@abtnode/blocklet-services 1.17.8-beta-20260106-113136-b3c09e14 → 1.17.8-beta-20260108-021819-e099f0ca

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 (214) hide show
  1. package/dist/assets/{AdapterDayjs-DafRMFLg.js → AdapterDayjs-C1bdndja.js} +1 -1
  2. package/dist/assets/{Google-DRu937I3.js → Google-JbLVL0lz.js} +1 -1
  3. package/dist/assets/{access-control-cgo5Z15_.js → access-control-DMsY0Jfu.js} +1 -1
  4. package/dist/assets/{actions-Dfiiwkit.js → actions-m1acuA78.js} +1 -1
  5. package/dist/assets/{add-component-core-BfzNEcS5.js → add-component-core-DXBsHpN1.js} +1 -1
  6. package/dist/assets/add-resource-B1owMSeP.js +1 -0
  7. package/dist/assets/{addon-qN24wAb4.js → addon-B42_QFF5.js} +1 -1
  8. package/dist/assets/{advanced-1Vu6rcXU.js → advanced-BnFynWN7.js} +1 -1
  9. package/dist/assets/{aigne-D6MrXXCU.js → aigne-Qq2FBVAW.js} +1 -1
  10. package/dist/assets/api-B24x7kOD.js +1 -0
  11. package/dist/assets/{appearance-DOQHBg9p.js → appearance-Dnc6HNzY.js} +1 -1
  12. package/dist/assets/{ar-BukCw0OI.js → ar-BHqjWgUQ.js} +2 -2
  13. package/dist/assets/{audit-logs-ISyoqJFp.js → audit-logs-Cfw8JmA4.js} +1 -1
  14. package/dist/assets/{authorize-B9RLEFal.js → authorize-B_1efpwx.js} +1 -1
  15. package/dist/assets/{base-chart-DhxjAyBU.js → base-chart-DT--nPCU.js} +1 -1
  16. package/dist/assets/{base32-_D4eWUeh.js → base32-r3F0yIbl.js} +1 -1
  17. package/dist/assets/{bind-account-CLIjYy96.js → bind-account-Cw-tBmC3.js} +1 -1
  18. package/dist/assets/{branding-iwUveEf5.js → branding-BxEmV2m2.js} +1 -1
  19. package/dist/assets/{branding-C81Kt22j.js → branding-CBavw5s2.js} +1 -1
  20. package/dist/assets/branding-CbYOEW_s.js +1 -0
  21. package/dist/assets/bundle-avatar-1zs0l21j.js +1 -0
  22. package/dist/assets/button-LwkniwV9.js +1 -0
  23. package/dist/assets/{click-to-copy-CMo42VnK.js → click-to-copy-Dk6ZAJOw.js} +1 -1
  24. package/dist/assets/{omit-CCIQ0Qdi.js → cloneDeep-rgNCMFod.js} +1 -1
  25. package/dist/assets/{collapse-B7gUzFaX.js → collapse-D72lnPa9.js} +1 -1
  26. package/dist/assets/{complete-CJ_buCAS.js → complete-CIQgRJri.js} +2 -2
  27. package/dist/assets/{component-Dip3v1Iq.js → component-qZAbczHw.js} +2 -2
  28. package/dist/assets/{config-D8XZj8JI.js → config-BaKRlJau.js} +2 -2
  29. package/dist/assets/{config-44sI5I0w.js → config-CoSaZVwp.js} +5 -5
  30. package/dist/assets/{config-D5KnWqfn.js → config-btuzRTop.js} +1 -1
  31. package/dist/assets/{config-navigation-Ni0iczgA.js → config-navigation-BNsZpUQd.js} +2 -2
  32. package/dist/assets/{config-space-B6_f52sE.js → config-space-BZQrckxG.js} +1 -1
  33. package/dist/assets/{confirm-Lb1MrAdS.js → confirm-D6AvlbAp.js} +1 -1
  34. package/dist/assets/connect-BC85oS0g.js +1 -0
  35. package/dist/assets/connect-Dv4BPfET.js +5 -0
  36. package/dist/assets/{connect-JAX_oP3o.js → connect-_I5q1wXN.js} +1 -1
  37. package/dist/assets/connect-to-CVH3cw77.js +1 -0
  38. package/dist/assets/{content-layout-DmSBGGVm.js → content-layout-Dtfb5X6M.js} +1 -1
  39. package/dist/assets/{create-passport-svg-5AYzBKFb.js → create-passport-svg-DeDfPZeD.js} +1 -1
  40. package/dist/assets/{createClass-DXYd7BIe.js → createClass-07c4wbGU.js} +1 -1
  41. package/dist/assets/{dashboard-C0l2IWWH.js → dashboard-BQgUp8NI.js} +2 -2
  42. package/dist/assets/{de-Br0tDZam.js → de-QUGQFv2K.js} +1 -1
  43. package/dist/assets/{delete-confirm-tbfLqDBI.js → delete-confirm-BLy-Oo1o.js} +1 -1
  44. package/dist/assets/{did-address-CsOJBoiY.js → did-address-Cq16cwTy.js} +1 -1
  45. package/dist/assets/{domain-CnhOsdmM.js → domain-BqtauLm5.js} +1 -1
  46. package/dist/assets/{domain-action-card-BsdHbhEi.js → domain-action-card-nuzd77mn.js} +2 -2
  47. package/dist/assets/domains-Cg8723ho.js +1 -0
  48. package/dist/assets/{email-Dt_DGuhf.js → email-CCNEyVGq.js} +2 -2
  49. package/dist/assets/{empty-spinner-BYDonf35.js → empty-spinner-BClWI15N.js} +1 -1
  50. package/dist/assets/engine-DOYgeVKF.js +1 -0
  51. package/dist/assets/{es-D_e0gGgp.js → es-C4w6cL07.js} +2 -2
  52. package/dist/assets/{exchange-passport-DztKvBat.js → exchange-passport-DR-pKNHM.js} +1 -1
  53. package/dist/assets/{form-DoC8uBcB.js → form-Bkig0Zr5.js} +3 -3
  54. package/dist/assets/{form-text-input-XjloVwBd.js → form-text-input-BsCymY_c.js} +1 -1
  55. package/dist/assets/{form-wrapper-PT5ZzMQy.js → form-wrapper-pwkkz4we.js} +1 -1
  56. package/dist/assets/{fr-DXizOT4b.js → fr-Bq3UipEu.js} +2 -2
  57. package/dist/assets/{fuel-IaJHNPPW.js → fuel-tC2bCgpP.js} +1 -1
  58. package/dist/assets/{gen-access-key-BJlDqEhI.js → gen-access-key-BbtCn0wJ.js} +1 -1
  59. package/dist/assets/{gen-simple-access-key-lyiUw0C-.js → gen-simple-access-key-DbKaLz9m.js} +1 -1
  60. package/dist/assets/get-safe-url-DxqVk96E.js +1 -0
  61. package/dist/assets/{hi-D2FEb_Tx.js → hi-DGZy0DLh.js} +2 -2
  62. package/dist/assets/{home-Bs_5YPbK.js → home-BdXWvJM-.js} +1 -1
  63. package/dist/assets/{id-Dw9URVwP.js → id-DOzDilAf.js} +2 -2
  64. package/dist/assets/{iframe-Dqu4MSyW.js → iframe-BHP6CYbe.js} +1 -1
  65. package/dist/assets/{index-B_SjLIbT.js → index-5IYIk-ZG.js} +5 -5
  66. package/dist/assets/{index-TYwJnR0n.js → index-B0O4cfgn.js} +6 -6
  67. package/dist/assets/{index-B9LF8Bep.js → index-B3RkYGd7.js} +1 -1
  68. package/dist/assets/{index-Cq6z7yeF.js → index-B7hLDto7.js} +4 -4
  69. package/dist/assets/{index-1HKgA-fz.js → index-BB8sYq-N.js} +1 -1
  70. package/dist/assets/{index-CQgzjKgB.js → index-BEfIUbZC.js} +98 -98
  71. package/dist/assets/{index-dbYkWwF4.js → index-BGo7DXlf.js} +1 -1
  72. package/dist/assets/{index-BkePHcyK.js → index-BHnD9G0G.js} +7 -7
  73. package/dist/assets/{index-DT5AXPVB.js → index-BPZITdMW.js} +7 -7
  74. package/dist/assets/{index-BWDWEkUF.js → index-BSZ3mQac.js} +2 -2
  75. package/dist/assets/{index-DhHvANH8.js → index-BasnkqHA.js} +4 -4
  76. package/dist/assets/{index-vP1T6V7V.js → index-BbSDwNE6.js} +4 -4
  77. package/dist/assets/index-Bm1VCAzZ.js +81 -0
  78. package/dist/assets/{index-B4YCnemd.js → index-BnOC3Ium.js} +1 -1
  79. package/dist/assets/index-BoLm67SH.js +1 -0
  80. package/dist/assets/{index-B7_VUEoc.js → index-BrDWLIA2.js} +1 -1
  81. package/dist/assets/{index-G6Vk78zE.js → index-Bv2O-NCZ.js} +2 -2
  82. package/dist/assets/{index-BhhZ8IDZ.js → index-BvB9yPsA.js} +9 -9
  83. package/dist/assets/{index-Dfx19arA.js → index-C96Fw4Lj.js} +1 -1
  84. package/dist/assets/{index-BNhv-9xy.js → index-CNGNZ6kv.js} +1 -1
  85. package/dist/assets/{index-BsohFwTm.js → index-CaQuyP_U.js} +1 -1
  86. package/dist/assets/{index-DctZHPFL.js → index-Cvt4JvUl.js} +1 -1
  87. package/dist/assets/{index-CRAuhYSg.js → index-D-O_eFad.js} +1 -1
  88. package/dist/assets/{index-B6DWjLJS.js → index-D320ZZ3W.js} +8 -8
  89. package/dist/assets/index-D3L_FG1K.js +1 -0
  90. package/dist/assets/{index-B4KKUWng.js → index-DTdf57JC.js} +1 -1
  91. package/dist/assets/{index-BSZtxRM0.js → index-DUL9RfTo.js} +2 -2
  92. package/dist/assets/{index-B10SG1vs.js → index-DVrxzIzr.js} +1 -1
  93. package/dist/assets/{index-BDH_LtJL.js → index-DixUQBnm.js} +1 -1
  94. package/dist/assets/{index-Cp0b8q3A.js → index-KUC3HPt0.js} +1 -1
  95. package/dist/assets/{index-CRZM3CKo.js → index-Ly6A31IO.js} +1 -1
  96. package/dist/assets/{index-BWL6HE0j.js → index-dC2vB2_g.js} +1 -1
  97. package/dist/assets/{index-B0Q9wWG1.js → index-oucqu2vy.js} +1 -1
  98. package/dist/assets/{index-BGhqVqit.js → index-yvRJAzQn.js} +1 -1
  99. package/dist/assets/info-outline-rounded-YiCh4oGg.js +1 -0
  100. package/dist/assets/{invitation-CYFN9u5t.js → invitation-CnuNtRnn.js} +4 -4
  101. package/dist/assets/{invitations-jY13RXbI.js → invitations-D_3NLIPO.js} +1 -1
  102. package/dist/assets/{invite-D72FvaiG.js → invite-CUVHQCSI.js} +1 -1
  103. package/dist/assets/{isURL-CJRImg0N.js → isURL-vNa-ZfGd.js} +1 -1
  104. package/dist/assets/{issue-passport-BfqkJF3W.js → issue-passport-Do2LhI-f.js} +1 -1
  105. package/dist/assets/{item-5ZWPft2s.js → item-BabsiwzU.js} +1 -1
  106. package/dist/assets/{ja-DBxpsmGJ.js → ja-DMq-YXDX.js} +2 -2
  107. package/dist/assets/{ko-CCAdSyce.js → ko-BrYbXurh.js} +2 -2
  108. package/dist/assets/{landing-page-DRtId3hN.js → landing-page-B5QvkHHO.js} +1 -1
  109. package/dist/assets/{launch-result-message-MNpx7ysR.js → launch-result-message-C04PaKk0.js} +1 -1
  110. package/dist/assets/{layout-Be1KH57_.js → layout-DRVZ4L0D.js} +1 -1
  111. package/dist/assets/{list-CQtiNSih.js → list-B22ZyQqz.js} +1 -1
  112. package/dist/assets/{list-CHI1rCEg.js → list-BbHzj-7w.js} +2 -2
  113. package/dist/assets/{list-header-Cl3jykCe.js → list-header-wJF4c6BN.js} +1 -1
  114. package/dist/assets/localization-BFHoFo4B.js +1 -0
  115. package/dist/assets/{log-BfCFT05M.js → log-BigiLZw2.js} +1 -1
  116. package/dist/assets/logger-DhW79f4a.js +1 -0
  117. package/dist/assets/{login-BtsH3IvI.js → login-DeBY1fPe.js} +1 -1
  118. package/dist/assets/{login-oauth-callback-Ds4uYiRr.js → login-oauth-callback-Du-bMipe.js} +1 -1
  119. package/dist/assets/{logo-uploader-lepUW_D7.js → logo-uploader-DEFzQY0j.js} +1 -1
  120. package/dist/assets/{lost-passport-BtN3h1ya.js → lost-passport-DkN5GdCK.js} +1 -1
  121. package/dist/assets/omit-BeaKJrg9.js +1 -0
  122. package/dist/assets/{open-window-CNt8gsrN.js → open-window-CdadJ5vo.js} +1 -1
  123. package/dist/assets/{over-due-invoice-payment-7TbnqqKX.js → over-due-invoice-payment-CXZ42RZu.js} +1 -1
  124. package/dist/assets/{overview-Be3tncsL.js → overview-a9TXaGnH.js} +1 -1
  125. package/dist/assets/{page-header-CHAwrgX-.js → page-header-BZv-tfgN.js} +1 -1
  126. package/dist/assets/passport-C_PAxd9K.js +1 -0
  127. package/dist/assets/{passport-item-Bhbm8_m6.js → passport-item-BudJHbYX.js} +1 -1
  128. package/dist/assets/{permission-BHvrn0M5.js → permission-CeqEAPPT.js} +1 -1
  129. package/dist/assets/preferences-ixUbb8gE.js +1 -0
  130. package/dist/assets/profile-embed-BIwa1Yt3.js +1 -0
  131. package/dist/assets/{provider-icon-DQY2_LaP.js → provider-icon-CkqIY6iX.js} +1 -1
  132. package/dist/assets/{pt-CrMGrBZ6.js → pt-Dl6732JN.js} +2 -2
  133. package/dist/assets/publish-resource-BpvxLOlV.js +1 -0
  134. package/dist/assets/{react-beautiful-dnd.esm-D0JKrMDl.js → react-beautiful-dnd.esm-BwIgGfYj.js} +1 -1
  135. package/dist/assets/{react-stripe.esm-CVZErl8X.js → react-stripe.esm-5Snjx_mn.js} +1 -1
  136. package/dist/assets/{required-BQln5OcV.js → required-DHjZE3-Y.js} +1 -1
  137. package/dist/assets/{ru-up3R57Pv.js → ru-CVUeN9AX.js} +2 -2
  138. package/dist/assets/{runtime-npJC4gp_.js → runtime-TkU2snTc.js} +1 -1
  139. package/dist/assets/{sanitize-C-shWbtD.js → sanitize-yX1j-ggS.js} +1 -1
  140. package/dist/assets/sdk-CMvNWVGa.js +1 -0
  141. package/dist/assets/{section-jXB9AxBb.js → section-CenHBXqj.js} +1 -1
  142. package/dist/assets/{security-nSKpCl8B.js → security-Dw0iwARQ.js} +3 -3
  143. package/dist/assets/{session-C2ZBRIpv.js → session-Cin9Rizr.js} +1 -1
  144. package/dist/assets/{setup-krkSJpAg.js → setup-Daw0Bdkr.js} +1 -1
  145. package/dist/assets/{shorten-label-C4py9TLA.js → shorten-label-DXFyDHDr.js} +1 -1
  146. package/dist/assets/{simple-select-i16Vwzvl.js → simple-select-DtCsUIHR.js} +1 -1
  147. package/dist/assets/{spaces-BdZ_Rv3s.js → spaces-DghHe7uP.js} +1 -1
  148. package/dist/assets/{start-y3zrboBQ.js → start-SLdZOtVD.js} +4 -4
  149. package/dist/assets/{starting-progress-DI-J-VlX.js → starting-progress-BiI8hmaj.js} +1 -1
  150. package/dist/assets/{status-B8pB_mTB.js → status-DRNtY6SL.js} +1 -1
  151. package/dist/assets/{step-actions-B1ufIDaK.js → step-actions-Cb6B0FCJ.js} +1 -1
  152. package/dist/assets/{studio-1jwq0HOw.js → studio-CVfdma-R.js} +1 -1
  153. package/dist/assets/{switch-CetbUrYR.js → switch-C49IloVU.js} +1 -1
  154. package/dist/assets/{switch-control-_85hc9FG.js → switch-control-npfWE_aC.js} +1 -1
  155. package/dist/assets/{table-tips-CMt22HEy.js → table-tips-DMrnJF8e.js} +1 -1
  156. package/dist/assets/{team-DDjNXwXE.js → team-DkV63Yjl.js} +8 -8
  157. package/dist/assets/{th-DdNj2Ao6.js → th-32eBNQes.js} +2 -2
  158. package/dist/assets/{traffic-mcbpWOFq.js → traffic-C8BReAMz.js} +1 -1
  159. package/dist/assets/{transfer-C66c3bWd.js → transfer-Dt4V38KL.js} +1 -1
  160. package/dist/assets/{unsubscribe-Cvz0OKhq.js → unsubscribe-rCcvC6Dj.js} +1 -1
  161. package/dist/assets/{use-app-logo-BuyF983S.js → use-app-logo-DnCfhAzv.js} +1 -1
  162. package/dist/assets/{use-mobile-BINJTzMb.js → use-mobile-Bz2ML4Gk.js} +1 -1
  163. package/dist/assets/{use-mobile-D5clNlrm.js → use-mobile-_vjPRYx2.js} +1 -1
  164. package/dist/assets/{use-server-logo-Pbr_UuiI.js → use-server-logo-Da86xnyt.js} +1 -1
  165. package/dist/assets/{use-window-close-B16QghYq.js → use-window-close-DUJmRIjM.js} +1 -1
  166. package/dist/assets/{useAsync-BVTh1KYj.js → useAsync-D0xh4Var.js} +1 -1
  167. package/dist/assets/{useAsync-ZGLJQow7.js → useAsync-D6IP8T2e.js} +1 -1
  168. package/dist/assets/{useAsyncRetry-BMmRgSGm.js → useAsyncRetry-B_bXUXWM.js} +1 -1
  169. package/dist/assets/{useLocalStorage-De-EuH_M.js → useLocalStorage-Brr2PSz9.js} +1 -1
  170. package/dist/assets/{user-center-DQSoqc_z.js → user-center-Cnc61do7.js} +6 -6
  171. package/dist/assets/{user-follower-TTyja_sV.js → user-follower-Cc2pWcSL.js} +1 -1
  172. package/dist/assets/{util-DuMKfKo8.js → util-BgLSp_5A.js} +1 -1
  173. package/dist/assets/{util-Ff3hwYmy.js → util-CMCJQTXJ.js} +1 -1
  174. package/dist/assets/{vendor-arcblock-Cnwtqa7s.js → vendor-arcblock-BCP2x3BR.js} +1 -1
  175. package/dist/assets/{vendor-hooks-BQWlJm53.js → vendor-hooks-DQAdyHrE.js} +1 -1
  176. package/dist/assets/{vendor-mui-core-DnR6WYuU.js → vendor-mui-core-CKKG_1TN.js} +2 -2
  177. package/dist/assets/{vendor-mui-x-CQc01l4r.js → vendor-mui-x-DHGvg6Bj.js} +1 -1
  178. package/dist/assets/{vendor-utils-DCMKu06e.js → vendor-utils-CUs2ebe7.js} +17 -17
  179. package/dist/assets/{vendor-ux-B0gV9NvH.js → vendor-ux-DjXlxcvL.js} +115 -115
  180. package/dist/assets/{vi-HNh41Xxk.js → vi-DF8IinAc.js} +2 -2
  181. package/dist/assets/{wait-connect-CRZmfXOA.js → wait-connect-TKbZWSFd.js} +1 -1
  182. package/dist/assets/{wizard-B41kI39b.js → wizard-BSaM_cSr.js} +1 -1
  183. package/dist/assets/wizard-components-BOHnkwWH.js +52 -0
  184. package/dist/assets/wrap-locale-CFhaO2KZ.js +1 -0
  185. package/dist/assets/{zh-MM5bvwO_.js → zh-ByJkLAV1.js} +2 -2
  186. package/dist/assets/{zh-BmX_fuoi.js → zh-DG89vJJ6.js} +1 -1
  187. package/dist/assets/{zh-tw-Dr5DyPwA.js → zh-tw-34G9tsUP.js} +2 -2
  188. package/dist/index.html +1 -1
  189. package/package.json +44 -44
  190. package/dist/assets/add-resource-CYRgZ1ps.js +0 -1
  191. package/dist/assets/api-DwxIBXZs.js +0 -1
  192. package/dist/assets/branding-myiZl37D.js +0 -1
  193. package/dist/assets/bundle-avatar-Cc_6nw01.js +0 -1
  194. package/dist/assets/button-D-lyR9BW.js +0 -1
  195. package/dist/assets/cloneDeep-BY8zW7hH.js +0 -1
  196. package/dist/assets/connect-0OZVqJvc.js +0 -1
  197. package/dist/assets/connect-B9GQZEi7.js +0 -5
  198. package/dist/assets/connect-to-Djgj6TLg.js +0 -1
  199. package/dist/assets/domains-DRP2VSvO.js +0 -1
  200. package/dist/assets/engine-BXGX_w-S.js +0 -1
  201. package/dist/assets/get-safe-url-BiNPujaX.js +0 -1
  202. package/dist/assets/index-BmXPp3DU.js +0 -1
  203. package/dist/assets/index-CI_uwh_J.js +0 -81
  204. package/dist/assets/index-CbiyJRV7.js +0 -1
  205. package/dist/assets/info-outline-rounded-BIwvgXCK.js +0 -1
  206. package/dist/assets/localization-CKE-bHgd.js +0 -1
  207. package/dist/assets/logger-DU7baop2.js +0 -1
  208. package/dist/assets/passport-CkJ4B4CG.js +0 -1
  209. package/dist/assets/preferences-TFWtUYLy.js +0 -1
  210. package/dist/assets/profile-embed-B9f9hlSS.js +0 -1
  211. package/dist/assets/publish-resource-CyvkVMG_.js +0 -1
  212. package/dist/assets/sdk-CoWDgSLO.js +0 -1
  213. package/dist/assets/wizard-components-Bn72hVOe.js +0 -52
  214. package/dist/assets/wrap-locale-CF46rj6q.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DnR6WYuU.js";import{r as h}from"./vendor-react-CTtPmzVP.js";import{b8 as S,F as p}from"./vendor-ux-B0gV9NvH.js";import{a as C}from"./page-header-CHAwrgX-.js";import{Y as g}from"./index-CQgzjKgB.js";import{o as b}from"./vendor-arcblock-Cnwtqa7s.js";import{u as k}from"./config-space-B6_f52sE.js";import{C as y,D as v,a as w}from"./connect-to-Djgj6TLg.js";import{S as c}from"./step-actions-B1ufIDaK.js";import{S as E}from"./layout-Be1KH57_.js";import"./vendor-utils-DCMKu06e.js";import"./vendor-hooks-BQWlJm53.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BdZ_Rv3s.js";import"./api-DwxIBXZs.js";import"./index-BNhv-9xy.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-1HKgA-fz.js";import"./index-DBs9Ljax.js";import"./use-mobile-D5clNlrm.js";import"./content-layout-DmSBGGVm.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
