@abtnode/webapp 1.16.30-beta-e7a90fb2 → 1.16.30

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 (176) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{Add-nimIss-R.js → Add-B6ZIiZST.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-SDLo8AU6.js → ArrowDropDown-CTOfLnwc.js} +1 -1
  5. package/dist/assets/{Autocomplete-mLMpcAAZ.js → Autocomplete-BRgMnZ52.js} +1 -1
  6. package/dist/assets/{Breadcrumbs-Bt0YLDiP.js → Breadcrumbs-s9U9zLgF.js} +1 -1
  7. package/dist/assets/{ButtonGroup-BIMC9S6K.js → ButtonGroup-3w5LvaA0.js} +1 -1
  8. package/dist/assets/{CheckCircle-__Xpcyhc.js → CheckCircle-DE_y9vib.js} +1 -1
  9. package/dist/assets/{ChevronLeft-DFREsjdS.js → ChevronLeft-CvWKad8W.js} +1 -1
  10. package/dist/assets/{ChevronRight-SbPIKwoC.js → ChevronRight-93HrdGCM.js} +1 -1
  11. package/dist/assets/{Close-BpEmkp97.js → Close-DzKkufzk.js} +1 -1
  12. package/dist/assets/{Delete-B-wviuP1.js → Delete-DFFe3xyW.js} +1 -1
  13. package/dist/assets/DeleteOutline-yYcRq6ni.js +1 -0
  14. package/dist/assets/{Done-DEwehpwv.js → Done-3-QQ_TOf.js} +1 -1
  15. package/dist/assets/{Edit-DK6KZi0P.js → Edit-wLc7o2cw.js} +1 -1
  16. package/dist/assets/{EditIcon-FDN14b0G.js → EditIcon-BCVTD6hP.js} +1 -1
  17. package/dist/assets/{ExpandMore-CoMbEsJD.js → ExpandMore-CFYbzpsT.js} +1 -1
  18. package/dist/assets/{FilterList-BSbt4VER.js → FilterList-FEjK2Fox.js} +1 -1
  19. package/dist/assets/{Google-DvvB9-RU.js → Google-C9I0SVEJ.js} +1 -1
  20. package/dist/assets/{Https-CHMUgx6-.js → Https-BPSFFlg6.js} +1 -1
  21. package/dist/assets/{InputAdornment-C_X3KhDA.js → InputAdornment-DT4h3g9o.js} +1 -1
  22. package/dist/assets/{InputLabel-qD-ek4kX.js → InputLabel-BOR0LpK5.js} +1 -1
  23. package/dist/assets/{LastPage-DRexSCl8.js → LastPage-BmNCoOR7.js} +1 -1
  24. package/dist/assets/{Launch-CXTnJ_ZP.js → Launch-BN3gZaS3.js} +1 -1
  25. package/dist/assets/{Link-BVKoqsek.js → Link-Dxx2K6Ua.js} +1 -1
  26. package/dist/assets/{LoadingButton-DHGZB25W.js → LoadingButton-DdNqcAhj.js} +1 -1
  27. package/dist/assets/{LockIcon-DGE39kAx.js → LockIcon-BB4v3xDA.js} +1 -1
  28. package/dist/assets/{Loop-DQi2cfGf.js → Loop-COqhNCYW.js} +1 -1
  29. package/dist/assets/{MoreHoriz-BXgBR7_l.js → MoreHoriz-IPlU_Vvy.js} +1 -1
  30. package/dist/assets/{MoreVert-xXktVXrB.js → MoreVert-C_-FQbwq.js} +1 -1
  31. package/dist/assets/{Pagination-DnPfWmf4.js → Pagination-BfGbGnHW.js} +1 -1
  32. package/dist/assets/{Public-DZG9u5nc.js → Public-CcSZDx4-.js} +1 -1
  33. package/dist/assets/{SchemaReference.es-DknvTEzi.js → SchemaReference.es-DmaLWYOX.js} +1 -1
  34. package/dist/assets/{Search-D2g_vALD.js → Search-CjX0JQkS.js} +1 -1
  35. package/dist/assets/{Select-DEE1eR0K.js → Select-C44-YCyD.js} +1 -1
  36. package/dist/assets/{Skeleton-m_lkZ6lH.js → Skeleton-4s7n7VqF.js} +1 -1
  37. package/dist/assets/{Slider-CBmIjsNj.js → Slider-C0JALcDq.js} +1 -1
  38. package/dist/assets/{Stepper-D4h3SXw3.js → Stepper-BRwbb4LL.js} +1 -1
  39. package/dist/assets/{TextField-Cml5LlcX.js → TextField-BjNW7Bjw.js} +1 -1
  40. package/dist/assets/{ToggleButtonGroup-DdMGIkJV.js → ToggleButtonGroup-DtqIWzr-.js} +1 -1
  41. package/dist/assets/{ViewList-Lg33z4FS.js → ViewList-CHj6lFwi.js} +1 -1
  42. package/dist/assets/{actions-Rsfuoore.js → actions-DGcLEhc9.js} +1 -1
  43. package/dist/assets/{actions-CCw2fiQZ.js → actions-TtrKwsqz.js} +1 -1
  44. package/dist/assets/{agreement-C2LFpgfH.js → agreement-DXIl-xR_.js} +1 -1
  45. package/dist/assets/api-Rcl-3MyM.js +1 -0
  46. package/dist/assets/{app-avatar-Z0pI74yn.js → app-avatar-BvOjNwzf.js} +1 -1
  47. package/dist/assets/{audit-logs-CGjF68d3.js → audit-logs-D4-Bez8p.js} +1 -1
  48. package/dist/assets/blocklet-d8bc_SQ4.js +1 -0
  49. package/dist/assets/{brace-fold.es-D-xxO9tk.js → brace-fold.es-B1LEOxqn.js} +1 -1
  50. package/dist/assets/{bundle-avatar-k-apmNe0.js → bundle-avatar-CW4zHZR5.js} +1 -1
  51. package/dist/assets/{chart-BHydpm-Q.js → chart-TIGkq42g.js} +1 -1
  52. package/dist/assets/{click-to-copy--CxmqZHP.js → click-to-copy-ZbSHXJko.js} +1 -1
  53. package/dist/assets/{closebrackets.es-CV5tiUGf.js → closebrackets.es-hz2Jou3O.js} +1 -1
  54. package/dist/assets/{codemirror.es-BSwJ_jke.js → codemirror.es-DRCfXk0r.js} +1 -1
  55. package/dist/assets/{comment.es-CN939E1H.js → comment.es-BmnkGJwk.js} +1 -1
  56. package/dist/assets/{config-navigation-BKucf5SM.js → config-navigation-DS08ePOc.js} +1 -1
  57. package/dist/assets/{delete-confirm-DOwYzFRf.js → delete-confirm-CGv3y6py.js} +1 -1
  58. package/dist/assets/{detail-BBO1G3ZP.js → detail-DmU03eC7.js} +3 -3
  59. package/dist/assets/{dialog.es-K7-bZIzF.js → dialog.es-CSYXNrcw.js} +1 -1
  60. package/dist/assets/{download-D88K6-GQ.js → download-CAroNPKK.js} +1 -1
  61. package/dist/assets/{foldgutter.es-DPSTEVXv.js → foldgutter.es-BSRJoBoZ.js} +1 -1
  62. package/dist/assets/getValidReactChildren-Y-QNoefA.js +1 -0
  63. package/dist/assets/{hint.es-DHTbet23.js → hint.es-DuHUgHT3.js} +1 -1
  64. package/dist/assets/{hint.es2-DaSN5I8T.js → hint.es2-CLzxOo96.js} +1 -1
  65. package/dist/assets/{iframe-DjGjc5CU.js → iframe-C3LtsJmK.js} +1 -1
  66. package/dist/assets/index-3tln4L6C.js +21 -0
  67. package/dist/assets/{index-D3GDvQdK.js → index-8azRnZez.js} +1 -1
  68. package/dist/assets/{index-TQDBcpeB.js → index-BApbAOLy.js} +1 -1
  69. package/dist/assets/{index-CF-WslF6.js → index-BN-HHDJJ.js} +1 -1
  70. package/dist/assets/{index-Daw6hKm4.js → index-BQmNmoac.js} +1 -1
  71. package/dist/assets/{index-DxgXNSd2.js → index-BZCt88Kn.js} +14 -14
  72. package/dist/assets/{index-C1KbWOak.js → index-BatYQHX2.js} +3 -3
  73. package/dist/assets/{index-wB3ekx1K.js → index-BdL0EBBo.js} +1 -1
  74. package/dist/assets/{index-Blc0lQcO.js → index-BfvNFce6.js} +1 -1
  75. package/dist/assets/{index-Co3JrBLr.js → index-BrDzj3_R.js} +1 -1
  76. package/dist/assets/{index-D3_NSRjd.js → index-C3UQMAkF.js} +1 -1
  77. package/dist/assets/{index-Dx95ER6O.js → index-C3q33eZl.js} +1 -1
  78. package/dist/assets/{index-CBTLvRHC.js → index-C4LMPu9u.js} +1 -1
  79. package/dist/assets/{index-BGI6bUJP.js → index-CJBZPdm6.js} +1 -1
  80. package/dist/assets/{index-DKrhe0Pd.js → index-CR_2MaC1.js} +1 -1
  81. package/dist/assets/{index-CE0mBRzM.js → index-CUztA_gz.js} +1 -1
  82. package/dist/assets/{index-ZTQq6T3W.js → index-CkbP6S_A.js} +1 -1
  83. package/dist/assets/{index-CAo0UcQ2.js → index-Cmy0GHU-.js} +1 -1
  84. package/dist/assets/{index-D_qCD-1x.js → index-Ctog4pYE.js} +1 -1
  85. package/dist/assets/{index-6hnZjYIo.js → index-CveYHk3t.js} +1 -1
  86. package/dist/assets/{index-BGXvULAc.js → index-D0RT0rzU.js} +1 -1
  87. package/dist/assets/{index-De9X8iTH.js → index-D53ihNsv.js} +1 -1
  88. package/dist/assets/{index-f7aL1bUo.js → index-D6q9zEjn.js} +5 -5
  89. package/dist/assets/{index-Cpw6Ga8g.js → index-DQo_Dew3.js} +1 -1
  90. package/dist/assets/{index-cqDbkK4O.js → index-DTSardYw.js} +1 -1
  91. package/dist/assets/{index-AO3oCF1x.js → index-DfTYGL67.js} +3 -3
  92. package/dist/assets/index-DnLx-UdH.js +68 -0
  93. package/dist/assets/{index-CeV4jn0N.js → index-DpVeIVbC.js} +1 -1
  94. package/dist/assets/{index-guvEPGrM.js → index-DrdqOXJL.js} +3 -3
  95. package/dist/assets/{index-DBP_eUf8.js → index-DtsnjFBd.js} +1 -1
  96. package/dist/assets/{index-C4Q4NeqR.js → index-Dy-ye0PE.js} +1 -1
  97. package/dist/assets/{index-BHdqgom8.js → index-DzlR4ROA.js} +2 -2
  98. package/dist/assets/{index-BKhW6tEi.js → index-EKqCJff8.js} +1 -1
  99. package/dist/assets/{index-o8JHOBc-.js → index-RRgjvIfT.js} +1 -1
  100. package/dist/assets/{index-mgj182ld.js → index-RrRN76hq.js} +1 -1
  101. package/dist/assets/{index-Mn9Cn8cU.js → index-UbiaSDM9.js} +1 -1
  102. package/dist/assets/{index-BsbdXNYr.js → index-aiikLstk.js} +1 -1
  103. package/dist/assets/{index-CgsfYcwc.js → index-ffNDefbl.js} +1 -1
  104. package/dist/assets/{index-DGNm6YxS.js → index-fiBRRSS-.js} +1 -1
  105. package/dist/assets/{index-BPHA36fg.js → index-po1Du4Ca.js} +1 -1
  106. package/dist/assets/{index-Dj8gJMNb.js → index-qSHb4AGp.js} +1 -1
  107. package/dist/assets/{index-ChCCjycd.js → index-sw48VBzs.js} +1 -1
  108. package/dist/assets/{index-DBjm0dlo.js → index-vCyUMIWI.js} +1 -1
  109. package/dist/assets/{index-D-FCWV-1.js → index-x2vTLzR6.js} +1 -1
  110. package/dist/assets/{index.es-39a3Nx9Z.js → index.es-C2y5LgUg.js} +1 -1
  111. package/dist/assets/{index.esm-VCHOqK12.js → index.esm-DNLYWMPY.js} +1 -1
  112. package/dist/assets/{info-addon.es-BC4uTAVC.js → info-addon.es-OU9D4WD4.js} +1 -1
  113. package/dist/assets/{info.es-BOB5BDAa.js → info.es-BYpWwfiq.js} +1 -1
  114. package/dist/assets/{install-from-url-BlpJ_JCL.js → install-from-url-BHRJMyoo.js} +1 -1
  115. package/dist/assets/{invitation-B9vV54jI.js → invitation-4BcBcG3g.js} +1 -1
  116. package/dist/assets/{is-path-prefix-equal-5RuRfdDZ.js → is-path-prefix-equal-QODAXh-c.js} +1 -1
  117. package/dist/assets/{isEqual-BMA5WXPh.js → isEqual-CFOAIOWs.js} +1 -1
  118. package/dist/assets/{item-BCjdddLT.js → item-DinHwjuB.js} +1 -1
  119. package/dist/assets/{javascript.es-CKHSRONz.js → javascript.es-BZ4hu16-.js} +1 -1
  120. package/dist/assets/{jump-to-line.es-BGiUhkkZ.js → jump-to-line.es-ds6uZCNW.js} +1 -1
  121. package/dist/assets/{jump.es-jlQKmx9y.js → jump.es-Dow2EsmT.js} +1 -1
  122. package/dist/assets/{line-BQ1AqKfx.js → line-Cpeu8572.js} +3 -3
  123. package/dist/assets/{lint.es-Ccw618G7.js → lint.es-BumMccTK.js} +1 -1
  124. package/dist/assets/{lint.es2-EOTuUPIZ.js → lint.es2-BzVHBAgd.js} +1 -1
  125. package/dist/assets/{lint.es3-DvHlvUn_.js → lint.es3-ziEStM1n.js} +1 -1
  126. package/dist/assets/{list-header-RtdpLA8N.js → list-header-5GKfEIKg.js} +1 -1
  127. package/dist/assets/{log-C240GbUG.js → log-BzeVufdm.js} +1 -1
  128. package/dist/assets/{lottie-DlriAay1.js → lottie-Dittdj4N.js} +1 -1
  129. package/dist/assets/{matchbrackets.es-C5JsbqKa.js → matchbrackets.es-DqPFoH1c.js} +1 -1
  130. package/dist/assets/{memory-DmcKHXq0.js → memory-CVFS6lDi.js} +1 -1
  131. package/dist/assets/{mode.es-mDILARJO.js → mode.es-tUbE6Sz4.js} +1 -1
  132. package/dist/assets/{mode.es2-BBLB98Wl.js → mode.es2-DOWb3-oK.js} +1 -1
  133. package/dist/assets/{mode.es3-Bp7C6PMW.js → mode.es3-BcjY2hx8.js} +1 -1
  134. package/dist/assets/{onlineParser.es-BoSRyIcT.js → onlineParser.es-BdeAPFTn.js} +1 -1
  135. package/dist/assets/{overview-_Rxbv1NB.js → overview-D7vbgmTw.js} +1 -1
  136. package/dist/assets/{react-DuJ5ZkKy.js → react-Dervdh0W.js} +3 -3
  137. package/dist/assets/{redux-B1Qumh5U.js → redux-C4Q_CSvp.js} +1 -1
  138. package/dist/assets/{resource-dialog-WWRI08PV.js → resource-dialog-Byph1CoJ.js} +1 -1
  139. package/dist/assets/{runtime-5oxnTidw.js → runtime-7TSih23R.js} +1 -1
  140. package/dist/assets/{schema-5ne-6Bp4.js → schema-Bq2ly-4o.js} +1 -1
  141. package/dist/assets/sdk-aTAcQDv-.js +1 -0
  142. package/dist/assets/{search.es-R2FORdVe.js → search.es-CMLj29wb.js} +1 -1
  143. package/dist/assets/{searchcursor.es-DO5Jf4gN.js → searchcursor.es-eHb4SABv.js} +1 -1
  144. package/dist/assets/service-FolPIcUS.js +1 -0
  145. package/dist/assets/{shorten-label-CZlXdSOl.js → shorten-label-BSQEIROA.js} +1 -1
  146. package/dist/assets/{show-hint.es-Bx2uNweg.js → show-hint.es-Bn3zEE4X.js} +1 -1
  147. package/dist/assets/{slicedToArray-Bg3ityWL.js → slicedToArray-ROu8OO6l.js} +1 -1
  148. package/dist/assets/{spaces-fC9EAj53.js → spaces-CKLphlMZ.js} +1 -1
  149. package/dist/assets/{status-BXJ91n7W.js → status-6F7XJ5dp.js} +1 -1
  150. package/dist/assets/{sublime.es-DHZMehLW.js → sublime.es-CYqGOBLs.js} +1 -1
  151. package/dist/assets/{switch-control-BuiDLx3e.js → switch-control-BxRwCbFm.js} +1 -1
  152. package/dist/assets/{table-icons-bAAAjGK1.js → table-icons-BXeoVsYd.js} +2 -2
  153. package/dist/assets/{team-QnBuJ2rq.js → team-nBwKhOsv.js} +1 -1
  154. package/dist/assets/{toUpper-CFRRtQH6.js → toUpper-BBB_TInl.js} +1 -1
  155. package/dist/assets/{traffic-CNgUOmfv.js → traffic-BgMFjNc5.js} +1 -1
  156. package/dist/assets/{url-evaluation-BTdmiGRO.js → url-evaluation-C7b_jErN.js} +1 -1
  157. package/dist/assets/{url-join-CiWL3EAW.js → url-join-LN7aIhdX.js} +1 -1
  158. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-CMsH-TzL.js → use-blocklet-info-for-connect-did-spaces-Dw7UZ6Jz.js} +1 -1
  159. package/dist/assets/{useLocalStorage-D6Ii7-Uk.js → useLocalStorage-F8gidp1W.js} +1 -1
  160. package/dist/assets/{useThemeProps-BlrL4N8K.js → useThemeProps-CRpVKi5P.js} +1 -1
  161. package/dist/assets/{util-DSMcrouF.js → util-DjDIVQpP.js} +1 -1
  162. package/dist/assets/{wait-container-BRhHYdS-.js → wait-container-fwTsXfbb.js} +1 -1
  163. package/dist/assets/{withStyles-CHrv3QJu.js → withStyles-unQnV9F2.js} +1 -1
  164. package/dist/assets/{wrap-locale-D-OFTljj.js → wrap-locale-CCm3KObK.js} +1 -1
  165. package/dist/index.html +1 -1
  166. package/dist/service-worker.js +1 -1
  167. package/package.json +1 -1
  168. package/dist/assets/DeleteOutline-DU3a7Mie.js +0 -1
  169. package/dist/assets/DeleteOutline-Dy_sSwNK.js +0 -1
  170. package/dist/assets/api-_ETsEoGC.js +0 -1
  171. package/dist/assets/blocklet-D8qZlMLE.js +0 -1
  172. package/dist/assets/getValidReactChildren-86LVJ_ka.js +0 -1
  173. package/dist/assets/index-CqrpWUFf.js +0 -21
  174. package/dist/assets/index-DUXbXc9f.js +0 -68
  175. package/dist/assets/sdk-Go6IWQIY.js +0 -1
  176. package/dist/assets/service-VyIQYaE6.js +0 -1
