@abtnode/blocklet-services 1.16.47-beta-20250805-095401-14eb156b → 1.16.47-beta-20250807-110715-19ad6b43

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 (235) hide show
  1. package/api/index.js +2 -1
  2. package/api/libs/connect/v1.js +1 -1
  3. package/api/libs/env.js +1 -1
  4. package/api/routes/access-key.js +7 -1
  5. package/api/routes/csp-proxy.js +2 -2
  6. package/api/routes/user.js +31 -6
  7. package/dist/assets/{AdapterDayjs-D8zlc0TS.js → AdapterDayjs-OwV8ZfRo.js} +1 -1
  8. package/dist/assets/{Google-DxcTyhFe.js → Google-B5khWV-G.js} +1 -1
  9. package/dist/assets/{access-control-jFR93SsS.js → access-control-C9JoF-VW.js} +1 -1
  10. package/dist/assets/{actions-B0rWiAuM.js → actions-DiUxQ792.js} +1 -1
  11. package/dist/assets/{add-component-core-DfrJCl4a.js → add-component-core-DbPZIJoa.js} +39 -39
  12. package/dist/assets/add-resource-D0yHahVH.js +1 -0
  13. package/dist/assets/{addon-B-vtdIPn.js → addon-S-x2oOBW.js} +1 -1
  14. package/dist/assets/{advanced-B92lyz70.js → advanced-Brdzd_hV.js} +1 -1
  15. package/dist/assets/aigne-CEwSzcja.js +10 -0
  16. package/dist/assets/aistro-NLUOUWwT.png +0 -0
  17. package/dist/assets/{appearance-C1k2L_bA.js → appearance-Dptvfp0O.js} +1 -1
  18. package/dist/assets/ar-BCTLRONQ.js +1 -0
  19. package/dist/assets/{ar-DDlrXmSt.js → ar-qovKpPcU.js} +1 -1
  20. package/dist/assets/{arrow-down.svg-BnKvb8st.js → arrow-down.svg-mrRaEeKB.js} +1 -1
  21. package/dist/assets/{audit-logs-OO0l4GnY.js → audit-logs-FBpDejHE.js} +1 -1
  22. package/dist/assets/{authorize-BU6KP5W6.js → authorize-BeJTPWjw.js} +1 -1
  23. package/dist/assets/{base-chart-B1XQ7Ytj.js → base-chart-BR64ujqk.js} +1 -1
  24. package/dist/assets/{base32-BeRPpTcK.js → base32-Dq34Xpru.js} +1 -1
  25. package/dist/assets/{branding-D1JmhF3p.js → branding-BX3gHZjy.js} +2 -2
  26. package/dist/assets/{branding-CEu-c8uQ.js → branding-D1DQzFQg.js} +1 -1
  27. package/dist/assets/{bundle-avatar-BZQ_lZxy.js → bundle-avatar-B6WDP8U8.js} +1 -1
  28. package/dist/assets/button-BGOqx4KL.js +1 -0
  29. package/dist/assets/{click-to-copy-EOhAhdSS.js → click-to-copy-Lt7iNH-g.js} +1 -1
  30. package/dist/assets/{collapse-wumRocfe.js → collapse-tY1N2fk5.js} +1 -1
  31. package/dist/assets/{complete-DwaBuF4K.js → complete-QPs88Xvq.js} +1 -1
  32. package/dist/assets/{component-D31UJpJQ.js → component-IvlOow7w.js} +3 -3
  33. package/dist/assets/{config-Df0dxvZZ.js → config-BV13SrRs.js} +1 -1
  34. package/dist/assets/config-ZidMeHMX.js +53 -0
  35. package/dist/assets/{config-AgncsJiw.js → config-gRz3hnHQ.js} +1 -1
  36. package/dist/assets/{config-navigation-JJehoQAV.js → config-navigation--k3uzAVY.js} +3 -3
  37. package/dist/assets/{config-space-CrH2JnlQ.js → config-space-DmPAo0Uc.js} +1 -1
  38. package/dist/assets/{confirm-Cx2owMMo.js → confirm-DwicyBRo.js} +1 -1
  39. package/dist/assets/{connect-C7C7ILA6.js → connect-CCyhtcsX.js} +1 -1
  40. package/dist/assets/{connect-BD9OoHaD.js → connect-CXYynAHv.js} +1 -1
  41. package/dist/assets/{connect-to-nCPxtJH1.js → connect-to-duHzVFsc.js} +1 -1
  42. package/dist/assets/{content-layout-BZKNdb6s.js → content-layout-D5EfCmvE.js} +1 -1
  43. package/dist/assets/{createClass-BTaIsrxM.js → createClass-Cy-fAHUw.js} +1 -1
  44. package/dist/assets/{dashboard-CDjptZox.js → dashboard-DTH5SkDE.js} +3 -3
  45. package/dist/assets/{de-DSALrqI8.js → de-BrVlvg8I.js} +1 -1
  46. package/dist/assets/de-Bxv5hOpH.js +1 -0
  47. package/dist/assets/{delete-confirm-Wa3xVOUM.js → delete-confirm-Bn607XWd.js} +1 -1
  48. package/dist/assets/{did-address-C7IHZs6x.js → did-address-BYpODbk4.js} +1 -1
  49. package/dist/assets/{domain-DV7cdOEy.js → domain-D0AJ_QKJ.js} +1 -1
  50. package/dist/assets/{domain-action-card-CnvZTstr.js → domain-action-card-DIdC2BX8.js} +1 -1
  51. package/dist/assets/domains-BnUGWOh5.js +1 -0
  52. package/dist/assets/{dot-CE8yAFCN.js → dot-3RzyGk21.js} +1 -1
  53. package/dist/assets/{email-DQnz-4Bc.js → email-DSvOsQV4.js} +1 -1
  54. package/dist/assets/{empty-spinner-DCdg-gxP.js → empty-spinner-DXNgsKH2.js} +1 -1
  55. package/dist/assets/engine-DwJQ8ndb.js +1 -0
  56. package/dist/assets/es-CJASnE29.js +1 -0
  57. package/dist/assets/{es-DQvY5fGr.js → es-CWdREjkO.js} +1 -1
  58. package/dist/assets/{exchange-passport-D9HZFZwF.js → exchange-passport-Duueo_OR.js} +1 -1
  59. package/dist/assets/{form-D52FUB8q.js → form-DJLzfDke.js} +1 -1
  60. package/dist/assets/{form-text-input-DanXI___.js → form-text-input-BWWenIQu.js} +1 -1
  61. package/dist/assets/{form-wrapper-DgFURo9t.js → form-wrapper-RaRgkgkH.js} +1 -1
  62. package/dist/assets/{fr-BgvhEJ06.js → fr-CfM2gAY_.js} +1 -1
  63. package/dist/assets/fr-GN7UO4qD.js +1 -0
  64. package/dist/assets/{fuel-DEa3ECY8.js → fuel-BxPebmaf.js} +1 -1
  65. package/dist/assets/gen-access-key-C8QyyPtS.js +1 -0
  66. package/dist/assets/gen-simple-access-key-CGRxC9aD.js +1 -0
  67. package/dist/assets/get-safe-url-Byu99Iq6.js +1 -0
  68. package/dist/assets/hi-B6hnXdBn.js +5 -0
  69. package/dist/assets/hi-DWiwUAYV.js +1 -0
  70. package/dist/assets/{home-B7OWEVsn.js → home-D1KsByvB.js} +1 -1
  71. package/dist/assets/{id-DfDk8Cxy.js → id-BfAVuWhm.js} +1 -1
  72. package/dist/assets/id-SWQ4mJGx.js +1 -0
  73. package/dist/assets/{iframe-CqwYISrF.js → iframe-2AxKOYBR.js} +1 -1
  74. package/dist/assets/{index-296hnpGF.js → index-0DKBOdj7.js} +1 -1
  75. package/dist/assets/index-4wrVz6i1.js +124 -0
  76. package/dist/assets/{index-ChbREcnK.js → index-7UPsmpeB.js} +1 -1
  77. package/dist/assets/{index-BFOTYlfC.js → index-7Wt3WOLU.js} +1 -1
  78. package/dist/assets/{index-B0GLaTiX.js → index-8djlz-MG.js} +1 -1
  79. package/dist/assets/{index-DlaHLSvf.js → index-B2HJDbWz.js} +19 -19
  80. package/dist/assets/{index-C4hly8RC.js → index-BAYFdR7m.js} +1 -1
  81. package/dist/assets/{index-uY6moYTs.js → index-BDSe7HLW.js} +1 -1
  82. package/dist/assets/{index-BEmLxB7B.js → index-Br7EG_jz.js} +1 -1
  83. package/dist/assets/{index-diQW5vdJ.js → index-BsHHb1rN.js} +1 -1
  84. package/dist/assets/{index-Nd6gD7eY.js → index-CMhFwlvk.js} +1 -1
  85. package/dist/assets/{index-CKesQXQW.js → index-CTM6wiOX.js} +1 -1
  86. package/dist/assets/{index-Dj0TETp9.js → index-CgCVx1sf.js} +12 -12
  87. package/dist/assets/{index-Cylfu8Kg.js → index-CniiyWPl.js} +14 -14
  88. package/dist/assets/{index-AK4Fi3I2.js → index-Cp_r7DvZ.js} +1 -1
  89. package/dist/assets/{index-Yow2d7gN.js → index-Cw89V6wx.js} +1 -1
  90. package/dist/assets/{index-BetmKk0p.js → index-Cy8O6s0C.js} +1 -1
  91. package/dist/assets/index-D05HWeh6.js +1 -0
  92. package/dist/assets/{index-CiL_9BYm.js → index-DFmxGkG9.js} +12 -12
  93. package/dist/assets/{index-CiW-jlCS.js → index-DKLDL0NU.js} +1 -1
  94. package/dist/assets/{index-B-k9otcQ.js → index-DLvW-hX6.js} +1 -1
  95. package/dist/assets/{index-BDu1k7Fv.js → index-DSSx9Ohc.js} +1 -1
  96. package/dist/assets/{index-BBIMESWU.js → index-DU79Hpz9.js} +1 -1
  97. package/dist/assets/{index-Bbcgo0GF.js → index-DgGkR58E.js} +1 -1
  98. package/dist/assets/{index-LdkiJabL.js → index-Dmil4V_-.js} +1 -1
  99. package/dist/assets/{index-DtuUsb1T.js → index-DtYei0B0.js} +2 -1
  100. package/dist/assets/{index-78a5Cdpe.js → index-GRZ8tMAV.js} +1 -1
  101. package/dist/assets/{index-C0mn0MnL.js → index-Mu2Sji0B.js} +1 -1
  102. package/dist/assets/{index-DSNvDaKK.js → index-dytlEEOb.js} +1 -1
  103. package/dist/assets/{index-B4OZ6pVW.js → index-khjK2Z9N.js} +1 -1
  104. package/dist/assets/{index-Cbf4geph.js → index-l5234Nwn.js} +123 -122
  105. package/dist/assets/{invitation-D8IFGbTf.js → invitation-BiM8UWsv.js} +1 -1
  106. package/dist/assets/{invite-bBNbkUJu.js → invite-CAmhHCq3.js} +1 -1
  107. package/dist/assets/{isURL-By2TdRfN.js → isURL-DA2-tMLY.js} +1 -1
  108. package/dist/assets/{issue-passport-DaQDVQ7Y.js → issue-passport-BlDK-yh8.js} +1 -1
  109. package/dist/assets/item-Deax8Tcs.js +1 -0
  110. package/dist/assets/{ja-GXo4l4Hp.js → ja-616mK6Bu.js} +1 -1
  111. package/dist/assets/ja-CUi7rI9p.js +1 -0
  112. package/dist/assets/ko-Bx9B8tBH.js +1 -0
  113. package/dist/assets/{ko-1dMP3P8A.js → ko-CoUjs_Gj.js} +1 -1
  114. package/dist/assets/{landing-page-k9p91AEv.js → landing-page-BJTNr6j1.js} +1 -1
  115. package/dist/assets/{launch-result-message-BTMFIbUm.js → launch-result-message-BklGSk6L.js} +1 -1
  116. package/dist/assets/{layout-zg5WZEdp.js → layout-B_66AMXX.js} +1 -1
  117. package/dist/assets/{list-C6CNPBAR.js → list-XQkJnArQ.js} +1 -1
  118. package/dist/assets/{list-header-B8ZTLjYf.js → list-header-BnA6XPP6.js} +1 -1
  119. package/dist/assets/{list-CYJEZSon.js → list-uh5difGn.js} +2 -2
  120. package/dist/assets/localization-DrnuLXG0.js +1 -0
  121. package/dist/assets/{log-ssfC90VX.js → log-22OBDAZV.js} +1 -1
  122. package/dist/assets/logger-Dth79fFL.js +1 -0
  123. package/dist/assets/{login-aFsf6-QM.js → login-6f9xq_uw.js} +1 -1
  124. package/dist/assets/{login-oauth-callback-dKBg8IoH.js → login-oauth-callback-mHVhjuxd.js} +1 -1
  125. package/dist/assets/{logo-uploader-D0Gz6YoY.js → logo-uploader-3Gf22QS4.js} +2 -2
  126. package/dist/assets/{lost-passport-Bo6am6th.js → lost-passport-BIYbG7oY.js} +1 -1
  127. package/dist/assets/{observability-Cfy3MVZa.js → observability-CFK-gQFz.js} +1 -1
  128. package/dist/assets/{open-window-DBhAlL9B.js → open-window-nJnt1xUe.js} +1 -1
  129. package/dist/assets/{over-due-invoice-payment-D89GCKNm.js → over-due-invoice-payment-D1hhqrpZ.js} +1 -1
  130. package/dist/assets/{overview-Xs3x6yXg.js → overview-DGSAxk-A.js} +1 -1
  131. package/dist/assets/{page-header-18voA300.js → page-header-Fuppayrb.js} +1 -1
  132. package/dist/assets/{passport-item-D-B7gJms.js → passport-item-4tKOyK2N.js} +1 -1
  133. package/dist/assets/{permission-DqaOkW_Z.js → permission-CzDQ8THQ.js} +1 -1
  134. package/dist/assets/{playground-CC7NZ-_A.js → playground-BNACWW4o.js} +1 -1
  135. package/dist/assets/preferences-CaRaLLOf.js +1 -0
  136. package/dist/assets/profile-embed-B295K6Uq.js +1 -0
  137. package/dist/assets/pt-BPWMiPVo.js +1 -0
  138. package/dist/assets/pt-BjllWaWg.js +5 -0
  139. package/dist/assets/publish-resource-Bhl_UV8t.js +1 -0
  140. package/dist/assets/{react-beautiful-dnd.esm-DkLcR42r.js → react-beautiful-dnd.esm-DOptRWpa.js} +1 -1
  141. package/dist/assets/{react-stripe.esm-BqogJv7y.js → react-stripe.esm-XKR9U0Pi.js} +1 -1
  142. package/dist/assets/{required-Df9AZf0R.js → required-DyRlNY7J.js} +1 -1
  143. package/dist/assets/ru-XKA9Zu_7.js +5 -0
  144. package/dist/assets/ru-aN6KKhQS.js +1 -0
  145. package/dist/assets/{runtime-DjILMoeT.js → runtime-bUnoJYpr.js} +1 -1
  146. package/dist/assets/{sanitize-BSjwjSMl.js → sanitize-Bu5pIC-A.js} +2 -2
  147. package/dist/assets/sdk-CiMbVjwj.js +1 -0
  148. package/dist/assets/{section-X04H4Q-a.js → section-D6477Ce1.js} +2 -1
  149. package/dist/assets/{security-BXhgiheS.js → security-DO4dtLin.js} +1 -1
  150. package/dist/assets/{session-89Q1nGxB.js → session-YnDvY5CJ.js} +1 -1
  151. package/dist/assets/setup-DigmKGGp.js +30 -0
  152. package/dist/assets/{shorten-label-CdBn9U0H.js → shorten-label-Bj776ixm.js} +1 -1
  153. package/dist/assets/{simple-select-BkbgqOQi.js → simple-select-BDbQa-9S.js} +1 -1
  154. package/dist/assets/{spaces-BJeg7L1z.js → spaces-KdeOps1v.js} +1 -1
  155. package/dist/assets/{start-CLueiUKJ.js → start-h8SswMC5.js} +1 -1
  156. package/dist/assets/{starting-progress-DWesZE5w.js → starting-progress-BjFMTtUQ.js} +1 -1
  157. package/dist/assets/{status-DheLJdlM.js → status-E4FMnQqN.js} +1 -1
  158. package/dist/assets/{step-actions-DmraEWCH.js → step-actions-GaXwswph.js} +1 -1
  159. package/dist/assets/studio-CgXu1gEM.js +6 -0
  160. package/dist/assets/{switch-control-BbRt1rRM.js → switch-control-CkW4eeJ4.js} +1 -1
  161. package/dist/assets/{table-tips-73VcKMz1.js → table-tips-LM2ip4Rj.js} +1 -1
  162. package/dist/assets/{team-ZJuYy81P.js → team-DjZ9qE6U.js} +1 -1
  163. package/dist/assets/th-CFlSwxxc.js +1 -0
  164. package/dist/assets/th-C_39WNhc.js +5 -0
  165. package/dist/assets/{traffic-CMI1Sbrr.js → traffic-CW6sZXQr.js} +1 -1
  166. package/dist/assets/{transfer-CW4yMg3K.js → transfer-BUR6hEv2.js} +1 -1
  167. package/dist/assets/{unsubscribe-D3ZXIJIb.js → unsubscribe-Dfzg-bws.js} +1 -1
  168. package/dist/assets/{use-mobile-BDciCFXT.js → use-mobile-CO13Oymt.js} +1 -1
  169. package/dist/assets/{use-mobile-BlpLWscF.js → use-mobile-CzqOrBZu.js} +1 -1
  170. package/dist/assets/{use-server-logo-lZp3Hq92.js → use-server-logo-Bs73VID2.js} +1 -1
  171. package/dist/assets/{use-window-close-wo9PxrTe.js → use-window-close-Cvx_le30.js} +1 -1
  172. package/dist/assets/{useLocalStorage-B_thopuV.js → useLocalStorage-phc-OA98.js} +1 -1
  173. package/dist/assets/{user-center-D6gs6-WZ.js → user-center-DjDTKFEf.js} +3 -3
  174. package/dist/assets/{user-sessions-B56a-4tA.js → user-sessions-D3Rr-i1p.js} +1 -1
  175. package/dist/assets/{util-Dcj6HCP7.js → util-Bn2B0xma.js} +1 -1
  176. package/dist/assets/{util-DQF9oPrf.js → util-majSFCTY.js} +1 -1
  177. package/dist/assets/{vendor-arcblock--zSibe1w.js → vendor-arcblock-DU4xNzGM.js} +1 -1
  178. package/dist/assets/{vendor-mui-core-BOHKtf8y.js → vendor-mui-core-CAIaAq-_.js} +2 -2
  179. package/dist/assets/{vendor-mui-x-16EG-AFj.js → vendor-mui-x-DXh6Gdva.js} +1 -1
  180. package/dist/assets/{vendor-ux-Cra9XTth.js → vendor-ux-C1NY8cuW.js} +3 -3
  181. package/dist/assets/vi-B8pz6rul.js +5 -0
  182. package/dist/assets/vi-DnVHbPxD.js +1 -0
  183. package/dist/assets/wait-connect-DpAcPy2e.js +1 -0
  184. package/dist/assets/wrap-locale-DwZj0kLA.js +1 -0
  185. package/dist/assets/zh-CFHHHyA4.js +1 -0
  186. package/dist/assets/{zh-DxCg9Pae.js → zh-DEpjANkc.js} +1 -1
  187. package/dist/assets/{zh-BoO0jdid.js → zh-Dr_3RhGJ.js} +1 -1
  188. package/dist/assets/zh-tw-DEjVZpn9.js +1 -0
  189. package/dist/assets/{zh-tw-D4_7lUjD.js → zh-tw-DK_EuRfN.js} +1 -1
  190. package/dist/index.html +4 -4
  191. package/dist/service-worker.js +1 -1
  192. package/package.json +46 -46
  193. package/dist/assets/add-resource-Ch4SZAWK.js +0 -1
  194. package/dist/assets/aigne-BDdYezR9.js +0 -10
  195. package/dist/assets/ar-cWkdH-wM.js +0 -1
  196. package/dist/assets/button-VEuIVOxr.js +0 -1
  197. package/dist/assets/config-C6pSSzan.js +0 -46
  198. package/dist/assets/de-CKHR0Dxi.js +0 -1
  199. package/dist/assets/domains-BpVmxPqY.js +0 -1
  200. package/dist/assets/empty-DhZfJeme.js +0 -1
  201. package/dist/assets/engine-BD3-KjxK.js +0 -1
  202. package/dist/assets/es-2tKCVVW6.js +0 -1
  203. package/dist/assets/fr-C2hgGsGq.js +0 -1
  204. package/dist/assets/gen-access-key-DrTcGDFb.js +0 -1
  205. package/dist/assets/gen-simple-access-key-DiDRmpFf.js +0 -1
  206. package/dist/assets/get-safe-url-DOmcOTEp.js +0 -1
  207. package/dist/assets/hi-DLl5_Grb.js +0 -1
  208. package/dist/assets/hi-DtMqBGN3.js +0 -5
  209. package/dist/assets/id-BEDDZnYa.js +0 -1
  210. package/dist/assets/index-AbdeuSeu.js +0 -124
  211. package/dist/assets/index-B-WiXXyt.js +0 -1
  212. package/dist/assets/item-BhrhnieT.js +0 -1
  213. package/dist/assets/ja-BXpHGJqS.js +0 -1
  214. package/dist/assets/ko-CwVxJk3S.js +0 -1
  215. package/dist/assets/localization-DFWXvHpl.js +0 -1
  216. package/dist/assets/logger-D5kKPkv7.js +0 -1
  217. package/dist/assets/preferences-5iBfUn8N.js +0 -1
  218. package/dist/assets/profile-embed-MOxF7ggV.js +0 -1
  219. package/dist/assets/pt-5iS1WU13.js +0 -5
  220. package/dist/assets/pt-DM9_sWXT.js +0 -1
  221. package/dist/assets/publish-resource-BBnSOgDd.js +0 -1
  222. package/dist/assets/ru-DpIRvFxj.js +0 -5
  223. package/dist/assets/ru-DvP9XKXg.js +0 -1
  224. package/dist/assets/sdk-B-MwbsI_.js +0 -1
  225. package/dist/assets/setup-Da3ReRWd.js +0 -30
  226. package/dist/assets/studio-C4flChud.js +0 -6
  227. package/dist/assets/th-BjX3AJzF.js +0 -5
  228. package/dist/assets/th-DyGOy3ap.js +0 -1
  229. package/dist/assets/use-promise-window-open-u0untujg.js +0 -1
  230. package/dist/assets/vi-0Dtw7069.js +0 -5
  231. package/dist/assets/vi-BWy1Jg4e.js +0 -1
  232. package/dist/assets/wait-connect-CqwL_aoj.js +0 -1
  233. package/dist/assets/wrap-locale-DAzAra4f.js +0 -1
  234. package/dist/assets/zh-D_lJZbI3.js +0 -1
  235. package/dist/assets/zh-tw-CfWhHTHL.js +0 -1