1
+ import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-CKKG_1TN.js";import{r as h}from"./vendor-react-CTtPmzVP.js";import{b9 as S,F as p}from"./vendor-ux-DjXlxcvL.js";import{a as C}from"./page-header-BZv-tfgN.js";import{Y as g}from"./index-BEfIUbZC.js";import{o as b}from"./vendor-arcblock-BCP2x3BR.js";import{u as k}from"./config-space-BZQrckxG.js";import{C as y,D as v,a as w}from"./connect-to-CVH3cw77.js";import{S as c}from"./step-actions-Cb6B0FCJ.js";import{S as E}from"./layout-DRVZ4L0D.js";import"./vendor-utils-CUs2ebe7.js";import"./vendor-hooks-DQAdyHrE.js";import"./lottie-web-4koyQiv_.js";import"./spaces-DghHe7uP.js";import"./api-B24x7kOD.js";import"./index-CNGNZ6kv.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-BB8sYq-N.js";import"./index-DBs9Ljax.js";import"./use-mobile-Bz2ML4Gk.js";import"./content-layout-Dtfb5X6M.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  `;export{T as default};
@@ -1,4 +1,4 @@
1
- import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-core-DnR6WYuU.js";import{r as N}from"./vendor-react-CTtPmzVP.js";import{l as b,b0 as H,V as W,m as V,k as Y}from"./vendor-ux-B0gV9NvH.js";import{aY as P,bh as G,bi as J,bj as O,k as K,bk as Q,ae as U,a4 as X,aa as Z,a5 as M,a7 as ee}from"./index-CQgzjKgB.js";import{ag as ne,h as oe,D as te}from"./vendor-utils-DCMKu06e.js";import{a as ie}from"./vendor-hooks-BQWlJm53.js";function L({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=N.isValidElement(t)?t:o.jsx("img",{src:t,alt:e});return o.jsxs(re,{...p,children:[o.jsxs("div",{children:[t&&o.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&o.jsx("div",{className:"footer-brand-name",children:e})]}),i&&o.jsx("div",{className:"footer-brand-desc",children:i})]})}L.propTypes={name:n.node,logo:n.node,description:n.string};const re=b("div")`
1
+ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-core-CKKG_1TN.js";import{r as N}from"./vendor-react-CTtPmzVP.js";import{l as b,b1 as H,V as W,m as V,k as Y}from"./vendor-ux-DjXlxcvL.js";import{aY as P,bh as G,bi as J,bj as O,k as K,bk as Q,ae as U,a4 as X,aa as Z,a5 as M,a7 as ee}from"./index-BEfIUbZC.js";import{ah as ne,h as oe,E as te}from"./vendor-utils-CUs2ebe7.js";import{a as ie}from"./vendor-hooks-DQAdyHrE.js";function E({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=N.isValidElement(t)?t:o.jsx("img",{src:t,alt:e});return o.jsxs(re,{...p,children:[o.jsxs("div",{children:[t&&o.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&o.jsx("div",{className:"footer-brand-name",children:e})]}),i&&o.jsx("div",{className:"footer-brand-desc",children:i})]})}E.propTypes={name:n.node,logo:n.node,description:n.string};const re=b("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  font-size: 14px;
@@ -45,7 +45,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
45
45
  }
46
46
  }
47
47
  }
48
- `;function T({links:e=[],flowLayout:t=!1,minColumns:i=1,maxColumns:p=4,...c}){const[d,m]=N.useState(-1),x=P({key:"md"}),j=e.some(s=>s.items?.length),h=!x&&j&&ne(i)&&i>1&&p>=i,w=h?Math.min(Math.max(e.length,i),p):1,g=({label:s,link:r,icon:l,render:a,props:u})=>{let k=s;if(a)k=a({label:s,link:r,props:u});else if(r&&oe(r)){const C=r.startsWith("http")||r.startsWith("//"),I=J(r)?{}:{target:C?"_blank":"_self",rel:C?"noreferrer noopener":void 0};k=o.jsx("a",{href:r,"aria-label":`Footer link for ${s}`,...I,...u,children:s})}return o.jsxs(o.Fragment,{children:[l&&o.jsx(O,{icon:l,size:20,sx:{mr:.5}}),k]})},$=ie(()=>e?.length?t?e.map((s,r)=>o.jsx("span",{className:"footer-links-item",children:g(s)},r)):h?G(e,{columns:w}).map((s,r)=>o.jsx("div",{className:"footer-links-column",children:s.filter(l=>l.group).map((l,a)=>{const{items:u}=l;return o.jsxs("div",{className:"footer-links-group",children:[o.jsx("span",{className:"footer-links-item",children:g(l)}),!!u?.length&&o.jsx("div",{className:"footer-links-sub",children:u.map((k,C)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":k.isNew}),children:g(k)},C))})]},a)})},r)):e.map((s,r)=>{const{items:l}=s,a=r===d;return o.jsxs("div",{className:y("footer-links-group",{"footer-links-group--active":a}),onClick:()=>m(d===r?-1:r),children:[o.jsxs("span",{className:"footer-links-item",children:[g(s),!!l?.length&&o.jsx("span",{className:"footer-links-group-expand-icon",children:o.jsx(A,{style:{transform:`rotate(${a?180:0}deg)`}})})]}),!!l?.length&&o.jsx("div",{className:"footer-links-sub",children:l.map((u,k)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":u.isNew}),children:g(u)},k))})]},r)}):null,[e,t,h,d]);return e?.length?o.jsx(se,{columns:w,...c,className:y(c.className,{"footer-links--grouped":j,"footer-links--flow":t,"footer-links--columns":h}),children:o.jsx("div",{className:"footer-links-inner",children:$})}):null}T.propTypes={links:n.arrayOf(n.shape({label:n.string,link:n.string,render:n.func,props:n.object})),flowLayout:n.bool,minColumns:n.number,maxColumns:n.number};const se=b("div",{shouldForwardProp:e=>e!=="columns"})`
48
+ `;function T({links:e=[],flowLayout:t=!1,minColumns:i=1,maxColumns:p=4,...c}){const[d,m]=N.useState(-1),x=P({key:"md"}),j=e.some(s=>s.items?.length),g=!x&&j&&ne(i)&&i>1&&p>=i,w=g?Math.min(Math.max(e.length,i),p):1,h=({label:s,link:r,icon:l,render:a,props:u})=>{let k=s;if(a)k=a({label:s,link:r,props:u});else if(r&&oe(r)){const C=r.startsWith("http")||r.startsWith("//"),I=J(r)?{}:{target:C?"_blank":"_self",rel:C?"noreferrer noopener":void 0};k=o.jsx("a",{href:r,"aria-label":`Footer link for ${s}`,...I,...u,children:s})}return o.jsxs(o.Fragment,{children:[l&&o.jsx(O,{icon:l,size:20,sx:{mr:.5}}),k]})},$=ie(()=>e?.length?t?e.map((s,r)=>o.jsx("span",{className:"footer-links-item",children:h(s)},r)):g?G(e,{columns:w}).map((s,r)=>o.jsx("div",{className:"footer-links-column",children:s.filter(l=>l.group).map((l,a)=>{const{items:u}=l;return o.jsxs("div",{className:"footer-links-group",children:[o.jsx("span",{className:"footer-links-item",children:h(l)}),!!u?.length&&o.jsx("div",{className:"footer-links-sub",children:u.map((k,C)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":k.isNew}),children:h(k)},C))})]},a)})},r)):e.map((s,r)=>{const{items:l}=s,a=r===d;return o.jsxs("div",{className:y("footer-links-group",{"footer-links-group--active":a}),onClick:()=>m(d===r?-1:r),children:[o.jsxs("span",{className:"footer-links-item",children:[h(s),!!l?.length&&o.jsx("span",{className:"footer-links-group-expand-icon",children:o.jsx(A,{style:{transform:`rotate(${a?180:0}deg)`}})})]}),!!l?.length&&o.jsx("div",{className:"footer-links-sub",children:l.map((u,k)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":u.isNew}),children:h(u)},k))})]},r)}):null,[e,t,g,d]);return e?.length?o.jsx(se,{columns:w,...c,className:y(c.className,{"footer-links--grouped":j,"footer-links--flow":t,"footer-links--columns":g}),children:o.jsx("div",{className:"footer-links-inner",children:$})}):null}T.propTypes={links:n.arrayOf(n.shape({label:n.string,link:n.string,render:n.func,props:n.object})),flowLayout:n.bool,minColumns:n.number,maxColumns:n.number};const se=b("div",{shouldForwardProp:e=>e!=="columns"})`
49
49
  overflow: hidden;
50
50
  color: ${({theme:e})=>e.palette.text.secondary};
51
51
  .footer-links-inner {
@@ -194,7 +194,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
194
194
  }
195
195
  }
196
196
  }
197
- `;function D({items:e=null,...t}){return e?.length?o.jsx(le,{...t,children:e.map((i,p)=>o.jsx("a",{href:i.link,target:"_blank","aria-label":`Social media icon${i.title?` for ${i.title}`:""}`,rel:"noreferrer",children:o.jsx(O,{icon:i.icon||i.title,size:24,component:"span"})},p))}):null}D.propTypes={items:n.arrayOf(n.shape({icon:n.string,link:n.string}))};const le=b("div")`
197
+ `;function L({items:e=null,...t}){return e?.length?o.jsx(le,{...t,children:e.map((i,p)=>o.jsx("a",{href:i.link,target:"_blank","aria-label":`Social media icon${i.title?` for ${i.title}`:""}`,rel:"noreferrer",children:o.jsx(O,{icon:i.icon||i.title,size:24,component:"span"})},p))}):null}L.propTypes={items:n.arrayOf(n.shape({icon:n.string,link:n.string}))};const le=b("div")`
198
198
  display: inline-flex;
199
199
  flex-wrap: wrap;
200
200
  align-items: center;
@@ -211,7 +211,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
211
211
  ${e=>e.theme.breakpoints.down("md")} {
212
212
  gap: 12px;
213
213
  }
214
- `;function E({owner:e="ArcBlock",year:t=`${new Date().getFullYear()}`,...i}){return o.jsxs(ae,{...i,children:["Copyright © ",t," ",e]})}E.propTypes={owner:n.string,year:n.string};const ae=b("p")`
214
+ `;function F({owner:e="ArcBlock",year:t=`${new Date().getFullYear()}`,...i}){return o.jsxs(ae,{...i,children:["Copyright © ",t," ",e]})}F.propTypes={owner:n.string,year:n.string};const ae=b("p")`
215
215
  display: flex;
216
216
  align-items: center;
217
217
  margin: 0;
@@ -237,7 +237,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
237
237
  margin: 0 auto;
238
238
  }
239
239
  }
