@abtnode/blocklet-services 1.16.43-beta-20250427-132304-6da95c55 → 1.16.43-beta-20250429-130236-269254ff

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 (296) hide show
  1. package/api/emails/_components/layout.js +2 -2
  2. package/api/emails/_libs/style.js +8 -3
  3. package/api/emails/_templates/kyc-code-verify.js +43 -0
  4. package/api/emails/_templates/new-user-session.js +2 -6
  5. package/api/emails/_templates/notification.js +2 -6
  6. package/api/emails/_templates/verify-code-body.js +4 -1
  7. package/api/emails/_templates/verify-code.js +2 -6
  8. package/api/index.js +31 -2
  9. package/api/libs/email.js +16 -0
  10. package/api/routes/blocklet.js +26 -17
  11. package/api/routes/ocap.js +1 -1
  12. package/api/routes/user.js +1 -1
  13. package/api/services/auth/session.js +2 -2
  14. package/api/services/kyc/index.js +5 -11
  15. package/dist/assets/{AdapterDayjs-BUGplkxR.js → AdapterDayjs-D5LoqHiU.js} +1 -1
  16. package/dist/assets/{ArrowDropDown-B0sLkJoY.js → ArrowDropDown-BCCa5uRn.js} +1 -1
  17. package/dist/assets/{CheckCircle-BNrN9mgy.js → CheckCircle-Bxk_pKUt.js} +1 -1
  18. package/dist/assets/{ChevronLeft-Dq00IS01.js → ChevronLeft-DgTQnUwX.js} +1 -1
  19. package/dist/assets/{ChevronRight-ZTqWK-Ga.js → ChevronRight-C-lajCDc.js} +1 -1
  20. package/dist/assets/{Community-DZCTPNMP.js → Community-DathqRsd.js} +1 -1
  21. package/dist/assets/{DeleteOutline-C2sY6hfm.js → DeleteOutline-Csdx_lih.js} +1 -1
  22. package/dist/assets/{Done-JLiLhELm.js → Done-DjB4uf97.js} +1 -1
  23. package/dist/assets/{Download-Ch4RfGRW.js → Download-CF6ZhZfD.js} +1 -1
  24. package/dist/assets/{Edit-CY6fFHQM.js → Edit-C-zkyYSj.js} +1 -1
  25. package/dist/assets/{EditIcon-Bi2cR-_u.js → EditIcon-DWRQ3fi6.js} +1 -1
  26. package/dist/assets/{Email-Dz2Eyqu0.js → Email-B0n6rLUZ.js} +1 -1
  27. package/dist/assets/{Error-CSFUqG0m.js → Error-DnzvDd2d.js} +1 -1
  28. package/dist/assets/{ExpandLess-BiMmSOBl.js → ExpandLess-DBN4huDO.js} +1 -1
  29. package/dist/assets/{Google-GOp5YvmZ.js → Google-VfyWFLKO.js} +1 -1
  30. package/dist/assets/{Holiday-Lc6woG1j.js → Holiday-BkY6LMfd.js} +1 -1
  31. package/dist/assets/{InfoOutlined-CQB5qKm-.js → InfoOutlined-BMb9Zu84.js} +1 -1
  32. package/dist/assets/{Launch-fxgQvk19.js → Launch-CVPYIHzD.js} +1 -1
  33. package/dist/assets/{LaunchOutlined-BV4_W1pb.js → LaunchOutlined-faHvtBle.js} +1 -1
  34. package/dist/assets/{Location-B8EOY3d0.js → Location-BQhEvGNL.js} +1 -1
  35. package/dist/assets/{LockIcon-fuTfhB_G.js → LockIcon-Bd69pSJI.js} +1 -1
  36. package/dist/assets/{Meeting-Epdyx36z.js → Meeting-BW-_XtSL.js} +1 -1
  37. package/dist/assets/{MoreHoriz-CX_pwfPT.js → MoreHoriz-CT231fLS.js} +1 -1
  38. package/dist/assets/{OffSick-VYgugWxu.js → OffSick-9I8vBA8l.js} +1 -1
  39. package/dist/assets/{Phone-KP65huHK.js → Phone-CKzC4712.js} +1 -1
  40. package/dist/assets/{PlayArrow-DFH1Psjx.js → PlayArrow-CVHX5RbU.js} +1 -1
  41. package/dist/assets/{QuestionMarkCircle-p6m3avKp.js → QuestionMarkCircle-DpFFQWud.js} +1 -1
  42. package/dist/assets/{ServerLogo-Bssx1Eou.js → ServerLogo-AfxVBRdi.js} +1 -1
  43. package/dist/assets/{Timezone-Ce4E1Xey.js → Timezone-C3hiNX6j.js} +1 -1
  44. package/dist/assets/{TuneOutlined-Dy2qPFGI.js → TuneOutlined-DcBuSd1o.js} +1 -1
  45. package/dist/assets/{ViewList-e3CoNi3K.js → ViewList-rVo7d5VV.js} +1 -1
  46. package/dist/assets/{WorkingRemotely-CXFJ6pz8.js → WorkingRemotely-CHzRY2CT.js} +1 -1
  47. package/dist/assets/access-control-Cum8iIaB.js +14 -0
  48. package/dist/assets/{actions-DA-6s_nQ.js → actions-D-Helr6n.js} +1 -1
  49. package/dist/assets/{add-component-core-DG9mQFsr.js → add-component-core-kWUUw0fB.js} +43 -37
  50. package/dist/assets/add-resource-DEesv1LC.js +1 -0
  51. package/dist/assets/{addon-Bcc-Xwbf.js → addon-B5zwPHe5.js} +1 -1
  52. package/dist/assets/{advanced-DTe2fs5L.js → advanced-CjSPlkxp.js} +1 -1
  53. package/dist/assets/api-BkKTvlm_.js +1 -0
  54. package/dist/assets/appearance-rlMOco_Q.js +1 -0
  55. package/dist/assets/ar-BRKjvO8p.js +1 -0
  56. package/dist/assets/ar-Duy7ZH--.js +7 -0
  57. package/dist/assets/audit-logs-BpacJ0mq.js +35 -0
  58. package/dist/assets/{authorize-DUyL7MEU.js → authorize-Dup4yiJg.js} +1 -1
  59. package/dist/assets/{base32-p9VcJrwv.js → base32-yUUlhgnG.js} +1 -1
  60. package/dist/assets/branding-3E94pu9e.js +54 -0
  61. package/dist/assets/{branding-_VO2ZZ3t.js → branding-BB4z7dex.js} +2 -2
  62. package/dist/assets/bundle-avatar-njRzpG6o.js +1 -0
  63. package/dist/assets/button-DRqMfYjF.js +1 -0
  64. package/dist/assets/{click-to-copy-BGyXQL2i.js → click-to-copy-CSwBjJDI.js} +1 -1
  65. package/dist/assets/cloneDeep-Cg0h_FaY.js +1 -0
  66. package/dist/assets/complete-lhAOowgH.js +45 -0
  67. package/dist/assets/{component-5gjaNHCg.js → component-DG-t6Jac.js} +50 -46
  68. package/dist/assets/{config-Bh19ZUJ-.js → config-BWuaMoux.js} +1 -1
  69. package/dist/assets/config-Ct2icT-j.js +32 -0
  70. package/dist/assets/{config-navigation-Dvjz9nAh.js → config-navigation-BZ3T8tYK.js} +6 -6
  71. package/dist/assets/config-space-CKx83vmi.js +1 -0
  72. package/dist/assets/{confirm-DqvNmeoz.js → confirm-Bj4L0Vn8.js} +2 -2
  73. package/dist/assets/connect-BoejDqj-.js +5 -0
  74. package/dist/assets/connect-to-lcfZI_0b.js +1 -0
  75. package/dist/assets/connect-v2Zx9JEk.js +1 -0
  76. package/dist/assets/{content-layout-BPaAeaMQ.js → content-layout-C3Yd4mK9.js} +1 -1
  77. package/dist/assets/dashboard-0TEl6bJJ.js +280 -0
  78. package/dist/assets/de-D3cg0t9f.js +1 -0
  79. package/dist/assets/de-jJ-wrtW1.js +7 -0
  80. package/dist/assets/{delete-confirm-_BzUlhv2.js → delete-confirm-kpan5KFX.js} +1 -1
  81. package/dist/assets/did-address-CJZtrzhT.js +1 -0
  82. package/dist/assets/{domain-ag7_Ivc1.js → domain-C8nJlURa.js} +1 -1
  83. package/dist/assets/domain-action-card-BZ3CFKs5.js +24 -0
  84. package/dist/assets/domains-Cn_DfzNS.js +1 -0
  85. package/dist/assets/{dot-BE1YP292.js → dot-CaKxEi_0.js} +2 -2
  86. package/dist/assets/{email-DKpgximx.js → email-BjCEb0WI.js} +2 -2
  87. package/dist/assets/{empty-spinner-DmDm8XzF.js → empty-spinner-BYUFR95o.js} +1 -1
  88. package/dist/assets/es-CoGP0eAj.js +7 -0
  89. package/dist/assets/es-DPjqApVE.js +1 -0
  90. package/dist/assets/exchange-passport-B_b6xNH8.js +1 -0
  91. package/dist/assets/fr-Dscs9WsP.js +1 -0
  92. package/dist/assets/fr-yctlgsrj.js +7 -0
  93. package/dist/assets/{fuel-CcBzY6Bt.js → fuel-Dtvd1fJW.js} +1 -1
  94. package/dist/assets/{gen-access-key-DxKwgiGT.js → gen-access-key-DsGgHUvi.js} +1 -1
  95. package/dist/assets/get-safe-url-BTmcSfZP.js +1 -0
  96. package/dist/assets/get-safe-url-BYr2jgRv.js +1 -0
  97. package/dist/assets/hi-B8D3j6bs.js +1 -0
  98. package/dist/assets/hi-Dh_pGPBD.js +5 -0
  99. package/dist/assets/{home-Bi8fA3jh.js → home-ClwQWk4f.js} +1 -1
  100. package/dist/assets/{id-BderyGO5.js → id-DWMMQI0G.js} +1 -1
  101. package/dist/assets/id-cicarMJv.js +7 -0
  102. package/dist/assets/{iframe-DZ181i8X.js → iframe-B7H87IMw.js} +1 -1
  103. package/dist/assets/index-2eL6Ndgh.js +288 -0
  104. package/dist/assets/index-B9lBWxnt.js +113 -0
  105. package/dist/assets/index-BDaAwySV.js +1 -0
  106. package/dist/assets/index-BOvzhuNp.js +11 -0
  107. package/dist/assets/{index-BT0GBmWF.js → index-BUHlfcy3.js} +1 -1
  108. package/dist/assets/index-BUrD6xiH.js +241 -0
  109. package/dist/assets/index-Bco7nZ5q.js +6 -0
  110. package/dist/assets/{index-SDdS_qt8.js → index-Bt7GP-dU.js} +1 -1
  111. package/dist/assets/{index-CYeIiQ6Q.js → index-C-rP7qS0.js} +1 -1
  112. package/dist/assets/{index-DyxFC42L.js → index-C1UHqpp3.js} +3 -3
  113. package/dist/assets/index-CEmSUlto.js +192 -0
  114. package/dist/assets/{index-CHbpkZwO.js → index-CMFOn8T3.js} +1 -1
  115. package/dist/assets/index-CVKN_Jn1.js +55 -0
  116. package/dist/assets/index-Cb1OPKJL.js +708 -0
  117. package/dist/assets/index-CjZLIV87.js +10 -0
  118. package/dist/assets/{index-Dl4W1N74.js → index-Cx-tuAMi.js} +1 -1
  119. package/dist/assets/index-D9eW5l3E.js +345 -0
  120. package/dist/assets/index-DAer_mWn.js +137 -0
  121. package/dist/assets/{index-n0Q-fETi.js → index-DHIWtN6I.js} +5 -5
  122. package/dist/assets/{index-DKhrYmrN.js → index-DIe9psLc.js} +1 -1
  123. package/dist/assets/{index-YbJjfDTR.js → index-DyKjKMmu.js} +1 -1
  124. package/dist/assets/{index-DuH8q5ir.js → index-M6peJL7s.js} +1 -1
  125. package/dist/assets/index-a0ZdM5aG.js +4 -0
  126. package/dist/assets/{index-CGBZONPv.js → index-i5c4XeO-.js} +1 -1
  127. package/dist/assets/{invitation-BrAZQXQL.js → invitation-DGRUoRzD.js} +3 -3
  128. package/dist/assets/invite-uoA9amq7.js +1 -0
  129. package/dist/assets/{issue-passport-Dd_yyO08.js → issue-passport-2LsCG1Ym.js} +1 -1
  130. package/dist/assets/item-taL0aTyr.js +2 -0
  131. package/dist/assets/ja-3LoBq68U.js +1 -0
  132. package/dist/assets/ja-Bm56AvcM.js +7 -0
  133. package/dist/assets/ko-B0ZZ2RWO.js +7 -0
  134. package/dist/assets/ko-B2dxwXDl.js +1 -0
  135. package/dist/assets/landing-page-EY5bGAu7.js +1 -0
  136. package/dist/assets/{launch-result-message-C9huWJUf.js → launch-result-message-B_fS-f90.js} +1 -1
  137. package/dist/assets/{layout-Cw-hwCHs.js → layout-DAempiIX.js} +1 -1
  138. package/dist/assets/list-B1E5dxgu.js +236 -0
  139. package/dist/assets/list-header-8k1_C0K0.js +1 -0
  140. package/dist/assets/localization-Di0I0VVv.js +1 -0
  141. package/dist/assets/{log-Chqr_or_.js → log-CL673QLU.js} +1 -1
  142. package/dist/assets/{logger-zix81YaM.js → logger-OMyVyA8K.js} +1 -1
  143. package/dist/assets/login-CsMJeMSS.js +1 -0
  144. package/dist/assets/login-oauth-callback-Bh6TJ59S.js +1 -0
  145. package/dist/assets/{logo-uploader-CJrdpVcQ.js → logo-uploader-DFGj09Gp.js} +20 -19
  146. package/dist/assets/{lost-passport-Do1Pl0xI.js → lost-passport-D00cnWl_.js} +2 -2
  147. package/dist/assets/lottie-error-CMOXHtBH.js +1 -0
  148. package/dist/assets/lottie-loading-o-GBrhM9.js +1 -0
  149. package/dist/assets/lottie-welcome-C9B95FIi.js +1 -0
  150. package/dist/assets/omit-1zyydTZL.js +1 -0
  151. package/dist/assets/{open-window-D8MZhu_7.js → open-window-xLNOSl03.js} +1 -1
  152. package/dist/assets/{overview-DLA9wj6a.js → overview-Ds0WiSnv.js} +2 -2
  153. package/dist/assets/{page-header-CWY8mxlT.js → page-header-BXC_EZqA.js} +1 -1
  154. package/dist/assets/{passport-item-CWtlyIE_.js → passport-item-Dpr4rKdD.js} +1 -1
  155. package/dist/assets/{permission-BGM09622.js → permission-DDLyDuSn.js} +1 -1
  156. package/dist/assets/preferences-DXw1rfcr.js +1 -0
  157. package/dist/assets/profile-embed-co2rsGfl.js +1 -0
  158. package/dist/assets/pt-6Xqu-_a4.js +5 -0
  159. package/dist/assets/pt-eei1_Z4R.js +1 -0
  160. package/dist/assets/publish-resource-CBR18Gc3.js +1 -0
  161. package/dist/assets/{react-beautiful-dnd.esm-ByydTUk4.js → react-beautiful-dnd.esm-CeODMcuS.js} +1 -1
  162. package/dist/assets/relative-time-DlN06RKr.js +1 -0
  163. package/dist/assets/ru-ZKgT6XdU.js +1 -0
  164. package/dist/assets/ru-y0N1jyVB.js +5 -0
  165. package/dist/assets/runtime-nJVx0iKJ.js +1 -0
  166. package/dist/assets/sdk-DICk2ZHP.js +1 -0
  167. package/dist/assets/{security-BhkfG23R.js → security-CHs7ENbZ.js} +4 -4
  168. package/dist/assets/session-j-9KoWbs.js +1 -0
  169. package/dist/assets/setup-CGwOCqjv.js +25 -0
  170. package/dist/assets/{shorten-label-DFzv9EKX.js → shorten-label-SbKUBkvs.js} +1 -1
  171. package/dist/assets/{simple-select-DlrdVbaI.js → simple-select-CLc0Q9sm.js} +1 -1
  172. package/dist/assets/{slicedToArray-CPl5_eGD.js → slicedToArray-C0YDCVwK.js} +2 -2
  173. package/dist/assets/{spaces-WkJCApHO.js → spaces-CZHg-rr5.js} +1 -1
  174. package/dist/assets/start-Chlvxw3J.js +187 -0
  175. package/dist/assets/starting-progress-DpqgCEFM.js +40 -0
  176. package/dist/assets/{status-CygZ0LuY.js → status-XLk6MkKv.js} +1 -1
  177. package/dist/assets/{step-actions-D_1PFeFs.js → step-actions-hjC-pbPT.js} +1 -1
  178. package/dist/assets/{studio-Byjzwg8q.js → studio-DrYhFxCD.js} +1 -1
  179. package/dist/assets/{switch-control-5fEOPVKs.js → switch-control-CqfXXgvP.js} +1 -1
  180. package/dist/assets/th-CG5eLRZo.js +1 -0
  181. package/dist/assets/th-CJa7646q.js +5 -0
  182. package/dist/assets/{traffic-T11hxc--.js → traffic-Dbf1L1c0.js} +1 -1
  183. package/dist/assets/{transfer-ROpxn9LD.js → transfer-GcIVZcyL.js} +1 -1
  184. package/dist/assets/unsubscribe-D2dQlJJM.js +1 -0
  185. package/dist/assets/use-blocklet-logo-DryhoHen.js +1 -0
  186. package/dist/assets/{use-mobile-C_flBrm-.js → use-mobile-BKvZ6hcv.js} +1 -1
  187. package/dist/assets/{use-mobile-DlKplWTG.js → use-mobile-BNUwcWCH.js} +1 -1
  188. package/dist/assets/{useAsync-CGW40D2-.js → useAsync-DXeWUWXr.js} +1 -1
  189. package/dist/assets/{useLocalStorage-DldnaMbZ.js → useLocalStorage-Cb6R1F6v.js} +1 -1
  190. package/dist/assets/user-center-D7lo6m0u.js +76 -0
  191. package/dist/assets/{util-Bjy-tP7q.js → util-BYQQqvk1.js} +1 -1
  192. package/dist/assets/util-BcFfyz6S.js +1 -0
  193. package/dist/assets/{vendor-arcblock-ScFEr-lj.js → vendor-arcblock-CX-5Ex_f.js} +100 -97
  194. package/dist/assets/vendor-hooks-DpLLpTSZ.js +7 -0
  195. package/dist/assets/vendor-mui-core-B6POpIBB.js +266 -0
  196. package/dist/assets/{vendor-mui-x-B0hsmEJ3.js → vendor-mui-x-CATHW1QL.js} +1 -1
  197. package/dist/assets/{vendor-utils-BNHJB5U7.js → vendor-utils-BUwfcN20.js} +13 -13
  198. package/dist/assets/{vendor-ux-did-connect-BdkhddhO.js → vendor-ux-did-connect-DVrP2LNw.js} +271 -241
  199. package/dist/assets/vi-CoZs3B42.js +1 -0
  200. package/dist/assets/vi-Rc5fwdQU.js +5 -0
  201. package/dist/assets/wrap-locale-CzSOEkvO.js +1 -0
  202. package/dist/assets/zh-CgkeS2I3.js +1 -0
  203. package/dist/assets/{zh-BYRCoK6F.js → zh-J32RyrWT.js} +2 -2
  204. package/dist/assets/zh-tw-BSUxp5LQ.js +7 -0
  205. package/dist/assets/zh-tw-CuakNRcW.js +1 -0
  206. package/dist/index.html +6 -6
  207. package/dist/service-worker.js +1 -1
  208. package/dist/share/shared-bridge.html +85 -0
  209. package/package.json +34 -34
  210. package/dist/assets/access-control-B20P1UrY.js +0 -14
  211. package/dist/assets/add-resource-BoS5YkVy.js +0 -1
  212. package/dist/assets/api-BrU7j0QA.js +0 -1
  213. package/dist/assets/appearance-DYi32tlk.js +0 -1
  214. package/dist/assets/ar-CmhpkjwX.js +0 -1
  215. package/dist/assets/ar-DupP3pla.js +0 -7
  216. package/dist/assets/audit-logs-CydL26ZC.js +0 -35
  217. package/dist/assets/branding-CAMtNLMU.js +0 -54
  218. package/dist/assets/bundle-avatar-D0t7RLGx.js +0 -1
  219. package/dist/assets/button-BeZibzB9.js +0 -1
  220. package/dist/assets/cloneDeep-SfcdeqEN.js +0 -1
  221. package/dist/assets/complete-BzCBoyhn.js +0 -45
  222. package/dist/assets/config-1xq1_d84.js +0 -32
  223. package/dist/assets/config-space-CYg-72ab.js +0 -1
  224. package/dist/assets/connect-Bbc2y5nS.js +0 -1
  225. package/dist/assets/connect-DM2xKEWk.js +0 -5
  226. package/dist/assets/connect-to-Ck5O2M1K.js +0 -1
  227. package/dist/assets/dashboard-8QXGSoVu.js +0 -280
  228. package/dist/assets/de-Doy9B4I7.js +0 -1
  229. package/dist/assets/de-TcDcBkI0.js +0 -7
  230. package/dist/assets/did-address-DUThaBlf.js +0 -1
  231. package/dist/assets/domain-action-card-D3w6jyPR.js +0 -24
  232. package/dist/assets/domains-BDxEOJh6.js +0 -1
  233. package/dist/assets/es-CDD0y3ur.js +0 -7
  234. package/dist/assets/es-CruF8tDk.js +0 -1
  235. package/dist/assets/exchange-passport-Izkf8qpM.js +0 -1
  236. package/dist/assets/fr-Bajh_D8H.js +0 -1
  237. package/dist/assets/fr-zYSSKlBw.js +0 -7
  238. package/dist/assets/get-safe-url-Bq9SFfX6.js +0 -1
  239. package/dist/assets/get-safe-url-DBsPGn--.js +0 -1
  240. package/dist/assets/hi-BsP-0YrU.js +0 -5
  241. package/dist/assets/hi-DOsApYK0.js +0 -1
  242. package/dist/assets/id-CY2FWdMB.js +0 -7
  243. package/dist/assets/index-B2yOcqTl.js +0 -192
  244. package/dist/assets/index-BGgGfqEc.js +0 -346
  245. package/dist/assets/index-B_vrglsK.js +0 -10
  246. package/dist/assets/index-BnmeT4Bk.js +0 -113
  247. package/dist/assets/index-C8QMe2NL.js +0 -138
  248. package/dist/assets/index-Cjjg2_Xp.js +0 -11
  249. package/dist/assets/index-DNG6b9sp.js +0 -224
  250. package/dist/assets/index-DO3_1y-L.js +0 -708
  251. package/dist/assets/index-DO4cSlUf.js +0 -290
  252. package/dist/assets/index-DcBUShKK.js +0 -1
  253. package/dist/assets/index-EnQ254k3.js +0 -6
  254. package/dist/assets/index-bb90BUf4.js +0 -55
  255. package/dist/assets/index-mDKG4SiY.js +0 -1
  256. package/dist/assets/index-slEV_y-C.js +0 -4
  257. package/dist/assets/invite-Cbz8B2uW.js +0 -1
  258. package/dist/assets/item-nK3D7WH5.js +0 -2
  259. package/dist/assets/ja-99RIjwwl.js +0 -1
  260. package/dist/assets/ja-BLPXqHM4.js +0 -7
  261. package/dist/assets/ko-8oFi6wHH.js +0 -1
  262. package/dist/assets/ko-Cxgk34co.js +0 -7
  263. package/dist/assets/landing-page-BMM_oJb1.js +0 -1
  264. package/dist/assets/list-Dmtz4mRb.js +0 -235
  265. package/dist/assets/list-header-CgF1S4js.js +0 -1
  266. package/dist/assets/localization-DATb3Y_j.js +0 -1
  267. package/dist/assets/login-DjB23H9M.js +0 -1
  268. package/dist/assets/login-oauth-callback-ILeP59KT.js +0 -1
  269. package/dist/assets/omit-bLid3PKQ.js +0 -1
  270. package/dist/assets/preferences-DYdbb0kG.js +0 -1
  271. package/dist/assets/profile-embed-CeEMHxEc.js +0 -1
  272. package/dist/assets/pt-BINIHul4.js +0 -5
  273. package/dist/assets/pt-ChXuTrrd.js +0 -1
  274. package/dist/assets/publish-resource-BEc_A5mC.js +0 -1
  275. package/dist/assets/relative-time-Djw-K4Zu.js +0 -1
  276. package/dist/assets/ru-BifF7u-P.js +0 -5
  277. package/dist/assets/ru-IkTTTY0K.js +0 -1
  278. package/dist/assets/runtime-DXl0lfXF.js +0 -1
  279. package/dist/assets/sdk-CTe6rL6c.js +0 -1
  280. package/dist/assets/session-VIMbdc9j.js +0 -1
  281. package/dist/assets/setup-BmYxTt6Z.js +0 -25
  282. package/dist/assets/start-CVexuuAk.js +0 -187
  283. package/dist/assets/th-CBxM23U5.js +0 -5
  284. package/dist/assets/th-OF8xr--T.js +0 -1
  285. package/dist/assets/unsubscribe-Cd3XOnSp.js +0 -1
  286. package/dist/assets/use-app-logo-B8Kl9EZt.js +0 -1
  287. package/dist/assets/user-center-CzyCbtWm.js +0 -77
  288. package/dist/assets/util-Dw9Eiuko.js +0 -1
  289. package/dist/assets/vendor-hooks-DftG_2gV.js +0 -7
  290. package/dist/assets/vendor-mui-core-CQ38ohp2.js +0 -266
  291. package/dist/assets/vi-DCBJBc4G.js +0 -1
  292. package/dist/assets/vi-DY_Y13jR.js +0 -5
  293. package/dist/assets/wrap-locale-DMTYAE64.js +0 -1
  294. package/dist/assets/zh-BRAYg0sY.js +0 -1
  295. package/dist/assets/zh-tw-BG0rlH8p.js +0 -7
  296. package/dist/assets/zh-tw-D5-DkgwC.js +0 -1
