@abtnode/blocklet-services 1.16.43 → 1.16.44-beta-20250513-030435-c2d99062

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 (182) hide show
  1. package/api/emails/_components/activity.js +2 -1
  2. package/api/index.js +5 -1
  3. package/api/libs/email.js +1 -1
  4. package/dist/assets/{AdapterDayjs-BiPHzcUP.js → AdapterDayjs-BD9H1lZ-.js} +1 -1
  5. package/dist/assets/{ArrowDropDown-Dghek9CI.js → ArrowDropDown-BrO-zDlb.js} +1 -1
  6. package/dist/assets/{CheckCircle-Dvhgeo9j.js → CheckCircle-Ds4QI0ey.js} +1 -1
  7. package/dist/assets/{ChevronLeft-DE33N57i.js → ChevronLeft-CnQaQ-rc.js} +1 -1
  8. package/dist/assets/{ChevronRight-BfbPIE2b.js → ChevronRight-a_2_x6Ew.js} +1 -1
  9. package/dist/assets/{Community-2MKVAbIk.js → Community-DW6DJTIs.js} +1 -1
  10. package/dist/assets/{DeleteOutline-B6efX_Fy.js → DeleteOutline-CFN4r-OG.js} +1 -1
  11. package/dist/assets/{Done-Ct5slWpT.js → Done-DqSE6KPe.js} +1 -1
  12. package/dist/assets/{Download-DKQGRFHf.js → Download-C_LRKzbG.js} +1 -1
  13. package/dist/assets/{Edit-BLsIdIOp.js → Edit-CbR4eoK8.js} +1 -1
  14. package/dist/assets/{EditIcon-CwTCQzs9.js → EditIcon-DxUWMw59.js} +1 -1
  15. package/dist/assets/{Email-DOy8vL0N.js → Email-DWueGk7t.js} +1 -1
  16. package/dist/assets/{Error-wpqrAfUT.js → Error-jEHdDLNk.js} +1 -1
  17. package/dist/assets/{ExpandLess-CJXkgMMr.js → ExpandLess-CkoEHpgk.js} +1 -1
  18. package/dist/assets/{Google-BbAgcDQ_.js → Google-DHEolkW-.js} +1 -1
  19. package/dist/assets/{Holiday-DT-VjgQP.js → Holiday-Dwvo6QkZ.js} +1 -1
  20. package/dist/assets/{InfoOutlined-Dy7jTc7H.js → InfoOutlined-DkG0jjos.js} +1 -1
  21. package/dist/assets/{Launch-DBKe0gh0.js → Launch-B-2Jomi6.js} +1 -1
  22. package/dist/assets/{LaunchOutlined-BIq6YUU8.js → LaunchOutlined-CXNijfqX.js} +1 -1
  23. package/dist/assets/{Location-C__VfR4D.js → Location-DUEOr9J2.js} +1 -1
  24. package/dist/assets/{LockIcon-DIGiHKHl.js → LockIcon-Cjg8jV1E.js} +1 -1
  25. package/dist/assets/{Meeting-Cn2X2Ix7.js → Meeting-CJaI_cKm.js} +1 -1
  26. package/dist/assets/{MoreHoriz-BxJelL2A.js → MoreHoriz-B6KdR0Y8.js} +1 -1
  27. package/dist/assets/{OffSick-Cnicwu8x.js → OffSick-C9VqqjrN.js} +1 -1
  28. package/dist/assets/{Phone-CoX1qzAs.js → Phone-DcHUzCa-.js} +1 -1
  29. package/dist/assets/{PlayArrow-C9IFmc-j.js → PlayArrow-BToG9L6q.js} +1 -1
  30. package/dist/assets/{QuestionMarkCircle-DCM9zW3a.js → QuestionMarkCircle-BPVDAm8U.js} +1 -1
  31. package/dist/assets/{ServerLogo-CfbYjQbP.js → ServerLogo-s6cfhx92.js} +1 -1
  32. package/dist/assets/{Timezone-CCdgxxpv.js → Timezone-B-Ho_Uno.js} +1 -1
  33. package/dist/assets/{TuneOutlined-CB7t_nGq.js → TuneOutlined-BR2H7Mxj.js} +1 -1
  34. package/dist/assets/{ViewList-B4hmqizo.js → ViewList-D8vtMKQz.js} +1 -1
  35. package/dist/assets/{WorkingRemotely-DWT54kH1.js → WorkingRemotely-lJ6DUMCR.js} +1 -1
  36. package/dist/assets/{access-control-RJu7xYI3.js → access-control-Din7doVd.js} +1 -1
  37. package/dist/assets/{actions-BCWb2ez1.js → actions-BjTeIzgS.js} +1 -1
  38. package/dist/assets/{add-component-core-DRAzXCeg.js → add-component-core-5x4gTem5.js} +15 -15
  39. package/dist/assets/{add-resource-BDJuVU8K.js → add-resource-BrZnm53f.js} +1 -1
  40. package/dist/assets/{addon-ygDS7Fug.js → addon--u4EErgw.js} +1 -1
  41. package/dist/assets/{advanced-CFME3Vrl.js → advanced-CN6mCSES.js} +1 -1
  42. package/dist/assets/{appearance-BqJwEmtt.js → appearance-Bowm1Shj.js} +1 -1
  43. package/dist/assets/audit-logs-DczjqamJ.js +35 -0
  44. package/dist/assets/{authorize-WekjQ3_M.js → authorize-D2LCmekq.js} +1 -1
  45. package/dist/assets/{base32-BbrXtXL6.js → base32-_zEVBJUg.js} +1 -1
  46. package/dist/assets/{branding-CS-f1gMT.js → branding-B6AmOMI6.js} +6 -6
  47. package/dist/assets/{branding-BTfb8_b4.js → branding-CwhhJRKu.js} +2 -2
  48. package/dist/assets/{bundle-avatar-Db5l8MQ4.js → bundle-avatar-CDJRatFg.js} +1 -1
  49. package/dist/assets/button-D8hoY4xw.js +1 -0
  50. package/dist/assets/click-to-copy-CFiGx48J.js +1 -0
  51. package/dist/assets/{collapse-Bn_BDlF9.js → collapse-QV_2gdtM.js} +1 -1
  52. package/dist/assets/{complete-BRApuFsV.js → complete-CKhw9u_z.js} +2 -2
  53. package/dist/assets/{component-C7g4FGFm.js → component-Cb3m5qUw.js} +2 -2
  54. package/dist/assets/{config-qG8JCIJ_.js → config-LE_EJolF.js} +1 -1
  55. package/dist/assets/{config-C8AXD1JH.js → config-kGXJEkFJ.js} +2 -2
  56. package/dist/assets/{config-navigation-B7r4dV5S.js → config-navigation-CKVyFhfH.js} +4 -4
  57. package/dist/assets/{config-space-CSKkMgqX.js → config-space-CogRdhoQ.js} +1 -1
  58. package/dist/assets/{confirm-BvUfAlkx.js → confirm-SdqBW-ti.js} +1 -1
  59. package/dist/assets/{connect-B2HOOYzS.js → connect-BMn4CxDk.js} +1 -1
  60. package/dist/assets/{connect-DGPdKMcu.js → connect-HAC-YfHh.js} +1 -1
  61. package/dist/assets/{connect-to-BBtnljQ-.js → connect-to-eNQDY2rc.js} +1 -1
  62. package/dist/assets/{content-layout-DzqMXifY.js → content-layout-BzF-fNQz.js} +1 -1
  63. package/dist/assets/dashboard-BYxl5V9e.js +239 -0
  64. package/dist/assets/{delete-confirm-BBaXcAXg.js → delete-confirm-CKF_eljP.js} +1 -1
  65. package/dist/assets/{did-address-BKBBjFqv.js → did-address-DjwPl1uy.js} +1 -1
  66. package/dist/assets/{domain-DTrwCkop.js → domain-DotN6lCb.js} +1 -1
  67. package/dist/assets/{domain-action-card-D-WETV-f.js → domain-action-card-DHH9PLRG.js} +1 -1
  68. package/dist/assets/domains-BV2pykxi.js +1 -0
  69. package/dist/assets/{dot-C05enzim.js → dot-BA3EvSrh.js} +1 -1
  70. package/dist/assets/{email-Bc5KLu5Q.js → email-CHR0EOis.js} +1 -1
  71. package/dist/assets/{empty-spinner-BZlBh4vA.js → empty-spinner-n0_Ehns5.js} +1 -1
  72. package/dist/assets/{exchange-passport-DbNEDTaa.js → exchange-passport-D0iIXJxD.js} +1 -1
  73. package/dist/assets/{fuel-DzWcrU-I.js → fuel-nMTHNcy-.js} +1 -1
  74. package/dist/assets/{gen-access-key-D-ftFU9F.js → gen-access-key-DH4wNzRm.js} +1 -1
  75. package/dist/assets/get-safe-url-B5RJTMjC.js +1 -0
  76. package/dist/assets/get-safe-url-Bk6PlU7n.js +1 -0
  77. package/dist/assets/{home-DXj5oFeO.js → home-DzCwBE8F.js} +1 -1
  78. package/dist/assets/{iframe-CIVgAJuH.js → iframe-DW7zzzTG.js} +1 -1
  79. package/dist/assets/{index-BemEiFHE.js → index-8CHxrfFP.js} +1 -1
  80. package/dist/assets/{index-D64RNKdt.js → index-B54lTbup.js} +6 -6
  81. package/dist/assets/{index-CKheO_aT.js → index-B8r-LrrM.js} +1 -1
  82. package/dist/assets/{index-Bxd86KLJ.js → index-BA8C83iz.js} +4 -4
  83. package/dist/assets/index-BCNchyGN.js +141 -0
  84. package/dist/assets/{index-g0L_1foA.js → index-BCtmnJeV.js} +11 -11
  85. package/dist/assets/{index-BMD-pSqT.js → index-BDYaw77z.js} +1 -1
  86. package/dist/assets/{index-Ce2NSVmU.js → index-BIPRCLBG.js} +1 -1
  87. package/dist/assets/{index-BMPpz8ni.js → index-BJxv6GA4.js} +1 -1
  88. package/dist/assets/index-BLGGjT7N.js +284 -0
  89. package/dist/assets/{index-DjLLC6N3.js → index-BYCeMwoO.js} +1 -1
  90. package/dist/assets/{index-BVU8_1Ed.js → index-B_-kynzD.js} +3 -3
  91. package/dist/assets/{index-D09AfnR1.js → index-BuXc3Oag.js} +1 -1
  92. package/dist/assets/{index-u-w3iMC9.js → index-CIkPfxzG.js} +4 -4
  93. package/dist/assets/{index-CHDiquXf.js → index-CPfvVvHv.js} +11 -11
  94. package/dist/assets/index-CYeNo51G.js +113 -0
  95. package/dist/assets/{index-CUfP1M2j.js → index-CfxcUIhC.js} +1 -1
  96. package/dist/assets/index-Ctzl9JDw.js +55 -0
  97. package/dist/assets/{index-BmWVfEGP.js → index-CxwBhS0_.js} +1 -1
  98. package/dist/assets/{index--HbH1n1_.js → index-D7eC9ptO.js} +1 -1
  99. package/dist/assets/{index-DF3gHUuW.js → index-D9KfgDPN.js} +4 -4
  100. package/dist/assets/{index-wXCx8TFU.js → index-DcUhenm6.js} +1 -1
  101. package/dist/assets/{index-C0SLCehH.js → index-enM9Y412.js} +1 -1
  102. package/dist/assets/{invitation-CKfllvl5.js → invitation-DzT9Qa0A.js} +1 -1
  103. package/dist/assets/{invite-CCCSmPiy.js → invite-CQPeUOT4.js} +1 -1
  104. package/dist/assets/{issue-passport-C3zUptls.js → issue-passport-BYhvmLsl.js} +1 -1
  105. package/dist/assets/{item-CkcpHBHM.js → item-D942q-4T.js} +1 -1
  106. package/dist/assets/{landing-page-q-KgqE9Q.js → landing-page-Due4o1uF.js} +1 -1
  107. package/dist/assets/{launch-result-message-BaU6oEsi.js → launch-result-message-DIYoykBK.js} +1 -1
  108. package/dist/assets/{layout-CyCulQBn.js → layout-BcLfVSqs.js} +1 -1
  109. package/dist/assets/list-BiJWMg_P.js +236 -0
  110. package/dist/assets/list-DKUSPdB6.js +2 -0
  111. package/dist/assets/{list-header-CU9W30JD.js → list-header-HqBQs1yn.js} +1 -1
  112. package/dist/assets/localization-BUDtnbyU.js +1 -0
  113. package/dist/assets/{log-DNpJdgp3.js → log-Iko0jLNA.js} +1 -1
  114. package/dist/assets/{logger-CQ50TnpL.js → logger-BLZgTs_U.js} +1 -1
  115. package/dist/assets/{login-BKaJnfFX.js → login-4Yq_pPSw.js} +1 -1
  116. package/dist/assets/{login-oauth-callback-LJsgXC8E.js → login-oauth-callback-DZaPZfnA.js} +1 -1
  117. package/dist/assets/{logo-uploader-BYnd80uu.js → logo-uploader-Cnkdgyfv.js} +3 -3
  118. package/dist/assets/{lost-passport-Bk0k4I4s.js → lost-passport-D5jMtgH_.js} +1 -1
  119. package/dist/assets/{open-window-DV0D-Mov.js → open-window--2G6Qjbq.js} +1 -1
  120. package/dist/assets/overview-CaQ-tV1t.js +85 -0
  121. package/dist/assets/{page-header-CpNMTtn_.js → page-header-xyZktwBS.js} +1 -1
  122. package/dist/assets/{passport-item-BxfGrDcE.js → passport-item-DH3_49G1.js} +1 -1
  123. package/dist/assets/{permission-BkNXA8B5.js → permission-BH1TY_tz.js} +1 -1
  124. package/dist/assets/{preferences-_jTjKHvU.js → preferences-CfmnTXfl.js} +1 -1
  125. package/dist/assets/{profile-embed-8w4_vg5a.js → profile-embed-ZtzRYgXv.js} +1 -1
  126. package/dist/assets/publish-resource-BtFRgv4P.js +1 -0
  127. package/dist/assets/{react-beautiful-dnd.esm-Cq_dOQ2z.js → react-beautiful-dnd.esm-7PS2VwOi.js} +1 -1
  128. package/dist/assets/runtime-B0207zk1.js +1 -0
  129. package/dist/assets/sdk-9eXJSWHG.js +1 -0
  130. package/dist/assets/section-Cv4udilp.js +41 -0
  131. package/dist/assets/{security-BQbSLSOe.js → security-CX01lhxW.js} +3 -3
  132. package/dist/assets/{session-6XaVDQaE.js → session-CHdTc1We.js} +1 -1
  133. package/dist/assets/{setup-CifjXQIf.js → setup-DIAgbS7c.js} +3 -3
  134. package/dist/assets/{shorten-label-Dq7bVuNa.js → shorten-label-Cng55547.js} +1 -1
  135. package/dist/assets/{simple-select-C-wGUGQR.js → simple-select-CP_Svi_D.js} +1 -1
  136. package/dist/assets/{slicedToArray-vWe02CJE.js → slicedToArray-C7EPqaHf.js} +1 -1
  137. package/dist/assets/{spaces-Cp7TgoZP.js → spaces-BVG-t3ND.js} +1 -1
  138. package/dist/assets/{start-CHmWCQE9.js → start-CMRQU8Px.js} +1 -1
  139. package/dist/assets/{starting-progress-CdpkXOrK.js → starting-progress-CiLZpNpg.js} +1 -1
  140. package/dist/assets/{status-46dMQnxA.js → status-DSQPLYSp.js} +1 -1
  141. package/dist/assets/{step-actions-Bu3Q5M4V.js → step-actions-BfGTFkaB.js} +1 -1
  142. package/dist/assets/{studio-BbeHx14I.js → studio-DikseKRr.js} +1 -1
  143. package/dist/assets/{switch-control-D6CqAlDY.js → switch-control-C5i52ixk.js} +1 -1
  144. package/dist/assets/{traffic-CY9Vj6w7.js → traffic-ClE631in.js} +2 -2
  145. package/dist/assets/{transfer-CSeo2FaW.js → transfer-BnR8fjLW.js} +1 -1
  146. package/dist/assets/{unsubscribe-BLaMmgbM.js → unsubscribe-rUE2LcLN.js} +1 -1
  147. package/dist/assets/{use-blocklet-logo-sEJnYyNL.js → use-blocklet-logo-Phq7jasP.js} +2 -2
  148. package/dist/assets/{use-mobile-BAjFH6d8.js → use-mobile-Boa_xu9A.js} +1 -1
  149. package/dist/assets/{use-mobile-Bh8CHBbH.js → use-mobile-DyX6Fl8Z.js} +1 -1
  150. package/dist/assets/{useLocalStorage-C6U1Aqya.js → useLocalStorage-DVnkpneF.js} +1 -1
  151. package/dist/assets/user-center-D25Vw-wP.js +76 -0
  152. package/dist/assets/{util-RWes6RwK.js → util-Btd7aQEC.js} +1 -1
  153. package/dist/assets/{util-Bg0WSJ-t.js → util-CEAObyfj.js} +1 -1
  154. package/dist/assets/{vendor-arcblock-CN2B_oTr.js → vendor-arcblock-uz9DVywv.js} +45 -45
  155. package/dist/assets/{vendor-mui-core-UZpb7wT7.js → vendor-mui-core-D_bnq77o.js} +1 -1
  156. package/dist/assets/{vendor-mui-x-whuSO90H.js → vendor-mui-x-R-0SFz4c.js} +1 -1
  157. package/dist/assets/{vendor-ux-did-connect-TEE6cGq6.js → vendor-ux-did-connect-DHrruicZ.js} +136 -136
  158. package/dist/assets/{wrap-locale-DZ79GW_G.js → wrap-locale-CPW6a0PM.js} +1 -1
  159. package/dist/index.html +4 -4
  160. package/dist/service-worker.js +1 -1
  161. package/dist/share/shared-bridge.html +4 -4
  162. package/package.json +32 -32
  163. package/dist/assets/audit-logs-CtFZQHby.js +0 -35
  164. package/dist/assets/button-DotKXyjc.js +0 -1
  165. package/dist/assets/click-to-copy-BxhgzyYL.js +0 -1
  166. package/dist/assets/dashboard-C124DXmc.js +0 -279
  167. package/dist/assets/domains-BxkmGeZE.js +0 -1
  168. package/dist/assets/get-safe-url-2RcRY8gU.js +0 -1
  169. package/dist/assets/get-safe-url-CEvgWyL5.js +0 -1
  170. package/dist/assets/index-9ixwCOkw.js +0 -113
  171. package/dist/assets/index-B_fwtN9z.js +0 -55
  172. package/dist/assets/index-CyUXddLG.js +0 -284
  173. package/dist/assets/index-DsT9i24r.js +0 -141
  174. package/dist/assets/list-D1dIr8Je.js +0 -2
  175. package/dist/assets/list-TP-VNuzL.js +0 -236
  176. package/dist/assets/localization-BXLZxF1J.js +0 -1
  177. package/dist/assets/overview-UIMGVO1S.js +0 -85
  178. package/dist/assets/publish-resource-CcM3RwPR.js +0 -1
  179. package/dist/assets/relative-time-Cl7lOTkO.js +0 -1
  180. package/dist/assets/runtime-BVDdcpyT.js +0 -1
  181. package/dist/assets/sdk-7yPC_DtN.js +0 -1
  182. package/dist/assets/user-center-BHyd-rRF.js +0 -76
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BVU8_1Ed.js","assets/vendor-ux-did-connect-TEE6cGq6.js","assets/vendor-react-DEoibe3W.js","assets/vendor-utils-rHXShPKm.js","assets/vendor-mui-core-UZpb7wT7.js","assets/vendor-hooks-rDgu5KV9.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/vendor-arcblock-CN2B_oTr.js","assets/index-Bs1kxR8_.js","assets/index-u-w3iMC9.js","assets/index-DOq-_YXu.css","assets/index-DVQCgvFb.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
2
- import{r as U,b as fe}from"./vendor-react-DEoibe3W.js";import{u as E,d as V,j as H,_ as $,Z as re,X as B,b4 as Ue,a7 as be}from"./vendor-ux-did-connect-TEE6cGq6.js";import{H as n,j as e,D as K,aj as G,I as X,t as Z,al as N,T as k,aa as u,O as T,br as C,bL as ve,bR as le,bt as ne,bS as se,X as J,ak as oe,z as ae,y as L,ab as Q,ad as Ce}from"./vendor-mui-core-UZpb7wT7.js";import{M as ce,_ as ye}from"./vendor-arcblock-CN2B_oTr.js";import{d as we}from"./Edit-BLsIdIOp.js";import{_ as Te}from"./dot-C05enzim.js";import{l as de}from"./index-CHDiquXf.js";import{z as F,E as ue,F as S,C as Se}from"./index-u-w3iMC9.js";import{u as _}from"./dashboard-C124DXmc.js";import{o as ke,c as Ie,A as ie}from"./vendor-utils-rHXShPKm.js";import{E as Re}from"./empty-spinner-BZlBh4vA.js";import{C as v}from"./click-to-copy-BxhgzyYL.js";import{D as qe}from"./delete-confirm-BBaXcAXg.js";import{b as Ae}from"./passport-item-BxfGrDcE.js";import{A as Oe}from"./actions-BCWb2ez1.js";import"./vendor-hooks-rDgu5KV9.js";import"./lottie-web-jYmAQWuC.js";import"./useAsync-DV3NyLhI.js";import"./useLocalStorage-C6U1Aqya.js";import"./confirm-BvUfAlkx.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-C9IFmc-j.js";import"./get-safe-url-2RcRY8gU.js";import"./session-6XaVDQaE.js";import"./use-blocklet-logo-sEJnYyNL.js";import"./InfoOutlined-Dy7jTc7H.js";import"./collapse-Bn_BDlF9.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-Bh8CHBbH.js";import"./index-Ce2NSVmU.js";import"./Phone-CoX1qzAs.js";import"./Location-C__VfR4D.js";import"./Email-DOy8vL0N.js";import"./Timezone-CCdgxxpv.js";import"./did-address-BKBBjFqv.js";import"./util-Bg0WSJ-t.js";import"./base32-BbrXtXL6.js";import"./MoreHoriz-BxJelL2A.js";const Pe={clientName:"",clientUri:"",redirectUris:"",scope:["profile:read"],contacts:"",tosUri:"",policyUri:""};function pe({onCreated:r,onClose:d}){const[i,j]=U.useState(!1),{t:l}=E(),{api:s}=F(),{teamDid:b}=_(),{control:p,handleSubmit:R,formState:{errors:h},watch:x,setValue:y}=ue({defaultValues:Pe,mode:"onChange"}),m=x("scope"),I=a=>{a!=="profile:read"&&y("scope",m.includes(a)?m.filter(c=>c!==a):[...m,a])},q=async a=>{j(!0);try{const c={...a,redirectUris:a.redirectUris,contacts:a.contacts?a.contacts.split(",").map(A=>A.trim()):[],scope:a.scope.join(" ")};await s.createOAuthClient({input:{teamDid:b,input:ke(c,Ie)}}),r(c)}catch(c){$.error(c.message||"Failed to create OAuth App")}finally{j(!1)}};return e.jsxs(K,{open:!0,onClose:d,maxWidth:"md",fullWidth:!0,children:[e.jsxs(G,{children:[l("oauth.client.register")," ",e.jsx(X,{onClick:d,sx:{position:"absolute",right:8,top:8},children:e.jsx(V,{})})]}),e.jsx(Z,{children:e.jsxs(N,{spacing:4,sx:{mt:2},children:[e.jsx(k,{variant:"h6",gutterBottom:!0,children:l("oauth.client.requiredInformation")}),e.jsx(u,{children:e.jsx(S,{name:"clientName",control:p,rules:{required:l("oauth.client.validate.clientName"),minLength:{value:3,message:l("oauth.client.validate.clientNameMinLength")}},render:({field:a})=>{var c;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...a,label:l("oauth.client.name"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientNamePlaceholder"),error:!!h.clientName,helperText:(c=h.clientName)==null?void 0:c.message}),e.jsx(C,{children:l("oauth.client.helperText.clientName")})]})}})}),e.jsx(u,{children:e.jsx(S,{name:"clientUri",control:p,rules:{required:l("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.clientUriInvalid")}},render:({field:a})=>{var c;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...a,label:l("oauth.client.input.clientUri"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.clientUriPlaceholder"),error:!!h.clientUri,helperText:(c=h.clientUri)==null?void 0:c.message}),e.jsx(C,{children:l("oauth.client.helperText.clientUri")})]})}})}),e.jsx(u,{children:e.jsx(S,{name:"redirectUris",control:p,rules:{required:l("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:l("oauth.client.validate.redirectUrisInvalid")}},render:({field:a})=>{var c;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...a,label:l("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,placeholder:l("oauth.client.input.redirectUrisPlaceholder"),error:!!h.redirectUris,helperText:(c=h.redirectUris)==null?void 0:c.message}),e.jsxs(u,{sx:{display:"flex",gap:"2px"},children:[e.jsx(C,{children:l("oauth.client.helperText.redirectUris")}),e.jsx(C,{children:l("oauth.client.helperText.read")}),e.jsx(C,{sx:{color:"info.main"},component:"a",href:"https://www.arcblock.io/docs/blocklet-developer/en/oauth-service",target:"_blank",rel:"noopener noreferrer",children:l("oauth.client.helperText.document")}),e.jsx(C,{children:l("oauth.client.helperText.more")})]})]})}})}),e.jsxs(ve,{variant:"outlined",sx:{p:2,display:"none"},children:[e.jsx(k,{variant:"subtitle2",gutterBottom:!0,children:l("oauth.client.input.permissions")}),e.jsx(u,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(H.OAUTH_SCOPES).map(([a,c])=>e.jsx(ne,{control:e.jsx(se,{checked:m.includes(a),onChange:()=>I(a),disabled:a==="profile:read",color:"primary"}),label:e.jsx(u,{children:e.jsx(k,{variant:"body2",sx:{fontWeight:500},children:c})})},a))})})]}),e.jsx(J,{}),e.jsx(k,{variant:"h6",gutterBottom:!0,children:l("oauth.client.optionalInformation")}),e.jsx(N,{children:e.jsx(S,{name:"contacts",control:p,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:l("oauth.client.validate.contacts")}},render:({field:a})=>{var c;return e.jsxs(e.Fragment,{children:[e.jsx(T,{size:"small",...a,label:l("oauth.client.input.contacts"),fullWidth:!0,placeholder:l("oauth.client.input.contactsPlaceholder"),error:!!h.contacts,helperText:(c=h.contacts)==null?void 0:c.message}),e.jsx(C,{children:l("oauth.client.helperText.contacts")})]})}})}),e.jsxs(N,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:p,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.tosUriInvalid")}},render:({field:a})=>{var c;return e.jsxs(u,{sx:{width:"50%"},children:[e.jsx(T,{size:"small",...a,label:l("oauth.client.input.tosUri"),fullWidth:!0,placeholder:l("oauth.client.input.tosUriPlaceholder"),error:!!h.tosUri,helperText:(c=h.tosUri)==null?void 0:c.message}),e.jsx(C,{children:l("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:p,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:l("oauth.client.validate.policyUriInvalid")}},render:({field:a})=>{var c;return e.jsxs(u,{sx:{width:"50%"},children:[e.jsx(T,{size:"small",...a,label:l("oauth.client.input.policyUri"),fullWidth:!0,placeholder:l("oauth.client.input.policyUriPlaceholder"),error:!!h.policyUri,helperText:(c=h.policyUri)==null?void 0:c.message}),e.jsx(C,{children:l("oauth.client.helperText.policyUri")})]})}})]}),h.error&&e.jsx(oe,{severity:"error",children:h.error.message})]})}),e.jsxs(ae,{children:[e.jsx(L,{onClick:d,children:l("common.cancel")}),e.jsxs(L,{onClick:R(q),disabled:i,variant:"contained",color:"primary",children:[i?e.jsx(Q,{size:20,sx:{mr:1}}):null,l("oauth.client.registerButton")]})]})]})}pe.propTypes={onCreated:n.func.isRequired,onClose:n.func.isRequired};function M({scope:r,...d}){if(!r)return null;const i=r.split(" ").filter(Boolean);return e.jsx(N,{direction:"row",flexWrap:"wrap",gap:1,...d,children:i.map(j=>e.jsx(fe.Fragment,{children:e.jsx(Ce,{title:H.OAUTH_SCOPES[j],children:e.jsx(v,{children:j})})},j))})}M.propTypes={scope:n.string};M.defaultProps={scope:""};const Y=r=>{const{prefix:d}=F(),{blocklet:i}=Se(),j=ie(d,"/api/media/upload",i.appPid),l=U.useCallback(b=>b?b.startsWith("http")?b:`${ie(d,"/api/media/upload",i.appPid)}/${b}`:"",[d,i.appPid]);return{clientLogoUrl:U.useMemo(()=>l(r),[r,l]),apiPath:j,getClientLogoUrl:l}},Ne=U.lazy(()=>ye(()=>import("./index-BVU8_1Ed.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(r=>({default:r.Uploader})));function he({client:r,onUpdate:d,onClose:i}){const[j,l]=U.useState(!1),{t:s,locale:b}=E(),p=U.useRef(null),{api:R}=F(),{teamDid:h}=_(),{control:x,handleSubmit:y,formState:{errors:m},watch:I,setValue:q,getValues:a}=ue({defaultValues:{clientName:r.clientName||"",clientUri:r.clientUri||"",redirectUris:Array.isArray(r.redirectUris)?r.redirectUris.join(","):"",scope:r.scope?r.scope.split(" "):["profile:read"],contacts:Array.isArray(r.contacts)?r.contacts.join(","):"",tosUri:r.tosUri||"",policyUri:r.policyUri||"",logoUri:r.logoUri||""},mode:"onChange"}),c=I("scope"),A=I("logoUri"),{clientLogoUrl:w,apiPath:z}=Y(A),D=t=>{t!=="profile:read"&&q("scope",c.includes(t)?c.filter(o=>o!==t):[...c,t])},P=async t=>{const o={clientId:r.clientId,clientName:t.clientName.trim(),clientUri:t.clientUri,redirectUris:t.redirectUris.split(",").map(g=>g.trim()).filter(Boolean),contacts:t.contacts?t.contacts.split(",").map(g=>g.trim()):[],scope:t.scope.join(" "),tosUri:t.tosUri,policyUri:t.policyUri,logoUri:t.logoUri};await R.updateOAuthClient({input:{teamDid:h,input:o}})},f=async t=>{l(!0);try{await P(t),d(),i()}catch(o){$.error(o.message||s("oauth.client.updateFailed"))}finally{l(!1)}};return e.jsxs(K,{open:!0,onClose:i,maxWidth:"md",fullWidth:!0,children:[e.jsxs(G,{children:[s("oauth.client.update")," ",e.jsx(X,{onClick:i,sx:{position:"absolute",right:8,top:8},children:e.jsx(V,{})})]}),e.jsx(Z,{children:e.jsxs(N,{spacing:3,sx:{mt:2},children:[e.jsxs(u,{sx:{mb:3},children:[e.jsx(k,{variant:"subtitle1",sx:{fontWeight:500,mb:1},children:s("oauth.client.logo")}),e.jsxs(u,{children:[e.jsx(u,{sx:{width:120,height:120,position:"relative",borderRadius:"4px",overflow:"hidden"},children:w?e.jsx(u,{children:e.jsx("img",{src:w,alt:"client-logo",style:{width:"100%",height:"100%"}})}):e.jsx(u,{onClick:()=>{var t;(t=p.current)==null||t.open()},sx:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.200"},children:e.jsx(ce,{sx:{fontSize:40,color:"common.white"}})})}),e.jsx(L,{sx:{mt:2},variant:"outlined",size:"small",onClick:()=>{var t;(t=p.current)==null||t.open()},children:s(w?"common.change":"common.upload")})]}),e.jsx(u,{sx:{display:"flex",alignItems:"center"},children:e.jsx(U.Suspense,{fallback:e.jsx(Re,{}),children:e.jsx(Ne,{ref:p,locale:b,popup:!0,onUploadFinish:t=>{q("logoUri",t.data.filename),P(a()).then(()=>{d()}).catch(o=>{$.error(o.message||s("oauth.client.updateFailed"))}).finally(()=>{var o;(o=p.current)==null||o.close()})},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:z,disableMediaKitPrefix:!0,disableAutoPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo")})})]}),e.jsx(k,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.requiredInformation")}),e.jsx(T,{label:"Client Id",fullWidth:!0,value:r.clientId,disabled:!0}),e.jsx(u,{children:e.jsx(S,{name:"clientName",control:x,rules:{required:s("oauth.client.validate.clientName"),minLength:{value:3,message:s("oauth.client.validate.clientNameMinLength")}},render:({field:t})=>{var o;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...t,label:s("oauth.client.name"),required:!0,fullWidth:!0,error:!!m.clientName,helperText:(o=m.clientName)==null?void 0:o.message}),e.jsx(C,{children:s("oauth.client.helperText.clientName")})]})}})}),e.jsx(u,{children:e.jsx(S,{name:"clientUri",control:x,rules:{required:s("oauth.client.validate.clientUri"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.clientUriInvalid")}},render:({field:t})=>{var o;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...t,label:s("oauth.client.input.clientUri"),required:!0,fullWidth:!0,error:!!m.clientUri,helperText:(o=m.clientUri)==null?void 0:o.message}),e.jsx(C,{children:s("oauth.client.helperText.clientUri")})]})}})}),e.jsx(u,{children:e.jsx(S,{name:"redirectUris",control:x,rules:{required:s("oauth.client.validate.redirectUris"),pattern:{value:/^https?:\/\/.+/,message:s("oauth.client.validate.redirectUrisInvalid")}},render:({field:t})=>{var o;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...t,label:s("oauth.client.input.redirectUris"),required:!0,fullWidth:!0,multiline:!0,rows:2,error:!!m.redirectUris,helperText:(o=m.redirectUris)==null?void 0:o.message}),e.jsx(C,{children:s("oauth.client.helperText.redirectUris")})]})}})}),e.jsxs(u,{sx:{display:"none"},children:[e.jsx(k,{variant:"subtitle2",sx:{mb:1},children:s("oauth.client.input.permissions")}),e.jsx(u,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2},children:e.jsx(le,{children:Object.entries(H.OAUTH_SCOPES).map(([t,o])=>e.jsx(ne,{control:e.jsx(se,{checked:c.includes(t),onChange:()=>D(t),disabled:t==="profile:read",color:"primary"}),label:e.jsx(u,{children:e.jsx(k,{variant:"body2",sx:{fontWeight:500},children:o})})},t))})})]}),e.jsx(J,{}),e.jsx(k,{variant:"subtitle1",sx:{fontWeight:500},children:s("oauth.client.optionalInformation")}),e.jsx(u,{children:e.jsx(S,{name:"contacts",control:x,rules:{pattern:{value:/^$|^[^@\s]+@[^@\s]+\.[^@\s]+(\s*,\s*[^@\s]+@[^@\s]+\.[^@\s]+)*$/,message:s("oauth.client.validate.contacts")}},render:({field:t})=>{var o;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...t,label:s("oauth.client.input.contacts"),fullWidth:!0,error:!!m.contacts,helperText:(o=m.contacts)==null?void 0:o.message}),e.jsx(C,{children:s("oauth.client.helperText.contacts")})]})}})}),e.jsxs(N,{direction:{xs:"column",sm:"row"},spacing:2,children:[e.jsx(S,{name:"tosUri",control:x,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.tosUriInvalid")}},render:({field:t})=>{var o;return e.jsxs(u,{sx:{width:"50%"},children:[e.jsx(T,{...t,label:s("oauth.client.input.tosUri"),fullWidth:!0,error:!!m.tosUri,helperText:(o=m.tosUri)==null?void 0:o.message}),e.jsx(C,{children:s("oauth.client.helperText.tosUri")})]})}}),e.jsx(S,{name:"policyUri",control:x,rules:{pattern:{value:/^$|^https?:\/\/.+/,message:s("oauth.client.validate.policyUriInvalid")}},render:({field:t})=>{var o;return e.jsxs(u,{sx:{width:"50%"},children:[e.jsx(T,{...t,label:s("oauth.client.input.policyUri"),fullWidth:!0,error:!!m.policyUri,helperText:(o=m.policyUri)==null?void 0:o.message}),e.jsx(C,{children:s("oauth.client.helperText.policyUri")})]})}})]}),m.error&&e.jsx(oe,{severity:"error",children:m.error.message})]})}),e.jsxs(ae,{children:[e.jsx(L,{onClick:i,children:s("common.cancel")}),e.jsx(L,{onClick:y(f),disabled:j,variant:"contained",color:"primary",children:j?e.jsx(Q,{size:16}):s("common.update")})]})]})}he.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function me({client:r,onUpdate:d,onClose:i}){return e.jsx(he,{client:r,onUpdate:j=>d(j),onClose:i})}me.propTypes={client:n.shape({clientId:n.string.isRequired,clientName:n.string.isRequired,clientUri:n.string,redirectUris:n.arrayOf(n.string),scope:n.string,contacts:n.arrayOf(n.string),tosUri:n.string,policyUri:n.string,logoUri:n.string}).isRequired,onUpdate:n.func.isRequired,onClose:n.func.isRequired};function ee(r){const{t:d}=E(),{api:i}=F(),{teamDid:j}=_(),{clientId:l,clientName:s,onDelete:b=()=>{},onClose:p=()=>{}}=r,R=()=>{p()},h=async()=>{try{await i.deleteOAuthClient({input:{teamDid:j,clientId:l}}),b()}catch(y){$.error(y==null?void 0:y.message)}finally{R()}},x={keyName:s,title:d("oauth.client.delete.title"),description:d("oauth.client.delete.description",{name:`<b>${s}</b>`}),confirmPlaceholder:d("oauth.client.delete.description",{name:s}),confirm:d("common.delConfirm"),cancel:d("common.cancel"),onConfirm:h,onCancel:R};return e.jsx(qe,{keyName:x.keyName,title:x.title,description:x.description,confirmPlaceholder:x.confirmPlaceholder,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})}ee.propTypes={clientId:n.string.isRequired,clientName:n.string.isRequired,onDelete:n.func,onClose:n.func};ee.defaultProps={onDelete:()=>{},onClose:()=>{}};function xe({title:r,items:d}){return e.jsxs(u,{mb:3,children:[e.jsx(k,{variant:"h6",sx:{mb:1.5},children:r}),e.jsx(N,{spacing:1.5,children:d.map(({label:i,value:j})=>e.jsxs(u,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(k,{variant:"subtitle2",color:"textSecondary",sx:{minWidth:200},children:i}),e.jsx(k,{sx:{wordBreak:"break-all"},children:j||"-"})]},i))})]})}xe.propTypes={title:n.string.isRequired,items:n.arrayOf(n.shape({label:n.string.isRequired,value:n.any})).isRequired};function je({client:r,onClose:d}){const{t:i}=E(),{teamDid:j}=_(),{clientName:l,clientId:s,clientSecret:b,redirectUris:p,scope:R,clientUri:h,logoUri:x,contacts:y,tosUri:m,policyUri:I,jwksUri:q,jwks:a,softwareId:c,softwareVersion:A,clientIdIssuedAt:w,clientSecretExpiresAt:z,updatedAt:D,createUser:P}=r,{clientLogoUrl:f}=Y(x),t=O=>{try{const W=new URL(window.blocklet.appUrl);return W.pathname=O,W.toString()}catch{return"-"}},o=de.fromAppDid(s,j),g=[{title:i("common.baseInfo"),items:[{label:i("oauth.client.name"),value:l},{label:i("oauth.client.logoUri"),value:e.jsx(re,{variant:"rounded",shape:"square",src:f,did:o.address,size:64})},{label:i("oauth.client.clientUri"),value:h?e.jsx(v,{children:h}):"-"},{label:i("oauth.client.clientId"),value:e.jsx(v,{children:s})},{label:i("oauth.client.clientSecret"),value:e.jsx(v,{children:b})},{label:i("oauth.client.redirectUris"),value:e.jsx(v,{children:(p||[]).join(", ")})},{label:i("oauth.client.scope"),value:e.jsx(M,{scope:R})},{label:i("oauth.client.createUser"),value:P?Ae(P,!0):i("oauth.client.openRegistration")}]},{title:i("oauth.client.oauthEndpoints"),items:[{label:i("oauth.client.openidConfiguration"),value:e.jsx(v,{children:t("/.well-known/openid-configuration")})},{label:i("oauth.client.authorizationEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/authorize")})},{label:i("oauth.client.tokenEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/token")})},{label:i("oauth.client.userinfoEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/userinfo")})},{label:i("oauth.client.jwksUri"),value:e.jsx(v,{children:t("/.well-known/service/oauth/jwks")})},{label:i("oauth.client.registrationEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/register")})},{label:i("oauth.client.endSessionEndpoint"),value:e.jsx(v,{children:t("/.well-known/service/oauth/logout")})}]},{title:i("oauth.client.metaContact"),items:[{label:i("oauth.client.contacts"),value:y.length?e.jsx(v,{children:(y||[]).join(", ")}):"-"},{label:i("oauth.client.tosUri"),value:m?e.jsx(v,{children:m}):"-"},{label:i("oauth.client.policyUri"),value:I?e.jsx(v,{children:I}):"-"},{label:i("oauth.client.jwksUri"),value:q},{label:i("oauth.client.jwks"),value:a},{label:i("oauth.client.softwareId"),value:c},{label:i("oauth.client.softwareVersion"),value:A}]},{title:i("common.timeInfo"),items:[{label:i("oauth.client.clientIdIssuedAt"),value:w?e.jsx(B,{value:w*1e3}):"-"},{label:i("oauth.client.clientSecretExpiresAt"),value:z?e.jsx(B,{value:z*1e3}):"-"},{label:i("common.updatedAt"),value:D?e.jsx(B,{value:D}):"-"}]}].filter(Boolean);return e.jsxs(K,{open:!0,onClose:d,maxWidth:"lg",fullWidth:!0,children:[e.jsxs(G,{children:[i("oauth.client.oauthAppDetails"),e.jsx(X,{onClick:d,sx:{position:"absolute",right:8,top:8},children:e.jsx(V,{})})]}),e.jsx(Z,{children:e.jsx(u,{mt:1,children:g.map((O,W)=>e.jsxs(u,{children:[e.jsx(xe,{title:O.title,items:O.items}),W!==g.length-1&&e.jsx(J,{sx:{my:2}})]},O.title))})})]})}je.propTypes={client:n.object.isRequired,onClose:n.func.isRequired};function We(r){return e.jsx(B,{value:r*1e3})}function te({selected:r,onClose:d}){return r?e.jsx(je,{client:r,onClose:d}):null}te.propTypes={selected:n.object,onClose:n.func.isRequired};te.defaultProps={selected:null};function ge({open:r,onCreated:d,onClose:i}){return r?e.jsx(pe,{onCreated:d,onClose:i}):null}ge.propTypes={open:n.bool.isRequired,onCreated:n.func.isRequired,onClose:n.func.isRequired};function bt(){var P;const[r,d]=U.useState({searchText:"",pageSize:10,page:1}),[i,j]=U.useState(null),[l,s]=U.useState(!1),b=U.useRef(null),{t:p}=E(),{api:R}=F(),{teamDid:h}=_(),[x,y]=U.useState(null),[m,I]=U.useState(null),{getClientLogoUrl:q}=Y(),a=Te(async()=>await R.getOAuthClients({input:{teamDid:h,paging:{page:r.page,pageSize:r.pageSize}}}),[r.page,r.pageSize]),{loading:c}=a,A=U.useMemo(()=>{var f;return((f=a.value)==null?void 0:f.list)||[]},[(P=a.value)==null?void 0:P.list]),w=U.useMemo(()=>r.searchText?A.filter(f=>f.clientName.toLowerCase().includes(r.searchText.toLowerCase())||f.clientId.toLowerCase().includes(r.searchText.toLowerCase())||f.scope.toLowerCase().includes(r.searchText.toLowerCase())):A,[r.searchText,A]),z=U.useMemo(()=>[{label:p("oauth.client.name"),name:"clientName",options:{customBodyRender:(f,{rowIndex:t})=>{const o=w[t],g=q(o.logoUri),O=de.fromAppDid(o.clientId,h);return e.jsx(u,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(u,{display:"flex",alignItems:"center",gap:2,sx:{cursor:"pointer"},onClick:W=>{W.stopPropagation(),window.open(o.clientUri,"_blank")},children:[e.jsx(re,{variant:"rounded",shape:"square",did:O.address,src:g,size:48}),e.jsxs(N,{gap:.5,children:[e.jsx(u,{sx:{color:"text.primary"},children:o.clientName}),e.jsx(u,{sx:{color:"text.secondary"},children:o.clientUri})]})]})})}}},{label:p("oauth.client.clientId"),name:"clientId"},{label:p("oauth.client.scope"),name:"scope",options:{customBodyRender:f=>e.jsx(M,{scope:f})}},{label:p("common.createdAt"),name:"clientIdIssuedAt",options:{customBodyRender:We}},{label:p("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRender:(f,{rowIndex:t})=>{const o=w[t];return e.jsx(Oe,{actions:[{icon:e.jsx(we,{}),text:p("common.edit"),onClick:g=>{g.stopPropagation(),y(o)}},{icon:e.jsx(Ue,{}),text:p("common.delete"),onClick:g=>{g.stopPropagation(),I(o)}}]})}}}],[w,p,q,h,y,I]),D=({page:f,rowsPerPage:t,searchText:o})=>{r.pageSize!==t?d(g=>({...g,searchText:"",pageSize:t,page:1})):r.page!==f+1?d(g=>({...g,searchText:"",page:f+1})):r.searchText!==o&&d(g=>({...g,searchText:o,page:1}))};return e.jsxs(u,{ref:b,sx:{".custom-toobar-btns":{gap:"8px"}},children:[e.jsx(be,{data:w,columns:z,options:{sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,page:r.page-1,rowsPerPage:r.pageSize,count:w.length,searchDebounceTime:400,onRowClick(f,{dataIndex:t},o){var g;if((g=b.current)!=null&&g.contains(o.target)){const O=w[t];j(O)}}},onChange:D,customButtons:[e.jsxs(L,{variant:"contained",size:"small",onClick:()=>s(!0),children:[c?e.jsx(Q,{size:16}):e.jsx(ce,{style:{fontSize:16}}),p("common.create")]},"add")],loading:!1}),e.jsx(te,{selected:i,onClose:()=>j(null)}),e.jsx(ge,{open:l,onCreated:()=>{s(!1),a.retry()},onClose:()=>s(!1)}),x&&e.jsx(me,{client:x,onUpdate:a.retry,onClose:()=>y(null)}),m&&e.jsx(ee,{...m,onDelete:a.retry,onClose:()=>I(null)})]})}export{bt as default};
@@ -1,236 +0,0 @@
1
- import{r as p}from"./vendor-react-DEoibe3W.js";import{H as i,j as r,bd as Y,e as N,ap as se,aa as m,ah as E,T as A,v as W,X as ne,bL as Ce,ad as Je,bM as Ze,ar as et,ai as tt,a9 as Re,m as rt,c0 as st,y as nt,s as it,I as ot}from"./vendor-mui-core-UZpb7wT7.js";import{f as D,u as ee,l as at}from"./vendor-hooks-rDgu5KV9.js";import{h as lt,aJ as ct,j as Te,Y as ie,b2 as oe,b6 as dt,u as Ie,r as Se,I as Me,bj as ut}from"./vendor-ux-did-connect-TEE6cGq6.js";import{S as pt}from"./index-DjLLC6N3.js";import{B as ht}from"./bundle-avatar-Db5l8MQ4.js";import{b as mt,g as ae,d as le,c as B,s as G,H as ft,u as $e,M as Ae,e as Q,f as gt,m as xt,i as yt}from"./use-blocklet-logo-sEJnYyNL.js";import{R as Ne}from"./relative-time-Cl7lOTkO.js";import{A as U,ag as vt,z as Pe,b as _,a0 as bt}from"./vendor-utils-rHXShPKm.js";import{u as ze,p as jt,h as X,f as Le,w as wt}from"./vendor-arcblock-CN2B_oTr.js";import{d as kt}from"./InfoOutlined-Dy7jTc7H.js";import{d as Ct}from"./CheckCircle-Dvhgeo9j.js";import{U as Rt,C as Tt,I as It}from"./index-Ce2NSVmU.js";import{p as St}from"./util-Bg0WSJ-t.js";import{z as Mt}from"./index-u-w3iMC9.js";function ce({blocklet:e,style:t,size:n,...s}){const o=mt({blocklet:e,square:!0}),{variant:l}=s;return r.jsx(Y,{variant:l||"square",style:Object.assign({backgroundColor:"transparent",width:n,height:n,borderRadius:10},t),...s,children:r.jsx("img",{src:o,alt:"",style:{width:n}})})}ce.propTypes={blocklet:i.object.isRequired,style:i.object,size:i.oneOfType([i.number,i.string])};ce.defaultProps={style:{},size:40};function De({attachment:e}){const{data:t}=e,n=N();let s="";try{s=new URL(t.url).host}catch{s=t.url}return r.jsxs(se,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:o=>{o.customPreventRedirect=!0},children:[!!s&&r.jsx("span",{className:"url",children:s}),!!t.title&&r.jsx(m,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&r.jsx(m,{className:"description",style:{whiteSpace:"unset",color:n.palette.text.secondary},children:t.description}),!!t.image&&r.jsx("img",{src:ze.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})]})}De.propTypes={attachment:i.object.isRequired};function Ee({attachment:e}){const{data:t}=e;return r.jsx("img",{src:ze.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})}Ee.propTypes={attachment:i.object.isRequired};function _e({attachment:e,...t}){var c;const{data:n}=e,s=((c=n.color)==null?void 0:c.toLowerCase())||t.color,o=n.size||t.size,l=n.fontWeight||t.fontWeight||400;let a="14px";return o==="small"?a="12px":o==="normal"?a="14px":o==="big"?a="16px":o==="large"&&(a="18px"),r.jsx($t,{className:"title",style:{fontSize:a,color:s,whiteSpace:"unset",fontWeight:l},children:n.text})}_e.propTypes={attachment:i.object.isRequired};const $t=E.span`
2
- width: 100%;
3
- display: -webkit-box;
4
- -webkit-box-orient: vertical;
5
- -webkit-line-clamp: 2;
6
- overflow: hidden;
7
- text-overflow: ellipsis;
8
- white-space: normal;
9
- word-break: break-word;
10
- `,At=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},Nt=e=>e.every(t=>t.type==="text"),Pt=e=>e.every(t=>t.type==="image"),zt=e=>vt(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(n=>{var s,o,l;return(l=(o=(s=n==null?void 0:n.data)==null?void 0:s.text)==null?void 0:o.trim)==null?void 0:l.call(o)})),Lt=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(n=>n.type===t)},Dt=(e,t)=>{try{const n=lt.toTypeInfo(e);if(!(n.role!==void 0&&n.role!==ct.types.RoleType.ACCOUNT))return;const o=U(Te.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return Pe(o,{did:e,locale:t})}catch(n){console.error(n);return}},Et=(e,t)=>{var s;const n=(s=t==null?void 0:t.componentMountPoints)==null?void 0:s.find(o=>o.did===e);return n==null?void 0:n.mountPoint},_t=(e,t)=>{var o,l,a;if(!e)return null;if(((o=e.actions)==null?void 0:o.length)===1)return e.actions[0].link||null;const n=ae(e.activity),s=(n==null?void 0:n.metaLink)||(n==null?void 0:n.targetLink);if(s)return le(s)?s:U(t,s);if(((l=e.attachments)==null?void 0:l.length)===1){const c=e.attachments[0];if(c.type==="link")return((a=c.data)==null?void 0:a.url)||null}return null},te=e=>{const{receivers:t=[]}=e;return t.length?t.every(n=>n.read):!0};function Ht(e){const t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight,o=t.height,l=t.width;let a=0;t.top>=0&&t.bottom<=s?a=o:t.top<0&&t.bottom>0&&t.bottom<=s?a=t.bottom:t.top>=0&&t.top<s&&t.bottom>s?a=s-t.top:t.top<0&&t.bottom>s&&(a=s);let c=0;return t.left>=0&&t.right<=n?c=l:t.left<0&&t.right>0&&t.right<=n?c=t.right:t.left>=0&&t.left<n&&t.right>n?c=n-t.left:t.left<0&&t.right>n&&(c=n),a*c/(o*l)>=.5}const qt=e=>{if(!e)return[];const t=[],n=5,s=Array.from(e.querySelectorAll(".notification-row")),o=s.length;for(let l=0;l<o;l+=n){const a=s.slice(l,l+n);let c=!0;for(const u of a){const x=u.id;if(Ht(u))t.push(x);else{c=!1;break}}if(!c)break}return t},He=e=>{var n;const t=[];return e&&((n=e.items)!=null&&n.length?e.items.forEach(s=>{te(s)||t.push(s)}):te(e)||t.push(e)),t},Wt=(e,t)=>{let n=[];return t.length&&t.forEach(s=>{const o=e.get(s);o&&(n=n.concat(He(o)))}),n},H=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}});de.propTypes={locale:i.string,data:i.object.isRequired};de.defaultProps={locale:"en"};function de({locale:e="en",data:t}){const n={zh:"来自",en:"from"}[e]||"from",s={zh:"接收",en:"Received"}[e]||"Received",l=`https://${B.getUrlHost(t.chainHost)||B.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`,a=N(),c=a.palette.mode==="dark";let u=t.amount;t.decimal&&(u=t.amount/10**t.decimal);const x=D(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return r.jsx("a",{href:l,target:"_blank",rel:"noreferrer",onClick:y=>{y.customPreventRedirect=!0},children:r.jsxs(m,{display:"flex",flexDirection:"column",children:[r.jsxs(m,{sx:x,children:[r.jsx(A,{component:"div",sx:{fontWeight:700,color:a.palette.text.primary},children:s}),r.jsxs(A,{component:"div",align:"right",style:H(G.summaryStyle,c),flex:1,children:["+",u," ",t.symbol]})]}),r.jsxs(m,{sx:x,children:[r.jsx(A,{component:"div",style:H({...G.remarkStyle,fontSize:14},c),children:n}),r.jsx(m,{maxWidth:260,fontSize:14,children:r.jsx(ie,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}ue.propTypes={locale:i.string,data:i.object.isRequired};ue.defaultProps={locale:"en"};function ue({locale:e,data:t}){var y,b;const n={zh:"接收",en:"Received"}[e]||"Received",s={zh:"来自",en:"from"}[e]||"from",o=B.getUrlHost(t.chainHost)||B.getChainHost(t.chainId),l=t.did||((b=(y=t==null?void 0:t.credential)==null?void 0:y.issuer)==null?void 0:b.id)||"",a=`https://${o}/explorer/assets/${l}`,u=N().palette.mode==="dark",x=D(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return r.jsx(m,{sx:{pr:1},children:r.jsx("a",{href:a,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},onClick:j=>{j.customPreventRedirect=!0},rel:"noreferrer",children:r.jsxs(m,{display:"flex",flexDirection:"column",children:[r.jsxs(m,{sx:x,children:[r.jsx(A,{component:"div",sx:{fontWeight:700,color:"text.primary"},children:n}),r.jsx(A,{component:"div",align:"right",style:H(G.summaryStyle,u),children:"+1 Asset"})]}),l?r.jsxs(m,{sx:x,children:[r.jsx(A,{component:"div",style:H({...G.remarkStyle,fontSize:14},u),children:s}),r.jsx(m,{maxWidth:260,fontSize:14,children:r.jsx(ie,{did:l,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}qe.propTypes={data:i.object.isRequired,locale:i.string};function qe({data:e,locale:t="en"}){const s=N().palette.mode==="dark";return r.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},onClick:o=>{o.customPreventRedirect=!0},rel:"noreferrer",children:[r.jsx("img",{className:"image",src:e.logo,width:50,height:50,alt:""}),r.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[r.jsx("div",{style:H({marginBottom:"6px"},s),children:e.title}),r.jsx(m,{maxWidth:260,fontSize:10,children:r.jsx(ie,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}pe.propTypes={locale:i.string,data:i.object.isRequired};pe.defaultProps={locale:"en"};function pe({locale:e,data:t}){const n=B.getChainHost(t.chainId),s=`https://${n}/explorer/txs/${t.hash}`,o={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",l={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash",a=N(),c=a.palette.mode==="dark";return r.jsxs("a",{href:s,target:"_blank",style:H({textDecoration:"none",color:"initial",display:"block",fontSize:14},c),onClick:u=>{u.customPreventRedirect=!0},rel:"noreferrer",children:[r.jsx("h6",{style:{color:a.palette.text.secondary,margin:0},children:n}),r.jsx("p",{style:{color:a.palette.warning.main,margin:0},children:o}),r.jsxs("div",{style:{wordBreak:"break-all"},children:[l,": ",t.hash]})]})}function We({attachment:e,...t}){const{local:n}=p.useContext(oe),s=W(l=>l.breakpoints.down("md")),o=N();return r.jsxs(Bt,{...t,isMd:s,children:[e.type==="link"&&r.jsx(De,{attachment:e,...t,isMd:s}),e.type==="image"&&r.jsx(Ee,{attachment:e,isMd:s}),e.type==="text"&&r.jsx(_e,{attachment:e,isMd:s}),e.type==="token"&&r.jsx(de,{data:e.data,local:n,isMd:s}),e.type==="asset"||e.type==="vc"?r.jsx(ue,{data:e.data,local:n,isMd:s}):null,e.type==="dapp"&&r.jsx(qe,{data:e.data,local:n,isMd:s}),e.type==="transaction"&&r.jsx(pe,{data:e.data,local:n,...t,isMd:s}),e.type==="divider"&&r.jsx(ne,{sx:{mb:1,mt:1},style:{color:o.palette.divider}})]})}const Bt=E.div`
11
- display: ${({sx:e={}})=>e.display||"flex"};
12
- flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
13
- gap: ${({sx:e={}})=>e.gap||1};
14
- width: ${({isMd:e=!1})=>e?"100%":"auto"};
15
- &:last-child {
16
- margin-bottom: 0;
17
- }
18
- `;We.propTypes={attachment:i.object.isRequired};function Be({data:e,...t}){const{items:n}=e;return r.jsx(Ut,{...t,children:n.map(s=>r.jsxs(Ce,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128},children:[r.jsxs(m,{display:"flex",alignItems:"center",gap:1,children:[s.icon?r.jsx("img",{src:s.icon,alt:s.title,style:{width:16,height:16}}):null,r.jsxs(m,{className:"metric-name",display:"flex",alignItems:"center",children:[s.title,s.subtitle?r.jsx(Je,{title:s.subtitle,arrow:!0,placement:"top",children:r.jsx(kt,{fontSize:"small",sx:{fontSize:14,ml:.5}})}):null]})]}),r.jsxs(m,{className:"metric-number",sx:{color:s.content_color||"rgba(3, 7, 18, 1)"},children:[s.content,s.sub_content?r.jsxs("span",{className:"sub-content",style:{color:s.sub_content_color||"rgba(156, 163, 175, 1)"},children:["(",s.sub_content,")"]}):null]})]},s.title))})}const Ut=E(m)`
19
- display: flex;
20
- justify-content: flex-start;
21
- flex-wrap: wrap;
22
- gap: 16px;
23
- .metric-number {
24
- font-size: 18px;
25
- font-weight: 600;
26
- .sub-content {
27
- font-size: 12px;
28
- font-weight: 400;
29
- margin-left: 4px;
30
- }
31
- }
32
- .metric-name {
33
- font-size: 14px;
34
- color: rgba(156, 163, 175, 1);
35
- }
36
- `;Be.propTypes={data:i.object.isRequired};function Ue({data:e}){const{items:t}=e,n=W(a=>a.breakpoints.down("sm")),s=W(a=>a.breakpoints.down("md")),o=W(a=>a.breakpoints.down("lg")),l=()=>n?1:s?3:o?4:6;return r.jsx(Ze,{variant:"quilted",cols:l(),gap:8,rowHeight:128,sx:{margin:0},children:t.map(a=>{const c=a.cover||a.display;return c?r.jsx("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:r.jsx(et,{children:r.jsx("img",{src:c,alt:a.title||"",style:{borderRadius:"8px"}})})},c):null})})}Ue.propTypes={data:i.object.isRequired};function he({data:e,feedType:t,...n}){return r.jsxs(Ot,{...n,children:[t==="data-tracker"&&e.type==="table"&&r.jsx(Be,{data:e}),(t==="graphic"||t==="gallery")&&r.jsx(Ue,{data:e})]})}const Ot=E.div`
37
- display: flex;
38
- flex-direction: column;
39
- width: 100%;
40
- margin-bottom: 4px;
41
- &:last-child {
42
- margin-bottom: 0;
43
- }
44
- `;he.propTypes={data:i.object.isRequired,feedType:i.string};he.defaultProps={feedType:"data-tracker"};F.propTypes={data:i.object.isRequired,style:i.object};function F({data:e,style:t={}}){const s=N().palette.mode==="dark";return r.jsx(A,{style:H({color:s&&e.darkModeColor?e.darkModeColor:e.color||"initial",margin:0,whiteSpace:"pre-line!important",...t},s),children:e.text})}function Oe({data:e}){const t=[];for(let n=0;n<(e==null?void 0:e.length);n+=2){const s=e[n],o=e[n+1];s&&o?t.push(r.jsxs(je,{children:[r.jsx("td",{className:"label-col",children:r.jsx(F,{data:s.data,style:{whiteSpace:"nowrap"}})}),r.jsx("td",{className:"value-col",children:r.jsx(F,{data:o.data,style:{wordBreak:"break-all"}})})]},n)):s&&t.push(r.jsx(je,{children:r.jsx("td",{className:"label-col",children:r.jsx(F,{data:s.data})})},n))}return r.jsx("table",{style:{width:"100%"},children:r.jsx("tbody",{children:t})})}Oe.propTypes={data:i.array.isRequired};const je=E.tr`
45
- display: flex;
46
- flex-direction: row;
47
- justify-content: flex-start;
48
- align-items: center;
49
- gap: ${({theme:e})=>e.spacing(1)};
50
- .label-col {
51
- min-width: 130px;
52
- flex-shrink: 0;
53
- }
54
- .value-col {
55
- flex: 1;
56
- }
57
- `;function me({notification:e,severity:t,showSke:n=!0}){const{attachments:s,data:o,...l}=e,a=W(y=>y.breakpoints.down("md"));if((!s||!s.length)&&_(o))return null;const c=At(t),u=(y,b=!1)=>{if(!y&&!Array.isArray(y))return null;let j=y,C={},R="horizontal";b&&Nt(y)&&(j=zt(y),R="vertical",C={display:"flex",gap:8,flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",height:"100%",width:a||j.length===1?"100%":"28%"});const d=Lt(j);return r.jsx(m,{sx:{width:"100%",display:"flex",gap:1,flexDirection:b?"row":"column",justifyContent:"flex-start",alignItems:b?"center":"unset",flexWrap:"wrap"},children:j.map((h,g)=>h.type==="section"?r.jsx(Oe,{data:h.fields},g):r.jsxs(p.Fragment,{children:[r.jsx(We,{attachment:h,style:C,...l}),!(a&&R==="vertical")&&d&&j.length>1&&g!==j.length-1?r.jsx(ne,{orientation:R,style:{color:dt.dividerColor},sx:R==="vertical"?{ml:2,mr:2,height:32}:{}}):null]},g))})},x=Pt(s);return r.jsx(Ft,{children:r.jsxs("div",{className:"message-in-list",children:[s.length>0&&r.jsx("div",{className:"message-container",style:a?{width:"100%"}:{},children:x?u(s):r.jsx(Ce,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128,borderColor:c},children:u(s)})}),!_(o)&&r.jsx("div",{className:"message-container",children:r.jsx("div",{className:"data-container",children:r.jsx(he,{data:o,feedType:e.feedType})})}),s.length===0&&_(o)&&n&&r.jsx(tt,{className:"attach-ske",style:{marginTop:10},variant:"rectangular",height:150})]})})}const Ft=E.div`
58
- display: flex;
59
- flex-direction: column;
60
- .message-in-list {
61
- padding: 8px 8px 8px 0;
62
- display: flex;
63
- border-radius: 8px;
64
- }
65
- .message-title {
66
- color: #25292f;
67
- font-size: 18px;
68
- font-weight: bold;
69
- word-break: break-all;
70
- }
71
-
72
- .attach-ske {
73
- position: relative;
74
- margin-left: 10px;
75
- &::after {
76
- content: '';
77
- position: absolute;
78
- left: -10px;
79
- top: 0;
80
- height: 100%;
81
- width: 4px;
82
- background-color: ${e=>e.leftLineColor};
83
- }
84
- }
85
-
86
- .message-body {
87
- color: #25292f;
88
- font-size: 16px;
89
- word-break: break-all;
90
- white-space: pre-line;
91
- }
92
- .message-container {
93
- display: flex;
94
- flex-direction: column;
95
- justify-content: flex-start;
96
- .data-container,
97
- .attachment-container {
98
- display: flex;
99
- flex-direction: column;
100
- width: 100%;
101
- }
102
- }
103
- .actions-container {
104
- margin-top: 10px;
105
- .actions-item {
106
- margin-right: 8px;
107
- }
108
- }
109
- `;me.propTypes={severity:i.string.isRequired,notification:i.object.isRequired,showSke:i.bool};me.defaultProps={showSke:!0};const Z=e=>jt.sanitize(e,{ALLOWED_ATTR:["href","target","rel","class","id","style"]}),Vt=async(e,t)=>{const{type:n,did:s}=e;return Le.isSameAddr(n,"did")?await Dt(s,t)||X.getLink(e):X.getLink(e)},Gt=async(e,t,n=!0)=>{const s=X.toTextList(e);return await Promise.all(s.map(async l=>{if(l instanceof X.Link){if(n){const a=await Vt(l,t),{type:c,chainId:u,did:x}=l;return Le.isSameAddr(c,"dapp")?`<em style="font-weight:bold;" data-type="${c}" data-chain-id="${u}" data-did="${x}">${l.text}</em>`:a?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${a}">${l.text}</a>`:`<em style="font-weight:bold;" data-type="${c}" data-chain-id="${u}" data-did="${x}">${l.text}</em>`}return l.text}return l})).then(l=>l.join(""))};Fe.propTypes={notification:i.object,rows:i.number,minimal:i.bool};function Fe({notification:e,rows:t=2,minimal:n=!1}){const[s,o]=p.useState(!1),[l,a]=p.useState(""),{t:c,locale:u}=Ie(),{palette:x}=N(),y=p.useMemo(()=>{const{attachments:g}=e||{};if(!g)return!1;try{return g.length>0}catch{return!1}},[e]),b=p.useMemo(()=>{const{blocks:g}=e||{};if(!g)return!1;try{return g.length>0}catch{return!1}},[e]),j=p.useMemo(()=>{const{description:g}=e||{};return!!g},[e]),C=p.useMemo(()=>{const{data:g}=e||{};return!_(g)},[e]),R=p.useMemo(()=>y||b||j||C,[y,b,j,C]);if(p.useEffect(()=>{Gt((e==null?void 0:e.description)??"",u).then(g=>{a(g)})},[e==null?void 0:e.description,u]),!R)return null;const d=()=>t===0?"":s?`<span class='toggle-btn' data-name='toggle-expanded'>${c("common.collapse")}</span>`:`...<span class='toggle-btn' data-name='toggle-expanded'>${c("common.expand")}</span>`,h=g=>{const{target:T}=g;T.getAttribute("data-name")==="toggle-expanded"&&(o(!s),g.customPreventRedirect=!0)};return r.jsxs(Qt,{color:n?x.primary.contrastText:"",children:[r.jsx(m,{className:"text-container",component:"div",onClick:h,children:l&&(!s&&t>0?r.jsx(ft,{basedOn:"letters",unsafeHTML:Z(l),maxLine:t,ellipsisHTML:Z(d())}):r.jsx(A,{component:"div",className:`content ${t===0?"ellipsis":""}`,style:{whiteSpace:"pre-line!important"},dangerouslySetInnerHTML:{__html:Z(`${l}${d()}`)}}))}),!n&&(y||C)?r.jsx(me,{severity:e.severity,notification:e}):null]})}const Qt=E(m)`
110
- width: 100%;
111
- color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
112
- .text-container {
113
- word-wrap: break-word;
114
- word-break: break-all;
115
- color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
116
- .toggle-btn {
117
- display: inline-block;
118
- white-space: nowrap;
119
- cursor: pointer;
120
- margin-left: 4px;
121
- color: ${e=>e.theme.palette.secondary.main};
122
- }
123
- .content.ellipsis {
124
- overflow: hidden;
125
- text-overflow: ellipsis;
126
- word-break: break-all;
127
- display: block;
128
- display: -webkit-box;
129
- -webkit-box-orient: vertical;
130
- -webkit-line-clamp: 2;
131
- line-height: 1.25;
132
- }
133
- }
134
- `,Xt=p.memo(Fe);var fe={},Kt=Re;Object.defineProperty(fe,"__esModule",{value:!0});var Ve=fe.default=void 0,Yt=Kt(Se()),Jt=r;Ve=fe.default=(0,Yt.default)((0,Jt.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel");var ge={},Zt=Re;Object.defineProperty(ge,"__esModule",{value:!0});var Ge=ge.default=void 0,er=Zt(Se()),tr=r;Ge=ge.default=(0,er.default)((0,tr.jsx)("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning");const rr={error:Ve,warning:Ge,info:wt,success:Ct};xe.propTypes={severity:i.oneOf(["error","warning","info","success"]).isRequired,size:i.number};xe.defaultProps={size:32};function xe({severity:e="info",size:t=32}){const n=N(),o=D(()=>({error:n.palette.error.main,warning:n.palette.warning.main,info:n.palette.info.main,success:n.palette.success.main}))[e],l=rr[e],a=rt(o,.1);return r.jsx(Y,{sx:{width:t,height:t,bgcolor:a,color:o},children:r.jsx(l,{fontSize:"small"})})}const sr={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M5.821 4.91c3.898-2.765 9.469-2.539 13.073.536c3.667 3.127 4.168 8.238 1.152 11.897c-2.842 3.447-7.965 4.583-12.231 2.805l-.232-.101l-4.375.931l-.075.013l-.11.009l-.113-.004l-.044-.005l-.11-.02l-.105-.034l-.1-.044l-.076-.042l-.108-.077l-.081-.074l-.073-.083l-.053-.075l-.065-.115l-.042-.106l-.031-.113l-.013-.075l-.009-.11l.004-.113l.005-.044l.02-.11l.022-.072l1.15-3.451l-.022-.036C.969 12.45 1.97 7.805 5.59 5.079l.23-.168z"/></g>'},nr={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M12 2a5 5 0 1 1-5 5l.005-.217A5 5 0 0 1 12 2zm2 12a5 5 0 0 1 5 5v1a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-1a5 5 0 0 1 5-5h4z"/></g>'},ir={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M17 3.34A10 10 0 1 1 2 12l.005-.324A10 10 0 0 1 17 3.34zM12 6a1 1 0 0 0-1 1a3 3 0 1 0 0 6v2a1.024 1.024 0 0 1-.866-.398l-.068-.101a1 1 0 0 0-1.732.998a3 3 0 0 0 2.505 1.5H11a1 1 0 0 0 .883.994L12 18a1 1 0 0 0 1-1l.176-.005A3 3 0 0 0 13 11V9c.358-.012.671.14.866.398l.068.101a1 1 0 0 0 1.732-.998A3 3 0 0 0 13.161 7H13a1 1 0 0 0-1-1zm1 7a1 1 0 0 1 0 2v-2zm-2-4v2a1 1 0 0 1 0-2z"/></g>'},or={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0"/><path d="M16 12v1.5a2.5 2.5 0 0 0 5 0V12a9 9 0 1 0-5.5 8.28"/></g>'},ar={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m15 10l-4 4l6 6l4-16l-18 7l4 2l2 6l3-4"/>'},we={comment:{icon:sr,bgColor:"rgba(239, 246, 255, 1)",color:"rgba(43, 127, 255, 1)"},like:{icon:"👍",bgColor:"rgba(244, 244, 245, 1)",color:"yellow",renderType:"emoji"},follow:{icon:nr,bgColor:"rgba(238, 242, 255, 1)",color:"rgba(97, 95, 255, 1)"},tips:{icon:ir,bgColor:"rgba(254, 252, 232, 1)",color:"rgba(240, 177, 0, 1)"},mention:{icon:or,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"},assign:{icon:ar,bgColor:"rgba(244, 244, 245, 1)",color:"rgba(43, 127, 255, 1)"}};ye.propTypes={activity:i.oneOf(["comment","like","follow","tips","mention","assign"]).isRequired,size:i.number};ye.defaultProps={size:32};function ye({activity:e,size:t=32}){const n=we[e]||we.comment,s=n.icon;return r.jsx(Y,{sx:{bgcolor:n.bgColor,color:n.color,width:t,height:t},children:n.renderType==="emoji"?r.jsx("span",{style:{fontSize:"14px"},children:s}):r.jsx(Me,{icon:s})})}const re={avatar:i.string,fullName:i.string,did:i.string};function K({actor:e,size:t,teamDid:n,inService:s,showName:o}){const l=D(()=>({...e,avatar:e!=null&&e.avatar?St(e.avatar,n,s):null}),[e,n,s]),a=c=>{e&&(c.stopPropagation(),window.open(Pe(U(Te.WELLKNOWN_SERVICE_PATH_PREFIX,"user"),{did:e.did}),"_blank"),c.customPreventRedirect=!0)};return r.jsxs(m,{display:"flex",alignItems:"center",gap:1,onClick:a,role:"button",style:{cursor:"pointer"},title:(e==null?void 0:e.fullName)||"",children:[l.avatar?r.jsx(Rt,{user:l,showDid:!0,cardType:Tt.AvatarOnly,infoType:It.Minimal,avatarSize:t,shape:"circle",sx:{width:t,height:t,borderRadius:"100%",overflow:"hidden",transition:"transform 0.2s ease-in-out","&:hover":{transform:"scale(1.1)"}}}):r.jsx(Y,{sx:{width:t,height:t}}),o&&r.jsx("span",{children:e==null?void 0:e.fullName})]})}K.propTypes={actor:i.shape(re).isRequired,size:i.number.isRequired,teamDid:i.string,inService:i.bool,showName:i.bool};K.defaultProps={teamDid:"",inService:!1,showName:!1};J.propTypes={actors:i.oneOfType([i.shape(re),i.arrayOf(i.shape(re))]).isRequired,size:i.number,maxDisplay:i.number,teamDid:i.string,inService:i.bool,showName:i.bool,avatarFallback:i.node};J.defaultProps={size:32,maxDisplay:9,teamDid:"",inService:!0,showName:!1,avatarFallback:null};function J({actors:e,size:t=32,maxDisplay:n=9,teamDid:s="",inService:o=!0,showName:l=!1,avatarFallback:a=null}){const c=D(()=>{const u=Array.isArray(e)?e:[e];return bt(u,"did").filter(Boolean)},[e]);return c.length===1||!c.length?r.jsx(K,{actor:c[0],size:t,teamDid:s,inService:o,showName:l}):r.jsx(st,{total:c.length,renderSurplus:u=>u<100?r.jsxs("span",{children:["+",u]}):r.jsx("span",{children:"99+"}),max:n,sx:{justifyContent:"flex-end",height:`${t}px`,".MuiAvatar-root":{width:`${t}px`,height:`${t}px`,fontSize:`${t/2.5}px`,border:0,zIndex:2}},children:c.map((u,x)=>u!=null&&u.avatar?r.jsx(K,{actor:u,size:t,teamDid:s,inService:o},(u==null?void 0:u.did)||x):a)})}const ke=3;Ke.propTypes={notification:i.object.isRequired,isMultiple:i.bool,blocklet:i.object,mountPoint:i.string,avatarFallback:i.node};Qe.propTypes={notification:i.object.isRequired,mountPoint:i.string};Xe.propTypes={items:i.array.isRequired,activity:i.object.isRequired,blocklet:i.object,mountPoint:i.string,viewMoreLink:i.string,avatarFallback:i.node};function Qe({notification:e,mountPoint:t=""}){var a;const{activity:n}=e,{type:s,meta:o={}}=n||{},l=$e({activity:n,users:[e==null?void 0:e.actorInfo],actors:[(a=e==null?void 0:e.activity)==null?void 0:a.actor],mountPoint:t});return _(n)||!n.type||!n.actor||_(n.target)?null:r.jsxs(m,{children:[r.jsx(A,{variant:"body1",color:"text.secondary",sx:{mb:.5},children:l}),o?r.jsx(Ae,{meta:o,type:s}):null]})}function Xe({items:e,activity:t,blocklet:n,mountPoint:s="",viewMoreLink:o="",avatarFallback:l=null}){const a=N(),c=D(()=>{var d;return(n==null?void 0:n.did)||((d=n==null?void 0:n.meta)==null?void 0:d.did)||""},[n]),{locale:u}=p.useContext(oe),x=D(()=>!_(t.meta)&&Object.values(t.meta).some(d=>d!=null),[t]),y=$e({activity:t,users:e.map(d=>d==null?void 0:d.actorInfo),actors:e.map(d=>{var h;return(h=d==null?void 0:d.activity)==null?void 0:h.actor}),mountPoint:s}),b=ee(d=>{if(!d.activity)return null;const h=ae(d.activity);return h!=null&&h.metaLink?le(h==null?void 0:h.metaLink)?h==null?void 0:h.metaLink:U(s,h.metaLink):null}),j=ee((d,h)=>{if(!h)return;const g=b(h);g&&(window.open(g,"_blank"),d.customPreventRedirect=!0)}),C=e.length>ke,R=e.slice(0,ke);return r.jsxs(m,{sx:{width:"100%"},children:[r.jsx(A,{variant:"body1",color:"text.secondary",sx:{mb:3},children:y}),x?r.jsxs(m,{className:"sub-content",display:"flex",flexDirection:"column",gap:3,children:[R.map(d=>{var h;return r.jsxs(m,{display:"flex",flexDirection:"column",gap:1,onClick:g=>j(g,d),children:[r.jsxs(m,{display:"flex",alignItems:"center",gap:1,children:[Q(d)?r.jsx(J,{actors:d.actorInfo,size:32,teamDid:c}):l,r.jsx(A,{variant:"subtitle1",color:"text.primary",children:Q(d)?(h=d==null?void 0:d.actorInfo)==null?void 0:h.fullName:"System"})," ","·",r.jsx(Ne,{value:d.createdAt,locale:u,shouldUpdate:!0,style:{color:a.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),d.activity.meta?r.jsx(m,{pl:5,children:r.jsx(Ae,{meta:d.activity.meta,type:d.activity.type})}):null]},d.id)}),C&&o?r.jsx(m,{mt:1,display:"flex",justifyContent:"center",children:r.jsxs(nt,{size:"large",variant:"text",component:se,href:o,target:"_blank",rel:"noopener noreferrer",onClick:d=>{d.customPreventRedirect=!0},children:["View More ",r.jsx(Me,{icon:gt,style:{marginLeft:4}})]})}):null]}):null]})}function Ke({notification:e,isMultiple:t=!1,blocklet:n,mountPoint:s="",avatarFallback:o}){const l=D(()=>{if(!e.activity)return null;const a=ae(e.activity);return a!=null&&a.targetLink?le(a==null?void 0:a.targetLink)?a==null?void 0:a.targetLink:U(s,a.targetLink):null},[e.activity,s]);return t?r.jsx(Xe,{items:e.items,activity:e.activity,blocklet:n,mountPoint:s,viewMoreLink:l,avatarFallback:o}):r.jsx(Qe,{notification:e,mountPoint:s})}const lr=it(m)`
135
- display: flex;
136
- justify-content: center;
137
- align-items: center;
138
- flex-direction: column;
139
- height: 100%;
140
- min-height: 100px;
141
- color: #999;
142
- .empty-icon {
143
- margin: 10px 0;
144
- }
145
- `;function ve({color:e,children:t,...n}){const s=Mt();return r.jsxs(lr,{...n,children:[r.jsx("img",{src:`${s.imgPrefix}/all-done.png`,alt:"All Done",width:200,height:200,style:{maxHeight:"100%",maxWidth:"100%"},onError:o=>{o.target.style.display="none"}}),r.jsx(m,{className:"empty-content",children:t})]})}ve.propTypes={color:i.string,children:i.any};ve.defaultProps={color:"inherit",children:null};cr.propTypes={data:i.array,blockletMap:i.object,onReadBatch:i.func,inDialog:i.bool,highlightId:i.string,highlight:i.bool,type:i.oneOf(["server","service"])};Ye.propTypes={notification:i.object,blocklet:i.object,onReadBatch:i.func,inDialog:i.bool,highlight:i.bool};V.propTypes={blocklet:i.object,size:i.number,showName:i.bool,hideDot:i.bool};function V({blocklet:e,size:t=40,showName:n=!1,hideDot:s=!1}){var a,c;const o=(e==null?void 0:e.did)||((a=e==null?void 0:e.meta)==null?void 0:a.did)||"",l=((e==null?void 0:e.alsoKnownAs)||[]).concat((e==null?void 0:e.appId)||(e==null?void 0:e.appDid)||(e==null?void 0:e.appPid)||"");return r.jsxs(m,{className:"component-avatar",display:"flex",alignItems:"center",sx:{gap:s?"8px":"4px"},children:[!s&&r.jsx("span",{className:"dot"}),e?r.jsx(m,{children:l.includes(o)?r.jsx(ce,{blocklet:e,size:t,style:{borderRadius:8}}):r.jsx(ht,{blocklet:e,ancestors:e.ancestors??[],size:t,style:{borderRadius:8}})}):r.jsx(pt,{width:t,height:t}),n&&r.jsx("span",{className:"component-name",children:(c=e==null?void 0:e.meta)==null?void 0:c.title})]})}function Ye({notification:e,blocklet:t,onReadBatch:n=()=>{},inDialog:s=!1,highlight:o}){const{locale:l}=p.useContext(oe),a=N(),c=W(v=>v.breakpoints.down("md")),u=p.useRef(null),x=p.useMemo(()=>te(e),[e]),y=p.useMemo(()=>yt(e),[e]),b=p.useMemo(()=>Q(e),[e]),j=p.useMemo(()=>{const{actions:v,action:I}=e;let w=v??[];return!w.length&&I&&(w=[{name:"Visit",link:I}]),w},[e]),C=p.useMemo(()=>e.items||[],[e]),R=p.useMemo(()=>C.length>0,[C]),d=p.useMemo(()=>y?R?C.map(v=>{var I;return Q(v)?v.actorInfo:{did:(I=v.activity)==null?void 0:I.actor}}).filter(Boolean):e.actorInfo??[]:[],[C,e.actorInfo,R,y]),h=p.useMemo(()=>{var v;return(t==null?void 0:t.did)||((v=t==null?void 0:t.meta)==null?void 0:v.did)||""},[t]),g=p.useMemo(()=>Et(h,window.blocklet),[h]),T=ee((v,I)=>{const w=He(v);if(w.length&&n(w.map(M=>M.id)),I&&!I.customPreventRedirect){const M=_t(v,g);M&&typeof M=="string"&&window.open(M,"_blank","noopener,noreferrer")}});return r.jsxs(dr,{ref:u,className:"notification-row",id:e.id,isRead:x,inDialog:s,highlight:o,isMd:c,onClick:v=>T(e,v),children:[y?r.jsx(ye,{activity:e.activity.type,size:c?24:32}):r.jsx(xe,{severity:e.severity,size:c?24:32}),r.jsxs(m,{className:"notification",display:"flex",flexDirection:"column",alignItems:"start",children:[r.jsxs(m,{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:1,className:"header",mb:1.5,children:[y&&b?r.jsx(J,{actors:d,teamDid:h,size:c?24:32,avatarFallback:r.jsx(V,{blocklet:t,hideDot:!0,size:c?24:32})}):r.jsx(V,{blocklet:t,hideDot:!0,size:c?24:32}),r.jsx(Ne,{value:e.createdAt,locale:l,shouldUpdate:!0,style:{color:a.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),y?r.jsx(Ke,{notification:e,isMultiple:R,blocklet:t,mountPoint:g,avatarFallback:r.jsx(V,{blocklet:t,hideDot:!0,size:c?24:32})}):r.jsxs(r.Fragment,{children:[r.jsx(A,{variant:"body1",className:"title",color:"rgba(24, 24, 27, 1)",style:{marginTop:0},sx:{mb:.5},children:e.title}),r.jsx(Xt,{notification:e,rows:s?0:2})]}),j.length>0?r.jsx(m,{display:"flex",justifyContent:"start",alignItems:"center",gap:1,mt:1.5,children:j.map((v,I)=>r.jsxs(p.Fragment,{children:[r.jsx(se,{href:v.link,target:"_blank",className:"link",rel:"noopener noreferrer",sx:{fontSize:"15px"},onClick:w=>{w.customPreventRedirect=!0},children:v.name},v.link),I<j.length-1?r.jsx(ne,{orientation:"vertical",sx:{ml:1,mr:1,height:12,borderWidth:"1px"}}):null]},v.link))}):null]}),(e==null?void 0:e.description)&&e.severity==="error"&&r.jsx(m,{className:"copy-button",children:r.jsx(ot,{size:"small",children:r.jsx(ut,{sx:{fontSize:22},content:(e==null?void 0:e.description)||""})})})]})}function cr({data:e,blockletMap:t,onReadBatch:n=()=>{},inDialog:s=!1,highlightId:o,highlight:l=!1,type:a="service"}){const{t:c}=Ie(),u=p.useRef(null),[x,y]=p.useState(!1),[b,j]=p.useState(!0),[C,R]=p.useState(!1),d=p.useRef(new Set),h=p.useRef(new Set),g=p.useRef(null),T=p.useRef(null),v=p.useRef(!1),I=p.useMemo(()=>s?e==null?void 0:e.slice(0,5):e,[s,e]),w=p.useMemo(()=>xt(I),[I]),M=p.useMemo(()=>{const f=new Map;return w&&w.length&&w.forEach(k=>{f.set(k.id,k)}),f},[w]);p.useEffect(()=>{const f=()=>{j(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",f),()=>{document.removeEventListener("visibilitychange",f)}},[]);const O=p.useCallback(()=>{if(!s&&d.current.size>0){const f=[];d.current.forEach(k=>{if(h.current.has(k))return;const S=M.get(k);if(S){const{receivers:z=[],items:L=[]}=S;if(z.length&&!z[0].read&&(f.push(k),h.current.add(k),L.length>0&&L.forEach($=>{const P=$.id;P&&!h.current.has(P)&&(f.push(P),h.current.add(P))}),T.current)){const $=document.getElementById(k);$&&T.current.unobserve($)}}}),f.length>0&&(n(f),setTimeout(()=>{y(!1)},300)),d.current.clear()}},[s,M,n]),q=p.useCallback(()=>{if(s||!u.current||!b)return;T.current&&T.current.disconnect();const f={root:null,rootMargin:"0px",threshold:.5},k=new IntersectionObserver(z=>{x&&z.forEach(L=>{const $=L.target.id;if(h.current.has($))return;const P=M.get($);if(P){const{receivers:be=[]}=P;be.length&&!be[0].read&&(L.isIntersecting?(d.current.add($),C||O()):d.current.delete($))}})},f);T.current=k,Array.from(u.current.querySelectorAll(".notification-row")).filter(z=>{const L=z.id;if(h.current.has(L))return!1;const $=M.get(L);if($){const{receivers:P=[]}=$;return P.length&&!P[0].read}return!1}).forEach(z=>{k.observe(z)}),v.current=!1},[x,s,C,b,M,O]);return p.useEffect(()=>{s||(v.current=!0,T.current&&b&&x&&setTimeout(()=>{q()},0))},[I,x,b,q,s]),p.useEffect(()=>{if(s||!u.current||!b)return;let f=window;if(a==="server"&&(f=document.getElementById("arc__dashboard-main")),!f){const S=document.getElementsByClassName("dashboard-main")[0];S&&(f=S)}if(!f)return;const k=S=>{S.isTrusted&&(x||y(!0),R(!0),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{R(!1),O(),v.current&&q()},300))};return f.addEventListener("scroll",k,{passive:!0}),()=>{f.removeEventListener("scroll",k),g.current&&clearTimeout(g.current)}},[s,x,b,O,q,a]),p.useEffect(()=>(s||q(),()=>{T.current&&T.current.disconnect()}),[q,s]),at(()=>{setTimeout(()=>{const f=qt(u.current),k=Wt(M,f);n(k.map(S=>S.id))},2e3)}),w!=null&&w.length?r.jsx(m,{ref:u,display:"flex",flexDirection:"column",sx:{...s?{maxHeight:"calc(-200px + 100vh)",overflow:"auto"}:{}},children:w==null?void 0:w.map(f=>{var S;const k=f.source==="system"?t.get(f.entityId||f.sender):t.get(f.componentDid||f.sender);return((S=f==null?void 0:f.type)==null?void 0:S.toLowerCase())==="passthrough"?null:r.jsx(Ye,{highlight:l&&o===f.id,inDialog:s,notification:f,blocklet:k,onReadBatch:n},f.id)})}):r.jsx(ve,{children:c("notification.allDone")})}const dr=E("div")`
146
- @keyframes flash-bg {
147
- 0% {
148
- background-color: ${e=>e.theme.palette.warning.light};
149
- }
150
- 100% {
151
- background-color: unset;
152
- }
153
- }
154
- position: relative;
155
- display: flex;
156
- align-items: flex-start;
157
- gap: ${e=>e.isMd?e.theme.spacing(1):e.theme.spacing(1.5)};
158
- padding: ${e=>e.isMd?`${e.theme.spacing(2)} 0`:e.theme.spacing(3)};
159
- cursor: pointer;
160
- animation: ${e=>e.highlight?"flash-bg 3s ease-out 0s 1 normal none running":"none"};
161
- background-color: ${e=>e.isRead?"transparent":e.theme.palette.grey[100]};
162
- border-bottom: 1px solid;
163
- border-color: ${({theme:e})=>e.palette.grey[200]};
164
- &:last-child {
165
- border-bottom: none;
166
- }
167
- &:hover {
168
- background-color: ${e=>e.theme.palette.action.hover};
169
- }
170
-
171
- .copy-button {
172
- position: absolute;
173
- right: ${e=>e.inDialog?e.theme.spacing(2):"0"};
174
- top: ${e=>e.inDialog?e.theme.spacing(5):e.theme.spacing(4)};
175
- display: none;
176
- background: ${e=>e.theme.palette.action.disabledBackground};
177
- border-radius: 50%;
178
- svg {
179
- width: ${e=>e.theme.spacing(2.25)};
180
- height: ${e=>e.theme.spacing(2.25)};
181
- }
182
- }
183
- &:hover {
184
- .copy-button {
185
- display: block;
186
- }
187
- }
188
-
189
- .component-avatar {
190
- .dot {
191
- width: ${e=>e.theme.spacing(1)};
192
- height: ${e=>e.theme.spacing(1)};
193
- border-radius: 50%;
194
- background-color: ${e=>e.theme.palette.primary.main};
195
- visibility: ${e=>e.isRead?"hidden":"visible"};
196
- }
197
- }
198
-
199
- .notification {
200
- width: calc(100% - ${e=>e.theme.spacing(6.25)});
201
-
202
- > .header {
203
- width: 100%;
204
- @media (min-width: 900px) {
205
- .title {
206
- max-width: calc(100vw - ${e=>e.theme.spacing(50)});
207
- }
208
- }
209
- @media (min-width: 1200px) {
210
- .title {
211
- max-width: ${e=>e.theme.spacing(102.5)};
212
- }
213
- }
214
- @media (max-width: 900px) {
215
- .title {
216
- max-width: calc(100vw - ${e=>e.theme.spacing(25)});
217
- }
218
- }
219
- }
220
-
221
- .title {
222
- min-width: 0;
223
- max-width: 100%;
224
- overflow: hidden;
225
- text-overflow: ellipsis;
226
- white-space: nowrap;
227
- color: ${e=>e.theme.palette.text.primary};
228
- font-size: ${e=>e.theme.typography.fontSize*1.15}px;
229
- }
230
- .link {
231
- color: ${e=>e.theme.palette.primary.main};
232
- font-size: ${e=>e.theme.typography.fontSize}px;
233
- text-decoration: none;
234
- }
235
- }
236
- `;export{J as A,ce as B,cr as N,V as S,Ke as a,Xt as b,te as c};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-UZpb7wT7.js";import"./vendor-react-DEoibe3W.js";import{S as t}from"./studio-BbeHx14I.js";import"./vendor-ux-did-connect-TEE6cGq6.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-rDgu5KV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-CN2B_oTr.js";import"./TuneOutlined-CB7t_nGq.js";function d(){return o.jsx(t,{children:"Coming soon..."})}export{d as default};
@@ -1,85 +0,0 @@
1
- import{j as t,ap as re,aa as i,H as h,ah as le,ad as k,T as A,bc as ae}from"./vendor-mui-core-UZpb7wT7.js";import{r as p,b as ve}from"./vendor-react-DEoibe3W.js";import{I as u,u as _,B as je,b8 as ye,j as I}from"./vendor-ux-did-connect-TEE6cGq6.js";import{Y as be,Z as z}from"./vendor-arcblock-CN2B_oTr.js";import{d as $}from"./InfoOutlined-Dy7jTc7H.js";import{K as we}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{p as ke}from"./use-blocklet-logo-sEJnYyNL.js";import{z as Se,C as Te,K as Ie,w as Ae,l as _e,ai as Ce,t as q}from"./index-u-w3iMC9.js";import{I as Me}from"./index-C0SLCehH.js";import{_ as Re}from"./dot-C05enzim.js";import{A as $e}from"./vendor-utils-rHXShPKm.js";import{u as Be}from"./dashboard-C124DXmc.js";import{W as g}from"./did-address-BKBBjFqv.js";import{V as De}from"./status-46dMQnxA.js";import{c as ze}from"./spaces-Cp7TgoZP.js";import"./vendor-hooks-rDgu5KV9.js";import"./lottie-web-jYmAQWuC.js";import"./session-6XaVDQaE.js";import"./useAsync-DV3NyLhI.js";import"./useLocalStorage-C6U1Aqya.js";import"./confirm-BvUfAlkx.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-C9IFmc-j.js";import"./get-safe-url-2RcRY8gU.js";import"./collapse-Bn_BDlF9.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-Bh8CHBbH.js";import"./omit-D2k92RIF.js";import"./api-BjteVZFg.js";const qe={width:24,height:24,body:'<path fill="currentColor" d="m12 10.8l-3.9 3.9q-.275.275-.7.275t-.7-.275q-.275-.275-.275-.7t.275-.7l4.6-4.6q.3-.3.7-.3t.7.3l4.6 4.6q.275.275.275.7t-.275.7q-.275.275-.7.275t-.7-.275L12 10.8Z"/>'},Ee=qe,Ne={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 17a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2zm12 0a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM9 5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2zM6 15v-1a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v1m-6-6v3"/>'},Pe=Ne,Ue={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 7a4 4 0 1 0 8 0a4 4 0 1 0-8 0M3 21v-2a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v2m1-17.87a4 4 0 0 1 0 7.75M21 21v-2a4 4 0 0 0-3-3.85"/>'},He=Ue,Le={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M7 12h3v4H7z"/><path d="M10 6H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-6"/><path d="M10 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zm4 12h2m-2-4h4"/></g>'},Ke=Le,Ve={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M19.5 7A9 9 0 0 0 12 3a8.991 8.991 0 0 0-7.484 4"/><path d="M11.5 3a16.989 16.989 0 0 0-1.826 4M12.5 3a16.989 16.989 0 0 1 1.828 4M19.5 17a9 9 0 0 1-7.5 4a8.991 8.991 0 0 1-7.484-4"/><path d="M11.5 21a16.989 16.989 0 0 1-1.826-4m2.826 4a16.989 16.989 0 0 0 1.828-4M2 10l1 4l1.5-4L6 14l1-4m10 0l1 4l1.5-4l1.5 4l1-4M9.5 10l1 4l1.5-4l1.5 4l1-4"/></g>'},Oe=Ve,Qe={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0-18 0"/><path d="M12 7v5l3 3"/></g>'},ie=Qe,We={width:24,height:24,body:'<path fill="currentColor" d="M12 14q-.825 0-1.413-.588T10 12q0-.825.588-1.413T12 10q.825 0 1.413.588T14 12q0 .825-.588 1.413T12 14Zm0 7q-3.475 0-6.025-2.288T3.05 13H5.1q.35 2.6 2.313 4.3T12 19q2.925 0 4.963-2.038T19 12q0-2.925-2.038-4.963T12 5q-1.725 0-3.225.8T6.25 8H9v2H3V4h2v2.35q1.275-1.6 3.113-2.475T12 3q1.875 0 3.513.713t2.85 1.924q1.212 1.213 1.925 2.85T21 12q0 1.875-.713 3.513t-1.924 2.85q-1.213 1.212-2.85 1.925T12 21Z"/>'},Fe=We;function E({icon:e,value:a,name:o,url:l="",animated:c=!1,LinkComponent:d=re}){const y=()=>ve.isValidElement(e)?e:t.jsx(i,{component:u,icon:e,alt:typeof o=="string"?o:"",sx:{fontSize:30}}),m=t.jsxs(t.Fragment,{children:[t.jsx(i,{className:"metric__image",children:y()}),t.jsxs(i,{children:[p.isValidElement(a)?t.jsx(i,{className:`metric__number ${c?"metric__number--animated":""}`,children:a}):t.jsx(i,{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:a}}),t.jsx(i,{className:"metric__name",children:o})]})]});return t.jsx(Ge,{children:l?t.jsx(d,{href:l,sx:{textDecoration:"none"},children:m}):m})}E.propTypes={icon:h.string.isRequired,value:h.string.isRequired,name:h.string.isRequired,url:h.string,animated:h.bool,LinkComponent:h.elementType};E.defaultProps={url:"",animated:!1,LinkComponent:re};const Ge=le("div")`
2
- border-left: 1px solid ${e=>e.theme.palette.divider};
3
- padding: 10px 0 10px 16px;
4
- @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
5
- padding: 0 0 0 8px;
6
- }
7
-
8
- display: flex;
9
- justify-items: center;
10
- align-items: flex-start;
11
-
12
- a {
13
- display: flex;
14
- justify-items: center;
15
- align-items: flex-start;
16
- }
17
-
18
- .metric__image {
19
- margin-right: 8px;
20
- margin-top: 2px;
21
- }
22
-
23
- .metric__number {
24
- margin-bottom: 8px;
25
- font-size: ${e=>e.size==="small"?32:36}px;
26
- font-weight: 600;
27
- line-height: 36px;
28
- color: ${e=>e.theme.typography.color.main};
29
-
30
- small {
31
- font-size: 12px;
32
- line-height: 12px;
33
- }
34
-
35
- @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
36
- font-size: ${e=>e.size==="small"?24:28}px;
37
- line-height: ${e=>e.size==="small"?24:28}px;
38
- margin-bottom: 2px;
39
- }
40
- }
41
-
42
- .metric__number--animated {
43
- animation-name: blink-opacity;
44
- animation-duration: 250ms;
45
- animation-timing-function: linear;
46
- animation-iteration-count: 1;
47
- background-color: transparent !important;
48
- }
49
-
50
- .metric__name {
51
- font-size: 14px;
52
- text-transform: capitalize;
53
- line-height: 1.2;
54
- font-weight: 500;
55
- color: ${e=>e.theme.typography.color.main};
56
- @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
57
- font-size: 10px;
58
- line-height: 1;
59
- }
60
- }
61
-
62
- @keyframes blink-opacity {
63
- 0% {
64
- opacity: 1;
65
- }
66
- 50% {
67
- opacity: 0.3;
68
- }
69
- 100% {
70
- opacity: 1;
71
- }
72
- }
73
- `,v={oneSecond:1,oneMin:1*60,oneHour:1*60*60,oneDay:24*60*60},Ze=(e,a)=>{const[o,l]=p.useState(0),c=m=>m>=v.oneDay?v.oneDay:m>=v.oneHour?v.oneHour:m>=v.oneMin?v.oneMin:v.oneSecond,[d,y]=p.useState(c(e/1e3));return p.useEffect(()=>{const m=setInterval(()=>{l(o+d);const C=c(e/1e3+o+d);d!==C&&y(C)},d*1e3);return()=>clearInterval(m)},[d,o]),p.useEffect(()=>{l(0),y(c(e/1e3))},[e]),a(e+o*1e3)};h.number.isRequired,h.func;const Ye={arcblock:"ArcBlock",ethereum:"Ethereum"};function ce({source:e,migrated:a}){const{t:o}=_();return e?e.startsWith("managed")?t.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:.5},children:[t.jsx(A,{children:e}),t.jsx(k,{title:o(a?"blocklet.skSourceMigratedTip":"blocklet.skSourceManagedTip"),children:t.jsx($,{sx:{fontSize:16,color:a?"text.secondary":"warning.main"}})})]}):t.jsx(A,{children:e}):null}ce.propTypes={source:h.string.isRequired,migrated:h.bool.isRequired};const Xe=e=>{const{t:a}=_();let o=0,l=0;e&&(o=e.length,l=e.filter(d=>d.status==="running").length);let c=o;return l&&(c+=`<small>${a("common.running")} ${l}</small>`),c},Je=(e,a)=>{const{t:o}=_();return a.length?t.jsxs(i,{component:"small",children:[o("router.domainAlias.custom")," ",a.length]}):t.jsxs(i,{component:"small",sx:{display:"flex",alignItems:"center",gap:.5,color:a.length?"text.primary":"warning.main"},children:[o("router.domainAlias.noCustom"),t.jsx(k,{title:o("router.domainAlias.noCustomTip"),children:t.jsx($,{sx:{fontSize:16}})})]})},et=(e,a)=>{const o=e===I.BACKUPS.STATUS.PROGRESS&&q().diff(a,"hours")>=I.BACKUPS.TIMEOUT_HOURS,l=e===I.BACKUPS.STATUS.PROGRESS&&!o;return e===I.BACKUPS.STATUS.SUCCEEDED&&!o?t.jsx(i,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"success.main"}}):l?t.jsx(i,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"error.main"}}):t.jsx(i,{sx:{width:8,height:8,borderRadius:"100%",bgcolor:"warning.main"}})},tt=(e,a)=>{const{t:o,locale:l}=_(),c=a==null?void 0:a.createdAt;return e&&c?t.jsxs(i,{sx:{display:"flex",alignItems:"baseline",gap:.5,color:q(c).add(1,"day").isAfter(q())?"text.primary":"warning.main"},children:[z(c,l==="tw"?"zh":l),t.jsx(k,{title:o("storage.spaces.backup.lastBackupTip",{time:z(c,l==="tw"?"zh":l)}),children:t.jsx($,{sx:{fontSize:16}})})]}):t.jsxs(i,{sx:{display:"flex",alignItems:"baseline",gap:.5,color:"warning.main"},children:[o("storage.spaces.backup.noBackup"),t.jsx(k,{title:o("storage.spaces.backup.noBackupTip"),children:t.jsx($,{sx:{fontSize:16}})})]})},j={fontSize:30,color:"text.primary"};function nt(){var H,L,K,V,O,Q,W,F,G,Z,Y,X,J,ee,te,ne,oe;const{t:e,locale:a}=_(),{info:o,inService:l,api:c,imgPrefix:d}=Se(),{teamDid:y}=Be(),[m,C]=p.useState(!1),{did:me,blocklet:n}=Te(),r=Re(()=>c.getBlockletBaseInfo({input:{teamDid:y}})),{appDid:B,appPid:D,migratedFrom:f=[]}=n,N=(H=n.environments.find(s=>s.key==="BLOCKLET_APP_CHAIN_TYPE"))==null?void 0:H.value,M=s=>typeof s!="number"||Number.isNaN(s)?"0":s>=1e4?new Intl.NumberFormat(a,{notation:"compact",compactDisplay:"short"}).format(s):new Intl.NumberFormat(a).format(s),P=[B?{name:e("blocklet.appId"),value:t.jsx(g,{did:B,showQrcode:!0})}:null,D&&B!==D?{name:t.jsxs(i,{children:[e("blocklet.appPid"),t.jsx(k,{title:e("blocklet.whyNeedAppPid"),style:{cursor:"help",fontSize:16},children:t.jsx(be,{sx:{verticalAlign:"middle",mt:"-2px",ml:"2px"}})})]}),value:t.jsx(g,{did:D,showQrcode:!0})}:null,(f==null?void 0:f.length)>1?{name:e("blocklet.alsoKnownAs"),value:t.jsxs("div",{children:[(m?f.slice(1):f.slice(1,2)).map(s=>t.jsx(g,{did:s.appDid,showQrcode:!0})),f.length>2&&t.jsx(je,{sx:{pl:0,"&:hover":{backgroundColor:"transparent"}},endIcon:m?t.jsx(u,{icon:Ee}):t.jsx(u,{icon:we}),onClick:()=>C(!m),children:e(m?"common.collapseAll":"blocklet.router.showAllDIDs")})]})}:null,Ie(n)?{name:"NFT",value:t.jsx(g,{external:!0,href:Ae((L=n==null?void 0:n.controller)==null?void 0:L.chainHost,(K=n==null?void 0:n.controller)==null?void 0:K.nftId,"asset"),did:(V=n==null?void 0:n.controller)==null?void 0:V.nftId,showQrcode:!0})}:null,{name:e("common.owner"),value:(O=n.settings)!=null&&O.owner?t.jsx(g,{did:n.settings.owner.did,showQrcode:!0}):"-"},(Q=n.vaults)!=null&&Q.length?{name:e("blocklet.config.vault.name"),value:t.jsxs(i,{sx:{display:"flex",alignItems:"center",gap:.5,"& > span":{width:"auto"}},children:[t.jsx(g,{did:n.vaults[n.vaults.length-1].did,showQrcode:!0}),t.jsx(De,{vaults:n.vaults,appPid:n.appPid})]})}:null,{name:e("blocklet.installedAt"),value:_e(n.installedAt,a)},{name:e("blocklet.config.walletType.name"),value:Ye[N||"arcblock"]||N},n.externalSkSource?{name:e("blocklet.skSource"),value:t.jsx(ce,{source:n.externalSkSource,migrated:f.length>0})}:null].filter(Boolean);l&&P.push({name:e("common.serverDid"),value:t.jsx(g,{did:o.did,showQrcode:!0})},{name:e("common.serverVersion"),value:t.jsx(ye,{children:o.version})});const de=s=>s.map(x=>t.jsx(Me,{style:{display:"flex",alignItems:"flex-start"},valueComponent:"div",nameWidth:150,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name)),pe=Xe(n.children),ue=Ze(Number(((W=n==null?void 0:n.appRuntimeInfo)==null?void 0:W.uptime)||0),s=>ke(s,{compact:!0,verbose:!0,locale:a==="tw"?"zh":a})),R=p.useMemo(()=>{var s;return((s=n==null?void 0:n.site)==null?void 0:s.domainAliases)||[]},[(F=n==null?void 0:n.site)==null?void 0:F.domainAliases]),he=p.useMemo(()=>R.filter(s=>Ce.isCustomDomain(s.value)),[R]),b=p.useMemo(()=>{var s;return((s=r==null?void 0:r.value)==null?void 0:s.passport)||{}},[(G=r==null?void 0:r.value)==null?void 0:G.passport]),w=p.useMemo(()=>{var s;return((s=r==null?void 0:r.value)==null?void 0:s.user)||{}},[(Z=r==null?void 0:r.value)==null?void 0:Z.user]),U=p.useMemo(()=>ze(n==null?void 0:n.environments),[n==null?void 0:n.environments]),xe=Je(R,he),fe=tt(U,(Y=r==null?void 0:r.value)==null?void 0:Y.backup),S=(s,x)=>`${I.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${s}/${x}`,T=s=>{var se;const x=(se=o==null?void 0:o.routing)==null?void 0:se.adminPath;return $e(x,`/blocklets/${me}/${s}`)},ge=[{name:e("common.blocklets"),value:pe,icon:t.jsx(i,{component:u,icon:Pe,sx:j}),url:l?S("overview","components"):T("components")},{name:e("common.members"),value:`${M((w==null?void 0:w.users)||0)}<small>${e("common.active")} ${M(w==null?void 0:w.approvedUsers)}</small>`,icon:t.jsx(i,{component:u,icon:He,sx:j}),url:l?S("did-connect","members"):T("members")},{name:e("team.member.passports"),value:`${M((b==null?void 0:b.passports)||0)}<small>${e("common.active")} ${M(b==null?void 0:b.activePassports)}</small>`,icon:t.jsx(i,{component:u,icon:Ke,sx:j}),url:l?S("did-connect","passports"):T("passports")},{name:e("common.domains"),value:t.jsxs(i,{display:"flex",alignItems:"baseline",children:[R.length,xe]}),icon:t.jsx(i,{component:u,icon:Oe,sx:j}),url:l?S("website","domains"):T("domains")},{name:e("common.uptime"),value:(X=n==null?void 0:n.appRuntimeInfo)!=null&&X.uptime?ue:`${e("common.waiting")}...`,icon:t.jsx(i,{component:u,icon:ie,sx:j})},n.createdAt&&+new Date(n.createdAt)!=+new Date(0)?{name:e("common.created"),value:z(new Date(n.createdAt).getTime(),a==="tw"?"zh":a),icon:t.jsx(i,{component:u,icon:ie,sx:j})}:null,{name:t.jsxs(i,{display:"flex",alignItems:"baseline",gap:.5,children:[e("storage.spaces.backup.lastBackup"),((J=r==null?void 0:r.value)==null?void 0:J.backup)&&U&&t.jsx(k,{children:et((te=(ee=r==null?void 0:r.value)==null?void 0:ee.backup)==null?void 0:te.status,(oe=(ne=r==null?void 0:r.value)==null?void 0:ne.backup)==null?void 0:oe.createdAt)})]}),value:fe,icon:t.jsx(i,{component:u,icon:Fe,sx:j}),url:l?S("did-spaces","backups"):T("didSpaces")}].filter(Boolean);return t.jsxs(ot,{component:"div",children:[t.jsxs(i,{className:"section",children:[t.jsx(A,{className:"section__header",color:"textPrimary",children:e("common.overview")}),t.jsx(ae,{className:"page-metrics",container:!0,spacing:5,children:ge.map(s=>t.jsx(ae,{item:!0,lg:3,md:4,sm:6,xs:12,sx:{small:{ml:.5}},children:t.jsx(E,{...s,prefix:d})},s.name))})]}),t.jsxs(i,{className:"section",children:[t.jsx(A,{className:"section__header",color:"textPrimary",children:e("common.basicInfo")}),t.jsx(i,{className:"basicInfo",children:de(P)})]})]})}nt.propTypes={};const ot=le(A)`
74
- .section {
75
- display: flex;
76
- flex-direction: column;
77
- margin-bottom: 64px;
78
-
79
- .section__header {
80
- font-size: 1.2rem;
81
- font-weight: bold;
82
- margin-bottom: 24px;
83
- }
84
- }
85
- `;export{nt as default};
@@ -1 +0,0 @@
1
- import{v as n,j as i,aa as l}from"./vendor-mui-core-UZpb7wT7.js";import{l as d,r as c}from"./vendor-react-DEoibe3W.js";import{u,am as h}from"./vendor-ux-did-connect-TEE6cGq6.js";import g from"./index-DF3gHUuW.js";import"./vendor-utils-rHXShPKm.js";import"./vendor-hooks-rDgu5KV9.js";import"./lottie-web-jYmAQWuC.js";import"./index-u-w3iMC9.js";import"./vendor-arcblock-CN2B_oTr.js";import"./Error-wpqrAfUT.js";import"./confirm-BvUfAlkx.js";import"./format-error-BrmqJs5a.js";import"./session-6XaVDQaE.js";import"./did-address-BKBBjFqv.js";import"./empty-spinner-BZlBh4vA.js";import"./bundle-avatar-Db5l8MQ4.js";import"./shorten-label-Dq7bVuNa.js";import"./list-header-CU9W30JD.js";import"./Download-DKQGRFHf.js";import"./click-to-copy-BxhgzyYL.js";import"./QuestionMarkCircle-DCM9zW3a.js";import"./useSetState-CWq0AVWn.js";import"./index-DVQCgvFb.js";import"./index-DjLLC6N3.js";import"./api-BjteVZFg.js";import"./ChevronRight-BfbPIE2b.js";import"./vendor-mui-x-whuSO90H.js";import"./DeleteOutline-B6efX_Fy.js";import"./react-beautiful-dnd.esm-Cq_dOQ2z.js";import"./raf-schd.esm-B3j6BePR.js";import"./item-CkcpHBHM.js";import"./Launch-DBKe0gh0.js";import"./Done-Ct5slWpT.js";import"./delete-confirm-BBaXcAXg.js";import"./get-safe-url-2RcRY8gU.js";import"./ArrowDropDown-Dghek9CI.js";import"./index-CKheO_aT.js";import"./index-BMD-pSqT.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function to(){const{t:p}=u(),{componentDid:o}=d(),m=n(t=>t.breakpoints.down("md")),a=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:m?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:a,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{to as default};
@@ -1 +0,0 @@
1
- import{r as f}from"./vendor-react-DEoibe3W.js";import{H as d,j as o,ad as u}from"./vendor-mui-core-UZpb7wT7.js";import{p as T}from"./use-blocklet-logo-sEJnYyNL.js";import{u as P}from"./vendor-ux-did-connect-TEE6cGq6.js";import{l as h,H as R}from"./index-u-w3iMC9.js";function x(e){return e.includes(" ")?new Date(e.replace(" ","T").replace(" ","")).getTime():new Date(e).getTime()}function y({value:e,shouldUpdate:l=!1,...c}){const{t:i,locale:r}=P(),[D,I]=f.useState(0);if(f.useEffect(()=>{let t;if(l){const j=x(e),w=Date.now(),m=Math.abs(Math.floor((j-w)/1e3)),s=()=>{I(M=>{const E=Math.random()*1e3;return parseFloat((M+E).toFixed(4))})};m<60?t=setInterval(s,1e3):m<60*60?t=setInterval(s,6e4):t=setInterval(s,36e5)}return()=>{clearInterval(t)}},[e,D,l]),!e)return"-";const p={locale:R(r),compact:!0},a=x(e),n=Date.now();if(a>n){const t=T(a-n,p);return o.jsx(u,{title:h(e,r),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.afterTime",{time:t})})})}const v=T(n-a,p);return o.jsx(u,{title:h(e,r),placement:"top-end",enterTouchDelay:0,children:o.jsx("span",{...c,children:i("common.timeAgo",{time:v})})})}y.propTypes={value:d.any,shouldUpdate:d.bool};y.defaultProps={value:"",shouldUpdate:!1};export{y as R};
@@ -1 +0,0 @@
1
- import{r as h}from"./vendor-react-DEoibe3W.js";import{e as G,m as $,j as s,bL as F,T as L,aa as w,H as l,bc as C,ah as O,ad as S,co as Z,cp as v}from"./vendor-mui-core-UZpb7wT7.js";import{p as H}from"./use-blocklet-logo-sEJnYyNL.js";import{u as P,a0 as ee,I as te,a7 as ae}from"./vendor-ux-did-connect-TEE6cGq6.js";import{as as q,ax as _,z as se,C as J,f as U,aF as ne}from"./index-u-w3iMC9.js";import{b as A,aM as re}from"./vendor-utils-rHXShPKm.js";import{a5 as R}from"./vendor-arcblock-CN2B_oTr.js";import{R as K}from"./index-ftkgQlGr.js";import{B as ie}from"./bundle-avatar-Db5l8MQ4.js";import{B as oe}from"./dashboard-C124DXmc.js";import"./vendor-hooks-rDgu5KV9.js";import"./session-6XaVDQaE.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-C6U1Aqya.js";import"./confirm-BvUfAlkx.js";import"./format-error-BrmqJs5a.js";import"./PlayArrow-C9IFmc-j.js";import"./get-safe-url-2RcRY8gU.js";import"./InfoOutlined-Dy7jTc7H.js";import"./collapse-Bn_BDlF9.js";import"./dot-C05enzim.js";import"./useAsync-DV3NyLhI.js";import"./useSetState-CWq0AVWn.js";import"./use-mobile-Bh8CHBbH.js";const Q=n=>{const g=new Date(Math.min(...n)),i=(new Date(Math.max(...n))-g)/(1e3*60);return p=>{if(i<=10){const t=(n.length-n.length%i)/i;return p%t===0}const o=(n.length-n.length%6)/6;return p%o===0}},B=n=>`${n}%`;function N({title:n,cpus:g,currentLoad:c,history:d,empty:i,onHover:p,hoverIndex:r}){const{t:o,locale:b}=P(),t=G(),e=h.useRef(null),a=A(d)?[]:d.map(u=>q(u.date,"HH:mm",b)),j=`${n||o("common.cpu")} (${Math.floor(c||0)}%)`,k=h.useCallback(()=>{p==null||p(null)},[p]);if(h.useEffect(()=>{if(!e.current||(r==null?void 0:r.ref)===e)return;const u=e.current.getEchartsInstance(),E=r==null?void 0:r.seriesIndex,T=a.findIndex(y=>y===(r==null?void 0:r.dataValue));r&&T!==-1?u.dispatchAction({type:"showTip",seriesIndex:E,dataIndex:T}):(u.dispatchAction({type:"hideTip"}),u.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[r]),!A(d)){const T={tooltip:{trigger:"axis",formatter(y){const D=y[0].data,{seriesIndex:f,dataIndex:x}=y[0];return p==null||p({seriesIndex:f,dataIndex:x,dataValue:a[x],ref:(r==null?void 0:r.ref)||e}),`${y[0].name}: <b>${B(D)}</b>`},backgroundColor:t.palette.background.paper,borderColor:t.palette.divider,textStyle:{color:t.palette.text.primary},extraCssText:`box-shadow: ${t.shadows[2]}; border-radius: 4px;`},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:a,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:Q(d.map(y=>new Date(y.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:100,interval:Math.ceil(50),axisLabel:{formatter:B}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:80,color:$(t.palette.primary.main,t.palette.mode==="dark"?.15:.08)},{min:80,max:100,color:$(t.palette.warning.main,t.palette.mode==="dark"?.18:.12)},{min:100,color:$(t.palette.error.main,t.palette.mode==="dark"?.25:.18)}]},series:[{name:"CPU Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:t.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:d.map(y=>y.value),markLine:{silent:!0,symbol:["none","none"],lineStyle:{color:t.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${B(100)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2},data:[{yAxis:100},{yAxis:80,lineStyle:{color:t.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${B(80)}`,position:"insideEndTop",color:t.palette.text.secondary,padding:[2,4],borderRadius:2}}]}}]};return s.jsxs(F,{sx:{p:1,position:"relative"},onMouseLeave:k,children:[s.jsx(L,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:j}),s.jsx(K,{ref:e,option:T,style:{width:"100%",height:"200px"},onEvents:{globalout:k}}),s.jsxs(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:[`${o("system.cores")}: ${(g==null?void 0:g.length)||0}`," "]})]})}return i}N.propTypes={title:l.string,cpus:l.array,currentLoad:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};N.defaultProps={title:"",cpus:[],currentLoad:0,history:[],empty:null,onHover:()=>{},hoverIndex:null};function V({instanceCount:n,title:g,total:c,used:d,history:i,empty:p,onHover:r,hoverIndex:o}){const{t:b,locale:t}=P(),e=G(),a=!!c,j=c-d,k=a?`(${_(d)}, ${Math.floor(d/c*100)}%)`:"",u=h.useRef(null),E=`${g||b("common.memory")} ${k}`,T=A(i)?[]:i.map(f=>q(f.date,"HH:mm",t));h.useEffect(()=>{if(!u.current||(o==null?void 0:o.ref)===u)return;const f=u.current.getEchartsInstance(),x=o==null?void 0:o.seriesIndex,M=T.findIndex(m=>m===(o==null?void 0:o.dataValue));o&&M!==-1?f.dispatchAction({type:"showTip",seriesIndex:x,dataIndex:M}):(f.dispatchAction({type:"hideTip"}),f.dispatchAction({type:"showTip",seriesIndex:0,dataIndex:-1}))},[o==null?void 0:o.dataIndex]);const y=h.useCallback(()=>{r==null||r(null)},[r]);h.useEffect(()=>{if(u.current){const f=u.current.getEchartsInstance(),x=f.getDom(),M=m=>{y(m)};return x.addEventListener("mouseleave",M),()=>{x&&x.removeEventListener("mouseleave",M),f&&f.dispose()}}},[y]);const D=[];if(n&&D.push({title:b("system.instances"),metric:n}),a&&D.push({title:b("system.free"),metric:R(j,{short:!0,iec:!0})}),!A(i)){const f=Math.max(...i.map(m=>m.value),c,0),x=Math.ceil(c*.8),M={tooltip:{trigger:"axis",formatter(m){const z=m[0].data,X=R(z,{short:!0,iec:!0}),{seriesIndex:Y,dataIndex:W}=m[0];return r==null||r({seriesIndex:Y,dataIndex:W,dataValue:T[W],ref:(o==null?void 0:o.ref)||u}),`${m[0].name}: <b>${X}</b>`},backgroundColor:e.palette.background.paper,borderColor:e.palette.divider,textStyle:{color:e.palette.text.primary},extraCssText:`box-shadow: ${e.shadows[2]}; border-radius: 4px;`},grid:{top:"48px",left:"16px",right:"16px",bottom:"0px",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:T,axisTick:{show:!1},splitLine:{show:!1},axisLabel:{interval:Q(i.map(m=>new Date(m.date)))}},yAxis:{type:"value",axisTick:{show:!1},splitLine:{show:!1},min:0,max:f,interval:Math.ceil(f/2),axisLabel:{formatter:m=>R(m,{short:!0,iec:!0}),padding:[5,0,0,0]}},visualMap:{show:!1,type:"piecewise",dimension:1,seriesIndex:0,pieces:[{max:x,color:$(e.palette.primary.main,e.palette.mode==="dark"?.15:.08)},{min:x,max:c,color:$(e.palette.warning.main,e.palette.mode==="dark"?.18:.12)},{min:c,color:$(e.palette.error.main,e.palette.mode==="dark"?.25:.18)}]},series:[{name:"Memory Usage",type:"line",smooth:!0,symbol:"none",lineStyle:{color:e.palette.primary.main,width:2.5},areaStyle:{},itemStyle:{},emphasis:{disabled:!0},data:i.map(m=>m.value),markLine:{silent:!0,symbol:["none","none"],data:[{yAxis:c,lineStyle:{color:e.palette.error.main,type:"dashed",width:1.5},label:{formatter:`${R(c,{short:!0,iec:!0})}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}},{yAxis:x,lineStyle:{color:e.palette.warning.light,type:"dashed",width:1.5},label:{formatter:`${R(x,{short:!0,iec:!0})}`,position:"insideEndTop",color:e.palette.text.secondary,padding:[2,4],borderRadius:2}}]}}]};return s.jsxs(F,{sx:{p:1,position:"relative"},onMouseLeave:y,children:[s.jsx(L,{sx:{position:"absolute",top:8,left:16,zIndex:10},fontSize:"16px",fontWeight:"bold",color:"text.secondary",children:E}),s.jsx(K,{ref:u,option:M,style:{width:"100%",height:"200px"}}),s.jsx(w,{sx:{ml:2,mt:1,fontSize:12},color:"text.secondary",children:D.map((m,z)=>s.jsxs(w,{sx:{marginLeft:z===0?0:1,display:"inline-flex"},children:[m.title,": ",m.metric]},m.title))})]})}return p}V.propTypes={title:l.string,instanceCount:l.number,total:l.number,used:l.number,history:l.array,empty:l.node,onHover:l.func,hoverIndex:l.number};V.defaultProps={title:"",instanceCount:null,total:null,used:null,history:[],empty:null,onHover:()=>{},hoverIndex:null};function I({blocklet:n,...g}){const{t:c}=P(),{info:d}=se(),{runtimeHistory:i}=J(),[p,r]=h.useState(null),o=h.useCallback(t=>n.status!=="running"?s.jsx(L,{children:c("blocklet.runtimeInfo.noRunning")}):t.length?null:s.jsx(ee,{children:c("common.empty")}),[n.status,c]),b=h.useCallback(t=>{r(t)},[]);return i.length===0?s.jsx(L,{children:c("blocklet.runtimeInfo.noRunning")}):s.jsxs(le,{component:"div",...g,children:[s.jsxs(C,{className:"page-metrics",container:!0,spacing:5,children:[s.jsx(C,{item:!0,xs:12,sx:{pt:"16px !important"},children:s.jsx(L,{fontSize:"16px",fontWeight:"bold",children:"CPU"})}),i==null?void 0:i.map(t=>{var e,a;return s.jsx(C,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:s.jsx(N,{title:`${t.name} CPU`,empty:o(t.cpu),currentLoad:((e=t.appRuntimeInfo)==null?void 0:e.cpuUsage)||0,cpus:((a=t.appRuntimeInfo)==null?void 0:a.cpus)||[],history:t.cpu,onHover:b,hoverIndex:p,style:{height:150}})},`${t.key}-cpu`)})]}),s.jsxs(C,{className:"page-metrics",container:!0,spacing:5,sx:{mt:1},children:[s.jsx(C,{item:!0,xs:12,sx:{pt:"16px !important"},children:s.jsx(L,{fontSize:"16px",fontWeight:"bold",children:"Memory"})}),i==null?void 0:i.map(t=>{var e,a,j;return s.jsx(C,{item:!0,lg:4,md:6,sm:6,xs:12,sx:{pt:"16px !important"},children:s.jsx(V,{title:`${t.name} Memory`,empty:o(t.memory),total:(e=d.runtimeConfig)!=null&&e.blockletMaxMemoryLimit?R.parseSize(`${d.runtimeConfig.blockletMaxMemoryLimit*(t.key===((a=n==null?void 0:n.meta)==null?void 0:a.did)?i.length-1:1)}MiB`):0,used:((j=t.appRuntimeInfo)==null?void 0:j.memoryUsage)||0,history:t.memory,onHover:b,hoverIndex:p,style:{height:150}})},`${t.key}-memory`)})]})]})}I.propTypes={blocklet:l.object.isRequired,cpuHistory:l.arrayOf(l.shape({date:l.number,value:l.number})),memoryHistory:l.arrayOf(l.shape({date:l.number,value:l.number}))};I.defaultProps={cpuHistory:[],memoryHistory:[]};const le=O(L)``;function ce(){const{t:n,locale:g}=P(),[c,d]=h.useState(6),{blocklet:i,actions:{refreshBlocklet:p}}=J(),r=h.useMemo(()=>{const t=[];return U.forEachBlockletSync(i,(e,{ancestors:a,id:j,level:k})=>{var u;(u=e==null?void 0:e.meta)!=null&&u.did&&e.meta.did!==i.meta.did&&t.push({type:"blocklet",groupId:i.meta.did,groupName:U.getDisplayName(i),id:j,name:U.getDisplayName(e,!0),blocklet:i,component:e,level:k-1>=0?k-1:0,runtimeInfo:e.runtimeInfo,ancestors:a})}),t},[i]);h.useEffect(()=>{p({hours:c});const t=setInterval(()=>{p({hours:c})},1e3*10);return()=>{clearInterval(t)}},[c]);const o=t=>H(Number(t||0),{locale:ne(g)}),b=[{label:n("common.name"),name:"name",options:{customBodyRenderLite(t){const{name:e,component:a,level:j,ancestors:k}=r[t];return s.jsxs(w,{display:"flex",alignItems:"center",pl:j*2,children:[s.jsx(ie,{size:20,blocklet:a,ancestors:k}),s.jsx(w,{ml:1,children:e}),s.jsx(oe,{variant:"pin",style:{marginLeft:8},status:a.status,source:a.source,progress:a.progress})]})}}},{label:n("common.uptime"),name:"runtimeInfo.uptime",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=r[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):o(e==null?void 0:e.uptime)}}},{label:n("blocklet.runtimeInfo.memoryUsage"),name:"runtimeInfo.memoryUsage",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=r[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):_((e==null?void 0:e.memoryUsage)||0)}}},{label:n("blocklet.runtimeInfo.cpuUsage"),name:"runtimeInfo.cpuUsage",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=r[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):`${((e==null?void 0:e.cpuUsage)||0).toFixed(1)}%`}}},{label:n("analytics.runtime"),name:"runtimeInfo.runtime",options:{customBodyRenderLite(t){const{runtimeInfo:e}=r[t];return e!=null&&e.uptime?s.jsxs(w,{display:"flex",alignItems:"center",children:[s.jsx(te,{icon:e!=null&&e.runningDocker?"catppuccin:docker-ignore":"logos:nodejs-icon"}),s.jsx(w,{ml:1,children:e!=null&&e.runningDocker?"Docker":"Nodejs"})]}):null}}},{label:n("blocklet.runtimeInfo.processId"),name:"runtimeInfo.pid",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=r[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):e==null?void 0:e.pid}}},{label:n("blocklet.runtimeInfo.port"),name:"runtimeInfo.port",options:{customBodyRenderLite(t){const{runtimeInfo:e,component:a}=r[t];return!(a!=null&&a.status)||a.status!=="running"?s.jsx(S,{title:n("common.noData"),children:"--"}):e==null?void 0:e.port}}}];return s.jsxs(me,{component:"div",children:[s.jsxs(w,{display:"flex",justifyContent:"space-between",flexDirection:"row",mb:2,children:[s.jsx(L,{component:"h3",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:2,children:n("analytics.trend")}),s.jsx(Z,{size:"small",exclusive:!0,value:c,onChange:(t,e)=>{re(e)&&d(e)},children:[1,3,6,12,24].map(t=>s.jsxs(v,{value:t,children:[t,"H"]},t))})]}),s.jsx(w,{children:s.jsx(I,{blocklet:i})}),s.jsx(w,{mt:3,children:s.jsx(ae,{title:n("analytics.detail"),className:"monitor-table",locale:g,data:r,columns:b,options:{search:!1,download:!1,filter:!1,print:!1,viewColumns:!1,pagination:!1,rowsPerPage:100}})})]})}ce.propTypes={};const me=O(L)``;export{ce as default};
@@ -1 +0,0 @@
1
- import{aX as o}from"./vendor-ux-did-connect-TEE6cGq6.js";const e=o();export{e as b};