@abtnode/blocklet-services 1.16.45-beta-20250609-111118-0d252ebe → 1.16.45-beta-20250612-231219-481217be

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 (217) hide show
  1. package/api/cache.js +36 -21
  2. package/api/libs/connect/session.js +2 -2
  3. package/api/middlewares/proxy-to-daemon.js +6 -2
  4. package/api/routes/blocklet.js +25 -5
  5. package/api/routes/dns-resolver.js +1 -1
  6. package/api/routes/env.js +2 -1
  7. package/api/services/auth/connect/invite.js +1 -1
  8. package/api/services/auth/connect/issue-passport.js +1 -1
  9. package/api/services/auth/connect/verify-destroy.js +3 -6
  10. package/api/services/auth/connect/verify-elevated.js +8 -9
  11. package/api/services/auth/session.js +1 -1
  12. package/api/services/oauth/server.js +2 -1
  13. package/api/socket/channel/did.js +2 -2
  14. package/dist/assets/{AdapterDayjs-BXVfASrK.js → AdapterDayjs-BzjU9O7t.js} +1 -1
  15. package/dist/assets/{ArrowDropDown-Ce8TY3aP.js → ArrowDropDown-CrJjI_sT.js} +1 -1
  16. package/dist/assets/{CheckCircle-M9NlpTm_.js → CheckCircle-BcPSvH2E.js} +1 -1
  17. package/dist/assets/{ChevronLeft-02OWcWpH.js → ChevronLeft-Ch9iK6fF.js} +1 -1
  18. package/dist/assets/{ChevronRight-CB8w0u2n.js → ChevronRight-DclARA5k.js} +1 -1
  19. package/dist/assets/{Community-vE_QnoqV.js → Community-D4mv0jfL.js} +1 -1
  20. package/dist/assets/{DeleteOutline-1-hBNY1U.js → DeleteOutline-CnS2XiM1.js} +1 -1
  21. package/dist/assets/{Done-CcJLRcBY.js → Done-C9LPqADS.js} +1 -1
  22. package/dist/assets/{Download-HHknpEZd.js → Download-D9LfWoxF.js} +1 -1
  23. package/dist/assets/{Edit-hd-cDU5C.js → Edit-rPlryssW.js} +1 -1
  24. package/dist/assets/{EditIcon-DiM9RB8U.js → EditIcon-DfiDnAsm.js} +1 -1
  25. package/dist/assets/{Error-D0rGqAKE.js → Error-q_AhSCeT.js} +1 -1
  26. package/dist/assets/{ExpandLess-Fb-uW6u_.js → ExpandLess-Da2Rv9Ox.js} +1 -1
  27. package/dist/assets/{Google-WGwK551e.js → Google-Buu8u6PW.js} +1 -1
  28. package/dist/assets/{Holiday-BnL2IwX3.js → Holiday-DkzYmdt-.js} +1 -1
  29. package/dist/assets/{Home-DeTVRhMG.js → Home-DkCBzKe9.js} +1 -1
  30. package/dist/assets/{InfoOutlined-CLiL5VeK.js → InfoOutlined-C8ZBPUhD.js} +1 -1
  31. package/dist/assets/{Launch-BwVeOcBz.js → Launch-Nu8TBDKk.js} +1 -1
  32. package/dist/assets/{LaunchOutlined-CPurmWuM.js → LaunchOutlined-DQZ7S23O.js} +1 -1
  33. package/dist/assets/{LockIcon-QnxDGvZv.js → LockIcon-BEG59s5q.js} +1 -1
  34. package/dist/assets/{Meeting-BkjjPbp7.js → Meeting-KSUAdbzW.js} +1 -1
  35. package/dist/assets/{MoreHoriz-9E3q8aHi.js → MoreHoriz-Ba9rYlyz.js} +1 -1
  36. package/dist/assets/{OffSick-D2B01pyN.js → OffSick-B0VcZ-o0.js} +1 -1
  37. package/dist/assets/{PlayArrow-B_ZNrQDa.js → PlayArrow-RVSfCmrB.js} +1 -1
  38. package/dist/assets/{QuestionMarkCircle-BMcwgPWr.js → QuestionMarkCircle-jbhclAfX.js} +1 -1
  39. package/dist/assets/{TuneOutlined-0oMZE8a4.js → TuneOutlined-CwV20zYf.js} +1 -1
  40. package/dist/assets/{ViewList-ColSGL1_.js → ViewList-D1BI4ac9.js} +1 -1
  41. package/dist/assets/{WorkingRemotely-CxoGYC4d.js → WorkingRemotely-5Kw3C-_c.js} +1 -1
  42. package/dist/assets/{access-control-nyeEpwlF.js → access-control-C-kFaf9T.js} +1 -1
  43. package/dist/assets/{actions-DtL6bYnA.js → actions-DYQW2ChM.js} +1 -1
  44. package/dist/assets/{add-component-core-CaE3xcyT.js → add-component-core-UeQfX1b1.js} +37 -37
  45. package/dist/assets/add-resource-BdL-oJxe.js +1 -0
  46. package/dist/assets/{addon-e-JO0VU3.js → addon-DMedfvRj.js} +1 -1
  47. package/dist/assets/{advanced-yrYBgA5T.js → advanced-BZZToP_j.js} +2 -2
  48. package/dist/assets/api-87p2GGd0.js +1 -0
  49. package/dist/assets/{appearance-DB1QowgL.js → appearance-CYop22yw.js} +1 -1
  50. package/dist/assets/ar-D9QEDjY-.js +7 -0
  51. package/dist/assets/{audit-logs-BamIXrWh.js → audit-logs-BtBk6uAY.js} +3 -3
  52. package/dist/assets/{authorize-B9LP0G9q.js → authorize-CQZkUNyV.js} +1 -1
  53. package/dist/assets/{base-chart-BYonGucU.js → base-chart-C2FJuVG1.js} +1 -1
  54. package/dist/assets/{base32-CmYq1ikq.js → base32-DEjena1X.js} +1 -1
  55. package/dist/assets/{branding-OlEgtAUT.js → branding-7ppDxFZf.js} +2 -2
  56. package/dist/assets/branding-gXMozCeI.js +54 -0
  57. package/dist/assets/{bundle-avatar-C41ZXEbR.js → bundle-avatar-B5-ypzmO.js} +1 -1
  58. package/dist/assets/button-YPMo8IwK.js +1 -0
  59. package/dist/assets/{click-to-copy-BUVqg1RQ.js → click-to-copy-BMX2P5UB.js} +1 -1
  60. package/dist/assets/{cloneDeep-ro06l5HL.js → cloneDeep-Jl_OPbSo.js} +1 -1
  61. package/dist/assets/{collapse--nd2JDBL.js → collapse-9taxUXec.js} +1 -1
  62. package/dist/assets/{complete-gnnvUqGU.js → complete-C8T0HN-B.js} +1 -1
  63. package/dist/assets/{component-ClWADDCr.js → component-D6hOmRzO.js} +1 -1
  64. package/dist/assets/{config-2Sy6fCTJ.js → config-DcwlSddI.js} +1 -1
  65. package/dist/assets/{config-QpBBpp7d.js → config-Sq1CUTiJ.js} +1 -1
  66. package/dist/assets/{config-navigation-CsVa3Hf0.js → config-navigation-IR_yUgmM.js} +6 -6
  67. package/dist/assets/{config-space-B39Ur9Mf.js → config-space-C3fS58cn.js} +1 -1
  68. package/dist/assets/{confirm-Bay3BcpN.js → confirm-DApmnpvm.js} +1 -1
  69. package/dist/assets/{connect-T4cAO9om.js → connect-BF4GoRL-.js} +1 -1
  70. package/dist/assets/connect-Bf8y7fMm.js +5 -0
  71. package/dist/assets/{connect-to-Dac7orQh.js → connect-to-Bwfa2hMr.js} +1 -1
  72. package/dist/assets/{content-layout-DuPlKBe3.js → content-layout-BC2QkTYi.js} +1 -1
  73. package/dist/assets/dashboard-B2X6c8E8.js +239 -0
  74. package/dist/assets/{de-Dv_ApqsF.js → de-BOa43YBF.js} +2 -2
  75. package/dist/assets/{delete-confirm-B1F5wKdb.js → delete-confirm-BsEqJQRY.js} +1 -1
  76. package/dist/assets/{did-address-bJAfhuZx.js → did-address-L54dTMrT.js} +1 -1
  77. package/dist/assets/domain-BGh0GDuZ.js +9 -0
  78. package/dist/assets/{domain-action-card-yyZstsWL.js → domain-action-card-DWqnvzry.js} +2 -2
  79. package/dist/assets/domains-CdwErmIF.js +1 -0
  80. package/dist/assets/dot-iw3hN9HL.js +7 -0
  81. package/dist/assets/{email-CYOorZ7K.js → email-By_nAv9m.js} +1 -1
  82. package/dist/assets/{empty-spinner-DSwpCqdd.js → empty-spinner-BHwHZpq-.js} +1 -1
  83. package/dist/assets/es-A3ma-OJp.js +9 -0
  84. package/dist/assets/{exchange-passport-xHfEBrd8.js → exchange-passport-BsgMfRJS.js} +1 -1
  85. package/dist/assets/fr-I3xKp6I5.js +7 -0
  86. package/dist/assets/{fuel-CtSAk9S3.js → fuel-RMmgm9AQ.js} +1 -1
  87. package/dist/assets/{gen-access-key-CoOxXtqa.js → gen-access-key-4teK8Dys.js} +1 -1
  88. package/dist/assets/{get-safe-url-BWDUV79Q.js → get-safe-url-B8xlSMyD.js} +1 -1
  89. package/dist/assets/{get-safe-url-CwT4-jkw.js → get-safe-url-t1C0E5Ux.js} +1 -1
  90. package/dist/assets/{hi-Dqbq8i5Y.js → hi-DacRhM8A.js} +1 -1
  91. package/dist/assets/{home-D1kBU1RC.js → home-CmHUXg5q.js} +1 -1
  92. package/dist/assets/{id-Bxr8o3Uo.js → id-B7LQAHL7.js} +3 -3
  93. package/dist/assets/{iframe-DsIqy16E.js → iframe-Dj9NLHp2.js} +1 -1
  94. package/dist/assets/{index-BoQJXOtZ.js → index-B2NkqENf.js} +1 -1
  95. package/dist/assets/{index-BpvW-cUy.js → index-BCtTVvHw.js} +1 -1
  96. package/dist/assets/{index-Cx-ESLe9.js → index-Bb7iSrGO.js} +4 -4
  97. package/dist/assets/{index-CTfYMqG2.js → index-Be8E3hiQ.js} +5 -5
  98. package/dist/assets/{index-DQl2QJod.js → index-BeE0KRva.js} +2 -2
  99. package/dist/assets/{index-DWgnwzKO.js → index-Bv7OAPJU.js} +1 -1
  100. package/dist/assets/{index-BnR8uU0R.js → index-BzZuK-66.js} +1 -1
  101. package/dist/assets/{index-CyS4mBmV.js → index-C8uNNoMb.js} +6 -6
  102. package/dist/assets/{index-CI4cLtBE.js → index-CCOwwQoc.js} +1 -1
  103. package/dist/assets/{index-DMSe2Qjx.js → index-CJQbYw9E.js} +2 -2
  104. package/dist/assets/{index-Dntq1ezd.js → index-CKY4HT0P.js} +1 -1
  105. package/dist/assets/{index-B18R5SlV.js → index-CMYalRl2.js} +7 -7
  106. package/dist/assets/{index-BXjOxZPH.js → index-CTlzm-Mc.js} +1 -1
  107. package/dist/assets/{index-8kcb4Nom.js → index-Cs3-IS09.js} +1 -1
  108. package/dist/assets/{index-DU8cx_m6.js → index-DEZojGsm.js} +1 -1
  109. package/dist/assets/{index-B7qZ5OdP.js → index-DXeoVV9Y.js} +11 -11
  110. package/dist/assets/{index-B1fP-8KR.js → index-DaM-GRtb.js} +2 -2
  111. package/dist/assets/{index-DaMn1fo9.js → index-Dfw2EDXA.js} +10 -10
  112. package/dist/assets/{index-DO-a7P7z.js → index-Dgsq6V-N.js} +1 -1
  113. package/dist/assets/{index-B4wY8GsU.js → index-DtZg53T9.js} +3 -3
  114. package/dist/assets/{index-j6UAnd8n.js → index-F85lIJcp.js} +1 -1
  115. package/dist/assets/{index-CY9xLy04.js → index-Inc_KF9k.js} +3 -3
  116. package/dist/assets/{index-CZgWTJXl.js → index-Mzv6hCex.js} +1 -1
  117. package/dist/assets/{index-Brd3-BIC.js → index-NnUiYa0L.js} +1 -1
  118. package/dist/assets/{index-C5vFhD_w.js → index-SX_KWrQh.js} +1 -1
  119. package/dist/assets/{invitation-BsuZg3B2.js → invitation-Ck_kq3Tr.js} +3 -3
  120. package/dist/assets/{invite-YNiMO-nB.js → invite-89aeW4Ho.js} +1 -1
  121. package/dist/assets/{issue-passport-2R7-XHuR.js → issue-passport-4udVYVdq.js} +1 -1
  122. package/dist/assets/{item-DHMVgmIa.js → item-D0U5vYXJ.js} +1 -1
  123. package/dist/assets/{ja-CJfcqkdo.js → ja-DRQ4Eecl.js} +3 -1
  124. package/dist/assets/{ko-BxAazRix.js → ko-CzL3UzwL.js} +3 -1
  125. package/dist/assets/{launch-result-message-DNgJY11G.js → launch-result-message-AharZGq2.js} +1 -1
  126. package/dist/assets/{layout-BnunMkuP.js → layout-CQb1lhEv.js} +1 -1
  127. package/dist/assets/{list-h4Ed_myi.js → list-BOdwWlS0.js} +2 -2
  128. package/dist/assets/{list-DZwgo-zf.js → list-KVxvPXZu.js} +6 -6
  129. package/dist/assets/{list-header-D976e09p.js → list-header-C7gle0n0.js} +1 -1
  130. package/dist/assets/localization-OxVxEhoS.js +1 -0
  131. package/dist/assets/{log-6M_J_pon.js → log-DOIh9luu.js} +1 -1
  132. package/dist/assets/{logger-KwxABgLK.js → logger-Dhaq1LDX.js} +1 -1
  133. package/dist/assets/{login-C2ILZhOf.js → login-J6Bsrh3B.js} +1 -1
  134. package/dist/assets/{login-oauth-callback-Dt9V4GRH.js → login-oauth-callback-BRmEibAb.js} +1 -1
  135. package/dist/assets/{logo-uploader-Dhh7Un4G.js → logo-uploader-Dzebv-rF.js} +3 -3
  136. package/dist/assets/{lost-passport-JODD9Yck.js → lost-passport-p5ZuXjnG.js} +2 -2
  137. package/dist/assets/{omit-O1pUD7ku.js → omit-BlzmxIB5.js} +1 -1
  138. package/dist/assets/{open-window-Dn44K3ur.js → open-window-Byi7CkW_.js} +1 -1
  139. package/dist/assets/{overview-Bjj9JLCV.js → overview-ClOSCvvh.js} +1 -1
  140. package/dist/assets/{page-header-JH9JWGMg.js → page-header-C_KAJILy.js} +1 -1
  141. package/dist/assets/{passport-item-CoNRdRpk.js → passport-item-Du8-xENr.js} +1 -1
  142. package/dist/assets/{permission-B7ZHEOJv.js → permission-ClRym5FB.js} +1 -1
  143. package/dist/assets/preferences-B6Y0XpLo.js +1 -0
  144. package/dist/assets/profile-embed-C_hd_hMh.js +1 -0
  145. package/dist/assets/{pt-FpFCyI6v.js → pt-CHKumXYv.js} +3 -3
  146. package/dist/assets/publish-resource-kHaYkbDE.js +1 -0
  147. package/dist/assets/{react-beautiful-dnd.esm-DCPrD7-r.js → react-beautiful-dnd.esm-CHsohizU.js} +1 -1
  148. package/dist/assets/{ru-BuGIFp9h.js → ru-CvkEKhgU.js} +1 -1
  149. package/dist/assets/{runtime-1mGYl_p2.js → runtime-D5P_2uNM.js} +1 -1
  150. package/dist/assets/{sanitize-DbZs1H_T.js → sanitize-B18rcrOf.js} +1 -1
  151. package/dist/assets/sdk-CbugbTkF.js +1 -0
  152. package/dist/assets/search-4YYphs0l.js +1 -0
  153. package/dist/assets/section-BDMQAX_r.js +41 -0
  154. package/dist/assets/{security-C2l4SCkx.js → security-CXewZHyS.js} +1 -1
  155. package/dist/assets/{session-1k8BRnYA.js → session-Bkvl2PSP.js} +1 -1
  156. package/dist/assets/setup-TPtYDnBB.js +30 -0
  157. package/dist/assets/{shorten-label-CTSJhlwO.js → shorten-label-BQvbtscf.js} +1 -1
  158. package/dist/assets/{simple-select-cKQxVH3U.js → simple-select-0cjVFuay.js} +1 -1
  159. package/dist/assets/{slicedToArray-CRrLoxQ4.js → slicedToArray-DFQjSbCD.js} +1 -1
  160. package/dist/assets/{spaces-CpSu6mVL.js → spaces-C1lh7et6.js} +1 -1
  161. package/dist/assets/{start-BotjXVuZ.js → start-BgSlMXsE.js} +1 -1
  162. package/dist/assets/{starting-progress-a7uoLG-L.js → starting-progress-BikYigPA.js} +1 -1
  163. package/dist/assets/{status-DIJ9lK3F.js → status-DDvFiBxA.js} +1 -1
  164. package/dist/assets/{step-actions-DLZOEVat.js → step-actions-_23FIn8v.js} +1 -1
  165. package/dist/assets/{studio-Cua13-ul.js → studio-Db5oA_Tx.js} +1 -1
  166. package/dist/assets/{switch-control-CzaI2YNK.js → switch-control-BYqb8MZf.js} +1 -1
  167. package/dist/assets/{table-tips-Czrj7r52.js → table-tips-BW6G2sKO.js} +1 -1
  168. package/dist/assets/{th-BafLD2wR.js → th-B2BUfjNJ.js} +1 -1
  169. package/dist/assets/{traffic-fPCLOWN3.js → traffic-CUSLm0PX.js} +1 -1
  170. package/dist/assets/{transfer-BqCYXmCB.js → transfer-CSsXAviu.js} +1 -1
  171. package/dist/assets/{unsubscribe-BE77Etc2.js → unsubscribe-BA46-fTa.js} +1 -1
  172. package/dist/assets/{use-blocklet-logo-DGSQQmh2.js → use-blocklet-logo-CTCMbFiC.js} +1 -1
  173. package/dist/assets/{use-mobile-CXU9YBvX.js → use-mobile-CtTQsfXN.js} +1 -1
  174. package/dist/assets/{use-mobile-CiFFAdJf.js → use-mobile-DwzRjjku.js} +1 -1
  175. package/dist/assets/{use-server-logo-BbYHFDuK.js → use-server-logo-UTr-CyJD.js} +1 -1
  176. package/dist/assets/useAsync-DVHp96Uu.js +1 -0
  177. package/dist/assets/{useLocalStorage-BF3BqN1O.js → useLocalStorage-DyVGBDlt.js} +1 -1
  178. package/dist/assets/user-center-Cap4mg5H.js +77 -0
  179. package/dist/assets/{util-xXGeezrD.js → util-DlS4tWs9.js} +1 -1
  180. package/dist/assets/{util-CS4PqVkK.js → util-M3UFXQFT.js} +1 -1
  181. package/dist/assets/{vendor-arcblock-B4hgrXYM.js → vendor-arcblock-DiSm3oUX.js} +7 -7
  182. package/dist/assets/{vendor-hooks-BCm626KH.js → vendor-hooks-BFlOfe0M.js} +1 -1
  183. package/dist/assets/{vendor-mui-core-wlbruq2I.js → vendor-mui-core-Bq8gXTan.js} +1 -1
  184. package/dist/assets/{vendor-mui-x-BKgL6hAa.js → vendor-mui-x-1nqAyytV.js} +1 -1
  185. package/dist/assets/vendor-utils-BotmZdBm.js +208 -0
  186. package/dist/assets/{vendor-ux-did-connect-CX7qG3_M.js → vendor-ux-did-connect-DVX9lQ8a.js} +66 -66
  187. package/dist/assets/{vi-BMZxxaJ2.js → vi-BykmwIAT.js} +3 -3
  188. package/dist/assets/wrap-locale-B8EvOR-l.js +1 -0
  189. package/dist/assets/{zh-DusA4qAT.js → zh-CbCaOuAd.js} +3 -1
  190. package/dist/assets/{zh-tw-BO-QhSNP.js → zh-tw-C9JfiCVV.js} +3 -1
  191. package/dist/index.html +6 -6
  192. package/dist/service-worker.js +1 -1
  193. package/package.json +33 -33
  194. package/dist/assets/add-resource-CG8u25Lv.js +0 -1
  195. package/dist/assets/api-CQoRx33p.js +0 -1
  196. package/dist/assets/ar-0ZkmCCuq.js +0 -7
  197. package/dist/assets/branding-C2Dm2Z1c.js +0 -54
  198. package/dist/assets/button-C0Vra3Ak.js +0 -1
  199. package/dist/assets/connect-B77rXeVL.js +0 -5
  200. package/dist/assets/dashboard-k0XcV2m5.js +0 -239
  201. package/dist/assets/domain-CEwb0Lyz.js +0 -9
  202. package/dist/assets/domains-CRt4uYYF.js +0 -1
  203. package/dist/assets/dot-DR7_m3Np.js +0 -7
  204. package/dist/assets/es-D_uF0siv.js +0 -7
  205. package/dist/assets/fr-DVFSQfDp.js +0 -7
  206. package/dist/assets/localization-BNjdHo-G.js +0 -1
  207. package/dist/assets/preferences-DUSp_pAb.js +0 -1
  208. package/dist/assets/profile-embed-BIjwkrGW.js +0 -1
  209. package/dist/assets/publish-resource-AW43Z8jj.js +0 -1
  210. package/dist/assets/sdk-BJQcHaGO.js +0 -1
  211. package/dist/assets/section-Bb547IGJ.js +0 -41
  212. package/dist/assets/setup-DxzbFXmd.js +0 -30
  213. package/dist/assets/useAsync-BMCqtJH2.js +0 -1
  214. package/dist/assets/useAsync-CBEJDwr0.js +0 -1
  215. package/dist/assets/user-center-olJmefSX.js +0 -77
  216. package/dist/assets/vendor-utils-B3iZkn2R.js +0 -208
  217. package/dist/assets/wrap-locale-Byq7otyk.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./vendor-react-DEoibe3W.js";import{j as w,b6 as x}from"./vendor-mui-core-wlbruq2I.js";import{b as G,a9 as B}from"./vendor-utils-B3iZkn2R.js";import{c as P}from"./vendor-arcblock-B4hgrXYM.js";import{i as k}from"./vendor-hooks-BCm626KH.js";import{a3 as L}from"./vendor-ux-did-connect-CX7qG3_M.js";import{G as u,D as T}from"./index-B18R5SlV.js";import{g as b,a as h,b as A}from"./spaces-CpSu6mVL.js";function N(){const[r,c]=e.useState(null),{blocklet:a}=u();return e.useEffect(()=>{c(b(a))},[a]),{storageEndpoint:r}}const l=e.createContext({}),{Provider:_,Consumer:F}=l;function f({children:r}){const[c,a]=e.useState(!1),[o,n]=e.useState(null),{blocklet:d,actions:{refreshBlocklet:i}}=u(),{storageEndpoint:s}=N(),{api:m}=T();k(async()=>{try{if(a(!0),G(s)){n(null);return}const t=await h(s);n(t)}catch(t){console.error(t),L.error(t.message)}finally{a(!1)}},[s]);const y=()=>{n(null),i()},E=async t=>{n(t),await p(t.endpoint),i()},p=async t=>{await m.configBlocklet({input:{did:[d.meta.did],configs:[{key:P.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}),i()};e.useEffect(()=>{async function t(){if(!o)return;const S=await A(o.endpoint,o.name),C=B(o,{name:S});n(C)}t()},[]);const g=!!(s&&o);return w.jsx(_,{value:{loading:c,spaceGateway:o,deleteSpaceGateway:y,updateSpaceGateway:E,storageEndpoint:s,settingStorageEndpoint:p,hasStorageEndpoint:g},children:r})}f.propTypes={children:x.node.isRequired};f.defaultProps={};function U(){return e.useContext(l)}export{f as C,U as u};