240
- `;function F({elements:e,data:t,className:i="",...p}){const c=!!t.navigation?.length;let d=null;return c?d=o.jsxs(v,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between"},children:[o.jsxs(f,{sx:{flex:"1 1 auto",paddingRight:{xs:0,md:3},display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2,pb:3},children:[o.jsx(f,{children:e.brand}),o.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),o.jsx(f,{sx:({palette:m})=>({mb:3,borderTop:{xs:`1px solid ${m.grey[200]}`,md:0}}),children:e.navigation})]}):d=o.jsxs(v,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:"space-between",gap:2,pb:3},children:[o.jsx(f,{children:e.brand}),o.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),o.jsx(ce,{...p,className:y({"footer--with-navs":c},i),children:o.jsxs(v,{style:{padding:0},children:[d,o.jsx(f,{sx:{pt:3,borderTop:1,borderColor:"divider"}}),o.jsx(v,{children:o.jsxs(z,{autoCenter:!0,children:[e.copyright,e.links]})})]})})}F.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired,className:n.string};const ce=b("div")`
240
+ `;function _({elements:e,data:t,className:i="",...p}){const c=!!t.navigation?.length;let d=null;return c?d=o.jsxs(v,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between"},children:[o.jsxs(f,{sx:{flex:"1 1 auto",paddingRight:{xs:0,md:3},display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2,pb:3},children:[o.jsx(f,{children:e.brand}),o.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),o.jsx(f,{sx:({palette:m})=>({mb:3,borderTop:{xs:`1px solid ${m.grey[200]}`,md:0}}),children:e.navigation})]}):d=o.jsxs(v,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:"space-between",gap:2,pb:3},children:[o.jsx(f,{children:e.brand}),o.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),o.jsx(ce,{...p,className:y({"footer--with-navs":c},i),children:o.jsxs(v,{style:{padding:0},children:[d,o.jsx(f,{sx:{pt:3,borderTop:1,borderColor:"divider"}}),o.jsx(v,{children:o.jsxs(z,{autoCenter:!0,children:[e.copyright,e.links]})})]})})}_.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired,className:n.string};const ce=b("div")`
241
241
  padding: 32px 0 24px 0;
242
242
  .footer-brand-name,
