@abtnode/blocklet-services 1.17.7 → 1.17.8-beta-20260104-120132-cb5b1914

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 (153) hide show
  1. package/api/routes/blocklet.js +26 -2
  2. package/api/util/blocklet-utils.js +15 -0
  3. package/dist/assets/{AdapterDayjs-CIz_EOtQ.js → AdapterDayjs-DyRP0A_7.js} +1 -1
  4. package/dist/assets/{Google-UUKF9aLU.js → Google-Bjq5o7qL.js} +1 -1
  5. package/dist/assets/{access-control-BvVaKG93.js → access-control-Cv1j0YWJ.js} +1 -1
  6. package/dist/assets/{add-component-core-DuwLtUBl.js → add-component-core-8nx00xJP.js} +1 -1
  7. package/dist/assets/{add-resource-DSF4-AYI.js → add-resource-B3-VwSQg.js} +1 -1
  8. package/dist/assets/{addon-CAO5ZUVe.js → addon-DckWyYy3.js} +1 -1
  9. package/dist/assets/{advanced-D-_qy4C4.js → advanced-BcLdGbJh.js} +1 -1
  10. package/dist/assets/{aigne-B-7qxD7r.js → aigne-Dehkd-7B.js} +1 -1
  11. package/dist/assets/{appearance-DpKwY0o1.js → appearance-CkrEEbhp.js} +1 -1
  12. package/dist/assets/{audit-logs-BW1TvN0z.js → audit-logs-XPxQHo2y.js} +1 -1
  13. package/dist/assets/{authorize-BwNdnPft.js → authorize-ByHCjaXS.js} +1 -1
  14. package/dist/assets/{base32-CmNHdxL7.js → base32-BPZDlXZz.js} +1 -1
  15. package/dist/assets/{bind-account-DOG2XJ6s.js → bind-account-DtN3r3bu.js} +1 -1
  16. package/dist/assets/{branding-lvlhWE2R.js → branding-Aq4o2tjp.js} +1 -1
  17. package/dist/assets/{branding-40UKivXV.js → branding-CBzX3Xum.js} +1 -1
  18. package/dist/assets/{branding-CUwzFTtf.js → branding-khY0G2TO.js} +1 -1
  19. package/dist/assets/{bundle-avatar-DJ_-4AO_.js → bundle-avatar-Dtpi1uSw.js} +1 -1
  20. package/dist/assets/{button-82FUWQ2H.js → button-D6aVYj2n.js} +1 -1
  21. package/dist/assets/{click-to-copy-CBd8B_uk.js → click-to-copy-BEM1P78p.js} +1 -1
  22. package/dist/assets/{complete-DCZaPQL5.js → complete-CuyAiV3B.js} +1 -1
  23. package/dist/assets/{component-CIlZ9gz_.js → component-nxxcEAFR.js} +2 -2
  24. package/dist/assets/{config-DCwReZ_J.js → config-DOcJbRFr.js} +1 -1
  25. package/dist/assets/{config-BFSglxmm.js → config-DweHAJPq.js} +2 -2
  26. package/dist/assets/{config-Dzr61Ovu.js → config-n9Go4CIg.js} +1 -1
  27. package/dist/assets/{config-navigation-D47x55_t.js → config-navigation-BG6durqz.js} +2 -2
  28. package/dist/assets/{config-space-D2mAEqFL.js → config-space-DNGDnW7P.js} +1 -1
  29. package/dist/assets/{confirm-DQlu79Sm.js → confirm-BRnYfcDD.js} +1 -1
  30. package/dist/assets/{connect-Dd7NRVCL.js → connect-B84DSta0.js} +1 -1
  31. package/dist/assets/{connect-II0vWvpi.js → connect-CmaOf6IU.js} +1 -1
  32. package/dist/assets/{connect-to-B_iWUbwW.js → connect-to-BEfFI4oa.js} +1 -1
  33. package/dist/assets/{create-passport-svg-BwkPTICE.js → create-passport-svg-BKhJ2ufW.js} +1 -1
  34. package/dist/assets/{createClass-DVDZaC6q.js → createClass-DXSToV70.js} +1 -1
  35. package/dist/assets/{dashboard-Bu3a5Px4.js → dashboard-CDOqgUmx.js} +5 -5
  36. package/dist/assets/{delete-confirm-BIuv3oO4.js → delete-confirm-1vzcMsM2.js} +1 -1
  37. package/dist/assets/{did-address-h4uLp20A.js → did-address-B3eXeL7H.js} +1 -1
  38. package/dist/assets/{domain--lKnmb8L.js → domain-D75xKDoP.js} +1 -1
  39. package/dist/assets/{domain-action-card-B5bWcTCx.js → domain-action-card-BgDPfYMr.js} +1 -1
  40. package/dist/assets/{domains-DTnBb4pb.js → domains-BmgTqdar.js} +1 -1
  41. package/dist/assets/{email-bOQg3Ln3.js → email-0rfuUid8.js} +2 -2
  42. package/dist/assets/engine-D-_cbl3F.js +1 -0
  43. package/dist/assets/exchange-passport-DtpDKfXH.js +1 -0
  44. package/dist/assets/{form-DcGl-E0U.js → form-BblKAylu.js} +1 -1
  45. package/dist/assets/{form-text-input-DNXpKwew.js → form-text-input-C-JBHNfU.js} +1 -1
  46. package/dist/assets/{fuel-tsazXQKp.js → fuel-BPg61IpB.js} +1 -1
  47. package/dist/assets/{gen-access-key-DrfFQLFL.js → gen-access-key-B-PvqBv6.js} +1 -1
  48. package/dist/assets/{gen-simple-access-key-CnP2yUd7.js → gen-simple-access-key-BRpJnjDR.js} +1 -1
  49. package/dist/assets/get-safe-url-xl2OarvZ.js +1 -0
  50. package/dist/assets/{home-BN59HeAP.js → home-CT38dHBL.js} +1 -1
  51. package/dist/assets/{iframe-CC7bnIjL.js → iframe-D119MMHU.js} +1 -1
  52. package/dist/assets/{index-Bc7P9fwl.js → index-8bzrOXqv.js} +1 -1
  53. package/dist/assets/{index-BORuOqqa.js → index-BMtr5-CV.js} +1 -1
  54. package/dist/assets/{index-BmeJ3mXz.js → index-BNAs76qj.js} +1 -1
  55. package/dist/assets/{index-55ZI5Xlz.js → index-BODmBNkm.js} +1 -1
  56. package/dist/assets/{index-CLao_b9r.js → index-BWCHnVga.js} +1 -1
  57. package/dist/assets/{index-DJEbIkF6.js → index-BcIeEF3v.js} +1 -1
  58. package/dist/assets/{index-ByMKy0IO.js → index-BpWFE-ry.js} +1 -1
  59. package/dist/assets/{index-DPByvHrj.js → index-C6oxUE_X.js} +6 -6
  60. package/dist/assets/{index-5n0QAOjO.js → index-CGrk0HiP.js} +1 -1
  61. package/dist/assets/{index-CoWxyxJt.js → index-CIC0R_Qc.js} +1 -1
  62. package/dist/assets/{index-keEY0SLH.js → index-CSCCjNba.js} +1 -1
  63. package/dist/assets/{index-DlTghgU6.js → index-CfA9D2iF.js} +1 -1
  64. package/dist/assets/{index-mL2PjDd3.js → index-D1f4dwYF.js} +3 -3
  65. package/dist/assets/{index-CNUfol2K.js → index-DGbr3NAq.js} +1 -1
  66. package/dist/assets/{index-H8MAN7us.js → index-DSVwCr5p.js} +2 -2
  67. package/dist/assets/{index-DZyT0N9R.js → index-DUo9jXH_.js} +1 -1
  68. package/dist/assets/{index-CXyo5mo3.js → index-DcjD74XY.js} +1 -1
  69. package/dist/assets/{index-D4cbtlCM.js → index-DdojJXSn.js} +2 -2
  70. package/dist/assets/{index-ETdrsXsn.js → index-DoDx-vpV.js} +2 -2
  71. package/dist/assets/{index-D3AsXyHs.js → index-E4Hos_Sx.js} +5 -5
  72. package/dist/assets/{index-DG0EDext.js → index-NWCpUGtr.js} +76 -76
  73. package/dist/assets/{index-DMjWlw40.js → index-OTENuoZ0.js} +1 -1
  74. package/dist/assets/{index-ByEZTgqv.js → index-TG3kf9io.js} +1 -1
  75. package/dist/assets/{index-CH-EXqMX.js → index-TzwTiNQ7.js} +1 -1
  76. package/dist/assets/{index-BJ6le4Td.js → index-VaUGnCuU.js} +1 -1
  77. package/dist/assets/{index-JhIOETr8.js → index-arhRQhsc.js} +1 -1
  78. package/dist/assets/{index-Bg5uZrWj.js → index-bCC4mzZc.js} +1 -1
  79. package/dist/assets/{index-CbjFdIdE.js → index-sBtfsjBo.js} +1 -1
  80. package/dist/assets/{index-BDmLm9RE.js → index-tfYDa2i6.js} +1 -1
  81. package/dist/assets/{index-D0cfNfgL.js → index-uODjznr3.js} +1 -1
  82. package/dist/assets/{invitation-0lU4EchQ.js → invitation-CVulfNR5.js} +4 -4
  83. package/dist/assets/{invitations-CSnyD-Wp.js → invitations-CuhR5Qhr.js} +1 -1
  84. package/dist/assets/invite-uHE_P5fP.js +1 -0
  85. package/dist/assets/{isURL-D4WfF4w_.js → isURL-CRZ7iI7F.js} +1 -1
  86. package/dist/assets/issue-passport-CgdZdVEa.js +1 -0
  87. package/dist/assets/{item-CwiqvF0e.js → item-BJSHAMwK.js} +1 -1
  88. package/dist/assets/{landing-page-q4NMkyjD.js → landing-page-Bu1ZaLGu.js} +1 -1
  89. package/dist/assets/{layout-CdGgFfY4.js → layout-D9M0eiNw.js} +1 -1
  90. package/dist/assets/{list-NP-91JKf.js → list-BYNjj68R.js} +1 -1
  91. package/dist/assets/{list-CVN6FKdL.js → list-DVUI92a2.js} +1 -1
  92. package/dist/assets/localization-CZX-M3IK.js +1 -0
  93. package/dist/assets/{log-Cox3P5_L.js → log-DbdNMVuv.js} +1 -1
  94. package/dist/assets/logger-Biwe4SzB.js +1 -0
  95. package/dist/assets/{login-2zmJhcBe.js → login-DUYsZ42N.js} +1 -1
  96. package/dist/assets/{login-oauth-callback-zq4hRJXC.js → login-oauth-callback-RLp-7ubu.js} +1 -1
  97. package/dist/assets/{logo-uploader-6T6d75Q6.js → logo-uploader-BFMnNkRn.js} +1 -1
  98. package/dist/assets/{lost-passport-DviehTF2.js → lost-passport-CB5SFq30.js} +1 -1
  99. package/dist/assets/{open-window-_3kVydQ2.js → open-window-xMdq1GjU.js} +1 -1
  100. package/dist/assets/{over-due-invoice-payment-rAHkUVgY.js → over-due-invoice-payment-DvKFY6t9.js} +1 -1
  101. package/dist/assets/{overview-DSB1dlE4.js → overview-DNVfcZQO.js} +2 -2
  102. package/dist/assets/{passport-DzlmGAGE.js → passport-BNRZfcVH.js} +1 -1
  103. package/dist/assets/{passport-item-DdvT-U5C.js → passport-item-Bf_kXmId.js} +1 -1
  104. package/dist/assets/{permission-CcdJMHov.js → permission-C0rLyhnq.js} +1 -1
  105. package/dist/assets/{preferences-B3FTkTJx.js → preferences-XGJx_7ht.js} +1 -1
  106. package/dist/assets/{profile-embed-Ds6zLGgv.js → profile-embed-DROgyynT.js} +1 -1
  107. package/dist/assets/{publish-resource-CAbbkAX0.js → publish-resource-C3tnQoPG.js} +1 -1
  108. package/dist/assets/{react-beautiful-dnd.esm-DDZ1XDH7.js → react-beautiful-dnd.esm-BZjy3RlT.js} +1 -1
  109. package/dist/assets/{runtime-BKJMYAui.js → runtime-DiEn6rZ9.js} +1 -1
  110. package/dist/assets/sdk-C45BrgFy.js +1 -0
  111. package/dist/assets/{security-3Y4MabOo.js → security-Ch3TxRbd.js} +1 -1
  112. package/dist/assets/{session-D-wwXXFW.js → session-5s-U-ruq.js} +1 -1
  113. package/dist/assets/{setup-CgcKBlmf.js → setup-DgF_JFoX.js} +1 -1
  114. package/dist/assets/{simple-select-qqtCC0US.js → simple-select-EppOca29.js} +1 -1
  115. package/dist/assets/{spaces-DGJd1uEt.js → spaces-BE9CZzeJ.js} +1 -1
  116. package/dist/assets/{start-Cu_Xr7Yd.js → start-D6EkscL8.js} +1 -1
  117. package/dist/assets/{starting-progress-DpUpXo1N.js → starting-progress-MyalFKYG.js} +2 -2
  118. package/dist/assets/{status-qiMZo73y.js → status-vSa6pwrP.js} +1 -1
  119. package/dist/assets/{step-actions-BKMeYA5x.js → step-actions-X2c_czAD.js} +1 -1
  120. package/dist/assets/{studio-BzkFXY4W.js → studio-BcQoXvqZ.js} +1 -1
  121. package/dist/assets/{switch-CWBW7iKo.js → switch-BjA8SIAh.js} +1 -1
  122. package/dist/assets/{switch-control-D9D8FbX3.js → switch-control-D2RiXLWV.js} +1 -1
  123. package/dist/assets/{table-tips-B9_goTLn.js → table-tips-Dgzi4H1y.js} +1 -1
  124. package/dist/assets/{team-DvyWlb8W.js → team-D9lFN8Pe.js} +1 -1
  125. package/dist/assets/{traffic-DsUQQR3F.js → traffic-CvgJe_3z.js} +1 -1
  126. package/dist/assets/transfer-IRaap94c.js +16 -0
  127. package/dist/assets/{unsubscribe-DpfMHut2.js → unsubscribe-7WUPZn-b.js} +1 -1
  128. package/dist/assets/{use-app-logo-BKJ912HX.js → use-app-logo-Cfo-T8ZY.js} +1 -1
  129. package/dist/assets/{use-window-close-BVOSCf9h.js → use-window-close-4WCUBrSc.js} +1 -1
  130. package/dist/assets/{useLocalStorage-BmGa-RG8.js → useLocalStorage-Cl1rEjxs.js} +1 -1
  131. package/dist/assets/{user-center-8NTN-2CY.js → user-center-BoGQKLvn.js} +1 -1
  132. package/dist/assets/{user-follower-C-xe6Fqb.js → user-follower-D8NzTP2C.js} +1 -1
  133. package/dist/assets/{util-CznlXimv.js → util-BNGEGQGN.js} +1 -1
  134. package/dist/assets/{util-DQmPydCJ.js → util-CDBgZOAd.js} +1 -1
  135. package/dist/assets/{vendor-arcblock-DyliHtVF.js → vendor-arcblock-B1iA4v4a.js} +1 -1
  136. package/dist/assets/{vendor-ux-IiqHAjMq.js → vendor-ux-jvAfFAl1.js} +2 -2
  137. package/dist/assets/{wait-connect-Co7Po2HJ.js → wait-connect-VFnD4S6k.js} +1 -1
  138. package/dist/assets/{wizard-tGxr6THv.js → wizard-D6nEp8xR.js} +1 -1
  139. package/dist/assets/{wizard-components-qCiwxNk8.js → wizard-components-CQAhuCn-.js} +1 -1
  140. package/dist/assets/wrap-locale-qgV7mOv6.js +1 -0
  141. package/dist/assets/{zh-DL3Su93_.js → zh-LGxmNDus.js} +1 -1
  142. package/dist/index.html +1 -1
  143. package/package.json +36 -36
  144. package/dist/assets/engine-_hdQizRi.js +0 -1
  145. package/dist/assets/exchange-passport-B8J1z6zW.js +0 -1
  146. package/dist/assets/get-safe-url-DaqBo3hv.js +0 -1
  147. package/dist/assets/invite-8i_Oru_O.js +0 -1
  148. package/dist/assets/issue-passport-Br15qs7n.js +0 -1
  149. package/dist/assets/localization-DAE0Xt60.js +0 -1
  150. package/dist/assets/logger-BKK0qIc9.js +0 -1
  151. package/dist/assets/sdk-DkjNLRKY.js +0 -1
  152. package/dist/assets/transfer-BU2gLE9m.js +0 -16
  153. package/dist/assets/wrap-locale-BdDblHwV.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a,D as M,T as _,cg as T,Q as W,ch as q,aV as X,ak as h,ci as Y,aU as Z,av as B,f as C,cj as J,ck as K}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,i as L,L as z,n as ee,o as ae}from"./vendor-react-CTtPmzVP.js";import{H as E,b5 as te}from"./index-DG0EDext.js";import{e as ie}from"./vendor-hooks-qxhUUbW5.js";import{M as re,l as m,b4 as A,b5 as S}from"./vendor-ux-IiqHAjMq.js";import{z as oe}from"./vendor-arcblock-DyliHtVF.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
