@abtnode/blocklet-services 1.16.39-beta-20250218-132815-6baaf20e → 1.16.39-beta-20250220-212222-627e9ea7

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 (202) hide show
  1. package/api/index.js +1 -1
  2. package/api/libs/push-kit/index.js +2 -2
  3. package/api/services/auth/index.js +1 -2
  4. package/api/services/dashboard/index.js +32 -48
  5. package/api/services/notification/notification-queue.js +77 -165
  6. package/api/socket/channel/did.js +44 -32
  7. package/api/util/attach-shared-utils.js +11 -4
  8. package/dist/assets/{Add-meGhscd6.js → Add-qzAc2S9X.js} +1 -1
  9. package/dist/assets/{ArrowDropDown-B7S4xnEe.js → ArrowDropDown-CH-FgtE-.js} +1 -1
  10. package/dist/assets/{CheckCircle-CnvZ4oB1.js → CheckCircle-Bk5vNiEj.js} +1 -1
  11. package/dist/assets/{ChevronLeft-D1qkw0FM.js → ChevronLeft-CtdCxfvp.js} +1 -1
  12. package/dist/assets/{ChevronRight-CEkTH0up.js → ChevronRight-C0FYeIUm.js} +1 -1
  13. package/dist/assets/{DeleteOutline-BjrgG_HY.js → DeleteOutline-DJPUGW0c.js} +1 -1
  14. package/dist/assets/{Done-7hvoRcVZ.js → Done-BBJndopl.js} +1 -1
  15. package/dist/assets/{Download-CMvqPsK9.js → Download-DR7jogQn.js} +1 -1
  16. package/dist/assets/{EditIcon-BOr0kf6I.js → EditIcon-Mm3W5DE6.js} +1 -1
  17. package/dist/assets/{Error-D3I1nNnO.js → Error-DtmzeQ7l.js} +1 -1
  18. package/dist/assets/{Google-TNOfJ3uU.js → Google-DLwblvhu.js} +1 -1
  19. package/dist/assets/{InfoOutlined-CwoytfGr.js → InfoOutlined-D5FF63tH.js} +1 -1
  20. package/dist/assets/{Launch-wyBVNKfb.js → Launch-CmFwRERO.js} +1 -1
  21. package/dist/assets/{LaunchOutlined-B2ZU9fkg.js → LaunchOutlined-DBHgr88s.js} +1 -1
  22. package/dist/assets/{LockIcon-D-W4Rph6.js → LockIcon-BbWIWjve.js} +1 -1
  23. package/dist/assets/{Loop-CQAI5rIS.js → Loop-Bca4uFY8.js} +1 -1
  24. package/dist/assets/{MoreHoriz-CyCcv2bV.js → MoreHoriz-Dye919yY.js} +1 -1
  25. package/dist/assets/{PlayArrow-B5ZFUKPq.js → PlayArrow-C2iusqXD.js} +1 -1
  26. package/dist/assets/{QuestionMarkCircle-BvUTckGB.js → QuestionMarkCircle-D5Im4T0u.js} +1 -1
  27. package/dist/assets/{ServerLogo-BDEZRDcg.js → ServerLogo-DWgX8KHy.js} +1 -1
  28. package/dist/assets/{ViewList-C8AcRueZ.js → ViewList-DKhSCuMV.js} +1 -1
  29. package/dist/assets/access-control-B0LaD0k_.js +13 -0
  30. package/dist/assets/{actions-C0a0eUYM.js → actions-yv07Sweq.js} +1 -1
  31. package/dist/assets/{add-component-core-CK3SAdlQ.js → add-component-core-C2j8WeZe.js} +35 -35
  32. package/dist/assets/add-resource-BqHzz2Ig.js +1 -0
  33. package/dist/assets/addon-B-oiJMyb.js +31 -0
  34. package/dist/assets/{analytics-CjaAB5m2.js → analytics-Djm-FxYj.js} +1 -1
  35. package/dist/assets/{ar-DoIWDL3Q.js → ar-BIivBIFd.js} +1 -1
  36. package/dist/assets/ar-COZYSjgL.js +3 -0
  37. package/dist/assets/{audit-logs-bl5st5Lr.js → audit-logs-e69kZ-on.js} +1 -1
  38. package/dist/assets/{base32-9oQoOkFy.js → base32-CD3Vv-Tv.js} +1 -1
  39. package/dist/assets/branding-BxqW8Sc9.js +40 -0
  40. package/dist/assets/{bundle-avatar-Dnk7mw7b.js → bundle-avatar-BHE5y99P.js} +1 -1
  41. package/dist/assets/button-DYvqAiv_.js +1 -0
  42. package/dist/assets/{click-to-copy-C9X-UQyL.js → click-to-copy-Do3l3xtT.js} +1 -1
  43. package/dist/assets/complete-BHA60Kfa.js +45 -0
  44. package/dist/assets/{component-B0WI6_H4.js → component-CkH8Sb15.js} +96 -88
  45. package/dist/assets/config-CGVl3CyQ.js +32 -0
  46. package/dist/assets/{config-C0wq7rMr.js → config-CZ4gUB4m.js} +1 -1
  47. package/dist/assets/{config-navigation-Dskr7Yic.js → config-navigation-B_PVAliu.js} +3 -3
  48. package/dist/assets/{config-space-BYYAVRcS.js → config-space-Cjs4lh6z.js} +1 -1
  49. package/dist/assets/{confirm-BmLsHbj9.js → confirm-HOW8FaxK.js} +1 -1
  50. package/dist/assets/{connect-06lWrPrR.js → connect--Oy8GGMA.js} +1 -1
  51. package/dist/assets/{connect-hhGPDSK8.js → connect-D4PAe19d.js} +1 -1
  52. package/dist/assets/{connect-to-DIJ57-hM.js → connect-to-aA5MeDcj.js} +1 -1
  53. package/dist/assets/{content-layout-cWwRTmIc.js → content-layout-CE2kjm54.js} +1 -1
  54. package/dist/assets/{dashboard-PlqPcVrd.js → dashboard-CiOynIcf.js} +10 -10
  55. package/dist/assets/de-C2zBBjYP.js +3 -0
  56. package/dist/assets/{de-BVgb1fEg.js → de-CQlYxUo4.js} +1 -1
  57. package/dist/assets/delete-confirm-CsLJksmh.js +1 -0
  58. package/dist/assets/{did-address-Bl2N44vc.js → did-address-5heyoc8D.js} +1 -1
  59. package/dist/assets/domain-DH9NJU3V.js +9 -0
  60. package/dist/assets/domain-action-card-COoKhuua.js +15 -0
  61. package/dist/assets/domains-CyoWnOlx.js +1 -0
  62. package/dist/assets/{email-9CbD02fM.js → email-kdvuQq1P.js} +1 -1
  63. package/dist/assets/es-BeW3ehjv.js +3 -0
  64. package/dist/assets/{es-CWcVPAna.js → es-CiFVrJLk.js} +1 -1
  65. package/dist/assets/{exchange-passport-ZTeqENxf.js → exchange-passport-DC5cSNtB.js} +1 -1
  66. package/dist/assets/{form-text-input-DEadnM80.js → form-text-input-Vg6k4hxG.js} +1 -1
  67. package/dist/assets/{fr-C8Jr_C8u.js → fr-ByVHFXxu.js} +1 -1
  68. package/dist/assets/fr-D2xyGusB.js +3 -0
  69. package/dist/assets/{fuel-AxStjHWS.js → fuel-BtUPmbM2.js} +1 -1
  70. package/dist/assets/{fullpage-BXvfrD1C.js → fullpage-9ClXH1L9.js} +1 -1
  71. package/dist/assets/{get-safe-url-BVjMxmwp.js → get-safe-url-BRR4RLgg.js} +1 -1
  72. package/dist/assets/{get-safe-url-BxZD1oA_.js → get-safe-url-bdLdP6Lf.js} +1 -1
  73. package/dist/assets/{hi-DTqZQNNB.js → hi-BIS_6XAM.js} +1 -1
  74. package/dist/assets/hi-OH9OAZfb.js +1 -0
  75. package/dist/assets/{home-CrkVy1DG.js → home-DERpglCy.js} +1 -1
  76. package/dist/assets/{id-CUsGyKYW.js → id-BK78HolG.js} +1 -1
  77. package/dist/assets/id-BNCctHPN.js +3 -0
  78. package/dist/assets/{iframe-BcWepstA.js → iframe-D3k1dg5d.js} +1 -1
  79. package/dist/assets/index-8p3WpvMR.js +192 -0
  80. package/dist/assets/{index-DIQ33Q8Z.js → index-B0unYdcz.js} +1 -1
  81. package/dist/assets/{index-BBOSdbE7.js → index-B3zo8s95.js} +1 -1
  82. package/dist/assets/{index-BtFCAsqh.js → index-BQSYz_Lo.js} +1 -1
  83. package/dist/assets/{index-DgaUl_lv.js → index-BbnozP7b.js} +1 -1
  84. package/dist/assets/index-BelkkFch.js +228 -0
  85. package/dist/assets/index-BtWvJbA-.js +52 -0
  86. package/dist/assets/{index-DkVoxpR-.js → index-BwEZdySL.js} +7 -7
  87. package/dist/assets/{index-Be9vrMiA.js → index-Bygo8biQ.js} +1 -1
  88. package/dist/assets/{index-CHFvfli7.js → index-CF4Aobpk.js} +1 -1
  89. package/dist/assets/{index-CDvqNewi.js → index-CR0qrcky.js} +1 -1
  90. package/dist/assets/{index-BSC2apzE.js → index-CfM3rPHl.js} +1 -1
  91. package/dist/assets/{index-DtwN19zv.js → index-DIP3om2u.js} +1 -1
  92. package/dist/assets/{index-C-D-nCB1.js → index-DQ3_atB3.js} +1 -1
  93. package/dist/assets/{index-DfBNyFsV.js → index-DV2omMe2.js} +1 -1
  94. package/dist/assets/{index-ChSPqVLh.js → index-DcvnbXW2.js} +1 -1
  95. package/dist/assets/index-H3wqK9-u.js +109 -0
  96. package/dist/assets/{index-BXlJ03I_.js → index-XiSmd1mo.js} +1 -1
  97. package/dist/assets/index-dZzRZ2ZY.js +104 -0
  98. package/dist/assets/{invitation-BzHMoDRH.js → invitation-CxmBuTs1.js} +6 -6
  99. package/dist/assets/{invite-BBcuJaUv.js → invite-B874TDmG.js} +1 -1
  100. package/dist/assets/{issue-passport-sgBfFZ4Y.js → issue-passport-D9TAuz7P.js} +1 -1
  101. package/dist/assets/item-Bl6VQtAH.js +2 -0
  102. package/dist/assets/ja-BP7svMm3.js +3 -0
  103. package/dist/assets/{ja-B0U7M2t1.js → ja-C_qbKn0g.js} +1 -1
  104. package/dist/assets/ko-Bucx3EaX.js +3 -0
  105. package/dist/assets/{ko-CpDA9JjF.js → ko-Dlp9c2u9.js} +1 -1
  106. package/dist/assets/{launch-result-message-keU5grqY.js → launch-result-message-B237vj_f.js} +1 -1
  107. package/dist/assets/{layout-CGas_HfS.js → layout--JdBWkq8.js} +1 -1
  108. package/dist/assets/{list-cZ-OXxN0.js → list-D6KYwBs8.js} +1 -1
  109. package/dist/assets/{list-header-Dd4BEf4y.js → list-header-CRB0LxnL.js} +1 -1
  110. package/dist/assets/localization-CfyOuYf8.js +1 -0
  111. package/dist/assets/{log-BFj6TDz5.js → log-CY8wNU8M.js} +1 -1
  112. package/dist/assets/{login-B-6s411x.js → login-B248a-js.js} +1 -1
  113. package/dist/assets/login-oauth-callback-BLrbomPI.js +1 -0
  114. package/dist/assets/{logo-uploader-pyVqJwKp.js → logo-uploader-CXyCerZA.js} +3 -3
  115. package/dist/assets/{lost-passport-DKkxzCH8.js → lost-passport-BviMxb1A.js} +1 -1
  116. package/dist/assets/{open-window-Cvetj9Mn.js → open-window-Ch1rgFaC.js} +1 -1
  117. package/dist/assets/overview-B6x2PVnm.js +12 -0
  118. package/dist/assets/{page-header--y63DY5K.js → page-header-BVxfqM_P.js} +1 -1
  119. package/dist/assets/{permission-Be_APIVZ.js → permission-Ct9GXCMW.js} +1 -1
  120. package/dist/assets/{preferences-D-NDmLhf.js → preferences-BhZaRM6Y.js} +1 -1
  121. package/dist/assets/pt-DWx2CRwy.js +1 -0
  122. package/dist/assets/{pt-7r06GaNd.js → pt-SFZ6JUYf.js} +1 -1
  123. package/dist/assets/publish-resource-DcoLPJys.js +1 -0
  124. package/dist/assets/{react-beautiful-dnd.esm-Czr1mmuu.js → react-beautiful-dnd.esm-Bj96SiFV.js} +1 -1
  125. package/dist/assets/{relative-time-D0P0AJUI.js → relative-time-cY8dsU43.js} +1 -1
  126. package/dist/assets/{ru-MS-ksi2g.js → ru-Bz5lOwmE.js} +1 -1
  127. package/dist/assets/ru-CCmcxEDp.js +1 -0
  128. package/dist/assets/sdk-DQoMrTNt.js +1 -0
  129. package/dist/assets/{session-CV6ez46v.js → session-CldqrK3N.js} +1 -1
  130. package/dist/assets/setup-AfPc0iVj.js +19 -0
  131. package/dist/assets/{shorten-label-J69eHfMN.js → shorten-label-la5sIm_0.js} +1 -1
  132. package/dist/assets/{simple-select-D06JmA0a.js → simple-select-Cu-p9eCv.js} +1 -1
  133. package/dist/assets/{slicedToArray-CXBLQZX4.js → slicedToArray-DBh5Z78L.js} +2 -2
  134. package/dist/assets/{start-BjFFihjS.js → start-D-vJAX65.js} +1 -1
  135. package/dist/assets/{step-actions-qXq3r5tX.js → step-actions-EEz4d7kn.js} +1 -1
  136. package/dist/assets/{studio-BNGylnt7.js → studio-BfuxFzVZ.js} +1 -1
  137. package/dist/assets/{switch-control-DmKC0hpm.js → switch-control-DkVbfEAf.js} +1 -1
  138. package/dist/assets/{th-gcuRSNHo.js → th-B1jLPjfm.js} +1 -1
  139. package/dist/assets/th-yhtyMUEz.js +1 -0
  140. package/dist/assets/{traffic-Djmt2Ph8.js → traffic-DIdLhQbQ.js} +1 -1
  141. package/dist/assets/{transfer-B9ohZjja.js → transfer-CSUEJJtc.js} +1 -1
  142. package/dist/assets/{unsubscribe-6xRksnNz.js → unsubscribe-Dma6eGwK.js} +1 -1
  143. package/dist/assets/{use-mobile-DnWfrhc7.js → use-mobile-B7gJcr5J.js} +1 -1
  144. package/dist/assets/{useAsync-Ua5iss51.js → useAsync-CEZQNMFX.js} +1 -1
  145. package/dist/assets/{useAsyncRetry-Bmo6a1Zp.js → useAsyncRetry-BEB-tWmQ.js} +2 -2
  146. package/dist/assets/{useLocalStorage-B5t6MEw6.js → useLocalStorage-CM7gP1Ni.js} +1 -1
  147. package/dist/assets/{user-center-DEGm9vzv.js → user-center-BkMU0Sgl.js} +1 -1
  148. package/dist/assets/util-C5G3YrVZ.js +1 -0
  149. package/dist/assets/{util-Bl4vyFsm.js → util-Dn2l5LdV.js} +1 -1
  150. package/dist/assets/{vendor-arcblock-BFUPp1Ez.js → vendor-arcblock-CLdpcBR_.js} +73 -73
  151. package/dist/assets/{vendor-hooks-BKxTDk_P.js → vendor-hooks-ZnvK17j8.js} +2 -2
  152. package/dist/assets/vendor-mui-core-DrGFkjqr.js +266 -0
  153. package/dist/assets/{vendor-mui-x-CSUdon8K.js → vendor-mui-x-vjsTA-wt.js} +1 -1
  154. package/dist/assets/vi-C8K3TxgS.js +1 -0
  155. package/dist/assets/{vi-CGYOhf_R.js → vi-RXH5xiEz.js} +1 -1
  156. package/dist/assets/wrap-locale-fZXg9Dsd.js +1 -0
  157. package/dist/assets/zh-BZ_tPxRT.js +4 -0
  158. package/dist/assets/{zh-BYS_9r4v.js → zh-NJ5wkDCG.js} +1 -1
  159. package/dist/assets/{zh-tw-BR5CO3an.js → zh-tw-BpuS6s2j.js} +1 -1
  160. package/dist/assets/zh-tw-DKnxL7q7.js +3 -0
  161. package/dist/index.html +4 -4
  162. package/dist/service-worker.js +1 -1
  163. package/package.json +34 -34
  164. package/dist/assets/access-control-ClVHa3J1.js +0 -13
  165. package/dist/assets/add-resource-hs_iM1xk.js +0 -1
  166. package/dist/assets/addon-C7fx4MJ0.js +0 -31
  167. package/dist/assets/ar-BFUPmTkR.js +0 -3
  168. package/dist/assets/branding-5S3zjZlC.js +0 -40
  169. package/dist/assets/button-BTVoaDd7.js +0 -1
  170. package/dist/assets/complete-C3yyjx_N.js +0 -45
  171. package/dist/assets/config-DINcJX6A.js +0 -32
  172. package/dist/assets/de-hV0yD3gq.js +0 -3
  173. package/dist/assets/domain-DDa_Ldun.js +0 -9
  174. package/dist/assets/domain-list-DXbfS21Z.js +0 -15
  175. package/dist/assets/es-BcSAobJW.js +0 -3
  176. package/dist/assets/fr-8qti32p1.js +0 -3
  177. package/dist/assets/hi-DDEUhQcX.js +0 -1
  178. package/dist/assets/id-DkUYINLx.js +0 -3
  179. package/dist/assets/index-BJA4YPaC.js +0 -243
  180. package/dist/assets/index-CoxJ8G1A.js +0 -77
  181. package/dist/assets/index-DcfIKM1A.js +0 -9
  182. package/dist/assets/index-DkufOgYs.js +0 -125
  183. package/dist/assets/index-MxM82EtU.js +0 -228
  184. package/dist/assets/index-uYcwdGZL.js +0 -104
  185. package/dist/assets/item-C5sAxGxS.js +0 -2
  186. package/dist/assets/ja-C2LP4WQG.js +0 -3
  187. package/dist/assets/ko-C-DMeONa.js +0 -3
  188. package/dist/assets/localization-Z_CTe1Z8.js +0 -1
  189. package/dist/assets/login-oauth-callback-aKbzfltj.js +0 -1
  190. package/dist/assets/overview-BxbJCUbS.js +0 -12
  191. package/dist/assets/pt-CbxvF__Z.js +0 -1
  192. package/dist/assets/publish-resource-CxkiI4_n.js +0 -1
  193. package/dist/assets/ru-DLHrAeE7.js +0 -1
  194. package/dist/assets/sdk-NKQJT0FS.js +0 -1
  195. package/dist/assets/setup-CF2VhAxD.js +0 -19
  196. package/dist/assets/th-Dil9kwjH.js +0 -1
  197. package/dist/assets/util-PzCAH0nE.js +0 -1
  198. package/dist/assets/vendor-mui-core-xF5F4eT7.js +0 -266
  199. package/dist/assets/vi-B46hyfUM.js +0 -1
  200. package/dist/assets/wrap-locale-6MxBCfA2.js +0 -1
  201. package/dist/assets/zh-DWWuPzr1.js +0 -4
  202. package/dist/assets/zh-tw-Ci21sS2Y.js +0 -3
@@ -1,4 +1,4 @@
1
- import{a1 as cr,j as i,E as _,a2 as ft,aa as Ve,a3 as Q,T as me,t as zt,aN as Yr,bL as Jr,I as Uo,bA as Wo,bM as zo,z as qo,aJ as Pa,bn as Ko,bN as _a,M as ur,bt as La,bu as Na,bv as Aa,br as Da,ad as Vo,L as Ma,bm as Fa,aw as Ba,al as Qr,a4 as Go,a6 as $a,ac as et,e as Gn,am as Ua,x as Hn,R as Ho,V as Xo,ar as Yo,bK as Jo,aF as Wa,as as Wt,bO as Yi,A as Ji,Z as za,P as qa,G as Ka,v as Va,$ as Ga,D as Ha,K as Qi,bp as Xa}from"./vendor-mui-core-xF5F4eT7.js";import{r as N,g as Zr,u as Ya,k as Ja,a as ei,e as Ee,b as Qa,l as Za}from"./vendor-react-D-afvo_7.js";import{j as Qo,d as el,S as tl,s as Zo,A as nl}from"./item-C5sAxGxS.js";import{a0 as dr,a3 as ct,a7 as ti,E as es,aC as Zi,b as ts,e as mt,aD as st,o as rl,m as il,n as hr,aa as ol,_ as ns,aE as eo,aF as sl,j as ni,C as al,aG as Kt,D as sr,aH as ll,f as to,aI as rs,aJ as ir,af as ri,ak as is,W as pr,aK as cl,aL as os,av as ul,aM as dl,aN as Ur,aO as hl,a6 as pl,aP as fl,a5 as ml}from"./vendor-arcblock-BFUPp1Ez.js";import{f as At,z as Cn,Z as gl,$ as vl,h as kt,a0 as yl,D as bl,a1 as xl,a2 as wl,a3 as El,C as fr,a4 as ss,X as Sl,a5 as Tl,a6 as jl,a7 as Ol,a8 as Qn,a9 as no,aa as kl}from"./index-uYcwdGZL.js";import{L as ro}from"./launch-result-message-keU5grqY.js";import{P as as}from"./page-header--y63DY5K.js";import{b as lt,p as Rl,B as Cl,C as io,x as qn,U as ls,Z as Il,a8 as Pl,G as _l,K as Er,w as ii,a9 as Ll,aa as Nl,ab as Al,ac as Dl,y as Un,ad as Ml,c as Fl}from"./vendor-utils-5TjOM6td.js";import{u as Bl,C as $l}from"./config-space-BYYAVRcS.js";import{R as Sr}from"./logo-uploader-pyVqJwKp.js";import{S as Ul}from"./index-CDvqNewi.js";import{s as cs,h as Wl,w as zl,f as ql,a as Kl,b as Vl,c as Gl,M as Hl}from"./index-ChSPqVLh.js";import{n as Xn,d as Xl,a as Yl,e as us,v as Jl}from"./vendor-hooks-BKxTDk_P.js";import{g as Ql}from"./get-safe-url-BVjMxmwp.js";import{p as Zl}from"./index-C2fPoxDR.js";import{r as ec}from"./cloneDeep-BRiLvZjr.js";import{I as oo}from"./index-BBOSdbE7.js";import{u as tc}from"./session-CV6ez46v.js";import{W as nc}from"./did-address-Bl2N44vc.js";import{_ as ds}from"./useLocalStorage-B5t6MEw6.js";import{f as hs}from"./format-error-C0Ke3VXF.js";import{a as so}from"./api-K65cLqol.js";import{d as rc,v as ic,e as oc}from"./util-PzCAH0nE.js";import{u as ps}from"./use-mobile-DnWfrhc7.js";import{C as sc}from"./content-layout-cWwRTmIc.js";import{C as ac,D as lc,a as cc}from"./connect-to-DIJ57-hM.js";import{d as uc}from"./ArrowDropDown-B7S4xnEe.js";import{d as dc}from"./ChevronLeft-D1qkw0FM.js";import{d as hc}from"./ChevronRight-CEkTH0up.js";const df="blocklet-add-component-registry",hf="server-add-registry",pf=e=>`resource-${e}-add-registry`;var oi={},pc=cr;Object.defineProperty(oi,"__esModule",{value:!0});var fs=oi.default=void 0,fc=pc(dr()),mc=i;fs=oi.default=(0,fc.default)((0,mc.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function si({disabled:e,children:t,onConfirm:n}){return N.useEffect(()=>{if(e)return()=>{};const r=o=>{o.code==="Enter"&&(o.metaKey===!0||o.ctrlKey===!0)&&(o.preventDefault(),o.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}si.propTypes={disabled:_.bool,children:_.any.isRequired,onConfirm:_.func.isRequired};si.defaultProps={disabled:!1};function ai({onContinue:e,nextDisabled:t,launching:n,texts:r,description:o}){const[c,d]=N.useState(!1),h=()=>d(b=>!b);return i.jsxs(i.Fragment,{children:[i.jsx(gc,{children:i.jsxs(si,{disabled:t,onConfirm:e,children:[i.jsx("div",{className:"eula-trigger",onClick:h,children:r.listenName}),i.jsx(ct,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?i.jsxs(i.Fragment,{children:[i.jsx(ft,{size:14}),r.launchingText]}):r.buttonNext})]})}),i.jsx(ti,{open:c,title:r.listenName,onClose:()=>d(!1),children:o})]})}ai.propTypes={onContinue:_.func.isRequired,nextDisabled:_.bool,launching:_.bool,description:_.any,texts:_.object};ai.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const gc=Ve.div`
1
+ import{a1 as Hr,j as i,E as L,a2 as ft,aa as Ve,a3 as Q,T as me,t as zt,aN as Xr,bL as Yr,I as $o,bA as Uo,bM as Wo,z as zo,aJ as Ca,bn as qo,bN as Ia,M as cr,bt as Pa,bu as La,bv as _a,br as Na,ad as Ko,L as Aa,bm as Da,aw as Ma,al as Jr,a4 as Vo,a6 as Fa,ac as et,e as Gn,am as Ba,x as Hn,R as Go,V as Ho,ar as Xo,bK as Yo,aF as $a,as as Wt,bO as Xi,A as Yi,Z as Ua,P as Wa,G as za,v as qa,$ as Ka,D as Va,K as Ji,bp as Ga}from"./vendor-mui-core-DrGFkjqr.js";import{r as N,g as Qr,u as Ha,k as Xa,a as Zr,e as Ee,b as Ya,l as Ja}from"./vendor-react-D-afvo_7.js";import{j as Jo,d as Qa,S as Za,s as Qo,A as el}from"./item-Bl6VQtAH.js";import{a0 as ei,a3 as ct,a7 as ti,E as Zo,aC as Qi,b as es,e as mt,aD as st,o as tl,m as nl,n as ur,aa as rl,_ as ts,aE as Zi,aF as il,j as ni,C as ol,aG as Kt,D as sr,aH as sl,f as eo,aI as ns,aJ as ir,af as ri,ak as rs,W as dr,aK as al,aL as is,av as ll,aM as cl,aN as Br,aO as ul,a6 as dl,aP as hl,a5 as pl}from"./vendor-arcblock-CLdpcBR_.js";import{f as At,z as Cn,Z as fl,$ as ml,h as kt,a0 as gl,D as vl,a1 as yl,a2 as bl,a3 as xl,C as hr,a4 as os,X as wl,a5 as El,a6 as Sl,a7 as Tl,a8 as Qn,a9 as to,aa as jl}from"./index-dZzRZ2ZY.js";import{L as no}from"./launch-result-message-B237vj_f.js";import{P as ss}from"./page-header-BVxfqM_P.js";import{b as lt,p as Ol,B as kl,C as ro,x as qn,U as as,Z as Rl,a8 as Cl,G as Il,K as xr,w as ii,a9 as Pl,aa as Ll,ab as _l,ac as Nl,y as Un,ad as Al,c as Dl}from"./vendor-utils-5TjOM6td.js";import{u as Ml,C as Fl}from"./config-space-Cjs4lh6z.js";import{R as wr}from"./logo-uploader-CXyCerZA.js";import{S as Bl}from"./index-CR0qrcky.js";import{s as ls,h as $l,w as Ul,f as Wl,a as zl,b as ql,c as Kl,M as Vl}from"./index-DcvnbXW2.js";import{o as Xn,e as Gl,a as Hl,f as cs,w as Xl}from"./vendor-hooks-ZnvK17j8.js";import{g as Yl}from"./get-safe-url-BRR4RLgg.js";import{p as Jl}from"./index-C2fPoxDR.js";import{r as Ql}from"./cloneDeep-BRiLvZjr.js";import{I as io}from"./index-B3zo8s95.js";import{u as Zl}from"./session-CldqrK3N.js";import{W as ec}from"./did-address-5heyoc8D.js";import{_ as us}from"./useLocalStorage-CM7gP1Ni.js";import{f as ds}from"./format-error-C0Ke3VXF.js";import{a as oo}from"./api-K65cLqol.js";import{d as tc,a as nc,v as rc,e as ic}from"./util-C5G3YrVZ.js";import{u as hs}from"./use-mobile-B7gJcr5J.js";import{C as oc}from"./content-layout-CE2kjm54.js";import{C as sc,D as ac,a as lc}from"./connect-to-aA5MeDcj.js";import{d as cc}from"./ArrowDropDown-CH-FgtE-.js";import{d as uc}from"./ChevronLeft-CtdCxfvp.js";import{d as dc}from"./ChevronRight-C0FYeIUm.js";const af="blocklet-add-component-registry",lf="server-add-registry",cf=e=>`resource-${e}-add-registry`;var oi={},hc=Hr;Object.defineProperty(oi,"__esModule",{value:!0});var ps=oi.default=void 0,pc=hc(ei()),fc=i;ps=oi.default=(0,pc.default)((0,fc.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function si({disabled:e,children:t,onConfirm:n}){return N.useEffect(()=>{if(e)return()=>{};const r=o=>{o.code==="Enter"&&(o.metaKey===!0||o.ctrlKey===!0)&&(o.preventDefault(),o.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}si.propTypes={disabled:L.bool,children:L.any.isRequired,onConfirm:L.func.isRequired};si.defaultProps={disabled:!1};function ai({onContinue:e,nextDisabled:t,launching:n,texts:r,description:o}){const[c,d]=N.useState(!1),h=()=>d(b=>!b);return i.jsxs(i.Fragment,{children:[i.jsx(mc,{children:i.jsxs(si,{disabled:t,onConfirm:e,children:[i.jsx("div",{className:"eula-trigger",onClick:h,children:r.listenName}),i.jsx(ct,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?i.jsxs(i.Fragment,{children:[i.jsx(ft,{size:14}),r.launchingText]}):r.buttonNext})]})}),i.jsx(ti,{open:c,title:r.listenName,onClose:()=>d(!1),children:o})]})}ai.propTypes={onContinue:L.func.isRequired,nextDisabled:L.bool,launching:L.bool,description:L.any,texts:L.object};ai.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const mc=Ve.div`
2
2
  margin: 0 auto;
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -27,18 +27,18 @@ import{a1 as cr,j as i,E as _,a2 as ft,aa as Ve,a3 as Q,T as me,t as zt,aN as Yr
27
27
  .next-button {
28
28
  min-width: 200px;
29
29
  }
30
- `;var li={exports:{}},ao=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,vc=/\n/g,yc=/^\s*/,bc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,xc=/^:\s*/,wc=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ec=/^[;\s]*/,Sc=/^\s+|\s+$/g,Tc=`
31
- `,lo="/",co="*",ln="",jc="comment",Oc="declaration",kc=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(S){var R=S.match(vc);R&&(n+=R.length);var L=S.lastIndexOf(Tc);r=~L?S.length-L:r+S.length}function c(){var S={line:n,column:r};return function(R){return R.position=new d(S),w(),R}}function d(S){this.start=S,this.end={line:n,column:r},this.source=t.source}d.prototype.content=e;function h(S){var R=new Error(t.source+":"+n+":"+r+": "+S);if(R.reason=S,R.filename=t.source,R.line=n,R.column=r,R.source=e,!t.silent)throw R}function b(S){var R=S.exec(e);if(R){var L=R[0];return o(L),e=e.slice(L.length),R}}function w(){b(yc)}function s(S){var R;for(S=S||[];R=a();)R!==!1&&S.push(R);return S}function a(){var S=c();if(!(lo!=e.charAt(0)||co!=e.charAt(1))){for(var R=2;ln!=e.charAt(R)&&(co!=e.charAt(R)||lo!=e.charAt(R+1));)++R;if(R+=2,ln===e.charAt(R-1))return h("End of comment missing");var L=e.slice(2,R-2);return r+=2,o(L),e=e.slice(R),r+=2,S({type:jc,comment:L})}}function O(){var S=c(),R=b(bc);if(R){if(a(),!b(xc))return h("property missing ':'");var L=b(wc),A=S({type:Oc,property:uo(R[0].replace(ao,ln)),value:L?uo(L[0].replace(ao,ln)):ln});return b(Ec),A}}function x(){var S=[];s(S);for(var R;R=O();)R!==!1&&(S.push(R),s(S));return S}return w(),x()};function uo(e){return e?e.replace(Sc,ln):ln}var Rc=kc;function ms(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=Rc(e),c=typeof t=="function",d,h,b=0,w=o.length;b<w;b++)r=o[b],d=r.property,h=r.value,c?t(d,h,r):h&&(n||(n={}),n[d]=h);return n}li.exports=ms;li.exports.default=ms;var Cc=li.exports;const Ic=Zr(Cc),Pc={}.hasOwnProperty;function _c(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Nc(e),o=Mc(e),c=Dc(e);let d,h;if(typeof n=="string"||typeof n=="boolean"?(d=n,n={}):(n||(n={}),d=n.prefix),t&&t.type==="root"){const b=t.children[0];h=t.children.length===1&&b.type==="element"?b:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")h=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return gs(e,h,{schema:n.space==="svg"?cs:Wl,prefix:d==null?r||o||c?"h-":void 0:typeof d=="string"?d:d?"h-":void 0,key:0,react:r,vue:o,vdom:c,hyperscript:Ac(e)})}function gs(e,t,n){const r=n.schema;let o=r,c=t.tagName;const d={},h=[];let b=-1,w;r.space==="html"&&c.toLowerCase()==="svg"&&(o=cs,n.schema=o);for(w in t.properties)t.properties&&Pc.call(t.properties,w)&&Lc(d,w,t.properties[w],n,c);if(n.vdom&&(o.space==="html"?c=c.toUpperCase():o.space&&(d.namespace=zl[o.space])),n.prefix&&(n.key++,d.key=n.prefix+n.key),t.children)for(;++b<t.children.length;){const s=t.children[b];s.type==="element"?h.push(gs(e,s,n)):s.type==="text"&&h.push(s.value)}return n.schema=r,h.length>0?e.call(t,c,d,h):e.call(t,c,d)}function Lc(e,t,n,r,o){const c=ql(r.schema,t);let d;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&c.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=c.commaSeparated?Kl(n):Vl(n)),c.boolean&&r.hyperscript&&(n=""),c.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Fc(n,o)),r.vue?c.property!=="style"&&(d="attrs"):c.mustUseProperty||(r.vdom?c.property!=="style"&&(d="attributes"):r.hyperscript&&(d="attrs")),d?e[d]=Object.assign(e[d]||{},{[c.attribute]:n}):c.space&&r.react?e[Gl[c.property]||c.property]=n:e[c.attribute]=n)}function Nc(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Ac(e){return"context"in e&&"cleanup"in e}function Dc(e){return e("div",{}).type==="VirtualNode"}function Mc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Fc(e,t){const n={};try{Ic(e,(r,o)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(c,d)=>d.toUpperCase())]=o})}catch(r){const o=r;throw o.message=t+"[style]"+o.message.slice(9),o}return n}var Bc=vs;function vs(e){if(typeof e=="string")return zc(e);if(e==null)return qc;if(typeof e=="object")return("length"in e?Wc:Uc)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function $c(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=vs(e[r]);return t}function Uc(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Wc(e){var t=$c(e),n=t.length;return r;function r(){for(var o=-1;++o<n;)if(t[o].apply(this,arguments))return!0;return!1}}function zc(e){return t;function t(n){return!!(n&&n.type===e)}}function qc(){return!0}var Kc=mr,Vc=Bc,ys=!0,bs="skip",or=!1;mr.CONTINUE=ys;mr.SKIP=bs;mr.EXIT=or;function mr(e,t,n,r){var o;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),o=Vc(t),c(e,null,[]);function c(h,b,w){var s=[],a;return(!t||o(h,b,w[w.length-1]||null))&&(s=ho(n(h,w)),s[0]===or)?s:h.children&&s[0]!==bs?(a=ho(d(h.children,w.concat(h))),a[0]===or?a:s):s}function d(h,b){for(var w=-1,s=r?-1:1,a=(r?h.length:w)+s,O;a>w&&a<h.length;){if(O=c(h[a],a,b),O[0]===or)return O;a=typeof O[1]=="number"?O[1]:a+s}}}function ho(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[ys,e]:[e]}var Gc=vr,gr=Kc,Hc=gr.CONTINUE,Xc=gr.SKIP,Yc=gr.EXIT;vr.CONTINUE=Hc;vr.SKIP=Xc;vr.EXIT=Yc;function vr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),gr(e,t,o,r);function o(c,d){var h=d[d.length-1],b=h?h.children.indexOf(c):null;return n(c,b,h)}}var Jc=Gc,Qc=Object.prototype.hasOwnProperty,Tr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Zc=function(t){return Jc(t,"element",eu),t};function eu(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Tr)!Qc.call(Tr,t)||e.properties[t]===void 0||(n=Tr[t],tu(e,n,e.properties[t]),delete e.properties[t])}}function tu(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var o=r+t+": "+n+";";e.properties.style=o}const nu=Zr(Zc);function ru(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const iu={}.hasOwnProperty,ou=new Set(["table","thead","tbody","tfoot","tr"]);function su(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,n=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:r});function r(c){let d=_c(o,n?nu(c):c,e.prefix);return c.type==="root"?(d=d&&typeof d=="object"&&"type"in d&&"props"in d&&d.type==="div"&&(c.children.length!==1||c.children[0].type!=="element")?d.props.children:[d],t(e.Fragment||"div",{},d)):d}function o(c,d,h){if(h&&ou.has(c)&&(h=h.filter(b=>!ru(b))),e.components&&iu.call(e.components,c)){const b=e.components[c];return e.passNode&&typeof b=="function"&&(d=Object.assign({node:this},d)),t(b,d,h)}return t(c,d,h)}}function ci({children:e}){return i.jsx(au,{children:e})}const po="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",au=Ve(Q)`
30
+ `;var li={exports:{}},so=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,gc=/\n/g,vc=/^\s*/,yc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,bc=/^:\s*/,xc=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,wc=/^[;\s]*/,Ec=/^\s+|\s+$/g,Sc=`
31
+ `,ao="/",lo="*",ln="",Tc="comment",jc="declaration",Oc=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(S){var R=S.match(gc);R&&(n+=R.length);var _=S.lastIndexOf(Sc);r=~_?S.length-_:r+S.length}function c(){var S={line:n,column:r};return function(R){return R.position=new d(S),w(),R}}function d(S){this.start=S,this.end={line:n,column:r},this.source=t.source}d.prototype.content=e;function h(S){var R=new Error(t.source+":"+n+":"+r+": "+S);if(R.reason=S,R.filename=t.source,R.line=n,R.column=r,R.source=e,!t.silent)throw R}function b(S){var R=S.exec(e);if(R){var _=R[0];return o(_),e=e.slice(_.length),R}}function w(){b(vc)}function s(S){var R;for(S=S||[];R=a();)R!==!1&&S.push(R);return S}function a(){var S=c();if(!(ao!=e.charAt(0)||lo!=e.charAt(1))){for(var R=2;ln!=e.charAt(R)&&(lo!=e.charAt(R)||ao!=e.charAt(R+1));)++R;if(R+=2,ln===e.charAt(R-1))return h("End of comment missing");var _=e.slice(2,R-2);return r+=2,o(_),e=e.slice(R),r+=2,S({type:Tc,comment:_})}}function O(){var S=c(),R=b(yc);if(R){if(a(),!b(bc))return h("property missing ':'");var _=b(xc),A=S({type:jc,property:co(R[0].replace(so,ln)),value:_?co(_[0].replace(so,ln)):ln});return b(wc),A}}function x(){var S=[];s(S);for(var R;R=O();)R!==!1&&(S.push(R),s(S));return S}return w(),x()};function co(e){return e?e.replace(Ec,ln):ln}var kc=Oc;function fs(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=kc(e),c=typeof t=="function",d,h,b=0,w=o.length;b<w;b++)r=o[b],d=r.property,h=r.value,c?t(d,h,r):h&&(n||(n={}),n[d]=h);return n}li.exports=fs;li.exports.default=fs;var Rc=li.exports;const Cc=Qr(Rc),Ic={}.hasOwnProperty;function Pc(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=_c(e),o=Dc(e),c=Ac(e);let d,h;if(typeof n=="string"||typeof n=="boolean"?(d=n,n={}):(n||(n={}),d=n.prefix),t&&t.type==="root"){const b=t.children[0];h=t.children.length===1&&b.type==="element"?b:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")h=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ms(e,h,{schema:n.space==="svg"?ls:$l,prefix:d==null?r||o||c?"h-":void 0:typeof d=="string"?d:d?"h-":void 0,key:0,react:r,vue:o,vdom:c,hyperscript:Nc(e)})}function ms(e,t,n){const r=n.schema;let o=r,c=t.tagName;const d={},h=[];let b=-1,w;r.space==="html"&&c.toLowerCase()==="svg"&&(o=ls,n.schema=o);for(w in t.properties)t.properties&&Ic.call(t.properties,w)&&Lc(d,w,t.properties[w],n,c);if(n.vdom&&(o.space==="html"?c=c.toUpperCase():o.space&&(d.namespace=Ul[o.space])),n.prefix&&(n.key++,d.key=n.prefix+n.key),t.children)for(;++b<t.children.length;){const s=t.children[b];s.type==="element"?h.push(ms(e,s,n)):s.type==="text"&&h.push(s.value)}return n.schema=r,h.length>0?e.call(t,c,d,h):e.call(t,c,d)}function Lc(e,t,n,r,o){const c=Wl(r.schema,t);let d;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&c.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=c.commaSeparated?zl(n):ql(n)),c.boolean&&r.hyperscript&&(n=""),c.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Mc(n,o)),r.vue?c.property!=="style"&&(d="attrs"):c.mustUseProperty||(r.vdom?c.property!=="style"&&(d="attributes"):r.hyperscript&&(d="attrs")),d?e[d]=Object.assign(e[d]||{},{[c.attribute]:n}):c.space&&r.react?e[Kl[c.property]||c.property]=n:e[c.attribute]=n)}function _c(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Nc(e){return"context"in e&&"cleanup"in e}function Ac(e){return e("div",{}).type==="VirtualNode"}function Dc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Mc(e,t){const n={};try{Cc(e,(r,o)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(c,d)=>d.toUpperCase())]=o})}catch(r){const o=r;throw o.message=t+"[style]"+o.message.slice(9),o}return n}var Fc=gs;function gs(e){if(typeof e=="string")return Wc(e);if(e==null)return zc;if(typeof e=="object")return("length"in e?Uc:$c)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Bc(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=gs(e[r]);return t}function $c(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Uc(e){var t=Bc(e),n=t.length;return r;function r(){for(var o=-1;++o<n;)if(t[o].apply(this,arguments))return!0;return!1}}function Wc(e){return t;function t(n){return!!(n&&n.type===e)}}function zc(){return!0}var qc=pr,Kc=Fc,vs=!0,ys="skip",or=!1;pr.CONTINUE=vs;pr.SKIP=ys;pr.EXIT=or;function pr(e,t,n,r){var o;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),o=Kc(t),c(e,null,[]);function c(h,b,w){var s=[],a;return(!t||o(h,b,w[w.length-1]||null))&&(s=uo(n(h,w)),s[0]===or)?s:h.children&&s[0]!==ys?(a=uo(d(h.children,w.concat(h))),a[0]===or?a:s):s}function d(h,b){for(var w=-1,s=r?-1:1,a=(r?h.length:w)+s,O;a>w&&a<h.length;){if(O=c(h[a],a,b),O[0]===or)return O;a=typeof O[1]=="number"?O[1]:a+s}}}function uo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[vs,e]:[e]}var Vc=mr,fr=qc,Gc=fr.CONTINUE,Hc=fr.SKIP,Xc=fr.EXIT;mr.CONTINUE=Gc;mr.SKIP=Hc;mr.EXIT=Xc;function mr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),fr(e,t,o,r);function o(c,d){var h=d[d.length-1],b=h?h.children.indexOf(c):null;return n(c,b,h)}}var Yc=Vc,Jc=Object.prototype.hasOwnProperty,Er={align:"text-align",valign:"vertical-align",height:"height",width:"width"},Qc=function(t){return Yc(t,"element",Zc),t};function Zc(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Er)!Jc.call(Er,t)||e.properties[t]===void 0||(n=Er[t],eu(e,n,e.properties[t]),delete e.properties[t])}}function eu(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var o=r+t+": "+n+";";e.properties.style=o}const tu=Qr(Qc);function nu(e){const t=e&&typeof e=="object"&&e.type==="text"?e.value||"":e;return typeof t=="string"&&t.replace(/[ \t\n\f\r]/g,"")===""}const ru={}.hasOwnProperty,iu=new Set(["table","thead","tbody","tfoot","tr"]);function ou(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,n=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:r});function r(c){let d=Pc(o,n?tu(c):c,e.prefix);return c.type==="root"?(d=d&&typeof d=="object"&&"type"in d&&"props"in d&&d.type==="div"&&(c.children.length!==1||c.children[0].type!=="element")?d.props.children:[d],t(e.Fragment||"div",{},d)):d}function o(c,d,h){if(h&&iu.has(c)&&(h=h.filter(b=>!nu(b))),e.components&&ru.call(e.components,c)){const b=e.components[c];return e.passNode&&typeof b=="function"&&(d=Object.assign({node:this},d)),t(b,d,h)}return t(c,d,h)}}function ci({children:e}){return i.jsx(su,{children:e})}const ho="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",su=Ve(Q)`
32
32
  .highlight pre,
33
33
  pre {
34
34
  border-radius: 5px;
35
35
  }
36
36
  code {
37
- font-family: ${po};
37
+ font-family: ${ho};
38
38
  }
39
39
  pre code {
40
40
  font-size: 14px;
41
- font-family: ${po};
41
+ font-family: ${ho};
42
42
  }
43
43
 
44
44
  h1,
@@ -62,7 +62,7 @@ import{a1 as cr,j as i,E as _,a2 as ft,aa as Ve,a3 as Q,T as me,t as zt,aN as Yr
62
62
  .anchor {
63
63
  display: none;
64
64
  }
65
- `;ci.propTypes={children:_.any.isRequired};ci.defaultProps={};function xs({infoList:e=[]}){return i.jsx(Q,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>i.jsxs(i.Fragment,{children:[i.jsx(Q,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),i.jsx(Q,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}xs.propTypes={infoList:_.arrayOf(_.shape({key:_.string,value:_.string}))};const lu=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,cu=new su({createElement:N.createElement}).Compiler,Ot={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ui({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:o,did:c}=r,d=At.getDisplayName({meta:r}),h=Xn(()=>o&&c?fetch(Zi(o,"/api/blocklets",c,"readme")).then(S=>S.json()):null,{refreshDeps:[o,c]}),b=Xl(()=>h.data?h.data[t]||h.data.en||h.data[Object.keys(h.data)[0]]:"",[h]),w=r&&r.htmlAst?cu(r.htmlAst):"",s=lu(r);let a=lt(r,"owner.fullName");if(a){const S=lt(r,"owner.did");S&&(a=i.jsxs(Q,{sx:{display:"flex",alignItems:"center",gap:1},children:[a,i.jsx(es,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else a=lt(r,"author.name");const O=[{key:lt(Ot[t],"appinfo.name"),value:At.getDisplayName({meta:r})},{key:lt(Ot[t],"appinfo.version"),value:r.version},{key:lt(Ot[t],"appinfo.author"),value:a},{type:"description",key:lt(Ot[t],"appinfo.description"),value:r.description}];r.requirements&&O.push({key:lt(Ot[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&O.push({key:lt(Ot[t],"appinfo.community"),value:i.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&O.push({key:lt(Ot[t],"appinfo.documentation"),value:i.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&O.push({key:lt(Ot[t],"appinfo.support"),value:i.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),w&&O.push({key:lt(Ot[t],"appinfo.overview"),value:""});let x;return t==="zh"?x=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["您可以免费使用 ",i.jsx("b",{children:d}),";"]}):i.jsxs("p",{children:["您需要购买才能使用 ",i.jsx("b",{children:d}),";"]}),i.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),i.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),i.jsx("p",{children:"下面为该应用的信息:"})]}):x=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["You can use ",i.jsx("b",{children:d})," for free;"]}):i.jsxs("p",{children:["You need to purchase before launch ",i.jsx("b",{children:d}),";"]}),i.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),i.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),i.jsx("p",{children:"Below is the information for the blocklet: "})]}),i.jsxs(du,{children:[n||x,i.jsx(xs,{infoList:O}),b?i.jsxs("div",{className:"app-overview",children:[i.jsx(me,{variant:"h5",gutterBottom:!0,children:lt(Ot[t],"appinfo.overview")}),i.jsx(ci,{children:i.jsx(uu,{component:"div",className:"content-wrapper post-content",children:i.jsx(Hl,{source:b,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,R,L)=>S.startsWith("/")?Zi(o,S):S})})})]}):w?i.jsx("div",{className:"app-overview",children:w}):null]})}const uu=Ve(me)`
65
+ `;ci.propTypes={children:L.any.isRequired};ci.defaultProps={};function bs({infoList:e=[]}){return i.jsx(Q,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>i.jsxs(i.Fragment,{children:[i.jsx(Q,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),i.jsx(Q,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}bs.propTypes={infoList:L.arrayOf(L.shape({key:L.string,value:L.string}))};const au=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,lu=new ou({createElement:N.createElement}).Compiler,Ot={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ui({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:o,did:c}=r,d=At.getDisplayName({meta:r}),h=Xn(()=>o&&c?fetch(Qi(o,"/api/blocklets",c,"readme")).then(S=>S.json()):null,{refreshDeps:[o,c]}),b=Gl(()=>h.data?h.data[t]||h.data.en||h.data[Object.keys(h.data)[0]]:"",[h]),w=r&&r.htmlAst?lu(r.htmlAst):"",s=au(r);let a=lt(r,"owner.fullName");if(a){const S=lt(r,"owner.did");S&&(a=i.jsxs(Q,{sx:{display:"flex",alignItems:"center",gap:1},children:[a,i.jsx(Zo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else a=lt(r,"author.name");const O=[{key:lt(Ot[t],"appinfo.name"),value:At.getDisplayName({meta:r})},{key:lt(Ot[t],"appinfo.version"),value:r.version},{key:lt(Ot[t],"appinfo.author"),value:a},{type:"description",key:lt(Ot[t],"appinfo.description"),value:r.description}];r.requirements&&O.push({key:lt(Ot[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&O.push({key:lt(Ot[t],"appinfo.community"),value:i.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&O.push({key:lt(Ot[t],"appinfo.documentation"),value:i.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&O.push({key:lt(Ot[t],"appinfo.support"),value:i.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),w&&O.push({key:lt(Ot[t],"appinfo.overview"),value:""});let x;return t==="zh"?x=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["您可以免费使用 ",i.jsx("b",{children:d}),";"]}):i.jsxs("p",{children:["您需要购买才能使用 ",i.jsx("b",{children:d}),";"]}),i.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),i.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),i.jsx("p",{children:"下面为该应用的信息:"})]}):x=i.jsxs(i.Fragment,{children:[s?i.jsxs("p",{children:["You can use ",i.jsx("b",{children:d})," for free;"]}):i.jsxs("p",{children:["You need to purchase before launch ",i.jsx("b",{children:d}),";"]}),i.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),i.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),i.jsx("p",{children:"Below is the information for the blocklet: "})]}),i.jsxs(uu,{children:[n||x,i.jsx(bs,{infoList:O}),b?i.jsxs("div",{className:"app-overview",children:[i.jsx(me,{variant:"h5",gutterBottom:!0,children:lt(Ot[t],"appinfo.overview")}),i.jsx(ci,{children:i.jsx(cu,{component:"div",className:"content-wrapper post-content",children:i.jsx(Vl,{source:b,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,R,_)=>S.startsWith("/")?Qi(o,S):S})})})]}):w?i.jsx("div",{className:"app-overview",children:w}):null]})}const cu=Ve(me)`
66
66
  width: 100%;
67
67
  word-wrap: break-word;
68
68
  word-break: break-word;
@@ -80,7 +80,7 @@ import{a1 as cr,j as i,E as _,a2 as ft,aa as Ve,a3 as Q,T as me,t as zt,aN as Yr
80
80
  iframe {
81
81
  width: 100% !important;
82
82
  }
83
- `,du=Ve.div`
83
+ `,uu=Ve.div`
84
84
  .info-table {
85
85
  a {
86
86
  word-break: break-all;
@@ -110,7 +110,7 @@ import{a1 as cr,j as i,E as _,a2 as ft,aa as Ve,a3 as Q,T as me,t as zt,aN as Yr
110
110
  margin-left: 2em;
111
111
  }
112
112
  }
113
- `;ui.propTypes={blockletMeta:_.object.isRequired,locale:_.string.isRequired,handleDescEle:_.node};ui.defaultProps={handleDescEle:""};function hu({...e}){return i.jsxs("div",{...e,style:{width:"100%"},children:[i.jsx("h3",{children:"End User License Agreement for Application"}),i.jsxs("p",{children:["Blocklet Server License Agreement ",ts.COPYRIGHT_OWNER," version 2020-08-28"]}),i.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),i.jsx("p",{children:"暂无"})]})}function pu(e){var t,n,r,o;return`${((t=e.bundleSource)==null?void 0:t.store)||e.meta.homepage}/assets/${(n=e.meta)==null?void 0:n.did}/${((r=e.meta)==null?void 0:r.logo)||"logo.png"}?v=${(o=e.meta)==null?void 0:o.version}`}function di({installRelated:e,meta:t,show:n,onClose:r,components:o,loading:c}){const{t:d}=mt(),h=zt(a=>a.breakpoints.down("md"));if(!n)return null;const b=!c&&o.length===0,w=!c&&o.length!==0,s=40;return i.jsxs(ti,{title:d("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(a,O)=>{O!=="backdropClick"&&r(!1)},PaperProps:{style:h?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[c&&i.jsx(Q,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:i.jsx(Q,{sx:{fontSize:32},color:"primary.main",component:st,icon:"line-md:loading-loop"})}),b&&i.jsx(Q,{sx:{textAlign:"center"},children:d("blocklet.component.noDependencies",{name:t.title})}),w&&i.jsx(Q,{sx:{marginBottom:2},children:o.map(a=>{if(!a.meta)return null;const{required:O}=a;let x;return e||O?x=1:x=.5,i.jsxs(Q,{sx:{opacity:x,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[i.jsx("img",{style:{width:s,height:s,minWidth:s,minHeight:s},src:pu(a),alt:a.meta.title}),i.jsxs(Q,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[i.jsxs(Q,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var S;window.open(Ql(`${((S=a.bundleSource)==null?void 0:S.store)||a.meta.homepage}/blocklets/${a.meta.did}`,{allowDomains:null}),"_blank")},children:[a.meta.title,i.jsx(Q,{sx:{display:O?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:d("blocklet.component.required")}),i.jsxs(Q,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[a.meta.version,i.jsx(Q,{className:"link-icon",icon:"fluent:open-20-filled",component:st,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),i.jsx(Q,{sx:{marginTop:0,opacity:.7},children:a.meta.description})]})]},a.meta.did)})})]})}di.propTypes={meta:_.object,show:_.bool,onClose:_.func.isRequired,installRelated:_.func,components:_.array.isRequired,loading:_.bool.isRequired};di.defaultProps={meta:null,show:!1,installRelated:!1};function fu(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function mu(e){const{api:t}=Cn(),[n]=Ya(),r=n.get("blocklet_meta_url")||fu(e),[o,c]=N.useState([]),[d,h]=N.useState(!1);return N.useEffect(()=>{!r||e!=null&&e.inputUrl||(h(!0),t.getDynamicComponents({input:{url:r}}).then(b=>{c(b.components)}).finally(()=>{h(!1)}))},[r]),{components:o,loading:d}}function ws(e){const{info:t}=Cn();return N.useMemo(()=>{var n,r,o;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((o=e.docker)!=null&&o.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function hi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:o}){const c=Ja(),{t:d,locale:h}=mt(),[b,w]=N.useState(!1),{components:s,loading:a}=mu(n),O=ws(n),x=r||(()=>{c(`/launch-blocklet/install${window.location.search}`)}),S=()=>{w(!0)},R=()=>{w(!1)};return i.jsxs(gu,{children:[i.jsx("div",{className:"app-content",children:i.jsx("div",{className:"agreement",children:i.jsx("div",{className:"agreement-content",children:O?i.jsx(ui,{blockletMeta:{data:n},locale:h,handleDescEle:o}):i.jsx(Q,{sx:{p:3},children:i.jsx(me,{children:d("launchBlocklet.dockerBlockletCantInstall")})})})})}),i.jsxs(Q,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[a?i.jsx(st,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,O&&t&&(s!=null&&s.length)?i.jsxs(Q,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[i.jsx(Yr,{sx:{mr:.5},checked:e,onChange:L=>t(L.currentTarget.checked),control:i.jsx(Jr,{}),label:i.jsx("span",{children:d("launchBlocklet.installRelatedComponents")})}),i.jsx(Q,{sx:{"> button svg":{color:"primary.main"}},children:i.jsx(Uo,{size:"small",onClick:S,children:i.jsx(st,{icon:"octicon:package-dependencies-16"})})})]}):null,i.jsx("div",{className:"button-container","data-cy":"agree-all",children:O?i.jsx(ai,{onContinue:x,description:i.jsx(hu,{}),texts:{listenName:d("launchBlocklet.license"),buttonNext:d("launchBlocklet.next")}}):null})]}),i.jsx(di,{installRelated:e,meta:n,show:b,onClose:R,components:s,loading:a})]})}hi.propTypes={meta:_.object.isRequired,onClickNext:_.func,handleDescEle:_.node,installRelated:_.bool,onChangeInstallRelated:_.func};hi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const gu=Ve.div`
113
+ `;ui.propTypes={blockletMeta:L.object.isRequired,locale:L.string.isRequired,handleDescEle:L.node};ui.defaultProps={handleDescEle:""};function du({...e}){return i.jsxs("div",{...e,style:{width:"100%"},children:[i.jsx("h3",{children:"End User License Agreement for Application"}),i.jsxs("p",{children:["Blocklet Server License Agreement ",es.COPYRIGHT_OWNER," version 2020-08-28"]}),i.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),i.jsx("p",{children:"暂无"})]})}function hu(e){var t,n,r,o;return`${((t=e.bundleSource)==null?void 0:t.store)||e.meta.homepage}/assets/${(n=e.meta)==null?void 0:n.did}/${((r=e.meta)==null?void 0:r.logo)||"logo.png"}?v=${(o=e.meta)==null?void 0:o.version}`}function di({installRelated:e,meta:t,show:n,onClose:r,components:o,loading:c}){const{t:d}=mt(),h=zt(a=>a.breakpoints.down("md"));if(!n)return null;const b=!c&&o.length===0,w=!c&&o.length!==0,s=40;return i.jsxs(ti,{title:d("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(a,O)=>{O!=="backdropClick"&&r(!1)},PaperProps:{style:h?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[c&&i.jsx(Q,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:i.jsx(Q,{sx:{fontSize:32},color:"primary.main",component:st,icon:"line-md:loading-loop"})}),b&&i.jsx(Q,{sx:{textAlign:"center"},children:d("blocklet.component.noDependencies",{name:t.title})}),w&&i.jsx(Q,{sx:{marginBottom:2},children:o.map(a=>{if(!a.meta)return null;const{required:O}=a;let x;return e||O?x=1:x=.5,i.jsxs(Q,{sx:{opacity:x,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[i.jsx("img",{style:{width:s,height:s,minWidth:s,minHeight:s},src:hu(a),alt:a.meta.title}),i.jsxs(Q,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[i.jsxs(Q,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var S;window.open(Yl(`${((S=a.bundleSource)==null?void 0:S.store)||a.meta.homepage}/blocklets/${a.meta.did}`,{allowDomains:null}),"_blank")},children:[a.meta.title,i.jsx(Q,{sx:{display:O?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:d("blocklet.component.required")}),i.jsxs(Q,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[a.meta.version,i.jsx(Q,{className:"link-icon",icon:"fluent:open-20-filled",component:st,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),i.jsx(Q,{sx:{marginTop:0,opacity:.7},children:a.meta.description})]})]},a.meta.did)})})]})}di.propTypes={meta:L.object,show:L.bool,onClose:L.func.isRequired,installRelated:L.func,components:L.array.isRequired,loading:L.bool.isRequired};di.defaultProps={meta:null,show:!1,installRelated:!1};function pu(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function fu(e){const{api:t}=Cn(),[n]=Ha(),r=n.get("blocklet_meta_url")||pu(e),[o,c]=N.useState([]),[d,h]=N.useState(!1);return N.useEffect(()=>{!r||e!=null&&e.inputUrl||(h(!0),t.getDynamicComponents({input:{url:r}}).then(b=>{c(b.components)}).finally(()=>{h(!1)}))},[r]),{components:o,loading:d}}function xs(e){const{info:t}=Cn();return N.useMemo(()=>{var n,r,o;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((o=e.docker)!=null&&o.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function hi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:o}){const c=Xa(),{t:d,locale:h}=mt(),[b,w]=N.useState(!1),{components:s,loading:a}=fu(n),O=xs(n),x=r||(()=>{c(`/launch-blocklet/install${window.location.search}`)}),S=()=>{w(!0)},R=()=>{w(!1)};return i.jsxs(mu,{children:[i.jsx("div",{className:"app-content",children:i.jsx("div",{className:"agreement",children:i.jsx("div",{className:"agreement-content",children:O?i.jsx(ui,{blockletMeta:{data:n},locale:h,handleDescEle:o}):i.jsx(Q,{sx:{p:3},children:i.jsx(me,{children:d("launchBlocklet.dockerBlockletCantInstall")})})})})}),i.jsxs(Q,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[a?i.jsx(st,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,O&&t&&(s!=null&&s.length)?i.jsxs(Q,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[i.jsx(Xr,{sx:{mr:.5},checked:e,onChange:_=>t(_.currentTarget.checked),control:i.jsx(Yr,{}),label:i.jsx("span",{children:d("launchBlocklet.installRelatedComponents")})}),i.jsx(Q,{sx:{"> button svg":{color:"primary.main"}},children:i.jsx($o,{size:"small",onClick:S,children:i.jsx(st,{icon:"octicon:package-dependencies-16"})})})]}):null,i.jsx("div",{className:"button-container","data-cy":"agree-all",children:O?i.jsx(ai,{onContinue:x,description:i.jsx(du,{}),texts:{listenName:d("launchBlocklet.license"),buttonNext:d("launchBlocklet.next")}}):null})]}),i.jsx(di,{installRelated:e,meta:n,show:b,onClose:R,components:s,loading:a})]})}hi.propTypes={meta:L.object.isRequired,onClickNext:L.func,handleDescEle:L.node,installRelated:L.bool,onChangeInstallRelated:L.func};hi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const mu=Ve.div`
114
114
  display: flex;
115
115
  flex-direction: column;
116
116
  align-items: center;
@@ -186,26 +186,26 @@ import{a1 as cr,j as i,E as _,a2 as ft,aa as Ve,a3 as Q,T as me,t as zt,aN as Yr
186
186
  padding-bottom: 16px;
187
187
  }
188
188
  }
189
- `;var Es={},pi={exports:{}},Ss={exports:{}},Mn=Ss.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(e){return"file-"+Ts(e)}}},fo={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:Ts};Object.keys(Mn).forEach(function(e){Object.keys(fo).forEach(function(t){Mn[e][t]||(Mn[e][t]=fo[t])}),Mn[e].protocols_re=RegExp("^("+Mn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ts(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var js=Ss.exports,mo=js,On=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let o=r.length;for(;o--;)t[r[o]]=n[r[o]];return t},vu=Ye;function Ye(e,t,n,r,o,c,d){var h=this;h.type=e,Object.keys(mo[e]).forEach(function(b){h[b]=mo[e][b]}),h.user=t,h.auth=n,h.project=r,h.committish=o,h.default=c,h.opts=d||{}}Ye.prototype.hash=function(){return this.committish?"#"+this.committish:""};Ye.prototype._fill=function(e,t){if(e){var n=On({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=On(On({},this.opts),t);var r=this;Object.keys(this).forEach(function(s){r[s]!=null&&n[s]==null&&(n[s]=r[s])});var o=n.auth,c=n.committish,d=n.fragment,h=n.path,b=n.project;Object.keys(n).forEach(function(s){var a=n[s];(s==="path"||s==="project")&&typeof a=="string"?n[s]=a.split("/").map(function(O){return encodeURIComponent(O)}).join("/"):s!=="domain"&&(n[s]=encodeURIComponent(a))}),n["auth@"]=o?o+"@":"",n["#fragment"]=d?"#"+this.hashformat(d):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=h?"#"+this.hashformat(h):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=b.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=c?"#"+c:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var w=e;return Object.keys(n).forEach(function(s){w=w.replace(new RegExp("[{]"+s+"[}]","g"),n[s])}),t.noGitPlus?w.replace(/^git[+]/,""):w}};Ye.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Ye.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Ye.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,On({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Ye.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Ye.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Ye.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Ye.prototype.git=function(e){return this._fill(this.gittemplate,e)};Ye.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Ye.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Ye.prototype.tarball=function(e){var t=On({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Ye.prototype.file=function(e,t){return this._fill(this.filetemplate,On({path:e},t))};Ye.prototype.getDefaultRepresentation=function(){return this.default};Ye.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var jr,go;function yu(){return go||(go=1,jr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),jr}var bu=ve;ve.Node=dn;ve.create=ve;function ve(e){var t=this;if(t instanceof ve||(t=new ve),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(o){t.push(o)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}ve.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};ve.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};ve.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};ve.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)wu(this,arguments[e]);return this.length};ve.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Eu(this,arguments[e]);return this.length};ve.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};ve.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};ve.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};ve.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};ve.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};ve.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};ve.prototype.map=function(e,t){t=t||this;for(var n=new ve,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ve.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ve,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ve.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;r!==null;o++)n=e(n,r.value,o),r=r.next;return n};ve.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;r!==null;o--)n=e(n,r.value,o),r=r.prev;return n};ve.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};ve.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};ve.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(;o!==null&&r<t;r++,o=o.next)n.push(o.value);return n};ve.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,o=this.tail;o!==null&&r>t;r--)o=o.prev;for(;o!==null&&r>e;r--,o=o.prev)n.push(o.value);return n};ve.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(var c=[],r=0;o&&r<t;r++)c.push(o.value),o=this.removeNode(o);o===null&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(var r=0;r<n.length;r++)o=xu(this,o,n[r]);return c};ve.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function xu(e,t,n){var r=t===e.head?new dn(n,null,t,e):new dn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function wu(e,t){e.tail=new dn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Eu(e,t){e.head=new dn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function dn(e,t,n,r){if(!(this instanceof dn))return new dn(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{yu()(ve)}catch{}const Su=bu,cn=Symbol("max"),Nt=Symbol("length"),jn=Symbol("lengthCalculator"),Wn=Symbol("allowStale"),un=Symbol("maxAge"),Lt=Symbol("dispose"),vo=Symbol("noDisposeOnSet"),We=Symbol("lruList"),yt=Symbol("cache"),Os=Symbol("updateAgeOnGet"),Or=()=>1;class Tu{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[cn]=t.max||1/0;const n=t.length||Or;if(this[jn]=typeof n!="function"?Or:n,this[Wn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[un]=t.maxAge||0,this[Lt]=t.dispose,this[vo]=t.noDisposeOnSet||!1,this[Os]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[cn]=t||1/0,Fn(this)}get max(){return this[cn]}set allowStale(t){this[Wn]=!!t}get allowStale(){return this[Wn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[un]=t,Fn(this)}get maxAge(){return this[un]}set lengthCalculator(t){typeof t!="function"&&(t=Or),t!==this[jn]&&(this[jn]=t,this[Nt]=0,this[We].forEach(n=>{n.length=this[jn](n.value,n.key),this[Nt]+=n.length})),Fn(this)}get lengthCalculator(){return this[jn]}get length(){return this[Nt]}get itemCount(){return this[We].length}rforEach(t,n){n=n||this;for(let r=this[We].tail;r!==null;){const o=r.prev;yo(this,t,r,n),r=o}}forEach(t,n){n=n||this;for(let r=this[We].head;r!==null;){const o=r.next;yo(this,t,r,n),r=o}}keys(){return this[We].toArray().map(t=>t.key)}values(){return this[We].toArray().map(t=>t.value)}reset(){this[Lt]&&this[We]&&this[We].length&&this[We].forEach(t=>this[Lt](t.key,t.value)),this[yt]=new Map,this[We]=new Su,this[Nt]=0}dump(){return this[We].map(t=>ar(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[We]}set(t,n,r){if(r=r||this[un],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const o=r?Date.now():0,c=this[jn](n,t);if(this[yt].has(t)){if(c>this[cn])return kn(this,this[yt].get(t)),!1;const b=this[yt].get(t).value;return this[Lt]&&(this[vo]||this[Lt](t,b.value)),b.now=o,b.maxAge=r,b.value=n,this[Nt]+=c-b.length,b.length=c,this.get(t),Fn(this),!0}const d=new ju(t,n,c,o,r);return d.length>this[cn]?(this[Lt]&&this[Lt](t,n),!1):(this[Nt]+=d.length,this[We].unshift(d),this[yt].set(t,this[We].head),Fn(this),!0)}has(t){if(!this[yt].has(t))return!1;const n=this[yt].get(t).value;return!ar(this,n)}get(t){return kr(this,t,!0)}peek(t){return kr(this,t,!1)}pop(){const t=this[We].tail;return t?(kn(this,t),t.value):null}del(t){kn(this,this[yt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const o=t[r],c=o.e||0;if(c===0)this.set(o.k,o.v);else{const d=c-n;d>0&&this.set(o.k,o.v,d)}}}prune(){this[yt].forEach((t,n)=>kr(this,n,!1))}}const kr=(e,t,n)=>{const r=e[yt].get(t);if(r){const o=r.value;if(ar(e,o)){if(kn(e,r),!e[Wn])return}else n&&(e[Os]&&(r.value.now=Date.now()),e[We].unshiftNode(r));return o.value}},ar=(e,t)=>{if(!t||!t.maxAge&&!e[un])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[un]&&n>e[un]},Fn=e=>{if(e[Nt]>e[cn])for(let t=e[We].tail;e[Nt]>e[cn]&&t!==null;){const n=t.prev;kn(e,t),t=n}},kn=(e,t)=>{if(t){const n=t.value;e[Lt]&&e[Lt](n.key,n.value),e[Nt]-=n.length,e[yt].delete(n.key),e[We].removeNode(t)}};class ju{constructor(t,n,r,o,c){this.key=t,this.value=n,this.length=r,this.now=o,this.maxAge=c||0}}const yo=(e,t,n,r)=>{let o=n.value;ar(e,o)&&(kn(e,n),e[Wn]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var Ou=Tu,Wr=gl,bo=js,ku=pi.exports=vu,Ru=Ou,Rr=new Ru({max:1e3}),Cu={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Iu(e){return Cu[e]||e.slice(0,-1)}var Pu={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};pi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Rr.has(n)||Rr.set(n,_u(e,t)),Rr.get(n)}};function _u(e,t){if(!(e==null||e==="")){var n=Nu(Lu(e)?"github:"+e:e),r=Au(n),o=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),c=Object.keys(bo).map(function(d){try{var h=bo[d],b=null;r.auth&&Pu[r.protocol]&&(b=r.auth);var w=r.hash?decodeURIComponent(r.hash.substr(1)):null,s=null,a=null,O=null;if(o&&o[1]===d)s=o[2]&&decodeURIComponent(o[2]),a=decodeURIComponent(o[3].replace(/\.git$/,"")),O="shortcut";else{if(r.host&&r.host!==h.domain&&r.host.replace(/^www[.]/,"")!==h.domain||!h.protocols_re.test(r.protocol)||!r.path)return;var x=h.pathmatch,S=r.path.match(x);if(!S)return;S[1]!==null&&S[1]!==void 0&&(s=decodeURIComponent(S[1].replace(/^:/,""))),a=decodeURIComponent(S[2]),O=Iu(r.protocol)}return new ku(d,s,b,a,w,O,t)}catch(R){if(!(R instanceof URIError))throw R}}).filter(function(d){return d});if(c.length===1)return c[0]}}function Lu(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Nu(e){var t=Wr.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Au(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=Wr.parse(e);if(n.auth){const o=e.match(/[^@]+@[^:/]+/);if(o){var r=new Wr.URL(o[0]);n.auth=r.username||"",r.password&&(n.auth+=":"+r.password)}}return n}return{protocol:"git+ssh:",slashes:!0,auth:t[1],host:t[2],port:null,hostname:t[2],hash:t[4],search:null,query:null,pathname:"/"+t[3],path:"/"+t[3],href:"git+ssh://"+t[1]+"@"+t[2]+"/"+t[3]+(t[4]||"")}}var Du=pi.exports,hn={},te={},Mu=null;const Fu=Object.freeze(Object.defineProperty({__proto__:null,default:Mu},Symbol.toStringTag,{value:"Module"})),ks=ei(Fu),Bu=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],$u=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Uu={charsWide:Bu,charsFullWidth:$u};const{charsWide:Wu,charsFullWidth:zu}=Uu,Rs=new RegExp(`[${Wu.join("")}${zu.join("")}]`,"g"),qu=e=>e.replace(Rs,"xx").length;var Ku={default:qu,charsRegex:Rs};/*!
189
+ `;var ws={},pi={exports:{}},Es={exports:{}},Mn=Es.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(e){return"file-"+Ss(e)}}},po={sshtemplate:"git@{domain}:{user}/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{user}/{project}.git{#committish}",browsetemplate:"https://{domain}/{user}/{project}{/tree/committish}",browsefiletemplate:"https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",docstemplate:"https://{domain}/{user}/{project}{/tree/committish}#readme",httpstemplate:"git+https://{auth@}{domain}/{user}/{project}.git{#committish}",filetemplate:"https://{domain}/{user}/{project}/raw/{committish}/{path}",shortcuttemplate:"{type}:{user}/{project}{#committish}",pathtemplate:"{user}/{project}{#committish}",pathmatch:/^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,hashformat:Ss};Object.keys(Mn).forEach(function(e){Object.keys(po).forEach(function(t){Mn[e][t]||(Mn[e][t]=po[t])}),Mn[e].protocols_re=RegExp("^("+Mn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Ss(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var Ts=Es.exports,fo=Ts,On=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let o=r.length;for(;o--;)t[r[o]]=n[r[o]];return t},gu=Ye;function Ye(e,t,n,r,o,c,d){var h=this;h.type=e,Object.keys(fo[e]).forEach(function(b){h[b]=fo[e][b]}),h.user=t,h.auth=n,h.project=r,h.committish=o,h.default=c,h.opts=d||{}}Ye.prototype.hash=function(){return this.committish?"#"+this.committish:""};Ye.prototype._fill=function(e,t){if(e){var n=On({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=On(On({},this.opts),t);var r=this;Object.keys(this).forEach(function(s){r[s]!=null&&n[s]==null&&(n[s]=r[s])});var o=n.auth,c=n.committish,d=n.fragment,h=n.path,b=n.project;Object.keys(n).forEach(function(s){var a=n[s];(s==="path"||s==="project")&&typeof a=="string"?n[s]=a.split("/").map(function(O){return encodeURIComponent(O)}).join("/"):s!=="domain"&&(n[s]=encodeURIComponent(a))}),n["auth@"]=o?o+"@":"",n["#fragment"]=d?"#"+this.hashformat(d):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=h?"#"+this.hashformat(h):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=b.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=c?"#"+c:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var w=e;return Object.keys(n).forEach(function(s){w=w.replace(new RegExp("[{]"+s+"[}]","g"),n[s])}),t.noGitPlus?w.replace(/^git[+]/,""):w}};Ye.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Ye.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Ye.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,On({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Ye.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Ye.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Ye.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Ye.prototype.git=function(e){return this._fill(this.gittemplate,e)};Ye.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Ye.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Ye.prototype.tarball=function(e){var t=On({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Ye.prototype.file=function(e,t){return this._fill(this.filetemplate,On({path:e},t))};Ye.prototype.getDefaultRepresentation=function(){return this.default};Ye.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Sr,mo;function vu(){return mo||(mo=1,Sr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Sr}var yu=ve;ve.Node=dn;ve.create=ve;function ve(e){var t=this;if(t instanceof ve||(t=new ve),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(o){t.push(o)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}ve.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};ve.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};ve.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};ve.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)xu(this,arguments[e]);return this.length};ve.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)wu(this,arguments[e]);return this.length};ve.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};ve.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};ve.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};ve.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};ve.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};ve.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};ve.prototype.map=function(e,t){t=t||this;for(var n=new ve,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ve.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ve,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ve.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=0;r!==null;o++)n=e(n,r.value,o),r=r.next;return n};ve.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var o=this.length-1;r!==null;o--)n=e(n,r.value,o),r=r.prev;return n};ve.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};ve.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};ve.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(;o!==null&&r<t;r++,o=o.next)n.push(o.value);return n};ve.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,o=this.tail;o!==null&&r>t;r--)o=o.prev;for(;o!==null&&r>e;r--,o=o.prev)n.push(o.value);return n};ve.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;o!==null&&r<e;r++)o=o.next;for(var c=[],r=0;o&&r<t;r++)c.push(o.value),o=this.removeNode(o);o===null&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(var r=0;r<n.length;r++)o=bu(this,o,n[r]);return c};ve.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function bu(e,t,n){var r=t===e.head?new dn(n,null,t,e):new dn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function xu(e,t){e.tail=new dn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function wu(e,t){e.head=new dn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function dn(e,t,n,r){if(!(this instanceof dn))return new dn(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{vu()(ve)}catch{}const Eu=yu,cn=Symbol("max"),Nt=Symbol("length"),jn=Symbol("lengthCalculator"),Wn=Symbol("allowStale"),un=Symbol("maxAge"),_t=Symbol("dispose"),go=Symbol("noDisposeOnSet"),We=Symbol("lruList"),yt=Symbol("cache"),js=Symbol("updateAgeOnGet"),Tr=()=>1;class Su{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[cn]=t.max||1/0;const n=t.length||Tr;if(this[jn]=typeof n!="function"?Tr:n,this[Wn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[un]=t.maxAge||0,this[_t]=t.dispose,this[go]=t.noDisposeOnSet||!1,this[js]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[cn]=t||1/0,Fn(this)}get max(){return this[cn]}set allowStale(t){this[Wn]=!!t}get allowStale(){return this[Wn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[un]=t,Fn(this)}get maxAge(){return this[un]}set lengthCalculator(t){typeof t!="function"&&(t=Tr),t!==this[jn]&&(this[jn]=t,this[Nt]=0,this[We].forEach(n=>{n.length=this[jn](n.value,n.key),this[Nt]+=n.length})),Fn(this)}get lengthCalculator(){return this[jn]}get length(){return this[Nt]}get itemCount(){return this[We].length}rforEach(t,n){n=n||this;for(let r=this[We].tail;r!==null;){const o=r.prev;vo(this,t,r,n),r=o}}forEach(t,n){n=n||this;for(let r=this[We].head;r!==null;){const o=r.next;vo(this,t,r,n),r=o}}keys(){return this[We].toArray().map(t=>t.key)}values(){return this[We].toArray().map(t=>t.value)}reset(){this[_t]&&this[We]&&this[We].length&&this[We].forEach(t=>this[_t](t.key,t.value)),this[yt]=new Map,this[We]=new Eu,this[Nt]=0}dump(){return this[We].map(t=>ar(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[We]}set(t,n,r){if(r=r||this[un],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const o=r?Date.now():0,c=this[jn](n,t);if(this[yt].has(t)){if(c>this[cn])return kn(this,this[yt].get(t)),!1;const b=this[yt].get(t).value;return this[_t]&&(this[go]||this[_t](t,b.value)),b.now=o,b.maxAge=r,b.value=n,this[Nt]+=c-b.length,b.length=c,this.get(t),Fn(this),!0}const d=new Tu(t,n,c,o,r);return d.length>this[cn]?(this[_t]&&this[_t](t,n),!1):(this[Nt]+=d.length,this[We].unshift(d),this[yt].set(t,this[We].head),Fn(this),!0)}has(t){if(!this[yt].has(t))return!1;const n=this[yt].get(t).value;return!ar(this,n)}get(t){return jr(this,t,!0)}peek(t){return jr(this,t,!1)}pop(){const t=this[We].tail;return t?(kn(this,t),t.value):null}del(t){kn(this,this[yt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const o=t[r],c=o.e||0;if(c===0)this.set(o.k,o.v);else{const d=c-n;d>0&&this.set(o.k,o.v,d)}}}prune(){this[yt].forEach((t,n)=>jr(this,n,!1))}}const jr=(e,t,n)=>{const r=e[yt].get(t);if(r){const o=r.value;if(ar(e,o)){if(kn(e,r),!e[Wn])return}else n&&(e[js]&&(r.value.now=Date.now()),e[We].unshiftNode(r));return o.value}},ar=(e,t)=>{if(!t||!t.maxAge&&!e[un])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[un]&&n>e[un]},Fn=e=>{if(e[Nt]>e[cn])for(let t=e[We].tail;e[Nt]>e[cn]&&t!==null;){const n=t.prev;kn(e,t),t=n}},kn=(e,t)=>{if(t){const n=t.value;e[_t]&&e[_t](n.key,n.value),e[Nt]-=n.length,e[yt].delete(n.key),e[We].removeNode(t)}};class Tu{constructor(t,n,r,o,c){this.key=t,this.value=n,this.length=r,this.now=o,this.maxAge=c||0}}const vo=(e,t,n,r)=>{let o=n.value;ar(e,o)&&(kn(e,n),e[Wn]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var ju=Su,$r=fl,yo=Ts,Ou=pi.exports=gu,ku=ju,Or=new ku({max:1e3}),Ru={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Cu(e){return Ru[e]||e.slice(0,-1)}var Iu={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};pi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Or.has(n)||Or.set(n,Pu(e,t)),Or.get(n)}};function Pu(e,t){if(!(e==null||e==="")){var n=_u(Lu(e)?"github:"+e:e),r=Nu(n),o=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),c=Object.keys(yo).map(function(d){try{var h=yo[d],b=null;r.auth&&Iu[r.protocol]&&(b=r.auth);var w=r.hash?decodeURIComponent(r.hash.substr(1)):null,s=null,a=null,O=null;if(o&&o[1]===d)s=o[2]&&decodeURIComponent(o[2]),a=decodeURIComponent(o[3].replace(/\.git$/,"")),O="shortcut";else{if(r.host&&r.host!==h.domain&&r.host.replace(/^www[.]/,"")!==h.domain||!h.protocols_re.test(r.protocol)||!r.path)return;var x=h.pathmatch,S=r.path.match(x);if(!S)return;S[1]!==null&&S[1]!==void 0&&(s=decodeURIComponent(S[1].replace(/^:/,""))),a=decodeURIComponent(S[2]),O=Cu(r.protocol)}return new Ou(d,s,b,a,w,O,t)}catch(R){if(!(R instanceof URIError))throw R}}).filter(function(d){return d});if(c.length===1)return c[0]}}function Lu(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function _u(e){var t=$r.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Nu(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=$r.parse(e);if(n.auth){const o=e.match(/[^@]+@[^:/]+/);if(o){var r=new $r.URL(o[0]);n.auth=r.username||"",r.password&&(n.auth+=":"+r.password)}}return n}return{protocol:"git+ssh:",slashes:!0,auth:t[1],host:t[2],port:null,hostname:t[2],hash:t[4],search:null,query:null,pathname:"/"+t[3],path:"/"+t[3],href:"git+ssh://"+t[1]+"@"+t[2]+"/"+t[3]+(t[4]||"")}}var Au=pi.exports,hn={},te={},Du=null;const Mu=Object.freeze(Object.defineProperty({__proto__:null,default:Du},Symbol.toStringTag,{value:"Module"})),Os=Zr(Mu),Fu=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Bu=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var $u={charsWide:Fu,charsFullWidth:Bu};const{charsWide:Uu,charsFullWidth:Wu}=$u,ks=new RegExp(`[${Uu.join("")}${Wu.join("")}]`,"g"),zu=e=>e.replace(ks,"xx").length;var qu={default:zu,charsRegex:ks};/*!
190
190
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
191
191
  *
192
192
  * Copyright (c) 2014-2016, Jon Schlinkert.
193
193
  * Licensed under the MIT License.
194
- */var Vu=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
194
+ */var Ku=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
195
195
  * is-glob <https://github.com/jonschlinkert/is-glob>
196
196
  *
197
197
  * Copyright (c) 2014-2017, Jon Schlinkert.
198
198
  * Released under the MIT License.
199
- */var Gu=Vu,Cs={"{":"}","(":")","[":"]"},Hu=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,o=-2,c=-2,d=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||r!==-1&&e[t]==="["&&e[t+1]!=="]"&&(r<t&&(r=e.indexOf("]",t)),r>t&&(d===-1||d>r||(d=e.indexOf("\\",t),d===-1||d>r)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(d=e.indexOf("\\",t),d===-1||d>o))||c!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(c=e.indexOf(")",t),c>t&&(d=e.indexOf("\\",t),d===-1||d>c))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(c=e.indexOf(")",n),c>n&&(d=e.indexOf("\\",n),d===-1||d>c))))return!0;if(e[t]==="\\"){var h=e[t+1];t+=2;var b=Cs[h];if(b){var w=e.indexOf(b,t);w!==-1&&(t=w+1)}if(e[t]==="!")return!0}else t++}return!1},Xu=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var n=e[t+1];t+=2;var r=Cs[n];if(r){var o=e.indexOf(r,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1},Yu=function(t,n){if(typeof t!="string"||t==="")return!1;if(Gu(t))return!0;var r=Hu;return n&&n.strict===!1&&(r=Xu),r(t)},zr={exports:{}};(function(e,t){var n={};t=e.exports=F;var r;typeof Rl=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var l=Array.prototype.slice.call(arguments,0);l.unshift("SEMVER"),console.log.apply(console,l)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=256,c=Number.MAX_SAFE_INTEGER||9007199254740991,d=16,h=o-6,b=t.re=[],w=t.safeRe=[],s=t.src=[],a=t.tokens={},O=0;function x(l){a[l]=O++}var S="[a-zA-Z0-9-]",R=[["\\s",1],["\\d",o],[S,h]];function L(l){for(var p=0;p<R.length;p++){var y=R[p][0],k=R[p][1];l=l.split(y+"*").join(y+"{0,"+k+"}").split(y+"+").join(y+"{1,"+k+"}")}return l}x("NUMERICIDENTIFIER"),s[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",x("NUMERICIDENTIFIERLOOSE"),s[a.NUMERICIDENTIFIERLOOSE]="\\d+",x("NONNUMERICIDENTIFIER"),s[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",x("MAINVERSION"),s[a.MAINVERSION]="("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")",x("MAINVERSIONLOOSE"),s[a.MAINVERSIONLOOSE]="("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")",x("PRERELEASEIDENTIFIER"),s[a.PRERELEASEIDENTIFIER]="(?:"+s[a.NUMERICIDENTIFIER]+"|"+s[a.NONNUMERICIDENTIFIER]+")",x("PRERELEASEIDENTIFIERLOOSE"),s[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[a.NUMERICIDENTIFIERLOOSE]+"|"+s[a.NONNUMERICIDENTIFIER]+")",x("PRERELEASE"),s[a.PRERELEASE]="(?:-("+s[a.PRERELEASEIDENTIFIER]+"(?:\\."+s[a.PRERELEASEIDENTIFIER]+")*))",x("PRERELEASELOOSE"),s[a.PRERELEASELOOSE]="(?:-?("+s[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[a.PRERELEASEIDENTIFIERLOOSE]+")*))",x("BUILDIDENTIFIER"),s[a.BUILDIDENTIFIER]=S+"+",x("BUILD"),s[a.BUILD]="(?:\\+("+s[a.BUILDIDENTIFIER]+"(?:\\."+s[a.BUILDIDENTIFIER]+")*))",x("FULL"),x("FULLPLAIN"),s[a.FULLPLAIN]="v?"+s[a.MAINVERSION]+s[a.PRERELEASE]+"?"+s[a.BUILD]+"?",s[a.FULL]="^"+s[a.FULLPLAIN]+"$",x("LOOSEPLAIN"),s[a.LOOSEPLAIN]="[v=\\s]*"+s[a.MAINVERSIONLOOSE]+s[a.PRERELEASELOOSE]+"?"+s[a.BUILD]+"?",x("LOOSE"),s[a.LOOSE]="^"+s[a.LOOSEPLAIN]+"$",x("GTLT"),s[a.GTLT]="((?:<|>)?=?)",x("XRANGEIDENTIFIERLOOSE"),s[a.XRANGEIDENTIFIERLOOSE]=s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",x("XRANGEIDENTIFIER"),s[a.XRANGEIDENTIFIER]=s[a.NUMERICIDENTIFIER]+"|x|X|\\*",x("XRANGEPLAIN"),s[a.XRANGEPLAIN]="[v=\\s]*("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:"+s[a.PRERELEASE]+")?"+s[a.BUILD]+"?)?)?",x("XRANGEPLAINLOOSE"),s[a.XRANGEPLAINLOOSE]="[v=\\s]*("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:"+s[a.PRERELEASELOOSE]+")?"+s[a.BUILD]+"?)?)?",x("XRANGE"),s[a.XRANGE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAIN]+"$",x("XRANGELOOSE"),s[a.XRANGELOOSE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAINLOOSE]+"$",x("COERCE"),s[a.COERCE]="(^|[^\\d])(\\d{1,"+d+"})(?:\\.(\\d{1,"+d+"}))?(?:\\.(\\d{1,"+d+"}))?(?:$|[^\\d])",x("COERCERTL"),b[a.COERCERTL]=new RegExp(s[a.COERCE],"g"),w[a.COERCERTL]=new RegExp(L(s[a.COERCE]),"g"),x("LONETILDE"),s[a.LONETILDE]="(?:~>?)",x("TILDETRIM"),s[a.TILDETRIM]="(\\s*)"+s[a.LONETILDE]+"\\s+",b[a.TILDETRIM]=new RegExp(s[a.TILDETRIM],"g"),w[a.TILDETRIM]=new RegExp(L(s[a.TILDETRIM]),"g");var A="$1~";x("TILDE"),s[a.TILDE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAIN]+"$",x("TILDELOOSE"),s[a.TILDELOOSE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAINLOOSE]+"$",x("LONECARET"),s[a.LONECARET]="(?:\\^)",x("CARETTRIM"),s[a.CARETTRIM]="(\\s*)"+s[a.LONECARET]+"\\s+",b[a.CARETTRIM]=new RegExp(s[a.CARETTRIM],"g"),w[a.CARETTRIM]=new RegExp(L(s[a.CARETTRIM]),"g");var H="$1^";x("CARET"),s[a.CARET]="^"+s[a.LONECARET]+s[a.XRANGEPLAIN]+"$",x("CARETLOOSE"),s[a.CARETLOOSE]="^"+s[a.LONECARET]+s[a.XRANGEPLAINLOOSE]+"$",x("COMPARATORLOOSE"),s[a.COMPARATORLOOSE]="^"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+")$|^$",x("COMPARATOR"),s[a.COMPARATOR]="^"+s[a.GTLT]+"\\s*("+s[a.FULLPLAIN]+")$|^$",x("COMPARATORTRIM"),s[a.COMPARATORTRIM]="(\\s*)"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+"|"+s[a.XRANGEPLAIN]+")",b[a.COMPARATORTRIM]=new RegExp(s[a.COMPARATORTRIM],"g"),w[a.COMPARATORTRIM]=new RegExp(L(s[a.COMPARATORTRIM]),"g");var U="$1$2$3";x("HYPHENRANGE"),s[a.HYPHENRANGE]="^\\s*("+s[a.XRANGEPLAIN]+")\\s+-\\s+("+s[a.XRANGEPLAIN]+")\\s*$",x("HYPHENRANGELOOSE"),s[a.HYPHENRANGELOOSE]="^\\s*("+s[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[a.XRANGEPLAINLOOSE]+")\\s*$",x("STAR"),s[a.STAR]="(<|>)?=?\\s*\\*";for(var X=0;X<O;X++)r(X,s[X]),b[X]||(b[X]=new RegExp(s[X]),w[X]=new RegExp(L(s[X])));t.parse=j;function j(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof F)return l;if(typeof l!="string"||l.length>o)return null;var y=p.loose?w[a.LOOSE]:w[a.FULL];if(!y.test(l))return null;try{return new F(l,p)}catch{return null}}t.valid=W;function W(l,p){var y=j(l,p);return y?y.version:null}t.clean=Z;function Z(l,p){var y=j(l.trim().replace(/^[=v]+/,""),p);return y?y.version:null}t.SemVer=F;function F(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof F){if(l.loose===p.loose)return l;l=l.version}else if(typeof l!="string")throw new TypeError("Invalid Version: "+l);if(l.length>o)throw new TypeError("version is longer than "+o+" characters");if(!(this instanceof F))return new F(l,p);r("SemVer",l,p),this.options=p,this.loose=!!p.loose;var y=l.trim().match(p.loose?w[a.LOOSE]:w[a.FULL]);if(!y)throw new TypeError("Invalid Version: "+l);if(this.raw=l,this.major=+y[1],this.minor=+y[2],this.patch=+y[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");y[4]?this.prerelease=y[4].split(".").map(function(k){if(/^[0-9]+$/.test(k)){var P=+k;if(P>=0&&P<c)return P}return k}):this.prerelease=[],this.build=y[5]?y[5].split("."):[],this.format()}F.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},F.prototype.toString=function(){return this.version},F.prototype.compare=function(l){return r("SemVer.compare",this.version,this.options,l),l instanceof F||(l=new F(l,this.options)),this.compareMain(l)||this.comparePre(l)},F.prototype.compareMain=function(l){return l instanceof F||(l=new F(l,this.options)),Se(this.major,l.major)||Se(this.minor,l.minor)||Se(this.patch,l.patch)},F.prototype.comparePre=function(l){if(l instanceof F||(l=new F(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;var p=0;do{var y=this.prerelease[p],k=l.prerelease[p];if(r("prerelease compare",p,y,k),y===void 0&&k===void 0)return 0;if(k===void 0)return 1;if(y===void 0)return-1;if(y===k)continue;return Se(y,k)}while(++p)},F.prototype.compareBuild=function(l){l instanceof F||(l=new F(l,this.options));var p=0;do{var y=this.build[p],k=l.build[p];if(r("prerelease compare",p,y,k),y===void 0&&k===void 0)return 0;if(k===void 0)return 1;if(y===void 0)return-1;if(y===k)continue;return Se(y,k)}while(++p)},F.prototype.inc=function(l,p){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p),this.inc("pre",p);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p),this.inc("pre",p);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var y=this.prerelease.length;--y>=0;)typeof this.prerelease[y]=="number"&&(this.prerelease[y]++,y=-2);y===-1&&this.prerelease.push(0)}p&&(this.prerelease[0]===p?isNaN(this.prerelease[1])&&(this.prerelease=[p,0]):this.prerelease=[p,0]);break;default:throw new Error("invalid increment argument: "+l)}return this.format(),this.raw=this.version,this},t.inc=ce;function ce(l,p,y,k){typeof y=="string"&&(k=y,y=void 0);try{return new F(l,y).inc(p,k).version}catch{return null}}t.diff=Y;function Y(l,p){if(Ct(l,p))return null;var y=j(l),k=j(p),P="";if(y.prerelease.length||k.prerelease.length){P="pre";var z="prerelease"}for(var V in y)if((V==="major"||V==="minor"||V==="patch")&&y[V]!==k[V])return P+V;return z}t.compareIdentifiers=Se;var ae=/^[0-9]+$/;function Se(l,p){var y=ae.test(l),k=ae.test(p);return y&&k&&(l=+l,p=+p),l===p?0:y&&!k?-1:k&&!y?1:l<p?-1:1}t.rcompareIdentifiers=Fe;function Fe(l,p){return Se(p,l)}t.major=Ue;function Ue(l,p){return new F(l,p).major}t.minor=nt;function nt(l,p){return new F(l,p).minor}t.patch=ee;function ee(l,p){return new F(l,p).patch}t.compare=pe;function pe(l,p,y){return new F(l,y).compare(new F(p,y))}t.compareLoose=q;function q(l,p){return pe(l,p,!0)}t.compareBuild=Te;function Te(l,p,y){var k=new F(l,y),P=new F(p,y);return k.compare(P)||k.compareBuild(P)}t.rcompare=ie;function ie(l,p,y){return pe(p,l,y)}t.sort=dt;function dt(l,p){return l.sort(function(y,k){return t.compareBuild(y,k,p)})}t.rsort=we;function we(l,p){return l.sort(function(y,k){return t.compareBuild(k,y,p)})}t.gt=Je;function Je(l,p,y){return pe(l,p,y)>0}t.lt=ze;function ze(l,p,y){return pe(l,p,y)<0}t.eq=Ct;function Ct(l,p,y){return pe(l,p,y)===0}t.neq=Vt;function Vt(l,p,y){return pe(l,p,y)!==0}t.gte=Dt;function Dt(l,p,y){return pe(l,p,y)>=0}t.lte=Gt;function Gt(l,p,y){return pe(l,p,y)<=0}t.cmp=Ie;function Ie(l,p,y,k){switch(p){case"===":return typeof l=="object"&&(l=l.version),typeof y=="object"&&(y=y.version),l===y;case"!==":return typeof l=="object"&&(l=l.version),typeof y=="object"&&(y=y.version),l!==y;case"":case"=":case"==":return Ct(l,y,k);case"!=":return Vt(l,y,k);case">":return Je(l,y,k);case">=":return Dt(l,y,k);case"<":return ze(l,y,k);case"<=":return Gt(l,y,k);default:throw new TypeError("Invalid operator: "+p)}}t.Comparator=Pe;function Pe(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof Pe){if(l.loose===!!p.loose)return l;l=l.value}if(!(this instanceof Pe))return new Pe(l,p);l=l.trim().split(/\s+/).join(" "),r("comparator",l,p),this.options=p,this.loose=!!p.loose,this.parse(l),this.semver===Oe?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Oe={};Pe.prototype.parse=function(l){var p=this.options.loose?w[a.COMPARATORLOOSE]:w[a.COMPARATOR],y=l.match(p);if(!y)throw new TypeError("Invalid comparator: "+l);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new F(y[2],this.options.loose):this.semver=Oe},Pe.prototype.toString=function(){return this.value},Pe.prototype.test=function(l){if(r("Comparator.test",l,this.options.loose),this.semver===Oe||l===Oe)return!0;if(typeof l=="string")try{l=new F(l,this.options)}catch{return!1}return Ie(l,this.operator,this.semver,this.options)},Pe.prototype.intersects=function(l,p){if(!(l instanceof Pe))throw new TypeError("a Comparator is required");(!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1});var y;if(this.operator==="")return this.value===""?!0:(y=new ye(l.value,p),Ge(this.value,y,p));if(l.operator==="")return l.value===""?!0:(y=new ye(this.value,p),Ge(l.semver,y,p));var k=(this.operator===">="||this.operator===">")&&(l.operator===">="||l.operator===">"),P=(this.operator==="<="||this.operator==="<")&&(l.operator==="<="||l.operator==="<"),z=this.semver.version===l.semver.version,V=(this.operator===">="||this.operator==="<=")&&(l.operator===">="||l.operator==="<="),ue=Ie(this.semver,"<",l.semver,p)&&(this.operator===">="||this.operator===">")&&(l.operator==="<="||l.operator==="<"),oe=Ie(this.semver,">",l.semver,p)&&(this.operator==="<="||this.operator==="<")&&(l.operator===">="||l.operator===">");return k||P||z&&V||ue||oe},t.Range=ye;function ye(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof ye)return l.loose===!!p.loose&&l.includePrerelease===!!p.includePrerelease?l:new ye(l.raw,p);if(l instanceof Pe)return new ye(l.value,p);if(!(this instanceof ye))return new ye(l,p);if(this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease,this.raw=l.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(y){return this.parseRange(y.trim())},this).filter(function(y){return y.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ye.prototype.format=function(){return this.range=this.set.map(function(l){return l.join(" ").trim()}).join("||").trim(),this.range},ye.prototype.toString=function(){return this.range},ye.prototype.parseRange=function(l){var p=this.options.loose,y=p?w[a.HYPHENRANGELOOSE]:w[a.HYPHENRANGE];l=l.replace(y,gt),r("hyphen replace",l),l=l.replace(w[a.COMPARATORTRIM],U),r("comparator trim",l,w[a.COMPARATORTRIM]),l=l.replace(w[a.TILDETRIM],A),l=l.replace(w[a.CARETTRIM],H),l=l.split(/\s+/).join(" ");var k=p?w[a.COMPARATORLOOSE]:w[a.COMPARATOR],P=l.split(" ").map(function(z){return Xt(z,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(P=P.filter(function(z){return!!z.match(k)})),P=P.map(function(z){return new Pe(z,this.options)},this),P},ye.prototype.intersects=function(l,p){if(!(l instanceof ye))throw new TypeError("a Range is required");return this.set.some(function(y){return It(y,p)&&l.set.some(function(k){return It(k,p)&&y.every(function(P){return k.every(function(z){return P.intersects(z,p)})})})})};function It(l,p){for(var y=!0,k=l.slice(),P=k.pop();y&&k.length;)y=k.every(function(z){return P.intersects(z,p)}),P=k.pop();return y}t.toComparators=Ht;function Ht(l,p){return new ye(l,p).set.map(function(y){return y.map(function(k){return k.value}).join(" ").trim().split(" ")})}function Xt(l,p){return r("comp",l,p),l=gn(l,p),r("caret",l),l=Yt(l,p),r("tildes",l),l=Qe(l,p),r("xrange",l),l=wt(l,p),r("stars",l),l}function ge(l){return!l||l.toLowerCase()==="x"||l==="*"}function Yt(l,p){return l.trim().split(/\s+/).map(function(y){return mn(y,p)}).join(" ")}function mn(l,p){var y=p.loose?w[a.TILDELOOSE]:w[a.TILDE];return l.replace(y,function(k,P,z,V,ue){r("tilde",l,k,P,z,V,ue);var oe;return ge(P)?oe="":ge(z)?oe=">="+P+".0.0 <"+(+P+1)+".0.0":ge(V)?oe=">="+P+"."+z+".0 <"+P+"."+(+z+1)+".0":ue?(r("replaceTilde pr",ue),oe=">="+P+"."+z+"."+V+"-"+ue+" <"+P+"."+(+z+1)+".0"):oe=">="+P+"."+z+"."+V+" <"+P+"."+(+z+1)+".0",r("tilde return",oe),oe})}function gn(l,p){return l.trim().split(/\s+/).map(function(y){return Jt(y,p)}).join(" ")}function Jt(l,p){r("caret",l,p);var y=p.loose?w[a.CARETLOOSE]:w[a.CARET];return l.replace(y,function(k,P,z,V,ue){r("caret",l,k,P,z,V,ue);var oe;return ge(P)?oe="":ge(z)?oe=">="+P+".0.0 <"+(+P+1)+".0.0":ge(V)?P==="0"?oe=">="+P+"."+z+".0 <"+P+"."+(+z+1)+".0":oe=">="+P+"."+z+".0 <"+(+P+1)+".0.0":ue?(r("replaceCaret pr",ue),P==="0"?z==="0"?oe=">="+P+"."+z+"."+V+"-"+ue+" <"+P+"."+z+"."+(+V+1):oe=">="+P+"."+z+"."+V+"-"+ue+" <"+P+"."+(+z+1)+".0":oe=">="+P+"."+z+"."+V+"-"+ue+" <"+(+P+1)+".0.0"):(r("no pr"),P==="0"?z==="0"?oe=">="+P+"."+z+"."+V+" <"+P+"."+z+"."+(+V+1):oe=">="+P+"."+z+"."+V+" <"+P+"."+(+z+1)+".0":oe=">="+P+"."+z+"."+V+" <"+(+P+1)+".0.0"),r("caret return",oe),oe})}function Qe(l,p){return r("replaceXRanges",l,p),l.split(/\s+/).map(function(y){return xt(y,p)}).join(" ")}function xt(l,p){l=l.trim();var y=p.loose?w[a.XRANGELOOSE]:w[a.XRANGE];return l.replace(y,function(k,P,z,V,ue,oe){r("xRange",l,k,P,z,V,ue,oe);var Ae=ge(z),Be=Ae||ge(V),Re=Be||ge(ue),De=Re;return P==="="&&De&&(P=""),oe=p.includePrerelease?"-0":"",Ae?P===">"||P==="<"?k="<0.0.0-0":k="*":P&&De?(Be&&(V=0),ue=0,P===">"?(P=">=",Be?(z=+z+1,V=0,ue=0):(V=+V+1,ue=0)):P==="<="&&(P="<",Be?z=+z+1:V=+V+1),k=P+z+"."+V+"."+ue+oe):Be?k=">="+z+".0.0"+oe+" <"+(+z+1)+".0.0"+oe:Re&&(k=">="+z+"."+V+".0"+oe+" <"+z+"."+(+V+1)+".0"+oe),r("xRange return",k),k})}function wt(l,p){return r("replaceStars",l,p),l.trim().replace(w[a.STAR],"")}function gt(l,p,y,k,P,z,V,ue,oe,Ae,Be,Re,De){return ge(y)?p="":ge(k)?p=">="+y+".0.0":ge(P)?p=">="+y+"."+k+".0":p=">="+p,ge(oe)?ue="":ge(Ae)?ue="<"+(+oe+1)+".0.0":ge(Be)?ue="<"+oe+"."+(+Ae+1)+".0":Re?ue="<="+oe+"."+Ae+"."+Be+"-"+Re:ue="<="+ue,(p+" "+ue).trim()}ye.prototype.test=function(l){if(!l)return!1;if(typeof l=="string")try{l=new F(l,this.options)}catch{return!1}for(var p=0;p<this.set.length;p++)if(Et(this.set[p],l,this.options))return!0;return!1};function Et(l,p,y){for(var k=0;k<l.length;k++)if(!l[k].test(p))return!1;if(p.prerelease.length&&!y.includePrerelease){for(k=0;k<l.length;k++)if(r(l[k].semver),l[k].semver!==Oe&&l[k].semver.prerelease.length>0){var P=l[k].semver;if(P.major===p.major&&P.minor===p.minor&&P.patch===p.patch)return!0}return!1}return!0}t.satisfies=Ge;function Ge(l,p,y){try{p=new ye(p,y)}catch{return!1}return p.test(l)}t.maxSatisfying=Ne;function Ne(l,p,y){var k=null,P=null;try{var z=new ye(p,y)}catch{return null}return l.forEach(function(V){z.test(V)&&(!k||P.compare(V)===-1)&&(k=V,P=new F(k,y))}),k}t.minSatisfying=Qt;function Qt(l,p,y){var k=null,P=null;try{var z=new ye(p,y)}catch{return null}return l.forEach(function(V){z.test(V)&&(!k||P.compare(V)===1)&&(k=V,P=new F(k,y))}),k}t.minVersion=Zt;function Zt(l,p){l=new ye(l,p);var y=new F("0.0.0");if(l.test(y)||(y=new F("0.0.0-0"),l.test(y)))return y;y=null;for(var k=0;k<l.set.length;++k){var P=l.set[k];P.forEach(function(z){var V=new F(z.semver.version);switch(z.operator){case">":V.prerelease.length===0?V.patch++:V.prerelease.push(0),V.raw=V.format();case"":case">=":(!y||Je(y,V))&&(y=V);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+z.operator)}})}return y&&l.test(y)?y:null}t.validRange=en;function en(l,p){try{return new ye(l,p).range||"*"}catch{return null}}t.ltr=tn;function tn(l,p,y){return I(l,p,"<",y)}t.gtr=Mt;function Mt(l,p,y){return I(l,p,">",y)}t.outside=I;function I(l,p,y,k){l=new F(l,k),p=new ye(p,k);var P,z,V,ue,oe;switch(y){case">":P=Je,z=Gt,V=ze,ue=">",oe=">=";break;case"<":P=ze,z=Dt,V=Je,ue="<",oe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ge(l,p,k))return!1;for(var Ae=0;Ae<p.set.length;++Ae){var Be=p.set[Ae],Re=null,De=null;if(Be.forEach(function(He){He.semver===Oe&&(He=new Pe(">=0.0.0")),Re=Re||He,De=De||He,P(He.semver,Re.semver,k)?Re=He:V(He.semver,De.semver,k)&&(De=He)}),Re.operator===ue||Re.operator===oe||(!De.operator||De.operator===ue)&&z(l,De.semver))return!1;if(De.operator===oe&&V(l,De.semver))return!1}return!0}t.prerelease=ht;function ht(l,p){var y=j(l,p);return y&&y.prerelease.length?y.prerelease:null}t.intersects=nn;function nn(l,p,y){return l=new ye(l,y),p=new ye(p,y),l.intersects(p)}t.coerce=rn;function rn(l,p){if(l instanceof F)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;p=p||{};var y=null;if(!p.rtl)y=l.match(w[a.COERCE]);else{for(var k;(k=w[a.COERCERTL].exec(l))&&(!y||y.index+y[0].length!==l.length);)(!y||k.index+k[0].length!==y.index+y[0].length)&&(y=k),w[a.COERCERTL].lastIndex=k.index+k[1].length+k[2].length;w[a.COERCERTL].lastIndex=-1}return y===null?null:j(y[2]+"."+(y[3]||"0")+"."+(y[4]||"0"),p)}})(zr,zr.exports);var Ju=zr.exports;const Is=Qo,Rt=Ju,$e="semver",Qu={base:Is.string(),type:"semverRange",validate:function(e,{error:t}){return Rt.validRange(e)?{value:e}:{errors:t(`${$e}.valid`)}},messages:{[`${$e}.valid`]:"{{#label}} needs to be a valid semver range"}},fn={};fn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Rt[r](e,n)?e:t.error(`${$e}.${r}`,{exp:n})},args:[{name:"exp",assert:Rt.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){fn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});fn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Rt.cmp(e,n,r)?e:t.error(`${$e}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Rt.valid,message:"needs to be a valid semver expression"}]};fn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Rt[r](e,n)?e:t.error(`${$e}.${r}`,{rng:n})},args:[{name:"rng",assert:Rt.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){fn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});fn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Rt.outside(e,r,n)?e:t.error(`${$e}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Rt.validRange,message:"needs to be a valid semver range"}]};const Zu={base:Is.string(),type:"semver",validate:function(e,{error:t}){return Rt.valid(e)?{value:e}:{errors:t(`${$e}.valid`)}},messages:{[`${$e}.valid`]:"{{#label}} needs to be a valid semver expression",[`${$e}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${$e}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${$e}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${$e}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${$e}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${$e}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${$e}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${$e}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${$e}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${$e}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${$e}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:fn};var ed={semver:Zu,semverRange:Qu};/*!
199
+ */var Vu=Ku,Rs={"{":"}","(":")","[":"]"},Gu=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,o=-2,c=-2,d=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||r!==-1&&e[t]==="["&&e[t+1]!=="]"&&(r<t&&(r=e.indexOf("]",t)),r>t&&(d===-1||d>r||(d=e.indexOf("\\",t),d===-1||d>r)))||o!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(o=e.indexOf("}",t),o>t&&(d=e.indexOf("\\",t),d===-1||d>o))||c!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(c=e.indexOf(")",t),c>t&&(d=e.indexOf("\\",t),d===-1||d>c))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(c=e.indexOf(")",n),c>n&&(d=e.indexOf("\\",n),d===-1||d>c))))return!0;if(e[t]==="\\"){var h=e[t+1];t+=2;var b=Rs[h];if(b){var w=e.indexOf(b,t);w!==-1&&(t=w+1)}if(e[t]==="!")return!0}else t++}return!1},Hu=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var n=e[t+1];t+=2;var r=Rs[n];if(r){var o=e.indexOf(r,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1},Xu=function(t,n){if(typeof t!="string"||t==="")return!1;if(Vu(t))return!0;var r=Gu;return n&&n.strict===!1&&(r=Hu),r(t)},Ur={exports:{}};(function(e,t){var n={};t=e.exports=F;var r;typeof Ol=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var l=Array.prototype.slice.call(arguments,0);l.unshift("SEMVER"),console.log.apply(console,l)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=256,c=Number.MAX_SAFE_INTEGER||9007199254740991,d=16,h=o-6,b=t.re=[],w=t.safeRe=[],s=t.src=[],a=t.tokens={},O=0;function x(l){a[l]=O++}var S="[a-zA-Z0-9-]",R=[["\\s",1],["\\d",o],[S,h]];function _(l){for(var p=0;p<R.length;p++){var y=R[p][0],k=R[p][1];l=l.split(y+"*").join(y+"{0,"+k+"}").split(y+"+").join(y+"{1,"+k+"}")}return l}x("NUMERICIDENTIFIER"),s[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",x("NUMERICIDENTIFIERLOOSE"),s[a.NUMERICIDENTIFIERLOOSE]="\\d+",x("NONNUMERICIDENTIFIER"),s[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",x("MAINVERSION"),s[a.MAINVERSION]="("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")",x("MAINVERSIONLOOSE"),s[a.MAINVERSIONLOOSE]="("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")",x("PRERELEASEIDENTIFIER"),s[a.PRERELEASEIDENTIFIER]="(?:"+s[a.NUMERICIDENTIFIER]+"|"+s[a.NONNUMERICIDENTIFIER]+")",x("PRERELEASEIDENTIFIERLOOSE"),s[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[a.NUMERICIDENTIFIERLOOSE]+"|"+s[a.NONNUMERICIDENTIFIER]+")",x("PRERELEASE"),s[a.PRERELEASE]="(?:-("+s[a.PRERELEASEIDENTIFIER]+"(?:\\."+s[a.PRERELEASEIDENTIFIER]+")*))",x("PRERELEASELOOSE"),s[a.PRERELEASELOOSE]="(?:-?("+s[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[a.PRERELEASEIDENTIFIERLOOSE]+")*))",x("BUILDIDENTIFIER"),s[a.BUILDIDENTIFIER]=S+"+",x("BUILD"),s[a.BUILD]="(?:\\+("+s[a.BUILDIDENTIFIER]+"(?:\\."+s[a.BUILDIDENTIFIER]+")*))",x("FULL"),x("FULLPLAIN"),s[a.FULLPLAIN]="v?"+s[a.MAINVERSION]+s[a.PRERELEASE]+"?"+s[a.BUILD]+"?",s[a.FULL]="^"+s[a.FULLPLAIN]+"$",x("LOOSEPLAIN"),s[a.LOOSEPLAIN]="[v=\\s]*"+s[a.MAINVERSIONLOOSE]+s[a.PRERELEASELOOSE]+"?"+s[a.BUILD]+"?",x("LOOSE"),s[a.LOOSE]="^"+s[a.LOOSEPLAIN]+"$",x("GTLT"),s[a.GTLT]="((?:<|>)?=?)",x("XRANGEIDENTIFIERLOOSE"),s[a.XRANGEIDENTIFIERLOOSE]=s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",x("XRANGEIDENTIFIER"),s[a.XRANGEIDENTIFIER]=s[a.NUMERICIDENTIFIER]+"|x|X|\\*",x("XRANGEPLAIN"),s[a.XRANGEPLAIN]="[v=\\s]*("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:"+s[a.PRERELEASE]+")?"+s[a.BUILD]+"?)?)?",x("XRANGEPLAINLOOSE"),s[a.XRANGEPLAINLOOSE]="[v=\\s]*("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:"+s[a.PRERELEASELOOSE]+")?"+s[a.BUILD]+"?)?)?",x("XRANGE"),s[a.XRANGE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAIN]+"$",x("XRANGELOOSE"),s[a.XRANGELOOSE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAINLOOSE]+"$",x("COERCE"),s[a.COERCE]="(^|[^\\d])(\\d{1,"+d+"})(?:\\.(\\d{1,"+d+"}))?(?:\\.(\\d{1,"+d+"}))?(?:$|[^\\d])",x("COERCERTL"),b[a.COERCERTL]=new RegExp(s[a.COERCE],"g"),w[a.COERCERTL]=new RegExp(_(s[a.COERCE]),"g"),x("LONETILDE"),s[a.LONETILDE]="(?:~>?)",x("TILDETRIM"),s[a.TILDETRIM]="(\\s*)"+s[a.LONETILDE]+"\\s+",b[a.TILDETRIM]=new RegExp(s[a.TILDETRIM],"g"),w[a.TILDETRIM]=new RegExp(_(s[a.TILDETRIM]),"g");var A="$1~";x("TILDE"),s[a.TILDE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAIN]+"$",x("TILDELOOSE"),s[a.TILDELOOSE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAINLOOSE]+"$",x("LONECARET"),s[a.LONECARET]="(?:\\^)",x("CARETTRIM"),s[a.CARETTRIM]="(\\s*)"+s[a.LONECARET]+"\\s+",b[a.CARETTRIM]=new RegExp(s[a.CARETTRIM],"g"),w[a.CARETTRIM]=new RegExp(_(s[a.CARETTRIM]),"g");var H="$1^";x("CARET"),s[a.CARET]="^"+s[a.LONECARET]+s[a.XRANGEPLAIN]+"$",x("CARETLOOSE"),s[a.CARETLOOSE]="^"+s[a.LONECARET]+s[a.XRANGEPLAINLOOSE]+"$",x("COMPARATORLOOSE"),s[a.COMPARATORLOOSE]="^"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+")$|^$",x("COMPARATOR"),s[a.COMPARATOR]="^"+s[a.GTLT]+"\\s*("+s[a.FULLPLAIN]+")$|^$",x("COMPARATORTRIM"),s[a.COMPARATORTRIM]="(\\s*)"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+"|"+s[a.XRANGEPLAIN]+")",b[a.COMPARATORTRIM]=new RegExp(s[a.COMPARATORTRIM],"g"),w[a.COMPARATORTRIM]=new RegExp(_(s[a.COMPARATORTRIM]),"g");var U="$1$2$3";x("HYPHENRANGE"),s[a.HYPHENRANGE]="^\\s*("+s[a.XRANGEPLAIN]+")\\s+-\\s+("+s[a.XRANGEPLAIN]+")\\s*$",x("HYPHENRANGELOOSE"),s[a.HYPHENRANGELOOSE]="^\\s*("+s[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[a.XRANGEPLAINLOOSE]+")\\s*$",x("STAR"),s[a.STAR]="(<|>)?=?\\s*\\*";for(var X=0;X<O;X++)r(X,s[X]),b[X]||(b[X]=new RegExp(s[X]),w[X]=new RegExp(_(s[X])));t.parse=j;function j(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof F)return l;if(typeof l!="string"||l.length>o)return null;var y=p.loose?w[a.LOOSE]:w[a.FULL];if(!y.test(l))return null;try{return new F(l,p)}catch{return null}}t.valid=W;function W(l,p){var y=j(l,p);return y?y.version:null}t.clean=Z;function Z(l,p){var y=j(l.trim().replace(/^[=v]+/,""),p);return y?y.version:null}t.SemVer=F;function F(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof F){if(l.loose===p.loose)return l;l=l.version}else if(typeof l!="string")throw new TypeError("Invalid Version: "+l);if(l.length>o)throw new TypeError("version is longer than "+o+" characters");if(!(this instanceof F))return new F(l,p);r("SemVer",l,p),this.options=p,this.loose=!!p.loose;var y=l.trim().match(p.loose?w[a.LOOSE]:w[a.FULL]);if(!y)throw new TypeError("Invalid Version: "+l);if(this.raw=l,this.major=+y[1],this.minor=+y[2],this.patch=+y[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");y[4]?this.prerelease=y[4].split(".").map(function(k){if(/^[0-9]+$/.test(k)){var P=+k;if(P>=0&&P<c)return P}return k}):this.prerelease=[],this.build=y[5]?y[5].split("."):[],this.format()}F.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},F.prototype.toString=function(){return this.version},F.prototype.compare=function(l){return r("SemVer.compare",this.version,this.options,l),l instanceof F||(l=new F(l,this.options)),this.compareMain(l)||this.comparePre(l)},F.prototype.compareMain=function(l){return l instanceof F||(l=new F(l,this.options)),Se(this.major,l.major)||Se(this.minor,l.minor)||Se(this.patch,l.patch)},F.prototype.comparePre=function(l){if(l instanceof F||(l=new F(l,this.options)),this.prerelease.length&&!l.prerelease.length)return-1;if(!this.prerelease.length&&l.prerelease.length)return 1;if(!this.prerelease.length&&!l.prerelease.length)return 0;var p=0;do{var y=this.prerelease[p],k=l.prerelease[p];if(r("prerelease compare",p,y,k),y===void 0&&k===void 0)return 0;if(k===void 0)return 1;if(y===void 0)return-1;if(y===k)continue;return Se(y,k)}while(++p)},F.prototype.compareBuild=function(l){l instanceof F||(l=new F(l,this.options));var p=0;do{var y=this.build[p],k=l.build[p];if(r("prerelease compare",p,y,k),y===void 0&&k===void 0)return 0;if(k===void 0)return 1;if(y===void 0)return-1;if(y===k)continue;return Se(y,k)}while(++p)},F.prototype.inc=function(l,p){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p),this.inc("pre",p);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p),this.inc("pre",p);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var y=this.prerelease.length;--y>=0;)typeof this.prerelease[y]=="number"&&(this.prerelease[y]++,y=-2);y===-1&&this.prerelease.push(0)}p&&(this.prerelease[0]===p?isNaN(this.prerelease[1])&&(this.prerelease=[p,0]):this.prerelease=[p,0]);break;default:throw new Error("invalid increment argument: "+l)}return this.format(),this.raw=this.version,this},t.inc=ce;function ce(l,p,y,k){typeof y=="string"&&(k=y,y=void 0);try{return new F(l,y).inc(p,k).version}catch{return null}}t.diff=Y;function Y(l,p){if(Ct(l,p))return null;var y=j(l),k=j(p),P="";if(y.prerelease.length||k.prerelease.length){P="pre";var z="prerelease"}for(var V in y)if((V==="major"||V==="minor"||V==="patch")&&y[V]!==k[V])return P+V;return z}t.compareIdentifiers=Se;var ae=/^[0-9]+$/;function Se(l,p){var y=ae.test(l),k=ae.test(p);return y&&k&&(l=+l,p=+p),l===p?0:y&&!k?-1:k&&!y?1:l<p?-1:1}t.rcompareIdentifiers=Fe;function Fe(l,p){return Se(p,l)}t.major=Ue;function Ue(l,p){return new F(l,p).major}t.minor=nt;function nt(l,p){return new F(l,p).minor}t.patch=ee;function ee(l,p){return new F(l,p).patch}t.compare=pe;function pe(l,p,y){return new F(l,y).compare(new F(p,y))}t.compareLoose=q;function q(l,p){return pe(l,p,!0)}t.compareBuild=Te;function Te(l,p,y){var k=new F(l,y),P=new F(p,y);return k.compare(P)||k.compareBuild(P)}t.rcompare=ie;function ie(l,p,y){return pe(p,l,y)}t.sort=dt;function dt(l,p){return l.sort(function(y,k){return t.compareBuild(y,k,p)})}t.rsort=we;function we(l,p){return l.sort(function(y,k){return t.compareBuild(k,y,p)})}t.gt=Je;function Je(l,p,y){return pe(l,p,y)>0}t.lt=ze;function ze(l,p,y){return pe(l,p,y)<0}t.eq=Ct;function Ct(l,p,y){return pe(l,p,y)===0}t.neq=Vt;function Vt(l,p,y){return pe(l,p,y)!==0}t.gte=Dt;function Dt(l,p,y){return pe(l,p,y)>=0}t.lte=Gt;function Gt(l,p,y){return pe(l,p,y)<=0}t.cmp=Ie;function Ie(l,p,y,k){switch(p){case"===":return typeof l=="object"&&(l=l.version),typeof y=="object"&&(y=y.version),l===y;case"!==":return typeof l=="object"&&(l=l.version),typeof y=="object"&&(y=y.version),l!==y;case"":case"=":case"==":return Ct(l,y,k);case"!=":return Vt(l,y,k);case">":return Je(l,y,k);case">=":return Dt(l,y,k);case"<":return ze(l,y,k);case"<=":return Gt(l,y,k);default:throw new TypeError("Invalid operator: "+p)}}t.Comparator=Pe;function Pe(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof Pe){if(l.loose===!!p.loose)return l;l=l.value}if(!(this instanceof Pe))return new Pe(l,p);l=l.trim().split(/\s+/).join(" "),r("comparator",l,p),this.options=p,this.loose=!!p.loose,this.parse(l),this.semver===Oe?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Oe={};Pe.prototype.parse=function(l){var p=this.options.loose?w[a.COMPARATORLOOSE]:w[a.COMPARATOR],y=l.match(p);if(!y)throw new TypeError("Invalid comparator: "+l);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new F(y[2],this.options.loose):this.semver=Oe},Pe.prototype.toString=function(){return this.value},Pe.prototype.test=function(l){if(r("Comparator.test",l,this.options.loose),this.semver===Oe||l===Oe)return!0;if(typeof l=="string")try{l=new F(l,this.options)}catch{return!1}return Ie(l,this.operator,this.semver,this.options)},Pe.prototype.intersects=function(l,p){if(!(l instanceof Pe))throw new TypeError("a Comparator is required");(!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1});var y;if(this.operator==="")return this.value===""?!0:(y=new ye(l.value,p),Ge(this.value,y,p));if(l.operator==="")return l.value===""?!0:(y=new ye(this.value,p),Ge(l.semver,y,p));var k=(this.operator===">="||this.operator===">")&&(l.operator===">="||l.operator===">"),P=(this.operator==="<="||this.operator==="<")&&(l.operator==="<="||l.operator==="<"),z=this.semver.version===l.semver.version,V=(this.operator===">="||this.operator==="<=")&&(l.operator===">="||l.operator==="<="),ue=Ie(this.semver,"<",l.semver,p)&&(this.operator===">="||this.operator===">")&&(l.operator==="<="||l.operator==="<"),oe=Ie(this.semver,">",l.semver,p)&&(this.operator==="<="||this.operator==="<")&&(l.operator===">="||l.operator===">");return k||P||z&&V||ue||oe},t.Range=ye;function ye(l,p){if((!p||typeof p!="object")&&(p={loose:!!p,includePrerelease:!1}),l instanceof ye)return l.loose===!!p.loose&&l.includePrerelease===!!p.includePrerelease?l:new ye(l.raw,p);if(l instanceof Pe)return new ye(l.value,p);if(!(this instanceof ye))return new ye(l,p);if(this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease,this.raw=l.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(y){return this.parseRange(y.trim())},this).filter(function(y){return y.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ye.prototype.format=function(){return this.range=this.set.map(function(l){return l.join(" ").trim()}).join("||").trim(),this.range},ye.prototype.toString=function(){return this.range},ye.prototype.parseRange=function(l){var p=this.options.loose,y=p?w[a.HYPHENRANGELOOSE]:w[a.HYPHENRANGE];l=l.replace(y,gt),r("hyphen replace",l),l=l.replace(w[a.COMPARATORTRIM],U),r("comparator trim",l,w[a.COMPARATORTRIM]),l=l.replace(w[a.TILDETRIM],A),l=l.replace(w[a.CARETTRIM],H),l=l.split(/\s+/).join(" ");var k=p?w[a.COMPARATORLOOSE]:w[a.COMPARATOR],P=l.split(" ").map(function(z){return Xt(z,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(P=P.filter(function(z){return!!z.match(k)})),P=P.map(function(z){return new Pe(z,this.options)},this),P},ye.prototype.intersects=function(l,p){if(!(l instanceof ye))throw new TypeError("a Range is required");return this.set.some(function(y){return It(y,p)&&l.set.some(function(k){return It(k,p)&&y.every(function(P){return k.every(function(z){return P.intersects(z,p)})})})})};function It(l,p){for(var y=!0,k=l.slice(),P=k.pop();y&&k.length;)y=k.every(function(z){return P.intersects(z,p)}),P=k.pop();return y}t.toComparators=Ht;function Ht(l,p){return new ye(l,p).set.map(function(y){return y.map(function(k){return k.value}).join(" ").trim().split(" ")})}function Xt(l,p){return r("comp",l,p),l=gn(l,p),r("caret",l),l=Yt(l,p),r("tildes",l),l=Qe(l,p),r("xrange",l),l=wt(l,p),r("stars",l),l}function ge(l){return!l||l.toLowerCase()==="x"||l==="*"}function Yt(l,p){return l.trim().split(/\s+/).map(function(y){return mn(y,p)}).join(" ")}function mn(l,p){var y=p.loose?w[a.TILDELOOSE]:w[a.TILDE];return l.replace(y,function(k,P,z,V,ue){r("tilde",l,k,P,z,V,ue);var oe;return ge(P)?oe="":ge(z)?oe=">="+P+".0.0 <"+(+P+1)+".0.0":ge(V)?oe=">="+P+"."+z+".0 <"+P+"."+(+z+1)+".0":ue?(r("replaceTilde pr",ue),oe=">="+P+"."+z+"."+V+"-"+ue+" <"+P+"."+(+z+1)+".0"):oe=">="+P+"."+z+"."+V+" <"+P+"."+(+z+1)+".0",r("tilde return",oe),oe})}function gn(l,p){return l.trim().split(/\s+/).map(function(y){return Jt(y,p)}).join(" ")}function Jt(l,p){r("caret",l,p);var y=p.loose?w[a.CARETLOOSE]:w[a.CARET];return l.replace(y,function(k,P,z,V,ue){r("caret",l,k,P,z,V,ue);var oe;return ge(P)?oe="":ge(z)?oe=">="+P+".0.0 <"+(+P+1)+".0.0":ge(V)?P==="0"?oe=">="+P+"."+z+".0 <"+P+"."+(+z+1)+".0":oe=">="+P+"."+z+".0 <"+(+P+1)+".0.0":ue?(r("replaceCaret pr",ue),P==="0"?z==="0"?oe=">="+P+"."+z+"."+V+"-"+ue+" <"+P+"."+z+"."+(+V+1):oe=">="+P+"."+z+"."+V+"-"+ue+" <"+P+"."+(+z+1)+".0":oe=">="+P+"."+z+"."+V+"-"+ue+" <"+(+P+1)+".0.0"):(r("no pr"),P==="0"?z==="0"?oe=">="+P+"."+z+"."+V+" <"+P+"."+z+"."+(+V+1):oe=">="+P+"."+z+"."+V+" <"+P+"."+(+z+1)+".0":oe=">="+P+"."+z+"."+V+" <"+(+P+1)+".0.0"),r("caret return",oe),oe})}function Qe(l,p){return r("replaceXRanges",l,p),l.split(/\s+/).map(function(y){return xt(y,p)}).join(" ")}function xt(l,p){l=l.trim();var y=p.loose?w[a.XRANGELOOSE]:w[a.XRANGE];return l.replace(y,function(k,P,z,V,ue,oe){r("xRange",l,k,P,z,V,ue,oe);var Ae=ge(z),Be=Ae||ge(V),Re=Be||ge(ue),De=Re;return P==="="&&De&&(P=""),oe=p.includePrerelease?"-0":"",Ae?P===">"||P==="<"?k="<0.0.0-0":k="*":P&&De?(Be&&(V=0),ue=0,P===">"?(P=">=",Be?(z=+z+1,V=0,ue=0):(V=+V+1,ue=0)):P==="<="&&(P="<",Be?z=+z+1:V=+V+1),k=P+z+"."+V+"."+ue+oe):Be?k=">="+z+".0.0"+oe+" <"+(+z+1)+".0.0"+oe:Re&&(k=">="+z+"."+V+".0"+oe+" <"+z+"."+(+V+1)+".0"+oe),r("xRange return",k),k})}function wt(l,p){return r("replaceStars",l,p),l.trim().replace(w[a.STAR],"")}function gt(l,p,y,k,P,z,V,ue,oe,Ae,Be,Re,De){return ge(y)?p="":ge(k)?p=">="+y+".0.0":ge(P)?p=">="+y+"."+k+".0":p=">="+p,ge(oe)?ue="":ge(Ae)?ue="<"+(+oe+1)+".0.0":ge(Be)?ue="<"+oe+"."+(+Ae+1)+".0":Re?ue="<="+oe+"."+Ae+"."+Be+"-"+Re:ue="<="+ue,(p+" "+ue).trim()}ye.prototype.test=function(l){if(!l)return!1;if(typeof l=="string")try{l=new F(l,this.options)}catch{return!1}for(var p=0;p<this.set.length;p++)if(Et(this.set[p],l,this.options))return!0;return!1};function Et(l,p,y){for(var k=0;k<l.length;k++)if(!l[k].test(p))return!1;if(p.prerelease.length&&!y.includePrerelease){for(k=0;k<l.length;k++)if(r(l[k].semver),l[k].semver!==Oe&&l[k].semver.prerelease.length>0){var P=l[k].semver;if(P.major===p.major&&P.minor===p.minor&&P.patch===p.patch)return!0}return!1}return!0}t.satisfies=Ge;function Ge(l,p,y){try{p=new ye(p,y)}catch{return!1}return p.test(l)}t.maxSatisfying=Ne;function Ne(l,p,y){var k=null,P=null;try{var z=new ye(p,y)}catch{return null}return l.forEach(function(V){z.test(V)&&(!k||P.compare(V)===-1)&&(k=V,P=new F(k,y))}),k}t.minSatisfying=Qt;function Qt(l,p,y){var k=null,P=null;try{var z=new ye(p,y)}catch{return null}return l.forEach(function(V){z.test(V)&&(!k||P.compare(V)===1)&&(k=V,P=new F(k,y))}),k}t.minVersion=Zt;function Zt(l,p){l=new ye(l,p);var y=new F("0.0.0");if(l.test(y)||(y=new F("0.0.0-0"),l.test(y)))return y;y=null;for(var k=0;k<l.set.length;++k){var P=l.set[k];P.forEach(function(z){var V=new F(z.semver.version);switch(z.operator){case">":V.prerelease.length===0?V.patch++:V.prerelease.push(0),V.raw=V.format();case"":case">=":(!y||Je(y,V))&&(y=V);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+z.operator)}})}return y&&l.test(y)?y:null}t.validRange=en;function en(l,p){try{return new ye(l,p).range||"*"}catch{return null}}t.ltr=tn;function tn(l,p,y){return I(l,p,"<",y)}t.gtr=Mt;function Mt(l,p,y){return I(l,p,">",y)}t.outside=I;function I(l,p,y,k){l=new F(l,k),p=new ye(p,k);var P,z,V,ue,oe;switch(y){case">":P=Je,z=Gt,V=ze,ue=">",oe=">=";break;case"<":P=ze,z=Dt,V=Je,ue="<",oe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ge(l,p,k))return!1;for(var Ae=0;Ae<p.set.length;++Ae){var Be=p.set[Ae],Re=null,De=null;if(Be.forEach(function(He){He.semver===Oe&&(He=new Pe(">=0.0.0")),Re=Re||He,De=De||He,P(He.semver,Re.semver,k)?Re=He:V(He.semver,De.semver,k)&&(De=He)}),Re.operator===ue||Re.operator===oe||(!De.operator||De.operator===ue)&&z(l,De.semver))return!1;if(De.operator===oe&&V(l,De.semver))return!1}return!0}t.prerelease=ht;function ht(l,p){var y=j(l,p);return y&&y.prerelease.length?y.prerelease:null}t.intersects=nn;function nn(l,p,y){return l=new ye(l,y),p=new ye(p,y),l.intersects(p)}t.coerce=rn;function rn(l,p){if(l instanceof F)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;p=p||{};var y=null;if(!p.rtl)y=l.match(w[a.COERCE]);else{for(var k;(k=w[a.COERCERTL].exec(l))&&(!y||y.index+y[0].length!==l.length);)(!y||k.index+k[0].length!==y.index+y[0].length)&&(y=k),w[a.COERCERTL].lastIndex=k.index+k[1].length+k[2].length;w[a.COERCERTL].lastIndex=-1}return y===null?null:j(y[2]+"."+(y[3]||"0")+"."+(y[4]||"0"),p)}})(Ur,Ur.exports);var Yu=Ur.exports;const Cs=Jo,Rt=Yu,$e="semver",Ju={base:Cs.string(),type:"semverRange",validate:function(e,{error:t}){return Rt.validRange(e)?{value:e}:{errors:t(`${$e}.valid`)}},messages:{[`${$e}.valid`]:"{{#label}} needs to be a valid semver range"}},fn={};fn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Rt[r](e,n)?e:t.error(`${$e}.${r}`,{exp:n})},args:[{name:"exp",assert:Rt.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){fn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});fn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Rt.cmp(e,n,r)?e:t.error(`${$e}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Rt.valid,message:"needs to be a valid semver expression"}]};fn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Rt[r](e,n)?e:t.error(`${$e}.${r}`,{rng:n})},args:[{name:"rng",assert:Rt.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){fn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});fn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Rt.outside(e,r,n)?e:t.error(`${$e}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Rt.validRange,message:"needs to be a valid semver range"}]};const Qu={base:Cs.string(),type:"semver",validate:function(e,{error:t}){return Rt.valid(e)?{value:e}:{errors:t(`${$e}.valid`)}},messages:{[`${$e}.valid`]:"{{#label}} needs to be a valid semver expression",[`${$e}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${$e}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${$e}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${$e}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${$e}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${$e}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${$e}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${$e}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${$e}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${$e}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${$e}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:fn};var Zu={semver:Qu,semverRange:Ju};/*!
200
200
  * is-var-name | ISC (c) Shinnosuke Watanabe
201
201
  * https://github.com/shinnn/is-var-name
202
- */function td(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const nd=Object.freeze(Object.defineProperty({__proto__:null,default:td},Symbol.toStringTag,{value:"Module"})),rd=ei(nd),id=ei(el),od=rl,sd=il,xo=hr,ad=e=>{if((0,xo.isValid)(e))return e;const t=(0,sd.toHex)(Cl.from(typeof e=="string"?e.trim():e));return(0,xo.fromPublicKey)(t,{role:od.types.RoleType.ROLE_ANY})};var ld=ad,pn={},Ps=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pn,"__esModule",{value:!0});pn.didExtension=pn.fileExtension=void 0;const wo=Ps(ks),cd=Ps(Zl),ud=hr,_s=e=>({type:"file",base:e.string(),validate(t,{error:n}){return t&&typeof t=="string"?{value:t}:{errors:n("file.empty",{file:t})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:t=null,canSkip:n=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:t,canSkip:n}})},args:[{name:"baseDir",assert:t=>wo.default.existsSync(t),message:"baseDir must exist"},{name:"canSkip",assert:t=>typeof t=="function",message:"canSkip must be a function"}],validate(t,{error:n},{baseDir:r,canSkip:o}={}){if(typeof o=="function"&&o(r,t))return t;try{return wo.default.statSync(cd.default.join(r,t)),t}catch(c){switch(c.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:c.message})}}}}});pn.fileExtension=_s;const Ls=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,ud.isValid)(t)===!1?{errors:n("did.invalid",{did:t})}:{value:t}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});pn.didExtension=Ls;pn.default={fileExtension:_s,didExtension:Ls};var fi={},Ns={exports:{}};const dd=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var As=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),hd=dd,pd=["node_modules","favicon.ico"],fd=Ns.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Bn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Bn(t,n);if(typeof e!="string")return n.push("name must be a string"),Bn(t,n);if(e.length||n.push("name length must be greater than zero"),e.match(/^\./)&&n.push("name cannot start with a period"),e.match(/^_/)&&n.push("name cannot start with an underscore"),e.trim()!==e&&n.push("name cannot contain leading or trailing spaces"),pd.forEach(function(d){e.toLowerCase()===d&&n.push(d+" is a blacklisted name")}),hd.forEach(function(d){e.toLowerCase()===d&&t.push(d+" is a core module name")}),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var r=e.match(As);if(r){var o=r[1],c=r[2];if(encodeURIComponent(o)===o&&encodeURIComponent(c)===c)return Bn(t,n)}n.push("name can only contain URL-friendly characters")}return Bn(t,n)};fd.scopedPackagePattern=As;var Bn=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n},md=Ns.exports;(function(e){var t=Ee&&Ee.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=hr,r=t(md),o=32,c=h=>{if((0,n.toTypeInfo)(h).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=c;const d=(h,{checkDid:b=!0}={})=>{if((0,n.isValid)(h))b&&(0,e.validateNewDid)(h);else{const{validForNewPackages:w,errors:s=[],warnings:a=[]}=(0,r.default)(h);if(!w)throw new Error(s[0]||a[0]);if(h.length>o)throw new Error("Blocklet name is too long")}};e.validateName=d,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(fi);var gd=Ee&&Ee.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),vd=Ee&&Ee.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),yd=Ee&&Ee.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[r.length]=o);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),o=0;o<r.length;o++)r[o]!=="default"&&gd(n,t,r[o]);return vd(n,t),n}}(),In=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});te.Joi=te.installBlockletDescriptionSchema=te.installBlockletTitleSchema=te.resourceBundleSchema=te.authConfigSchema=te.cacheableSchema=te.statsSchema=te.titleSchema=te.themeSchema=te.signatureSchema=te.serviceSchema=te.scriptsSchema=te.personSchema=te.navigationSchema=te.navigationItemSchema=te.updateMountPointSchema=te.mountPointSchema=te.logoSchema=te.interfaceSchema=te.environmentNameSchema=te.environmentSchema=te.engineSchema=te.endpointSchema=te.distSchema=te.descriptionSchema=te.createBlockletSchema=te.componentSchema=te.blockletNameSchema=te.blockletMetaSchema=void 0;const bd=In(ks),xd=In(Qo),wd=In(Ku),Ed=In(Yu),Eo=ed,Sd=In(rd),So=ts,Td=hr,jd=id,Le=kt,Od=In(ld),To=pn,qr=fi,mi=yd(vl),kd=wd.default.default,jo="/.well-known",u=xd.default.extend(Eo.semver).extend(Eo.semverRange).extend(To.fileExtension).extend(To.didExtension);te.Joi=u;const Oo=(e,t)=>(0,mi.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
202
+ */function ed(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const td=Object.freeze(Object.defineProperty({__proto__:null,default:ed},Symbol.toStringTag,{value:"Module"})),nd=Zr(td),rd=Zr(Qa),id=tl,od=nl,bo=ur,sd=e=>{if((0,bo.isValid)(e))return e;const t=(0,od.toHex)(kl.from(typeof e=="string"?e.trim():e));return(0,bo.fromPublicKey)(t,{role:id.types.RoleType.ROLE_ANY})};var ad=sd,pn={},Is=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pn,"__esModule",{value:!0});pn.didExtension=pn.fileExtension=void 0;const xo=Is(Os),ld=Is(Jl),cd=ur,Ps=e=>({type:"file",base:e.string(),validate(t,{error:n}){return t&&typeof t=="string"?{value:t}:{errors:n("file.empty",{file:t})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:t=null,canSkip:n=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:t,canSkip:n}})},args:[{name:"baseDir",assert:t=>xo.default.existsSync(t),message:"baseDir must exist"},{name:"canSkip",assert:t=>typeof t=="function",message:"canSkip must be a function"}],validate(t,{error:n},{baseDir:r,canSkip:o}={}){if(typeof o=="function"&&o(r,t))return t;try{return xo.default.statSync(ld.default.join(r,t)),t}catch(c){switch(c.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:c.message})}}}}});pn.fileExtension=Ps;const Ls=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,cd.isValid)(t)===!1?{errors:n("did.invalid",{did:t})}:{value:t}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});pn.didExtension=Ls;pn.default={fileExtension:Ps,didExtension:Ls};var fi={},_s={exports:{}};const ud=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var Ns=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),dd=ud,hd=["node_modules","favicon.ico"],pd=_s.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Bn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Bn(t,n);if(typeof e!="string")return n.push("name must be a string"),Bn(t,n);if(e.length||n.push("name length must be greater than zero"),e.match(/^\./)&&n.push("name cannot start with a period"),e.match(/^_/)&&n.push("name cannot start with an underscore"),e.trim()!==e&&n.push("name cannot contain leading or trailing spaces"),hd.forEach(function(d){e.toLowerCase()===d&&n.push(d+" is a blacklisted name")}),dd.forEach(function(d){e.toLowerCase()===d&&t.push(d+" is a core module name")}),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var r=e.match(Ns);if(r){var o=r[1],c=r[2];if(encodeURIComponent(o)===o&&encodeURIComponent(c)===c)return Bn(t,n)}n.push("name can only contain URL-friendly characters")}return Bn(t,n)};pd.scopedPackagePattern=Ns;var Bn=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n},fd=_s.exports;(function(e){var t=Ee&&Ee.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=ur,r=t(fd),o=32,c=h=>{if((0,n.toTypeInfo)(h).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=c;const d=(h,{checkDid:b=!0}={})=>{if((0,n.isValid)(h))b&&(0,e.validateNewDid)(h);else{const{validForNewPackages:w,errors:s=[],warnings:a=[]}=(0,r.default)(h);if(!w)throw new Error(s[0]||a[0]);if(h.length>o)throw new Error("Blocklet name is too long")}};e.validateName=d,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(fi);var md=Ee&&Ee.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),gd=Ee&&Ee.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),vd=Ee&&Ee.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[r.length]=o);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),o=0;o<r.length;o++)r[o]!=="default"&&md(n,t,r[o]);return gd(n,t),n}}(),In=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});te.Joi=te.installBlockletDescriptionSchema=te.installBlockletTitleSchema=te.resourceBundleSchema=te.authConfigSchema=te.cacheableSchema=te.statsSchema=te.titleSchema=te.themeSchema=te.signatureSchema=te.serviceSchema=te.scriptsSchema=te.personSchema=te.navigationSchema=te.navigationItemSchema=te.updateMountPointSchema=te.mountPointSchema=te.logoSchema=te.interfaceSchema=te.environmentNameSchema=te.environmentSchema=te.engineSchema=te.endpointSchema=te.distSchema=te.descriptionSchema=te.createBlockletSchema=te.componentSchema=te.blockletNameSchema=te.blockletMetaSchema=void 0;const yd=In(Os),bd=In(Jo),xd=In(qu),wd=In(Xu),wo=Zu,Ed=In(nd),Eo=es,Sd=ur,Td=rd,_e=kt,jd=In(ad),So=pn,Wr=fi,mi=vd(ml),Od=xd.default.default,To="/.well-known",u=bd.default.extend(wo.semver).extend(wo.semverRange).extend(So.fileExtension).extend(So.didExtension);te.Joi=u;const jo=(e,t)=>(0,mi.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
203
203
 
204
204
  A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
205
205
  - /en/home
206
206
  - /zh/home
207
207
  - https://www.arcblock.io
208
- `),Rd=(e,t)=>!e||(0,Sd.default)(e)?e:t.message(`Invalid navigation id: ${e}
208
+ `),kd=(e,t)=>!e||(0,Ed.default)(e)?e:t.message(`Invalid navigation id: ${e}
209
209
 
210
210
  A valid navigation id is should follow the rules of javascript variables, such as:
211
211
  - foo
@@ -213,7 +213,7 @@ A valid navigation id is should follow the rules of javascript variables, such a
213
213
  - foo123
214
214
 
215
215
  see detail in https://www.npmjs.com/package/is-var-name
216
- `),yr=u.string().trim().min(1).custom(e=>{if(kd(e)>Le.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Le.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);if(e.includes("."))throw new Error('title cannot contain "."');return e}).meta({className:"TTitle"});te.titleSchema=yr;const br=u.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=br;const Ds=u.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=Ds;const Ms=u.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=Ms;const Fs=u.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(So.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${So.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=Fs;const Bs=u.string().trim().min(1),gi=Bs.meta({className:"TMountPoint"}).custom((e,t)=>(0,mi.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=gi;const $s=Bs.meta({className:"TUpdateMountPoint"}).custom(e=>(0,mi.default)(e));te.updateMountPointSchema=$s;const Rn=u.string().custom(e=>((0,qr.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=Rn;const Cd=[],vi=u.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Cd.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});te.environmentNameSchema=vi;const yi=u.object({name:vi.required(),description:u.string().trim().required(),default:u.string().optional().allow("").default(""),required:u.boolean().default(!1),secure:u.boolean().default(!1),validation:u.string().optional(),shared:u.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});te.environmentSchema=yi;const bi=u.object({dev:u.string().trim().min(1),e2eDev:u.string().trim().min(1),preFlight:u.string().trim().min(1),preInstall:u.string().trim().min(1),postInstall:u.string().trim().min(1),preStart:u.string().trim().min(1),postStart:u.string().trim().min(1),preStop:u.string().trim().min(1),preUninstall:u.string().trim().min(1),preConfig:u.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});te.scriptsSchema=bi;const xi=u.object({name:u.string().required().trim(),config:u.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=xi;const wi=u.object({type:u.string().trim(!0).min(1).required(),path:u.string().required(),meta:u.object({vcType:u.string(),payable:u.boolean(),params:u.array().items({name:u.string().required().trim(),description:u.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});te.endpointSchema=wi;const Us=u.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});te.cacheableSchema=Us;const Ei=u.object({type:u.string().lowercase().valid(...Le.BLOCKLET_INTERFACE_TYPES).required(),name:u.string().trim().required(),path:u.string().trim().default("/"),prefix:u.string().trim().min(1).default(Le.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:u.number().port().optional(),hostIP:u.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:u.string().lowercase().valid(...Le.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:u.alternatives().try(u.string().uppercase().default(Le.BLOCKLET_DEFAULT_PORT_NAME),u.object({internal:u.string().uppercase().required(),external:u.number().port().required()})).default(Le.BLOCKLET_DEFAULT_PORT_NAME),cacheable:u.array().items(Us).unique(),services:u.array().items(xi).unique("name"),endpoints:u.array().items(wi).unique("type"),pageGroups:u.array().items(u.string().min(1).max(255).trim()).unique()}).meta({className:"TInterface",unknownType:"any"});te.interfaceSchema=Ei;const Id=u.alternatives().try(u.string().required(),u.object({url:u.string().uri({scheme:["http","https","file"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),Kr=u.object({platform:u.string().valid(...Le.BLOCKLET_PLATFORMS).optional(),interpreter:u.string().valid("binary","node","blocklet").default("node"),source:Id,args:u.array().items(u.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=Kr;const zn=u.object({name:u.string().min(1).required(),email:u.string().email({tlds:!1}).optional(),url:u.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});te.personSchema=zn;const Kn=u.object({tarball:u.alternatives().try(u.string().uri(),u.string()).required(),integrity:u.string().required(),size:u.number().optional()}).meta({className:"TDist",unknownType:"any"});te.distSchema=Kn;const Ws=u.object({downloads:u.number().integer().greater(-1),star:u.number().default(0),purchases:u.number().default(0)}).meta({className:"TStats",unknownType:"any"});te.statsSchema=Ws;const Pd=u.alternatives().try(u.object({url:u.alternatives().try(u.string().uri(),u.array().items(u.string().uri()).min(1)).required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),zs={source:Pd.required(),required:u.boolean(),title:yr,description:br,mountPoint:gi,name:Rn},qs=(e,t)=>u.object(e).custom((n,r)=>!t&&n.source&&n.source.name&&!n.source.store?r.message(`missing 'store' in source of component ${n.name}`):n),Si=qs(zs).meta({className:"TComponent",unknownType:"any"});te.componentSchema=Si;const _d=qs(zs,!0),Ks=({checkStore:e}={})=>{const t=[Si,_d];return u.array().items(e?t[0]:t[1]).optional().default([])},Vs=u.object({type:u.string().required(),name:u.string().required(),signer:u.string().required(),pk:u.string().required(),created:u.string().isoDate().required(),sig:u.string().required(),excludes:u.array().items(u.string()).optional(),appended:u.array().items(u.string()).optional(),delegatee:u.string(),delegateePk:u.string(),delegation:u.string()}).meta({className:"TSignature",unknownType:"any"});te.signatureSchema=Vs;const ko=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Ro={id:u.string().custom(Rd),title:u.alternatives().try(u.string().min(1).max(Le.MAX_TITLE_LENGTH),u.object().min(1).pattern(u.string().valid(...ko),u.string().min(1).max(Le.MAX_TITLE_LENGTH))).required(),link:u.alternatives().try(u.string().custom(Oo),u.object().min(1).pattern(u.string().valid(...ko),u.string().custom(Oo))),component:u.string().min(1),section:u.array().items(u.string().min(1)).single(),role:u.array().items(u.string().min(1)).single(),icon:u.string().min(1),visible:u.boolean()},Gs=u.object({...Ro,items:u.array().items(u.object({...Ro}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=Gs;const Ti=u.array().items(Gs).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=Ti;const ji=u.object({background:u.alternatives().try(u.string().min(1),u.object({header:u.string().min(1),footer:u.string().min(1),default:u.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});te.themeSchema=ji;const Hs=u.object({whoCanAccess:u.string().valid("owner","invited","all"),profileFields:u.array().items(u.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:u.array().items(u.string().min(1)),allowSwitchProfile:u.boolean(),blockUnauthenticated:u.boolean(),blockUnauthorized:u.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});te.authConfigSchema=Hs;const Ld=u.object({type:u.string().trim().min(1).required(),description:u.string().trim().min(1)}),Oi=u.object({did:u.DID().trim().required(),type:u.string().trim().min(1).required(),public:u.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=Oi;const Xs={did:u.DID().trim().required(),version:u.semver().valid().required(),name:u.string().optional(),description:br.required(),group:u.string().valid(...Le.BLOCKLET_GROUPS),main:u.string().trim(),title:yr.optional().allow(""),logo:u.string().trim().optional(),specVersion:u.semver().valid().gte("1.0.0").optional(),author:zn.optional(),contributors:u.array().items(zn).optional(),maintainers:u.array().items(zn).optional(),community:u.string().uri().optional().allow("").default(""),documentation:u.string().uri().optional().allow("").default(""),homepage:u.string().uri().optional().allow("").default(""),license:u.string().optional().allow("").default(""),support:u.alternatives().try(u.string().uri(),u.string().email({tlds:!1})).optional(),nftFactory:u.DID().optional().allow("").default(""),payment:u.object({price:u.array().max(1).items(u.object({value:u.number().greater(0).required(),address:u.DID().required()})).default([]),share:u.array().max(4).items(u.object({name:u.string().required(),address:u.DID().required(),value:u.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const t=e.reduce((n,r)=>n+r.value,0);if(t!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${t}`);return e},"invalid blocklet share"),componentPrice:u.array().items(u.object({parentPriceRange:u.array().items(u.number()).custom((e,t)=>e.length!==2?t.message("length of range should be 2"):e[0]<0?t.message("the first value should not less than 0 in range"):e[1]<=e[0]?t.message("the second value should greater than the first value in range"):e),type:u.string().valid("fixed","percentage").required(),value:u.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),tags:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),gitHash:u.string().optional().allow(""),repository:u.alternatives().try(u.string().min(1),u.object({type:u.string().valid("git","https","svn").required(),url:u.string().uri().required(),directory:u.string()})).optional(),timeout:u.object({start:u.number().min(10).max(600),script:u.number().min(1).max(1800)}).default({start:60}),requirements:u.object({abtnode:u.semverRange().valid(),server:u.semverRange().valid(),os:u.alternatives().try(u.string().valid("*",...Le.BLOCKLET_PLATFORMS),u.array().items(u.string().valid(...Le.BLOCKLET_PLATFORMS)).min(1)),cpu:u.alternatives().try(u.string().valid("*",...Le.BLOCKLET_ARCHITECTURES),u.array().items(u.string().valid(...Le.BLOCKLET_ARCHITECTURES)).min(1)),fuels:u.array().items(u.object({endpoint:u.string().trim().required(),address:u.string().trim(),value:u.string().trim().required(),reason:u.string().trim().required()})),nodejs:u.semverRange().valid()}).default({server:Le.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:u.array().items(Ei).unique("name").custom((e,t)=>{if(e.filter(o=>o.type===Le.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Le.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(o=>o.type===Le.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const o of r)if(!o.prefix.startsWith(jo))return t.message(`Wellknown path prefix must start with: ${jo}`);return e}).default([]),environments:u.array().items(yi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,o)=>e.findIndex(c=>c.name===r.name)!==o);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:bi,capabilities:u.object({clusterMode:u.boolean(),didSpace:u.string().valid(...Object.values(Le.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:u.boolean().default(!0),serverless:u.boolean().optional(),component:u.boolean(),sitemap:u.boolean().optional()}).default({}),files:u.array().items(u.string().trim()).optional(),resource:u.object({exportApi:u.string().trim(),bundles:u.array().items(Oi),types:u.array().items(Ld).max(10)}),engine:u.alternatives().try(Kr,u.array().items(Kr)).optional(),screenshots:u.array().items(u.string().min(1)).optional().default([]),videos:u.array().items(u.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:u.string().optional().allow(""),dist:Kn.optional(),stats:Ws.optional(),htmlAst:u.any().optional(),path:u.string().optional(),signatures:u.array().items(Vs).optional(),lastPublishedAt:u.string().isoDate().optional().allow(null),components:Ks(),navigation:Ti,theme:ji,copyright:u.object({owner:u.string().min(1),year:u.alternatives().try(u.string(),u.number())}),bundleName:u.string(),bundleDid:u.DID().trim(),storeId:u.string()},Nd=u.object(Xs).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=Nd;const Ys=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,...d}={})=>((!e||!bd.default.existsSync(e))&&(t=!1),u.object({...Xs,owner:u.object({avatar:u.string().optional(),did:u.DID().trim().required(),fullName:u.string().trim().required(),email:u.string().optional().allow(null).empty("").default("")}).optional(),logo:t?u.file().trim().exists({baseDir:e}).optional():u.string().trim().optional(),files:u.array().items(t?u.file().exists({baseDir:e,canSkip:(h,b)=>[Le.BLOCKLET_ENTRY_FILE,Le.BLOCKLET_BUNDLE_FILE].includes(b)||(0,Ed.default)(b)}):u.string().trim()).optional(),dist:n?Kn.required():Kn.optional(),components:Ks({checkStore:r}),name:o?u.string().optional():u.string().required(),egress:u.boolean().optional().default(!0),docker:jd.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...d}).rename("children","components").custom((h,b)=>{const{did:w,name:s,docker:a}=h;if(a){const{image:x,dockerfile:S,network:R}=a;if(!x&&!S)return b.message("Image or dockerfile must be set");if(x&&S)return b.message("Image and dockerfile cannot be set at the same time");if(R)return b.message("ExportPorts and network cannot be set at the same time");if(S&&(h.files||(h.files=[]),h.files.push(S)),a.volumes)for(const L of a.volumes){if(!L.startsWith("$BLOCKLET_APP_DIR/")&&!L.startsWith("$BLOCKLET_DATA_DIR/"))return b.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(L.indexOf("..")>-1)return b.message('Volume cannot contain ".."')}}let O;if((0,Td.isValid)(w))try{return(0,qr.validateNewDid)(w),h}catch(x){O=x}if(s){(0,qr.validateName)(s,{checkDid:!c});const x=(0,Od.default)(s);return x!==w?b.message(`The did of name "${s}" should be "${x}"`):h}return O?b.message(O.message):h}));te.createBlockletSchema=Ys;te.default={blockletNameSchema:Rn,componentSchema:Si,endpointSchema:wi,serviceSchema:xi,createBlockletSchema:Ys,interfaceSchema:Ei,environmentSchema:yi,environmentNameSchema:vi,scriptsSchema:bi,personSchema:zn,distSchema:Kn,titleSchema:yr,descriptionSchema:br,logoSchema:Fs,navigationSchema:Ti,themeSchema:ji,mountPointSchema:gi,updateMountPointSchema:$s,authConfigSchema:Hs,resourceBundleSchema:Oi,installBlockletTitleSchema:Ds,installBlockletDescriptionSchema:Ms,Joi:u};var bt={},Ad=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.setService=bt.findService=bt.getDefaultServiceConfig=bt.getServiceConfig=void 0;const Dd=Ad(ec),Md=te,Js={},ki=e=>{Js[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};bt.setService=ki;ki({name:"auth",schema:Md.authConfigSchema,default:{}});const Qs=e=>{if(!e)throw new Error("service name should not be empty");const t=Js[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Zs=(e,t,{validate:n}={})=>{const r=Qs(e),o=(0,Dd.default)(t||{}),{value:c,error:d}=r.validate(o);if(n&&d)throw new Error(`Invalid blocklet service config: ${d.details.map(h=>h.message).join(", ")}`);return c};bt.getServiceConfig=Zs;const ea=e=>{const{defaultConfig:t}=Qs(e);return t};bt.getDefaultServiceConfig=ea;const ta=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};bt.findService=ta;bt.default={getServiceConfig:Zs,getDefaultServiceConfig:ea,findService:ta,setService:ki};Object.defineProperty(hn,"__esModule",{value:!0});hn.fixAndValidateService=hn.validateMeta=void 0;const Fd=te,Bd=bt,$d=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Bd.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);hn.fixAndValidateService=$d;const na=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,schemaOptions:d={}}={})=>{const h=(0,Fd.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:o,skipValidateDidName:c,...d}),{value:b,error:w}=h.validate(e);if(w)throw new Error(`Invalid blocklet meta: ${w.details.map(s=>s.message).join(", ")}`);return b};hn.validateMeta=na;hn.default=na;(function(e){var t=Ee&&Ee.__createBinding||(Object.create?function(j,W,Z,F){F===void 0&&(F=Z);var ce=Object.getOwnPropertyDescriptor(W,Z);(!ce||("get"in ce?!W.__esModule:ce.writable||ce.configurable))&&(ce={enumerable:!0,get:function(){return W[Z]}}),Object.defineProperty(j,F,ce)}:function(j,W,Z,F){F===void 0&&(F=Z),j[F]=W[Z]}),n=Ee&&Ee.__setModuleDefault||(Object.create?function(j,W){Object.defineProperty(j,"default",{enumerable:!0,value:W})}:function(j,W){j.default=W}),r=Ee&&Ee.__importStar||function(){var j=function(W){return j=Object.getOwnPropertyNames||function(Z){var F=[];for(var ce in Z)Object.prototype.hasOwnProperty.call(Z,ce)&&(F[F.length]=ce);return F},j(W)};return function(W){if(W&&W.__esModule)return W;var Z={};if(W!=null)for(var F=j(W),ce=0;ce<F.length;ce++)F[ce]!=="default"&&t(Z,W,F[ce]);return n(Z,W),Z}}(),o=Ee&&Ee.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const c=o(yl),d=r(Du),h=kt,b=hn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return b.fixAndValidateService}});const w=fi,s=(j,W)=>{j.description||(j.description=`Blocklet from ${W}`),j.version||(j.version=h.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=s;const a=j=>{if(j.repository&&(typeof j.repository=="string"&&(j.repository={type:"git",url:j.repository}),j.repository.url)){const W=d.fromUrl(j.repository.url);W&&(j.repository.url=W.getDefaultRepresentation()==="shortcut"?W.https():W.toString())}};e.fixRepository=a;const O=j=>{Array.isArray(j.files)?j.files&&(j.files=j.files.filter(W=>!(!W||typeof W!="string"))):delete j.files};e.fixFiles=O;const x=j=>{typeof j.keywords=="string"&&(j.keywords=j.keywords.split(/,\s+/)),j.keywords&&!Array.isArray(j.keywords)?delete j.keywords:j.keywords&&(j.keywords=j.keywords.filter(W=>!(typeof W!="string"||!W)))};e.fixKeywords=x;const S=j=>{typeof j.tags=="string"&&(j.tags=j.tags.split(/,\s+/)),j.tags&&!Array.isArray(j.tags)?delete j.tags:j.tags&&(j.tags=j.tags.filter(W=>!(typeof W!="string"||!W)))};e.fixTags=S;const R=(j,W)=>(j.author&&(j.author=W(j.author)),["maintainers","contributors"].forEach(Z=>{Array.isArray(j[Z])&&(j[Z]=j[Z].map(W))}),j),L=j=>{if(!j)return"";if(typeof j=="string")return j;const W=j.name||"",Z=j.url||j.web,F=Z?` (${Z})`:"",ce=j.email||j.mail,Y=ce?` <${ce}>`:"";return W+Y+F};e.formatPerson=L;const A=j=>{if(typeof j!="string")return j;const W=j.match(/^([^(<]+)/),Z=j.match(/\(([^)]+)\)/),F=j.match(/<([^>]+)>/),ce={};return W&&W[0].trim()&&(ce.name=W[0].trim()),F&&([,ce.email]=F),Z&&([,ce.url]=Z),ce};e.parsePerson=A;const H=j=>(R(j,L),R(j,A),j);e.fixPerson=H;const U=(j,W=!0)=>{if(Array.isArray(j.interfaces)||(j.interfaces=[]),j.interfaces.length)return j.interfaces.forEach(Y=>{Y.type===h.BLOCKLET_INTERFACE_TYPE_WEB&&(Y.protocol="http")}),j;const F=(0,c.default)(j,"capabilities.dynamicPathPrefix",!0)?h.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ce=({type:Y="web",name:ae,path:Se="/",protocol:Fe="http",port:Ue=h.BLOCKLET_DEFAULT_PORT_NAME})=>{j.interfaces.push({type:Y,name:ae,path:Se,prefix:F,port:Ue,protocol:Fe})};return[h.BLOCKLET_INTERFACE_PUBLIC].forEach(Y=>{j[Y]&&ce({name:Y,path:j[Y]})}),Array.isArray(j.exposeServices)&&j.exposeServices.forEach(Y=>{ce({type:"service",name:Y.protocol,protocol:Y.protocol,port:{internal:`BLOCKLET_${Y.protocol}_PORT`.toUpperCase(),external:Y.port}})}),W&&(delete j.publicUrl,delete j.adminUrl,delete j.configUrl,delete j.docUrl,delete j.exposeServices,j.capabilities&&delete j.capabilities.dynamicPathPrefix),j};e.fixInterfaces=U;const X=j=>{const{did:W}=j;try{(0,w.validateNewDid)(W),j.name=W}catch{}return j};e.fixName=X,e.default={fixRequired:s,fixRepository:a,fixFiles:O,fixKeywords:x,fixPerson:H,fixTags:S,fixName:X,formatPerson:L,parsePerson:A,fixInterfaces:U,fixService:b.fixAndValidateService}})(Es);function ra({owner:e,locale:t}){return i.jsxs(Q,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?i.jsx(es,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}ra.propTypes={owner:_.object.isRequired,locale:_.string.isRequired};const Ud="install-blocklet-from-URL",ia=()=>{const[e,t]=ds(Ud,"[]",{raw:!0}),n=o=>{const c=o.trim(),d=JSON.parse(e),h=d.findIndex(b=>b===c);h!==0&&(h>0&&d.splice(h,1),d.length>=10&&d.splice(9),d.unshift(c),t(JSON.stringify(d)))},r=o=>{if(!o)return;const c=JSON.parse(e),d=o.trim(),h=c.findIndex(b=>b===d);h>-1&&(c.splice(h,1),t(JSON.stringify(c)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Wd=Wo(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function Ri(e){const{value:t,onValueChange:n,children:r,helperText:o}=e,{urls:c,removeUrlRecord:d}=ia(),h=(w,s)=>{w.preventDefault(),w.stopPropagation(),d(s)},b=Wd();return i.jsxs(Q,{children:[i.jsx(zo,{freeSolo:!0,options:c,inputValue:t,onInputChange:(w,s)=>{n(s)},disableClearable:!0,popupIcon:null,renderInput:w=>Qa.cloneElement(r,{...w}),renderOption:(w,s)=>N.createElement(qo,{...w,key:s,secondaryAction:i.jsx(Uo,{edge:"end","aria-label":"delete",onClick:a=>h(a,s),children:i.jsx(ol,{})})},i.jsx(Pa,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:i.jsx(Ko,{primary:s,className:b.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),i.jsx(_a,{style:{margin:0},children:o})]})}Ri.propTypes={onValueChange:_.func,children:_.node,value:_.string,helperText:_.string};Ri.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Ci({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:o,handleText:c}){const{api:d}=Cn(),{api:h}=tc(),[b,w]=N.useState(!1),[s,a]=N.useState(""),{t:O,locale:x}=mt(),S={dist:{}},[R,L]=N.useState(e),[A,H]=N.useState(e?1:0),[U,X]=N.useState(S),[j,W]=N.useState(!1),[Z,F]=N.useState({}),ce=o==="component",Y=ce?!0:!e,{addUrlRecord:ae}=ia(),Se=async()=>{X(S),a(null),w(!0);let ie=R.trim();!ie.startsWith("https://")&&!ie.startsWith("http://")&&!ie.startsWith("file://")&&(ie=`file://${ie}`);try{const dt=decodeURIComponent(ie);try{new URL(dt)}catch{throw new Error("Invalid URL")}const{meta:we,inStore:Je,registryUrl:ze}=await d.getBlockletMetaFromUrl({input:{url:dt}});X(we),F({inStore:Je,registryUrl:ze,inputUrl:ie}),ae(ie)}catch(dt){console.error(dt);const we=`Blocklet Install failed: ${hs(dt)}`;a(we),r(dt)}finally{w(!1)}},Fe=()=>{if(ce){n({meta:U,...Z}),t();return}w(!0),W(!0)},Ue=()=>{w(!1),W(!1),n({meta:U,...Z}),t()},nt=()=>{w(!1),W(!1)};N.useEffect(()=>{e&&Se()},[e]);const ee=[{name:O("common.name"),value:At.getDisplayName({meta:U},!0)},{name:O("common.version"),value:U.version},{name:O("common.did"),value:U.did?i.jsx(nc,{did:U.did}):null},{name:O("common.author"),value:U.owner?i.jsx(ra,{owner:U.owner,locale:x}):Es.formatPerson(U.author)},{name:O("blocklet.dist.downloadLink"),value:U.dist.tarball}],pe=()=>b?i.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:i.jsx(ft,{})}):U.did?i.jsx("div",{style:{paddingLeft:"10%"},children:ee.map(ie=>ie.name===O("common.did")?i.jsx(oo,{valueComponent:"div",nameWidth:120,name:ie.name,nameFormatter:()=>O("common.did"),children:ie.value},ie.name):i.jsx(oo,{valueComponent:"div",nameWidth:120,name:ie.name,children:ie.value},ie.name))}):null,q=[{label:O("blocklet.fromUrl.step0"),body:i.jsx(me,{component:"div",children:i.jsx(Ri,{style:{marginBottom:32},value:R,helperText:O("blocklet.fromUrl.description"),onValueChange:ie=>{a(null),L(ie)},children:i.jsx(ur,{label:O("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:R,onChange:ie=>{a(null),L(ie.target.value)},disabled:b,onKeyPress:ie=>{ie.key==="Enter"&&(ie.preventDefault(),Se(),H(1))}})})}),cancel:O("common.cancel"),confirm:O("common.next"),onCancel:t,onConfirm:()=>{Se(),H(1)}},{label:O("blocklet.fromUrl.step1"),body:pe(),cancel:O(Y?"common.pre":"common.cancel"),confirm:(c==null?void 0:c.confirm)||O("blocklet.fromUrl.confirm"),onCancel:()=>{Y?H(ie=>ie-1):t()},onConfirm:()=>{Fe()}}],Te=q[A];return i.jsxs(i.Fragment,{children:[i.jsxs(ti,{title:(c==null?void 0:c.title)||O("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Te.onCancel(),showCloseButton:A===0,disableEscapeKeyDown:!0,open:!0,actions:i.jsxs(i.Fragment,{children:[Te.cancel&&i.jsx(ct,{onClick:ie=>{ie.stopPropagation(),a(null),Te.onCancel()},color:"inherit",children:Te.cancel||O("common.cancel")}),i.jsxs(ct,{onClick:ie=>{ie.stopPropagation(),Te.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:b||!R||s,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[b&&A===0&&i.jsx(ft,{size:16}),Te.confirm]})]}),children:[Y&&i.jsx(La,{alternativeLabel:!0,activeStep:A,children:q.map(({label:ie})=>i.jsx(Na,{children:i.jsx(Aa,{children:ie})},ie))}),i.jsx(Da,{component:"div",style:{marginTop:24},children:Te.body}),!!s&&i.jsx(Vo,{severity:"error",style:{width:"100%",marginTop:8},children:s})]}),U&&j&&i.jsx(ns,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:Ue,extraParams:{title:U.title,wt:bl(U),blockletMetaUrl:decodeURIComponent(R.trim())},messages:{title:O("setup.keyPair.title"),scan:O("setup.keyPair.scan"),confirm:O("setup.keyPair.confirm"),success:O("setup.keyPair.success")},onClose:nt})]})}Ci.propTypes={defaultUrl:_.string,onCancel:_.func.isRequired,onSuccess:_.func.isRequired,onError:_.func,mode:_.oneOf(["install","component"]),handleText:_.object};Ci.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};var Ii={},zd=cr;Object.defineProperty(Ii,"__esModule",{value:!0});var oa=Ii.default=void 0,qd=zd(dr()),Kd=i;oa=Ii.default=(0,qd.default)((0,Kd.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const Vd={meta:_.object.isRequired,onCancel:_.func.isRequired},Gd=Wo(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function sa({action:e,onSelect:t,onNext:n}){const r=Gd(),{t:o}=mt(),c=[{action:"purchase",title:o("store.purchase.purchase.title"),description:o("store.purchase.purchase.description")},{action:"verify",title:o("store.purchase.verify.title"),description:o("store.purchase.verify.description")}];return i.jsxs(i.Fragment,{children:[i.jsx(Ma,{className:r.tabPanel,children:c.map(d=>i.jsxs(qo,{button:!0,selected:e===d.action,onClick:()=>t(d.action),children:[i.jsx(Fa,{className:r.iconRoot,children:d.action==="purchase"?i.jsx(rc,{style:{color:e==="purchase"?eo.primary.main:"#AAA",fontSize:32}}):i.jsx(oa,{style:{color:e==="verify"?eo.primary.main:"#AAA",fontSize:32}})}),i.jsx(Ko,{primary:d.title,secondary:d.description})]},d.action))}),n&&i.jsx(ct,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:o("common.next")})]})}sa.propTypes={action:_.oneOf(["both","purchase","verify"]).isRequired,onSelect:_.func.isRequired,onNext:_.func.isRequired};function Pi({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:o,locale:c}=mt(),{info:d}=Cn(),h=xl(d),[b,w]=N.useState(null),s=new URL(e==null?void 0:e.registryUrl).origin,a=At.getDisplayName({meta:e}),O=async(S,R)=>{const L=({downloadTokenList:U})=>{r({downloadTokenList:U})},A=U=>{ni.error(U),t(U)};function H(U){return sl(()=>so.get(U).then(async({data:X})=>{const j=X==null?void 0:X.downloadTokenList;if(X.status==="succeed"){if(j&&j.length)await L({downloadTokenList:j});else return await A(o("blocklet.component.missDownloadTokenTip")),!0;return!0}return X.status==="error"?(console.error("vc error: ",X),await A(X==null?void 0:X.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&b){const{statusUrl:U}=wl(b);await H(U)}else await L({downloadTokenList:S.downloadTokenList&&R(S.downloadTokenList)})};if(N.useEffect(()=>{if(n==="purchase"){const S=new URL(s);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",d.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{so.get(S.href).then(({data:R})=>{const L=`${R.url}`;w(L)})}catch(R){console.error("get next workflow url error: ",R)}}return()=>{w(null)}},[n]),n==="purchase"&&!b)return"";const x={verify:{action:"verify-purchase-blocklet",checkFn:io.create({baseURL:s}).get,extraParams:{serverDid:d.did,blockletDid:e==null?void 0:e.did},messages:{title:o("store.purchase.verify.auth.title",{name:a}),scan:o("store.purchase.verify.auth.scan"),confirm:o("store.purchase.verify.auth.confirm"),success:o("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:io.create({baseURL:qn(s,"/store")}).get,extraParams:{factory:e.nftFactory,nw:b},messages:{title:o("store.purchase.auth.title",{name:a}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:i.jsxs(i.Fragment,{children:[i.jsx("p",{children:o("store.purchase.auth.success")}),i.jsx("p",{children:o("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return i.jsx(ns,{open:!0,locale:c,popup:!1,saveConnect:!1,className:"connect",baseUrl:s,onSuccess:O,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:h,disableClose:!0,showDownload:!1,...x[n]})}Pi.propTypes={...Vd,handlePaySuccess:_.func,mode:_.oneOf(["verify","purchase"]).isRequired};Pi.defaultProps={handlePaySuccess:()=>{}};const _i=N.forwardRef(({mode:e,...t},n)=>{const[r,o]=N.useState(e!=="both"?e:"verify"),[c,d]=N.useState(e!=="both"?2:1),h=w=>{w!==r&&o(w)},b=()=>{r&&c!==2&&d(2)};return N.useImperativeHandle(n,()=>({onNext:b,getCurrentStep:()=>c})),c===1?i.jsx("div",{style:{maxWidth:520},children:i.jsx(sa,{action:r,onNext:null,onSelect:h})}):i.jsx(Pi,{...t,mode:r})});_i.propTypes={mode:_.oneOf(["both","verify","purchase"]).isRequired,ref:_.any};_i.defaultProps={ref:{}};const Hd=_i;function Xd({...e}){return i.jsx(ct,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Li({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:o}=mt(),c=ps();return!e||El(e.meta)?i.jsx(Yd,{children:n}):i.jsxs(Jd,{isMobile:c,children:[i.jsx(Xd,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:o("setup.startNow")}),i.jsx(Q,{display:"flex",alignItems:"center",children:n})]})}Li.propTypes={blocklet:_.object,onStartNow:_.func,children:_.any,disabled:_.bool};Li.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Yd=Ve(Q)`
216
+ `),gr=u.string().trim().min(1).custom(e=>{if(Od(e)>_e.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${_e.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});te.titleSchema=gr;const vr=u.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=vr;const As=u.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=As;const Ds=u.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=Ds;const Ms=u.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Eo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Eo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=Ms;const Fs=u.string().trim().min(1),gi=Fs.meta({className:"TMountPoint"}).custom((e,t)=>(0,mi.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=gi;const Bs=Fs.meta({className:"TUpdateMountPoint"}).custom(e=>(0,mi.default)(e));te.updateMountPointSchema=Bs;const Rn=u.string().custom(e=>((0,Wr.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=Rn;const Rd=[],vi=u.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Rd.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});te.environmentNameSchema=vi;const yi=u.object({name:vi.required(),description:u.string().trim().required(),default:u.string().optional().allow("").default(""),required:u.boolean().default(!1),secure:u.boolean().default(!1),validation:u.string().optional(),shared:u.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});te.environmentSchema=yi;const bi=u.object({dev:u.string().trim().min(1),e2eDev:u.string().trim().min(1),preFlight:u.string().trim().min(1),preInstall:u.string().trim().min(1),postInstall:u.string().trim().min(1),preStart:u.string().trim().min(1),postStart:u.string().trim().min(1),preStop:u.string().trim().min(1),preUninstall:u.string().trim().min(1),preConfig:u.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});te.scriptsSchema=bi;const xi=u.object({name:u.string().required().trim(),config:u.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=xi;const wi=u.object({type:u.string().trim(!0).min(1).required(),path:u.string().required(),meta:u.object({vcType:u.string(),payable:u.boolean(),params:u.array().items({name:u.string().required().trim(),description:u.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});te.endpointSchema=wi;const $s=u.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});te.cacheableSchema=$s;const Ei=u.object({type:u.string().lowercase().valid(..._e.BLOCKLET_INTERFACE_TYPES).required(),name:u.string().trim().required(),path:u.string().trim().default("/"),prefix:u.string().trim().min(1).default(_e.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:u.number().port().optional(),hostIP:u.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:u.string().lowercase().valid(..._e.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:u.alternatives().try(u.string().uppercase().default(_e.BLOCKLET_DEFAULT_PORT_NAME),u.object({internal:u.string().uppercase().required(),external:u.number().port().required()})).default(_e.BLOCKLET_DEFAULT_PORT_NAME),cacheable:u.array().items($s).unique(),services:u.array().items(xi).unique("name"),endpoints:u.array().items(wi).unique("type"),pageGroups:u.array().items(u.string().min(1).max(255).trim()).unique()}).meta({className:"TInterface",unknownType:"any"});te.interfaceSchema=Ei;const Cd=u.alternatives().try(u.string().required(),u.object({url:u.string().uri({scheme:["http","https","file"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}).required(),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),zr=u.object({platform:u.string().valid(..._e.BLOCKLET_PLATFORMS).optional(),interpreter:u.string().valid("binary","node","blocklet").default("node"),source:Cd,args:u.array().items(u.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=zr;const zn=u.object({name:u.string().min(1).required(),email:u.string().email({tlds:!1}).optional(),url:u.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});te.personSchema=zn;const Kn=u.object({tarball:u.alternatives().try(u.string().uri(),u.string()).required(),integrity:u.string().required(),size:u.number().optional()}).meta({className:"TDist",unknownType:"any"});te.distSchema=Kn;const Us=u.object({downloads:u.number().integer().greater(-1),star:u.number().default(0),purchases:u.number().default(0)}).meta({className:"TStats",unknownType:"any"});te.statsSchema=Us;const Id=u.alternatives().try(u.object({url:u.alternatives().try(u.string().uri(),u.array().items(u.string().uri()).min(1)).required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid())}),u.object({store:u.string().uri({scheme:["http","https"]}),name:Rn.required(),version:u.alternatives().try(u.string().valid("latest"),u.semverRange().valid()).default("latest")})),Ws={source:Id.required(),required:u.boolean(),title:gr,description:vr,mountPoint:gi,name:Rn},zs=(e,t)=>u.object(e).custom((n,r)=>!t&&n.source&&n.source.name&&!n.source.store?r.message(`missing 'store' in source of component ${n.name}`):n),Si=zs(Ws).meta({className:"TComponent",unknownType:"any"});te.componentSchema=Si;const Pd=zs(Ws,!0),qs=({checkStore:e}={})=>{const t=[Si,Pd];return u.array().items(e?t[0]:t[1]).optional().default([])},Ks=u.object({type:u.string().required(),name:u.string().required(),signer:u.string().required(),pk:u.string().required(),created:u.string().isoDate().required(),sig:u.string().required(),excludes:u.array().items(u.string()).optional(),appended:u.array().items(u.string()).optional(),delegatee:u.string(),delegateePk:u.string(),delegation:u.string()}).meta({className:"TSignature",unknownType:"any"});te.signatureSchema=Ks;const Oo=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],ko={id:u.string().custom(kd),title:u.alternatives().try(u.string().min(1).max(_e.MAX_TITLE_LENGTH),u.object().min(1).pattern(u.string().valid(...Oo),u.string().min(1).max(_e.MAX_TITLE_LENGTH))).required(),link:u.alternatives().try(u.string().custom(jo),u.object().min(1).pattern(u.string().valid(...Oo),u.string().custom(jo))),component:u.string().min(1),section:u.array().items(u.string().min(1)).single(),role:u.array().items(u.string().min(1)).single(),icon:u.string().min(1),visible:u.boolean()},Vs=u.object({...ko,items:u.array().items(u.object({...ko}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=Vs;const Ti=u.array().items(Vs).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=Ti;const ji=u.object({background:u.alternatives().try(u.string().min(1),u.object({header:u.string().min(1),footer:u.string().min(1),default:u.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});te.themeSchema=ji;const Gs=u.object({whoCanAccess:u.string().valid("owner","invited","all"),profileFields:u.array().items(u.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:u.array().items(u.string().min(1)),allowSwitchProfile:u.boolean(),blockUnauthenticated:u.boolean(),blockUnauthorized:u.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});te.authConfigSchema=Gs;const Ld=u.object({type:u.string().trim().min(1).required(),description:u.string().trim().min(1)}),Oi=u.object({did:u.DID().trim().required(),type:u.string().trim().min(1).required(),public:u.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=Oi;const Hs={did:u.DID().trim().required(),version:u.semver().valid().required(),name:u.string().optional(),description:vr.required(),group:u.string().valid(..._e.BLOCKLET_GROUPS),main:u.string().trim(),title:gr.optional().allow(""),logo:u.string().trim().optional(),specVersion:u.semver().valid().gte("1.0.0").optional(),author:zn.optional(),contributors:u.array().items(zn).optional(),maintainers:u.array().items(zn).optional(),community:u.string().uri().optional().allow("").default(""),documentation:u.string().uri().optional().allow("").default(""),homepage:u.string().uri().optional().allow("").default(""),license:u.string().optional().allow("").default(""),support:u.alternatives().try(u.string().uri(),u.string().email({tlds:!1})).optional(),nftFactory:u.DID().optional().allow("").default(""),payment:u.object({price:u.array().max(1).items(u.object({value:u.number().greater(0).required(),address:u.DID().required()})).default([]),share:u.array().max(4).items(u.object({name:u.string().required(),address:u.DID().required(),value:u.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const t=e.reduce((n,r)=>n+r.value,0);if(t!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${t}`);return e},"invalid blocklet share"),componentPrice:u.array().items(u.object({parentPriceRange:u.array().items(u.number()).custom((e,t)=>e.length!==2?t.message("length of range should be 2"):e[0]<0?t.message("the first value should not less than 0 in range"):e[1]<=e[0]?t.message("the second value should greater than the first value in range"):e),type:u.string().valid("fixed","percentage").required(),value:u.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),tags:u.alternatives().try(u.string().trim().min(1),u.array().items(u.string().min(1))).optional(),gitHash:u.string().optional().allow(""),repository:u.alternatives().try(u.string().min(1),u.object({type:u.string().valid("git","https","svn").required(),url:u.string().uri().required(),directory:u.string()})).optional(),timeout:u.object({start:u.number().min(10).max(600),script:u.number().min(1).max(1800)}).default({start:60}),requirements:u.object({abtnode:u.semverRange().valid(),server:u.semverRange().valid(),os:u.alternatives().try(u.string().valid("*",..._e.BLOCKLET_PLATFORMS),u.array().items(u.string().valid(..._e.BLOCKLET_PLATFORMS)).min(1)),cpu:u.alternatives().try(u.string().valid("*",..._e.BLOCKLET_ARCHITECTURES),u.array().items(u.string().valid(..._e.BLOCKLET_ARCHITECTURES)).min(1)),fuels:u.array().items(u.object({endpoint:u.string().trim().required(),address:u.string().trim(),value:u.string().trim().required(),reason:u.string().trim().required()})),nodejs:u.semverRange().valid()}).default({server:_e.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:u.array().items(Ei).unique("name").custom((e,t)=>{if(e.filter(o=>o.type===_e.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${_e.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(o=>o.type===_e.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const o of r)if(!o.prefix.startsWith(To))return t.message(`Wellknown path prefix must start with: ${To}`);return e}).default([]),environments:u.array().items(yi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,o)=>e.findIndex(c=>c.name===r.name)!==o);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:bi,capabilities:u.object({clusterMode:u.boolean(),didSpace:u.string().valid(...Object.values(_e.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:u.boolean().default(!0),serverless:u.boolean().optional(),component:u.boolean(),sitemap:u.boolean().optional()}).default({}),files:u.array().items(u.string().trim()).optional(),resource:u.object({exportApi:u.string().trim(),bundles:u.array().items(Oi),types:u.array().items(Ld).max(10)}),engine:u.alternatives().try(zr,u.array().items(zr)).optional(),screenshots:u.array().items(u.string().min(1)).optional().default([]),videos:u.array().items(u.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:u.string().optional().allow(""),dist:Kn.optional(),stats:Us.optional(),htmlAst:u.any().optional(),path:u.string().optional(),signatures:u.array().items(Ks).optional(),lastPublishedAt:u.string().isoDate().optional().allow(null),components:qs(),navigation:Ti,theme:ji,copyright:u.object({owner:u.string().min(1),year:u.alternatives().try(u.string(),u.number())}),bundleName:u.string(),bundleDid:u.DID().trim(),storeId:u.string()},_d=u.object(Hs).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=_d;const Xs=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,...d}={})=>((!e||!yd.default.existsSync(e))&&(t=!1),u.object({...Hs,owner:u.object({avatar:u.string().optional(),did:u.DID().trim().required(),fullName:u.string().trim().required(),email:u.string().optional().allow(null).empty("").default("")}).optional(),logo:t?u.file().trim().exists({baseDir:e}).optional():u.string().trim().optional(),files:u.array().items(t?u.file().exists({baseDir:e,canSkip:(h,b)=>[_e.BLOCKLET_ENTRY_FILE,_e.BLOCKLET_BUNDLE_FILE].includes(b)||(0,wd.default)(b)}):u.string().trim()).optional(),dist:n?Kn.required():Kn.optional(),components:qs({checkStore:r}),name:o?u.string().optional():u.string().required(),egress:u.boolean().optional().default(!0),docker:Td.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...d}).rename("children","components").custom((h,b)=>{const{did:w,name:s,docker:a}=h;if(a){const{image:x,dockerfile:S,network:R}=a;if(!x&&!S)return b.message("Image or dockerfile must be set");if(x&&S)return b.message("Image and dockerfile cannot be set at the same time");if(R)return b.message("ExportPorts and network cannot be set at the same time");if(S&&(h.files||(h.files=[]),h.files.push(S)),a.volumes)for(const _ of a.volumes){if(!_.startsWith("$BLOCKLET_APP_DIR/")&&!_.startsWith("$BLOCKLET_DATA_DIR/"))return b.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(_.indexOf("..")>-1)return b.message('Volume cannot contain ".."')}}let O;if((0,Sd.isValid)(w))try{return(0,Wr.validateNewDid)(w),h}catch(x){O=x}if(s){(0,Wr.validateName)(s,{checkDid:!c});const x=(0,jd.default)(s);return x!==w?b.message(`The did of name "${s}" should be "${x}"`):h}return O?b.message(O.message):h}));te.createBlockletSchema=Xs;te.default={blockletNameSchema:Rn,componentSchema:Si,endpointSchema:wi,serviceSchema:xi,createBlockletSchema:Xs,interfaceSchema:Ei,environmentSchema:yi,environmentNameSchema:vi,scriptsSchema:bi,personSchema:zn,distSchema:Kn,titleSchema:gr,descriptionSchema:vr,logoSchema:Ms,navigationSchema:Ti,themeSchema:ji,mountPointSchema:gi,updateMountPointSchema:Bs,authConfigSchema:Gs,resourceBundleSchema:Oi,installBlockletTitleSchema:As,installBlockletDescriptionSchema:Ds,Joi:u};var bt={},Nd=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.setService=bt.findService=bt.getDefaultServiceConfig=bt.getServiceConfig=void 0;const Ad=Nd(Ql),Dd=te,Ys={},ki=e=>{Ys[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};bt.setService=ki;ki({name:"auth",schema:Dd.authConfigSchema,default:{}});const Js=e=>{if(!e)throw new Error("service name should not be empty");const t=Ys[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Qs=(e,t,{validate:n}={})=>{const r=Js(e),o=(0,Ad.default)(t||{}),{value:c,error:d}=r.validate(o);if(n&&d)throw new Error(`Invalid blocklet service config: ${d.details.map(h=>h.message).join(", ")}`);return c};bt.getServiceConfig=Qs;const Zs=e=>{const{defaultConfig:t}=Js(e);return t};bt.getDefaultServiceConfig=Zs;const ea=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};bt.findService=ea;bt.default={getServiceConfig:Qs,getDefaultServiceConfig:Zs,findService:ea,setService:ki};Object.defineProperty(hn,"__esModule",{value:!0});hn.fixAndValidateService=hn.validateMeta=void 0;const Md=te,Fd=bt,Bd=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Fd.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);hn.fixAndValidateService=Bd;const ta=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:c=!1,schemaOptions:d={}}={})=>{const h=(0,Md.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:o,skipValidateDidName:c,...d}),{value:b,error:w}=h.validate(e);if(w)throw new Error(`Invalid blocklet meta: ${w.details.map(s=>s.message).join(", ")}`);return b};hn.validateMeta=ta;hn.default=ta;(function(e){var t=Ee&&Ee.__createBinding||(Object.create?function(j,W,Z,F){F===void 0&&(F=Z);var ce=Object.getOwnPropertyDescriptor(W,Z);(!ce||("get"in ce?!W.__esModule:ce.writable||ce.configurable))&&(ce={enumerable:!0,get:function(){return W[Z]}}),Object.defineProperty(j,F,ce)}:function(j,W,Z,F){F===void 0&&(F=Z),j[F]=W[Z]}),n=Ee&&Ee.__setModuleDefault||(Object.create?function(j,W){Object.defineProperty(j,"default",{enumerable:!0,value:W})}:function(j,W){j.default=W}),r=Ee&&Ee.__importStar||function(){var j=function(W){return j=Object.getOwnPropertyNames||function(Z){var F=[];for(var ce in Z)Object.prototype.hasOwnProperty.call(Z,ce)&&(F[F.length]=ce);return F},j(W)};return function(W){if(W&&W.__esModule)return W;var Z={};if(W!=null)for(var F=j(W),ce=0;ce<F.length;ce++)F[ce]!=="default"&&t(Z,W,F[ce]);return n(Z,W),Z}}(),o=Ee&&Ee.__importDefault||function(j){return j&&j.__esModule?j:{default:j}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const c=o(gl),d=r(Au),h=kt,b=hn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return b.fixAndValidateService}});const w=fi,s=(j,W)=>{j.description||(j.description=`Blocklet from ${W}`),j.version||(j.version=h.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=s;const a=j=>{if(j.repository&&(typeof j.repository=="string"&&(j.repository={type:"git",url:j.repository}),j.repository.url)){const W=d.fromUrl(j.repository.url);W&&(j.repository.url=W.getDefaultRepresentation()==="shortcut"?W.https():W.toString())}};e.fixRepository=a;const O=j=>{Array.isArray(j.files)?j.files&&(j.files=j.files.filter(W=>!(!W||typeof W!="string"))):delete j.files};e.fixFiles=O;const x=j=>{typeof j.keywords=="string"&&(j.keywords=j.keywords.split(/,\s+/)),j.keywords&&!Array.isArray(j.keywords)?delete j.keywords:j.keywords&&(j.keywords=j.keywords.filter(W=>!(typeof W!="string"||!W)))};e.fixKeywords=x;const S=j=>{typeof j.tags=="string"&&(j.tags=j.tags.split(/,\s+/)),j.tags&&!Array.isArray(j.tags)?delete j.tags:j.tags&&(j.tags=j.tags.filter(W=>!(typeof W!="string"||!W)))};e.fixTags=S;const R=(j,W)=>(j.author&&(j.author=W(j.author)),["maintainers","contributors"].forEach(Z=>{Array.isArray(j[Z])&&(j[Z]=j[Z].map(W))}),j),_=j=>{if(!j)return"";if(typeof j=="string")return j;const W=j.name||"",Z=j.url||j.web,F=Z?` (${Z})`:"",ce=j.email||j.mail,Y=ce?` <${ce}>`:"";return W+Y+F};e.formatPerson=_;const A=j=>{if(typeof j!="string")return j;const W=j.match(/^([^(<]+)/),Z=j.match(/\(([^)]+)\)/),F=j.match(/<([^>]+)>/),ce={};return W&&W[0].trim()&&(ce.name=W[0].trim()),F&&([,ce.email]=F),Z&&([,ce.url]=Z),ce};e.parsePerson=A;const H=j=>(R(j,_),R(j,A),j);e.fixPerson=H;const U=(j,W=!0)=>{if(Array.isArray(j.interfaces)||(j.interfaces=[]),j.interfaces.length)return j.interfaces.forEach(Y=>{Y.type===h.BLOCKLET_INTERFACE_TYPE_WEB&&(Y.protocol="http")}),j;const F=(0,c.default)(j,"capabilities.dynamicPathPrefix",!0)?h.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ce=({type:Y="web",name:ae,path:Se="/",protocol:Fe="http",port:Ue=h.BLOCKLET_DEFAULT_PORT_NAME})=>{j.interfaces.push({type:Y,name:ae,path:Se,prefix:F,port:Ue,protocol:Fe})};return[h.BLOCKLET_INTERFACE_PUBLIC].forEach(Y=>{j[Y]&&ce({name:Y,path:j[Y]})}),Array.isArray(j.exposeServices)&&j.exposeServices.forEach(Y=>{ce({type:"service",name:Y.protocol,protocol:Y.protocol,port:{internal:`BLOCKLET_${Y.protocol}_PORT`.toUpperCase(),external:Y.port}})}),W&&(delete j.publicUrl,delete j.adminUrl,delete j.configUrl,delete j.docUrl,delete j.exposeServices,j.capabilities&&delete j.capabilities.dynamicPathPrefix),j};e.fixInterfaces=U;const X=j=>{const{did:W}=j;try{(0,w.validateNewDid)(W),j.name=W}catch{}return j};e.fixName=X,e.default={fixRequired:s,fixRepository:a,fixFiles:O,fixKeywords:x,fixPerson:H,fixTags:S,fixName:X,formatPerson:_,parsePerson:A,fixInterfaces:U,fixService:b.fixAndValidateService}})(ws);function na({owner:e,locale:t}){return i.jsxs(Q,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?i.jsx(Zo,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}na.propTypes={owner:L.object.isRequired,locale:L.string.isRequired};const $d="install-blocklet-from-URL",ra=()=>{const[e,t]=us($d,"[]",{raw:!0}),n=o=>{const c=o.trim(),d=JSON.parse(e),h=d.findIndex(b=>b===c);h!==0&&(h>0&&d.splice(h,1),d.length>=10&&d.splice(9),d.unshift(c),t(JSON.stringify(d)))},r=o=>{if(!o)return;const c=JSON.parse(e),d=o.trim(),h=c.findIndex(b=>b===d);h>-1&&(c.splice(h,1),t(JSON.stringify(c)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Ud=Uo(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function Ri(e){const{value:t,onValueChange:n,children:r,helperText:o}=e,{urls:c,removeUrlRecord:d}=ra(),h=(w,s)=>{w.preventDefault(),w.stopPropagation(),d(s)},b=Ud();return i.jsxs(Q,{children:[i.jsx(Wo,{freeSolo:!0,options:c,inputValue:t,onInputChange:(w,s)=>{n(s)},disableClearable:!0,popupIcon:null,renderInput:w=>Ya.cloneElement(r,{...w}),renderOption:(w,s)=>N.createElement(zo,{...w,key:s,secondaryAction:i.jsx($o,{edge:"end","aria-label":"delete",onClick:a=>h(a,s),children:i.jsx(rl,{})})},i.jsx(Ca,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:i.jsx(qo,{primary:s,className:b.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),i.jsx(Ia,{style:{margin:0},children:o})]})}Ri.propTypes={onValueChange:L.func,children:L.node,value:L.string,helperText:L.string};Ri.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Ci({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:o,handleText:c}){const{api:d}=Cn(),{api:h}=Zl(),[b,w]=N.useState(!1),[s,a]=N.useState(""),{t:O,locale:x}=mt(),S={dist:{}},[R,_]=N.useState(e),[A,H]=N.useState(e?1:0),[U,X]=N.useState(S),[j,W]=N.useState(!1),[Z,F]=N.useState({}),ce=o==="component",Y=ce?!0:!e,{addUrlRecord:ae}=ra(),Se=async()=>{X(S),a(null),w(!0);let ie=R.trim();!ie.startsWith("https://")&&!ie.startsWith("http://")&&!ie.startsWith("file://")&&(ie=`file://${ie}`);try{const dt=decodeURIComponent(ie);try{new URL(dt)}catch{throw new Error("Invalid URL")}const{meta:we,inStore:Je,registryUrl:ze}=await d.getBlockletMetaFromUrl({input:{url:dt}});X(we),F({inStore:Je,registryUrl:ze,inputUrl:ie}),ae(ie)}catch(dt){console.error(dt);const we=`Blocklet Install failed: ${ds(dt)}`;a(we),r(dt)}finally{w(!1)}},Fe=()=>{if(ce){n({meta:U,...Z}),t();return}w(!0),W(!0)},Ue=()=>{w(!1),W(!1),n({meta:U,...Z}),t()},nt=()=>{w(!1),W(!1)};N.useEffect(()=>{e&&Se()},[e]);const ee=[{name:O("common.name"),value:At.getDisplayName({meta:U},!0)},{name:O("common.version"),value:U.version},{name:O("common.did"),value:U.did?i.jsx(ec,{did:U.did}):null},{name:O("common.author"),value:U.owner?i.jsx(na,{owner:U.owner,locale:x}):ws.formatPerson(U.author)},{name:O("blocklet.dist.downloadLink"),value:U.dist.tarball}],pe=()=>b?i.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:i.jsx(ft,{})}):U.did?i.jsx("div",{style:{paddingLeft:"10%"},children:ee.map(ie=>ie.name===O("common.did")?i.jsx(io,{valueComponent:"div",nameWidth:120,name:ie.name,nameFormatter:()=>O("common.did"),children:ie.value},ie.name):i.jsx(io,{valueComponent:"div",nameWidth:120,name:ie.name,children:ie.value},ie.name))}):null,q=[{label:O("blocklet.fromUrl.step0"),body:i.jsx(me,{component:"div",children:i.jsx(Ri,{style:{marginBottom:32},value:R,helperText:O("blocklet.fromUrl.description"),onValueChange:ie=>{a(null),_(ie)},children:i.jsx(cr,{label:O("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:R,onChange:ie=>{a(null),_(ie.target.value)},disabled:b,onKeyPress:ie=>{ie.key==="Enter"&&(ie.preventDefault(),Se(),H(1))}})})}),cancel:O("common.cancel"),confirm:O("common.next"),onCancel:t,onConfirm:()=>{Se(),H(1)}},{label:O("blocklet.fromUrl.step1"),body:pe(),cancel:O(Y?"common.pre":"common.cancel"),confirm:(c==null?void 0:c.confirm)||O("blocklet.fromUrl.confirm"),onCancel:()=>{Y?H(ie=>ie-1):t()},onConfirm:()=>{Fe()}}],Te=q[A];return i.jsxs(i.Fragment,{children:[i.jsxs(ti,{title:(c==null?void 0:c.title)||O("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Te.onCancel(),showCloseButton:A===0,disableEscapeKeyDown:!0,open:!0,actions:i.jsxs(i.Fragment,{children:[Te.cancel&&i.jsx(ct,{onClick:ie=>{ie.stopPropagation(),a(null),Te.onCancel()},color:"inherit",children:Te.cancel||O("common.cancel")}),i.jsxs(ct,{onClick:ie=>{ie.stopPropagation(),Te.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:b||!R||s,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[b&&A===0&&i.jsx(ft,{size:16}),Te.confirm]})]}),children:[Y&&i.jsx(Pa,{alternativeLabel:!0,activeStep:A,children:q.map(({label:ie})=>i.jsx(La,{children:i.jsx(_a,{children:ie})},ie))}),i.jsx(Na,{component:"div",style:{marginTop:24},children:Te.body}),!!s&&i.jsx(Ko,{severity:"error",style:{width:"100%",marginTop:8},children:s})]}),U&&j&&i.jsx(ts,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:h.get,checkTimeout:5*60*1e3,onSuccess:Ue,extraParams:{title:U.title,wt:vl(U),blockletMetaUrl:decodeURIComponent(R.trim())},messages:{title:O("setup.keyPair.title"),scan:O("setup.keyPair.scan"),confirm:O("setup.keyPair.confirm"),success:O("setup.keyPair.success")},onClose:nt})]})}Ci.propTypes={defaultUrl:L.string,onCancel:L.func.isRequired,onSuccess:L.func.isRequired,onError:L.func,mode:L.oneOf(["install","component"]),handleText:L.object};Ci.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const Wd={meta:L.object.isRequired,onCancel:L.func.isRequired},zd=Uo(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function ia({action:e,onSelect:t,onNext:n}){const r=zd(),{t:o}=mt(),c=[{action:"purchase",title:o("store.purchase.purchase.title"),description:o("store.purchase.purchase.description")},{action:"verify",title:o("store.purchase.verify.title"),description:o("store.purchase.verify.description")}];return i.jsxs(i.Fragment,{children:[i.jsx(Aa,{className:r.tabPanel,children:c.map(d=>i.jsxs(zo,{button:!0,selected:e===d.action,onClick:()=>t(d.action),children:[i.jsx(Da,{className:r.iconRoot,children:d.action==="purchase"?i.jsx(tc,{style:{color:e==="purchase"?Zi.primary.main:"#AAA",fontSize:32}}):i.jsx(nc,{style:{color:e==="verify"?Zi.primary.main:"#AAA",fontSize:32}})}),i.jsx(qo,{primary:d.title,secondary:d.description})]},d.action))}),n&&i.jsx(ct,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:o("common.next")})]})}ia.propTypes={action:L.oneOf(["both","purchase","verify"]).isRequired,onSelect:L.func.isRequired,onNext:L.func.isRequired};function Ii({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:o,locale:c}=mt(),{info:d}=Cn(),h=yl(d),[b,w]=N.useState(null),s=new URL(e==null?void 0:e.registryUrl).origin,a=At.getDisplayName({meta:e}),O=async(S,R)=>{const _=({downloadTokenList:U})=>{r({downloadTokenList:U})},A=U=>{ni.error(U),t(U)};function H(U){return il(()=>oo.get(U).then(async({data:X})=>{const j=X==null?void 0:X.downloadTokenList;if(X.status==="succeed"){if(j&&j.length)await _({downloadTokenList:j});else return await A(o("blocklet.component.missDownloadTokenTip")),!0;return!0}return X.status==="error"?(console.error("vc error: ",X),await A(X==null?void 0:X.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&b){const{statusUrl:U}=bl(b);await H(U)}else await _({downloadTokenList:S.downloadTokenList&&R(S.downloadTokenList)})};if(N.useEffect(()=>{if(n==="purchase"){const S=new URL(s);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",d.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{oo.get(S.href).then(({data:R})=>{const _=`${R.url}`;w(_)})}catch(R){console.error("get next workflow url error: ",R)}}return()=>{w(null)}},[n]),n==="purchase"&&!b)return"";const x={verify:{action:"verify-purchase-blocklet",checkFn:ro.create({baseURL:s}).get,extraParams:{serverDid:d.did,blockletDid:e==null?void 0:e.did},messages:{title:o("store.purchase.verify.auth.title",{name:a}),scan:o("store.purchase.verify.auth.scan"),confirm:o("store.purchase.verify.auth.confirm"),success:o("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:ro.create({baseURL:qn(s,"/store")}).get,extraParams:{factory:e.nftFactory,nw:b},messages:{title:o("store.purchase.auth.title",{name:a}),scan:o("store.purchase.auth.scan"),confirm:o("store.purchase.auth.confirm"),success:i.jsxs(i.Fragment,{children:[i.jsx("p",{children:o("store.purchase.auth.success")}),i.jsx("p",{children:o("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return i.jsx(ts,{open:!0,locale:c,popup:!1,saveConnect:!1,className:"connect",baseUrl:s,onSuccess:O,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:h,disableClose:!0,showDownload:!1,...x[n]})}Ii.propTypes={...Wd,handlePaySuccess:L.func,mode:L.oneOf(["verify","purchase"]).isRequired};Ii.defaultProps={handlePaySuccess:()=>{}};const Pi=N.forwardRef(({mode:e,...t},n)=>{const[r,o]=N.useState(e!=="both"?e:"verify"),[c,d]=N.useState(e!=="both"?2:1),h=w=>{w!==r&&o(w)},b=()=>{r&&c!==2&&d(2)};return N.useImperativeHandle(n,()=>({onNext:b,getCurrentStep:()=>c})),c===1?i.jsx("div",{style:{maxWidth:520},children:i.jsx(ia,{action:r,onNext:null,onSelect:h})}):i.jsx(Ii,{...t,mode:r})});Pi.propTypes={mode:L.oneOf(["both","verify","purchase"]).isRequired,ref:L.any};Pi.defaultProps={ref:{}};const qd=Pi;function Kd({...e}){return i.jsx(ct,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Li({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:o}=mt(),c=hs();return!e||xl(e.meta)?i.jsx(Vd,{children:n}):i.jsxs(Gd,{isMobile:c,children:[i.jsx(Kd,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:o("setup.startNow")}),i.jsx(Q,{display:"flex",alignItems:"center",children:n})]})}Li.propTypes={blocklet:L.object,onStartNow:L.func,children:L.any,disabled:L.bool};Li.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Vd=Ve(Q)`
217
217
  width: 100%;
218
218
  margin-top: auto;
219
219
  padding-top: 24px;
@@ -228,7 +228,7 @@ see detail in https://www.npmjs.com/package/is-var-name
228
228
  width: 100%;
229
229
  }
230
230
  }
231
- `,Jd=Ve(Q)`
231
+ `,Gd=Ve(Q)`
232
232
  padding-top: 24px;
233
233
  margin-top: auto;
234
234
  width: 100%;
@@ -258,12 +258,12 @@ see detail in https://www.npmjs.com/package/is-var-name
258
258
  justify-content: space-between;
259
259
  gap: '32px',
260
260
  }}
261
- `;function Ni({blockletMeta:e,onEndpointUpdate:t}){var h;const n=ps(),{blocklet:r}=fr(),{updateSpaceGateway:o,loading:c,hasStorageEndpoint:d}=Bl();return N.useEffect(()=>{t==null||t()},[r]),c?i.jsx(al,{relative:"parent",children:i.jsx(ft,{})}):i.jsxs(Qd,{children:[i.jsx(Q,{width:n?"360px":"720px",children:d?i.jsx(ac,{}):i.jsx(lc,{})}),((h=e==null?void 0:e.capabilities)==null?void 0:h.didSpace)==="required"&&i.jsx(Li,{mt:8,children:i.jsx(cc,{onConnect:o})})]})}Ni.propTypes={blockletMeta:_.any.isRequired,onEndpointUpdate:Ba.func};Ni.defaultProps={onEndpointUpdate:()=>{}};const Qd=Ve(sc)`
261
+ `;function _i({blockletMeta:e,onEndpointUpdate:t}){var h;const n=hs(),{blocklet:r}=hr(),{updateSpaceGateway:o,loading:c,hasStorageEndpoint:d}=Ml();return N.useEffect(()=>{t==null||t()},[r]),c?i.jsx(ol,{relative:"parent",children:i.jsx(ft,{})}):i.jsxs(Hd,{children:[i.jsx(Q,{width:n?"360px":"720px",children:d?i.jsx(sc,{}):i.jsx(ac,{})}),((h=e==null?void 0:e.capabilities)==null?void 0:h.didSpace)==="required"&&i.jsx(Li,{mt:8,children:i.jsx(lc,{onConnect:o})})]})}_i.propTypes={blockletMeta:L.any.isRequired,onEndpointUpdate:Ma.func};_i.defaultProps={onEndpointUpdate:()=>{}};const Hd=Ve(oc)`
262
262
  height: 100%;
263
263
  overflow-y: auto;
264
264
  padding-bottom: 32px;
265
265
  overflow-x: hidden;
266
- `;function Ai({onChange:e,loading:t,children:n,extra:r,stores:o,storageKey:c}){const{t:d}=mt(),{info:h,inService:b}=Cn(),{blocklet:w}=fr(),[s,a]=N.useState(!1),O=N.useRef(null),[x,S]=N.useState(),[R,L]=ds(c||"tmp"),[A,H]=c?[R,L]:[x,S],{storeList:U,teamDid:X}=ss({fromBlocklet:b,blocklet:w,nodeInfo:h}),j=ls([...o.map(Z=>({...Z,protected:!0})),...U],"url"),W=A&&j.find(Z=>A===Z.url)||j[0];return i.jsxs(i.Fragment,{children:[i.jsxs(Zd,{children:[i.jsx(ct,{ref:O,color:"primary","data-cy":"add-component-select-store",endIcon:i.jsx(uc,{color:"primary"}),onClick:()=>{a(!0)},style:{padding:"0 2px"},children:i.jsx(me,{color:"primary",children:W.name})}),i.jsx(me,{color:"primary",children:r})]}),i.jsxs(ur,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:d("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:W,autoFocus:!0,onChange:Z=>{const F=Z.target.value;H(F.url),e(F)},SelectProps:{open:s,MenuProps:{anchorEl:O.current},renderValue:Z=>Z==null?void 0:Z.name,onClose:()=>{a(!1)}},style:{display:"none"},margin:"normal",children:[j==null?void 0:j.map(Z=>i.jsx(Qr,{sx:{width:"400px",maxWidth:"90vw"},value:Z,"data-cy":Z.url,children:i.jsx(tl,{teamDid:X,store:Z,onDelete:()=>{var F;A===Z.url&&H((F=j[0])==null?void 0:F.url)}})},Z.url)),!Zo.isInServerlessMode(h)&&i.jsx(nl,{disabled:t,storeList:j,teamDid:X,onAdd:Z=>{H(Z)}})]}),n({currentRegistry:W})]})}Ai.propTypes={onChange:_.func,loading:_.bool,children:_.any.isRequired,extra:_.node,storageKey:_.string,stores:_.arrayOf(_.shape({name:_.string.isRequired,url:_.string.isRequired}))};Ai.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Zd=Ve.div`
266
+ `;function Ni({onChange:e,loading:t,children:n,extra:r,stores:o,storageKey:c}){const{t:d}=mt(),{info:h,inService:b}=Cn(),{blocklet:w}=hr(),[s,a]=N.useState(!1),O=N.useRef(null),[x,S]=N.useState(),[R,_]=us(c||"tmp"),[A,H]=c?[R,_]:[x,S],{storeList:U,teamDid:X}=os({fromBlocklet:b,blocklet:w,nodeInfo:h}),j=as([...o.map(Z=>({...Z,protected:!0})),...U],"url"),W=A&&j.find(Z=>A===Z.url)||j[0];return i.jsxs(i.Fragment,{children:[i.jsxs(Xd,{children:[i.jsx(ct,{ref:O,color:"primary","data-cy":"add-component-select-store",endIcon:i.jsx(cc,{color:"primary"}),onClick:()=>{a(!0)},style:{padding:"0 2px"},children:i.jsx(me,{color:"primary",children:W.name})}),i.jsx(me,{color:"primary",children:r})]}),i.jsxs(cr,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:d("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:W,autoFocus:!0,onChange:Z=>{const F=Z.target.value;H(F.url),e(F)},SelectProps:{open:s,MenuProps:{anchorEl:O.current},renderValue:Z=>Z==null?void 0:Z.name,onClose:()=>{a(!1)}},style:{display:"none"},margin:"normal",children:[j==null?void 0:j.map(Z=>i.jsx(Jr,{sx:{width:"400px",maxWidth:"90vw"},value:Z,"data-cy":Z.url,children:i.jsx(Za,{teamDid:X,store:Z,onDelete:()=>{var F;A===Z.url&&H((F=j[0])==null?void 0:F.url)}})},Z.url)),!Qo.isInServerlessMode(h)&&i.jsx(el,{disabled:t,storeList:j,teamDid:X,onAdd:Z=>{H(Z)}})]}),n({currentRegistry:W})]})}Ni.propTypes={onChange:L.func,loading:L.bool,children:L.any.isRequired,extra:L.node,storageKey:L.string,stores:L.arrayOf(L.shape({name:L.string.isRequired,url:L.string.isRequired}))};Ni.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Xd=Ve.div`
267
267
  display: flex;
268
268
  justify-content: space-between;
269
269
  align-items: center;
@@ -274,7 +274,7 @@ see detail in https://www.npmjs.com/package/is-var-name
274
274
  color: ${e=>e.theme.palette.common.black};
275
275
  // font-weight: bold;
276
276
  }
277
- `,eh=Kt("div")`
277
+ `,Yd=Kt("div")`
278
278
  background-color: transparent !important;
279
279
  & > :not(.Mui-disabled) {
280
280
  position: relative;
@@ -433,7 +433,7 @@ see detail in https://www.npmjs.com/package/is-var-name
433
433
  color: ${e=>e.theme.palette.grey[600]};
434
434
  font-size: 12px;
435
435
  }
436
- `;_.string||_.node,_.string,_.string||_.node,_.string,_.string,_.bool,_.bool,_.element,_.string,_.func,_.func,_.string;Kt("div")`
436
+ `;L.string||L.node,L.string,L.string||L.node,L.string,L.string,L.bool,L.bool,L.element,L.string,L.func,L.func,L.string;Kt("div")`
437
437
  background-color: transparent !important;
438
438
  & > :not(.Mui-disabled) {
439
439
  position: relative;
@@ -482,7 +482,7 @@ see detail in https://www.npmjs.com/package/is-var-name
482
482
  color: ${e=>e.theme.palette.common.white}!important;
483
483
  }
484
484
  }
485
- `;const Co=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),th=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},aa={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function Vr({title:e,sx:t,children:n,slotProps:r,fontSize:o=12,fontWeight:c=500,color:d="text.secondary",...h}){var b,w;return e?i.jsx(Go,{title:e,placement:"top",...h,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${$a.tooltip}`]:{backgroundColor:"common.white",fontSize:o,fontWeight:c,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:d,display:"flex",alignItems:"center"}},...Array.isArray((b=r==null?void 0:r.popper)==null?void 0:b.sx)?r.popper.sx:[(w=r==null?void 0:r.popper)==null?void 0:w.sx]]}},children:n}):n}function Zn({icon:e,children:t,maxWidth:n=100,title:r,sx:o}){return(t===0||t)&&i.jsxs(et,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(o)?o:[o]],children:[e,i.jsx(Vr,{title:r||(typeof t=="string"?t:""),children:i.jsx(me,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function nh(e){const{title:t,description:n="",cover:r="",avatar:o,author:c,download:d,did:h,official:b,buttonText:w="Install",buttonDisabled:s,buttonLoading:a,button:O,onButtonClick:x=()=>{},onMainClick:S,className:R,ref:L,icons:A,status:H,...U}=e,X=Gn(),j=(Y,ae=()=>!1)=>(Se,...Fe)=>{const Ue=Y instanceof Function;(ae()||Ue)&&(Se.preventDefault(),Se.stopPropagation(),Ue&&Y(...Fe))},W=S&&j(S),Z=j(x,()=>!!(O||s||a)),F=N.isValidElement(t)?{children:t}:{title:Co(t),dangerouslySetInnerHTML:{__html:t}},ce=N.isValidElement(n)?{children:n}:{title:Co(n),dangerouslySetInnerHTML:{__html:n}};return i.jsxs(Ua,{variant:"outlined",onClick:W,...U,sx:{p:{xs:2,md:3},borderRadius:2,...U.sx},children:[i.jsxs(et,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[i.jsx(sr,{src:r,did:h,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),i.jsx(me,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...F}),i.jsxs(Q,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[b&&i.jsx(Vr,{title:b.tooltip,children:i.jsx(ll,{sx:{color:b.color||"#D97706",fontSize:b.size||18}})}),A==null?void 0:A.map(Y=>i.jsx(Vr,{title:Y.title,children:typeof Y.icon=="string"?i.jsx(st,{icon:Y.icon,style:{color:Y.color}}):Y.icon},Y.key))]}),x&&i.jsxs(ct,{color:"reverse",variant:"outlined",size:"small",disabled:s||a,style:{borderColor:X.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:X.typography.fontWeightMedium},onClick:Z,children:[a&&i.jsx(ft,{size:15,style:{marginRight:3,color:"inherit"}}),w]}),O]}),i.jsx(et,{py:2,children:i.jsx(me,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...ce})}),i.jsxs(et,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(Zn,{icon:i.jsx(sr,{src:o,did:h,size:20,variant:"circle"}),maxWidth:200,children:c}),i.jsx(Zn,{icon:i.jsx(st,{icon:aa}),title:d,children:th(d)}),H==null?void 0:H.filter(Y=>Y.align!=="right").map(Y=>i.jsx(Zn,{icon:typeof Y.icon=="string"?i.jsx(st,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,children:Y.text},Y.key)),i.jsx(Q,{sx:{flex:1}}),H==null?void 0:H.filter(Y=>Y.align==="right").map(Y=>i.jsx(Zn,{icon:typeof Y.icon=="string"?i.jsx(st,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,sx:{color:Y.color},children:Y.text},Y.key))]})]})}const rh={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'};var Di={},ih=cr;Object.defineProperty(Di,"__esModule",{value:!0});var la=Di.default=void 0,oh=ih(dr()),sh=i;la=Di.default=(0,oh.default)((0,sh.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var ca={exports:{}};(function(e,t){(function(n,r){e.exports=r(N)})(Ee,n=>(()=>{var r={703:(h,b,w)=>{var s=w(414);function a(){}function O(){}O.resetWarningCache=a,h.exports=function(){function x(L,A,H,U,X,j){if(j!==s){var W=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw W.name="Invariant Violation",W}}function S(){return x}x.isRequired=x;var R={array:x,bool:x,func:x,number:x,object:x,string:x,symbol:x,any:x,arrayOf:S,element:x,elementType:x,instanceOf:S,node:x,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:O,resetWarningCache:a};return R.PropTypes=R,R}},697:(h,b,w)=>{h.exports=w(703)()},414:h=>{h.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:h=>{var b=typeof Element<"u",w=typeof Map=="function",s=typeof Set=="function",a=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function O(x,S){if(x===S)return!0;if(x&&S&&typeof x=="object"&&typeof S=="object"){if(x.constructor!==S.constructor)return!1;var R,L,A,H;if(Array.isArray(x)){if((R=x.length)!=S.length)return!1;for(L=R;L--!=0;)if(!O(x[L],S[L]))return!1;return!0}if(w&&x instanceof Map&&S instanceof Map){if(x.size!==S.size)return!1;for(H=x.entries();!(L=H.next()).done;)if(!S.has(L.value[0]))return!1;for(H=x.entries();!(L=H.next()).done;)if(!O(L.value[1],S.get(L.value[0])))return!1;return!0}if(s&&x instanceof Set&&S instanceof Set){if(x.size!==S.size)return!1;for(H=x.entries();!(L=H.next()).done;)if(!S.has(L.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(x)&&ArrayBuffer.isView(S)){if((R=x.length)!=S.length)return!1;for(L=R;L--!=0;)if(x[L]!==S[L])return!1;return!0}if(x.constructor===RegExp)return x.source===S.source&&x.flags===S.flags;if(x.valueOf!==Object.prototype.valueOf)return x.valueOf()===S.valueOf();if(x.toString!==Object.prototype.toString)return x.toString()===S.toString();if((R=(A=Object.keys(x)).length)!==Object.keys(S).length)return!1;for(L=R;L--!=0;)if(!Object.prototype.hasOwnProperty.call(S,A[L]))return!1;if(b&&x instanceof Element)return!1;for(L=R;L--!=0;)if((A[L]!=="_owner"&&A[L]!=="__v"&&A[L]!=="__o"||!x.$$typeof)&&!O(x[A[L]],S[A[L]]))return!1;return!0}return x!=x&&S!=S}h.exports=function(x,S){try{return O(x,S)}catch(R){if((R.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw R}}},359:h=>{h.exports=n}},o={};function c(h){var b=o[h];if(b!==void 0)return b.exports;var w=o[h]={exports:{}};return r[h](w,w.exports,c),w.exports}c.n=h=>{var b=h&&h.__esModule?()=>h.default:()=>h;return c.d(b,{a:b}),b},c.d=(h,b)=>{for(var w in b)c.o(b,w)&&!c.o(h,w)&&Object.defineProperty(h,w,{enumerable:!0,get:b[w]})},c.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),c.o=(h,b)=>Object.prototype.hasOwnProperty.call(h,b),c.r=h=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})};var d={};return(()=>{function h(v){var f,E,T="";if(typeof v=="string"||typeof v=="number")T+=v;else if(typeof v=="object")if(Array.isArray(v))for(f=0;f<v.length;f++)v[f]&&(E=h(v[f]))&&(T&&(T+=" "),T+=E);else for(f in v)v[f]&&(T&&(T+=" "),T+=f);return T}function b(){for(var v,f,E=0,T="";E<arguments.length;)(v=arguments[E++])&&(f=h(v))&&(T&&(T+=" "),T+=f);return T}c.r(d),c.d(d,{default:()=>Ca});var w=c(359),s=c.n(w);const a=function(v){var f=typeof v;return v!=null&&(f=="object"||f=="function")},O=typeof Ee=="object"&&Ee&&Ee.Object===Object&&Ee;var x=typeof self=="object"&&self&&self.Object===Object&&self;const S=O||x||Function("return this")(),R=function(){return S.Date.now()};var L=/\s/,A=/^\s+/;const H=function(v){return v&&v.slice(0,function(f){for(var E=f.length;E--&&L.test(f.charAt(E)););return E}(v)+1).replace(A,"")},U=S.Symbol;var X=Object.prototype,j=X.hasOwnProperty,W=X.toString,Z=U?U.toStringTag:void 0,F=Object.prototype.toString,ce=U?U.toStringTag:void 0;const Y=function(v){return v==null?v===void 0?"[object Undefined]":"[object Null]":ce&&ce in Object(v)?function(f){var E=j.call(f,Z),T=f[Z];try{f[Z]=void 0;var B=!0}catch{}var ne=W.call(f);return B&&(E?f[Z]=T:delete f[Z]),ne}(v):function(f){return F.call(f)}(v)};var ae=/^[-+]0x[0-9a-f]+$/i,Se=/^0b[01]+$/i,Fe=/^0o[0-7]+$/i,Ue=parseInt;const nt=function(v){if(typeof v=="number")return v;if(function(T){return typeof T=="symbol"||function(B){return B!=null&&typeof B=="object"}(T)&&Y(T)=="[object Symbol]"}(v))return NaN;if(a(v)){var f=typeof v.valueOf=="function"?v.valueOf():v;v=a(f)?f+"":f}if(typeof v!="string")return v===0?v:+v;v=H(v);var E=Se.test(v);return E||Fe.test(v)?Ue(v.slice(2),E?2:8):ae.test(v)?NaN:+v};var ee=Math.max,pe=Math.min;const q=function(v,f,E){var T,B,ne,fe,g,m,C=0,D=!1,$=!1,M=!0;if(typeof v!="function")throw new TypeError("Expected a function");function le(re){var he=T,be=B;return T=B=void 0,C=re,fe=v.apply(be,he)}function se(re){return C=re,g=setTimeout(K,f),D?le(re):fe}function de(re){var he=re-m;return m===void 0||he>=f||he<0||$&&re-C>=ne}function K(){var re=R();if(de(re))return G(re);g=setTimeout(K,function(he){var be=f-(he-m);return $?pe(be,ne-(he-C)):be}(re))}function G(re){return g=void 0,M&&T?le(re):(T=B=void 0,fe)}function J(){var re=R(),he=de(re);if(T=arguments,B=this,m=re,he){if(g===void 0)return se(m);if($)return clearTimeout(g),g=setTimeout(K,f),le(m)}return g===void 0&&(g=setTimeout(K,f)),fe}return f=nt(f)||0,a(E)&&(D=!!E.leading,ne=($="maxWait"in E)?ee(nt(E.maxWait)||0,f):ne,M="trailing"in E?!!E.trailing:M),J.cancel=function(){g!==void 0&&clearTimeout(g),C=0,T=m=B=g=void 0},J.flush=function(){return g===void 0?fe:G(R())},J},Te=function(v,f,E){var T=!0,B=!0;if(typeof v!="function")throw new TypeError("Expected a function");return a(E)&&(T="leading"in E?!!E.leading:T,B="trailing"in E?!!E.trailing:B),q(v,f,{leading:T,maxWait:f,trailing:B})};var ie=c(590),dt=c.n(ie),we=function(){if(typeof Map<"u")return Map;function v(f,E){var T=-1;return f.some(function(B,ne){return B[0]===E&&(T=ne,!0)}),T}return function(){function f(){this.__entries__=[]}return Object.defineProperty(f.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),f.prototype.get=function(E){var T=v(this.__entries__,E),B=this.__entries__[T];return B&&B[1]},f.prototype.set=function(E,T){var B=v(this.__entries__,E);~B?this.__entries__[B][1]=T:this.__entries__.push([E,T])},f.prototype.delete=function(E){var T=this.__entries__,B=v(T,E);~B&&T.splice(B,1)},f.prototype.has=function(E){return!!~v(this.__entries__,E)},f.prototype.clear=function(){this.__entries__.splice(0)},f.prototype.forEach=function(E,T){T===void 0&&(T=null);for(var B=0,ne=this.__entries__;B<ne.length;B++){var fe=ne[B];E.call(T,fe[1],fe[0])}},f}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,ze=c.g!==void 0&&c.g.Math===Math?c.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Ct=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ze):function(v){return setTimeout(function(){return v(Date.now())},1e3/60)},Vt=["top","right","bottom","left","width","height","size","weight"],Dt=typeof MutationObserver<"u",Gt=function(){function v(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(f,E){var T=!1,B=!1,ne=0;function fe(){T&&(T=!1,f()),B&&m()}function g(){Ct(fe)}function m(){var C=Date.now();if(T){if(C-ne<2)return;B=!0}else T=!0,B=!1,setTimeout(g,20);ne=C}return m}(this.refresh.bind(this))}return v.prototype.addObserver=function(f){~this.observers_.indexOf(f)||this.observers_.push(f),this.connected_||this.connect_()},v.prototype.removeObserver=function(f){var E=this.observers_,T=E.indexOf(f);~T&&E.splice(T,1),!E.length&&this.connected_&&this.disconnect_()},v.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},v.prototype.updateObservers_=function(){var f=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return f.forEach(function(E){return E.broadcastActive()}),f.length>0},v.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Dt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},v.prototype.disconnect_=function(){Je&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},v.prototype.onTransitionEnd_=function(f){var E=f.propertyName,T=E===void 0?"":E;Vt.some(function(B){return!!~T.indexOf(B)})&&this.refresh()},v.getInstance=function(){return this.instance_||(this.instance_=new v),this.instance_},v.instance_=null,v}(),Ie=function(v,f){for(var E=0,T=Object.keys(f);E<T.length;E++){var B=T[E];Object.defineProperty(v,B,{value:f[B],enumerable:!1,writable:!1,configurable:!0})}return v},Pe=function(v){return v&&v.ownerDocument&&v.ownerDocument.defaultView||ze},Oe=ge(0,0,0,0);function ye(v){return parseFloat(v)||0}function It(v){for(var f=[],E=1;E<arguments.length;E++)f[E-1]=arguments[E];return f.reduce(function(T,B){return T+ye(v["border-"+B+"-width"])},0)}var Ht=typeof SVGGraphicsElement<"u"?function(v){return v instanceof Pe(v).SVGGraphicsElement}:function(v){return v instanceof Pe(v).SVGElement&&typeof v.getBBox=="function"};function Xt(v){return Je?Ht(v)?function(f){var E=f.getBBox();return ge(0,0,E.width,E.height)}(v):function(f){var E=f.clientWidth,T=f.clientHeight;if(!E&&!T)return Oe;var B=Pe(f).getComputedStyle(f),ne=function(M){for(var le={},se=0,de=["top","right","bottom","left"];se<de.length;se++){var K=de[se],G=M["padding-"+K];le[K]=ye(G)}return le}(B),fe=ne.left+ne.right,g=ne.top+ne.bottom,m=ye(B.width),C=ye(B.height);if(B.boxSizing==="border-box"&&(Math.round(m+fe)!==E&&(m-=It(B,"left","right")+fe),Math.round(C+g)!==T&&(C-=It(B,"top","bottom")+g)),!function(M){return M===Pe(M).document.documentElement}(f)){var D=Math.round(m+fe)-E,$=Math.round(C+g)-T;Math.abs(D)!==1&&(m-=D),Math.abs($)!==1&&(C-=$)}return ge(ne.left,ne.top,m,C)}(v):Oe}function ge(v,f,E,T){return{x:v,y:f,width:E,height:T}}var Yt=function(){function v(f){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ge(0,0,0,0),this.target=f}return v.prototype.isActive=function(){var f=Xt(this.target);return this.contentRect_=f,f.width!==this.broadcastWidth||f.height!==this.broadcastHeight},v.prototype.broadcastRect=function(){var f=this.contentRect_;return this.broadcastWidth=f.width,this.broadcastHeight=f.height,f},v}(),mn=function(v,f){var E,T,B,ne,fe,g,m,C=(T=(E=f).x,B=E.y,ne=E.width,fe=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Ie(m,{x:T,y:B,width:ne,height:fe,top:B,right:T+ne,bottom:fe+B,left:T}),m);Ie(this,{target:v,contentRect:C})},gn=function(){function v(f,E,T){if(this.activeObservations_=[],this.observations_=new we,typeof f!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=f,this.controller_=E,this.callbackCtx_=T}return v.prototype.observe=function(f){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(f instanceof Pe(f).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(f)||(E.set(f,new Yt(f)),this.controller_.addObserver(this),this.controller_.refresh())}},v.prototype.unobserve=function(f){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(f instanceof Pe(f).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(f)&&(E.delete(f),E.size||this.controller_.removeObserver(this))}},v.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},v.prototype.gatherActive=function(){var f=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&f.activeObservations_.push(E)})},v.prototype.broadcastActive=function(){if(this.hasActive()){var f=this.callbackCtx_,E=this.activeObservations_.map(function(T){return new mn(T.target,T.broadcastRect())});this.callback_.call(f,E,f),this.clearActive()}},v.prototype.clearActive=function(){this.activeObservations_.splice(0)},v.prototype.hasActive=function(){return this.activeObservations_.length>0},v}(),Jt=typeof WeakMap<"u"?new WeakMap:new we,Qe=function v(f){if(!(this instanceof v))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var E=Gt.getInstance(),T=new gn(f,E,this);Jt.set(this,T)};["observe","unobserve","disconnect"].forEach(function(v){Qe.prototype[v]=function(){var f;return(f=Jt.get(this))[v].apply(f,arguments)}});const xt=ze.ResizeObserver!==void 0?ze.ResizeObserver:Qe,wt="Left",gt="Right",Et="Up",Ge="Down",Ne={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Qt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Zt="mousemove",en="mouseup";function tn(v,f){if(f===0)return v;const E=Math.PI/180*f;return[v[0]*Math.cos(E)+v[1]*Math.sin(E),v[1]*Math.cos(E)-v[0]*Math.sin(E)]}function Mt(v){const{trackMouse:f}=v,E=w.useRef(Object.assign({},Qt)),T=w.useRef(Object.assign({},Ne)),B=w.useRef(Object.assign({},T.current));let ne;for(ne in B.current=Object.assign({},T.current),T.current=Object.assign(Object.assign({},Ne),v),Ne)T.current[ne]===void 0&&(T.current[ne]=Ne[ne]);const[fe,g]=w.useMemo(()=>function(m,C){const D=K=>{const G="touches"in K;G&&K.touches.length>1||m((J,re)=>{re.trackMouse&&!G&&(document.addEventListener(Zt,$),document.addEventListener(en,le));const{clientX:he,clientY:be}=G?K.touches[0]:K,_e=tn([he,be],re.rotationAngle);return re.onTouchStartOrOnMouseDown&&re.onTouchStartOrOnMouseDown({event:K}),Object.assign(Object.assign(Object.assign({},J),Qt),{initial:_e.slice(),xy:_e,start:K.timeStamp||0})})},$=K=>{m((G,J)=>{const re="touches"in K;if(re&&K.touches.length>1)return G;if(K.timeStamp-G.start>J.swipeDuration)return G.swiping?Object.assign(Object.assign({},G),{swiping:!1}):G;const{clientX:he,clientY:be}=re?K.touches[0]:K,[_e,ot]=tn([he,be],J.rotationAngle),Ze=_e-G.xy[0],qe=ot-G.xy[1],Ce=Math.abs(Ze),xe=Math.abs(qe),Ut=(K.timeStamp||0)-G.start,Ln=Math.sqrt(Ce*Ce+xe*xe)/(Ut||1),Nn=[Ze/(Ut||1),qe/(Ut||1)],_t=function(An,Tn,Dn,at){return An>Tn?Dn>0?gt:wt:at>0?Ge:Et}(Ce,xe,Ze,qe),sn=typeof J.delta=="number"?J.delta:J.delta[_t.toLowerCase()]||Ne.delta;if(Ce<sn&&xe<sn&&!G.swiping)return G;const jt={absX:Ce,absY:xe,deltaX:Ze,deltaY:qe,dir:_t,event:K,first:G.first,initial:G.initial,velocity:Ln,vxvy:Nn};jt.first&&J.onSwipeStart&&J.onSwipeStart(jt),J.onSwiping&&J.onSwiping(jt);let Sn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${_t}`])&&(Sn=!0),Sn&&J.preventScrollOnSwipe&&J.trackTouch&&K.cancelable&&K.preventDefault(),Object.assign(Object.assign({},G),{first:!1,eventData:jt,swiping:!0})})},M=K=>{m((G,J)=>{let re;if(G.swiping&&G.eventData){if(K.timeStamp-G.start<J.swipeDuration){re=Object.assign(Object.assign({},G.eventData),{event:K}),J.onSwiped&&J.onSwiped(re);const he=J[`onSwiped${re.dir}`];he&&he(re)}}else J.onTap&&J.onTap({event:K});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:K}),Object.assign(Object.assign(Object.assign({},G),Qt),{eventData:re})})},le=K=>{document.removeEventListener(Zt,$),document.removeEventListener(en,le),M(K)},se=(K,G)=>{let J=()=>{};if(K&&K.addEventListener){const re=Object.assign(Object.assign({},Ne.touchEventOptions),G.touchEventOptions),he=[["touchstart",D,re],["touchmove",$,Object.assign(Object.assign({},re),G.preventScrollOnSwipe?{passive:!1}:{})],["touchend",M,re]];he.forEach(([be,_e,ot])=>K.addEventListener(be,_e,ot)),J=()=>he.forEach(([be,_e])=>K.removeEventListener(be,_e))}return J},de={ref:K=>{K!==null&&m((G,J)=>{if(G.el===K)return G;const re={};return G.el&&G.el!==K&&G.cleanUpTouch&&(G.cleanUpTouch(),re.cleanUpTouch=void 0),J.trackTouch&&K&&(re.cleanUpTouch=se(K,J)),Object.assign(Object.assign(Object.assign({},G),{el:K}),re)})}};return C.trackMouse&&(de.onMouseDown=D),[de,se]}(m=>E.current=m(E.current,T.current),{trackMouse:f}),[f]);return E.current=function(m,C,D,$){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==D.preventScrollOnSwipe||C.touchEventOptions.passive!==D.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:$(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:$(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,T.current,B.current,g),fe}var I=c(697);function ht(v){return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},ht(v)}function nn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function rn(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?nn(Object(E),!0).forEach(function(T){l(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):nn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function l(v,f,E){return(f=function(T){var B=function(ne,fe){if(ht(ne)!=="object"||ne===null)return ne;var g=ne[Symbol.toPrimitive];if(g!==void 0){var m=g.call(ne,fe);if(ht(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return ht(B)==="symbol"?B:String(B)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var p={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},y=s().memo(function(v){var f=rn(rn({},p),v),E=f.description,T=f.fullscreen,B=f.handleImageLoaded,ne=f.isFullscreen,fe=f.onImageError,g=f.original,m=f.originalAlt,C=f.originalHeight,D=f.originalWidth,$=f.originalTitle,M=f.sizes,le=f.srcSet,se=f.loading,de=ne&&T||g;return s().createElement(s().Fragment,null,s().createElement("img",{className:"image-gallery-image",src:de,alt:m,srcSet:le,height:C,width:D,sizes:M,title:$,onLoad:function(K){return B(K,g)},onError:fe,loading:se}),E&&s().createElement("span",{className:"image-gallery-description"},E))});y.displayName="Item",y.propTypes={description:I.string,fullscreen:I.string,handleImageLoaded:I.func.isRequired,isFullscreen:I.bool,onImageError:I.func.isRequired,original:I.string.isRequired,originalAlt:I.string,originalHeight:I.string,originalWidth:I.string,originalTitle:I.string,sizes:I.string,srcSet:I.string,loading:I.string};const k=y;function P(v){return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},P(v)}function z(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function V(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?z(Object(E),!0).forEach(function(T){ue(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):z(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function ue(v,f,E){return(f=function(T){var B=function(ne,fe){if(P(ne)!=="object"||ne===null)return ne;var g=ne[Symbol.toPrimitive];if(g!==void 0){var m=g.call(ne,fe);if(P(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return P(B)==="symbol"?B:String(B)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var oe={left:s().createElement("polyline",{points:"15 18 9 12 15 6"}),right:s().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:s().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:s().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:s().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:s().createElement(s().Fragment,null,s().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),s().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Ae={strokeWidth:1,viewBox:"0 0 24 24"},Be=function(v){var f=V(V({},Ae),v),E=f.strokeWidth,T=f.viewBox,B=f.icon;return s().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:T,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},oe[B])};Be.propTypes={strokeWidth:I.number,viewBox:I.string,icon:(0,I.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Re=Be;var De=s().memo(function(v){var f=v.isFullscreen,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},s().createElement(Re,{strokeWidth:2,icon:f?"minimize":"maximize"}))});De.displayName="Fullscreen",De.propTypes={isFullscreen:I.bool.isRequired,onClick:I.func.isRequired};const He=De;var Xe=s().memo(function(v){var f=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:f,onClick:E,"aria-label":"Previous Slide"},s().createElement(Re,{icon:"left",viewBox:"6 0 12 24"}))});Xe.displayName="LeftNav",Xe.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const vn=Xe;var St=s().memo(function(v){var f=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:f,onClick:E,"aria-label":"Next Slide"},s().createElement(Re,{icon:"right",viewBox:"6 0 12 24"}))});St.displayName="RightNav",St.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const Ft=St;var rt=s().memo(function(v){var f=v.isPlaying,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},s().createElement(Re,{strokeWidth:2,icon:f?"pause":"play"}))});rt.displayName="PlayPause",rt.propTypes={isPlaying:I.bool.isRequired,onClick:I.func.isRequired};const Bt=rt;function Pt(v){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},Pt(v)}function $t(){return $t=Object.assign?Object.assign.bind():function(v){for(var f=1;f<arguments.length;f++){var E=arguments[f];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(v[T]=E[T])}return v},$t.apply(this,arguments)}function Pn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function _n(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?Pn(Object(E),!0).forEach(function(T){Yn(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):Pn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function Yn(v,f,E){return(f=function(T){var B=function(ne,fe){if(Pt(ne)!=="object"||ne===null)return ne;var g=ne[Symbol.toPrimitive];if(g!==void 0){var m=g.call(ne,fe);if(Pt(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return Pt(B)==="symbol"?B:String(B)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var it={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},yn=function(v){var f=_n(_n({},it),v),E=f.children,T=f.className,B=Mt({delta:f.delta,onSwiping:f.onSwiping,onSwiped:f.onSwiped});return s().createElement("div",$t({},B,{className:T}),E)};yn.propTypes={children:I.node.isRequired,className:I.string,delta:I.number,onSwiped:I.func,onSwiping:I.func};const on=yn;function vt(v){return vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},vt(v)}function bn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function xn(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?bn(Object(E),!0).forEach(function(T){Vi(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):bn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function Jn(v,f){for(var E=0;E<f.length;E++){var T=f[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,Gi(T.key),T)}}function Tt(v,f){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E},Tt(v,f)}function wn(v,f){if(f&&(vt(f)==="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return je(v)}function je(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function En(v){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},En(v)}function Vi(v,f,E){return(f=Gi(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}function Gi(v){var f=function(E,T){if(vt(E)!=="object"||E===null)return E;var B=E[Symbol.toPrimitive];if(B!==void 0){var ne=B.call(E,T);if(vt(ne)!=="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(v,"string");return vt(f)==="symbol"?f:String(f)}var Hi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Ra=(0,I.arrayOf)((0,I.shape)({srcSet:I.string,media:I.string}));function Xi(v){var f=parseInt(v.keyCode||v.which||0,10);return f===66||f===62}var wr=function(v){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&Tt(g,m)})(fe,v);var f,E,T,B,ne=(T=fe,B=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=En(T);if(B){var C=En(this).constructor;g=Reflect.construct(m,arguments,C)}else g=m.apply(this,arguments);return wn(this,g)});function fe(g){var m;return function(C,D){if(!(C instanceof D))throw new TypeError("Cannot call a class as a function")}(this,fe),Vi(je(m=ne.call(this,g)),"onBulletClick",function(C,D){var $=m.props,M=$.onBulletClick,le=$.items,se=m.state.currentIndex;C.target.blur(),se!==D&&(le.length===2?m.slideToIndexWithStyleReset(D,C):m.slideToIndex(D,C)),M&&M(C,D)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=s().createRef(),m.thumbnailsWrapper=s().createRef(),m.thumbnails=s().createRef(),m.imageGallerySlideWrapper=s().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(je(m)),m.handleKeyDown=m.handleKeyDown.bind(je(m)),m.handleMouseDown=m.handleMouseDown.bind(je(m)),m.handleResize=m.handleResize.bind(je(m)),m.handleTouchMove=m.handleTouchMove.bind(je(m)),m.handleOnSwiped=m.handleOnSwiped.bind(je(m)),m.handleScreenChange=m.handleScreenChange.bind(je(m)),m.handleSwiping=m.handleSwiping.bind(je(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(je(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(je(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(je(m)),m.handleImageError=m.handleImageError.bind(je(m)),m.pauseOrPlay=m.pauseOrPlay.bind(je(m)),m.renderThumbInner=m.renderThumbInner.bind(je(m)),m.renderItem=m.renderItem.bind(je(m)),m.slideLeft=m.slideLeft.bind(je(m)),m.slideRight=m.slideRight.bind(je(m)),m.toggleFullScreen=m.toggleFullScreen.bind(je(m)),m.togglePlay=m.togglePlay.bind(je(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=Te(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return f=fe,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,C=g.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var C=this.props,D=C.items,$=C.lazyLoad,M=C.slideDuration,le=C.slideInterval,se=C.startIndex,de=C.thumbnailPosition,K=C.showThumbnails,G=C.useWindowKeyDown,J=this.state,re=J.currentIndex,he=J.isPlaying,be=g.items.length!==D.length,_e=!dt()(g.items,D),ot=g.startIndex!==se,Ze=g.thumbnailPosition!==de,qe=g.showThumbnails!==K;le===g.slideInterval&&M===g.slideDuration||he&&(this.pause(),this.play()),Ze&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),qe&&K&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),qe&&!K&&this.removeThumbnailsResizeObserver(),(be||qe)&&this.handleResize(),m.currentIndex!==re&&this.slideThumbnailBar(),g.slideDuration!==M&&(this.slideToIndex=Te(this.unthrottledSlideToIndex,M,{trailing:!1})),!$||g.lazyLoad&&!_e||(this.lazyLoaded=[]),G!==g.useWindowKeyDown&&(G?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ot||_e)&&this.setState({currentIndex:se,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,C=m.currentIndex,D=m.isTransitioning,$=this.props,M=$.onSlide,le=$.slideDuration;this.transitionTimer=window.setTimeout(function(){D&&(g.setState({isTransitioning:!D,isSwipingThumbnail:!1}),M&&M(C))},le+50)}},{key:"onThumbnailClick",value:function(g,m){var C=this.props,D=C.onThumbnailClick,$=C.items,M=this.state.currentIndex;g.target.parentNode.parentNode.blur(),M!==m&&($.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),D&&D(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,C=this.props,D=C.disableThumbnailScroll,$=C.items,M=this.state,le=M.thumbnailsWrapperWidth,se=M.thumbnailsWrapperHeight,de=this.thumbnails&&this.thumbnails.current;if(D)return 0;if(de){if(this.isThumbnailVertical()){if(de.scrollHeight<=se)return 0;m=de.scrollHeight-se}else{if(de.scrollWidth<=le||le<=0)return 0;m=de.scrollWidth-le}return g*(m/($.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,C=this.props,D=C.infinite,$=C.items,M="",le="image-gallery-left",se="image-gallery-right";switch(g){case m-1:M=" ".concat(le);break;case m:M=" ".concat("image-gallery-center");break;case m+1:M=" ".concat(se)}return $.length>=3&&D&&(g===0&&m===$.length-1?M=" ".concat(se):g===$.length-1&&m===0&&(M=" ".concat(le))),M}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,C=m.currentIndex,D=m.currentSlideOffset,$=m.previousIndex,M=C!==$,le=g===0&&$===0,se=g===1&&$===1,de=g===0&&C===1,K=g===1&&C===0,G=D===0,J=-100*C+100*g+D;return D>0?this.direction="left":D<0&&(this.direction="right"),K&&D>0&&(J=-100+D),de&&D<0&&(J=100+D),M?le&&G&&this.direction==="left"?J=100:se&&G&&this.direction==="right"&&(J=-100):(K&&G&&this.direction==="left"&&(J=-100),de&&G&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,C=m.currentIndex,D=m.currentSlideOffset,$=m.slideStyle,M=this.props,le=M.infinite,se=M.items,de=M.useTranslate3D,K=M.isRTL,G=-100*C,J=se.length-1,re=(G+100*g)*(K?-1:1)+D;le&&se.length>2&&(C===0&&g===J?re=-100*(K?-1:1)+D:C===J&&g===0&&(re=100*(K?-1:1)+D)),le&&se.length===2&&(re=this.getTranslateXForTwoSlide(g));var he="translate(".concat(re,"%, 0)");return de&&(he="translate3d(".concat(re,"%, 0, 0)")),xn({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:he,MozTransform:he,msTransform:he,OTransform:he,transform:he},$)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,C=m.useTranslate3D,D=m.isRTL,$=this.state,M=$.thumbsTranslate,le=$.thumbsStyle,se=D?-1*M:M;return this.isThumbnailVertical()?(g="translate(0, ".concat(M,"px)"),C&&(g="translate3d(0, ".concat(M,"px, 0)"))):(g="translate(".concat(se,"px, 0)"),C&&(g="translate3d(".concat(se,"px, 0, 0)"))),xn({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},le)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,C=this.props,D=C.items,$=C.slideOnThumbnailOver,M=C.onClick,le=C.lazyLoad,se=C.onTouchMove,de=C.onTouchEnd,K=C.onTouchStart,G=C.onMouseOver,J=C.onMouseLeave,re=C.renderItem,he=C.renderThumbInner,be=C.showThumbnails,_e=C.showBullets,ot=[],Ze=[],qe=[];return D.forEach(function(Ce,xe){var Ut=g.getAlignmentClassName(xe),Ln=Ce.originalClass?" ".concat(Ce.originalClass):"",Nn=Ce.thumbnailClass?" ".concat(Ce.thumbnailClass):"",_t=Ce.renderItem||re||g.renderItem,sn=Ce.renderThumbInner||he||g.renderThumbInner,jt=!le||Ut||g.lazyLoaded[xe];jt&&le&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var Sn=g.getSlideStyle(xe),An=s().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Ut," ").concat(Ln),style:Sn,onClick:M,onKeyUp:g.handleSlideKeyUp,onTouchMove:se,onTouchEnd:de,onTouchStart:K,onMouseOver:G,onFocus:G,onMouseLeave:J,role:"button"},jt?_t(Ce):s().createElement("div",{style:{height:"100%"}}));if(ot.push(An),be&&Ce.thumbnail){var Tn=b("image-gallery-thumbnail",Nn,{active:m===xe});Ze.push(s().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:Tn,onMouseLeave:$?g.onThumbnailMouseLeave:null,onMouseOver:function(at){return g.handleThumbnailMouseOver(at,xe)},onFocus:function(at){return g.handleThumbnailMouseOver(at,xe)},onKeyUp:function(at){return g.handleThumbnailKeyUp(at,xe)},onClick:function(at){return g.onThumbnailClick(at,xe)}},sn(Ce)))}if(_e){var Dn=b("image-gallery-bullet",Ce.bulletClass,{active:m===xe});qe.push(s().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Dn,onClick:function(at){return g.onBulletClick(at,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:ot,thumbnails:Ze,bullets:qe}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,C=m.previousIndex,D=m.currentIndex,$=g.length-1;return Math.abs(C-D)>1&&!(C===0&&D===$)&&!(C===$&&D===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,C=m.isTransitioning,D=m.previousIndex,$=m.currentIndex;return C&&!(g===D||g===$)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,C=g.isSwipingThumbnail,D=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:D,thumbsSwipedTranslate:D}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,C=g.absX,D=g.dir,$=this.props,M=$.disableSwipe,le=$.stopPropagation,se=this.state,de=se.galleryWidth,K=se.isTransitioning,G=se.swipingUpDown,J=se.swipingLeftRight;if(D!==Et&&D!==Ge&&!G||J){if(D!==wt&&D!==gt||J||this.setState({swipingLeftRight:!0}),!M){var re=this.props.swipingTransitionDuration;if(le&&m.preventDefault(),K)this.setState({currentSlideOffset:0});else{var he=D===gt?1:-1,be=C/de*100;Math.abs(be)>=100&&(be=100);var _e={transition:"transform ".concat(re,"ms ease-out")};this.setState({currentSlideOffset:he*be,slideStyle:_e})}}}else G||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,C=g.absX,D=g.absY,$=g.dir,M=this.props,le=M.stopPropagation,se=M.swipingThumbnailTransitionDuration,de=this.state,K=de.thumbsSwipedTranslate,G=de.thumbnailsWrapperHeight,J=de.thumbnailsWrapperWidth,re=de.swipingUpDown,he=de.swipingLeftRight;if(this.isThumbnailVertical()){if(($===wt||$===gt||he)&&!re)return void(he||this.setState({swipingLeftRight:!0}));$!==Et&&$!==Ge||re||this.setState({swipingUpDown:!0})}else{if(($===Et||$===Ge||re)&&!he)return void(re||this.setState({swipingUpDown:!0}));$!==wt&&$!==gt||he||this.setState({swipingLeftRight:!0})}var be,_e,ot,Ze,qe,Ce=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=K+($===Ge?D:-D),_e=Ce.scrollHeight-G+20,ot=Math.abs(be)>_e,Ze=be>20,qe=Ce.scrollHeight<=G):(be=K+($===gt?C:-C),_e=Ce.scrollWidth-J+20,ot=Math.abs(be)>_e,Ze=be>20,qe=Ce.scrollWidth<=J),!qe&&($!==wt&&$!==Et||!ot)&&($!==gt&&$!==Ge||!Ze)){le&&m.stopPropagation();var xe={transition:"transform ".concat(se,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,C=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,C=g.dir,D=g.velocity,$=this.props,M=$.disableSwipe,le=$.stopPropagation,se=$.flickThreshold;if(!M){var de=this.props.isRTL;le&&m.stopPropagation(),this.resetSwipingDirection();var K=(C===wt?1:-1)*(de?-1:1),G=D>se&&!(C===Et||C===Ge);this.handleOnSwipedTo(K,G)}}},{key:"handleOnSwipedTo",value:function(g,m){var C=this.state,D=C.currentIndex,$=C.isTransitioning,M=D;!this.sufficientSwipe()&&!m||$||(M+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(M=D),this.unthrottledSlideToIndex(M)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,C=m.disableKeyDown,D=m.useBrowserFullscreen,$=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:$&&!D&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new xt(q(function(C){C&&C.forEach(function(D){m.setState({thumbnailsWrapperWidth:D.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new xt(q(function(C){C&&C.forEach(function(D){m.setState({thumbnailsWrapperHeight:D.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,C=g.useBrowserFullscreen,D=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,$=this.imageGallery.current===D;m&&m($),C&&this.setState({isFullscreen:$})}},{key:"slideToIndex",value:function(g,m){var C=this.state,D=C.currentIndex,$=C.isTransitioning,M=this.props,le=M.items,se=M.slideDuration,de=M.onBeforeSlide;if(!$){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var K=le.length-1,G=g;g<0?G=K:g>K&&(G=0),de&&G!==D&&de(G),this.setState({previousIndex:D,currentIndex:G,isTransitioning:G!==D,currentSlideOffset:0,slideStyle:{transition:"all ".concat(se,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var C=this.state,D=C.currentIndex,$=C.isTransitioning,M=this.props.items,le=D+(m==="left"?-1:1);$||(M.length===2?this.slideToIndexWithStyleReset(le,g):this.slideToIndex(le,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var C=this,D=this.state,$=D.currentIndex,M=D.currentSlideOffset;this.setState({currentSlideOffset:M+($>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){Xi(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){Xi(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;Hi.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;Hi.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,D=m.slideInterval,$=m.slideDuration,M=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(D,$)),C&&g&&C(M))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(C))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return s().createElement(k,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return s().createElement("span",{className:"image-gallery-thumbnail-inner"},s().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&s().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,C=g.isFullscreen,D=g.modalFullscreen,$=g.isPlaying,M=this.props,le=M.additionalClass,se=M.disableThumbnailSwipe,de=M.indexSeparator,K=M.isRTL,G=M.items,J=M.thumbnailPosition,re=M.renderFullscreenButton,he=M.renderCustomControls,be=M.renderLeftNav,_e=M.renderRightNav,ot=M.showBullets,Ze=M.showFullscreenButton,qe=M.showIndex,Ce=M.showThumbnails,xe=M.showNav,Ut=M.showPlayButton,Ln=M.renderPlayPauseButton,Nn=this.getThumbnailStyle(),_t=this.getSlideItems(),sn=_t.slides,jt=_t.thumbnails,Sn=_t.bullets,An=b("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":K}),Tn=s().createElement("div",{ref:this.imageGallerySlideWrapper,className:An},he&&he(),this.canSlide()?s().createElement(s().Fragment,null,xe&&s().createElement(s().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),_e(this.slideRight,!this.canSlideRight())),s().createElement(on,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},s().createElement("div",{className:"image-gallery-slides"},sn))):s().createElement("div",{className:"image-gallery-slides"},sn),Ut&&Ln(this.togglePlay,$),ot&&s().createElement("div",{className:"image-gallery-bullets"},s().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},Sn)),Ze&&re(this.toggleFullScreen,C),qe&&s().createElement("div",{className:"image-gallery-index"},s().createElement("span",{className:"image-gallery-index-current"},m+1),s().createElement("span",{className:"image-gallery-index-separator"},de),s().createElement("span",{className:"image-gallery-index-total"},G.length))),Dn=b("image-gallery",le,{"fullscreen-modal":D}),at=b("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:C}),Ia=b("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(J),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&K},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!se},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!se});return s().createElement("div",{ref:this.imageGallery,className:Dn,"aria-live":"polite"},s().createElement("div",{className:at},(J==="bottom"||J==="right")&&Tn,Ce&&jt.length>0?s().createElement(on,{className:Ia,delta:0,onSwiping:!se&&this.handleThumbnailSwiping,onSwiped:!se&&this.handleOnThumbnailSwiped},s().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},s().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:Nn,"aria-label":"Thumbnail Navigation"},jt))):null,(J==="top"||J==="left")&&Tn))}}],E&&Jn(f.prototype,E),Object.defineProperty(f,"prototype",{writable:!1}),fe}(s().Component);wr.propTypes={flickThreshold:I.number,items:(0,I.arrayOf)((0,I.shape)({bulletClass:I.string,bulletOnClick:I.func,description:I.string,original:I.string,originalHeight:I.number,originalWidth:I.number,loading:I.string,thumbnailHeight:I.number,thumbnailWidth:I.number,thumbnailLoading:I.string,fullscreen:I.string,originalAlt:I.string,originalTitle:I.string,thumbnail:I.string,thumbnailAlt:I.string,thumbnailLabel:I.string,thumbnailTitle:I.string,originalClass:I.string,thumbnailClass:I.string,renderItem:I.func,renderThumbInner:I.func,imageSet:Ra,srcSet:I.string,sizes:I.string})).isRequired,showNav:I.bool,autoPlay:I.bool,lazyLoad:I.bool,infinite:I.bool,showIndex:I.bool,showBullets:I.bool,showThumbnails:I.bool,showPlayButton:I.bool,showFullscreenButton:I.bool,disableThumbnailScroll:I.bool,disableKeyDown:I.bool,disableSwipe:I.bool,disableThumbnailSwipe:I.bool,useBrowserFullscreen:I.bool,onErrorImageURL:I.string,indexSeparator:I.string,thumbnailPosition:(0,I.oneOf)(["top","bottom","left","right"]),startIndex:I.number,slideDuration:I.number,slideInterval:I.number,slideOnThumbnailOver:I.bool,swipeThreshold:I.number,swipingTransitionDuration:I.number,swipingThumbnailTransitionDuration:I.number,onSlide:I.func,onBeforeSlide:I.func,onScreenChange:I.func,onPause:I.func,onPlay:I.func,onClick:I.func,onImageLoad:I.func,onImageError:I.func,onTouchMove:I.func,onTouchEnd:I.func,onTouchStart:I.func,onMouseOver:I.func,onMouseLeave:I.func,onBulletClick:I.func,onThumbnailError:I.func,onThumbnailClick:I.func,renderCustomControls:I.func,renderLeftNav:I.func,renderRightNav:I.func,renderPlayPauseButton:I.func,renderFullscreenButton:I.func,renderItem:I.func,renderThumbInner:I.func,stopPropagation:I.bool,additionalClass:I.string,useTranslate3D:I.bool,isRTL:I.bool,useWindowKeyDown:I.bool},wr.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(v,f){return s().createElement(vn,{onClick:v,disabled:f})},renderRightNav:function(v,f){return s().createElement(Ft,{onClick:v,disabled:f})},renderPlayPauseButton:function(v,f){return s().createElement(Bt,{onClick:v,isPlaying:f})},renderFullscreenButton:function(v,f){return s().createElement(He,{onClick:v,isFullscreen:f})},useWindowKeyDown:!0};const Ca=wr})(),d})())})(ca);var ah=ca.exports;const lh=Zr(ah);function ch(){var e=new Map;function t(n){var r=n.root,o=n.rootMargin,c=n.threshold,d=e.get(r);d||(d=new Map,e.set(r,d));var h=JSON.stringify({rootMargin:o,threshold:c}),b=d.get(h);if(!b){var w=new Map,s=new IntersectionObserver(function(a){a.forEach(function(O){var x=w.get(O.target);x==null||x(O)})},{root:r,rootMargin:o,threshold:c});b={observer:s,entryCallbacks:w},d.set(h,b)}return{observe:function(O,x){var S,R;(S=b)==null||S.entryCallbacks.set(O,x),(R=b)==null||R.observer.observe(O)},unobserve:function(O){var x,S;(x=b)==null||x.entryCallbacks.delete(O),(S=b)==null||S.observer.unobserve(O)}}}return{getObserver:t}}var uh="0px",dh=[0],hh=ch();function ph(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:uh,o=(n=e==null?void 0:e.threshold)!=null?n:dh,c=N.useRef(null),d=N.useRef(null),h=N.useRef(null),b=N.useState(),w=b[0],s=b[1],a=N.useCallback(function(){var R=c.current;if(!R){s(void 0);return}var L=hh.getObserver({root:d.current,rootMargin:r,threshold:o});L.observe(R,function(A){s(A)}),h.current=L},[r,o]),O=N.useCallback(function(){var R=h.current,L=c.current;L&&(R==null||R.unobserve(L)),h.current=null},[]),x=N.useCallback(function(R){O(),c.current=R,a()},[a,O]),S=N.useCallback(function(R){O(),d.current=R,a()},[a,O]);return[x,{entry:w,rootRef:S}]}function Gr(){return Gr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gr.apply(this,arguments)}function fh(e){var t,n=ph(e),r=n[0],o=n[1],c=!!((t=o.entry)!=null&&t.isIntersecting),d=N.useState(c),h=d[0],b=d[1];return c&&!h&&b(!0),[r,Gr({},o,{isVisible:c,wasEverVisible:h})]}var mh=100;function gh(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,o=e.rootMargin,c=e.disabled,d=e.delayInMs,h=d===void 0?mh:d,b=fh({rootMargin:o}),w=b[0],s=b[1],a=s.rootRef,O=s.isVisible,x=!c&&!t&&O&&n;return N.useEffect(function(){if(x){var S=setTimeout(function(){r()},h);return function(){clearTimeout(S)}}},[r,x,h]),[w,{rootRef:a}]}const vh={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},yh={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'};var Cr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Ir(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function ua(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function da(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function bh(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,c=0;c<n.length;c++)r.indexOf(n[c])===-1&&(o=!1);return o}var Mi={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Cr?173:189,"=":Cr?61:187,";":Cr?59:186,"'":222,"[":219,"]":221,"\\":220},qt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Hr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ke={16:!1,18:!1,17:!1,91:!1},Me={};for(var er=1;er<20;er++)Mi["f".concat(er)]=111+er;var ke=[],Io=!1,ha="all",pa=[],xr=function(t){return Mi[t.toLowerCase()]||qt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function fa(e){ha=e||"all"}function Vn(){return ha||"all"}function xh(){return ke.slice(0)}function wh(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function Eh(e){return typeof e=="string"&&(e=xr(e)),ke.indexOf(e)!==-1}function Sh(e,t){var n,r;e||(e=Vn());for(var o in Me)if(Object.prototype.hasOwnProperty.call(Me,o))for(n=Me[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;Vn()===e&&fa(t||"all")}function Th(e){var t=e.keyCode||e.which||e.charCode,n=ke.indexOf(t);if(n>=0&&ke.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&ke.splice(0,ke.length),(t===93||t===224)&&(t=91),t in Ke){Ke[t]=!1;for(var r in qt)qt[r]===t&&(ut[r]=!1)}}function jh(e){if(typeof e>"u")Object.keys(Me).forEach(function(d){return delete Me[d]});else if(Array.isArray(e))e.forEach(function(d){d.key&&Pr(d)});else if(typeof e=="object")e.key&&Pr(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[0],c=n[1];typeof o=="function"&&(c=o,o=""),Pr({key:e,scope:o,method:c,splitKey:"+"})}}var Pr=function(t){var n=t.key,r=t.scope,o=t.method,c=t.splitKey,d=c===void 0?"+":c,h=da(n);h.forEach(function(b){var w=b.split(d),s=w.length,a=w[s-1],O=a==="*"?"*":xr(a);if(Me[O]){r||(r=Vn());var x=s>1?ua(qt,w):[];Me[O]=Me[O].filter(function(S){var R=o?S.method===o:!0;return!(R&&S.scope===r&&bh(S.mods,x))})}})};function Po(e,t,n,r){if(t.element===r){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var c in Ke)Object.prototype.hasOwnProperty.call(Ke,c)&&(!Ke[c]&&t.mods.indexOf(+c)>-1||Ke[c]&&t.mods.indexOf(+c)===-1)&&(o=!1);(t.mods.length===0&&!Ke[16]&&!Ke[18]&&!Ke[17]&&!Ke[91]||o||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function _o(e,t){var n=Me["*"],r=e.keyCode||e.which||e.charCode;if(ut.filter.call(this,e)){if((r===93||r===224)&&(r=91),ke.indexOf(r)===-1&&r!==229&&ke.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var R=Hr[S];e[S]&&ke.indexOf(R)===-1?ke.push(R):!e[S]&&ke.indexOf(R)>-1?ke.splice(ke.indexOf(R),1):S==="metaKey"&&e[S]&&ke.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(ke=ke.slice(ke.indexOf(R))))}),r in Ke){Ke[r]=!0;for(var o in qt)qt[o]===r&&(ut[o]=!0);if(!n)return}for(var c in Ke)Object.prototype.hasOwnProperty.call(Ke,c)&&(Ke[c]=e[Hr[c]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(ke.indexOf(17)===-1&&ke.push(17),ke.indexOf(18)===-1&&ke.push(18),Ke[17]=!0,Ke[18]=!0);var d=Vn();if(n)for(var h=0;h<n.length;h++)n[h].scope===d&&(e.type==="keydown"&&n[h].keydown||e.type==="keyup"&&n[h].keyup)&&Po(e,n[h],d,t);if(r in Me){for(var b=0;b<Me[r].length;b++)if((e.type==="keydown"&&Me[r][b].keydown||e.type==="keyup"&&Me[r][b].keyup)&&Me[r][b].key){for(var w=Me[r][b],s=w.splitKey,a=w.key.split(s),O=[],x=0;x<a.length;x++)O.push(xr(a[x]));O.sort().join("")===ke.sort().join("")&&Po(e,w,d,t)}}}}function Oh(e){return pa.indexOf(e)>-1}function ut(e,t,n){ke=[];var r=da(e),o=[],c="all",d=document,h=0,b=!1,w=!0,s="+",a=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(c=t.scope),t.element&&(d=t.element),t.keyup&&(b=t.keyup),t.keydown!==void 0&&(w=t.keydown),t.capture!==void 0&&(a=t.capture),typeof t.splitKey=="string"&&(s=t.splitKey)),typeof t=="string"&&(c=t);h<r.length;h++)e=r[h].split(s),o=[],e.length>1&&(o=ua(qt,e)),e=e[e.length-1],e=e==="*"?"*":xr(e),e in Me||(Me[e]=[]),Me[e].push({keyup:b,keydown:w,scope:c,mods:o,shortcut:r[h],method:n,key:r[h],splitKey:s,element:d});typeof d<"u"&&!Oh(d)&&window&&(pa.push(d),Ir(d,"keydown",function(O){_o(O,d)},a),Io||(Io=!0,Ir(window,"focus",function(){ke=[]},a)),Ir(d,"keyup",function(O){_o(O,d),Th(O)},a))}function kh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Me).forEach(function(n){var r=Me[n].find(function(o){return o.scope===t&&o.shortcut===e});r&&r.method&&r.method()})}var _r={setScope:fa,getScope:Vn,deleteScope:Sh,getPressedKeyCodes:xh,isPressed:Eh,filter:wh,trigger:kh,unbind:jh,keyMap:Mi,modifier:qt,modifierMap:Hr};for(var Lr in _r)Object.prototype.hasOwnProperty.call(_r,Lr)&&(ut[Lr]=_r[Lr]);if(typeof window<"u"){var Rh=window.hotkeys;ut.noConflict=function(e){return e&&window.hotkeys===ut&&(window.hotkeys=Rh),ut},window.hotkeys=ut}ut.filter=function(){return!0};var ma=function(t,n){var r=t.target,o=r&&r.tagName;return!!(o&&n&&n.includes(o))},Ch=function(t){return ma(t,["INPUT","TEXTAREA","SELECT"])};function Ih(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var o=n||{},c=o.enableOnTags,d=o.filter,h=o.keyup,b=o.keydown,w=o.filterPreventDefault,s=w===void 0?!0:w,a=o.enabled,O=a===void 0?!0:a,x=o.enableOnContentEditable,S=x===void 0?!1:x,R=N.useRef(null),L=N.useCallback(function(A,H){var U,X;return d&&!d(A)?!s:Ch(A)&&!ma(A,c)||(U=A.target)!=null&&U.isContentEditable&&!S?!0:R.current===null||document.activeElement===R.current||(X=R.current)!=null&&X.contains(document.activeElement)?(t(A,H),!0):!1},r?[R,c,d].concat(r):[R,c,d]);return N.useEffect(function(){if(!O){ut.unbind(e,L);return}return h&&b!==!0&&(n.keydown=!1),ut(e,n||{},L),function(){return ut.unbind(e,L)}},[L,e,O]),R}ut.isPressed;const ga=N.createContext({open:!1,toggleOpen:e=>{}});function Ph({children:e}){const[t,n]=N.useState(!1),r=c=>{n(c??!c)},o=N.useMemo(()=>({open:t,toggleOpen:r}),[t]);return i.jsx(ga.Provider,{value:o,children:e})}function Fi(){return N.useContext(ga)}const pt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},_h=e=>Xn(async()=>{const{data:t}=await e.get(pt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Lh(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",..._l(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:o=h=>{t.onFilterChange({...n,keyword:h.title})},emptyCategory:c}=t;!n.category&&!c&&(n.category="All");const d=h=>{const b={...n,...h};r(Er(b,w=>w===""||w===void 0))};return{filters:e,cleanFilter:h=>{const b=h?Er(n,(w,s)=>h.includes(s)):{};r(Er(b,w=>w===""||w===void 0))},handleActiveMenu:h=>{h!==e.menu&&r({menu:h})},handleSort:(h,b)=>{d({sortBy:h,sortDirection:b||h==="nameAsc"?"asc":"desc"})},handleKeyword:h=>{d({category:void 0,keyword:h||void 0})},handlePrice:h=>{d({price:h===e.price?void 0:h})},handleCategory:h=>{d({category:h===e.category?"":h})},handleDeveloper:h=>{d({owner:h||void 0})},handlePage:h=>{d({currentPage:h})},handleSwitchShowResources:h=>{d({showResources:h})},handleSearchSelect:h=>{o(h)}}}const Nh=(e,t,n)=>e&&t||!n,va=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ya=(e,t,n)=>{var r,o;const c=Ll(e),d=Nl(c.search);if((r=Al(e,{strict:!0}))!=null&&r.endsWith(".gif"))return d.imageFilter?Dl({...c,search:""}):e;if(d.imageFilter)return e;const h=n||((o=window.blocklet)==null?void 0:o.version),{w:b,h:w}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return ii(e,{...b||w?{imageFilter:"resize",w:b,h:w}:{},v:h})},Ah=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Dh=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Mh=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Fh=()=>window.innerWidth<=600,Bh={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},$h={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Nr={en:to(Bh),zh:to($h)},ba=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Uh=e=>(t,n)=>{const r=Nr[e]?Nr[e][t]:Nr.en[t];return Mh(r,n)||t},xa={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},wa=N.createContext(xa),{Provider:Wh,Consumer:ff}=wa;function zh(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:o=()=>{},minItemWidth:c=350,queryFilter:d=!0,layout:h={},wrapChildren:b=q=>q,extraFilter:w=q=>q,baseSearch:s=!1,fetchCategoryDelay:a=0,showResourcesSwitch:O=!1,showCategory:x=!0,tagFilters:S=[],children:R,storeVersion:L,onSearchSelect:A=()=>{},endpoint:H,blockletRender:U}=e,X=ba(r,L),j=N.useMemo(()=>rs({baseURL:H,headers:X}),[H]),W=Lh(n,{onFilterChange:o,emptyCategory:!h.showExplore,onSearchSelect:A}),[Z,F]=N.useState(""),{data:ce=[],error:Y,loading:ae,run:Se}=_h(j),Fe=N.useMemo(()=>{const q=Pl(ce,[ie=>ie.name],["asc"]),Te=q.findIndex(ie=>ie.name==="All"||ie.locales.en==="All");return Te>-1?[{...q[Te],_id:"All"},...q.slice(0,Te),...q.slice(Te+1)]:q},[ce]),Ue=N.useCallback(Uh(t),[t]),nt=N.useMemo(()=>Dh(Fe,t),[Fe,t]),ee=Ah(Ue),pe={search:W,errors:{fetchCategoriesError:Y},loadings:{fetchCategoriesLoading:ae},extraFilter:w,endpoint:H,queryFilter:d,layout:{showExplore:h.showExplore??!1,showCategory:h.showCategory??!0,showTitle:h.showTitle??!0,showSearch:h.showSearch??!0},minItemWidth:c,wrapChildren:b,t:Ue,storeVersion:L,serverVersion:r,selectedCategory:W.filters.category||(h.showExplore?"":"All"),categoryList:Fe,blockletRender:U,locale:t,categoryOptions:nt,priceOptions:ee,storeApi:j,baseSearch:s,showResourcesSwitch:O,showCategory:x,tagFilters:S,onFilterChange:o,getCategoryLocale:q=>{if(!q)return null;const Te=ce.find(ie=>ie._id===q||ie.locales.en==="All");return Te?Te.locales[t]||Te.locales.en:null},get developerName(){return Z},updateDeveloperName:F};return N.useEffect(()=>{setTimeout(Se,a||0)},[H,Se,a]),i.jsx(Wh,{value:pe,children:R})}function tt(){return N.useContext(wa)||xa}function Ea({children:e,onClick:t,size:n=32,...r}){return i.jsx(Hn,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function tr(e,t){return e===void 0?t:e}function Bi({xs:e,sm:t,md:n,lg:r,xl:o,exact:c}){const d=Gn(),h=zt(d.breakpoints.down("sm")),b=zt(d.breakpoints.between("sm","md")),w=zt(d.breakpoints.between("md","lg")),s=zt(d.breakpoints.between("lg","xl"));if(c)return h?e||null:b?t||null:w?n||null:s?r||null:o||null;let a=e;return h||(a=tr(t,a),b)||(a=tr(n,a),w)||(a=tr(r,a),s)?a:tr(o,a)}function qh({children:e}){const{open:t,toggleOpen:n}=Fi();return i.jsx(Bi,{xs:i.jsx(Wa,{open:t,onClose:()=>n(!1),children:e}),md:i.jsx(Q,{children:e})})}const Kh=N.forwardRef(({loading:e,disabled:t,...n},r)=>i.jsx(Hn,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&i.jsx(ft,{size:"1em"})}));function Sa({value:e,options:t,onChange:n,placeholder:r,...o}){var c;const d=N.useRef(null),h=Gn(),[b,w]=N.useState(!1),[s,a]=N.useState(e!==null?e:""),O=zt(h.breakpoints.down("sm"));N.useEffect(()=>{a(e!==null?e:"")},[e]);const x=N.useCallback(()=>{w(!1)},[]),S=N.useCallback(()=>{w(!0)},[]);function R(A){a(A.value),n(A.value),O&&x()}function L(A){return A===s}return i.jsxs(i.Fragment,{children:[i.jsxs(Vh,{ref:d,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Un(s)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary",borderRadius:"8px"},...o,children:[((c=t.find(A=>A.value===s))==null?void 0:c.name)||r,i.jsx(za,{className:"my-select__arrowdown",component:la,sx:{width:18,height:18}})]}),i.jsx(qa,{open:b,anchorEl:d.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:A,placement:H})=>i.jsx(Ka,{...A,style:{transformOrigin:H==="bottom"?"center top":"center bottom"},children:i.jsx(Va,{children:i.jsx(Ga,{onClickAway:x,children:i.jsx(Gh,{autoFocusItem:b,onMouseEnter:S,onMouseLeave:x,children:t.map(U=>i.jsxs(Qr,{onClick:()=>R(U),sx:{fontSize:14},children:[i.jsx(os,{sx:{mr:1,fontSize:16,visibility:L(U.value)?"visible":"hidden"}}),U.name]},U.value))})})})})})]})}const Vh=Kt(Kh)`
485
+ `;const Ro=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Jd=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},oa={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function qr({title:e,sx:t,children:n,slotProps:r,fontSize:o=12,fontWeight:c=500,color:d="text.secondary",...h}){var b,w;return e?i.jsx(Vo,{title:e,placement:"top",...h,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Fa.tooltip}`]:{backgroundColor:"common.white",fontSize:o,fontWeight:c,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:d,display:"flex",alignItems:"center"}},...Array.isArray((b=r==null?void 0:r.popper)==null?void 0:b.sx)?r.popper.sx:[(w=r==null?void 0:r.popper)==null?void 0:w.sx]]}},children:n}):n}function Zn({icon:e,children:t,maxWidth:n=100,title:r,sx:o}){return(t===0||t)&&i.jsxs(et,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(o)?o:[o]],children:[e,i.jsx(qr,{title:r||(typeof t=="string"?t:""),children:i.jsx(me,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function Qd(e){const{title:t,description:n="",cover:r="",avatar:o,author:c,download:d,did:h,official:b,buttonText:w="Install",buttonDisabled:s,buttonLoading:a,button:O,onButtonClick:x=()=>{},onMainClick:S,className:R,ref:_,icons:A,status:H,...U}=e,X=Gn(),j=(Y,ae=()=>!1)=>(Se,...Fe)=>{const Ue=Y instanceof Function;(ae()||Ue)&&(Se.preventDefault(),Se.stopPropagation(),Ue&&Y(...Fe))},W=S&&j(S),Z=j(x,()=>!!(O||s||a)),F=N.isValidElement(t)?{children:t}:{title:Ro(t),dangerouslySetInnerHTML:{__html:t}},ce=N.isValidElement(n)?{children:n}:{title:Ro(n),dangerouslySetInnerHTML:{__html:n}};return i.jsxs(Ba,{variant:"outlined",onClick:W,...U,sx:{p:{xs:2,md:3},borderRadius:2,...U.sx},children:[i.jsxs(et,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[i.jsx(sr,{src:r,did:h,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),i.jsx(me,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...F}),i.jsxs(Q,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[b&&i.jsx(qr,{title:b.tooltip,children:i.jsx(sl,{sx:{color:b.color||"#D97706",fontSize:b.size||18}})}),A==null?void 0:A.map(Y=>i.jsx(qr,{title:Y.title,children:typeof Y.icon=="string"?i.jsx(st,{icon:Y.icon,style:{color:Y.color}}):Y.icon},Y.key))]}),x&&i.jsxs(ct,{color:"reverse",variant:"outlined",size:"small",disabled:s||a,style:{borderColor:X.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:X.typography.fontWeightMedium},onClick:Z,children:[a&&i.jsx(ft,{size:15,style:{marginRight:3,color:"inherit"}}),w]}),O]}),i.jsx(et,{py:2,children:i.jsx(me,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...ce})}),i.jsxs(et,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(Zn,{icon:i.jsx(sr,{src:o,did:h,size:20,variant:"circle"}),maxWidth:200,children:c}),i.jsx(Zn,{icon:i.jsx(st,{icon:oa}),title:d,children:Jd(d)}),H==null?void 0:H.filter(Y=>Y.align!=="right").map(Y=>i.jsx(Zn,{icon:typeof Y.icon=="string"?i.jsx(st,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,children:Y.text},Y.key)),i.jsx(Q,{sx:{flex:1}}),H==null?void 0:H.filter(Y=>Y.align==="right").map(Y=>i.jsx(Zn,{icon:typeof Y.icon=="string"?i.jsx(st,{icon:Y.icon}):Y.icon,title:Y.title,maxWidth:Y.maxWidth,sx:{color:Y.color},children:Y.text},Y.key))]})]})}const Zd={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'};var Ai={},eh=Hr;Object.defineProperty(Ai,"__esModule",{value:!0});var sa=Ai.default=void 0,th=eh(ei()),nh=i;sa=Ai.default=(0,th.default)((0,nh.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var aa={exports:{}};(function(e,t){(function(n,r){e.exports=r(N)})(Ee,n=>(()=>{var r={703:(h,b,w)=>{var s=w(414);function a(){}function O(){}O.resetWarningCache=a,h.exports=function(){function x(_,A,H,U,X,j){if(j!==s){var W=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw W.name="Invariant Violation",W}}function S(){return x}x.isRequired=x;var R={array:x,bool:x,func:x,number:x,object:x,string:x,symbol:x,any:x,arrayOf:S,element:x,elementType:x,instanceOf:S,node:x,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:O,resetWarningCache:a};return R.PropTypes=R,R}},697:(h,b,w)=>{h.exports=w(703)()},414:h=>{h.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:h=>{var b=typeof Element<"u",w=typeof Map=="function",s=typeof Set=="function",a=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function O(x,S){if(x===S)return!0;if(x&&S&&typeof x=="object"&&typeof S=="object"){if(x.constructor!==S.constructor)return!1;var R,_,A,H;if(Array.isArray(x)){if((R=x.length)!=S.length)return!1;for(_=R;_--!=0;)if(!O(x[_],S[_]))return!1;return!0}if(w&&x instanceof Map&&S instanceof Map){if(x.size!==S.size)return!1;for(H=x.entries();!(_=H.next()).done;)if(!S.has(_.value[0]))return!1;for(H=x.entries();!(_=H.next()).done;)if(!O(_.value[1],S.get(_.value[0])))return!1;return!0}if(s&&x instanceof Set&&S instanceof Set){if(x.size!==S.size)return!1;for(H=x.entries();!(_=H.next()).done;)if(!S.has(_.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(x)&&ArrayBuffer.isView(S)){if((R=x.length)!=S.length)return!1;for(_=R;_--!=0;)if(x[_]!==S[_])return!1;return!0}if(x.constructor===RegExp)return x.source===S.source&&x.flags===S.flags;if(x.valueOf!==Object.prototype.valueOf)return x.valueOf()===S.valueOf();if(x.toString!==Object.prototype.toString)return x.toString()===S.toString();if((R=(A=Object.keys(x)).length)!==Object.keys(S).length)return!1;for(_=R;_--!=0;)if(!Object.prototype.hasOwnProperty.call(S,A[_]))return!1;if(b&&x instanceof Element)return!1;for(_=R;_--!=0;)if((A[_]!=="_owner"&&A[_]!=="__v"&&A[_]!=="__o"||!x.$$typeof)&&!O(x[A[_]],S[A[_]]))return!1;return!0}return x!=x&&S!=S}h.exports=function(x,S){try{return O(x,S)}catch(R){if((R.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw R}}},359:h=>{h.exports=n}},o={};function c(h){var b=o[h];if(b!==void 0)return b.exports;var w=o[h]={exports:{}};return r[h](w,w.exports,c),w.exports}c.n=h=>{var b=h&&h.__esModule?()=>h.default:()=>h;return c.d(b,{a:b}),b},c.d=(h,b)=>{for(var w in b)c.o(b,w)&&!c.o(h,w)&&Object.defineProperty(h,w,{enumerable:!0,get:b[w]})},c.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),c.o=(h,b)=>Object.prototype.hasOwnProperty.call(h,b),c.r=h=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})};var d={};return(()=>{function h(v){var f,E,T="";if(typeof v=="string"||typeof v=="number")T+=v;else if(typeof v=="object")if(Array.isArray(v))for(f=0;f<v.length;f++)v[f]&&(E=h(v[f]))&&(T&&(T+=" "),T+=E);else for(f in v)v[f]&&(T&&(T+=" "),T+=f);return T}function b(){for(var v,f,E=0,T="";E<arguments.length;)(v=arguments[E++])&&(f=h(v))&&(T&&(T+=" "),T+=f);return T}c.r(d),c.d(d,{default:()=>ka});var w=c(359),s=c.n(w);const a=function(v){var f=typeof v;return v!=null&&(f=="object"||f=="function")},O=typeof Ee=="object"&&Ee&&Ee.Object===Object&&Ee;var x=typeof self=="object"&&self&&self.Object===Object&&self;const S=O||x||Function("return this")(),R=function(){return S.Date.now()};var _=/\s/,A=/^\s+/;const H=function(v){return v&&v.slice(0,function(f){for(var E=f.length;E--&&_.test(f.charAt(E)););return E}(v)+1).replace(A,"")},U=S.Symbol;var X=Object.prototype,j=X.hasOwnProperty,W=X.toString,Z=U?U.toStringTag:void 0,F=Object.prototype.toString,ce=U?U.toStringTag:void 0;const Y=function(v){return v==null?v===void 0?"[object Undefined]":"[object Null]":ce&&ce in Object(v)?function(f){var E=j.call(f,Z),T=f[Z];try{f[Z]=void 0;var B=!0}catch{}var ne=W.call(f);return B&&(E?f[Z]=T:delete f[Z]),ne}(v):function(f){return F.call(f)}(v)};var ae=/^[-+]0x[0-9a-f]+$/i,Se=/^0b[01]+$/i,Fe=/^0o[0-7]+$/i,Ue=parseInt;const nt=function(v){if(typeof v=="number")return v;if(function(T){return typeof T=="symbol"||function(B){return B!=null&&typeof B=="object"}(T)&&Y(T)=="[object Symbol]"}(v))return NaN;if(a(v)){var f=typeof v.valueOf=="function"?v.valueOf():v;v=a(f)?f+"":f}if(typeof v!="string")return v===0?v:+v;v=H(v);var E=Se.test(v);return E||Fe.test(v)?Ue(v.slice(2),E?2:8):ae.test(v)?NaN:+v};var ee=Math.max,pe=Math.min;const q=function(v,f,E){var T,B,ne,fe,g,m,C=0,D=!1,$=!1,M=!0;if(typeof v!="function")throw new TypeError("Expected a function");function le(re){var he=T,be=B;return T=B=void 0,C=re,fe=v.apply(be,he)}function se(re){return C=re,g=setTimeout(K,f),D?le(re):fe}function de(re){var he=re-m;return m===void 0||he>=f||he<0||$&&re-C>=ne}function K(){var re=R();if(de(re))return G(re);g=setTimeout(K,function(he){var be=f-(he-m);return $?pe(be,ne-(he-C)):be}(re))}function G(re){return g=void 0,M&&T?le(re):(T=B=void 0,fe)}function J(){var re=R(),he=de(re);if(T=arguments,B=this,m=re,he){if(g===void 0)return se(m);if($)return clearTimeout(g),g=setTimeout(K,f),le(m)}return g===void 0&&(g=setTimeout(K,f)),fe}return f=nt(f)||0,a(E)&&(D=!!E.leading,ne=($="maxWait"in E)?ee(nt(E.maxWait)||0,f):ne,M="trailing"in E?!!E.trailing:M),J.cancel=function(){g!==void 0&&clearTimeout(g),C=0,T=m=B=g=void 0},J.flush=function(){return g===void 0?fe:G(R())},J},Te=function(v,f,E){var T=!0,B=!0;if(typeof v!="function")throw new TypeError("Expected a function");return a(E)&&(T="leading"in E?!!E.leading:T,B="trailing"in E?!!E.trailing:B),q(v,f,{leading:T,maxWait:f,trailing:B})};var ie=c(590),dt=c.n(ie),we=function(){if(typeof Map<"u")return Map;function v(f,E){var T=-1;return f.some(function(B,ne){return B[0]===E&&(T=ne,!0)}),T}return function(){function f(){this.__entries__=[]}return Object.defineProperty(f.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),f.prototype.get=function(E){var T=v(this.__entries__,E),B=this.__entries__[T];return B&&B[1]},f.prototype.set=function(E,T){var B=v(this.__entries__,E);~B?this.__entries__[B][1]=T:this.__entries__.push([E,T])},f.prototype.delete=function(E){var T=this.__entries__,B=v(T,E);~B&&T.splice(B,1)},f.prototype.has=function(E){return!!~v(this.__entries__,E)},f.prototype.clear=function(){this.__entries__.splice(0)},f.prototype.forEach=function(E,T){T===void 0&&(T=null);for(var B=0,ne=this.__entries__;B<ne.length;B++){var fe=ne[B];E.call(T,fe[1],fe[0])}},f}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,ze=c.g!==void 0&&c.g.Math===Math?c.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Ct=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ze):function(v){return setTimeout(function(){return v(Date.now())},1e3/60)},Vt=["top","right","bottom","left","width","height","size","weight"],Dt=typeof MutationObserver<"u",Gt=function(){function v(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(f,E){var T=!1,B=!1,ne=0;function fe(){T&&(T=!1,f()),B&&m()}function g(){Ct(fe)}function m(){var C=Date.now();if(T){if(C-ne<2)return;B=!0}else T=!0,B=!1,setTimeout(g,20);ne=C}return m}(this.refresh.bind(this))}return v.prototype.addObserver=function(f){~this.observers_.indexOf(f)||this.observers_.push(f),this.connected_||this.connect_()},v.prototype.removeObserver=function(f){var E=this.observers_,T=E.indexOf(f);~T&&E.splice(T,1),!E.length&&this.connected_&&this.disconnect_()},v.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},v.prototype.updateObservers_=function(){var f=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return f.forEach(function(E){return E.broadcastActive()}),f.length>0},v.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Dt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},v.prototype.disconnect_=function(){Je&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},v.prototype.onTransitionEnd_=function(f){var E=f.propertyName,T=E===void 0?"":E;Vt.some(function(B){return!!~T.indexOf(B)})&&this.refresh()},v.getInstance=function(){return this.instance_||(this.instance_=new v),this.instance_},v.instance_=null,v}(),Ie=function(v,f){for(var E=0,T=Object.keys(f);E<T.length;E++){var B=T[E];Object.defineProperty(v,B,{value:f[B],enumerable:!1,writable:!1,configurable:!0})}return v},Pe=function(v){return v&&v.ownerDocument&&v.ownerDocument.defaultView||ze},Oe=ge(0,0,0,0);function ye(v){return parseFloat(v)||0}function It(v){for(var f=[],E=1;E<arguments.length;E++)f[E-1]=arguments[E];return f.reduce(function(T,B){return T+ye(v["border-"+B+"-width"])},0)}var Ht=typeof SVGGraphicsElement<"u"?function(v){return v instanceof Pe(v).SVGGraphicsElement}:function(v){return v instanceof Pe(v).SVGElement&&typeof v.getBBox=="function"};function Xt(v){return Je?Ht(v)?function(f){var E=f.getBBox();return ge(0,0,E.width,E.height)}(v):function(f){var E=f.clientWidth,T=f.clientHeight;if(!E&&!T)return Oe;var B=Pe(f).getComputedStyle(f),ne=function(M){for(var le={},se=0,de=["top","right","bottom","left"];se<de.length;se++){var K=de[se],G=M["padding-"+K];le[K]=ye(G)}return le}(B),fe=ne.left+ne.right,g=ne.top+ne.bottom,m=ye(B.width),C=ye(B.height);if(B.boxSizing==="border-box"&&(Math.round(m+fe)!==E&&(m-=It(B,"left","right")+fe),Math.round(C+g)!==T&&(C-=It(B,"top","bottom")+g)),!function(M){return M===Pe(M).document.documentElement}(f)){var D=Math.round(m+fe)-E,$=Math.round(C+g)-T;Math.abs(D)!==1&&(m-=D),Math.abs($)!==1&&(C-=$)}return ge(ne.left,ne.top,m,C)}(v):Oe}function ge(v,f,E,T){return{x:v,y:f,width:E,height:T}}var Yt=function(){function v(f){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ge(0,0,0,0),this.target=f}return v.prototype.isActive=function(){var f=Xt(this.target);return this.contentRect_=f,f.width!==this.broadcastWidth||f.height!==this.broadcastHeight},v.prototype.broadcastRect=function(){var f=this.contentRect_;return this.broadcastWidth=f.width,this.broadcastHeight=f.height,f},v}(),mn=function(v,f){var E,T,B,ne,fe,g,m,C=(T=(E=f).x,B=E.y,ne=E.width,fe=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Ie(m,{x:T,y:B,width:ne,height:fe,top:B,right:T+ne,bottom:fe+B,left:T}),m);Ie(this,{target:v,contentRect:C})},gn=function(){function v(f,E,T){if(this.activeObservations_=[],this.observations_=new we,typeof f!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=f,this.controller_=E,this.callbackCtx_=T}return v.prototype.observe=function(f){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(f instanceof Pe(f).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(f)||(E.set(f,new Yt(f)),this.controller_.addObserver(this),this.controller_.refresh())}},v.prototype.unobserve=function(f){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(f instanceof Pe(f).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(f)&&(E.delete(f),E.size||this.controller_.removeObserver(this))}},v.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},v.prototype.gatherActive=function(){var f=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&f.activeObservations_.push(E)})},v.prototype.broadcastActive=function(){if(this.hasActive()){var f=this.callbackCtx_,E=this.activeObservations_.map(function(T){return new mn(T.target,T.broadcastRect())});this.callback_.call(f,E,f),this.clearActive()}},v.prototype.clearActive=function(){this.activeObservations_.splice(0)},v.prototype.hasActive=function(){return this.activeObservations_.length>0},v}(),Jt=typeof WeakMap<"u"?new WeakMap:new we,Qe=function v(f){if(!(this instanceof v))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var E=Gt.getInstance(),T=new gn(f,E,this);Jt.set(this,T)};["observe","unobserve","disconnect"].forEach(function(v){Qe.prototype[v]=function(){var f;return(f=Jt.get(this))[v].apply(f,arguments)}});const xt=ze.ResizeObserver!==void 0?ze.ResizeObserver:Qe,wt="Left",gt="Right",Et="Up",Ge="Down",Ne={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Qt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Zt="mousemove",en="mouseup";function tn(v,f){if(f===0)return v;const E=Math.PI/180*f;return[v[0]*Math.cos(E)+v[1]*Math.sin(E),v[1]*Math.cos(E)-v[0]*Math.sin(E)]}function Mt(v){const{trackMouse:f}=v,E=w.useRef(Object.assign({},Qt)),T=w.useRef(Object.assign({},Ne)),B=w.useRef(Object.assign({},T.current));let ne;for(ne in B.current=Object.assign({},T.current),T.current=Object.assign(Object.assign({},Ne),v),Ne)T.current[ne]===void 0&&(T.current[ne]=Ne[ne]);const[fe,g]=w.useMemo(()=>function(m,C){const D=K=>{const G="touches"in K;G&&K.touches.length>1||m((J,re)=>{re.trackMouse&&!G&&(document.addEventListener(Zt,$),document.addEventListener(en,le));const{clientX:he,clientY:be}=G?K.touches[0]:K,Le=tn([he,be],re.rotationAngle);return re.onTouchStartOrOnMouseDown&&re.onTouchStartOrOnMouseDown({event:K}),Object.assign(Object.assign(Object.assign({},J),Qt),{initial:Le.slice(),xy:Le,start:K.timeStamp||0})})},$=K=>{m((G,J)=>{const re="touches"in K;if(re&&K.touches.length>1)return G;if(K.timeStamp-G.start>J.swipeDuration)return G.swiping?Object.assign(Object.assign({},G),{swiping:!1}):G;const{clientX:he,clientY:be}=re?K.touches[0]:K,[Le,ot]=tn([he,be],J.rotationAngle),Ze=Le-G.xy[0],qe=ot-G.xy[1],Ce=Math.abs(Ze),xe=Math.abs(qe),Ut=(K.timeStamp||0)-G.start,_n=Math.sqrt(Ce*Ce+xe*xe)/(Ut||1),Nn=[Ze/(Ut||1),qe/(Ut||1)],Lt=function(An,Tn,Dn,at){return An>Tn?Dn>0?gt:wt:at>0?Ge:Et}(Ce,xe,Ze,qe),sn=typeof J.delta=="number"?J.delta:J.delta[Lt.toLowerCase()]||Ne.delta;if(Ce<sn&&xe<sn&&!G.swiping)return G;const jt={absX:Ce,absY:xe,deltaX:Ze,deltaY:qe,dir:Lt,event:K,first:G.first,initial:G.initial,velocity:_n,vxvy:Nn};jt.first&&J.onSwipeStart&&J.onSwipeStart(jt),J.onSwiping&&J.onSwiping(jt);let Sn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${Lt}`])&&(Sn=!0),Sn&&J.preventScrollOnSwipe&&J.trackTouch&&K.cancelable&&K.preventDefault(),Object.assign(Object.assign({},G),{first:!1,eventData:jt,swiping:!0})})},M=K=>{m((G,J)=>{let re;if(G.swiping&&G.eventData){if(K.timeStamp-G.start<J.swipeDuration){re=Object.assign(Object.assign({},G.eventData),{event:K}),J.onSwiped&&J.onSwiped(re);const he=J[`onSwiped${re.dir}`];he&&he(re)}}else J.onTap&&J.onTap({event:K});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:K}),Object.assign(Object.assign(Object.assign({},G),Qt),{eventData:re})})},le=K=>{document.removeEventListener(Zt,$),document.removeEventListener(en,le),M(K)},se=(K,G)=>{let J=()=>{};if(K&&K.addEventListener){const re=Object.assign(Object.assign({},Ne.touchEventOptions),G.touchEventOptions),he=[["touchstart",D,re],["touchmove",$,Object.assign(Object.assign({},re),G.preventScrollOnSwipe?{passive:!1}:{})],["touchend",M,re]];he.forEach(([be,Le,ot])=>K.addEventListener(be,Le,ot)),J=()=>he.forEach(([be,Le])=>K.removeEventListener(be,Le))}return J},de={ref:K=>{K!==null&&m((G,J)=>{if(G.el===K)return G;const re={};return G.el&&G.el!==K&&G.cleanUpTouch&&(G.cleanUpTouch(),re.cleanUpTouch=void 0),J.trackTouch&&K&&(re.cleanUpTouch=se(K,J)),Object.assign(Object.assign(Object.assign({},G),{el:K}),re)})}};return C.trackMouse&&(de.onMouseDown=D),[de,se]}(m=>E.current=m(E.current,T.current),{trackMouse:f}),[f]);return E.current=function(m,C,D,$){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==D.preventScrollOnSwipe||C.touchEventOptions.passive!==D.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:$(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:$(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,T.current,B.current,g),fe}var I=c(697);function ht(v){return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},ht(v)}function nn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function rn(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?nn(Object(E),!0).forEach(function(T){l(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):nn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function l(v,f,E){return(f=function(T){var B=function(ne,fe){if(ht(ne)!=="object"||ne===null)return ne;var g=ne[Symbol.toPrimitive];if(g!==void 0){var m=g.call(ne,fe);if(ht(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return ht(B)==="symbol"?B:String(B)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var p={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},y=s().memo(function(v){var f=rn(rn({},p),v),E=f.description,T=f.fullscreen,B=f.handleImageLoaded,ne=f.isFullscreen,fe=f.onImageError,g=f.original,m=f.originalAlt,C=f.originalHeight,D=f.originalWidth,$=f.originalTitle,M=f.sizes,le=f.srcSet,se=f.loading,de=ne&&T||g;return s().createElement(s().Fragment,null,s().createElement("img",{className:"image-gallery-image",src:de,alt:m,srcSet:le,height:C,width:D,sizes:M,title:$,onLoad:function(K){return B(K,g)},onError:fe,loading:se}),E&&s().createElement("span",{className:"image-gallery-description"},E))});y.displayName="Item",y.propTypes={description:I.string,fullscreen:I.string,handleImageLoaded:I.func.isRequired,isFullscreen:I.bool,onImageError:I.func.isRequired,original:I.string.isRequired,originalAlt:I.string,originalHeight:I.string,originalWidth:I.string,originalTitle:I.string,sizes:I.string,srcSet:I.string,loading:I.string};const k=y;function P(v){return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},P(v)}function z(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function V(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?z(Object(E),!0).forEach(function(T){ue(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):z(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function ue(v,f,E){return(f=function(T){var B=function(ne,fe){if(P(ne)!=="object"||ne===null)return ne;var g=ne[Symbol.toPrimitive];if(g!==void 0){var m=g.call(ne,fe);if(P(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return P(B)==="symbol"?B:String(B)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var oe={left:s().createElement("polyline",{points:"15 18 9 12 15 6"}),right:s().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:s().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:s().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:s().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:s().createElement(s().Fragment,null,s().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),s().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Ae={strokeWidth:1,viewBox:"0 0 24 24"},Be=function(v){var f=V(V({},Ae),v),E=f.strokeWidth,T=f.viewBox,B=f.icon;return s().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:T,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},oe[B])};Be.propTypes={strokeWidth:I.number,viewBox:I.string,icon:(0,I.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Re=Be;var De=s().memo(function(v){var f=v.isFullscreen,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},s().createElement(Re,{strokeWidth:2,icon:f?"minimize":"maximize"}))});De.displayName="Fullscreen",De.propTypes={isFullscreen:I.bool.isRequired,onClick:I.func.isRequired};const He=De;var Xe=s().memo(function(v){var f=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:f,onClick:E,"aria-label":"Previous Slide"},s().createElement(Re,{icon:"left",viewBox:"6 0 12 24"}))});Xe.displayName="LeftNav",Xe.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const vn=Xe;var St=s().memo(function(v){var f=v.disabled,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:f,onClick:E,"aria-label":"Next Slide"},s().createElement(Re,{icon:"right",viewBox:"6 0 12 24"}))});St.displayName="RightNav",St.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const Ft=St;var rt=s().memo(function(v){var f=v.isPlaying,E=v.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},s().createElement(Re,{strokeWidth:2,icon:f?"pause":"play"}))});rt.displayName="PlayPause",rt.propTypes={isPlaying:I.bool.isRequired,onClick:I.func.isRequired};const Bt=rt;function Pt(v){return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},Pt(v)}function $t(){return $t=Object.assign?Object.assign.bind():function(v){for(var f=1;f<arguments.length;f++){var E=arguments[f];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(v[T]=E[T])}return v},$t.apply(this,arguments)}function Pn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function Ln(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?Pn(Object(E),!0).forEach(function(T){Yn(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):Pn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function Yn(v,f,E){return(f=function(T){var B=function(ne,fe){if(Pt(ne)!=="object"||ne===null)return ne;var g=ne[Symbol.toPrimitive];if(g!==void 0){var m=g.call(ne,fe);if(Pt(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ne)}(T,"string");return Pt(B)==="symbol"?B:String(B)}(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}var it={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},yn=function(v){var f=Ln(Ln({},it),v),E=f.children,T=f.className,B=Mt({delta:f.delta,onSwiping:f.onSwiping,onSwiped:f.onSwiped});return s().createElement("div",$t({},B,{className:T}),E)};yn.propTypes={children:I.node.isRequired,className:I.string,delta:I.number,onSwiped:I.func,onSwiping:I.func};const on=yn;function vt(v){return vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},vt(v)}function bn(v,f){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(v);f&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(v,B).enumerable})),E.push.apply(E,T)}return E}function xn(v){for(var f=1;f<arguments.length;f++){var E=arguments[f]!=null?arguments[f]:{};f%2?bn(Object(E),!0).forEach(function(T){Ki(v,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):bn(Object(E)).forEach(function(T){Object.defineProperty(v,T,Object.getOwnPropertyDescriptor(E,T))})}return v}function Jn(v,f){for(var E=0;E<f.length;E++){var T=f[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(v,Vi(T.key),T)}}function Tt(v,f){return Tt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E},Tt(v,f)}function wn(v,f){if(f&&(vt(f)==="object"||typeof f=="function"))return f;if(f!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return je(v)}function je(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function En(v){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},En(v)}function Ki(v,f,E){return(f=Vi(f))in v?Object.defineProperty(v,f,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[f]=E,v}function Vi(v){var f=function(E,T){if(vt(E)!=="object"||E===null)return E;var B=E[Symbol.toPrimitive];if(B!==void 0){var ne=B.call(E,T);if(vt(ne)!=="object")return ne;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(v,"string");return vt(f)==="symbol"?f:String(f)}var Gi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Oa=(0,I.arrayOf)((0,I.shape)({srcSet:I.string,media:I.string}));function Hi(v){var f=parseInt(v.keyCode||v.which||0,10);return f===66||f===62}var br=function(v){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&Tt(g,m)})(fe,v);var f,E,T,B,ne=(T=fe,B=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=En(T);if(B){var C=En(this).constructor;g=Reflect.construct(m,arguments,C)}else g=m.apply(this,arguments);return wn(this,g)});function fe(g){var m;return function(C,D){if(!(C instanceof D))throw new TypeError("Cannot call a class as a function")}(this,fe),Ki(je(m=ne.call(this,g)),"onBulletClick",function(C,D){var $=m.props,M=$.onBulletClick,le=$.items,se=m.state.currentIndex;C.target.blur(),se!==D&&(le.length===2?m.slideToIndexWithStyleReset(D,C):m.slideToIndex(D,C)),M&&M(C,D)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=s().createRef(),m.thumbnailsWrapper=s().createRef(),m.thumbnails=s().createRef(),m.imageGallerySlideWrapper=s().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(je(m)),m.handleKeyDown=m.handleKeyDown.bind(je(m)),m.handleMouseDown=m.handleMouseDown.bind(je(m)),m.handleResize=m.handleResize.bind(je(m)),m.handleTouchMove=m.handleTouchMove.bind(je(m)),m.handleOnSwiped=m.handleOnSwiped.bind(je(m)),m.handleScreenChange=m.handleScreenChange.bind(je(m)),m.handleSwiping=m.handleSwiping.bind(je(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(je(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(je(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(je(m)),m.handleImageError=m.handleImageError.bind(je(m)),m.pauseOrPlay=m.pauseOrPlay.bind(je(m)),m.renderThumbInner=m.renderThumbInner.bind(je(m)),m.renderItem=m.renderItem.bind(je(m)),m.slideLeft=m.slideLeft.bind(je(m)),m.slideRight=m.slideRight.bind(je(m)),m.toggleFullScreen=m.toggleFullScreen.bind(je(m)),m.togglePlay=m.togglePlay.bind(je(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=Te(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return f=fe,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,C=g.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var C=this.props,D=C.items,$=C.lazyLoad,M=C.slideDuration,le=C.slideInterval,se=C.startIndex,de=C.thumbnailPosition,K=C.showThumbnails,G=C.useWindowKeyDown,J=this.state,re=J.currentIndex,he=J.isPlaying,be=g.items.length!==D.length,Le=!dt()(g.items,D),ot=g.startIndex!==se,Ze=g.thumbnailPosition!==de,qe=g.showThumbnails!==K;le===g.slideInterval&&M===g.slideDuration||he&&(this.pause(),this.play()),Ze&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),qe&&K&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),qe&&!K&&this.removeThumbnailsResizeObserver(),(be||qe)&&this.handleResize(),m.currentIndex!==re&&this.slideThumbnailBar(),g.slideDuration!==M&&(this.slideToIndex=Te(this.unthrottledSlideToIndex,M,{trailing:!1})),!$||g.lazyLoad&&!Le||(this.lazyLoaded=[]),G!==g.useWindowKeyDown&&(G?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ot||Le)&&this.setState({currentIndex:se,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,C=m.currentIndex,D=m.isTransitioning,$=this.props,M=$.onSlide,le=$.slideDuration;this.transitionTimer=window.setTimeout(function(){D&&(g.setState({isTransitioning:!D,isSwipingThumbnail:!1}),M&&M(C))},le+50)}},{key:"onThumbnailClick",value:function(g,m){var C=this.props,D=C.onThumbnailClick,$=C.items,M=this.state.currentIndex;g.target.parentNode.parentNode.blur(),M!==m&&($.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),D&&D(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,C=this.props,D=C.disableThumbnailScroll,$=C.items,M=this.state,le=M.thumbnailsWrapperWidth,se=M.thumbnailsWrapperHeight,de=this.thumbnails&&this.thumbnails.current;if(D)return 0;if(de){if(this.isThumbnailVertical()){if(de.scrollHeight<=se)return 0;m=de.scrollHeight-se}else{if(de.scrollWidth<=le||le<=0)return 0;m=de.scrollWidth-le}return g*(m/($.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,C=this.props,D=C.infinite,$=C.items,M="",le="image-gallery-left",se="image-gallery-right";switch(g){case m-1:M=" ".concat(le);break;case m:M=" ".concat("image-gallery-center");break;case m+1:M=" ".concat(se)}return $.length>=3&&D&&(g===0&&m===$.length-1?M=" ".concat(se):g===$.length-1&&m===0&&(M=" ".concat(le))),M}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,C=m.currentIndex,D=m.currentSlideOffset,$=m.previousIndex,M=C!==$,le=g===0&&$===0,se=g===1&&$===1,de=g===0&&C===1,K=g===1&&C===0,G=D===0,J=-100*C+100*g+D;return D>0?this.direction="left":D<0&&(this.direction="right"),K&&D>0&&(J=-100+D),de&&D<0&&(J=100+D),M?le&&G&&this.direction==="left"?J=100:se&&G&&this.direction==="right"&&(J=-100):(K&&G&&this.direction==="left"&&(J=-100),de&&G&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,C=m.currentIndex,D=m.currentSlideOffset,$=m.slideStyle,M=this.props,le=M.infinite,se=M.items,de=M.useTranslate3D,K=M.isRTL,G=-100*C,J=se.length-1,re=(G+100*g)*(K?-1:1)+D;le&&se.length>2&&(C===0&&g===J?re=-100*(K?-1:1)+D:C===J&&g===0&&(re=100*(K?-1:1)+D)),le&&se.length===2&&(re=this.getTranslateXForTwoSlide(g));var he="translate(".concat(re,"%, 0)");return de&&(he="translate3d(".concat(re,"%, 0, 0)")),xn({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:he,MozTransform:he,msTransform:he,OTransform:he,transform:he},$)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,C=m.useTranslate3D,D=m.isRTL,$=this.state,M=$.thumbsTranslate,le=$.thumbsStyle,se=D?-1*M:M;return this.isThumbnailVertical()?(g="translate(0, ".concat(M,"px)"),C&&(g="translate3d(0, ".concat(M,"px, 0)"))):(g="translate(".concat(se,"px, 0)"),C&&(g="translate3d(".concat(se,"px, 0, 0)"))),xn({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},le)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,C=this.props,D=C.items,$=C.slideOnThumbnailOver,M=C.onClick,le=C.lazyLoad,se=C.onTouchMove,de=C.onTouchEnd,K=C.onTouchStart,G=C.onMouseOver,J=C.onMouseLeave,re=C.renderItem,he=C.renderThumbInner,be=C.showThumbnails,Le=C.showBullets,ot=[],Ze=[],qe=[];return D.forEach(function(Ce,xe){var Ut=g.getAlignmentClassName(xe),_n=Ce.originalClass?" ".concat(Ce.originalClass):"",Nn=Ce.thumbnailClass?" ".concat(Ce.thumbnailClass):"",Lt=Ce.renderItem||re||g.renderItem,sn=Ce.renderThumbInner||he||g.renderThumbInner,jt=!le||Ut||g.lazyLoaded[xe];jt&&le&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var Sn=g.getSlideStyle(xe),An=s().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Ut," ").concat(_n),style:Sn,onClick:M,onKeyUp:g.handleSlideKeyUp,onTouchMove:se,onTouchEnd:de,onTouchStart:K,onMouseOver:G,onFocus:G,onMouseLeave:J,role:"button"},jt?Lt(Ce):s().createElement("div",{style:{height:"100%"}}));if(ot.push(An),be&&Ce.thumbnail){var Tn=b("image-gallery-thumbnail",Nn,{active:m===xe});Ze.push(s().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:Tn,onMouseLeave:$?g.onThumbnailMouseLeave:null,onMouseOver:function(at){return g.handleThumbnailMouseOver(at,xe)},onFocus:function(at){return g.handleThumbnailMouseOver(at,xe)},onKeyUp:function(at){return g.handleThumbnailKeyUp(at,xe)},onClick:function(at){return g.onThumbnailClick(at,xe)}},sn(Ce)))}if(Le){var Dn=b("image-gallery-bullet",Ce.bulletClass,{active:m===xe});qe.push(s().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Dn,onClick:function(at){return g.onBulletClick(at,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:ot,thumbnails:Ze,bullets:qe}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,C=m.previousIndex,D=m.currentIndex,$=g.length-1;return Math.abs(C-D)>1&&!(C===0&&D===$)&&!(C===$&&D===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,C=m.isTransitioning,D=m.previousIndex,$=m.currentIndex;return C&&!(g===D||g===$)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,C=g.isSwipingThumbnail,D=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:D,thumbsSwipedTranslate:D}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,C=g.absX,D=g.dir,$=this.props,M=$.disableSwipe,le=$.stopPropagation,se=this.state,de=se.galleryWidth,K=se.isTransitioning,G=se.swipingUpDown,J=se.swipingLeftRight;if(D!==Et&&D!==Ge&&!G||J){if(D!==wt&&D!==gt||J||this.setState({swipingLeftRight:!0}),!M){var re=this.props.swipingTransitionDuration;if(le&&m.preventDefault(),K)this.setState({currentSlideOffset:0});else{var he=D===gt?1:-1,be=C/de*100;Math.abs(be)>=100&&(be=100);var Le={transition:"transform ".concat(re,"ms ease-out")};this.setState({currentSlideOffset:he*be,slideStyle:Le})}}}else G||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,C=g.absX,D=g.absY,$=g.dir,M=this.props,le=M.stopPropagation,se=M.swipingThumbnailTransitionDuration,de=this.state,K=de.thumbsSwipedTranslate,G=de.thumbnailsWrapperHeight,J=de.thumbnailsWrapperWidth,re=de.swipingUpDown,he=de.swipingLeftRight;if(this.isThumbnailVertical()){if(($===wt||$===gt||he)&&!re)return void(he||this.setState({swipingLeftRight:!0}));$!==Et&&$!==Ge||re||this.setState({swipingUpDown:!0})}else{if(($===Et||$===Ge||re)&&!he)return void(re||this.setState({swipingUpDown:!0}));$!==wt&&$!==gt||he||this.setState({swipingLeftRight:!0})}var be,Le,ot,Ze,qe,Ce=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=K+($===Ge?D:-D),Le=Ce.scrollHeight-G+20,ot=Math.abs(be)>Le,Ze=be>20,qe=Ce.scrollHeight<=G):(be=K+($===gt?C:-C),Le=Ce.scrollWidth-J+20,ot=Math.abs(be)>Le,Ze=be>20,qe=Ce.scrollWidth<=J),!qe&&($!==wt&&$!==Et||!ot)&&($!==gt&&$!==Ge||!Ze)){le&&m.stopPropagation();var xe={transition:"transform ".concat(se,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,C=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,C=g.dir,D=g.velocity,$=this.props,M=$.disableSwipe,le=$.stopPropagation,se=$.flickThreshold;if(!M){var de=this.props.isRTL;le&&m.stopPropagation(),this.resetSwipingDirection();var K=(C===wt?1:-1)*(de?-1:1),G=D>se&&!(C===Et||C===Ge);this.handleOnSwipedTo(K,G)}}},{key:"handleOnSwipedTo",value:function(g,m){var C=this.state,D=C.currentIndex,$=C.isTransitioning,M=D;!this.sufficientSwipe()&&!m||$||(M+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(M=D),this.unthrottledSlideToIndex(M)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,C=m.disableKeyDown,D=m.useBrowserFullscreen,$=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:$&&!D&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new xt(q(function(C){C&&C.forEach(function(D){m.setState({thumbnailsWrapperWidth:D.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new xt(q(function(C){C&&C.forEach(function(D){m.setState({thumbnailsWrapperHeight:D.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,C=g.useBrowserFullscreen,D=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,$=this.imageGallery.current===D;m&&m($),C&&this.setState({isFullscreen:$})}},{key:"slideToIndex",value:function(g,m){var C=this.state,D=C.currentIndex,$=C.isTransitioning,M=this.props,le=M.items,se=M.slideDuration,de=M.onBeforeSlide;if(!$){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var K=le.length-1,G=g;g<0?G=K:g>K&&(G=0),de&&G!==D&&de(G),this.setState({previousIndex:D,currentIndex:G,isTransitioning:G!==D,currentSlideOffset:0,slideStyle:{transition:"all ".concat(se,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var C=this.state,D=C.currentIndex,$=C.isTransitioning,M=this.props.items,le=D+(m==="left"?-1:1);$||(M.length===2?this.slideToIndexWithStyleReset(le,g):this.slideToIndex(le,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var C=this,D=this.state,$=D.currentIndex,M=D.currentSlideOffset;this.setState({currentSlideOffset:M+($>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){Hi(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){Hi(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;Gi.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;Gi.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,D=m.slideInterval,$=m.slideDuration,M=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(D,$)),C&&g&&C(M))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(C))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return s().createElement(k,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return s().createElement("span",{className:"image-gallery-thumbnail-inner"},s().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&s().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,C=g.isFullscreen,D=g.modalFullscreen,$=g.isPlaying,M=this.props,le=M.additionalClass,se=M.disableThumbnailSwipe,de=M.indexSeparator,K=M.isRTL,G=M.items,J=M.thumbnailPosition,re=M.renderFullscreenButton,he=M.renderCustomControls,be=M.renderLeftNav,Le=M.renderRightNav,ot=M.showBullets,Ze=M.showFullscreenButton,qe=M.showIndex,Ce=M.showThumbnails,xe=M.showNav,Ut=M.showPlayButton,_n=M.renderPlayPauseButton,Nn=this.getThumbnailStyle(),Lt=this.getSlideItems(),sn=Lt.slides,jt=Lt.thumbnails,Sn=Lt.bullets,An=b("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":K}),Tn=s().createElement("div",{ref:this.imageGallerySlideWrapper,className:An},he&&he(),this.canSlide()?s().createElement(s().Fragment,null,xe&&s().createElement(s().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),Le(this.slideRight,!this.canSlideRight())),s().createElement(on,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},s().createElement("div",{className:"image-gallery-slides"},sn))):s().createElement("div",{className:"image-gallery-slides"},sn),Ut&&_n(this.togglePlay,$),ot&&s().createElement("div",{className:"image-gallery-bullets"},s().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},Sn)),Ze&&re(this.toggleFullScreen,C),qe&&s().createElement("div",{className:"image-gallery-index"},s().createElement("span",{className:"image-gallery-index-current"},m+1),s().createElement("span",{className:"image-gallery-index-separator"},de),s().createElement("span",{className:"image-gallery-index-total"},G.length))),Dn=b("image-gallery",le,{"fullscreen-modal":D}),at=b("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:C}),Ra=b("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(J),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&K},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!se},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!se});return s().createElement("div",{ref:this.imageGallery,className:Dn,"aria-live":"polite"},s().createElement("div",{className:at},(J==="bottom"||J==="right")&&Tn,Ce&&jt.length>0?s().createElement(on,{className:Ra,delta:0,onSwiping:!se&&this.handleThumbnailSwiping,onSwiped:!se&&this.handleOnThumbnailSwiped},s().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},s().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:Nn,"aria-label":"Thumbnail Navigation"},jt))):null,(J==="top"||J==="left")&&Tn))}}],E&&Jn(f.prototype,E),Object.defineProperty(f,"prototype",{writable:!1}),fe}(s().Component);br.propTypes={flickThreshold:I.number,items:(0,I.arrayOf)((0,I.shape)({bulletClass:I.string,bulletOnClick:I.func,description:I.string,original:I.string,originalHeight:I.number,originalWidth:I.number,loading:I.string,thumbnailHeight:I.number,thumbnailWidth:I.number,thumbnailLoading:I.string,fullscreen:I.string,originalAlt:I.string,originalTitle:I.string,thumbnail:I.string,thumbnailAlt:I.string,thumbnailLabel:I.string,thumbnailTitle:I.string,originalClass:I.string,thumbnailClass:I.string,renderItem:I.func,renderThumbInner:I.func,imageSet:Oa,srcSet:I.string,sizes:I.string})).isRequired,showNav:I.bool,autoPlay:I.bool,lazyLoad:I.bool,infinite:I.bool,showIndex:I.bool,showBullets:I.bool,showThumbnails:I.bool,showPlayButton:I.bool,showFullscreenButton:I.bool,disableThumbnailScroll:I.bool,disableKeyDown:I.bool,disableSwipe:I.bool,disableThumbnailSwipe:I.bool,useBrowserFullscreen:I.bool,onErrorImageURL:I.string,indexSeparator:I.string,thumbnailPosition:(0,I.oneOf)(["top","bottom","left","right"]),startIndex:I.number,slideDuration:I.number,slideInterval:I.number,slideOnThumbnailOver:I.bool,swipeThreshold:I.number,swipingTransitionDuration:I.number,swipingThumbnailTransitionDuration:I.number,onSlide:I.func,onBeforeSlide:I.func,onScreenChange:I.func,onPause:I.func,onPlay:I.func,onClick:I.func,onImageLoad:I.func,onImageError:I.func,onTouchMove:I.func,onTouchEnd:I.func,onTouchStart:I.func,onMouseOver:I.func,onMouseLeave:I.func,onBulletClick:I.func,onThumbnailError:I.func,onThumbnailClick:I.func,renderCustomControls:I.func,renderLeftNav:I.func,renderRightNav:I.func,renderPlayPauseButton:I.func,renderFullscreenButton:I.func,renderItem:I.func,renderThumbInner:I.func,stopPropagation:I.bool,additionalClass:I.string,useTranslate3D:I.bool,isRTL:I.bool,useWindowKeyDown:I.bool},br.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(v,f){return s().createElement(vn,{onClick:v,disabled:f})},renderRightNav:function(v,f){return s().createElement(Ft,{onClick:v,disabled:f})},renderPlayPauseButton:function(v,f){return s().createElement(Bt,{onClick:v,isPlaying:f})},renderFullscreenButton:function(v,f){return s().createElement(He,{onClick:v,isFullscreen:f})},useWindowKeyDown:!0};const ka=br})(),d})())})(aa);var rh=aa.exports;const ih=Qr(rh);function oh(){var e=new Map;function t(n){var r=n.root,o=n.rootMargin,c=n.threshold,d=e.get(r);d||(d=new Map,e.set(r,d));var h=JSON.stringify({rootMargin:o,threshold:c}),b=d.get(h);if(!b){var w=new Map,s=new IntersectionObserver(function(a){a.forEach(function(O){var x=w.get(O.target);x==null||x(O)})},{root:r,rootMargin:o,threshold:c});b={observer:s,entryCallbacks:w},d.set(h,b)}return{observe:function(O,x){var S,R;(S=b)==null||S.entryCallbacks.set(O,x),(R=b)==null||R.observer.observe(O)},unobserve:function(O){var x,S;(x=b)==null||x.entryCallbacks.delete(O),(S=b)==null||S.observer.unobserve(O)}}}return{getObserver:t}}var sh="0px",ah=[0],lh=oh();function ch(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:sh,o=(n=e==null?void 0:e.threshold)!=null?n:ah,c=N.useRef(null),d=N.useRef(null),h=N.useRef(null),b=N.useState(),w=b[0],s=b[1],a=N.useCallback(function(){var R=c.current;if(!R){s(void 0);return}var _=lh.getObserver({root:d.current,rootMargin:r,threshold:o});_.observe(R,function(A){s(A)}),h.current=_},[r,o]),O=N.useCallback(function(){var R=h.current,_=c.current;_&&(R==null||R.unobserve(_)),h.current=null},[]),x=N.useCallback(function(R){O(),c.current=R,a()},[a,O]),S=N.useCallback(function(R){O(),d.current=R,a()},[a,O]);return[x,{entry:w,rootRef:S}]}function Kr(){return Kr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kr.apply(this,arguments)}function uh(e){var t,n=ch(e),r=n[0],o=n[1],c=!!((t=o.entry)!=null&&t.isIntersecting),d=N.useState(c),h=d[0],b=d[1];return c&&!h&&b(!0),[r,Kr({},o,{isVisible:c,wasEverVisible:h})]}var dh=100;function hh(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,o=e.rootMargin,c=e.disabled,d=e.delayInMs,h=d===void 0?dh:d,b=uh({rootMargin:o}),w=b[0],s=b[1],a=s.rootRef,O=s.isVisible,x=!c&&!t&&O&&n;return N.useEffect(function(){if(x){var S=setTimeout(function(){r()},h);return function(){clearTimeout(S)}}},[r,x,h]),[w,{rootRef:a}]}const ph={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},fh={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'};var kr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Rr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function la(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function ca(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function mh(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,c=0;c<n.length;c++)r.indexOf(n[c])===-1&&(o=!1);return o}var Di={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":kr?173:189,"=":kr?61:187,";":kr?59:186,"'":222,"[":219,"]":221,"\\":220},qt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Vr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ke={16:!1,18:!1,17:!1,91:!1},Me={};for(var er=1;er<20;er++)Di["f".concat(er)]=111+er;var ke=[],Co=!1,ua="all",da=[],yr=function(t){return Di[t.toLowerCase()]||qt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ha(e){ua=e||"all"}function Vn(){return ua||"all"}function gh(){return ke.slice(0)}function vh(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function yh(e){return typeof e=="string"&&(e=yr(e)),ke.indexOf(e)!==-1}function bh(e,t){var n,r;e||(e=Vn());for(var o in Me)if(Object.prototype.hasOwnProperty.call(Me,o))for(n=Me[o],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;Vn()===e&&ha(t||"all")}function xh(e){var t=e.keyCode||e.which||e.charCode,n=ke.indexOf(t);if(n>=0&&ke.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&ke.splice(0,ke.length),(t===93||t===224)&&(t=91),t in Ke){Ke[t]=!1;for(var r in qt)qt[r]===t&&(ut[r]=!1)}}function wh(e){if(typeof e>"u")Object.keys(Me).forEach(function(d){return delete Me[d]});else if(Array.isArray(e))e.forEach(function(d){d.key&&Cr(d)});else if(typeof e=="object")e.key&&Cr(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n[0],c=n[1];typeof o=="function"&&(c=o,o=""),Cr({key:e,scope:o,method:c,splitKey:"+"})}}var Cr=function(t){var n=t.key,r=t.scope,o=t.method,c=t.splitKey,d=c===void 0?"+":c,h=ca(n);h.forEach(function(b){var w=b.split(d),s=w.length,a=w[s-1],O=a==="*"?"*":yr(a);if(Me[O]){r||(r=Vn());var x=s>1?la(qt,w):[];Me[O]=Me[O].filter(function(S){var R=o?S.method===o:!0;return!(R&&S.scope===r&&mh(S.mods,x))})}})};function Io(e,t,n,r){if(t.element===r){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var c in Ke)Object.prototype.hasOwnProperty.call(Ke,c)&&(!Ke[c]&&t.mods.indexOf(+c)>-1||Ke[c]&&t.mods.indexOf(+c)===-1)&&(o=!1);(t.mods.length===0&&!Ke[16]&&!Ke[18]&&!Ke[17]&&!Ke[91]||o||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function Po(e,t){var n=Me["*"],r=e.keyCode||e.which||e.charCode;if(ut.filter.call(this,e)){if((r===93||r===224)&&(r=91),ke.indexOf(r)===-1&&r!==229&&ke.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var R=Vr[S];e[S]&&ke.indexOf(R)===-1?ke.push(R):!e[S]&&ke.indexOf(R)>-1?ke.splice(ke.indexOf(R),1):S==="metaKey"&&e[S]&&ke.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(ke=ke.slice(ke.indexOf(R))))}),r in Ke){Ke[r]=!0;for(var o in qt)qt[o]===r&&(ut[o]=!0);if(!n)return}for(var c in Ke)Object.prototype.hasOwnProperty.call(Ke,c)&&(Ke[c]=e[Vr[c]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(ke.indexOf(17)===-1&&ke.push(17),ke.indexOf(18)===-1&&ke.push(18),Ke[17]=!0,Ke[18]=!0);var d=Vn();if(n)for(var h=0;h<n.length;h++)n[h].scope===d&&(e.type==="keydown"&&n[h].keydown||e.type==="keyup"&&n[h].keyup)&&Io(e,n[h],d,t);if(r in Me){for(var b=0;b<Me[r].length;b++)if((e.type==="keydown"&&Me[r][b].keydown||e.type==="keyup"&&Me[r][b].keyup)&&Me[r][b].key){for(var w=Me[r][b],s=w.splitKey,a=w.key.split(s),O=[],x=0;x<a.length;x++)O.push(yr(a[x]));O.sort().join("")===ke.sort().join("")&&Io(e,w,d,t)}}}}function Eh(e){return da.indexOf(e)>-1}function ut(e,t,n){ke=[];var r=ca(e),o=[],c="all",d=document,h=0,b=!1,w=!0,s="+",a=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(c=t.scope),t.element&&(d=t.element),t.keyup&&(b=t.keyup),t.keydown!==void 0&&(w=t.keydown),t.capture!==void 0&&(a=t.capture),typeof t.splitKey=="string"&&(s=t.splitKey)),typeof t=="string"&&(c=t);h<r.length;h++)e=r[h].split(s),o=[],e.length>1&&(o=la(qt,e)),e=e[e.length-1],e=e==="*"?"*":yr(e),e in Me||(Me[e]=[]),Me[e].push({keyup:b,keydown:w,scope:c,mods:o,shortcut:r[h],method:n,key:r[h],splitKey:s,element:d});typeof d<"u"&&!Eh(d)&&window&&(da.push(d),Rr(d,"keydown",function(O){Po(O,d)},a),Co||(Co=!0,Rr(window,"focus",function(){ke=[]},a)),Rr(d,"keyup",function(O){Po(O,d),xh(O)},a))}function Sh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Me).forEach(function(n){var r=Me[n].find(function(o){return o.scope===t&&o.shortcut===e});r&&r.method&&r.method()})}var Ir={setScope:ha,getScope:Vn,deleteScope:bh,getPressedKeyCodes:gh,isPressed:yh,filter:vh,trigger:Sh,unbind:wh,keyMap:Di,modifier:qt,modifierMap:Vr};for(var Pr in Ir)Object.prototype.hasOwnProperty.call(Ir,Pr)&&(ut[Pr]=Ir[Pr]);if(typeof window<"u"){var Th=window.hotkeys;ut.noConflict=function(e){return e&&window.hotkeys===ut&&(window.hotkeys=Th),ut},window.hotkeys=ut}ut.filter=function(){return!0};var pa=function(t,n){var r=t.target,o=r&&r.tagName;return!!(o&&n&&n.includes(o))},jh=function(t){return pa(t,["INPUT","TEXTAREA","SELECT"])};function Oh(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var o=n||{},c=o.enableOnTags,d=o.filter,h=o.keyup,b=o.keydown,w=o.filterPreventDefault,s=w===void 0?!0:w,a=o.enabled,O=a===void 0?!0:a,x=o.enableOnContentEditable,S=x===void 0?!1:x,R=N.useRef(null),_=N.useCallback(function(A,H){var U,X;return d&&!d(A)?!s:jh(A)&&!pa(A,c)||(U=A.target)!=null&&U.isContentEditable&&!S?!0:R.current===null||document.activeElement===R.current||(X=R.current)!=null&&X.contains(document.activeElement)?(t(A,H),!0):!1},r?[R,c,d].concat(r):[R,c,d]);return N.useEffect(function(){if(!O){ut.unbind(e,_);return}return h&&b!==!0&&(n.keydown=!1),ut(e,n||{},_),function(){return ut.unbind(e,_)}},[_,e,O]),R}ut.isPressed;const fa=N.createContext({open:!1,toggleOpen:e=>{}});function kh({children:e}){const[t,n]=N.useState(!1),r=c=>{n(c??!c)},o=N.useMemo(()=>({open:t,toggleOpen:r}),[t]);return i.jsx(fa.Provider,{value:o,children:e})}function Mi(){return N.useContext(fa)}const pt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},Rh=e=>Xn(async()=>{const{data:t}=await e.get(pt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Ch(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...Il(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:o=h=>{t.onFilterChange({...n,keyword:h.title})},emptyCategory:c}=t;!n.category&&!c&&(n.category="All");const d=h=>{const b={...n,...h};r(xr(b,w=>w===""||w===void 0))};return{filters:e,cleanFilter:h=>{const b=h?xr(n,(w,s)=>h.includes(s)):{};r(xr(b,w=>w===""||w===void 0))},handleActiveMenu:h=>{h!==e.menu&&r({menu:h})},handleSort:(h,b)=>{d({sortBy:h,sortDirection:b||h==="nameAsc"?"asc":"desc"})},handleKeyword:h=>{d({category:void 0,keyword:h||void 0})},handlePrice:h=>{d({price:h===e.price?void 0:h})},handleCategory:h=>{d({category:h===e.category?"":h})},handleDeveloper:h=>{d({owner:h||void 0})},handlePage:h=>{d({currentPage:h})},handleSwitchShowResources:h=>{d({showResources:h})},handleSearchSelect:h=>{o(h)}}}const Ih=(e,t,n)=>e&&t||!n,ma=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ga=(e,t,n)=>{var r,o;const c=Pl(e),d=Ll(c.search);if((r=_l(e,{strict:!0}))!=null&&r.endsWith(".gif"))return d.imageFilter?Nl({...c,search:""}):e;if(d.imageFilter)return e;const h=n||((o=window.blocklet)==null?void 0:o.version),{w:b,h:w}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return ii(e,{...b||w?{imageFilter:"resize",w:b,h:w}:{},v:h})},Ph=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Lh=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),_h=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Nh=()=>window.innerWidth<=600,Ah={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},Dh={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Lr={en:eo(Ah),zh:eo(Dh)},va=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Mh=e=>(t,n)=>{const r=Lr[e]?Lr[e][t]:Lr.en[t];return _h(r,n)||t},ya={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},ba=N.createContext(ya),{Provider:Fh,Consumer:uf}=ba;function Bh(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:o=()=>{},minItemWidth:c=350,queryFilter:d=!0,layout:h={},wrapChildren:b=q=>q,extraFilter:w=q=>q,baseSearch:s=!1,fetchCategoryDelay:a=0,showResourcesSwitch:O=!1,showCategory:x=!0,tagFilters:S=[],children:R,storeVersion:_,onSearchSelect:A=()=>{},endpoint:H,blockletRender:U}=e,X=va(r,_),j=N.useMemo(()=>ns({baseURL:H,headers:X}),[H]),W=Ch(n,{onFilterChange:o,emptyCategory:!h.showExplore,onSearchSelect:A}),[Z,F]=N.useState(""),{data:ce=[],error:Y,loading:ae,run:Se}=Rh(j),Fe=N.useMemo(()=>{const q=Cl(ce,[ie=>ie.name],["asc"]),Te=q.findIndex(ie=>ie.name==="All"||ie.locales.en==="All");return Te>-1?[{...q[Te],_id:"All"},...q.slice(0,Te),...q.slice(Te+1)]:q},[ce]),Ue=N.useCallback(Mh(t),[t]),nt=N.useMemo(()=>Lh(Fe,t),[Fe,t]),ee=Ph(Ue),pe={search:W,errors:{fetchCategoriesError:Y},loadings:{fetchCategoriesLoading:ae},extraFilter:w,endpoint:H,queryFilter:d,layout:{showExplore:h.showExplore??!1,showCategory:h.showCategory??!0,showTitle:h.showTitle??!0,showSearch:h.showSearch??!0},minItemWidth:c,wrapChildren:b,t:Ue,storeVersion:_,serverVersion:r,selectedCategory:W.filters.category||(h.showExplore?"":"All"),categoryList:Fe,blockletRender:U,locale:t,categoryOptions:nt,priceOptions:ee,storeApi:j,baseSearch:s,showResourcesSwitch:O,showCategory:x,tagFilters:S,onFilterChange:o,getCategoryLocale:q=>{if(!q)return null;const Te=ce.find(ie=>ie._id===q||ie.locales.en==="All");return Te?Te.locales[t]||Te.locales.en:null},get developerName(){return Z},updateDeveloperName:F};return N.useEffect(()=>{setTimeout(Se,a||0)},[H,Se,a]),i.jsx(Fh,{value:pe,children:R})}function tt(){return N.useContext(ba)||ya}function xa({children:e,onClick:t,size:n=32,...r}){return i.jsx(Hn,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function tr(e,t){return e===void 0?t:e}function Fi({xs:e,sm:t,md:n,lg:r,xl:o,exact:c}){const d=Gn(),h=zt(d.breakpoints.down("sm")),b=zt(d.breakpoints.between("sm","md")),w=zt(d.breakpoints.between("md","lg")),s=zt(d.breakpoints.between("lg","xl"));if(c)return h?e||null:b?t||null:w?n||null:s?r||null:o||null;let a=e;return h||(a=tr(t,a),b)||(a=tr(n,a),w)||(a=tr(r,a),s)?a:tr(o,a)}function $h({children:e}){const{open:t,toggleOpen:n}=Mi();return i.jsx(Fi,{xs:i.jsx($a,{open:t,onClose:()=>n(!1),children:e}),md:i.jsx(Q,{children:e})})}const Uh=N.forwardRef(({loading:e,disabled:t,...n},r)=>i.jsx(Hn,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&i.jsx(ft,{size:"1em"})}));function wa({value:e,options:t,onChange:n,placeholder:r,...o}){var c;const d=N.useRef(null),h=Gn(),[b,w]=N.useState(!1),[s,a]=N.useState(e!==null?e:""),O=zt(h.breakpoints.down("sm"));N.useEffect(()=>{a(e!==null?e:"")},[e]);const x=N.useCallback(()=>{w(!1)},[]),S=N.useCallback(()=>{w(!0)},[]);function R(A){a(A.value),n(A.value),O&&x()}function _(A){return A===s}return i.jsxs(i.Fragment,{children:[i.jsxs(Wh,{ref:d,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Un(s)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary",borderRadius:"8px"},...o,children:[((c=t.find(A=>A.value===s))==null?void 0:c.name)||r,i.jsx(Ua,{className:"my-select__arrowdown",component:sa,sx:{width:18,height:18}})]}),i.jsx(Wa,{open:b,anchorEl:d.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:A,placement:H})=>i.jsx(za,{...A,style:{transformOrigin:H==="bottom"?"center top":"center bottom"},children:i.jsx(qa,{children:i.jsx(Ka,{onClickAway:x,children:i.jsx(zh,{autoFocusItem:b,onMouseEnter:S,onMouseLeave:x,children:t.map(U=>i.jsxs(Jr,{onClick:()=>R(U),sx:{fontSize:14},children:[i.jsx(is,{sx:{mr:1,fontSize:16,visibility:_(U.value)?"visible":"hidden"}}),U.name]},U.value))})})})})})]})}const Wh=Kt(Uh)`
486
486
  border: 1px solid #f0f0f0;
487
487
  padding: 6px 8px 6px 12px;
488
488
  font-weight: ${e=>e.theme.typography.fontWeightRegular};
@@ -510,7 +510,7 @@ see detail in https://www.npmjs.com/package/is-var-name
510
510
  margin-right: 3px;
511
511
  }
512
512
  }
513
- `,Gh=Kt(Yo)`
513
+ `,zh=Kt(Xo)`
514
514
  .my-select__option__icon {
515
515
  color: transparent;
516
516
  font-size: 14px;
@@ -526,7 +526,7 @@ see detail in https://www.npmjs.com/package/is-var-name
526
526
  color: ${e=>e.theme.palette.primary.main};
527
527
  }
528
528
  }
529
- `;function Ta(){const{search:e,t}=tt(),{filters:n,handleSort:r,handlePrice:o}=e,c=va(t);return i.jsxs(et,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[i.jsx(Yr,{control:i.jsx(Jr,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:d=>o(d.target.checked?"free":"")}),label:t("blocklet.free")}),i.jsx(Sa,{value:n.sortBy||c[0].value,options:c,onChange:d=>r(d),placeholder:t("sort.sort")})]})}function Hh({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:o,loadings:c,layout:d,baseSearch:h}=tt(),{filters:b,handleActiveMenu:w,handleCategory:s,cleanFilter:a}=n,{toggleOpen:O}=Fi();N.useEffect(()=>{O(!1)},[Object.values(b).join("")]);const x=Nh(h,d.showSearch,b.keyword);return d.showCategory?i.jsxs(qh,{children:[i.jsx(Bi,{xs:i.jsxs(et,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[i.jsx(Ea,{onClick:()=>O(!1),children:i.jsx(ri,{})}),i.jsx(me,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),i.jsx(et,{visibility:c.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:x?i.jsxs(i.Fragment,{children:[d.showExplore&&i.jsxs(Q,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[i.jsxs(Q,{display:"flex",alignItems:"center",gap:1,children:[i.jsx(st,{icon:rh,width:20,height:20}),i.jsx(me,{variant:"body1",color:!t&&!b.menu?"text.primary":"text.lighter",fontWeight:!t&&!b.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{O(!1),a()},children:r("explore.title")})]}),e==null?void 0:e.map(S=>i.jsxs(Q,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?i.jsx(st,{icon:S.icon,width:20,height:20}):S.icon,i.jsx(me,{variant:"body1",color:b.menu===S.key?"text.primary":"text.lighter",fontWeight:b.menu===S.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var R;O(!1),w(S.key),(R=S.onClick)==null||R.call(S)},children:S.title})]},S.key))]}),!!o.length&&i.jsx(et,{gap:2,children:o.map(S=>i.jsx(me,{variant:"body1",title:S.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===S.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{t===S.value?a():s(S.value),O(!1)},children:S.name},S.value))})]}):i.jsx(Ta,{})})]}):null}function $i(){const{endpoint:e,serverVersion:t,storeVersion:n}=tt(),r=ba(t,n),o=N.useMemo(()=>rs({baseURL:e,headers:r}),[e]);return{get:async c=>{const{data:d}=await o.get(c);return d},post:async(c,d)=>{const{data:h}=await o.post(c,d);return h}}}const ja=N.memo(function(e){return i.jsx(Q,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:i.jsx(ft,{})})});function Lo({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&i.jsxs(et,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,i.jsx(me,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Xh=16/9,Ar=292,Xr=189,lr=336;function Yh(){var e,t;const{t:n,search:r}=tt(),{get:o}=$i(),c=Gn(),d=zt(c.breakpoints.down("md")),h=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:b=[],error:w,loading:s}=Xn(async()=>{const A=await o(ii(pt.blockletsPath,{didList:h.map(H=>H.did).join(",")}));return A!=null&&A.dataList?h.map(H=>A.dataList.find(U=>U.did===H.did)):[]});w&&console.error("Get Banner Blocklets error:",w);const a={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!w&&h.length>0?i.jsxs(i.Fragment,{children:[i.jsx(me,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),i.jsx(Q,{height:{xs:"auto",md:Ar},minHeight:Ar,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:s?i.jsxs(Q,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[i.jsx(Wt,{variant:"rounded",height:Xr,width:lr}),i.jsxs(Q,{flex:1,height:"100%",children:[i.jsx(Wt,{variant:"text",height:50,width:100}),i.jsx(Wt,{variant:"text",height:40,width:"100%"}),i.jsx(Wt,{variant:"text",height:40,width:300}),i.jsxs(Q,{display:"flex",gap:1,my:2,children:[i.jsx(Wt,{variant:"circular",height:20,width:20}),i.jsx(Wt,{variant:"text",height:20,width:50})]}),i.jsx(Wt,{variant:"rounded",height:30,width:100})]})]}):i.jsx(lh,{showNav:!0,autoPlay:!0,slideDuration:d?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:A=>i.jsx(Q,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(dc,{sx:{...a,left:5}})}),renderRightNav:A=>i.jsx(Q,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(hc,{sx:{...a,right:5}})}),items:h.map((A,H)=>({original:A.did,renderItem:()=>{var U;const X=b[H]||{},j=A.cover||Qh(A.did,(U=X.screenshots)==null?void 0:U[0]),W=ya(j,c.breakpoints.values.md*2);return i.jsxs(et,{height:{xs:"auto",md:Ar},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${W}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(X),gap:{xs:2,md:5},children:[O(W),i.jsxs(et,{flex:1,height:"100%",gap:3,children:[i.jsxs(Q,{flex:1,children:[x(A.name||X.title||A.name),S(A.desc||X.description)]}),X.did&&R(X,A.baseNum),L(X)]})]})}}))})})]}):null;function O(A){return i.jsx(Q,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:lr},children:i.jsx(Zh,{url:A})})}function x(A){return i.jsx(me,{variant:"h2",width:"100%",children:A})}function S(A){return i.jsx(me,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:A})}function R(A,H=0){const{did:U,owner:X,stats:j}=A;return i.jsxs(Q,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(Lo,{icon:i.jsx(sr,{src:X.avatar,did:U,size:20,variant:"circle"}),children:X.fullName}),i.jsx(Lo,{icon:i.jsx(st,{icon:aa}),title:`${j.downloads+H}`,children:Jh(j.downloads+H)})]})}function L(A){return i.jsx(Hn,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(A),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Jh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,Qh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Zh({url:e}){const[t,n]=N.useState(!0);return i.jsxs(i.Fragment,{children:[t&&i.jsx(Wt,{variant:"rectangular",sx:{width:{xs:"100%",md:lr},height:{xs:"auto",md:Xr}}}),i.jsx(Q,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:lr},height:{xs:"auto",md:Xr},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Xh},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function ep({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=tt();return i.jsxs(Q,{mt:3,children:[i.jsx(me,{component:"h3",variant:"h3",sx:{mb:2},children:e}),i.jsx(Yi,{container:!0,spacing:2,children:t.map(o=>i.jsx(Yi,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":o.did,children:i.jsx(Q,{padding:"1px",children:n({blocklet:o,blocklets:t,serverVersion:r})})},o.did))})]})}function tp(){const{get:e}=$i(),{t}=tt(),{data:n=[],error:r,loading:o}=Xn(async()=>{const c=await e(pt.explorePath);return Array.isArray(c)?c:[]});return r?i.jsx(pr,{error:new Error(`Failed to fetch blocklets from ${pt.explorePath}`)}):o?i.jsx(ja,{mt:15}):i.jsxs(i.Fragment,{children:[i.jsx(Yh,{}),n.map(c=>{var d;return((d=c.blocklets)==null?void 0:d.length)>0?i.jsx(ep,{title:t(`explore.${c.type}`),blocklets:c.blocklets},c.type):null})]})}const Dr="__FREE_TEXT__",No="__NO_RESULT__",Mr=40;function np({endpoint:e,t,locale:n,filters:r,handleKeyword:o,handleSearchSelect:c,...d}){const h=N.useRef(null),b=N.useRef(!1),[w,s]=N.useState(!1),[a,O]=N.useState(""),[x,S]=N.useState(!1),R=$i(),[L,A]=N.useState(!1),H=(d==null?void 0:d.placeholder)||t("common.searchStore"),U=async ee=>{A(!0);const pe=await R.get(qn(e,ii(pt.blockletsPath,ee)));return A(!1),pe.dataList||[]},{data:X,run:j}=Xn(ee=>ee?U({sortBy:pt.nameDesc,page:1,pageSize:10,keyword:ee,showResources:"true"}):Promise.resolve([]),{manual:!0});N.useEffect(()=>{A(!0),j(r.keyword),O(r.keyword||"")},[r.keyword,j]),Ih("ctrl + k, command + k",ee=>{var pe,q;return ee.stopPropagation(),ee.preventDefault(),(q=(pe=h.current)==null?void 0:pe.querySelector("input"))==null||q.focus(),!1},{enableOnTags:["INPUT"]});const W=us(ee=>j(ee),{wait:300}),Z={name:Dr,title:a,did:""};let F=[];return a&&(L?F=[Z]:X!=null&&X.length?F=[Z,...X]:F=[{name:No,title:t("blocklet.noResults"),did:""}]),i.jsxs(i.Fragment,{children:[i.jsxs(Ha,{fullScreen:!0,open:x,sx:{display:{md:"none"}},children:[i.jsxs(Q,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[i.jsx(Jo,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:H,className:"bl-autocomplete-input",value:a,onChange:ee=>ce(ee.target.value),startAdornment:Ue(x),endAdornment:nt()}),i.jsx(Hn,{variant:"outlined",onClick:()=>{S(!1),O(r.keyword||"")},children:t("common.cancel")})]}),i.jsx(Yo,{sx:{p:.5},children:F.map(ee=>Se(ee))})]}),i.jsx(ir,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),i.jsx(zo,{ref:h,open:!!a&&w,size:"small",onOpen:()=>s(!0),onClose:(ee,pe)=>{s(!1),pe==="selectOption"&&!b.current&&o(a)},onKeyDown:ee=>{ee.key==="Enter"&&!a&&Y()},disableClearable:!0,inputValue:a,onInputChange:(ee,pe)=>ce(pe),isOptionEqualToValue:(ee,pe)=>ee.name===pe.name,getOptionLabel:ee=>ee.title,getOptionKey:ee=>ee.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:ee=>i.jsx(ur,{...ee,InputProps:{...ee.InputProps,autoFocus:!0,placeholder:H,className:"bl-autocomplete-input",value:a,startAdornment:Ue(w),endAdornment:nt()}}),filterOptions:ee=>ee,...d,options:F,renderOption:(ee,pe)=>Se(pe),value:Z,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(d.sx)?d.sx:[d.sx]]})]});function ce(ee){A(!0),O(ee),b.current=!1,W.run(ee)}function Y(){S(!1),O(""),ce(""),o("")}function ae(ee){ee!=null&&ee.did?(S(!1),b.current=!0,O(""),c(ee)):ee.name===Dr&&(S(!1),o(a))}function Se(ee){var pe,q;return i.jsxs(Qr,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ae(ee),children:[Fe(ee),i.jsxs(me,{variant:"body1",children:[i.jsx(me,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:ee.title}),i.jsx(me,{sx:{color:"text.lighter"},fontSize:"13px",children:((q=(pe=ee.category)==null?void 0:pe.locales)==null?void 0:q[n||"en"])||""})]})]},ee.did)}function Fe(ee){if([Dr,No].includes(ee.name))return i.jsx(Q,{width:Mr,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:i.jsx(ir,{sx:{fontSize:28}})});let pe="";return ee.logo&&(pe=qn(e,"assets",ee.did,ya(ee.logo,Mr,ee.version))),i.jsx(sr,{src:pe,size:Mr,style:{borderRadius:"8px",overflow:"hidden"}})}function Ue(ee=!0){return i.jsx(Q,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:ee&&a&&L?i.jsx(ft,{color:"inherit",size:16}):i.jsx(ir,{sx:{fontSize:16,cursor:"default"}})})}function nt(){return a?i.jsx(Q,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:i.jsx(ri,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>Y()})}):null}}function rp({placeholder:e="Type to search...",...t}){const{search:n}=tt(),{filters:r,handleKeyword:o}=n,[c,d]=N.useState(r.keyword||""),h=us(o,{wait:300}),b=s=>{const{value:a}=s.target;d(a),h.run(a)},w=()=>{d(""),o("")};return N.useEffect(()=>{d(r.keyword||"")},[r.keyword]),i.jsx(ip,{inputProps:{"data-cy":"search-blocklet"},startAdornment:i.jsx(Qi,{position:"start",children:i.jsx(op,{})}),onChange:b,placeholder:e,value:c,title:e,"data-cy":"search",endAdornment:c&&i.jsx(Qi,{position:"end",children:i.jsx(sp,{"data-cy":"search-delete",onClick:w})}),...t})}const ip=Kt(Jo)`
529
+ `;function Ea(){const{search:e,t}=tt(),{filters:n,handleSort:r,handlePrice:o}=e,c=ma(t);return i.jsxs(et,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[i.jsx(Xr,{control:i.jsx(Yr,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:d=>o(d.target.checked?"free":"")}),label:t("blocklet.free")}),i.jsx(wa,{value:n.sortBy||c[0].value,options:c,onChange:d=>r(d),placeholder:t("sort.sort")})]})}function qh({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:o,loadings:c,layout:d,baseSearch:h}=tt(),{filters:b,handleActiveMenu:w,handleCategory:s,cleanFilter:a}=n,{toggleOpen:O}=Mi();N.useEffect(()=>{O(!1)},[Object.values(b).join("")]);const x=Ih(h,d.showSearch,b.keyword);return d.showCategory?i.jsxs($h,{children:[i.jsx(Fi,{xs:i.jsxs(et,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[i.jsx(xa,{onClick:()=>O(!1),children:i.jsx(ri,{})}),i.jsx(me,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),i.jsx(et,{visibility:c.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:x?i.jsxs(i.Fragment,{children:[d.showExplore&&i.jsxs(Q,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[i.jsxs(Q,{display:"flex",alignItems:"center",gap:1,children:[i.jsx(st,{icon:Zd,width:20,height:20}),i.jsx(me,{variant:"body1",color:!t&&!b.menu?"text.primary":"text.lighter",fontWeight:!t&&!b.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{O(!1),a()},children:r("explore.title")})]}),e==null?void 0:e.map(S=>i.jsxs(Q,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?i.jsx(st,{icon:S.icon,width:20,height:20}):S.icon,i.jsx(me,{variant:"body1",color:b.menu===S.key?"text.primary":"text.lighter",fontWeight:b.menu===S.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var R;O(!1),w(S.key),(R=S.onClick)==null||R.call(S)},children:S.title})]},S.key))]}),!!o.length&&i.jsx(et,{gap:2,children:o.map(S=>i.jsx(me,{variant:"body1",title:S.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===S.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{t===S.value?a():s(S.value),O(!1)},children:S.name},S.value))})]}):i.jsx(Ea,{})})]}):null}function Bi(){const{endpoint:e,serverVersion:t,storeVersion:n}=tt(),r=va(t,n),o=N.useMemo(()=>ns({baseURL:e,headers:r}),[e]);return{get:async c=>{const{data:d}=await o.get(c);return d},post:async(c,d)=>{const{data:h}=await o.post(c,d);return h}}}const Sa=N.memo(function(e){return i.jsx(Q,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:i.jsx(ft,{})})});function Lo({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&i.jsxs(et,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,i.jsx(me,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Kh=16/9,_r=292,Gr=189,lr=336;function Vh(){var e,t;const{t:n,search:r}=tt(),{get:o}=Bi(),c=Gn(),d=zt(c.breakpoints.down("md")),h=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:b=[],error:w,loading:s}=Xn(async()=>{const A=await o(ii(pt.blockletsPath,{didList:h.map(H=>H.did).join(",")}));return A!=null&&A.dataList?h.map(H=>A.dataList.find(U=>U.did===H.did)):[]});w&&console.error("Get Banner Blocklets error:",w);const a={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!w&&h.length>0?i.jsxs(i.Fragment,{children:[i.jsx(me,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),i.jsx(Q,{height:{xs:"auto",md:_r},minHeight:_r,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:s?i.jsxs(Q,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[i.jsx(Wt,{variant:"rounded",height:Gr,width:lr}),i.jsxs(Q,{flex:1,height:"100%",children:[i.jsx(Wt,{variant:"text",height:50,width:100}),i.jsx(Wt,{variant:"text",height:40,width:"100%"}),i.jsx(Wt,{variant:"text",height:40,width:300}),i.jsxs(Q,{display:"flex",gap:1,my:2,children:[i.jsx(Wt,{variant:"circular",height:20,width:20}),i.jsx(Wt,{variant:"text",height:20,width:50})]}),i.jsx(Wt,{variant:"rounded",height:30,width:100})]})]}):i.jsx(ih,{showNav:!0,autoPlay:!0,slideDuration:d?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:A=>i.jsx(Q,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(uc,{sx:{...a,left:5}})}),renderRightNav:A=>i.jsx(Q,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(dc,{sx:{...a,right:5}})}),items:h.map((A,H)=>({original:A.did,renderItem:()=>{var U;const X=b[H]||{},j=A.cover||Hh(A.did,(U=X.screenshots)==null?void 0:U[0]),W=ga(j,c.breakpoints.values.md*2);return i.jsxs(et,{height:{xs:"auto",md:_r},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${W}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(X),gap:{xs:2,md:5},children:[O(W),i.jsxs(et,{flex:1,height:"100%",gap:3,children:[i.jsxs(Q,{flex:1,children:[x(A.name||X.title||A.name),S(A.desc||X.description)]}),X.did&&R(X,A.baseNum),_(X)]})]})}}))})})]}):null;function O(A){return i.jsx(Q,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:lr},children:i.jsx(Xh,{url:A})})}function x(A){return i.jsx(me,{variant:"h2",width:"100%",children:A})}function S(A){return i.jsx(me,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:A})}function R(A,H=0){const{did:U,owner:X,stats:j}=A;return i.jsxs(Q,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(Lo,{icon:i.jsx(sr,{src:X.avatar,did:U,size:20,variant:"circle"}),children:X.fullName}),i.jsx(Lo,{icon:i.jsx(st,{icon:oa}),title:`${j.downloads+H}`,children:Gh(j.downloads+H)})]})}function _(A){return i.jsx(Hn,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(A),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Gh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,Hh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Xh({url:e}){const[t,n]=N.useState(!0);return i.jsxs(i.Fragment,{children:[t&&i.jsx(Wt,{variant:"rectangular",sx:{width:{xs:"100%",md:lr},height:{xs:"auto",md:Gr}}}),i.jsx(Q,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:lr},height:{xs:"auto",md:Gr},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Kh},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Yh({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=tt();return i.jsxs(Q,{mt:3,children:[i.jsx(me,{component:"h3",variant:"h3",sx:{mb:2},children:e}),i.jsx(Xi,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(o=>i.jsx(Xi,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":o.did,children:i.jsx(Q,{padding:"1px",children:n({blocklet:o,blocklets:t,serverVersion:r})})},o.did))})]})}function Jh(){const{get:e}=Bi(),{t}=tt(),{data:n=[],error:r,loading:o}=Xn(async()=>{const c=await e(pt.explorePath);return Array.isArray(c)?c:[]});return r?i.jsx(dr,{error:new Error(`Failed to fetch blocklets from ${pt.explorePath}`)}):o?i.jsx(Sa,{mt:15}):i.jsxs(i.Fragment,{children:[i.jsx(Vh,{}),n.map(c=>{var d;return((d=c.blocklets)==null?void 0:d.length)>0?i.jsx(Yh,{title:t(`explore.${c.type}`),blocklets:c.blocklets},c.type):null})]})}const Nr="__FREE_TEXT__",_o="__NO_RESULT__",Ar=40;function Qh({endpoint:e,t,locale:n,filters:r,handleKeyword:o,handleSearchSelect:c,...d}){const h=N.useRef(null),b=N.useRef(!1),[w,s]=N.useState(!1),[a,O]=N.useState(""),[x,S]=N.useState(!1),R=Bi(),[_,A]=N.useState(!1),H=(d==null?void 0:d.placeholder)||t("common.searchStore"),U=async ee=>{A(!0);const pe=await R.get(qn(e,ii(pt.blockletsPath,ee)));return A(!1),pe.dataList||[]},{data:X,run:j}=Xn(ee=>ee?U({sortBy:pt.nameDesc,page:1,pageSize:10,keyword:ee,showResources:"true"}):Promise.resolve([]),{manual:!0});N.useEffect(()=>{A(!0),j(r.keyword),O(r.keyword||"")},[r.keyword,j]),Oh("ctrl + k, command + k",ee=>{var pe,q;return ee.stopPropagation(),ee.preventDefault(),(q=(pe=h.current)==null?void 0:pe.querySelector("input"))==null||q.focus(),!1},{enableOnTags:["INPUT"]});const W=cs(ee=>j(ee),{wait:300}),Z={name:Nr,title:a,did:""};let F=[];return a&&(_?F=[Z]:X!=null&&X.length?F=[Z,...X]:F=[{name:_o,title:t("blocklet.noResults"),did:""}]),i.jsxs(i.Fragment,{children:[i.jsxs(Va,{fullScreen:!0,open:x,sx:{display:{md:"none"}},children:[i.jsxs(Q,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[i.jsx(Yo,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:H,className:"bl-autocomplete-input",value:a,onChange:ee=>ce(ee.target.value),startAdornment:Ue(x),endAdornment:nt()}),i.jsx(Hn,{variant:"outlined",onClick:()=>{S(!1),O(r.keyword||"")},children:t("common.cancel")})]}),i.jsx(Xo,{sx:{p:.5},children:F.map(ee=>Se(ee))})]}),i.jsx(ir,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),i.jsx(Wo,{ref:h,open:!!a&&w,size:"small",onOpen:()=>s(!0),onClose:(ee,pe)=>{s(!1),pe==="selectOption"&&!b.current&&o(a)},onKeyDown:ee=>{ee.key==="Enter"&&!a&&Y()},disableClearable:!0,inputValue:a,onInputChange:(ee,pe)=>ce(pe),isOptionEqualToValue:(ee,pe)=>ee.name===pe.name,getOptionLabel:ee=>ee.title,getOptionKey:ee=>ee.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:ee=>i.jsx(cr,{...ee,InputProps:{...ee.InputProps,autoFocus:!0,placeholder:H,className:"bl-autocomplete-input",value:a,startAdornment:Ue(w),endAdornment:nt()}}),filterOptions:ee=>ee,...d,options:F,renderOption:(ee,pe)=>Se(pe),value:Z,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(d.sx)?d.sx:[d.sx]]})]});function ce(ee){A(!0),O(ee),b.current=!1,W.run(ee)}function Y(){S(!1),O(""),ce(""),o("")}function ae(ee){ee!=null&&ee.did?(S(!1),b.current=!0,O(""),c(ee)):ee.name===Nr&&(S(!1),o(a))}function Se(ee){var pe,q;return i.jsxs(Jr,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ae(ee),children:[Fe(ee),i.jsxs(me,{variant:"body1",children:[i.jsx(me,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:ee.title}),i.jsx(me,{sx:{color:"text.lighter"},fontSize:"13px",children:((q=(pe=ee.category)==null?void 0:pe.locales)==null?void 0:q[n||"en"])||""})]})]},ee.did)}function Fe(ee){if([Nr,_o].includes(ee.name))return i.jsx(Q,{width:Ar,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:i.jsx(ir,{sx:{fontSize:28}})});let pe="";return ee.logo&&(pe=qn(e,"assets",ee.did,ga(ee.logo,Ar,ee.version))),i.jsx(sr,{src:pe,size:Ar,style:{borderRadius:"8px",overflow:"hidden"}})}function Ue(ee=!0){return i.jsx(Q,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:ee&&a&&_?i.jsx(ft,{color:"inherit",size:16}):i.jsx(ir,{sx:{fontSize:16,cursor:"default"}})})}function nt(){return a?i.jsx(Q,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:i.jsx(ri,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>Y()})}):null}}function Zh({placeholder:e="Type to search...",...t}){const{search:n}=tt(),{filters:r,handleKeyword:o}=n,[c,d]=N.useState(r.keyword||""),h=cs(o,{wait:300}),b=s=>{const{value:a}=s.target;d(a),h.run(a)},w=()=>{d(""),o("")};return N.useEffect(()=>{d(r.keyword||"")},[r.keyword]),i.jsx(ep,{inputProps:{"data-cy":"search-blocklet"},startAdornment:i.jsx(Ji,{position:"start",children:i.jsx(tp,{})}),onChange:b,placeholder:e,value:c,title:e,"data-cy":"search",endAdornment:c&&i.jsx(Ji,{position:"end",children:i.jsx(np,{"data-cy":"search-delete",onClick:w})}),...t})}const ep=Kt(Yo)`
530
530
  background-color: ${e=>e.theme.palette.grey[50]};
531
531
  font-size: 14px;
532
532
  border-radius: 6px;
@@ -543,23 +543,23 @@ see detail in https://www.npmjs.com/package/is-var-name
543
543
  color: transparent;
544
544
  }
545
545
  }
546
- `,op=Kt(ir)`
546
+ `,tp=Kt(ir)`
547
547
  color: ${e=>e.theme.palette.grey[500]};
548
548
  font-size: 28px;
549
549
  @media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
550
550
  font-size: 24px;
551
551
  }
552
- `,sp=Kt(ri)`
552
+ `,np=Kt(ri)`
553
553
  color: ${e=>e.theme.palette.grey[500]};
554
554
  font-size: 16px;
555
555
  cursor: pointer;
556
- `;function ap(){const{search:e,t,endpoint:n,locale:r,getCategoryLocale:o,developerName:c,showResourcesSwitch:d,layout:h,baseSearch:b}=tt(),{filters:w,handleSort:s,handlePrice:a,handleDeveloper:O,handleSwitchShowResources:x,cleanFilter:S}=e,R=va(t);return i.jsxs(et,{className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:3,children:[i.jsx(me,{variant:"h2",textTransform:"capitalize",children:o(w.category)}),i.jsxs(et,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[h.showSearch?i.jsx(Q,{flex:1,children:b?i.jsx(rp,{}):i.jsx(np,{locale:r,endpoint:n,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,w.owner&&c&&i.jsx(Ji,{label:t("blocklet.authorTag",{name:c}),size:"small",onDelete:()=>O("")}),w.resourceDid&&w.resourceBlocklet&&i.jsx(Ji,{label:t("blocklet.resourceTag",{name:w.resourceBlocklet}),size:"small",onDelete:()=>S(["resourceDid","resourceBlocklet","showResources"])}),d?i.jsx(Ao,{checked:w.showResources!=="false",onChange:L=>x(L?"true":"false"),label:t("common.showResources")}):null,i.jsx(Ao,{checked:w.price==="free",onChange:L=>a(L?"free":""),label:t("blocklet.free")}),i.jsx(Sa,{value:w.sortBy||R[0].value,options:R,placeholder:t("sort.sort"),onChange:L=>s(L)})]})]})}function Ao({checked:e,onChange:t,label:n}){return i.jsx(Yr,{sx:{m:0,p:0},className:"check-button",control:i.jsx(Jr,{checked:e,icon:i.jsx(st,{style:{padding:0},icon:vh}),checkedIcon:i.jsx(st,{style:{padding:0,color:"#3478E2"},icon:yh}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function nr({children:e}){return i.jsxs(Q,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[i.jsx(ul,{}),e]})}function Do(){const{t:e}=tt();return i.jsx(me,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Fr({filterTip:e,keywordTip:t}){const{t:n,locale:r}=tt(),o=()=>r==="zh"?"、":" , ";return i.jsxs(Q,{mt:1,display:"flex",children:[i.jsx(me,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&i.jsx(me,{children:n("blocklet.filterTip")}),e&&t&&o(),t&&i.jsx(me,{children:n("blocklet.keywordTip")})]})}function Br({primaryStart:e,primaryEnd:t,filter:n}){return i.jsxs(me,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[i.jsx(me,{children:e}),i.jsx(me,{color:"primary",children:n}),i.jsxs(me,{children:[t," "]})]})}function lp(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=tt(),{filters:o}=t,c=!!r||!!o.price;if(o.keyword&&c)return i.jsxs(nr,{children:[i.jsx(Br,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Fr,{keywordTip:!0,filterTip:!0})]});if(o.keyword)return i.jsxs(nr,{children:[i.jsx(Br,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Fr,{keywordTip:!0})]});if(c){const d=n(r);return i.jsxs(nr,{children:[d?i.jsx(Br,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:d}):i.jsx(Do,{}),i.jsx(Fr,{filterTip:!0})]})}return i.jsx(nr,{children:i.jsx(Do,{})})}const cp=(e,t,n,r)=>Jl(async o=>{o||(n.currentPage=n.defaultCurrentPage);const{currentPage:c,pageSize:d}=n,h={...t,category:t.category==="All"?"":t.category,sortBy:pt[t.sortBy],page:c,pageSize:d};r(null);const{data:b={}}=await e.get(pt.blockletsPath,{params:h});return n.currentPage++,{page:c,pageSize:d,list:(b==null?void 0:b.dataList)||[],total:(b==null?void 0:b.total)||0}},{isNoMore:o=>o?o.page*o.pageSize>=o.total:!1,reloadDeps:[e,dl(t)],onError:r});function up(){var e;const{storeApi:t,search:n,extraFilter:r,errors:o,updateDeveloperName:c}=tt(),{filters:d}=n,h=Yl({currentPage:pt.currentPage,pageSize:Fh()?pt.mobilePageSize:pt.pageSize,defaultCurrentPage:pt.defaultCurrentPage}),[b,w]=N.useState(null),s=cp(t,d,h,w),a=N.useMemo(()=>{var O,x;return r?r(((O=s.data)==null?void 0:O.list)||[]):((x=s.data)==null?void 0:x.list)||[]},[s.data,r]);return N.useEffect(()=>{const O=a.find(x=>x.owner.did===d.owner);c((O==null?void 0:O.owner.fullName)||(O==null?void 0:O.author.name)||"")},[d.owner,a,c]),{blocklets:a,fetchBlockletsError:b,loadMore:s.loadMore,hasNextPage:!s.noMore,total:((e=s.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:s.loading,loadingMore:s.loadingMore},errors:{...o,fetchBlockletsError:b}}}function dp(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:o,minItemWidth:c,layout:d,baseSearch:h}=tt(),{filters:b}=t,{blocklets:w,errors:s,loadMore:a,loadings:O,hasNextPage:x,total:S}=up(),[R]=gh({loading:O.fetchBlockletsLoading||O.loadingMore,hasNextPage:x,onLoadMore:a});if(s.fetchBlockletsError){const U=new Error(`Failed to fetch blocklets from ${n}: ${s.fetchBlockletsError.message}`);return i.jsx(pr,{error:U})}const L=h&&d.showSearch||!b.keyword;return i.jsxs(i.Fragment,{children:[L?i.jsx(ap,{}):i.jsxs(i.Fragment,{children:[i.jsx(Bi,{xs:i.jsx(Ta,{}),md:null}),H()]}),A(),!O.fetchBlockletsLoading&&x&&i.jsx(Q,{height:60,display:"flex",justifyContent:"center",py:2,ref:R,children:i.jsx(ft,{})})]});function A(){return O.fetchBlockletsLoading?i.jsx(ja,{mt:15}):w.length?i.jsx(Q,{className:"blocklet-list",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${c}px, 1fr))`,p:"2px",gap:2,children:w.map(U=>i.jsx(Q,{"data-blocklet-did":U.did,sx:{minWidth:c},children:r({blocklet:U,blocklets:w,serverVersion:o})},U.did))}):i.jsx(lp,{})}function H(){return i.jsxs(et,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[i.jsx(me,{variant:"h3",children:e("blocklet.search",{keyword:b.keyword})}),i.jsx(me,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:S})})]})}}function hp(){const{t:e,selectedCategory:t,getCategoryLocale:n}=tt(),{toggleOpen:r}=Fi();return i.jsxs(me,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[i.jsx(Ea,{onClick:()=>r(!0),children:i.jsx(cl,{})}),n(t)||e("common.category")]})}function pp({menus:e,children:t}){var n;const{search:r,layout:o}=tt(),{filters:c}=r,d=c.category||c.keyword||c.price,h=(n=e==null?void 0:e.find(b=>b.key===c.menu))==null?void 0:n.key;return i.jsx(Ph,{children:i.jsxs(is,{FallbackComponent:pr,children:[i.jsx(hp,{}),i.jsxs(Q,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[i.jsx(Hh,{menus:e}),i.jsxs(et,{height:"100%",position:"relative",flex:1,overflow:"visible",children:[h&&(t==null?void 0:t(h)),!h&&(o.showExplore&&!d?i.jsx(tp,{}):i.jsx(dp,{}))]})]})]})})}function fp(e){const{menus:t,children:n,...r}=e,o=Gn(),c=Ho(Il({...o,typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return i.jsx(Xo,{theme:c,children:i.jsx(zh,{...r,children:i.jsx(pp,{menus:t,children:n})})})}const mp={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},gp=mp;var Ui={},vp=cr;Object.defineProperty(Ui,"__esModule",{value:!0});var Oa=Ui.default=void 0,yp=vp(dr()),bp=i;Oa=Ui.default=(0,yp.default)((0,bp.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const xp=(e,t)=>!t||!e?!0:Ur.satisfies(Ur.coerce(e),t);function Wi({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:o}=mt();return xp(t,n)?e:i.jsx(Go,{title:o("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:i.jsx(me,{children:i.jsx(Hn,{disabled:!0,variant:"outlined",...r,children:o("common.upgradeServer")})})})}Wi.propTypes={children:_.node.isRequired,serverVersion:_.string,requirementVersion:_.string};Wi.defaultProps={serverVersion:"",requirementVersion:""};const $n=getComputedStyle(document.documentElement),wp=Ho({palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:$n.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:$n.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:$n.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:$n.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:$n.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{fontSize:14,button:{textTransform:"none"},allVariants:{textTransform:"none"},h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),Ep=(e,t)=>qn(t,`/blocklets/${e.did}`),Mo=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Sp=e=>e.inStore&&At.isFreeBlocklet(e)===!1;function zi({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:o}){var A,H;const{t:c}=mt();let d=qn(r,Sl(e.did,e.logo||""));try{const U=new URL(d);U.searchParams.set("v",e.version||+new Date),d=U.href}catch{}const[h,b]=N.useState(!1),w=U=>U.currentTarget.contains(U.target)?!0:(U.preventDefault(),!1),s=async U=>{U.preventDefault(),U.stopPropagation();try{b(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(X){ni.error(X.message)}finally{b(!1)}},{blocklet:a}=fr(),O=()=>((a==null?void 0:a.children)||[]).find(j=>j.meta.bundleDid===e.did).meta.version,S=(()=>{const U=((a==null?void 0:a.children)||[]).find(X=>X.meta.bundleDid===e.did);if(U){try{const X=U.meta.version,j=e.version;if(Ur.gt(j,X))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let R=c("blocklet.component.choose");S==="upgrade"?R=c("blocklet.component.upgrade"):S==="disable"?R=c("blocklet.component.installed"):Sp(e)&&(R=c("common.purchase"));const L=(A=e.requirements)==null?void 0:A.server;return i.jsx(Xa,{href:Ep(e,r),style:{color:"initial",textDecoration:"none"},onClick:w,target:"_blank",children:i.jsx(Tp,{title:Mo({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Mo({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?d:"",version:e.version,onButtonClick:null,icons:(H=e.docker)!=null&&H.image?[{key:"docker",icon:i.jsx(Q,{display:"flex",color:"primary.main",children:i.jsx(st,{icon:gp})}),title:c("blocklet.dockerImage")}]:[],button:i.jsx(Wi,{serverVersion:o,requirementVersion:L,size:"small",children:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:i.jsx(eh,{children:i.jsxs(ct,{onClick:s,size:"small",disabled:h||S==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:S==="upgrade"?`${O()} -> ${e.version}`:"",children:[h?i.jsxs(i.Fragment,{children:[i.jsx(ft,{size:16,style:{marginRight:3}}),R]}):R,S==="upgrade"?i.jsx(Oa,{style:{fontSize:"1.2rem"}}):null]},e.did)})})})})})}zi.propTypes={blocklet:_.object.isRequired,blocklets:_.array,handleButtonClick:_.func,endpoint:_.string,serverVersion:_.string};zi.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function qi({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:o,serverVersion:c,resourceType:d,resourceDid:h,showResourcesSwitch:b,showCategory:w,...s}){const{locale:a}=mt(),[O,x]=N.useState(!1),[S,R]=N.useState({}),L=H=>{R(H)},A=n;return N.useEffect(()=>{R({showResources:!0,resourceType:d,resourceDid:h})},[A,d,h]),N.useEffect(()=>{x(!0),R({showResources:!0,resourceType:d,resourceDid:h})},[]),i.jsx(Xo,{theme:wp,children:i.jsx(is,{FallbackComponent:pr,resetKeys:[A],children:i.jsxs(Q,{...s,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(s.sx)?s.sx:[s.sx]],children:[O&&i.jsx(fp,{showCategory:w,showResourcesSwitch:b,blockletRender:H=>{const U={...H,handleButtonClick:e,endpoint:A};return r({...H,defaultRender:i.jsx(zi,{...U})})},baseSearch:!0,endpoint:A,locale:a,onFilterChange:L,onSearchSelect:t,filters:S,extraFilter:o,serverVersion:c,fetchCategoryDelay:500}),i.jsx(Q,{sx:{mt:2},children:" "})]})})})}qi.propTypes={storeUrl:_.string.isRequired,handleButtonClick:_.func,handleSearchSelect:_.func,handleBlockletRender:_.func,extraFilter:_.func,serverVersion:_.string,resourceType:_.string,resourceDid:_.string,showResourcesSwitch:_.bool,showCategory:_.bool};qi.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const Tp=Ve(nh)`
556
+ `;function rp(){const{search:e,t,endpoint:n,locale:r,getCategoryLocale:o,developerName:c,showResourcesSwitch:d,layout:h,baseSearch:b}=tt(),{filters:w,handleSort:s,handlePrice:a,handleDeveloper:O,handleSwitchShowResources:x,cleanFilter:S}=e,R=ma(t);return i.jsxs(et,{className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:3,children:[i.jsx(me,{variant:"h2",textTransform:"capitalize",children:o(w.category)}),i.jsxs(et,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[h.showSearch?i.jsx(Q,{flex:1,children:b?i.jsx(Zh,{}):i.jsx(Qh,{locale:r,endpoint:n,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,w.owner&&c&&i.jsx(Yi,{label:t("blocklet.authorTag",{name:c}),size:"small",onDelete:()=>O("")}),w.resourceDid&&w.resourceBlocklet&&i.jsx(Yi,{label:t("blocklet.resourceTag",{name:w.resourceBlocklet}),size:"small",onDelete:()=>S(["resourceDid","resourceBlocklet","showResources"])}),d?i.jsx(No,{checked:w.showResources!=="false",onChange:_=>x(_?"true":"false"),label:t("common.showResources")}):null,i.jsx(No,{checked:w.price==="free",onChange:_=>a(_?"free":""),label:t("blocklet.free")}),i.jsx(wa,{value:w.sortBy||R[0].value,options:R,placeholder:t("sort.sort"),onChange:_=>s(_)})]})]})}function No({checked:e,onChange:t,label:n}){return i.jsx(Xr,{sx:{m:0,p:0},className:"check-button",control:i.jsx(Yr,{checked:e,icon:i.jsx(st,{style:{padding:0},icon:ph}),checkedIcon:i.jsx(st,{style:{padding:0,color:"#3478E2"},icon:fh}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function nr({children:e}){return i.jsxs(Q,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[i.jsx(ll,{}),e]})}function Ao(){const{t:e}=tt();return i.jsx(me,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Dr({filterTip:e,keywordTip:t}){const{t:n,locale:r}=tt(),o=()=>r==="zh"?"、":" , ";return i.jsxs(Q,{mt:1,display:"flex",children:[i.jsx(me,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&i.jsx(me,{children:n("blocklet.filterTip")}),e&&t&&o(),t&&i.jsx(me,{children:n("blocklet.keywordTip")})]})}function Mr({primaryStart:e,primaryEnd:t,filter:n}){return i.jsxs(me,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[i.jsx(me,{children:e}),i.jsx(me,{color:"primary",children:n}),i.jsxs(me,{children:[t," "]})]})}function ip(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=tt(),{filters:o}=t,c=!!r||!!o.price;if(o.keyword&&c)return i.jsxs(nr,{children:[i.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Dr,{keywordTip:!0,filterTip:!0})]});if(o.keyword)return i.jsxs(nr,{children:[i.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Dr,{keywordTip:!0})]});if(c){const d=n(r);return i.jsxs(nr,{children:[d?i.jsx(Mr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:d}):i.jsx(Ao,{}),i.jsx(Dr,{filterTip:!0})]})}return i.jsx(nr,{children:i.jsx(Ao,{})})}const op=(e,t,n,r)=>Xl(async o=>{o||(n.currentPage=n.defaultCurrentPage);const{currentPage:c,pageSize:d}=n,h={...t,category:t.category==="All"?"":t.category,sortBy:pt[t.sortBy],page:c,pageSize:d};r(null);const{data:b={}}=await e.get(pt.blockletsPath,{params:h});return n.currentPage++,{page:c,pageSize:d,list:(b==null?void 0:b.dataList)||[],total:(b==null?void 0:b.total)||0}},{isNoMore:o=>o?o.page*o.pageSize>=o.total:!1,reloadDeps:[e,cl(t)],onError:r});function sp(){var e;const{storeApi:t,search:n,extraFilter:r,errors:o,updateDeveloperName:c}=tt(),{filters:d}=n,h=Hl({currentPage:pt.currentPage,pageSize:Nh()?pt.mobilePageSize:pt.pageSize,defaultCurrentPage:pt.defaultCurrentPage}),[b,w]=N.useState(null),s=op(t,d,h,w),a=N.useMemo(()=>{var O,x;return r?r(((O=s.data)==null?void 0:O.list)||[]):((x=s.data)==null?void 0:x.list)||[]},[s.data,r]);return N.useEffect(()=>{const O=a.find(x=>x.owner.did===d.owner);c((O==null?void 0:O.owner.fullName)||(O==null?void 0:O.author.name)||"")},[d.owner,a,c]),{blocklets:a,fetchBlockletsError:b,loadMore:s.loadMore,hasNextPage:!s.noMore,total:((e=s.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:s.loading,loadingMore:s.loadingMore},errors:{...o,fetchBlockletsError:b}}}function ap(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:o,minItemWidth:c,layout:d,baseSearch:h}=tt(),{filters:b}=t,{blocklets:w,errors:s,loadMore:a,loadings:O,hasNextPage:x,total:S}=sp(),[R]=hh({loading:O.fetchBlockletsLoading||O.loadingMore,hasNextPage:x,onLoadMore:a});if(s.fetchBlockletsError){const U=new Error(`Failed to fetch blocklets from ${n}: ${s.fetchBlockletsError.message}`);return i.jsx(dr,{error:U})}const _=h&&d.showSearch||!b.keyword;return i.jsxs(i.Fragment,{children:[_?i.jsx(rp,{}):i.jsxs(i.Fragment,{children:[i.jsx(Fi,{xs:i.jsx(Ea,{}),md:null}),H()]}),A(),!O.fetchBlockletsLoading&&x&&i.jsx(Q,{height:60,display:"flex",justifyContent:"center",py:2,ref:R,children:i.jsx(ft,{})})]});function A(){return O.fetchBlockletsLoading?i.jsx(Sa,{mt:15}):w.length?i.jsx(Q,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${c}px, 1fr))`},p:"2px",gap:2,children:w.map(U=>i.jsx(Q,{"data-blocklet-did":U.did,minWidth:{xs:"100%",sm:c},maxWidth:"calc(100vw - 32px)",children:r({blocklet:U,blocklets:w,serverVersion:o})},U.did))}):i.jsx(ip,{})}function H(){return i.jsxs(et,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[i.jsx(me,{variant:"h3",children:e("blocklet.search",{keyword:b.keyword})}),i.jsx(me,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:S})})]})}}function lp(){const{t:e,selectedCategory:t,getCategoryLocale:n}=tt(),{toggleOpen:r}=Mi();return i.jsxs(me,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[i.jsx(xa,{onClick:()=>r(!0),children:i.jsx(al,{})}),n(t)||e("common.category")]})}function cp({menus:e,children:t}){var n;const{search:r,layout:o}=tt(),{filters:c}=r,d=c.category||c.keyword||c.price,h=(n=e==null?void 0:e.find(b=>b.key===c.menu))==null?void 0:n.key;return i.jsx(kh,{children:i.jsxs(rs,{FallbackComponent:dr,children:[i.jsx(lp,{}),i.jsxs(Q,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[i.jsx(qh,{menus:e}),i.jsxs(et,{height:"100%",position:"relative",flex:1,overflow:"visible",children:[h&&(t==null?void 0:t(h)),!h&&(o.showExplore&&!d?i.jsx(Jh,{}):i.jsx(ap,{}))]})]})]})})}function up(e){const{menus:t,children:n,...r}=e,o=Gn(),c=Go(Rl({...o,typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return i.jsx(Ho,{theme:c,children:i.jsx(Bh,{...r,children:i.jsx(cp,{menus:t,children:n})})})}const dp={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},hp=dp;var $i={},pp=Hr;Object.defineProperty($i,"__esModule",{value:!0});var Ta=$i.default=void 0,fp=pp(ei()),mp=i;Ta=$i.default=(0,fp.default)((0,mp.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const gp=(e,t)=>!t||!e?!0:Br.satisfies(Br.coerce(e),t);function Ui({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:o}=mt();return gp(t,n)?e:i.jsx(Vo,{title:o("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:i.jsx(me,{children:i.jsx(Hn,{disabled:!0,variant:"outlined",...r,children:o("common.upgradeServer")})})})}Ui.propTypes={children:L.node.isRequired,serverVersion:L.string,requirementVersion:L.string};Ui.defaultProps={serverVersion:"",requirementVersion:""};const $n=getComputedStyle(document.documentElement),vp=Go({palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:$n.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:$n.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:$n.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:$n.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:$n.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{fontSize:14,button:{textTransform:"none"},allVariants:{textTransform:"none"},h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),yp=(e,t)=>qn(t,`/blocklets/${e.did}`),Do=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,bp=e=>e.inStore&&At.isFreeBlocklet(e)===!1;function Wi({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:o}){var A,H;const{t:c}=mt();let d=qn(r,wl(e.did,e.logo||""));try{const U=new URL(d);U.searchParams.set("v",e.version||+new Date),d=U.href}catch{}const[h,b]=N.useState(!1),w=U=>U.currentTarget.contains(U.target)?!0:(U.preventDefault(),!1),s=async U=>{U.preventDefault(),U.stopPropagation();try{b(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(X){ni.error(X.message)}finally{b(!1)}},{blocklet:a}=hr(),O=()=>((a==null?void 0:a.children)||[]).find(j=>j.meta.bundleDid===e.did).meta.version,S=(()=>{const U=((a==null?void 0:a.children)||[]).find(X=>X.meta.bundleDid===e.did);if(U){try{const X=U.meta.version,j=e.version;if(Br.gt(j,X))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let R=c("blocklet.component.choose");S==="upgrade"?R=c("blocklet.component.upgrade"):S==="disable"?R=c("blocklet.component.installed"):bp(e)&&(R=c("common.purchase"));const _=(A=e.requirements)==null?void 0:A.server;return i.jsx(Ga,{href:yp(e,r),style:{color:"initial",textDecoration:"none"},onClick:w,target:"_blank",children:i.jsx(xp,{title:Do({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Do({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?d:"",version:e.version,onButtonClick:null,icons:(H=e.docker)!=null&&H.image?[{key:"docker",icon:i.jsx(Q,{display:"flex",color:"primary.main",children:i.jsx(st,{icon:hp})}),title:c("blocklet.dockerImage")}]:[],button:i.jsx(Ui,{serverVersion:o,requirementVersion:_,size:"small",children:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:i.jsx(Yd,{children:i.jsxs(ct,{onClick:s,size:"small",disabled:h||S==="disable",variant:"outlined",color:"primary","data-cy":"install-blocklet",title:S==="upgrade"?`${O()} -> ${e.version}`:"",children:[h?i.jsxs(i.Fragment,{children:[i.jsx(ft,{size:16,style:{marginRight:3}}),R]}):R,S==="upgrade"?i.jsx(Ta,{style:{fontSize:"1.2rem"}}):null]},e.did)})})})})})}Wi.propTypes={blocklet:L.object.isRequired,blocklets:L.array,handleButtonClick:L.func,endpoint:L.string,serverVersion:L.string};Wi.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function zi({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:o,serverVersion:c,resourceType:d,resourceDid:h,showResourcesSwitch:b,showCategory:w,...s}){const{locale:a}=mt(),[O,x]=N.useState(!1),[S,R]=N.useState({}),_=H=>{R(H)},A=n;return N.useEffect(()=>{R({showResources:!0,resourceType:d,resourceDid:h})},[A,d,h]),N.useEffect(()=>{x(!0),R({showResources:!0,resourceType:d,resourceDid:h})},[]),i.jsx(Ho,{theme:vp,children:i.jsx(rs,{FallbackComponent:dr,resetKeys:[A],children:i.jsxs(Q,{...s,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(s.sx)?s.sx:[s.sx]],children:[O&&i.jsx(up,{showCategory:w,showResourcesSwitch:b,blockletRender:H=>{const U={...H,handleButtonClick:e,endpoint:A};return r({...H,defaultRender:i.jsx(Wi,{...U})})},baseSearch:!0,endpoint:A,locale:a,onFilterChange:_,onSearchSelect:t,filters:S,extraFilter:o,serverVersion:c,fetchCategoryDelay:500}),i.jsx(Q,{sx:{mt:2},children:" "})]})})})}zi.propTypes={storeUrl:L.string.isRequired,handleButtonClick:L.func,handleSearchSelect:L.func,handleBlockletRender:L.func,extraFilter:L.func,serverVersion:L.string,resourceType:L.string,resourceDid:L.string,showResourcesSwitch:L.bool,showCategory:L.bool};zi.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const xp=Ve(Qd)`
557
557
  .ms-highlight {
558
558
  color: ${e=>e.theme.palette.primary.main};
559
559
  }
560
- `,Ki=N.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const{steps:o,activeStep:c,setActiveStepByKey:d,setActiveStepByIndex:h}=hl(),{t:b,locale:w}=mt(),s=o[c];return N.useEffect(()=>{n(c)},[n,c]),N.useImperativeHandle(r,()=>({setActiveStepByKey:d,setActiveStepByIndex:h})),i.jsx(Op,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:i.jsx(pl,{locale:w,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?Tl({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,stepTip:b("blocklet.component.add"),children:i.jsx(jp,{children:typeof(s==null?void 0:s.body)=="function"?s.body():s==null?void 0:s.body})})})});Ki.propTypes={meta:_.any,onStepChange:_.func.isRequired,isMobile:_.bool.isRequired};Ki.defaultProps={meta:null};const Fo=e=>e.isMobile?`
560
+ `,qi=N.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const{steps:o,activeStep:c,setActiveStepByKey:d,setActiveStepByIndex:h}=ul(),{t:b,locale:w}=mt(),s=o[c];return N.useEffect(()=>{n(c)},[n,c]),N.useImperativeHandle(r,()=>({setActiveStepByKey:d,setActiveStepByIndex:h})),i.jsx(Ep,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:i.jsx(dl,{locale:w,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?El({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,stepTip:b("blocklet.component.add"),children:i.jsx(wp,{children:typeof(s==null?void 0:s.body)=="function"?s.body():s==null?void 0:s.body})})})});qi.propTypes={meta:L.any,onStepChange:L.func.isRequired,isMobile:L.bool.isRequired};qi.defaultProps={meta:null};const Mo=e=>e.isMobile?`
561
561
  height: calc(100vh - 56px - 64px - 48px);
562
- `:"",jp=Ve.div`
562
+ `:"",wp=Ve.div`
563
563
  width: 100%;
564
564
  height: 100%;
565
565
  display: flex;
@@ -575,7 +575,7 @@ see detail in https://www.npmjs.com/package/is-var-name
575
575
  aside {
576
576
  width: 140px;
577
577
  }
578
- `,Op=Ve(Q)`
578
+ `,Ep=Ve(Q)`
579
579
  ${({className:e})=>e==="mobileStyle"?`
580
580
  & > div{
581
581
  height: 100%;
@@ -676,11 +676,11 @@ see detail in https://www.npmjs.com/package/is-var-name
676
676
  display: flex;
677
677
  height: 100%;
678
678
  align-items: center;
679
- ${e=>Fo(e)}
679
+ ${e=>Mo(e)}
680
680
  }
681
681
 
682
682
  & .agreement-wrapper {
683
- ${e=>Fo(e)}
683
+ ${e=>Mo(e)}
684
684
  max-height: 60vh;
685
685
  .eula-trigger {
686
686
  padding-right: 0;
@@ -693,7 +693,7 @@ see detail in https://www.npmjs.com/package/is-var-name
693
693
  & .connect {
694
694
  background: white;
695
695
  }
696
- `,kp=Ki,Rp=e=>e.inStore&&At.isFreeBlocklet(e)===!1,Cp=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},$r=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Ip=e=>(e.environments||[]).some(t=>t.required),Bo=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Pp=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(c=>c.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},$o=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function ka({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:o,storageKey:c,inDialog:d,selectedMeta:h,storeUrl:b,showResourcesSwitch:w,showFromUrl:s,enableRunBackground:a,showCategory:O}){var Zt,en,tn,Mt,I,ht,nn,rn,l;const{t:x,locale:S}=mt(),[R,L]=N.useState(!1),[A,H]=N.useState(null),[U,X]=N.useState(""),[j,W]=N.useState(""),{api:Z,ws:{useSubscription:F},inService:ce,info:Y}=Cn(),{blocklet:ae,actions:{refreshBlocklet:Se}}=fr(),[Fe,Ue]=N.useState(null),[nt,ee]=N.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[q,Te]=N.useState(pe),[ie,dt]=N.useState(0),we=N.useRef({}),Je=N.useRef({}),ze=N.useRef({}),Ct=zt(p=>p.breakpoints.down("md")),Vt=Za(),[Dt,Gt]=N.useState(!0),{meta:Ie}=we.current,Pe=ws(Ie),Oe=p=>Te(y=>({...y,...p}));N.useEffect(()=>{if(q.pathPrefix){const{errMsg:p}=Jt({...q,pathPrefix:q.pathPrefix,locale:S});X(p)}},[q.pathPrefix]),N.useEffect(()=>{ie===0&&Te(pe)},[ie]);const ye=()=>{const p=$r(ae)??"";Oe({didSpaceEndpoint:p})},It=()=>{var p;return(p=we==null?void 0:we.current)!=null&&p.meta?At.getDisplayName(we.current):""},Ht=p=>{const y=k=>{Oe({installResultProps:{variant:"error",title:It(),subTitle:p,footer:i.jsx(ct,{className:"bottom-button",disabled:k,"data-cy":"retry-install-component",onClick:async()=>{y(!0),await gn(we.current.installInput)},children:i.jsxs(Q,{display:"flex",alignItems:"center",children:[k&&i.jsx(ft,{size:16,style:{marginRight:8}}),x("common.retry")]})})}})};y()},Xt=p=>y=>{var k,P;(((k=y==null?void 0:y.meta)==null?void 0:k.did)||(y==null?void 0:y.meta))===((P=ae==null?void 0:ae.meta)==null?void 0:P.did)&&p(y)};F(kt.BlockletEvents.statusChange,Xt(p=>{switch(p.status){case kt.BlockletStatus.upgrading:Oe({installResultProps:{variant:"success",title:It(),subTitle:x("blocklet.component.installSuccessTip")}}),$o({componentDid:Vt.componentDid});break}const y=$r(ae);Oe(k=>({...k,didSpaceEndpoint:y}))}),[(Zt=ae==null?void 0:ae.meta)==null?void 0:Zt.did]),F(kt.BlockletEvents.downloadFailed,Xt(()=>{Ht(x("blocklet.component.installComponentError"))}),[(en=ae==null?void 0:ae.meta)==null?void 0:en.did]),F(kt.BlockletEvents.installFailed,Xt(()=>{Ht(x("blocklet.component.installComponentError"))}),[(tn=ae==null?void 0:ae.meta)==null?void 0:tn.did]);const ge=[],Yt=()=>{L(!1),Te({}),we.current={},e()},mn=p=>((ae==null?void 0:ae.children)||[]).find(y=>y.meta.did===p),gn=async p=>{var St,Ft;const{pathPrefix:y,bundleDid:k,title:P,componentName:z="",componentDid:V=""}=q,ue=((St=we.current)==null?void 0:St.meta)||{},{configs:oe=[],registryUrl:Ae,inStore:Be,inputUrl:Re,dist:De}=ue,He=(Ft=we.current)==null?void 0:Ft.downloadTokenList,Xe=Re||(Be?no(Ae,k,De):"");L(!0);const vn={rootDid:ae.meta.did,url:Xe,mountPoint:y?Qn(y):`/${Qn(ue.title||ue.name)}`,title:P,name:z,did:V,onlyRequired:!Dt,...q.hasEnvironmentsStep&&oe.length>0?{configs:oe.map(rt=>({...rt,value:q.configsValue[rt.key]||""}))}:{},...He?{downloadTokenList:He}:{},...p};try{if(await Z.installComponent({input:vn}),Ae){const{teamDid:rt,storeList:Bt}=ss({fromBlocklet:ce,nodeInfo:Y,blocklet:ae}),{isNew:Pt,decoded:$t}=kl(Ae,Bt);Pt&&await Z.addBlockletStore({input:{teamDid:rt,url:$t}})}Oe({installResultProps:{}}),Se({showError:!1,attachRuntimeInfo:!1})}catch(rt){const Bt=hs(rt);ni.error(Bt),console.error("installComponent error: ",rt),Ht(Bt)}finally{L(!1),we.current.installInput=vn}},Jt=p=>{const y=ic({params:{...p,did:p.bundleDid},blocklets:[ae],blocklet:ae,locale:S});if(y){const k=mn(p.bundleDid),P=oc({params:{...p,did:p.bundleDid},blocklet:ae});if(k&&k.mountPoint===P)return{errMsg:""}}return{errMsg:y}},Qe=async p=>{var k,P;const{errMsg:y}=Jt({...q,locale:S});X(y),ie===ge.length-2&&await gn(p),(P=(k=Je.current)==null?void 0:k.setActiveStepByIndex)==null||P.call(k,z=>z+1)},xt=()=>{var p,y;(y=(p=Je.current)==null?void 0:p.setActiveStepByIndex)==null||y.call(p,k=>k-1)},wt=()=>{const{pathPrefix:p,bundleDid:y,title:k,componentName:P="",componentDid:z=""}=q,{meta:V={}}=we.current||{},{registryUrl:ue,inStore:oe,inputUrl:Ae,dist:Be}=V,Re=oe?no(ue,y,Be):Ae;Ue({meta:V,installOpts:{type:"component",rootDid:ae.meta.did,mountPoint:p,url:Re,title:k,name:P,did:z}})},gt=p=>{ee(!1),Oe({purchaseResultProps:{variant:"error",title:It(),subTitle:p,style:{paddingTop:120},footer:i.jsx(ct,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Oe({purchaseResultProps:{}})},children:x("common.retry")})}})},Et=({downloadTokenList:p})=>{we.current.downloadTokenList=p,ee(!1),Qe()},Ge=({chooseParams:p=we.current,componentDid:y,isInit:k=!1})=>{var $t,Pn,_n,Yn;const{meta:P,registryUrl:z,inStore:V,inputUrl:ue}=p,{did:oe,title:Ae,name:Be}=P,Re=((($t=ae.settings)==null?void 0:$t.children)||[]).filter(it=>it.status==="deleted"&&it.meta.bundleDid===oe),De=y||"",He=(Pn=P.environments)==null?void 0:Pn.map(it=>{const{name:yn,validation:on,...vt}=it,bn={validation:Fl(on)?"":on};return{...vt,key:yn,...bn}});we.current={...p,meta:{...P,configs:He,registryUrl:z,inStore:V,inputUrl:ue}};let Xe={};if(k){const it=[ae],yn=He||[],on=[],vt=ls(Ml([...yn,...on]),"key").filter(Tt=>!!Tt.key).sort((Tt,wn)=>Tt.required&&!wn.required?-1:wn.required&&!Tt.required?1:0),bn=At.getSharedConfigObj(it[0],{configs:vt}),xn={},Jn=vt.map(Tt=>{const{default:wn,key:je,...En}=Tt;return xn[je]=bn[je]||wn,{...En,key:je,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[je]}});Xe={...Xe,configsList:Jn,configsValue:xn,hasMissRequiredConfigs:Bo(Jn,xn)}}const vn=ae.children.some(it=>it.mountPoint==="/"),St=Re.find(it=>it.meta.bundleDid===oe),Ft=ae.children.find(it=>it.meta.bundleDid===oe);Xe.title=Ae||"",St?Xe={...Xe,pathPrefix:St.mountPoint||"",componentName:St.meta.name,hasEnvironmentsStep:!1}:Ft?Xe={...Xe,pathPrefix:Ft.mountPoint||"",componentName:Ft.meta.name,hasEnvironmentsStep:!1}:Xe={...Xe,pathPrefix:vn?`/${Qn(Ae)||Qn(Be)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Yn=(_n=we.current.meta)==null?void 0:_n.environments)==null?void 0:Yn.length)>0};const rt=Rp(we.current.meta),Bt=Cp(we.current.meta),Pt=$r(ae);Oe({bundleDid:oe,componentDid:De,...Xe,hasRequiredEnvironments:Ip(we.current.meta),requirePurchase:rt,didSpaceIsRequiredSetup:Bt,didSpaceEndpoint:Pt}),k&&rt&&wt()};N.useEffect(()=>{!h||ie!==0||!ae||(Ge({chooseParams:{blocklets:[h],meta:h,registryUrl:b||h.homepage,inStore:!0},isInit:!0}),Oe({showFromUrlDialog:!1}),Qe())},[h,ie,ae]),ge.push({key:"selectComponent",name:x("blocklet.component.selectComponent"),body:i.jsxs(an,{sx:{width:400},component:"div",children:[s&&q.showFromUrlDialog&&i.jsx(Ci,{mode:"component",onCancel:()=>{Oe({showFromUrlDialog:!1})},onSuccess:({meta:p,inputUrl:y,inStore:k,registryUrl:P})=>{Ge({chooseParams:{meta:p,inputUrl:y,inStore:k,registryUrl:P},isInit:!0}),Oe({showFromUrlDialog:!1}),Qe()},handleText:{title:x("blocklet.component.addComponentTip.fromUrl"),confirm:x("blocklet.component.choose")}}),i.jsx(Ai,{stores:n,extra:Zo.isInServerlessMode(Y)?null:s?i.jsxs(ct,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Oe({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[i.jsx(fs,{style:{fontSize:20,marginRight:4}})," ",x("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:R,onChange:()=>{Te({}),we.current={}},storageKey:c,children:({currentRegistry:p})=>i.jsx(qi,{showResourcesSwitch:w,showCategory:O,serverVersion:Y==null?void 0:Y.version,style:Ct?{height:"calc(100vh - 56px - 80px - 32px - 10px )"}:{height:"calc(100% - 10px)"},storeUrl:p.url,resourceType:r,resourceDid:o,handleButtonClick:y=>{Ge({chooseParams:{...y,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:y,defaultRender:k})=>{const P=(q==null?void 0:q.bundleDid)&&(q==null?void 0:q.bundleDid)===(y==null?void 0:y.did);return i.jsxs(Lp,{children:[P&&i.jsx("div",{className:"check-container",children:i.jsx(os,{className:"check-icon"})}),i.jsx("div",{className:P?"choose-blocklet":"",style:{marginLeft:16},children:k})]})}})})]}),cancel:t==="embed"?void 0:x("common.cancel"),confirm:Pp({params:q,blocklet:ae,t:x}),onCancel:Yt,onConfirm:()=>{Qe()}}),ge.push({key:"agreement",name:x("launchBlocklet.introduction"),body:i.jsxs(an,{component:"div",className:"agreement-wrapper",children:[i.jsx(as,{title:x("launchBlocklet.introduction"),subTitle:x("blocklet.component.addComponentTip.introduction")}),i.jsx(hi,{meta:Ie,onClickNext:Qe,installRelated:Dt,onChangeInstallRelated:Gt,handleDescEle:i.jsx("p",{children:x("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:h?void 0:x("common.pre"),disabled:!Pe,confirm:x(Pe?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:h?Yt:xt,onConfirm:()=>{ee(!1),Qe()}}),Ie&&q.requirePurchase&&ge.push({key:"purchase",name:i.jsxs(i.Fragment,{children:[x("common.verifyNFT"),i.jsx(Sr,{})]}),body:i.jsxs(an,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((I=(Mt=ze.current)==null?void 0:Mt.getCurrentStep)==null?void 0:I.call(Mt))===2||nt)&&i.jsx(rr,{title:x("common.verifyNFT"),subTitle:x("blocklet.component.addComponentTip.verifyNFT")}),Un(q.purchaseResultProps)?Fe&&i.jsx(Hd,{ref:ze,meta:Fe.meta,mode:q.componentDid?"verify":"both",onCancel:gt,installOpts:Fe.installOpts,handlePaySuccess:Et}):i.jsx("div",{className:"flex-align-center flex-justify-center",children:i.jsx(ro,{...q.purchaseResultProps})})]}),disabled:((nn=(ht=ze.current)==null?void 0:ht.getCurrentStep)==null?void 0:nn.call(ht))===2||nt,cancel:x("common.pre"),confirm:x("common.next"),onConfirm:()=>{typeof ze.current.onNext=="function"&&(ze.current.onNext(),ee(!0))},onCancel:()=>{xt()}}),At.hasStartEngine(Ie)&&jl.hasMountPoint(Ie)?ge.push({key:"config",name:x("common.config"),error:U,body:i.jsxs(an,{component:"div",children:[i.jsx(rr,{title:x("common.config"),subTitle:x("blocklet.component.addComponentTip.config")}),i.jsx(ur,{label:x("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:j||x("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:q.pathPrefix,onChange:p=>{const y=p.target.value;Oe({pathPrefix:y}),W(x("common.slugifyHint",{value:Ol(y)}))}}),!!U&&i.jsx(Vo,{severity:"error",style:{width:"100%",marginTop:8},children:U})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:xt,onConfirm:()=>{Qe()}}):Ie&&(q.pathPrefix=((l=(rn=Ie.interfaces)==null?void 0:rn[0])==null?void 0:l.path)||`/${Ie.did}`),Ie&&(q!=null&&q.hasEnvironmentsStep)&&ge.push({key:"environment",name:i.jsxs(i.Fragment,{children:[x("common.environment")," ",q.hasRequiredEnvironments&&i.jsx(Sr,{})]}),disabled:!!A||(q==null?void 0:q.hasMissRequiredConfigs),body:()=>i.jsxs(an,{component:"div",style:{overflowY:"auto"},children:[i.jsx(rr,{title:x("common.environment"),subTitle:x("blocklet.component.addComponentTip.environment")}),i.jsx(Ul,{style:{marginTop:-12,width:"100%"},schema:q.configsList,defaultValue:q.configsValue,onChange:(p,{action:y,currentItem:k,allValues:P})=>{y==="confirm"&&Oe({hasMissRequiredConfigs:Bo(q.configsList,P),configsValue:P}),y==="edit"?H(k):["cancel","confirm"].includes(y)&&H(null)}})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:xt,onConfirm:Qe}),Ie&&(q!=null&&q.didSpaceIsRequiredSetup)&&ge.push({key:"didSpace",name:i.jsxs(i.Fragment,{children:[x("blocklet.component.didSpaceConfig")," ",q.didSpaceIsRequiredSetup==="required"&&i.jsx(Sr,{})]}),disabled:(q==null?void 0:q.didSpaceIsRequiredSetup)&&!q.didSpaceEndpoint,body:()=>i.jsx($l,{children:i.jsxs(an,{component:"div",children:[i.jsx(rr,{title:x("blocklet.component.didSpaceConfig"),subTitle:x("blocklet.component.didSpaceConfigTip")}),i.jsx(Q,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:i.jsx(Ni,{blockletMeta:we.current.meta,onNext:()=>{Qe()},onEndpointUpdate:ye})})]})}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:xt,onConfirm:Qe}),ge.push({key:"install",name:mn(Ie==null?void 0:Ie.did)?x("common.upgrade"):x("common.install"),disabled:a?!1:Un(q.installResultProps),loading:a?!1:Un(q.installResultProps),body:i.jsx(an,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Un(q.installResultProps)?i.jsx(fl,{message:i.jsx(Np,{children:x(a?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):i.jsx("div",{style:{marginTop:120},children:i.jsx(ro,{...q.installResultProps})})}),confirm:x("common.complete"),onConfirm:()=>{$o({timeout:0,componentDid:Vt.componentDid,manual:!0}),Yt(),setTimeout(()=>{const p=document.getElementsByClassName("dashboard-main")[0];p&&(p.scrollTop=p.scrollHeight)},200)}});const Ne=ge[ie]||{},Qt=()=>R||Ne.error||!q.bundleDid?!0:ie>1?!q.pathPrefix:!1;return ae?i.jsxs(_p,{sx:{width:"100%",height:Ct?window.innerHeight:d?"72vh":"100vh"},children:[i.jsx(ml,{steps:ge,mode:"memory",children:i.jsx(kp,{ref:Je,meta:Ie,isMobile:Ct,onStepChange:p=>{dt(p)}})}),i.jsxs(Q,{className:"action-bar",children:[Ne.cancel&&i.jsx(ct,{onClick:p=>{p.stopPropagation(),Ne.onCancel()},disabled:ie===ge.length-2&&R,color:"inherit",children:Ne.cancel||x("common.cancel")}),Ne.confirm&&i.jsx(ct,{onClick:p=>{p.stopPropagation(),Ne.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:R||(typeof Ne.disabled=="boolean"?Ne.disabled:Qt()),variant:"contained",autoFocus:!0,title:Ne.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:i.jsxs(Q,{display:"flex",alignItems:"center",children:[(typeof Ne.loading=="boolean"?Ne.loading:R)&&i.jsx(ft,{style:{marginRight:8},size:16}),Ne.confirm]})})]})]}):null}ka.propTypes={onClose:_.func,mode:_.oneOf(["normal","embed"]),inDialog:_.bool,stores:_.arrayOf(_.string),storeUrl:_.string,resourceType:_.string,resourceDid:_.string,storageKey:_.string,selectedMeta:_.object,showResourcesSwitch:_.bool,showFromUrl:_.bool,enableRunBackground:_.bool,showCategory:_.bool};ka.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const _p=Ve(Q)`
696
+ `,Sp=qi,Tp=e=>e.inStore&&At.isFreeBlocklet(e)===!1,jp=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},Fr=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Op=e=>(e.environments||[]).some(t=>t.required),Fo=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),kp=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(c=>c.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},Bo=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function ja({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:o,storageKey:c,inDialog:d,selectedMeta:h,storeUrl:b,showResourcesSwitch:w,showFromUrl:s,enableRunBackground:a,showCategory:O}){var Zt,en,tn,Mt,I,ht,nn,rn,l;const{t:x,locale:S}=mt(),[R,_]=N.useState(!1),[A,H]=N.useState(null),[U,X]=N.useState(""),[j,W]=N.useState(""),{api:Z,ws:{useSubscription:F},inService:ce,info:Y}=Cn(),{blocklet:ae,actions:{refreshBlocklet:Se}}=hr(),[Fe,Ue]=N.useState(null),[nt,ee]=N.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[q,Te]=N.useState(pe),[ie,dt]=N.useState(0),we=N.useRef({}),Je=N.useRef({}),ze=N.useRef({}),Ct=zt(p=>p.breakpoints.down("md")),Vt=Ja(),[Dt,Gt]=N.useState(!0),{meta:Ie}=we.current,Pe=xs(Ie),Oe=p=>Te(y=>({...y,...p}));N.useEffect(()=>{if(q.pathPrefix){const{errMsg:p}=Jt({...q,pathPrefix:q.pathPrefix,locale:S});X(p)}},[q.pathPrefix]),N.useEffect(()=>{ie===0&&Te(pe)},[ie]);const ye=()=>{const p=Fr(ae)??"";Oe({didSpaceEndpoint:p})},It=()=>{var p;return(p=we==null?void 0:we.current)!=null&&p.meta?At.getDisplayName(we.current):""},Ht=p=>{const y=k=>{Oe({installResultProps:{variant:"error",title:It(),subTitle:p,footer:i.jsx(ct,{className:"bottom-button",disabled:k,"data-cy":"retry-install-component",onClick:async()=>{y(!0),await gn(we.current.installInput)},children:i.jsxs(Q,{display:"flex",alignItems:"center",children:[k&&i.jsx(ft,{size:16,style:{marginRight:8}}),x("common.retry")]})})}})};y()},Xt=p=>y=>{var k,P;(((k=y==null?void 0:y.meta)==null?void 0:k.did)||(y==null?void 0:y.meta))===((P=ae==null?void 0:ae.meta)==null?void 0:P.did)&&p(y)};F(kt.BlockletEvents.statusChange,Xt(p=>{switch(p.status){case kt.BlockletStatus.upgrading:Oe({installResultProps:{variant:"success",title:It(),subTitle:x("blocklet.component.installSuccessTip")}}),Bo({componentDid:Vt.componentDid});break}const y=Fr(ae);Oe(k=>({...k,didSpaceEndpoint:y}))}),[(Zt=ae==null?void 0:ae.meta)==null?void 0:Zt.did]),F(kt.BlockletEvents.downloadFailed,Xt(()=>{Ht(x("blocklet.component.installComponentError"))}),[(en=ae==null?void 0:ae.meta)==null?void 0:en.did]),F(kt.BlockletEvents.installFailed,Xt(()=>{Ht(x("blocklet.component.installComponentError"))}),[(tn=ae==null?void 0:ae.meta)==null?void 0:tn.did]);const ge=[],Yt=()=>{_(!1),Te({}),we.current={},e()},mn=p=>((ae==null?void 0:ae.children)||[]).find(y=>y.meta.did===p),gn=async p=>{var St,Ft;const{pathPrefix:y,bundleDid:k,title:P,componentName:z="",componentDid:V=""}=q,ue=((St=we.current)==null?void 0:St.meta)||{},{configs:oe=[],registryUrl:Ae,inStore:Be,inputUrl:Re,dist:De}=ue,He=(Ft=we.current)==null?void 0:Ft.downloadTokenList,Xe=Re||(Be?to(Ae,k,De):"");_(!0);const vn={rootDid:ae.meta.did,url:Xe,mountPoint:y?Qn(y):`/${Qn(ue.title||ue.name)}`,title:P,name:z,did:V,onlyRequired:!Dt,...q.hasEnvironmentsStep&&oe.length>0?{configs:oe.map(rt=>({...rt,value:q.configsValue[rt.key]||""}))}:{},...He?{downloadTokenList:He}:{},...p};try{if(await Z.installComponent({input:vn}),Ae){const{teamDid:rt,storeList:Bt}=os({fromBlocklet:ce,nodeInfo:Y,blocklet:ae}),{isNew:Pt,decoded:$t}=jl(Ae,Bt);Pt&&await Z.addBlockletStore({input:{teamDid:rt,url:$t}})}Oe({installResultProps:{}}),Se({showError:!1,attachRuntimeInfo:!1})}catch(rt){const Bt=ds(rt);ni.error(Bt),console.error("installComponent error: ",rt),Ht(Bt)}finally{_(!1),we.current.installInput=vn}},Jt=p=>{const y=rc({params:{...p,did:p.bundleDid},blocklets:[ae],blocklet:ae,locale:S});if(y){const k=mn(p.bundleDid),P=ic({params:{...p,did:p.bundleDid},blocklet:ae});if(k&&k.mountPoint===P)return{errMsg:""}}return{errMsg:y}},Qe=async p=>{var k,P;const{errMsg:y}=Jt({...q,locale:S});X(y),ie===ge.length-2&&await gn(p),(P=(k=Je.current)==null?void 0:k.setActiveStepByIndex)==null||P.call(k,z=>z+1)},xt=()=>{var p,y;(y=(p=Je.current)==null?void 0:p.setActiveStepByIndex)==null||y.call(p,k=>k-1)},wt=()=>{const{pathPrefix:p,bundleDid:y,title:k,componentName:P="",componentDid:z=""}=q,{meta:V={}}=we.current||{},{registryUrl:ue,inStore:oe,inputUrl:Ae,dist:Be}=V,Re=oe?to(ue,y,Be):Ae;Ue({meta:V,installOpts:{type:"component",rootDid:ae.meta.did,mountPoint:p,url:Re,title:k,name:P,did:z}})},gt=p=>{ee(!1),Oe({purchaseResultProps:{variant:"error",title:It(),subTitle:p,style:{paddingTop:120},footer:i.jsx(ct,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Oe({purchaseResultProps:{}})},children:x("common.retry")})}})},Et=({downloadTokenList:p})=>{we.current.downloadTokenList=p,ee(!1),Qe()},Ge=({chooseParams:p=we.current,componentDid:y,isInit:k=!1})=>{var $t,Pn,Ln,Yn;const{meta:P,registryUrl:z,inStore:V,inputUrl:ue}=p,{did:oe,title:Ae,name:Be}=P,Re=((($t=ae.settings)==null?void 0:$t.children)||[]).filter(it=>it.status==="deleted"&&it.meta.bundleDid===oe),De=y||"",He=(Pn=P.environments)==null?void 0:Pn.map(it=>{const{name:yn,validation:on,...vt}=it,bn={validation:Dl(on)?"":on};return{...vt,key:yn,...bn}});we.current={...p,meta:{...P,configs:He,registryUrl:z,inStore:V,inputUrl:ue}};let Xe={};if(k){const it=[ae],yn=He||[],on=[],vt=as(Al([...yn,...on]),"key").filter(Tt=>!!Tt.key).sort((Tt,wn)=>Tt.required&&!wn.required?-1:wn.required&&!Tt.required?1:0),bn=At.getSharedConfigObj(it[0],{configs:vt}),xn={},Jn=vt.map(Tt=>{const{default:wn,key:je,...En}=Tt;return xn[je]=bn[je]||wn,{...En,key:je,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[je]}});Xe={...Xe,configsList:Jn,configsValue:xn,hasMissRequiredConfigs:Fo(Jn,xn)}}const vn=ae.children.some(it=>it.mountPoint==="/"),St=Re.find(it=>it.meta.bundleDid===oe),Ft=ae.children.find(it=>it.meta.bundleDid===oe);Xe.title=Ae||"",St?Xe={...Xe,pathPrefix:St.mountPoint||"",componentName:St.meta.name,hasEnvironmentsStep:!1}:Ft?Xe={...Xe,pathPrefix:Ft.mountPoint||"",componentName:Ft.meta.name,hasEnvironmentsStep:!1}:Xe={...Xe,pathPrefix:vn?`/${Qn(Ae)||Qn(Be)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Yn=(Ln=we.current.meta)==null?void 0:Ln.environments)==null?void 0:Yn.length)>0};const rt=Tp(we.current.meta),Bt=jp(we.current.meta),Pt=Fr(ae);Oe({bundleDid:oe,componentDid:De,...Xe,hasRequiredEnvironments:Op(we.current.meta),requirePurchase:rt,didSpaceIsRequiredSetup:Bt,didSpaceEndpoint:Pt}),k&&rt&&wt()};N.useEffect(()=>{!h||ie!==0||!ae||(Ge({chooseParams:{blocklets:[h],meta:h,registryUrl:b||h.homepage,inStore:!0},isInit:!0}),Oe({showFromUrlDialog:!1}),Qe())},[h,ie,ae]),ge.push({key:"selectComponent",name:x("blocklet.component.selectComponent"),body:i.jsxs(an,{sx:{width:400},component:"div",children:[s&&q.showFromUrlDialog&&i.jsx(Ci,{mode:"component",onCancel:()=>{Oe({showFromUrlDialog:!1})},onSuccess:({meta:p,inputUrl:y,inStore:k,registryUrl:P})=>{Ge({chooseParams:{meta:p,inputUrl:y,inStore:k,registryUrl:P},isInit:!0}),Oe({showFromUrlDialog:!1}),Qe()},handleText:{title:x("blocklet.component.addComponentTip.fromUrl"),confirm:x("blocklet.component.choose")}}),i.jsx(Ni,{stores:n,extra:Qo.isInServerlessMode(Y)?null:s?i.jsxs(ct,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Oe({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[i.jsx(ps,{style:{fontSize:20,marginRight:4}})," ",x("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:R,onChange:()=>{Te({}),we.current={}},storageKey:c,children:({currentRegistry:p})=>i.jsx(zi,{showResourcesSwitch:w,showCategory:O,serverVersion:Y==null?void 0:Y.version,style:Ct?{height:"calc(100vh - 56px - 80px - 32px - 10px )"}:{height:"calc(100% - 10px)"},storeUrl:p.url,resourceType:r,resourceDid:o,handleButtonClick:y=>{Ge({chooseParams:{...y,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:y,defaultRender:k})=>{const P=(q==null?void 0:q.bundleDid)&&(q==null?void 0:q.bundleDid)===(y==null?void 0:y.did);return i.jsxs(Cp,{children:[P&&i.jsx("div",{className:"check-container",children:i.jsx(is,{className:"check-icon"})}),i.jsx("div",{className:P?"choose-blocklet":"",style:{marginLeft:16},children:k})]})}})})]}),cancel:t==="embed"?void 0:x("common.cancel"),confirm:kp({params:q,blocklet:ae,t:x}),onCancel:Yt,onConfirm:()=>{Qe()}}),ge.push({key:"agreement",name:x("launchBlocklet.introduction"),body:i.jsxs(an,{component:"div",className:"agreement-wrapper",children:[i.jsx(ss,{title:x("launchBlocklet.introduction"),subTitle:x("blocklet.component.addComponentTip.introduction")}),i.jsx(hi,{meta:Ie,onClickNext:Qe,installRelated:Dt,onChangeInstallRelated:Gt,handleDescEle:i.jsx("p",{children:x("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:h?void 0:x("common.pre"),disabled:!Pe,confirm:x(Pe?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:h?Yt:xt,onConfirm:()=>{ee(!1),Qe()}}),Ie&&q.requirePurchase&&ge.push({key:"purchase",name:i.jsxs(i.Fragment,{children:[x("common.verifyNFT"),i.jsx(wr,{})]}),body:i.jsxs(an,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((I=(Mt=ze.current)==null?void 0:Mt.getCurrentStep)==null?void 0:I.call(Mt))===2||nt)&&i.jsx(rr,{title:x("common.verifyNFT"),subTitle:x("blocklet.component.addComponentTip.verifyNFT")}),Un(q.purchaseResultProps)?Fe&&i.jsx(qd,{ref:ze,meta:Fe.meta,mode:q.componentDid?"verify":"both",onCancel:gt,installOpts:Fe.installOpts,handlePaySuccess:Et}):i.jsx("div",{className:"flex-align-center flex-justify-center",children:i.jsx(no,{...q.purchaseResultProps})})]}),disabled:((nn=(ht=ze.current)==null?void 0:ht.getCurrentStep)==null?void 0:nn.call(ht))===2||nt,cancel:x("common.pre"),confirm:x("common.next"),onConfirm:()=>{typeof ze.current.onNext=="function"&&(ze.current.onNext(),ee(!0))},onCancel:()=>{xt()}}),At.hasStartEngine(Ie)&&Sl.hasMountPoint(Ie)?ge.push({key:"config",name:x("common.config"),error:U,body:i.jsxs(an,{component:"div",children:[i.jsx(rr,{title:x("common.config"),subTitle:x("blocklet.component.addComponentTip.config")}),i.jsx(cr,{label:x("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:j||x("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:q.pathPrefix,onChange:p=>{const y=p.target.value;Oe({pathPrefix:y}),W(x("common.slugifyHint",{value:Tl(y)}))}}),!!U&&i.jsx(Ko,{severity:"error",style:{width:"100%",marginTop:8},children:U})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:xt,onConfirm:()=>{Qe()}}):Ie&&(q.pathPrefix=((l=(rn=Ie.interfaces)==null?void 0:rn[0])==null?void 0:l.path)||`/${Ie.did}`),Ie&&(q!=null&&q.hasEnvironmentsStep)&&ge.push({key:"environment",name:i.jsxs(i.Fragment,{children:[x("common.environment")," ",q.hasRequiredEnvironments&&i.jsx(wr,{})]}),disabled:!!A||(q==null?void 0:q.hasMissRequiredConfigs),body:()=>i.jsxs(an,{component:"div",style:{overflowY:"auto"},children:[i.jsx(rr,{title:x("common.environment"),subTitle:x("blocklet.component.addComponentTip.environment")}),i.jsx(Bl,{style:{marginTop:-12,width:"100%"},schema:q.configsList,defaultValue:q.configsValue,onChange:(p,{action:y,currentItem:k,allValues:P})=>{y==="confirm"&&Oe({hasMissRequiredConfigs:Fo(q.configsList,P),configsValue:P}),y==="edit"?H(k):["cancel","confirm"].includes(y)&&H(null)}})]}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:xt,onConfirm:Qe}),Ie&&(q!=null&&q.didSpaceIsRequiredSetup)&&ge.push({key:"didSpace",name:i.jsxs(i.Fragment,{children:[x("blocklet.component.didSpaceConfig")," ",q.didSpaceIsRequiredSetup==="required"&&i.jsx(wr,{})]}),disabled:(q==null?void 0:q.didSpaceIsRequiredSetup)&&!q.didSpaceEndpoint,body:()=>i.jsx(Fl,{children:i.jsxs(an,{component:"div",children:[i.jsx(rr,{title:x("blocklet.component.didSpaceConfig"),subTitle:x("blocklet.component.didSpaceConfigTip")}),i.jsx(Q,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:i.jsx(_i,{blockletMeta:we.current.meta,onNext:()=>{Qe()},onEndpointUpdate:ye})})]})}),cancel:x("common.pre"),confirm:x("common.next"),onCancel:xt,onConfirm:Qe}),ge.push({key:"install",name:mn(Ie==null?void 0:Ie.did)?x("common.upgrade"):x("common.install"),disabled:a?!1:Un(q.installResultProps),loading:a?!1:Un(q.installResultProps),body:i.jsx(an,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Un(q.installResultProps)?i.jsx(hl,{message:i.jsx(Ip,{children:x(a?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):i.jsx("div",{style:{marginTop:120},children:i.jsx(no,{...q.installResultProps})})}),confirm:x("common.complete"),onConfirm:()=>{Bo({timeout:0,componentDid:Vt.componentDid,manual:!0}),Yt(),setTimeout(()=>{const p=document.getElementsByClassName("dashboard-main")[0];p&&(p.scrollTop=p.scrollHeight)},200)}});const Ne=ge[ie]||{},Qt=()=>R||Ne.error||!q.bundleDid?!0:ie>1?!q.pathPrefix:!1;return ae?i.jsxs(Rp,{sx:{width:"100%",height:Ct?window.innerHeight:d?"72vh":"100vh"},children:[i.jsx(pl,{steps:ge,mode:"memory",children:i.jsx(Sp,{ref:Je,meta:Ie,isMobile:Ct,onStepChange:p=>{dt(p)}})}),i.jsxs(Q,{className:"action-bar",children:[Ne.cancel&&i.jsx(ct,{onClick:p=>{p.stopPropagation(),Ne.onCancel()},disabled:ie===ge.length-2&&R,color:"inherit",children:Ne.cancel||x("common.cancel")}),Ne.confirm&&i.jsx(ct,{onClick:p=>{p.stopPropagation(),Ne.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:R||(typeof Ne.disabled=="boolean"?Ne.disabled:Qt()),variant:"contained",autoFocus:!0,title:Ne.confirm,style:{marginLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:i.jsxs(Q,{display:"flex",alignItems:"center",children:[(typeof Ne.loading=="boolean"?Ne.loading:R)&&i.jsx(ft,{style:{marginRight:8},size:16}),Ne.confirm]})})]})]}):null}ja.propTypes={onClose:L.func,mode:L.oneOf(["normal","embed"]),inDialog:L.bool,stores:L.arrayOf(L.string),storeUrl:L.string,resourceType:L.string,resourceDid:L.string,storageKey:L.string,selectedMeta:L.object,showResourcesSwitch:L.bool,showFromUrl:L.bool,enableRunBackground:L.bool,showCategory:L.bool};ja.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Rp=Ve(Q)`
697
697
  .action-bar {
698
698
  display: flex;
699
699
  justify-content: flex-end;
@@ -708,9 +708,9 @@ see detail in https://www.npmjs.com/package/is-var-name
708
708
  `,an=Ve(me)`
709
709
  width: 100%;
710
710
  height: 100%;
711
- `,rr=Ve(as)`
711
+ `,rr=Ve(ss)`
712
712
  margin-bottom: 24px;
713
- `,Lp=Ve.div`
713
+ `,Cp=Ve.div`
714
714
  position: relative;
715
715
 
716
716
  .choose-blocklet {
@@ -754,7 +754,7 @@ see detail in https://www.npmjs.com/package/is-var-name
754
754
  transition: all ease 0.2s;
755
755
  }
756
756
  }
757
- `,Np=Ve.div`
757
+ `,Ip=Ve.div`
758
758
  color: ${e=>e.theme.palette.primary.main};
759
759
  .msg-before {
760
760
  display: inline-block;
@@ -762,4 +762,4 @@ see detail in https://www.npmjs.com/package/is-var-name
762
762
  font-size: 14px;
763
763
  margin-right: 6px;
764
764
  }
765
- `;export{ka as A,ra as B,pf as S,df as a,hf as b,gp as c,fs as d,Es as f};
765
+ `;export{ja as A,na as B,cf as S,af as a,lf as b,hp as c,ps as d,ws as f};