@abtnode/webapp 1.16.29-beta-924d4db7 → 1.16.29-beta-87e06e1c

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 (209) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-R25cZfQ7.js → Add-9p89cr51.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-B70H9TLI.js → ArrowDropDown-PUGycbah.js} +1 -1
  5. package/dist/assets/{Autocomplete-lQIAHH0f.js → Autocomplete-CBrNN6Wi.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-DKONJeCv.js → Breadcrumbs-YbVhGF74.js} +1 -1
  7. package/dist/assets/{ButtonGroup-DIddKbz4.js → ButtonGroup-qjpoNO9j.js} +1 -1
  8. package/dist/assets/{CheckCircle-BJCDxSmg.js → CheckCircle-C458wd7t.js} +1 -1
  9. package/dist/assets/{ChevronLeft-DkAxUxaL.js → ChevronLeft-Bvm6nyLn.js} +1 -1
  10. package/dist/assets/{ChevronRight-BmodGMIR.js → ChevronRight-pbRslwzZ.js} +1 -1
  11. package/dist/assets/{Close-Crlhu1gh.js → Close-CRs5nN-9.js} +1 -1
  12. package/dist/assets/{Delete-CrjB4xBG.js → Delete-BTd8aIqu.js} +1 -1
  13. package/dist/assets/DeleteOutline-CT39B0th.js +1 -0
  14. package/dist/assets/DeleteOutline-DkbzMi-O.js +1 -0
  15. package/dist/assets/{Done-Dh1HNrje.js → Done-DycYtcxi.js} +1 -1
  16. package/dist/assets/{Edit-BmjnjV4o.js → Edit-CWojktHH.js} +1 -1
  17. package/dist/assets/{EditIcon-Dmb-RHKW.js → EditIcon-ugJwCH0S.js} +1 -1
  18. package/dist/assets/{FilterList-1v-QYJKg.js → FilterList-Cv0uknPg.js} +5 -5
  19. package/dist/assets/{Google-BVA2G_jw.js → Google-Bpr-eboG.js} +1 -1
  20. package/dist/assets/{Https-Bk4pEwaI.js → Https-DEV-Mw3j.js} +1 -1
  21. package/dist/assets/{InputAdornment-Dq98l8WX.js → InputAdornment-GAXpW_Pc.js} +1 -1
  22. package/dist/assets/{InputLabel-C0MowDYM.js → InputLabel-CdP2Vrv8.js} +1 -1
  23. package/dist/assets/{LastPage-D3djMPDV.js → LastPage-BTLBin5_.js} +1 -1
  24. package/dist/assets/{Launch-BXNO5-AB.js → Launch-C4_ktc4w.js} +1 -1
  25. package/dist/assets/{Link-iUvOe_0B.js → Link-DbSs28Vg.js} +1 -1
  26. package/dist/assets/{LoadingButton-zGO5vZVM.js → LoadingButton-DXivgZhE.js} +1 -1
  27. package/dist/assets/{LockIcon-D5qESv6d.js → LockIcon-QS29DL1o.js} +1 -1
  28. package/dist/assets/{Loop-BuS5QyRc.js → Loop-Dpp5fctN.js} +1 -1
  29. package/dist/assets/{MoreVert-j9UJKkr6.js → MoreVert-YMJ5zQGi.js} +1 -1
  30. package/dist/assets/{Pagination-CU9MiHeH.js → Pagination-Dw5SQ0Cx.js} +1 -1
  31. package/dist/assets/{Public-CNI1n1ip.js → Public-DuGVgRc8.js} +1 -1
  32. package/dist/assets/{SchemaReference.es-BoUIpk_7.js → SchemaReference.es-CuLNjPJp.js} +1 -1
  33. package/dist/assets/{Search-DdOWC3-l.js → Search-CnmiZ7r5.js} +1 -1
  34. package/dist/assets/{Select-DFShmSX4.js → Select-D_jjFrx2.js} +2 -2
  35. package/dist/assets/{Skeleton-DZXKedF8.js → Skeleton-DMU-9YHS.js} +5 -5
  36. package/dist/assets/{Slider-DwDD12e9.js → Slider-OEZKoU_q.js} +1 -1
  37. package/dist/assets/{Stepper-X7fZGQnQ.js → Stepper-BLioo72i.js} +1 -1
  38. package/dist/assets/{TextField-BIxqRuYh.js → TextField-udFGOQyD.js} +1 -1
  39. package/dist/assets/{ToggleButtonGroup-D8M7B8jp.js → ToggleButtonGroup-DOF-aia7.js} +1 -1
  40. package/dist/assets/{ViewList-L_cnowYR.js → ViewList-e_g9Zmbu.js} +1 -1
  41. package/dist/assets/{actions-BcyDmatM.js → actions-BWX_qXJD.js} +1 -1
  42. package/dist/assets/{actions-XylnHbsY.js → actions-e3525553.js} +1 -1
  43. package/dist/assets/{agreement-B-WzIvLt.js → agreement-CvcGSLJB.js} +2 -2
  44. package/dist/assets/api-DeLIbQas.js +1 -0
  45. package/dist/assets/{app-avatar-Ckes_yQg.js → app-avatar-CFWpqff1.js} +1 -1
  46. package/dist/assets/ar-DAUz5_Ej.js +1 -0
  47. package/dist/assets/{audit-logs-BDgFNcNM.js → audit-logs-DPElXT2k.js} +1 -1
  48. package/dist/assets/blocklet-BBUrtnew.js +1 -0
  49. package/dist/assets/{brace-fold.es-CTlHj9Yh.js → brace-fold.es-CXHeYjf1.js} +1 -1
  50. package/dist/assets/{bundle-avatar-BY2nARYo.js → bundle-avatar-DEQzPsHD.js} +1 -1
  51. package/dist/assets/{chart-2Xt2fIeo.js → chart-B4W7fRqI.js} +1 -1
  52. package/dist/assets/{click-to-copy-C_IAO7KR.js → click-to-copy-6L_LfYIl.js} +1 -1
  53. package/dist/assets/{closebrackets.es-DPAnsadO.js → closebrackets.es-ZZ8LeVnj.js} +1 -1
  54. package/dist/assets/{codemirror.es-D5rCWz3k.js → codemirror.es-CF4ao-W3.js} +1 -1
  55. package/dist/assets/{comment.es-gPWKA0Nj.js → comment.es-DQ_cLmdb.js} +1 -1
  56. package/dist/assets/{config-navigation-BIdJOyx5.js → config-navigation-CkEBHj2r.js} +1 -1
  57. package/dist/assets/de-JXmbvsP-.js +1 -0
  58. package/dist/assets/{delete-confirm-CQ5chdBo.js → delete-confirm-BN8gy06y.js} +1 -1
  59. package/dist/assets/{detail-fXteNAJ8.js → detail-CP83_tPj.js} +3 -3
  60. package/dist/assets/{dialog.es-Dz_F-cop.js → dialog.es-DExnqR6t.js} +1 -1
  61. package/dist/assets/{download-C7Ang0v6.js → download-DKskcy43.js} +5 -5
  62. package/dist/assets/es-D_uIRKnu.js +1 -0
  63. package/dist/assets/{foldgutter.es-Cy1h3hL-.js → foldgutter.es-BRAMSNxp.js} +1 -1
  64. package/dist/assets/fr-BocLckhV.js +1 -0
  65. package/dist/assets/getValidReactChildren-DItgry09.js +1 -0
  66. package/dist/assets/hi-Bn38t0nX.js +1 -0
  67. package/dist/assets/{hint.es-CXsohjGX.js → hint.es-6G79xByO.js} +1 -1
  68. package/dist/assets/{hint.es2-C4glUxfh.js → hint.es2-Baw04wRx.js} +1 -1
  69. package/dist/assets/id-DuC9mOr4.js +1 -0
  70. package/dist/assets/{iframe-D6qR_3ri.js → iframe-CpnjA8zm.js} +1 -1
  71. package/dist/assets/{index-CPh559U2.js → index-2gGHhy3B.js} +1 -1
  72. package/dist/assets/{index-BoZx42kN.js → index-B2cmqIK_.js} +1 -1
  73. package/dist/assets/{index-B7hs0P0M.js → index-B6T71Xra.js} +3 -3
  74. package/dist/assets/{index-DjDrwMwk.js → index-BBsadaJh.js} +4 -4
  75. package/dist/assets/{index-93rdCclb.js → index-BIJwoRQp.js} +1 -1
  76. package/dist/assets/{index-BP0jhdgI.js → index-BWxquNjq.js} +1 -1
  77. package/dist/assets/index-BdNyli-L.js +16 -0
  78. package/dist/assets/{index-CKoRQbL4.js → index-Bj-A_LO-.js} +1 -1
  79. package/dist/assets/{index-VgSzbGP5.js → index-C3f4JgKQ.js} +1 -1
  80. package/dist/assets/{index-zhMYpdaE.js → index-CB51-nwP.js} +1 -1
  81. package/dist/assets/index-CBhH59N7.js +2 -0
  82. package/dist/assets/index-CIh5WVdy.js +54 -0
  83. package/dist/assets/{index-BRUsJJ9E.js → index-CIsUZHl3.js} +3 -3
  84. package/dist/assets/{index-CiTOd0f5.js → index-CJBXTfA_.js} +10 -10
  85. package/dist/assets/{index-DJXP92GG.js → index-COF37GzL.js} +1 -1
  86. package/dist/assets/{index-BUAD1OTq.js → index-CS1P34PK.js} +1 -1
  87. package/dist/assets/{index-D_k_Olx_.js → index-Ca8SBrNy.js} +1 -1
  88. package/dist/assets/index-Cse3dDDG.js +21 -0
  89. package/dist/assets/index-D0qCsQ_X.js +11 -0
  90. package/dist/assets/{index-BNRm2Xtr.js → index-D0y4Peo7.js} +3 -3
  91. package/dist/assets/{index-Chpxsuu0.js → index-D3_95_AQ.js} +1 -1
  92. package/dist/assets/index-DDVZbDc5.js +131 -0
  93. package/dist/assets/{index-BEHxtswt.js → index-DH_YItOr.js} +1 -1
  94. package/dist/assets/{index-CNmwHsby.js → index-DM-kSqOV.js} +1 -1
  95. package/dist/assets/{index-DlnLadUb.js → index-DOvGlVxX.js} +1 -1
  96. package/dist/assets/{index-BC0NMNQX.js → index-DQvie1Xo.js} +1 -1
  97. package/dist/assets/index-DT3eBYfa.js +1 -0
  98. package/dist/assets/{index-DPskKZ67.js → index-DTCh76Oq.js} +9 -9
  99. package/dist/assets/index-DTt6OFJv.js +1 -0
  100. package/dist/assets/{index-B7vPshgV.js → index-DVd2dq8l.js} +1 -1
  101. package/dist/assets/index-DW_sEbOX.js +2491 -0
  102. package/dist/assets/{index-D87Grs_R.js → index-DYG5Tovq.js} +1 -1
  103. package/dist/assets/{index-CpLXBcU2.js → index-DcAqvRRT.js} +1 -1
  104. package/dist/assets/{index-BmH69n-l.js → index-DgFCpT_-.js} +5 -5
  105. package/dist/assets/{index-BMznxoOz.js → index-DwL4aLvY.js} +9 -9
  106. package/dist/assets/{index-DhmDR0Ng.js → index-Dylb0qYR.js} +1 -1
  107. package/dist/assets/{index-DPzIFozG.js → index-Dz1ahtjo.js} +10 -10
  108. package/dist/assets/{index-DwaBjaXn.js → index-I6_9XQww.js} +1 -1
  109. package/dist/assets/{index-DqhKfK7p.js → index-KGG0_6hI.js} +1 -1
  110. package/dist/assets/{index-DWG0Ov8f.js → index-OpPbc3XM.js} +6 -6
  111. package/dist/assets/{index-BB3gqUNz.js → index-WT4dVA5f.js} +1 -1
  112. package/dist/assets/{index-BToxpJgs.js → index-XomN73iI.js} +1 -1
  113. package/dist/assets/{index-Bdi6R8Nl.js → index-aeB_hGnn.js} +1 -1
  114. package/dist/assets/{index-CVHCRunX.js → index-brs4Ovtr.js} +1 -1
  115. package/dist/assets/{index-DGgnSEH7.js → index-mFd06l0F.js} +3 -3
  116. package/dist/assets/{index.es-DGXzHlWb.js → index.es-D1k5M1E2.js} +1 -1
  117. package/dist/assets/{index.esm-k8ocYudx.js → index.esm-NzqlBaFf.js} +1 -1
  118. package/dist/assets/{info-addon.es-kUa8-T6D.js → info-addon.es-D28Gve7b.js} +1 -1
  119. package/dist/assets/{info.es-Dc-GRWWB.js → info.es-BHx5fgaf.js} +1 -1
  120. package/dist/assets/{install-from-url-Bti2J2br.js → install-from-url-D913MaCZ.js} +1 -1
  121. package/dist/assets/{invitation-DfR9WxzY.js → invitation-DSwZ-Xej.js} +6 -6
  122. package/dist/assets/{is-path-prefix-equal-D-HjkB4G.js → is-path-prefix-equal-ufTBNRSJ.js} +1 -1
  123. package/dist/assets/isEqual-vbSrcyPi.js +1 -0
  124. package/dist/assets/{item-DF4Nk2eZ.js → item-B7ZSMqn6.js} +31 -31
  125. package/dist/assets/ja-B2J7-ZGM.js +1 -0
  126. package/dist/assets/{javascript.es-DwIUeeWD.js → javascript.es-WSUko8sV.js} +1 -1
  127. package/dist/assets/{jump-to-line.es-CkOrY_Fe.js → jump-to-line.es-CcgyMzYU.js} +1 -1
  128. package/dist/assets/{jump.es-CFHlR2lu.js → jump.es-dMMEnQpp.js} +1 -1
  129. package/dist/assets/ko-TAMb2jXz.js +1 -0
  130. package/dist/assets/{line-BnTOgrYf.js → line-VZzxMXH1.js} +4 -4
  131. package/dist/assets/{lint.es-BJVhSgfY.js → lint.es-BJtFL-R1.js} +1 -1
  132. package/dist/assets/{lint.es2-BiXPX6bi.js → lint.es2-8JV00Yve.js} +1 -1
  133. package/dist/assets/{lint.es3-BULj-cPm.js → lint.es3-1yXUm-RP.js} +1 -1
  134. package/dist/assets/{list-header-AfOdlLFR.js → list-header-DwVsFEjc.js} +1 -1
  135. package/dist/assets/{log-3x522WGd.js → log-BpKaLgPW.js} +1 -1
  136. package/dist/assets/{lottie-CX5d6rq5.js → lottie-O2tV-OjZ.js} +1 -1
  137. package/dist/assets/{matchbrackets.es-C1B5k-tj.js → matchbrackets.es-rEntxSn4.js} +1 -1
  138. package/dist/assets/{memory--ykPq6zK.js → memory-GChDLCy_.js} +1 -1
  139. package/dist/assets/{mode.es-B8N5TzF6.js → mode.es-BR84FRL3.js} +1 -1
  140. package/dist/assets/{mode.es2-CnuCmA5g.js → mode.es2-C9o9JxCy.js} +1 -1
  141. package/dist/assets/{mode.es3-CM03woHB.js → mode.es3-hEzwa8oI.js} +1 -1
  142. package/dist/assets/{onlineParser.es-C1LE6Oxs.js → onlineParser.es-bjnhX9oL.js} +1 -1
  143. package/dist/assets/overview-y9hXmNWR.js +23 -0
  144. package/dist/assets/pt-DAmg1w9n.js +1 -0
  145. package/dist/assets/{react-LlVsx8aM.js → react-D74HYKcx.js} +3 -3
  146. package/dist/assets/{redux-CkgCCMBw.js → redux-AeaWrwCk.js} +1 -1
  147. package/dist/assets/{resource-dialog-BFzRgbm7.js → resource-dialog-RnJtI7_o.js} +2 -2
  148. package/dist/assets/ru-BqJl8PYs.js +1 -0
  149. package/dist/assets/{runtime-D1fsfm06.js → runtime-DfYA5FiE.js} +1 -1
  150. package/dist/assets/{search.es-BCKTPt8Z.js → search.es-BxNdUYNg.js} +1 -1
  151. package/dist/assets/{searchcursor.es-CG-7kPiK.js → searchcursor.es-s8a8A3Ii.js} +1 -1
  152. package/dist/assets/service-CFkt34Sc.js +1 -0
  153. package/dist/assets/{shorten-label-BBeWB-uS.js → shorten-label-pU8ae-Oh.js} +1 -1
  154. package/dist/assets/{show-hint.es-Cv-DsdJz.js → show-hint.es-B1JGf57k.js} +1 -1
  155. package/dist/assets/{slicedToArray-CcdXc-Lv.js → slicedToArray-C1UbO-hj.js} +1 -1
  156. package/dist/assets/{spaces-B6EXNQZl.js → spaces-2O-5X4yt.js} +1 -1
  157. package/dist/assets/{sublime.es-C4afyVlv.js → sublime.es-CiN5FIO2.js} +1 -1
  158. package/dist/assets/{switch-control-Df2z4_JR.js → switch-control-Dh1twa_3.js} +1 -1
  159. package/dist/assets/{table-icons-oYcHHRuN.js → table-icons-BmuX7Xai.js} +2 -2
  160. package/dist/assets/{tag-DSbPzPgh.js → tag-BgAeiRXM.js} +1 -1
  161. package/dist/assets/{team-DDHOdEq4.js → team-DGUd51ZP.js} +1 -1
  162. package/dist/assets/th-CGcwcZWK.js +1 -0
  163. package/dist/assets/{toUpper-BQcl0cuu.js → toUpper-BSJ4Soan.js} +1 -1
  164. package/dist/assets/{traffic-CYOQ1e8m.js → traffic-BEhPBbjp.js} +6 -6
  165. package/dist/assets/{url-evaluation-DEtrELk4.js → url-evaluation-Cw18Tjx5.js} +1 -1
  166. package/dist/assets/{url-join-D3n4s1tB.js → url-join-Di_BFQmE.js} +1 -1
  167. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-BAJBDbkb.js → use-blocklet-info-for-connect-did-spaces-CgjVAwmg.js} +1 -1
  168. package/dist/assets/useLocalStorage-FbxxP1zi.js +1 -0
  169. package/dist/assets/{util-6qKOiPh1.js → util-DWgJMgY9.js} +1 -1
  170. package/dist/assets/vi-lYszmNr_.js +1 -0
  171. package/dist/assets/{wait-container-CgVFT9ud.js → wait-container-D5DZGw_l.js} +2 -2
  172. package/dist/assets/{withStyles-oAg8TXx8.js → withStyles-D9qnQfcC.js} +1 -1
  173. package/dist/assets/wrap-locale-CDqxNJXh.js +1 -0
  174. package/dist/assets/zh-DMGrvlv0.js +2 -0
  175. package/dist/assets/zh-tw-BkGc-T4k.js +1 -0
  176. package/dist/index.html +1 -1
  177. package/dist/service-worker.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/assets/DeleteOutline-25NmKYhJ.js +0 -1
  180. package/dist/assets/api-CL59ZI-3.js +0 -1
  181. package/dist/assets/ar-JbMny-gg.js +0 -1
  182. package/dist/assets/blocklet-DfDTBrqe.js +0 -1
  183. package/dist/assets/de-CE9g_-X2.js +0 -1
  184. package/dist/assets/es-DOde1pH1.js +0 -1
  185. package/dist/assets/fr-CQP2ynaM.js +0 -1
  186. package/dist/assets/getValidReactChildren-C9Mg6JUR.js +0 -1
  187. package/dist/assets/hi-COkpP61P.js +0 -1
  188. package/dist/assets/id-e4JFBjR1.js +0 -1
  189. package/dist/assets/index-Ac-KxJUH.js +0 -131
  190. package/dist/assets/index-BC77e5qU.js +0 -1
  191. package/dist/assets/index-BHkNlsZn.js +0 -21
  192. package/dist/assets/index-BSyUX4TC.js +0 -1
  193. package/dist/assets/index-BYiS-jO5.js +0 -54
  194. package/dist/assets/index-BwjyQGvu.js +0 -16
  195. package/dist/assets/index-C7--GPHL.js +0 -2491
  196. package/dist/assets/index-CXZjlBgU.js +0 -11
  197. package/dist/assets/isEqual-D2pDzEvE.js +0 -1
  198. package/dist/assets/ja-Bq_9phll.js +0 -1
  199. package/dist/assets/ko-BGNBXY1X.js +0 -1
  200. package/dist/assets/overview-CaUgupo4.js +0 -23
  201. package/dist/assets/pt-CowvQB1d.js +0 -1
  202. package/dist/assets/ru-8F9Pd4BB.js +0 -1
  203. package/dist/assets/service-ByPcQZWp.js +0 -1
  204. package/dist/assets/th-ChXe3YuF.js +0 -1
  205. package/dist/assets/useLocalStorage-CCFlaZGi.js +0 -1
  206. package/dist/assets/vi-B7O3CE6M.js +0 -1
  207. package/dist/assets/wrap-locale-CYkqiYpi.js +0 -1
  208. package/dist/assets/zh-CmpXeSIg.js +0 -2
  209. package/dist/assets/zh-tw-BLezyw-8.js +0 -1
