@abtnode/blocklet-services 1.16.53-beta-20251013-075536-64fcb94b → 1.16.53

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 (264) hide show
  1. package/api/middlewares/verify-did.js +27 -0
  2. package/api/routes/csp-proxy.js +4 -0
  3. package/api/routes/ocap.js +18 -3
  4. package/api/routes/openapi.js +3 -2
  5. package/api/routes/opencomponent.js +3 -2
  6. package/api/routes/openembed.js +3 -2
  7. package/api/routes/user.js +11 -9
  8. package/api/services/auth/session.js +6 -0
  9. package/dist/assets/{AdapterDayjs-Bp0ir26R.js → AdapterDayjs-DyE9ImrK.js} +1 -1
  10. package/dist/assets/{Google-E3u2a9g7.js → Google-ZJmTt04Y.js} +1 -1
  11. package/dist/assets/{access-control-CUUGBegg.js → access-control-tkXiKu_B.js} +1 -1
  12. package/dist/assets/{actions-B4VXcSRp.js → actions-C4-lIUPY.js} +1 -1
  13. package/dist/assets/{add-component-core-D8CsaWtE.js → add-component-core-DZewqmQf.js} +17 -17
  14. package/dist/assets/{add-resource-DRYWyzFg.js → add-resource-CFOC6fO8.js} +1 -1
  15. package/dist/assets/{addon-DhicELT4.js → addon-CAEOt-oM.js} +1 -1
  16. package/dist/assets/{advanced-D4kyySFu.js → advanced-BsPW8tKj.js} +2 -2
  17. package/dist/assets/aigne-C6-afA57.js +10 -0
  18. package/dist/assets/api-txzyyizM.js +1 -0
  19. package/dist/assets/{appearance-DiUMtWiZ.js → appearance-BZqg7Kkn.js} +1 -1
  20. package/dist/assets/{ar-7nBHeQPa.js → ar-DW15ct8A.js} +1 -1
  21. package/dist/assets/{ar-CHd3xUx5.js → ar-Ge3t6oI2.js} +2 -2
  22. package/dist/assets/{arrow-down.svg-DgXRF8DP.js → arrow-down.svg-zOZF6XLO.js} +1 -1
  23. package/dist/assets/audit-logs-aCVF7lhB.js +35 -0
  24. package/dist/assets/{authorize-Dr-5dOao.js → authorize-QCoPxe3U.js} +1 -1
  25. package/dist/assets/{base-chart-UFWO9a3P.js → base-chart-C_jLgGFD.js} +1 -1
  26. package/dist/assets/{base32-BK7MXAD4.js → base32-Cg02gOuu.js} +1 -1
  27. package/dist/assets/bind-account-C8pbYbtP.js +1 -0
  28. package/dist/assets/{branding-BqZaDEQy.js → branding-BxYz3fG3.js} +5 -5
  29. package/dist/assets/{branding-Bwa2_l30.js → branding-CKEfz45I.js} +1 -1
  30. package/dist/assets/branding-r2VAPR6q.js +1 -0
  31. package/dist/assets/{bundle-avatar-D5n6XSFF.js → bundle-avatar-CRBdm-Kg.js} +1 -1
  32. package/dist/assets/button-CaqBEwnu.js +1 -0
  33. package/dist/assets/click-to-copy-CK42VmRr.js +1 -0
  34. package/dist/assets/{cloneDeep-LRq4Ya2k.js → cloneDeep-gpb_g13N.js} +1 -1
  35. package/dist/assets/{collapse-DJGzUM1Q.js → collapse-D7GlSZQp.js} +1 -1
  36. package/dist/assets/{complete-CJN6MZr9.js → complete-B1ERhNgz.js} +3 -3
  37. package/dist/assets/{component-BkgYdhLW.js → component-D1imN4b5.js} +2 -2
  38. package/dist/assets/{config-BKWRBZkN.js → config-CRH_AVvL.js} +2 -2
  39. package/dist/assets/{config-NzhCDrRK.js → config-D9yLBkGc.js} +1 -1
  40. package/dist/assets/{config-C6P5yz_l.js → config-dGkFpD36.js} +4 -4
  41. package/dist/assets/config-navigation-CkwpaFE2.js +40 -0
  42. package/dist/assets/config-space-DEqVeU5w.js +1 -0
  43. package/dist/assets/confirm-DAMhAYR3.js +7 -0
  44. package/dist/assets/{connect-Cp5779ib.js → connect-BHzZ3O8m.js} +1 -1
  45. package/dist/assets/{connect-DCldlgle.js → connect-VhC_tOjl.js} +1 -1
  46. package/dist/assets/connect-to-CnrptX8a.js +1 -0
  47. package/dist/assets/{content-layout-B9tc9LCL.js → content-layout-W7JDm8iO.js} +1 -1
  48. package/dist/assets/{create-passport-svg-n0J1kwzH.js → create-passport-svg-BsR3hKFq.js} +1 -1
  49. package/dist/assets/createClass-B4I2IV47.js +1 -0
  50. package/dist/assets/{dashboard-COW8XxoK.js → dashboard-C6gjCAD6.js} +7 -7
  51. package/dist/assets/{de-CD44Obtw.js → de-CbARTvf4.js} +2 -2
  52. package/dist/assets/{de-Dn7PhTZq.js → de-DomrlJGv.js} +1 -1
  53. package/dist/assets/{delete-confirm-DDcjKsY2.js → delete-confirm-Ca3miSFM.js} +1 -1
  54. package/dist/assets/{did-address-DnFNwELW.js → did-address-BQL5Zxlr.js} +1 -1
  55. package/dist/assets/{domain-DR_J7IrS.js → domain-DZJxjNTq.js} +1 -1
  56. package/dist/assets/{domain-action-card-CuN-BTun.js → domain-action-card-CPmR-n-P.js} +2 -2
  57. package/dist/assets/domains-DH3UyJ8c.js +1 -0
  58. package/dist/assets/{email-Da8K28dJ.js → email-dNTq-UZN.js} +2 -2
  59. package/dist/assets/{empty-spinner-LXNYl6_1.js → empty-spinner-sNq-0DF5.js} +1 -1
  60. package/dist/assets/engine-lkWYvtZC.js +1 -0
  61. package/dist/assets/{es-B_X5HHiA.js → es-BWRncAvl.js} +1 -1
  62. package/dist/assets/{es-DNFAt0y7.js → es-CaCbzATO.js} +2 -2
  63. package/dist/assets/exchange-passport-C-tUCCyK.js +1 -0
  64. package/dist/assets/{form-BO9zQEEu.js → form-BIXDp48N.js} +3 -3
  65. package/dist/assets/{form-text-input-CwOsIY5R.js → form-text-input-AIMlcRaM.js} +1 -1
  66. package/dist/assets/{form-wrapper-Dt1iJZge.js → form-wrapper-DINLdpTN.js} +1 -1
  67. package/dist/assets/{fr-C9xE9tD4.js → fr-B3yjKUFH.js} +2 -2
  68. package/dist/assets/{fr-BIAMVkwl.js → fr-DkEISw5U.js} +1 -1
  69. package/dist/assets/{fuel-QHX754Te.js → fuel-_yedTm2I.js} +1 -1
  70. package/dist/assets/{gen-access-key-1fCgd-vd.js → gen-access-key-DXoAyhBv.js} +1 -1
  71. package/dist/assets/{gen-simple-access-key-DrYDMNDo.js → gen-simple-access-key-BPpzmXdv.js} +1 -1
  72. package/dist/assets/get-safe-url-94yHUMyk.js +1 -0
  73. package/dist/assets/{hi-4-0lpKbp.js → hi-CNLsAFCp.js} +1 -1
  74. package/dist/assets/{hi-D_0DFJcS.js → hi-q4mhHiIl.js} +1 -1
  75. package/dist/assets/{home-CR7v9FTO.js → home-CgfBIBYo.js} +1 -1
  76. package/dist/assets/{id-Dw1-p0GY.js → id-CiNosIvh.js} +1 -1
  77. package/dist/assets/{id-BgJjfH2L.js → id-DTf7aVH8.js} +2 -2
  78. package/dist/assets/{iframe-CKOcsJB-.js → iframe-D73zp9VN.js} +1 -1
  79. package/dist/assets/{index-ChdZfn2Z.js → index-3gh3KcSo.js} +9 -9
  80. package/dist/assets/{index-BSTi6sO4.js → index-9GU1U3uC.js} +2 -2
  81. package/dist/assets/index-B07KPoAU.js +7 -0
  82. package/dist/assets/index-BO_K5qp8.js +4 -0
  83. package/dist/assets/index-BV58Bk4h.js +6 -0
  84. package/dist/assets/index-BcGECSaf.js +1 -0
  85. package/dist/assets/{index-6KFpxb0K.js → index-BdlpB2eR.js} +7 -7
  86. package/dist/assets/{index-DYxM5dQ0.js → index-Bsziwsc_.js} +6 -6
  87. package/dist/assets/index-CSjGSZvb.js +55 -0
  88. package/dist/assets/{index-9WUHnAoz.js → index-CT7MCvWf.js} +2 -2
  89. package/dist/assets/index-CWoGXO4Z.js +30 -0
  90. package/dist/assets/{index-Y8LQew4k.js → index-Cd_Gml9C.js} +1 -1
  91. package/dist/assets/index-CeTnfded.js +1 -0
  92. package/dist/assets/index-CmM1Fb8I.js +1041 -0
  93. package/dist/assets/{index-BAigP45p.js → index-CoEkDRkg.js} +3 -3
  94. package/dist/assets/{index-DuO31sai.js → index-CtjgKQvS.js} +12 -12
  95. package/dist/assets/{index-DyNpNTLA.js → index-D2x0prGU.js} +5 -5
  96. package/dist/assets/{index-BFBoLr1Z.js → index-DACE9NO5.js} +1 -1
  97. package/dist/assets/{index-BH9BMLP2.js → index-DGuACYX4.js} +2 -2
  98. package/dist/assets/{index-Oj4fYD5K.js → index-DJwvNiRa.js} +13 -13
  99. package/dist/assets/{index-Bx-RW9vi.js → index-DX3L95vz.js} +1 -1
  100. package/dist/assets/{index-pDY1qDDT.js → index-DhLGB_2p.js} +1 -1
  101. package/dist/assets/{index-CGC3omja.js → index-Dl5NP6ym.js} +8 -8
  102. package/dist/assets/{index-DlrQ2HQP.js → index-DlRa8Zeh.js} +1 -1
  103. package/dist/assets/index-Dvkly5_Y.js +1 -0
  104. package/dist/assets/{index--2eh3YdI.js → index-DwuQFnlr.js} +1 -1
  105. package/dist/assets/{index-Ba9-ArMT.js → index-IGBGBXd_.js} +1 -1
  106. package/dist/assets/{index-Difo-vx2.js → index-J-Fwoozx.js} +1 -1
  107. package/dist/assets/{index-3ePiAFIp.js → index-KpZGUssm.js} +1 -1
  108. package/dist/assets/{index-C5sng-9P.js → index-M4Y_gFoP.js} +2 -2
  109. package/dist/assets/{index-BO080WnZ.js → index-VySXxf4w.js} +1 -1
  110. package/dist/assets/index-erYyAW7o.js +1 -0
  111. package/dist/assets/index-gu-JSZcO.js +113 -0
  112. package/dist/assets/{index-BZUEA_VO.js → index-xrCVFXc_.js} +5 -5
  113. package/dist/assets/{invitation-BKbYsXkF.js → invitation-LkRqaKIR.js} +5 -5
  114. package/dist/assets/invitations-D0twFHTb.js +3 -0
  115. package/dist/assets/invite-Bq02Wgwb.js +1 -0
  116. package/dist/assets/{isURL-B2kErAOg.js → isURL-DAY9MZJJ.js} +2 -2
  117. package/dist/assets/issue-passport-NpVrtTSF.js +1 -0
  118. package/dist/assets/{item-BFG9doj4.js → item-A9AxqmJb.js} +1 -1
  119. package/dist/assets/{ja-SFs9TI5a.js → ja-Csh_XwzF.js} +2 -2
  120. package/dist/assets/{ja-C6gbn0J8.js → ja-D5EfJGvg.js} +1 -1
  121. package/dist/assets/{ko-av2FKXII.js → ko-DIYdQvvz.js} +1 -1
  122. package/dist/assets/{ko-CHdBh-EI.js → ko-xiNTwgO9.js} +2 -2
  123. package/dist/assets/landing-page-BBhzhyhU.js +1 -0
  124. package/dist/assets/{launch-result-message-DW948RfZ.js → launch-result-message-Dt-T7zmz.js} +1 -1
  125. package/dist/assets/{layout-BByAfem8.js → layout-CT8j1IGl.js} +1 -1
  126. package/dist/assets/list-CpdSyVlo.js +103 -0
  127. package/dist/assets/{list-4bMHptVO.js → list-DcrvvV8X.js} +1 -1
  128. package/dist/assets/{list-header-DMpz8A8v.js → list-header-CjohGZ9B.js} +1 -1
  129. package/dist/assets/localization-BnjH2TLn.js +1 -0
  130. package/dist/assets/{log-BgOBDKaO.js → log-CcKk7QZL.js} +1 -1
  131. package/dist/assets/logger-DkBs7Soy.js +1 -0
  132. package/dist/assets/login-IMzJsMuG.js +1 -0
  133. package/dist/assets/{login-oauth-callback-D81WLOfu.js → login-oauth-callback-Df5gSERT.js} +1 -1
  134. package/dist/assets/{logo-uploader-BSLuQUWG.js → logo-uploader-DI_6oB30.js} +1 -1
  135. package/dist/assets/{lost-passport-CN1lCjAR.js → lost-passport-i0WRSJQt.js} +3 -3
  136. package/dist/assets/{observability-pdEZhjSl.js → observability-B458LeIE.js} +1 -1
  137. package/dist/assets/{omit-BQZKecPT.js → omit-DdfLLBNW.js} +1 -1
  138. package/dist/assets/{open-window-DFdTfBab.js → open-window-CrdkIvcc.js} +1 -1
  139. package/dist/assets/{over-due-invoice-payment-BHBjNHAK.js → over-due-invoice-payment-Dairtuas.js} +1 -1
  140. package/dist/assets/{overview-BNptGAD0.js → overview-D4hz1f04.js} +2 -2
  141. package/dist/assets/{page-header-DvSb4Cmz.js → page-header-gosgJ3fX.js} +1 -1
  142. package/dist/assets/passport-B2fL-0uN.js +1 -0
  143. package/dist/assets/{passport-item-cu1WVC_B.js → passport-item-L7acCYqJ.js} +1 -1
  144. package/dist/assets/{permission-ya4qYiIS.js → permission-B7_8SVB9.js} +1 -1
  145. package/dist/assets/{playground-C0bWoIDS.js → playground-_1Dj8J_h.js} +1 -1
  146. package/dist/assets/preferences-BNy97I1g.js +1 -0
  147. package/dist/assets/profile-embed-hHsyn2Ki.js +1 -0
  148. package/dist/assets/pt-BvcG4R7B.js +5 -0
  149. package/dist/assets/{pt-C5SxM_jO.js → pt-aIOBgpHE.js} +1 -1
  150. package/dist/assets/publish-resource-urgBZEXm.js +1 -0
  151. package/dist/assets/{react-beautiful-dnd.esm-BeX82uI5.js → react-beautiful-dnd.esm-CIwtis6a.js} +1 -1
  152. package/dist/assets/{react-stripe.esm-C51Uah32.js → react-stripe.esm-omsK4b05.js} +1 -1
  153. package/dist/assets/{required-BT8zXV8U.js → required-BPzIdi1N.js} +1 -1
  154. package/dist/assets/{ru-BWd-_jpY.js → ru-Bt8-v101.js} +1 -1
  155. package/dist/assets/ru-DzUPRLmr.js +5 -0
  156. package/dist/assets/runtime-wNrz-OwM.js +1 -0
  157. package/dist/assets/{sanitize-C5jEFDvG.js → sanitize-CEXE1rEu.js} +1 -1
  158. package/dist/assets/sdk-mf5ixH6N.js +1 -0
  159. package/dist/assets/{section-ZPKr6_ii.js → section-DOw43pby.js} +1 -1
  160. package/dist/assets/{security-BlvbBEUe.js → security-D5AcOcu2.js} +3 -3
  161. package/dist/assets/session-BtQQCb_u.js +1 -0
  162. package/dist/assets/{setup-BZH_pYLe.js → setup-PRcxWbhy.js} +1 -1
  163. package/dist/assets/{shorten-label-DVy6K5I7.js → shorten-label-C-X_7vr2.js} +1 -1
  164. package/dist/assets/{simple-select-BeAlThKq.js → simple-select-Bg4XC1E_.js} +1 -1
  165. package/dist/assets/{spaces-BwBxBfty.js → spaces-jHZOfRT3.js} +1 -1
  166. package/dist/assets/{start-DZ1T1oW8.js → start-DyT2xbZe.js} +1 -1
  167. package/dist/assets/{starting-progress-HuVVYFsR.js → starting-progress-Jn-4yF7_.js} +1 -1
  168. package/dist/assets/status-b40PyJnc.js +1 -0
  169. package/dist/assets/{step-actions-D4zI4sWZ.js → step-actions-BZmm0ei-.js} +1 -1
  170. package/dist/assets/{studio-UxYOr-dB.js → studio-Dqjq8IDN.js} +1 -1
  171. package/dist/assets/{switch-control-DEpBEl7-.js → switch-control-CRxlGq2g.js} +1 -1
  172. package/dist/assets/{table-tips-rCE1XKlc.js → table-tips-BMq3WO_p.js} +1 -1
  173. package/dist/assets/team-DK_N0J3a.js +146 -0
  174. package/dist/assets/th-BmW1qKpZ.js +5 -0
  175. package/dist/assets/{th-CRUlNqtq.js → th-QYkziTlm.js} +1 -1
  176. package/dist/assets/traffic-BVT9gNf1.js +1 -0
  177. package/dist/assets/{transfer-DBlISG7m.js → transfer-BGhQJnlc.js} +2 -2
  178. package/dist/assets/unsubscribe-DsNv3U7c.js +1 -0
  179. package/dist/assets/{use-app-logo-BjReZUm7.js → use-app-logo-BKyiSzxV.js} +1 -1
  180. package/dist/assets/{use-mobile-BQQpAf3i.js → use-mobile-DLnLSQQq.js} +1 -1
  181. package/dist/assets/{use-mobile-D6YQgajG.js → use-mobile-Db5FIl07.js} +1 -1
  182. package/dist/assets/{use-server-logo-ClR4qaF0.js → use-server-logo-CFlVReBS.js} +1 -1
  183. package/dist/assets/{use-window-close-CAdGHigF.js → use-window-close-CrHmRyVV.js} +1 -1
  184. package/dist/assets/{useAsync-DVtDVEv6.js → useAsync-1_z8P8M4.js} +1 -1
  185. package/dist/assets/{useAsync-fWwm3Jbj.js → useAsync-BKYfrNw7.js} +1 -1
  186. package/dist/assets/{useAsyncRetry-EEjDgDMR.js → useAsyncRetry-Dyo5t1bq.js} +1 -1
  187. package/dist/assets/{useLocalStorage-BtAV-lV2.js → useLocalStorage-Be_1V0gr.js} +1 -1
  188. package/dist/assets/user-center-BcjjuRmk.js +126 -0
  189. package/dist/assets/{user-follower-McTCB9YD.js → user-follower-DgAPhBY5.js} +1 -1
  190. package/dist/assets/{user-sessions-DYtBKHTy.js → user-sessions-Bv46aXrx.js} +1 -1
  191. package/dist/assets/{util-V3sRgqXp.js → util-BLs2BnSw.js} +1 -1
  192. package/dist/assets/{util-DDkRAi85.js → util-CxUMQb4N.js} +1 -1
  193. package/dist/assets/{vendor-arcblock-DeeG8u0h.js → vendor-arcblock-DGOH9a3F.js} +115 -114
  194. package/dist/assets/{vendor-hooks-BlA8TRnZ.js → vendor-hooks-DmThWyyG.js} +1 -1
  195. package/dist/assets/{vendor-mui-core-DRxbhqaK.js → vendor-mui-core-BFPsXaTR.js} +1 -1
  196. package/dist/assets/{vendor-mui-x-Qp6zkx78.js → vendor-mui-x-C6iZOJbV.js} +1 -1
  197. package/dist/assets/vendor-utils-OrZFrHBP.js +213 -0
  198. package/dist/assets/vendor-ux-CE4sOH7O.js +1569 -0
  199. package/dist/assets/{vi-5AzowaJ4.js → vi-BIkODa3n.js} +1 -1
  200. package/dist/assets/vi-BPU54RQW.js +5 -0
  201. package/dist/assets/{wait-connect-C4xkzmAl.js → wait-connect-D97I-PbQ.js} +1 -1
  202. package/dist/assets/{wizard-5C6_E9yj.js → wizard-Bs0eTfDi.js} +2 -2
  203. package/dist/assets/{wizard-components-Cu-kCEHh.js → wizard-components-BwF9dBN2.js} +2 -2
  204. package/dist/assets/wrap-locale-D6EgWtG_.js +1 -0
  205. package/dist/assets/{zh-Ckmy3lEn.js → zh-Dp_c1E39.js} +1 -1
  206. package/dist/assets/{zh-CZLHYA5h.js → zh-WrFfMVyM.js} +1 -1
  207. package/dist/assets/{zh-tw-DAvBOrfW.js → zh-tw-CYPf8U5U.js} +1 -1
  208. package/dist/assets/{zh-tw-B-qWW0q8.js → zh-tw-DjWFpq-W.js} +1 -1
  209. package/dist/index.html +1 -1
  210. package/dist/service-worker.js +1 -1
  211. package/package.json +37 -37
  212. package/dist/assets/aigne--ydEFgxM.js +0 -10
  213. package/dist/assets/api-rC33aBSs.js +0 -1
  214. package/dist/assets/audit-logs-zMqI7X3o.js +0 -35
  215. package/dist/assets/bind-account-DA7_VhlG.js +0 -1
  216. package/dist/assets/branding-CDF8I7CS.js +0 -1
  217. package/dist/assets/button-BmGMF4AE.js +0 -1
  218. package/dist/assets/click-to-copy-CO6UIqva.js +0 -1
  219. package/dist/assets/config-navigation-CpkTSVgC.js +0 -40
  220. package/dist/assets/config-space-D742OP6B.js +0 -1
  221. package/dist/assets/confirm-D1n-RK65.js +0 -7
  222. package/dist/assets/connect-to-CzzpDiUC.js +0 -1
  223. package/dist/assets/createClass-D_F4rKN8.js +0 -1
  224. package/dist/assets/domains-BwpVswVc.js +0 -1
  225. package/dist/assets/engine-CynZsYEr.js +0 -1
  226. package/dist/assets/exchange-passport-Bic3wuCk.js +0 -1
  227. package/dist/assets/get-safe-url-BrBIp6RF.js +0 -1
  228. package/dist/assets/index-B6gW9Yjq.js +0 -1
  229. package/dist/assets/index-BAm_yZT8.js +0 -6
  230. package/dist/assets/index-BOst2c_c.js +0 -29
  231. package/dist/assets/index-De6RU5uv.js +0 -55
  232. package/dist/assets/index-Dt8akALo.js +0 -1039
  233. package/dist/assets/index-F6BB6AaL.js +0 -4
  234. package/dist/assets/index-OuTt2geA.js +0 -1
  235. package/dist/assets/index-Y3X8f7Z4.js +0 -113
  236. package/dist/assets/index-dAVnNC1I.js +0 -7
  237. package/dist/assets/index-rX_gKff6.js +0 -1
  238. package/dist/assets/invitations-B-nYRbwb.js +0 -3
  239. package/dist/assets/invite-wTyupZG1.js +0 -1
  240. package/dist/assets/issue-passport-BrDZjXex.js +0 -1
  241. package/dist/assets/landing-page-CQU5LiHu.js +0 -1
  242. package/dist/assets/list-aRu0R0L1.js +0 -103
  243. package/dist/assets/localization-J2gA-h7I.js +0 -1
  244. package/dist/assets/logger-DVbuTPin.js +0 -1
  245. package/dist/assets/login-DFrvIKm0.js +0 -1
  246. package/dist/assets/passport-Di66zEMV.js +0 -1
  247. package/dist/assets/preferences-BPkyQMDe.js +0 -1
  248. package/dist/assets/profile-embed-DEkmxYPv.js +0 -1
  249. package/dist/assets/pt-BJowi6tZ.js +0 -5
  250. package/dist/assets/publish-resource-q3_KT0uW.js +0 -1
  251. package/dist/assets/ru-DTjDV3Pw.js +0 -5
  252. package/dist/assets/runtime-zSSdjk9Q.js +0 -1
  253. package/dist/assets/sdk-DlI_Utmi.js +0 -1
  254. package/dist/assets/session-Y3RU3I2O.js +0 -1
  255. package/dist/assets/status-BR0A9vPy.js +0 -1
  256. package/dist/assets/team-s6q3vfNx.js +0 -146
  257. package/dist/assets/th-A3GLGlJ1.js +0 -5
  258. package/dist/assets/traffic-CwvEJLQW.js +0 -1
  259. package/dist/assets/unsubscribe-BW7dIXXb.js +0 -1
  260. package/dist/assets/user-center-D18_bCCh.js +0 -126
  261. package/dist/assets/vendor-utils-CUDP56Ff.js +0 -213
  262. package/dist/assets/vendor-ux-B9VfuZTg.js +0 -1569
  263. package/dist/assets/vi-DGXwnYQW.js +0 -5
  264. package/dist/assets/wrap-locale-DcfUdcYR.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./vendor-react-Dvs43sk9.js";import{j as C,bB as w}from"./vendor-mui-core-BFPsXaTR.js";import{a as x,Q as B}from"./vendor-utils-OrZFrHBP.js";import{ab as u,Z as G,X as k}from"./index-CmM1Fb8I.js";import{j as L}from"./vendor-hooks-DmThWyyG.js";import{H as P}from"./vendor-ux-CE4sOH7O.js";import{g as b,a as h,b as A}from"./spaces-jHZOfRT3.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:T,Consumer:q}=l;function _({children:r}){const[c,a]=e.useState(!1),[o,n]=e.useState(null),{blocklet:f,actions:{refreshBlocklet:i}}=u(),{storageEndpoint:s}=N(),{api:d}=G();L(async()=>{try{if(a(!0),x(s)){n(null);return}const t=await h(s);n(t)}catch(t){console.error(t),P.error(t.message)}finally{a(!1)}},[s]);const m=()=>{n(null),i()},E=async t=>{n(t),await p(t.endpoint),i()},p=async t=>{await d.configBlocklet({input:{did:[f.meta.did],configs:[{key:k.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}),i()};e.useEffect(()=>{async function t(){if(!o)return;const g=await A(o.endpoint,o.name),S=B(o,{name:g});n(S)}t()},[]);const y=!!(s&&o);return C.jsx(T,{value:{loading:c,spaceGateway:o,deleteSpaceGateway:m,updateSpaceGateway:E,storageEndpoint:s,settingStorageEndpoint:p,hasStorageEndpoint:y},children:r})}_.propTypes={children:w.node.isRequired};function F(){return e.useContext(l)}export{_ as C,F as u};
@@ -0,0 +1,7 @@
1
+ import{r as a}from"./vendor-react-Dvs43sk9.js";import{D as x,J as b,j as s,bC as z,$ as F,bD as J,aX as L,R as N,a6 as O,at as Q,Y as V,W as o}from"./vendor-mui-core-BFPsXaTR.js";import{V as X,p as y}from"./vendor-ux-CE4sOH7O.js";import"./index-CmM1Fb8I.js";import{f as Y}from"./index-DBs9Ljax.js";function G(){const e=x();return{minWidth:b(e.breakpoints.down("md"))?300:e.breakpoints.values.sm}}function H({title:e,description:n,showCancel:l=!0,showConfirm:C=!0,cancel:j="",confirm:k="Confirm",color:D="error",params:w={},onCancel:S=()=>{},onConfirm:E,loading:c=!1,displayError:P=!0,children:R=void 0,...T}){const[r,W]=a.useState(w),[$,d]=a.useState(!0),[m,p]=a.useState(!1),[u,f]=a.useState(""),{t:v}=X(),q=x(),h=async t=>{if(typeof t=="function"){p(!0);try{if(await t(r)===!1)return;d(!1)}catch(i){f(Y(i)),console.error(i)}finally{p(!1)}}else d(!1)},B=typeof e=="function"?e():e,M=typeof n=="function"?n(r,W,f):n,A=b(q.breakpoints.down("md")),_=t=>{t.stopPropagation()},{minWidth:g}=G();return s.jsxs(I,{onClick:_,fullScreen:A,open:$,style:{minWidth:g},...T,children:[s.jsx(z,{children:B}),s.jsxs(F,{style:{minWidth:g},children:[s.jsx(J,{component:"div",children:M}),!!u&&P&&s.jsx(L,{severity:"error",style:{width:"100%",marginTop:8},children:u}),R]}),s.jsxs(N,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[l&&s.jsx(y,{onClick:t=>{t.stopPropagation(),h(S)},color:"inherit","data-cy":"cancel-confirm-dialog",children:j||v("common.cancel")}),C&&s.jsxs(y,{onClick:t=>{t.stopPropagation(),h(E)},color:D,disabled:r.__disableConfirm||m||c,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(m||c)&&s.jsx(O,{size:16,sx:{mr:1}}),k]})]})]})}H.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};const I=Q(V)`
2
+ .delete-actions .Mui-disabled {
3
+ color: ${({theme:e})=>`${e.palette.text.primary} !important`};
4
+ box-shadow: none;
5
+ background-color: ${({theme:e})=>`${e.palette.action.disabled} !important`};
6
+ }
7
+ `;export{H as C};
@@ -1 +1 @@
1
- import{D as Y,j as o,ak as u,J as Z,a6 as ee,ae as ne,Q as oe}from"./vendor-mui-core-DRxbhqaK.js";import{i as se,u as te,r as L,L as re}from"./vendor-react-Dvs43sk9.js";import{a as ae,a5 as ce,R as ie,c as le,ac as S,H as E,ad as U,W as de,g as pe}from"./index-Dt8akALo.js";import{a as me,b as k,h as ue,m as fe}from"./vendor-hooks-BlA8TRnZ.js";import{o as ge}from"./vendor-arcblock-DeeG8u0h.js";import{T as he,e as we,v as ke,H as x}from"./vendor-ux-B9VfuZTg.js";import{u as xe}from"./use-passport-id-B-b-_oYF.js";import{b as ve,c as Te,J as _e,C as be,A as Ce,O as Ie,P as ye}from"./vendor-utils-CUDP56Ff.js";import{g as j}from"./get-safe-url-BrBIp6RF.js";import{K as Pe}from"./landing-page-CQU5LiHu.js";import{d}from"./logger-DVbuTPin.js";import"./lottie-web-4koyQiv_.js";const De={primary:{light:"#51A2FF"}},R="authorization_response",Le=pe(),Se="blocklet:onLogin",f=new BroadcastChannel(Se);function ze(){const{getPassportId:M}=xe(),{session:N,connectApi:O}=ae(),{t:a,locale:A}=he(),F=se(),[i]=te(),{encrypt:B}=ce(),H=Y(),v=we();let p={};try{p=JSON.parse(decodeURIComponent(ie(i.get("params"))))}catch(n){console.error("parse connect params failed",n)}ve(i.get("popup"));const{action:m="login",passkeyBehavior:W="both",extraParams:l={},messages:J,...g}=p;L.useEffect(()=>{l.inviter&&window.localStorage.setItem("inviter",l.inviter)},[l.inviter]);const c=i.get("redirect"),T=i.get("opener"),h=i.get("_ek_");l.passportId=M(),m==="login"&&Te(g.forceConnected)&&(g.forceConnected=!1);const w=n=>h?B(JSON.stringify(n),h):n,_=L.useMemo(()=>c||!window.opener?"redirect":"popup",[c]),b=async n=>{const e=await Le.federated.getTrustedDomains();if(!T){e.forEach(s=>{window.opener.postMessage(n,Ie(s)),window.opener.postMessage(n,ye(s))});return}const t=new URL(T);if(!e.includes(t.hostname))throw x.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(n,t.origin)},C=({encrypted:n=!0,...e},t,s)=>{d("connect page onSuccess",{encrypted:n,result:e,options:s}),n&&(e.sessionToken&&(e.sessionToken=t(e.sessionToken)),e.refreshToken&&(e.refreshToken=t(e.refreshToken)),e.visitorId&&(e.visitorId=t(e.visitorId)),d("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const P={type:R,response:e,options:s};({redirect:()=>{d("connect page onSuccess redirect",e),setTimeout(()=>{if(U(),c){const D=decodeURIComponent(c),r=S(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)),s?.connected_did&&r.searchParams.set("connected_did",s.connected_did),s?.connected_pk&&r.searchParams.set("connected_pk",s.connected_pk),s?.connected_app&&r.searchParams.set("connected_app",s.connected_app),s?.connected_wallet_os&&r.searchParams.set("connected_wallet_os",s.connected_wallet_os),s?.saveConnect&&r.searchParams.set("saveConnect",s.saveConnect),f.postMessage({...Ce(e,["sessionToken","refreshToken","visitorId"])}),de(D)?window.location.replace(j(r.href,{allowDomains:null})):F(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},3e3)},popup:async()=>{d("connect page onSuccess popup",P),await b(P),U(),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[_]()},z=n=>{const e={type:R,error:n.message,errorDescription:n.message};d("connect page onError",{res:e}),{redirect:()=>{x.error(n.message)},popup:()=>{b(e)}}[_]()},K=me(()=>{if(m!=="login")return null;const n=window.blocklet?.trustedFactories||[];return n?.length>0?o.jsxs(u,{children:[a("exchangePassport.tooltip1"),o.jsx(u,{component:re,reloadDocument:!0,to:_e(be(le.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:c||"/"}),sx:{color:De.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),o.jsx(u,{component:"ul",sx:{pl:1.5},children:n.map(e=>o.jsx(u,{component:"li",children:e},e))})]}):null},[m]),Q=k(async()=>{if(!c)return!0;let n;try{n=new URL(c)}catch{return!1}let e;try{e=new URL(p?.baseUrl)}catch{try{e=new URL(p?.prefix)}catch(t){console.error("baseUrl and prefix are both invalid",t)}}if(e){let t=[];if(e.origin===window.location.origin?t=window.blocklet.domainAliases||[]:t=(await ke(e.origin))?.domainAliases||[],!t.includes(n.hostname))return x.error(a("login.invalidRedirectUrl")),!1}return!0}),I=k(()=>{const n=decodeURIComponent(c),e=S(n);window.location.replace(j(e.href,{allowDomains:null}))}),$=!0,G=!0,V=Z(n=>n.breakpoints.down("lg")),y=k(async()=>{await Q()&&$&&(window.temporaryDIDConnectOnSuccess=(e,t)=>{C(e,t,{saveConnect:!0})},setTimeout(()=>{O.open({locale:A,action:m,passkeyBehavior:W,extraParams:l,...g,className:"connect",popup:!0,messages:J||{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(globalThis.blocklet?.DID_CONNECT_ALLOW_WALLET),onSuccess:C,onError:z,hideCloseButton:G})}))});if(ue(()=>{y(),f.addEventListener("message",I)}),fe(()=>{delete window.temporaryDIDConnectOnSuccess,f.removeEventListener("message",I),f.close()}),N.loading)return o.jsxs(o.Fragment,{children:[o.jsx(E,{children:o.jsx("title",{children:"DID Connect"})}),o.jsx(ge,{children:o.jsx(ee,{})})]});const X=globalThis.blocklet.appName,q=globalThis.blocklet.appDescription;return o.jsxs(o.Fragment,{children:[o.jsx(E,{children:o.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),V&&!v.arcSphere?o.jsx(ne,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):o.jsx(Pe,{did:globalThis.blocklet.appPid,title:X,description:q,actions:v.arcSphere?null:o.jsx(oe,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{ze as default};
1
+ import{D as q,j as o,ak as u,J as Z,a6 as ee,ae as ne,Q as oe}from"./vendor-mui-core-BFPsXaTR.js";import{i as se,u as te,r as L,L as re}from"./vendor-react-Dvs43sk9.js";import{a as ae,a7 as ce,R as ie,c as le,ae as S,H as E,af as U,Y as de,g as pe}from"./index-CmM1Fb8I.js";import{a as me,b as k,h as ue,m as fe}from"./vendor-hooks-DmThWyyG.js";import{o as ge}from"./vendor-arcblock-DGOH9a3F.js";import{V as he,u as we,F as ke,H as x}from"./vendor-ux-CE4sOH7O.js";import{u as xe}from"./use-passport-id-B-b-_oYF.js";import{b as ve,c as _e,J as be,C as Te,A as Ce,O as Ie,P as ye}from"./vendor-utils-OrZFrHBP.js";import{g as j}from"./get-safe-url-94yHUMyk.js";import{K as Pe}from"./landing-page-BBhzhyhU.js";import{d}from"./logger-DkBs7Soy.js";import"./lottie-web-4koyQiv_.js";const De={primary:{light:"#51A2FF"}},R="authorization_response",Le=pe(),Se="blocklet:onLogin",f=new BroadcastChannel(Se);function ze(){const{getPassportId:M}=xe(),{session:N,connectApi:O}=ae(),{t:a,locale:A}=he(),F=se(),[i]=te(),{encrypt:B}=ce(),H=q(),v=we();let p={};try{p=JSON.parse(decodeURIComponent(ie(i.get("params"))))}catch(n){console.error("parse connect params failed",n)}ve(i.get("popup"));const{action:m="login",passkeyBehavior:J="both",extraParams:l={},messages:W,...g}=p;L.useEffect(()=>{l.inviter&&window.localStorage.setItem("inviter",l.inviter)},[l.inviter]);const c=i.get("redirect"),_=i.get("opener"),h=i.get("_ek_");l.passportId=M(),m==="login"&&_e(g.forceConnected)&&(g.forceConnected=!1);const w=n=>h?B(JSON.stringify(n),h):n,b=L.useMemo(()=>c||!window.opener?"redirect":"popup",[c]),T=async n=>{const e=await Le.federated.getTrustedDomains();if(!_){e.forEach(s=>{window.opener.postMessage(n,Ie(s)),window.opener.postMessage(n,ye(s))});return}const t=new URL(_);if(!e.includes(t.hostname))throw x.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(n,t.origin)},C=({encrypted:n=!0,...e},t,s)=>{d("connect page onSuccess",{encrypted:n,result:e,options:s}),n&&(e.sessionToken&&(e.sessionToken=t(e.sessionToken)),e.refreshToken&&(e.refreshToken=t(e.refreshToken)),e.visitorId&&(e.visitorId=t(e.visitorId)),d("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const P={type:R,response:e,options:s};({redirect:()=>{d("connect page onSuccess redirect",e),setTimeout(()=>{if(U(),c){const D=decodeURIComponent(c),r=S(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)),s?.connected_did&&r.searchParams.set("connected_did",s.connected_did),s?.connected_pk&&r.searchParams.set("connected_pk",s.connected_pk),s?.connected_app&&r.searchParams.set("connected_app",s.connected_app),s?.connected_wallet_os&&r.searchParams.set("connected_wallet_os",s.connected_wallet_os),s?.saveConnect&&r.searchParams.set("saveConnect",s.saveConnect),f.postMessage({...Ce(e,["sessionToken","refreshToken","visitorId"])}),de(D)?window.location.replace(j(r.href,{allowDomains:null})):F(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},3e3)},popup:async()=>{d("connect page onSuccess popup",P),await T(P),U(),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[b]()},z=n=>{const e={type:R,error:n.message,errorDescription:n.message};d("connect page onError",{res:e}),{redirect:()=>{x.error(n.message)},popup:()=>{T(e)}}[b]()},K=me(()=>{if(m!=="login")return null;const n=window.blocklet?.trustedFactories||[];return n?.length>0?o.jsxs(u,{children:[a("exchangePassport.tooltip1"),o.jsx(u,{component:re,reloadDocument:!0,to:be(Te(le.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:c||"/"}),sx:{color:De.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),o.jsx(u,{component:"ul",sx:{pl:1.5},children:n.map(e=>o.jsx(u,{component:"li",children:e},e))})]}):null},[m]),Q=k(async()=>{if(!c)return!0;let n;try{n=new URL(c)}catch{return!1}let e;try{e=new URL(p?.baseUrl)}catch{try{e=new URL(p?.prefix)}catch(t){console.error("baseUrl and prefix are both invalid",t)}}if(e){let t=[];if(e.origin===window.location.origin?t=window.blocklet.domainAliases||[]:t=(await ke(e.origin))?.domainAliases||[],!t.includes(n.hostname))return x.error(a("login.invalidRedirectUrl")),!1}return!0}),I=k(()=>{const n=decodeURIComponent(c),e=S(n);window.location.replace(j(e.href,{allowDomains:null}))}),$=!0,V=!0,G=Z(n=>n.breakpoints.down("lg")),y=k(async()=>{await Q()&&$&&(window.temporaryDIDConnectOnSuccess=(e,t)=>{C(e,t,{saveConnect:!0})},setTimeout(()=>{O.open({locale:A,action:m,passkeyBehavior:J,extraParams:l,...g,className:"connect",popup:!0,messages:W||{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(globalThis.blocklet?.DID_CONNECT_ALLOW_WALLET),onSuccess:C,onError:z,hideCloseButton:V})}))});if(ue(()=>{y(),f.addEventListener("message",I)}),fe(()=>{delete window.temporaryDIDConnectOnSuccess,f.removeEventListener("message",I),f.close()}),N.loading)return o.jsxs(o.Fragment,{children:[o.jsx(E,{children:o.jsx("title",{children:"DID Connect"})}),o.jsx(ge,{children:o.jsx(ee,{})})]});const X=globalThis.blocklet.appName,Y=globalThis.blocklet.appDescription;return o.jsxs(o.Fragment,{children:[o.jsx(E,{children:o.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),G&&!v.arcSphere?o.jsx(ne,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):o.jsx(Pe,{did:globalThis.blocklet.appPid,title:X,description:Y,actions:v.arcSphere?null:o.jsx(oe,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{ze as default};
@@ -1,4 +1,4 @@
1
- import{j as n,a6 as g,T as w,s as k,W as l}from"./vendor-mui-core-DRxbhqaK.js";import{r as j}from"./vendor-react-Dvs43sk9.js";import{C as A,n as E}from"./vendor-utils-CUDP56Ff.js";import{u as I}from"./useAsync-fWwm3Jbj.js";import{a as T,a5 as R,V as d,a6 as C,s as P,t as L}from"./index-Dt8akALo.js";import{T as M,u as S,H as U}from"./vendor-ux-B9VfuZTg.js";import{o as m}from"./vendor-arcblock-DeeG8u0h.js";import"./useAsync-DVtDVEv6.js";import"./vendor-hooks-BlA8TRnZ.js";import"./lottie-web-4koyQiv_.js";function b({children:f,skipBindAccount:i=!1}){const{t:c,locale:y}=M(),{api:u,session:r}=T(),{encryptKey:h,decrypt:x}=R(),s=j.useMemo(()=>{if(i||!r.user)return!1;const{sourceProvider:e,connectedAccounts:o=[]}=r.user,a=o.every(v=>v.provider===d.LOGIN_PROVIDER.EMAIL);return e===d.LOGIN_PROVIDER.EMAIL&&a},[r.user,i]),t=I(async()=>{if(s)return null;const e=new URL(window.location.href);e.pathname=A(window?.env?.apiPrefix??"/","/api/did/setup/token"),e.searchParams.set("_ek_",h);const{data:o}=await u.get(e.href);return o},[s]),p=async e=>{const o=Array.isArray(e)?e.find(a=>a.sessionToken):e;o.sessionToken&&P(x(o.sessionToken));try{await r.refresh()}catch(a){U.error(a.message)}};return!s&&(!t.value||t.loading||r.loading)?n.jsx(m,{relative:"parent",children:n.jsx(g,{})}):!s&&t.error?n.jsx(m,{relative:"parent",children:n.jsx(w,{children:t.error.message})}):r.user&&!s?f:n.jsx(O,{popup:!0,open:!0,hideCloseButton:!0,action:s?"bind-wallet":"pre-setup",checkFn:u.get,checkTimeout:10*60*1e3,webWalletUrl:S(),onSuccess:p,locale:y,messages:{title:c("setup.connect.title"),scan:c("setup.connect.scan"),confirm:c("setup.connect.confirm"),success:c("setup.connect.success")},customItems:s?[n.jsx(C,{behavior:"only-new",action:"connect",createMode:"connect",onSuccess:p,onError:E,dense:!0},"passkey")]:[],extraParams:s?{previousUserDid:r.user?.did,visitorId:t.value?.visitorId,skipMigrateAccount:!0,isService:!0}:{setup:!0,nw:t.value.url}})}b.propTypes={children:l.any.isRequired,skipBindAccount:l.bool};const O=k(L)`
1
+ import{j as n,a6 as g,T as w,s as k,W as l}from"./vendor-mui-core-BFPsXaTR.js";import{r as j}from"./vendor-react-Dvs43sk9.js";import{C as A,n as E}from"./vendor-utils-OrZFrHBP.js";import{u as I}from"./useAsync-BKYfrNw7.js";import{a as R,a7 as T,X as d,a8 as C,s as P,v as L}from"./index-CmM1Fb8I.js";import{V as M,D as S,H as U}from"./vendor-ux-CE4sOH7O.js";import{o as m}from"./vendor-arcblock-DGOH9a3F.js";import"./useAsync-1_z8P8M4.js";import"./vendor-hooks-DmThWyyG.js";import"./lottie-web-4koyQiv_.js";function b({children:f,skipBindAccount:i=!1}){const{t:c,locale:y}=M(),{api:u,session:r}=R(),{encryptKey:h,decrypt:x}=T(),s=j.useMemo(()=>{if(i||!r.user)return!1;const{sourceProvider:e,connectedAccounts:o=[]}=r.user,a=o.every(v=>v.provider===d.LOGIN_PROVIDER.EMAIL);return e===d.LOGIN_PROVIDER.EMAIL&&a},[r.user,i]),t=I(async()=>{if(s)return null;const e=new URL(window.location.href);e.pathname=A(window?.env?.apiPrefix??"/","/api/did/setup/token"),e.searchParams.set("_ek_",h);const{data:o}=await u.get(e.href);return o},[s]),p=async e=>{const o=Array.isArray(e)?e.find(a=>a.sessionToken):e;o.sessionToken&&P(x(o.sessionToken));try{await r.refresh()}catch(a){U.error(a.message)}};return!s&&(!t.value||t.loading||r.loading)?n.jsx(m,{relative:"parent",children:n.jsx(g,{})}):!s&&t.error?n.jsx(m,{relative:"parent",children:n.jsx(w,{children:t.error.message})}):r.user&&!s?f:n.jsx(D,{popup:!0,open:!0,hideCloseButton:!0,action:s?"bind-wallet":"pre-setup",checkFn:u.get,checkTimeout:10*60*1e3,webWalletUrl:S(),onSuccess:p,locale:y,messages:{title:c("setup.connect.title"),scan:c("setup.connect.scan"),confirm:c("setup.connect.confirm"),success:c("setup.connect.success")},customItems:s?[n.jsx(C,{behavior:"only-new",action:"connect",createMode:"connect",onSuccess:p,onError:E,dense:!0},"passkey")]:[],extraParams:s?{previousUserDid:r.user?.did,visitorId:t.value?.visitorId,skipMigrateAccount:!0,isService:!0}:{setup:!0,nw:t.value.url}})}b.propTypes={children:l.any.isRequired,skipBindAccount:l.bool};const D=k(L)`
2
2
  .action-info-desc {
3
3
  padding: 0 72px;
4
4
  }
@@ -0,0 +1 @@
1
+ import{r as h}from"./vendor-react-Dvs43sk9.js";import{V as x,a3 as S,H as f}from"./vendor-ux-CE4sOH7O.js";import{D as w,a as b,b as R}from"./index-CWoGXO4Z.js";import{e as y,X as I,ab as E,Z as T,aK as P,aL as U}from"./index-CmM1Fb8I.js";import{j as t,ak as m,T as g,I as B,bX as q,W as r,bB as F}from"./vendor-mui-core-BFPsXaTR.js";import"./index-Cd_Gml9C.js";import"./index-BojVbZw0.js";import{u as N}from"./config-space-DEqVeU5w.js";import{f as D}from"./index-DBs9Ljax.js";import{a as O,D as W,C as A}from"./vendor-utils-OrZFrHBP.js";import"./api-txzyyizM.js";function M(){const{t:e}=x();return t.jsx(m,{children:t.jsxs(m,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center"},children:[t.jsx(w,{style:{width:250,height:250}}),t.jsx(g,{sx:{marginTop:"24px"},children:e("storage.spaces.connect.providerForStorage")})]})})}function j({spaceGateway:e,onDeleteSpace:c=()=>{}}){const{t:n}=x(),[a,l]=h.useState(!1),[o,d]=h.useState(!1),u=(s,p)=>{s?.stopPropagation(),l(p)},i=async s=>{try{s?.stopPropagation(),d(!0),await c(e),l(!1)}catch(p){console.error(p),f.error(`${n("storage.spaces.gateway.delete.failed")}: ${D(p)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(B,{size:"small",onClick:s=>u(s,!0),children:t.jsx(q,{})}),t.jsx(S,{title:n("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:n("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:o}},cancelButton:{text:n("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:i,onCancel:s=>u(s,!1),children:t.jsx(g,{sx:{wordWrap:"break-word"},children:n("storage.spaces.gateway.delete.descForStorage",{name:`${e?.name}`})})})]})}j.propTypes={onDeleteSpace:r.func,spaceGateway:r.shape({name:r.string.isRequired,url:r.string.isRequired,protected:r.bool}).isRequired};function C({spaceGateway:e,onDisconnect:c=()=>{}}){const{t:n}=x(),a=async()=>{try{await c(),f.success(n("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(l){console.error(l),f.error(D(l))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}C.propTypes={spaceGateway:r.shape({did:r.string.isRequired,name:r.string.isRequired,url:r.string.isRequired,endpoint:r.string.isRequired}).isRequired,onDisconnect:r.func};function Q(){const{t:e}=x(),{spaceGateway:c,settingStorageEndpoint:n}=N();return t.jsxs(m,{sx:{display:"flex",flexDirection:"column"},children:[t.jsx(m,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:t.jsx(g,{sx:{fontSize:"1rem",fontWeight:"bold"},children:e("storage.spaces.connected.title")})}),t.jsx(m,{children:t.jsx(b,{sx:{marginTop:2},endpoint:c.endpoint,selected:!0,action:a=>t.jsx(C,{...a,onDisconnect:()=>n(null)})})})]})}function $({blocklet:e}){if(O(e))return{};const{appDid:c}=e,n=y.getAppName(e),a=y.getAppDescription(e),o=e?.site?.domainAliases?.sort((i,s)=>i.accessibility.accessible&&s.accessibility.accessible?+i.isProtected-+s.isProtected:+s.accessibility.accessible-+i.accessibility.accessible)?.map(i=>{const s=i?.domainStatus?.isHttps?"https://":"http://",p=i?.value;return`${s}${p}`}).filter(Boolean)?.[0],d=I.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:c,appName:n,appDescription:a,appUrl:o,scopes:d,referrer:u,isReady:!!o}}function v({onConnect:e=()=>{},...c}){const{blocklet:n}=E(),{info:a}=T(),{t:l}=x(),o=$({blocklet:n}),d=P(a),u={checkFn:W.create({baseURL:A(window.location.origin,U())}).get,webWalletUrl:d,extraParams:{appPid:n.appPid,appDid:o.appDid,appName:o.appName,appDescription:o.appDescription,appUrl:o.appUrl,referrer:o.referrer,scopes:o.scopes,nodeDid:a.did}},i=async({spaceGateway:s})=>{try{await e(s),f.success(l("storage.spaces.connectedWithName",{name:s.name}))}catch(p){console.error(p),f.error(D(p))}};return t.jsx(R,{...c,options:u,onSuccess:i})}v.propTypes={onConnect:F.func};export{Q as C,M as D,v as a,$ as u};
@@ -1,4 +1,4 @@
1
- import{j as n,at as i,W as o}from"./vendor-mui-core-DRxbhqaK.js";function p({children:e,...t}){return n.jsx(d,{...t,children:e})}p.propTypes={children:o.any.isRequired};const d=i.div`
1
+ import{j as n,at as i,W as o}from"./vendor-mui-core-BFPsXaTR.js";function p({children:e,...t}){return n.jsx(d,{...t,children:e})}p.propTypes={children:o.any.isRequired};const d=i.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{e as D,g as F}from"./vendor-react-Dvs43sk9.js";import{e as L}from"./vendor-arcblock-DeeG8u0h.js";var s={exports:{}};const N=D(L);var l;function R(){if(l)return s.exports;l=1;const{getNftBGColor:g,DEFAULT_COLORS:u,getNftBGColorFromDid:v,getSvg:f}=N,n=(e,r)=>{let t;return e==="default"?t=u["app-passport"]:e==="auto"?t=v(r):t=g(e),t},m=e=>{const r=parseInt(e.slice(1,3),16),t=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return(.299*r+.587*t+.114*o)/255>.5?"#111":"#EEE"},x=({issuer:e="",title:r="",issuerDid:t="",issuerAvatarUrl:o="",ownerDid:p="",ownerName:C="",ownerAvatarUrl:P="",preferredColor:S="default",revoked:c=!1,isDataUrl:E=!1,width:d="100%",height:$="100%",extra:I=null,scope:a="passport",role:q=""})=>{const y=n(S,t),i=f({width:d,height:$,tag:c?"revoked":"",tagVariant:c?"error":"info",color:y,did:p,variant:`app-${a}`,verifiable:!0,issuer:{name:e,icon:o},header:{name:a==="passport"?r:C,icon:P},extra:a==="kyc"?{key:q,value:r}:I||{key:"Exp",value:"2123-01-01"}});return E?`data:image/svg+xml;utf8,${encodeURIComponent(i)}`:i};return s.exports=x,s.exports.getPassportColor=n,s.exports.getTextColor=m,s.exports}var T=R();const B=F(T);export{B as c};
1
+ import{e as D,g as F}from"./vendor-react-Dvs43sk9.js";import{e as L}from"./vendor-arcblock-DGOH9a3F.js";var s={exports:{}};const N=D(L);var l;function R(){if(l)return s.exports;l=1;const{getNftBGColor:g,DEFAULT_COLORS:u,getNftBGColorFromDid:v,getSvg:f}=N,n=(e,r)=>{let t;return e==="default"?t=u["app-passport"]:e==="auto"?t=v(r):t=g(e),t},m=e=>{const r=parseInt(e.slice(1,3),16),t=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return(.299*r+.587*t+.114*o)/255>.5?"#111":"#EEE"},x=({issuer:e="",title:r="",issuerDid:t="",issuerAvatarUrl:o="",ownerDid:p="",ownerName:C="",ownerAvatarUrl:P="",preferredColor:S="default",revoked:c=!1,isDataUrl:E=!1,width:d="100%",height:$="100%",extra:I=null,scope:a="passport",role:q=""})=>{const y=n(S,t),i=f({width:d,height:$,tag:c?"revoked":"",tagVariant:c?"error":"info",color:y,did:p,variant:`app-${a}`,verifiable:!0,issuer:{name:e,icon:o},header:{name:a==="passport"?r:C,icon:P},extra:a==="kyc"?{key:q,value:r}:I||{key:"Exp",value:"2123-01-01"}});return E?`data:image/svg+xml;utf8,${encodeURIComponent(i)}`:i};return s.exports=x,s.exports.getPassportColor=n,s.exports.getTextColor=m,s.exports}var T=R();const B=F(T);export{B as c};
@@ -0,0 +1 @@
1
+ import{c9 as u,ca as c}from"./vendor-mui-core-BFPsXaTR.js";import{a4 as f,a5 as s}from"./vendor-ux-CE4sOH7O.js";function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function y(e,t){if(e){if(typeof e=="string")return n(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function b(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(e)}function _(e,t){if(t&&(f(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,s(o.key),o)}}function O(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}export{O as _,d as a,b,_ as c,a as d,n as e,y as f};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-gnjjKJuC.css"),window.__toCdnUrl("assets/add-component-core-G0iZE90Q.css")])))=>i.map(i=>d[i]);
2
- import{c as tn,n as ht,H as F,T as B,aG as nn,aH as wo,a3 as So,M as on,P as rn,E as Et,w as jo,p as Co,k as ko,_}from"./vendor-ux-B9VfuZTg.js";import{j as i,W as S,aZ as Eo,cN as Io,d4 as _o,bb as To,dh as Lo,di as Do,cP as Ao,dj as Po,d8 as Ro,dk as Mo,I as Ne,aQ as Oo,aR as No,aX as gt,a3 as Uo,M as Bo,aO as zo,a6 as V,aP as $o,bi as Fo,at as Ue,T as ee,bq as Vo,b6 as It,br as _t,ak as I,D as pe,J as re,ah as Be,ao as Ho,dl as Wo,aj as qo,dm as sn,dn as an,dp as cn,am as de,a$ as _e,dq as Tt,U as Q,aN as ln,Y as un,b_ as Ko,dr as Go,ds as Qo,Q as Zo,dt as Xo}from"./vendor-mui-core-DRxbhqaK.js";import{r as m,L as dn,i as fn,g as Jo,k as Yo,j as er}from"./vendor-react-Dvs43sk9.js";import{X as ze,e as P,V as qe,am as Ke,c as R,W as Lt,bC as tr,$ as nr,a9 as or,t as rr,bD as sr,bE as pn,_ as te,bF as mn,aL as ir,bG as ar,U as cr,b2 as lr,b3 as ur,bH as dr,b4 as fr,bI as pr,bJ as mr,al as hr,bK as Ge,bL as gr,bM as br,b1 as xr,a as hn,B as gn,l as me,a7 as yr,k as vr,ab as wr,m as Dt,bN as At,h as Sr,j as jr,q as Cr,o as ie,n as kr,p as Er,P as Ir,G as _r,N as Tr,bv as Lr,Z as Dr,r as Ar}from"./index-Dt8akALo.js";import{aa as Pr,C as W,J as bn,Q as Rr,e as Mr}from"./vendor-utils-CUDP56Ff.js";import{o as Ae}from"./vendor-arcblock-DeeG8u0h.js";import{u as Pt}from"./useLocalStorage-BtAV-lV2.js";import{f as bt}from"./index-DBs9Ljax.js";import{C as Rt}from"./confirm-D1n-RK65.js";import{g as Mt}from"./get-safe-url-BrBIp6RF.js";import{u as xn}from"./session-Y3RU3I2O.js";import{a as ne,l as Or}from"./vendor-hooks-BlA8TRnZ.js";import{j as Nr,b as Ur,M as Br,a as zr,T as $r,N as Fr}from"./team-s6q3vfNx.js";import{c as Ot}from"./passport-Di66zEMV.js";import{D as Vr,u as yn}from"./useAsyncRetry-EEjDgDMR.js";import{u as vn}from"./useSetState-DFuQZPPV.js";import{x as Hr,d as Wr}from"./index-DuO31sai.js";import{O as qr}from"./over-due-invoice-payment-BHBjNHAK.js";import{u as Kr}from"./use-mobile-D6YQgajG.js";const wn=m.createContext({});function Sn({children:e,type:t="blocklets"}){const[n,r]=m.useState([]),o=m.useRef([]),s=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},a=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));Pr(u,n).forEach(p=>a(p))};return i.jsx(wn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:a,matchDeletingDid:c},children:e})}Sn.propTypes={type:S.string,children:S.node.isRequired};function ec(){return m.useContext(wn)}const Gr=e=>m.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("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"})),Y={Start:Eo,Stop:Io,Restart:_o,Reload:Mo,Remove:To,Config:Ro,Log:Po,Group:Ao,Cancel:Lo,Dashboard:Gr,Overview:Do},Qr=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(W(n.origin,t));return o.search=r.toString(),o.toString()},Zr="internal",Xr="external";function jn({blocklet:e,onStart:t,onComplete:n,variant:r="menu",hasPermission:o=!1,getComponentUrl:s=null,useBlockletUrlEvaluation:a=()=>({loading:!1,recommendedUrl:window?.location?.href}),...c}){const l=ze(),[u,d]=m.useState(null),[p,f]=m.useState(null),[b,y]=m.useState(!1),[h,C]=m.useState(null),{t:v}=m.useContext(tn),[j]=Pt("skip-blocklet-setup",!1),{loading:g,recommendedUrl:E}=a(e),[k]=Pt("blocklet-type-filter",Zr),x=P.isInProgress(e.status),[T,O]=m.useState(!1);m.useEffect(()=>{if(!e?.controller)return;O(e?.controller?.status?.value===qe.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const D=await l.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(D?.error){console.error("get launcher session failed",D.error);return}O([R.LAUNCH_SESSION_STATUS.overdue,R.LAUNCH_SESSION_STATUS.canceled,R.LAUNCH_SESSION_STATUS.terminated].includes(D?.launcherSession?.status))}catch(D){console.error("call getLauncherSession error",D)}})()},[]);const{inService:M}=l,N=(w,D,K=!1)=>async()=>{const G=async Se=>{t({action:w,blocklet:e}),y(!0),f(w);let je=!1;try{if(w==="remove")await D(Se);else if(w==="start"){if(!P.hasRunnableComponent(e)){F.error(v("blocklet.noComponent"));return}if(!M&&!j&&!e.settings?.initialized&&e.mode!==qe.BLOCKLET_MODES.DEVELOPMENT){if(!E||!Lt(E)){F.error(v("blocklet.gotoVisitError"));return}const U=tr(l.info),kt=new URL(E);kt.searchParams.set("serverUrl",U),window.open(Mt(kt.href,{allowDomains:null})),n({action:w,blocklet:e});return}const $=e.children.filter(U=>!P.isInProgress(U.status)&&U.status!=="running"||!P.isInProgress(U.greenStatus)&&U.greenStatus!=="running").map(U=>U.meta.did),J={did:e.meta.did,componentDids:$};await D({input:J})}else if(["stop","restart","reload"].includes(w)){const $=e.children.filter(U=>P.isDeletableBlocklet(U)).map(U=>U.meta.did),J={did:e.meta.did,componentDids:$};await D({input:J})}else{const $={did:e.meta.did};await D({input:$})}w==="remove"?je=!0:await nr(1e3),w==="reload"&&F.success(v("blocklet.reloadSuccess")),C(null),n({action:w,blocklet:e})}catch($){const J=`Blocklet ${w} failed: ${bt($)}`;throw n({action:w,blocklet:e,error:new Error(J)}),new Error(J)}finally{je||y(!1)}},ve=()=>{y(!1),C(null)},we=P.getDisplayName(e,!0),yo=e.mode===qe.BLOCKLET_MODES.DEVELOPMENT?{description:()=>i.jsx(ee,{component:"div",children:i.jsx(ee,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Se,je)=>i.jsxs(ee,{component:"div",children:[i.jsx(ee,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")}),i.jsxs(Vo,{name:"removeType",value:Se.removeType,onChange:$=>je({...Se,removeType:$.target.value}),children:[i.jsx(It,{value:"backup",control:i.jsx(_t,{}),label:v("blocklet.action.removeApplicationAfterBackup")}),i.jsx(It,{value:"complete",control:i.jsx(_t,{}),label:v("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},vo={stop:{title:`${v("common.stop")} ${we}`,description:v("blocklet.action.stopDescription"),confirm:v("blocklet.action.confirmStop"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve},restart:{title:`${v("common.restart")} ${we}`,description:v("blocklet.action.restartDescription"),confirm:v("blocklet.action.confirmRestart"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve},remove:{title:`${v("common.remove")} ${we}`,confirm:v("blocklet.action.confirmRemove"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve,...yo},cancelDownload:{title:`${v("common.cancel")}`,description:v("blocklet.action.cancelDownloadDescription",{name:we}),confirm:v("common.confirm"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve}};K?C(vo[w]):await G()},We=!!u,po=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}d(w.currentTarget)},mo=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}d(null)},Ct=async(w,D)=>{try{D.stopPropagation(),D.preventDefault()}catch{}if(typeof w.handler=="function")try{y(!0),f(w.action),await w.handler()}catch(K){console.error(`Blocklet ${w.name} failed: `,K)}finally{y(!1),d(null)}else d(null)},ho=!M&&P.isDeletableBlocklet(e)?{action:"remove",icon:Y.Remove,name:v("common.remove"),handler:N("remove",async({removeType:w})=>{w==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:x}:null,go={action:"remove",icon:({sx:w,...D})=>i.jsx(Y.Cancel,{sx:{...w,paddingRight:"2px",zoom:.95},...D}),name:v("common.cancel"),handler:N("cancelDownload",l.api.cancelDownloadBlocklet,!0)},bo=P.getAppMissingConfigs(e),xo=()=>{const w=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),D=s?.({mountPoint:w,blocklet:e});if(!D||!Lt(D)){F.error(v("blocklet.gotoVisitError"));return}const K=e?.site?.domainAliases;window.open(Mt(Qr(D,`${R.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:K?.map(G=>G.value)}))};let ye=[{action:"start",icon:Y.Start,inExternal:!0,name:v("common.start"),handler:N("start",l.api.startBlocklet),disabled:T||e.children.every(w=>P.isBlockletRunning(w))||Ke(e.status)||g||x},{action:"stop",icon:Y.Stop,inExternal:!0,name:v("common.stop"),handler:N("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:Y.Restart,name:v("common.restart"),handler:N("restart",l.api.restartBlocklet,!0),disabled:T||e.status!=="running"},Ke(e.status)?go:ho,{separator:!0},M?null:{action:"dashboard",icon:({style:w,...D})=>i.jsx(Y.Dashboard,{...D,style:{...w,width:"26px",height:"26px",paddingRight:"3px"}}),name:v("sidebar.dashboard"),handler:xo}].filter(Boolean);return k===Xr&&(ye=ye.filter(w=>w.inExternal)),r==="menu"?i.jsxs(Nt,{"data-cy":"blocklet-actions",children:[i.jsx(Ne,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:po,size:"small",disabled:!o||!Ke(e.status)&&b,children:i.jsx(Oo,{})}),i.jsxs(No,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:We,onClose:mo,PaperProps:{},children:[bo.length>0&&i.jsxs(gt,{style:{maxWidth:"400px"},severity:"error",children:[v("blocklet.config.missingRequired"),i.jsx("br",{}),i.jsx(dn,{to:`/blocklets/${e.meta.did}/components`,children:v("blocklet.config.gotoFix")})]}),ye.map((w,D)=>w.separator?i.jsx(Uo,{},`separator-${D}`):i.jsxs(Bo,{dense:!0,onClick:K=>Ct(w,K),disabled:b||w.disabled,"data-cy":`${w.action}-blocklet`,children:[i.jsx(zo,{style:{minWidth:24},children:p===w.action&&b?i.jsx(V,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{fontSize:"small"})}),i.jsx($o,{primary:w.name})]},w.name))]}),h&&i.jsx(Rt,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]}):i.jsxs(Nt,{"data-cy":"blocklet-actions",...c,children:[i.jsx(Fo,{children:ye.filter(w=>!w.separator&&!w.onlyInMenu).map(w=>i.jsxs(ht,{title:w.name,"data-cy":`${w.action}-blocklet`,onClick:()=>Ct(w),disabled:!!w.disabled||b,children:[p===w.action&&b?i.jsx(V,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{}),i.jsx("span",{className:"blocklet-action-text",children:w.name})]},w.name))}),h&&i.jsx(Rt,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}jn.propTypes={getComponentUrl:S.func,blocklet:S.object.isRequired,onStart:S.func.isRequired,onComplete:S.func.isRequired,variant:S.oneOf(["menu","group"]),hasPermission:S.bool,useBlockletUrlEvaluation:S.func};const Nt=Ue.div`
2
+ import{s as tn,p as ht,H as F,V as B,aK as nn,aL as wo,a1 as So,M as on,a2 as rn,E as Et,G as jo,A as Co,z as ko,_ as L}from"./vendor-ux-CE4sOH7O.js";import{j as i,W as S,aZ as Eo,cN as Io,d4 as _o,bb as Lo,dg as To,dh as Do,cP as Ao,di as Po,d8 as Ro,dj as Mo,I as Ne,aQ as Oo,aR as No,aX as gt,a3 as Uo,M as Bo,aO as zo,a6 as V,aP as $o,bi as Fo,at as Ue,T as ee,bq as Vo,b6 as It,br as _t,ak as E,D as pe,J as re,ah as Be,ao as Ho,dk as Wo,aj as qo,dl as sn,dm as an,dn as cn,am as de,a$ as _e,dp as Lt,U as Q,aN as ln,Y as un,b_ as Ko,dq as Go,dr as Qo,Q as Zo,ds as Xo}from"./vendor-mui-core-BFPsXaTR.js";import{r as h,L as dn,i as fn,g as Jo,k as Yo,j as er}from"./vendor-react-Dvs43sk9.js";import{Z as ze,e as P,X as qe,am as Ke,c as R,Y as Tt,bD as tr,a1 as nr,ab as or,v as rr,bE as sr,bF as pn,a0 as te,bG as mn,aM as ir,bH as ar,W as cr,b3 as lr,b4 as ur,bI as dr,b5 as fr,bJ as pr,bK as mr,al as hr,bL as Ge,bM as gr,bN as br,b2 as xr,a as hn,B as gn,l as me,a9 as yr,k as vr,ad as wr,m as Dt,bO as At,h as Sr,j as jr,q as Cr,o as ie,n as kr,p as Er,P as Ir,G as _r,N as Lr,bC as Tr,$ as Dr,t as Ar}from"./index-CmM1Fb8I.js";import{a9 as Pr,C as W,J as bn,Q as Rr,e as Mr}from"./vendor-utils-OrZFrHBP.js";import{o as Ae}from"./vendor-arcblock-DGOH9a3F.js";import{u as Pt}from"./useLocalStorage-Be_1V0gr.js";import{f as bt}from"./index-DBs9Ljax.js";import{C as Rt}from"./confirm-DAMhAYR3.js";import{g as Mt}from"./get-safe-url-94yHUMyk.js";import{u as xn}from"./session-BtQQCb_u.js";import{a as ne,l as Or}from"./vendor-hooks-DmThWyyG.js";import{j as Nr,b as Ur,M as Br,a as zr,T as $r,N as Fr}from"./team-DK_N0J3a.js";import{c as Ot}from"./passport-B2fL-0uN.js";import{D as Vr,u as yn}from"./useAsyncRetry-Dyo5t1bq.js";import{u as vn}from"./useSetState-DFuQZPPV.js";import{x as Hr,d as Wr}from"./index-CtjgKQvS.js";import{O as qr}from"./over-due-invoice-payment-Dairtuas.js";import{u as Kr}from"./use-mobile-Db5FIl07.js";const wn=h.createContext({});function Sn({children:e,type:t="blocklets"}){const[n,r]=h.useState([]),o=h.useRef([]),s=l=>{if(!o.current.includes(l)){const u=[...o.current,l];r(u),o.current=u}},a=l=>{if(o.current.includes(l)){const u=o.current.filter(d=>d!==l);r(u),o.current=u}},c=l=>{const u=n.filter(p=>l.find(f=>f===p));Pr(u,n).forEach(p=>a(p))};return i.jsx(wn.Provider,{value:{type:t,deletingBlocklets:n,addDeletingDid:s,removeDeletingDid:a,matchDeletingDid:c},children:e})}Sn.propTypes={type:S.string,children:S.node.isRequired};function ec(){return h.useContext(wn)}const Gr=e=>h.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},h.createElement("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"})),Y={Start:Eo,Stop:Io,Restart:_o,Reload:Mo,Remove:Lo,Config:Ro,Log:Po,Group:Ao,Cancel:To,Dashboard:Gr,Overview:Do},Qr=(e,t)=>{if(!e)return"";if(!t)return e;const n=new URL(e),r=new URLSearchParams(n.searchParams),o=new URL(W(n.origin,t));return o.search=r.toString(),o.toString()},Zr="internal",Xr="external";function jn({blocklet:e,onStart:t,onComplete:n,variant:r="menu",hasPermission:o=!1,getComponentUrl:s=null,useBlockletUrlEvaluation:a=()=>({loading:!1,recommendedUrl:window?.location?.href}),...c}){const l=ze(),[u,d]=h.useState(null),[p,f]=h.useState(null),[x,y]=h.useState(!1),[b,j]=h.useState(null),{t:v}=h.useContext(tn),[C]=Pt("skip-blocklet-setup",!1),{loading:g,recommendedUrl:k}=a(e),[_]=Pt("blocklet-type-filter",Zr),m=P.isInProgress(e.status),[I,O]=h.useState(!1);h.useEffect(()=>{if(!e?.controller)return;O(e?.controller?.status?.value===qe.BLOCKLET_CONTROLLER_STATUS.suspended),(async()=>{try{const D=await l.api.getLauncherSession({input:{launcherSessionId:e?.controller?.launcherSessionId,launcherUrl:e?.controller?.launcherUrl}});if(D?.error){console.error("get launcher session failed",D.error);return}O([R.LAUNCH_SESSION_STATUS.overdue,R.LAUNCH_SESSION_STATUS.canceled,R.LAUNCH_SESSION_STATUS.terminated].includes(D?.launcherSession?.status))}catch(D){console.error("call getLauncherSession error",D)}})()},[]);const{inService:M}=l,N=(w,D,K=!1)=>async()=>{const G=async Se=>{t({action:w,blocklet:e}),y(!0),f(w);let je=!1;try{if(w==="remove")await D(Se);else if(w==="start"){if(!P.hasRunnableComponent(e)){F.error(v("blocklet.noComponent"));return}if(!M&&!C&&!e.settings?.initialized&&e.mode!==qe.BLOCKLET_MODES.DEVELOPMENT){if(!k||!Tt(k)){F.error(v("blocklet.gotoVisitError"));return}const U=tr(l.info),kt=new URL(k);kt.searchParams.set("serverUrl",U),window.open(Mt(kt.href,{allowDomains:null})),n({action:w,blocklet:e});return}const $=e.children.filter(U=>!P.isInProgress(U.status)&&U.status!=="running"||!P.isInProgress(U.greenStatus)&&U.greenStatus!=="running").map(U=>U.meta.did),J={did:e.meta.did,componentDids:$};await D({input:J})}else if(["stop","restart","reload"].includes(w)){const $=e.children.filter(U=>P.isDeletableBlocklet(U)).map(U=>U.meta.did),J={did:e.meta.did,componentDids:$};await D({input:J})}else{const $={did:e.meta.did};await D({input:$})}w==="remove"?je=!0:await nr(1e3),w==="reload"&&F.success(v("blocklet.reloadSuccess")),j(null),n({action:w,blocklet:e})}catch($){const J=`Blocklet ${w} failed: ${bt($)}`;throw n({action:w,blocklet:e,error:new Error(J)}),new Error(J)}finally{je||y(!1)}},ve=()=>{y(!1),j(null)},we=P.getDisplayName(e,!0),yo=e.mode===qe.BLOCKLET_MODES.DEVELOPMENT?{description:()=>i.jsx(ee,{component:"div",children:i.jsx(ee,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")})}),params:{removeType:"complete"}}:{description:(Se,je)=>i.jsxs(ee,{component:"div",children:[i.jsx(ee,{gutterBottom:!0,children:v("blocklet.action.removeApplicationDescription")}),i.jsxs(Vo,{name:"removeType",value:Se.removeType,onChange:$=>je({...Se,removeType:$.target.value}),children:[i.jsx(It,{value:"backup",control:i.jsx(_t,{}),label:v("blocklet.action.removeApplicationAfterBackup")}),i.jsx(It,{value:"complete",control:i.jsx(_t,{}),label:v("blocklet.action.removeApplicationComplete")})]})]}),params:{removeType:"backup"}},vo={stop:{title:`${v("common.stop")} ${we}`,description:v("blocklet.action.stopDescription"),confirm:v("blocklet.action.confirmStop"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve},restart:{title:`${v("common.restart")} ${we}`,description:v("blocklet.action.restartDescription"),confirm:v("blocklet.action.confirmRestart"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve},remove:{title:`${v("common.remove")} ${we}`,confirm:v("blocklet.action.confirmRemove"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve,...yo},cancelDownload:{title:`${v("common.cancel")}`,description:v("blocklet.action.cancelDownloadDescription",{name:we}),confirm:v("common.confirm"),cancel:v("common.cancel"),onConfirm:G,onCancel:ve}};K?j(vo[w]):await G()},We=!!u,po=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}d(w.currentTarget)},mo=w=>{try{w.stopPropagation(),w.preventDefault()}catch{}d(null)},Ct=async(w,D)=>{try{D.stopPropagation(),D.preventDefault()}catch{}if(typeof w.handler=="function")try{y(!0),f(w.action),await w.handler()}catch(K){console.error(`Blocklet ${w.name} failed: `,K)}finally{y(!1),d(null)}else d(null)},ho=!M&&P.isDeletableBlocklet(e)?{action:"remove",icon:Y.Remove,name:v("common.remove"),handler:N("remove",async({removeType:w})=>{w==="backup"&&await l.api.backupBlocklet({input:{appDid:e.appDid,to:"disk"}}),await l.api.deleteBlocklet({input:{did:e.meta.did,keepData:!1}})},!0),disabled:m}:null,go={action:"remove",icon:({sx:w,...D})=>i.jsx(Y.Cancel,{sx:{...w,paddingRight:"2px",zoom:.95},...D}),name:v("common.cancel"),handler:N("cancelDownload",l.api.cancelDownloadBlocklet,!0)},bo=P.getAppMissingConfigs(e),xo=()=>{const w=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),D=s?.({mountPoint:w,blocklet:e});if(!D||!Tt(D)){F.error(v("blocklet.gotoVisitError"));return}const K=e?.site?.domainAliases;window.open(Mt(Qr(D,`${R.WELLKNOWN_SERVICE_PATH_PREFIX}/admin`),{allowDomains:K?.map(G=>G.value)}))};let ye=[{action:"start",icon:Y.Start,inExternal:!0,name:v("common.start"),handler:N("start",l.api.startBlocklet),disabled:I||e.children.every(w=>P.isBlockletRunning(w))||Ke(e.status)||g||m},{action:"stop",icon:Y.Stop,inExternal:!0,name:v("common.stop"),handler:N("stop",l.api.stopBlocklet,!0),disabled:!["running","starting"].includes(e.status)},{action:"restart",inExternal:!0,icon:Y.Restart,name:v("common.restart"),handler:N("restart",l.api.restartBlocklet,!0),disabled:I||e.status!=="running"},Ke(e.status)?go:ho,{separator:!0},M?null:{action:"dashboard",icon:({style:w,...D})=>i.jsx(Y.Dashboard,{...D,style:{...w,width:"26px",height:"26px",paddingRight:"3px"}}),name:v("sidebar.dashboard"),handler:xo}].filter(Boolean);return _===Xr&&(ye=ye.filter(w=>w.inExternal)),r==="menu"?i.jsxs(Nt,{"data-cy":"blocklet-actions",children:[i.jsx(Ne,{"aria-label":"more","aria-controls":"actions-menu","aria-haspopup":"true","data-cy":"trigger-blocklet-actions","actions-blocklet-did":e.meta.did,onClick:po,size:"small",disabled:!o||!Ke(e.status)&&x,children:i.jsx(Oo,{})}),i.jsxs(No,{id:"actions-menu",anchorEl:u,keepMounted:!0,open:We,onClose:mo,PaperProps:{},children:[bo.length>0&&i.jsxs(gt,{style:{maxWidth:"400px"},severity:"error",children:[v("blocklet.config.missingRequired"),i.jsx("br",{}),i.jsx(dn,{to:`/blocklets/${e.meta.did}/components`,children:v("blocklet.config.gotoFix")})]}),ye.map((w,D)=>w.separator?i.jsx(Uo,{},`separator-${D}`):i.jsxs(Bo,{dense:!0,onClick:K=>Ct(w,K),disabled:x||w.disabled,"data-cy":`${w.action}-blocklet`,children:[i.jsx(zo,{style:{minWidth:24},children:p===w.action&&x?i.jsx(V,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{fontSize:"small"})}),i.jsx($o,{primary:w.name})]},w.name))]}),b&&i.jsx(Rt,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]}):i.jsxs(Nt,{"data-cy":"blocklet-actions",...c,children:[i.jsx(Fo,{children:ye.filter(w=>!w.separator&&!w.onlyInMenu).map(w=>i.jsxs(ht,{title:w.name,"data-cy":`${w.action}-blocklet`,onClick:()=>Ct(w),disabled:!!w.disabled||x,children:[p===w.action&&x?i.jsx(V,{size:16,sx:{marginRight:1}}):i.jsx(w.icon,{}),i.jsx("span",{className:"blocklet-action-text",children:w.name})]},w.name))}),b&&i.jsx(Rt,{title:b.title,description:b.description,confirm:b.confirm,cancel:b.cancel,params:b.params,onConfirm:b.onConfirm,onCancel:b.onCancel})]})}jn.propTypes={getComponentUrl:S.func,blocklet:S.object.isRequired,onStart:S.func.isRequired,onComplete:S.func.isRequired,variant:S.oneOf(["menu","group"]),hasPermission:S.bool,useBlockletUrlEvaluation:S.func};const Nt=Ue.div`
3
3
  display: flex;
4
4
  align-items: center;
5
5
 
@@ -9,7 +9,7 @@ import{c as tn,n as ht,H as F,T as B,aG as nn,aH as wo,a3 as So,M as on,P as rn,
9
9
  font-size: 10px;
10
10
  }
11
11
  }
12
- `,Ut=m.memo(jn),Jr=e=>{const t={};let n=null;return P.forEachBlockletSync(e,r=>{t[r.meta.bundleDid]?n=P.getDisplayName(r,!0):r.meta.bundleDid&&(t[r.meta.bundleDid]=!0)}),n},Yr=(e,t,n)=>{const{hostname:r,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!a)return o;const c=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(R.DEFAULT_DID_DOMAIN))||"").replace(`.${R.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(r,`${u}-${c}.${R.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function es(){const{t:e}=B(),{api:t}=xn(),{blocklet:n}=or(),{inService:r}=ze(),[o,s]=m.useState(!1),[a,c]=m.useState(5),l=n&&n.structVersion!==R.APP_STRUCT_VERSION,u=()=>{try{if(P.isBlockletRunning(n)){F.error(e("blocklet.migrate.tip.running"));return}const f=Jr(n);if(f){F.error(e("blocklet.migrate.tip.duplicate",{name:f}));return}s(!0)}catch(f){F.error(bt(f))}},d=()=>{const f=Yr(window.location,n,r);setTimeout(()=>{window.location.href=f},5e3),c(5),setInterval(()=>{c(b=>b-1)},1e3)},p=()=>s(!1);return[l&&i.jsxs(gt,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(ht,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(f=>i.jsx(I,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${f}`)},f))]},"alert"),n&&i.jsx(rr,{popup:!0,open:o,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:sr(n,!0),title:P.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:p},"connect")]}function ts(){const e=pe();return[...e.breakpoints.keys].reverse().reduce((n,r)=>{const o=re(e.breakpoints.up(r));return!n&&o?r:n},null)||"xs"}function ns(e){return i.jsx(Be,{...e,children:i.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 os(e){return i.jsx(Be,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function rs(e){return i.jsx(Be,{...e,children:i.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 ss(e){return i.jsx(Be,{...e,children:i.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 Ce={fontSize:20,marginInlineEnd:8},is={success:i.jsx(ns,{style:Ce}),warning:i.jsx(os,{style:Ce}),error:i.jsx(rs,{style:Ce}),info:i.jsx(ss,{style:Ce})},as={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Cn({keyId:e,notification:t={},viewAllUrl:n,content:r=null},o){const s=pe(),a=is[t.severity],{closeSnackbar:c}=nn(),l=()=>c(e),u=fn(),d=()=>{c(e),u(n)},p=ne(()=>Nr(t),[t]),f=ne(()=>t?.activity,[t]),b=Ur({activity:f,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:s.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),y=ts();return i.jsxs(I,{component:wo,ref:o,sx:[{...s.typography.body2,display:"flex",backgroundColor:s.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,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)",width:as[y]},t.severity==="success"?{backgroundColor:`${Ho[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${s.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${s.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${Wo[700]} !important`}:{}],children:[i.jsxs(I,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(ls,{onClick:d,sx:{flex:1},children:i.jsx(I,{children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:b}),f.meta?i.jsx(Br,{meta:f.meta,type:f.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),r||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(I,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(Ne,{"aria-label":"close",color:"inherit",onClick:l,size:"large",children:i.jsx(I,{component:qo,sx:{fontSize:20}})},"close")})]})}const cs=m.forwardRef(Cn);Cn.propTypes={viewAllUrl:S.string.isRequired,keyId:S.number.isRequired,notification:S.object.isRequired,content:S.node};const ls=Ue.div`
12
+ `,Ut=h.memo(jn),Jr=e=>{const t={};let n=null;return P.forEachBlockletSync(e,r=>{t[r.meta.bundleDid]?n=P.getDisplayName(r,!0):r.meta.bundleDid&&(t[r.meta.bundleDid]=!0)}),n},Yr=(e,t,n)=>{const{hostname:r,href:o}=e;if(!t)return o;if(n){const a=/\d+[-.]\d+[-.]\d+[-.]\d+/.exec(r);if(!a)return o;const c=a[0],u=((t.site?.domainAliases||[]).map(d=>d.value).filter(Boolean).find(d=>d.endsWith(R.DEFAULT_DID_DOMAIN))||"").replace(`.${R.DEFAULT_DID_DOMAIN}`,"");return u?o.replace(r,`${u}-${c}.${R.DEFAULT_IP_DOMAIN_SUFFIX}`):o}return o.replace(t.meta.bundleDid,t.appPid)};function es(){const{t:e}=B(),{api:t}=xn(),{blocklet:n}=or(),{inService:r}=ze(),[o,s]=h.useState(!1),[a,c]=h.useState(5),l=n&&n.structVersion!==R.APP_STRUCT_VERSION,u=()=>{try{if(P.isBlockletRunning(n)){F.error(e("blocklet.migrate.tip.running"));return}const f=Jr(n);if(f){F.error(e("blocklet.migrate.tip.duplicate",{name:f}));return}s(!0)}catch(f){F.error(bt(f))}},d=()=>{const f=Yr(window.location,n,r);setTimeout(()=>{window.location.href=f},5e3),c(5),setInterval(()=>{c(x=>x-1)},1e3)},p=()=>s(!1);return[l&&i.jsxs(gt,{severity:"warning",style:{margin:"12px 0"},children:[i.jsxs(E,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(ht,{variant:"contained",size:"small",color:"primary",onClick:()=>u(),style:{marginRight:8},children:e("blocklet.migrate.intro.l1")}),i.jsx("span",{children:e("blocklet.migrate.intro.l2")})]}),["l3","l4","l5","l6"].map(f=>i.jsx(E,{sx:{display:"flex",alignItems:"center"},children:e(`blocklet.migrate.intro.${f}`)},f))]},"alert"),n&&i.jsx(rr,{popup:!0,open:o,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:sr(n,!0),title:P.getDisplayName(n)},messages:{title:e("blocklet.migrate.title"),scan:e("blocklet.migrate.scan"),confirm:e("blocklet.migrate.confirm"),success:a>=0?e("blocklet.migrate.success",{sec:a}):"Redirecting..."},onClose:p},"connect")]}function ts(){const e=pe();return[...e.breakpoints.keys].reverse().reduce((n,r)=>{const o=re(e.breakpoints.up(r));return!n&&o?r:n},null)||"xs"}function ns(e){return i.jsx(Be,{...e,children:i.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 os(e){return i.jsx(Be,{...e,children:i.jsx("path",{d:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"})})}function rs(e){return i.jsx(Be,{...e,children:i.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 ss(e){return i.jsx(Be,{...e,children:i.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 Ce={fontSize:20,marginInlineEnd:8},is={success:i.jsx(ns,{style:Ce}),warning:i.jsx(os,{style:Ce}),error:i.jsx(rs,{style:Ce}),info:i.jsx(ss,{style:Ce})},as={xl:"400px",lg:"400px",md:"400px",sm:"300px"};function Cn({keyId:e,notification:t={},viewAllUrl:n,content:r=null},o){const s=pe(),a=is[t.severity],{closeSnackbar:c}=nn(),l=()=>c(e),u=fn(),d=()=>{c(e),u(n)},p=ne(()=>Nr(t),[t]),f=ne(()=>t?.activity,[t]),x=Ur({activity:f,users:[t?.actorInfo],actors:[t?.activity?.actor],extra:{linkColor:s.palette.primary.main,userDid:t?.receivers?.[0]?.did}}),y=ts();return i.jsxs(E,{component:wo,ref:o,sx:[{...s.typography.body2,display:"flex",backgroundColor:s.palette.background.default,color:"#fff",alignItems:"center",pl:2.5,pr:2,py:.75,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)",width:as[y]},t.severity==="success"?{backgroundColor:`${Ho[600]} !important`}:{},t.severity==="error"?{backgroundColor:`${s.palette.error.dark} !important`}:{},t.severity==="info"?{backgroundColor:`${s.palette.primary.main} !important`}:{},t.severity==="warning"?{backgroundColor:`${Wo[700]} !important`}:{}],children:[i.jsxs(E,{sx:{display:"flex",alignItems:"center",py:1,flex:1},children:[a,i.jsx(ls,{onClick:d,sx:{flex:1},children:i.jsx(E,{children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:x}),f.meta?i.jsx(Br,{meta:f.meta,type:f.type,sx:{display:"-webkit-box",overflow:"hidden",textOverflow:"ellipsis",WebkitLineClamp:3,WebkitBoxOrient:"vertical",color:"#fff"}}):null]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"title",children:t.title}),r||i.jsx("span",{className:"desc",children:t.description})]})})})]}),i.jsx(E,{sx:{display:"flex",alignItems:"center",ml:"auto",mr:-1,width:44},children:i.jsx(Ne,{"aria-label":"close",color:"inherit",onClick:l,size:"large",children:i.jsx(E,{component:qo,sx:{fontSize:20}})},"close")})]})}const cs=h.forwardRef(Cn);Cn.propTypes={viewAllUrl:S.string.isRequired,keyId:S.number.isRequired,notification:S.object.isRequired,content:S.node};const ls=Ue.div`
13
13
  cursor: pointer;
14
14
  display: flex;
15
15
  flex-direction: column;
@@ -29,7 +29,7 @@ import{c as tn,n as ht,H as F,T as B,aG as nn,aH as wo,a3 as So,M as on,P as rn,
29
29
  -webkit-box-orient: vertical;
30
30
  word-break: break-word;
31
31
  }
32
- `;var L=function(t,n,r){return sn.call(n,"css")?i.jsx(an,cn(t,n),r):i.jsx(t,n,r)},ke=function(t,n,r){return sn.call(n,"css")?i.jsxs(an,cn(t,n),r):i.jsxs(t,n,r)};/**
32
+ `;var T=function(t,n,r){return sn.call(n,"css")?i.jsx(an,cn(t,n),r):i.jsx(t,n,r)},ke=function(t,n,r){return sn.call(n,"css")?i.jsxs(an,cn(t,n),r):i.jsxs(t,n,r)};/**
33
33
  * (c) Iconify
34
34
  *
35
35
  * For the full copyright and license information, please view the license.txt or license.gpl.txt
@@ -39,7 +39,7 @@ import{c as tn,n as ht,H as F,T as B,aG as nn,aH as wo,a3 as So,M as on,P as rn,
39
39
  *
40
40
  * @license MIT
41
41
  * @version 3.1.1
42
- */const kn=Object.freeze({left:0,top:0,width:16,height:16}),Pe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),he=Object.freeze({...kn,...Pe}),rt=Object.freeze({...he,body:"",hidden:!1});function us(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 Bt(e,t){const n=us(e,t);for(const r in rt)r in Pe?r in e&&!(r in n)&&(n[r]=Pe[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ds(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(n[a])return o[a]=[];if(!(a in o)){o[a]=null;const c=r[a]&&r[a].parent,l=c&&s(c);l&&(o[a]=[c].concat(l))}return o[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),o}function fs(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function a(c){s=Bt(r[c]||o[c],s)}return a(t),n.forEach(a),Bt(e,s)}function ps(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=ds(e);for(const o in r){const s=r[o];s&&(t(o,fs(e,o,s)),n.push(o))}return n}const ce=/^[a-z0-9]+(-[a-z0-9]+)*$/,se=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const c=o.pop(),l=o.pop(),u={provider:o.length>0?o[0]:r,prefix:l,name:c};return t&&!Te(u)?null:u}const s=o[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Te(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Te(c,n)?null:c}return null},Te=(e,t)=>e?!!((e.provider===""||e.provider.match(ce))&&(t&&e.prefix===""||e.prefix.match(ce))&&e.name.match(ce)):!1,ms={provider:"",aliases:{},not_found:{},...kn};function Qe(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function hs(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Qe(e,ms))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(ce)||typeof s.body!="string"||!Qe(s,rt))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],a=s.parent;if(!o.match(ce)||typeof a!="string"||!n[a]&&!r[a]||!Qe(s,rt))return null}return t}const Re=Object.create(null);function gs(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function z(e,t){const n=Re[e]||(Re[e]=Object.create(null));return n[t]||(n[t]=gs(e,t))}function xt(e,t){return hs(t)?ps(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function bs(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function xs(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Re)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Re[o]||{})).forEach(a=>{const c=z(o,a);n=n.concat(Object.keys(c.icons).map(l=>(o!==""?"@"+o+":":"")+a+":"+l))})}),n}let yt=!1;function ys(e){return yt}function ge(e){const t=typeof e=="string"?se(e,!0,yt):e;if(t){const n=z(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function vs(e,t){const n=se(e,!0,yt);if(!n)return!1;const r=z(n.provider,n.prefix);return bs(r,n.name,t)}function En(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!Te({provider:t,prefix:n,name:"a"}))return!1;const r=z(t,n);return!!xt(r,e)}function ws(e){return!!ge(e)}function Ss(e){const t=ge(e);return t?{...he,...t}:null}const In=Object.freeze({width:null,height:null}),_n=Object.freeze({...In,...Pe}),js=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Cs=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function st(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(js);if(r===null||!r.length)return e;const o=[];let s=r.shift(),a=Cs.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?o.push(s):o.push(Math.ceil(c*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");a=!a}}const ks=e=>e==="unset"||e==="undefined"||e==="none";function $e(e,t){const n={...he,...e},r={..._n,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(y=>{const h=[],C=y.hFlip,v=y.vFlip;let j=y.rotate;C?v?j+=2:(h.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),h.push("scale(-1 1)"),o.top=o.left=0):v&&(h.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),h.push("scale(1 -1)"),o.top=o.left=0);let g;switch(j<0&&(j-=Math.floor(j/4)*4),j=j%4,j){case 1:g=o.height/2+o.top,h.unshift("rotate(90 "+g.toString()+" "+g.toString()+")");break;case 2:h.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:g=o.width/2+o.left,h.unshift("rotate(-90 "+g.toString()+" "+g.toString()+")");break}j%2===1&&(o.left!==o.top&&(g=o.left,o.left=o.top,o.top=g),o.width!==o.height&&(g=o.width,o.width=o.height,o.height=g)),h.length&&(s='<g transform="'+h.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,l=o.width,u=o.height;let d,p;a===null?(p=c===null?"1em":c==="auto"?u:c,d=st(p,l/u)):(d=a==="auto"?l:a,p=c===null?st(d,u/l):c==="auto"?u:c);const f={},b=(y,h)=>{ks(h)||(f[y]=h.toString())};return b("width",d),b("height",p),f.viewBox=o.left.toString()+" "+o.top.toString()+" "+l.toString()+" "+u.toString(),{attributes:f,body:s}}const Es=/\sid="(\S+)"/g,Is="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let _s=0;function Tn(e,t=Is){const n=[];let r;for(;r=Es.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(_s++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const Z={local:!0,session:!0},Ln={local:new Set,session:new Set};let vt=!1;function Ts(e){vt=e}const zt="iconify2",fe="iconify",Dn=fe+"-count",$t=fe+"-version",An=36e5,Ls=168;function it(e,t){try{return e.getItem(t)}catch{}}function wt(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ft(e,t){try{e.removeItem(t)}catch{}}function at(e,t){return wt(e,Dn,t.toString())}function ct(e){return parseInt(it(e,Dn))||0}let Ee=typeof window>"u"?{}:window;function Pn(e){const t=e+"Storage";try{if(Ee&&Ee[t]&&typeof Ee[t].length=="number")return Ee[t]}catch{}Z[e]=!1}function Rn(e,t){const n=Pn(e);if(!n)return;const r=it(n,$t);if(r!==zt){if(r){const c=ct(n);for(let l=0;l<c;l++)Ft(n,fe+l.toString())}wt(n,$t,zt),at(n,0);return}const o=Math.floor(Date.now()/An)-Ls,s=c=>{const l=fe+c.toString(),u=it(n,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,c))return!0}catch{}Ft(n,l)}};let a=ct(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,at(n,a)):Ln[e].add(c))}function Mn(){if(!vt){Ts(!0);for(const e in Z)Rn(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=z(r,o);if(!xt(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function On(e,t){switch(e){case"local":case"session":Z[e]=t;break;case"all":for(const n in Z)Z[n]=t;break}}const lt=Object.create(null);function Nn(e,t){lt[e]=t}function ut(e){return lt[e]||lt[""]}function St(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 Fe=Object.create(null),ae=["https://api.simplesvg.com","https://api.unisvg.com"],Le=[];for(;ae.length>0;)ae.length===1||Math.random()>.5?Le.push(ae.shift()):Le.push(ae.pop());Fe[""]=St({resources:["https://api.iconify.design"].concat(Le)});function Un(e,t){const n=St(t);return n===null?!1:(Fe[e]=n,!0)}function Ve(e){return Fe[e]}function Ds(){return Object.keys(Fe)}const As=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Me=As();function Ps(e){Me=e}function Rs(){return Me}function Ms(e,t){const n=Ve(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(a=>{o=Math.max(o,a.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Os(e){return e===404}const Ns=(e,t,n)=>{const r=[],o=Ms(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((l,u)=>{c+=l.length+1,c>=o&&u>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=l.length),a.icons.push(l)}),r.push(a),r};function Us(e){if(typeof e=="string"){const t=Ve(e);if(t)return t.path}return"/"}const Bs=(e,t,n)=>{if(!Me){n("abort",424);return}let r=Us(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});r+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;Me(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Os(a)?"abort":"next",a)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},zs={prepare:Ns,send:Bs};function $s(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,a=o.prefix,c=o.name,l=n[s]||(n[s]=Object.create(null)),u=l[a]||(l[a]=z(s,a));let d;c in u.icons?d=t.loaded:a===""||u.missing.has(c)?d=t.missing:d=t.pending;const p={provider:s,prefix:a,name:c};d.push(p)}),t}function Bn(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Fs(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,o=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==o)return!0;const u=l.name;if(e.icons[u])a.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))a.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Bn([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Vs=0;function Hs(e,t,n){const r=Vs++,o=Bn.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),o}function Ws(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?se(o,t,n):o;s&&r.push(s)}),r}var qs={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ks(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let a;if(e.random){let x=e.resources.slice(0);for(a=[];x.length>1;){const T=Math.floor(Math.random()*x.length);a.push(x[T]),x=x.slice(0,T).concat(x.slice(T+1))}a=a.concat(x)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",u=0,d,p=null,f=[],b=[];typeof r=="function"&&b.push(r);function y(){p&&(clearTimeout(p),p=null)}function h(){l==="pending"&&(l="aborted"),y(),f.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),f=[]}function C(x,T){T&&(b=[]),typeof x=="function"&&b.push(x)}function v(){return{startTime:c,payload:t,status:l,queriesSent:u,queriesPending:f.length,subscribe:C,abort:h}}function j(){l="failed",b.forEach(x=>{x(void 0,d)})}function g(){f.forEach(x=>{x.status==="pending"&&(x.status="aborted")}),f=[]}function E(x,T,O){const M=T!=="success";switch(f=f.filter(N=>N!==x),l){case"pending":break;case"failed":if(M||!e.dataAfterTimeout)return;break;default:return}if(T==="abort"){d=O,j();return}if(M){d=O,f.length||(a.length?k():j());return}if(y(),g(),!e.random){const N=e.resources.indexOf(x.resource);N!==-1&&N!==e.index&&(e.index=N)}l="completed",b.forEach(N=>{N(O)})}function k(){if(l!=="pending")return;y();const x=a.shift();if(x===void 0){if(f.length){p=setTimeout(()=>{y(),l==="pending"&&(g(),j())},e.timeout);return}j();return}const T={status:"pending",resource:x,callback:(O,M)=>{E(T,O,M)}};f.push(T),u++,p=setTimeout(k,e.rotate),n(x,t,T.callback)}return setTimeout(k),v}function zn(e){const t={...qs,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function o(c,l,u){const d=Ks(t,c,l,(p,f)=>{r(),u&&u(p,f)});return n.push(d),d}function s(c){return n.find(l=>c(l))||null}return{query:o,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Vt(){}const Ze=Object.create(null);function Gs(e){if(!Ze[e]){const t=Ve(e);if(!t)return;const n=zn(t),r={config:t,redundancy:n};Ze[e]=r}return Ze[e]}function $n(e,t,n){let r,o;if(typeof e=="string"){const s=ut(e);if(!s)return n(void 0,424),Vt;o=s.send;const a=Gs(e);a&&(r=a.redundancy)}else{const s=St(e);if(s){r=zn(s);const a=e.resources?e.resources[0]:"",c=ut(a);c&&(o=c.send)}}return!r||!o?(n(void 0,424),Vt):r.query(t,o,n)().abort}function Qs(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Z)Rn(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Zs(e,t){vt||Mn();function n(r){let o;if(!Z[r]||!(o=Pn(r)))return;const s=Ln[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=ct(o),!at(o,a+1))return;const c={cached:Math.floor(Date.now()/An),provider:e.provider,data:t};return wt(o,fe+a.toString(),JSON.stringify(c))}t.lastModified&&!Qs(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Ht(){}function Xs(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Fs(e)}))}function Js(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,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ut(n)))return;s.prepare(n,r,o).forEach(c=>{$n(n,c,l=>{if(typeof l!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=xt(e,l);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(p=>{d.delete(p)}),Zs(e,l)}catch(u){console.error(u)}Xs(e)})})}))}const Ys=e=>{const n=z(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},jt=(e,t)=>{const n=Ws(e,!0,ys()),r=$s(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Ht)}),()=>{l=!1}}const o=Object.create(null),s=[];let a,c;return r.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===c&&u===a)return;a=u,c=d,s.push(z(u,d));const p=o[u]||(o[u]=Object.create(null));p[d]||(p[d]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:d,name:p}=l,f=z(u,d),b=f.pendingIcons||(f.pendingIcons=new Set);b.has(p)||(b.add(p),o[u][d].push(p))}),s.forEach(l=>{const{provider:u,prefix:d}=l;o[u][d].length&&Js(l,o[u][d])}),t?Hs(t,r,s):Ht},ei=e=>new Promise((t,n)=>{const r=typeof e=="string"?se(e,!0):e;if(!r){n(e);return}jt([r||e],o=>{if(o.length&&r){const s=ge(r);if(s){t({...he,...s});return}}n(e)})});function Fn(e,t){const n={...e};for(const r in t){const o=t[r],s=typeof o;r in In?(o===null||o&&(s==="string"||s==="number"))&&(n[r]=o):s===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const He={..._n,inline:!1},Xe="iconify",dt="iconify-inline",q="iconifyData"+Date.now();let X=[];function be(e){for(let t=0;t<X.length;t++){const n=X[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function Vn(e,t=!1){let n=be(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},X.push(n),n)}function ti(){if(document.documentElement)return Vn(document.documentElement);X.push({node:()=>document.documentElement})}function ni(e){X=X.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function xe(){return X}function oi(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let le=null;const ri={childList:!0,subtree:!0,attributes:!0};function Hn(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,le&&le(e)}))}function si(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const o=t[r];if(o.addedNodes&&o.addedNodes.length>0||o.type==="attributes"&&o.target[q]!==void 0){n.paused||Hn(e);return}}}function Wn(e,t){e.observer.instance.observe(t,ri)}function Oe(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(si.bind(null,e)),Wn(e,n),t.paused||Hn(e))}function Wt(){xe().forEach(Oe)}function qn(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 ii(e){const t=le!==null;if(le!==e&&(le=e,t&&xe().forEach(qn)),t){Wt();return}oi(Wt)}function ft(e){(e?[e]:xe()).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 ai(e){if(e){const t=be(e);t&&ft(t)}else ft()}function pt(e){(e?[e]:xe()).forEach(t=>{if(!t.observer){Oe(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?Wn(t,r):Oe(t);else return}})}function ci(e){if(e){const t=be(e);t&&pt(t)}else pt()}function Kn(e,t=!1){const n=Vn(e,t);return Oe(n),n}function Gn(e){const t=be(e);t&&(qn(t),ni(e))}function li(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const o in He)if(n[o]!==r[o])return!0;return!1}function ui(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const di=/[\s,]+/;function fi(e,t){t.split(di).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const pi=["width","height"],mi=["inline","hFlip","vFlip"];function hi(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function gi(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&se(t,!0);if(!n)return null;const r={...He,inline:e.classList&&e.classList.contains(dt)};pi.forEach(c=>{const l=e.getAttribute("data-"+c);l&&(r[c]=l)});const o=e.getAttribute("data-rotate");typeof o=="string"&&(r.rotate=ui(o));const s=e.getAttribute("data-flip");typeof s=="string"&&fi(r,s),mi.forEach(c=>{const l="data-"+c,u=hi(e.getAttribute(l),l);typeof u=="boolean"&&(r[c]=u)});const a=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:a}}const bi="svg."+Xe+", i."+Xe+", span."+Xe+", i."+dt+", span."+dt;function xi(e){const t=[];return e.querySelectorAll(bi).forEach(n=>{const r=n[q]||n.tagName.toLowerCase()!=="svg"?gi(n):null;r&&t.push({node:n,props:r})}),t}function Qn(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 ue;function yi(){try{ue=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ue=null}}function vi(e){return ue===void 0&&yi(),ue?ue.createHTML(e):e}function Zn(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function Xn(e,t,n,r){const o=e.classList;if(r){const a=r.classList;Array.from(a).forEach(c=>{o.add(c)})}const s=[];return t.forEach(a=>{o.contains(a)?n.has(a)&&s.push(a):(o.add(a),s.push(a))}),n.forEach(a=>{t.has(a)||o.remove(a)}),s}function Jn(e,t,n){const r=e.style;(n||[]).forEach(s=>{r.removeProperty(s)});const o=[];for(const s in t)r.getPropertyValue(s)||(o.push(s),r.setProperty(s,t[s]));return o}function Yn(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const o=t.customisations,s=$e(n,o),a=e[q],c=Qn(Tn(s.body),{"aria-hidden":"true",role:"img",...s.attributes});r.innerHTML=vi(c);const l=r.childNodes[0],u=e.attributes;for(let y=0;y<u.length;y++){const h=u.item(y),C=h.name;C!=="class"&&!l.hasAttribute(C)&&l.setAttribute(C,h.value)}const d=Zn(t.icon),p=Xn(l,d,new Set(a&&a.addedClasses),e),f=Jn(l,o.inline?{"vertical-align":"-0.125em"}:{},a&&a.addedStyles),b={...t,status:"loaded",addedClasses:p,addedStyles:f};return l[q]=b,e.parentNode&&e.parentNode.replaceChild(l,e),l}function wi(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Si(e){return"data:image/svg+xml,"+wi(e)}function ji(e){return'url("'+Si(e)+'")'}const Ci={display:"inline-block"},mt={"background-color":"currentColor"},eo={"background-color":"transparent"},qt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Kt={"-webkit-mask":mt,mask:mt,background:eo};for(const e in Kt){const t=Kt[e];for(const n in qt)t[e+"-"+n]=qt[n]}function Gt(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function ki(e,t,n,r){const o=t.customisations,s=$e(n,o),a=s.attributes,c=e[q],l=Qn(s.body,{...a,width:n.width+"",height:n.height+""}),u=Zn(t.icon),d=Xn(e,u,new Set(c&&c.addedClasses)),f={"--svg":ji(l),width:Gt(a.width),height:Gt(a.height),...Ci,...r?mt:eo};o.inline&&(f["vertical-align"]="-0.125em");const b=Jn(e,f,c&&c.addedStyles),y={...t,status:"loaded",addedClasses:d,addedStyles:b};return e[q]=y,e}let Ie=!1;function Ei(){Ie||(Ie=!0,setTimeout(()=>{Ie&&(Ie=!1,oe())}))}function oe(e,t=!1){const n=Object.create(null);function r(o,s){const{provider:a,prefix:c,name:l}=o,u=z(a,c),d=u.icons[l];if(d)return{status:"loaded",icon:d};if(u.missing.has(l))return{status:"missing"};if(s&&!Ys(o)){const p=n[a]||(n[a]=Object.create(null));(p[c]||(p[c]=new Set)).add(l)}return{status:"loading"}}(e?[e]:xe()).forEach(o=>{const s=typeof o.node=="function"?o.node():o.node;if(!s||!s.querySelectorAll)return;let a=!1,c=!1;function l(u,d,p){if(c||(c=!0,ft(o)),u.tagName.toUpperCase()!=="SVG"){const f=d.mode,b=f==="mask"||(f==="bg"?!1:f==="style"?p.body.indexOf("currentColor")!==-1:null);if(typeof b=="boolean"){ki(u,d,{...he,...p},b);return}}Yn(u,d,p)}xi(s).forEach(({node:u,props:d})=>{const p=u[q];if(!p){const{status:b,icon:y}=r(d.icon,!0);if(y){l(u,d,y);return}a=a||b==="loading",u[q]={...d,status:b};return}let f;if(li(p,d)){if(f=r(d.icon,p.name!==d.name),!f.icon){a=a||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)}),o.temporary&&!a?Gn(s):t&&a?Kn(s,!0):c&&o.observer&&pt(o)});for(const o in n){const s=n[o];for(const a in s){const c=s[a];jt(Array.from(c).map(l=>({provider:o,prefix:a,name:l})),Ei)}}}function Ii(e){const t=be(e);t?oe(t):oe({node:e,temporary:!0},!0)}function to(e,t,n=!1){const r=ge(e);if(!r)return null;const o=se(e),s=Fn(He,t||{}),a=Yn(document.createElement("span"),{name:e,icon:o,customisations:s},r);return n?a.outerHTML:a}function _i(){return"3.1.1"}function Ti(e,t){return to(e,t,!1)}function Li(e,t){return to(e,t,!0)}function Di(e,t){const n=ge(e);if(!n)return null;const r=Fn(He,t||{});return $e(n,r)}function Ai(e){e?Ii(e):oe()}if(typeof document<"u"&&typeof window<"u"){ti();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"||!En(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{ii(oe),oe()})}function Pi(e,t){On(e,t!==!1)}function Ri(e){On(e,!0)}Nn("",zs);if(typeof document<"u"&&typeof window<"u"){Mn();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 o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;Un(n,o)||console.error(r)}catch{console.error(r)}}}}const Mi={getAPIConfig:Ve,setAPIModule:Nn,sendAPIQuery:$n,setFetch:Ps,getFetch:Rs,listAPIProviders:Ds},Oi={_api:Mi,addAPIProvider:Un,loadIcons:jt,loadIcon:ei,iconExists:ws,getIcon:Ss,listIcons:xs,addIcon:vs,addCollection:En,replaceIDs:Tn,calculateSize:st,buildIcon:$e,getVersion:_i,renderSVG:Ti,renderHTML:Li,renderIcon:Di,scan:Ai,observe:Kn,stopObserving:Gn,pauseObserver:ai,resumeObserver:ci,enableCache:Pi,disableCache:Ri};try{self.Iconify===void 0&&(self.Iconify=Oi)}catch{}function no({children:e,style:t={},...n}){return i.jsx(So,{style:t,...n,children:e})}no.propTypes={children:S.any.isRequired,style:S.object};const A={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},De={added:A.grey,waiting:A.yellow,downloading:A.yellow,extracting:A.yellow,downloaded:A.grey,installing:A.yellow,installed:A.grey,starting:A.yellow,running:A.running,stopping:A.yellow,stopped:A.reverse,error:A.error,upgrading:A.yellow,restarting:A.yellow,corrupted:A.error,deleting:A.yellow,resource:A.primary},Ni={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 Ui({isResource:e=!1,status:t,variant:n="tag",progress:r=0,tip:o="",...s}){const{t:a}=m.useContext(tn),c=P.isInProgress(t),l=e&&t==="stopped"?"resource":t,u=a(`blocklet.status.${l}`);return n==="pin"?i.jsx(de,{title:a("blocklet.statusTip",{status:u}),children:i.jsxs(I,{...s,sx:[{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[i.jsx(I,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:De[l]}}),i.jsx(I,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:De[l]}})]})}):n==="dot"?i.jsx(de,{title:a("blocklet.statusTip",{status:u}),children:i.jsx(Vr,{color:De[l],...s})}):i.jsxs(no,{type:Ni[l],...s,children:[c&&i.jsx(V,{size:12,color:"inherit",style:{marginRight:5}}),u,o&&i.jsx("span",{style:{marginLeft:5},children:o}),l==="downloading"&&r?i.jsx("div",{style:{marginLeft:5},children:`${r} %`}):null]})}Ui.propTypes={status:S.string.isRequired,variant:S.oneOf(["dot","tag","pin"]),source:S.string,progress:S.number,isResource:S.bool,tip:S.string};function oo({infos:e=[]}){const{t}=B(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(o=>{n.searchParams.set(o.label,o.value)});const r=e.map(o=>`* ${o.label}: ${o.value}`).join(`
42
+ */const kn=Object.freeze({left:0,top:0,width:16,height:16}),Pe=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),he=Object.freeze({...kn,...Pe}),rt=Object.freeze({...he,body:"",hidden:!1});function us(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 Bt(e,t){const n=us(e,t);for(const r in rt)r in Pe?r in e&&!(r in n)&&(n[r]=Pe[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ds(e,t){const n=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(a){if(n[a])return o[a]=[];if(!(a in o)){o[a]=null;const c=r[a]&&r[a].parent,l=c&&s(c);l&&(o[a]=[c].concat(l))}return o[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),o}function fs(e,t,n){const r=e.icons,o=e.aliases||Object.create(null);let s={};function a(c){s=Bt(r[c]||o[c],s)}return a(t),n.forEach(a),Bt(e,s)}function ps(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),n.push(o)});const r=ds(e);for(const o in r){const s=r[o];s&&(t(o,fs(e,o,s)),n.push(o))}return n}const ce=/^[a-z0-9]+(-[a-z0-9]+)*$/,se=(e,t,n,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const c=o.pop(),l=o.pop(),u={provider:o.length>0?o[0]:r,prefix:l,name:c};return t&&!Le(u)?null:u}const s=o[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!Le(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!Le(c,n)?null:c}return null},Le=(e,t)=>e?!!((e.provider===""||e.provider.match(ce))&&(t&&e.prefix===""||e.prefix.match(ce))&&e.name.match(ce)):!1,ms={provider:"",aliases:{},not_found:{},...kn};function Qe(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function hs(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Qe(e,ms))return null;const n=t.icons;for(const o in n){const s=n[o];if(!o.match(ce)||typeof s.body!="string"||!Qe(s,rt))return null}const r=t.aliases||Object.create(null);for(const o in r){const s=r[o],a=s.parent;if(!o.match(ce)||typeof a!="string"||!n[a]&&!r[a]||!Qe(s,rt))return null}return t}const Re=Object.create(null);function gs(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function z(e,t){const n=Re[e]||(Re[e]=Object.create(null));return n[t]||(n[t]=gs(e,t))}function xt(e,t){return hs(t)?ps(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function bs(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}function xs(e,t){let n=[];return(typeof e=="string"?[e]:Object.keys(Re)).forEach(o=>{(typeof o=="string"&&typeof t=="string"?[t]:Object.keys(Re[o]||{})).forEach(a=>{const c=z(o,a);n=n.concat(Object.keys(c.icons).map(l=>(o!==""?"@"+o+":":"")+a+":"+l))})}),n}let yt=!1;function ys(e){return yt}function ge(e){const t=typeof e=="string"?se(e,!0,yt):e;if(t){const n=z(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function vs(e,t){const n=se(e,!0,yt);if(!n)return!1;const r=z(n.provider,n.prefix);return bs(r,n.name,t)}function En(e,t){if(typeof e!="object")return!1;typeof t!="string"&&(t=e.provider||"");const n=e.prefix;if(!Le({provider:t,prefix:n,name:"a"}))return!1;const r=z(t,n);return!!xt(r,e)}function ws(e){return!!ge(e)}function Ss(e){const t=ge(e);return t?{...he,...t}:null}const In=Object.freeze({width:null,height:null}),_n=Object.freeze({...In,...Pe}),js=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Cs=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function st(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(js);if(r===null||!r.length)return e;const o=[];let s=r.shift(),a=Cs.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?o.push(s):o.push(Math.ceil(c*t*n)/n)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");a=!a}}const ks=e=>e==="unset"||e==="undefined"||e==="none";function $e(e,t){const n={...he,...e},r={..._n,...t},o={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(y=>{const b=[],j=y.hFlip,v=y.vFlip;let C=y.rotate;j?v?C+=2:(b.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),b.push("scale(-1 1)"),o.top=o.left=0):v&&(b.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),b.push("scale(1 -1)"),o.top=o.left=0);let g;switch(C<0&&(C-=Math.floor(C/4)*4),C=C%4,C){case 1:g=o.height/2+o.top,b.unshift("rotate(90 "+g.toString()+" "+g.toString()+")");break;case 2:b.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:g=o.width/2+o.left,b.unshift("rotate(-90 "+g.toString()+" "+g.toString()+")");break}C%2===1&&(o.left!==o.top&&(g=o.left,o.left=o.top,o.top=g),o.width!==o.height&&(g=o.width,o.width=o.height,o.height=g)),b.length&&(s='<g transform="'+b.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,l=o.width,u=o.height;let d,p;a===null?(p=c===null?"1em":c==="auto"?u:c,d=st(p,l/u)):(d=a==="auto"?l:a,p=c===null?st(d,u/l):c==="auto"?u:c);const f={},x=(y,b)=>{ks(b)||(f[y]=b.toString())};return x("width",d),x("height",p),f.viewBox=o.left.toString()+" "+o.top.toString()+" "+l.toString()+" "+u.toString(),{attributes:f,body:s}}const Es=/\sid="(\S+)"/g,Is="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let _s=0;function Ln(e,t=Is){const n=[];let r;for(;r=Es.exec(e);)n.push(r[1]);if(!n.length)return e;const o="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(_s++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+o+"$3")}),e=e.replace(new RegExp(o,"g"),""),e}const Z={local:!0,session:!0},Tn={local:new Set,session:new Set};let vt=!1;function Ls(e){vt=e}const zt="iconify2",fe="iconify",Dn=fe+"-count",$t=fe+"-version",An=36e5,Ts=168;function it(e,t){try{return e.getItem(t)}catch{}}function wt(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ft(e,t){try{e.removeItem(t)}catch{}}function at(e,t){return wt(e,Dn,t.toString())}function ct(e){return parseInt(it(e,Dn))||0}let Ee=typeof window>"u"?{}:window;function Pn(e){const t=e+"Storage";try{if(Ee&&Ee[t]&&typeof Ee[t].length=="number")return Ee[t]}catch{}Z[e]=!1}function Rn(e,t){const n=Pn(e);if(!n)return;const r=it(n,$t);if(r!==zt){if(r){const c=ct(n);for(let l=0;l<c;l++)Ft(n,fe+l.toString())}wt(n,$t,zt),at(n,0);return}const o=Math.floor(Date.now()/An)-Ts,s=c=>{const l=fe+c.toString(),u=it(n,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>o&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,c))return!0}catch{}Ft(n,l)}};let a=ct(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,at(n,a)):Tn[e].add(c))}function Mn(){if(!vt){Ls(!0);for(const e in Z)Rn(e,t=>{const n=t.data,r=t.provider,o=n.prefix,s=z(r,o);if(!xt(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function On(e,t){switch(e){case"local":case"session":Z[e]=t;break;case"all":for(const n in Z)Z[n]=t;break}}const lt=Object.create(null);function Nn(e,t){lt[e]=t}function ut(e){return lt[e]||lt[""]}function St(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 Fe=Object.create(null),ae=["https://api.simplesvg.com","https://api.unisvg.com"],Te=[];for(;ae.length>0;)ae.length===1||Math.random()>.5?Te.push(ae.shift()):Te.push(ae.pop());Fe[""]=St({resources:["https://api.iconify.design"].concat(Te)});function Un(e,t){const n=St(t);return n===null?!1:(Fe[e]=n,!0)}function Ve(e){return Fe[e]}function Ds(){return Object.keys(Fe)}const As=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Me=As();function Ps(e){Me=e}function Rs(){return Me}function Ms(e,t){const n=Ve(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let o=0;n.resources.forEach(a=>{o=Math.max(o,a.length)});const s=t+".json?icons=";r=n.maxURL-o-n.path.length-s.length}return r}function Os(e){return e===404}const Ns=(e,t,n)=>{const r=[],o=Ms(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((l,u)=>{c+=l.length+1,c>=o&&u>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=l.length),a.icons.push(l)}),r.push(a),r};function Us(e){if(typeof e=="string"){const t=Ve(e);if(t)return t.path}return"/"}const Bs=(e,t,n)=>{if(!Me){n("abort",424);return}let r=Us(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),l=new URLSearchParams({icons:c});r+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let o=503;Me(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Os(a)?"abort":"next",a)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",o)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",o)})},zs={prepare:Ns,send:Bs};function $s(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,a=o.prefix,c=o.name,l=n[s]||(n[s]=Object.create(null)),u=l[a]||(l[a]=z(s,a));let d;c in u.icons?d=t.loaded:a===""||u.missing.has(c)?d=t.missing:d=t.pending;const p={provider:s,prefix:a,name:c};d.push(p)}),t}function Bn(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(o=>o.id!==t))})}function Fs(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,o=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(l=>{if(l.prefix!==o)return!0;const u=l.name;if(e.icons[u])a.loaded.push({provider:r,prefix:o,name:u});else if(e.missing.has(u))a.missing.push({provider:r,prefix:o,name:u});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Bn([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Vs=0;function Hs(e,t,n){const r=Vs++,o=Bn.bind(null,n,r);if(!t.pending.length)return o;const s={id:r,icons:t,callback:e,abort:o};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),o}function Ws(e,t=!0,n=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?se(o,t,n):o;s&&r.push(s)}),r}var qs={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Ks(e,t,n,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let a;if(e.random){let m=e.resources.slice(0);for(a=[];m.length>1;){const I=Math.floor(Math.random()*m.length);a.push(m[I]),m=m.slice(0,I).concat(m.slice(I+1))}a=a.concat(m)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let l="pending",u=0,d,p=null,f=[],x=[];typeof r=="function"&&x.push(r);function y(){p&&(clearTimeout(p),p=null)}function b(){l==="pending"&&(l="aborted"),y(),f.forEach(m=>{m.status==="pending"&&(m.status="aborted")}),f=[]}function j(m,I){I&&(x=[]),typeof m=="function"&&x.push(m)}function v(){return{startTime:c,payload:t,status:l,queriesSent:u,queriesPending:f.length,subscribe:j,abort:b}}function C(){l="failed",x.forEach(m=>{m(void 0,d)})}function g(){f.forEach(m=>{m.status==="pending"&&(m.status="aborted")}),f=[]}function k(m,I,O){const M=I!=="success";switch(f=f.filter(N=>N!==m),l){case"pending":break;case"failed":if(M||!e.dataAfterTimeout)return;break;default:return}if(I==="abort"){d=O,C();return}if(M){d=O,f.length||(a.length?_():C());return}if(y(),g(),!e.random){const N=e.resources.indexOf(m.resource);N!==-1&&N!==e.index&&(e.index=N)}l="completed",x.forEach(N=>{N(O)})}function _(){if(l!=="pending")return;y();const m=a.shift();if(m===void 0){if(f.length){p=setTimeout(()=>{y(),l==="pending"&&(g(),C())},e.timeout);return}C();return}const I={status:"pending",resource:m,callback:(O,M)=>{k(I,O,M)}};f.push(I),u++,p=setTimeout(_,e.rotate),n(m,t,I.callback)}return setTimeout(_),v}function zn(e){const t={...qs,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function o(c,l,u){const d=Ks(t,c,l,(p,f)=>{r(),u&&u(p,f)});return n.push(d),d}function s(c){return n.find(l=>c(l))||null}return{query:o,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function Vt(){}const Ze=Object.create(null);function Gs(e){if(!Ze[e]){const t=Ve(e);if(!t)return;const n=zn(t),r={config:t,redundancy:n};Ze[e]=r}return Ze[e]}function $n(e,t,n){let r,o;if(typeof e=="string"){const s=ut(e);if(!s)return n(void 0,424),Vt;o=s.send;const a=Gs(e);a&&(r=a.redundancy)}else{const s=St(e);if(s){r=zn(s);const a=e.resources?e.resources[0]:"",c=ut(a);c&&(o=c.send)}}return!r||!o?(n(void 0,424),Vt):r.query(t,o,n)().abort}function Qs(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Z)Rn(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Zs(e,t){vt||Mn();function n(r){let o;if(!Z[r]||!(o=Pn(r)))return;const s=Tn[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=ct(o),!at(o,a+1))return;const c={cached:Math.floor(Date.now()/An),provider:e.provider,data:t};return wt(o,fe+a.toString(),JSON.stringify(c))}t.lastModified&&!Qs(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Ht(){}function Xs(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Fs(e)}))}function Js(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,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=ut(n)))return;s.prepare(n,r,o).forEach(c=>{$n(n,c,l=>{if(typeof l!="object")c.icons.forEach(u=>{e.missing.add(u)});else try{const u=xt(e,l);if(!u.length)return;const d=e.pendingIcons;d&&u.forEach(p=>{d.delete(p)}),Zs(e,l)}catch(u){console.error(u)}Xs(e)})})}))}const Ys=e=>{const n=z(e.provider,e.prefix).pendingIcons;return!!(n&&n.has(e.name))},jt=(e,t)=>{const n=Ws(e,!0,ys()),r=$s(n);if(!r.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(r.loaded,r.missing,r.pending,Ht)}),()=>{l=!1}}const o=Object.create(null),s=[];let a,c;return r.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===c&&u===a)return;a=u,c=d,s.push(z(u,d));const p=o[u]||(o[u]=Object.create(null));p[d]||(p[d]=[])}),r.pending.forEach(l=>{const{provider:u,prefix:d,name:p}=l,f=z(u,d),x=f.pendingIcons||(f.pendingIcons=new Set);x.has(p)||(x.add(p),o[u][d].push(p))}),s.forEach(l=>{const{provider:u,prefix:d}=l;o[u][d].length&&Js(l,o[u][d])}),t?Hs(t,r,s):Ht},ei=e=>new Promise((t,n)=>{const r=typeof e=="string"?se(e,!0):e;if(!r){n(e);return}jt([r||e],o=>{if(o.length&&r){const s=ge(r);if(s){t({...he,...s});return}}n(e)})});function Fn(e,t){const n={...e};for(const r in t){const o=t[r],s=typeof o;r in In?(o===null||o&&(s==="string"||s==="number"))&&(n[r]=o):s===typeof n[r]&&(n[r]=r==="rotate"?o%4:o)}return n}const He={..._n,inline:!1},Xe="iconify",dt="iconify-inline",q="iconifyData"+Date.now();let X=[];function be(e){for(let t=0;t<X.length;t++){const n=X[t];if((typeof n.node=="function"?n.node():n.node)===e)return n}}function Vn(e,t=!1){let n=be(e);return n?(n.temporary&&(n.temporary=t),n):(n={node:e,temporary:t},X.push(n),n)}function ti(){if(document.documentElement)return Vn(document.documentElement);X.push({node:()=>document.documentElement})}function ni(e){X=X.filter(t=>e!==t&&e!==(typeof t.node=="function"?t.node():t.node))}function xe(){return X}function oi(e){const t=document;t.readyState&&t.readyState!=="loading"?e():t.addEventListener("DOMContentLoaded",e)}let le=null;const ri={childList:!0,subtree:!0,attributes:!0};function Hn(e){if(!e.observer)return;const t=e.observer;t.pendingScan||(t.pendingScan=setTimeout(()=>{delete t.pendingScan,le&&le(e)}))}function si(e,t){if(!e.observer)return;const n=e.observer;if(!n.pendingScan)for(let r=0;r<t.length;r++){const o=t[r];if(o.addedNodes&&o.addedNodes.length>0||o.type==="attributes"&&o.target[q]!==void 0){n.paused||Hn(e);return}}}function Wn(e,t){e.observer.instance.observe(t,ri)}function Oe(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(si.bind(null,e)),Wn(e,n),t.paused||Hn(e))}function Wt(){xe().forEach(Oe)}function qn(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 ii(e){const t=le!==null;if(le!==e&&(le=e,t&&xe().forEach(qn)),t){Wt();return}oi(Wt)}function ft(e){(e?[e]:xe()).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 ai(e){if(e){const t=be(e);t&&ft(t)}else ft()}function pt(e){(e?[e]:xe()).forEach(t=>{if(!t.observer){Oe(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?Wn(t,r):Oe(t);else return}})}function ci(e){if(e){const t=be(e);t&&pt(t)}else pt()}function Kn(e,t=!1){const n=Vn(e,t);return Oe(n),n}function Gn(e){const t=be(e);t&&(qn(t),ni(e))}function li(e,t){if(e.name!==t.name||e.mode!==t.mode)return!0;const n=e.customisations,r=t.customisations;for(const o in He)if(n[o]!==r[o])return!0;return!1}function ui(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(n===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(n!==e){let o=0;switch(n){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return t}const di=/[\s,]+/;function fi(e,t){t.split(di).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const pi=["width","height"],mi=["inline","hFlip","vFlip"];function hi(e,t){return e===t||e==="true"?!0:e===""||e==="false"?!1:null}function gi(e){const t=e.getAttribute("data-icon"),n=typeof t=="string"&&se(t,!0);if(!n)return null;const r={...He,inline:e.classList&&e.classList.contains(dt)};pi.forEach(c=>{const l=e.getAttribute("data-"+c);l&&(r[c]=l)});const o=e.getAttribute("data-rotate");typeof o=="string"&&(r.rotate=ui(o));const s=e.getAttribute("data-flip");typeof s=="string"&&fi(r,s),mi.forEach(c=>{const l="data-"+c,u=hi(e.getAttribute(l),l);typeof u=="boolean"&&(r[c]=u)});const a=e.getAttribute("data-mode");return{name:t,icon:n,customisations:r,mode:a}}const bi="svg."+Xe+", i."+Xe+", span."+Xe+", i."+dt+", span."+dt;function xi(e){const t=[];return e.querySelectorAll(bi).forEach(n=>{const r=n[q]||n.tagName.toLowerCase()!=="svg"?gi(n):null;r&&t.push({node:n,props:r})}),t}function Qn(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 ue;function yi(){try{ue=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ue=null}}function vi(e){return ue===void 0&&yi(),ue?ue.createHTML(e):e}function Zn(e){const t=new Set(["iconify"]);return["provider","prefix"].forEach(n=>{e[n]&&t.add("iconify--"+e[n])}),t}function Xn(e,t,n,r){const o=e.classList;if(r){const a=r.classList;Array.from(a).forEach(c=>{o.add(c)})}const s=[];return t.forEach(a=>{o.contains(a)?n.has(a)&&s.push(a):(o.add(a),s.push(a))}),n.forEach(a=>{t.has(a)||o.remove(a)}),s}function Jn(e,t,n){const r=e.style;(n||[]).forEach(s=>{r.removeProperty(s)});const o=[];for(const s in t)r.getPropertyValue(s)||(o.push(s),r.setProperty(s,t[s]));return o}function Yn(e,t,n){let r;try{r=document.createElement("span")}catch{return e}const o=t.customisations,s=$e(n,o),a=e[q],c=Qn(Ln(s.body),{"aria-hidden":"true",role:"img",...s.attributes});r.innerHTML=vi(c);const l=r.childNodes[0],u=e.attributes;for(let y=0;y<u.length;y++){const b=u.item(y),j=b.name;j!=="class"&&!l.hasAttribute(j)&&l.setAttribute(j,b.value)}const d=Zn(t.icon),p=Xn(l,d,new Set(a&&a.addedClasses),e),f=Jn(l,o.inline?{"vertical-align":"-0.125em"}:{},a&&a.addedStyles),x={...t,status:"loaded",addedClasses:p,addedStyles:f};return l[q]=x,e.parentNode&&e.parentNode.replaceChild(l,e),l}function wi(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Si(e){return"data:image/svg+xml,"+wi(e)}function ji(e){return'url("'+Si(e)+'")'}const Ci={display:"inline-block"},mt={"background-color":"currentColor"},eo={"background-color":"transparent"},qt={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Kt={"-webkit-mask":mt,mask:mt,background:eo};for(const e in Kt){const t=Kt[e];for(const n in qt)t[e+"-"+n]=qt[n]}function Gt(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function ki(e,t,n,r){const o=t.customisations,s=$e(n,o),a=s.attributes,c=e[q],l=Qn(s.body,{...a,width:n.width+"",height:n.height+""}),u=Zn(t.icon),d=Xn(e,u,new Set(c&&c.addedClasses)),f={"--svg":ji(l),width:Gt(a.width),height:Gt(a.height),...Ci,...r?mt:eo};o.inline&&(f["vertical-align"]="-0.125em");const x=Jn(e,f,c&&c.addedStyles),y={...t,status:"loaded",addedClasses:d,addedStyles:x};return e[q]=y,e}let Ie=!1;function Ei(){Ie||(Ie=!0,setTimeout(()=>{Ie&&(Ie=!1,oe())}))}function oe(e,t=!1){const n=Object.create(null);function r(o,s){const{provider:a,prefix:c,name:l}=o,u=z(a,c),d=u.icons[l];if(d)return{status:"loaded",icon:d};if(u.missing.has(l))return{status:"missing"};if(s&&!Ys(o)){const p=n[a]||(n[a]=Object.create(null));(p[c]||(p[c]=new Set)).add(l)}return{status:"loading"}}(e?[e]:xe()).forEach(o=>{const s=typeof o.node=="function"?o.node():o.node;if(!s||!s.querySelectorAll)return;let a=!1,c=!1;function l(u,d,p){if(c||(c=!0,ft(o)),u.tagName.toUpperCase()!=="SVG"){const f=d.mode,x=f==="mask"||(f==="bg"?!1:f==="style"?p.body.indexOf("currentColor")!==-1:null);if(typeof x=="boolean"){ki(u,d,{...he,...p},x);return}}Yn(u,d,p)}xi(s).forEach(({node:u,props:d})=>{const p=u[q];if(!p){const{status:x,icon:y}=r(d.icon,!0);if(y){l(u,d,y);return}a=a||x==="loading",u[q]={...d,status:x};return}let f;if(li(p,d)){if(f=r(d.icon,p.name!==d.name),!f.icon){a=a||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)}),o.temporary&&!a?Gn(s):t&&a?Kn(s,!0):c&&o.observer&&pt(o)});for(const o in n){const s=n[o];for(const a in s){const c=s[a];jt(Array.from(c).map(l=>({provider:o,prefix:a,name:l})),Ei)}}}function Ii(e){const t=be(e);t?oe(t):oe({node:e,temporary:!0},!0)}function to(e,t,n=!1){const r=ge(e);if(!r)return null;const o=se(e),s=Fn(He,t||{}),a=Yn(document.createElement("span"),{name:e,icon:o,customisations:s},r);return n?a.outerHTML:a}function _i(){return"3.1.1"}function Li(e,t){return to(e,t,!1)}function Ti(e,t){return to(e,t,!0)}function Di(e,t){const n=ge(e);if(!n)return null;const r=Fn(He,t||{});return $e(n,r)}function Ai(e){e?Ii(e):oe()}if(typeof document<"u"&&typeof window<"u"){ti();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"||!En(r))&&console.error(n)}catch{console.error(n)}})}setTimeout(()=>{ii(oe),oe()})}function Pi(e,t){On(e,t!==!1)}function Ri(e){On(e,!0)}Nn("",zs);if(typeof document<"u"&&typeof window<"u"){Mn();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 o=t[n];if(typeof o!="object"||!o||o.resources===void 0)continue;Un(n,o)||console.error(r)}catch{console.error(r)}}}}const Mi={getAPIConfig:Ve,setAPIModule:Nn,sendAPIQuery:$n,setFetch:Ps,getFetch:Rs,listAPIProviders:Ds},Oi={_api:Mi,addAPIProvider:Un,loadIcons:jt,loadIcon:ei,iconExists:ws,getIcon:Ss,listIcons:xs,addIcon:vs,addCollection:En,replaceIDs:Ln,calculateSize:st,buildIcon:$e,getVersion:_i,renderSVG:Li,renderHTML:Ti,renderIcon:Di,scan:Ai,observe:Kn,stopObserving:Gn,pauseObserver:ai,resumeObserver:ci,enableCache:Pi,disableCache:Ri};try{self.Iconify===void 0&&(self.Iconify=Oi)}catch{}function no({children:e,style:t={},...n}){return i.jsx(So,{style:t,...n,children:e})}no.propTypes={children:S.any.isRequired,style:S.object};const A={yellow:"#FFCF71",grey:"#aaaaaa",reverse:"#444",running:"#34BE74",error:"#D0021B",primary:"#1DC1C7"},De={added:A.grey,waiting:A.yellow,downloading:A.yellow,extracting:A.yellow,downloaded:A.grey,installing:A.yellow,installed:A.grey,starting:A.yellow,running:A.running,stopping:A.yellow,stopped:A.reverse,error:A.error,upgrading:A.yellow,restarting:A.yellow,corrupted:A.error,deleting:A.yellow,resource:A.primary},Ni={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 Ui({isResource:e=!1,status:t,variant:n="tag",progress:r=0,tip:o="",...s}){const{t:a}=h.useContext(tn),c=P.isInProgress(t),l=e&&t==="stopped"?"resource":t,u=a(`blocklet.status.${l}`);return n==="pin"?i.jsx(de,{title:a("blocklet.statusTip",{status:u}),children:i.jsxs(E,{...s,sx:[{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[i.jsx(E,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:De[l]}}),i.jsx(E,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:De[l]}})]})}):n==="dot"?i.jsx(de,{title:a("blocklet.statusTip",{status:u}),children:i.jsx(Vr,{color:De[l],...s})}):i.jsxs(no,{type:Ni[l],...s,children:[c&&i.jsx(V,{size:12,color:"inherit",style:{marginRight:5}}),u,o&&i.jsx("span",{style:{marginLeft:5},children:o}),l==="downloading"&&r?i.jsx("div",{style:{marginLeft:5},children:`${r} %`}):null]})}Ui.propTypes={status:S.string.isRequired,variant:S.oneOf(["dot","tag","pin"]),source:S.string,progress:S.number,isResource:S.bool,tip:S.string};function oo({infos:e=[]}){const{t}=B(),n=new URL("https://community.arcblock.io/discussions/add");e.forEach(o=>{n.searchParams.set(o.label,o.value)});const r=e.map(o=>`* ${o.label}: ${o.value}`).join(`
43
43
  `);return n.searchParams.set("report","server"),n.searchParams.set("context",`[Enter feedback here]
44
44
 
45
45
 
@@ -49,7 +49,7 @@ import{c as tn,n as ht,H as F,T as B,aG as nn,aH as wo,a3 as So,M as on,P as rn,
49
49
  ${r}
50
50
  * Page: ${window.location.href}
51
51
  -->
52
- `),L(I,{sx:{mx:{xs:0,md:2}},children:L(_e,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}oo.propTypes={infos:S.arrayOf(S.shape({label:S.string,value:S.string}))};var Je,Qt;function Bi(){return Qt||(Qt=1,Je={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"}}),Je}var Ye,Zt;function zi(){return Zt||(Zt=1,Ye={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}}),Ye}var et,Xt;function ro(){if(Xt)return et;Xt=1;const e=new Map;return et={registerLang:(r,o)=>{e.set(r,o)},getLang:(r="en_US")=>e.get(r)||e.get("en_US")},et}var tt,Jt;function $i(){return Jt||(Jt=1,tt=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}}),tt}var nt,Yt;function Fi(){if(Yt)return nt;Yt=1;const e=$i(),{getLang:t}=ro(),n=(o,s)=>s===1?o:`${o}s`,r=1e-7;return nt=(o,s={})=>{if(!Number.isFinite(o))throw new TypeError("Expected a finite number");s.colonNotation&&(s.compact=!1,s.formatSubMilliseconds=!1,s.separateMilliseconds=!1,s.verbose=!1),s.compact&&(s.secondsDecimalDigits=0,s.millisecondsDecimalDigits=0);const a=t(s.locale),c=[],l=(p,f)=>{const b=Math.floor(p*10**f+r);return(Math.round(b)/10**f).toFixed(f)},u=(p,f,b)=>{if((c.length===0||!s.colonNotation)&&p===0&&!(s.colonNotation&&f==="minute"))return;const{long:y}=a[f]||t("en_US")[f],{short:h}=a[f]||t("en_US")[f];let C=(b||p||"0").toString(),v,j;if(s.colonNotation){v=c.length>0?":":"",j="";const g=C.includes(".")?C.split(".")[0].length:C.length,E=c.length>0?2:1;C="0".repeat(Math.max(0,E-g))+C}else v="",s.locale==="zh_CN"?Object.values(d).filter(g=>g>0).length>1?!d.days&&!d.hours&&d.minutes&&s.compact?j=y:j=h:d.minutes?j=y:j=h:j=s.verbose?` ${n(y,p)}`:h;c.push(v+C+j)},d=e(o);if(u(Math.trunc(d.days/365),"year"),u(d.days%365,"day"),u(d.hours,"hour"),u(d.minutes,"minute"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&o<1e3)if(u(d.seconds,"second"),s.formatSubMilliseconds)u(d.milliseconds,"millisecond"),u(d.microseconds,"microsecond"),u(d.nanoseconds,"nanosecond");else{const p=d.milliseconds+d.microseconds/1e3+d.nanoseconds/1e6,f=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,b=p>=1?Math.round(p):Math.ceil(p),y=f?p.toFixed(f):b;u(Number.parseFloat(y,10),"millisecond",y)}else{const p=o/1e3%60,f=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,b=l(p,f),y=s.keepDecimalsOnWholeSeconds?b:b.replace(/\.0+$/,"");u(Number.parseFloat(y,10),"second",y)}if(c.length===0){const p=(a.millisecond||t("en_US").millisecond).long,f=(a.millisecond||t("en_US").millisecond).short;return s.locale==="zh_CN"?`0${s.verbose?`${p}`:f}`:`0${s.verbose?` ${p}s`:f}`}if(s.compact)return c[0];if(typeof s.unitCount=="number"){const p=s.colonNotation?"":" ";return c.slice(0,Math.max(s.unitCount,1)).join(p)}return s.colonNotation?c.join(""):c.join(" ")},nt}var ot,en;function Vi(){if(en)return ot;en=1;const e=Bi(),t=zi(),{registerLang:n}=ro(),r=Fi();return n("en_US",e),n("zh_CN",t),r.registerLang=n,ot=r,ot}var Hi=Vi();const so=Jo(Hi);function H({children:e}){return re(n=>n.breakpoints.down("md"))?i.jsx(de,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:i.jsx(I,{sx:{display:"flex",alignItems:"center",gap:1},children:i.jsx(Tt,{fontSize:"small"})})}):i.jsxs(I,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.jsx(Tt,{fontSize:"small"}),e]})}H.propTypes={children:S.node.isRequired};const Wi="https://launcher.arcblock.io/",qi=30*24*60*60*1e3;function io({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",retention:o=0,sx:s={},...a}){const{t:c,locale:l}=B(),u=ze(),[d,p]=vn({safeIframeRef:null,popoverAnchorEl:null}),f=m.useRef(null),b=pe(),y=re(x=>x.breakpoints.down("md")),h=y?"mobile":"desktop",C=yn(async()=>{const[x,T]=await Promise.all([u.api.getLauncherSession({input:{launcherSessionId:r,launcherUrl:e}}),pn({launcherUrl:e||Wi,nftDid:n,launcherSessionId:r,locale:l,theme:b.palette.mode})]);if(x?.error)throw new Error(x.error);return{launcherSession:x.launcherSession,subscriptionURL:T}},[l]);if(C.loading)return i.jsx(Q,{label:i.jsxs(H,{children:[!y&&c("expiration.desktop.loading"),i.jsx(V,{size:16})]}),variant:"success",sx:{cursor:"pointer",...s},...a,retention:o});if(C.error)return console.error(C.error),i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${h}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...s},...a,retention:o,onClick:()=>C.retry()});const v=x=>{p({popoverAnchorEl:x.currentTarget})},j=()=>{p({popoverAnchorEl:null})},g=C.value?.launcherSession;let E="success";[R.LAUNCH_SESSION_STATUS.overdue,R.LAUNCH_SESSION_STATUS.canceled,R.LAUNCH_SESSION_STATUS.terminated].includes(C.value?.launcherSession?.status)&&(E="error");let k=null;if(g.expirationDate&&!g.subscription){const x=te(g.expirationDate).diff(te(),"ms");k=c(`expiration.${h}.tips.${E}`,{validity:so(x,{locale:mn(l),compact:!0,verbose:!0})}),x>0&&x<=qi&&(E="warning")}return i.jsxs(i.Fragment,{children:[i.jsx(Q,{label:i.jsx(H,{children:k||g?.subscription?.product?.name||c("common.subscription")}),color:E,variant:E!=="success"?"contained":"outlined",sx:{cursor:"pointer",...s},...a,retention:o,onClick:v}),i.jsx(ln,{id:"popover-info",open:!!d.popoverAnchorEl,anchorEl:d.popoverAnchorEl,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"right"},sx:{"& .MuiPopover-paper":{minHeight:0}},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(I,{sx:{width:{xs:"360px",md:"450px"},display:"flex",flexDirection:"column"},children:i.jsx("iframe",{ref:f,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0,maxHeight:"800px"},src:C.value?.subscriptionURL})})})]})}io.propTypes={chainHost:S.string.isRequired,nftId:S.string,launcherSessionId:S.string,sx:S.object,retention:S.number,launcherUrl:S.string.isRequired};const Ki=30*24*60*60*1e3,Gi="https://launcher.arcblock.io/";function ao({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",sx:o={},retention:s=0,...a}){const{t:c,locale:l}=B(),[u,d]=vn({safeIframeRef:null,popoverAnchorEl:null}),p=m.useRef(null),f=re(x=>x.breakpoints.down("md")),b=ze(),y=f?"mobile":"desktop",h=yn(async()=>{const[x,T]=await Promise.all([b.api.getLauncherSession({input:{launcherSessionId:r||n,launcherUrl:e}}),pn({launcherUrl:e||Gi,nftDid:n,launcherSessionId:r,locale:l})]);if(x?.error)throw new Error(x.error);return{launcherSession:x.launcherSession,subscriptionURL:T}},[l]);if(h.loading)return i.jsx(Q,{label:i.jsxs(H,{children:[!f&&c("expiration.desktop.loading"),i.jsx(V,{size:16})]}),variant:"success",sx:{cursor:"pointer",...o},...a,retention:s});if(h.error)return console.error(h.error),i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${y}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...o},...a,retention:s,onClick:()=>h.retry()});const C=h.value?.launcherSession?.expirationDate,v=te(C).isBefore(te()),j=te(C).diff(te(),"ms");let g="success";j<=Ki&&(g="warning"),v&&(g="error");const E=x=>{d({popoverAnchorEl:x.currentTarget})},k=()=>{d({popoverAnchorEl:null})};return i.jsxs(i.Fragment,{children:[h.value?.launcherSession?.subscription&&i.jsx(Q,{label:i.jsx(H,{children:c("expiration.desktop.nextInvoice",{date:ir(C,l)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:E}),!h.value?.launcherSession?.subscription&&i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${y}.tips.${g}`,{validity:so(j,{locale:mn(l),compact:!0,verbose:!0})})}),color:g,variant:g!=="success"?"contained":"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:E}),i.jsx(ln,{id:"popover-info",open:!!u.popoverAnchorEl,anchorEl:u.popoverAnchorEl,onClose:k,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(I,{sx:{width:{xs:"360px",md:"450px"}},children:i.jsx("iframe",{ref:p,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0},src:h.value?.subscriptionURL})})})]})}ao.propTypes={chainHost:S.string.isRequired,nftId:S.string,launcherSessionId:S.string,sx:S.object,retention:S.number,launcherUrl:S.string.isRequired};function co({meta:e={},fallbackUrl:t=Ge,invalidPathFallback:n=null,headerAddons:r=void 0,sessionManagerProps:o={showRole:!0,onLogout:()=>{window.location.href=Ge}},links:s=[],showDomainWarningDialog:a=!0,...c}){ar();const l=m.use(cr)?.session?.user,u=l?.role,{locale:d}=B()||{},p=m.useMemo(()=>{const j=Object.assign({},window.blocklet,e);try{return lr(j)}catch(g){return console.error("Failed to format blocklet info",g,j),j}},[e]),{localizedNav:f,flattened:b,matchedIndex:y}=m.useMemo(()=>{let j=ur(p?.navigation?.dashboard,d)||[];j=dr(j,u),j=fr(j,k=>{let x=null;return k.icon&&(k.icon.startsWith("http")||k.icon.startsWith("data:")?x=i.jsx(on,{src:k.icon}):x=i.jsx("iconify-icon",{height:"100%",width:"100%",icon:k.icon})),{id:k.id,title:k.title,url:k.link,icon:x,external:!0,children:k.items}},"items");const g=pr(j).filter(k=>!!k.url),E=mr(g.map(k=>k.url));return E!==-1&&(g[E].active=!0),{localizedNav:j,flattened:g,matchedIndex:E}},[p,d,u]),h=typeof s=="function"?s(f):[...f,...s],C=hr({meta:e});if(m.useLayoutEffect(()=>{l&&!b?.length&&t&&(window.location.href=t)},[t]),m.useLayoutEffect(()=>{l&&b?.length&&y===-1&&n&&n()},[n,b,y]),!p.appName)return null;const{appName:v}=p;return i.jsx(Hr,{title:v,fullWidth:!0,sidebarWidth:128,legacy:!1,links:h,...c,headerProps:{homeLink:Ge,logo:i.jsx("img",{src:C,alt:"logo"}),addons:i.jsx(gr,{formattedBlocklet:p,addons:r,sessionManagerProps:o,showDomainWarningDialog:a}),...c.headerProps}})}co.propTypes={meta:xr,fallbackUrl:S.string,invalidPathFallback:S.func,headerAddons:S.oneOfType([S.func,S.node]),sessionManagerProps:br,links:S.oneOfType([S.array,S.func]),showDomainWarningDialog:S.bool};const Qi={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'},Zi="/.well-known/service/onboard/bind-account";function lo({onFinished:e=()=>{},show:t=!1,onChangeVisible:n=()=>{},loadingText:r="",defaultPath:o=Zi,...s}){const[a,c]=m.useState(t),[l,u]=m.useState(!1),[d,p]=m.useState(()=>{const g=localStorage.getItem("wizard-current-url");return g?.includes("/.well-known/service/onboard")?g:o}),f=m.useRef(e),b=m.useRef(),y=m.useRef(null),{locale:h}=B(),C=pe(),v=re(C.breakpoints.down("sm"));if(f.current=e,b.current=()=>{if(y.current?.contentWindow)try{const g=new URL(y.current.contentWindow.location.href).pathname;localStorage.setItem("wizard-current-url",g),p(g)}catch(g){p(o),console.warn("Failed to save wizard URL:",g)}localStorage.setItem("wizard-completed","true"),c(!1),n(!1)},m.useEffect(()=>{t!==a&&c(t)},[t]),m.useEffect(()=>{!a&&l&&u(!1)},[a]),m.useEffect(()=>{const g=E=>{if(E.origin!==window.location.origin)return;const{type:k,data:x}=E.data||{};switch(k){case"wizard.loaded":u(!0);break;case"wizard.finished":{c(!1),p(o),localStorage.removeItem("wizard-current-url"),localStorage.setItem("wizard-completed","true"),f.current?.(x);break}case"wizard.close":{b.current();break}}};return window.addEventListener("message",g),()=>{window.removeEventListener("message",g)}},[]),m.useEffect(()=>{localStorage.getItem("wizard-completed")||c(!0)},[]),!a)return null;const j=bn(W(window.location.origin,d),{locale:h});return i.jsxs(un,{id:"wizard-dialog",open:a,onClose:()=>b.current(),fullWidth:!0,maxWidth:v?!1:"md",fullScreen:v,...s,slotProps:Rr({},{paper:{sx:{margin:0,borderRadius:0,position:"relative",overflow:"hidden",...v?{borderRadius:0}:{borderRadius:1,height:"720px"}}}},s.slotProps),sx:{"& .MuiBackdrop-root":{backgroundColor:"rgba(0, 0, 0, 0.5)"},...s.sx},children:[i.jsx("iframe",{ref:y,id:"wizard-iframe",src:j,title:"Setup Wizard",style:{width:"100%",height:"100%",border:0,padding:0,margin:0,opacity:l?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>u(!0)}),l?null:i.jsx(I,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",bgcolor:"background.paper"},children:i.jsxs(I,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:1},children:[i.jsx(V,{}),typeof r=="string"?i.jsx(ee,{variant:"body1",children:r}):r]})})]})}lo.propTypes={onFinished:S.func,show:S.bool,onChangeVisible:S.func,loadingText:S.node,defaultPath:S.string,...un.propTypes};const Xi={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 21L21 6l-3-3L3 18l3 3m9-15l3 3M9 3a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2m10 10a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2"/>'};function Ji(){const{session:e}=hn(),[t,n]=m.useState(!1),[r,o]=m.useState(!1),{t:s}=B(),a=m.useMemo(()=>!!localStorage.getItem("wizard-finished"),[]);return m.useMemo(()=>e.user?.role&&gn.includes(e.user.role),[e])?i.jsxs(i.Fragment,{children:[i.jsx(de,{title:s("setup.wizardTooltip"),open:t,placement:"bottom",arrow:!0,children:i.jsx(Ne,{size:"small",onClick:()=>{o(!0),n(!1)},sx:{display:{xs:"none",md:"flex"},color:"text.secondary",...t&&{backgroundColor:"action.hover","@keyframes pulse":{"0%":{opacity:.8},"50%":{opacity:.5},"100%":{opacity:.8}},animation:"pulse 2s infinite"}},children:i.jsx(rn,{icon:Xi,height:20})})},`wizard-toggle-${t}`),i.jsx(lo,{show:r,loadingText:i.jsxs(I,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,mt:2,maxWidth:"80vw"},children:[i.jsx(Et,{variant:"h4",sx:{fontWeight:"bold"},children:s("setup.wizardLoading")}),!a&&i.jsx(Et,{variant:"body2",sx:{textAlign:"center"},children:s("setup.wizardSubTitle")})]}),slotProps:{paper:{sx:{height:{xs:"100vh",md:"750px"}}}},onChangeVisible:l=>{o(l),!l&&r&&n(!0)},onClose:void 0,onFinished:()=>{o(!1),n(!1)}},"wizard-modal")]}):null}function Yi(){const{inFullPage:e,toggleFullPage:t}=Wr();return L(Ne,{onClick:t,children:e?L(Go,{sx:{transform:"scale(1.3)"}}):L(Qo,{sx:{transform:"scale(1.3)"}})})}function uo({children:e=null,title:t=""}){const{t:n}=B(),{loading:r,error:o,actions:{refreshBlocklet:s},env:a,blocklet:c}=me(),{info:l,imgPrefix:u}=yr(),d=Yo(),p=re(E=>E.breakpoints.down("md")),f=pe(),{appId:b,version:y}=a,h=[{label:"App ID",value:b},{label:"App Version",value:y},{label:"App Bundle Name",value:c?.meta?.bundleName},{label:"Server Id",value:l.did},{label:"Server Version",value:l.version}],C=E=>{const k=Array.isArray(E)?E:[E];if(k.unshift(L(Ji,{})),p||k.unshift(L(Yi,{})),c){const x={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};wr(c)?k.unshift(L(io,{chainHost:c?.controller?.chainHost,nftId:c?.controller?.nftId,launcherSessionId:c?.controller?.launcherSessionId,launcherUrl:c?.controller?.launcherUrl,sx:x})):l.ownerNft&&l.launcher&&k.unshift(L(ao,{chainHost:l.launcher.chainHost,launcherUrl:l.launcher.url,nftId:l.ownerNft.did,launcherSessionId:l.ownerNft.launcherSessionId,sx:x}))}return k},v=zr({blocklet:c}),j={logo:v?L("img",{src:v,alt:"logo"}):null,brandAddon:L(I,{children:c&&ke(I,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,py:.5,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[L(de,{title:P.isRunning(c?.status)?void 0:n(`blocklet.status.${c?.status}`),children:L(I,{sx:{bgcolor:De[c?.status],width:8,height:8,borderRadius:"50%"}})}),L(I,{sx:{color:"text.secondary",maxWidth:p?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P.getDisplayName(c)}),L(I,{component:rn,icon:Qi,sx:{color:"text.secondary"}})]})})};return ke(ea,{legacy:!1,fullWidth:!0,headerAddons:C,headerProps:j,links:E=>E?.map(x=>(x.children=x.children?.map(T=>{if(T.id==="/team/aigne"){const O=u?W(u,"/aigne-hub.png"):"/aigne-hub.pg";return{...T,icon:L(on,{src:O,alt:"AIGNE Hub",style:f.palette.mode==="dark"?{filter:"invert(1)"}:{},fallback:T.icon})}}return T}),x)),title:t,footerProps:{addon:L(oo,{infos:h})},children:[!c&&r&&L(Ae,{relative:"parent",children:L(V,{})}),!c&&o&&ke(Ae,{relative:"parent",children:[ke(I,{sx:{display:"flex",alignItems:"center"},children:[L(Ko,{color:"error",sx:{marginRight:1}}),bt(o)]}),L(ht,{onClick:()=>s(),children:L("span",{style:{textDecoration:"underline"},children:n("common.retry")})})]}),!!c&&L(I,{sx:{flex:1,padding:p?2:3,display:"flex",flexDirection:"column"},children:L(jo,{FallbackComponent:vr,resetKeys:[d.pathname],children:e})})]})}uo.propTypes={children:S.any,title:S.string};const ea=Ue(co)`
52
+ `),T(E,{sx:{mx:{xs:0,md:2}},children:T(_e,{sx:{color:"text.primary"},target:"_blank",href:n.href,rel:"noreferrer",style:{textDecoration:"underline"},children:t("common.reportIssue")})})}oo.propTypes={infos:S.arrayOf(S.shape({label:S.string,value:S.string}))};var Je,Qt;function Bi(){return Qt||(Qt=1,Je={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"}}),Je}var Ye,Zt;function zi(){return Zt||(Zt=1,Ye={year:{long:"年",short:"年"},day:{long:"天",short:"天"},hour:{long:"小时",short:"小时"},minute:{long:"分钟",short:"分"},second:{long:"秒钟",short:"秒"},millisecond:{long:"毫秒",short:"毫秒"},microsecond:{long:"微秒",short:"微秒"},nanosecond:{long:"纳秒",short:"纳秒"}}),Ye}var et,Xt;function ro(){if(Xt)return et;Xt=1;const e=new Map;return et={registerLang:(r,o)=>{e.set(r,o)},getLang:(r="en_US")=>e.get(r)||e.get("en_US")},et}var tt,Jt;function $i(){return Jt||(Jt=1,tt=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}}),tt}var nt,Yt;function Fi(){if(Yt)return nt;Yt=1;const e=$i(),{getLang:t}=ro(),n=(o,s)=>s===1?o:`${o}s`,r=1e-7;return nt=(o,s={})=>{if(!Number.isFinite(o))throw new TypeError("Expected a finite number");s.colonNotation&&(s.compact=!1,s.formatSubMilliseconds=!1,s.separateMilliseconds=!1,s.verbose=!1),s.compact&&(s.secondsDecimalDigits=0,s.millisecondsDecimalDigits=0);const a=t(s.locale),c=[],l=(p,f)=>{const x=Math.floor(p*10**f+r);return(Math.round(x)/10**f).toFixed(f)},u=(p,f,x)=>{if((c.length===0||!s.colonNotation)&&p===0&&!(s.colonNotation&&f==="minute"))return;const{long:y}=a[f]||t("en_US")[f],{short:b}=a[f]||t("en_US")[f];let j=(x||p||"0").toString(),v,C;if(s.colonNotation){v=c.length>0?":":"",C="";const g=j.includes(".")?j.split(".")[0].length:j.length,k=c.length>0?2:1;j="0".repeat(Math.max(0,k-g))+j}else v="",s.locale==="zh_CN"?Object.values(d).filter(g=>g>0).length>1?!d.days&&!d.hours&&d.minutes&&s.compact?C=y:C=b:d.minutes?C=y:C=b:C=s.verbose?` ${n(y,p)}`:b;c.push(v+j+C)},d=e(o);if(u(Math.trunc(d.days/365),"year"),u(d.days%365,"day"),u(d.hours,"hour"),u(d.minutes,"minute"),s.separateMilliseconds||s.formatSubMilliseconds||!s.colonNotation&&o<1e3)if(u(d.seconds,"second"),s.formatSubMilliseconds)u(d.milliseconds,"millisecond"),u(d.microseconds,"microsecond"),u(d.nanoseconds,"nanosecond");else{const p=d.milliseconds+d.microseconds/1e3+d.nanoseconds/1e6,f=typeof s.millisecondsDecimalDigits=="number"?s.millisecondsDecimalDigits:0,x=p>=1?Math.round(p):Math.ceil(p),y=f?p.toFixed(f):x;u(Number.parseFloat(y,10),"millisecond",y)}else{const p=o/1e3%60,f=typeof s.secondsDecimalDigits=="number"?s.secondsDecimalDigits:1,x=l(p,f),y=s.keepDecimalsOnWholeSeconds?x:x.replace(/\.0+$/,"");u(Number.parseFloat(y,10),"second",y)}if(c.length===0){const p=(a.millisecond||t("en_US").millisecond).long,f=(a.millisecond||t("en_US").millisecond).short;return s.locale==="zh_CN"?`0${s.verbose?`${p}`:f}`:`0${s.verbose?` ${p}s`:f}`}if(s.compact)return c[0];if(typeof s.unitCount=="number"){const p=s.colonNotation?"":" ";return c.slice(0,Math.max(s.unitCount,1)).join(p)}return s.colonNotation?c.join(""):c.join(" ")},nt}var ot,en;function Vi(){if(en)return ot;en=1;const e=Bi(),t=zi(),{registerLang:n}=ro(),r=Fi();return n("en_US",e),n("zh_CN",t),r.registerLang=n,ot=r,ot}var Hi=Vi();const so=Jo(Hi);function H({children:e}){return re(n=>n.breakpoints.down("md"))?i.jsx(de,{enterDelay:500,leaveDelay:2e3,title:typeof e=="string"?e:"",children:i.jsx(E,{sx:{display:"flex",alignItems:"center",gap:1},children:i.jsx(Lt,{fontSize:"small"})})}):i.jsxs(E,{sx:{display:"flex",alignItems:"center",gap:1},children:[i.jsx(Lt,{fontSize:"small"}),e]})}H.propTypes={children:S.node.isRequired};const Wi="https://launcher.arcblock.io/",qi=30*24*60*60*1e3;function io({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",retention:o=0,sx:s={},...a}){const{t:c,locale:l}=B(),u=ze(),[d,p]=vn({safeIframeRef:null,popoverAnchorEl:null}),f=h.useRef(null),x=pe(),y=re(m=>m.breakpoints.down("md")),b=y?"mobile":"desktop",j=yn(async()=>{const[m,I]=await Promise.all([u.api.getLauncherSession({input:{launcherSessionId:r,launcherUrl:e}}),pn({launcherUrl:e||Wi,nftDid:n,launcherSessionId:r,locale:l,theme:x.palette.mode})]);if(m?.error)throw new Error(m.error);return{launcherSession:m.launcherSession,subscriptionURL:I}},[l]);if(j.loading)return i.jsx(Q,{label:i.jsxs(H,{children:[!y&&c("expiration.desktop.loading"),i.jsx(V,{size:16})]}),variant:"success",sx:{cursor:"pointer",...s},...a,retention:o});if(j.error)return console.error(j.error),i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${b}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...s},...a,retention:o,onClick:()=>j.retry()});const v=m=>{p({popoverAnchorEl:m.currentTarget})},C=()=>{p({popoverAnchorEl:null})},g=j.value?.launcherSession;let k="success";[R.LAUNCH_SESSION_STATUS.overdue,R.LAUNCH_SESSION_STATUS.canceled,R.LAUNCH_SESSION_STATUS.terminated].includes(j.value?.launcherSession?.status)&&(k="error");let _=null;if(g.expirationDate&&!g.subscription){const m=te(g.expirationDate).diff(te(),"ms");_=c(`expiration.${b}.tips.${k}`,{validity:so(m,{locale:mn(l),compact:!0,verbose:!0})}),m>0&&m<=qi&&(k="warning")}return i.jsxs(i.Fragment,{children:[i.jsx(Q,{label:i.jsx(H,{children:_||g?.subscription?.product?.name||c("common.subscription")}),color:k,variant:k!=="success"?"contained":"outlined",sx:{cursor:"pointer",...s},...a,retention:o,onClick:v}),i.jsx(ln,{id:"popover-info",open:!!d.popoverAnchorEl,anchorEl:d.popoverAnchorEl,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},sx:{"& .MuiPopover-paper":{minHeight:0}},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(E,{sx:{width:{xs:"360px",md:"450px"},display:"flex",flexDirection:"column"},children:i.jsx("iframe",{ref:f,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0,maxHeight:"800px"},src:j.value?.subscriptionURL})})})]})}io.propTypes={chainHost:S.string.isRequired,nftId:S.string,launcherSessionId:S.string,sx:S.object,retention:S.number,launcherUrl:S.string.isRequired};const Ki=30*24*60*60*1e3,Gi="https://launcher.arcblock.io/";function ao({launcherUrl:e,chainHost:t,nftId:n="",launcherSessionId:r="",sx:o={},retention:s=0,...a}){const{t:c,locale:l}=B(),[u,d]=vn({safeIframeRef:null,popoverAnchorEl:null}),p=h.useRef(null),f=re(m=>m.breakpoints.down("md")),x=ze(),y=f?"mobile":"desktop",b=yn(async()=>{const[m,I]=await Promise.all([x.api.getLauncherSession({input:{launcherSessionId:r||n,launcherUrl:e}}),pn({launcherUrl:e||Gi,nftDid:n,launcherSessionId:r,locale:l})]);if(m?.error)throw new Error(m.error);return{launcherSession:m.launcherSession,subscriptionURL:I}},[l]);if(b.loading)return i.jsx(Q,{label:i.jsxs(H,{children:[!f&&c("expiration.desktop.loading"),i.jsx(V,{size:16})]}),variant:"success",sx:{cursor:"pointer",...o},...a,retention:s});if(b.error)return console.error(b.error),i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${y}.loadFailed`)}),color:"error",variant:"success",sx:{cursor:"pointer",...o},...a,retention:s,onClick:()=>b.retry()});const j=b.value?.launcherSession?.expirationDate,v=te(j).isBefore(te()),C=te(j).diff(te(),"ms");let g="success";C<=Ki&&(g="warning"),v&&(g="error");const k=m=>{d({popoverAnchorEl:m.currentTarget})},_=()=>{d({popoverAnchorEl:null})};return i.jsxs(i.Fragment,{children:[b.value?.launcherSession?.subscription&&i.jsx(Q,{label:i.jsx(H,{children:c("expiration.desktop.nextInvoice",{date:ir(j,l)})}),color:"success",variant:"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:k}),!b.value?.launcherSession?.subscription&&i.jsx(Q,{label:i.jsx(H,{children:c(`expiration.${y}.tips.${g}`,{validity:so(C,{locale:mn(l),compact:!0,verbose:!0})})}),color:g,variant:g!=="success"?"contained":"outlined",sx:{cursor:"pointer",...o},...a,retention:s,onClick:k}),i.jsx(ln,{id:"popover-info",open:!!u.popoverAnchorEl,anchorEl:u.popoverAnchorEl,onClose:_,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:i.jsx(E,{sx:{width:{xs:"360px",md:"450px"}},children:i.jsx("iframe",{ref:p,title:c("common.subscription"),width:"100%",height:"600px",style:{border:0},src:b.value?.subscriptionURL})})})]})}ao.propTypes={chainHost:S.string.isRequired,nftId:S.string,launcherSessionId:S.string,sx:S.object,retention:S.number,launcherUrl:S.string.isRequired};function co({meta:e={},fallbackUrl:t=Ge,invalidPathFallback:n=null,headerAddons:r=void 0,sessionManagerProps:o={showRole:!0,onLogout:()=>{window.location.href=Ge}},links:s=[],showDomainWarningDialog:a=!0,...c}){ar();const l=h.use(cr)?.session?.user,u=l?.role,{locale:d,defaultLocale:p}=B()||{},f=h.useMemo(()=>{const g=Object.assign({},window.blocklet,e);try{return lr(g)}catch(k){return console.error("Failed to format blocklet info",k,g),g}},[e]),{localizedNav:x,flattened:y,matchedIndex:b}=h.useMemo(()=>{let g=ur({navigation:f?.navigation?.dashboard,locale:d,defaultLocale:p})||[];g=dr(g,u),g=fr(g,m=>{let I=null;return m.icon&&(m.icon.startsWith("http")||m.icon.startsWith("data:")?I=i.jsx(on,{src:m.icon}):I=i.jsx("iconify-icon",{height:"100%",width:"100%",icon:m.icon})),{id:m.id,title:m.title,url:m.link,icon:I,external:!0,children:m.items}},"items");const k=pr(g).filter(m=>!!m.url),_=mr(k.map(m=>m.url));return _!==-1&&(k[_].active=!0),{localizedNav:g,flattened:k,matchedIndex:_}},[f,d,p,u]),j=typeof s=="function"?s(x):[...x,...s],v=hr({meta:e});if(h.useLayoutEffect(()=>{l&&!y?.length&&t&&(window.location.href=t)},[t]),h.useLayoutEffect(()=>{l&&y?.length&&b===-1&&n&&n()},[n,y,b]),!f.appName)return null;const{appName:C}=f;return i.jsx(Hr,{title:C,fullWidth:!0,sidebarWidth:128,legacy:!1,links:j,...c,headerProps:{homeLink:Ge,logo:i.jsx("img",{src:v,alt:"logo"}),addons:i.jsx(gr,{formattedBlocklet:f,addons:r,sessionManagerProps:o,showDomainWarningDialog:a}),...c.headerProps}})}co.propTypes={meta:xr,fallbackUrl:S.string,invalidPathFallback:S.func,headerAddons:S.oneOfType([S.func,S.node]),sessionManagerProps:br,links:S.oneOfType([S.array,S.func]),showDomainWarningDialog:S.bool};const Qi={width:24,height:24,body:'<path fill="currentColor" d="M6.4 18L5 16.6L14.6 7H6V5h12v12h-2V8.4L6.4 18Z"/>'},Zi="/.well-known/service/onboard/bind-account";function lo({onFinished:e=()=>{},show:t=!1,onChangeVisible:n=()=>{},loadingText:r="",defaultPath:o=Zi,...s}){const[a,c]=h.useState(t),[l,u]=h.useState(!1),[d,p]=h.useState(()=>{const g=localStorage.getItem("wizard-current-url");return g?.includes("/.well-known/service/onboard")?g:o}),f=h.useRef(e),x=h.useRef(),y=h.useRef(null),{locale:b}=B(),j=pe(),v=re(j.breakpoints.down("sm"));if(f.current=e,x.current=()=>{if(y.current?.contentWindow)try{const g=new URL(y.current.contentWindow.location.href).pathname;localStorage.setItem("wizard-current-url",g),p(g)}catch(g){p(o),console.warn("Failed to save wizard URL:",g)}localStorage.setItem("wizard-completed","true"),c(!1),n(!1)},h.useEffect(()=>{t!==a&&c(t)},[t]),h.useEffect(()=>{!a&&l&&u(!1)},[a]),h.useEffect(()=>{const g=k=>{if(k.origin!==window.location.origin)return;const{type:_,data:m}=k.data||{};switch(_){case"wizard.loaded":u(!0);break;case"wizard.finished":{c(!1),p(o),localStorage.removeItem("wizard-current-url"),localStorage.setItem("wizard-completed","true"),f.current?.(m);break}case"wizard.close":{x.current();break}}};return window.addEventListener("message",g),()=>{window.removeEventListener("message",g)}},[]),h.useEffect(()=>{localStorage.getItem("wizard-completed")||c(!0)},[]),!a)return null;const C=bn(W(window.location.origin,d),{locale:b});return i.jsxs(un,{id:"wizard-dialog",open:a,onClose:()=>x.current(),fullWidth:!0,maxWidth:v?!1:"md",fullScreen:v,...s,slotProps:Rr({},{paper:{sx:{margin:0,borderRadius:0,position:"relative",overflow:"hidden",...v?{borderRadius:0}:{borderRadius:1,height:"720px"}}}},s.slotProps),sx:{"& .MuiBackdrop-root":{backgroundColor:"rgba(0, 0, 0, 0.5)"},...s.sx},children:[i.jsx("iframe",{ref:y,id:"wizard-iframe",src:C,title:"Setup Wizard",style:{width:"100%",height:"100%",border:0,padding:0,margin:0,opacity:l?1:0,transition:"opacity 0.3s ease-in-out"},onLoad:()=>u(!0)}),l?null:i.jsx(E,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",bgcolor:"background.paper"},children:i.jsxs(E,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:1},children:[i.jsx(V,{}),typeof r=="string"?i.jsx(ee,{variant:"body1",children:r}):r]})})]})}lo.propTypes={onFinished:S.func,show:S.bool,onChangeVisible:S.func,loadingText:S.node,defaultPath:S.string,...un.propTypes};const Xi={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 21L21 6l-3-3L3 18l3 3m9-15l3 3M9 3a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2m10 10a2 2 0 0 0 2 2a2 2 0 0 0-2 2a2 2 0 0 0-2-2a2 2 0 0 0 2-2"/>'};function Ji(){const{session:e}=hn(),[t,n]=h.useState(!1),[r,o]=h.useState(!1),{t:s}=B(),a=h.useMemo(()=>!!localStorage.getItem("wizard-finished"),[]);return h.useMemo(()=>e.user?.role&&gn.includes(e.user.role),[e])?i.jsxs(i.Fragment,{children:[i.jsx(de,{title:s("setup.wizardTooltip"),open:t,placement:"bottom",arrow:!0,children:i.jsx(Ne,{size:"small",onClick:()=>{o(!0),n(!1)},sx:{display:{xs:"none",md:"flex"},color:"text.secondary",...t&&{backgroundColor:"action.hover","@keyframes pulse":{"0%":{opacity:.8},"50%":{opacity:.5},"100%":{opacity:.8}},animation:"pulse 2s infinite"}},children:i.jsx(rn,{icon:Xi,height:20})})},`wizard-toggle-${t}`),i.jsx(lo,{show:r,loadingText:i.jsxs(E,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:1,mt:2,maxWidth:"80vw"},children:[i.jsx(Et,{variant:"h4",sx:{fontWeight:"bold"},children:s("setup.wizardLoading")}),!a&&i.jsx(Et,{variant:"body2",sx:{textAlign:"center"},children:s("setup.wizardSubTitle")})]}),slotProps:{paper:{sx:{height:{xs:"100vh",md:"750px"}}}},onChangeVisible:l=>{o(l),!l&&r&&n(!0)},onClose:void 0,onFinished:()=>{o(!1),n(!1)}},"wizard-modal")]}):null}function Yi(){const{inFullPage:e,toggleFullPage:t}=Wr();return T(Ne,{onClick:t,children:e?T(Go,{sx:{transform:"scale(1.3)"}}):T(Qo,{sx:{transform:"scale(1.3)"}})})}function uo({children:e=null,title:t=""}){const{t:n}=B(),{loading:r,error:o,actions:{refreshBlocklet:s},env:a,blocklet:c}=me(),{info:l,imgPrefix:u}=yr(),d=Yo(),p=re(k=>k.breakpoints.down("md")),f=pe(),{appId:x,version:y}=a,b=[{label:"App ID",value:x},{label:"App Version",value:y},{label:"App Bundle Name",value:c?.meta?.bundleName},{label:"Server Id",value:l.did},{label:"Server Version",value:l.version}],j=k=>{const _=Array.isArray(k)?k:[k];if(_.unshift(T(Ji,{})),p||_.unshift(T(Yi,{})),c){const m={cursor:"pointer",marginRight:{xs:"8px",md:"48px"}};wr(c)?_.unshift(T(io,{chainHost:c?.controller?.chainHost,nftId:c?.controller?.nftId,launcherSessionId:c?.controller?.launcherSessionId,launcherUrl:c?.controller?.launcherUrl,sx:m})):l.ownerNft&&l.launcher&&_.unshift(T(ao,{chainHost:l.launcher.chainHost,launcherUrl:l.launcher.url,nftId:l.ownerNft.did,launcherSessionId:l.ownerNft.launcherSessionId,sx:m}))}return _},v=zr({blocklet:c}),C={logo:v?T("img",{src:v,alt:"logo"}):null,brandAddon:T(E,{children:c&&ke(E,{component:"a",target:"_blank",href:window.blocklet.appUrl,rel:"noopener noreferrer",title:window.blocklet.appName,sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,py:.5,px:2,border:"1px solid",borderColor:"text.disabled",borderRadius:"30px",cursor:"pointer"},children:[T(de,{title:P.isRunning(c?.status)?void 0:n(`blocklet.status.${c?.status}`),children:T(E,{sx:{bgcolor:De[c?.status],width:8,height:8,borderRadius:"50%"}})}),T(E,{sx:{color:"text.secondary",maxWidth:p?66:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:P.getDisplayName(c)}),T(E,{component:rn,icon:Qi,sx:{color:"text.secondary"}})]})})};return ke(ea,{legacy:!1,fullWidth:!0,headerAddons:j,headerProps:C,links:k=>k?.map(m=>(m.children=m.children?.map(I=>{if(I.id==="/team/aigne"){const O=u?W(u,"/aigne-hub.png"):"/aigne-hub.pg";return{...I,icon:T(on,{src:O,alt:"AIGNE Hub",style:f.palette.mode==="dark"?{filter:"invert(1)"}:{},fallback:I.icon})}}return I}),m)),title:t,footerProps:{addon:T(oo,{infos:b})},children:[!c&&r&&T(Ae,{relative:"parent",children:T(V,{})}),!c&&o&&ke(Ae,{relative:"parent",children:[ke(E,{sx:{display:"flex",alignItems:"center"},children:[T(Ko,{color:"error",sx:{marginRight:1}}),bt(o)]}),T(ht,{onClick:()=>s(),children:T("span",{style:{textDecoration:"underline"},children:n("common.retry")})})]}),!!c&&T(E,{sx:{flex:1,padding:p?2:3,display:"flex",flexDirection:"column"},children:T(jo,{FallbackComponent:vr,resetKeys:[d.pathname],children:e})})]})}uo.propTypes={children:S.any,title:S.string};const ea=Ue(co)`
53
53
  div.dashboard-content {
54
54
  padding: 0;
55
55
  }
@@ -61,7 +61,7 @@ ${r}
61
61
  .header-brand-addon {
62
62
  display: block;
63
63
  }
64
- `;function ta(){const{t:e,locale:t}=B(),{blocklet:n,launcherSession:r,refreshSubscription:o}=me(),{connectApi:s,session:a,api:c}=hn(),[l,u]=m.useState(!1),[d,p]=m.useState(""),[f,b]=Or({subscriptionURL:"#"});if(m.useEffect(()=>{(Dt(n,r)||At(r))&&Sr({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(v=>{b({subscriptionURL:v})}).catch(v=>{console.error("get subscription url error:",v)})},[n,r]),m.useEffect(()=>{if(n.controller?.launcherUrl){const v=W(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(v).then(j=>j.json()).then(j=>{const g=j.componentMountPoints?.find(k=>k.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,E=W(n.controller.launcherUrl,g);p(E)})}},[n.controller?.launcherUrl]),!n||!r)return"";let y=null,h="",C="error";return jr(r)?(y=Cr(r)?i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):i.jsx(Zo,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),h=e("blocklet.suspendedCausedByPastDue",{deadline:ie(r?.reservedUntil,t)})):At(r)?(y=i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.willBeSuspendedSoon",{deadline:ie((r?.subscription?.cancel_at||0)*1e3,t)}),C="warning"):Dt(n,r)?(y=i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),h=e("blocklet.suspendedCausedByExpired",{deadline:ie(r?.reservedUntil,t),canceledAt:ie((r?.subscription?.canceled_at||0)*1e3,t)})):kr(n,r)&&(y=i.jsx(dn,{to:W(R.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),h=e("blocklet.suspendedCausedByTerminated",{canceledAt:ie(r?.terminatedAt,t),deadline:Er(r?.terminatedAt,t)})),h?i.jsxs(i.Fragment,{children:[i.jsxs(gt,{severity:C,sx:{mb:1},children:[h,i.jsx(ee,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:y})]}),l&&d&&r&&i.jsx(Ir,{session:a,connect:s,baseUrl:d,authToken:r.subscription.authToken,children:i.jsx(qr,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}const na=m.lazy(()=>_(()=>import("./log-BgOBDKaO.js"),__vite__mapDeps([0,1]),import.meta.url)),oa=m.lazy(()=>_(()=>import("./index-CGC3omja.js"),__vite__mapDeps([0,1]),import.meta.url)),ra=m.lazy(()=>_(()=>import("./index-dAVnNC1I.js"),__vite__mapDeps([0,1]),import.meta.url)),sa=m.lazy(()=>_(()=>import("./index-Oj4fYD5K.js"),__vite__mapDeps([0,1,2]),import.meta.url)),ia=m.lazy(()=>_(()=>import("./overview-BNptGAD0.js"),__vite__mapDeps([0,1]),import.meta.url)),aa=m.lazy(()=>_(()=>import("./domains-BwpVswVc.js"),__vite__mapDeps([0,1]),import.meta.url)),ca=m.lazy(()=>_(()=>import("./index-6KFpxb0K.js"),__vite__mapDeps([0,1]),import.meta.url)),la=m.lazy(()=>_(()=>import("./appearance-DiUMtWiZ.js"),__vite__mapDeps([0,1]),import.meta.url)),ua=m.lazy(()=>_(()=>import("./audit-logs-zMqI7X3o.js"),__vite__mapDeps([0,1,2]),import.meta.url)),da=m.lazy(()=>_(()=>import("./index-Y3X8f7Z4.js"),__vite__mapDeps([0,1]),import.meta.url)),fa=m.lazy(()=>_(()=>import("./config-navigation-CpkTSVgC.js"),__vite__mapDeps([0,1]),import.meta.url)),pa=m.lazy(()=>_(()=>import("./index-BH9BMLP2.js"),__vite__mapDeps([0,1]),import.meta.url)),ma=m.lazy(()=>_(()=>import("./index-De6RU5uv.js"),__vite__mapDeps([0,1]),import.meta.url)),ha=m.lazy(()=>_(()=>import("./security-BlvbBEUe.js"),__vite__mapDeps([0,1]),import.meta.url)),ga=m.lazy(()=>_(()=>import("./branding-BqZaDEQy.js"),__vite__mapDeps([0,1]),import.meta.url)),ba=m.lazy(()=>_(()=>import("./advanced-D4kyySFu.js"),__vite__mapDeps([0,1]),import.meta.url)),xa=m.lazy(()=>_(()=>import("./traffic-CwvEJLQW.js").then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url)),ya=m.lazy(()=>_(()=>import("./runtime-zSSdjk9Q.js"),__vite__mapDeps([0,1]),import.meta.url)),va=m.lazy(()=>_(()=>import("./index-DYxM5dQ0.js"),__vite__mapDeps([0,1]),import.meta.url)),wa=m.lazy(()=>_(()=>import("./list-4bMHptVO.js"),__vite__mapDeps([0,1]),import.meta.url)),Sa=m.lazy(()=>_(()=>import("./index-Difo-vx2.js"),__vite__mapDeps([0,1]),import.meta.url)),ja=m.lazy(()=>_(()=>import("./config-C6P5yz_l.js").then(e=>e.c),__vite__mapDeps([0,1]),import.meta.url)),Ca=m.lazy(()=>_(()=>import("./observability-pdEZhjSl.js"),[],import.meta.url)),ka=m.lazy(()=>_(()=>import("./playground-C0bWoIDS.js"),[],import.meta.url)),Ea=m.lazy(()=>_(()=>import("./index-BAm_yZT8.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url)),Ia=m.lazy(()=>_(()=>import("./component-BkgYdhLW.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),_a=m.lazy(()=>_(()=>import("./index--2eh3YdI.js"),__vite__mapDeps([0,1]),import.meta.url)),Ta=W(R.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),La=e=>{const{enqueueSnackbar:t}=nn(),n=m.useCallback(r=>bn(Ta,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);Lr(`${e}/${R.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const o=n(r),{severity:s,description:a}=r||{},c=["error","warning"].includes(s)||r.sticky;r.source==="system"&&t(a,{variant:s,autoHideDuration:c?null:5e3,content:l=>i.jsx(cs,{viewAllUrl:o,keyId:l,notification:r,content:i.jsx(Fr,{notification:r,minimal:!0,rows:0})})})},[],"user")};function fo({blocklet:e,isAdmin:t}){return t?i.jsx(da,{blocklet:e}):i.jsx(Ar,{status:403})}fo.propTypes={blocklet:S.object.isRequired,isAdmin:S.bool.isRequired};const Da=e=>{const{t}=B(),{blocklet:n,actions:{refreshBlocklet:r},client:o,did:s}=me(),a=ne(()=>Mr(n,"settings.org.enabled",!1),[n]),c=n?.meta?.did,l=!n||Dr(n.status)?[]:P.getAppMissingConfigs(n),u={overview:[{label:t("common.overview"),value:"overview"},{label:i.jsx(Xo,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!l.length,children:t("common.components")}),labelText:t("common.components"),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},a?{label:t("common.orgs"),value:"orgs"}:null,{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"}].filter(Boolean),aigne:[{label:t("setup.aigne.config"),value:"aigne-config"}],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:n?.children?.length&&n.structVersion===R.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},d={overview:ia,components:Ia,members:i.jsx(oa,{type:"blocklet",createPassportSvg:Ot}),passports:i.jsx(ca,{createPassportSvg:Ot}),orgs:i.jsx(Ea,{editable:!1,mode:"dashboard",layout:"table"}),settings:i.jsx(ma,{orientation:"vertical"}),security:i.jsx(ha,{}),"did-spaces":i.jsx(pa,{navOrientation:"horizontal"}),domains:aa,branding:i.jsx(ga,{blocklet:n,onUpdate:r}),theming:i.jsx(la,{}),navigation:fa,sitemap:i.jsx(ko,{children:t("common.comingSoon")}),notifications:i.jsx(fo,{blocklet:n,isAdmin:e}),"audit-logs":i.jsx(ua,{scope:c,categories:["blocklet","team","security","certificates","gateway"]}),analytics:i.jsx(xa,{client:o,did:s}),advanced:i.jsx(ba,{blocklet:n,onUpdate:r}),webhooks:i.jsx(ra,{}),"access-keys":i.jsx(va,{}),"mcp-servers":i.jsx(Sa,{}),logs:na,performance:i.jsx(ya,{client:o,did:s}),docs:_a,publish:i.jsx(sa,{}),oauth:i.jsx(wa,{}),"aigne-config":i.jsx(I,{sx:{maxWidth:1536},children:i.jsx(ja,{})}),"aigne-observability":i.jsx(Ca,{}),"aigne-playground":i.jsx(ka,{})};return{tabGroups:u,renders:d}};function Aa(){const e=fn(),{tab:t="overview",subtab:n}=er(),{locale:r}=B(),{blocklet:o,refreshFlag:s}=me(),{session:a}=xn(),c=ne(()=>a?.user?.did,[a]),l=Kr(),u=ne(()=>a.user?.role&&gn.includes(a.user.role),[a]);La(c);const{tabGroups:d,renders:p}=Da(u),f=g=>{e(`${R.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${g}`)},b=(d[t]||[]).filter(g=>g.show===void 0||g.show),y=(b||[]).find(g=>g.value===n)?.value||b?.[0]?.value||t,h=p[y]||p.overview,C=["overview"].includes(t),v=o?i.jsxs(Sn,{type:"components",children:[b.length>0&&i.jsxs(I,{sx:{mb:2,display:"flex",alignItems:"center",gap:2},children:[i.jsx(Co,{tabs:b,current:y,onChange:f,scrollButtons:"auto"}),C&&!l&&i.jsx(I,{sx:{flex:1,display:"flex",justifyContent:"flex-end"},children:i.jsx(I,{component:"div",className:"page-header",children:o?i.jsx(Ut,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:g}={})=>{g&&F.error(g.message)},variant:"group"}):null})})]}),i.jsx(I,{className:"page-content",children:i.jsx(m.Suspense,{fallback:i.jsx(Ae,{relative:"parent",children:i.jsx(V,{})}),children:m.isValidElement(h)?h:i.jsx(h,{blocklet:o})})})]}):i.jsx(Ae,{relative:"parent",children:i.jsx(V,{})}),j=ne(()=>{const g=window.blocklet?.navigation?.find(M=>M.id==="/team"&&M.section==="dashboard"),E=o?.meta?.title||"";let k="";if(g){const M=W(R.WELLKNOWN_BLOCKLET_ADMIN_PATH,t,t==="publish"?n:"");k=g.items.find(We=>We.link===M)?.title?.[r]||""}const x=b.find(M=>M.value===n),O=[x?.labelText||x?.label||b?.[0]?.labelText||b?.[0]?.label||"",k].filter(Boolean).join(" - ");return E?O?`${O} | ${E}`:E:O||""},[t,n,o,r]);return i.jsx(Tr,{children:i.jsx($r,{children:i.jsx(uo,{title:j,children:i.jsxs(Ra,{children:[l&&C&&i.jsx(I,{component:"div",className:"page-header",sx:{mb:2},children:o?i.jsx(Ut,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:g}={})=>{g&&F.error(g.message)},variant:"group"}):null}),i.jsx(es,{}),i.jsx(ta,{}),v]})},`${s}`)})})}function Pa(){const{blocklet:e}=me(),t=e?.meta?.did;return m.useEffect(()=>{const n=_r();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(Aa,{})}const Ra=Ue.main`
64
+ `;function ta(){const{t:e,locale:t}=B(),{blocklet:n,launcherSession:r,refreshSubscription:o}=me(),{connectApi:s,session:a,api:c}=hn(),[l,u]=h.useState(!1),[d,p]=h.useState(""),[f,x]=Or({subscriptionURL:"#"});if(h.useEffect(()=>{(Dt(n,r)||At(r))&&Sr({launcherSessionId:n?.controller?.launcherSessionId,launcherUrl:n?.controller?.launcherUrl,locale:t}).then(v=>{x({subscriptionURL:v})}).catch(v=>{console.error("get subscription url error:",v)})},[n,r]),h.useEffect(()=>{if(n.controller?.launcherUrl){const v=W(n.controller.launcherUrl,"__blocklet__.js?type=json");fetch(v).then(C=>C.json()).then(C=>{const g=C.componentMountPoints?.find(_=>_.did==="z2qaCNvKMv5GjouKdcDWexv6WqtHbpNPQDnAk")?.mountPoint,k=W(n.controller.launcherUrl,g);p(k)})}},[n.controller?.launcherUrl]),!n||!r)return"";let y=null,b="",j="error";return jr(r)?(y=Cr(r)?i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}):i.jsx(Zo,{variant:"text",color:"error",onClick:()=>u(!0),sx:{lineHeight:"inherit",fontSize:"inherit"},children:e("blocklet.payNow")}),b=e("blocklet.suspendedCausedByPastDue",{deadline:ie(r?.reservedUntil,t)})):At(r)?(y=i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),b=e("blocklet.willBeSuspendedSoon",{deadline:ie((r?.subscription?.cancel_at||0)*1e3,t)}),j="warning"):Dt(n,r)?(y=i.jsx(_e,{href:f.subscriptionURL,children:e("blocklet.manageSubscription")}),b=e("blocklet.suspendedCausedByExpired",{deadline:ie(r?.reservedUntil,t),canceledAt:ie((r?.subscription?.canceled_at||0)*1e3,t)})):kr(n,r)&&(y=i.jsx(dn,{to:W(R.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/did-spaces"),children:e("common.backup")}),b=e("blocklet.suspendedCausedByTerminated",{canceledAt:ie(r?.terminatedAt,t),deadline:Er(r?.terminatedAt,t)})),b?i.jsxs(i.Fragment,{children:[i.jsxs(gt,{severity:j,sx:{mb:1},children:[b,i.jsx(ee,{sx:{display:"inline-block",fontSize:"inherit",lineHeight:"inherit",ml:1,a:{textDecoration:"auto"},"& .MuiButtonBase-root":{p:0,minWidth:"auto"}},children:y})]}),l&&d&&r&&i.jsx(Ir,{session:a,connect:s,baseUrl:d,authToken:r.subscription.authToken,children:i.jsx(qr,{dialogProps:{open:l,onClose:()=>u(!1)},subscriptionId:r.subscription.id,successToast:!0,onPaid:()=>{c.post("/blocklet/start?fromSetup=1"),o(),u(!1)}})})]}):null}const na=h.lazy(()=>L(()=>import("./log-CcKk7QZL.js"),__vite__mapDeps([0,1]),import.meta.url)),oa=h.lazy(()=>L(()=>import("./index-Dl5NP6ym.js"),__vite__mapDeps([0,1]),import.meta.url)),ra=h.lazy(()=>L(()=>import("./index-B07KPoAU.js"),__vite__mapDeps([0,1]),import.meta.url)),sa=h.lazy(()=>L(()=>import("./index-DJwvNiRa.js"),__vite__mapDeps([0,1,2]),import.meta.url)),ia=h.lazy(()=>L(()=>import("./overview-D4hz1f04.js"),__vite__mapDeps([0,1]),import.meta.url)),aa=h.lazy(()=>L(()=>import("./domains-DH3UyJ8c.js"),__vite__mapDeps([0,1]),import.meta.url)),ca=h.lazy(()=>L(()=>import("./index-BdlpB2eR.js"),__vite__mapDeps([0,1]),import.meta.url)),la=h.lazy(()=>L(()=>import("./appearance-BZqg7Kkn.js"),__vite__mapDeps([0,1]),import.meta.url)),ua=h.lazy(()=>L(()=>import("./audit-logs-aCVF7lhB.js"),__vite__mapDeps([0,1,2]),import.meta.url)),da=h.lazy(()=>L(()=>import("./index-gu-JSZcO.js"),__vite__mapDeps([0,1]),import.meta.url)),fa=h.lazy(()=>L(()=>import("./config-navigation-CkwpaFE2.js"),__vite__mapDeps([0,1]),import.meta.url)),pa=h.lazy(()=>L(()=>import("./index-DGuACYX4.js"),__vite__mapDeps([0,1]),import.meta.url)),ma=h.lazy(()=>L(()=>import("./index-CSjGSZvb.js"),__vite__mapDeps([0,1]),import.meta.url)),ha=h.lazy(()=>L(()=>import("./security-D5AcOcu2.js"),__vite__mapDeps([0,1]),import.meta.url)),ga=h.lazy(()=>L(()=>import("./branding-BxYz3fG3.js"),__vite__mapDeps([0,1]),import.meta.url)),ba=h.lazy(()=>L(()=>import("./advanced-BsPW8tKj.js"),__vite__mapDeps([0,1]),import.meta.url)),xa=h.lazy(()=>L(()=>import("./traffic-BVT9gNf1.js").then(e=>e.t),__vite__mapDeps([0,1]),import.meta.url)),ya=h.lazy(()=>L(()=>import("./runtime-wNrz-OwM.js"),__vite__mapDeps([0,1]),import.meta.url)),va=h.lazy(()=>L(()=>import("./index-Bsziwsc_.js"),__vite__mapDeps([0,1]),import.meta.url)),wa=h.lazy(()=>L(()=>import("./list-DcrvvV8X.js"),__vite__mapDeps([0,1]),import.meta.url)),Sa=h.lazy(()=>L(()=>import("./index-J-Fwoozx.js"),__vite__mapDeps([0,1]),import.meta.url)),ja=h.lazy(()=>L(()=>import("./config-dGkFpD36.js").then(e=>e.c),__vite__mapDeps([0,1]),import.meta.url)),Ca=h.lazy(()=>L(()=>import("./observability-B458LeIE.js"),[],import.meta.url)),ka=h.lazy(()=>L(()=>import("./playground-_1Dj8J_h.js"),[],import.meta.url)),Ea=h.lazy(()=>L(()=>import("./index-BV58Bk4h.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url)),Ia=h.lazy(()=>L(()=>import("./component-D1imN4b5.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),_a=h.lazy(()=>L(()=>import("./index-DwuQFnlr.js"),__vite__mapDeps([0,1]),import.meta.url)),La=W(R.WELLKNOWN_SERVICE_PATH_PREFIX,"user","notifications"),Ta=e=>{const{enqueueSnackbar:t}=nn(),n=h.useCallback(r=>bn(La,{id:r.id,severity:r.severity||"all",componentDid:r.source==="system"?"system":r.componentDid||"all"}),[]);Tr(`${e}/${R.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,r=>{const o=n(r),{severity:s,description:a}=r||{},c=["error","warning"].includes(s)||r.sticky;r.source==="system"&&t(a,{variant:s,autoHideDuration:c?null:5e3,content:l=>i.jsx(cs,{viewAllUrl:o,keyId:l,notification:r,content:i.jsx(Fr,{notification:r,minimal:!0,rows:0})})})},[],"user")};function fo({blocklet:e,isAdmin:t}){return t?i.jsx(da,{blocklet:e}):i.jsx(Ar,{status:403})}fo.propTypes={blocklet:S.object.isRequired,isAdmin:S.bool.isRequired};const Da=e=>{const{t}=B(),{blocklet:n,actions:{refreshBlocklet:r},client:o,did:s}=me(),a=ne(()=>Mr(n,"settings.org.enabled",!1),[n]),c=n?.meta?.did,l=!n||Dr(n.status)?[]:P.getAppMissingConfigs(n),u={overview:[{label:t("common.overview"),value:"overview"},{label:i.jsx(Xo,{"data-cy":"blocklet-list",color:"error",variant:"dot",invisible:!l.length,children:t("common.components")}),labelText:t("common.components"),value:"components"}],"did-connect":[{label:t("common.members"),value:"members"},a?{label:t("common.orgs"),value:"orgs"}:null,{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"}].filter(Boolean),aigne:[{label:t("setup.aigne.config"),value:"aigne-config"}],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:n?.children?.length&&n.structVersion===R.APP_STRUCT_VERSION},{label:t("common.performance"),value:"performance"},{label:t("common.docs"),value:"docs"}]},d={overview:ia,components:Ia,members:i.jsx(oa,{type:"blocklet",createPassportSvg:Ot}),passports:i.jsx(ca,{createPassportSvg:Ot}),orgs:i.jsx(Ea,{editable:!1,mode:"dashboard",layout:"table"}),settings:i.jsx(ma,{orientation:"vertical"}),security:i.jsx(ha,{}),"did-spaces":i.jsx(pa,{navOrientation:"horizontal"}),domains:aa,branding:i.jsx(ga,{blocklet:n,onUpdate:r}),theming:i.jsx(la,{}),navigation:fa,sitemap:i.jsx(ko,{children:t("common.comingSoon")}),notifications:i.jsx(fo,{blocklet:n,isAdmin:e}),"audit-logs":i.jsx(ua,{scope:c,categories:["blocklet","team","security","certificates","gateway"]}),analytics:i.jsx(xa,{client:o,did:s}),advanced:i.jsx(ba,{blocklet:n,onUpdate:r}),webhooks:i.jsx(ra,{}),"access-keys":i.jsx(va,{}),"mcp-servers":i.jsx(Sa,{}),logs:na,performance:i.jsx(ya,{client:o,did:s}),docs:_a,publish:i.jsx(sa,{}),oauth:i.jsx(wa,{}),"aigne-config":i.jsx(E,{sx:{maxWidth:1536},children:i.jsx(ja,{})}),"aigne-observability":i.jsx(Ca,{}),"aigne-playground":i.jsx(ka,{})};return{tabGroups:u,renders:d}};function Aa(){const e=fn(),{tab:t="overview",subtab:n}=er(),{locale:r}=B(),{blocklet:o,refreshFlag:s}=me(),{session:a}=xn(),c=ne(()=>a?.user?.did,[a]),l=Kr(),u=ne(()=>a.user?.role&&gn.includes(a.user.role),[a]);Ta(c);const{tabGroups:d,renders:p}=Da(u),f=g=>{e(`${R.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/${t}/${g}`)},x=(d[t]||[]).filter(g=>g.show===void 0||g.show),y=(x||[]).find(g=>g.value===n)?.value||x?.[0]?.value||t,b=p[y]||p.overview,j=["overview"].includes(t),v=o?i.jsxs(Sn,{type:"components",children:[x.length>0&&i.jsxs(E,{sx:{mb:2,display:"flex",alignItems:"center",gap:2},children:[i.jsx(Co,{tabs:x,current:y,onChange:f,scrollButtons:"auto"}),j&&!l&&i.jsx(E,{sx:{flex:1,display:"flex",justifyContent:"flex-end"},children:i.jsx(E,{component:"div",className:"page-header",children:o?i.jsx(Ut,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:g}={})=>{g&&F.error(g.message)},variant:"group"}):null})})]}),i.jsx(E,{className:"page-content",children:i.jsx(h.Suspense,{fallback:i.jsx(Ae,{relative:"parent",children:i.jsx(V,{})}),children:h.isValidElement(b)?b:i.jsx(b,{blocklet:o})})})]}):i.jsx(Ae,{relative:"parent",children:i.jsx(V,{})}),C=ne(()=>{const g=window.blocklet?.navigation?.find(M=>M.id==="/team"&&M.section==="dashboard"),k=o?.meta?.title||"";let _="";if(g){const M=W(R.WELLKNOWN_BLOCKLET_ADMIN_PATH,t,t==="publish"?n:"");_=g.items.find(We=>We.link===M)?.title?.[r]||""}const m=x.find(M=>M.value===n),O=[m?.labelText||m?.label||x?.[0]?.labelText||x?.[0]?.label||"",_].filter(Boolean).join(" - ");return k?O?`${O} | ${k}`:k:O||""},[t,n,o,r]);return i.jsx(Lr,{children:i.jsx($r,{children:i.jsx(uo,{title:C,children:i.jsxs(Ra,{children:[l&&j&&i.jsx(E,{component:"div",className:"page-header",sx:{mb:2},children:o?i.jsx(Ut,{className:"page-actions",hasPermission:!0,blocklet:o,onStart:()=>{},onComplete:({error:g}={})=>{g&&F.error(g.message)},variant:"group"}):null}),i.jsx(es,{}),i.jsx(ta,{}),v]})},`${s}`)})})}function Pa(){const{blocklet:e}=me(),t=e?.meta?.did;return h.useEffect(()=>{const n=_r();return t&&n.connect(),()=>{t&&n.isConnected()&&n.disconnect()}},[t]),i.jsx(Aa,{})}const Ra=Ue.main`
65
65
  .page-header {
66
66
  display: flex;
67
67
  justify-content: space-between;
@@ -103,4 +103,4 @@ ${r}
103
103
  margin-bottom: 15px;
104
104
  }
105
105
  }
106
- `,tc=Object.freeze(Object.defineProperty({__proto__:null,default:Pa},Symbol.toStringTag,{value:"Module"}));export{Ui as B,co as F,no as W,Y as b,tc as d,so as p,ec as u};
106
+ `,tc=Object.freeze(Object.defineProperty({__proto__:null,default:Pa},Symbol.toStringTag,{value:"Module"}));export{Ui as B,co as G,no as W,Y as b,tc as d,so as p,ec as u};