@abtnode/blocklet-services 1.16.40-beta-20250303-132654-d0e1975b → 1.16.40-beta-20250305-001025-5ee639c9

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 (195) hide show
  1. package/api/index.js +25 -6
  2. package/api/libs/email.js +8 -0
  3. package/api/routes/openevent.js +2 -2
  4. package/api/routes/user-session.js +2 -1
  5. package/api/services/notification/queue.js +11 -3
  6. package/api/socket/channel/did.js +72 -53
  7. package/api/socket/channel/eventbus.js +6 -0
  8. package/api/util/attach-shared-utils.js +2 -0
  9. package/dist/assets/{Add-Ek8OCMuT.js → Add-Cip-Q3Dt.js} +1 -1
  10. package/dist/assets/{ArrowDropDown-DZq1hKFM.js → ArrowDropDown-_ravVKaf.js} +1 -1
  11. package/dist/assets/{CheckCircle-h-5wsEcS.js → CheckCircle-CFF65I7d.js} +1 -1
  12. package/dist/assets/{ChevronLeft-DIOt0Dnm.js → ChevronLeft-DyVK0SyV.js} +1 -1
  13. package/dist/assets/{ChevronRight-C-nvqavT.js → ChevronRight-CMCOlQoz.js} +1 -1
  14. package/dist/assets/{DeleteOutline-BOp68orT.js → DeleteOutline-f6Nb7LK2.js} +1 -1
  15. package/dist/assets/{Done-BvLqpK-v.js → Done-DcyOV4wB.js} +1 -1
  16. package/dist/assets/{Download-DqMayZA9.js → Download-BcZsjfbS.js} +1 -1
  17. package/dist/assets/{EditIcon-lehrw0S5.js → EditIcon-CMs1pbEF.js} +1 -1
  18. package/dist/assets/{Error-C5z3wYEl.js → Error-tDg6ei77.js} +1 -1
  19. package/dist/assets/ExpandLess-RenWdANb.js +1 -0
  20. package/dist/assets/{Google-DW0b3C6a.js → Google-1jzD6KC8.js} +1 -1
  21. package/dist/assets/{InfoOutlined-9i-3RhVQ.js → InfoOutlined-B6WkOk1K.js} +1 -1
  22. package/dist/assets/{Launch-_IZJK_Vx.js → Launch-COjc0xnX.js} +1 -1
  23. package/dist/assets/{LaunchOutlined-CBNlUm6c.js → LaunchOutlined-DnsoPOkc.js} +1 -1
  24. package/dist/assets/{LockIcon-D4mzr6Ds.js → LockIcon-8k0MoCr8.js} +1 -1
  25. package/dist/assets/{MoreHoriz-CTCrqJvG.js → MoreHoriz-CdM4YEUS.js} +1 -1
  26. package/dist/assets/{PlayArrow-hvgEYgZA.js → PlayArrow-BtE24rss.js} +1 -1
  27. package/dist/assets/{QuestionMarkCircle-CVX4b3Jp.js → QuestionMarkCircle-DRDWkVkn.js} +1 -1
  28. package/dist/assets/{ServerLogo-CwSdifJS.js → ServerLogo-zTW7vice.js} +1 -1
  29. package/dist/assets/{ViewList-B-PdukqA.js → ViewList-BZ5ZAyNP.js} +1 -1
  30. package/dist/assets/{access-control-Bay4zhnb.js → access-control-DGnu8R-_.js} +1 -1
  31. package/dist/assets/actions-B1PhmGqt.js +1 -0
  32. package/dist/assets/add-component-core-Bbl0KUAk.js +765 -0
  33. package/dist/assets/add-resource-DtMCqT6r.js +1 -0
  34. package/dist/assets/{addon-C-LGA5c4.js → addon-DQmVM60-.js} +1 -1
  35. package/dist/assets/{analytics-BZ-j-os_.js → analytics-BpE1mSK8.js} +1 -1
  36. package/dist/assets/api-C4EBZ3D8.js +1 -0
  37. package/dist/assets/{ar-DKCGhCQr.js → ar-BvRDrl-h.js} +2 -2
  38. package/dist/assets/{audit-logs-C1Gyw98-.js → audit-logs-BniXTgud.js} +2 -2
  39. package/dist/assets/{base32-C1jmVeew.js → base32-BaFZoAVl.js} +1 -1
  40. package/dist/assets/{branding-DybmEyd0.js → branding-Bo2bC8bs.js} +2 -2
  41. package/dist/assets/{bundle-avatar-D5YGq25H.js → bundle-avatar-Sre-N_aE.js} +1 -1
  42. package/dist/assets/button-CtIW722z.js +1 -0
  43. package/dist/assets/click-to-copy-_PxhgXLr.js +1 -0
  44. package/dist/assets/cloneDeep-6qDcDoTp.js +1 -0
  45. package/dist/assets/{complete-Bnl2464f.js → complete-Bt6vm6Xh.js} +1 -1
  46. package/dist/assets/{component-CsbE8XV6.js → component-Dc-fRks0.js} +68 -68
  47. package/dist/assets/config-Bs1nzYyR.js +32 -0
  48. package/dist/assets/{config-DLsLRfYV.js → config-Ds5GJ36d.js} +1 -1
  49. package/dist/assets/{config-navigation-BM8q4Kld.js → config-navigation-WPDlQ1RJ.js} +4 -4
  50. package/dist/assets/{config-space-B21-FlA8.js → config-space-BwYNAO5S.js} +1 -1
  51. package/dist/assets/confirm-D9nnIOvs.js +7 -0
  52. package/dist/assets/{connect-DjpFqYv_.js → connect-BDN-wehP.js} +1 -1
  53. package/dist/assets/connect-CyW5d5Dv.js +1 -0
  54. package/dist/assets/{connect-to-CgQDh1qk.js → connect-to-Bl1JCiMg.js} +1 -1
  55. package/dist/assets/{content-layout-Dw7m52fz.js → content-layout-B8euliPp.js} +1 -1
  56. package/dist/assets/{dashboard-BRJbjsNF.js → dashboard-DyGi-puS.js} +11 -11
  57. package/dist/assets/{de-CCvzUauh.js → de-D18LzkQY.js} +2 -2
  58. package/dist/assets/{delete-confirm-CycQm1zC.js → delete-confirm-DZNkTsic.js} +1 -1
  59. package/dist/assets/{did-address-daPXJuXF.js → did-address-nBrtfdFs.js} +1 -1
  60. package/dist/assets/domain-CoZiXxyK.js +9 -0
  61. package/dist/assets/domain-action-card-DatWnWEH.js +17 -0
  62. package/dist/assets/domains-Cczdqu0Z.js +1 -0
  63. package/dist/assets/{email-BEDMCssb.js → email-DALnM6tC.js} +3 -3
  64. package/dist/assets/{es-Wou6JEaC.js → es-is1Q8RnK.js} +2 -2
  65. package/dist/assets/{exchange-passport-DpkACXar.js → exchange-passport-Bf-YSqcM.js} +1 -1
  66. package/dist/assets/{form-text-input-CL5UNLXF.js → form-text-input-gQXonEjr.js} +2 -2
  67. package/dist/assets/{format-error-C0Ke3VXF.js → format-error-LAoTjvJe.js} +1 -1
  68. package/dist/assets/{fr-Cvr2WC4J.js → fr-Buu4BG5m.js} +2 -2
  69. package/dist/assets/{fuel-OhNSkspC.js → fuel-DqVOAgbE.js} +1 -1
  70. package/dist/assets/{fullpage-C3gtnvua.js → fullpage-BcQv9PGo.js} +1 -1
  71. package/dist/assets/{get-safe-url-B21BiB8i.js → get-safe-url-COD6BqDE.js} +1 -1
  72. package/dist/assets/{get-safe-url-C2JaquA2.js → get-safe-url-DnoVfY5w.js} +1 -1
  73. package/dist/assets/{hi-ka40k8ho.js → hi-DGeeysYm.js} +1 -1
  74. package/dist/assets/{home-CqU5Kdbi.js → home-D5ywxuTl.js} +1 -1
  75. package/dist/assets/{id-u0hazIXA.js → id-NlIgbQ92.js} +2 -2
  76. package/dist/assets/{iframe-BP6lX9jz.js → iframe-BW5fhB2Q.js} +1 -1
  77. package/dist/assets/{index-CJtxyUnG.js → index-BUDaVPaJ.js} +4 -4
  78. package/dist/assets/{index-ISNTpwcS.js → index-BZu4MJFr.js} +1 -1
  79. package/dist/assets/{index-Dtw3nWy-.js → index-BmW4nkqT.js} +3 -3
  80. package/dist/assets/index-C-jNyGNZ.js +5 -0
  81. package/dist/assets/{index-CV3ZYUK0.js → index-C24CwgC5.js} +1 -1
  82. package/dist/assets/{index-CMCh4RTY.js → index-C6PabcPO.js} +1 -1
  83. package/dist/assets/index-CNtFrfyH.js +1 -0
  84. package/dist/assets/{index-CVcY_VTn.js → index-CR8UpawY.js} +8 -8
  85. package/dist/assets/{index-Cv9hbnTq.js → index-CpfGTKUf.js} +22 -22
  86. package/dist/assets/index-CsCfuYnX.js +138 -0
  87. package/dist/assets/{index-70BdZ2Qz.js → index-Cszfyf7Q.js} +1 -1
  88. package/dist/assets/{index-DdqHlWJ9.js → index-D-W1QzOs.js} +1 -1
  89. package/dist/assets/{index-Cj11xhYV.js → index-DPFaqs63.js} +1 -1
  90. package/dist/assets/{index-DrWKVSz_.js → index-DZeG-UP6.js} +1 -1
  91. package/dist/assets/{index-BPho8CPY.js → index-DmFVT2Y_.js} +1 -1
  92. package/dist/assets/{index-B33NNRC0.js → index-Mj8Kilqv.js} +1 -1
  93. package/dist/assets/{index-BvF7InmW.js → index-Y6bMeXBB.js} +1 -1
  94. package/dist/assets/{index-DiX6J9w5.js → index-Zz9qzQ_9.js} +30 -30
  95. package/dist/assets/{index-DHVQZzdw.js → index-a-qtpRvq.js} +3 -3
  96. package/dist/assets/index-bZdsGPmc.js +11 -0
  97. package/dist/assets/{index-BX3rOdw-.js → index-gpG3AUyG.js} +7 -7
  98. package/dist/assets/{index-DVYdq7IA.js → index-pV_0wOyY.js} +1 -1
  99. package/dist/assets/{index-DoZ2YM4T.js → index-tUQxVYYQ.js} +1 -1
  100. package/dist/assets/index.esm-CWepf7I_.js +1 -0
  101. package/dist/assets/{invitation-CjI5duN4.js → invitation-WgaVpLz-.js} +5 -5
  102. package/dist/assets/{invite-CPun5Od6.js → invite-CvRmEUzI.js} +1 -1
  103. package/dist/assets/{isEmail-BWNRBSAy.js → isEmail-DKEyei-O.js} +1 -1
  104. package/dist/assets/issue-passport-DvrxTzgL.js +1 -0
  105. package/dist/assets/{item-DyrFoThQ.js → item-BmR66mZ6.js} +1 -1
  106. package/dist/assets/{ja-D0tI3uZZ.js → ja-ZWJjus9M.js} +2 -2
  107. package/dist/assets/{ko-CMI6XHkl.js → ko-BhHmR8oQ.js} +2 -2
  108. package/dist/assets/{launch-result-message-BqgwRruP.js → launch-result-message-DgQUOIWL.js} +1 -1
  109. package/dist/assets/{layout-CzzCZbOO.js → layout-DTwYq-9q.js} +1 -1
  110. package/dist/assets/{list-DbowpmDP.js → list-BQIfnrdu.js} +4 -4
  111. package/dist/assets/{list-header-Dd-jrV-1.js → list-header-ZN_SAqiN.js} +1 -1
  112. package/dist/assets/localization-CP5Fgk5j.js +1 -0
  113. package/dist/assets/{log-CreobbQA.js → log-MmG2K3Cy.js} +1 -1
  114. package/dist/assets/{login-CRHjT4oe.js → login-D-xY5H2J.js} +1 -1
  115. package/dist/assets/login-bg-CBktcoss.jpg +0 -0
  116. package/dist/assets/{login-oauth-callback-CZ0U8oeZ.js → login-oauth-callback-C0RSY-FN.js} +1 -1
  117. package/dist/assets/{logo-uploader-hK9XhJ02.js → logo-uploader-COOjI78W.js} +3 -3
  118. package/dist/assets/{lost-passport-s5aUXZEv.js → lost-passport-XYMkiTwo.js} +4 -4
  119. package/dist/assets/{lottie-react.esm-CHpXrEmm.js → lottie-react.esm-CPHH620R.js} +1 -1
  120. package/dist/assets/omit-CxKFl3YR.js +1 -0
  121. package/dist/assets/{open-window-DwSZt4WB.js → open-window-DFyxvWDW.js} +1 -1
  122. package/dist/assets/{overview-D8oAW2La.js → overview-DhXk6dxJ.js} +1 -1
  123. package/dist/assets/{page-header-CEu1Ykmz.js → page-header-Bqi4eBBo.js} +1 -1
  124. package/dist/assets/{permission-c7HixHEA.js → permission-DfwAG69G.js} +1 -1
  125. package/dist/assets/{preferences-BinWMaZ6.js → preferences-CgrDODoo.js} +1 -1
  126. package/dist/assets/{pt-D1oQRAQ3.js → pt-BhvKzxfK.js} +1 -1
  127. package/dist/assets/publish-resource-mmACXheB.js +1 -0
  128. package/dist/assets/{raf-schd.esm-Cxhj8umC.js → raf-schd.esm-GV-XhwE0.js} +1 -1
  129. package/dist/assets/{react-beautiful-dnd.esm-CEqeHST8.js → react-beautiful-dnd.esm-Drgsy606.js} +1 -1
  130. package/dist/assets/{relative-time-CQJdt3Wa.js → relative-time-7jETcOaL.js} +1 -1
  131. package/dist/assets/{ru-BckdJ2zI.js → ru-Cc01DBPA.js} +1 -1
  132. package/dist/assets/sdk-BAIH7jDs.js +1 -0
  133. package/dist/assets/session-BqpWYLN3.js +1 -0
  134. package/dist/assets/setup-fPLYIoHX.js +19 -0
  135. package/dist/assets/{shorten-label-CRTt8ftG.js → shorten-label-DXP5M5GB.js} +1 -1
  136. package/dist/assets/simple-select-NHdBjvAy.js +1 -0
  137. package/dist/assets/{slicedToArray-C4pirt-5.js → slicedToArray-DPt500Gd.js} +1 -1
  138. package/dist/assets/{start-Q_P2Vv9q.js → start-R4emxzL_.js} +1 -1
  139. package/dist/assets/{status-Dcdkhvdh.js → status-Cn67FaBl.js} +1 -1
  140. package/dist/assets/{step-actions-Bw3C3mC4.js → step-actions-BzTrLOhC.js} +1 -1
  141. package/dist/assets/{studio-CcB75dSa.js → studio-CMXW7rb0.js} +1 -1
  142. package/dist/assets/{switch-control-ChDs2LUa.js → switch-control-DdM1x1I2.js} +1 -1
  143. package/dist/assets/{th-DcDC9AAH.js → th-DMmvF5EW.js} +1 -1
  144. package/dist/assets/{traffic-CcaFrARg.js → traffic-DgHqx0ot.js} +3 -3
  145. package/dist/assets/{transfer-CO1mYUp7.js → transfer-CFTVWUIN.js} +1 -1
  146. package/dist/assets/{unsubscribe-CrySuEC_.js → unsubscribe-ClBSlk0u.js} +1 -1
  147. package/dist/assets/{use-mobile-B37G6FHz.js → use-mobile-B-PzRAbm.js} +1 -1
  148. package/dist/assets/{useAsync-DIcJhKIm.js → useAsync-HJBQVHgn.js} +1 -1
  149. package/dist/assets/{useAsyncRetry-DCwz7CH3.js → useAsyncRetry-ru9OmM2c.js} +2 -2
  150. package/dist/assets/{useLocalStorage-fTkn9UDn.js → useLocalStorage-Cd_KRSFh.js} +1 -1
  151. package/dist/assets/{useSetState-Crt4S51m.js → useSetState-BL3ktMon.js} +1 -1
  152. package/dist/assets/{user-center-Cz68llKL.js → user-center-DlZwK1g7.js} +3 -3
  153. package/dist/assets/{util-BHPEeQvS.js → util-CuX2h5UG.js} +1 -1
  154. package/dist/assets/{util-B33zKhsE.js → util-b7UGzXHn.js} +1 -1
  155. package/dist/assets/vendor-arcblock-Bv04Mkff.js +3399 -0
  156. package/dist/assets/vendor-hooks-DlxYXMPL.js +7 -0
  157. package/dist/assets/{vendor-mui-core-BWT1QT-d.js → vendor-mui-core-Dh3XBxY7.js} +21 -21
  158. package/dist/assets/{vendor-mui-x-VJmvJUkN.js → vendor-mui-x-l1ezRCJc.js} +1 -1
  159. package/dist/assets/{vendor-react-D-afvo_7.js → vendor-react-DoD83n6N.js} +1 -1
  160. package/dist/assets/{vendor-utils-CzbloUV0.js → vendor-utils-oUOK1Lc7.js} +6 -6
  161. package/dist/assets/{vi-rd14DF59.js → vi-Bxs4l6dO.js} +1 -1
  162. package/dist/assets/wrap-locale-CkbmGs8Q.js +1 -0
  163. package/dist/assets/{zh-CP_Wl4iq.js → zh-Cw2E9SuI.js} +2 -2
  164. package/dist/assets/{zh-tw-Bm8MIAqQ.js → zh-tw-Dqct16yD.js} +2 -2
  165. package/dist/index.html +6 -6
  166. package/dist/service-worker.js +1 -1
  167. package/package.json +40 -40
  168. package/dist/assets/actions-C7XSyka2.js +0 -1
  169. package/dist/assets/add-component-core-wq0EAE8F.js +0 -765
  170. package/dist/assets/add-resource-aVrooseW.js +0 -1
  171. package/dist/assets/api-CSRyy6oj.js +0 -1
  172. package/dist/assets/button-CfubhTZK.js +0 -1
  173. package/dist/assets/click-to-copy-CWibjXuG.js +0 -1
  174. package/dist/assets/cloneDeep-DvDcCvik.js +0 -1
  175. package/dist/assets/config-DikFZPU7.js +0 -32
  176. package/dist/assets/confirm-DXc_P68H.js +0 -7
  177. package/dist/assets/connect--AWGAxeh.js +0 -1
  178. package/dist/assets/domain-CnpR2-Pn.js +0 -9
  179. package/dist/assets/domain-action-card-l5TDZbeH.js +0 -15
  180. package/dist/assets/domains-DYymQ_65.js +0 -1
  181. package/dist/assets/index-9jpmSx0L.js +0 -11
  182. package/dist/assets/index-CrKuY_PA.js +0 -5
  183. package/dist/assets/index-Dbwcynb7.js +0 -1
  184. package/dist/assets/issue-passport-DNmeWSmt.js +0 -1
  185. package/dist/assets/localization-DSADUTc6.js +0 -1
  186. package/dist/assets/login-bg-BMPVKR1k.svg +0 -5
  187. package/dist/assets/omit-C3h2fvu1.js +0 -1
  188. package/dist/assets/publish-resource-fOMJD2KN.js +0 -1
  189. package/dist/assets/sdk-B9ocVXGO.js +0 -1
  190. package/dist/assets/session-CsQYB5hx.js +0 -1
  191. package/dist/assets/setup-Bljvcr7F.js +0 -19
  192. package/dist/assets/simple-select-wXoKpx5r.js +0 -1
  193. package/dist/assets/vendor-arcblock-THecWMPk.js +0 -3500
  194. package/dist/assets/vendor-hooks-6khEvbqa.js +0 -7
  195. package/dist/assets/wrap-locale-CBhgBt-i.js +0 -1