1
+ import{j as a,D as M,T as _,cg as T,Q as W,ch as q,aV as X,ak as h,ci as Y,aU as Z,av as B,f as C,cj as J,ck as K}from"./vendor-mui-core-DnR6WYuU.js";import{r as d,i as L,L as z,n as ee,o as ae}from"./vendor-react-CTtPmzVP.js";import{H as E,b5 as te}from"./index-NWCpUGtr.js";import{e as ie}from"./vendor-hooks-qxhUUbW5.js";import{M as re,l as m,b4 as A,b5 as S}from"./vendor-ux-jvAfFAl1.js";import{z as oe}from"./vendor-arcblock-B1iA4v4a.js";const H=d.createContext(null),se=e=>{const i=d.use(H);return d.useLayoutEffect(()=>{},[]),i};function le({children:e=void 0,...i}){const[t,r]=d.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),s=()=>{r(o=>({...o,inFullPage:!o.inFullPage}))},l=d.useMemo(()=>({...t,headerVisible:!t.inFullPage||t.headerVisibleInFullPage,footerVisible:!t.inFullPage||t.footerVisibleInFullPage,sidebarVisible:!t.inFullPage||t.sidebarVisibleInFullPage,toggleFullPage:s,configure:o=>r(n=>({...n,...o}))}),[t]);return a.jsx(H,{value:l,...i,children:e})}function ne({name:e,size:i=36,alt:t="",color:r="#000000",prefix:s="/images",showBadge:l=!1,style:o={},...n}){const c=`${s}/${e}-${r.replace(/^#/,"")}.png`;return a.jsxs(de,{style:{width:i,height:i},children:[a.jsx(re,{width:i,height:i,alt:t||e,src:c,style:Object.assign({width:i},o),...n}),l&&a.jsx("i",{className:"badge-point"})]})}const de=m("div")`
2
2
  position: relative;
3
3
  .badge-point {
4
4
  position: absolute;
@@ -1,4 +1,4 @@
1
- import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DnR6WYuU.js";import{r as h}from"./vendor-react-CTtPmzVP.js";import{aU as S,w as p}from"./vendor-ux-IiqHAjMq.js";import{a as C}from"./page-header-CHAwrgX-.js";import{Y as g}from"./index-DG0EDext.js";import{o as b}from"./vendor-arcblock-DyliHtVF.js";import{u as k}from"./config-space-D2mAEqFL.js";import{C as y,D as w,a as v}from"./connect-to-B_iWUbwW.js";import{S as c}from"./step-actions-BKMeYA5x.js";import{S as E}from"./layout-CdGgFfY4.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./spaces-DGJd1uEt.js";import"./api-FQQlzPOP.js";import"./index-D4cbtlCM.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-ByMKy0IO.js";import"./index-DBs9Ljax.js";import"./use-mobile-D5clNlrm.js";import"./content-layout-DmSBGGVm.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(w,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(v,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
1
+ import{j as t,a6 as f,ak as r,at as j,W as n}from"./vendor-mui-core-DnR6WYuU.js";import{r as h}from"./vendor-react-CTtPmzVP.js";import{aU as S,w as p}from"./vendor-ux-jvAfFAl1.js";import{a as C}from"./page-header-CHAwrgX-.js";import{Y as g}from"./index-NWCpUGtr.js";import{o as b}from"./vendor-arcblock-B1iA4v4a.js";import{u as k}from"./config-space-DNGDnW7P.js";import{C as y,D as w,a as v}from"./connect-to-BEfFI4oa.js";import{S as c}from"./step-actions-X2c_czAD.js";import{S as E}from"./layout-D9M0eiNw.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./spaces-BE9CZzeJ.js";import"./api-FQQlzPOP.js";import"./index-DdojJXSn.js";import"./index-DRYJ0xIl.js";import"./index-BojVbZw0.js";import"./index-BpWFE-ry.js";import"./index-DBs9Ljax.js";import"./use-mobile-D5clNlrm.js";import"./content-layout-DmSBGGVm.js";function T({onNext:a=()=>{},onPrevious:d=()=>{}}){const{t:e}=h.useContext(S),{blocklet:o}=g(),{spaceGateway:m,settingStorageEndpoint:l,updateSpaceGateway:u,hasStorageEndpoint:x,loading:i,storageEndpoint:s}=k();return i?t.jsx(b,{relative:"parent",children:t.jsx(f,{})}):t.jsxs(B,{children:[t.jsx("div",{className:"header",children:t.jsx(C,{title:e("setup.didSpace.title"),subTitle:e("setup.didSpace.subTitle"),onClickBack:d})}),t.jsxs(r,{className:"form-container",sx:{width:"100%",maxWidth:"720px"},children:[x?t.jsx(y,{spaceGateway:m,settingStorageEndpoint:l}):t.jsx(w,{}),o?.capabilities?.didSpace&&t.jsx(r,{sx:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px"},children:t.jsx(v,{onConnect:u,storageEndpoint:s})})]}),o?.capabilities?.didSpace==="required"&&t.jsx(c,{mt:8,children:t.jsx(p,{loading:i,variant:"contained",disabled:i||!s,onClick:()=>a(),children:e("setup.continue")})}),o?.capabilities?.didSpace==="optional"&&t.jsx(c,{blocklet:o,onStartNow:()=>a("complete"),children:t.jsx(p,{className:"start-now",loading:i,variant:"contained",disabled:i,onClick:()=>a(),children:e(s?"setup.continue":"setup.skip")})})]})}T.propTypes={onNext:n.func,onPrevious:n.func};const B=j(E)`
2
2
  height: 100%;
3
3
  overflow-y: auto;