@@ -0,0 +1,288 @@
1
+ import{r as S,g as Ee,b as ct}from"./vendor-react-DEoibe3W.js";import{a as dt,m as oe}from"./vendor-hooks-DpLLpTSZ.js";import{j as e,aa as g,H as w,ah as H,E as pt,T as E,X as ut,al as te,ad as K,ab as O,ak as Oe,a9 as mt,I as W,O as q,q as ie,N as ft,bs as $e,cp as Me,cq as ee,bV as qe,br as We,by as ht,bt as xt,bS as gt,v as yt,y as jt,bo as vt,s as bt}from"./vendor-mui-core-B6POpIBB.js";import{u as L,ar as U,aw as Ct,a2 as F,ab as xe,n as G,aR as St,a as _,r as Tt,a4 as ge,by as He,k as wt,bb as Pt,bS as Fe,bl as It,bx as Rt}from"./vendor-ux-did-connect-DVrP2LNw.js";import{z as A,l as ne,t as Ue,U as J,C as Dt,ac as kt,f as Ft,b as re,aw as At,R as Ge}from"./index-Cb1OPKJL.js";import{w as Nt,c as Lt,O as ye,a0 as X}from"./vendor-arcblock-CX-5Ex_f.js";import{W as je}from"./did-address-CJZtrzhT.js";import{u as $}from"./dashboard-0TEl6bJJ.js";import{r as ve,a as be,b as Ce,c as le,d as zt,e as Ve,u as Bt,f as _t}from"./passport-item-Dpr4rKdD.js";import{p as Ye}from"./util-BcFfyz6S.js";import{w as V,P as Ke}from"./permission-DDLyDuSn.js";import{C as Et}from"./Google-VfyWFLKO.js";import{L as Z,az as Ot,J as $t}from"./vendor-utils-BUwfcN20.js";import{E as ce}from"./EditIcon-DWRQ3fi6.js";import{C as Se}from"./confirm-Bj4L0Vn8.js";import{L as Ze}from"./list-header-8k1_C0K0.js";import{f as se}from"./format-error-BrmqJs5a.js";import{_ as Mt}from"./useSetState-CWq0AVWn.js";import{L as qt}from"./LockIcon-Bd69pSJI.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-Cb6R1F6v.js";import"./PlayArrow-CVHX5RbU.js";import"./get-safe-url-BYr2jgRv.js";import"./session-j-9KoWbs.js";import"./use-blocklet-logo-DryhoHen.js";import"./InfoOutlined-BMb9Zu84.js";import"./dot-CaKxEi_0.js";import"./useAsync-DXeWUWXr.js";import"./use-mobile-BNUwcWCH.js";import"./index-CjZLIV87.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./base32-yUUlhgnG.js";import"./cloneDeep-Cg0h_FaY.js";const Ae="info";function Te({createPassportSvg:c,passport:o,onCancel:d,onSwitchPassport:f}){const{t:u}=L(),l=dt({tab:Ae}),h={info:{label:u("common.basicInfo"),value:Ae,component:()=>e.jsx(Je,{passport:o,createPassportSvg:c})},logs:{label:u("common.logs"),value:"logs",component:()=>e.jsx(et,{passport:o})},related:{label:u("team.passport.related"),value:"related",component:()=>e.jsx(tt,{passport:o,onSwitchPassport:f})}},s=Object.values(h).map(({label:n,value:t})=>({label:n,value:t})).filter(n=>n.value==="related"?o.parentDid:!0),m=h[l.tab]||h.info,a=n=>{l.tab=n};return e.jsx(U,{title:u("common.passport"),onClose:d,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(Wt,{children:[e.jsx(g,{className:"tabs",children:e.jsx(Ct,{tabs:s,current:l.tab,onChange:a,scrollButtons:"auto"})}),e.jsx(g,{className:"body",children:e.jsx(m.component,{})})]})})}Te.propTypes={createPassportSvg:w.func.isRequired,passport:w.object.isRequired,onCancel:w.func.isRequired,onSwitchPassport:w.func};Te.defaultProps={onSwitchPassport:()=>{}};const Wt=H(g)`
2
+ margin-top: -16px;
3
+
4
+ .tabs {
5
+ margin-left: 0;
6
+ margin-right: 0;
7
+ }
8
+
9
+ .body {
10
+ margin-top: 24px;
11
+ }
12
+ `;function Je({createPassportSvg:c,passport:o}){var m,a,n,t;const{t:d,locale:f}=L(),{teamDid:u}=$(),{inService:l}=A(),h=[{items:[{label:d("common.role"),content:ve(o.title)},{label:d("common.did"),content:e.jsx(je,{did:o.id})},{label:d("team.passport.status"),content:be(o.status)},{label:d("common.type"),content:e.jsx(g,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:(o.type||[]).map(r=>e.jsx(pt,{label:r,variant:"outlined",size:"small",sx:{borderRadius:1}},r))})}]}],s=[{title:d("team.passport.owner"),items:[{label:d("team.passport.owner"),content:e.jsx(g,{children:Ce(o.user,l)})}]},{title:d("common.timeInfo"),items:[{label:d("team.passport.issuanceTime"),content:o.issuanceDate?ne(o.issuanceDate,f):"-"},{label:d("team.member.lastLogin"),content:o.lastLoginAt?ne(o.lastLoginAt,f):"-"},{label:d("common.expires"),content:o.expirationDate?ne(o.expirationDate,f):"-"}]},{title:d("blocklet.overview.source"),items:[{label:d("blocklet.overview.source"),content:le(o.source)}]}];return e.jsxs(Ht,{gap:3,children:[e.jsxs(g,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%",overflow:"hidden",gap:5},children:[e.jsx(g,{sx:{display:"flex",p:1},className:"passport-image",dangerouslySetInnerHTML:{__html:c({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(m=o.user)==null?void 0:m.fullName,ownerDid:(a=o.user)==null?void 0:a.did,ownerAvatarUrl:(n=o.user)!=null&&n.avatar?Ye((t=o.user)==null?void 0:t.avatar,u,l):"",revoked:o.revoked,width:"200px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}}),e.jsx(g,{className:"info-area",children:h.map(r=>e.jsxs(g,{children:[r.title&&e.jsx(E,{variant:"h6",sx:{mb:2},children:r.title}),e.jsx(g,{className:"info-grid",sx:{gap:"12px !important"},children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",sx:{maxWidth:40},children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]}),e.jsx(ut,{}),e.jsx(g,{className:"info-area",children:s.map(r=>e.jsxs(g,{children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:r.title}),e.jsx(g,{className:"info-grid",children:r.items.map(i=>e.jsxs(g,{className:"info-item",children:[e.jsx(g,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:i.label})}),e.jsx(g,{children:i.content})]},i.label))})]},r.title))})]})}Je.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired};const Ht=H(te)`
13
+ .info-card {
14
+ margin-bottom: 24px;
15
+ overflow: hidden;
16
+ }
17
+
18
+ .card-content {
19
+ display: flex;
20
+ gap: 32px;
21
+ padding: 24px;
22
+ }
23
+
24
+ .passport-image {
25
+ width: 150px;
26
+ flex-shrink: 0;
27
+ transition: transform 0.2s ease-in-out;
28
+ cursor: pointer;
29
+
30
+ &:hover {
31
+ transform: scale(1.05);
32
+ }
33
+ }
34
+
35
+ .info-area {
36
+ flex: 1;
37
+ display: flex;
38
+ flex-direction: column;
39
+ gap: 16px;
40
+ }
41
+
42
+ .info-header {
43
+ padding-bottom: 16px;
44
+ border-bottom: 1px solid #eee;
45
+ }
46
+
47
+ .info-grid {
48
+ display: flex;
49
+ flex-direction: column;
50
+ gap: 8px;
51
+ }
52
+
53
+ .info-item {
54
+ display: flex;
55
+ gap: 8px;
56
+ }
57
+
58
+ .info-label {
59
+ display: flex;
60
+ align-items: center;
61
+ gap: 8px;
62
+ width: 100px;
63
+ }
64
+
65
+ .logs-card {
66
+ .card-header {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: 8px;
70
+ padding: 16px 24px;
71
+ border-bottom: 1px solid #eee;
72
+ }
73
+
74
+ .MuiTimeline-root {
75
+ padding: 24px;
76
+ }
77
+
78
+ .MuiTimelineContent-root {
79
+ padding: 0px 16px;
80
+ }
81
+
82
+ .MuiTimelineDot-root {
83
+ margin: 0;
84
+ }
85
+ }
86
+ `,Qe=10,Xe=1;function et({passport:c}){const{api:o}=A(),{teamDid:d}=$(),{t:f,locale:u}=L(),[l,h]=S.useState({pageSize:Qe,page:Xe}),{data:s,loading:m}=oe(async()=>{const y={teamDid:d,query:{passportId:c.id},paging:{page:l.page,pageSize:l.pageSize}},x=await o.getPassportLogs({input:y});return{logs:x.passportLogs||[],total:x.paging.total}},{refreshDeps:[l.page,l.pageSize],onError:y=>F.error(y.message)}),a=S.useMemo(()=>(s==null?void 0:s.logs)||[],[s==null?void 0:s.logs]),n=y=>{var x,p,v,j,T,C,I,D,N;return y.action===G.PASSPORT_LOG_ACTION.APPROVE||y.action===G.PASSPORT_LOG_ACTION.REVOKE?(p=(x=y==null?void 0:y.metadata)==null?void 0:x.operator)!=null&&p.fullName?`${f("common.operator")}: ${(j=(v=y==null?void 0:y.metadata)==null?void 0:v.operator)==null?void 0:j.fullName}`:null:y.action===G.PASSPORT_LOG_ACTION.ISSUE&&((T=y.metadata)==null?void 0:T.action)===G.PASSPORT_ISSUE_ACTION.ISSUE_ON_INVITE?(I=(C=y==null?void 0:y.metadata)==null?void 0:C.inviter)!=null&&I.fullName?`${f("common.inviter")}: ${(N=(D=y==null?void 0:y.metadata)==null?void 0:D.inviter)==null?void 0:N.fullName}`:null:`passportId: ${y.passportId}`},t=S.useMemo(()=>[{label:f("common.action"),name:"action",options:{customBodyRender:(y,{rowIndex:x})=>{var v;const p=a[x];return e.jsx(K,{title:n(p),children:`${y} ${(v=p.metadata)!=null&&v.action?`(${p.metadata.action})`:""}`})}}},{label:"IP",name:"operatorIp",options:{customBodyRender:y=>e.jsx(g,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsx("span",{children:y||"-"})})}},{label:"UA",width:250,name:"operatorUa",options:{customBodyRender:(y,{rowIndex:x})=>{const p=a[x];return e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[p.operatorUa&&e.jsx(g,{children:zt(p.operatorUa)}),p.operatorUa&&e.jsx(K,{title:p.operatorUa,children:e.jsx(Nt,{fontSize:"small",color:"action",sx:{fontSize:16,cursor:"pointer"}})})]})}}},{label:f("common.createdAt"),name:"createdAt",options:{customBodyRender:y=>ne(y,u)}}],[f,u,a]),r=({page:y,rowsPerPage:x})=>{l.pageSize!==x?h(p=>({...p,pageSize:x,page:1})):l.page!==y+1&&h(p=>({...p,page:y+1}))},i={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:l.page-1,rowsPerPage:l.pageSize,count:(s==null?void 0:s.total)||0};return m?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(O,{})})}):e.jsx(g,{children:e.jsx(xe,{className:"logs-table",verticalKeyWidth:100,locale:u,data:a,columns:t,options:i,loading:m,onChange:r})})}et.propTypes={passport:w.object.isRequired};function tt({passport:c,onSwitchPassport:o}){const{api:d}=A(),{teamDid:f}=$(),{t:u,locale:l}=L(),[h,s]=S.useState({pageSize:Qe,page:Xe}),{data:m,loading:a}=oe(async()=>{const x={teamDid:f,passportId:c.parentDid,paging:{page:h.page,pageSize:h.pageSize}},p=await d.getRelatedPassports({input:x});return{passports:p.passports||[],total:p.paging.total}},{refreshDeps:[h.page,h.pageSize],onError:x=>F.error(x.message)}),n=S.useMemo(()=>(m==null?void 0:m.passports)||[],[m==null?void 0:m.passports]),t=S.useMemo(()=>[{label:u("team.passport.role"),name:"role",options:{customBodyRender:ve}},{label:u("team.passport.owner"),name:"user",options:{customBodyRender:Ce}},{label:u("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:u("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:x=>Ve(x,l)}},{label:u("blocklet.overview.source"),name:"source",options:{customBodyRender:le}}],[u,l]),r=({page:x,rowsPerPage:p})=>{h.pageSize!==p?s(v=>({...v,pageSize:p,page:1})):h.page!==x+1&&s(v=>({...v,page:x+1}))},i=S.useRef(null),y={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,search:!1,page:h.page-1,rowsPerPage:h.pageSize,count:(m==null?void 0:m.total)||0,onRowClick(x,{dataIndex:p},v){var j;if((j=i.current)!=null&&j.contains(v.target)){const T=n[p];o(T)}}};return a?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(O,{})})}):e.jsxs(te,{spacing:1,children:[e.jsx(Oe,{severity:"warning",children:u("team.passport.relatedDescription")}),e.jsx(g,{ref:i,sx:{".MuiTableRow-root":{cursor:"pointer"}},children:e.jsx(xe,{className:"related-table",verticalKeyWidth:100,locale:l,data:n.filter(x=>x.id!==c.id),columns:t,options:y,loading:a,onChange:r})})]})}tt.propTypes={passport:w.object.isRequired,onSwitchPassport:w.func.isRequired};function de({onCancel:c,onSuccess:o}){const{api:d}=A(),{blocklet:f}=Dt(),{t:u}=L(),[l,h]=S.useState(!1),s=(f.environments.find(r=>r.key==="BLOCKLET_PASSPORT_COLOR")||{}).value||"auto",m=s==="auto"?St.getPassportColorFromDid(f.appDid):s,[a,n]=S.useState(m),t=async()=>{const r=[{key:Lt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR,value:a}];try{h(!0),await d.configBlocklet({input:{did:f.meta.did,configs:r}}),o()}catch(i){F.error(i.message)}finally{h(!1)}};return e.jsx(U,{title:u("team.passport.color"),onClose:c,open:!0,fullWidth:!0,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:u("common.cancel")}),e.jsxs(_,{onClick:t,color:"primary",disabled:l,variant:"contained",autoFocus:!0,"data-cy":"color-btn-confirm",children:[l&&e.jsx(O,{size:16}),u("common.save")]})]}),children:e.jsxs(g,{display:"flex",justifyContent:"center",alignItems:"center",className:"dialog-content",children:[e.jsx(Et,{disableAlpha:!0,color:a,onChange:r=>n(r.hex)}),e.jsx("div",{style:{width:220,marginLeft:24},dangerouslySetInnerHTML:{__html:kt({scope:"passport",role:"owner",title:"Owner",issuer:Ft.getDisplayName(f),issuerDid:f.appDid,ownerName:"Your Name",ownerDid:f.appDid,preferredColor:a})}})]})})}const Ut=V(de,"mutate_team"),Gt=V(de,"",J);function Vt(c){const{inService:o}=A();return o?e.jsx(Gt,{...c}):e.jsx(Ut,{...c})}de.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired};de.defaultProps={};var Q=function(c){return e.jsx("svg",{...c,children:e.jsx("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"})})};Q.defaultProps={width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"};Q.displayName="delete";var we={},Yt=mt;Object.defineProperty(we,"__esModule",{value:!0});var Pe=we.default=void 0,Kt=Yt(Tt()),Zt=e;Pe=we.default=(0,Kt.default)((0,Zt.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack");var st=function(o){return e.jsx("svg",{...o,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"})})};st.defaultProps={width:"65",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const Jt=(c,o)=>c?!o.some(d=>!d.from.passport||!d.to.role):!1;function Ie({onCancel:c,onSuccess:o,data:d,trustedPassports:f}){const{api:u}=A(),{roles:l,teamDid:h}=$(),{t:s}=L(),[m,a]=S.useState(!1),[n,t]=S.useState(d.issuerDid||""),[r,i]=S.useState(d.remark||""),[y,x]=S.useState(Z(d.mappings)||[]),p=f.findIndex(j=>j.issuerDid===d.issuerDid),v=async()=>{if(m)return;const j={issuerDid:n,remark:r,mappings:y.map(C=>({...C,to:{...C.to,ttl:C.to.ttl||0}}))},T=[...f];p===-1?T.unshift(j):T[p]=j;try{a(!0),await u.configTrustedPassports({input:{teamDid:h,trustedPassports:T}}),await re(800),a(!1),F.success(s("common.saveSuccess")),o()}catch(C){a(!1),F.error(se(C))}};return e.jsx(U,{title:s("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(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>v(),color:"primary",disabled:!Jt(n,y)||!r||m,variant:"contained",autoFocus:!0,"data-cy":"save-mapping",children:[m&&e.jsx(O,{size:16}),s("common.save")]})]}),children:e.jsx(Qt,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(q,{fullWidth:!0,"data-cy":"input-issuer-did",placeholder:s("team.passport.issuerDid"),value:n,onChange:j=>{t(j.target.value)}}),e.jsx(q,{style:{marginTop:16},fullWidth:!0,"data-cy":"input-issuer-remark",placeholder:s("common.remark"),value:r,onChange:j=>{i(j.target.value)}}),e.jsxs(g,{mt:"30px",display:"flex",justifyContent:"space-between",alignItems:"center",children:[e.jsx(g,{className:"dialog-h1",children:s("team.passport.mappingRule")}),e.jsx(g,{children:e.jsx(_,{variant:"outlined",color:"primary","data-cy":"add-mapping",onClick:()=>{x(j=>{const T=[...j];return T.unshift({from:{passport:""},to:{role:G.ROLES.GUEST}}),T})},children:s("team.add")})})]}),e.jsxs(g,{className:"list",mt:-.5,children:[y.map((j,T)=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",my:3,children:[e.jsxs(g,{display:"flex",alignItems:"center",flexGrow:1,children:[e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(q,{fullWidth:!0,size:"small","data-cy":`input-${T}-from`,placeholder:"Issuer’s Passport Name/ID",value:j.from.passport,onChange:C=>{const{value:I}=C.target;x(D=>{const N=[...D];return N[T].from.passport=I,N})}})}),e.jsx(g,{flexShrink:0,mx:4,children:e.jsx(st,{})}),e.jsx(g,{flexGrow:1,flexBasis:1,children:e.jsx(q,{fullWidth:!0,size:"small",select:!0,value:j.to.role,onChange:C=>{x(I=>{const D=[...I];return D[T].to.role=C.target.value,D})},variant:"outlined",children:l.filter(C=>C.name!=="owner").map(C=>e.jsx(ie,{value:C.name,"data-cy":`passport-mapping-select-option-${C.name}`,children:e.jsx("span",{children:C.title||C.name})},C.name))})})]}),e.jsx(g,{flexShrink:0,ml:4,children:e.jsx(W,{onClick:()=>{x(C=>{const I=[...C];return I.splice(T,1),I})},size:"large",children:e.jsx(Q,{})})})]},`mapping-${T}`)),!y.length&&e.jsx(g,{my:2,color:"text.secondary",fontSize:"16px",children:e.jsx(ge,{children:s("common.empty")})})]})]})})})}Ie.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedPassports:w.array,data:w.object};Ie.defaultProps={data:{},trustedPassports:[]};const Qt=H.div`
87
+ .dialog-h1 {
88
+ font-size: 18px;
89
+ }
90
+
91
+ .list {
92
+ .MuiIconButton-root {
93
+ svg {
94
+ fill: #bfbfbf;
95
+ }
96
+ }
97
+ }
98
+ `;function pe({onCancel:c,hasPermission:o}){const{api:d}=A(),{teamDid:f,trustedPassports:u}=$(),{t:l}=L(),[h,s]=S.useState(null),[m,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(""),y=async p=>{if(m)return;const v=u.findIndex(T=>T.issuerDid===p);v===-1&&F.error("Cannot find passports");const j=[...u];j.splice(v,1);try{a(!0),await d.configTrustedPassports({input:{teamDid:f,trustedPassports:j}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(!1)}catch(T){a(!1),F.error(T.message)}},x=u.filter(p=>!r||p.issuerDid.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedIssuers"),open:!0,onClose:c,fullWidth:!0,PaperProps:{style:{minHeight:"80vh"}},children:[e.jsx(ss,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx("div",{className:"dialog-h1",children:l("team.passport.trustedPassportIssuers")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchIssuerDid"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary","data-cy":"add-trusted-issuer",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(p=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexShrink:0,children:[e.jsx(je,{copyable:!1,size:16,did:p.issuerDid,showDidLogo:!1}),!!p.remark&&e.jsx(g,{pl:3.5,fontSize:12,maxWidth:"300px",children:p.remark})]}),e.jsx(g,{color:"gray",ml:"28px",flexGrow:1,children:p.mappings&&p.mappings.length?`${p.mappings.length} ${l("team.passport.mappingRule")}`:l("team.passport.defaultRule")}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx(W,{onClick:()=>t({mode:"update",data:Z(p)}),"data-cy":"edit-mapping-rule",size:"large",children:e.jsx(ce,{})}),e.jsx(W,{"data-cy":"delete-mapping-rule",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:p.issuerDid}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(p.issuerDid),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},p.issuerDid)),!u.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Ie,{mode:n.mode,data:n.data,trustedPassports:Z(u),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}pe.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};pe.defaultProps={hasPermission:!1};const Xt=V(pe,"mutate_team"),es=V(pe,"",J);function ts(c){const{inService:o}=A();return o?e.jsx(es,{...c}):e.jsx(Xt,{...c})}const ss=H.div`
99
+ .list {
100
+ .MuiIconButton-root {
101
+ svg {
102
+ fill: #bfbfbf;
103
+ }
104
+ }
105
+ }
106
+ `;var rs=Ot();const Ne=Ee(rs);function Re({onCancel:c,onSuccess:o,data:d,trustedFactories:f}){var x,p,v;const{api:u}=A(),{roles:l,teamDid:h}=$(),{t:s}=L(),[m,a]=Mt({loading:!1,fetching:!1,fetched:[],errored:[],factoryAddress:d.factoryAddress||"",remark:d.remark||"",role:((x=d.passport)==null?void 0:x.role)||"member",ttlPolicy:((p=d.passport)==null?void 0:p.ttlPolicy)||"never",ttl:Ne(+((v=d.passport)==null?void 0:v.ttl)||365*24*60*60*1e3),error:""}),n=f.findIndex(j=>j.factoryAddress===d.factoryAddress),t=async()=>{if(m.loading)return;const{factoryAddress:j,remark:T,role:C,ttlPolicy:I,ttl:D}=m,N={factoryAddress:j,remark:T,passport:{role:C,ttlPolicy:I,ttl:I==="never"?0:Ne(D)}},k=[...f];n===-1?k.unshift(N):k[n]=N;try{a({loading:!0}),await u.configTrustedFactories({input:{teamDid:h,trustedFactories:k}}),await re(800),F.success(s("common.saveSuccess")),o()}catch(z){console.error(z),F.error(se(z))}finally{a({loading:!1})}};S.useEffect(()=>{const j=m.fetched.find(C=>C.address===m.factoryAddress),T=m.errored.find(C=>C.address===m.factoryAddress);wt.isValid(m.factoryAddress)&&!m.fetching&&!j&&!T&&(a({fetching:!0}),At(G.MAIN_CHAIN_ENDPOINT).getFactoryState({address:m.factoryAddress}).then(I=>{I.state?a({fetching:!1,fetched:[...m.fetched.filter(D=>D.address!==m.factoryAddress),I.state],remark:I.state.name}):a({fetching:!1,errored:[...m.errored.filter(D=>D.address!==m.factoryAddress),{address:m.factoryAddress}],error:s("team.passport.factory404",m)})}).catch(I=>{console.error(I),a({fetching:!1,error:se(I)})}))},[m.factoryAddress,m.fetching]);let r=m.error;const i=m.factoryAddress?m.errored.find(j=>j.address===m.factoryAddress):null;!r&&i&&(r=s("team.passport.factory404",m));const y=m.factoryAddress?m.fetched.find(j=>j.address===m.factoryAddress):null;return!r&&y&&(r=y.description),r||(r=s("team.passport.factoryAddressTip")),e.jsx(U,{title:s("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(Pe,{})}),actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:s("common.cancel")}),e.jsxs(_,{onClick:()=>t(),color:"primary",disabled:!m.factoryAddress||!m.remark||!m.role||m.loading||m.error||i,variant:"contained",autoFocus:!0,"data-cy":"save-trusted-factory",children:[m.loading&&e.jsx(O,{size:16}),s("common.save")]})]}),children:e.jsx(as,{children:e.jsxs("div",{className:"dialog-content",children:[e.jsx(q,{fullWidth:!0,error:!!m.error||!!i,"data-cy":"input-factory-address",label:s("team.passport.factoryAddress"),helperText:r,value:m.factoryAddress,InputProps:{endAdornment:m.fetching?e.jsx(ft,{position:"end",children:e.jsx(O,{size:16})}):null},onChange:j=>{a({factoryAddress:j.target.value,error:""})}}),e.jsx(q,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-factory-remark",label:s("common.remark"),value:m.remark,onChange:j=>{a({remark:j.target.value})}}),e.jsx(q,{style:{marginTop:32},fullWidth:!0,"data-cy":"input-passport-role",label:s("team.passport.role"),select:!0,value:m.role,onChange:j=>{a({role:j.target.value})},variant:"outlined",children:l.filter(j=>j.name!=="owner").map(j=>e.jsx(ie,{value:j.name,"data-cy":`passport-role-select-option-${j.name}`,children:e.jsx("span",{children:j.title||j.name})},j.name))}),e.jsxs("div",{style:{marginTop:32},children:[e.jsx($e,{children:s("team.passport.ttl")}),e.jsxs(Me,{color:"primary",size:"small",value:m.ttlPolicy,exclusive:!0,style:{marginTop:16},onChange:(j,T)=>a({ttlPolicy:T}),"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(K,{title:s("team.passport.ttlNeverTip"),children:e.jsx(E,{children:s("team.passport.ttlNever")})})}),e.jsx(ee,{value:"mint","data-cy":"input-passport-ttl-mint",children:e.jsx(K,{title:s("team.passport.ttlMintTip"),children:e.jsx(E,{children:s("team.passport.ttlMint")})})}),e.jsx(ee,{value:"exchange","data-cy":"input-passport-ttl-exchange",children:e.jsx(K,{title:s("team.passport.ttlExchangeTip"),children:e.jsx(E,{children:s("team.passport.ttlExchange")})})})]}),m.ttlPolicy!=="never"&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-passport-ttl",value:m.ttl,onChange:j=>{a({ttl:j.target.value})}}),e.jsx(We,{children:s("team.passport.ttlTip")})]})]})]})})})}Re.propTypes={onCancel:w.func.isRequired,onSuccess:w.func.isRequired,trustedFactories:w.array,data:w.object};Re.defaultProps={data:{},trustedFactories:[]};const as=H.div`
107
+ .dialog-h1 {
108
+ font-size: 18px;
109
+ }
110
+
111
+ .list {
112
+ .MuiIconButton-root {
113
+ svg {
114
+ fill: #bfbfbf;
115
+ }
116
+ }
117
+ }
118
+ `;function ue({onCancel:c,hasPermission:o}){const{api:d}=A(),{teamDid:f,trustedFactories:u}=$(),{t:l}=L(),[h,s]=S.useState(null),[m,a]=S.useState(!1),[n,t]=S.useState(null),[r,i]=S.useState(""),y=async p=>{if(!m)try{a(!0),await d.configTrustedFactories({input:{teamDid:f,trustedFactories:u.filter(v=>v.factoryAddress!==p)}}),await re(800),a(!1),F.success(l("common.saveSuccess")),s(null)}catch(v){a(!1),F.error(v.message)}},x=u.filter(p=>!r||p.factoryAddress.toLowerCase().includes(r.toLowerCase()));return e.jsxs(U,{title:l("team.passport.trustedFactories"),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:l("team.passport.trustedFactoriesTip")}),e.jsx(Ze,{sx:{mt:3},actions:e.jsxs(e.Fragment,{children:[e.jsx(He,{options:{searchPlaceholder:l("team.passport.searchFactoryAddress"),searchDebounceTime:600},search:r,searchText:r,searchTextUpdate:i,searchClose:()=>i(""),onSearchOpen:()=>{}}),o&&e.jsxs(_,{variant:"contained",color:"primary",size:"small","data-cy":"add-trusted-factory",onClick:()=>t({mode:"add"}),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),l("team.add")]})]})}),e.jsxs("div",{className:"list",children:[x.map(p=>e.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:"20px",children:[e.jsxs(g,{flexGrow:1,children:[e.jsx(je,{copyable:!1,did:p.factoryAddress,size:16,showDidLogo:!1}),!!p.remark&&e.jsx(g,{fontSize:12,maxWidth:"300px",children:p.remark})]}),e.jsx(g,{color:"gray",mr:"24px",children:e.jsx(Pt,{type:"success",children:p.passport.role})}),e.jsxs(g,{flexShrink:0,display:"flex",alignItems:"center",children:[e.jsx(W,{onClick:()=>t({mode:"update",data:Z(p)}),"data-cy":"edit-trusted-factory",size:"large",children:e.jsx(ce,{})}),e.jsx(W,{"data-cy":"delete-trusted-factory",onClick:()=>s({title:l("common.delete"),description:l("common.delConfirmDescription",{data:p.factoryAddress}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:()=>y(p.factoryAddress),onCancel:()=>{a(!1),s(null)}}),size:"large",children:e.jsx(Q,{})})]})]},p.factoryAddress)),!u.length&&e.jsx(ge,{children:l("common.empty")})]})]})}),n&&e.jsx(Re,{data:n.data,trustedFactories:Z(u),onCancel:()=>t(null),onSuccess:()=>{t(null)}}),h&&e.jsx(Se,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}ue.propTypes={onCancel:w.func.isRequired,hasPermission:w.bool};ue.defaultProps={hasPermission:!1};const ns=V(ue,"mutate_team"),os=V(ue,"",J);function is(c){const{inService:o}=A();return o?e.jsx(os,{...c}):e.jsx(ns,{...c})}const ls=H.div`
119
+ .list {
120
+ .MuiIconButton-root {
121
+ svg {
122
+ fill: #bfbfbf;
123
+ }
124
+ }
125
+ }
126
+ `;var rt={exports:{}},at={exports:{}};(function(){var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o={rotl:function(d,f){return d<<f|d>>>32-f},rotr:function(d,f){return d<<32-f|d>>>f},endian:function(d){if(d.constructor==Number)return o.rotl(d,8)&16711935|o.rotl(d,24)&4278255360;for(var f=0;f<d.length;f++)d[f]=o.endian(d[f]);return d},randomBytes:function(d){for(var f=[];d>0;d--)f.push(Math.floor(Math.random()*256));return f},bytesToWords:function(d){for(var f=[],u=0,l=0;u<d.length;u++,l+=8)f[l>>>5]|=d[u]<<24-l%32;return f},wordsToBytes:function(d){for(var f=[],u=0;u<d.length*32;u+=8)f.push(d[u>>>5]>>>24-u%32&255);return f},bytesToHex:function(d){for(var f=[],u=0;u<d.length;u++)f.push((d[u]>>>4).toString(16)),f.push((d[u]&15).toString(16));return f.join("")},hexToBytes:function(d){for(var f=[],u=0;u<d.length;u+=2)f.push(parseInt(d.substr(u,2),16));return f},bytesToBase64:function(d){for(var f=[],u=0;u<d.length;u+=3)for(var l=d[u]<<16|d[u+1]<<8|d[u+2],h=0;h<4;h++)u*8+h*6<=d.length*8?f.push(c.charAt(l>>>6*(3-h)&63)):f.push("=");return f.join("")},base64ToBytes:function(d){d=d.replace(/[^A-Z0-9+\/]/ig,"");for(var f=[],u=0,l=0;u<d.length;l=++u%4)l!=0&&f.push((c.indexOf(d.charAt(u-1))&Math.pow(2,-2*l+8)-1)<<l*2|c.indexOf(d.charAt(u))>>>6-l*2);return f}};at.exports=o})();var cs=at.exports,he={utf8:{stringToBytes:function(c){return he.bin.stringToBytes(unescape(encodeURIComponent(c)))},bytesToString:function(c){return decodeURIComponent(escape(he.bin.bytesToString(c)))}},bin:{stringToBytes:function(c){for(var o=[],d=0;d<c.length;d++)o.push(c.charCodeAt(d)&255);return o},bytesToString:function(c){for(var o=[],d=0;d<c.length;d++)o.push(String.fromCharCode(c[d]));return o.join("")}}},Le=he;/*!
127
+ * Determine if an object is a Buffer
128
+ *
129
+ * @author Feross Aboukhadijeh <https://feross.org>
130
+ * @license MIT
131
+ */var ds=function(c){return c!=null&&(nt(c)||ps(c)||!!c._isBuffer)};function nt(c){return!!c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c)}function ps(c){return typeof c.readFloatLE=="function"&&typeof c.slice=="function"&&nt(c.slice(0,0))}(function(){var c=cs,o=Le.utf8,d=ds,f=Le.bin,u=function(l,h){l.constructor==String?h&&h.encoding==="binary"?l=f.stringToBytes(l):l=o.stringToBytes(l):d(l)?l=Array.prototype.slice.call(l,0):!Array.isArray(l)&&l.constructor!==Uint8Array&&(l=l.toString());for(var s=c.bytesToWords(l),m=l.length*8,a=1732584193,n=-271733879,t=-1732584194,r=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[m>>>5]|=128<<m%32,s[(m+64>>>9<<4)+14]=m;for(var y=u._ff,x=u._gg,p=u._hh,v=u._ii,i=0;i<s.length;i+=16){var j=a,T=n,C=t,I=r;a=y(a,n,t,r,s[i+0],7,-680876936),r=y(r,a,n,t,s[i+1],12,-389564586),t=y(t,r,a,n,s[i+2],17,606105819),n=y(n,t,r,a,s[i+3],22,-1044525330),a=y(a,n,t,r,s[i+4],7,-176418897),r=y(r,a,n,t,s[i+5],12,1200080426),t=y(t,r,a,n,s[i+6],17,-1473231341),n=y(n,t,r,a,s[i+7],22,-45705983),a=y(a,n,t,r,s[i+8],7,1770035416),r=y(r,a,n,t,s[i+9],12,-1958414417),t=y(t,r,a,n,s[i+10],17,-42063),n=y(n,t,r,a,s[i+11],22,-1990404162),a=y(a,n,t,r,s[i+12],7,1804603682),r=y(r,a,n,t,s[i+13],12,-40341101),t=y(t,r,a,n,s[i+14],17,-1502002290),n=y(n,t,r,a,s[i+15],22,1236535329),a=x(a,n,t,r,s[i+1],5,-165796510),r=x(r,a,n,t,s[i+6],9,-1069501632),t=x(t,r,a,n,s[i+11],14,643717713),n=x(n,t,r,a,s[i+0],20,-373897302),a=x(a,n,t,r,s[i+5],5,-701558691),r=x(r,a,n,t,s[i+10],9,38016083),t=x(t,r,a,n,s[i+15],14,-660478335),n=x(n,t,r,a,s[i+4],20,-405537848),a=x(a,n,t,r,s[i+9],5,568446438),r=x(r,a,n,t,s[i+14],9,-1019803690),t=x(t,r,a,n,s[i+3],14,-187363961),n=x(n,t,r,a,s[i+8],20,1163531501),a=x(a,n,t,r,s[i+13],5,-1444681467),r=x(r,a,n,t,s[i+2],9,-51403784),t=x(t,r,a,n,s[i+7],14,1735328473),n=x(n,t,r,a,s[i+12],20,-1926607734),a=p(a,n,t,r,s[i+5],4,-378558),r=p(r,a,n,t,s[i+8],11,-2022574463),t=p(t,r,a,n,s[i+11],16,1839030562),n=p(n,t,r,a,s[i+14],23,-35309556),a=p(a,n,t,r,s[i+1],4,-1530992060),r=p(r,a,n,t,s[i+4],11,1272893353),t=p(t,r,a,n,s[i+7],16,-155497632),n=p(n,t,r,a,s[i+10],23,-1094730640),a=p(a,n,t,r,s[i+13],4,681279174),r=p(r,a,n,t,s[i+0],11,-358537222),t=p(t,r,a,n,s[i+3],16,-722521979),n=p(n,t,r,a,s[i+6],23,76029189),a=p(a,n,t,r,s[i+9],4,-640364487),r=p(r,a,n,t,s[i+12],11,-421815835),t=p(t,r,a,n,s[i+15],16,530742520),n=p(n,t,r,a,s[i+2],23,-995338651),a=v(a,n,t,r,s[i+0],6,-198630844),r=v(r,a,n,t,s[i+7],10,1126891415),t=v(t,r,a,n,s[i+14],15,-1416354905),n=v(n,t,r,a,s[i+5],21,-57434055),a=v(a,n,t,r,s[i+12],6,1700485571),r=v(r,a,n,t,s[i+3],10,-1894986606),t=v(t,r,a,n,s[i+10],15,-1051523),n=v(n,t,r,a,s[i+1],21,-2054922799),a=v(a,n,t,r,s[i+8],6,1873313359),r=v(r,a,n,t,s[i+15],10,-30611744),t=v(t,r,a,n,s[i+6],15,-1560198380),n=v(n,t,r,a,s[i+13],21,1309151649),a=v(a,n,t,r,s[i+4],6,-145523070),r=v(r,a,n,t,s[i+11],10,-1120210379),t=v(t,r,a,n,s[i+2],15,718787259),n=v(n,t,r,a,s[i+9],21,-343485551),a=a+j>>>0,n=n+T>>>0,t=t+C>>>0,r=r+I>>>0}return c.endian([a,n,t,r])};u._ff=function(l,h,s,m,a,n,t){var r=l+(h&s|~h&m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._gg=function(l,h,s,m,a,n,t){var r=l+(h&m|s&~m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._hh=function(l,h,s,m,a,n,t){var r=l+(h^s^m)+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._ii=function(l,h,s,m,a,n,t){var r=l+(s^(h|~m))+(a>>>0)+t;return(r<<n|r>>>32-n)+h},u._blocksize=16,u._digestsize=16,rt.exports=function(l,h){if(l==null)throw new Error("Illegal argument "+l);var s=c.wordsToBytes(u(l,h));return h&&h.asBytes?s:h&&h.asString?f.bytesToString(s):c.bytesToHex(s)}})();var us=rt.exports;const ms=Ee(us);function me({teamDid:c,onCancel:o,onSuccess:d,onError:f,mode:u,item:l}){var D,N;const{api:h}=A(),[s,m]=S.useState(!1),[a,n]=S.useState(""),{t}=L(),[r,i]=S.useState(l.title||""),[y,x]=S.useState(l.description||""),[p,v]=S.useState(((D=l==null?void 0:l.extra)==null?void 0:D.display)||"builtin"),[j,T]=S.useState((N=l==null?void 0:l.extra)!=null&&N.types?l.extra.types.join(","):""),C=async()=>{const k=r.trim();if(!k){n(t("team.passport.error.titleEmpty"));return}if(k.length>64){n(t("team.passport.error.titleTooLong",{length:64}));return}const z=y.replace(/\n/g," ");if(!z){n(t("team.passport.error.descriptionEmpty"));return}const Y=u==="create"?ms(k):l.name;n(null),m(!0);try{if(u==="create"){const R={teamDid:c,name:Y,title:k,description:z};p==="custom"&&(R.extra=JSON.stringify({display:"custom",types:j.split(",")})),await h.createRole({input:R})}else{const R={teamDid:c,role:{name:Y,title:k,description:z}};await h.updateRole({input:R})}d()}catch(R){const b=se(R);n(b),f(R)}finally{m(!1)}},I=e.jsxs("div",{children:[u==="update"&&e.jsx(E,{component:"div",style:{paddingTop:16},children:e.jsx(q,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:l.name,disabled:!0})}),e.jsx(E,{component:"div",style:{marginTop:16},children:e.jsx(q,{label:t("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:r,onChange:k=>{n(null),i(k.target.value)},disabled:u==="update"||s,helperText:t("team.passport.create.titleTip")})}),e.jsx(E,{component:"div",style:{marginTop:16,marginBottom:16},children:e.jsx(q,{label:t("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:y,onChange:k=>{n(null),x(k.target.value)},disabled:s,multiline:!0,rows:3})}),u==="create"&&e.jsxs("div",{style:{marginBottom:16},children:[e.jsx($e,{children:t("common.display")}),e.jsxs(Me,{color:"primary",size:"small",value:p,exclusive:!0,style:{marginTop:16},disabled:s,onChange:(k,z)=>v(z),"data-cy":"input-role-display",children:[e.jsx(ee,{value:"builtin","data-cy":"input-role-display-builtin",children:e.jsx(E,{children:t("team.passport.displayBuiltin")})}),e.jsx(ee,{value:"custom","data-cy":"input-role-display-custom",children:e.jsx(E,{children:t("team.passport.displayCustom")})})]}),p==="custom"&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:j,disabled:s,onChange:k=>{T(k.target.value)}}),e.jsx(We,{children:t("team.passport.typesTip")})]})]})]});return e.jsxs(U,{title:u==="create"?t("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:o,showCloseButton:!1,actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:o,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{"data-cy":"mutate-role-confirm",onClick:C,color:"primary",disabled:s,variant:"contained",autoFocus:!0,children:[s&&e.jsx(O,{size:16}),t(u==="create"?"common.create":"common.update")]})]}),children:[e.jsx(ht,{component:"div",children:I}),!!a&&e.jsx(Oe,{severity:"error",variant:"icon",style:{width:"100%",margin:0},children:a})]})}me.propTypes={teamDid:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onError:w.func,mode:w.oneOf(["create","update"]),item:w.object};me.defaultProps={onError:()=>{},mode:"create",item:{}};function fe({onCancel:c,onSuccess:o,onDelete:d,roleName:f,hasPermission:u}){const{api:l}=A(),{roles:h,permissions:s,teamDid:m,refresh:a,isNodeTeam:n}=$(),{t}=L(),[r,i]=S.useState([]),[y,x]=S.useState(!1),[p,v]=S.useState(null),[j,T]=S.useState(!1),C=Z(h.find(R=>R.name===f)),I=Ge(f),D=async R=>{if(!j)try{T(!0),await l.deleteRole({input:{teamDid:m,name:R}}),d()}catch(b){F.error(b.message)}finally{T(!1),v(null)}},N=async(R,b)=>{const B=(await l.getPermissionsByRole({input:{teamDid:R,role:{name:b}}})).permissions||[],M=s.map(ae=>({...ae,bind:B.some(lt=>lt.name===ae.name)}));i(M)},k=async()=>{T(!0);const R=r.filter(b=>b.bind).map(b=>b.name);try{await l.updatePermissionsForRole({input:{teamDid:m,roleName:C.name,grantNames:R}}),F.success(t("common.saveSuccess")),o()}catch(b){F.error(se(b))}finally{T(!1)}};S.useEffect(()=>{m&&f&&N(m,f)},[m,f]);const z=n||!u;let Y=null;return n&&(Y=e.jsxs("div",{className:"bind",children:[e.jsx("div",{className:"title",children:t("common.permission")}),e.jsx("div",{className:"list",children:r.filter(R=>z?R.bind:!0).map(R=>e.jsx("div",{className:"item",children:e.jsx(xt,{control:e.jsx(gt,{disabled:z,checked:R.bind,onChange:()=>{i(b=>b.map(P=>(P.name===R.name&&(P.bind=!P.bind),P)))},name:R.name}),label:R.description})}))})]})),e.jsxs(U,{title:t("common.passport"),onClose:c,open:!0,fullWidth:!0,toolbar:u&&!I&&e.jsxs(e.Fragment,{children:[e.jsx(W,{onClick:()=>x(C),"data-cy":`edit-passport-${C.name}`,size:"large",children:e.jsx(ce,{fill:"#bfbfbf"})}),e.jsx(W,{onClick:()=>v({title:t("team.passport.delete.title"),description:t("team.passport.delete.description",{name:C.title}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>{D(C.name)},onCancel:()=>{T(!1),v(null)}}),"data-cy":`delete-passport-${C.name}`,size:"large",children:e.jsx(Q,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:n&&!z&&e.jsxs(e.Fragment,{children:[e.jsx(_,{onClick:c,color:"inherit",children:t("common.cancel")}),e.jsxs(_,{onClick:k,color:"primary",disabled:j||!C,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[j&&e.jsx(O,{size:16}),t("common.save")]})]}),children:[e.jsxs(gs,{children:[!C&&e.jsx(ys,{children:e.jsx(O,{})}),C&&e.jsxs("div",{className:"dialog-content",children:[e.jsxs("div",{className:"header",children:[e.jsx("div",{className:"title",children:C.title}),e.jsx("div",{className:"description",style:{marginTop:n?16:48},children:C.description})]}),Y]})]}),y&&e.jsx(me,{teamDid:m,onCancel:()=>x(null),onSuccess:()=>{x(null),a()},mode:"update",roleName:y.name,item:y}),p&&e.jsx(Se,{title:p.title,description:p.description,confirm:p.confirm,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}const fs=V(fe,"mutate_team"),hs=V(fe,"",J);function xs(c){const{inService:o}=A();return o?e.jsx(hs,{...c}):e.jsx(fs,{...c})}fe.propTypes={roleName:w.string.isRequired,onCancel:w.func.isRequired,onSuccess:w.func.isRequired,onDelete:w.func.isRequired,hasPermission:w.bool};fe.defaultProps={hasPermission:!1};const gs=H.div`
132
+ .header {
133
+ .title {
134
+ font-weight: 400;
135
+ font-size: 24px;
136
+ line-height: 28px;
137
+ color: ${({theme:c})=>c.palette.text.primary};
138
+ }
139
+
140
+ .description {
141
+ margin-top: 16px;
142
+ font-weight: 400;
143
+ font-size: 16px;
144
+ line-height: 19px;
145
+ color: ${({theme:c})=>c.palette.text.secondary};
146
+ }
147
+ }
148
+
149
+ .bind {
150
+ margin-top: 24px;
151
+ .title {
152
+ font-weight: 400;
153
+ font-size: 16px;
154
+ line-height: 19px;
155
+ color: ${({theme:c})=>c.palette.text.secondary};
156
+ margin-bottom: 24px;
157
+ }
158
+ .item {
159
+ margin-top: 24px;
160
+ }
161
+
162
+ .MuiFormControlLabel-label {
163
+ font-weight: 400;
164
+ font-size: 16px;
165
+ line-height: 19px;
166
+ color: ${({theme:c})=>c.palette.text.secondary};
167
+ }
168
+
169
+ .PrivateSwitchBase-root-45 {
170
+ padding: 0;
171
+ padding-right: 12px;
172
+ }
173
+ }
174
+ `,ys=H.div`
175
+ flex: 1;
176
+ display: flex;
177
+ justify-content: center;
178
+ align-items: center;
179
+ height: 200px;
180
+ `,ze=S.memo(({field:c,value:o,copyable:d})=>{const{local:f}=L();return o?e.jsxs(g,{display:"flex",alignItems:"center",gap:1,onClick:u=>u.stopPropagation(),children:[c?e.jsxs(Fe,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[c,":"]}):null,e.jsx(Fe,{variant:"body1",children:e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx(K,{title:o,children:e.jsx("span",{className:"value-ellipsis",children:o})}),d?e.jsx(It,{content:$t(o),locale:f,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null});function De({createPassportSvg:c}){const{inService:o}=A(),{roles:d,teamIssuerDid:f,teamName:u,refresh:l,passportColor:h,teamDid:s,isNodeTeam:m}=$(),{t:a}=L(),[n,t]=S.useState(!1),[r,i]=S.useState(!1),y=yt(p=>p.breakpoints.down("md")),x=S.useCallback(p=>p&&!G.ROLES[p.toUpperCase()],[]);return e.jsxs(js,{sx:{mt:0},children:[e.jsx(g,{display:"flex",justifyContent:"flex-end",children:!m&&e.jsxs(jt,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[e.jsx(ye,{style:{fontSize:16,marginRight:4}}),a("team.passport.create.title")]})}),e.jsx(g,{className:"list",children:d.map(p=>e.jsxs(g,{"data-cy":`passport-${p.name}`,sx:{display:"flex",justifyContent:"space-between"},className:"item",display:"flex",alignItems:"center",onClick:()=>i(p),children:[e.jsxs(g,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:c({title:p.title,issuer:u,issuerDid:f,ownerName:"Your Name",ownerDid:f,preferredColor:h,width:"150px"})}}),e.jsxs(g,{ml:3,className:"title",children:[e.jsx(ze,{value:p.title}),x(p.name)?e.jsx(ze,{value:p.name,copyable:!0}):null]})]}),!y&&e.jsx(g,{className:"description",children:p.description}),e.jsx(Ke,{permission:o?"":"mutate_team",role:o?J:[],children:e.jsx("div",{className:"action",children:Ge(p.name)?e.jsx(qt,{}):e.jsx(ce,{})})})]},p.name))}),r&&e.jsx(xs,{onCancel:()=>i(!1),onSuccess:()=>{i(!1),l()},onDelete:()=>{i(!1),l()},mode:"update",roleName:r.name,item:r}),n&&e.jsx(me,{teamDid:s,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const js=H(g)`
181
+ .list {
182
+ .item {
183
+ padding: 12px;
184
+ margin: 12px -12px;
185
+ cursor: pointer;
186
+ transition: box-shadow 0.4s;
187
+ &:hover {
188
+ box-shadow: 0 0 10px 4px rgba(0, 0, 0, 0.1);
189
+ }
190
+
191
+ .value-ellipsis {
192
+ display: inline-block;
193
+ max-width: 290px;
194
+ white-space: nowrap;
195
+ overflow: hidden;
196
+ text-overflow: ellipsis;
197
+ }
198
+ }
199
+
200
+ .title {
201
+ font-weight: 400;
202
+ font-size: 18px;
203
+ line-height: 21px;
204
+ color: ${({theme:c})=>c.palette.text.primary};
205
+ }
206
+
207
+ .description {
208
+ flex: 1;
209
+ margin-left: 24px;
210
+ margin-right: 24px;
211
+ color: ${({theme:c})=>c.palette.text.secondary};
212
+ }
213
+
214
+ .action {
215
+ fill: ${({theme:c})=>c.palette.text.secondary};
216
+ }
217
+ }
218
+ `;De.propTypes={createPassportSvg:w.func.isRequired};De.defaultProps={};function ke({createPassportSvg:c}){const{t:o}=L(),{api:d,inService:f}=A(),{teamDid:u,refresh:l,enablePassportIssuance:h,isNodeTeam:s}=$(),[m,a]=S.useState(!1),[n,t]=S.useState(!1),[r,i]=S.useState(!1),[y,x]=S.useState(!1),[p,v]=S.useState(!1),j=async T=>{if(T.stopPropagation(),!y){x(!0);try{await d.configPassportIssuance({input:{teamDid:u,enable:!h}}),l(),await re(800),F.success(o("common.configSuccess"))}catch(C){F.error(C.message)}finally{x(!1)}}};return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,sx:{ml:1},children:[e.jsx(Ke,{permission:f?"":"mutate_team",role:f?J:[],children:e.jsx(X,{variant:"outlined",menuButtonProps:{"data-cy":"trusted-issuers-more"},menu:e.jsxs(e.Fragment,{children:[e.jsx(X.Item,{onClick:()=>t(!0),"data-cy":"config-trusted-issuers",children:e.jsxs(g,{children:[o("team.passport.trustedPassportIssuers"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.trustedPassportIssuersTip")})]})}),e.jsx(X.Item,{onClick:()=>i(!0),"data-cy":"config-show-trusted-factories",children:e.jsxs(g,{children:[o("team.passport.configFactories"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configFactoriesTip")})]})}),e.jsx(X.Item,{"data-cy":"config-show-issue-passport",onClick:j,children:e.jsxs(g,{display:"flex",alignItems:"center",children:[y&&e.jsx(O,{size:16,style:{marginRight:8}}),e.jsxs(g,{children:[o(h?"team.passport.disableIssuance":"team.passport.enableIssuance"),e.jsx(g,{fontSize:12,color:"#888",children:o(h?"team.passport.disableIssuanceTip":"team.passport.enableIssuanceTip")})]})]})}),!s&&e.jsx(X.Item,{onClick:()=>a(!0),"data-cy":"config-passport-color",children:e.jsxs(g,{children:[o("team.passport.configColor"),e.jsx(g,{fontSize:12,color:"#888",children:o("team.passport.configColorTip")})]})})]}),children:()=>e.jsx(_,{variant:"outlined",onClick:()=>{v(!0)},children:o("team.passport.view")})})}),n&&e.jsx(ts,{onCancel:()=>t(!1)}),r&&e.jsx(is,{onCancel:()=>i(!1)}),m&&e.jsx(Vt,{onCancel:()=>a(!1),onSuccess:()=>a(!1)}),p&&e.jsx(U,{open:!0,maxWidth:"lg",onClose:()=>v(!1),onBackdropClick:()=>v(!1),onEscapeKeyDown:()=>v(!1),title:o("team.passport.view"),children:e.jsx(De,{createPassportSvg:c,onCancel:()=>v(!1)})})]})}ke.propTypes={createPassportSvg:w.func.isRequired};ke.defaultProps={};const Be="$all",_e="",ot=ct.memo(({createPassportSvg:c,passport:o,teamDid:d,inService:f})=>{var u,l,h,s;return e.jsx(g,{sx:{display:"flex"},dangerouslySetInnerHTML:{__html:c({scope:o.scope,role:o.role,title:o.scope==="kyc"?o.name:o.title,issuer:o.issuer&&o.issuer.name,issuerDid:o.issuer&&o.issuer.id,ownerName:(u=o.user)==null?void 0:u.fullName,ownerDid:(l=o.user)==null?void 0:l.did,ownerAvatarUrl:(h=o.user)!=null&&h.avatar?Ye((s=o.user)==null?void 0:s.avatar,d,f):"",revoked:o.revoked,width:"36px",extra:o!=null&&o.expirationDate?{key:"Exp",value:Ue(o.expirationDate).format("YYYY-MM-DD HH:mm:ss")}:null})}})});ot.propTypes={passport:w.object.isRequired,createPassportSvg:w.func.isRequired,teamDid:w.string.isRequired,inService:w.bool.isRequired};function it({createPassportSvg:c}){const{api:o}=A(),{teamDid:d}=$(),{t:f,locale:u}=L(),{SYSTEM_ROLES:l}=Bt(),{inService:h}=A(),[s,m]=S.useState(!1),a=`passports-${d}`,n=Rt(a),[t,r]=S.useState({role:Be,status:_e,searchText:n.searchText||"",pageSize:n.rowsPerPage||10,page:n.page?n.page+1:1}),{data:i,loading:y}=oe(async()=>(await o.getPassportRoleCounts({input:{teamDid:d}})).counts||[],{refreshDeps:[d]}),{data:x,loading:p}=oe(async()=>{const b={};t.role!==Be&&(b.role=t.role),t.status&&(b.status=t.status);const P=await o.getPassportsByRole({input:{teamDid:d,query:b,paging:{page:t.page,pageSize:t.pageSize}}});return{passports:P.passports||[],total:P.paging.total}},{refreshDeps:[t.role,t.status,t.page,t.pageSize],onError:b=>F.error(b.message)}),v=b=>{const P=i==null?void 0:i.find(B=>B.key===b);return(P==null?void 0:P.value)||0},j=S.useMemo(()=>Object.keys(l).map(b=>({name:b,title:l[b],num:v(b)})),[i,v]),T=S.useMemo(()=>[{label:f("team.passport.role"),name:"role",options:{customBodyRender:(b,{rowIndex:P})=>{const B=x==null?void 0:x.passports[P];return e.jsxs(g,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ot,{createPassportSvg:c,passport:B,teamDid:d}),e.jsx(g,{children:ve(B.title)})]})}}},{label:f("team.passport.owner"),name:"user",options:{customBodyRender:b=>Ce(b,h)}},{label:f("team.passport.status"),name:"status",options:{customBodyRender:be}},{label:f("team.member.lastLogin"),name:"lastLoginAt",options:{customBodyRender:b=>Ve(b,u)}},{label:f("common.address"),name:"id",options:{customBodyRender:_t}},{label:f("blocklet.overview.source"),name:"source",options:{customBodyRender:(b,{rowIndex:P})=>{const B=x==null?void 0:x.passports[P];return B.parentDid?le("recover"):le(B.source)}}}],[f,u,x==null?void 0:x.passports,d,c,h]),C=b=>{r(P=>({...P,role:b,page:1}))},I=({page:b,rowsPerPage:P,searchText:B})=>{t.pageSize!==P?r(M=>({...M,searchText:"",pageSize:P,page:1})):t.page!==b+1?r(M=>({...M,searchText:"",page:b+1})):t.searchText!==B&&r(M=>({...M,searchText:B,page:1}))},D=S.useRef(null),N=(x==null?void 0:x.passports)||[],k=t.searchText?N.filter(b=>{var P;return b.id.includes(t.searchText)||(((P=b==null?void 0:b.user)==null?void 0:P.fullName)||"").includes(t.searchText)}):N,z={sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,onRowClick(b,{dataIndex:P},B){var M;if((M=D.current)!=null&&M.contains(B.target)){const ae=x==null?void 0:x.passports[P];m(ae)}},page:t.page-1,rowsPerPage:t.pageSize,count:(x==null?void 0:x.total)||0,searchDebounceTime:600},Y=b=>{r(P=>({...P,status:b.target.value,page:1}))},R=e.jsxs(g,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsxs(g,{sx:{fontSize:16,fontWeight:400},children:[f("team.passport.status"),":"]}),e.jsxs(vt,{size:"small",value:t.status,onChange:Y,displayEmpty:!0,sx:{minWidth:120,height:36,".MuiSelect-select":{py:.5,px:1.5}},children:[e.jsx(ie,{value:_e,children:f("common.all")}),Object.values(G.PASSPORT_STATUS).map(b=>e.jsx(ie,{value:b,sx:{py:1},children:f(`team.passport.statusMap.${b}`)},b))]})]});return y?e.jsx(g,{py:2,children:e.jsx(te,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{position:"relative",pb:2},children:e.jsx(O,{})})}):e.jsxs(vs,{children:[e.jsxs(g,{className:"main",display:"flex",sx:{mt:0,gap:3},children:[e.jsx(g,{className:"left",children:e.jsx(g,{className:"tabs",children:j.map(b=>e.jsxs(g,{className:`tab ${t.role===b.name?"active":""}`,onClick:()=>C(b.name),children:[e.jsx("span",{className:"text",children:b.title}),e.jsx(g,{sx:{color:"text.secondary"},children:b.num})]},b.name))})}),e.jsx(g,{ref:D,className:"right",children:e.jsx(xe,{className:"main-table",verticalKeyWidth:100,locale:u,durable:a,durableKeys:["page","rowsPerPage"],data:k,columns:T,options:z,loading:p,onChange:I,customButtons:[e.jsx(ke,{createPassportSvg:c})],title:R})})]}),s&&e.jsx(Te,{createPassportSvg:c,onCancel:()=>m(null),passport:s,onSwitchPassport:m})]})}it.propTypes={createPassportSvg:w.func.isRequired};it.defaultProps={};const vs=bt(g)`
219
+ .main {
220
+ .left {
221
+ width: 256px;
222
+ flex-shrink: 0;
223
+
224
+ .tabs {
225
+ padding-top: 16px;
226
+ .tab {
227
+ display: flex;
228
+ justify-content: space-between;
229
+ align-items: center;
230
+ padding: 8px 16px;
231
+ transition: background 0.4s;
232
+
233
+ width: 256px;
234
+ height: 36px;
235
+ border-radius: 8px;
236
+
237
+ cursor: pointer;
238
+ user-select: none;
239
+
240
+ &:nth-child(n + 2) {
241
+ margin-top: 24px;
242
+ }
243
+
244
+ &.active {
245
+ background-color: ${({theme:c})=>c.palette.grey[100]};
246
+ }
247
+
248
+ &:hover {
249
+ background-color: ${({theme:c})=>c.palette.grey[100]};
250
+ }
251
+
252
+ .text {
253
+ font-weight: 400;
254
+ font-size: 16px;
255
+ line-height: 19px;
256
+ color: ${({theme:c})=>c.palette.text.primary};
257
+ }
258
+
259
+ .badge {
260
+ display: flex;
261
+ flex-shrink: 0;
262
+ justify-content: center;
263
+ align-items: center;
264
+ width: 20px;
265
+ height: 20px;
266
+ border-radius: 100%;
267
+ color: #fff;
268
+ background: #666666;
269
+ font-size: 10px;
270
+ font-weight: 400;
271
+ &.is-rect {
272
+ width: auto;
273
+ border-radius: 8px;
274
+ padding: 0 4px;
275
+ }
276
+ }
277
+ }
278
+ }
279
+ @media (max-width: ${c=>c.theme.breakpoints.values.md}px) {
280
+ display: none;
281
+ }
282
+ }
283
+ .right {
284
+ flex: 1;
285
+ overflow: auto;
286
+ }
287
+ }
288
+ `;export{it as default};
@@ -0,0 +1,113 @@
1
+ import{r as j}from"./vendor-react-DEoibe3W.js";import{j as e,H as d,a9 as Pe,ad as jt,T as J,aa as C,E as _e,bp as Fe,bA as et,bR as Te,bt as Re,bS as Ie,y as Se,b4 as Ee,ab as tt,ah as ce,a1 as st,m as yt,bd as Xe,bs as vt,bo as St,q as Ze,bZ as Ct}from"./vendor-mui-core-B6POpIBB.js";import{e as ie,aA as ue,C as Nt}from"./vendor-utils-BUwfcN20.js";import{a2 as Z,n as P,bb as wt,r as ke,F as Tt,u as te,bT as Rt,a1 as nt,a as De,ab as at,bq as je,ar as It,aw as Et,bx as Dt}from"./vendor-ux-did-connect-DVrP2LNw.js";import{z as At,t as V,l as Ot,I as Je}from"./index-Cb1OPKJL.js";import{f as ee,a as Ae}from"./vendor-hooks-DpLLpTSZ.js";import{S as he}from"./shorten-label-SbKUBkvs.js";import{I as it}from"./index-i5c4XeO-.js";import{A as Lt,S as Pt,a as _t,b as Ft,B as kt}from"./list-B1E5dxgu.js";import{R as Be}from"./relative-time-DlN06RKr.js";import{a as ze}from"./dashboard-0TEl6bJJ.js";import{W as Bt}from"./did-address-CJZtrzhT.js";import{p as ot}from"./util-BcFfyz6S.js";import{D as zt,g as Wt}from"./traffic-Dbf1L1c0.js";import{i as Mt,b as qt}from"./use-blocklet-logo-DryhoHen.js";import{B as rt}from"./bundle-avatar-njRzpG6o.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CX-5Ex_f.js";import"./index-DIe9psLc.js";import"./InfoOutlined-BMb9Zu84.js";import"./sdk-DICk2ZHP.js";import"./CheckCircle-Bxk_pKUt.js";import"./index-CjZLIV87.js";import"./Phone-CKzC4712.js";import"./Location-BQhEvGNL.js";import"./Email-B0n6rLUZ.js";import"./Timezone-C3hiNX6j.js";import"./useLocalStorage-Cb6R1F6v.js";import"./confirm-Bj4L0Vn8.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-CVHX5RbU.js";import"./get-safe-url-BYr2jgRv.js";import"./session-j-9KoWbs.js";import"./dot-CaKxEi_0.js";import"./useAsync-DXeWUWXr.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-BNUwcWCH.js";import"./base32-yUUlhgnG.js";import"./iframe-B7H87IMw.js";import"./LaunchOutlined-faHvtBle.js";import"./ChevronLeft-DgTQnUwX.js";import"./ChevronRight-C-lajCDc.js";import"./index-BUHlfcy3.js";import"./vendor-mui-x-CATHW1QL.js";import"./AdapterDayjs-D5LoqHiU.js";const lt=j.createContext({}),{Provider:Kt,Consumer:mn}=lt;function $t({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:o}}=At(),[a,x]=j.useState([]),[u,R]=j.useState({total:0,pageSize:20,pageCount:0,page:1}),m=ee(()=>{var h;return(h=s.meta)==null?void 0:h.did},[s]),[v,S]=j.useState([]),[I,M]=j.useState({}),E=ee(()=>a.length?new Set(a.map(h=>h.id)):new Set,[a]),L=async({page:h=1,pageSize:O=20,...A}={})=>{if(!m)return[];try{const _={paging:{page:h,pageSize:O},...A,teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0},{dids:B,...q}=_;let Q="";B&&B.includes("system")&&(Q="system");const z=B?B.filter(f=>f!=="system"):[],oe={...q,source:Q,componentDids:z},se=await n.getNotificationSendLog({input:oe});return M(oe),x(se.list),R(se.paging),se.list}catch(_){return Z.error(_.message),[]}},D=async()=>{const h=await n.getNotificationComponents({input:{teamDid:m}});S(h.componentDids)},G=j.useCallback(h=>{const O=s.children.find(A=>{var _;return((_=A.meta)==null?void 0:_.did)===h});if(O)return O.ancestors=[s],O},[s]),$=async({notificationId:h,receivers:O,channels:A,..._})=>{await n.resendNotification({input:{teamDid:m,notificationId:h,receivers:O,channels:A.map(B=>B==="wallet"?P.NOTIFICATION_SEND_CHANNEL.WALLET:B==="pushKit"?P.NOTIFICATION_SEND_CHANNEL.PUSH:B),..._}})},H=j.useCallback(async h=>(await n.getUser({input:{teamDid:m,user:{did:h}}})).user,[n,m]),N=j.useCallback(async({page:h=1,pageSize:O=20,...A}={})=>{try{const _={paging:{page:h,pageSize:O},...A,userName:A.searchText||"",teamDid:m,dateRange:A.dateRange?[V(A.dateRange[0]).toISOString(),V(A.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:_})}catch(_){throw Z.error(_.message),_}},[n,m]);j.useEffect(()=>{m&&D()},[m]),o(P.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{E.has(h.notificationId)&&L(I)},[E,I]),o(P.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{E.has(h.id)||L(I)},[E,I]);const k={fetch:L,data:a,paging:u,blocklet:s,getComponent:G,resendNotification:$,getUser:H,componentDids:v,getReceivers:N,inService:r,teamDid:m};return e.jsx(Kt,{value:{notificationRecords:k},children:t})}function We(){const{notificationRecords:t}=j.useContext(lt);return t}ge.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ht={info:"primary",success:"success",error:"error",warning:"warning"};function ge({severity:t="info"}){return e.jsx(wt,{type:Ht[t],children:t})}var Me={},Ut=Pe;Object.defineProperty(Me,"__esModule",{value:!0});var ct=Me.default=void 0,Vt=Ut(ke()),Gt=e;ct=Me.default=(0,Vt.default)((0,Gt.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");var qe={},Yt=Pe;Object.defineProperty(qe,"__esModule",{value:!0});var dt=qe.default=void 0,Xt=Yt(ke()),Zt=e;dt=qe.default=(0,Xt.default)((0,Zt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var Ke={},Jt=Pe;Object.defineProperty(Ke,"__esModule",{value:!0});var ut=Ke.default=void 0,Qt=Jt(ke()),es=e;ut=Ke.default=(0,Qt.default)((0,es.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");const ts=(t,s,n="")=>{if(!n||!s)return"";switch(n){case P.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case P.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function pt(t,s,n={}){const{status:r,updatedAt:o,reason:a="",channel:x="wallet"}=n,u=o?t("notification.sendStatus.sentTime",{date:Ot(o,s)}):"",R=ts(t,x,a);return r===P.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:R}:r===P.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:R,sentTime:u}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],Qe=["info","success","error","warning"],ft=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.email)==null?void 0:r.enabled},mt=t=>{var n,r;const{settings:s}=t;return(r=(n=s==null?void 0:s.notification)==null?void 0:n.pushKit)==null?void 0:r.enabled},ss=(t,s)=>{const n=ie(s,"extra.notifications.email",!0);return{available:ft(t),enabled:n}},ns=(t,s)=>{const n=ie(s,"extra.notifications.push",!0);return{available:mt(t),enabled:n}},as=t=>({enabled:ie(t,"extra.notifications.wallet",!0)}),is=t=>({enabled:ie(t,"extra.webhooks",[]).length>0}),xe=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),os=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],be=(t=[])=>{const s=V().startOf("day");return t.filter(n=>V(n.sendAt).isSame(s,"day")).length},rs=(t,s="")=>{if(s&&Le.includes(s)){const a=`${s}SendRecord`,x=ie(t,a,[]);return be(x)}const n=ie(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const a=n[s]??[];return be(a)}const o={};return Le.forEach(a=>{const x=`${a}SendRecord`,u=ie(t,x,[]),R=be(u);o[a]=R}),r.length>0&&r.forEach(a=>{const x=n[a]??[],u=be(x);o[a]=u}),o},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ls=t=>{switch(t){case P.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case P.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case P.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case P.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ht=()=>Tt({typography:{fontSize:14,button:{textTransform:"none"}},components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function ne({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r}){const{status:o,title:a="",sentTime:x="",reason:u=""}=t,R=[a,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(J,{color:"inherit",sx:{fontSize:12},children:R}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(C,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(C,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(C,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[o],style:{opacity:.15}}),e.jsx(C,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[o]})]}),e.jsx(J,{color:"inherit",sx:{fontSize:12},children:n?a:r})]})})}ne.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};ne.defaultProps={enableTooltip:!0,showTitle:!1,children:null};pe.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};pe.defaultProps={onDelete:()=>{}};function pe({list:t,label:s,onDelete:n}){const{t:r,locale:o}=te();return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(a=>{const x=pt(r,o,{status:a});return e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ne,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,a)},a)})]})}$e.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function $e({filterList:t,onChange:s,index:n,column:r,filterValues:o,label:a,renderLabel:x}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(et,{component:"legend",children:a}),e.jsx(Te,{row:!0,children:o.map(u=>e.jsx(Re,{control:e.jsx(Ie,{checked:t[n].indexOf(u.value??u)>-1,onChange:R=>{const m=[...t];R.target.checked?m[n]=[...m[n],u.value??u]:m[n]=m[n].filter(v=>v!==(u.value??u)),s(m[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function we(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(ne,{enableTooltip:!1,config:{status:s.status},children:s.label})})}de.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function de({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:o}){const{t:a,locale:x}=te(),u=pt(a,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(ne,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(ze,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:o,children:a("notification.resend")})]})}He.propTypes={value:d.array.isRequired,onChange:d.func};function He({value:t,onChange:s}){const{locale:n}=te(),r=V().toDate(),[o,a]=j.useState(null),x=j.useCallback(m=>{a(o?null:m.currentTarget)},[o]),u=!!o,R=j.useCallback(m=>{if(!m.startDate||!m.endDate){Z.error("Please select a date range");return}if(V(m.startDate).isAfter(m.endDate)||!V(m.startDate).isValid()||!V(m.endDate).isValid()){Z.error("Invalid date range");return}s([m.startDate,m.endDate]),a(null)},[s]);return e.jsxs("div",{children:[e.jsx(J,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Je(t[0],n)," - ",Je(t[1],n)]})}),e.jsx(Ee,{open:u,anchorEl:o,onClose:()=>{a(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(zt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Wt(r),onChange:R})})]})}Ue.propTypes={itemComponent:d.elementType.isRequired};function Ue({itemComponent:t,...s}){var o;const{t:n}=te();return!((o=s==null?void 0:s.filterList)!=null&&o.filter(a=>a.length).length)?null:e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(Rt.TableFilterList,{...s,ItemComponent:t})})]})}function Ce({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const o=s&&typeof s=="function"?s:void 0;let a=!0;return n&&typeof n=="function"&&(a=n({label:t,...r})),e.jsx(_e,{label:t,variant:"outlined",...o&&a?{onDelete:o}:{}})}Ce.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};Ce.defaultProps={canDelete:()=>!0};const cs=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];Ve.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};Ve.defaultProps={loading:!1,onCancel:()=>{},onConfirm:()=>{}};function Ve({loading:t=!1,onCancel:s,onConfirm:n}){const{t:r}=te(),[o,a]=j.useState(cs),[x,u]=j.useState(!0),R=(v,S)=>{S.checked=v.target.checked;const I=o.map(M=>({...M,checked:M.value===S.value?S.checked:M.checked}));a(I)},m=v=>{v.stopPropagation(),n({channels:o.filter(S=>S.checked).map(S=>S.value),isResendFailedOnly:x})};return e.jsxs(C,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(J,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(C,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(et,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:o.map(v=>e.jsx(Re,{control:e.jsx(Ie,{checked:v.checked,onChange:S=>R(S,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(C,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Re,{control:e.jsx(Ie,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(C,{display:"flex",justifyContent:"flex-end",gap:1,className:"resend-config-footer-tip",children:[e.jsx(Se,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Se,{onClick:m,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(tt,{size:16}),r("common.confirm")]})]})]})}gt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function gt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:o}=te(),{getReceivers:a,inService:x,teamDid:u,getUser:R,blocklet:m}=We(),[v,S]=j.useState(!1),[I,M]=j.useState([]),E=Ae({anchorEl:null,position:null}),L=Ae({anchorEl:null,position:null}),[D,G]=j.useState(null),[$,H]=j.useState({total:0,pageSize:10,pageCount:0,page:1}),[N,k]=j.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),[h,O]=j.useState([]),A=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],_=async()=>{if(!v&&t)try{S(!0);const i=await a({notificationId:t,...N}),l=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:ot(c.receiverUser.avatar,u,x)}}));M(l),H(i.paging),S(!1)}catch(i){Z.error(i.message),S(!1)}};j.useEffect(()=>{_()},[N]);const B=i=>{i.stopPropagation();const l=i.currentTarget;L.anchorEl=l;const c=l.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},q=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(De,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,Q={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:$.page-1,rowsPerPage:$.pageSize,count:$.total,searchText:N.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:h,onRowSelectionChange:(i,l)=>{O(l.map(c=>c.dataIndex))},customToolbarSelect:q},z=({page:i,rowsPerPage:l,searchText:c,filterList:y})=>{const[,F=[],U=[],K=[]]=y;N.pageSize!==l?k(W=>({...W,pageSize:l,page:1})):N.page!==i+1?k(W=>({...W,page:i+1})):N.searchText!==c?k(W=>({...W,searchText:c,page:1})):ue(F,N.walletSendStatus)?ue(U,N.pushKitSendStatus)?ue(K,N.emailSendStatus)||k(W=>({...W,emailSendStatus:K,page:1})):k(W=>({...W,pushKitSendStatus:U,page:1})):k(W=>({...W,walletSendStatus:F,page:1}))},oe=j.useCallback(async(i,l)=>{if(!l)return!1;const c=await R(l);return c?i==="wallet"?as(c):i==="email"?ss(m,c):i==="pushKit"?ns(m,c):i==="webhook"?is(c):!0:!1},[R,m]),se=j.useCallback(i=>os(r,i),[r]),f=()=>{E.anchorEl=null,E.position=null,G(null)},p=()=>{L.anchorEl=null,L.position=null},g=async(i,l,c=!0,y="")=>{if(!(!l.length||!i.length))try{s(i,l,c,y),L.anchorEl||(await xe(.5),f())}catch(F){console.error("handleResend error",{error:F})}},b=async({channels:i,isResendFailedOnly:l})=>{const c=h.map(y=>I[y].receiver);await g(i,c,l),await xe(.5),p(),O([])},T=async(i,l=[],c=!0)=>{try{await g(["webhook"],[i.receiver],c,l)}catch(y){Z.error(y.response?y.response.statusText:y.message)}},w=async(i,l,c,y=[],F=!0)=>{if(i.stopPropagation(),rs(l,c)>=4){Z.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await T(l,y,F);return}if(i){const K=i.currentTarget,W=K.getBoundingClientRect();E.anchorEl=K,E.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}G({channel:c});try{const K=await oe(c,l.receiver);await xe(1),G({channel:c,result:K}),(typeof K=="boolean"&&K||Nt(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[l.receiver],F),L.anchorEl||(await xe(.5),f()))}catch(K){Z.error(K.message)}},Y=i=>{k(l=>({...l,dateRange:i,page:1}))},X=(i,l,c,y)=>{i.stopPropagation();const F=c.filter(U=>U!==l);k(U=>({...U,[y]:F,page:1}))},ae=ee(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:l,receiver:c}=I[i];return l?e.jsxs(C,{"data-cy":`member-name-${l.fullName}`,display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start",children:[e.jsx(nt,{src:`${l.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(he,{children:l.fullName})]},c):e.jsx(Bt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:N.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Wallet",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Wallet",filterList:i,onChange:l,index:c,column:y,filterValues:A})},customBodyRenderLite:i=>{const{walletSendStatus:l,walletSendAt:c,walletSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"wallet",onResend:F=>w(F,I[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:l,pushKitSendAt:c,pushKitSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"pushkit",onResend:F=>w(F,I[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:N.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Push Kit",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Push Kit",filterList:i,onChange:l,index:c,column:y,filterValues:A})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:l,emailSendAt:c,emailSendFailedReason:y}=I[i];return e.jsx(de,{status:l,updatedAt:c,reason:y,channel:"email",onResend:F=>w(F,I[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:N.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(pe,{list:i,label:"Email",onDelete:(l,c)=>{l.stopPropagation(),X(l,c,ae[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:A,fullWidth:!0,logic:ve,display:(i,l,c,y)=>e.jsx(we,{label:"Email",filterList:i,onChange:l,index:c,column:y,filterValues:A})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:l}=I[i];if(!l)return null;const c=Object.entries(l)[0];if(!c)return null;const[y,F]=c,U=F[0];return e.jsx(C,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(C,{className:"webhook-item",fontSize:12,children:[e.jsx(he,{maxLength:30,children:y},y),e.jsx(de,{status:U.status,updatedAt:U.sendAt,reason:U.failedReason,channel:"webhook",onResend:K=>w(K,I[i],"webhook",[y],!1)})]},y)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:l}=I[i];return e.jsx(Be,{value:l,locale:o,shouldUpdate:!0})}}}],[I,o,N,r]),Ye=[e.jsx(He,{value:N.dateRange,onChange:Y},"date-picker"),e.jsx(De,{variant:"contained",size:"small",color:"primary",loading:v,startIcon:e.jsx(ut,{}),onClick:()=>_(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(C,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(us,{children:e.jsxs(st,{theme:ht(),children:[e.jsx(at,{className:"receivers-table",locale:o,loading:v,columns:ae,data:I,onChange:z,options:Q,customButtons:Ye,components:{TableFilterList:i=>e.jsx(Ue,{...i,itemComponent:l=>e.jsx(Ce,{...l,canDelete:()=>!1})})}}),E.anchorEl&&e.jsx(Ee,{open:!!E.anchorEl,anchorReference:"anchorPosition",anchorPosition:E.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ps,{children:[e.jsxs(J,{variant:"body1",component:"div",className:"check-title",children:[D==null?void 0:D.channel," Checking"]}),e.jsx(C,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:se(D==null?void 0:D.channel).map(i=>{var F,U;const{type:l,pass:c,fail:y}=i;return!(D!=null&&D.result)||(F=D==null?void 0:D.result)!=null&&F[l]?e.jsxs(J,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(U=D==null?void 0:D.result)!=null&&U[l]?je.success.main:"inherit"},children:[D!=null&&D.result?e.jsx(ct,{}):e.jsx(tt,{size:12,sx:{color:je.primary.main}}),e.jsx("span",{children:c})]},l):e.jsxs(J,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:je.error.main},children:[e.jsx(dt,{}),e.jsx("span",{children:y})]},l)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:p,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(Ve,{loading:n,onCancel:p,onConfirm:b})})]})})})}const ds=j.memo(gt),us=ce.div`
2
+ td.MuiTableCell-footer {
3
+ border: none !important;
4
+ }
5
+ .sent-status-cell {
6
+ .resend-btn {
7
+ display: none;
8
+ }
9
+ &:hover {
10
+ .resend-btn {
11
+ display: flex;
12
+ }
13
+ }
14
+ }
15
+ `,ps=ce.div`
16
+ padding: 8px 16px;
17
+ .check-title {
18
+ font-weight: 500;
19
+ margin-bottom: 8px;
20
+ &::first-letter {
21
+ text-transform: uppercase;
22
+ }
23
+ }
24
+ .check-item {
25
+ svg {
26
+ font-size: 16px;
27
+ }
28
+ font-size: 12px;
29
+ }
30
+ `,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function fs(t){const{wallet:s,push:n,email:r,webhook:o}=t;return[{name:"Wallet",value:e.jsx(re,{item:s})},{name:"Push",value:e.jsx(re,{item:n})},{name:"Email",value:e.jsx(re,{item:r})},...o.total>0?[{name:"Webhook",value:e.jsx(re,{item:o,isWebhook:!0})}]:[]]}function ms(t,s,n){const{wallet:r,push:o,email:a,webhook:x}=t;return[{name:"Wallet",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.PUSH,item:o,onResend:s})},{name:"Email",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.EMAIL,item:a,onResend:s})},...x.total>0?[{name:"Webhook",value:e.jsx(le,{loading:n,channel:P.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:x,isWebhook:!0,onResend:s})}]:[]]}Ne.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};Ne.defaultProps={mode:"simple",onResend:()=>{},resending:!1};re.propTypes={item:d.object.isRequired,isWebhook:d.bool};re.defaultProps={isWebhook:!1};function re({item:t,isWebhook:s=!1}){const{t:n}=te(),r=s?t.success.length:t.success,o=t.total,a=r===o?"success":"failed";return e.jsx(C,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,children:e.jsx(C,{display:"flex",alignItems:"center",gap:1,children:e.jsxs(ne,{config:{status:a},enableTooltip:!1,children:[fe(r)," / ",fe(o)," ",n("notification.sendStatus.success")]})})})}le.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};le.defaultProps={isWebhook:!1,channel:P.NOTIFICATION_SEND_CHANNEL.WALLET,onResend:()=>{},loading:!1};function le({channel:t,item:s,isWebhook:n=!1,onResend:r,loading:o}){const{t:a}=te(),{success:x,failed:u,pending:R}=s,m=ls(t),v=n?x.length:x,S=n?u.length:u,I=n?R.length:R,M=async G=>{G.stopPropagation();const $=n?[...new Set([...x,...u].map(H=>H))]:[];await r([t],[],!0,$)},E=v+S,L=E>0?v/E*100:0,D=E>0?S/E*100:0;return e.jsxs(hs,{successRatio:L,failedRatio:D,children:[e.jsxs(J,{variant:"h6",children:[m," (",s.total,")"]}),e.jsxs(J,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(v)}),e.jsx("small",{style:{paddingLeft:4},children:a("notification.sendStatus.success")})]}),e.jsxs(C,{className:"unsent-area",children:[e.jsxs(C,{children:[e.jsxs(ne,{config:{status:"failed"},enableTooltip:!1,children:[fe(S)," ",a("notification.sendStatus.failed")]}),e.jsxs(ne,{config:{status:"pending"},enableTooltip:!1,children:[fe(I)," ",a("notification.sendStatus.pending")]})]}),S>0&&e.jsx(C,{className:"resend-btn",children:e.jsx(De,{size:"small",color:"primary",loading:o,variant:"contained",startIcon:e.jsx(ze,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:M,children:a("notification.resend")})})]})]})}function Ne({statistics:t,mode:s="simple",onResend:n,resending:r}){const o=ee(()=>s==="simple"?fs(t):ms(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:o.map(a=>e.jsx(it,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:a.name,children:a.value},a.name))}):e.jsx(Xe,{container:!0,spacing:2,children:o.map(a=>e.jsx(Xe,{item:!0,md:4,sm:6,xs:12,children:a.value},a.name))})}const hs=ce(C)`
31
+ display: flex;
32
+ flex-direction: column;
33
+ align-items: flex-start;
34
+ padding: 16px;
35
+ border-radius: 8px;
36
+ background: ${({successRatio:t,failedRatio:s,theme:n})=>t===0&&s===0?n.palette.grey[300]:`linear-gradient(to right, ${yt(n.palette.success.light,.4)} ${t}%, ${n.palette.grey[100]} ${t}%)`};
37
+ transition: 'background 0.5s ease';
38
+ cursor: pointer;
39
+ .unsent-area {
40
+ width: 100%;
41
+ position: relative;
42
+ .resend-btn {
43
+ position: absolute;
44
+ right: 0;
45
+ bottom: 0;
46
+ }
47
+ }
48
+ `;xt.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function xt({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:o,locale:a}=te(),{getComponent:x,resendNotification:u}=We(),[R,m]=j.useState(!1),v=ee(()=>x(t.componentDid)||n,[n,t.componentDid]),S=Ae({tab:r||"info"}),I=j.useCallback(async(h,O,A=!0,_=[])=>{var Q;if(!h.length||!t.id)return;const B=O.length>0?O:(Q=t==null?void 0:t.receivers)==null?void 0:Q.map(z=>z.receiver);if(!B.length)return;let q=[...h];if(q.includes(P.NOTIFICATION_SEND_CHANNEL.PUSH)&&!mt(n)&&(Z.warning(o("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),q=q.filter(z=>z!==P.NOTIFICATION_SEND_CHANNEL.PUSH)),q.includes(P.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ft(n)&&(Z.warning(o("notification.sendStatus.reason.unavailable",{channel:"Email"})),q=q.filter(z=>z!==P.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!q.length)try{m(!0),await u({notificationId:t.id,receivers:B,channels:q,resendFailedOnly:A,...q.includes("webhook")&&_.length?{webhookUrls:_}:{}}),Z.success("Message has been sent!")}catch(z){console.error("handleResend error",{error:z}),Z.error(z.response?z.response.statusText:z.message)}finally{m(!1)}},[n,t.id,t==null?void 0:t.receivers,u,o]),M=ee(()=>Mt(t),[t]),E=ee(()=>qt(t),[t]),L=ee(()=>M?t==null?void 0:t.actorInfo:[],[t]),D=ee(()=>{var h;return(n==null?void 0:n.did)||((h=n==null?void 0:n.meta)==null?void 0:h.did)||""},[n]);function G(){return[{name:o("notification.from"),value:M&&E?e.jsx(Lt,{actors:L,teamDid:D,size:32,showName:!0}):e.jsx(Pt,{size:32,blocklet:v,showName:!0,hideDot:!0})},{name:o("notification.notificationTitle"),value:e.jsx(he,{maxLength:50,children:t.title})},{name:o("notification.body"),value:M?e.jsx(_t,{notification:t,blocklet:n}):e.jsx(Ft,{notification:t,rows:0})},{name:o("notification.severity"),value:e.jsx(ge,{severity:t.severity})},{name:o("notification.createdAt"),value:e.jsx(Be,{value:t.createdAt,locale:a,shouldUpdate:!0})}].map(O=>e.jsx(it,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:O.name,children:O.value},O.name))}const $={info:{label:o("common.basicInfo"),value:"info",component:G},receivers:{label:o("notification.receiver"),value:"receivers"},statistics:{label:o("notification.statistics"),value:"statistics"}},H=Object.values($).map(({label:h,value:O})=>({label:h,value:O})),N=$[S.tab]||$.info,k=h=>{S.tab=h};return e.jsx(It,{title:o("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{S.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(xs,{children:[e.jsx(C,{mx:3,className:"tabs",children:e.jsx(Et,{tabs:H,current:S.tab,onChange:k,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[S.tab==="receivers"&&e.jsx(ds,{notificationId:t.id,resending:R,handleResend:I}),S.tab==="statistics"&&e.jsx(Ne,{statistics:t.statistics,mode:"detail",resending:R,onResend:I}),S.tab==="info"&&e.jsx(N.component,{})]})]})})}const gs=j.memo(xt),xs=ce.div`
49
+ & > .notification-row {
50
+ padding: 0;
51
+ }
52
+
53
+ .tabs {
54
+ margin: 0;
55
+ }
56
+ .body {
57
+ margin-top: 16px;
58
+ }
59
+
60
+ .channel-item {
61
+ display: flex;
62
+ padding: 4px;
63
+ justify-content: flex-start;
64
+ align-items: center;
65
+ gap: 8px;
66
+ > p {
67
+ font-size: 15px;
68
+ }
69
+ .resend-btn {
70
+ svg {
71
+ font-size: 16px;
72
+ }
73
+ display: flex;
74
+ align-items: center;
75
+ font-size: 12px;
76
+ cursor: pointer;
77
+ &.disabled {
78
+ cursor: not-allowed;
79
+ color: ${je.text.disabled};
80
+ }
81
+ }
82
+ }
83
+ `;me.propTypes={blocklet:d.object,label:d.string};me.defaultProps={blocklet:null,label:""};const bs=ce.div`
84
+ display: flex;
85
+ justify-items: flex-start;
86
+ align-items: center;
87
+ gap: 8px;
88
+ .name {
89
+ display: block;
90
+ max-width: 260px;
91
+ white-space: nowrap;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ }
95
+ `;function me({blocklet:t,label:s}){var n;return e.jsx(bs,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(rt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||((n=t.meta)==null?void 0:n.title)})]}):e.jsx("span",{className:"name",children:s})})}Ge.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};Ge.defaultProps={onDelete:()=>{}};function Ge({list:t,label:s,onDelete:n}){return e.jsxs(C,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(J,{children:[s,": "]}),t.map(r=>e.jsx(_e,{size:"small",label:e.jsx(C,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:e.jsx(ge,{severity:r})}),onDelete:o=>n(o,r)},r))]})}function js(t){return e.jsx($e,{...t,renderLabel:s=>e.jsx(ge,{severity:s})})}function ys({customTableButtons:t}){var se;const{t:s,locale:n}=te(),[r,o]=j.useState(!1),{data:a,paging:x,blocklet:u,fetch:R,getComponent:m,componentDids:v,inService:S,teamDid:I}=We(),M=j.useRef(null),[E,L]=j.useState(null),[D,G]=j.useState("info"),$=`notification-records-${(se=u.meta)==null?void 0:se.did}`,H=Dt($),[N,k]=j.useState({pageSize:H.rowsPerPage||10,page:H.page?H.page+1:1,dids:H.dids||[],dateRange:H.dateRange||[V().subtract(1,"month").startOf("day").toDate(),V().endOf("day").toDate()]}),h=ee(()=>{if(!u.children||!u.children.length)return[];const f=[];return u.children.forEach(p=>{var b;const g=p.did||((b=p.meta)==null?void 0:b.did);v.includes(g)&&(p.ancestors=[u],f.push(p))}),f},[v,u]),O=async f=>{try{o(!0),await R(f),o(!1)}finally{o(!1)}};j.useEffect(()=>{O(N)},[N]),j.useEffect(()=>{const f=a.find(p=>p.id===(E==null?void 0:E.id));E&&f&&L({...f})},[a,E]);const A=(f,p,g,b)=>{f.stopPropagation();const T=g.filter(w=>w!==p);k(w=>({...w,[b]:T,page:1}))},_=({page:f,rowsPerPage:p,filterList:g})=>{const[b=[],,,,T=[]]=g;N.pageSize!==p?k(w=>({...w,pageSize:p,page:1})):N.page!==f+1?k(w=>({...w,page:f+1})):ue(N.dids,b)?ue(N.severities,T)||k(w=>({...w,severities:T,page:1})):k(w=>({...w,dids:b,page:1}))},B=j.useCallback(()=>{L(null),G("info")},[]),q=j.useCallback(()=>{R(N)},[R,N]),Q=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((p,g)=>{var T;if(p==="system")return e.jsx("span",{children:s("notification.system")},`system-${g}`);const b=h.find(w=>{var X;return(w.did||((X=w.meta)==null?void 0:X.did))===p});return e.jsx(me,{blocklet:b,label:(b==null?void 0:b.title)||((T=b==null?void 0:b.meta)==null?void 0:T.title)},p)}),update:(f,p,g)=>(f[g].splice(p,1),f)},filterOptions:{names:h,logic:(f,p)=>p.length?!p.includes(f):!1,display:(f,p,g,b)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(vt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[g],renderValue:T=>e.jsx(C,{display:"flex",gap:1,alignItems:"center",style:{overflow:"hidden",textOverflow:"ellipsis"},children:T.map(w=>{var X;if(w==="system")return e.jsx("span",{children:s("notification.system")},w);const Y=h.find(ae=>{var i;return(ae.did||((i=ae.meta)==null?void 0:i.did))===w});return e.jsx(me,{blocklet:Y,label:(Y==null?void 0:Y.title)||((X=Y==null?void 0:Y.meta)==null?void 0:X.title)},w)})}),onChange:T=>{f[g]=T.target.value,p(f[g],g,b)},children:[e.jsx(Ze,{value:"system",children:s("notification.system")}),h.map(T=>{var Y,X;const w=T.did||((Y=T.meta)==null?void 0:Y.did);return e.jsx(Ze,{value:w,children:e.jsx(me,{blocklet:T,label:T.title||((X=T.meta)==null?void 0:X.title)})},w)})]})]})},customBodyRenderLite:f=>{var b,T;const p=a[f],g=m(p.componentDid);return e.jsxs(C,{display:"flex",alignItems:"center",gap:1,children:[g?e.jsx(rt,{size:32,blocklet:g,ancestors:g.ancestors??[]}):e.jsx(kt,{blocklet:u,size:32}),e.jsx(he,{maxLength:50,children:((b=g==null?void 0:g.meta)==null?void 0:b.title)||((T=u==null?void 0:u.meta)==null?void 0:T.title)})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f],{receivers:g}=p;return e.jsx(Ct,{total:g.length,renderSurplus:b=>b<100?e.jsxs("span",{children:["+",b]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:b=>{b.stopPropagation(),L(p),G("receivers")},children:g.map(b=>{const{receiverUser:T}=b,w=ot(T.avatar,I,S);return e.jsx(nt,{alt:T.fullName,src:`${w}?imageFilter=resize&w=48&h=48`,size:32,did:b.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},b.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(C,{onClick:g=>{g.stopPropagation(),L(p),G("statistics")},children:e.jsx(Ne,{statistics:p.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const p=a[f];return e.jsx(he,{maxLength:50,children:p.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const p=a[f];return e.jsx(ge,{severity:p.severity})},filter:!0,filterType:"custom",filterList:N.severities??[],customFilterListOptions:{render:f=>e.jsx(Ge,{list:f,label:s("notification.severity"),onDelete:(p,g)=>{p.stopPropagation(),A(p,g,Q[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:Qe,fullWidth:!0,logic:ve,display:(f,p,g,b)=>e.jsx(js,{label:s("notification.severity"),filterList:f,onChange:p,index:g,column:b,filterValues:Qe})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:p}=a[f];return e.jsx(Be,{value:p,locale:n,shouldUpdate:!0})}}}],z=f=>{k(p=>({...p,dateRange:f,page:1}))},oe=[...t||[]];return e.jsxs(C,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(vs,{children:e.jsx(st,{theme:ht(),children:e.jsx(at,{className:"main-table",verticalKeyWidth:100,loading:r,locale:n,columns:Q,data:a,durable:$,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:x.page-1,rowsPerPage:x.pageSize,count:x.total,...H,onRowClick:(f,{dataIndex:p})=>{L(a[p])}},customPreButtons:[e.jsx(He,{value:N.dateRange,onChange:z})],customButtons:oe,components:{TableFilterList:f=>e.jsx(Ue,{...f,itemComponent:p=>e.jsx(Ce,{...p,canDelete:g=>{var T;const b=(T=g==null?void 0:g.columnNames)==null?void 0:T[(g==null?void 0:g.index)||0];return(b==null?void 0:b.name)==="sender"}})})}})})}),E&&e.jsx(gs,{refresh:q,onCancel:B,notification:E,blocklet:u,tab:D})]})}const vs=ce.div`
96
+ td.MuiTableCell-footer {
97
+ border: none !important;
98
+ }
99
+ .sent-status-cell {
100
+ .resend-btn {
101
+ display: none;
102
+ }
103
+ &:hover {
104
+ .resend-btn {
105
+ display: flex;
106
+ }
107
+ }
108
+ }
109
+
110
+ .custom-toobar-btns {
111
+ gap: 4px;
112
+ }
113
+ `;bt.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};bt.defaultProps={customTableButtons:[]};function bt({blocklet:t={},customTableButtons:s}){return e.jsx($t,{blocklet:t,children:e.jsx(ys,{customTableButtons:s})})}export{bt as default};
@@ -0,0 +1 @@
1
+ import{j as t,ah as r}from"./vendor-mui-core-B6POpIBB.js";import{r as s}from"./vendor-react-DEoibe3W.js";import{b6 as a}from"./vendor-ux-did-connect-DVrP2LNw.js";import{R as e}from"./vendor-arcblock-CX-5Ex_f.js";import"./vendor-utils-BUwfcN20.js";import"./vendor-hooks-DpLLpTSZ.js";import"./lottie-web-jYmAQWuC.js";function x(){const{t:o}=s.useContext(a);return t.jsx(n,{style:{paddingTop:"25vh"},children:t.jsx(e,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const n=r.main``;export{x as default};
@@ -0,0 +1,11 @@
1
+ import{r as u}from"./vendor-react-DEoibe3W.js";import{a9 as $,j as r,H as o,aa as b,b4 as B,O as K,s as D,c2 as W,c3 as X,c4 as G,c5 as H,I as z,ab as U,ah as Y}from"./vendor-mui-core-B6POpIBB.js";import{r as J,b6 as Q,aR as Z,d as ee}from"./vendor-ux-did-connect-DVrP2LNw.js";import{d as re}from"./Done-DjB4uf97.js";import{C as te}from"./Google-VfyWFLKO.js";import{ac as ne,f as oe}from"./index-Cb1OPKJL.js";import{R as se,F as ie,L as ae}from"./logo-uploader-DFGj09Gp.js";var E={},le=$;Object.defineProperty(E,"__esModule",{value:!0});var V=E.default=void 0,ce=le(J()),de=r;V=E.default=(0,ce.default)((0,de.jsx)("path",{d:"M6.23 20.23 8 22l10-10L8 2 6.23 3.77 14.46 12z"}),"ArrowForwardIosSharp");const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function N({editing:e,value:s,onChange:i}){const[a,d]=u.useState(!1),p=u.useRef(),m=u.useRef(s);u.useEffect(()=>{let l=null;return e&&(l=setTimeout(()=>{d(!0)},50)),()=>{clearTimeout(l)}},[e]);const x=l=>{m.current=l,i(l)},j=()=>{d(!1),i(m.current)},g=r.jsx(b,{className:"form-item-input slot",px:1,children:r.jsxs(b,{display:"flex",alignItems:"center",children:[s,s!=="auto"&&r.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=r.jsxs(b,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:j,children:[r.jsx(b,{display:"flex",alignItems:"center",onClick:()=>d(!0),children:r.jsx("div",{ref:p,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),r.jsx(B,{open:a,anchorEl:p.current,onClose:()=>d(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:r.jsx(te,{color:s,onChange:l=>x(l.hex)})})]});return e?f:g}N.propTypes=T;function O({editing:e,description:s,value:i,onChange:a,componentProps:d,...p}){const{placeholder:m}=d,x=u.useRef(i),{t:j}=u.useContext(Q),g=l=>{l.key==="Enter"&&a(x.current,"confirm")},f=l=>{x.current=l,a(l)};return e?r.jsx(K,{style:{flex:1},fullWidth:!0,value:i,onChange:l=>{l.persist(),f(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||m,onKeyDown:g,...p}):r.jsx(b,{px:1,className:"form-item-input slot",children:i||r.jsx("span",{className:"placeholder",children:j("common.requiredInputPlaceholder",{name:s||m})})})}O.propTypes=T;O.defaultProps={componentProps:{}};function A({editing:e,value:s,onChange:i,componentProps:a,...d}){const{blocklet:p}=a,m=s==="auto"?Z.getPassportColorFromDid(p.appDid):s;return r.jsxs(b,{display:"flex",alignItems:"center",children:[r.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:ne({title:"Owner",issuer:oe.getDisplayName(p),issuerDid:p.appDid,ownerName:"Your Name",ownerDid:p.appDid,preferredColor:s||"auto"})}}),r.jsx(N,{...d,editing:e,value:e?m:s,onChange:i,componentProps:a})]})}A.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};A.defaultProps={};const ue=D(e=>r.jsx(W,{disableGutters:!0,elevation:0,square:!0,...e}))(({theme:e})=>({border:`1px solid ${e.palette.divider}`,"&:not(:last-child)":{borderBottom:0},"&::before":{display:"none"}})),pe=D(e=>r.jsx(X,{expandIcon:r.jsx(V,{sx:{fontSize:"0.9rem"}}),...e}))(({theme:e})=>({backgroundColor:e.palette.mode==="dark"?"rgba(255, 255, 255, .05)":"rgba(0, 0, 0, .03)",flexDirection:"row-reverse","& .MuiAccordionSummary-expandIconWrapper.Mui-expanded":{transform:"rotate(90deg)"},"& .MuiAccordionSummary-content":{marginLeft:e.spacing(1)}})),fe=D(G)(({theme:e})=>({padding:e.spacing(2),borderTop:"1px solid rgba(0, 0, 0, .125)"})),me=H`
2
+ 0%, 100% {
3
+ transform: scale(1) translateX(0);
4
+ }
5
+ 50% {
6
+ transform: scale(1.05) translateX(-3px);
7
+ }
8
+ 25%, 75% {
9
+ transform: scale(1.1) translateX(3px);
10
+ }
11
+ `,xe={input:O,color:N,passport:A,uploader:e=>r.jsx(ae,{...e.componentProps})};function ge(e,{editing:s=!1}){const{componentType:i="input",render:a,renderFormItem:d}=e;return s&&d?d:!s&&a?a:xe[i==null?void 0:i.toLowerCase()]}F.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};F.defaultProps={disabled:!1,loading:!1,onCancel:()=>{}};function F({item:e,findEditingItem:s,getItemValue:i,onFormItemChange:a,onFocusOut:d,disabled:p,loading:m,onCancel:x,formValues:j}){var h;const{key:g,description:f,required:l,solo:S=!1,hidden:y=!1,componentProps:k={},skipButtonDisabled:w=!1}=e;if(y)return null;const I=s(g),{editing:R,shaking:q}=I??{},P=i(e,{editing:R}),n=ge(e,{editing:R}),t={inputProps:{"data-cy":"schema-form-item-component"},key:g,description:f,editing:R,value:P,onChange:(c,_="change")=>a(e,c,_),componentProps:k,skipButtonDisabled:w,onBlur:()=>d(e)};return e.componentType==="collapse"&&((h=e.children)==null?void 0:h.length)>0?r.jsxs(ue,{children:[r.jsx(pe,{expandIcon:r.jsx(V,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),r.jsx(fe,{children:e.children.map(c=>r.jsx(F,{item:c,findEditingItem:s,getItemValue:i,onFormItemChange:a,onFocusOut:d,formValues:j,disabled:p,loading:m,onCancel:x},c.key))})]}):r.jsxs(b,{className:"form-item",children:[!S&&r.jsxs(b,{className:"form-item-label",sx:{color:l&&!P?"error.main":"text.secondary"},children:[f,l&&r.jsx(se,{})]}),r.jsxs(b,{className:"form-item-body",children:[r.jsx(b,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:S?"center":"left"},style:{cursor:"text"},onClick:()=>{p||I!=null&&I.edited||w||a(e,j[g],"edit")},children:r.jsx(n,{...t})}),!S&&r.jsx(b,{className:"form-item-action",style:{marginLeft:0},children:R?r.jsxs(r.Fragment,{children:[I.edited?r.jsx(z,{"data-cy":"schema-form-item-confirm",onClick:()=>{a(e,P,"confirm")},disabled:p||m,sx:{animation:q?`${me} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:m?r.jsx(U,{size:24}):r.jsx(re,{})}):null,r.jsx(z,{"data-cy":"schema-form-item-cancel",onClick:()=>x(e),style:{paddingLeft:I.edited?4:8},disabled:p||m,size:"large",children:r.jsx(ee,{})})]}):null})]})]},g)}function v({schema:e,loading:s,value:i,defaultValue:a,onChange:d,style:p,disabled:m}){const x=Object.prototype.toString.call(i)==="[object Object]",[j,g]=u.useState([]),[f,l]=u.useState(x?i:a),S=u.useMemo(()=>e.length===1,[e]),y=u.useCallback(n=>j.find(t=>t.key===n),[j]);u.useEffect(()=>{var n;S&&((n=e[0])!=null&&n.required)&&g([{key:e[0].key,editing:!0,initialValue:a[e[0].key]}])},[e,S,a]);const k=u.useCallback(n=>{g(t=>t.find(c=>c.key===n.key)?t.map(c=>c.key===n.key?n:{...c}):[n].concat(t))},[]),w=u.useCallback((n,t,h)=>{const{key:c,secure:_}=n,C=y(c)??{...n};C.editing=!0;const M=f[c]!==t;C.edited=t&&C.initialValue!==t,C.initialValue=a[c];const L={...f,[c]:t};M&&l(L),d({[c]:t},{allValues:L,action:h,currentItem:n}),h==="confirm"&&_&&l({...f,[c]:"__encrypted__"}),h==="confirm"&&(C.initialValue=f[c]),["confirm","cancel"].includes(h)&&(C.editing=!1,C.edited=!1),k(C)},[a,f,d,k,y]),I=u.useCallback((n,{editing:t=!1})=>{const{key:h}=n,c=x?i[h]:f[h];return c==="__encrypted__"?t?"":"******":c},[x,i,f]),R=u.useCallback(n=>{const t=y(n.key);t&&w(n,t.initialValue,"cancel")},[y,w]),q=u.useCallback(n=>{const t=y(n.key);!t||!t.edited||(t.shaking=!0,k(t),setTimeout(()=>{t.shaking=!1,k(t)},500))},[y,k]),P=u.useCallback(n=>{const t=y(n.key);!t||!t.edited?R(n):q(n)},[y,q,R]);return r.jsx(ye,{className:"form",style:p,children:e==null?void 0:e.map(n=>{const{hidden:t=!1}=n;return t?null:r.jsx(F,{item:n,findEditingItem:y,getItemValue:I,onFormItemChange:w,onFocusOut:P,formValues:f,disabled:m,loading:s,onCancel:R})})})}v.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};v.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const ye=Y(ie)``;export{v as S};