@@ -1,4 +1,4 @@
1
- import{aK as Re,aL as Oe,j as t,P as U,n as _e,dT as pa,r as K,bc as ma,O as m,fb as Mn,eC as ns,a2 as Le,C as en,q as be,t as ha,v as ba,F as he,gO as Ea,A as Y,M as Me,ad as _a,x as ss,fL as xa,m as $t,gP as ya,at as Sa,aZ as Te,a_ as as,D as Qe,B as ie,w as va,J as Na,K as rs,b as se,bn as fe,bI as is,ce as Aa,f as xe,k as ze,bq as Ut,bf as Ye,U as Ta,gQ as Ca,g as et,ck as j,aO as De,dB as me,a3 as Ra,gR as Ce,bL as Oa,a1 as ft,fc as Ge,S as os,bd as tt,a9 as wa,bJ as Ia,bK as La,ax as Dn,b7 as ja,b6 as cs,dP as Ae,d9 as rt,f_ as He,gS as Ma,gT as Da,gU as ka,aS as Pa,bv as Ba,bw as Fa,gV as $a,gB as Ua,bC as Ka,b8 as ls,bl as Kt,Q as za,eW as us,s as Ha,fh as Ie,Z as Wa,cX as ds,E as Ga,G as Nt}from"./index-C7--GPHL.js";import{I as qa}from"./iframe-D6qR_3ri.js";import{F as Va,R as Ya,I as Za,a as zt,L as At,b as Ja,d as Xa}from"./line-BnTOgrYf.js";import{d as fs}from"./ChevronRight-BmodGMIR.js";import{T as tn}from"./index-CpLXBcU2.js";import{B as gs}from"./bundle-avatar-BY2nARYo.js";import{u as Qa,B as er}from"./app-avatar-Ckes_yQg.js";import{i as tr}from"./isEqual-D2pDzEvE.js";import{d as nr}from"./Loop-BuS5QyRc.js";import{d as sr}from"./Done-Dh1HNrje.js";import{a as kn,A as ar}from"./Autocomplete-lQIAHH0f.js";import{T as te,F as rr}from"./TextField-BIxqRuYh.js";import{e as ir}from"./mode-B2dWMeTO.js";import{C as or,d as cr}from"./Public-CNI1n1ip.js";import{u as ge}from"./blocklet-DfDTBrqe.js";import{C as lr}from"./click-to-copy-C_IAO7KR.js";import{a as nn}from"./team-DDHOdEq4.js";import{a as We}from"./index-93rdCclb.js";import{E as sn}from"./index-D87Grs_R.js";import{u as ke,C as X}from"./index.esm-k8ocYudx.js";import{F as re}from"./Select-DFShmSX4.js";import{d as ur}from"./Launch-BXNO5-AB.js";import{d as dr}from"./EditIcon-Dmb-RHKW.js";import{d as fr}from"./Edit-BmjnjV4o.js";import{d as gr}from"./actions-BcyDmatM.js";import{u as pr,a as mr,D as hr,H as br}from"./index-DJXP92GG.js";import{S as ht}from"./switch-control-Df2z4_JR.js";import{K as Er}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{S as _r}from"./Slider-DwDD12e9.js";import{D as xr}from"./index-zhMYpdaE.js";import{I as yr}from"./index-BEHxtswt.js";import"./index-DqhKfK7p.js";import"./ArrowDropDown-B70H9TLI.js";import"./ButtonGroup-DIddKbz4.js";import"./getValidReactChildren-C9Mg6JUR.js";import"./index-BP0jhdgI.js";import"./Delete-CrjB4xBG.js";import"./InputLabel-C0MowDYM.js";import"./useLocalStorage-CCFlaZGi.js";import"./MoreVert-j9UJKkr6.js";import"./url-evaluation-DEtrELk4.js";import"./tag-DSbPzPgh.js";import"./redux-CkgCCMBw.js";import"./FilterList-1v-QYJKg.js";import"./LastPage-D3djMPDV.js";import"./Search-DdOWC3-l.js";var an={},Sr=Oe;Object.defineProperty(an,"__esModule",{value:!0});var ps=an.default=void 0,vr=Sr(Re()),Nr=t;ps=an.default=(0,vr.default)((0,Nr.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var rn={},Ar=Oe;Object.defineProperty(rn,"__esModule",{value:!0});var ms=rn.default=void 0,Tr=Ar(Re()),Cr=t;ms=rn.default=(0,Tr.default)((0,Cr.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var on={},Rr=Oe;Object.defineProperty(on,"__esModule",{value:!0});var hs=on.default=void 0,Or=Rr(Re()),wr=t;hs=on.default=(0,Or.default)((0,wr.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var cn={},Ir=Oe;Object.defineProperty(cn,"__esModule",{value:!0});var bs=cn.default=void 0,Lr=Ir(Re()),jr=t;bs=cn.default=(0,Lr.default)((0,jr.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");function ln({label:e,disabled:n,required:s,initialValue:r,onChange:u,style:c,onSubmit:i,triggers:a,options:o,formatterBeforeSubmit:l,helperText:d,placeholder:y,renderImage:b,renderLabel:h,filterKeys:v,noEmpty:A,...C}){const[I,f]=K.useState(!1),[g,S]=K.useState(!1),[p,x]=ma.useState(""),[R,D]=K.useState(r),[O,_]=K.useState(R),w=K.useMemo(()=>{if(!o)return{};const F={};return o.forEach(E=>{F[E.code]=E}),F},[o]),T=()=>{if(!o)return[];if(!p)return o.map(E=>E.code);const F=new RegExp(p.toLowerCase());return o.filter(E=>{var N;for(let k=0;k<v.length;k++){const z=v[k];if(F.test((N=E[z])==null?void 0:N.toLowerCase()))return!0}return!1}).map(E=>E.code)},M=async()=>{S(!0);try{await i(typeof l=="function"?l(O):O)===!1?_(R):A&&!O.length?(_(r),D(r)):(_(O),D(O))}catch{_(R)}finally{S(!1),f(!1)}},$=(F,E)=>{if(!Array.isArray(E)){_([]),u([]);return}const N=E.filter(k=>w[k]);if(!N.length){_([]),u([]);return}_(N),u(N)},q=I?t.jsx(ar,{options:o,value:O,onChange:$,inputValue:p,onInputChange:(F,E)=>{x(E)},PopperComponent:Dr,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:T,getOptionLabel:F=>{var E;return(E=w[F])==null?void 0:E.name},renderInput:F=>t.jsx(te,{...F,label:"",placeholder:y}),renderOption:(F,E)=>{var k;const N=O.indexOf(E)!==-1;return K.createElement(Mr,{component:"li",...F,key:E},b(w[E]||{}),t.jsx(m,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:h(E,w[E])||((k=w[E])==null?void 0:k.name)}),t.jsx(m,{component:Mn,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...C}):t.jsx(m,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:O.filter(F=>o.some(E=>E.code===F)).map(F=>t.jsx(ns,{label:o.find(E=>E.code===F).name,style:{marginRight:8},size:"small"},F))});return t.jsx(Va,{className:"form",style:c,children:t.jsxs(m,{className:"form-item",children:[t.jsxs(m,{className:"form-item-label",children:[e,s&&t.jsx(Ya,{})]}),t.jsxs(m,{className:"form-item-body",children:[t.jsx(m,{className:"form-item-input",children:q}),t.jsx(m,{className:"form-item-action",children:I?t.jsxs(t.Fragment,{children:[t.jsx(Le,{"data-cy":"schema-form-item-confirm",onClick:M,disabled:n||g,size:"large",children:g?t.jsx(en,{size:24}):t.jsx(sr,{})}),t.jsx(Le,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(R),f(!1)},disabled:n||g,size:"large",children:t.jsx(Mn,{})})]}):t.jsx(Za,{triggers:a,onEnterEdit:()=>f(!0),disabled:n})})]}),I&&d&&t.jsx(rr,{children:d})]})})}ln.propTypes={style:U.object,onSubmit:U.func,onChange:U.func,label:U.string,initialValue:U.string,required:U.bool,disabled:U.bool,triggers:U.array,options:U.array,helperText:U.string,formatterBeforeSubmit:U.func,placeholder:U.string,renderImage:U.func,filterKeys:U.arrayOf(U.string),noEmpty:U.bool,renderLabel:U.func};ln.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const Mr=_e.div`
1
+ import{aK as Re,aL as Oe,j as t,P as U,n as _e,e8 as pa,r as K,bc as ma,O as m,fs as Mn,eT as ns,a2 as Le,C as en,q as be,t as ha,v as ba,F as he,h1 as Ea,A as Y,M as Me,ad as _a,x as ss,f$ as xa,m as $t,h2 as ya,at as Sa,aZ as Te,a_ as as,D as Qe,B as ie,w as va,J as Na,K as rs,b as se,bn as fe,bI as is,ce as Aa,f as xe,k as ze,bq as Ut,bf as Ye,U as Ta,h3 as Ca,g as et,ck as j,aO as De,dz as me,a3 as Ra,h4 as Ce,bL as Oa,a1 as ft,ft as Ge,S as os,bd as tt,a9 as wa,bJ as Ia,bK as La,ax as Dn,b7 as ja,b6 as cs,e4 as Ae,d7 as rt,ge as He,h5 as Ma,h6 as Da,h7 as ka,aS as Pa,bv as Ba,bw as Fa,h8 as $a,gQ as Ua,bC as Ka,b8 as ls,bl as Kt,Q as za,fb as us,s as Ha,fy as Ie,Z as Wa,cV as ds,E as Ga,G as Nt}from"./index-DW_sEbOX.js";import{I as qa}from"./iframe-CpnjA8zm.js";import{F as Va,R as Ya,I as Za,a as zt,L as At,b as Ja,d as Xa}from"./line-VZzxMXH1.js";import{d as fs}from"./ChevronRight-pbRslwzZ.js";import{T as tn}from"./index-DcAqvRRT.js";import{B as gs}from"./bundle-avatar-DEQzPsHD.js";import{u as Qa,B as er}from"./app-avatar-CFWpqff1.js";import{i as tr}from"./isEqual-vbSrcyPi.js";import{d as nr}from"./Loop-Dpp5fctN.js";import{d as sr}from"./Done-DycYtcxi.js";import{a as kn,A as ar}from"./Autocomplete-CBrNN6Wi.js";import{T as te,F as rr}from"./TextField-udFGOQyD.js";import{e as ir}from"./mode-B2dWMeTO.js";import{C as or,d as cr}from"./Public-DuGVgRc8.js";import{u as ge}from"./blocklet-BBUrtnew.js";import{C as lr}from"./click-to-copy-6L_LfYIl.js";import{a as nn}from"./team-DGUd51ZP.js";import{a as We}from"./index-BIJwoRQp.js";import{E as sn}from"./index-DYG5Tovq.js";import{u as ke,C as X}from"./index.esm-NzqlBaFf.js";import{F as re}from"./Select-D_jjFrx2.js";import{d as ur}from"./Launch-C4_ktc4w.js";import{d as dr}from"./EditIcon-ugJwCH0S.js";import{d as fr}from"./Edit-CWojktHH.js";import{d as gr}from"./actions-BWX_qXJD.js";import{u as pr,a as mr,D as hr,H as br}from"./index-COF37GzL.js";import{S as ht}from"./switch-control-Dh1twa_3.js";import{K as Er}from"./keyboard-arrow-down-rounded-DadBVmpO.js";import{S as _r}from"./Slider-OEZKoU_q.js";import{D as xr}from"./index-CB51-nwP.js";import{I as yr}from"./index-DH_YItOr.js";import"./index-KGG0_6hI.js";import"./ArrowDropDown-PUGycbah.js";import"./ButtonGroup-qjpoNO9j.js";import"./getValidReactChildren-DItgry09.js";import"./index-BWxquNjq.js";import"./Delete-BTd8aIqu.js";import"./InputLabel-CdP2Vrv8.js";import"./useLocalStorage-FbxxP1zi.js";import"./MoreVert-YMJ5zQGi.js";import"./url-evaluation-Cw18Tjx5.js";import"./tag-BgAeiRXM.js";import"./redux-AeaWrwCk.js";import"./FilterList-Cv0uknPg.js";import"./LastPage-BTLBin5_.js";import"./Search-CnmiZ7r5.js";var an={},Sr=Oe;Object.defineProperty(an,"__esModule",{value:!0});var ps=an.default=void 0,vr=Sr(Re()),Nr=t;ps=an.default=(0,vr.default)((0,Nr.jsx)("path",{d:"M3 18c0 .55.45 1 1 1h5v-2H4c-.55 0-1 .45-1 1M3 6c0 .55.45 1 1 1h9V5H4c-.55 0-1 .45-1 1m10 14v-1h7c.55 0 1-.45 1-1s-.45-1-1-1h-7v-1c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1s1-.45 1-1M7 10v1H4c-.55 0-1 .45-1 1s.45 1 1 1h3v1c0 .55.45 1 1 1s1-.45 1-1v-4c0-.55-.45-1-1-1s-1 .45-1 1m14 2c0-.55-.45-1-1-1h-9v2h9c.55 0 1-.45 1-1m-5-3c.55 0 1-.45 1-1V7h3c.55 0 1-.45 1-1s-.45-1-1-1h-3V4c0-.55-.45-1-1-1s-1 .45-1 1v4c0 .55.45 1 1 1"}),"TuneRounded");var rn={},Ar=Oe;Object.defineProperty(rn,"__esModule",{value:!0});var ms=rn.default=void 0,Tr=Ar(Re()),Cr=t;ms=rn.default=(0,Tr.default)((0,Cr.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"Key");var on={},Rr=Oe;Object.defineProperty(on,"__esModule",{value:!0});var hs=on.default=void 0,Or=Rr(Re()),wr=t;hs=on.default=(0,Or.default)((0,wr.jsx)("path",{d:"M11 7 9.6 8.4l2.6 2.6H2v2h10.2l-2.6 2.6L11 17l5-5zm9 12h-8v2h8c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-8v2h8z"}),"Login");var cn={},Ir=Oe;Object.defineProperty(cn,"__esModule",{value:!0});var bs=cn.default=void 0,Lr=Ir(Re()),jr=t;bs=cn.default=(0,Lr.default)((0,jr.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");function ln({label:e,disabled:n,required:s,initialValue:r,onChange:u,style:c,onSubmit:i,triggers:a,options:o,formatterBeforeSubmit:l,helperText:d,placeholder:y,renderImage:b,renderLabel:h,filterKeys:v,noEmpty:A,...C}){const[I,f]=K.useState(!1),[g,S]=K.useState(!1),[p,x]=ma.useState(""),[R,D]=K.useState(r),[O,_]=K.useState(R),w=K.useMemo(()=>{if(!o)return{};const F={};return o.forEach(E=>{F[E.code]=E}),F},[o]),T=()=>{if(!o)return[];if(!p)return o.map(E=>E.code);const F=new RegExp(p.toLowerCase());return o.filter(E=>{var N;for(let k=0;k<v.length;k++){const z=v[k];if(F.test((N=E[z])==null?void 0:N.toLowerCase()))return!0}return!1}).map(E=>E.code)},M=async()=>{S(!0);try{await i(typeof l=="function"?l(O):O)===!1?_(R):A&&!O.length?(_(r),D(r)):(_(O),D(O))}catch{_(R)}finally{S(!1),f(!1)}},$=(F,E)=>{if(!Array.isArray(E)){_([]),u([]);return}const N=E.filter(k=>w[k]);if(!N.length){_([]),u([]);return}_(N),u(N)},q=I?t.jsx(ar,{options:o,value:O,onChange:$,inputValue:p,onInputChange:(F,E)=>{x(E)},PopperComponent:Dr,fullWidth:!0,multiple:!0,variant:"outlined",margin:"dense",filterOptions:T,getOptionLabel:F=>{var E;return(E=w[F])==null?void 0:E.name},renderInput:F=>t.jsx(te,{...F,label:"",placeholder:y}),renderOption:(F,E)=>{var k;const N=O.indexOf(E)!==-1;return K.createElement(Mr,{component:"li",...F,key:E},b(w[E]||{}),t.jsx(m,{sx:{"& > img":{mr:2,flexShrink:0}},style:{flex:1,fontWeight:N?"700":"normal"},children:h(E,w[E])||((k=w[E])==null?void 0:k.name)}),t.jsx(m,{component:Mn,sx:{opacity:.5,width:18,height:18},style:{visibility:N?"visible":"hidden"}}))},...C}):t.jsx(m,{px:1,className:"form-item-input slot",style:{whiteSpace:"pre-wrap"},children:O.filter(F=>o.some(E=>E.code===F)).map(F=>t.jsx(ns,{label:o.find(E=>E.code===F).name,style:{marginRight:8},size:"small"},F))});return t.jsx(Va,{className:"form",style:c,children:t.jsxs(m,{className:"form-item",children:[t.jsxs(m,{className:"form-item-label",children:[e,s&&t.jsx(Ya,{})]}),t.jsxs(m,{className:"form-item-body",children:[t.jsx(m,{className:"form-item-input",children:q}),t.jsx(m,{className:"form-item-action",children:I?t.jsxs(t.Fragment,{children:[t.jsx(Le,{"data-cy":"schema-form-item-confirm",onClick:M,disabled:n||g,size:"large",children:g?t.jsx(en,{size:24}):t.jsx(sr,{})}),t.jsx(Le,{"data-cy":"schema-form-item-cancel",onClick:()=>{_(R),f(!1)},disabled:n||g,size:"large",children:t.jsx(Mn,{})})]}):t.jsx(Za,{triggers:a,onEnterEdit:()=>f(!0),disabled:n})})]}),I&&d&&t.jsx(rr,{children:d})]})})}ln.propTypes={style:U.object,onSubmit:U.func,onChange:U.func,label:U.string,initialValue:U.string,required:U.bool,disabled:U.bool,triggers:U.array,options:U.array,helperText:U.string,formatterBeforeSubmit:U.func,placeholder:U.string,renderImage:U.func,filterKeys:U.arrayOf(U.string),noEmpty:U.bool,renderLabel:U.func};ln.defaultProps={style:{},onSubmit:()=>{},onChange:()=>{},label:"",initialValue:"",required:!1,disabled:!1,triggers:[],options:[],helperText:"",formatterBeforeSubmit:e=>e.join(","),placeholder:"",filterKeys:["name"],renderImage:()=>null,renderLabel:(e,n)=>"",noEmpty:!1};const Mr=_e.div`
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{z as l,bi as m,u as p,j as s,S as u}from"./index-C7--GPHL.js";import{L as g,D as v}from"./download-C7Ang0v6.js";import{F as f,S as x}from"./Select-DFShmSX4.js";import"./ButtonGroup-DIddKbz4.js";import"./getValidReactChildren-C9Mg6JUR.js";function k(){const i=l(),{name:a="abtnode"}=m(),{info:n}=p(),r=n.routing.provider,o=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(r){const e=`Service Gateway(${r})`;o.push({id:`service-gateway-${r}`,name:e,types:["error","access"]})}const c=e=>{i(`/logs/${e.target.value}`)},d=s.jsx(f,{sx:{minWidth:240},children:s.jsx(x,{value:a,onChange:c,size:"small",children:o.map(e=>s.jsx(u,{value:e.id,children:e.name},e.id))})}),t=o.find(e=>e.id===a)||o[0];return s.jsx(g,{name:t.name,logId:t.id,types:t.types,prepend:d,postpend:s.jsx(v,{id:n.did,name:"blocklet-server"})},t.id)}export{k as default};
1
+ import{z as l,bi as m,u as p,j as s,S as u}from"./index-DW_sEbOX.js";import{L as g,D as v}from"./download-DKskcy43.js";import{F as f,S as x}from"./Select-D_jjFrx2.js";import"./ButtonGroup-qjpoNO9j.js";import"./getValidReactChildren-DItgry09.js";function k(){const i=l(),{name:a="abtnode"}=m(),{info:n}=p(),r=n.routing.provider,o=[{id:"abtnode",name:"Blocklet Server",types:["error","info","access","stdout","stderr","pm2"]},{id:"blocklet-services",name:"Blocklet Services",types:["error","info","access","stdout","stderr"]}];if(r){const e=`Service Gateway(${r})`;o.push({id:`service-gateway-${r}`,name:e,types:["error","access"]})}const c=e=>{i(`/logs/${e.target.value}`)},d=s.jsx(f,{sx:{minWidth:240},children:s.jsx(x,{value:a,onChange:c,size:"small",children:o.map(e=>s.jsx(u,{value:e.id,children:e.name},e.id))})}),t=o.find(e=>e.id===a)||o[0];return s.jsx(g,{name:t.name,logId:t.id,types:t.types,prepend:d,postpend:s.jsx(v,{id:n.did,name:"blocklet-server"})},t.id)}export{k as default};
@@ -0,0 +1 @@
1
+ import{hv as O,r as L,hw as W,cn as R,fm as N,hx as K,hy as P,cl as j,hz as S}from"./index-DW_sEbOX.js";var V=function(r,a){return r===void 0&&(r=[]),a===void 0&&(a=[]),O(r,a)},I=function(r,a,n){var e=L.useRef(),i=L.useRef(0);V(a,e.current)||(e.current=a,i.current+=1),W(r,[i.current],n)},J=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),z={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,meta:J?[91,93]:[91,92],selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},E={ctrl:function(r){return r.ctrlKey},shift:function(r){return r.shiftKey},alt:function(r){return r.altKey},meta:function(r){return r.type==="keyup"?z.meta.includes(r.keyCode):r.metaKey}};function B(r){return P(r)||j(r)}function Q(r){var a=Object.keys(E).reduce(function(n,e){return E[e](r)?n+1:n},0);return[16,17,18,91,92].includes(r.keyCode)?a:a+1}function T(r,a,n){var e,i;if(!r.key)return!1;if(j(a))return r.keyCode===a?a:!1;var o=a.split("."),s=0;try{for(var l=K(o),c=l.next();!c.done;c=l.next()){var p=c.value,y=E[p],m=z[p.toLowerCase()];(y&&y(r)||m&&m===r.keyCode)&&s++}}catch(b){e={error:b}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(e)throw e.error}}return n?s===o.length&&Q(r)===o.length?a:!1:s===o.length?a:!1}function U(r,a){return S(r)?r:B(r)?function(n){return T(n,r,a)}:Array.isArray(r)?function(n){return r.find(function(e){return T(n,e,a)})}:function(){return!!r}}var X=["keydown"];function Z(r,a,n){var e=n||{},i=e.events,o=i===void 0?X:i,s=e.target,l=e.exactMatch,c=l===void 0?!1:l,p=e.useCapture,y=p===void 0?!1:p,m=R(a),b=R(r);I(function(){var k,C,x,t=N(s,window);if(t){var q=function(u){var v,g=U(b.current,c),f=g(u),d=B(f)?f:u.key;if(f)return(v=m.current)===null||v===void 0?void 0:v.call(m,u,d)};try{for(var w=K(o),h=w.next();!h.done;h=w.next()){var G=h.value;(x=t==null?void 0:t.addEventListener)===null||x===void 0||x.call(t,G,q,y)}}catch(u){k={error:u}}finally{try{h&&!h.done&&(C=w.return)&&C.call(w)}finally{if(k)throw k.error}}return function(){var u,v,g;try{for(var f=K(o),d=f.next();!d.done;d=f.next()){var H=d.value;(g=t==null?void 0:t.removeEventListener)===null||g===void 0||g.call(t,H,q,y)}}catch(M){u={error:M}}finally{try{d&&!d.done&&(v=f.return)&&v.call(f)}finally{if(u)throw u.error}}}}},[o],s)}export{Z as u};
@@ -1,4 +1,4 @@
1
- import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J,r as f,f as Ce,bq as Je,b as X,M as O,J as dt,U as Mt,ce as Oe,n as F,K as Z,gQ as qo,bI as Me,aY as ue,aX as gt,aC as Ft,a2 as $,D as xt,F as D,aP as Vo,Y as Ke,$ as Wn,b1 as _o,fP as Wo,fQ as Ho,C as re,fb as Yo,y as po,av as pt,a1 as we,x as Gt,hE as Jo,hF as Ko,B as ne,bd as uo,H as Wt,hG as Qo,m as ee,a3 as Zo,eC as Xo,W as mo,Z as fo,ak as $o,w as es,Q as He,V as ts,hH as ho,S as ge,az as ns,aA as os,aB as ss,i as yt,aN as rs,cG as is,bi as as,hf as ls,hI as cs,ay as Hn,cE as ds,ad as Fe,aJ as go,bK as Ht,cg as ps,hJ as us,b8 as ms,z as fs,aZ as zt,T as hs,aQ as Ye,at as Nt,dH as gs,br as xo,aF as xs,f_ as Pe,dP as ys,hK as Cs,gn as Yn,hL as Jn,gp as Kn,a_ as js,G as at,gr as vs,bJ as Ss}from"./index-C7--GPHL.js";import{d as bs}from"./Add-R25cZfQ7.js";import{a as Rs,R as ct,F as Es,L as Ts,d as Yt,b as Jt}from"./line-BnTOgrYf.js";import{C as ws,A as Ps,d as Is}from"./agreement-B-WzIvLt.js";import{E as ks}from"./index-D87Grs_R.js";import{b as Us,a as Ds,c as Bs,u as Kt,e as Ns}from"./actions-BcyDmatM.js";import{S as As}from"./switch-control-Df2z4_JR.js";import{u as Ls}from"./detail-fXteNAJ8.js";import{d as yo}from"./Edit-BmjnjV4o.js";import{T as Os}from"./index-CpLXBcU2.js";import{T as Ms,M as Fs,t as Gs}from"./table-icons-oYcHHRuN.js";import{C as Qn}from"./click-to-copy-C_IAO7KR.js";import{T as K}from"./TextField-BIxqRuYh.js";import{d as Qt}from"./Link-iUvOe_0B.js";import{c as zs,C as qs,a as Vs,b as _s,D as Ws,A as Hs,B as Ys,d as Js,S as Ks}from"./item-DF4Nk2eZ.js";import{u as Qs,a as Zs,P as Co,L as Zn,A as Xs,S as $s}from"./index-CKoRQbL4.js";import{u as jo,t as er}from"./toUpper-BQcl0cuu.js";import{u as ie}from"./blocklet-DfDTBrqe.js";import{c as tr,d as nr,a as or,e as sr,f as rr,g as Xn,h as ir,i as $n}from"./spaces-B6EXNQZl.js";import{d as ar}from"./EditIcon-Dmb-RHKW.js";import{d as lr}from"./Done-Dh1HNrje.js";import{C as cr}from"./Google-BVA2G_jw.js";import{I as dr,B as pr}from"./install-from-url-Bti2J2br.js";import{a as eo}from"./api-CL59ZI-3.js";import{v as vo,a as ut}from"./util-6qKOiPh1.js";import{P as ur,u as mr}from"./use-blocklet-info-for-connect-did-spaces-BAJBDbkb.js";import{d as fr}from"./DeleteOutline-25NmKYhJ.js";import{S as to}from"./index-BwjyQGvu.js";import{d as hr}from"./ArrowDropDown-B70H9TLI.js";import{_ as gr}from"./useLocalStorage-CCFlaZGi.js";import{d as xr}from"./LockIcon-D5qESv6d.js";import{d as Ct}from"./Delete-CrjB4xBG.js";import{d as So}from"./Launch-BXNO5-AB.js";import{C as yr}from"./delete-confirm-CQ5chdBo.js";import{W as Qe}from"./tag-DSbPzPgh.js";import{d as Cr}from"./is-path-prefix-equal-D-HjkB4G.js";import{R as jr,b as no,B as bo}from"./url-evaluation-DEtrELk4.js";import{B as vr}from"./bundle-avatar-BY2nARYo.js";import{A as Ro}from"./actions-XylnHbsY.js";import{I as At}from"./index-BEHxtswt.js";import{a as Sr}from"./index-93rdCclb.js";import{u as br}from"./team-DDHOdEq4.js";import"./ButtonGroup-DIddKbz4.js";import"./getValidReactChildren-C9Mg6JUR.js";import"./index-BP0jhdgI.js";import"./index-BB3gqUNz.js";import"./url-join-D3n4s1tB.js";import"./MoreVert-j9UJKkr6.js";import"./app-avatar-Ckes_yQg.js";import"./Breadcrumbs-DKONJeCv.js";import"./FilterList-1v-QYJKg.js";import"./Select-DFShmSX4.js";import"./InputLabel-C0MowDYM.js";import"./LastPage-D3djMPDV.js";import"./slicedToArray-CcdXc-Lv.js";import"./Search-DdOWC3-l.js";import"./ChevronLeft-DkAxUxaL.js";import"./ChevronRight-BmodGMIR.js";import"./redux-CkgCCMBw.js";import"./Skeleton-DZXKedF8.js";import"./InputAdornment-Dq98l8WX.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-DjDrwMwk.js";import"./index-ZG7jWpak.js";import"./preact.module-B1z5cdvs.js";import"./Close-Crlhu1gh.js";import"./lottie-CX5d6rq5.js";import"./Stepper-X7fZGQnQ.js";import"./index-CPh559U2.js";import"./shorten-label-BBeWB-uS.js";const Rr=zo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Zt={},Er=_t;Object.defineProperty(Zt,"__esModule",{value:!0});var Eo=Zt.default=void 0,Tr=Er(Vt()),wr=e;Eo=Zt.default=(0,Tr.default)((0,wr.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");function Xt({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Ls(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),A.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){A.error(l.message)}},m=!!(n!=null&&n.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(ve,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(As,{checked:m,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Xt.propTypes={children:r.any};Xt.defaultProps={children:null};const Pr=(t,o)=>{let{description:s}=t;return(Object.values(X.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},Lt=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom;function mt({blocklet:t,ancestors:o}){const s=J(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.success(n("blocklet.config.changedTip")),l=c=>Lt(c,t,o);if(Je(t.status)||t.status==="unknown"&&Je(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")||c.key.startsWith("COMPONENT_")){A.error(n("blocklet.config.environment.invalidKey"));return}c.custom=!0;try{const v=await s.api.configBlocklet({input:{did:i,configs:[c]}});m(v.blocklet)}catch(v){A.error(Z(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")&&!X.BLOCKLET_CONFIGURABLE_KEY[c.key]){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=qo(c);if(T){A.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!Lt(c,t,o)){A.error("Only key of custom env can be changed");return}j.push({key:v.key,custom:!0})}try{const T=await s.api.configBlocklet({input:{did:i,configs:j}});m(T.blocklet)}catch(T){A.error(Z(T))}},g=async c=>{if(c.required){A.error(n("blocklet.config.environment.deleteForbidden"));return}if(!Lt(c,t,o)){A.error("Only key of custom env can be changed");return}try{const v=await s.api.configBlocklet({input:{did:i,configs:[{key:c.key,custom:!0}]}});m(v.blocklet)}catch(v){A.error(Z(v))}},p=(t.configs||[]).filter(c=>!X.BLOCKLET_CONFIGURABLE_KEY[c.key]),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),b=p.map(c=>({...c,value:Object.values(X.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=b.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},R=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Qn,{value:c.value,style:{color:c.required&&!c.value?"#ff4436":"#222222",fontWeight:c.required?"bold":"normal"},children:c.key}),editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsx(oo,{children:e.jsx(K,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:I=>T(I.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:c=>c.value?c.secure?"******":e.jsx(Qn,{unstyled:!0,value:c.value,style:{wordBreak:"break-all"},children:c.value}):null,editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsxs(oo,{children:[e.jsx(K,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:I=>T(I.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Pr(j,n)]})}}];return e.jsxs(Ir,{children:[!!d.length&&e.jsx(dt,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(dt,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Mt,{permission:a?"":"mutate_blocklets",role:a?Oe:[],children:c=>e.jsx(Ms,{className:"config-table",children:e.jsx(Fs,{title:e.jsx("h4",{children:n("common.environment")}),columns:R(),icons:{...Us,...Gs},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:b,editable:c?x:{}})})})]})}mt.propTypes={blocklet:r.object.isRequired,ancestors:r.array};mt.defaultProps={ancestors:[]};const Ir=F.div`
1
+ import{bM as zo,j as e,aK as qt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J,r as f,f as Ce,bq as Je,b as X,M as O,J as dt,U as Mt,ce as Oe,n as F,K as Z,h3 as Vo,bI as Me,aY as ue,aX as gt,aC as Ft,a2 as $,D as xt,F as D,aP as qo,Y as Ke,$ as Wn,b1 as _o,g3 as Wo,g4 as Ho,C as re,fs as Yo,y as po,av as pt,a1 as we,x as Gt,hT as Jo,hU as Ko,B as ne,bd as uo,H as Wt,hV as Qo,m as ee,a3 as Zo,eT as Xo,W as mo,Z as fo,ak as $o,w as es,Q as He,V as ts,hW as ho,S as ge,az as ns,aA as os,aB as ss,i as yt,aN as rs,cE as is,bi as as,hu as ls,hX as cs,ay as Hn,cC as ds,ad as Fe,aJ as go,bK as Ht,cg as ps,hY as us,b8 as ms,z as fs,aZ as zt,T as hs,aQ as Ye,at as Nt,dN as gs,br as xo,aF as xs,ge as Pe,e4 as ys,hZ as Cs,gC as Yn,h_ as Jn,gE as Kn,a_ as js,G as at,gG as vs,bJ as Ss}from"./index-DW_sEbOX.js";import{d as bs}from"./Add-9p89cr51.js";import{a as Rs,R as ct,F as Es,L as Ts,d as Yt,b as Jt}from"./line-VZzxMXH1.js";import{C as ws,A as Ps,d as Is}from"./agreement-CvcGSLJB.js";import{E as ks}from"./index-DYG5Tovq.js";import{b as Us,a as Ds,c as Bs,u as Kt,e as Ns}from"./actions-BWX_qXJD.js";import{S as As}from"./switch-control-Dh1twa_3.js";import{u as Ls}from"./detail-CP83_tPj.js";import{d as yo}from"./Edit-CWojktHH.js";import{T as Os}from"./index-DcAqvRRT.js";import{T as Ms,M as Fs,t as Gs}from"./table-icons-BmuX7Xai.js";import{C as Qn}from"./click-to-copy-6L_LfYIl.js";import{T as K}from"./TextField-udFGOQyD.js";import{d as Qt}from"./Link-DbSs28Vg.js";import{c as zs,C as Vs,a as qs,b as _s,D as Ws,A as Hs,B as Ys,d as Js,S as Ks}from"./item-B7ZSMqn6.js";import{u as Qs,a as Zs,P as Co,L as Zn,A as Xs,S as $s}from"./index-Bj-A_LO-.js";import{u as jo,t as er}from"./toUpper-BSJ4Soan.js";import{u as ie}from"./blocklet-BBUrtnew.js";import{c as tr,d as nr,a as or,e as sr,f as rr,g as Xn,h as ir,i as $n}from"./spaces-2O-5X4yt.js";import{d as ar}from"./EditIcon-ugJwCH0S.js";import{d as lr}from"./Done-DycYtcxi.js";import{C as cr}from"./Google-Bpr-eboG.js";import{I as dr,B as pr}from"./install-from-url-D913MaCZ.js";import{a as eo}from"./api-DeLIbQas.js";import{v as vo,a as ut}from"./util-DWgJMgY9.js";import{P as ur,u as mr}from"./use-blocklet-info-for-connect-did-spaces-CgjVAwmg.js";import{D as fr}from"./DeleteOutline-CT39B0th.js";import{S as to}from"./index-BdNyli-L.js";import{d as hr}from"./ArrowDropDown-PUGycbah.js";import{_ as gr}from"./useLocalStorage-FbxxP1zi.js";import{d as xr}from"./LockIcon-QS29DL1o.js";import{d as Ct}from"./Delete-BTd8aIqu.js";import{d as So}from"./Launch-C4_ktc4w.js";import{C as yr}from"./delete-confirm-BN8gy06y.js";import{W as Qe}from"./tag-BgAeiRXM.js";import{d as Cr}from"./is-path-prefix-equal-ufTBNRSJ.js";import{R as jr,b as no,B as bo}from"./url-evaluation-Cw18Tjx5.js";import{B as vr}from"./bundle-avatar-DEQzPsHD.js";import{A as Ro}from"./actions-e3525553.js";import{I as At}from"./index-DH_YItOr.js";import{a as Sr}from"./index-BIJwoRQp.js";import{u as br}from"./team-DGUd51ZP.js";import"./ButtonGroup-qjpoNO9j.js";import"./getValidReactChildren-DItgry09.js";import"./index-BWxquNjq.js";import"./index-WT4dVA5f.js";import"./url-join-Di_BFQmE.js";import"./MoreVert-YMJ5zQGi.js";import"./app-avatar-CFWpqff1.js";import"./Breadcrumbs-YbVhGF74.js";import"./FilterList-Cv0uknPg.js";import"./Select-D_jjFrx2.js";import"./InputLabel-CdP2Vrv8.js";import"./LastPage-BTLBin5_.js";import"./slicedToArray-C1UbO-hj.js";import"./Search-CnmiZ7r5.js";import"./ChevronLeft-Bvm6nyLn.js";import"./ChevronRight-pbRslwzZ.js";import"./DeleteOutline-DkbzMi-O.js";import"./redux-AeaWrwCk.js";import"./Skeleton-DMU-9YHS.js";import"./InputAdornment-GAXpW_Pc.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-BBsadaJh.js";import"./index-ZG7jWpak.js";import"./preact.module-B1z5cdvs.js";import"./Close-CRs5nN-9.js";import"./lottie-O2tV-OjZ.js";import"./Stepper-BLioo72i.js";import"./index-2gGHhy3B.js";import"./shorten-label-pU8ae-Oh.js";const Rr=zo(e.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");var Zt={},Er=_t;Object.defineProperty(Zt,"__esModule",{value:!0});var Eo=Zt.default=void 0,Tr=Er(qt()),wr=e;Eo=Zt.default=(0,Tr.default)((0,wr.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");function Xt({children:t,...o}){const{t:s}=z(),{updateAutoCheckUpdate:a,autoCheckUpdate:n}=Ls(),i=async()=>{try{const l=!(n!=null&&n.enabled);await a({enabled:l}),A.success(s(l?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(l){A.error(l.message)}},m=!!(n!=null&&n.enabled);return e.jsxs(y,{display:"flex",flexDirection:"row",alignItems:"center",children:[t,e.jsx(ve,{title:s("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:e.jsx("div",{children:e.jsx(As,{checked:m,onChange:i,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Xt.propTypes={children:r.any};Xt.defaultProps={children:null};const Pr=(t,o)=>{let{description:s}=t;return(Object.values(X.CHAIN_PROP_MAP).includes(t.key)||O.isEnvShareable(t))&&(s?s=`${s} (${o("blocklet.config.sharedToAllComponents")})`:s=o("blocklet.config.sharedToAllComponents")),s&&e.jsx("div",{style:{marginLeft:12},children:s})},Lt=(t,o,s=[])=>!(s!=null&&s.length)&&!t.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(t.key)&&!o.meta.environments.find(a=>a.name===t.key)&&o.children.every(a=>!a.meta.environments.find(n=>n.name===t.key))?!0:t.custom;function mt({blocklet:t,ancestors:o}){const s=J(),{inService:a}=s,{t:n}=f.useContext(Ce),i=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.success(n("blocklet.config.changedTip")),l=c=>Lt(c,t,o);if(Je(t.status)||t.status==="unknown"&&Je(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")||c.key.startsWith("COMPONENT_")){A.error(n("blocklet.config.environment.invalidKey"));return}c.custom=!0;try{const v=await s.api.configBlocklet({input:{did:i,configs:[c]}});m(v.blocklet)}catch(v){A.error(Z(v))}},h=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(c.key.startsWith("BLOCKLET_")&&!X.BLOCKLET_CONFIGURABLE_KEY[c.key]){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const T=Vo(c);if(T){A.error(T);return}}const j=[{...c,value:c.secure&&c.value==="__encrypted__"?"":c.value}];if(c.key!==v.key){if(!Lt(c,t,o)){A.error("Only key of custom env can be changed");return}j.push({key:v.key,custom:!0})}try{const T=await s.api.configBlocklet({input:{did:i,configs:j}});m(T.blocklet)}catch(T){A.error(Z(T))}},g=async c=>{if(c.required){A.error(n("blocklet.config.environment.deleteForbidden"));return}if(!Lt(c,t,o)){A.error("Only key of custom env can be changed");return}try{const v=await s.api.configBlocklet({input:{did:i,configs:[{key:c.key,custom:!0}]}});m(v.blocklet)}catch(v){A.error(Z(v))}},p=(t.configs||[]).filter(c=>!X.BLOCKLET_CONFIGURABLE_KEY[c.key]),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),b=p.map(c=>({...c,value:Object.values(X.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=b.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:h,onRowDelete:g,isDeletable:l},R=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Qn,{value:c.value,style:{color:c.required&&!c.value?"#ff4436":"#222222",fontWeight:c.required?"bold":"normal"},children:c.key}),editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsx(oo,{children:e.jsx(K,{fullWidth:!0,size:"small",disabled:l(j)===!1,value:v,onChange:I=>T(I.target.value),variant:"outlined",label:"Key",placeholder:n("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:n("common.value"),field:"value",initialEditValue:"Value",width:"calc((100% - (96px + 30%)) / 1)",render:c=>c.value?c.secure?"******":e.jsx(Qn,{unstyled:!0,value:c.value,style:{wordBreak:"break-all"},children:c.value}):null,editComponent:c=>{const{value:v,rowData:j,onChange:T}=c;return e.jsxs(oo,{children:[e.jsx(K,{fullWidth:!0,size:"small",value:v==="__encrypted__"?"":v,onChange:I=>T(I.target.value),variant:"outlined",label:n("common.value"),placeholder:n("blocklet.config.environment.value"),margin:"dense",autoFocus:!0}),Pr(j,n)]})}}];return e.jsxs(Ir,{children:[!!d.length&&e.jsx(dt,{severity:"error",style:{marginTop:24},children:n("blocklet.config.missingRequired")}),C&&e.jsx(dt,{severity:"info",children:n("blocklet.config.environment.tip")}),e.jsx(Mt,{permission:a?"":"mutate_blocklets",role:a?Oe:[],children:c=>e.jsx(Ms,{className:"config-table",children:e.jsx(Fs,{title:e.jsx("h4",{children:n("common.environment")}),columns:R(),icons:{...Us,...Gs},options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1},localization:{header:{actions:n("common.actions")},body:{emptyDataSourceMessage:n("common.noData")}},data:b,editable:c?x:{}})})})]})}mt.propTypes={blocklet:r.object.isRequired,ancestors:r.array};mt.defaultProps={ancestors:[]};const Ir=F.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -63,7 +63,7 @@ import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J
63
63
  .ux-dialog_right {
64
64
  padding-right: 20px;
65
65
  }
66
- `,{NODE_MODES:so}=D,Ar=({mode:t,previousMode:o}={})=>t===so.SERVERLESS||o===so.SERVERLESS;var To={isInServerlessMode:Ar};function Lr(){const[t,o]=f.useState(null),{blocklet:s}=ie();return f.useEffect(()=>{o(tr(s))},[s]),{storageEndpoint:t}}const wo=f.createContext({}),{Provider:Or,Consumer:Qa}=wo;function $t({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=ie(),{storageEndpoint:l}=Lr(),{api:u}=J();Vo(async()=>{try{if(s(!0),Wn.isEmpty(l)){n(null);return}const d=await nr(l);n(d)}catch(d){console.error(d),A.error(d.message)}finally{s(!1)}},[l]);const h=()=>{n(null),m()},g=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};f.useEffect(()=>{async function d(){if(!a)return;const b=await or(a.endpoint,a.name),C=Wn.merge(a,{name:b});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Or,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}$t.propTypes={children:Ke.node.isRequired};$t.defaultProps={};function en(){return f.useContext(wo)}const tn={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function nn({editing:t,value:o,onChange:s}){const[a,n]=f.useState(!1),i=f.useRef(),m=f.useRef(o);f.useEffect(()=>{let p=null;return t&&(p=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(p)}},[t]);const l=p=>{m.current=p,s(p)},u=()=>{n(!1),s(m.current)},h=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),e.jsx(_o,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(cr,{color:o,onChange:p=>l(p.hex)})})]});return t?g:h}nn.propTypes=tn;function on({editing:t,description:o,value:s,onChange:a,componentProps:n,...i}){const{placeholder:m}=n,l=f.useRef(s),u=g=>{g.key==="Enter"&&a(l.current,"confirm")},h=g=>{l.current=g,a(g)};return t?e.jsx(K,{style:{flex:1},fullWidth:!0,value:s,onChange:g=>{g.persist(),h(g.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...i}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}on.propTypes=tn;on.defaultProps={componentProps:{}};function sn({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Wo.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ho({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(nn,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}sn.propTypes={...tn,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};sn.defaultProps={};const Mr={input:on,color:nn,passport:sn,uploader:t=>e.jsx(Ts,{...t.componentProps})};function Fr(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Mr[s==null?void 0:s.toLowerCase()]}function rn({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:i,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,h]=f.useState(null),[g,p]=f.useState(l?s:a),S=f.useRef();function d(x,R,c){const{key:v,secure:j}=x,I=g[v]!==R,U={...g,[v]:R};I&&p(U),n({[v]:R},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?b(null):b(x)}function b(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:R=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?R?"":"******":v}return e.jsx(Gr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:R,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const U=!!(u&&R===u.key),L=C(x,{editing:U}),k=Fr(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:R,description:c,editing:U,value:L,onChange:(B,q="change")=>d(x,B,q),componentProps:I};return e.jsxs(y,{className:"form-item",children:[!j&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!L?"#ff0000":"#333"},children:[c,v&&e.jsx(ct,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input",sx:{textAlign:j?"center":"left"},children:e.jsx(k,{...M})}),!j&&e.jsx(y,{className:"form-item-action",children:U?e.jsxs(e.Fragment,{children:[e.jsx($,{"data-cy":"schema-form-item-confirm",onClick:()=>{d(x,L,"confirm")},disabled:m||o,size:"large",children:o?e.jsx(re,{size:24}):e.jsx(lr,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Yo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[R],"edit")},disabled:m||u,size:"large",children:e.jsx(ar,{})})})]})]},R)})})}rn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};rn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Gr=F(Es)``;function an({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=J(),l=po(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(b,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},R=v=>{A.error(v),o(v)};function c(v){return Ko(()=>eo.get(v).then(async({data:j})=>{const T=j==null?void 0:j.downloadTokenList;if(j.status==="succeed"){if(T&&T.length)await x({downloadTokenList:T});else return await R(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await R(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Jo(u);await c(v)}else await x({downloadTokenList:b.downloadTokenList&&C(b.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const b=new URL(g);b.pathname="/api/did/verify-purchase-blocklet/token",b.searchParams.set("serverDid",m.did),b.searchParams.set("blockletDid",t==null?void 0:t.did);try{eo.get(b.href).then(({data:C})=>{const x=`${C.url}`;h(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{h(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:pt.create({baseURL:g}).get,extraParams:{serverDid:m.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:p}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:pt.create({baseURL:we(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:p}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Gt,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}an.propTypes={...zs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};an.defaultProps={handlePaySuccess:()=>{}};const ln=f.forwardRef(({mode:t,...o},s)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[i,m]=f.useState(t!=="both"?2:1),l=h=>{h!==a&&n(h)},u=()=>{a&&i!==2&&m(2)};return f.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(qs,{action:a,onNext:null,onSelect:l})}):e.jsx(an,{...o,mode:a})});ln.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};ln.defaultProps={ref:{}};const zr=ln;function qr({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function cn({key:t}={key:"sm"}){const o=uo();return Wt(o.breakpoints.down(t))}function dn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=cn();return!t||Qo(t.meta)?e.jsx(Vr,{children:s}):e.jsxs(_r,{isMobile:i,children:[e.jsx(qr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}dn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};dn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Vr=F(y)`
66
+ `,{NODE_MODES:so}=D,Ar=({mode:t,previousMode:o}={})=>t===so.SERVERLESS||o===so.SERVERLESS;var To={isInServerlessMode:Ar};function Lr(){const[t,o]=f.useState(null),{blocklet:s}=ie();return f.useEffect(()=>{o(tr(s))},[s]),{storageEndpoint:t}}const wo=f.createContext({}),{Provider:Or,Consumer:Za}=wo;function $t({children:t}){const[o,s]=f.useState(!1),[a,n]=f.useState(null),{blocklet:i,actions:{refreshBlocklet:m}}=ie(),{storageEndpoint:l}=Lr(),{api:u}=J();qo(async()=>{try{if(s(!0),Wn.isEmpty(l)){n(null);return}const d=await nr(l);n(d)}catch(d){console.error(d),A.error(d.message)}finally{s(!1)}},[l]);const h=()=>{n(null),m()},g=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[i.meta.did],configs:[{key:X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};f.useEffect(()=>{async function d(){if(!a)return;const b=await or(a.endpoint,a.name),C=Wn.merge(a,{name:b});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Or,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:h,updateSpaceGateway:g,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}$t.propTypes={children:Ke.node.isRequired};$t.defaultProps={};function en(){return f.useContext(wo)}const tn={description:r.string,editing:r.bool,onChange:r.func,required:r.bool,value:r.any,componentProps:r.object,render:r.func,renderFormItem:r.func};function nn({editing:t,value:o,onChange:s}){const[a,n]=f.useState(!1),i=f.useRef(),m=f.useRef(o);f.useEffect(()=>{let p=null;return t&&(p=setTimeout(()=>{n(!0)},50)),()=>{clearTimeout(p)}},[t]);const l=p=>{m.current=p,s(p)},u=()=>{n(!1),s(m.current)},h=e.jsx(y,{className:"form-item-input slot",px:1,children:e.jsxs(y,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),g=e.jsxs(y,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[e.jsx(y,{display:"flex",alignItems:"center",onClick:()=>n(!0),children:e.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),e.jsx(_o,{open:a,anchorEl:i.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(cr,{color:o,onChange:p=>l(p.hex)})})]});return t?g:h}nn.propTypes=tn;function on({editing:t,description:o,value:s,onChange:a,componentProps:n,...i}){const{placeholder:m}=n,l=f.useRef(s),u=g=>{g.key==="Enter"&&a(l.current,"confirm")},h=g=>{l.current=g,a(g)};return t?e.jsx(K,{style:{flex:1},fullWidth:!0,value:s,onChange:g=>{g.persist(),h(g.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...i}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}on.propTypes=tn;on.defaultProps={componentProps:{}};function sn({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:i}=a,m=o==="auto"?Wo.getPassportColorFromDid(i.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Ho({title:"Owner",issuer:O.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),e.jsx(nn,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}sn.propTypes={...tn,componentProps:r.shape({blocklet:r.object.isRequired}).isRequired};sn.defaultProps={};const Mr={input:on,color:nn,passport:sn,uploader:t=>e.jsx(Ts,{...t.componentProps})};function Fr(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:Mr[s==null?void 0:s.toLowerCase()]}function rn({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:i,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,h]=f.useState(null),[g,p]=f.useState(l?s:a),S=f.useRef();function d(x,R,c){const{key:v,secure:j}=x,I=g[v]!==R,U={...g,[v]:R};I&&p(U),n({[v]:R},{allValues:U,action:c,currentItem:x}),c==="confirm"&&j&&p({...g,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?b(null):b(x)}function b(x){if(x){S.current=g[x.key],h(x);return}S.current=null,h(null)}function C(x,{editing:R=!1}){const{key:c}=x,v=l?s[c]:g[c];return v==="__encrypted__"?R?"":"******":v}return e.jsx(Gr,{className:"form",style:i,children:t==null?void 0:t.map(x=>{const{key:R,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const U=!!(u&&R===u.key),L=C(x,{editing:U}),k=Fr(x,{editing:U}),M={inputProps:{"data-cy":"schema-form-item-component"},key:R,description:c,editing:U,value:L,onChange:(B,V="change")=>d(x,B,V),componentProps:I};return e.jsxs(y,{className:"form-item",children:[!j&&e.jsxs(y,{className:"form-item-label",style:{color:v&&!L?"#ff0000":"#333"},children:[c,v&&e.jsx(ct,{})]}),e.jsxs(y,{className:"form-item-body",children:[e.jsx(y,{className:"form-item-input",sx:{textAlign:j?"center":"left"},children:e.jsx(k,{...M})}),!j&&e.jsx(y,{className:"form-item-action",children:U?e.jsxs(e.Fragment,{children:[e.jsx($,{"data-cy":"schema-form-item-confirm",onClick:()=>{d(x,L,"confirm")},disabled:m||o,size:"large",children:o?e.jsx(re,{size:24}):e.jsx(lr,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Yo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,g[R],"edit")},disabled:m||u,size:"large",children:e.jsx(ar,{})})})]})]},R)})})}rn.propTypes={schema:r.array.isRequired,loading:r.bool,onChange:r.func.isRequired,value:r.object,defaultValue:r.object,style:r.object,disabled:r.bool};rn.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Gr=F(Es)``;function an({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:i}=z(),{info:m}=J(),l=po(m),[u,h]=f.useState(null),g=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(b,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},R=v=>{A.error(v),o(v)};function c(v){return Ko(()=>eo.get(v).then(async({data:j})=>{const T=j==null?void 0:j.downloadTokenList;if(j.status==="succeed"){if(T&&T.length)await x({downloadTokenList:T});else return await R(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await R(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Jo(u);await c(v)}else await x({downloadTokenList:b.downloadTokenList&&C(b.downloadTokenList)})};if(f.useEffect(()=>{if(s==="purchase"){const b=new URL(g);b.pathname="/api/did/verify-purchase-blocklet/token",b.searchParams.set("serverDid",m.did),b.searchParams.set("blockletDid",t==null?void 0:t.did);try{eo.get(b.href).then(({data:C})=>{const x=`${C.url}`;h(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{h(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:pt.create({baseURL:g}).get,extraParams:{serverDid:m.did,blockletDid:t==null?void 0:t.did},messages:{title:n("store.purchase.verify.auth.title",{name:p}),scan:n("store.purchase.verify.auth.scan"),confirm:n("store.purchase.verify.auth.confirm"),success:n("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:pt.create({baseURL:we(g,"/store")}).get,extraParams:{factory:t.nftFactory,nw:u},messages:{title:n("store.purchase.auth.title",{name:p}),scan:n("store.purchase.auth.scan"),confirm:n("store.purchase.auth.confirm"),success:e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("store.purchase.auth.success")}),e.jsx("p",{children:n("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return e.jsx(Gt,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:g,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}an.propTypes={...zs,handlePaySuccess:r.func,mode:r.oneOf(["verify","purchase"]).isRequired};an.defaultProps={handlePaySuccess:()=>{}};const ln=f.forwardRef(({mode:t,...o},s)=>{const[a,n]=f.useState(t!=="both"?t:"verify"),[i,m]=f.useState(t!=="both"?2:1),l=h=>{h!==a&&n(h)},u=()=>{a&&i!==2&&m(2)};return f.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>i})),i===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(Vs,{action:a,onNext:null,onSelect:l})}):e.jsx(an,{...o,mode:a})});ln.propTypes={mode:r.oneOf(["both","verify","purchase"]).isRequired,ref:r.any};ln.defaultProps={ref:{}};const zr=ln;function Vr({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function cn({key:t}={key:"sm"}){const o=uo();return Wt(o.breakpoints.down(t))}function dn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),i=cn();return!t||Qo(t.meta)?e.jsx(qr,{children:s}):e.jsxs(_r,{isMobile:i,children:[e.jsx(Vr,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}dn.propTypes={blocklet:r.object,onStartNow:r.func,children:r.any,disabled:r.bool};dn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const qr=F(y)`
67
67
  width: 100%;
68
68
  margin-top: auto;
69
69
  padding-top: 24px;
@@ -161,12 +161,12 @@ import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J
161
161
  visibility: visible;
162
162
  }
163
163
  }
164
- `;function Hr(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=en();return e.jsxs(y,{display:"flex",flexDirection:"column",children:[e.jsx(y,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:e.jsx(ee,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.connected.title")})}),e.jsx(y,{children:e.jsx(un,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function mn({onConnect:t,...o}){const{blocklet:s}=ie(),{info:a}=J(),{t:n,locale:i}=z(),[m,l]=f.useState(""),[u,h]=f.useState(!1),[g,p]=f.useState(!1),[S,d]=f.useState(""),b=mr({blocklet:s}),C=po(a),{storageEndpoint:x}=en(),[R,c]=f.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:pt.create({baseURL:we(window.location.origin,$o())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:b.appName},i),scan:n("storage.spaces.provideNFT.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(k=>({...k,open:!1}))}}),[v,j]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:b.appName},i),scan:n("storage.spaces.authorize.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{j(k=>({...k,open:!1}))}}),T=async({did:k,name:M,endpoint:B})=>{const q=await Xn(B);if(!await $n(q)){A.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Q={name:M,did:k,url:q,endpoint:B};await t(Q),A.success(n("storage.spaces.connectedWithName",{name:Q.name}))},I=(k,M)=>{setTimeout(async()=>{if(j(Q=>({...Q,open:!1})),l(null),c(Q=>({...Q,open:!1})),!He(k.spaceGateway)){await T(M(k.spaceGateway));return}const B=M(k.endpoint),q=k.space?M(k.space):{};await T({endpoint:B,did:rr(B),name:"DID Space",...q})},0)},U=()=>{c(k=>({...k,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{h(!0);const k=await Xn(m),M=ir(k),B=new URL(k).searchParams.get("spaceDid");if(!await $n(M))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));j(q=>({...q,open:!0,prefix:we(M,"space/api/did"),baseUrl:new URL(M).origin,checkFn:pt.create({baseURL:we(M,"space")}).get,extraParams:{appDid:b.appDid,appName:b.appName,appDescription:b.appDescription,scopes:b.scopes,appUrl:b.appUrl,referrer:b.referrer,nodeDid:a.did,spaceDid:B}})),p(!1)}catch(k){const M=`${n("storage.spaces.gateway.add.failed",i)}: ${Z(k)}`;d(M)}finally{h(!1)}};return e.jsxs(y,{children:[e.jsx(to,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:U,variant:"outlined",menu:[e.jsx(to.Item,{sx:{textTransform:"none"},onClick:()=>p(!0),size:"small",...o,children:n(x?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(ee,{sx:{fontWeight:"bold",textTransform:"none"},children:n(x?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),e.jsx(Gt,{forceConnected:!1,saveConnect:!1,prefix:R.prefix,open:R.open,popup:!0,action:R.action,webWalletUrl:C,baseUrl:R.baseUrl,checkFn:R.checkFn,onSuccess:I,onClose:R.onClose,checkTimeout:R.checkTimeout,extraParams:R.extraParams,messages:R.messages,locale:i}),e.jsx(Gt,{forceConnected:!1,saveConnect:!1,prefix:v.prefix,open:v.open,popup:!0,action:v.action,baseUrl:v.baseUrl,checkFn:v.checkFn,onSuccess:I,onClose:v.onClose,checkTimeout:v.checkTimeout,extraParams:v.extraParams,messages:v.messages,locale:i}),e.jsxs(xt,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:g,onClose:()=>p(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(ne,{onClick:k=>{k.stopPropagation(),p(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(ne,{onClick:L,color:"primary",disabled:u||!m,variant:"contained",autoFocus:!0,children:[u&&e.jsx(re,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(es,{component:"div",children:e.jsx(ee,{component:"div",children:e.jsx(K,{label:n("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:m,onChange:k=>{d(null),l(k.target.value)},disabled:u,onKeyPress:async k=>{k.key==="Enter"&&await L()},autoFocus:!0})})})}),!!S&&e.jsx(dt,{severity:"error",style:{width:"100%"},children:S})]})]})}mn.propTypes={onConnect:Ke.func};mn.defaultProps={onConnect:()=>{}};function fn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=cn(),{blocklet:a}=ie(),{updateSpaceGateway:n,loading:i,hasStorageEndpoint:m}=en();return f.useEffect(()=>{o==null||o()},[a]),i?e.jsx(ts,{relative:"parent",children:e.jsx(re,{})}):e.jsxs(Yr,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx(Hr,{}):e.jsx(Io,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(dn,{mt:8,children:e.jsx(mn,{onConnect:n})})]})}fn.propTypes={blockletMeta:r.any.isRequired,onEndpointUpdate:Ke.func};fn.defaultProps={onEndpointUpdate:()=>{}};const Yr=F(ws)`
164
+ `;function Hr(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=en();return e.jsxs(y,{display:"flex",flexDirection:"column",children:[e.jsx(y,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:"12px",children:e.jsx(ee,{fontSize:"1.2rem",fontWeight:"bold",children:t("storage.spaces.connected.title")})}),e.jsx(y,{children:e.jsx(un,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function mn({onConnect:t,...o}){const{blocklet:s}=ie(),{info:a}=J(),{t:n,locale:i}=z(),[m,l]=f.useState(""),[u,h]=f.useState(!1),[g,p]=f.useState(!1),[S,d]=f.useState(""),b=mr({blocklet:s}),C=po(a),{storageEndpoint:x}=en(),[R,c]=f.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:pt.create({baseURL:we(window.location.origin,$o())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:b.appName},i),scan:n("storage.spaces.provideNFT.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(k=>({...k,open:!1}))}}),[v,j]=f.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:b.appName},i),scan:n("storage.spaces.authorize.scan",{appName:b.appName},i),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.authorize.success")})},onClose:()=>{j(k=>({...k,open:!1}))}}),T=async({did:k,name:M,endpoint:B})=>{const V=await Xn(B);if(!await $n(V)){A.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Q={name:M,did:k,url:V,endpoint:B};await t(Q),A.success(n("storage.spaces.connectedWithName",{name:Q.name}))},I=(k,M)=>{setTimeout(async()=>{if(j(Q=>({...Q,open:!1})),l(null),c(Q=>({...Q,open:!1})),!He(k.spaceGateway)){await T(M(k.spaceGateway));return}const B=M(k.endpoint),V=k.space?M(k.space):{};await T({endpoint:B,did:rr(B),name:"DID Space",...V})},0)},U=()=>{c(k=>({...k,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{h(!0);const k=await Xn(m),M=ir(k),B=new URL(k).searchParams.get("spaceDid");if(!await $n(M))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));j(V=>({...V,open:!0,prefix:we(M,"space/api/did"),baseUrl:new URL(M).origin,checkFn:pt.create({baseURL:we(M,"space")}).get,extraParams:{appDid:b.appDid,appName:b.appName,appDescription:b.appDescription,scopes:b.scopes,appUrl:b.appUrl,referrer:b.referrer,nodeDid:a.did,spaceDid:B}})),p(!1)}catch(k){const M=`${n("storage.spaces.gateway.add.failed",i)}: ${Z(k)}`;d(M)}finally{h(!1)}};return e.jsxs(y,{children:[e.jsx(to,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:U,variant:"outlined",menu:[e.jsx(to.Item,{sx:{textTransform:"none"},onClick:()=>p(!0),size:"small",...o,children:n(x?"storage.spaces.connect.useSpaceGatewayReconnect":"storage.spaces.connect.useSpaceGateway")},"1")],children:e.jsx(ee,{sx:{fontWeight:"bold",textTransform:"none"},children:n(x?"storage.spaces.connect.useWalletReconnect":"storage.spaces.connect.useWallet")})}),e.jsx(Gt,{forceConnected:!1,saveConnect:!1,prefix:R.prefix,open:R.open,popup:!0,action:R.action,webWalletUrl:C,baseUrl:R.baseUrl,checkFn:R.checkFn,onSuccess:I,onClose:R.onClose,checkTimeout:R.checkTimeout,extraParams:R.extraParams,messages:R.messages,locale:i}),e.jsx(Gt,{forceConnected:!1,saveConnect:!1,prefix:v.prefix,open:v.open,popup:!0,action:v.action,baseUrl:v.baseUrl,checkFn:v.checkFn,onSuccess:I,onClose:v.onClose,checkTimeout:v.checkTimeout,extraParams:v.extraParams,messages:v.messages,locale:i}),e.jsxs(xt,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:g,onClose:()=>p(!1),PaperProps:{style:{minHeight:"auto"}},actions:e.jsxs(e.Fragment,{children:[e.jsx(ne,{onClick:k=>{k.stopPropagation(),p(!1)},color:"inherit",children:n("common.cancel")}),e.jsxs(ne,{onClick:L,color:"primary",disabled:u||!m,variant:"contained",autoFocus:!0,children:[u&&e.jsx(re,{size:16}),n("common.confirm")]})]}),children:[e.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:e.jsx(es,{component:"div",children:e.jsx(ee,{component:"div",children:e.jsx(K,{label:n("storage.spaces.gateway.add.label"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:m,onChange:k=>{d(null),l(k.target.value)},disabled:u,onKeyPress:async k=>{k.key==="Enter"&&await L()},autoFocus:!0})})})}),!!S&&e.jsx(dt,{severity:"error",style:{width:"100%"},children:S})]})]})}mn.propTypes={onConnect:Ke.func};mn.defaultProps={onConnect:()=>{}};function fn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=cn(),{blocklet:a}=ie(),{updateSpaceGateway:n,loading:i,hasStorageEndpoint:m}=en();return f.useEffect(()=>{o==null||o()},[a]),i?e.jsx(ts,{relative:"parent",children:e.jsx(re,{})}):e.jsxs(Yr,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx(Hr,{}):e.jsx(Io,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(dn,{mt:8,children:e.jsx(mn,{onConnect:n})})]})}fn.propTypes={blockletMeta:r.any.isRequired,onEndpointUpdate:Ke.func};fn.defaultProps={onEndpointUpdate:()=>{}};const Yr=F(ws)`
165
165
  height: 100%;
166
166
  overflow-y: auto;
167
167
  padding-bottom: 32px;
168
168
  overflow-x: hidden;
169
- `;function hn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:i}){const{t:m}=z(),{info:l,inService:u}=J(),{blocklet:h}=ie(),[g,p]=f.useState(!1),S=f.useRef(null),[d,b]=f.useState(),[C,x]=gr(i||"tmp"),[R,c]=i?[C,x]:[d,b],{storeList:v,teamDid:j}=ho({fromBlocklet:u,blocklet:h,nodeInfo:l}),T=jo([...n.map(U=>({...U,protected:!0})),...v],"url"),I=R&&T.find(U=>R===U.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Jr,{children:[e.jsx(ne,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(hr,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:e.jsx(ee,{color:"primary",children:I.name})}),e.jsx(ee,{color:"primary",children:a})]}),e.jsxs(K,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:m("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:I,autoFocus:!0,onChange:U=>{const L=U.target.value;c(L.url),t(L)},SelectProps:{open:g,MenuProps:{anchorEl:S.current},renderValue:U=>U==null?void 0:U.name,onClose:()=>{p(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(U=>e.jsx(ge,{sx:{width:"400px",maxWidth:"90vw"},value:U,"data-cy":U.url,children:e.jsx(Vs,{teamDid:j,store:U,onDelete:()=>{var L;R===U.url&&c((L=T[0])==null?void 0:L.url)}})},U.url)),!To.isInServerlessMode(l)&&e.jsx(_s,{disabled:o,storeList:T,teamDid:j,onAdd:U=>{c(U)}})]}),s({currentRegistry:I})]})}hn.propTypes={onChange:r.func,loading:r.bool,children:r.any.isRequired,extra:r.node,storageKey:r.string,stores:r.arrayOf(r.shape({name:r.string.isRequired,url:r.string.isRequired}))};hn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Jr=F.div`
169
+ `;function hn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:i}){const{t:m}=z(),{info:l,inService:u}=J(),{blocklet:h}=ie(),[g,p]=f.useState(!1),S=f.useRef(null),[d,b]=f.useState(),[C,x]=gr(i||"tmp"),[R,c]=i?[C,x]:[d,b],{storeList:v,teamDid:j}=ho({fromBlocklet:u,blocklet:h,nodeInfo:l}),T=jo([...n.map(U=>({...U,protected:!0})),...v],"url"),I=R&&T.find(U=>R===U.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Jr,{children:[e.jsx(ne,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(hr,{color:"primary"}),onClick:()=>{p(!0)},style:{padding:"0 2px"},children:e.jsx(ee,{color:"primary",children:I.name})}),e.jsx(ee,{color:"primary",children:a})]}),e.jsxs(K,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:m("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:I,autoFocus:!0,onChange:U=>{const L=U.target.value;c(L.url),t(L)},SelectProps:{open:g,MenuProps:{anchorEl:S.current},renderValue:U=>U==null?void 0:U.name,onClose:()=>{p(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(U=>e.jsx(ge,{sx:{width:"400px",maxWidth:"90vw"},value:U,"data-cy":U.url,children:e.jsx(qs,{teamDid:j,store:U,onDelete:()=>{var L;R===U.url&&c((L=T[0])==null?void 0:L.url)}})},U.url)),!To.isInServerlessMode(l)&&e.jsx(_s,{disabled:o,storeList:T,teamDid:j,onAdd:U=>{c(U)}})]}),s({currentRegistry:I})]})}hn.propTypes={onChange:r.func,loading:r.bool,children:r.any.isRequired,extra:r.node,storageKey:r.string,stores:r.arrayOf(r.shape({name:r.string.isRequired,url:r.string.isRequired}))};hn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Jr=F.div`
170
170
  display: flex;
171
171
  justify-content: space-between;
172
172
  align-items: center;
@@ -177,7 +177,7 @@ import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J
177
177
  color: ${t=>t.theme.palette.common.black};
178
178
  // font-weight: bold;
179
179
  }
180
- `;var gn={},Kr=_t;Object.defineProperty(gn,"__esModule",{value:!0});var Uo=gn.default=void 0,Qr=Kr(Vt()),Zr=e;Uo=gn.default=(0,Qr.default)((0,Zr.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const Xr=(t,o)=>we(o,`/blocklets/${t.did}`),ro=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,$r=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function xn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let i=we(a,ss(t.did,t.logo||""));try{const C=new URL(i);C.searchParams.set("v",t.version||+new Date),i=C.href}catch{}const[m,l]=f.useState(!1),u=C=>C.currentTarget.contains(C.target)?!0:(C.preventDefault(),!1),h=async C=>{C.preventDefault(),C.stopPropagation();try{l(!0),await s({meta:t,registryUrl:a,blocklets:o})}catch(x){A.error(x.message)}finally{l(!1)}},{blocklet:g}=ie(),p=()=>((g==null?void 0:g.children)||[]).find(R=>R.meta.bundleDid===t.did).meta.version,d=(()=>{const C=((g==null?void 0:g.children)||[]).find(x=>x.meta.bundleDid===t.did);if(C){try{const x=C.meta.version,R=t.version;if(rs.gt(R,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let b=n("blocklet.component.choose");return d==="upgrade"?b=n("blocklet.component.upgrade"):d==="disable"?b=n("blocklet.component.installed"):$r(t)&&(b=n("common.purchase")),e.jsx(yt,{href:Xr(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(ei,{title:ro({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:ro({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?i:"",version:t.version,button:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Hs,{children:e.jsxs(ne,{onClick:h,size:"small",disabled:m||d==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:d==="upgrade"?`${p()} -> ${t.version}`:"",children:[m?e.jsxs(e.Fragment,{children:[e.jsx(re,{size:16,style:{marginRight:3}}),b]}):b,d==="upgrade"?e.jsx(Uo,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}xn.propTypes={blocklet:r.object.isRequired,blocklets:r.array,handleButtonClick:r.func,endpoint:r.string};xn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function yn({handleButtonClick:t,handleSearchSelect:o,storeUrl:s,handleBlockletRender:a,extraFilter:n,serverVersion:i,resourceType:m,resourceDid:l,showResourcesSwitch:u,showCategory:h,...g}){const{locale:p}=z(),[S,d]=f.useState(!1),[b,C]=f.useState({}),x=c=>{C(c)},R=s;return f.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[R,m,l]),f.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(ns,{FallbackComponent:os,resetKeys:[R],children:e.jsx("div",{...g,children:S&&e.jsx(Ws,{showCategory:h,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:R};return a({...c,defaultRender:e.jsx(xn,{...v})})},baseSearch:!0,endpoint:R,locale:p,onFilterChange:x,onSearchSelect:o,filters:b,extraFilter:n,serverVersion:i,fetchCategoryDelay:500})})})}yn.propTypes={storeUrl:r.string.isRequired,handleButtonClick:r.func,handleSearchSelect:r.func,handleBlockletRender:r.func,extraFilter:r.func,serverVersion:r.string,resourceType:r.string,resourceDid:r.string,showResourcesSwitch:r.bool,showCategory:r.bool};yn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const ei=F(Ys)`
180
+ `;var gn={},Kr=_t;Object.defineProperty(gn,"__esModule",{value:!0});var Uo=gn.default=void 0,Qr=Kr(qt()),Zr=e;Uo=gn.default=(0,Qr.default)((0,Zr.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const Xr=(t,o)=>we(o,`/blocklets/${t.did}`),ro=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,$r=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function xn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let i=we(a,ss(t.did,t.logo||""));try{const C=new URL(i);C.searchParams.set("v",t.version||+new Date),i=C.href}catch{}const[m,l]=f.useState(!1),u=C=>C.currentTarget.contains(C.target)?!0:(C.preventDefault(),!1),h=async C=>{C.preventDefault(),C.stopPropagation();try{l(!0),await s({meta:t,registryUrl:a,blocklets:o})}catch(x){A.error(x.message)}finally{l(!1)}},{blocklet:g}=ie(),p=()=>((g==null?void 0:g.children)||[]).find(R=>R.meta.bundleDid===t.did).meta.version,d=(()=>{const C=((g==null?void 0:g.children)||[]).find(x=>x.meta.bundleDid===t.did);if(C){try{const x=C.meta.version,R=t.version;if(rs.gt(R,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let b=n("blocklet.component.choose");return d==="upgrade"?b=n("blocklet.component.upgrade"):d==="disable"?b=n("blocklet.component.installed"):$r(t)&&(b=n("common.purchase")),e.jsx(yt,{href:Xr(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(ei,{title:ro({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:ro({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?i:"",version:t.version,button:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Hs,{children:e.jsxs(ne,{onClick:h,size:"small",disabled:m||d==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:d==="upgrade"?`${p()} -> ${t.version}`:"",children:[m?e.jsxs(e.Fragment,{children:[e.jsx(re,{size:16,style:{marginRight:3}}),b]}):b,d==="upgrade"?e.jsx(Uo,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}xn.propTypes={blocklet:r.object.isRequired,blocklets:r.array,handleButtonClick:r.func,endpoint:r.string};xn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function yn({handleButtonClick:t,handleSearchSelect:o,storeUrl:s,handleBlockletRender:a,extraFilter:n,serverVersion:i,resourceType:m,resourceDid:l,showResourcesSwitch:u,showCategory:h,...g}){const{locale:p}=z(),[S,d]=f.useState(!1),[b,C]=f.useState({}),x=c=>{C(c)},R=s;return f.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[R,m,l]),f.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(ns,{FallbackComponent:os,resetKeys:[R],children:e.jsx("div",{...g,children:S&&e.jsx(Ws,{showCategory:h,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:R};return a({...c,defaultRender:e.jsx(xn,{...v})})},baseSearch:!0,endpoint:R,locale:p,onFilterChange:x,onSearchSelect:o,filters:b,extraFilter:n,serverVersion:i,fetchCategoryDelay:500})})})}yn.propTypes={storeUrl:r.string.isRequired,handleButtonClick:r.func,handleSearchSelect:r.func,handleBlockletRender:r.func,extraFilter:r.func,serverVersion:r.string,resourceType:r.string,resourceDid:r.string,showResourcesSwitch:r.bool,showCategory:r.bool};yn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const ei=F(Ys)`
181
181
  .ms-highlight {
182
182
  color: ${t=>t.theme.palette.primary.main};
183
183
  }
@@ -319,7 +319,7 @@ import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J
319
319
  & .connect {
320
320
  background: white;
321
321
  }
322
- `,oi=Cn,si=t=>t.inStore&&O.isFreeBlocklet(t)===!1,ri=t=>{var o;return[X.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,X.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=t==null?void 0:t.capabilities)==null?void 0:o.didSpace)},Ot=t=>{var o,s;return((s=(o=t==null?void 0:t.configs)==null?void 0:o.find(a=>a.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:s.value)||null},ii=t=>(t.environments||[]).some(o=>o.required),ao=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),ai=({params:t,blocklet:o,t:s})=>{const a=t.title||t.name;return a?((o==null?void 0:o.children)||[]).find(i=>i.meta.bundleDid===t.bundleDid)?s("blocklet.component.upgradeNext",{name:a}):s("blocklet.component.addNext",{name:a}):s("common.next")},lo=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function jn({onClose:t,mode:o,stores:s,resourceType:a,resourceDid:n,storageKey:i,inDialog:m,selectedMeta:l,storeUrl:u,showResourcesSwitch:h,showFromUrl:g,enableRunBackground:p,showCategory:S}){var Ln,On,Mn,$e,Fn,et,Gn;const{t:d,locale:b}=z(),[C,x]=f.useState(!1),[R,c]=f.useState(null),[v,j]=f.useState(""),[T,I]=f.useState(""),{api:U,ws:{useSubscription:L},inService:k,info:M}=J(),{blocklet:B,actions:{refreshBlocklet:q}}=ie(),[Q,Ie]=f.useState(null),[te,de]=f.useState(!1),Se={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[P,ke]=f.useState(Se),[me,Ze]=f.useState(0),V=f.useRef({}),w=f.useRef({}),_=f.useRef({}),oe=Wt(E=>E.breakpoints.down("md")),xe=as(),[se,Ge]=f.useState(!0),{meta:Y}=V.current,H=E=>ke(N=>({...N,...E}));f.useEffect(()=>{if(P.pathPrefix){const{errMsg:E}=An({...P,pathPrefix:P.pathPrefix,locale:b});j(E)}},[P.pathPrefix]),f.useEffect(()=>{me===0&&ke(Se)},[me]);const be=()=>{const E=Ot(B)??"";H({didSpaceEndpoint:E})},ze=()=>{var E;return(E=V==null?void 0:V.current)!=null&&E.meta?O.getDisplayName(V.current):""},Ue=E=>{const N=G=>{H({installResultProps:{variant:"error",title:ze(),subTitle:E,footer:e.jsx(ne,{className:"bottom-button",disabled:G,"data-cy":"retry-install-component",onClick:async()=>{N(!0),await Nn(V.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[G&&e.jsx(re,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};N()},Tt=E=>N=>{var G,W;(((G=N==null?void 0:N.meta)==null?void 0:G.did)||(N==null?void 0:N.meta))===((W=B==null?void 0:B.meta)==null?void 0:W.did)&&E(N)};L(X.BlockletEvents.statusChange,Tt(E=>{switch(E.status){case X.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:ze(),subTitle:d("blocklet.component.installSuccessTip")}}),lo({componentDid:xe.componentDid});break}const N=Ot(B);H(G=>({...G,didSpaceEndpoint:N}))}),[(Ln=B==null?void 0:B.meta)==null?void 0:Ln.did]),L(X.BlockletEvents.downloadFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(On=B==null?void 0:B.meta)==null?void 0:On.did]),L(X.BlockletEvents.installFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Mn=B==null?void 0:B.meta)==null?void 0:Mn.did]);const pe=[],wt=()=>{x(!1),ke({}),V.current={},t()},Xe=E=>((B==null?void 0:B.children)||[]).some(N=>N.meta.did===E),Nn=async E=>{var Be,Ne;const{pathPrefix:N,bundleDid:G,title:W,componentName:Re="",componentDid:De=""}=P,Ee=((Be=V.current)==null?void 0:Be.meta)||{},{configs:ye=[],registryUrl:je,inStore:Ve,inputUrl:_e,dist:It}=Ee,We=(Ne=V.current)==null?void 0:Ne.downloadTokenList,le=Ve?Hn(je,G,It):_e;x(!0);const tt={rootDid:B.meta.did,url:le,mountPoint:N?ue(N):`/${ue(Ee.title||Ee.name)}`,title:W,name:Re,did:De,onlyRequired:!se,...P.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:P.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await U.installComponent({input:tt}),je){const{teamDid:he,storeList:Ae}=ho({fromBlocklet:k,nodeInfo:M,blocklet:B}),{isNew:kt,decoded:nt}=ds(je,Ae);kt&&await U.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),q({showError:!1,attachRuntimeInfo:!1})}catch(he){const Ae=Z(he);A.error(Ae),console.error("installComponent error: ",he),Ue(Ae)}finally{x(!1),V.current.installInput=tt}},An=E=>({errMsg:vo({params:{...E,did:E.bundleDid},blocklets:[B],blocklet:B,locale:b})}),fe=async E=>{var G,W;const{errMsg:N}=An({...P,locale:b});j(N),me===pe.length-2&&await Nn(E),(W=(G=w.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,Re=>Re+1)},qe=()=>{var E,N;(N=(E=w.current)==null?void 0:E.setActiveStepByIndex)==null||N.call(E,G=>G-1)},Lo=()=>{const{pathPrefix:E,bundleDid:N,title:G,componentName:W="",componentDid:Re=""}=P,{meta:De={}}=V.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:Ve}=De,_e=ye?Hn(Ee,N,Ve):je;Ie({meta:De,installOpts:{type:"component",rootDid:B.meta.did,mountPoint:E,url:_e,title:G,name:W,did:Re}})},Oo=E=>{de(!1),H({purchaseResultProps:{variant:"error",title:ze(),subTitle:E,style:{paddingTop:120},footer:e.jsx(ne,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{H({purchaseResultProps:{}})},children:d("common.retry")})}})},Mo=({downloadTokenList:E})=>{V.current.downloadTokenList=E,de(!1),fe()},Pt=({chooseParams:E=V.current,componentDid:N,isInit:G=!1})=>{var nt,zn,qn,Vn;const{meta:W,registryUrl:Re,inStore:De,inputUrl:Ee}=E,{did:ye,title:je,name:Ve}=W,_e=(((nt=B.settings)==null?void 0:nt.children)||[]).filter(ce=>ce.status==="deleted"&&ce.meta.bundleDid===ye),It=N||"",We=(zn=W.environments)==null?void 0:zn.map(ce=>{const{name:Ut,validation:ot,...st}=ce,Dt={validation:ls(ot)?"":ot};return{...st,key:Ut,...Dt}});V.current={...E,meta:{...W,configs:We,registryUrl:Re,inStore:De,inputUrl:Ee}};let le={};if(G){const ce=[B],Ut=We||[],ot=[],st=jo(cs([...Ut,...ot]),"key").filter(Le=>!!Le.key).sort((Le,rt)=>Le.required&&!rt.required?-1:rt.required&&!Le.required?1:0),Dt=O.getSharedConfigObj(ce[0],{configs:st}),Bt={},_n=st.map(Le=>{const{default:rt,key:it,...Go}=Le;return Bt[it]=Dt[it]||rt,{...Go,key:it,hidden:!!X.BLOCKLET_CONFIGURABLE_KEY[it]}});le={...le,configsList:_n,configsValue:Bt,hasMissRequiredConfigs:ao(_n,Bt)}}const tt=B.children.some(ce=>ce.mountPoint==="/"),Be=_e.find(ce=>ce.meta.bundleDid===ye),Ne=B.children.find(ce=>ce.meta.bundleDid===ye);le.title=je||"",Be?le={...le,pathPrefix:Be.mountPoint||"",componentName:Be.meta.name,hasEnvironmentsStep:!1}:Ne?le={...le,pathPrefix:Ne.mountPoint||"",componentName:Ne.meta.name,hasEnvironmentsStep:!1}:le={...le,pathPrefix:tt?`/${ue(je)||ue(Ve)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Vn=(qn=V.current.meta)==null?void 0:qn.environments)==null?void 0:Vn.length)>0};const he=si(V.current.meta),Ae=ri(V.current.meta),kt=Ot(B);H({bundleDid:ye,componentDid:It,...le,hasRequiredEnvironments:ii(V.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Ae,didSpaceEndpoint:kt}),G&&he&&Lo()};f.useEffect(()=>{!l||me!==0||!B||(Pt({chooseParams:{blocklets:[l],meta:l,registryUrl:u||l.homepage,inStore:!0},isInit:!0}),H({showFromUrlDialog:!1}),fe())},[l,me,B]),pe.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:e.jsxs(Te,{sx:{width:400},component:"div",children:[g&&P.showFromUrlDialog&&e.jsx(dr,{mode:"component",onCancel:()=>{H({showFromUrlDialog:!1})},onSuccess:({meta:E,inputUrl:N,inStore:G,registryUrl:W})=>{Pt({chooseParams:{meta:E,inputUrl:N,inStore:G,registryUrl:W},isInit:!0}),H({showFromUrlDialog:!1}),fe()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),e.jsx(hn,{stores:s,extra:To.isInServerlessMode(M)?null:g?e.jsxs(ne,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{H({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Qt,{style:{fontSize:20,marginRight:4}})," ",d("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:C,onChange:()=>{ke({}),V.current={}},storageKey:i,children:({currentRegistry:E})=>e.jsx(yn,{showResourcesSwitch:h,showCategory:S,serverVersion:M==null?void 0:M.version,style:oe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:E.url,resourceType:a,resourceDid:n,handleButtonClick:N=>{Pt({chooseParams:{...N,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:N,defaultRender:G})=>{const W=(P==null?void 0:P.bundleDid)&&(P==null?void 0:P.bundleDid)===(N==null?void 0:N.did);return e.jsxs(ci,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(fo,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:ai({params:P,blocklet:B,t:d}),onCancel:wt,onConfirm:()=>{fe()}}),pe.push({key:"agreement",name:d("launchBlocklet.introduction"),body:e.jsxs(Te,{component:"div",className:"agreement-wrapper",children:[e.jsx(Co,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(Ps,{meta:Y,onClickNext:fe,installRelated:se,onChangeInstallRelated:Ge,handleDescEle:e.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:l?void 0:d("common.pre"),confirm:d("launchBlocklet.next"),onCancel:l?wt:qe,onConfirm:()=>{de(!1),fe()}}),Y&&P.requirePurchase&&pe.push({key:"purchase",name:e.jsxs(e.Fragment,{children:[d("common.verifyNFT"),e.jsx(ct,{})]}),body:e.jsxs(Te,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Fn=($e=_.current)==null?void 0:$e.getCurrentStep)==null?void 0:Fn.call($e))===2||te)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(P.purchaseResultProps)?Q&&e.jsx(zr,{ref:_,meta:Q.meta,mode:P.componentDid?"verify":"both",onCancel:Oo,installOpts:Q.installOpts,handlePaySuccess:Mo}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Zn,{...P.purchaseResultProps})})]}),disabled:((Gn=(et=_.current)==null?void 0:et.getCurrentStep)==null?void 0:Gn.call(et))===2||te,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof _.current.onNext=="function"&&(_.current.onNext(),de(!0))},onCancel:()=>{qe()}}),O.hasStartEngine(Y)&&!Xe(Y.did)&&pe.push({key:"config",name:d("common.config"),error:v,body:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.config"),subTitle:d("blocklet.component.addComponentTip.config")}),e.jsx(K,{label:d("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:T||d("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:P.pathPrefix,onChange:E=>{const N=E.target.value;H({pathPrefix:N}),I(d("common.slugifyHint",{value:gt(N)}))}}),!!v&&e.jsx(dt,{severity:"error",style:{width:"100%",marginTop:8},children:v})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:()=>{fe()}}),Y&&!Xe(Y.did)&&(P!=null&&P.hasEnvironmentsStep)&&pe.push({key:"environment",name:e.jsxs(e.Fragment,{children:[d("common.environment")," ",P.hasRequiredEnvironments&&e.jsx(ct,{})]}),disabled:!!R||(P==null?void 0:P.hasMissRequiredConfigs),body:()=>e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),e.jsx(rn,{style:{marginTop:-12,width:"100%"},schema:P.configsList,defaultValue:P.configsValue,onChange:(E,{action:N,currentItem:G,allValues:W})=>{N==="confirm"&&H({hasMissRequiredConfigs:ao(P.configsList,W),configsValue:W}),N==="edit"?c(G):["cancel","confirm"].includes(N)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:fe}),Y&&!Xe(Y.did)&&(P!=null&&P.didSpaceIsRequiredSetup)&&pe.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",P.didSpaceIsRequiredSetup==="required"&&e.jsx(ct,{})]}),disabled:(P==null?void 0:P.didSpaceIsRequiredSetup)&&!P.didSpaceEndpoint,body:()=>e.jsx($t,{children:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("blocklet.component.didSpaceConfig"),subTitle:d("blocklet.component.didSpaceConfigTip")}),e.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:e.jsx(fn,{blockletMeta:V.current.meta,onNext:()=>{fe()},onEndpointUpdate:be})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:qe,onConfirm:fe}),pe.push({key:"install",name:Xe(Y==null?void 0:Y.did)?d("common.upgrade"):d("common.install"),disabled:p?!1:He(P.installResultProps),loading:p?!1:He(P.installResultProps),body:e.jsx(Te,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:He(P.installResultProps)?e.jsx(Xs,{message:e.jsx(di,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Zn,{...P.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{lo({timeout:0,componentDid:xe.componentDid,manual:!0}),wt(),setTimeout(()=>{const E=document.getElementsByClassName("dashboard-main")[0];E&&(E.scrollTop=E.scrollHeight)},200)}});const ae=pe[me]||{},Fo=()=>C||ae.error||!P.bundleDid?!0:me>1?!P.pathPrefix:!1;return B?e.jsxs(li,{sx:{width:"100%",height:oe?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx($s,{steps:pe,mode:"memory",children:e.jsx(oi,{ref:w,meta:Y,isMobile:oe,onStepChange:E=>{Ze(E)}})}),e.jsxs(y,{className:"action-bar",children:[ae.cancel&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onCancel()},disabled:me===pe.length-2&&C,color:"inherit",children:ae.cancel||d("common.cancel")}),ae.confirm&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof ae.disabled=="boolean"?ae.disabled:Fo()),variant:"contained",autoFocus:!0,title:ae.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[(typeof ae.loading=="boolean"?ae.loading:C)&&e.jsx(re,{style:{marginRight:8},size:16}),ae.confirm]})})]})]}):null}jn.propTypes={onClose:r.func,mode:r.oneOf(["normal","embed"]),inDialog:r.bool,stores:r.arrayOf(r.string),storeUrl:r.string,resourceType:r.string,resourceDid:r.string,storageKey:r.string,selectedMeta:r.object,showResourcesSwitch:r.bool,showFromUrl:r.bool,enableRunBackground:r.bool,showCategory:r.bool};jn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const li=F(y)`
322
+ `,oi=Cn,si=t=>t.inStore&&O.isFreeBlocklet(t)===!1,ri=t=>{var o;return[X.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,X.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=t==null?void 0:t.capabilities)==null?void 0:o.didSpace)},Ot=t=>{var o,s;return((s=(o=t==null?void 0:t.configs)==null?void 0:o.find(a=>a.key===X.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:s.value)||null},ii=t=>(t.environments||[]).some(o=>o.required),ao=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),ai=({params:t,blocklet:o,t:s})=>{const a=t.title||t.name;return a?((o==null?void 0:o.children)||[]).find(i=>i.meta.bundleDid===t.bundleDid)?s("blocklet.component.upgradeNext",{name:a}):s("blocklet.component.addNext",{name:a}):s("common.next")},lo=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function jn({onClose:t,mode:o,stores:s,resourceType:a,resourceDid:n,storageKey:i,inDialog:m,selectedMeta:l,storeUrl:u,showResourcesSwitch:h,showFromUrl:g,enableRunBackground:p,showCategory:S}){var Ln,On,Mn,$e,Fn,et,Gn;const{t:d,locale:b}=z(),[C,x]=f.useState(!1),[R,c]=f.useState(null),[v,j]=f.useState(""),[T,I]=f.useState(""),{api:U,ws:{useSubscription:L},inService:k,info:M}=J(),{blocklet:B,actions:{refreshBlocklet:V}}=ie(),[Q,Ie]=f.useState(null),[te,de]=f.useState(!1),Se={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[P,ke]=f.useState(Se),[me,Ze]=f.useState(0),q=f.useRef({}),w=f.useRef({}),_=f.useRef({}),oe=Wt(E=>E.breakpoints.down("md")),xe=as(),[se,Ge]=f.useState(!0),{meta:Y}=q.current,H=E=>ke(N=>({...N,...E}));f.useEffect(()=>{if(P.pathPrefix){const{errMsg:E}=An({...P,pathPrefix:P.pathPrefix,locale:b});j(E)}},[P.pathPrefix]),f.useEffect(()=>{me===0&&ke(Se)},[me]);const be=()=>{const E=Ot(B)??"";H({didSpaceEndpoint:E})},ze=()=>{var E;return(E=q==null?void 0:q.current)!=null&&E.meta?O.getDisplayName(q.current):""},Ue=E=>{const N=G=>{H({installResultProps:{variant:"error",title:ze(),subTitle:E,footer:e.jsx(ne,{className:"bottom-button",disabled:G,"data-cy":"retry-install-component",onClick:async()=>{N(!0),await Nn(q.current.installInput)},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[G&&e.jsx(re,{size:16,style:{marginRight:8}}),d("common.retry")]})})}})};N()},Tt=E=>N=>{var G,W;(((G=N==null?void 0:N.meta)==null?void 0:G.did)||(N==null?void 0:N.meta))===((W=B==null?void 0:B.meta)==null?void 0:W.did)&&E(N)};L(X.BlockletEvents.statusChange,Tt(E=>{switch(E.status){case X.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:ze(),subTitle:d("blocklet.component.installSuccessTip")}}),lo({componentDid:xe.componentDid});break}const N=Ot(B);H(G=>({...G,didSpaceEndpoint:N}))}),[(Ln=B==null?void 0:B.meta)==null?void 0:Ln.did]),L(X.BlockletEvents.downloadFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(On=B==null?void 0:B.meta)==null?void 0:On.did]),L(X.BlockletEvents.installFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Mn=B==null?void 0:B.meta)==null?void 0:Mn.did]);const pe=[],wt=()=>{x(!1),ke({}),q.current={},t()},Xe=E=>((B==null?void 0:B.children)||[]).some(N=>N.meta.did===E),Nn=async E=>{var Be,Ne;const{pathPrefix:N,bundleDid:G,title:W,componentName:Re="",componentDid:De=""}=P,Ee=((Be=q.current)==null?void 0:Be.meta)||{},{configs:ye=[],registryUrl:je,inStore:qe,inputUrl:_e,dist:It}=Ee,We=(Ne=q.current)==null?void 0:Ne.downloadTokenList,le=qe?Hn(je,G,It):_e;x(!0);const tt={rootDid:B.meta.did,url:le,mountPoint:N?ue(N):`/${ue(Ee.title||Ee.name)}`,title:W,name:Re,did:De,onlyRequired:!se,...P.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:P.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await U.installComponent({input:tt}),je){const{teamDid:he,storeList:Ae}=ho({fromBlocklet:k,nodeInfo:M,blocklet:B}),{isNew:kt,decoded:nt}=ds(je,Ae);kt&&await U.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),V({showError:!1,attachRuntimeInfo:!1})}catch(he){const Ae=Z(he);A.error(Ae),console.error("installComponent error: ",he),Ue(Ae)}finally{x(!1),q.current.installInput=tt}},An=E=>({errMsg:vo({params:{...E,did:E.bundleDid},blocklets:[B],blocklet:B,locale:b})}),fe=async E=>{var G,W;const{errMsg:N}=An({...P,locale:b});j(N),me===pe.length-2&&await Nn(E),(W=(G=w.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,Re=>Re+1)},Ve=()=>{var E,N;(N=(E=w.current)==null?void 0:E.setActiveStepByIndex)==null||N.call(E,G=>G-1)},Lo=()=>{const{pathPrefix:E,bundleDid:N,title:G,componentName:W="",componentDid:Re=""}=P,{meta:De={}}=q.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:qe}=De,_e=ye?Hn(Ee,N,qe):je;Ie({meta:De,installOpts:{type:"component",rootDid:B.meta.did,mountPoint:E,url:_e,title:G,name:W,did:Re}})},Oo=E=>{de(!1),H({purchaseResultProps:{variant:"error",title:ze(),subTitle:E,style:{paddingTop:120},footer:e.jsx(ne,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{H({purchaseResultProps:{}})},children:d("common.retry")})}})},Mo=({downloadTokenList:E})=>{q.current.downloadTokenList=E,de(!1),fe()},Pt=({chooseParams:E=q.current,componentDid:N,isInit:G=!1})=>{var nt,zn,Vn,qn;const{meta:W,registryUrl:Re,inStore:De,inputUrl:Ee}=E,{did:ye,title:je,name:qe}=W,_e=(((nt=B.settings)==null?void 0:nt.children)||[]).filter(ce=>ce.status==="deleted"&&ce.meta.bundleDid===ye),It=N||"",We=(zn=W.environments)==null?void 0:zn.map(ce=>{const{name:Ut,validation:ot,...st}=ce,Dt={validation:ls(ot)?"":ot};return{...st,key:Ut,...Dt}});q.current={...E,meta:{...W,configs:We,registryUrl:Re,inStore:De,inputUrl:Ee}};let le={};if(G){const ce=[B],Ut=We||[],ot=[],st=jo(cs([...Ut,...ot]),"key").filter(Le=>!!Le.key).sort((Le,rt)=>Le.required&&!rt.required?-1:rt.required&&!Le.required?1:0),Dt=O.getSharedConfigObj(ce[0],{configs:st}),Bt={},_n=st.map(Le=>{const{default:rt,key:it,...Go}=Le;return Bt[it]=Dt[it]||rt,{...Go,key:it,hidden:!!X.BLOCKLET_CONFIGURABLE_KEY[it]}});le={...le,configsList:_n,configsValue:Bt,hasMissRequiredConfigs:ao(_n,Bt)}}const tt=B.children.some(ce=>ce.mountPoint==="/"),Be=_e.find(ce=>ce.meta.bundleDid===ye),Ne=B.children.find(ce=>ce.meta.bundleDid===ye);le.title=je||"",Be?le={...le,pathPrefix:Be.mountPoint||"",componentName:Be.meta.name,hasEnvironmentsStep:!1}:Ne?le={...le,pathPrefix:Ne.mountPoint||"",componentName:Ne.meta.name,hasEnvironmentsStep:!1}:le={...le,pathPrefix:tt?`/${ue(je)||ue(qe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((qn=(Vn=q.current.meta)==null?void 0:Vn.environments)==null?void 0:qn.length)>0};const he=si(q.current.meta),Ae=ri(q.current.meta),kt=Ot(B);H({bundleDid:ye,componentDid:It,...le,hasRequiredEnvironments:ii(q.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Ae,didSpaceEndpoint:kt}),G&&he&&Lo()};f.useEffect(()=>{!l||me!==0||!B||(Pt({chooseParams:{blocklets:[l],meta:l,registryUrl:u||l.homepage,inStore:!0},isInit:!0}),H({showFromUrlDialog:!1}),fe())},[l,me,B]),pe.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:e.jsxs(Te,{sx:{width:400},component:"div",children:[g&&P.showFromUrlDialog&&e.jsx(dr,{mode:"component",onCancel:()=>{H({showFromUrlDialog:!1})},onSuccess:({meta:E,inputUrl:N,inStore:G,registryUrl:W})=>{Pt({chooseParams:{meta:E,inputUrl:N,inStore:G,registryUrl:W},isInit:!0}),H({showFromUrlDialog:!1}),fe()},handleText:{title:d("blocklet.component.addComponentTip.fromUrl"),confirm:d("blocklet.component.choose")}}),e.jsx(hn,{stores:s,extra:To.isInServerlessMode(M)?null:g?e.jsxs(ne,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{H({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Qt,{style:{fontSize:20,marginRight:4}})," ",d("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:C,onChange:()=>{ke({}),q.current={}},storageKey:i,children:({currentRegistry:E})=>e.jsx(yn,{showResourcesSwitch:h,showCategory:S,serverVersion:M==null?void 0:M.version,style:oe?{height:"calc(100vh - 56px - 80px - 32px - 40px )"}:{height:"calc(100% - 40px)"},storeUrl:E.url,resourceType:a,resourceDid:n,handleButtonClick:N=>{Pt({chooseParams:{...N,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:N,defaultRender:G})=>{const W=(P==null?void 0:P.bundleDid)&&(P==null?void 0:P.bundleDid)===(N==null?void 0:N.did);return e.jsxs(ci,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(fo,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:ai({params:P,blocklet:B,t:d}),onCancel:wt,onConfirm:()=>{fe()}}),pe.push({key:"agreement",name:d("launchBlocklet.introduction"),body:e.jsxs(Te,{component:"div",className:"agreement-wrapper",children:[e.jsx(Co,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(Ps,{meta:Y,onClickNext:fe,installRelated:se,onChangeInstallRelated:Ge,handleDescEle:e.jsx("p",{children:d("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:l?void 0:d("common.pre"),confirm:d("launchBlocklet.next"),onCancel:l?wt:Ve,onConfirm:()=>{de(!1),fe()}}),Y&&P.requirePurchase&&pe.push({key:"purchase",name:e.jsxs(e.Fragment,{children:[d("common.verifyNFT"),e.jsx(ct,{})]}),body:e.jsxs(Te,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Fn=($e=_.current)==null?void 0:$e.getCurrentStep)==null?void 0:Fn.call($e))===2||te)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(P.purchaseResultProps)?Q&&e.jsx(zr,{ref:_,meta:Q.meta,mode:P.componentDid?"verify":"both",onCancel:Oo,installOpts:Q.installOpts,handlePaySuccess:Mo}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Zn,{...P.purchaseResultProps})})]}),disabled:((Gn=(et=_.current)==null?void 0:et.getCurrentStep)==null?void 0:Gn.call(et))===2||te,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof _.current.onNext=="function"&&(_.current.onNext(),de(!0))},onCancel:()=>{Ve()}}),O.hasStartEngine(Y)&&!Xe(Y.did)&&pe.push({key:"config",name:d("common.config"),error:v,body:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.config"),subTitle:d("blocklet.component.addComponentTip.config")}),e.jsx(K,{label:d("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:T||d("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:P.pathPrefix,onChange:E=>{const N=E.target.value;H({pathPrefix:N}),I(d("common.slugifyHint",{value:gt(N)}))}}),!!v&&e.jsx(dt,{severity:"error",style:{width:"100%",marginTop:8},children:v})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Ve,onConfirm:()=>{fe()}}),Y&&!Xe(Y.did)&&(P!=null&&P.hasEnvironmentsStep)&&pe.push({key:"environment",name:e.jsxs(e.Fragment,{children:[d("common.environment")," ",P.hasRequiredEnvironments&&e.jsx(ct,{})]}),disabled:!!R||(P==null?void 0:P.hasMissRequiredConfigs),body:()=>e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("common.environment"),subTitle:d("blocklet.component.addComponentTip.environment")}),e.jsx(rn,{style:{marginTop:-12,width:"100%"},schema:P.configsList,defaultValue:P.configsValue,onChange:(E,{action:N,currentItem:G,allValues:W})=>{N==="confirm"&&H({hasMissRequiredConfigs:ao(P.configsList,W),configsValue:W}),N==="edit"?c(G):["cancel","confirm"].includes(N)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Ve,onConfirm:fe}),Y&&!Xe(Y.did)&&(P!=null&&P.didSpaceIsRequiredSetup)&&pe.push({key:"didSpace",name:e.jsxs(e.Fragment,{children:[d("blocklet.component.didSpaceConfig")," ",P.didSpaceIsRequiredSetup==="required"&&e.jsx(ct,{})]}),disabled:(P==null?void 0:P.didSpaceIsRequiredSetup)&&!P.didSpaceEndpoint,body:()=>e.jsx($t,{children:e.jsxs(Te,{component:"div",children:[e.jsx(lt,{title:d("blocklet.component.didSpaceConfig"),subTitle:d("blocklet.component.didSpaceConfigTip")}),e.jsx(y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:e.jsx(fn,{blockletMeta:q.current.meta,onNext:()=>{fe()},onEndpointUpdate:be})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:Ve,onConfirm:fe}),pe.push({key:"install",name:Xe(Y==null?void 0:Y.did)?d("common.upgrade"):d("common.install"),disabled:p?!1:He(P.installResultProps),loading:p?!1:He(P.installResultProps),body:e.jsx(Te,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:He(P.installResultProps)?e.jsx(Xs,{message:e.jsx(di,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Zn,{...P.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{lo({timeout:0,componentDid:xe.componentDid,manual:!0}),wt(),setTimeout(()=>{const E=document.getElementsByClassName("dashboard-main")[0];E&&(E.scrollTop=E.scrollHeight)},200)}});const ae=pe[me]||{},Fo=()=>C||ae.error||!P.bundleDid?!0:me>1?!P.pathPrefix:!1;return B?e.jsxs(li,{sx:{width:"100%",height:oe?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx($s,{steps:pe,mode:"memory",children:e.jsx(oi,{ref:w,meta:Y,isMobile:oe,onStepChange:E=>{Ze(E)}})}),e.jsxs(y,{className:"action-bar",children:[ae.cancel&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onCancel()},disabled:me===pe.length-2&&C,color:"inherit",children:ae.cancel||d("common.cancel")}),ae.confirm&&e.jsx(ne,{onClick:E=>{E.stopPropagation(),ae.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof ae.disabled=="boolean"?ae.disabled:Fo()),variant:"contained",autoFocus:!0,title:ae.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:e.jsxs(y,{display:"flex",alignItems:"center",children:[(typeof ae.loading=="boolean"?ae.loading:C)&&e.jsx(re,{style:{marginRight:8},size:16}),ae.confirm]})})]})]}):null}jn.propTypes={onClose:r.func,mode:r.oneOf(["normal","embed"]),inDialog:r.bool,stores:r.arrayOf(r.string),storeUrl:r.string,resourceType:r.string,resourceDid:r.string,storageKey:r.string,selectedMeta:r.object,showResourcesSwitch:r.bool,showFromUrl:r.bool,enableRunBackground:r.bool,showCategory:r.bool};jn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const li=F(y)`
323
323
  .action-bar {
324
324
  display: flex;
325
325
  justify-content: flex-end;
@@ -399,7 +399,7 @@ import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J
399
399
  &.Mui-disabled {
400
400
  opacity: 0.5;
401
401
  }
402
- `;function Pn({sourceInfo:t,blocklet:o}){var a;const{t:s}=f.useContext(Ce);return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(hs,{type:"success",children:er(t.source)},"source"),t.source==="registry"&&e.jsx(yt,{href:we(t.deployedFrom,"blocklets",((a=o==null?void 0:o.meta)==null?void 0:a.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:s("blocklet.overview.viewInStore")})]})}Pn.propTypes={sourceInfo:r.shape({source:r.string,deployedFrom:r.string}),blocklet:r.object};Pn.defaultProps={sourceInfo:{},blocklet:{}};var In={},Ci=_t;Object.defineProperty(In,"__esModule",{value:!0});var Bo=In.default=void 0,ji=Ci(Vt()),vi=e;Bo=In.default=(0,ji.default)((0,vi.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Et({blocklet:t,checkUpgrade:o,hasPermission:s,...a}){const{api:n}=J(),{t:i}=f.useContext(Ce),[m,l]=f.useState(!1),[u,h]=f.useState(""),[g,p]=f.useState(null),[S,d]=f.useState(null);f.useEffect(()=>{p(null),o&&(t.mode,X.BLOCKLET_MODES.DEVELOPMENT)},[t,o]);const b=()=>{l(!1),d(null)},C=async()=>{l(!0);try{const R={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ye(2e3),await n.upgradeBlocklet({input:R})}catch(R){A.error(`Blocklet upgrade failed: ${Z(R)}`)}finally{l(!1),d(null)}},x={title:`${i("common.upgrade")} ${i("common.blocklet")} ${O.getDisplayName(t)}`,description:i("blocklet.action.upgradeDescription"),confirm:i("blocklet.action.confirmUpgrade"),cancel:i("common.cancel"),onConfirm:C,onCancel:b};return s&&g&&!O.isInProgress(t.status)?e.jsxs(e.Fragment,{children:[e.jsx(Qe,{...a,children:t.meta.version}),e.jsx(ve,{title:i("common.updateAvailable",{version:g.version}),children:e.jsx($,{size:"small",style:{marginLeft:8},disabled:m,onClick:()=>d(x),children:m?e.jsx(re,{size:16}):e.jsx(Bo,{style:{fontSize:16,color:"red"}})})}),!!u&&e.jsx(A,{variant:"error",message:u,onClose:()=>h("")}),S&&e.jsx(Fe,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):e.jsx(Qe,{...a,children:t.meta.version})}Et.propTypes={blocklet:r.object.isRequired,checkUpgrade:r.bool,hasPermission:r.bool};Et.defaultProps={checkUpgrade:!1,hasPermission:!1};const Si=Me(Et,"mutate_blocklets"),bi=Me(Et,"",Oe);function Ri(t){const{inService:o}=J();return o?e.jsx(bi,{...t}):e.jsx(Si,{...t})}const Ei=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},Ti=(t,o)=>t?[{name:o("common.name"),value:t.displayName},{name:o("common.description"),value:t.description},{name:o("common.version"),value:e.jsx(Qe,{children:t.version})}]:[],wi=t=>{const{source:o,deployedFrom:s,bundleSource:a}=t;return o?{source:o,deployedFrom:s}:a?a.url?{source:"url",deployedFrom:s||Array.isArray(a.url)?a.url[0]:a.url}:a.store?{source:"registry",deployedFrom:s||Array.isArray(a.store)?a.store[0]:a.store}:{}:{source:"upload",deployedFrom:s}},Pi=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function kn({blocklet:t,depth:o,componentInfo:s,app:a,onClose:n}){var d,b;const{t:i,locale:m}=f.useContext(Ce),{deletingBlocklets:l}=Kt();let{status:u}=t;o===1&&l.includes(t.meta.did)&&(u="deleting");const h=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),g=C=>C.map(x=>x.name===i("common.did")||x.name===i("blocklet.appId")?e.jsx(At,{valueComponent:"div",nameWidth:120,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name):e.jsx(At,{valueComponent:"div",nameWidth:120,name:x.name,children:x.value},x.name)),p=s?wi(s):{},S=s?[{name:i("common.name"),value:O.getDisplayName(s,!0)},{name:i("common.version"),value:e.jsx(Ri,{blocklet:s,checkUpgrade:!1})},{name:i("common.status"),value:e.jsx(bo,{isResource:Ei(t),status:u,source:s.source,progress:t.progress})},t.status==="running"?{name:i("blocklet.startedAt"),value:Nt(t.startedAt,m)}:null,t.status!=="running"?{name:i("blocklet.stoppedAt"),value:Nt(t.stoppedAt,m)}:null,t.installedAt?{name:i("blocklet.installedAt"),value:Nt(t.installedAt,m)}:null,O.hasStartEngine(t.meta)?{name:i("common.mountPoint"),value:h}:null,s.meta.group?{name:i("common.group"),value:e.jsx(Qe,{type:"success",children:s.meta.group})}:null,{name:i("blocklet.overview.source"),value:e.jsx(Pn,{sourceInfo:p,blocklet:t})},{name:i("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-"},{name:i("common.did"),value:e.jsx(mo,{did:s.meta.did,showQrcode:!0})},{name:i("common.author"),value:gs(s.meta.author)},{name:i("common.engine"),value:Ti(s.engine,i).map(({name:C,value:x})=>e.jsx(At,{style:{marginBottom:4},nameWidth:120,name:C,children:x},C))},(d=t.dependents)!=null&&d.length?{name:i("common.dependents"),value:e.jsx(y,{children:t.dependents.map(C=>e.jsx(y,{children:`${Pi(C.id,a)} ${C.required?`(${i("common.required")})`:""}`},C.id))})}:null,(b=t.meta.resources)!=null&&b.length?{name:i("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return s?e.jsx(xt,{open:!0,title:i("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{n(null)},children:e.jsx(y,{paddingBottom:1.5,children:g(S)},"dialog-wrapper")},"base-info-dialog"):null}kn.propTypes={blocklet:r.object.isRequired,depth:r.number,app:r.object,componentInfo:r.object,onClose:r.func.isRequired};kn.defaultProps={depth:0,app:null,componentInfo:null};F(xo)`
402
+ `;function Pn({sourceInfo:t,blocklet:o}){var a;const{t:s}=f.useContext(Ce);return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(hs,{type:"success",children:er(t.source)},"source"),t.source==="registry"&&e.jsx(yt,{href:we(t.deployedFrom,"blocklets",((a=o==null?void 0:o.meta)==null?void 0:a.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:s("blocklet.overview.viewInStore")})]})}Pn.propTypes={sourceInfo:r.shape({source:r.string,deployedFrom:r.string}),blocklet:r.object};Pn.defaultProps={sourceInfo:{},blocklet:{}};var In={},Ci=_t;Object.defineProperty(In,"__esModule",{value:!0});var Bo=In.default=void 0,ji=Ci(qt()),vi=e;Bo=In.default=(0,ji.default)((0,vi.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Et({blocklet:t,checkUpgrade:o,hasPermission:s,...a}){const{api:n}=J(),{t:i}=f.useContext(Ce),[m,l]=f.useState(!1),[u,h]=f.useState(""),[g,p]=f.useState(null),[S,d]=f.useState(null);f.useEffect(()=>{p(null),o&&(t.mode,X.BLOCKLET_MODES.DEVELOPMENT)},[t,o]);const b=()=>{l(!1),d(null)},C=async()=>{l(!0);try{const R={did:t.meta.did,version:g.version,storeUrl:g.registryUrl||""};await Ye(2e3),await n.upgradeBlocklet({input:R})}catch(R){A.error(`Blocklet upgrade failed: ${Z(R)}`)}finally{l(!1),d(null)}},x={title:`${i("common.upgrade")} ${i("common.blocklet")} ${O.getDisplayName(t)}`,description:i("blocklet.action.upgradeDescription"),confirm:i("blocklet.action.confirmUpgrade"),cancel:i("common.cancel"),onConfirm:C,onCancel:b};return s&&g&&!O.isInProgress(t.status)?e.jsxs(e.Fragment,{children:[e.jsx(Qe,{...a,children:t.meta.version}),e.jsx(ve,{title:i("common.updateAvailable",{version:g.version}),children:e.jsx($,{size:"small",style:{marginLeft:8},disabled:m,onClick:()=>d(x),children:m?e.jsx(re,{size:16}):e.jsx(Bo,{style:{fontSize:16,color:"red"}})})}),!!u&&e.jsx(A,{variant:"error",message:u,onClose:()=>h("")}),S&&e.jsx(Fe,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):e.jsx(Qe,{...a,children:t.meta.version})}Et.propTypes={blocklet:r.object.isRequired,checkUpgrade:r.bool,hasPermission:r.bool};Et.defaultProps={checkUpgrade:!1,hasPermission:!1};const Si=Me(Et,"mutate_blocklets"),bi=Me(Et,"",Oe);function Ri(t){const{inService:o}=J();return o?e.jsx(bi,{...t}):e.jsx(Si,{...t})}const Ei=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},Ti=(t,o)=>t?[{name:o("common.name"),value:t.displayName},{name:o("common.description"),value:t.description},{name:o("common.version"),value:e.jsx(Qe,{children:t.version})}]:[],wi=t=>{const{source:o,deployedFrom:s,bundleSource:a}=t;return o?{source:o,deployedFrom:s}:a?a.url?{source:"url",deployedFrom:s||Array.isArray(a.url)?a.url[0]:a.url}:a.store?{source:"registry",deployedFrom:s||Array.isArray(a.store)?a.store[0]:a.store}:{}:{source:"upload",deployedFrom:s}},Pi=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function kn({blocklet:t,depth:o,componentInfo:s,app:a,onClose:n}){var d,b;const{t:i,locale:m}=f.useContext(Ce),{deletingBlocklets:l}=Kt();let{status:u}=t;o===1&&l.includes(t.meta.did)&&(u="deleting");const h=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),g=C=>C.map(x=>x.name===i("common.did")||x.name===i("blocklet.appId")?e.jsx(At,{valueComponent:"div",nameWidth:120,name:x.name,nameFormatter:()=>x.name,children:x.value},x.name):e.jsx(At,{valueComponent:"div",nameWidth:120,name:x.name,children:x.value},x.name)),p=s?wi(s):{},S=s?[{name:i("common.name"),value:O.getDisplayName(s,!0)},{name:i("common.version"),value:e.jsx(Ri,{blocklet:s,checkUpgrade:!1})},{name:i("common.status"),value:e.jsx(bo,{isResource:Ei(t),status:u,source:s.source,progress:t.progress})},t.status==="running"?{name:i("blocklet.startedAt"),value:Nt(t.startedAt,m)}:null,t.status!=="running"?{name:i("blocklet.stoppedAt"),value:Nt(t.stoppedAt,m)}:null,t.installedAt?{name:i("blocklet.installedAt"),value:Nt(t.installedAt,m)}:null,O.hasStartEngine(t.meta)?{name:i("common.mountPoint"),value:h}:null,s.meta.group?{name:i("common.group"),value:e.jsx(Qe,{type:"success",children:s.meta.group})}:null,{name:i("blocklet.overview.source"),value:e.jsx(Pn,{sourceInfo:p,blocklet:t})},{name:i("blocklet.overview.deployedFrom"),value:p.deployedFrom||"-"},{name:i("common.did"),value:e.jsx(mo,{did:s.meta.did,showQrcode:!0})},{name:i("common.author"),value:gs(s.meta.author)},{name:i("common.engine"),value:Ti(s.engine,i).map(({name:C,value:x})=>e.jsx(At,{style:{marginBottom:4},nameWidth:120,name:C,children:x},C))},(d=t.dependents)!=null&&d.length?{name:i("common.dependents"),value:e.jsx(y,{children:t.dependents.map(C=>e.jsx(y,{children:`${Pi(C.id,a)} ${C.required?`(${i("common.required")})`:""}`},C.id))})}:null,(b=t.meta.resources)!=null&&b.length?{name:i("common.resource"),value:t.meta.resources.join(", ")}:null].filter(Boolean):[];return s?e.jsx(xt,{open:!0,title:i("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{n(null)},children:e.jsx(y,{paddingBottom:1.5,children:g(S)},"dialog-wrapper")},"base-info-dialog"):null}kn.propTypes={blocklet:r.object.isRequired,depth:r.number,app:r.object,componentInfo:r.object,onClose:r.func.isRequired};kn.defaultProps={depth:0,app:null,componentInfo:null};F(xo)`
403
403
  .BaseBadge-badge {
404
404
  top: ${t=>t.top*8||6}px;
405
405
  right: ${t=>t.right*8||6}px;
@@ -421,7 +421,7 @@ import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J
421
421
  margin-left: 4px;
422
422
  transform: translateY(-1px);
423
423
  }
424
- `;function No({blocklet:t,ancestors:o,mountPoint:s,href:a}){const[n,i]=f.useState(!1),[m,l]=f.useState(!1),[u,h]=f.useState(!1),[g,p]=f.useState(s),{api:S}=J(),d=!o.length,b=d?t.meta.did:o.map(c=>c.meta.did)[0];f.useEffect(()=>{l(!1),i(!1),h(!1)},[s]);const C=()=>{i(!1),l(!1),p(s)},x=async c=>{c.preventDefault(),h(!0),i(!1);try{const v={rootDid:b,mountPoint:ue(g)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw h(!1),v.message=Z(v),A.error(v.message),v}},R=m?e.jsxs(y,{sx:{ml:1},children:[e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"data-cy":"edit-mount-point-submit",onClick:x,children:e.jsx(y,{component:Pe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:C,children:e.jsx(y,{component:Pe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>l(!0),children:e.jsx(y,{component:Pe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:n?1:0,color:"primary.main",transition:"0.3s opacity"}})});return e.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[m?e.jsx("form",{onSubmit:x,children:e.jsx(K,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:c=>p(c.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:s})}):e.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:xs(s)})}),u?e.jsx(re,{size:20,sx:{ml:1}}):R]},s)}No.propTypes={mountPoint:r.string.isRequired,href:r.string.isRequired,blocklet:r.object.isRequired,ancestors:r.array.isRequired};const Ii=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},co=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function ht({blocklet:t,ancestors:o,depth:s,onRemove:a,onStart:n,onStop:i,onRestart:m,getComponentUrl:l,app:u}){var q,Q,Ie;const{t:h}=f.useContext(Ce),[g,p]=f.useState(),[S,d]=f.useState(!1),[b,C]=f.useState(!1),[x,R]=f.useState(null),[c,v]=f.useState(!1),{deletingBlocklets:j}=Kt();let{status:T}=t;s===1&&j.includes(t.meta.did)&&(T="deleting");const I=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),U=l(I),L=O.isInProgress(u.status),k=O.isInProgress(t.status);let M="";if(L||k||s===1&&j.includes(t.meta.did))M=h("blocklet.component.tip.stopBlocklet");else if((q=t.dependents)!=null&&q.length){const te=t.dependents.filter(de=>de.required);if(te.length){const de=te.map(Se=>co(Se.id,u));M=h("blocklet.component.tip.requiredBy",{name:de.join(", ")})}}const B=async(...te)=>{C(!0);try{await a(...te)}catch{}C(!1),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(Un,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(vr,{blocklet:t,ancestors:o}),e.jsxs(y,{ml:"16px",children:[e.jsxs(y,{className:"component-header",onClick:()=>p(t),children:[e.jsx(y,{className:"component-name",children:O.getDisplayName(t,!0)}),e.jsx(y,{className:"component-version",children:(Q=t==null?void 0:t.meta)==null?void 0:Q.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[T!=="unknown"&&e.jsx(bo,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(pr,{style:{marginLeft:4},mode:t.mode||""}),!!((Ie=t.dependents)!=null&&Ie.length)&&e.jsx(ve,{title:[`${h("common.dependents")}: `,t.dependents.map(te=>e.jsx(y,{pl:1,children:`${co(te.id,u)} ${te.required?`(${h("common.required")})`:""}`},te.id))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]})]})]},t),Ft.hasMountPoint(t.meta)&&e.jsx(No,{blocklet:t,ancestors:o,mountPoint:I,href:U},I),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[O.hasStartEngine(t.meta)&&e.jsx(ve,{title:h("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:U,rel:"noopener noreferrer",children:e.jsx($,{size:"small",children:e.jsx(So,{})})})}),e.jsx(wn,{blocklet:u,component:t,onStart:n,onStop:i,disabled:!["starting","stopping"].includes(u.status)&&O.isInProgress(u.status)}),e.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(Ro,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||Ii(t)?{icon:e.jsx(Cr,{}),text:h("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(Ns,{}),text:h("common.restart"),onClick:()=>{R({title:`${h("common.restart")} ${t.meta.title}`,description:h("blocklet.action.restartDescription"),confirm:h("blocklet.action.confirmRestart"),cancel:h("common.cancel"),onConfirm:async()=>{C(!0),await m(t),C(!1)},onCancel:()=>R(null)})},disabled:b||L||k||t.status!=="running"},{icon:e.jsx(Ct,{}),text:h("common.delete"),onClick:()=>{d(!0)},disabled:L||k||!!M,tip:M},{separator:!0},{icon:e.jsx(Yt,{}),onClick:()=>{v(!0)},text:e.jsx(qt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(y,{sx:{width:"100%"},children:h("common.config")})}),disabled:L||k}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Jt,{},"line"),e.jsx(kn,{componentInfo:g,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(Tn,{blocklet:u,component:t,remove:B,onCancel:()=>d(!1),hideBtn:!0,showConfirm:S},"delete-component"),x&&e.jsx(Fe,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel},"confirm-setting"),c&&e.jsx(vt,{open:!0,hiddenChildren:!0,onClose:()=>v(!1),blocklet:t,ancestors:o})]})}ht.propTypes={blocklet:r.object.isRequired,ancestors:r.array,depth:r.number,onRemove:r.func,onStart:r.func,onStop:r.func,onRestart:r.func,getComponentUrl:r.func,app:r.object};ht.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const qt=F(xo)`
424
+ `;function No({blocklet:t,ancestors:o,mountPoint:s,href:a}){const[n,i]=f.useState(!1),[m,l]=f.useState(!1),[u,h]=f.useState(!1),[g,p]=f.useState(s),{api:S}=J(),d=!o.length,b=d?t.meta.did:o.map(c=>c.meta.did)[0];f.useEffect(()=>{l(!1),i(!1),h(!1)},[s]);const C=()=>{i(!1),l(!1),p(s)},x=async c=>{c.preventDefault(),h(!0),i(!1);try{const v={rootDid:b,mountPoint:ue(g)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw h(!1),v.message=Z(v),A.error(v.message),v}},R=m?e.jsxs(y,{sx:{ml:1},children:[e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"data-cy":"edit-mount-point-submit",onClick:x,children:e.jsx(y,{component:Pe,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:C,children:e.jsx(y,{component:Pe,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):e.jsx($,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>l(!0),children:e.jsx(y,{component:Pe,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:n?1:0,color:"primary.main",transition:"0.3s opacity"}})});return e.jsxs(y,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[m?e.jsx("form",{onSubmit:x,children:e.jsx(K,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:g,onChange:c=>p(c.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:s})}):e.jsx(y,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:xs(s)})}),u?e.jsx(re,{size:20,sx:{ml:1}}):R]},s)}No.propTypes={mountPoint:r.string.isRequired,href:r.string.isRequired,blocklet:r.object.isRequired,ancestors:r.array.isRequired};const Ii=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},co=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const i=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&i.push(m.meta.title)}return i.join(" / ")};function ht({blocklet:t,ancestors:o,depth:s,onRemove:a,onStart:n,onStop:i,onRestart:m,getComponentUrl:l,app:u}){var V,Q,Ie;const{t:h}=f.useContext(Ce),[g,p]=f.useState(),[S,d]=f.useState(!1),[b,C]=f.useState(!1),[x,R]=f.useState(null),[c,v]=f.useState(!1),{deletingBlocklets:j}=Kt();let{status:T}=t;s===1&&j.includes(t.meta.did)&&(T="deleting");const I=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),U=l(I),L=O.isInProgress(u.status),k=O.isInProgress(t.status);let M="";if(L||k||s===1&&j.includes(t.meta.did))M=h("blocklet.component.tip.stopBlocklet");else if((V=t.dependents)!=null&&V.length){const te=t.dependents.filter(de=>de.required);if(te.length){const de=te.map(Se=>co(Se.id,u));M=h("blocklet.component.tip.requiredBy",{name:de.join(", ")})}}const B=async(...te)=>{C(!0);try{await a(...te)}catch{}C(!1),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(Un,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(vr,{blocklet:t,ancestors:o}),e.jsxs(y,{ml:"16px",children:[e.jsxs(y,{className:"component-header",onClick:()=>p(t),children:[e.jsx(y,{className:"component-name",children:O.getDisplayName(t,!0)}),e.jsx(y,{className:"component-version",children:(Q=t==null?void 0:t.meta)==null?void 0:Q.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[T!=="unknown"&&e.jsx(bo,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(pr,{style:{marginLeft:4},mode:t.mode||""}),!!((Ie=t.dependents)!=null&&Ie.length)&&e.jsx(ve,{title:[`${h("common.dependents")}: `,t.dependents.map(te=>e.jsx(y,{pl:1,children:`${co(te.id,u)} ${te.required?`(${h("common.required")})`:""}`},te.id))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]})]})]},t),Ft.hasMountPoint(t.meta)&&e.jsx(No,{blocklet:t,ancestors:o,mountPoint:I,href:U},I),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[O.hasStartEngine(t.meta)&&e.jsx(ve,{title:h("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:U,rel:"noopener noreferrer",children:e.jsx($,{size:"small",children:e.jsx(So,{})})})}),e.jsx(wn,{blocklet:u,component:t,onStart:n,onStop:i,disabled:!["starting","stopping"].includes(u.status)&&O.isInProgress(u.status)}),e.jsx(Vt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(Ro,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||Ii(t)?{icon:e.jsx(Cr,{}),text:h("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(Ns,{}),text:h("common.restart"),onClick:()=>{R({title:`${h("common.restart")} ${t.meta.title}`,description:h("blocklet.action.restartDescription"),confirm:h("blocklet.action.confirmRestart"),cancel:h("common.cancel"),onConfirm:async()=>{C(!0),await m(t),C(!1)},onCancel:()=>R(null)})},disabled:b||L||k||t.status!=="running"},{icon:e.jsx(Ct,{}),text:h("common.delete"),onClick:()=>{d(!0)},disabled:L||k||!!M,tip:M},{separator:!0},{icon:e.jsx(Yt,{}),onClick:()=>{v(!0)},text:e.jsx(Vt,{color:"error",badgeContent:"",variant:"dot",invisible:!O.getComponentMissingConfigs(t,o[0]).length,children:e.jsx(y,{sx:{width:"100%"},children:h("common.config")})}),disabled:L||k}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Jt,{},"line"),e.jsx(kn,{componentInfo:g,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(Tn,{blocklet:u,component:t,remove:B,onCancel:()=>d(!1),hideBtn:!0,showConfirm:S},"delete-component"),x&&e.jsx(Fe,{title:x.title,description:x.description,confirm:x.confirm,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel},"confirm-setting"),c&&e.jsx(vt,{open:!0,hiddenChildren:!0,onClose:()=>v(!1),blocklet:t,ancestors:o})]})}ht.propTypes={blocklet:r.object.isRequired,ancestors:r.array,depth:r.number,onRemove:r.func,onStart:r.func,onStop:r.func,onRestart:r.func,getComponentUrl:r.func,app:r.object};ht.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const Vt=F(xo)`
425
425
  .BaseBadge-badge {
426
426
  top: ${t=>t.top*8||6}px;
427
427
  right: ${t=>t.right*8||6}px;
@@ -489,7 +489,7 @@ import{bM as zo,j as e,aK as Vt,aL as _t,q as z,O as y,ax as ve,P as r,A,bn as J
489
489
  margin-left: 4px;
490
490
  transform: translateY(-1px);
491
491
  }
492
- `;function Bn({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var V;const{t:n}=f.useContext(Ce),{api:i,inService:m,info:l}=J(),{addDeletingDid:u,removeDeletingDid:h,matchDeletingDid:g}=Kt(),[p,S]=f.useState(!1),[d,b]=f.useState(null),[C,x]=f.useState(null),[R,c]=f.useState(!1),[v,j]=f.useState(!1),[T,I]=f.useState(!1),[U,L]=f.useState(null),k=t&&t.structVersion!==D.APP_STRUCT_VERSION,[M,B]=f.useState(!1),q=[...t.children];t.meta.group!=="gateway"&&q.unshift(t),g(q.map(w=>w.meta.did));const Q=async()=>{if(!p){S(!0);try{const{updateId:w,updateList:_}=(await i.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!w){A.info(n("blocklet.component.noUpdate"));return}const oe=[];O.forEachChildSync(t,(se,{id:Ge,ancestors:Y})=>{const H=_.find(be=>be.id===Ge);if(H){const be=Y.slice(1).concat(se).map(Ue=>Ue.meta.title||Ue.meta.name).join(" / "),ze=(Y[1]||se).meta.did;oe.push({groupId:ze,name:be,version:se.meta.version,newVersion:H.meta.version})}});const xe={};oe.forEach(se=>{xe[se.groupId]?se.disabled=!0:xe[se.groupId]=!0}),b({params:{updateId:w},list:oe,checks:xe,hasChecks:!0})}catch(w){S(!1),A.error(Z(w))}}},Ie=async()=>{if(!p)try{S(!0);const w=Object.keys(d.checks).filter(oe=>d.checks[oe]),_={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:w};await i.upgradeComponents({input:_}),S(!1),b(null),B(null)}catch(w){S(!1),A.error(Z(w))}},te=async(w,_)=>{u(w.meta.did);try{await i.deleteComponent({input:{did:w.meta.did,keepData:_==="keepData",rootDid:t.meta.did}}),await Ye(800)}catch(oe){A.error(Z(oe)),h(w.meta.did)}},de=async w=>{try{await i.startBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},Se=async w=>{try{await i.stopBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},P=async w=>{try{await i.restartBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},ke=(w,_)=>{const{checked:oe}=w.target;b(xe=>{const se=Object.entries(xe.checks).reduce((Y,[H,be])=>(Y[H]=_===H?oe:be,Y),{}),Ge=Object.values(se).includes(!0);return{...xe,checks:se,hasChecks:Ge}})};Cs(Q);const me=gi({blocklet:t,scrollToComponent:!0}),Ze=U||me;return e.jsxs(Ui,{component:"div",...a,children:[e.jsxs(Di,{display:"flex",children:[e.jsxs(Bi,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[q!=null&&q.length?`${n("common.components")} (${q.length})`:`${n("common.components")}`,!k&&e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsx(Xt,{children:e.jsx(qt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!M,children:e.jsxs(ne,{disabled:p||O.isInProgress(t.status),color:"secondary",onClick:()=>{Q()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:p?e.jsx(re,{size:16}):e.jsx(Eo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!k&&e.jsx(vn,{blocklet:t,serverVersion:l.version,children:({open:w})=>e.jsxs(ne,{disabled:p||O.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:w,children:[e.jsx(bs,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(Ro,{"data-cy":"component-actions",actions:[{icon:e.jsx(Pe,{icon:"fluent:link-20-filled"}),onClick:()=>j(!0),text:n("router.rule.add.title"),disabled:p||O.isInProgress(t.status)},!k&&{icon:e.jsx(Yt,{}),text:`${n("blocklet.component.container")}`,onClick:()=>I(!0)}].filter(Boolean)})]})})]}),q!=null&&q.length?e.jsxs(e.Fragment,{children:[e.jsxs(y,{mt:2,children:[t.meta.group!=="gateway"&&e.jsx(ht,{blocklet:t,app:t,onRemove:te,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`0-${t.meta.did}`),t.children.map(w=>e.jsx(ht,{depth:1,blocklet:w,ancestors:[t],app:t,onRemove:te,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`1-${w.meta.did}`))]},`top-blocklet-${t.meta.did}`),(V=t.optionalComponents)==null?void 0:V.map(w=>e.jsx(Un,{children:e.jsx(Dn,{setInstallComponentMeta:L,...w})},w.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(ks,{children:n("blocklet.component.noComponent")})}),!!t.site.rules.length&&e.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:e.jsx(hi,{})}),!!d&&e.jsx(Yn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("blocklet.component.updateTitle")}),e.jsx(y,{component:Kn,py:4,children:d.list.map(w=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(js,{checked:d.checks[w.groupId],onChange:_=>ke(_,w.groupId),style:{marginLeft:w.disabled?16:0},defaultChecked:!0,disabled:w.disabled}),e.jsxs(y,{flexGrow:1,mt:3,children:[e.jsx(y,{item:!0,xs:8,children:w.name}),w.version&&e.jsxs(at,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(at,{item:!0,xs:3,children:w.version}),e.jsx(at,{item:!0,xs:1,children:e.jsx(Is,{style:{fontSize:"0.9em"}})}),e.jsx(at,{item:!0,xs:3,children:e.jsx(y,{color:"secondary.main",children:w.newVersion})})]})]},`${w.name}-${w.newVersion}`)]},w.name))}),e.jsxs(vs,{style:{padding:"8px 24px 24px"},children:[e.jsx(ne,{onClick:()=>{b(null)},children:n("common.cancel")}),e.jsxs(ne,{onClick:w=>{w.stopPropagation(),Ie()},color:"primary",disabled:p||!d.hasChecks,variant:"contained",autoFocus:!0,children:[p&&e.jsx(re,{size:16}),n("common.update")]})]})]})}),!!C&&e.jsx(Yn,{open:!0,fullWidth:!0,onClose:()=>x(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("common.configuration")}),e.jsx(Kn,{children:e.jsx(y,{py:2,children:e.jsx(zt,{control:e.jsx(Sr,{checked:R,onChange:w=>c(!!w.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(St,{selectedMeta:Ze,blocklet:t,showDialog:!!Ze,setShowDialog:()=>L(null)}),v&&e.jsx(Sn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(vt,{open:!0,onClose:()=>I(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}Bn.propTypes={blocklet:r.object.isRequired,onUpdate:r.func,getComponentUrl:r.func};Bn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Ui=F.div`
492
+ `;function Bn({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var q;const{t:n}=f.useContext(Ce),{api:i,inService:m,info:l}=J(),{addDeletingDid:u,removeDeletingDid:h,matchDeletingDid:g}=Kt(),[p,S]=f.useState(!1),[d,b]=f.useState(null),[C,x]=f.useState(null),[R,c]=f.useState(!1),[v,j]=f.useState(!1),[T,I]=f.useState(!1),[U,L]=f.useState(null),k=t&&t.structVersion!==D.APP_STRUCT_VERSION,[M,B]=f.useState(!1),V=[...t.children];t.meta.group!=="gateway"&&V.unshift(t),g(V.map(w=>w.meta.did));const Q=async()=>{if(!p){S(!0);try{const{updateId:w,updateList:_}=(await i.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!w){A.info(n("blocklet.component.noUpdate"));return}const oe=[];O.forEachChildSync(t,(se,{id:Ge,ancestors:Y})=>{const H=_.find(be=>be.id===Ge);if(H){const be=Y.slice(1).concat(se).map(Ue=>Ue.meta.title||Ue.meta.name).join(" / "),ze=(Y[1]||se).meta.did;oe.push({groupId:ze,name:be,version:se.meta.version,newVersion:H.meta.version})}});const xe={};oe.forEach(se=>{xe[se.groupId]?se.disabled=!0:xe[se.groupId]=!0}),b({params:{updateId:w},list:oe,checks:xe,hasChecks:!0})}catch(w){S(!1),A.error(Z(w))}}},Ie=async()=>{if(!p)try{S(!0);const w=Object.keys(d.checks).filter(oe=>d.checks[oe]),_={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:w};await i.upgradeComponents({input:_}),S(!1),b(null),B(null)}catch(w){S(!1),A.error(Z(w))}},te=async(w,_)=>{u(w.meta.did);try{await i.deleteComponent({input:{did:w.meta.did,keepData:_==="keepData",rootDid:t.meta.did}}),await Ye(800)}catch(oe){A.error(Z(oe)),h(w.meta.did)}},de=async w=>{try{await i.startBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},Se=async w=>{try{await i.stopBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},P=async w=>{try{await i.restartBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ye(800)}catch(_){A.error(Z(_))}},ke=(w,_)=>{const{checked:oe}=w.target;b(xe=>{const se=Object.entries(xe.checks).reduce((Y,[H,be])=>(Y[H]=_===H?oe:be,Y),{}),Ge=Object.values(se).includes(!0);return{...xe,checks:se,hasChecks:Ge}})};Cs(Q);const me=gi({blocklet:t,scrollToComponent:!0}),Ze=U||me;return e.jsxs(Ui,{component:"div",...a,children:[e.jsxs(Di,{display:"flex",children:[e.jsxs(Bi,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[V!=null&&V.length?`${n("common.components")} (${V.length})`:`${n("common.components")}`,!k&&e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsx(Xt,{children:e.jsx(Vt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!M,children:e.jsxs(ne,{disabled:p||O.isInProgress(t.status),color:"secondary",onClick:()=>{Q()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:p?e.jsx(re,{size:16}):e.jsx(Eo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Mt,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!k&&e.jsx(vn,{blocklet:t,serverVersion:l.version,children:({open:w})=>e.jsxs(ne,{disabled:p||O.isInProgress(t.status),variant:"text",color:"primary","data-cy":"add-component",className:"sm-hide-icon",onClick:w,children:[e.jsx(bs,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.component.add")]})}),e.jsx(Ro,{"data-cy":"component-actions",actions:[{icon:e.jsx(Pe,{icon:"fluent:link-20-filled"}),onClick:()=>j(!0),text:n("router.rule.add.title"),disabled:p||O.isInProgress(t.status)},!k&&{icon:e.jsx(Yt,{}),text:`${n("blocklet.component.container")}`,onClick:()=>I(!0)}].filter(Boolean)})]})})]}),V!=null&&V.length?e.jsxs(e.Fragment,{children:[e.jsxs(y,{mt:2,children:[t.meta.group!=="gateway"&&e.jsx(ht,{blocklet:t,app:t,onRemove:te,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`0-${t.meta.did}`),t.children.map(w=>e.jsx(ht,{depth:1,blocklet:w,ancestors:[t],app:t,onRemove:te,onStart:de,onStop:Se,onRestart:P,getComponentUrl:s},`1-${w.meta.did}`))]},`top-blocklet-${t.meta.did}`),(q=t.optionalComponents)==null?void 0:q.map(w=>e.jsx(Un,{children:e.jsx(Dn,{setInstallComponentMeta:L,...w})},w.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(ks,{children:n("blocklet.component.noComponent")})}),!!t.site.rules.length&&e.jsx(y,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:e.jsx(hi,{})}),!!d&&e.jsx(Yn,{open:!0,fullWidth:!0,children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("blocklet.component.updateTitle")}),e.jsx(y,{component:Kn,py:4,children:d.list.map(w=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(js,{checked:d.checks[w.groupId],onChange:_=>ke(_,w.groupId),style:{marginLeft:w.disabled?16:0},defaultChecked:!0,disabled:w.disabled}),e.jsxs(y,{flexGrow:1,mt:3,children:[e.jsx(y,{item:!0,xs:8,children:w.name}),w.version&&e.jsxs(at,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[e.jsx(at,{item:!0,xs:3,children:w.version}),e.jsx(at,{item:!0,xs:1,children:e.jsx(Is,{style:{fontSize:"0.9em"}})}),e.jsx(at,{item:!0,xs:3,children:e.jsx(y,{color:"secondary.main",children:w.newVersion})})]})]},`${w.name}-${w.newVersion}`)]},w.name))}),e.jsxs(vs,{style:{padding:"8px 24px 24px"},children:[e.jsx(ne,{onClick:()=>{b(null)},children:n("common.cancel")}),e.jsxs(ne,{onClick:w=>{w.stopPropagation(),Ie()},color:"primary",disabled:p||!d.hasChecks,variant:"contained",autoFocus:!0,children:[p&&e.jsx(re,{size:16}),n("common.update")]})]})]})}),!!C&&e.jsx(Yn,{open:!0,fullWidth:!0,onClose:()=>x(!1),children:e.jsxs(y,{paddingY:1.5,children:[e.jsx(Jn,{children:n("common.configuration")}),e.jsx(Kn,{children:e.jsx(y,{py:2,children:e.jsx(zt,{control:e.jsx(Sr,{checked:R,onChange:w=>c(!!w.target.checked)}),label:n("blocklet.component.showContainer")})})})]})}),e.jsx(St,{selectedMeta:Ze,blocklet:t,showDialog:!!Ze,setShowDialog:()=>L(null)}),v&&e.jsx(Sn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(vt,{open:!0,onClose:()=>I(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}Bn.propTypes={blocklet:r.object.isRequired,onUpdate:r.func,getComponentUrl:r.func};Bn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Ui=F.div`
493
493
  .title {
494
494
  font-size: 1.2rem;
495
495
  font-weight: bold;
@@ -0,0 +1 @@
1
+ import{cy as a,dV as be,dW as me,dX as ge,dY as Be,dL as we,dZ as ye,d_ as _e,d$ as Te,dK as $e,e0 as he,e1 as Se,e2 as Ne,e3 as He,cx as b}from"./index-DW_sEbOX.js";var Ue={};(function(t){var P=a&&a.__createBinding||(Object.create?function(e,n,i,o){o===void 0&&(o=i);var r=Object.getOwnPropertyDescriptor(n,i);(!r||("get"in r?!n.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(e,o,r)}:function(e,n,i,o){o===void 0&&(o=i),e[o]=n[i]}),D=a&&a.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),E=a&&a.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var i in e)i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)&&P(n,e,i);return D(n,e),n},s=a&&a.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.formatTxType=t.isSameDid=t.toDid=t.toAddress=t.fromBase64=t.toBase64=t.fromBase58=t.toBase58=t.toBuffer=t.toUint8Array=t.isUUID=t.UUID=t.isUint8Array=t.fromTokenToUnit=t.fromUnitToToken=t.numberToString=t.toHex=t.hexToBytes=t.bytesToHex=t.numberToHex=t.hexToNumber=t.hexToUtf8=t.utf8ToHex=t.toBN=t.isHex=t.isHexStrict=t.isBigNumber=t.isBN=t.stripHexPrefix=t.isHexPrefixed=t.numberToBN=t.rightPad=t.leftPad=t.BN=t.isBase58btc=void 0;const O=s(be),$=s(me),h=s(ge),j=s(Be),I=s(we),C=s(ye),F=s(_e),L=s(Te);t.rightPad=L.default;const M=s($e);t.leftPad=M.default;const S=s(he),w=s(Se),u=s(Ne);t.BN=u.default;const N=E(He),H="did:abt:",X=new u.default(0),U=new u.default(-1),m={encode:e=>`z${S.default.encode(e)}`,decode:e=>S.default.decode(e.slice(1))},v=e=>{if(typeof e!="string")return!1;if(e[0]==="z")try{return m.decode(e),!0}catch{return!1}return!1};t.isBase58btc=v;const G=e=>{if(typeof e=="string"||typeof e=="number"){let n=new u.default(1);const i=String(e).toLowerCase().trim(),o=i.substr(0,2)==="0x"||i.substr(0,3)==="-0x";let r=(0,t.stripHexPrefix)(i);if(r.substr(0,1)==="-"&&(r=(0,t.stripHexPrefix)(r.slice(1)),n=new u.default(-1,10)),r=r===""?"0":r,!r.match(/^-?[0-9]+$/)&&r.match(/^[0-9A-Fa-f]+$/)||r.match(/^[a-fA-F]+$/)||o===!0&&r.match(/^[0-9A-Fa-f]+$/))return new u.default(r,16).mul(n);if((r.match(/^-?[0-9]+$/)||r==="")&&o===!1)return new u.default(r,10).mul(n)}if((0,t.isBN)(e))return new u.default(e.toString(10),10);throw new Error(`[number-to-bn] while converting number ${JSON.stringify(e)} to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.`)};t.numberToBN=G;const z=e=>{if(typeof e!="string")throw new Error("[is-hex-prefixed] value must be type string");return e.slice(0,2).toLowerCase()==="0x"};t.isHexPrefixed=z;const x=e=>typeof e=="string"&&(0,t.isHexPrefixed)(e)?e.slice(2):e;t.stripHexPrefix=x;const J=e=>e instanceof u.default||e&&e.constructor&&e.constructor.name==="BN";t.isBN=J;const V=e=>e&&e.constructor&&e.constructor.name==="BigNumber";t.isBigNumber=V;const k=e=>((0,$.default)(e)||(0,h.default)(e))&&/^(-)?0x[0-9a-f]*$/i.test(e);t.isHexStrict=k;const q=e=>((0,$.default)(e)||(0,h.default)(e))&&/^(-0x|0x|0X|-0X)?[0-9a-f]*$/i.test(e);t.isHex=q;const K=(e,n=10)=>{try{if(typeof e=="number"&&e>0){const i=Number(e).toLocaleString("fullwide",{useGrouping:!1});return new u.default(i,n)}return(0,t.numberToBN)(e)}catch(i){throw new Error(`${i} Given value: "${e}"`)}};t.toBN=K;const R=e=>{e=N.encode(e);let n="";e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:\u0000)*/,""),e=e.split("").reverse().join("");for(let i=0;i<e.length;i++){const r=e.charCodeAt(i).toString(16);n+=r.length<2?`0${r}`:r}return`0x${n}`};t.utf8ToHex=R;const W=e=>{if(!(0,t.isHexStrict)(e))throw new Error(`The parameter "${e}" must be a valid HEX string.`);let n="",i=0;e=e.replace(/^0x/i,""),e=e.replace(/^(?:00)*/,""),e=e.split("").reverse().join(""),e=e.replace(/^(?:00)*/,""),e=e.split("").reverse().join("");const o=e.length;for(let r=0;r<o;r+=2)i=parseInt(e.substr(r,2),16),n+=String.fromCharCode(i);return N.decode(n)};t.hexToUtf8=W;const Y=e=>e?(0,t.toBN)(e).toNumber():0;t.hexToNumber=Y;const Z=e=>{if((0,F.default)(e)||typeof e>"u")return e;if(!isFinite(e)&&!(0,t.isHex)(e))throw new Error(`Given input "${e}" is not a number.`);const n=(0,t.toBN)(e),i=n.toString(16);return n.lt(new u.default(0))?`-0x${i.substr(1)}`:`0x${i}`};t.numberToHex=Z;const Q=e=>{const n=[];for(let i=0;i<e.length;i++)n.push((e[i]>>>4).toString(16)),n.push((e[i]&15).toString(16));return`0x${n.join("")}`};t.bytesToHex=Q;const p=e=>{if(e=e.toString(16),!(0,t.isHex)(e))throw new Error(`Given value "${e}" is not a valid hex string.`);e=e.replace(/^0x/i,""),e=e.length%2?`0${e}`:e;const n=[];for(let i=0;i<e.length;i+=2)n.push(parseInt(e.substr(i,2),16));return n};t.hexToBytes=p;const ee=(e,n=!1)=>y(e)||b.isBuffer(e)?n?"bytes":(0,t.bytesToHex)(e):(0,t.isBase58btc)(e)?n?"bytes":(0,t.bytesToHex)(m.decode(e)):(0,O.default)(e)?n?"bool":e?"0x01":"0x00":(0,j.default)(e)&&!(0,t.isBigNumber)(e)&&!(0,t.isBN)(e)?n?"string":(0,t.utf8ToHex)(JSON.stringify(e)):typeof e=="string"?e.indexOf("-0x")===0||e.indexOf("-0X")===0?n?"int256":(0,t.numberToHex)(e):e.indexOf("0x")===0||e.indexOf("0X")===0?n?"bytes":e:n?"string":(0,t.utf8ToHex)(e):n?e<0?"int256":"uint256":(0,t.numberToHex)(e);t.toHex=ee;const te=e=>{if(typeof e=="string"){if(!e.match(/^-?[0-9.]+$/))throw new Error(`Invalid value '${e}' while converting to string, should be a number matching (^-?[0-9.]+).`);return e}if(typeof e=="number")return Number.isInteger(e)&&e>0?Number(e).toLocaleString("fullwide",{useGrouping:!1}):String(e);if(typeof e=="object"&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10);throw new Error(`while converting number to string, invalid number value '${e}' type ${typeof e}.`)};t.numberToString=te;const ne=(e,n=18,i={})=>{let o=(0,t.toBN)(e);const r=o.lt(X),d=(0,t.toBN)(`1${"0".repeat(n)}`,10),g=d.toString(10).length-1||1,c=i||{};r&&(o=o.mul(U));let f=o.mod(d).toString(10);for(;f.length<g;)f=`0${f}`;c.pad||(f=f.match(/^([0-9]*[1-9]|0)(0*)/)[1]);let l=o.div(d).toString(10);c.commify&&(l=l.replace(/\B(?=(\d{3})+(?!\d))/g,","));let T=`${l}${f==="0"?"":`.${f}`}`;return r&&(T=`-${T}`),T};t.fromUnitToToken=ne;const ie=(e,n=18)=>{let i=(0,t.numberToString)(e);const o=(0,t.toBN)(`1${"0".repeat(n)}`,10),r=o.toString(10).length-1||1,d=i.substring(0,1)==="-";if(d&&(i=i.substring(1)),i===".")throw new Error(`error converting token ${e} to unit, invalid value`);const g=i.split(".");if(g.length>2)throw new Error(`error converting token ${e} to unit, too many decimal points`);let c=g[0],f=g[1];if(c||(c="0"),f||(f="0"),f.length>r)throw new Error(`error converting token ${e} to unit, too many decimal places`);for(;f.length<r;)f+="0";c=new u.default(c),f=new u.default(f);let l=c.mul(o).add(f);return d&&(l=l.mul(U)),new u.default(l.toString(10),10)};t.fromTokenToUnit=ie;function y(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}t.isUint8Array=y;function re(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}t.UUID=re;function oe(e){return/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(e)}t.isUUID=oe;function _(e){let n=null;if([null,void 0,""].includes(e))n=new Uint8Array;else if(b.isBuffer(e))n=new Uint8Array(e);else if((0,t.isHexStrict)(e))n=new Uint8Array((0,t.hexToBytes)(e));else if(y(e))n=new Uint8Array(e);else if((0,t.isBase58btc)(e))n=new Uint8Array(m.decode(e));else if(typeof e=="string")n=new Uint8Array((0,t.hexToBytes)((0,t.toHex)(e)));else throw new Error(`Unsupported input type ${typeof e} detected for toBuffer, only Uint8Array/Buffer/Hex/Base58 are supported`);return n}t.toUint8Array=_;function A(e){return b.from(_(e))}t.toBuffer=A;function fe(e){const n=m.encode(_(e));return b.from(n).toString("utf-8")}t.toBase58=fe;function ue(e){if((0,t.isBase58btc)(e)===!1)throw new Error("fromBase58 expect strict base58 encoded string as input");return b.from(m.decode(e))}t.fromBase58=ue;function se(e,n=!0){const i=w.default.encode(A(e));return n?w.default.escape(i):i}t.toBase64=se;function ce(e){if(typeof e!="string")throw new Error("fromBase64 requires input to be a string");return b.from(w.default.unescape(e),"base64")}t.fromBase64=ce;function B(e){return e.replace(H,"")}t.toAddress=B;function ae(e){return`${H}${B(e)}`}t.toDid=ae;function le(e,n){return B(e)===B(n)}t.isSameDid=le;function de(e){return(0,I.default)((0,C.default)(e))}t.formatTxType=de})(Ue);export{Ue as l};
@@ -1,4 +1,4 @@
1
- import{g as O,_ as F,P as o,s as Q,j as e,I as Y,r as p,u as q,c as X,a as P,b as R,L as J,d as K,e as Z,f as ee,h as ne,W as T,i as te,T as j,k as ae,l as b,m as g,G as v,n as V,p as se,C as re,o as L}from"./index-C7--GPHL.js";import{f as oe}from"./index-D9k2I5J1.js";import{I as E}from"./index-BEHxtswt.js";import{C as I}from"./click-to-copy-C_IAO7KR.js";import{w as ie}from"./withStyles-oAg8TXx8.js";var le=F,ce=le(function(n,i,r){return n+(r?" ":"")+i.toLowerCase()}),me=ce;const de=O(me);function w({icon:n,value:i,name:r,url:x,animated:c,LinkComponent:l,prefix:d}){const s=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"metric__image",children:e.jsx(Y,{name:n,alt:typeof r=="string"?r:"",size:30,prefix:d,color:"#222222"})}),e.jsxs("div",{children:[e.jsx("div",{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:i}}),e.jsx("div",{className:"metric__name",children:r})]})]});return e.jsx(ue,{children:x?e.jsx(l,{to:x,children:s}):s})}w.propTypes={icon:o.string.isRequired,value:o.oneOfType([o.string,o.number]).isRequired,name:o.node.isRequired,animated:o.bool,url:o.string,LinkComponent:o.any,prefix:o.string};w.defaultProps={animated:!1,url:"",LinkComponent:null,prefix:"/images"};const ue=Q("div")`
1
+ import{g as O,_ as F,P as o,s as Q,j as e,I as Y,r as p,u as q,c as X,a as P,b as R,L as J,d as K,e as Z,f as ee,h as ne,W as T,i as te,T as j,k as ae,l as b,m as g,G as v,n as V,p as se,C as re,o as L}from"./index-DW_sEbOX.js";import{f as oe}from"./index-D9k2I5J1.js";import{I as E}from"./index-DH_YItOr.js";import{C as I}from"./click-to-copy-6L_LfYIl.js";import{w as ie}from"./withStyles-D9qnQfcC.js";var le=F,ce=le(function(n,i,r){return n+(r?" ":"")+i.toLowerCase()}),me=ce;const de=O(me);function w({icon:n,value:i,name:r,url:x,animated:c,LinkComponent:l,prefix:d}){const s=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"metric__image",children:e.jsx(Y,{name:n,alt:typeof r=="string"?r:"",size:30,prefix:d,color:"#222222"})}),e.jsxs("div",{children:[e.jsx("div",{className:`metric__number ${c?"metric__number--animated":""}`,dangerouslySetInnerHTML:{__html:i}}),e.jsx("div",{className:"metric__name",children:r})]})]});return e.jsx(ue,{children:x?e.jsx(l,{to:x,children:s}):s})}w.propTypes={icon:o.string.isRequired,value:o.oneOfType([o.string,o.number]).isRequired,name:o.node.isRequired,animated:o.bool,url:o.string,LinkComponent:o.any,prefix:o.string};w.defaultProps={animated:!1,url:"",LinkComponent:null,prefix:"/images"};const ue=Q("div")`
2
2
  border-left: 1px solid ${n=>n.theme.typography.color.main};
3
3
  padding: 10px 0 10px 16px;
4
4
  @media (max-width: ${n=>n.theme.breakpoints.values.sm}px) {