@@ -0,0 +1,124 @@
1
+ import{j as e,y as kt,bb as ke,M as ae,ak as f,Q as q,W as u,J as xe,c0 as St,I as O,aN as Pt,T as I,aj as Rt,b5 as Ee,P as Be,b6 as Z,a5 as Le,z as Qe,A as Ve,cm as It,bf as Tt,U as je,dk as At,dl as Mt,at as ee,dm as zt,a6 as V,n as le,D as Et,dn as Bt,ar as We,b1 as Se,dp as Lt,aX as Wt,am as J,bp as Dt,bq as ye,a$ as Nt,d7 as Ot}from"./vendor-mui-core-CAIaAq-_.js";import{r as y,a as $t,u as Ft,j as Ut}from"./vendor-react-Dvs43sk9.js";import{t as Ye,Z as _t,a8 as qt,R as De,D as Ht,C as ce,n as Q,A as Gt}from"./vendor-utils-BOkrEpKO.js";import{a as Kt,D as Qt,bA as Vt,c as Pe,d as Yt,T as Zt,bB as Jt,aN as Re,Q as fe,b8 as Xt,bC as er,_ as tr,aP as rr,$ as nr,bD as or}from"./index-l5234Nwn.js";import{a as T,h as Ze,k as te,g as H,b as E,j as sr}from"./vendor-hooks-DTeIFVkk.js";import{l as Je}from"./arrow-down.svg-mrRaEeKB.js";import{b as Ie,I as N,T as D,aw as ir,G as Xe,ax as ar,H as _,ay as lr,az as cr,aA as Ne,e as dr,n as et,c as Te,aB as ur,aC as M,x as pr,v as xr,$ as tt,aD as fr,aE as hr,u as gr,o as de,B as Oe,J as mr}from"./vendor-ux-C1NY8cuW.js";import{N as br}from"./list-XQkJnArQ.js";import{d as yr}from"./search-4YYphs0l.js";import{B as $e}from"./bundle-avatar-B6WDP8U8.js";import{j as Fe,T as vr}from"./team-DjZ9qE6U.js";import{b as wr,d as jr,a as Cr,c as kr,e as Sr,f as Pr,B as Rr}from"./user-center-DjDTKFEf.js";import{N as rt,U as nt}from"./index-CMhFwlvk.js";import{u as re}from"./use-mobile-CO13Oymt.js";import Ir from"./index-Cy8O6s0C.js";import{f as X}from"./index-DBs9Ljax.js";import{u as ot}from"./index-Br7EG_jz.js";import{U as ve}from"./user-sessions-D3Rr-i1p.js";import Tr from"./index-GRZ8tMAV.js";import{o as Ar}from"./vendor-arcblock-DU4xNzGM.js";import{c as Mr,b as ue,a as zr,S as Er}from"./index-7Wt3WOLU.js";import"./index-dytlEEOb.js";import"./index-BojVbZw0.js";import"./lottie-web-4koyQiv_.js";import"./server-logo-notext.svg-CKQB0tIp.js";import"./index-D05HWeh6.js";import"./util-Bn2B0xma.js";import"./base32-Dq34Xpru.js";import"./session-YnDvY5CJ.js";import"./isURL-DA2-tMLY.js";import"./index-DtYei0B0.js";import"./api-Rnh95Dt4.js";import"./table-tips-LM2ip4Rj.js";import"./use-mobile-CzqOrBZu.js";import"./passport-item-4tKOyK2N.js";import"./did-address-BYpODbk4.js";import"./index-DSSx9Ohc.js";import"./vendor-mui-x-DXh6Gdva.js";import"./AdapterDayjs-OwV8ZfRo.js";import"./confirm-DwicyBRo.js";import"./click-to-copy-Lt7iNH-g.js";import"./delete-confirm-Bn607XWd.js";import"./permission-CzDQ8THQ.js";import"./actions-DiUxQ792.js";import"./index-DRYJ0xIl.js";function Br(){let t=new Map;function s({root:o,rootMargin:n,threshold:l}){let i=t.get(o);i||(i=new Map,t.set(o,i));let c=JSON.stringify({rootMargin:n,threshold:l}),p=i.get(c);if(!p){let r=new Map;p={observer:new IntersectionObserver(x=>{x.forEach(m=>{r.get(m.target)?.(m)})},{root:o,rootMargin:n,threshold:l}),entryCallbacks:r},i.set(c,p)}return{observe:(r,x)=>{p.entryCallbacks.set(r,x),p.observer.observe(r)},unobserve:r=>{p.entryCallbacks.delete(r),p.observer.unobserve(r)}}}return{getObserver:s}}var Lr="0px",Wr=[0],Dr=Br();function Nr(t){let s=t?.rootMargin??Lr,o=t?.threshold??Wr,n=y.useRef(null),l=y.useRef(null),i=y.useRef(null),[c,p]=y.useState(),r=y.useCallback(()=>{let C=n.current;if(!C){p(void 0);return}let v=Dr.getObserver({root:l.current,rootMargin:s,threshold:o});v.observe(C,a=>{p(a)}),i.current=v},[s,o]),x=y.useCallback(()=>{let C=i.current,v=n.current;v&&C?.unobserve(v),i.current=null},[]),m=y.useCallback(C=>{x(),n.current=C,r()},[r,x]),h=y.useCallback(C=>{x(),l.current=C,r()},[r,x]);return[m,{entry:c,rootRef:h}]}var Or=Nr;function $r(t){let[s,o]=Or(t),n=!!o.entry?.isIntersecting,[l,i]=y.useState(n);return n&&!l&&i(!0),[s,{...o,isVisible:n,wasEverVisible:l}]}var Fr=$r,Ur=100;function _r({loading:t,hasNextPage:s,onLoadMore:o,rootMargin:n,disabled:l,delayInMs:i=Ur}){let c=y.useRef(o),[p,{rootRef:r,isVisible:x}]=Fr({rootMargin:n});y.useEffect(()=>{c.current=o},[o]);let m=!l&&!t&&x&&s;return y.useEffect(()=>{if(m){let h=setTimeout(()=>{c.current()},i);return()=>{clearTimeout(h)}}},[m,i]),[p,{rootRef:r}]}var qr=_r;const we={info:"#3B82F6",success:"#10B981",warning:"#F59E0B",error:"#EF4444"};pe.propTypes={severity:u.oneOf(["info","success","warning","error",""]).isRequired,size:u.number};function pe({severity:t,size:s=8}){return we[t]?e.jsx(f,{component:"span",sx:{display:"inline-block",width:s,height:s,borderRadius:"50%",backgroundColor:we[t]||we.info}}):null}st.propTypes={theme:u.string,type:u.oneOf(["button","line","select"]),onSelectType:u.func,extra:u.node,loading:u.bool,currentTab:u.oneOf(["info","success","warning","error",""])};function st({theme:t="dark",type:s="button",onSelectType:o,extra:n=void 0,currentTab:l="",loading:i=!1,...c}){const{t:p}=y.useContext(Ie),r=[{label:p("notification.allSeverity"),value:""},{label:p("notification.severityType.info"),value:"info"},{label:p("notification.severityType.success"),value:"success"},{label:p("notification.severityType.warning"),value:"warning"},{label:p("notification.severityType.error"),value:"error"}],x=g=>{(g!==l||!i)&&o(g)},m=y.useMemo(()=>{const g={width:"100%",bgcolor:t==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:s==="select"?"0":"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(g,{}):g},[s,t]),h=(g,S,R)=>e.jsx(q,{disabled:i,onClick:()=>x(g.value),className:`profile-button ${S?"active":""}`,...c,children:g.label},g.value||R),C=(g,S,R)=>e.jsx(q,{variant:"text",disabled:i,onClick:()=>x(g.value),className:`profile-line-button ${S?"active":""}`,...c,children:g.label},g.value||R),v=()=>r?.map((g,S)=>{const R=l===g?.value;return s==="line"?e.jsx(y.Fragment,{children:C(g,R,S)},g.value||S):e.jsx(y.Fragment,{children:h(g,R,S)},g.value||S)}),a=g=>{const{value:S}=g.target;x(S==="all"?"":S)};return s==="select"?e.jsx(kt,{sx:{maxWidth:300},children:e.jsx(ke,{value:l||"all",onChange:a,size:"small",label:"Severity",IconComponent:g=>e.jsx(Je,{...g,width:20,height:20}),MenuProps:{autoFocus:!1,PaperProps:{style:{maxHeight:400,overflowY:"auto",borderRadius:"8px",boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},variant:"outlined",sx:{fieldset:{border:"none"}},children:r.map((g,S)=>e.jsx(ae,{value:g.value||"all",children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(pe,{severity:g.value}),g.label]})},g.value||S))})}):e.jsxs(f,{className:"severity-tabs",sx:m,children:[e.jsx(f,{sx:{...s==="line"?{flex:1,borderBottom:"1px solid",borderColor:"grey.200"}:{display:"flex",gap:"24px"}},children:v()}),n]})}it.propTypes={paging:u.objectOf(u.any).isRequired,loading:u.bool.isRequired,onChange:u.func.isRequired};function it({loading:t,paging:s,onChange:o}){const{t:n}=y.useContext(Ie),l=xe(r=>r.breakpoints.down("md"));if(s.pageCount<=0||l)return null;const i=(r,x)=>{o({page:x+1})},c=r=>{const x=Number(r.target.value);o({page:1,pageSize:x})},p=s.page-1<=0?0:s.page-1;return e.jsx(f,{className:"notification-pagination",sx:{mt:2,display:"flex",justifyContent:"flex-end"},children:e.jsx(St,{component:"div",disabled:t,count:s.total,page:p,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:n("pagination.rowsPerPage"),labelDisplayedRows:({from:r,to:x,count:m})=>`${r}–${x} / ${m!==-1?m:`${n()}more than ${x}`}`,rowsPerPage:s.pageSize,onPageChange:i,onRowsPerPageChange:c})})}const Hr=y.memo(it),Gr={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4h16v2.172a2 2 0 0 1-.586 1.414L15 12v7l-6 2v-8.5L4.52 7.572A2 2 0 0 1 4 6.227V4z"/>'},Ue=6,_e={"& .MuiCheckbox-root":{padding:"4px"},"& .MuiCheckbox-root .MuiSvgIcon-root":{fontSize:"1.35rem"},"& .MuiCheckbox-root:not(.Mui-checked)":{color:"divider"},"& .MuiCheckbox-root.Mui-checked":{color:"primary.main"},"& .MuiCheckbox-root .css-i4bv87-MuiSvgIcon-root":{width:"1.1em",height:"1.1em"},"& .MuiCheckbox-root svg":{stroke:"divider",strokeWidth:.7}},Kr={border:"1px solid",borderColor:"divider",borderRadius:1,overflow:"hidden",backgroundColor:"background.paper",backgroundImage:"none",transition:"all 0.2s ease-in-out"},qe=()=>({...Kr,width:"calc(50% - 8px)"});at.propTypes={loading:u.bool,type:u.oneOf(["server","service"]),onFilterChange:u.func,blockletMap:u.object,filterType:u.oneOf(["component","entity"]),selectedId:u.array,severity:u.array,enableMarkAllAsRead:u.bool,unReadCount:u.number,onReadFilterChange:u.func,currentReadFilter:u.string};function at({onFilterChange:t=()=>{},loading:s=!1,type:o="service",blockletMap:n={},filterType:l="component",selectedId:i=[],severity:c=[],enableMarkAllAsRead:p=!0,unReadCount:r=0,onReadFilterChange:x=()=>{},currentReadFilter:m="all"}){const{t:h}=y.useContext(Ie),[C,v]=y.useState(null),a=!!C,[g,S]=y.useState(i),[R,P]=y.useState(c),[b,z]=y.useState(!1),[B,F]=y.useState(""),[j,k]=y.useState([]);y.useEffect(()=>{S(i),P(c)},[i,c]);const L=[{label:h("notification.filterType.all"),value:"all"},{label:h("notification.filterType.unread"),value:"unread"}],G=d=>{(d!==m||!s)&&x(d)},Y=[{label:h("notification.severityType.info"),value:"info"},{label:h("notification.severityType.success"),value:"success"},{label:h("notification.severityType.warning"),value:"warning"},{label:h("notification.severityType.error"),value:"error"}],ne=d=>{v(d.currentTarget),F(""),z(!1)},he=()=>{v(null)},oe=d=>{const w=g.includes(d)?g.filter(A=>A!==d):[...g,d];S(w),t({id:w,severity:R})},se=d=>{const w=R.includes(d)?R.filter(A=>A!==d):[...R,d];P(w),t({severity:w,id:g})},ge=d=>{F(d.target.value)},me=()=>{z(!b)},K=$t.useMemo(()=>{if(!n.size)return[];const d=[];return l==="component"&&d.push({label:h("notification.system"),id:"system"}),Array.from(n).forEach(([,w])=>{const A=w.did||w.meta?.did,W=w.title||w.meta?.title||"",U=w.appPid||w.appDid;(l==="component"&&U!==A||l==="entity"&&U===A)&&d.push({label:W,id:A,blocklet:w,ancestors:w.ancestors})}),d},[n,l,h]);y.useEffect(()=>{if(B.trim()==="")k(K);else{const d=B.toLowerCase(),w=K.filter(A=>A.label.toLowerCase().includes(d));k(w)}},[B,K]);const be=B.trim()!==""||b?j:j.slice(0,Ue);return e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:p?"space-between":"flex-end",alignItems:"flex-start",flexWrap:"wrap",gap:1},children:[p&&e.jsx(f,{sx:{display:"flex",gap:1.5},children:L.map(d=>e.jsxs(q,{disabled:s,onClick:()=>G(d.value),className:`profile-button ${m===d.value?"active":""}`,sx:{...o==="service"&&m===d.value?{color:"secondary.main"}:{},color:"red",fontWeight:m===d.value?"bold":"normal"},children:[d.label,d.value==="unread"&&r>0&&` (${r})`]},d.value))}),e.jsxs(f,{sx:{display:"flex",justifyContent:"flex-end",gap:2},children:[e.jsx(O,{size:"small",onClick:ne,disabled:s,sx:{minWidth:"auto",borderRadius:1,border:"1px solid",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:e.jsx(N,{icon:Gr,hFlip:!0})}),e.jsx(Pt,{open:a,anchorEl:C,onClose:he,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{p:3,width:450,maxHeight:500,overflowY:"auto",backgroundColor:"background.paper",backgroundImage:"none",borderRadius:1,boxShadow:"0px 6px 24px rgba(0, 0, 0, 0.15)"}}},children:e.jsxs(f,{children:[e.jsxs(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,height:"28px"},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("notification.severity")}),e.jsx(f,{sx:{minWidth:"60px",display:"flex",justifyContent:"flex-end"},children:(g.length>0||R.length>0)&&e.jsx(q,{size:"small",onClick:()=>{S([]),P([]),t({severity:[],id:[]})},startIcon:e.jsx(Rt,{fontSize:"small"}),sx:{color:"text.secondary",textTransform:"none",minWidth:"auto","&:hover":{backgroundColor:"transparent"},"& .MuiButton-startIcon":{marginRight:"2px"}},children:h("notification.clear")})})]}),e.jsx(f,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2,flex:1},children:Y.map(d=>e.jsx(Be,{elevation:0,sx:qe(R.includes(d.value)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{display:"flex",alignItems:"center",gap:1,fontSize:"0.875rem"},..._e},control:e.jsx(Le,{checked:R.includes(d.value),onChange:()=>se(d.value),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5},children:[e.jsx(pe,{severity:d.value}),d.label]})})},d.value))})}),e.jsxs(f,{sx:{mb:2},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mb:1.5},children:[e.jsx(I,{variant:"subtitle1",sx:{fontWeight:"bold",width:"calc(100% - 36px)"},children:h("notification.from")}),e.jsx(f,{sx:{display:"flex",alignItems:"center",width:"calc(100% - 36px)"},children:e.jsx(Qe,{size:"small",placeholder:"search",value:B,onChange:ge,sx:{width:"100%","& .MuiOutlinedInput-input":{padding:"6px 4px 6px 0"},".MuiOutlinedInput-root":{"&:hover":{fieldset:{borderColor:"divider"}},"&.Mui-focused":{fieldset:{borderColor:"divider"}}},fieldset:{borderColor:"divider"}},slotProps:{input:{size:"small",startAdornment:e.jsx(Ve,{position:"start",sx:{marginRight:"2px"},children:e.jsx(N,{icon:yr})})}}})})]}),e.jsx(Ee,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:2},children:be.map(d=>e.jsx(Be,{elevation:0,sx:qe(g.includes(d.id)),children:e.jsx(Z,{sx:{margin:0,padding:.5,width:"100%","& .MuiFormControlLabel-label":{fontSize:"0.875rem",width:"calc(100% - 36px)"},..._e},control:e.jsx(Le,{checked:g.includes(d.id),onChange:()=>oe(d.id),disabled:s,size:"small"}),label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,minWidth:0,width:"100%"},children:[d.blocklet&&e.jsx($e,{size:20,blocklet:d.blocklet,ancestors:d.ancestors,style:{borderRadius:4,flexShrink:0}}),e.jsx(I,{noWrap:!0,variant:"body2",component:"span",title:d.label,sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},children:d.label})]})})},d.id))}),j.length>Ue&&B.trim()===""&&e.jsx(q,{fullWidth:!0,size:"small",onClick:me,sx:{mt:1},endIcon:b?e.jsx(It,{}):e.jsx(Tt,{})})]})]})})]})]}),g.length>0||R.length>0?e.jsxs(f,{className:"notification-filter-content",sx:{display:"flex",flexWrap:"wrap",gap:1,mt:2},children:[R.map(d=>{const w=Y.find(A=>A.value===d);return e.jsx(je,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(pe,{severity:d}),w?w.label:d]}),onDelete:()=>se(d),size:"small",variant:"outlined",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`severity-${d}`)}),g.map(d=>{const w=K.find(A=>A.id===d);return e.jsx(je,{label:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5},children:[w?.blocklet&&e.jsx($e,{size:16,blocklet:w.blocklet,ancestors:w.ancestors,style:{borderRadius:4,flexShrink:0}}),w?w.label:d]}),variant:"outlined",onDelete:()=>oe(d),size:"small",sx:{borderRadius:2,color:"text.secondary",borderColor:"divider","& .MuiChip-label":{display:"flex",alignItems:"center"}}},`component-${d}`)})]}):null]})}const Qr=ee(zt)`
2
+ position: fixed;
3
+ bottom: 20px;
4
+ right: 20px;
5
+ z-index: 1000;
6
+ @media (max-width: 600px) {
7
+ bottom: 16px;
8
+ right: 16px;
9
+ transform: scale(0.9);
10
+ }
11
+ `;function Vr(){const[t,s]=y.useState(!1);y.useEffect(()=>{const n=Ye(()=>{s(window.pageYOffset>300)},200);return window.addEventListener("scroll",n),n(),()=>window.removeEventListener("scroll",n)},[]);const o=()=>{try{"scrollTo"in window?window.scrollTo({top:0,behavior:"smooth"}):window.scrollTo(0,0)}catch{window.scrollTo(0,0)}};return e.jsx(At,{in:t,children:e.jsx(Qr,{color:"primary",size:"small","aria-label":"scroll back to top",onClick:o,children:e.jsx(Mt,{})})})}const Yr=ee.div`
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: ${t=>t.inDialog?0:"24px"};
15
+ .MuiContainer-root {
16
+ padding-right: 0;
17
+ }
18
+
19
+ .profile-button.MuiButtonBase-root {
20
+ border-radius: 9999px;
21
+ margin-right: 2px;
22
+ padding: 5px 12px;
23
+ line-height: 22px;
24
+ font-size: 13px;
25
+ border: 1px solid transparent;
26
+ background-color: ${({theme:t})=>t.palette.background.default};
27
+ color: ${({theme:t})=>t.palette.text.primary};
28
+ font-weight: 400;
29
+ border: 1px solid ${({theme:t})=>t.palette.divider} !important;
30
+ }
31
+ .profile-button.active.MuiButtonBase-root,
32
+ .profile-button.active.MuiButtonBase-root:hover {
33
+ color: ${({theme:t})=>t.palette.primary.main};
34
+ font-weight: 600;
35
+ background-color: ${({theme:t})=>le(t.palette.primary.main,.1)};
36
+ border: 1px solid ${({theme:t})=>le(t.palette.primary.main,.24)} !important;
37
+ }
38
+
39
+ .profile-button.MuiButtonBase-root:hover {
40
+ background-color: rgba(0, 0, 0, 0.04);
41
+ }
42
+
43
+ .profile-line-button.MuiButtonBase-root {
44
+ margin-right: 2px;
45
+ color: ${({theme:t})=>t.palette.text.secondary};
46
+ padding: 5px 12px;
47
+ line-height: 22px;
48
+ font-size: 13px;
49
+ border: none !important;
50
+ border-radius: 0;
51
+ }
52
+
53
+ .profile-line-button.active.MuiButtonBase-root {
54
+ color: ${({theme:t})=>t.palette.text.primary};
55
+ border-bottom: 1px solid ${({theme:t})=>t.palette.text.primary} !important;
56
+ }
57
+
58
+ .profile-button.MuiButtonBase-root:last-of-type,
59
+ .profile-line-button.MuiButtonBase-root {
60
+ margin-right: 0;
61
+ }
62
+
63
+ .profile-line-button.MuiButtonBase-root:hover {
64
+ color: ${({theme:t})=>t.palette.text.primary};
65
+ background-color: unset;
66
+ }
67
+
68
+ * {
69
+ scrollbar-width: none; /* Firefox */
70
+ -ms-overflow-style: none; /* IE and Edge */
71
+ }
72
+
73
+ *::-webkit-scrollbar {
74
+ display: none; /* Chrome, Safari and Opera */
75
+ }
76
+ `;lt.propTypes={blocklets:u.array,context:u.object,pagination:u.bool,inDialog:u.bool,filterType:u.oneOf(["component","entity"]),toViewAll:u.func,type:u.oneOf(["server","service"])};function lt({blocklets:t=[],context:s,pagination:o=!0,inDialog:n=!1,filterType:l="component",toViewAll:i=()=>{},type:c="service"}){const{data:p,paging:r,refresh:x,loading:m,params:h,onReadNotification:C,componentDids:v,filterUnReadCount:a,initial:g}=s,S=d=>{x({...h,severity:d&&typeof d=="string"?[d]:d||[],paging:{...h.paging,page:1}})},[R]=Ft(),P=T(()=>R.get("id"),[R]),b=xe(d=>d.breakpoints.down("md")),[z,B]=y.useState(0),[F,j]=y.useState(!1),k=y.useMemo(()=>h.read===!1?"unread":"all",[h.read]),L=T(()=>Ye(d=>{if(m)return;const w=p.length,A=p.filter(U=>!Fe(U)).length;let W={...h,append:!0,paging:{...h.paging,...d,currentPage:(r.currentPage||0)+1}};k==="unread"&&A<w&&d.page>h.paging.page&&(W={...h,append:!0,paging:{...h.paging,...d,page:h.paging.page||1,currentPage:(r.currentPage||0)+1}}),x(W)},500),[p,h,k,r,m,x]);Ze(()=>{g&&typeof g=="function"&&g()}),y.useEffect(()=>{(!r.currentPage||r.currentPage===1)&&B(r.total)},[r.total,r.currentPage]),y.useEffect(()=>{setTimeout(()=>{const d=document.getElementById(P);d&&d.scrollIntoView({behavior:"smooth",block:"center"}),j(!0)},100),setTimeout(()=>{j(!1)},3e3)},[P]);const G=T(()=>p?.length>0&&p.length<z,[p,z]),Y=y.useCallback(d=>{const{blocklet:w={}}=window,A=[w?.did,...(w?.ancestors||[]).map(W=>W)];return v?.includes(d)||A.findIndex(W=>W===d)>-1},[v]),ne=y.useMemo(()=>{const d=new Map;return t.length&&t.forEach(w=>{const A=w?.did||w.meta?.did;A&&!d.has(A)&&(w.ancestors=[],d.set(A,w),w?.alsoKnownAs?.length>0&&w.alsoKnownAs.forEach(W=>{d.has(W)||d.set(W,w)})),w?.children?.length>0&&w.children.forEach(W=>{const U=W?.did||W.meta?.did;U&&!d.has(U)&&Y(U)&&(W.ancestors=[w],d.set(U,W))})}),d},[t,Y]),he=y.useCallback(()=>{m||L({page:r.page+1})},[r.page,m,L]),[oe]=qr({loading:m,hasNextPage:G,onLoadMore:he}),se=d=>{!d||Fe(d)||C(d.id).then(()=>{n&&i()})},ge=({severity:d,id:w})=>{if(m)return;let A={};l==="component"?A={entityId:[],componentDid:w}:l==="entity"&&(A={componentDid:[],entityId:w}),x({...h,severity:d,...A,paging:{...h.paging,page:1}})},me=d=>{if(m)return;let w={...h,paging:{...h.paging,page:1}};d==="unread"?(w.read=!1,w.paging.currentPage=1):w=_t(w,"read"),x(w)},K=T(()=>l==="component"?Array.isArray(h.componentDid)?h.componentDid:[]:l==="entity"?Array.isArray(h.entityId)?h.entityId:[]:[],[h,l]),be=T(()=>(Array.isArray(h.severity)?h.severity:[])[0]||"",[h.severity]);return e.jsxs(Yr,{inDialog:!!n,children:[n?e.jsx(st,{currentTab:be,type:"line",theme:"light",onSelectType:S}):e.jsx(at,{loading:m,blockletMap:ne,unReadCount:a,filterType:l,type:c,selectedId:K,onFilterChange:ge,severity:h.severity,onReadFilterChange:me,currentReadFilter:k}),!b&&m?e.jsx(f,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:e.jsx(V,{})}):e.jsx(br,{data:p,blockletMap:ne,onReadNotification:se,onReadBatch:C,inDialog:n,highlightId:P,highlight:!n&&F,type:c}),o&&!b?e.jsx(Hr,{loading:m,paging:r,onChange:L}):null,o&&b&&(m||G)?e.jsx(f,{ref:oe,sx:{display:"flex",width:"100%",minHeight:100,justifyContent:"center",alignItems:"center"},children:e.jsx(V,{})}):null,!n&&b?e.jsx(Vr,{}):null]})}const Zr=y.memo(lt),$=new Vt;function Ae(t){const{userDid:s=""}={},{session:o}=Kt(),n=T(()=>{if(s)return s;const r=window.location.href,x=qt(r);return x?.did?Array.isArray(x.did)?x.did[0]:x.did:o?.user?.did},[o?.user?.did,s]),l=T(()=>o.user,[o]),i=T(()=>l?n===l?.did:!1,[n,l?.did]),c=te(async()=>{if(await Qt(()=>o?.initialized),i)return o.user;if(n)return $.user.getUserPublicInfo({did:n})},{refreshDeps:[n,i,o?.initialized,l]}),p=T(()=>l.passports?.some(r=>r.role===Pe.ROLES.OWNER),[l]);return{currentDid:n,session:o,isMyself:i,user:l,viewUser:c.data,isOwner:p}}function ct({user:t,...s}){const{t:o}=D(),n=Et(),l=T(()=>{const p=(t?.passports||[]).map(r=>({...r,revoked:r.status===ir.REVOKED}));return p.sort((r,x)=>r.revoked===x.revoked?0:r.revoked?1:-1),De(p.filter(r=>!r.display),"role").concat(De(p.filter(r=>r.display),"display.content"))},[t?.passports]),i=T(()=>l?.find(p=>p.name===t.role),[l,t?.role]),c=n.palette.primary.main;return l.length===0?e.jsx(f,{children:e.jsx(Xe,{children:o("userCenter.noPassport")})}):e.jsx(f,{...s,sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5,...s.sx},children:l.map(p=>e.jsx(wr,{passport:p,user:t,color:window.blocklet.passportColor,createPassportSvg:Yt,title:i&&i.role===p.role?o("userCenter.currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:1,px:2,display:"flex",justifyContent:"center",backgroundColor:"grey.50",boxShadow:i&&i.role===p.role?`0px 2px 4px 0px ${c}, 0px 1px 2px -1px ${c}, 0px 0px 0px 1px ${c} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}ct.propTypes={user:u.object.isRequired};function Jr({visible:t,onClose:s,nft:o}){return!t||!o?null:e.jsx(Xr,{children:e.jsx(Bt,{open:t,onClose:s,children:e.jsx(en,{onClick:s,children:e.jsx(rt,{data:nt(o),address:o.address,inset:!0})})})})}const Xr=ee.div`
77
+ position: relative;
78
+ width: 100%;
79
+ height: 100%;
80
+ cursor: pointer;
81
+
82
+ &:hover {
83
+ .mask {
84
+ opacity: 1;
85
+ }
86
+ }
87
+
88
+ .mask {
89
+ position: absolute;
90
+ top: 0;
91
+ left: 0;
92
+ display: flex;
93
+ align-items: center;
94
+ justify-content: center;
95
+ width: 100%;
96
+ height: 100%;
97
+ background: rgba(0, 0, 0, 0.6);
98
+ opacity: 0;
99
+ transition: opacity 0.2s;
100
+ }
101
+ `,en=ee.div`
102
+ display: flex;
103
+ justify-content: center;
104
+ align-items: center;
105
+ height: 100vh;
106
+ width: 100vw;
107
+
108
+ img,
109
+ object {
110
+ max-width: 90vw;
111
+ max-height: 75vh;
112
+ }
113
+
114
+ .nft-display--inset {
115
+ > .MuiBox-root,
116
+ .nft-display__loading {
117
+ width: 75vmin;
118
+ height: 75vmin;
119
+ }
120
+ }
121
+ `,tn=t=>({position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.6)",opacity:0,transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1,"& .mask-item":{backgroundColor:le(t.palette.background.paper,.9),color:"text.primary","&:hover":{backgroundColor:le(t.palette.background.paper,1)}}}),rn={position:"absolute",bottom:0,left:0,right:0,height:24,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",gap:1,zIndex:1,"& .mask-item":{width:20,height:20,color:"white"}},He="https://main.abtnetwork.io/explorer";function dt({user:t}){const{t:s}=D(),o=re(),[n,l]=y.useState({visible:!1,nft:null}),[i,c]=y.useState({anchorEl:null,props:null}),p=P=>{const b=ce(He,"assets",P);window.open(b,"_blank")},r=(P,b)=>{let z="";typeof b.data?.value=="string"?z=JSON.parse(b.data?.value)?.domain:z=b.data?.value?.domain,c({anchorEl:P,props:{title:z?`Hey, I just won an NFT at the ${z} event!`:"Hey, I just won an NFT!",url:ce(He,"assets",b.address)}})},x=P=>{l({visible:!0,nft:P})},m=H({page:1,size:20}),h=te(async(P=m)=>(await Ht.get(`${Pe.WELLKNOWN_SERVICE_PATH_PREFIX}/ocap/listAssets`,{params:{ownerAddress:t.did,...P}})).data,{defaultParams:[m],refreshDeps:[t.did,m]}),{loading:C,data:v}=h,a=v?.page??{cursor:0,next:!1,total:0},g=(P,b)=>{m.page=b,h.run(m)},S=E(P=>[e.jsx(O,{size:"small",className:"mask-item",onClick:b=>{b.stopPropagation(),p(P.address)},children:e.jsx(N,{icon:"tabler:link",fontSize:18})},"link"),e.jsx(O,{size:"small",onClick:b=>{b.stopPropagation(),r(b.currentTarget,P)},className:"mask-item",children:e.jsx(N,{icon:"tabler:share-2",fontSize:18})},"share"),e.jsx(O,{size:"small",onClick:b=>{b.stopPropagation(),x(P)},className:"mask-item",children:e.jsx(N,{icon:"tabler:eye",fontSize:18})},"view")]),R=T(()=>{if(C){const P=["skeleton-1","skeleton-2","skeleton-3","skeleton-4","skeleton-5"].map(b=>e.jsx(We,{variant:"rectangular",width:"15%",height:166,sx:{borderRadius:1,flexShrink:0}},b));return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsx(We,{width:"20%"}),e.jsx(f,{sx:{display:"flex",flexDirection:"row",gap:2,flexWrap:"nowrap"},children:P})]})}return e.jsxs(e.Fragment,{children:[e.jsx(I,{sx:{color:"grey.A700",fontWeight:600,mb:2.5},children:s("userCenter.common.nft")}),v?.assets?.length===0&&!C&&e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:e.jsx(Xe,{children:s("userCenter.common.noNFT")})}),e.jsx(f,{className:"nft-list-wrapper",sx:{display:"grid",justifyItems:"start",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(5, 1fr)"},gap:2.5},children:v?.assets?.map(P=>e.jsxs(f,{sx:{flexShrink:0,width:{xs:120,sm:120,md:120,lg:166},height:{xs:120,sm:120,md:120,lg:166},position:"relative",borderRadius:1,overflow:"hidden",cursor:"pointer",...o?{}:{"&:hover .mask":{opacity:1}}},children:[e.jsx(rt,{data:nt(P),address:P.address,inset:!0,imageFilter:{imageFilter:"resize",w:"500",f:"webp"}}),o?e.jsx(f,{className:"footer-mask",sx:rn,children:S(P)}):e.jsx(f,{className:"mask",sx:tn,children:e.jsx(Se,{direction:"row",spacing:1,children:S(P)})})]},P.address))}),a.next||m.page>1?e.jsx(Lt,{sx:{display:"flex",justifyContent:"center",mt:2},page:m.page,onChange:g,count:Math.ceil(a.total/m.size),size:"small"}):null,e.jsx(Jr,{visible:n.visible&&!!n.nft,nft:n.nft,onClose:()=>{l({visible:!1,nft:null})}}),e.jsx(ar,{anchorEl:i.anchorEl,onClose:()=>{c({anchorEl:null,props:null})},sharedProps:i.props||{title:"",url:""}})]})},[C,a,m.page,m.size,g,i,n]);return e.jsx(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1,p:2,mb:5},children:R})}dt.propTypes={user:u.object.isRequired};function nn(){const{t}=D(),{user:s,isMyself:o}=Ae();return e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[o?e.jsxs(f,{sx:{border:"1px solid",borderColor:"divider",borderRadius:1.5,p:2},children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600,mb:2.5},children:t("userCenter.passport")}),e.jsx(ct,{user:s})]}):null,e.jsx(dt,{user:s})]})}const on=[{name:"English",code:"en"},{name:"中文",code:"zh"}];function ut({user:t,onSave:s}){const{t:o,changeLocale:n}=D(),l=H({locale:t.locale,loading:!1}),i=E(async c=>{try{const{value:p}=c.target;l.loading=!0,await $.user.saveProfile({locale:p}),await s("profile"),n(p),l.locale=p}catch(p){_.error(X(p))}finally{l.loading=!1}});return e.jsxs(f,{sx:{gap:1,display:"grid",alignItems:"center",gridTemplateColumns:{xs:"1fr",sm:"max-content 1fr"}},children:[e.jsx(f,{children:o("userCenter.commonSetting.locale")}),e.jsx(f,{children:e.jsx(ke,{value:l.locale,onChange:i,size:"small",IconComponent:c=>e.jsx(Je,{...c,width:20,height:20}),sx:{minWidth:200,"&:hover":{"fieldset.MuiOutlinedInput-notchedOutline":{borderColor:"divider"}},fieldset:{borderColor:"divider"}},children:(window.blocklet.languages||on).map(c=>e.jsx(ae,{value:c.code,children:c.name},c.code))})})]})}ut.propTypes={user:u.shape({locale:u.string}).isRequired,onSave:u.func.isRequired};function Ce({onTest:t=Q,onDelete:s=Q,onSave:o=Q,onCancel:n=Q,type:l="slack",url:i="",edit:c=!1}){const{t:p}=D(),r=H({type:l||"slack",url:i||"",edit:c??!1,error:"",loading:!1}),x=E(()=>r.url?Zt(r.url)?(r.error="",!0):(r.error=p("common.invalid"),!1):(r.error=p("common.required"),!1)),m=E(()=>{r.edit=!1,r.url=i||"",r.type=l||"slack",r.error="",r.loading=!1,n()}),h=E(async a=>{r.loading=!0,await t(a),r.loading=!1}),C=E(a=>()=>{x()&&a({type:r.type,url:r.url})}),v=T(()=>r.error?e.jsx(I,{component:"span",color:"error",children:r.error}):r.edit?r.loading?e.jsx(V,{size:16}):e.jsx(O,{size:"small",onClick:C(h),sx:{mr:-1},children:e.jsx(N,{icon:jr})}):null,[r.error,r.edit,r.loading]);return e.jsxs(f,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[e.jsxs(ke,{sx:{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}},disabled:!r.edit||r.loading,size:"small",value:r.type,onChange:a=>{r.type=a.target.value},children:[e.jsx(ae,{value:"api",children:p("userCenter.webhook.url")}),e.jsx(ae,{value:"slack",children:p("userCenter.webhook.slack")})]}),e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[e.jsx(Qe,{sx:{flex:1,".MuiInputBase-root":{borderRadius:1,"&.Mui-disabled":{backgroundColor:"grey.50"}}},disabled:!r.edit||r.loading,fullWidth:!0,size:"small",required:!0,value:r.url,onChange:a=>{r.url=a.target.value,x()},error:!!r.error,slotProps:{input:{endAdornment:e.jsx(Ve,{position:"end",children:v})}}}),e.jsx(f,{sx:{display:"flex",gap:.5},children:r.edit?e.jsxs(e.Fragment,{children:[e.jsx(O,{color:"success",onClick:C((...a)=>{o(...a),r.edit=!1}),sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:lr})}),e.jsx(O,{color:"error",onClick:m,sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:cr})})]}):e.jsxs(e.Fragment,{children:[e.jsx(O,{onClick:()=>{r.edit=!0},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:Cr})}),e.jsx(O,{color:"error",onClick:()=>{s({type:r.type,url:r.url})},sx:{borderRadius:1,border:"1px solid",borderColor:"grey.200"},children:e.jsx(N,{icon:kr})})]})})]})]})}Ce.propTypes={onTest:u.func,onDelete:u.func,onSave:u.func,onCancel:u.func,type:u.oneOf(["api","slack"]),url:u.string,edit:u.bool};function ie({title:t=void 0,description:s=void 0,value:o,onChange:n,isMobile:l}){const i=E(c=>{c.stopPropagation()});return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ot,{checked:o,size:"small",onChange:n}),e.jsxs(I,{component:"div",onClick:i,sx:{color:"text.primary",fontSize:14,display:"flex",flexWrap:l?"wrap":"nowrap",columnGap:1,flex:1,whiteSpace:l?"normal":"nowrap"},children:[t,s]})]})}ie.propTypes={title:u.string,description:u.node,value:u.bool.isRequired,onChange:u.func.isRequired,isMobile:u.bool.isRequired};function pt({user:t,isMobile:s}){const{t:o}=D(),n=H({showAdd:!1}),l=te(async()=>await $.user.getUserNotificationConfig(),{refreshDeps:[t],loadingDelay:300}),i=T(()=>({wallet:!0,email:!0,phone:!1,push:!0,...l?.data?.notifications||{}}),[l?.data?.notifications]),c=T(()=>l?.data?.webhooks||[],[l?.data?.webhooks]),p=E(async v=>{try{await $.user.saveUserNotificationConfig(v),_.success(o("userCenter.saveSuccess")),l.run()}catch(a){_.error(X(a))}}),r=E(async(v,a)=>{await p({notifications:{[v]:a}})}),x=async v=>{try{await $.user.testNotificationWebhook(v),_.success(o("userCenter.webhookTested"))}catch(a){_.error(X(a))}},m=E(async v=>{await p({webhooks:c.filter((a,g)=>g!==v)})}),h=E(async(v,a)=>{await p({webhooks:c.map((g,S)=>S===v?a:g)})}),C=E(async v=>{await p({webhooks:[...c,v]}),n.showAdd=!1});return l.error?e.jsx(Wt,{severity:"error",children:l.error.message}):l.loading||!l.data?e.jsx(f,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:e.jsx(V,{})}):e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[e.jsx(ie,{value:i.wallet,isMobile:s,title:o("userCenter.walletNotification"),onChange:v=>r("wallet",v.target.checked),description:Ne(t)&&e.jsx(dr,{did:Ne(t),showQrcode:!1,showAvatar:!s,copyable:!0,compact:!0,responsive:!0,startChars:s?2:6})}),e.jsx(ie,{value:i.email,isMobile:s,onChange:v=>r("email",v.target.checked),title:o("userCenter.emailNotification"),description:t?.email&&e.jsx(I,{component:"span",sx:{color:"text.secondary",fontSize:13},children:t?.email})}),e.jsx(ie,{isMobile:s,value:i.push,title:o("userCenter.pushNotification"),onChange:v=>r("push",v.target.checked)})]}),e.jsxs(Se,{spacing:1.5,useFlexGap:!0,direction:"column",sx:{alignItems:"start"},children:[c.map((v,a)=>e.jsx(Ce,{onTest:x,onDelete:()=>m(a),onSave:(...g)=>h(a,...g),type:v.type,url:v.url,edit:!1},`${a}_${v.url}`)),n.showAdd&&e.jsx(Ce,{onTest:x,onCancel:()=>{n.showAdd=!1},onSave:(...v)=>C(...v),edit:!0},"add"),e.jsx(et,{variant:"outlined",size:"small",sx:{color:"text.primary",borderColor:"divider","&:hover":{borderColor:"divider"},py:.5,borderRadius:1},startIcon:e.jsx(N,{icon:Sr}),onClick:()=>{n.showAdd=!0},children:o("userCenter.addWebhook")})]})]})}pt.propTypes={user:u.object.isRequired,isMobile:u.bool.isRequired};function xt({item:t}){const s=Te(),{blocklet:o}=Jt(),{confirmApi:n,confirmHolder:l}=Re(),i=H({loading:!1}),{t:c}=D(),{session:p}=y.use(fe),{bindOAuth:r,unbindOAuth:x,setBaseUrl:m,baseUrl:h}=p.useOAuth(),{disconnectPasskey:C,setTargetAppPid:v}=p.usePasskey(),a=T(()=>ur[t?.provider]||"unknown",[t?.provider]),g=E(async()=>{if(t?.provider===M.PASSKEY){await new Promise((b,z)=>{n.open({title:c("userCenter.thirdPartyLogin.disconnectPasskey",{name:a}),content:c("userCenter.thirdPartyLogin.disconnectPasskeyDescription",{name:a}),confirmButtonText:c("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:c("common.cancel"),onConfirm(B){C({session:p,connectedAccount:t}).then(b).catch(z),B()},onCancel:b})});return}try{i.loading=!0,await new Promise((b,z)=>{if(t?._bind)n.open({title:c("userCenter.thirdPartyLogin.confirmUnbind",{name:a}),content:c("userCenter.thirdPartyLogin.confirmUnbindDescription",{name:a}),confirmButtonText:c("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:c("common.confirm"),onConfirm(B){x({session:p,connectedAccount:{...Gt(t,["did","pk"]),showProvider:t.provider,provider:t._rawProvider}}).then(b).catch(z),B()},onCancel:b});else if(t.provider===M.WALLET)p.bindWallet({onSuccess:b,onCancel:z});else{const B=h,F=window?.blocklet;let j="/";const k=pr(F),L=xr(F);k&&L?.appPid&&p?.user?.sourceAppPid&&(j=L.appUrl),m(j),v(o?.appPid),r({session:p,oauthItem:{...t,provider:t._rawProvider}}).then(b).catch(z).finally(()=>{m(B),v()})}})}catch(b){console.error(`Failed to ${t?._bind?"unbind":"bind"} oauth account`,b)}finally{i.loading=!1}}),S=E(b=>b.provider===M.WALLET&&b.did?c("userCenter.thirdPartyLogin.walletAccount"):b._mainProvider?c("userCenter.thirdPartyLogin.mainAccount"):b?._bind?c("userCenter.thirdPartyLogin.disconnect"):c("userCenter.thirdPartyLogin.connect")),R=E(b=>b.provider===M.WALLET&&b.did?c("userCenter.thirdPartyLogin.walletAccountCantRemove"):b.provider===M.PASSKEY?c("userCenter.thirdPartyLogin.dontSupportRemoveinArcSphere"):b._mainProvider?c("userCenter.thirdPartyLogin.mainProviderCantRemove"):""),P=E(b=>b.provider===M.WALLET&&b.did||b.provider===M.PASSKEY&&(s.arcSphere||s.wallet)?!0:!!t._mainProvider,[s.arcSphere]);return e.jsxs(e.Fragment,{children:[e.jsxs(f,{sx:{borderRadius:1,border:"1px solid",borderColor:"divider",backgroundColor:"grey.50",display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[e.jsx(Xt,{provider:t?.provider,sx:{width:"1em",height:"1em",flexShrink:0,fontSize:16,filter:({palette:b})=>t?.provider===M.GITHUB&&b.mode==="dark"?"invert(1)":"none"}}),e.jsx(f,{sx:{flex:1,display:{xs:t.userInfo?.email||t.did?"none":"block",sm:"block"}},children:a}),t.userInfo?.email||t.did?e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:.5,overflow:"hidden"},children:[e.jsx(f,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:t.userInfo?.email||t.did}),t.userInfo?.name?e.jsx(J,{title:e.jsx(e.Fragment,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(tt,{size:36,variant:"circle",shape:"circle",src:t.userInfo?.picture,did:t.did}),e.jsxs(f,{children:[e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.name}),e.jsx(I,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:t.userInfo?.email})]})]})}),children:e.jsx(f,{component:N,icon:er,sx:{color:"text.secondary",fontSize:16,cursor:"pointer",flexShrink:0}})}):null]}):null]}),e.jsx(J,{title:R(t),placement:"auto",children:e.jsx(f,{children:e.jsx(et,{variant:"outlined",size:"small",sx:b=>{const z=b.palette.error.main,B=b.palette.primary.main;return{color:t?._bind?z:B,borderColor:t?._bind?z:B,backgroundColor:"background.default","&:hover":{borderColor:t?._bind?z:B,backgroundColor:"action.hover"},py:.5,borderRadius:1,fontWeight:500,whiteSpace:"nowrap"}},fullWidth:!0,startIcon:i.loading?null:e.jsx(N,{icon:Pr}),onClick:g,disabled:P(t),loading:i.loading,children:S(t)})})}),l]})}xt.propTypes={item:u.shape({provider:u.string,did:u.string,pk:u.string,userInfo:u.object,id:u.string,_bind:u.bool,_rawProvider:u.string,_mainProvider:u.bool}).isRequired};function ft({user:t}){const{session:s}=y.use(fe),[o,n]=y.useState({}),{getOAuthConfigs:l}=s.useOAuth(),i=Te();sr(async()=>{const r=await l({sourceAppPid:t?.sourceAppPid});n(r)},[t?.sourceAppPid]);const c=T(()=>{const r=Object.keys(o).map(x=>({...o[x],provider:x})).filter(x=>x.enabled);return[{provider:M.WALLET,order:-1},...r,{provider:M.PASSKEY,order:1/0}]},[o]),p=T(()=>{const r=fr(t);let x=!1,m="",h=hr(t);const C=r.find(a=>a.provider===M.AUTH0);return C&&(C.id.startsWith("google-oauth2|")&&(r.some(a=>a.provider==="google")||(x=!0,m=M.GOOGLE,h===M.AUTH0&&(h=M.GOOGLE))),C.id.startsWith("appleid|")&&(r.some(a=>a.provider===M.APPLE)||(x=!0,m=M.APPLE,h===M.AUTH0&&(h=M.APPLE))),C.id.startsWith("github|")&&(r.some(a=>a.provider===M.GITHUB)||(x=!0,m=M.GITHUB,h===M.AUTH0&&(h=M.GITHUB)))),c.map(a=>{if(a.provider===M.AUTH0&&x)return null;const g=x&&a.provider===m?r.find(S=>S.provider===M.AUTH0):r.find(S=>S.provider===a.provider);return g?{...a,provider:a.provider,did:g.did,pk:g.pk,userInfo:g.userInfo,_bind:!0,_rawProvider:g.provider,_mainProvider:a.provider===h}:{...a,provider:a.provider,_rawProvider:a.provider,_mainProvider:a.provider===h}}).filter(a=>!(!a||a.provider===M.PASSKEY&&!a.did)).sort((a,g)=>a._mainProvider?-1:a?.order!==void 0&&g?.order!==void 0?a.order-g.order:a?.order!==void 0?-1:1)},[t?.connectedAccounts,c]);return e.jsxs(f,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:[p.map(r=>e.jsx(xt,{item:r},r?.provider)),i.wallet||i.arcSphere?null:e.jsx(tr,{behavior:"only-new",action:"connect",createMode:"connect",createButtonText:"Add New Passkey",onSuccess:Q,onError:Q,dense:!0,sx:{px:1.5,py:1,gap:.75}})]})}ft.propTypes={user:u.object.isRequired};function ht({configList:t,onSave:s}){const[o,n]=y.useState(t),{t:l}=D(),i=E(async(c,p)=>{try{const r=await $.user.saveUserPrivacyConfig({[c]:!p});n(o.map(x=>({...x,value:r?.[x.key]??x.value}))),_.success(l("userCenter.saveSuccess")),s("privacy")}catch(r){_.error(X(r))}});return y.useEffect(()=>{n(t)},[t]),e.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:o.map(c=>c.isPrivate?null:e.jsx(ot,{checked:!c.value,labelProps:{label:e.jsx(I,{sx:{color:"text.primary",fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:l("userCenter.toPublic",{name:c.name})})},size:"small",onChange:p=>i(c.key,p.target.checked)},c.key))})}ht.propTypes={configList:u.arrayOf(u.shape({key:u.string.isRequired,name:u.string.isRequired,value:u.bool.isRequired,isPrivate:u.bool})).isRequired,onSave:u.func.isRequired};function gt({user:t,sessionUser:s}){const o=T(()=>(t?.passports||[])?.find(n=>n.name===s.role),[t?.passports,s?.role]);return e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(tt,{size:40,variant:"circle",shape:"circle",src:s.avatar,did:s.did,sx:{flexShrink:0}}),e.jsxs(f,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(J,{title:s.fullName,children:e.jsx(I,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:s.fullName})}),e.jsx(je,{label:o?.title||o?.name||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:"text.primary",borderColor:"grey.300",backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),e.jsx(J,{title:s.email,children:e.jsx(I,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.email})})]})]})}gt.propTypes={user:u.object.isRequired,sessionUser:u.shape({role:u.string,avatar:u.string,did:u.string,fullName:u.string,email:u.string}).isRequired};const sn=()=>Promise.resolve(""),Ge=t=>new ve(t,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[ve.BROWSER.NAME,ve.BROWSER.VERSION]]}).getResult(),Ke={display:"flex",justifyContent:"flex-end",textAlign:"right"},an=new rr({concurrency:1}),Me=y.memo(({userSession:t,isMobile:s=!1})=>{const o=H({loading:!0,ipRegion:""}),{t:n}=D();return y.useEffect(()=>{an.add(async()=>{try{o.ipRegion=await sn(t.lastLoginIp)}finally{o.loading=!1}})},[o,t.lastLoginIp]),e.jsx(f,{...s&&{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:1,flexWrap:"wrap"},children:o.ipRegion?e.jsxs(e.Fragment,{children:[e.jsx(I,{variant:"body2",children:o.ipRegion}),e.jsx(I,{variant:"body2",color:"grey",children:t.lastLoginIp||n("userCenter.unknown")})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{children:t.lastLoginIp||n("userCenter.unknown")}),o.loading?e.jsx(I,{variant:"body2",color:"grey",sx:{textAlign:"center"},children:e.jsx(V,{size:12,color:"inherit"})}):null]})})});Me.propTypes={userSession:u.object.isRequired,isMobile:u.bool};Me.defaultProps={isMobile:!1};function mt({user:t,showAction:s=!0,showUser:o=!0,getUserSessions:n,showOffline:l=!1}){const i=H({status:"online",page:1,pageSize:10}),c=H({online:0,expired:0,offline:0}),p=gr(),{t:r}=D(),x=re({key:"md"}),m=xe(j=>j.breakpoints.down("lg")),{confirmApi:h,confirmHolder:C}=Re(),v=E(async()=>{const j=await n({page:i.page,pageSize:i.pageSize,status:i.status}),k=j?.paging?.total||0;return c[i.status]=k,{total:k,list:j?.list||[]}});Ze(async()=>{const j=await n({page:1,pageSize:1,status:"expired"});c.expired=j?.paging?.total||0;const k=await n({page:1,pageSize:1,status:"offline"});c.offline=k?.paging?.total||0});const a=te(v,{refreshDeps:[i.status,i.page,i.pageSize]}),g=T(()=>a.data?.list||[],[a.data?.list]),S=T(()=>{const{status:j}=i;return j==="online"?c[j]<=1:c[j]===0},[g,p]),R=T(()=>de({},x?Ke:{}),[x]),P=E(({visitorId:j})=>{h.open({title:r("userCenter.logoutThisSession"),content:r("userCenter.logoutThisSessionConfirm"),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({visitorId:j,includeFederated:!0});const{page:k=0}=i,{list:L=[]}=a.data||{},G=L.length||0;k>1&&G===1&&(i.page=Math.max(k-1,1)),a.refresh(),h.close()}})}),b=E(()=>{h.open({title:r("userCenter.logoutAllSession",{type:r(i.status)}),content:r("userCenter.logoutAllSessionConfirm",{type:r(i.status)}),confirmButtonText:r("userCenter.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:r("userCenter.cancel"),onConfirm:async()=>{await $.user.logout({status:i.status,visitorId:p,includeFederated:!0}),i.page=1,a.refresh(),h.close()}})}),z=[];s&&z.push(e.jsx(J,{title:r("userCenter.logoutAllTips",{type:r(i.status)}),children:e.jsx(q,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:S,children:r("userCenter.logoutAll",{type:r(i.status)})})},"logoutAll"));const B=T(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600,page:i.page-1,rowsPerPage:i.pageSize,count:a.data?.total||0}),[a.data?.total,i.page,i.pageSize]),F=[{label:r("userCenter.platform"),name:"platform",options:{customBodyRenderLite:j=>{const k=g[j],L=Ge(k?.ua);return e.jsx(f,{sx:R,children:[L.os?.name,L.os?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.deviceType"),name:"deviceType",options:{customBodyRenderLite:j=>{const k=g[j],L=Ge(k?.ua);return e.jsx(f,{sx:R,children:[L.browser?.name,L.browser?.version].filter(Boolean).join("/")||r("userCenter.unknown")})}}},{label:r("userCenter.walletOS"),name:"walletOS",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.extra?.walletOS||r("userCenter.unknown")})}}},o&&{label:r("userCenter.user"),name:"user",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:de({minWidth:150,maxWidth:250},x?Ke:{}),children:e.jsx(gt,{sessionUser:k.user,user:t})})}}},{label:r("userCenter.createdAt"),name:"createdAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.createdAt?e.jsx(Oe,{value:k.createdAt,relativeRange:3*86400*1e3}):r("userCenter.unknown")})}}},!l&&{label:r("userCenter.updatedAt"),name:"updatedAt",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:k.status==="expired"?r("userCenter.expired"):e.jsx(Oe,{value:k.updatedAt,relativeRange:3*86400*1e3})})}}},{label:r("userCenter.lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(Me,{userSession:k,isMobile:x})}}},s&&{label:r("userCenter.actions"),name:"actions",options:{customBodyRenderLite:j=>{const k=g[j];return e.jsx(f,{sx:R,children:e.jsx(q,{sx:{whiteSpace:"nowrap",fontSize:"12px !important",lineHeight:"1.25",px:1},disabled:p===k.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>P({visitorId:k.visitorId}),children:k.status==="expired"?r("userCenter.remove"):p===k.visitorId?r("userCenter.currentSession"):r("userCenter.logout")})})}}}].filter(Boolean);return e.jsxs(f,{className:"pc-user-sessions",sx:{maxWidth:x?"unset":m?"calc(100vw - 300px)":"100%",...x&&{".pc-user-sessions-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:j=>`${j.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...x&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:[C,e.jsx(mr,{count:a.data?.total||0,data:g,columns:F,customButtons:z,options:B,loading:a.loading,className:"pc-user-sessions-table",title:e.jsxs(Dt,{row:!0,sx:{lineHeight:1,ml:1},onChange:j=>{i.status=j.target.value},children:[e.jsx(Z,{value:"online",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="online"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.online"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.online,")"]})]})}),e.jsx(Z,{value:"expired",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="expired"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.expired"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.expired,")"]})]})}),l?e.jsx(Z,{value:"offline",control:e.jsx(ye,{size:"small",sx:{lineHeight:1,fontSize:0},checked:i.status==="offline"}),label:e.jsxs(I,{sx:{display:"flex",alignItems:"center"},children:[r("userCenter.offline"),e.jsxs(I,{component:"span",sx:{ml:.5,color:"text.secondary"},children:["(",c.offline,")"]})]})}):null]}),onChange:j=>{i.page=j.page+1,i.pageSize=j.rowsPerPage}})]})}mt.propTypes={user:u.object.isRequired,showAction:u.bool,showUser:u.bool,showOffline:u.bool,getUserSessions:u.func.isRequired};function bt({onDestroySelf:t=void 0}){const{confirmHolder:s}=Re(),{t:o}=D(),{session:n}=y.use(fe),l=E(async()=>{if(!t||typeof t!="function")return;const i=n.withSecondaryAuth(t,{extraParams:{removeUserDid:n?.user?.did,input:{user:{did:n?.user?.did},teamDid:window?.blocklet?.did}},operation:"destroySelf"});try{await i(),n.logout()}catch(c){_.error(c?.message||o("userCenter.destroyMyself.error"))}});return e.jsxs(e.Fragment,{children:[e.jsx(f,{children:e.jsxs(f,{sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"space-between",flexWrap:"wrap"},children:[e.jsxs(f,{children:[e.jsx(I,{variant:"h6",sx:{fontSize:"0.875rem !important",fontWeight:"bold"},children:o("userCenter.dangerZone.deleteAccount")}),e.jsx(I,{variant:"caption",sx:{color:"text.secondary"},children:o("userCenter.dangerZone.deleteAccountDescription")})]}),e.jsx(q,{variant:"contained",color:"error",size:"small",onClick:l,children:o("userCenter.dangerZone.delete")})]})}),s]})}bt.propTypes={onDestroySelf:u.func};function ln(){const t=re({key:"md"}),s=xe(l=>l.breakpoints.down("lg")),o={display:"flex",justifyContent:"flex-end",flexWrap:"wrap",textAlign:"right","&.expired-at > div":{maxWidth:160,justifyContent:"flex-end",flexWrap:"wrap"}},n=T(()=>de({},t?o:{}),[t]);return e.jsx(f,{id:"user-center-access-key-setting",sx:{maxWidth:t?"unset":s?"calc(100vw - 300px)":"100%",...t&&{".pc-access-key-table > div:nth-child(2)":{border:"1px solid",borderColor:"divider",borderRadius:1}},".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableRow-root":{border:"unset","&:nth-child(even)":{backgroundColor:"grey.50","&:hover":{backgroundColor:l=>`${l.palette.grey[50]} !important`}}},".MuiTableRow-hover":{"&:hover":{backgroundColor:"inherit !important"}},".MuiTableCell-root":{paddingRight:"8px",paddingLeft:"8px",color:"text.secondary",...t&&{padding:"8px !important","&:first-child":{paddingTop:"20px!important"},"&:last-child":{paddingBottom:"20px!important"}}}},children:e.jsx(Tr,{isSelf:!0,columnSx:n})})}function yt({onDestroySelf:t=void 0,userCenterTabs:s=[]}){const{t:o}=D(),{user:n,session:l,isMyself:i,isOwner:c}=Ae(),r=Te().arcSphere,x=re({key:"md"}),m=te(async()=>n&&i?await $.user.getUserPrivacyConfig({did:n.did}):null,{refreshDeps:[n,i],loadingDelay:300}),h=T(()=>s.map(a=>({key:a.value,name:a.label,value:a.protected,isPrivate:a.isPrivate})),[s]),C=E(async a=>a==="privacy"?(await m.runAsync(),m.data):(a==="profile"&&await l.refresh(),null));y.useEffect(()=>{const a=window.location.hash.slice(1);a&&document.getElementById(a)?.scrollIntoView({behavior:"smooth"})},[]);const v=T(()=>[r?void 0:{label:o("userCenter.commonSetting.title"),value:"common",content:e.jsx(ut,{user:n,onSave:C})},{label:o("userCenter.notificationManagement"),value:"notification",content:e.jsx(pt,{user:n,isMobile:x})},{label:o("userCenter.thirdPartyLogin.title"),value:"thirdPartyLogin",content:e.jsx(ft,{user:n})},{label:o("common.accessKeys"),value:"accessKeys",content:e.jsx(ln,{isSelf:!0})},{label:o("common.mcpServers"),value:"mcpServers",content:e.jsx(Ir,{})},{label:o("userCenter.privacyManagement"),value:"privacy",content:e.jsx(ht,{configList:h,onSave:C})},{label:o("userCenter.sessionManagement"),value:"session",content:e.jsx(mt,{user:n,showUser:!1,getUserSessions:a=>$.userSession.getMyLoginSessions({},a)})},!c&&t&&typeof t=="function"?{label:o("userCenter.dangerZone.title"),value:"dangerZone",content:e.jsx(bt,{onDestroySelf:t}),sx:{borderColor:"error.main"}}:null].filter(Boolean),[n,h,x,c,t]);return i?e.jsx(f,{sx:{display:"flex",flexDirection:"column",gap:2.5,minWidth:{md:500},maxWidth:"100%"},children:v.map(a=>a?e.jsxs(f,{id:a.value,sx:de({border:"1px solid",borderColor:"divider",borderRadius:1,p:2,"&:last-child":{mb:5}},a.sx),children:[e.jsx(I,{sx:{color:"text.primary",fontWeight:600},children:a.label}),e.jsx(f,{sx:{mt:2.5},children:a.content})]},a.value):null)}):null}yt.propTypes={onDestroySelf:u.func,userCenterTabs:u.array};const vt=y.createContext({}),{Provider:cn,Consumer:io}=vt;function wt({children:t}){const[s]=y.useState(!1),{session:o}=y.use(fe),{user:n}=o,[l,i]=y.useState(),c=y.useMemo(()=>n?.didSpace?.endpoint,[n?.didSpace]);y.useEffect(()=>{i(n?.didSpace)},[n?.didSpace]);const p=async()=>{i(void 0)},r=h=>{},x=async h=>{i(h),await r(h.endpoint)},m=!!(c&&l);return e.jsx(cn,{value:{loading:s,spaceGateway:l,session:o,deleteSpaceGateway:p,updateSpaceGateway:x,storageEndpoint:c,settingStorageEndpoint:r,hasStorageEndpoint:m},children:t})}function ze(){return y.use(vt)}wt.propTypes={children:u.node.isRequired};function dn(t){const s=t.replace(/\/api\/space\/.+/,""),n=t.replace(/\/$/,"").split("/").at(-4);return ce(s,"space",n)}function jt({session:t,spaceGateway:s,spaceStatus:o,refresh:n}){return e.jsxs(Se,{direction:"row",spacing:1,children:[o===Mr.DISCONNECTED&&e.jsx(ue,{reconnect:!0,variant:"outlined",session:t,spaceDid:t.user?.didSpace?.did,spaceGatewayUrl:t.user?.didSpace?.url,connectScope:"user",onSuccess:async()=>{await n()},onError:l=>{console.error(l),_.error(X(l))}}),e.jsx(O,{size:"small",LinkComponent:Nt,href:dn(s.endpoint),target:"_blank",children:e.jsx(Ot,{})})]})}jt.propTypes={session:u.object.isRequired,spaceGateway:u.object.isRequired,spaceStatus:u.string.isRequired,refresh:u.func.isRequired};function Ct({spaceGateway:t=void 0}){const{t:s}=D(),{updateSpaceGateway:o,session:n}=ze(),l=re(),i=({spaceGateway:c})=>o(c);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(f,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:s("userCenter.storage.spaces.connected.title")}),!l&&e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})]}),e.jsx(f,{children:t&&e.jsx(zr,{endpoint:t.endpoint,deps:[t],selected:!0,footer:!0,action:c=>e.jsx(jt,{session:n,...c})},t.endpoint)}),l&&e.jsx(f,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2},children:e.jsx(ue,{connectScope:"user",connectText:s("userCenter.storage.spaces.connected.switch"),session:n,onSuccess:i})})]})}Ct.propTypes={spaceGateway:u.object};function un(){const{t}=D(),{updateSpaceGateway:s,session:o}=ze(),n=({spaceGateway:l})=>s(l);return e.jsxs(f,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{sx:{fontSize:"16px",fontWeight:"bold"},children:t("userCenter.storage.spaces.connect.providerForStorage")}),e.jsx(Er,{viewBox:"0 0 228 258",style:{width:"156px",height:"156px",margin:"16px 0"}}),e.jsx(f,{children:e.jsx(ue,{session:o,onSuccess:n})})]})}function pn(){const{spaceGateway:t,hasStorageEndpoint:s,loading:o}=ze(),{isMyself:n}=Ae();return n?o?e.jsx(Ar,{relative:"parent",children:e.jsx(V,{})}):e.jsx(fn,{children:e.jsx(f,{sx:{maxWidth:"720px"},children:s?e.jsx(Ct,{spaceGateway:t}):e.jsx(un,{})})}):null}function xn(){return e.jsx(wt,{children:e.jsx(pn,{})})}const fn=ee(f)`
122
+ height: 100%;
123
+ overflow-y: auto;
124
+ `;function ao(){const{api:t}=nr(),s=y.useRef(null),n=Ut().tab,i=new URLSearchParams(window.location.search).get("embed")||window.sessionStorage?.getItem("embed"),c=or(),p=T(()=>({...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:window?.blocklet?.componentMountPoints.map(x=>({...x,meta:{...x,did:x.did,name:x.name||x.title||"",logo:"logo.png"}}))})),r=async x=>{const{input:m,sessionId:h}=x;try{await t.destroySelf({input:{...m,sessionId:h}})}catch(C){console.error("destroy myself error",C)}};return e.jsx(vr,{children:e.jsxs(Rr,{ref:s,embed:i==="1",currentTab:n?ce(Pe.WELLKNOWN_SERVICE_PATH_PREFIX,"user",n):"",disableAutoRedirect:n==="settings",children:[n==="notifications"?e.jsx(Zr,{blocklets:[p],context:c}):null,n==="nfts"?e.jsx(nn,{}):null,n==="settings"?e.jsx(yt,{onDestroySelf:r}):null,n==="did-spaces"?e.jsx(xn,{}):null]})})}export{ao as default};
@@ -1,4 +1,4 @@
1
- import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-BOHKtf8y.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{b as S,n as p}from"./vendor-ux-Cra9XTth.js";import{a as C}from"./page-header-18voA300.js";import{a1 as g}from"./index-Cbf4geph.js";import{o as b}from"./vendor-arcblock--zSibe1w.js";import{u as k}from"./config-space-CrH2JnlQ.js";import{C as y,D as v,a as w}from"./connect-to-nCPxtJH1.js";import{S as c}from"./step-actions-DmraEWCH.js";import{S as E}from"./layout-zg5WZEdp.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BJeg7L1z.js";import"./api-Rnh95Dt4.js";import"./index-BFOTYlfC.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-DSNvDaKK.js";import"./index-DBs9Ljax.js";import"./use-mobile-BDciCFXT.js";import"./content-layout-BZKNdb6s.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsx(r,{sx:{width:"100%",maxWidth:"720px"},children:x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{})}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
1
+ import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-CAIaAq-_.js";import{r as h}from"./vendor-react-Dvs43sk9.js";import{b as S,n as p}from"./vendor-ux-C1NY8cuW.js";import{a as C}from"./page-header-Fuppayrb.js";import{a1 as g}from"./index-l5234Nwn.js";import{o as b}from"./vendor-arcblock-DU4xNzGM.js";import{u as k}from"./config-space-DmPAo0Uc.js";import{C as y,D as v,a as w}from"./connect-to-duHzVFsc.js";import{S as c}from"./step-actions-GaXwswph.js";import{S as E}from"./layout-B_66AMXX.js";import"./vendor-utils-BOkrEpKO.js";import"./vendor-hooks-DTeIFVkk.js";import"./lottie-web-4koyQiv_.js";import"./spaces-KdeOps1v.js";import"./api-Rnh95Dt4.js";import"./index-7Wt3WOLU.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-dytlEEOb.js";import"./index-DBs9Ljax.js";import"./use-mobile-CO13Oymt.js";import"./content-layout-D5EfCmvE.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsx(r,{sx:{width:"100%",maxWidth:"720px"},children:x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(v,{})}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(w,{onConnect:u,storageEndpoint:s})}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  `;export{T as default};
@@ -1,4 +1,4 @@
1
- import{D as w1,J as z1,j as r,Y as Y1,$ as W1,I as q1,ds as _1,ar as y1,ak as U,a$ as R,d7 as I1,b1 as $1,am as B1,T,bC as e6,z as t6,cs as n6,a6,Q as r6}from"./vendor-mui-core-BOHKtf8y.js";import{C as x,a as i6,ab as S1,J as M,c as s6,I as o6,F as c6}from"./vendor-utils-BOkrEpKO.js";import{T as l6,A as F1,e as u6,m as C6,s as p6,a as d6,n as t1,aF as n1}from"./vendor-ux-Cra9XTth.js";import{r as t}from"./vendor-react-Dvs43sk9.js";import{k as L1,b as v1,a as Z}from"./vendor-hooks-DTeIFVkk.js";import{bp as Y,T as W,bJ as U1,bK as h6,aj as H,v as m6,by as E6,bA as g6}from"./index-Cbf4geph.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-DSNvDaKK.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return z1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
1
+ import{D as w1,J as z1,j as r,Y as Y1,$ as W1,I as q1,ds as _1,ar as y1,ak as U,a$ as R,d7 as I1,b1 as $1,am as B1,T,bC as e6,z as t6,cs as n6,a6,Q as r6}from"./vendor-mui-core-CAIaAq-_.js";import{C as x,a as i6,ab as S1,J as M,c as s6,I as o6,F as c6}from"./vendor-utils-BOkrEpKO.js";import{T as l6,A as F1,e as u6,m as C6,s as p6,a as d6,n as t1,aF as n1}from"./vendor-ux-C1NY8cuW.js";import{r as t}from"./vendor-react-Dvs43sk9.js";import{k as L1,b as v1,a as Z}from"./vendor-hooks-DTeIFVkk.js";import{bp as Y,T as W,bJ as U1,bK as h6,aj as H,v as m6,by as E6,bA as g6}from"./index-l5234Nwn.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-dytlEEOb.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return z1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
2
2
  1. Please contact the DID Space administrator to verify the relevant configuration.
3
3
  2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.`,networkError:"DID Space is currently unreachable due to potential server issues, network problems, or maintenance. Please click the link to visit the homepage and check its status.",incompatible:`The current connection of DID Spaces version ({spaceVersion}) is not compatible with the component version ({expectVersion}). Please contact the administrator for adjustments.
4
4
  If you are the administrator, you can click the link below to take action.`},gateway:{add:{invalidUrl:"Invalid DID Spaces gateway url",label:"Enter the url of the DID Spaces",title:"Add DID Spaces"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} show DID Spaces NFT",success:"Connected successfully"},helperText:{fixCorsError:"Fixing CORS Errors When Connecting to DID Spaces"}}},auditLog:{backup:{description:"A backup operation was completed {relativeTime}"},restore:{description:"A restore operation was completed {relativeTime}"},connected:{description:"A connection was established {relativeTime}"},disconnected:{description:"The connection was disconnected {relativeTime}"},objectsSync:{description:"{totalCount} objects ({size}) were synchronized {relativeTime}"}}}),y6=U1.flatten({common:{cancel:"取消",confirm:"确认",delete:"删除",error:"错误",open:"打开",unknown:"未知",invalidUrl:"无效的 url: {url}",upgrade:"升级",viewMore:"查看更多"},storage:{spaces:{authorize:{title:"连接 {appName} 至 DID Spaces",scan:"使用你的 DID Wallet 扫描下面的二维码以允许应用 {appName} 连接至 DID Spaces",success:"连接成功"},connect:{reconnect:"立即重连",useSpaceGateway:"使用 DID Spaces 网关连接",useWallet:"连接至 DID Spaces",howToGetGatewayUrl:"如何获取 DID Spaces 的网关地址",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"},disconnected:{tag:"连接已断开"},error:{tag:"需要关注",blockedByCors:"因 CORS 限制,访问被阻止",unreachable:"DID Space 无法访问",expired:"DID Spaces 已过期,点击此链接重新订阅",pastDue:"DID Spaces 有未支付账单,点击此链接完成支付",invalid:"DID Spaces 订阅异常,点击此链接检查",unitLimit:"DID Spaces 免费额度已用完,点击此链接付费升级",cors:`连接请求可能因 CORS 限制而失败:
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lottie-react.esm-M5fKy3fg.js","assets/vendor-react-Dvs43sk9.js"])))=>i.map(i=>d[i]);
2
- import{j as e,ak as s,c1 as h,T as k,z as V,bp as G,b6 as q,bq as U,c9 as O,Q as R,at as I,ar as B,ca as X,cb as J,cc as W,I as H,cd as K,D as Y,aj as Q}from"./vendor-mui-core-BOHKtf8y.js";import{r as j}from"./vendor-react-Dvs43sk9.js";import{q as Z,g as N,u as ee,j as te,e as oe}from"./vendor-hooks-DTeIFVkk.js";import{C as re,R as ie,_ as C}from"./vendor-ux-Cra9XTth.js";import{X as se}from"./vendor-utils-BOkrEpKO.js";import{getAIKitComponent as ne}from"./index-DlaHLSvf.js";import"./lottie-web-4koyQiv_.js";import"./index-Cbf4geph.js";import"./vendor-arcblock--zSibe1w.js";import"./index-BPy8_fa2.js";import"./index-DRYJ0xIl.js";const T=j.createContext({}),D=()=>j.useContext(T);function ae({children:o,restrictions:f,i18n:d,theme:r}){const[n,b]=Z({loading:!1}),c=i=>b(g=>({...g,loading:i})),p=j.useMemo(()=>({...n,onLoading:c,restrictions:f,i18n:d}),[n]);return e.jsx(re,{theme:r,children:e.jsx(T.Provider,{value:p,children:o})})}const le=["1024x1024","1024x1792","1792x1024"],de=["256x256","512x512","1024x1024"],ce=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function xe({onSubmit:o}){const{loading:f,i18n:d}=D(),r=N({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),n=()=>{const i=JSON.parse(JSON.stringify(r));Object.values(r).every(y=>!!y)&&o(i)},{run:b}=ee(n,{wait:500}),c={width:"100%",pl:1,pr:1},p=r.model==="dall-e-2"?de:le;return e.jsxs(pe,{onSubmit:i=>i.preventDefault(),children:[e.jsx(s,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(h,{container:!0,sx:{gap:2.5},children:[e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:d("aiImagePrompt")}),e.jsx(V,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:d("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:r.prompt??"",onChange:i=>{i.stopPropagation(),r.prompt=i.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageModel")}`}),e.jsx(G,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:r.model,onChange:i=>{r.number=1,r.size="1024x1024",r.model=i.target.value},children:ce.map(i=>e.jsx(q,{value:i.value,control:e.jsx(U,{size:"small"}),label:i.label},i.label))})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageSize")}: ${r.size}`}),e.jsx(h,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(s,{sx:{flex:1},children:e.jsx(s,{...c,children:e.jsx(O,{size:"small",min:0,max:p.length-1,step:1,value:p.findIndex(i=>i==r.size),onChange:(i,g)=>{r.size=p[g]}})})})})]}),r.model==="dall-e-2"&&e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageNumber")}: ${r.number}`}),e.jsx(s,{...c,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:r.number,onChange:(i,g)=>{i.stopPropagation(),r.number=Number(g)}})})]})]})}),e.jsx(R,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:b,disabled:f,children:d(f?"aiImageGenerating":"aiImageGenerate")},f?"loading-submit":"submit")]})}const pe=I(s)`
2
+ import{j as e,ak as s,c1 as h,T as k,z as V,bp as G,b6 as q,bq as U,c9 as O,Q as R,at as I,ar as B,ca as X,cb as J,cc as W,I as H,cd as K,D as Y,aj as Q}from"./vendor-mui-core-CAIaAq-_.js";import{r as j}from"./vendor-react-Dvs43sk9.js";import{q as Z,g as N,u as ee,j as te,e as oe}from"./vendor-hooks-DTeIFVkk.js";import{C as re,R as ie,_ as C}from"./vendor-ux-C1NY8cuW.js";import{X as se}from"./vendor-utils-BOkrEpKO.js";import{getAIKitComponent as ne}from"./index-B2HJDbWz.js";import"./lottie-web-4koyQiv_.js";import"./index-l5234Nwn.js";import"./vendor-arcblock-DU4xNzGM.js";import"./index-BPy8_fa2.js";import"./index-DRYJ0xIl.js";const T=j.createContext({}),D=()=>j.useContext(T);function ae({children:o,restrictions:f,i18n:d,theme:r}){const[n,b]=Z({loading:!1}),c=i=>b(g=>({...g,loading:i})),p=j.useMemo(()=>({...n,onLoading:c,restrictions:f,i18n:d}),[n]);return e.jsx(re,{theme:r,children:e.jsx(T.Provider,{value:p,children:o})})}const le=["1024x1024","1024x1792","1792x1024"],de=["256x256","512x512","1024x1024"],ce=[{label:"DALL·E 3",value:"dall-e-3"},{label:"DALL·E 2",value:"dall-e-2"}];function xe({onSubmit:o}){const{loading:f,i18n:d}=D(),r=N({model:"dall-e-3",prompt:"",size:"1024x1024",number:1}),n=()=>{const i=JSON.parse(JSON.stringify(r));Object.values(r).every(y=>!!y)&&o(i)},{run:b}=ee(n,{wait:500}),c={width:"100%",pl:1,pr:1},p=r.model==="dall-e-2"?de:le;return e.jsxs(pe,{onSubmit:i=>i.preventDefault(),children:[e.jsx(s,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",m:2,mb:0},children:e.jsxs(h,{container:!0,sx:{gap:2.5},children:[e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:d("aiImagePrompt")}),e.jsx(V,{sx:{width:1,mt:1},size:"small",type:"text",required:!0,placeholder:d("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:r.prompt??"",onChange:i=>{i.stopPropagation(),r.prompt=i.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageModel")}`}),e.jsx(G,{row:!0,sx:{".MuiFormControlLabel-label":{fontSize:"12px",color:"text.primary"}},value:r.model,onChange:i=>{r.number=1,r.size="1024x1024",r.model=i.target.value},children:ce.map(i=>e.jsx(q,{value:i.value,control:e.jsx(U,{size:"small"}),label:i.label},i.label))})]}),e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageSize")}: ${r.size}`}),e.jsx(h,{container:!0,sx:{gap:2.5,pt:1},children:e.jsx(s,{sx:{flex:1},children:e.jsx(s,{...c,children:e.jsx(O,{size:"small",min:0,max:p.length-1,step:1,value:p.findIndex(i=>i==r.size),onChange:(i,g)=>{r.size=p[g]}})})})})]}),r.model==="dall-e-2"&&e.jsxs(h,{size:12,children:[e.jsx(k,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${d("aiImageNumber")}: ${r.number}`}),e.jsx(s,{...c,children:e.jsx(O,{size:"small",defaultValue:1,valueLabelDisplay:"auto",step:1,min:1,max:10,value:r.number,onChange:(i,g)=>{i.stopPropagation(),r.number=Number(g)}})})]})]})}),e.jsx(R,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:b,disabled:f,children:d(f?"aiImageGenerating":"aiImageGenerate")},f?"loading-submit":"submit")]})}const pe=I(s)`
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  height: 100%;