@@ -0,0 +1,765 @@
1
+ import{a1 as ei,j as i,E as P,a2 as gt,aa as Ve,a3 as X,T as be,t as Yt,aI as ti,bM as ni,I as zo,bx as qo,bN as Ko,z as Vo,aD as Ia,bj as Go,bO as Pa,M as gr,bq as _a,br as La,bs as Na,bo as Aa,ad as Ho,L as Da,bi as Ma,aq as Fa,ak as ri,a4 as Xo,a6 as Ba,ae as et,e as er,bz as $a,x as tr,R as Yo,V as Jo,aj as Qo,bI as Zo,ag as Ua,ab as Xt,aC as Qi,A as Zi,Z as Wa,P as za,G as qa,v as Ka,$ as Va,D as Ga,K as eo,bm as Ha}from"./vendor-mui-core-Dh3XBxY7.js";import{r as L,g as ii,f as Xa,k as Ya,a as oi,e as ke,b as Ja,l as Qa}from"./vendor-react-DoD83n6N.js";import{j as es,d as Za,S as el,s as ts,A as tl}from"./item-BmR66mZ6.js";import{a0 as si,a3 as ut,a8 as ai,E as ns,aD as to,b as rs,e as vt,aE as ot,o as nl,m as rl,n as vr,ab as il,_ as is,aF as no,aG as ol,j as li,C as sl,aH as Qt,D as pr,aI as al,f as ro,aJ as os,aK as dr,ag as ci,al as ss,W as yr,aL as ll,aM as as,aw as cl,aN as ul,aO as Kr,aP as dl,a7 as hl,aQ as pl,aR as fl,a6 as ml}from"./vendor-arcblock-Bv04Mkff.js";import{z as _n,f as $t,Z as gl,$ as vl,h as _t,a0 as yl,D as bl,a1 as xl,a2 as wl,a3 as El,C as br,a4 as ls,X as Sl,a5 as Tl,a6 as jl,a7 as Ol,a8 as or,a9 as io,aa as kl}from"./index-CpfGTKUf.js";import{L as oo}from"./launch-result-message-DgQUOIWL.js";import{P as cs}from"./page-header-Bqi4eBBo.js";import{b as ct,p as Rl,B as Cl,C as so,x as Jn,V as us,_ as Il,a9 as Pl,G as _l,K as Or,w as ui,aa as Ll,ab as Nl,ac as Al,ad as Dl,y as Hn,ae as Ml,c as Fl}from"./vendor-utils-oUOK1Lc7.js";import{u as Bl,C as $l}from"./config-space-BwYNAO5S.js";import{R as kr}from"./logo-uploader-COOjI78W.js";import{S as Ul}from"./index-bZdsGPmc.js";import{s as ds,h as Wl,w as zl,f as ql,a as Kl,b as Vl,c as Gl,M as Hl}from"./index-D-W1QzOs.js";import{m as nr,e as Xl,a as Yl,f as hs,x as Jl}from"./vendor-hooks-DlxYXMPL.js";import{g as Ql}from"./get-safe-url-DnoVfY5w.js";import{p as Zl}from"./index-BZu4MJFr.js";import{r as ec}from"./cloneDeep-6qDcDoTp.js";import{I as ao}from"./index-DPFaqs63.js";import{u as tc}from"./session-BqpWYLN3.js";import{W as nc}from"./did-address-nBrtfdFs.js";import{_ as ps}from"./useLocalStorage-Cd_KRSFh.js";import{f as fs}from"./format-error-LAoTjvJe.js";import{a as lo}from"./api-C4EBZ3D8.js";import{d as rc,a as ic,v as oc,e as sc}from"./util-CuX2h5UG.js";import{u as ms}from"./use-mobile-B-PzRAbm.js";import{C as ac}from"./content-layout-B8euliPp.js";import{C as lc,D as cc,a as uc}from"./connect-to-Bl1JCiMg.js";import{d as dc}from"./ArrowDropDown-_ravVKaf.js";import{d as hc}from"./ChevronLeft-DyVK0SyV.js";import{d as pc}from"./ChevronRight-CMCOlQoz.js";const cf="blocklet-add-component-registry",uf="server-add-registry",df=e=>`resource-${e}-add-registry`;var di={},fc=ei;Object.defineProperty(di,"__esModule",{value:!0});var gs=di.default=void 0,mc=fc(si()),gc=i;gs=di.default=(0,mc.default)((0,gc.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 vs(e){const{info:t}=_n();return L.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({disabled:e,children:t,onConfirm:n}){return L.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}hi.propTypes={disabled:P.bool,children:P.any.isRequired,onConfirm:P.func.isRequired};hi.defaultProps={disabled:!1};function pi({onContinue:e,nextDisabled:t,launching:n,texts:r,description:o}){const[u,d]=L.useState(!1),h=()=>d(y=>!y);return i.jsxs(i.Fragment,{children:[i.jsx(vc,{children:i.jsxs(hi,{disabled:t,onConfirm:e,children:[i.jsx("div",{className:"eula-trigger",onClick:h,children:r.listenName}),i.jsx(ut,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?i.jsxs(i.Fragment,{children:[i.jsx(gt,{size:14}),r.launchingText]}):r.buttonNext})]})}),i.jsx(ai,{open:u,title:r.listenName,onClose:()=>d(!1),children:o})]})}pi.propTypes={onContinue:P.func.isRequired,nextDisabled:P.bool,launching:P.bool,description:P.any,texts:P.object};pi.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const vc=Ve.div`
2
+ margin: 0 auto;
3
+ display: flex;
4
+ justify-content: space-between;
5
+ align-items: center;
6
+
7
+ @media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
8
+ flex-direction: column;
9
+ }
10
+
11
+ .eula-trigger {
12
+ cursor: pointer;
13
+ text-decoration: underline;
14
+ ${e=>e.theme.breakpoints.up("md")} {
15
+ padding-right: 24px;
16
+ }
17
+ ${e=>e.theme.breakpoints.down("md")} {
18
+ padding: 16px;
19
+ }
20
+ font-size: 14px;
21
+ white-space: nowrap;
22
+ &:hover {
23
+ color: ${e=>e.theme.palette.primary.main};
24
+ }
25
+ }
26
+
27
+ .next-button {
28
+ min-width: 200px;
29
+ }
30
+ `;var fi={exports:{}},co=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,yc=/\n/g,bc=/^\s*/,xc=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,wc=/^:\s*/,Ec=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Sc=/^[;\s]*/,Tc=/^\s+|\s+$/g,jc=`
31
+ `,uo="/",ho="*",hn="",Oc="comment",kc="declaration",Rc=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 k=S.match(yc);k&&(n+=k.length);var _=S.lastIndexOf(jc);r=~_?S.length-_:r+S.length}function u(){var S={line:n,column:r};return function(k){return k.position=new d(S),x(),k}}function d(S){this.start=S,this.end={line:n,column:r},this.source=t.source}d.prototype.content=e;function h(S){var k=new Error(t.source+":"+n+":"+r+": "+S);if(k.reason=S,k.filename=t.source,k.line=n,k.column=r,k.source=e,!t.silent)throw k}function y(S){var k=S.exec(e);if(k){var _=k[0];return o(_),e=e.slice(_.length),k}}function x(){y(bc)}function s(S){var k;for(S=S||[];k=a();)k!==!1&&S.push(k);return S}function a(){var S=u();if(!(uo!=e.charAt(0)||ho!=e.charAt(1))){for(var k=2;hn!=e.charAt(k)&&(ho!=e.charAt(k)||uo!=e.charAt(k+1));)++k;if(k+=2,hn===e.charAt(k-1))return h("End of comment missing");var _=e.slice(2,k-2);return r+=2,o(_),e=e.slice(k),r+=2,S({type:Oc,comment:_})}}function O(){var S=u(),k=y(xc);if(k){if(a(),!y(wc))return h("property missing ':'");var _=y(Ec),A=S({type:kc,property:po(k[0].replace(co,hn)),value:_?po(_[0].replace(co,hn)):hn});return y(Sc),A}}function v(){var S=[];s(S);for(var k;k=O();)k!==!1&&(S.push(k),s(S));return S}return x(),v()};function po(e){return e?e.replace(Tc,hn):hn}var Cc=Rc;function ys(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,o=Cc(e),u=typeof t=="function",d,h,y=0,x=o.length;y<x;y++)r=o[y],d=r.property,h=r.value,u?t(d,h,r):h&&(n||(n={}),n[d]=h);return n}fi.exports=ys;fi.exports.default=ys;var Ic=fi.exports;const Pc=ii(Ic),_c={}.hasOwnProperty;function Lc(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Ac(e),o=Fc(e),u=Mc(e);let d,h;if(typeof n=="string"||typeof n=="boolean"?(d=n,n={}):(n||(n={}),d=n.prefix),t&&t.type==="root"){const y=t.children[0];h=t.children.length===1&&y.type==="element"?y:{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 bs(e,h,{schema:n.space==="svg"?ds:Wl,prefix:d==null?r||o||u?"h-":void 0:typeof d=="string"?d:d?"h-":void 0,key:0,react:r,vue:o,vdom:u,hyperscript:Dc(e)})}function bs(e,t,n){const r=n.schema;let o=r,u=t.tagName;const d={},h=[];let y=-1,x;r.space==="html"&&u.toLowerCase()==="svg"&&(o=ds,n.schema=o);for(x in t.properties)t.properties&&_c.call(t.properties,x)&&Nc(d,x,t.properties[x],n,u);if(n.vdom&&(o.space==="html"?u=u.toUpperCase():o.space&&(d.namespace=zl[o.space])),n.prefix&&(n.key++,d.key=n.prefix+n.key),t.children)for(;++y<t.children.length;){const s=t.children[y];s.type==="element"?h.push(bs(e,s,n)):s.type==="text"&&h.push(s.value)}return n.schema=r,h.length>0?e.call(t,u,d,h):e.call(t,u,d)}function Nc(e,t,n,r,o){const u=ql(r.schema,t);let d;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&u.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=u.commaSeparated?Kl(n):Vl(n)),u.boolean&&r.hyperscript&&(n=""),u.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Bc(n,o)),r.vue?u.property!=="style"&&(d="attrs"):u.mustUseProperty||(r.vdom?u.property!=="style"&&(d="attributes"):r.hyperscript&&(d="attrs")),d?e[d]=Object.assign(e[d]||{},{[u.attribute]:n}):u.space&&r.react?e[Gl[u.property]||u.property]=n:e[u.attribute]=n)}function Ac(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Dc(e){return"context"in e&&"cleanup"in e}function Mc(e){return e("div",{}).type==="VirtualNode"}function Fc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Bc(e,t){const n={};try{Pc(e,(r,o)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(u,d)=>d.toUpperCase())]=o})}catch(r){const o=r;throw o.message=t+"[style]"+o.message.slice(9),o}return n}var $c=xs;function xs(e){if(typeof e=="string")return qc(e);if(e==null)return Kc;if(typeof e=="object")return("length"in e?zc:Wc)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Uc(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=xs(e[r]);return t}function Wc(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function zc(e){var t=Uc(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 qc(e){return t;function t(n){return!!(n&&n.type===e)}}function Kc(){return!0}var Vc=xr,Gc=$c,ws=!0,Es="skip",hr=!1;xr.CONTINUE=ws;xr.SKIP=Es;xr.EXIT=hr;function xr(e,t,n,r){var o;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),o=Gc(t),u(e,null,[]);function u(h,y,x){var s=[],a;return(!t||o(h,y,x[x.length-1]||null))&&(s=fo(n(h,x)),s[0]===hr)?s:h.children&&s[0]!==Es?(a=fo(d(h.children,x.concat(h))),a[0]===hr?a:s):s}function d(h,y){for(var x=-1,s=r?-1:1,a=(r?h.length:x)+s,O;a>x&&a<h.length;){if(O=u(h[a],a,y),O[0]===hr)return O;a=typeof O[1]=="number"?O[1]:a+s}}}function fo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[ws,e]:[e]}var Hc=Er,wr=Vc,Xc=wr.CONTINUE,Yc=wr.SKIP,Jc=wr.EXIT;Er.CONTINUE=Xc;Er.SKIP=Yc;Er.EXIT=Jc;function Er(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),wr(e,t,o,r);function o(u,d){var h=d[d.length-1],y=h?h.children.indexOf(u):null;return n(u,y,h)}}var Qc=Hc,Zc=Object.prototype.hasOwnProperty,Rr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},eu=function(t){return Qc(t,"element",tu),t};function tu(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Rr)!Zc.call(Rr,t)||e.properties[t]===void 0||(n=Rr[t],nu(e,n,e.properties[t]),delete e.properties[t])}}function nu(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 ru=ii(eu);function iu(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 ou={}.hasOwnProperty,su=new Set(["table","thead","tbody","tfoot","tr"]);function au(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(u){let d=Lc(o,n?ru(u):u,e.prefix);return u.type==="root"?(d=d&&typeof d=="object"&&"type"in d&&"props"in d&&d.type==="div"&&(u.children.length!==1||u.children[0].type!=="element")?d.props.children:[d],t(e.Fragment||"div",{},d)):d}function o(u,d,h){if(h&&su.has(u)&&(h=h.filter(y=>!iu(y))),e.components&&ou.call(e.components,u)){const y=e.components[u];return e.passNode&&typeof y=="function"&&(d=Object.assign({node:this},d)),t(y,d,h)}return t(u,d,h)}}function mi({children:e}){return i.jsx(lu,{children:e})}const mo="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",lu=Ve(X)`
32
+ .highlight pre,
33
+ pre {
34
+ border-radius: 5px;
35
+ }
36
+ code {
37
+ font-family: ${mo};
38
+ }
39
+ pre code {
40
+ font-size: 14px;
41
+ font-family: ${mo};
42
+ }
43
+
44
+ h1,
45
+ h2,
46
+ h3,
47
+ h4,
48
+ h5,
49
+ h6 {
50
+ font-weight: 700 !important;
51
+ font-size: 1.2rem !important;
52
+ line-height: 1.5 !important;
53
+ margin-bottom: 16px;
54
+ margin-top: 24px;
55
+ border-bottom: initial !important;
56
+ }
57
+
58
+ .CodeMirror pre {
59
+ background: #f6f8fa !important;
60
+ }
61
+
62
+ .anchor {
63
+ display: none;
64
+ }
65
+ `;mi.propTypes={children:P.any.isRequired};mi.defaultProps={};function Ss({infoList:e=[]}){return i.jsx(X,{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(X,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),i.jsx(X,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}Ss.propTypes={infoList:P.arrayOf(P.shape({key:P.string,value:P.string}))};const cu=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,uu=new au({createElement:L.createElement}).Compiler,Pt={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 gi({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:o,did:u}=r,d=$t.getDisplayName({meta:r}),h=nr(()=>o&&u?fetch(to(o,"/api/blocklets",u,"readme")).then(S=>S.json()):null,{refreshDeps:[o,u]}),y=Xl(()=>h.data?h.data[t]||h.data.en||h.data[Object.keys(h.data)[0]]:"",[h]),x=r&&r.htmlAst?uu(r.htmlAst):"",s=cu(r);let a=ct(r,"owner.fullName");if(a){const S=ct(r,"owner.did");S&&(a=i.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:1},children:[a,i.jsx(ns,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else a=ct(r,"author.name");const O=[{key:ct(Pt[t],"appinfo.name"),value:$t.getDisplayName({meta:r})},{key:ct(Pt[t],"appinfo.version"),value:r.version},{key:ct(Pt[t],"appinfo.author"),value:a},{type:"description",key:ct(Pt[t],"appinfo.description"),value:r.description}];r.requirements&&O.push({key:ct(Pt[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&O.push({key:ct(Pt[t],"appinfo.community"),value:i.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&O.push({key:ct(Pt[t],"appinfo.documentation"),value:i.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&O.push({key:ct(Pt[t],"appinfo.support"),value:i.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),x&&O.push({key:ct(Pt[t],"appinfo.overview"),value:""});let v;return t==="zh"?v=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:"下面为该应用的信息:"})]}):v=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(hu,{children:[n||v,i.jsx(Ss,{infoList:O}),y?i.jsxs("div",{className:"app-overview",children:[i.jsx(be,{variant:"h5",gutterBottom:!0,children:ct(Pt[t],"appinfo.overview")}),i.jsx(mi,{children:i.jsx(du,{component:"div",className:"content-wrapper post-content",children:i.jsx(Hl,{source:y,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,k,_)=>S.startsWith("/")?to(o,S):S})})})]}):x?i.jsx("div",{className:"app-overview",children:x}):null]})}const du=Ve(be)`
66
+ width: 100%;
67
+ word-wrap: break-word;
68
+ word-break: break-word;
69
+ line-height: 1.5em;
70
+ min-height: 10vh;
71
+ margin-bottom: 40px !important;
72
+
73
+ .alert-content {
74
+ max-width: 100%;
75
+ p:last-of-type {
76
+ margin-bottom: 0;
77
+ }
78
+ }
79
+
80
+ iframe {
81
+ width: 100% !important;
82
+ }
83
+ `,hu=Ve.div`
84
+ .info-table {
85
+ a {
86
+ word-break: break-all;
87
+ }
88
+ }
89
+ .app-overview {
90
+ font-size: 16px;
91
+ margin: 16px 0 0 16px;
92
+ h1 {
93
+ margin: 8px 0;
94
+ font-size: 20px;
95
+ }
96
+ h2 {
97
+ margin: 8px 0;
98
+ font-size: 18px;
99
+ }
100
+ ul {
101
+ display: block;
102
+ list-style-type: disc;
103
+ padding-left: 2em;
104
+ li {
105
+ display: list-item;
106
+ list-style: disc;
107
+ }
108
+ }
109
+ blockquote {
110
+ margin-left: 2em;
111
+ }
112
+ }
113
+ `;gi.propTypes={blockletMeta:P.object.isRequired,locale:P.string.isRequired,handleDescEle:P.node};gi.defaultProps={handleDescEle:""};function pu({...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 ",rs.COPYRIGHT_OWNER," version 2020-08-28"]}),i.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),i.jsx("p",{children:"暂无"})]})}function fu(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 vi({installRelated:e,meta:t,show:n,onClose:r,components:o,loading:u}){const{t:d}=vt(),h=Yt(a=>a.breakpoints.down("md"));if(!n)return null;const y=!u&&o.length===0,x=!u&&o.length!==0,s=40;return i.jsxs(ai,{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:[u&&i.jsx(X,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:i.jsx(X,{sx:{fontSize:32},color:"primary.main",component:ot,icon:"line-md:loading-loop"})}),y&&i.jsx(X,{sx:{textAlign:"center"},children:d("blocklet.component.noDependencies",{name:t.title})}),x&&i.jsx(X,{sx:{marginBottom:2},children:o.map(a=>{if(!a.meta)return null;const{required:O}=a;let v;return e||O?v=1:v=.5,i.jsxs(X,{sx:{opacity:v,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:fu(a),alt:a.meta.title}),i.jsxs(X,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[i.jsxs(X,{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(X,{sx:{display:O?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:d("blocklet.component.required")}),i.jsxs(X,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[a.meta.version,i.jsx(X,{className:"link-icon",icon:"fluent:open-20-filled",component:ot,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),i.jsx(X,{sx:{marginTop:0,opacity:.7},children:a.meta.description})]})]},a.meta.did)})})]})}vi.propTypes={meta:P.object,show:P.bool,onClose:P.func.isRequired,installRelated:P.func,components:P.array.isRequired,loading:P.bool.isRequired};vi.defaultProps={meta:null,show:!1,installRelated:!1};function mu(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function gu(e){const{api:t}=_n(),[n]=Xa(),r=n.get("blocklet_meta_url")||mu(e),[o,u]=L.useState([]),[d,h]=L.useState(!1);return L.useEffect(()=>{!r||e!=null&&e.inputUrl||(h(!0),t.getDynamicComponents({input:{url:r}}).then(y=>{u(y.components)}).finally(()=>{h(!1)}))},[r]),{components:o,loading:d}}function yi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:o}){const u=Ya(),{t:d,locale:h}=vt(),[y,x]=L.useState(!1),{components:s,loading:a}=gu(n),O=vs(n),v=r||(()=>{u(`/launch-blocklet/install${window.location.search}`)}),S=()=>{x(!0)},k=()=>{x(!1)};return i.jsxs(vu,{children:[i.jsx("div",{className:"app-content",children:i.jsx("div",{className:"agreement",children:i.jsx("div",{className:"agreement-content",children:O?i.jsx(gi,{blockletMeta:{data:n},locale:h,handleDescEle:o}):i.jsx(X,{sx:{p:3},children:i.jsx(be,{children:d("launchBlocklet.dockerBlockletCantInstall")})})})})}),i.jsxs(X,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[a?i.jsx(ot,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,O&&t&&(s!=null&&s.length)?i.jsxs(X,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[i.jsx(ti,{sx:{mr:.5},checked:e,onChange:_=>t(_.currentTarget.checked),control:i.jsx(ni,{}),label:i.jsx("span",{children:d("launchBlocklet.installRelatedComponents")})}),i.jsx(X,{sx:{"> button svg":{color:"primary.main"}},children:i.jsx(zo,{size:"small",onClick:S,children:i.jsx(ot,{icon:"octicon:package-dependencies-16"})})})]}):null,i.jsx("div",{className:"button-container","data-cy":"agree-all",children:O?i.jsx(pi,{onContinue:v,description:i.jsx(pu,{}),texts:{listenName:d("launchBlocklet.license"),buttonNext:d("launchBlocklet.next")}}):null})]}),i.jsx(vi,{installRelated:e,meta:n,show:y,onClose:k,components:s,loading:a})]})}yi.propTypes={meta:P.object.isRequired,onClickNext:P.func,handleDescEle:P.node,installRelated:P.bool,onChangeInstallRelated:P.func};yi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const vu=Ve.div`
114
+ display: flex;
115
+ flex-direction: column;
116
+ align-items: center;
117
+ width: 100%;
118
+ height: 100%;
119
+ flex: 1;
120
+ .app-content {
121
+ padding: 2px 24px 24px;
122
+ ${e=>e.theme.breakpoints.down("md")} {
123
+ padding-top: 10px;
124
+ }
125
+ width: 100%;
126
+ flex: 1;
127
+ letter-spacing: normal;
128
+ }
129
+ .agreement {
130
+ position: relative;
131
+ display: flex;
132
+ flex-direction: column;
133
+ width: 100%;
134
+ height: 100%;
135
+ border: 1px solid ${e=>e.theme.palette.grey[100]};
136
+ border-radius: 12px;
137
+ ${e=>e.theme.breakpoints.up("md")} {
138
+ margin-top: 24px;
139
+ }
140
+ ${e=>e.theme.breakpoints.down("md")} {
141
+ margin-top: 16px;
142
+ }
143
+ .agreement-content {
144
+ position: absolute;
145
+ left: 0;
146
+ top: 0;
147
+ width: 100%;
148
+ height: 100%;
149
+ font-size: 14px;
150
+ overflow-y: auto;
151
+ ${e=>e.theme.breakpoints.up("md")} {
152
+ padding: 0 24px;
153
+ }
154
+ ${e=>e.theme.breakpoints.down("md")} {
155
+ padding: 0 16px;
156
+ }
157
+ &:after {
158
+ display: block;
159
+ content: '';
160
+ height: 24px;
161
+ }
162
+ }
163
+ }
164
+ .agreement-bottom {
165
+ display: flex;
166
+ width: 100%;
167
+ padding: 24px;
168
+ ${e=>e.theme.breakpoints.up("md")} {
169
+ flex-direction: row;
170
+ align-items: center;
171
+ margin-left: auto;
172
+ }
173
+ ${e=>e.theme.breakpoints.down("md")} {
174
+ flex-direction: column;
175
+ align-items: center;
176
+ padding-top: 0;
177
+ padding-bottom: 16px;
178
+ }
179
+ }
180
+ .button-container {
181
+ ${e=>e.theme.breakpoints.up("md")} {
182
+ margin-left: auto;
183
+ }
184
+ ${e=>e.theme.breakpoints.down("md")} {
185
+ padding-top: 0;
186
+ padding-bottom: 16px;
187
+ }
188
+ }
189
+ `;var Ts={},bi={exports:{}},js={exports:{}},qn=js.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-"+Os(e)}}},go={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:Os};Object.keys(qn).forEach(function(e){Object.keys(go).forEach(function(t){qn[e][t]||(qn[e][t]=go[t])}),qn[e].protocols_re=RegExp("^("+qn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function Os(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var ks=js.exports,vo=ks,Cn=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},yu=Ge;function Ge(e,t,n,r,o,u,d){var h=this;h.type=e,Object.keys(vo[e]).forEach(function(y){h[y]=vo[e][y]}),h.user=t,h.auth=n,h.project=r,h.committish=o,h.default=u,h.opts=d||{}}Ge.prototype.hash=function(){return this.committish?"#"+this.committish:""};Ge.prototype._fill=function(e,t){if(e){var n=Cn({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=Cn(Cn({},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,u=n.committish,d=n.fragment,h=n.path,y=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=y.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=u?"#"+u:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var x=e;return Object.keys(n).forEach(function(s){x=x.replace(new RegExp("[{]"+s+"[}]","g"),n[s])}),t.noGitPlus?x.replace(/^git[+]/,""):x}};Ge.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Ge.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Ge.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Cn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Ge.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Ge.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Ge.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Ge.prototype.git=function(e){return this._fill(this.gittemplate,e)};Ge.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Ge.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Ge.prototype.tarball=function(e){var t=Cn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Ge.prototype.file=function(e,t){return this._fill(this.filetemplate,Cn({path:e},t))};Ge.prototype.getDefaultRepresentation=function(){return this.default};Ge.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Cr,yo;function bu(){return yo||(yo=1,Cr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Cr}var xu=Se;Se.Node=mn;Se.create=Se;function Se(e){var t=this;if(t instanceof Se||(t=new Se),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}Se.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};Se.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++}};Se.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++}};Se.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Eu(this,arguments[e]);return this.length};Se.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Su(this,arguments[e]);return this.length};Se.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}};Se.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}};Se.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};Se.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};Se.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};Se.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};Se.prototype.map=function(e,t){t=t||this;for(var n=new Se,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};Se.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Se,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};Se.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};Se.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};Se.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};Se.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};Se.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 Se;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};Se.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 Se;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};Se.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 u=[],r=0;o&&r<t;r++)u.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=wu(this,o,n[r]);return u};Se.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 wu(e,t,n){var r=t===e.head?new mn(n,null,t,e):new mn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function Eu(e,t){e.tail=new mn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Su(e,t){e.head=new mn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function mn(e,t,n,r){if(!(this instanceof mn))return new mn(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{bu()(Se)}catch{}const Tu=xu,pn=Symbol("max"),Bt=Symbol("length"),Rn=Symbol("lengthCalculator"),Xn=Symbol("allowStale"),fn=Symbol("maxAge"),Ft=Symbol("dispose"),bo=Symbol("noDisposeOnSet"),Ue=Symbol("lruList"),Ot=Symbol("cache"),Rs=Symbol("updateAgeOnGet"),Ir=()=>1;class ju{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[pn]=t.max||1/0;const n=t.length||Ir;if(this[Rn]=typeof n!="function"?Ir:n,this[Xn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[fn]=t.maxAge||0,this[Ft]=t.dispose,this[bo]=t.noDisposeOnSet||!1,this[Rs]=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[pn]=t||1/0,Kn(this)}get max(){return this[pn]}set allowStale(t){this[Xn]=!!t}get allowStale(){return this[Xn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[fn]=t,Kn(this)}get maxAge(){return this[fn]}set lengthCalculator(t){typeof t!="function"&&(t=Ir),t!==this[Rn]&&(this[Rn]=t,this[Bt]=0,this[Ue].forEach(n=>{n.length=this[Rn](n.value,n.key),this[Bt]+=n.length})),Kn(this)}get lengthCalculator(){return this[Rn]}get length(){return this[Bt]}get itemCount(){return this[Ue].length}rforEach(t,n){n=n||this;for(let r=this[Ue].tail;r!==null;){const o=r.prev;xo(this,t,r,n),r=o}}forEach(t,n){n=n||this;for(let r=this[Ue].head;r!==null;){const o=r.next;xo(this,t,r,n),r=o}}keys(){return this[Ue].toArray().map(t=>t.key)}values(){return this[Ue].toArray().map(t=>t.value)}reset(){this[Ft]&&this[Ue]&&this[Ue].length&&this[Ue].forEach(t=>this[Ft](t.key,t.value)),this[Ot]=new Map,this[Ue]=new Tu,this[Bt]=0}dump(){return this[Ue].map(t=>fr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Ue]}set(t,n,r){if(r=r||this[fn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const o=r?Date.now():0,u=this[Rn](n,t);if(this[Ot].has(t)){if(u>this[pn])return In(this,this[Ot].get(t)),!1;const y=this[Ot].get(t).value;return this[Ft]&&(this[bo]||this[Ft](t,y.value)),y.now=o,y.maxAge=r,y.value=n,this[Bt]+=u-y.length,y.length=u,this.get(t),Kn(this),!0}const d=new Ou(t,n,u,o,r);return d.length>this[pn]?(this[Ft]&&this[Ft](t,n),!1):(this[Bt]+=d.length,this[Ue].unshift(d),this[Ot].set(t,this[Ue].head),Kn(this),!0)}has(t){if(!this[Ot].has(t))return!1;const n=this[Ot].get(t).value;return!fr(this,n)}get(t){return Pr(this,t,!0)}peek(t){return Pr(this,t,!1)}pop(){const t=this[Ue].tail;return t?(In(this,t),t.value):null}del(t){In(this,this[Ot].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const o=t[r],u=o.e||0;if(u===0)this.set(o.k,o.v);else{const d=u-n;d>0&&this.set(o.k,o.v,d)}}}prune(){this[Ot].forEach((t,n)=>Pr(this,n,!1))}}const Pr=(e,t,n)=>{const r=e[Ot].get(t);if(r){const o=r.value;if(fr(e,o)){if(In(e,r),!e[Xn])return}else n&&(e[Rs]&&(r.value.now=Date.now()),e[Ue].unshiftNode(r));return o.value}},fr=(e,t)=>{if(!t||!t.maxAge&&!e[fn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[fn]&&n>e[fn]},Kn=e=>{if(e[Bt]>e[pn])for(let t=e[Ue].tail;e[Bt]>e[pn]&&t!==null;){const n=t.prev;In(e,t),t=n}},In=(e,t)=>{if(t){const n=t.value;e[Ft]&&e[Ft](n.key,n.value),e[Bt]-=n.length,e[Ot].delete(n.key),e[Ue].removeNode(t)}};class Ou{constructor(t,n,r,o,u){this.key=t,this.value=n,this.length=r,this.now=o,this.maxAge=u||0}}const xo=(e,t,n,r)=>{let o=n.value;fr(e,o)&&(In(e,n),e[Xn]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var ku=ju,Vr=gl,wo=ks,Ru=bi.exports=yu,Cu=ku,_r=new Cu({max:1e3}),Iu={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Pu(e){return Iu[e]||e.slice(0,-1)}var _u={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};bi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return _r.has(n)||_r.set(n,Lu(e,t)),_r.get(n)}};function Lu(e,t){if(!(e==null||e==="")){var n=Au(Nu(e)?"github:"+e:e),r=Du(n),o=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),u=Object.keys(wo).map(function(d){try{var h=wo[d],y=null;r.auth&&_u[r.protocol]&&(y=r.auth);var x=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 v=h.pathmatch,S=r.path.match(v);if(!S)return;S[1]!==null&&S[1]!==void 0&&(s=decodeURIComponent(S[1].replace(/^:/,""))),a=decodeURIComponent(S[2]),O=Pu(r.protocol)}return new Ru(d,s,y,a,x,O,t)}catch(k){if(!(k instanceof URIError))throw k}}).filter(function(d){return d});if(u.length===1)return u[0]}}function Nu(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Au(e){var t=Vr.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Du(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=Vr.parse(e);if(n.auth){const o=e.match(/[^@]+@[^:/]+/);if(o){var r=new Vr.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 Mu=bi.exports,gn={},re={},Fu=null;const Bu=Object.freeze(Object.defineProperty({__proto__:null,default:Fu},Symbol.toStringTag,{value:"Module"})),Cs=oi(Bu),$u=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Uu=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Wu={charsWide:$u,charsFullWidth:Uu};const{charsWide:zu,charsFullWidth:qu}=Wu,Is=new RegExp(`[${zu.join("")}${qu.join("")}]`,"g"),Ku=e=>e.replace(Is,"xx").length;var Vu={default:Ku,charsRegex:Is};/*!
190
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
191
+ *
192
+ * Copyright (c) 2014-2016, Jon Schlinkert.
193
+ * Licensed under the MIT License.
194
+ */var Gu=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
+ * is-glob <https://github.com/jonschlinkert/is-glob>
196
+ *
197
+ * Copyright (c) 2014-2017, Jon Schlinkert.
198
+ * Released under the MIT License.
199
+ */var Hu=Gu,Ps={"{":"}","(":")","[":"]"},Xu=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,o=-2,u=-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))||u!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(u=e.indexOf(")",t),u>t&&(d=e.indexOf("\\",t),d===-1||d>u))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(u=e.indexOf(")",n),u>n&&(d=e.indexOf("\\",n),d===-1||d>u))))return!0;if(e[t]==="\\"){var h=e[t+1];t+=2;var y=Ps[h];if(y){var x=e.indexOf(y,t);x!==-1&&(t=x+1)}if(e[t]==="!")return!0}else t++}return!1},Yu=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=Ps[n];if(r){var o=e.indexOf(r,t);o!==-1&&(t=o+1)}if(e[t]==="!")return!0}else t++}return!1},Ju=function(t,n){if(typeof t!="string"||t==="")return!1;if(Hu(t))return!0;var r=Xu;return n&&n.strict===!1&&(r=Yu),r(t)},Gr={exports:{}};(function(e,t){var n={};t=e.exports=M;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,u=Number.MAX_SAFE_INTEGER||9007199254740991,d=16,h=o-6,y=t.re=[],x=t.safeRe=[],s=t.src=[],a=t.tokens={},O=0;function v(l){a[l]=O++}var S="[a-zA-Z0-9-]",k=[["\\s",1],["\\d",o],[S,h]];function _(l){for(var b=0;b<k.length;b++){var w=k[b][0],C=k[b][1];l=l.split(w+"*").join(w+"{0,"+C+"}").split(w+"+").join(w+"{1,"+C+"}")}return l}v("NUMERICIDENTIFIER"),s[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",v("NUMERICIDENTIFIERLOOSE"),s[a.NUMERICIDENTIFIERLOOSE]="\\d+",v("NONNUMERICIDENTIFIER"),s[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",v("MAINVERSION"),s[a.MAINVERSION]="("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")",v("MAINVERSIONLOOSE"),s[a.MAINVERSIONLOOSE]="("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")",v("PRERELEASEIDENTIFIER"),s[a.PRERELEASEIDENTIFIER]="(?:"+s[a.NUMERICIDENTIFIER]+"|"+s[a.NONNUMERICIDENTIFIER]+")",v("PRERELEASEIDENTIFIERLOOSE"),s[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[a.NUMERICIDENTIFIERLOOSE]+"|"+s[a.NONNUMERICIDENTIFIER]+")",v("PRERELEASE"),s[a.PRERELEASE]="(?:-("+s[a.PRERELEASEIDENTIFIER]+"(?:\\."+s[a.PRERELEASEIDENTIFIER]+")*))",v("PRERELEASELOOSE"),s[a.PRERELEASELOOSE]="(?:-?("+s[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[a.PRERELEASEIDENTIFIERLOOSE]+")*))",v("BUILDIDENTIFIER"),s[a.BUILDIDENTIFIER]=S+"+",v("BUILD"),s[a.BUILD]="(?:\\+("+s[a.BUILDIDENTIFIER]+"(?:\\."+s[a.BUILDIDENTIFIER]+")*))",v("FULL"),v("FULLPLAIN"),s[a.FULLPLAIN]="v?"+s[a.MAINVERSION]+s[a.PRERELEASE]+"?"+s[a.BUILD]+"?",s[a.FULL]="^"+s[a.FULLPLAIN]+"$",v("LOOSEPLAIN"),s[a.LOOSEPLAIN]="[v=\\s]*"+s[a.MAINVERSIONLOOSE]+s[a.PRERELEASELOOSE]+"?"+s[a.BUILD]+"?",v("LOOSE"),s[a.LOOSE]="^"+s[a.LOOSEPLAIN]+"$",v("GTLT"),s[a.GTLT]="((?:<|>)?=?)",v("XRANGEIDENTIFIERLOOSE"),s[a.XRANGEIDENTIFIERLOOSE]=s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",v("XRANGEIDENTIFIER"),s[a.XRANGEIDENTIFIER]=s[a.NUMERICIDENTIFIER]+"|x|X|\\*",v("XRANGEPLAIN"),s[a.XRANGEPLAIN]="[v=\\s]*("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:"+s[a.PRERELEASE]+")?"+s[a.BUILD]+"?)?)?",v("XRANGEPLAINLOOSE"),s[a.XRANGEPLAINLOOSE]="[v=\\s]*("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:"+s[a.PRERELEASELOOSE]+")?"+s[a.BUILD]+"?)?)?",v("XRANGE"),s[a.XRANGE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAIN]+"$",v("XRANGELOOSE"),s[a.XRANGELOOSE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAINLOOSE]+"$",v("COERCE"),s[a.COERCE]="(^|[^\\d])(\\d{1,"+d+"})(?:\\.(\\d{1,"+d+"}))?(?:\\.(\\d{1,"+d+"}))?(?:$|[^\\d])",v("COERCERTL"),y[a.COERCERTL]=new RegExp(s[a.COERCE],"g"),x[a.COERCERTL]=new RegExp(_(s[a.COERCE]),"g"),v("LONETILDE"),s[a.LONETILDE]="(?:~>?)",v("TILDETRIM"),s[a.TILDETRIM]="(\\s*)"+s[a.LONETILDE]+"\\s+",y[a.TILDETRIM]=new RegExp(s[a.TILDETRIM],"g"),x[a.TILDETRIM]=new RegExp(_(s[a.TILDETRIM]),"g");var A="$1~";v("TILDE"),s[a.TILDE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAIN]+"$",v("TILDELOOSE"),s[a.TILDELOOSE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAINLOOSE]+"$",v("LONECARET"),s[a.LONECARET]="(?:\\^)",v("CARETTRIM"),s[a.CARETTRIM]="(\\s*)"+s[a.LONECARET]+"\\s+",y[a.CARETTRIM]=new RegExp(s[a.CARETTRIM],"g"),x[a.CARETTRIM]=new RegExp(_(s[a.CARETTRIM]),"g");var Y="$1^";v("CARET"),s[a.CARET]="^"+s[a.LONECARET]+s[a.XRANGEPLAIN]+"$",v("CARETLOOSE"),s[a.CARETLOOSE]="^"+s[a.LONECARET]+s[a.XRANGEPLAINLOOSE]+"$",v("COMPARATORLOOSE"),s[a.COMPARATORLOOSE]="^"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+")$|^$",v("COMPARATOR"),s[a.COMPARATOR]="^"+s[a.GTLT]+"\\s*("+s[a.FULLPLAIN]+")$|^$",v("COMPARATORTRIM"),s[a.COMPARATORTRIM]="(\\s*)"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+"|"+s[a.XRANGEPLAIN]+")",y[a.COMPARATORTRIM]=new RegExp(s[a.COMPARATORTRIM],"g"),x[a.COMPARATORTRIM]=new RegExp(_(s[a.COMPARATORTRIM]),"g");var U="$1$2$3";v("HYPHENRANGE"),s[a.HYPHENRANGE]="^\\s*("+s[a.XRANGEPLAIN]+")\\s+-\\s+("+s[a.XRANGEPLAIN]+")\\s*$",v("HYPHENRANGELOOSE"),s[a.HYPHENRANGELOOSE]="^\\s*("+s[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[a.XRANGEPLAINLOOSE]+")\\s*$",v("STAR"),s[a.STAR]="(<|>)?=?\\s*\\*";for(var J=0;J<O;J++)r(J,s[J]),y[J]||(y[J]=new RegExp(s[J]),x[J]=new RegExp(_(s[J])));t.parse=j;function j(l,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),l instanceof M)return l;if(typeof l!="string"||l.length>o)return null;var w=b.loose?x[a.LOOSE]:x[a.FULL];if(!w.test(l))return null;try{return new M(l,b)}catch{return null}}t.valid=W;function W(l,b){var w=j(l,b);return w?w.version:null}t.clean=Q;function Q(l,b){var w=j(l.trim().replace(/^[=v]+/,""),b);return w?w.version:null}t.SemVer=M;function M(l,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),l instanceof M){if(l.loose===b.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 M))return new M(l,b);r("SemVer",l,b),this.options=b,this.loose=!!b.loose;var w=l.trim().match(b.loose?x[a.LOOSE]:x[a.FULL]);if(!w)throw new TypeError("Invalid Version: "+l);if(this.raw=l,this.major=+w[1],this.minor=+w[2],this.patch=+w[3],this.major>u||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u||this.patch<0)throw new TypeError("Invalid patch version");w[4]?this.prerelease=w[4].split(".").map(function(C){if(/^[0-9]+$/.test(C)){var N=+C;if(N>=0&&N<u)return N}return C}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}M.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},M.prototype.toString=function(){return this.version},M.prototype.compare=function(l){return r("SemVer.compare",this.version,this.options,l),l instanceof M||(l=new M(l,this.options)),this.compareMain(l)||this.comparePre(l)},M.prototype.compareMain=function(l){return l instanceof M||(l=new M(l,this.options)),Re(this.major,l.major)||Re(this.minor,l.minor)||Re(this.patch,l.patch)},M.prototype.comparePre=function(l){if(l instanceof M||(l=new M(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 b=0;do{var w=this.prerelease[b],C=l.prerelease[b];if(r("prerelease compare",b,w,C),w===void 0&&C===void 0)return 0;if(C===void 0)return 1;if(w===void 0)return-1;if(w===C)continue;return Re(w,C)}while(++b)},M.prototype.compareBuild=function(l){l instanceof M||(l=new M(l,this.options));var b=0;do{var w=this.build[b],C=l.build[b];if(r("prerelease compare",b,w,C),w===void 0&&C===void 0)return 0;if(C===void 0)return 1;if(w===void 0)return-1;if(w===C)continue;return Re(w,C)}while(++b)},M.prototype.inc=function(l,b){switch(l){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",b),this.inc("pre",b);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",b),this.inc("pre",b);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 w=this.prerelease.length;--w>=0;)typeof this.prerelease[w]=="number"&&(this.prerelease[w]++,w=-2);w===-1&&this.prerelease.push(0)}b&&(this.prerelease[0]===b?isNaN(this.prerelease[1])&&(this.prerelease=[b,0]):this.prerelease=[b,0]);break;default:throw new Error("invalid increment argument: "+l)}return this.format(),this.raw=this.version,this},t.inc=de;function de(l,b,w,C){typeof w=="string"&&(C=w,w=void 0);try{return new M(l,w).inc(b,C).version}catch{return null}}t.diff=Z;function Z(l,b){if(Nt(l,b))return null;var w=j(l),C=j(b),N="";if(w.prerelease.length||C.prerelease.length){N="pre";var K="prerelease"}for(var H in w)if((H==="major"||H==="minor"||H==="patch")&&w[H]!==C[H])return N+H;return K}t.compareIdentifiers=Re;var ae=/^[0-9]+$/;function Re(l,b){var w=ae.test(l),C=ae.test(b);return w&&C&&(l=+l,b=+b),l===b?0:w&&!C?-1:C&&!w?1:l<b?-1:1}t.rcompareIdentifiers=Fe;function Fe(l,b){return Re(b,l)}t.major=$e;function $e(l,b){return new M(l,b).major}t.minor=nt;function nt(l,b){return new M(l,b).minor}t.patch=te;function te(l,b){return new M(l,b).patch}t.compare=ge;function ge(l,b,w){return new M(l,w).compare(new M(b,w))}t.compareLoose=z;function z(l,b){return ge(l,b,!0)}t.compareBuild=Ce;function Ce(l,b,w){var C=new M(l,w),N=new M(b,w);return C.compare(N)||C.compareBuild(N)}t.rcompare=se;function se(l,b,w){return ge(b,l,w)}t.sort=ht;function ht(l,b){return l.sort(function(w,C){return t.compareBuild(w,C,b)})}t.rsort=Oe;function Oe(l,b){return l.sort(function(w,C){return t.compareBuild(C,w,b)})}t.gt=He;function He(l,b,w){return ge(l,b,w)>0}t.lt=We;function We(l,b,w){return ge(l,b,w)<0}t.eq=Nt;function Nt(l,b,w){return ge(l,b,w)===0}t.neq=Zt;function Zt(l,b,w){return ge(l,b,w)!==0}t.gte=Ut;function Ut(l,b,w){return ge(l,b,w)>=0}t.lte=en;function en(l,b,w){return ge(l,b,w)<=0}t.cmp=_e;function _e(l,b,w,C){switch(b){case"===":return typeof l=="object"&&(l=l.version),typeof w=="object"&&(w=w.version),l===w;case"!==":return typeof l=="object"&&(l=l.version),typeof w=="object"&&(w=w.version),l!==w;case"":case"=":case"==":return Nt(l,w,C);case"!=":return Zt(l,w,C);case">":return He(l,w,C);case">=":return Ut(l,w,C);case"<":return We(l,w,C);case"<=":return en(l,w,C);default:throw new TypeError("Invalid operator: "+b)}}t.Comparator=Le;function Le(l,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),l instanceof Le){if(l.loose===!!b.loose)return l;l=l.value}if(!(this instanceof Le))return new Le(l,b);l=l.trim().split(/\s+/).join(" "),r("comparator",l,b),this.options=b,this.loose=!!b.loose,this.parse(l),this.semver===Xe?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Xe={};Le.prototype.parse=function(l){var b=this.options.loose?x[a.COMPARATORLOOSE]:x[a.COMPARATOR],w=l.match(b);if(!w)throw new TypeError("Invalid comparator: "+l);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new M(w[2],this.options.loose):this.semver=Xe},Le.prototype.toString=function(){return this.value},Le.prototype.test=function(l){if(r("Comparator.test",l,this.options.loose),this.semver===Xe||l===Xe)return!0;if(typeof l=="string")try{l=new M(l,this.options)}catch{return!1}return _e(l,this.operator,this.semver,this.options)},Le.prototype.intersects=function(l,b){if(!(l instanceof Le))throw new TypeError("a Comparator is required");(!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new xe(l.value,b),rt(this.value,w,b));if(l.operator==="")return l.value===""?!0:(w=new xe(this.value,b),rt(l.semver,w,b));var C=(this.operator===">="||this.operator===">")&&(l.operator===">="||l.operator===">"),N=(this.operator==="<="||this.operator==="<")&&(l.operator==="<="||l.operator==="<"),K=this.semver.version===l.semver.version,H=(this.operator===">="||this.operator==="<=")&&(l.operator===">="||l.operator==="<="),me=_e(this.semver,"<",l.semver,b)&&(this.operator===">="||this.operator===">")&&(l.operator==="<="||l.operator==="<"),he=_e(this.semver,">",l.semver,b)&&(this.operator==="<="||this.operator==="<")&&(l.operator===">="||l.operator===">");return C||N||K&&H||me||he},t.Range=xe;function xe(l,b){if((!b||typeof b!="object")&&(b={loose:!!b,includePrerelease:!1}),l instanceof xe)return l.loose===!!b.loose&&l.includePrerelease===!!b.includePrerelease?l:new xe(l.raw,b);if(l instanceof Le)return new xe(l.value,b);if(!(this instanceof xe))return new xe(l,b);if(this.options=b,this.loose=!!b.loose,this.includePrerelease=!!b.includePrerelease,this.raw=l.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(w){return this.parseRange(w.trim())},this).filter(function(w){return w.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}xe.prototype.format=function(){return this.range=this.set.map(function(l){return l.join(" ").trim()}).join("||").trim(),this.range},xe.prototype.toString=function(){return this.range},xe.prototype.parseRange=function(l){var b=this.options.loose,w=b?x[a.HYPHENRANGELOOSE]:x[a.HYPHENRANGE];l=l.replace(w,De),r("hyphen replace",l),l=l.replace(x[a.COMPARATORTRIM],U),r("comparator trim",l,x[a.COMPARATORTRIM]),l=l.replace(x[a.TILDETRIM],A),l=l.replace(x[a.CARETTRIM],Y),l=l.split(/\s+/).join(" ");var C=b?x[a.COMPARATORLOOSE]:x[a.COMPARATOR],N=l.split(" ").map(function(K){return An(K,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(N=N.filter(function(K){return!!K.match(C)})),N=N.map(function(K){return new Le(K,this.options)},this),N},xe.prototype.intersects=function(l,b){if(!(l instanceof xe))throw new TypeError("a Range is required");return this.set.some(function(w){return yt(w,b)&&l.set.some(function(C){return yt(C,b)&&w.every(function(N){return C.every(function(K){return N.intersects(K,b)})})})})};function yt(l,b){for(var w=!0,C=l.slice(),N=C.pop();w&&C.length;)w=C.every(function(K){return N.intersects(K,b)}),N=C.pop();return w}t.toComparators=Nn;function Nn(l,b){return new xe(l,b).set.map(function(w){return w.map(function(C){return C.value}).join(" ").trim().split(" ")})}function An(l,b){return r("comp",l,b),l=nn(l,b),r("caret",l),l=Dn(l,b),r("tildes",l),l=At(l,b),r("xrange",l),l=pt(l,b),r("stars",l),l}function ve(l){return!l||l.toLowerCase()==="x"||l==="*"}function Dn(l,b){return l.trim().split(/\s+/).map(function(w){return tn(w,b)}).join(" ")}function tn(l,b){var w=b.loose?x[a.TILDELOOSE]:x[a.TILDE];return l.replace(w,function(C,N,K,H,me){r("tilde",l,C,N,K,H,me);var he;return ve(N)?he="":ve(K)?he=">="+N+".0.0 <"+(+N+1)+".0.0":ve(H)?he=">="+N+"."+K+".0 <"+N+"."+(+K+1)+".0":me?(r("replaceTilde pr",me),he=">="+N+"."+K+"."+H+"-"+me+" <"+N+"."+(+K+1)+".0"):he=">="+N+"."+K+"."+H+" <"+N+"."+(+K+1)+".0",r("tilde return",he),he})}function nn(l,b){return l.trim().split(/\s+/).map(function(w){return Wt(w,b)}).join(" ")}function Wt(l,b){r("caret",l,b);var w=b.loose?x[a.CARETLOOSE]:x[a.CARET];return l.replace(w,function(C,N,K,H,me){r("caret",l,C,N,K,H,me);var he;return ve(N)?he="":ve(K)?he=">="+N+".0.0 <"+(+N+1)+".0.0":ve(H)?N==="0"?he=">="+N+"."+K+".0 <"+N+"."+(+K+1)+".0":he=">="+N+"."+K+".0 <"+(+N+1)+".0.0":me?(r("replaceCaret pr",me),N==="0"?K==="0"?he=">="+N+"."+K+"."+H+"-"+me+" <"+N+"."+K+"."+(+H+1):he=">="+N+"."+K+"."+H+"-"+me+" <"+N+"."+(+K+1)+".0":he=">="+N+"."+K+"."+H+"-"+me+" <"+(+N+1)+".0.0"):(r("no pr"),N==="0"?K==="0"?he=">="+N+"."+K+"."+H+" <"+N+"."+K+"."+(+H+1):he=">="+N+"."+K+"."+H+" <"+N+"."+(+K+1)+".0":he=">="+N+"."+K+"."+H+" <"+(+N+1)+".0.0"),r("caret return",he),he})}function At(l,b){return r("replaceXRanges",l,b),l.split(/\s+/).map(function(w){return rn(w,b)}).join(" ")}function rn(l,b){l=l.trim();var w=b.loose?x[a.XRANGELOOSE]:x[a.XRANGE];return l.replace(w,function(C,N,K,H,me,he){r("xRange",l,C,N,K,H,me,he);var Je=ve(K),q=Je||ve(H),ne=q||ve(me),ue=ne;return N==="="&&ue&&(N=""),he=b.includePrerelease?"-0":"",Je?N===">"||N==="<"?C="<0.0.0-0":C="*":N&&ue?(q&&(H=0),me=0,N===">"?(N=">=",q?(K=+K+1,H=0,me=0):(H=+H+1,me=0)):N==="<="&&(N="<",q?K=+K+1:H=+H+1),C=N+K+"."+H+"."+me+he):q?C=">="+K+".0.0"+he+" <"+(+K+1)+".0.0"+he:ne&&(C=">="+K+"."+H+".0"+he+" <"+K+"."+(+H+1)+".0"+he),r("xRange return",C),C})}function pt(l,b){return r("replaceStars",l,b),l.trim().replace(x[a.STAR],"")}function De(l,b,w,C,N,K,H,me,he,Je,q,ne,ue){return ve(w)?b="":ve(C)?b=">="+w+".0.0":ve(N)?b=">="+w+"."+C+".0":b=">="+b,ve(he)?me="":ve(Je)?me="<"+(+he+1)+".0.0":ve(q)?me="<"+he+"."+(+Je+1)+".0":ne?me="<="+he+"."+Je+"."+q+"-"+ne:me="<="+me,(b+" "+me).trim()}xe.prototype.test=function(l){if(!l)return!1;if(typeof l=="string")try{l=new M(l,this.options)}catch{return!1}for(var b=0;b<this.set.length;b++)if(bt(this.set[b],l,this.options))return!0;return!1};function bt(l,b,w){for(var C=0;C<l.length;C++)if(!l[C].test(b))return!1;if(b.prerelease.length&&!w.includePrerelease){for(C=0;C<l.length;C++)if(r(l[C].semver),l[C].semver!==Xe&&l[C].semver.prerelease.length>0){var N=l[C].semver;if(N.major===b.major&&N.minor===b.minor&&N.patch===b.patch)return!0}return!1}return!0}t.satisfies=rt;function rt(l,b,w){try{b=new xe(b,w)}catch{return!1}return b.test(l)}t.maxSatisfying=xt;function xt(l,b,w){var C=null,N=null;try{var K=new xe(b,w)}catch{return null}return l.forEach(function(H){K.test(H)&&(!C||N.compare(H)===-1)&&(C=H,N=new M(C,w))}),C}t.minSatisfying=zt;function zt(l,b,w){var C=null,N=null;try{var K=new xe(b,w)}catch{return null}return l.forEach(function(H){K.test(H)&&(!C||N.compare(H)===1)&&(C=H,N=new M(C,w))}),C}t.minVersion=Ye;function Ye(l,b){l=new xe(l,b);var w=new M("0.0.0");if(l.test(w)||(w=new M("0.0.0-0"),l.test(w)))return w;w=null;for(var C=0;C<l.set.length;++C){var N=l.set[C];N.forEach(function(K){var H=new M(K.semver.version);switch(K.operator){case">":H.prerelease.length===0?H.patch++:H.prerelease.push(0),H.raw=H.format();case"":case">=":(!w||He(w,H))&&(w=H);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+K.operator)}})}return w&&l.test(w)?w:null}t.validRange=Rt;function Rt(l,b){try{return new xe(l,b).range||"*"}catch{return null}}t.ltr=bn;function bn(l,b,w){return I(l,b,"<",w)}t.gtr=Mn;function Mn(l,b,w){return I(l,b,">",w)}t.outside=I;function I(l,b,w,C){l=new M(l,C),b=new xe(b,C);var N,K,H,me,he;switch(w){case">":N=He,K=en,H=We,me=">",he=">=";break;case"<":N=We,K=Ut,H=He,me="<",he="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(rt(l,b,C))return!1;for(var Je=0;Je<b.set.length;++Je){var q=b.set[Je],ne=null,ue=null;if(q.forEach(function(we){we.semver===Xe&&(we=new Le(">=0.0.0")),ne=ne||we,ue=ue||we,N(we.semver,ne.semver,C)?ne=we:H(we.semver,ue.semver,C)&&(ue=we)}),ne.operator===me||ne.operator===he||(!ue.operator||ue.operator===me)&&K(l,ue.semver))return!1;if(ue.operator===he&&H(l,ue.semver))return!1}return!0}t.prerelease=wt;function wt(l,b){var w=j(l,b);return w&&w.prerelease.length?w.prerelease:null}t.intersects=ze;function ze(l,b,w){return l=new xe(l,w),b=new xe(b,w),l.intersects(b)}t.coerce=xn;function xn(l,b){if(l instanceof M)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;b=b||{};var w=null;if(!b.rtl)w=l.match(x[a.COERCE]);else{for(var C;(C=x[a.COERCERTL].exec(l))&&(!w||w.index+w[0].length!==l.length);)(!w||C.index+C[0].length!==w.index+w[0].length)&&(w=C),x[a.COERCERTL].lastIndex=C.index+C[1].length+C[2].length;x[a.COERCERTL].lastIndex=-1}return w===null?null:j(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),b)}})(Gr,Gr.exports);var Qu=Gr.exports;const _s=es,Lt=Qu,Be="semver",Zu={base:_s.string(),type:"semverRange",validate:function(e,{error:t}){return Lt.validRange(e)?{value:e}:{errors:t(`${Be}.valid`)}},messages:{[`${Be}.valid`]:"{{#label}} needs to be a valid semver range"}},yn={};yn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Lt[r](e,n)?e:t.error(`${Be}.${r}`,{exp:n})},args:[{name:"exp",assert:Lt.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){yn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});yn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Lt.cmp(e,n,r)?e:t.error(`${Be}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Lt.valid,message:"needs to be a valid semver expression"}]};yn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Lt[r](e,n)?e:t.error(`${Be}.${r}`,{rng:n})},args:[{name:"rng",assert:Lt.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){yn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});yn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Lt.outside(e,r,n)?e:t.error(`${Be}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Lt.validRange,message:"needs to be a valid semver range"}]};const ed={base:_s.string(),type:"semver",validate:function(e,{error:t}){return Lt.valid(e)?{value:e}:{errors:t(`${Be}.valid`)}},messages:{[`${Be}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Be}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Be}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Be}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Be}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Be}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Be}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Be}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Be}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Be}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Be}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Be}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:yn};var td={semver:ed,semverRange:Zu};/*!
200
+ * is-var-name | ISC (c) Shinnosuke Watanabe
201
+ * https://github.com/shinnn/is-var-name
202
+ */function nd(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const rd=Object.freeze(Object.defineProperty({__proto__:null,default:nd},Symbol.toStringTag,{value:"Module"})),id=oi(rd),od=oi(Za),sd=nl,ad=rl,Eo=vr,ld=e=>{if((0,Eo.isValid)(e))return e;const t=(0,ad.toHex)(Cl.from(typeof e=="string"?e.trim():e));return(0,Eo.fromPublicKey)(t,{role:sd.types.RoleType.ROLE_ANY})};var cd=ld,vn={},Ls=ke&&ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vn,"__esModule",{value:!0});vn.didExtension=vn.fileExtension=void 0;const So=Ls(Cs),ud=Ls(Zl),dd=vr,Ns=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=>So.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 So.default.statSync(ud.default.join(r,t)),t}catch(u){switch(u.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:u.message})}}}}});vn.fileExtension=Ns;const As=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,dd.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'}});vn.didExtension=As;vn.default={fileExtension:Ns,didExtension:As};var xi={},Ds={exports:{}};const hd=["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 Ms=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),pd=hd,fd=["node_modules","favicon.ico"],md=Ds.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Vn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Vn(t,n);if(typeof e!="string")return n.push("name must be a string"),Vn(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"),fd.forEach(function(d){e.toLowerCase()===d&&n.push(d+" is a blacklisted name")}),pd.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(Ms);if(r){var o=r[1],u=r[2];if(encodeURIComponent(o)===o&&encodeURIComponent(u)===u)return Vn(t,n)}n.push("name can only contain URL-friendly characters")}return Vn(t,n)};md.scopedPackagePattern=Ms;var Vn=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},gd=Ds.exports;(function(e){var t=ke&&ke.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=vr,r=t(gd),o=32,u=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=u;const d=(h,{checkDid:y=!0}={})=>{if((0,n.isValid)(h))y&&(0,e.validateNewDid)(h);else{const{validForNewPackages:x,errors:s=[],warnings:a=[]}=(0,r.default)(h);if(!x)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}})(xi);var vd=ke&&ke.__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]}),yd=ke&&ke.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),bd=ke&&ke.__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"&&vd(n,t,r[o]);return yd(n,t),n}}(),Ln=ke&&ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(re,"__esModule",{value:!0});re.Joi=re.eventsSchema=re.installBlockletDescriptionSchema=re.installBlockletTitleSchema=re.resourceBundleSchema=re.authConfigSchema=re.cacheableSchema=re.statsSchema=re.titleSchema=re.themeSchema=re.signatureSchema=re.serviceSchema=re.scriptsSchema=re.personSchema=re.navigationSchema=re.navigationItemSchema=re.updateMountPointSchema=re.mountPointSchema=re.logoSchema=re.interfaceSchema=re.environmentNameSchema=re.environmentSchema=re.engineSchema=re.endpointSchema=re.distSchema=re.descriptionSchema=re.createBlockletSchema=re.componentSchema=re.blockletNameSchema=re.blockletMetaSchema=void 0;const xd=Ln(Cs),wd=Ln(es),Ed=Ln(Vu),Sd=Ln(Ju),To=td,Td=Ln(id),jo=rs,jd=vr,Od=od,Ae=_t,kd=Ln(cd),Oo=vn,Hr=xi,wi=bd(vl),Rd=Ed.default.default,ko="/.well-known",c=wd.default.extend(To.semver).extend(To.semverRange).extend(Oo.fileExtension).extend(Oo.didExtension);re.Joi=c;const Ro=(e,t)=>(0,wi.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
203
+
204
+ A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
205
+ - /en/home
206
+ - /zh/home
207
+ - https://www.arcblock.io
208
+ `),Cd=(e,t)=>!e||(0,Td.default)(e)?e:t.message(`Invalid navigation id: ${e}
209
+
210
+ A valid navigation id is should follow the rules of javascript variables, such as:
211
+ - foo
212
+ - fooBar
213
+ - foo123
214
+
215
+ see detail in https://www.npmjs.com/package/is-var-name
216
+ `),Sr=c.string().trim().min(1).custom(e=>{if(Rd(e)>Ae.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Ae.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});re.titleSchema=Sr;const Tr=c.string().trim().min(3).max(160).meta({className:"TDescription"});re.descriptionSchema=Tr;const Fs=c.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});re.installBlockletTitleSchema=Fs;const Bs=c.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});re.installBlockletDescriptionSchema=Bs;const $s=c.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(jo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${jo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});re.logoSchema=$s;const Us=c.string().trim().min(1),Ei=Us.meta({className:"TMountPoint"}).custom((e,t)=>(0,wi.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));re.mountPointSchema=Ei;const Ws=Us.meta({className:"TUpdateMountPoint"}).custom(e=>(0,wi.default)(e));re.updateMountPointSchema=Ws;const Pn=c.string().custom(e=>((0,Hr.validateName)(e),e)).meta({className:"TBlockletName"});re.blockletNameSchema=Pn;const Id=[],Si=c.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Id.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"});re.environmentNameSchema=Si;const Ti=c.object({name:Si.required(),description:c.string().trim().required(),default:c.string().optional().allow("").default(""),required:c.boolean().default(!1),secure:c.boolean().default(!1),validation:c.string().optional(),shared:c.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"});re.environmentSchema=Ti;const ji=c.object({dev:c.string().trim().min(1),e2eDev:c.string().trim().min(1),preFlight:c.string().trim().min(1),preInstall:c.string().trim().min(1),postInstall:c.string().trim().min(1),preStart:c.string().trim().min(1),postStart:c.string().trim().min(1),preStop:c.string().trim().min(1),preUninstall:c.string().trim().min(1),preConfig:c.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"});re.scriptsSchema=ji;const Oi=c.object({name:c.string().required().trim(),config:c.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});re.serviceSchema=Oi;const ki=c.object({type:c.string().trim(!0).min(1).required(),path:c.string().required(),meta:c.object({vcType:c.string(),payable:c.boolean(),params:c.array().items({name:c.string().required().trim(),description:c.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});re.endpointSchema=ki;const zs=c.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"});re.cacheableSchema=zs;const Ri=c.object({type:c.string().lowercase().valid(...Ae.BLOCKLET_INTERFACE_TYPES).required(),name:c.string().trim().required(),path:c.string().trim().default("/"),prefix:c.string().trim().min(1).default(Ae.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:c.number().port().optional(),hostIP:c.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:c.string().lowercase().valid(...Ae.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:c.alternatives().try(c.string().uppercase().default(Ae.BLOCKLET_DEFAULT_PORT_NAME),c.object({internal:c.string().uppercase().required(),external:c.number().port().required()})).default(Ae.BLOCKLET_DEFAULT_PORT_NAME),cacheable:c.array().items(zs).unique(),services:c.array().items(Oi).unique("name"),endpoints:c.array().items(ki).unique("type"),pageGroups:c.array().items(c.string().min(1).max(255).trim()).unique()}).meta({className:"TInterface",unknownType:"any"});re.interfaceSchema=Ri;const Pd=c.alternatives().try(c.string().required(),c.object({url:c.string().uri({scheme:["http","https","file"]}).required(),name:Pn.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}).required(),name:Pn.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),Xr=c.object({platform:c.string().valid(...Ae.BLOCKLET_PLATFORMS).optional(),interpreter:c.string().valid("binary","node","blocklet").default("node"),source:Pd,args:c.array().items(c.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});re.engineSchema=Xr;const Yn=c.object({name:c.string().min(1).required(),email:c.string().email({tlds:!1}).optional(),url:c.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});re.personSchema=Yn;const Qn=c.object({tarball:c.alternatives().try(c.string().uri(),c.string()).required(),integrity:c.string().required(),size:c.number().optional()}).meta({className:"TDist",unknownType:"any"});re.distSchema=Qn;const qs=c.object({downloads:c.number().integer().greater(-1),star:c.number().default(0),purchases:c.number().default(0)}).meta({className:"TStats",unknownType:"any"});re.statsSchema=qs;const _d=c.alternatives().try(c.object({url:c.alternatives().try(c.string().uri(),c.array().items(c.string().uri()).min(1)).required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}),name:Pn.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),Ks={source:_d.required(),required:c.boolean(),title:Sr,description:Tr,mountPoint:Ei,name:Pn},Vs=(e,t)=>c.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),Ci=Vs(Ks).meta({className:"TComponent",unknownType:"any"});re.componentSchema=Ci;const Ld=Vs(Ks,!0),Gs=({checkStore:e}={})=>{const t=[Ci,Ld];return c.array().items(e?t[0]:t[1]).optional().default([])},Hs=c.object({type:c.string().required(),name:c.string().required(),signer:c.string().required(),pk:c.string().required(),created:c.string().isoDate().required(),sig:c.string().required(),excludes:c.array().items(c.string()).optional(),appended:c.array().items(c.string()).optional(),delegatee:c.string(),delegateePk:c.string(),delegation:c.string()}).meta({className:"TSignature",unknownType:"any"});re.signatureSchema=Hs;const Co=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Io={id:c.string().custom(Cd),title:c.alternatives().try(c.string().min(1).max(Ae.MAX_TITLE_LENGTH),c.object().min(1).pattern(c.string().valid(...Co),c.string().min(1).max(Ae.MAX_TITLE_LENGTH))).required(),link:c.alternatives().try(c.string().custom(Ro),c.object().min(1).pattern(c.string().valid(...Co),c.string().custom(Ro))),component:c.string().min(1),section:c.array().items(c.string().min(1)).single(),role:c.array().items(c.string().min(1)).single(),icon:c.string().min(1),visible:c.boolean()},Xs=c.object({...Io,items:c.array().items(c.object({...Io}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});re.navigationItemSchema=Xs;const Ii=c.array().items(Xs).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});re.navigationSchema=Ii;const Pi=c.object({background:c.alternatives().try(c.string().min(1),c.object({header:c.string().min(1),footer:c.string().min(1),default:c.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});re.themeSchema=Pi;const Ys=c.object({whoCanAccess:c.string().valid("owner","invited","all"),profileFields:c.array().items(c.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:c.array().items(c.string().min(1)),allowSwitchProfile:c.boolean(),blockUnauthenticated:c.boolean(),blockUnauthorized:c.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});re.authConfigSchema=Ys;const Nd=c.object({type:c.string().trim().min(1).required(),description:c.string().trim().min(1)}),_i=c.object({did:c.DID().trim().required(),type:c.string().trim().min(1).required(),public:c.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});re.resourceBundleSchema=_i;const Li=c.array().items(c.object({type:c.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:c.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});re.eventsSchema=Li;const Js={did:c.DID().trim().required(),version:c.semver().valid().required(),name:c.string().optional(),description:Tr.required(),group:c.string().valid(...Ae.BLOCKLET_GROUPS),main:c.string().trim(),title:Sr.optional().allow(""),logo:c.string().trim().optional(),specVersion:c.semver().valid().gte("1.0.0").optional(),author:Yn.optional(),contributors:c.array().items(Yn).optional(),maintainers:c.array().items(Yn).optional(),community:c.string().uri().optional().allow("").default(""),documentation:c.string().uri().optional().allow("").default(""),homepage:c.string().uri().optional().allow("").default(""),license:c.string().optional().allow("").default(""),support:c.alternatives().try(c.string().uri(),c.string().email({tlds:!1})).optional(),nftFactory:c.DID().optional().allow("").default(""),payment:c.object({price:c.array().max(1).items(c.object({value:c.number().greater(0).required(),address:c.DID().required()})).default([]),share:c.array().max(4).items(c.object({name:c.string().required(),address:c.DID().required(),value:c.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:c.array().items(c.object({parentPriceRange:c.array().items(c.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:c.string().valid("fixed","percentage").required(),value:c.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),tags:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),gitHash:c.string().optional().allow(""),repository:c.alternatives().try(c.string().min(1),c.object({type:c.string().valid("git","https","svn").required(),url:c.string().uri().required(),directory:c.string()})).optional(),timeout:c.object({start:c.number().min(10).max(600),script:c.number().min(1).max(1800)}).default({start:60}),requirements:c.object({abtnode:c.semverRange().valid(),server:c.semverRange().valid(),os:c.alternatives().try(c.string().valid("*",...Ae.BLOCKLET_PLATFORMS),c.array().items(c.string().valid(...Ae.BLOCKLET_PLATFORMS)).min(1)),cpu:c.alternatives().try(c.string().valid("*",...Ae.BLOCKLET_ARCHITECTURES),c.array().items(c.string().valid(...Ae.BLOCKLET_ARCHITECTURES)).min(1)),fuels:c.array().items(c.object({endpoint:c.string().trim().required(),address:c.string().trim(),value:c.string().trim().required(),reason:c.string().trim().required()})),nodejs:c.semverRange().valid()}).default({server:Ae.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:c.array().items(Ri).unique("name").custom((e,t)=>{if(e.filter(o=>o.type===Ae.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Ae.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(o=>o.type===Ae.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const o of r)if(!o.prefix.startsWith(ko))return t.message(`Wellknown path prefix must start with: ${ko}`);return e}).default([]),environments:c.array().items(Ti).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,o)=>e.findIndex(u=>u.name===r.name)!==o);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:ji,capabilities:c.object({clusterMode:c.boolean(),didSpace:c.string().valid(...Object.values(Ae.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:c.boolean().default(!0),serverless:c.boolean().optional(),component:c.boolean(),sitemap:c.boolean().optional()}).default({}),files:c.array().items(c.string().trim()).optional(),resource:c.object({exportApi:c.string().trim(),bundles:c.array().items(_i),types:c.array().items(Nd).max(10)}),engine:c.alternatives().try(Xr,c.array().items(Xr)).optional(),screenshots:c.array().items(c.string().min(1)).optional().default([]),videos:c.array().items(c.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:c.string().optional().allow(""),dist:Qn.optional(),stats:qs.optional(),htmlAst:c.any().optional(),path:c.string().optional(),signatures:c.array().items(Hs).optional(),lastPublishedAt:c.string().isoDate().optional().allow(null),components:Gs(),navigation:Ii,theme:Pi,copyright:c.object({owner:c.string().min(1),year:c.alternatives().try(c.string(),c.number())}),bundleName:c.string(),bundleDid:c.DID().trim(),storeId:c.string(),events:Li.optional()},Ad=c.object(Js).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});re.blockletMetaSchema=Ad;const Qs=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:u=!1,...d}={})=>((!e||!xd.default.existsSync(e))&&(t=!1),c.object({...Js,owner:c.object({avatar:c.string().optional(),did:c.DID().trim().required(),fullName:c.string().trim().required(),email:c.string().optional().allow(null).empty("").default("")}).optional(),logo:t?c.file().trim().exists({baseDir:e}).optional():c.string().trim().optional(),files:c.array().items(t?c.file().exists({baseDir:e,canSkip:(h,y)=>[Ae.BLOCKLET_ENTRY_FILE,Ae.BLOCKLET_BUNDLE_FILE].includes(y)||(0,Sd.default)(y)}):c.string().trim()).optional(),dist:n?Qn.required():Qn.optional(),components:Gs({checkStore:r}),name:o?c.string().optional():c.string().required(),egress:c.boolean().optional().default(!0),docker:Od.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...d}).rename("children","components").custom((h,y)=>{const{did:x,name:s,docker:a}=h;if(a){const{image:v,dockerfile:S,network:k}=a;if(!v&&!S)return y.message("Image or dockerfile must be set");if(v&&S)return y.message("Image and dockerfile cannot be set at the same time");if(k)return y.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 y.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(_.indexOf("..")>-1)return y.message('Volume cannot contain ".."')}}let O;if((0,jd.isValid)(x))try{return(0,Hr.validateNewDid)(x),h}catch(v){O=v}if(s){(0,Hr.validateName)(s,{checkDid:!u});const v=(0,kd.default)(s);return v!==x?y.message(`The did of name "${s}" should be "${v}"`):h}return O?y.message(O.message):h}));re.createBlockletSchema=Qs;re.default={blockletNameSchema:Pn,componentSchema:Ci,endpointSchema:ki,serviceSchema:Oi,createBlockletSchema:Qs,interfaceSchema:Ri,environmentSchema:Ti,environmentNameSchema:Si,scriptsSchema:ji,personSchema:Yn,distSchema:Qn,titleSchema:Sr,descriptionSchema:Tr,logoSchema:$s,navigationSchema:Ii,themeSchema:Pi,mountPointSchema:Ei,updateMountPointSchema:Ws,authConfigSchema:Ys,resourceBundleSchema:_i,installBlockletTitleSchema:Fs,installBlockletDescriptionSchema:Bs,eventsSchema:Li,Joi:c};var kt={},Dd=ke&&ke.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kt,"__esModule",{value:!0});kt.setService=kt.findService=kt.getDefaultServiceConfig=kt.getServiceConfig=void 0;const Md=Dd(ec),Fd=re,Zs={},Ni=e=>{Zs[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};kt.setService=Ni;Ni({name:"auth",schema:Fd.authConfigSchema,default:{}});const ea=e=>{if(!e)throw new Error("service name should not be empty");const t=Zs[e];if(!t)throw new Error(`service ${e} does not exist`);return t},ta=(e,t,{validate:n}={})=>{const r=ea(e),o=(0,Md.default)(t||{}),{value:u,error:d}=r.validate(o);if(n&&d)throw new Error(`Invalid blocklet service config: ${d.details.map(h=>h.message).join(", ")}`);return u};kt.getServiceConfig=ta;const na=e=>{const{defaultConfig:t}=ea(e);return t};kt.getDefaultServiceConfig=na;const ra=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};kt.findService=ra;kt.default={getServiceConfig:ta,getDefaultServiceConfig:na,findService:ra,setService:Ni};Object.defineProperty(gn,"__esModule",{value:!0});gn.fixAndValidateService=gn.validateMeta=void 0;const Bd=re,$d=kt,Ud=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,$d.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);gn.fixAndValidateService=Ud;const ia=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:o=!1,skipValidateDidName:u=!1,schemaOptions:d={}}={})=>{const h=(0,Bd.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:o,skipValidateDidName:u,...d}),{value:y,error:x}=h.validate(e);if(x)throw new Error(`Invalid blocklet meta: ${x.details.map(s=>s.message).join(", ")}`);return y};gn.validateMeta=ia;gn.default=ia;(function(e){var t=ke&&ke.__createBinding||(Object.create?function(j,W,Q,M){M===void 0&&(M=Q);var de=Object.getOwnPropertyDescriptor(W,Q);(!de||("get"in de?!W.__esModule:de.writable||de.configurable))&&(de={enumerable:!0,get:function(){return W[Q]}}),Object.defineProperty(j,M,de)}:function(j,W,Q,M){M===void 0&&(M=Q),j[M]=W[Q]}),n=ke&&ke.__setModuleDefault||(Object.create?function(j,W){Object.defineProperty(j,"default",{enumerable:!0,value:W})}:function(j,W){j.default=W}),r=ke&&ke.__importStar||function(){var j=function(W){return j=Object.getOwnPropertyNames||function(Q){var M=[];for(var de in Q)Object.prototype.hasOwnProperty.call(Q,de)&&(M[M.length]=de);return M},j(W)};return function(W){if(W&&W.__esModule)return W;var Q={};if(W!=null)for(var M=j(W),de=0;de<M.length;de++)M[de]!=="default"&&t(Q,W,M[de]);return n(Q,W),Q}}(),o=ke&&ke.__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 u=o(yl),d=r(Mu),h=_t,y=gn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return y.fixAndValidateService}});const x=xi,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 v=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=v;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 k=(j,W)=>(j.author&&(j.author=W(j.author)),["maintainers","contributors"].forEach(Q=>{Array.isArray(j[Q])&&(j[Q]=j[Q].map(W))}),j),_=j=>{if(!j)return"";if(typeof j=="string")return j;const W=j.name||"",Q=j.url||j.web,M=Q?` (${Q})`:"",de=j.email||j.mail,Z=de?` <${de}>`:"";return W+Z+M};e.formatPerson=_;const A=j=>{if(typeof j!="string")return j;const W=j.match(/^([^(<]+)/),Q=j.match(/\(([^)]+)\)/),M=j.match(/<([^>]+)>/),de={};return W&&W[0].trim()&&(de.name=W[0].trim()),M&&([,de.email]=M),Q&&([,de.url]=Q),de};e.parsePerson=A;const Y=j=>(k(j,_),k(j,A),j);e.fixPerson=Y;const U=(j,W=!0)=>{if(Array.isArray(j.interfaces)||(j.interfaces=[]),j.interfaces.length)return j.interfaces.forEach(Z=>{Z.type===h.BLOCKLET_INTERFACE_TYPE_WEB&&(Z.protocol="http")}),j;const M=(0,u.default)(j,"capabilities.dynamicPathPrefix",!0)?h.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",de=({type:Z="web",name:ae,path:Re="/",protocol:Fe="http",port:$e=h.BLOCKLET_DEFAULT_PORT_NAME})=>{j.interfaces.push({type:Z,name:ae,path:Re,prefix:M,port:$e,protocol:Fe})};return[h.BLOCKLET_INTERFACE_PUBLIC].forEach(Z=>{j[Z]&&de({name:Z,path:j[Z]})}),Array.isArray(j.exposeServices)&&j.exposeServices.forEach(Z=>{de({type:"service",name:Z.protocol,protocol:Z.protocol,port:{internal:`BLOCKLET_${Z.protocol}_PORT`.toUpperCase(),external:Z.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 J=j=>{const{did:W}=j;try{(0,x.validateNewDid)(W),j.name=W}catch{}return j};e.fixName=J,e.default={fixRequired:s,fixRepository:a,fixFiles:O,fixKeywords:v,fixPerson:Y,fixTags:S,fixName:J,formatPerson:_,parsePerson:A,fixInterfaces:U,fixService:y.fixAndValidateService}})(Ts);function oa({owner:e,locale:t}){return i.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?i.jsx(ns,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}oa.propTypes={owner:P.object.isRequired,locale:P.string.isRequired};const Wd="install-blocklet-from-URL",sa=()=>{const[e,t]=ps(Wd,"[]",{raw:!0}),n=o=>{const u=o.trim(),d=JSON.parse(e),h=d.findIndex(y=>y===u);h!==0&&(h>0&&d.splice(h,1),d.length>=10&&d.splice(9),d.unshift(u),t(JSON.stringify(d)))},r=o=>{if(!o)return;const u=JSON.parse(e),d=o.trim(),h=u.findIndex(y=>y===d);h>-1&&(u.splice(h,1),t(JSON.stringify(u)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},zd=qo(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function Ai(e){const{value:t,onValueChange:n,children:r,helperText:o}=e,{urls:u,removeUrlRecord:d}=sa(),h=(x,s)=>{x.preventDefault(),x.stopPropagation(),d(s)},y=zd();return i.jsxs(X,{children:[i.jsx(Ko,{freeSolo:!0,options:u,inputValue:t,onInputChange:(x,s)=>{n(s)},disableClearable:!0,popupIcon:null,renderInput:x=>Ja.cloneElement(r,{...x}),renderOption:(x,s)=>L.createElement(Vo,{...x,key:s,secondaryAction:i.jsx(zo,{edge:"end","aria-label":"delete",onClick:a=>h(a,s),children:i.jsx(il,{})})},i.jsx(Ia,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:i.jsx(Go,{primary:s,className:y.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),i.jsx(Pa,{style:{margin:0},children:o})]})}Ai.propTypes={onValueChange:P.func,children:P.node,value:P.string,helperText:P.string};Ai.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function Di({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:o,handleText:u}){const{api:d}=_n(),{api:h}=tc(),[y,x]=L.useState(!1),[s,a]=L.useState(""),{t:O,locale:v}=vt(),S={dist:{}},[k,_]=L.useState(e),[A,Y]=L.useState(e?1:0),[U,J]=L.useState(S),[j,W]=L.useState(!1),[Q,M]=L.useState({}),de=o==="component",Z=de?!0:!e,{addUrlRecord:ae}=sa(),Re=async()=>{J(S),a(null),x(!0);let se=k.trim();!se.startsWith("https://")&&!se.startsWith("http://")&&!se.startsWith("file://")&&(se=`file://${se}`);try{const ht=decodeURIComponent(se);try{new URL(ht)}catch{throw new Error("Invalid URL")}const{meta:Oe,inStore:He,registryUrl:We}=await d.getBlockletMetaFromUrl({input:{url:ht}});J(Oe),M({inStore:He,registryUrl:We,inputUrl:se}),ae(se)}catch(ht){console.error(ht);const Oe=`Blocklet Install failed: ${fs(ht)}`;a(Oe),r(ht)}finally{x(!1)}},Fe=()=>{if(de){n({meta:U,...Q}),t();return}x(!0),W(!0)},$e=()=>{x(!1),W(!1),n({meta:U,...Q}),t()},nt=()=>{x(!1),W(!1)};L.useEffect(()=>{e&&Re()},[e]);const te=[{name:O("common.name"),value:$t.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(oa,{owner:U.owner,locale:v}):Ts.formatPerson(U.author)},{name:O("blocklet.dist.downloadLink"),value:U.dist.tarball}],ge=()=>y?i.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:i.jsx(gt,{})}):U.did?i.jsx("div",{style:{paddingLeft:"10%"},children:te.map(se=>se.name===O("common.did")?i.jsx(ao,{valueComponent:"div",nameWidth:120,name:se.name,nameFormatter:()=>O("common.did"),children:se.value},se.name):i.jsx(ao,{valueComponent:"div",nameWidth:120,name:se.name,children:se.value},se.name))}):null,z=[{label:O("blocklet.fromUrl.step0"),body:i.jsx(be,{component:"div",children:i.jsx(Ai,{style:{marginBottom:32},value:k,helperText:O("blocklet.fromUrl.description"),onValueChange:se=>{a(null),_(se)},children:i.jsx(gr,{label:O("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:k,onChange:se=>{a(null),_(se.target.value)},disabled:y,onKeyPress:se=>{se.key==="Enter"&&(se.preventDefault(),Re(),Y(1))}})})}),cancel:O("common.cancel"),confirm:O("common.next"),onCancel:t,onConfirm:()=>{Re(),Y(1)}},{label:O("blocklet.fromUrl.step1"),body:ge(),cancel:O(Z?"common.pre":"common.cancel"),confirm:(u==null?void 0:u.confirm)||O("blocklet.fromUrl.confirm"),onCancel:()=>{Z?Y(se=>se-1):t()},onConfirm:()=>{Fe()}}],Ce=z[A];return i.jsxs(i.Fragment,{children:[i.jsxs(ai,{title:(u==null?void 0:u.title)||O("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Ce.onCancel(),showCloseButton:A===0,disableEscapeKeyDown:!0,open:!0,actions:i.jsxs(i.Fragment,{children:[Ce.cancel&&i.jsx(ut,{onClick:se=>{se.stopPropagation(),a(null),Ce.onCancel()},color:"inherit",children:Ce.cancel||O("common.cancel")}),i.jsxs(ut,{onClick:se=>{se.stopPropagation(),Ce.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:y||!k||s,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[y&&A===0&&i.jsx(gt,{size:16}),Ce.confirm]})]}),children:[Z&&i.jsx(_a,{alternativeLabel:!0,activeStep:A,children:z.map(({label:se})=>i.jsx(La,{children:i.jsx(Na,{children:se})},se))}),i.jsx(Aa,{component:"div",style:{marginTop:24},children:Ce.body}),!!s&&i.jsx(Ho,{severity:"error",style:{width:"100%",marginTop:8},children:s})]}),U&&j&&i.jsx(is,{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:$e,extraParams:{title:U.title,wt:bl(U),blockletMetaUrl:decodeURIComponent(k.trim())},messages:{title:O("setup.keyPair.title"),scan:O("setup.keyPair.scan"),confirm:O("setup.keyPair.confirm"),success:O("setup.keyPair.success")},onClose:nt})]})}Di.propTypes={defaultUrl:P.string,onCancel:P.func.isRequired,onSuccess:P.func.isRequired,onError:P.func,mode:P.oneOf(["install","component"]),handleText:P.object};Di.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const qd={meta:P.object.isRequired,onCancel:P.func.isRequired},Kd=qo(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function aa({action:e,onSelect:t,onNext:n}){const r=Kd(),{t:o}=vt(),u=[{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(Da,{className:r.tabPanel,children:u.map(d=>i.jsxs(Vo,{button:!0,selected:e===d.action,onClick:()=>t(d.action),children:[i.jsx(Ma,{className:r.iconRoot,children:d.action==="purchase"?i.jsx(rc,{style:{color:e==="purchase"?no.primary.main:"#AAA",fontSize:32}}):i.jsx(ic,{style:{color:e==="verify"?no.primary.main:"#AAA",fontSize:32}})}),i.jsx(Go,{primary:d.title,secondary:d.description})]},d.action))}),n&&i.jsx(ut,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:o("common.next")})]})}aa.propTypes={action:P.oneOf(["both","purchase","verify"]).isRequired,onSelect:P.func.isRequired,onNext:P.func.isRequired};function Mi({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:o,locale:u}=vt(),{info:d}=_n(),h=xl(d),[y,x]=L.useState(null),s=new URL(e==null?void 0:e.registryUrl).origin,a=$t.getDisplayName({meta:e}),O=async(S,k)=>{const _=({downloadTokenList:U})=>{r({downloadTokenList:U})},A=U=>{li.error(U),t(U)};function Y(U){return ol(()=>lo.get(U).then(async({data:J})=>{const j=J==null?void 0:J.downloadTokenList;if(J.status==="succeed"){if(j&&j.length)await _({downloadTokenList:j});else return await A(o("blocklet.component.missDownloadTokenTip")),!0;return!0}return J.status==="error"?(console.error("vc error: ",J),await A(J==null?void 0:J.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&y){const{statusUrl:U}=wl(y);await Y(U)}else await _({downloadTokenList:S.downloadTokenList&&k(S.downloadTokenList)})};if(L.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{lo.get(S.href).then(({data:k})=>{const _=`${k.url}`;x(_)})}catch(k){console.error("get next workflow url error: ",k)}}return()=>{x(null)}},[n]),n==="purchase"&&!y)return"";const v={verify:{action:"verify-purchase-blocklet",checkFn:so.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:so.create({baseURL:Jn(s,"/store")}).get,extraParams:{factory:e.nftFactory,nw:y},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(is,{open:!0,locale:u,popup:!1,saveConnect:!1,className:"connect",baseUrl:s,onSuccess:O,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:h,disableClose:!0,showDownload:!1,...v[n]})}Mi.propTypes={...qd,handlePaySuccess:P.func,mode:P.oneOf(["verify","purchase"]).isRequired};Mi.defaultProps={handlePaySuccess:()=>{}};const Fi=L.forwardRef(({mode:e,...t},n)=>{const[r,o]=L.useState(e!=="both"?e:"verify"),[u,d]=L.useState(e!=="both"?2:1),h=x=>{x!==r&&o(x)},y=()=>{r&&u!==2&&d(2)};return L.useImperativeHandle(n,()=>({onNext:y,getCurrentStep:()=>u})),u===1?i.jsx("div",{style:{maxWidth:520},children:i.jsx(aa,{action:r,onNext:null,onSelect:h})}):i.jsx(Mi,{...t,mode:r})});Fi.propTypes={mode:P.oneOf(["both","verify","purchase"]).isRequired,ref:P.any};Fi.defaultProps={ref:{}};const Vd=Fi;function Gd({...e}){return i.jsx(ut,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Bi({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:o}=vt(),u=ms();return!e||El(e.meta)?i.jsx(Hd,{children:n}):i.jsxs(Xd,{isMobile:u,children:[i.jsx(Gd,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:o("setup.startNow")}),i.jsx(X,{display:"flex",alignItems:"center",children:n})]})}Bi.propTypes={blocklet:P.object,onStartNow:P.func,children:P.any,disabled:P.bool};Bi.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Hd=Ve(X)`
217
+ width: 100%;
218
+ margin-top: auto;
219
+ padding-top: 24px;
220
+ display: flex;
221
+ align-items: center;
222
+ justify-content: center;
223
+ .bottom-button {
224
+ min-width: 200px;
225
+ }
226
+ ${e=>e.theme.breakpoints.down("md")} {
227
+ .bottom-button {
228
+ width: 100%;
229
+ }
230
+ }
231
+ `,Xd=Ve(X)`
232
+ padding-top: 24px;
233
+ margin-top: auto;
234
+ width: 100%;
235
+ display: flex;
236
+ align-items: center;
237
+ justify-content: space-between;
238
+ .start-now {
239
+ min-width: 140px;
240
+ }
241
+ .bottom-button {
242
+ min-width: 120px;
243
+ }
244
+ ${e=>e.theme.breakpoints.down("lg")} {
245
+ width: 100%;
246
+ }
247
+
248
+ ${e=>e.theme.breakpoints.down("md")} {
249
+ .start-now {
250
+ min-width: inherit;
251
+ }
252
+ .bottom-button {
253
+ min-width: 100px;
254
+ }
255
+ }
256
+
257
+ ${e=>e.isMobile} {
258
+ justify-content: space-between;
259
+ gap: '32px',
260
+ }}
261
+ `;function $i({blockletMeta:e,onEndpointUpdate:t}){var h;const n=ms(),{blocklet:r}=br(),{updateSpaceGateway:o,loading:u,hasStorageEndpoint:d}=Bl();return L.useEffect(()=>{t==null||t()},[r]),u?i.jsx(sl,{relative:"parent",children:i.jsx(gt,{})}):i.jsxs(Yd,{children:[i.jsx(X,{width:n?"360px":"720px",children:d?i.jsx(lc,{}):i.jsx(cc,{})}),((h=e==null?void 0:e.capabilities)==null?void 0:h.didSpace)==="required"&&i.jsx(Bi,{mt:8,children:i.jsx(uc,{onConnect:o})})]})}$i.propTypes={blockletMeta:P.any.isRequired,onEndpointUpdate:Fa.func};$i.defaultProps={onEndpointUpdate:()=>{}};const Yd=Ve(ac)`
262
+ height: 100%;
263
+ overflow-y: auto;
264
+ padding-bottom: 32px;
265
+ overflow-x: hidden;
266
+ `;function Ui({onChange:e,loading:t,children:n,extra:r,stores:o,storageKey:u}){const{t:d}=vt(),{info:h,inService:y}=_n(),{blocklet:x}=br(),[s,a]=L.useState(!1),O=L.useRef(null),[v,S]=L.useState(),[k,_]=ps(u||"tmp"),[A,Y]=u?[k,_]:[v,S],{storeList:U,teamDid:J}=ls({fromBlocklet:y,blocklet:x,nodeInfo:h}),j=us([...o.map(Q=>({...Q,protected:!0})),...U],"url"),W=A&&j.find(Q=>A===Q.url)||j[0];return i.jsxs(i.Fragment,{children:[i.jsxs(Jd,{children:[i.jsx(ut,{ref:O,color:"primary","data-cy":"add-component-select-store",endIcon:i.jsx(dc,{color:"primary"}),onClick:()=>{a(!0)},style:{padding:"0 2px"},children:i.jsx(be,{color:"primary",children:W.name})}),i.jsx(be,{color:"primary",children:r})]}),i.jsxs(gr,{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:Q=>{const M=Q.target.value;Y(M.url),e(M)},SelectProps:{open:s,MenuProps:{anchorEl:O.current},renderValue:Q=>Q==null?void 0:Q.name,onClose:()=>{a(!1)}},style:{display:"none"},margin:"normal",children:[j==null?void 0:j.map(Q=>i.jsx(ri,{sx:{width:"400px",maxWidth:"90vw"},value:Q,"data-cy":Q.url,children:i.jsx(el,{teamDid:J,store:Q,onDelete:()=>{var M;A===Q.url&&Y((M=j[0])==null?void 0:M.url)}})},Q.url)),!ts.isInServerlessMode(h)&&i.jsx(tl,{disabled:t,storeList:j,teamDid:J,onAdd:Q=>{Y(Q)}})]}),n({currentRegistry:W})]})}Ui.propTypes={onChange:P.func,loading:P.bool,children:P.any.isRequired,extra:P.node,storageKey:P.string,stores:P.arrayOf(P.shape({name:P.string.isRequired,url:P.string.isRequired}))};Ui.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Jd=Ve.div`
267
+ display: flex;
268
+ justify-content: space-between;
269
+ align-items: center;
270
+ margin-bottom: 16px;
271
+
272
+ span {
273
+ font-size: 16px;
274
+ color: ${e=>e.theme.palette.common.black};
275
+ // font-weight: bold;
276
+ }
277
+ `,Qd=Qt("div")`
278
+ background-color: transparent !important;
279
+ & > :not(.Mui-disabled) {
280
+ position: relative;
281
+ z-index: 1;
282
+ &::before {
283
+ content: '';
284
+ position: absolute;
285
+ height: 100%;
286
+ width: 100%;
287
+ left: 0;
288
+ top: 0;
289
+ transition: opacity 0.3s;
290
+ }
291
+ &:hover::before {
292
+ opacity: 0;
293
+ }
294
+ &::after {
295
+ content: '';
296
+ position: absolute;
297
+ height: 100%;
298
+ width: 100%;
299
+ top: 0;
300
+ left: 0;
301
+ border-radius: 2px;
302
+ background-color: ${e=>e.theme.palette.primary.main};
303
+ transform: scale(0.1);
304
+ opacity: 0;
305
+ z-index: -1;
306
+ transition:
307
+ transform 0.3s,
308
+ opacity 0.3s,
309
+ background-color 0.3s;
310
+ }
311
+ &:hover::after {
312
+ opacity: 1;
313
+ transform-origin: center;
314
+ transform: scale(1);
315
+ }
316
+ }
317
+ & > :not(.Mui-disabled) {
318
+ background-color: transparent !important;
319
+ color: ${e=>e.theme.palette.primary.main}!important;
320
+ }
321
+ & > :not(.Mui-disabled) {
322
+ &:hover {
323
+ color: ${e=>e.theme.palette.common.white}!important;
324
+ }
325
+ }
326
+ `;Qt("div")`
327
+ &.arcblock-blocklet {
328
+ padding: ${e=>e.theme.spacing(2)} ${e=>e.theme.spacing(2)} 0
329
+ ${e=>e.theme.spacing(2)};
330
+ }
331
+ .arcblock-blocklet__content {
332
+ cursor: pointer;
333
+ display: flex;
334
+ ${e=>e.theme.breakpoints.up("sm")} {
335
+ align-items: center;
336
+ }
337
+ }
338
+ .arcblock-blocklet__cover {
339
+ width: 64px;
340
+ height: 64px;
341
+ margin-right: ${e=>e.theme.spacing(2)};
342
+ overflow: hidden;
343
+ border-radius: 12px;
344
+ /* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
345
+ transform: translateZ(0);
346
+ ${e=>e.theme.breakpoints.up("sm")} {
347
+ width: 80px;
348
+ height: 80px;
349
+ margin-bottom: 12px;
350
+ }
351
+ }
352
+ .arcblock-blocklet__button--hover {
353
+ &:not(.Mui-disabled) {
354
+ position: relative;
355
+ z-index: 1;
356
+ &::before {
357
+ content: '';
358
+ position: absolute;
359
+ height: 100%;
360
+ width: 100%;
361
+ left: 0;
362
+ top: 0;
363
+ transition: opacity 0.3s;
364
+ }
365
+ &:hover::before {
366
+ opacity: 0;
367
+ }
368
+ &::after {
369
+ content: '';
370
+ position: absolute;
371
+ height: 100%;
372
+ width: 100%;
373
+ background-color: ${e=>e.theme.palette.primary.main};
374
+ transform: scale(0.1);
375
+ opacity: 0;
376
+ z-index: -1;
377
+ transition:
378
+ transform 0.3s,
379
+ opacity 0.3s,
380
+ background-color 0.3s;
381
+ }
382
+ &:hover::after {
383
+ opacity: 1;
384
+ transform-origin: center;
385
+ transform: scale(1);
386
+ }
387
+ }
388
+
389
+ &:not(.Mui-disabled) {
390
+ background-color: transparent !important;
391
+ color: ${e=>e.theme.palette.primary.main};
392
+ }
393
+ &:not(.Mui-disabled) {
394
+ &:hover {
395
+ color: ${e=>e.theme.palette.common.white};
396
+ }
397
+ }
398
+ }
399
+ .arcblock-blocklet__info {
400
+ flex: 1;
401
+ overflow: hidden;
402
+ border-bottom: 1px solid ${e=>e.theme.palette.divider};
403
+ padding-bottom: ${e=>e.theme.spacing(2)};
404
+ }
405
+ .arcblock-blocklet__text {
406
+ height: 65px;
407
+ overflow: hidden;
408
+ }
409
+ /* 设置多行文本溢出显示省略号 兼容fireFox、safari */
410
+ .arcblock-blocklet__title {
411
+ margin: 0;
412
+ font-size: 16px;
413
+ font-weight: 500;
414
+ overflow: hidden;
415
+ text-overflow: ellipsis;
416
+ white-space: nowrap;
417
+ }
418
+ .arcblock-blocklet__describe {
419
+ margin-top: ${e=>e.theme.spacing(.5)};
420
+ color: ${e=>e.theme.palette.grey[600]};
421
+ font-size: 14px;
422
+ font-weight: 500;
423
+ line-height: 17px;
424
+ max-height: 34px;
425
+ overflow: hidden;
426
+ text-overflow: ellipsis;
427
+ display: -webkit-box;
428
+ -webkit-line-clamp: 2;
429
+ -webkit-box-orient: vertical;
430
+ word-break: break-word;
431
+ }
432
+ .arcblock-blocklet__version {
433
+ color: ${e=>e.theme.palette.grey[600]};
434
+ font-size: 12px;
435
+ }
436
+ `;P.string||P.node,P.string,P.string||P.node,P.string,P.string,P.bool,P.bool,P.element,P.string,P.func,P.func,P.string;Qt("div")`
437
+ background-color: transparent !important;
438
+ & > :not(.Mui-disabled) {
439
+ position: relative;
440
+ z-index: 1;
441
+ &::before {
442
+ content: '';
443
+ position: absolute;
444
+ height: 100%;
445
+ width: 100%;
446
+ left: 0;
447
+ top: 0;
448
+ transition: opacity 0.3s;
449
+ }
450
+ &:hover::before {
451
+ opacity: 0;
452
+ }
453
+ &::after {
454
+ content: '';
455
+ position: absolute;
456
+ height: 100%;
457
+ width: 100%;
458
+ top: 0;
459
+ left: 0;
460
+ border-radius: 2px;
461
+ background-color: ${e=>e.theme.palette.primary.main};
462
+ transform: scale(0.1);
463
+ opacity: 0;
464
+ z-index: -1;
465
+ transition:
466
+ transform 0.3s,
467
+ opacity 0.3s,
468
+ background-color 0.3s;
469
+ }
470
+ &:hover::after {
471
+ opacity: 1;
472
+ transform-origin: center;
473
+ transform: scale(1);
474
+ }
475
+ }
476
+ & > :not(.Mui-disabled) {
477
+ background-color: transparent !important;
478
+ color: ${e=>e.theme.palette.primary.main}!important;
479
+ }
480
+ & > :not(.Mui-disabled) {
481
+ &:hover {
482
+ color: ${e=>e.theme.palette.common.white}!important;
483
+ }
484
+ }
485
+ `;const Po=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Zd=(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`},la={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 Yr({title:e,sx:t,children:n,slotProps:r,fontSize:o=12,fontWeight:u=500,color:d="text.secondary",...h}){var y,x;return e?i.jsx(Xo,{title:e,placement:"top",...h,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Ba.tooltip}`]:{backgroundColor:"common.white",fontSize:o,fontWeight:u,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((y=r==null?void 0:r.popper)==null?void 0:y.sx)?r.popper.sx:[(x=r==null?void 0:r.popper)==null?void 0:x.sx]]}},children:n}):n}function sr({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(Yr,{title:r||(typeof t=="string"?t:""),children:i.jsx(be,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function eh(e){const{title:t,description:n="",cover:r="",avatar:o,author:u,download:d,did:h,official:y,buttonText:x="Install",buttonDisabled:s,buttonLoading:a,button:O,onButtonClick:v=()=>{},onMainClick:S,className:k,ref:_,icons:A,status:Y,...U}=e,J=er(),j=(Z,ae=()=>!1)=>(Re,...Fe)=>{const $e=Z instanceof Function;(ae()||$e)&&(Re.preventDefault(),Re.stopPropagation(),$e&&Z(...Fe))},W=S&&j(S),Q=j(v,()=>!!(O||s||a)),M=L.isValidElement(t)?{children:t}:{title:Po(t),dangerouslySetInnerHTML:{__html:t}},de=L.isValidElement(n)?{children:n}:{title:Po(n),dangerouslySetInnerHTML:{__html:n}};return i.jsxs($a,{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(pr,{src:r,did:h,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),i.jsx(be,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...M}),i.jsxs(X,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[y&&i.jsx(Yr,{title:y.tooltip,children:i.jsx(al,{sx:{color:y.color||"#D97706",fontSize:y.size||18}})}),A==null?void 0:A.map(Z=>i.jsx(Yr,{title:Z.title,children:typeof Z.icon=="string"?i.jsx(ot,{icon:Z.icon,style:{color:Z.color}}):Z.icon},Z.key))]}),v&&i.jsxs(ut,{color:"reverse",variant:"outlined",size:"small",disabled:s||a,style:{borderColor:J.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:J.typography.fontWeightMedium},onClick:Q,children:[a&&i.jsx(gt,{size:15,style:{marginRight:3,color:"inherit"}}),x]}),O]}),i.jsx(et,{py:2,children:i.jsx(be,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...de})}),i.jsxs(et,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(sr,{icon:i.jsx(pr,{src:o,did:h,size:20,variant:"circle"}),maxWidth:200,children:u}),i.jsx(sr,{icon:i.jsx(ot,{icon:la}),title:d,children:Zd(d)}),Y==null?void 0:Y.filter(Z=>Z.align!=="right").map(Z=>i.jsx(sr,{icon:typeof Z.icon=="string"?i.jsx(ot,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,children:Z.text},Z.key)),i.jsx(X,{sx:{flex:1}}),Y==null?void 0:Y.filter(Z=>Z.align==="right").map(Z=>i.jsx(sr,{icon:typeof Z.icon=="string"?i.jsx(ot,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,sx:{color:Z.color},children:Z.text},Z.key))]})]})}const th={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 Wi={},nh=ei;Object.defineProperty(Wi,"__esModule",{value:!0});var ca=Wi.default=void 0,rh=nh(si()),ih=i;ca=Wi.default=(0,rh.default)((0,ih.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var ua={exports:{}};(function(e,t){(function(n,r){e.exports=r(L)})(ke,n=>(()=>{var r={703:(h,y,x)=>{var s=x(414);function a(){}function O(){}O.resetWarningCache=a,h.exports=function(){function v(_,A,Y,U,J,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 v}v.isRequired=v;var k={array:v,bool:v,func:v,number:v,object:v,string:v,symbol:v,any:v,arrayOf:S,element:v,elementType:v,instanceOf:S,node:v,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:O,resetWarningCache:a};return k.PropTypes=k,k}},697:(h,y,x)=>{h.exports=x(703)()},414:h=>{h.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:h=>{var y=typeof Element<"u",x=typeof Map=="function",s=typeof Set=="function",a=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function O(v,S){if(v===S)return!0;if(v&&S&&typeof v=="object"&&typeof S=="object"){if(v.constructor!==S.constructor)return!1;var k,_,A,Y;if(Array.isArray(v)){if((k=v.length)!=S.length)return!1;for(_=k;_--!=0;)if(!O(v[_],S[_]))return!1;return!0}if(x&&v instanceof Map&&S instanceof Map){if(v.size!==S.size)return!1;for(Y=v.entries();!(_=Y.next()).done;)if(!S.has(_.value[0]))return!1;for(Y=v.entries();!(_=Y.next()).done;)if(!O(_.value[1],S.get(_.value[0])))return!1;return!0}if(s&&v instanceof Set&&S instanceof Set){if(v.size!==S.size)return!1;for(Y=v.entries();!(_=Y.next()).done;)if(!S.has(_.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(v)&&ArrayBuffer.isView(S)){if((k=v.length)!=S.length)return!1;for(_=k;_--!=0;)if(v[_]!==S[_])return!1;return!0}if(v.constructor===RegExp)return v.source===S.source&&v.flags===S.flags;if(v.valueOf!==Object.prototype.valueOf)return v.valueOf()===S.valueOf();if(v.toString!==Object.prototype.toString)return v.toString()===S.toString();if((k=(A=Object.keys(v)).length)!==Object.keys(S).length)return!1;for(_=k;_--!=0;)if(!Object.prototype.hasOwnProperty.call(S,A[_]))return!1;if(y&&v instanceof Element)return!1;for(_=k;_--!=0;)if((A[_]!=="_owner"&&A[_]!=="__v"&&A[_]!=="__o"||!v.$$typeof)&&!O(v[A[_]],S[A[_]]))return!1;return!0}return v!=v&&S!=S}h.exports=function(v,S){try{return O(v,S)}catch(k){if((k.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw k}}},359:h=>{h.exports=n}},o={};function u(h){var y=o[h];if(y!==void 0)return y.exports;var x=o[h]={exports:{}};return r[h](x,x.exports,u),x.exports}u.n=h=>{var y=h&&h.__esModule?()=>h.default:()=>h;return u.d(y,{a:y}),y},u.d=(h,y)=>{for(var x in y)u.o(y,x)&&!u.o(h,x)&&Object.defineProperty(h,x,{enumerable:!0,get:y[x]})},u.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),u.o=(h,y)=>Object.prototype.hasOwnProperty.call(h,y),u.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(g){var p,E,T="";if(typeof g=="string"||typeof g=="number")T+=g;else if(typeof g=="object")if(Array.isArray(g))for(p=0;p<g.length;p++)g[p]&&(E=h(g[p]))&&(T&&(T+=" "),T+=E);else for(p in g)g[p]&&(T&&(T+=" "),T+=p);return T}function y(){for(var g,p,E=0,T="";E<arguments.length;)(g=arguments[E++])&&(p=h(g))&&(T&&(T+=" "),T+=p);return T}u.r(d),u.d(d,{default:()=>jn});var x=u(359),s=u.n(x);const a=function(g){var p=typeof g;return g!=null&&(p=="object"||p=="function")},O=typeof ke=="object"&&ke&&ke.Object===Object&&ke;var v=typeof self=="object"&&self&&self.Object===Object&&self;const S=O||v||Function("return this")(),k=function(){return S.Date.now()};var _=/\s/,A=/^\s+/;const Y=function(g){return g&&g.slice(0,function(p){for(var E=p.length;E--&&_.test(p.charAt(E)););return E}(g)+1).replace(A,"")},U=S.Symbol;var J=Object.prototype,j=J.hasOwnProperty,W=J.toString,Q=U?U.toStringTag:void 0,M=Object.prototype.toString,de=U?U.toStringTag:void 0;const Z=function(g){return g==null?g===void 0?"[object Undefined]":"[object Null]":de&&de in Object(g)?function(p){var E=j.call(p,Q),T=p[Q];try{p[Q]=void 0;var B=!0}catch{}var ie=W.call(p);return B&&(E?p[Q]=T:delete p[Q]),ie}(g):function(p){return M.call(p)}(g)};var ae=/^[-+]0x[0-9a-f]+$/i,Re=/^0b[01]+$/i,Fe=/^0o[0-7]+$/i,$e=parseInt;const nt=function(g){if(typeof g=="number")return g;if(function(T){return typeof T=="symbol"||function(B){return B!=null&&typeof B=="object"}(T)&&Z(T)=="[object Symbol]"}(g))return NaN;if(a(g)){var p=typeof g.valueOf=="function"?g.valueOf():g;g=a(p)?p+"":p}if(typeof g!="string")return g===0?g:+g;g=Y(g);var E=Re.test(g);return E||Fe.test(g)?$e(g.slice(2),E?2:8):ae.test(g)?NaN:+g};var te=Math.max,ge=Math.min;const z=function(g,p,E){var T,B,ie,ye,m,f,R=0,D=!1,$=!1,F=!0;if(typeof g!="function")throw new TypeError("Expected a function");function ce(oe){var fe=T,Te=B;return T=B=void 0,R=oe,ye=g.apply(Te,fe)}function le(oe){return R=oe,m=setTimeout(V,p),D?ce(oe):ye}function pe(oe){var fe=oe-f;return f===void 0||fe>=p||fe<0||$&&oe-R>=ie}function V(){var oe=k();if(pe(oe))return G(oe);m=setTimeout(V,function(fe){var Te=p-(fe-f);return $?ge(Te,ie-(fe-R)):Te}(oe))}function G(oe){return m=void 0,F&&T?ce(oe):(T=B=void 0,ye)}function ee(){var oe=k(),fe=pe(oe);if(T=arguments,B=this,f=oe,fe){if(m===void 0)return le(f);if($)return clearTimeout(m),m=setTimeout(V,p),ce(f)}return m===void 0&&(m=setTimeout(V,p)),ye}return p=nt(p)||0,a(E)&&(D=!!E.leading,ie=($="maxWait"in E)?te(nt(E.maxWait)||0,p):ie,F="trailing"in E?!!E.trailing:F),ee.cancel=function(){m!==void 0&&clearTimeout(m),R=0,T=f=B=m=void 0},ee.flush=function(){return m===void 0?ye:G(k())},ee},Ce=function(g,p,E){var T=!0,B=!0;if(typeof g!="function")throw new TypeError("Expected a function");return a(E)&&(T="leading"in E?!!E.leading:T,B="trailing"in E?!!E.trailing:B),z(g,p,{leading:T,maxWait:p,trailing:B})};var se=u(590),ht=u.n(se),Oe=function(){if(typeof Map<"u")return Map;function g(p,E){var T=-1;return p.some(function(B,ie){return B[0]===E&&(T=ie,!0)}),T}return function(){function p(){this.__entries__=[]}return Object.defineProperty(p.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),p.prototype.get=function(E){var T=g(this.__entries__,E),B=this.__entries__[T];return B&&B[1]},p.prototype.set=function(E,T){var B=g(this.__entries__,E);~B?this.__entries__[B][1]=T:this.__entries__.push([E,T])},p.prototype.delete=function(E){var T=this.__entries__,B=g(T,E);~B&&T.splice(B,1)},p.prototype.has=function(E){return!!~g(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,T){T===void 0&&(T=null);for(var B=0,ie=this.__entries__;B<ie.length;B++){var ye=ie[B];E.call(T,ye[1],ye[0])}},p}()}(),He=typeof window<"u"&&typeof document<"u"&&window.document===document,We=u.g!==void 0&&u.g.Math===Math?u.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Nt=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(We):function(g){return setTimeout(function(){return g(Date.now())},1e3/60)},Zt=["top","right","bottom","left","width","height","size","weight"],Ut=typeof MutationObserver<"u",en=function(){function g(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var T=!1,B=!1,ie=0;function ye(){T&&(T=!1,p()),B&&f()}function m(){Nt(ye)}function f(){var R=Date.now();if(T){if(R-ie<2)return;B=!0}else T=!0,B=!1,setTimeout(m,20);ie=R}return f}(this.refresh.bind(this))}return g.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},g.prototype.removeObserver=function(p){var E=this.observers_,T=E.indexOf(p);~T&&E.splice(T,1),!E.length&&this.connected_&&this.disconnect_()},g.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},g.prototype.updateObservers_=function(){var p=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return p.forEach(function(E){return E.broadcastActive()}),p.length>0},g.prototype.connect_=function(){He&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ut?(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)},g.prototype.disconnect_=function(){He&&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)},g.prototype.onTransitionEnd_=function(p){var E=p.propertyName,T=E===void 0?"":E;Zt.some(function(B){return!!~T.indexOf(B)})&&this.refresh()},g.getInstance=function(){return this.instance_||(this.instance_=new g),this.instance_},g.instance_=null,g}(),_e=function(g,p){for(var E=0,T=Object.keys(p);E<T.length;E++){var B=T[E];Object.defineProperty(g,B,{value:p[B],enumerable:!1,writable:!1,configurable:!0})}return g},Le=function(g){return g&&g.ownerDocument&&g.ownerDocument.defaultView||We},Xe=ve(0,0,0,0);function xe(g){return parseFloat(g)||0}function yt(g){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(T,B){return T+xe(g["border-"+B+"-width"])},0)}var Nn=typeof SVGGraphicsElement<"u"?function(g){return g instanceof Le(g).SVGGraphicsElement}:function(g){return g instanceof Le(g).SVGElement&&typeof g.getBBox=="function"};function An(g){return He?Nn(g)?function(p){var E=p.getBBox();return ve(0,0,E.width,E.height)}(g):function(p){var E=p.clientWidth,T=p.clientHeight;if(!E&&!T)return Xe;var B=Le(p).getComputedStyle(p),ie=function(F){for(var ce={},le=0,pe=["top","right","bottom","left"];le<pe.length;le++){var V=pe[le],G=F["padding-"+V];ce[V]=xe(G)}return ce}(B),ye=ie.left+ie.right,m=ie.top+ie.bottom,f=xe(B.width),R=xe(B.height);if(B.boxSizing==="border-box"&&(Math.round(f+ye)!==E&&(f-=yt(B,"left","right")+ye),Math.round(R+m)!==T&&(R-=yt(B,"top","bottom")+m)),!function(F){return F===Le(F).document.documentElement}(p)){var D=Math.round(f+ye)-E,$=Math.round(R+m)-T;Math.abs(D)!==1&&(f-=D),Math.abs($)!==1&&(R-=$)}return ve(ie.left,ie.top,f,R)}(g):Xe}function ve(g,p,E,T){return{x:g,y:p,width:E,height:T}}var Dn=function(){function g(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ve(0,0,0,0),this.target=p}return g.prototype.isActive=function(){var p=An(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},g.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},g}(),tn=function(g,p){var E,T,B,ie,ye,m,f,R=(T=(E=p).x,B=E.y,ie=E.width,ye=E.height,m=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,f=Object.create(m.prototype),_e(f,{x:T,y:B,width:ie,height:ye,top:B,right:T+ie,bottom:ye+B,left:T}),f);_e(this,{target:g,contentRect:R})},nn=function(){function g(p,E,T){if(this.activeObservations_=[],this.observations_=new Oe,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=T}return g.prototype.observe=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new Dn(p)),this.controller_.addObserver(this),this.controller_.refresh())}},g.prototype.unobserve=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)&&(E.delete(p),E.size||this.controller_.removeObserver(this))}},g.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},g.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},g.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(T){return new tn(T.target,T.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},g.prototype.clearActive=function(){this.activeObservations_.splice(0)},g.prototype.hasActive=function(){return this.activeObservations_.length>0},g}(),Wt=typeof WeakMap<"u"?new WeakMap:new Oe,At=function g(p){if(!(this instanceof g))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=en.getInstance(),T=new nn(p,E,this);Wt.set(this,T)};["observe","unobserve","disconnect"].forEach(function(g){At.prototype[g]=function(){var p;return(p=Wt.get(this))[g].apply(p,arguments)}});const rn=We.ResizeObserver!==void 0?We.ResizeObserver:At,pt="Left",De="Right",bt="Up",rt="Down",xt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},zt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ye="mousemove",Rt="mouseup";function bn(g,p){if(p===0)return g;const E=Math.PI/180*p;return[g[0]*Math.cos(E)+g[1]*Math.sin(E),g[1]*Math.cos(E)-g[0]*Math.sin(E)]}function Mn(g){const{trackMouse:p}=g,E=x.useRef(Object.assign({},zt)),T=x.useRef(Object.assign({},xt)),B=x.useRef(Object.assign({},T.current));let ie;for(ie in B.current=Object.assign({},T.current),T.current=Object.assign(Object.assign({},xt),g),xt)T.current[ie]===void 0&&(T.current[ie]=xt[ie]);const[ye,m]=x.useMemo(()=>function(f,R){const D=V=>{const G="touches"in V;G&&V.touches.length>1||f((ee,oe)=>{oe.trackMouse&&!G&&(document.addEventListener(Ye,$),document.addEventListener(Rt,ce));const{clientX:fe,clientY:Te}=G?V.touches[0]:V,Ne=bn([fe,Te],oe.rotationAngle);return oe.onTouchStartOrOnMouseDown&&oe.onTouchStartOrOnMouseDown({event:V}),Object.assign(Object.assign(Object.assign({},ee),zt),{initial:Ne.slice(),xy:Ne,start:V.timeStamp||0})})},$=V=>{f((G,ee)=>{const oe="touches"in V;if(oe&&V.touches.length>1)return G;if(V.timeStamp-G.start>ee.swipeDuration)return G.swiping?Object.assign(Object.assign({},G),{swiping:!1}):G;const{clientX:fe,clientY:Te}=oe?V.touches[0]:V,[Ne,it]=bn([fe,Te],ee.rotationAngle),Ze=Ne-G.xy[0],qe=it-G.xy[1],Pe=Math.abs(Ze),je=Math.abs(qe),Ht=(V.timeStamp||0)-G.start,$n=Math.sqrt(Pe*Pe+je*je)/(Ht||1),Un=[Ze/(Ht||1),qe/(Ht||1)],Mt=function(Wn,kn,zn,lt){return Wn>kn?zn>0?De:pt:lt>0?rt:bt}(Pe,je,Ze,qe),un=typeof ee.delta=="number"?ee.delta:ee.delta[Mt.toLowerCase()]||xt.delta;if(Pe<un&&je<un&&!G.swiping)return G;const It={absX:Pe,absY:je,deltaX:Ze,deltaY:qe,dir:Mt,event:V,first:G.first,initial:G.initial,velocity:$n,vxvy:Un};It.first&&ee.onSwipeStart&&ee.onSwipeStart(It),ee.onSwiping&&ee.onSwiping(It);let On=!1;return(ee.onSwiping||ee.onSwiped||ee[`onSwiped${Mt}`])&&(On=!0),On&&ee.preventScrollOnSwipe&&ee.trackTouch&&V.cancelable&&V.preventDefault(),Object.assign(Object.assign({},G),{first:!1,eventData:It,swiping:!0})})},F=V=>{f((G,ee)=>{let oe;if(G.swiping&&G.eventData){if(V.timeStamp-G.start<ee.swipeDuration){oe=Object.assign(Object.assign({},G.eventData),{event:V}),ee.onSwiped&&ee.onSwiped(oe);const fe=ee[`onSwiped${oe.dir}`];fe&&fe(oe)}}else ee.onTap&&ee.onTap({event:V});return ee.onTouchEndOrOnMouseUp&&ee.onTouchEndOrOnMouseUp({event:V}),Object.assign(Object.assign(Object.assign({},G),zt),{eventData:oe})})},ce=V=>{document.removeEventListener(Ye,$),document.removeEventListener(Rt,ce),F(V)},le=(V,G)=>{let ee=()=>{};if(V&&V.addEventListener){const oe=Object.assign(Object.assign({},xt.touchEventOptions),G.touchEventOptions),fe=[["touchstart",D,oe],["touchmove",$,Object.assign(Object.assign({},oe),G.preventScrollOnSwipe?{passive:!1}:{})],["touchend",F,oe]];fe.forEach(([Te,Ne,it])=>V.addEventListener(Te,Ne,it)),ee=()=>fe.forEach(([Te,Ne])=>V.removeEventListener(Te,Ne))}return ee},pe={ref:V=>{V!==null&&f((G,ee)=>{if(G.el===V)return G;const oe={};return G.el&&G.el!==V&&G.cleanUpTouch&&(G.cleanUpTouch(),oe.cleanUpTouch=void 0),ee.trackTouch&&V&&(oe.cleanUpTouch=le(V,ee)),Object.assign(Object.assign(Object.assign({},G),{el:V}),oe)})}};return R.trackMouse&&(pe.onMouseDown=D),[pe,le]}(f=>E.current=f(E.current,T.current),{trackMouse:p}),[p]);return E.current=function(f,R,D,$){return R.trackTouch&&f.el?f.cleanUpTouch?R.preventScrollOnSwipe!==D.preventScrollOnSwipe||R.touchEventOptions.passive!==D.touchEventOptions.passive?(f.cleanUpTouch(),Object.assign(Object.assign({},f),{cleanUpTouch:$(f.el,R)})):f:Object.assign(Object.assign({},f),{cleanUpTouch:$(f.el,R)}):(f.cleanUpTouch&&f.cleanUpTouch(),Object.assign(Object.assign({},f),{cleanUpTouch:void 0}))}(E.current,T.current,B.current,m),ye}var I=u(697);function wt(g){return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},wt(g)}function ze(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(g,B).enumerable})),E.push.apply(E,T)}return E}function xn(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?ze(Object(E),!0).forEach(function(T){l(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):ze(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function l(g,p,E){return(p=function(T){var B=function(ie,ye){if(wt(ie)!=="object"||ie===null)return ie;var m=ie[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ie,ye);if(wt(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(T,"string");return wt(B)==="symbol"?B:String(B)}(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}var b={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=s().memo(function(g){var p=xn(xn({},b),g),E=p.description,T=p.fullscreen,B=p.handleImageLoaded,ie=p.isFullscreen,ye=p.onImageError,m=p.original,f=p.originalAlt,R=p.originalHeight,D=p.originalWidth,$=p.originalTitle,F=p.sizes,ce=p.srcSet,le=p.loading,pe=ie&&T||m;return s().createElement(s().Fragment,null,s().createElement("img",{className:"image-gallery-image",src:pe,alt:f,srcSet:ce,height:R,width:D,sizes:F,title:$,onLoad:function(V){return B(V,m)},onError:ye,loading:le}),E&&s().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.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 C=w;function N(g){return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},N(g)}function K(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(g,B).enumerable})),E.push.apply(E,T)}return E}function H(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?K(Object(E),!0).forEach(function(T){me(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):K(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function me(g,p,E){return(p=function(T){var B=function(ie,ye){if(N(ie)!=="object"||ie===null)return ie;var m=ie[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ie,ye);if(N(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(T,"string");return N(B)==="symbol"?B:String(B)}(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}var he={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"}))},Je={strokeWidth:1,viewBox:"0 0 24 24"},q=function(g){var p=H(H({},Je),g),E=p.strokeWidth,T=p.viewBox,B=p.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"},he[B])};q.propTypes={strokeWidth:I.number,viewBox:I.string,icon:(0,I.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const ne=q;var ue=s().memo(function(g){var p=g.isFullscreen,E=g.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},s().createElement(ne,{strokeWidth:2,icon:p?"minimize":"maximize"}))});ue.displayName="Fullscreen",ue.propTypes={isFullscreen:I.bool.isRequired,onClick:I.func.isRequired};const we=ue;var Et=s().memo(function(g){var p=g.disabled,E=g.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},s().createElement(ne,{icon:"left",viewBox:"6 0 12 24"}))});Et.displayName="LeftNav",Et.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const qt=Et;var St=s().memo(function(g){var p=g.disabled,E=g.onClick;return s().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},s().createElement(ne,{icon:"right",viewBox:"6 0 12 24"}))});St.displayName="RightNav",St.propTypes={disabled:I.bool.isRequired,onClick:I.func.isRequired};const Tt=St;var ft=s().memo(function(g){var p=g.isPlaying,E=g.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(ne,{strokeWidth:2,icon:p?"pause":"play"}))});ft.displayName="PlayPause",ft.propTypes={isPlaying:I.bool.isRequired,onClick:I.func.isRequired};const on=ft;function jt(g){return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},jt(g)}function sn(){return sn=Object.assign?Object.assign.bind():function(g){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(g[T]=E[T])}return g},sn.apply(this,arguments)}function Kt(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(g,B).enumerable})),E.push.apply(E,T)}return E}function Qe(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Kt(Object(E),!0).forEach(function(T){wn(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):Kt(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function wn(g,p,E){return(p=function(T){var B=function(ie,ye){if(jt(ie)!=="object"||ie===null)return ie;var m=ie[Symbol.toPrimitive];if(m!==void 0){var f=m.call(ie,ye);if(jt(f)!=="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(ie)}(T,"string");return jt(B)==="symbol"?B:String(B)}(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}var Vt={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Dt=function(g){var p=Qe(Qe({},Vt),g),E=p.children,T=p.className,B=Mn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return s().createElement("div",sn({},B,{className:T}),E)};Dt.propTypes={children:I.node.isRequired,className:I.string,delta:I.number,onSwiped:I.func,onSwiping:I.func};const st=Dt;function at(g){return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},at(g)}function En(g,p){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(g);p&&(T=T.filter(function(B){return Object.getOwnPropertyDescriptor(g,B).enumerable})),E.push.apply(E,T)}return E}function an(g){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?En(Object(E),!0).forEach(function(T){ln(g,T,E[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):En(Object(E)).forEach(function(T){Object.defineProperty(g,T,Object.getOwnPropertyDescriptor(E,T))})}return g}function rr(g,p){for(var E=0;E<p.length;E++){var T=p[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(g,cn(T.key),T)}}function Sn(g,p){return Sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,T){return E.__proto__=T,E},Sn(g,p)}function ir(g,p){if(p&&(at(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ee(g)}function Ee(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function Gt(g){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},Gt(g)}function ln(g,p,E){return(p=cn(p))in g?Object.defineProperty(g,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):g[p]=E,g}function cn(g){var p=function(E,T){if(at(E)!=="object"||E===null)return E;var B=E[Symbol.toPrimitive];if(B!==void 0){var ie=B.call(E,T);if(at(ie)!=="object")return ie;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(g,"string");return at(p)==="symbol"?p:String(p)}var Tn=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Fn=(0,I.arrayOf)((0,I.shape)({srcSet:I.string,media:I.string}));function Bn(g){var p=parseInt(g.keyCode||g.which||0,10);return p===66||p===62}var Ct=function(g){(function(m,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function");m.prototype=Object.create(f&&f.prototype,{constructor:{value:m,writable:!0,configurable:!0}}),Object.defineProperty(m,"prototype",{writable:!1}),f&&Sn(m,f)})(ye,g);var p,E,T,B,ie=(T=ye,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 m,f=Gt(T);if(B){var R=Gt(this).constructor;m=Reflect.construct(f,arguments,R)}else m=f.apply(this,arguments);return ir(this,m)});function ye(m){var f;return function(R,D){if(!(R instanceof D))throw new TypeError("Cannot call a class as a function")}(this,ye),ln(Ee(f=ie.call(this,m)),"onBulletClick",function(R,D){var $=f.props,F=$.onBulletClick,ce=$.items,le=f.state.currentIndex;R.target.blur(),le!==D&&(ce.length===2?f.slideToIndexWithStyleReset(D,R):f.slideToIndex(D,R)),F&&F(R,D)}),f.state={currentIndex:m.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(m.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},f.loadedImages={},f.imageGallery=s().createRef(),f.thumbnailsWrapper=s().createRef(),f.thumbnails=s().createRef(),f.imageGallerySlideWrapper=s().createRef(),f.handleImageLoaded=f.handleImageLoaded.bind(Ee(f)),f.handleKeyDown=f.handleKeyDown.bind(Ee(f)),f.handleMouseDown=f.handleMouseDown.bind(Ee(f)),f.handleResize=f.handleResize.bind(Ee(f)),f.handleTouchMove=f.handleTouchMove.bind(Ee(f)),f.handleOnSwiped=f.handleOnSwiped.bind(Ee(f)),f.handleScreenChange=f.handleScreenChange.bind(Ee(f)),f.handleSwiping=f.handleSwiping.bind(Ee(f)),f.handleThumbnailSwiping=f.handleThumbnailSwiping.bind(Ee(f)),f.handleOnThumbnailSwiped=f.handleOnThumbnailSwiped.bind(Ee(f)),f.onThumbnailMouseLeave=f.onThumbnailMouseLeave.bind(Ee(f)),f.handleImageError=f.handleImageError.bind(Ee(f)),f.pauseOrPlay=f.pauseOrPlay.bind(Ee(f)),f.renderThumbInner=f.renderThumbInner.bind(Ee(f)),f.renderItem=f.renderItem.bind(Ee(f)),f.slideLeft=f.slideLeft.bind(Ee(f)),f.slideRight=f.slideRight.bind(Ee(f)),f.toggleFullScreen=f.toggleFullScreen.bind(Ee(f)),f.togglePlay=f.togglePlay.bind(Ee(f)),f.unthrottledSlideToIndex=f.slideToIndex,f.slideToIndex=Ce(f.unthrottledSlideToIndex,m.slideDuration,{trailing:!1}),m.lazyLoad&&(f.lazyLoaded=[]),f}return p=ye,E=[{key:"componentDidMount",value:function(){var m=this.props,f=m.autoPlay,R=m.useWindowKeyDown;f&&this.play(),R?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(m,f){var R=this.props,D=R.items,$=R.lazyLoad,F=R.slideDuration,ce=R.slideInterval,le=R.startIndex,pe=R.thumbnailPosition,V=R.showThumbnails,G=R.useWindowKeyDown,ee=this.state,oe=ee.currentIndex,fe=ee.isPlaying,Te=m.items.length!==D.length,Ne=!ht()(m.items,D),it=m.startIndex!==le,Ze=m.thumbnailPosition!==pe,qe=m.showThumbnails!==V;ce===m.slideInterval&&F===m.slideDuration||fe&&(this.pause(),this.play()),Ze&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),qe&&V&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),qe&&!V&&this.removeThumbnailsResizeObserver(),(Te||qe)&&this.handleResize(),f.currentIndex!==oe&&this.slideThumbnailBar(),m.slideDuration!==F&&(this.slideToIndex=Ce(this.unthrottledSlideToIndex,F,{trailing:!1})),!$||m.lazyLoad&&!Ne||(this.lazyLoaded=[]),G!==m.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))),(it||Ne)&&this.setState({currentIndex:le,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var m=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),m?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var m=this,f=this.state,R=f.currentIndex,D=f.isTransitioning,$=this.props,F=$.onSlide,ce=$.slideDuration;this.transitionTimer=window.setTimeout(function(){D&&(m.setState({isTransitioning:!D,isSwipingThumbnail:!1}),F&&F(R))},ce+50)}},{key:"onThumbnailClick",value:function(m,f){var R=this.props,D=R.onThumbnailClick,$=R.items,F=this.state.currentIndex;m.target.parentNode.parentNode.blur(),F!==f&&($.length===2?this.slideToIndexWithStyleReset(f,m):this.slideToIndex(f,m)),D&&D(m,f)}},{key:"onThumbnailMouseOver",value:function(m,f){var R=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){R.slideToIndex(f),R.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var m=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,m&&this.play()}}},{key:"setThumbsTranslate",value:function(m){this.setState({thumbsTranslate:m})}},{key:"setModalFullscreen",value:function(m){var f=this.props.onScreenChange;this.setState({modalFullscreen:m}),f&&f(m)}},{key:"getThumbsTranslate",value:function(m){var f,R=this.props,D=R.disableThumbnailScroll,$=R.items,F=this.state,ce=F.thumbnailsWrapperWidth,le=F.thumbnailsWrapperHeight,pe=this.thumbnails&&this.thumbnails.current;if(D)return 0;if(pe){if(this.isThumbnailVertical()){if(pe.scrollHeight<=le)return 0;f=pe.scrollHeight-le}else{if(pe.scrollWidth<=ce||ce<=0)return 0;f=pe.scrollWidth-ce}return m*(f/($.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(m){switch(m){case"left":m=" ".concat("image-gallery-thumbnails-left");break;case"right":m=" ".concat("image-gallery-thumbnails-right");break;case"bottom":m=" ".concat("image-gallery-thumbnails-bottom");break;case"top":m=" ".concat("image-gallery-thumbnails-top")}return m}},{key:"getAlignmentClassName",value:function(m){var f=this.state.currentIndex,R=this.props,D=R.infinite,$=R.items,F="",ce="image-gallery-left",le="image-gallery-right";switch(m){case f-1:F=" ".concat(ce);break;case f:F=" ".concat("image-gallery-center");break;case f+1:F=" ".concat(le)}return $.length>=3&&D&&(m===0&&f===$.length-1?F=" ".concat(le):m===$.length-1&&f===0&&(F=" ".concat(ce))),F}},{key:"getTranslateXForTwoSlide",value:function(m){var f=this.state,R=f.currentIndex,D=f.currentSlideOffset,$=f.previousIndex,F=R!==$,ce=m===0&&$===0,le=m===1&&$===1,pe=m===0&&R===1,V=m===1&&R===0,G=D===0,ee=-100*R+100*m+D;return D>0?this.direction="left":D<0&&(this.direction="right"),V&&D>0&&(ee=-100+D),pe&&D<0&&(ee=100+D),F?ce&&G&&this.direction==="left"?ee=100:le&&G&&this.direction==="right"&&(ee=-100):(V&&G&&this.direction==="left"&&(ee=-100),pe&&G&&this.direction==="right"&&(ee=100)),ee}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(m){var f=this.state,R=f.currentIndex,D=f.currentSlideOffset,$=f.slideStyle,F=this.props,ce=F.infinite,le=F.items,pe=F.useTranslate3D,V=F.isRTL,G=-100*R,ee=le.length-1,oe=(G+100*m)*(V?-1:1)+D;ce&&le.length>2&&(R===0&&m===ee?oe=-100*(V?-1:1)+D:R===ee&&m===0&&(oe=100*(V?-1:1)+D)),ce&&le.length===2&&(oe=this.getTranslateXForTwoSlide(m));var fe="translate(".concat(oe,"%, 0)");return pe&&(fe="translate3d(".concat(oe,"%, 0, 0)")),an({display:this.isSlideVisible(m)?"inherit":"none",WebkitTransform:fe,MozTransform:fe,msTransform:fe,OTransform:fe,transform:fe},$)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var m,f=this.props,R=f.useTranslate3D,D=f.isRTL,$=this.state,F=$.thumbsTranslate,ce=$.thumbsStyle,le=D?-1*F:F;return this.isThumbnailVertical()?(m="translate(0, ".concat(F,"px)"),R&&(m="translate3d(0, ".concat(F,"px, 0)"))):(m="translate(".concat(le,"px, 0)"),R&&(m="translate3d(".concat(le,"px, 0, 0)"))),an({WebkitTransform:m,MozTransform:m,msTransform:m,OTransform:m,transform:m},ce)}},{key:"getSlideItems",value:function(){var m=this,f=this.state.currentIndex,R=this.props,D=R.items,$=R.slideOnThumbnailOver,F=R.onClick,ce=R.lazyLoad,le=R.onTouchMove,pe=R.onTouchEnd,V=R.onTouchStart,G=R.onMouseOver,ee=R.onMouseLeave,oe=R.renderItem,fe=R.renderThumbInner,Te=R.showThumbnails,Ne=R.showBullets,it=[],Ze=[],qe=[];return D.forEach(function(Pe,je){var Ht=m.getAlignmentClassName(je),$n=Pe.originalClass?" ".concat(Pe.originalClass):"",Un=Pe.thumbnailClass?" ".concat(Pe.thumbnailClass):"",Mt=Pe.renderItem||oe||m.renderItem,un=Pe.renderThumbInner||fe||m.renderThumbInner,It=!ce||Ht||m.lazyLoaded[je];It&&ce&&!m.lazyLoaded[je]&&(m.lazyLoaded[je]=!0);var On=m.getSlideStyle(je),Wn=s().createElement("div",{"aria-label":"Go to Slide ".concat(je+1),key:"slide-".concat(je),tabIndex:"-1",className:"image-gallery-slide ".concat(Ht," ").concat($n),style:On,onClick:F,onKeyUp:m.handleSlideKeyUp,onTouchMove:le,onTouchEnd:pe,onTouchStart:V,onMouseOver:G,onFocus:G,onMouseLeave:ee,role:"button"},It?Mt(Pe):s().createElement("div",{style:{height:"100%"}}));if(it.push(Wn),Te&&Pe.thumbnail){var kn=y("image-gallery-thumbnail",Un,{active:f===je});Ze.push(s().createElement("button",{key:"thumbnail-".concat(je),type:"button",tabIndex:"0","aria-pressed":f===je?"true":"false","aria-label":"Go to Slide ".concat(je+1),className:kn,onMouseLeave:$?m.onThumbnailMouseLeave:null,onMouseOver:function(lt){return m.handleThumbnailMouseOver(lt,je)},onFocus:function(lt){return m.handleThumbnailMouseOver(lt,je)},onKeyUp:function(lt){return m.handleThumbnailKeyUp(lt,je)},onClick:function(lt){return m.onThumbnailClick(lt,je)}},un(Pe)))}if(Ne){var zn=y("image-gallery-bullet",Pe.bulletClass,{active:f===je});qe.push(s().createElement("button",{type:"button",key:"bullet-".concat(je),className:zn,onClick:function(lt){return m.onBulletClick(lt,je)},"aria-pressed":f===je?"true":"false","aria-label":"Go to Slide ".concat(je+1)}))}}),{slides:it,thumbnails:Ze,bullets:qe}}},{key:"ignoreIsTransitioning",value:function(){var m=this.props.items,f=this.state,R=f.previousIndex,D=f.currentIndex,$=m.length-1;return Math.abs(R-D)>1&&!(R===0&&D===$)&&!(R===$&&D===0)}},{key:"isFirstOrLastSlide",value:function(m){return m===this.props.items.length-1||m===0}},{key:"slideIsTransitioning",value:function(m){var f=this.state,R=f.isTransitioning,D=f.previousIndex,$=f.currentIndex;return R&&!(m===D||m===$)}},{key:"isSlideVisible",value:function(m){return!this.slideIsTransitioning(m)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(m)}},{key:"slideThumbnailBar",value:function(){var m=this.state,f=m.currentIndex,R=m.isSwipingThumbnail,D=-this.getThumbsTranslate(f);R||(f===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(m){var f=m.event,R=m.absX,D=m.dir,$=this.props,F=$.disableSwipe,ce=$.stopPropagation,le=this.state,pe=le.galleryWidth,V=le.isTransitioning,G=le.swipingUpDown,ee=le.swipingLeftRight;if(D!==bt&&D!==rt&&!G||ee){if(D!==pt&&D!==De||ee||this.setState({swipingLeftRight:!0}),!F){var oe=this.props.swipingTransitionDuration;if(ce&&f.preventDefault(),V)this.setState({currentSlideOffset:0});else{var fe=D===De?1:-1,Te=R/pe*100;Math.abs(Te)>=100&&(Te=100);var Ne={transition:"transform ".concat(oe,"ms ease-out")};this.setState({currentSlideOffset:fe*Te,slideStyle:Ne})}}}else G||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(m){var f=m.event,R=m.absX,D=m.absY,$=m.dir,F=this.props,ce=F.stopPropagation,le=F.swipingThumbnailTransitionDuration,pe=this.state,V=pe.thumbsSwipedTranslate,G=pe.thumbnailsWrapperHeight,ee=pe.thumbnailsWrapperWidth,oe=pe.swipingUpDown,fe=pe.swipingLeftRight;if(this.isThumbnailVertical()){if(($===pt||$===De||fe)&&!oe)return void(fe||this.setState({swipingLeftRight:!0}));$!==bt&&$!==rt||oe||this.setState({swipingUpDown:!0})}else{if(($===bt||$===rt||oe)&&!fe)return void(oe||this.setState({swipingUpDown:!0}));$!==pt&&$!==De||fe||this.setState({swipingLeftRight:!0})}var Te,Ne,it,Ze,qe,Pe=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(Te=V+($===rt?D:-D),Ne=Pe.scrollHeight-G+20,it=Math.abs(Te)>Ne,Ze=Te>20,qe=Pe.scrollHeight<=G):(Te=V+($===De?R:-R),Ne=Pe.scrollWidth-ee+20,it=Math.abs(Te)>Ne,Ze=Te>20,qe=Pe.scrollWidth<=ee),!qe&&($!==pt&&$!==bt||!it)&&($!==De&&$!==rt||!Ze)){ce&&f.stopPropagation();var je={transition:"transform ".concat(le,"ms ease-out")};this.setState({thumbsTranslate:Te,thumbsStyle:je})}}},{key:"handleOnThumbnailSwiped",value:function(){var m=this.state.thumbsTranslate,f=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:m,thumbsStyle:{transition:"all ".concat(f,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var m=this.state.currentSlideOffset,f=this.props.swipeThreshold;return Math.abs(m)>f}},{key:"resetSwipingDirection",value:function(){var m=this.state,f=m.swipingUpDown,R=m.swipingLeftRight;f&&this.setState({swipingUpDown:!1}),R&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(m){var f=m.event,R=m.dir,D=m.velocity,$=this.props,F=$.disableSwipe,ce=$.stopPropagation,le=$.flickThreshold;if(!F){var pe=this.props.isRTL;ce&&f.stopPropagation(),this.resetSwipingDirection();var V=(R===pt?1:-1)*(pe?-1:1),G=D>le&&!(R===bt||R===rt);this.handleOnSwipedTo(V,G)}}},{key:"handleOnSwipedTo",value:function(m,f){var R=this.state,D=R.currentIndex,$=R.isTransitioning,F=D;!this.sufficientSwipe()&&!f||$||(F+=m),(m===-1&&!this.canSlideLeft()||m===1&&!this.canSlideRight())&&(F=D),this.unthrottledSlideToIndex(F)}},{key:"handleTouchMove",value:function(m){this.state.swipingLeftRight&&m.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(m){var f=this.props,R=f.disableKeyDown,D=f.useBrowserFullscreen,$=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!R)switch(parseInt(m.keyCode||m.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(m);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(m);break;case 27:$&&!D&&this.exitFullScreen()}}},{key:"handleImageError",value:function(m){var f=this.props.onErrorImageURL;f&&m.target.src.indexOf(f)===-1&&(m.target.src=f)}},{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 m=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(m)))}},{key:"initSlideWrapperResizeObserver",value:function(m){var f=this;m&&!m.current||(this.resizeSlideWrapperObserver=new rn(z(function(R){R&&R.forEach(function(D){f.setState({thumbnailsWrapperWidth:D.contentRect.width},f.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(m.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(m){var f=this;m&&!m.current||(this.resizeThumbnailWrapperObserver=new rn(z(function(R){R&&R.forEach(function(D){f.setState({thumbnailsWrapperHeight:D.contentRect.height},f.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(m.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 m=this.props,f=m.onScreenChange,R=m.useBrowserFullscreen,D=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,$=this.imageGallery.current===D;f&&f($),R&&this.setState({isFullscreen:$})}},{key:"slideToIndex",value:function(m,f){var R=this.state,D=R.currentIndex,$=R.isTransitioning,F=this.props,ce=F.items,le=F.slideDuration,pe=F.onBeforeSlide;if(!$){f&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var V=ce.length-1,G=m;m<0?G=V:m>V&&(G=0),pe&&G!==D&&pe(G),this.setState({previousIndex:D,currentIndex:G,isTransitioning:G!==D,currentSlideOffset:0,slideStyle:{transition:"all ".concat(le,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(m){var f=this.props.isRTL;this.slideTo(m,f?"right":"left")}},{key:"slideRight",value:function(m){var f=this.props.isRTL;this.slideTo(m,f?"left":"right")}},{key:"slideTo",value:function(m,f){var R=this.state,D=R.currentIndex,$=R.isTransitioning,F=this.props.items,ce=D+(f==="left"?-1:1);$||(F.length===2?this.slideToIndexWithStyleReset(ce,m):this.slideToIndex(ce,m))}},{key:"slideToIndexWithStyleReset",value:function(m,f){var R=this,D=this.state,$=D.currentIndex,F=D.currentSlideOffset;this.setState({currentSlideOffset:F+($>m?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return R.slideToIndex(m,f)},25)})}},{key:"handleThumbnailMouseOver",value:function(m,f){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(m,f)}},{key:"handleThumbnailKeyUp",value:function(m,f){Bn(m)&&this.onThumbnailClick(m,f)}},{key:"handleSlideKeyUp",value:function(m){Bn(m)&&(0,this.props.onClick)(m)}},{key:"isThumbnailVertical",value:function(){var m=this.props.thumbnailPosition;return m==="left"||m==="right"}},{key:"addScreenChangeEvent",value:function(){var m=this;Tn.forEach(function(f){document.addEventListener(f,m.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var m=this;Tn.forEach(function(f){document.removeEventListener(f,m.handleScreenChange)})}},{key:"fullScreen",value:function(){var m=this.props.useBrowserFullscreen,f=this.imageGallery.current;m?f.requestFullscreen?f.requestFullscreen():f.msRequestFullscreen?f.msRequestFullscreen():f.mozRequestFullScreen?f.mozRequestFullScreen():f.webkitRequestFullscreen?f.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var m=this.state.isFullscreen,f=this.props.useBrowserFullscreen;m&&(f?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 m=this.props.infinite,f=this.state.currentIndex;m||this.canSlideRight()?this.slideToIndex(f+1):this.pause()}},{key:"play",value:function(){var m=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],f=this.props,R=f.onPlay,D=f.slideInterval,$=f.slideDuration,F=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(D,$)),R&&m&&R(F))}},{key:"pause",value:function(){var m=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],f=this.props.onPause,R=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),f&&m&&f(R))}},{key:"isImageLoaded",value:function(m){return!!this.loadedImages[m.original]||(this.loadedImages[m.original]=!0,!1)}},{key:"handleImageLoaded",value:function(m,f){var R=this.props.onImageLoad;!this.loadedImages[f]&&R&&(this.loadedImages[f]=!0,R(m))}},{key:"renderItem",value:function(m){var f=this.state.isFullscreen,R=this.props.onImageError||this.handleImageError;return s().createElement(C,{description:m.description,fullscreen:m.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:f,onImageError:R,original:m.original,originalAlt:m.originalAlt,originalHeight:m.originalHeight,originalWidth:m.originalWidth,originalTitle:m.originalTitle,sizes:m.sizes,loading:m.loading,srcSet:m.srcSet})}},{key:"renderThumbInner",value:function(m){var f=this.props.onThumbnailError||this.handleImageError;return s().createElement("span",{className:"image-gallery-thumbnail-inner"},s().createElement("img",{className:"image-gallery-thumbnail-image",src:m.thumbnail,height:m.thumbnailHeight,width:m.thumbnailWidth,alt:m.thumbnailAlt,title:m.thumbnailTitle,loading:m.thumbnailLoading,onError:f}),m.thumbnailLabel&&s().createElement("div",{className:"image-gallery-thumbnail-label"},m.thumbnailLabel))}},{key:"render",value:function(){var m=this.state,f=m.currentIndex,R=m.isFullscreen,D=m.modalFullscreen,$=m.isPlaying,F=this.props,ce=F.additionalClass,le=F.disableThumbnailSwipe,pe=F.indexSeparator,V=F.isRTL,G=F.items,ee=F.thumbnailPosition,oe=F.renderFullscreenButton,fe=F.renderCustomControls,Te=F.renderLeftNav,Ne=F.renderRightNav,it=F.showBullets,Ze=F.showFullscreenButton,qe=F.showIndex,Pe=F.showThumbnails,je=F.showNav,Ht=F.showPlayButton,$n=F.renderPlayPauseButton,Un=this.getThumbnailStyle(),Mt=this.getSlideItems(),un=Mt.slides,It=Mt.thumbnails,On=Mt.bullets,Wn=y("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ee),{"image-gallery-rtl":V}),kn=s().createElement("div",{ref:this.imageGallerySlideWrapper,className:Wn},fe&&fe(),this.canSlide()?s().createElement(s().Fragment,null,je&&s().createElement(s().Fragment,null,Te(this.slideLeft,!this.canSlideLeft()),Ne(this.slideRight,!this.canSlideRight())),s().createElement(st,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},s().createElement("div",{className:"image-gallery-slides"},un))):s().createElement("div",{className:"image-gallery-slides"},un),Ht&&$n(this.togglePlay,$),it&&s().createElement("div",{className:"image-gallery-bullets"},s().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},On)),Ze&&oe(this.toggleFullScreen,R),qe&&s().createElement("div",{className:"image-gallery-index"},s().createElement("span",{className:"image-gallery-index-current"},f+1),s().createElement("span",{className:"image-gallery-index-separator"},pe),s().createElement("span",{className:"image-gallery-index-total"},G.length))),zn=y("image-gallery",ce,{"fullscreen-modal":D}),lt=y("image-gallery-content",this.getThumbnailPositionClassName(ee),{fullscreen:R}),Ca=y("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ee),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&V},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!le},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!le});return s().createElement("div",{ref:this.imageGallery,className:zn,"aria-live":"polite"},s().createElement("div",{className:lt},(ee==="bottom"||ee==="right")&&kn,Pe&&It.length>0?s().createElement(st,{className:Ca,delta:0,onSwiping:!le&&this.handleThumbnailSwiping,onSwiped:!le&&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:Un,"aria-label":"Thumbnail Navigation"},It))):null,(ee==="top"||ee==="left")&&kn))}}],E&&rr(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),ye}(s().Component);Ct.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:Fn,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},Ct.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(g,p){return s().createElement(qt,{onClick:g,disabled:p})},renderRightNav:function(g,p){return s().createElement(Tt,{onClick:g,disabled:p})},renderPlayPauseButton:function(g,p){return s().createElement(on,{onClick:g,isPlaying:p})},renderFullscreenButton:function(g,p){return s().createElement(we,{onClick:g,isFullscreen:p})},useWindowKeyDown:!0};const jn=Ct})(),d})())})(ua);var oh=ua.exports;const sh=ii(oh);function ah(){var e=new Map;function t(n){var r=n.root,o=n.rootMargin,u=n.threshold,d=e.get(r);d||(d=new Map,e.set(r,d));var h=JSON.stringify({rootMargin:o,threshold:u}),y=d.get(h);if(!y){var x=new Map,s=new IntersectionObserver(function(a){a.forEach(function(O){var v=x.get(O.target);v==null||v(O)})},{root:r,rootMargin:o,threshold:u});y={observer:s,entryCallbacks:x},d.set(h,y)}return{observe:function(O,v){var S,k;(S=y)==null||S.entryCallbacks.set(O,v),(k=y)==null||k.observer.observe(O)},unobserve:function(O){var v,S;(v=y)==null||v.entryCallbacks.delete(O),(S=y)==null||S.observer.unobserve(O)}}}return{getObserver:t}}var lh="0px",ch=[0],uh=ah();function dh(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:lh,o=(n=e==null?void 0:e.threshold)!=null?n:ch,u=L.useRef(null),d=L.useRef(null),h=L.useRef(null),y=L.useState(),x=y[0],s=y[1],a=L.useCallback(function(){var k=u.current;if(!k){s(void 0);return}var _=uh.getObserver({root:d.current,rootMargin:r,threshold:o});_.observe(k,function(A){s(A)}),h.current=_},[r,o]),O=L.useCallback(function(){var k=h.current,_=u.current;_&&(k==null||k.unobserve(_)),h.current=null},[]),v=L.useCallback(function(k){O(),u.current=k,a()},[a,O]),S=L.useCallback(function(k){O(),d.current=k,a()},[a,O]);return[v,{entry:x,rootRef:S}]}function Jr(){return Jr=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},Jr.apply(this,arguments)}function hh(e){var t,n=dh(e),r=n[0],o=n[1],u=!!((t=o.entry)!=null&&t.isIntersecting),d=L.useState(u),h=d[0],y=d[1];return u&&!h&&y(!0),[r,Jr({},o,{isVisible:u,wasEverVisible:h})]}var ph=100;function fh(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,o=e.rootMargin,u=e.disabled,d=e.delayInMs,h=d===void 0?ph:d,y=hh({rootMargin:o}),x=y[0],s=y[1],a=s.rootRef,O=s.isVisible,v=!u&&!t&&O&&n;return L.useEffect(function(){if(v){var S=setTimeout(function(){r()},h);return function(){clearTimeout(S)}}},[r,v,h]),[x,{rootRef:a}]}const mh={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"/>'},gh={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 Lr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Nr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function da(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 ha(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 vh(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,o=!0,u=0;u<n.length;u++)r.indexOf(n[u])===-1&&(o=!1);return o}var zi={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,"-":Lr?173:189,"=":Lr?61:187,";":Lr?59:186,"'":222,"[":219,"]":221,"\\":220},Jt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Qr={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 ar=1;ar<20;ar++)zi["f".concat(ar)]=111+ar;var Ie=[],_o=!1,pa="all",fa=[],jr=function(t){return zi[t.toLowerCase()]||Jt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ma(e){pa=e||"all"}function Zn(){return pa||"all"}function yh(){return Ie.slice(0)}function bh(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 xh(e){return typeof e=="string"&&(e=jr(e)),Ie.indexOf(e)!==-1}function wh(e,t){var n,r;e||(e=Zn());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++;Zn()===e&&ma(t||"all")}function Eh(e){var t=e.keyCode||e.which||e.charCode,n=Ie.indexOf(t);if(n>=0&&Ie.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ie.splice(0,Ie.length),(t===93||t===224)&&(t=91),t in Ke){Ke[t]=!1;for(var r in Jt)Jt[r]===t&&(dt[r]=!1)}}function Sh(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&&Ar(d)});else if(typeof e=="object")e.key&&Ar(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],u=n[1];typeof o=="function"&&(u=o,o=""),Ar({key:e,scope:o,method:u,splitKey:"+"})}}var Ar=function(t){var n=t.key,r=t.scope,o=t.method,u=t.splitKey,d=u===void 0?"+":u,h=ha(n);h.forEach(function(y){var x=y.split(d),s=x.length,a=x[s-1],O=a==="*"?"*":jr(a);if(Me[O]){r||(r=Zn());var v=s>1?da(Jt,x):[];Me[O]=Me[O].filter(function(S){var k=o?S.method===o:!0;return!(k&&S.scope===r&&vh(S.mods,v))})}})};function Lo(e,t,n,r){if(t.element===r){var o;if(t.scope===n||t.scope==="all"){o=t.mods.length>0;for(var u in Ke)Object.prototype.hasOwnProperty.call(Ke,u)&&(!Ke[u]&&t.mods.indexOf(+u)>-1||Ke[u]&&t.mods.indexOf(+u)===-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 No(e,t){var n=Me["*"],r=e.keyCode||e.which||e.charCode;if(dt.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ie.indexOf(r)===-1&&r!==229&&Ie.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var k=Qr[S];e[S]&&Ie.indexOf(k)===-1?Ie.push(k):!e[S]&&Ie.indexOf(k)>-1?Ie.splice(Ie.indexOf(k),1):S==="metaKey"&&e[S]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(k))))}),r in Ke){Ke[r]=!0;for(var o in Jt)Jt[o]===r&&(dt[o]=!0);if(!n)return}for(var u in Ke)Object.prototype.hasOwnProperty.call(Ke,u)&&(Ke[u]=e[Qr[u]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),Ke[17]=!0,Ke[18]=!0);var d=Zn();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)&&Lo(e,n[h],d,t);if(r in Me){for(var y=0;y<Me[r].length;y++)if((e.type==="keydown"&&Me[r][y].keydown||e.type==="keyup"&&Me[r][y].keyup)&&Me[r][y].key){for(var x=Me[r][y],s=x.splitKey,a=x.key.split(s),O=[],v=0;v<a.length;v++)O.push(jr(a[v]));O.sort().join("")===Ie.sort().join("")&&Lo(e,x,d,t)}}}}function Th(e){return fa.indexOf(e)>-1}function dt(e,t,n){Ie=[];var r=ha(e),o=[],u="all",d=document,h=0,y=!1,x=!0,s="+",a=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(u=t.scope),t.element&&(d=t.element),t.keyup&&(y=t.keyup),t.keydown!==void 0&&(x=t.keydown),t.capture!==void 0&&(a=t.capture),typeof t.splitKey=="string"&&(s=t.splitKey)),typeof t=="string"&&(u=t);h<r.length;h++)e=r[h].split(s),o=[],e.length>1&&(o=da(Jt,e)),e=e[e.length-1],e=e==="*"?"*":jr(e),e in Me||(Me[e]=[]),Me[e].push({keyup:y,keydown:x,scope:u,mods:o,shortcut:r[h],method:n,key:r[h],splitKey:s,element:d});typeof d<"u"&&!Th(d)&&window&&(fa.push(d),Nr(d,"keydown",function(O){No(O,d)},a),_o||(_o=!0,Nr(window,"focus",function(){Ie=[]},a)),Nr(d,"keyup",function(O){No(O,d),Eh(O)},a))}function jh(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 Dr={setScope:ma,getScope:Zn,deleteScope:wh,getPressedKeyCodes:yh,isPressed:xh,filter:bh,trigger:jh,unbind:Sh,keyMap:zi,modifier:Jt,modifierMap:Qr};for(var Mr in Dr)Object.prototype.hasOwnProperty.call(Dr,Mr)&&(dt[Mr]=Dr[Mr]);if(typeof window<"u"){var Oh=window.hotkeys;dt.noConflict=function(e){return e&&window.hotkeys===dt&&(window.hotkeys=Oh),dt},window.hotkeys=dt}dt.filter=function(){return!0};var ga=function(t,n){var r=t.target,o=r&&r.tagName;return!!(o&&n&&n.includes(o))},kh=function(t){return ga(t,["INPUT","TEXTAREA","SELECT"])};function Rh(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var o=n||{},u=o.enableOnTags,d=o.filter,h=o.keyup,y=o.keydown,x=o.filterPreventDefault,s=x===void 0?!0:x,a=o.enabled,O=a===void 0?!0:a,v=o.enableOnContentEditable,S=v===void 0?!1:v,k=L.useRef(null),_=L.useCallback(function(A,Y){var U,J;return d&&!d(A)?!s:kh(A)&&!ga(A,u)||(U=A.target)!=null&&U.isContentEditable&&!S?!0:k.current===null||document.activeElement===k.current||(J=k.current)!=null&&J.contains(document.activeElement)?(t(A,Y),!0):!1},r?[k,u,d].concat(r):[k,u,d]);return L.useEffect(function(){if(!O){dt.unbind(e,_);return}return h&&y!==!0&&(n.keydown=!1),dt(e,n||{},_),function(){return dt.unbind(e,_)}},[_,e,O]),k}dt.isPressed;const va=L.createContext({open:!1,toggleOpen:e=>{}});function Ch({children:e}){const[t,n]=L.useState(!1),r=u=>{n(u??!u)},o=L.useMemo(()=>({open:t,toggleOpen:r}),[t]);return i.jsx(va.Provider,{value:o,children:e})}function qi(){return L.useContext(va)}const mt={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},Ih=e=>nr(async()=>{const{data:t}=await e.get(mt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Ph(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:u}=t;!n.category&&!u&&(n.category="All");const d=h=>{const y={...n,...h};r(Or(y,x=>x===""||x===void 0))};return{filters:e,cleanFilter:h=>{const y=h?Or(n,(x,s)=>h.includes(s)):{};r(Or(y,x=>x===""||x===void 0))},handleActiveMenu:h=>{h!==e.menu&&r({menu:h})},handleSort:(h,y)=>{d({sortBy:h,sortDirection:y||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 _h=(e,t,n)=>e&&t||!n,ya=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ba=(e,t,n)=>{var r,o;const u=Ll(e),d=Nl(u.search);if((r=Al(e,{strict:!0}))!=null&&r.endsWith(".gif"))return d.imageFilter?Dl({...u,search:""}):e;if(d.imageFilter)return e;const h=n||((o=window.blocklet)==null?void 0:o.version),{w:y,h:x}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return ui(e,{...y||x?{imageFilter:"resize",w:y,h:x}:{},v:h})},Lh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Nh=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Ah=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Dh=()=>window.innerWidth<=600,Mh={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}"'}},Fh={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}” 的所有搜索结果"}},Fr={en:ro(Mh),zh:ro(Fh)},xa=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Bh=e=>(t,n)=>{const r=Fr[e]?Fr[e][t]:Fr.en[t];return Ah(r,n)||t},wa={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:()=>{}}},Ea=L.createContext(wa),{Provider:$h,Consumer:hf}=Ea;function Uh(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:o=()=>{},minItemWidth:u=350,queryFilter:d=!0,layout:h={},wrapChildren:y=z=>z,extraFilter:x=z=>z,baseSearch:s=!1,fetchCategoryDelay:a=0,showResourcesSwitch:O=!1,showCategory:v=!0,tagFilters:S=[],children:k,storeVersion:_,onSearchSelect:A=()=>{},endpoint:Y,blockletRender:U}=e,J=xa(r,_),j=L.useMemo(()=>os({baseURL:Y,headers:J}),[Y]),W=Ph(n,{onFilterChange:o,emptyCategory:!h.showExplore,onSearchSelect:A}),[Q,M]=L.useState(""),{data:de=[],error:Z,loading:ae,run:Re}=Ih(j),Fe=L.useMemo(()=>{const z=Pl(de,[se=>se.name],["asc"]),Ce=z.findIndex(se=>se.name==="All"||se.locales.en==="All");return Ce>-1?[{...z[Ce],_id:"All"},...z.slice(0,Ce),...z.slice(Ce+1)]:z},[de]),$e=L.useCallback(Bh(t),[t]),nt=L.useMemo(()=>Nh(Fe,t),[Fe,t]),te=Lh($e),ge={search:W,errors:{fetchCategoriesError:Z},loadings:{fetchCategoriesLoading:ae},extraFilter:x,endpoint:Y,queryFilter:d,layout:{showExplore:h.showExplore??!1,showCategory:h.showCategory??!0,showTitle:h.showTitle??!0,showSearch:h.showSearch??!0},minItemWidth:u,wrapChildren:y,t:$e,storeVersion:_,serverVersion:r,selectedCategory:W.filters.category||(h.showExplore?"":"All"),categoryList:Fe,blockletRender:U,locale:t,categoryOptions:nt,priceOptions:te,storeApi:j,baseSearch:s,showResourcesSwitch:O,showCategory:v,tagFilters:S,onFilterChange:o,getCategoryLocale:z=>{if(!z)return null;const Ce=de.find(se=>se._id===z||se.locales.en==="All");return Ce?Ce.locales[t]||Ce.locales.en:null},get developerName(){return Q},updateDeveloperName:M};return L.useEffect(()=>{setTimeout(Re,a||0)},[Y,Re,a]),i.jsx($h,{value:ge,children:k})}function tt(){return L.useContext(Ea)||wa}function Sa({children:e,onClick:t,size:n=32,...r}){return i.jsx(tr,{...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 lr(e,t){return e===void 0?t:e}function Ki({xs:e,sm:t,md:n,lg:r,xl:o,exact:u}){const d=er(),h=Yt(d.breakpoints.down("sm")),y=Yt(d.breakpoints.between("sm","md")),x=Yt(d.breakpoints.between("md","lg")),s=Yt(d.breakpoints.between("lg","xl"));if(u)return h?e||null:y?t||null:x?n||null:s?r||null:o||null;let a=e;return h||(a=lr(t,a),y)||(a=lr(n,a),x)||(a=lr(r,a),s)?a:lr(o,a)}function Wh({children:e}){const{open:t,toggleOpen:n}=qi();return i.jsx(Ki,{xs:i.jsx(Ua,{open:t,onClose:()=>n(!1),children:e}),md:i.jsx(X,{children:e})})}const zh=L.forwardRef(({loading:e,disabled:t,...n},r)=>i.jsx(tr,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&i.jsx(gt,{size:"1em"})}));function Ta({value:e,options:t,onChange:n,placeholder:r,...o}){var u;const d=L.useRef(null),h=er(),[y,x]=L.useState(!1),[s,a]=L.useState(e!==null?e:""),O=Yt(h.breakpoints.down("sm"));L.useEffect(()=>{a(e!==null?e:"")},[e]);const v=L.useCallback(()=>{x(!1)},[]),S=L.useCallback(()=>{x(!0)},[]);function k(A){a(A.value),n(A.value),O&&v()}function _(A){return A===s}return i.jsxs(i.Fragment,{children:[i.jsxs(qh,{ref:d,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Hn(s)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary",borderRadius:"8px"},...o,children:[((u=t.find(A=>A.value===s))==null?void 0:u.name)||r,i.jsx(Wa,{className:"my-select__arrowdown",component:ca,sx:{width:18,height:18}})]}),i.jsx(za,{open:y,anchorEl:d.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:A,placement:Y})=>i.jsx(qa,{...A,style:{transformOrigin:Y==="bottom"?"center top":"center bottom"},children:i.jsx(Ka,{children:i.jsx(Va,{onClickAway:v,children:i.jsx(Kh,{autoFocusItem:y,onMouseEnter:S,onMouseLeave:v,children:t.map(U=>i.jsxs(ri,{onClick:()=>k(U),sx:{fontSize:14},children:[i.jsx(as,{sx:{mr:1,fontSize:16,visibility:_(U.value)?"visible":"hidden"}}),U.name]},U.value))})})})})})]})}const qh=Qt(zh)`
486
+ border: 1px solid #f0f0f0;
487
+ padding: 6px 8px 6px 12px;
488
+ font-weight: ${e=>e.theme.typography.fontWeightRegular};
489
+ font-size: 14px;
490
+ color: #666;
491
+ line-height: 1;
492
+ text-transform: none;
493
+ & + & {
494
+ margin-left: 10px;
495
+ }
496
+ &.my-select__selector--active {
497
+ &,
498
+ .my-select__arrowdown,
499
+ }
500
+ .my-select__arrowdown {
501
+ color: #999;
502
+ font-size: 14px;
503
+ margin-left: 6px;
504
+ }
505
+ .my-select__icon {
506
+ font-size: 0;
507
+ svg {
508
+ color: #999;
509
+ font-size: 18px;
510
+ margin-right: 3px;
511
+ }
512
+ }
513
+ `,Kh=Qt(Qo)`
514
+ .my-select__option__icon {
515
+ color: transparent;
516
+ font-size: 14px;
517
+ margin: 0 3px 0 -5px;
518
+ }
519
+ .my-select__option {
520
+ font-size: 14px;
521
+ color: #999;
522
+ }
523
+ .my-select__option--active {
524
+ &,
525
+ .my-select__option__icon {
526
+ color: ${e=>e.theme.palette.primary.main};
527
+ }
528
+ }
529
+ `;function ja(){const{search:e,t}=tt(),{filters:n,handleSort:r,handlePrice:o}=e,u=ya(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(ti,{control:i.jsx(ni,{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(Ta,{value:n.sortBy||u[0].value,options:u,onChange:d=>r(d),placeholder:t("sort.sort")})]})}function Vh({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:o,loadings:u,layout:d,baseSearch:h}=tt(),{filters:y,handleActiveMenu:x,handleCategory:s,cleanFilter:a}=n,{toggleOpen:O}=qi();L.useEffect(()=>{O(!1)},[Object.values(y).join("")]);const v=_h(h,d.showSearch,y.keyword);return d.showCategory?i.jsxs(Wh,{children:[i.jsx(Ki,{xs:i.jsxs(et,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[i.jsx(Sa,{onClick:()=>O(!1),children:i.jsx(ci,{})}),i.jsx(be,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),i.jsx(et,{visibility:u.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:v?i.jsxs(i.Fragment,{children:[d.showExplore&&i.jsxs(X,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[i.jsxs(X,{display:"flex",alignItems:"center",gap:1,children:[i.jsx(ot,{icon:th,width:20,height:20}),i.jsx(be,{variant:"body1",color:!t&&!y.menu?"text.primary":"text.lighter",fontWeight:!t&&!y.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{O(!1),a()},children:r("explore.title")})]}),e==null?void 0:e.map(S=>i.jsxs(X,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?i.jsx(ot,{icon:S.icon,width:20,height:20}):S.icon,i.jsx(be,{variant:"body1",color:y.menu===S.key?"text.primary":"text.lighter",fontWeight:y.menu===S.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var k;O(!1),x(S.key),(k=S.onClick)==null||k.call(S)},children:S.title})]},S.key))]}),!!o.length&&i.jsx(et,{gap:2,children:o.map(S=>i.jsx(be,{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(ja,{})})]}):null}function Vi(){const{endpoint:e,serverVersion:t,storeVersion:n}=tt(),r=xa(t,n),o=L.useMemo(()=>os({baseURL:e,headers:r}),[e]);return{get:async u=>{const{data:d}=await o.get(u);return d},post:async(u,d)=>{const{data:h}=await o.post(u,d);return h}}}const Oa=L.memo(function(e){return i.jsx(X,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:i.jsx(gt,{})})});function Ao({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(be,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Gh=16/9,Br=292,Zr=189,mr=336;function Hh(){var e,t;const{t:n,search:r}=tt(),{get:o}=Vi(),u=er(),d=Yt(u.breakpoints.down("md")),h=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:y=[],error:x,loading:s}=nr(async()=>{const A=await o(ui(mt.blockletsPath,{didList:h.map(Y=>Y.did).join(",")}));return A!=null&&A.dataList?h.map(Y=>A.dataList.find(U=>U.did===Y.did)):[]});x&&console.error("Get Banner Blocklets error:",x);const a={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!x&&h.length>0?i.jsxs(i.Fragment,{children:[i.jsx(be,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),i.jsx(X,{height:{xs:"auto",md:Br},minHeight:Br,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:s?i.jsxs(X,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[i.jsx(Xt,{variant:"rounded",height:Zr,width:mr}),i.jsxs(X,{flex:1,height:"100%",children:[i.jsx(Xt,{variant:"text",height:50,width:100}),i.jsx(Xt,{variant:"text",height:40,width:"100%"}),i.jsx(Xt,{variant:"text",height:40,width:300}),i.jsxs(X,{display:"flex",gap:1,my:2,children:[i.jsx(Xt,{variant:"circular",height:20,width:20}),i.jsx(Xt,{variant:"text",height:20,width:50})]}),i.jsx(Xt,{variant:"rounded",height:30,width:100})]})]}):i.jsx(sh,{showNav:!0,autoPlay:!0,slideDuration:d?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:A=>i.jsx(X,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(hc,{sx:{...a,left:5}})}),renderRightNav:A=>i.jsx(X,{onClick:A,sx:{display:{xs:"none",md:"block"}},children:i.jsx(pc,{sx:{...a,right:5}})}),items:h.map((A,Y)=>({original:A.did,renderItem:()=>{var U;const J=y[Y]||{},j=A.cover||Yh(A.did,(U=J.screenshots)==null?void 0:U[0]),W=ba(j,u.breakpoints.values.md*2);return i.jsxs(et,{height:{xs:"auto",md:Br},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(J),gap:{xs:2,md:5},children:[O(W),i.jsxs(et,{flex:1,height:"100%",gap:3,children:[i.jsxs(X,{flex:1,children:[v(A.name||J.title||A.name),S(A.desc||J.description)]}),J.did&&k(J,A.baseNum),_(J)]})]})}}))})})]}):null;function O(A){return i.jsx(X,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:mr},children:i.jsx(Jh,{url:A})})}function v(A){return i.jsx(be,{variant:"h2",width:"100%",children:A})}function S(A){return i.jsx(be,{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 k(A,Y=0){const{did:U,owner:J,stats:j}=A;return i.jsxs(X,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[i.jsx(Ao,{icon:i.jsx(pr,{src:J.avatar,did:U,size:20,variant:"circle"}),children:J.fullName}),i.jsx(Ao,{icon:i.jsx(ot,{icon:la}),title:`${j.downloads+Y}`,children:Xh(j.downloads+Y)})]})}function _(A){return i.jsx(tr,{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 Xh=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`,Yh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Jh({url:e}){const[t,n]=L.useState(!0);return i.jsxs(i.Fragment,{children:[t&&i.jsx(Xt,{variant:"rectangular",sx:{width:{xs:"100%",md:mr},height:{xs:"auto",md:Zr}}}),i.jsx(X,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:mr},height:{xs:"auto",md:Zr},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Gh},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Qh({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=tt();return i.jsxs(X,{mt:3,children:[i.jsx(be,{component:"h3",variant:"h3",sx:{mb:2},children:e}),i.jsx(Qi,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(o=>i.jsx(Qi,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":o.did,children:i.jsx(X,{padding:"1px",children:n({blocklet:o,blocklets:t,serverVersion:r})})},o.did))})]})}function Zh(){const{get:e}=Vi(),{t}=tt(),{data:n=[],error:r,loading:o}=nr(async()=>{const u=await e(mt.explorePath);return Array.isArray(u)?u:[]});return r?i.jsx(yr,{error:new Error(`Failed to fetch blocklets from ${mt.explorePath}`)}):o?i.jsx(Oa,{mt:15}):i.jsxs(i.Fragment,{children:[i.jsx(Hh,{}),n.map(u=>{var d;return((d=u.blocklets)==null?void 0:d.length)>0?i.jsx(Qh,{title:t(`explore.${u.type}`),blocklets:u.blocklets},u.type):null})]})}const $r="__FREE_TEXT__",Do="__NO_RESULT__",Ur=40;function ep({endpoint:e,t,locale:n,filters:r,handleKeyword:o,handleSearchSelect:u,...d}){const h=L.useRef(null),y=L.useRef(!1),[x,s]=L.useState(!1),[a,O]=L.useState(""),[v,S]=L.useState(!1),k=Vi(),[_,A]=L.useState(!1),Y=(d==null?void 0:d.placeholder)||t("common.searchStore"),U=async te=>{A(!0);const ge=await k.get(Jn(e,ui(mt.blockletsPath,te)));return A(!1),ge.dataList||[]},{data:J,run:j}=nr(te=>te?U({sortBy:mt.nameDesc,page:1,pageSize:10,keyword:te,showResources:"true"}):Promise.resolve([]),{manual:!0});L.useEffect(()=>{A(!0),j(r.keyword),O(r.keyword||"")},[r.keyword,j]),Rh("ctrl + k, command + k",te=>{var ge,z;return te.stopPropagation(),te.preventDefault(),(z=(ge=h.current)==null?void 0:ge.querySelector("input"))==null||z.focus(),!1},{enableOnTags:["INPUT"]});const W=hs(te=>j(te),{wait:300}),Q={name:$r,title:a,did:""};let M=[];return a&&(_?M=[Q]:J!=null&&J.length?M=[Q,...J]:M=[{name:Do,title:t("blocklet.noResults"),did:""}]),i.jsxs(i.Fragment,{children:[i.jsxs(Ga,{fullScreen:!0,open:v,sx:{display:{md:"none"}},children:[i.jsxs(X,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[i.jsx(Zo,{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:Y,className:"bl-autocomplete-input",value:a,onChange:te=>de(te.target.value),startAdornment:$e(v),endAdornment:nt()}),i.jsx(tr,{variant:"outlined",onClick:()=>{S(!1),O(r.keyword||"")},children:t("common.cancel")})]}),i.jsx(Qo,{sx:{p:.5},children:M.map(te=>Re(te))})]}),i.jsx(dr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),i.jsx(Ko,{ref:h,open:!!a&&x,size:"small",onOpen:()=>s(!0),onClose:(te,ge)=>{s(!1),ge==="selectOption"&&!y.current&&o(a)},onKeyDown:te=>{te.key==="Enter"&&!a&&Z()},disableClearable:!0,inputValue:a,onInputChange:(te,ge)=>de(ge),isOptionEqualToValue:(te,ge)=>te.name===ge.name,getOptionLabel:te=>te.title,getOptionKey:te=>te.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:te=>i.jsx(gr,{...te,InputProps:{...te.InputProps,autoFocus:!0,placeholder:Y,className:"bl-autocomplete-input",value:a,startAdornment:$e(x),endAdornment:nt()}}),filterOptions:te=>te,...d,options:M,renderOption:(te,ge)=>Re(ge),value:Q,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 de(te){A(!0),O(te),y.current=!1,W.run(te)}function Z(){S(!1),O(""),de(""),o("")}function ae(te){te!=null&&te.did?(S(!1),y.current=!0,O(""),u(te)):te.name===$r&&(S(!1),o(a))}function Re(te){var ge,z;return i.jsxs(ri,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ae(te),children:[Fe(te),i.jsxs(be,{variant:"body1",children:[i.jsx(be,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:te.title}),i.jsx(be,{sx:{color:"text.lighter"},fontSize:"13px",children:((z=(ge=te.category)==null?void 0:ge.locales)==null?void 0:z[n||"en"])||""})]})]},te.did)}function Fe(te){if([$r,Do].includes(te.name))return i.jsx(X,{width:Ur,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:i.jsx(dr,{sx:{fontSize:28}})});let ge="";return te.logo&&(ge=Jn(e,"assets",te.did,ba(te.logo,Ur,te.version))),i.jsx(pr,{src:ge,size:Ur,style:{borderRadius:"8px",overflow:"hidden"}})}function $e(te=!0){return i.jsx(X,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:te&&a&&_?i.jsx(gt,{color:"inherit",size:16}):i.jsx(dr,{sx:{fontSize:16,cursor:"default"}})})}function nt(){return a?i.jsx(X,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:i.jsx(ci,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>Z()})}):null}}function tp({placeholder:e="Type to search...",...t}){const{search:n}=tt(),{filters:r,handleKeyword:o}=n,[u,d]=L.useState(r.keyword||""),h=hs(o,{wait:300}),y=s=>{const{value:a}=s.target;d(a),h.run(a)},x=()=>{d(""),o("")};return L.useEffect(()=>{d(r.keyword||"")},[r.keyword]),i.jsx(np,{inputProps:{"data-cy":"search-blocklet"},startAdornment:i.jsx(eo,{position:"start",children:i.jsx(rp,{})}),onChange:y,placeholder:e,value:u,title:e,"data-cy":"search",endAdornment:u&&i.jsx(eo,{position:"end",children:i.jsx(ip,{"data-cy":"search-delete",onClick:x})}),...t})}const np=Qt(Zo)`
530
+ background-color: ${e=>e.theme.palette.grey[50]};
531
+ font-size: 14px;
532
+ border-radius: 6px;
533
+ width: 100%;
534
+ .MuiInputBase-input {
535
+ padding: 8px 0 8px 10px;
536
+ }
537
+ .MuiOutlinedInput-notchedOutline {
538
+ border: none;
539
+ }
540
+ .Mui-focused {
541
+ background-color: #f6f6f6;
542
+ .MuiInputBase-input::placeholder {
543
+ color: transparent;
544
+ }
545
+ }
546
+ `,rp=Qt(dr)`
547
+ color: ${e=>e.theme.palette.grey[500]};
548
+ font-size: 28px;
549
+ @media (max-width: ${e=>e.theme.breakpoints.values.md}px) {
550
+ font-size: 24px;
551
+ }
552
+ `,ip=Qt(ci)`
553
+ color: ${e=>e.theme.palette.grey[500]};
554
+ font-size: 16px;
555
+ cursor: pointer;
556
+ `;function op(){const{search:e,t,endpoint:n,locale:r,getCategoryLocale:o,developerName:u,showResourcesSwitch:d,layout:h,baseSearch:y}=tt(),{filters:x,handleSort:s,handlePrice:a,handleDeveloper:O,handleSwitchShowResources:v,cleanFilter:S}=e,k=ya(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(be,{variant:"h2",textTransform:"capitalize",children:o(x.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(X,{flex:1,children:y?i.jsx(tp,{}):i.jsx(ep,{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,x.owner&&u&&i.jsx(Zi,{label:t("blocklet.authorTag",{name:u}),size:"small",onDelete:()=>O("")}),x.resourceDid&&x.resourceBlocklet&&i.jsx(Zi,{label:t("blocklet.resourceTag",{name:x.resourceBlocklet}),size:"small",onDelete:()=>S(["resourceDid","resourceBlocklet","showResources"])}),d?i.jsx(Mo,{checked:x.showResources!=="false",onChange:_=>v(_?"true":"false"),label:t("common.showResources")}):null,i.jsx(Mo,{checked:x.price==="free",onChange:_=>a(_?"free":""),label:t("blocklet.free")}),i.jsx(Ta,{value:x.sortBy||k[0].value,options:k,placeholder:t("sort.sort"),onChange:_=>s(_)})]})]})}function Mo({checked:e,onChange:t,label:n}){return i.jsx(ti,{sx:{m:0,p:0},className:"check-button",control:i.jsx(ni,{checked:e,icon:i.jsx(ot,{style:{padding:0},icon:mh}),checkedIcon:i.jsx(ot,{style:{padding:0,color:"#3478E2"},icon:gh}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function cr({children:e}){return i.jsxs(X,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[i.jsx(cl,{}),e]})}function Fo(){const{t:e}=tt();return i.jsx(be,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Wr({filterTip:e,keywordTip:t}){const{t:n,locale:r}=tt(),o=()=>r==="zh"?"、":" , ";return i.jsxs(X,{mt:1,display:"flex",children:[i.jsx(be,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&i.jsx(be,{children:n("blocklet.filterTip")}),e&&t&&o(),t&&i.jsx(be,{children:n("blocklet.keywordTip")})]})}function zr({primaryStart:e,primaryEnd:t,filter:n}){return i.jsxs(be,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[i.jsx(be,{children:e}),i.jsx(be,{color:"primary",children:n}),i.jsxs(be,{children:[t," "]})]})}function sp(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=tt(),{filters:o}=t,u=!!r||!!o.price;if(o.keyword&&u)return i.jsxs(cr,{children:[i.jsx(zr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Wr,{keywordTip:!0,filterTip:!0})]});if(o.keyword)return i.jsxs(cr,{children:[i.jsx(zr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:o.keyword}),i.jsx(Wr,{keywordTip:!0})]});if(u){const d=n(r);return i.jsxs(cr,{children:[d?i.jsx(zr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:d}):i.jsx(Fo,{}),i.jsx(Wr,{filterTip:!0})]})}return i.jsx(cr,{children:i.jsx(Fo,{})})}const ap=(e,t,n,r)=>Jl(async o=>{o||(n.currentPage=n.defaultCurrentPage);const{currentPage:u,pageSize:d}=n,h={...t,category:t.category==="All"?"":t.category,sortBy:mt[t.sortBy],page:u,pageSize:d};r(null);const{data:y={}}=await e.get(mt.blockletsPath,{params:h});return n.currentPage++,{page:u,pageSize:d,list:(y==null?void 0:y.dataList)||[],total:(y==null?void 0:y.total)||0}},{isNoMore:o=>o?o.page*o.pageSize>=o.total:!1,reloadDeps:[e,ul(t)],onError:r});function lp(){var e;const{storeApi:t,search:n,extraFilter:r,errors:o,updateDeveloperName:u}=tt(),{filters:d}=n,h=Yl({currentPage:mt.currentPage,pageSize:Dh()?mt.mobilePageSize:mt.pageSize,defaultCurrentPage:mt.defaultCurrentPage}),[y,x]=L.useState(null),s=ap(t,d,h,x),a=L.useMemo(()=>{var O,v;return r?r(((O=s.data)==null?void 0:O.list)||[]):((v=s.data)==null?void 0:v.list)||[]},[s.data,r]);return L.useEffect(()=>{const O=a.find(v=>v.owner.did===d.owner);u((O==null?void 0:O.owner.fullName)||(O==null?void 0:O.author.name)||"")},[d.owner,a,u]),{blocklets:a,fetchBlockletsError:y,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:y}}}function cp(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:o,minItemWidth:u,layout:d,baseSearch:h}=tt(),{filters:y}=t,{blocklets:x,errors:s,loadMore:a,loadings:O,hasNextPage:v,total:S}=lp(),[k]=fh({loading:O.fetchBlockletsLoading||O.loadingMore,hasNextPage:v,onLoadMore:a});if(s.fetchBlockletsError){const U=new Error(`Failed to fetch blocklets from ${n}: ${s.fetchBlockletsError.message}`);return i.jsx(yr,{error:U})}const _=h&&d.showSearch||!y.keyword;return i.jsxs(i.Fragment,{children:[_?i.jsx(op,{}):i.jsxs(i.Fragment,{children:[i.jsx(Ki,{xs:i.jsx(ja,{}),md:null}),Y()]}),A(),!O.fetchBlockletsLoading&&v&&i.jsx(X,{height:60,display:"flex",justifyContent:"center",py:2,ref:k,children:i.jsx(gt,{})})]});function A(){return O.fetchBlockletsLoading?i.jsx(Oa,{mt:15}):x.length?i.jsx(X,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${u}px, 1fr))`},p:"2px",gap:2,children:x.map(U=>i.jsx(X,{"data-blocklet-did":U.did,minWidth:{xs:"100%",sm:u},maxWidth:"calc(100vw - 32px)",children:r({blocklet:U,blocklets:x,serverVersion:o})},U.did))}):i.jsx(sp,{})}function Y(){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(be,{variant:"h3",children:e("blocklet.search",{keyword:y.keyword})}),i.jsx(be,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:S})})]})}}function up(){const{t:e,selectedCategory:t,getCategoryLocale:n}=tt(),{toggleOpen:r}=qi();return i.jsxs(be,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[i.jsx(Sa,{onClick:()=>r(!0),children:i.jsx(ll,{})}),n(t)||e("common.category")]})}function dp({menus:e,children:t}){var n;const{search:r,layout:o}=tt(),{filters:u}=r,d=u.category||u.keyword||u.price,h=(n=e==null?void 0:e.find(y=>y.key===u.menu))==null?void 0:n.key;return i.jsx(Ch,{children:i.jsxs(ss,{FallbackComponent:yr,children:[i.jsx(up,{}),i.jsxs(X,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[i.jsx(Vh,{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(Zh,{}):i.jsx(cp,{}))]})]})]})})}function hp(e){const{menus:t,children:n,...r}=e,o=er(),u=Yo(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(Jo,{theme:u,children:i.jsx(Uh,{...r,children:i.jsx(dp,{menus:t,children:n})})})}const pp={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>'},fp=pp;var Gi={},mp=ei;Object.defineProperty(Gi,"__esModule",{value:!0});var ka=Gi.default=void 0,gp=mp(si()),vp=i;ka=Gi.default=(0,gp.default)((0,vp.jsx)("path",{d:"M16 18v2H8v-2zM11 7.99V16h2V7.99h3L12 4 8 7.99z"}),"Upgrade");const yp=(e,t)=>!t||!e?!0:Kr.satisfies(Kr.coerce(e),t);function Hi({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:o}=vt();return yp(t,n)?e:i.jsx(Xo,{title:o("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:i.jsx(be,{children:i.jsx(tr,{disabled:!0,variant:"outlined",...r,children:o("common.upgradeServer")})})})}Hi.propTypes={children:P.node.isRequired,serverVersion:P.string,requirementVersion:P.string};Hi.defaultProps={serverVersion:"",requirementVersion:""};const Gn=getComputedStyle(document.documentElement),bp=Yo({palette:{primary:{main:"#1DC1C7",contrastText:"#fff"},secondary:{main:"#030712",contrastText:"#fff"},storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:Gn.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:Gn.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:Gn.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:Gn.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:Gn.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}}}),xp=(e,t)=>Jn(t,`/blocklets/${e.did}`),Bo=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,wp=e=>e.inStore&&$t.isFreeBlocklet(e)===!1;function Xi({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:o}){var A,Y;const{t:u}=vt();let d=Jn(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,y]=L.useState(!1),x=U=>U.currentTarget.contains(U.target)?!0:(U.preventDefault(),!1),s=async U=>{U.preventDefault(),U.stopPropagation();try{y(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(J){li.error(J.message)}finally{y(!1)}},{blocklet:a}=br(),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(J=>J.meta.bundleDid===e.did);if(U){try{const J=U.meta.version,j=e.version;if(Kr.gt(j,J))return"upgrade"}catch{return"install"}return"disable"}return"install"})();let k=u("blocklet.component.choose");S==="upgrade"?k=u("blocklet.component.upgrade"):S==="disable"?k=u("blocklet.component.installed"):wp(e)&&(k=u("common.purchase"));const _=(A=e.requirements)==null?void 0:A.server;return i.jsx(Ha,{href:xp(e,r),style:{color:"initial",textDecoration:"none"},onClick:x,target:"_blank",children:i.jsx(Ep,{title:Bo({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Bo({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?d:"",version:e.version,onButtonClick:null,icons:(Y=e.docker)!=null&&Y.image?[{key:"docker",icon:i.jsx(X,{display:"flex",color:"primary.main",children:i.jsx(ot,{icon:fp})}),title:u("blocklet.dockerImage")}]:[],button:i.jsx(Hi,{serverVersion:o,requirementVersion:_,size:"small",children:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:i.jsx(Qd,{children:i.jsxs(ut,{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(gt,{size:16,style:{marginRight:3}}),k]}):k,S==="upgrade"?i.jsx(ka,{style:{fontSize:"1.2rem"}}):null]},e.did)})})})})})}Xi.propTypes={blocklet:P.object.isRequired,blocklets:P.array,handleButtonClick:P.func,endpoint:P.string,serverVersion:P.string};Xi.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function Yi({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:o,serverVersion:u,resourceType:d,resourceDid:h,showResourcesSwitch:y,showCategory:x,...s}){const{locale:a}=vt(),[O,v]=L.useState(!1),[S,k]=L.useState({}),_=Y=>{k(Y)},A=n;return L.useEffect(()=>{k({showResources:!0,resourceType:d,resourceDid:h})},[A,d,h]),L.useEffect(()=>{v(!0),k({showResources:!0,resourceType:d,resourceDid:h})},[]),i.jsx(Jo,{theme:bp,children:i.jsx(ss,{FallbackComponent:yr,resetKeys:[A],children:i.jsxs(X,{...s,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(s.sx)?s.sx:[s.sx]],children:[O&&i.jsx(hp,{showCategory:x,showResourcesSwitch:y,blockletRender:Y=>{const U={...Y,handleButtonClick:e,endpoint:A};return r({...Y,defaultRender:i.jsx(Xi,{...U})})},baseSearch:!0,endpoint:A,locale:a,onFilterChange:_,onSearchSelect:t,filters:S,extraFilter:o,serverVersion:u,fetchCategoryDelay:500}),i.jsx(X,{sx:{mt:2},children:" "})]})})})}Yi.propTypes={storeUrl:P.string.isRequired,handleButtonClick:P.func,handleSearchSelect:P.func,handleBlockletRender:P.func,extraFilter:P.func,serverVersion:P.string,resourceType:P.string,resourceDid:P.string,showResourcesSwitch:P.bool,showCategory:P.bool};Yi.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0};const Ep=Ve(eh)`
557
+ .ms-highlight {
558
+ color: ${e=>e.theme.palette.primary.main};
559
+ }
560
+ `,Ji=L.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const{steps:o,activeStep:u,setActiveStepByKey:d,setActiveStepByIndex:h}=dl(),{t:y,locale:x}=vt(),s=o[u];return L.useEffect(()=>{n(u)},[n,u]),L.useImperativeHandle(r,()=>({setActiveStepByKey:d,setActiveStepByIndex:h})),i.jsx(Tp,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:i.jsx(hl,{locale:x,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:y("blocklet.component.add"),children:i.jsx(Sp,{children:typeof(s==null?void 0:s.body)=="function"?s.body():s==null?void 0:s.body})})})});Ji.propTypes={meta:P.any,onStepChange:P.func.isRequired,isMobile:P.bool.isRequired};Ji.defaultProps={meta:null};const $o=e=>e.isMobile?`
561
+ height: calc(100vh - 56px - 64px - 48px);
562
+ `:"",Sp=Ve.div`
563
+ width: 100%;
564
+ height: 100%;
565
+ display: flex;
566
+ flex-direction: column;
567
+ justify-content: flex-start;
568
+ align-items: flex-start;
569
+
570
+ .bottom-button {
571
+ min-width: 200px;
572
+ }
573
+
574
+ // blocklet-select-side
575
+ aside {
576
+ width: 140px;
577
+ }
578
+ `,Tp=Ve(X)`
579
+ ${({className:e})=>e==="mobileStyle"?`
580
+ & > div{
581
+ height: 100%;
582
+ }
583
+ .root-header {
584
+ .app-name-content {
585
+ display: none;
586
+ }
587
+ }
588
+
589
+ // content-panel
590
+ .root-header + div{
591
+ padding-top: 0;
592
+ position: relative;
593
+ & > div {
594
+ padding-top: 0;
595
+ }
596
+ }
597
+
598
+ header + div {
599
+ padding-top: 0;
600
+ }
601
+
602
+ header {
603
+ .header-title {
604
+ margin-left: 0;
605
+ }
606
+
607
+ .header-title-name {
608
+ max-width: 100% !important;
609
+ }
610
+ }
611
+ .app-content {
612
+ padding: 0!important;
613
+ }
614
+ `:`
615
+ position: relative;
616
+ .ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
617
+ width: 100%;
618
+ height: 100%;
619
+ }
620
+
621
+ .root-header {
622
+ z-index: auto !important;
623
+ position: fixed !important;
624
+ }
625
+ & > div {
626
+ height: 100%;
627
+ width: 100%;
628
+ max-width: 100%;
629
+ & > div {
630
+ max-height: unset !important;
631
+ max-width: 100%;
632
+ & > div {
633
+ // left-panel
634
+ &:first-child {
635
+ padding: 0;
636
+ width: 20%;
637
+ min-width: 180px;
638
+
639
+ & > div:first-child {
640
+ display: none;
641
+ }
642
+ // step
643
+ & > div:last-child {
644
+ // margin-top: 32px;
645
+ margin-top: 0;
646
+ }
647
+ }
648
+ // right-panel
649
+ &:last-child {
650
+ padding-top: 0;
651
+ padding-right: 0px;
652
+ overflow-y: hidden;
653
+ .app-content {
654
+ padding: 0 0 24px 0;
655
+ }
656
+ .button-container {
657
+ padding-right: 0;
658
+ }
659
+ }
660
+ }
661
+ }
662
+ }
663
+
664
+ `}
665
+
666
+ & .app-overview {
667
+ margin-left: 0 !important;
668
+ }
669
+
670
+ & .flex-justify-center {
671
+ display: flex;
672
+ justify-content: center;
673
+ }
674
+
675
+ & .flex-align-center {
676
+ display: flex;
677
+ height: 100%;
678
+ align-items: center;
679
+ ${e=>$o(e)}
680
+ }
681
+
682
+ & .agreement-wrapper {
683
+ ${e=>$o(e)}
684
+ max-height: 60vh;
685
+ .eula-trigger {
686
+ padding-right: 0;
687
+ }
688
+ .next-button {
689
+ display: none;
690
+ }
691
+ }
692
+
693
+ & .connect {
694
+ background: white;
695
+ }
696
+ `,jp=Ji,Op=e=>e.inStore&&$t.isFreeBlocklet(e)===!1,kp=e=>{var t;return[_t.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,_t.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},qr=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===_t.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Rp=e=>(e.environments||[]).some(t=>t.required),Uo=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Cp=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(u=>u.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},Wo=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Ra({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:o,storageKey:u,inDialog:d,selectedMeta:h,storeUrl:y,showResourcesSwitch:x,showFromUrl:s,enableRunBackground:a,showCategory:O}){var l,b,w,C,N,K,H,me,he,Je;const{t:v,locale:S}=vt(),[k,_]=L.useState(!1),[A,Y]=L.useState(null),[U,J]=L.useState(""),[j,W]=L.useState(""),{api:Q,ws:{useSubscription:M},inService:de,info:Z}=_n(),{blocklet:ae,actions:{refreshBlocklet:Re}}=br(),[Fe,$e]=L.useState(null),[nt,te]=L.useState(!1),ge={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[z,Ce]=L.useState(ge),[se,ht]=L.useState(0),Oe=L.useRef({}),He=L.useRef({}),We=L.useRef({}),Nt=Yt(q=>q.breakpoints.down("md")),Zt=Qa(),[Ut,en]=L.useState(!0),{meta:_e}=Oe.current,Le=vs(_e),Xe=L.useRef(!1),[xe,yt]=L.useState(null),{confirmApi:Nn,confirmHolder:An}=pl(),ve=q=>Ce(ne=>({...ne,...q}));L.useEffect(()=>{if(z.pathPrefix){const{errMsg:q}=zt({...z,pathPrefix:z.pathPrefix,locale:S});J(q)}},[z.pathPrefix]),L.useEffect(()=>{se===0&&Ce(ge)},[se]);const Dn=()=>{const q=qr(ae)??"";ve({didSpaceEndpoint:q})},tn=()=>{var q;return(q=Oe==null?void 0:Oe.current)!=null&&q.meta?$t.getDisplayName(Oe.current):""},nn=()=>{_(!1),Ce({}),yt(null),Xe.current=!1,Oe.current={},e()},Wt=q=>{const ne=ue=>{ve({installResultProps:{variant:"error",title:tn(),subTitle:q,footer:i.jsx(ut,{className:"bottom-button",disabled:ue,"data-cy":"retry-install-component",onClick:async()=>{ne(!0),await xt(Oe.current.installInput)},children:i.jsxs(X,{display:"flex",alignItems:"center",children:[ue&&i.jsx(gt,{size:16,style:{marginRight:8}}),v("common.retry")]})})}})};ne()},At=q=>ne=>{var ue,we;(((ue=ne==null?void 0:ne.meta)==null?void 0:ue.did)||(ne==null?void 0:ne.meta))===((we=ae==null?void 0:ae.meta)==null?void 0:we.did)&&q(ne)},rn=()=>{Wo({timeout:0,componentDid:Zt.componentDid,manual:!0}),nn(),setTimeout(()=>{const q=document.getElementsByClassName("dashboard-main")[0];q&&(q.scrollTop=q.scrollHeight)},200)},pt=()=>{xe?rn():Nn.open({title:v("common.noticeTitle"),content:v("blocklet.component.startTip"),confirmButtonText:v("common.confirm"),onConfirm:rn,showCancelButton:!1})};M(_t.BlockletEvents.componentInstalled,At(q=>{ve({installResultProps:{variant:"success",title:tn(),subTitle:v("blocklet.component.installSuccessTip")}}),yt(q.componentDids),Wo({componentDid:Zt.componentDid})}),[(l=ae==null?void 0:ae.meta)==null?void 0:l.did]),M(_t.BlockletEvents.statusChange,At(()=>{const q=qr(ae);ve(ne=>({...ne,didSpaceEndpoint:q}))}),[(b=ae==null?void 0:ae.meta)==null?void 0:b.did]),M(_t.BlockletEvents.downloadFailed,At(()=>{Xe.current=!1,yt([]),Wt(v("blocklet.component.installComponentError"))}),[(w=ae==null?void 0:ae.meta)==null?void 0:w.did]),M(_t.BlockletEvents.installFailed,At(()=>{Xe.current=!1,yt([]),Wt(v("blocklet.component.installComponentError"))}),[(C=ae==null?void 0:ae.meta)==null?void 0:C.did]);const De=[],bt=q=>((ae==null?void 0:ae.children)||[]).find(ne=>ne.meta.did===q),rt=()=>{Q.startBlocklet({input:{did:ae.meta.did,componentDids:xe}}),pt()},xt=async q=>{var Vt,Dt;Xe.current=!0,yt(null);const{pathPrefix:ne,bundleDid:ue,title:we,componentName:Et="",componentDid:qt=""}=z,St=((Vt=Oe.current)==null?void 0:Vt.meta)||{},{configs:Tt=[],registryUrl:ft,inStore:on,inputUrl:jt,dist:sn}=St,Kt=(Dt=Oe.current)==null?void 0:Dt.downloadTokenList,Qe=jt||(on?io(ft,ue,sn):"");_(!0);const wn={rootDid:ae.meta.did,url:Qe,mountPoint:ne?or(ne):`/${or(St.title||St.name)}`,title:we,name:Et,did:qt,onlyRequired:!Ut,...z.hasEnvironmentsStep&&Tt.length>0?{configs:Tt.map(st=>({...st,value:z.configsValue[st.key]||""}))}:{},...Kt?{downloadTokenList:Kt}:{},...q};try{if(await Q.installComponent({input:wn}),ft){const{teamDid:st,storeList:at}=ls({fromBlocklet:de,nodeInfo:Z,blocklet:ae}),{isNew:En,decoded:an}=kl(ft,at);En&&await Q.addBlockletStore({input:{teamDid:st,url:an}})}ve({installResultProps:{}}),Re({showError:!1,attachRuntimeInfo:!1})}catch(st){const at=fs(st);li.error(at),console.error("installComponent error: ",st),Wt(at)}finally{_(!1),Oe.current.installInput=wn}},zt=q=>{const ne=oc({params:{...q,did:q.bundleDid},blocklets:[ae],blocklet:ae,locale:S});if(ne){const ue=bt(q.bundleDid),we=sc({params:{...q,did:q.bundleDid},blocklet:ae});if(ue&&ue.mountPoint===we)return{errMsg:""}}return{errMsg:ne}},Ye=async q=>{var ue,we;const{errMsg:ne}=zt({...z,locale:S});J(ne),se===De.length-2&&!Xe.current&&await xt(q),(we=(ue=He.current)==null?void 0:ue.setActiveStepByIndex)==null||we.call(ue,Et=>Et+1)},Rt=()=>{var q,ne;(ne=(q=He.current)==null?void 0:q.setActiveStepByIndex)==null||ne.call(q,ue=>ue-1)},bn=()=>{const{pathPrefix:q,bundleDid:ne,title:ue,componentName:we="",componentDid:Et=""}=z,{meta:qt={}}=Oe.current||{},{registryUrl:St,inStore:Tt,inputUrl:ft,dist:on}=qt,jt=Tt?io(St,ne,on):ft;$e({meta:qt,installOpts:{type:"component",rootDid:ae.meta.did,mountPoint:q,url:jt,title:ue,name:we,did:Et}})},Mn=q=>{te(!1),ve({purchaseResultProps:{variant:"error",title:tn(),subTitle:q,style:{paddingTop:120},footer:i.jsx(ut,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{ve({purchaseResultProps:{}})},children:v("common.retry")})}})},I=({downloadTokenList:q})=>{Oe.current.downloadTokenList=q,te(!1),Ye()},wt=({chooseParams:q=Oe.current,componentDid:ne,isInit:ue=!1})=>{var an,rr,Sn,ir;const{meta:we,registryUrl:Et,inStore:qt,inputUrl:St}=q,{did:Tt,title:ft,name:on}=we,jt=(((an=ae.settings)==null?void 0:an.children)||[]).filter(Ee=>Ee.status==="deleted"&&Ee.meta.bundleDid===Tt),sn=ne||"",Kt=(rr=we.environments)==null?void 0:rr.map(Ee=>{const{name:Gt,validation:ln,...cn}=Ee,Tn={validation:Fl(ln)?"":ln};return{...cn,key:Gt,...Tn}});Oe.current={...q,meta:{...we,configs:Kt,registryUrl:Et,inStore:qt,inputUrl:St}};let Qe={};if(ue){const Ee=[ae],Gt=Kt||[],ln=[],cn=us(Ml([...Gt,...ln]),"key").filter(Ct=>!!Ct.key).sort((Ct,jn)=>Ct.required&&!jn.required?-1:jn.required&&!Ct.required?1:0),Tn=$t.getSharedConfigObj(Ee[0],{configs:cn}),Fn={},Bn=cn.map(Ct=>{const{default:jn,key:g,...p}=Ct;return Fn[g]=Tn[g]||jn,{...p,key:g,hidden:!!_t.BLOCKLET_CONFIGURABLE_KEY[g]}});Qe={...Qe,configsList:Bn,configsValue:Fn,hasMissRequiredConfigs:Uo(Bn,Fn)}}const wn=ae.children.some(Ee=>Ee.mountPoint==="/"),Vt=jt.find(Ee=>Ee.meta.bundleDid===Tt),Dt=ae.children.find(Ee=>Ee.meta.bundleDid===Tt);Qe.title=ft||"",Vt?Qe={...Qe,pathPrefix:Vt.mountPoint||"",componentName:Vt.meta.name,hasEnvironmentsStep:!1}:Dt?Qe={...Qe,pathPrefix:Dt.mountPoint||"",componentName:Dt.meta.name,hasEnvironmentsStep:!1}:Qe={...Qe,pathPrefix:wn?`/${or(ft)||or(on)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((ir=(Sn=Oe.current.meta)==null?void 0:Sn.environments)==null?void 0:ir.length)>0};const st=Op(Oe.current.meta),at=kp(Oe.current.meta),En=qr(ae);ve({bundleDid:Tt,componentDid:sn,...Qe,hasRequiredEnvironments:Rp(Oe.current.meta),requirePurchase:st,didSpaceIsRequiredSetup:at,didSpaceEndpoint:En}),ue&&st&&bn()};L.useEffect(()=>{!h||se!==0||!ae||(wt({chooseParams:{blocklets:[h],meta:h,registryUrl:y||h.homepage,inStore:!0},isInit:!0}),ve({showFromUrlDialog:!1}),Ye())},[h,se,ae]),De.push({key:"selectComponent",name:v("blocklet.component.selectComponent"),body:i.jsxs(dn,{sx:{width:400},component:"div",children:[s&&z.showFromUrlDialog&&i.jsx(Di,{mode:"component",onCancel:()=>{ve({showFromUrlDialog:!1})},onSuccess:({meta:q,inputUrl:ne,inStore:ue,registryUrl:we})=>{wt({chooseParams:{meta:q,inputUrl:ne,inStore:ue,registryUrl:we},isInit:!0}),ve({showFromUrlDialog:!1}),Ye()},handleText:{title:v("blocklet.component.addComponentTip.fromUrl"),confirm:v("blocklet.component.choose")}}),i.jsx(Ui,{stores:n,extra:ts.isInServerlessMode(Z)?null:s?i.jsxs(ut,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{ve({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[i.jsx(gs,{style:{fontSize:20,marginRight:4}})," ",v("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:k,onChange:()=>{Ce({}),Oe.current={}},storageKey:u,children:({currentRegistry:q})=>i.jsx(Yi,{showResourcesSwitch:x,showCategory:O,serverVersion:Z==null?void 0:Z.version,style:Nt?{height:"calc(100vh - 56px - 80px - 32px - 10px )"}:{height:"calc(100% - 10px)"},storeUrl:q.url,resourceType:r,resourceDid:o,handleButtonClick:ne=>{wt({chooseParams:{...ne,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:ne,defaultRender:ue})=>{const we=(z==null?void 0:z.bundleDid)&&(z==null?void 0:z.bundleDid)===(ne==null?void 0:ne.did);return i.jsxs(Pp,{children:[we&&i.jsx("div",{className:"check-container",children:i.jsx(as,{className:"check-icon"})}),i.jsx("div",{className:we?"choose-blocklet":"",style:{marginLeft:16},children:ue})]})}})})]}),cancel:t==="embed"?void 0:v("common.cancel"),confirm:Cp({params:z,blocklet:ae,t:v}),onCancel:nn,onConfirm:()=>{Ye()}}),De.push({key:"agreement",name:v("launchBlocklet.introduction"),body:i.jsxs(dn,{component:"div",className:"agreement-wrapper",children:[i.jsx(cs,{title:v("launchBlocklet.introduction"),subTitle:v("blocklet.component.addComponentTip.introduction")}),i.jsx(yi,{meta:_e,onClickNext:Ye,installRelated:Ut,onChangeInstallRelated:en,handleDescEle:i.jsx("p",{children:v("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:h?void 0:v("common.pre"),disabled:!Le,confirm:v(Le?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:h?nn:Rt,onConfirm:()=>{te(!1),Ye()}}),_e&&z.requirePurchase&&De.push({key:"purchase",name:i.jsxs(i.Fragment,{children:[v("common.verifyNFT"),i.jsx(kr,{})]}),body:i.jsxs(dn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((K=(N=We.current)==null?void 0:N.getCurrentStep)==null?void 0:K.call(N))===2||nt)&&i.jsx(ur,{title:v("common.verifyNFT"),subTitle:v("blocklet.component.addComponentTip.verifyNFT")}),Hn(z.purchaseResultProps)?Fe&&i.jsx(Vd,{ref:We,meta:Fe.meta,mode:z.componentDid?"verify":"both",onCancel:Mn,installOpts:Fe.installOpts,handlePaySuccess:I}):i.jsx("div",{className:"flex-align-center flex-justify-center",children:i.jsx(oo,{...z.purchaseResultProps})})]}),disabled:((me=(H=We.current)==null?void 0:H.getCurrentStep)==null?void 0:me.call(H))===2||nt,cancel:v("common.pre"),confirm:v("common.next"),onConfirm:()=>{typeof We.current.onNext=="function"&&(We.current.onNext(),te(!0))},onCancel:()=>{Rt()}}),$t.hasStartEngine(_e)&&jl.hasMountPoint(_e)?De.push({key:"config",name:v("common.config"),error:U,body:i.jsxs(dn,{component:"div",children:[i.jsx(ur,{title:v("common.config"),subTitle:v("blocklet.component.addComponentTip.config")}),i.jsx(gr,{label:v("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:j||v("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:z.pathPrefix,onChange:q=>{const ne=q.target.value;ve({pathPrefix:ne}),W(v("common.slugifyHint",{value:Ol(ne)}))}}),!!U&&i.jsx(Ho,{severity:"error",style:{width:"100%",marginTop:8},children:U})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Rt,onConfirm:()=>{Ye()}}):_e&&(z.pathPrefix=((Je=(he=_e.interfaces)==null?void 0:he[0])==null?void 0:Je.path)||`/${_e.did}`),_e&&(z!=null&&z.hasEnvironmentsStep)&&De.push({key:"environment",name:i.jsxs(i.Fragment,{children:[v("common.environment")," ",z.hasRequiredEnvironments&&i.jsx(kr,{})]}),disabled:!!A||(z==null?void 0:z.hasMissRequiredConfigs),body:()=>i.jsxs(dn,{component:"div",style:{overflowY:"auto"},children:[i.jsx(ur,{title:v("common.environment"),subTitle:v("blocklet.component.addComponentTip.environment")}),i.jsx(Ul,{style:{marginTop:-12,width:"100%"},schema:z.configsList,defaultValue:z.configsValue,onChange:(q,{action:ne,currentItem:ue,allValues:we})=>{ne==="confirm"&&ve({hasMissRequiredConfigs:Uo(z.configsList,we),configsValue:we}),ne==="edit"?Y(ue):["cancel","confirm"].includes(ne)&&Y(null)}})]}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Rt,onConfirm:Ye}),_e&&(z!=null&&z.didSpaceIsRequiredSetup)&&De.push({key:"didSpace",name:i.jsxs(i.Fragment,{children:[v("blocklet.component.didSpaceConfig")," ",z.didSpaceIsRequiredSetup==="required"&&i.jsx(kr,{})]}),disabled:(z==null?void 0:z.didSpaceIsRequiredSetup)&&!z.didSpaceEndpoint,body:()=>i.jsx($l,{children:i.jsxs(dn,{component:"div",children:[i.jsx(ur,{title:v("blocklet.component.didSpaceConfig"),subTitle:v("blocklet.component.didSpaceConfigTip")}),i.jsx(X,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:i.jsx($i,{blockletMeta:Oe.current.meta,onNext:()=>{Ye()},onEndpointUpdate:Dn})})]})}),cancel:v("common.pre"),confirm:v("common.next"),onCancel:Rt,onConfirm:Ye}),De.push({key:"install",name:bt(_e==null?void 0:_e.did)?v("common.upgrade"):v("common.install"),disabled:a?!1:Hn(z.installResultProps),loading:a?!1:Hn(z.installResultProps),body:i.jsx(dn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Hn(z.installResultProps)?i.jsx(fl,{message:i.jsx(_p,{children:v(a?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):i.jsx("div",{style:{marginTop:120},children:i.jsx(oo,{...z.installResultProps})})}),cancel:xe?v("common.complete"):void 0,onCancel:pt,confirm:v(xe?"common.start":"common.complete"),onConfirm:xe?rt:pt});const ze=De[se]||{},xn=()=>k||ze.error||!z.bundleDid?!0:se>1?!z.pathPrefix:!1;return ae?i.jsxs(Ip,{sx:{width:"100%",height:Nt?window.innerHeight:d?"72vh":"100vh"},children:[i.jsx(ml,{steps:De,mode:"memory",children:i.jsx(jp,{ref:He,meta:_e,isMobile:Nt,onStepChange:q=>{ht(q)}})}),i.jsxs(X,{className:"action-bar",children:[ze.cancel&&i.jsx(ut,{onClick:q=>{q.stopPropagation(),ze.onCancel()},disabled:se===De.length-2&&k,color:"inherit",children:ze.cancel||v("common.cancel")}),ze.confirm&&i.jsx(ut,{onClick:q=>{q.stopPropagation(),ze.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:k||(typeof ze.disabled=="boolean"?ze.disabled:xn()),variant:"contained",autoFocus:!0,title:ze.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:i.jsxs(X,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof ze.loading=="boolean"?ze.loading:k)&&i.jsx(gt,{style:{marginRight:8},size:16}),i.jsx(X,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ze.confirm})]})}),An]})]}):null}Ra.propTypes={onClose:P.func,mode:P.oneOf(["normal","embed"]),inDialog:P.bool,stores:P.arrayOf(P.string),storeUrl:P.string,resourceType:P.string,resourceDid:P.string,storageKey:P.string,selectedMeta:P.object,showResourcesSwitch:P.bool,showFromUrl:P.bool,enableRunBackground:P.bool,showCategory:P.bool};Ra.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Ip=Ve(X)`
697
+ .action-bar {
698
+ display: flex;
699
+ justify-content: flex-end;
700
+ position: sticky;
701
+ bottom: 0;
702
+ padding-top: 16px;
703
+ z-index: 100;
704
+ width: 100%;
705
+ background: #fff;
706
+ border-top: 1px solid #eee;
707
+ }
708
+ `,dn=Ve(be)`
709
+ width: 100%;
710
+ height: 100%;
711
+ `,ur=Ve(cs)`
712
+ margin-bottom: 24px;
713
+ `,Pp=Ve.div`
714
+ position: relative;
715
+
716
+ .choose-blocklet {
717
+ background-color: rgb(236, 251, 253);
718
+ border-color: rgb(236, 251, 253);
719
+ border-radius: 8px;
720
+ }
721
+
722
+ .check-container {
723
+ position: absolute;
724
+ right: 0;
725
+ bottom: 0;
726
+ display: flex;
727
+ justify-content: flex-end;
728
+ align-items: flex-end;
729
+ width: 30px;
730
+ height: 30px;
731
+ border-radius: 0 0 8px 0;
732
+ color: ${e=>e.theme.palette.common.white};
733
+ overflow: hidden;
734
+ transition: all ease 0.3s;
735
+ &:after {
736
+ position: absolute;
737
+ z-index: 0;
738
+ display: block;
739
+ width: 0;
740
+ height: 0;
741
+ border-top: transparent solid 15px;
742
+ border-left: transparent solid 15px;
743
+ border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
744
+ border-right: ${e=>e.theme.palette.primary.main} solid 15px;
745
+ transition: all ease 0.1s;
746
+ content: '';
747
+ }
748
+
749
+ .check-icon {
750
+ position: relative;
751
+ z-index: 2;
752
+ margin: 0 1px 1px 0;
753
+ font-size: 16px;
754
+ transition: all ease 0.2s;
755
+ }
756
+ }
757
+ `,_p=Ve.div`
758
+ color: ${e=>e.theme.palette.primary.main};
759
+ .msg-before {
760
+ display: inline-block;
761
+ color: #aaa;
762
+ font-size: 14px;
763
+ margin-right: 6px;
764
+ }
765
+ `;export{Ra as A,oa as B,df as S,cf as a,uf as b,fp as c,gs as d,Ts as f};