1
+ import{r as e}from"./vendor-react-DEoibe3W.js";import{j as w,b5 as x}from"./vendor-mui-core-Bq8gXTan.js";import{b as G,a9 as B}from"./vendor-utils-BotmZdBm.js";import{c as P}from"./vendor-arcblock-DiSm3oUX.js";import{i as k}from"./vendor-hooks-BFlOfe0M.js";import{a3 as L}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{G as u,D as T}from"./index-CMYalRl2.js";import{g as b,a as h,b as A}from"./spaces-C1lh7et6.js";function N(){const[r,c]=e.useState(null),{blocklet:a}=u();return e.useEffect(()=>{c(b(a))},[a]),{storageEndpoint:r}}const l=e.createContext({}),{Provider:_,Consumer:F}=l;function f({children:r}){const[c,a]=e.useState(!1),[o,n]=e.useState(null),{blocklet:d,actions:{refreshBlocklet:i}}=u(),{storageEndpoint:s}=N(),{api:m}=T();k(async()=>{try{if(a(!0),G(s)){n(null);return}const t=await h(s);n(t)}catch(t){console.error(t),L.error(t.message)}finally{a(!1)}},[s]);const y=()=>{n(null),i()},E=async t=>{n(t),await p(t.endpoint),i()},p=async t=>{await m.configBlocklet({input:{did:[d.meta.did],configs:[{key:P.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}),i()};e.useEffect(()=>{async function t(){if(!o)return;const S=await A(o.endpoint,o.name),C=B(o,{name:S});n(C)}t()},[]);const g=!!(s&&o);return w.jsx(_,{value:{loading:c,spaceGateway:o,deleteSpaceGateway:y,updateSpaceGateway:E,storageEndpoint:s,settingStorageEndpoint:p,hasStorageEndpoint:g},children:r})}f.propTypes={children:x.node.isRequired};f.defaultProps={};function U(){return e.useContext(l)}export{f as C,U as u};
@@ -1,4 +1,4 @@
1
- import{r as a}from"./vendor-react-DEoibe3W.js";import{bJ as L,v as x,e as _,j as n,aj as F,t as H,by as J,ak as N,z as O,ab as Q,H as o,ah as G,D as I}from"./vendor-mui-core-wlbruq2I.js";import{a as K,B as g}from"./vendor-ux-did-connect-CX7qG3_M.js";import"./index-B18R5SlV.js";import{f as U}from"./index-8eXqqyHQ.js";function V(){const e=L();return{minWidth:x(e.breakpoints.down("md"))?300:e.breakpoints.values.sm}}function C({title:e,description:t,showCancel:l,showConfirm:b,cancel:j,confirm:k,color:w,params:D,onCancel:S,onConfirm:P,loading:c,displayError:T,children:E,...v}){const[r,B]=a.useState(D),[$,d]=a.useState(!0),[m,p]=a.useState(!1),[u,f]=a.useState(""),{t:R}=K(),W=_(),h=async s=>{if(typeof s=="function"){p(!0);try{if(await s(r)===!1)return;d(!1)}catch(i){f(U(i)),console.error(i)}finally{p(!1)}}else d(!1)},q=typeof e=="function"?e():e,M=typeof t=="function"?t(r,B,f):t,z=x(W.breakpoints.down("md")),A=s=>{s.stopPropagation()},{minWidth:y}=V();return n.jsxs(X,{onClick:A,fullScreen:z,open:$,style:{minWidth:y},...v,children:[n.jsx(F,{children:q}),n.jsxs(H,{style:{minWidth:y},children:[n.jsx(J,{component:"div",children:M}),!!u&&T&&n.jsx(N,{severity:"error",style:{width:"100%",marginTop:8},children:u}),E]}),n.jsxs(O,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[l&&n.jsx(g,{onClick:s=>{s.stopPropagation(),h(S)},color:"inherit","data-cy":"cancel-confirm-dialog",children:j||R("common.cancel")}),b&&n.jsxs(g,{onClick:s=>{s.stopPropagation(),h(P)},color:w,disabled:r.__disableConfirm||m||c,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(m||c)&&n.jsx(Q,{size:16,sx:{mr:1}}),k]})]})]})}C.propTypes={title:o.any.isRequired,description:o.any.isRequired,showCancel:o.bool,showConfirm:o.bool,cancel:o.string,color:o.string,confirm:o.string,params:o.object,onCancel:o.func,onConfirm:o.func.isRequired,loading:o.bool,displayError:o.bool,children:o.any};C.defaultProps={children:void 0,onCancel:()=>{},showCancel:!0,showConfirm:!0,cancel:"",confirm:"Confirm",color:"error",params:{},loading:!1,displayError:!0};const X=G(I)`
1
+ import{r as a}from"./vendor-react-DEoibe3W.js";import{bI as L,v as x,e as _,j as n,aj as F,t as H,bx as I,ak as N,z as O,ab as Q,H as o,ah as G,D as J}from"./vendor-mui-core-Bq8gXTan.js";import{a as K,B as y}from"./vendor-ux-did-connect-DVX9lQ8a.js";import"./index-CMYalRl2.js";import{f as U}from"./index-8eXqqyHQ.js";function V(){const e=L();return{minWidth:x(e.breakpoints.down("md"))?300:e.breakpoints.values.sm}}function C({title:e,description:t,showCancel:l,showConfirm:b,cancel:j,confirm:k,color:w,params:D,onCancel:S,onConfirm:P,loading:c,displayError:T,children:E,...v}){const[r,B]=a.useState(D),[$,d]=a.useState(!0),[m,p]=a.useState(!1),[u,f]=a.useState(""),{t:R}=K(),W=_(),h=async s=>{if(typeof s=="function"){p(!0);try{if(await s(r)===!1)return;d(!1)}catch(i){f(U(i)),console.error(i)}finally{p(!1)}}else d(!1)},q=typeof e=="function"?e():e,M=typeof t=="function"?t(r,B,f):t,z=x(W.breakpoints.down("md")),A=s=>{s.stopPropagation()},{minWidth:g}=V();return n.jsxs(X,{onClick:A,fullScreen:z,open:$,style:{minWidth:g},...v,children:[n.jsx(F,{children:q}),n.jsxs(H,{style:{minWidth:g},children:[n.jsx(I,{component:"div",children:M}),!!u&&T&&n.jsx(N,{severity:"error",style:{width:"100%",marginTop:8},children:u}),E]}),n.jsxs(O,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[l&&n.jsx(y,{onClick:s=>{s.stopPropagation(),h(S)},color:"inherit","data-cy":"cancel-confirm-dialog",children:j||R("common.cancel")}),b&&n.jsxs(y,{onClick:s=>{s.stopPropagation(),h(P)},color:w,disabled:r.__disableConfirm||m||c,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(m||c)&&n.jsx(Q,{size:16,sx:{mr:1}}),k]})]})]})}C.propTypes={title:o.any.isRequired,description:o.any.isRequired,showCancel:o.bool,showConfirm:o.bool,cancel:o.string,color:o.string,confirm:o.string,params:o.object,onCancel:o.func,onConfirm:o.func.isRequired,loading:o.bool,displayError:o.bool,children:o.any};C.defaultProps={children:void 0,onCancel:()=>{},showCancel:!0,showConfirm:!0,cancel:"",confirm:"Confirm",color:"error",params:{},loading:!1,displayError:!0};const X=G(J)`
2
2
  .delete-actions .Mui-disabled {
3
3
  color: ${({theme:e})=>`${e.palette.text.primary} !important`};
4
4
  box-shadow: none;
@@ -1 +1 @@
1
- import{e as Y,j as t,aa as u,v as q,ab as Z,a3 as ee,y as ne}from"./vendor-mui-core-wlbruq2I.js";import{f as se,h as oe,r as S,L as te}from"./vendor-react-DEoibe3W.js";import{a as re,aY as ae,p as ce,b4 as ie,b5 as le,F as de,b6 as pe,b3 as me,k as ue,b7 as fe,a3 as k,a8 as ge}from"./vendor-ux-did-connect-CX7qG3_M.js";import{b as he,u as x,m as we,s as ke}from"./vendor-hooks-BCm626KH.js";import{u as xe}from"./use-passport-id-B-b-_oYF.js";import{H as U}from"./vendor-arcblock-B4hgrXYM.js";import{c as ve,I as be,z as Ce,A as Te,J as _e,ae as Ie,af as ye}from"./vendor-utils-B3iZkn2R.js";import{g as E}from"./get-safe-url-BWDUV79Q.js";import{u as Le,p as P}from"./index-B18R5SlV.js";import{d as p}from"./logger-KwxABgLK.js";import"./lottie-web-jYmAQWuC.js";const j="authorization_response",De=me(),Se="blocklet:onLogin",f=new BroadcastChannel(Se);function Fe(){const{getPassportId:R}=xe(),{session:M,connectApi:N}=Le(),{t:a,locale:O}=re(),A=se(),[l]=oe(),{encrypt:B}=ae(),H=Y(),v=ce();let c={};try{c=JSON.parse(decodeURIComponent(ie(l.get("params"))))}catch(s){console.error("parse connect params failed",s)}ve(l.get("popup"));const{action:m="login",passkeyBehavior:W="both",extraParams:d={},messages:F,...g}=c;S.useEffect(()=>{d.inviter&&window.localStorage.setItem("inviter",d.inviter)},[d.inviter]);const i=l.get("redirect"),b=l.get("opener"),h=l.get("_ek_");d.passportId=R(),m==="login"&&be(g.forceConnected)&&(g.forceConnected=!1);const w=s=>h?B(JSON.stringify(s),h):s,C=S.useMemo(()=>i||!window.opener?"redirect":"popup",[i]),T=async s=>{const e=await De.federated.getTrustedDomains();if(!b){e.forEach(n=>{window.opener.postMessage(s,Ie(n)),window.opener.postMessage(s,ye(n))});return}const o=new URL(b);if(!e.includes(o.hostname))throw k.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(s,o.origin)},_=({encrypted:s=!0,...e},o,n)=>{p("connect page onSuccess",{encrypted:s,result:e,options:n}),s&&(e.sessionToken&&(e.sessionToken=o(e.sessionToken)),e.refreshToken&&(e.refreshToken=o(e.refreshToken)),e.visitorId&&(e.visitorId=o(e.visitorId)),p("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const L={type:j,response:e,options:n};({redirect:()=>{p("connect page onSuccess redirect",e),setTimeout(()=>{if(i){const D=decodeURIComponent(i),r=P(D);h&&r.searchParams.set("encrypted",!0),e.sessionToken&&r.searchParams.set("sessionToken",w(e.sessionToken)),e.refreshToken&&r.searchParams.set("refreshToken",w(e.refreshToken)),e.visitorId&&r.searchParams.set("visitorId",w(e.visitorId)),n!=null&&n.connected_did&&r.searchParams.set("connected_did",n.connected_did),n!=null&&n.connected_pk&&r.searchParams.set("connected_pk",n.connected_pk),n!=null&&n.connected_app&&r.searchParams.set("connected_app",n.connected_app),n!=null&&n.connected_wallet_os&&r.searchParams.set("connected_wallet_os",n.connected_wallet_os),n!=null&&n.saveConnect&&r.searchParams.set("saveConnect",n.saveConnect),f.postMessage({..._e(e,["sessionToken","refreshToken","visitorId"])}),ge(D)?window.location.replace(E(r.href,{allowDomains:null})):A(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},50)},popup:async()=>{p("connect page onSuccess popup",L),await T(L),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[C]()},z=s=>{const e={type:j,error:s.message,errorDescription:s.message};p("connect page onError",{res:e}),{redirect:()=>{k.error(s.message)},popup:()=>{T(e)}}[C]()},K=he(()=>{var e;if(m!=="login")return null;const s=((e=window.blocklet)==null?void 0:e.trustedFactories)||[];return(s==null?void 0:s.length)>0?t.jsxs(u,{children:[a("exchangePassport.tooltip1"),t.jsx(u,{component:te,reloadDocument:!0,to:Ce(Te(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:i||"/"}),sx:{color:le.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),t.jsx(u,{component:"ul",sx:{pl:1.5},children:s.map(o=>t.jsx(u,{component:"li",children:o},o))})]}):null},[m]),$=x(async()=>{if(!i)return!0;let s;try{s=new URL(i)}catch{return!1}let e;try{e=new URL(c==null?void 0:c.baseUrl)}catch{try{e=new URL(c==null?void 0:c.prefix)}catch(o){console.error("baseUrl and prefix are both invalid",o)}}if(e){let o=[];if(e.origin===window.location.origin)o=window.blocklet.domainAliases||[];else{const n=await fe(e.origin);o=(n==null?void 0:n.domainAliases)||[]}if(!o.includes(s.hostname))return k.error(a("login.invalidRedirectUrl")),!1}return!0}),I=x(()=>{const s=decodeURIComponent(i),e=P(s);window.location.replace(E(e.href,{allowDomains:null}))}),J=!0,Q=!0,G=q(s=>s.breakpoints.down("lg")),y=x(async()=>{await $()&&J&&(window.temporaryDIDConnectOnSuccess=(e,o)=>{_(e,o,{saveConnect:!0})},setTimeout(()=>{var e;N.open({locale:O,action:m,passkeyBehavior:W,extraParams:d,...g,className:"connect",popup:!0,messages:F||{title:a("login.connect.title"),scan:a("login.connect.scan"),confirm:a("login.connect.confirm"),success:a("login.connect.success")},extraContent:K,useSocket:!0,allowWallet:["1","true",void 0,null].includes((e=globalThis.blocklet)==null?void 0:e.DID_CONNECT_ALLOW_WALLET),onSuccess:_,onError:z,hideCloseButton:Q})}))});if(we(()=>{y(),f.addEventListener("message",I)}),ke(()=>{delete window.temporaryDIDConnectOnSuccess,f.removeEventListener("message",I),f.close()}),M.loading)return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsx("title",{children:"DID Connect"})}),t.jsx(de,{children:t.jsx(Z,{})})]});const V=globalThis.blocklet.appName,X=globalThis.blocklet.appDescription;return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),G&&!v.arcSphere?t.jsx(ee,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):t.jsx(pe,{did:globalThis.blocklet.appPid,title:V,description:X,actions:v.arcSphere?null:t.jsx(ne,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{Fe as default};
1
+ import{e as Y,j as t,aa as u,v as q,ab as Z,a3 as ee,y as ne}from"./vendor-mui-core-Bq8gXTan.js";import{f as se,h as oe,r as S,L as te}from"./vendor-react-DEoibe3W.js";import{a as re,aY as ae,p as ce,b4 as ie,b5 as le,F as de,b6 as pe,b3 as me,k as ue,b7 as fe,a3 as k,a8 as ge}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{b as he,u as x,m as we,s as ke}from"./vendor-hooks-BFlOfe0M.js";import{u as xe}from"./use-passport-id-B-b-_oYF.js";import{H as U}from"./vendor-arcblock-DiSm3oUX.js";import{c as ve,I as be,z as Ce,A as Te,J as _e,ae as Ie,af as ye}from"./vendor-utils-BotmZdBm.js";import{g as E}from"./get-safe-url-t1C0E5Ux.js";import{u as Le,p as P}from"./index-CMYalRl2.js";import{d as p}from"./logger-Dhaq1LDX.js";import"./lottie-web-jYmAQWuC.js";const j="authorization_response",De=me(),Se="blocklet:onLogin",f=new BroadcastChannel(Se);function Fe(){const{getPassportId:R}=xe(),{session:M,connectApi:N}=Le(),{t:a,locale:O}=re(),A=se(),[l]=oe(),{encrypt:B}=ae(),H=Y(),v=ce();let c={};try{c=JSON.parse(decodeURIComponent(ie(l.get("params"))))}catch(s){console.error("parse connect params failed",s)}ve(l.get("popup"));const{action:m="login",passkeyBehavior:W="both",extraParams:d={},messages:F,...g}=c;S.useEffect(()=>{d.inviter&&window.localStorage.setItem("inviter",d.inviter)},[d.inviter]);const i=l.get("redirect"),b=l.get("opener"),h=l.get("_ek_");d.passportId=R(),m==="login"&&be(g.forceConnected)&&(g.forceConnected=!1);const w=s=>h?B(JSON.stringify(s),h):s,C=S.useMemo(()=>i||!window.opener?"redirect":"popup",[i]),T=async s=>{const e=await De.federated.getTrustedDomains();if(!b){e.forEach(n=>{window.opener.postMessage(s,Ie(n)),window.opener.postMessage(s,ye(n))});return}const o=new URL(b);if(!e.includes(o.hostname))throw k.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(s,o.origin)},_=({encrypted:s=!0,...e},o,n)=>{p("connect page onSuccess",{encrypted:s,result:e,options:n}),s&&(e.sessionToken&&(e.sessionToken=o(e.sessionToken)),e.refreshToken&&(e.refreshToken=o(e.refreshToken)),e.visitorId&&(e.visitorId=o(e.visitorId)),p("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const L={type:j,response:e,options:n};({redirect:()=>{p("connect page onSuccess redirect",e),setTimeout(()=>{if(i){const D=decodeURIComponent(i),r=P(D);h&&r.searchParams.set("encrypted",!0),e.sessionToken&&r.searchParams.set("sessionToken",w(e.sessionToken)),e.refreshToken&&r.searchParams.set("refreshToken",w(e.refreshToken)),e.visitorId&&r.searchParams.set("visitorId",w(e.visitorId)),n!=null&&n.connected_did&&r.searchParams.set("connected_did",n.connected_did),n!=null&&n.connected_pk&&r.searchParams.set("connected_pk",n.connected_pk),n!=null&&n.connected_app&&r.searchParams.set("connected_app",n.connected_app),n!=null&&n.connected_wallet_os&&r.searchParams.set("connected_wallet_os",n.connected_wallet_os),n!=null&&n.saveConnect&&r.searchParams.set("saveConnect",n.saveConnect),f.postMessage({..._e(e,["sessionToken","refreshToken","visitorId"])}),ge(D)?window.location.replace(E(r.href,{allowDomains:null})):A(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},50)},popup:async()=>{p("connect page onSuccess popup",L),await T(L),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[C]()},z=s=>{const e={type:j,error:s.message,errorDescription:s.message};p("connect page onError",{res:e}),{redirect:()=>{k.error(s.message)},popup:()=>{T(e)}}[C]()},K=he(()=>{var e;if(m!=="login")return null;const s=((e=window.blocklet)==null?void 0:e.trustedFactories)||[];return(s==null?void 0:s.length)>0?t.jsxs(u,{children:[a("exchangePassport.tooltip1"),t.jsx(u,{component:te,reloadDocument:!0,to:Ce(Te(ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:i||"/"}),sx:{color:le.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),t.jsx(u,{component:"ul",sx:{pl:1.5},children:s.map(o=>t.jsx(u,{component:"li",children:o},o))})]}):null},[m]),$=x(async()=>{if(!i)return!0;let s;try{s=new URL(i)}catch{return!1}let e;try{e=new URL(c==null?void 0:c.baseUrl)}catch{try{e=new URL(c==null?void 0:c.prefix)}catch(o){console.error("baseUrl and prefix are both invalid",o)}}if(e){let o=[];if(e.origin===window.location.origin)o=window.blocklet.domainAliases||[];else{const n=await fe(e.origin);o=(n==null?void 0:n.domainAliases)||[]}if(!o.includes(s.hostname))return k.error(a("login.invalidRedirectUrl")),!1}return!0}),I=x(()=>{const s=decodeURIComponent(i),e=P(s);window.location.replace(E(e.href,{allowDomains:null}))}),J=!0,Q=!0,G=q(s=>s.breakpoints.down("lg")),y=x(async()=>{await $()&&J&&(window.temporaryDIDConnectOnSuccess=(e,o)=>{_(e,o,{saveConnect:!0})},setTimeout(()=>{var e;N.open({locale:O,action:m,passkeyBehavior:W,extraParams:d,...g,className:"connect",popup:!0,messages:F||{title:a("login.connect.title"),scan:a("login.connect.scan"),confirm:a("login.connect.confirm"),success:a("login.connect.success")},extraContent:K,useSocket:!0,allowWallet:["1","true",void 0,null].includes((e=globalThis.blocklet)==null?void 0:e.DID_CONNECT_ALLOW_WALLET),onSuccess:_,onError:z,hideCloseButton:Q})}))});if(we(()=>{y(),f.addEventListener("message",I)}),ke(()=>{delete window.temporaryDIDConnectOnSuccess,f.removeEventListener("message",I),f.close()}),M.loading)return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsx("title",{children:"DID Connect"})}),t.jsx(de,{children:t.jsx(Z,{})})]});const V=globalThis.blocklet.appName,X=globalThis.blocklet.appDescription;return t.jsxs(t.Fragment,{children:[t.jsx(U,{children:t.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),G&&!v.arcSphere?t.jsx(ee,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):t.jsx(pe,{did:globalThis.blocklet.appPid,title:V,description:X,actions:v.arcSphere?null:t.jsx(ne,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{Fe as default};
@@ -0,0 +1,5 @@
1
+ import{j as r,ab as f,T as h,H as y,ah as x}from"./vendor-mui-core-Bq8gXTan.js";import"./vendor-react-DEoibe3W.js";import{A as g}from"./vendor-utils-BotmZdBm.js";import{_ as w}from"./useAsync-DVHp96Uu.js";import{a as C,aY as T,F as i,ba as j,a3 as k,at as v}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{u as P,s as S}from"./index-CMYalRl2.js";import"./vendor-hooks-BFlOfe0M.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-DiSm3oUX.js";function U({children:p}){const{t:n,locale:u}=C(),{api:c,session:a}=P(),{encryptKey:l,decrypt:m}=T(),s=w(async()=>{var t;const e=new URL(window.location.href);e.pathname=g(((t=window==null?void 0:window.env)==null?void 0:t.apiPrefix)??"/","/api/did/setup/token"),e.searchParams.set("_ek_",l);const{data:o}=await c.get(e.href);return o}),d=async e=>{const o=Array.isArray(e)?e.find(t=>t.sessionToken):e;S(m(o.sessionToken));try{await a.refresh()}catch(t){k.error(t.message)}};return!s.value||s.loading||a.loading?r.jsx(i,{relative:"parent",children:r.jsx(f,{})}):a.user?p:s.error?r.jsx(i,{relative:"parent",children:r.jsx(h,{children:s.error.message})}):r.jsx(b,{popup:!0,open:!0,hideCloseButton:!0,action:"pre-setup",checkFn:c.get,checkTimeout:10*60*1e3,webWalletUrl:j(),onSuccess:d,locale:u,messages:{title:n("setup.connect.title"),scan:n("setup.connect.scan"),confirm:n("setup.connect.confirm"),success:n("setup.connect.success")},extraParams:{setup:!0,nw:s.value.url}})}U.propTypes={children:y.any.isRequired};const b=x(v)`
2
+ .action-info-desc {
3
+ padding: 0 72px;
4
+ }
5
+ `;export{U as default};
@@ -1 +1 @@
1
- import{r as P}from"./vendor-react-DEoibe3W.js";import{a as D,bE as E,a3 as g}from"./vendor-ux-did-connect-CX7qG3_M.js";import{w as I,x as b,c as q,y as B}from"./vendor-arcblock-B4hgrXYM.js";import{j as t,aa as x,T as h,H as c,I as U,b6 as F}from"./vendor-mui-core-wlbruq2I.js";import{u as N}from"./config-space-B39Ur9Mf.js";import{f as y}from"./index-8eXqqyHQ.js";import{d as O}from"./DeleteOutline-1-hBNY1U.js";import{b as W,E as $,A as v}from"./vendor-utils-B3iZkn2R.js";import{f as T,G as L,D as z,a3 as H,af as _}from"./index-B18R5SlV.js";import"./api-CQoRx33p.js";function Z(){const{t:e}=D();return t.jsx(x,{children:t.jsxs(x,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[t.jsx(I,{style:{width:250,height:250}}),t.jsx(h,{marginTop:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Z.propTypes={};function j({spaceGateway:e,onDeleteSpace:l}){const{t:s}=D(),[a,o]=P.useState(!1),[r,d]=P.useState(!1),u=(n,i)=>{n==null||n.stopPropagation(),o(i)},f=async n=>{try{n==null||n.stopPropagation(),d(!0),await l(e),o(!1)}catch(i){console.error(i),g.error(`${s("storage.spaces.gateway.delete.failed")}: ${y(i)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(U,{size:"small",onClick:n=>u(n,!0),children:t.jsx(O,{})}),t.jsx(E,{title:s("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:f,onCancel:n=>u(n,!1),children:t.jsx(h,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForStorage",{name:`${e==null?void 0:e.name}`})})})]})}j.propTypes={onDeleteSpace:c.func,spaceGateway:c.shape({name:c.string.isRequired,url:c.string.isRequired,protected:c.bool}).isRequired};j.defaultProps={onDeleteSpace:()=>{}};function C({spaceGateway:e,onDisconnect:l}){const{t:s}=D(),a=async()=>{try{await l(),g.success(s("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(o){console.error(o),g.error(y(o))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}C.propTypes={spaceGateway:c.shape({did:c.string.isRequired,name:c.string.isRequired,url:c.string.isRequired,endpoint:c.string.isRequired}).isRequired,onDisconnect:c.func};C.defaultProps={onDisconnect:()=>{}};function te(){const{t:e}=D(),{spaceGateway:l,settingStorageEndpoint:s}=N();return t.jsxs(x,{display:"flex",flexDirection:"column",children:[t.jsx(x,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:t.jsx(h,{fontSize:"1rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),t.jsx(x,{children:t.jsx(b,{sx:{marginTop:2},endpoint:l.endpoint,selected:!0,action:a=>t.jsx(C,{...a,onDisconnect:()=>s(null)})})})]})}function J({blocklet:e}){var f,n,i;if(W(e))return{};const{appDid:l}=e,s=T.getAppName(e),a=T.getAppDescription(e),o=(i=(n=(f=e==null?void 0:e.site)==null?void 0:f.domainAliases)==null?void 0:n.sort((p,m)=>p.accessibility.accessible&&m.accessibility.accessible?+p.isProtected-+m.isProtected:+m.accessibility.accessible-+p.accessibility.accessible))==null?void 0:i.map(p=>{var S;const m=(S=p==null?void 0:p.domainStatus)!=null&&S.isHttps?"https://":"http://",R=p==null?void 0:p.value;return`${m}${R}`}).filter(Boolean),r=o==null?void 0:o[0],d=q.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:l,appName:s,appDescription:a,appUrl:r,scopes:d,referrer:u,isReady:!!r}}function w({onConnect:e,...l}){const{blocklet:s}=L(),{info:a}=z(),{t:o}=D(),r=J({blocklet:s}),d=H(a),u={checkFn:$.create({baseURL:v(window.location.origin,_())}).get,webWalletUrl:d,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:a.did}},f=async({spaceGateway:n})=>{try{await e(n),g.success(o("storage.spaces.connectedWithName",{name:n.name}))}catch(i){console.error(i),g.error(y(i))}};return t.jsx(B,{...l,options:u,onSuccess:f})}w.propTypes={onConnect:F.func};w.defaultProps={onConnect:()=>{}};export{te as C,Z as D,w as a,J as u};
1
+ import{r as P}from"./vendor-react-DEoibe3W.js";import{a as D,bD as I,a3 as g}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{w as E,x as b,c as q,y as B}from"./vendor-arcblock-DiSm3oUX.js";import{j as t,aa as x,T as h,H as c,I as U,b5 as F}from"./vendor-mui-core-Bq8gXTan.js";import{u as N}from"./config-space-C3fS58cn.js";import{f as y}from"./index-8eXqqyHQ.js";import{d as O}from"./DeleteOutline-CnS2XiM1.js";import{b as W,E as $,A as v}from"./vendor-utils-BotmZdBm.js";import{f as T,G as L,D as z,a3 as H,af as _}from"./index-CMYalRl2.js";import"./api-87p2GGd0.js";function Z(){const{t:e}=D();return t.jsx(x,{children:t.jsxs(x,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[t.jsx(E,{style:{width:250,height:250}}),t.jsx(h,{marginTop:"24px",children:e("storage.spaces.connect.providerForStorage")})]})})}Z.propTypes={};function j({spaceGateway:e,onDeleteSpace:l}){const{t:s}=D(),[a,o]=P.useState(!1),[r,d]=P.useState(!1),u=(n,i)=>{n==null||n.stopPropagation(),o(i)},f=async n=>{try{n==null||n.stopPropagation(),d(!0),await l(e),o(!1)}catch(i){console.error(i),g.error(`${s("storage.spaces.gateway.delete.failed")}: ${y(i)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(U,{size:"small",onClick:n=>u(n,!0),children:t.jsx(O,{})}),t.jsx(I,{title:s("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:s("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:f,onCancel:n=>u(n,!1),children:t.jsx(h,{sx:{wordWrap:"break-word"},children:s("storage.spaces.gateway.delete.descForStorage",{name:`${e==null?void 0:e.name}`})})})]})}j.propTypes={onDeleteSpace:c.func,spaceGateway:c.shape({name:c.string.isRequired,url:c.string.isRequired,protected:c.bool}).isRequired};j.defaultProps={onDeleteSpace:()=>{}};function C({spaceGateway:e,onDisconnect:l}){const{t:s}=D(),a=async()=>{try{await l(),g.success(s("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(o){console.error(o),g.error(y(o))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}C.propTypes={spaceGateway:c.shape({did:c.string.isRequired,name:c.string.isRequired,url:c.string.isRequired,endpoint:c.string.isRequired}).isRequired,onDisconnect:c.func};C.defaultProps={onDisconnect:()=>{}};function te(){const{t:e}=D(),{spaceGateway:l,settingStorageEndpoint:s}=N();return t.jsxs(x,{display:"flex",flexDirection:"column",children:[t.jsx(x,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:t.jsx(h,{fontSize:"1rem",fontWeight:"bold",children:e("storage.spaces.connected.title")})}),t.jsx(x,{children:t.jsx(b,{sx:{marginTop:2},endpoint:l.endpoint,selected:!0,action:a=>t.jsx(C,{...a,onDisconnect:()=>s(null)})})})]})}function J({blocklet:e}){var f,n,i;if(W(e))return{};const{appDid:l}=e,s=T.getAppName(e),a=T.getAppDescription(e),o=(i=(n=(f=e==null?void 0:e.site)==null?void 0:f.domainAliases)==null?void 0:n.sort((p,m)=>p.accessibility.accessible&&m.accessibility.accessible?+p.isProtected-+m.isProtected:+m.accessibility.accessible-+p.accessibility.accessible))==null?void 0:i.map(p=>{var S;const m=(S=p==null?void 0:p.domainStatus)!=null&&S.isHttps?"https://":"http://",R=p==null?void 0:p.value;return`${m}${R}`}).filter(Boolean),r=o==null?void 0:o[0],d=q.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:l,appName:s,appDescription:a,appUrl:r,scopes:d,referrer:u,isReady:!!r}}function w({onConnect:e,...l}){const{blocklet:s}=L(),{info:a}=z(),{t:o}=D(),r=J({blocklet:s}),d=H(a),u={checkFn:$.create({baseURL:v(window.location.origin,_())}).get,webWalletUrl:d,extraParams:{appPid:s.appPid,appDid:r.appDid,appName:r.appName,appDescription:r.appDescription,appUrl:r.appUrl,referrer:r.referrer,scopes:r.scopes,nodeDid:a.did}},f=async({spaceGateway:n})=>{try{await e(n),g.success(o("storage.spaces.connectedWithName",{name:n.name}))}catch(i){console.error(i),g.error(y(i))}};return t.jsx(B,{...l,options:u,onSuccess:f})}w.propTypes={onConnect:F.func};w.defaultProps={onConnect:()=>{}};export{te as C,Z as D,w as a,J as u};
@@ -1,4 +1,4 @@
1
- import{H as n,ah as i,j as o}from"./vendor-mui-core-wlbruq2I.js";function p({children:e,...t}){return o.jsx(d,{...t,children:e})}p.propTypes={children:n.any.isRequired};const d=i.div`
1
+ import{H as n,ah as i,j as o}from"./vendor-mui-core-Bq8gXTan.js";function p({children:e,...t}){return o.jsx(d,{...t,children:e})}p.propTypes={children:n.any.isRequired};const d=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -0,0 +1,239 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/log-DOIh9luu.js","assets/vendor-mui-core-Bq8gXTan.js","assets/vendor-react-DEoibe3W.js","assets/useLocalStorage-DyVGBDlt.js","assets/vendor-ux-did-connect-DVX9lQ8a.js","assets/vendor-utils-BotmZdBm.js","assets/vendor-hooks-BFlOfe0M.js","assets/lottie-web-jYmAQWuC.js","assets/vendor-ux-did-connect-DpSGLE7B.css","assets/index-CMYalRl2.js","assets/vendor-arcblock-DiSm3oUX.js","assets/index-DOq-_YXu.css","assets/Download-D9LfWoxF.js","assets/bundle-avatar-B5-ypzmO.js","assets/log-D33dFtt_.css","assets/index-Bb7iSrGO.js","assets/ViewList-D1BI4ac9.js","assets/index-Mzv6hCex.js","assets/did-address-L54dTMrT.js","assets/permission-ClRym5FB.js","assets/session-Bkvl2PSP.js","assets/click-to-copy-BMX2P5UB.js","assets/index-Dgsq6V-N.js","assets/vendor-mui-x-1nqAyytV.js","assets/AdapterDayjs-BzjU9O7t.js","assets/index-8eXqqyHQ.js","assets/useAsync-DVHp96Uu.js","assets/index-BzZuK-66.js","assets/DeleteOutline-CnS2XiM1.js","assets/confirm-DApmnpvm.js","assets/util-M3UFXQFT.js","assets/base32-DEjena1X.js","assets/sdk-CbugbTkF.js","assets/actions-DYQW2ChM.js","assets/MoreHoriz-Ba9rYlyz.js","assets/shorten-label-BQvbtscf.js","assets/PlayArrow-RVSfCmrB.js","assets/get-safe-url-B8xlSMyD.js","assets/use-blocklet-logo-CTCMbFiC.js","assets/InfoOutlined-C8ZBPUhD.js","assets/dot-iw3hN9HL.js","assets/useSetState-CWq0AVWn.js","assets/use-mobile-CtTQsfXN.js","assets/index-BeE0KRva.js","assets/use-mobile-DwzRjjku.js","assets/ExpandLess-Da2Rv9Ox.js","assets/table-tips-BW6G2sKO.js","assets/index-Dfw2EDXA.js","assets/Error-q_AhSCeT.js","assets/empty-spinner-BHwHZpq-.js","assets/list-header-C7gle0n0.js","assets/QuestionMarkCircle-jbhclAfX.js","assets/index-DVQCgvFb.js","assets/Launch-Nu8TBDKk.js","assets/index-DEZojGsm.js","assets/api-87p2GGd0.js","assets/ChevronRight-DclARA5k.js","assets/react-beautiful-dnd.esm-CHsohizU.js","assets/raf-schd.esm-B3j6BePR.js","assets/item-D0U5vYXJ.js","assets/Done-C9LPqADS.js","assets/delete-confirm-BsEqJQRY.js","assets/ArrowDropDown-CrJjI_sT.js","assets/index-CTlzm-Mc.js","assets/index-C0Iiqot3.css","assets/index-Bv7OAPJU.js","assets/overview-ClOSCvvh.js","assets/keyboard-arrow-down-rounded-DadBVmpO.js","assets/status-DDvFiBxA.js","assets/omit-BlzmxIB5.js","assets/spaces-C1lh7et6.js","assets/domains-CdwErmIF.js","assets/domain-action-card-DWqnvzry.js","assets/util-DlS4tWs9.js","assets/CheckCircle-BcPSvH2E.js","assets/index-DXeoVV9Y.js","assets/passport-item-Du8-xENr.js","assets/Google-Buu8u6PW.js","assets/cloneDeep-Jl_OPbSo.js","assets/EditIcon-DfiDnAsm.js","assets/LockIcon-BEG59s5q.js","assets/appearance-CYop22yw.js","assets/audit-logs-BtBk6uAY.js","assets/index-Be8E3hiQ.js","assets/collapse-9taxUXec.js","assets/section-BDMQAX_r.js","assets/list-KVxvPXZu.js","assets/traffic-CUSLm0PX.js","assets/iframe-Dj9NLHp2.js","assets/LaunchOutlined-DQZ7S23O.js","assets/ChevronLeft-Ch9iK6fF.js","assets/index-B2NkqENf.js","assets/base-chart-C2FJuVG1.js","assets/index-CKY4HT0P.js","assets/config-navigation-IR_yUgmM.js","assets/index-BCtTVvHw.js","assets/slicedToArray-DFQjSbCD.js","assets/simple-select-0cjVFuay.js","assets/index-DaM-GRtb.js","assets/connect-to-Bwfa2hMr.js","assets/config-space-C3fS58cn.js","assets/switch-control-BYqb8MZf.js","assets/index-CJQbYw9E.js","assets/security-CXewZHyS.js","assets/config-Sq1CUTiJ.js","assets/branding-gXMozCeI.js","assets/sanitize-B18rcrOf.js","assets/logo-uploader-Dzebv-rF.js","assets/advanced-BZZToP_j.js","assets/runtime-D5P_2uNM.js","assets/index-C8uNNoMb.js","assets/Edit-rPlryssW.js","assets/list-BOdwWlS0.js","assets/index-Cs3-IS09.js","assets/component-D6hOmRzO.js","assets/TuneOutlined-CwV20zYf.js","assets/add-component-core-UeQfX1b1.js","assets/launch-result-message-AharZGq2.js","assets/page-header-C_KAJILy.js","assets/index-CCOwwQoc.js","assets/content-layout-BC2QkTYi.js","assets/search-4YYphs0l.js","assets/add-component-core-D-IRi6XF.css","assets/index-SX_KWrQh.js"])))=>i.map(i=>d[i]);
2
+ import{r as F,bd as fs,bb as Lt,be as ps,B as Dt,k as M,a8 as vn,a3 as Z,a as Y,at as ms,n as Hn,m as hs,d as gs,i as xs,aR as vs,D as Le,a1 as Pt,bf as ys,bg as bs,I as ws,F as Je,bh as js,_ as D,ax as Ss,a5 as _s}from"./vendor-ux-did-connect-DVX9lQ8a.js";import{H as v,j as o,a9 as V,ah as G,I as Rt,at as Cs,ak as At,X as Mt,q as Is,b7 as Es,ab as re,b8 as ks,bw as Ts,T as H,bu as Ls,bs as yn,bv as bn,aa as _,bI as Ds,v as X,a7 as it,bJ as Ps,e as ee,ae as Rs,bf as As,ap as Se,bK as Bn,ad as Ee,bL as Ms,au as $s,ai as Os,bM as Fn,bN as Vn,bO as qn,E as ae,b6 as Wn,y as Ns,bh as Us}from"./vendor-mui-core-Bq8gXTan.js";import{r as x,L as Kn,f as Gn,g as zs,u as Hs,l as Bs}from"./vendor-react-DEoibe3W.js";import{D as at,f as N,E as ft,F as Fs,b as Vs,G as qs,H as Ws,I as Qn,y as me,J as Zn,K as Ks,k as ve,L as Gs,M as Qs,u as Zs,l as wn,Q as jn,g as Xs,j as Js,q as Ys,n as be,m as eo,o as to,P as no,O as ro,R as We,e as He,T as so,U as oo,V as io,N as ao,W as co,c as Sn}from"./index-CMYalRl2.js";import{ag as lo,A as he,ah as uo,z as Xn,b as Ke,ai as fo}from"./vendor-utils-BotmZdBm.js";import{_ as _n}from"./useLocalStorage-DyVGBDlt.js";import{f as $t}from"./index-8eXqqyHQ.js";import{c as ce,u as Ye,p as po,h as et,f as Jn,e as mo,E as ho,g as go,H as xo,R as vo}from"./vendor-arcblock-DiSm3oUX.js";import{C as Cn}from"./confirm-DApmnpvm.js";import{d as yo}from"./PlayArrow-RVSfCmrB.js";import{g as In}from"./get-safe-url-B8xlSMyD.js";import{u as Yn}from"./session-Bkvl2PSP.js";import{b as ge,x as bo}from"./vendor-hooks-BFlOfe0M.js";import{i as wo,u as jo,M as So,c as ke,s as tt,H as _o,a as Co}from"./use-blocklet-logo-CTCMbFiC.js";import{d as Io}from"./InfoOutlined-C8ZBPUhD.js";import{_ as er,D as Eo}from"./dot-iw3hN9HL.js";import{_ as tr}from"./useSetState-CWq0AVWn.js";import{u as ko}from"./use-mobile-CtTQsfXN.js";const nr=x.createContext({});function Ot({children:e,type:t}){const[n,r]=x.useState([]),s=x.useRef([]),a=l=>{if(!s.current.includes(l)){const u=[...s.current,l];r(u),s.current=u}},i=l=>{if(s.current.includes(l)){const u=s.current.filter(d=>d!==l);r(u),s.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));lo(u,n).forEach(p=>i(p))};return o.jsx(nr.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:a,removeDeletingDid:i,matchDeletingDid:c},children:e})}Ot.propTypes={type:v.string,children:v.node.isRequired};Ot.defaultProps={type:"blocklets"};function Ll(){return x.useContext(nr)}var Nt={},To=V;Object.defineProperty(Nt,"__esModule",{value:!0});var rr=Nt.default=void 0,Lo=To(F()),Do=o;rr=Nt.default=(0,Lo.default)((0,Do.jsx)("path",{d:"M6 6h12v12H6z"}),"Stop");var Ut={},Po=V;Object.defineProperty(Ut,"__esModule",{value:!0});var sr=Ut.default=void 0,Ro=Po(F()),Ao=o;sr=Ut.default=(0,Ro.default)((0,Ao.jsx)("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8"}),"Replay");var zt={},Mo=V;Object.defineProperty(zt,"__esModule",{value:!0});var or=zt.default=void 0,$o=Mo(F()),Oo=o;or=zt.default=(0,$o.default)((0,Oo.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6m6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26"}),"Autorenew");var Ht={},No=V;Object.defineProperty(Ht,"__esModule",{value:!0});var ir=Ht.default=void 0,Uo=No(F()),zo=o;ir=Ht.default=(0,Uo.default)((0,zo.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings");var Bt={},Ho=V;Object.defineProperty(Bt,"__esModule",{value:!0});var ar=Bt.default=void 0,Bo=Ho(F()),Fo=o;ar=Bt.default=(0,Bo.default)((0,Fo.jsx)("path",{d:"M18 17H6v-2h12zm0-4H6v-2h12zm0-4H6V7h12zM3 22l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2z"}),"Receipt");var Ft={},Vo=V;Object.defineProperty(Ft,"__esModule",{value:!0});var cr=Ft.default=void 0,qo=Vo(F()),Wo=o;cr=Ft.default=(0,qo.default)((0,Wo.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"Group");var Vt={},Ko=V;Object.defineProperty(Vt,"__esModule",{value:!0});var lr=Vt.default=void 0,Go=Ko(F()),Qo=o;lr=Vt.default=(0,Go.default)((0,Qo.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20m6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9"}),"NotInterested");var qt=function(e){return o.jsx("svg",{...e,children:o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.32989 8.20744C11.2787 6.82349 13.6098 6.08 16 6.08C18.3902 6.08 20.7213 6.82349 22.6701 8.20744C24.6189 9.59139 26.089 11.5473 26.8766 13.804C27.6642 16.0607 27.7304 18.5066 27.0659 20.8026C26.4419 22.9587 25.2026 24.8823 23.5044 26.3404H8.49555C6.79735 24.8823 5.55809 22.9587 4.9341 20.8026C4.26961 18.5066 4.33575 16.0607 5.12337 13.804C5.91098 11.5473 7.38107 9.59139 9.32989 8.20744ZM16 3.52C13.0786 3.52 10.2295 4.42871 7.84764 6.1202C5.46575 7.81169 3.66898 10.2022 2.70634 12.9604C1.7437 15.7187 1.66286 18.708 2.47501 21.5143C3.28717 24.3205 4.95211 26.8046 7.23909 28.6224C7.46554 28.8024 7.74628 28.9004 8.03554 28.9004H23.9644C24.2537 28.9004 24.5344 28.8024 24.7609 28.6224C27.0479 26.8046 28.7128 24.3205 29.5249 21.5143C30.3371 18.708 30.2563 15.7187 29.2936 12.9604C28.331 10.2022 26.5342 7.81169 24.1523 6.1202C21.7704 4.42871 18.9214 3.52 16 3.52ZM21.8829 13.5921C22.3827 13.0923 22.3827 12.2818 21.8829 11.7819C21.383 11.2821 20.5725 11.2821 20.0727 11.7819L17.868 13.9866C17.3072 13.7012 16.6724 13.5404 16 13.5404C13.7221 13.5404 11.8755 15.3869 11.8755 17.6648C11.8755 19.9427 13.7221 21.7892 16 21.7892C18.2779 21.7892 20.1244 19.9427 20.1244 17.6648C20.1244 16.9924 19.9635 16.3576 19.6782 15.7968L21.8829 13.5921ZM14.4355 17.6648C14.4355 16.8008 15.136 16.1004 16 16.1004C16.864 16.1004 17.5644 16.8008 17.5644 17.6648C17.5644 18.5288 16.864 19.2292 16 19.2292C15.136 19.2292 14.4355 18.5288 14.4355 17.6648Z",fill:"currentColor"})})};qt.defaultProps={width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"};qt.displayName="dashboard";var Wt={},Zo=V;Object.defineProperty(Wt,"__esModule",{value:!0});var ur=Wt.default=void 0,Xo=Zo(F()),Jo=o;ur=Wt.default=(0,Xo.default)((0,Jo.jsx)("path",{d:"m18.25 7.6-5.5-3.18c-.46-.27-1.04-.27-1.5 0L5.75 7.6c-.46.27-.75.76-.75 1.3v6.35c0 .54.29 1.03.75 1.3l5.5 3.18c.46.27 1.04.27 1.5 0l5.5-3.18c.46-.27.75-.76.75-1.3V8.9c0-.54-.29-1.03-.75-1.3M7 14.96v-4.62l4 2.32v4.61zm5-4.03L8 8.61l4-2.31 4 2.31zm1 6.34v-4.61l4-2.32v4.62zM7 2H3.5C2.67 2 2 2.67 2 3.5V7h2V4h3zm10 0h3.5c.83 0 1.5.67 1.5 1.5V7h-2V4h-3zM7 22H3.5c-.83 0-1.5-.67-1.5-1.5V17h2v3h3zm10 0h3.5c.83 0 1.5-.67 1.5-1.5V17h-2v3h-3z"}),"ViewInAr");const pe={Start:yo,Stop:rr,Restart:sr,Reload:or,Remove:fs,Config:ir,Log:ar,Group:cr,Cancel:lr,Dashboard:qt,Overview:ur},Yo=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),s=new URL(he(n.origin,t));return s.search=r.toString(),s.toString()},ei="internal",ti="external";function Kt({blocklet:e,onStart:t,onComplete:n,variant:r,hasPermission:s,getComponentUrl:a,useBlockletUrlEvaluation:i,...c}){const l=at(),[u,d]=x.useState(null),[p,f]=x.useState(null),[y,g]=x.useState(!1),[h,S]=x.useState(null),{t:m}=x.useContext(Lt),[C]=_n("skip-blocklet-setup",!1),{loading:w,recommendedUrl:L}=i(e),[R]=_n("blocklet-type-filter",ei),j=N.isInProgress(e.status),[k,E]=x.useState(!1);x.useEffect(()=>{var A,B;if(!(e!=null&&e.controller))return;E(((B=(A=e==null?void 0:e.controller)==null?void 0:A.status)==null?void 0:B.value)===ce.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{var q,te,oe;try{const W=await l.api.getLauncherSession({input:{launcherSessionId:(q=e==null?void 0:e.controller)==null?void 0:q.launcherSessionId,launcherUrl:(te=e==null?void 0:e.controller)==null?void 0:te.launcherUrl}});if(W!=null&&W.error){console.error("get launcher session failed",W.error);return}E([M.LAUNCH_SESSION_STATUS.overdue,M.LAUNCH_SESSION_STATUS.canceled,M.LAUNCH_SESSION_STATUS.terminated].includes((oe=W==null?void 0:W.launcherSession)==null?void 0:oe.status))}catch(W){console.error("call getLauncherSession error",W)}})()},[]);const{inService:T}=l,I=(b,A,B=!1)=>async()=>{const q=async Ne=>{var ze;t({action:b,blocklet:e}),g(!0),f(b);let Ue=!1;try{if(b==="remove")await A(Ne);else if(b==="start"){if(!N.hasRunnableComponent(e)){Z.error(m("blocklet.noComponent"));return}if(!T&&!C&&!((ze=e.settings)!=null&&ze.initialized)&&e.mode!==ce.BLOCKLET_MODES.DEVELOPMENT){if(!L||!vn(L)){Z.error(m("blocklet.gotoVisitError"));return}const Q=Fs(l.info),xn=new URL(L);xn.searchParams.set("serverUrl",Q),window.open(In(xn.href,{allowDomains:null})),n({action:b,blocklet:e});return}const ie=e.children.filter(Q=>!N.isInProgress(Q.status)&&Q.status!=="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else if(["stop","restart","reload"].includes(b)){const ie=e.children.filter(Q=>Q.status==="running").map(Q=>Q.meta.did),fe={did:e.meta.did,componentDids:ie};await A({input:fe})}else{const ie={did:e.meta.did};await A({input:ie})}b==="remove"?Ue=!0:await Vs(1e3),b==="reload"&&Z.success(m("blocklet.reloadSuccess")),S(null),n({action:b,blocklet:e})}catch(ie){const fe=`Blocklet ${b} failed: ${$t(ie)}`;throw n({action:b,blocklet:e,error:new Error(fe)}),new Error(fe)}finally{Ue||g(!1)}},te=()=>{g(!1),S(null)},oe=N.getDisplayName(e,!0),W=e.mode===ce.BLOCKLET_MODES.DEVELOPMENT?{description:()=>o.jsx(H,{component:"div",children:o.jsx(H,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Ne,Ue)=>o.jsxs(H,{component:"div",children:[o.jsx(H,{gutterBottom:!0,children:m("blocklet.action.removeApplicationDescription")}),o.jsxs(Ls,{name:"removeType",value:Ne.removeType,onChange:ze=>Ue({...Ne,removeType:ze.target.value}),children:[o.jsx(yn,{value:"backup",control:o.jsx(bn,{}),label:m("blocklet.action.removeApplicationAfterBackup")}),o.jsx(yn,{value:"complete",control:o.jsx(bn,{}),label:m("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},ds={stop:{title:`${m("common.stop")} ${oe}`,description:m("blocklet.action.stopDescription"),confirm:m("blocklet.action.confirmStop"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},restart:{title:`${m("common.restart")} ${oe}`,description:m("blocklet.action.restartDescription"),confirm:m("blocklet.action.confirmRestart"),cancel:m("common.cancel"),onConfirm:q,onCancel:te},remove:{title:`${m("common.remove")} ${oe}`,confirm:m("blocklet.action.confirmRemove"),cancel:m("common.cancel"),onConfirm:q,onCancel:te,...W},cancelDownload:{title:`${m("common.cancel")}`,description:m("blocklet.action.cancelDownloadDescription",{name:oe}),confirm:m("common.confirm"),cancel:m("common.cancel"),onConfirm:q,onCancel:te}};B?S(ds[b]):await q()},U=!!u,$=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(b.currentTarget)},z=b=>{try{b.stopPropagation(),b.preventDefault()}catch{}d(null)},$e=async(b,A)=>{try{A.stopPropagation(),A.preventDefault()}catch{}if(typeof b.handler=="function")try{g(!0),f(b.action),await b.handler()}catch(B){console.error(`Blocklet ${b.name} failed: `,B)}finally{g(!1),d(null)}else d(null)},as=!T&&N.isDeletableBlocklet(e)?{action:"remove",icon:pe.Remove,name:m("common.remove"),handler:I("remove",async({removeType:b})=>{b==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:j}:null,cs={action:"remove",icon:({sx:b,...A})=>o.jsx(pe.Cancel,{sx:{...b,paddingRight:"2px",zoom:.95},...A}),name:m("common.cancel"),handler:I("cancelDownload",l.api.cancelDownloadBlocklet,!0)},ls=N.getAppMissingConfigs(e),us=()=>{var q;const b=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),A=a==null?void 0:a({mountPoint:b,blocklet:e});if(!A||!vn(A)){Z.error(m("blocklet.gotoVisitError"));return}const B=(q=e==null?void 0:e.site)==null?void 0:q.domainAliases;window.open(In(Yo(A,`${M.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:B==null?void 0:B.map(te=>te.value)}))};let Oe=[{action:"start",icon:pe.Start,inExternal:!0,name:m("common.start"),handler:I("start",l.api.startBlocklet),disabled:k||e.children.every(b=>b.status==="running")||ft(e.status)||w||j},{action:"stop",icon:pe.Stop,inExternal:!0,name:m("common.stop"),handler:I("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:pe.Restart,name:m("common.restart"),handler:I("restart",l.api.restartBlocklet,!0),disabled:k||e.status!=="running"},ft(e.status)?cs:as,{separator:!0},T?null:{action:"dashboard",icon:({style:b,...A})=>o.jsx(pe.Dashboard,{...A,style:{...b,width:"26px",height:"26px",paddingRight:"3px"}}),name:m("sidebar.dashboard"),handler:us}].filter(Boolean);return R===ti&&(Oe=Oe.filter(b=>b.inExternal)),r==="menu"?o.jsxs(En,{"data-cy":"blocklet-actions",children:[o.jsx(Rt,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:$,size:"small",disabled:!s||!ft(e.status)&&y,children:o.jsx(ps,{})}),o.jsxs(Cs,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:U,onClose:z,PaperProps:{},children:[ls.length>0&&o.jsxs(At,{style:{maxWidth:"400px"},severity:"error",children:[m("blocklet.config.missingRequired"),o.jsx("br",{}),o.jsx(Kn,{to:`/blocklets/${e.meta.did}/components`,children:m("blocklet.config.gotoFix")})]}),Oe.map((b,A)=>b.separator?o.jsx(Mt,{},`separator-${A}`):o.jsxs(Is,{dense:!0,onClick:B=>$e(b,B),disabled:y||b.disabled,"data-cy":`${b.action}-blocklet`,children:[o.jsx(Es,{style:{minWidth:24},children:p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{fontSize:"small"})}),o.jsx(ks,{primary:b.name})]},b.name))]}),h&&o.jsx(Cn,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]}):o.jsxs(En,{"data-cy":"blocklet-actions",...c,children:[o.jsx(Ts,{children:Oe.filter(b=>!b.separator&&!b.onlyInMenu).map(b=>o.jsxs(Dt,{title:b.name,"data-cy":`${b.action}-blocklet`,onClick:()=>$e(b),disabled:!!b.disabled||y,children:[p===b.action&&y?o.jsx(re,{size:16,sx:{marginRight:1}}):o.jsx(b.icon,{}),o.jsx("span",{className:"blocklet-action-text",children:b.name})]},b.name))}),h&&o.jsx(Cn,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Kt.propTypes={getComponentUrl:v.func,blocklet:v.object.isRequired,onStart:v.func.isRequired,onComplete:v.func.isRequired,variant:v.oneOf(["menu","group"]),hasPermission:v.bool,useBlockletUrlEvaluation:v.func};Kt.defaultProps={getComponentUrl:null,variant:"menu",hasPermission:!1,useBlockletUrlEvaluation:()=>{var e;return{loading:!1,recommendedUrl:(e=window==null?void 0:window.location)==null?void 0:e.href}}};const En=G.div`
3
+ display: flex;
4
+ align-items: center;
5
+
6
+ @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
7
+ .MuiButton-root {
8
+ padding: 4px;
9
+ font-size: 10px;
10
+ }
11
+ }
12
+ `,kn=x.memo(Kt),ni=e=>{const t={};let n=null;return N.forEachBlockletSync(e,r=>{t[r.meta.bundleDid]?n=N.getDisplayName(r,!0):r.meta.bundleDid&&(t[r.meta.bundleDid]=!0)}),n},ri=(e,t,n)=>{var a;const{hostname:r,href:s}=e;if(!t)return s;if(n){const c=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!c)return s;const l=c[0],d=((((a=t.site)==null?void 0:a.domainAliases)||[]).map(p=>p.value).filter(Boolean).find(p=>p.endsWith(M.DEFAULT_DID_DOMAIN))||"").replace(`.${M.DEFAULT_DID_DOMAIN}`,"");return d?s.replace(r,`${d}-${l}.${M.DEFAULT_IP_DOMAIN_SUFFIX}`):s}return s.replace(t.meta.bundleDid,t.appPid)};function dr(){const{t:e}=Y(),{api:t}=Yn(),{blocklet:n}=qs(),{inService:r}=at(),[s,a]=x.useState(!1),[i,c]=x.useState(5),l=n&&n.structVersion!==M.APP_STRUCT_VERSION,u=()=>{try{if(n.status==="running"){Z.error(e("blocklet.migrate.tip.running"));return}const f=ni(n);if(f){Z.error(e("blocklet.migrate.tip.duplicate",{name:f}));return}a(!0)}catch(f){Z.error($t(f))}},d=()=>{const f=ri(window.location,n,r);setTimeout(()=>{window.location.href=f},5e3),c(5),setInterval(()=>{c(y=>y-1)},1e3)},p=()=>a(!1);return[l&&o.jsxs(At,{severity:"warning",style:{margin:"12px 0"},children:[o.jsxs(_,{display:"flex",alignItems:"center",children:[o.jsx(Dt,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),o.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(f=>o.jsx(_,{display:"flex",alignItems:"center",children:e(`blocklet.migrate.intro.${f}`)},f))]},"alert"),n&&o.jsx(ms,{popup:!0,open:s,saveConnect:!1,forceConnected:!1,action:"migrate-app-to-struct-v2",checkFn:t.get,checkTimeout:5*60*1e3,onSuccess:d,extraParams:{appDid:n.appDid,did:n.meta.did,wt:Ws(n,!0),title:N.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:i>=0?e("blocklet.migrate.success",{sec:i}):"Redirecting..."},onClose:p},"connect")]}dr.propTypes={};function si(){const e=Ds();return[...e.breakpoints.keys].reverse().reduce((n,r)=>{const s=X(e.breakpoints.up(r));return!n&&s?r:n},null)||"xs"}function oi(e){return o.jsx(it,{...e,children:o.jsx("path",{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z"})})}function ii(e){return o.jsx(it,{...e,children:o.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function ai(e){return o.jsx(it,{...e,children:o.jsx("path",{d:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2, 6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12, 13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"})})}function ci(e){return o.jsx(it,{...e,children:o.jsx("path",{d:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12A10,10 0 0,0 12,2Z"})})}const Be={fontSize:20,marginInlineEnd:8},li={success:o.jsx(oi,{style:Be}),warning:o.jsx(ii,{style:Be}),error:o.jsx(ai,{style:Be}),info:o.jsx(ci,{style:Be})},ui=Ps(e=>{const t={xl:"400px",lg:"400px",md:"400px",sm:"300px"},n=e.palette.background.default;return{lessPadding:{paddingLeft:8*2.5},contentRoot:{...e.typography.body2,display:"flex",backgroundColor:n,color:"#fff",alignItems:"center",padding:"6px 16px",borderRadius:"4px",boxShadow:"0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12)"},success:r=>({backgroundColor:`${Rs[600]} !important`,width:t[r.breakpoint]}),error:r=>({backgroundColor:`${e.palette.error.dark} !important`,width:t[r.breakpoint]}),info:r=>({backgroundColor:`${e.palette.primary.main} !important`,width:t[r.breakpoint]}),warning:r=>({backgroundColor:`${As[700]} !important`,width:t[r.breakpoint]}),icon:{fontSize:20},message:{display:"flex",alignItems:"center",padding:"8px 0",flex:1,width:0},action:{display:"flex",alignItems:"center",marginLeft:"auto",marginRight:-8,width:44}}});function Gt({keyId:e,notification:t={},viewAllUrl:n,content:r},s){var S,m,C;const a=ui({breakpoint:si()}),i=ee(),c=[a.contentRoot,a.lessPadding,a[t.severity]].join(" "),l=li[t.severity],{closeSnackbar:u}=Hn(),d=()=>u(e),p=Gn(),f=()=>{u(e),p(n)},y=ge(()=>wo(t),[t]),g=ge(()=>t==null?void 0:t.activity,[t]),h=jo({activity:g,users:[t==null?void 0:t.actorInfo],actors:[(S=t==null?void 0:t.activity)==null?void 0:S.actor],extra:{linkColor:i.palette.primary.main,userDid:(C=(m=t==null?void 0:t.receivers)==null?void 0:m[0])==null?void 0:C.did}});return o.jsxs(hs,{ref:s,className:c,children:[o.jsxs("div",{className:a.message,children:[l,o.jsx(fi,{onClick:f,style:{width:"calc(100% - 30px)"},children:o.jsx(_,{children:y?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"title",children:h}),g.meta?o.jsx(So,{meta:g.meta,type:g.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"title",children:t.title}),r||o.jsx("span",{className:"desc",children:t.description})]})})})]}),o.jsx("div",{className:a.action,children:o.jsx(Rt,{"aria-label":"close",color:"inherit",onClick:d,size:"large",children:o.jsx(gs,{className:a.icon})},"close")})]})}const di=x.forwardRef(Gt);Gt.propTypes={viewAllUrl:v.string.isRequired,keyId:v.number.isRequired,notification:v.object.isRequired,content:v.node};Gt.defaultProps={content:null};const fi=G.div`
13
+ cursor: pointer;
14
+ display: flex;
15
+ flex-direction: column;
16
+ .title {
17
+ overflow: hidden;
18
+ text-overflow: ellipsis;
19
+ display: -webkit-box;
20
+ -webkit-line-clamp: 1;
21
+ -webkit-box-orient: vertical;
22
+ font-weight: bold;
23
+ }
24
+ .desc {
25
+ overflow: hidden;
26
+ text-overflow: ellipsis;
27
+ display: -webkit-box;
28
+ -webkit-line-clamp: 3;
29
+ -webkit-box-orient: vertical;
30
+ word-break: break-word;
31
+ }
32
+ `,pi=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},mi=e=>e.every(t=>t.type==="text"),hi=e=>e.every(t=>t.type==="image"),gi=e=>uo(e,2).map(t=>({type:"combined",items:t})).filter(t=>(t.items||[]).every(n=>{var r,s,a;return(a=(s=(r=n==null?void 0:n.data)==null?void 0:r.text)==null?void 0:s.trim)==null?void 0:a.call(s)})),xi=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(n=>n.type===t)},vi=(e,t)=>{try{const n=xs.toTypeInfo(e);if(!(n.role!==void 0&&n.role!==vs.types.RoleType.ACCOUNT))return;const s=he(M.WELLKNOWN_SERVICE_PATH_PREFIX,"user");return Xn(s,{did:e,locale:t})}catch(n){console.error(n);return}},ue=(e,t)=>({...e,...t?{filter:"invert(1)"}:{}}),De=e=>{if(!e)return null;try{return new URL(e).protocol!=="https:"?(console.warn("Image URL must use HTTPS protocol:",e),null):`${M.WELLKNOWN_SERVICE_PATH_PREFIX}/proxy?url=${e}`}catch(t){return console.warn("Invalid image URL format:",e,t),null}};function fr({attachment:e}){const{data:t}=e,n=ee();let r="";try{r=new URL(t.url).host}catch{r=t.url}return o.jsxs(Se,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},onClick:s=>{s.customPreventRedirect=!0},children:[!!r&&o.jsx("span",{className:"url",children:r}),!!t.title&&o.jsx(_,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&o.jsx(_,{className:"description",style:{whiteSpace:"unset",color:n.palette.text.secondary},children:t.description}),!!t.image&&o.jsx(Le,{src:Ye.getImagePath(t.image),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:De(Ye.getImagePath(t.image))})]})}fr.propTypes={attachment:v.object.isRequired};function pr({attachment:e}){const{data:t}=e;return o.jsx(Le,{src:Ye.getImagePath(t.url),alt:t.title||"",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"},fallback:De(Ye.getImagePath(t.url))})}pr.propTypes={attachment:v.object.isRequired};function mr({attachment:e,...t}){var c;const{data:n}=e,r=((c=n.color)==null?void 0:c.toLowerCase())||t.color,s=n.size||t.size,a=n.fontWeight||t.fontWeight||400;let i="14px";return s==="small"?i="12px":s==="normal"?i="14px":s==="big"?i="16px":s==="large"&&(i="18px"),o.jsx(yi,{className:"title",style:{fontSize:i,color:r,whiteSpace:"unset",fontWeight:a},children:n.text})}mr.propTypes={attachment:v.object.isRequired};const yi=G.span`
33
+ width: 100%;
34
+ display: -webkit-box;
35
+ -webkit-box-orient: vertical;
36
+ -webkit-line-clamp: 2;
37
+ overflow: hidden;
38
+ text-overflow: ellipsis;
39
+ white-space: normal;
40
+ word-break: break-word;
41
+ `;Qt.propTypes={locale:v.string,data:v.object.isRequired};Qt.defaultProps={locale:"en"};function Qt({locale:e="en",data:t}){const n={zh:"来自",en:"from"}[e]||"from",r={zh:"接收",en:"Received"}[e]||"Received",a=`https://${ke.getUrlHost(t.chainHost)||ke.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`,i=ee(),c=i.palette.mode==="dark";let l=t.amount;t.decimal&&(l=t.amount/10**t.decimal);const u=ge(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return o.jsx("a",{href:a,target:"_blank",rel:"noreferrer",onClick:d=>{d.customPreventRedirect=!0},children:o.jsxs(_,{display:"flex",flexDirection:"column",children:[o.jsxs(_,{sx:u,children:[o.jsx(H,{component:"div",sx:{fontWeight:700,color:i.palette.text.primary},children:r}),o.jsxs(H,{component:"div",align:"right",style:ue(tt.summaryStyle,c),flex:1,children:["+",l," ",t.symbol]})]}),o.jsxs(_,{sx:u,children:[o.jsx(H,{component:"div",style:ue({...tt.remarkStyle,fontSize:14},c),children:n}),o.jsx(_,{maxWidth:260,fontSize:14,children:o.jsx(Pt,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}Zt.propTypes={locale:v.string,data:v.object.isRequired};Zt.defaultProps={locale:"en"};function Zt({locale:e,data:t}){var d,p;const n={zh:"接收",en:"Received"}[e]||"Received",r={zh:"来自",en:"from"}[e]||"from",s=ke.getUrlHost(t.chainHost)||ke.getChainHost(t.chainId),a=t.did||((p=(d=t==null?void 0:t.credential)==null?void 0:d.issuer)==null?void 0:p.id)||"",i=`https://${s}/explorer/assets/${a}`,l=ee().palette.mode==="dark",u=ge(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return o.jsx(_,{sx:{pr:1},children:o.jsx("a",{href:i,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},onClick:f=>{f.customPreventRedirect=!0},rel:"noreferrer",children:o.jsxs(_,{display:"flex",flexDirection:"column",children:[o.jsxs(_,{sx:u,children:[o.jsx(H,{component:"div",sx:{fontWeight:700,color:"text.primary"},children:n}),o.jsx(H,{component:"div",align:"right",style:ue(tt.summaryStyle,l),children:"+1 Asset"})]}),a?o.jsxs(_,{sx:u,children:[o.jsx(H,{component:"div",style:ue({...tt.remarkStyle,fontSize:14},l),children:r}),o.jsx(_,{maxWidth:260,fontSize:14,children:o.jsx(Pt,{did:a,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}hr.propTypes={data:v.object.isRequired,locale:v.string};function hr({data:e,locale:t="en"}){const r=ee().palette.mode==="dark";return o.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},onClick:s=>{s.customPreventRedirect=!0},rel:"noreferrer",children:[o.jsx(Le,{className:"image",src:e.logo,width:50,height:50,alt:"",fallback:De(e.logo)}),o.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[o.jsx("div",{style:ue({marginBottom:"6px"},r),children:e.title}),o.jsx(_,{maxWidth:260,fontSize:10,children:o.jsx(Pt,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}Xt.propTypes={locale:v.string,data:v.object.isRequired};Xt.defaultProps={locale:"en"};function Xt({locale:e,data:t}){const n=ke.getChainHost(t.chainId),r=`https://${n}/explorer/txs/${t.hash}`,s={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",a={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash",i=ee(),c=i.palette.mode==="dark";return o.jsxs("a",{href:r,target:"_blank",style:ue({textDecoration:"none",color:"initial",display:"block",fontSize:14},c),onClick:l=>{l.customPreventRedirect=!0},rel:"noreferrer",children:[o.jsx("h6",{style:{color:i.palette.text.secondary,margin:0},children:n}),o.jsx("p",{style:{color:i.palette.warning.main,margin:0},children:s}),o.jsxs("div",{style:{wordBreak:"break-all"},children:[a,": ",t.hash]})]})}function gr({attachment:e,...t}){const{local:n}=x.useContext(Lt),r=X(a=>a.breakpoints.down("md")),s=ee();return o.jsxs(bi,{...t,isMd:r,children:[e.type==="link"&&o.jsx(fr,{attachment:e,...t,isMd:r}),e.type==="image"&&o.jsx(pr,{attachment:e,isMd:r}),e.type==="text"&&o.jsx(mr,{attachment:e,isMd:r}),e.type==="token"&&o.jsx(Qt,{data:e.data,local:n,isMd:r}),e.type==="asset"||e.type==="vc"?o.jsx(Zt,{data:e.data,local:n,isMd:r}):null,e.type==="dapp"&&o.jsx(hr,{data:e.data,local:n,isMd:r}),e.type==="transaction"&&o.jsx(Xt,{data:e.data,local:n,...t,isMd:r}),e.type==="divider"&&o.jsx(Mt,{sx:{mb:1,mt:1},style:{color:s.palette.divider}})]})}const bi=G.div`
42
+ display: ${({sx:e={}})=>e.display||"flex"};
43
+ flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
44
+ gap: ${({sx:e={}})=>e.gap||1};
45
+ width: ${({isMd:e=!1})=>e?"100%":"auto"};
46
+ &:last-child {
47
+ margin-bottom: 0;
48
+ }
49
+ `;gr.propTypes={attachment:v.object.isRequired};function xr({data:e,...t}){const{items:n}=e;return o.jsx(wi,{...t,children:n.map(r=>o.jsxs(Bn,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128},children:[o.jsxs(_,{display:"flex",alignItems:"center",gap:1,children:[r.icon?o.jsx(Le,{src:r.icon,alt:r.title,style:{width:16,height:16},fallback:De(r.icon)}):null,o.jsxs(_,{className:"metric-name",display:"flex",alignItems:"center",children:[r.title,r.subtitle?o.jsx(Ee,{title:r.subtitle,arrow:!0,placement:"top",children:o.jsx(Io,{fontSize:"small",sx:{fontSize:14,ml:.5}})}):null]})]}),o.jsxs(_,{className:"metric-number",sx:{color:r.content_color||"rgba(3, 7, 18, 1)"},children:[r.content,r.sub_content?o.jsxs("span",{className:"sub-content",style:{color:r.sub_content_color||"rgba(156, 163, 175, 1)"},children:["(",r.sub_content,")"]}):null]})]},r.title))})}const wi=G(_)`
50
+ display: flex;
51
+ justify-content: flex-start;
52
+ flex-wrap: wrap;
53
+ gap: 16px;
54
+ .metric-number {
55
+ font-size: 18px;
56
+ font-weight: 600;
57
+ .sub-content {
58
+ font-size: 12px;
59
+ font-weight: 400;
60
+ margin-left: 4px;
61
+ }
62
+ }
63
+ .metric-name {
64
+ font-size: 14px;
65
+ color: rgba(156, 163, 175, 1);
66
+ }
67
+ `;xr.propTypes={data:v.object.isRequired};function vr({data:e}){const{items:t}=e,n=X(i=>i.breakpoints.down("sm")),r=X(i=>i.breakpoints.down("md")),s=X(i=>i.breakpoints.down("lg")),a=()=>n?1:r?3:s?4:6;return o.jsx(Ms,{variant:"quilted",cols:a(),gap:8,rowHeight:128,sx:{margin:0},children:t.map(i=>{const c=i.cover||i.display;return c?o.jsx("a",{href:i.link,target:"_blank",rel:"noopener noreferrer",children:o.jsx($s,{children:o.jsx(Le,{src:c,alt:i.title||"",style:{borderRadius:"8px"},fallback:De(c)})})},c):null})})}vr.propTypes={data:v.object.isRequired};function Jt({data:e,feedType:t,...n}){return o.jsxs(ji,{...n,children:[t==="data-tracker"&&e.type==="table"&&o.jsx(xr,{data:e}),(t==="graphic"||t==="gallery")&&o.jsx(vr,{data:e})]})}const ji=G.div`
68
+ display: flex;
69
+ flex-direction: column;
70
+ width: 100%;
71
+ margin-bottom: 4px;
72
+ &:last-child {
73
+ margin-bottom: 0;
74
+ }
75
+ `;Jt.propTypes={data:v.object.isRequired,feedType:v.string};Jt.defaultProps={feedType:"data-tracker"};Ge.propTypes={data:v.object.isRequired,style:v.object};function Ge({data:e,style:t={}}){const r=ee().palette.mode==="dark";return o.jsx(H,{style:ue({color:r&&e.darkModeColor?e.darkModeColor:e.color||"initial",margin:0,whiteSpace:"pre-line!important",...t},r),children:e.text})}function yr({data:e}){const t=[];for(let n=0;n<(e==null?void 0:e.length);n+=2){const r=e[n],s=e[n+1];r&&s?t.push(o.jsxs(Tn,{children:[o.jsx("td",{className:"label-col",children:o.jsx(Ge,{data:r.data,style:{whiteSpace:"nowrap"}})}),o.jsx("td",{className:"value-col",children:o.jsx(Ge,{data:s.data,style:{wordBreak:"break-all"}})})]},n)):r&&t.push(o.jsx(Tn,{children:o.jsx("td",{className:"label-col",children:o.jsx(Ge,{data:r.data})})},n))}return o.jsx("table",{style:{width:"100%"},children:o.jsx("tbody",{children:t})})}yr.propTypes={data:v.array.isRequired};const Tn=G.tr`
76
+ display: flex;
77
+ flex-direction: row;
78
+ justify-content: flex-start;
79
+ align-items: center;
80
+ gap: ${({theme:e})=>e.spacing(1)};
81
+ .label-col {
82
+ min-width: 130px;
83
+ flex-shrink: 0;
84
+ }
85
+ .value-col {
86
+ flex: 1;
87
+ }
88
+ `;function Yt({notification:e,severity:t,showSke:n=!0}){const{attachments:r,data:s,...a}=e,i=X(d=>d.breakpoints.down("md"));if((!r||!r.length)&&Ke(s))return null;const c=pi(t),l=(d,p=!1)=>{if(!d&&!Array.isArray(d))return null;let f=d,y={},g="horizontal";p&&mi(d)&&(f=gi(d),g="vertical",y={display:"flex",gap:8,flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",height:"100%",width:i||f.length===1?"100%":"28%"});const h=xi(f);return o.jsx(_,{sx:{width:"100%",display:"flex",gap:1,flexDirection:p?"row":"column",justifyContent:"flex-start",alignItems:p?"center":"unset",flexWrap:"wrap"},children:f.map((S,m)=>S.type==="section"?o.jsx(yr,{data:S.fields},m):o.jsxs(x.Fragment,{children:[o.jsx(gr,{attachment:S,style:y,...a}),!(i&&g==="vertical")&&h&&f.length>1&&m!==f.length-1?o.jsx(Mt,{orientation:g,style:{color:ys.dividerColor},sx:g==="vertical"?{ml:2,mr:2,height:32}:{}}):null]},m))})},u=hi(r);return o.jsx(Si,{children:o.jsxs("div",{className:"message-in-list",children:[r.length>0&&o.jsx("div",{className:"message-container",style:i?{width:"100%"}:{},children:u?l(r):o.jsx(Bn,{variant:"outlined",sx:{p:i?1:2,borderRadius:"8px",minWidth:128,borderColor:c},children:l(r)})}),!Ke(s)&&o.jsx("div",{className:"message-container",children:o.jsx("div",{className:"data-container",children:o.jsx(Jt,{data:s,feedType:e.feedType})})}),r.length===0&&Ke(s)&&n&&o.jsx(Os,{className:"attach-ske",style:{marginTop:10},variant:"rectangular",height:150})]})})}const Si=G.div`
89
+ display: flex;
90
+ flex-direction: column;
91
+ .message-in-list {
92
+ padding: 8px 8px 8px 0;
93
+ display: flex;
94
+ border-radius: 8px;
95
+ }
96
+ .message-title {
97
+ color: #25292f;
98
+ font-size: 18px;
99
+ font-weight: bold;
100
+ word-break: break-all;
101
+ }
102
+
103
+ .attach-ske {
104
+ position: relative;
105
+ margin-left: 10px;
106
+ &::after {
107
+ content: '';
108
+ position: absolute;
109
+ left: -10px;
110
+ top: 0;
111
+ height: 100%;
112
+ width: 4px;
113
+ background-color: ${e=>e.leftLineColor};
114
+ }
115
+ }
116
+
117
+ .message-body {
118
+ color: #25292f;
119
+ font-size: 16px;
120
+ word-break: break-all;
121
+ white-space: pre-line;
122
+ }
123
+ .message-container {
124
+ display: flex;
125
+ flex-direction: column;
126
+ justify-content: flex-start;
127
+ .data-container,
128
+ .attachment-container {
129
+ display: flex;
130
+ flex-direction: column;
131
+ width: 100%;
132
+ }
133
+ }
134
+ .actions-container {
135
+ margin-top: 10px;
136
+ .actions-item {
137
+ margin-right: 8px;
138
+ }
139
+ }
140
+ `;Yt.propTypes={severity:v.string.isRequired,notification:v.object.isRequired,showSke:v.bool};Yt.defaultProps={showSke:!0};const pt=e=>po.sanitize(e,{ALLOWED_ATTR:["href","target","rel","class","id","style"]}),_i=async(e,t)=>{const{type:n,did:r}=e;return Jn.isSameAddr(n,"did")?await vi(r,t)||et.getLink(e):et.getLink(e)};function Ci(e){return new TextEncoder().encode(e).length>=1e4}const Ii=async(e,t,n=!0)=>{let r=e;Ci(e)&&(r=e.slice(0,1e4));const s=et.toTextList(r);return await Promise.all(s.map(async i=>{if(i instanceof et.Link){if(n){const c=await _i(i,t),{type:l,chainId:u,did:d}=i;return Jn.isSameAddr(l,"dapp")?`<em style="font-weight:bold;" data-type="${l}" data-chain-id="${u}" data-did="${d}">${i.text}</em>`:c?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${c}">${i.text}</a>`:`<em style="font-weight:bold;" data-type="${l}" data-chain-id="${u}" data-did="${d}">${i.text}</em>`}return i.text}return i})).then(i=>i.join(""))};br.propTypes={notification:v.object,rows:v.number,minimal:v.bool};function br({notification:e,rows:t=2,minimal:n=!1}){const[r,s]=x.useState(!1),[a,i]=x.useState(""),{t:c,locale:l}=Y(),{palette:u}=ee(),d=x.useMemo(()=>{const{attachments:m}=e||{};if(!m)return!1;try{return m.length>0}catch{return!1}},[e]),p=x.useMemo(()=>{const{blocks:m}=e||{};if(!m)return!1;try{return m.length>0}catch{return!1}},[e]),f=x.useMemo(()=>{const{description:m}=e||{};return!!m},[e]),y=x.useMemo(()=>{const{data:m}=e||{};return!Ke(m)},[e]),g=x.useMemo(()=>d||p||f||y,[d,p,f,y]);if(x.useEffect(()=>{Ii((e==null?void 0:e.description)??"",l).then(m=>{i(m)})},[e==null?void 0:e.description,l]),!g)return null;const h=()=>t===0?"":r?`<span class='toggle-btn' data-name='toggle-expanded'>${c("common.collapse")}</span>`:`...<span class='toggle-btn' data-name='toggle-expanded'>${c("common.expand")}</span>`,S=m=>{const{target:C}=m;C.getAttribute("data-name")==="toggle-expanded"&&(s(!r),m.customPreventRedirect=!0)};return o.jsxs(Ei,{color:n?u.primary.contrastText:"",children:[o.jsx(_,{className:"text-container",component:"div",onClick:S,children:a&&(!r&&t>0?o.jsx(_o,{basedOn:"letters",unsafeHTML:pt(a),maxLine:t,ellipsisHTML:pt(h())}):o.jsx(H,{component:"div",className:`content ${t===0?"ellipsis":""}`,style:{whiteSpace:"pre-line!important"},dangerouslySetInnerHTML:{__html:pt(`${a}${h()}`)}}))}),!n&&(d||y)?o.jsx(Yt,{severity:e.severity,notification:e}):null]})}const Ei=G(_)`
141
+ width: 100%;
142
+ color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
143
+ .text-container {
144
+ word-wrap: break-word;
145
+ word-break: break-all;
146
+ color: ${e=>e.color?e.color:e.theme.palette.text.secondary};
147
+ .toggle-btn {
148
+ display: inline-block;
149
+ white-space: nowrap;
150
+ cursor: pointer;
151
+ margin-left: 4px;
152
+ color: ${e=>e.theme.palette.secondary.main};
153
+ }
154
+ .content.ellipsis {
155
+ overflow: hidden;
156
+ text-overflow: ellipsis;
157
+ word-break: break-all;
158
+ display: block;
159
+ display: -webkit-box;
160
+ -webkit-box-orient: vertical;
161
+ -webkit-line-clamp: 2;
162
+ line-height: 1.25;
163
+ }
164
+ }
165
+ `,ki=x.memo(br);var P=function(t,n,r){return Fn.call(n,"css")?o.jsx(Vn,qn(t,n),r):o.jsx(t,n,r)},Fe=function(t,n,r){return Fn.call(n,"css")?o.jsxs(Vn,qn(t,n),r):o.jsxs(t,n,r)};/**
166
+ * (c) Iconify
167
+ *
168
+ * For the full copyright and license information, please view the license.txt or license.gpl.txt
169
+ * files at https://github.com/iconify/iconify
170
+ *
171
+ * Licensed under MIT.
172
+ *
173
+ * @license MIT
174
+ * @version 3.1.1
175
+ */const wr=Object.freeze({left:0,top:0,width:16,height:16}),nt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Pe=Object.freeze({...wr,...nt}),xt=Object.freeze({...Pe,body:"",hidden:!1});function Ti(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Ln(e,t){const n=Ti(e,t);for(const r in xt)r in nt?r in e&&!(r in n)&&(n[r]=nt[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Li(e,t){const n=e.icons,r=e.aliases||Object.create(null),s=Object.create(null);function a(i){if(n[i])return s[i]=[];if(!(i in s)){s[i]=null;const c=r[i]&&r[i].parent,l=c&&a(c);l&&(s[i]=[c].concat(l))}return s[i]}return Object.keys(n).concat(Object.keys(r)).forEach(a),s}function Di(e,t,n){const r=e.icons,s=e.aliases||Object.create(null);let a={};function i(c){a=Ln(r[c]||s[c],a)}return i(t),n.forEach(i),Ln(e,a)}function Pi(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),n.push(s)});const r=Li(e);for(const s in r){const a=r[s];a&&(t(s,Di(e,s,a)),n.push(s))}return n}const _e=/^[a-z0-9]+(-[a-z0-9]+)*$/,ye=(e,t,n,r="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;r=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const c=s.pop(),l=s.pop(),u={provider:s.length>0?s[0]:r,prefix:l,name:c};return t&&!Qe(u)?null:u}const a=s[0],i=a.split("-");if(i.length>1){const c={provider:r,prefix:i.shift(),name:i.join("-")};return t&&!Qe(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:a};return t&&!Qe(c,n)?null:c}return null},Qe=(e,t)=>e?!!((e.provider===""||e.provider.match(_e))&&(t&&e.prefix===""||e.prefix.match(_e))&&e.name.match(_e)):!1,Ri={provider:"",aliases:{},not_found:{},...wr};function mt(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ai(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!mt(e,Ri))return null;const n=t.icons;for(const s in n){const a=n[s];if(!s.match(_e)||typeof a.body!="string"||!mt(a,xt))return null}const r=t.aliases||Object.create(null);for(const s in r){const a=r[s],i=a.parent;if(!s.match(_e)||typeof i!="string"||!n[i]&&!r[i]||!mt(a,xt))return null}return t}const rt=Object.create(null);function Mi(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function J(e,t){const n=rt[e]||(rt[e]=Object.create(null));return n[t]||(n[t]=Mi(e,t))}function en(e,t){return Ai(t)?Pi(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function $i(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function Oi(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(rt)).forEach(s=>{(typeof s=="string"&&typeof t=="string"?[t]:Object.keys(rt[s]||{})).forEach(i=>{const c=J(s,i);n=n.concat(Object.keys(c.icons).map(l=>(s!==""?"@"+s+":":"")+i+":"+l))})}),n}let tn=!1;function Ni(e){return tn}function Re(e){const t=typeof e=="string"?ye(e,!0,tn):e;if(t){const n=J(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function Ui(e,t){const n=ye(e,!0,tn);if(!n)return!1;const r=J(n.provider,n.prefix);return $i(r,n.name,t)}function jr(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!Qe({provider:t,prefix:n,name:"a"}))return!1;const r=J(t,n);return!!en(r,e)}function zi(e){return!!Re(e)}function Hi(e){const t=Re(e);return t?{...Pe,...t}:null}const Sr=Object.freeze({width:null,height:null}),_r=Object.freeze({...Sr,...nt}),Bi=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Fi=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function vt(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Bi);if(r===null||!r.length)return e;const s=[];let a=r.shift(),i=Fi.test(a);for(;;){if(i){const c=parseFloat(a);isNaN(c)?s.push(a):s.push(Math.ceil(c*t*n)/n)}else s.push(a);if(a=r.shift(),a===void 0)return s.join("");i=!i}}const Vi=e=>e==="unset"||e==="undefined"||e==="none";function ct(e,t){const n={...Pe,...e},r={..._r,...t},s={left:n.left,top:n.top,width:n.width,height:n.height};let a=n.body;[n,r].forEach(g=>{const h=[],S=g.hFlip,m=g.vFlip;let C=g.rotate;S?m?C+=2:(h.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),h.push("scale(-1 1)"),s.top=s.left=0):m&&(h.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),h.push("scale(1 -1)"),s.top=s.left=0);let w;switch(C<0&&(C-=Math.floor(C/4)*4),C=C%4,C){case 1:w=s.height/2+s.top,h.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:h.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:w=s.width/2+s.left,h.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}C%2===1&&(s.left!==s.top&&(w=s.left,s.left=s.top,s.top=w),s.width!==s.height&&(w=s.width,s.width=s.height,s.height=w)),h.length&&(a='<g transform="'+h.join(" ")+'">'+a+"</g>")});const i=r.width,c=r.height,l=s.width,u=s.height;let d,p;i===null?(p=c===null?"1em":c==="auto"?u:c,d=vt(p,l/u)):(d=i==="auto"?l:i,p=c===null?vt(d,u/l):c==="auto"?u:c);const f={},y=(g,h)=>{Vi(h)||(f[g]=h.toString())};return y("width",d),y("height",p),f.viewBox=s.left.toString()+" "+s.top.toString()+" "+l.toString()+" "+u.toString(),{attributes:f,body:a}}const qi=/\sid="(\S+)"/g,Wi="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Ki=0;function Cr(e,t=Wi){const n=[];let r;for(;r=qi.exec(e);)n.push(r[1]);if(!n.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(a=>{const i=typeof t=="function"?t(a):t+(Ki++).toString(),c=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+i+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const le={local:!0,session:!0},Ir={local:new Set,session:new Set};let nn=!1;function Gi(e){nn=e}const Dn="iconify2",Te="iconify",Er=Te+"-count",Pn=Te+"-version",kr=36e5,Qi=168;function yt(e,t){try{return e.getItem(t)}catch{}}function rn(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Rn(e,t){try{e.removeItem(t)}catch{}}function bt(e,t){return rn(e,Er,t.toString())}function wt(e){return parseInt(yt(e,Er))||0}let Ve=typeof window>"u"?{}:window;function Tr(e){const t=e+"Storage";try{if(Ve&&Ve[t]&&typeof Ve[t].length=="number")return Ve[t]}catch{}le[e]=!1}function Lr(e,t){const n=Tr(e);if(!n)return;const r=yt(n,Pn);if(r!==Dn){if(r){const c=wt(n);for(let l=0;l<c;l++)Rn(n,Te+l.toString())}rn(n,Pn,Dn),bt(n,0);return}const s=Math.floor(Date.now()/kr)-Qi,a=c=>{const l=Te+c.toString(),u=yt(n,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>s&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,c))return!0}catch{}Rn(n,l)}};let i=wt(n);for(let c=i-1;c>=0;c--)a(c)||(c===i-1?(i--,bt(n,i)):Ir[e].add(c))}function Dr(){if(!nn){Gi(!0);for(const e in le)Lr(e,t=>{const n=t.data,r=t.provider,s=n.prefix,a=J(r,s);if(!en(a,n).length)return!1;const i=n.lastModified||-1;return a.lastModifiedCached=a.lastModifiedCached?Math.min(a.lastModifiedCached,i):i,!0})}}function Pr(e,t){switch(e){case"local":case"session":le[e]=t;break;case"all":for(const n in le)le[n]=t;break}}const jt=Object.create(null);function Rr(e,t){jt[e]=t}function St(e){return jt[e]||jt[""]}function sn(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const lt=Object.create(null),we=["https://api.simplesvg.com","https://api.unisvg.com"],Ze=[];for(;we.length>0;)we.length===1||Math.random()>.5?Ze.push(we.shift()):Ze.push(we.pop());lt[""]=sn({resources:["https://api.iconify.design"].concat(Ze)});function Ar(e,t){const n=sn(t);return n===null?!1:(lt[e]=n,!0)}function ut(e){return lt[e]}function Zi(){return Object.keys(lt)}const Xi=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let st=Xi();function Ji(e){st=e}function Yi(){return st}function ea(e,t){const n=ut(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let s=0;n.resources.forEach(i=>{s=Math.max(s,i.length)});const a=t+".json?icons=";r=n.maxURL-s-n.path.length-a.length}return r}function ta(e){return e===404}const na=(e,t,n)=>{const r=[],s=ea(e,t),a="icons";let i={type:a,provider:e,prefix:t,icons:[]},c=0;return n.forEach((l,u)=>{c+=l.length+1,c>=s&&u>0&&(r.push(i),i={type:a,provider:e,prefix:t,icons:[]},c=l.length),i.icons.push(l)}),r.push(i),r};function ra(e){if(typeof e=="string"){const t=ut(e);if(t)return t.path}return"/"}const sa=(e,t,n)=>{if(!st){n("abort",424);return}let r=ra(t.provider);switch(t.type){case"icons":{const a=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});r+=a+".json?"+l.toString();break}case"custom":{const a=t.uri;r+=a.slice(0,1)==="/"?a.slice(1):a;break}default:n("abort",400);return}let s=503;st(e+r).then(a=>{const i=a.status;if(i!==200){setTimeout(()=>{n(ta(i)?"abort":"next",i)});return}return s=501,a.json()}).then(a=>{if(typeof a!="object"||a===null){setTimeout(()=>{a===404?n("abort",a):n("next",s)});return}setTimeout(()=>{n("success",a)})}).catch(()=>{n("next",s)})},oa={prepare:na,send:sa};function ia(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((s,a)=>s.provider!==a.provider?s.provider.localeCompare(a.provider):s.prefix!==a.prefix?s.prefix.localeCompare(a.prefix):s.name.localeCompare(a.name));let r={provider:"",prefix:"",name:""};return e.forEach(s=>{if(r.name===s.name&&r.prefix===s.prefix&&r.provider===s.provider)return;r=s;const a=s.provider,i=s.prefix,c=s.name,l=n[a]||(n[a]=Object.create(null)),u=l[i]||(l[i]=J(a,i));let d;c in u.icons?d=t.loaded:i===""||u.missing.has(c)?d=t.missing:d=t.pending;const p={provider:a,prefix:i,name:c};d.push(p)}),t}function Mr(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(s=>s.id!==t))})}function aa(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,s=e.prefix;t.forEach(a=>{const i=a.icons,c=i.pending.length;i.pending=i.pending.filter(l=>{if(l.prefix!==s)return!0;const u=l.name;if(e.icons[u])i.loaded.push({provider:r,prefix:s,name:u});else if(e.missing.has(u))i.missing.push({provider:r,prefix:s,name:u});else return n=!0,!0;return!1}),i.pending.length!==c&&(n||Mr([e],a.id),a.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),a.abort))})}))}let ca=0;function la(e,t,n){const r=ca++,s=Mr.bind(null,n,r);if(!t.pending.length)return s;const a={id:r,icons:t,callback:e,abort:s};return n.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(a)}),s}function ua(e,t=!0,n=!1){const r=[];return e.forEach(s=>{const a=typeof s=="string"?ye(s,t,n):s;a&&r.push(a)}),r}var da={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function fa(e,t,n,r){const s=e.resources.length,a=e.random?Math.floor(Math.random()*s):e.index;let i;if(e.random){let j=e.resources.slice(0);for(i=[];j.length>1;){const k=Math.floor(Math.random()*j.length);i.push(j[k]),j=j.slice(0,k).concat(j.slice(k+1))}i=i.concat(j)}else i=e.resources.slice(a).concat(e.resources.slice(0,a));const c=Date.now();let l="pending",u=0,d,p=null,f=[],y=[];typeof r=="function"&&y.push(r);function g(){p&&(clearTimeout(p),p=null)}function h(){l==="pending"&&(l="aborted"),g(),f.forEach(j=>{j.status==="pending"&&(j.status="aborted")}),f=[]}function S(j,k){k&&(y=[]),typeof j=="function"&&y.push(j)}function m(){return{startTime:c,payload:t,status:l,queriesSent:u,queriesPending:f.length,subscribe:S,abort:h}}function C(){l="failed",y.forEach(j=>{j(void 0,d)})}function w(){f.forEach(j=>{j.status==="pending"&&(j.status="aborted")}),f=[]}function L(j,k,E){const T=k!=="success";switch(f=f.filter(I=>I!==j),l){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if(k==="abort"){d=E,C();return}if(T){d=E,f.length||(i.length?R():C());return}if(g(),w(),!e.random){const I=e.resources.indexOf(j.resource);I!==-1&&I!==e.index&&(e.index=I)}l="completed",y.forEach(I=>{I(E)})}function R(){if(l!=="pending")return;g();const j=i.shift();if(j===void 0){if(f.length){p=setTimeout(()=>{g(),l==="pending"&&(w(),C())},e.timeout);return}C();return}const k={status:"pending",resource:j,callback:(E,T)=>{L(k,E,T)}};f.push(k),u++,p=setTimeout(R,e.rotate),n(j,t,k.callback)}return setTimeout(R),m}function $r(e){const t={...da,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function s(c,l,u){const d=fa(t,c,l,(p,f)=>{r(),u&&u(p,f)});return n.push(d),d}function a(c){return n.find(l=>c(l))||null}return{query:s,find:a,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function An(){}const ht=Object.create(null);function pa(e){if(!ht[e]){const t=ut(e);if(!t)return;const n=$r(t),r={config:t,redundancy:n};ht[e]=r}return ht[e]}function Or(e,t,n){let r,s;if(typeof e=="string"){const a=St(e);if(!a)return n(void 0,424),An;s=a.send;const i=pa(e);i&&(r=i.redundancy)}else{const a=sn(e);if(a){r=$r(a);const i=e.resources?e.resources[0]:"",c=St(i);c&&(s=c.send)}}return!r||!s?(n(void 0,424),An):r.query(t,s,n)().abort}function ma(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in le)Lr(r,s=>{const a=s.data;return s.provider!==e.provider||a.prefix!==e.prefix||a.lastModified===t});return!0}function ha(e,t){nn||Dr();function n(r){let s;if(!le[r]||!(s=Tr(r)))return;const a=Ir[r];let i;if(a.size)a.delete(i=Array.from(a).shift());else if(i=wt(s),!bt(s,i+1))return;const c={cached:Math.floor(Date.now()/kr),provider:e.provider,data:t};return rn(s,Te+i.toString(),JSON.stringify(c))}t.lastModified&&!ma(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Mn(){}function ga(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,aa(e)}))}function xa(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,s=e.iconsToLoad;delete e.iconsToLoad;let a;if(!s||!(a=St(n)))return;a.prepare(n,r,s).forEach(c=>{Or(n,c,l=>{if(typeof l!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=en(e,l);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(p=>{d.delete(p)}),ha(e,l)}catch(u){console.error(u)}ga(e)})})}))}const va=e=>{const n=J(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},on=(e,t)=>{const n=ua(e,!0,Ni()),r=ia(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Mn)}),()=>{l=!1}}const s=Object.create(null),a=[];let i,c;return r.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===c&&u===i)return;i=u,c=d,a.push(J(u,d));const p=s[u]||(s[u]=Object.create(null));p[d]||(p[d]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:d,name:p}=l,f=J(u,d),y=f.pendingIcons||(f.pendingIcons=new Set);y.has(p)||(y.add(p),s[u][d].push(p))}),a.forEach(l=>{const{provider:u,prefix:d}=l;s[u][d].length&&xa(l,s[u][d])}),t?la(t,r,a):Mn},ya=e=>new Promise((t,n)=>{const r=typeof e=="string"?ye(e,!0):e;if(!r){n(e);return}on([r||e],s=>{if(s.length&&r){const a=Re(r);if(a){t({...Pe,...a});return}}n(e)})});function Nr(e,t){const n={...e};for(const r in t){const s=t[r],a=typeof s;r in Sr?(s===null||s&&(a==="string"||a==="number"))&&(n[r]=s):a===typeof n[r]&&(n[r]=r==="rotate"?s%4:s)}return n}const dt={..._r,inline:!1},gt="iconify",_t="iconify-inline",se="iconifyData"+Date.now();let de=[];function Ae(e){for(let t=0;t<de.length;t++){const n=de[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function Ur(e,t=!1){let n=Ae(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},de.push(n),n)}function ba(){if(document.documentElement)return Ur(document.documentElement);de.push({node:()=>document.documentElement})}function wa(e){de=de.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function Me(){return de}function ja(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let Ce=null;const Sa={childList:!0,subtree:!0,attributes:!0};function zr(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,Ce&&Ce(e)}))}function _a(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const s=t[r];if(s.addedNodes&&s.addedNodes.length>0||s.type==="attributes"&&s.target[se]!==void 0){n.paused||zr(e);return}}}function Hr(e,t){e.observer.instance.observe(t,Sa)}function ot(e){let t=e.observer;if(t&&t.instance)return;const n=typeof e.node=="function"?e.node():e.node;!n||!window||(t||(t={paused:0},e.observer=t),t.instance=new window.MutationObserver(_a.bind(null,e)),Hr(e,n),t.paused||zr(e))}function $n(){Me().forEach(ot)}function Br(e){if(!e.observer)return;const t=e.observer;t.pendingScan&&(clearTimeout(t.pendingScan),delete t.pendingScan),t.instance&&(t.instance.disconnect(),delete t.instance)}function Ca(e){const t=Ce!==null;if(Ce!==e&&(Ce=e,t&&Me().forEach(Br)),t){$n();return}ja($n)}function Ct(e){(e?[e]:Me()).forEach(t=>{if(!t.observer){t.observer={paused:1};return}const n=t.observer;if(n.paused++,n.paused>1||!n.instance)return;n.instance.disconnect()})}function Ia(e){if(e){const t=Ae(e);t&&Ct(t)}else Ct()}function It(e){(e?[e]:Me()).forEach(t=>{if(!t.observer){ot(t);return}const n=t.observer;if(n.paused&&(n.paused--,!n.paused)){const r=typeof t.node=="function"?t.node():t.node;if(r)n.instance?Hr(t,r):ot(t);else return}})}function Ea(e){if(e){const t=Ae(e);t&&It(t)}else It()}function Fr(e,t=!1){const n=Ur(e,t);return ot(n),n}function Vr(e){const t=Ae(e);t&&(Br(t),wa(e))}function ka(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const s in dt)if(n[s]!==r[s])return!0;return!1}function Ta(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(s){for(;s<0;)s+=4;return s%4}if(n===""){const s=parseInt(e);return isNaN(s)?0:r(s)}else if(n!==e){let s=0;switch(n){case"%":s=25;break;case"deg":s=90}if(s){let a=parseFloat(e.slice(0,e.length-n.length));return isNaN(a)?0:(a=a/s,a%1===0?r(a):0)}}return t}const La=/[\s,]+/;function Da(e,t){t.split(La).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Pa=["width","height"],Ra=["inline","hFlip","vFlip"];function Aa(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function Ma(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&ye(t,!0);if(!n)return null;const r={...dt,inline:e.classList&&e.classList.contains(_t)};Pa.forEach(c=>{const l=e.getAttribute("data-"+c);l&&(r[c]=l)});const s=e.getAttribute("data-rotate");typeof s=="string"&&(r.rotate=Ta(s));const a=e.getAttribute("data-flip");typeof a=="string"&&Da(r,a),Ra.forEach(c=>{const l="data-"+c,u=Aa(e.getAttribute(l),l);typeof u=="boolean"&&(r[c]=u)});const i=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:i}}const $a="svg."+gt+", i."+gt+", span."+gt+", i."+_t+", span."+_t;function Oa(e){const t=[];return e.querySelectorAll($a).forEach(n=>{const r=n[se]||n.tagName.toLowerCase()!=="svg"?Ma(n):null;r&&t.push({node:n,props:r})}),t}function qr(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}let Ie;function Na(){try{Ie=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Ie=null}}function Ua(e){return Ie===void 0&&Na(),Ie?Ie.createHTML(e):e}function Wr(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function Kr(e,t,n,r){const s=e.classList;if(r){const i=r.classList;Array.from(i).forEach(c=>{s.add(c)})}const a=[];return t.forEach(i=>{s.contains(i)?n.has(i)&&a.push(i):(s.add(i),a.push(i))}),n.forEach(i=>{t.has(i)||s.remove(i)}),a}function Gr(e,t,n){const r=e.style;(n||[]).forEach(a=>{r.removeProperty(a)});const s=[];for(const a in t)r.getPropertyValue(a)||(s.push(a),r.setProperty(a,t[a]));return s}function Qr(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const s=t.customisations,a=ct(n,s),i=e[se],c=qr(Cr(a.body),{"aria-hidden":"true",role:"img",...a.attributes});r.innerHTML=Ua(c);const l=r.childNodes[0],u=e.attributes;for(let g=0;g<u.length;g++){const h=u.item(g),S=h.name;S!=="class"&&!l.hasAttribute(S)&&l.setAttribute(S,h.value)}const d=Wr(t.icon),p=Kr(l,d,new Set(i&&i.addedClasses),e),f=Gr(l,s.inline?{"vertical-align":"-0.125em"}:{},i&&i.addedStyles),y={...t,status:"loaded",addedClasses:p,addedStyles:f};return l[se]=y,e.parentNode&&e.parentNode.replaceChild(l,e),l}function za(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Ha(e){return"data:image/svg+xml,"+za(e)}function Ba(e){return'url("'+Ha(e)+'")'}const Fa={display:"inline-block"},Et={"background-color":"currentColor"},Zr={"background-color":"transparent"},On={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Nn={"-webkit-mask":Et,mask:Et,background:Zr};for(const e in Nn){const t=Nn[e];for(const n in On)t[e+"-"+n]=On[n]}function Un(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function Va(e,t,n,r){const s=t.customisations,a=ct(n,s),i=a.attributes,c=e[se],l=qr(a.body,{...i,width:n.width+"",height:n.height+""}),u=Wr(t.icon),d=Kr(e,u,new Set(c&&c.addedClasses)),f={"--svg":Ba(l),width:Un(i.width),height:Un(i.height),...Fa,...r?Et:Zr};s.inline&&(f["vertical-align"]="-0.125em");const y=Gr(e,f,c&&c.addedStyles),g={...t,status:"loaded",addedClasses:d,addedStyles:y};return e[se]=g,e}let qe=!1;function qa(){qe||(qe=!0,setTimeout(()=>{qe&&(qe=!1,xe())}))}function xe(e,t=!1){const n=Object.create(null);function r(s,a){const{provider:i,prefix:c,name:l}=s,u=J(i,c),d=u.icons[l];if(d)return{status:"loaded",icon:d};if(u.missing.has(l))return{status:"missing"};if(a&&!va(s)){const p=n[i]||(n[i]=Object.create(null));(p[c]||(p[c]=new Set)).add(l)}return{status:"loading"}}(e?[e]:Me()).forEach(s=>{const a=typeof s.node=="function"?s.node():s.node;if(!a||!a.querySelectorAll)return;let i=!1,c=!1;function l(u,d,p){if(c||(c=!0,Ct(s)),u.tagName.toUpperCase()!=="SVG"){const f=d.mode,y=f==="mask"||(f==="bg"?!1:f==="style"?p.body.indexOf("currentColor")!==-1:null);if(typeof y=="boolean"){Va(u,d,{...Pe,...p},y);return}}Qr(u,d,p)}Oa(a).forEach(({node:u,props:d})=>{const p=u[se];if(!p){const{status:y,icon:g}=r(d.icon,!0);if(g){l(u,d,g);return}i=i||y==="loading",u[se]={...d,status:y};return}let f;if(ka(p,d)){if(f=r(d.icon,p.name!==d.name),!f.icon){i=i||f.status==="loading",Object.assign(p,{...d,status:f.status});return}}else{if(p.status!=="loading")return;if(f=r(d.icon,!1),!f.icon){p.status=f.status;return}}l(u,d,f.icon)}),s.temporary&&!i?Vr(a):t&&i?Fr(a,!0):c&&s.observer&&It(s)});for(const s in n){const a=n[s];for(const i in a){const c=a[i];on(Array.from(c).map(l=>({provider:s,prefix:i,name:l})),qa)}}}function Wa(e){const t=Ae(e);t?xe(t):xe({node:e,temporary:!0},!0)}function Xr(e,t,n=!1){const r=Re(e);if(!r)return null;const s=ye(e),a=Nr(dt,t||{}),i=Qr(document.createElement("span"),{name:e,icon:s,customisations:a},r);return n?i.outerHTML:i}function Ka(){return"3.1.1"}function Ga(e,t){return Xr(e,t,!1)}function Qa(e,t){return Xr(e,t,!0)}function Za(e,t){const n=Re(e);if(!n)return null;const r=Nr(dt,t||{});return ct(n,r)}function Xa(e){e?Wa(e):xe()}if(typeof document<"u"&&typeof window<"u"){ba();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!jr(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{Ca(xe),xe()})}function Ja(e,t){Pr(e,t!==!1)}function Ya(e){Pr(e,!0)}Rr("",oa);if(typeof document<"u"&&typeof window<"u"){Dr();const e=window;if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const n in t){const r="IconifyProviders["+n+"] is invalid.";try{const s=t[n];if(typeof s!="object"||!s||s.resources===void 0)continue;Ar(n,s)||console.error(r)}catch{console.error(r)}}}}const ec={getAPIConfig:ut,setAPIModule:Rr,sendAPIQuery:Or,setFetch:Ji,getFetch:Yi,listAPIProviders:Zi},tc={_api:ec,addAPIProvider:Ar,loadIcons:on,loadIcon:ya,iconExists:zi,getIcon:Hi,listIcons:Oi,addIcon:Ui,addCollection:jr,replaceIDs:Cr,calculateSize:vt,buildIcon:ct,getVersion:Ka,renderSVG:Ga,renderHTML:Qa,renderIcon:Za,scan:Xa,observe:Fr,stopObserving:Vr,pauseObserver:Ia,resumeObserver:Ea,enableCache:Ja,disableCache:Ya};try{self.Iconify===void 0&&(self.Iconify=tc)}catch{}var an={},nc=V;Object.defineProperty(an,"__esModule",{value:!0});var Jr=an.default=void 0,rc=nc(F()),sc=o;Jr=an.default=(0,rc.default)((0,sc.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline");function cn({infos:e}){const{t}=Y(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(s=>{n.searchParams.set(s.label,s.value)});const r=e.map(s=>`* ${s.label}: ${s.value}`).join(`
176
+ `);return n.searchParams.set("report","server"),n.searchParams.set("context",`[Enter feedback here]
177
+
178
+
179
+
180
+ <!--
181
+ [Server Info]
182
+ ${r}
183
+ * Page: ${window.location.href}
184
+ -->
185
+ `),P(_,{sx:{mx:{xs:0,md:2}},children:P(Se,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}cn.propTypes={infos:v.arrayOf(v.shape({label:v.string,value:v.string}))};cn.defaultProps={infos:[]};var oc={year:{long:"year",short:"y"},day:{long:"day",short:"d"},hour:{long:"hour",short:"h"},minute:{long:"minute",short:"m"},second:{long:"second",short:"s"},millisecond:{long:"millisecond",short:"ms"},microsecond:{long:"microsecond",short:"µs"},nanosecond:{long:"nanosecond",short:"ns"}},ic={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}};const kt=new Map,ac=(e,t)=>{kt.set(e,t)},cc=(e="en_US")=>kt.get(e)||kt.get("en_US");var Yr={registerLang:ac,getLang:cc},lc=e=>{if(typeof e!="number")throw new TypeError("Expected a number");const t=e>0?Math.floor:Math.ceil;return{days:t(e/864e5),hours:t(e/36e5)%24,minutes:t(e/6e4)%60,seconds:t(e/1e3)%60,milliseconds:t(e)%1e3,microseconds:t(e*1e3)%1e3,nanoseconds:t(e*1e6)%1e3}};const uc=lc,{getLang:je}=Yr,dc=(e,t)=>t===1?e:`${e}s`,fc=1e-7;var pc=(e,t={})=>{if(!Number.isFinite(e))throw new TypeError("Expected a finite number");t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);const n=je(t.locale),r=[],s=(c,l)=>{const u=Math.floor(c*10**l+fc);return(Math.round(u)/10**l).toFixed(l)},a=(c,l,u)=>{if((r.length===0||!t.colonNotation)&&c===0&&!(t.colonNotation&&l==="minute"))return;const{long:d}=n[l]||je("en_US")[l],{short:p}=n[l]||je("en_US")[l];let f=(u||c||"0").toString(),y,g;if(t.colonNotation){y=r.length>0?":":"",g="";const h=f.includes(".")?f.split(".")[0].length:f.length,S=r.length>0?2:1;f="0".repeat(Math.max(0,S-h))+f}else y="",t.locale==="zh_CN"?Object.values(i).filter(h=>h>0).length>1?!i.days&&!i.hours&&i.minutes&&t.compact?g=d:g=p:i.minutes?g=d:g=p:g=t.verbose?` ${dc(d,c)}`:p;r.push(y+f+g)},i=uc(e);if(a(Math.trunc(i.days/365),"year"),a(i.days%365,"day"),a(i.hours,"hour"),a(i.minutes,"minute"),t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3)if(a(i.seconds,"second"),t.formatSubMilliseconds)a(i.milliseconds,"millisecond"),a(i.microseconds,"microsecond"),a(i.nanoseconds,"nanosecond");else{const c=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,l=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,u=c>=1?Math.round(c):Math.ceil(c),d=l?c.toFixed(l):u;a(Number.parseFloat(d,10),"millisecond",d)}else{const c=e/1e3%60,l=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,u=s(c,l),d=t.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");a(Number.parseFloat(d,10),"second",d)}if(r.length===0){const c=(n.millisecond||je("en_US").millisecond).long,l=(n.millisecond||je("en_US").millisecond).short;return t.locale==="zh_CN"?`0${t.verbose?`${c}`:l}`:`0${t.verbose?` ${c}s`:l}`}if(t.compact)return r[0];if(typeof t.unitCount=="number"){const c=t.colonNotation?"":" ";return r.slice(0,Math.max(t.unitCount,1)).join(c)}return t.colonNotation?r.join(""):r.join(" ")};const mc=oc,hc=ic,{registerLang:ln}=Yr,es=pc;ln("en_US",mc);ln("zh_CN",hc);es.registerLang=ln;var gc=es;const ts=zs(gc);var un={},xc=V;Object.defineProperty(un,"__esModule",{value:!0});var Tt=un.default=void 0,vc=xc(F()),zn=o;Tt=un.default=(0,vc.default)([(0,zn.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),(0,zn.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime");function ne({children:e}){return X(n=>n.breakpoints.down("md"))?o.jsx(Ee,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:o.jsx(_,{sx:{display:"flex",alignItems:"center",gap:1},children:o.jsx(Tt,{fontSize:"small"})})}):o.jsxs(_,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(Tt,{fontSize:"small"}),e]})}ne.propTypes={children:v.node.isRequired};const yc="https://launcher.arcblock.io/",bc=30*24*60*60*1e3;function dn({launcherUrl:e,chainHost:t,nftId:n,launcherSessionId:r,...s}){var j,k,E,T,I,U;const{t:a,locale:i}=Y(),c=at(),[l,u]=tr({safeIframeRef:null,popoverAnchorEl:null}),d=x.useRef(null),p=ee(),f=X($=>$.breakpoints.down("md")),{sx:y={},...g}=s,h=f?"mobile":"desktop",S=er(async()=>{const[$,z]=await Promise.all([c.api.getLauncherSession({input:{launcherSessionId:r,launcherUrl:e}}),Qn({launcherUrl:e||yc,nftDid:n,launcherSessionId:r,locale:i,theme:p.palette.mode})]);if($!=null&&$.error)throw new Error($.error);return{launcherSession:$.launcherSession,subscriptionURL:z}},[i]);if(S.loading)return o.jsx(ae,{label:o.jsxs(ne,{children:[!f&&a("expiration.desktop.loading"),o.jsx(re,{size:16})]}),variant:"success",sx:{cursor:"pointer",...y},...g});if(S.error)return console.error(S.error),o.jsx(ae,{label:o.jsx(ne,{children:a(`expiration.${h}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...y},...g,onClick:()=>S.retry()});const m=$=>{u({popoverAnchorEl:$.currentTarget})},C=()=>{u({popoverAnchorEl:null})},w=(j=S.value)==null?void 0:j.launcherSession;let L="success";[M.LAUNCH_SESSION_STATUS.overdue,M.LAUNCH_SESSION_STATUS.canceled,M.LAUNCH_SESSION_STATUS.terminated].includes((E=(k=S.value)==null?void 0:k.launcherSession)==null?void 0:E.status)&&(L="error");let R=null;if(w.expirationDate&&!w.subscription){const $=me(w.expirationDate).diff(me(),"ms");R=a(`expiration.${h}.tips.${L}`,{validity:ts($,{locale:Zn(i),compact:!0,verbose:!0})}),$>0&&$<=bc&&(L="warning")}return o.jsxs(o.Fragment,{children:[o.jsx(ae,{label:o.jsx(ne,{children:R||((I=(T=w==null?void 0:w.subscription)==null?void 0:T.product)==null?void 0:I.name)||a("common.subscription")}),color:L,variant:L!=="success"?"contained":"outlined",sx:{cursor:"pointer",...y},...g,onClick:m}),o.jsx(Wn,{id:"popover-info",open:!!l.popoverAnchorEl,anchorEl:l.popoverAnchorEl,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},sx:{"& .MuiPopover-paper":{minHeight:0}},transformOrigin:{vertical:"top",horizontal:"right"},children:o.jsx(_,{sx:{width:{xs:"360px",md:"450px"},display:"flex",flexDirection:"column"},children:o.jsx("iframe",{ref:d,title:a("common.subscription"),width:"100%",height:"600px",style:{border:0,maxHeight:"800px"},src:(U=S.value)==null?void 0:U.subscriptionURL})})})]})}dn.propTypes={chainHost:v.string.isRequired,nftId:v.string,launcherSessionId:v.string,sx:v.object,retention:v.number,launcherUrl:v.string.isRequired};dn.defaultProps={sx:{},retention:0,nftId:"",launcherSessionId:""};const wc=30*24*60*60*1e3,jc="https://launcher.arcblock.io/";function fn({launcherUrl:e,chainHost:t,nftId:n,launcherSessionId:r,...s}){var j,k,E,T,I,U,$;const{t:a,locale:i}=Y(),[c,l]=tr({safeIframeRef:null,popoverAnchorEl:null}),u=x.useRef(null),d=X(z=>z.breakpoints.down("md")),p=at(),{sx:f={},...y}=s,g=d?"mobile":"desktop",h=er(async()=>{const[z,$e]=await Promise.all([p.api.getLauncherSession({input:{launcherSessionId:r||n,launcherUrl:e}}),Qn({launcherUrl:e||jc,nftDid:n,launcherSessionId:r,locale:i})]);if(z!=null&&z.error)throw new Error(z.error);return{launcherSession:z.launcherSession,subscriptionURL:$e}},[i]);if(h.loading)return o.jsx(ae,{label:o.jsxs(ne,{children:[!d&&a("expiration.desktop.loading"),o.jsx(re,{size:16})]}),variant:"success",sx:{cursor:"pointer",...f},...y});if(h.error)return console.error(h.error),o.jsx(ae,{label:o.jsx(ne,{children:a(`expiration.${g}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...f},...y,onClick:()=>h.retry()});const S=(k=(j=h.value)==null?void 0:j.launcherSession)==null?void 0:k.expirationDate,m=me(S).isBefore(me()),C=me(S).diff(me(),"ms");let w="success";C<=wc&&(w="warning"),m&&(w="error");const L=z=>{l({popoverAnchorEl:z.currentTarget})},R=()=>{l({popoverAnchorEl:null})};return o.jsxs(o.Fragment,{children:[((T=(E=h.value)==null?void 0:E.launcherSession)==null?void 0:T.subscription)&&o.jsx(ae,{label:o.jsx(ne,{children:a("expiration.desktop.nextInvoice",{date:Ks(S,i)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...f},...y,onClick:L}),!((U=(I=h.value)==null?void 0:I.launcherSession)!=null&&U.subscription)&&o.jsx(ae,{label:o.jsx(ne,{children:a(`expiration.${g}.tips.${w}`,{validity:ts(C,{locale:Zn(i),compact:!0,verbose:!0})})}),color:w,variant:w!=="success"?"contained":"outlined",sx:{cursor:"pointer",...f},...y,onClick:L}),o.jsx(Wn,{id:"popover-info",open:!!c.popoverAnchorEl,anchorEl:c.popoverAnchorEl,onClose:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:o.jsx(_,{sx:{width:{xs:"360px",md:"450px"}},children:o.jsx("iframe",{ref:u,title:a("common.subscription"),width:"100%",height:"600px",style:{border:0},src:($=h.value)==null?void 0:$.subscriptionURL})})})]})}fn.propTypes={chainHost:v.string.isRequired,nftId:v.string,launcherSessionId:v.string,sx:v.object,retention:v.number,launcherUrl:v.string.isRequired};fn.defaultProps={sx:{},retention:0,nftId:"",launcherSessionId:""};var pn={},Sc=V;Object.defineProperty(pn,"__esModule",{value:!0});var ns=pn.default=void 0,_c=Sc(F()),Cc=o;ns=pn.default=(0,_c.default)((0,Cc.jsx)("path",{d:"M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z"}),"Fullscreen");var mn={},Ic=V;Object.defineProperty(mn,"__esModule",{value:!0});var rs=mn.default=void 0,Ec=Ic(F()),kc=o;rs=mn.default=(0,Ec.default)((0,kc.jsx)("path",{d:"M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"}),"FullscreenExit");const Tc={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'};function hn({children:e,style:t,...n}){return o.jsx(bs,{style:t,...n,children:e})}hn.propTypes={children:v.any.isRequired,style:v.object};hn.defaultProps={style:{}};const O={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",success:"#3ab39d",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},Xe={added:O.grey,waiting:O.yellow,downloading:O.yellow,extracting:O.yellow,downloaded:O.grey,installing:O.yellow,installed:O.grey,starting:O.yellow,running:O.running,stopping:O.yellow,stopped:O.reverse,error:O.error,upgrading:O.yellow,restarting:O.yellow,corrupted:O.error,deleting:O.yellow,resource:O.primary},Lc={added:"primary",waiting:"info",downloading:"info",extracting:"info",downloaded:"primary",installing:"info",installed:"primary",starting:"info",running:"success",stopping:"warning",stopped:"reverse",error:"error",upgrading:"info",restarting:"info",corrupted:"error",deleting:"warning",resource:"primary"};function ss({isResource:e,status:t,variant:n,source:r,progress:s,...a}){const{t:i}=x.useContext(Lt),c=N.isInProgress(t),l=e&&t==="stopped"?"resource":t,u=i(`blocklet.status.${l}`);return n==="pin"?o.jsx(Ee,{title:i("blocklet.statusTip",{status:u}),children:o.jsxs(_,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",...a,children:[o.jsx(_,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Xe[l],style:{opacity:.15}}),o.jsx(_,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Xe[l]})]})}):n==="dot"?o.jsx(Ee,{title:i("blocklet.statusTip",{status:u}),children:o.jsx(Eo,{color:Xe[l],...a})}):o.jsxs(hn,{type:Lc[l],...a,children:[c&&o.jsx(re,{size:12,color:"inherit",style:{marginRight:5}}),u,l==="downloading"&&s?o.jsx("div",{style:{marginLeft:5},children:`${s} %`}):null]})}ss.propTypes={status:v.string.isRequired,variant:v.oneOf(["dot","tag","pin"]),source:v.string,progress:v.number,isResource:v.bool};ss.defaultProps={isResource:!1,variant:"tag",source:"",progress:0};function Dc(){const{inFullPage:e,toggleFullPage:t}=go();return P(Rt,{onClick:t,children:e?P(rs,{sx:{transform:"scale(1.3)"}}):P(ns,{sx:{transform:"scale(1.3)"}})})}function gn({children:e}){var S;const{t}=Y(),{loading:n,error:r,actions:{refreshBlocklet:s},env:a,blocklet:i}=ve(),{info:c}=Gs(),l=Hs(),u=X(m=>m.breakpoints.down("md")),{appId:d,version:p}=a,f=[{label:"App ID",value:d},{label:"App Version",value:p},{label:"App Bundle Name",value:(S=i==null?void 0:i.meta)==null?void 0:S.bundleName},{label:"Server Id",value:c.did},{label:"Server Version",value:c.version}],y=m=>{var w,L,R,j;const C=Array.isArray(m)?m:[m];if(u||C.unshift(P(Dc,{})),i){const k={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};Qs(i)?C.unshift(P(dn,{chainHost:(w=i==null?void 0:i.controller)==null?void 0:w.chainHost,nftId:(L=i==null?void 0:i.controller)==null?void 0:L.nftId,launcherSessionId:(R=i==null?void 0:i.controller)==null?void 0:R.launcherSessionId,launcherUrl:(j=i==null?void 0:i.controller)==null?void 0:j.launcherUrl,sx:k})):c.ownerNft&&c.launcher&&C.unshift(P(fn,{chainHost:c.launcher.chainHost,launcherUrl:c.launcher.url,nftId:c.ownerNft.did,launcherSessionId:c.ownerNft.launcherSessionId,sx:k}))}return C},g=Co({blocklet:i}),h={logo:g?P("img",{src:g,alt:"logo"}):null,brandAddon:P(_,{children:i&&Fe(_,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,sx:{py:1,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[P(Ee,{title:N.isRunning(i==null?void 0:i.status)?void 0:t(`blocklet.status.${i==null?void 0:i.status}`),children:P(_,{sx:{width:8,height:8,borderRadius:"50%"},bgcolor:Xe[i==null?void 0:i.status]})}),P(_,{sx:{lineHeight:1,color:"text.secondary",maxWidth:u?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:N.getDisplayName(i)}),P(_,{component:ws,icon:Tc,sx:{color:"text.secondary"}})]})})};return Fe(Pc,{legacy:!1,fullWidth:!0,headerAddons:y,headerProps:h,footerProps:{addon:P(cn,{infos:f})},children:[!i&&n&&P(Je,{relative:"parent",children:P(re,{})}),!i&&r&&Fe(Je,{relative:"parent",children:[Fe(_,{display:"flex",alignItems:"center",children:[P(Jr,{color:"error",sx:{marginRight:1}}),$t(r)]}),P(Dt,{onClick:()=>s(),children:P("span",{style:{textDecoration:"underline"},children:t("common.retry")})})]}),!!i&&P(_,{flex:1,padding:u?2:3,display:"flex",flexDirection:"column",children:P(js,{FallbackComponent:ho,resetKeys:[l.pathname],children:e})})]})}gn.propTypes={children:v.any};gn.defaultProps={children:null};const Pc=G(mo)`
186
+ div.dashboard-content {
187
+ padding: 0;
188
+ }
189
+ .header-addons .locales {
190
+ max-height: 400px;
191
+ overflow-y: auto;
192
+ }
193
+
194
+ .header-brand-addon {
195
+ display: block;
196
+ }
197
+ `;function Rc(){var m,C,w;const{t:e,locale:t}=Y(),{blocklet:n,launcherSession:r,refreshSubscription:s}=ve(),{connectApi:a,session:i,api:c}=Zs(),[l,u]=x.useState(!1),[d,p]=x.useState(""),[f,y]=bo({subscriptionURL:"#"});if(x.useEffect(()=>{var L,R;(wn(n,r)||jn(r))&&Xs({launcherSessionId:(L=n==null?void 0:n.controller)==null?void 0:L.launcherSessionId,launcherUrl:(R=n==null?void 0:n.controller)==null?void 0:R.launcherUrl,locale:t}).then(j=>{y({subscriptionURL:j})}).catch(j=>{console.error("get subscription url error:",j)})},[n,r]),x.useEffect(()=>{var L;if((L=n.controller)!=null&&L.launcherUrl){const R=he(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(R).then(j=>j.json()).then(j=>{var T,I;const k=(I=(T=j.componentMountPoints)==null?void 0:T.find(U=>U.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk"))==null?void 0:I.mountPoint,E=he(n.controller.launcherUrl,k);p(E)})}},[(m=n.controller)==null?void 0:m.launcherUrl]),!n||!r)return"";let g=null,h="",S="error";return Js(r)?(g=Ys(r)?o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):o.jsx(Ns,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),h=e("blocklet.suspendedCausedByPastDue",{deadline:be(r==null?void 0:r.reservedUntil,t)})):jn(r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.willBeSuspendedSoon",{deadline:be((((C=r==null?void 0:r.subscription)==null?void 0:C.cancel_at)||0)*1e3,t)}),S="warning"):wn(n,r)?(g=o.jsx(Se,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.suspendedCausedByExpired",{deadline:be(r==null?void 0:r.reservedUntil,t),canceledAt:be((((w=r==null?void 0:r.subscription)==null?void 0:w.canceled_at)||0)*1e3,t)})):eo(n,r)&&(g=o.jsx(Kn,{to:he(M.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),h=e("blocklet.suspendedCausedByTerminated",{canceledAt:be(r==null?void 0:r.terminatedAt,t),deadline:to(r==null?void 0:r.terminatedAt,t)})),h?o.jsxs(o.Fragment,{children:[o.jsxs(At,{severity:S,sx:{mb:1},children:[h,o.jsx(H,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:g})]}),l&&d&&r&&o.jsx(no,{session:i,connect:a,baseUrl:d,authToken:r.subscription.authToken,children:o.jsx(ro,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),s(),u(!1)}})})]}):null}const os=x.createContext({});function Dl(){return x.useContext(os)}const{Provider:Ac,Consumer:Pl}=os,{did:K,appId:Mc}=window.env;function $c({children:e}){var j,k;const{t,locale:n}=Y(),{blocklet:r}=ve(),[s,a]=x.useState([]),[i,c]=x.useState([]),[l,u]=x.useState([]),d=N.getDisplayName(r),p=((j=((r==null?void 0:r.environments)||[]).find(E=>E.key===ce.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_PASSPORT_COLOR))==null?void 0:j.value)||"auto",f=(r==null?void 0:r.trustedPassports)||[],y=(r==null?void 0:r.trustedFactories)||[],g=(r==null?void 0:r.enablePassportIssuance)!==!1,h=async()=>{try{const E=await He.doBatchQuery({getRoles:{input:{teamDid:K}},getPermissions:{input:{teamDid:K}},getInvitations:{input:{teamDid:K}}}),T=(E.getRoles.roles||[]).filter(I=>!M.RBAC_CONFIG.roles.some(U=>U.name===I.name&&(!U.passport||U.ci))).map(I=>(I.hasDescription=!!I.description,I.hasDescription||(I.description=t("team.passport.description",{teamName:d,title:I.title})),I));c(fo(T,[I=>so(I.name)],["desc"])),u(E.getPermissions.permissions||[]),a(E.getInvitations.invitations||[])}catch(E){Z.error(E.message)}},S=({did:E}={})=>{const T={teamDid:K,user:{did:E}};return He.getUser({input:T})},m=({query:E,paging:T}={})=>{const I={teamDid:K};return T&&(I.paging=T),E&&(I.query=E),I.sort={lastLoginAt:-1},He.getUsers({input:I})},C=()=>He.getUsersCountPerRole({input:{teamDid:K}}),w=()=>h();x.useEffect(()=>{var E;(E=r==null?void 0:r.meta)!=null&&E.did&&h()},[(k=r==null?void 0:r.meta)==null?void 0:k.did]),x.useEffect(()=>{c(E=>E.map(T=>(T.hasDescription||(T.description=t("team.passport.description",{teamName:d,title:T.title})),{...T})))},[t,n]);const L=E=>{E.teamDid===K&&h()};We(ce.TeamEvents.userAdded,L,[K]),We(ce.TeamEvents.userRemoved,L,[K]),We(ce.TeamEvents.userUpdated,L,[K]);const R={teamDid:K,teamIssuerDid:Mc,teamName:d,invitations:s,roles:i,permissions:l,trustedPassports:f,trustedFactories:y,isNodeTeam:!1,enablePassportIssuance:g,refresh:w,passportColor:p,endpoint:window.location.origin,blocklet:r,api:{getUser:S,getUsers:m,getUsersCountPerRole:C}};return o.jsx(Ac,{value:R,children:e})}const Oc=x.lazy(()=>D(()=>import("./log-DOIh9luu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),Nc=x.lazy(()=>D(()=>import("./index-Bb7iSrGO.js"),__vite__mapDeps([15,2,1,5,4,6,7,8,10,16,9,11,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,3,36,37,38,39,40,41,42]))),Uc=x.lazy(()=>D(()=>import("./index-BeE0KRva.js"),__vite__mapDeps([43,4,2,5,1,6,7,8,39,10,9,11,44,45,29,25,33,34,46,3,36,37,20,38,40,26,41,42]))),zc=x.lazy(()=>D(()=>import("./index-Dfw2EDXA.js"),__vite__mapDeps([47,2,1,9,4,5,6,7,8,10,11,48,29,25,20,18,49,13,35,50,12,21,51,41,52,53,54,55,56,23,28,57,58,59,60,61,37,62,63,64,65]))),Hc=x.lazy(()=>D(()=>import("./overview-ClOSCvvh.js"),__vite__mapDeps([66,1,2,4,5,6,7,8,10,39,67,9,11,27,40,26,18,68,69,70,55,3,25,29,36,37,20,38,41,42]))),Bc=x.lazy(()=>D(()=>import("./domains-CdwErmIF.js"),__vite__mapDeps([71,2,4,5,1,6,7,8,9,10,11,72,45,19,20,40,26,29,25,33,34,61,21,73,41,39,27,74]))),Fc=x.lazy(()=>D(()=>import("./index-DXeoVV9Y.js"),__vite__mapDeps([75,2,6,5,1,4,7,8,9,10,11,18,76,30,31,44,19,20,77,78,79,29,25,50,41,80,3,36,37,38,39,40,26,42]))),Vc=x.lazy(()=>D(()=>import("./appearance-CYop22yw.js"),__vite__mapDeps([81,5,2,4,1,6,7,8,9,10,11,44]))),qc=x.lazy(()=>D(()=>import("./audit-logs-BtBk6uAY.js"),__vite__mapDeps([82,4,2,5,1,6,7,8,30,31,3,9,10,11,63,64,39,35,65,25,29,36,37,20,38,40,26,41,42]))),Wc=x.lazy(()=>D(()=>import("./index-Be8E3hiQ.js"),__vite__mapDeps([83,2,1,5,4,6,7,8,9,10,11,38,20,84,85,35,27,86,54,13,39,74,30,31,18,87,40,26,88,89,90,56,91,25,92,93,23,24,44,3,29,36,37,41,42]))),Kc=x.lazy(()=>D(()=>import("./config-navigation-IR_yUgmM.js"),__vite__mapDeps([94,2,4,5,1,6,7,8,69,78,10,95,9,11,96,97,62,55,38,20,57,58,88,25,3,29,36,37,39,40,26,41,42]))),Gc=x.lazy(()=>D(()=>import("./index-DaM-GRtb.js"),__vite__mapDeps([98,1,2,6,5,10,4,7,8,9,11,44,55,99,100,70,25,28,27,93,34,37,101,50,3,29,36,20,38,39,40,26,41,42]))),Qc=x.lazy(()=>D(()=>import("./index-CJQbYw9E.js"),__vite__mapDeps([102,4,2,5,1,6,7,8,10,9,11,101,85,67,27,31,44]))),Zc=x.lazy(()=>D(()=>import("./security-CXewZHyS.js"),__vite__mapDeps([103,4,2,5,1,6,7,8,9,10,11,97,104,44,3,25,29,36,37,20,38,39,40,26,41,42]))),Xc=x.lazy(()=>D(()=>import("./branding-gXMozCeI.js"),__vite__mapDeps([105,2,1,4,5,6,7,8,10,106,69,95,60,107,52,79,62,9,11,19,20,38,85]))),Jc=x.lazy(()=>D(()=>import("./advanced-BZZToP_j.js"),__vite__mapDeps([108,2,1,9,4,5,6,7,8,10,11,19,20,39,29,25,41,85,21,27,18,68,69,3,36,37,38,40,26,42]))),Yc=x.lazy(()=>D(()=>import("./traffic-CUSLm0PX.js").then(e=>e.t),__vite__mapDeps([87,2,9,1,4,5,6,7,8,10,11,40,26,88,89,90,56,91,25,92,93,23,24]))),el=x.lazy(()=>D(()=>import("./runtime-D5P_2uNM.js"),__vite__mapDeps([109,2,1,4,5,6,7,8,9,10,11,92,93,13,3,25,29,36,37,20,38,39,40,26,41,42]))),tl=x.lazy(()=>D(()=>import("./index-C8uNNoMb.js"),__vite__mapDeps([110,2,4,5,1,6,7,8,111,25,76,18,30,31,9,10,11,22,23,24,29,21,61,19,20,13,33,34,44,46,39,3,36,37,38,40,26,41,42]))),nl=x.lazy(()=>D(()=>import("./list-BOdwWlS0.js"),__vite__mapDeps([112,2,4,5,1,6,7,8,10,111,40,26,17,9,11,22,23,24,49,21,61,29,25,76,18,30,31,33,34,46,39,44,3,36,37,20,38,41,42]))),rl=x.lazy(()=>D(()=>import("./index-Cs3-IS09.js"),__vite__mapDeps([113,2,4,5,1,6,7,8,53,55,46,39,44,9,10,11,3,25,29,36,37,20,38,40,26,41,42]))),sl=x.lazy(()=>D(()=>import("./component-D6hOmRzO.js"),__vite__mapDeps([114,1,2,5,4,6,7,8,10,9,11,25,115,101,19,20,111,96,91,58,106,69,95,21,56,90,62,116,59,53,60,28,61,29,37,18,117,118,100,70,55,107,52,119,84,77,78,63,64,27,3,73,44,120,99,121,122,80,39,88,13,36,33,34,38,40,26,41,42]))),ol=x.lazy(()=>D(()=>import("./index-SX_KWrQh.js"),__vite__mapDeps([123,1,2,4,5,6,7,8,9,10,11]))),il=he(M.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),al=e=>{const{enqueueSnackbar:t}=Hn(),n=x.useCallback(r=>Xn(il,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);We(`${e}/${M.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const s=n(r),{severity:a,description:i}=r||{},c=["error","warning"].includes(a)||r.sticky;r.source==="system"&&t(i,{variant:a,autoHideDuration:c?null:5e3,content:l=>o.jsx(di,{viewAllUrl:s,keyId:l,notification:r,content:o.jsx(ki,{notification:r,minimal:!0,rows:0})})})},[],"user")};function is({blocklet:e,isAdmin:t}){return t?o.jsx(Wc,{blocklet:e}):o.jsx(vo,{status:403})}is.propTypes={blocklet:v.object.isRequired,isAdmin:v.bool.isRequired};const cl=e=>{var d,p;const{t}=Y(),{blocklet:n,actions:{refreshBlocklet:r},client:s,did:a}=ve(),i=(d=n==null?void 0:n.meta)==null?void 0:d.did,c=!n||co(n.status)?[]:N.getAppMissingConfigs(n),l={overview:[{label:t("common.overview"),value:"overview"},{label:o.jsx(Us,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!c.length,children:t("common.components")}),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},{label:t("team.member.passports"),value:"passports"},{label:t("common.setting"),value:"settings"},{label:t("common.security"),value:"security"},{label:t("oauth.client.tab"),value:"oauth"}],website:[{label:t("common.domains"),value:"domains"},{label:t("common.branding"),value:"branding"},{label:t("common.theming"),value:"theming"},{label:t("common.navigation"),value:"navigation"}],operations:[{label:t("common.notificationRecords"),value:"notifications",show:e},{label:t("common.analytics"),value:"analytics"},{label:t("common.auditLogs"),value:"audit-logs"},{label:t("common.advancedConfig"),value:"advanced"}],integrations:[{label:"Webhooks",value:"webhooks",show:e},{label:t("common.accessKeys"),value:"access-keys"},{label:t("common.mcpServers"),value:"mcp-servers"}],developers:[{label:t("common.logs"),value:"logs",show:((p=n==null?void 0:n.children)==null?void 0:p.length)&&n.structVersion===M.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},u={overview:Hc,components:sl,members:o.jsx(Nc,{type:"blocklet",createPassportSvg:Sn}),passports:o.jsx(Fc,{createPassportSvg:Sn}),settings:o.jsx(Qc,{orientation:"vertical"}),security:o.jsx(Zc,{}),"did-spaces":o.jsx(Gc,{navOrientation:"horizontal"}),domains:Bc,branding:o.jsx(Xc,{blocklet:n,onUpdate:r}),theming:o.jsx(Vc,{}),navigation:Kc,sitemap:o.jsx(_s,{children:t("common.comingSoon")}),notifications:o.jsx(is,{blocklet:n,isAdmin:e}),"audit-logs":o.jsx(qc,{scope:i,categories:["blocklet","team","security","certificates","gateway"]}),analytics:o.jsx(Yc,{client:s,did:a}),advanced:o.jsx(Jc,{blocklet:n,onUpdate:r}),webhooks:o.jsx(Uc,{}),"access-keys":o.jsx(tl,{}),"mcp-servers":o.jsx(rl,{}),logs:Oc,performance:o.jsx(el,{client:s,did:a}),docs:ol,publish:o.jsx(zc,{}),oauth:o.jsx(nl,{})};return{tabGroups:l,renders:u}};function ll(){var m,C;const e=Gn(),{tab:t="overview",subtab:n}=Bs(),{blocklet:r,refreshFlag:s}=ve(),{session:a}=Yn(),i=ge(()=>{var w;return(w=a==null?void 0:a.user)==null?void 0:w.did},[a]),c=ko(),l=ge(()=>{var w;return((w=a.user)==null?void 0:w.role)&&io.includes(a.user.role)},[a]);al(i);const{tabGroups:u,renders:d}=cl(l),p=w=>{e(`${M.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${w}`)},f=(u[t]||[]).filter(w=>w.show===void 0||w.show),y=((m=(f||[]).find(w=>w.value===n))==null?void 0:m.value)||((C=f==null?void 0:f[0])==null?void 0:C.value)||t,g=d[y]||d.overview,h=["overview"].includes(t),S=r?o.jsxs(Ot,{type:"components",children:[f.length>0&&o.jsxs(_,{mb:2,display:"flex",alignItems:"center",gap:2,children:[o.jsx(Ss,{tabs:f,current:y,onChange:p,scrollButtons:"auto"}),h&&!c&&o.jsx(_,{flex:1,display:"flex",justifyContent:"flex-end",children:o.jsx(_,{component:"div",className:"page-header",children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null})})]}),o.jsx(_,{className:"page-content",children:o.jsx(x.Suspense,{fallback:o.jsx(Je,{relative:"parent",children:o.jsx(re,{})}),children:x.isValidElement(g)?g:o.jsx(g,{blocklet:r})})})]}):o.jsx(Je,{relative:"parent",children:o.jsx(re,{})});return o.jsx(ao,{children:o.jsx($c,{children:o.jsx(gn,{children:o.jsxs(dl,{children:[c&&h&&o.jsx(_,{component:"div",className:"page-header",mb:2,children:r?o.jsx(kn,{className:"page-actions",hasPermission:!0,blocklet:r,onStart:()=>{},onComplete:({error:w}={})=>{w&&Z.error(w.message)},variant:"group"}):null}),o.jsx(dr,{}),o.jsx(Rc,{}),S]})},`${s}`)})})}function ul(){var r;const{blocklet:e}=ve(),{t}=Y(),n=(r=e==null?void 0:e.meta)==null?void 0:r.did;return x.useEffect(()=>{const s=oo();return n&&s.connect(),()=>{n&&s.isConnected()&&s.disconnect()}},[n]),o.jsxs(o.Fragment,{children:[o.jsx(xo,{children:o.jsx("title",{children:t("pageTitle.dashboard")})}),o.jsx(ll,{})]})}const dl=G.main`
198
+ .page-header {
199
+ display: flex;
200
+ justify-content: space-between;
201
+ align-items: center;
202
+ flex-wrap: wrap;
203
+ gap: 16px;
204
+ }
205
+
206
+ .page-title {
207
+ display: flex;
208
+ align-items: center;
209
+
210
+ .page-link {
211
+ font-size: 15px;
212
+ margin-top: 8px;
213
+ margin-left: 8px;
214
+ }
215
+ }
216
+
217
+ @media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
218
+ .page-header {
219
+ flex-direction: column;
220
+ align-items: flex-start;
221
+ .page-actions,
222
+ .MuiButtonGroup-root {
223
+ width: 100%;
224
+ }
225
+ .MuiButtonGroup-root {
226
+ .MuiButtonBase-root {
227
+ flex: 1;
228
+ }
229
+ .blocklet-action-text {
230
+ display: none;
231
+ }
232
+ }
233
+ }
234
+
235
+ .page-title {
236
+ margin-bottom: 15px;
237
+ }
238
+ }
239
+ `,Rl=Object.freeze(Object.defineProperty({__proto__:null,default:ul},Symbol.toStringTag,{value:"Module"}));export{ss as B,hn as W,sr as a,ir as b,rr as c,Jr as d,cr as e,pe as f,Ll as g,Rl as h,ts as p,Dl as u};