@abtnode/blocklet-services 1.16.43-beta-20250420-132156-d732158a → 1.16.43-beta-20250422-042711-c40bec75

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 (215) hide show
  1. package/api/services/auth/connect/gen-access-key.js +9 -2
  2. package/api/services/auth/session.js +7 -4
  3. package/dist/assets/{AdapterDayjs-Bq_2AanQ.js → AdapterDayjs-DcprbhsV.js} +1 -1
  4. package/dist/assets/{ArrowDropDown-CnO3M65x.js → ArrowDropDown-BHNhtNqo.js} +1 -1
  5. package/dist/assets/{CheckCircle-vHBx3yBd.js → CheckCircle-C7lAzkFm.js} +1 -1
  6. package/dist/assets/{ChevronLeft-J2DjxamT.js → ChevronLeft-fcaEvvT2.js} +1 -1
  7. package/dist/assets/{ChevronRight-CbbryV_W.js → ChevronRight-BWcj-otI.js} +1 -1
  8. package/dist/assets/{Community-eISlOOkV.js → Community-BXFIKoZW.js} +1 -1
  9. package/dist/assets/{DeleteOutline-D3rMfe5l.js → DeleteOutline-CMgoFNHT.js} +1 -1
  10. package/dist/assets/{Done-BKjm-wNl.js → Done-CkkNExgL.js} +1 -1
  11. package/dist/assets/{Download-dWBmoIIz.js → Download-B1KcU2Zd.js} +1 -1
  12. package/dist/assets/{Edit-BsIdXKZ9.js → Edit-C-ChSGAK.js} +1 -1
  13. package/dist/assets/{EditIcon-CQgpOLLT.js → EditIcon-BRKobKzh.js} +1 -1
  14. package/dist/assets/{Email-BWTg6iJI.js → Email-7cDhevM1.js} +1 -1
  15. package/dist/assets/{Error-BhDI-TWw.js → Error-Du9QXuYs.js} +1 -1
  16. package/dist/assets/{ExpandLess-ap4H2881.js → ExpandLess-Cdn0T-U2.js} +1 -1
  17. package/dist/assets/{Google-yY5m8tgo.js → Google-3Ox3gIL3.js} +1 -1
  18. package/dist/assets/{Holiday-C3bRTVlx.js → Holiday-BtexoPxk.js} +1 -1
  19. package/dist/assets/{InfoOutlined-xdatqyfu.js → InfoOutlined-ZIQMeu0p.js} +1 -1
  20. package/dist/assets/{Launch-C6_9RwNa.js → Launch-qJWNGQwX.js} +1 -1
  21. package/dist/assets/{LaunchOutlined-CG63jbPx.js → LaunchOutlined-BVUDVgft.js} +1 -1
  22. package/dist/assets/LoadingButton-D_tuQuaP.js +1 -0
  23. package/dist/assets/{Location-C_mUMqZP.js → Location-BF9BwrVf.js} +1 -1
  24. package/dist/assets/{LockIcon-G8zLxYzV.js → LockIcon-L5QI4AoC.js} +1 -1
  25. package/dist/assets/{Meeting-vvmUKHs1.js → Meeting-gc3Ts6jN.js} +1 -1
  26. package/dist/assets/{MoreHoriz-ylsvAqcI.js → MoreHoriz-ByNTWUxY.js} +1 -1
  27. package/dist/assets/{OffSick-BTxtVws3.js → OffSick-_EZgqU01.js} +1 -1
  28. package/dist/assets/{Phone-Cz_yY8ed.js → Phone-oJLFEdfI.js} +1 -1
  29. package/dist/assets/{PlayArrow-B-b0Dvp8.js → PlayArrow-rSzT1Thf.js} +1 -1
  30. package/dist/assets/{QuestionMarkCircle-DeAbZuzW.js → QuestionMarkCircle-Cw7EtCDd.js} +1 -1
  31. package/dist/assets/{ServerLogo-UZVUmHWK.js → ServerLogo-zdbLsMaw.js} +1 -1
  32. package/dist/assets/{Timezone-5RxC7sK-.js → Timezone-BtCtoEo9.js} +1 -1
  33. package/dist/assets/{TuneOutlined-DJ2Nw9gU.js → TuneOutlined-BnxAi8kP.js} +1 -1
  34. package/dist/assets/{ViewList-DYqpQSjn.js → ViewList-DbzNMeex.js} +1 -1
  35. package/dist/assets/{WorkingRemotely-_QD8QN72.js → WorkingRemotely-YBya8rZT.js} +1 -1
  36. package/dist/assets/{access-control-DcIGjdcM.js → access-control-q2DA79L8.js} +1 -1
  37. package/dist/assets/actions-J8MFA_6y.js +1 -0
  38. package/dist/assets/{add-component-core-BpT5fbHq.js → add-component-core-IYRc9eac.js} +24 -24
  39. package/dist/assets/{add-resource-BVgzn5lM.js → add-resource-8w2aCwfA.js} +1 -1
  40. package/dist/assets/{addon-DXuj5GtV.js → addon-BQEpbqTR.js} +1 -1
  41. package/dist/assets/{advanced-CIJNFJAE.js → advanced-CX8tZItX.js} +1 -1
  42. package/dist/assets/api-BrU7j0QA.js +1 -0
  43. package/dist/assets/{appearance-CCLVRyLq.js → appearance-C5895lZP.js} +1 -1
  44. package/dist/assets/{audit-logs-brXiMrw_.js → audit-logs-DukS3LSM.js} +3 -3
  45. package/dist/assets/authorize-CEHLfOxJ.js +1 -0
  46. package/dist/assets/{base32-Dd6rPCV6.js → base32--dljmFCF.js} +1 -1
  47. package/dist/assets/{branding-31ZnkyoG.js → branding-Abk6CVlX.js} +1 -1
  48. package/dist/assets/branding-Cczews7F.js +40 -0
  49. package/dist/assets/bundle-avatar-DFwyxj9P.js +1 -0
  50. package/dist/assets/button-CJk6Iiza.js +1 -0
  51. package/dist/assets/click-to-copy-CbKZyfyr.js +1 -0
  52. package/dist/assets/cloneDeep-SfcdeqEN.js +1 -0
  53. package/dist/assets/{complete-Cpcoq6Ge.js → complete-ejUOC1cY.js} +2 -2
  54. package/dist/assets/{component-Djsamap6.js → component-BOLQzzEI.js} +2 -2
  55. package/dist/assets/{config-BK2qWQnO.js → config-Bv0DcfgY.js} +2 -2
  56. package/dist/assets/{config-BQ9p6EgE.js → config-efFznM9P.js} +1 -1
  57. package/dist/assets/{config-navigation-D2PpiTzz.js → config-navigation-1cuUaRsL.js} +6 -6
  58. package/dist/assets/{config-space-BFcXXNuJ.js → config-space-DEku2tJv.js} +1 -1
  59. package/dist/assets/confirm-miQS3Z1c.js +7 -0
  60. package/dist/assets/connect-0B3z_kZV.js +5 -0
  61. package/dist/assets/{connect-rWOVXBvz.js → connect-OYujfpaQ.js} +1 -1
  62. package/dist/assets/connect-to-C-vFK0ym.js +1 -0
  63. package/dist/assets/{content-layout-Cg5RRv1R.js → content-layout-JixQ7owc.js} +1 -1
  64. package/dist/assets/dashboard-C9tAGBV0.js +280 -0
  65. package/dist/assets/{delete-confirm-B2Ye1_SC.js → delete-confirm-kKb8VxbQ.js} +1 -1
  66. package/dist/assets/{did-address-gmPYOGuy.js → did-address-DNf_-NM-.js} +1 -1
  67. package/dist/assets/domain-RAN90v9n.js +9 -0
  68. package/dist/assets/domain-action-card-BNybk5kq.js +25 -0
  69. package/dist/assets/domains-B51g2OQM.js +1 -0
  70. package/dist/assets/dot-xwsgXXMo.js +7 -0
  71. package/dist/assets/{email-BAajjNQV.js → email-CBFKGDtB.js} +3 -3
  72. package/dist/assets/{empty-spinner-yzHJfTIe.js → empty-spinner-Rr_2DR73.js} +1 -1
  73. package/dist/assets/{exchange-passport-EldPKAEU.js → exchange-passport-2U7cUaM-.js} +1 -1
  74. package/dist/assets/{format-error-LAoTjvJe.js → format-error-BrmqJs5a.js} +1 -1
  75. package/dist/assets/{fuel-g6aTZdFA.js → fuel-Ctl6kh4M.js} +1 -1
  76. package/dist/assets/{gen-access-key-CXCl8SEM.js → gen-access-key-CIrRotRy.js} +2 -2
  77. package/dist/assets/{get-safe-url-BpQyWsMx.js → get-safe-url-BXaepgsm.js} +1 -1
  78. package/dist/assets/{get-safe-url-DGJYpGp-.js → get-safe-url-MZ-ksvtD.js} +1 -1
  79. package/dist/assets/{home-DBeMBDeM.js → home-C2Bgs4zS.js} +1 -1
  80. package/dist/assets/{iframe-DTWkOiY8.js → iframe-oHkt22fl.js} +1 -1
  81. package/dist/assets/{index-Bh63LaOx.js → index-51ncOoae.js} +2 -2
  82. package/dist/assets/{index-BY0gjHeR.js → index-B1-S-x6B.js} +32 -32
  83. package/dist/assets/{index-D7Oq5q89.js → index-B1EwWGHW.js} +4 -4
  84. package/dist/assets/index-B1ljmpu4.css +1 -0
  85. package/dist/assets/{index-C9TPKuLt.js → index-BRXM9-_y.js} +1 -1
  86. package/dist/assets/{index-C8lvmI4i.js → index-BT3gX_Gs.js} +1 -1
  87. package/dist/assets/{index-Cg_v1vT_.js → index-BWx6ivvZ.js} +650 -55
  88. package/dist/assets/{index-lk2RMFv-.js → index-BaU0U5xc.js} +10 -10
  89. package/dist/assets/index-BiIKWZTs.js +113 -0
  90. package/dist/assets/{index-B0Z8409R.js → index-C3XAI9I7.js} +1 -1
  91. package/dist/assets/{index-C6wFIF6L.js → index-C7UL-KG1.js} +2 -2
  92. package/dist/assets/{index-BGnWzg98.js → index-CILVFQJH.js} +4 -4
  93. package/dist/assets/{index-B1r8E4TH.js → index-CNpN35y4.js} +1 -1
  94. package/dist/assets/{index-pV_0wOyY.js → index-CPE8Apzb.js} +1 -1
  95. package/dist/assets/{index-haYY8BAk.js → index-CYeIiQ6Q.js} +1 -1
  96. package/dist/assets/index-CzzLOOSx.js +55 -0
  97. package/dist/assets/{index-BkHi7e8i.js → index-DGPhY8xp.js} +2 -2
  98. package/dist/assets/{index-DhAVA9HZ.js → index-DHdYd4nT.js} +3 -3
  99. package/dist/assets/index-DHjPgdgK.js +1 -0
  100. package/dist/assets/{index-CEMXycV7.js → index-DQc29-JM.js} +1 -1
  101. package/dist/assets/{index-tUQxVYYQ.js → index-DVQCgvFb.js} +1 -1
  102. package/dist/assets/{index-CgtY16Wm.js → index-DhGZEbPZ.js} +1 -1
  103. package/dist/assets/index-Ds7z-vG7.js +10 -0
  104. package/dist/assets/{index-BfbxxLBr.js → index-GJgyTjK2.js} +9 -9
  105. package/dist/assets/{index-Xi3jaVFs.js → index-Hl4sXXdc.js} +1 -1
  106. package/dist/assets/{index-BjmnM2sd.js → index-ILkKQT7G.js} +1 -1
  107. package/dist/assets/{index-kqlC8JFQ.js → index-YbJjfDTR.js} +1 -1
  108. package/dist/assets/{index-KWGv7rf_.js → index-qcSTfn8X.js} +2 -2
  109. package/dist/assets/{invitation-DnZ_Ex8p.js → invitation-CPSru_8S.js} +5 -5
  110. package/dist/assets/invite-DquuAqEb.js +1 -0
  111. package/dist/assets/issue-passport-DW27M9Fi.js +1 -0
  112. package/dist/assets/{item-VCJ7-Z3r.js → item-CdEFLc19.js} +1 -1
  113. package/dist/assets/{landing-page-QhzHIr--.js → landing-page-DPD1zNWJ.js} +1 -1
  114. package/dist/assets/{launch-result-message-Ckk5lRW7.js → launch-result-message-yorrVgpQ.js} +1 -1
  115. package/dist/assets/{layout-0YBKzIlI.js → layout-DBsOgAhr.js} +1 -1
  116. package/dist/assets/{list-Dw9DDKoC.js → list-BNd4p4TF.js} +9 -8
  117. package/dist/assets/{list-header-BYlc5SI1.js → list-header-BTUducS9.js} +1 -1
  118. package/dist/assets/localization-CS7BsCef.js +1 -0
  119. package/dist/assets/{log-BLTzXOlE.js → log-R8TIkchf.js} +1 -1
  120. package/dist/assets/logger-d2Lh_KCF.js +1 -0
  121. package/dist/assets/{login-tmff27IK.js → login-Dgvm6HMJ.js} +1 -1
  122. package/dist/assets/{login-oauth-callback-DnYvzeVx.js → login-oauth-callback-rmUYgE44.js} +1 -1
  123. package/dist/assets/logo-uploader-Bv2ZSxJV.js +133 -0
  124. package/dist/assets/{lost-passport-DiKkPtUB.js → lost-passport-CiVM9B2L.js} +4 -4
  125. package/dist/assets/{lottie-react.esm-CPHH620R.js → lottie-react.esm-D2t-u0YU.js} +1 -1
  126. package/dist/assets/{lottie-web-B6s7dDoL.js → lottie-web-jYmAQWuC.js} +1 -1
  127. package/dist/assets/omit-bLid3PKQ.js +1 -0
  128. package/dist/assets/{open-window-DjL5TW3X.js → open-window-D2wkW326.js} +1 -1
  129. package/dist/assets/{overview-zOWtcWbm.js → overview-C_fDcPQA.js} +2 -2
  130. package/dist/assets/{page-header-BhpaMk9g.js → page-header-C86YQnHE.js} +1 -1
  131. package/dist/assets/{passport-item-Cxkhzo-W.js → passport-item-C4X2VZeo.js} +1 -1
  132. package/dist/assets/{permission-_ttLx53e.js → permission-CbDCh9eS.js} +1 -1
  133. package/dist/assets/preferences-Cdzon7pe.js +1 -0
  134. package/dist/assets/profile-embed-Dr2ZxkvM.js +1 -0
  135. package/dist/assets/publish-resource-DumHfLtC.js +1 -0
  136. package/dist/assets/{raf-schd.esm-GV-XhwE0.js → raf-schd.esm-B3j6BePR.js} +1 -1
  137. package/dist/assets/{react-beautiful-dnd.esm-gUY08qHq.js → react-beautiful-dnd.esm-kcYalw4r.js} +1 -1
  138. package/dist/assets/{relative-time-DYjTOclf.js → relative-time-Dkz5qmEb.js} +1 -1
  139. package/dist/assets/runtime-HBzWjxDb.js +1 -0
  140. package/dist/assets/sdk-DuZx5LYY.js +1 -0
  141. package/dist/assets/{security-BD2-azah.js → security-BFBpBlQy.js} +4 -4
  142. package/dist/assets/session-CdQbSkeB.js +1 -0
  143. package/dist/assets/setup-BSfklNq4.js +19 -0
  144. package/dist/assets/{shorten-label-8jfEkawx.js → shorten-label-Dz7RgJfj.js} +1 -1
  145. package/dist/assets/{simple-select-CNZc1N7Q.js → simple-select-BlUQXxNL.js} +1 -1
  146. package/dist/assets/{slicedToArray-gyBkcGHe.js → slicedToArray-lOWXD6Th.js} +1 -1
  147. package/dist/assets/{spaces-B_YG3iE7.js → spaces-CcTi9vap.js} +1 -1
  148. package/dist/assets/{start-DIhK4VNY.js → start-BitVK7fH.js} +1 -1
  149. package/dist/assets/{status-CQCKGmiV.js → status-F7OR8ZWk.js} +1 -1
  150. package/dist/assets/{step-actions-DGcZdY1e.js → step-actions-Cmh5n2jE.js} +1 -1
  151. package/dist/assets/{studio-CC8lU96f.js → studio-CW2bLcBh.js} +1 -1
  152. package/dist/assets/{switch-control-BWuo2NQH.js → switch-control-BjOmRKBW.js} +1 -1
  153. package/dist/assets/{traffic-BIz-TYy2.js → traffic-CcfffSvS.js} +2 -2
  154. package/dist/assets/{transfer-OroSS_fF.js → transfer-DHcMO-R4.js} +1 -1
  155. package/dist/assets/{unsubscribe-cKpP6HeV.js → unsubscribe-DnPmucfC.js} +1 -1
  156. package/dist/assets/{use-app-logo-C5KrAQp3.js → use-app-logo-DnfizCGM.js} +1 -1
  157. package/dist/assets/{use-mobile-BbxjRR_q.js → use-mobile-Bgy7gTTP.js} +1 -1
  158. package/dist/assets/{use-mobile-T-9_nK_m.js → use-mobile-CcdVxg80.js} +1 -1
  159. package/dist/assets/useAsync-70zHrUMr.js +1 -0
  160. package/dist/assets/useAsync-BquSRC77.js +1 -0
  161. package/dist/assets/{useLocalStorage-BTc2ONSy.js → useLocalStorage-BJb7uGDO.js} +1 -1
  162. package/dist/assets/{useSetState-BL3ktMon.js → useSetState-CWq0AVWn.js} +1 -1
  163. package/dist/assets/user-center-u43jJYr4.js +77 -0
  164. package/dist/assets/{util-DA84MxE0.js → util-BYLEVYA_.js} +1 -1
  165. package/dist/assets/{util-Dvapjz4O.js → util-CJbxj6IE.js} +1 -1
  166. package/dist/assets/{vendor-arcblock-Dd-d3bxC.js → vendor-arcblock-CWji6U03.js} +300 -300
  167. package/dist/assets/{vendor-hooks-jg6xPUPF.js → vendor-hooks-DftG_2gV.js} +2 -2
  168. package/dist/assets/{vendor-mui-core-DiDsSLd-.js → vendor-mui-core-CfA4EdRA.js} +26 -26
  169. package/dist/assets/{vendor-mui-x-mVhD3N7n.js → vendor-mui-x-DSNWmGVo.js} +1 -1
  170. package/dist/assets/{vendor-react-DoD83n6N.js → vendor-react-DEoibe3W.js} +1 -1
  171. package/dist/assets/vendor-utils-BNHJB5U7.js +208 -0
  172. package/dist/assets/vendor-ux-did-connect-zBIy2ulO.js +2265 -0
  173. package/dist/assets/{wrap-locale-CyEJqSC4.js → wrap-locale-BSYWBgCo.js} +1 -1
  174. package/dist/assets/zh-_GYrLCB8.js +1 -0
  175. package/dist/index.html +9 -8
  176. package/dist/service-worker.js +1 -1
  177. package/package.json +30 -29
  178. package/dist/assets/actions-54wIQrhQ.js +0 -1
  179. package/dist/assets/api-DwjKcjK8.js +0 -1
  180. package/dist/assets/authorize-DVVvHvmA.js +0 -1
  181. package/dist/assets/branding-CY0aknSo.js +0 -40
  182. package/dist/assets/bundle-avatar-BcZExfqu.js +0 -1
  183. package/dist/assets/button-Cfb46ee0.js +0 -1
  184. package/dist/assets/click-to-copy-D4Cmyemb.js +0 -1
  185. package/dist/assets/cloneDeep-DUYD8ZBI.js +0 -1
  186. package/dist/assets/confirm-Bi4_XwxH.js +0 -7
  187. package/dist/assets/connect-Bzett2rh.js +0 -5
  188. package/dist/assets/connect-to-nP4HS-Z0.js +0 -1
  189. package/dist/assets/dashboard-27JnEnGY.js +0 -279
  190. package/dist/assets/domain-5-nsJfDM.js +0 -9
  191. package/dist/assets/domain-action-card-DrjkSQwC.js +0 -25
  192. package/dist/assets/domains-CD91MGQk.js +0 -1
  193. package/dist/assets/dot-BBxUn__M.js +0 -7
  194. package/dist/assets/index-B-h0rpyF.js +0 -10
  195. package/dist/assets/index-BeXUaMlG.js +0 -55
  196. package/dist/assets/index-Ca99ESdg.js +0 -1
  197. package/dist/assets/index-o53rWfYr.js +0 -113
  198. package/dist/assets/invite-BC0OYJxG.js +0 -1
  199. package/dist/assets/issue-passport-CD5ylk7Y.js +0 -1
  200. package/dist/assets/localization-Bqeaav45.js +0 -1
  201. package/dist/assets/logger-DzZIANXq.js +0 -1
  202. package/dist/assets/logo-uploader-BKxncdN2.js +0 -133
  203. package/dist/assets/omit-B1LDXfkq.js +0 -1
  204. package/dist/assets/preferences-C0eu3vgg.js +0 -1
  205. package/dist/assets/profile-embed-DfDaKcjJ.js +0 -1
  206. package/dist/assets/publish-resource-BEIDgQwd.js +0 -1
  207. package/dist/assets/runtime-B8E7DTqn.js +0 -1
  208. package/dist/assets/sdk-K0wUtuBQ.js +0 -1
  209. package/dist/assets/session-BPop7wxF.js +0 -1
  210. package/dist/assets/setup-DW_rcwsG.js +0 -19
  211. package/dist/assets/useAsync-B_98ShEr.js +0 -1
  212. package/dist/assets/user-center-DGFt0-Nt.js +0 -77
  213. package/dist/assets/vendor-utils-DMClavLd.js +0 -11
  214. package/dist/assets/vendor-ux-did-connect-qEfzi7sf.js +0 -1832
  215. package/dist/assets/zh-yJzqRkfw.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a8 as Ol,j as o,H as N,a9 as xt,ag as Ve,aa as Y,T as ge,v as qt,bs as wi,bO as Ei,I as js,bG as ks,bW as Os,A as Is,bh as Il,b5 as Cs,bq as Cl,O as Sr,bB as Rl,bC as Pl,bD as _l,bx as Ll,aj as Rs,L as Nl,b4 as Al,b2 as Dl,q as Si,ab as Ps,ad as Ml,ak as rt,e as yn,bH as Fl,y as ir,Z as Bl,a1 as _s,M as Ls,bR as Ns,am as $l,ah as zt,bg as To,E as jo,a5 as Ul,P as Wl,G as zl,w as ql,a6 as Kl,D as Gl,N as ko}from"./vendor-mui-core-DiDsSLd-.js";import{r as M,g as Ti,f as Hl,k as Vl,a as ji,e as Se,b as Mt,l as Xl}from"./vendor-react-DoD83n6N.js";import{j as As,d as Yl,S as Ql,s as Ds,A as Jl}from"./item-VCJ7-Z3r.js";import{r as Zl,B as dt,al as ki,W as Ms,p as Fs,u as gt,h as pt,aH as ec,aG as tc,l as Tr,b3 as nc,an as Bs,bk as Oo,aq as rc,Y as Oi,C as ic,s as Gt,X as br,ax as Io,ai as $s,bl as mr,d as Ii,b6 as Us,e as Ws,_ as oc,bm as sc,g as ii,bn as ac,aA as lc,bo as cc}from"./vendor-ux-did-connect-qEfzi7sf.js";import{v as Co,c as kt,w as uc,E as jr,x as dc,y as hc,z as fc,L as pc,S as mc}from"./vendor-arcblock-Dd-d3bxC.js";import{L as Ro}from"./launch-result-message-Ckk5lRW7.js";import{P as zs}from"./page-header-BhpaMk9g.js";import{c as ut,p as gc,B as vc,D as Po,y as Jn,_ as qs,a2 as yc,ac as bc,I as xc,o as Dr,x as Ci,Y as wc,ad as Ec,ae as Sc,af as Tc,z as Hn,ag as jc,b as kc}from"./vendor-utils-DMClavLd.js";import{z as _n,f as Dt,W as Oc,X as Ic,Y as Cc,D as Rc,Z as Pc,_ as _c,$ as Lc,C as kr,a0 as Ks,T as Nc,a1 as Ac,a2 as Dc,a3 as Mc,a4 as lr,a5 as _o,a6 as Fc}from"./index-Cg_v1vT_.js";import{u as Bc,C as $c}from"./config-space-BFcXXNuJ.js";import{R as Mr}from"./logo-uploader-BKxncdN2.js";import{S as Uc}from"./index-KWGv7rf_.js";import{s as Gs,h as Wc,w as zc,f as qc,a as Kc,b as Gc,c as Hc,M as Vc}from"./index-CEMXycV7.js";import{m as or,f as Xc,a as Yc,e as Hs,x as Qc}from"./vendor-hooks-jg6xPUPF.js";import{g as Jc}from"./get-safe-url-DGJYpGp-.js";import{p as Zc}from"./index-kqlC8JFQ.js";import{r as eu}from"./cloneDeep-DUYD8ZBI.js";import{I as Lo}from"./index-C6wFIF6L.js";import{u as tu}from"./session-BPop7wxF.js";import{W as nu}from"./did-address-gmPYOGuy.js";import{_ as Vs}from"./useLocalStorage-BTc2ONSy.js";import{f as Xs}from"./format-error-LAoTjvJe.js";import{a as No}from"./api-DwjKcjK8.js";import{d as ru,a as iu,v as ou,e as su}from"./util-DA84MxE0.js";import{u as Ys}from"./use-mobile-BbxjRR_q.js";import{C as au}from"./content-layout-Cg5RRv1R.js";import{C as lu,D as cu,a as uu}from"./connect-to-nP4HS-Z0.js";import{d as du}from"./ArrowDropDown-CnO3M65x.js";import{d as hu}from"./ChevronLeft-J2DjxamT.js";import{d as fu}from"./ChevronRight-CbbryV_W.js";const ug="blocklet-add-component-registry",dg="server-add-registry",hg=e=>`resource-${e}-add-registry`;var Ri={},pu=Ol;Object.defineProperty(Ri,"__esModule",{value:!0});var Qs=Ri.default=void 0,mu=pu(Zl()),gu=o;Qs=Ri.default=(0,mu.default)((0,gu.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 Js(e){const{info:t}=_n();return M.useMemo(()=>{var n,r,i;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((i=e.docker)!=null&&i.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function Pi({disabled:e,children:t,onConfirm:n}){return M.useEffect(()=>{if(e)return()=>{};const r=i=>{i.code==="Enter"&&(i.metaKey===!0||i.ctrlKey===!0)&&(i.preventDefault(),i.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}Pi.propTypes={disabled:N.bool,children:N.any.isRequired,onConfirm:N.func.isRequired};Pi.defaultProps={disabled:!1};function _i({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=M.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(vu,{children:o.jsxs(Pi,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(dt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(xt,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(ki,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}_i.propTypes={onContinue:N.func.isRequired,nextDisabled:N.bool,launching:N.bool,description:N.any,texts:N.object};_i.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const vu=Ve.div`
1
+ import{a8 as Ol,j as o,H as N,aa as xt,ag as He,a9 as Y,T as ge,v as qt,bs as wi,bS as Ei,I as js,bK as ks,b_ as Os,A as Is,bd as Il,b5 as Cs,bq as Cl,O as Sr,bF as Rl,bG as Pl,bH as _l,bx as Ll,aj as Rs,L as Nl,b4 as Al,b2 as Dl,q as Si,ac as Ps,ae as Ml,ak as rt,e as yn,bL as Fl,y as ir,Z as Bl,a1 as _s,M as Ls,bV as Ns,am as $l,ah as zt,bb as To,E as jo,a5 as Ul,P as Wl,G as zl,w as ql,a6 as Kl,D as Gl,N as ko}from"./vendor-mui-core-CfA4EdRA.js";import{r as M,g as Ti,h as Vl,f as Hl,a as ji,e as Se,b as Mt,l as Xl}from"./vendor-react-DEoibe3W.js";import{j as As,d as Yl,S as Ql,s as Ds,A as Jl}from"./item-CdEFLc19.js";import{r as Zl,B as dt,al as ki,W as Ms,j as Fs,u as gt,I as pt,aJ as ec,az as tc,f as Tr,b4 as nc,an as Bs,bl as Oo,aq as rc,Y as Oi,C as ic,s as Gt,X as br,ax as Io,ai as $s,bm as mr,d as Ii,b7 as Us,z as Ws,_ as oc,bn as sc,a as ii,bo as ac,aD as lc,bp as cc}from"./vendor-ux-did-connect-zBIy2ulO.js";import{z as Co,c as kt,B as uc,E as jr,G as dc,I as hc,J as fc,L as pc,S as mc}from"./vendor-arcblock-CWji6U03.js";import{L as Ro}from"./launch-result-message-yorrVgpQ.js";import{P as zs}from"./page-header-C86YQnHE.js";import{c as ut,q as gc,B as vc,D as Po,y as Jn,_ as qs,a6 as yc,af as bc,I as xc,o as Dr,x as Ci,Y as wc,ah as Ec,ai as Sc,aj as Tc,z as Vn,ak as jc,b as kc}from"./vendor-utils-BNHJB5U7.js";import{z as _n,f as Dt,$ as Oc,a0 as Ic,a1 as Cc,D as Rc,a2 as Pc,a3 as _c,a4 as Lc,C as kr,a5 as Ks,Y as Nc,a6 as Ac,a7 as Dc,a8 as Mc,a9 as lr,aa as _o,ab as Fc}from"./index-BWx6ivvZ.js";import{u as Bc,C as $c}from"./config-space-DEku2tJv.js";import{R as Mr}from"./logo-uploader-Bv2ZSxJV.js";import{S as Uc}from"./index-qcSTfn8X.js";import{s as Gs,h as Wc,w as zc,f as qc,a as Kc,b as Gc,c as Vc,M as Hc}from"./index-DQc29-JM.js";import{m as or,f as Xc,a as Yc,e as Vs,t as Qc}from"./vendor-hooks-DftG_2gV.js";import{g as Jc}from"./get-safe-url-MZ-ksvtD.js";import{p as Zc}from"./index-YbJjfDTR.js";import{r as eu}from"./cloneDeep-SfcdeqEN.js";import{I as Lo}from"./index-C7UL-KG1.js";import{u as tu}from"./session-CdQbSkeB.js";import{W as nu}from"./did-address-DNf_-NM-.js";import{_ as Hs}from"./useLocalStorage-BJb7uGDO.js";import{f as Xs}from"./format-error-BrmqJs5a.js";import{a as No}from"./api-BrU7j0QA.js";import{d as ru,a as iu,v as ou,e as su}from"./util-BYLEVYA_.js";import{u as Ys}from"./use-mobile-Bgy7gTTP.js";import{C as au}from"./content-layout-JixQ7owc.js";import{C as lu,D as cu,a as uu}from"./connect-to-C-vFK0ym.js";import{d as du}from"./ArrowDropDown-BHNhtNqo.js";import{d as hu}from"./ChevronLeft-fcaEvvT2.js";import{d as fu}from"./ChevronRight-BWcj-otI.js";const ug="blocklet-add-component-registry",dg="server-add-registry",hg=e=>`resource-${e}-add-registry`;var Ri={},pu=Ol;Object.defineProperty(Ri,"__esModule",{value:!0});var Qs=Ri.default=void 0,mu=pu(Zl()),gu=o;Qs=Ri.default=(0,mu.default)((0,gu.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 Js(e){const{info:t}=_n();return M.useMemo(()=>{var n,r,i;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((i=e.docker)!=null&&i.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function Pi({disabled:e,children:t,onConfirm:n}){return M.useEffect(()=>{if(e)return()=>{};const r=i=>{i.code==="Enter"&&(i.metaKey===!0||i.ctrlKey===!0)&&(i.preventDefault(),i.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}Pi.propTypes={disabled:N.bool,children:N.any.isRequired,onConfirm:N.func.isRequired};Pi.defaultProps={disabled:!1};function _i({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=M.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(vu,{children:o.jsxs(Pi,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(dt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(xt,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(ki,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}_i.propTypes={onContinue:N.func.isRequired,nextDisabled:N.bool,launching:N.bool,description:N.any,texts:N.object};_i.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const vu=He.div`
2
2
  margin: 0 auto;
3
3
  display: flex;
4
4
  justify-content: space-between;
@@ -28,7 +28,7 @@ import{a8 as Ol,j as o,H as N,a9 as xt,ag as Ve,aa as Y,T as ge,v as qt,bs as wi
28
28
  min-width: 200px;
29
29
  }
30
30
  `;var Li={exports:{}},Ao=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,yu=/\n/g,bu=/^\s*/,xu=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,wu=/^:\s*/,Eu=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Su=/^[;\s]*/,Tu=/^\s+|\s+$/g,ju=`
31
- `,Do="/",Mo="*",dn="",ku="comment",Ou="declaration",Iu=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 i(S){var j=S.match(yu);j&&(n+=j.length);var L=S.lastIndexOf(ju);r=~L?S.length-L:r+S.length}function s(){var S={line:n,column:r};return function(j){return j.position=new a(S),v(),j}}function a(S){this.start=S,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function c(S){var j=new Error(t.source+":"+n+":"+r+": "+S);if(j.reason=S,j.filename=t.source,j.line=n,j.column=r,j.source=e,!t.silent)throw j}function f(S){var j=S.exec(e);if(j){var L=j[0];return i(L),e=e.slice(L.length),j}}function v(){f(bu)}function l(S){var j;for(S=S||[];j=u();)j!==!1&&S.push(j);return S}function u(){var S=s();if(!(Do!=e.charAt(0)||Mo!=e.charAt(1))){for(var j=2;dn!=e.charAt(j)&&(Mo!=e.charAt(j)||Do!=e.charAt(j+1));)++j;if(j+=2,dn===e.charAt(j-1))return c("End of comment missing");var L=e.slice(2,j-2);return r+=2,i(L),e=e.slice(j),r+=2,S({type:ku,comment:L})}}function T(){var S=s(),j=f(xu);if(j){if(u(),!f(wu))return c("property missing ':'");var L=f(Eu),D=S({type:Ou,property:Fo(j[0].replace(Ao,dn)),value:L?Fo(L[0].replace(Ao,dn)):dn});return f(Su),D}}function y(){var S=[];l(S);for(var j;j=T();)j!==!1&&(S.push(j),l(S));return S}return v(),y()};function Fo(e){return e?e.replace(Tu,dn):dn}var Cu=Iu;function Zs(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=Cu(e),s=typeof t=="function",a,c,f=0,v=i.length;f<v;f++)r=i[f],a=r.property,c=r.value,s?t(a,c,r):c&&(n||(n={}),n[a]=c);return n}Li.exports=Zs;Li.exports.default=Zs;var Ru=Li.exports;const Pu=Ti(Ru),_u={}.hasOwnProperty;function Lu(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Au(e),i=Fu(e),s=Mu(e);let a,c;if(typeof n=="string"||typeof n=="boolean"?(a=n,n={}):(n||(n={}),a=n.prefix),t&&t.type==="root"){const f=t.children[0];c=t.children.length===1&&f.type==="element"?f:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")c=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ea(e,c,{schema:n.space==="svg"?Gs:Wc,prefix:a==null?r||i||s?"h-":void 0:typeof a=="string"?a:a?"h-":void 0,key:0,react:r,vue:i,vdom:s,hyperscript:Du(e)})}function ea(e,t,n){const r=n.schema;let i=r,s=t.tagName;const a={},c=[];let f=-1,v;r.space==="html"&&s.toLowerCase()==="svg"&&(i=Gs,n.schema=i);for(v in t.properties)t.properties&&_u.call(t.properties,v)&&Nu(a,v,t.properties[v],n,s);if(n.vdom&&(i.space==="html"?s=s.toUpperCase():i.space&&(a.namespace=zc[i.space])),n.prefix&&(n.key++,a.key=n.prefix+n.key),t.children)for(;++f<t.children.length;){const l=t.children[f];l.type==="element"?c.push(ea(e,l,n)):l.type==="text"&&c.push(l.value)}return n.schema=r,c.length>0?e.call(t,s,a,c):e.call(t,s,a)}function Nu(e,t,n,r,i){const s=qc(r.schema,t);let a;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&s.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=s.commaSeparated?Kc(n):Gc(n)),s.boolean&&r.hyperscript&&(n=""),s.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Bu(n,i)),r.vue?s.property!=="style"&&(a="attrs"):s.mustUseProperty||(r.vdom?s.property!=="style"&&(a="attributes"):r.hyperscript&&(a="attrs")),a?e[a]=Object.assign(e[a]||{},{[s.attribute]:n}):s.space&&r.react?e[Hc[s.property]||s.property]=n:e[s.attribute]=n)}function Au(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Du(e){return"context"in e&&"cleanup"in e}function Mu(e){return e("div",{}).type==="VirtualNode"}function Fu(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Bu(e,t){const n={};try{Pu(e,(r,i)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(s,a)=>a.toUpperCase())]=i})}catch(r){const i=r;throw i.message=t+"[style]"+i.message.slice(9),i}return n}var $u=ta;function ta(e){if(typeof e=="string")return qu(e);if(e==null)return Ku;if(typeof e=="object")return("length"in e?zu:Wu)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Uu(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=ta(e[r]);return t}function Wu(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function zu(e){var t=Uu(e),n=t.length;return r;function r(){for(var i=-1;++i<n;)if(t[i].apply(this,arguments))return!0;return!1}}function qu(e){return t;function t(n){return!!(n&&n.type===e)}}function Ku(){return!0}var Gu=Or,Hu=$u,na=!0,ra="skip",gr=!1;Or.CONTINUE=na;Or.SKIP=ra;Or.EXIT=gr;function Or(e,t,n,r){var i;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),i=Hu(t),s(e,null,[]);function s(c,f,v){var l=[],u;return(!t||i(c,f,v[v.length-1]||null))&&(l=Bo(n(c,v)),l[0]===gr)?l:c.children&&l[0]!==ra?(u=Bo(a(c.children,v.concat(c))),u[0]===gr?u:l):l}function a(c,f){for(var v=-1,l=r?-1:1,u=(r?c.length:v)+l,T;u>v&&u<c.length;){if(T=s(c[u],u,f),T[0]===gr)return T;u=typeof T[1]=="number"?T[1]:u+l}}}function Bo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[na,e]:[e]}var Vu=Cr,Ir=Gu,Xu=Ir.CONTINUE,Yu=Ir.SKIP,Qu=Ir.EXIT;Cr.CONTINUE=Xu;Cr.SKIP=Yu;Cr.EXIT=Qu;function Cr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),Ir(e,t,i,r);function i(s,a){var c=a[a.length-1],f=c?c.children.indexOf(s):null;return n(s,f,c)}}var Ju=Vu,Zu=Object.prototype.hasOwnProperty,Fr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},ed=function(t){return Ju(t,"element",td),t};function td(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Fr)!Zu.call(Fr,t)||e.properties[t]===void 0||(n=Fr[t],nd(e,n,e.properties[t]),delete e.properties[t])}}function nd(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var i=r+t+": "+n+";";e.properties.style=i}const rd=Ti(ed);function id(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 od={}.hasOwnProperty,sd=new Set(["table","thead","tbody","tfoot","tr"]);function ad(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(s){let a=Lu(i,n?rd(s):s,e.prefix);return s.type==="root"?(a=a&&typeof a=="object"&&"type"in a&&"props"in a&&a.type==="div"&&(s.children.length!==1||s.children[0].type!=="element")?a.props.children:[a],t(e.Fragment||"div",{},a)):a}function i(s,a,c){if(c&&sd.has(s)&&(c=c.filter(f=>!id(f))),e.components&&od.call(e.components,s)){const f=e.components[s];return e.passNode&&typeof f=="function"&&(a=Object.assign({node:this},a)),t(f,a,c)}return t(s,a,c)}}function Ni({children:e}){return o.jsx(ld,{children:e})}const $o="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",ld=Ve(Y)`
31
+ `,Do="/",Mo="*",dn="",ku="comment",Ou="declaration",Iu=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 i(S){var j=S.match(yu);j&&(n+=j.length);var L=S.lastIndexOf(ju);r=~L?S.length-L:r+S.length}function s(){var S={line:n,column:r};return function(j){return j.position=new a(S),v(),j}}function a(S){this.start=S,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function c(S){var j=new Error(t.source+":"+n+":"+r+": "+S);if(j.reason=S,j.filename=t.source,j.line=n,j.column=r,j.source=e,!t.silent)throw j}function f(S){var j=S.exec(e);if(j){var L=j[0];return i(L),e=e.slice(L.length),j}}function v(){f(bu)}function l(S){var j;for(S=S||[];j=u();)j!==!1&&S.push(j);return S}function u(){var S=s();if(!(Do!=e.charAt(0)||Mo!=e.charAt(1))){for(var j=2;dn!=e.charAt(j)&&(Mo!=e.charAt(j)||Do!=e.charAt(j+1));)++j;if(j+=2,dn===e.charAt(j-1))return c("End of comment missing");var L=e.slice(2,j-2);return r+=2,i(L),e=e.slice(j),r+=2,S({type:ku,comment:L})}}function T(){var S=s(),j=f(xu);if(j){if(u(),!f(wu))return c("property missing ':'");var L=f(Eu),D=S({type:Ou,property:Fo(j[0].replace(Ao,dn)),value:L?Fo(L[0].replace(Ao,dn)):dn});return f(Su),D}}function y(){var S=[];l(S);for(var j;j=T();)j!==!1&&(S.push(j),l(S));return S}return v(),y()};function Fo(e){return e?e.replace(Tu,dn):dn}var Cu=Iu;function Zs(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=Cu(e),s=typeof t=="function",a,c,f=0,v=i.length;f<v;f++)r=i[f],a=r.property,c=r.value,s?t(a,c,r):c&&(n||(n={}),n[a]=c);return n}Li.exports=Zs;Li.exports.default=Zs;var Ru=Li.exports;const Pu=Ti(Ru),_u={}.hasOwnProperty;function Lu(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Au(e),i=Fu(e),s=Mu(e);let a,c;if(typeof n=="string"||typeof n=="boolean"?(a=n,n={}):(n||(n={}),a=n.prefix),t&&t.type==="root"){const f=t.children[0];c=t.children.length===1&&f.type==="element"?f:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")c=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ea(e,c,{schema:n.space==="svg"?Gs:Wc,prefix:a==null?r||i||s?"h-":void 0:typeof a=="string"?a:a?"h-":void 0,key:0,react:r,vue:i,vdom:s,hyperscript:Du(e)})}function ea(e,t,n){const r=n.schema;let i=r,s=t.tagName;const a={},c=[];let f=-1,v;r.space==="html"&&s.toLowerCase()==="svg"&&(i=Gs,n.schema=i);for(v in t.properties)t.properties&&_u.call(t.properties,v)&&Nu(a,v,t.properties[v],n,s);if(n.vdom&&(i.space==="html"?s=s.toUpperCase():i.space&&(a.namespace=zc[i.space])),n.prefix&&(n.key++,a.key=n.prefix+n.key),t.children)for(;++f<t.children.length;){const l=t.children[f];l.type==="element"?c.push(ea(e,l,n)):l.type==="text"&&c.push(l.value)}return n.schema=r,c.length>0?e.call(t,s,a,c):e.call(t,s,a)}function Nu(e,t,n,r,i){const s=qc(r.schema,t);let a;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&s.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=s.commaSeparated?Kc(n):Gc(n)),s.boolean&&r.hyperscript&&(n=""),s.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Bu(n,i)),r.vue?s.property!=="style"&&(a="attrs"):s.mustUseProperty||(r.vdom?s.property!=="style"&&(a="attributes"):r.hyperscript&&(a="attrs")),a?e[a]=Object.assign(e[a]||{},{[s.attribute]:n}):s.space&&r.react?e[Vc[s.property]||s.property]=n:e[s.attribute]=n)}function Au(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function Du(e){return"context"in e&&"cleanup"in e}function Mu(e){return e("div",{}).type==="VirtualNode"}function Fu(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Bu(e,t){const n={};try{Pu(e,(r,i)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(s,a)=>a.toUpperCase())]=i})}catch(r){const i=r;throw i.message=t+"[style]"+i.message.slice(9),i}return n}var $u=ta;function ta(e){if(typeof e=="string")return qu(e);if(e==null)return Ku;if(typeof e=="object")return("length"in e?zu:Wu)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Uu(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=ta(e[r]);return t}function Wu(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function zu(e){var t=Uu(e),n=t.length;return r;function r(){for(var i=-1;++i<n;)if(t[i].apply(this,arguments))return!0;return!1}}function qu(e){return t;function t(n){return!!(n&&n.type===e)}}function Ku(){return!0}var Gu=Or,Vu=$u,na=!0,ra="skip",gr=!1;Or.CONTINUE=na;Or.SKIP=ra;Or.EXIT=gr;function Or(e,t,n,r){var i;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),i=Vu(t),s(e,null,[]);function s(c,f,v){var l=[],u;return(!t||i(c,f,v[v.length-1]||null))&&(l=Bo(n(c,v)),l[0]===gr)?l:c.children&&l[0]!==ra?(u=Bo(a(c.children,v.concat(c))),u[0]===gr?u:l):l}function a(c,f){for(var v=-1,l=r?-1:1,u=(r?c.length:v)+l,T;u>v&&u<c.length;){if(T=s(c[u],u,f),T[0]===gr)return T;u=typeof T[1]=="number"?T[1]:u+l}}}function Bo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[na,e]:[e]}var Hu=Cr,Ir=Gu,Xu=Ir.CONTINUE,Yu=Ir.SKIP,Qu=Ir.EXIT;Cr.CONTINUE=Xu;Cr.SKIP=Yu;Cr.EXIT=Qu;function Cr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),Ir(e,t,i,r);function i(s,a){var c=a[a.length-1],f=c?c.children.indexOf(s):null;return n(s,f,c)}}var Ju=Hu,Zu=Object.prototype.hasOwnProperty,Fr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},ed=function(t){return Ju(t,"element",td),t};function td(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Fr)!Zu.call(Fr,t)||e.properties[t]===void 0||(n=Fr[t],nd(e,n,e.properties[t]),delete e.properties[t])}}function nd(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var i=r+t+": "+n+";";e.properties.style=i}const rd=Ti(ed);function id(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 od={}.hasOwnProperty,sd=new Set(["table","thead","tbody","tfoot","tr"]);function ad(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(s){let a=Lu(i,n?rd(s):s,e.prefix);return s.type==="root"?(a=a&&typeof a=="object"&&"type"in a&&"props"in a&&a.type==="div"&&(s.children.length!==1||s.children[0].type!=="element")?a.props.children:[a],t(e.Fragment||"div",{},a)):a}function i(s,a,c){if(c&&sd.has(s)&&(c=c.filter(f=>!id(f))),e.components&&od.call(e.components,s)){const f=e.components[s];return e.passNode&&typeof f=="function"&&(a=Object.assign({node:this},a)),t(f,a,c)}return t(s,a,c)}}function Ni({children:e}){return o.jsx(ld,{children:e})}const $o="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",ld=He(Y)`
32
32
  .highlight pre,
33
33
  pre {
34
34
  border-radius: 5px;
@@ -62,7 +62,7 @@ import{a8 as Ol,j as o,H as N,a9 as xt,ag as Ve,aa as Y,T as ge,v as qt,bs as wi
62
62
  .anchor {
63
63
  display: none;
64
64
  }
65
- `;Ni.propTypes={children:N.any.isRequired};Ni.defaultProps={};function ia({infoList:e=[]}){return o.jsx(Y,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>o.jsxs(o.Fragment,{children:[o.jsx(Y,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),o.jsx(Y,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}ia.propTypes={infoList:N.arrayOf(N.shape({key:N.string,value:N.string}))};const cd=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,ud=new ad({createElement:M.createElement}).Compiler,jt={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 Ai({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:i,did:s}=r,a=Dt.getDisplayName({meta:r}),c=or(()=>i&&s?fetch(Co(i,"/api/blocklets",s,"readme")).then(S=>S.json()):null,{refreshDeps:[i,s]}),f=Xc(()=>c.data?c.data[t]||c.data.en||c.data[Object.keys(c.data)[0]]:"",[c]),v=r&&r.htmlAst?ud(r.htmlAst):"",l=cd(r);let u=ut(r,"owner.fullName");if(u){const S=ut(r,"owner.did");S&&(u=o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[u,o.jsx(Ms,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else u=ut(r,"author.name");const T=[{key:ut(jt[t],"appinfo.name"),value:Dt.getDisplayName({meta:r})},{key:ut(jt[t],"appinfo.version"),value:r.version},{key:ut(jt[t],"appinfo.author"),value:u},{type:"description",key:ut(jt[t],"appinfo.description"),value:r.description}];r.requirements&&T.push({key:ut(jt[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&T.push({key:ut(jt[t],"appinfo.community"),value:o.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&T.push({key:ut(jt[t],"appinfo.documentation"),value:o.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&T.push({key:ut(jt[t],"appinfo.support"),value:o.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),v&&T.push({key:ut(jt[t],"appinfo.overview"),value:""});let y;return t==="zh"?y=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["您可以免费使用 ",o.jsx("b",{children:a}),";"]}):o.jsxs("p",{children:["您需要购买才能使用 ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),o.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),o.jsx("p",{children:"下面为该应用的信息:"})]}):y=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["You can use ",o.jsx("b",{children:a})," for free;"]}):o.jsxs("p",{children:["You need to purchase before launch ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),o.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),o.jsx("p",{children:"Below is the information for the blocklet: "})]}),o.jsxs(hd,{children:[n||y,o.jsx(ia,{infoList:T}),f?o.jsxs("div",{className:"app-overview",children:[o.jsx(ge,{variant:"h5",gutterBottom:!0,children:ut(jt[t],"appinfo.overview")}),o.jsx(Ni,{children:o.jsx(dd,{component:"div",className:"content-wrapper post-content",children:o.jsx(Vc,{source:f,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,j,L)=>S.startsWith("/")?Co(i,S):S})})})]}):v?o.jsx("div",{className:"app-overview",children:v}):null]})}const dd=Ve(ge)`
65
+ `;Ni.propTypes={children:N.any.isRequired};Ni.defaultProps={};function ia({infoList:e=[]}){return o.jsx(Y,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>o.jsxs(o.Fragment,{children:[o.jsx(Y,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),o.jsx(Y,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}ia.propTypes={infoList:N.arrayOf(N.shape({key:N.string,value:N.string}))};const cd=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,ud=new ad({createElement:M.createElement}).Compiler,jt={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 Ai({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:i,did:s}=r,a=Dt.getDisplayName({meta:r}),c=or(()=>i&&s?fetch(Co(i,"/api/blocklets",s,"readme")).then(S=>S.json()):null,{refreshDeps:[i,s]}),f=Xc(()=>c.data?c.data[t]||c.data.en||c.data[Object.keys(c.data)[0]]:"",[c]),v=r&&r.htmlAst?ud(r.htmlAst):"",l=cd(r);let u=ut(r,"owner.fullName");if(u){const S=ut(r,"owner.did");S&&(u=o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[u,o.jsx(Ms,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else u=ut(r,"author.name");const T=[{key:ut(jt[t],"appinfo.name"),value:Dt.getDisplayName({meta:r})},{key:ut(jt[t],"appinfo.version"),value:r.version},{key:ut(jt[t],"appinfo.author"),value:u},{type:"description",key:ut(jt[t],"appinfo.description"),value:r.description}];r.requirements&&T.push({key:ut(jt[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&T.push({key:ut(jt[t],"appinfo.community"),value:o.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&T.push({key:ut(jt[t],"appinfo.documentation"),value:o.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&T.push({key:ut(jt[t],"appinfo.support"),value:o.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),v&&T.push({key:ut(jt[t],"appinfo.overview"),value:""});let y;return t==="zh"?y=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["您可以免费使用 ",o.jsx("b",{children:a}),";"]}):o.jsxs("p",{children:["您需要购买才能使用 ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),o.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),o.jsx("p",{children:"下面为该应用的信息:"})]}):y=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["You can use ",o.jsx("b",{children:a})," for free;"]}):o.jsxs("p",{children:["You need to purchase before launch ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),o.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),o.jsx("p",{children:"Below is the information for the blocklet: "})]}),o.jsxs(hd,{children:[n||y,o.jsx(ia,{infoList:T}),f?o.jsxs("div",{className:"app-overview",children:[o.jsx(ge,{variant:"h5",gutterBottom:!0,children:ut(jt[t],"appinfo.overview")}),o.jsx(Ni,{children:o.jsx(dd,{component:"div",className:"content-wrapper post-content",children:o.jsx(Hc,{source:f,wrapperElement:{"data-color-mode":"light"},urlTransform:(S,j,L)=>S.startsWith("/")?Co(i,S):S})})})]}):v?o.jsx("div",{className:"app-overview",children:v}):null]})}const dd=He(ge)`
66
66
  width: 100%;
67
67
  word-wrap: break-word;
68
68
  word-break: break-word;
@@ -80,7 +80,7 @@ import{a8 as Ol,j as o,H as N,a9 as xt,ag as Ve,aa as Y,T as ge,v as qt,bs as wi
80
80
  iframe {
81
81
  width: 100% !important;
82
82
  }
83
- `,hd=Ve.div`
83
+ `,hd=He.div`
84
84
  .info-table {
85
85
  a {
86
86
  word-break: break-all;
@@ -110,7 +110,7 @@ import{a8 as Ol,j as o,H as N,a9 as xt,ag as Ve,aa as Y,T as ge,v as qt,bs as wi
110
110
  margin-left: 2em;
111
111
  }
112
112
  }
113
- `;Ai.propTypes={blockletMeta:N.object.isRequired,locale:N.string.isRequired,handleDescEle:N.node};Ai.defaultProps={handleDescEle:""};function fd({...e}){return o.jsxs("div",{...e,style:{width:"100%"},children:[o.jsx("h3",{children:"End User License Agreement for Application"}),o.jsxs("p",{children:["Blocklet Server License Agreement ",Fs.COPYRIGHT_OWNER," version 2020-08-28"]}),o.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),o.jsx("p",{children:"暂无"})]})}function pd(e){var t,n,r,i;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=${(i=e.meta)==null?void 0:i.version}`}function Di({installRelated:e,meta:t,show:n,onClose:r,components:i,loading:s}){const{t:a}=gt(),c=qt(u=>u.breakpoints.down("md"));if(!n)return null;const f=!s&&i.length===0,v=!s&&i.length!==0,l=40;return o.jsxs(ki,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(u,T)=>{T!=="backdropClick"&&r(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[s&&o.jsx(Y,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:o.jsx(Y,{sx:{fontSize:32},color:"primary.main",component:pt,icon:"line-md:loading-loop"})}),f&&o.jsx(Y,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),v&&o.jsx(Y,{sx:{marginBottom:2},children:i.map(u=>{if(!u.meta)return null;const{required:T}=u;let y;return e||T?y=1:y=.5,o.jsxs(Y,{sx:{opacity:y,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[o.jsx("img",{style:{width:l,height:l,minWidth:l,minHeight:l},src:pd(u),alt:u.meta.title}),o.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[o.jsxs(Y,{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(Jc(`${((S=u.bundleSource)==null?void 0:S.store)||u.meta.homepage}/blocklets/${u.meta.did}`,{allowDomains:null}),"_blank")},children:[u.meta.title,o.jsx(Y,{sx:{display:T?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),o.jsxs(Y,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[u.meta.version,o.jsx(Y,{className:"link-icon",icon:"fluent:open-20-filled",component:pt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),o.jsx(Y,{sx:{marginTop:0,opacity:.7},children:u.meta.description})]})]},u.meta.did)})})]})}Di.propTypes={meta:N.object,show:N.bool,onClose:N.func.isRequired,installRelated:N.func,components:N.array.isRequired,loading:N.bool.isRequired};Di.defaultProps={meta:null,show:!1,installRelated:!1};function md(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function gd(e){const{api:t}=_n(),[n]=Hl(),r=n.get("blocklet_meta_url")||md(e),[i,s]=M.useState([]),[a,c]=M.useState(!1);return M.useEffect(()=>{!r||e!=null&&e.inputUrl||(c(!0),t.getDynamicComponents({input:{url:r}}).then(f=>{s(f.components)}).finally(()=>{c(!1)}))},[r]),{components:i,loading:a}}function Mi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:i}){const s=Vl(),{t:a,locale:c}=gt(),[f,v]=M.useState(!1),{components:l,loading:u}=gd(n),T=Js(n),y=r||(()=>{s(`/launch-blocklet/install${window.location.search}`)}),S=()=>{v(!0)},j=()=>{v(!1)};return o.jsxs(vd,{children:[o.jsx("div",{className:"app-content",children:o.jsx("div",{className:"agreement",children:o.jsx("div",{className:"agreement-content",children:T?o.jsx(Ai,{blockletMeta:{data:n},locale:c,handleDescEle:i}):o.jsx(Y,{sx:{p:3},children:o.jsx(ge,{children:a("launchBlocklet.dockerBlockletCantInstall")})})})})}),o.jsxs(Y,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[u?o.jsx(pt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,T&&t&&(l!=null&&l.length)?o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[o.jsx(wi,{sx:{mr:.5},checked:e,onChange:L=>t(L.currentTarget.checked),control:o.jsx(Ei,{}),label:o.jsx("span",{children:a("launchBlocklet.installRelatedComponents")})}),o.jsx(Y,{sx:{"> button svg":{color:"primary.main"}},children:o.jsx(js,{size:"small",onClick:S,children:o.jsx(pt,{icon:"octicon:package-dependencies-16"})})})]}):null,o.jsx("div",{className:"button-container","data-cy":"agree-all",children:T?o.jsx(_i,{onContinue:y,description:o.jsx(fd,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}}):null})]}),o.jsx(Di,{installRelated:e,meta:n,show:f,onClose:j,components:l,loading:u})]})}Mi.propTypes={meta:N.object.isRequired,onClickNext:N.func,handleDescEle:N.node,installRelated:N.bool,onChangeInstallRelated:N.func};Mi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const vd=Ve.div`
113
+ `;Ai.propTypes={blockletMeta:N.object.isRequired,locale:N.string.isRequired,handleDescEle:N.node};Ai.defaultProps={handleDescEle:""};function fd({...e}){return o.jsxs("div",{...e,style:{width:"100%"},children:[o.jsx("h3",{children:"End User License Agreement for Application"}),o.jsxs("p",{children:["Blocklet Server License Agreement ",Fs.COPYRIGHT_OWNER," version 2020-08-28"]}),o.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),o.jsx("p",{children:"暂无"})]})}function pd(e){var t,n,r,i;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=${(i=e.meta)==null?void 0:i.version}`}function Di({installRelated:e,meta:t,show:n,onClose:r,components:i,loading:s}){const{t:a}=gt(),c=qt(u=>u.breakpoints.down("md"));if(!n)return null;const f=!s&&i.length===0,v=!s&&i.length!==0,l=40;return o.jsxs(ki,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(u,T)=>{T!=="backdropClick"&&r(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[s&&o.jsx(Y,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:o.jsx(Y,{sx:{fontSize:32},color:"primary.main",component:pt,icon:"line-md:loading-loop"})}),f&&o.jsx(Y,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),v&&o.jsx(Y,{sx:{marginBottom:2},children:i.map(u=>{if(!u.meta)return null;const{required:T}=u;let y;return e||T?y=1:y=.5,o.jsxs(Y,{sx:{opacity:y,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[o.jsx("img",{style:{width:l,height:l,minWidth:l,minHeight:l},src:pd(u),alt:u.meta.title}),o.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[o.jsxs(Y,{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(Jc(`${((S=u.bundleSource)==null?void 0:S.store)||u.meta.homepage}/blocklets/${u.meta.did}`,{allowDomains:null}),"_blank")},children:[u.meta.title,o.jsx(Y,{sx:{display:T?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),o.jsxs(Y,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[u.meta.version,o.jsx(Y,{className:"link-icon",icon:"fluent:open-20-filled",component:pt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),o.jsx(Y,{sx:{marginTop:0,opacity:.7},children:u.meta.description})]})]},u.meta.did)})})]})}Di.propTypes={meta:N.object,show:N.bool,onClose:N.func.isRequired,installRelated:N.func,components:N.array.isRequired,loading:N.bool.isRequired};Di.defaultProps={meta:null,show:!1,installRelated:!1};function md(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function gd(e){const{api:t}=_n(),[n]=Vl(),r=n.get("blocklet_meta_url")||md(e),[i,s]=M.useState([]),[a,c]=M.useState(!1);return M.useEffect(()=>{!r||e!=null&&e.inputUrl||(c(!0),t.getDynamicComponents({input:{url:r}}).then(f=>{s(f.components)}).finally(()=>{c(!1)}))},[r]),{components:i,loading:a}}function Mi({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:i}){const s=Hl(),{t:a,locale:c}=gt(),[f,v]=M.useState(!1),{components:l,loading:u}=gd(n),T=Js(n),y=r||(()=>{s(`/launch-blocklet/install${window.location.search}`)}),S=()=>{v(!0)},j=()=>{v(!1)};return o.jsxs(vd,{children:[o.jsx("div",{className:"app-content",children:o.jsx("div",{className:"agreement",children:o.jsx("div",{className:"agreement-content",children:T?o.jsx(Ai,{blockletMeta:{data:n},locale:c,handleDescEle:i}):o.jsx(Y,{sx:{p:3},children:o.jsx(ge,{children:a("launchBlocklet.dockerBlockletCantInstall")})})})})}),o.jsxs(Y,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[u?o.jsx(pt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,T&&t&&(l!=null&&l.length)?o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[o.jsx(wi,{sx:{mr:.5},checked:e,onChange:L=>t(L.currentTarget.checked),control:o.jsx(Ei,{}),label:o.jsx("span",{children:a("launchBlocklet.installRelatedComponents")})}),o.jsx(Y,{sx:{"> button svg":{color:"primary.main"}},children:o.jsx(js,{size:"small",onClick:S,children:o.jsx(pt,{icon:"octicon:package-dependencies-16"})})})]}):null,o.jsx("div",{className:"button-container","data-cy":"agree-all",children:T?o.jsx(_i,{onContinue:y,description:o.jsx(fd,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}}):null})]}),o.jsx(Di,{installRelated:e,meta:n,show:f,onClose:j,components:l,loading:u})]})}Mi.propTypes={meta:N.object.isRequired,onClickNext:N.func,handleDescEle:N.node,installRelated:N.bool,onChangeInstallRelated:N.func};Mi.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const vd=He.div`
114
114
  display: flex;
115
115
  flex-direction: column;
116
116
  align-items: center;
@@ -186,20 +186,20 @@ import{a8 as Ol,j as o,H as N,a9 as xt,ag as Ve,aa as Y,T as ge,v as qt,bs as wi
186
186
  padding-bottom: 16px;
187
187
  }
188
188
  }
189
- `;var oa={},Fi={exports:{}},sa={exports:{}},zn=sa.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-"+aa(e)}}},Uo={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:aa};Object.keys(zn).forEach(function(e){Object.keys(Uo).forEach(function(t){zn[e][t]||(zn[e][t]=Uo[t])}),zn[e].protocols_re=RegExp("^("+zn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function aa(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var la=sa.exports,Wo=la,Cn=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let i=r.length;for(;i--;)t[r[i]]=n[r[i]];return t},yd=Ye;function Ye(e,t,n,r,i,s,a){var c=this;c.type=e,Object.keys(Wo[e]).forEach(function(f){c[f]=Wo[e][f]}),c.user=t,c.auth=n,c.project=r,c.committish=i,c.default=s,c.opts=a||{}}Ye.prototype.hash=function(){return this.committish?"#"+this.committish:""};Ye.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(l){r[l]!=null&&n[l]==null&&(n[l]=r[l])});var i=n.auth,s=n.committish,a=n.fragment,c=n.path,f=n.project;Object.keys(n).forEach(function(l){var u=n[l];(l==="path"||l==="project")&&typeof u=="string"?n[l]=u.split("/").map(function(T){return encodeURIComponent(T)}).join("/"):l!=="domain"&&(n[l]=encodeURIComponent(u))}),n["auth@"]=i?i+"@":"",n["#fragment"]=a?"#"+this.hashformat(a):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=c?"#"+this.hashformat(c):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=s?"#"+s:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var v=e;return Object.keys(n).forEach(function(l){v=v.replace(new RegExp("[{]"+l+"[}]","g"),n[l])}),t.noGitPlus?v.replace(/^git[+]/,""):v}};Ye.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Ye.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Ye.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Cn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Ye.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Ye.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Ye.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Ye.prototype.git=function(e){return this._fill(this.gittemplate,e)};Ye.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Ye.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Ye.prototype.tarball=function(e){var t=Cn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Ye.prototype.file=function(e,t){return this._fill(this.filetemplate,Cn({path:e},t))};Ye.prototype.getDefaultRepresentation=function(){return this.default};Ye.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Br,zo;function bd(){return zo||(zo=1,Br=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Br}var xd=ve;ve.Node=pn;ve.create=ve;function ve(e){var t=this;if(t instanceof ve||(t=new ve),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}ve.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};ve.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};ve.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};ve.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Ed(this,arguments[e]);return this.length};ve.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Sd(this,arguments[e]);return this.length};ve.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};ve.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};ve.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};ve.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};ve.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};ve.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};ve.prototype.map=function(e,t){t=t||this;for(var n=new ve,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ve.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ve,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ve.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};ve.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};ve.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};ve.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};ve.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n};ve.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};ve.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var s=[],r=0;i&&r<t;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=wd(this,i,n[r]);return s};ve.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function wd(e,t,n){var r=t===e.head?new pn(n,null,t,e):new pn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function Ed(e,t){e.tail=new pn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Sd(e,t){e.head=new pn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function pn(e,t,n,r){if(!(this instanceof pn))return new pn(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{bd()(ve)}catch{}const Td=xd,hn=Symbol("max"),At=Symbol("length"),In=Symbol("lengthCalculator"),Vn=Symbol("allowStale"),fn=Symbol("maxAge"),Nt=Symbol("dispose"),qo=Symbol("noDisposeOnSet"),ze=Symbol("lruList"),yt=Symbol("cache"),ca=Symbol("updateAgeOnGet"),$r=()=>1;class jd{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[hn]=t.max||1/0;const n=t.length||$r;if(this[In]=typeof n!="function"?$r:n,this[Vn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[fn]=t.maxAge||0,this[Nt]=t.dispose,this[qo]=t.noDisposeOnSet||!1,this[ca]=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[hn]=t||1/0,qn(this)}get max(){return this[hn]}set allowStale(t){this[Vn]=!!t}get allowStale(){return this[Vn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[fn]=t,qn(this)}get maxAge(){return this[fn]}set lengthCalculator(t){typeof t!="function"&&(t=$r),t!==this[In]&&(this[In]=t,this[At]=0,this[ze].forEach(n=>{n.length=this[In](n.value,n.key),this[At]+=n.length})),qn(this)}get lengthCalculator(){return this[In]}get length(){return this[At]}get itemCount(){return this[ze].length}rforEach(t,n){n=n||this;for(let r=this[ze].tail;r!==null;){const i=r.prev;Ko(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[ze].head;r!==null;){const i=r.next;Ko(this,t,r,n),r=i}}keys(){return this[ze].toArray().map(t=>t.key)}values(){return this[ze].toArray().map(t=>t.value)}reset(){this[Nt]&&this[ze]&&this[ze].length&&this[ze].forEach(t=>this[Nt](t.key,t.value)),this[yt]=new Map,this[ze]=new Td,this[At]=0}dump(){return this[ze].map(t=>xr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ze]}set(t,n,r){if(r=r||this[fn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[In](n,t);if(this[yt].has(t)){if(s>this[hn])return Rn(this,this[yt].get(t)),!1;const f=this[yt].get(t).value;return this[Nt]&&(this[qo]||this[Nt](t,f.value)),f.now=i,f.maxAge=r,f.value=n,this[At]+=s-f.length,f.length=s,this.get(t),qn(this),!0}const a=new kd(t,n,s,i,r);return a.length>this[hn]?(this[Nt]&&this[Nt](t,n),!1):(this[At]+=a.length,this[ze].unshift(a),this[yt].set(t,this[ze].head),qn(this),!0)}has(t){if(!this[yt].has(t))return!1;const n=this[yt].get(t).value;return!xr(this,n)}get(t){return Ur(this,t,!0)}peek(t){return Ur(this,t,!1)}pop(){const t=this[ze].tail;return t?(Rn(this,t),t.value):null}del(t){Rn(this,this[yt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const a=s-n;a>0&&this.set(i.k,i.v,a)}}}prune(){this[yt].forEach((t,n)=>Ur(this,n,!1))}}const Ur=(e,t,n)=>{const r=e[yt].get(t);if(r){const i=r.value;if(xr(e,i)){if(Rn(e,r),!e[Vn])return}else n&&(e[ca]&&(r.value.now=Date.now()),e[ze].unshiftNode(r));return i.value}},xr=(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]},qn=e=>{if(e[At]>e[hn])for(let t=e[ze].tail;e[At]>e[hn]&&t!==null;){const n=t.prev;Rn(e,t),t=n}},Rn=(e,t)=>{if(t){const n=t.value;e[Nt]&&e[Nt](n.key,n.value),e[At]-=n.length,e[yt].delete(n.key),e[ze].removeNode(t)}};class kd{constructor(t,n,r,i,s){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Ko=(e,t,n,r)=>{let i=n.value;xr(e,i)&&(Rn(e,n),e[Vn]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var Od=jd,oi=Oc,Go=la,Id=Fi.exports=yd,Cd=Od,Wr=new Cd({max:1e3}),Rd={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Pd(e){return Rd[e]||e.slice(0,-1)}var _d={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Fi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Wr.has(n)||Wr.set(n,Ld(e,t)),Wr.get(n)}};function Ld(e,t){if(!(e==null||e==="")){var n=Ad(Nd(e)?"github:"+e:e),r=Dd(n),i=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),s=Object.keys(Go).map(function(a){try{var c=Go[a],f=null;r.auth&&_d[r.protocol]&&(f=r.auth);var v=r.hash?decodeURIComponent(r.hash.substr(1)):null,l=null,u=null,T=null;if(i&&i[1]===a)l=i[2]&&decodeURIComponent(i[2]),u=decodeURIComponent(i[3].replace(/\.git$/,"")),T="shortcut";else{if(r.host&&r.host!==c.domain&&r.host.replace(/^www[.]/,"")!==c.domain||!c.protocols_re.test(r.protocol)||!r.path)return;var y=c.pathmatch,S=r.path.match(y);if(!S)return;S[1]!==null&&S[1]!==void 0&&(l=decodeURIComponent(S[1].replace(/^:/,""))),u=decodeURIComponent(S[2]),T=Pd(r.protocol)}return new Id(a,l,f,u,v,T,t)}catch(j){if(!(j instanceof URIError))throw j}}).filter(function(a){return a});if(s.length===1)return s[0]}}function Nd(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Ad(e){var t=oi.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Dd(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=oi.parse(e);if(n.auth){const i=e.match(/[^@]+@[^:/]+/);if(i){var r=new oi.URL(i[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 Md=Fi.exports,mn={},te={},Fd=null;const Bd=Object.freeze(Object.defineProperty({__proto__:null,default:Fd},Symbol.toStringTag,{value:"Module"})),ua=ji(Bd),$d=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Ud=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Wd={charsWide:$d,charsFullWidth:Ud};const{charsWide:zd,charsFullWidth:qd}=Wd,da=new RegExp(`[${zd.join("")}${qd.join("")}]`,"g"),Kd=e=>e.replace(da,"xx").length;var Gd={default:Kd,charsRegex:da};/*!
189
+ `;var oa={},Fi={exports:{}},sa={exports:{}},zn=sa.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-"+aa(e)}}},Uo={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:aa};Object.keys(zn).forEach(function(e){Object.keys(Uo).forEach(function(t){zn[e][t]||(zn[e][t]=Uo[t])}),zn[e].protocols_re=RegExp("^("+zn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function aa(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var la=sa.exports,Wo=la,Cn=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let i=r.length;for(;i--;)t[r[i]]=n[r[i]];return t},yd=Ye;function Ye(e,t,n,r,i,s,a){var c=this;c.type=e,Object.keys(Wo[e]).forEach(function(f){c[f]=Wo[e][f]}),c.user=t,c.auth=n,c.project=r,c.committish=i,c.default=s,c.opts=a||{}}Ye.prototype.hash=function(){return this.committish?"#"+this.committish:""};Ye.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(l){r[l]!=null&&n[l]==null&&(n[l]=r[l])});var i=n.auth,s=n.committish,a=n.fragment,c=n.path,f=n.project;Object.keys(n).forEach(function(l){var u=n[l];(l==="path"||l==="project")&&typeof u=="string"?n[l]=u.split("/").map(function(T){return encodeURIComponent(T)}).join("/"):l!=="domain"&&(n[l]=encodeURIComponent(u))}),n["auth@"]=i?i+"@":"",n["#fragment"]=a?"#"+this.hashformat(a):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=c?"#"+this.hashformat(c):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=s?"#"+s:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var v=e;return Object.keys(n).forEach(function(l){v=v.replace(new RegExp("[{]"+l+"[}]","g"),n[l])}),t.noGitPlus?v.replace(/^git[+]/,""):v}};Ye.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Ye.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Ye.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Cn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Ye.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Ye.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Ye.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Ye.prototype.git=function(e){return this._fill(this.gittemplate,e)};Ye.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Ye.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Ye.prototype.tarball=function(e){var t=Cn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Ye.prototype.file=function(e,t){return this._fill(this.filetemplate,Cn({path:e},t))};Ye.prototype.getDefaultRepresentation=function(){return this.default};Ye.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var Br,zo;function bd(){return zo||(zo=1,Br=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),Br}var xd=ve;ve.Node=pn;ve.create=ve;function ve(e){var t=this;if(t instanceof ve||(t=new ve),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}ve.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};ve.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};ve.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};ve.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Ed(this,arguments[e]);return this.length};ve.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Sd(this,arguments[e]);return this.length};ve.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};ve.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};ve.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};ve.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};ve.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};ve.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};ve.prototype.map=function(e,t){t=t||this;for(var n=new ve,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ve.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ve,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ve.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};ve.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};ve.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};ve.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};ve.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n};ve.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ve;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};ve.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var s=[],r=0;i&&r<t;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=wd(this,i,n[r]);return s};ve.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function wd(e,t,n){var r=t===e.head?new pn(n,null,t,e):new pn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function Ed(e,t){e.tail=new pn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Sd(e,t){e.head=new pn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function pn(e,t,n,r){if(!(this instanceof pn))return new pn(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{bd()(ve)}catch{}const Td=xd,hn=Symbol("max"),At=Symbol("length"),In=Symbol("lengthCalculator"),Hn=Symbol("allowStale"),fn=Symbol("maxAge"),Nt=Symbol("dispose"),qo=Symbol("noDisposeOnSet"),ze=Symbol("lruList"),yt=Symbol("cache"),ca=Symbol("updateAgeOnGet"),$r=()=>1;class jd{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[hn]=t.max||1/0;const n=t.length||$r;if(this[In]=typeof n!="function"?$r:n,this[Hn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[fn]=t.maxAge||0,this[Nt]=t.dispose,this[qo]=t.noDisposeOnSet||!1,this[ca]=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[hn]=t||1/0,qn(this)}get max(){return this[hn]}set allowStale(t){this[Hn]=!!t}get allowStale(){return this[Hn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[fn]=t,qn(this)}get maxAge(){return this[fn]}set lengthCalculator(t){typeof t!="function"&&(t=$r),t!==this[In]&&(this[In]=t,this[At]=0,this[ze].forEach(n=>{n.length=this[In](n.value,n.key),this[At]+=n.length})),qn(this)}get lengthCalculator(){return this[In]}get length(){return this[At]}get itemCount(){return this[ze].length}rforEach(t,n){n=n||this;for(let r=this[ze].tail;r!==null;){const i=r.prev;Ko(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[ze].head;r!==null;){const i=r.next;Ko(this,t,r,n),r=i}}keys(){return this[ze].toArray().map(t=>t.key)}values(){return this[ze].toArray().map(t=>t.value)}reset(){this[Nt]&&this[ze]&&this[ze].length&&this[ze].forEach(t=>this[Nt](t.key,t.value)),this[yt]=new Map,this[ze]=new Td,this[At]=0}dump(){return this[ze].map(t=>xr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ze]}set(t,n,r){if(r=r||this[fn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[In](n,t);if(this[yt].has(t)){if(s>this[hn])return Rn(this,this[yt].get(t)),!1;const f=this[yt].get(t).value;return this[Nt]&&(this[qo]||this[Nt](t,f.value)),f.now=i,f.maxAge=r,f.value=n,this[At]+=s-f.length,f.length=s,this.get(t),qn(this),!0}const a=new kd(t,n,s,i,r);return a.length>this[hn]?(this[Nt]&&this[Nt](t,n),!1):(this[At]+=a.length,this[ze].unshift(a),this[yt].set(t,this[ze].head),qn(this),!0)}has(t){if(!this[yt].has(t))return!1;const n=this[yt].get(t).value;return!xr(this,n)}get(t){return Ur(this,t,!0)}peek(t){return Ur(this,t,!1)}pop(){const t=this[ze].tail;return t?(Rn(this,t),t.value):null}del(t){Rn(this,this[yt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const a=s-n;a>0&&this.set(i.k,i.v,a)}}}prune(){this[yt].forEach((t,n)=>Ur(this,n,!1))}}const Ur=(e,t,n)=>{const r=e[yt].get(t);if(r){const i=r.value;if(xr(e,i)){if(Rn(e,r),!e[Hn])return}else n&&(e[ca]&&(r.value.now=Date.now()),e[ze].unshiftNode(r));return i.value}},xr=(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]},qn=e=>{if(e[At]>e[hn])for(let t=e[ze].tail;e[At]>e[hn]&&t!==null;){const n=t.prev;Rn(e,t),t=n}},Rn=(e,t)=>{if(t){const n=t.value;e[Nt]&&e[Nt](n.key,n.value),e[At]-=n.length,e[yt].delete(n.key),e[ze].removeNode(t)}};class kd{constructor(t,n,r,i,s){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Ko=(e,t,n,r)=>{let i=n.value;xr(e,i)&&(Rn(e,n),e[Hn]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var Od=jd,oi=Oc,Go=la,Id=Fi.exports=yd,Cd=Od,Wr=new Cd({max:1e3}),Rd={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Pd(e){return Rd[e]||e.slice(0,-1)}var _d={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Fi.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Wr.has(n)||Wr.set(n,Ld(e,t)),Wr.get(n)}};function Ld(e,t){if(!(e==null||e==="")){var n=Ad(Nd(e)?"github:"+e:e),r=Dd(n),i=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),s=Object.keys(Go).map(function(a){try{var c=Go[a],f=null;r.auth&&_d[r.protocol]&&(f=r.auth);var v=r.hash?decodeURIComponent(r.hash.substr(1)):null,l=null,u=null,T=null;if(i&&i[1]===a)l=i[2]&&decodeURIComponent(i[2]),u=decodeURIComponent(i[3].replace(/\.git$/,"")),T="shortcut";else{if(r.host&&r.host!==c.domain&&r.host.replace(/^www[.]/,"")!==c.domain||!c.protocols_re.test(r.protocol)||!r.path)return;var y=c.pathmatch,S=r.path.match(y);if(!S)return;S[1]!==null&&S[1]!==void 0&&(l=decodeURIComponent(S[1].replace(/^:/,""))),u=decodeURIComponent(S[2]),T=Pd(r.protocol)}return new Id(a,l,f,u,v,T,t)}catch(j){if(!(j instanceof URIError))throw j}}).filter(function(a){return a});if(s.length===1)return s[0]}}function Nd(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Ad(e){var t=oi.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function Dd(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=oi.parse(e);if(n.auth){const i=e.match(/[^@]+@[^:/]+/);if(i){var r=new oi.URL(i[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 Md=Fi.exports,mn={},te={},Fd=null;const Bd=Object.freeze(Object.defineProperty({__proto__:null,default:Fd},Symbol.toStringTag,{value:"Module"})),ua=ji(Bd),$d=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Ud=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Wd={charsWide:$d,charsFullWidth:Ud};const{charsWide:zd,charsFullWidth:qd}=Wd,da=new RegExp(`[${zd.join("")}${qd.join("")}]`,"g"),Kd=e=>e.replace(da,"xx").length;var Gd={default:Kd,charsRegex:da};/*!
190
190
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
191
191
  *
192
192
  * Copyright (c) 2014-2016, Jon Schlinkert.
193
193
  * Licensed under the MIT License.
194
- */var Hd=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
194
+ */var Vd=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
195
195
  * is-glob <https://github.com/jonschlinkert/is-glob>
196
196
  *
197
197
  * Copyright (c) 2014-2017, Jon Schlinkert.
198
198
  * Released under the MIT License.
199
- */var Vd=Hd,ha={"{":"}","(":")","[":"]"},Xd=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,i=-2,s=-2,a=-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&&(a===-1||a>r||(a=e.indexOf("\\",t),a===-1||a>r)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(a=e.indexOf("\\",t),a===-1||a>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(a=e.indexOf("\\",t),a===-1||a>s))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(s=e.indexOf(")",n),s>n&&(a=e.indexOf("\\",n),a===-1||a>s))))return!0;if(e[t]==="\\"){var c=e[t+1];t+=2;var f=ha[c];if(f){var v=e.indexOf(f,t);v!==-1&&(t=v+1)}if(e[t]==="!")return!0}else t++}return!1},Yd=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=ha[n];if(r){var i=e.indexOf(r,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1},Qd=function(t,n){if(typeof t!="string"||t==="")return!1;if(Vd(t))return!0;var r=Xd;return n&&n.strict===!1&&(r=Yd),r(t)},si={exports:{}};(function(e,t){var n={};t=e.exports=$;var r;typeof gc=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var d=Array.prototype.slice.call(arguments,0);d.unshift("SEMVER"),console.log.apply(console,d)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=16,c=i-6,f=t.re=[],v=t.safeRe=[],l=t.src=[],u=t.tokens={},T=0;function y(d){u[d]=T++}var S="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",i],[S,c]];function L(d){for(var x=0;x<j.length;x++){var w=j[x][0],P=j[x][1];d=d.split(w+"*").join(w+"{0,"+P+"}").split(w+"+").join(w+"{1,"+P+"}")}return d}y("NUMERICIDENTIFIER"),l[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",y("NUMERICIDENTIFIERLOOSE"),l[u.NUMERICIDENTIFIERLOOSE]="\\d+",y("NONNUMERICIDENTIFIER"),l[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",y("MAINVERSION"),l[u.MAINVERSION]="("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")",y("MAINVERSIONLOOSE"),l[u.MAINVERSIONLOOSE]="("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")",y("PRERELEASEIDENTIFIER"),l[u.PRERELEASEIDENTIFIER]="(?:"+l[u.NUMERICIDENTIFIER]+"|"+l[u.NONNUMERICIDENTIFIER]+")",y("PRERELEASEIDENTIFIERLOOSE"),l[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[u.NUMERICIDENTIFIERLOOSE]+"|"+l[u.NONNUMERICIDENTIFIER]+")",y("PRERELEASE"),l[u.PRERELEASE]="(?:-("+l[u.PRERELEASEIDENTIFIER]+"(?:\\."+l[u.PRERELEASEIDENTIFIER]+")*))",y("PRERELEASELOOSE"),l[u.PRERELEASELOOSE]="(?:-?("+l[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[u.PRERELEASEIDENTIFIERLOOSE]+")*))",y("BUILDIDENTIFIER"),l[u.BUILDIDENTIFIER]=S+"+",y("BUILD"),l[u.BUILD]="(?:\\+("+l[u.BUILDIDENTIFIER]+"(?:\\."+l[u.BUILDIDENTIFIER]+")*))",y("FULL"),y("FULLPLAIN"),l[u.FULLPLAIN]="v?"+l[u.MAINVERSION]+l[u.PRERELEASE]+"?"+l[u.BUILD]+"?",l[u.FULL]="^"+l[u.FULLPLAIN]+"$",y("LOOSEPLAIN"),l[u.LOOSEPLAIN]="[v=\\s]*"+l[u.MAINVERSIONLOOSE]+l[u.PRERELEASELOOSE]+"?"+l[u.BUILD]+"?",y("LOOSE"),l[u.LOOSE]="^"+l[u.LOOSEPLAIN]+"$",y("GTLT"),l[u.GTLT]="((?:<|>)?=?)",y("XRANGEIDENTIFIERLOOSE"),l[u.XRANGEIDENTIFIERLOOSE]=l[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",y("XRANGEIDENTIFIER"),l[u.XRANGEIDENTIFIER]=l[u.NUMERICIDENTIFIER]+"|x|X|\\*",y("XRANGEPLAIN"),l[u.XRANGEPLAIN]="[v=\\s]*("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:"+l[u.PRERELEASE]+")?"+l[u.BUILD]+"?)?)?",y("XRANGEPLAINLOOSE"),l[u.XRANGEPLAINLOOSE]="[v=\\s]*("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:"+l[u.PRERELEASELOOSE]+")?"+l[u.BUILD]+"?)?)?",y("XRANGE"),l[u.XRANGE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAIN]+"$",y("XRANGELOOSE"),l[u.XRANGELOOSE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAINLOOSE]+"$",y("COERCE"),l[u.COERCE]="(^|[^\\d])(\\d{1,"+a+"})(?:\\.(\\d{1,"+a+"}))?(?:\\.(\\d{1,"+a+"}))?(?:$|[^\\d])",y("COERCERTL"),f[u.COERCERTL]=new RegExp(l[u.COERCE],"g"),v[u.COERCERTL]=new RegExp(L(l[u.COERCE]),"g"),y("LONETILDE"),l[u.LONETILDE]="(?:~>?)",y("TILDETRIM"),l[u.TILDETRIM]="(\\s*)"+l[u.LONETILDE]+"\\s+",f[u.TILDETRIM]=new RegExp(l[u.TILDETRIM],"g"),v[u.TILDETRIM]=new RegExp(L(l[u.TILDETRIM]),"g");var D="$1~";y("TILDE"),l[u.TILDE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAIN]+"$",y("TILDELOOSE"),l[u.TILDELOOSE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAINLOOSE]+"$",y("LONECARET"),l[u.LONECARET]="(?:\\^)",y("CARETTRIM"),l[u.CARETTRIM]="(\\s*)"+l[u.LONECARET]+"\\s+",f[u.CARETTRIM]=new RegExp(l[u.CARETTRIM],"g"),v[u.CARETTRIM]=new RegExp(L(l[u.CARETTRIM]),"g");var A="$1^";y("CARET"),l[u.CARET]="^"+l[u.LONECARET]+l[u.XRANGEPLAIN]+"$",y("CARETLOOSE"),l[u.CARETLOOSE]="^"+l[u.LONECARET]+l[u.XRANGEPLAINLOOSE]+"$",y("COMPARATORLOOSE"),l[u.COMPARATORLOOSE]="^"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+")$|^$",y("COMPARATOR"),l[u.COMPARATOR]="^"+l[u.GTLT]+"\\s*("+l[u.FULLPLAIN]+")$|^$",y("COMPARATORTRIM"),l[u.COMPARATORTRIM]="(\\s*)"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+"|"+l[u.XRANGEPLAIN]+")",f[u.COMPARATORTRIM]=new RegExp(l[u.COMPARATORTRIM],"g"),v[u.COMPARATORTRIM]=new RegExp(L(l[u.COMPARATORTRIM]),"g");var B="$1$2$3";y("HYPHENRANGE"),l[u.HYPHENRANGE]="^\\s*("+l[u.XRANGEPLAIN]+")\\s+-\\s+("+l[u.XRANGEPLAIN]+")\\s*$",y("HYPHENRANGELOOSE"),l[u.HYPHENRANGELOOSE]="^\\s*("+l[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+l[u.XRANGEPLAINLOOSE]+")\\s*$",y("STAR"),l[u.STAR]="(<|>)?=?\\s*\\*";for(var G=0;G<T;G++)r(G,l[G]),f[G]||(f[G]=new RegExp(l[G]),v[G]=new RegExp(L(l[G])));t.parse=I;function I(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $)return d;if(typeof d!="string"||d.length>i)return null;var w=x.loose?v[u.LOOSE]:v[u.FULL];if(!w.test(d))return null;try{return new $(d,x)}catch{return null}}t.valid=F;function F(d,x){var w=I(d,x);return w?w.version:null}t.clean=H;function H(d,x){var w=I(d.trim().replace(/^[=v]+/,""),x);return w?w.version:null}t.SemVer=$;function $(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $){if(d.loose===x.loose)return d;d=d.version}else if(typeof d!="string")throw new TypeError("Invalid Version: "+d);if(d.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof $))return new $(d,x);r("SemVer",d,x),this.options=x,this.loose=!!x.loose;var w=d.trim().match(x.loose?v[u.LOOSE]:v[u.FULL]);if(!w)throw new TypeError("Invalid Version: "+d);if(this.raw=d,this.major=+w[1],this.minor=+w[2],this.patch=+w[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");w[4]?this.prerelease=w[4].split(".").map(function(P){if(/^[0-9]+$/.test(P)){var O=+P;if(O>=0&&O<s)return O}return P}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(d){return r("SemVer.compare",this.version,this.options,d),d instanceof $||(d=new $(d,this.options)),this.compareMain(d)||this.comparePre(d)},$.prototype.compareMain=function(d){return d instanceof $||(d=new $(d,this.options)),je(this.major,d.major)||je(this.minor,d.minor)||je(this.patch,d.patch)},$.prototype.comparePre=function(d){if(d instanceof $||(d=new $(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;var x=0;do{var w=this.prerelease[x],P=d.prerelease[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.compareBuild=function(d){d instanceof $||(d=new $(d,this.options));var x=0;do{var w=this.build[x],P=d.build[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.inc=function(d,x){switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",x),this.inc("pre",x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",x),this.inc("pre",x);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)}x&&(this.prerelease[0]===x?isNaN(this.prerelease[1])&&(this.prerelease=[x,0]):this.prerelease=[x,0]);break;default:throw new Error("invalid increment argument: "+d)}return this.format(),this.raw=this.version,this},t.inc=le;function le(d,x,w,P){typeof w=="string"&&(P=w,w=void 0);try{return new $(d,w).inc(x,P).version}catch{return null}}t.diff=V;function V(d,x){if(Ht(d,x))return null;var w=I(d),P=I(x),O="";if(w.prerelease.length||P.prerelease.length){O="pre";var _="prerelease"}for(var W in w)if((W==="major"||W==="minor"||W==="patch")&&w[W]!==P[W])return O+W;return _}t.compareIdentifiers=je;var se=/^[0-9]+$/;function je(d,x){var w=se.test(d),P=se.test(x);return w&&P&&(d=+d,x=+x),d===x?0:w&&!P?-1:P&&!w?1:d<x?-1:1}t.rcompareIdentifiers=We;function We(d,x){return je(x,d)}t.major=Me;function Me(d,x){return new $(d,x).major}t.minor=Qe;function Qe(d,x){return new $(d,x).minor}t.patch=Z;function Z(d,x){return new $(d,x).patch}t.compare=pe;function pe(d,x,w){return new $(d,w).compare(new $(x,w))}t.compareLoose=ee;function ee(d,x){return pe(d,x,!0)}t.compareBuild=ye;function ye(d,x,w){var P=new $(d,w),O=new $(x,w);return P.compare(O)||P.compareBuild(O)}t.rcompare=oe;function oe(d,x,w){return pe(x,d,w)}t.sort=Ae;function Ae(d,x){return d.sort(function(w,P){return t.compareBuild(w,P,x)})}t.rsort=we;function we(d,x){return d.sort(function(w,P){return t.compareBuild(P,w,x)})}t.gt=Je;function Je(d,x,w){return pe(d,x,w)>0}t.lt=qe;function qe(d,x,w){return pe(d,x,w)<0}t.eq=Ht;function Ht(d,x,w){return pe(d,x,w)===0}t.neq=Vt;function Vt(d,x,w){return pe(d,x,w)!==0}t.gte=Ft;function Ft(d,x,w){return pe(d,x,w)>=0}t.lte=Xt;function Xt(d,x,w){return pe(d,x,w)<=0}t.cmp=Pe;function Pe(d,x,w,P){switch(x){case"===":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d===w;case"!==":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d!==w;case"":case"=":case"==":return Ht(d,w,P);case"!=":return Vt(d,w,P);case">":return Je(d,w,P);case">=":return Ft(d,w,P);case"<":return qe(d,w,P);case"<=":return Xt(d,w,P);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=_e;function _e(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof _e){if(d.loose===!!x.loose)return d;d=d.value}if(!(this instanceof _e))return new _e(d,x);d=d.trim().split(/\s+/).join(" "),r("comparator",d,x),this.options=x,this.loose=!!x.loose,this.parse(d),this.semver===Ze?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Ze={};_e.prototype.parse=function(d){var x=this.options.loose?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],w=d.match(x);if(!w)throw new TypeError("Invalid comparator: "+d);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new $(w[2],this.options.loose):this.semver=Ze},_e.prototype.toString=function(){return this.value},_e.prototype.test=function(d){if(r("Comparator.test",d,this.options.loose),this.semver===Ze||d===Ze)return!0;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}return Pe(d,this.operator,this.semver,this.options)},_e.prototype.intersects=function(d,x){if(!(d instanceof _e))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new de(d.value,x),ot(this.value,w,x));if(d.operator==="")return d.value===""?!0:(w=new de(this.value,x),ot(d.semver,w,x));var P=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),O=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),_=this.semver.version===d.semver.version,W=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),ne=Pe(this.semver,"<",d.semver,x)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),ae=Pe(this.semver,">",d.semver,x)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return P||O||_&&W||ne||ae},t.Range=de;function de(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof de)return d.loose===!!x.loose&&d.includePrerelease===!!x.includePrerelease?d:new de(d.raw,x);if(d instanceof _e)return new de(d.value,x);if(!(this instanceof de))return new de(d,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=d.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()}de.prototype.format=function(){return this.range=this.set.map(function(d){return d.join(" ").trim()}).join("||").trim(),this.range},de.prototype.toString=function(){return this.range},de.prototype.parseRange=function(d){var x=this.options.loose,w=x?v[u.HYPHENRANGELOOSE]:v[u.HYPHENRANGE];d=d.replace(w,tt),r("hyphen replace",d),d=d.replace(v[u.COMPARATORTRIM],B),r("comparator trim",d,v[u.COMPARATORTRIM]),d=d.replace(v[u.TILDETRIM],D),d=d.replace(v[u.CARETTRIM],A),d=d.split(/\s+/).join(" ");var P=x?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],O=d.split(" ").map(function(_){return Jt(_,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(O=O.filter(function(_){return!!_.match(P)})),O=O.map(function(_){return new _e(_,this.options)},this),O},de.prototype.intersects=function(d,x){if(!(d instanceof de))throw new TypeError("a Range is required");return this.set.some(function(w){return Yt(w,x)&&d.set.some(function(P){return Yt(P,x)&&w.every(function(O){return P.every(function(_){return O.intersects(_,x)})})})})};function Yt(d,x){for(var w=!0,P=d.slice(),O=P.pop();w&&P.length;)w=P.every(function(_){return O.intersects(_,x)}),O=P.pop();return w}t.toComparators=Qt;function Qt(d,x){return new de(d,x).set.map(function(w){return w.map(function(P){return P.value}).join(" ").trim().split(" ")})}function Jt(d,x){return r("comp",d,x),d=et(d,x),r("caret",d),d=Bt(d,x),r("tildes",d),d=en(d,x),r("xrange",d),d=Fe(d,x),r("stars",d),d}function ke(d){return!d||d.toLowerCase()==="x"||d==="*"}function Bt(d,x){return d.trim().split(/\s+/).map(function(w){return Nn(w,x)}).join(" ")}function Nn(d,x){var w=x.loose?v[u.TILDELOOSE]:v[u.TILDE];return d.replace(w,function(P,O,_,W,ne){r("tilde",d,P,O,_,W,ne);var ae;return ke(O)?ae="":ke(_)?ae=">="+O+".0.0 <"+(+O+1)+".0.0":ke(W)?ae=">="+O+"."+_+".0 <"+O+"."+(+_+1)+".0":ne?(r("replaceTilde pr",ne),ae=">="+O+"."+_+"."+W+"-"+ne+" <"+O+"."+(+_+1)+".0"):ae=">="+O+"."+_+"."+W+" <"+O+"."+(+_+1)+".0",r("tilde return",ae),ae})}function et(d,x){return d.trim().split(/\s+/).map(function(w){return Zt(w,x)}).join(" ")}function Zt(d,x){r("caret",d,x);var w=x.loose?v[u.CARETLOOSE]:v[u.CARET];return d.replace(w,function(P,O,_,W,ne){r("caret",d,P,O,_,W,ne);var ae;return ke(O)?ae="":ke(_)?ae=">="+O+".0.0 <"+(+O+1)+".0.0":ke(W)?O==="0"?ae=">="+O+"."+_+".0 <"+O+"."+(+_+1)+".0":ae=">="+O+"."+_+".0 <"+(+O+1)+".0.0":ne?(r("replaceCaret pr",ne),O==="0"?_==="0"?ae=">="+O+"."+_+"."+W+"-"+ne+" <"+O+"."+_+"."+(+W+1):ae=">="+O+"."+_+"."+W+"-"+ne+" <"+O+"."+(+_+1)+".0":ae=">="+O+"."+_+"."+W+"-"+ne+" <"+(+O+1)+".0.0"):(r("no pr"),O==="0"?_==="0"?ae=">="+O+"."+_+"."+W+" <"+O+"."+_+"."+(+W+1):ae=">="+O+"."+_+"."+W+" <"+O+"."+(+_+1)+".0":ae=">="+O+"."+_+"."+W+" <"+(+O+1)+".0.0"),r("caret return",ae),ae})}function en(d,x){return r("replaceXRanges",d,x),d.split(/\s+/).map(function(w){return tn(w,x)}).join(" ")}function tn(d,x){d=d.trim();var w=x.loose?v[u.XRANGELOOSE]:v[u.XRANGE];return d.replace(w,function(P,O,_,W,ne,ae){r("xRange",d,P,O,_,W,ne,ae);var Be=ke(_),Ne=Be||ke(W),Ee=Ne||ke(ne),Te=Ee;return O==="="&&Te&&(O=""),ae=x.includePrerelease?"-0":"",Be?O===">"||O==="<"?P="<0.0.0-0":P="*":O&&Te?(Ne&&(W=0),ne=0,O===">"?(O=">=",Ne?(_=+_+1,W=0,ne=0):(W=+W+1,ne=0)):O==="<="&&(O="<",Ne?_=+_+1:W=+W+1),P=O+_+"."+W+"."+ne+ae):Ne?P=">="+_+".0.0"+ae+" <"+(+_+1)+".0.0"+ae:Ee&&(P=">="+_+"."+W+".0"+ae+" <"+_+"."+(+W+1)+".0"+ae),r("xRange return",P),P})}function Fe(d,x){return r("replaceStars",d,x),d.trim().replace(v[u.STAR],"")}function tt(d,x,w,P,O,_,W,ne,ae,Be,Ne,Ee,Te){return ke(w)?x="":ke(P)?x=">="+w+".0.0":ke(O)?x=">="+w+"."+P+".0":x=">="+x,ke(ae)?ne="":ke(Be)?ne="<"+(+ae+1)+".0.0":ke(Ne)?ne="<"+ae+"."+(+Be+1)+".0":Ee?ne="<="+ae+"."+Be+"."+Ne+"-"+Ee:ne="<="+ne,(x+" "+ne).trim()}de.prototype.test=function(d){if(!d)return!1;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(wt(this.set[x],d,this.options))return!0;return!1};function wt(d,x,w){for(var P=0;P<d.length;P++)if(!d[P].test(x))return!1;if(x.prerelease.length&&!w.includePrerelease){for(P=0;P<d.length;P++)if(r(d[P].semver),d[P].semver!==Ze&&d[P].semver.prerelease.length>0){var O=d[P].semver;if(O.major===x.major&&O.minor===x.minor&&O.patch===x.patch)return!0}return!1}return!0}t.satisfies=ot;function ot(d,x,w){try{x=new de(x,w)}catch{return!1}return x.test(d)}t.maxSatisfying=Et;function Et(d,x,w){var P=null,O=null;try{var _=new de(x,w)}catch{return null}return d.forEach(function(W){_.test(W)&&(!P||O.compare(W)===-1)&&(P=W,O=new $(P,w))}),P}t.minSatisfying=It;function It(d,x,w){var P=null,O=null;try{var _=new de(x,w)}catch{return null}return d.forEach(function(W){_.test(W)&&(!P||O.compare(W)===1)&&(P=W,O=new $(P,w))}),P}t.minVersion=Ke;function Ke(d,x){d=new de(d,x);var w=new $("0.0.0");if(d.test(w)||(w=new $("0.0.0-0"),d.test(w)))return w;w=null;for(var P=0;P<d.set.length;++P){var O=d.set[P];O.forEach(function(_){var W=new $(_.semver.version);switch(_.operator){case">":W.prerelease.length===0?W.patch++:W.prerelease.push(0),W.raw=W.format();case"":case">=":(!w||Je(w,W))&&(w=W);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+_.operator)}})}return w&&d.test(w)?w:null}t.validRange=xn;function xn(d,x){try{return new de(d,x).range||"*"}catch{return null}}t.ltr=nn;function nn(d,x,w){return R(d,x,"<",w)}t.gtr=wn;function wn(d,x,w){return R(d,x,">",w)}t.outside=R;function R(d,x,w,P){d=new $(d,P),x=new de(x,P);var O,_,W,ne,ae;switch(w){case">":O=Je,_=Xt,W=qe,ne=">",ae=">=";break;case"<":O=qe,_=Ft,W=Je,ne="<",ae="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ot(d,x,P))return!1;for(var Be=0;Be<x.set.length;++Be){var Ne=x.set[Be],Ee=null,Te=null;if(Ne.forEach(function(Xe){Xe.semver===Ze&&(Xe=new _e(">=0.0.0")),Ee=Ee||Xe,Te=Te||Xe,O(Xe.semver,Ee.semver,P)?Ee=Xe:W(Xe.semver,Te.semver,P)&&(Te=Xe)}),Ee.operator===ne||Ee.operator===ae||(!Te.operator||Te.operator===ne)&&_(d,Te.semver))return!1;if(Te.operator===ae&&W(d,Te.semver))return!1}return!0}t.prerelease=St;function St(d,x){var w=I(d,x);return w&&w.prerelease.length?w.prerelease:null}t.intersects=Ct;function Ct(d,x,w){return d=new de(d,w),x=new de(x,w),d.intersects(x)}t.coerce=rn;function rn(d,x){if(d instanceof $)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;x=x||{};var w=null;if(!x.rtl)w=d.match(v[u.COERCE]);else{for(var P;(P=v[u.COERCERTL].exec(d))&&(!w||w.index+w[0].length!==d.length);)(!w||P.index+P[0].length!==w.index+w[0].length)&&(w=P),v[u.COERCERTL].lastIndex=P.index+P[1].length+P[2].length;v[u.COERCERTL].lastIndex=-1}return w===null?null:I(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),x)}})(si,si.exports);var Jd=si.exports;const fa=As,Ot=Jd,Ue="semver",Zd={base:fa.string(),type:"semverRange",validate:function(e,{error:t}){return Ot.validRange(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver range"}},bn={};bn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{exp:n})},args:[{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});bn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Ot.cmp(e,n,r)?e:t.error(`${Ue}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};bn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{rng:n})},args:[{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});bn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Ot.outside(e,r,n)?e:t.error(`${Ue}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};const eh={base:fa.string(),type:"semver",validate:function(e,{error:t}){return Ot.valid(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Ue}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Ue}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Ue}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Ue}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Ue}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Ue}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Ue}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Ue}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Ue}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Ue}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Ue}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:bn};var th={semver:eh,semverRange:Zd};/*!
199
+ */var Hd=Vd,ha={"{":"}","(":")","[":"]"},Xd=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,i=-2,s=-2,a=-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&&(a===-1||a>r||(a=e.indexOf("\\",t),a===-1||a>r)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(a=e.indexOf("\\",t),a===-1||a>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(a=e.indexOf("\\",t),a===-1||a>s))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(s=e.indexOf(")",n),s>n&&(a=e.indexOf("\\",n),a===-1||a>s))))return!0;if(e[t]==="\\"){var c=e[t+1];t+=2;var f=ha[c];if(f){var v=e.indexOf(f,t);v!==-1&&(t=v+1)}if(e[t]==="!")return!0}else t++}return!1},Yd=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=ha[n];if(r){var i=e.indexOf(r,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1},Qd=function(t,n){if(typeof t!="string"||t==="")return!1;if(Hd(t))return!0;var r=Xd;return n&&n.strict===!1&&(r=Yd),r(t)},si={exports:{}};(function(e,t){var n={};t=e.exports=$;var r;typeof gc=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var d=Array.prototype.slice.call(arguments,0);d.unshift("SEMVER"),console.log.apply(console,d)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=16,c=i-6,f=t.re=[],v=t.safeRe=[],l=t.src=[],u=t.tokens={},T=0;function y(d){u[d]=T++}var S="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",i],[S,c]];function L(d){for(var x=0;x<j.length;x++){var w=j[x][0],P=j[x][1];d=d.split(w+"*").join(w+"{0,"+P+"}").split(w+"+").join(w+"{1,"+P+"}")}return d}y("NUMERICIDENTIFIER"),l[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",y("NUMERICIDENTIFIERLOOSE"),l[u.NUMERICIDENTIFIERLOOSE]="\\d+",y("NONNUMERICIDENTIFIER"),l[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+S+"*",y("MAINVERSION"),l[u.MAINVERSION]="("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")",y("MAINVERSIONLOOSE"),l[u.MAINVERSIONLOOSE]="("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")",y("PRERELEASEIDENTIFIER"),l[u.PRERELEASEIDENTIFIER]="(?:"+l[u.NUMERICIDENTIFIER]+"|"+l[u.NONNUMERICIDENTIFIER]+")",y("PRERELEASEIDENTIFIERLOOSE"),l[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[u.NUMERICIDENTIFIERLOOSE]+"|"+l[u.NONNUMERICIDENTIFIER]+")",y("PRERELEASE"),l[u.PRERELEASE]="(?:-("+l[u.PRERELEASEIDENTIFIER]+"(?:\\."+l[u.PRERELEASEIDENTIFIER]+")*))",y("PRERELEASELOOSE"),l[u.PRERELEASELOOSE]="(?:-?("+l[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[u.PRERELEASEIDENTIFIERLOOSE]+")*))",y("BUILDIDENTIFIER"),l[u.BUILDIDENTIFIER]=S+"+",y("BUILD"),l[u.BUILD]="(?:\\+("+l[u.BUILDIDENTIFIER]+"(?:\\."+l[u.BUILDIDENTIFIER]+")*))",y("FULL"),y("FULLPLAIN"),l[u.FULLPLAIN]="v?"+l[u.MAINVERSION]+l[u.PRERELEASE]+"?"+l[u.BUILD]+"?",l[u.FULL]="^"+l[u.FULLPLAIN]+"$",y("LOOSEPLAIN"),l[u.LOOSEPLAIN]="[v=\\s]*"+l[u.MAINVERSIONLOOSE]+l[u.PRERELEASELOOSE]+"?"+l[u.BUILD]+"?",y("LOOSE"),l[u.LOOSE]="^"+l[u.LOOSEPLAIN]+"$",y("GTLT"),l[u.GTLT]="((?:<|>)?=?)",y("XRANGEIDENTIFIERLOOSE"),l[u.XRANGEIDENTIFIERLOOSE]=l[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",y("XRANGEIDENTIFIER"),l[u.XRANGEIDENTIFIER]=l[u.NUMERICIDENTIFIER]+"|x|X|\\*",y("XRANGEPLAIN"),l[u.XRANGEPLAIN]="[v=\\s]*("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:"+l[u.PRERELEASE]+")?"+l[u.BUILD]+"?)?)?",y("XRANGEPLAINLOOSE"),l[u.XRANGEPLAINLOOSE]="[v=\\s]*("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:"+l[u.PRERELEASELOOSE]+")?"+l[u.BUILD]+"?)?)?",y("XRANGE"),l[u.XRANGE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAIN]+"$",y("XRANGELOOSE"),l[u.XRANGELOOSE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAINLOOSE]+"$",y("COERCE"),l[u.COERCE]="(^|[^\\d])(\\d{1,"+a+"})(?:\\.(\\d{1,"+a+"}))?(?:\\.(\\d{1,"+a+"}))?(?:$|[^\\d])",y("COERCERTL"),f[u.COERCERTL]=new RegExp(l[u.COERCE],"g"),v[u.COERCERTL]=new RegExp(L(l[u.COERCE]),"g"),y("LONETILDE"),l[u.LONETILDE]="(?:~>?)",y("TILDETRIM"),l[u.TILDETRIM]="(\\s*)"+l[u.LONETILDE]+"\\s+",f[u.TILDETRIM]=new RegExp(l[u.TILDETRIM],"g"),v[u.TILDETRIM]=new RegExp(L(l[u.TILDETRIM]),"g");var D="$1~";y("TILDE"),l[u.TILDE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAIN]+"$",y("TILDELOOSE"),l[u.TILDELOOSE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAINLOOSE]+"$",y("LONECARET"),l[u.LONECARET]="(?:\\^)",y("CARETTRIM"),l[u.CARETTRIM]="(\\s*)"+l[u.LONECARET]+"\\s+",f[u.CARETTRIM]=new RegExp(l[u.CARETTRIM],"g"),v[u.CARETTRIM]=new RegExp(L(l[u.CARETTRIM]),"g");var A="$1^";y("CARET"),l[u.CARET]="^"+l[u.LONECARET]+l[u.XRANGEPLAIN]+"$",y("CARETLOOSE"),l[u.CARETLOOSE]="^"+l[u.LONECARET]+l[u.XRANGEPLAINLOOSE]+"$",y("COMPARATORLOOSE"),l[u.COMPARATORLOOSE]="^"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+")$|^$",y("COMPARATOR"),l[u.COMPARATOR]="^"+l[u.GTLT]+"\\s*("+l[u.FULLPLAIN]+")$|^$",y("COMPARATORTRIM"),l[u.COMPARATORTRIM]="(\\s*)"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+"|"+l[u.XRANGEPLAIN]+")",f[u.COMPARATORTRIM]=new RegExp(l[u.COMPARATORTRIM],"g"),v[u.COMPARATORTRIM]=new RegExp(L(l[u.COMPARATORTRIM]),"g");var B="$1$2$3";y("HYPHENRANGE"),l[u.HYPHENRANGE]="^\\s*("+l[u.XRANGEPLAIN]+")\\s+-\\s+("+l[u.XRANGEPLAIN]+")\\s*$",y("HYPHENRANGELOOSE"),l[u.HYPHENRANGELOOSE]="^\\s*("+l[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+l[u.XRANGEPLAINLOOSE]+")\\s*$",y("STAR"),l[u.STAR]="(<|>)?=?\\s*\\*";for(var G=0;G<T;G++)r(G,l[G]),f[G]||(f[G]=new RegExp(l[G]),v[G]=new RegExp(L(l[G])));t.parse=I;function I(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $)return d;if(typeof d!="string"||d.length>i)return null;var w=x.loose?v[u.LOOSE]:v[u.FULL];if(!w.test(d))return null;try{return new $(d,x)}catch{return null}}t.valid=F;function F(d,x){var w=I(d,x);return w?w.version:null}t.clean=V;function V(d,x){var w=I(d.trim().replace(/^[=v]+/,""),x);return w?w.version:null}t.SemVer=$;function $(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $){if(d.loose===x.loose)return d;d=d.version}else if(typeof d!="string")throw new TypeError("Invalid Version: "+d);if(d.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof $))return new $(d,x);r("SemVer",d,x),this.options=x,this.loose=!!x.loose;var w=d.trim().match(x.loose?v[u.LOOSE]:v[u.FULL]);if(!w)throw new TypeError("Invalid Version: "+d);if(this.raw=d,this.major=+w[1],this.minor=+w[2],this.patch=+w[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");w[4]?this.prerelease=w[4].split(".").map(function(P){if(/^[0-9]+$/.test(P)){var O=+P;if(O>=0&&O<s)return O}return P}):this.prerelease=[],this.build=w[5]?w[5].split("."):[],this.format()}$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(d){return r("SemVer.compare",this.version,this.options,d),d instanceof $||(d=new $(d,this.options)),this.compareMain(d)||this.comparePre(d)},$.prototype.compareMain=function(d){return d instanceof $||(d=new $(d,this.options)),je(this.major,d.major)||je(this.minor,d.minor)||je(this.patch,d.patch)},$.prototype.comparePre=function(d){if(d instanceof $||(d=new $(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;var x=0;do{var w=this.prerelease[x],P=d.prerelease[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.compareBuild=function(d){d instanceof $||(d=new $(d,this.options));var x=0;do{var w=this.build[x],P=d.build[x];if(r("prerelease compare",x,w,P),w===void 0&&P===void 0)return 0;if(P===void 0)return 1;if(w===void 0)return-1;if(w===P)continue;return je(w,P)}while(++x)},$.prototype.inc=function(d,x){switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",x),this.inc("pre",x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",x),this.inc("pre",x);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)}x&&(this.prerelease[0]===x?isNaN(this.prerelease[1])&&(this.prerelease=[x,0]):this.prerelease=[x,0]);break;default:throw new Error("invalid increment argument: "+d)}return this.format(),this.raw=this.version,this},t.inc=le;function le(d,x,w,P){typeof w=="string"&&(P=w,w=void 0);try{return new $(d,w).inc(x,P).version}catch{return null}}t.diff=H;function H(d,x){if(Vt(d,x))return null;var w=I(d),P=I(x),O="";if(w.prerelease.length||P.prerelease.length){O="pre";var _="prerelease"}for(var W in w)if((W==="major"||W==="minor"||W==="patch")&&w[W]!==P[W])return O+W;return _}t.compareIdentifiers=je;var se=/^[0-9]+$/;function je(d,x){var w=se.test(d),P=se.test(x);return w&&P&&(d=+d,x=+x),d===x?0:w&&!P?-1:P&&!w?1:d<x?-1:1}t.rcompareIdentifiers=We;function We(d,x){return je(x,d)}t.major=Me;function Me(d,x){return new $(d,x).major}t.minor=Qe;function Qe(d,x){return new $(d,x).minor}t.patch=Z;function Z(d,x){return new $(d,x).patch}t.compare=pe;function pe(d,x,w){return new $(d,w).compare(new $(x,w))}t.compareLoose=ee;function ee(d,x){return pe(d,x,!0)}t.compareBuild=ye;function ye(d,x,w){var P=new $(d,w),O=new $(x,w);return P.compare(O)||P.compareBuild(O)}t.rcompare=oe;function oe(d,x,w){return pe(x,d,w)}t.sort=Ae;function Ae(d,x){return d.sort(function(w,P){return t.compareBuild(w,P,x)})}t.rsort=we;function we(d,x){return d.sort(function(w,P){return t.compareBuild(P,w,x)})}t.gt=Je;function Je(d,x,w){return pe(d,x,w)>0}t.lt=qe;function qe(d,x,w){return pe(d,x,w)<0}t.eq=Vt;function Vt(d,x,w){return pe(d,x,w)===0}t.neq=Ht;function Ht(d,x,w){return pe(d,x,w)!==0}t.gte=Ft;function Ft(d,x,w){return pe(d,x,w)>=0}t.lte=Xt;function Xt(d,x,w){return pe(d,x,w)<=0}t.cmp=Pe;function Pe(d,x,w,P){switch(x){case"===":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d===w;case"!==":return typeof d=="object"&&(d=d.version),typeof w=="object"&&(w=w.version),d!==w;case"":case"=":case"==":return Vt(d,w,P);case"!=":return Ht(d,w,P);case">":return Je(d,w,P);case">=":return Ft(d,w,P);case"<":return qe(d,w,P);case"<=":return Xt(d,w,P);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=_e;function _e(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof _e){if(d.loose===!!x.loose)return d;d=d.value}if(!(this instanceof _e))return new _e(d,x);d=d.trim().split(/\s+/).join(" "),r("comparator",d,x),this.options=x,this.loose=!!x.loose,this.parse(d),this.semver===Ze?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var Ze={};_e.prototype.parse=function(d){var x=this.options.loose?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],w=d.match(x);if(!w)throw new TypeError("Invalid comparator: "+d);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new $(w[2],this.options.loose):this.semver=Ze},_e.prototype.toString=function(){return this.value},_e.prototype.test=function(d){if(r("Comparator.test",d,this.options.loose),this.semver===Ze||d===Ze)return!0;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}return Pe(d,this.operator,this.semver,this.options)},_e.prototype.intersects=function(d,x){if(!(d instanceof _e))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var w;if(this.operator==="")return this.value===""?!0:(w=new de(d.value,x),ot(this.value,w,x));if(d.operator==="")return d.value===""?!0:(w=new de(this.value,x),ot(d.semver,w,x));var P=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),O=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),_=this.semver.version===d.semver.version,W=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),ne=Pe(this.semver,"<",d.semver,x)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),ae=Pe(this.semver,">",d.semver,x)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return P||O||_&&W||ne||ae},t.Range=de;function de(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof de)return d.loose===!!x.loose&&d.includePrerelease===!!x.includePrerelease?d:new de(d.raw,x);if(d instanceof _e)return new de(d.value,x);if(!(this instanceof de))return new de(d,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=d.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()}de.prototype.format=function(){return this.range=this.set.map(function(d){return d.join(" ").trim()}).join("||").trim(),this.range},de.prototype.toString=function(){return this.range},de.prototype.parseRange=function(d){var x=this.options.loose,w=x?v[u.HYPHENRANGELOOSE]:v[u.HYPHENRANGE];d=d.replace(w,tt),r("hyphen replace",d),d=d.replace(v[u.COMPARATORTRIM],B),r("comparator trim",d,v[u.COMPARATORTRIM]),d=d.replace(v[u.TILDETRIM],D),d=d.replace(v[u.CARETTRIM],A),d=d.split(/\s+/).join(" ");var P=x?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],O=d.split(" ").map(function(_){return Jt(_,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(O=O.filter(function(_){return!!_.match(P)})),O=O.map(function(_){return new _e(_,this.options)},this),O},de.prototype.intersects=function(d,x){if(!(d instanceof de))throw new TypeError("a Range is required");return this.set.some(function(w){return Yt(w,x)&&d.set.some(function(P){return Yt(P,x)&&w.every(function(O){return P.every(function(_){return O.intersects(_,x)})})})})};function Yt(d,x){for(var w=!0,P=d.slice(),O=P.pop();w&&P.length;)w=P.every(function(_){return O.intersects(_,x)}),O=P.pop();return w}t.toComparators=Qt;function Qt(d,x){return new de(d,x).set.map(function(w){return w.map(function(P){return P.value}).join(" ").trim().split(" ")})}function Jt(d,x){return r("comp",d,x),d=et(d,x),r("caret",d),d=Bt(d,x),r("tildes",d),d=en(d,x),r("xrange",d),d=Fe(d,x),r("stars",d),d}function ke(d){return!d||d.toLowerCase()==="x"||d==="*"}function Bt(d,x){return d.trim().split(/\s+/).map(function(w){return Nn(w,x)}).join(" ")}function Nn(d,x){var w=x.loose?v[u.TILDELOOSE]:v[u.TILDE];return d.replace(w,function(P,O,_,W,ne){r("tilde",d,P,O,_,W,ne);var ae;return ke(O)?ae="":ke(_)?ae=">="+O+".0.0 <"+(+O+1)+".0.0":ke(W)?ae=">="+O+"."+_+".0 <"+O+"."+(+_+1)+".0":ne?(r("replaceTilde pr",ne),ae=">="+O+"."+_+"."+W+"-"+ne+" <"+O+"."+(+_+1)+".0"):ae=">="+O+"."+_+"."+W+" <"+O+"."+(+_+1)+".0",r("tilde return",ae),ae})}function et(d,x){return d.trim().split(/\s+/).map(function(w){return Zt(w,x)}).join(" ")}function Zt(d,x){r("caret",d,x);var w=x.loose?v[u.CARETLOOSE]:v[u.CARET];return d.replace(w,function(P,O,_,W,ne){r("caret",d,P,O,_,W,ne);var ae;return ke(O)?ae="":ke(_)?ae=">="+O+".0.0 <"+(+O+1)+".0.0":ke(W)?O==="0"?ae=">="+O+"."+_+".0 <"+O+"."+(+_+1)+".0":ae=">="+O+"."+_+".0 <"+(+O+1)+".0.0":ne?(r("replaceCaret pr",ne),O==="0"?_==="0"?ae=">="+O+"."+_+"."+W+"-"+ne+" <"+O+"."+_+"."+(+W+1):ae=">="+O+"."+_+"."+W+"-"+ne+" <"+O+"."+(+_+1)+".0":ae=">="+O+"."+_+"."+W+"-"+ne+" <"+(+O+1)+".0.0"):(r("no pr"),O==="0"?_==="0"?ae=">="+O+"."+_+"."+W+" <"+O+"."+_+"."+(+W+1):ae=">="+O+"."+_+"."+W+" <"+O+"."+(+_+1)+".0":ae=">="+O+"."+_+"."+W+" <"+(+O+1)+".0.0"),r("caret return",ae),ae})}function en(d,x){return r("replaceXRanges",d,x),d.split(/\s+/).map(function(w){return tn(w,x)}).join(" ")}function tn(d,x){d=d.trim();var w=x.loose?v[u.XRANGELOOSE]:v[u.XRANGE];return d.replace(w,function(P,O,_,W,ne,ae){r("xRange",d,P,O,_,W,ne,ae);var Be=ke(_),Ne=Be||ke(W),Ee=Ne||ke(ne),Te=Ee;return O==="="&&Te&&(O=""),ae=x.includePrerelease?"-0":"",Be?O===">"||O==="<"?P="<0.0.0-0":P="*":O&&Te?(Ne&&(W=0),ne=0,O===">"?(O=">=",Ne?(_=+_+1,W=0,ne=0):(W=+W+1,ne=0)):O==="<="&&(O="<",Ne?_=+_+1:W=+W+1),P=O+_+"."+W+"."+ne+ae):Ne?P=">="+_+".0.0"+ae+" <"+(+_+1)+".0.0"+ae:Ee&&(P=">="+_+"."+W+".0"+ae+" <"+_+"."+(+W+1)+".0"+ae),r("xRange return",P),P})}function Fe(d,x){return r("replaceStars",d,x),d.trim().replace(v[u.STAR],"")}function tt(d,x,w,P,O,_,W,ne,ae,Be,Ne,Ee,Te){return ke(w)?x="":ke(P)?x=">="+w+".0.0":ke(O)?x=">="+w+"."+P+".0":x=">="+x,ke(ae)?ne="":ke(Be)?ne="<"+(+ae+1)+".0.0":ke(Ne)?ne="<"+ae+"."+(+Be+1)+".0":Ee?ne="<="+ae+"."+Be+"."+Ne+"-"+Ee:ne="<="+ne,(x+" "+ne).trim()}de.prototype.test=function(d){if(!d)return!1;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(wt(this.set[x],d,this.options))return!0;return!1};function wt(d,x,w){for(var P=0;P<d.length;P++)if(!d[P].test(x))return!1;if(x.prerelease.length&&!w.includePrerelease){for(P=0;P<d.length;P++)if(r(d[P].semver),d[P].semver!==Ze&&d[P].semver.prerelease.length>0){var O=d[P].semver;if(O.major===x.major&&O.minor===x.minor&&O.patch===x.patch)return!0}return!1}return!0}t.satisfies=ot;function ot(d,x,w){try{x=new de(x,w)}catch{return!1}return x.test(d)}t.maxSatisfying=Et;function Et(d,x,w){var P=null,O=null;try{var _=new de(x,w)}catch{return null}return d.forEach(function(W){_.test(W)&&(!P||O.compare(W)===-1)&&(P=W,O=new $(P,w))}),P}t.minSatisfying=It;function It(d,x,w){var P=null,O=null;try{var _=new de(x,w)}catch{return null}return d.forEach(function(W){_.test(W)&&(!P||O.compare(W)===1)&&(P=W,O=new $(P,w))}),P}t.minVersion=Ke;function Ke(d,x){d=new de(d,x);var w=new $("0.0.0");if(d.test(w)||(w=new $("0.0.0-0"),d.test(w)))return w;w=null;for(var P=0;P<d.set.length;++P){var O=d.set[P];O.forEach(function(_){var W=new $(_.semver.version);switch(_.operator){case">":W.prerelease.length===0?W.patch++:W.prerelease.push(0),W.raw=W.format();case"":case">=":(!w||Je(w,W))&&(w=W);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+_.operator)}})}return w&&d.test(w)?w:null}t.validRange=xn;function xn(d,x){try{return new de(d,x).range||"*"}catch{return null}}t.ltr=nn;function nn(d,x,w){return R(d,x,"<",w)}t.gtr=wn;function wn(d,x,w){return R(d,x,">",w)}t.outside=R;function R(d,x,w,P){d=new $(d,P),x=new de(x,P);var O,_,W,ne,ae;switch(w){case">":O=Je,_=Xt,W=qe,ne=">",ae=">=";break;case"<":O=qe,_=Ft,W=Je,ne="<",ae="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ot(d,x,P))return!1;for(var Be=0;Be<x.set.length;++Be){var Ne=x.set[Be],Ee=null,Te=null;if(Ne.forEach(function(Xe){Xe.semver===Ze&&(Xe=new _e(">=0.0.0")),Ee=Ee||Xe,Te=Te||Xe,O(Xe.semver,Ee.semver,P)?Ee=Xe:W(Xe.semver,Te.semver,P)&&(Te=Xe)}),Ee.operator===ne||Ee.operator===ae||(!Te.operator||Te.operator===ne)&&_(d,Te.semver))return!1;if(Te.operator===ae&&W(d,Te.semver))return!1}return!0}t.prerelease=St;function St(d,x){var w=I(d,x);return w&&w.prerelease.length?w.prerelease:null}t.intersects=Ct;function Ct(d,x,w){return d=new de(d,w),x=new de(x,w),d.intersects(x)}t.coerce=rn;function rn(d,x){if(d instanceof $)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;x=x||{};var w=null;if(!x.rtl)w=d.match(v[u.COERCE]);else{for(var P;(P=v[u.COERCERTL].exec(d))&&(!w||w.index+w[0].length!==d.length);)(!w||P.index+P[0].length!==w.index+w[0].length)&&(w=P),v[u.COERCERTL].lastIndex=P.index+P[1].length+P[2].length;v[u.COERCERTL].lastIndex=-1}return w===null?null:I(w[2]+"."+(w[3]||"0")+"."+(w[4]||"0"),x)}})(si,si.exports);var Jd=si.exports;const fa=As,Ot=Jd,Ue="semver",Zd={base:fa.string(),type:"semverRange",validate:function(e,{error:t}){return Ot.validRange(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver range"}},bn={};bn.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{exp:n})},args:[{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});bn.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return Ot.cmp(e,n,r)?e:t.error(`${Ue}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:Ot.valid,message:"needs to be a valid semver expression"}]};bn.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return Ot[r](e,n)?e:t.error(`${Ue}.${r}`,{rng:n})},args:[{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){bn[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});bn.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return Ot.outside(e,r,n)?e:t.error(`${Ue}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:Ot.validRange,message:"needs to be a valid semver range"}]};const eh={base:fa.string(),type:"semver",validate:function(e,{error:t}){return Ot.valid(e)?{value:e}:{errors:t(`${Ue}.valid`)}},messages:{[`${Ue}.valid`]:"{{#label}} needs to be a valid semver expression",[`${Ue}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${Ue}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${Ue}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${Ue}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${Ue}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${Ue}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${Ue}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${Ue}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${Ue}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${Ue}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${Ue}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:bn};var th={semver:eh,semverRange:Zd};/*!
200
200
  * is-var-name | ISC (c) Shinnosuke Watanabe
201
201
  * https://github.com/shinnn/is-var-name
202
- */function nh(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const rh=Object.freeze(Object.defineProperty({__proto__:null,default:nh},Symbol.toStringTag,{value:"Module"})),ih=ji(rh),oh=ji(Yl),sh=ec,ah=tc,Ho=Tr,lh=e=>{if((0,Ho.isValid)(e))return e;const t=(0,ah.toHex)(vc.from(typeof e=="string"?e.trim():e));return(0,Ho.fromPublicKey)(t,{role:sh.types.RoleType.ROLE_ANY})};var ch=lh,gn={},pa=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0});gn.didExtension=gn.fileExtension=void 0;const Vo=pa(ua),uh=pa(Zc),dh=Tr,ma=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=>Vo.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:i}={}){if(typeof i=="function"&&i(r,t))return t;try{return Vo.default.statSync(uh.default.join(r,t)),t}catch(s){switch(s.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:s.message})}}}}});gn.fileExtension=ma;const ga=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,dh.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'}});gn.didExtension=ga;gn.default={fileExtension:ma,didExtension:ga};var Bi={},va={exports:{}};const hh=["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 ya=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),fh=hh,ph=["node_modules","favicon.ico"],mh=va.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Kn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Kn(t,n);if(typeof e!="string")return n.push("name must be a string"),Kn(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"),ph.forEach(function(a){e.toLowerCase()===a&&n.push(a+" is a blacklisted name")}),fh.forEach(function(a){e.toLowerCase()===a&&t.push(a+" 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(ya);if(r){var i=r[1],s=r[2];if(encodeURIComponent(i)===i&&encodeURIComponent(s)===s)return Kn(t,n)}n.push("name can only contain URL-friendly characters")}return Kn(t,n)};mh.scopedPackagePattern=ya;var Kn=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},gh=va.exports;(function(e){var t=Se&&Se.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=Tr,r=t(gh),i=32,s=c=>{if((0,n.toTypeInfo)(c).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=s;const a=(c,{checkDid:f=!0}={})=>{if((0,n.isValid)(c))f&&(0,e.validateNewDid)(c);else{const{validForNewPackages:v,errors:l=[],warnings:u=[]}=(0,r.default)(c);if(!v)throw new Error(l[0]||u[0]);if(c.length>i)throw new Error("Blocklet name is too long")}};e.validateName=a,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(Bi);var vh=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),yh=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),bh=Se&&Se.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&vh(n,t,r[i]);return yh(n,t),n}}(),Ln=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});te.Joi=te.eventsSchema=te.installBlockletDescriptionSchema=te.installBlockletTitleSchema=te.resourceBundleSchema=te.authConfigSchema=te.cacheableSchema=te.statsSchema=te.titleSchema=te.themeSchema=te.signatureSchema=te.serviceSchema=te.scriptsSchema=te.personSchema=te.navigationSchema=te.navigationItemSchema=te.updateMountPointSchema=te.mountPointSchema=te.logoSchema=te.interfaceSchema=te.environmentNameSchema=te.environmentSchema=te.engineSchema=te.endpointSchema=te.distSchema=te.descriptionSchema=te.createBlockletSchema=te.componentSchema=te.blockletNameSchema=te.blockletMetaSchema=void 0;const xh=Ln(ua),wh=Ln(As),Eh=Ln(Gd),Sh=Ln(Qd),Xo=th,Th=Ln(ih),Yo=Fs,jh=Tr,kh=oh,Ce=kt,Oh=Ln(ch),Qo=gn,ai=Bi,$i=bh(Ic),Ih=Eh.default.default,Jo="/.well-known",h=wh.default.extend(Xo.semver).extend(Xo.semverRange).extend(Qo.fileExtension).extend(Qo.didExtension);te.Joi=h;const Zo=(e,t)=>(0,$i.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
202
+ */function nh(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const rh=Object.freeze(Object.defineProperty({__proto__:null,default:nh},Symbol.toStringTag,{value:"Module"})),ih=ji(rh),oh=ji(Yl),sh=ec,ah=tc,Vo=Tr,lh=e=>{if((0,Vo.isValid)(e))return e;const t=(0,ah.toHex)(vc.from(typeof e=="string"?e.trim():e));return(0,Vo.fromPublicKey)(t,{role:sh.types.RoleType.ROLE_ANY})};var ch=lh,gn={},pa=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gn,"__esModule",{value:!0});gn.didExtension=gn.fileExtension=void 0;const Ho=pa(ua),uh=pa(Zc),dh=Tr,ma=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=>Ho.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:i}={}){if(typeof i=="function"&&i(r,t))return t;try{return Ho.default.statSync(uh.default.join(r,t)),t}catch(s){switch(s.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:s.message})}}}}});gn.fileExtension=ma;const ga=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,dh.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'}});gn.didExtension=ga;gn.default={fileExtension:ma,didExtension:ga};var Bi={},va={exports:{}};const hh=["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 ya=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),fh=hh,ph=["node_modules","favicon.ico"],mh=va.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Kn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Kn(t,n);if(typeof e!="string")return n.push("name must be a string"),Kn(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"),ph.forEach(function(a){e.toLowerCase()===a&&n.push(a+" is a blacklisted name")}),fh.forEach(function(a){e.toLowerCase()===a&&t.push(a+" 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(ya);if(r){var i=r[1],s=r[2];if(encodeURIComponent(i)===i&&encodeURIComponent(s)===s)return Kn(t,n)}n.push("name can only contain URL-friendly characters")}return Kn(t,n)};mh.scopedPackagePattern=ya;var Kn=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},gh=va.exports;(function(e){var t=Se&&Se.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=Tr,r=t(gh),i=32,s=c=>{if((0,n.toTypeInfo)(c).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=s;const a=(c,{checkDid:f=!0}={})=>{if((0,n.isValid)(c))f&&(0,e.validateNewDid)(c);else{const{validForNewPackages:v,errors:l=[],warnings:u=[]}=(0,r.default)(c);if(!v)throw new Error(l[0]||u[0]);if(c.length>i)throw new Error("Blocklet name is too long")}};e.validateName=a,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(Bi);var vh=Se&&Se.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),yh=Se&&Se.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),bh=Se&&Se.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&vh(n,t,r[i]);return yh(n,t),n}}(),Ln=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(te,"__esModule",{value:!0});te.Joi=te.eventsSchema=te.installBlockletDescriptionSchema=te.installBlockletTitleSchema=te.resourceBundleSchema=te.authConfigSchema=te.cacheableSchema=te.statsSchema=te.titleSchema=te.themeSchema=te.signatureSchema=te.serviceSchema=te.scriptsSchema=te.personSchema=te.navigationSchema=te.navigationItemSchema=te.updateMountPointSchema=te.mountPointSchema=te.logoSchema=te.interfaceSchema=te.environmentNameSchema=te.environmentSchema=te.engineSchema=te.endpointSchema=te.distSchema=te.descriptionSchema=te.createBlockletSchema=te.componentSchema=te.blockletNameSchema=te.blockletMetaSchema=void 0;const xh=Ln(ua),wh=Ln(As),Eh=Ln(Gd),Sh=Ln(Qd),Xo=th,Th=Ln(ih),Yo=Fs,jh=Tr,kh=oh,Ce=kt,Oh=Ln(ch),Qo=gn,ai=Bi,$i=bh(Ic),Ih=Eh.default.default,Jo="/.well-known",h=wh.default.extend(Xo.semver).extend(Xo.semverRange).extend(Qo.fileExtension).extend(Qo.didExtension);te.Joi=h;const Zo=(e,t)=>(0,$i.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
203
203
 
204
204
  A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
205
205
  - /en/home
@@ -213,7 +213,7 @@ A valid navigation id is should follow the rules of javascript variables, such a
213
213
  - foo123
214
214
 
215
215
  see detail in https://www.npmjs.com/package/is-var-name
216
- `),Rr=h.string().trim().min(1).custom(e=>{if(Ih(e)>Ce.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Ce.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});te.titleSchema=Rr;const Pr=h.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=Pr;const ba=h.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=ba;const xa=h.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=xa;const wa=h.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Yo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Yo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=wa;const Ea=h.string().trim().min(1),Ui=Ea.meta({className:"TMountPoint"}).custom((e,t)=>(0,$i.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=Ui;const Sa=Ea.meta({className:"TUpdateMountPoint"}).custom(e=>(0,$i.default)(e));te.updateMountPointSchema=Sa;const Pn=h.string().custom(e=>((0,ai.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=Pn;const Rh=[],Wi=h.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Rh.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});te.environmentNameSchema=Wi;const zi=h.object({name:Wi.required(),description:h.string().trim().required(),default:h.string().optional().allow("").default(""),required:h.boolean().default(!1),secure:h.boolean().default(!1),validation:h.string().optional(),shared:h.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});te.environmentSchema=zi;const qi=h.object({dev:h.string().trim().min(1),e2eDev:h.string().trim().min(1),preFlight:h.string().trim().min(1),preInstall:h.string().trim().min(1),postInstall:h.string().trim().min(1),preStart:h.string().trim().min(1),postStart:h.string().trim().min(1),preStop:h.string().trim().min(1),preUninstall:h.string().trim().min(1),preConfig:h.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});te.scriptsSchema=qi;const Ki=h.object({name:h.string().required().trim(),config:h.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=Ki;const Gi=h.object({type:h.string().trim(!0).min(1).required(),path:h.string().required(),meta:h.object({vcType:h.string(),payable:h.boolean(),params:h.array().items({name:h.string().required().trim(),description:h.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});te.endpointSchema=Gi;const Ta=h.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});te.cacheableSchema=Ta;const Hi=h.object({type:h.string().lowercase().valid(...Ce.BLOCKLET_INTERFACE_TYPES).required(),name:h.string().trim().required(),path:h.string().trim().default("/"),prefix:h.string().trim().min(1).default(Ce.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:h.number().port().optional(),hostIP:h.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:h.string().lowercase().valid(...Ce.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:h.alternatives().try(h.string().uppercase().default(Ce.BLOCKLET_DEFAULT_PORT_NAME),h.object({internal:h.string().uppercase().required(),external:h.number().port().required()})).default(Ce.BLOCKLET_DEFAULT_PORT_NAME),cacheable:h.array().items(Ta).unique(),services:h.array().items(Ki).unique("name"),endpoints:h.array().items(Gi).unique("type"),pageGroups:h.array().items(h.string().min(1).max(255).trim()).unique(),proxyBehavior:h.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});te.interfaceSchema=Hi;const Ph=h.alternatives().try(h.string().required(),h.object({url:h.string().uri({scheme:["http","https","file"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),li=h.object({platform:h.string().valid(...Ce.BLOCKLET_PLATFORMS).optional(),interpreter:h.string().valid("binary","node","blocklet").default("node"),source:Ph,args:h.array().items(h.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=li;const Xn=h.object({name:h.string().min(1).required(),email:h.string().email({tlds:!1}).optional(),url:h.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});te.personSchema=Xn;const Zn=h.object({tarball:h.alternatives().try(h.string().uri(),h.string()).required(),integrity:h.string().required(),size:h.number().optional()}).meta({className:"TDist",unknownType:"any"});te.distSchema=Zn;const ja=h.object({downloads:h.number().integer().greater(-1),star:h.number().default(0),purchases:h.number().default(0)}).meta({className:"TStats",unknownType:"any"});te.statsSchema=ja;const _h=h.alternatives().try(h.object({url:h.alternatives().try(h.string().uri(),h.array().items(h.string().uri()).min(1)).required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),ka={source:_h.required(),required:h.boolean(),title:Rr,description:Pr,mountPoint:Ui,name:Pn},Oa=(e,t)=>h.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),Vi=Oa(ka).meta({className:"TComponent",unknownType:"any"});te.componentSchema=Vi;const Lh=Oa(ka,!0),Ia=({checkStore:e}={})=>{const t=[Vi,Lh];return h.array().items(e?t[0]:t[1]).optional().default([])},Ca=h.object({type:h.string().required(),name:h.string().required(),signer:h.string().required(),pk:h.string().required(),created:h.string().isoDate().required(),sig:h.string().required(),excludes:h.array().items(h.string()).optional(),appended:h.array().items(h.string()).optional(),delegatee:h.string(),delegateePk:h.string(),delegation:h.string()}).meta({className:"TSignature",unknownType:"any"});te.signatureSchema=Ca;const zr=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],es={id:h.string().custom(Ch),title:h.alternatives().try(h.string().min(1).max(Ce.MAX_TITLE_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Ce.MAX_TITLE_LENGTH))).required(),description:h.alternatives().try(h.string().min(1).max(Ce.MAX_DESCRIPTION_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Ce.MAX_DESCRIPTION_LENGTH))),link:h.alternatives().try(h.string().custom(Zo),h.object().min(1).pattern(h.string().valid(...zr),h.string().custom(Zo))),component:h.string().min(1),section:h.array().items(h.string().min(1)).single(),role:h.array().items(h.string().min(1)).single(),icon:h.string().min(1),visible:h.boolean()},Ra=h.object({...es,items:h.array().items(h.object({...es}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=Ra;const Xi=h.array().items(Ra).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=Xi;const Yi=h.object({background:h.alternatives().try(h.string().min(1),h.object({header:h.string().min(1),footer:h.string().min(1),default:h.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});te.themeSchema=Yi;const Pa=h.object({whoCanAccess:h.string().valid("owner","invited","all"),profileFields:h.array().items(h.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:h.array().items(h.string().min(1)),allowSwitchProfile:h.boolean(),blockUnauthenticated:h.boolean(),blockUnauthorized:h.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});te.authConfigSchema=Pa;const Nh=h.object({type:h.string().trim().min(1).required(),description:h.string().trim().min(1)}),Qi=h.object({did:h.DID().trim().required(),type:h.string().trim().min(1).required(),public:h.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=Qi;const Ji=h.array().items(h.object({type:h.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:h.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});te.eventsSchema=Ji;const _a={did:h.DID().trim().required(),version:h.semver().valid().required(),name:h.string().optional(),description:Pr.required(),group:h.string().valid(...Ce.BLOCKLET_GROUPS),main:h.string().trim(),title:Rr.optional().allow(""),logo:h.string().trim().optional(),specVersion:h.semver().valid().gte("1.0.0").optional(),author:Xn.optional(),contributors:h.array().items(Xn).optional(),maintainers:h.array().items(Xn).optional(),community:h.string().uri().optional().allow("").default(""),documentation:h.string().uri().optional().allow("").default(""),homepage:h.string().uri().optional().allow("").default(""),license:h.string().optional().allow("").default(""),support:h.alternatives().try(h.string().uri(),h.string().email({tlds:!1})).optional(),nftFactory:h.DID().optional().allow("").default(""),payment:h.object({price:h.array().max(1).items(h.object({value:h.number().greater(0).required(),address:h.DID().required()})).default([]),share:h.array().max(4).items(h.object({name:h.string().required(),address:h.DID().required(),value:h.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:h.array().items(h.object({parentPriceRange:h.array().items(h.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:h.string().valid("fixed","percentage").required(),value:h.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),tags:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),gitHash:h.string().optional().allow(""),repository:h.alternatives().try(h.string().min(1),h.object({type:h.string().valid("git","https","svn").required(),url:h.string().uri().required(),directory:h.string()})).optional(),timeout:h.object({start:h.number().min(10).max(600),script:h.number().min(1).max(1800)}).default({start:60}),requirements:h.object({abtnode:h.semverRange().valid(),server:h.semverRange().valid(),os:h.alternatives().try(h.string().valid("*",...Ce.BLOCKLET_PLATFORMS),h.array().items(h.string().valid(...Ce.BLOCKLET_PLATFORMS)).min(1)),cpu:h.alternatives().try(h.string().valid("*",...Ce.BLOCKLET_ARCHITECTURES),h.array().items(h.string().valid(...Ce.BLOCKLET_ARCHITECTURES)).min(1)),fuels:h.array().items(h.object({endpoint:h.string().trim().required(),address:h.string().trim(),value:h.string().trim().required(),reason:h.string().trim().required()})),nodejs:h.semverRange().valid()}).default({server:Ce.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:h.array().items(Hi).unique("name").custom((e,t)=>{if(e.filter(i=>i.type===Ce.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Ce.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(i=>i.type===Ce.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const i of r)if(!i.prefix.startsWith(Jo))return t.message(`Wellknown path prefix must start with: ${Jo}`);return e}).default([]),environments:h.array().items(zi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,i)=>e.findIndex(s=>s.name===r.name)!==i);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:qi,capabilities:h.object({clusterMode:h.boolean(),didSpace:h.string().valid(...Object.values(Ce.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:h.boolean().default(!0),serverless:h.boolean().optional(),component:h.boolean(),sitemap:h.boolean().optional(),mcp:h.boolean().optional()}).default({}),files:h.array().items(h.string().trim()).optional(),resource:h.object({exportApi:h.string().trim(),bundles:h.array().items(Qi),types:h.array().items(Nh).max(10)}),engine:h.alternatives().try(li,h.array().items(li)).optional(),screenshots:h.array().items(h.string().min(1)).optional().default([]),videos:h.array().items(h.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:h.string().optional().allow(""),dist:Zn.optional(),stats:ja.optional(),htmlAst:h.any().optional(),path:h.string().optional(),signatures:h.array().items(Ca).optional(),lastPublishedAt:h.string().isoDate().optional().allow(null),components:Ia(),navigation:Xi,theme:Yi,copyright:h.object({owner:h.string().min(1),year:h.alternatives().try(h.string(),h.number())}),bundleName:h.string(),bundleDid:h.DID().trim(),storeId:h.string(),events:Ji.optional()},Ah=h.object(_a).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=Ah;const La=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,...a}={})=>((!e||!xh.default.existsSync(e))&&(t=!1),h.object({..._a,owner:h.object({avatar:h.string().optional(),did:h.DID().trim().required(),fullName:h.string().trim().required(),email:h.string().optional().allow(null).empty("").default("")}).optional(),logo:t?h.file().trim().exists({baseDir:e}).optional():h.string().trim().optional(),files:h.array().items(t?h.file().exists({baseDir:e,canSkip:(c,f)=>[Ce.BLOCKLET_ENTRY_FILE,Ce.BLOCKLET_BUNDLE_FILE].includes(f)||(0,Sh.default)(f)}):h.string().trim()).optional(),dist:n?Zn.required():Zn.optional(),components:Ia({checkStore:r}),name:i?h.string().optional():h.string().required(),egress:h.boolean().optional().default(!0),docker:kh.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...a}).rename("children","components").custom((c,f)=>{const{did:v,name:l,docker:u}=c;if(u){const{image:y,dockerfile:S,network:j}=u;if(!y&&!S)return f.message("Image or dockerfile must be set");if(y&&S)return f.message("Image and dockerfile cannot be set at the same time");if(j)return f.message("ExportPorts and network cannot be set at the same time");if(S&&(c.files||(c.files=[]),c.files.push(S)),u.volumes)for(const L of u.volumes){if(!L.startsWith("$BLOCKLET_APP_DIR/")&&!L.startsWith("$BLOCKLET_DATA_DIR/"))return f.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(L.indexOf("..")>-1)return f.message('Volume cannot contain ".."')}}let T;if((0,jh.isValid)(v))try{return(0,ai.validateNewDid)(v),c}catch(y){T=y}if(l){(0,ai.validateName)(l,{checkDid:!s});const y=(0,Oh.default)(l);return y!==v?f.message(`The did of name "${l}" should be "${y}"`):c}return T?f.message(T.message):c}));te.createBlockletSchema=La;te.default={blockletNameSchema:Pn,componentSchema:Vi,endpointSchema:Gi,serviceSchema:Ki,createBlockletSchema:La,interfaceSchema:Hi,environmentSchema:zi,environmentNameSchema:Wi,scriptsSchema:qi,personSchema:Xn,distSchema:Zn,titleSchema:Rr,descriptionSchema:Pr,logoSchema:wa,navigationSchema:Xi,themeSchema:Yi,mountPointSchema:Ui,updateMountPointSchema:Sa,authConfigSchema:Pa,resourceBundleSchema:Qi,installBlockletTitleSchema:ba,installBlockletDescriptionSchema:xa,eventsSchema:Ji,Joi:h};var bt={},Dh=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.setService=bt.findService=bt.getDefaultServiceConfig=bt.getServiceConfig=void 0;const Mh=Dh(eu),Fh=te,Na={},Zi=e=>{Na[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};bt.setService=Zi;Zi({name:"auth",schema:Fh.authConfigSchema,default:{}});const Aa=e=>{if(!e)throw new Error("service name should not be empty");const t=Na[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Da=(e,t,{validate:n}={})=>{const r=Aa(e),i=(0,Mh.default)(t||{}),{value:s,error:a}=r.validate(i);if(n&&a)throw new Error(`Invalid blocklet service config: ${a.details.map(c=>c.message).join(", ")}`);return s};bt.getServiceConfig=Da;const Ma=e=>{const{defaultConfig:t}=Aa(e);return t};bt.getDefaultServiceConfig=Ma;const Fa=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};bt.findService=Fa;bt.default={getServiceConfig:Da,getDefaultServiceConfig:Ma,findService:Fa,setService:Zi};Object.defineProperty(mn,"__esModule",{value:!0});mn.fixAndValidateService=mn.validateMeta=void 0;const Bh=te,$h=bt,Uh=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,$h.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);mn.fixAndValidateService=Uh;const Ba=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,schemaOptions:a={}}={})=>{const c=(0,Bh.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:i,skipValidateDidName:s,...a}),{value:f,error:v}=c.validate(e);if(v)throw new Error(`Invalid blocklet meta: ${v.details.map(l=>l.message).join(", ")}`);return f};mn.validateMeta=Ba;mn.default=Ba;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(I,F,H,$){$===void 0&&($=H);var le=Object.getOwnPropertyDescriptor(F,H);(!le||("get"in le?!F.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return F[H]}}),Object.defineProperty(I,$,le)}:function(I,F,H,$){$===void 0&&($=H),I[$]=F[H]}),n=Se&&Se.__setModuleDefault||(Object.create?function(I,F){Object.defineProperty(I,"default",{enumerable:!0,value:F})}:function(I,F){I.default=F}),r=Se&&Se.__importStar||function(){var I=function(F){return I=Object.getOwnPropertyNames||function(H){var $=[];for(var le in H)Object.prototype.hasOwnProperty.call(H,le)&&($[$.length]=le);return $},I(F)};return function(F){if(F&&F.__esModule)return F;var H={};if(F!=null)for(var $=I(F),le=0;le<$.length;le++)$[le]!=="default"&&t(H,F,$[le]);return n(H,F),H}}(),i=Se&&Se.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};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 s=i(Cc),a=r(Md),c=kt,f=mn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return f.fixAndValidateService}});const v=Bi,l=(I,F)=>{I.description||(I.description=`Blocklet from ${F}`),I.version||(I.version=c.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=l;const u=I=>{if(I.repository&&(typeof I.repository=="string"&&(I.repository={type:"git",url:I.repository}),I.repository.url)){const F=a.fromUrl(I.repository.url);F&&(I.repository.url=F.getDefaultRepresentation()==="shortcut"?F.https():F.toString())}};e.fixRepository=u;const T=I=>{Array.isArray(I.files)?I.files&&(I.files=I.files.filter(F=>!(!F||typeof F!="string"))):delete I.files};e.fixFiles=T;const y=I=>{typeof I.keywords=="string"&&(I.keywords=I.keywords.split(/,\s+/)),I.keywords&&!Array.isArray(I.keywords)?delete I.keywords:I.keywords&&(I.keywords=I.keywords.filter(F=>!(typeof F!="string"||!F)))};e.fixKeywords=y;const S=I=>{typeof I.tags=="string"&&(I.tags=I.tags.split(/,\s+/)),I.tags&&!Array.isArray(I.tags)?delete I.tags:I.tags&&(I.tags=I.tags.filter(F=>!(typeof F!="string"||!F)))};e.fixTags=S;const j=(I,F)=>(I.author&&(I.author=F(I.author)),["maintainers","contributors"].forEach(H=>{Array.isArray(I[H])&&(I[H]=I[H].map(F))}),I),L=I=>{if(!I)return"";if(typeof I=="string")return I;const F=I.name||"",H=I.url||I.web,$=H?` (${H})`:"",le=I.email||I.mail,V=le?` <${le}>`:"";return F+V+$};e.formatPerson=L;const D=I=>{if(typeof I!="string")return I;const F=I.match(/^([^(<]+)/),H=I.match(/\(([^)]+)\)/),$=I.match(/<([^>]+)>/),le={};return F&&F[0].trim()&&(le.name=F[0].trim()),$&&([,le.email]=$),H&&([,le.url]=H),le};e.parsePerson=D;const A=I=>(j(I,L),j(I,D),I);e.fixPerson=A;const B=(I,F=!0)=>{if(Array.isArray(I.interfaces)||(I.interfaces=[]),I.interfaces.length)return I.interfaces.forEach(V=>{V.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(V.protocol="http")}),I;const $=(0,s.default)(I,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",le=({type:V="web",name:se,path:je="/",protocol:We="http",port:Me=c.BLOCKLET_DEFAULT_PORT_NAME})=>{I.interfaces.push({type:V,name:se,path:je,prefix:$,port:Me,protocol:We})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(V=>{I[V]&&le({name:V,path:I[V]})}),Array.isArray(I.exposeServices)&&I.exposeServices.forEach(V=>{le({type:"service",name:V.protocol,protocol:V.protocol,port:{internal:`BLOCKLET_${V.protocol}_PORT`.toUpperCase(),external:V.port}})}),F&&(delete I.publicUrl,delete I.adminUrl,delete I.configUrl,delete I.docUrl,delete I.exposeServices,I.capabilities&&delete I.capabilities.dynamicPathPrefix),I};e.fixInterfaces=B;const G=I=>{const{did:F}=I;try{(0,v.validateNewDid)(F),I.name=F}catch{}return I};e.fixName=G,e.default={fixRequired:l,fixRepository:u,fixFiles:T,fixKeywords:y,fixPerson:A,fixTags:S,fixName:G,formatPerson:L,parsePerson:D,fixInterfaces:B,fixService:f.fixAndValidateService}})(oa);function $a({owner:e,locale:t}){return o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?o.jsx(Ms,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}$a.propTypes={owner:N.object.isRequired,locale:N.string.isRequired};const Wh="install-blocklet-from-URL",Ua=()=>{const[e,t]=Vs(Wh,"[]",{raw:!0}),n=i=>{const s=i.trim(),a=JSON.parse(e),c=a.findIndex(f=>f===s);c!==0&&(c>0&&a.splice(c,1),a.length>=10&&a.splice(9),a.unshift(s),t(JSON.stringify(a)))},r=i=>{if(!i)return;const s=JSON.parse(e),a=i.trim(),c=s.findIndex(f=>f===a);c>-1&&(s.splice(c,1),t(JSON.stringify(s)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},zh=ks(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function eo(e){const{value:t,onValueChange:n,children:r,helperText:i}=e,{urls:s,removeUrlRecord:a}=Ua(),c=(v,l)=>{v.preventDefault(),v.stopPropagation(),a(l)},f=zh();return o.jsxs(Y,{children:[o.jsx(Os,{freeSolo:!0,options:s,inputValue:t,onInputChange:(v,l)=>{n(l)},disableClearable:!0,popupIcon:null,renderInput:v=>Mt.cloneElement(r,{...v}),renderOption:(v,l)=>M.createElement(Is,{...v,key:l,secondaryAction:o.jsx(js,{edge:"end","aria-label":"delete",onClick:u=>c(u,l),children:o.jsx(nc,{})})},o.jsx(Il,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:o.jsx(Cs,{primary:l,className:f.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),o.jsx(Cl,{style:{margin:0},children:i})]})}eo.propTypes={onValueChange:N.func,children:N.node,value:N.string,helperText:N.string};eo.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function to({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:i,handleText:s}){const{api:a}=_n(),{api:c}=tu(),[f,v]=M.useState(!1),[l,u]=M.useState(""),{t:T,locale:y}=gt(),S={dist:{}},[j,L]=M.useState(e),[D,A]=M.useState(e?1:0),[B,G]=M.useState(S),[I,F]=M.useState(!1),[H,$]=M.useState({}),le=i==="component",V=le?!0:!e,{addUrlRecord:se}=Ua(),je=async()=>{G(S),u(null),v(!0);let oe=j.trim();!oe.startsWith("https://")&&!oe.startsWith("http://")&&!oe.startsWith("file://")&&(oe=`file://${oe}`);try{const Ae=decodeURIComponent(oe);try{new URL(Ae)}catch{throw new Error("Invalid URL")}const{meta:we,inStore:Je,registryUrl:qe}=await a.getBlockletMetaFromUrl({input:{url:Ae}});G(we),$({inStore:Je,registryUrl:qe,inputUrl:oe}),se(oe)}catch(Ae){console.error(Ae);const we=`Blocklet Install failed: ${Xs(Ae)}`;u(we),r(Ae)}finally{v(!1)}},We=()=>{if(le){n({meta:B,...H}),t();return}v(!0),F(!0)},Me=()=>{v(!1),F(!1),n({meta:B,...H}),t()},Qe=()=>{v(!1),F(!1)};M.useEffect(()=>{e&&je()},[e]);const Z=[{name:T("common.name"),value:Dt.getDisplayName({meta:B},!0)},{name:T("common.version"),value:B.version},{name:T("common.did"),value:B.did?o.jsx(nu,{did:B.did}):null},{name:T("common.author"),value:B.owner?o.jsx($a,{owner:B.owner,locale:y}):oa.formatPerson(B.author)},{name:T("blocklet.dist.downloadLink"),value:B.dist.tarball}],pe=()=>f?o.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:o.jsx(xt,{})}):B.did?o.jsx("div",{style:{paddingLeft:"10%"},children:Z.map(oe=>oe.name===T("common.did")?o.jsx(Lo,{valueComponent:"div",nameWidth:120,name:oe.name,nameFormatter:()=>T("common.did"),children:oe.value},oe.name):o.jsx(Lo,{valueComponent:"div",nameWidth:120,name:oe.name,children:oe.value},oe.name))}):null,ee=[{label:T("blocklet.fromUrl.step0"),body:o.jsx(ge,{component:"div",children:o.jsx(eo,{style:{marginBottom:32},value:j,helperText:T("blocklet.fromUrl.description"),onValueChange:oe=>{u(null),L(oe)},children:o.jsx(Sr,{label:T("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:j,onChange:oe=>{u(null),L(oe.target.value)},disabled:f,onKeyPress:oe=>{oe.key==="Enter"&&(oe.preventDefault(),je(),A(1))}})})}),cancel:T("common.cancel"),confirm:T("common.next"),onCancel:t,onConfirm:()=>{je(),A(1)}},{label:T("blocklet.fromUrl.step1"),body:pe(),cancel:T(V?"common.pre":"common.cancel"),confirm:(s==null?void 0:s.confirm)||T("blocklet.fromUrl.confirm"),onCancel:()=>{V?A(oe=>oe-1):t()},onConfirm:()=>{We()}}],ye=ee[D];return o.jsxs(o.Fragment,{children:[o.jsxs(ki,{title:(s==null?void 0:s.title)||T("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>ye.onCancel(),showCloseButton:D===0,disableEscapeKeyDown:!0,open:!0,actions:o.jsxs(o.Fragment,{children:[ye.cancel&&o.jsx(dt,{onClick:oe=>{oe.stopPropagation(),u(null),ye.onCancel()},color:"inherit",children:ye.cancel||T("common.cancel")}),o.jsxs(dt,{onClick:oe=>{oe.stopPropagation(),ye.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:f||!j||l,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[f&&D===0&&o.jsx(xt,{size:16}),ye.confirm]})]}),children:[V&&o.jsx(Rl,{alternativeLabel:!0,activeStep:D,children:ee.map(({label:oe})=>o.jsx(Pl,{children:o.jsx(_l,{children:oe})},oe))}),o.jsx(Ll,{component:"div",style:{marginTop:24},children:ye.body}),!!l&&o.jsx(Rs,{severity:"error",style:{width:"100%",marginTop:8},children:l})]}),B&&I&&o.jsx(Bs,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:c.get,checkTimeout:5*60*1e3,onSuccess:Me,extraParams:{title:B.title,wt:Rc(B),blockletMetaUrl:decodeURIComponent(j.trim())},messages:{title:T("setup.keyPair.title"),scan:T("setup.keyPair.scan"),confirm:T("setup.keyPair.confirm"),success:T("setup.keyPair.success")},onClose:Qe})]})}to.propTypes={defaultUrl:N.string,onCancel:N.func.isRequired,onSuccess:N.func.isRequired,onError:N.func,mode:N.oneOf(["install","component"]),handleText:N.object};to.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const qh={meta:N.object.isRequired,onCancel:N.func.isRequired},Kh=ks(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function Wa({action:e,onSelect:t,onNext:n}){const r=Kh(),{t:i}=gt(),s=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return o.jsxs(o.Fragment,{children:[o.jsx(Nl,{className:r.tabPanel,children:s.map(a=>o.jsxs(Is,{button:!0,selected:e===a.action,onClick:()=>t(a.action),children:[o.jsx(Al,{className:r.iconRoot,children:a.action==="purchase"?o.jsx(ru,{style:{color:e==="purchase"?Oo.primary.main:"#AAA",fontSize:32}}):o.jsx(iu,{style:{color:e==="verify"?Oo.primary.main:"#AAA",fontSize:32}})}),o.jsx(Cs,{primary:a.title,secondary:a.description})]},a.action))}),n&&o.jsx(dt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:i("common.next")})]})}Wa.propTypes={action:N.oneOf(["both","purchase","verify"]).isRequired,onSelect:N.func.isRequired,onNext:N.func.isRequired};function no({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:i,locale:s}=gt(),{info:a}=_n(),c=Pc(a),[f,v]=M.useState(null),l=new URL(e==null?void 0:e.registryUrl).origin,u=Dt.getDisplayName({meta:e}),T=async(S,j)=>{const L=({downloadTokenList:B})=>{r({downloadTokenList:B})},D=B=>{Oi.error(B),t(B)};function A(B){return rc(()=>No.get(B).then(async({data:G})=>{const I=G==null?void 0:G.downloadTokenList;if(G.status==="succeed"){if(I&&I.length)await L({downloadTokenList:I});else return await D(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return G.status==="error"?(console.error("vc error: ",G),await D(G==null?void 0:G.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&f){const{statusUrl:B}=_c(f);await A(B)}else await L({downloadTokenList:S.downloadTokenList&&j(S.downloadTokenList)})};if(M.useEffect(()=>{if(n==="purchase"){const S=new URL(l);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",a.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{No.get(S.href).then(({data:j})=>{const L=`${j.url}`;v(L)})}catch(j){console.error("get next workflow url error: ",j)}}return()=>{v(null)}},[n]),n==="purchase"&&!f)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:Po.create({baseURL:l}).get,extraParams:{serverDid:a.did,blockletDid:e==null?void 0:e.did},messages:{title:i("store.purchase.verify.auth.title",{name:u}),scan:i("store.purchase.verify.auth.scan"),confirm:i("store.purchase.verify.auth.confirm"),success:i("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Po.create({baseURL:Jn(l,"/store")}).get,extraParams:{factory:e.nftFactory,nw:f},messages:{title:i("store.purchase.auth.title",{name:u}),scan:i("store.purchase.auth.scan"),confirm:i("store.purchase.auth.confirm"),success:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:i("store.purchase.auth.success")}),o.jsx("p",{children:i("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return o.jsx(Bs,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:l,onSuccess:T,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...y[n]})}no.propTypes={...qh,handlePaySuccess:N.func,mode:N.oneOf(["verify","purchase"]).isRequired};no.defaultProps={handlePaySuccess:()=>{}};const ro=M.forwardRef(({mode:e,...t},n)=>{const[r,i]=M.useState(e!=="both"?e:"verify"),[s,a]=M.useState(e!=="both"?2:1),c=v=>{v!==r&&i(v)},f=()=>{r&&s!==2&&a(2)};return M.useImperativeHandle(n,()=>({onNext:f,getCurrentStep:()=>s})),s===1?o.jsx("div",{style:{maxWidth:520},children:o.jsx(Wa,{action:r,onNext:null,onSelect:c})}):o.jsx(no,{...t,mode:r})});ro.propTypes={mode:N.oneOf(["both","verify","purchase"]).isRequired,ref:N.any};ro.defaultProps={ref:{}};const Gh=ro;function Hh({...e}){return o.jsx(dt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function io({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:i}=gt(),s=Ys();return!e||Lc(e.meta)?o.jsx(Vh,{children:n}):o.jsxs(Xh,{isMobile:s,children:[o.jsx(Hh,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:i("setup.startNow")}),o.jsx(Y,{display:"flex",alignItems:"center",children:n})]})}io.propTypes={blocklet:N.object,onStartNow:N.func,children:N.any,disabled:N.bool};io.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Vh=Ve(Y)`
216
+ `),Rr=h.string().trim().min(1).custom(e=>{if(Ih(e)>Ce.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Ce.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});te.titleSchema=Rr;const Pr=h.string().trim().min(3).max(160).meta({className:"TDescription"});te.descriptionSchema=Pr;const ba=h.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});te.installBlockletTitleSchema=ba;const xa=h.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});te.installBlockletDescriptionSchema=xa;const wa=h.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Yo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Yo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});te.logoSchema=wa;const Ea=h.string().trim().min(1),Ui=Ea.meta({className:"TMountPoint"}).custom((e,t)=>(0,$i.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));te.mountPointSchema=Ui;const Sa=Ea.meta({className:"TUpdateMountPoint"}).custom(e=>(0,$i.default)(e));te.updateMountPointSchema=Sa;const Pn=h.string().custom(e=>((0,ai.validateName)(e),e)).meta({className:"TBlockletName"});te.blockletNameSchema=Pn;const Rh=[],Wi=h.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Rh.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});te.environmentNameSchema=Wi;const zi=h.object({name:Wi.required(),description:h.string().trim().required(),default:h.string().optional().allow("").default(""),required:h.boolean().default(!1),secure:h.boolean().default(!1),validation:h.string().optional(),shared:h.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});te.environmentSchema=zi;const qi=h.object({dev:h.string().trim().min(1),e2eDev:h.string().trim().min(1),preFlight:h.string().trim().min(1),preInstall:h.string().trim().min(1),postInstall:h.string().trim().min(1),preStart:h.string().trim().min(1),postStart:h.string().trim().min(1),preStop:h.string().trim().min(1),preUninstall:h.string().trim().min(1),preConfig:h.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});te.scriptsSchema=qi;const Ki=h.object({name:h.string().required().trim(),config:h.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});te.serviceSchema=Ki;const Gi=h.object({type:h.string().trim(!0).min(1).required(),path:h.string().required(),meta:h.object({vcType:h.string(),payable:h.boolean(),params:h.array().items({name:h.string().required().trim(),description:h.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});te.endpointSchema=Gi;const Ta=h.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});te.cacheableSchema=Ta;const Vi=h.object({type:h.string().lowercase().valid(...Ce.BLOCKLET_INTERFACE_TYPES).required(),name:h.string().trim().required(),path:h.string().trim().default("/"),prefix:h.string().trim().min(1).default(Ce.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:h.number().port().optional(),hostIP:h.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:h.string().lowercase().valid(...Ce.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:h.alternatives().try(h.string().uppercase().default(Ce.BLOCKLET_DEFAULT_PORT_NAME),h.object({internal:h.string().uppercase().required(),external:h.number().port().required()})).default(Ce.BLOCKLET_DEFAULT_PORT_NAME),cacheable:h.array().items(Ta).unique(),services:h.array().items(Ki).unique("name"),endpoints:h.array().items(Gi).unique("type"),pageGroups:h.array().items(h.string().min(1).max(255).trim()).unique(),proxyBehavior:h.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});te.interfaceSchema=Vi;const Ph=h.alternatives().try(h.string().required(),h.object({url:h.string().uri({scheme:["http","https","file"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}).required(),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),li=h.object({platform:h.string().valid(...Ce.BLOCKLET_PLATFORMS).optional(),interpreter:h.string().valid("binary","node","blocklet").default("node"),source:Ph,args:h.array().items(h.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});te.engineSchema=li;const Xn=h.object({name:h.string().min(1).required(),email:h.string().email({tlds:!1}).optional(),url:h.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});te.personSchema=Xn;const Zn=h.object({tarball:h.alternatives().try(h.string().uri(),h.string()).required(),integrity:h.string().required(),size:h.number().optional()}).meta({className:"TDist",unknownType:"any"});te.distSchema=Zn;const ja=h.object({downloads:h.number().integer().greater(-1),star:h.number().default(0),purchases:h.number().default(0)}).meta({className:"TStats",unknownType:"any"});te.statsSchema=ja;const _h=h.alternatives().try(h.object({url:h.alternatives().try(h.string().uri(),h.array().items(h.string().uri()).min(1)).required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}),name:Pn.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),ka={source:_h.required(),required:h.boolean(),title:Rr,description:Pr,mountPoint:Ui,name:Pn},Oa=(e,t)=>h.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),Hi=Oa(ka).meta({className:"TComponent",unknownType:"any"});te.componentSchema=Hi;const Lh=Oa(ka,!0),Ia=({checkStore:e}={})=>{const t=[Hi,Lh];return h.array().items(e?t[0]:t[1]).optional().default([])},Ca=h.object({type:h.string().required(),name:h.string().required(),signer:h.string().required(),pk:h.string().required(),created:h.string().isoDate().required(),sig:h.string().required(),excludes:h.array().items(h.string()).optional(),appended:h.array().items(h.string()).optional(),delegatee:h.string(),delegateePk:h.string(),delegation:h.string()}).meta({className:"TSignature",unknownType:"any"});te.signatureSchema=Ca;const zr=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],es={id:h.string().custom(Ch),title:h.alternatives().try(h.string().min(1).max(Ce.MAX_TITLE_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Ce.MAX_TITLE_LENGTH))).required(),description:h.alternatives().try(h.string().min(1).max(Ce.MAX_DESCRIPTION_LENGTH),h.object().min(1).pattern(h.string().valid(...zr),h.string().min(1).max(Ce.MAX_DESCRIPTION_LENGTH))),link:h.alternatives().try(h.string().custom(Zo),h.object().min(1).pattern(h.string().valid(...zr),h.string().custom(Zo))),component:h.string().min(1),section:h.array().items(h.string().min(1)).single(),role:h.array().items(h.string().min(1)).single(),icon:h.string().min(1),visible:h.boolean()},Ra=h.object({...es,items:h.array().items(h.object({...es}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});te.navigationItemSchema=Ra;const Xi=h.array().items(Ra).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});te.navigationSchema=Xi;const Yi=h.object({background:h.alternatives().try(h.string().min(1),h.object({header:h.string().min(1),footer:h.string().min(1),default:h.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});te.themeSchema=Yi;const Pa=h.object({whoCanAccess:h.string().valid("owner","invited","all"),profileFields:h.array().items(h.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:h.array().items(h.string().min(1)),allowSwitchProfile:h.boolean(),blockUnauthenticated:h.boolean(),blockUnauthorized:h.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});te.authConfigSchema=Pa;const Nh=h.object({type:h.string().trim().min(1).required(),description:h.string().trim().min(1)}),Qi=h.object({did:h.DID().trim().required(),type:h.string().trim().min(1).required(),public:h.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});te.resourceBundleSchema=Qi;const Ji=h.array().items(h.object({type:h.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:h.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});te.eventsSchema=Ji;const _a={did:h.DID().trim().required(),version:h.semver().valid().required(),name:h.string().optional(),description:Pr.required(),group:h.string().valid(...Ce.BLOCKLET_GROUPS),main:h.string().trim(),title:Rr.optional().allow(""),logo:h.string().trim().optional(),specVersion:h.semver().valid().gte("1.0.0").optional(),author:Xn.optional(),contributors:h.array().items(Xn).optional(),maintainers:h.array().items(Xn).optional(),community:h.string().uri().optional().allow("").default(""),documentation:h.string().uri().optional().allow("").default(""),homepage:h.string().uri().optional().allow("").default(""),license:h.string().optional().allow("").default(""),support:h.alternatives().try(h.string().uri(),h.string().email({tlds:!1})).optional(),nftFactory:h.DID().optional().allow("").default(""),payment:h.object({price:h.array().max(1).items(h.object({value:h.number().greater(0).required(),address:h.DID().required()})).default([]),share:h.array().max(4).items(h.object({name:h.string().required(),address:h.DID().required(),value:h.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:h.array().items(h.object({parentPriceRange:h.array().items(h.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:h.string().valid("fixed","percentage").required(),value:h.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),tags:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),gitHash:h.string().optional().allow(""),repository:h.alternatives().try(h.string().min(1),h.object({type:h.string().valid("git","https","svn").required(),url:h.string().uri().required(),directory:h.string()})).optional(),timeout:h.object({start:h.number().min(10).max(600),script:h.number().min(1).max(1800)}).default({start:60}),requirements:h.object({abtnode:h.semverRange().valid(),server:h.semverRange().valid(),os:h.alternatives().try(h.string().valid("*",...Ce.BLOCKLET_PLATFORMS),h.array().items(h.string().valid(...Ce.BLOCKLET_PLATFORMS)).min(1)),cpu:h.alternatives().try(h.string().valid("*",...Ce.BLOCKLET_ARCHITECTURES),h.array().items(h.string().valid(...Ce.BLOCKLET_ARCHITECTURES)).min(1)),fuels:h.array().items(h.object({endpoint:h.string().trim().required(),address:h.string().trim(),value:h.string().trim().required(),reason:h.string().trim().required()})),nodejs:h.semverRange().valid()}).default({server:Ce.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:h.array().items(Vi).unique("name").custom((e,t)=>{if(e.filter(i=>i.type===Ce.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Ce.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(i=>i.type===Ce.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const i of r)if(!i.prefix.startsWith(Jo))return t.message(`Wellknown path prefix must start with: ${Jo}`);return e}).default([]),environments:h.array().items(zi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,i)=>e.findIndex(s=>s.name===r.name)!==i);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:qi,capabilities:h.object({clusterMode:h.boolean(),didSpace:h.string().valid(...Object.values(Ce.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:h.boolean().default(!0),serverless:h.boolean().optional(),component:h.boolean(),sitemap:h.boolean().optional(),mcp:h.boolean().optional()}).default({}),files:h.array().items(h.string().trim()).optional(),resource:h.object({exportApi:h.string().trim(),bundles:h.array().items(Qi),types:h.array().items(Nh).max(10)}),engine:h.alternatives().try(li,h.array().items(li)).optional(),screenshots:h.array().items(h.string().min(1)).optional().default([]),videos:h.array().items(h.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:h.string().optional().allow(""),dist:Zn.optional(),stats:ja.optional(),htmlAst:h.any().optional(),path:h.string().optional(),signatures:h.array().items(Ca).optional(),lastPublishedAt:h.string().isoDate().optional().allow(null),components:Ia(),navigation:Xi,theme:Yi,copyright:h.object({owner:h.string().min(1),year:h.alternatives().try(h.string(),h.number())}),bundleName:h.string(),bundleDid:h.DID().trim(),storeId:h.string(),events:Ji.optional()},Ah=h.object(_a).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});te.blockletMetaSchema=Ah;const La=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,...a}={})=>((!e||!xh.default.existsSync(e))&&(t=!1),h.object({..._a,owner:h.object({avatar:h.string().optional(),did:h.DID().trim().required(),fullName:h.string().trim().required(),email:h.string().optional().allow(null).empty("").default("")}).optional(),logo:t?h.file().trim().exists({baseDir:e}).optional():h.string().trim().optional(),files:h.array().items(t?h.file().exists({baseDir:e,canSkip:(c,f)=>[Ce.BLOCKLET_ENTRY_FILE,Ce.BLOCKLET_BUNDLE_FILE].includes(f)||(0,Sh.default)(f)}):h.string().trim()).optional(),dist:n?Zn.required():Zn.optional(),components:Ia({checkStore:r}),name:i?h.string().optional():h.string().required(),egress:h.boolean().optional().default(!0),docker:kh.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...a}).rename("children","components").custom((c,f)=>{const{did:v,name:l,docker:u}=c;if(u){const{image:y,dockerfile:S,network:j}=u;if(!y&&!S)return f.message("Image or dockerfile must be set");if(y&&S)return f.message("Image and dockerfile cannot be set at the same time");if(j)return f.message("ExportPorts and network cannot be set at the same time");if(S&&(c.files||(c.files=[]),c.files.push(S)),u.volumes)for(const L of u.volumes){if(!L.startsWith("$BLOCKLET_APP_DIR/")&&!L.startsWith("$BLOCKLET_DATA_DIR/"))return f.message("Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR");if(L.indexOf("..")>-1)return f.message('Volume cannot contain ".."')}}let T;if((0,jh.isValid)(v))try{return(0,ai.validateNewDid)(v),c}catch(y){T=y}if(l){(0,ai.validateName)(l,{checkDid:!s});const y=(0,Oh.default)(l);return y!==v?f.message(`The did of name "${l}" should be "${y}"`):c}return T?f.message(T.message):c}));te.createBlockletSchema=La;te.default={blockletNameSchema:Pn,componentSchema:Hi,endpointSchema:Gi,serviceSchema:Ki,createBlockletSchema:La,interfaceSchema:Vi,environmentSchema:zi,environmentNameSchema:Wi,scriptsSchema:qi,personSchema:Xn,distSchema:Zn,titleSchema:Rr,descriptionSchema:Pr,logoSchema:wa,navigationSchema:Xi,themeSchema:Yi,mountPointSchema:Ui,updateMountPointSchema:Sa,authConfigSchema:Pa,resourceBundleSchema:Qi,installBlockletTitleSchema:ba,installBlockletDescriptionSchema:xa,eventsSchema:Ji,Joi:h};var bt={},Dh=Se&&Se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(bt,"__esModule",{value:!0});bt.setService=bt.findService=bt.getDefaultServiceConfig=bt.getServiceConfig=void 0;const Mh=Dh(eu),Fh=te,Na={},Zi=e=>{Na[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};bt.setService=Zi;Zi({name:"auth",schema:Fh.authConfigSchema,default:{}});const Aa=e=>{if(!e)throw new Error("service name should not be empty");const t=Na[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Da=(e,t,{validate:n}={})=>{const r=Aa(e),i=(0,Mh.default)(t||{}),{value:s,error:a}=r.validate(i);if(n&&a)throw new Error(`Invalid blocklet service config: ${a.details.map(c=>c.message).join(", ")}`);return s};bt.getServiceConfig=Da;const Ma=e=>{const{defaultConfig:t}=Aa(e);return t};bt.getDefaultServiceConfig=Ma;const Fa=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};bt.findService=Fa;bt.default={getServiceConfig:Da,getDefaultServiceConfig:Ma,findService:Fa,setService:Zi};Object.defineProperty(mn,"__esModule",{value:!0});mn.fixAndValidateService=mn.validateMeta=void 0;const Bh=te,$h=bt,Uh=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,$h.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);mn.fixAndValidateService=Uh;const Ba=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,schemaOptions:a={}}={})=>{const c=(0,Bh.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:i,skipValidateDidName:s,...a}),{value:f,error:v}=c.validate(e);if(v)throw new Error(`Invalid blocklet meta: ${v.details.map(l=>l.message).join(", ")}`);return f};mn.validateMeta=Ba;mn.default=Ba;(function(e){var t=Se&&Se.__createBinding||(Object.create?function(I,F,V,$){$===void 0&&($=V);var le=Object.getOwnPropertyDescriptor(F,V);(!le||("get"in le?!F.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return F[V]}}),Object.defineProperty(I,$,le)}:function(I,F,V,$){$===void 0&&($=V),I[$]=F[V]}),n=Se&&Se.__setModuleDefault||(Object.create?function(I,F){Object.defineProperty(I,"default",{enumerable:!0,value:F})}:function(I,F){I.default=F}),r=Se&&Se.__importStar||function(){var I=function(F){return I=Object.getOwnPropertyNames||function(V){var $=[];for(var le in V)Object.prototype.hasOwnProperty.call(V,le)&&($[$.length]=le);return $},I(F)};return function(F){if(F&&F.__esModule)return F;var V={};if(F!=null)for(var $=I(F),le=0;le<$.length;le++)$[le]!=="default"&&t(V,F,$[le]);return n(V,F),V}}(),i=Se&&Se.__importDefault||function(I){return I&&I.__esModule?I:{default:I}};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 s=i(Cc),a=r(Md),c=kt,f=mn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return f.fixAndValidateService}});const v=Bi,l=(I,F)=>{I.description||(I.description=`Blocklet from ${F}`),I.version||(I.version=c.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=l;const u=I=>{if(I.repository&&(typeof I.repository=="string"&&(I.repository={type:"git",url:I.repository}),I.repository.url)){const F=a.fromUrl(I.repository.url);F&&(I.repository.url=F.getDefaultRepresentation()==="shortcut"?F.https():F.toString())}};e.fixRepository=u;const T=I=>{Array.isArray(I.files)?I.files&&(I.files=I.files.filter(F=>!(!F||typeof F!="string"))):delete I.files};e.fixFiles=T;const y=I=>{typeof I.keywords=="string"&&(I.keywords=I.keywords.split(/,\s+/)),I.keywords&&!Array.isArray(I.keywords)?delete I.keywords:I.keywords&&(I.keywords=I.keywords.filter(F=>!(typeof F!="string"||!F)))};e.fixKeywords=y;const S=I=>{typeof I.tags=="string"&&(I.tags=I.tags.split(/,\s+/)),I.tags&&!Array.isArray(I.tags)?delete I.tags:I.tags&&(I.tags=I.tags.filter(F=>!(typeof F!="string"||!F)))};e.fixTags=S;const j=(I,F)=>(I.author&&(I.author=F(I.author)),["maintainers","contributors"].forEach(V=>{Array.isArray(I[V])&&(I[V]=I[V].map(F))}),I),L=I=>{if(!I)return"";if(typeof I=="string")return I;const F=I.name||"",V=I.url||I.web,$=V?` (${V})`:"",le=I.email||I.mail,H=le?` <${le}>`:"";return F+H+$};e.formatPerson=L;const D=I=>{if(typeof I!="string")return I;const F=I.match(/^([^(<]+)/),V=I.match(/\(([^)]+)\)/),$=I.match(/<([^>]+)>/),le={};return F&&F[0].trim()&&(le.name=F[0].trim()),$&&([,le.email]=$),V&&([,le.url]=V),le};e.parsePerson=D;const A=I=>(j(I,L),j(I,D),I);e.fixPerson=A;const B=(I,F=!0)=>{if(Array.isArray(I.interfaces)||(I.interfaces=[]),I.interfaces.length)return I.interfaces.forEach(H=>{H.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(H.protocol="http")}),I;const $=(0,s.default)(I,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",le=({type:H="web",name:se,path:je="/",protocol:We="http",port:Me=c.BLOCKLET_DEFAULT_PORT_NAME})=>{I.interfaces.push({type:H,name:se,path:je,prefix:$,port:Me,protocol:We})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(H=>{I[H]&&le({name:H,path:I[H]})}),Array.isArray(I.exposeServices)&&I.exposeServices.forEach(H=>{le({type:"service",name:H.protocol,protocol:H.protocol,port:{internal:`BLOCKLET_${H.protocol}_PORT`.toUpperCase(),external:H.port}})}),F&&(delete I.publicUrl,delete I.adminUrl,delete I.configUrl,delete I.docUrl,delete I.exposeServices,I.capabilities&&delete I.capabilities.dynamicPathPrefix),I};e.fixInterfaces=B;const G=I=>{const{did:F}=I;try{(0,v.validateNewDid)(F),I.name=F}catch{}return I};e.fixName=G,e.default={fixRequired:l,fixRepository:u,fixFiles:T,fixKeywords:y,fixPerson:A,fixTags:S,fixName:G,formatPerson:L,parsePerson:D,fixInterfaces:B,fixService:f.fixAndValidateService}})(oa);function $a({owner:e,locale:t}){return o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?o.jsx(Ms,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}$a.propTypes={owner:N.object.isRequired,locale:N.string.isRequired};const Wh="install-blocklet-from-URL",Ua=()=>{const[e,t]=Hs(Wh,"[]",{raw:!0}),n=i=>{const s=i.trim(),a=JSON.parse(e),c=a.findIndex(f=>f===s);c!==0&&(c>0&&a.splice(c,1),a.length>=10&&a.splice(9),a.unshift(s),t(JSON.stringify(a)))},r=i=>{if(!i)return;const s=JSON.parse(e),a=i.trim(),c=s.findIndex(f=>f===a);c>-1&&(s.splice(c,1),t(JSON.stringify(s)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},zh=ks(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function eo(e){const{value:t,onValueChange:n,children:r,helperText:i}=e,{urls:s,removeUrlRecord:a}=Ua(),c=(v,l)=>{v.preventDefault(),v.stopPropagation(),a(l)},f=zh();return o.jsxs(Y,{children:[o.jsx(Os,{freeSolo:!0,options:s,inputValue:t,onInputChange:(v,l)=>{n(l)},disableClearable:!0,popupIcon:null,renderInput:v=>Mt.cloneElement(r,{...v}),renderOption:(v,l)=>M.createElement(Is,{...v,key:l,secondaryAction:o.jsx(js,{edge:"end","aria-label":"delete",onClick:u=>c(u,l),children:o.jsx(nc,{})})},o.jsx(Il,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:o.jsx(Cs,{primary:l,className:f.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),o.jsx(Cl,{style:{margin:0},children:i})]})}eo.propTypes={onValueChange:N.func,children:N.node,value:N.string,helperText:N.string};eo.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function to({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:i,handleText:s}){const{api:a}=_n(),{api:c}=tu(),[f,v]=M.useState(!1),[l,u]=M.useState(""),{t:T,locale:y}=gt(),S={dist:{}},[j,L]=M.useState(e),[D,A]=M.useState(e?1:0),[B,G]=M.useState(S),[I,F]=M.useState(!1),[V,$]=M.useState({}),le=i==="component",H=le?!0:!e,{addUrlRecord:se}=Ua(),je=async()=>{G(S),u(null),v(!0);let oe=j.trim();!oe.startsWith("https://")&&!oe.startsWith("http://")&&!oe.startsWith("file://")&&(oe=`file://${oe}`);try{const Ae=decodeURIComponent(oe);try{new URL(Ae)}catch{throw new Error("Invalid URL")}const{meta:we,inStore:Je,registryUrl:qe}=await a.getBlockletMetaFromUrl({input:{url:Ae}});G(we),$({inStore:Je,registryUrl:qe,inputUrl:oe}),se(oe)}catch(Ae){console.error(Ae);const we=`Blocklet Install failed: ${Xs(Ae)}`;u(we),r(Ae)}finally{v(!1)}},We=()=>{if(le){n({meta:B,...V}),t();return}v(!0),F(!0)},Me=()=>{v(!1),F(!1),n({meta:B,...V}),t()},Qe=()=>{v(!1),F(!1)};M.useEffect(()=>{e&&je()},[e]);const Z=[{name:T("common.name"),value:Dt.getDisplayName({meta:B},!0)},{name:T("common.version"),value:B.version},{name:T("common.did"),value:B.did?o.jsx(nu,{did:B.did}):null},{name:T("common.author"),value:B.owner?o.jsx($a,{owner:B.owner,locale:y}):oa.formatPerson(B.author)},{name:T("blocklet.dist.downloadLink"),value:B.dist.tarball}],pe=()=>f?o.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:o.jsx(xt,{})}):B.did?o.jsx("div",{style:{paddingLeft:"10%"},children:Z.map(oe=>oe.name===T("common.did")?o.jsx(Lo,{valueComponent:"div",nameWidth:120,name:oe.name,nameFormatter:()=>T("common.did"),children:oe.value},oe.name):o.jsx(Lo,{valueComponent:"div",nameWidth:120,name:oe.name,children:oe.value},oe.name))}):null,ee=[{label:T("blocklet.fromUrl.step0"),body:o.jsx(ge,{component:"div",children:o.jsx(eo,{style:{marginBottom:32},value:j,helperText:T("blocklet.fromUrl.description"),onValueChange:oe=>{u(null),L(oe)},children:o.jsx(Sr,{label:T("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:j,onChange:oe=>{u(null),L(oe.target.value)},disabled:f,onKeyPress:oe=>{oe.key==="Enter"&&(oe.preventDefault(),je(),A(1))}})})}),cancel:T("common.cancel"),confirm:T("common.next"),onCancel:t,onConfirm:()=>{je(),A(1)}},{label:T("blocklet.fromUrl.step1"),body:pe(),cancel:T(H?"common.pre":"common.cancel"),confirm:(s==null?void 0:s.confirm)||T("blocklet.fromUrl.confirm"),onCancel:()=>{H?A(oe=>oe-1):t()},onConfirm:()=>{We()}}],ye=ee[D];return o.jsxs(o.Fragment,{children:[o.jsxs(ki,{title:(s==null?void 0:s.title)||T("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>ye.onCancel(),showCloseButton:D===0,disableEscapeKeyDown:!0,open:!0,actions:o.jsxs(o.Fragment,{children:[ye.cancel&&o.jsx(dt,{onClick:oe=>{oe.stopPropagation(),u(null),ye.onCancel()},color:"inherit",children:ye.cancel||T("common.cancel")}),o.jsxs(dt,{onClick:oe=>{oe.stopPropagation(),ye.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:f||!j||l,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[f&&D===0&&o.jsx(xt,{size:16}),ye.confirm]})]}),children:[H&&o.jsx(Rl,{alternativeLabel:!0,activeStep:D,children:ee.map(({label:oe})=>o.jsx(Pl,{children:o.jsx(_l,{children:oe})},oe))}),o.jsx(Ll,{component:"div",style:{marginTop:24},children:ye.body}),!!l&&o.jsx(Rs,{severity:"error",style:{width:"100%",marginTop:8},children:l})]}),B&&I&&o.jsx(Bs,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:c.get,checkTimeout:5*60*1e3,onSuccess:Me,extraParams:{title:B.title,wt:Rc(B),blockletMetaUrl:decodeURIComponent(j.trim())},messages:{title:T("setup.keyPair.title"),scan:T("setup.keyPair.scan"),confirm:T("setup.keyPair.confirm"),success:T("setup.keyPair.success")},onClose:Qe})]})}to.propTypes={defaultUrl:N.string,onCancel:N.func.isRequired,onSuccess:N.func.isRequired,onError:N.func,mode:N.oneOf(["install","component"]),handleText:N.object};to.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const qh={meta:N.object.isRequired,onCancel:N.func.isRequired},Kh=ks(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function Wa({action:e,onSelect:t,onNext:n}){const r=Kh(),{t:i}=gt(),s=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return o.jsxs(o.Fragment,{children:[o.jsx(Nl,{className:r.tabPanel,children:s.map(a=>o.jsxs(Is,{button:!0,selected:e===a.action,onClick:()=>t(a.action),children:[o.jsx(Al,{className:r.iconRoot,children:a.action==="purchase"?o.jsx(ru,{style:{color:e==="purchase"?Oo.primary.main:"#AAA",fontSize:32}}):o.jsx(iu,{style:{color:e==="verify"?Oo.primary.main:"#AAA",fontSize:32}})}),o.jsx(Cs,{primary:a.title,secondary:a.description})]},a.action))}),n&&o.jsx(dt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:i("common.next")})]})}Wa.propTypes={action:N.oneOf(["both","purchase","verify"]).isRequired,onSelect:N.func.isRequired,onNext:N.func.isRequired};function no({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:i,locale:s}=gt(),{info:a}=_n(),c=Pc(a),[f,v]=M.useState(null),l=new URL(e==null?void 0:e.registryUrl).origin,u=Dt.getDisplayName({meta:e}),T=async(S,j)=>{const L=({downloadTokenList:B})=>{r({downloadTokenList:B})},D=B=>{Oi.error(B),t(B)};function A(B){return rc(()=>No.get(B).then(async({data:G})=>{const I=G==null?void 0:G.downloadTokenList;if(G.status==="succeed"){if(I&&I.length)await L({downloadTokenList:I});else return await D(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return G.status==="error"?(console.error("vc error: ",G),await D(G==null?void 0:G.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&f){const{statusUrl:B}=_c(f);await A(B)}else await L({downloadTokenList:S.downloadTokenList&&j(S.downloadTokenList)})};if(M.useEffect(()=>{if(n==="purchase"){const S=new URL(l);S.pathname="/api/did/verify-purchase-blocklet/token",S.searchParams.set("serverDid",a.did),S.searchParams.set("blockletDid",e==null?void 0:e.did);try{No.get(S.href).then(({data:j})=>{const L=`${j.url}`;v(L)})}catch(j){console.error("get next workflow url error: ",j)}}return()=>{v(null)}},[n]),n==="purchase"&&!f)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:Po.create({baseURL:l}).get,extraParams:{serverDid:a.did,blockletDid:e==null?void 0:e.did},messages:{title:i("store.purchase.verify.auth.title",{name:u}),scan:i("store.purchase.verify.auth.scan"),confirm:i("store.purchase.verify.auth.confirm"),success:i("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Po.create({baseURL:Jn(l,"/store")}).get,extraParams:{factory:e.nftFactory,nw:f},messages:{title:i("store.purchase.auth.title",{name:u}),scan:i("store.purchase.auth.scan"),confirm:i("store.purchase.auth.confirm"),success:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:i("store.purchase.auth.success")}),o.jsx("p",{children:i("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return o.jsx(Bs,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:l,onSuccess:T,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...y[n]})}no.propTypes={...qh,handlePaySuccess:N.func,mode:N.oneOf(["verify","purchase"]).isRequired};no.defaultProps={handlePaySuccess:()=>{}};const ro=M.forwardRef(({mode:e,...t},n)=>{const[r,i]=M.useState(e!=="both"?e:"verify"),[s,a]=M.useState(e!=="both"?2:1),c=v=>{v!==r&&i(v)},f=()=>{r&&s!==2&&a(2)};return M.useImperativeHandle(n,()=>({onNext:f,getCurrentStep:()=>s})),s===1?o.jsx("div",{style:{maxWidth:520},children:o.jsx(Wa,{action:r,onNext:null,onSelect:c})}):o.jsx(no,{...t,mode:r})});ro.propTypes={mode:N.oneOf(["both","verify","purchase"]).isRequired,ref:N.any};ro.defaultProps={ref:{}};const Gh=ro;function Vh({...e}){return o.jsx(dt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function io({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:i}=gt(),s=Ys();return!e||Lc(e.meta)?o.jsx(Hh,{children:n}):o.jsxs(Xh,{isMobile:s,children:[o.jsx(Vh,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:i("setup.startNow")}),o.jsx(Y,{display:"flex",alignItems:"center",children:n})]})}io.propTypes={blocklet:N.object,onStartNow:N.func,children:N.any,disabled:N.bool};io.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const Hh=He(Y)`
217
217
  width: 100%;
218
218
  margin-top: auto;
219
219
  padding-top: 24px;
@@ -228,7 +228,7 @@ see detail in https://www.npmjs.com/package/is-var-name
228
228
  width: 100%;
229
229
  }
230
230
  }
231
- `,Xh=Ve(Y)`
231
+ `,Xh=He(Y)`
232
232
  padding-top: 24px;
233
233
  margin-top: auto;
234
234
  width: 100%;
@@ -258,12 +258,12 @@ see detail in https://www.npmjs.com/package/is-var-name
258
258
  justify-content: space-between;
259
259
  gap: '32px',
260
260
  }}
261
- `;function oo({blockletMeta:e,onEndpointUpdate:t}){var c;const n=Ys(),{blocklet:r}=kr(),{updateSpaceGateway:i,loading:s,hasStorageEndpoint:a}=Bc();return M.useEffect(()=>{t==null||t()},[r]),s?o.jsx(ic,{relative:"parent",children:o.jsx(xt,{})}):o.jsxs(Yh,{children:[o.jsx(Y,{width:n?"360px":"720px",children:a?o.jsx(lu,{}):o.jsx(cu,{})}),((c=e==null?void 0:e.capabilities)==null?void 0:c.didSpace)==="required"&&o.jsx(io,{mt:8,children:o.jsx(uu,{onConnect:i})})]})}oo.propTypes={blockletMeta:N.any.isRequired,onEndpointUpdate:Dl.func};oo.defaultProps={onEndpointUpdate:()=>{}};const Yh=Ve(au)`
261
+ `;function oo({blockletMeta:e,onEndpointUpdate:t}){var c;const n=Ys(),{blocklet:r}=kr(),{updateSpaceGateway:i,loading:s,hasStorageEndpoint:a}=Bc();return M.useEffect(()=>{t==null||t()},[r]),s?o.jsx(ic,{relative:"parent",children:o.jsx(xt,{})}):o.jsxs(Yh,{children:[o.jsx(Y,{width:n?"360px":"720px",children:a?o.jsx(lu,{}):o.jsx(cu,{})}),((c=e==null?void 0:e.capabilities)==null?void 0:c.didSpace)==="required"&&o.jsx(io,{mt:8,children:o.jsx(uu,{onConnect:i})})]})}oo.propTypes={blockletMeta:N.any.isRequired,onEndpointUpdate:Dl.func};oo.defaultProps={onEndpointUpdate:()=>{}};const Yh=He(au)`
262
262
  height: 100%;
263
263
  overflow-y: auto;
264
264
  padding-bottom: 32px;
265
265
  overflow-x: hidden;
266
- `;function so({onChange:e,loading:t,children:n,extra:r,stores:i,storageKey:s}){const{t:a}=gt(),{info:c,inService:f}=_n(),{blocklet:v}=kr(),[l,u]=M.useState(!1),T=M.useRef(null),[y,S]=M.useState(),[j,L]=Vs(s||"tmp"),[D,A]=s?[j,L]:[y,S],{storeList:B,teamDid:G}=Ks({fromBlocklet:f,blocklet:v,nodeInfo:c}),I=qs([...i.map(H=>({...H,protected:!0})),...B],"url"),F=D&&I.find(H=>D===H.url)||I[0];return o.jsxs(o.Fragment,{children:[o.jsxs(Qh,{children:[o.jsx(dt,{ref:T,color:"primary","data-cy":"add-component-select-store",endIcon:o.jsx(du,{color:"primary"}),onClick:()=>{u(!0)},style:{padding:"0 2px"},children:o.jsx(ge,{color:"primary",children:F.name})}),o.jsx(ge,{color:"primary",children:r})]}),o.jsxs(Sr,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:a("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:F,autoFocus:!0,onChange:H=>{const $=H.target.value;A($.url),e($)},SelectProps:{open:l,MenuProps:{anchorEl:T.current},renderValue:H=>H==null?void 0:H.name,onClose:()=>{u(!1)}},style:{display:"none"},margin:"normal",children:[I==null?void 0:I.map(H=>o.jsx(Si,{sx:{width:"400px",maxWidth:"90vw"},value:H,"data-cy":H.url,children:o.jsx(Ql,{teamDid:G,store:H,onDelete:()=>{var $;D===H.url&&A(($=I[0])==null?void 0:$.url)}})},H.url)),!Ds.isInServerlessMode(c)&&o.jsx(Jl,{disabled:t,storeList:I,teamDid:G,onAdd:H=>{A(H)}})]}),n({currentRegistry:F})]})}so.propTypes={onChange:N.func,loading:N.bool,children:N.any.isRequired,extra:N.node,storageKey:N.string,stores:N.arrayOf(N.shape({name:N.string.isRequired,url:N.string.isRequired}))};so.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Qh=Ve.div`
266
+ `;function so({onChange:e,loading:t,children:n,extra:r,stores:i,storageKey:s}){const{t:a}=gt(),{info:c,inService:f}=_n(),{blocklet:v}=kr(),[l,u]=M.useState(!1),T=M.useRef(null),[y,S]=M.useState(),[j,L]=Hs(s||"tmp"),[D,A]=s?[j,L]:[y,S],{storeList:B,teamDid:G}=Ks({fromBlocklet:f,blocklet:v,nodeInfo:c}),I=qs([...i.map(V=>({...V,protected:!0})),...B],"url"),F=D&&I.find(V=>D===V.url)||I[0];return o.jsxs(o.Fragment,{children:[o.jsxs(Qh,{children:[o.jsx(dt,{ref:T,color:"primary","data-cy":"add-component-select-store",endIcon:o.jsx(du,{color:"primary"}),onClick:()=>{u(!0)},style:{padding:"0 2px"},children:o.jsx(ge,{color:"primary",children:F.name})}),o.jsx(ge,{color:"primary",children:r})]}),o.jsxs(Sr,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:a("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:F,autoFocus:!0,onChange:V=>{const $=V.target.value;A($.url),e($)},SelectProps:{open:l,MenuProps:{anchorEl:T.current},renderValue:V=>V==null?void 0:V.name,onClose:()=>{u(!1)}},style:{display:"none"},margin:"normal",children:[I==null?void 0:I.map(V=>o.jsx(Si,{sx:{width:"400px",maxWidth:"90vw"},value:V,"data-cy":V.url,children:o.jsx(Ql,{teamDid:G,store:V,onDelete:()=>{var $;D===V.url&&A(($=I[0])==null?void 0:$.url)}})},V.url)),!Ds.isInServerlessMode(c)&&o.jsx(Jl,{disabled:t,storeList:I,teamDid:G,onAdd:V=>{A(V)}})]}),n({currentRegistry:F})]})}so.propTypes={onChange:N.func,loading:N.bool,children:N.any.isRequired,extra:N.node,storageKey:N.string,stores:N.arrayOf(N.shape({name:N.string.isRequired,url:N.string.isRequired}))};so.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const Qh=He.div`
267
267
  display: flex;
268
268
  justify-content: space-between;
269
269
  align-items: center;
@@ -482,8 +482,8 @@ see detail in https://www.npmjs.com/package/is-var-name
482
482
  color: ${e=>e.theme.palette.common.white}!important;
483
483
  }
484
484
  }
485
- `;const ts=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Zh=(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`},za={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 ci({title:e,sx:t,children:n,slotProps:r,fontSize:i=12,fontWeight:s=500,color:a="text.secondary",...c}){var f,v;return e?o.jsx(Ps,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Ml.tooltip}`]:{backgroundColor:"common.white",fontSize:i,fontWeight:s,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:a,display:"flex",alignItems:"center"}},...Array.isArray((f=r==null?void 0:r.popper)==null?void 0:f.sx)?r.popper.sx:[(v=r==null?void 0:r.popper)==null?void 0:v.sx]]}},children:n}):n}function cr({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(i)?i:[i]],children:[e,o.jsx(ci,{title:r||(typeof t=="string"?t:""),children:o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function ef(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:v="Install",buttonDisabled:l,buttonLoading:u,button:T,onButtonClick:y=()=>{},onMainClick:S,className:j,ref:L,icons:D,status:A,...B}=e,G=yn(),I=(V,se=()=>!1)=>(je,...We)=>{const Me=V instanceof Function;(se()||Me)&&(je.preventDefault(),je.stopPropagation(),Me&&V(...We))},F=S&&I(S),H=I(y,()=>!!(T||l||u)),$=M.isValidElement(t)?{children:t}:{title:ts(t),dangerouslySetInnerHTML:{__html:t}},le=M.isValidElement(n)?{children:n}:{title:ts(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Fl,{variant:"outlined",onClick:F,...B,sx:{p:{xs:2,md:3},borderRadius:2,...B.sx},children:[o.jsxs(rt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(br,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...$}),o.jsxs(Y,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[f&&o.jsx(ci,{title:f.tooltip,children:o.jsx(uc,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),D==null?void 0:D.map(V=>o.jsx(ci,{title:V.title,children:typeof V.icon=="string"?o.jsx(pt,{icon:V.icon,style:{color:V.color}}):V.icon},V.key))]}),y&&o.jsxs(dt,{color:"reverse",variant:"outlined",size:"small",disabled:l||u,style:{borderColor:G.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:G.typography.fontWeightMedium},onClick:H,children:[u&&o.jsx(xt,{size:15,style:{marginRight:3,color:"inherit"}}),v]}),T]}),o.jsx(rt,{py:2,children:o.jsx(ge,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...le})}),o.jsxs(rt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(cr,{icon:o.jsx(br,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(cr,{icon:o.jsx(pt,{icon:za}),title:a,children:Zh(a)}),A==null?void 0:A.filter(V=>V.align!=="right").map(V=>o.jsx(cr,{icon:typeof V.icon=="string"?o.jsx(pt,{icon:V.icon}):V.icon,title:V.title,maxWidth:V.maxWidth,children:V.text},V.key)),o.jsx(Y,{sx:{flex:1}}),A==null?void 0:A.filter(V=>V.align==="right").map(V=>o.jsx(cr,{icon:typeof V.icon=="string"?o.jsx(pt,{icon:V.icon}):V.icon,title:V.title,maxWidth:V.maxWidth,sx:{color:V.color},children:V.text},V.key))]})]})}const tf={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>'},Yn=/^[a-z0-9]+(-[a-z0-9]+)*$/,_r=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),f=i.pop(),v={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!vr(v)?null:v}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!vr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!vr(c,n)?null:c}return null},vr=(e,t)=>e?!!((e.provider===""||e.provider.match(Yn))&&(t&&e.prefix===""||e.prefix.match(Yn))&&e.name.match(Yn)):!1,qa=Object.freeze({left:0,top:0,width:16,height:16}),wr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ao=Object.freeze({...qa,...wr}),ui=Object.freeze({...ao,body:"",hidden:!1});function nf(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function ns(e,t){const n=nf(e,t);for(const r in ui)r in wr?r in e&&!(r in n)&&(n[r]=wr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function rf(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,f=c&&s(c);f&&(i[a]=[c].concat(f))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function of(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=ns(r[c]||i[c],s)}return a(t),n.forEach(a),ns(e,s)}function Ka(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=rf(e);for(const i in r){const s=r[i];s&&(t(i,of(e,i,s)),n.push(i))}return n}const sf={provider:"",aliases:{},not_found:{},...qa};function qr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ga(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!qr(e,sf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Yn)||typeof s.body!="string"||!qr(s,ui))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(Yn)||typeof a!="string"||!n[a]&&!r[a]||!qr(s,ui))return null}return t}const rs=Object.create(null);function af(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function vn(e,t){const n=rs[e]||(rs[e]=Object.create(null));return n[t]||(n[t]=af(e,t))}function lo(e,t){return Ga(t)?Ka(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function lf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let er=!1;function Ha(e){return typeof e=="boolean"&&(er=e),er}function cf(e){const t=typeof e=="string"?_r(e,!0,er):e;if(t){const n=vn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function uf(e,t){const n=_r(e,!0,er);if(!n)return!1;const r=vn(n.provider,n.prefix);return lf(r,n.name,t)}function df(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),er&&!t&&!e.prefix){let i=!1;return Ga(e)&&(e.prefix="",Ka(e,(s,a)=>{a&&uf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!vr({provider:t,prefix:n,name:"a"}))return!1;const r=vn(t,n);return!!lo(r,e)}const Va=Object.freeze({width:null,height:null}),Xa=Object.freeze({...Va,...wr}),hf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ff=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function is(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(hf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=ff.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}const pf=e=>e==="unset"||e==="undefined"||e==="none";function mf(e,t){const n={...ao,...e},r={...Xa,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(S=>{const j=[],L=S.hFlip,D=S.vFlip;let A=S.rotate;L?D?A+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):D&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let B;switch(A<0&&(A-=Math.floor(A/4)*4),A=A%4,A){case 1:B=i.height/2+i.top,j.unshift("rotate(90 "+B.toString()+" "+B.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:B=i.width/2+i.left,j.unshift("rotate(-90 "+B.toString()+" "+B.toString()+")");break}A%2===1&&(i.left!==i.top&&(B=i.left,i.left=i.top,i.top=B),i.width!==i.height&&(B=i.width,i.width=i.height,i.height=B)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,v=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?v:c,l=is(u,f/v)):(l=a==="auto"?f:a,u=c===null?is(l,v/f):c==="auto"?v:c);const T={},y=(S,j)=>{pf(j)||(T[S]=j.toString())};return y("width",l),y("height",u),T.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+v.toString(),{attributes:T,body:s}}const gf=/\sid="(\S+)"/g,vf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let yf=0;function bf(e,t=vf){const n=[];let r;for(;r=gf.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(yf++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const di=Object.create(null);function xf(e,t){di[e]=t}function hi(e){return di[e]||di[""]}function co(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const uo=Object.create(null),Gn=["https://api.simplesvg.com","https://api.unisvg.com"],yr=[];for(;Gn.length>0;)Gn.length===1||Math.random()>.5?yr.push(Gn.shift()):yr.push(Gn.pop());uo[""]=co({resources:["https://api.iconify.design"].concat(yr)});function wf(e,t){const n=co(t);return n===null?!1:(uo[e]=n,!0)}function ho(e){return uo[e]}const Ef=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let os=Ef();function Sf(e,t){const n=ho(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Tf(e){return e===404}const jf=(e,t,n)=>{const r=[],i=Sf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,v)=>{c+=f.length+1,c>=i&&v>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function kf(e){if(typeof e=="string"){const t=ho(e);if(t)return t.path}return"/"}const Of=(e,t,n)=>{if(!os){n("abort",424);return}let r=kf(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),f=new URLSearchParams({icons:c});r+=s+".json?"+f.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;os(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Tf(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},If={prepare:jf,send:Of};function Cf(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,f=n[s]||(n[s]=Object.create(null)),v=f[a]||(f[a]=vn(s,a));let l;c in v.icons?l=t.loaded:a===""||v.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Ya(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Rf(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(f=>{if(f.prefix!==i)return!0;const v=f.name;if(e.icons[v])a.loaded.push({provider:r,prefix:i,name:v});else if(e.missing.has(v))a.missing.push({provider:r,prefix:i,name:v});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Ya([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Pf=0;function _f(e,t,n){const r=Pf++,i=Ya.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function Lf(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?_r(i,t,n):i;s&&r.push(s)}),r}var Nf={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Af(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let F=e.resources.slice(0);for(a=[];F.length>1;){const H=Math.floor(Math.random()*F.length);a.push(F[H]),F=F.slice(0,H).concat(F.slice(H+1))}a=a.concat(F)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",v=0,l,u=null,T=[],y=[];typeof r=="function"&&y.push(r);function S(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),S(),T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function L(F,H){H&&(y=[]),typeof F=="function"&&y.push(F)}function D(){return{startTime:c,payload:t,status:f,queriesSent:v,queriesPending:T.length,subscribe:L,abort:j}}function A(){f="failed",y.forEach(F=>{F(void 0,l)})}function B(){T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function G(F,H,$){const le=H!=="success";switch(T=T.filter(V=>V!==F),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(H==="abort"){l=$,A();return}if(le){l=$,T.length||(a.length?I():A());return}if(S(),B(),!e.random){const V=e.resources.indexOf(F.resource);V!==-1&&V!==e.index&&(e.index=V)}f="completed",y.forEach(V=>{V($)})}function I(){if(f!=="pending")return;S();const F=a.shift();if(F===void 0){if(T.length){u=setTimeout(()=>{S(),f==="pending"&&(B(),A())},e.timeout);return}A();return}const H={status:"pending",resource:F,callback:($,le)=>{G(H,$,le)}};T.push(H),v++,u=setTimeout(I,e.rotate),n(F,t,H.callback)}return setTimeout(I),D}function Qa(e){const t={...Nf,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,v){const l=Af(t,c,f,(u,T)=>{r(),v&&v(u,T)});return n.push(l),l}function s(c){return n.find(f=>c(f))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function ss(){}const Kr=Object.create(null);function Df(e){if(!Kr[e]){const t=ho(e);if(!t)return;const n=Qa(t),r={config:t,redundancy:n};Kr[e]=r}return Kr[e]}function Mf(e,t,n){let r,i;if(typeof e=="string"){const s=hi(e);if(!s)return n(void 0,424),ss;i=s.send;const a=Df(e);a&&(r=a.redundancy)}else{const s=co(e);if(s){r=Qa(s);const a=e.resources?e.resources[0]:"",c=hi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),ss):r.query(t,i,n)().abort}const as="iconify2",tr="iconify",Ja=tr+"-count",ls=tr+"-version",Za=36e5,Ff=168;function fi(e,t){try{return e.getItem(t)}catch{}}function fo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function cs(e,t){try{e.removeItem(t)}catch{}}function pi(e,t){return fo(e,Ja,t.toString())}function mi(e){return parseInt(fi(e,Ja))||0}const Lr={local:!0,session:!0},el={local:new Set,session:new Set};let po=!1;function Bf(e){po=e}let ur=typeof window>"u"?{}:window;function tl(e){const t=e+"Storage";try{if(ur&&ur[t]&&typeof ur[t].length=="number")return ur[t]}catch{}Lr[e]=!1}function nl(e,t){const n=tl(e);if(!n)return;const r=fi(n,ls);if(r!==as){if(r){const c=mi(n);for(let f=0;f<c;f++)cs(n,tr+f.toString())}fo(n,ls,as),pi(n,0);return}const i=Math.floor(Date.now()/Za)-Ff,s=c=>{const f=tr+c.toString(),v=fi(n,f);if(typeof v=="string"){try{const l=JSON.parse(v);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>i&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&t(l,c))return!0}catch{}cs(n,f)}};let a=mi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,pi(n,a)):el[e].add(c))}function rl(){if(!po){Bf(!0);for(const e in Lr)nl(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=vn(r,i);if(!lo(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function $f(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Lr)nl(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Uf(e,t){po||rl();function n(r){let i;if(!Lr[r]||!(i=tl(r)))return;const s=el[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=mi(i),!pi(i,a+1))return;const c={cached:Math.floor(Date.now()/Za),provider:e.provider,data:t};return fo(i,tr+a.toString(),JSON.stringify(c))}t.lastModified&&!$f(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function us(){}function Wf(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Rf(e)}))}function zf(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=hi(n)))return;s.prepare(n,r,i).forEach(c=>{Mf(n,c,f=>{if(typeof f!="object")c.icons.forEach(v=>{e.missing.add(v)});else try{const v=lo(e,f);if(!v.length)return;const l=e.pendingIcons;l&&v.forEach(u=>{l.delete(u)}),Uf(e,f)}catch(v){console.error(v)}Wf(e)})})}))}const qf=(e,t)=>{const n=Lf(e,!0,Ha()),r=Cf(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,us)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:v,prefix:l}=f;if(l===c&&v===a)return;a=v,c=l,s.push(vn(v,l));const u=i[v]||(i[v]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:v,prefix:l,name:u}=f,T=vn(v,l),y=T.pendingIcons||(T.pendingIcons=new Set);y.has(u)||(y.add(u),i[v][l].push(u))}),s.forEach(f=>{const{provider:v,prefix:l}=f;i[v][l].length&&zf(f,i[v][l])}),t?_f(t,r,s):us};function Kf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Va?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Gf=/[\s,]+/;function Hf(e,t){t.split(Gf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Vf(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function Xf(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Yf(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Qf(e){return"data:image/svg+xml,"+Yf(e)}function Jf(e){return'url("'+Qf(e)+'")'}let Qn;function Zf(){try{Qn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Qn=null}}function ep(e){return Qn===void 0&&Zf(),Qn?Qn.createHTML(e):e}const il={...Xa,inline:!1},tp={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},np={display:"inline-block"},gi={backgroundColor:"currentColor"},ol={backgroundColor:"transparent"},ds={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},hs={WebkitMask:gi,mask:gi,background:ol};for(const e in hs){const t=hs[e];for(const n in ds)t[e+n]=ds[n]}const rp={...il,inline:!0};function fs(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const ip=(e,t,n,r)=>{const i=n?rp:il,s=Kf(i,t),a=t.mode||"svg",c={},f=t.style||{},v={...a==="svg"?tp:{},ref:r};for(let D in t){const A=t[D];if(A!==void 0)switch(D){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[D]=A===!0||A==="true"||A===1;break;case"flip":typeof A=="string"&&Hf(s,A);break;case"color":c.color=A;break;case"rotate":typeof A=="string"?s[D]=Vf(A):typeof A=="number"&&(s[D]=A);break;case"ariaHidden":case"aria-hidden":A!==!0&&A!=="true"&&delete v["aria-hidden"];break;default:i[D]===void 0&&(v[D]=A)}}const l=mf(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){v.style={...c,...f},Object.assign(v,u);let D=0,A=t.id;return typeof A=="string"&&(A=A.replace(/-/g,"_")),v.dangerouslySetInnerHTML={__html:ep(bf(l.body,A?()=>A+"ID"+D++:"iconifyReact"))},Mt.createElement("svg",v)}const{body:T,width:y,height:S}=e,j=a==="mask"||(a==="bg"?!1:T.indexOf("currentColor")!==-1),L=Xf(T,{...u,width:y+"",height:S+""});return v.style={...c,"--svg":Jf(L),width:fs(u.width),height:fs(u.height),...np,...j?gi:ol,...f},Mt.createElement("span",v)};Ha(!0);xf("",If);if(typeof document<"u"&&typeof window<"u"){rl();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!df(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;wf(n,i)||console.error(r)}catch{console.error(r)}}}}class sl extends Mt.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||n.icon===null)&&this._setData({data:r});return}let i;if(typeof r!="string"||(i=_r(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=cf(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:qf([i],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const a=["iconify"];i.prefix!==""&&a.push("iconify--"+i.prefix),i.provider!==""&&a.push("iconify--"+i.provider),this._setData({data:s,classes:a}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,n=this.state.icon;if(n===null)return t.children?t.children:Mt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),ip({...ao,...n.data},r,t._inline,t._ref)}}const nr=Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Mt.createElement(sl,r)});Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Mt.createElement(sl,r)});var al={exports:{}};(function(e,t){(function(n,r){e.exports=r(M)})(Se,n=>(()=>{var r={703:(c,f,v)=>{var l=v(414);function u(){}function T(){}T.resetWarningCache=u,c.exports=function(){function y(L,D,A,B,G,I){if(I!==l){var F=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 F.name="Invariant Violation",F}}function S(){return y}y.isRequired=y;var j={array:y,bool:y,func:y,number:y,object:y,string:y,symbol:y,any:y,arrayOf:S,element:y,elementType:y,instanceOf:S,node:y,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:T,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,v)=>{c.exports=v(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",v=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function T(y,S){if(y===S)return!0;if(y&&S&&typeof y=="object"&&typeof S=="object"){if(y.constructor!==S.constructor)return!1;var j,L,D,A;if(Array.isArray(y)){if((j=y.length)!=S.length)return!1;for(L=j;L--!=0;)if(!T(y[L],S[L]))return!1;return!0}if(v&&y instanceof Map&&S instanceof Map){if(y.size!==S.size)return!1;for(A=y.entries();!(L=A.next()).done;)if(!S.has(L.value[0]))return!1;for(A=y.entries();!(L=A.next()).done;)if(!T(L.value[1],S.get(L.value[0])))return!1;return!0}if(l&&y instanceof Set&&S instanceof Set){if(y.size!==S.size)return!1;for(A=y.entries();!(L=A.next()).done;)if(!S.has(L.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(S)){if((j=y.length)!=S.length)return!1;for(L=j;L--!=0;)if(y[L]!==S[L])return!1;return!0}if(y.constructor===RegExp)return y.source===S.source&&y.flags===S.flags;if(y.valueOf!==Object.prototype.valueOf)return y.valueOf()===S.valueOf();if(y.toString!==Object.prototype.toString)return y.toString()===S.toString();if((j=(D=Object.keys(y)).length)!==Object.keys(S).length)return!1;for(L=j;L--!=0;)if(!Object.prototype.hasOwnProperty.call(S,D[L]))return!1;if(f&&y instanceof Element)return!1;for(L=j;L--!=0;)if((D[L]!=="_owner"&&D[L]!=="__v"&&D[L]!=="__o"||!y.$$typeof)&&!T(y[D[L]],S[D[L]]))return!1;return!0}return y!=y&&S!=S}c.exports=function(y,S){try{return T(y,S)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var v=i[c]={exports:{}};return r[c](v,v.exports,s),v.exports}s.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return s.d(f,{a:f}),f},s.d=(c,f)=>{for(var v in f)s.o(f,v)&&!s.o(c,v)&&Object.defineProperty(c,v,{enumerable:!0,get:f[v]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),s.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};return(()=>{function c(b){var p,E,k="";if(typeof b=="string"||typeof b=="number")k+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(E=c(b[p]))&&(k&&(k+=" "),k+=E);else for(p in b)b[p]&&(k&&(k+=" "),k+=p);return k}function f(){for(var b,p,E=0,k="";E<arguments.length;)(b=arguments[E++])&&(p=c(b))&&(k&&(k+=" "),k+=p);return k}s.r(a),s.d(a,{default:()=>jl});var v=s(359),l=s.n(v);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},T=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var y=typeof self=="object"&&self&&self.Object===Object&&self;const S=T||y||Function("return this")(),j=function(){return S.Date.now()};var L=/\s/,D=/^\s+/;const A=function(b){return b&&b.slice(0,function(p){for(var E=p.length;E--&&L.test(p.charAt(E)););return E}(b)+1).replace(D,"")},B=S.Symbol;var G=Object.prototype,I=G.hasOwnProperty,F=G.toString,H=B?B.toStringTag:void 0,$=Object.prototype.toString,le=B?B.toStringTag:void 0;const V=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":le&&le in Object(b)?function(p){var E=I.call(p,H),k=p[H];try{p[H]=void 0;var q=!0}catch{}var re=F.call(p);return q&&(E?p[H]=k:delete p[H]),re}(b):function(p){return $.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,We=/^0o[0-7]+$/i,Me=parseInt;const Qe=function(b){if(typeof b=="number")return b;if(function(k){return typeof k=="symbol"||function(q){return q!=null&&typeof q=="object"}(k)&&V(k)=="[object Symbol]"}(b))return NaN;if(u(b)){var p=typeof b.valueOf=="function"?b.valueOf():b;b=u(p)?p+"":p}if(typeof b!="string")return b===0?b:+b;b=A(b);var E=je.test(b);return E||We.test(b)?Me(b.slice(2),E?2:8):se.test(b)?NaN:+b};var Z=Math.max,pe=Math.min;const ee=function(b,p,E){var k,q,re,me,g,m,C=0,U=!1,K=!1,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");function ue(ie){var fe=k,be=q;return k=q=void 0,C=ie,me=b.apply(be,fe)}function ce(ie){return C=ie,g=setTimeout(X,p),U?ue(ie):me}function he(ie){var fe=ie-m;return m===void 0||fe>=p||fe<0||K&&ie-C>=re}function X(){var ie=j();if(he(ie))return Q(ie);g=setTimeout(X,function(fe){var be=p-(fe-m);return K?pe(be,re-(fe-C)):be}(ie))}function Q(ie){return g=void 0,z&&k?ue(ie):(k=q=void 0,me)}function J(){var ie=j(),fe=he(ie);if(k=arguments,q=this,m=ie,fe){if(g===void 0)return ce(m);if(K)return clearTimeout(g),g=setTimeout(X,p),ue(m)}return g===void 0&&(g=setTimeout(X,p)),me}return p=Qe(p)||0,u(E)&&(U=!!E.leading,re=(K="maxWait"in E)?Z(Qe(E.maxWait)||0,p):re,z="trailing"in E?!!E.trailing:z),J.cancel=function(){g!==void 0&&clearTimeout(g),C=0,k=m=q=g=void 0},J.flush=function(){return g===void 0?me:Q(j())},J},ye=function(b,p,E){var k=!0,q=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(E)&&(k="leading"in E?!!E.leading:k,q="trailing"in E?!!E.trailing:q),ee(b,p,{leading:k,maxWait:p,trailing:q})};var oe=s(590),Ae=s.n(oe),we=function(){if(typeof Map<"u")return Map;function b(p,E){var k=-1;return p.some(function(q,re){return q[0]===E&&(k=re,!0)}),k}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 k=b(this.__entries__,E),q=this.__entries__[k];return q&&q[1]},p.prototype.set=function(E,k){var q=b(this.__entries__,E);~q?this.__entries__[q][1]=k:this.__entries__.push([E,k])},p.prototype.delete=function(E){var k=this.__entries__,q=b(k,E);~q&&k.splice(q,1)},p.prototype.has=function(E){return!!~b(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,k){k===void 0&&(k=null);for(var q=0,re=this.__entries__;q<re.length;q++){var me=re[q];E.call(k,me[1],me[0])}},p}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,qe=s.g!==void 0&&s.g.Math===Math?s.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Ht=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(qe):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Vt=["top","right","bottom","left","width","height","size","weight"],Ft=typeof MutationObserver<"u",Xt=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var k=!1,q=!1,re=0;function me(){k&&(k=!1,p()),q&&m()}function g(){Ht(me)}function m(){var C=Date.now();if(k){if(C-re<2)return;q=!0}else k=!0,q=!1,setTimeout(g,20);re=C}return m}(this.refresh.bind(this))}return b.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},b.prototype.removeObserver=function(p){var E=this.observers_,k=E.indexOf(p);~k&&E.splice(k,1),!E.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.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},b.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ft?(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)},b.prototype.disconnect_=function(){Je&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(p){var E=p.propertyName,k=E===void 0?"":E;Vt.some(function(q){return!!~k.indexOf(q)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Pe=function(b,p){for(var E=0,k=Object.keys(p);E<k.length;E++){var q=k[E];Object.defineProperty(b,q,{value:p[q],enumerable:!1,writable:!1,configurable:!0})}return b},_e=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||qe},Ze=ke(0,0,0,0);function de(b){return parseFloat(b)||0}function Yt(b){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(k,q){return k+de(b["border-"+q+"-width"])},0)}var Qt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof _e(b).SVGGraphicsElement}:function(b){return b instanceof _e(b).SVGElement&&typeof b.getBBox=="function"};function Jt(b){return Je?Qt(b)?function(p){var E=p.getBBox();return ke(0,0,E.width,E.height)}(b):function(p){var E=p.clientWidth,k=p.clientHeight;if(!E&&!k)return Ze;var q=_e(p).getComputedStyle(p),re=function(z){for(var ue={},ce=0,he=["top","right","bottom","left"];ce<he.length;ce++){var X=he[ce],Q=z["padding-"+X];ue[X]=de(Q)}return ue}(q),me=re.left+re.right,g=re.top+re.bottom,m=de(q.width),C=de(q.height);if(q.boxSizing==="border-box"&&(Math.round(m+me)!==E&&(m-=Yt(q,"left","right")+me),Math.round(C+g)!==k&&(C-=Yt(q,"top","bottom")+g)),!function(z){return z===_e(z).document.documentElement}(p)){var U=Math.round(m+me)-E,K=Math.round(C+g)-k;Math.abs(U)!==1&&(m-=U),Math.abs(K)!==1&&(C-=K)}return ke(re.left,re.top,m,C)}(b):Ze}function ke(b,p,E,k){return{x:b,y:p,width:E,height:k}}var Bt=function(){function b(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ke(0,0,0,0),this.target=p}return b.prototype.isActive=function(){var p=Jt(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},b}(),Nn=function(b,p){var E,k,q,re,me,g,m,C=(k=(E=p).x,q=E.y,re=E.width,me=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Pe(m,{x:k,y:q,width:re,height:me,top:q,right:k+re,bottom:me+q,left:k}),m);Pe(this,{target:b,contentRect:C})},et=function(){function b(p,E,k){if(this.activeObservations_=[],this.observations_=new we,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=k}return b.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 _e(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new Bt(p)),this.controller_.addObserver(this),this.controller_.refresh())}},b.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 _e(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))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(k){return new Nn(k.target,k.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),Zt=typeof WeakMap<"u"?new WeakMap:new we,en=function b(p){if(!(this instanceof b))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=Xt.getInstance(),k=new et(p,E,this);Zt.set(this,k)};["observe","unobserve","disconnect"].forEach(function(b){en.prototype[b]=function(){var p;return(p=Zt.get(this))[b].apply(p,arguments)}});const tn=qe.ResizeObserver!==void 0?qe.ResizeObserver:en,Fe="Left",tt="Right",wt="Up",ot="Down",Et={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},It={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ke="mousemove",xn="mouseup";function nn(b,p){if(p===0)return b;const E=Math.PI/180*p;return[b[0]*Math.cos(E)+b[1]*Math.sin(E),b[1]*Math.cos(E)-b[0]*Math.sin(E)]}function wn(b){const{trackMouse:p}=b,E=v.useRef(Object.assign({},It)),k=v.useRef(Object.assign({},Et)),q=v.useRef(Object.assign({},k.current));let re;for(re in q.current=Object.assign({},k.current),k.current=Object.assign(Object.assign({},Et),b),Et)k.current[re]===void 0&&(k.current[re]=Et[re]);const[me,g]=v.useMemo(()=>function(m,C){const U=X=>{const Q="touches"in X;Q&&X.touches.length>1||m((J,ie)=>{ie.trackMouse&&!Q&&(document.addEventListener(Ke,K),document.addEventListener(xn,ue));const{clientX:fe,clientY:be}=Q?X.touches[0]:X,Le=nn([fe,be],ie.rotationAngle);return ie.onTouchStartOrOnMouseDown&&ie.onTouchStartOrOnMouseDown({event:X}),Object.assign(Object.assign(Object.assign({},J),It),{initial:Le.slice(),xy:Le,start:X.timeStamp||0})})},K=X=>{m((Q,J)=>{const ie="touches"in X;if(ie&&X.touches.length>1)return Q;if(X.timeStamp-Q.start>J.swipeDuration)return Q.swiping?Object.assign(Object.assign({},Q),{swiping:!1}):Q;const{clientX:fe,clientY:be}=ie?X.touches[0]:X,[Le,lt]=nn([fe,be],J.rotationAngle),nt=Le-Q.xy[0],Ge=lt-Q.xy[1],Re=Math.abs(nt),xe=Math.abs(Ge),Wt=(X.timeStamp||0)-Q.start,Bn=Math.sqrt(Re*Re+xe*xe)/(Wt||1),$n=[nt/(Wt||1),Ge/(Wt||1)],Lt=function(Un,On,Wn,ct){return Un>On?Wn>0?tt:Fe:ct>0?ot:wt}(Re,xe,nt,Ge),cn=typeof J.delta=="number"?J.delta:J.delta[Lt.toLowerCase()]||Et.delta;if(Re<cn&&xe<cn&&!Q.swiping)return Q;const Tt={absX:Re,absY:xe,deltaX:nt,deltaY:Ge,dir:Lt,event:X,first:Q.first,initial:Q.initial,velocity:Bn,vxvy:$n};Tt.first&&J.onSwipeStart&&J.onSwipeStart(Tt),J.onSwiping&&J.onSwiping(Tt);let kn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${Lt}`])&&(kn=!0),kn&&J.preventScrollOnSwipe&&J.trackTouch&&X.cancelable&&X.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Tt,swiping:!0})})},z=X=>{m((Q,J)=>{let ie;if(Q.swiping&&Q.eventData){if(X.timeStamp-Q.start<J.swipeDuration){ie=Object.assign(Object.assign({},Q.eventData),{event:X}),J.onSwiped&&J.onSwiped(ie);const fe=J[`onSwiped${ie.dir}`];fe&&fe(ie)}}else J.onTap&&J.onTap({event:X});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:X}),Object.assign(Object.assign(Object.assign({},Q),It),{eventData:ie})})},ue=X=>{document.removeEventListener(Ke,K),document.removeEventListener(xn,ue),z(X)},ce=(X,Q)=>{let J=()=>{};if(X&&X.addEventListener){const ie=Object.assign(Object.assign({},Et.touchEventOptions),Q.touchEventOptions),fe=[["touchstart",U,ie],["touchmove",K,Object.assign(Object.assign({},ie),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",z,ie]];fe.forEach(([be,Le,lt])=>X.addEventListener(be,Le,lt)),J=()=>fe.forEach(([be,Le])=>X.removeEventListener(be,Le))}return J},he={ref:X=>{X!==null&&m((Q,J)=>{if(Q.el===X)return Q;const ie={};return Q.el&&Q.el!==X&&Q.cleanUpTouch&&(Q.cleanUpTouch(),ie.cleanUpTouch=void 0),J.trackTouch&&X&&(ie.cleanUpTouch=ce(X,J)),Object.assign(Object.assign(Object.assign({},Q),{el:X}),ie)})}};return C.trackMouse&&(he.onMouseDown=U),[he,ce]}(m=>E.current=m(E.current,k.current),{trackMouse:p}),[p]);return E.current=function(m,C,U,K){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==U.preventScrollOnSwipe||C.touchEventOptions.passive!==U.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,k.current,q.current,g),me}var R=s(697);function St(b){return St=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},St(b)}function Ct(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function rn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Ct(Object(E),!0).forEach(function(k){d(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Ct(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function d(b,p,E){return(p=function(k){var q=function(re,me){if(St(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(St(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return St(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=l().memo(function(b){var p=rn(rn({},x),b),E=p.description,k=p.fullscreen,q=p.handleImageLoaded,re=p.isFullscreen,me=p.onImageError,g=p.original,m=p.originalAlt,C=p.originalHeight,U=p.originalWidth,K=p.originalTitle,z=p.sizes,ue=p.srcSet,ce=p.loading,he=re&&k||g;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:he,alt:m,srcSet:ue,height:C,width:U,sizes:z,title:K,onLoad:function(X){return q(X,g)},onError:me,loading:ce}),E&&l().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:R.string,fullscreen:R.string,handleImageLoaded:R.func.isRequired,isFullscreen:R.bool,onImageError:R.func.isRequired,original:R.string.isRequired,originalAlt:R.string,originalHeight:R.string,originalWidth:R.string,originalTitle:R.string,sizes:R.string,srcSet:R.string,loading:R.string};const P=w;function O(b){return O=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},O(b)}function _(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function W(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_(Object(E),!0).forEach(function(k){ne(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):_(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function ne(b,p,E){return(p=function(k){var q=function(re,me){if(O(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(O(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return O(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var ae={left:l().createElement("polyline",{points:"15 18 9 12 15 6"}),right:l().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:l().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:l().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:l().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:l().createElement(l().Fragment,null,l().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),l().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Be={strokeWidth:1,viewBox:"0 0 24 24"},Ne=function(b){var p=W(W({},Be),b),E=p.strokeWidth,k=p.viewBox,q=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:k,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},ae[q])};Ne.propTypes={strokeWidth:R.number,viewBox:R.string,icon:(0,R.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ee=Ne;var Te=l().memo(function(b){var p=b.isFullscreen,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},l().createElement(Ee,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Te.displayName="Fullscreen",Te.propTypes={isFullscreen:R.bool.isRequired,onClick:R.func.isRequired};const Xe=Te;var Rt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},l().createElement(Ee,{icon:"left",viewBox:"6 0 12 24"}))});Rt.displayName="LeftNav",Rt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const An=Rt;var Pt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},l().createElement(Ee,{icon:"right",viewBox:"6 0 12 24"}))});Pt.displayName="RightNav",Pt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const st=Pt;var $t=l().memo(function(b){var p=b.isPlaying,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},l().createElement(Ee,{strokeWidth:2,icon:p?"pause":"play"}))});$t.displayName="PlayPause",$t.propTypes={isPlaying:R.bool.isRequired,onClick:R.func.isRequired};const Ut=$t;function ft(b){return ft=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},ft(b)}function at(){return at=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var k in E)Object.prototype.hasOwnProperty.call(E,k)&&(b[k]=E[k])}return b},at.apply(this,arguments)}function _t(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function En(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_t(Object(E),!0).forEach(function(k){Sn(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):_t(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function Sn(b,p,E){return(p=function(k){var q=function(re,me){if(ft(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(ft(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return ft(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var sr={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Dn=function(b){var p=En(En({},sr),b),E=p.children,k=p.className,q=wn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",at({},q,{className:k}),E)};Dn.propTypes={children:R.node.isRequired,className:R.string,delta:R.number,onSwiped:R.func,onSwiping:R.func};const Mn=Dn;function $e(b){return $e=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},$e(b)}function Tn(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function on(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Tn(Object(E),!0).forEach(function(k){an(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Tn(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function jn(b,p){for(var E=0;E<p.length;E++){var k=p[E];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(b,ln(k.key),k)}}function sn(b,p){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,k){return E.__proto__=k,E},sn(b,p)}function Fn(b,p){if(p&&($e(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oe(b)}function Oe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function vt(b){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},vt(b)}function an(b,p,E){return(p=ln(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}function ln(b){var p=function(E,k){if($e(E)!=="object"||E===null)return E;var q=E[Symbol.toPrimitive];if(q!==void 0){var re=q.call(E,k);if($e(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(b,"string");return $e(p)==="symbol"?p:String(p)}var ar=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Tl=(0,R.arrayOf)((0,R.shape)({srcSet:R.string,media:R.string}));function So(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Ar=function(b){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&sn(g,m)})(me,b);var p,E,k,q,re=(k=me,q=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=vt(k);if(q){var C=vt(this).constructor;g=Reflect.construct(m,arguments,C)}else g=m.apply(this,arguments);return Fn(this,g)});function me(g){var m;return function(C,U){if(!(C instanceof U))throw new TypeError("Cannot call a class as a function")}(this,me),an(Oe(m=re.call(this,g)),"onBulletClick",function(C,U){var K=m.props,z=K.onBulletClick,ue=K.items,ce=m.state.currentIndex;C.target.blur(),ce!==U&&(ue.length===2?m.slideToIndexWithStyleReset(U,C):m.slideToIndex(U,C)),z&&z(C,U)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=l().createRef(),m.thumbnailsWrapper=l().createRef(),m.thumbnails=l().createRef(),m.imageGallerySlideWrapper=l().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(Oe(m)),m.handleKeyDown=m.handleKeyDown.bind(Oe(m)),m.handleMouseDown=m.handleMouseDown.bind(Oe(m)),m.handleResize=m.handleResize.bind(Oe(m)),m.handleTouchMove=m.handleTouchMove.bind(Oe(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Oe(m)),m.handleScreenChange=m.handleScreenChange.bind(Oe(m)),m.handleSwiping=m.handleSwiping.bind(Oe(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Oe(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Oe(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Oe(m)),m.handleImageError=m.handleImageError.bind(Oe(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Oe(m)),m.renderThumbInner=m.renderThumbInner.bind(Oe(m)),m.renderItem=m.renderItem.bind(Oe(m)),m.slideLeft=m.slideLeft.bind(Oe(m)),m.slideRight=m.slideRight.bind(Oe(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Oe(m)),m.togglePlay=m.togglePlay.bind(Oe(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=ye(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return p=me,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,C=g.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var C=this.props,U=C.items,K=C.lazyLoad,z=C.slideDuration,ue=C.slideInterval,ce=C.startIndex,he=C.thumbnailPosition,X=C.showThumbnails,Q=C.useWindowKeyDown,J=this.state,ie=J.currentIndex,fe=J.isPlaying,be=g.items.length!==U.length,Le=!Ae()(g.items,U),lt=g.startIndex!==ce,nt=g.thumbnailPosition!==he,Ge=g.showThumbnails!==X;ue===g.slideInterval&&z===g.slideDuration||fe&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ge&&X&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ge&&!X&&this.removeThumbnailsResizeObserver(),(be||Ge)&&this.handleResize(),m.currentIndex!==ie&&this.slideThumbnailBar(),g.slideDuration!==z&&(this.slideToIndex=ye(this.unthrottledSlideToIndex,z,{trailing:!1})),!K||g.lazyLoad&&!Le||(this.lazyLoaded=[]),Q!==g.useWindowKeyDown&&(Q?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(lt||Le)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,C=m.currentIndex,U=m.isTransitioning,K=this.props,z=K.onSlide,ue=K.slideDuration;this.transitionTimer=window.setTimeout(function(){U&&(g.setState({isTransitioning:!U,isSwipingThumbnail:!1}),z&&z(C))},ue+50)}},{key:"onThumbnailClick",value:function(g,m){var C=this.props,U=C.onThumbnailClick,K=C.items,z=this.state.currentIndex;g.target.parentNode.parentNode.blur(),z!==m&&(K.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),U&&U(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,C=this.props,U=C.disableThumbnailScroll,K=C.items,z=this.state,ue=z.thumbnailsWrapperWidth,ce=z.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(U)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=ce)return 0;m=he.scrollHeight-ce}else{if(he.scrollWidth<=ue||ue<=0)return 0;m=he.scrollWidth-ue}return g*(m/(K.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,C=this.props,U=C.infinite,K=C.items,z="",ue="image-gallery-left",ce="image-gallery-right";switch(g){case m-1:z=" ".concat(ue);break;case m:z=" ".concat("image-gallery-center");break;case m+1:z=" ".concat(ce)}return K.length>=3&&U&&(g===0&&m===K.length-1?z=" ".concat(ce):g===K.length-1&&m===0&&(z=" ".concat(ue))),z}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.previousIndex,z=C!==K,ue=g===0&&K===0,ce=g===1&&K===1,he=g===0&&C===1,X=g===1&&C===0,Q=U===0,J=-100*C+100*g+U;return U>0?this.direction="left":U<0&&(this.direction="right"),X&&U>0&&(J=-100+U),he&&U<0&&(J=100+U),z?ue&&Q&&this.direction==="left"?J=100:ce&&Q&&this.direction==="right"&&(J=-100):(X&&Q&&this.direction==="left"&&(J=-100),he&&Q&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.slideStyle,z=this.props,ue=z.infinite,ce=z.items,he=z.useTranslate3D,X=z.isRTL,Q=-100*C,J=ce.length-1,ie=(Q+100*g)*(X?-1:1)+U;ue&&ce.length>2&&(C===0&&g===J?ie=-100*(X?-1:1)+U:C===J&&g===0&&(ie=100*(X?-1:1)+U)),ue&&ce.length===2&&(ie=this.getTranslateXForTwoSlide(g));var fe="translate(".concat(ie,"%, 0)");return he&&(fe="translate3d(".concat(ie,"%, 0, 0)")),on({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:fe,MozTransform:fe,msTransform:fe,OTransform:fe,transform:fe},K)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,C=m.useTranslate3D,U=m.isRTL,K=this.state,z=K.thumbsTranslate,ue=K.thumbsStyle,ce=U?-1*z:z;return this.isThumbnailVertical()?(g="translate(0, ".concat(z,"px)"),C&&(g="translate3d(0, ".concat(z,"px, 0)"))):(g="translate(".concat(ce,"px, 0)"),C&&(g="translate3d(".concat(ce,"px, 0, 0)"))),on({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},ue)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,C=this.props,U=C.items,K=C.slideOnThumbnailOver,z=C.onClick,ue=C.lazyLoad,ce=C.onTouchMove,he=C.onTouchEnd,X=C.onTouchStart,Q=C.onMouseOver,J=C.onMouseLeave,ie=C.renderItem,fe=C.renderThumbInner,be=C.showThumbnails,Le=C.showBullets,lt=[],nt=[],Ge=[];return U.forEach(function(Re,xe){var Wt=g.getAlignmentClassName(xe),Bn=Re.originalClass?" ".concat(Re.originalClass):"",$n=Re.thumbnailClass?" ".concat(Re.thumbnailClass):"",Lt=Re.renderItem||ie||g.renderItem,cn=Re.renderThumbInner||fe||g.renderThumbInner,Tt=!ue||Wt||g.lazyLoaded[xe];Tt&&ue&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var kn=g.getSlideStyle(xe),Un=l().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Wt," ").concat(Bn),style:kn,onClick:z,onKeyUp:g.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:he,onTouchStart:X,onMouseOver:Q,onFocus:Q,onMouseLeave:J,role:"button"},Tt?Lt(Re):l().createElement("div",{style:{height:"100%"}}));if(lt.push(Un),be&&Re.thumbnail){var On=f("image-gallery-thumbnail",$n,{active:m===xe});nt.push(l().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:On,onMouseLeave:K?g.onThumbnailMouseLeave:null,onMouseOver:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onFocus:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onKeyUp:function(ct){return g.handleThumbnailKeyUp(ct,xe)},onClick:function(ct){return g.onThumbnailClick(ct,xe)}},cn(Re)))}if(Le){var Wn=f("image-gallery-bullet",Re.bulletClass,{active:m===xe});Ge.push(l().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Wn,onClick:function(ct){return g.onBulletClick(ct,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:lt,thumbnails:nt,bullets:Ge}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,C=m.previousIndex,U=m.currentIndex,K=g.length-1;return Math.abs(C-U)>1&&!(C===0&&U===K)&&!(C===K&&U===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,C=m.isTransitioning,U=m.previousIndex,K=m.currentIndex;return C&&!(g===U||g===K)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,C=g.isSwipingThumbnail,U=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:U,thumbsSwipedTranslate:U}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,C=g.absX,U=g.dir,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=this.state,he=ce.galleryWidth,X=ce.isTransitioning,Q=ce.swipingUpDown,J=ce.swipingLeftRight;if(U!==wt&&U!==ot&&!Q||J){if(U!==Fe&&U!==tt||J||this.setState({swipingLeftRight:!0}),!z){var ie=this.props.swipingTransitionDuration;if(ue&&m.preventDefault(),X)this.setState({currentSlideOffset:0});else{var fe=U===tt?1:-1,be=C/he*100;Math.abs(be)>=100&&(be=100);var Le={transition:"transform ".concat(ie,"ms ease-out")};this.setState({currentSlideOffset:fe*be,slideStyle:Le})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,C=g.absX,U=g.absY,K=g.dir,z=this.props,ue=z.stopPropagation,ce=z.swipingThumbnailTransitionDuration,he=this.state,X=he.thumbsSwipedTranslate,Q=he.thumbnailsWrapperHeight,J=he.thumbnailsWrapperWidth,ie=he.swipingUpDown,fe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((K===Fe||K===tt||fe)&&!ie)return void(fe||this.setState({swipingLeftRight:!0}));K!==wt&&K!==ot||ie||this.setState({swipingUpDown:!0})}else{if((K===wt||K===ot||ie)&&!fe)return void(ie||this.setState({swipingUpDown:!0}));K!==Fe&&K!==tt||fe||this.setState({swipingLeftRight:!0})}var be,Le,lt,nt,Ge,Re=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=X+(K===ot?U:-U),Le=Re.scrollHeight-Q+20,lt=Math.abs(be)>Le,nt=be>20,Ge=Re.scrollHeight<=Q):(be=X+(K===tt?C:-C),Le=Re.scrollWidth-J+20,lt=Math.abs(be)>Le,nt=be>20,Ge=Re.scrollWidth<=J),!Ge&&(K!==Fe&&K!==wt||!lt)&&(K!==tt&&K!==ot||!nt)){ue&&m.stopPropagation();var xe={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,C=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,C=g.dir,U=g.velocity,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=K.flickThreshold;if(!z){var he=this.props.isRTL;ue&&m.stopPropagation(),this.resetSwipingDirection();var X=(C===Fe?1:-1)*(he?-1:1),Q=U>ce&&!(C===wt||C===ot);this.handleOnSwipedTo(X,Q)}}},{key:"handleOnSwipedTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=U;!this.sufficientSwipe()&&!m||K||(z+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(z=U),this.unthrottledSlideToIndex(z)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,C=m.disableKeyDown,U=m.useBrowserFullscreen,K=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:K&&!U&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperWidth:U.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperHeight:U.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,C=g.useBrowserFullscreen,U=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,K=this.imageGallery.current===U;m&&m(K),C&&this.setState({isFullscreen:K})}},{key:"slideToIndex",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props,ue=z.items,ce=z.slideDuration,he=z.onBeforeSlide;if(!K){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var X=ue.length-1,Q=g;g<0?Q=X:g>X&&(Q=0),he&&Q!==U&&he(Q),this.setState({previousIndex:U,currentIndex:Q,isTransitioning:Q!==U,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props.items,ue=U+(m==="left"?-1:1);K||(z.length===2?this.slideToIndexWithStyleReset(ue,g):this.slideToIndex(ue,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var C=this,U=this.state,K=U.currentIndex,z=U.currentSlideOffset;this.setState({currentSlideOffset:z+(K>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){So(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){So(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,U=m.slideInterval,K=m.slideDuration,z=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(U,K)),C&&g&&C(z))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(C))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return l().createElement(P,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return l().createElement("span",{className:"image-gallery-thumbnail-inner"},l().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,C=g.isFullscreen,U=g.modalFullscreen,K=g.isPlaying,z=this.props,ue=z.additionalClass,ce=z.disableThumbnailSwipe,he=z.indexSeparator,X=z.isRTL,Q=z.items,J=z.thumbnailPosition,ie=z.renderFullscreenButton,fe=z.renderCustomControls,be=z.renderLeftNav,Le=z.renderRightNav,lt=z.showBullets,nt=z.showFullscreenButton,Ge=z.showIndex,Re=z.showThumbnails,xe=z.showNav,Wt=z.showPlayButton,Bn=z.renderPlayPauseButton,$n=this.getThumbnailStyle(),Lt=this.getSlideItems(),cn=Lt.slides,Tt=Lt.thumbnails,kn=Lt.bullets,Un=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":X}),On=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:Un},fe&&fe(),this.canSlide()?l().createElement(l().Fragment,null,xe&&l().createElement(l().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),Le(this.slideRight,!this.canSlideRight())),l().createElement(Mn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},cn))):l().createElement("div",{className:"image-gallery-slides"},cn),Wt&&Bn(this.togglePlay,K),lt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},kn)),nt&&ie(this.toggleFullScreen,C),Ge&&l().createElement("div",{className:"image-gallery-index"},l().createElement("span",{className:"image-gallery-index-current"},m+1),l().createElement("span",{className:"image-gallery-index-separator"},he),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),Wn=f("image-gallery",ue,{"fullscreen-modal":U}),ct=f("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:C}),kl=f("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(J),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&X},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ce},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ce});return l().createElement("div",{ref:this.imageGallery,className:Wn,"aria-live":"polite"},l().createElement("div",{className:ct},(J==="bottom"||J==="right")&&On,Re&&Tt.length>0?l().createElement(Mn,{className:kl,delta:0,onSwiping:!ce&&this.handleThumbnailSwiping,onSwiped:!ce&&this.handleOnThumbnailSwiped},l().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},l().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:$n,"aria-label":"Thumbnail Navigation"},Tt))):null,(J==="top"||J==="left")&&On))}}],E&&jn(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),me}(l().Component);Ar.propTypes={flickThreshold:R.number,items:(0,R.arrayOf)((0,R.shape)({bulletClass:R.string,bulletOnClick:R.func,description:R.string,original:R.string,originalHeight:R.number,originalWidth:R.number,loading:R.string,thumbnailHeight:R.number,thumbnailWidth:R.number,thumbnailLoading:R.string,fullscreen:R.string,originalAlt:R.string,originalTitle:R.string,thumbnail:R.string,thumbnailAlt:R.string,thumbnailLabel:R.string,thumbnailTitle:R.string,originalClass:R.string,thumbnailClass:R.string,renderItem:R.func,renderThumbInner:R.func,imageSet:Tl,srcSet:R.string,sizes:R.string})).isRequired,showNav:R.bool,autoPlay:R.bool,lazyLoad:R.bool,infinite:R.bool,showIndex:R.bool,showBullets:R.bool,showThumbnails:R.bool,showPlayButton:R.bool,showFullscreenButton:R.bool,disableThumbnailScroll:R.bool,disableKeyDown:R.bool,disableSwipe:R.bool,disableThumbnailSwipe:R.bool,useBrowserFullscreen:R.bool,onErrorImageURL:R.string,indexSeparator:R.string,thumbnailPosition:(0,R.oneOf)(["top","bottom","left","right"]),startIndex:R.number,slideDuration:R.number,slideInterval:R.number,slideOnThumbnailOver:R.bool,swipeThreshold:R.number,swipingTransitionDuration:R.number,swipingThumbnailTransitionDuration:R.number,onSlide:R.func,onBeforeSlide:R.func,onScreenChange:R.func,onPause:R.func,onPlay:R.func,onClick:R.func,onImageLoad:R.func,onImageError:R.func,onTouchMove:R.func,onTouchEnd:R.func,onTouchStart:R.func,onMouseOver:R.func,onMouseLeave:R.func,onBulletClick:R.func,onThumbnailError:R.func,onThumbnailClick:R.func,renderCustomControls:R.func,renderLeftNav:R.func,renderRightNav:R.func,renderPlayPauseButton:R.func,renderFullscreenButton:R.func,renderItem:R.func,renderThumbInner:R.func,stopPropagation:R.bool,additionalClass:R.string,useTranslate3D:R.bool,isRTL:R.bool,useWindowKeyDown:R.bool},Ar.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(b,p){return l().createElement(An,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(st,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Ut,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(Xe,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const jl=Ar})(),a})())})(al);var op=al.exports;const sp=Ti(op);function ap(){var e=new Map;function t(n){var r=n.root,i=n.rootMargin,s=n.threshold,a=e.get(r);a||(a=new Map,e.set(r,a));var c=JSON.stringify({rootMargin:i,threshold:s}),f=a.get(c);if(!f){var v=new Map,l=new IntersectionObserver(function(u){u.forEach(function(T){var y=v.get(T.target);y==null||y(T)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:v},a.set(c,f)}return{observe:function(T,y){var S,j;(S=f)==null||S.entryCallbacks.set(T,y),(j=f)==null||j.observer.observe(T)},unobserve:function(T){var y,S;(y=f)==null||y.entryCallbacks.delete(T),(S=f)==null||S.observer.unobserve(T)}}}return{getObserver:t}}var lp="0px",cp=[0],up=ap();function dp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:lp,i=(n=e==null?void 0:e.threshold)!=null?n:cp,s=M.useRef(null),a=M.useRef(null),c=M.useRef(null),f=M.useState(),v=f[0],l=f[1],u=M.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var L=up.getObserver({root:a.current,rootMargin:r,threshold:i});L.observe(j,function(D){l(D)}),c.current=L},[r,i]),T=M.useCallback(function(){var j=c.current,L=s.current;L&&(j==null||j.unobserve(L)),c.current=null},[]),y=M.useCallback(function(j){T(),s.current=j,u()},[u,T]),S=M.useCallback(function(j){T(),a.current=j,u()},[u,T]);return[y,{entry:v,rootRef:S}]}function vi(){return vi=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},vi.apply(this,arguments)}function hp(e){var t,n=dp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=M.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,vi({},i,{isVisible:s,wasEverVisible:c})]}var fp=100;function pp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?fp:a,f=hp({rootMargin:i}),v=f[0],l=f[1],u=l.rootRef,T=l.isVisible,y=!s&&!t&&T&&n;return M.useEffect(function(){if(y){var S=setTimeout(function(){r()},c);return function(){clearTimeout(S)}}},[r,y,c]),[v,{rootRef:u}]}const mp={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"/>'},gp={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 Gr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Hr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function ll(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 cl(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 vp(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}var mo={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,"-":Gr?173:189,"=":Gr?61:187,";":Gr?59:186,"'":222,"[":219,"]":221,"\\":220},Kt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},yi={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},He={16:!1,18:!1,17:!1,91:!1},De={};for(var dr=1;dr<20;dr++)mo["f".concat(dr)]=111+dr;var Ie=[],ps=!1,ul="all",dl=[],Nr=function(t){return mo[t.toLowerCase()]||Kt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function hl(e){ul=e||"all"}function rr(){return ul||"all"}function yp(){return Ie.slice(0)}function bp(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 xp(e){return typeof e=="string"&&(e=Nr(e)),Ie.indexOf(e)!==-1}function wp(e,t){var n,r;e||(e=rr());for(var i in De)if(Object.prototype.hasOwnProperty.call(De,i))for(n=De[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;rr()===e&&hl(t||"all")}function Ep(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 He){He[t]=!1;for(var r in Kt)Kt[r]===t&&(ht[r]=!1)}}function Sp(e){if(typeof e>"u")Object.keys(De).forEach(function(a){return delete De[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Vr(a)});else if(typeof e=="object")e.key&&Vr(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 i=n[0],s=n[1];typeof i=="function"&&(s=i,i=""),Vr({key:e,scope:i,method:s,splitKey:"+"})}}var Vr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=cl(n);c.forEach(function(f){var v=f.split(a),l=v.length,u=v[l-1],T=u==="*"?"*":Nr(u);if(De[T]){r||(r=rr());var y=l>1?ll(Kt,v):[];De[T]=De[T].filter(function(S){var j=i?S.method===i:!0;return!(j&&S.scope===r&&vp(S.mods,y))})}})};function ms(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var s in He)Object.prototype.hasOwnProperty.call(He,s)&&(!He[s]&&t.mods.indexOf(+s)>-1||He[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!He[16]&&!He[18]&&!He[17]&&!He[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function gs(e,t){var n=De["*"],r=e.keyCode||e.which||e.charCode;if(ht.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 j=yi[S];e[S]&&Ie.indexOf(j)===-1?Ie.push(j):!e[S]&&Ie.indexOf(j)>-1?Ie.splice(Ie.indexOf(j),1):S==="metaKey"&&e[S]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(j))))}),r in He){He[r]=!0;for(var i in Kt)Kt[i]===r&&(ht[i]=!0);if(!n)return}for(var s in He)Object.prototype.hasOwnProperty.call(He,s)&&(He[s]=e[yi[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),He[17]=!0,He[18]=!0);var a=rr();if(n)for(var c=0;c<n.length;c++)n[c].scope===a&&(e.type==="keydown"&&n[c].keydown||e.type==="keyup"&&n[c].keyup)&&ms(e,n[c],a,t);if(r in De){for(var f=0;f<De[r].length;f++)if((e.type==="keydown"&&De[r][f].keydown||e.type==="keyup"&&De[r][f].keyup)&&De[r][f].key){for(var v=De[r][f],l=v.splitKey,u=v.key.split(l),T=[],y=0;y<u.length;y++)T.push(Nr(u[y]));T.sort().join("")===Ie.sort().join("")&&ms(e,v,a,t)}}}}function Tp(e){return dl.indexOf(e)>-1}function ht(e,t,n){Ie=[];var r=cl(e),i=[],s="all",a=document,c=0,f=!1,v=!0,l="+",u=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(v=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(l=t.splitKey)),typeof t=="string"&&(s=t);c<r.length;c++)e=r[c].split(l),i=[],e.length>1&&(i=ll(Kt,e)),e=e[e.length-1],e=e==="*"?"*":Nr(e),e in De||(De[e]=[]),De[e].push({keyup:f,keydown:v,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Tp(a)&&window&&(dl.push(a),Hr(a,"keydown",function(T){gs(T,a)},u),ps||(ps=!0,Hr(window,"focus",function(){Ie=[]},u)),Hr(a,"keyup",function(T){gs(T,a),Ep(T)},u))}function jp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(De).forEach(function(n){var r=De[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Xr={setScope:hl,getScope:rr,deleteScope:wp,getPressedKeyCodes:yp,isPressed:xp,filter:bp,trigger:jp,unbind:Sp,keyMap:mo,modifier:Kt,modifierMap:yi};for(var Yr in Xr)Object.prototype.hasOwnProperty.call(Xr,Yr)&&(ht[Yr]=Xr[Yr]);if(typeof window<"u"){var kp=window.hotkeys;ht.noConflict=function(e){return e&&window.hotkeys===ht&&(window.hotkeys=kp),ht},window.hotkeys=ht}ht.filter=function(){return!0};var fl=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},Op=function(t){return fl(t,["INPUT","TEXTAREA","SELECT"])};function Ip(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,c=i.keyup,f=i.keydown,v=i.filterPreventDefault,l=v===void 0?!0:v,u=i.enabled,T=u===void 0?!0:u,y=i.enableOnContentEditable,S=y===void 0?!1:y,j=M.useRef(null),L=M.useCallback(function(D,A){var B,G;return a&&!a(D)?!l:Op(D)&&!fl(D,s)||(B=D.target)!=null&&B.isContentEditable&&!S?!0:j.current===null||document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement)?(t(D,A),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return M.useEffect(function(){if(!T){ht.unbind(e,L);return}return c&&f!==!0&&(n.keydown=!1),ht(e,n||{},L),function(){return ht.unbind(e,L)}},[L,e,T]),j}ht.isPressed;const pl=M.createContext({open:!1,toggleOpen:e=>{}});function Cp({children:e}){const[t,n]=M.useState(!1),r=s=>{n(s??!s)},i=M.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(pl.Provider,{value:i,children:e})}function go(){return M.useContext(pl)}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},Rp=e=>or(async()=>{const{data:t}=await e.get(mt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Pp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...xc(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:i=c=>{t.onFilterChange({...n,keyword:c.title})},emptyCategory:s}=t;!n.category&&!s&&(n.category="All");const a=c=>{const f={...n,...c};r(Dr(f,v=>v===""||v===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Dr(n,(v,l)=>c.includes(l)):{};r(Dr(f,v=>v===""||v===void 0))},handleActiveMenu:c=>{c!==e.menu&&r({menu:c})},handleSort:(c,f)=>{a({sortBy:c,sortDirection:f||c==="nameAsc"?"asc":"desc"})},handleKeyword:c=>{a({category:void 0,keyword:c||void 0})},handlePrice:c=>{a({price:c===e.price?void 0:c})},handleCategory:c=>{a({category:c===e.category?"":c})},handleDeveloper:c=>{a({owner:c||void 0})},handlePage:c=>{a({currentPage:c})},handleSwitchShowResources:c=>{a({showResources:c})},handleSearchSelect:c=>{i(c)}}}const _p=(e,t,n)=>e&&t||!n,ml=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],gl=(e,t,n)=>{var r,i;const s=wc(e),a=Ec(s.search);if((r=Sc(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Tc({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:v}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Ci(e,{...f||v?{imageFilter:"resize",w:f,h:v}:{},v:c})},Lp=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Np=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Ap=e=>{var t,n;return Array.isArray(e)?e.map(r=>r.message).join(`
486
- `):(n=(t=e.response)==null?void 0:t.data)!=null&&n.error?e.response.data.error.message||e.response.data.error:e.message||e},Dp=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Mp=()=>window.innerWidth<=600,Fp={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",searchPlaceholder:"Search blocklet"},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}"'}},Bp={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试",searchPlaceholder:"搜索 Blocklet"},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}” 的所有搜索结果"}},Qr={en:Io(Fp),zh:Io(Bp)},vl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},$p=e=>(t,n)=>{const r=Qr[e]?Qr[e][t]:Qr.en[t];return Dp(r,n)||t},yl={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!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:()=>{}}},bl=M.createContext(yl),{Provider:Up,Consumer:fg}=bl;function Wp(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=ye=>ye,extraFilter:v=ye=>ye,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:T=!1,showCategory:y=!0,tagFilters:S=[],children:j,storeVersion:L,onSearchSelect:D=()=>{},endpoint:A,blockletRender:B,compact:G=!1}=e,I=vl(r,L),F=M.useMemo(()=>$s({baseURL:A,headers:I}),[A]),H=Pp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:D}),[$,le]=M.useState(""),{data:V=[],error:se,loading:je,run:We}=Rp(F),Me=M.useMemo(()=>{const ye=bc(V,[Ae=>Ae.name],["asc"]),oe=ye.findIndex(Ae=>Ae.name==="All"||Ae.locales.en==="All");return oe>-1?[{...ye[oe],_id:"All"},...ye.slice(0,oe),...ye.slice(oe+1)]:ye},[V]),Qe=M.useCallback($p(t),[t]),Z=M.useMemo(()=>Np(Me,t),[Me,t]),pe=Lp(Qe),ee={search:H,compact:G,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:je},extraFilter:v,endpoint:A,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Qe,storeVersion:L,serverVersion:r,selectedCategory:H.filters.category||(c.showExplore?"":"All"),categoryList:Me,blockletRender:B,locale:t,categoryOptions:Z,priceOptions:pe,storeApi:F,baseSearch:l,showResourcesSwitch:T,showCategory:y,tagFilters:S,onFilterChange:i,getCategoryLocale:ye=>{if(!ye)return null;const oe=V.find(Ae=>Ae._id===ye||Ae.locales.en==="All");return oe?oe.locales[t]||oe.locales.en:null},get developerName(){return $},updateDeveloperName:le};return M.useEffect(()=>{setTimeout(We,u||0)},[A,We,u]),o.jsx(Up,{value:ee,children:j})}function it(){return M.useContext(bl)||yl}function xl({children:e,onClick:t,size:n=32,...r}){return o.jsx(ir,{...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 hr(e,t){return e===void 0?t:e}function vo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=yn(),c=qt(a.breakpoints.down("sm")),f=qt(a.breakpoints.between("sm","md")),v=qt(a.breakpoints.between("md","lg")),l=qt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:v?n||null:l?r||null:i||null;let u=e;return c||(u=hr(t,u),f)||(u=hr(n,u),v)||(u=hr(r,u),l)?u:hr(i,u)}function zp({children:e}){const{open:t,toggleOpen:n}=go();return o.jsx(vo,{xs:o.jsx($l,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const qp=M.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(ir,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(xt,{size:"1em"})}));function bi({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=M.useRef(null),c=yn(),[f,v]=M.useState(!1),[l,u]=M.useState(e!==null?e:""),T=qt(c.breakpoints.down("sm"));M.useEffect(()=>{u(e!==null?e:"")},[e]);const y=M.useCallback(()=>{v(!1)},[]),S=M.useCallback(()=>{v(!0)},[]);function j(D){u(D.value),n(D.value),T&&y()}function L(D){return D===l}return o.jsxs(o.Fragment,{children:[o.jsxs(Kp,{ref:a,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Hn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(D=>D.value===l))==null?void 0:s.name)||r,o.jsx(Ul,{className:"my-select__arrowdown",component:hc,sx:{width:18,height:18}})]}),o.jsx(Wl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:D,placement:A})=>o.jsx(zl,{...D,style:{transformOrigin:A==="bottom"?"center top":"center bottom"},children:o.jsx(ql,{children:o.jsx(Kl,{onClickAway:y,children:o.jsx(Gp,{autoFocusItem:f,onMouseEnter:S,onMouseLeave:y,children:t.map(B=>o.jsxs(Si,{onClick:()=>j(B),sx:{fontSize:14},children:[o.jsx(Ws,{sx:{mr:1,fontSize:16,visibility:L(B.value)?"visible":"hidden"}}),B.name]},B.value))})})})})})]})}const Kp=Gt(qp)`
485
+ `;const ts=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Zh=(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`},za={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 ci({title:e,sx:t,children:n,slotProps:r,fontSize:i=12,fontWeight:s=500,color:a="text.secondary",...c}){var f,v;return e?o.jsx(Ps,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Ml.tooltip}`]:{backgroundColor:"common.white",fontSize:i,fontWeight:s,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:a,display:"flex",alignItems:"center"}},...Array.isArray((f=r==null?void 0:r.popper)==null?void 0:f.sx)?r.popper.sx:[(v=r==null?void 0:r.popper)==null?void 0:v.sx]]}},children:n}):n}function cr({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(i)?i:[i]],children:[e,o.jsx(ci,{title:r||(typeof t=="string"?t:""),children:o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function ef(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:v="Install",buttonDisabled:l,buttonLoading:u,button:T,onButtonClick:y=()=>{},onMainClick:S,className:j,ref:L,icons:D,status:A,...B}=e,G=yn(),I=(H,se=()=>!1)=>(je,...We)=>{const Me=H instanceof Function;(se()||Me)&&(je.preventDefault(),je.stopPropagation(),Me&&H(...We))},F=S&&I(S),V=I(y,()=>!!(T||l||u)),$=M.isValidElement(t)?{children:t}:{title:ts(t),dangerouslySetInnerHTML:{__html:t}},le=M.isValidElement(n)?{children:n}:{title:ts(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Fl,{variant:"outlined",onClick:F,...B,sx:{p:{xs:2,md:3},borderRadius:2,...B.sx},children:[o.jsxs(rt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(br,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...$}),o.jsxs(Y,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[f&&o.jsx(ci,{title:f.tooltip,children:o.jsx(uc,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),D==null?void 0:D.map(H=>o.jsx(ci,{title:H.title,children:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon,style:{color:H.color}}):H.icon},H.key))]}),y&&o.jsxs(dt,{color:"reverse",variant:"outlined",size:"small",disabled:l||u,style:{borderColor:G.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:G.typography.fontWeightMedium},onClick:V,children:[u&&o.jsx(xt,{size:15,style:{marginRight:3,color:"inherit"}}),v]}),T]}),o.jsx(rt,{py:2,children:o.jsx(ge,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...le})}),o.jsxs(rt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(cr,{icon:o.jsx(br,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(cr,{icon:o.jsx(pt,{icon:za}),title:a,children:Zh(a)}),A==null?void 0:A.filter(H=>H.align!=="right").map(H=>o.jsx(cr,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,children:H.text},H.key)),o.jsx(Y,{sx:{flex:1}}),A==null?void 0:A.filter(H=>H.align==="right").map(H=>o.jsx(cr,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,sx:{color:H.color},children:H.text},H.key))]})]})}const tf={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>'},Yn=/^[a-z0-9]+(-[a-z0-9]+)*$/,_r=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),f=i.pop(),v={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!vr(v)?null:v}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!vr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!vr(c,n)?null:c}return null},vr=(e,t)=>e?!!((e.provider===""||e.provider.match(Yn))&&(t&&e.prefix===""||e.prefix.match(Yn))&&e.name.match(Yn)):!1,qa=Object.freeze({left:0,top:0,width:16,height:16}),wr=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ao=Object.freeze({...qa,...wr}),ui=Object.freeze({...ao,body:"",hidden:!1});function nf(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function ns(e,t){const n=nf(e,t);for(const r in ui)r in wr?r in e&&!(r in n)&&(n[r]=wr[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function rf(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,f=c&&s(c);f&&(i[a]=[c].concat(f))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function of(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=ns(r[c]||i[c],s)}return a(t),n.forEach(a),ns(e,s)}function Ka(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=rf(e);for(const i in r){const s=r[i];s&&(t(i,of(e,i,s)),n.push(i))}return n}const sf={provider:"",aliases:{},not_found:{},...qa};function qr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ga(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!qr(e,sf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Yn)||typeof s.body!="string"||!qr(s,ui))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(Yn)||typeof a!="string"||!n[a]&&!r[a]||!qr(s,ui))return null}return t}const rs=Object.create(null);function af(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function vn(e,t){const n=rs[e]||(rs[e]=Object.create(null));return n[t]||(n[t]=af(e,t))}function lo(e,t){return Ga(t)?Ka(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function lf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let er=!1;function Va(e){return typeof e=="boolean"&&(er=e),er}function cf(e){const t=typeof e=="string"?_r(e,!0,er):e;if(t){const n=vn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function uf(e,t){const n=_r(e,!0,er);if(!n)return!1;const r=vn(n.provider,n.prefix);return lf(r,n.name,t)}function df(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),er&&!t&&!e.prefix){let i=!1;return Ga(e)&&(e.prefix="",Ka(e,(s,a)=>{a&&uf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!vr({provider:t,prefix:n,name:"a"}))return!1;const r=vn(t,n);return!!lo(r,e)}const Ha=Object.freeze({width:null,height:null}),Xa=Object.freeze({...Ha,...wr}),hf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ff=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function is(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(hf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=ff.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}const pf=e=>e==="unset"||e==="undefined"||e==="none";function mf(e,t){const n={...ao,...e},r={...Xa,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(S=>{const j=[],L=S.hFlip,D=S.vFlip;let A=S.rotate;L?D?A+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):D&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let B;switch(A<0&&(A-=Math.floor(A/4)*4),A=A%4,A){case 1:B=i.height/2+i.top,j.unshift("rotate(90 "+B.toString()+" "+B.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:B=i.width/2+i.left,j.unshift("rotate(-90 "+B.toString()+" "+B.toString()+")");break}A%2===1&&(i.left!==i.top&&(B=i.left,i.left=i.top,i.top=B),i.width!==i.height&&(B=i.width,i.width=i.height,i.height=B)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,v=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?v:c,l=is(u,f/v)):(l=a==="auto"?f:a,u=c===null?is(l,v/f):c==="auto"?v:c);const T={},y=(S,j)=>{pf(j)||(T[S]=j.toString())};return y("width",l),y("height",u),T.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+v.toString(),{attributes:T,body:s}}const gf=/\sid="(\S+)"/g,vf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let yf=0;function bf(e,t=vf){const n=[];let r;for(;r=gf.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(yf++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const di=Object.create(null);function xf(e,t){di[e]=t}function hi(e){return di[e]||di[""]}function co(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const uo=Object.create(null),Gn=["https://api.simplesvg.com","https://api.unisvg.com"],yr=[];for(;Gn.length>0;)Gn.length===1||Math.random()>.5?yr.push(Gn.shift()):yr.push(Gn.pop());uo[""]=co({resources:["https://api.iconify.design"].concat(yr)});function wf(e,t){const n=co(t);return n===null?!1:(uo[e]=n,!0)}function ho(e){return uo[e]}const Ef=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let os=Ef();function Sf(e,t){const n=ho(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Tf(e){return e===404}const jf=(e,t,n)=>{const r=[],i=Sf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,v)=>{c+=f.length+1,c>=i&&v>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function kf(e){if(typeof e=="string"){const t=ho(e);if(t)return t.path}return"/"}const Of=(e,t,n)=>{if(!os){n("abort",424);return}let r=kf(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),f=new URLSearchParams({icons:c});r+=s+".json?"+f.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;os(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Tf(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},If={prepare:jf,send:Of};function Cf(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,f=n[s]||(n[s]=Object.create(null)),v=f[a]||(f[a]=vn(s,a));let l;c in v.icons?l=t.loaded:a===""||v.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Ya(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Rf(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(f=>{if(f.prefix!==i)return!0;const v=f.name;if(e.icons[v])a.loaded.push({provider:r,prefix:i,name:v});else if(e.missing.has(v))a.missing.push({provider:r,prefix:i,name:v});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Ya([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Pf=0;function _f(e,t,n){const r=Pf++,i=Ya.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function Lf(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?_r(i,t,n):i;s&&r.push(s)}),r}var Nf={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Af(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let F=e.resources.slice(0);for(a=[];F.length>1;){const V=Math.floor(Math.random()*F.length);a.push(F[V]),F=F.slice(0,V).concat(F.slice(V+1))}a=a.concat(F)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",v=0,l,u=null,T=[],y=[];typeof r=="function"&&y.push(r);function S(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),S(),T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function L(F,V){V&&(y=[]),typeof F=="function"&&y.push(F)}function D(){return{startTime:c,payload:t,status:f,queriesSent:v,queriesPending:T.length,subscribe:L,abort:j}}function A(){f="failed",y.forEach(F=>{F(void 0,l)})}function B(){T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function G(F,V,$){const le=V!=="success";switch(T=T.filter(H=>H!==F),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(V==="abort"){l=$,A();return}if(le){l=$,T.length||(a.length?I():A());return}if(S(),B(),!e.random){const H=e.resources.indexOf(F.resource);H!==-1&&H!==e.index&&(e.index=H)}f="completed",y.forEach(H=>{H($)})}function I(){if(f!=="pending")return;S();const F=a.shift();if(F===void 0){if(T.length){u=setTimeout(()=>{S(),f==="pending"&&(B(),A())},e.timeout);return}A();return}const V={status:"pending",resource:F,callback:($,le)=>{G(V,$,le)}};T.push(V),v++,u=setTimeout(I,e.rotate),n(F,t,V.callback)}return setTimeout(I),D}function Qa(e){const t={...Nf,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,v){const l=Af(t,c,f,(u,T)=>{r(),v&&v(u,T)});return n.push(l),l}function s(c){return n.find(f=>c(f))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function ss(){}const Kr=Object.create(null);function Df(e){if(!Kr[e]){const t=ho(e);if(!t)return;const n=Qa(t),r={config:t,redundancy:n};Kr[e]=r}return Kr[e]}function Mf(e,t,n){let r,i;if(typeof e=="string"){const s=hi(e);if(!s)return n(void 0,424),ss;i=s.send;const a=Df(e);a&&(r=a.redundancy)}else{const s=co(e);if(s){r=Qa(s);const a=e.resources?e.resources[0]:"",c=hi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),ss):r.query(t,i,n)().abort}const as="iconify2",tr="iconify",Ja=tr+"-count",ls=tr+"-version",Za=36e5,Ff=168;function fi(e,t){try{return e.getItem(t)}catch{}}function fo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function cs(e,t){try{e.removeItem(t)}catch{}}function pi(e,t){return fo(e,Ja,t.toString())}function mi(e){return parseInt(fi(e,Ja))||0}const Lr={local:!0,session:!0},el={local:new Set,session:new Set};let po=!1;function Bf(e){po=e}let ur=typeof window>"u"?{}:window;function tl(e){const t=e+"Storage";try{if(ur&&ur[t]&&typeof ur[t].length=="number")return ur[t]}catch{}Lr[e]=!1}function nl(e,t){const n=tl(e);if(!n)return;const r=fi(n,ls);if(r!==as){if(r){const c=mi(n);for(let f=0;f<c;f++)cs(n,tr+f.toString())}fo(n,ls,as),pi(n,0);return}const i=Math.floor(Date.now()/Za)-Ff,s=c=>{const f=tr+c.toString(),v=fi(n,f);if(typeof v=="string"){try{const l=JSON.parse(v);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>i&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&t(l,c))return!0}catch{}cs(n,f)}};let a=mi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,pi(n,a)):el[e].add(c))}function rl(){if(!po){Bf(!0);for(const e in Lr)nl(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=vn(r,i);if(!lo(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function $f(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Lr)nl(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Uf(e,t){po||rl();function n(r){let i;if(!Lr[r]||!(i=tl(r)))return;const s=el[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=mi(i),!pi(i,a+1))return;const c={cached:Math.floor(Date.now()/Za),provider:e.provider,data:t};return fo(i,tr+a.toString(),JSON.stringify(c))}t.lastModified&&!$f(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function us(){}function Wf(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Rf(e)}))}function zf(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=hi(n)))return;s.prepare(n,r,i).forEach(c=>{Mf(n,c,f=>{if(typeof f!="object")c.icons.forEach(v=>{e.missing.add(v)});else try{const v=lo(e,f);if(!v.length)return;const l=e.pendingIcons;l&&v.forEach(u=>{l.delete(u)}),Uf(e,f)}catch(v){console.error(v)}Wf(e)})})}))}const qf=(e,t)=>{const n=Lf(e,!0,Va()),r=Cf(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,us)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:v,prefix:l}=f;if(l===c&&v===a)return;a=v,c=l,s.push(vn(v,l));const u=i[v]||(i[v]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:v,prefix:l,name:u}=f,T=vn(v,l),y=T.pendingIcons||(T.pendingIcons=new Set);y.has(u)||(y.add(u),i[v][l].push(u))}),s.forEach(f=>{const{provider:v,prefix:l}=f;i[v][l].length&&zf(f,i[v][l])}),t?_f(t,r,s):us};function Kf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Ha?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Gf=/[\s,]+/;function Vf(e,t){t.split(Gf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Hf(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function Xf(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Yf(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Qf(e){return"data:image/svg+xml,"+Yf(e)}function Jf(e){return'url("'+Qf(e)+'")'}let Qn;function Zf(){try{Qn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Qn=null}}function ep(e){return Qn===void 0&&Zf(),Qn?Qn.createHTML(e):e}const il={...Xa,inline:!1},tp={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},np={display:"inline-block"},gi={backgroundColor:"currentColor"},ol={backgroundColor:"transparent"},ds={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},hs={WebkitMask:gi,mask:gi,background:ol};for(const e in hs){const t=hs[e];for(const n in ds)t[e+n]=ds[n]}const rp={...il,inline:!0};function fs(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const ip=(e,t,n,r)=>{const i=n?rp:il,s=Kf(i,t),a=t.mode||"svg",c={},f=t.style||{},v={...a==="svg"?tp:{},ref:r};for(let D in t){const A=t[D];if(A!==void 0)switch(D){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[D]=A===!0||A==="true"||A===1;break;case"flip":typeof A=="string"&&Vf(s,A);break;case"color":c.color=A;break;case"rotate":typeof A=="string"?s[D]=Hf(A):typeof A=="number"&&(s[D]=A);break;case"ariaHidden":case"aria-hidden":A!==!0&&A!=="true"&&delete v["aria-hidden"];break;default:i[D]===void 0&&(v[D]=A)}}const l=mf(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){v.style={...c,...f},Object.assign(v,u);let D=0,A=t.id;return typeof A=="string"&&(A=A.replace(/-/g,"_")),v.dangerouslySetInnerHTML={__html:ep(bf(l.body,A?()=>A+"ID"+D++:"iconifyReact"))},Mt.createElement("svg",v)}const{body:T,width:y,height:S}=e,j=a==="mask"||(a==="bg"?!1:T.indexOf("currentColor")!==-1),L=Xf(T,{...u,width:y+"",height:S+""});return v.style={...c,"--svg":Jf(L),width:fs(u.width),height:fs(u.height),...np,...j?gi:ol,...f},Mt.createElement("span",v)};Va(!0);xf("",If);if(typeof document<"u"&&typeof window<"u"){rl();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!df(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;wf(n,i)||console.error(r)}catch{console.error(r)}}}}class sl extends Mt.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||n.icon===null)&&this._setData({data:r});return}let i;if(typeof r!="string"||(i=_r(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=cf(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:qf([i],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const a=["iconify"];i.prefix!==""&&a.push("iconify--"+i.prefix),i.provider!==""&&a.push("iconify--"+i.provider),this._setData({data:s,classes:a}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,n=this.state.icon;if(n===null)return t.children?t.children:Mt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),ip({...ao,...n.data},r,t._inline,t._ref)}}const nr=Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Mt.createElement(sl,r)});Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Mt.createElement(sl,r)});var al={exports:{}};(function(e,t){(function(n,r){e.exports=r(M)})(Se,n=>(()=>{var r={703:(c,f,v)=>{var l=v(414);function u(){}function T(){}T.resetWarningCache=u,c.exports=function(){function y(L,D,A,B,G,I){if(I!==l){var F=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 F.name="Invariant Violation",F}}function S(){return y}y.isRequired=y;var j={array:y,bool:y,func:y,number:y,object:y,string:y,symbol:y,any:y,arrayOf:S,element:y,elementType:y,instanceOf:S,node:y,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:T,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,v)=>{c.exports=v(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",v=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function T(y,S){if(y===S)return!0;if(y&&S&&typeof y=="object"&&typeof S=="object"){if(y.constructor!==S.constructor)return!1;var j,L,D,A;if(Array.isArray(y)){if((j=y.length)!=S.length)return!1;for(L=j;L--!=0;)if(!T(y[L],S[L]))return!1;return!0}if(v&&y instanceof Map&&S instanceof Map){if(y.size!==S.size)return!1;for(A=y.entries();!(L=A.next()).done;)if(!S.has(L.value[0]))return!1;for(A=y.entries();!(L=A.next()).done;)if(!T(L.value[1],S.get(L.value[0])))return!1;return!0}if(l&&y instanceof Set&&S instanceof Set){if(y.size!==S.size)return!1;for(A=y.entries();!(L=A.next()).done;)if(!S.has(L.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(S)){if((j=y.length)!=S.length)return!1;for(L=j;L--!=0;)if(y[L]!==S[L])return!1;return!0}if(y.constructor===RegExp)return y.source===S.source&&y.flags===S.flags;if(y.valueOf!==Object.prototype.valueOf)return y.valueOf()===S.valueOf();if(y.toString!==Object.prototype.toString)return y.toString()===S.toString();if((j=(D=Object.keys(y)).length)!==Object.keys(S).length)return!1;for(L=j;L--!=0;)if(!Object.prototype.hasOwnProperty.call(S,D[L]))return!1;if(f&&y instanceof Element)return!1;for(L=j;L--!=0;)if((D[L]!=="_owner"&&D[L]!=="__v"&&D[L]!=="__o"||!y.$$typeof)&&!T(y[D[L]],S[D[L]]))return!1;return!0}return y!=y&&S!=S}c.exports=function(y,S){try{return T(y,S)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var v=i[c]={exports:{}};return r[c](v,v.exports,s),v.exports}s.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return s.d(f,{a:f}),f},s.d=(c,f)=>{for(var v in f)s.o(f,v)&&!s.o(c,v)&&Object.defineProperty(c,v,{enumerable:!0,get:f[v]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),s.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};return(()=>{function c(b){var p,E,k="";if(typeof b=="string"||typeof b=="number")k+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(E=c(b[p]))&&(k&&(k+=" "),k+=E);else for(p in b)b[p]&&(k&&(k+=" "),k+=p);return k}function f(){for(var b,p,E=0,k="";E<arguments.length;)(b=arguments[E++])&&(p=c(b))&&(k&&(k+=" "),k+=p);return k}s.r(a),s.d(a,{default:()=>jl});var v=s(359),l=s.n(v);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},T=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var y=typeof self=="object"&&self&&self.Object===Object&&self;const S=T||y||Function("return this")(),j=function(){return S.Date.now()};var L=/\s/,D=/^\s+/;const A=function(b){return b&&b.slice(0,function(p){for(var E=p.length;E--&&L.test(p.charAt(E)););return E}(b)+1).replace(D,"")},B=S.Symbol;var G=Object.prototype,I=G.hasOwnProperty,F=G.toString,V=B?B.toStringTag:void 0,$=Object.prototype.toString,le=B?B.toStringTag:void 0;const H=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":le&&le in Object(b)?function(p){var E=I.call(p,V),k=p[V];try{p[V]=void 0;var q=!0}catch{}var re=F.call(p);return q&&(E?p[V]=k:delete p[V]),re}(b):function(p){return $.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,We=/^0o[0-7]+$/i,Me=parseInt;const Qe=function(b){if(typeof b=="number")return b;if(function(k){return typeof k=="symbol"||function(q){return q!=null&&typeof q=="object"}(k)&&H(k)=="[object Symbol]"}(b))return NaN;if(u(b)){var p=typeof b.valueOf=="function"?b.valueOf():b;b=u(p)?p+"":p}if(typeof b!="string")return b===0?b:+b;b=A(b);var E=je.test(b);return E||We.test(b)?Me(b.slice(2),E?2:8):se.test(b)?NaN:+b};var Z=Math.max,pe=Math.min;const ee=function(b,p,E){var k,q,re,me,g,m,C=0,U=!1,K=!1,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");function ue(ie){var fe=k,be=q;return k=q=void 0,C=ie,me=b.apply(be,fe)}function ce(ie){return C=ie,g=setTimeout(X,p),U?ue(ie):me}function he(ie){var fe=ie-m;return m===void 0||fe>=p||fe<0||K&&ie-C>=re}function X(){var ie=j();if(he(ie))return Q(ie);g=setTimeout(X,function(fe){var be=p-(fe-m);return K?pe(be,re-(fe-C)):be}(ie))}function Q(ie){return g=void 0,z&&k?ue(ie):(k=q=void 0,me)}function J(){var ie=j(),fe=he(ie);if(k=arguments,q=this,m=ie,fe){if(g===void 0)return ce(m);if(K)return clearTimeout(g),g=setTimeout(X,p),ue(m)}return g===void 0&&(g=setTimeout(X,p)),me}return p=Qe(p)||0,u(E)&&(U=!!E.leading,re=(K="maxWait"in E)?Z(Qe(E.maxWait)||0,p):re,z="trailing"in E?!!E.trailing:z),J.cancel=function(){g!==void 0&&clearTimeout(g),C=0,k=m=q=g=void 0},J.flush=function(){return g===void 0?me:Q(j())},J},ye=function(b,p,E){var k=!0,q=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(E)&&(k="leading"in E?!!E.leading:k,q="trailing"in E?!!E.trailing:q),ee(b,p,{leading:k,maxWait:p,trailing:q})};var oe=s(590),Ae=s.n(oe),we=function(){if(typeof Map<"u")return Map;function b(p,E){var k=-1;return p.some(function(q,re){return q[0]===E&&(k=re,!0)}),k}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 k=b(this.__entries__,E),q=this.__entries__[k];return q&&q[1]},p.prototype.set=function(E,k){var q=b(this.__entries__,E);~q?this.__entries__[q][1]=k:this.__entries__.push([E,k])},p.prototype.delete=function(E){var k=this.__entries__,q=b(k,E);~q&&k.splice(q,1)},p.prototype.has=function(E){return!!~b(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,k){k===void 0&&(k=null);for(var q=0,re=this.__entries__;q<re.length;q++){var me=re[q];E.call(k,me[1],me[0])}},p}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,qe=s.g!==void 0&&s.g.Math===Math?s.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Vt=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(qe):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Ht=["top","right","bottom","left","width","height","size","weight"],Ft=typeof MutationObserver<"u",Xt=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var k=!1,q=!1,re=0;function me(){k&&(k=!1,p()),q&&m()}function g(){Vt(me)}function m(){var C=Date.now();if(k){if(C-re<2)return;q=!0}else k=!0,q=!1,setTimeout(g,20);re=C}return m}(this.refresh.bind(this))}return b.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},b.prototype.removeObserver=function(p){var E=this.observers_,k=E.indexOf(p);~k&&E.splice(k,1),!E.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.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},b.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ft?(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)},b.prototype.disconnect_=function(){Je&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(p){var E=p.propertyName,k=E===void 0?"":E;Ht.some(function(q){return!!~k.indexOf(q)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Pe=function(b,p){for(var E=0,k=Object.keys(p);E<k.length;E++){var q=k[E];Object.defineProperty(b,q,{value:p[q],enumerable:!1,writable:!1,configurable:!0})}return b},_e=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||qe},Ze=ke(0,0,0,0);function de(b){return parseFloat(b)||0}function Yt(b){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(k,q){return k+de(b["border-"+q+"-width"])},0)}var Qt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof _e(b).SVGGraphicsElement}:function(b){return b instanceof _e(b).SVGElement&&typeof b.getBBox=="function"};function Jt(b){return Je?Qt(b)?function(p){var E=p.getBBox();return ke(0,0,E.width,E.height)}(b):function(p){var E=p.clientWidth,k=p.clientHeight;if(!E&&!k)return Ze;var q=_e(p).getComputedStyle(p),re=function(z){for(var ue={},ce=0,he=["top","right","bottom","left"];ce<he.length;ce++){var X=he[ce],Q=z["padding-"+X];ue[X]=de(Q)}return ue}(q),me=re.left+re.right,g=re.top+re.bottom,m=de(q.width),C=de(q.height);if(q.boxSizing==="border-box"&&(Math.round(m+me)!==E&&(m-=Yt(q,"left","right")+me),Math.round(C+g)!==k&&(C-=Yt(q,"top","bottom")+g)),!function(z){return z===_e(z).document.documentElement}(p)){var U=Math.round(m+me)-E,K=Math.round(C+g)-k;Math.abs(U)!==1&&(m-=U),Math.abs(K)!==1&&(C-=K)}return ke(re.left,re.top,m,C)}(b):Ze}function ke(b,p,E,k){return{x:b,y:p,width:E,height:k}}var Bt=function(){function b(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ke(0,0,0,0),this.target=p}return b.prototype.isActive=function(){var p=Jt(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},b}(),Nn=function(b,p){var E,k,q,re,me,g,m,C=(k=(E=p).x,q=E.y,re=E.width,me=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Pe(m,{x:k,y:q,width:re,height:me,top:q,right:k+re,bottom:me+q,left:k}),m);Pe(this,{target:b,contentRect:C})},et=function(){function b(p,E,k){if(this.activeObservations_=[],this.observations_=new we,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=k}return b.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 _e(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new Bt(p)),this.controller_.addObserver(this),this.controller_.refresh())}},b.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 _e(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))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(k){return new Nn(k.target,k.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),Zt=typeof WeakMap<"u"?new WeakMap:new we,en=function b(p){if(!(this instanceof b))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=Xt.getInstance(),k=new et(p,E,this);Zt.set(this,k)};["observe","unobserve","disconnect"].forEach(function(b){en.prototype[b]=function(){var p;return(p=Zt.get(this))[b].apply(p,arguments)}});const tn=qe.ResizeObserver!==void 0?qe.ResizeObserver:en,Fe="Left",tt="Right",wt="Up",ot="Down",Et={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},It={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ke="mousemove",xn="mouseup";function nn(b,p){if(p===0)return b;const E=Math.PI/180*p;return[b[0]*Math.cos(E)+b[1]*Math.sin(E),b[1]*Math.cos(E)-b[0]*Math.sin(E)]}function wn(b){const{trackMouse:p}=b,E=v.useRef(Object.assign({},It)),k=v.useRef(Object.assign({},Et)),q=v.useRef(Object.assign({},k.current));let re;for(re in q.current=Object.assign({},k.current),k.current=Object.assign(Object.assign({},Et),b),Et)k.current[re]===void 0&&(k.current[re]=Et[re]);const[me,g]=v.useMemo(()=>function(m,C){const U=X=>{const Q="touches"in X;Q&&X.touches.length>1||m((J,ie)=>{ie.trackMouse&&!Q&&(document.addEventListener(Ke,K),document.addEventListener(xn,ue));const{clientX:fe,clientY:be}=Q?X.touches[0]:X,Le=nn([fe,be],ie.rotationAngle);return ie.onTouchStartOrOnMouseDown&&ie.onTouchStartOrOnMouseDown({event:X}),Object.assign(Object.assign(Object.assign({},J),It),{initial:Le.slice(),xy:Le,start:X.timeStamp||0})})},K=X=>{m((Q,J)=>{const ie="touches"in X;if(ie&&X.touches.length>1)return Q;if(X.timeStamp-Q.start>J.swipeDuration)return Q.swiping?Object.assign(Object.assign({},Q),{swiping:!1}):Q;const{clientX:fe,clientY:be}=ie?X.touches[0]:X,[Le,lt]=nn([fe,be],J.rotationAngle),nt=Le-Q.xy[0],Ge=lt-Q.xy[1],Re=Math.abs(nt),xe=Math.abs(Ge),Wt=(X.timeStamp||0)-Q.start,Bn=Math.sqrt(Re*Re+xe*xe)/(Wt||1),$n=[nt/(Wt||1),Ge/(Wt||1)],Lt=function(Un,On,Wn,ct){return Un>On?Wn>0?tt:Fe:ct>0?ot:wt}(Re,xe,nt,Ge),cn=typeof J.delta=="number"?J.delta:J.delta[Lt.toLowerCase()]||Et.delta;if(Re<cn&&xe<cn&&!Q.swiping)return Q;const Tt={absX:Re,absY:xe,deltaX:nt,deltaY:Ge,dir:Lt,event:X,first:Q.first,initial:Q.initial,velocity:Bn,vxvy:$n};Tt.first&&J.onSwipeStart&&J.onSwipeStart(Tt),J.onSwiping&&J.onSwiping(Tt);let kn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${Lt}`])&&(kn=!0),kn&&J.preventScrollOnSwipe&&J.trackTouch&&X.cancelable&&X.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Tt,swiping:!0})})},z=X=>{m((Q,J)=>{let ie;if(Q.swiping&&Q.eventData){if(X.timeStamp-Q.start<J.swipeDuration){ie=Object.assign(Object.assign({},Q.eventData),{event:X}),J.onSwiped&&J.onSwiped(ie);const fe=J[`onSwiped${ie.dir}`];fe&&fe(ie)}}else J.onTap&&J.onTap({event:X});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:X}),Object.assign(Object.assign(Object.assign({},Q),It),{eventData:ie})})},ue=X=>{document.removeEventListener(Ke,K),document.removeEventListener(xn,ue),z(X)},ce=(X,Q)=>{let J=()=>{};if(X&&X.addEventListener){const ie=Object.assign(Object.assign({},Et.touchEventOptions),Q.touchEventOptions),fe=[["touchstart",U,ie],["touchmove",K,Object.assign(Object.assign({},ie),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",z,ie]];fe.forEach(([be,Le,lt])=>X.addEventListener(be,Le,lt)),J=()=>fe.forEach(([be,Le])=>X.removeEventListener(be,Le))}return J},he={ref:X=>{X!==null&&m((Q,J)=>{if(Q.el===X)return Q;const ie={};return Q.el&&Q.el!==X&&Q.cleanUpTouch&&(Q.cleanUpTouch(),ie.cleanUpTouch=void 0),J.trackTouch&&X&&(ie.cleanUpTouch=ce(X,J)),Object.assign(Object.assign(Object.assign({},Q),{el:X}),ie)})}};return C.trackMouse&&(he.onMouseDown=U),[he,ce]}(m=>E.current=m(E.current,k.current),{trackMouse:p}),[p]);return E.current=function(m,C,U,K){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==U.preventScrollOnSwipe||C.touchEventOptions.passive!==U.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,k.current,q.current,g),me}var R=s(697);function St(b){return St=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},St(b)}function Ct(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function rn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Ct(Object(E),!0).forEach(function(k){d(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Ct(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function d(b,p,E){return(p=function(k){var q=function(re,me){if(St(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(St(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return St(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=l().memo(function(b){var p=rn(rn({},x),b),E=p.description,k=p.fullscreen,q=p.handleImageLoaded,re=p.isFullscreen,me=p.onImageError,g=p.original,m=p.originalAlt,C=p.originalHeight,U=p.originalWidth,K=p.originalTitle,z=p.sizes,ue=p.srcSet,ce=p.loading,he=re&&k||g;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:he,alt:m,srcSet:ue,height:C,width:U,sizes:z,title:K,onLoad:function(X){return q(X,g)},onError:me,loading:ce}),E&&l().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:R.string,fullscreen:R.string,handleImageLoaded:R.func.isRequired,isFullscreen:R.bool,onImageError:R.func.isRequired,original:R.string.isRequired,originalAlt:R.string,originalHeight:R.string,originalWidth:R.string,originalTitle:R.string,sizes:R.string,srcSet:R.string,loading:R.string};const P=w;function O(b){return O=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},O(b)}function _(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function W(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_(Object(E),!0).forEach(function(k){ne(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):_(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function ne(b,p,E){return(p=function(k){var q=function(re,me){if(O(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(O(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return O(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var ae={left:l().createElement("polyline",{points:"15 18 9 12 15 6"}),right:l().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:l().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:l().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:l().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:l().createElement(l().Fragment,null,l().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),l().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Be={strokeWidth:1,viewBox:"0 0 24 24"},Ne=function(b){var p=W(W({},Be),b),E=p.strokeWidth,k=p.viewBox,q=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:k,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},ae[q])};Ne.propTypes={strokeWidth:R.number,viewBox:R.string,icon:(0,R.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ee=Ne;var Te=l().memo(function(b){var p=b.isFullscreen,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},l().createElement(Ee,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Te.displayName="Fullscreen",Te.propTypes={isFullscreen:R.bool.isRequired,onClick:R.func.isRequired};const Xe=Te;var Rt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},l().createElement(Ee,{icon:"left",viewBox:"6 0 12 24"}))});Rt.displayName="LeftNav",Rt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const An=Rt;var Pt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},l().createElement(Ee,{icon:"right",viewBox:"6 0 12 24"}))});Pt.displayName="RightNav",Pt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const st=Pt;var $t=l().memo(function(b){var p=b.isPlaying,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},l().createElement(Ee,{strokeWidth:2,icon:p?"pause":"play"}))});$t.displayName="PlayPause",$t.propTypes={isPlaying:R.bool.isRequired,onClick:R.func.isRequired};const Ut=$t;function ft(b){return ft=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},ft(b)}function at(){return at=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var k in E)Object.prototype.hasOwnProperty.call(E,k)&&(b[k]=E[k])}return b},at.apply(this,arguments)}function _t(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function En(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?_t(Object(E),!0).forEach(function(k){Sn(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):_t(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function Sn(b,p,E){return(p=function(k){var q=function(re,me){if(ft(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(ft(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return ft(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var sr={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Dn=function(b){var p=En(En({},sr),b),E=p.children,k=p.className,q=wn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",at({},q,{className:k}),E)};Dn.propTypes={children:R.node.isRequired,className:R.string,delta:R.number,onSwiped:R.func,onSwiping:R.func};const Mn=Dn;function $e(b){return $e=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},$e(b)}function Tn(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function on(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Tn(Object(E),!0).forEach(function(k){an(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Tn(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function jn(b,p){for(var E=0;E<p.length;E++){var k=p[E];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(b,ln(k.key),k)}}function sn(b,p){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,k){return E.__proto__=k,E},sn(b,p)}function Fn(b,p){if(p&&($e(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oe(b)}function Oe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function vt(b){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},vt(b)}function an(b,p,E){return(p=ln(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}function ln(b){var p=function(E,k){if($e(E)!=="object"||E===null)return E;var q=E[Symbol.toPrimitive];if(q!==void 0){var re=q.call(E,k);if($e(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(b,"string");return $e(p)==="symbol"?p:String(p)}var ar=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Tl=(0,R.arrayOf)((0,R.shape)({srcSet:R.string,media:R.string}));function So(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Ar=function(b){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&sn(g,m)})(me,b);var p,E,k,q,re=(k=me,q=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=vt(k);if(q){var C=vt(this).constructor;g=Reflect.construct(m,arguments,C)}else g=m.apply(this,arguments);return Fn(this,g)});function me(g){var m;return function(C,U){if(!(C instanceof U))throw new TypeError("Cannot call a class as a function")}(this,me),an(Oe(m=re.call(this,g)),"onBulletClick",function(C,U){var K=m.props,z=K.onBulletClick,ue=K.items,ce=m.state.currentIndex;C.target.blur(),ce!==U&&(ue.length===2?m.slideToIndexWithStyleReset(U,C):m.slideToIndex(U,C)),z&&z(C,U)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=l().createRef(),m.thumbnailsWrapper=l().createRef(),m.thumbnails=l().createRef(),m.imageGallerySlideWrapper=l().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(Oe(m)),m.handleKeyDown=m.handleKeyDown.bind(Oe(m)),m.handleMouseDown=m.handleMouseDown.bind(Oe(m)),m.handleResize=m.handleResize.bind(Oe(m)),m.handleTouchMove=m.handleTouchMove.bind(Oe(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Oe(m)),m.handleScreenChange=m.handleScreenChange.bind(Oe(m)),m.handleSwiping=m.handleSwiping.bind(Oe(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Oe(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Oe(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Oe(m)),m.handleImageError=m.handleImageError.bind(Oe(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Oe(m)),m.renderThumbInner=m.renderThumbInner.bind(Oe(m)),m.renderItem=m.renderItem.bind(Oe(m)),m.slideLeft=m.slideLeft.bind(Oe(m)),m.slideRight=m.slideRight.bind(Oe(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Oe(m)),m.togglePlay=m.togglePlay.bind(Oe(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=ye(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return p=me,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,C=g.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var C=this.props,U=C.items,K=C.lazyLoad,z=C.slideDuration,ue=C.slideInterval,ce=C.startIndex,he=C.thumbnailPosition,X=C.showThumbnails,Q=C.useWindowKeyDown,J=this.state,ie=J.currentIndex,fe=J.isPlaying,be=g.items.length!==U.length,Le=!Ae()(g.items,U),lt=g.startIndex!==ce,nt=g.thumbnailPosition!==he,Ge=g.showThumbnails!==X;ue===g.slideInterval&&z===g.slideDuration||fe&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ge&&X&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ge&&!X&&this.removeThumbnailsResizeObserver(),(be||Ge)&&this.handleResize(),m.currentIndex!==ie&&this.slideThumbnailBar(),g.slideDuration!==z&&(this.slideToIndex=ye(this.unthrottledSlideToIndex,z,{trailing:!1})),!K||g.lazyLoad&&!Le||(this.lazyLoaded=[]),Q!==g.useWindowKeyDown&&(Q?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(lt||Le)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,C=m.currentIndex,U=m.isTransitioning,K=this.props,z=K.onSlide,ue=K.slideDuration;this.transitionTimer=window.setTimeout(function(){U&&(g.setState({isTransitioning:!U,isSwipingThumbnail:!1}),z&&z(C))},ue+50)}},{key:"onThumbnailClick",value:function(g,m){var C=this.props,U=C.onThumbnailClick,K=C.items,z=this.state.currentIndex;g.target.parentNode.parentNode.blur(),z!==m&&(K.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),U&&U(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,C=this.props,U=C.disableThumbnailScroll,K=C.items,z=this.state,ue=z.thumbnailsWrapperWidth,ce=z.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(U)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=ce)return 0;m=he.scrollHeight-ce}else{if(he.scrollWidth<=ue||ue<=0)return 0;m=he.scrollWidth-ue}return g*(m/(K.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,C=this.props,U=C.infinite,K=C.items,z="",ue="image-gallery-left",ce="image-gallery-right";switch(g){case m-1:z=" ".concat(ue);break;case m:z=" ".concat("image-gallery-center");break;case m+1:z=" ".concat(ce)}return K.length>=3&&U&&(g===0&&m===K.length-1?z=" ".concat(ce):g===K.length-1&&m===0&&(z=" ".concat(ue))),z}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.previousIndex,z=C!==K,ue=g===0&&K===0,ce=g===1&&K===1,he=g===0&&C===1,X=g===1&&C===0,Q=U===0,J=-100*C+100*g+U;return U>0?this.direction="left":U<0&&(this.direction="right"),X&&U>0&&(J=-100+U),he&&U<0&&(J=100+U),z?ue&&Q&&this.direction==="left"?J=100:ce&&Q&&this.direction==="right"&&(J=-100):(X&&Q&&this.direction==="left"&&(J=-100),he&&Q&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.slideStyle,z=this.props,ue=z.infinite,ce=z.items,he=z.useTranslate3D,X=z.isRTL,Q=-100*C,J=ce.length-1,ie=(Q+100*g)*(X?-1:1)+U;ue&&ce.length>2&&(C===0&&g===J?ie=-100*(X?-1:1)+U:C===J&&g===0&&(ie=100*(X?-1:1)+U)),ue&&ce.length===2&&(ie=this.getTranslateXForTwoSlide(g));var fe="translate(".concat(ie,"%, 0)");return he&&(fe="translate3d(".concat(ie,"%, 0, 0)")),on({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:fe,MozTransform:fe,msTransform:fe,OTransform:fe,transform:fe},K)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,C=m.useTranslate3D,U=m.isRTL,K=this.state,z=K.thumbsTranslate,ue=K.thumbsStyle,ce=U?-1*z:z;return this.isThumbnailVertical()?(g="translate(0, ".concat(z,"px)"),C&&(g="translate3d(0, ".concat(z,"px, 0)"))):(g="translate(".concat(ce,"px, 0)"),C&&(g="translate3d(".concat(ce,"px, 0, 0)"))),on({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},ue)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,C=this.props,U=C.items,K=C.slideOnThumbnailOver,z=C.onClick,ue=C.lazyLoad,ce=C.onTouchMove,he=C.onTouchEnd,X=C.onTouchStart,Q=C.onMouseOver,J=C.onMouseLeave,ie=C.renderItem,fe=C.renderThumbInner,be=C.showThumbnails,Le=C.showBullets,lt=[],nt=[],Ge=[];return U.forEach(function(Re,xe){var Wt=g.getAlignmentClassName(xe),Bn=Re.originalClass?" ".concat(Re.originalClass):"",$n=Re.thumbnailClass?" ".concat(Re.thumbnailClass):"",Lt=Re.renderItem||ie||g.renderItem,cn=Re.renderThumbInner||fe||g.renderThumbInner,Tt=!ue||Wt||g.lazyLoaded[xe];Tt&&ue&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var kn=g.getSlideStyle(xe),Un=l().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Wt," ").concat(Bn),style:kn,onClick:z,onKeyUp:g.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:he,onTouchStart:X,onMouseOver:Q,onFocus:Q,onMouseLeave:J,role:"button"},Tt?Lt(Re):l().createElement("div",{style:{height:"100%"}}));if(lt.push(Un),be&&Re.thumbnail){var On=f("image-gallery-thumbnail",$n,{active:m===xe});nt.push(l().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:On,onMouseLeave:K?g.onThumbnailMouseLeave:null,onMouseOver:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onFocus:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onKeyUp:function(ct){return g.handleThumbnailKeyUp(ct,xe)},onClick:function(ct){return g.onThumbnailClick(ct,xe)}},cn(Re)))}if(Le){var Wn=f("image-gallery-bullet",Re.bulletClass,{active:m===xe});Ge.push(l().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Wn,onClick:function(ct){return g.onBulletClick(ct,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:lt,thumbnails:nt,bullets:Ge}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,C=m.previousIndex,U=m.currentIndex,K=g.length-1;return Math.abs(C-U)>1&&!(C===0&&U===K)&&!(C===K&&U===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,C=m.isTransitioning,U=m.previousIndex,K=m.currentIndex;return C&&!(g===U||g===K)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,C=g.isSwipingThumbnail,U=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:U,thumbsSwipedTranslate:U}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,C=g.absX,U=g.dir,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=this.state,he=ce.galleryWidth,X=ce.isTransitioning,Q=ce.swipingUpDown,J=ce.swipingLeftRight;if(U!==wt&&U!==ot&&!Q||J){if(U!==Fe&&U!==tt||J||this.setState({swipingLeftRight:!0}),!z){var ie=this.props.swipingTransitionDuration;if(ue&&m.preventDefault(),X)this.setState({currentSlideOffset:0});else{var fe=U===tt?1:-1,be=C/he*100;Math.abs(be)>=100&&(be=100);var Le={transition:"transform ".concat(ie,"ms ease-out")};this.setState({currentSlideOffset:fe*be,slideStyle:Le})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,C=g.absX,U=g.absY,K=g.dir,z=this.props,ue=z.stopPropagation,ce=z.swipingThumbnailTransitionDuration,he=this.state,X=he.thumbsSwipedTranslate,Q=he.thumbnailsWrapperHeight,J=he.thumbnailsWrapperWidth,ie=he.swipingUpDown,fe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((K===Fe||K===tt||fe)&&!ie)return void(fe||this.setState({swipingLeftRight:!0}));K!==wt&&K!==ot||ie||this.setState({swipingUpDown:!0})}else{if((K===wt||K===ot||ie)&&!fe)return void(ie||this.setState({swipingUpDown:!0}));K!==Fe&&K!==tt||fe||this.setState({swipingLeftRight:!0})}var be,Le,lt,nt,Ge,Re=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=X+(K===ot?U:-U),Le=Re.scrollHeight-Q+20,lt=Math.abs(be)>Le,nt=be>20,Ge=Re.scrollHeight<=Q):(be=X+(K===tt?C:-C),Le=Re.scrollWidth-J+20,lt=Math.abs(be)>Le,nt=be>20,Ge=Re.scrollWidth<=J),!Ge&&(K!==Fe&&K!==wt||!lt)&&(K!==tt&&K!==ot||!nt)){ue&&m.stopPropagation();var xe={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,C=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,C=g.dir,U=g.velocity,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=K.flickThreshold;if(!z){var he=this.props.isRTL;ue&&m.stopPropagation(),this.resetSwipingDirection();var X=(C===Fe?1:-1)*(he?-1:1),Q=U>ce&&!(C===wt||C===ot);this.handleOnSwipedTo(X,Q)}}},{key:"handleOnSwipedTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=U;!this.sufficientSwipe()&&!m||K||(z+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(z=U),this.unthrottledSlideToIndex(z)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,C=m.disableKeyDown,U=m.useBrowserFullscreen,K=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:K&&!U&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperWidth:U.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperHeight:U.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,C=g.useBrowserFullscreen,U=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,K=this.imageGallery.current===U;m&&m(K),C&&this.setState({isFullscreen:K})}},{key:"slideToIndex",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props,ue=z.items,ce=z.slideDuration,he=z.onBeforeSlide;if(!K){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var X=ue.length-1,Q=g;g<0?Q=X:g>X&&(Q=0),he&&Q!==U&&he(Q),this.setState({previousIndex:U,currentIndex:Q,isTransitioning:Q!==U,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props.items,ue=U+(m==="left"?-1:1);K||(z.length===2?this.slideToIndexWithStyleReset(ue,g):this.slideToIndex(ue,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var C=this,U=this.state,K=U.currentIndex,z=U.currentSlideOffset;this.setState({currentSlideOffset:z+(K>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){So(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){So(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;ar.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,U=m.slideInterval,K=m.slideDuration,z=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(U,K)),C&&g&&C(z))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(C))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return l().createElement(P,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return l().createElement("span",{className:"image-gallery-thumbnail-inner"},l().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,C=g.isFullscreen,U=g.modalFullscreen,K=g.isPlaying,z=this.props,ue=z.additionalClass,ce=z.disableThumbnailSwipe,he=z.indexSeparator,X=z.isRTL,Q=z.items,J=z.thumbnailPosition,ie=z.renderFullscreenButton,fe=z.renderCustomControls,be=z.renderLeftNav,Le=z.renderRightNav,lt=z.showBullets,nt=z.showFullscreenButton,Ge=z.showIndex,Re=z.showThumbnails,xe=z.showNav,Wt=z.showPlayButton,Bn=z.renderPlayPauseButton,$n=this.getThumbnailStyle(),Lt=this.getSlideItems(),cn=Lt.slides,Tt=Lt.thumbnails,kn=Lt.bullets,Un=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":X}),On=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:Un},fe&&fe(),this.canSlide()?l().createElement(l().Fragment,null,xe&&l().createElement(l().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),Le(this.slideRight,!this.canSlideRight())),l().createElement(Mn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},cn))):l().createElement("div",{className:"image-gallery-slides"},cn),Wt&&Bn(this.togglePlay,K),lt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},kn)),nt&&ie(this.toggleFullScreen,C),Ge&&l().createElement("div",{className:"image-gallery-index"},l().createElement("span",{className:"image-gallery-index-current"},m+1),l().createElement("span",{className:"image-gallery-index-separator"},he),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),Wn=f("image-gallery",ue,{"fullscreen-modal":U}),ct=f("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:C}),kl=f("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(J),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&X},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ce},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ce});return l().createElement("div",{ref:this.imageGallery,className:Wn,"aria-live":"polite"},l().createElement("div",{className:ct},(J==="bottom"||J==="right")&&On,Re&&Tt.length>0?l().createElement(Mn,{className:kl,delta:0,onSwiping:!ce&&this.handleThumbnailSwiping,onSwiped:!ce&&this.handleOnThumbnailSwiped},l().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},l().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:$n,"aria-label":"Thumbnail Navigation"},Tt))):null,(J==="top"||J==="left")&&On))}}],E&&jn(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),me}(l().Component);Ar.propTypes={flickThreshold:R.number,items:(0,R.arrayOf)((0,R.shape)({bulletClass:R.string,bulletOnClick:R.func,description:R.string,original:R.string,originalHeight:R.number,originalWidth:R.number,loading:R.string,thumbnailHeight:R.number,thumbnailWidth:R.number,thumbnailLoading:R.string,fullscreen:R.string,originalAlt:R.string,originalTitle:R.string,thumbnail:R.string,thumbnailAlt:R.string,thumbnailLabel:R.string,thumbnailTitle:R.string,originalClass:R.string,thumbnailClass:R.string,renderItem:R.func,renderThumbInner:R.func,imageSet:Tl,srcSet:R.string,sizes:R.string})).isRequired,showNav:R.bool,autoPlay:R.bool,lazyLoad:R.bool,infinite:R.bool,showIndex:R.bool,showBullets:R.bool,showThumbnails:R.bool,showPlayButton:R.bool,showFullscreenButton:R.bool,disableThumbnailScroll:R.bool,disableKeyDown:R.bool,disableSwipe:R.bool,disableThumbnailSwipe:R.bool,useBrowserFullscreen:R.bool,onErrorImageURL:R.string,indexSeparator:R.string,thumbnailPosition:(0,R.oneOf)(["top","bottom","left","right"]),startIndex:R.number,slideDuration:R.number,slideInterval:R.number,slideOnThumbnailOver:R.bool,swipeThreshold:R.number,swipingTransitionDuration:R.number,swipingThumbnailTransitionDuration:R.number,onSlide:R.func,onBeforeSlide:R.func,onScreenChange:R.func,onPause:R.func,onPlay:R.func,onClick:R.func,onImageLoad:R.func,onImageError:R.func,onTouchMove:R.func,onTouchEnd:R.func,onTouchStart:R.func,onMouseOver:R.func,onMouseLeave:R.func,onBulletClick:R.func,onThumbnailError:R.func,onThumbnailClick:R.func,renderCustomControls:R.func,renderLeftNav:R.func,renderRightNav:R.func,renderPlayPauseButton:R.func,renderFullscreenButton:R.func,renderItem:R.func,renderThumbInner:R.func,stopPropagation:R.bool,additionalClass:R.string,useTranslate3D:R.bool,isRTL:R.bool,useWindowKeyDown:R.bool},Ar.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(b,p){return l().createElement(An,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(st,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Ut,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(Xe,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const jl=Ar})(),a})())})(al);var op=al.exports;const sp=Ti(op);function ap(){var e=new Map;function t(n){var r=n.root,i=n.rootMargin,s=n.threshold,a=e.get(r);a||(a=new Map,e.set(r,a));var c=JSON.stringify({rootMargin:i,threshold:s}),f=a.get(c);if(!f){var v=new Map,l=new IntersectionObserver(function(u){u.forEach(function(T){var y=v.get(T.target);y==null||y(T)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:v},a.set(c,f)}return{observe:function(T,y){var S,j;(S=f)==null||S.entryCallbacks.set(T,y),(j=f)==null||j.observer.observe(T)},unobserve:function(T){var y,S;(y=f)==null||y.entryCallbacks.delete(T),(S=f)==null||S.observer.unobserve(T)}}}return{getObserver:t}}var lp="0px",cp=[0],up=ap();function dp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:lp,i=(n=e==null?void 0:e.threshold)!=null?n:cp,s=M.useRef(null),a=M.useRef(null),c=M.useRef(null),f=M.useState(),v=f[0],l=f[1],u=M.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var L=up.getObserver({root:a.current,rootMargin:r,threshold:i});L.observe(j,function(D){l(D)}),c.current=L},[r,i]),T=M.useCallback(function(){var j=c.current,L=s.current;L&&(j==null||j.unobserve(L)),c.current=null},[]),y=M.useCallback(function(j){T(),s.current=j,u()},[u,T]),S=M.useCallback(function(j){T(),a.current=j,u()},[u,T]);return[y,{entry:v,rootRef:S}]}function vi(){return vi=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},vi.apply(this,arguments)}function hp(e){var t,n=dp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=M.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,vi({},i,{isVisible:s,wasEverVisible:c})]}var fp=100;function pp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?fp:a,f=hp({rootMargin:i}),v=f[0],l=f[1],u=l.rootRef,T=l.isVisible,y=!s&&!t&&T&&n;return M.useEffect(function(){if(y){var S=setTimeout(function(){r()},c);return function(){clearTimeout(S)}}},[r,y,c]),[v,{rootRef:u}]}const mp={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"/>'},gp={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 Gr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Vr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function ll(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 cl(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 vp(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}var mo={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,"-":Gr?173:189,"=":Gr?61:187,";":Gr?59:186,"'":222,"[":219,"]":221,"\\":220},Kt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},yi={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ve={16:!1,18:!1,17:!1,91:!1},De={};for(var dr=1;dr<20;dr++)mo["f".concat(dr)]=111+dr;var Ie=[],ps=!1,ul="all",dl=[],Nr=function(t){return mo[t.toLowerCase()]||Kt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function hl(e){ul=e||"all"}function rr(){return ul||"all"}function yp(){return Ie.slice(0)}function bp(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 xp(e){return typeof e=="string"&&(e=Nr(e)),Ie.indexOf(e)!==-1}function wp(e,t){var n,r;e||(e=rr());for(var i in De)if(Object.prototype.hasOwnProperty.call(De,i))for(n=De[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;rr()===e&&hl(t||"all")}function Ep(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 Ve){Ve[t]=!1;for(var r in Kt)Kt[r]===t&&(ht[r]=!1)}}function Sp(e){if(typeof e>"u")Object.keys(De).forEach(function(a){return delete De[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Hr(a)});else if(typeof e=="object")e.key&&Hr(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 i=n[0],s=n[1];typeof i=="function"&&(s=i,i=""),Hr({key:e,scope:i,method:s,splitKey:"+"})}}var Hr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=cl(n);c.forEach(function(f){var v=f.split(a),l=v.length,u=v[l-1],T=u==="*"?"*":Nr(u);if(De[T]){r||(r=rr());var y=l>1?ll(Kt,v):[];De[T]=De[T].filter(function(S){var j=i?S.method===i:!0;return!(j&&S.scope===r&&vp(S.mods,y))})}})};function ms(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var s in Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(!Ve[s]&&t.mods.indexOf(+s)>-1||Ve[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!Ve[16]&&!Ve[18]&&!Ve[17]&&!Ve[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function gs(e,t){var n=De["*"],r=e.keyCode||e.which||e.charCode;if(ht.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 j=yi[S];e[S]&&Ie.indexOf(j)===-1?Ie.push(j):!e[S]&&Ie.indexOf(j)>-1?Ie.splice(Ie.indexOf(j),1):S==="metaKey"&&e[S]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(j))))}),r in Ve){Ve[r]=!0;for(var i in Kt)Kt[i]===r&&(ht[i]=!0);if(!n)return}for(var s in Ve)Object.prototype.hasOwnProperty.call(Ve,s)&&(Ve[s]=e[yi[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),Ve[17]=!0,Ve[18]=!0);var a=rr();if(n)for(var c=0;c<n.length;c++)n[c].scope===a&&(e.type==="keydown"&&n[c].keydown||e.type==="keyup"&&n[c].keyup)&&ms(e,n[c],a,t);if(r in De){for(var f=0;f<De[r].length;f++)if((e.type==="keydown"&&De[r][f].keydown||e.type==="keyup"&&De[r][f].keyup)&&De[r][f].key){for(var v=De[r][f],l=v.splitKey,u=v.key.split(l),T=[],y=0;y<u.length;y++)T.push(Nr(u[y]));T.sort().join("")===Ie.sort().join("")&&ms(e,v,a,t)}}}}function Tp(e){return dl.indexOf(e)>-1}function ht(e,t,n){Ie=[];var r=cl(e),i=[],s="all",a=document,c=0,f=!1,v=!0,l="+",u=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(v=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(l=t.splitKey)),typeof t=="string"&&(s=t);c<r.length;c++)e=r[c].split(l),i=[],e.length>1&&(i=ll(Kt,e)),e=e[e.length-1],e=e==="*"?"*":Nr(e),e in De||(De[e]=[]),De[e].push({keyup:f,keydown:v,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Tp(a)&&window&&(dl.push(a),Vr(a,"keydown",function(T){gs(T,a)},u),ps||(ps=!0,Vr(window,"focus",function(){Ie=[]},u)),Vr(a,"keyup",function(T){gs(T,a),Ep(T)},u))}function jp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(De).forEach(function(n){var r=De[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Xr={setScope:hl,getScope:rr,deleteScope:wp,getPressedKeyCodes:yp,isPressed:xp,filter:bp,trigger:jp,unbind:Sp,keyMap:mo,modifier:Kt,modifierMap:yi};for(var Yr in Xr)Object.prototype.hasOwnProperty.call(Xr,Yr)&&(ht[Yr]=Xr[Yr]);if(typeof window<"u"){var kp=window.hotkeys;ht.noConflict=function(e){return e&&window.hotkeys===ht&&(window.hotkeys=kp),ht},window.hotkeys=ht}ht.filter=function(){return!0};var fl=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},Op=function(t){return fl(t,["INPUT","TEXTAREA","SELECT"])};function Ip(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,c=i.keyup,f=i.keydown,v=i.filterPreventDefault,l=v===void 0?!0:v,u=i.enabled,T=u===void 0?!0:u,y=i.enableOnContentEditable,S=y===void 0?!1:y,j=M.useRef(null),L=M.useCallback(function(D,A){var B,G;return a&&!a(D)?!l:Op(D)&&!fl(D,s)||(B=D.target)!=null&&B.isContentEditable&&!S?!0:j.current===null||document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement)?(t(D,A),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return M.useEffect(function(){if(!T){ht.unbind(e,L);return}return c&&f!==!0&&(n.keydown=!1),ht(e,n||{},L),function(){return ht.unbind(e,L)}},[L,e,T]),j}ht.isPressed;const pl=M.createContext({open:!1,toggleOpen:e=>{}});function Cp({children:e}){const[t,n]=M.useState(!1),r=s=>{n(s??!s)},i=M.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(pl.Provider,{value:i,children:e})}function go(){return M.useContext(pl)}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},Rp=e=>or(async()=>{const{data:t}=await e.get(mt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Pp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...xc(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:i=c=>{t.onFilterChange({...n,keyword:c.title})},emptyCategory:s}=t;!n.category&&!s&&(n.category="All");const a=c=>{const f={...n,...c};r(Dr(f,v=>v===""||v===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Dr(n,(v,l)=>c.includes(l)):{};r(Dr(f,v=>v===""||v===void 0))},handleActiveMenu:c=>{c!==e.menu&&r({menu:c})},handleSort:(c,f)=>{a({sortBy:c,sortDirection:f||c==="nameAsc"?"asc":"desc"})},handleKeyword:c=>{a({category:void 0,keyword:c||void 0})},handlePrice:c=>{a({price:c===e.price?void 0:c})},handleCategory:c=>{a({category:c===e.category?"":c})},handleDeveloper:c=>{a({owner:c||void 0})},handlePage:c=>{a({currentPage:c})},handleSwitchShowResources:c=>{a({showResources:c})},handleSearchSelect:c=>{i(c)}}}const _p=(e,t,n)=>e&&t||!n,ml=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],gl=(e,t,n)=>{var r,i;const s=wc(e),a=Ec(s.search);if((r=Sc(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Tc({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:v}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Ci(e,{...f||v?{imageFilter:"resize",w:f,h:v}:{},v:c})},Lp=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Np=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Ap=e=>{var t,n;return Array.isArray(e)?e.map(r=>r.message).join(`
486
+ `):(n=(t=e.response)==null?void 0:t.data)!=null&&n.error?e.response.data.error.message||e.response.data.error:e.message||e},Dp=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Mp=()=>window.innerWidth<=600,Fp={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",searchPlaceholder:"Search blocklet"},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}"'}},Bp={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试",searchPlaceholder:"搜索 Blocklet"},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}” 的所有搜索结果"}},Qr={en:Io(Fp),zh:Io(Bp)},vl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},$p=e=>(t,n)=>{const r=Qr[e]?Qr[e][t]:Qr.en[t];return Dp(r,n)||t},yl={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!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:()=>{}}},bl=M.createContext(yl),{Provider:Up,Consumer:fg}=bl;function Wp(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=ye=>ye,extraFilter:v=ye=>ye,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:T=!1,showCategory:y=!0,tagFilters:S=[],children:j,storeVersion:L,onSearchSelect:D=()=>{},endpoint:A,blockletRender:B,compact:G=!1}=e,I=vl(r,L),F=M.useMemo(()=>$s({baseURL:A,headers:I}),[A]),V=Pp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:D}),[$,le]=M.useState(""),{data:H=[],error:se,loading:je,run:We}=Rp(F),Me=M.useMemo(()=>{const ye=bc(H,[Ae=>Ae.name],["asc"]),oe=ye.findIndex(Ae=>Ae.name==="All"||Ae.locales.en==="All");return oe>-1?[{...ye[oe],_id:"All"},...ye.slice(0,oe),...ye.slice(oe+1)]:ye},[H]),Qe=M.useCallback($p(t),[t]),Z=M.useMemo(()=>Np(Me,t),[Me,t]),pe=Lp(Qe),ee={search:V,compact:G,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:je},extraFilter:v,endpoint:A,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Qe,storeVersion:L,serverVersion:r,selectedCategory:V.filters.category||(c.showExplore?"":"All"),categoryList:Me,blockletRender:B,locale:t,categoryOptions:Z,priceOptions:pe,storeApi:F,baseSearch:l,showResourcesSwitch:T,showCategory:y,tagFilters:S,onFilterChange:i,getCategoryLocale:ye=>{if(!ye)return null;const oe=H.find(Ae=>Ae._id===ye||Ae.locales.en==="All");return oe?oe.locales[t]||oe.locales.en:null},get developerName(){return $},updateDeveloperName:le};return M.useEffect(()=>{setTimeout(We,u||0)},[A,We,u]),o.jsx(Up,{value:ee,children:j})}function it(){return M.useContext(bl)||yl}function xl({children:e,onClick:t,size:n=32,...r}){return o.jsx(ir,{...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 hr(e,t){return e===void 0?t:e}function vo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=yn(),c=qt(a.breakpoints.down("sm")),f=qt(a.breakpoints.between("sm","md")),v=qt(a.breakpoints.between("md","lg")),l=qt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:v?n||null:l?r||null:i||null;let u=e;return c||(u=hr(t,u),f)||(u=hr(n,u),v)||(u=hr(r,u),l)?u:hr(i,u)}function zp({children:e}){const{open:t,toggleOpen:n}=go();return o.jsx(vo,{xs:o.jsx($l,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const qp=M.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(ir,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(xt,{size:"1em"})}));function bi({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=M.useRef(null),c=yn(),[f,v]=M.useState(!1),[l,u]=M.useState(e!==null?e:""),T=qt(c.breakpoints.down("sm"));M.useEffect(()=>{u(e!==null?e:"")},[e]);const y=M.useCallback(()=>{v(!1)},[]),S=M.useCallback(()=>{v(!0)},[]);function j(D){u(D.value),n(D.value),T&&y()}function L(D){return D===l}return o.jsxs(o.Fragment,{children:[o.jsxs(Kp,{ref:a,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Vn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(D=>D.value===l))==null?void 0:s.name)||r,o.jsx(Ul,{className:"my-select__arrowdown",component:hc,sx:{width:18,height:18}})]}),o.jsx(Wl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:D,placement:A})=>o.jsx(zl,{...D,style:{transformOrigin:A==="bottom"?"center top":"center bottom"},children:o.jsx(ql,{children:o.jsx(Kl,{onClickAway:y,children:o.jsx(Gp,{autoFocusItem:f,onMouseEnter:S,onMouseLeave:y,children:t.map(B=>o.jsxs(Si,{onClick:()=>j(B),sx:{fontSize:14},children:[o.jsx(Ws,{sx:{mr:1,fontSize:16,visibility:L(B.value)?"visible":"hidden"}}),B.name]},B.value))})})})})})]})}const Kp=Gt(qp)`
487
487
  border: 1px solid #f0f0f0;
488
488
  padding: 6px 8px 6px 12px;
489
489
  font-weight: ${e=>e.theme.typography.fontWeightRegular};
@@ -527,7 +527,7 @@ see detail in https://www.npmjs.com/package/is-var-name
527
527
  color: ${e=>e.theme.palette.primary.main};
528
528
  }
529
529
  }
530
- `;function wl(){const{search:e,t}=it(),{filters:n,handleSort:r,handlePrice:i}=e,s=ml(t);return o.jsxs(rt,{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:[o.jsx(wi,{control:o.jsx(Ei,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(bi,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function Hp({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v,handleActiveMenu:l,handleCategory:u,cleanFilter:T}=n,{toggleOpen:y}=go();M.useEffect(()=>{y(!1)},[Object.values(v).join("")]);const S=_p(c,a.showSearch,v.keyword);return a.showCategory&&!f?o.jsxs(zp,{children:[o.jsx(vo,{xs:o.jsxs(rt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(xl,{onClick:()=>y(!1),children:o.jsx(Ii,{})}),o.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(rt,{visibility:s.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?o.jsxs(o.Fragment,{children:[a.showExplore&&o.jsxs(Y,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[o.jsxs(Y,{display:"flex",alignItems:"center",gap:1,children:[o.jsx(nr,{icon:tf,width:20,height:20}),o.jsx(ge,{variant:"body1",color:!t&&!v.menu?"text.primary":"text.hint",fontWeight:!t&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{y(!1),T()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx(nr,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ge,{variant:"body1",color:v.menu===j.key?"text.primary":"text.hint",fontWeight:v.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var L;y(!1),l(j.key),(L=j.onClick)==null||L.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(rt,{gap:2,children:i.map(j=>o.jsx(ge,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"text.hint",textTransform:"capitalize",onClick:()=>{t===j.value?T():u(j.value),y(!1)},children:j.name},j.value))})]}):o.jsx(wl,{})})]}):null}function yo(){const{endpoint:e,serverVersion:t,storeVersion:n}=it(),r=vl(t,n),i=M.useMemo(()=>$s({baseURL:e,headers:r}),[e]);return{get:async s=>{const{data:a}=await i.get(s);return a},post:async(s,a)=>{const{data:c}=await i.post(s,a);return c}}}const El=M.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(xt,{})})});function vs({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Vp=16/9,Jr=292,xi=189,Er=336;function Xp(){var e,t;const{t:n,search:r}=it(),{get:i}=yo(),s=yn(),a=qt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:v,loading:l}=or(async()=>{const D=await i(Ci(mt.blockletsPath,{didList:c.map(A=>A.did).join(",")}));return D!=null&&D.dataList?c.map(A=>D.dataList.find(B=>B.did===A.did)):[]});v&&console.error("Get Banner Blocklets error:",v);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!v&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:Jr},minHeight:Jr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:l?o.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[o.jsx(zt,{variant:"rounded",height:xi,width:Er}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(zt,{variant:"text",height:50,width:100}),o.jsx(zt,{variant:"text",height:40,width:"100%"}),o.jsx(zt,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(zt,{variant:"circular",height:20,width:20}),o.jsx(zt,{variant:"text",height:20,width:50})]}),o.jsx(zt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(sp,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(hu,{sx:{...u,left:5}})}),renderRightNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(fu,{sx:{...u,right:5}})}),items:c.map((D,A)=>({original:D.did,renderItem:()=>{var B;const G=f[A]||{},I=D.cover||Qp(D.did,(B=G.screenshots)==null?void 0:B[0]),F=gl(I,s.breakpoints.values.md*2);return o.jsxs(rt,{height:{xs:"auto",md:Jr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${F}")`,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(G),gap:{xs:2,md:5},children:[T(F),o.jsxs(rt,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[y(D.name||G.title||D.name),S(D.desc||G.description)]}),G.did&&j(G,D.baseNum),L(G)]})]})}}))})})]}):null;function T(D){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Er},children:o.jsx(Jp,{url:D})})}function y(D){return o.jsx(ge,{variant:"h2",width:"100%",children:D})}function S(D){return o.jsx(ge,{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:D})}function j(D,A=0){const{did:B,owner:G,stats:I}=D;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(vs,{icon:o.jsx(br,{src:G.avatar,did:B,size:20,variant:"circle"}),children:G.fullName}),o.jsx(vs,{icon:o.jsx(nr,{icon:za}),title:`${I.downloads+A}`,children:Yp(I.downloads+A)})]})}function L(D){return o.jsx(ir,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(D),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Yp=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`,Qp=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Jp({url:e}){const[t,n]=M.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(zt,{variant:"rectangular",sx:{width:{xs:"100%",md:Er},height:{xs:"auto",md:xi}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Er},height:{xs:"auto",md:xi},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Vp},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Zp({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=it();return o.jsxs(Y,{mt:3,children:[o.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(To,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(To,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":i.did,children:o.jsx(Y,{padding:"1px",children:n({blocklet:i,blocklets:t,serverVersion:r})})},i.did))})]})}function em(){const{get:e}=yo(),{t}=it(),{data:n=[],error:r,loading:i}=or(async()=>{const s=await e(mt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(jr,{error:new Error(`Failed to fetch blocklets from ${mt.explorePath}`)}):i?o.jsx(El,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(Xp,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(Zp,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const Zr="__FREE_TEXT__",ys="__NO_RESULT__",ei=40;function tm({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=M.useRef(null),f=M.useRef(!1),[v,l]=M.useState(!1),[u,T]=M.useState(""),[y,S]=M.useState(!1),j=yo(),[L,D]=M.useState(!1),A=(a==null?void 0:a.placeholder)||t("common.searchStore"),B=async Z=>{D(!0);const pe=await j.get(Jn(e,Ci(mt.blockletsPath,Z)));return D(!1),pe.dataList||[]},{data:G,run:I}=or(Z=>Z?B({sortBy:mt.nameDesc,page:1,pageSize:10,keyword:Z,showResources:"true"}):Promise.resolve([]),{manual:!0});M.useEffect(()=>{D(!0),I(r.keyword),T(r.keyword||"")},[r.keyword,I]),Ip("ctrl + k, command + k",Z=>{var pe,ee;return Z.stopPropagation(),Z.preventDefault(),(ee=(pe=c.current)==null?void 0:pe.querySelector("input"))==null||ee.focus(),!1},{enableOnTags:["INPUT"]});const F=Hs(Z=>I(Z),{wait:300}),H={name:Zr,title:u,did:""};let $=[];return u&&(L?$=[H]:G!=null&&G.length?$=[H,...G]:$=[{name:ys,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(Gl,{fullScreen:!0,open:y,sx:{display:{md:"none"}},children:[o.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[o.jsx(Ns,{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:A,className:"bl-autocomplete-input",value:u,onChange:Z=>le(Z.target.value),startAdornment:Me(y),endAdornment:Qe()}),o.jsx(ir,{variant:"outlined",onClick:()=>{S(!1),T(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ls,{sx:{p:.5},children:$.map(Z=>je(Z))})]}),o.jsx(mr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.hint"},onClick:()=>S(!0)}),o.jsx(Os,{ref:c,open:!!u&&v,size:"small",onOpen:()=>l(!0),onClose:(Z,pe)=>{l(!1),pe==="selectOption"&&!f.current&&i(u)},onKeyDown:Z=>{Z.key==="Enter"&&!u&&V()},disableClearable:!0,inputValue:u,onInputChange:(Z,pe)=>le(pe),isOptionEqualToValue:(Z,pe)=>Z.name===pe.name,getOptionLabel:Z=>Z.title,getOptionKey:Z=>Z.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:Z=>o.jsx(Sr,{...Z,InputProps:{...Z.InputProps,autoFocus:!0,placeholder:A,className:"bl-autocomplete-input",value:u,startAdornment:Me(v),endAdornment:Qe()}}),filterOptions:Z=>Z,...a,options:$,renderOption:(Z,pe)=>je(pe),value:H,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(a.sx)?a.sx:[a.sx]]})]});function le(Z){D(!0),T(Z),f.current=!1,F.run(Z)}function V(){S(!1),T(""),le(""),i("")}function se(Z){Z!=null&&Z.did?(S(!1),f.current=!0,T(""),s(Z)):Z.name===Zr&&(S(!1),i(u))}function je(Z){var pe,ee;return o.jsxs(Si,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(Z),children:[We(Z),o.jsxs(ge,{variant:"body1",children:[o.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Z.title}),o.jsx(ge,{sx:{color:"text.hint"},fontSize:"13px",children:((ee=(pe=Z.category)==null?void 0:pe.locales)==null?void 0:ee[n||"en"])||""})]})]},Z.did)}function We(Z){if([Zr,ys].includes(Z.name))return o.jsx(Y,{width:ei,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"#F1F3F5",borderRadius:"8px",children:o.jsx(mr,{sx:{fontSize:28}})});let pe="";return Z.logo&&(pe=Jn(e,"assets",Z.did,gl(Z.logo,ei,Z.version))),o.jsx(br,{src:pe,size:ei,style:{borderRadius:"8px",overflow:"hidden"}})}function Me(Z=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:Z&&u&&L?o.jsx(xt,{color:"inherit",size:16}):o.jsx(mr,{sx:{fontSize:16,cursor:"default"}})})}function Qe(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:o.jsx(Ii,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>V()})}):null}}function nm({placeholder:e,...t}){const{search:n,t:r}=it(),{filters:i,handleKeyword:s}=n,[a,c]=M.useState(i.keyword||""),f=Hs(s,{wait:300}),v=T=>{const{value:y}=T.target;c(y),f.run(y)},l=()=>{c(""),s("")};M.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(rm,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(ko,{position:"start",children:o.jsx(im,{sx:{fontSize:18,ml:-.5}})}),onChange:v,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(ko,{position:"end",children:o.jsx(om,{"data-cy":"search-delete",onClick:l})}),...t})}const rm=Gt(Ns)`
530
+ `;function wl(){const{search:e,t}=it(),{filters:n,handleSort:r,handlePrice:i}=e,s=ml(t);return o.jsxs(rt,{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:[o.jsx(wi,{control:o.jsx(Ei,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(bi,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function Vp({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v,handleActiveMenu:l,handleCategory:u,cleanFilter:T}=n,{toggleOpen:y}=go();M.useEffect(()=>{y(!1)},[Object.values(v).join("")]);const S=_p(c,a.showSearch,v.keyword);return a.showCategory&&!f?o.jsxs(zp,{children:[o.jsx(vo,{xs:o.jsxs(rt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(xl,{onClick:()=>y(!1),children:o.jsx(Ii,{})}),o.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(rt,{visibility:s.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?o.jsxs(o.Fragment,{children:[a.showExplore&&o.jsxs(Y,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[o.jsxs(Y,{display:"flex",alignItems:"center",gap:1,children:[o.jsx(nr,{icon:tf,width:20,height:20}),o.jsx(ge,{variant:"body1",color:!t&&!v.menu?"text.primary":"text.hint",fontWeight:!t&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{y(!1),T()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx(nr,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ge,{variant:"body1",color:v.menu===j.key?"text.primary":"text.hint",fontWeight:v.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var L;y(!1),l(j.key),(L=j.onClick)==null||L.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(rt,{gap:2,children:i.map(j=>o.jsx(ge,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"text.hint",textTransform:"capitalize",onClick:()=>{t===j.value?T():u(j.value),y(!1)},children:j.name},j.value))})]}):o.jsx(wl,{})})]}):null}function yo(){const{endpoint:e,serverVersion:t,storeVersion:n}=it(),r=vl(t,n),i=M.useMemo(()=>$s({baseURL:e,headers:r}),[e]);return{get:async s=>{const{data:a}=await i.get(s);return a},post:async(s,a)=>{const{data:c}=await i.post(s,a);return c}}}const El=M.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(xt,{})})});function vs({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Hp=16/9,Jr=292,xi=189,Er=336;function Xp(){var e,t;const{t:n,search:r}=it(),{get:i}=yo(),s=yn(),a=qt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:v,loading:l}=or(async()=>{const D=await i(Ci(mt.blockletsPath,{didList:c.map(A=>A.did).join(",")}));return D!=null&&D.dataList?c.map(A=>D.dataList.find(B=>B.did===A.did)):[]});v&&console.error("Get Banner Blocklets error:",v);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!v&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:Jr},minHeight:Jr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:l?o.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[o.jsx(zt,{variant:"rounded",height:xi,width:Er}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(zt,{variant:"text",height:50,width:100}),o.jsx(zt,{variant:"text",height:40,width:"100%"}),o.jsx(zt,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(zt,{variant:"circular",height:20,width:20}),o.jsx(zt,{variant:"text",height:20,width:50})]}),o.jsx(zt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(sp,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(hu,{sx:{...u,left:5}})}),renderRightNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(fu,{sx:{...u,right:5}})}),items:c.map((D,A)=>({original:D.did,renderItem:()=>{var B;const G=f[A]||{},I=D.cover||Qp(D.did,(B=G.screenshots)==null?void 0:B[0]),F=gl(I,s.breakpoints.values.md*2);return o.jsxs(rt,{height:{xs:"auto",md:Jr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${F}")`,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(G),gap:{xs:2,md:5},children:[T(F),o.jsxs(rt,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[y(D.name||G.title||D.name),S(D.desc||G.description)]}),G.did&&j(G,D.baseNum),L(G)]})]})}}))})})]}):null;function T(D){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Er},children:o.jsx(Jp,{url:D})})}function y(D){return o.jsx(ge,{variant:"h2",width:"100%",children:D})}function S(D){return o.jsx(ge,{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:D})}function j(D,A=0){const{did:B,owner:G,stats:I}=D;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(vs,{icon:o.jsx(br,{src:G.avatar,did:B,size:20,variant:"circle"}),children:G.fullName}),o.jsx(vs,{icon:o.jsx(nr,{icon:za}),title:`${I.downloads+A}`,children:Yp(I.downloads+A)})]})}function L(D){return o.jsx(ir,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(D),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Yp=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`,Qp=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Jp({url:e}){const[t,n]=M.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(zt,{variant:"rectangular",sx:{width:{xs:"100%",md:Er},height:{xs:"auto",md:xi}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Er},height:{xs:"auto",md:xi},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Hp},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Zp({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=it();return o.jsxs(Y,{mt:3,children:[o.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(To,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(To,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":i.did,children:o.jsx(Y,{padding:"1px",children:n({blocklet:i,blocklets:t,serverVersion:r})})},i.did))})]})}function em(){const{get:e}=yo(),{t}=it(),{data:n=[],error:r,loading:i}=or(async()=>{const s=await e(mt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(jr,{error:new Error(`Failed to fetch blocklets from ${mt.explorePath}`)}):i?o.jsx(El,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(Xp,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(Zp,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const Zr="__FREE_TEXT__",ys="__NO_RESULT__",ei=40;function tm({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=M.useRef(null),f=M.useRef(!1),[v,l]=M.useState(!1),[u,T]=M.useState(""),[y,S]=M.useState(!1),j=yo(),[L,D]=M.useState(!1),A=(a==null?void 0:a.placeholder)||t("common.searchStore"),B=async Z=>{D(!0);const pe=await j.get(Jn(e,Ci(mt.blockletsPath,Z)));return D(!1),pe.dataList||[]},{data:G,run:I}=or(Z=>Z?B({sortBy:mt.nameDesc,page:1,pageSize:10,keyword:Z,showResources:"true"}):Promise.resolve([]),{manual:!0});M.useEffect(()=>{D(!0),I(r.keyword),T(r.keyword||"")},[r.keyword,I]),Ip("ctrl + k, command + k",Z=>{var pe,ee;return Z.stopPropagation(),Z.preventDefault(),(ee=(pe=c.current)==null?void 0:pe.querySelector("input"))==null||ee.focus(),!1},{enableOnTags:["INPUT"]});const F=Vs(Z=>I(Z),{wait:300}),V={name:Zr,title:u,did:""};let $=[];return u&&(L?$=[V]:G!=null&&G.length?$=[V,...G]:$=[{name:ys,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(Gl,{fullScreen:!0,open:y,sx:{display:{md:"none"}},children:[o.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[o.jsx(Ns,{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:A,className:"bl-autocomplete-input",value:u,onChange:Z=>le(Z.target.value),startAdornment:Me(y),endAdornment:Qe()}),o.jsx(ir,{variant:"outlined",onClick:()=>{S(!1),T(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ls,{sx:{p:.5},children:$.map(Z=>je(Z))})]}),o.jsx(mr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.hint"},onClick:()=>S(!0)}),o.jsx(Os,{ref:c,open:!!u&&v,size:"small",onOpen:()=>l(!0),onClose:(Z,pe)=>{l(!1),pe==="selectOption"&&!f.current&&i(u)},onKeyDown:Z=>{Z.key==="Enter"&&!u&&H()},disableClearable:!0,inputValue:u,onInputChange:(Z,pe)=>le(pe),isOptionEqualToValue:(Z,pe)=>Z.name===pe.name,getOptionLabel:Z=>Z.title,getOptionKey:Z=>Z.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:Z=>o.jsx(Sr,{...Z,InputProps:{...Z.InputProps,autoFocus:!0,placeholder:A,className:"bl-autocomplete-input",value:u,startAdornment:Me(v),endAdornment:Qe()}}),filterOptions:Z=>Z,...a,options:$,renderOption:(Z,pe)=>je(pe),value:V,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(a.sx)?a.sx:[a.sx]]})]});function le(Z){D(!0),T(Z),f.current=!1,F.run(Z)}function H(){S(!1),T(""),le(""),i("")}function se(Z){Z!=null&&Z.did?(S(!1),f.current=!0,T(""),s(Z)):Z.name===Zr&&(S(!1),i(u))}function je(Z){var pe,ee;return o.jsxs(Si,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(Z),children:[We(Z),o.jsxs(ge,{variant:"body1",children:[o.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Z.title}),o.jsx(ge,{sx:{color:"text.hint"},fontSize:"13px",children:((ee=(pe=Z.category)==null?void 0:pe.locales)==null?void 0:ee[n||"en"])||""})]})]},Z.did)}function We(Z){if([Zr,ys].includes(Z.name))return o.jsx(Y,{width:ei,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"#F1F3F5",borderRadius:"8px",children:o.jsx(mr,{sx:{fontSize:28}})});let pe="";return Z.logo&&(pe=Jn(e,"assets",Z.did,gl(Z.logo,ei,Z.version))),o.jsx(br,{src:pe,size:ei,style:{borderRadius:"8px",overflow:"hidden"}})}function Me(Z=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:Z&&u&&L?o.jsx(xt,{color:"inherit",size:16}):o.jsx(mr,{sx:{fontSize:16,cursor:"default"}})})}function Qe(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:o.jsx(Ii,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>H()})}):null}}function nm({placeholder:e,...t}){const{search:n,t:r}=it(),{filters:i,handleKeyword:s}=n,[a,c]=M.useState(i.keyword||""),f=Vs(s,{wait:300}),v=T=>{const{value:y}=T.target;c(y),f.run(y)},l=()=>{c(""),s("")};M.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(rm,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(ko,{position:"start",children:o.jsx(im,{sx:{fontSize:18,ml:-.5}})}),onChange:v,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(ko,{position:"end",children:o.jsx(om,{"data-cy":"search-delete",onClick:l})}),...t})}const rm=Gt(Ns)`
531
531
  background-color: ${e=>e.theme.palette.grey[50]};
532
532
  font-size: 14px;
533
533
  border-radius: 6px;
@@ -550,13 +550,13 @@ see detail in https://www.npmjs.com/package/is-var-name
550
550
  color: ${e=>e.theme.palette.grey[500]};
551
551
  font-size: 16px;
552
552
  cursor: pointer;
553
- `;function sm(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:v,categoryOptions:l,compact:u}=it(),{filters:T,handleSort:y,handlePrice:S,handleDeveloper:j,handleSwitchShowResources:L,cleanFilter:D,handleCategory:A}=t,B=ml(n);return o.jsxs(rt,{position:"sticky",top:0,zIndex:1e3,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:u?2:3,sx:{backgroundColor:"background.default"},children:[!u&&o.jsx(ge,{variant:"h2",textTransform:"capitalize",children:s(T.category)}),o.jsxs(rt,{flex:1,direction:"row",alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2,children:[f.showSearch?o.jsx(Y,{flex:1,flexBasis:{xs:"100%",md:"auto"},children:v?o.jsx(nm,{}):o.jsx(tm,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:t.filters,handleKeyword:t.handleKeyword,handleSearchSelect:t.handleSearchSelect})}):null,T.owner&&a&&o.jsx(jo,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),T.resourceDid&&T.resourceBlocklet&&o.jsx(jo,{label:n("blocklet.resourceTag",{name:T.resourceBlocklet}),size:"small",onDelete:()=>D(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(bs,{checked:T.showResources!=="false",onChange:G=>L(G?"true":"false"),label:n("common.showResources")}):null,o.jsx(bs,{checked:T.price==="free",onChange:G=>S(G?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(bi,{value:T.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:G=>A(G)})}),o.jsx(bi,{value:T.sortBy||B[0].value,options:B,placeholder:n("sort.sort"),onChange:G=>y(G)})]})]})}function bs({checked:e,onChange:t,label:n}){const r=yn();return o.jsx(wi,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Ei,{checked:e,icon:o.jsx(nr,{style:{padding:0},icon:mp}),checkedIcon:o.jsx(nr,{style:{padding:0,color:r.palette.primary.main},icon:gp}),size:"large",sx:{p:0,mr:1},onChange:i=>t(i.target.checked)}),label:n})}function fr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint",children:[o.jsx(oc,{}),e]})}function xs(){const{t:e}=it();return o.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function ti({filterTip:e,keywordTip:t}){const{t:n,locale:r}=it(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ge,{children:n("blocklet.keywordTip")})]})}function ni({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ge,{children:e}),o.jsx(ge,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ge,{children:[t," "]})]})}function am(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=it(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(fr,{children:[a?o.jsx(ni,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(xs,{}),o.jsx(ti,{filterTip:!0})]})}return o.jsx(fr,{children:o.jsx(xs,{})})}const lm=(e,t,n,r)=>Qc(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:mt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(mt.blockletsPath,{params:c});return n.currentPage++,{page:s,pageSize:a,list:(f==null?void 0:f.dataList)||[],total:(f==null?void 0:f.total)||0}},{isNoMore:i=>i?i.page*i.pageSize>=i.total:!1,reloadDeps:[e,sc(t)],onError:r});function cm(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=it(),{filters:a}=n,c=Yc({currentPage:mt.currentPage,pageSize:Mp()?mt.mobilePageSize:mt.pageSize,defaultCurrentPage:mt.defaultCurrentPage}),[f,v]=M.useState(null),l=lm(t,a,c,v),u=M.useMemo(()=>{var T,y;return r?r(((T=l.data)==null?void 0:T.list)||[]):((y=l.data)==null?void 0:y.list)||[]},[l.data,r]);return M.useEffect(()=>{const T=u.find(y=>y.owner.did===a.owner);s((T==null?void 0:T.owner.fullName)||(T==null?void 0:T.author.name)||"")},[a.owner,u,s]),{blocklets:u,fetchBlockletsError:f,loadMore:l.loadMore,hasNextPage:!l.noMore,total:((e=l.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:l.loading,loadingMore:l.loadingMore},errors:{...i,fetchBlockletsError:f}}}function um(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v}=t,{blocklets:l,errors:u,loadMore:T,loadings:y,hasNextPage:S,total:j}=cm(),[L]=pp({loading:y.fetchBlockletsLoading||y.loadingMore,hasNextPage:S,onLoadMore:T});if(u.fetchBlockletsError){const G=new Error(`Failed to fetch blocklets from ${n}: ${Ap(u.fetchBlockletsError)}`);return o.jsx(jr,{error:G})}const D=c&&a.showSearch||!v.keyword;return o.jsxs(o.Fragment,{children:[D?o.jsx(sm,{}):o.jsxs(o.Fragment,{children:[o.jsx(vo,{xs:o.jsx(wl,{}),md:null}),B()]}),A(),!y.fetchBlockletsLoading&&S&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:L,children:o.jsx(xt,{})})]});function A(){return y.fetchBlockletsLoading?o.jsx(El,{mt:15}):l.length?o.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${s}px, 1fr))`},p:"2px",rowGap:2,columnGap:f?0:2,children:l.map(G=>o.jsx(Y,{"data-blocklet-did":G.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:G,blocklets:l,serverVersion:i})},G.did))}):o.jsx(am,{})}function B(){return o.jsxs(rt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ge,{variant:"h3",title:v.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:v.keyword})}),o.jsx(ge,{variant:"body1",color:"text.hint",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function dm(){const{t:e,selectedCategory:t,getCategoryLocale:n}=it(),{toggleOpen:r}=go();return o.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(xl,{onClick:()=>r(!0),children:o.jsx(dc,{})}),n(t)||e("common.category")]})}function hm({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=it(),{filters:a}=r,c=M.useRef(null),f=a.category||a.keyword||a.price,v=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Cp,{children:o.jsxs(Us,{FallbackComponent:jr,children:[!s&&o.jsx(dm,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(Hp,{menus:e}),o.jsxs(rt,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[v&&(t==null?void 0:t(v)),!v&&(i.showExplore&&!f?o.jsx(em,{}):o.jsx(um,{}))]})]})]})})}function fm(e){const{menus:t,children:n,...r}=e,i=yn(),s=Bl(yc({},i,{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 o.jsx(_s,{theme:s,children:o.jsx(Wp,{...r,children:o.jsx(hm,{menus:t,children:n})})})}const pm={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},mm={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},gm={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>'},vm=gm,ym={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},bm=(e,t)=>!t||!e?!0:ii.satisfies(ii.coerce(e),t);function bo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=gt();return bm(t,n)?e:o.jsx(Ps,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ge,{children:o.jsx(ir,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}bo.propTypes={children:N.node.isRequired,serverVersion:N.string,requirementVersion:N.string};bo.defaultProps={serverVersion:"",requirementVersion:""};const xm=ac({...lc,disableBlockletTheme:!0}),wm=(e,t)=>Jn(t,`/blocklets/${e.did}`),ws=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Em=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1;function xo({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var L,D;const{t:s}=gt();let a=Jn(r,Nc(e.did,e.logo||""));try{const A=new URL(a);A.searchParams.set("v",e.version||+new Date),a=A.href}catch{}const[c,f]=M.useState(!1),v=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(A){Oi.error(A.message)}finally{f(!1)}},{blocklet:l}=kr(),u=()=>((l==null?void 0:l.children)||[]).find(G=>G.meta.bundleDid===e.did).meta.version,y=(()=>{const A=((l==null?void 0:l.children)||[]).find(B=>B.meta.bundleDid===e.did);if(A){try{const B=A.meta.version,G=e.version;if(ii.gt(G,B))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),S=(L=e.requirements)==null?void 0:L.server,j=[];return y==="upgrade"?j.push({key:"upgrade",icon:o.jsx(pt,{icon:ym,color:"success.light",width:20,height:20},"version"),title:`${u()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:o.jsx(Y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):y==="disable"?j.push({key:"disable",icon:o.jsx(pt,{icon:pm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Em(e)&&j.push({key:"purchase",icon:o.jsx(pt,{icon:mm,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(Sm,{title:ws({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:ws({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:y!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:y==="disable"?void 0:v,icons:(D=e.docker)!=null&&D.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(pt,{icon:vm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(bo,{serverVersion:i,requirementVersion:S,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(Jh,{children:o.jsx(dt,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:A=>{A.preventDefault(),A.stopPropagation();const B=wm(e,r);B&&window.open(B,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}xo.propTypes={blocklet:N.object.isRequired,blocklets:N.array,handleButtonClick:N.func,endpoint:N.string,serverVersion:N.string};xo.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function wo({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:v,compact:l,...u}){const{locale:T}=gt(),[y,S]=M.useState(!1),[j,L]=M.useState({}),D=B=>{L(B)},A=n;return M.useEffect(()=>{L({showResources:!0,resourceType:a,resourceDid:c})},[A,a,c]),M.useEffect(()=>{S(!0),L({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(_s,{theme:xm,children:o.jsx(Us,{FallbackComponent:jr,resetKeys:[A],children:o.jsxs(Y,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[y&&o.jsx(fm,{showCategory:v,showResourcesSwitch:f,blockletRender:B=>{const G={...B,handleButtonClick:e,endpoint:A};return r({...B,defaultRender:o.jsx(xo,{...G})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:A,locale:T,onFilterChange:D,onSearchSelect:t,filters:j,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}wo.propTypes={storeUrl:N.string.isRequired,handleButtonClick:N.func,handleSearchSelect:N.func,handleBlockletRender:N.func,extraFilter:N.func,serverVersion:N.string,resourceType:N.string,resourceDid:N.string,showResourcesSwitch:N.bool,showCategory:N.bool,compact:N.bool};wo.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Sm=Ve(ef)`
553
+ `;function sm(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:v,categoryOptions:l,compact:u}=it(),{filters:T,handleSort:y,handlePrice:S,handleDeveloper:j,handleSwitchShowResources:L,cleanFilter:D,handleCategory:A}=t,B=ml(n);return o.jsxs(rt,{position:"sticky",top:0,zIndex:1e3,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:u?2:3,sx:{backgroundColor:"background.default"},children:[!u&&o.jsx(ge,{variant:"h2",textTransform:"capitalize",children:s(T.category)}),o.jsxs(rt,{flex:1,direction:"row",alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2,children:[f.showSearch?o.jsx(Y,{flex:1,flexBasis:{xs:"100%",md:"auto"},children:v?o.jsx(nm,{}):o.jsx(tm,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:t.filters,handleKeyword:t.handleKeyword,handleSearchSelect:t.handleSearchSelect})}):null,T.owner&&a&&o.jsx(jo,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),T.resourceDid&&T.resourceBlocklet&&o.jsx(jo,{label:n("blocklet.resourceTag",{name:T.resourceBlocklet}),size:"small",onDelete:()=>D(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(bs,{checked:T.showResources!=="false",onChange:G=>L(G?"true":"false"),label:n("common.showResources")}):null,o.jsx(bs,{checked:T.price==="free",onChange:G=>S(G?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(bi,{value:T.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:G=>A(G)})}),o.jsx(bi,{value:T.sortBy||B[0].value,options:B,placeholder:n("sort.sort"),onChange:G=>y(G)})]})]})}function bs({checked:e,onChange:t,label:n}){const r=yn();return o.jsx(wi,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Ei,{checked:e,icon:o.jsx(nr,{style:{padding:0},icon:mp}),checkedIcon:o.jsx(nr,{style:{padding:0,color:r.palette.primary.main},icon:gp}),size:"large",sx:{p:0,mr:1},onChange:i=>t(i.target.checked)}),label:n})}function fr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint",children:[o.jsx(oc,{}),e]})}function xs(){const{t:e}=it();return o.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function ti({filterTip:e,keywordTip:t}){const{t:n,locale:r}=it(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ge,{children:n("blocklet.keywordTip")})]})}function ni({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ge,{children:e}),o.jsx(ge,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ge,{children:[t," "]})]})}function am(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=it(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(fr,{children:[o.jsx(ni,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ti,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(fr,{children:[a?o.jsx(ni,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(xs,{}),o.jsx(ti,{filterTip:!0})]})}return o.jsx(fr,{children:o.jsx(xs,{})})}const lm=(e,t,n,r)=>Qc(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:mt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(mt.blockletsPath,{params:c});return n.currentPage++,{page:s,pageSize:a,list:(f==null?void 0:f.dataList)||[],total:(f==null?void 0:f.total)||0}},{isNoMore:i=>i?i.page*i.pageSize>=i.total:!1,reloadDeps:[e,sc(t)],onError:r});function cm(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=it(),{filters:a}=n,c=Yc({currentPage:mt.currentPage,pageSize:Mp()?mt.mobilePageSize:mt.pageSize,defaultCurrentPage:mt.defaultCurrentPage}),[f,v]=M.useState(null),l=lm(t,a,c,v),u=M.useMemo(()=>{var T,y;return r?r(((T=l.data)==null?void 0:T.list)||[]):((y=l.data)==null?void 0:y.list)||[]},[l.data,r]);return M.useEffect(()=>{const T=u.find(y=>y.owner.did===a.owner);s((T==null?void 0:T.owner.fullName)||(T==null?void 0:T.author.name)||"")},[a.owner,u,s]),{blocklets:u,fetchBlockletsError:f,loadMore:l.loadMore,hasNextPage:!l.noMore,total:((e=l.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:l.loading,loadingMore:l.loadingMore},errors:{...i,fetchBlockletsError:f}}}function um(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v}=t,{blocklets:l,errors:u,loadMore:T,loadings:y,hasNextPage:S,total:j}=cm(),[L]=pp({loading:y.fetchBlockletsLoading||y.loadingMore,hasNextPage:S,onLoadMore:T});if(u.fetchBlockletsError){const G=new Error(`Failed to fetch blocklets from ${n}: ${Ap(u.fetchBlockletsError)}`);return o.jsx(jr,{error:G})}const D=c&&a.showSearch||!v.keyword;return o.jsxs(o.Fragment,{children:[D?o.jsx(sm,{}):o.jsxs(o.Fragment,{children:[o.jsx(vo,{xs:o.jsx(wl,{}),md:null}),B()]}),A(),!y.fetchBlockletsLoading&&S&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:L,children:o.jsx(xt,{})})]});function A(){return y.fetchBlockletsLoading?o.jsx(El,{mt:15}):l.length?o.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${s}px, 1fr))`},p:"2px",rowGap:2,columnGap:f?0:2,children:l.map(G=>o.jsx(Y,{"data-blocklet-did":G.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:G,blocklets:l,serverVersion:i})},G.did))}):o.jsx(am,{})}function B(){return o.jsxs(rt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ge,{variant:"h3",title:v.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:v.keyword})}),o.jsx(ge,{variant:"body1",color:"text.hint",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function dm(){const{t:e,selectedCategory:t,getCategoryLocale:n}=it(),{toggleOpen:r}=go();return o.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(xl,{onClick:()=>r(!0),children:o.jsx(dc,{})}),n(t)||e("common.category")]})}function hm({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=it(),{filters:a}=r,c=M.useRef(null),f=a.category||a.keyword||a.price,v=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Cp,{children:o.jsxs(Us,{FallbackComponent:jr,children:[!s&&o.jsx(dm,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(Vp,{menus:e}),o.jsxs(rt,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[v&&(t==null?void 0:t(v)),!v&&(i.showExplore&&!f?o.jsx(em,{}):o.jsx(um,{}))]})]})]})})}function fm(e){const{menus:t,children:n,...r}=e,i=yn(),s=Bl(yc({},i,{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 o.jsx(_s,{theme:s,children:o.jsx(Wp,{...r,children:o.jsx(hm,{menus:t,children:n})})})}const pm={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},mm={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},gm={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>'},vm=gm,ym={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},bm=(e,t)=>!t||!e?!0:ii.satisfies(ii.coerce(e),t);function bo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=gt();return bm(t,n)?e:o.jsx(Ps,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ge,{children:o.jsx(ir,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}bo.propTypes={children:N.node.isRequired,serverVersion:N.string,requirementVersion:N.string};bo.defaultProps={serverVersion:"",requirementVersion:""};const xm=ac({...lc,disableBlockletTheme:!0}),wm=(e,t)=>Jn(t,`/blocklets/${e.did}`),ws=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Em=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1;function xo({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var L,D;const{t:s}=gt();let a=Jn(r,Nc(e.did,e.logo||""));try{const A=new URL(a);A.searchParams.set("v",e.version||+new Date),a=A.href}catch{}const[c,f]=M.useState(!1),v=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(A){Oi.error(A.message)}finally{f(!1)}},{blocklet:l}=kr(),u=()=>((l==null?void 0:l.children)||[]).find(G=>G.meta.bundleDid===e.did).meta.version,y=(()=>{const A=((l==null?void 0:l.children)||[]).find(B=>B.meta.bundleDid===e.did);if(A){try{const B=A.meta.version,G=e.version;if(ii.gt(G,B))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),S=(L=e.requirements)==null?void 0:L.server,j=[];return y==="upgrade"?j.push({key:"upgrade",icon:o.jsx(pt,{icon:ym,color:"success.light",width:20,height:20},"version"),title:`${u()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:o.jsx(Y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):y==="disable"?j.push({key:"disable",icon:o.jsx(pt,{icon:pm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Em(e)&&j.push({key:"purchase",icon:o.jsx(pt,{icon:mm,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(Sm,{title:ws({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:ws({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:y!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:y==="disable"?void 0:v,icons:(D=e.docker)!=null&&D.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(pt,{icon:vm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(bo,{serverVersion:i,requirementVersion:S,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(Jh,{children:o.jsx(dt,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:A=>{A.preventDefault(),A.stopPropagation();const B=wm(e,r);B&&window.open(B,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}xo.propTypes={blocklet:N.object.isRequired,blocklets:N.array,handleButtonClick:N.func,endpoint:N.string,serverVersion:N.string};xo.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function wo({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:v,compact:l,...u}){const{locale:T}=gt(),[y,S]=M.useState(!1),[j,L]=M.useState({}),D=B=>{L(B)},A=n;return M.useEffect(()=>{L({showResources:!0,resourceType:a,resourceDid:c})},[A,a,c]),M.useEffect(()=>{S(!0),L({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(_s,{theme:xm,children:o.jsx(Us,{FallbackComponent:jr,resetKeys:[A],children:o.jsxs(Y,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[y&&o.jsx(fm,{showCategory:v,showResourcesSwitch:f,blockletRender:B=>{const G={...B,handleButtonClick:e,endpoint:A};return r({...B,defaultRender:o.jsx(xo,{...G})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:A,locale:T,onFilterChange:D,onSearchSelect:t,filters:j,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}wo.propTypes={storeUrl:N.string.isRequired,handleButtonClick:N.func,handleSearchSelect:N.func,handleBlockletRender:N.func,extraFilter:N.func,serverVersion:N.string,resourceType:N.string,resourceDid:N.string,showResourcesSwitch:N.bool,showCategory:N.bool,compact:N.bool};wo.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Sm=He(ef)`
554
554
  .ms-highlight {
555
555
  color: ${e=>e.theme.palette.primary.main};
556
556
  }
557
557
  `,Eo=M.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=yn(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=fc(),{t:v,locale:l}=gt(),u=s[a];return M.useEffect(()=>{n(a)},[n,a]),M.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(jm,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:o.jsx(pc,{locale:l,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?Ac({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:i,stepTip:v("blocklet.component.add"),children:o.jsx(Tm,{children:typeof(u==null?void 0:u.body)=="function"?u.body():u==null?void 0:u.body})})})});Eo.propTypes={meta:N.any,onStepChange:N.func.isRequired,isMobile:N.bool.isRequired};Eo.defaultProps={meta:null};const Es=e=>e.isMobile?`
558
558
  height: calc(100vh - 56px - 64px - 48px);
559
- `:"",Tm=Ve.div`
559
+ `:"",Tm=He.div`
560
560
  width: 100%;
561
561
  height: 100%;
562
562
  display: flex;
@@ -572,7 +572,7 @@ see detail in https://www.npmjs.com/package/is-var-name
572
572
  aside {
573
573
  width: 140px;
574
574
  }
575
- `,jm=Ve(Y)`
575
+ `,jm=He(Y)`
576
576
  ${({className:e})=>e==="mobileStyle"?`
577
577
  & > div{
578
578
  height: 100%;
@@ -690,7 +690,7 @@ see detail in https://www.npmjs.com/package/is-var-name
690
690
  & .connect {
691
691
  background: white;
692
692
  }
693
- `,km=Eo,Om=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1,Im=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},ri=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Cm=e=>(e.environments||[]).some(t=>t.required),Ss=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Rm=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},Ts=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Sl({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:v,showFromUrl:l,enableRunBackground:u,showCategory:T}){var nn,wn,R,St,Ct,rn,d,x,w,P;const{t:y,locale:S}=gt(),[j,L]=M.useState(!1),[D,A]=M.useState(null),[B,G]=M.useState(""),[I,F]=M.useState(""),{api:H,ws:{useSubscription:$},inService:le,info:V}=_n(),{blocklet:se,actions:{refreshBlocklet:je}}=kr(),[We,Me]=M.useState(null),[Qe,Z]=M.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ee,ye]=M.useState(pe),[oe,Ae]=M.useState(0),we=M.useRef({}),Je=M.useRef({}),qe=M.useRef({}),Ht=qt(O=>O.breakpoints.down("md")),Vt=Xl(),[Ft,Xt]=M.useState(!0),{meta:Pe}=we.current,_e=Js(Pe),Ze=M.useRef(!1),de=O=>ye(_=>({..._,...O}));M.useEffect(()=>{if(ee.pathPrefix){const{errMsg:O}=tn({...ee,pathPrefix:ee.pathPrefix,locale:S});G(O)}},[ee.pathPrefix]),M.useEffect(()=>{oe===0&&ye(pe)},[oe]);const Yt=()=>{const O=ri(se)??"";de({didSpaceEndpoint:O})},Qt=()=>{var O;return(O=we==null?void 0:we.current)!=null&&O.meta?Dt.getDisplayName(we.current):""},Jt=()=>{L(!1),ye({}),Ze.current=!1,we.current={},e()},ke=O=>{const _=W=>{de({installResultProps:{variant:"error",title:Qt(),subTitle:O,footer:o.jsx(dt,{className:"bottom-button",disabled:W,"data-cy":"retry-install-component",onClick:async()=>{_(!0),await en(we.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[W&&o.jsx(xt,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};_()},Bt=O=>_=>{var W,ne;(((W=_==null?void 0:_.meta)==null?void 0:W.did)||(_==null?void 0:_.meta))===((ne=se==null?void 0:se.meta)==null?void 0:ne.did)&&O(_)},Nn=()=>{Ts({timeout:0,componentDid:Vt.componentDid,manual:!0}),Jt(),setTimeout(()=>{const O=document.getElementsByClassName("dashboard-main")[0];O&&(O.scrollTop=O.scrollHeight)},200)};$(kt.BlockletEvents.componentInstalled,Bt(()=>{de({installResultProps:{variant:"success",title:Qt(),subTitle:y("blocklet.component.installSuccessTip")}}),Ts({componentDid:Vt.componentDid})}),[(nn=se==null?void 0:se.meta)==null?void 0:nn.did]),$(kt.BlockletEvents.statusChange,Bt(()=>{const O=ri(se);de(_=>({..._,didSpaceEndpoint:O}))}),[(wn=se==null?void 0:se.meta)==null?void 0:wn.did]),$(kt.BlockletEvents.downloadFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(R=se==null?void 0:se.meta)==null?void 0:R.did]),$(kt.BlockletEvents.installFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(St=se==null?void 0:se.meta)==null?void 0:St.did]);const et=[],Zt=O=>((se==null?void 0:se.children)||[]).find(_=>_.meta.did===O),en=async O=>{var Ut,ft;Ze.current=!0;const{pathPrefix:_,bundleDid:W,title:ne,componentName:ae="",componentDid:Be=""}=ee,Ne=((Ut=we.current)==null?void 0:Ut.meta)||{},{configs:Ee=[],registryUrl:Te,inStore:Xe,inputUrl:Rt,dist:An}=Ne,Pt=(ft=we.current)==null?void 0:ft.downloadTokenList,st=Rt||(Xe?_o(Te,W,An):"");L(!0);const $t={rootDid:se.meta.did,url:st,mountPoint:_?lr(_):`/${lr(Ne.title||Ne.name)}`,title:ne,name:ae,did:Be,onlyRequired:!Ft,...ee.hasEnvironmentsStep&&Ee.length>0?{configs:Ee.map(at=>({...at,value:ee.configsValue[at.key]||""}))}:{},...Pt?{downloadTokenList:Pt}:{},...O};try{if(await H.installComponent({input:$t}),Te){const{teamDid:at,storeList:_t}=Ks({fromBlocklet:le,nodeInfo:V,blocklet:se}),{isNew:En,decoded:Sn}=Fc(Te,_t);En&&await H.addBlockletStore({input:{teamDid:at,url:Sn}})}de({installResultProps:{}}),je({showError:!1,attachRuntimeInfo:!1})}catch(at){const _t=Xs(at);Oi.error(_t),console.error("installComponent error: ",at),ke(_t)}finally{L(!1),we.current.installInput=$t}},tn=O=>{const _=ou({params:{...O,did:O.bundleDid},blocklets:[se],blocklet:se,locale:S});if(_){const W=Zt(O.bundleDid),ne=su({params:{...O,did:O.bundleDid},blocklet:se});if(W&&W.mountPoint===ne)return{errMsg:""}}return{errMsg:_}},Fe=async O=>{var W,ne;const{errMsg:_}=tn({...ee,locale:S});G(_),oe===et.length-2&&!Ze.current&&await en(O),(ne=(W=Je.current)==null?void 0:W.setActiveStepByIndex)==null||ne.call(W,ae=>ae+1)},tt=()=>{var O,_;(_=(O=Je.current)==null?void 0:O.setActiveStepByIndex)==null||_.call(O,W=>W-1)},wt=()=>{const{pathPrefix:O,bundleDid:_,title:W,componentName:ne="",componentDid:ae=""}=ee,{meta:Be={}}=we.current||{},{registryUrl:Ne,inStore:Ee,inputUrl:Te,dist:Xe}=Be,Rt=Ee?_o(Ne,_,Xe):Te;Me({meta:Be,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:O,url:Rt,title:W,name:ne,did:ae}})},ot=O=>{Z(!1),de({purchaseResultProps:{variant:"error",title:Qt(),subTitle:O,style:{paddingTop:120},footer:o.jsx(dt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},Et=({downloadTokenList:O})=>{we.current.downloadTokenList=O,Z(!1),Fe()},It=({chooseParams:O=we.current,componentDid:_,isInit:W=!1})=>{var Sn,sr,Dn,Mn;const{meta:ne,registryUrl:ae,inStore:Be,inputUrl:Ne}=O,{did:Ee,title:Te,name:Xe}=ne,Rt=(((Sn=se.settings)==null?void 0:Sn.children)||[]).filter($e=>$e.status==="deleted"&&$e.meta.bundleDid===Ee),An=_||"",Pt=(sr=ne.environments)==null?void 0:sr.map($e=>{const{name:Tn,validation:on,...jn}=$e,sn={validation:kc(on)?"":on};return{...jn,key:Tn,...sn}});we.current={...O,meta:{...ne,configs:Pt,registryUrl:ae,inStore:Be,inputUrl:Ne}};let st={};if(W){const $e=[se],Tn=Pt||[],on=[],jn=qs(jc([...Tn,...on]),"key").filter(vt=>!!vt.key).sort((vt,an)=>vt.required&&!an.required?-1:an.required&&!vt.required?1:0),sn=Dt.getSharedConfigObj($e[0],{configs:jn}),Fn={},Oe=jn.map(vt=>{const{default:an,key:ln,...ar}=vt;return Fn[ln]=sn[ln]||an,{...ar,key:ln,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[ln]}});st={...st,configsList:Oe,configsValue:Fn,hasMissRequiredConfigs:Ss(Oe,Fn)}}const $t=se.children.some($e=>$e.mountPoint==="/"),Ut=Rt.find($e=>$e.meta.bundleDid===Ee),ft=se.children.find($e=>$e.meta.bundleDid===Ee);st.title=Te||"",Ut?st={...st,pathPrefix:Ut.mountPoint||"",componentName:Ut.meta.name,hasEnvironmentsStep:!1}:ft?st={...st,pathPrefix:ft.mountPoint||"",componentName:ft.meta.name,hasEnvironmentsStep:!1}:st={...st,pathPrefix:$t?`/${lr(Te)||lr(Xe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(Dn=we.current.meta)==null?void 0:Dn.environments)==null?void 0:Mn.length)>0};const at=Om(we.current.meta),_t=Im(we.current.meta),En=ri(se);de({bundleDid:Ee,componentDid:An,...st,hasRequiredEnvironments:Cm(we.current.meta),requirePurchase:at,didSpaceIsRequiredSetup:_t,didSpaceEndpoint:En}),W&&at&&wt()};M.useEffect(()=>{!c||oe!==0||!se||(It({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Fe())},[c,oe,se]),et.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:o.jsxs(un,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ee.showFromUrlDialog&&o.jsx(to,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:O,inputUrl:_,inStore:W,registryUrl:ne})=>{It({chooseParams:{meta:O,inputUrl:_,inStore:W,registryUrl:ne},isInit:!0}),de({showFromUrlDialog:!1}),Fe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),o.jsx(so,{stores:n,extra:Ds.isInServerlessMode(V)?null:l?o.jsxs(dt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Qs,{style:{fontSize:20,marginRight:4}}),y("blocklet.component.addComponentTip.fromUrl")]}):null,loading:j,onChange:()=>{ye({}),we.current={}},storageKey:s,children:({currentRegistry:O})=>o.jsx(wo,{showResourcesSwitch:v,showCategory:T,serverVersion:V==null?void 0:V.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:O.url,resourceType:r,resourceDid:i,handleButtonClick:_=>{It({chooseParams:{..._,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:_,defaultRender:W})=>{const ne=(ee==null?void 0:ee.bundleDid)&&(ee==null?void 0:ee.bundleDid)===(_==null?void 0:_.did);return o.jsxs(_m,{children:[o.jsx(Y,{className:ne?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...ne?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:W}),ne&&o.jsx(Y,{className:"check-container",children:o.jsx(Ws,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:Rm({params:ee,blocklet:se,t:y}),onCancel:Jt,onConfirm:()=>{Fe()}}),et.push({key:"agreement",name:y("launchBlocklet.introduction"),body:o.jsxs(un,{component:"div",className:"agreement-wrapper",children:[o.jsx(zs,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),o.jsx(Mi,{meta:Pe,onClickNext:Fe,installRelated:Ft,onChangeInstallRelated:Xt,handleDescEle:o.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:y("common.pre"),disabled:!_e,confirm:y(_e?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Jt:tt,onConfirm:()=>{Z(!1),Fe()}}),Pe&&ee.requirePurchase&&et.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[y("common.verifyNFT"),o.jsx(Mr,{})]}),body:o.jsxs(un,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((rn=(Ct=qe.current)==null?void 0:Ct.getCurrentStep)==null?void 0:rn.call(Ct))===2||Qe)&&o.jsx(pr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Hn(ee.purchaseResultProps)?We&&o.jsx(Gh,{ref:qe,meta:We.meta,mode:ee.componentDid?"verify":"both",onCancel:ot,installOpts:We.installOpts,handlePaySuccess:Et}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Ro,{...ee.purchaseResultProps})})]}),disabled:((x=(d=qe.current)==null?void 0:d.getCurrentStep)==null?void 0:x.call(d))===2||Qe,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof qe.current.onNext=="function"&&(qe.current.onNext(),Z(!0))},onCancel:()=>{tt()}}),Dt.hasStartEngine(Pe)&&Dc.hasMountPoint(Pe)?et.push({key:"config",name:y("common.config"),error:B,body:o.jsxs(un,{component:"div",children:[o.jsx(pr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),o.jsx(Sr,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:I||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ee.pathPrefix,onChange:O=>{const _=O.target.value;de({pathPrefix:_}),F(y("common.slugifyHint",{value:Mc(_)}))}}),!!B&&o.jsx(Rs,{severity:"error",style:{width:"100%",marginTop:8},children:B})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:()=>{Fe()}}):Pe&&(ee.pathPrefix=((P=(w=Pe.interfaces)==null?void 0:w[0])==null?void 0:P.path)||`/${Pe.did}`),Pe&&(ee!=null&&ee.hasEnvironmentsStep)&&et.push({key:"environment",name:o.jsxs(o.Fragment,{children:[y("common.environment")," ",ee.hasRequiredEnvironments&&o.jsx(Mr,{})]}),disabled:!!D||(ee==null?void 0:ee.hasMissRequiredConfigs),body:()=>o.jsxs(un,{component:"div",style:{overflowY:"auto"},children:[o.jsx(pr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),o.jsx(Uc,{style:{marginTop:-12,width:"100%"},schema:ee.configsList,defaultValue:ee.configsValue,onChange:(O,{action:_,currentItem:W,allValues:ne})=>{_==="confirm"&&de({hasMissRequiredConfigs:Ss(ee.configsList,ne),configsValue:ne}),_==="edit"?A(W):["cancel","confirm"].includes(_)&&A(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),Pe&&(ee!=null&&ee.didSpaceIsRequiredSetup)&&et.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",ee.didSpaceIsRequiredSetup==="required"&&o.jsx(Mr,{})]}),disabled:(ee==null?void 0:ee.didSpaceIsRequiredSetup)&&!ee.didSpaceEndpoint,body:()=>o.jsx($c,{children:o.jsxs(un,{component:"div",children:[o.jsx(pr,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),o.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:o.jsx(oo,{blockletMeta:we.current.meta,onNext:()=>{Fe()},onEndpointUpdate:Yt})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),et.push({key:"install",name:Zt(Pe==null?void 0:Pe.did)?y("common.upgrade"):y("common.install"),disabled:u?!1:Hn(ee.installResultProps),loading:u?!1:Hn(ee.installResultProps),body:o.jsx(un,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Hn(ee.installResultProps)?o.jsx(cc,{message:o.jsx(Lm,{children:y(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Ro,{...ee.installResultProps})})}),confirm:y("common.complete"),onConfirm:Nn});const Ke=et[oe]||{},xn=()=>j||Ke.error||!ee.bundleDid?!0:oe>1?!ee.pathPrefix:!1;return se?o.jsxs(Pm,{sx:a?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[o.jsx(mc,{steps:et,mode:"memory",children:o.jsx(km,{ref:Je,meta:Pe,isMobile:Ht,onStepChange:O=>{Ae(O)}})}),o.jsxs(Y,{className:"action-bar",children:[Ke.cancel&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onCancel()},disabled:oe===et.length-2&&j,color:"inherit",children:Ke.cancel||y("common.cancel")}),Ke.confirm&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Ke.disabled=="boolean"?Ke.disabled:xn()),variant:"contained",autoFocus:!0,title:Ke.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ke.loading=="boolean"?Ke.loading:j)&&o.jsx(xt,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke.confirm})]})})]})]}):null}Sl.propTypes={onClose:N.func,mode:N.oneOf(["normal","embed"]),inDialog:N.bool,stores:N.arrayOf(N.string),storeUrl:N.string,resourceType:N.string,resourceDid:N.string,storageKey:N.string,selectedMeta:N.object,showResourcesSwitch:N.bool,showFromUrl:N.bool,enableRunBackground:N.bool,showCategory:N.bool};Sl.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Pm=Ve(Y)`
693
+ `,km=Eo,Om=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1,Im=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},ri=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Cm=e=>(e.environments||[]).some(t=>t.required),Ss=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Rm=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},Ts=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Sl({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:v,showFromUrl:l,enableRunBackground:u,showCategory:T}){var nn,wn,R,St,Ct,rn,d,x,w,P;const{t:y,locale:S}=gt(),[j,L]=M.useState(!1),[D,A]=M.useState(null),[B,G]=M.useState(""),[I,F]=M.useState(""),{api:V,ws:{useSubscription:$},inService:le,info:H}=_n(),{blocklet:se,actions:{refreshBlocklet:je}}=kr(),[We,Me]=M.useState(null),[Qe,Z]=M.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ee,ye]=M.useState(pe),[oe,Ae]=M.useState(0),we=M.useRef({}),Je=M.useRef({}),qe=M.useRef({}),Vt=qt(O=>O.breakpoints.down("md")),Ht=Xl(),[Ft,Xt]=M.useState(!0),{meta:Pe}=we.current,_e=Js(Pe),Ze=M.useRef(!1),de=O=>ye(_=>({..._,...O}));M.useEffect(()=>{if(ee.pathPrefix){const{errMsg:O}=tn({...ee,pathPrefix:ee.pathPrefix,locale:S});G(O)}},[ee.pathPrefix]),M.useEffect(()=>{oe===0&&ye(pe)},[oe]);const Yt=()=>{const O=ri(se)??"";de({didSpaceEndpoint:O})},Qt=()=>{var O;return(O=we==null?void 0:we.current)!=null&&O.meta?Dt.getDisplayName(we.current):""},Jt=()=>{L(!1),ye({}),Ze.current=!1,we.current={},e()},ke=O=>{const _=W=>{de({installResultProps:{variant:"error",title:Qt(),subTitle:O,footer:o.jsx(dt,{className:"bottom-button",disabled:W,"data-cy":"retry-install-component",onClick:async()=>{_(!0),await en(we.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[W&&o.jsx(xt,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};_()},Bt=O=>_=>{var W,ne;(((W=_==null?void 0:_.meta)==null?void 0:W.did)||(_==null?void 0:_.meta))===((ne=se==null?void 0:se.meta)==null?void 0:ne.did)&&O(_)},Nn=()=>{Ts({timeout:0,componentDid:Ht.componentDid,manual:!0}),Jt(),setTimeout(()=>{const O=document.getElementsByClassName("dashboard-main")[0];O&&(O.scrollTop=O.scrollHeight)},200)};$(kt.BlockletEvents.componentInstalled,Bt(()=>{de({installResultProps:{variant:"success",title:Qt(),subTitle:y("blocklet.component.installSuccessTip")}}),Ts({componentDid:Ht.componentDid})}),[(nn=se==null?void 0:se.meta)==null?void 0:nn.did]),$(kt.BlockletEvents.statusChange,Bt(()=>{const O=ri(se);de(_=>({..._,didSpaceEndpoint:O}))}),[(wn=se==null?void 0:se.meta)==null?void 0:wn.did]),$(kt.BlockletEvents.downloadFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(R=se==null?void 0:se.meta)==null?void 0:R.did]),$(kt.BlockletEvents.installFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(St=se==null?void 0:se.meta)==null?void 0:St.did]);const et=[],Zt=O=>((se==null?void 0:se.children)||[]).find(_=>_.meta.did===O),en=async O=>{var Ut,ft;Ze.current=!0;const{pathPrefix:_,bundleDid:W,title:ne,componentName:ae="",componentDid:Be=""}=ee,Ne=((Ut=we.current)==null?void 0:Ut.meta)||{},{configs:Ee=[],registryUrl:Te,inStore:Xe,inputUrl:Rt,dist:An}=Ne,Pt=(ft=we.current)==null?void 0:ft.downloadTokenList,st=Rt||(Xe?_o(Te,W,An):"");L(!0);const $t={rootDid:se.meta.did,url:st,mountPoint:_?lr(_):`/${lr(Ne.title||Ne.name)}`,title:ne,name:ae,did:Be,onlyRequired:!Ft,...ee.hasEnvironmentsStep&&Ee.length>0?{configs:Ee.map(at=>({...at,value:ee.configsValue[at.key]||""}))}:{},...Pt?{downloadTokenList:Pt}:{},...O};try{if(await V.installComponent({input:$t}),Te){const{teamDid:at,storeList:_t}=Ks({fromBlocklet:le,nodeInfo:H,blocklet:se}),{isNew:En,decoded:Sn}=Fc(Te,_t);En&&await V.addBlockletStore({input:{teamDid:at,url:Sn}})}de({installResultProps:{}}),je({showError:!1,attachRuntimeInfo:!1})}catch(at){const _t=Xs(at);Oi.error(_t),console.error("installComponent error: ",at),ke(_t)}finally{L(!1),we.current.installInput=$t}},tn=O=>{const _=ou({params:{...O,did:O.bundleDid},blocklets:[se],blocklet:se,locale:S});if(_){const W=Zt(O.bundleDid),ne=su({params:{...O,did:O.bundleDid},blocklet:se});if(W&&W.mountPoint===ne)return{errMsg:""}}return{errMsg:_}},Fe=async O=>{var W,ne;const{errMsg:_}=tn({...ee,locale:S});G(_),oe===et.length-2&&!Ze.current&&await en(O),(ne=(W=Je.current)==null?void 0:W.setActiveStepByIndex)==null||ne.call(W,ae=>ae+1)},tt=()=>{var O,_;(_=(O=Je.current)==null?void 0:O.setActiveStepByIndex)==null||_.call(O,W=>W-1)},wt=()=>{const{pathPrefix:O,bundleDid:_,title:W,componentName:ne="",componentDid:ae=""}=ee,{meta:Be={}}=we.current||{},{registryUrl:Ne,inStore:Ee,inputUrl:Te,dist:Xe}=Be,Rt=Ee?_o(Ne,_,Xe):Te;Me({meta:Be,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:O,url:Rt,title:W,name:ne,did:ae}})},ot=O=>{Z(!1),de({purchaseResultProps:{variant:"error",title:Qt(),subTitle:O,style:{paddingTop:120},footer:o.jsx(dt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},Et=({downloadTokenList:O})=>{we.current.downloadTokenList=O,Z(!1),Fe()},It=({chooseParams:O=we.current,componentDid:_,isInit:W=!1})=>{var Sn,sr,Dn,Mn;const{meta:ne,registryUrl:ae,inStore:Be,inputUrl:Ne}=O,{did:Ee,title:Te,name:Xe}=ne,Rt=(((Sn=se.settings)==null?void 0:Sn.children)||[]).filter($e=>$e.status==="deleted"&&$e.meta.bundleDid===Ee),An=_||"",Pt=(sr=ne.environments)==null?void 0:sr.map($e=>{const{name:Tn,validation:on,...jn}=$e,sn={validation:kc(on)?"":on};return{...jn,key:Tn,...sn}});we.current={...O,meta:{...ne,configs:Pt,registryUrl:ae,inStore:Be,inputUrl:Ne}};let st={};if(W){const $e=[se],Tn=Pt||[],on=[],jn=qs(jc([...Tn,...on]),"key").filter(vt=>!!vt.key).sort((vt,an)=>vt.required&&!an.required?-1:an.required&&!vt.required?1:0),sn=Dt.getSharedConfigObj($e[0],{configs:jn}),Fn={},Oe=jn.map(vt=>{const{default:an,key:ln,...ar}=vt;return Fn[ln]=sn[ln]||an,{...ar,key:ln,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[ln]}});st={...st,configsList:Oe,configsValue:Fn,hasMissRequiredConfigs:Ss(Oe,Fn)}}const $t=se.children.some($e=>$e.mountPoint==="/"),Ut=Rt.find($e=>$e.meta.bundleDid===Ee),ft=se.children.find($e=>$e.meta.bundleDid===Ee);st.title=Te||"",Ut?st={...st,pathPrefix:Ut.mountPoint||"",componentName:Ut.meta.name,hasEnvironmentsStep:!1}:ft?st={...st,pathPrefix:ft.mountPoint||"",componentName:ft.meta.name,hasEnvironmentsStep:!1}:st={...st,pathPrefix:$t?`/${lr(Te)||lr(Xe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(Dn=we.current.meta)==null?void 0:Dn.environments)==null?void 0:Mn.length)>0};const at=Om(we.current.meta),_t=Im(we.current.meta),En=ri(se);de({bundleDid:Ee,componentDid:An,...st,hasRequiredEnvironments:Cm(we.current.meta),requirePurchase:at,didSpaceIsRequiredSetup:_t,didSpaceEndpoint:En}),W&&at&&wt()};M.useEffect(()=>{!c||oe!==0||!se||(It({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Fe())},[c,oe,se]),et.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:o.jsxs(un,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ee.showFromUrlDialog&&o.jsx(to,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:O,inputUrl:_,inStore:W,registryUrl:ne})=>{It({chooseParams:{meta:O,inputUrl:_,inStore:W,registryUrl:ne},isInit:!0}),de({showFromUrlDialog:!1}),Fe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),o.jsx(so,{stores:n,extra:Ds.isInServerlessMode(H)?null:l?o.jsxs(dt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Qs,{style:{fontSize:20,marginRight:4}}),y("blocklet.component.addComponentTip.fromUrl")]}):null,loading:j,onChange:()=>{ye({}),we.current={}},storageKey:s,children:({currentRegistry:O})=>o.jsx(wo,{showResourcesSwitch:v,showCategory:T,serverVersion:H==null?void 0:H.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:O.url,resourceType:r,resourceDid:i,handleButtonClick:_=>{It({chooseParams:{..._,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:_,defaultRender:W})=>{const ne=(ee==null?void 0:ee.bundleDid)&&(ee==null?void 0:ee.bundleDid)===(_==null?void 0:_.did);return o.jsxs(_m,{children:[o.jsx(Y,{className:ne?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...ne?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:W}),ne&&o.jsx(Y,{className:"check-container",children:o.jsx(Ws,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:Rm({params:ee,blocklet:se,t:y}),onCancel:Jt,onConfirm:()=>{Fe()}}),et.push({key:"agreement",name:y("launchBlocklet.introduction"),body:o.jsxs(un,{component:"div",className:"agreement-wrapper",children:[o.jsx(zs,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),o.jsx(Mi,{meta:Pe,onClickNext:Fe,installRelated:Ft,onChangeInstallRelated:Xt,handleDescEle:o.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:y("common.pre"),disabled:!_e,confirm:y(_e?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Jt:tt,onConfirm:()=>{Z(!1),Fe()}}),Pe&&ee.requirePurchase&&et.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[y("common.verifyNFT"),o.jsx(Mr,{})]}),body:o.jsxs(un,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((rn=(Ct=qe.current)==null?void 0:Ct.getCurrentStep)==null?void 0:rn.call(Ct))===2||Qe)&&o.jsx(pr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Vn(ee.purchaseResultProps)?We&&o.jsx(Gh,{ref:qe,meta:We.meta,mode:ee.componentDid?"verify":"both",onCancel:ot,installOpts:We.installOpts,handlePaySuccess:Et}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Ro,{...ee.purchaseResultProps})})]}),disabled:((x=(d=qe.current)==null?void 0:d.getCurrentStep)==null?void 0:x.call(d))===2||Qe,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof qe.current.onNext=="function"&&(qe.current.onNext(),Z(!0))},onCancel:()=>{tt()}}),Dt.hasStartEngine(Pe)&&Dc.hasMountPoint(Pe)?et.push({key:"config",name:y("common.config"),error:B,body:o.jsxs(un,{component:"div",children:[o.jsx(pr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),o.jsx(Sr,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:I||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ee.pathPrefix,onChange:O=>{const _=O.target.value;de({pathPrefix:_}),F(y("common.slugifyHint",{value:Mc(_)}))}}),!!B&&o.jsx(Rs,{severity:"error",style:{width:"100%",marginTop:8},children:B})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:()=>{Fe()}}):Pe&&(ee.pathPrefix=((P=(w=Pe.interfaces)==null?void 0:w[0])==null?void 0:P.path)||`/${Pe.did}`),Pe&&(ee!=null&&ee.hasEnvironmentsStep)&&et.push({key:"environment",name:o.jsxs(o.Fragment,{children:[y("common.environment")," ",ee.hasRequiredEnvironments&&o.jsx(Mr,{})]}),disabled:!!D||(ee==null?void 0:ee.hasMissRequiredConfigs),body:()=>o.jsxs(un,{component:"div",style:{overflowY:"auto"},children:[o.jsx(pr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),o.jsx(Uc,{style:{marginTop:-12,width:"100%"},schema:ee.configsList,defaultValue:ee.configsValue,onChange:(O,{action:_,currentItem:W,allValues:ne})=>{_==="confirm"&&de({hasMissRequiredConfigs:Ss(ee.configsList,ne),configsValue:ne}),_==="edit"?A(W):["cancel","confirm"].includes(_)&&A(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),Pe&&(ee!=null&&ee.didSpaceIsRequiredSetup)&&et.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",ee.didSpaceIsRequiredSetup==="required"&&o.jsx(Mr,{})]}),disabled:(ee==null?void 0:ee.didSpaceIsRequiredSetup)&&!ee.didSpaceEndpoint,body:()=>o.jsx($c,{children:o.jsxs(un,{component:"div",children:[o.jsx(pr,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),o.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:o.jsx(oo,{blockletMeta:we.current.meta,onNext:()=>{Fe()},onEndpointUpdate:Yt})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),et.push({key:"install",name:Zt(Pe==null?void 0:Pe.did)?y("common.upgrade"):y("common.install"),disabled:u?!1:Vn(ee.installResultProps),loading:u?!1:Vn(ee.installResultProps),body:o.jsx(un,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Vn(ee.installResultProps)?o.jsx(cc,{message:o.jsx(Lm,{children:y(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Ro,{...ee.installResultProps})})}),confirm:y("common.complete"),onConfirm:Nn});const Ke=et[oe]||{},xn=()=>j||Ke.error||!ee.bundleDid?!0:oe>1?!ee.pathPrefix:!1;return se?o.jsxs(Pm,{sx:a?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[o.jsx(mc,{steps:et,mode:"memory",children:o.jsx(km,{ref:Je,meta:Pe,isMobile:Vt,onStepChange:O=>{Ae(O)}})}),o.jsxs(Y,{className:"action-bar",children:[Ke.cancel&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onCancel()},disabled:oe===et.length-2&&j,color:"inherit",children:Ke.cancel||y("common.cancel")}),Ke.confirm&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Ke.disabled=="boolean"?Ke.disabled:xn()),variant:"contained",autoFocus:!0,title:Ke.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ke.loading=="boolean"?Ke.loading:j)&&o.jsx(xt,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke.confirm})]})})]})]}):null}Sl.propTypes={onClose:N.func,mode:N.oneOf(["normal","embed"]),inDialog:N.bool,stores:N.arrayOf(N.string),storeUrl:N.string,resourceType:N.string,resourceDid:N.string,storageKey:N.string,selectedMeta:N.object,showResourcesSwitch:N.bool,showFromUrl:N.bool,enableRunBackground:N.bool,showCategory:N.bool};Sl.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Pm=He(Y)`
694
694
  .action-bar {
695
695
  display: flex;
696
696
  justify-content: flex-end;
@@ -702,12 +702,12 @@ see detail in https://www.npmjs.com/package/is-var-name
702
702
  background: #fff;
703
703
  border-top: 1px solid #eee;
704
704
  }
705
- `,un=Ve(ge)`
705
+ `,un=He(ge)`
706
706
  width: 100%;
707
707
  height: 100%;
708
- `,pr=Ve(zs)`
708
+ `,pr=He(zs)`
709
709
  margin-bottom: 24px;
710
- `,_m=Ve.div`
710
+ `,_m=He.div`
711
711
  position: relative;
712
712
 
713
713
  .choose-blocklet {
@@ -751,7 +751,7 @@ see detail in https://www.npmjs.com/package/is-var-name
751
751
  transition: all ease 0.2s;
752
752
  }
753
753
  }
754
- `,Lm=Ve.div`
754
+ `,Lm=He.div`
755
755
  color: ${e=>e.theme.palette.primary.main};
756
756
  .msg-before {
757
757
  display: inline-block;