@abtnode/blocklet-services 1.16.32-beta-0593a408 → 1.16.32-beta-5463e017

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 (181) hide show
  1. package/api/services/auth/connect/update-kyc.js +11 -3
  2. package/dist/assets/{Add-BXK5RFEZ.js → Add-DPWETbuH.js} +1 -1
  3. package/dist/assets/{Alert-CeGhMuEg.js → Alert-DDr4PUmN.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-JIsmOdUp.js → ArrowDropDown-BCZ8iqaM.js} +1 -1
  5. package/dist/assets/{Avatar-DlL4WPrD.js → Avatar-Der2Q3Zi.js} +1 -1
  6. package/dist/assets/{ButtonGroup-ailEu1Nr.js → ButtonGroup-zMm3edlK.js} +1 -1
  7. package/dist/assets/{CheckCircle-CEIChsEH.js → CheckCircle-BfztTFob.js} +1 -1
  8. package/dist/assets/{ChevronLeft-D_bQ82yy.js → ChevronLeft-CrTHRIqK.js} +1 -1
  9. package/dist/assets/{ChevronRight-BGd4BknI.js → ChevronRight-CIt5KDbd.js} +1 -1
  10. package/dist/assets/{Close-uLBCA-jx.js → Close-CgA7Qef8.js} +1 -1
  11. package/dist/assets/{CloseOutlined-IVnREWlC.js → CloseOutlined-OBzuC30j.js} +1 -1
  12. package/dist/assets/{Delete-BVwa0m1R.js → Delete-DVYTl7-n.js} +1 -1
  13. package/dist/assets/{DeleteOutline-CZQhsml4.js → DeleteOutline-DKoxIRL9.js} +1 -1
  14. package/dist/assets/{DialogContentText-ClisAi23.js → DialogContentText-BnQAOkxN.js} +1 -1
  15. package/dist/assets/{Done-Dsagjn-5.js → Done-D1_3yhtX.js} +1 -1
  16. package/dist/assets/{Download-BONj8GVi.js → Download-CvngcFRX.js} +1 -1
  17. package/dist/assets/{Edit-uwWLILxD.js → Edit-DQ3aLTS3.js} +1 -1
  18. package/dist/assets/{EditIcon-Ccz9ZvCO.js → EditIcon-C5DCIJQ3.js} +1 -1
  19. package/dist/assets/{Error-Cpv-DWNH.js → Error-DOhq8cCM.js} +1 -1
  20. package/dist/assets/{ExpandMore-DUJJgQvW.js → ExpandMore-BgcTT2Bb.js} +1 -1
  21. package/dist/assets/{FormControl-DFtCJG5u.js → FormControl-D00yHDcj.js} +1 -1
  22. package/dist/assets/{FormControlLabel-DXsQRQXS.js → FormControlLabel-BJXWJJky.js} +1 -1
  23. package/dist/assets/{FormGroup-BYqGm4p-.js → FormGroup-CBgybl1l.js} +1 -1
  24. package/dist/assets/{Google-_v-FGHrH.js → Google-Be2TlnTX.js} +1 -1
  25. package/dist/assets/{Hidden-qI_JwCnJ.js → Hidden-Bg6BPxEd.js} +1 -1
  26. package/dist/assets/{InfoOutlined-ph3gfjxo.js → InfoOutlined-BxTwuqiu.js} +1 -1
  27. package/dist/assets/{InputAdornment-ooDD0p7-.js → InputAdornment-BGOXKboF.js} +1 -1
  28. package/dist/assets/{InputLabel-BvnZs665.js → InputLabel-BaHBEVm2.js} +1 -1
  29. package/dist/assets/{LastPage-Cyi1MuLL.js → LastPage-DyrTuTrl.js} +1 -1
  30. package/dist/assets/{Launch-DuItzynA.js → Launch-CNWKbDVj.js} +1 -1
  31. package/dist/assets/{LaunchOutlined-D-2u70Um.js → LaunchOutlined-BuQ3n0Nq.js} +1 -1
  32. package/dist/assets/{Link-Bi0x7esG.js → Link-CiVKLn7B.js} +1 -1
  33. package/dist/assets/{ListItemText-5Rgq6wEi.js → ListItemText-BW_owdy0.js} +1 -1
  34. package/dist/assets/{LoadingButton-D5Z3wmwU.js → LoadingButton-AM-IIW_5.js} +1 -1
  35. package/dist/assets/{LockIcon-m3nszp09.js → LockIcon-0vWjHODV.js} +1 -1
  36. package/dist/assets/{Loop-DxSgdtYO.js → Loop-C8sLBH67.js} +1 -1
  37. package/dist/assets/{MoreHoriz-BhT61kh5.js → MoreHoriz-i1hLrklo.js} +1 -1
  38. package/dist/assets/{MoreVert-BZrKRQjN.js → MoreVert-D_g6Th6c.js} +1 -1
  39. package/dist/assets/{OpenInNew-BmjNdWrg.js → OpenInNew-DBNjDxil.js} +1 -1
  40. package/dist/assets/{Pagination-BuAgd0Fq.js → Pagination-DLYy7jWI.js} +1 -1
  41. package/dist/assets/{PlayArrow-duerFb9i.js → PlayArrow-ywjbMR8A.js} +1 -1
  42. package/dist/assets/{QuestionMarkCircle-e6Dqgeid.js → QuestionMarkCircle-UZOXHzIe.js} +1 -1
  43. package/dist/assets/{RadioGroup-hK79XBIl.js → RadioGroup-BOq5mI1A.js} +1 -1
  44. package/dist/assets/{Search-BMPJQuLV.js → Search-Cm2FDsnl.js} +1 -1
  45. package/dist/assets/{Select-BeArBHJP.js → Select-_ZzhxUOz.js} +1 -1
  46. package/dist/assets/{ServerLogo-BNlEHeUQ.js → ServerLogo-DeFJVAh8.js} +1 -1
  47. package/dist/assets/{Skeleton-D5U61zVB.js → Skeleton-D6pzHOGJ.js} +1 -1
  48. package/dist/assets/{Slider-DTLSNhz0.js → Slider-ZYL8jZ1U.js} +1 -1
  49. package/dist/assets/{Stack-CZh-rd3Z.js → Stack-DuNNAX-1.js} +1 -1
  50. package/dist/assets/{Stepper-DRS0AaL5.js → Stepper-DJcNoyk4.js} +1 -1
  51. package/dist/assets/{TextField-qwbmqJ_2.js → TextField-DvTYZ6EA.js} +1 -1
  52. package/dist/assets/{Toolbar-vbF-NV4R.js → Toolbar-DbekG5v-.js} +1 -1
  53. package/dist/assets/{ViewColumn-C39IjII_.js → ViewColumn-BOqfI3PF.js} +1 -1
  54. package/dist/assets/{ViewList-D9Rx7CG7.js → ViewList-DloAt_wk.js} +1 -1
  55. package/dist/assets/{access-control-CZ2vCfvl.js → access-control-Coh2AROp.js} +1 -1
  56. package/dist/assets/{actions-bp0tIFPr.js → actions-DU4pTpmF.js} +1 -1
  57. package/dist/assets/{add-component-core-C1Hjv9Mu.js → add-component-core-DT8eSr6D.js} +1 -1
  58. package/dist/assets/{add-resource-ClftlsDn.js → add-resource-CSMNGPH3.js} +1 -1
  59. package/dist/assets/{addon-CR-5t9SG.js → addon-DImOcoyp.js} +1 -1
  60. package/dist/assets/{analytics-DtV5hN-G.js → analytics-CdJi4q2Q.js} +1 -1
  61. package/dist/assets/api-DUETbHv8.js +1 -0
  62. package/dist/assets/{audit-logs-CLta2fsb.js → audit-logs-Bf2mKt3i.js} +1 -1
  63. package/dist/assets/{button-C_Ohwi26.js → button-LdgYe-Yo.js} +1 -1
  64. package/dist/assets/{click-to-copy-DdG-v5Xf.js → click-to-copy-GLcS-PQh.js} +1 -1
  65. package/dist/assets/{complete-d1ZMK4NF.js → complete-d1PDQlj9.js} +1 -1
  66. package/dist/assets/{component-C3cEDupm.js → component-Ny_sGfYr.js} +1 -1
  67. package/dist/assets/{config-CoCmaQP0.js → config-CFU2n19a.js} +1 -1
  68. package/dist/assets/{config-Dx0nfjiu.js → config-CpPqNxWJ.js} +1 -1
  69. package/dist/assets/{config-navigation-WnNuhnxu.js → config-navigation-BQEWPLSH.js} +1 -1
  70. package/dist/assets/{confirm-BY-9Ale6.js → confirm-BdJlZzQ-.js} +1 -1
  71. package/dist/assets/{connect-eNCvhZ4O.js → connect-BDR3XUNJ.js} +1 -1
  72. package/dist/assets/{connect-DDUiaDOH.js → connect-ndruP8fv.js} +1 -1
  73. package/dist/assets/{connect-to-CTihUmuN.js → connect-to-D6gkq_5F.js} +1 -1
  74. package/dist/assets/{content-layout-DYHA2DoT.js → content-layout-9pObqqwC.js} +1 -1
  75. package/dist/assets/{dashboard-C8VgUavf.js → dashboard-Clr7sJbb.js} +3 -3
  76. package/dist/assets/{did-address-Bye61gv9.js → did-address-DNmiCCjI.js} +1 -1
  77. package/dist/assets/{domain-JYDawt5A.js → domain-BM3Ias2K.js} +1 -1
  78. package/dist/assets/{domain-list-1LRFMuDN.js → domain-list-BdKqoNlW.js} +1 -1
  79. package/dist/assets/{email-THIe3MUl.js → email-03xGEqer.js} +3 -3
  80. package/dist/assets/{exchange-passport-CvhlZqQF.js → exchange-passport-BwiQ670F.js} +1 -1
  81. package/dist/assets/{fallback-0bWgPkSN.js → fallback-BLJkxLTK.js} +1 -1
  82. package/dist/assets/{format-error-BOfFwKPG.js → format-error-C43xGCjC.js} +1 -1
  83. package/dist/assets/{fuel-CfBzTTU6.js → fuel-C7otG6Kf.js} +1 -1
  84. package/dist/assets/{fullpage-ChxIZLoV.js → fullpage-C4Et_NyD.js} +1 -1
  85. package/dist/assets/{home-DNnK3U-z.js → home-CZCCRVbe.js} +1 -1
  86. package/dist/assets/{iframe-BuZAORHf.js → iframe-CPKiwkND.js} +1 -1
  87. package/dist/assets/{index-Dn3O_6kH.js → index-AgTn3eU4.js} +1 -1
  88. package/dist/assets/{index-BmJ_HmLz.js → index-B3ThwVSS.js} +1 -1
  89. package/dist/assets/{index-DnNh-evc.js → index-BCMjvLku.js} +1 -1
  90. package/dist/assets/{index-DMGDz3J5.js → index-BK9kuqs5.js} +1 -1
  91. package/dist/assets/{index-BVQpPnuL.js → index-BRnCFYx3.js} +1 -1
  92. package/dist/assets/{index--Zmo4lNz.js → index-BWVDn9BP.js} +1 -1
  93. package/dist/assets/{index-fpoxcuML.js → index-BaC4EhQh.js} +20 -20
  94. package/dist/assets/{index-C2qWDMpv.js → index-Bc3FFnWG.js} +1 -1
  95. package/dist/assets/{index-B-Fz2GNJ.js → index-BlvJrvQX.js} +1 -1
  96. package/dist/assets/{index-Be2wLDD2.js → index-BrFlqDrV.js} +1 -1
  97. package/dist/assets/{index-BML-rKDv.js → index-BzY4clAs.js} +1 -1
  98. package/dist/assets/{index-CMg55b21.js → index-CD6yQnY4.js} +1 -1
  99. package/dist/assets/{index-BmTem0RD.js → index-CFpdZL6w.js} +1 -1
  100. package/dist/assets/{index-CeNlYeEB.js → index-CH2n2mOS.js} +1 -1
  101. package/dist/assets/{index-D0TT-qXy.js → index-CT70Tuv9.js} +1 -1
  102. package/dist/assets/{index-BlaHh4Bq.js → index-CTil0VJz.js} +1 -1
  103. package/dist/assets/{index-Dg3ZdGFC.js → index-CWjTgh2V.js} +1 -1
  104. package/dist/assets/{index-CmriykVM.js → index-CbBjirNE.js} +1 -1
  105. package/dist/assets/{index-CsqAQtnh.js → index-Cfnr_7cH.js} +4 -4
  106. package/dist/assets/{index-BqbUZVee.js → index-ChWrF7R7.js} +1 -1
  107. package/dist/assets/{index--PkoOt7s.js → index-CzxDEhmG.js} +1 -1
  108. package/dist/assets/{index-D3wlHMtS.js → index-D9e3uQkW.js} +1 -1
  109. package/dist/assets/{index-C5cJ2AYH.js → index-DPXmNWqb.js} +1 -1
  110. package/dist/assets/{index-DyEaiz-D.js → index-DR40cJFL.js} +3 -3
  111. package/dist/assets/{index-BElhBMsQ.js → index-DiOkeCOc.js} +1 -1
  112. package/dist/assets/{index-DCyB2kx5.js → index-Dp6zROo4.js} +1 -1
  113. package/dist/assets/{index-C0fRQdXZ.js → index-Ez2y1Lea.js} +1 -1
  114. package/dist/assets/{index-CuDHF3xN.js → index-TwQfcdR0.js} +1 -1
  115. package/dist/assets/{index-DCx94jgM.js → index-hkkOggLS.js} +1 -1
  116. package/dist/assets/{index-52sgx-HD.js → index-lVfYf5Oq.js} +1 -1
  117. package/dist/assets/{index-BM94YLjm.js → index-s95vTNww.js} +1 -1
  118. package/dist/assets/{index.es-BXRXZClL.js → index.es-CkGqU4MQ.js} +1 -1
  119. package/dist/assets/{index.esm-BPFo6X8Z.js → index.esm-8yCk0S5h.js} +1 -1
  120. package/dist/assets/{invitation-D1Wp3bRP.js → invitation-DAGy7I2M.js} +1 -1
  121. package/dist/assets/{invite-YMYQJqN-.js → invite-06pBNgrg.js} +1 -1
  122. package/dist/assets/{issue-passport-BGReKwsC.js → issue-passport-CbtgsLgQ.js} +1 -1
  123. package/dist/assets/{item-BXQ3arsv.js → item-B0XIEv1j.js} +1 -1
  124. package/dist/assets/{jss-plugin-props-sort.esm-C9YatkDP.js → jss-plugin-props-sort.esm-D4wv_NcC.js} +1 -1
  125. package/dist/assets/{launch-result-message-BerDxO98.js → launch-result-message-BGkFHBr0.js} +1 -1
  126. package/dist/assets/{layout-D4J5Y79b.js → layout-C1fJ0PwQ.js} +1 -1
  127. package/dist/assets/{list-header-Be3w9ZWF.js → list-header-D2TsmXsU.js} +1 -1
  128. package/dist/assets/localization-IrbI0TJr.js +1 -0
  129. package/dist/assets/{log-CQOOprUt.js → log-Bx1CDJfR.js} +1 -1
  130. package/dist/assets/{login-BE50q_9g.js → login-Ci8kprd2.js} +1 -1
  131. package/dist/assets/{login-oauth-callback-BPCfA25m.js → login-oauth-callback-OcVe-Pko.js} +1 -1
  132. package/dist/assets/{logo-uploader-BQq1Bvz4.js → logo-uploader-DPtvNrwp.js} +3 -3
  133. package/dist/assets/{lost-passport-CqiiJzdw.js → lost-passport-DQYzD5oM.js} +3 -3
  134. package/dist/assets/{lottie-8CewroZu.js → lottie-Dtcij0yx.js} +1 -1
  135. package/dist/assets/{notifications-hFiNE8Kp.js → notifications-u_yxMKF9.js} +1 -1
  136. package/dist/assets/{open-window-DZuQsoOo.js → open-window-Ca8SnnJR.js} +1 -1
  137. package/dist/assets/{overview-eXanKabi.js → overview-hyt-Fv0L.js} +1 -1
  138. package/dist/assets/{page-header-D6emPvgS.js → page-header-DZBo2jY4.js} +1 -1
  139. package/dist/assets/{permission-CV9At0xV.js → permission-DDD12SuE.js} +1 -1
  140. package/dist/assets/{preferences-GIta-dYt.js → preferences-BzxjYd2D.js} +1 -1
  141. package/dist/assets/publish-resource-BL3ifBGp.js +1 -0
  142. package/dist/assets/{react-BnX7dsCg.js → react-iXxw1Yhu.js} +3 -3
  143. package/dist/assets/{redux-B4e5IkPl.js → redux-Bma4eNss.js} +1 -1
  144. package/dist/assets/{resource-dialog-DSlBHCVu.js → resource-dialog-DhmviK8K.js} +1 -1
  145. package/dist/assets/sdk-B37oViy1.js +1 -0
  146. package/dist/assets/{selector-fvBTD9SB.js → selector-B8IAFODK.js} +1 -1
  147. package/dist/assets/session-D3mS3Gz5.js +1 -0
  148. package/dist/assets/{setup-p-Q92t4g.js → setup-TXTEwwLA.js} +3 -3
  149. package/dist/assets/{shorten-label-BOSkgF_N.js → shorten-label-DWH-tsmz.js} +1 -1
  150. package/dist/assets/{slicedToArray-CbPRhqfX.js → slicedToArray-Doa8i3Sy.js} +1 -1
  151. package/dist/assets/{spaces-Dv5sTFBl.js → spaces-DPfrZKXe.js} +1 -1
  152. package/dist/assets/{start-D4PsKATv.js → start-DwEZv43D.js} +1 -1
  153. package/dist/assets/{step-actions-DvJ3jG2s.js → step-actions-B1vsf_QO.js} +1 -1
  154. package/dist/assets/{studio-kDlNaA-v.js → studio-CTK5QQPt.js} +1 -1
  155. package/dist/assets/{switch-control-CCflGHVj.js → switch-control-DJhTvGtn.js} +1 -1
  156. package/dist/assets/{toUpper-DxMwQ-7A.js → toUpper-Bff1Q0mA.js} +1 -1
  157. package/dist/assets/{transfer-Cdc4gT4M.js → transfer-IRhzEeuE.js} +1 -1
  158. package/dist/assets/{uniqBy-C7E-hw0R.js → uniqBy-DIeGY4K_.js} +1 -1
  159. package/dist/assets/{unsubscribe-CZRtq6xH.js → unsubscribe-CwygyLJZ.js} +1 -1
  160. package/dist/assets/{url-join-Cc5BAZ2e.js → url-join-D5TK65dM.js} +1 -1
  161. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-Dro42um_.js → use-blocklet-info-for-connect-did-spaces-DaNxIRBj.js} +1 -1
  162. package/dist/assets/{use-mobile-BziK5djw.js → use-mobile-BA_cO1yG.js} +1 -1
  163. package/dist/assets/{useAsync-fA1HnQaq.js → useAsync-Bl2lmnoD.js} +1 -1
  164. package/dist/assets/{useFormControl-CQ_7pr9i.js → useFormControl-CAWQrhew.js} +1 -1
  165. package/dist/assets/{useLocalStorage-CpPhACy5.js → useLocalStorage-DkK4fk62.js} +1 -1
  166. package/dist/assets/{useSetState-5snwvlLZ.js → useSetState-OuMAH4bG.js} +1 -1
  167. package/dist/assets/{useSlot-GRhp-924.js → useSlot-nO86v-Bn.js} +1 -1
  168. package/dist/assets/{useSlotProps-CPXTP7XP.js → useSlotProps-B8lkbwkT.js} +1 -1
  169. package/dist/assets/{useThemeProps-BnBMhVDF.js → useThemeProps-CIT7yB5m.js} +1 -1
  170. package/dist/assets/{user-center-CuPwYsI_.js → user-center-BEb-hcxI.js} +1 -1
  171. package/dist/assets/{user-sessions-lG0a9kqK.js → user-sessions-D_s7CT2k.js} +1 -1
  172. package/dist/assets/{util-BBmowc-s.js → util-znUxW1sG.js} +1 -1
  173. package/dist/assets/{wrap-locale-D-ibzwQK.js → wrap-locale-BjkpLOO0.js} +1 -1
  174. package/dist/index.html +1 -1
  175. package/dist/service-worker.js +1 -1
  176. package/package.json +25 -25
  177. package/dist/assets/api-BdPs8cnO.js +0 -1
  178. package/dist/assets/localization-C6Hais-M.js +0 -1
  179. package/dist/assets/publish-resource-E3qK4Lfb.js +0 -1
  180. package/dist/assets/sdk-C5Eo3Lk8.js +0 -1
  181. package/dist/assets/session-BHe45BP1.js +0 -1
