@abtnode/blocklet-services 1.16.47-beta-20250805-140707-3a4df7fd → 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-BSEf18wl.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-Bi6BoTuW.js → add-component-core-DbPZIJoa.js} +39 -39
  12. package/dist/assets/add-resource-D0yHahVH.js +1 -0
  13. package/dist/assets/{addon-Bdomwmjo.js → addon-S-x2oOBW.js} +1 -1
  14. package/dist/assets/{advanced-CVn4Hcf5.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-BeyMAsY0.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-DJGgsS-M.js → arrow-down.svg-mrRaEeKB.js} +1 -1
  21. package/dist/assets/{audit-logs-BITrjM7H.js → audit-logs-FBpDejHE.js} +1 -1
  22. package/dist/assets/{authorize-DTBqTI9x.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-BGgw8cEJ.js → branding-BX3gHZjy.js} +2 -2
  26. package/dist/assets/{branding-CUo9AQgP.js → branding-D1DQzFQg.js} +1 -1
  27. package/dist/assets/{bundle-avatar-nqQPph1V.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-B0oh9oaL.js → complete-QPs88Xvq.js} +1 -1
  32. package/dist/assets/{component-tmpSeXZN.js → component-IvlOow7w.js} +3 -3
  33. package/dist/assets/{config-DzbUoUBj.js → config-BV13SrRs.js} +1 -1
  34. package/dist/assets/config-ZidMeHMX.js +53 -0
  35. package/dist/assets/{config-DtGAnIEK.js → config-gRz3hnHQ.js} +1 -1
  36. package/dist/assets/{config-navigation-XlR3iC8u.js → config-navigation--k3uzAVY.js} +3 -3
  37. package/dist/assets/{config-space-Dc8fZcHS.js → config-space-DmPAo0Uc.js} +1 -1
  38. package/dist/assets/{confirm-BE3P2t7f.js → confirm-DwicyBRo.js} +1 -1
  39. package/dist/assets/{connect-CN37jxgn.js → connect-CCyhtcsX.js} +1 -1
  40. package/dist/assets/{connect-DZZ-4AIX.js → connect-CXYynAHv.js} +1 -1
  41. package/dist/assets/{connect-to-Bkmg684d.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-DxuecHqY.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-BxYuZyLa.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-Bfay_KsZ.js → domain-D0AJ_QKJ.js} +1 -1
  50. package/dist/assets/{domain-action-card-cQQZnRXd.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-BQwo1xmz.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-LngoI7mR.js → exchange-passport-Duueo_OR.js} +1 -1
  59. package/dist/assets/{form-BBQ9hkWe.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-DTDoJVJw.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-D9FcK20t.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-DhAlOm-t.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-iEC5ZdMS.js → index-7UPsmpeB.js} +1 -1
  77. package/dist/assets/{index-7zXCE3Ua.js → index-7Wt3WOLU.js} +1 -1
  78. package/dist/assets/{index-CTur5nk-.js → index-8djlz-MG.js} +1 -1
  79. package/dist/assets/{index-BsDq3W_j.js → index-B2HJDbWz.js} +19 -19
  80. package/dist/assets/{index-gkPitOyo.js → index-BAYFdR7m.js} +1 -1
  81. package/dist/assets/{index-C0rREY1Q.js → index-BDSe7HLW.js} +1 -1
  82. package/dist/assets/{index-BEmLxB7B.js → index-Br7EG_jz.js} +1 -1
  83. package/dist/assets/{index-CtthKnbV.js → index-BsHHb1rN.js} +1 -1
  84. package/dist/assets/{index-CkAhcTYd.js → index-CMhFwlvk.js} +1 -1
  85. package/dist/assets/{index-B5vvgnse.js → index-CTM6wiOX.js} +1 -1
  86. package/dist/assets/{index-BSWcZ39K.js → index-CgCVx1sf.js} +12 -12
  87. package/dist/assets/{index-DSXRZM65.js → index-CniiyWPl.js} +4 -4
  88. package/dist/assets/{index-sgUJ1UrA.js → index-Cp_r7DvZ.js} +1 -1
  89. package/dist/assets/{index-Yow2d7gN.js → index-Cw89V6wx.js} +1 -1
  90. package/dist/assets/{index-ClmgRx8j.js → index-Cy8O6s0C.js} +1 -1
  91. package/dist/assets/index-D05HWeh6.js +1 -0
  92. package/dist/assets/{index-D9V5Umc7.js → index-DFmxGkG9.js} +12 -12
  93. package/dist/assets/{index-CK7BAVRn.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-BETqi_AV.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-Bh3Eqgyw.js → index-Dmil4V_-.js} +1 -1
  99. package/dist/assets/{index-DQFj-nYH.js → index-DtYei0B0.js} +2 -1
  100. package/dist/assets/{index-BXQsZlT0.js → index-GRZ8tMAV.js} +1 -1
  101. package/dist/assets/{index-LNOwklRT.js → index-Mu2Sji0B.js} +1 -1
  102. package/dist/assets/{index-DSNvDaKK.js → index-dytlEEOb.js} +1 -1
  103. package/dist/assets/{index-DXEP0e1N.js → index-khjK2Z9N.js} +1 -1
  104. package/dist/assets/{index-BGbMta1w.js → index-l5234Nwn.js} +123 -122
  105. package/dist/assets/{invitation-US90mCZ0.js → invitation-BiM8UWsv.js} +1 -1
  106. package/dist/assets/{invite-DyIqbjve.js → invite-CAmhHCq3.js} +1 -1
  107. package/dist/assets/{isURL-Bawv3imX.js → isURL-DA2-tMLY.js} +1 -1
  108. package/dist/assets/{issue-passport-C5vD2vwu.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-CxWEfJb1.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-DE-cz95w.js → layout-B_66AMXX.js} +1 -1
  117. package/dist/assets/{list-CwpC3pkX.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-DBxh165t.js → list-uh5difGn.js} +2 -2
  120. package/dist/assets/localization-DrnuLXG0.js +1 -0
  121. package/dist/assets/{log-DmRKBFGC.js → log-22OBDAZV.js} +1 -1
  122. package/dist/assets/logger-Dth79fFL.js +1 -0
  123. package/dist/assets/{login-DJCu1xgf.js → login-6f9xq_uw.js} +1 -1
  124. package/dist/assets/{login-oauth-callback-DUU4jnz6.js → login-oauth-callback-mHVhjuxd.js} +1 -1
  125. package/dist/assets/{logo-uploader-Dkqno_Ja.js → logo-uploader-3Gf22QS4.js} +2 -2
  126. package/dist/assets/{lost-passport-ImDGPXaC.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-q1wrayPW.js → open-window-nJnt1xUe.js} +1 -1
  129. package/dist/assets/{over-due-invoice-payment-JvwfN8wc.js → over-due-invoice-payment-D1hhqrpZ.js} +1 -1
  130. package/dist/assets/{overview-BmpIT6Q_.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-C25fvRz1.js → passport-item-4tKOyK2N.js} +1 -1
  133. package/dist/assets/{permission-jA6KoYLs.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-CVbnWFXH.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-DZamcnzN.js → security-DO4dtLin.js} +1 -1
  150. package/dist/assets/{session-DwRV85k4.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-BVGaa6Hu.js → spaces-KdeOps1v.js} +1 -1
  155. package/dist/assets/{start-aPtgs0SV.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-C3kkPu09.js → status-E4FMnQqN.js} +1 -1
  158. package/dist/assets/{step-actions-CAm14q1m.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-D7qYznX0.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-DTdSCUkM.js → traffic-CW6sZXQr.js} +1 -1
  166. package/dist/assets/{transfer-C5DkV4KG.js → transfer-BUR6hEv2.js} +1 -1
  167. package/dist/assets/{unsubscribe-CLba7U2w.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-Jy5Iq5_O.js → user-center-DjDTKFEf.js} +3 -3
  174. package/dist/assets/{user-sessions-BGnHveoB.js → user-sessions-D3Rr-i1p.js} +1 -1
  175. package/dist/assets/{util-C5cbPYrK.js → util-Bn2B0xma.js} +1 -1
  176. package/dist/assets/{util-D2_crIYF.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-BowysNWx.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-DJwbu06V.js +0 -1
  194. package/dist/assets/aigne-DkujEYax.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-yZbzEM9S.js +0 -46
  198. package/dist/assets/de-CKHR0Dxi.js +0 -1
  199. package/dist/assets/domains-CmO_JEoH.js +0 -1
  200. package/dist/assets/empty-DhZfJeme.js +0 -1
  201. package/dist/assets/engine-te2i4Xkp.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-96g8FE-z.js +0 -1
  205. package/dist/assets/gen-simple-access-key-eAA9bcyC.js +0 -1
  206. package/dist/assets/get-safe-url-CoK26-Ak.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-7viVkiSg.js +0 -124
  211. package/dist/assets/index-IvJAtHzW.js +0 -1
  212. package/dist/assets/item-CicRcRrO.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-DDJ05J06.js +0 -1
  216. package/dist/assets/logger-D5kKPkv7.js +0 -1
  217. package/dist/assets/preferences-DRk6dZEm.js +0 -1
  218. package/dist/assets/profile-embed-CWn_g09P.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-vKH4JQbV.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-BPlpWr_6.js +0 -1
  225. package/dist/assets/setup-kwTvymfp.js +0 -30
  226. package/dist/assets/studio-BfthGuiI.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-ZxLzFYBo.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-COCKCQEf.js +0 -1
  234. package/dist/assets/zh-D_lJZbI3.js +0 -1
  235. package/dist/assets/zh-tw-CfWhHTHL.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as X,av as B,f as L,b_ as Y,cl as J}from"./vendor-mui-core-BOHKtf8y.js";import{r as d,k as V,L as z,n as Z,o as ee}from"./vendor-react-Dvs43sk9.js";import{H as A,aL as ae}from"./index-BGbMta1w.js";import{e as te}from"./vendor-hooks-DTeIFVkk.js";import{M as ie,m,U as E,V as S}from"./vendor-ux-Cra9XTth.js";import{z as re}from"./vendor-arcblock--zSibe1w.js";const U=d.createContext(null),oe=e=>{const i=d.use(U);return d.useLayoutEffect(()=>{},[]),i};function se({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(U,{value:l,...i,children:e})}function le({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(ne,{style:{width:i,height:i},children:[a.jsx(ie,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const ne=m("div")`
1
+ import{j as a,D as M,T as _,ci as C,Q as W,cj as q,aV as X,ak as h,ck as Y,aU as Z,av as B,f as L,b_ as J,cl as K}from"./vendor-mui-core-CAIaAq-_.js";import{r as d,k as V,L as z,n as ee,o as ae}from"./vendor-react-Dvs43sk9.js";import{H as E,aL as te}from"./index-l5234Nwn.js";import{e as ie}from"./vendor-hooks-DTeIFVkk.js";import{M as re,m,U as A,V as S}from"./vendor-ux-C1NY8cuW.js";import{z as oe}from"./vendor-arcblock-DU4xNzGM.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
2
2
  position: relative;
3
3
  .badge-point {
4
4
  position: absolute;
@@ -12,7 +12,7 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
12
12
  0px 1px 4px rgba(0, 0, 0, 0.3),
13
13
  0px 0px 20px rgba(0, 0, 0, 0.1);
14
14
  }
15
- `;function de({images:e,links:i,prefix:t="/images",addons:r=void 0,logo:s=void 0,...l}){const o=I(),n=V(),c=(p,x)=>new RegExp(`/${x}`).test(n.pathname);return a.jsxs(ce,{...l,children:[a.jsx(z,{to:"/",className:"sidebar-logo",children:s||a.jsx(E,{showText:!1,size:20})}),i.map(({url:p,name:x,title:j,showBadge:g})=>{const f=c(p,x);return a.jsxs(he,{component:z,selected:f,to:p,children:[a.jsx(le,{name:e[x],size:36,color:f?"#00c2c4":o.typography.color.main,prefix:t,showBadge:g}),a.jsx(_,{component:"span",className:"menu-title",children:j})]},p)}),a.jsx("div",{style:{flex:1}}),r]})}const ce=d.memo(m("div")`
15
+ `;function ce({images:e,links:i,prefix:t="/images",addons:r=void 0,logo:s=void 0,...l}){const o=M(),n=V(),c=(x,p)=>new RegExp(`/${p}`).test(n.pathname);return a.jsxs(he,{...l,children:[a.jsx(z,{to:"/",className:"sidebar-logo",children:s||a.jsx(A,{showText:!1,size:20})}),i.map(({url:x,name:p,title:b,showBadge:g})=>{const f=c(x,p);return a.jsxs(pe,{component:z,selected:f,to:x,children:[a.jsx(ne,{name:e[p],size:36,color:f?"#00c2c4":o.typography.color.main,prefix:t,showBadge:g}),a.jsx(_,{component:"span",className:"menu-title",children:b})]},x)}),a.jsx("div",{style:{flex:1}}),r]})}const he=d.memo(m("div")`
16
16
  flex: 1;
17
17
  display: flex;
18
18
  flex-direction: column;
@@ -33,7 +33,7 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
33
33
  display: block;
34
34
  }
35
35
  }
36
- `),M="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",he=m(W)`
36
+ `),T="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",pe=m(W)`
37
37
  && {
38
38
  display: flex;
39
39
  flex-direction: column;
@@ -41,13 +41,13 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
41
41
  align-items: center;
42
42
  width: 100%;
43
43
  transition: all 200ms ease-in-out;
44
- background: ${e=>e.selected?M:""};
44
+ background: ${e=>e.selected?T:""};
45
45
  padding: 24px 0;
46
46
  border-left: 2px solid ${e=>e.selected?C.A700:"transparent"};
47
47
  border-radius: 0;
48
48
 
49
49
  &:hover {
50
- background: ${M};
50
+ background: ${T};
51
51
  border-left-color: ${C.A700};
52
52
  }
53
53
 
@@ -62,7 +62,7 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
62
62
  color: ${e=>e.theme.palette.text.primary};
63
63
  }
64
64
  }
65
- `,pe=m(K)`
65
+ `,xe=m(Y)`
66
66
  && {
67
67
  z-index: ${e=>e.theme.zIndex.drawer};
68
68
  background: ${e=>e.theme.palette.background.default};
@@ -132,7 +132,7 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
132
132
  display: block;
133
133
  }
134
134
  }
135
- `;function xe({onToggleMenu:e,brand:i=void 0,description:t=void 0,addons:r=void 0,brandAddon:s=void 0,homeUrl:l="/",logo:o=void 0,children:n,...c}){return a.jsx(pe,{position:"sticky",className:"header",...c,children:a.jsxs(Q,{disableGutters:!1,className:"header-toolbar",children:[a.jsx(W,{color:"inherit","aria-label":"open drawer",className:"header-menu","aira-label":"header menu button",onClick:e,children:a.jsx(q,{})}),a.jsxs(z,{to:l,className:"header-link",children:[a.jsx(h,{sx:{display:{xs:"none",md:"block"}},className:"header-logo",children:o||a.jsx(E,{showText:!1})}),a.jsxs("div",{className:"header-title",children:[a.jsxs(_,{component:"h2",noWrap:!0,className:"header-title__primary",children:[i,s]}),a.jsx(_,{component:"p",noWrap:!0,className:"header-title__secondary",children:t})]})]}),a.jsx(h,{sx:{flexGrow:1}}),!!n&&a.jsx("div",{className:"header-children",children:n}),a.jsx("div",{className:"header-addons",children:r})]})})}const ue=m("div")`
135
+ `;function ue({onToggleMenu:e,brand:i=void 0,description:t=void 0,addons:r=void 0,brandAddon:s=void 0,homeUrl:l="/",logo:o=void 0,children:n,...c}){return a.jsx(xe,{position:"sticky",className:"header",...c,children:a.jsxs(q,{disableGutters:!1,className:"header-toolbar",children:[a.jsx(W,{color:"inherit","aria-label":"open drawer",className:"header-menu","aira-label":"header menu button",onClick:e,children:a.jsx(X,{})}),a.jsxs(z,{to:l,className:"header-link",children:[a.jsx(h,{sx:{display:{xs:"none",md:"block"}},className:"header-logo",children:o||a.jsx(A,{showText:!1})}),a.jsxs("div",{className:"header-title",children:[a.jsxs(_,{component:"h2",noWrap:!0,className:"header-title__primary",children:[i,s]}),a.jsx(_,{component:"p",noWrap:!0,className:"header-title__secondary",children:t})]})]}),a.jsx(h,{sx:{flexGrow:1}}),!!n&&a.jsx("div",{className:"header-children",children:n}),a.jsx("div",{className:"header-addons",children:r})]})})}const me=m("div")`
136
136
  &.dashboard {
137
137
  display: flex;
138
138
  flex-direction: column;
@@ -160,7 +160,7 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
160
160
  box-shadow: 2px 16px 10px 0 rgba(0, 0, 0, ${e=>e.theme.palette.mode==="light"?.05:.5});
161
161
  border: 0;
162
162
  }
163
- `;function me({links:e=[],brand:i="",description:t="",images:r,title:s="Home",brandAddon:l=void 0,headerAddon:o=void 0,prefix:n="/images",fullWidth:c=!1,contentLayout:p="column",className:x="",homeUrl:j="/",logo:g=void 0,children:f,...P}){const w=te(document.body)?.width||0,[k,v]=d.useState(w>=960?"permanent":"temporary"),[y,$]=d.useState(k==="permanent");d.useEffect(()=>{const N=w>=960?"permanent":"temporary";v(N),$(N!=="temporary")},[w]);const b=()=>{$(!y)},F=c||p==="row";return a.jsxs(ue,{className:`dashboard ${x}`,...P,children:[a.jsx(A,{title:`${s}-${i}`}),a.jsx(xe,{className:"dashboard__header",onToggleMenu:b,brand:i,brandAddon:l,description:t,addons:o,homeUrl:j,logo:g}),a.jsxs(h,{className:"dashboard__body",sx:{display:"flex"},children:[a.jsx(X,{variant:k,className:"drawer",classes:{paper:"drawerPaper"},open:y,onClose:b,ModalProps:{disablePortal:!0,keepMounted:!0},children:a.jsx(de,{className:"dashboard__sidebar",images:r,links:e,prefix:n,logo:g})}),a.jsxs(h,{className:"dashboard__main",children:[a.jsx(B,{maxWidth:F?!1:"lg",className:"dashboard__content",children:f}),a.jsx(S,{})]})]})]})}function H({routerLinkComponent:e,to:i,external:t=!1,children:r,...s}){return t?a.jsx("a",{href:i,...s,children:r}):a.jsx(e,{to:i,...s,children:r})}function R({...e}){return a.jsx(H,{routerLinkComponent:z,...e})}function be({className:e="",...i}){const t=i.external&&typeof e=="function"?e({}):e;return a.jsx(H,{routerLinkComponent:Z,className:t,...i})}function D(e,i){if(e.children?.length)return ge(e,i);const{url:t,icon:r,title:s,showBadge:l,external:o,active:n}=e;return a.jsx("li",{className:"layout-sidebar-item",children:a.jsxs(be,{external:o,to:t,className:({isActive:c})=>L("layout-sidebar-link",{"layout-sidebar-link--active":o?n:c}),children:[r&&a.jsx("span",{className:`layout-sidebar-icon ${l?"layout-sidebar-badge":""}`,children:r}),a.jsx(_,{component:"span",className:"layout-sidebar-link-text",children:s})]})},`${t}-${i}`)}function ge(e,i){return a.jsxs("li",{className:"layout-sidebar-group",children:[a.jsx("span",{className:"layout-sidebar-group-title",children:e.title}),a.jsx("ul",{children:e.children.map(D)})]},`group-${e.title}-${i}`)}function T({links:e,addons:i=void 0,dense:t=!1,...r}){return a.jsxs(ye,{...r,className:L({"layout-sidebar-dense":t}),children:[a.jsx("ul",{children:e.map(D)}),a.jsx("div",{style:{flex:1}}),i]})}const fe="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",ye=m("div")`
163
+ `;function be({links:e=[],brand:i="",description:t="",images:r,title:s="Home",brandAddon:l=void 0,headerAddon:o=void 0,prefix:n="/images",fullWidth:c=!1,contentLayout:x="column",className:p="",homeUrl:b="/",logo:g=void 0,children:f,...P}){const w=ie(document.body)?.width||0,[v,F]=d.useState(w>=960?"permanent":"temporary"),[k,y]=d.useState(v==="permanent");d.useEffect(()=>{const N=w>=960?"permanent":"temporary";F(N),y(N!=="temporary")},[w]);const $=()=>{y(!k)},j=c||x==="row";return a.jsxs(me,{className:`dashboard ${p}`,...P,children:[a.jsx(E,{title:`${s}-${i}`}),a.jsx(ue,{className:"dashboard__header",onToggleMenu:$,brand:i,brandAddon:l,description:t,addons:o,homeUrl:b,logo:g}),a.jsxs(h,{className:"dashboard__body",sx:{display:"flex"},children:[a.jsx(Z,{variant:v,className:"drawer",classes:{paper:"drawerPaper"},open:k,onClose:$,ModalProps:{disablePortal:!0,keepMounted:!0},children:a.jsx(ce,{className:"dashboard__sidebar",images:r,links:e,prefix:n,logo:g})}),a.jsxs(h,{className:"dashboard__main",children:[a.jsx(B,{maxWidth:j?!1:"lg",className:"dashboard__content",children:f}),a.jsx(S,{})]})]})]})}function U({routerLinkComponent:e,to:i,external:t=!1,children:r,...s}){return t?a.jsx("a",{href:i,...s,children:r}):a.jsx(e,{to:i,...s,children:r})}function R({...e}){return a.jsx(U,{routerLinkComponent:z,...e})}function ge({className:e="",...i}){const t=i.external&&typeof e=="function"?e({}):e;return a.jsx(U,{routerLinkComponent:ee,className:t,...i})}function D(e,i){if(e.children?.length)return fe(e,i);const{url:t,icon:r,title:s,showBadge:l,external:o,active:n}=e;return a.jsx("li",{className:"layout-sidebar-item",children:a.jsxs(ge,{external:o,to:t,className:({isActive:c})=>L("layout-sidebar-link",{"layout-sidebar-link--active":o?n:c}),children:[r&&a.jsx("span",{className:`layout-sidebar-icon ${l?"layout-sidebar-badge":""}`,children:r}),a.jsx(_,{component:"span",className:"layout-sidebar-link-text",children:s})]})},`${t}-${i}`)}function fe(e,i){return a.jsxs("li",{className:"layout-sidebar-group",children:[a.jsx("span",{className:"layout-sidebar-group-title",children:e.title}),a.jsx("ul",{children:e.children.map(D)})]},`group-${e.title}-${i}`)}function I({links:e,addons:i=void 0,dense:t=!1,...r}){return a.jsxs(je,{...r,className:L({"layout-sidebar-dense":t}),children:[a.jsx("ul",{children:e.map(D)}),a.jsx("div",{style:{flex:1}}),i]})}const ye="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",je=m("div")`
164
164
  display: flex;
165
165
  flex-direction: column;
166
166
  ul {
@@ -179,7 +179,7 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
179
179
  &:hover,
180
180
  &.layout-sidebar-link--active {
181
181
  color: ${e=>e.theme.palette.primary.main};
182
- background: ${fe};
182
+ background: ${ye};
183
183
  border-left-color: ${e=>e.theme.palette.primary.main};
184
184
  }
185
185
  }
@@ -285,7 +285,7 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
285
285
  margin-top: 16px;
286
286
  }
287
287
  }
288
- `;function je({closeMenu:e,...i}){const t=V();return d.useEffect(()=>{e()},[t]),a.jsx(ae,{...i})}function G(e,i){return e.map(t=>t.children?.length?{...t,label:t.title,children:G(t.children,i)}:{...t,label:a.jsx(R,{to:t.url,external:t.external,children:t.title}),active:t.external?t.active:!!ee({path:t.url,end:!1},i.pathname)})}function we({title:e="Home",headerProps:i={},links:t=[],sidebarWidth:r=120,fullWidth:s=!1,dense:l="auto",footerProps:o={},sx:n={},children:c,...p}){const x=I(),{inFullPage:j,showToggleButton:g,headerVisible:f,footerVisible:P,sidebarVisible:w,toggleFullPage:k}=oe(),v=V(),y=d.useMemo(()=>G(t,v),[v,t]),$=y.some(u=>!!u.children?.length),b=l==="auto"?y.length>=8||$:l,F=L("dashboard",{"dashboard-dense":b},p.className),N={homeLink:u=>a.jsx(R,{to:window.blocklet?.prefix||"/",children:u}),...i};return d.useEffect(()=>{const{searchParams:u}=new URL(window.location.href);u.get("inviter")&&window.localStorage.setItem("inviter",u.get("inviter"))},[]),a.jsxs(ke,{sx:n,...p,className:F,sidebarWidth:r,children:[a.jsx(A,{title:e},e),f&&a.jsx(ve,{...N,className:"dashboard-header",children:t?.length?({isMobile:u,closeMenu:O})=>u?a.jsx(je,{mode:"inline",items:y,closeMenu:O,bgColor:"transparent",activeTextColor:x.palette.primary.main}):null:null}),a.jsxs(h,{className:"dashboard-body",sx:{display:"flex"},children:[!!t?.length&&w&&a.jsx(h,{className:"dashboard-sidebar",sx:{display:{xs:"none",md:"block"}},children:b?a.jsx(T,{links:t,dense:b}):a.jsx(h,{className:"dashboard-sidebar-container",children:a.jsx(T,{links:t,dense:b})})}),a.jsxs(h,{className:"dashboard-main",id:"arc__dashboard-main",children:[g&&a.jsx(h,{sx:{position:"absolute",top:4,right:4,display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,color:"#fff",bgcolor:"rgba(158,158,158, 0.6);",borderRadius:1,cursor:"pointer"},onClick:k,children:j?a.jsx(Y,{style:{fontSize:18}}):a.jsx(J,{style:{fontSize:18}})}),a.jsx(B,{className:"dashboard-content",id:"arc__dashboard-content",...s&&{maxWidth:!1},children:c}),P&&a.jsx(S,{dark:x.palette.mode==="dark",...o})]})]})]})}const ke=m(h)`
288
+ `;function we({closeMenu:e,...i}){const t=V();return d.useEffect(()=>{e()},[t]),a.jsx(te,{...i})}function G(e,i){return e.map(t=>t.children?.length?{...t,label:t.title,children:G(t.children,i)}:{...t,label:a.jsx(R,{to:t.url,external:t.external,children:t.title}),active:t.external?t.active:!!ae({path:t.url,end:!1},i.pathname)})}function ke({title:e="Home",headerProps:i={},links:t=[],sidebarWidth:r=120,fullWidth:s=!1,dense:l="auto",footerProps:o={},sx:n={},children:c,hideHtmlTitle:x=!1,...p}){const b=M(),{inFullPage:g,showToggleButton:f,headerVisible:P,footerVisible:w,sidebarVisible:v,toggleFullPage:F}=se(),k=V(),y=d.useMemo(()=>G(t,k),[k,t]),$=y.some(u=>!!u.children?.length),j=l==="auto"?y.length>=8||$:l,N=L("dashboard",{"dashboard-dense":j},p.className),O={homeLink:u=>a.jsx(R,{to:window.blocklet?.prefix||"/",children:u}),...i};return d.useEffect(()=>{const{searchParams:u}=new URL(window.location.href);u.get("inviter")&&window.localStorage.setItem("inviter",u.get("inviter"))},[]),a.jsxs(ve,{sx:n,...p,className:N,sidebarWidth:r,children:[!x&&a.jsx(E,{title:e},e),P&&a.jsx($e,{...O,className:"dashboard-header",children:t?.length?({isMobile:u,closeMenu:Q})=>u?a.jsx(we,{mode:"inline",items:y,closeMenu:Q,bgColor:"transparent",activeTextColor:b.palette.primary.main}):null:null}),a.jsxs(h,{className:"dashboard-body",sx:{display:"flex"},children:[!!t?.length&&v&&a.jsx(h,{className:"dashboard-sidebar",sx:{display:{xs:"none",md:"block"}},children:j?a.jsx(I,{links:t,dense:j}):a.jsx(h,{className:"dashboard-sidebar-container",children:a.jsx(I,{links:t,dense:j})})}),a.jsxs(h,{className:"dashboard-main",id:"arc__dashboard-main",children:[f&&a.jsx(h,{sx:{position:"absolute",top:4,right:4,display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,color:"#fff",bgcolor:"rgba(158,158,158, 0.6);",borderRadius:1,cursor:"pointer"},onClick:F,children:g?a.jsx(J,{style:{fontSize:18}}):a.jsx(K,{style:{fontSize:18}})}),a.jsx(B,{className:"dashboard-content",id:"arc__dashboard-content",...s&&{maxWidth:!1},children:c}),w&&a.jsx(S,{dark:b.palette.mode==="dark",...o})]})]})]})}const ve=m(h)`
289
289
  &.dashboard {
290
290
  display: flex;
291
291
  flex-direction: column;
@@ -341,8 +341,8 @@ import{j as a,D as I,T as _,ci as C,Q as W,cj as Q,aV as q,ak as h,ck as K,aU as
341
341
  }
342
342
  }
343
343
  }
344
- `,ve=m(re)`
344
+ `,$e=m(oe)`
345
345
  .header-container {
346
346
  max-width: 100%;
347
347
  }
348
- `;function Le({legacy:e=!0,...i}){return e?a.jsx(me,{...i}):a.jsx(se,{children:a.jsx(we,{...i})})}export{oe as d,Le as u};
348
+ `;function Ve({legacy:e=!0,...i}){return e?a.jsx(be,{...i}):a.jsx(le,{children:a.jsx(ke,{...i})})}export{se as d,Ve as x};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BsDq3W_j.js","assets/index-BGbMta1w.js","assets/vendor-mui-core-BOHKtf8y.js","assets/vendor-react-Dvs43sk9.js","assets/vendor-ux-Cra9XTth.js","assets/vendor-utils-BOkrEpKO.js","assets/vendor-hooks-DTeIFVkk.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock--zSibe1w.js","assets/index-DrVXX4fX.css","assets/index-BPy8_fa2.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
- import{r as k,i as It,j as rt,L as we,g as fo,k as As,l as qs,m as bt}from"./vendor-react-Dvs43sk9.js";import{J as Oe,j as e,ak as a,b4 as Et,W as n,am as ke,I as ce,dA as Ns,dB as _s,ca as xo,cg as nt,dC as Ws,a_ as Os,T as A,s as go,dD as ko,dE as zs,cN as Bs,Y as lt,at as ve,av as Vs,dF as Us,a5 as Ye,aX as it,bc as Pt,c7 as Ms,bf as Fs,b6 as Ze,d7 as Hs,bg as et,Q as X,a6 as Se,bD as Js,O as jo,K as yo,P as Lt,ai as wo,o as vo,M as be,a3 as Gs,bB as Co,$ as Ro,bv as Xs,A as He,aJ as Ks,R as So,z as ne,b1 as Re,dG as Gt,bW as tt,dH as To,V as Do,S as $t,aP as Io,bC as Ys,D as Eo,ct as Zs,aQ as Qs,aR as er,cu as tr,cv as or,bE as Po,aq as sr,dI as rr,a1 as Lo,a0 as ot,bi as Xt,bH as nr,bI as lr,dJ as ir,dK as cr,bb as vt,y as ar,F as dr,bp as ur,bq as ft}from"./vendor-mui-core-BOHKtf8y.js";import{c as F,U as ge,a1 as De,v as pr,R as me,c4 as hr,T as mr,f as Kt,c5 as br,ai as Yt,aj as We,b3 as fr,bH as xr,c6 as gr,c7 as kr,c8 as jr}from"./index-BGbMta1w.js";import{T as G,W as $o,s as yr,n as $e,a0 as Ao,B as qo,F as wr,J as At,H as W,k as qt,aP as Nt,I as ae,_ as No,a as ct,h as _o}from"./vendor-ux-Cra9XTth.js";import{C as at}from"./confirm-BE3P2t7f.js";import{u as ze}from"./session-DwRV85k4.js";import{W as Ct}from"./did-address-C7IHZs6x.js";import{E as Je}from"./empty-spinner-DCdg-gxP.js";import{B as _t}from"./bundle-avatar-nqQPph1V.js";import{S as Te}from"./shorten-label-CdBn9U0H.js";import{L as Wt}from"./list-header-B8ZTLjYf.js";import{K as vr,C as ue,A as Ot,D as Wo,a1 as Cr}from"./vendor-utils-BOkrEpKO.js";import{C as Oo}from"./click-to-copy-EOhAhdSS.js";import{t as Rr}from"./question-mark-circle.svg-B4stD6SS.js";import{l as Sr,b as Tr}from"./vendor-hooks-DTeIFVkk.js";import{u as Me}from"./useSetState-DFuQZPPV.js";import{e as Dr}from"./engine-te2i4Xkp.js";import"./api-Rnh95Dt4.js";import{T as Ir,S as Er}from"./vendor-mui-x-16EG-AFj.js";import{D as Zt,C as Qt,P as eo}from"./react-beautiful-dnd.esm-DkLcR42r.js";import{u as zo}from"./use-promise-window-open-ZxLzFYBo.js";import{c as Pr,w as Lr,a as $r,b as Ar}from"./wait-connect-CqwL_aoj.js";import{f as xe}from"./index-DBs9Ljax.js";import{c as qr,A as Bo,S as Nr,U as _r,r as Wr}from"./item-CicRcRrO.js";import{D as Or}from"./delete-confirm-BxYuZyLa.js";import{g as Vo}from"./get-safe-url-CoK26-Ak.js";import{u as Le}from"./index-BEmLxB7B.js";import{M as zr}from"./index-BBIMESWU.js";import{r as Br}from"./index-296hnpGF.js";import"./vendor-arcblock--zSibe1w.js";import"./lottie-web-4koyQiv_.js";import"./raf-schd.esm-CHNehTG3.js";function zt({did:t,projectId:o,title:s,logo:r,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[d,u]=k.useState(!1),x=Oe(p=>p.breakpoints.down("md"));return e.jsxs(a,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[e.jsx(Et,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||d?"primary.main":"grey.700"},children:l||"/"})]})]})}zt.propTypes={projectId:n.string.isRequired,did:n.string.isRequired,title:n.string.isRequired,logo:n.string.isRequired,describe:n.string.isRequired};function Uo({initUrl:t=null}){const o=It(),s=t?.searchParams.get("tenantScope")||"",{t:r,locale:l}=G(),{api:c}=ge(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:x}=De(),[p,m]=k.useState(null),[f,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=rt(),[g,C]=k.useState(null),D=`publish-${x.meta.did}`,R=$o(D),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const I=E?.projects||[];u(!1),C(I)}).catch(E=>{u(!1),W.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},P=()=>{b(!1),m(null)},L=E=>{W.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){W.error("Delete project failed");return}O(),b(!1),m(null)};k.useEffect(()=>{O()},[]);const S=k.useMemo(()=>{if(!y.searchText)return g;let E=y.searchText?.trim();return E?(E=yr.toAddress(E).toLocaleLowerCase(),g.filter(I=>I.blockletTitle.toLowerCase().includes(E)||I.blockletDid.toLowerCase().includes(E))):g},[g,y.searchText]);if(!g&&d)return e.jsx(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Je,{})});if(!g)return null;if(!g.length)return e.jsxs(a,{sx:{display:"flex",flexDirection:"column",alignItems:"center",pt:10},children:[e.jsx(a,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const I=g[E];return e.jsx(we,{to:`${I.id}`,children:e.jsx(zt,{did:x.meta.did,projectId:I.id,logo:I.blockletLogo,title:I.blockletTitle,describe:I.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(Ao,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Ct,{onClick:()=>{o(`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${E}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:E}):null}},h||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const I=(x.children||[]).find(V=>V.meta.did===E);return I?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(_t,{size:14,blocklet:I,ancestors:[x]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:I.meta.title})]},E):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:E=>e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(Te,{children:E})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(qo,{value:Number(E),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const I=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${I.id}/new-release/none/${I.lastReleaseId}`,children:e.jsx(ke,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Ns,{style:{fontSize:18}})})})}),!!I.lastReleaseId&&e.jsx(ke,{title:r("blocklet.publish.viewLastRelease",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${I.id}/view/${I.lastReleaseId}/${I.blockletVersion}`,children:e.jsx(_s,{sx:{fontSize:18}})})})}),e.jsx(ke,{title:r("blocklet.publish.delete",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(I),children:e.jsx(xo,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:I,searchText:V})=>{y.pageSize!==I?T(U=>({...U,searchText:"",pageSize:I,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=f?e.jsx(pr,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:w,onError:L,extraParams:{projectId:p.id,did:x.meta.did,name:p.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Vr,{children:[e.jsx(Wt,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(a,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(ke,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Ws,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(wr,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(I=>({...I,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(nt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:l,data:S,columns:Z,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:D,onChange:H}),p&&e.jsx(at,{title:`${r("common.delete")} ${p.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Os,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const Vr=go(a)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B2HJDbWz.js","assets/index-l5234Nwn.js","assets/vendor-mui-core-CAIaAq-_.js","assets/vendor-react-Dvs43sk9.js","assets/vendor-ux-C1NY8cuW.js","assets/vendor-utils-BOkrEpKO.js","assets/vendor-hooks-DTeIFVkk.js","assets/lottie-web-4koyQiv_.js","assets/vendor-ux-DYcPPYq2.css","assets/vendor-arcblock-DU4xNzGM.js","assets/index-DrVXX4fX.css","assets/index-BPy8_fa2.js","assets/index-DRYJ0xIl.js","assets/index-B5LvOF-F.css"])))=>i.map(i=>d[i]);
2
+ import{r as k,i as It,j as rt,L as we,g as fo,k as As,l as qs,m as bt}from"./vendor-react-Dvs43sk9.js";import{J as Oe,j as e,ak as a,b4 as Et,W as n,am as ke,I as ce,dA as Ns,dB as _s,ca as xo,cg as nt,dC as Ws,a_ as Os,T as A,s as go,dD as ko,dE as zs,cN as Bs,Y as lt,at as ve,av as Vs,dF as Us,a5 as Ye,aX as it,bc as Pt,c7 as Ms,bf as Fs,b6 as Ze,d7 as Hs,bg as et,Q as X,a6 as Se,bD as Js,O as jo,K as yo,P as Lt,ai as wo,o as vo,M as be,a3 as Gs,bB as Co,$ as Ro,bv as Xs,A as He,aJ as Ks,R as So,z as ne,b1 as Re,dG as Gt,bW as tt,dH as To,V as Do,S as $t,aP as Io,bC as Ys,D as Eo,ct as Zs,aQ as Qs,aR as er,cu as tr,cv as or,bE as Po,aq as sr,dI as rr,a1 as Lo,a0 as ot,bi as Xt,bH as nr,bI as lr,dJ as ir,dK as cr,bb as vt,y as ar,F as dr,bp as ur,bq as ft}from"./vendor-mui-core-CAIaAq-_.js";import{c as F,U as ge,a1 as De,v as pr,R as me,c4 as hr,T as mr,f as Kt,c5 as br,ai as Yt,aj as We,b3 as fr,bH as xr,c6 as gr,c7 as kr,c8 as jr}from"./index-l5234Nwn.js";import{T as G,W as $o,s as yr,n as $e,a0 as Ao,B as qo,F as wr,J as At,H as W,k as qt,aP as Nt,I as ae,_ as No,a as ct,h as _o}from"./vendor-ux-C1NY8cuW.js";import{C as at}from"./confirm-DwicyBRo.js";import{u as ze}from"./session-YnDvY5CJ.js";import{W as Ct}from"./did-address-BYpODbk4.js";import{E as Je}from"./empty-spinner-DXNgsKH2.js";import{B as _t}from"./bundle-avatar-B6WDP8U8.js";import{S as Te}from"./shorten-label-Bj776ixm.js";import{L as Wt}from"./list-header-BnA6XPP6.js";import{K as vr,C as ue,A as Ot,D as Wo,a1 as Cr}from"./vendor-utils-BOkrEpKO.js";import{C as Oo}from"./click-to-copy-Lt7iNH-g.js";import{t as Rr}from"./question-mark-circle.svg-B4stD6SS.js";import{l as Sr,b as Tr}from"./vendor-hooks-DTeIFVkk.js";import{u as Me}from"./useSetState-DFuQZPPV.js";import{e as Dr}from"./engine-DwJQ8ndb.js";import"./api-Rnh95Dt4.js";import{T as Ir,S as Er}from"./vendor-mui-x-DXh6Gdva.js";import{D as Zt,C as Qt,P as eo}from"./react-beautiful-dnd.esm-DOptRWpa.js";import{u as zo,c as Pr,w as Lr,a as $r,b as Ar}from"./wait-connect-DpAcPy2e.js";import{f as xe}from"./index-DBs9Ljax.js";import{c as qr,A as Bo,S as Nr,U as _r,r as Wr}from"./item-Deax8Tcs.js";import{D as Or}from"./delete-confirm-Bn607XWd.js";import{g as Vo}from"./get-safe-url-Byu99Iq6.js";import{u as Le}from"./index-Br7EG_jz.js";import{M as zr}from"./index-DU79Hpz9.js";import{r as Br}from"./index-0DKBOdj7.js";import"./vendor-arcblock-DU4xNzGM.js";import"./lottie-web-4koyQiv_.js";import"./raf-schd.esm-CHNehTG3.js";function zt({did:t,projectId:o,title:s,logo:r,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[d,u]=k.useState(!1),x=Oe(p=>p.breakpoints.down("md"));return e.jsxs(a,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[e.jsx(Et,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||d?"primary.main":"grey.700"},children:l||"/"})]})]})}zt.propTypes={projectId:n.string.isRequired,did:n.string.isRequired,title:n.string.isRequired,logo:n.string.isRequired,describe:n.string.isRequired};function Uo({initUrl:t=null}){const o=It(),s=t?.searchParams.get("tenantScope")||"",{t:r,locale:l}=G(),{api:c}=ge(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:x}=De(),[p,m]=k.useState(null),[f,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=rt(),[g,C]=k.useState(null),D=`publish-${x.meta.did}`,R=$o(D),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const I=E?.projects||[];u(!1),C(I)}).catch(E=>{u(!1),W.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},P=()=>{b(!1),m(null)},L=E=>{W.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){W.error("Delete project failed");return}O(),b(!1),m(null)};k.useEffect(()=>{O()},[]);const S=k.useMemo(()=>{if(!y.searchText)return g;let E=y.searchText?.trim();return E?(E=yr.toAddress(E).toLocaleLowerCase(),g.filter(I=>I.blockletTitle.toLowerCase().includes(E)||I.blockletDid.toLowerCase().includes(E))):g},[g,y.searchText]);if(!g&&d)return e.jsx(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Je,{})});if(!g)return null;if(!g.length)return e.jsxs(a,{sx:{display:"flex",flexDirection:"column",alignItems:"center",pt:10},children:[e.jsx(a,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const I=g[E];return e.jsx(we,{to:`${I.id}`,children:e.jsx(zt,{did:x.meta.did,projectId:I.id,logo:I.blockletLogo,title:I.blockletTitle,describe:I.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(Ao,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Ct,{onClick:()=>{o(`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${E}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:E}):null}},h||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const I=(x.children||[]).find(V=>V.meta.did===E);return I?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(_t,{size:14,blocklet:I,ancestors:[x]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:I.meta.title})]},E):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:E=>e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(Te,{children:E})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(qo,{value:Number(E),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const I=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${I.id}/new-release/none/${I.lastReleaseId}`,children:e.jsx(ke,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(Ns,{style:{fontSize:18}})})})}),!!I.lastReleaseId&&e.jsx(ke,{title:r("blocklet.publish.viewLastRelease",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${I.id}/view/${I.lastReleaseId}/${I.blockletVersion}`,children:e.jsx(_s,{sx:{fontSize:18}})})})}),e.jsx(ke,{title:r("blocklet.publish.delete",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(I),children:e.jsx(xo,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:I,searchText:V})=>{y.pageSize!==I?T(U=>({...U,searchText:"",pageSize:I,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=f?e.jsx(pr,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:w,onError:L,extraParams:{projectId:p.id,did:x.meta.did,name:p.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Vr,{children:[e.jsx(Wt,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsx(a,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:r("common.blockletStudio")}),e.jsx(ke,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Ws,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(wr,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(I=>({...I,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(nt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:l,data:S,columns:Z,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:D,onChange:H}),p&&e.jsx(at,{title:`${r("common.delete")} ${p.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(Os,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const Vr=go(a)`
3
3
  ${({theme:t})=>t.breakpoints.down("md")} {
4
4
  .MuiTableRow-root {
5
5
  border-color: ${({theme:t})=>t.palette.divider};
@@ -142,7 +142,7 @@ import{r as k,i as It,j as rt,L as we,g as fo,k as As,l as qs,m as bt}from"./ven
142
142
  background: #fff;
143
143
  z-index: 10;
144
144
  }
145
- `,io="lastWantToConnectStoreId";function rn(t){const[o,s]=k.useState(null),{session:r}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(io,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(io),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let x=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==r?.user?.did));return x||(x=t?.settings?.storeList?.[0]),x},[t?.settings?.storeList,r?.user?.did]);return[o||c||{},l]}const Bt=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{const l=t?s?.meta?.did:o?.did;let c=t?s?.settings?.storeList||[]:o?.blockletRegistryList||[];return Array.isArray(c)||(c=[]),c=c.filter(i=>i.protected||Cr(i.scope)||i.scope==="studio"||i.scope===r),{teamDid:l,storeList:c}};function es({blocklet:t=null,store:o=null,onChangeStore:s,onClick:r,disabled:l,loading:c,componentDid:i}){const{t:d}=G(),{session:u}=ze(),{api:x,info:p,inService:m}=ge(),f=De(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,D]=k.useState(null),R=L=>{s(L),h(!1)},y=()=>{h(!b)},T=L=>{j.current&&j.current.contains(L.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await f?.actions?.refreshBlocklet()}catch(L){W.error(`Remove Blocklet Store Error: ${xe(L)}`)}finally{D(null)}},{storeList:K}=Bt({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),P=t?.meta?.did;return e.jsxs(e.Fragment,{children:[e.jsxs(et,{disabled:l,ref:j,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(X,{onClick:r,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(X,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:e.jsx(Js,{})})]}),e.jsx(jo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:L})=>e.jsx(yo,{...L,style:{transformOrigin:"center top"},children:e.jsx(Lt,{children:e.jsx(wo,{onClickAway:T,children:e.jsxs(vo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[K?.map(w=>e.jsxs(be,{selected:w.id===o?.id,sx:{height:56},onClick:()=>R(w),children:[e.jsxs(a,{children:[e.jsx(Te,{sx:{fontSize:"16px"},maxLength:24,children:w.name}),e.jsx(Te,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:w.url})]}),qr({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),D(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Gs,{}),e.jsxs(be,{onClick:O,children:[e.jsx(nt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Bo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:P,storeList:K,scope:"studio",onAdd:f?.actions?.refreshBlocklet}),C&&e.jsx(at,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:z,onCancel:()=>D(null)})]})}es.propTypes={store:n.object,blocklet:n.object,onChangeStore:n.func.isRequired,onClick:n.func.isRequired,loading:n.bool.isRequired,disabled:n.bool.isRequired,componentDid:n.string.isRequired,projectType:n.string.isRequired,getData:n.func.isRequired};const ts=(t,o,s)=>{const r=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,c=t?.blockletLogo?`${r}/${t.blockletLogo}`:`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,i=(t?.blockletScreenshots||[]).filter(Boolean).map(d=>`${l}/${d}`);return{logoUrl:c,screenshotUrls:i,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},nn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Vt({url:t,style:o={},controls:s=1,modestbranding:r=1}){const{t:l}=G(),c=t.includes("youtube.com")||t.includes("youtu.be"),i=t.includes("vimeo.com");if(c){const d=t.split("v=")[1]?.split("&")[0]||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o?.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(i){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(a,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(a,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}Vt.propTypes={url:n.string.isRequired,style:n.object,controls:n.number,modestbranding:n.number};function os({setParams:t,onClose:o,params:s}){const{t:r}=G(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=nn(l),u=()=>{t(x=>{const p=[...x.blockletVideos];return p.push(l),{...x,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Co,{children:r("studio.videoDialogTitle")}),e.jsxs(Ro,{children:[e.jsx(Xs,{fullWidth:!0,value:l,onChange:x=>c(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(He,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Ks,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(Vt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(So,{children:[e.jsx(X,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(X,{disabled:!d||i,onClick:u,children:r("studio.confirm")})]})]})}os.propTypes={onClose:n.func.isRequired,params:n.object.isRequired,setParams:n.func.isRequired};function Rt({errors:t,storeList:o,...s}){const{t:r}=G();return e.jsxs(a,{...s,sx:[{color:"warning.main",fontSize:"14px",border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,c])=>{const i=Object.values(c),d=o.find(u=>u.url===l);return i.length>0&&e.jsxs(a,{children:[e.jsx(ke,{title:l,children:e.jsx(a,{component:"span",sx:{cursor:"pointer"},children:d.name})}),i.map(u=>e.jsx(a,{component:"li",sx:{ml:2,wordBreak:!0},children:u},u))]},l)})]})}Rt.propTypes={errors:n.object.isRequired,storeList:n.array.isRequired};const co=k.lazy(()=>No(()=>import("./index-BsDq3W_j.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ss({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:x,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:f,componentDid:b=""}){const{t:h,locale:j}=G(),{api:v}=ge(),g=It(),C=k.useRef(null),D=k.useRef(null),[R,y]=rn(r),[T,O]=k.useState(!1),N=zo({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async q=>{const Y=setTimeout(()=>{x(!1)},2e4),J=await Lr(v,q);x(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${J}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){W.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){W.error(h("blocklet.publish.noStoreSelected"));return}const q=Pr();N(async(Y,J)=>{try{const se=await v.connectByStudio({input:{did:r?.meta?.did,blockletTitle:l?.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:l?.blockletComponents?.length>0?"pack":"resource",componentDid:b,messageId:q,tenantScope:p?.searchParams.get("tenantScope")||""}});if(!se?.url){W.error("failed to connect to store");return}J(se.url),z({did:r?.meta?.did,projectId:"",messageId:q})}catch(se){const de=xe(se);W.error(de),x(!1)}})},{logoUrl:P,screenshotUrls:L,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=ts(l,r,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:I}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(W.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(ln,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:q=>{d({blockletTitle:""}),c({blockletTitle:q.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||"",slotProps:{input:{"data-cy":"blocklet-title",readOnly:o}}}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",error:!!i.projectId,helperText:i.projectId||"",value:t===F.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3},slotProps:{input:{"data-cy":"export-blocklet-did",endAdornment:t===F.UNOWNED_DID&&e.jsx(He,{position:"end",children:e.jsx(es,{blocklet:r,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:q=>{d({blockletDescription:""}),c({blockletDescription:q.target.value.slice(0,159)})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-description",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletHomepage:""}),c({blockletHomepage:q.target.value})},error:!!i.blockletHomepage,helperText:i.blockletHomepage||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-homepage",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletCommunity:""}),c({blockletCommunity:q.target.value})},error:!!i.blockletCommunity,helperText:i.blockletCommunity||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-community",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q.target.value)?d({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):d({blockletSupport:""}),c({blockletSupport:q.target.value})},error:!!i.blockletSupport,helperText:i.blockletSupport||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-support",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:q=>{q.target.value&&!/^(git|https|svn)/.test(q.target.value)?d({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletRepository:""}),c({blockletRepository:q.target.value})},error:!!i.blockletRepository,helperText:i.blockletRepository||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-repository",readOnly:o}}})]})}),e.jsx(a,{className:"section full-width",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.type"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(a,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Et,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||P,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(Rt,{errors:Z,storeList:Q,mt:3}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Zt,{onDragEnd:o?void 0:U,children:e.jsx(Qt,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[L.map((J,se)=>e.jsx(eo,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:J}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Gt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletScreenshots];return he.splice(se,1),{...pe,blockletScreenshots:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,L.length<5&&e.jsx(a,{onClick:()=>{V()&&D.current?.open()},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]}),I&&e.jsx(Rt,{errors:H,storeList:Q}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.videoType"),":"," "]}),e.jsxs(a,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Zt,{onDragEnd:o?void 0:ee,children:e.jsx(Qt,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[l.blockletVideos.map((J,se)=>e.jsx(eo,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(Vt,{url:J,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Gt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletVideos];return he.splice(se,1),{...pe,blockletVideos:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,l.blockletVideos.length<3&&e.jsx(a,{onClick:()=>{V()&&O(!0)},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]})]})}),e.jsxs(k.Suspense,{fallback:e.jsx(Je,{}),children:[e.jsx(co,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),f(""),C.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&e.jsx(os,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(co,{ref:D,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const J=Y.blockletScreenshots||[];return J.push(q.data?.filename),{...Y,blockletScreenshots:J}}),D.current?.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-L.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}ss.propTypes={projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,warning:n.object.isRequired,loading:n.bool.isRequired,blocklet:n.object.isRequired,setLoading:n.func.isRequired,initUrl:n.object,componentDid:n.string,initLogoUrl:n.string.isRequired,setInitLogoUrl:n.func.isRequired};const ln=ve.div`
145
+ `,io="lastWantToConnectStoreId";function rn(t){const[o,s]=k.useState(null),{session:r}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(io,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(io),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let x=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==r?.user?.did));return x||(x=t?.settings?.storeList?.[0]),x},[t?.settings?.storeList,r?.user?.did]);return[o||c||{},l]}const Bt=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{const l=t?s?.meta?.did:o?.did;let c=t?s?.settings?.storeList||[]:o?.blockletRegistryList||[];return Array.isArray(c)||(c=[]),c=c.filter(i=>i.protected||Cr(i.scope)||i.scope==="studio"||i.scope===r),{teamDid:l,storeList:c}};function es({blocklet:t=null,store:o=null,onChangeStore:s,onClick:r,disabled:l,loading:c,componentDid:i}){const{t:d}=G(),{session:u}=ze(),{api:x,info:p,inService:m}=ge(),f=De(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,D]=k.useState(null),R=L=>{s(L),h(!1)},y=()=>{h(!b)},T=L=>{j.current&&j.current.contains(L.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await f?.actions?.refreshBlocklet()}catch(L){W.error(`Remove Blocklet Store Error: ${xe(L)}`)}finally{D(null)}},{storeList:K}=Bt({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),P=t?.meta?.did;return e.jsxs(e.Fragment,{children:[e.jsxs(et,{disabled:l,ref:j,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(X,{onClick:r,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(X,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:e.jsx(Js,{})})]}),e.jsx(jo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:L})=>e.jsx(yo,{...L,style:{transformOrigin:"center top"},children:e.jsx(Lt,{children:e.jsx(wo,{onClickAway:T,children:e.jsxs(vo,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[K?.map(w=>e.jsxs(be,{selected:w.id===o?.id,sx:{height:56},onClick:()=>R(w),children:[e.jsxs(a,{children:[e.jsx(Te,{sx:{fontSize:"16px"},maxLength:24,children:w.name}),e.jsx(Te,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:w.url})]}),qr({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),D(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Gs,{}),e.jsxs(be,{onClick:O,children:[e.jsx(nt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Bo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:P,storeList:K,scope:"studio",onAdd:f?.actions?.refreshBlocklet}),C&&e.jsx(at,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:z,onCancel:()=>D(null)})]})}es.propTypes={store:n.object,blocklet:n.object,onChangeStore:n.func.isRequired,onClick:n.func.isRequired,loading:n.bool.isRequired,disabled:n.bool.isRequired,componentDid:n.string.isRequired,projectType:n.string.isRequired,getData:n.func.isRequired};const ts=(t,o,s)=>{const r=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,c=t?.blockletLogo?`${r}/${t.blockletLogo}`:`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,i=(t?.blockletScreenshots||[]).filter(Boolean).map(d=>`${l}/${d}`);return{logoUrl:c,screenshotUrls:i,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},nn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Vt({url:t,style:o={},controls:s=1,modestbranding:r=1}){const{t:l}=G(),c=t.includes("youtube.com")||t.includes("youtu.be"),i=t.includes("vimeo.com");if(c){const d=t.split("v=")[1]?.split("&")[0]||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o?.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(i){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(a,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(a,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}Vt.propTypes={url:n.string.isRequired,style:n.object,controls:n.number,modestbranding:n.number};function os({setParams:t,onClose:o,params:s}){const{t:r}=G(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=nn(l),u=()=>{t(x=>{const p=[...x.blockletVideos];return p.push(l),{...x,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Co,{children:r("studio.videoDialogTitle")}),e.jsxs(Ro,{children:[e.jsx(Xs,{fullWidth:!0,value:l,onChange:x=>c(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(He,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Ks,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(Vt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(So,{children:[e.jsx(X,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(X,{disabled:!d||i,onClick:u,children:r("studio.confirm")})]})]})}os.propTypes={onClose:n.func.isRequired,params:n.object.isRequired,setParams:n.func.isRequired};function Rt({errors:t,storeList:o,...s}){const{t:r}=G();return e.jsxs(a,{...s,sx:[{color:"warning.main",fontSize:"14px",border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,c])=>{const i=Object.values(c),d=o.find(u=>u.url===l);return i.length>0&&e.jsxs(a,{children:[e.jsx(ke,{title:l,children:e.jsx(a,{component:"span",sx:{cursor:"pointer"},children:d.name})}),i.map(u=>e.jsx(a,{component:"li",sx:{ml:2,wordBreak:!0},children:u},u))]},l)})]})}Rt.propTypes={errors:n.object.isRequired,storeList:n.array.isRequired};const co=k.lazy(()=>No(()=>import("./index-B2HJDbWz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ss({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:x,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:f,componentDid:b=""}){const{t:h,locale:j}=G(),{api:v}=ge(),g=It(),C=k.useRef(null),D=k.useRef(null),[R,y]=rn(r),[T,O]=k.useState(!1),N=zo({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async q=>{const Y=setTimeout(()=>{x(!1)},2e4),J=await Lr(v,q);x(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${J}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){W.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){W.error(h("blocklet.publish.noStoreSelected"));return}const q=Pr();N(async(Y,J)=>{try{const se=await v.connectByStudio({input:{did:r?.meta?.did,blockletTitle:l?.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:l?.blockletComponents?.length>0?"pack":"resource",componentDid:b,messageId:q,tenantScope:p?.searchParams.get("tenantScope")||""}});if(!se?.url){W.error("failed to connect to store");return}J(se.url),z({did:r?.meta?.did,projectId:"",messageId:q})}catch(se){const de=xe(se);W.error(de),x(!1)}})},{logoUrl:P,screenshotUrls:L,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=ts(l,r,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:I}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(W.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(ln,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:q=>{d({blockletTitle:""}),c({blockletTitle:q.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||"",slotProps:{input:{"data-cy":"blocklet-title",readOnly:o}}}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",error:!!i.projectId,helperText:i.projectId||"",value:t===F.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3},slotProps:{input:{"data-cy":"export-blocklet-did",endAdornment:t===F.UNOWNED_DID&&e.jsx(He,{position:"end",children:e.jsx(es,{blocklet:r,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:q=>{d({blockletDescription:""}),c({blockletDescription:q.target.value.slice(0,159)})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-description",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletHomepage:""}),c({blockletHomepage:q.target.value})},error:!!i.blockletHomepage,helperText:i.blockletHomepage||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-homepage",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletCommunity:""}),c({blockletCommunity:q.target.value})},error:!!i.blockletCommunity,helperText:i.blockletCommunity||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-community",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q.target.value)?d({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):d({blockletSupport:""}),c({blockletSupport:q.target.value})},error:!!i.blockletSupport,helperText:i.blockletSupport||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-support",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:q=>{q.target.value&&!/^(git|https|svn)/.test(q.target.value)?d({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletRepository:""}),c({blockletRepository:q.target.value})},error:!!i.blockletRepository,helperText:i.blockletRepository||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-repository",readOnly:o}}})]})}),e.jsx(a,{className:"section full-width",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.type"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(a,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Et,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||P,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(Rt,{errors:Z,storeList:Q,mt:3}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Zt,{onDragEnd:o?void 0:U,children:e.jsx(Qt,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[L.map((J,se)=>e.jsx(eo,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:J}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Gt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletScreenshots];return he.splice(se,1),{...pe,blockletScreenshots:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,L.length<5&&e.jsx(a,{onClick:()=>{V()&&D.current?.open()},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]}),I&&e.jsx(Rt,{errors:H,storeList:Q}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.videoType"),":"," "]}),e.jsxs(a,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Zt,{onDragEnd:o?void 0:ee,children:e.jsx(Qt,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[l.blockletVideos.map((J,se)=>e.jsx(eo,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(Vt,{url:J,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Gt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletVideos];return he.splice(se,1),{...pe,blockletVideos:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,l.blockletVideos.length<3&&e.jsx(a,{onClick:()=>{V()&&O(!0)},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]})]})}),e.jsxs(k.Suspense,{fallback:e.jsx(Je,{}),children:[e.jsx(co,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),f(""),C.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&e.jsx(os,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(co,{ref:D,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const J=Y.blockletScreenshots||[];return J.push(q.data?.filename),{...Y,blockletScreenshots:J}}),D.current?.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-L.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}ss.propTypes={projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,warning:n.object.isRequired,loading:n.bool.isRequired,blocklet:n.object.isRequired,setLoading:n.func.isRequired,initUrl:n.object,componentDid:n.string,initLogoUrl:n.string.isRequired,setInitLogoUrl:n.func.isRequired};const ln=ve.div`
146
146
  margin-top: 24px;
147
147
  .screenshot {
148
148
  margin-bottom: 16px;
@@ -190,7 +190,7 @@ import{r as k,i as It,j as rt,L as we,g as fo,k as As,l as qs,m as bt}from"./ven
190
190
  padding-bottom: 12px;
191
191
  border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
192
192
  }
193
- `;function bs({text:t}){const{palette:o}=Eo();return t?e.jsx(zr,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:xr.sanitize(t),rehypePlugins:[[Br,{target:"_blank"}]]}):e.jsx(Fe,{Icon:Nt})}bs.propTypes={text:n.string.isRequired};function fs({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:c}){const{t:i}=G(),[d,u]=k.useState(c?"preview":"write"),x=(p,m)=>{u(m)};return e.jsxs(a,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",sx:{fontWeight:"bold"},children:i("common.introduction")}),e.jsxs(Lo,{value:d,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(a,{sx:{display:d==="write"?"block":"none",width:"100%",marginTop:3},children:e.jsx(ne,{disabled:r||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{l({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,me.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||"",slotProps:{input:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:e.jsxs(He,{position:"end",children:[t?.blockletIntroduction?.length||0," / ",me.PROJECT.MAX_INTRO_LENGTH]})}}})}),e.jsx(a,{sx:{display:d==="preview"?"block":"none",mt:3},children:e.jsx(bs,{text:t.blockletIntroduction||""})})]})}fs.propTypes={params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,readOnly:n.bool.isRequired,loading:n.bool.isRequired};function xs({step:t=0,ok:o=!1,active:s=0,error:r="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx(Po,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(c="error.main",i=e.jsx(Xt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Xt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(c="primary.main"),e.jsx(a,{sx:{width:24,height:24,bgcolor:c,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center"},children:i})}xs.propTypes={step:n.number,ok:n.bool,active:n.number,error:n.string,warning:n.bool};function gs({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:x}){const{t:p}=G(),m=()=>{s(j=>j+1)},f=()=>{s(j=>j-1)},b=j=>j===0?i?.blockletTitle||i?.projectId||i?.blockletDescription||i?.blockletHomepage||i?.blockletSupport||i?.blockletCommunity||i?.blockletRepository:j===2?i?.blockletResource||i?.blockletDocker||i?.dockerImageName:j>=4?i?.blockletVersion||i?.note:"",h=u||rs({params:l,projectId:x,t:p})===null;return e.jsxs(a,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(nr,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!pn({params:l,projectId:x,step:v,t:p}),D=c?"":b(v);return D&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:D}),g.error=!0),e.jsxs(lr,{children:[e.jsx(ir,{icon:e.jsx(xs,{error:D,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:D?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:D||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(cr,{children:[e.jsx(A,{fontSize:12,children:j.description}),!h&&e.jsx(a,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(X,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:D||!C,children:p("common.continue")}),v>0&&e.jsx(X,{disabled:v===0,onClick:f,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx(Lt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}gs.propTypes={steps:n.array.isRequired,activeStep:n.number.isRequired,setActiveStep:n.func.isRequired,params:n.object.isRequired,viewMode:n.oneOfType([n.string,n.bool]),loading:n.bool.isRequired,projectId:n.string.isRequired,hasSelectedResources:n.oneOfType([n.string,n.bool]),warning:n.object.isRequired,paramsErrTip:n.shape({projectId:n.string,blockletVersion:n.string,blockletTitle:n.string,blockletDescription:n.string,note:n.string,blockletResource:n.string,blockletHomepage:n.string,blockletSupport:n.string,blockletCommunity:n.string,blockletRepository:n.string,blockletDocker:n.object,dockerImageName:n.string}).isRequired};const mn=[".zip",".gz"],bn=1024*1024*100,fn=k.lazy(()=>No(()=>import("./index-BsDq3W_j.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ks({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=G(),x=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(W.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(a,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),e.jsxs(Re,{direction:"row",spacing:1,sx:{alignItems:"center",flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(X,{variant:"outlined",size:"small",onClick:()=>{p()&&x.current?.open()},children:r.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Je,{}),children:e.jsx(fn,{ref:x,locale:u,popup:!0,onUploadFinish:f=>{l({uploadedResource:f.data.filename}),c({blockletResource:""}),x.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:mn,maxFileSize:bn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}ks.propTypes={app:n.object.isRequired,projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,error:n.string.isRequired,setParamsErrTip:n.func.isRequired};function Tt({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:c}){const{t:i}=G();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:c||t,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(ne,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||t,variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,me.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(He,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Tt.propTypes={readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,loading:n.bool.isRequired};function js(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&js(t[o]);return t}var xn=Wr();const oe=fo(xn),gn={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ut={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},kn={"--volume":!0,"--publish":!0},jn=new Set(["--publish","--volume"]),ys=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function yn(t){return t.map(o=>{if(o.key!=="--volume"||o.value.startsWith("$BLOCKLET_APP_DIR/")||o.value.startsWith("$BLOCKLET_DATA_DIR/"))return o;const[s,...r]=o.value.split(":");if(!s||!ys(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...r].join(":")}})}function wn(t){let o=!0;return t.find(r=>r.key==="--publish"&&r.type==="web")?t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"docker":r.type};return o=r.type==="web",l}return r}):t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"web":"docker"};return o=!1,l}return r})}function po(t){if(!t)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(t=t.trim(),t.startsWith("$ docker run")&&(t=t.replace("$ docker run","docker run")),!t.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const s=t.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!s)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const r=[],l=[];let c=0,i="",d="";const u=[];for(;c<s.length;){const p=s[c];if(!p){c++;continue}if(p==="docker"||p==="run"){c++;continue}if((p==="-e"||p==="--env")&&c+1<s.length){const m=s[c+1]||"",[f,...b]=m.split("=");if(f){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:f,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let f=p,b=null;m!==-1&&(f=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=gn[f];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,r.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){r.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const x=[];for(const p of r)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(jn.has(p.key)&&p.value==="true")&&x.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:wn(yn(x)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function vn({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:r}){if(t.length===0&&o.length===0&&!s)return"";const l=["docker run \\"],c=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const i of t){const{key:d,value:u}=i;if(c.has(d))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}else if(!l.some(x=>x.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}}for(const i of o){const{key:d,value:u}=i,x=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${x} \\`)}return s&&l.push(` ${s} \\`),r&&l.push(` ${r} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
193
+ `;function bs({text:t}){const{palette:o}=Eo();return t?e.jsx(zr,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:xr.sanitize(t),rehypePlugins:[[Br,{target:"_blank"}]]}):e.jsx(Fe,{Icon:Nt})}bs.propTypes={text:n.string.isRequired};function fs({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:c}){const{t:i}=G(),[d,u]=k.useState(c?"preview":"write"),x=(p,m)=>{u(m)};return e.jsxs(a,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",sx:{fontWeight:"bold"},children:i("common.introduction")}),e.jsxs(Lo,{value:d,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(a,{sx:{display:d==="write"?"block":"none",width:"100%",marginTop:3},children:e.jsx(ne,{disabled:r||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{l({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,me.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||"",slotProps:{input:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:e.jsxs(He,{position:"end",children:[t?.blockletIntroduction?.length||0," / ",me.PROJECT.MAX_INTRO_LENGTH]})}}})}),e.jsx(a,{sx:{display:d==="preview"?"block":"none",mt:3},children:e.jsx(bs,{text:t.blockletIntroduction||""})})]})}fs.propTypes={params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,readOnly:n.bool.isRequired,loading:n.bool.isRequired};function xs({step:t=0,ok:o=!1,active:s=0,error:r="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx(Po,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(c="error.main",i=e.jsx(Xt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Xt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(c="primary.main"),e.jsx(a,{sx:{width:24,height:24,bgcolor:c,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center"},children:i})}xs.propTypes={step:n.number,ok:n.bool,active:n.number,error:n.string,warning:n.bool};function gs({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:x}){const{t:p}=G(),m=()=>{s(j=>j+1)},f=()=>{s(j=>j-1)},b=j=>j===0?i?.blockletTitle||i?.projectId||i?.blockletDescription||i?.blockletHomepage||i?.blockletSupport||i?.blockletCommunity||i?.blockletRepository:j===2?i?.blockletResource||i?.blockletDocker||i?.dockerImageName:j>=4?i?.blockletVersion||i?.note:"",h=u||rs({params:l,projectId:x,t:p})===null;return e.jsxs(a,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(nr,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!pn({params:l,projectId:x,step:v,t:p}),D=c?"":b(v);return D&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:D}),g.error=!0),e.jsxs(lr,{children:[e.jsx(ir,{icon:e.jsx(xs,{error:D,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:D?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:D||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(cr,{children:[e.jsx(A,{fontSize:12,children:j.description}),!h&&e.jsx(a,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(X,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:D||!C,children:p("common.continue")}),v>0&&e.jsx(X,{disabled:v===0,onClick:f,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx(Lt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}gs.propTypes={steps:n.array.isRequired,activeStep:n.number.isRequired,setActiveStep:n.func.isRequired,params:n.object.isRequired,viewMode:n.oneOfType([n.string,n.bool]),loading:n.bool.isRequired,projectId:n.string.isRequired,hasSelectedResources:n.oneOfType([n.string,n.bool]),warning:n.object.isRequired,paramsErrTip:n.shape({projectId:n.string,blockletVersion:n.string,blockletTitle:n.string,blockletDescription:n.string,note:n.string,blockletResource:n.string,blockletHomepage:n.string,blockletSupport:n.string,blockletCommunity:n.string,blockletRepository:n.string,blockletDocker:n.object,dockerImageName:n.string}).isRequired};const mn=[".zip",".gz"],bn=1024*1024*100,fn=k.lazy(()=>No(()=>import("./index-B2HJDbWz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])).then(t=>({default:t.Uploader})));function ks({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=G(),x=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(W.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(a,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),e.jsxs(Re,{direction:"row",spacing:1,sx:{alignItems:"center",flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(X,{variant:"outlined",size:"small",onClick:()=>{p()&&x.current?.open()},children:r.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Je,{}),children:e.jsx(fn,{ref:x,locale:u,popup:!0,onUploadFinish:f=>{l({uploadedResource:f.data.filename}),c({blockletResource:""}),x.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:mn,maxFileSize:bn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}ks.propTypes={app:n.object.isRequired,projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,error:n.string.isRequired,setParamsErrTip:n.func.isRequired};function Tt({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:c}){const{t:i}=G();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:c||t,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(ne,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||t,variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,me.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(He,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Tt.propTypes={readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,loading:n.bool.isRequired};function js(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&js(t[o]);return t}var xn=Wr();const oe=fo(xn),gn={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ut={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},kn={"--volume":!0,"--publish":!0},jn=new Set(["--publish","--volume"]),ys=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function yn(t){return t.map(o=>{if(o.key!=="--volume"||o.value.startsWith("$BLOCKLET_APP_DIR/")||o.value.startsWith("$BLOCKLET_DATA_DIR/"))return o;const[s,...r]=o.value.split(":");if(!s||!ys(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...r].join(":")}})}function wn(t){let o=!0;return t.find(r=>r.key==="--publish"&&r.type==="web")?t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"docker":r.type};return o=r.type==="web",l}return r}):t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"web":"docker"};return o=!1,l}return r})}function po(t){if(!t)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(t=t.trim(),t.startsWith("$ docker run")&&(t=t.replace("$ docker run","docker run")),!t.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const s=t.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!s)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const r=[],l=[];let c=0,i="",d="";const u=[];for(;c<s.length;){const p=s[c];if(!p){c++;continue}if(p==="docker"||p==="run"){c++;continue}if((p==="-e"||p==="--env")&&c+1<s.length){const m=s[c+1]||"",[f,...b]=m.split("=");if(f){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:f,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let f=p,b=null;m!==-1&&(f=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=gn[f];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,r.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){r.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const x=[];for(const p of r)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(jn.has(p.key)&&p.value==="true")&&x.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:wn(yn(x)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function vn({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:r}){if(t.length===0&&o.length===0&&!s)return"";const l=["docker run \\"],c=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const i of t){const{key:d,value:u}=i;if(c.has(d))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}else if(!l.some(x=>x.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}}for(const i of o){const{key:d,value:u}=i,x=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${x} \\`)}return s&&l.push(` ${s} \\`),r&&l.push(` ${r} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
194
194
  `)}const ws={"--volume":t=>{const[o]=t.split(":");return o?ys(t)&&!t.startsWith("$BLOCKLET_APP_DIR/")&&!t.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":t.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},Qe=t=>t.replace(/^[-]+/,"").replace(/-([a-z])/g,(r,l)=>l.toUpperCase()),Cn=t=>`--${t.replace(/([A-Z])/g,"-$1").toLowerCase()}`,Rn=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],Sn=["rm ","sudo "];function vs(t){if(t==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(t))throw new Error("Docker CMD is invalid");const s=t.toLocaleLowerCase();if(Sn.some(l=>s.indexOf(l)!==-1))throw new Error("Docker CMD is invalid");if(Rn.some(l=>t.indexOf(l)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(t))throw new Error("Docker CMD is invalid")}const Tn=Array.from(new Set(Object.keys(Ut).map(Qe))),Dn=["publish","volume"];oe.object({workdir:oe.string().trim().optional(),image:oe.string().trim().regex(/^[^\s]+$/).optional(),shell:oe.string().trim().optional(),volumes:oe.array().items(oe.string().trim()).optional(),script:oe.string().trim().optional(),installNodeModules:oe.boolean().optional(),skipWrapDockerfile:oe.boolean().optional(),command:oe.string().allow("").default("").optional().custom((t,o)=>{try{return vs(t),t}catch(s){return o.error("any.invalid",{message:s.message})}},"Docker CMD validation"),runBaseScript:oe.boolean().optional(),...Tn.reduce((t,o)=>{const s=ws[Cn(o)];return Dn.includes(o)?(t[o]=oe.array().items(oe.string().trim()).optional(),s?t[o]=oe.array().items(oe.string().trim().custom((r,l)=>{const c=s(r);return c?l.message(c):r})).optional():t[o]=oe.array().items(oe.string().trim()).optional(),t):(s?t[o]=oe.string().trim().custom((r,l)=>{const c=s(r);return c?l.message(c):r}).optional():t[o]=oe.string().trim().optional(),t)},{})}).optional();function Dt({index:t,item:o,dockerParams:s,setDockerParams:r,dataKey:l,t:c,readOnly:i}){const d=o?.value||"",[u,x]=k.useState(!1),p=()=>{s[l]?.splice(t,1),r({...s,[l]:[...s[l]]})},m=(P,L)=>{s[l]?.[t]&&(L?(s[l][t].custom=s[l][t].value,s[l][t].value=`$${Qe(o.key)}`):(s[l][t].value=s[l][t].custom||"",s[l][t].custom="")),r({...s,[l]:[...s[l]]})},f=(P,L)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],secure:L,value:L&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},r({...s,[l]:[...s[l]]})},b=(P,L)=>{s[l][t]={...s[l][t],shared:L},r({...s,[l]:[...s[l]]})},h=(P,L)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],required:L,value:L&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},r({...s,[l]:[...s[l]]})},j=(P,L)=>{s[l][t]={...s[l][t],value:L?me.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...s,[l]:[...s[l]]})},v=P=>{s[l][t]={...s[l][t],description:P.target.value},r({...s,[l]:[...s[l]]})},g=P=>{const L=P.target.value==="web"?"web":"docker";L==="web"&&s.dockerArgs.forEach(Z=>{Z.type="docker"});const S=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:L,path:L==="docker"?S:"/",protocol:"http",prefix:L==="docker"?S:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...s,dockerArgs:[...s.dockerArgs]})},C=P=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:P.target.value==="direct"?"direct":"service"},r({...s,dockerArgs:[...s.dockerArgs]})},D=P=>{const L=P.target.value;s[l][t]={...s[l][t],prefix:L,path:L==="*"?"/":L},r({...s,[l]:[...s[l]]})},R=P=>{s[l]?.[t]&&(s[l][t].value=P.target.value),r({...s,[l]:[...s[l]]})},y=d===`$${Qe(o.key)}`||o.custom,T=l==="dockerArgs"&&!Ut[o.key],O=kn[o.key],N=l==="dockerEnvs",z=o.key==="--publish";let K=o.key;return z&&o.type==="web"?K="--publish (Web)":N&&(K=`--env ${o.key}`),e.jsxs(a,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(a,{sx:{width:250},children:e.jsx(A,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:K})}),e.jsxs(a,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(ne,{disabled:i||y||T||o.value===me.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:y?`$${Qe(o.key)}`:d,sx:{flex:1},error:T,onChange:R,slotProps:{input:{endAdornment:e.jsxs(He,{position:"end",sx:{zoom:.9},children:[(!(O||T)||N||z)&&e.jsx(ce,{onClick:()=>x(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!i&&e.jsx(ce,{onClick:p,color:T?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})}}}),T&&e.jsx(A,{variant:"caption",color:"error",children:c("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(A,{variant:"caption",sx:{color:"text.secondary"},children:c("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&ws[o.key](d)&&e.jsx(A,{variant:"caption",color:"error",children:c("blocklet.publish.docker.volumeTips")})]}),u&&e.jsx(ct,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:c(N?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>x(!1),children:e.jsxs(a,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[O||T||N?null:e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.needCustomInput")}),e.jsx(Le,{disabled:i,checked:y,onChange:m,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.shared")}),e.jsx(Le,{disabled:i,checked:o.shared,onChange:b,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.required")}),e.jsx(Le,{disabled:i,checked:o.required,onChange:h,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.secure")}),e.jsx(Le,{disabled:i,checked:o.secure,onChange:f,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.autoGenerated")}),e.jsx(Le,{disabled:i,checked:o.value===me.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:j,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.description")}),e.jsx(ne,{disabled:i,value:o.description,onChange:v,sx:{flex:1},label:c("blocklet.publish.docker.description")})]}),z&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.portType")}),e.jsxs(vt,{value:o.type||"docker",onChange:g,children:[e.jsx(be,{value:"docker",children:"Docker"}),e.jsx(be,{value:"web",children:"Web"})]})]}),z&&o.type==="web"&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.proxyBehavior")}),e.jsxs(vt,{value:o.proxyBehavior||"service",onChange:C,children:[e.jsx(be,{value:"service",children:c("blocklet.publish.docker.serviceProxy")}),e.jsx(be,{value:"direct",children:c("blocklet.publish.docker.directProxy")})]})]}),z&&o.type==="web"&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.prefix")}),e.jsx(ne,{disabled:i,value:o.prefix,onChange:D,sx:{flex:1},label:c("blocklet.publish.docker.prefix")})]})]})})]})}Dt.propTypes={dockerParams:n.object.isRequired,setDockerParams:n.func.isRequired,dataKey:n.string.isRequired,item:n.object.isRequired,t:n.func.isRequired,readOnly:n.bool.isRequired,index:n.number.isRequired};const In=`
195
195
  docker run --name postgrest
196
196
  -p 3000:3000
@@ -1,4 +1,4 @@
1
- import{T as M,H as q,I as N,j as J,G as ve,J as Ce,W as Se}from"./vendor-ux-Cra9XTth.js";import{s as Te,k as le,t as Ie}from"./vendor-hooks-DTeIFVkk.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bB as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as P,bd as _,a5 as Y,V as X,S as Z,b4 as Oe,U as L,I as B,cm as Ae,bf as Pe,a7 as $e,F as qe,W as t,b1 as R,a3 as ce,c1 as ee,cn as Le,aO as Me,aP as Be,co as Fe,cp as He,cq as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cr as Ve,aZ as Je,ch as Ye,ca as Qe,cg as Ge}from"./vendor-mui-core-BOHKtf8y.js";import{B as de,a as pe,l as ue}from"./index-IvJAtHzW.js";import{U as K,c as xe,ad as Xe,a1 as Ze,b1 as Q}from"./index-BGbMta1w.js";import{u as V}from"./team-D7qYznX0.js";import{u as et}from"./use-mobile-BlpLWscF.js";import{u as tt,C as G}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-BOkrEpKO.js";import{C as st}from"./confirm-BE3P2t7f.js";import{A as nt}from"./actions-B0rWiAuM.js";import{T as ie}from"./table-tips-73VcKMz1.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock--zSibe1w.js";import"./session-DwRV85k4.js";import"./isURL-Bawv3imX.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[b,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),f=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{f()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:b,error:w,loadData:f}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:b=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),f=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(Y,{onChange:T,checked:l>0&&l===f}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(X,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(Y,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Ae,{}):e.jsx(Pe,{})})]})]})}),m.length>0&&e.jsx($e,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(X,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(Z,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(Y,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),b&&e.jsx(qe,{error:!0,sx:{mt:1},children:b})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function fe({id:i=null,url:u="",description:c="",enabledEvents:b=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:f}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:f,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:f,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(b.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,b]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(G,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(G,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(G,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}fe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function be(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Xe(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function A({value:i,label:u,tip:c="",divider:b=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),b&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}A.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:b=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:b,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const b=new Date(c.createdAt).toLocaleDateString();u[b]||(u[b]=[]),u[b]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:b,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ze(),{data:l,loadMore:f,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return b.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map($=>$.id===s.id?{...$,...s}:$);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await b.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find($=>$?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(X,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:f,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx(P,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(J,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
1
+ import{T as M,H as q,I as N,j as J,G as ve,J as Ce,W as Se}from"./vendor-ux-C1NY8cuW.js";import{s as Te,k as le,t as Ie}from"./vendor-hooks-DTeIFVkk.js";import{r as E,a as ae}from"./vendor-react-Dvs43sk9.js";import{j as e,Y as Re,bB as We,$ as ze,ak as p,z as se,T as C,a6 as F,aX as te,R as De,Q as H,b6 as ne,am as P,bd as _,a5 as Y,V as X,S as Z,b4 as Oe,U as L,I as B,cm as Ae,bf as Pe,a7 as $e,F as qe,W as t,b1 as R,a3 as ce,c1 as ee,cn as Le,aO as Me,aP as Be,co as Fe,cp as He,cq as Ne,s as oe,aU as Ue,aj as _e,J as Ke,cr as Ve,aZ as Je,ch as Ye,ca as Qe,cg as Ge}from"./vendor-mui-core-CAIaAq-_.js";import{B as de,a as pe,l as ue}from"./index-D05HWeh6.js";import{U as K,c as xe,ad as Xe,a1 as Ze,b1 as Q}from"./index-l5234Nwn.js";import{u as V}from"./team-DjZ9qE6U.js";import{u as et}from"./use-mobile-CzqOrBZu.js";import{u as tt,C as G}from"./index.esm-JPZAjt0x.js";import{C as he,a as me,J as ot}from"./vendor-utils-BOkrEpKO.js";import{C as st}from"./confirm-DwicyBRo.js";import{A as nt}from"./actions-DiUxQ792.js";import{T as ie}from"./table-tips-LM2ip4Rj.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DU4xNzGM.js";import"./session-YnDvY5CJ.js";import"./isURL-DA2-tMLY.js";import"./index-DBs9Ljax.js";const it=i=>{const[u,c]=E.useState(null),[b,r]=E.useState(!0),[w,x]=E.useState(null),j=window.blocklet?.appUrl,l=E.useMemo(()=>{const g={};return u&&(u.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),u.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[u]),f=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(he(j,xe.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),x(null)}catch(g){x(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return E.useEffect(()=>{f()},[j]),{openEvent:u,setOpenEvent:c,eventsBySource:l,loading:b,error:w,loadData:f}};function ge({eventsBySource:i,selectedEvents:u,setSelectedEvents:c,error:b=null}){const{t:r}=M(),[w,x]=E.useState({}),j=E.useMemo(()=>{const n={};return Object.entries(i).forEach(([a,{events:m}])=>{const v=m.filter(S=>u[`${S.type}-${S.source}`]).length;n[a]=v}),n},[i,u]),l=E.useMemo(()=>Object.values(j).reduce((n,a)=>n+a,0),[j]),f=E.useMemo(()=>Object.values(i).reduce((n,{events:a})=>n+a.length,0),[i]),g=(n,a)=>{a.stopPropagation(),x({...w,[n]:!w[n]})},y=n=>{const a=`${n.type}-${n.source}`;c(m=>({...m,[a]:!m[a]}))},z=(n,a)=>{const m={};n.forEach(v=>{const S=`${v.type}-${v.source}`;m[S]=!a}),c(v=>({...v,...m}))},T=n=>{const a={};Object.values(i).forEach(({events:m})=>{m.forEach(v=>{const S=`${v.type}-${v.source}`;a[S]=n.target.checked})}),c(a)};return e.jsxs(p,{sx:{width:"100%"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ne,{control:e.jsx(Y,{onChange:T,checked:l>0&&l===f}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),l>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:l})})]}),e.jsx(p,{sx:{maxHeight:"50vh",overflow:"auto"},children:e.jsx(X,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:"4px"},children:Object.entries(i).map(([n,{source:a,events:m,count:v}],S)=>{const D=j[n]>0,I=j[n]===m.length&&m.length>0,O=w[n];return e.jsxs(ae.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:o})=>S<Object.keys(i).length-1?`1px solid ${o.divider}`:"none",px:2,py:1.5,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(p,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:o=>{o.target.closest(".MuiFormControlLabel-root")||g(n,o)},children:[e.jsx(p,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ne,{control:e.jsx(Y,{checked:I,indeterminate:D&&!I,onChange:o=>{o.stopPropagation(),z(m,I)}}),label:e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.logo&&e.jsx(Oe,{src:a.logo,sx:{width:24,height:24}}),e.jsx(p,{children:a.title||n}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[n]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:o=>`${o.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(p,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:v})}),m.length>0&&e.jsx(B,{size:"small",edge:"end",children:O?e.jsx(Ae,{}):e.jsx(Pe,{})})]})]})}),m.length>0&&e.jsx($e,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(X,{disablePadding:!0,sx:{pl:2,pr:2,py:1,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(o=>{const d=`${o.type}-${o.source}`,s=!!u[d];return e.jsx(Z,{dense:!0,sx:{py:.75},onClick:()=>y(o),children:e.jsxs(p,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(Y,{checked:s,sx:{mr:1}}),e.jsxs(p,{children:[e.jsx(C,{variant:"body1",sx:{cursor:"pointer",color:"text.primary"},children:o.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer"},children:o.description})]})]})},d)})})})]},n)})})}),b&&e.jsx(qe,{error:!0,sx:{mt:1},children:b})]})}ge.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function fe({id:i=null,url:u="",description:c="",enabledEvents:b=[],onSubmit:r,onClose:w=()=>{}}){const{t:x}=M(),[j,l]=E.useState({}),{teamDid:f}=V(),{api:g}=K(),{loading:y,error:z,eventsBySource:T}=it(),{control:n,handleSubmit:a,formState:{errors:m},reset:v,setValue:S,trigger:D}=tt({defaultValues:{url:"",description:""}});E.useEffect(()=>{const o=Object.values(j).some(d=>d);S("selectedEvents",o?"valid":""),D("selectedEvents")},[j,S,D]);const I=()=>{l({}),v(),w()},O=async o=>{const d=Object.keys(j).filter(h=>j[h]),s={url:o.url,description:o.description,enabledEvents:d.map(h=>{const[k,W]=h.split("-");return!k||!W?null:{type:k,source:W}}).filter(Boolean)};try{if(i){const h=await g.updateWebhookEndpoint({input:{teamDid:f,id:i,data:s}});q.success(`${x("webhookEndpoint.updateWebhook")} ${x("webhookEndpoint.success")}`),r(h)}else{const h=await g.createWebhookEndpoint({input:{teamDid:f,input:s}});q.success(`${x("webhookEndpoint.createWebhook")} ${x("webhookEndpoint.success")}`),r(h)}}catch(h){q.error(h?.message)}I()};return E.useEffect(()=>{v({url:u,description:c}),l(b.reduce((o,d)=>(o[`${d.type}-${d.source}`]=!0,o),{}))},[v,l,u,c,b]),e.jsx(Re,{open:!0,onClose:I,maxWidth:"lg",fullWidth:!0,sx:{"& .MuiDialog-paper":{minHeight:600}},children:e.jsxs("form",{onSubmit:a(O),children:[e.jsx(We,{children:x(i?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(ze,{children:e.jsxs(p,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(G,{name:"url",control:n,rules:{required:x("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:x("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.url.label"),fullWidth:!0,error:!!m.url,helperText:m.url?.message})}),e.jsx(G,{name:"description",control:n,rules:{required:x("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(se,{...o,label:x("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!m.description,helperText:m.description?.message})}),e.jsx(G,{name:"selectedEvents",control:n,rules:{required:x("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&T&&Object.keys(T).length>0&&e.jsx(ge,{eventsBySource:T,selectedEvents:j,setSelectedEvents:l,error:m.selectedEvents?.message}),!y&&(!T||Object.keys(T).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:x("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(F,{size:20})}),z&&e.jsx(te,{severity:"error",children:x("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(De,{sx:{p:"8px 24px 24px"},children:[e.jsx(H,{onClick:I,children:x("common.cancel")}),e.jsx(H,{type:"submit",variant:"contained",color:"primary",children:x(i?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}fe.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function be(i){switch(i){case"enabled":return"success";case"disabled":default:return"default"}}const rt=(i="en")=>i==="tw"?"zh":i;function U(i,u="YYYY-MM-DD HH:mm:ss",c="en"){return i?Xe(i).locale(rt(c)).format(u):"-"}function lt(i){return typeof i=="number"?!1:me(i)}function at(i){return i>=200&&i<300}function A({value:i,label:u,tip:c="",divider:b=!1}){const r=lt(i);return e.jsxs(e.Fragment,{children:[e.jsxs(R,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[u,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":i})]}),b&&e.jsx(ce,{orientation:"vertical",flexItem:!0})]})}A.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function je({title:i,children:u=null,mb:c=1.5,mt:b=1.5}){return e.jsxs(R,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:b,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:i}),u]})}je.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const ct={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},dt=i=>{const u={};return i.forEach(c=>{const b=new Date(c.createdAt).toLocaleDateString();u[b]||(u[b]=[]),u[b]?.push(c)}),u};function ye({eventId:i="",webhookEndpointId:u="",event:c=null}){const{api:b,ws:{useSubscription:r}}=K(),{t:w}=M(),{teamDid:x}=V(),{blocklet:j}=Ze(),{data:l,loadMore:f,loadingMore:g,loading:y,mutate:z}=Te(s=>{const k=s?Math.ceil(s.list.length/15)+1:1;return b.getWebhookAttempts({input:{teamDid:x,input:{eventId:i,webhookId:u},paging:{page:k,pageSize:15}}})},{reloadDeps:[i,u]}),T=l?.list||[],[n,a]=E.useState(null),[m,v]=E.useState(!1),S=dt(T);if(E.useEffect(()=>{!n&&l?.list.length&&a(l.list[0])},[l?.list.length,n]),r(xe.EVENTS.WEBHOOK_ATTEMPT,s=>{z(h=>{if(h.list.find(W=>W.id===s.id)){const W=h.list.map($=>$.id===s.id?{...$,...s}:$);return{...h,list:W}}return s.endpoint=h.list[0]?.endpoint,s.event=h.list[0]?.event,{...h,list:[s,...h.list]}})},[]),y)return e.jsx(F,{});const D=l&&l.list.length<l.paging.total,I=async()=>{n&&(v(!0),await b.retryWebhookAttempt({input:{teamDid:x,eventId:n.event.id,webhookId:u,attemptId:n.id}}).finally(()=>{setTimeout(()=>{v(!1)},1e3)}))},O=s=>{if(s.responseBody&&s.responseBody?.sessionId&&s.responseBody?.projectId&&s.responseBody?.agentId){const h=j?.site?.domainAliases[0]?.value,k=(j.children||[]).find($=>$?.meta?.name==="ai-studio"),W=ot(he(`https://${h}`,k?.mountPoint||"","projects",s.responseBody.projectId,"logs/main"),{sessionId:s.responseBody.sessionId,agentId:s.responseBody.agentId});return e.jsx(B,{sx:{fontSize:20},onClick:()=>window.open(W,"_blank"),children:e.jsx(p,{component:N,icon:Q})})}return null},o=s=>s.status==="pending"?e.jsx(Fe,{color:"warning"}):at(s.responseStatus)?e.jsx(He,{color:"success"}):e.jsx(Ne,{color:"error"}),d=n?.triggeredFrom&&(l?.list||[]).find(s=>s.id===n.triggeredFrom);return e.jsxs(pt,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:me(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(X,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([s,h])=>e.jsxs(ae.Fragment,{children:[e.jsx(Le,{sx:{p:0},children:s}),h.map(k=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>a(k),selected:n&&n?.id===k?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:U(k.createdAt,"HH:mm:ss")}),children:[e.jsx(Me,{sx:{minWidth:0,mr:1.5},children:o(k)}),e.jsx(Be,{primary:e.jsx(C,{sx:{color:"text.primary"},children:k.event.type})})]},k.id))]},s))}),D&&e.jsx(p,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(H,{variant:"text",type:"button",color:"inherit",onClick:f,disabled:g,sx:{color:s=>s.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[n&&e.jsxs(R,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${n.status}`)}),e.jsx(p,{children:O(n)})]}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[d&&e.jsx(P,{placement:"left",title:e.jsxs(R,{onClick:()=>a(d),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(de,{showDid:!0,did:n.triggeredBy,cardType:ue.Detailed,infoType:pe.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(ce,{}),e.jsxs(p,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(p,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:n.id}),e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(B,{onClick:()=>a(d),children:e.jsx(p,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(H,{variant:"outlined",color:"primary",size:"small",onClick:I,disabled:m,children:[e.jsx(p,{component:N,icon:ct,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(p,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",n.responseStatus,")"]}),e.jsx(J,{language:"json",children:JSON.stringify(n.responseBody,null,2)})]}),e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(n.event,null,2)})]})]}),l?.list.length===0&&c&&e.jsxs(p,{children:[e.jsx(R,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(J,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}ye.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const pt=oe(ee)`
2
2
  @keyframes spin {
3
3
  to {
4
4
  transform: rotate(360deg);
@@ -1 +1 @@
1
- import{j as t,ak as l,W as o}from"./vendor-mui-core-BOHKtf8y.js";import{n}from"./vendor-ux-Cra9XTth.js";import{r as C}from"./vendor-react-Dvs43sk9.js";const i=e=>C.createElement("svg",{width:239,height:42,viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},C.createElement("path",{d:"M24.6042 2.26271L28.5233 0H42.7899V41.8617H28.7912C28.6157 41.8617 28.4433 41.8155 28.2912 41.7277L13.1882 33.0079L13.1882 8.85374L15.0055 7.80451L18.2055 9.65203L16.3882 10.7013V31.1604L29.3807 38.6617H39.5899V3.2H29.3807L27.8042 4.11023L24.6042 2.26271Z",fill:"currentColor"}),C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.4018 31.1604V10.7013L13.4092 3.2H3.2V38.6617H13.4092L14.9906 37.7486L18.1906 39.5961L14.2666 41.8617H0V0H14.2666L29.6018 8.85374V33.0079L27.7893 34.0543L24.5893 32.2068L26.4018 31.1604Z",fill:"currentColor"}),C.createElement("path",{d:"M138.44 27.684C138.632 27.684 138.797 27.7587 138.936 27.908L140.28 29.38C139.341 30.4893 138.195 31.348 136.84 31.956C135.496 32.564 133.875 32.868 131.976 32.868C130.312 32.868 128.803 32.58 127.448 32.004C126.104 31.428 124.952 30.6227 123.992 29.588C123.043 28.5533 122.307 27.316 121.784 25.876C121.261 24.436 121 22.852 121 21.124C121 19.396 121.272 17.812 121.816 16.372C122.371 14.932 123.144 13.6947 124.136 12.66C125.128 11.6253 126.312 10.82 127.688 10.244C129.075 9.668 130.605 9.38 132.28 9.38C133.912 9.38 135.363 9.64666 136.632 10.18C137.901 10.7133 139.005 11.4227 139.944 12.308L138.824 13.892C138.749 14.0093 138.653 14.1053 138.536 14.18C138.429 14.2547 138.285 14.292 138.104 14.292C137.901 14.292 137.661 14.1907 137.384 13.988C137.117 13.7853 136.76 13.5613 136.312 13.316C135.875 13.06 135.331 12.8307 134.68 12.628C134.029 12.4253 133.219 12.324 132.248 12.324C131.107 12.324 130.061 12.5267 129.112 12.932C128.163 13.3267 127.341 13.9027 126.648 14.66C125.965 15.4067 125.432 16.3293 125.048 17.428C124.675 18.516 124.488 19.748 124.488 21.124C124.488 22.5213 124.685 23.764 125.08 24.852C125.475 25.94 126.019 26.8627 126.712 27.62C127.405 28.3773 128.221 28.9533 129.16 29.348C130.099 29.7427 131.112 29.94 132.2 29.94C132.861 29.94 133.453 29.9027 133.976 29.828C134.509 29.7427 134.995 29.62 135.432 29.46C135.88 29.3 136.301 29.0973 136.696 28.852C137.091 28.596 137.48 28.292 137.864 27.94C137.949 27.8653 138.04 27.8067 138.136 27.764C138.232 27.7107 138.333 27.684 138.44 27.684Z",fill:"currentColor"}),C.createElement("path",{d:"M149.68 16.1C150.875 16.1 151.952 16.2973 152.912 16.692C153.883 17.076 154.704 17.636 155.376 18.372C156.059 19.0973 156.581 19.9773 156.944 21.012C157.307 22.036 157.488 23.188 157.488 24.468C157.488 25.748 157.307 26.9053 156.944 27.94C156.581 28.9747 156.059 29.8547 155.376 30.58C154.704 31.3053 153.883 31.8653 152.912 32.26C151.952 32.644 150.875 32.836 149.68 32.836C148.475 32.836 147.387 32.644 146.416 32.26C145.456 31.8653 144.635 31.3053 143.952 30.58C143.269 29.8547 142.741 28.9747 142.368 27.94C142.005 26.9053 141.824 25.748 141.824 24.468C141.824 23.188 142.005 22.036 142.368 21.012C142.741 19.9773 143.269 19.0973 143.952 18.372C144.635 17.636 145.456 17.076 146.416 16.692C147.387 16.2973 148.475 16.1 149.68 16.1ZM149.68 30.404C151.216 30.404 152.363 29.8867 153.12 28.852C153.877 27.8173 154.256 26.3613 154.256 24.484C154.256 22.6067 153.877 21.1507 153.12 20.116C152.363 19.0707 151.216 18.548 149.68 18.548C148.123 18.548 146.96 19.0707 146.192 20.116C145.435 21.1507 145.056 22.6067 145.056 24.484C145.056 26.3613 145.435 27.8173 146.192 28.852C146.96 29.8867 148.123 30.404 149.68 30.404Z",fill:"currentColor"}),C.createElement("path",{d:"M163.899 18.612C164.251 18.2387 164.619 17.8973 165.003 17.588C165.387 17.2787 165.792 17.0173 166.219 16.804C166.656 16.58 167.12 16.4093 167.611 16.292C168.112 16.164 168.645 16.1 169.211 16.1C170.107 16.1 170.891 16.2493 171.563 16.548C172.245 16.8467 172.816 17.268 173.275 17.812C173.733 18.3453 174.08 18.9907 174.315 19.748C174.549 20.5053 174.667 21.3427 174.667 22.26V32.612H171.531V22.26C171.531 21.0973 171.264 20.196 170.731 19.556C170.197 18.9053 169.381 18.58 168.283 18.58C167.483 18.58 166.731 18.772 166.027 19.156C165.333 19.5293 164.688 20.0413 164.091 20.692V32.612H160.971V16.356H162.843C163.28 16.356 163.552 16.564 163.659 16.98L163.899 18.612Z",fill:"currentColor"}),C.createElement("path",{d:"M181.805 18.612C182.157 18.2387 182.525 17.8973 182.909 17.588C183.293 17.2787 183.698 17.0173 184.125 16.804C184.562 16.58 185.026 16.4093 185.517 16.292C186.018 16.164 186.552 16.1 187.117 16.1C188.013 16.1 188.797 16.2493 189.469 16.548C190.152 16.8467 190.722 17.268 191.181 17.812C191.64 18.3453 191.986 18.9907 192.221 19.748C192.456 20.5053 192.573 21.3427 192.573 22.26V32.612H189.437V22.26C189.437 21.0973 189.17 20.196 188.637 19.556C188.104 18.9053 187.288 18.58 186.189 18.58C185.389 18.58 184.637 18.772 183.933 19.156C183.24 19.5293 182.594 20.0413 181.997 20.692V32.612H178.877V16.356H180.749C181.186 16.356 181.458 16.564 181.565 16.98L181.805 18.612Z",fill:"currentColor"}),C.createElement("path",{d:"M207.551 22.676C207.551 22.0573 207.461 21.4867 207.279 20.964C207.109 20.4413 206.853 19.988 206.511 19.604C206.17 19.22 205.754 18.9213 205.263 18.708C204.773 18.4947 204.207 18.388 203.567 18.388C202.255 18.388 201.221 18.7667 200.463 19.524C199.717 20.2813 199.242 21.332 199.039 22.676H207.551ZM210.127 30.292C209.743 30.74 209.301 31.1293 208.799 31.46C208.298 31.78 207.765 32.0413 207.199 32.244C206.634 32.4467 206.047 32.596 205.439 32.692C204.842 32.788 204.25 32.836 203.663 32.836C202.543 32.836 201.503 32.6493 200.543 32.276C199.594 31.892 198.767 31.3373 198.063 30.612C197.37 29.876 196.826 28.9693 196.431 27.892C196.047 26.804 195.855 25.556 195.855 24.148C195.855 23.0173 196.031 21.9667 196.383 20.996C196.735 20.0147 197.237 19.1613 197.887 18.436C198.549 17.7107 199.354 17.14 200.303 16.724C201.253 16.308 202.319 16.1 203.503 16.1C204.495 16.1 205.407 16.2653 206.239 16.596C207.082 16.916 207.807 17.3853 208.415 18.004C209.023 18.6227 209.498 19.3853 209.839 20.292C210.191 21.1987 210.367 22.2333 210.367 23.396C210.367 23.876 210.314 24.2013 210.207 24.372C210.101 24.532 209.903 24.612 209.615 24.612H198.959C198.991 25.5827 199.13 26.4307 199.375 27.156C199.621 27.8707 199.957 28.468 200.383 28.948C200.821 29.428 201.338 29.7853 201.935 30.02C202.533 30.2547 203.199 30.372 203.935 30.372C204.629 30.372 205.226 30.292 205.727 30.132C206.239 29.972 206.677 29.8013 207.039 29.62C207.413 29.428 207.722 29.252 207.967 29.092C208.223 28.932 208.447 28.852 208.639 28.852C208.895 28.852 209.093 28.948 209.231 29.14L210.127 30.292Z",fill:"currentColor"}),C.createElement("path",{d:"M225.113 19.396C225.017 19.5133 224.921 19.6093 224.825 19.684C224.739 19.748 224.611 19.78 224.441 19.78C224.27 19.78 224.089 19.716 223.897 19.588C223.715 19.4493 223.481 19.3053 223.193 19.156C222.915 18.996 222.574 18.852 222.169 18.724C221.774 18.5853 221.283 18.516 220.697 18.516C219.929 18.516 219.251 18.6547 218.665 18.932C218.078 19.2093 217.587 19.604 217.193 20.116C216.809 20.628 216.515 21.252 216.313 21.988C216.11 22.724 216.009 23.5507 216.009 24.468C216.009 25.4173 216.115 26.2653 216.329 27.012C216.542 27.748 216.846 28.372 217.241 28.884C217.635 29.3853 218.115 29.7693 218.681 30.036C219.246 30.292 219.875 30.42 220.569 30.42C221.241 30.42 221.795 30.34 222.233 30.18C222.67 30.0093 223.033 29.828 223.321 29.636C223.609 29.444 223.849 29.268 224.041 29.108C224.233 28.9373 224.43 28.852 224.633 28.852C224.889 28.852 225.086 28.948 225.225 29.14L226.121 30.292C225.747 30.7507 225.326 31.14 224.857 31.46C224.398 31.78 223.907 32.0413 223.385 32.244C222.862 32.4467 222.313 32.596 221.737 32.692C221.171 32.788 220.595 32.836 220.009 32.836C218.995 32.836 218.046 32.6493 217.161 32.276C216.286 31.9027 215.523 31.3587 214.873 30.644C214.233 29.9293 213.726 29.0547 213.353 28.02C212.979 26.9747 212.793 25.7907 212.793 24.468C212.793 23.2627 212.958 22.148 213.289 21.124C213.63 20.1 214.126 19.22 214.777 18.484C215.438 17.7373 216.249 17.156 217.209 16.74C218.169 16.3133 219.267 16.1 220.505 16.1C221.667 16.1 222.691 16.2867 223.577 16.66C224.462 17.0333 225.251 17.5613 225.945 18.244L225.113 19.396Z",fill:"currentColor"}),C.createElement("path",{d:"M234.121 32.868C232.809 32.868 231.796 32.5 231.081 31.764C230.377 31.028 230.025 29.9773 230.025 28.612V18.884H228.137C227.956 18.884 227.801 18.8307 227.673 18.724C227.556 18.6067 227.497 18.436 227.497 18.212V16.948L230.137 16.58L230.841 11.732C230.884 11.5507 230.964 11.412 231.081 11.316C231.209 11.2093 231.369 11.156 231.561 11.156H233.145V16.612H237.753V18.884H233.145V28.404C233.145 29.044 233.3 29.524 233.609 29.844C233.929 30.1533 234.335 30.308 234.825 30.308C235.113 30.308 235.359 30.2707 235.561 30.196C235.775 30.1213 235.956 30.0413 236.105 29.956C236.255 29.86 236.383 29.7747 236.489 29.7C236.596 29.6253 236.692 29.588 236.777 29.588C236.884 29.588 236.964 29.6147 237.017 29.668C237.081 29.7107 237.145 29.7853 237.209 29.892L238.137 31.396C237.625 31.8653 237.017 32.228 236.313 32.484C235.609 32.74 234.879 32.868 234.121 32.868Z",fill:"currentColor"}),C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8154 33.2842V9H70.6597C73.9281 9.22427 76.4828 11.9486 76.4828 15.2433V27.026C76.4828 30.4823 73.6809 33.2842 70.2246 33.2842H57.8154ZM84.5586 9H81.2237V33.3211H84.5586V9ZM61.1503 29.9493V12.32H70.2246C71.8391 12.32 73.1479 13.6288 73.1479 15.2433V27.026C73.1479 28.6405 71.8391 29.9493 70.2246 29.9493H61.1503ZM89.2432 9V33.2842H101.652C105.109 33.2842 107.911 30.4823 107.911 27.026V15.2433C107.911 11.9486 105.356 9.22427 102.087 9H89.2432ZM112.155 14.6355H115.883V18.3639H112.155V14.6355ZM115.883 23.9572H112.155V27.6856H115.883V23.9572ZM92.5781 12.32V29.9493H101.652C103.267 29.9493 104.576 28.6405 104.576 27.026V15.2433C104.576 13.6288 103.267 12.32 101.652 12.32H92.5781Z",fill:"currentColor"}));function a({children:e=null,...r}){return t.jsxs(n,{color:"did",variant:"contained",...r,children:[t.jsx(l,{sx:{fontWeight:400},children:e||"Continue With"}),t.jsx(i,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}a.propTypes={children:o.any};export{a};
1
+ import{j as t,ak as l,W as o}from"./vendor-mui-core-CAIaAq-_.js";import{n}from"./vendor-ux-C1NY8cuW.js";import{r as C}from"./vendor-react-Dvs43sk9.js";const i=e=>C.createElement("svg",{width:239,height:42,viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},C.createElement("path",{d:"M24.6042 2.26271L28.5233 0H42.7899V41.8617H28.7912C28.6157 41.8617 28.4433 41.8155 28.2912 41.7277L13.1882 33.0079L13.1882 8.85374L15.0055 7.80451L18.2055 9.65203L16.3882 10.7013V31.1604L29.3807 38.6617H39.5899V3.2H29.3807L27.8042 4.11023L24.6042 2.26271Z",fill:"currentColor"}),C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.4018 31.1604V10.7013L13.4092 3.2H3.2V38.6617H13.4092L14.9906 37.7486L18.1906 39.5961L14.2666 41.8617H0V0H14.2666L29.6018 8.85374V33.0079L27.7893 34.0543L24.5893 32.2068L26.4018 31.1604Z",fill:"currentColor"}),C.createElement("path",{d:"M138.44 27.684C138.632 27.684 138.797 27.7587 138.936 27.908L140.28 29.38C139.341 30.4893 138.195 31.348 136.84 31.956C135.496 32.564 133.875 32.868 131.976 32.868C130.312 32.868 128.803 32.58 127.448 32.004C126.104 31.428 124.952 30.6227 123.992 29.588C123.043 28.5533 122.307 27.316 121.784 25.876C121.261 24.436 121 22.852 121 21.124C121 19.396 121.272 17.812 121.816 16.372C122.371 14.932 123.144 13.6947 124.136 12.66C125.128 11.6253 126.312 10.82 127.688 10.244C129.075 9.668 130.605 9.38 132.28 9.38C133.912 9.38 135.363 9.64666 136.632 10.18C137.901 10.7133 139.005 11.4227 139.944 12.308L138.824 13.892C138.749 14.0093 138.653 14.1053 138.536 14.18C138.429 14.2547 138.285 14.292 138.104 14.292C137.901 14.292 137.661 14.1907 137.384 13.988C137.117 13.7853 136.76 13.5613 136.312 13.316C135.875 13.06 135.331 12.8307 134.68 12.628C134.029 12.4253 133.219 12.324 132.248 12.324C131.107 12.324 130.061 12.5267 129.112 12.932C128.163 13.3267 127.341 13.9027 126.648 14.66C125.965 15.4067 125.432 16.3293 125.048 17.428C124.675 18.516 124.488 19.748 124.488 21.124C124.488 22.5213 124.685 23.764 125.08 24.852C125.475 25.94 126.019 26.8627 126.712 27.62C127.405 28.3773 128.221 28.9533 129.16 29.348C130.099 29.7427 131.112 29.94 132.2 29.94C132.861 29.94 133.453 29.9027 133.976 29.828C134.509 29.7427 134.995 29.62 135.432 29.46C135.88 29.3 136.301 29.0973 136.696 28.852C137.091 28.596 137.48 28.292 137.864 27.94C137.949 27.8653 138.04 27.8067 138.136 27.764C138.232 27.7107 138.333 27.684 138.44 27.684Z",fill:"currentColor"}),C.createElement("path",{d:"M149.68 16.1C150.875 16.1 151.952 16.2973 152.912 16.692C153.883 17.076 154.704 17.636 155.376 18.372C156.059 19.0973 156.581 19.9773 156.944 21.012C157.307 22.036 157.488 23.188 157.488 24.468C157.488 25.748 157.307 26.9053 156.944 27.94C156.581 28.9747 156.059 29.8547 155.376 30.58C154.704 31.3053 153.883 31.8653 152.912 32.26C151.952 32.644 150.875 32.836 149.68 32.836C148.475 32.836 147.387 32.644 146.416 32.26C145.456 31.8653 144.635 31.3053 143.952 30.58C143.269 29.8547 142.741 28.9747 142.368 27.94C142.005 26.9053 141.824 25.748 141.824 24.468C141.824 23.188 142.005 22.036 142.368 21.012C142.741 19.9773 143.269 19.0973 143.952 18.372C144.635 17.636 145.456 17.076 146.416 16.692C147.387 16.2973 148.475 16.1 149.68 16.1ZM149.68 30.404C151.216 30.404 152.363 29.8867 153.12 28.852C153.877 27.8173 154.256 26.3613 154.256 24.484C154.256 22.6067 153.877 21.1507 153.12 20.116C152.363 19.0707 151.216 18.548 149.68 18.548C148.123 18.548 146.96 19.0707 146.192 20.116C145.435 21.1507 145.056 22.6067 145.056 24.484C145.056 26.3613 145.435 27.8173 146.192 28.852C146.96 29.8867 148.123 30.404 149.68 30.404Z",fill:"currentColor"}),C.createElement("path",{d:"M163.899 18.612C164.251 18.2387 164.619 17.8973 165.003 17.588C165.387 17.2787 165.792 17.0173 166.219 16.804C166.656 16.58 167.12 16.4093 167.611 16.292C168.112 16.164 168.645 16.1 169.211 16.1C170.107 16.1 170.891 16.2493 171.563 16.548C172.245 16.8467 172.816 17.268 173.275 17.812C173.733 18.3453 174.08 18.9907 174.315 19.748C174.549 20.5053 174.667 21.3427 174.667 22.26V32.612H171.531V22.26C171.531 21.0973 171.264 20.196 170.731 19.556C170.197 18.9053 169.381 18.58 168.283 18.58C167.483 18.58 166.731 18.772 166.027 19.156C165.333 19.5293 164.688 20.0413 164.091 20.692V32.612H160.971V16.356H162.843C163.28 16.356 163.552 16.564 163.659 16.98L163.899 18.612Z",fill:"currentColor"}),C.createElement("path",{d:"M181.805 18.612C182.157 18.2387 182.525 17.8973 182.909 17.588C183.293 17.2787 183.698 17.0173 184.125 16.804C184.562 16.58 185.026 16.4093 185.517 16.292C186.018 16.164 186.552 16.1 187.117 16.1C188.013 16.1 188.797 16.2493 189.469 16.548C190.152 16.8467 190.722 17.268 191.181 17.812C191.64 18.3453 191.986 18.9907 192.221 19.748C192.456 20.5053 192.573 21.3427 192.573 22.26V32.612H189.437V22.26C189.437 21.0973 189.17 20.196 188.637 19.556C188.104 18.9053 187.288 18.58 186.189 18.58C185.389 18.58 184.637 18.772 183.933 19.156C183.24 19.5293 182.594 20.0413 181.997 20.692V32.612H178.877V16.356H180.749C181.186 16.356 181.458 16.564 181.565 16.98L181.805 18.612Z",fill:"currentColor"}),C.createElement("path",{d:"M207.551 22.676C207.551 22.0573 207.461 21.4867 207.279 20.964C207.109 20.4413 206.853 19.988 206.511 19.604C206.17 19.22 205.754 18.9213 205.263 18.708C204.773 18.4947 204.207 18.388 203.567 18.388C202.255 18.388 201.221 18.7667 200.463 19.524C199.717 20.2813 199.242 21.332 199.039 22.676H207.551ZM210.127 30.292C209.743 30.74 209.301 31.1293 208.799 31.46C208.298 31.78 207.765 32.0413 207.199 32.244C206.634 32.4467 206.047 32.596 205.439 32.692C204.842 32.788 204.25 32.836 203.663 32.836C202.543 32.836 201.503 32.6493 200.543 32.276C199.594 31.892 198.767 31.3373 198.063 30.612C197.37 29.876 196.826 28.9693 196.431 27.892C196.047 26.804 195.855 25.556 195.855 24.148C195.855 23.0173 196.031 21.9667 196.383 20.996C196.735 20.0147 197.237 19.1613 197.887 18.436C198.549 17.7107 199.354 17.14 200.303 16.724C201.253 16.308 202.319 16.1 203.503 16.1C204.495 16.1 205.407 16.2653 206.239 16.596C207.082 16.916 207.807 17.3853 208.415 18.004C209.023 18.6227 209.498 19.3853 209.839 20.292C210.191 21.1987 210.367 22.2333 210.367 23.396C210.367 23.876 210.314 24.2013 210.207 24.372C210.101 24.532 209.903 24.612 209.615 24.612H198.959C198.991 25.5827 199.13 26.4307 199.375 27.156C199.621 27.8707 199.957 28.468 200.383 28.948C200.821 29.428 201.338 29.7853 201.935 30.02C202.533 30.2547 203.199 30.372 203.935 30.372C204.629 30.372 205.226 30.292 205.727 30.132C206.239 29.972 206.677 29.8013 207.039 29.62C207.413 29.428 207.722 29.252 207.967 29.092C208.223 28.932 208.447 28.852 208.639 28.852C208.895 28.852 209.093 28.948 209.231 29.14L210.127 30.292Z",fill:"currentColor"}),C.createElement("path",{d:"M225.113 19.396C225.017 19.5133 224.921 19.6093 224.825 19.684C224.739 19.748 224.611 19.78 224.441 19.78C224.27 19.78 224.089 19.716 223.897 19.588C223.715 19.4493 223.481 19.3053 223.193 19.156C222.915 18.996 222.574 18.852 222.169 18.724C221.774 18.5853 221.283 18.516 220.697 18.516C219.929 18.516 219.251 18.6547 218.665 18.932C218.078 19.2093 217.587 19.604 217.193 20.116C216.809 20.628 216.515 21.252 216.313 21.988C216.11 22.724 216.009 23.5507 216.009 24.468C216.009 25.4173 216.115 26.2653 216.329 27.012C216.542 27.748 216.846 28.372 217.241 28.884C217.635 29.3853 218.115 29.7693 218.681 30.036C219.246 30.292 219.875 30.42 220.569 30.42C221.241 30.42 221.795 30.34 222.233 30.18C222.67 30.0093 223.033 29.828 223.321 29.636C223.609 29.444 223.849 29.268 224.041 29.108C224.233 28.9373 224.43 28.852 224.633 28.852C224.889 28.852 225.086 28.948 225.225 29.14L226.121 30.292C225.747 30.7507 225.326 31.14 224.857 31.46C224.398 31.78 223.907 32.0413 223.385 32.244C222.862 32.4467 222.313 32.596 221.737 32.692C221.171 32.788 220.595 32.836 220.009 32.836C218.995 32.836 218.046 32.6493 217.161 32.276C216.286 31.9027 215.523 31.3587 214.873 30.644C214.233 29.9293 213.726 29.0547 213.353 28.02C212.979 26.9747 212.793 25.7907 212.793 24.468C212.793 23.2627 212.958 22.148 213.289 21.124C213.63 20.1 214.126 19.22 214.777 18.484C215.438 17.7373 216.249 17.156 217.209 16.74C218.169 16.3133 219.267 16.1 220.505 16.1C221.667 16.1 222.691 16.2867 223.577 16.66C224.462 17.0333 225.251 17.5613 225.945 18.244L225.113 19.396Z",fill:"currentColor"}),C.createElement("path",{d:"M234.121 32.868C232.809 32.868 231.796 32.5 231.081 31.764C230.377 31.028 230.025 29.9773 230.025 28.612V18.884H228.137C227.956 18.884 227.801 18.8307 227.673 18.724C227.556 18.6067 227.497 18.436 227.497 18.212V16.948L230.137 16.58L230.841 11.732C230.884 11.5507 230.964 11.412 231.081 11.316C231.209 11.2093 231.369 11.156 231.561 11.156H233.145V16.612H237.753V18.884H233.145V28.404C233.145 29.044 233.3 29.524 233.609 29.844C233.929 30.1533 234.335 30.308 234.825 30.308C235.113 30.308 235.359 30.2707 235.561 30.196C235.775 30.1213 235.956 30.0413 236.105 29.956C236.255 29.86 236.383 29.7747 236.489 29.7C236.596 29.6253 236.692 29.588 236.777 29.588C236.884 29.588 236.964 29.6147 237.017 29.668C237.081 29.7107 237.145 29.7853 237.209 29.892L238.137 31.396C237.625 31.8653 237.017 32.228 236.313 32.484C235.609 32.74 234.879 32.868 234.121 32.868Z",fill:"currentColor"}),C.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8154 33.2842V9H70.6597C73.9281 9.22427 76.4828 11.9486 76.4828 15.2433V27.026C76.4828 30.4823 73.6809 33.2842 70.2246 33.2842H57.8154ZM84.5586 9H81.2237V33.3211H84.5586V9ZM61.1503 29.9493V12.32H70.2246C71.8391 12.32 73.1479 13.6288 73.1479 15.2433V27.026C73.1479 28.6405 71.8391 29.9493 70.2246 29.9493H61.1503ZM89.2432 9V33.2842H101.652C105.109 33.2842 107.911 30.4823 107.911 27.026V15.2433C107.911 11.9486 105.356 9.22427 102.087 9H89.2432ZM112.155 14.6355H115.883V18.3639H112.155V14.6355ZM115.883 23.9572H112.155V27.6856H115.883V23.9572ZM92.5781 12.32V29.9493H101.652C103.267 29.9493 104.576 28.6405 104.576 27.026V15.2433C104.576 13.6288 103.267 12.32 101.652 12.32H92.5781Z",fill:"currentColor"}));function a({children:e=null,...r}){return t.jsxs(n,{color:"did",variant:"contained",...r,children:[t.jsx(l,{sx:{fontWeight:400},children:e||"Continue With"}),t.jsx(i,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}a.propTypes={children:o.any};export{a};