4
4
  `;export{T as default};
@@ -1 +1 @@
1
- import{r as p}from"./vendor-react-CTtPmzVP.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-DnR6WYuU.js";import{a as j}from"./vendor-hooks-qxhUUbW5.js";import{Q as r}from"./index-DG0EDext.js";import{V as A}from"./vendor-ux-IiqHAjMq.js";import{l as C}from"./arrow-down.svg-C4FUKwt4.js";import{L as O,D as H}from"./vendor-mui-x-CQc01l4r.js";import{A as R}from"./AdapterDayjs-CIz_EOtQ.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:h="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const T=e?r(n).tz(e):r(n);i(new Date(T.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:h,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(C,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:h=!0}){const{t:e}=A(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[T,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),M=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},_=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>h?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>M(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},sx:{"& .MuiInputLabel-root":{width:"calc(100% - 46px)"}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(I,{children:a.jsx(v,{value:m,onChange:_,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:T})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
1
+ import{r as p}from"./vendor-react-CTtPmzVP.js";import{j as a,y as b,W as t,z as y,M as E,ak as I}from"./vendor-mui-core-DnR6WYuU.js";import{a as j}from"./vendor-hooks-qxhUUbW5.js";import{Q as r}from"./index-NWCpUGtr.js";import{V as A}from"./vendor-ux-jvAfFAl1.js";import{l as C}from"./arrow-down.svg-C4FUKwt4.js";import{L as O,D as H}from"./vendor-mui-x-CQc01l4r.js";import{A as R}from"./AdapterDayjs-DyRP0A_7.js";function v({value:s=null,onChange:i,error:l=!1,helperText:c="",label:h="",timezone:e="",minDateTime:f=null}){const d=j(()=>{let n=r();return s&&(n=e?r(s).tz(e):r(s)),n},[s,e]),m=n=>{const T=e?r(n).tz(e):r(n);i(new Date(T.format("YYYY-MM-DD HH:mm:00")))};return a.jsx(O,{dateAdapter:R,children:a.jsx(b,{fullWidth:!0,error:l,children:a.jsx(H,{label:h,minDateTime:f,value:d,onChange:m,slotProps:{textField:{error:l,helperText:l?c:""}},format:"YYYY-MM-DD HH:mm"})})})}v.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,error:t.bool,helperText:t.string,label:t.string,timezone:t.string,minDateTime:t.instanceOf(Date)};function U(s){return a.jsx(C,{...s,width:20,height:20})}const u={MINUTES_30:30*60*1e3,HOUR_1:60*60*1e3,HOURS_3:3*60*60*1e3,DAY_1:24*60*60*1e3,DAYS_7:7*24*60*60*1e3,DAYS_30:30*24*60*60*1e3};function $({placeholder:s="",value:i="",onChange:l,timezone:c="",showError:h=!0}){const{t:e}=A(),[f,d]=p.useState(i||""),[m,n]=p.useState(null),[T,Y]=p.useState(null),x=p.useMemo(()=>[{value:u.MINUTES_30,label:`30 ${e("common.minutes")}`},{value:u.HOUR_1,label:`1 ${e("common.hour")}`},{value:u.HOURS_3,label:`3 ${e("common.hours")}`},{value:u.DAY_1,label:`1 ${e("common.day")}`},{value:u.DAYS_7,label:`7 ${e("common.days")}`},{value:u.DAYS_30,label:`30 ${e("common.days")}`},{value:"custom",label:e("common.custom")}],[e]),M=o=>{if(d(o),o==="custom"){const D=c?r().tz(c):r(),S=D.add(1,"day").toDate();Y(D),n(S),l(S)}else l(new Date(Date.now()+o))},_=o=>{n(o),l(o)};p.useEffect(()=>{i&&(x.find(D=>r(D.value).isSame(i))||(d("custom"),n(i)))},[]);const g=j(()=>h?!!(!m||r(m).isBefore(r())):!1,[m,e]);return a.jsxs(a.Fragment,{children:[a.jsx(b,{fullWidth:!0,children:a.jsx(y,{select:!0,value:f,label:s||e("team.passport.passportExpireTime"),onChange:o=>M(o.target.value),variant:"outlined",slotProps:{select:{IconComponent:U}},sx:{"& .MuiInputLabel-root":{width:"calc(100% - 46px)"}},children:x.map(o=>a.jsx(E,{value:o.value,children:o.label},o.value))})}),f==="custom"&&a.jsx(I,{children:a.jsx(v,{value:m,onChange:_,label:e("team.passport.customExpireTime"),timezone:c,error:!!g,helperText:g?e("team.passport.customExpireTimeIsInvalid"):void 0,minDateTime:T})})]})}$.propTypes={value:t.oneOfType([t.string,t.instanceOf(Date)]),onChange:t.func.isRequired,timezone:t.string,placeholder:t.string,showError:t.bool};export{$ as T};
@@ -1 +1 @@
1
- import{_ as r}from"./vendor-ux-IiqHAjMq.js";import{be as _,bf as e}from"./index-DG0EDext.js";const m={en:_(e),ar:()=>r(()=>import("./ar-BukCw0OI.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-Br0tDZam.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-D_e0gGgp.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-DXizOT4b.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-D2FEb_Tx.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-Dw9URVwP.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-DBxpsmGJ.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-CCAdSyce.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-CrMGrBZ6.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-up3R57Pv.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-DdNj2Ao6.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-HNh41Xxk.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-Dr5DyPwA.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-MM5bvwO_.js"),[],import.meta.url).then(t=>_(t.default))};export{m as t};
1
+ import{_ as r}from"./vendor-ux-jvAfFAl1.js";import{be as _,bf as e}from"./index-NWCpUGtr.js";const m={en:_(e),ar:()=>r(()=>import("./ar-BukCw0OI.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-Br0tDZam.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-D_e0gGgp.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-DXizOT4b.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-D2FEb_Tx.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-Dw9URVwP.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-DBxpsmGJ.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-CCAdSyce.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-CrMGrBZ6.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-up3R57Pv.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-DdNj2Ao6.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-HNh41Xxk.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-Dr5DyPwA.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-MM5bvwO_.js"),[],import.meta.url).then(t=>_(t.default))};export{m as t};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.__toCdnUrl("assets/vendor-ux-DYcPPYq2.css"),window.__toCdnUrl("assets/index-DrVXX4fX.css"),window.__toCdnUrl("assets/index-B5LvOF-F.css")])))=>i.map(i=>d[i]);
2
- import{r as k,u as It,m as rt,L as we,g as xo,i as qs,k as Ns,l as bt}from"./vendor-react-CTtPmzVP.js";import{J as Oe,j as e,ak as a,b2 as Et,W as n,am as xe,I as ce,d5 as _s,d6 as Ws,cu as go,bi as nt,T as A,d7 as Os,bC as zs,s as ko,cr as jo,d8 as Bs,d9 as Vs,Y as lt,at as ve,av as Us,da as Ms,a5 as He,aZ as it,cC as Pt,cR as Fs,b0 as Hs,bX as Me,bj as Js,bV as et,Q as G,a6 as Se,cG as Xs,O as yo,K as wo,P as Lt,ai as vo,o as Co,M as be,a3 as Gs,b5 as Ro,$ as So,ca as Ks,A as Xe,aJ as Ys,R as To,z as ne,b6 as Re,db as Xt,bO as tt,dc as Do,V as Io,S as $t,aP as Eo,bf as Zs,D as Po,cU as Qs,aQ as er,aR as tr,cV as or,cW as sr,by as Lo,aq as rr,dd as nr,a1 as $o,a0 as ot,cX as Gt,bv as lr,bw as ir,de as cr,df as ar,bZ as vt,y as dr,F as ur,bW as pr,bY as ft}from"./vendor-mui-core-DnR6WYuU.js";import{c as F,Z as ke,Y as De,l as hr,J as me,bU as mr,h as br,q as Kt,bY as fr,an as Yt,bR as xr,aK as gr,bZ as kr,b_ as jr,b$ as yr}from"./index-DG0EDext.js";import{V as X,b9 as Ao,q as wr,w as $e,aV as qo,b2 as No,bq as vr,aP as At,H as W,bo as qt,br as Nt,z as ae,_ as _o,aA as We,aL as ct,aX as Wo}from"./vendor-ux-IiqHAjMq.js";import{C as at}from"./confirm-DQlu79Sm.js";import{u as ze}from"./session-D-wwXXFW.js";import{W as Ct}from"./did-address-h4uLp20A.js";import{E as Ge}from"./empty-spinner-BYDonf35.js";import{B as _t}from"./bundle-avatar-DJ_-4AO_.js";import{S as Te}from"./shorten-label-C4py9TLA.js";import{L as Wt}from"./list-header-Cl3jykCe.js";import{aa as Cr,C as ue,A as Ot,D as Oo,N as Rr}from"./vendor-utils-CxWN1dT3.js";import{C as zo}from"./click-to-copy-CBd8B_uk.js";import{t as Zt}from"./question-mark-circle.svg-CByEVDhb.js";import{x as Sr,b as Tr}from"./vendor-hooks-qxhUUbW5.js";import{u as Fe}from"./useSetState-L-f8mSga.js";import{e as Dr}from"./engine-_hdQizRi.js";import"./api-FQQlzPOP.js";import{T as Ir,S as Er}from"./vendor-mui-x-CQc01l4r.js";import{D as Qt,C as eo,P as to}from"./react-beautiful-dnd.esm-DDZ1XDH7.js";import{u as Bo,a as Pr,b as Lr,d as $r,e as Ar}from"./wait-connect-Co7Po2HJ.js";import{f as ge}from"./index-DBs9Ljax.js";import{c as qr,A as Vo,S as Nr,U as _r,r as Wr}from"./item-CwiqvF0e.js";import{D as Or}from"./delete-confirm-BIuv3oO4.js";import{g as Uo}from"./get-safe-url-DaqBo3hv.js";import{u as Le}from"./index-Bg5uZrWj.js";import{M as zr}from"./index-B0Q9wWG1.js";import{r as Br}from"./index-CRAuhYSg.js";import"./vendor-arcblock-DyliHtVF.js";import"./lottie-web-4koyQiv_.js";import"./raf-schd.esm-XXBRsnmf.js";function zt({did:t,projectId:o,title:s,logo:r,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[d,u]=k.useState(!1),x=Oe(p=>p.breakpoints.down("md"));return e.jsxs(a,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[e.jsx(Et,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||d?"primary.main":"grey.700"},children:l||"/"})]})]})}zt.propTypes={projectId:n.string.isRequired,did:n.string.isRequired,title:n.string.isRequired,logo:n.string.isRequired,describe:n.string.isRequired};function Mo({initUrl:t=null}){const o=It(),s=t?.searchParams.get("tenantScope")||"",{t:r,locale:l}=X(),{api:c}=ke(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:x}=De(),[p,m]=k.useState(null),[f,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=rt(),[g,C]=k.useState(null),D=`publish-${x.meta.did}`,R=Ao(D),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const I=E?.projects||[];u(!1),C(I)}).catch(E=>{u(!1),W.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},P=()=>{b(!1),m(null)},$=E=>{W.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){W.error("Delete project failed");return}O(),b(!1),m(null)};k.useEffect(()=>{O()},[]);const S=k.useMemo(()=>{if(!y.searchText)return g;let E=y.searchText?.trim();return E?(E=wr.toAddress(E).toLocaleLowerCase(),g.filter(I=>I.blockletTitle.toLowerCase().includes(E)||I.blockletDid.toLowerCase().includes(E))):g},[g,y.searchText]);if(!g&&d)return e.jsx(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Ge,{})});if(!g)return null;if(!g.length)return e.jsxs(a,{sx:{display:"flex",flexDirection:"column",alignItems:"center",pt:10},children:[e.jsx(a,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const I=g[E];return e.jsx(we,{to:`${I.id}`,children:e.jsx(zt,{did:x.meta.did,projectId:I.id,logo:I.blockletLogo,title:I.blockletTitle,describe:I.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(qo,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Ct,{onClick:()=>{o(`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${E}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:E}):null}},h||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const I=(x.children||[]).find(V=>V.meta.did===E);return I?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(_t,{size:14,blocklet:I,ancestors:[x]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:I.meta.title})]},E):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:E=>e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(Te,{children:E})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(No,{value:Number(E),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const I=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${I.id}/new-release/none/${I.lastReleaseId}`,children:e.jsx(xe,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(_s,{style:{fontSize:18}})})})}),!!I.lastReleaseId&&e.jsx(xe,{title:r("blocklet.publish.viewLastRelease",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${I.id}/view/${I.lastReleaseId}/${I.blockletVersion}`,children:e.jsx(Ws,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:r("blocklet.publish.delete",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(I),children:e.jsx(go,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:I,searchText:V})=>{y.pageSize!==I?T(U=>({...U,searchText:"",pageSize:I,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=f?e.jsx(hr,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:w,onError:$,extraParams:{projectId:p.id,did:x.meta.did,name:p.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Vr,{children:[e.jsx(Wt,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(A,{variant:"h4",children:[r("common.blocklets")," (",S.length,")"]}),e.jsx(xe,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Os,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(vr,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(I=>({...I,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(nt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:l,data:S,columns:Z,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:D,onChange:H}),p&&e.jsx(at,{title:`${r("common.delete")} ${p.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(zs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const Vr=ko(a)`
2
+ import{r as k,u as It,m as rt,L as we,g as xo,i as qs,k as Ns,l as bt}from"./vendor-react-CTtPmzVP.js";import{J as Oe,j as e,ak as a,b2 as Et,W as n,am as xe,I as ce,d5 as _s,d6 as Ws,cu as go,bi as nt,T as A,d7 as Os,bC as zs,s as ko,cr as jo,d8 as Bs,d9 as Vs,Y as lt,at as ve,av as Us,da as Ms,a5 as He,aZ as it,cC as Pt,cR as Fs,b0 as Hs,bX as Me,bj as Js,bV as et,Q as G,a6 as Se,cG as Xs,O as yo,K as wo,P as Lt,ai as vo,o as Co,M as be,a3 as Gs,b5 as Ro,$ as So,ca as Ks,A as Xe,aJ as Ys,R as To,z as ne,b6 as Re,db as Xt,bO as tt,dc as Do,V as Io,S as $t,aP as Eo,bf as Zs,D as Po,cU as Qs,aQ as er,aR as tr,cV as or,cW as sr,by as Lo,aq as rr,dd as nr,a1 as $o,a0 as ot,cX as Gt,bv as lr,bw as ir,de as cr,df as ar,bZ as vt,y as dr,F as ur,bW as pr,bY as ft}from"./vendor-mui-core-DnR6WYuU.js";import{c as F,Z as ke,Y as De,m as hr,J as me,bU as mr,l as br,r as Kt,bY as fr,an as Yt,bR as xr,aK as gr,bZ as kr,b_ as jr,b$ as yr}from"./index-NWCpUGtr.js";import{V as X,b9 as Ao,q as wr,w as $e,aV as qo,b2 as No,bq as vr,aP as At,H as W,bo as qt,br as Nt,z as ae,_ as _o,aA as We,aL as ct,aX as Wo}from"./vendor-ux-jvAfFAl1.js";import{C as at}from"./confirm-BRnYfcDD.js";import{u as ze}from"./session-5s-U-ruq.js";import{W as Ct}from"./did-address-B3eXeL7H.js";import{E as Ge}from"./empty-spinner-BYDonf35.js";import{B as _t}from"./bundle-avatar-Dtpi1uSw.js";import{S as Te}from"./shorten-label-C4py9TLA.js";import{L as Wt}from"./list-header-Cl3jykCe.js";import{aa as Cr,C as ue,A as Ot,D as Oo,N as Rr}from"./vendor-utils-CxWN1dT3.js";import{C as zo}from"./click-to-copy-BEM1P78p.js";import{t as Zt}from"./question-mark-circle.svg-CByEVDhb.js";import{x as Sr,b as Tr}from"./vendor-hooks-qxhUUbW5.js";import{u as Fe}from"./useSetState-L-f8mSga.js";import{e as Dr}from"./engine-D-_cbl3F.js";import"./api-FQQlzPOP.js";import{T as Ir,S as Er}from"./vendor-mui-x-CQc01l4r.js";import{D as Qt,C as eo,P as to}from"./react-beautiful-dnd.esm-BZjy3RlT.js";import{u as Bo,a as Pr,b as Lr,d as $r,e as Ar}from"./wait-connect-VFnD4S6k.js";import{f as ge}from"./index-DBs9Ljax.js";import{c as qr,A as Vo,S as Nr,U as _r,r as Wr}from"./item-BJSHAMwK.js";import{D as Or}from"./delete-confirm-1vzcMsM2.js";import{g as Uo}from"./get-safe-url-xl2OarvZ.js";import{u as Le}from"./index-bCC4mzZc.js";import{M as zr}from"./index-B0Q9wWG1.js";import{r as Br}from"./index-CRAuhYSg.js";import"./vendor-arcblock-B1iA4v4a.js";import"./lottie-web-4koyQiv_.js";import"./raf-schd.esm-XXBRsnmf.js";function zt({did:t,projectId:o,title:s,logo:r,describe:l}){const i=`${`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t}/${o}/logo/upload`}/${r}`,[d,u]=k.useState(!1),x=Oe(p=>p.breakpoints.down("md"));return e.jsxs(a,{sx:{display:"flex",flexDirection:"row",color:d?"primary.main":"grey.900",gap:1},onPointerEnter:()=>u(!0),onPointerLeave:()=>u(!1),children:[e.jsx(Et,{sx:{borderRadius:1},src:i}),e.jsxs(a,{children:[e.jsx(Te,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:x?"primary.main":""},children:s||"/"}),e.jsx(Te,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:x||d?"primary.main":"grey.700"},children:l||"/"})]})]})}zt.propTypes={projectId:n.string.isRequired,did:n.string.isRequired,title:n.string.isRequired,logo:n.string.isRequired,describe:n.string.isRequired};function Mo({initUrl:t=null}){const o=It(),s=t?.searchParams.get("tenantScope")||"",{t:r,locale:l}=X(),{api:c}=ke(),{api:i}=ze(),[d,u]=k.useState(!0),{blocklet:x}=De(),[p,m]=k.useState(null),[f,b]=k.useState(!1),h=Oe(E=>E.breakpoints.down("xl")),j=Oe(E=>E.breakpoints.down("md")),{componentDid:v=""}=rt(),[g,C]=k.useState(null),D=`publish-${x.meta.did}`,R=Ao(D),[y,T]=k.useState({searchText:R.searchText||"",pageSize:R.rowsPerPage||10,page:1}),O=()=>{c.getProjects({input:{did:x.meta.did,componentDid:v,tenantScope:s}}).then(E=>{const I=E?.projects||[];u(!1),C(I)}).catch(E=>{u(!1),W.error(E.message)})},N=()=>{o(`${F.UNOWNED_DID}/create/none/0.0.0`,{replace:!0})},z=E=>{m(E)},K=()=>{u(!1),b(!0)},P=()=>{b(!1),m(null)},$=E=>{W.error(E.message),b(!1),m(null)},w=E=>{if(!E?.deleted){W.error("Delete project failed");return}O(),b(!1),m(null)};k.useEffect(()=>{O()},[]);const S=k.useMemo(()=>{if(!y.searchText)return g;let E=y.searchText?.trim();return E?(E=wr.toAddress(E).toLocaleLowerCase(),g.filter(I=>I.blockletTitle.toLowerCase().includes(E)||I.blockletDid.toLowerCase().includes(E))):g},[g,y.searchText]);if(!g&&d)return e.jsx(a,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:e.jsx(Ge,{})});if(!g)return null;if(!g.length)return e.jsxs(a,{sx:{display:"flex",flexDirection:"column",alignItems:"center",pt:10},children:[e.jsx(a,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:r("blocklet.publish.blockletEmptyTip")}),e.jsx(a,{sx:{fontSize:14,color:"text.secondary",mb:3},children:r("blocklet.publish.createBlockletTip")}),e.jsx($e,{onClick:N,variant:"contained",children:r("blocklet.publish.createBlocklet")})]});const Z=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:E=>{const I=g[E];return e.jsx(we,{to:`${I.id}`,children:e.jsx(zt,{did:x.meta.did,projectId:I.id,logo:I.blockletLogo,title:I.blockletTitle,describe:I.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{searchable:!1,customBodyRender:E=>E?e.jsx(qo,{type:"success",children:E}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:E=>E?e.jsx(Ct,{size:14,compact:!0,responsive:!1,did:E}):null}},h||v?null:{label:r("common.createdBy"),name:"createdBy",options:{customBodyRender:E=>E?e.jsx(Ct,{onClick:()=>{o(`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/admin/members?did=${E}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:E}):null}},h||v?null:{label:r("common.scope"),name:"componentDid",options:{customBodyRender:E=>{const I=(x.children||[]).find(V=>V.meta.did===E);return I?e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:[e.jsx(_t,{size:14,blocklet:I,ancestors:[x]}),e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:I.meta.title})]},E):""}}},h||s?null:{label:r("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:E=>e.jsx(a,{sx:{ml:.5,color:"text.primary",fontSize:14},children:e.jsx(Te,{children:E})})}},{label:r("common.updatedAt"),name:"updatedAt",options:{searchable:!1,customBodyRender:E=>e.jsx(No,{value:Number(E),locale:l})}},{label:r("common.actions"),name:"actions",options:{searchable:!1,customBodyRenderLite:E=>{const I=g[E];return e.jsxs(a,{sx:{display:"flex"},children:[e.jsx(we,{to:`${I.id}/new-release/none/${I.lastReleaseId}`,children:e.jsx(xe,{title:r("blocklet.publish.createRelease"),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"create",children:e.jsx(_s,{style:{fontSize:18}})})})}),!!I.lastReleaseId&&e.jsx(xe,{title:r("blocklet.publish.viewLastRelease",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"secondary","aria-label":"create",children:e.jsx(we,{style:{display:"flex"},to:`${I.id}/view/${I.lastReleaseId}/${I.blockletVersion}`,children:e.jsx(Ws,{sx:{fontSize:18}})})})}),e.jsx(xe,{title:r("blocklet.publish.delete",{name:I.blockletTitle}),placement:"top",children:e.jsx(ce,{color:"primary","aria-label":"delete",onClick:()=>z(I),children:e.jsx(go,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),H=({page:E,rowsPerPage:I,searchText:V})=>{y.pageSize!==I?T(U=>({...U,searchText:"",pageSize:I,page:1})):y.page!==E+1?T(U=>({...U,searchText:"",page:E+1})):y.searchText!==V&&T(U=>({...U,searchText:V,page:1}))},Q=f?e.jsx(hr,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:l,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:w,onError:$,extraParams:{projectId:p.id,did:x.meta.did,name:p.blockletTitle},messages:{title:r("blocklet.publish.deleteProject.title",{name:p.blockletTitle}),scan:r("blocklet.publish.deleteProject.scan",{name:p.blockletTitle}),confirm:r("blocklet.publish.deleteProject.confirm"),success:r("blocklet.publish.deleteProject.success")}}):null;return e.jsxs(Vr,{children:[e.jsx(Wt,{sx:{mb:2},left:e.jsxs(a,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[e.jsxs(A,{variant:"h4",children:[r("common.blocklets")," (",S.length,")"]}),e.jsx(xe,{title:r("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:e.jsx(Os,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(vr,{options:{searchPlaceholder:r("blocklet.list.searchPlaceholder"),searchDebounceTime:600,searchAlwaysOpen:j},search:y.searchText,searchText:y.searchText,searchTextUpdate:E=>T(I=>({...I,searchText:E})),searchClose:()=>T(E=>({...E,searchText:""})),onSearchOpen:()=>{}}),e.jsxs($e,{onClick:N,variant:"contained",children:[e.jsx(nt,{style:{fontSize:"1.3em",marginRight:4}}),r("blocklet.publish.createBlocklet")]})]})}),e.jsx(At,{className:"main-table",locale:l,data:S,columns:Z,options:{search:!1,sort:!1,download:!1,filter:!1,print:!1,viewColumns:!1,searchAlwaysOpen:!0,rowsPerPageOptions:[10,20,50,100]},durable:D,onChange:H}),p&&e.jsx(at,{title:`${r("common.delete")} ${p.blockletTitle}`,description:r("blocklet.publish.deleteProject.description"),confirm:r("common.confirm"),onConfirm:K,onCancel:()=>m(null),children:e.jsx(a,{sx:{marginTop:2},children:[r("blocklet.publish.deleteProject.tip1"),r("blocklet.publish.deleteProject.tip2"),r("blocklet.publish.deleteProject.tip3")].map(E=>e.jsxs(a,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[e.jsx(zs,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),e.jsx(A,{component:"span",variant:"inherit",sx:{color:"text.secondary"},children:E})]}))})}),Q]})}const Vr=ko(a)`
3
3
  ${({theme:t})=>t.breakpoints.down("md")} {
4
4
  .MuiTableRow-root {
5
5
  border-color: ${({theme:t})=>t.palette.divider};
@@ -142,7 +142,7 @@ import{r as k,u as It,m as rt,L as we,g as xo,i as qs,k as Ns,l as bt}from"./ven
142
142
  background: #fff;
143
143
  z-index: 10;
144
144
  }
145
- `,co="lastWantToConnectStoreId";function rn(t){const[o,s]=k.useState(null),{session:r}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(co,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(co),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let x=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==r?.user?.did));return x||(x=t?.settings?.storeList?.[0]),x},[t?.settings?.storeList,r?.user?.did]);return[o||c||{},l]}const Bt=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{const l=t?s?.meta?.did:o?.did;let c=t?s?.settings?.storeList||[]:o?.blockletRegistryList||[];return Array.isArray(c)||(c=[]),c=c.filter(i=>i.protected||Rr(i.scope)||i.scope==="studio"||i.scope===r),{teamDid:l,storeList:c}};function ts({blocklet:t=null,store:o=null,onChangeStore:s,onClick:r,disabled:l,loading:c,componentDid:i}){const{t:d}=X(),{session:u}=ze(),{api:x,info:p,inService:m}=ke(),f=De(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,D]=k.useState(null),R=$=>{s($),h(!1)},y=()=>{h(!b)},T=$=>{j.current&&j.current.contains($.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await f?.actions?.refreshBlocklet()}catch($){W.error(`Remove Blocklet Store Error: ${ge($)}`)}finally{D(null)}},{storeList:K}=Bt({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),P=t?.meta?.did;return e.jsxs(e.Fragment,{children:[e.jsxs(et,{disabled:l,ref:j,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(G,{onClick:r,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(G,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:e.jsx(Xs,{})})]}),e.jsx(yo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:$})=>e.jsx(wo,{...$,style:{transformOrigin:"center top"},children:e.jsx(Lt,{children:e.jsx(vo,{onClickAway:T,children:e.jsxs(Co,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[K?.map(w=>e.jsxs(be,{selected:w.id===o?.id,sx:{height:56},onClick:()=>R(w),children:[e.jsxs(a,{children:[e.jsx(Te,{sx:{fontSize:"16px"},maxLength:24,children:w.name}),e.jsx(Te,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:w.url})]}),qr({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),D(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Gs,{}),e.jsxs(be,{onClick:O,children:[e.jsx(nt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Vo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:P,storeList:K,scope:"studio",onAdd:f?.actions?.refreshBlocklet}),C&&e.jsx(at,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:z,onCancel:()=>D(null)})]})}ts.propTypes={store:n.object,blocklet:n.object,onChangeStore:n.func.isRequired,onClick:n.func.isRequired,loading:n.bool.isRequired,disabled:n.bool.isRequired,componentDid:n.string.isRequired,projectType:n.string.isRequired,getData:n.func.isRequired};const os=(t,o,s)=>{const r=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,c=t?.blockletLogo?`${r}/${t.blockletLogo}`:`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,i=(t?.blockletScreenshots||[]).filter(Boolean).map(d=>`${l}/${d}`);return{logoUrl:c,screenshotUrls:i,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},nn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Vt({url:t,style:o={},controls:s=1,modestbranding:r=1}){const{t:l}=X(),c=t.includes("youtube.com")||t.includes("youtu.be"),i=t.includes("vimeo.com");if(c){const d=t.split("v=")[1]?.split("&")[0]||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o?.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(i){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(a,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(a,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}Vt.propTypes={url:n.string.isRequired,style:n.object,controls:n.number,modestbranding:n.number};function ss({setParams:t,onClose:o,params:s}){const{t:r}=X(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=nn(l),u=()=>{t(x=>{const p=[...x.blockletVideos];return p.push(l),{...x,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Ro,{children:r("studio.videoDialogTitle")}),e.jsxs(So,{children:[e.jsx(Ks,{fullWidth:!0,value:l,onChange:x=>c(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(Xe,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Ys,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(Vt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(To,{children:[e.jsx(G,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(G,{disabled:!d||i,onClick:u,children:r("studio.confirm")})]})]})}ss.propTypes={onClose:n.func.isRequired,params:n.object.isRequired,setParams:n.func.isRequired};function Rt({errors:t,storeList:o,...s}){const{t:r}=X();return e.jsxs(a,{...s,sx:[{color:"warning.main",fontSize:"14px",border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,c])=>{const i=Object.values(c),d=o.find(u=>u.url===l);return i.length>0&&e.jsxs(a,{children:[e.jsx(xe,{title:l,children:e.jsx(a,{component:"span",sx:{cursor:"pointer"},children:d.name})}),i.map(u=>e.jsx(a,{component:"li",sx:{ml:2,wordBreak:!0},children:u},u))]},l)})]})}Rt.propTypes={errors:n.object.isRequired,storeList:n.array.isRequired};const ao=k.lazy(()=>_o(()=>import("./index-ETdrsXsn.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function rs({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:x,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:f,componentDid:b=""}){const{t:h,locale:j}=X(),{api:v}=ke(),g=It(),C=k.useRef(null),D=k.useRef(null),[R,y]=rn(r),[T,O]=k.useState(!1),N=Bo({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async q=>{const Y=setTimeout(()=>{x(!1)},2e4),J=await Lr(v,q);x(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${J}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){W.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){W.error(h("blocklet.publish.noStoreSelected"));return}const q=Pr();N(async(Y,J)=>{try{const se=await v.connectByStudio({input:{did:r?.meta?.did,blockletTitle:l?.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:l?.blockletComponents?.length>0?"pack":"resource",componentDid:b,messageId:q,tenantScope:p?.searchParams.get("tenantScope")||""}});if(!se?.url){W.error("failed to connect to store");return}J(se.url),z({did:r?.meta?.did,projectId:"",messageId:q})}catch(se){const de=ge(se);W.error(de),x(!1)}})},{logoUrl:P,screenshotUrls:$,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=os(l,r,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:I}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(W.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(ln,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:q=>{d({blockletTitle:""}),c({blockletTitle:q.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||"",slotProps:{input:{"data-cy":"blocklet-title",readOnly:o}}}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",error:!!i.projectId,helperText:i.projectId||"",value:t===F.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3},slotProps:{input:{"data-cy":"export-blocklet-did",endAdornment:t===F.UNOWNED_DID&&e.jsx(Xe,{position:"end",children:e.jsx(ts,{blocklet:r,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:q=>{d({blockletDescription:""}),c({blockletDescription:q.target.value.slice(0,159)})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-description",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletHomepage:""}),c({blockletHomepage:q.target.value})},error:!!i.blockletHomepage,helperText:i.blockletHomepage||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-homepage",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletCommunity:""}),c({blockletCommunity:q.target.value})},error:!!i.blockletCommunity,helperText:i.blockletCommunity||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-community",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q.target.value)?d({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):d({blockletSupport:""}),c({blockletSupport:q.target.value})},error:!!i.blockletSupport,helperText:i.blockletSupport||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-support",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:q=>{q.target.value&&!/^(git|https|svn)/.test(q.target.value)?d({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletRepository:""}),c({blockletRepository:q.target.value})},error:!!i.blockletRepository,helperText:i.blockletRepository||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-repository",readOnly:o}}})]})}),e.jsx(a,{className:"section full-width",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.type"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(a,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Et,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||P,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(Rt,{errors:Z,storeList:Q,mt:3}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:U,children:e.jsx(eo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[$.map((J,se)=>e.jsx(to,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:J}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletScreenshots];return he.splice(se,1),{...pe,blockletScreenshots:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,$.length<5&&e.jsx(a,{onClick:()=>{V()&&D.current?.open()},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]}),I&&e.jsx(Rt,{errors:H,storeList:Q}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.videoType"),":"," "]}),e.jsxs(a,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:ee,children:e.jsx(eo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[l.blockletVideos.map((J,se)=>e.jsx(to,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(Vt,{url:J,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletVideos];return he.splice(se,1),{...pe,blockletVideos:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,l.blockletVideos.length<3&&e.jsx(a,{onClick:()=>{V()&&O(!0)},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]})]})}),e.jsxs(k.Suspense,{fallback:e.jsx(Ge,{}),children:[e.jsx(ao,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),f(""),C.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&e.jsx(ss,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(ao,{ref:D,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const J=Y.blockletScreenshots||[];return J.push(q.data?.filename),{...Y,blockletScreenshots:J}}),D.current?.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-$.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}rs.propTypes={projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,warning:n.object.isRequired,loading:n.bool.isRequired,blocklet:n.object.isRequired,setLoading:n.func.isRequired,initUrl:n.object,componentDid:n.string,initLogoUrl:n.string.isRequired,setInitLogoUrl:n.func.isRequired};const ln=ve.div`
145
+ `,co="lastWantToConnectStoreId";function rn(t){const[o,s]=k.useState(null),{session:r}=ze(),l=k.useCallback(d=>{s(d),localStorage.setItem(co,d?.id)},[s]),c=k.useMemo(()=>{const d=localStorage.getItem(co),u=d?(t?.settings?.storeList||[]).find(p=>p.id===d):null;if(u)return u;let x=(t?.settings?.storeList||[]).find(p=>!(p.id!==F.BLOCKLET_STORE.id||p.scope&&p.scope!=="studio"&&p.scope!==r?.user?.did));return x||(x=t?.settings?.storeList?.[0]),x},[t?.settings?.storeList,r?.user?.did]);return[o||c||{},l]}const Bt=({fromBlocklet:t,nodeInfo:o,blocklet:s,userDid:r})=>{const l=t?s?.meta?.did:o?.did;let c=t?s?.settings?.storeList||[]:o?.blockletRegistryList||[];return Array.isArray(c)||(c=[]),c=c.filter(i=>i.protected||Rr(i.scope)||i.scope==="studio"||i.scope===r),{teamDid:l,storeList:c}};function ts({blocklet:t=null,store:o=null,onChangeStore:s,onClick:r,disabled:l,loading:c,componentDid:i}){const{t:d}=X(),{session:u}=ze(),{api:x,info:p,inService:m}=ke(),f=De(),[b,h]=k.useState(!1),j=k.useRef(null),[v,g]=k.useState(!1),[C,D]=k.useState(null),R=$=>{s($),h(!1)},y=()=>{h(!b)},T=$=>{j.current&&j.current.contains($.target)||h(!1)},O=()=>{g(!0)},N=()=>{g(!1)},z=async()=>{if(C)try{await x.deleteBlockletStore({input:{teamDid:t.meta.did,url:C.url,projectId:"",scope:C.scope||"studio"}}),await f?.actions?.refreshBlocklet()}catch($){W.error(`Remove Blocklet Store Error: ${ge($)}`)}finally{D(null)}},{storeList:K}=Bt({fromBlocklet:m,blocklet:t,nodeInfo:p,userDid:u?.user?.did}),P=t?.meta?.did;return e.jsxs(e.Fragment,{children:[e.jsxs(et,{disabled:l,ref:j,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[e.jsxs(G,{onClick:r,children:[c&&e.jsx(Se,{size:14,sx:{mr:.5}}),`${d("common.connect")} ${o.name||""}`]}),e.jsx(G,{size:"small","aria-controls":b?"split-button-menu":void 0,"aria-expanded":b?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:e.jsx(Xs,{})})]}),e.jsx(yo,{sx:{zIndex:10},open:b,anchorEl:j.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:$})=>e.jsx(wo,{...$,style:{transformOrigin:"center top"},children:e.jsx(Lt,{children:e.jsx(vo,{onClickAway:T,children:e.jsxs(Co,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[K?.map(w=>e.jsxs(be,{selected:w.id===o?.id,sx:{height:56},onClick:()=>R(w),children:[e.jsxs(a,{children:[e.jsx(Te,{sx:{fontSize:"16px"},maxLength:24,children:w.name}),e.jsx(Te,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:w.url})]}),qr({store:w,userDid:u?.user?.did})&&e.jsx(ce,{sx:{ml:1},onClick:S=>{S.preventDefault(),S.stopPropagation(),D(w)},children:e.jsx(ae,{icon:"ic:outline-delete"})})]},w.url)),e.jsx(Gs,{}),e.jsxs(be,{onClick:O,children:[e.jsx(nt,{font:!0}),e.jsx(A,{variant:"inherit",children:d("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&e.jsx(Vo,{hiddenChildren:!0,open:!0,onClose:N,teamDid:P,storeList:K,scope:"studio",onAdd:f?.actions?.refreshBlocklet}),C&&e.jsx(at,{displayError:!0,title:`${d("common.delete")} ${C.name}`,description:d("blocklet.publish.deleteStoreTip",{name:C.name}),confirm:d("common.confirm"),onConfirm:z,onCancel:()=>D(null)})]})}ts.propTypes={store:n.object,blocklet:n.object,onChangeStore:n.func.isRequired,onClick:n.func.isRequired,loading:n.bool.isRequired,disabled:n.bool.isRequired,componentDid:n.string.isRequired,projectType:n.string.isRequired,getData:n.func.isRequired};const os=(t,o,s)=>{const r=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/logo/upload`,l=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${o.meta.did}/${s}/screenshot/upload`,c=t?.blockletLogo?`${r}/${t.blockletLogo}`:`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,i=(t?.blockletScreenshots||[]).filter(Boolean).map(d=>`${l}/${d}`);return{logoUrl:c,screenshotUrls:i,uploadLogoPrefix:r,uploadScreenshotPrefix:l}},nn=t=>{const o=t.includes("youtube.com")||t.includes("youtu.be"),s=t.includes("vimeo.com");return o||s};function Vt({url:t,style:o={},controls:s=1,modestbranding:r=1}){const{t:l}=X(),c=t.includes("youtube.com")||t.includes("youtu.be"),i=t.includes("vimeo.com");if(c){const d=t.split("v=")[1]?.split("&")[0]||t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o?.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${d}?modestbranding=${r}&controls=${s}&rel=0`,title:"YouTube video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})}if(i){const d=t.split("/").pop();return e.jsx("div",{style:{position:"relative",width:"100%",paddingTop:"56.25%",pointerEvents:o.pointerEvents||"auto"},children:e.jsx("iframe",{src:`https://player.vimeo.com/video/${d}`,title:"Vimeo video player",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0})})}return e.jsx(a,{style:{position:"relative",width:"100%",paddingTop:"56.25%"},children:e.jsxs(a,{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",border:"none",backgroundColor:"rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...o},allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,children:[e.jsx(ae,{icon:"carbon:video-off",style:{fontSize:40,marginBottom:"10px",opacity:.5}}),e.jsx(A,{variant:"body1",sx:{opacity:.5},children:l("studio.videoDialogNoSrc")})]})})}Vt.propTypes={url:n.string.isRequired,style:n.object,controls:n.number,modestbranding:n.number};function ss({setParams:t,onClose:o,params:s}){const{t:r}=X(),[l,c]=k.useState(""),i=l&&s.blockletVideos.includes(l),d=nn(l),u=()=>{t(x=>{const p=[...x.blockletVideos];return p.push(l),{...x,blockletVideos:p}}),o()};return e.jsxs(lt,{open:!0,fullWidth:!0,maxWidth:"sm",children:[e.jsx(Ro,{children:r("studio.videoDialogTitle")}),e.jsxs(So,{children:[e.jsx(Ks,{fullWidth:!0,value:l,onChange:x=>c(x.target.value),placeholder:r("studio.videoInputLabel"),endAdornment:l?e.jsx(Xe,{position:"end",children:e.jsx(ce,{onClick:()=>c(""),children:e.jsx(Ys,{})})}):null,error:i}),i&&e.jsx(A,{variant:"body2",color:"error",children:r("studio.duplicateVideo")}),e.jsx(Vt,{url:l,style:{marginTop:"20px",borderRadius:"4px"}})]}),e.jsxs(To,{children:[e.jsx(G,{onClick:()=>o(),children:r("studio.cancel")}),e.jsx(G,{disabled:!d||i,onClick:u,children:r("studio.confirm")})]})]})}ss.propTypes={onClose:n.func.isRequired,params:n.object.isRequired,setParams:n.func.isRequired};function Rt({errors:t,storeList:o,...s}){const{t:r}=X();return e.jsxs(a,{...s,sx:[{color:"warning.main",fontSize:"14px",border:"1px solid rgba(214, 164, 64, 0.34)",borderRadius:"4px",py:2,px:1.5,position:"relative"},...Array.isArray(s.sx)?s.sx:[s.sx]],children:[e.jsx(A,{variant:"caption",sx:{fontWeight:"bold",position:"absolute",top:-10,left:12,backgroundColor:"white",px:1,width:"fit-content"},children:r("blocklet.publish.storeRule.warning")}),t&&Object.entries(t).map(([l,c])=>{const i=Object.values(c),d=o.find(u=>u.url===l);return i.length>0&&e.jsxs(a,{children:[e.jsx(xe,{title:l,children:e.jsx(a,{component:"span",sx:{cursor:"pointer"},children:d.name})}),i.map(u=>e.jsx(a,{component:"li",sx:{ml:2,wordBreak:!0},children:u},u))]},l)})]})}Rt.propTypes={errors:n.object.isRequired,storeList:n.array.isRequired};const ao=k.lazy(()=>_o(()=>import("./index-DoDx-vpV.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function rs({projectId:t,readOnly:o,loading:s,blocklet:r,params:l,setParams:c,paramsErrTip:i,setParamsErrTip:d,warning:u,setLoading:x,initUrl:p=null,initLogoUrl:m,setInitLogoUrl:f,componentDid:b=""}){const{t:h,locale:j}=X(),{api:v}=ke(),g=It(),C=k.useRef(null),D=k.useRef(null),[R,y]=rn(r),[T,O]=k.useState(!1),N=Bo({messageType:"connect-store-message",onOpen:()=>x(!0),onClose:()=>x(!1)}),z=async q=>{const Y=setTimeout(()=>{x(!1)},2e4),J=await Lr(v,q);x(!1),clearTimeout(Y),window.parent.postMessage({event:"studioDialog.connected",componentDid:b},"*"),g(window.location.pathname.replace(`${F.UNOWNED_DID}/create`,`${J}/create`),{replace:!0})},K=()=>{if(!l.blockletTitle){W.error(h("blocklet.publish.errorTip.noTitle"));return}if(!R?.url){W.error(h("blocklet.publish.noStoreSelected"));return}const q=Pr();N(async(Y,J)=>{try{const se=await v.connectByStudio({input:{did:r?.meta?.did,blockletTitle:l?.blockletTitle,storeUrl:R.url,storeId:R.id,storeName:R.name,type:l?.blockletComponents?.length>0?"pack":"resource",componentDid:b,messageId:q,tenantScope:p?.searchParams.get("tenantScope")||""}});if(!se?.url){W.error("failed to connect to store");return}J(se.url),z({did:r?.meta?.did,projectId:"",messageId:q})}catch(se){const de=ge(se);W.error(de),x(!1)}})},{logoUrl:P,screenshotUrls:$,uploadLogoPrefix:w,uploadScreenshotPrefix:S}=os(l,r,t),{logoErrors:Z,screenshotErrors:H,storeList:Q,hasLogoWarning:E,hasScreenshotWarning:I}=u,V=()=>o?!1:!t||t===F.UNOWNED_DID?(W.error(h("blocklet.publish.errorTip.noFirstDid")),!1):!0,U=q=>{if(!q.destination)return;const Y=Array.from(l.blockletScreenshots),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletScreenshots:Y}))},ee=q=>{if(!q.destination)return;const Y=Array.from(l.blockletVideos),[J]=Y.splice(q.source.index,1);Y.splice(q.destination.index,0,J),c(se=>({...se,blockletVideos:Y}))};return e.jsxs(ln,{children:[e.jsx(a,{className:"section",sx:{display:"flex"},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.title")}`,placeholder:`Blocklet ${h("common.title")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:l.blockletTitle||"",onChange:q=>{d({blockletTitle:""}),c({blockletTitle:q.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||"",slotProps:{input:{"data-cy":"blocklet-title",readOnly:o}}}),e.jsx(ne,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",error:!!i.projectId,helperText:i.projectId||"",value:t===F.UNOWNED_DID?"":`did:abt:${t}`,sx:{mt:3},slotProps:{input:{"data-cy":"export-blocklet-did",endAdornment:t===F.UNOWNED_DID&&e.jsx(Xe,{position:"end",children:e.jsx(ts,{blocklet:r,store:R,componentDid:b,onChangeStore:y,disabled:!l.blockletTitle||o||s,loading:s,onClick:K})})}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.description")}`,placeholder:`Blocklet ${h("common.description")}`,required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletDescription||"",onChange:q=>{d({blockletDescription:""}),c({blockletDescription:q.target.value.slice(0,159)})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-description",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.homepageTip")}`,placeholder:`Blocklet ${h("common.homepageTip")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletHomepage||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletHomepage:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletHomepage:""}),c({blockletHomepage:q.target.value})},error:!!i.blockletHomepage,helperText:i.blockletHomepage||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-homepage",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.community")}`,placeholder:`Blocklet ${h("common.community")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletCommunity||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)?d({blockletCommunity:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletCommunity:""}),c({blockletCommunity:q.target.value})},error:!!i.blockletCommunity,helperText:i.blockletCommunity||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-community",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.support")}`,placeholder:`Blocklet ${h("common.support")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletSupport||"",onChange:q=>{q.target.value&&!/^(http|https):\/\//.test(q.target.value)&&!/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q.target.value)?d({blockletSupport:h("blocklet.publish.errorTip.invalidUrlOrEmail")}):d({blockletSupport:""}),c({blockletSupport:q.target.value})},error:!!i.blockletSupport,helperText:i.blockletSupport||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-support",readOnly:o}}}),e.jsx(ne,{disabled:s||o,label:`Blocklet ${h("common.repository")}`,placeholder:`Blocklet ${h("common.repository")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:l.blockletRepository||"",onChange:q=>{q.target.value&&!/^(git|https|svn)/.test(q.target.value)?d({blockletRepository:h("blocklet.publish.errorTip.invalidUrl")}):d({blockletRepository:""}),c({blockletRepository:q.target.value})},error:!!i.blockletRepository,helperText:i.blockletRepository||"",sx:{mt:3},slotProps:{input:{"data-cy":"blocklet-repository",readOnly:o}}})]})}),e.jsx(a,{className:"section full-width",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1,overflow:"hidden"},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.logo")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.type"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"png, jpg, webp, svg"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"256x256"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<500Kb"})]})})]})]}),e.jsx(a,{sx:{flex:1,cursor:o?"default":"pointer",display:"flex",alignItems:"flex-end"},children:e.jsx(Et,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||P,onClick:()=>{V()&&C.current?.open()}})})]}),E&&e.jsx(Rt,{errors:Z,storeList:Q,mt:3}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("common.screenshot")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{sx:{border:"none"},variant:"outlined",size:"small",children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.ratio"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"16 / 9"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~5"})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.size"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"<5MB"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:U,children:e.jsx(eo,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"grey.100":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[$.map((J,se)=>e.jsx(to,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx("img",{alt:"screenshot",src:J}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletScreenshots];return he.splice(se,1),{...pe,blockletScreenshots:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,$.length<5&&e.jsx(a,{onClick:()=>{V()&&D.current?.open()},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]}),I&&e.jsx(Rt,{errors:H,storeList:Q}),e.jsxs(a,{sx:{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap"},children:[e.jsxs(Re,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[e.jsx(A,{variant:"subtitle1",sx:{fontWeight:"bold"},children:h("studio.video")}),e.jsxs(Re,{direction:"column",spacing:1,sx:{alignItems:"flex-start",opacity:.8,fontSize:"12px"},children:[e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.videoType"),":"," "]}),e.jsxs(a,{component:"span",sx:{color:"secondary.main"},children:[e.jsx("a",{href:"https://www.youtube.com/",target:"_blank",rel:"noreferrer",children:"Youtube"}),","," ",e.jsx("a",{href:"https://vimeo.com/",target:"_blank",rel:"noreferrer",children:"Vimeo"})]})]})}),e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.count"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:"1~3"})]})}),!o&&e.jsx(a,{children:e.jsxs(a,{component:"span",children:[e.jsxs(a,{component:"span",sx:{color:"text.secondary"},children:[h("studio.order"),":"," "]}),e.jsx(a,{component:"span",sx:{color:"secondary.main"},children:h("studio.orderTip")})]})})]})]}),e.jsx(Qt,{onDragEnd:o?void 0:ee,children:e.jsx(eo,{droppableId:"videos",direction:"horizontal",isDropDisabled:o,children:(q,Y)=>e.jsxs(a,{ref:q.innerRef,...q.droppableProps,sx:{display:"flex",alignItems:"center",flex:1,flexWrap:"wrap",minHeight:160,background:Y.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:Y.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},children:[l.blockletVideos.map((J,se)=>e.jsx(to,{draggableId:J,index:se,isDragDisabled:o,children:(de,le)=>e.jsxs(a,{ref:de.innerRef,...de.draggableProps,className:"screenshot",sx:{transform:le.isDragging?"scale(1.05)":"none",boxShadow:le.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[e.jsx(Vt,{url:J,style:{pointerEvents:le.isDragging?"none":"auto"}}),!o&&e.jsx(ce,{...de.dragHandleProps,className:"action",style:{right:40,zIndex:10,color:"#fff"},children:e.jsx(Xt,{})}),!o&&e.jsx(ce,{className:"action",onClick:()=>{c(pe=>{const he=[...pe.blockletVideos];return he.splice(se,1),{...pe,blockletVideos:he}})},children:e.jsx(tt,{})})]})},J)),q.placeholder,l.blockletVideos.length<3&&e.jsx(a,{onClick:()=>{V()&&O(!0)},sx:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,width:240,height:135,background:"#eee",cursor:o?"default":"pointer",color:"#999",mb:2},children:"+"})]})})})]})]})}),e.jsxs(k.Suspense,{fallback:e.jsx(Ge,{}),children:[e.jsx(ao,{ref:C,locale:j,popup:!0,onUploadFinish:q=>{c({blockletLogo:q.data.filename}),f(""),C.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:w,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/png","image/jpeg","image/webp","image/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),T&&e.jsx(ss,{onClose:()=>O(!1),params:l,setParams:c}),e.jsx(ao,{ref:D,locale:j,popup:!0,onUploadFinish:q=>{c(Y=>{const J=Y.blockletScreenshots||[];return J.push(q.data?.filename),{...Y,blockletScreenshots:J}}),D.current?.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:S,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","image/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-$.length}},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}rs.propTypes={projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,warning:n.object.isRequired,loading:n.bool.isRequired,blocklet:n.object.isRequired,setLoading:n.func.isRequired,initUrl:n.object,componentDid:n.string,initLogoUrl:n.string.isRequired,setInitLogoUrl:n.func.isRequired};const ln=ve.div`
146
146
  margin-top: 24px;
147
147
  .screenshot {
148
148
  margin-bottom: 16px;
@@ -190,7 +190,7 @@ import{r as k,u as It,m as rt,L as we,g as xo,i as qs,k as Ns,l as bt}from"./ven
190
190
  padding-bottom: 12px;
191
191
  border-bottom: ${({theme:t})=>`1px solid ${t.palette.divider}`};
192
192
  }
193
- `;function fs({text:t}){const{palette:o}=Po();return t?e.jsx(zr,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:gr.sanitize(t),rehypePlugins:[[Br,{target:"_blank"}]]}):e.jsx(Je,{Icon:Nt})}fs.propTypes={text:n.string.isRequired};function xs({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:c}){const{t:i}=X(),[d,u]=k.useState(c?"preview":"write"),x=(p,m)=>{u(m)};return e.jsxs(a,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",sx:{fontWeight:"bold"},children:i("common.introduction")}),e.jsxs($o,{value:d,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(a,{sx:{display:d==="write"?"block":"none",width:"100%",marginTop:3},children:e.jsx(ne,{disabled:r||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{l({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,me.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||"",slotProps:{input:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:e.jsxs(Xe,{position:"end",children:[t?.blockletIntroduction?.length||0," / ",me.PROJECT.MAX_INTRO_LENGTH]})}}})}),e.jsx(a,{sx:{display:d==="preview"?"block":"none",mt:3},children:e.jsx(fs,{text:t.blockletIntroduction||""})})]})}xs.propTypes={params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,readOnly:n.bool.isRequired,loading:n.bool.isRequired};function gs({step:t=0,ok:o=!1,active:s=0,error:r="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx(Lo,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(c="error.main",i=e.jsx(Gt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Gt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(c="primary.main"),e.jsx(a,{sx:{width:24,height:24,bgcolor:c,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center"},children:i})}gs.propTypes={step:n.number,ok:n.bool,active:n.number,error:n.string,warning:n.bool};function ks({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:x}){const{t:p}=X(),m=()=>{s(j=>j+1)},f=()=>{s(j=>j-1)},b=j=>j===0?i?.blockletTitle||i?.projectId||i?.blockletDescription||i?.blockletHomepage||i?.blockletSupport||i?.blockletCommunity||i?.blockletRepository:j===2?i?.blockletResource||i?.blockletDocker||i?.dockerImageName:j>=4?i?.blockletVersion||i?.note:"",h=u||ns({params:l,projectId:x,t:p})===null;return e.jsxs(a,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(lr,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!pn({params:l,projectId:x,step:v,t:p}),D=c?"":b(v);return D&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:D}),g.error=!0),e.jsxs(ir,{children:[e.jsx(cr,{icon:e.jsx(gs,{error:D,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:D?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:D||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(ar,{children:[e.jsx(A,{fontSize:12,children:j.description}),!h&&e.jsx(a,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(G,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:D||!C,children:p("common.continue")}),v>0&&e.jsx(G,{disabled:v===0,onClick:f,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx(Lt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}ks.propTypes={steps:n.array.isRequired,activeStep:n.number.isRequired,setActiveStep:n.func.isRequired,params:n.object.isRequired,viewMode:n.oneOfType([n.string,n.bool]),loading:n.bool.isRequired,projectId:n.string.isRequired,hasSelectedResources:n.oneOfType([n.string,n.bool]),warning:n.object.isRequired,paramsErrTip:n.shape({projectId:n.string,blockletVersion:n.string,blockletTitle:n.string,blockletDescription:n.string,note:n.string,blockletResource:n.string,blockletHomepage:n.string,blockletSupport:n.string,blockletCommunity:n.string,blockletRepository:n.string,blockletDocker:n.object,dockerImageName:n.string}).isRequired};const mn=[".zip",".gz"],bn=1024*1024*100,fn=k.lazy(()=>_o(()=>import("./index-ETdrsXsn.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function js({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=X(),x=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(W.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(a,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),e.jsxs(Re,{direction:"row",spacing:1,sx:{alignItems:"center",flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(G,{variant:"outlined",size:"small",onClick:()=>{p()&&x.current?.open()},children:r.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Ge,{}),children:e.jsx(fn,{ref:x,locale:u,popup:!0,onUploadFinish:f=>{l({uploadedResource:f.data.filename}),c({blockletResource:""}),x.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:mn,maxFileSize:bn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}js.propTypes={app:n.object.isRequired,projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,error:n.string.isRequired,setParamsErrTip:n.func.isRequired};function Tt({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:c}){const{t:i}=X();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:c||t,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(ne,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||t,variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,me.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Xe,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Tt.propTypes={readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,loading:n.bool.isRequired};function ys(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&ys(t[o]);return t}var xn=Wr();const te=xo(xn),gn={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ut={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},kn={"--volume":!0,"--publish":!0},jn=new Set(["--publish","--volume"]),ws=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function yn(t){return t.map(o=>{if(o.key!=="--volume"||o.value.startsWith("$BLOCKLET_APP_DIR/")||o.value.startsWith("$BLOCKLET_DATA_DIR/"))return o;const[s,...r]=o.value.split(":");if(!s||!ws(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...r].join(":")}})}function wn(t){let o=!0;return t.find(r=>r.key==="--publish"&&r.type==="web")?t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"docker":r.type};return o=r.type==="web",l}return r}):t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"web":"docker"};return o=!1,l}return r})}function ho(t){if(!t)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(t=t.trim(),t.startsWith("$ docker run")&&(t=t.replace("$ docker run","docker run")),!t.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const s=t.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!s)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const r=[],l=[];let c=0,i="",d="";const u=[];for(;c<s.length;){const p=s[c];if(!p){c++;continue}if(p==="docker"||p==="run"){c++;continue}if((p==="-e"||p==="--env")&&c+1<s.length){const m=s[c+1]||"",[f,...b]=m.split("=");if(f){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:f,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let f=p,b=null;m!==-1&&(f=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=gn[f];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,r.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){r.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const x=[];for(const p of r)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(jn.has(p.key)&&p.value==="true")&&x.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:wn(yn(x)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function vn({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:r}){if(t.length===0&&o.length===0&&!s)return"";const l=["docker run \\"],c=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const i of t){const{key:d,value:u}=i;if(c.has(d))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}else if(!l.some(x=>x.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}}for(const i of o){const{key:d,value:u}=i,x=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${x} \\`)}return s&&l.push(` ${s} \\`),r&&l.push(` ${r} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
193
+ `;function fs({text:t}){const{palette:o}=Po();return t?e.jsx(zr,{style:{backgroundColor:o.background.default,color:o.text.primary},wrapperElement:{"data-color-mode":"light"},source:gr.sanitize(t),rehypePlugins:[[Br,{target:"_blank"}]]}):e.jsx(Je,{Icon:Nt})}fs.propTypes={text:n.string.isRequired};function xs({params:t,setParams:o,paramsErrTip:s,loading:r,setParamsErrTip:l,readOnly:c}){const{t:i}=X(),[d,u]=k.useState(c?"preview":"write"),x=(p,m)=>{u(m)};return e.jsxs(a,{sx:{border:"1px solid transparent",borderRadius:2},children:[e.jsxs(a,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[e.jsx(A,{variant:"h6",sx:{fontWeight:"bold"},children:i("common.introduction")}),e.jsxs($o,{value:d,onChange:x,"aria-label":"wrapped label tabs example",children:[e.jsx(ot,{value:"write",label:"Write"}),e.jsx(ot,{value:"preview",label:"Preview"})]})]}),e.jsx(a,{sx:{display:d==="write"?"block":"none",width:"100%",marginTop:3},children:e.jsx(ne,{disabled:r||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:t.blockletIntroduction||"",onChange:p=>{l({blockletIntroduction:""}),o({blockletIntroduction:p.target.value.slice(0,me.PROJECT.MAX_INTRO_LENGTH)})},error:!!s.blockletIntroduction,helperText:s.blockletIntroduction||"",slotProps:{input:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:e.jsxs(Xe,{position:"end",children:[t?.blockletIntroduction?.length||0," / ",me.PROJECT.MAX_INTRO_LENGTH]})}}})}),e.jsx(a,{sx:{display:d==="preview"?"block":"none",mt:3},children:e.jsx(fs,{text:t.blockletIntroduction||""})})]})}xs.propTypes={params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,readOnly:n.bool.isRequired,loading:n.bool.isRequired};function gs({step:t=0,ok:o=!1,active:s=0,error:r="",warning:l=!1}){let c="grey.500",i=t+1;return o&&(i=e.jsx(Lo,{sx:{fontSize:18,margin:0},color:"white"})),r||!o&&s>t?(c="error.main",i=e.jsx(Gt,{sx:{fontSize:18,margin:0},color:"white"})):l?(c="warning.main",i=e.jsx(Gt,{sx:{fontSize:18,margin:0},color:"white"})):s>=t&&(c="primary.main"),e.jsx(a,{sx:{width:24,height:24,bgcolor:c,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center"},children:i})}gs.propTypes={step:n.number,ok:n.bool,active:n.number,error:n.string,warning:n.bool};function ks({steps:t,activeStep:o,setActiveStep:s,hasSelectedResources:r=!1,params:l,loading:c,paramsErrTip:i,warning:d,viewMode:u="",projectId:x}){const{t:p}=X(),m=()=>{s(j=>j+1)},f=()=>{s(j=>j-1)},b=j=>j===0?i?.blockletTitle||i?.projectId||i?.blockletDescription||i?.blockletHomepage||i?.blockletSupport||i?.blockletCommunity||i?.blockletRepository:j===2?i?.blockletResource||i?.blockletDocker||i?.dockerImageName:j>=4?i?.blockletVersion||i?.note:"",h=u||ns({params:l,projectId:x,t:p})===null;return e.jsxs(a,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid",borderColor:"divider",borderRadius:1},children:[e.jsx(lr,{activeStep:o,orientation:"vertical",children:t.map((j,v)=>{const g={},C=c||!pn({params:l,projectId:x,step:v,t:p}),D=c?"":b(v);return D&&(g.optional=e.jsx(A,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:D}),g.error=!0),e.jsxs(ir,{children:[e.jsx(cr,{icon:e.jsx(gs,{error:D,warning:v===0?d.hasWarning:!1,active:h?99:o,step:v,ok:C}),sx:{cursor:"pointer",color:D?"error.main":"inherit"},disabled:!1,onClick:()=>s(v),...g,children:e.jsx(A,{fontSize:"14px",fontWeight:"500",color:D||!C&&o>v?"error.main":"inherit",children:j.label})}),e.jsxs(ar,{children:[e.jsx(A,{fontSize:12,children:j.description}),!h&&e.jsx(a,{sx:{mb:2},children:e.jsxs("div",{children:[v<t.length-1&&e.jsx(G,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:D||!C,children:p("common.continue")}),v>0&&e.jsx(G,{disabled:v===0,onClick:f,sx:{mt:1,mr:1},children:p("common.back")})]})})]})]},j.label)})}),o>=t.length-1&&e.jsx(Lt,{square:!0,elevation:0,sx:{p:3},children:e.jsx(A,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}ks.propTypes={steps:n.array.isRequired,activeStep:n.number.isRequired,setActiveStep:n.func.isRequired,params:n.object.isRequired,viewMode:n.oneOfType([n.string,n.bool]),loading:n.bool.isRequired,projectId:n.string.isRequired,hasSelectedResources:n.oneOfType([n.string,n.bool]),warning:n.object.isRequired,paramsErrTip:n.shape({projectId:n.string,blockletVersion:n.string,blockletTitle:n.string,blockletDescription:n.string,note:n.string,blockletResource:n.string,blockletHomepage:n.string,blockletSupport:n.string,blockletCommunity:n.string,blockletRepository:n.string,blockletDocker:n.object,dockerImageName:n.string}).isRequired};const mn=[".zip",".gz"],bn=1024*1024*100,fn=k.lazy(()=>_o(()=>import("./index-DoDx-vpV.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(t=>({default:t.Uploader})));function js({app:t,projectId:o,readOnly:s,params:r,setParams:l,setParamsErrTip:c,error:i}){const{t:d,locale:u}=X(),x=k.useRef(null),p=()=>s?!1:!o||o===F.UNOWNED_DID?(W.error(d("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${F.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${t.meta.did}/${o}/resource/upload`;return e.jsxs(a,{sx:{mt:3},children:[e.jsx(A,{gutterBottom:!0,children:d("blocklet.publish.resourceUpload")}),e.jsxs(Re,{direction:"row",spacing:1,sx:{alignItems:"center",flex:1,cursor:s?"default":"pointer"},children:[!!r.uploadedResource&&e.jsx(A,{component:"a",href:`${m}/params.uploadedResource`,children:r.uploadedResource}),!s&&e.jsx(G,{variant:"outlined",size:"small",onClick:()=>{p()&&x.current?.open()},children:r.uploadedResource?d("common.change"):d("common.upload")})]}),e.jsx(k.Suspense,{fallback:e.jsx(Ge,{}),children:e.jsx(fn,{ref:x,locale:u,popup:!0,onUploadFinish:f=>{l({uploadedResource:f.data.filename}),c({blockletResource:""}),x.current?.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileExts:mn,maxFileSize:bn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&e.jsx(a,{sx:{color:"error.main",mt:1,fontSize:14},children:i})]})}js.propTypes={app:n.object.isRequired,projectId:n.string.isRequired,readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,error:n.string.isRequired,setParamsErrTip:n.func.isRequired};function Tt({readOnly:t,params:o,setParams:s,paramsErrTip:r,setParamsErrTip:l,loading:c}){const{t:i}=X();return e.jsx(a,{className:"section",sx:{display:"flex",mt:3},children:e.jsxs(a,{sx:{flex:1},children:[e.jsx(ne,{required:!0,disabled:c||t,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,autoComplete:"off",variant:"outlined",fullWidth:!0,value:o.blockletVersion||"",onChange:d=>{l({blockletVersion:""}),s({blockletVersion:d.target.value})},error:!!r.blockletVersion,helperText:r.blockletVersion||"",slotProps:{input:{"data-cy":"blocklet-version",readOnly:t}}}),e.jsx(ne,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||t,variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,required:!0,value:o.note||"",onChange:d=>{l({note:""}),s({note:d.target.value.slice(0,me.PROJECT.MAX_NOTE_LENGTH)})},error:!!r.note,helperText:r.note||"",sx:{mt:3},slotProps:{input:{"data-cy":"release-note",readOnly:t,endAdornment:e.jsxs(Xe,{position:"end",children:[o?.note?.length||0," / ",me.PROJECT.MAX_NOTE_LENGTH]})}}})]})})}Tt.propTypes={readOnly:n.bool.isRequired,params:n.object.isRequired,setParams:n.func.isRequired,paramsErrTip:n.object.isRequired,setParamsErrTip:n.func.isRequired,loading:n.bool.isRequired};function ys(t){for(const o in t)typeof t[o]=="string"?t[o]=t[o].replace(/\\\\/g,"\\"):typeof t[o]=="object"&&t[o]!==null&&ys(t[o]);return t}var xn=Wr();const te=xo(xn),gn={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},Ut={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},kn={"--volume":!0,"--publish":!0},jn=new Set(["--publish","--volume"]),ws=t=>{const[o]=t.split(":");return o?.startsWith("/")||o?.startsWith("./")||o?.startsWith("../")||o?.startsWith("~")||o?.startsWith("$BLOCKLET")};function yn(t){return t.map(o=>{if(o.key!=="--volume"||o.value.startsWith("$BLOCKLET_APP_DIR/")||o.value.startsWith("$BLOCKLET_DATA_DIR/"))return o;const[s,...r]=o.value.split(":");if(!s||!ws(o.value))return o;const l=s.startsWith("/")?`$BLOCKLET_DATA_DIR${s}`:`$BLOCKLET_DATA_DIR/${s}`;return{...o,value:[l,...r].join(":")}})}function wn(t){let o=!0;return t.find(r=>r.key==="--publish"&&r.type==="web")?t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"docker":r.type};return o=r.type==="web",l}return r}):t.map(r=>{if(r.key==="--publish"){const l={...r,type:o?"web":"docker"};return o=!1,l}return r})}function ho(t){if(!t)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(t=t.trim(),t.startsWith("$ docker run")&&(t=t.replace("$ docker run","docker run")),!t.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const s=t.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!s)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const r=[],l=[];let c=0,i="",d="";const u=[];for(;c<s.length;){const p=s[c];if(!p){c++;continue}if(p==="docker"||p==="run"){c++;continue}if((p==="-e"||p==="--env")&&c+1<s.length){const m=s[c+1]||"",[f,...b]=m.split("=");if(f){const h=b.join("=").replace(/^['"]|['"]$/g,"");l.push({key:f,value:h})}c+=2;continue}if(p.startsWith("-")&&u.length===0){const m=p.indexOf("=");let f=p,b=null;m!==-1&&(f=p.substring(0,m),b=p.substring(m+1).replace(/^['"]|['"]$/g,""));const h=gn[f];if(!h){c+=2;continue}if(h==="--publish"){let j="";if(b)j=b,r.push({key:h,value:j});else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){j=(s[c+1]||"").replace(/^['"]|['"]$/g,""),r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}c++;continue}if(b!==null){r.push({key:h,value:b}),c++;continue}else if(c+1<s.length&&!(s[c+1]||"").startsWith("-")){const j=(s[c+1]||"").replace(/^['"]|['"]$/g,"");r.push({key:h,value:j}),c+=2;continue}else{r.push({key:h,value:"true"}),c++;continue}}u.push(p),c++}i=u[0]||"",d=u.slice(1).join(" ");const x=[];for(const p of r)p.name="",p.path="",p.prefix="",p.protocol="",p.proxyBehavior="service",p.type="docker",!(jn.has(p.key)&&p.value==="true")&&x.push(p);for(const p of l)p.custom="",p.description="",p.secure=!1,p.shared=!1,p.required=!1;return{dockerArgs:wn(yn(x)),dockerEnvs:l,dockerImage:i,dockerCommand:d}}function vn({dockerArgs:t,dockerEnvs:o,dockerImage:s,dockerCommand:r}){if(t.length===0&&o.length===0&&!s)return"";const l=["docker run \\"],c=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const i of t){const{key:d,value:u}=i;if(c.has(d))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}else if(!l.some(x=>x.startsWith(` ${d}`)))if(u==="true")l.push(` ${d} \\`);else{const x=/[\s"']/g.test(u)?`"${u}"`:u;l.push(` ${d} ${x} \\`)}}for(const i of o){const{key:d,value:u}=i,x=/["']/g.test(u)?u:`"${u}"`;l.push(` -e ${d}=${x} \\`)}return s&&l.push(` ${s} \\`),r&&l.push(` ${r} \\`),l[l.length-1]?.endsWith(" \\")&&(l[l.length-1]=(l[l.length-1]||"").slice(0,-2)),l.join(`
194
194
  `)}const vs={"--volume":t=>{const[o]=t.split(":");return o?ws(t)&&!t.startsWith("$BLOCKLET_APP_DIR/")&&!t.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":t.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},Qe=t=>t.replace(/^[-]+/,"").replace(/-([a-z])/g,(r,l)=>l.toUpperCase()),Cn=t=>`--${t.replace(/([A-Z])/g,"-$1").toLowerCase()}`,Rn=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],Sn=["rm ","sudo "];function Cs(t){if(t==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(t))throw new Error("Docker CMD is invalid");const s=t.toLocaleLowerCase();if(Sn.some(l=>s.indexOf(l)!==-1))throw new Error("Docker CMD is invalid");if(Rn.some(l=>t.indexOf(l)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(t))throw new Error("Docker CMD is invalid")}const Tn=Array.from(new Set(Object.keys(Ut).map(Qe))),Dn=["publish","volume"];te.object({workdir:te.string().trim().optional(),image:te.string().trim().regex(/^[^\s]+$/).optional(),shell:te.string().trim().optional(),volumes:te.array().items(te.string().trim()).optional(),script:te.string().trim().optional(),installNodeModules:te.boolean().optional(),skipWrapDockerfile:te.boolean().optional(),tmpfs:te.string().trim().optional(),command:te.string().allow("").default("").optional().custom((t,o)=>{try{return Cs(t),t}catch(s){return o.error("any.invalid",{message:s.message})}},"Docker CMD validation"),runBaseScript:te.boolean().optional(),...Tn.reduce((t,o)=>{const s=vs[Cn(o)];return Dn.includes(o)?(t[o]=te.array().items(te.string().trim()).optional(),s?t[o]=te.array().items(te.string().trim().custom((r,l)=>{const c=s(r);return c?l.message(c):r})).optional():t[o]=te.array().items(te.string().trim()).optional(),t):(s?t[o]=te.string().trim().custom((r,l)=>{const c=s(r);return c?l.message(c):r}).optional():t[o]=te.string().trim().optional(),t)},{})}).optional();function Dt({index:t,item:o,dockerParams:s,setDockerParams:r,dataKey:l,t:c,readOnly:i}){const d=o?.value||"",[u,x]=k.useState(!1),p=()=>{s[l]?.splice(t,1),r({...s,[l]:[...s[l]]})},m=(P,$)=>{s[l]?.[t]&&($?(s[l][t].custom=s[l][t].value,s[l][t].value=`$${Qe(o.key)}`):(s[l][t].value=s[l][t].custom||"",s[l][t].custom="")),r({...s,[l]:[...s[l]]})},f=(P,$)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],secure:$,value:$&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},r({...s,[l]:[...s[l]]})},b=(P,$)=>{s[l][t]={...s[l][t],shared:$},r({...s,[l]:[...s[l]]})},h=(P,$)=>{const w=s[l][t]?.value||"";s[l][t]={...s[l][t],required:$,value:$&&w===me.BLOCKLET_AUTOMATIC_ENV_VALUE?"":w},r({...s,[l]:[...s[l]]})},j=(P,$)=>{s[l][t]={...s[l][t],value:$?me.BLOCKLET_AUTOMATIC_ENV_VALUE:"",secure:!1,required:!1},r({...s,[l]:[...s[l]]})},v=P=>{s[l][t]={...s[l][t],description:P.target.value},r({...s,[l]:[...s[l]]})},g=P=>{const $=P.target.value==="web"?"web":"docker";$==="web"&&s.dockerArgs.forEach(Z=>{Z.type="docker"});const S=`/${s.dockerImage.replace(/\W/g,"-")}-${t}`;s.dockerArgs[t]={...s.dockerArgs[t],type:$,path:$==="docker"?S:"/",protocol:"http",prefix:$==="docker"?S:"/",name:"publicUrl",port:"BLOCKLET_PORT"},r({...s,dockerArgs:[...s.dockerArgs]})},C=P=>{s.dockerArgs[t]={...s.dockerArgs[t],proxyBehavior:P.target.value==="direct"?"direct":"service"},r({...s,dockerArgs:[...s.dockerArgs]})},D=P=>{const $=P.target.value;s[l][t]={...s[l][t],prefix:$,path:$==="*"?"/":$},r({...s,[l]:[...s[l]]})},R=P=>{s[l]?.[t]&&(s[l][t].value=P.target.value),r({...s,[l]:[...s[l]]})},y=d===`$${Qe(o.key)}`||o.custom,T=l==="dockerArgs"&&!Ut[o.key],O=kn[o.key],N=l==="dockerEnvs",z=o.key==="--publish";let K=o.key;return z&&o.type==="web"?K="--publish (Web)":N&&(K=`--env ${o.key}`),e.jsxs(a,{sx:{display:"flex",flexDirection:"row",gap:2,alignItems:"center"},children:[e.jsx(a,{sx:{width:250},children:e.jsx(A,{sx:{textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:K})}),e.jsxs(a,{sx:{display:"flex",flexDirection:"column",gap:1,flex:1},children:[e.jsx(ne,{disabled:i||y||T||o.value===me.BLOCKLET_AUTOMATIC_ENV_VALUE,placeholder:"",value:y?`$${Qe(o.key)}`:d,sx:{flex:1},error:T,onChange:R,slotProps:{input:{endAdornment:e.jsxs(Xe,{position:"end",sx:{zoom:.9},children:[(!(O||T)||N||z)&&e.jsx(ce,{onClick:()=>x(!0),children:e.jsx(ae,{icon:"icon-park-outline:setting-config"})}),!i&&e.jsx(ce,{onClick:p,color:T?"error":"default",children:e.jsx(ae,{icon:"ic:round-delete"})})]})}}}),T&&e.jsx(A,{variant:"caption",color:"error",children:c("blocklet.publish.docker.noAllowTheArg")}),o.key==="--publish"&&e.jsx(A,{variant:"caption",sx:{color:"text.secondary"},children:c("blocklet.publish.docker.publishTips")}),o.key==="--volume"&&vs[o.key](d)&&e.jsx(A,{variant:"caption",color:"error",children:c("blocklet.publish.docker.volumeTips")})]}),u&&e.jsx(ct,{open:!0,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:0}},title:c(N?"blocklet.publish.docker.modifyEnv":"blocklet.publish.docker.modifyParam"),onClose:()=>x(!1),children:e.jsxs(a,{sx:{display:"flex",flexDirection:"column",gap:1,paddingBottom:2},children:[O||T||N?null:e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.needCustomInput")}),e.jsx(Le,{disabled:i,checked:y,onChange:m,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.shared")}),e.jsx(Le,{disabled:i,checked:o.shared,onChange:b,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.required")}),e.jsx(Le,{disabled:i,checked:o.required,onChange:h,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.secure")}),e.jsx(Le,{disabled:i,checked:o.secure,onChange:f,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{children:c("blocklet.publish.docker.autoGenerated")}),e.jsx(Le,{disabled:i,checked:o.value===me.BLOCKLET_AUTOMATIC_ENV_VALUE,onChange:j,sx:{zoom:.9}})]}),N&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.description")}),e.jsx(ne,{disabled:i,value:o.description,onChange:v,sx:{flex:1},label:c("blocklet.publish.docker.description")})]}),z&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.portType")}),e.jsxs(vt,{value:o.type||"docker",onChange:g,children:[e.jsx(be,{value:"docker",children:"Docker"}),e.jsx(be,{value:"web",children:"Web"})]})]}),z&&o.type==="web"&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.proxyBehavior")}),e.jsxs(vt,{value:o.proxyBehavior||"service",onChange:C,children:[e.jsx(be,{value:"service",children:c("blocklet.publish.docker.serviceProxy")}),e.jsx(be,{value:"direct",children:c("blocklet.publish.docker.directProxy")})]})]}),z&&o.type==="web"&&e.jsxs(a,{sx:{mt:1,width:"100%",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(A,{sx:{flex:1},children:c("blocklet.publish.docker.prefix")}),e.jsx(ne,{disabled:i,value:o.prefix,onChange:D,sx:{flex:1},label:c("blocklet.publish.docker.prefix")})]})]})})]})}Dt.propTypes={dockerParams:n.object.isRequired,setDockerParams:n.func.isRequired,dataKey:n.string.isRequired,item:n.object.isRequired,t:n.func.isRequired,readOnly:n.bool.isRequired,index:n.number.isRequired};const In=`
195
195
  docker run --name postgrest
196
196
  -p 3000:3000
@@ -1,4 +1,4 @@
1
- import{j as B,ak as z,T as pe,z as gt,y as ht,bZ as dt,M as Ct,Q as Me,at as ce,ar as lt,cu as xt,ee as Et,ef as Rt,I as yt,eg as mt,D as bt,b4 as le,aj as wt,a6 as vt}from"./vendor-mui-core-DnR6WYuU.js";import{r as oe,p as Ve,g as It}from"./vendor-react-CTtPmzVP.js";import{L as St,g as Ze,u as Lt,l as Bt,e as _t,q as Tt}from"./vendor-hooks-qxhUUbW5.js";import{k as Ht,bc as Ot,_ as he,bn as ct}from"./vendor-ux-IiqHAjMq.js";import{aI as Nt}from"./vendor-utils-CxWN1dT3.js";import{mediaKitApi as Qt}from"./index-ETdrsXsn.js";import{r as De}from"./index-_tncRnTu.js";import"./lottie-web-4koyQiv_.js";import"./index-DG0EDext.js";import"./vendor-arcblock-DyliHtVF.js";import"./index-DRYJ0xIl.js";const ft=oe.createContext({}),pt=()=>oe.useContext(ft);function qt({children:h,restrictions:f,i18n:w,theme:R}){const[x,b]=St({loading:!1}),n=t=>b(a=>({...a,loading:t})),e=oe.useMemo(()=>({...x,onLoading:n,restrictions:f,i18n:w}),[x]);return B.jsx(Ht,{theme:R,children:B.jsx(ft.Provider,{value:e,children:h})})}const Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAskSURBVHgB7d3RcdTIGoZhcSJYMoAMIAIgAiACIALIwBCBIQIgA4jAkAEZQAYmAx+6iqnjM+vxjD3qX/qk56niYm92wYve6W790ty5+GMACPCfASCEYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExBAuIIVhADMECYggWEEOwgBiCBcQQLCCGYAExB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ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWECM/wKc/Y0zpWLfuAAAAABJRU5ErkJggg==",Mt=""+window.__toCdnUrl("assets/bedrock-yFRPpe__.png"),Zt=""+window.__toCdnUrl("assets/deepseek-C3x42pq3.png"),Dt=""+window.__toCdnUrl("assets/doubao-yPqHSkLx.png"),Gt=""+window.__toCdnUrl("assets/gemini-DffKpc81.png"),jt=""+window.__toCdnUrl("assets/google-DT1VSJ0m.png"),Vt=""+window.__toCdnUrl("assets/ideogram-REIjy0Er.png"),Ft=""+window.__toCdnUrl("assets/ollama-C7MZn2d_.png"),kt=""+window.__toCdnUrl("assets/openai-DlpqJdrb.png"),Yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0dSURBVHgB7d1Nb1XXucDxlahAogQUUi6VSG+iQCT7CmJyS0FB5WYQRreT209wP1w7yqhpB3QSKrUgEYWQFkIlLCW4aTASxrGRbRryIqX7OXBSILzY2Od4P2v9ftIRBKkDv5x/13r23us89V2nACTwdAFIQrCANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwgDQEC0hDsIA0BAtIQ7CANAQLSEOwqM7J9y+Wy1fmCvURLKqzvHKr/OHPf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AAAElFTkSuQmCC",ge={anthropic:Wt,bedrock:Mt,deepseek:Zt,doubao:Dt,gemini:Gt,google:jt,ideogram:Vt,ollama:Ft,openai:kt,openrouter:Yt,poe:Pt,xai:Ut},Fe={width:16,height:16,borderRadius:"2px",objectFit:"contain",backgroundColor:"transparent"};function Kt({onSubmit:h,models:f}){const{loading:w,i18n:R}=pt(),x=Ze({model:"",prompt:"",number:1}),b=()=>{const t=JSON.parse(JSON.stringify(x));Object.values(x).every(E=>!!E)&&h(t)},{run:n}=Lt(b,{wait:500}),e=oe.useMemo(()=>{const t=JSON.parse(JSON.stringify(x));return Object.values(t).some(a=>!a)},[JSON.stringify(x)]);return B.jsxs(zt,{onSubmit:t=>t.preventDefault(),children:[B.jsxs(z,{sx:{flex:1,height:"100%",overflow:"hidden",flexDirection:"column",display:"flex",mt:2,gap:2},children:[B.jsxs(z,{sx:{mx:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:R("aiImagePrompt")}),B.jsx(gt,{sx:{width:1},size:"small",type:"text",required:!0,placeholder:R("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:x.prompt??"",onChange:t=>{t.stopPropagation(),x.prompt=t.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),B.jsxs(z,{sx:{px:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${R("aiImageModel")}`}),B.jsx(ht,{fullWidth:!0,size:"small",children:B.jsx(dt,{sx:{width:1},value:x.model,onChange:t=>{x.number=1,x.model=t.target.value},MenuProps:{disablePortal:!0},renderValue:t=>{const a=f.find(i=>`${i.provider}/${i.model}`===t);return a?B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1},children:[ge[a.provider]&&B.jsx(z,{component:"img",src:ge[a.provider],alt:a.provider,style:Fe}),B.jsx(pe,{variant:"body2",children:a.model})]}):t},children:f.map(t=>B.jsx(Ct,{value:`${t.provider}/${t.model}`,children:B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ge[t.provider]&&B.jsx(z,{component:"img",src:ge[t.provider],alt:t.provider,style:Fe}),B.jsx(pe,{variant:"body2",sx:{flex:1},children:t.model})]})},`${t.provider}/${t.model}`))})})]})]}),B.jsx(Me,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:n,disabled:w||e,children:R(w?"aiImageGenerating":"aiImageGenerate")},w?"loading-submit":"submit")]})}const zt=ce(z)`
1
+ import{j as B,ak as z,T as pe,z as gt,y as ht,bZ as dt,M as Ct,Q as Me,at as ce,ar as lt,cu as xt,ee as Et,ef as Rt,I as yt,eg as mt,D as bt,b4 as le,aj as wt,a6 as vt}from"./vendor-mui-core-DnR6WYuU.js";import{r as oe,p as Ve,g as It}from"./vendor-react-CTtPmzVP.js";import{L as St,g as Ze,u as Lt,l as Bt,e as _t,q as Tt}from"./vendor-hooks-qxhUUbW5.js";import{k as Ht,bc as Ot,_ as he,bn as ct}from"./vendor-ux-jvAfFAl1.js";import{aI as Nt}from"./vendor-utils-CxWN1dT3.js";import{mediaKitApi as Qt}from"./index-DoDx-vpV.js";import{r as De}from"./index-_tncRnTu.js";import"./lottie-web-4koyQiv_.js";import"./index-NWCpUGtr.js";import"./vendor-arcblock-B1iA4v4a.js";import"./index-DRYJ0xIl.js";const ft=oe.createContext({}),pt=()=>oe.useContext(ft);function qt({children:h,restrictions:f,i18n:w,theme:R}){const[x,b]=St({loading:!1}),n=t=>b(a=>({...a,loading:t})),e=oe.useMemo(()=>({...x,onLoading:n,restrictions:f,i18n:w}),[x]);return B.jsx(Ht,{theme:R,children:B.jsx(ft.Provider,{value:e,children:h})})}const Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAskSURB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9T+CNdTOXlWdfcxd5aM6ZrKWQ7CG2k+wtd4d3Fb9qI6ZrGVYfbCq33u1pkdx9qncFprJWobVB6tyqb32w/ZtlfNMZrKWYfXB8maGaVWd6ZnJWgZfVQ/EcOgOxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWEAMwQJiCBYQQ7CAGIIFxBAsIIZgATEEC4ghWECM/wKc/Y0zpWLfuAAAAABJRU5ErkJggg==",Mt=""+window.__toCdnUrl("assets/bedrock-yFRPpe__.png"),Zt=""+window.__toCdnUrl("assets/deepseek-C3x42pq3.png"),Dt=""+window.__toCdnUrl("assets/doubao-yPqHSkLx.png"),Gt=""+window.__toCdnUrl("assets/gemini-DffKpc81.png"),jt=""+window.__toCdnUrl("assets/google-DT1VSJ0m.png"),Vt=""+window.__toCdnUrl("assets/ideogram-REIjy0Er.png"),Ft=""+window.__toCdnUrl("assets/ollama-C7MZn2d_.png"),kt=""+window.__toCdnUrl("assets/openai-DlpqJdrb.png"),Yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA0dSURBVHgB7d1Nb1XXucDxlahAogQUUi6VSG+iQCT7CmJyS0FB5WYQRreT209wP1w7yqhpB3QSKrUgEYWQFkIlLCW4aTASxrGRbRry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BAtIQLCANwQLSECwgDcEC0hAsIA3BAtIQLCANwQLSECwgDcEC0vgXkv5P8wQTb/sAAAAASUVORK5CYII=",Pt=""+window.__toCdnUrl("assets/poe-B588TgZu.png"),Ut="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA1dSURBVHgB7d3tbRXXFgbg8dX9T1wBoQPSQejAVBBTgXEFSSogqQBcgdMBdAAdkA6gg3O9kCwhX3POfO5Za+Z5JCdSZBIfO+f1Xnve2XN2uNMBFPCfDqAIgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGw2J1///23e/bsWXd2drb6x6tXrzr6Ozvc6WBHXrx40X348KFb288//9y9f//+29/pxwqLXfnzzz9ThFV48+aNsBrICovduB8FM7i6uur++uuvjmEEFrsRYRWhtbZYVX3+/LljOCMhuxCjYIawCrFvxTgCi82LPas//vijy+D333+3bzWBkZBNi1VVXBXMsLp6/vx59/Hjx47xrLDYtCyj4E8//dTd3t52TCOw2Kx37959+8hAhWEeRkI2KdMoeHl52b19+7ZjOoHFJmmzb5ORkM3J1GY/dVUwS9WiCissNqVam/3ly5c24wcQWGxKpjZ7VBji6uCP/P33393r1687b8H+jIRsRrY2+7Gwiq8zwophBBabUK3NHhcFGE5gUV6sVrIchBdBdSo4v18Juno4jMCivExt9lM3Nn/69CnNS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Fvz0Ca4S9tNnHylR1mNKC10bPR2ANtLc2+1jZWvBGw20QWAPstc0+VqYWfJxNRn0Ca4C9ttnHynSDdLTgs5z+GlwlHOfscKcDKMAKCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoAyBBZQhsIAyBBZQhsACyhBYQBkCCyhDYAFlCCygDIEFlCGwgDIEFlCGwALKEFhAGQILKENgAWUILKAMgQWUIbCAMgQWUIbAAsoQWEAZAgsoQ2ABZQgsoIz/AWP7oZ6cDDZCAAAAAElFTkSuQmCC",ge={anthropic:Wt,bedrock:Mt,deepseek:Zt,doubao:Dt,gemini:Gt,google:jt,ideogram:Vt,ollama:Ft,openai:kt,openrouter:Yt,poe:Pt,xai:Ut},Fe={width:16,height:16,borderRadius:"2px",objectFit:"contain",backgroundColor:"transparent"};function Kt({onSubmit:h,models:f}){const{loading:w,i18n:R}=pt(),x=Ze({model:"",prompt:"",number:1}),b=()=>{const t=JSON.parse(JSON.stringify(x));Object.values(x).every(E=>!!E)&&h(t)},{run:n}=Lt(b,{wait:500}),e=oe.useMemo(()=>{const t=JSON.parse(JSON.stringify(x));return Object.values(t).some(a=>!a)},[JSON.stringify(x)]);return B.jsxs(zt,{onSubmit:t=>t.preventDefault(),children:[B.jsxs(z,{sx:{flex:1,height:"100%",overflow:"hidden",flexDirection:"column",display:"flex",mt:2,gap:2},children:[B.jsxs(z,{sx:{mx:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:R("aiImagePrompt")}),B.jsx(gt,{sx:{width:1},size:"small",type:"text",required:!0,placeholder:R("aiImagePromptTip"),multiline:!0,minRows:5,maxRows:6,value:x.prompt??"",onChange:t=>{t.stopPropagation(),x.prompt=t.target.value},slotProps:{htmlInput:{maxLength:1e3}}})]}),B.jsxs(z,{sx:{px:2,display:"flex",flexDirection:"column",gap:1},children:[B.jsx(pe,{gutterBottom:!0,className:"title label",sx:{color:"text.primary"},children:`${R("aiImageModel")}`}),B.jsx(ht,{fullWidth:!0,size:"small",children:B.jsx(dt,{sx:{width:1},value:x.model,onChange:t=>{x.number=1,x.model=t.target.value},MenuProps:{disablePortal:!0},renderValue:t=>{const a=f.find(i=>`${i.provider}/${i.model}`===t);return a?B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1},children:[ge[a.provider]&&B.jsx(z,{component:"img",src:ge[a.provider],alt:a.provider,style:Fe}),B.jsx(pe,{variant:"body2",children:a.model})]}):t},children:f.map(t=>B.jsx(Ct,{value:`${t.provider}/${t.model}`,children:B.jsxs(z,{sx:{display:"flex",alignItems:"center",gap:1,width:"100%"},children:[ge[t.provider]&&B.jsx(z,{component:"img",src:ge[t.provider],alt:t.provider,style:Fe}),B.jsx(pe,{variant:"body2",sx:{flex:1},children:t.model})]})},`${t.provider}/${t.model}`))})})]})]}),B.jsx(Me,{sx:{m:2,transition:"all 0.3s"},className:"submit-ai",variant:"contained",onClick:n,disabled:w||e,children:R(w?"aiImageGenerating":"aiImageGenerate")},w?"loading-submit":"submit")]})}const zt=ce(z)`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  height: 100%;
@@ -1,4 +1,4 @@
1
- import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-DnR6WYuU.js";import{C as U}from"./Google-UUKF9aLU.js";import{aU as G}from"./vendor-ux-IiqHAjMq.js";import{c as Y}from"./create-passport-svg-BwkPTICE.js";import{A as Z}from"./vendor-arcblock-DyliHtVF.js";import{q as $}from"./index-DG0EDext.js";import{R as J}from"./required-BQln5OcV.js";import{F as Q}from"./form-wrapper-PT5ZzMQy.js";import{L as v}from"./logo-uploader-6T6d75Q6.js";import{A as ee,a as ne,b as te}from"./collapse-B7gUzFaX.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 T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(U,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(G),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
1
+ import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-DnR6WYuU.js";import{C as U}from"./Google-Bjq5o7qL.js";import{aU as G}from"./vendor-ux-jvAfFAl1.js";import{c as Y}from"./create-passport-svg-BKhJ2ufW.js";import{A as Z}from"./vendor-arcblock-B1iA4v4a.js";import{r as $}from"./index-NWCpUGtr.js";import{R as J}from"./required-BQln5OcV.js";import{F as Q}from"./form-wrapper-PT5ZzMQy.js";import{L as v}from"./logo-uploader-BFMnNkRn.js";import{A as ee,a as ne,b as te}from"./collapse-B7gUzFaX.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 T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(U,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(G),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -8,4 +8,4 @@ import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN a
8
8
  25%, 75% {
9
9
  transform: scale(1.1) translateX(3px);
10
10
  }
11
- `,oe={input:D,color:T,passport:O,uploader:n=>e.jsx(v,{...n.componentProps})};function se(n,{editing:s=!1}){const{componentType:l="input",render:i,renderFormItem:c}=n;return s&&c?c:!s&&i?i:oe[l?.toLowerCase()]}V.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};function V({item:n,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,disabled:m=!1,loading:f=!1,onCancel:h=()=>{},formValues:b}){const{key:y,description:p,required:a,solo:R=!1,hidden:g=!1,componentProps:C={},skipButtonDisabled:w=!1}=n;if(g)return null;const q=s(y),{editing:I,shaking:E}=q??{},F=l(n,{editing:I}),r=se(n,{editing:I}),t={inputProps:{"data-cy":"schema-form-item-component"},key:y,description:p,editing:I,value:F,onChange:(x,d="change")=>i(n,x,d),componentProps:C,skipButtonDisabled:w,onBlur:()=>c(n)};return n.componentType==="collapse"&&n.children?.length>0?e.jsxs(ee,{children:[e.jsx(ne,{expandIcon:e.jsx(B,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:n.description}),e.jsx(te,{children:n.children.map(x=>e.jsx(V,{item:x,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,formValues:b,disabled:m,loading:f,onCancel:h},x.key))})]}):e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",sx:{color:a&&!F?"error.main":"text.secondary"},children:[p,a&&e.jsx(J,{})]}),e.jsxs(j,{className:"form-item-body",children:[e.jsx(j,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:R?"center":"left"},style:{cursor:"text"},onClick:()=>{m||q?.edited||w||i(n,b[y],"edit")},children:e.jsx(r,{...t})}),!R&&e.jsx(j,{className:"form-item-action",style:{marginLeft:0},children:I?e.jsxs(e.Fragment,{children:[q.edited?e.jsx(P,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(n,F,"confirm")},disabled:m||f,sx:{animation:E?`${re} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?e.jsx(W,{size:24}):e.jsx(M,{})}):null,e.jsx(P,{"data-cy":"schema-form-item-cancel",onClick:()=>h(n),style:{paddingLeft:q.edited?4:8},disabled:m||f,size:"large",children:e.jsx(X,{})})]}):null})]})]},y)}function ie({schema:n,loading:s=!1,value:l=void 0,defaultValue:i={},onChange:c,style:m={},disabled:f=!1}){const h=Object.prototype.toString.call(l)==="[object Object]",[b,y]=u.useState([]),[p,a]=u.useState(h?l:i),R=u.useMemo(()=>n.length===1,[n]),g=u.useCallback(r=>b.find(t=>t.key===r),[b]);u.useEffect(()=>{R&&n[0]?.required&&y([{key:n[0].key,editing:!0,initialValue:i[n[0].key]}])},[n,R,i]);const C=u.useCallback(r=>{y(t=>t.find(d=>d.key===r.key)?t.map(d=>d.key===r.key?r:{...d}):[r].concat(t))},[]),w=u.useCallback((r,t,x)=>{const{key:d,secure:_}=r,k=g(d)??{...r};k.editing=!0;const z=p[d]!==t;k.edited=t&&k.initialValue!==t,k.initialValue=i[d];const N={...p,[d]:t};z&&a(N),c({[d]:t},{allValues:N,action:x,currentItem:r}),x==="confirm"&&_&&a({...p,[d]:"__encrypted__"}),x==="confirm"&&(k.initialValue=p[d]),["confirm","cancel"].includes(x)&&(k.editing=!1,k.edited=!1),C(k)},[i,p,c,C,g]),q=u.useCallback((r,{editing:t=!1})=>{const{key:x}=r,d=h?l[x]:p[x];return d==="__encrypted__"?t?"":"******":d},[h,l,p]),I=u.useCallback(r=>{const t=g(r.key);t&&w(r,t.initialValue,"cancel")},[g,w]),E=u.useCallback(r=>{const t=g(r.key);!t||!t.edited||(t.shaking=!0,C(t),setTimeout(()=>{t.shaking=!1,C(t)},500))},[g,C]),F=u.useCallback(r=>{const t=g(r.key);!t||!t.edited?I(r):E(r)},[g,E,I]);return e.jsx(ae,{className:"form",style:m,children:n?.map(r=>{const{hidden:t=!1}=r;return t?null:e.jsx(V,{item:r,findEditingItem:g,getItemValue:q,onFormItemChange:w,onFocusOut:F,formValues:p,disabled:f,loading:s,onCancel:I})})})}ie.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};const ae=K(Q)``;export{ie as S};
11
+ `,oe={input:D,color:T,passport:O,uploader:n=>e.jsx(v,{...n.componentProps})};function se(n,{editing:s=!1}){const{componentType:l="input",render:i,renderFormItem:c}=n;return s&&c?c:!s&&i?i:oe[l?.toLowerCase()]}V.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};function V({item:n,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,disabled:m=!1,loading:f=!1,onCancel:h=()=>{},formValues:b}){const{key:y,description:p,required:a,solo:R=!1,hidden:g=!1,componentProps:C={},skipButtonDisabled:w=!1}=n;if(g)return null;const F=s(y),{editing:I,shaking:E}=F??{},q=l(n,{editing:I}),r=se(n,{editing:I}),t={inputProps:{"data-cy":"schema-form-item-component"},key:y,description:p,editing:I,value:q,onChange:(x,d="change")=>i(n,x,d),componentProps:C,skipButtonDisabled:w,onBlur:()=>c(n)};return n.componentType==="collapse"&&n.children?.length>0?e.jsxs(ee,{children:[e.jsx(ne,{expandIcon:e.jsx(B,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:n.description}),e.jsx(te,{children:n.children.map(x=>e.jsx(V,{item:x,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,formValues:b,disabled:m,loading:f,onCancel:h},x.key))})]}):e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",sx:{color:a&&!q?"error.main":"text.secondary"},children:[p,a&&e.jsx(J,{})]}),e.jsxs(j,{className:"form-item-body",children:[e.jsx(j,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:R?"center":"left"},style:{cursor:"text"},onClick:()=>{m||F?.edited||w||i(n,b[y],"edit")},children:e.jsx(r,{...t})}),!R&&e.jsx(j,{className:"form-item-action",style:{marginLeft:0},children:I?e.jsxs(e.Fragment,{children:[F.edited?e.jsx(P,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(n,q,"confirm")},disabled:m||f,sx:{animation:E?`${re} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?e.jsx(W,{size:24}):e.jsx(M,{})}):null,e.jsx(P,{"data-cy":"schema-form-item-cancel",onClick:()=>h(n),style:{paddingLeft:F.edited?4:8},disabled:m||f,size:"large",children:e.jsx(X,{})})]}):null})]})]},y)}function ie({schema:n,loading:s=!1,value:l=void 0,defaultValue:i={},onChange:c,style:m={},disabled:f=!1}){const h=Object.prototype.toString.call(l)==="[object Object]",[b,y]=u.useState([]),[p,a]=u.useState(h?l:i),R=u.useMemo(()=>n.length===1,[n]),g=u.useCallback(r=>b.find(t=>t.key===r),[b]);u.useEffect(()=>{R&&n[0]?.required&&y([{key:n[0].key,editing:!0,initialValue:i[n[0].key]}])},[n,R,i]);const C=u.useCallback(r=>{y(t=>t.find(d=>d.key===r.key)?t.map(d=>d.key===r.key?r:{...d}):[r].concat(t))},[]),w=u.useCallback((r,t,x)=>{const{key:d,secure:_}=r,k=g(d)??{...r};k.editing=!0;const z=p[d]!==t;k.edited=t&&k.initialValue!==t,k.initialValue=i[d];const N={...p,[d]:t};z&&a(N),c({[d]:t},{allValues:N,action:x,currentItem:r}),x==="confirm"&&_&&a({...p,[d]:"__encrypted__"}),x==="confirm"&&(k.initialValue=p[d]),["confirm","cancel"].includes(x)&&(k.editing=!1,k.edited=!1),C(k)},[i,p,c,C,g]),F=u.useCallback((r,{editing:t=!1})=>{const{key:x}=r,d=h?l[x]:p[x];return d==="__encrypted__"?t?"":"******":d},[h,l,p]),I=u.useCallback(r=>{const t=g(r.key);t&&w(r,t.initialValue,"cancel")},[g,w]),E=u.useCallback(r=>{const t=g(r.key);!t||!t.edited||(t.shaking=!0,C(t),setTimeout(()=>{t.shaking=!1,C(t)},500))},[g,C]),q=u.useCallback(r=>{const t=g(r.key);!t||!t.edited?I(r):E(r)},[g,E,I]);return e.jsx(ae,{className:"form",style:m,children:n?.map(r=>{const{hidden:t=!1}=r;return t?null:e.jsx(V,{item:r,findEditingItem:g,getItemValue:F,onFormItemChange:w,onFocusOut:q,formValues:p,disabled:f,loading:s,onCancel:I})})})}ie.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};const ae=K(Q)``;export{ie as S};