@@ -1,4 +1,4 @@
1
- import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E as A,r as h,f as Ce,bo as Ye,b as J,N as O,K as dt,V as Ft,cb as Oe,n as F,M as X,hA as qo,bG as Me,aY as ue,aX as gt,aC as Gt,a2 as $,D as xt,H as U,aP as Wo,Z as Je,a0 as Hn,b1 as Ho,fP as Ko,fQ as Yo,C as re,fc as Jo,z as mo,av as pt,q as we,y as zt,hB as Qo,hC as Zo,B as ne,ai as fo,J as Ht,hD as Xo,m as ee,a3 as $o,ez as es,W as ho,$ as go,ak as ts,x as ns,R as He,X as os,hE as xo,U as ge,az as ss,aA as is,aB as rs,i as yt,aN as as,cw as ls,bg as cs,hb as ds,hF as ps,ay as Kn,cu as us,ac as Fe,aJ as yo,bI as Kt,cd as ms,hG as fs,b7 as hs,A as gs,aZ as _t,T as xs,aQ as Ke,at as Nt,bp as Co,aF as ys,fM as Pe,dM as Cs,hH as js,gm as Yn,hI as Jn,go as Qn,a_ as vs,G as at,gq as Ss,bH as Rs}from"./index-BHdqgom8.js";import{d as bs}from"./Add-nimIss-R.js";import{a as Es,R as ct,F as Ts,L as ws,d as Yt,b as Jt}from"./line-BQ1AqKfx.js";import{C as Ps,A as Is,d as ks}from"./agreement-C2LFpgfH.js";import{E as Us}from"./index-BPHA36fg.js";import{b as Ds,a as Bs,c as Ns,u as Qt,e as As}from"./actions-Rsfuoore.js";import{S as Ls}from"./switch-control-BuiDLx3e.js";import{u as oe}from"./blocklet-D8qZlMLE.js";import{d as jo}from"./Edit-DK6KZi0P.js";import{T as Os}from"./index-CAo0UcQ2.js";import{T as Ms,M as Fs,t as Gs}from"./table-icons-bAAAjGK1.js";import{C as Zn}from"./click-to-copy--CxmqZHP.js";import{T as Q}from"./TextField-Cml5LlcX.js";import{d as Zt}from"./Link-BVKoqsek.js";import{c as zs,C as _s,a as Vs,b as qs,D as Ws,A as Hs,B as Ks,d as Ys,S as Js}from"./item-BCjdddLT.js";import{u as Qs,a as Zs,P as vo,L as Xn,A as Xs,S as $s}from"./index-mgj182ld.js";import{u as So,t as ei}from"./toUpper-CFRRtQH6.js";import{a as ti,b as ni,c as oi,d as si,e as ii,g as $n,f as ri,i as eo}from"./spaces-fC9EAj53.js";import{d as ai}from"./EditIcon-FDN14b0G.js";import{d as li}from"./Done-DEwehpwv.js";import{C as ci}from"./Google-DvvB9-RU.js";import{I as di,a as pi,f as ui,B as mi}from"./install-from-url-BlpJ_JCL.js";import{a as to}from"./api-_ETsEoGC.js";import{v as Ro,a as ut,b as fi}from"./util-DSMcrouF.js";import{P as hi,u as gi}from"./use-blocklet-info-for-connect-did-spaces-CMsH-TzL.js";import{D as xi}from"./DeleteOutline-DU3a7Mie.js";import{S as no}from"./index-o8JHOBc-.js";import{d as yi}from"./ArrowDropDown-SDLo8AU6.js";import{_ as Ci}from"./useLocalStorage-D6Ii7-Uk.js";import{d as ji}from"./LockIcon-DGE39kAx.js";import{d as Ct}from"./Delete-B-wviuP1.js";import{d as bo}from"./Launch-CXTnJ_ZP.js";import{C as vi}from"./delete-confirm-DOwYzFRf.js";import{W as Qe}from"./url-evaluation-BTdmiGRO.js";import{d as Si}from"./is-path-prefix-equal-5RuRfdDZ.js";import{R as Ri,a as oo,B as Eo}from"./status-BXJ91n7W.js";import{B as bi}from"./bundle-avatar-k-apmNe0.js";import{A as To}from"./actions-CCw2fiQZ.js";import{I as At}from"./index-D3GDvQdK.js";import{a as Ei}from"./index-DKrhe0Pd.js";import{u as Ti}from"./team-QnBuJ2rq.js";import"./ButtonGroup-BIMC9S6K.js";import"./getValidReactChildren-86LVJ_ka.js";import"./index-Dj8gJMNb.js";import"./index-BGXvULAc.js";import"./url-join-CiWL3EAW.js";import"./MoreVert-xXktVXrB.js";import"./FilterList-BSbt4VER.js";import"./useThemeProps-BlrL4N8K.js";import"./Select-DEE1eR0K.js";import"./InputLabel-qD-ek4kX.js";import"./LastPage-DRexSCl8.js";import"./slicedToArray-Bg3ityWL.js";import"./Search-D2g_vALD.js";import"./ChevronLeft-DFREsjdS.js";import"./ChevronRight-SbPIKwoC.js";import"./DeleteOutline-Dy_sSwNK.js";import"./redux-B1Qumh5U.js";import"./Skeleton-m_lkZ6lH.js";import"./InputAdornment-C_X3KhDA.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-Cpw6Ga8g.js";import"./index-ZG7jWpak.js";import"./preact.module-DJUF--8d.js";import"./Close-BpEmkp97.js";import"./lottie-DlriAay1.js";import"./schema-5ne-6Bp4.js";import"./index-wB3ekx1K.js";import"./isEqual-BMA5WXPh.js";import"./index-CBTLvRHC.js";import"./Stepper-D4h3SXw3.js";import"./index-D3_NSRjd.js";import"./ExpandMore-CoMbEsJD.js";import"./shorten-label-CZlXdSOl.js";import"./MoreHoriz-BXgBR7_l.js";const wi=Vo(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 Xt={},Pi=Wt;Object.defineProperty(Xt,"__esModule",{value:!0});var wo=Xt.default=void 0,Ii=Pi(qt()),ki=e;wo=Xt.default=(0,Ii.default)((0,ki.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 $t({children:t,...o}){var g;const{t:s}=z(),{api:a}=K(),{blocklet:n}=oe(),r=(g=n==null?void 0:n.settings)==null?void 0:g.autoCheckUpdate,m=async f=>{await a.updateAutoCheckUpdate({input:{did:n.meta.did,autoCheckUpdate:f}})},l=async()=>{try{const f=!(r!=null&&r.enabled);await m({enabled:f}),A.success(s(f?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(f){A.error(f.message)}},u=!!(r!=null&&r.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(Ls,{checked:u,onChange:l,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}$t.propTypes={children:i.any};$t.defaultProps={children:null};const Ui=(t,o)=>{let{description:s}=t;return(Object.values(J.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,so=t=>[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),Ot=t=>[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function mt({blocklet:t,ancestors:o}){const s=K(),{inService:a}=s,{t:n}=h.useContext(Ce),r=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.success(n("blocklet.config.changedTip")),l=c=>Lt(c,t,o);if(Ye(t.status)||t.status==="unknown"&&Ye(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(so(c.key)===!1){A.error(n("blocklet.config.environment.invalidKey"));return}c.custom=Ot(c.key);try{const v=await s.api.configBlocklet({input:{did:r,configs:[c]}});m(v.blocklet)}catch(v){A.error(X(v))}},g=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(so(c.key)===!1){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===J.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:Ot(c.key)})}try{const T=await s.api.configBlocklet({input:{did:r,configs:j}});m(T.blocklet)}catch(T){A.error(X(T))}},f=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:r,configs:[{key:c.key,custom:Ot(c.key)}]}});m(v.blocklet)}catch(v){A.error(X(v))}},p=(t.configs||[]).filter(c=>!J.BLOCKLET_CONFIGURABLE_KEY[c.key]||[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(c.key)),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),R=p.map(c=>({...c,value:Object.values(J.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=R.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:g,onRowDelete:f,isDeletable:l},b=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Zn,{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(io,{children:e.jsx(Q,{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(Zn,{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(io,{children:[e.jsx(Q,{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}),Ui(j,n)]})}}];return e.jsxs(Di,{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(Ft,{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:b(),icons:{...Ds,...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:R,editable:c?x:{}})})})]})}mt.propTypes={blocklet:i.object.isRequired,ancestors:i.array};mt.defaultProps={ancestors:[]};const Di=F.div`
1
+ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E as A,r as h,f as Ce,bo as Ye,b as J,N as O,K as dt,V as Ft,cb as Oe,n as F,M as X,hA as qo,bG as Me,aY as ue,aX as gt,aC as Gt,a2 as $,D as xt,H as U,aP as Wo,Z as Je,a0 as Hn,b1 as Ho,fP as Ko,fQ as Yo,C as re,fc as Jo,z as mo,av as pt,q as we,y as zt,hB as Qo,hC as Zo,B as ne,ai as fo,J as Ht,hD as Xo,m as ee,a3 as $o,ez as es,W as ho,$ as go,ak as ts,x as ns,R as He,X as os,hE as xo,U as ge,az as ss,aA as is,aB as rs,i as yt,aN as as,cw as ls,bg as cs,hb as ds,hF as ps,ay as Kn,cu as us,ac as Fe,aJ as yo,bI as Kt,cd as ms,hG as fs,b7 as hs,A as gs,aZ as _t,T as xs,aQ as Ke,at as Nt,bp as Co,aF as ys,fM as Pe,dM as Cs,hH as js,gm as Yn,hI as Jn,go as Qn,a_ as vs,G as at,gq as Ss,bH as Rs}from"./index-DzlR4ROA.js";import{d as bs}from"./Add-B6ZIiZST.js";import{a as Es,R as ct,F as Ts,L as ws,d as Yt,b as Jt}from"./line-Cpeu8572.js";import{C as Ps,A as Is,d as ks}from"./agreement-DXIl-xR_.js";import{E as Us}from"./index-po1Du4Ca.js";import{b as Bs,a as Ds,c as Ns,u as Qt,e as As}from"./actions-DGcLEhc9.js";import{S as Ls}from"./switch-control-BxRwCbFm.js";import{u as oe}from"./blocklet-d8bc_SQ4.js";import{d as jo}from"./Edit-wLc7o2cw.js";import{T as Os}from"./index-Cmy0GHU-.js";import{T as Ms,M as Fs,t as Gs}from"./table-icons-BXeoVsYd.js";import{C as Zn}from"./click-to-copy-ZbSHXJko.js";import{T as Q}from"./TextField-BjNW7Bjw.js";import{d as Zt}from"./Link-Dxx2K6Ua.js";import{c as zs,C as _s,a as Vs,b as qs,D as Ws,A as Hs,B as Ks,d as Ys,S as Js}from"./item-DinHwjuB.js";import{u as Qs,a as Zs,P as vo,L as Xn,A as Xs,S as $s}from"./index-RrRN76hq.js";import{u as So,t as ei}from"./toUpper-BBB_TInl.js";import{a as ti,b as ni,c as oi,d as si,e as ii,g as $n,f as ri,i as eo}from"./spaces-CKLphlMZ.js";import{d as ai}from"./EditIcon-BCVTD6hP.js";import{d as li}from"./Done-3-QQ_TOf.js";import{C as ci}from"./Google-C9I0SVEJ.js";import{I as di,a as pi,f as ui,B as mi}from"./install-from-url-BHRJMyoo.js";import{a as to}from"./api-Rcl-3MyM.js";import{v as Ro,a as ut,b as fi}from"./util-DjDIVQpP.js";import{P as hi,u as gi}from"./use-blocklet-info-for-connect-did-spaces-Dw7UZ6Jz.js";import{d as xi}from"./DeleteOutline-yYcRq6ni.js";import{S as no}from"./index-RRgjvIfT.js";import{d as yi}from"./ArrowDropDown-CTOfLnwc.js";import{_ as Ci}from"./useLocalStorage-F8gidp1W.js";import{d as ji}from"./LockIcon-BB4v3xDA.js";import{d as Ct}from"./Delete-DFFe3xyW.js";import{d as bo}from"./Launch-BN3gZaS3.js";import{C as vi}from"./delete-confirm-CGv3y6py.js";import{W as Qe}from"./url-evaluation-C7b_jErN.js";import{d as Si}from"./is-path-prefix-equal-QODAXh-c.js";import{R as Ri,a as oo,B as Eo}from"./status-6F7XJ5dp.js";import{B as bi}from"./bundle-avatar-CW4zHZR5.js";import{A as To}from"./actions-TtrKwsqz.js";import{I as At}from"./index-8azRnZez.js";import{a as Ei}from"./index-CR_2MaC1.js";import{u as Ti}from"./team-nBwKhOsv.js";import"./ButtonGroup-3w5LvaA0.js";import"./getValidReactChildren-Y-QNoefA.js";import"./index-qSHb4AGp.js";import"./index-D0RT0rzU.js";import"./url-join-LN7aIhdX.js";import"./MoreVert-C_-FQbwq.js";import"./FilterList-FEjK2Fox.js";import"./useThemeProps-CRpVKi5P.js";import"./Select-C44-YCyD.js";import"./InputLabel-BOR0LpK5.js";import"./LastPage-BmNCoOR7.js";import"./slicedToArray-ROu8OO6l.js";import"./Search-CjX0JQkS.js";import"./ChevronLeft-CvWKad8W.js";import"./ChevronRight-93HrdGCM.js";import"./redux-C4Q_CSvp.js";import"./Skeleton-4s7n7VqF.js";import"./InputAdornment-DT4h3g9o.js";import"./memoize-one.esm-BdPwpGay.js";import"./index-DQo_Dew3.js";import"./index-ZG7jWpak.js";import"./preact.module-DJUF--8d.js";import"./Close-DzKkufzk.js";import"./lottie-Dittdj4N.js";import"./schema-Bq2ly-4o.js";import"./index-BdL0EBBo.js";import"./isEqual-CFOAIOWs.js";import"./index-C4LMPu9u.js";import"./Stepper-BRwbb4LL.js";import"./index-C3UQMAkF.js";import"./ExpandMore-CFYbzpsT.js";import"./shorten-label-BSQEIROA.js";import"./MoreHoriz-IPlU_Vvy.js";const wi=Vo(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 Xt={},Pi=Wt;Object.defineProperty(Xt,"__esModule",{value:!0});var wo=Xt.default=void 0,Ii=Pi(qt()),ki=e;wo=Xt.default=(0,Ii.default)((0,ki.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 $t({children:t,...o}){var g;const{t:s}=z(),{api:a}=K(),{blocklet:n}=oe(),r=(g=n==null?void 0:n.settings)==null?void 0:g.autoCheckUpdate,m=async f=>{await a.updateAutoCheckUpdate({input:{did:n.meta.did,autoCheckUpdate:f}})},l=async()=>{try{const f=!(r!=null&&r.enabled);await m({enabled:f}),A.success(s(f?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(f){A.error(f.message)}},u=!!(r!=null&&r.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(Ls,{checked:u,onChange:l,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}$t.propTypes={children:i.any};$t.defaultProps={children:null};const Ui=(t,o)=>{let{description:s}=t;return(Object.values(J.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,so=t=>[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)?!0:!(t.startsWith("BLOCKLET_")||t.startsWith("COMPONENT_")),Ot=t=>[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(t)===!1;function mt({blocklet:t,ancestors:o}){const s=K(),{inService:a}=s,{t:n}=h.useContext(Ce),r=[...o.map(c=>c.meta.did),t.meta.did],m=()=>A.success(n("blocklet.config.changedTip")),l=c=>Lt(c,t,o);if(Ye(t.status)||t.status==="unknown"&&Ye(t.status))return null;const u=async c=>{if(!c.key.trim()||!c.value.trim()){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(so(c.key)===!1){A.error(n("blocklet.config.environment.invalidKey"));return}c.custom=Ot(c.key);try{const v=await s.api.configBlocklet({input:{did:r,configs:[c]}});m(v.blocklet)}catch(v){A.error(X(v))}},g=async(c,v)=>{if(c.required&&(!c.key.trim()||!c.value.trim())){A.error(n("blocklet.config.environment.keyValueRequired"));return}if(so(c.key)===!1){A.error(n("blocklet.config.environment.invalidKey"));return}if(c.key===J.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:Ot(c.key)})}try{const T=await s.api.configBlocklet({input:{did:r,configs:j}});m(T.blocklet)}catch(T){A.error(X(T))}},f=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:r,configs:[{key:c.key,custom:Ot(c.key)}]}});m(v.blocklet)}catch(v){A.error(X(v))}},p=(t.configs||[]).filter(c=>!J.BLOCKLET_CONFIGURABLE_KEY[c.key]||[J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(c.key)),S=O.getSharedConfigObj(o[0],t),d=O.getComponentMissingConfigs(t,o[0]),R=p.map(c=>({...c,value:Object.values(J.CHAIN_PROP_MAP).includes(c.key)&&Object.keys(S).includes(c.key)?S[c.key]:S[c.key]||c.value})),C=R.some(c=>c.key&&c.key.startsWith("BWA_")),x={onRowAdd:u,onRowUpdate:g,onRowDelete:f,isDeletable:l},b=()=>[{title:n("common.key"),field:"key",initialEditValue:"Key",width:"30%",render:c=>e.jsx(Zn,{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(io,{children:e.jsx(Q,{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(Zn,{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(io,{children:[e.jsx(Q,{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}),Ui(j,n)]})}}];return e.jsxs(Bi,{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(Ft,{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:b(),icons:{...Bs,...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:R,editable:c?x:{}})})})]})}mt.propTypes={blocklet:i.object.isRequired,ancestors:i.array};mt.defaultProps={ancestors:[]};const Bi=F.div`
2
2
  .config-table {
3
3
  margin-bottom: 24px;
4
4
  position: relative;
@@ -52,7 +52,7 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
52
52
  }
53
53
  `,io=F.div`
54
54
  height: 60px;
55
- `;function jt({blocklet:t,ancestors:o,hasPermission:s,...a}){const{t:n}=z(),{api:r}=K(),m=!o.length,l=m?t.meta.did:o.map(C=>C.meta.did)[0],[u,g]=h.useState(""),[f,p]=h.useState(""),S=u||!s;if(!l||t.status==="unknown"&&Ye(t.status))return null;const d=async C=>{g(!0);try{const x={rootDid:l,mountPoint:ue(C)};return m||(x.did=t.meta.did),await r.updateComponentMountPoint({input:x}),g(!1),!0}catch(x){throw g(!1),x.message=X(x),A.error(x.message),x}},R=C=>{p(n("common.slugifyHint",{value:gt(C)}))};return e.jsx(Li,{component:"div",...a,children:e.jsx(y,{mt:3,children:e.jsx(Es,{label:n("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:u||S,loading:u,required:!0,initialValue:t.mountPoint,onSubmit:d,onChange:R,helperText:f,formatterBeforeSubmit:C=>ue(C)})})})}const Bi=Me(jt,"mutate_blocklets"),Ni=Me(jt,"",Oe);function Ai(t){const{inService:o}=K();return o?e.jsx(Ni,{...t}):e.jsx(Bi,{...t})}jt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,hasPermission:i.bool};jt.defaultProps={ancestors:[],hasPermission:!1};const Li=F.div``;function vt({open:t,onClose:o,hiddenChildren:s,blocklet:a,ancestors:n,children:r}){const[m,l]=h.useState(!1),{t:u}=z(),g=!!n.length,[f,p]=h.useState(Gt.hasMountPoint(a==null?void 0:a.meta)?"settings":"environments"),S=g?O.getDisplayName(a,!0):u("blocklet.component.container");if(Ye(a.status)||a.status==="unknown"&&Ye(a.status))return null;const d=()=>{o==null||o(),l(!1)},R=T=>{T.stopPropagation(),l(!0)},C={settings:Gt.hasMountPoint(a.meta)&&{label:u("blocklet.component.setting"),value:"settings",component:e.jsx(Ai,{blocklet:a,ancestors:n})},environments:{label:u("common.environment"),value:"environments",component:e.jsx(mt,{blocklet:a,ancestors:n})}},x=Object.values(C).filter(Boolean),b=x.map(({label:T,value:I})=>({label:T,value:I})),c=T=>{p(T)},v=C[f]||x[0];let j=null;return s||(j=typeof r=="function"?r({open:R}):e.jsx($,{onClick:R,"data-cy":"action-config-component",children:e.jsx(jo,{})})),e.jsxs(e.Fragment,{children:[j,(t||m)&&e.jsx(Oi,{open:!0,fullWidth:!0,maxWidth:"md",title:S,onClose:d,PaperProps:{style:{minHeight:"auto"}},children:g?e.jsxs(y,{mt:1,children:[e.jsx(Os,{tabs:b,current:f,onChange:c,scrollButtons:"auto"}),v.component]}):e.jsx(mt,{blocklet:a,ancestors:n})})]})}vt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,children:i.any,open:i.bool,onClose:i.func,hiddenChildren:i.bool};vt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Oi=F(xt)`
55
+ `;function jt({blocklet:t,ancestors:o,hasPermission:s,...a}){const{t:n}=z(),{api:r}=K(),m=!o.length,l=m?t.meta.did:o.map(C=>C.meta.did)[0],[u,g]=h.useState(""),[f,p]=h.useState(""),S=u||!s;if(!l||t.status==="unknown"&&Ye(t.status))return null;const d=async C=>{g(!0);try{const x={rootDid:l,mountPoint:ue(C)};return m||(x.did=t.meta.did),await r.updateComponentMountPoint({input:x}),g(!1),!0}catch(x){throw g(!1),x.message=X(x),A.error(x.message),x}},R=C=>{p(n("common.slugifyHint",{value:gt(C)}))};return e.jsx(Li,{component:"div",...a,children:e.jsx(y,{mt:3,children:e.jsx(Es,{label:n("blocklet.component.mountPoint"),style:{marginTop:-24},disabled:u||S,loading:u,required:!0,initialValue:t.mountPoint,onSubmit:d,onChange:R,helperText:f,formatterBeforeSubmit:C=>ue(C)})})})}const Di=Me(jt,"mutate_blocklets"),Ni=Me(jt,"",Oe);function Ai(t){const{inService:o}=K();return o?e.jsx(Ni,{...t}):e.jsx(Di,{...t})}jt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,hasPermission:i.bool};jt.defaultProps={ancestors:[],hasPermission:!1};const Li=F.div``;function vt({open:t,onClose:o,hiddenChildren:s,blocklet:a,ancestors:n,children:r}){const[m,l]=h.useState(!1),{t:u}=z(),g=!!n.length,[f,p]=h.useState(Gt.hasMountPoint(a==null?void 0:a.meta)?"settings":"environments"),S=g?O.getDisplayName(a,!0):u("blocklet.component.container");if(Ye(a.status)||a.status==="unknown"&&Ye(a.status))return null;const d=()=>{o==null||o(),l(!1)},R=T=>{T.stopPropagation(),l(!0)},C={settings:Gt.hasMountPoint(a.meta)&&{label:u("blocklet.component.setting"),value:"settings",component:e.jsx(Ai,{blocklet:a,ancestors:n})},environments:{label:u("common.environment"),value:"environments",component:e.jsx(mt,{blocklet:a,ancestors:n})}},x=Object.values(C).filter(Boolean),b=x.map(({label:T,value:I})=>({label:T,value:I})),c=T=>{p(T)},v=C[f]||x[0];let j=null;return s||(j=typeof r=="function"?r({open:R}):e.jsx($,{onClick:R,"data-cy":"action-config-component",children:e.jsx(jo,{})})),e.jsxs(e.Fragment,{children:[j,(t||m)&&e.jsx(Oi,{open:!0,fullWidth:!0,maxWidth:"md",title:S,onClose:d,PaperProps:{style:{minHeight:"auto"}},children:g?e.jsxs(y,{mt:1,children:[e.jsx(Os,{tabs:b,current:f,onChange:c,scrollButtons:"auto"}),v.component]}):e.jsx(mt,{blocklet:a,ancestors:n})})]})}vt.propTypes={blocklet:i.object.isRequired,ancestors:i.array,children:i.any,open:i.bool,onClose:i.func,hiddenChildren:i.bool};vt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Oi=F(xt)`
56
56
  .MuiDialogContent-root {
57
57
  padding-top: 0;
58
58
  margin-top: -32px;
@@ -63,7 +63,7 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
63
63
  .ux-dialog_right {
64
64
  padding-right: 20px;
65
65
  }
66
- `,{NODE_MODES:ro}=U,Mi=({mode:t,previousMode:o}={})=>t===ro.SERVERLESS||o===ro.SERVERLESS;var Po={isInServerlessMode:Mi};function Fi(){const[t,o]=h.useState(null),{blocklet:s}=oe();return h.useEffect(()=>{o(ti(s))},[s]),{storageEndpoint:t}}const Io=h.createContext({}),{Provider:Gi,Consumer:sl}=Io;function en({children:t}){const[o,s]=h.useState(!1),[a,n]=h.useState(null),{blocklet:r,actions:{refreshBlocklet:m}}=oe(),{storageEndpoint:l}=Fi(),{api:u}=K();Wo(async()=>{try{if(s(!0),Hn.isEmpty(l)){n(null);return}const d=await ni(l);n(d)}catch(d){console.error(d),A.error(d.message)}finally{s(!1)}},[l]);const g=()=>{n(null),m()},f=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[r.meta.did],configs:[{key:J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};h.useEffect(()=>{async function d(){if(!a)return;const R=await oi(a.endpoint,a.name),C=Hn.merge(a,{name:R});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Gi,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:g,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}en.propTypes={children:Je.node.isRequired};en.defaultProps={};function tn(){return h.useContext(Io)}const nn={description:i.string,editing:i.bool,onChange:i.func,required:i.bool,value:i.any,componentProps:i.object,render:i.func,renderFormItem:i.func};function on({editing:t,value:o,onChange:s}){const[a,n]=h.useState(!1),r=h.useRef(),m=h.useRef(o);h.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)},g=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"}})]})}),f=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:r,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(Ho,{open:a,anchorEl:r.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(ci,{color:o,onChange:p=>l(p.hex)})})]});return t?f:g}on.propTypes=nn;function sn({editing:t,description:o,value:s,onChange:a,componentProps:n,...r}){const{placeholder:m}=n,l=h.useRef(s),u=f=>{f.key==="Enter"&&a(l.current,"confirm")},g=f=>{l.current=f,a(f)};return t?e.jsx(Q,{style:{flex:1},fullWidth:!0,value:s,onChange:f=>{f.persist(),g(f.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...r}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}sn.propTypes=nn;sn.defaultProps={componentProps:{}};function rn({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:r}=a,m=o==="auto"?Ko.getPassportColorFromDid(r.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Yo({title:"Owner",issuer:O.getDisplayName(r),issuerDid:r.appDid,ownerName:"Your Name",ownerDid:r.appDid,preferredColor:o||"auto"})}}),e.jsx(on,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}rn.propTypes={...nn,componentProps:i.shape({blocklet:i.object.isRequired}).isRequired};rn.defaultProps={};const zi={input:sn,color:on,passport:rn,uploader:t=>e.jsx(ws,{...t.componentProps})};function _i(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:zi[s==null?void 0:s.toLowerCase()]}function an({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:r,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,g]=h.useState(null),[f,p]=h.useState(l?s:a),S=h.useRef();function d(x,b,c){const{key:v,secure:j}=x,I=f[v]!==b,D={...f,[v]:b};I&&p(D),n({[v]:b},{allValues:D,action:c,currentItem:x}),c==="confirm"&&j&&p({...f,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?R(null):R(x)}function R(x){if(x){S.current=f[x.key],g(x);return}S.current=null,g(null)}function C(x,{editing:b=!1}){const{key:c}=x,v=l?s[c]:f[c];return v==="__encrypted__"?b?"":"******":v}return e.jsx(Vi,{className:"form",style:r,children:t==null?void 0:t.map(x=>{const{key:b,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const D=!!(u&&b===u.key),L=C(x,{editing:D}),k=_i(x,{editing:D}),M={inputProps:{"data-cy":"schema-form-item-component"},key:b,description:c,editing:D,value:L,onChange:(B,_="change")=>d(x,B,_),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:D?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(li,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Jo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,f[b],"edit")},disabled:m||u,size:"large",children:e.jsx(ai,{})})})]})]},b)})})}an.propTypes={schema:i.array.isRequired,loading:i.bool,onChange:i.func.isRequired,value:i.object,defaultValue:i.object,style:i.object,disabled:i.bool};an.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Vi=F(Ts)``;function ln({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:r}=z(),{info:m}=K(),l=mo(m),[u,g]=h.useState(null),f=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(R,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},b=v=>{A.error(v),o(v)};function c(v){return Zo(()=>to.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 b(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await b(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Qo(u);await c(v)}else await x({downloadTokenList:R.downloadTokenList&&C(R.downloadTokenList)})};if(h.useEffect(()=>{if(s==="purchase"){const R=new URL(f);R.pathname="/api/did/verify-purchase-blocklet/token",R.searchParams.set("serverDid",m.did),R.searchParams.set("blockletDid",t==null?void 0:t.did);try{to.get(R.href).then(({data:C})=>{const x=`${C.url}`;g(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{g(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:pt.create({baseURL:f}).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(f,"/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(zt,{open:!0,locale:r,popup:!1,saveConnect:!1,className:"connect",baseUrl:f,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}ln.propTypes={...zs,handlePaySuccess:i.func,mode:i.oneOf(["verify","purchase"]).isRequired};ln.defaultProps={handlePaySuccess:()=>{}};const cn=h.forwardRef(({mode:t,...o},s)=>{const[a,n]=h.useState(t!=="both"?t:"verify"),[r,m]=h.useState(t!=="both"?2:1),l=g=>{g!==a&&n(g)},u=()=>{a&&r!==2&&m(2)};return h.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>r})),r===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(_s,{action:a,onNext:null,onSelect:l})}):e.jsx(ln,{...o,mode:a})});cn.propTypes={mode:i.oneOf(["both","verify","purchase"]).isRequired,ref:i.any};cn.defaultProps={ref:{}};const qi=cn;function Wi({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function dn({key:t}={key:"sm"}){const o=fo();return Ht(o.breakpoints.down(t))}function pn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),r=dn();return!t||Xo(t.meta)?e.jsx(Hi,{children:s}):e.jsxs(Ki,{isMobile:r,children:[e.jsx(Wi,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}pn.propTypes={blocklet:i.object,onStartNow:i.func,children:i.any,disabled:i.bool};pn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Hi=F(y)`
66
+ `,{NODE_MODES:ro}=U,Mi=({mode:t,previousMode:o}={})=>t===ro.SERVERLESS||o===ro.SERVERLESS;var Po={isInServerlessMode:Mi};function Fi(){const[t,o]=h.useState(null),{blocklet:s}=oe();return h.useEffect(()=>{o(ti(s))},[s]),{storageEndpoint:t}}const Io=h.createContext({}),{Provider:Gi,Consumer:ol}=Io;function en({children:t}){const[o,s]=h.useState(!1),[a,n]=h.useState(null),{blocklet:r,actions:{refreshBlocklet:m}}=oe(),{storageEndpoint:l}=Fi(),{api:u}=K();Wo(async()=>{try{if(s(!0),Hn.isEmpty(l)){n(null);return}const d=await ni(l);n(d)}catch(d){console.error(d),A.error(d.message)}finally{s(!1)}},[l]);const g=()=>{n(null),m()},f=async d=>{n(d),await p(d.endpoint),m()},p=async d=>{await u.configBlocklet({input:{did:[r.meta.did],configs:[{key:J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:d}]}}),m()};h.useEffect(()=>{async function d(){if(!a)return;const R=await oi(a.endpoint,a.name),C=Hn.merge(a,{name:R});n(C)}d()},[]);const S=!!(l&&a);return e.jsx(Gi,{value:{loading:o,spaceGateway:a,deleteSpaceGateway:g,updateSpaceGateway:f,storageEndpoint:l,settingStorageEndpoint:p,hasStorageEndpoint:S},children:t})}en.propTypes={children:Je.node.isRequired};en.defaultProps={};function tn(){return h.useContext(Io)}const nn={description:i.string,editing:i.bool,onChange:i.func,required:i.bool,value:i.any,componentProps:i.object,render:i.func,renderFormItem:i.func};function on({editing:t,value:o,onChange:s}){const[a,n]=h.useState(!1),r=h.useRef(),m=h.useRef(o);h.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)},g=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"}})]})}),f=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:r,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(Ho,{open:a,anchorEl:r.current,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(ci,{color:o,onChange:p=>l(p.hex)})})]});return t?f:g}on.propTypes=nn;function sn({editing:t,description:o,value:s,onChange:a,componentProps:n,...r}){const{placeholder:m}=n,l=h.useRef(s),u=f=>{f.key==="Enter"&&a(l.current,"confirm")},g=f=>{l.current=f,a(f)};return t?e.jsx(Q,{style:{flex:1},fullWidth:!0,value:s,onChange:f=>{f.persist(),g(f.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||m,onKeyDown:u,...r}):e.jsx(y,{px:1,className:"form-item-input slot",children:s})}sn.propTypes=nn;sn.defaultProps={componentProps:{}};function rn({editing:t,value:o,onChange:s,componentProps:a,...n}){const{blocklet:r}=a,m=o==="auto"?Ko.getPassportColorFromDid(r.appDid):o;return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Yo({title:"Owner",issuer:O.getDisplayName(r),issuerDid:r.appDid,ownerName:"Your Name",ownerDid:r.appDid,preferredColor:o||"auto"})}}),e.jsx(on,{...n,editing:t,value:t?m:o,onChange:s,componentProps:a})]})}rn.propTypes={...nn,componentProps:i.shape({blocklet:i.object.isRequired}).isRequired};rn.defaultProps={};const zi={input:sn,color:on,passport:rn,uploader:t=>e.jsx(ws,{...t.componentProps})};function _i(t,{editing:o=!1}){const{componentType:s="input",render:a,renderFormItem:n}=t;return o&&n?n:!o&&a?a:zi[s==null?void 0:s.toLowerCase()]}function an({schema:t,loading:o,value:s,defaultValue:a,onChange:n,style:r,disabled:m}){const l=Object.prototype.toString.call(s)==="[object Object]",[u,g]=h.useState(null),[f,p]=h.useState(l?s:a),S=h.useRef();function d(x,b,c){const{key:v,secure:j}=x,I=f[v]!==b,B={...f,[v]:b};I&&p(B),n({[v]:b},{allValues:B,action:c,currentItem:x}),c==="confirm"&&j&&p({...f,[v]:"__encrypted__"}),["confirm","cancel"].includes(c)?R(null):R(x)}function R(x){if(x){S.current=f[x.key],g(x);return}S.current=null,g(null)}function C(x,{editing:b=!1}){const{key:c}=x,v=l?s[c]:f[c];return v==="__encrypted__"?b?"":"******":v}return e.jsx(Vi,{className:"form",style:r,children:t==null?void 0:t.map(x=>{const{key:b,description:c,required:v,solo:j=!1,hidden:T=!1,componentProps:I={}}=x;if(T)return null;const B=!!(u&&b===u.key),L=C(x,{editing:B}),k=_i(x,{editing:B}),M={inputProps:{"data-cy":"schema-form-item-component"},key:b,description:c,editing:B,value:L,onChange:(D,_="change")=>d(x,D,_),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:B?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(li,{})}),e.jsx($,{"data-cy":"schema-form-item-cancel",onClick:()=>{d(x,S.current,"cancel")},disabled:m||o,size:"large",children:e.jsx(Jo,{})})]}):e.jsx($,{"data-cy":"schema-form-item-edit",onClick:()=>{d(x,f[b],"edit")},disabled:m||u,size:"large",children:e.jsx(ai,{})})})]})]},b)})})}an.propTypes={schema:i.array.isRequired,loading:i.bool,onChange:i.func.isRequired,value:i.object,defaultValue:i.object,style:i.object,disabled:i.bool};an.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const Vi=F(Ts)``;function ln({meta:t,onCancel:o,mode:s,handlePaySuccess:a}){const{t:n,locale:r}=z(),{info:m}=K(),l=mo(m),[u,g]=h.useState(null),f=new URL(t==null?void 0:t.registryUrl).origin,p=O.getDisplayName({meta:t}),S=async(R,C)=>{const x=({downloadTokenList:v})=>{a({downloadTokenList:v})},b=v=>{A.error(v),o(v)};function c(v){return Zo(()=>to.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 b(n("blocklet.component.missDownloadTokenTip")),!0;return!0}return j.status==="error"?(console.error("vc error: ",j),await b(j==null?void 0:j.error),!0):!1}),{interval:1e3})}if(s==="purchase"&&u){const{statusUrl:v}=Qo(u);await c(v)}else await x({downloadTokenList:R.downloadTokenList&&C(R.downloadTokenList)})};if(h.useEffect(()=>{if(s==="purchase"){const R=new URL(f);R.pathname="/api/did/verify-purchase-blocklet/token",R.searchParams.set("serverDid",m.did),R.searchParams.set("blockletDid",t==null?void 0:t.did);try{to.get(R.href).then(({data:C})=>{const x=`${C.url}`;g(x)})}catch(C){console.error("get next workflow url error: ",C)}}return()=>{g(null)}},[s]),s==="purchase"&&!u)return"";const d={verify:{action:"verify-purchase-blocklet",checkFn:pt.create({baseURL:f}).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(f,"/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(zt,{open:!0,locale:r,popup:!1,saveConnect:!1,className:"connect",baseUrl:f,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:l,disableClose:!0,showDownload:!1,...d[s]})}ln.propTypes={...zs,handlePaySuccess:i.func,mode:i.oneOf(["verify","purchase"]).isRequired};ln.defaultProps={handlePaySuccess:()=>{}};const cn=h.forwardRef(({mode:t,...o},s)=>{const[a,n]=h.useState(t!=="both"?t:"verify"),[r,m]=h.useState(t!=="both"?2:1),l=g=>{g!==a&&n(g)},u=()=>{a&&r!==2&&m(2)};return h.useImperativeHandle(s,()=>({onNext:u,getCurrentStep:()=>r})),r===1?e.jsx("div",{style:{maxWidth:520},children:e.jsx(_s,{action:a,onNext:null,onSelect:l})}):e.jsx(ln,{...o,mode:a})});cn.propTypes={mode:i.oneOf(["both","verify","purchase"]).isRequired,ref:i.any};cn.defaultProps={ref:{}};const qi=cn;function Wi({...t}){return e.jsx(ne,{className:"bottom-button",variant:"contained",color:"primary",...t})}function dn({key:t}={key:"sm"}){const o=fo();return Ht(o.breakpoints.down(t))}function pn({blocklet:t,onStartNow:o,children:s,disabled:a}){const{t:n}=z(),r=dn();return!t||Xo(t.meta)?e.jsx(Hi,{children:s}):e.jsxs(Ki,{isMobile:r,children:[e.jsx(Wi,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:n("setup.startNow")}),e.jsx(y,{display:"flex",alignItems:"center",children:s})]})}pn.propTypes={blocklet:i.object,onStartNow:i.func,children:i.any,disabled:i.bool};pn.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Hi=F(y)`
67
67
  width: 100%;
68
68
  margin-top: auto;
69
69
  padding-top: 24px;
@@ -108,7 +108,7 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
108
108
  justify-content: space-between;
109
109
  gap: '32px',
110
110
  }}
111
- `;var ko=function(o){return e.jsxs("svg",{...o,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUiEwBOMsHUisZiXU8k3bVSTrPcHsKEEg8gV/vP7U26vRWhl2UnfEbX3VlVbRHgSwmcy2tWTjsxmIb4YjgbAkmpyEOINs1gCtSC4YsjwnY9l1MJYRz1N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+OwfYAo9QybSeFUX5a9bl1On+cL5YHUjp/eID+XwV2AwZUXHswFw0IhIUlwmaTdQtlKJUpbAArh1IONYy6WQkAc9+ZocJMnELtCFNKLySGLwUIuW1fJLBKOoydII6+sDlhy8xYI1vchhF6qZnM0/oZSUzcd5By2cDzUtH3ng8PHIzAKL25wuSv+gDBsggYWWkvLT27f2dhwRULpny5D5yKI7vD/4iAW9KWHB7JsEZeCE1E/mdgVHZTOci8X+YIanJt7+aBd2k8f2RL45Z2puefelcXjUWbKdMSYwr58dAPaHymSU0o9/zjFt7/VoGmNAwCyvrKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};ko.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Uo(){const{t}=z();return e.jsx(y,{children:e.jsxs(y,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(ko,{style:{width:200,height:250}}),e.jsx(ee,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.providerForStorage")})]})})}Uo.propTypes={};function un({spaceGateway:t,onDeleteSpace:o}){const{t:s}=z(),[a,n]=h.useState(!1),[r,m]=h.useState(!1),l=(g,f)=>{g==null||g.stopPropagation(),n(f)},u=async g=>{try{g==null||g.stopPropagation(),m(!0),await o(t),n(!1)}catch(f){console.error(f),A.error(`${s("storage.spaces.gateway.delete.failed")}: ${X(f)}`)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx($,{size:"small",onClick:g=>l(g,!0),children:e.jsx(xi,{})}),e.jsx($o,{title:s("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`}),open:a,confirmButton:{text:s("common.confirm"),props:{variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:u,onCancel:g=>l(g,!1)})]})}un.propTypes={onDeleteSpace:i.func,spaceGateway:i.shape({name:i.string.isRequired,url:i.string.isRequired,protected:i.bool}).isRequired};un.defaultProps={onDeleteSpace:()=>{}};var Do=function(o){return e.jsx("svg",{...o,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Do.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mn({spaceGateway:t,connected:o,onDisconnect:s,...a}){const n=dn(),{t:r}=z(),m=async()=>{try{await s(),A.success(r("storage.spaces.gateway.delete.succeeded",{name:t.name}))}catch(l){console.error(l),A.error(X(l))}};return e.jsxs(Yi,{style:{position:"relative"},children:[e.jsxs(y,{sx:{backgroundColor:o?"#F0FDFF":"inherit","&:hover":{backgroundColor:o?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...a,children:[e.jsx(y,{display:"flex",children:e.jsx(hi,{alt:t.did,src:si(t.endpoint)})}),e.jsxs(y,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px",minWidth:0},children:[e.jsxs(y,{className:"spaces-info",display:"flex",children:[e.jsx(ee,{sx:{color:o?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),e.jsx(es,{label:e.jsxs(e.Fragment,{children:[e.jsx(Do,{style:{marginRight:"4px"}}),r("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:n?null:"20px",fontWeight:"bold"}})]}),e.jsx(y,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:e.jsx(ee,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:t.did&&e.jsx(ho,{copyable:!1,size:14,compact:!0,responsive:!1,did:t.did})})})]}),e.jsx(y,{className:"spaces-backup",display:"flex",alignItems:"center",children:e.jsx(y,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:e.jsx(un,{spaceGateway:t,onDeleteSpace:m})})})]}),e.jsx(y,{className:"selected-container selected",children:e.jsx(go,{className:"selected-icon"})})]})}mn.propTypes={spaceGateway:i.shape({did:i.string.isRequired,name:i.string.isRequired,url:i.string.isRequired,endpoint:i.string.isRequired,protected:i.bool}).isRequired,connected:Je.bool,onDisconnect:Je.func};mn.defaultProps={connected:!1,onDisconnect:()=>{}};const Yi=F(y)`
111
+ `;var ko=function(o){return e.jsxs("svg",{...o,children:[e.jsxs("g",{filter:"url(#a)",children:[e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#DDD"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m49.192 6.222-40.97 40.97A11 11 0 0 0 5 54.971V240c0 6.075 4.925 11 11 11h196c6.075 0 11-4.925 11-11V14c0-6.075-4.925-11-11-11H56.97a11 11 0 0 0-7.778 3.222Zm-.707-.707A12 12 0 0 1 56.971 2H212c6.627 0 12 5.373 12 12v226c0 6.627-5.373 12-12 12H16c-6.627 0-12-5.373-12-12V54.97a12 12 0 0 1 3.515-8.485l40.97-40.97Z",fill:"#000",fillOpacity:".08"}),e.jsx("mask",{id:"b",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"4",y:"2",width:"220",height:"250",children:e.jsx("path",{d:"M56.97 2a12 12 0 0 0-8.485 3.515l-40.97 40.97A12 12 0 0 0 4 54.971V240c0 6.627 5.373 12 12 12h196c6.627 0 12-5.373 12-12V14c0-6.627-5.373-12-12-12H56.97Z",fill:"#D9D9D9"})}),e.jsxs("g",{mask:"url(#b)",children:[e.jsx("path",{opacity:".5",fill:"url(#c)",d:"M4 2h220v128H4z"}),e.jsx("path",{opacity:".1",fill:"url(#d)",d:"M4 130h220v122H4z"}),e.jsx("path",{d:"M33.045 169h-3.767v-11.636h3.887c1.14 0 2.12.233 2.937.698a4.61 4.61 0 0 1 1.881 1.995c.44.863.659 1.899.659 3.108 0 1.212-.222 2.254-.665 3.125a4.668 4.668 0 0 1-1.909 2.011c-.833.466-1.84.699-3.023.699Zm-2.01-1.534h1.914c.886 0 1.623-.167 2.21-.5a3.152 3.152 0 0 0 1.318-1.46c.292-.64.438-1.421.438-2.341 0-.913-.146-1.688-.438-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm11.546-10.102V169h-1.756v-11.636h1.756ZM48.905 169h-3.767v-11.636h3.886c1.14 0 2.12.233 2.938.698a4.609 4.609 0 0 1 1.88 1.995c.44.863.66 1.899.66 3.108 0 1.212-.222 2.254-.665 3.125a4.667 4.667 0 0 1-1.91 2.011c-.833.466-1.84.699-3.022.699Zm-2.011-1.534h1.914c.887 0 1.623-.167 2.21-.5a3.151 3.151 0 0 0 1.319-1.46c.291-.64.437-1.421.437-2.341 0-.913-.146-1.688-.437-2.324a3.095 3.095 0 0 0-1.29-1.449c-.572-.33-1.282-.494-2.13-.494h-2.023v8.568Zm20.372-7.046a1.662 1.662 0 0 0-.75-1.25c-.44-.299-.993-.448-1.66-.448-.477 0-.89.075-1.238.227a1.91 1.91 0 0 0-.813.613c-.189.258-.284.552-.284.881 0 .277.065.515.194.716.132.201.304.369.516.506.216.132.447.244.694.335.246.087.483.159.71.216l1.136.295c.371.091.752.214 1.142.37.39.155.752.36 1.086.613.333.254.602.568.806.944.209.374.313.823.313 1.346 0 .659-.17 1.244-.511 1.756-.338.511-.828.915-1.472 1.21-.64.295-1.415.443-2.324.443-.871 0-1.625-.138-2.261-.415-.637-.276-1.135-.668-1.495-1.176-.36-.511-.558-1.117-.596-1.818h1.761c.034.421.17.771.41 1.051.242.277.55.483.925.62.38.132.794.198 1.245.198.496 0 .937-.077 1.324-.233.39-.159.697-.378.92-.659a1.56 1.56 0 0 0 .335-.994c0-.345-.098-.627-.295-.847a2.191 2.191 0 0 0-.79-.545 7.725 7.725 0 0 0-1.12-.381l-1.374-.375c-.932-.253-1.67-.627-2.216-1.119-.542-.492-.813-1.144-.813-1.955 0-.67.182-1.255.546-1.755.363-.5.856-.888 1.477-1.165.621-.28 1.322-.42 2.102-.42.788 0 1.483.138 2.085.414.607.277 1.084.658 1.432 1.142.349.481.53 1.034.546 1.659h-1.693Zm3.813 11.853v-12h1.66v1.415h.142c.098-.182.24-.393.426-.631.185-.239.443-.447.772-.625.33-.182.766-.273 1.307-.273.705 0 1.334.178 1.887.534.553.356.987.869 1.3 1.54.319.67.478 1.477.478 2.42 0 .944-.157 1.752-.472 2.427-.314.67-.746 1.187-1.295 1.551-.55.36-1.176.539-1.88.539-.53 0-.965-.089-1.302-.267a2.457 2.457 0 0 1-.784-.625 4.667 4.667 0 0 1-.437-.636h-.103v4.631H71.08Zm1.665-7.637c0 .614.09 1.152.267 1.614.178.462.436.824.773 1.085.337.258.75.387 1.239.387.507 0 .931-.135 1.273-.404.34-.273.598-.642.772-1.108.178-.466.267-.99.267-1.574 0-.575-.087-1.092-.261-1.551-.17-.458-.428-.82-.773-1.085-.34-.265-.767-.398-1.278-.398-.493 0-.91.127-1.25.381-.337.254-.593.608-.767 1.062-.175.455-.262.985-.262 1.591Zm10.75 4.557a3.557 3.557 0 0 1-1.5-.307 2.523 2.523 0 0 1-1.062-.903c-.258-.394-.386-.877-.386-1.449 0-.492.094-.898.283-1.216.19-.318.446-.57.768-.756a4.036 4.036 0 0 1 1.08-.42c.397-.095.802-.167 1.215-.216l1.273-.148c.325-.041.562-.108.71-.198.148-.091.222-.239.222-.444v-.039c0-.497-.14-.881-.42-1.154-.277-.273-.69-.409-1.24-.409-.572 0-1.022.127-1.352.381-.325.25-.55.528-.676.835l-1.597-.364c.19-.53.466-.958.83-1.284.368-.329.79-.568 1.267-.716.477-.151.98-.227 1.506-.227.348 0 .718.042 1.108.125.394.08.761.227 1.102.443.345.216.627.525.847.926.22.398.33.915.33 1.552V169h-1.66v-1.193h-.068c-.11.22-.275.435-.495.648-.22.212-.501.388-.846.528s-.758.21-1.239.21Zm.37-1.363c.47 0 .87-.093 1.204-.279.337-.185.593-.428.767-.727.178-.303.267-.627.267-.972v-1.125c-.06.061-.178.118-.352.171-.17.049-.365.093-.585.13-.22.034-.434.067-.642.097l-.523.068c-.33.042-.63.112-.903.21a1.553 1.553 0 0 0-.648.427c-.16.181-.239.424-.239.727 0 .42.156.738.466.954.31.212.707.319 1.188.319Zm9.876 1.346c-.845 0-1.572-.191-2.182-.574a3.796 3.796 0 0 1-1.398-1.596c-.325-.678-.488-1.455-.488-2.33 0-.886.166-1.668.5-2.346a3.832 3.832 0 0 1 1.409-1.597c.606-.383 1.32-.574 2.142-.574.663 0 1.254.123 1.773.369.519.243.937.584 1.255 1.023.322.44.514.953.574 1.54h-1.653c-.091-.409-.3-.761-.625-1.057-.322-.295-.754-.443-1.296-.443a2.11 2.11 0 0 0-1.244.375c-.352.246-.627.598-.824 1.057-.197.454-.295.992-.295 1.613 0 .637.096 1.186.29 1.648.193.462.466.82.818 1.074.356.254.774.381 1.255.381.322 0 .614-.059.875-.177.266-.121.487-.293.665-.517.182-.223.309-.492.38-.806h1.654a3.211 3.211 0 0 1-.55 1.511 3.165 3.165 0 0 1-1.234 1.045c-.511.254-1.111.381-1.8.381Zm9.163 0c-.859 0-1.6-.184-2.221-.551a3.732 3.732 0 0 1-1.432-1.563c-.333-.674-.5-1.464-.5-2.369 0-.894.167-1.682.5-2.363a3.887 3.887 0 0 1 1.409-1.597c.606-.383 1.314-.574 2.125-.574.493 0 .97.082 1.432.244.462.163.877.419 1.244.767.368.349.657.802.87 1.358.212.553.318 1.226.318 2.017v.603H99.71v-1.273h5.273c0-.447-.091-.843-.273-1.187a2.052 2.052 0 0 0-.767-.824c-.326-.201-.708-.302-1.148-.302a2.22 2.22 0 0 0-1.25.353 2.364 2.364 0 0 0-.818.909 2.626 2.626 0 0 0-.284 1.21v.994c0 .584.102 1.08.307 1.489.208.409.498.722.869.938.372.212.805.318 1.301.318a2.7 2.7 0 0 0 .881-.137c.265-.094.494-.234.688-.42.193-.186.341-.415.443-.688l1.608.29c-.129.474-.36.888-.693 1.244-.33.353-.745.627-1.245.824-.496.194-1.062.29-1.699.29Z",fill:"#fff"}),e.jsx("path",{d:"M117.604 47.263 121.523 45h14.267v41.862h-14.267l-15.335-8.854V53.854l1.818-1.05 3.2 1.848-1.818 1.05V76.16l12.993 7.502h10.209V48.2h-10.209l-1.577.91-3.2-1.847Z",fill:"url(#e)"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M119.402 76.16V55.701L106.409 48.2H96.2v35.462h10.209l1.582-.913 3.2 1.847-3.924 2.266H93V45h14.267l15.335 8.854v24.154l-1.813 1.046-3.2-1.847 1.813-1.047Z",fill:"url(#f)"}),e.jsxs("g",{clipPath:"url(#g)",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff",children:[e.jsx("path",{d:"m50.928 216.089 1.034 2.852h-2.503l1.028-2.842a4.95 4.95 0 0 0 .107-.338 7.17 7.17 0 0 0 .111-.409c.075.297.15.542.223.737Zm2.28 5.591h.796l-2.775-7.352h-1.043l-2.774 7.352h.795a.338.338 0 0 0 .223-.077.425.425 0 0 0 .127-.179l.615-1.705h3.07l.617 1.705a.399.399 0 0 0 .126.184.339.339 0 0 0 .223.072Zm4.823-.963a2.023 2.023 0 0 1-.67.098h-1.455v-2.453h1.456c.5 0 .871.106 1.11.318.24.208.36.495.36.86 0 .184-.028.355-.083.512a1.005 1.005 0 0 1-.262.399 1.2 1.2 0 0 1-.456.266Zm-2.125-3.128v-2.406h1.237c.498 0 .865.095 1.101.286.236.192.355.497.355.917 0 .369-.125.662-.374.881-.246.215-.623.322-1.13.322h-1.189Zm2.358-3.128a4.106 4.106 0 0 0-1.12-.133h-2.27v7.352h2.507c.391 0 .74-.051 1.048-.154.307-.102.566-.247.776-.435.21-.188.37-.409.48-.665.11-.26.165-.547.165-.861 0-.904-.506-1.462-1.518-1.674.22-.075.41-.169.572-.281a1.79 1.79 0 0 0 .403-.379c.106-.144.186-.297.237-.461.052-.164.078-.335.078-.512a2.1 2.1 0 0 0-.146-.804 1.49 1.49 0 0 0-.441-.609 2.073 2.073 0 0 0-.771-.384Zm7.535.778h-2.212v6.441h-1.028v-6.441h-2.222v-.911H65.8v.911Zm2.439.564h-1.13v1.193h1.13v-1.193Zm-1.13 2.983h1.13v1.193h-1.13v-1.193Z",fillOpacity:".8"}),e.jsx("path",{d:"M28.247 221.771V214h3.894c.99.072 1.765.944 1.765 1.998v3.77c0 1.106-.85 2.003-1.897 2.003h-3.762ZM36.355 214h-1.011v7.783h1.01V214Zm-7.097 6.704v-5.642h2.751c.49 0 .886.419.886.936v3.77c0 .517-.396.936-.886.936h-2.75ZM37.775 214v7.771h3.762c1.047 0 1.897-.897 1.897-2.003v-3.77c0-1.054-.774-1.926-1.765-1.998h-3.894Zm6.946 1.803h1.13v1.193h-1.13v-1.193Zm1.13 2.983h-1.13v1.193h1.13v-1.193Zm-7.065-3.724v5.642h2.75c.49 0 .887-.419.887-.936v-3.77c0-.517-.397-.936-.886-.936h-2.751Z"})]}),e.jsx("circle",{cx:"191.32",cy:"218",r:"10",fill:"url(#h)"}),e.jsx("path",{d:"m192.064 213.333.976-.564h3.554v10.427h-3.286a1 1 0 0 1-.5-.134l-3.588-2.071v-6.016l.453-.262.797.46-.453.262v5.096l3.237 1.868h2.543v-8.833h-2.543l-.393.227-.797-.46Z",fill:"#fff"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M192.512 220.531v-5.096l-3.237-1.869h-2.543v8.833h2.543l.394-.227.797.46-.977.564h-3.554v-10.427h3.554l3.82 2.206v6.016l-.452.261-.797-.461.452-.26Z",fill:"#fff"})]})]}),e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"d",x1:"114",y1:"130",x2:"114",y2:"252",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#101010"}),e.jsx("stop",{offset:"1",stopColor:"#272727"})]}),e.jsxs("linearGradient",{id:"e",x1:"120.989",y1:"45",x2:"120.989",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff",stopOpacity:".4"}),e.jsx("stop",{offset:"1",stopColor:"#fff"})]}),e.jsxs("linearGradient",{id:"f",x1:"107.801",y1:"45",x2:"107.801",y2:"86.862",gradientUnits:"userSpaceOnUse",children:[e.jsx("stop",{stopColor:"#fff"}),e.jsx("stop",{offset:"1",stopColor:"#fff",stopOpacity:".4"})]}),e.jsxs("radialGradient",{id:"h",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(17 -8.76924 6.97565 13.52294 183.166 221)",children:[e.jsx("stop",{stopColor:"#016BED"}),e.jsx("stop",{offset:".699",stopColor:"#4498FB"}),e.jsx("stop",{offset:"1",stopColor:"#9DFFE8"})]}),e.jsx("clipPath",{id:"g",children:e.jsx("path",{fill:"#fff",transform:"translate(28 214)",d:"M0 0h40.32v8H0z"})}),e.jsx("pattern",{id:"c",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:e.jsx("use",{xlinkHref:"#i",transform:"scale(.00455 .00781)"})}),e.jsxs("filter",{id:"a",x:"0",y:"0",width:"228",height:"258",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[e.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),e.jsx("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),e.jsx("feOffset",{dy:"2"}),e.jsx("feGaussianBlur",{stdDeviation:"2"}),e.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),e.jsx("feColorMatrix",{values:"0 0 0 0 0.0631944 0 0 0 0 0.242785 0 0 0 0 0.403472 0 0 0 0.2 0"}),e.jsx("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_1410_22507"}),e.jsx("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_1410_22507",result:"shape"})]}),e.jsx("image",{id:"i",width:"220",height:"128",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAACABAMAAACSOBo+AAAAG1BMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUUeIgAAAACXRSTlMSFhkOHAsfCCOMH5MiAAAjjElEQVRo3hTQO3sjRRBG4a+qWzJhVfdIJqzuGXsJe2bkJe0e2UA4shdIJS2X1LBcUpbL/wae5yQnfVHGjp2+V08yKR7OwBDYte8pi5Aq9DObSBouqN9cidZyusonzWtGJO13phLebEn6xKEnlYyXe5hnySc53Ym9Abn7crTse8r7BMeIB8yBOVZK0trMjxT5S/cgc9G63BQqZoF3xSYZYeRk2hoIvEBFA7XMtaaF8TdY1GjiDDqgEswRDlWnRtmYzl5zRUq3sx3I+JL7sBJKXchDGJY9D+SfHAIoA+TuHCyYYYFjkhNB8tO5hhju0ANjdCITLx4/JDL+yyP0ErZR+m3M322bY8OKHzoOcAXLQMBHiIh+X59pv6udCJ7MAV9HARPtTEuFSdAzNVn7uPmkk3TpBGHb8DJZ3p36ScsuJVFQP6CUBXimN3BABZJUi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+B4vr0gBhFB6S+89eO6chpzkyM8s0MdCgW7njgiikAKvGH0fRKr9cXmycUjU8xfeY87PIXB3q1TK2GWGjxhtr146ZKTKWPp9sR8MWBNzQTNNrIt4XCVHh+OwfYAo9QybSeFUX5a9bl1On+cL5YHUjp/eID+XwV2AwZUXHswFw0IhIUlwmaTdQtlKJUpbAArh1IONYy6WQkAc9+ZocJMnELtCFNKLySGLwUIuW1fJLBKOoydII6+sDlhy8xYI1vchhF6qZnM0/oZSUzcd5By2cDzUtH3ng8PHIzAKL25wuSv+gDBsggYWWkvLT27f2dhwRULpny5D5yKI7vD/4iAW9KWHB7JsEZeCE1E/mdgVHZTOci8X+YIanJt7+aBd2k8f2RL45Z2puefelcXjUWbKdMSYwr58dAPaHymSU0o9/zjFt7/VoGmNAwCyvrKe2L1hYJqtd5gh6FGiCAGzqFk6on9pQdSAQzkctDTtXGbDih5iRPVIk9TwCJGwP3tpATkHsNwloUilnNMFce7twgDgrgWhsE8jWW+EBLlTDMn9pmtJOefTJc6Cxld039TN4XiwL4pMtU+8tXJ4g/LghG5APdF7/e3FSi4v8vnEBiIEm+5LlZtsk2LbbbY5hN9JkkJkd5BjQFPoUcwjJdTm0mx0024NmOvVgxASvU9TonFxUqG8cUTy3m5s3i7BqLbFkKcfxLQYhAXfjam0yFFd3PZE9wlXWfHYKlg2cFlTcnwRH6z8DpSfQHidMhElmCMb07li9ceHQHFknk/98f4KJRLpX6xQEXVAnJxlr8Aw6/qb0wu9SNolstScB0izxmMC5DiytBJd9Rcm3RGf42aiddmUTM4d4dgdjiT+vMPX0/RzfZdLoZ4aQqPzhx9plNI3QyvsMZHn2j2wOECoTtkfJt89O+eYUnXB/gFxHxPmOeL9ogAAAABJRU5ErkJggg=="})]})]})};ko.defaultProps={width:"228",height:"258",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"};function Uo(){const{t}=z();return e.jsx(y,{children:e.jsxs(y,{minHeight:"40vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",children:[e.jsx(ko,{style:{width:200,height:250}}),e.jsx(ee,{marginTop:"24px",marginBottom:"24px",children:t("storage.spaces.connect.providerForStorage")})]})})}Uo.propTypes={};function un({spaceGateway:t,onDeleteSpace:o}){const{t:s}=z(),[a,n]=h.useState(!1),[r,m]=h.useState(!1),l=(g,f)=>{g==null||g.stopPropagation(),n(f)},u=async g=>{try{g==null||g.stopPropagation(),m(!0),await o(t),n(!1)}catch(f){console.error(f),A.error(`${s("storage.spaces.gateway.delete.failed")}: ${X(f)}`)}finally{m(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx($,{size:"small",onClick:g=>l(g,!0),children:e.jsx(xi,{})}),e.jsx($o,{title:s("common.delConfirmDescription",{data:`${t==null?void 0:t.name}`}),open:a,confirmButton:{text:s("common.confirm"),props:{variant:"contained",color:"error",loading:r}},cancelButton:{text:s("common.cancel"),props:{variant:"contained",color:"primary"}},onConfirm:u,onCancel:g=>l(g,!1)})]})}un.propTypes={onDeleteSpace:i.func,spaceGateway:i.shape({name:i.string.isRequired,url:i.string.isRequired,protected:i.bool}).isRequired};un.defaultProps={onDeleteSpace:()=>{}};var Bo=function(o){return e.jsx("svg",{...o,children:e.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"#25C99B"})})};Bo.defaultProps={width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function mn({spaceGateway:t,connected:o,onDisconnect:s,...a}){const n=dn(),{t:r}=z(),m=async()=>{try{await s(),A.success(r("storage.spaces.gateway.delete.succeeded",{name:t.name}))}catch(l){console.error(l),A.error(X(l))}};return e.jsxs(Yi,{style:{position:"relative"},children:[e.jsxs(y,{sx:{backgroundColor:o?"#F0FDFF":"inherit","&:hover":{backgroundColor:o?"#F0FDFF":"#FBFBFB"},borderRadius:"8px"},display:"flex",padding:"12px 20px",...a,children:[e.jsx(y,{display:"flex",children:e.jsx(hi,{alt:t.did,src:si(t.endpoint)})}),e.jsxs(y,{className:"spaces-info",display:"flex",flexGrow:1,flexDirection:"column",sx:{marginLeft:"20px",padding:"0px 0px",minWidth:0},children:[e.jsxs(y,{className:"spaces-info",display:"flex",children:[e.jsx(ee,{sx:{color:o?"primary":"inherit",fontSize:"1rem",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),e.jsx(es,{label:e.jsxs(e.Fragment,{children:[e.jsx(Bo,{style:{marginRight:"4px"}}),r("storage.spaces.connected.tag")]}),variant:"outlined",size:"small",style:{marginLeft:n?null:"20px",fontWeight:"bold"}})]}),e.jsx(y,{className:"spaces-address",display:"flex",color:"#9397A1",marginTop:"8px",children:e.jsx(ee,{sx:{display:"inline-flex",alignItems:"center",fontSize:"14px"},color:"#9397A1",children:t.did&&e.jsx(ho,{copyable:!1,size:14,compact:!0,responsive:!1,did:t.did})})})]}),e.jsx(y,{className:"spaces-backup",display:"flex",alignItems:"center",children:e.jsx(y,{className:"backup-strategy",display:"flex",alignItems:"center",width:"100%",children:e.jsx(un,{spaceGateway:t,onDeleteSpace:m})})})]}),e.jsx(y,{className:"selected-container selected",children:e.jsx(go,{className:"selected-icon"})})]})}mn.propTypes={spaceGateway:i.shape({did:i.string.isRequired,name:i.string.isRequired,url:i.string.isRequired,endpoint:i.string.isRequired,protected:i.bool}).isRequired,connected:Je.bool,onDisconnect:Je.func};mn.defaultProps={connected:!1,onDisconnect:()=>{}};const Yi=F(y)`
112
112
  .selected-container {
113
113
  position: absolute;
114
114
  right: 0px;
@@ -161,12 +161,12 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
161
161
  visibility: visible;
162
162
  }
163
163
  }
164
- `;function Ji(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=tn();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(mn,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function fn({onConnect:t,...o}){const{blocklet:s}=oe(),{info:a}=K(),{t:n,locale:r}=z(),[m,l]=h.useState(""),[u,g]=h.useState(!1),[f,p]=h.useState(!1),[S,d]=h.useState(""),R=gi({blocklet:s}),C=mo(a),{storageEndpoint:x}=tn(),[b,c]=h.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:pt.create({baseURL:we(window.location.origin,ts())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:R.appName},r),scan:n("storage.spaces.provideNFT.scan",{appName:R.appName},r),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(k=>({...k,open:!1}))}}),[v,j]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:R.appName},r),scan:n("storage.spaces.authorize.scan",{appName:R.appName},r),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 _=await $n(B);if(!await eo(_)){A.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Z={name:M,did:k,url:_,endpoint:B};await t(Z),A.success(n("storage.spaces.connectedWithName",{name:Z.name}))},I=(k,M)=>{setTimeout(async()=>{if(j(Z=>({...Z,open:!1})),l(null),c(Z=>({...Z,open:!1})),!He(k.spaceGateway)){await T(M(k.spaceGateway));return}const B=M(k.endpoint),_=k.space?M(k.space):{};await T({endpoint:B,did:ii(B),name:"DID Space",..._})},0)},D=()=>{c(k=>({...k,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{g(!0);const k=await $n(m),M=ri(k),B=new URL(k).searchParams.get("spaceDid");if(!await eo(M))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));j(_=>({..._,open:!0,prefix:we(M,"space/api/did"),baseUrl:new URL(M).origin,checkFn:pt.create({baseURL:we(M,"space")}).get,extraParams:{appDid:R.appDid,appName:R.appName,appDescription:R.appDescription,scopes:R.scopes,appUrl:R.appUrl,referrer:R.referrer,nodeDid:a.did,spaceDid:B}})),p(!1)}catch(k){const M=`${n("storage.spaces.gateway.add.failed",r)}: ${X(k)}`;d(M)}finally{g(!1)}};return e.jsxs(y,{children:[e.jsx(no,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:D,variant:"outlined",menu:[e.jsx(no.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(zt,{forceConnected:!1,saveConnect:!1,prefix:b.prefix,open:b.open,popup:!0,action:b.action,webWalletUrl:C,baseUrl:b.baseUrl,checkFn:b.checkFn,onSuccess:I,onClose:b.onClose,checkTimeout:b.checkTimeout,extraParams:b.extraParams,messages:b.messages,locale:r}),e.jsx(zt,{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:r}),e.jsxs(xt,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:f,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(ns,{component:"div",children:e.jsx(ee,{component:"div",children:e.jsx(Q,{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})]})]})}fn.propTypes={onConnect:Je.func};fn.defaultProps={onConnect:()=>{}};function hn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=dn(),{blocklet:a}=oe(),{updateSpaceGateway:n,loading:r,hasStorageEndpoint:m}=tn();return h.useEffect(()=>{o==null||o()},[a]),r?e.jsx(os,{relative:"parent",children:e.jsx(re,{})}):e.jsxs(Qi,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx(Ji,{}):e.jsx(Uo,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(pn,{mt:8,children:e.jsx(fn,{onConnect:n})})]})}hn.propTypes={blockletMeta:i.any.isRequired,onEndpointUpdate:Je.func};hn.defaultProps={onEndpointUpdate:()=>{}};const Qi=F(Ps)`
164
+ `;function Ji(){const{t}=z(),{spaceGateway:o,settingStorageEndpoint:s}=tn();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(mn,{style:{marginTop:"12px"},spaceGateway:o,connected:!0,onDisconnect:()=>s(null)},o.endpoint)})]})}function fn({onConnect:t,...o}){const{blocklet:s}=oe(),{info:a}=K(),{t:n,locale:r}=z(),[m,l]=h.useState(""),[u,g]=h.useState(!1),[f,p]=h.useState(!1),[S,d]=h.useState(""),R=gi({blocklet:s}),C=mo(a),{storageEndpoint:x}=tn(),[b,c]=h.useState({open:!1,action:"connect-to-did-spaces",checkTimeout:1e3*300,prefix:"/api/did",checkFn:pt.create({baseURL:we(window.location.origin,ts())}).get,messages:{title:n("storage.spaces.provideNFT.title",{appName:R.appName},r),scan:n("storage.spaces.provideNFT.scan",{appName:R.appName},r),confirm:"",success:e.jsx(ee,{gutterBottom:!0,children:n("storage.spaces.provideNFT.success")})},onClose:()=>{c(k=>({...k,open:!1}))}}),[v,j]=h.useState({open:!1,action:"one-click-authorization",checkTimeout:1e3*300,messages:{title:n("storage.spaces.authorize.title",{appName:R.appName},r),scan:n("storage.spaces.authorize.scan",{appName:R.appName},r),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:D})=>{const _=await $n(D);if(!await eo(_)){A.error(n("storage.spaces.gateway.add.invalidUrl"));return}const Z={name:M,did:k,url:_,endpoint:D};await t(Z),A.success(n("storage.spaces.connectedWithName",{name:Z.name}))},I=(k,M)=>{setTimeout(async()=>{if(j(Z=>({...Z,open:!1})),l(null),c(Z=>({...Z,open:!1})),!He(k.spaceGateway)){await T(M(k.spaceGateway));return}const D=M(k.endpoint),_=k.space?M(k.space):{};await T({endpoint:D,did:ii(D),name:"DID Space",..._})},0)},B=()=>{c(k=>({...k,open:!0,extraParams:{appPid:s.appPid,referrer:window.location.href}}))},L=async()=>{try{g(!0);const k=await $n(m),M=ri(k),D=new URL(k).searchParams.get("spaceDid");if(!await eo(M))throw new Error(n("storage.spaces.gateway.add.invalidUrl"));j(_=>({..._,open:!0,prefix:we(M,"space/api/did"),baseUrl:new URL(M).origin,checkFn:pt.create({baseURL:we(M,"space")}).get,extraParams:{appDid:R.appDid,appName:R.appName,appDescription:R.appDescription,scopes:R.scopes,appUrl:R.appUrl,referrer:R.referrer,nodeDid:a.did,spaceDid:D}})),p(!1)}catch(k){const M=`${n("storage.spaces.gateway.add.failed",r)}: ${X(k)}`;d(M)}finally{g(!1)}};return e.jsxs(y,{children:[e.jsx(no,{color:"primary",style:{textTransform:"none !important",fontSize:"1rem"},size:"small",onClick:B,variant:"outlined",menu:[e.jsx(no.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(zt,{forceConnected:!1,saveConnect:!1,prefix:b.prefix,open:b.open,popup:!0,action:b.action,webWalletUrl:C,baseUrl:b.baseUrl,checkFn:b.checkFn,onSuccess:I,onClose:b.onClose,checkTimeout:b.checkTimeout,extraParams:b.extraParams,messages:b.messages,locale:r}),e.jsx(zt,{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:r}),e.jsxs(xt,{title:n("storage.spaces.gateway.add.title"),fullWidth:!0,maxWidth:"md",open:f,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(ns,{component:"div",children:e.jsx(ee,{component:"div",children:e.jsx(Q,{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})]})]})}fn.propTypes={onConnect:Je.func};fn.defaultProps={onConnect:()=>{}};function hn({blockletMeta:t,onEndpointUpdate:o}){var l;const s=dn(),{blocklet:a}=oe(),{updateSpaceGateway:n,loading:r,hasStorageEndpoint:m}=tn();return h.useEffect(()=>{o==null||o()},[a]),r?e.jsx(os,{relative:"parent",children:e.jsx(re,{})}):e.jsxs(Qi,{children:[e.jsx(y,{width:s?"360px":"720px",children:m?e.jsx(Ji,{}):e.jsx(Uo,{})}),((l=t==null?void 0:t.capabilities)==null?void 0:l.didSpace)==="required"&&e.jsx(pn,{mt:8,children:e.jsx(fn,{onConnect:n})})]})}hn.propTypes={blockletMeta:i.any.isRequired,onEndpointUpdate:Je.func};hn.defaultProps={onEndpointUpdate:()=>{}};const Qi=F(Ps)`
165
165
  height: 100%;
166
166
  overflow-y: auto;
167
167
  padding-bottom: 32px;
168
168
  overflow-x: hidden;
169
- `;function gn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:r}){const{t:m}=z(),{info:l,inService:u}=K(),{blocklet:g}=oe(),[f,p]=h.useState(!1),S=h.useRef(null),[d,R]=h.useState(),[C,x]=Ci(r||"tmp"),[b,c]=r?[C,x]:[d,R],{storeList:v,teamDid:j}=xo({fromBlocklet:u,blocklet:g,nodeInfo:l}),T=So([...n.map(D=>({...D,protected:!0})),...v],"url"),I=b&&T.find(D=>b===D.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Zi,{children:[e.jsx(ne,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(yi,{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(Q,{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:D=>{const L=D.target.value;c(L.url),t(L)},SelectProps:{open:f,MenuProps:{anchorEl:S.current},renderValue:D=>D==null?void 0:D.name,onClose:()=>{p(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(D=>e.jsx(ge,{sx:{width:"400px",maxWidth:"90vw"},value:D,"data-cy":D.url,children:e.jsx(Vs,{teamDid:j,store:D,onDelete:()=>{var L;b===D.url&&c((L=T[0])==null?void 0:L.url)}})},D.url)),!Po.isInServerlessMode(l)&&e.jsx(qs,{disabled:o,storeList:T,teamDid:j,onAdd:D=>{c(D)}})]}),s({currentRegistry:I})]})}gn.propTypes={onChange:i.func,loading:i.bool,children:i.any.isRequired,extra:i.node,storageKey:i.string,stores:i.arrayOf(i.shape({name:i.string.isRequired,url:i.string.isRequired}))};gn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Zi=F.div`
169
+ `;function gn({onChange:t,loading:o,children:s,extra:a,stores:n,storageKey:r}){const{t:m}=z(),{info:l,inService:u}=K(),{blocklet:g}=oe(),[f,p]=h.useState(!1),S=h.useRef(null),[d,R]=h.useState(),[C,x]=Ci(r||"tmp"),[b,c]=r?[C,x]:[d,R],{storeList:v,teamDid:j}=xo({fromBlocklet:u,blocklet:g,nodeInfo:l}),T=So([...n.map(B=>({...B,protected:!0})),...v],"url"),I=b&&T.find(B=>b===B.url)||T[0];return e.jsxs(e.Fragment,{children:[e.jsxs(Zi,{children:[e.jsx(ne,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:e.jsx(yi,{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(Q,{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:B=>{const L=B.target.value;c(L.url),t(L)},SelectProps:{open:f,MenuProps:{anchorEl:S.current},renderValue:B=>B==null?void 0:B.name,onClose:()=>{p(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(B=>e.jsx(ge,{sx:{width:"400px",maxWidth:"90vw"},value:B,"data-cy":B.url,children:e.jsx(Vs,{teamDid:j,store:B,onDelete:()=>{var L;b===B.url&&c((L=T[0])==null?void 0:L.url)}})},B.url)),!Po.isInServerlessMode(l)&&e.jsx(qs,{disabled:o,storeList:T,teamDid:j,onAdd:B=>{c(B)}})]}),s({currentRegistry:I})]})}gn.propTypes={onChange:i.func,loading:i.bool,children:i.any.isRequired,extra:i.node,storageKey:i.string,stores:i.arrayOf(i.shape({name:i.string.isRequired,url:i.string.isRequired}))};gn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Zi=F.div`
170
170
  display: flex;
171
171
  justify-content: space-between;
172
172
  align-items: center;
@@ -177,7 +177,7 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
177
177
  color: ${t=>t.theme.palette.common.black};
178
178
  // font-weight: bold;
179
179
  }
180
- `;var xn={},Xi=Wt;Object.defineProperty(xn,"__esModule",{value:!0});var Bo=xn.default=void 0,$i=Xi(qt()),er=e;Bo=xn.default=(0,$i.default)((0,er.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const tr=(t,o)=>we(o,`/blocklets/${t.did}`),ao=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,nr=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function yn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let r=we(a,rs(t.did,t.logo||""));try{const C=new URL(r);C.searchParams.set("v",t.version||+new Date),r=C.href}catch{}const[m,l]=h.useState(!1),u=C=>C.currentTarget.contains(C.target)?!0:(C.preventDefault(),!1),g=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:f}=oe(),p=()=>((f==null?void 0:f.children)||[]).find(b=>b.meta.bundleDid===t.did).meta.version,d=(()=>{const C=((f==null?void 0:f.children)||[]).find(x=>x.meta.bundleDid===t.did);if(C){try{const x=C.meta.version,b=t.version;if(as.gt(b,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let R=n("blocklet.component.choose");return d==="upgrade"?R=n("blocklet.component.upgrade"):d==="disable"?R=n("blocklet.component.installed"):nr(t)&&(R=n("common.purchase")),e.jsx(yt,{href:tr(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(or,{title:ao({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:ao({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?r:"",version:t.version,button:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Hs,{children:e.jsxs(ne,{onClick:g,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}}),R]}):R,d==="upgrade"?e.jsx(Bo,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}yn.propTypes={blocklet:i.object.isRequired,blocklets:i.array,handleButtonClick:i.func,endpoint:i.string};yn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function Cn({handleButtonClick:t,handleSearchSelect:o,storeUrl:s,handleBlockletRender:a,extraFilter:n,serverVersion:r,resourceType:m,resourceDid:l,showResourcesSwitch:u,showCategory:g,...f}){const{locale:p}=z(),[S,d]=h.useState(!1),[R,C]=h.useState({}),x=c=>{C(c)},b=s;return h.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[b,m,l]),h.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(ss,{FallbackComponent:is,resetKeys:[b],children:e.jsx("div",{...f,children:S&&e.jsx(Ws,{showCategory:g,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:b};return a({...c,defaultRender:e.jsx(yn,{...v})})},baseSearch:!0,endpoint:b,locale:p,onFilterChange:x,onSearchSelect:o,filters:R,extraFilter:n,serverVersion:r,fetchCategoryDelay:500})})})}Cn.propTypes={storeUrl:i.string.isRequired,handleButtonClick:i.func,handleSearchSelect:i.func,handleBlockletRender:i.func,extraFilter:i.func,serverVersion:i.string,resourceType:i.string,resourceDid:i.string,showResourcesSwitch:i.bool,showCategory:i.bool};Cn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const or=F(Ks)`
180
+ `;var xn={},Xi=Wt;Object.defineProperty(xn,"__esModule",{value:!0});var Do=xn.default=void 0,$i=Xi(qt()),er=e;Do=xn.default=(0,$i.default)((0,er.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const tr=(t,o)=>we(o,`/blocklets/${t.did}`),ao=({blocklet:t,attribute:o,value:s})=>t._formatted?t._formatted[o]:s,nr=t=>t.inStore&&O.isFreeBlocklet(t)===!1;function yn({blocklet:t,blocklets:o,handleButtonClick:s,endpoint:a}){const{t:n}=z();let r=we(a,rs(t.did,t.logo||""));try{const C=new URL(r);C.searchParams.set("v",t.version||+new Date),r=C.href}catch{}const[m,l]=h.useState(!1),u=C=>C.currentTarget.contains(C.target)?!0:(C.preventDefault(),!1),g=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:f}=oe(),p=()=>((f==null?void 0:f.children)||[]).find(b=>b.meta.bundleDid===t.did).meta.version,d=(()=>{const C=((f==null?void 0:f.children)||[]).find(x=>x.meta.bundleDid===t.did);if(C){try{const x=C.meta.version,b=t.version;if(as.gt(b,x))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let R=n("blocklet.component.choose");return d==="upgrade"?R=n("blocklet.component.upgrade"):d==="disable"?R=n("blocklet.component.installed"):nr(t)&&(R=n("common.purchase")),e.jsx(yt,{href:tr(t,a),style:{color:"initial",textDecoration:"none"},onClick:u,target:"_blank",children:e.jsx(or,{title:ao({blocklet:t,attribute:"title",value:t.title||t.name}),did:t.did,description:ao({blocklet:t,attribute:"description",value:t.description}),cover:t.logo?r:"",version:t.version,button:e.jsx("div",{style:{display:"flex",alignItems:"center"},children:e.jsx(Hs,{children:e.jsxs(ne,{onClick:g,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}}),R]}):R,d==="upgrade"?e.jsx(Do,{style:{fontSize:"1.2rem"}}):null]},t.did)})})})})}yn.propTypes={blocklet:i.object.isRequired,blocklets:i.array,handleButtonClick:i.func,endpoint:i.string};yn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[]};function Cn({handleButtonClick:t,handleSearchSelect:o,storeUrl:s,handleBlockletRender:a,extraFilter:n,serverVersion:r,resourceType:m,resourceDid:l,showResourcesSwitch:u,showCategory:g,...f}){const{locale:p}=z(),[S,d]=h.useState(!1),[R,C]=h.useState({}),x=c=>{C(c)},b=s;return h.useEffect(()=>{C({showResources:!0,resourceType:m,resourceDid:l})},[b,m,l]),h.useEffect(()=>{d(!0),C({showResources:!0,resourceType:m,resourceDid:l})},[]),e.jsx(ss,{FallbackComponent:is,resetKeys:[b],children:e.jsx("div",{...f,children:S&&e.jsx(Ws,{showCategory:g,showResourcesSwitch:u,blockletRender:c=>{const v={...c,handleButtonClick:t,endpoint:b};return a({...c,defaultRender:e.jsx(yn,{...v})})},baseSearch:!0,endpoint:b,locale:p,onFilterChange:x,onSearchSelect:o,filters:R,extraFilter:n,serverVersion:r,fetchCategoryDelay:500})})})}Cn.propTypes={storeUrl:i.string.isRequired,handleButtonClick:i.func,handleSearchSelect:i.func,handleBlockletRender:i.func,extraFilter:i.func,serverVersion:i.string,resourceType:i.string,resourceDid:i.string,showResourcesSwitch:i.bool,showCategory:i.bool};Cn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const or=F(Ks)`
181
181
  .ms-highlight {
182
182
  color: ${t=>t.theme.palette.primary.main};
183
183
  }
@@ -317,7 +317,7 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
317
317
  & .connect {
318
318
  background: white;
319
319
  }
320
- `,rr=jn,ar=t=>t.inStore&&O.isFreeBlocklet(t)===!1,lr=t=>{var o;return[J.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,J.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=t==null?void 0:t.capabilities)==null?void 0:o.didSpace)},Mt=t=>{var o,s;return((s=(o=t==null?void 0:t.configs)==null?void 0:o.find(a=>a.key===J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:s.value)||null},cr=t=>(t.environments||[]).some(o=>o.required),co=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),dr=({params:t,blocklet:o,t:s})=>{const a=t.title||t.name;return a?((o==null?void 0:o.children)||[]).find(r=>r.meta.bundleDid===t.bundleDid)?s("blocklet.component.upgradeNext",{name:a}):s("blocklet.component.addNext",{name:a}):s("common.next")},po=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function vn({onClose:t,mode:o,stores:s,resourceType:a,resourceDid:n,storageKey:r,inDialog:m,selectedMeta:l,storeUrl:u,showResourcesSwitch:g,showFromUrl:f,enableRunBackground:p,showCategory:S}){var On,Mn,Fn,$e,Gn,et,zn;const{t:d,locale:R}=z(),[C,x]=h.useState(!1),[b,c]=h.useState(null),[v,j]=h.useState(""),[T,I]=h.useState(""),{api:D,ws:{useSubscription:L},inService:k,info:M}=K(),{blocklet:B,actions:{refreshBlocklet:_}}=oe(),[Z,Ie]=h.useState(null),[te,de]=h.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]=h.useState(Se),[me,Ze]=h.useState(0),V=h.useRef({}),w=h.useRef({}),q=h.useRef({}),se=Ht(E=>E.breakpoints.down("md")),xe=cs(),[ie,Ge]=h.useState(!0),{meta:Y}=V.current,H=E=>ke(N=>({...N,...E}));h.useEffect(()=>{if(P.pathPrefix){const{errMsg:E}=Ln({...P,pathPrefix:P.pathPrefix,locale:R});j(E)}},[P.pathPrefix]),h.useEffect(()=>{me===0&&ke(Se)},[me]);const Re=()=>{const E=Mt(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 An(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(J.BlockletEvents.statusChange,Tt(E=>{switch(E.status){case J.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:ze(),subTitle:d("blocklet.component.installSuccessTip")}}),po({componentDid:xe.componentDid});break}const N=Mt(B);H(G=>({...G,didSpaceEndpoint:N}))}),[(On=B==null?void 0:B.meta)==null?void 0:On.did]),L(J.BlockletEvents.downloadFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Mn=B==null?void 0:B.meta)==null?void 0:Mn.did]),L(J.BlockletEvents.installFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Fn=B==null?void 0:B.meta)==null?void 0:Fn.did]);const pe=[],wt=()=>{x(!1),ke({}),V.current={},t()},Xe=E=>((B==null?void 0:B.children)||[]).some(N=>N.meta.did===E),An=async E=>{var Be,Ne;const{pathPrefix:N,bundleDid:G,title:W,componentName:be="",componentDid:De=""}=P,Ee=((Be=V.current)==null?void 0:Be.meta)||{},{configs:ye=[],registryUrl:je,inStore:Ve,inputUrl:qe,dist:It}=Ee,We=(Ne=V.current)==null?void 0:Ne.downloadTokenList,le=Ve?Kn(je,G,It):qe;x(!0);const tt={rootDid:B.meta.did,url:le,mountPoint:N?ue(N):`/${ue(Ee.title||Ee.name)}`,title:W,name:be,did:De,onlyRequired:!ie,...P.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:P.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await D.installComponent({input:tt}),je){const{teamDid:he,storeList:Ae}=xo({fromBlocklet:k,nodeInfo:M,blocklet:B}),{isNew:kt,decoded:nt}=us(je,Ae);kt&&await D.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),_({showError:!1,attachRuntimeInfo:!1})}catch(he){const Ae=X(he);A.error(Ae),console.error("installComponent error: ",he),Ue(Ae)}finally{x(!1),V.current.installInput=tt}},Ln=E=>({errMsg:Ro({params:{...E,did:E.bundleDid},blocklets:[B],blocklet:B,locale:R})}),fe=async E=>{var G,W;const{errMsg:N}=Ln({...P,locale:R});j(N),me===pe.length-2&&await An(E),(W=(G=w.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,be=>be+1)},_e=()=>{var E,N;(N=(E=w.current)==null?void 0:E.setActiveStepByIndex)==null||N.call(E,G=>G-1)},Mo=()=>{const{pathPrefix:E,bundleDid:N,title:G,componentName:W="",componentDid:be=""}=P,{meta:De={}}=V.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:Ve}=De,qe=ye?Kn(Ee,N,Ve):je;Ie({meta:De,installOpts:{type:"component",rootDid:B.meta.did,mountPoint:E,url:qe,title:G,name:W,did:be}})},Fo=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")})}})},Go=({downloadTokenList:E})=>{V.current.downloadTokenList=E,de(!1),fe()},Pt=({chooseParams:E=V.current,componentDid:N,isInit:G=!1})=>{var nt,_n,Vn,qn;const{meta:W,registryUrl:be,inStore:De,inputUrl:Ee}=E,{did:ye,title:je,name:Ve}=W,qe=(((nt=B.settings)==null?void 0:nt.children)||[]).filter(ce=>ce.status==="deleted"&&ce.meta.bundleDid===ye),It=N||"",We=(_n=W.environments)==null?void 0:_n.map(ce=>{const{name:Ut,validation:ot,...st}=ce,Dt={validation:ds(ot)?"":ot};return{...st,key:Ut,...Dt}});V.current={...E,meta:{...W,configs:We,registryUrl:be,inStore:De,inputUrl:Ee}};let le={};if(G){const ce=[B],Ut=We||[],ot=[],st=So(ps([...Ut,...ot]),"key").filter(Le=>!!Le.key).sort((Le,it)=>Le.required&&!it.required?-1:it.required&&!Le.required?1:0),Dt=O.getSharedConfigObj(ce[0],{configs:st}),Bt={},Wn=st.map(Le=>{const{default:it,key:rt,..._o}=Le;return Bt[rt]=Dt[rt]||it,{..._o,key:rt,hidden:!!J.BLOCKLET_CONFIGURABLE_KEY[rt]}});le={...le,configsList:Wn,configsValue:Bt,hasMissRequiredConfigs:co(Wn,Bt)}}const tt=B.children.some(ce=>ce.mountPoint==="/"),Be=qe.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:((qn=(Vn=V.current.meta)==null?void 0:Vn.environments)==null?void 0:qn.length)>0};const he=ar(V.current.meta),Ae=lr(V.current.meta),kt=Mt(B);H({bundleDid:ye,componentDid:It,...le,hasRequiredEnvironments:cr(V.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Ae,didSpaceEndpoint:kt}),G&&he&&Mo()};h.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:[f&&P.showFromUrlDialog&&e.jsx(di,{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(gn,{stores:s,extra:Po.isInServerlessMode(M)?null:f?e.jsxs(ne,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{H({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Zt,{style:{fontSize:20,marginRight:4}})," ",d("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:C,onChange:()=>{ke({}),V.current={}},storageKey:r,children:({currentRegistry:E})=>e.jsx(Cn,{showResourcesSwitch:g,showCategory:S,serverVersion:M==null?void 0:M.version,style:se?{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(ur,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(go,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:dr({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(vo,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(Is,{meta:Y,onClickNext:fe,installRelated:ie,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:_e,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:[!(((Gn=($e=q.current)==null?void 0:$e.getCurrentStep)==null?void 0:Gn.call($e))===2||te)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(P.purchaseResultProps)?Z&&e.jsx(qi,{ref:q,meta:Z.meta,mode:P.componentDid?"verify":"both",onCancel:Fo,installOpts:Z.installOpts,handlePaySuccess:Go}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Xn,{...P.purchaseResultProps})})]}),disabled:((zn=(et=q.current)==null?void 0:et.getCurrentStep)==null?void 0:zn.call(et))===2||te,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof q.current.onNext=="function"&&(q.current.onNext(),de(!0))},onCancel:()=>{_e()}}),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(Q,{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:_e,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:!!b||(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(an,{style:{marginTop:-12,width:"100%"},schema:P.configsList,defaultValue:P.configsValue,onChange:(E,{action:N,currentItem:G,allValues:W})=>{N==="confirm"&&H({hasMissRequiredConfigs:co(P.configsList,W),configsValue:W}),N==="edit"?c(G):["cancel","confirm"].includes(N)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:_e,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(en,{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(hn,{blockletMeta:V.current.meta,onNext:()=>{fe()},onEndpointUpdate:Re})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:_e,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(mr,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Xn,{...P.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{po({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]||{},zo=()=>C||ae.error||!P.bundleDid?!0:me>1?!P.pathPrefix:!1;return B?e.jsxs(pr,{sx:{width:"100%",height:se?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx($s,{steps:pe,mode:"memory",children:e.jsx(rr,{ref:w,meta:Y,isMobile:se,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:zo()),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}vn.propTypes={onClose:i.func,mode:i.oneOf(["normal","embed"]),inDialog:i.bool,stores:i.arrayOf(i.string),storeUrl:i.string,resourceType:i.string,resourceDid:i.string,storageKey:i.string,selectedMeta:i.object,showResourcesSwitch:i.bool,showFromUrl:i.bool,enableRunBackground:i.bool,showCategory:i.bool};vn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const pr=F(y)`
320
+ `,rr=jn,ar=t=>t.inStore&&O.isFreeBlocklet(t)===!1,lr=t=>{var o;return[J.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,J.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=t==null?void 0:t.capabilities)==null?void 0:o.didSpace)},Mt=t=>{var o,s;return((s=(o=t==null?void 0:t.configs)==null?void 0:o.find(a=>a.key===J.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:s.value)||null},cr=t=>(t.environments||[]).some(o=>o.required),co=(t,o)=>t==null?void 0:t.some(s=>s.required&&!o[s.key]),dr=({params:t,blocklet:o,t:s})=>{const a=t.title||t.name;return a?((o==null?void 0:o.children)||[]).find(r=>r.meta.bundleDid===t.bundleDid)?s("blocklet.component.upgradeNext",{name:a}):s("blocklet.component.addNext",{name:a}):s("common.next")},po=({componentDid:t,timeout:o=1e3,manual:s=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:t,manual:s},"*")},o)};function vn({onClose:t,mode:o,stores:s,resourceType:a,resourceDid:n,storageKey:r,inDialog:m,selectedMeta:l,storeUrl:u,showResourcesSwitch:g,showFromUrl:f,enableRunBackground:p,showCategory:S}){var On,Mn,Fn,$e,Gn,et,zn;const{t:d,locale:R}=z(),[C,x]=h.useState(!1),[b,c]=h.useState(null),[v,j]=h.useState(""),[T,I]=h.useState(""),{api:B,ws:{useSubscription:L},inService:k,info:M}=K(),{blocklet:D,actions:{refreshBlocklet:_}}=oe(),[Z,Ie]=h.useState(null),[te,de]=h.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]=h.useState(Se),[me,Ze]=h.useState(0),V=h.useRef({}),w=h.useRef({}),q=h.useRef({}),se=Ht(E=>E.breakpoints.down("md")),xe=cs(),[ie,Ge]=h.useState(!0),{meta:Y}=V.current,H=E=>ke(N=>({...N,...E}));h.useEffect(()=>{if(P.pathPrefix){const{errMsg:E}=Ln({...P,pathPrefix:P.pathPrefix,locale:R});j(E)}},[P.pathPrefix]),h.useEffect(()=>{me===0&&ke(Se)},[me]);const Re=()=>{const E=Mt(D)??"";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 An(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=D==null?void 0:D.meta)==null?void 0:W.did)&&E(N)};L(J.BlockletEvents.statusChange,Tt(E=>{switch(E.status){case J.BlockletStatus.upgrading:H({installResultProps:{variant:"success",title:ze(),subTitle:d("blocklet.component.installSuccessTip")}}),po({componentDid:xe.componentDid});break}const N=Mt(D);H(G=>({...G,didSpaceEndpoint:N}))}),[(On=D==null?void 0:D.meta)==null?void 0:On.did]),L(J.BlockletEvents.downloadFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Mn=D==null?void 0:D.meta)==null?void 0:Mn.did]),L(J.BlockletEvents.installFailed,Tt(()=>{Ue(d("blocklet.component.installComponentError"))}),[(Fn=D==null?void 0:D.meta)==null?void 0:Fn.did]);const pe=[],wt=()=>{x(!1),ke({}),V.current={},t()},Xe=E=>((D==null?void 0:D.children)||[]).some(N=>N.meta.did===E),An=async E=>{var De,Ne;const{pathPrefix:N,bundleDid:G,title:W,componentName:be="",componentDid:Be=""}=P,Ee=((De=V.current)==null?void 0:De.meta)||{},{configs:ye=[],registryUrl:je,inStore:Ve,inputUrl:qe,dist:It}=Ee,We=(Ne=V.current)==null?void 0:Ne.downloadTokenList,le=Ve?Kn(je,G,It):qe;x(!0);const tt={rootDid:D.meta.did,url:le,mountPoint:N?ue(N):`/${ue(Ee.title||Ee.name)}`,title:W,name:be,did:Be,onlyRequired:!ie,...P.hasEnvironmentsStep&&ye.length>0?{configs:ye.map(he=>({...he,value:P.configsValue[he.key]||""}))}:{},...We?{downloadTokenList:We}:{},...E};try{if(await B.installComponent({input:tt}),je){const{teamDid:he,storeList:Ae}=xo({fromBlocklet:k,nodeInfo:M,blocklet:D}),{isNew:kt,decoded:nt}=us(je,Ae);kt&&await B.addBlockletStore({input:{teamDid:he,url:nt}})}H({installResultProps:{}}),_({showError:!1,attachRuntimeInfo:!1})}catch(he){const Ae=X(he);A.error(Ae),console.error("installComponent error: ",he),Ue(Ae)}finally{x(!1),V.current.installInput=tt}},Ln=E=>({errMsg:Ro({params:{...E,did:E.bundleDid},blocklets:[D],blocklet:D,locale:R})}),fe=async E=>{var G,W;const{errMsg:N}=Ln({...P,locale:R});j(N),me===pe.length-2&&await An(E),(W=(G=w.current)==null?void 0:G.setActiveStepByIndex)==null||W.call(G,be=>be+1)},_e=()=>{var E,N;(N=(E=w.current)==null?void 0:E.setActiveStepByIndex)==null||N.call(E,G=>G-1)},Mo=()=>{const{pathPrefix:E,bundleDid:N,title:G,componentName:W="",componentDid:be=""}=P,{meta:Be={}}=V.current||{},{registryUrl:Ee,inStore:ye,inputUrl:je,dist:Ve}=Be,qe=ye?Kn(Ee,N,Ve):je;Ie({meta:Be,installOpts:{type:"component",rootDid:D.meta.did,mountPoint:E,url:qe,title:G,name:W,did:be}})},Fo=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")})}})},Go=({downloadTokenList:E})=>{V.current.downloadTokenList=E,de(!1),fe()},Pt=({chooseParams:E=V.current,componentDid:N,isInit:G=!1})=>{var nt,_n,Vn,qn;const{meta:W,registryUrl:be,inStore:Be,inputUrl:Ee}=E,{did:ye,title:je,name:Ve}=W,qe=(((nt=D.settings)==null?void 0:nt.children)||[]).filter(ce=>ce.status==="deleted"&&ce.meta.bundleDid===ye),It=N||"",We=(_n=W.environments)==null?void 0:_n.map(ce=>{const{name:Ut,validation:ot,...st}=ce,Bt={validation:ds(ot)?"":ot};return{...st,key:Ut,...Bt}});V.current={...E,meta:{...W,configs:We,registryUrl:be,inStore:Be,inputUrl:Ee}};let le={};if(G){const ce=[D],Ut=We||[],ot=[],st=So(ps([...Ut,...ot]),"key").filter(Le=>!!Le.key).sort((Le,it)=>Le.required&&!it.required?-1:it.required&&!Le.required?1:0),Bt=O.getSharedConfigObj(ce[0],{configs:st}),Dt={},Wn=st.map(Le=>{const{default:it,key:rt,..._o}=Le;return Dt[rt]=Bt[rt]||it,{..._o,key:rt,hidden:!!J.BLOCKLET_CONFIGURABLE_KEY[rt]}});le={...le,configsList:Wn,configsValue:Dt,hasMissRequiredConfigs:co(Wn,Dt)}}const tt=D.children.some(ce=>ce.mountPoint==="/"),De=qe.find(ce=>ce.meta.bundleDid===ye),Ne=D.children.find(ce=>ce.meta.bundleDid===ye);le.title=je||"",De?le={...le,pathPrefix:De.mountPoint||"",componentName:De.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:((qn=(Vn=V.current.meta)==null?void 0:Vn.environments)==null?void 0:qn.length)>0};const he=ar(V.current.meta),Ae=lr(V.current.meta),kt=Mt(D);H({bundleDid:ye,componentDid:It,...le,hasRequiredEnvironments:cr(V.current.meta),requirePurchase:he,didSpaceIsRequiredSetup:Ae,didSpaceEndpoint:kt}),G&&he&&Mo()};h.useEffect(()=>{!l||me!==0||!D||(Pt({chooseParams:{blocklets:[l],meta:l,registryUrl:u||l.homepage,inStore:!0},isInit:!0}),H({showFromUrlDialog:!1}),fe())},[l,me,D]),pe.push({key:"selectComponent",name:d("blocklet.component.selectComponent"),body:e.jsxs(Te,{sx:{width:400},component:"div",children:[f&&P.showFromUrlDialog&&e.jsx(di,{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(gn,{stores:s,extra:Po.isInServerlessMode(M)?null:f?e.jsxs(ne,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{H({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[e.jsx(Zt,{style:{fontSize:20,marginRight:4}})," ",d("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:C,onChange:()=>{ke({}),V.current={}},storageKey:r,children:({currentRegistry:E})=>e.jsx(Cn,{showResourcesSwitch:g,showCategory:S,serverVersion:M==null?void 0:M.version,style:se?{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(ur,{children:[W&&e.jsx("div",{className:"check-container",children:e.jsx(go,{className:"check-icon"})}),e.jsx("div",{className:W?"choose-blocklet":"",style:{marginLeft:16},children:G})]})}})})]}),cancel:o==="embed"?void 0:d("common.cancel"),confirm:dr({params:P,blocklet:D,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(vo,{title:d("launchBlocklet.introduction"),subTitle:d("blocklet.component.addComponentTip.introduction")}),e.jsx(Is,{meta:Y,onClickNext:fe,installRelated:ie,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:_e,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:[!(((Gn=($e=q.current)==null?void 0:$e.getCurrentStep)==null?void 0:Gn.call($e))===2||te)&&e.jsx(lt,{title:d("common.verifyNFT"),subTitle:d("blocklet.component.addComponentTip.verifyNFT")}),He(P.purchaseResultProps)?Z&&e.jsx(qi,{ref:q,meta:Z.meta,mode:P.componentDid?"verify":"both",onCancel:Fo,installOpts:Z.installOpts,handlePaySuccess:Go}):e.jsx("div",{className:"flex-align-center flex-justify-center",children:e.jsx(Xn,{...P.purchaseResultProps})})]}),disabled:((zn=(et=q.current)==null?void 0:et.getCurrentStep)==null?void 0:zn.call(et))===2||te,cancel:d("common.pre"),confirm:d("common.next"),onConfirm:()=>{typeof q.current.onNext=="function"&&(q.current.onNext(),de(!0))},onCancel:()=>{_e()}}),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(Q,{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:_e,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:!!b||(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(an,{style:{marginTop:-12,width:"100%"},schema:P.configsList,defaultValue:P.configsValue,onChange:(E,{action:N,currentItem:G,allValues:W})=>{N==="confirm"&&H({hasMissRequiredConfigs:co(P.configsList,W),configsValue:W}),N==="edit"?c(G):["cancel","confirm"].includes(N)&&c(null)}})]}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:_e,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(en,{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(hn,{blockletMeta:V.current.meta,onNext:()=>{fe()},onEndpointUpdate:Re})})]})}),cancel:d("common.pre"),confirm:d("common.next"),onCancel:_e,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(mr,{children:d(p?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):e.jsx("div",{style:{marginTop:120},children:e.jsx(Xn,{...P.installResultProps})})}),confirm:d("common.complete"),onConfirm:()=>{po({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]||{},zo=()=>C||ae.error||!P.bundleDid?!0:me>1?!P.pathPrefix:!1;return D?e.jsxs(pr,{sx:{width:"100%",height:se?window.innerHeight:m?"72vh":"100vh"},children:[e.jsx($s,{steps:pe,mode:"memory",children:e.jsx(rr,{ref:w,meta:Y,isMobile:se,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:zo()),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}vn.propTypes={onClose:i.func,mode:i.oneOf(["normal","embed"]),inDialog:i.bool,stores:i.arrayOf(i.string),storeUrl:i.string,resourceType:i.string,resourceDid:i.string,storageKey:i.string,selectedMeta:i.object,showResourcesSwitch:i.bool,showFromUrl:i.bool,enableRunBackground:i.bool,showCategory:i.bool};vn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const pr=F(y)`
321
321
  .action-bar {
322
322
  display: flex;
323
323
  justify-content: flex-end;
@@ -389,11 +389,11 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
389
389
  `;function St({blocklet:t,showDialog:o,setShowDialog:s,selectedMeta:a}){const{t:n}=z(),r=Ht(u=>u.breakpoints.down("md")),{inService:m}=K(),l=()=>{s(!1)};return o?e.jsx(fr,{title:n("blocklet.component.addWithName",{name:O.getDisplayName(t)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:r?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(u,g)=>{g!=="backdropClick"&&l()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:e.jsx(vn,{selectedMeta:a,onClose:l,storageKey:m?Ys:Js})}):null}St.propTypes={selectedMeta:i.object,showDialog:i.bool.isRequired,setShowDialog:i.func.isRequired,blocklet:i.object.isRequired};St.defaultProps={selectedMeta:null};const fr=F(xt)`
390
390
  .MuiDialogContent-root {
391
391
  }
392
- `;function Sn({blocklet:t,children:o}){const{t:s}=z(),[a,n]=h.useState(!1),r=m=>{m.stopPropagation(),n(!0)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({open:r}):e.jsxs(ge,{onClick:r,className:"component-action","data-cy":"action-add-component",children:[e.jsx(Zt,{style:{fontSize:18,marginRight:5}}),s("blocklet.component.add")]}),e.jsx(St,{showDialog:a,setShowDialog:n,blocklet:t})]})}Sn.propTypes={children:i.any,blocklet:i.object.isRequired};Sn.defaultProps={children:null};const hr=t=>t.children.filter(o=>o.meta.interfaces.find(s=>s.type===J.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:t,setParams:o,setError:s,serviceTypes:a}){const{t:n}=z(),{blocklet:r}=oe(),m=r.meta.did,l=hr(r),[u,g]=h.useState([]),f={301:n("common.redirectPermanently"),302:n("common.redirectTemporary"),307:n("common.redirectTemporary"),308:n("common.redirectPermanently")};return h.useEffect(()=>{if(t.type===U.ROUTING_RULE_TYPES.COMPONENT&&t.componentId){const p=l.find(R=>R.meta.did===t.componentId),S=O.findWebInterface(p.meta),d=(Array.isArray(S==null?void 0:S.pageGroups)?S.pageGroups:[]).map(R=>({value:R,label:`${R} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),g(d),t.pageGroup&&d.find(R=>R.value===t.pageGroup)===!1&&o({...t,pageGroups:""})}},[t.componentId,t.type]),e.jsxs(e.Fragment,{children:[e.jsx(Q,{select:!0,label:n("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:t.type,onChange:p=>{s(""),o({...t,type:p.target.value,did:p.target.value===U.ROUTING_RULE_TYPES.BLOCKLET?m:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:p,value:S})=>e.jsx(ge,{value:S,children:p},S))}),t.type===U.ROUTING_RULE_TYPES.REDIRECT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:t.redirectCode,onChange:p=>o({...t,redirectCode:p.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(f).map(p=>e.jsx(ge,{value:p,children:`${f[p]} - ${p}`},p))},"redirectCode"),e.jsx(Q,{label:n("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{o({...t,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?s(""):s(n("router.validation.redirectUrlRequired"))}},"redirectUrl")],t.type===U.ROUTING_RULE_TYPES.COMPONENT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:t.componentId,onChange:p=>{o({...t,componentId:p.target.value})},style:{marginBottom:32},SelectProps:{},children:l.map(p=>e.jsx(ge,{value:p.meta.did,selected:p.meta.did===t.componentId,children:O.getDisplayName(p,!0)},p.meta.did))},"componentId"),u.length?e.jsx(Q,{select:!0,label:n("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:t.pageGroup,helperText:n("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{o({...t,pageGroup:p.target.value})},SelectProps:{},children:u.map(p=>e.jsx(ge,{value:p.value,selected:p.value===t.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),t.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(Q,{label:n("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,url:p.target.value,__disableConfirm:!S}),s(S?"":n("router.validation.rewriteUrlRequired"))}},"url"),t.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[e.jsx(Q,{select:!0,label:n("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:t.responseType,onChange:p=>o({...t,responseType:p.target.value}),style:{marginBottom:32},SelectProps:{},children:U.ROUTING_RESPONSE_TYPES.map(p=>e.jsx(ge,{value:p.value,children:p.text},p.value))},"responseType"),e.jsx(Q,{label:n("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:t.responseBody,helperText:n("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,responseBody:p.target.value,__disableConfirm:!S}),s(S?"":n("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:i.object,serviceTypes:i.array,setParams:i.func,setError:i.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:U.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:U.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:U.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:U.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:U.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function Rn({children:t,hiddenChildren:o,open:s,onClose:a}){const{t:n}=z(),{api:r}=K(),{blocklet:m}=oe(),[l,u]=h.useState(!1),[g,f]=h.useState(!1),p=m.meta.did,S=m.site.id,d=()=>{a==null||a(),u(!1),f(!1)},R=async c=>{try{const v=await ut(c,n);if(v)throw v;u(!0);const j={from:{pathPrefix:ue(c.pathPrefix)},to:{type:c.type}};c.type===U.ROUTING_RULE_TYPES.REDIRECT&&(j.to.url=c.url.trim(),j.to.redirectCode=c.redirectCode),c.type===U.ROUTING_RULE_TYPES.COMPONENT&&(j.to.did=p,j.to.componentId=c.componentId,j.to.pageGroup=c.pageGroup),c.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(j.to.url=ue(c.url)),c.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(j.to.response={status:200,contentType:c.responseType,body:c.responseBody}),await r.addRoutingRule({input:{id:S,rule:j,teamDid:p}})}catch(v){A.error(v.message)}finally{u(!1),f(!1)}},C={title:n("router.rule.add.title"),description:(c,v,j)=>{const T=I=>{if(j(null),ut(I,n)){v({...I,__disableConfirm:!0});return}v({...I})};return e.jsxs(ee,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:c.pathPrefixHint||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:c.pathPrefix,onChange:I=>{let D=!1;const L=Ro({params:{...c,pathPrefix:I.target.value},blocklets:[m]});j(L),c.type===U.ROUTING_RULE_TYPES.BLOCKLET&&L&&(D=!0),c.type===U.ROUTING_RULE_TYPES.REDIRECT&&!c.url&&(D=!0),c.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!c.url&&(D=!0),c.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!c.responseType||!c.responseBody)&&(D=!0),I.target.value.trim()||(D=!0,j(n("router.validation.pathPrefixRequired"))),D||j("");const k=n("common.slugifyHint",{value:gt(I.target.value)});v({...c,pathPrefix:I.target.value,pathPrefixHint:k,__disableConfirm:D})}}),e.jsx(Rt,{params:c,setParams:T,setError:j})]})},confirm:n("router.rule.add.confirm"),cancel:n("common.cancel"),params:{did:"",pathPrefix:"",type:U.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:R,onCancel:d},x=c=>{c.stopPropagation(),f(!0)};let b=null;return o||(b=typeof t=="function"?t({open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-add-rule",children:[l?e.jsx(re,{size:16}):e.jsx(Zt,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[b,(s||g)&&e.jsx(Fe,{title:C.title,description:C.description,confirm:C.confirm,cancel:C.cancel,params:C.params,onConfirm:C.onConfirm,onCancel:C.onCancel,color:"primary"})]})}Rn.propTypes={children:i.any,onClose:i.func,hiddenChildren:i.bool,open:i.bool};Rn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function bn({id:t,from:o,children:s}){const{t:a}=z(),{api:n}=K(),{blocklet:r}=oe(),[m,l]=h.useState(!1),[u,g]=h.useState(null),f=r.meta.did,p=r.site.id,S=o.pathPrefix,d=()=>{l(!1),g(null)},R=async()=>{l(!0);try{await n.deleteRoutingRule({input:{id:p,ruleId:t,teamDid:f}})}catch(b){A.error(b.message)}finally{g(null),l(!1)}},C={keyName:S,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${S}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:S}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:R,onCancel:d},x=b=>{b.stopPropagation(),g(C)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({loading:m,open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-delete-rule",children:[m?e.jsx(re,{size:16}):e.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),u&&e.jsx(vi,{keyName:u.keyName,title:u.title,description:u.description,confirmPlaceholder:u.confirmPlaceholder,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}bn.propTypes={id:i.string.isRequired,from:i.object.isRequired,children:i.any};bn.defaultProps={children:null};function En({id:t,from:o,to:s,children:a}){var c,v;const{t:n}=z(),{api:r}=K(),{blocklet:m}=oe(),[l,u]=h.useState(!1),[g,f]=h.useState(null),p=m.meta.did,S=m.site.id,d=o.pathPrefix,R=()=>{u(!1),f(null)},C=async j=>{try{const T=await ut(j,n);if(T)throw T;u(!0);const I={id:t,from:{pathPrefix:ue(j.pathPrefix)},to:{type:j.type}};j.type===U.ROUTING_RULE_TYPES.REDIRECT&&(I.to.url=j.url,I.to.redirectCode=j.redirectCode),j.type===U.ROUTING_RULE_TYPES.COMPONENT&&(I.to.did=p,I.to.componentId=j.componentId,I.to.pageGroup=j.pageGroup),j.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(I.to.url=ue(j.url)),j.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(I.to.response={status:200,contentType:j.responseType,body:j.responseBody}),await r.updateRoutingRule({input:{id:S,rule:I,teamDid:p}})}catch(T){A.error(T.message)}finally{u(!1),f(null)}},x={title:n("router.rule.update.title"),description:(j,T,I)=>{const D=L=>{if(ut(L,n)){T({...L,__disableConfirm:!0});return}T({...L})};return e.jsxs(ee,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:j.helperText||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:j.pathPrefix,onChange:L=>{let k=!1;j.type===U.ROUTING_RULE_TYPES.REDIRECT&&!j.url&&(k=!0),j.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!j.url&&(k=!0),j.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!j.responseType||!j.responseBody)&&(k=!0),L.target.value.trim()||(k=!0,I(n("router.validation.pathPrefixRequired"))),k||I("");const M=n("common.slugifyHint",{value:gt(L.target.value)});T({...j,pathPrefix:L.target.value,helperText:M,__disableConfirm:k})}}),e.jsx(Rt,{params:j,setParams:D,setError:I})]})},confirm:n("router.rule.update.confirm"),cancel:n("router.rule.update.cancel"),color:"primary",params:{did:s.did||"",pathPrefix:d==="/"?d:d.replace(/^\/+/,"").replace(/\/+$/,""),type:s.type||U.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:s.redirectCode||302,componentId:s.componentId||"",pageGroup:s.pageGroup||"",url:s.url||"",responseType:((c=s.response)==null?void 0:c.contentType)||"",responseBody:(((v=s.response)==null?void 0:v.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:C,onCancel:R},b=j=>{j.stopPropagation(),f(x)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:l,open:b}):e.jsxs(ge,{onClick:b,className:"rule-action","data-cy":"action-update-rule",children:[l?e.jsx(re,{size:16}):e.jsx(jo,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),g&&e.jsx(Fe,{title:g.title,description:g.description,confirm:g.confirm,color:g.color,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}En.propTypes={id:i.string.isRequired,from:i.object.isRequired,to:i.object.isRequired,children:i.any};En.defaultProps={children:null};function Tn(t){const{locale:o}=z(),{blocklet:s,recommendedDomain:a}=oe(),n=yo(a,t.from.pathPrefix,Kt(s,o));return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:n,rel:"noopener noreferrer",title:n,children:e.jsx($,{size:"small",children:e.jsx(bo,{})})}),e.jsx(En,{...t,children:({open:r})=>e.jsx($,{size:"small",onClick:r,disabled:t.isProtected,"data-cy":"action-update-rule",children:e.jsx(Yt,{})})}),e.jsx(bn,{...t,children:({open:r})=>e.jsx($,{size:"small",onClick:r,disabled:t.isProtected,"data-cy":"action-delete-rule",children:e.jsx(Ct,{})})})]})}Tn.propTypes={isProtected:i.bool};Tn.defaultProps={isProtected:!1};function No({group:t,...o}){return t?e.jsx(Qe,{type:"reverse",...o,children:t}):null}No.propTypes={group:i.string.isRequired};function ft({domain:t,isHttps:o,toUrl:s}){const a=o?"https":"http";let n=s;return hs(n)||(n=`${a}://${t}${s}`),e.jsx(yt,{href:n,target:"_blank",style:{fontSize:14},underline:"hover",children:s},n)}ft.propTypes={domain:i.string.isRequired,toUrl:i.string.isRequired,isHttps:i.bool};ft.defaultProps={isHttps:!1};function bt({hasPermission:t}){const{t:o,locale:s}=z(),a=fo(),{blocklet:n,recommendedDomain:r}=oe();return n.site.rules.filter(l=>l.to.type!==U.ROUTING_RULE_TYPES.BLOCKLET).map(l=>{var p;let u=null,g=null;l.to.type===U.ROUTING_RULE_TYPES.NONE?u="404":l.to.type===U.ROUTING_RULE_TYPES.REDIRECT?u=l.to.redirectCode:l.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE?u="R":l.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE?u=e.jsx(wi,{sx:{color:"text.secondary",fontSize:"45px"}}):l.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(g=n.children.find(S=>S.meta.did===l.to.componentId),u="C");const f=l.isProtected?e.jsx(ve,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:e.jsx("span",{children:e.jsx($,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:e.jsx(ji,{style:{fill:a.palette.text.disabled}})})})}):e.jsx(Tn,{...l});return[e.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(y,{className:"component-item__indent",width:28}),typeof u=="object"?u:e.jsx(ms,{children:u}),e.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[e.jsxs(y,{style:{color:"#222",fontSize:16},children:[l.to.type===U.ROUTING_RULE_TYPES.NONE&&o("common.page404"),l.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),l.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),l.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((p=U.ROUTING_RESPONSE_TYPES.find(S=>S.value===l.to.response.contentType))==null?void 0:p.text),l.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&O.getDisplayName(g,!0)]}),e.jsxs(y,{display:"flex",alignItems:"center",children:[l.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&e.jsx(ft,{domain:r,toUrl:l.to.url}),l.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(ft,{domain:r,toUrl:l.to.url}),l.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(No,{group:l.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(yt,{href:yo(r,l.from.pathPrefix,Kt(n,s)),target:"_blank",style:{fontSize:16},underline:"hover",children:fs(l.from.pathPrefix,"/")||"/"})},l.from.pathPrefix),e.jsx(y,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:f})},"actions")]},"rule"),e.jsx(Jt,{},"divider")]})}bt.propTypes={hasPermission:i.bool};bt.defaultProps={hasPermission:!1};const gr=Me(bt,"mutate_blocklets"),xr=Me(bt,"",Oe);function yr(t){const{inService:o}=K();return o?e.jsx(xr,{...t}):e.jsx(gr,{...t})}function Cr({blocklet:t,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const s=gs(),{t:a}=z(),n=h.useRef(null),r=h.useMemo(()=>{if(!t||!t.optionalComponents)return null;const m=new URLSearchParams(window.location.search),l=m.get("install-component");if(l){n.current=l,m.delete("install-component"),s(m.toString());const u=t.optionalComponents.find(f=>f.meta.did===l);if(!u)return A.success(a("notification.installComponentError",{did:l})),null;const{meta:g}=u;if(o){const f=document.getElementById(`optional-component-${l}`),p=document.querySelector(".dashboard-main");if(f){const S=f.getBoundingClientRect(),d=p.getBoundingClientRect();p.scrollTo({top:S.top-d.top+p.scrollTop,behavior:"smooth"})}}return g}return null},[t,s,a,o]);return h.useEffect(()=>{var m;n.current&&window.opener&&window.opener.postMessage({blocklet:t,kind:"component-installer"},(m=window.blocklet)==null?void 0:m.appUrl)},[t]),r}function wn({component:t,remove:o,disabled:s,tip:a,showConfirm:n,hideBtn:r,onCancel:m}){const{t:l}=h.useContext(Ce),[u,g]=h.useState(!1),[f,p]=h.useState(null),S=async b=>{g(!0),await o(b.component,b.removeType),g(!1),p(null)},d=s||u,R=()=>{p({title:`${l("common.delete")} ${t.meta.title||t.meta.name}`,description:(b,c)=>e.jsxs(ee,{component:"div",children:[e.jsx(ee,{gutterBottom:!0,children:l("blocklet.action.removeComponentDescription")}),e.jsxs(Ri,{name:"removeType",value:b.removeType,onChange:v=>c({...b,removeType:v.target.value}),children:[e.jsx(_t,{value:"keepData",control:e.jsx(oo,{}),label:l("blocklet.action.removeComponentKeepData")}),e.jsx(_t,{value:"complete",control:e.jsx(oo,{}),label:l("blocklet.action.removeComponentComplete")})]})]}),confirm:l("common.confirm"),cancel:l("common.cancel"),params:{component:t,removeType:"keepData"},onConfirm:S,onCancel:()=>{p(null),m()}})};h.useEffect(()=>{n?R():(g(!1),p(null))},[n]);const C=e.jsx(jr,{size:"small",disabled:d,onClick:()=>R,"data-cy":"delete-component-btn",children:e.jsx(Ct,{disabled:d})}),x=e.jsx(ve,{title:a||l("common.delete"),children:e.jsx("span",{children:C})});return e.jsxs(e.Fragment,{children:[!r&&x,f&&e.jsx(Fe,{title:f.title,description:f.description,confirm:f.confirm,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})]})}wn.propTypes={component:i.object.isRequired,remove:i.func,onCancel:i.func,disabled:i.bool,showConfirm:i.bool,hideBtn:i.bool,tip:i.string};wn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const jr=F($)`
392
+ `;function Sn({blocklet:t,children:o}){const{t:s}=z(),[a,n]=h.useState(!1),r=m=>{m.stopPropagation(),n(!0)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({open:r}):e.jsxs(ge,{onClick:r,className:"component-action","data-cy":"action-add-component",children:[e.jsx(Zt,{style:{fontSize:18,marginRight:5}}),s("blocklet.component.add")]}),e.jsx(St,{showDialog:a,setShowDialog:n,blocklet:t})]})}Sn.propTypes={children:i.any,blocklet:i.object.isRequired};Sn.defaultProps={children:null};const hr=t=>t.children.filter(o=>o.meta.interfaces.find(s=>s.type===J.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:t,setParams:o,setError:s,serviceTypes:a}){const{t:n}=z(),{blocklet:r}=oe(),m=r.meta.did,l=hr(r),[u,g]=h.useState([]),f={301:n("common.redirectPermanently"),302:n("common.redirectTemporary"),307:n("common.redirectTemporary"),308:n("common.redirectPermanently")};return h.useEffect(()=>{if(t.type===U.ROUTING_RULE_TYPES.COMPONENT&&t.componentId){const p=l.find(R=>R.meta.did===t.componentId),S=O.findWebInterface(p.meta),d=(Array.isArray(S==null?void 0:S.pageGroups)?S.pageGroups:[]).map(R=>({value:R,label:`${R} pages`}));d.length&&d.unshift({value:"",label:"All pages"}),g(d),t.pageGroup&&d.find(R=>R.value===t.pageGroup)===!1&&o({...t,pageGroups:""})}},[t.componentId,t.type]),e.jsxs(e.Fragment,{children:[e.jsx(Q,{select:!0,label:n("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:t.type,onChange:p=>{s(""),o({...t,type:p.target.value,did:p.target.value===U.ROUTING_RULE_TYPES.BLOCKLET?m:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:p,value:S})=>e.jsx(ge,{value:S,children:p},S))}),t.type===U.ROUTING_RULE_TYPES.REDIRECT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:t.redirectCode,onChange:p=>o({...t,redirectCode:p.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(f).map(p=>e.jsx(ge,{value:p,children:`${f[p]} - ${p}`},p))},"redirectCode"),e.jsx(Q,{label:n("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{o({...t,url:p.target.value,__disableConfirm:!p.target.value.trim()}),p.target.value.trim()?s(""):s(n("router.validation.redirectUrlRequired"))}},"redirectUrl")],t.type===U.ROUTING_RULE_TYPES.COMPONENT&&[e.jsx(Q,{select:!0,label:n("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:t.componentId,onChange:p=>{o({...t,componentId:p.target.value})},style:{marginBottom:32},SelectProps:{},children:l.map(p=>e.jsx(ge,{value:p.meta.did,selected:p.meta.did===t.componentId,children:O.getDisplayName(p,!0)},p.meta.did))},"componentId"),u.length?e.jsx(Q,{select:!0,label:n("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:t.pageGroup,helperText:n("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:p=>{o({...t,pageGroup:p.target.value})},SelectProps:{},children:u.map(p=>e.jsx(ge,{value:p.value,selected:p.value===t.pageGroup,children:p.label},p.label))},"pageGroup"):null].filter(Boolean),t.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(Q,{label:n("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:t.url,helperText:n("router.urlHelperText"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,url:p.target.value,__disableConfirm:!S}),s(S?"":n("router.validation.rewriteUrlRequired"))}},"url"),t.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[e.jsx(Q,{select:!0,label:n("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:t.responseType,onChange:p=>o({...t,responseType:p.target.value}),style:{marginBottom:32},SelectProps:{},children:U.ROUTING_RESPONSE_TYPES.map(p=>e.jsx(ge,{value:p.value,children:p.text},p.value))},"responseType"),e.jsx(Q,{label:n("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:t.responseBody,helperText:n("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:p=>{const S=p.target.value.trim();o({...t,responseBody:p.target.value,__disableConfirm:!S}),s(S?"":n("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:i.object,serviceTypes:i.array,setParams:i.func,setError:i.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:U.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:U.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:U.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:U.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:U.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function Rn({children:t,hiddenChildren:o,open:s,onClose:a}){const{t:n}=z(),{api:r}=K(),{blocklet:m}=oe(),[l,u]=h.useState(!1),[g,f]=h.useState(!1),p=m.meta.did,S=m.site.id,d=()=>{a==null||a(),u(!1),f(!1)},R=async c=>{try{const v=await ut(c,n);if(v)throw v;u(!0);const j={from:{pathPrefix:ue(c.pathPrefix)},to:{type:c.type}};c.type===U.ROUTING_RULE_TYPES.REDIRECT&&(j.to.url=c.url.trim(),j.to.redirectCode=c.redirectCode),c.type===U.ROUTING_RULE_TYPES.COMPONENT&&(j.to.did=p,j.to.componentId=c.componentId,j.to.pageGroup=c.pageGroup),c.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(j.to.url=ue(c.url)),c.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(j.to.response={status:200,contentType:c.responseType,body:c.responseBody}),await r.addRoutingRule({input:{id:S,rule:j,teamDid:p}})}catch(v){A.error(v.message)}finally{u(!1),f(!1)}},C={title:n("router.rule.add.title"),description:(c,v,j)=>{const T=I=>{if(j(null),ut(I,n)){v({...I,__disableConfirm:!0});return}v({...I})};return e.jsxs(ee,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:c.pathPrefixHint||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:c.pathPrefix,onChange:I=>{let B=!1;const L=Ro({params:{...c,pathPrefix:I.target.value},blocklets:[m]});j(L),c.type===U.ROUTING_RULE_TYPES.BLOCKLET&&L&&(B=!0),c.type===U.ROUTING_RULE_TYPES.REDIRECT&&!c.url&&(B=!0),c.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!c.url&&(B=!0),c.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!c.responseType||!c.responseBody)&&(B=!0),I.target.value.trim()||(B=!0,j(n("router.validation.pathPrefixRequired"))),B||j("");const k=n("common.slugifyHint",{value:gt(I.target.value)});v({...c,pathPrefix:I.target.value,pathPrefixHint:k,__disableConfirm:B})}}),e.jsx(Rt,{params:c,setParams:T,setError:j})]})},confirm:n("router.rule.add.confirm"),cancel:n("common.cancel"),params:{did:"",pathPrefix:"",type:U.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:R,onCancel:d},x=c=>{c.stopPropagation(),f(!0)};let b=null;return o||(b=typeof t=="function"?t({open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-add-rule",children:[l?e.jsx(re,{size:16}):e.jsx(Zt,{style:{fontSize:18,marginRight:5}}),n("router.rule.add.title")]})),e.jsxs(e.Fragment,{children:[b,(s||g)&&e.jsx(Fe,{title:C.title,description:C.description,confirm:C.confirm,cancel:C.cancel,params:C.params,onConfirm:C.onConfirm,onCancel:C.onCancel,color:"primary"})]})}Rn.propTypes={children:i.any,onClose:i.func,hiddenChildren:i.bool,open:i.bool};Rn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function bn({id:t,from:o,children:s}){const{t:a}=z(),{api:n}=K(),{blocklet:r}=oe(),[m,l]=h.useState(!1),[u,g]=h.useState(null),f=r.meta.did,p=r.site.id,S=o.pathPrefix,d=()=>{l(!1),g(null)},R=async()=>{l(!0);try{await n.deleteRoutingRule({input:{id:p,ruleId:t,teamDid:f}})}catch(b){A.error(b.message)}finally{g(null),l(!1)}},C={keyName:S,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${S}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:S}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:R,onCancel:d},x=b=>{b.stopPropagation(),g(C)};return e.jsxs(e.Fragment,{children:[typeof s=="function"?s({loading:m,open:x}):e.jsxs(ge,{onClick:x,className:"rule-action","data-cy":"action-delete-rule",children:[m?e.jsx(re,{size:16}):e.jsx(Ct,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),u&&e.jsx(vi,{keyName:u.keyName,title:u.title,description:u.description,confirmPlaceholder:u.confirmPlaceholder,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}bn.propTypes={id:i.string.isRequired,from:i.object.isRequired,children:i.any};bn.defaultProps={children:null};function En({id:t,from:o,to:s,children:a}){var c,v;const{t:n}=z(),{api:r}=K(),{blocklet:m}=oe(),[l,u]=h.useState(!1),[g,f]=h.useState(null),p=m.meta.did,S=m.site.id,d=o.pathPrefix,R=()=>{u(!1),f(null)},C=async j=>{try{const T=await ut(j,n);if(T)throw T;u(!0);const I={id:t,from:{pathPrefix:ue(j.pathPrefix)},to:{type:j.type}};j.type===U.ROUTING_RULE_TYPES.REDIRECT&&(I.to.url=j.url,I.to.redirectCode=j.redirectCode),j.type===U.ROUTING_RULE_TYPES.COMPONENT&&(I.to.did=p,I.to.componentId=j.componentId,I.to.pageGroup=j.pageGroup),j.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(I.to.url=ue(j.url)),j.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(I.to.response={status:200,contentType:j.responseType,body:j.responseBody}),await r.updateRoutingRule({input:{id:S,rule:I,teamDid:p}})}catch(T){A.error(T.message)}finally{u(!1),f(null)}},x={title:n("router.rule.update.title"),description:(j,T,I)=>{const B=L=>{if(ut(L,n)){T({...L,__disableConfirm:!0});return}T({...L})};return e.jsxs(ee,{component:"div",children:[e.jsx(Q,{label:n("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:j.helperText||n("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:j.pathPrefix,onChange:L=>{let k=!1;j.type===U.ROUTING_RULE_TYPES.REDIRECT&&!j.url&&(k=!0),j.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!j.url&&(k=!0),j.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!j.responseType||!j.responseBody)&&(k=!0),L.target.value.trim()||(k=!0,I(n("router.validation.pathPrefixRequired"))),k||I("");const M=n("common.slugifyHint",{value:gt(L.target.value)});T({...j,pathPrefix:L.target.value,helperText:M,__disableConfirm:k})}}),e.jsx(Rt,{params:j,setParams:B,setError:I})]})},confirm:n("router.rule.update.confirm"),cancel:n("router.rule.update.cancel"),color:"primary",params:{did:s.did||"",pathPrefix:d==="/"?d:d.replace(/^\/+/,"").replace(/\/+$/,""),type:s.type||U.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:s.redirectCode||302,componentId:s.componentId||"",pageGroup:s.pageGroup||"",url:s.url||"",responseType:((c=s.response)==null?void 0:c.contentType)||"",responseBody:(((v=s.response)==null?void 0:v.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:C,onCancel:R},b=j=>{j.stopPropagation(),f(x)};return e.jsxs(e.Fragment,{children:[typeof a=="function"?a({loading:l,open:b}):e.jsxs(ge,{onClick:b,className:"rule-action","data-cy":"action-update-rule",children:[l?e.jsx(re,{size:16}):e.jsx(jo,{style:{fontSize:18,marginRight:5}}),n("router.rule.update.title")]}),g&&e.jsx(Fe,{title:g.title,description:g.description,confirm:g.confirm,color:g.color,cancel:g.cancel,params:g.params,onConfirm:g.onConfirm,onCancel:g.onCancel})]})}En.propTypes={id:i.string.isRequired,from:i.object.isRequired,to:i.object.isRequired,children:i.any};En.defaultProps={children:null};function Tn(t){const{locale:o}=z(),{blocklet:s,recommendedDomain:a}=oe(),n=yo(a,t.from.pathPrefix,Kt(s,o));return e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:n,rel:"noopener noreferrer",title:n,children:e.jsx($,{size:"small",children:e.jsx(bo,{})})}),e.jsx(En,{...t,children:({open:r})=>e.jsx($,{size:"small",onClick:r,disabled:t.isProtected,"data-cy":"action-update-rule",children:e.jsx(Yt,{})})}),e.jsx(bn,{...t,children:({open:r})=>e.jsx($,{size:"small",onClick:r,disabled:t.isProtected,"data-cy":"action-delete-rule",children:e.jsx(Ct,{})})})]})}Tn.propTypes={isProtected:i.bool};Tn.defaultProps={isProtected:!1};function No({group:t,...o}){return t?e.jsx(Qe,{type:"reverse",...o,children:t}):null}No.propTypes={group:i.string.isRequired};function ft({domain:t,isHttps:o,toUrl:s}){const a=o?"https":"http";let n=s;return hs(n)||(n=`${a}://${t}${s}`),e.jsx(yt,{href:n,target:"_blank",style:{fontSize:14},underline:"hover",children:s},n)}ft.propTypes={domain:i.string.isRequired,toUrl:i.string.isRequired,isHttps:i.bool};ft.defaultProps={isHttps:!1};function bt({hasPermission:t}){const{t:o,locale:s}=z(),a=fo(),{blocklet:n,recommendedDomain:r}=oe();return n.site.rules.filter(l=>l.to.type!==U.ROUTING_RULE_TYPES.BLOCKLET).map(l=>{var p;let u=null,g=null;l.to.type===U.ROUTING_RULE_TYPES.NONE?u="404":l.to.type===U.ROUTING_RULE_TYPES.REDIRECT?u=l.to.redirectCode:l.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE?u="R":l.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE?u=e.jsx(wi,{sx:{color:"text.secondary",fontSize:"45px"}}):l.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&(g=n.children.find(S=>S.meta.did===l.to.componentId),u="C");const f=l.isProtected?e.jsx(ve,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:e.jsx("span",{children:e.jsx($,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:e.jsx(ji,{style:{fill:a.palette.text.disabled}})})})}):e.jsx(Tn,{...l});return[e.jsxs(y,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[e.jsxs(y,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[e.jsx(y,{className:"component-item__indent",width:28}),typeof u=="object"?u:e.jsx(ms,{children:u}),e.jsxs(y,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[e.jsxs(y,{style:{color:"#222",fontSize:16},children:[l.to.type===U.ROUTING_RULE_TYPES.NONE&&o("common.page404"),l.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),l.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),l.to.type===U.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((p=U.ROUTING_RESPONSE_TYPES.find(S=>S.value===l.to.response.contentType))==null?void 0:p.text),l.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&O.getDisplayName(g,!0)]}),e.jsxs(y,{display:"flex",alignItems:"center",children:[l.to.type===U.ROUTING_RULE_TYPES.REDIRECT&&e.jsx(ft,{domain:r,toUrl:l.to.url}),l.to.type===U.ROUTING_RULE_TYPES.GENERAL_REWRITE&&e.jsx(ft,{domain:r,toUrl:l.to.url}),l.to.type===U.ROUTING_RULE_TYPES.COMPONENT&&e.jsx(No,{group:l.to.pageGroup})]})]})]}),e.jsx(y,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:e.jsx(yt,{href:yo(r,l.from.pathPrefix,Kt(n,s)),target:"_blank",style:{fontSize:16},underline:"hover",children:fs(l.from.pathPrefix,"/")||"/"})},l.from.pathPrefix),e.jsx(y,{children:t&&e.jsx("div",{style:{textAlign:"right"},children:f})},"actions")]},"rule"),e.jsx(Jt,{},"divider")]})}bt.propTypes={hasPermission:i.bool};bt.defaultProps={hasPermission:!1};const gr=Me(bt,"mutate_blocklets"),xr=Me(bt,"",Oe);function yr(t){const{inService:o}=K();return o?e.jsx(xr,{...t}):e.jsx(gr,{...t})}function Cr({blocklet:t,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const s=gs(),{t:a}=z(),n=h.useRef(null),r=h.useMemo(()=>{if(!t||!t.optionalComponents)return null;const m=new URLSearchParams(window.location.search),l=m.get("install-component");if(l){n.current=l,m.delete("install-component"),s(m.toString());const u=t.optionalComponents.find(f=>f.meta.did===l);if(!u)return A.success(a("notification.installComponentError",{did:l})),null;const{meta:g}=u;if(o){const f=document.getElementById(`optional-component-${l}`),p=document.querySelector(".dashboard-main");if(f){const S=f.getBoundingClientRect(),d=p.getBoundingClientRect();p.scrollTo({top:S.top-d.top+p.scrollTop,behavior:"smooth"})}}return g}return null},[t,s,a,o]);return h.useEffect(()=>{var m;n.current&&window.opener&&window.opener.postMessage({blocklet:t,kind:"component-installer"},(m=window.blocklet)==null?void 0:m.appUrl)},[t]),r}function wn({component:t,remove:o,disabled:s,tip:a,showConfirm:n,hideBtn:r,onCancel:m}){const{t:l}=h.useContext(Ce),[u,g]=h.useState(!1),[f,p]=h.useState(null),S=async b=>{g(!0),await o(b.component,b.removeType),g(!1),p(null)},d=s||u,R=()=>{p({title:`${l("common.delete")} ${t.meta.title||t.meta.name}`,description:(b,c)=>e.jsxs(ee,{component:"div",children:[e.jsx(ee,{gutterBottom:!0,children:l("blocklet.action.removeComponentDescription")}),e.jsxs(Ri,{name:"removeType",value:b.removeType,onChange:v=>c({...b,removeType:v.target.value}),children:[e.jsx(_t,{value:"keepData",control:e.jsx(oo,{}),label:l("blocklet.action.removeComponentKeepData")}),e.jsx(_t,{value:"complete",control:e.jsx(oo,{}),label:l("blocklet.action.removeComponentComplete")})]})]}),confirm:l("common.confirm"),cancel:l("common.cancel"),params:{component:t,removeType:"keepData"},onConfirm:S,onCancel:()=>{p(null),m()}})};h.useEffect(()=>{n?R():(g(!1),p(null))},[n]);const C=e.jsx(jr,{size:"small",disabled:d,onClick:()=>R,"data-cy":"delete-component-btn",children:e.jsx(Ct,{disabled:d})}),x=e.jsx(ve,{title:a||l("common.delete"),children:e.jsx("span",{children:C})});return e.jsxs(e.Fragment,{children:[!r&&x,f&&e.jsx(Fe,{title:f.title,description:f.description,confirm:f.confirm,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})]})}wn.propTypes={component:i.object.isRequired,remove:i.func,onCancel:i.func,disabled:i.bool,showConfirm:i.bool,hideBtn:i.bool,tip:i.string};wn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const jr=F($)`
393
393
  &.Mui-disabled {
394
394
  opacity: 0.5;
395
395
  }
396
- `;function Pn({component:t,onStart:o,onStop:s,disabled:a,tip:n}){const{t:r}=h.useContext(Ce),[m,l]=h.useState(!1),[u,g]=h.useState(),f=async()=>{l(!0);try{await o(t)}catch(x){A.error(x.message)}l(!1)},p=async()=>{l(!0);try{await s(t)}catch(x){A.error(x.message)}l(!1)},S=a||m,d=["starting","running","stopping"].includes(t.status),R=d?Bs:Ns,C=e.jsx(vr,{disabled:S,onClick:()=>{var x;d?g({title:`${r("common.stop")} ${(x=t==null?void 0:t.meta)==null?void 0:x.title}`,description:r("blocklet.action.stopComponentDescription"),confirm:r("blocklet.action.confirmStop"),cancel:r("common.cancel"),onConfirm:()=>(g(null),p()),onCancel:()=>g(null)}):f()},"data-cy":`${d?"stop":"start"}-component-btn`,children:e.jsx(R,{disabled:S})});return[e.jsx(ve,{title:n||r(`common.${d?"stop":"start"}`),children:e.jsx("span",{children:C})},"btn"),u&&e.jsx(Fe,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"connect")]}Pn.propTypes={component:i.object.isRequired,onStart:i.func,onStop:i.func,disabled:i.bool,tip:i.string};Pn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const vr=F($)`
396
+ `;function Pn({component:t,onStart:o,onStop:s,disabled:a,tip:n}){const{t:r}=h.useContext(Ce),[m,l]=h.useState(!1),[u,g]=h.useState(),f=async()=>{l(!0);try{await o(t)}catch(x){A.error(x.message)}l(!1)},p=async()=>{l(!0);try{await s(t)}catch(x){A.error(x.message)}l(!1)},S=a||m,d=["starting","running","stopping"].includes(t.status),R=d?Ds:Ns,C=e.jsx(vr,{disabled:S,onClick:()=>{var x;d?g({title:`${r("common.stop")} ${(x=t==null?void 0:t.meta)==null?void 0:x.title}`,description:r("blocklet.action.stopComponentDescription"),confirm:r("blocklet.action.confirmStop"),cancel:r("common.cancel"),onConfirm:()=>(g(null),p()),onCancel:()=>g(null)}):f()},"data-cy":`${d?"stop":"start"}-component-btn`,children:e.jsx(R,{disabled:S})});return[e.jsx(ve,{title:n||r(`common.${d?"stop":"start"}`),children:e.jsx("span",{children:C})},"btn"),u&&e.jsx(Fe,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"connect")]}Pn.propTypes={component:i.object.isRequired,onStart:i.func,onStop:i.func,disabled:i.bool,tip:i.string};Pn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const vr=F($)`
397
397
  &.Mui-disabled {
398
398
  opacity: 0.5;
399
399
  }
@@ -419,12 +419,12 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
419
419
  margin-left: 4px;
420
420
  transform: translateY(-1px);
421
421
  }
422
- `;function Lo({blocklet:t,ancestors:o,mountPoint:s,href:a}){const[n,r]=h.useState(!1),[m,l]=h.useState(!1),[u,g]=h.useState(!1),[f,p]=h.useState(s),{api:S}=K(),d=!o.length,R=d?t.meta.did:o.map(c=>c.meta.did)[0];h.useEffect(()=>{l(!1),r(!1),g(!1)},[s]);const C=()=>{r(!1),l(!1),p(s)},x=async c=>{c.preventDefault(),g(!0),r(!1);try{const v={rootDid:R,mountPoint:ue(f)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw g(!1),v.message=X(v),A.error(v.message),v}},b=m?e.jsxs(y,{sx:{ml:1},children:[e.jsx($,{size:"medium",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!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:()=>r(!0),onMouseLeave:()=>r(!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:()=>r(!0),onMouseLeave:()=>r(!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(Q,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:f,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:()=>r(!0),onMouseLeave:()=>r(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:ys(s)})}),u?e.jsx(re,{size:20,sx:{ml:1}}):b]},s)}Lo.propTypes={mountPoint:i.string.isRequired,href:i.string.isRequired,blocklet:i.object.isRequired,ancestors:i.array.isRequired};const Dr=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},uo=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const r=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&r.push(m.meta.title)}return r.join(" / ")};function ht({blocklet:t,ancestors:o,depth:s,onRemove:a,onStart:n,onStop:r,onRestart:m,getComponentUrl:l,app:u}){var _,Z,Ie;const{t:g}=h.useContext(Ce),[f,p]=h.useState(),[S,d]=h.useState(!1),[R,C]=h.useState(!1),[x,b]=h.useState(null),[c,v]=h.useState(!1),{deletingBlocklets:j}=Qt();let{status:T}=t;s===1&&j.includes(t.meta.did)&&(T="deleting");const I=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),D=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=g("blocklet.component.tip.stopBlocklet");else if((_=t.dependents)!=null&&_.length){const te=t.dependents.filter(de=>de.required);if(te.length){const de=te.map(Se=>uo(Se.id,u));M=g("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(Dn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(bi,{blocklet:t,ancestors:o}),e.jsxs(y,{ml:"16px",sx:{minWidth:0},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:(Z=t==null?void 0:t.meta)==null?void 0:Z.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[T!=="unknown"&&e.jsx(Eo,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(mi,{style:{marginLeft:4},mode:t.mode||""}),!!((Ie=t.dependents)!=null&&Ie.length)&&e.jsx(ve,{title:[`${g("common.dependents")}: `,t.dependents.map(te=>e.jsx(y,{pl:1,children:`${uo(te.id,u)} ${te.required?`(${g("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),Gt.hasMountPoint(t.meta)&&e.jsx(Lo,{blocklet:t,ancestors:o,mountPoint:I,href:D},I),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[O.hasStartEngine(t.meta)&&e.jsx(ve,{title:g("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:D,rel:"noopener noreferrer",children:e.jsx($,{size:"small",children:e.jsx(bo,{})})})}),e.jsx(Pn,{blocklet:u,component:t,onStart:n,onStop:r,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(To,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||Dr(t)?{icon:e.jsx(Si,{}),text:g("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(As,{}),text:g("common.restart"),onClick:()=>{b({title:`${g("common.restart")} ${t.meta.title}`,description:g("blocklet.action.restartDescription"),confirm:g("blocklet.action.confirmRestart"),cancel:g("common.cancel"),onConfirm:async()=>{C(!0),await m(t),C(!1)},onCancel:()=>b(null)})},disabled:R||L||k||t.status!=="running"},{icon:e.jsx(Ct,{}),text:g("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:g("common.config")})}),disabled:L||k}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Jt,{},"line"),e.jsx(Un,{componentInfo:f,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(wn,{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:i.object.isRequired,ancestors:i.array,depth:i.number,onRemove:i.func,onStart:i.func,onStop:i.func,onRestart:i.func,getComponentUrl:i.func,app:i.object};ht.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const Vt=F(Co)`
422
+ `;function Lo({blocklet:t,ancestors:o,mountPoint:s,href:a}){const[n,r]=h.useState(!1),[m,l]=h.useState(!1),[u,g]=h.useState(!1),[f,p]=h.useState(s),{api:S}=K(),d=!o.length,R=d?t.meta.did:o.map(c=>c.meta.did)[0];h.useEffect(()=>{l(!1),r(!1),g(!1)},[s]);const C=()=>{r(!1),l(!1),p(s)},x=async c=>{c.preventDefault(),g(!0),r(!1);try{const v={rootDid:R,mountPoint:ue(f)};d||(v.did=t.meta.did),await S.updateComponentMountPoint({input:v})}catch(v){throw g(!1),v.message=X(v),A.error(v.message),v}},b=m?e.jsxs(y,{sx:{ml:1},children:[e.jsx($,{size:"medium",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!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:()=>r(!0),onMouseLeave:()=>r(!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:()=>r(!0),onMouseLeave:()=>r(!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(Q,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:f,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:()=>r(!0),onMouseLeave:()=>r(!1),children:e.jsx(y,{maxWidth:400,sx:{color:"secondary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:ys(s)})}),u?e.jsx(re,{size:20,sx:{ml:1}}):b]},s)}Lo.propTypes={mountPoint:i.string.isRequired,href:i.string.isRequired,blocklet:i.object.isRequired,ancestors:i.array.isRequired};const Br=t=>{var o;return!((o=t==null?void 0:t.meta)!=null&&o.group)},uo=(t,o)=>{const s=t.split("/").slice(1);let a=o,n=0;const r=[];for(;a&&n<s.length;){const m=a.children.find(l=>l.meta.did===s[n]);a=m,n++,m&&r.push(m.meta.title)}return r.join(" / ")};function ht({blocklet:t,ancestors:o,depth:s,onRemove:a,onStart:n,onStop:r,onRestart:m,getComponentUrl:l,app:u}){var _,Z,Ie;const{t:g}=h.useContext(Ce),[f,p]=h.useState(),[S,d]=h.useState(!1),[R,C]=h.useState(!1),[x,b]=h.useState(null),[c,v]=h.useState(!1),{deletingBlocklets:j}=Qt();let{status:T}=t;s===1&&j.includes(t.meta.did)&&(T="deleting");const I=`/${t.mountPoint||"/"}`.replace(/\/+/g,"/"),B=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=g("blocklet.component.tip.stopBlocklet");else if((_=t.dependents)!=null&&_.length){const te=t.dependents.filter(de=>de.required);if(te.length){const de=te.map(Se=>uo(Se.id,u));M=g("blocklet.component.tip.requiredBy",{name:de.join(", ")})}}const D=async(...te)=>{C(!0);try{await a(...te)}catch{}C(!1),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(Bn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[e.jsxs(y,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[e.jsx(bi,{blocklet:t,ancestors:o}),e.jsxs(y,{ml:"16px",sx:{minWidth:0},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:(Z=t==null?void 0:t.meta)==null?void 0:Z.version})]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[T!=="unknown"&&e.jsx(Eo,{style:{marginLeft:4},status:T,source:t.source,progress:t.progress}),e.jsx(mi,{style:{marginLeft:4},mode:t.mode||""}),!!((Ie=t.dependents)!=null&&Ie.length)&&e.jsx(ve,{title:[`${g("common.dependents")}: `,t.dependents.map(te=>e.jsx(y,{pl:1,children:`${uo(te.id,u)} ${te.required?`(${g("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),Gt.hasMountPoint(t.meta)&&e.jsx(Lo,{blocklet:t,ancestors:o,mountPoint:I,href:B},I),e.jsx("div",{style:{flex:1}}),e.jsxs(y,{display:"flex",alignItems:"center",children:[O.hasStartEngine(t.meta)&&e.jsx(ve,{title:g("common.visit"),children:e.jsx(y,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:B,rel:"noopener noreferrer",children:e.jsx($,{size:"small",children:e.jsx(bo,{})})})}),e.jsx(Pn,{blocklet:u,component:t,onStart:n,onStop:r,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(To,{"data-cy":"component-actions",actions:[O.hasStartEngine(t.meta)||Br(t)?{icon:e.jsx(Si,{}),text:g("common.detail"),onClick:()=>{p(t)}}:null,{icon:e.jsx(As,{}),text:g("common.restart"),onClick:()=>{b({title:`${g("common.restart")} ${t.meta.title}`,description:g("blocklet.action.restartDescription"),confirm:g("blocklet.action.confirmRestart"),cancel:g("common.cancel"),onConfirm:async()=>{C(!0),await m(t),C(!1)},onCancel:()=>b(null)})},disabled:R||L||k||t.status!=="running"},{icon:e.jsx(Ct,{}),text:g("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:g("common.config")})}),disabled:L||k}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),e.jsx(Jt,{},"line"),e.jsx(Un,{componentInfo:f,onClose:p,blocklet:t,app:u,depth:s}),e.jsx(wn,{blocklet:u,component:t,remove:D,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:i.object.isRequired,ancestors:i.array,depth:i.number,onRemove:i.func,onStart:i.func,onStop:i.func,onRestart:i.func,getComponentUrl:i.func,app:i.object};ht.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const Vt=F(Co)`
423
423
  .BaseBadge-badge {
424
424
  top: ${t=>t.top*8||6}px;
425
425
  right: ${t=>t.right*8||6}px;
426
426
  }
427
- `,Dn=F(y)`
427
+ `,Bn=F(y)`
428
428
  &:hover {
429
429
  background-color: rgba(0, 0, 0, 0.05);
430
430
  }
@@ -448,7 +448,7 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
448
448
  margin-left: 4px;
449
449
  transform: translateY(-1px);
450
450
  }
451
- `;function Bn({meta:t,dependencies:o,logoUrl:s,setInstallComponentMeta:a}){const n=K(),{t:r}=z(),m=()=>{a(t)},l=40;return e.jsxs(Br,{id:`optional-component-${t.did}`,children:[e.jsxs("div",{className:"cell",children:[e.jsxs("div",{className:"component-left",children:[e.jsx("img",{className:"component-logo",src:s,onError:()=>`${n.imgPrefix}/blocklet.png`,alt:t.title,style:{width:l,height:l}}),e.jsxs("div",{className:"component-header",children:[e.jsx("div",{className:"component-name",children:t.title}),e.jsx("div",{className:"component-version",children:t.version})]}),e.jsx(ve,{title:[`${r("common.dependents")}: `,o.map(u=>e.jsx(y,{pl:1,children:`${u.parentTitle} ${u.required?`(${r("common.required")})`:""}`},u.parentName+u.mount_point))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]}),e.jsx("div",{style:{flex:1}}),e.jsx(y,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:e.jsx(Cs,{onClick:m,startIcon:e.jsx(Pe,{icon:"ph:download-simple-bold"}),children:r("common.install")})})]}),e.jsx(Jt,{class:"line"},"line")]})}Bn.propTypes={meta:i.object.isRequired,logoUrl:i.string,setInstallComponentMeta:i.func.isRequired,dependencies:i.arrayOf(i.shape({parentDid:i.string,parentName:i.string,parentPoint:i.string,required:i.bool}))};Bn.defaultProps={logoUrl:"",dependencies:[]};const Br=F(Dn)`
451
+ `;function Dn({meta:t,dependencies:o,logoUrl:s,setInstallComponentMeta:a}){const n=K(),{t:r}=z(),m=()=>{a(t)},l=40;return e.jsxs(Dr,{id:`optional-component-${t.did}`,children:[e.jsxs("div",{className:"cell",children:[e.jsxs("div",{className:"component-left",children:[e.jsx("img",{className:"component-logo",src:s,onError:()=>`${n.imgPrefix}/blocklet.png`,alt:t.title,style:{width:l,height:l}}),e.jsxs("div",{className:"component-header",children:[e.jsx("div",{className:"component-name",children:t.title}),e.jsx("div",{className:"component-version",children:t.version})]}),e.jsx(ve,{title:[`${r("common.dependents")}: `,o.map(u=>e.jsx(y,{pl:1,children:`${u.parentTitle} ${u.required?`(${r("common.required")})`:""}`},u.parentName+u.mount_point))],children:e.jsx(y,{display:"flex",color:"primary.main",ml:1,children:e.jsx(Pe,{icon:"octicon:package-dependents-16"})})})]}),e.jsx("div",{style:{flex:1}}),e.jsx(y,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:e.jsx(Cs,{onClick:m,startIcon:e.jsx(Pe,{icon:"ph:download-simple-bold"}),children:r("common.install")})})]}),e.jsx(Jt,{class:"line"},"line")]})}Dn.propTypes={meta:i.object.isRequired,logoUrl:i.string,setInstallComponentMeta:i.func.isRequired,dependencies:i.arrayOf(i.shape({parentDid:i.string,parentName:i.string,parentPoint:i.string,required:i.bool}))};Dn.defaultProps={logoUrl:"",dependencies:[]};const Dr=F(Bn)`
452
452
  .line {
453
453
  opacity: 0.5;
454
454
  }
@@ -498,7 +498,7 @@ import{bJ as Vo,j as e,aK as qt,aL as Wt,t as z,bl as K,Q as y,ax as ve,P as i,E
498
498
  margin-left: 4px;
499
499
  transform: translateY(-1px);
500
500
  }
501
- `;function Nn({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var V;const{t:n}=h.useContext(Ce),{api:r,inService:m,info:l}=K(),{addDeletingDid:u,removeDeletingDid:g,matchDeletingDid:f}=Qt(),[p,S]=h.useState(!1),[d,R]=h.useState(null),[C,x]=h.useState(null),[b,c]=h.useState(!1),[v,j]=h.useState(!1),[T,I]=h.useState(!1),[D,L]=h.useState(null),k=t&&t.structVersion!==U.APP_STRUCT_VERSION,[M,B]=h.useState(!1),_=[...t.children];t.meta.group!=="gateway"&&_.unshift(t),f(_.map(w=>w.meta.did));const Z=async()=>{if(!p){S(!0);try{const{updateId:w,updateList:q}=(await r.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!w){A.info(n("blocklet.component.noUpdate"));return}const se=[];O.forEachChildSync(t,(ie,{id:Ge,ancestors:Y})=>{const H=q.find(Re=>Re.id===Ge);if(H){const Re=Y.slice(1).concat(ie).map(Ue=>Ue.meta.title||Ue.meta.name).join(" / "),ze=(Y[1]||ie).meta.did;se.push({groupId:ze,name:Re,version:ie.meta.version,newVersion:H.meta.version})}});const xe={};se.forEach(ie=>{xe[ie.groupId]?ie.disabled=!0:xe[ie.groupId]=!0}),R({params:{updateId:w},list:se,checks:xe,hasChecks:!0})}catch(w){S(!1),A.error(X(w))}}},Ie=async()=>{if(!p)try{S(!0);const w=Object.keys(d.checks).filter(se=>d.checks[se]),q={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:w};await r.upgradeComponents({input:q}),S(!1),R(null),B(null)}catch(w){S(!1),A.error(X(w))}},te=async(w,q)=>{u(w.meta.did);try{await r.deleteComponent({input:{did:w.meta.did,keepData:q==="keepData",rootDid:t.meta.did}}),await Ke(800)}catch(se){A.error(X(se)),g(w.meta.did)}},de=async w=>{try{await r.startBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(q){A.error(X(q))}},Se=async w=>{try{await r.stopBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(q){A.error(X(q))}},P=async w=>{try{await r.restartBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(q){A.error(X(q))}},ke=(w,q)=>{const{checked:se}=w.target;R(xe=>{const ie=Object.entries(xe.checks).reduce((Y,[H,Re])=>(Y[H]=q===H?se:Re,Y),{}),Ge=Object.values(ie).includes(!0);return{...xe,checks:ie,hasChecks:Ge}})};js(Z);const me=Cr({blocklet:t,scrollToComponent:!0}),Ze=D||me;return e.jsxs(Nr,{component:"div",...a,children:[e.jsxs(Ar,{display:"flex",children:[e.jsxs(Lr,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[_!=null&&_.length?`${n("common.components")} (${_.length})`:`${n("common.components")}`,!k&&e.jsx(Ft,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsx($t,{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:()=>{Z()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:p?e.jsx(re,{size:16}):e.jsx(wo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Ft,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!k&&e.jsx(Sn,{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(To,{"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)})]})})]}),_!=null&&_.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(Dn,{children:e.jsx(Bn,{setInstallComponentMeta:L,...w})},w.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(Us,{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(yr,{})}),!!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:Qn,py:4,children:d.list.map(w=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(vs,{checked:d.checks[w.groupId],onChange:q=>ke(q,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(ks,{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(Ss,{style:{padding:"8px 24px 24px"},children:[e.jsx(ne,{onClick:()=>{R(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(Qn,{children:e.jsx(y,{py:2,children:e.jsx(_t,{control:e.jsx(Ei,{checked:b,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(Rn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(vt,{open:!0,onClose:()=>I(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}Nn.propTypes={blocklet:i.object.isRequired,onUpdate:i.func,getComponentUrl:i.func};Nn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Nr=F.div`
501
+ `;function Nn({blocklet:t,onUpdate:o,getComponentUrl:s,...a}){var V;const{t:n}=h.useContext(Ce),{api:r,inService:m,info:l}=K(),{addDeletingDid:u,removeDeletingDid:g,matchDeletingDid:f}=Qt(),[p,S]=h.useState(!1),[d,R]=h.useState(null),[C,x]=h.useState(null),[b,c]=h.useState(!1),[v,j]=h.useState(!1),[T,I]=h.useState(!1),[B,L]=h.useState(null),k=t&&t.structVersion!==U.APP_STRUCT_VERSION,[M,D]=h.useState(!1),_=[...t.children];t.meta.group!=="gateway"&&_.unshift(t),f(_.map(w=>w.meta.did));const Z=async()=>{if(!p){S(!0);try{const{updateId:w,updateList:q}=(await r.checkComponentsForUpdates({input:{did:t.meta.did}})).preUpdateInfo||{};if(S(!1),!w){A.info(n("blocklet.component.noUpdate"));return}const se=[];O.forEachChildSync(t,(ie,{id:Ge,ancestors:Y})=>{const H=q.find(Re=>Re.id===Ge);if(H){const Re=Y.slice(1).concat(ie).map(Ue=>Ue.meta.title||Ue.meta.name).join(" / "),ze=(Y[1]||ie).meta.did;se.push({groupId:ze,name:Re,version:ie.meta.version,newVersion:H.meta.version})}});const xe={};se.forEach(ie=>{xe[ie.groupId]?ie.disabled=!0:xe[ie.groupId]=!0}),R({params:{updateId:w},list:se,checks:xe,hasChecks:!0})}catch(w){S(!1),A.error(X(w))}}},Ie=async()=>{if(!p)try{S(!0);const w=Object.keys(d.checks).filter(se=>d.checks[se]),q={updateId:d.params.updateId,rootDid:t.meta.did,selectedComponents:w};await r.upgradeComponents({input:q}),S(!1),R(null),D(null)}catch(w){S(!1),A.error(X(w))}},te=async(w,q)=>{u(w.meta.did);try{await r.deleteComponent({input:{did:w.meta.did,keepData:q==="keepData",rootDid:t.meta.did}}),await Ke(800)}catch(se){A.error(X(se)),g(w.meta.did)}},de=async w=>{try{await r.startBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(q){A.error(X(q))}},Se=async w=>{try{await r.stopBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(q){A.error(X(q))}},P=async w=>{try{await r.restartBlocklet({input:{did:t.meta.did,componentDids:[w.meta.did]}}),await Ke(800)}catch(q){A.error(X(q))}},ke=(w,q)=>{const{checked:se}=w.target;R(xe=>{const ie=Object.entries(xe.checks).reduce((Y,[H,Re])=>(Y[H]=q===H?se:Re,Y),{}),Ge=Object.values(ie).includes(!0);return{...xe,checks:ie,hasChecks:Ge}})};js(Z);const me=Cr({blocklet:t,scrollToComponent:!0}),Ze=B||me;return e.jsxs(Nr,{component:"div",...a,children:[e.jsxs(Ar,{display:"flex",children:[e.jsxs(Lr,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[_!=null&&_.length?`${n("common.components")} (${_.length})`:`${n("common.components")}`,!k&&e.jsx(Ft,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsx($t,{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:()=>{Z()},"data-cy":"check-for-updates",children:[e.jsx(y,{ml:.5,mr:.5,display:"flex",children:p?e.jsx(re,{size:16}):e.jsx(wo,{style:{fontSize:"1em"}})}),n("blocklet.component.checkUpdateTitle")]})})})})]}),e.jsx(Ft,{permission:m?"":"mutate_blocklets",role:m?Oe:[],children:e.jsxs(y,{display:"flex",alignItems:"center",children:[!k&&e.jsx(Sn,{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(To,{"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)})]})})]}),_!=null&&_.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(Bn,{children:e.jsx(Dn,{setInstallComponentMeta:L,...w})},w.meta.did))]}):e.jsx(y,{mt:8,children:e.jsx(Us,{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(yr,{})}),!!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:Qn,py:4,children:d.list.map(w=>e.jsxs(y,{display:"flex",alignItems:"center",children:[e.jsx(vs,{checked:d.checks[w.groupId],onChange:q=>ke(q,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(ks,{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(Ss,{style:{padding:"8px 24px 24px"},children:[e.jsx(ne,{onClick:()=>{R(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(Qn,{children:e.jsx(y,{py:2,children:e.jsx(_t,{control:e.jsx(Ei,{checked:b,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(Rn,{hiddenChildren:!0,open:!0,onClose:()=>j(!1)}),T&&e.jsx(vt,{open:!0,onClose:()=>I(!1),hiddenChildren:!0,blocklet:t,ancestors:[]})]})}Nn.propTypes={blocklet:i.object.isRequired,onUpdate:i.func,getComponentUrl:i.func};Nn.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const Nr=F.div`
502
502
  .title {
503
503
  font-size: 1.2rem;
504
504
  font-weight: bold;