243
243
  .footer-brand-desc {
@@ -254,7 +254,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
254
254
  && .footer-brand-logo {
255
255
  margin-right: 0;
256
256
  }
257
- `;function _({elements:e,data:t,...i}){return o.jsx(de,{...i,children:o.jsx(v,{style:{padding:0},children:o.jsxs(v,{className:"plain-layout-container",children:[e.links&&o.jsxs(z,{sx:{width:1},autoCenter:!0,children:[e.copyright,e.links]}),!e.links&&o.jsxs(o.Fragment,{children:[N.cloneElement(e.brand,{name:null,description:null}),e.copyright]})]})})})}_.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired};const de=b("div")`
257
+ `;function D({elements:e,data:t,...i}){return o.jsx(de,{...i,children:o.jsx(v,{style:{padding:0},children:o.jsxs(v,{className:"plain-layout-container",children:[e.links&&o.jsxs(z,{sx:{width:1},autoCenter:!0,children:[e.copyright,e.links]}),!e.links&&o.jsxs(o.Fragment,{children:[N.cloneElement(e.brand,{name:null,description:null}),e.copyright]})]})})})}D.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired};const de=b("div")`
258
258
  padding: 24px 0;
259
259
  .plain-layout-container {
260
260
  display: flex;
@@ -263,7 +263,7 @@ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-cor
263
263
  flex-wrap: wrap;
264
264
  gap: 8px;
265
265
  }
266
- `,R=[{name:"plain",support:(e,t)=>!t.navigation?.length&&!t.socialMedia?.length,component:_},{name:"standard",support:()=>!0,component:F}],me=R.reduce((e,t)=>({...e,[t.name]:t}),{});function S({...e}){const{brand:t=null,navigation:i=null,socialMedia:p=null,copyright:c=null,links:d=null,layout:m="auto",...x}=e,j=()=>t?o.jsx(L,{...t}):null,h=()=>i?.length?o.jsx(T,{links:i,minColumns:3}):null,w=()=>p?.length?o.jsx(D,{items:p}):null,g=()=>{const l=c?.owner||t?.name;return l?o.jsx(E,{owner:l,year:c?.year||void 0}):null},$=()=>d?.length?o.jsx(T,{flowLayout:!0,links:d}):null,s={brand:j(),navigation:h(),socialMedia:w(),copyright:g(),links:$()};let r=null;if(m==="auto"?r=R.find(l=>l.support(s,e)).component:r=me[m]?.component,!r)throw new Error(`layout ${m} is not supported.`);return o.jsxs(f,{...x,className:y("blocklet__footer",x.className),sx:[{position:"relative"},...Array.isArray(x.sx)?x.sx:[x.sx]],children:[o.jsx(r,{elements:s,data:e}),o.jsx(f,{sx:{position:"absolute",right:16,bottom:0,fontSize:12,color:"transparent","::selection":{background:"#000",color:"#fff"}},children:window?.blocklet?.version})]})}S.propTypes={brand:n.shape({name:n.node,description:n.string,logo:n.node}),navigation:n.arrayOf(n.shape({label:n.node,link:n.string})),socialMedia:n.arrayOf(n.shape({icon:n.node,link:n.string})),copyright:n.shape({owner:n.string,year:n.oneOfType([n.string,n.number])}),links:n.arrayOf(n.shape({label:n.node,link:n.string})),layout:n.oneOf(["auto","standard","plain"])};function q({meta:e={},theme:t={},...i}){const{locale:p,defaultLocale:c}=W()||{},d=B(),m=N.useMemo(()=>{const a=Object.assign({},window.blocklet,e);try{return X(a)}catch(u){return console.error("Failed to format blocklet info",u,a),a}},[e]),x=N.useMemo(()=>V(d,t),[d,t]),j=Z({key:"xs",meta:e,theme:t});if(!m.appName)return null;const{appName:h,appDescription:w,description:g,copyright:$}=m,s=x.palette.background.default,r={footerNav:M({navigation:m?.navigation?.footer,locale:p,defaultLocale:c,section:"footer"})||[],socialMedia:M({navigation:m?.navigation?.social,locale:p,defaultLocale:c,section:"footer"})||[],links:M({navigation:m?.navigation?.bottom,locale:p,defaultLocale:c,section:"footer"})||[]},l={brand:{name:h,description:w||g,logo:j},navigation:ee(r.footerNav,a=>({...a,label:a.title,link:a.link}),"items"),copyright:$,socialMedia:r.socialMedia,links:r.links.map(a=>({...a,label:a.title}))};return o.jsx(Y,{theme:x,children:o.jsx(fe,{...l,...te(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}q.propTypes={meta:U,theme:n.object};const fe=b(S)`
266
+ `,R=[{name:"plain",support:(e,t)=>!t.navigation?.length&&!t.socialMedia?.length,component:D},{name:"standard",support:()=>!0,component:_}],me=R.reduce((e,t)=>({...e,[t.name]:t}),{});function S({...e}){const{brand:t=null,navigation:i=null,socialMedia:p=null,copyright:c=null,links:d=null,layout:m="auto",...x}=e,j=()=>t?o.jsx(E,{...t}):null,g=()=>i?.length?o.jsx(T,{links:i,minColumns:3}):null,w=()=>p?.length?o.jsx(L,{items:p}):null,h=()=>{const l=c?.owner||t?.name;return l?o.jsx(F,{owner:l,year:c?.year||void 0}):null},$=()=>d?.length?o.jsx(T,{flowLayout:!0,links:d}):null,s={brand:j(),navigation:g(),socialMedia:w(),copyright:h(),links:$()};let r=null;if(m==="auto"?r=R.find(l=>l.support(s,e)).component:r=me[m]?.component,!r)throw new Error(`layout ${m} is not supported.`);return o.jsxs(f,{...x,className:y("blocklet__footer",x.className),sx:[{position:"relative"},...Array.isArray(x.sx)?x.sx:[x.sx]],children:[o.jsx(r,{elements:s,data:e}),o.jsx(f,{sx:{position:"absolute",right:16,bottom:0,fontSize:12,color:"transparent","::selection":{background:"#000",color:"#fff"}},children:window?.blocklet?.version})]})}S.propTypes={brand:n.shape({name:n.node,description:n.string,logo:n.node}),navigation:n.arrayOf(n.shape({label:n.node,link:n.string})),socialMedia:n.arrayOf(n.shape({icon:n.node,link:n.string})),copyright:n.shape({owner:n.string,year:n.oneOfType([n.string,n.number])}),links:n.arrayOf(n.shape({label:n.node,link:n.string})),layout:n.oneOf(["auto","standard","plain"])};function q({meta:e={},theme:t={},...i}){const{locale:p,defaultLocale:c}=W()||{},d=B(),m=N.useMemo(()=>{const a=Object.assign({},window.blocklet,e);try{return X(a)}catch(u){return console.error("Failed to format blocklet info",u,a),a}},[e]),x=N.useMemo(()=>V(d,t),[d,t]),j=Z({key:"xs",meta:e,theme:t});if(!m.appName)return null;const{appName:g,appDescription:w,description:h,copyright:$}=m,s=x.palette.background.default,r={footerNav:M({navigation:m?.navigation?.footer,locale:p,defaultLocale:c,section:"footer"})||[],socialMedia:M({navigation:m?.navigation?.social,locale:p,defaultLocale:c,section:"footer"})||[],links:M({navigation:m?.navigation?.bottom,locale:p,defaultLocale:c,section:"footer"})||[]},l={brand:{name:g,description:w||h,logo:j},navigation:ee(r.footerNav,a=>({...a,label:a.title,link:a.link}),"items"),copyright:$,socialMedia:r.socialMedia,links:r.links.map(a=>({...a,label:a.title}))};return o.jsx(Y,{theme:x,children:o.jsx(fe,{...l,...te(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}q.propTypes={meta:U,theme:n.object};const fe=b(S)`
267
267
  ${({$bordered:e,theme:t})=>`border-top: 1px solid ${e&&t.palette.divider};`}
268
268
  color: ${({theme:e})=>e.palette.text.secondary};
269
269
  ${({$bgcolor:e})=>e&&`background-color: ${e};`}
@@ -1,4 +1,4 @@
1
- import{r as b,g as _e,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p as V}from"./vendor-hooks-BQWlJm53.js";import{j as e,ak as t,at as $,b6 as K,a6 as F,aZ as Ue,am as G,br as He,U as Ge,T as E,a3 as Ke,W as S,z as O,M as J,I as W,dZ as ge,bi as je,A as Ye,x as Ze,cs as Ve,ct as ee,ca as Je,F as Qe,bZ as Xe,s as es}from"./vendor-mui-core-DnR6WYuU.js";import{V as A,aZ as _,bb as ss,b2 as ae,bj as se,W as D,F as N,b1 as re,bL as ye,bK as ts,j as as,b9 as rs,bt as os}from"./vendor-ux-B0gV9NvH.js";import{Z as P,C as ns,Q as be,c as M,G as X,Y as is,q as ls,J as cs,f as Z,cD as ds}from"./index-CQgzjKgB.js";import{W as oe}from"./did-address-CsOJBoiY.js";import{b as z}from"./team-DDjNXwXE.js";import{r as ne,a as ie,b as le,c as ve,d as Q,e as ps,u as us,f as ms}from"./passport-item-Bhbm8_m6.js";import{p as Se}from"./util-DuMKfKo8.js";import{u as fs}from"./use-mobile-BINJTzMb.js";import{O as H}from"./index-1HKgA-fz.js";import{w as q,P as xs}from"./permission-BHvrn0M5.js";import{C as hs}from"./Google-DRu937I3.js";import{c as gs}from"./create-passport-svg-5AYzBKFb.js";import{A as js}from"./vendor-arcblock-Cnwtqa7s.js";import{C as Y,aB as ys}from"./vendor-utils-DCMKu06e.js";import{e as Ce}from"./edit.svg-CTE5eATX.js";import{h as ce,b as bs}from"./index-DhHvANH8.js";import{C as Te}from"./confirm-Lb1MrAdS.js";import{L as we}from"./list-header-Cl3jykCe.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-L-f8mSga.js";import"./lottie-web-4koyQiv_.js";import"./session-C2ZBRIpv.js";import"./isURL-CJRImg0N.js";import"./use-app-logo-BuyF983S.js";import"./ua-parser-DP5omx3I.js";import"./base32-_D4eWUeh.js";import"./cloneDeep-BY8zW7hH.js";import"./lock.svg-CiT4rEpi.js";const me="info";function Ie({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=qe({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(De,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Re,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Ae,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(_,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ss,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ss,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}Ie.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const Ss=$(t)`
1
+ import{r as b,g as We,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p as V}from"./vendor-hooks-DQAdyHrE.js";import{j as e,ak as t,at as $,b6 as Y,a6 as F,aZ as Ue,am as G,br as He,U as Ge,T as B,a3 as Ye,W as S,z as O,M as J,I as _,dZ as ge,bi as je,A as Ke,x as Ze,cs as Ve,ct as ee,ca as Je,F as Qe,bZ as Xe,s as es}from"./vendor-mui-core-CKKG_1TN.js";import{V as A,a_ as W,bc as ss,b3 as ae,bk as se,W as D,F as N,b2 as re,bM as ye,bL as ts,j as as,ba as rs,bu as os}from"./vendor-ux-DjXlxcvL.js";import{Z as P,C as ns,Q as be,c as M,G as X,Y as is,q as ls,J as cs,f as Z,cE as ds}from"./index-BEfIUbZC.js";import{W as oe}from"./did-address-Cq16cwTy.js";import{b as z}from"./team-DkV63Yjl.js";import{r as ne,a as ie,b as le,c as ve,d as Q,e as ps,u as us,f as ms}from"./passport-item-BudJHbYX.js";import{p as Se}from"./util-BgLSp_5A.js";import{u as fs}from"./use-mobile-_vjPRYx2.js";import{O as H}from"./index-BB8sYq-N.js";import{w as q,P as xs}from"./permission-CeqEAPPT.js";import{C as hs}from"./Google-JbLVL0lz.js";import{c as gs}from"./create-passport-svg-DeDfPZeD.js";import{A as js}from"./vendor-arcblock-BCP2x3BR.js";import{D as K,aC as ys}from"./vendor-utils-CUs2ebe7.js";import{e as Ce}from"./edit.svg-CTE5eATX.js";import{h as ce,b as bs}from"./index-BasnkqHA.js";import{C as Te}from"./confirm-D6AvlbAp.js";import{L as we}from"./list-header-wJF4c6BN.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-L-f8mSga.js";import"./lottie-web-4koyQiv_.js";import"./session-Cin9Rizr.js";import"./isURL-vNa-ZfGd.js";import"./use-app-logo-DnCfhAzv.js";import"./ua-parser-DP5omx3I.js";import"./base32-r3F0yIbl.js";import"./cloneDeep-rgNCMFod.js";import"./lock.svg-CiT4rEpi.js";const me="info";function Ie({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=qe({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(De,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Re,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Ae,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(W,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Ss,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ss,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}Ie.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const Ss=$(t)`
2
2
  margin-top: -16px;
3
3
 
4
4
  .tabs {
@@ -9,7 +9,7 @@ import{r as b,g as _e,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p
9
9
  .body {
10
10
  margin-top: 24px;
11
11
  }
12
- `;function De({createPassportSvg:c,passport:s}){const{t:p,locale:u}=A(),{teamDid:f}=z(),{inService:i}=P(),d=fs(),l=[{items:[{label:p("common.role"),content:ne(s.title)},{label:p("common.did"),content:e.jsx(oe,{did:s.id})},{label:p("team.passport.status"),content:le(s.status)},{label:p("common.type"),content:e.jsx(t,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(s.type||[]).map(n=>e.jsx(Ge,{label:n,variant:"outlined",size:"small",sx:{borderRadius:1}},n))})}]}],r=[{title:p("team.passport.owner"),items:[{label:p("team.passport.owner"),content:e.jsx(t,{children:ie(s.user,i)})}]},{title:p("common.timeInfo"),items:[{label:p("team.passport.issuanceTime"),content:s.issuanceDate?e.jsx(se,{value:s.issuanceDate,type:"all",locale:u}):"-"},{label:p("team.member.lastLogin"),content:s.lastLoginAt?e.jsx(se,{value:s.lastLoginAt,type:"all",locale:u}):"-"},{label:p("common.expires"),content:s.expirationDate?e.jsx(se,{value:s.expirationDate,type:"all",locale:u}):"-"}]},{title:p("blocklet.overview.source"),items:[{label:p("blocklet.overview.source"),content:Q(s.source)}]}];return e.jsxs(Cs,{gap:3,children:[e.jsxs(t,{sx:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"flex-start":"center",justifyContent:d?"center":"flex-start",width:"100%",overflow:"hidden",gap:d?2:4},children:[e.jsx(t,{sx:{display:"flex",width:"180px"},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,f,i):"",revoked:s.revoked,extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(t,{className:"info-area",children:l.map(n=>e.jsxs(t,{children:[n.title&&e.jsx(E,{variant:"h6",sx:{mb:2},children:n.title}),e.jsx(t,{className:"info-grid",sx:{gap:"12px !important"},children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",sx:{maxWidth:40},children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{display:"flex",flexWrap:"wrap",gap:.5,minWidth:0},children:h.content})]},h.label))})]},n.title))})]}),e.jsx(Ke,{}),e.jsx(t,{className:"info-area",children:r.map(n=>e.jsxs(t,{children:[e.jsx(E,{variant:"h5",sx:{mb:1.5},children:n.title}),e.jsx(t,{className:"info-grid",children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{minWidth:500},children:h.content})]},h.label))})]},n.title))})]})}De.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired};const Cs=$(K)`
12
+ `;function De({createPassportSvg:c,passport:s}){const{t:p,locale:u}=A(),{teamDid:f}=z(),{inService:i}=P(),d=fs(),l=[{items:[{label:p("common.role"),content:ne(s.title)},{label:p("common.did"),content:e.jsx(oe,{did:s.id})},{label:p("team.passport.status"),content:le(s.status)},{label:p("common.type"),content:e.jsx(t,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(s.type||[]).map(n=>e.jsx(Ge,{label:n,variant:"outlined",size:"small",sx:{borderRadius:1}},n))})}]}],r=[{title:p("team.passport.owner"),items:[{label:p("team.passport.owner"),content:e.jsx(t,{children:ie(s.user,i)})}]},{title:p("common.timeInfo"),items:[{label:p("team.passport.issuanceTime"),content:s.issuanceDate?e.jsx(se,{value:s.issuanceDate,type:"all",locale:u}):"-"},{label:p("team.member.lastLogin"),content:s.lastLoginAt?e.jsx(se,{value:s.lastLoginAt,type:"all",locale:u}):"-"},{label:p("common.expires"),content:s.expirationDate?e.jsx(se,{value:s.expirationDate,type:"all",locale:u}):"-"}]},{title:p("blocklet.overview.source"),items:[{label:p("blocklet.overview.source"),content:Q(s.source)}]}];return e.jsxs(Cs,{gap:3,children:[e.jsxs(t,{sx:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"flex-start":"center",justifyContent:d?"center":"flex-start",width:"100%",overflow:"hidden",gap:d?2:4},children:[e.jsx(t,{sx:{display:"flex",width:"180px"},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,f,i):"",revoked:s.revoked,extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(t,{className:"info-area",children:l.map(n=>e.jsxs(t,{children:[n.title&&e.jsx(B,{variant:"h6",sx:{mb:2},children:n.title}),e.jsx(t,{className:"info-grid",sx:{gap:"12px !important"},children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",sx:{maxWidth:40},children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{display:"flex",flexWrap:"wrap",gap:.5,minWidth:0},children:h.content})]},h.label))})]},n.title))})]}),e.jsx(Ye,{}),e.jsx(t,{className:"info-area",children:r.map(n=>e.jsxs(t,{children:[e.jsx(B,{variant:"h5",sx:{mb:1.5},children:n.title}),e.jsx(t,{className:"info-grid",children:n.items.map(h=>e.jsxs(t,{className:"info-item",children:[e.jsx(t,{className:"info-label",children:e.jsx(B,{variant:"subtitle2",color:"textSecondary",children:h.label})}),e.jsx(t,{sx:{minWidth:500},children:h.content})]},h.label))})]},n.title))})]})}De.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired};const Cs=$(Y)`
13
13
  .info-card {
14
14
  margin-bottom: 24px;
15
15
  overflow: hidden;
@@ -87,7 +87,7 @@ import{r as b,g as _e,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p
87
87
  margin: 0;
88
88
  }
89
89
  }
90
- `,Pe=10,ke=1;function Re({passport:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),[i,d]=b.useState({pageSize:Pe,page:ke}),{data:l,loading:r}=V(async()=>{const x={teamDid:p,query:{passportId:c.id},paging:{page:i.page,pageSize:i.pageSize}},a=await s.getPassportLogs({input:x});return{logs:a.passportLogs||[],total:a.paging.total}},{refreshDeps:[i.page,i.pageSize],onError:x=>D.error(x.message)}),n=b.useMemo(()=>l?.logs||[],[l?.logs]),h=x=>x.action===M.PASSPORT_LOG_ACTION.APPROVE||x.action===M.PASSPORT_LOG_ACTION.REVOKE?x?.metadata?.operator?.fullName?`${u("common.operator")}: ${x?.metadata?.operator?.fullName}`:null:x.action===M.PASSPORT_LOG_ACTION.ISSUE&&x.metadata?.action===M.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?x?.metadata?.inviter?.fullName?`${u("common.inviter")}: ${x?.metadata?.inviter?.fullName}`:null:`passportId: ${x.passportId}`,m=b.useMemo(()=>[{label:u("common.action"),name:"action",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsx(G,{title:h(o),children:`${x} ${o.metadata?.action?`(${o.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:x=>e.jsx(t,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:x||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.operatorUa&&e.jsx(t,{children:ps(o.operatorUa)}),o.operatorUa&&e.jsx(G,{title:o.operatorUa,children:e.jsx(He,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:u("common.createdAt"),name:"createdAt",options:{customBodyRender:x=>ns(x,f)}}],[u,f,n]),g=({page:x,rowsPerPage:a})=>{i.pageSize!==a?d(o=>({...o,pageSize:a,page:1})):i.page!==x+1&&d(o=>({...o,page:x+1}))},w={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:i.page-1,rowsPerPage:i.pageSize,count:l?.total||0};return r?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsx(t,{children:e.jsx(ae,{className:"logs-table",verticalKeyWidth:100,locale:f,data:n,columns:m,options:w,loading:r,onChange:g})})}Re.propTypes={passport:S.object.isRequired};function Ae({passport:c,onSwitchPassport:s}){const{api:p}=P(),{teamDid:u}=z(),{t:f,locale:i}=A(),[d,l]=b.useState({pageSize:Pe,page:ke}),{data:r,loading:n}=V(async()=>{const a={teamDid:u,passportId:c.parentDid,paging:{page:d.page,pageSize:d.pageSize}},o=await p.getRelatedPassports({input:a});return{passports:o.passports||[],total:o.paging.total}},{refreshDeps:[d.page,d.pageSize],onError:a=>D.error(a.message)}),h=b.useMemo(()=>r?.passports||[],[r?.passports]),m=b.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:ne}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:ie}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:a=>ve(a,i)}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:Q}}],[f,i]),g=({page:a,rowsPerPage:o})=>{d.pageSize!==o?l(v=>({...v,pageSize:o,page:1})):d.page!==a+1&&l(v=>({...v,page:a+1}))},w=b.useRef(null),x={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:d.page-1,rowsPerPage:d.pageSize,count:r?.total||0,onRowClick(a,{dataIndex:o},v){if(w.current?.contains(v.target)){const y=h[o];s(y)}}};return n?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(K,{spacing:1,children:[e.jsx(Ue,{severity:"warning",children:f("team.passport.relatedDescription")}),e.jsx(t,{ref:w,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(ae,{className:"related-table",verticalKeyWidth:100,locale:i,data:h.filter(a=>a.id!==c.id),columns:m,options:x,loading:n,onChange:g})})]})}Ae.propTypes={passport:S.object.isRequired,onSwitchPassport:S.func.isRequired};function de({onCancel:c,onSuccess:s}){const{api:p}=P(),{blocklet:u}=is(),{t:f}=A(),[i,d]=b.useState(!1),l=(u.environments.find(g=>g.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",r=l==="auto"?js(u.appDid):l,[n,h]=b.useState(r),m=async()=>{const g=[{key:cs.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:n}];try{d(!0),await p.configBlocklet({input:{did:u.meta.did,configs:g}}),s()}catch(w){D.error(w.message)}finally{d(!1)}};return e.jsx(_,{title:f("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:f("common.cancel")}),e.jsxs(N,{onClick:m,color:"primary",disabled:i,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[i&&e.jsx(F,{size:16}),f("common.save")]})]}),children:e.jsxs(t,{className:"dialog-content",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(hs,{disableAlpha:!0,color:n,onChange:g=>h(g.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:gs({scope:"passport",role:"owner",title:"Owner",issuer:ls.getDisplayName(u),issuerDid:u.appDid,ownerName:"Your Name",ownerDid:u.appDid,preferredColor:n})}})]})})}const Ts=q(de,"mutate_team"),ws=q(de,"",X);function Is(c){const{inService:s}=P();return s?e.jsx(ws,{...c}):e.jsx(Ts,{...c})}de.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired};var Le=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};Le.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Ds=(c,s)=>c?!s.some(p=>!p.from.passport||!p.to.role):!1;function Ne({onCancel:c,onSuccess:s,data:p={},trustedPassports:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=b.useState(!1),[h,m]=b.useState(p.issuerDid||""),[g,w]=b.useState(p.remark||""),[x,a]=b.useState(Y(p.mappings)||[]),o=u.findIndex(y=>y.issuerDid===p.issuerDid),v=async()=>{if(r)return;const y={issuerDid:h,remark:g,mappings:x.map(T=>({...T,to:{...T.to,ttl:T.to.ttl||0}}))},C=[...u];o===-1?C.unshift(y):C[o]=y;try{n(!0),await f.configTrustedPassports({input:{teamDid:d,trustedPassports:C}}),await Z(800),n(!1),D.success(l("common.saveSuccess")),s()}catch(T){n(!1),D.error(te(T))}};return e.jsx(_,{title:l("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(W,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>v(),color:"primary",disabled:!Ds(h,x)||!g||r,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[r&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(Ps,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:l("team.passport.issuerDid"),value:h,onChange:y=>{m(y.target.value)}}),e.jsx(O,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:l("common.remark"),value:g,onChange:y=>{w(y.target.value)}}),e.jsxs(t,{sx:{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(t,{className:"dialog-h1",children:l("team.passport.mappingRule")}),e.jsx(t,{children:e.jsx(N,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{a(y=>{const C=[...y];return C.unshift({from:{passport:""},to:{role:M.ROLES.GUEST}}),C})},children:l("team.add")})})]}),e.jsxs(t,{className:"list",sx:{mt:-.5},children:[x.map((y,C)=>e.jsxs(t,{className:"mapping-item",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",my:1},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small","data-cy":`input-${C}-from`,placeholder:"Issuer’s Passport Name/ID *",value:y.from.passport,onChange:T=>{const{value:k}=T.target;a(L=>{const U=[...L];return U[C].from.passport=k,U})},sx:{"& .MuiInputBase-input::placeholder":{fontSize:14},"& .Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}})}),e.jsx(t,{sx:{flexShrink:0,mx:1,width:65,height:16},children:e.jsx(Le,{})}),e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small",select:!0,value:y.to.role,onChange:T=>{a(k=>{const L=[...k];return L[C].to.role=T.target.value,L})},variant:"outlined",children:i.filter(T=>T.name!=="owner").map(T=>e.jsx(J,{value:T.name,"data-cy":`passport-mapping-select-option-${T.name}`,children:e.jsx("span",{children:T.title||T.name})},T.name))})})]}),e.jsx(t,{sx:{flexShrink:0},children:e.jsx(W,{onClick:()=>{a(T=>{const k=[...T];return k.splice(C,1),k})},size:"large",children:e.jsx(ce,{})})})]},`mapping-${C}`)),!x.length&&e.jsx(t,{sx:{my:2,color:"text.secondary",fontSize:"16px"},children:e.jsx(re,{children:l("common.empty")})})]})]})})})}Ne.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedPassports:S.array,data:S.object};const Ps=$.div`
90
+ `,Pe=10,ke=1;function Re({passport:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),[i,d]=b.useState({pageSize:Pe,page:ke}),{data:l,loading:r}=V(async()=>{const x={teamDid:p,query:{passportId:c.id},paging:{page:i.page,pageSize:i.pageSize}},a=await s.getPassportLogs({input:x});return{logs:a.passportLogs||[],total:a.paging.total}},{refreshDeps:[i.page,i.pageSize],onError:x=>D.error(x.message)}),n=b.useMemo(()=>l?.logs||[],[l?.logs]),h=x=>x.action===M.PASSPORT_LOG_ACTION.APPROVE||x.action===M.PASSPORT_LOG_ACTION.REVOKE?x?.metadata?.operator?.fullName?`${u("common.operator")}: ${x?.metadata?.operator?.fullName}`:null:x.action===M.PASSPORT_LOG_ACTION.ISSUE&&x.metadata?.action===M.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?x?.metadata?.inviter?.fullName?`${u("common.inviter")}: ${x?.metadata?.inviter?.fullName}`:null:`passportId: ${x.passportId}`,m=b.useMemo(()=>[{label:u("common.action"),name:"action",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsx(G,{title:h(o),children:`${x} ${o.metadata?.action?`(${o.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:x=>e.jsx(t,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:x||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(x,{rowIndex:a})=>{const o=n[a];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.operatorUa&&e.jsx(t,{children:ps(o.operatorUa)}),o.operatorUa&&e.jsx(G,{title:o.operatorUa,children:e.jsx(He,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:u("common.createdAt"),name:"createdAt",options:{customBodyRender:x=>ns(x,f)}}],[u,f,n]),g=({page:x,rowsPerPage:a})=>{i.pageSize!==a?d(o=>({...o,pageSize:a,page:1})):i.page!==x+1&&d(o=>({...o,page:x+1}))},w={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:i.page-1,rowsPerPage:i.pageSize,count:l?.total||0};return r?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsx(t,{children:e.jsx(ae,{className:"logs-table",verticalKeyWidth:100,locale:f,data:n,columns:m,options:w,loading:r,onChange:g})})}Re.propTypes={passport:S.object.isRequired};function Ae({passport:c,onSwitchPassport:s}){const{api:p}=P(),{teamDid:u}=z(),{t:f,locale:i}=A(),[d,l]=b.useState({pageSize:Pe,page:ke}),{data:r,loading:n}=V(async()=>{const a={teamDid:u,passportId:c.parentDid,paging:{page:d.page,pageSize:d.pageSize}},o=await p.getRelatedPassports({input:a});return{passports:o.passports||[],total:o.paging.total}},{refreshDeps:[d.page,d.pageSize],onError:a=>D.error(a.message)}),h=b.useMemo(()=>r?.passports||[],[r?.passports]),m=b.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:ne}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:ie}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:a=>ve(a,i)}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:Q}}],[f,i]),g=({page:a,rowsPerPage:o})=>{d.pageSize!==o?l(v=>({...v,pageSize:o,page:1})):d.page!==a+1&&l(v=>({...v,page:a+1}))},w=b.useRef(null),x={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:d.page-1,rowsPerPage:d.pageSize,count:r?.total||0,onRowClick(a,{dataIndex:o},v){if(w.current?.contains(v.target)){const y=h[o];s(y)}}};return n?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(Y,{spacing:1,children:[e.jsx(Ue,{severity:"warning",children:f("team.passport.relatedDescription")}),e.jsx(t,{ref:w,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(ae,{className:"related-table",verticalKeyWidth:100,locale:i,data:h.filter(a=>a.id!==c.id),columns:m,options:x,loading:n,onChange:g})})]})}Ae.propTypes={passport:S.object.isRequired,onSwitchPassport:S.func.isRequired};function de({onCancel:c,onSuccess:s}){const{api:p}=P(),{blocklet:u}=is(),{t:f}=A(),[i,d]=b.useState(!1),l=(u.environments.find(g=>g.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",r=l==="auto"?js(u.appDid):l,[n,h]=b.useState(r),m=async()=>{const g=[{key:cs.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:n}];try{d(!0),await p.configBlocklet({input:{did:u.meta.did,configs:g}}),s()}catch(w){D.error(w.message)}finally{d(!1)}};return e.jsx(W,{title:f("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:f("common.cancel")}),e.jsxs(N,{onClick:m,color:"primary",disabled:i,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[i&&e.jsx(F,{size:16}),f("common.save")]})]}),children:e.jsxs(t,{className:"dialog-content",sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[e.jsx(hs,{disableAlpha:!0,color:n,onChange:g=>h(g.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:gs({scope:"passport",role:"owner",title:"Owner",issuer:ls.getDisplayName(u),issuerDid:u.appDid,ownerName:"Your Name",ownerDid:u.appDid,preferredColor:n})}})]})})}const Ts=q(de,"mutate_team"),ws=q(de,"",X);function Is(c){const{inService:s}=P();return s?e.jsx(ws,{...c}):e.jsx(Ts,{...c})}de.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired};var Le=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{d:"M64.707 8.707a1 1 0 0 0 0-1.414L58.343.929a1 1 0 1 0-1.414 1.414L62.586 8l-5.657 5.657a1 1 0 0 0 1.414 1.414l6.364-6.364ZM0 9h64V7H0v2Z",fill:"#666"})})};Le.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Ds=(c,s)=>c?!s.some(p=>!p.from.passport||!p.to.role):!1;function Ne({onCancel:c,onSuccess:s,data:p={},trustedPassports:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=b.useState(!1),[h,m]=b.useState(p.issuerDid||""),[g,w]=b.useState(p.remark||""),[x,a]=b.useState(K(p.mappings)||[]),o=u.findIndex(y=>y.issuerDid===p.issuerDid),v=async()=>{if(r)return;const y={issuerDid:h,remark:g,mappings:x.map(T=>({...T,to:{...T.to,ttl:T.to.ttl||0}}))},C=[...u];o===-1?C.unshift(y):C[o]=y;try{n(!0),await f.configTrustedPassports({input:{teamDid:d,trustedPassports:C}}),await Z(800),n(!1),D.success(l("common.saveSuccess")),s()}catch(T){n(!1),D.error(te(T))}};return e.jsx(W,{title:l("team.passport.trustedIssuers"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"trusted-issuer-close",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>v(),color:"primary",disabled:!Ds(h,x)||!g||r,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[r&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(Ps,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:l("team.passport.issuerDid"),value:h,onChange:y=>{m(y.target.value)}}),e.jsx(O,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:l("common.remark"),value:g,onChange:y=>{w(y.target.value)}}),e.jsxs(t,{sx:{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(t,{className:"dialog-h1",children:l("team.passport.mappingRule")}),e.jsx(t,{children:e.jsx(N,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{a(y=>{const C=[...y];return C.unshift({from:{passport:""},to:{role:M.ROLES.GUEST}}),C})},children:l("team.add")})})]}),e.jsxs(t,{className:"list",sx:{mt:-.5},children:[x.map((y,C)=>e.jsxs(t,{className:"mapping-item",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",my:1},children:[e.jsxs(t,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small","data-cy":`input-${C}-from`,placeholder:"Issuer’s Passport Name/ID *",value:y.from.passport,onChange:T=>{const{value:k}=T.target;a(L=>{const U=[...L];return U[C].from.passport=k,U})},sx:{"& .MuiInputBase-input::placeholder":{fontSize:14},"& .Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}})}),e.jsx(t,{sx:{flexShrink:0,mx:1,width:65,height:16},children:e.jsx(Le,{})}),e.jsx(t,{sx:{flexGrow:1,flexBasis:1},children:e.jsx(O,{fullWidth:!0,size:"small",select:!0,value:y.to.role,onChange:T=>{a(k=>{const L=[...k];return L[C].to.role=T.target.value,L})},variant:"outlined",children:i.filter(T=>T.name!=="owner").map(T=>e.jsx(J,{value:T.name,"data-cy":`passport-mapping-select-option-${T.name}`,children:e.jsx("span",{children:T.title||T.name})},T.name))})})]}),e.jsx(t,{sx:{flexShrink:0},children:e.jsx(_,{onClick:()=>{a(T=>{const k=[...T];return k.splice(C,1),k})},size:"large",children:e.jsx(ce,{})})})]},`mapping-${C}`)),!x.length&&e.jsx(t,{sx:{my:2,color:"text.secondary",fontSize:"16px"},children:e.jsx(re,{children:l("common.empty")})})]})]})})})}Ne.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedPassports:S.array,data:S.object};const Ps=$.div`
91
91
  .dialog-h1 {
92
92
  font-size: 18px;
93
93
  }
@@ -99,7 +99,7 @@ import{r as b,g as _e,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p
99
99
  }
100
100
  }
101
101
  }
102
- `;function pe({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedPassports:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(""),x=async o=>{if(r)return;const v=f.findIndex(C=>C.issuerDid===o);v===-1&&D.error("Cannot find passports");const y=[...f];y.splice(v,1);try{n(!0),await p.configTrustedPassports({input:{teamDid:u,trustedPassports:y}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(!1)}catch(C){n(!1),D.error(C.message)}},a=f.filter(o=>!g||o.issuerDid.toLowerCase().includes(g.toLowerCase()));return e.jsxs(_,{title:i("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Ls,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedPassportIssuers")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(ye,{options:{searchPlaceholder:i("team.passport.searchIssuerDid"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>m({mode:"add"}),children:[e.jsx(je,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexShrink:0},children:[e.jsx(oe,{copyable:!1,size:16,did:ts(o.issuerDid),showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",ml:"28px",flexGrow:1},children:o.mappings&&o.mappings.length?`${o.mappings.length} ${i("team.passport.mappingRule")}`:i("team.passport.defaultRule")}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(W,{onClick:()=>m({mode:"update",data:Y(o)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(Ce,{})}),e.jsx(W,{"data-cy":"delete-mapping-rule",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.issuerDid}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.issuerDid),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.issuerDid)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(Ne,{mode:h.mode,data:h.data,trustedPassports:Y(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}pe.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const ks=q(pe,"mutate_team"),Rs=q(pe,"",X);function As(c){const{inService:s}=P();return s?e.jsx(Rs,{...c}):e.jsx(ks,{...c})}const Ls=$.div`
102
+ `;function pe({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedPassports:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(""),x=async o=>{if(r)return;const v=f.findIndex(C=>C.issuerDid===o);v===-1&&D.error("Cannot find passports");const y=[...f];y.splice(v,1);try{n(!0),await p.configTrustedPassports({input:{teamDid:u,trustedPassports:y}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(!1)}catch(C){n(!1),D.error(C.message)}},a=f.filter(o=>!g||o.issuerDid.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Ls,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedPassportIssuers")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(ye,{options:{searchPlaceholder:i("team.passport.searchIssuerDid"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>m({mode:"add"}),children:[e.jsx(je,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexShrink:0},children:[e.jsx(oe,{copyable:!1,size:16,did:ts(o.issuerDid),showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",ml:"28px",flexGrow:1},children:o.mappings&&o.mappings.length?`${o.mappings.length} ${i("team.passport.mappingRule")}`:i("team.passport.defaultRule")}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(Ce,{})}),e.jsx(_,{"data-cy":"delete-mapping-rule",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.issuerDid}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.issuerDid),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.issuerDid)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(Ne,{mode:h.mode,data:h.data,trustedPassports:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}pe.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const ks=q(pe,"mutate_team"),Rs=q(pe,"",X);function As(c){const{inService:s}=P();return s?e.jsx(Rs,{...c}):e.jsx(ks,{...c})}const Ls=$.div`
103
103
  .list {
104
104
  .MuiIconButton-root {
105
105
  svg {
@@ -107,7 +107,7 @@ import{r as b,g as _e,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p
107
107
  }
108
108
  }
109
109
  }
110
- `;var Ns=ys();const fe=_e(Ns);function ze({onCancel:c,onSuccess:s,data:p={},trustedFactories:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=vs({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:p.factoryAddress||"",remark:p.remark||"",role:p.passport?.role||"member",ttlPolicy:p.passport?.ttlPolicy||"never",ttl:fe(+p.passport?.ttl||365*24*60*60*1e3),error:""}),h=u.findIndex(a=>a.factoryAddress===p.factoryAddress),m=async()=>{if(r.loading)return;const{factoryAddress:a,remark:o,role:v,ttlPolicy:y,ttl:C}=r,T={factoryAddress:a,remark:o,passport:{role:v,ttlPolicy:y,ttl:y==="never"?0:fe(C)}},k=[...u];h===-1?k.unshift(T):k[h]=T;try{n({loading:!0}),await f.configTrustedFactories({input:{teamDid:d,trustedFactories:k}}),await Z(800),D.success(l("common.saveSuccess")),s()}catch(L){console.error(L),D.error(te(L))}finally{n({loading:!1})}};b.useEffect(()=>{const a=r.fetched.find(v=>v.address===r.factoryAddress),o=r.errored.find(v=>v.address===r.factoryAddress);as(r.factoryAddress)&&!r.fetching&&!a&&!o&&(n({fetching:!0}),ds(M.MAIN_CHAIN_ENDPOINT).getFactoryState({address:r.factoryAddress}).then(y=>{y.state?n({fetching:!1,fetched:[...r.fetched.filter(C=>C.address!==r.factoryAddress),y.state],remark:y.state.name}):n({fetching:!1,errored:[...r.errored.filter(C=>C.address!==r.factoryAddress),{address:r.factoryAddress}],error:l("team.passport.factory404",r)})}).catch(y=>{console.error(y),n({fetching:!1,error:te(y)})}))},[r.factoryAddress,r.fetching]);let g=r.error;const w=r.factoryAddress?r.errored.find(a=>a.address===r.factoryAddress):null;!g&&w&&(g=l("team.passport.factory404",r));const x=r.factoryAddress?r.fetched.find(a=>a.address===r.factoryAddress):null;return!g&&x&&(g=x.description),g||(g=l("team.passport.factoryAddressTip")),e.jsx(_,{title:l("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(W,{onClick:c,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>m(),color:"primary",disabled:!r.factoryAddress||!r.remark||!r.role||r.loading||r.error||w,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[r.loading&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(zs,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,error:!!r.error||!!w,"data-cy":"input-factory-address",label:l("team.passport.factoryAddress"),helperText:g,value:r.factoryAddress,onChange:a=>{n({factoryAddress:a.target.value,error:""})},slotProps:{input:{endAdornment:r.fetching?e.jsx(Ye,{position:"end",children:e.jsx(F,{size:16})}):null}}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:l("common.remark"),value:r.remark,onChange:a=>{n({remark:a.target.value})}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:l("team.passport.role"),select:!0,value:r.role,onChange:a=>{n({role:a.target.value})},variant:"outlined",children:i.filter(a=>a.name!=="owner").map(a=>e.jsx(J,{value:a.name,"data-cy":`passport-role-select-option-${a.name}`,children:e.jsx("span",{children:a.title||a.name})},a.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx(Ze,{children:l("team.passport.ttl")}),e.jsxs(Ve,{color:"primary",size:"small",value:r.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(a,o)=>n({ttlPolicy:o}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(G,{title:l("team.passport.ttlNeverTip"),children:e.jsx(E,{children:l("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(G,{title:l("team.passport.ttlMintTip"),children:e.jsx(E,{children:l("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(G,{title:l("team.passport.ttlExchangeTip"),children:e.jsx(E,{children:l("team.passport.ttlExchange")})})})]}),r.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(Je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:r.ttl,onChange:a=>{n({ttl:a.target.value})}}),e.jsx(Qe,{children:l("team.passport.ttlTip")})]})]})]})})})}ze.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedFactories:S.array,data:S.object};const zs=$.div`
110
+ `;var Ns=ys();const fe=We(Ns);function ze({onCancel:c,onSuccess:s,data:p={},trustedFactories:u=[]}){const{api:f}=P(),{roles:i,teamDid:d}=z(),{t:l}=A(),[r,n]=vs({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:p.factoryAddress||"",remark:p.remark||"",role:p.passport?.role||"member",ttlPolicy:p.passport?.ttlPolicy||"never",ttl:fe(+p.passport?.ttl||365*24*60*60*1e3),error:""}),h=u.findIndex(a=>a.factoryAddress===p.factoryAddress),m=async()=>{if(r.loading)return;const{factoryAddress:a,remark:o,role:v,ttlPolicy:y,ttl:C}=r,T={factoryAddress:a,remark:o,passport:{role:v,ttlPolicy:y,ttl:y==="never"?0:fe(C)}},k=[...u];h===-1?k.unshift(T):k[h]=T;try{n({loading:!0}),await f.configTrustedFactories({input:{teamDid:d,trustedFactories:k}}),await Z(800),D.success(l("common.saveSuccess")),s()}catch(L){console.error(L),D.error(te(L))}finally{n({loading:!1})}};b.useEffect(()=>{const a=r.fetched.find(v=>v.address===r.factoryAddress),o=r.errored.find(v=>v.address===r.factoryAddress);as(r.factoryAddress)&&!r.fetching&&!a&&!o&&(n({fetching:!0}),ds(M.MAIN_CHAIN_ENDPOINT).getFactoryState({address:r.factoryAddress}).then(y=>{y.state?n({fetching:!1,fetched:[...r.fetched.filter(C=>C.address!==r.factoryAddress),y.state],remark:y.state.name}):n({fetching:!1,errored:[...r.errored.filter(C=>C.address!==r.factoryAddress),{address:r.factoryAddress}],error:l("team.passport.factory404",r)})}).catch(y=>{console.error(y),n({fetching:!1,error:te(y)})}))},[r.factoryAddress,r.fetching]);let g=r.error;const w=r.factoryAddress?r.errored.find(a=>a.address===r.factoryAddress):null;!g&&w&&(g=l("team.passport.factory404",r));const x=r.factoryAddress?r.fetched.find(a=>a.address===r.factoryAddress):null;return!g&&x&&(g=x.description),g||(g=l("team.passport.factoryAddressTip")),e.jsx(W,{title:l("team.passport.trustedFactories"),open:!0,showCloseButton:!1,PaperProps:{style:{minHeight:"80vh"}},fullWidth:!0,prepend:e.jsx(_,{onClick:c,"data-cy":"close-trusted-factory",size:"large",children:e.jsx(ge,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(N,{onClick:c,color:"inherit",children:l("common.cancel")}),e.jsxs(N,{onClick:()=>m(),color:"primary",disabled:!r.factoryAddress||!r.remark||!r.role||r.loading||r.error||w,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[r.loading&&e.jsx(F,{size:16}),l("common.save")]})]}),children:e.jsx(zs,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(O,{fullWidth:!0,error:!!r.error||!!w,"data-cy":"input-factory-address",label:l("team.passport.factoryAddress"),helperText:g,value:r.factoryAddress,onChange:a=>{n({factoryAddress:a.target.value,error:""})},slotProps:{input:{endAdornment:r.fetching?e.jsx(Ke,{position:"end",children:e.jsx(F,{size:16})}):null}}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:l("common.remark"),value:r.remark,onChange:a=>{n({remark:a.target.value})}}),e.jsx(O,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:l("team.passport.role"),select:!0,value:r.role,onChange:a=>{n({role:a.target.value})},variant:"outlined",children:i.filter(a=>a.name!=="owner").map(a=>e.jsx(J,{value:a.name,"data-cy":`passport-role-select-option-${a.name}`,children:e.jsx("span",{children:a.title||a.name})},a.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx(Ze,{children:l("team.passport.ttl")}),e.jsxs(Ve,{color:"primary",size:"small",value:r.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(a,o)=>n({ttlPolicy:o}),"data-cy":"input-passport-ttl-since","aria-label":"Expire Policy",children:[e.jsx(ee,{value:"never","data-cy":"input-passport-ttl-never",children:e.jsx(G,{title:l("team.passport.ttlNeverTip"),children:e.jsx(B,{children:l("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(G,{title:l("team.passport.ttlMintTip"),children:e.jsx(B,{children:l("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(G,{title:l("team.passport.ttlExchangeTip"),children:e.jsx(B,{children:l("team.passport.ttlExchange")})})})]}),r.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(Je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:r.ttl,onChange:a=>{n({ttl:a.target.value})}}),e.jsx(Qe,{children:l("team.passport.ttlTip")})]})]})]})})})}ze.propTypes={onCancel:S.func.isRequired,onSuccess:S.func.isRequired,trustedFactories:S.array,data:S.object};const zs=$.div`
111
111
  .dialog-h1 {
112
112
  font-size: 18px;
113
113
  }
@@ -119,7 +119,7 @@ import{r as b,g as _e,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p
119
119
  }
120
120
  }
121
121
  }
122
- `;function ue({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedFactories:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(null),[g,w]=b.useState(""),x=async o=>{if(!r)try{n(!0),await p.configTrustedFactories({input:{teamDid:u,trustedFactories:f.filter(v=>v.factoryAddress!==o)}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(null)}catch(v){n(!1),D.error(v.message)}},a=f.filter(o=>!g||o.factoryAddress.toLowerCase().includes(g.toLowerCase()));return e.jsxs(_,{title:i("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Os,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedFactoriesTip")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(ye,{options:{searchPlaceholder:i("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>m({mode:"add"}),children:[e.jsx(je,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexGrow:1},children:[e.jsx(oe,{copyable:!1,did:o.factoryAddress,size:16,showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",mr:"24px"},children:e.jsx(rs,{type:"success",children:o.passport.role})}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(W,{onClick:()=>m({mode:"update",data:Y(o)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(Ce,{})}),e.jsx(W,{"data-cy":"delete-trusted-factory",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.factoryAddress}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.factoryAddress),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.factoryAddress)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(ze,{data:h.data,trustedFactories:Y(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ue.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Fs=q(ue,"mutate_team"),Bs=q(ue,"",X);function Es(c){const{inService:s}=P();return s?e.jsx(Bs,{...c}):e.jsx(Fs,{...c})}const Os=$.div`
122
+ `;function ue({onCancel:c,hasPermission:s=!1}){const{api:p}=P(),{teamDid:u,trustedFactories:f}=z(),{t:i}=A(),[d,l]=b.useState(null),[r,n]=b.useState(!1),[h,m]=b.useState(null),[g,w]=b.useState(""),x=async o=>{if(!r)try{n(!0),await p.configTrustedFactories({input:{teamDid:u,trustedFactories:f.filter(v=>v.factoryAddress!==o)}}),await Z(800),n(!1),D.success(i("common.saveSuccess")),l(null)}catch(v){n(!1),D.error(v.message)}},a=f.filter(o=>!g||o.factoryAddress.toLowerCase().includes(g.toLowerCase()));return e.jsxs(W,{title:i("team.passport.trustedFactories"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(Os,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:i("team.passport.trustedFactoriesTip")}),e.jsx(we,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(ye,{options:{searchPlaceholder:i("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:g,searchText:g,searchTextUpdate:w,searchClose:()=>w(""),onSearchOpen:()=>{}}),s&&e.jsxs(N,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>m({mode:"add"}),children:[e.jsx(je,{style:{fontSize:16,marginRight:4}}),i("team.add")]})]})}),e.jsxs("div",{className:"list",children:[a.map(o=>e.jsxs(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px"},children:[e.jsxs(t,{sx:{flexGrow:1},children:[e.jsx(oe,{copyable:!1,did:o.factoryAddress,size:16,showDidLogo:!1}),!!o.remark&&e.jsx(t,{sx:{fontSize:12,maxWidth:"300px"},children:o.remark})]}),e.jsx(t,{sx:{color:"gray",mr:"24px"},children:e.jsx(rs,{type:"success",children:o.passport.role})}),e.jsxs(t,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:[e.jsx(_,{onClick:()=>m({mode:"update",data:K(o)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(Ce,{})}),e.jsx(_,{"data-cy":"delete-trusted-factory",onClick:()=>l({title:i("common.delete"),description:i("common.delConfirmDescription",{data:o.factoryAddress}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>x(o.factoryAddress),onCancel:()=>{n(!1),l(null)}}),size:"large",children:e.jsx(ce,{})})]})]},o.factoryAddress)),!f.length&&e.jsx(re,{children:i("common.empty")})]})]})}),h&&e.jsx(ze,{data:h.data,trustedFactories:K(f),onCancel:()=>m(null),onSuccess:()=>{m(null)}}),d&&e.jsx(Te,{title:d.title,description:d.description,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})]})}ue.propTypes={onCancel:S.func.isRequired,hasPermission:S.bool};const Fs=q(ue,"mutate_team"),Es=q(ue,"",X);function Bs(c){const{inService:s}=P();return s?e.jsx(Es,{...c}):e.jsx(Fs,{...c})}const Os=$.div`
123
123
  .list {
124
124
  .MuiIconButton-root {
125
125
  svg {
@@ -127,7 +127,7 @@ import{r as b,g as _e,a as $e}from"./vendor-react-CTtPmzVP.js";import{g as qe,p
127
127
  }
128
128
  }
129
129
  }
130
- `;function Fe({createPassportSvg:c}){const{t:s}=A(),{api:p,inService:u}=P(),{teamDid:f,refresh:i,enablePassportIssuance:d,isNodeTeam:l}=z(),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(!1),[x,a]=b.useState(!1),[o,v]=b.useState(!1),y=async C=>{if(C.stopPropagation(),!x){a(!0);try{await p.configPassportIssuance({input:{teamDid:f,enable:!d}}),i(),await Z(800),D.success(s("common.configSuccess"))}catch(T){D.error(T.message)}finally{a(!1)}}};return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[e.jsx(xs,{permission:u?"":"mutate_team",role:u?X:[],children:e.jsx(H,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(H.Item,{onClick:()=>m(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(t,{children:[s("team.passport.trustedPassportIssuers"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(H.Item,{onClick:()=>w(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(t,{children:[s("team.passport.configFactories"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configFactoriesTip")})]})}),e.jsx(H.Item,{"data-cy":"config-show-issue-passport",onClick:y,children:e.jsxs(t,{sx:{display:"flex",alignItems:"center"},children:[x&&e.jsx(F,{size:16,style:{marginRight:8}}),e.jsxs(t,{children:[s(d?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s(d?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!l&&e.jsx(H.Item,{onClick:()=>n(!0),"data-cy":"config-passport-color",children:e.jsxs(t,{children:[s("team.passport.configColor"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(N,{variant:"outlined",onClick:()=>{v(!0)},children:s("team.passport.view")})})}),h&&e.jsx(As,{onCancel:()=>m(!1)}),g&&e.jsx(Es,{onCancel:()=>w(!1)}),r&&e.jsx(Is,{onCancel:()=>n(!1),onSuccess:()=>n(!1)}),o&&e.jsx(_,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:s("team.passport.view"),children:e.jsx(bs,{createPassportSvg:c,onCancel:()=>v(!1)})})]})}Fe.propTypes={createPassportSvg:S.func.isRequired};const xe="$all",he="",Be=$e.memo(({createPassportSvg:c,passport:s,teamDid:p,inService:u})=>e.jsx(t,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,p,u):"",revoked:s.revoked,width:"36px",extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}));Be.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired,teamDid:S.string.isRequired,inService:S.bool.isRequired};function Ms({createPassportSvg:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),{SYSTEM_ROLES:i}=us(),{inService:d}=P(),[l,r]=b.useState(!1),n=`passports-${p}`,h=os(n),[m,g]=b.useState({role:xe,status:he,searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:h.page?h.page+1:1}),{data:w,loading:x}=V(async()=>(await s.getPassportRoleCounts({input:{teamDid:p}})).counts||[],{refreshDeps:[p]}),{data:a,loading:o}=V(async()=>{const j={};m.role!==xe&&(j.role=m.role),m.status&&(j.status=m.status);const I=await s.getPassportsByRole({input:{teamDid:p,query:j,paging:{page:m.page,pageSize:m.pageSize}}});return{passports:I.passports||[],total:I.paging.total}},{refreshDeps:[m.role,m.status,m.page,m.pageSize],onError:j=>D.error(j.message)}),v=j=>w?.find(R=>R.key===j)?.value||0,y=b.useMemo(()=>Object.keys(i).map(j=>({name:j,title:i[j],num:v(j)})),[w,v]),C=b.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:(j,{rowIndex:I})=>{const R=a?.passports[I];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Be,{createPassportSvg:c,passport:R,teamDid:p}),e.jsx(t,{children:ne(R.title)})]})}}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:j=>ie(j,d)}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:j=>ve(j,f)}},{label:u("common.address"),name:"id",options:{customBodyRender:ms}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:(j,{rowIndex:I})=>{const R=a?.passports[I];return R.parentDid?Q("recover"):Q(R.source)}}}],[u,f,a?.passports,p,c,d]),T=j=>{g(I=>({...I,role:j,page:1}))},k=({page:j,rowsPerPage:I,searchText:R})=>{m.pageSize!==I?g(B=>({...B,searchText:"",pageSize:I,page:1})):m.page!==j+1?g(B=>({...B,searchText:"",page:j+1})):m.searchText!==R&&g(B=>({...B,searchText:R,page:1}))},L=b.useRef(null),U=a?.passports||[],Ee=m.searchText?U.filter(j=>j.id.includes(m.searchText)||(j?.user?.fullName||"").includes(m.searchText)):U,Oe={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(j,{dataIndex:I},R){if(L.current?.contains(R.target)){const B=a?.passports[I];r(B)}},page:m.page-1,rowsPerPage:m.pageSize,count:a?.total||0,searchDebounceTime:600},Me=j=>{g(I=>({...I,status:j.target.value,page:1}))},We=e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(t,{sx:{fontSize:16,fontWeight:400},children:[u("team.passport.status"),":"]}),e.jsxs(Xe,{size:"small",value:m.status,onChange:Me,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(J,{value:he,children:u("common.all")}),Object.values(M.PASSPORT_STATUS).map(j=>e.jsx(J,{value:j,sx:{py:1},children:u(`team.passport.statusMap.${j}`)},j))]})]});return x?e.jsx(t,{sx:{py:2},children:e.jsx(K,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(Ws,{children:[e.jsxs(t,{className:"main",sx:{display:"flex",mt:0,gap:3},children:[e.jsx(t,{className:"left",children:e.jsx(t,{className:"tabs",children:y.map(j=>e.jsxs(t,{className:`tab ${m.role===j.name?"active":""}`,onClick:()=>T(j.name),children:[e.jsx("span",{className:"text",children:j.title}),e.jsx(t,{sx:{color:"text.secondary"},children:j.num})]},j.name))})}),e.jsx(t,{ref:L,className:"right",children:e.jsx(ae,{className:"main-table",verticalKeyWidth:100,locale:f,durable:n,durableKeys:["page","rowsPerPage"],data:Ee,columns:C,options:Oe,loading:o,onChange:k,customButtons:[e.jsx(Fe,{createPassportSvg:c})],title:We})})]}),l&&e.jsx(Ie,{createPassportSvg:c,onCancel:()=>r(null),passport:l,onSwitchPassport:r})]})}Ms.propTypes={createPassportSvg:S.func.isRequired};const Ws=es(t)`
130
+ `;function Fe({createPassportSvg:c}){const{t:s}=A(),{api:p,inService:u}=P(),{teamDid:f,refresh:i,enablePassportIssuance:d,isNodeTeam:l}=z(),[r,n]=b.useState(!1),[h,m]=b.useState(!1),[g,w]=b.useState(!1),[x,a]=b.useState(!1),[o,v]=b.useState(!1),y=async C=>{if(C.stopPropagation(),!x){a(!0);try{await p.configPassportIssuance({input:{teamDid:f,enable:!d}}),i(),await Z(800),D.success(s("common.configSuccess"))}catch(T){D.error(T.message)}finally{a(!1)}}};return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1,ml:1},children:[e.jsx(xs,{permission:u?"":"mutate_team",role:u?X:[],children:e.jsx(H,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(H.Item,{onClick:()=>m(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(t,{children:[s("team.passport.trustedPassportIssuers"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(H.Item,{onClick:()=>w(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(t,{children:[s("team.passport.configFactories"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configFactoriesTip")})]})}),e.jsx(H.Item,{"data-cy":"config-show-issue-passport",onClick:y,children:e.jsxs(t,{sx:{display:"flex",alignItems:"center"},children:[x&&e.jsx(F,{size:16,style:{marginRight:8}}),e.jsxs(t,{children:[s(d?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s(d?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!l&&e.jsx(H.Item,{onClick:()=>n(!0),"data-cy":"config-passport-color",children:e.jsxs(t,{children:[s("team.passport.configColor"),e.jsx(t,{sx:{fontSize:12,color:"#888"},children:s("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(N,{variant:"outlined",onClick:()=>{v(!0)},children:s("team.passport.view")})})}),h&&e.jsx(As,{onCancel:()=>m(!1)}),g&&e.jsx(Bs,{onCancel:()=>w(!1)}),r&&e.jsx(Is,{onCancel:()=>n(!1),onSuccess:()=>n(!1)}),o&&e.jsx(W,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:s("team.passport.view"),children:e.jsx(bs,{createPassportSvg:c,onCancel:()=>v(!1)})})]})}Fe.propTypes={createPassportSvg:S.func.isRequired};const xe="$all",he="",Ee=$e.memo(({createPassportSvg:c,passport:s,teamDid:p,inService:u})=>e.jsx(t,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:s.scope,role:s.role,title:s.scope==="kyc"?s.name:s.title,issuer:s.issuer&&s.issuer.name,issuerDid:s.issuer&&s.issuer.id,ownerName:s.user?.fullName,ownerDid:s.user?.did,ownerAvatarUrl:s.user?.avatar?Se(s.user?.avatar,p,u):"",revoked:s.revoked,width:"36px",extra:s?.expirationDate?{key:"Exp",value:be(s.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}));Ee.propTypes={passport:S.object.isRequired,createPassportSvg:S.func.isRequired,teamDid:S.string.isRequired,inService:S.bool.isRequired};function Ms({createPassportSvg:c}){const{api:s}=P(),{teamDid:p}=z(),{t:u,locale:f}=A(),{SYSTEM_ROLES:i}=us(),{inService:d}=P(),[l,r]=b.useState(!1),n=`passports-${p}`,h=os(n),[m,g]=b.useState({role:xe,status:he,searchText:h.searchText||"",pageSize:h.rowsPerPage||10,page:h.page?h.page+1:1}),{data:w,loading:x}=V(async()=>(await s.getPassportRoleCounts({input:{teamDid:p}})).counts||[],{refreshDeps:[p]}),{data:a,loading:o}=V(async()=>{const j={};m.role!==xe&&(j.role=m.role),m.status&&(j.status=m.status);const I=await s.getPassportsByRole({input:{teamDid:p,query:j,paging:{page:m.page,pageSize:m.pageSize}}});return{passports:I.passports||[],total:I.paging.total}},{refreshDeps:[m.role,m.status,m.page,m.pageSize],onError:j=>D.error(j.message)}),v=j=>w?.find(R=>R.key===j)?.value||0,y=b.useMemo(()=>Object.keys(i).map(j=>({name:j,title:i[j],num:v(j)})),[w,v]),C=b.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:(j,{rowIndex:I})=>{const R=a?.passports[I];return e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(Ee,{createPassportSvg:c,passport:R,teamDid:p}),e.jsx(t,{children:ne(R.title)})]})}}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:j=>ie(j,d)}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:le}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:j=>ve(j,f)}},{label:u("common.address"),name:"id",options:{customBodyRender:ms}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:(j,{rowIndex:I})=>{const R=a?.passports[I];return R.parentDid?Q("recover"):Q(R.source)}}}],[u,f,a?.passports,p,c,d]),T=j=>{g(I=>({...I,role:j,page:1}))},k=({page:j,rowsPerPage:I,searchText:R})=>{m.pageSize!==I?g(E=>({...E,searchText:"",pageSize:I,page:1})):m.page!==j+1?g(E=>({...E,searchText:"",page:j+1})):m.searchText!==R&&g(E=>({...E,searchText:R,page:1}))},L=b.useRef(null),U=a?.passports||[],Be=m.searchText?U.filter(j=>j.id.includes(m.searchText)||(j?.user?.fullName||"").includes(m.searchText)):U,Oe={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(j,{dataIndex:I},R){if(L.current?.contains(R.target)){const E=a?.passports[I];r(E)}},page:m.page-1,rowsPerPage:m.pageSize,count:a?.total||0,searchDebounceTime:600},Me=j=>{g(I=>({...I,status:j.target.value,page:1}))},_e=e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(t,{sx:{fontSize:16,fontWeight:400},children:[u("team.passport.status"),":"]}),e.jsxs(Xe,{size:"small",value:m.status,onChange:Me,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(J,{value:he,children:u("common.all")}),Object.values(M.PASSPORT_STATUS).map(j=>e.jsx(J,{value:j,sx:{py:1},children:u(`team.passport.statusMap.${j}`)},j))]})]});return x?e.jsx(t,{sx:{py:2},children:e.jsx(Y,{direction:"row",spacing:1,sx:{justifyContent:"center",alignItems:"center",position:"relative",pb:2},children:e.jsx(F,{})})}):e.jsxs(_s,{children:[e.jsxs(t,{className:"main",sx:{display:"flex",mt:0,gap:3},children:[e.jsx(t,{className:"left",children:e.jsx(t,{className:"tabs",children:y.map(j=>e.jsxs(t,{className:`tab ${m.role===j.name?"active":""}`,onClick:()=>T(j.name),children:[e.jsx("span",{className:"text",children:j.title}),e.jsx(t,{sx:{color:"text.secondary"},children:j.num})]},j.name))})}),e.jsx(t,{ref:L,className:"right",children:e.jsx(ae,{className:"main-table",verticalKeyWidth:100,locale:f,durable:n,durableKeys:["page","rowsPerPage"],data:Be,columns:C,options:Oe,loading:o,onChange:k,customButtons:[e.jsx(Fe,{createPassportSvg:c})],title:_e})})]}),l&&e.jsx(Ie,{createPassportSvg:c,onCancel:()=>r(null),passport:l,onSwitchPassport:r})]})}Ms.propTypes={createPassportSvg:S.func.isRequired};const _s=es(t)`
131
131
  .main {
132
132
  .left {
133
133
  width: 256px;
@@ -1,4 +1,4 @@
1
- import{j as e,T as i}from"./vendor-mui-core-DnR6WYuU.js";import{u as p,ai as c}from"./vendor-utils-DCMKu06e.js";import{l as x}from"./vendor-ux-B0gV9NvH.js";function y({name:t,nameFormatter:r=o=>typeof o=="string"?o.split(" ").map(f=>p(c(f))).join(" "):o,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return e.jsxs(u,{layout:n,width:m,...s,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const u=x("div")`
1
+ import{j as e,T as i}from"./vendor-mui-core-CKKG_1TN.js";import{v as p,aj as c}from"./vendor-utils-CUs2ebe7.js";import{l as x}from"./vendor-ux-DjXlxcvL.js";function v({name:t,nameFormatter:r=o=>typeof o=="string"?o.split(" ").map(f=>p(c(f))).join(" "):o,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return e.jsxs(d,{layout:n,width:m,...s,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const d=x("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -33,4 +33,4 @@ import{j as e,T as i}from"./vendor-mui-core-DnR6WYuU.js";import{u as p,ai as c}f
33
33
  margin-top: 8px;
34
34
  }
35
35
  }
36
- `;export{y as v};
36
+ `;export{v};
@@ -1,9 +1,9 @@
1
- import{r as j,g as ge}from"./vendor-react-CTtPmzVP.js";import{j as o,T as I,z as $,x as ye,cs as ve,ct as Y,ca as je,F as Ce,bf as Fe,aZ as Te,a6 as V,W as C,bX as be,a5 as we,I as K,at as G,ak as B,Q as Se,bi as Be,J as De,am as Re}from"./vendor-mui-core-DnR6WYuU.js";import{Z as M,aI as ae,G as le,c as Ne}from"./index-CQgzjKgB.js";import{V as _,aZ as ce,F as E,W as L,ac as ee,bu as Pe}from"./vendor-ux-B0gV9NvH.js";import{e as ue}from"./edit.svg-CTE5eATX.js";import{c as Ie}from"./lock.svg-CiT4rEpi.js";import{C as ze,M as Ee}from"./vendor-utils-DCMKu06e.js";import{f as pe}from"./index-DBs9Ljax.js";import{b as de}from"./team-DDjNXwXE.js";import{w as me,P as Me}from"./permission-BHvrn0M5.js";import{C as _e}from"./confirm-Lb1MrAdS.js";const ke=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.438 4.313H8.25a.188.188 0 0 0 .188-.188v.188h7.124v-.188a.19.19 0 0 0 .188.188h-.188V6h1.688V4.125c0-.827-.673-1.5-1.5-1.5h-7.5c-.827 0-1.5.673-1.5 1.5V6h1.688V4.312zM20.25 6H3.75a.75.75 0 0 0-.75.75v.75c0 .103.084.188.188.188h1.415l.579 12.257c.038.8.698 1.43 1.498 1.43h10.64c.802 0 1.46-.628 1.498-1.43l.579-12.258h1.416A.188.188 0 0 0 21 7.5v-.75a.75.75 0 0 0-.75-.75zm-3.11 13.688H6.86l-.567-12h11.414l-.567 12z"}));var W={exports:{}},H={exports:{}},te;function qe(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};H.exports=m}()),H.exports}var O,re;function ne(){if(re)return O;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return O=u,O}/*!
1
+ import{r as j,g as ge}from"./vendor-react-CTtPmzVP.js";import{j as o,T as I,z as $,x as ye,cs as ve,ct as Y,ca as je,F as Ce,bf as Fe,aZ as Te,a6 as V,W as C,bX as be,a5 as we,I as K,at as G,ak as B,Q as Se,bi as Be,J as De,am as Re}from"./vendor-mui-core-CKKG_1TN.js";import{Z as E,aI as ae,G as le,c as Ne}from"./index-BEfIUbZC.js";import{V as k,a_ as ce,F as _,W as L,ac as ee,bv as Pe}from"./vendor-ux-DjXlxcvL.js";import{e as ue}from"./edit.svg-CTE5eATX.js";import{c as Ie}from"./lock.svg-CiT4rEpi.js";import{D as ze,N as _e}from"./vendor-utils-CUs2ebe7.js";import{f as pe}from"./index-DBs9Ljax.js";import{b as de}from"./team-DkV63Yjl.js";import{w as me,P as Ee}from"./permission-CeqEAPPT.js";import{C as ke}from"./confirm-D6AvlbAp.js";const qe=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.438 4.313H8.25a.188.188 0 0 0 .188-.188v.188h7.124v-.188a.19.19 0 0 0 .188.188h-.188V6h1.688V4.125c0-.827-.673-1.5-1.5-1.5h-7.5c-.827 0-1.5.673-1.5 1.5V6h1.688V4.312zM20.25 6H3.75a.75.75 0 0 0-.75.75v.75c0 .103.084.188.188.188h1.415l.579 12.257c.038.8.698 1.43 1.498 1.43h10.64c.802 0 1.46-.628 1.498-1.43l.579-12.258h1.416A.188.188 0 0 0 21 7.5v-.75a.75.75 0 0 0-.75-.75zm-3.11 13.688H6.86l-.567-12h11.414l-.567 12z"}));var W={exports:{}},H={exports:{}},te;function Me(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};H.exports=m}()),H.exports}var O,re;function ne(){if(re)return O;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return O=u,O}/*!
2
2
  * Determine if an object is a Buffer
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */var U,se;function Ae(){if(se)return U;se=1,U=function(a){return a!=null&&(u(a)||m(a)||!!a._isBuffer)};function u(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function m(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&u(a.slice(0,0))}return U}var ie;function $e(){return ie||(ie=1,function(){var u=qe(),m=ne().utf8,a=Ae(),c=ne().bin,l=function(p,d){p.constructor==String?d&&d.encoding==="binary"?p=c.stringToBytes(p):p=m.stringToBytes(p):a(p)?p=Array.prototype.slice.call(p,0):!Array.isArray(p)&&p.constructor!==Uint8Array&&(p=p.toString());for(var s=u.bytesToWords(p),f=p.length*8,n=1732584193,t=-271733879,r=-1732584194,e=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[f>>>5]|=128<<f%32,s[(f+64>>>9<<4)+14]=f;for(var v=l._ff,g=l._gg,y=l._hh,x=l._ii,i=0;i<s.length;i+=16){var T=n,D=t,R=r,w=e;n=v(n,t,r,e,s[i+0],7,-680876936),e=v(e,n,t,r,s[i+1],12,-389564586),r=v(r,e,n,t,s[i+2],17,606105819),t=v(t,r,e,n,s[i+3],22,-1044525330),n=v(n,t,r,e,s[i+4],7,-176418897),e=v(e,n,t,r,s[i+5],12,1200080426),r=v(r,e,n,t,s[i+6],17,-1473231341),t=v(t,r,e,n,s[i+7],22,-45705983),n=v(n,t,r,e,s[i+8],7,1770035416),e=v(e,n,t,r,s[i+9],12,-1958414417),r=v(r,e,n,t,s[i+10],17,-42063),t=v(t,r,e,n,s[i+11],22,-1990404162),n=v(n,t,r,e,s[i+12],7,1804603682),e=v(e,n,t,r,s[i+13],12,-40341101),r=v(r,e,n,t,s[i+14],17,-1502002290),t=v(t,r,e,n,s[i+15],22,1236535329),n=g(n,t,r,e,s[i+1],5,-165796510),e=g(e,n,t,r,s[i+6],9,-1069501632),r=g(r,e,n,t,s[i+11],14,643717713),t=g(t,r,e,n,s[i+0],20,-373897302),n=g(n,t,r,e,s[i+5],5,-701558691),e=g(e,n,t,r,s[i+10],9,38016083),r=g(r,e,n,t,s[i+15],14,-660478335),t=g(t,r,e,n,s[i+4],20,-405537848),n=g(n,t,r,e,s[i+9],5,568446438),e=g(e,n,t,r,s[i+14],9,-1019803690),r=g(r,e,n,t,s[i+3],14,-187363961),t=g(t,r,e,n,s[i+8],20,1163531501),n=g(n,t,r,e,s[i+13],5,-1444681467),e=g(e,n,t,r,s[i+2],9,-51403784),r=g(r,e,n,t,s[i+7],14,1735328473),t=g(t,r,e,n,s[i+12],20,-1926607734),n=y(n,t,r,e,s[i+5],4,-378558),e=y(e,n,t,r,s[i+8],11,-2022574463),r=y(r,e,n,t,s[i+11],16,1839030562),t=y(t,r,e,n,s[i+14],23,-35309556),n=y(n,t,r,e,s[i+1],4,-1530992060),e=y(e,n,t,r,s[i+4],11,1272893353),r=y(r,e,n,t,s[i+7],16,-155497632),t=y(t,r,e,n,s[i+10],23,-1094730640),n=y(n,t,r,e,s[i+13],4,681279174),e=y(e,n,t,r,s[i+0],11,-358537222),r=y(r,e,n,t,s[i+3],16,-722521979),t=y(t,r,e,n,s[i+6],23,76029189),n=y(n,t,r,e,s[i+9],4,-640364487),e=y(e,n,t,r,s[i+12],11,-421815835),r=y(r,e,n,t,s[i+15],16,530742520),t=y(t,r,e,n,s[i+2],23,-995338651),n=x(n,t,r,e,s[i+0],6,-198630844),e=x(e,n,t,r,s[i+7],10,1126891415),r=x(r,e,n,t,s[i+14],15,-1416354905),t=x(t,r,e,n,s[i+5],21,-57434055),n=x(n,t,r,e,s[i+12],6,1700485571),e=x(e,n,t,r,s[i+3],10,-1894986606),r=x(r,e,n,t,s[i+10],15,-1051523),t=x(t,r,e,n,s[i+1],21,-2054922799),n=x(n,t,r,e,s[i+8],6,1873313359),e=x(e,n,t,r,s[i+15],10,-30611744),r=x(r,e,n,t,s[i+6],15,-1560198380),t=x(t,r,e,n,s[i+13],21,1309151649),n=x(n,t,r,e,s[i+4],6,-145523070),e=x(e,n,t,r,s[i+11],10,-1120210379),r=x(r,e,n,t,s[i+2],15,718787259),t=x(t,r,e,n,s[i+9],21,-343485551),n=n+T>>>0,t=t+D>>>0,r=r+R>>>0,e=e+w>>>0}return u.endian([n,t,r,e])};l._ff=function(p,d,s,f,n,t,r){var e=p+(d&s|~d&f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._gg=function(p,d,s,f,n,t,r){var e=p+(d&f|s&~f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._hh=function(p,d,s,f,n,t,r){var e=p+(d^s^f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._ii=function(p,d,s,f,n,t,r){var e=p+(s^(d|~f))+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._blocksize=16,l._digestsize=16,W.exports=function(p,d){if(p==null)throw new Error("Illegal argument "+p);var s=u.wordsToBytes(l(p,d));return d&&d.asBytes?s:d&&d.asString?c.bytesToString(s):u.bytesToHex(s)}}()),W.exports}var Le=$e();const We=ge(Le);function Z({teamDid:u,onCancel:m,onSuccess:a,onError:c=()=>{},mode:l="create",item:p={},orgId:d=""}){const{api:s}=M(),[f,n]=j.useState(!1),[t,r]=j.useState(""),{t:e}=_(),[i,v]=j.useState(p.title||""),[g,y]=j.useState(p.description||""),[x,T]=j.useState(p?.extra?.display||"builtin"),[D,R]=j.useState(p?.extra?.types?p.extra.types.join(","):""),w=async()=>{const h=i.trim();if(!h){r(e("team.passport.error.titleEmpty"));return}if(h.length>64){r(e("team.passport.error.titleTooLong",{length:64}));return}const N=g.replace(/\n/g," ");if(!N){r(e("team.passport.error.descriptionEmpty"));return}const z=l==="create"?We(d?`${d}-${h}`:h):p.name;r(null),n(!0);try{if(l==="create"){const S={teamDid:u,name:z,title:h,description:N,...d?{orgId:d}:{}};x==="custom"&&(S.extra=JSON.stringify({display:"custom",types:D.split(",")})),await s.createRole({input:S})}else{const S={teamDid:u,role:{name:z,title:h,description:N},...d?{orgId:d}:{}};await s.updateRole({input:S})}a()}catch(S){const q=pe(S);r(q),c(S)}finally{n(!1)}},k=o.jsxs("div",{children:[l==="update"&&o.jsx(I,{component:"div",style:{paddingTop:16},children:o.jsx($,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:p.name,disabled:!0})}),o.jsx(I,{component:"div",style:{marginTop:16},children:o.jsx($,{label:e("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:i,onChange:h=>{r(null),v(h.target.value)},disabled:l==="update"||f,helperText:e("team.passport.create.titleTip")})}),o.jsx(I,{component:"div",style:{marginTop:16,marginBottom:16},children:o.jsx($,{label:e("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:g,onChange:h=>{r(null),y(h.target.value)},disabled:f,multiline:!0,rows:3})}),l==="create"&&o.jsxs("div",{style:{marginBottom:16},children:[o.jsx(ye,{children:e("common.display")}),o.jsxs(ve,{color:"primary",size:"small",value:x,exclusive:!0,style:{marginTop:16},disabled:f,onChange:(h,N)=>T(N),"data-cy":"input-role-display",children:[o.jsx(Y,{value:"builtin","data-cy":"input-role-display-builtin",children:o.jsx(I,{children:e("team.passport.displayBuiltin")})}),o.jsx(Y,{value:"custom","data-cy":"input-role-display-custom",children:o.jsx(I,{children:e("team.passport.displayCustom")})})]}),x==="custom"&&o.jsxs(o.Fragment,{children:[o.jsx(je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:D,disabled:f,onChange:h=>{R(h.target.value)}}),o.jsx(Ce,{children:e("team.passport.typesTip")})]})]})]});return o.jsxs(ce,{title:l==="create"?e("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:m,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[o.jsx(E,{onClick:m,color:"inherit",children:e("common.cancel")}),o.jsxs(E,{"data-cy":"mutate-role-confirm",onClick:w,color:"primary",disabled:f,variant:"contained",autoFocus:!0,children:[f&&o.jsx(V,{size:16}),e(l==="create"?"common.create":"common.update")]})]}),children:[o.jsx(Fe,{component:"div",children:k}),!!t&&o.jsx(Te,{severity:"error",style:{width:"100%",margin:0},children:t})]})}Z.propTypes={teamDid:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["create","update"]),item:C.object,orgId:C.string};function J({onCancel:u,onSuccess:m,onDelete:a,roleName:c,roles:l=void 0,hasPermission:p=!1,orgId:d=""}){const{api:s}=M(),{roles:f,permissions:n,teamDid:t,refresh:r,isNodeTeam:e}=de(),{t:i}=_(),[v,g]=j.useState([]),[y,x]=j.useState(!1),[T,D]=j.useState(null),[R,w]=j.useState(!1),k=j.useMemo(()=>l||f,[l,f]),h=ze(k.find(F=>F.name===c)),N=ae(c),z=async F=>{if(!R)try{w(!0),await s.deleteRole({input:{teamDid:t,name:F}}),a()}catch(b){L.error(b.message)}finally{w(!1),D(null)}},S=async(F,b)=>{const fe=(await s.getPermissionsByRole({input:{teamDid:F,role:{name:b}}})).permissions||[],he=n.map(X=>({...X,bind:fe.some(xe=>xe.name===X.name)}));g(he)},q=async()=>{w(!0);const F=v.filter(b=>b.bind).map(b=>b.name);try{await s.updatePermissionsForRole({input:{teamDid:t,roleName:h.name,grantNames:F}}),L.success(i("common.saveSuccess")),m()}catch(b){L.error(pe(b))}finally{w(!1)}};j.useEffect(()=>{t&&c&&S(t,c)},[t,c]);const A=e||!p;let Q=null;return e&&(Q=o.jsxs("div",{className:"bind",children:[o.jsx("div",{className:"title",children:i("common.permission")}),o.jsx("div",{className:"list",children:v.filter(F=>A?F.bind:!0).map(F=>o.jsx("div",{className:"item",children:o.jsx(be,{control:o.jsx(we,{disabled:A,checked:F.bind,onChange:()=>{g(b=>b.map(P=>(P.name===F.name&&(P.bind=!P.bind),P)))},name:F.name}),label:F.description})}))})]})),o.jsxs(ce,{title:i("common.passport"),onClose:u,open:!0,fullWidth:!0,toolbar:p&&!N&&o.jsxs(o.Fragment,{children:[o.jsx(K,{onClick:()=>x(h),"data-cy":`edit-passport-${h.name}`,size:"large",children:o.jsx(ue,{fill:"#bfbfbf"})}),o.jsx(K,{onClick:()=>D({title:i("team.passport.delete.title"),description:i("team.passport.delete.description",{name:h.title}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>{z(h.name)},onCancel:()=>{w(!1),D(null)}}),"data-cy":`delete-passport-${h.name}`,size:"large",children:o.jsx(ke,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:e&&!A&&o.jsxs(o.Fragment,{children:[o.jsx(E,{onClick:u,color:"inherit",children:i("common.cancel")}),o.jsxs(E,{onClick:q,color:"primary",disabled:R||!h,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[R&&o.jsx(V,{size:16}),i("common.save")]})]}),children:[o.jsxs(Ve,{children:[!h&&o.jsx(Ge,{children:o.jsx(V,{})}),h&&o.jsxs("div",{className:"dialog-content",children:[o.jsxs("div",{className:"header",children:[o.jsx("div",{className:"title",children:h.title}),o.jsx("div",{className:"description",style:{marginTop:e?16:48},children:h.description})]}),Q]})]}),y&&o.jsx(Z,{teamDid:t,onCancel:()=>x(null),onSuccess:()=>{x(null),d?m():r()},mode:"update",roleName:y.name,item:y,orgId:d}),T&&o.jsx(_e,{title:T.title,description:T.description,confirm:T.confirm,cancel:T.cancel,params:T.params,onConfirm:T.onConfirm,onCancel:T.onCancel})]})}const He=me(J,"mutate_team"),Oe=me(J,"",le);function Ue(u){const{inService:m}=M();return m?o.jsx(Oe,{...u}):o.jsx(He,{...u})}J.propTypes={roleName:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onDelete:C.func.isRequired,hasPermission:C.bool,roles:C.array,orgId:C.string};const Ve=G.div`
6
+ */var U,se;function Ae(){if(se)return U;se=1,U=function(a){return a!=null&&(u(a)||m(a)||!!a._isBuffer)};function u(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function m(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&u(a.slice(0,0))}return U}var ie;function $e(){return ie||(ie=1,function(){var u=Me(),m=ne().utf8,a=Ae(),c=ne().bin,l=function(p,d){p.constructor==String?d&&d.encoding==="binary"?p=c.stringToBytes(p):p=m.stringToBytes(p):a(p)?p=Array.prototype.slice.call(p,0):!Array.isArray(p)&&p.constructor!==Uint8Array&&(p=p.toString());for(var s=u.bytesToWords(p),f=p.length*8,n=1732584193,t=-271733879,r=-1732584194,e=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[f>>>5]|=128<<f%32,s[(f+64>>>9<<4)+14]=f;for(var v=l._ff,g=l._gg,y=l._hh,x=l._ii,i=0;i<s.length;i+=16){var T=n,D=t,R=r,w=e;n=v(n,t,r,e,s[i+0],7,-680876936),e=v(e,n,t,r,s[i+1],12,-389564586),r=v(r,e,n,t,s[i+2],17,606105819),t=v(t,r,e,n,s[i+3],22,-1044525330),n=v(n,t,r,e,s[i+4],7,-176418897),e=v(e,n,t,r,s[i+5],12,1200080426),r=v(r,e,n,t,s[i+6],17,-1473231341),t=v(t,r,e,n,s[i+7],22,-45705983),n=v(n,t,r,e,s[i+8],7,1770035416),e=v(e,n,t,r,s[i+9],12,-1958414417),r=v(r,e,n,t,s[i+10],17,-42063),t=v(t,r,e,n,s[i+11],22,-1990404162),n=v(n,t,r,e,s[i+12],7,1804603682),e=v(e,n,t,r,s[i+13],12,-40341101),r=v(r,e,n,t,s[i+14],17,-1502002290),t=v(t,r,e,n,s[i+15],22,1236535329),n=g(n,t,r,e,s[i+1],5,-165796510),e=g(e,n,t,r,s[i+6],9,-1069501632),r=g(r,e,n,t,s[i+11],14,643717713),t=g(t,r,e,n,s[i+0],20,-373897302),n=g(n,t,r,e,s[i+5],5,-701558691),e=g(e,n,t,r,s[i+10],9,38016083),r=g(r,e,n,t,s[i+15],14,-660478335),t=g(t,r,e,n,s[i+4],20,-405537848),n=g(n,t,r,e,s[i+9],5,568446438),e=g(e,n,t,r,s[i+14],9,-1019803690),r=g(r,e,n,t,s[i+3],14,-187363961),t=g(t,r,e,n,s[i+8],20,1163531501),n=g(n,t,r,e,s[i+13],5,-1444681467),e=g(e,n,t,r,s[i+2],9,-51403784),r=g(r,e,n,t,s[i+7],14,1735328473),t=g(t,r,e,n,s[i+12],20,-1926607734),n=y(n,t,r,e,s[i+5],4,-378558),e=y(e,n,t,r,s[i+8],11,-2022574463),r=y(r,e,n,t,s[i+11],16,1839030562),t=y(t,r,e,n,s[i+14],23,-35309556),n=y(n,t,r,e,s[i+1],4,-1530992060),e=y(e,n,t,r,s[i+4],11,1272893353),r=y(r,e,n,t,s[i+7],16,-155497632),t=y(t,r,e,n,s[i+10],23,-1094730640),n=y(n,t,r,e,s[i+13],4,681279174),e=y(e,n,t,r,s[i+0],11,-358537222),r=y(r,e,n,t,s[i+3],16,-722521979),t=y(t,r,e,n,s[i+6],23,76029189),n=y(n,t,r,e,s[i+9],4,-640364487),e=y(e,n,t,r,s[i+12],11,-421815835),r=y(r,e,n,t,s[i+15],16,530742520),t=y(t,r,e,n,s[i+2],23,-995338651),n=x(n,t,r,e,s[i+0],6,-198630844),e=x(e,n,t,r,s[i+7],10,1126891415),r=x(r,e,n,t,s[i+14],15,-1416354905),t=x(t,r,e,n,s[i+5],21,-57434055),n=x(n,t,r,e,s[i+12],6,1700485571),e=x(e,n,t,r,s[i+3],10,-1894986606),r=x(r,e,n,t,s[i+10],15,-1051523),t=x(t,r,e,n,s[i+1],21,-2054922799),n=x(n,t,r,e,s[i+8],6,1873313359),e=x(e,n,t,r,s[i+15],10,-30611744),r=x(r,e,n,t,s[i+6],15,-1560198380),t=x(t,r,e,n,s[i+13],21,1309151649),n=x(n,t,r,e,s[i+4],6,-145523070),e=x(e,n,t,r,s[i+11],10,-1120210379),r=x(r,e,n,t,s[i+2],15,718787259),t=x(t,r,e,n,s[i+9],21,-343485551),n=n+T>>>0,t=t+D>>>0,r=r+R>>>0,e=e+w>>>0}return u.endian([n,t,r,e])};l._ff=function(p,d,s,f,n,t,r){var e=p+(d&s|~d&f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._gg=function(p,d,s,f,n,t,r){var e=p+(d&f|s&~f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._hh=function(p,d,s,f,n,t,r){var e=p+(d^s^f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._ii=function(p,d,s,f,n,t,r){var e=p+(s^(d|~f))+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._blocksize=16,l._digestsize=16,W.exports=function(p,d){if(p==null)throw new Error("Illegal argument "+p);var s=u.wordsToBytes(l(p,d));return d&&d.asBytes?s:d&&d.asString?c.bytesToString(s):u.bytesToHex(s)}}()),W.exports}var Le=$e();const We=ge(Le);function Z({teamDid:u,onCancel:m,onSuccess:a,onError:c=()=>{},mode:l="create",item:p={},orgId:d=""}){const{api:s}=E(),[f,n]=j.useState(!1),[t,r]=j.useState(""),{t:e}=k(),[i,v]=j.useState(p.title||""),[g,y]=j.useState(p.description||""),[x,T]=j.useState(p?.extra?.display||"builtin"),[D,R]=j.useState(p?.extra?.types?p.extra.types.join(","):""),w=async()=>{const h=i.trim();if(!h){r(e("team.passport.error.titleEmpty"));return}if(h.length>64){r(e("team.passport.error.titleTooLong",{length:64}));return}const N=g.replace(/\n/g," ");if(!N){r(e("team.passport.error.descriptionEmpty"));return}const z=l==="create"?We(d?`${d}-${h}`:h):p.name;r(null),n(!0);try{if(l==="create"){const S={teamDid:u,name:z,title:h,description:N,...d?{orgId:d}:{}};x==="custom"&&(S.extra=JSON.stringify({display:"custom",types:D.split(",")})),await s.createRole({input:S})}else{const S={teamDid:u,role:{name:z,title:h,description:N},...d?{orgId:d}:{}};await s.updateRole({input:S})}a()}catch(S){const M=pe(S);r(M),c(S)}finally{n(!1)}},q=o.jsxs("div",{children:[l==="update"&&o.jsx(I,{component:"div",style:{paddingTop:16},children:o.jsx($,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:p.name,disabled:!0})}),o.jsx(I,{component:"div",style:{marginTop:16},children:o.jsx($,{label:e("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:i,onChange:h=>{r(null),v(h.target.value)},disabled:l==="update"||f,helperText:e("team.passport.create.titleTip")})}),o.jsx(I,{component:"div",style:{marginTop:16,marginBottom:16},children:o.jsx($,{label:e("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:g,onChange:h=>{r(null),y(h.target.value)},disabled:f,multiline:!0,rows:3})}),l==="create"&&o.jsxs("div",{style:{marginBottom:16},children:[o.jsx(ye,{children:e("common.display")}),o.jsxs(ve,{color:"primary",size:"small",value:x,exclusive:!0,style:{marginTop:16},disabled:f,onChange:(h,N)=>T(N),"data-cy":"input-role-display",children:[o.jsx(Y,{value:"builtin","data-cy":"input-role-display-builtin",children:o.jsx(I,{children:e("team.passport.displayBuiltin")})}),o.jsx(Y,{value:"custom","data-cy":"input-role-display-custom",children:o.jsx(I,{children:e("team.passport.displayCustom")})})]}),x==="custom"&&o.jsxs(o.Fragment,{children:[o.jsx(je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:D,disabled:f,onChange:h=>{R(h.target.value)}}),o.jsx(Ce,{children:e("team.passport.typesTip")})]})]})]});return o.jsxs(ce,{title:l==="create"?e("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:m,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[o.jsx(_,{onClick:m,color:"inherit",children:e("common.cancel")}),o.jsxs(_,{"data-cy":"mutate-role-confirm",onClick:w,color:"primary",disabled:f,variant:"contained",autoFocus:!0,children:[f&&o.jsx(V,{size:16}),e(l==="create"?"common.create":"common.update")]})]}),children:[o.jsx(Fe,{component:"div",children:q}),!!t&&o.jsx(Te,{severity:"error",style:{width:"100%",margin:0},children:t})]})}Z.propTypes={teamDid:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["create","update"]),item:C.object,orgId:C.string};function J({onCancel:u,onSuccess:m,onDelete:a,roleName:c,roles:l=void 0,hasPermission:p=!1,orgId:d=""}){const{api:s}=E(),{roles:f,permissions:n,teamDid:t,refresh:r,isNodeTeam:e}=de(),{t:i}=k(),[v,g]=j.useState([]),[y,x]=j.useState(!1),[T,D]=j.useState(null),[R,w]=j.useState(!1),q=j.useMemo(()=>l||f,[l,f]),h=ze(q.find(F=>F.name===c)),N=ae(c),z=async F=>{if(!R)try{w(!0),await s.deleteRole({input:{teamDid:t,name:F}}),a()}catch(b){L.error(b.message)}finally{w(!1),D(null)}},S=async(F,b)=>{const fe=(await s.getPermissionsByRole({input:{teamDid:F,role:{name:b}}})).permissions||[],he=n.map(X=>({...X,bind:fe.some(xe=>xe.name===X.name)}));g(he)},M=async()=>{w(!0);const F=v.filter(b=>b.bind).map(b=>b.name);try{await s.updatePermissionsForRole({input:{teamDid:t,roleName:h.name,grantNames:F}}),L.success(i("common.saveSuccess")),m()}catch(b){L.error(pe(b))}finally{w(!1)}};j.useEffect(()=>{t&&c&&S(t,c)},[t,c]);const A=e||!p;let Q=null;return e&&(Q=o.jsxs("div",{className:"bind",children:[o.jsx("div",{className:"title",children:i("common.permission")}),o.jsx("div",{className:"list",children:v.filter(F=>A?F.bind:!0).map(F=>o.jsx("div",{className:"item",children:o.jsx(be,{control:o.jsx(we,{disabled:A,checked:F.bind,onChange:()=>{g(b=>b.map(P=>(P.name===F.name&&(P.bind=!P.bind),P)))},name:F.name}),label:F.description})}))})]})),o.jsxs(ce,{title:i("common.passport"),onClose:u,open:!0,fullWidth:!0,toolbar:p&&!N&&o.jsxs(o.Fragment,{children:[o.jsx(K,{onClick:()=>x(h),"data-cy":`edit-passport-${h.name}`,size:"large",children:o.jsx(ue,{fill:"#bfbfbf"})}),o.jsx(K,{onClick:()=>D({title:i("team.passport.delete.title"),description:i("team.passport.delete.description",{name:h.title}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>{z(h.name)},onCancel:()=>{w(!1),D(null)}}),"data-cy":`delete-passport-${h.name}`,size:"large",children:o.jsx(qe,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:e&&!A&&o.jsxs(o.Fragment,{children:[o.jsx(_,{onClick:u,color:"inherit",children:i("common.cancel")}),o.jsxs(_,{onClick:M,color:"primary",disabled:R||!h,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[R&&o.jsx(V,{size:16}),i("common.save")]})]}),children:[o.jsxs(Ve,{children:[!h&&o.jsx(Ge,{children:o.jsx(V,{})}),h&&o.jsxs("div",{className:"dialog-content",children:[o.jsxs("div",{className:"header",children:[o.jsx("div",{className:"title",children:h.title}),o.jsx("div",{className:"description",style:{marginTop:e?16:48},children:h.description})]}),Q]})]}),y&&o.jsx(Z,{teamDid:t,onCancel:()=>x(null),onSuccess:()=>{x(null),d?m():r()},mode:"update",roleName:y.name,item:y,orgId:d}),T&&o.jsx(ke,{title:T.title,description:T.description,confirm:T.confirm,cancel:T.cancel,params:T.params,onConfirm:T.onConfirm,onCancel:T.onCancel})]})}const He=me(J,"mutate_team"),Oe=me(J,"",le);function Ue(u){const{inService:m}=E();return m?o.jsx(Oe,{...u}):o.jsx(He,{...u})}J.propTypes={roleName:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onDelete:C.func.isRequired,hasPermission:C.bool,roles:C.array,orgId:C.string};const Ve=G.div`
7
7
  .header {
8
8
  .title {
9
9
  font-weight: 400;
@@ -52,7 +52,7 @@ import{r as j,g as ge}from"./vendor-react-CTtPmzVP.js";import{j as o,T as I,z as
52
52
  justify-content: center;
53
53
  align-items: center;
54
54
  height: 200px;
55
- `,oe=j.memo(({field:u,value:m,copyable:a})=>{const{local:c}=_();return m?o.jsxs(B,{onClick:l=>l.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1},children:[u?o.jsxs(ee,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[u,":"]}):null,o.jsx(ee,{variant:"body1",children:o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx(Re,{title:m,children:o.jsx("span",{className:"value-ellipsis",children:m})}),a?o.jsx(Pe,{content:Ee(m),locale:c,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null}),Ze=j.memo(({role:u={},createPassportSvg:m,onUpdate:a,passportProps:c={},actions:l=null})=>{const{inService:p}=M(),d=De(f=>f.breakpoints.down("md")),s=j.useMemo(()=>u.name&&!Ne.ROLES[u.name.toUpperCase()],[u]);return o.jsxs(B,{"data-cy":`passport-${u.name}`,className:"item",onClick:()=>a(u),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:m({title:u.title,ownerName:"Your Name",width:"150px",...c})}}),o.jsxs(B,{className:"title",sx:{ml:3},children:[o.jsx(oe,{value:u.title}),s?o.jsx(oe,{value:u.name,copyable:!0}):null]})]}),!d&&o.jsx(B,{className:"description",children:u.description}),l||o.jsx(Me,{permission:p?"":"mutate_team",role:p?le:[],children:o.jsx("div",{className:"action",children:ae(u.name)?o.jsx(Ie,{}):o.jsx(ue,{})})})]},u.name)});function Je({createPassportSvg:u}){const{roles:m,teamIssuerDid:a,teamName:c,refresh:l,passportColor:p,teamDid:d,isNodeTeam:s}=de(),{t:f}=_(),[n,t]=j.useState(!1),[r,e]=j.useState(!1);return o.jsxs(Qe,{sx:{mt:0},children:[o.jsx(B,{sx:{display:"flex",justifyContent:"flex-end"},children:!s&&o.jsxs(Se,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[o.jsx(Be,{style:{fontSize:16,marginRight:4}}),f("team.passport.create.title")]})}),o.jsx(B,{className:"list",children:m.map(i=>o.jsx(Ze,{role:i,createPassportSvg:u,onUpdate:e,passportProps:{issuer:c,issuerDid:a,ownerDid:a,preferredColor:p}}))}),r&&o.jsx(Ue,{onCancel:()=>e(!1),onSuccess:()=>{e(!1),l()},onDelete:()=>{e(!1),l()},mode:"update",roleName:r.name,item:r}),n&&o.jsx(Z,{teamDid:d,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const Qe=G(B)`
55
+ `,oe=j.memo(({field:u,value:m,copyable:a})=>{const{local:c}=k();return m?o.jsxs(B,{onClick:l=>l.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1},children:[u?o.jsxs(ee,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[u,":"]}):null,o.jsx(ee,{variant:"body1",children:o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx(Re,{title:m,children:o.jsx("span",{className:"value-ellipsis",children:m})}),a?o.jsx(Pe,{content:_e(m),locale:c,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null}),Ze=j.memo(({role:u={},createPassportSvg:m,onUpdate:a,passportProps:c={},actions:l=null})=>{const{inService:p}=E(),d=De(f=>f.breakpoints.down("md")),s=j.useMemo(()=>u.name&&!Ne.ROLES[u.name.toUpperCase()],[u]);return o.jsxs(B,{"data-cy":`passport-${u.name}`,className:"item",onClick:()=>a(u),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:m({title:u.title,ownerName:"Your Name",width:"150px",...c})}}),o.jsxs(B,{className:"title",sx:{ml:3},children:[o.jsx(oe,{value:u.title}),s?o.jsx(oe,{value:u.name,copyable:!0}):null]})]}),!d&&o.jsx(B,{className:"description",children:u.description}),l||o.jsx(Ee,{permission:p?"":"mutate_team",role:p?le:[],children:o.jsx("div",{className:"action",children:ae(u.name)?o.jsx(Ie,{}):o.jsx(ue,{})})})]},u.name)});function Je({createPassportSvg:u}){const{roles:m,teamIssuerDid:a,teamName:c,refresh:l,passportColor:p,teamDid:d,isNodeTeam:s}=de(),{t:f}=k(),[n,t]=j.useState(!1),[r,e]=j.useState(!1);return o.jsxs(Qe,{sx:{mt:0},children:[o.jsx(B,{sx:{display:"flex",justifyContent:"flex-end"},children:!s&&o.jsxs(Se,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[o.jsx(Be,{style:{fontSize:16,marginRight:4}}),f("team.passport.create.title")]})}),o.jsx(B,{className:"list",children:m.map(i=>o.jsx(Ze,{role:i,createPassportSvg:u,onUpdate:e,passportProps:{issuer:c,issuerDid:a,ownerDid:a,preferredColor:p}}))}),r&&o.jsx(Ue,{onCancel:()=>e(!1),onSuccess:()=>{e(!1),l()},onDelete:()=>{e(!1),l()},mode:"update",roleName:r.name,item:r}),n&&o.jsx(Z,{teamDid:d,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const Qe=G(B)`
56
56
  .list {
57
57
  .item {
58
58
  padding: 12px;
@@ -90,4 +90,4 @@ import{r as j,g as ge}from"./vendor-react-CTtPmzVP.js";import{j as o,T as I,z as
90
90
  fill: ${({theme:u})=>u.palette.text.secondary};
91
91
  }
92
92
  }
93
- `;Je.propTypes={createPassportSvg:C.func.isRequired};export{Qe as D,Z as M,Ze as P,J as a,Je as b,ke as h};
93
+ `;Je.propTypes={createPassportSvg:C.func.isRequired};export{Qe as D,Z as M,Ze as P,J as a,Je as b,qe as h};