@@ -1 +1 @@
1
- import{r as a,a0 as e,j as t,R as n,Z as o}from"./index-fpoxcuML.js";function p(){const{t:s}=a.useContext(e);return t.jsx(r,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const r=o.main``;export{p as default};
1
+ import{r as a,a0 as e,j as t,R as n,Z as o}from"./index-BaC4EhQh.js";function p(){const{t:s}=a.useContext(e);return t.jsx(r,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:s("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const r=o.main``;export{p as default};
@@ -1 +1 @@
1
- import{b7 as a}from"./index-fpoxcuML.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
1
+ import{b7 as a}from"./index-BaC4EhQh.js";var e=i,s=/^(?:\w+:)?\/\/(\S+)$/,l=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,n=/^[^\s\.]+\.\S{2,}$/;function i(t){if(typeof t!="string")return!1;var o=t.match(s);if(!o)return!1;var r=o[1];return r?!!(l.test(r)||n.test(r)):!1}const c=a(e);export{c as i};
@@ -1,4 +1,4 @@
1
- import{r as $,bX as Q,dr as Z,j as o,bF as O,ds as z,P as n,dt as ee,du as U,bt as b,bE as B,u as _,dv as q,B as y,aM as C,aj as oe,I as W}from"./index-fpoxcuML.js";import{E as D}from"./fallback-0bWgPkSN.js";import{R as ne,N as te}from"./index-BElhBMsQ.js";import{i as re,u as ie,f as G,g as I,p as ae,m as K,a as se,b as le,H as ce,B as de}from"./index-DnNh-evc.js";import{d as pe}from"./ExpandMore-DUJJgQvW.js";import{A as S}from"./Avatar-DlL4WPrD.js";function T({icon:e,size:t,sx:r,...a}){const i=[...Array.isArray(r)?r:[r]];t&&i.push({width:t,height:t});const[u,s]=$.useState(!1),[c,l]=$.useState(!0);if(Q(async()=>{l(!0);try{await Z(e),s(!0)}catch{s(!1)}l(!1)},[e]),a.variant||i.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),re(e))return o.jsx(S,{component:"span",...a,src:e,sx:i});const d=t?.6*t+4:0;return c?o.jsx(O,{icon:"codicon:blank",height:d||void 0}):u?o.jsx(S,{component:"span",...a,sx:i,children:o.jsx(O,{icon:e,height:d||void 0})}):e&&typeof e=="string"?(i.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),o.jsx(S,{component:"span",...a,sx:i,children:Array.from(e)[0]})):null}const ue=z();function M({theme:e,children:t}){const r=e?z(e):ue;return o.jsx(ee,{theme:r,children:t})}M.propTypes={children:n.any.isRequired,theme:n.object};M.defaultProps={theme:null};const fe=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const a=K(e,s=>{var d,p;const c=s.icon?o.jsx(T,{icon:s.icon}):null;if(s.items)return{id:`${t++}`,label:s.title,icon:c,children:s.items};let l={};return((d=s.link)!=null&&d.startsWith("http://")||(p=s.link)!=null&&p.startsWith("https://"))&&(l={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:o.jsx("a",{href:s.link,...l,children:s.title}),icon:c,link:s.link}},"items"),i=se(a),u=le(i.map(s=>s.link));return{navItems:a,activeId:u>=0?i[u].id:null}};function he({meta:e={},addons:t,sessionManagerProps:r={showRole:!0},homeLink:a=ae,theme:i,hideNavMenu:u=!1,...s}){var h,N;ie();const{locale:c}=_()||{},l=$.useMemo(()=>{const w=Object.assign({},window.blocklet,e);try{return G(w)}catch(J){return console.error("Failed to format blocklet info",J,w),w}},[e]);if(!l.appName)return null;const{appLogo:d,appLogoRect:p,theme:m}=l,f=I((h=l==null?void 0:l.navigation)==null?void 0:h.header,c),k=fe(f),{navItems:g,activeId:v}=k,j=typeof t=="function"?w=>t(w,{navigation:k}):t,x=o.jsx(ce,{formattedBlocklet:l,addons:j,sessionManagerProps:r});return o.jsx(M,{theme:i,children:o.jsx(me,{homeLink:a,logo:o.jsx("img",{src:p||d,alt:"logo"}),addons:x,...q(s,["bordered"]),$bordered:s==null?void 0:s.bordered,$bgcolor:(N=m==null?void 0:m.background)==null?void 0:N.header,children:u||!(g!=null&&g.length)?null:({isMobile:w})=>o.jsx(te,{mode:w?"inline":"horizontal",activeId:v,items:g,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}const me=b(ne)`
1
+ import{r as $,bX as Q,dr as Z,j as o,bF as O,ds as z,P as n,dt as ee,du as U,bt as b,bE as B,u as _,dv as q,B as y,aM as C,aj as oe,I as W}from"./index-BaC4EhQh.js";import{E as D}from"./fallback-BLJkxLTK.js";import{R as ne,N as te}from"./index-DiOkeCOc.js";import{i as re,u as ie,f as G,g as I,p as ae,m as K,a as se,b as le,H as ce,B as de}from"./index-BCMjvLku.js";import{d as pe}from"./ExpandMore-BgcTT2Bb.js";import{A as S}from"./Avatar-Der2Q3Zi.js";function T({icon:e,size:t,sx:r,...a}){const i=[...Array.isArray(r)?r:[r]];t&&i.push({width:t,height:t});const[u,s]=$.useState(!1),[c,l]=$.useState(!0);if(Q(async()=>{l(!0);try{await Z(e),s(!0)}catch{s(!1)}l(!1)},[e]),a.variant||i.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),re(e))return o.jsx(S,{component:"span",...a,src:e,sx:i});const d=t?.6*t+4:0;return c?o.jsx(O,{icon:"codicon:blank",height:d||void 0}):u?o.jsx(S,{component:"span",...a,sx:i,children:o.jsx(O,{icon:e,height:d||void 0})}):e&&typeof e=="string"?(i.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),o.jsx(S,{component:"span",...a,sx:i,children:Array.from(e)[0]})):null}const ue=z();function M({theme:e,children:t}){const r=e?z(e):ue;return o.jsx(ee,{theme:r,children:t})}M.propTypes={children:n.any.isRequired,theme:n.object};M.defaultProps={theme:null};const fe=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const a=K(e,s=>{var d,p;const c=s.icon?o.jsx(T,{icon:s.icon}):null;if(s.items)return{id:`${t++}`,label:s.title,icon:c,children:s.items};let l={};return((d=s.link)!=null&&d.startsWith("http://")||(p=s.link)!=null&&p.startsWith("https://"))&&(l={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:o.jsx("a",{href:s.link,...l,children:s.title}),icon:c,link:s.link}},"items"),i=se(a),u=le(i.map(s=>s.link));return{navItems:a,activeId:u>=0?i[u].id:null}};function he({meta:e={},addons:t,sessionManagerProps:r={showRole:!0},homeLink:a=ae,theme:i,hideNavMenu:u=!1,...s}){var h,N;ie();const{locale:c}=_()||{},l=$.useMemo(()=>{const w=Object.assign({},window.blocklet,e);try{return G(w)}catch(J){return console.error("Failed to format blocklet info",J,w),w}},[e]);if(!l.appName)return null;const{appLogo:d,appLogoRect:p,theme:m}=l,f=I((h=l==null?void 0:l.navigation)==null?void 0:h.header,c),k=fe(f),{navItems:g,activeId:v}=k,j=typeof t=="function"?w=>t(w,{navigation:k}):t,x=o.jsx(ce,{formattedBlocklet:l,addons:j,sessionManagerProps:r});return o.jsx(M,{theme:i,children:o.jsx(me,{homeLink:a,logo:o.jsx("img",{src:p||d,alt:"logo"}),addons:x,...q(s,["bordered"]),$bordered:s==null?void 0:s.bordered,$bgcolor:(N=m==null?void 0:m.background)==null?void 0:N.header,children:u||!(g!=null&&g.length)?null:({isMobile:w})=>o.jsx(te,{mode:w?"inline":"horizontal",activeId:v,items:g,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}const me=b(ne)`
2
2
  ${({$bgcolor:e})=>`background-color: ${e||"#fff"};`}
3
3
  font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
4
4
  'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
@@ -1 +1 @@
1
- import{gD as V,r as L,gE as W,V as R,eJ as z,gF as K,gG as J,U as G,by as N}from"./index-fpoxcuML.js";var P=function(r,a){return r===void 0&&(r=[]),a===void 0&&(a=[]),V(r,a)},S=function(r,a,n){var e=L.useRef(),i=L.useRef(0);P(a,e.current)||(i.current+=1),e.current=a,W(r,[i.current],n)},U=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),j={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:U?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},x={ctrl:function(r){return r.ctrlKey},shift:function(r){return r.shiftKey},alt:function(r){return r.altKey},meta:function(r){return r.type==="keyup"?j.meta.includes(r.keyCode):r.metaKey}};function B(r){return J(r)||G(r)}function I(r){var a=Object.keys(x).reduce(function(n,e){return x[e](r)?n+1:n},0);return[16,17,18,91,92].includes(r.keyCode)?a:a+1}function T(r,a,n){var e,i;if(!r.key)return!1;if(G(a))return r.keyCode===a?a:!1;var o=a.split("."),s=0;try{for(var l=K(o),c=l.next();!c.done;c=l.next()){var p=c.value,y=x[p],m=j[p.toLowerCase()];(y&&y(r)||m&&m===r.keyCode)&&s++}}catch(b){e={error:b}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(e)throw e.error}}return n?s===o.length&&I(r)===o.length?a:!1:s===o.length?a:!1}function Q(r,a){return N(r)?r:B(r)?function(n){return T(n,r,a)}:Array.isArray(r)?function(n){return r.find(function(e){return T(n,e,a)})}:function(){return!!r}}var X=["keydown"];function Z(r,a,n){var e=n||{},i=e.events,o=i===void 0?X:i,s=e.target,l=e.exactMatch,c=l===void 0?!1:l,p=e.useCapture,y=p===void 0?!1:p,m=R(a),b=R(r);S(function(){var k,C,E,t=z(s,window);if(t){var q=function(u){var v,h=Q(b.current,c),f=h(u),d=B(f)?f:u.key;if(f)return(v=m.current)===null||v===void 0?void 0:v.call(m,u,d)};try{for(var w=K(o),g=w.next();!g.done;g=w.next()){var H=g.value;(E=t==null?void 0:t.addEventListener)===null||E===void 0||E.call(t,H,q,y)}}catch(u){k={error:u}}finally{try{g&&!g.done&&(C=w.return)&&C.call(w)}finally{if(k)throw k.error}}return function(){var u,v,h;try{for(var f=K(o),d=f.next();!d.done;d=f.next()){var M=d.value;(h=t==null?void 0:t.removeEventListener)===null||h===void 0||h.call(t,M,q,y)}}catch(O){u={error:O}}finally{try{d&&!d.done&&(v=f.return)&&v.call(f)}finally{if(u)throw u.error}}}}},[o],s)}export{Z as u};
1
+ import{gD as V,r as L,gE as W,V as R,eJ as z,gF as K,gG as J,U as G,by as N}from"./index-BaC4EhQh.js";var P=function(r,a){return r===void 0&&(r=[]),a===void 0&&(a=[]),V(r,a)},S=function(r,a,n){var e=L.useRef(),i=L.useRef(0);P(a,e.current)||(i.current+=1),e.current=a,W(r,[i.current],n)},U=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),j={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:U?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},x={ctrl:function(r){return r.ctrlKey},shift:function(r){return r.shiftKey},alt:function(r){return r.altKey},meta:function(r){return r.type==="keyup"?j.meta.includes(r.keyCode):r.metaKey}};function B(r){return J(r)||G(r)}function I(r){var a=Object.keys(x).reduce(function(n,e){return x[e](r)?n+1:n},0);return[16,17,18,91,92].includes(r.keyCode)?a:a+1}function T(r,a,n){var e,i;if(!r.key)return!1;if(G(a))return r.keyCode===a?a:!1;var o=a.split("."),s=0;try{for(var l=K(o),c=l.next();!c.done;c=l.next()){var p=c.value,y=x[p],m=j[p.toLowerCase()];(y&&y(r)||m&&m===r.keyCode)&&s++}}catch(b){e={error:b}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(e)throw e.error}}return n?s===o.length&&I(r)===o.length?a:!1:s===o.length?a:!1}function Q(r,a){return N(r)?r:B(r)?function(n){return T(n,r,a)}:Array.isArray(r)?function(n){return r.find(function(e){return T(n,e,a)})}:function(){return!!r}}var X=["keydown"];function Z(r,a,n){var e=n||{},i=e.events,o=i===void 0?X:i,s=e.target,l=e.exactMatch,c=l===void 0?!1:l,p=e.useCapture,y=p===void 0?!1:p,m=R(a),b=R(r);S(function(){var k,C,E,t=z(s,window);if(t){var q=function(u){var v,h=Q(b.current,c),f=h(u),d=B(f)?f:u.key;if(f)return(v=m.current)===null||v===void 0?void 0:v.call(m,u,d)};try{for(var w=K(o),g=w.next();!g.done;g=w.next()){var H=g.value;(E=t==null?void 0:t.addEventListener)===null||E===void 0||E.call(t,H,q,y)}}catch(u){k={error:u}}finally{try{g&&!g.done&&(C=w.return)&&C.call(w)}finally{if(k)throw k.error}}return function(){var u,v,h;try{for(var f=K(o),d=f.next();!d.done;d=f.next()){var M=d.value;(h=t==null?void 0:t.removeEventListener)===null||h===void 0||h.call(t,M,q,y)}}catch(O){u={error:O}}finally{try{d&&!d.done&&(v=f.return)&&v.call(f)}finally{if(u)throw u.error}}}}},[o],s)}export{Z as u};
@@ -1,4 +1,4 @@
1
- import{j as ee,r as $e,aK as Se,dy as pi,cR as Yb,aJ as Ar,dk as Co,dz as Fl,dA as Jb,dB as Xb,dC as Qb,dD as Ss,dE as Ot,dF as Rt,dG as Qi,dH as Zi,dI as ti,dJ as Zb,dK as Xv,dL as Qv,dM as ew,dN as Zv,dO as eh,cA as tw,cB as rw,cI as aw,dP as nw,ah as th,dQ as ow,dR as iw,dS as sw,dT as lw,dU as uw,aG as _r,dV as cw,dW as dw,dX as fw,dY as pw,cF as vw,dZ as hw,d_ as gw,d$ as mw,e0 as yw,e1 as bw,cG as ww,cH as Sw,aj as rh,ai as $w,e2 as xw,e3 as _w,aC as Ja,e4 as Tw,e5 as Cw,T as Pw,e6 as Ow,e7 as Rw,e8 as Iw,bf as Ew,e9 as Aw,ea as jw,b as Dw,eb as kw,ec as Mw,cY as Lw,cX as Fw,ed as Bw,ee as Nw,bi as ah,ef as Hw,eg as Uw,eh as Ww,ei as zw,aT as $s,ej as Gw,ek as Kw,a as xs,el as Vw,em as qw,aF as Ln,aE as Fn,aI as Bn,aM as Er,aN as Nn,aH as Dn,ce as Yw,ck as _s,cd as Jw,cM as Xw,d2 as jd,cQ as Qw,at as Zw,cJ as eS,cv as tt,cu as lt,en as tS,eo as rS,ep as aS,eq as nS,X as vi,Y as hi,er as oS,b7 as Rc,cr as iS,es as sS,et as nh,eu as lS,ev as uS,ew as cS,ex as dS,P as Qe,bt as jo,bD as fS,aR as pS,b_ as vS,$ as hS,cz as Dd,c1 as gS,cw as mS,n as yS}from"./index-fpoxcuML.js";import{u as bS}from"./useThemeProps-BnBMhVDF.js";import{t as wS}from"./toPropertyKey-PLuKRk1e.js";import{e as SS,r as $S,l as xS}from"./index-BM94YLjm.js";import{c as _S,C as TS,g as CS,F as PS,f as OS,a as RS}from"./FormControlLabel-DXsQRQXS.js";import{R as IS,C as ES,V as AS,d as jS,a as DS}from"./ViewColumn-C39IjII_.js";import{F as kS,f as MS,g as LS}from"./FormControl-DFtCJG5u.js";import{u as FS}from"./useFormControl-CQ_7pr9i.js";import{F as BS,f as NS,g as HS}from"./FormGroup-BYqGm4p-.js";import{G as US,g as WS,a as zS}from"./redux-B4e5IkPl.js";import{I as oh,g as GS,i as KS,a as VS,b as qS,c as YS,S as ih,d as JS,s as XS}from"./Select-BeArBHJP.js";import{I as QS,g as ZS,i as e$}from"./InputLabel-BvnZs665.js";import{a as ac,L as kd}from"./ListItemText-5Rgq6wEi.js";import{T as nc,g as t$,t as r$}from"./TextField-qwbmqJ_2.js";import{K as a$,a as n$}from"./index-DMGDz3J5.js";import{F as o$,L as i$}from"./LastPage-Cyi1MuLL.js";import{T as sh,g as s$,t as l$}from"./Toolbar-vbF-NV4R.js";import{S as u$,d as Md}from"./Search-BMPJQuLV.js";import{D as c$}from"./Delete-BVwa0m1R.js";import{E as Ld}from"./index-BmJ_HmLz.js";import{d as d$}from"./MoreVert-BZrKRQjN.js";const Ic="mode",Ec="color-scheme",lh="data-color-scheme";function f$(e){const{defaultMode:t="light",defaultLightColorScheme:r="light",defaultDarkColorScheme:a="dark",modeStorageKey:n=Ic,colorSchemeStorageKey:i=Ec,attribute:c=lh,colorSchemeNode:v="document.documentElement",nonce:p}=e||{};return ee.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(function() {
1
+ import{j as ee,r as $e,aK as Se,dy as pi,cR as Yb,aJ as Ar,dk as Co,dz as Fl,dA as Jb,dB as Xb,dC as Qb,dD as Ss,dE as Ot,dF as Rt,dG as Qi,dH as Zi,dI as ti,dJ as Zb,dK as Xv,dL as Qv,dM as ew,dN as Zv,dO as eh,cA as tw,cB as rw,cI as aw,dP as nw,ah as th,dQ as ow,dR as iw,dS as sw,dT as lw,dU as uw,aG as _r,dV as cw,dW as dw,dX as fw,dY as pw,cF as vw,dZ as hw,d_ as gw,d$ as mw,e0 as yw,e1 as bw,cG as ww,cH as Sw,aj as rh,ai as $w,e2 as xw,e3 as _w,aC as Ja,e4 as Tw,e5 as Cw,T as Pw,e6 as Ow,e7 as Rw,e8 as Iw,bf as Ew,e9 as Aw,ea as jw,b as Dw,eb as kw,ec as Mw,cY as Lw,cX as Fw,ed as Bw,ee as Nw,bi as ah,ef as Hw,eg as Uw,eh as Ww,ei as zw,aT as $s,ej as Gw,ek as Kw,a as xs,el as Vw,em as qw,aF as Ln,aE as Fn,aI as Bn,aM as Er,aN as Nn,aH as Dn,ce as Yw,ck as _s,cd as Jw,cM as Xw,d2 as jd,cQ as Qw,at as Zw,cJ as eS,cv as tt,cu as lt,en as tS,eo as rS,ep as aS,eq as nS,X as vi,Y as hi,er as oS,b7 as Rc,cr as iS,es as sS,et as nh,eu as lS,ev as uS,ew as cS,ex as dS,P as Qe,bt as jo,bD as fS,aR as pS,b_ as vS,$ as hS,cz as Dd,c1 as gS,cw as mS,n as yS}from"./index-BaC4EhQh.js";import{u as bS}from"./useThemeProps-CIT7yB5m.js";import{t as wS}from"./toPropertyKey-PLuKRk1e.js";import{e as SS,r as $S,l as xS}from"./index-s95vTNww.js";import{c as _S,C as TS,g as CS,F as PS,f as OS,a as RS}from"./FormControlLabel-BJXWJJky.js";import{R as IS,C as ES,V as AS,d as jS,a as DS}from"./ViewColumn-BOqfI3PF.js";import{F as kS,f as MS,g as LS}from"./FormControl-D00yHDcj.js";import{u as FS}from"./useFormControl-CAWQrhew.js";import{F as BS,f as NS,g as HS}from"./FormGroup-CBgybl1l.js";import{G as US,g as WS,a as zS}from"./redux-Bma4eNss.js";import{I as oh,g as GS,i as KS,a as VS,b as qS,c as YS,S as ih,d as JS,s as XS}from"./Select-_ZzhxUOz.js";import{I as QS,g as ZS,i as e$}from"./InputLabel-BaHBEVm2.js";import{a as ac,L as kd}from"./ListItemText-BW_owdy0.js";import{T as nc,g as t$,t as r$}from"./TextField-DvTYZ6EA.js";import{K as a$,a as n$}from"./index-BK9kuqs5.js";import{F as o$,L as i$}from"./LastPage-DyrTuTrl.js";import{T as sh,g as s$,t as l$}from"./Toolbar-DbekG5v-.js";import{S as u$,d as Md}from"./Search-Cm2FDsnl.js";import{D as c$}from"./Delete-DVYTl7-n.js";import{E as Ld}from"./index-B3ThwVSS.js";import{d as d$}from"./MoreVert-D_g6Th6c.js";const Ic="mode",Ec="color-scheme",lh="data-color-scheme";function f$(e){const{defaultMode:t="light",defaultLightColorScheme:r="light",defaultDarkColorScheme:a="dark",modeStorageKey:n=Ic,colorSchemeStorageKey:i=Ec,attribute:c=lh,colorSchemeNode:v="document.documentElement",nonce:p}=e||{};return ee.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(function() {
2
2
  try {
3
3
  var mode = localStorage.getItem('${n}') || '${t}';
4
4
  var colorScheme = '';
@@ -1 +1 @@
1
- import{P as o,r as x,j as e,B as u,bi as K,bA as B,fg as W,a8 as v,aC as R,n as A,d8 as M,Z as $}from"./index-fpoxcuML.js";import{d as G}from"./EditIcon-Ccz9ZvCO.js";import{d as H}from"./Done-Dsagjn-5.js";import{C as U}from"./Google-_v-FGHrH.js";import{T as Y}from"./TextField-qwbmqJ_2.js";import{R as Z,F as J,L as Q}from"./logo-uploader-BQq1Bvz4.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function V({editing:n,value:r,onChange:s}){const[a,l]=x.useState(!1),c=x.useRef(),d=x.useRef(r);x.useEffect(()=>{let p=null;return n&&(p=setTimeout(()=>{l(!0)},50)),()=>{clearTimeout(p)}},[n]);const g=p=>{d.current=p,s(p)},y=()=>{l(!1),s(d.current)},b=e.jsx(u,{className:"form-item-input slot",px:1,children:e.jsxs(u,{display:"flex",alignItems:"center",children:[r,r!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:r,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),i=e.jsxs(u,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:y,children:[e.jsx(u,{display:"flex",alignItems:"center",onClick:()=>l(!0),children:e.jsx("div",{ref:c,style:{flexShrink:0,marginLeft:"8px",backgroundColor:r,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:r==="auto"?"default":"pointer"}})}),e.jsx(K,{open:a,anchorEl:c.current,onClose:()=>l(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(U,{color:r,onChange:p=>g(p.hex)})})]});return n?i:b}V.propTypes=S;function _({editing:n,description:r,value:s,onChange:a,componentProps:l,...c}){const{placeholder:d}=l,g=x.useRef(s),y=i=>{i.key==="Enter"&&a(g.current,"confirm")},b=i=>{g.current=i,a(i)};return n?e.jsx(Y,{style:{flex:1},fullWidth:!0,value:s,onChange:i=>{i.persist(),b(i.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:r||d,onKeyDown:y,...c}):e.jsx(u,{px:1,className:"form-item-input slot",children:s})}_.propTypes=S;_.defaultProps={componentProps:{}};function F({editing:n,value:r,onChange:s,componentProps:a,...l}){const{blocklet:c}=a,d=r==="auto"?B.getPassportColorFromDid(c.appDid):r;return e.jsxs(u,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:W({title:"Owner",issuer:v.getDisplayName(c),issuerDid:c.appDid,ownerName:"Your Name",ownerDid:c.appDid,preferredColor:r||"auto"})}}),e.jsx(V,{...l,editing:n,value:n?d:r,onChange:s,componentProps:a})]})}F.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};F.defaultProps={};const X={input:_,color:V,passport:F,uploader:n=>e.jsx(Q,{...n.componentProps})};function ee(n,{editing:r=!1}){const{componentType:s="input",render:a,renderFormItem:l}=n;return r&&l?l:!r&&a?a:X[s==null?void 0:s.toLowerCase()]}function D({schema:n,loading:r,value:s,defaultValue:a,onChange:l,style:c,disabled:d}){const g=Object.prototype.toString.call(s)==="[object Object]",[y,b]=x.useState(null),[i,p]=x.useState(g?s:a),P=x.useRef();function I(t,m,h){const{key:f,secure:C}=t,k=i[f]!==m,j={...i,[f]:m};k&&p(j),l({[f]:m},{allValues:j,action:h,currentItem:t}),h==="confirm"&&C&&p({...i,[f]:"__encrypted__"}),["confirm","cancel"].includes(h)?N(null):N(t)}function N(t){if(t){P.current=i[t.key],b(t);return}P.current=null,b(null)}function E(t,{editing:m=!1}){const{key:h}=t,f=g?s[h]:i[h];return f==="__encrypted__"?m?"":"******":f}return e.jsx(re,{className:"form",style:c,children:n==null?void 0:n.map(t=>{const{key:m,description:h,required:f,solo:C=!1,hidden:T=!1,componentProps:k={}}=t;if(T)return null;const j=!!(y&&m===y.key),w=E(t,{editing:j}),z=ee(t,{editing:j}),q={inputProps:{"data-cy":"schema-form-item-component"},key:m,description:h,editing:j,value:w,onChange:(L,O="change")=>I(t,L,O),componentProps:k};return e.jsxs(u,{className:"form-item",children:[!C&&e.jsxs(u,{className:"form-item-label",style:{color:f&&!w?"#ff0000":"#333"},children:[h,f&&e.jsx(Z,{})]}),e.jsxs(u,{className:"form-item-body",children:[e.jsx(u,{className:"form-item-input",sx:{textAlign:C?"center":"left"},children:e.jsx(z,{...q})}),!C&&e.jsx(u,{className:"form-item-action",children:j?e.jsxs(e.Fragment,{children:[e.jsx(R,{"data-cy":"schema-form-item-confirm",onClick:()=>{I(t,w,"confirm")},disabled:d||r,size:"large",children:r?e.jsx(A,{size:24}):e.jsx(H,{})}),e.jsx(R,{"data-cy":"schema-form-item-cancel",onClick:()=>{I(t,P.current,"cancel")},disabled:d||r,size:"large",children:e.jsx(M,{})})]}):e.jsx(R,{"data-cy":"schema-form-item-edit",onClick:()=>{I(t,i[m],"edit")},disabled:d||y,size:"large",children:e.jsx(G,{})})})]})]},m)})})}D.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};D.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const re=$(J)``;export{D as S};
1
+ import{P as o,r as x,j as e,B as u,bi as K,bA as B,fg as W,a8 as v,aC as R,n as A,d8 as M,Z as $}from"./index-BaC4EhQh.js";import{d as G}from"./EditIcon-C5DCIJQ3.js";import{d as H}from"./Done-D1_3yhtX.js";import{C as U}from"./Google-Be2TlnTX.js";import{T as Y}from"./TextField-DvTYZ6EA.js";import{R as Z,F as J,L as Q}from"./logo-uploader-DPtvNrwp.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function V({editing:n,value:r,onChange:s}){const[a,l]=x.useState(!1),c=x.useRef(),d=x.useRef(r);x.useEffect(()=>{let p=null;return n&&(p=setTimeout(()=>{l(!0)},50)),()=>{clearTimeout(p)}},[n]);const g=p=>{d.current=p,s(p)},y=()=>{l(!1),s(d.current)},b=e.jsx(u,{className:"form-item-input slot",px:1,children:e.jsxs(u,{display:"flex",alignItems:"center",children:[r,r!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:r,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),i=e.jsxs(u,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:y,children:[e.jsx(u,{display:"flex",alignItems:"center",onClick:()=>l(!0),children:e.jsx("div",{ref:c,style:{flexShrink:0,marginLeft:"8px",backgroundColor:r,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:r==="auto"?"default":"pointer"}})}),e.jsx(K,{open:a,anchorEl:c.current,onClose:()=>l(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(U,{color:r,onChange:p=>g(p.hex)})})]});return n?i:b}V.propTypes=S;function _({editing:n,description:r,value:s,onChange:a,componentProps:l,...c}){const{placeholder:d}=l,g=x.useRef(s),y=i=>{i.key==="Enter"&&a(g.current,"confirm")},b=i=>{g.current=i,a(i)};return n?e.jsx(Y,{style:{flex:1},fullWidth:!0,value:s,onChange:i=>{i.persist(),b(i.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:r||d,onKeyDown:y,...c}):e.jsx(u,{px:1,className:"form-item-input slot",children:s})}_.propTypes=S;_.defaultProps={componentProps:{}};function F({editing:n,value:r,onChange:s,componentProps:a,...l}){const{blocklet:c}=a,d=r==="auto"?B.getPassportColorFromDid(c.appDid):r;return e.jsxs(u,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:W({title:"Owner",issuer:v.getDisplayName(c),issuerDid:c.appDid,ownerName:"Your Name",ownerDid:c.appDid,preferredColor:r||"auto"})}}),e.jsx(V,{...l,editing:n,value:n?d:r,onChange:s,componentProps:a})]})}F.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};F.defaultProps={};const X={input:_,color:V,passport:F,uploader:n=>e.jsx(Q,{...n.componentProps})};function ee(n,{editing:r=!1}){const{componentType:s="input",render:a,renderFormItem:l}=n;return r&&l?l:!r&&a?a:X[s==null?void 0:s.toLowerCase()]}function D({schema:n,loading:r,value:s,defaultValue:a,onChange:l,style:c,disabled:d}){const g=Object.prototype.toString.call(s)==="[object Object]",[y,b]=x.useState(null),[i,p]=x.useState(g?s:a),P=x.useRef();function I(t,m,h){const{key:f,secure:C}=t,k=i[f]!==m,j={...i,[f]:m};k&&p(j),l({[f]:m},{allValues:j,action:h,currentItem:t}),h==="confirm"&&C&&p({...i,[f]:"__encrypted__"}),["confirm","cancel"].includes(h)?N(null):N(t)}function N(t){if(t){P.current=i[t.key],b(t);return}P.current=null,b(null)}function E(t,{editing:m=!1}){const{key:h}=t,f=g?s[h]:i[h];return f==="__encrypted__"?m?"":"******":f}return e.jsx(re,{className:"form",style:c,children:n==null?void 0:n.map(t=>{const{key:m,description:h,required:f,solo:C=!1,hidden:T=!1,componentProps:k={}}=t;if(T)return null;const j=!!(y&&m===y.key),w=E(t,{editing:j}),z=ee(t,{editing:j}),q={inputProps:{"data-cy":"schema-form-item-component"},key:m,description:h,editing:j,value:w,onChange:(L,O="change")=>I(t,L,O),componentProps:k};return e.jsxs(u,{className:"form-item",children:[!C&&e.jsxs(u,{className:"form-item-label",style:{color:f&&!w?"#ff0000":"#333"},children:[h,f&&e.jsx(Z,{})]}),e.jsxs(u,{className:"form-item-body",children:[e.jsx(u,{className:"form-item-input",sx:{textAlign:C?"center":"left"},children:e.jsx(z,{...q})}),!C&&e.jsx(u,{className:"form-item-action",children:j?e.jsxs(e.Fragment,{children:[e.jsx(R,{"data-cy":"schema-form-item-confirm",onClick:()=>{I(t,w,"confirm")},disabled:d||r,size:"large",children:r?e.jsx(A,{size:24}):e.jsx(H,{})}),e.jsx(R,{"data-cy":"schema-form-item-cancel",onClick:()=>{I(t,P.current,"cancel")},disabled:d||r,size:"large",children:e.jsx(M,{})})]}):e.jsx(R,{"data-cy":"schema-form-item-edit",onClick:()=>{I(t,i[m],"edit")},disabled:d||y,size:"large",children:e.jsx(G,{})})})]})]},m)})})}D.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};D.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const re=$(J)``;export{D as S};
@@ -1 +1 @@
1
- import{r as h,j as c,P as f,a1 as d}from"./index-fpoxcuML.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});var p=o.default=void 0;m(h);var n=c;function m(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(v){return Object.getOwnPropertyDescriptor(e,v).enumerable})),r.push.apply(r,a)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(a){y(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function y(e,t,r){return(t=j(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j(e){var t=b(e,"string");return typeof t=="symbol"?t:t+""}function b(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i=function(t){return(0,n.jsxs)("svg",u(u({},t),{},{children:[(0,n.jsx)("path",{d:"M24.604 2.263L28.524 0H42.79v41.862H28.79a1 1 0 0 1-.5-.134l-15.103-8.72V8.854l1.817-1.05 3.2 1.848-1.817 1.05V31.16l12.993 7.502H39.59V3.2H29.38l-1.576.91-3.2-1.847z"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.402 31.16V10.701L13.409 3.2H3.2v35.462h10.21l1.58-.913 3.2 1.847-3.923 2.266H0V0h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z"}),(0,n.jsx)("path",{d:"M138.44 27.684c.192 0 .357.075.496.224l1.344 1.472a9.584 9.584 0 0 1-3.44 2.576c-1.344.608-2.965.912-4.864.912-1.664 0-3.173-.288-4.528-.864a10.056 10.056 0 0 1-3.456-2.416c-.949-1.035-1.685-2.272-2.208-3.712-.523-1.44-.784-3.024-.784-4.752 0-1.728.272-3.312.816-4.752.555-1.44 1.328-2.677 2.32-3.712a10.444 10.444 0 0 1 3.552-2.416c1.387-.576 2.917-.864 4.592-.864 1.632 0 3.083.267 4.352.8a10.973 10.973 0 0 1 3.312 2.128l-1.12 1.584a.936.936 0 0 1-.288.288.742.742 0 0 1-.432.112c-.203 0-.443-.101-.72-.304a8.802 8.802 0 0 0-1.072-.672c-.437-.256-.981-.485-1.632-.688-.651-.203-1.461-.304-2.432-.304-1.141 0-2.187.203-3.136.608a6.885 6.885 0 0 0-2.464 1.728c-.683.747-1.216 1.67-1.6 2.768-.373 1.088-.56 2.32-.56 3.696 0 1.397.197 2.64.592 3.728.395 1.088.939 2.01 1.632 2.768a6.914 6.914 0 0 0 2.448 1.728 7.764 7.764 0 0 0 3.04.592c.661 0 1.253-.037 1.776-.112a7.843 7.843 0 0 0 1.456-.368c.448-.16.869-.363 1.264-.608a8.89 8.89 0 0 0 1.168-.912c.085-.075.176-.133.272-.176a.616.616 0 0 1 .304-.08zM149.68 16.1c1.195 0 2.272.197 3.232.592a6.54 6.54 0 0 1 2.464 1.68c.683.725 1.205 1.605 1.568 2.64.363 1.024.544 2.176.544 3.456 0 1.28-.181 2.437-.544 3.472-.363 1.035-.885 1.915-1.568 2.64a6.795 6.795 0 0 1-2.464 1.68c-.96.384-2.037.576-3.232.576-1.205 0-2.293-.192-3.264-.576a6.987 6.987 0 0 1-2.464-1.68c-.683-.725-1.211-1.605-1.584-2.64-.363-1.035-.544-2.192-.544-3.472 0-1.28.181-2.432.544-3.456.373-1.035.901-1.915 1.584-2.64a6.717 6.717 0 0 1 2.464-1.68c.971-.395 2.059-.592 3.264-.592zm0 14.304c1.536 0 2.683-.517 3.44-1.552.757-1.035 1.136-2.49 1.136-4.368 0-1.877-.379-3.333-1.136-4.368-.757-1.045-1.904-1.568-3.44-1.568-1.557 0-2.72.523-3.488 1.568-.757 1.035-1.136 2.49-1.136 4.368 0 1.877.379 3.333 1.136 4.368.768 1.035 1.931 1.552 3.488 1.552zM163.899 18.612c.352-.373.72-.715 1.104-1.024a6.73 6.73 0 0 1 1.216-.784 6.195 6.195 0 0 1 1.392-.512 6.442 6.442 0 0 1 1.6-.192c.896 0 1.68.15 2.352.448.682.299 1.253.72 1.712 1.264.458.533.805 1.179 1.04 1.936.234.757.352 1.595.352 2.512v10.352h-3.136V22.26c0-1.163-.267-2.064-.8-2.704-.534-.65-1.35-.976-2.448-.976-.8 0-1.552.192-2.256.576a7.38 7.38 0 0 0-1.936 1.536v11.92h-3.12V16.356h1.872c.437 0 .709.208.816.624l.24 1.632zM181.805 18.612c.352-.373.72-.715 1.104-1.024a6.73 6.73 0 0 1 1.216-.784 6.195 6.195 0 0 1 1.392-.512 6.448 6.448 0 0 1 1.6-.192c.896 0 1.68.15 2.352.448a4.63 4.63 0 0 1 1.712 1.264c.459.533.805 1.179 1.04 1.936.235.757.352 1.595.352 2.512v10.352h-3.136V22.26c0-1.163-.267-2.064-.8-2.704-.533-.65-1.349-.976-2.448-.976-.8 0-1.552.192-2.256.576a7.396 7.396 0 0 0-1.936 1.536v11.92h-3.12V16.356h1.872c.437 0 .709.208.816.624l.24 1.632zM207.551 22.676c0-.619-.09-1.19-.272-1.712a3.77 3.77 0 0 0-.768-1.36 3.521 3.521 0 0 0-1.248-.896c-.49-.213-1.056-.32-1.696-.32-1.312 0-2.346.379-3.104 1.136-.746.757-1.221 1.808-1.424 3.152h8.512zm2.576 7.616a6.311 6.311 0 0 1-1.328 1.168 7.926 7.926 0 0 1-1.6.784 9.664 9.664 0 0 1-1.76.448c-.597.096-1.189.144-1.776.144-1.12 0-2.16-.187-3.12-.56a7.159 7.159 0 0 1-2.48-1.664c-.693-.736-1.237-1.643-1.632-2.72-.384-1.088-.576-2.336-.576-3.744 0-1.13.176-2.181.528-3.152a7.67 7.67 0 0 1 1.504-2.56 7.064 7.064 0 0 1 2.416-1.712c.95-.416 2.016-.624 3.2-.624.992 0 1.904.165 2.736.496.843.32 1.568.79 2.176 1.408.608.619 1.083 1.381 1.424 2.288.352.907.528 1.941.528 3.104 0 .48-.053.805-.16.976-.106.16-.304.24-.592.24h-10.656c.032.97.171 1.819.416 2.544.246.715.582 1.312 1.008 1.792.438.48.955.837 1.552 1.072.598.235 1.264.352 2 .352.694 0 1.291-.08 1.792-.24.512-.16.95-.33 1.312-.512.374-.192.683-.368.928-.528.256-.16.48-.24.672-.24.256 0 .454.096.592.288l.896 1.152zM225.113 19.396a1.836 1.836 0 0 1-.288.288c-.086.064-.214.096-.384.096-.171 0-.352-.064-.544-.192a4.872 4.872 0 0 0-.704-.432 5.21 5.21 0 0 0-1.024-.432c-.395-.139-.886-.208-1.472-.208-.768 0-1.446.139-2.032.416a3.972 3.972 0 0 0-1.472 1.184c-.384.512-.678 1.136-.88 1.872-.203.736-.304 1.563-.304 2.48 0 .95.106 1.797.32 2.544.213.736.517 1.36.912 1.872.394.501.874.885 1.44 1.152a4.522 4.522 0 0 0 1.888.384c.672 0 1.226-.08 1.664-.24.437-.17.8-.352 1.088-.544.288-.192.528-.368.72-.528.192-.17.389-.256.592-.256.256 0 .453.096.592.288l.896 1.152a5.966 5.966 0 0 1-1.264 1.168c-.459.32-.95.581-1.472.784a8.34 8.34 0 0 1-1.648.448c-.566.096-1.142.144-1.728.144a7.25 7.25 0 0 1-2.848-.56 6.52 6.52 0 0 1-2.288-1.632c-.64-.715-1.147-1.59-1.52-2.624-.374-1.045-.56-2.23-.56-3.552 0-1.205.165-2.32.496-3.344.341-1.024.837-1.904 1.488-2.64a6.821 6.821 0 0 1 2.432-1.744c.96-.427 2.058-.64 3.296-.64 1.162 0 2.186.187 3.072.56a7.514 7.514 0 0 1 2.368 1.584l-.832 1.152zM234.121 32.868c-1.312 0-2.325-.368-3.04-1.104-.704-.736-1.056-1.787-1.056-3.152v-9.728h-1.888a.701.701 0 0 1-.464-.16c-.117-.117-.176-.288-.176-.512v-1.264l2.64-.368.704-4.848a.738.738 0 0 1 .24-.416.724.724 0 0 1 .48-.16h1.584v5.456h4.608v2.272h-4.608v9.52c0 .64.155 1.12.464 1.44.32.31.726.464 1.216.464.288 0 .534-.037.736-.112a3.27 3.27 0 0 0 .544-.24c.15-.096.278-.181.384-.256a.521.521 0 0 1 .288-.112c.107 0 .187.027.24.08a.694.694 0 0 1 .192.224l.928 1.504c-.512.47-1.12.832-1.824 1.088a6.362 6.362 0 0 1-2.192.384z"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.815 33.284V9H70.66a6.259 6.259 0 0 1 5.823 6.243v11.783a6.258 6.258 0 0 1-6.258 6.258h-12.41zM84.56 9h-3.335v24.321h3.335V9zM61.15 29.95V12.32h9.075a2.923 2.923 0 0 1 2.923 2.923v11.783a2.923 2.923 0 0 1-2.923 2.923H61.15zM89.243 9v24.284h12.409a6.258 6.258 0 0 0 6.259-6.258V15.243A6.259 6.259 0 0 0 102.087 9H89.243zm22.912 5.636h3.728v3.728h-3.728v-3.729zm3.728 9.321h-3.728v3.729h3.728v-3.729zM92.578 12.32v17.63h9.074a2.924 2.924 0 0 0 2.924-2.924V15.243a2.924 2.924 0 0 0-2.924-2.923h-9.074z"})]}))};i.defaultProps={width:"239",height:"42",viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};i.displayName="connect-logo";p=o.default=i;function s({children:e,...t}){return c.jsxs(d,{color:"did",variant:"contained",...t,children:[c.jsx("span",{style:{fontWeight:400},children:e||"Continue With"}),c.jsx(p,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}s.propTypes={children:f.any};s.defaultProps={children:""};export{s as C};
1
+ import{r as h,j as c,P as f,a1 as d}from"./index-BaC4EhQh.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});var p=o.default=void 0;m(h);var n=c;function m(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(v){return Object.getOwnPropertyDescriptor(e,v).enumerable})),r.push.apply(r,a)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?l(Object(r),!0).forEach(function(a){y(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function y(e,t,r){return(t=j(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j(e){var t=b(e,"string");return typeof t=="symbol"?t:t+""}function b(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var i=function(t){return(0,n.jsxs)("svg",u(u({},t),{},{children:[(0,n.jsx)("path",{d:"M24.604 2.263L28.524 0H42.79v41.862H28.79a1 1 0 0 1-.5-.134l-15.103-8.72V8.854l1.817-1.05 3.2 1.848-1.817 1.05V31.16l12.993 7.502H39.59V3.2H29.38l-1.576.91-3.2-1.847z"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.402 31.16V10.701L13.409 3.2H3.2v35.462h10.21l1.58-.913 3.2 1.847-3.923 2.266H0V0h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047z"}),(0,n.jsx)("path",{d:"M138.44 27.684c.192 0 .357.075.496.224l1.344 1.472a9.584 9.584 0 0 1-3.44 2.576c-1.344.608-2.965.912-4.864.912-1.664 0-3.173-.288-4.528-.864a10.056 10.056 0 0 1-3.456-2.416c-.949-1.035-1.685-2.272-2.208-3.712-.523-1.44-.784-3.024-.784-4.752 0-1.728.272-3.312.816-4.752.555-1.44 1.328-2.677 2.32-3.712a10.444 10.444 0 0 1 3.552-2.416c1.387-.576 2.917-.864 4.592-.864 1.632 0 3.083.267 4.352.8a10.973 10.973 0 0 1 3.312 2.128l-1.12 1.584a.936.936 0 0 1-.288.288.742.742 0 0 1-.432.112c-.203 0-.443-.101-.72-.304a8.802 8.802 0 0 0-1.072-.672c-.437-.256-.981-.485-1.632-.688-.651-.203-1.461-.304-2.432-.304-1.141 0-2.187.203-3.136.608a6.885 6.885 0 0 0-2.464 1.728c-.683.747-1.216 1.67-1.6 2.768-.373 1.088-.56 2.32-.56 3.696 0 1.397.197 2.64.592 3.728.395 1.088.939 2.01 1.632 2.768a6.914 6.914 0 0 0 2.448 1.728 7.764 7.764 0 0 0 3.04.592c.661 0 1.253-.037 1.776-.112a7.843 7.843 0 0 0 1.456-.368c.448-.16.869-.363 1.264-.608a8.89 8.89 0 0 0 1.168-.912c.085-.075.176-.133.272-.176a.616.616 0 0 1 .304-.08zM149.68 16.1c1.195 0 2.272.197 3.232.592a6.54 6.54 0 0 1 2.464 1.68c.683.725 1.205 1.605 1.568 2.64.363 1.024.544 2.176.544 3.456 0 1.28-.181 2.437-.544 3.472-.363 1.035-.885 1.915-1.568 2.64a6.795 6.795 0 0 1-2.464 1.68c-.96.384-2.037.576-3.232.576-1.205 0-2.293-.192-3.264-.576a6.987 6.987 0 0 1-2.464-1.68c-.683-.725-1.211-1.605-1.584-2.64-.363-1.035-.544-2.192-.544-3.472 0-1.28.181-2.432.544-3.456.373-1.035.901-1.915 1.584-2.64a6.717 6.717 0 0 1 2.464-1.68c.971-.395 2.059-.592 3.264-.592zm0 14.304c1.536 0 2.683-.517 3.44-1.552.757-1.035 1.136-2.49 1.136-4.368 0-1.877-.379-3.333-1.136-4.368-.757-1.045-1.904-1.568-3.44-1.568-1.557 0-2.72.523-3.488 1.568-.757 1.035-1.136 2.49-1.136 4.368 0 1.877.379 3.333 1.136 4.368.768 1.035 1.931 1.552 3.488 1.552zM163.899 18.612c.352-.373.72-.715 1.104-1.024a6.73 6.73 0 0 1 1.216-.784 6.195 6.195 0 0 1 1.392-.512 6.442 6.442 0 0 1 1.6-.192c.896 0 1.68.15 2.352.448.682.299 1.253.72 1.712 1.264.458.533.805 1.179 1.04 1.936.234.757.352 1.595.352 2.512v10.352h-3.136V22.26c0-1.163-.267-2.064-.8-2.704-.534-.65-1.35-.976-2.448-.976-.8 0-1.552.192-2.256.576a7.38 7.38 0 0 0-1.936 1.536v11.92h-3.12V16.356h1.872c.437 0 .709.208.816.624l.24 1.632zM181.805 18.612c.352-.373.72-.715 1.104-1.024a6.73 6.73 0 0 1 1.216-.784 6.195 6.195 0 0 1 1.392-.512 6.448 6.448 0 0 1 1.6-.192c.896 0 1.68.15 2.352.448a4.63 4.63 0 0 1 1.712 1.264c.459.533.805 1.179 1.04 1.936.235.757.352 1.595.352 2.512v10.352h-3.136V22.26c0-1.163-.267-2.064-.8-2.704-.533-.65-1.349-.976-2.448-.976-.8 0-1.552.192-2.256.576a7.396 7.396 0 0 0-1.936 1.536v11.92h-3.12V16.356h1.872c.437 0 .709.208.816.624l.24 1.632zM207.551 22.676c0-.619-.09-1.19-.272-1.712a3.77 3.77 0 0 0-.768-1.36 3.521 3.521 0 0 0-1.248-.896c-.49-.213-1.056-.32-1.696-.32-1.312 0-2.346.379-3.104 1.136-.746.757-1.221 1.808-1.424 3.152h8.512zm2.576 7.616a6.311 6.311 0 0 1-1.328 1.168 7.926 7.926 0 0 1-1.6.784 9.664 9.664 0 0 1-1.76.448c-.597.096-1.189.144-1.776.144-1.12 0-2.16-.187-3.12-.56a7.159 7.159 0 0 1-2.48-1.664c-.693-.736-1.237-1.643-1.632-2.72-.384-1.088-.576-2.336-.576-3.744 0-1.13.176-2.181.528-3.152a7.67 7.67 0 0 1 1.504-2.56 7.064 7.064 0 0 1 2.416-1.712c.95-.416 2.016-.624 3.2-.624.992 0 1.904.165 2.736.496.843.32 1.568.79 2.176 1.408.608.619 1.083 1.381 1.424 2.288.352.907.528 1.941.528 3.104 0 .48-.053.805-.16.976-.106.16-.304.24-.592.24h-10.656c.032.97.171 1.819.416 2.544.246.715.582 1.312 1.008 1.792.438.48.955.837 1.552 1.072.598.235 1.264.352 2 .352.694 0 1.291-.08 1.792-.24.512-.16.95-.33 1.312-.512.374-.192.683-.368.928-.528.256-.16.48-.24.672-.24.256 0 .454.096.592.288l.896 1.152zM225.113 19.396a1.836 1.836 0 0 1-.288.288c-.086.064-.214.096-.384.096-.171 0-.352-.064-.544-.192a4.872 4.872 0 0 0-.704-.432 5.21 5.21 0 0 0-1.024-.432c-.395-.139-.886-.208-1.472-.208-.768 0-1.446.139-2.032.416a3.972 3.972 0 0 0-1.472 1.184c-.384.512-.678 1.136-.88 1.872-.203.736-.304 1.563-.304 2.48 0 .95.106 1.797.32 2.544.213.736.517 1.36.912 1.872.394.501.874.885 1.44 1.152a4.522 4.522 0 0 0 1.888.384c.672 0 1.226-.08 1.664-.24.437-.17.8-.352 1.088-.544.288-.192.528-.368.72-.528.192-.17.389-.256.592-.256.256 0 .453.096.592.288l.896 1.152a5.966 5.966 0 0 1-1.264 1.168c-.459.32-.95.581-1.472.784a8.34 8.34 0 0 1-1.648.448c-.566.096-1.142.144-1.728.144a7.25 7.25 0 0 1-2.848-.56 6.52 6.52 0 0 1-2.288-1.632c-.64-.715-1.147-1.59-1.52-2.624-.374-1.045-.56-2.23-.56-3.552 0-1.205.165-2.32.496-3.344.341-1.024.837-1.904 1.488-2.64a6.821 6.821 0 0 1 2.432-1.744c.96-.427 2.058-.64 3.296-.64 1.162 0 2.186.187 3.072.56a7.514 7.514 0 0 1 2.368 1.584l-.832 1.152zM234.121 32.868c-1.312 0-2.325-.368-3.04-1.104-.704-.736-1.056-1.787-1.056-3.152v-9.728h-1.888a.701.701 0 0 1-.464-.16c-.117-.117-.176-.288-.176-.512v-1.264l2.64-.368.704-4.848a.738.738 0 0 1 .24-.416.724.724 0 0 1 .48-.16h1.584v5.456h4.608v2.272h-4.608v9.52c0 .64.155 1.12.464 1.44.32.31.726.464 1.216.464.288 0 .534-.037.736-.112a3.27 3.27 0 0 0 .544-.24c.15-.096.278-.181.384-.256a.521.521 0 0 1 .288-.112c.107 0 .187.027.24.08a.694.694 0 0 1 .192.224l.928 1.504c-.512.47-1.12.832-1.824 1.088a6.362 6.362 0 0 1-2.192.384z"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.815 33.284V9H70.66a6.259 6.259 0 0 1 5.823 6.243v11.783a6.258 6.258 0 0 1-6.258 6.258h-12.41zM84.56 9h-3.335v24.321h3.335V9zM61.15 29.95V12.32h9.075a2.923 2.923 0 0 1 2.923 2.923v11.783a2.923 2.923 0 0 1-2.923 2.923H61.15zM89.243 9v24.284h12.409a6.258 6.258 0 0 0 6.259-6.258V15.243A6.259 6.259 0 0 0 102.087 9H89.243zm22.912 5.636h3.728v3.728h-3.728v-3.729zm3.728 9.321h-3.728v3.729h3.728v-3.729zM92.578 12.32v17.63h9.074a2.924 2.924 0 0 0 2.924-2.924V15.243a2.924 2.924 0 0 0-2.924-2.923h-9.074z"})]}))};i.defaultProps={width:"239",height:"42",viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};i.displayName="connect-logo";p=o.default=i;function s({children:e,...t}){return c.jsxs(d,{color:"did",variant:"contained",...t,children:[c.jsx("span",{style:{fontWeight:400},children:e||"Continue With"}),c.jsx(p,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}s.propTypes={children:f.any};s.defaultProps={children:""};export{s as C};
@@ -1,4 +1,4 @@
1
- import{r as r0,aY as hb,aP as WA,bX as aA,j as y,cr as nA,cs as db,t as dA,aa as tA,P,Z as C0,n as YM,ct as KM,cu as iA,cv as QM,cw as tb,b7 as rA,$ as Xb,ac as sA,cx as fA,cy as uA,cz as RA,cA as lA,cB as LA,cC as NA,T as BA,C as hA}from"./index-fpoxcuML.js";import{g as XA,a as mA,b as TA}from"./spaces-Dv5sTFBl.js";import{j as yA}from"./url-join-Cc5BAZ2e.js";import{S as W2}from"./Skeleton-D5U61zVB.js";import{H as gA}from"./Hidden-qI_JwCnJ.js";function _A(){const[M,b]=r0.useState(null),{blocklet:O}=hb();return r0.useEffect(()=>{b(XA(O))},[O]),{storageEndpoint:M}}const mb=r0.createContext({}),{Provider:SA,Consumer:R5}=mb;function Tb({children:M}){const[b,O]=r0.useState(!1),[c,q]=r0.useState(null),{blocklet:W,actions:{refreshBlocklet:d}}=hb(),{storageEndpoint:i}=_A(),{api:X}=WA();aA(async()=>{try{if(O(!0),db.isEmpty(i)){q(null);return}const E=await mA(i);q(E)}catch(E){console.error(E),dA.error(E.message)}finally{O(!1)}},[i]);const R=()=>{q(null),d()},w=async E=>{q(E),await Q(E.endpoint),d()},Q=async E=>{await X.configBlocklet({input:{did:[W.meta.did],configs:[{key:tA.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:E}]}}),d()};r0.useEffect(()=>{async function E(){if(!c)return;const D=await TA(c.endpoint,c.name),n0=db.merge(c,{name:D});q(n0)}E()},[]);const _=!!(i&&c);return y.jsx(SA,{value:{loading:b,spaceGateway:c,deleteSpaceGateway:R,updateSpaceGateway:w,storageEndpoint:i,settingStorageEndpoint:Q,hasStorageEndpoint:_},children:M})}Tb.propTypes={children:nA.node.isRequired};Tb.defaultProps={};function l5(){return r0.useContext(mb)}function JM({value:M,size:b,style:O,...c}){return y.jsxs(kA,{style:{width:b,height:b,...O},...c,children:[y.jsx(YM,{variant:"determinate",role:"progressbar",value:100,size:b,"aria-label":"decorative progress bar",thickness:10,style:{color:"#dddddd"}}),y.jsx(YM,{variant:"determinate",value:M,role:"progressbar",size:b,thickness:10,"aria-label":"main progress bar"})]})}JM.propTypes={value:P.number.isRequired,size:P.number,style:P.object};JM.defaultProps={size:10,style:{}};const kA=C0.span`
1
+ import{r as r0,aY as hb,aP as WA,bX as aA,j as y,cr as nA,cs as db,t as dA,aa as tA,P,Z as C0,n as YM,ct as KM,cu as iA,cv as QM,cw as tb,b7 as rA,$ as Xb,ac as sA,cx as fA,cy as uA,cz as RA,cA as lA,cB as LA,cC as NA,T as BA,C as hA}from"./index-BaC4EhQh.js";import{g as XA,a as mA,b as TA}from"./spaces-DPfrZKXe.js";import{j as yA}from"./url-join-D5TK65dM.js";import{S as W2}from"./Skeleton-D6pzHOGJ.js";import{H as gA}from"./Hidden-Bg6BPxEd.js";function _A(){const[M,b]=r0.useState(null),{blocklet:O}=hb();return r0.useEffect(()=>{b(XA(O))},[O]),{storageEndpoint:M}}const mb=r0.createContext({}),{Provider:SA,Consumer:R5}=mb;function Tb({children:M}){const[b,O]=r0.useState(!1),[c,q]=r0.useState(null),{blocklet:W,actions:{refreshBlocklet:d}}=hb(),{storageEndpoint:i}=_A(),{api:X}=WA();aA(async()=>{try{if(O(!0),db.isEmpty(i)){q(null);return}const E=await mA(i);q(E)}catch(E){console.error(E),dA.error(E.message)}finally{O(!1)}},[i]);const R=()=>{q(null),d()},w=async E=>{q(E),await Q(E.endpoint),d()},Q=async E=>{await X.configBlocklet({input:{did:[W.meta.did],configs:[{key:tA.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:E}]}}),d()};r0.useEffect(()=>{async function E(){if(!c)return;const D=await TA(c.endpoint,c.name),n0=db.merge(c,{name:D});q(n0)}E()},[]);const _=!!(i&&c);return y.jsx(SA,{value:{loading:b,spaceGateway:c,deleteSpaceGateway:R,updateSpaceGateway:w,storageEndpoint:i,settingStorageEndpoint:Q,hasStorageEndpoint:_},children:M})}Tb.propTypes={children:nA.node.isRequired};Tb.defaultProps={};function l5(){return r0.useContext(mb)}function JM({value:M,size:b,style:O,...c}){return y.jsxs(kA,{style:{width:b,height:b,...O},...c,children:[y.jsx(YM,{variant:"determinate",role:"progressbar",value:100,size:b,"aria-label":"decorative progress bar",thickness:10,style:{color:"#dddddd"}}),y.jsx(YM,{variant:"determinate",value:M,role:"progressbar",size:b,thickness:10,"aria-label":"main progress bar"})]})}JM.propTypes={value:P.number.isRequired,size:P.number,style:P.object};JM.defaultProps={size:10,style:{}};const kA=C0.span`
2
2
  display: inline-block;
3
3
  position: relative;
4
4
  > * {
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-BnX7dsCg.js","assets/index-fpoxcuML.js","assets/index-D8NuaJ66.css","assets/index-CeNlYeEB.js","assets/preact.module-DJUF--8d.js","assets/index-DCx94jgM.js","assets/index-C5cJ2AYH.js","assets/toUpper-DxMwQ-7A.js","assets/index-BmTem0RD.js","assets/fallback-0bWgPkSN.js","assets/index-BElhBMsQ.js","assets/Toolbar-vbF-NV4R.js","assets/Hidden-qI_JwCnJ.js","assets/index-DnNh-evc.js","assets/MoreVert-BZrKRQjN.js","assets/selector-fvBTD9SB.js","assets/ExpandMore-DUJJgQvW.js","assets/Avatar-DlL4WPrD.js","assets/useSlot-GRhp-924.js","assets/resource-dialog-DSlBHCVu.js","assets/OpenInNew-BmjNdWrg.js","assets/CloseOutlined-IVnREWlC.js","assets/use-mobile-BziK5djw.js","assets/Link-Bi0x7esG.js","assets/index-DMGDz3J5.js","assets/index-BmJ_HmLz.js","assets/index-BqbUZVee.js","assets/FormControlLabel-DXsQRQXS.js","assets/useFormControl-CQ_7pr9i.js","assets/Stack-CZh-rd3Z.js","assets/index-D0TT-qXy.js","assets/useThemeProps-BnBMhVDF.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-BM94YLjm.js","assets/redux-B4e5IkPl.js","assets/ViewColumn-C39IjII_.js","assets/FormControl-DFtCJG5u.js","assets/FormGroup-BYqGm4p-.js","assets/Select-BeArBHJP.js","assets/InputLabel-BvnZs665.js","assets/ListItemText-5Rgq6wEi.js","assets/TextField-qwbmqJ_2.js","assets/LastPage-Cyi1MuLL.js","assets/Search-BMPJQuLV.js","assets/Delete-BVwa0m1R.js","assets/index-C0fRQdXZ.js","assets/url-join-Cc5BAZ2e.js","assets/uniqBy-C7E-hw0R.js","assets/react-BW7E7-P9.css"])))=>i.map(i=>d[i]);
2
- import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cP as p2,fx as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dw as f2,aa as ye,c as pe,I as x2,bW as g1,ch as j0,cE as m2,cN as He,cO as w0,aj as v2,d2 as g2,cI as Je,bF as re,c3 as Qe,fi as b2,a8 as J1,b as ne,bm as R0,ec as C0,ai as b1,bn as y0,co as z0,aT as Ae,aS as j2,a3 as S0,fy as Q1,f7 as Le,bk as w2,au as k0,cV as R2,l as C2,aB as y2,aq as z2,ar as i1}from"./index-fpoxcuML.js";import{d as j1}from"./Add-BXK5RFEZ.js";import{d as I0}from"./Delete-BVwa0m1R.js";import{d as S2}from"./Error-Cpv-DWNH.js";import{D as w1}from"./index-D0TT-qXy.js";import{T as M0,b as k2}from"./index-DCyB2kx5.js";import{C as R1}from"./confirm-BY-9Ale6.js";import{u as s1}from"./session-BHe45BP1.js";import{W as Y1}from"./did-address-Bye61gv9.js";import{B as C1,d as I2}from"./ChevronRight-BGd4BknI.js";import{S as be}from"./shorten-label-BOSkgF_N.js";import{A as P0}from"./Avatar-DlL4WPrD.js";import{d as M2}from"./Download-BONj8GVi.js";import{d as P2}from"./QuestionMarkCircle-e6Dqgeid.js";import{b as L2,c as Z1,T as T2}from"./index-DMGDz3J5.js";import{_ as Pe}from"./useSetState-5snwvlLZ.js";import{c as y1}from"./index-C5cJ2AYH.js";import{C as u1,F as p1}from"./FormControlLabel-DXsQRQXS.js";import{A as L0}from"./Alert-CeGhMuEg.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-BdPs8cnO.js";import{i as N2}from"./index-CMg55b21.js";import{d as V2}from"./ExpandMore-DUJJgQvW.js";import{d as D2}from"./OpenInNew-BmjNdWrg.js";import{u as T0}from"./useThemeProps-BnBMhVDF.js";import{u as _2}from"./useSlotProps-CPXTP7XP.js";import{d as E2}from"./DeleteOutline-CZQhsml4.js";import{c as B2,A as N0,u as A2,S as O2,U as H2}from"./item-BXQ3arsv.js";import{d as $2}from"./ArrowDropDown-JIsmOdUp.js";import{f as Ne}from"./format-error-BOfFwKPG.js";import{B as h1}from"./ButtonGroup-ailEu1Nr.js";import{T as Te}from"./TextField-qwbmqJ_2.js";import{I as z1}from"./InputAdornment-ooDD0p7-.js";import{C as F2}from"./click-to-copy-DdG-v5Xf.js";import{d as U2}from"./Launch-DuItzynA.js";import{L as q2}from"./MoreVert-BZrKRQjN.js";import{a as W2}from"./ListItemText-5Rgq6wEi.js";import{S as e0}from"./index-BqbUZVee.js";import{M as G2}from"./index-Be2wLDD2.js";import{r as K2}from"./index--PkoOt7s.js";import{d as X2}from"./Done-Dsagjn-5.js";import{c as V0,d as D0,b as J2,S as Q2,a as Y2}from"./Stepper-DRS0AaL5.js";import{S as Z2}from"./Stack-CZh-rd3Z.js";import{R as et,a as t0}from"./RadioGroup-hK79XBIl.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-BM94YLjm.js";import"./redux-B4e5IkPl.js";import"./ViewColumn-C39IjII_.js";import"./FormControl-DFtCJG5u.js";import"./useFormControl-CQ_7pr9i.js";import"./FormGroup-BYqGm4p-.js";import"./Select-BeArBHJP.js";import"./InputLabel-BvnZs665.js";import"./LastPage-Cyi1MuLL.js";import"./Toolbar-vbF-NV4R.js";import"./Search-BMPJQuLV.js";import"./index-BmJ_HmLz.js";import"./DialogContentText-ClisAi23.js";import"./Link-Bi0x7esG.js";import"./useSlot-GRhp-924.js";import"./jss-plugin-props-sort.esm-C9YatkDP.js";const tt=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),ot=["slots","slotProps"],lt=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),nt=se(tt)({width:24,height:16});function st(e){const{slots:t={},slotProps:l={}}=e,s=je(e,ot),r=e;return o.jsx("li",{children:o.jsx(lt,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(nt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function rt(e){return Fe("MuiBreadcrumbs",e)}const it=$e("MuiBreadcrumbs",["root","ol","li","separator"]),at=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ct=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},rt,t)},dt=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${it.li}`]:t.li},t.root]})({}),ut=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ht(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(pt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,at),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=ct(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(st,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(dt,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(ut,{className:C.ol,ref:N,ownerState:v,children:ht(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function ft(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ft,t)},vt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,xt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=mt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(J2,A({},d,{children:r}));return o.jsx(vt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function bt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const jt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],wt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},bt,t)},Rt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),Ct=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),yt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,jt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=wt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Rt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(Ct,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},zt=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,St=zt(Se()),kt=o;E0=S1.default=(0,St.default)((0,kt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var k1={},It=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Mt=It(Se()),Pt=o;B0=k1.default=(0,Mt.default)((0,Pt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var I1={},Lt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Tt=Lt(Se()),Nt=o;A0=I1.default=(0,Tt.default)((0,Nt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Vt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(S2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const Vt=ae(z)`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/react-iXxw1Yhu.js","assets/index-BaC4EhQh.js","assets/index-D8NuaJ66.css","assets/index-CH2n2mOS.js","assets/preact.module-DJUF--8d.js","assets/index-hkkOggLS.js","assets/index-DPXmNWqb.js","assets/toUpper-Bff1Q0mA.js","assets/index-CFpdZL6w.js","assets/fallback-BLJkxLTK.js","assets/index-DiOkeCOc.js","assets/Toolbar-DbekG5v-.js","assets/Hidden-Bg6BPxEd.js","assets/index-BCMjvLku.js","assets/MoreVert-D_g6Th6c.js","assets/selector-B8IAFODK.js","assets/ExpandMore-BgcTT2Bb.js","assets/Avatar-Der2Q3Zi.js","assets/useSlot-nO86v-Bn.js","assets/resource-dialog-DhmviK8K.js","assets/OpenInNew-DBNjDxil.js","assets/CloseOutlined-OBzuC30j.js","assets/use-mobile-BA_cO1yG.js","assets/Link-CiVKLn7B.js","assets/index-BK9kuqs5.js","assets/index-B3ThwVSS.js","assets/index-ChWrF7R7.js","assets/FormControlLabel-BJXWJJky.js","assets/useFormControl-CAWQrhew.js","assets/Stack-DuNNAX-1.js","assets/index-CT70Tuv9.js","assets/useThemeProps-CIT7yB5m.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-s95vTNww.js","assets/redux-Bma4eNss.js","assets/ViewColumn-BOqfI3PF.js","assets/FormControl-D00yHDcj.js","assets/FormGroup-CBgybl1l.js","assets/Select-_ZzhxUOz.js","assets/InputLabel-BaHBEVm2.js","assets/ListItemText-BW_owdy0.js","assets/TextField-DvTYZ6EA.js","assets/LastPage-DyrTuTrl.js","assets/Search-Cm2FDsnl.js","assets/Delete-DVYTl7-n.js","assets/index-Ez2y1Lea.js","assets/url-join-D5TK65dM.js","assets/uniqBy-DIeGY4K_.js","assets/react-BW7E7-P9.css"])))=>i.map(i=>d[i]);
2
+ import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF as Fe,T as G,r as R,aI as m1,aL as u2,aM as Ue,aN as qe,cP as p2,fx as l1,X as Se,Y as ke,B as z,n as Oe,P as h,$ as We,G as X,e as v1,u as te,aP as we,aY as Ve,bx as n1,a1 as e1,L as ue,bL as b0,a as ve,aC as ge,K as h2,t as $,Z as ae,dw as f2,aa as ye,c as pe,I as x2,bW as g1,ch as j0,cE as m2,cN as He,cO as w0,aj as v2,d2 as g2,cI as Je,bF as re,c3 as Qe,fi as b2,a8 as J1,b as ne,bm as R0,ec as C0,ai as b1,bn as y0,co as z0,aT as Ae,aS as j2,a3 as S0,fy as Q1,f7 as Le,bk as w2,au as k0,cV as R2,l as C2,aB as y2,aq as z2,ar as i1}from"./index-BaC4EhQh.js";import{d as j1}from"./Add-DPWETbuH.js";import{d as I0}from"./Delete-DVYTl7-n.js";import{d as S2}from"./Error-DOhq8cCM.js";import{D as w1}from"./index-CT70Tuv9.js";import{T as M0,b as k2}from"./index-Dp6zROo4.js";import{C as R1}from"./confirm-BdJlZzQ-.js";import{u as s1}from"./session-D3mS3Gz5.js";import{W as Y1}from"./did-address-DNmiCCjI.js";import{B as C1,d as I2}from"./ChevronRight-CIt5KDbd.js";import{S as be}from"./shorten-label-DWH-tsmz.js";import{A as P0}from"./Avatar-Der2Q3Zi.js";import{d as M2}from"./Download-CvngcFRX.js";import{d as P2}from"./QuestionMarkCircle-UZOXHzIe.js";import{b as L2,c as Z1,T as T2}from"./index-BK9kuqs5.js";import{_ as Pe}from"./useSetState-OuMAH4bG.js";import{c as y1}from"./index-DPXmNWqb.js";import{C as u1,F as p1}from"./FormControlLabel-BJXWJJky.js";import{A as L0}from"./Alert-DDr4PUmN.js";import{p as t1}from"./index-HqFqdQ4r.js";import"./api-DUETbHv8.js";import{i as N2}from"./index-CD6yQnY4.js";import{d as V2}from"./ExpandMore-BgcTT2Bb.js";import{d as D2}from"./OpenInNew-DBNjDxil.js";import{u as T0}from"./useThemeProps-CIT7yB5m.js";import{u as _2}from"./useSlotProps-B8lkbwkT.js";import{d as E2}from"./DeleteOutline-DKoxIRL9.js";import{c as B2,A as N0,u as A2,S as O2,U as H2}from"./item-B0XIEv1j.js";import{d as $2}from"./ArrowDropDown-BCZ8iqaM.js";import{f as Ne}from"./format-error-C43xGCjC.js";import{B as h1}from"./ButtonGroup-zMm3edlK.js";import{T as Te}from"./TextField-DvTYZ6EA.js";import{I as z1}from"./InputAdornment-BGOXKboF.js";import{C as F2}from"./click-to-copy-GLcS-PQh.js";import{d as U2}from"./Launch-CNWKbDVj.js";import{L as q2}from"./MoreVert-D_g6Th6c.js";import{a as W2}from"./ListItemText-BW_owdy0.js";import{S as e0}from"./index-ChWrF7R7.js";import{M as G2}from"./index-BrFlqDrV.js";import{r as K2}from"./index-CzxDEhmG.js";import{d as X2}from"./Done-D1_3yhtX.js";import{c as V0,d as D0,b as J2,S as Q2,a as Y2}from"./Stepper-DJcNoyk4.js";import{S as Z2}from"./Stack-DuNNAX-1.js";import{R as et,a as t0}from"./RadioGroup-BOq5mI1A.js";import"./toPropertyKey-PLuKRk1e.js";import"./index-s95vTNww.js";import"./redux-Bma4eNss.js";import"./ViewColumn-BOqfI3PF.js";import"./FormControl-D00yHDcj.js";import"./useFormControl-CAWQrhew.js";import"./FormGroup-CBgybl1l.js";import"./Select-_ZzhxUOz.js";import"./InputLabel-BaHBEVm2.js";import"./LastPage-DyrTuTrl.js";import"./Toolbar-DbekG5v-.js";import"./Search-Cm2FDsnl.js";import"./index-B3ThwVSS.js";import"./DialogContentText-BnQAOkxN.js";import"./Link-CiVKLn7B.js";import"./useSlot-nO86v-Bn.js";import"./jss-plugin-props-sort.esm-D4wv_NcC.js";const tt=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),ot=["slots","slotProps"],lt=se(g0)(({theme:e})=>A({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":A({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":A({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:X1(e.palette.grey[200],.12)}:{backgroundColor:X1(e.palette.grey[600],.12)})})),nt=se(tt)({width:24,height:16});function st(e){const{slots:t={},slotProps:l={}}=e,s=je(e,ot),r=e;return o.jsx("li",{children:o.jsx(lt,A({focusRipple:!0},s,{ownerState:r,children:o.jsx(nt,A({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function rt(e){return Fe("MuiBreadcrumbs",e)}const it=$e("MuiBreadcrumbs",["root","ol","li","separator"]),at=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ct=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},rt,t)},dt=se(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${it.li}`]:t.li},t.root]})({}),ut=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ht(e,t,l,s){return e.reduce((r,c,i)=>(i<e.length-1?r=r.concat(c,o.jsx(pt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(c),r),[])}const _0=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:c,component:i="nav",slots:a={},slotProps:u={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:y=8,separator:p="/"}=s,d=je(s,at),[m,b]=R.useState(!1),v=A({},s,{component:i,expanded:m,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:y,separator:p}),C=ct(v),S=u2({elementType:a.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:v}),N=R.useRef(null),T=I=>{const U=()=>{b(!0);const V=N.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return g+x>=I.length?I:[...I.slice(0,g),o.jsx(st,{"aria-label":f,slots:{CollapsedIcon:a.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:U},"ellipsis"),...I.slice(I.length-x,I.length)]},P=R.Children.toArray(r).filter(I=>R.isValidElement(I)).map((I,U)=>o.jsx("li",{className:C.li,children:I},`child-${U}`));return o.jsx(dt,A({ref:l,component:i,color:"text.secondary",className:Ue(C.root,c),ownerState:v},d,{children:o.jsx(ut,{className:C.ol,ref:N,ownerState:v,children:ht(m||y&&P.length<=y?P:T(P),C.separator,p,v)})}))});function ft(e){return Fe("MuiStepButton",e)}const o0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),xt=["children","className","icon","optional"],mt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},ft,t)},vt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${o0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>A({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${o0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),gt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepButton"}),{children:r,className:c,icon:i,optional:a}=s,u=je(s,xt),{disabled:f,active:x}=R.useContext(V0),{orientation:g}=R.useContext(D0),y=A({},s,{orientation:g}),p=mt(y),d={icon:i,optional:a},m=p2(r,["StepLabel"])?R.cloneElement(r,d):o.jsx(J2,A({},d,{children:r}));return o.jsx(vt,A({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,c),ref:l,ownerState:y,"aria-current":x?"step":void 0},u,{children:m}))});function bt(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const jt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],wt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},bt,t)},Rt=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>A({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),Ct=se(l1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),yt=R.forwardRef(function(t,l){const s=m1({props:t,name:"MuiStepContent"}),{children:r,className:c,TransitionComponent:i=l1,transitionDuration:a="auto",TransitionProps:u}=s,f=je(s,jt);R.useContext(D0);const{active:x,last:g,expanded:y}=R.useContext(V0),p=A({},s,{last:g}),d=wt(p);let m=a;return a==="auto"&&!i.muiSupportAuto&&(m=void 0),o.jsx(Rt,A({className:Ue(d.root,c),ref:l,ownerState:p},f,{children:o.jsx(Ct,A({as:i,in:x||y,className:d.transition,ownerState:p,timeout:m,unmountOnExit:!0},u,{children:r}))}))});var S1={},zt=ke;Object.defineProperty(S1,"__esModule",{value:!0});var E0=S1.default=void 0,St=zt(Se()),kt=o;E0=S1.default=(0,St.default)((0,kt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var k1={},It=ke;Object.defineProperty(k1,"__esModule",{value:!0});var B0=k1.default=void 0,Mt=It(Se()),Pt=o;B0=k1.default=(0,Mt.default)((0,Pt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var I1={},Lt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var A0=I1.default=void 0,Tt=Lt(Se()),Nt=o;A0=I1.default=(0,Tt.default)((0,Nt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function Ie({size:e,...t}){return o.jsx(z,{display:"flex",mt:4,...t,children:o.jsx(Oe,{size:e})})}Ie.propTypes={size:h.number};Ie.defaultProps={size:24};function M1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[a,u]=R.useState(!1),f=We(x=>x.breakpoints.down("md"));return o.jsxs(z,{sx:{display:"flex",flexDirection:"row",color:a?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(z,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||a?"primary.main":"grey.700"},children:r||"/"})]})]})}M1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function P1({initUrl:e}){const t=v1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:c}=we(),{api:i}=s1(),[a,u]=R.useState(!0),{blocklet:f}=Ve(),[x,g]=R.useState(null),[y,p]=R.useState(!1),d=We(k=>k.breakpoints.down("xl")),{componentDid:m=""}=n1(),[b,v]=R.useState(null),C=()=>{c.getProjects({input:{did:f.meta.did,componentDid:m,tenantScope:l}}).then(k=>{const L=(k==null?void 0:k.projects)||[];u(!1),v(L)}).catch(k=>{u(!1),$.error(k.message)})},S=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},N=k=>{g(k)},T=()=>{u(!1),p(!0)},P=()=>{p(!1),g(null)},I=k=>{$.error(k.message),p(!1),g(null)},U=k=>{if(!(k!=null&&k.deleted)){$.error("Delete project failed");return}C(),p(!1),g(null)};if(R.useEffect(()=>{C()},[]),!b&&a)return o.jsx(z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ie,{})});if(!b)return null;if(!b.length)return o.jsxs(z,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(z,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(z,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(e1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:k=>{const L=b[k];return o.jsx(ue,{to:`${L.id}`,children:o.jsx(M1,{did:f.meta.did,projectId:L.id,logo:L.blockletLogo,title:L.blockletTitle,describe:L.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:k=>k?o.jsx(M0,{type:"success",children:k}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:k=>k?o.jsx(Y1,{size:14,compact:!0,responsive:!1,did:k}):null}},d||m?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:k=>k?o.jsx(Y1,{onClick:()=>{t(`/.well-known/service/admin/members?did=${k}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:k}):null}},d||m?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:k=>{const L=(f.children||[]).find(E=>E.meta.did===k);return L?o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:14,blocklet:L,ancestors:[f]}),o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:L.meta.title})]},k):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:k=>o.jsx(z,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:k})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:k=>o.jsx(b0,{value:Number(k),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:k=>{const L=b[k];return o.jsxs(z,{display:"flex",children:[o.jsx(ue,{to:`${L.id}/new-release/${L.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(E0,{style:{fontSize:18}})})})}),!!L.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${L.id}/view/${L.lastReleaseId}`,children:o.jsx(B0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:L.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>N(L),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),M=y?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:U,onError:I,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Vt,{children:[o.jsxs(z,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(z,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(z,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(e1,{onClick:S,variant:"contained",children:[o.jsx(j1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(z,{mt:3}),o.jsx(w1,{className:"main-table",locale:r,data:b,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(R1,{title:`${s("common.delete")} ${x.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:T,onCancel:()=>g(null),children:o.jsx(z,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(k=>o.jsxs(z,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(S2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:k})]}))})}),M]})}P1.propTypes={initUrl:h.object};P1.defaultProps={initUrl:null};const Vt=ae(z)`
3
3
  .main-table > div:first-child {
4
4
  display: none;
5
5
  }
@@ -133,7 +133,7 @@ import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF a
133
133
  background: #fff;
134
134
  z-index: 10;
135
135
  }
136
- `,c0="lastWantToConnectStoreId";function Wl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Gl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Kl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Xl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx($2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),B2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(j2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-BnX7dsCg.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Wl(s),N=A2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Kl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Gl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Jl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(E2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Jl=ae.div`
136
+ `,c0="lastWantToConnectStoreId";function Wl(e){var a,u;const[t,l]=R.useState(null),{session:s}=s1(),r=R.useCallback(f=>{l(f),localStorage.setItem(c0,f==null?void 0:f.id)},[l]),c=R.useMemo(()=>{var y,p,d,m;const f=localStorage.getItem(c0),x=f?(((y=e==null?void 0:e.settings)==null?void 0:y.storeList)||[]).find(b=>b.id===f):null;if(x)return x;let g=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(b=>{var v;return!(b.id!==X.BLOCKLET_STORE.id||b.scope&&b.scope!=="studio"&&b.scope!==((v=s==null?void 0:s.user)==null?void 0:v.did))});return g||(g=(m=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:m[0]),g},[(a=e==null?void 0:e.settings)==null?void 0:a.storeList,(u=s==null?void 0:s.user)==null?void 0:u.did]);return[t||c||{},r]}const d1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){d1[r]&&clearTimeout(d1[r]),await new Promise(a=>setTimeout(a,s));const c=Date.now(),i=async(a,u)=>{try{const f=await e();a(f)}catch(f){Date.now()-c>l?u(f):r?d1[r]=setTimeout(()=>i(a,u),t):setTimeout(()=>i(a,u),t)}};return new Promise(i)}function Gl(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Kl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var c;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((c=r==null?void 0:r.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Xl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,a;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((a=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&a.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(u=>u.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,a;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((a=l==null?void 0:l.settings)==null?void 0:a.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(u=>u.protected||!u.scope||u.scope==="studio"||u.scope===s),{teamDid:r,storeList:c}};function H1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:c,componentDid:i}){var L,E,B;const{t:a}=te(),{session:u}=s1(),{api:f,info:x,inService:g}=we(),y=Ve(),[p,d]=R.useState(!1),m=R.useRef(null),[b,v]=R.useState(!1),[C,S]=R.useState(null),N=O=>{l(O),d(!1)},T=()=>{d(!p)},P=O=>{m.current&&m.current.contains(O.target)||d(!1)},I=()=>{v(!0)},U=()=>{v(!1)},V=async()=>{var O;if(C)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await((O=y==null?void 0:y.actions)==null?void 0:O.refreshBlocklet())}catch(K){$.error(`Remove Blocklet Store Error: ${Ne(K)}`)}finally{S(null)}},{storeList:M}=X0({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(L=u==null?void 0:u.user)==null?void 0:L.did}),k=(E=e==null?void 0:e.meta)==null?void 0:E.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h1,{disabled:r,ref:m,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[c&&o.jsx(Oe,{size:14,sx:{mr:.5}}),`${a("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:T,children:o.jsx($2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:m.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:O})=>o.jsx(C0,{...O,style:{transformOrigin:"center top"},children:o.jsx(b1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[M==null?void 0:M.map(K=>{var J;return o.jsxs(Ae,{selected:K.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>N(K),children:[o.jsxs(z,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:K.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:K.url})]}),B2({store:K,userDid:(J=u==null?void 0:u.user)==null?void 0:J.did})&&o.jsx(ge,{sx:{ml:1},onClick:W=>{W.preventDefault(),W.stopPropagation(),S(K)},children:o.jsx(re,{icon:"ic:outline-delete"})})]},K.url)}),o.jsx(j2,{}),o.jsxs(Ae,{onClick:I,children:[o.jsx(j1,{font:!0}),o.jsx(G,{variant:"inherit",children:a("store.blockletRegistry.addRegistry")})]})]})})})})}),b&&o.jsx(N0,{hiddenChildren:!0,open:!0,onClose:U,teamDid:k,storeList:M,scope:"studio",onAdd:(B=y==null?void 0:y.actions)==null?void 0:B.refreshBlocklet}),C&&o.jsx(R1,{displayError:!0,title:`${a("common.delete")} ${C.name}`,description:a("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:a("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}H1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};H1.defaultProps={store:null,blocklet:null};const d0=[".webp",".jpg",".jpeg",".png",".gif",".svg"],u0=1024*1024*10,p0=R.lazy(()=>S0(()=>import("./react-iXxw1Yhu.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:c,paramsErrTip:i,setParamsErrTip:a,setLoading:u,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:y}){const{t:p}=te(),{api:d}=we(),m=v1(),b=R.useRef(null),v=R.useRef(null),[C,S]=Wl(s),N=A2({messageType:"connect-store-message",onOpen:()=>u(!0),onClose:()=>u(!1)}),T=async L=>{const E=setTimeout(()=>{u(!1)},2e4),B=await Kl(d,L);u(!1),clearTimeout(E),window.parent.postMessage({event:"studioDialog.connected",componentDid:y},"*"),m(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${B}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){$.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(C!=null&&C.url)){$.error(p("blocklet.publish.noStoreSelected"));return}const L=Gl();N(async(E,B)=>{var O,K,J;try{const W=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:C.url,storeId:C.id,storeName:C.name,type:((K=r==null?void 0:r.blockletComponents)==null?void 0:K.length)>0?"pack":"resource",componentDid:y,messageId:L,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(W!=null&&W.url)){$.error("failed to connect to store");return}B(W.url),T({did:(J=s==null?void 0:s.meta)==null?void 0:J.did,projectId:"",messageId:L})}catch(W){const Z=Ne(W);$.error(Z),u(!1)}})},I=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,U=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,M=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(L=>`${U}/${L}`),k=()=>t?!1:!e||e===X.UNOWNED_DID?($.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0;return o.jsxs(Jl,{children:[o.jsx(z,{display:"flex",className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:L=>{a({blockletTitle:""}),c({blockletTitle:L.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Te,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(z1,{position:"end",children:o.jsx(H1,{blocklet:s,store:C,componentDid:y,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Te,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:L=>{a({blockletDescription:""}),c({blockletDescription:L.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(z,{display:"flex",children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.logo")}),o.jsx(z,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||V,onClick:()=>{k()&&b.current.open()}})})]}),o.jsxs(z,{display:"flex",mt:3,children:[o.jsx(G,{variant:"subtitle1",sx:{mr:2},children:p("common.screenshot")}),o.jsxs(z,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap"},children:[M.map((L,E)=>o.jsxs(z,{className:"screenshot",children:[o.jsx("img",{alt:"screenshot",src:L}),!t&&o.jsx(ge,{className:"action",onClick:()=>{c(B=>{const O=[...B.blockletScreenshots];return O.splice(E,1),{...B,blockletScreenshots:O}})},children:o.jsx(E2,{})})]},L)),M.length<5&&o.jsx(z,{sx:{width:200,height:140,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{k()&&v.current.open()},children:"+"})]})]})]})}),o.jsxs(R.Suspense,{fallback:o.jsx(Ie,{}),children:[o.jsx(p0,{ref:b,popup:!0,onUploadFinish:L=>{c({blockletLogo:L.data.filename}),g(""),b.current.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:1}}},"uploader-logo"),o.jsx(p0,{ref:v,popup:!0,onUploadFinish:L=>{c(E=>{var O;const B=E.blockletScreenshots||[];return B.push((O=L.data)==null?void 0:O.filename),{...E,blockletScreenshots:B}}),v.current.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:U,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:d0,maxFileSize:u0,maxNumberOfFiles:5-M.length}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const Jl=ae.div`
137
137
  margin-top: 24px;
138
138
  .screenshot {
139
139
  margin-bottom: 16px;
@@ -178,7 +178,7 @@ import{at as d2,j as o,aG as se,cJ as g0,aK as A,fw as X1,aJ as je,aE as $e,aF a
178
178
  padding-bottom: 12px;
179
179
  border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
180
180
  }
181
- `;function o2({text:e}){return e?o.jsx(G2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[K2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(L2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},r3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,i3=r3(Se()),f0=o;n2=U1.default=(0,i3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(X2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Q2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!n3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Y2,{children:[o.jsx(gt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(yt,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const a3=[".zip",".gz"],c3=1024*1024*100,d3=R.lazy(()=>S0(()=>import("./react-BnX7dsCg.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(Z2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(d3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:a3,maxFileSize:c3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const u3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},p3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{u3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=C2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=p3[Z];return o.jsxs(h3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(P2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(et,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(T2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const h3=ae.div`
181
+ `;function o2({text:e}){return e?o.jsx(G2,{wrapperElement:{"data-color-mode":"light"},source:e,rehypePlugins:[[K2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ge})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:c}){var x;const{t:i}=te(),[a,u]=R.useState(c?"preview":"write"),f=(g,y)=>{u(y)};return o.jsxs(z,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(z,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(L2,{value:a,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(Z1,{value:"write",label:"Write"}),o.jsx(Z1,{value:"preview",label:"Preview"})]})]}),o.jsx(z,{display:a==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Te,{disabled:s||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(z1,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{r({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(z,{display:a==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var U1={},r3=ke;Object.defineProperty(U1,"__esModule",{value:!0});var n2=U1.default=void 0,i3=r3(Se()),f0=o;n2=U1.default=(0,i3.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function q1({step:e,ok:t,active:l,error:s}){let r="grey.500",c=e+1;return t&&(c=o.jsx(X2,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",c=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(z,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}q1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};q1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:c,paramsErrTip:i,viewMode:a,projectId:u}){const{t:f}=te(),x=()=>{l(d=>d+1)},g=()=>{l(d=>d-1)},y=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=a||Y0({hasSelectedResources:s,params:r,projectId:u,t:f})===null;return o.jsxs(z,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(Q2,{activeStep:t,orientation:"vertical",children:e.map((d,m)=>{const b={},v=c||!n3({hasSelectedResources:s,params:r,projectId:u,step:m,t:f}),C=c?"":y(m);return C&&(b.optional=o.jsx(G,{variant:"caption",color:"error",children:C}),b.error=!0),o.jsxs(Y2,{children:[o.jsx(gt,{icon:o.jsx(q1,{error:C,active:p?99:t,step:m,ok:v}),sx:{cursor:"pointer",color:C?"error.main":"inherit"},disabled:!1,onClick:()=>l(m),...b,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:C||!v&&t>m?"error.main":"inherit",children:d.label})}),o.jsxs(yt,{children:[o.jsx(G,{fontSize:12,children:d.description}),!p&&o.jsx(z,{sx:{mb:2},children:o.jsxs("div",{children:[m<e.length-1&&o.jsx(ne,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:C||!v,children:f("common.continue")}),m>0&&o.jsx(ne,{disabled:m===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(b1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const a3=[".zip",".gz"],c3=1024*1024*100,d3=R.lazy(()=>S0(()=>import("./react-iXxw1Yhu.js").then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48])).then(e=>({default:e.Uploader})));function W1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:c,error:i}){const{t:a}=te(),u=R.useRef(null),f=()=>l?!1:!t||t===X.UNOWNED_DID?($.error(a("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(z,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:a("blocklet.publish.resourceUpload")}),o.jsxs(Z2,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=u.current)==null||g.open())},children:s.uploadedResource?a("common.change"):a("common.upload")})]}),o.jsx(R.Suspense,{fallback:o.jsx(Ie,{}),children:o.jsx(d3,{ref:u,popup:!0,onUploadFinish:g=>{var y;r({uploadedResource:g.data.filename}),c({blockletResource:""}),(y=u.current)==null||y.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:a3,maxFileSize:c3,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(z,{color:"error.main",mt:1,fontSize:14,children:i})]})}W1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};W1.defaultProps={};function o1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:c}){var a;const{t:i}=te();return o.jsx(z,{display:"flex",mt:3,className:"section",children:o.jsxs(z,{sx:{flex:1},children:[o.jsx(Te,{required:!0,disabled:c||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:u=>{r({blockletVersion:""}),l({blockletVersion:u.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Te,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(z1,{position:"end",children:[((a=t==null?void 0:t.note)==null?void 0:a.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:u=>{r({note:""}),l({note:u.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}o1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};o1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const u3=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(z,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(C1,{size:24,blocklet:t,ancestors:l}),o.jsx(z,{ml:"4px",className:"text",children:o.jsx(z,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=g1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},p3={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function G1({initUrl:e,...t}){var K1;const{projectId:l,mode:s,releaseId:r,componentDid:c=""}=n1(),{t:i}=te(),{blocklet:a}=Ve(),[u,f]=Pe({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",resourceFromSelect:!0}),[x,g]=Pe({}),[y,p]=R.useState(!1),[d,m]=Pe(null),{api:b}=we(),v=We(D=>D.breakpoints.down("md")),[C,S]=R.useState({}),[N,T]=R.useState(!1),P=R.useRef({}),[I,U]=Pe({}),[V,M]=R.useState(""),[k,L]=Pe({}),E=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=E==="readonly",O=R.useMemo(()=>{const D={};return Object.keys(k).forEach(_=>{const Ce=k[_];Ce&&Ce.forEach(c2=>{D[c2]=!0})}),D},[k]),K=R.useCallback(D=>{B&&f({blockletComponents:[]}),L(D)},[B,L,f]),J=R.useCallback((...D)=>{U(...D),g({blockletResource:""})},[]),W=r==="none"?(u==null?void 0:u.lastReleaseId)||"":r,[Z,Me]=R.useState(s==="new-release"?4:0);R.useEffect(()=>{l&&g({projectId:""})},[l,g]);const he=R.useMemo(()=>{var D;return(D=u==null?void 0:u.blockletComponents)!=null&&D.some(_=>_.included)||Object.keys(O).length||u!=null&&u.uploadedResource?"pack":"resource"},[u==null?void 0:u.blockletComponents,u==null?void 0:u.uploadedResource,O]),ce=[],oe=((a==null?void 0:a.children)||[]).filter(D=>{var _;return(_=D.meta.resource)==null?void 0:_.exportApi}).filter(D=>!c||D.meta.did===c);oe.forEach(D=>{u3({tabs:ce,blocklet:D,t:i,ancestors:[a]})});const[ee,ie]=R.useState((K1=ce[0])==null?void 0:K1.value),fe=!N&&(d==null?void 0:d.status)==="published",Q=fe,xe=C2(()=>{if(!e)return;M(e.searchParams.get("logo")),f(_=>{var Ce;return{..._,blockletTitle:(_==null?void 0:_.blockletTitle)||e.searchParams.get("title"),blockletDescription:(_==null?void 0:_.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(_==null?void 0:_.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=_==null?void 0:_.blockletComponents)!=null&&Ce.length?_==null?void 0:_.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(_==null?void 0:_.note)||e.searchParams.get("note")||"No note"}});const D=e.searchParams.get("resources");try{const _=JSON.parse(D);S(_)}catch{}}),q=async()=>{if(W)try{const D=await b.getRelease({input:{did:a.meta.did,projectId:l,releaseId:W}});if(p(!1),!D.release){$.error("Release not found");return}D.release=r2(D.release),s!=="view"&&(D.release.note=""),f(_=>x0({..._,...D.release,blockletVersion:s==="create"||s==="new-release"?Le.inc(D.release.blockletVersion,"patch"):D.release.blockletVersion},a)),m(D.release)}catch(D){p(!1),$.error(Ne(D))}},le=async()=>{if(l===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){$.error(i("blocklet.publish.errorTip.noDid"));return}try{const _=(await b.getProject({input:{did:a.meta.did,projectId:l}})).project||{};_.blockletVersion?(s==="create"||s==="new-release")&&Le.valid(_.blockletVersion)&&(_.blockletVersion=Le.inc(_.blockletVersion,"patch")):_.blockletVersion="1.0.0";const Ce=x0(_,a);f(Ce),_.lastReleaseId||xe()}catch(D){$.error(Ne(D))}},H=R.useCallback(async()=>{p(!0);try{if(s==="view"){if(!W){$.error("Empty release id");return}await le(),await q();return}await le(),W&&(T(!0),await q())}finally{p(!1)}},[s,W]),Ke=D=>{f({blockletComponents:D})};R.useEffect(()=>{H()},[H]),R.useEffect(()=>{l===X.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const _e=R.useMemo(()=>!!Object.keys(I).find(D=>!!I[D].length),[I]);if(!u&&y)return o.jsx(Ie,{});if(!u)return null;const Ee=oe.find(D=>D.meta.did===ee);if(oe.every(D=>D.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const Xe=D=>{ie(D)},F=e==null?void 0:e.searchParams.get("resourcesTitle"),Y=e==null?void 0:e.searchParams.get("componentsTitle"),de=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:F||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Y||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=de[Z]||de[de.length-1],Re=p3[Z];return o.jsxs(h3,{...t,children:[o.jsx(t2,{blocklet:a,release:d,getData:H,getRelease:q,mode:s,params:u,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:fe,loading:y,setLoading:p,initLogoUrl:V,releaseId:W,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:k,resourceRelateComponents:O,resourceItem:Ee,saveSelectedEventsRef:P,hasSelectedResources:_e,releaseUsedLast:N,setReleaseUsedLast:T,setRelease:m}),o.jsxs(z,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(z,{pt:3}),o.jsxs(z,{sx:{gap:3},display:"flex",flexDirection:v?"column":"row",children:[!v&&o.jsx(s2,{steps:de,loading:y,viewMode:s==="view",params:u,hasSelectedResources:_e||u.uploadedResource,paramsErrTip:x,activeStep:Z,setActiveStep:Me,projectId:l,resourcesUrlTitle:F,componentsUrlTitle:Y}),o.jsxs(z,{flex:"1",maxWidth:"720px",children:[!v&&Re!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(z,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(P2,{})})})]}),(v||Re==="branding")&&o.jsx(z,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:g,params:u,componentDid:c,blocklet:a,initUrl:e,loading:y,setLoading:p,paramsErrTip:x,readOnly:Q,initLogoUrl:V,setInitLogoUrl:M})}),v&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(v||Re==="introduction")&&o.jsx(z,{display:"flex",flexDirection:"column",sx:{mt:v?5:0,width:"100%"},children:o.jsx(l2,{loading:y,readOnly:Q,params:u,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.resources].label}),o.jsx(z,{display:v||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(z,{sx:{flex:1},children:[o.jsxs(et,{onChange:()=>f({resourceFromSelect:!u.resourceFromSelect}),children:[o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:u.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(p1,{value:"select",disabled:Q,control:o.jsx(t0,{size:"small",checked:!u.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),u.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(T2,{tabs:ce,current:ee,onChange:Xe,sx:{ml:-2,mt:2,maxWidth:v?window.innerWidth-24:"100%"}}),o.jsx(O1,{loading:y,initialResources:C,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:J,setResourceComponentsMap:K,error:x.blockletResource,app:a,readOnly:Q,component:Ee,componentDid:c,initUrl:e,params:u,setParams:f,projectId:l===X.UNOWNED_DID?"":l,releaseUsedLast:N,release:{...d,id:W}})]}),!u.resourceFromSelect&&o.jsx(W1,{app:a,readOnly:Q,projectId:l===X.UNOWNED_DID?"":l,params:u,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),v&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:de[m0.blocklets].label}),(v||Re==="blocklets")&&o.jsx(z,{flexDirection:"column",children:o.jsx(z,{display:"flex",mt:3,className:"section full-width",children:o.jsx(z,{sx:{flex:1},children:o.jsx(N1,{projectType:he,disabled:y||Q,app:a,value:(u==null?void 0:u.blockletComponents)||[],onChange:Ke,resourceRelateComponents:O,dependentComponentsMode:E})})})}),!v&&Re==="version"&&o.jsx(z,{flexDirection:"column",children:o.jsx(o1,{loading:y,params:u,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}G1.propTypes={initUrl:h.object};G1.defaultProps={initUrl:null};const h3=ae.div`
182
182
  .section {
183
183
  &.full-width {
184
184
  max-width: 100%;
@@ -1 +1 @@
1
- import{aE as $,aF as x,aG as d,aH as e,ck as k,ce as y,cd as m,r as C,aI as M,aJ as z,aK as l,j as s,aM as j,aN as R,bt as B,P as E}from"./index-fpoxcuML.js";import{S as T,F as N}from"./FormControlLabel-DXsQRQXS.js";function P(t){return x("MuiSwitch",t)}const o=$("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),D=["className","color","edge","size","sx"],I=t=>{const{classes:a,edge:i,size:r,color:p,checked:u,disabled:h}=t,g={root:["root",i&&`edge${e(i)}`,`size${e(r)}`],switchBase:["switchBase",`color${e(p)}`,u&&"checked",h&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},b=R(g,P,a);return l({},a,b)},O=d("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:i}=t;return[a.root,i.edge&&a[`edge${e(i.edge)}`],a[`size${e(i.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${o.thumb}`]:{width:16,height:16},[`& .${o.switchBase}`]:{padding:4,[`&.${o.checked}`]:{transform:"translateX(16px)"}}}}]}),_=d(T,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:i}=t;return[a.switchBase,{[`& .${o.input}`]:a.input},i.color!=="default"&&a[`color${e(i.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${o.checked}`]:{transform:"translateX(20px)"},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${o.checked} + .${o.track}`]:{opacity:.5},[`&.${o.disabled} + .${o.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${o.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:k(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{color:a},style:{[`&.${o.checked}`]:{color:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[a].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:k(t.palette[a].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${a}DisabledColor`]:`${t.palette.mode==="light"?y(t.palette[a].main,.62):m(t.palette[a].main,.55)}`}},[`&.${o.checked} + .${o.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]})),A=d("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,a)=>a.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),U=d("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,a)=>a.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),F=C.forwardRef(function(a,i){const r=M({props:a,name:"MuiSwitch"}),{className:p,color:u="primary",edge:h=!1,size:g="medium",sx:b}=r,f=z(r,D),c=l({},r,{color:u,edge:h,size:g}),n=I(c),w=s.jsx(U,{className:n.thumb,ownerState:c});return s.jsxs(O,{className:j(n.root,p),sx:b,ownerState:c,children:[s.jsx(_,l({type:"checkbox",icon:w,checkedIcon:w,ref:i,ownerState:c},f,{classes:l({},n,{root:n.switchBase})})),s.jsx(A,{className:n.track,ownerState:c})]})}),v=B(t=>s.jsx(F,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.mode==="dark"?"#2ECA45":"#65C466",opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:"#33cf4d",border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.mode==="light"?"#E9E9EA":"#39393D",opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function S({labelProps:t,...a}){return t?s.jsx(N,{control:s.jsx(v,{...a}),...t}):s.jsx(v,{...a})}S.propTypes={labelProps:E.object};S.defaultProps={labelProps:null};export{S,F as a};
1
+ import{aE as $,aF as x,aG as d,aH as e,ck as k,ce as y,cd as m,r as C,aI as M,aJ as z,aK as l,j as s,aM as j,aN as R,bt as B,P as E}from"./index-BaC4EhQh.js";import{S as T,F as N}from"./FormControlLabel-BJXWJJky.js";function P(t){return x("MuiSwitch",t)}const o=$("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),D=["className","color","edge","size","sx"],I=t=>{const{classes:a,edge:i,size:r,color:p,checked:u,disabled:h}=t,g={root:["root",i&&`edge${e(i)}`,`size${e(r)}`],switchBase:["switchBase",`color${e(p)}`,u&&"checked",h&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},b=R(g,P,a);return l({},a,b)},O=d("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:i}=t;return[a.root,i.edge&&a[`edge${e(i.edge)}`],a[`size${e(i.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${o.thumb}`]:{width:16,height:16},[`& .${o.switchBase}`]:{padding:4,[`&.${o.checked}`]:{transform:"translateX(16px)"}}}}]}),_=d(T,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,a)=>{const{ownerState:i}=t;return[a.switchBase,{[`& .${o.input}`]:a.input},i.color!=="default"&&a[`color${e(i.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${o.checked}`]:{transform:"translateX(20px)"},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${o.checked} + .${o.track}`]:{opacity:.5},[`&.${o.disabled} + .${o.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${o.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:k(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{color:a},style:{[`&.${o.checked}`]:{color:(t.vars||t).palette[a].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[a].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:k(t.palette[a].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${o.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${a}DisabledColor`]:`${t.palette.mode==="light"?y(t.palette[a].main,.62):m(t.palette[a].main,.55)}`}},[`&.${o.checked} + .${o.track}`]:{backgroundColor:(t.vars||t).palette[a].main}}}))]})),A=d("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,a)=>a.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),U=d("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,a)=>a.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),F=C.forwardRef(function(a,i){const r=M({props:a,name:"MuiSwitch"}),{className:p,color:u="primary",edge:h=!1,size:g="medium",sx:b}=r,f=z(r,D),c=l({},r,{color:u,edge:h,size:g}),n=I(c),w=s.jsx(U,{className:n.thumb,ownerState:c});return s.jsxs(O,{className:j(n.root,p),sx:b,ownerState:c,children:[s.jsx(_,l({type:"checkbox",icon:w,checkedIcon:w,ref:i,ownerState:c},f,{classes:l({},n,{root:n.switchBase})})),s.jsx(A,{className:n.track,ownerState:c})]})}),v=B(t=>s.jsx(F,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.mode==="dark"?"#2ECA45":"#65C466",opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:"#33cf4d",border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.mode==="light"?"#E9E9EA":"#39393D",opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function S({labelProps:t,...a}){return t?s.jsx(N,{control:s.jsx(v,{...a}),...t}):s.jsx(v,{...a})}S.propTypes={labelProps:E.object};S.defaultProps={labelProps:null};export{S,F as a};
@@ -1 +1 @@
1
- import{d as A,v as R,p as w,e as p}from"./index-Be2wLDD2.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
1
+ import{d as A,v as R,p as w,e as p}from"./index-BrFlqDrV.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
@@ -1,4 +1,4 @@
1
- import{r as h,a0 as g,aY as y,j as t,C as P,n as v,B as c,a1 as d,P as m,Z as w}from"./index-fpoxcuML.js";import{P as T}from"./page-header-D6emPvgS.js";import{u as B}from"./index-CmriykVM.js";import{C as E,D,a as N}from"./connect-to-CTihUmuN.js";import{S as u}from"./step-actions-DvJ3jG2s.js";import{S as b}from"./layout-D4J5Y79b.js";import"./spaces-Dv5sTFBl.js";import"./index-CMg55b21.js";import"./api-BdPs8cnO.js";import"./url-join-Cc5BAZ2e.js";import"./Skeleton-D5U61zVB.js";import"./Hidden-qI_JwCnJ.js";import"./use-blocklet-info-for-connect-did-spaces-Dro42um_.js";import"./CloseOutlined-IVnREWlC.js";import"./did-address-Bye61gv9.js";import"./Link-Bi0x7esG.js";import"./DeleteOutline-CZQhsml4.js";import"./format-error-BOfFwKPG.js";import"./index-B-Fz2GNJ.js";import"./ExpandMore-DUJJgQvW.js";import"./ButtonGroup-ailEu1Nr.js";import"./DialogContentText-ClisAi23.js";import"./TextField-qwbmqJ_2.js";import"./FormControl-DFtCJG5u.js";import"./useFormControl-CQ_7pr9i.js";import"./InputLabel-BvnZs665.js";import"./Select-BeArBHJP.js";import"./Alert-CeGhMuEg.js";import"./useSlot-GRhp-924.js";import"./content-layout-DYHA2DoT.js";function l({onNext:r,onPrevious:x}){var s,n,p;const{t:e}=h.useContext(g),{blocklet:i}=y(),{spaceGateway:C,settingStorageEndpoint:j,updateSpaceGateway:f,hasStorageEndpoint:S,loading:o,storageEndpoint:a}=B();return o?t.jsx(P,{relative:"parent",children:t.jsx(v,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(T,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(E,{spaceGateway:C,settingStorageEndpoint:j}):t.jsx(D,{})}),((s=i==null?void 0:i.capabilities)==null?void 0:s.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:f,storageEndpoint:a})}),((n=i==null?void 0:i.capabilities)==null?void 0:n.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(d,{loading:o,variant:"contained",disabled:o||!a,onClick:()=>r(),children:e("setup.continue")})}),((p=i==null?void 0:i.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:i,onStartNow:()=>r("complete"),children:t.jsx(d,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>r(),children:e(a?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:m.func,onPrevious:m.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=w(b)`
1
+ import{r as h,a0 as g,aY as y,j as t,C as P,n as v,B as c,a1 as d,P as m,Z as w}from"./index-BaC4EhQh.js";import{P as T}from"./page-header-DZBo2jY4.js";import{u as B}from"./index-CbBjirNE.js";import{C as E,D,a as N}from"./connect-to-D6gkq_5F.js";import{S as u}from"./step-actions-B1vsf_QO.js";import{S as b}from"./layout-C1fJ0PwQ.js";import"./spaces-DPfrZKXe.js";import"./index-CD6yQnY4.js";import"./api-DUETbHv8.js";import"./url-join-D5TK65dM.js";import"./Skeleton-D6pzHOGJ.js";import"./Hidden-Bg6BPxEd.js";import"./use-blocklet-info-for-connect-did-spaces-DaNxIRBj.js";import"./CloseOutlined-OBzuC30j.js";import"./did-address-DNmiCCjI.js";import"./Link-CiVKLn7B.js";import"./DeleteOutline-DKoxIRL9.js";import"./format-error-C43xGCjC.js";import"./index-BlvJrvQX.js";import"./ExpandMore-BgcTT2Bb.js";import"./ButtonGroup-zMm3edlK.js";import"./DialogContentText-BnQAOkxN.js";import"./TextField-DvTYZ6EA.js";import"./FormControl-D00yHDcj.js";import"./useFormControl-CAWQrhew.js";import"./InputLabel-BaHBEVm2.js";import"./Select-_ZzhxUOz.js";import"./Alert-DDr4PUmN.js";import"./useSlot-nO86v-Bn.js";import"./content-layout-9pObqqwC.js";function l({onNext:r,onPrevious:x}){var s,n,p;const{t:e}=h.useContext(g),{blocklet:i}=y(),{spaceGateway:C,settingStorageEndpoint:j,updateSpaceGateway:f,hasStorageEndpoint:S,loading:o,storageEndpoint:a}=B();return o?t.jsx(P,{relative:"parent",children:t.jsx(v,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(T,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:S?t.jsx(E,{spaceGateway:C,settingStorageEndpoint:j}):t.jsx(D,{})}),((s=i==null?void 0:i.capabilities)==null?void 0:s.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(N,{onConnect:f,storageEndpoint:a})}),((n=i==null?void 0:i.capabilities)==null?void 0:n.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(d,{loading:o,variant:"contained",disabled:o||!a,onClick:()=>r(),children:e("setup.continue")})}),((p=i==null?void 0:i.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:i,onStartNow:()=>r("complete"),children:t.jsx(d,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>r(),children:e(a?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:m.func,onPrevious:m.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=w(b)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  `;export{l as default};
@@ -1,4 +1,4 @@
1
- import{b7 as c}from"./index-fpoxcuML.js";var i={exports:{}};/*!
1
+ import{b7 as c}from"./index-BaC4EhQh.js";var i={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames