@abtnode/blocklet-services 1.16.46-beta-20250704-234926-09d872ad → 1.16.46-beta-20250706-075512-de1b046b
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.
- package/dist/assets/AdapterDayjs-XSKQGIOn.js +3 -0
- package/dist/assets/{Community-B_rRcH4k.js → Community-CcMMU0U0.js} +1 -1
- package/dist/assets/{Google-if7RtO8D.js → Google-DEJzh5qu.js} +1 -1
- package/dist/assets/{Holiday-DET7Gz33.js → Holiday-CQ56q1Zn.js} +1 -1
- package/dist/assets/{Meeting-D-dNfxru.js → Meeting-BloE6sJb.js} +1 -1
- package/dist/assets/{OffSick-MDwLewaS.js → OffSick-BDgahXbb.js} +1 -1
- package/dist/assets/{WorkingRemotely-BmHz2B2e.js → WorkingRemotely-Dy2yEuOf.js} +1 -1
- package/dist/assets/access-control-BCwE1yaW.js +14 -0
- package/dist/assets/{actions-DzwK3TZX.js → actions-C2acYZqU.js} +1 -1
- package/dist/assets/{add-component-core-D76Zubeq.js → add-component-core-BFbARhO9.js} +19 -19
- package/dist/assets/add-resource-DOrkE3yq.js +1 -0
- package/dist/assets/addon-DTMrz0XJ.js +14 -0
- package/dist/assets/{advanced-D6zLG63b.js → advanced-C6q3rX82.js} +3 -3
- package/dist/assets/api-B7LEhzE2.js +1 -0
- package/dist/assets/appearance-Cb9WLLnL.js +1 -0
- package/dist/assets/arrow-down.svg-ChoF_uzO.js +1 -0
- package/dist/assets/{audit-logs-CdG4bSHH.js → audit-logs-tRP7Ir6c.js} +3 -3
- package/dist/assets/authorize-CKa1qwqR.js +1 -0
- package/dist/assets/{base-chart-CYYG4HBW.js → base-chart-DN6icVvl.js} +1 -1
- package/dist/assets/base32-BCg8oKIC.js +1 -0
- package/dist/assets/branding-BfFZn4oO.js +40 -0
- package/dist/assets/{branding-_WV1QAAs.js → branding-Cr2G9cD7.js} +6 -6
- package/dist/assets/bundle-avatar-Xp52QSf2.js +1 -0
- package/dist/assets/button-V9BmeTRn.js +1 -0
- package/dist/assets/click-to-copy-CT3GMLFE.js +1 -0
- package/dist/assets/cloneDeep-C4F9EbDd.js +1 -0
- package/dist/assets/{collapse-hSqt1R5N.js → collapse-cchwlIcj.js} +1 -1
- package/dist/assets/complete-R8Z3eD81.js +39 -0
- package/dist/assets/{component-DKjuvHj4.js → component-CMmOvKYP.js} +8 -8
- package/dist/assets/config-BV6XReOP.js +1 -0
- package/dist/assets/{config-CUi0elhI.js → config-Drzui8W3.js} +2 -2
- package/dist/assets/{config-navigation-Ha3M5G4P.js → config-navigation-lVp-1ugd.js} +7 -7
- package/dist/assets/config-space-D9QgW6OB.js +1 -0
- package/dist/assets/confirm-CDf7UR9D.js +7 -0
- package/dist/assets/connect-Bnz0r5Wi.js +5 -0
- package/dist/assets/connect-Dy-g9TU9.js +1 -0
- package/dist/assets/connect-to-sTkrNSP4.js +1 -0
- package/dist/assets/{content-layout-QCcsYBSN.js → content-layout-C0J5I0TX.js} +1 -1
- package/dist/assets/createClass-CBJCc0i0.js +1 -0
- package/dist/assets/dashboard-D2WUGp4d.js +106 -0
- package/dist/assets/delete-confirm-Db5_a_ND.js +1 -0
- package/dist/assets/did-address-6ebqvNNq.js +1 -0
- package/dist/assets/domain-D3NSNHzA.js +9 -0
- package/dist/assets/domain-action-card-XBKx5ZEq.js +28 -0
- package/dist/assets/domains-DDnUseHb.js +1 -0
- package/dist/assets/{dot-BXCAJPqI.js → dot-DfSvSTo2.js} +1 -1
- package/dist/assets/{edit.svg-DhSbRuoX.js → edit.svg-D-deOViK.js} +1 -1
- package/dist/assets/email-D9yKsyjd.js +18 -0
- package/dist/assets/{empty-spinner-Iuhp-DUy.js → empty-spinner-DlvM3tDM.js} +1 -1
- package/dist/assets/engine-CqzMzhBR.js +1 -0
- package/dist/assets/exchange-passport-Bi7Za8uz.js +1 -0
- package/dist/assets/{form-mylhS1ms.js → form-Cv425yYf.js} +3 -3
- package/dist/assets/fuel-B8dyWYCs.js +32 -0
- package/dist/assets/gen-access-key-CGYvJ1k7.js +2 -0
- package/dist/assets/get-safe-url-HSOeeYs_.js +1 -0
- package/dist/assets/github-icon-CH2zo-td.js +1 -0
- package/dist/assets/home-DxujM2Op.js +1 -0
- package/dist/assets/iframe-BxB-nDw4.js +1 -0
- package/dist/assets/index-B0xpDUsO.js +1019 -0
- package/dist/assets/index-BFT0qxie.js +1 -0
- package/dist/assets/index-BGsWoTbW.js +113 -0
- package/dist/assets/index-BLIgZ0kx.js +269 -0
- package/dist/assets/{index-DareKNWL.js → index-BfwIRDCT.js} +2 -2
- package/dist/assets/index-BojVbZw0.js +1 -0
- package/dist/assets/index-BpkAJRJ3.js +16 -0
- package/dist/assets/index-Bu80qBT0.js +77 -0
- package/dist/assets/{index-Bvup9KK2.js → index-C-vjjw9E.js} +1 -1
- package/dist/assets/index-C35qnTxV.js +1 -0
- package/dist/assets/{index-CJSRV-xv.js → index-CK4-I4Dt.js} +5 -5
- package/dist/assets/{index-y3-0A2va.js → index-CMkvpy46.js} +23 -23
- package/dist/assets/{index-troycNLC.js → index-COypY_9V.js} +13 -13
- package/dist/assets/{index-HJ9bCmon.js → index-CWV__hd3.js} +1 -1
- package/dist/assets/index-CYFNAQl1.js +284 -0
- package/dist/assets/index-CeqM1ZpW.js +1 -0
- package/dist/assets/index-Cm7r5rvw.js +348 -0
- package/dist/assets/{index-DjNdCKSK.js → index-Cwk7U-s7.js} +9 -9
- package/dist/assets/{index-CxOcEJip.js → index-DIBGQQQm.js} +7 -7
- package/dist/assets/index-DNQJZcPj.js +55 -0
- package/dist/assets/index-DRLhEfAl.js +1 -0
- package/dist/assets/index-DRYJ0xIl.js +7 -0
- package/dist/assets/{index-CMf86-QO.js → index-DbIUA2zH.js} +1 -1
- package/dist/assets/index-DjfjJ3Fo.js +1 -0
- package/dist/assets/index-DrVXX4fX.css +1 -0
- package/dist/assets/index-DuEs5obm.js +7 -0
- package/dist/assets/{index-CuVvB-Cv.js → index-Dy-MET-d.js} +1 -1
- package/dist/assets/index-GF3HOour.js +4 -0
- package/dist/assets/index-If1MEgvU.js +29 -0
- package/dist/assets/{index-CsOZO30I.js → index-Iv2oisWn.js} +2 -2
- package/dist/assets/index-JZtXFT6r.js +1 -0
- package/dist/assets/{index-DQ2ZPkAL.js → index-LLcbh8Mm.js} +2 -2
- package/dist/assets/{index-BmzIIRpf.js → index-MGxe3V9B.js} +1 -1
- package/dist/assets/index-PN2leRF6.js +102 -0
- package/dist/assets/index-f_f4wJSK.js +1 -0
- package/dist/assets/index-fy1uK_IR.js +1 -0
- package/dist/assets/{index-CGtM1j0R.js → index-qmAWfCpk.js} +1 -1
- package/dist/assets/{index.esm-CkOXP-jL.js → index.esm-BONQrRCU.js} +1 -1
- package/dist/assets/invitation-B34gciAx.js +177 -0
- package/dist/assets/invite-ByfXPpkh.js +1 -0
- package/dist/assets/issue-passport-CF7kjIha.js +1 -0
- package/dist/assets/item-CT17goAk.js +1 -0
- package/dist/assets/landing-page-8lE7kpfr.js +1 -0
- package/dist/assets/{launch-result-message-Cxe_kPrP.js → launch-result-message-B0akHCFQ.js} +1 -1
- package/dist/assets/{layout-DkPyTaVW.js → layout-Df4ylgze.js} +2 -2
- package/dist/assets/list-BqjxSFj_.js +103 -0
- package/dist/assets/{list-header-CxfG7AtB.js → list-header-BbJpGLxs.js} +1 -1
- package/dist/assets/list-yWg6vRtr.js +2 -0
- package/dist/assets/localization-CJcbV1c6.js +1 -0
- package/dist/assets/{lock.svg-BRQnEAKL.js → lock.svg-xPuKHQ-O.js} +1 -1
- package/dist/assets/{log-DZVsi88y.js → log-B8snR1zU.js} +1 -1
- package/dist/assets/logger-BwL8cVCo.js +1 -0
- package/dist/assets/login-LEjGUnmy.js +1 -0
- package/dist/assets/login-oauth-callback-VnZviVo0.js +1 -0
- package/dist/assets/logo-uploader-C_Xk3axk.js +133 -0
- package/dist/assets/{lost-passport-BmeRKwmT.js → lost-passport-D6MwfL4M.js} +4 -4
- package/dist/assets/{lottie-react.esm-k2Km8DK4.js → lottie-react.esm-Bqal_rmd.js} +1 -1
- package/dist/assets/omit-LyexeK2n.js +1 -0
- package/dist/assets/open-window-BVAimsZ8.js +1 -0
- package/dist/assets/over-due-invoice-payment-DjR5rU46.js +1 -0
- package/dist/assets/{overview-D-oWyxxM.js → overview-Dr0GLBll.js} +3 -3
- package/dist/assets/{page-header-C3zFQU72.js → page-header-Dhv5B-BX.js} +2 -2
- package/dist/assets/passport-item-Cvgw81pu.js +1 -0
- package/dist/assets/{permission-BT6A_5g7.js → permission-CKmU8Z_5.js} +1 -1
- package/dist/assets/preferences-CojjhPk8.js +1 -0
- package/dist/assets/profile-embed-CzLWocm3.js +1 -0
- package/dist/assets/publish-resource-CCEV3Bm_.js +1 -0
- package/dist/assets/{question-mark-circle.svg-Dsn3tw38.js → question-mark-circle.svg-YsMacl4Q.js} +1 -1
- package/dist/assets/{raf-schd.esm-Cy5s98oK.js → raf-schd.esm-BZ5FB5HD.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-B7r3OKKK.js → react-beautiful-dnd.esm-C53HbB7P.js} +1 -1
- package/dist/assets/{react-stripe.esm-iz31a8Oy.js → react-stripe.esm-DdI1E_2N.js} +1 -1
- package/dist/assets/runtime-Bjcp30CT.js +1 -0
- package/dist/assets/{sanitize-CNYhE_fv.js → sanitize-Be9_TGIg.js} +1 -1
- package/dist/assets/sdk-BI2up0A5.js +1 -0
- package/dist/assets/{section-DG_88Iq9.js → section-Be6GDkk8.js} +1 -1
- package/dist/assets/{security-C3JSOgkl.js → security-DYUzNKac.js} +4 -4
- package/dist/assets/{server-logo-notext.svg-BDfKF66U.js → server-logo-notext.svg-BqCXmsOm.js} +1 -1
- package/dist/assets/session-Bj1hMOts.js +1 -0
- package/dist/assets/setup-D_EJHnh2.js +30 -0
- package/dist/assets/{shorten-label-CMcbJgkJ.js → shorten-label-Ba-bmb_4.js} +1 -1
- package/dist/assets/{simple-select-FEjR7w5_.js → simple-select-CGk0N_bX.js} +1 -1
- package/dist/assets/spaces-C1fb5NDx.js +1 -0
- package/dist/assets/start-wlEhUSyq.js +187 -0
- package/dist/assets/starting-progress-IzrgfSED.js +40 -0
- package/dist/assets/status-CwzJOHQ-.js +1 -0
- package/dist/assets/{step-actions-C2pOiZon.js → step-actions-DZNamIJE.js} +1 -1
- package/dist/assets/studio-CMWQYNVG.js +6 -0
- package/dist/assets/switch-control-Z293FB2U.js +18 -0
- package/dist/assets/table-tips-GxhBg0e3.js +1 -0
- package/dist/assets/traffic-CbhaWm03.js +1 -0
- package/dist/assets/transfer-B5jo0mhi.js +16 -0
- package/dist/assets/unsubscribe-CQgLMQmM.js +1 -0
- package/dist/assets/{use-blocklet-logo-BEiiWhw_.js → use-blocklet-logo-BKc9E-_L.js} +6 -6
- package/dist/assets/{use-mobile-CbxgT1_q.js → use-mobile-BmXUeM1i.js} +1 -1
- package/dist/assets/{use-mobile-KernkJ0t.js → use-mobile-DspJgIrG.js} +1 -1
- package/dist/assets/{use-server-logo-CnmK6Efi.js → use-server-logo-7qMC4vqP.js} +1 -1
- package/dist/assets/useAsync-COkfundQ.js +1 -0
- package/dist/assets/{useAsync-sAAs4CGb.js → useAsync-fxvoN33w.js} +1 -1
- package/dist/assets/useLocalStorage-DvM3QMYe.js +1 -0
- package/dist/assets/{useSetState-BO0mlssA.js → useSetState-BWrXo9eH.js} +1 -1
- package/dist/assets/user-center-BAHrlllm.js +77 -0
- package/dist/assets/user-center-C8GAilfL.js +81 -0
- package/dist/assets/user-sessions-DVo9LBeI.js +1 -0
- package/dist/assets/util-C6EYY0RW.js +1 -0
- package/dist/assets/util-fjAejugL.js +1 -0
- package/dist/assets/vendor-arcblock-D026EX-Z.js +1419 -0
- package/dist/assets/vendor-hooks-CFpNP5Ql.js +7 -0
- package/dist/assets/{vendor-mui-core-CB7usZvs.js → vendor-mui-core-BWI0_sKe.js} +2 -2
- package/dist/assets/{vendor-mui-x-Cn6DlQME.js → vendor-mui-x-Bwa_JtSa.js} +1 -1
- package/dist/assets/{vendor-react-BvXSmFbV.js → vendor-react-x2lQvn4m.js} +1 -1
- package/dist/assets/{vendor-utils-eI_TRB_9.js → vendor-utils-Vke2d2wu.js} +2 -2
- package/dist/assets/vendor-ux-DVPR2iDY.js +1564 -0
- package/dist/assets/{vendor-ux-did-connect-C3VYvpKG.css → vendor-ux-DYcPPYq2.css} +1 -1
- package/dist/assets/wrap-locale-CVw8KKu9.js +1 -0
- package/dist/assets/zh-BAK9QZ79.js +1 -0
- package/dist/index.html +9 -9
- package/dist/service-worker.js +1 -1
- package/package.json +32 -32
- package/dist/assets/AdapterDayjs-C4xA34Wo.js +0 -3
- package/dist/assets/access-control-DiMFm5vm.js +0 -14
- package/dist/assets/add-resource-QtPySaVp.js +0 -1
- package/dist/assets/addon-BlQzxfa9.js +0 -14
- package/dist/assets/api-Cux33v3g.js +0 -1
- package/dist/assets/appearance-ALezezqS.js +0 -1
- package/dist/assets/authorize-Bf6tuW6d.js +0 -1
- package/dist/assets/base32-ApkcljBe.js +0 -1
- package/dist/assets/branding-DMgflqsR.js +0 -40
- package/dist/assets/bundle-avatar-ZXyAO7K1.js +0 -1
- package/dist/assets/button-HKPEWKSE.js +0 -1
- package/dist/assets/click-to-copy-C9F3ippp.js +0 -1
- package/dist/assets/cloneDeep-D_6REFFg.js +0 -1
- package/dist/assets/complete-TvShCSjx.js +0 -39
- package/dist/assets/config-B_jSftWs.js +0 -1
- package/dist/assets/config-space-Bf5mw5iZ.js +0 -1
- package/dist/assets/confirm-ChzBz5HU.js +0 -7
- package/dist/assets/connect-ClCSSq0i.js +0 -5
- package/dist/assets/connect-DvZ8YtIj.js +0 -1
- package/dist/assets/connect-to-BHJ-dAXD.js +0 -1
- package/dist/assets/createClass-DrvVCDPe.js +0 -1
- package/dist/assets/dashboard-BObw3ALy.js +0 -106
- package/dist/assets/delete-confirm-BR2J5ZDD.js +0 -1
- package/dist/assets/did-address-D3Egz-BH.js +0 -1
- package/dist/assets/domain-DcVIImSr.js +0 -9
- package/dist/assets/domain-action-card-DhD_cXV_.js +0 -28
- package/dist/assets/domains-ou456zE4.js +0 -1
- package/dist/assets/email-Dl0EXVcw.js +0 -18
- package/dist/assets/engine-sqdrhsce.js +0 -1
- package/dist/assets/exchange-passport-BSJ3G8lf.js +0 -1
- package/dist/assets/fuel-Bd06KJQe.js +0 -32
- package/dist/assets/gen-access-key-m-8Jt1Hc.js +0 -2
- package/dist/assets/get-safe-url-BH99736U.js +0 -1
- package/dist/assets/home-bdgdtKT6.js +0 -1
- package/dist/assets/iframe-B0Sl1srb.js +0 -1
- package/dist/assets/index-B3QNvDDj.js +0 -746
- package/dist/assets/index-BZR3BNLz.js +0 -1
- package/dist/assets/index-BqGWM_OW.js +0 -77
- package/dist/assets/index-BxJtY5Kv.js +0 -284
- package/dist/assets/index-CFeWjGB5.js +0 -55
- package/dist/assets/index-CrwOcYsE.js +0 -1
- package/dist/assets/index-Cx0gea65.js +0 -4
- package/dist/assets/index-DH-srZsa.js +0 -113
- package/dist/assets/index-DiZ-o7if.js +0 -1
- package/dist/assets/index-DrCTi6nm.css +0 -1
- package/dist/assets/index-fEBO3Gzc.js +0 -1
- package/dist/assets/index-k7k0SQbv.js +0 -1
- package/dist/assets/index-ks-YsRmg.js +0 -7
- package/dist/assets/invitation-DbN-YRUm.js +0 -177
- package/dist/assets/invite-CIXrj-3X.js +0 -1
- package/dist/assets/issue-passport-r6T68j--.js +0 -1
- package/dist/assets/item-Bd0ii0Us.js +0 -1
- package/dist/assets/list-DXrUx08c.js +0 -2
- package/dist/assets/list-DlvWPWYw.js +0 -103
- package/dist/assets/localization-Bz_iVajc.js +0 -1
- package/dist/assets/logger-CCGgFyYA.js +0 -1
- package/dist/assets/login-JGAKiqpV.js +0 -1
- package/dist/assets/login-oauth-callback-DqS91pc0.js +0 -1
- package/dist/assets/logo-uploader-X2TJccsm.js +0 -133
- package/dist/assets/omit-D-CdbK9w.js +0 -1
- package/dist/assets/open-window-DcAQjlEr.js +0 -1
- package/dist/assets/over-due-invoice-payment-CqC6F7wx.js +0 -1
- package/dist/assets/passport-item-CFSqpoVC.js +0 -1
- package/dist/assets/preferences-Bp3snrNx.js +0 -1
- package/dist/assets/profile-embed-DdOuqHl9.js +0 -1
- package/dist/assets/publish-resource-QE-lbMIo.js +0 -1
- package/dist/assets/runtime-D3F-K4em.js +0 -1
- package/dist/assets/sdk-fQbwfdKO.js +0 -1
- package/dist/assets/session-CEzfQzQW.js +0 -1
- package/dist/assets/setup-80ncmxUI.js +0 -30
- package/dist/assets/spaces-BEQecBKs.js +0 -1
- package/dist/assets/start-CeGPz6-6.js +0 -187
- package/dist/assets/starting-progress-ACb9l4Xf.js +0 -40
- package/dist/assets/status-Ci7ywBRs.js +0 -1
- package/dist/assets/studio-CAziGLSY.js +0 -6
- package/dist/assets/switch-control-B_6jQTpz.js +0 -18
- package/dist/assets/table-tips-Dmnk1ZGp.js +0 -1
- package/dist/assets/traffic-BVI8c87H.js +0 -1
- package/dist/assets/transfer-BnJYdOTH.js +0 -16
- package/dist/assets/unsubscribe-Bt8dn_fv.js +0 -1
- package/dist/assets/useAsync--s_vBMXH.js +0 -1
- package/dist/assets/useLocalStorage-DmhYFNPM.js +0 -1
- package/dist/assets/user-center-DeDT-eSp.js +0 -77
- package/dist/assets/util-BA-_-Cnq.js +0 -1
- package/dist/assets/util-C7Sp_ClB.js +0 -1
- package/dist/assets/vendor-arcblock-B55HFGqZ.js +0 -2399
- package/dist/assets/vendor-hooks-BA23GwO5.js +0 -7
- package/dist/assets/vendor-ux-did-connect-soajAeMx.js +0 -1702
- package/dist/assets/wrap-locale-DXvoSw5L.js +0 -1
- package/dist/assets/zh-C8_JX25l.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as F,j as l,p as Tt,
|
|
1
|
+
import{$ as F,j as l,p as Tt,at as it,ak as oe,J as qt,T as je,O as Gt,b6 as Jr,C as Qr,I as _o,c1 as No,X as Ao,c9 as ya,dJ as ba,aP as Do,F as xa,G as Vn,bE as wa,bF as Sa,bG as Ea,bC as ka,aX as Mo,Z as Ta,aO as ja,cT as Oa,cU as Ca,bA as Ia,c0 as Ra,M as Zr,am as Bo,aq as Pa,b1 as ut,b7 as La,dq as _a,a9 as Fo,ac as $o,aV as Na,aj as Uo,V as kn,a1 as Aa,bv as qo,v as Wo,aU as Da,ar as Kt,c6 as Ma,c5 as Ba,bY as Si,Y as Ei,ah as Fa,du as $a,U as Ua,P as qa,S as Wa,ai as za,an as zo,H as ki,aI as Va,dK as Ka}from"./vendor-mui-core-BWI0_sKe.js";import{r as q,g as ei,u as Ga,i as Ha,e as Vo,p as Xa,a as Ut,d as Ya,f as Cn,j as Ja}from"./vendor-react-x2lQvn4m.js";import{r as ti,S as Qa,s as Ko,A as Za}from"./item-CT17goAk.js";import{n as yt,a as ni,e as Go,T as wt,I as bt,a7 as el,r as tl,A as Kn,H as Gn,as as Ti,m as Xt,o as Ho,$ as qn,E as Xo,c as nl,B as rl,aP as il}from"./vendor-ux-DVPR2iDY.js";import{_ as ln,f as $t,c as ol,c8 as sl,a_ as al,bO as Yo,c9 as ll,bK as cl,ca as ul,cb as dl,U as hl,M as Bt,bl as fl,$ as Jo,aC as pl,cc as ml,C as gl,cd as vl,Y as Hn,ce as Qo,b8 as Zo,k as Xn,a3 as ji,cf as yl,an as Mr,ac as bl,cg as xl,ch as wl,ci as In,cj as Oi,a$ as Sl}from"./index-B0xpDUsO.js";import{j as Ci,o as El,T as kl,L as Tl,P as jl}from"./vendor-arcblock-D026EX-Z.js";import{u as Ii}from"./launch-result-message-B0akHCFQ.js";import{a as es}from"./page-header-Dhv5B-BX.js";import{c as vt,B as Ol,C as Zt,J as Yn,D as Ri,R as ts,Q as Cl,a8 as Il,A as Rl,o as rr,U as Pl,am as Ll,an as _l,ao as Nl,a as yn,S as Al,b as Dl}from"./vendor-utils-Vke2d2wu.js";import{f as Br}from"./index-DBs9Ljax.js";import{e as Ml}from"./engine-CqzMzhBR.js";import{u as Bl,C as Fl}from"./config-space-D9QgW6OB.js";import{R as ir}from"./logo-uploader-C_Xk3axk.js";import{S as $l}from"./index-Iv2oisWn.js";import{a as ns,h as Ul,w as ql,f as Wl,b as zl,d as Vl,e as Kl,M as Gl}from"./index-BfwIRDCT.js";import{k as Tn,f as Hl,a as Xl,u as rs,g as Yl,q as Jl}from"./vendor-hooks-CFpNP5Ql.js";import{g as Ql}from"./get-safe-url-HSOeeYs_.js";import{r as Zl}from"./index-MGxe3V9B.js";import{r as ec}from"./cloneDeep-C4F9EbDd.js";import{u as ri}from"./useLocalStorage-DvM3QMYe.js";import{v as Pi}from"./index-Dy-MET-d.js";import{u as tc}from"./session-Bj1hMOts.js";import{W as nc}from"./did-address-6ebqvNNq.js";import{a as Li}from"./api-B7LEhzE2.js";import{v as rc,e as ic}from"./util-fjAejugL.js";import{u as is}from"./use-mobile-BmXUeM1i.js";import{C as oc}from"./content-layout-C0J5I0TX.js";import{C as sc,D as ac,a as lc}from"./connect-to-sTkrNSP4.js";import{d as or}from"./search-4YYphs0l.js";const Lf="blocklet-add-component-registry",_f="server-add-registry",Nf=e=>`resource-${e}-add-registry`;function os(e){const{info:t}=ln();return q.useMemo(()=>!e||!e.docker?.image||e.docker?.image&&e.docker?.runBaseScript?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork,[e,t])}function ss({disabled:e=!1,children:t,onConfirm:r}){return q.useEffect(()=>{if(e)return()=>{};const i=s=>{s.code==="Enter"&&(s.metaKey===!0||s.ctrlKey===!0)&&(s.preventDefault(),s.stopPropagation(),r())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e,r]),t}ss.propTypes={disabled:F.bool,children:F.any.isRequired,onConfirm:F.func.isRequired};function as({onContinue:e,nextDisabled:t=!1,launching:r=!1,texts:i={listenName:"",launchingText:"",buttonNext:""},description:s=""}){const[n,o]=q.useState(!1);return l.jsxs(l.Fragment,{children:[l.jsx(cc,{children:l.jsxs(ss,{disabled:t,onConfirm:e,children:[l.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),l.jsx(yt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?l.jsxs(l.Fragment,{children:[l.jsx(Tt,{size:14}),i.launchingText]}):i.buttonNext})]})}),l.jsx(ni,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:F.func.isRequired,nextDisabled:F.bool,launching:F.bool,description:F.any,texts:F.object};const cc=it.div`
|
|
2
2
|
margin: 0 auto;
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -28,7 +28,7 @@ import{$ as F,j as l,p as Tt,ar as it,ak as oe,J as qt,T as je,O as Kt,bt as Jr,
|
|
|
28
28
|
min-width: 200px;
|
|
29
29
|
}
|
|
30
30
|
`;var Rn={exports:{}},sr,_i;function uc(){if(_i)return sr;_i=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,i=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,n=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,d=`
|
|
31
|
-
`,h="/",u="*",f="",j="comment",m="declaration";sr=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var _=1,N=1;function D(H){var A=H.match(t);A&&(_+=A.length);var X=H.lastIndexOf(d);N=~X?H.length-X:N+H.length}function c(){var H={line:_,column:N};return function(A){return A.position=new w(H),M(),A}}function w(H){this.start=H,this.end={line:_,column:N},this.source=C.source}w.prototype.content=S;function R(H){var A=new Error(C.source+":"+_+":"+N+": "+H);if(A.reason=H,A.filename=C.source,A.line=_,A.column=N,A.source=S,!C.silent)throw A}function B(H){var A=H.exec(S);if(A){var X=A[0];return D(X),S=S.slice(X.length),A}}function M(){B(r)}function re(H){var A;for(H=H||[];A=Z();)A!==!1&&H.push(A);return H}function Z(){var H=c();if(!(h!=S.charAt(0)||u!=S.charAt(1))){for(var A=2;f!=S.charAt(A)&&(u!=S.charAt(A)||h!=S.charAt(A+1));)++A;if(A+=2,f===S.charAt(A-1))return R("End of comment missing");var X=S.slice(2,A-2);return N+=2,D(X),S=S.slice(A),N+=2,H({type:j,comment:X})}}function z(){var H=c(),A=B(i);if(A){if(Z(),!B(s))return R("property missing ':'");var X=B(n),$=H({type:m,property:E(A[0].replace(e,f)),value:X?E(X[0].replace(e,f)):f});return B(o),$}}function W(){var H=[];re(H);for(var A;A=z();)A!==!1&&(H.push(A),re(H));return H}return M(),W()};function E(S){return S?S.replace(a,f):f}return sr}var Ni;function dc(){if(Ni)return Rn.exports;Ni=1;var e=uc();function t(r,i){var s=null;if(!r||typeof r!="string")return s;for(var n,o=e(r),a=typeof i=="function",d,h,u=0,f=o.length;u<f;u++)n=o[u],d=n.property,h=n.value,a?i(d,h,n):h&&(s||(s={}),s[d]=h);return s}return Rn.exports=t,Rn.exports.default=t,Rn.exports}var hc=dc();const fc=ei(hc),pc={}.hasOwnProperty;function mc(e,t,r){if(typeof e!="function")throw new TypeError("h is not a function");const i=vc(e),s=xc(e),n=bc(e);let o,a;if(typeof r=="string"||typeof r=="boolean"?(o=r,r={}):(r||(r={}),o=r.prefix),t&&t.type==="root"){const d=t.children[0];a=t.children.length===1&&d.type==="element"?d:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")a=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ls(e,a,{schema:r.space==="svg"?ns:Ul,prefix:o==null?i||s||n?"h-":void 0:typeof o=="string"?o:o?"h-":void 0,key:0,react:i,vue:s,vdom:n,hyperscript:yc(e)})}function ls(e,t,r){const i=r.schema;let s=i,n=t.tagName;const o={},a=[];let d=-1,h;i.space==="html"&&n.toLowerCase()==="svg"&&(s=ns,r.schema=s);for(h in t.properties)t.properties&&pc.call(t.properties,h)&&gc(o,h,t.properties[h],r,n);if(r.vdom&&(s.space==="html"?n=n.toUpperCase():s.space&&(o.namespace=ql[s.space])),r.prefix&&(r.key++,o.key=r.prefix+r.key),t.children)for(;++d<t.children.length;){const u=t.children[d];u.type==="element"?a.push(ls(e,u,r)):u.type==="text"&&a.push(u.value)}return r.schema=i,a.length>0?e.call(t,n,o,a):e.call(t,n,o)}function gc(e,t,r,i,s){const n=Wl(i.schema,t);let o;r==null||typeof r=="number"&&Number.isNaN(r)||r===!1&&(i.vue||i.vdom||i.hyperscript)||!r&&n.boolean&&(i.vue||i.vdom||i.hyperscript)||(Array.isArray(r)&&(r=n.commaSeparated?zl(r):Vl(r)),n.boolean&&i.hyperscript&&(r=""),n.property==="style"&&typeof r=="string"&&(i.react||i.vue||i.vdom)&&(r=wc(r,s)),i.vue?n.property!=="style"&&(o="attrs"):n.mustUseProperty||(i.vdom?n.property!=="style"&&(o="attributes"):i.hyperscript&&(o="attrs")),o?e[o]=Object.assign(e[o]||{},{[n.attribute]:r}):n.space&&i.react?e[
|
|
31
|
+
`,h="/",u="*",f="",j="comment",m="declaration";sr=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var _=1,N=1;function D(H){var A=H.match(t);A&&(_+=A.length);var X=H.lastIndexOf(d);N=~X?H.length-X:N+H.length}function c(){var H={line:_,column:N};return function(A){return A.position=new w(H),M(),A}}function w(H){this.start=H,this.end={line:_,column:N},this.source=C.source}w.prototype.content=S;function R(H){var A=new Error(C.source+":"+_+":"+N+": "+H);if(A.reason=H,A.filename=C.source,A.line=_,A.column=N,A.source=S,!C.silent)throw A}function B(H){var A=H.exec(S);if(A){var X=A[0];return D(X),S=S.slice(X.length),A}}function M(){B(r)}function re(H){var A;for(H=H||[];A=Z();)A!==!1&&H.push(A);return H}function Z(){var H=c();if(!(h!=S.charAt(0)||u!=S.charAt(1))){for(var A=2;f!=S.charAt(A)&&(u!=S.charAt(A)||h!=S.charAt(A+1));)++A;if(A+=2,f===S.charAt(A-1))return R("End of comment missing");var X=S.slice(2,A-2);return N+=2,D(X),S=S.slice(A),N+=2,H({type:j,comment:X})}}function z(){var H=c(),A=B(i);if(A){if(Z(),!B(s))return R("property missing ':'");var X=B(n),$=H({type:m,property:E(A[0].replace(e,f)),value:X?E(X[0].replace(e,f)):f});return B(o),$}}function W(){var H=[];re(H);for(var A;A=z();)A!==!1&&(H.push(A),re(H));return H}return M(),W()};function E(S){return S?S.replace(a,f):f}return sr}var Ni;function dc(){if(Ni)return Rn.exports;Ni=1;var e=uc();function t(r,i){var s=null;if(!r||typeof r!="string")return s;for(var n,o=e(r),a=typeof i=="function",d,h,u=0,f=o.length;u<f;u++)n=o[u],d=n.property,h=n.value,a?i(d,h,n):h&&(s||(s={}),s[d]=h);return s}return Rn.exports=t,Rn.exports.default=t,Rn.exports}var hc=dc();const fc=ei(hc),pc={}.hasOwnProperty;function mc(e,t,r){if(typeof e!="function")throw new TypeError("h is not a function");const i=vc(e),s=xc(e),n=bc(e);let o,a;if(typeof r=="string"||typeof r=="boolean"?(o=r,r={}):(r||(r={}),o=r.prefix),t&&t.type==="root"){const d=t.children[0];a=t.children.length===1&&d.type==="element"?d:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")a=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return ls(e,a,{schema:r.space==="svg"?ns:Ul,prefix:o==null?i||s||n?"h-":void 0:typeof o=="string"?o:o?"h-":void 0,key:0,react:i,vue:s,vdom:n,hyperscript:yc(e)})}function ls(e,t,r){const i=r.schema;let s=i,n=t.tagName;const o={},a=[];let d=-1,h;i.space==="html"&&n.toLowerCase()==="svg"&&(s=ns,r.schema=s);for(h in t.properties)t.properties&&pc.call(t.properties,h)&&gc(o,h,t.properties[h],r,n);if(r.vdom&&(s.space==="html"?n=n.toUpperCase():s.space&&(o.namespace=ql[s.space])),r.prefix&&(r.key++,o.key=r.prefix+r.key),t.children)for(;++d<t.children.length;){const u=t.children[d];u.type==="element"?a.push(ls(e,u,r)):u.type==="text"&&a.push(u.value)}return r.schema=i,a.length>0?e.call(t,n,o,a):e.call(t,n,o)}function gc(e,t,r,i,s){const n=Wl(i.schema,t);let o;r==null||typeof r=="number"&&Number.isNaN(r)||r===!1&&(i.vue||i.vdom||i.hyperscript)||!r&&n.boolean&&(i.vue||i.vdom||i.hyperscript)||(Array.isArray(r)&&(r=n.commaSeparated?zl(r):Vl(r)),n.boolean&&i.hyperscript&&(r=""),n.property==="style"&&typeof r=="string"&&(i.react||i.vue||i.vdom)&&(r=wc(r,s)),i.vue?n.property!=="style"&&(o="attrs"):n.mustUseProperty||(i.vdom?n.property!=="style"&&(o="attributes"):i.hyperscript&&(o="attrs")),o?e[o]=Object.assign(e[o]||{},{[n.attribute]:r}):n.space&&i.react?e[Kl[n.property]||n.property]=r:e[n.attribute]=r)}function vc(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function yc(e){return"context"in e&&"cleanup"in e}function bc(e){return e("div",{}).type==="VirtualNode"}function xc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function wc(e,t){const r={};try{fc(e,(i,s)=>{i.slice(0,4)==="-ms-"&&(i="ms-"+i.slice(4)),r[i.replace(/-([a-z])/g,(n,o)=>o.toUpperCase())]=s})}catch(i){const s=i;throw s.message=t+"[style]"+s.message.slice(9),s}return r}var ar,Ai;function Sc(){if(Ai)return ar;Ai=1,ar=e;function e(o){if(typeof o=="string")return s(o);if(o==null)return n;if(typeof o=="object")return("length"in o?i:r)(o);if(typeof o=="function")return o;throw new Error("Expected function, string, or object as test")}function t(o){for(var a=[],d=o.length,h=-1;++h<d;)a[h]=e(o[h]);return a}function r(o){return a;function a(d){var h;for(h in o)if(d[h]!==o[h])return!1;return!0}}function i(o){var a=t(o),d=a.length;return h;function h(){for(var u=-1;++u<d;)if(a[u].apply(this,arguments))return!0;return!1}}function s(o){return a;function a(d){return!!(d&&d.type===o)}}function n(){return!0}return ar}var lr,Di;function Ec(){if(Di)return lr;Di=1,lr=s;var e=Sc(),t=!0,r="skip",i=!1;s.CONTINUE=t,s.SKIP=r,s.EXIT=i;function s(o,a,d,h){var u;typeof a=="function"&&typeof d!="function"&&(h=d,d=a,a=null),u=e(a),f(o,null,[]);function f(m,E,S){var C=[],_;return(!a||u(m,E,S[S.length-1]||null))&&(C=n(d(m,S)),C[0]===i)?C:m.children&&C[0]!==r?(_=n(j(m.children,S.concat(m))),_[0]===i?_:C):C}function j(m,E){for(var S=-1,C=h?-1:1,_=(h?m.length:S)+C,N;_>S&&_<m.length;){if(N=f(m[_],_,E),N[0]===i)return N;_=typeof N[1]=="number"?N[1]:_+C}}}function n(o){return o!==null&&typeof o=="object"&&"length"in o?o:typeof o=="number"?[t,o]:[o]}return lr}var cr,Mi;function kc(){if(Mi)return cr;Mi=1,cr=s;var e=Ec(),t=e.CONTINUE,r=e.SKIP,i=e.EXIT;s.CONTINUE=t,s.SKIP=r,s.EXIT=i;function s(n,o,a,d){typeof o=="function"&&typeof a!="function"&&(d=a,a=o,o=null),e(n,o,h,d);function h(u,f){var j=f[f.length-1],m=j?j.children.indexOf(u):null;return a(u,m,j)}}return cr}var ur,Bi;function Tc(){if(Bi)return ur;Bi=1;var e=kc(),t=Object.prototype.hasOwnProperty,r={align:"text-align",valign:"vertical-align",height:"height",width:"width"};ur=function(o){return e(o,"element",i),o};function i(n){if(!(n.tagName!=="tr"&&n.tagName!=="td"&&n.tagName!=="th")){var o,a;for(o in r)!t.call(r,o)||n.properties[o]===void 0||(a=r[o],s(n,a,n.properties[o]),delete n.properties[o])}}function s(n,o,a){var d=(n.properties.style||"").trim();d&&!/;\s*/.test(d)&&(d+=";"),d&&(d+=" ");var h=d+o+": "+a+";";n.properties.style=h}return ur}var jc=Tc();const Oc=ei(jc);function Cc(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 Ic={}.hasOwnProperty,Rc=new Set(["table","thead","tbody","tfoot","tr"]);function Pc(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,r=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:i});function i(n){let o=mc(s,r?Oc(n):n,e.prefix);return n.type==="root"?(o=o&&typeof o=="object"&&"type"in o&&"props"in o&&o.type==="div"&&(n.children.length!==1||n.children[0].type!=="element")?o.props.children:[o],t(e.Fragment||"div",{},o)):o}function s(n,o,a){if(a&&Rc.has(n)&&(a=a.filter(d=>!Cc(d))),e.components&&Ic.call(e.components,n)){const d=e.components[n];return e.passNode&&typeof d=="function"&&(o=Object.assign({node:this},o)),t(d,o,a)}return t(n,o,a)}}function cs({children:e}){return l.jsx(Lc,{children:e})}const Fi="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",Lc=it(oe)`
|
|
32
32
|
.highlight pre,
|
|
33
33
|
pre {
|
|
34
34
|
border-radius: 5px;
|
|
@@ -62,7 +62,7 @@ import{$ as F,j as l,p as Tt,ar as it,ak as oe,J as qt,T as je,O as Kt,bt as Jr,
|
|
|
62
62
|
.anchor {
|
|
63
63
|
display: none;
|
|
64
64
|
}
|
|
65
|
-
`;cs.propTypes={children:F.any.isRequired};function us({infoList:e=[]}){return l.jsx(oe,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>l.jsxs(l.Fragment,{children:[l.jsx(oe,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),l.jsx(oe,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}us.propTypes={infoList:F.arrayOf(F.shape({key:F.string,value:F.string}))};const _c=e=>e.payment?(e.payment.price||[]).map(t=>t.value||0).every(t=>t===0):!0,Nc=new Pc({createElement:q.createElement}).Compiler,Pt={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ds({blockletMeta:e,locale:t,handleDescEle:r=""}){const{data:i}=e,s=qt(),{registryUrl:n,did:o}=i,a=$t.getDisplayName({meta:i}),d=Tn(()=>n&&o?fetch(
|
|
65
|
+
`;cs.propTypes={children:F.any.isRequired};function us({infoList:e=[]}){return l.jsx(oe,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>l.jsxs(l.Fragment,{children:[l.jsx(oe,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),l.jsx(oe,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}us.propTypes={infoList:F.arrayOf(F.shape({key:F.string,value:F.string}))};const _c=e=>e.payment?(e.payment.price||[]).map(t=>t.value||0).every(t=>t===0):!0,Nc=new Pc({createElement:q.createElement}).Compiler,Pt={zh:{appinfo:{name:"应用名",version:"版本号",author:"开发者",description:"描述",community:"社区地址",documentation:"文档手册",support:"服务支持",overview:"概述",requirements:"节点版本要求"}},en:{appinfo:{name:"Name",version:"Version",author:"Author",description:"Description",community:"Community",documentation:"Documentation",support:"Support",overview:"Overview",requirements:"Server requirements"}}};function ds({blockletMeta:e,locale:t,handleDescEle:r=""}){const{data:i}=e,s=qt(),{registryUrl:n,did:o}=i,a=$t.getDisplayName({meta:i}),d=Tn(()=>n&&o?fetch(Ci(n,"/api/blocklets",o,"readme")).then(S=>S.json()):null,{refreshDeps:[n,o]}),h=Hl(()=>d.data?d.data[t]||d.data.en||d.data[Object.keys(d.data)[0]]:"",[d]),u=i&&i.htmlAst?Nc(i.htmlAst):"",f=_c(i);let j=vt(i,"owner.fullName");if(j){const S=vt(i,"owner.did");S&&(j=l.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:1},children:[j,l.jsx(Go,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else j=vt(i,"author.name");const m=[{key:vt(Pt[t],"appinfo.name"),value:$t.getDisplayName({meta:i})},{key:vt(Pt[t],"appinfo.version"),value:i.version},{key:vt(Pt[t],"appinfo.author"),value:j},{type:"description",key:vt(Pt[t],"appinfo.description"),value:i.description}];i.requirements&&m.push({key:vt(Pt[t],"appinfo.requirements"),value:i.requirements.server}),i.community&&m.push({key:vt(Pt[t],"appinfo.community"),value:l.jsx("a",{href:i.community,target:"_blank",rel:"noreferrer",children:i.community})}),i.documentation&&m.push({key:vt(Pt[t],"appinfo.documentation"),value:l.jsx("a",{href:i.documentation,target:"_blank",rel:"noreferrer",children:i.documentation})}),i.support&&m.push({key:vt(Pt[t],"appinfo.support"),value:l.jsx("a",{href:`mailto:${i.support}`,target:"_blank",rel:"noreferrer",children:i.support})}),u&&m.push({key:vt(Pt[t],"appinfo.overview"),value:""});let E;return t==="zh"?E=l.jsxs(l.Fragment,{children:[f?l.jsxs("p",{children:["您可以免费使用 ",l.jsx("b",{children:a}),";"]}):l.jsxs("p",{children:["您需要购买才能使用 ",l.jsx("b",{children:a}),";"]}),l.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),l.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),l.jsx("p",{children:"下面为该应用的信息:"})]}):E=l.jsxs(l.Fragment,{children:[f?l.jsxs("p",{children:["You can use ",l.jsx("b",{children:a})," for free;"]}):l.jsxs("p",{children:["You need to purchase before launch ",l.jsx("b",{children:a}),";"]}),l.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),l.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),l.jsx("p",{children:"Below is the information for the blocklet: "})]}),l.jsxs(Dc,{children:[r||E,l.jsx(us,{infoList:m}),h?l.jsxs("div",{className:"app-overview",children:[l.jsx(je,{variant:"h5",gutterBottom:!0,children:vt(Pt[t],"appinfo.overview")}),l.jsx(cs,{children:l.jsx(Ac,{component:"div",className:"content-wrapper post-content",children:l.jsx(Gl,{source:h,wrapperElement:{"data-color-mode":s.palette.mode},urlTransform:(S,C,_)=>S.startsWith("/")?Ci(n,S):S})})})]}):u?l.jsx("div",{className:"app-overview",children:u}):null]})}const Ac=it(je)`
|
|
66
66
|
width: 100%;
|
|
67
67
|
word-wrap: break-word;
|
|
68
68
|
word-break: break-word;
|
|
@@ -113,7 +113,7 @@ import{$ as F,j as l,p as Tt,ar as it,ak as oe,J as qt,T as je,O as Kt,bt as Jr,
|
|
|
113
113
|
.wmde-markdown[data-color-mode='dark'] {
|
|
114
114
|
background: transparent;
|
|
115
115
|
}
|
|
116
|
-
`;ds.propTypes={blockletMeta:F.object.isRequired,locale:F.string.isRequired,handleDescEle:F.node};function Mc({...e}){return l.jsxs("div",{...e,style:{width:"100%"},children:[l.jsx("h3",{children:"End User License Agreement for Application"}),l.jsxs("p",{children:["Blocklet Server License Agreement ",
|
|
116
|
+
`;ds.propTypes={blockletMeta:F.object.isRequired,locale:F.string.isRequired,handleDescEle:F.node};function Mc({...e}){return l.jsxs("div",{...e,style:{width:"100%"},children:[l.jsx("h3",{children:"End User License Agreement for Application"}),l.jsxs("p",{children:["Blocklet Server License Agreement ",ol.COPYRIGHT_OWNER," version 2020-08-28"]}),l.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),l.jsx("p",{children:"暂无"})]})}function Bc(e){return`${e.bundleSource?.store||e.meta.homepage}/assets/${e.meta?.did}/${e.meta?.logo||"logo.png"}?v=${e.meta?.version}`}function hs({installRelated:e=!1,meta:t=null,show:r=!1,onClose:i,components:s,loading:n}){const{t:o}=wt(),a=Gt(f=>f.breakpoints.down("md"));if(!r)return null;const d=!n&&s.length===0,h=!n&&s.length!==0,u=40;return l.jsxs(ni,{title:o("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(f,j)=>{j!=="backdropClick"&&i(!1)},PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[n&&l.jsx(oe,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:l.jsx(oe,{component:bt,icon:"line-md:loading-loop",sx:{color:"primary.main",fontSize:32}})}),d&&l.jsx(oe,{sx:{textAlign:"center"},children:o("blocklet.component.noDependencies",{name:t.title})}),h&&l.jsx(oe,{sx:{marginBottom:2},children:s.map(f=>{if(!f.meta)return null;const{required:j}=f;let m;return e||j?m=1:m=.5,l.jsxs(oe,{sx:{opacity:m,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[l.jsx("img",{style:{width:u,height:u,minWidth:u,minHeight:u},src:Bc(f),alt:f.meta.title}),l.jsxs(oe,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[l.jsxs(oe,{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:()=>{window.open(Ql(`${f.bundleSource?.store||f.meta.homepage}/blocklets/${f.meta.did}`,{allowDomains:null}),"_blank")},children:[f.meta.title,l.jsx(oe,{sx:{display:j?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:o("blocklet.component.required")}),l.jsxs(oe,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[f.meta.version,l.jsx(oe,{className:"link-icon",icon:"fluent:open-20-filled",component:bt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),l.jsx(oe,{sx:{marginTop:0,opacity:.7},children:f.meta.description})]})]},f.meta.did)})})]})}hs.propTypes={meta:F.object,show:F.bool,onClose:F.func.isRequired,installRelated:F.func,components:F.array.isRequired,loading:F.bool.isRequired};function Fc(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e?.did}/blocklet.json`:""}function $c(e){const{api:t}=ln(),[r]=Ga(),i=r.get("blocklet_meta_url")||Fc(e),[s,n]=q.useState([]),[o,a]=q.useState(!1);return q.useEffect(()=>{!i||e?.inputUrl||(a(!0),t.getDynamicComponents({input:{url:i}}).then(d=>{n(d.components)}).finally(()=>{a(!1)}))},[i]),{components:s,loading:o}}function fs({installRelated:e=!0,onChangeInstallRelated:t=null,meta:r,onClickNext:i=null,handleDescEle:s=""}){const n=Ha(),{t:o,locale:a}=wt(),[d,h]=q.useState(!1),{components:u,loading:f}=$c(r),j=os(r),m=i||(()=>{n(`/launch-blocklet/install${window.location.search}`)}),E=()=>{h(!0)},S=()=>{h(!1)};return l.jsxs(Uc,{children:[l.jsx("div",{className:"app-content",children:l.jsx("div",{className:"agreement",children:l.jsx("div",{className:"agreement-content",children:j?l.jsx(ds,{blockletMeta:{data:r},locale:a,handleDescEle:s}):l.jsx(oe,{sx:{p:3},children:l.jsx(je,{children:o("launchBlocklet.dockerBlockletCantInstall")})})})})}),l.jsxs(oe,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[f?l.jsx(bt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,j&&t&&u?.length?l.jsxs(oe,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[l.jsx(Jr,{sx:{mr:.5},checked:e,onChange:C=>t(C.currentTarget.checked),control:l.jsx(Qr,{}),label:l.jsx("span",{children:o("launchBlocklet.installRelatedComponents")})}),l.jsx(oe,{sx:{"> button svg":{color:"primary.main"}},children:l.jsx(_o,{size:"small",onClick:E,children:l.jsx(bt,{icon:"octicon:package-dependencies-16"})})})]}):null,l.jsx("div",{className:"button-container","data-cy":"agree-all",children:j?l.jsx(as,{onContinue:m,description:l.jsx(Mc,{}),texts:{listenName:o("launchBlocklet.license"),buttonNext:o("launchBlocklet.next")}}):null})]}),l.jsx(hs,{installRelated:e,meta:r,show:d,onClose:S,components:u,loading:f})]})}fs.propTypes={meta:F.object.isRequired,onClickNext:F.func,handleDescEle:F.node,installRelated:F.bool,onChangeInstallRelated:F.func};const Uc=it.div`
|
|
117
117
|
display: flex;
|
|
118
118
|
flex-direction: column;
|
|
119
119
|
align-items: center;
|
|
@@ -189,7 +189,7 @@ import{$ as F,j as l,p as Tt,ar as it,ak as oe,J as qt,T as je,O as Kt,bt as Jr,
|
|
|
189
189
|
padding-bottom: 16px;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
`;var kt={},Pn={exports:{}},dr={exports:{}},$i;function ps(){if($i)return dr.exports;$i=1;var e=dr.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(i){return"file-"+r(i)}}},t={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:r};Object.keys(e).forEach(function(i){Object.keys(t).forEach(function(s){e[i][s]||(e[i][s]=t[s])}),e[i].protocols_re=RegExp("^("+e[i].protocols.map(function(s){return s.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function r(i){return i.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}return dr.exports}var hr,Ui;function qc(){if(Ui)return hr;Ui=1;var e=ps(),t=Object.assign||function(s,n){if(n===null||typeof n!="object")return s;const o=Object.keys(n);let a=o.length;for(;a--;)s[o[a]]=n[o[a]];return s};hr=r;function r(i,s,n,o,a,d,h){var u=this;u.type=i,Object.keys(e[i]).forEach(function(f){u[f]=e[i][f]}),u.user=s,u.auth=n,u.project=o,u.committish=a,u.default=d,u.opts=h||{}}return r.prototype.hash=function(){return this.committish?"#"+this.committish:""},r.prototype._fill=function(i,s){if(i){var n=t({},s);n.path=n.path?n.path.replace(/^[/]+/g,""):"",s=t(t({},this.opts),s);var o=this;Object.keys(this).forEach(function(m){o[m]!=null&&n[m]==null&&(n[m]=o[m])});var a=n.auth,d=n.committish,h=n.fragment,u=n.path,f=n.project;Object.keys(n).forEach(function(m){var E=n[m];(m==="path"||m==="project")&&typeof E=="string"?n[m]=E.split("/").map(function(S){return encodeURIComponent(S)}).join("/"):m!=="domain"&&(n[m]=encodeURIComponent(E))}),n["auth@"]=a?a+"@":"",n["#fragment"]=h?"#"+this.hashformat(h):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=u?"#"+this.hashformat(u):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),s.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=d?"#"+d:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var j=i;return Object.keys(n).forEach(function(m){j=j.replace(new RegExp("[{]"+m+"[}]","g"),n[m])}),s.noGitPlus?j.replace(/^git[+]/,""):j}},r.prototype.ssh=function(i){return this._fill(this.sshtemplate,i)},r.prototype.sshurl=function(i){return this._fill(this.sshurltemplate,i)},r.prototype.browse=function(i,s,n){return typeof i=="string"?(typeof s!="string"&&(n=s,s=null),this._fill(this.browsefiletemplate,t({fragment:s,path:i},n))):this._fill(this.browsetemplate,i)},r.prototype.docs=function(i){return this._fill(this.docstemplate,i)},r.prototype.bugs=function(i){return this._fill(this.bugstemplate,i)},r.prototype.https=function(i){return this._fill(this.httpstemplate,i)},r.prototype.git=function(i){return this._fill(this.gittemplate,i)},r.prototype.shortcut=function(i){return this._fill(this.shortcuttemplate,i)},r.prototype.path=function(i){return this._fill(this.pathtemplate,i)},r.prototype.tarball=function(i){var s=t({},i,{noCommittish:!1});return this._fill(this.tarballtemplate,s)},r.prototype.file=function(i,s){return this._fill(this.filetemplate,t({path:i},s))},r.prototype.getDefaultRepresentation=function(){return this.default},r.prototype.toString=function(i){return this.default&&typeof this[this.default]=="function"?this[this.default](i):this.sshurl(i)},hr}var fr,qi;function Wc(){return qi||(qi=1,fr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),fr}var pr,Wi;function zc(){if(Wi)return pr;Wi=1,pr=e,e.Node=s,e.create=e;function e(n){var o=this;if(o instanceof e||(o=new e),o.tail=null,o.head=null,o.length=0,n&&typeof n.forEach=="function")n.forEach(function(h){o.push(h)});else if(arguments.length>0)for(var a=0,d=arguments.length;a<d;a++)o.push(arguments[a]);return o}e.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var o=n.next,a=n.prev;return o&&(o.prev=a),a&&(a.next=o),n===this.head&&(this.head=o),n===this.tail&&(this.tail=a),n.list.length--,n.next=null,n.prev=null,n.list=null,o},e.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var o=this.head;n.list=this,n.next=o,o&&(o.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}},e.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var o=this.tail;n.list=this,n.prev=o,o&&(o.next=n),this.tail=n,this.head||(this.head=n),this.length++}},e.prototype.push=function(){for(var n=0,o=arguments.length;n<o;n++)r(this,arguments[n]);return this.length},e.prototype.unshift=function(){for(var n=0,o=arguments.length;n<o;n++)i(this,arguments[n]);return this.length},e.prototype.pop=function(){if(this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}},e.prototype.shift=function(){if(this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}},e.prototype.forEach=function(n,o){o=o||this;for(var a=this.head,d=0;a!==null;d++)n.call(o,a.value,d,this),a=a.next},e.prototype.forEachReverse=function(n,o){o=o||this;for(var a=this.tail,d=this.length-1;a!==null;d--)n.call(o,a.value,d,this),a=a.prev},e.prototype.get=function(n){for(var o=0,a=this.head;a!==null&&o<n;o++)a=a.next;if(o===n&&a!==null)return a.value},e.prototype.getReverse=function(n){for(var o=0,a=this.tail;a!==null&&o<n;o++)a=a.prev;if(o===n&&a!==null)return a.value},e.prototype.map=function(n,o){o=o||this;for(var a=new e,d=this.head;d!==null;)a.push(n.call(o,d.value,this)),d=d.next;return a},e.prototype.mapReverse=function(n,o){o=o||this;for(var a=new e,d=this.tail;d!==null;)a.push(n.call(o,d.value,this)),d=d.prev;return a},e.prototype.reduce=function(n,o){var a,d=this.head;if(arguments.length>1)a=o;else if(this.head)d=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;d!==null;h++)a=n(a,d.value,h),d=d.next;return a},e.prototype.reduceReverse=function(n,o){var a,d=this.tail;if(arguments.length>1)a=o;else if(this.tail)d=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;d!==null;h--)a=n(a,d.value,h),d=d.prev;return a},e.prototype.toArray=function(){for(var n=new Array(this.length),o=0,a=this.head;a!==null;o++)n[o]=a.value,a=a.next;return n},e.prototype.toArrayReverse=function(){for(var n=new Array(this.length),o=0,a=this.tail;a!==null;o++)n[o]=a.value,a=a.prev;return n},e.prototype.slice=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(;h!==null&&d<o;d++,h=h.next)a.push(h.value);return a},e.prototype.sliceReverse=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=this.length,h=this.tail;h!==null&&d>o;d--)h=h.prev;for(;h!==null&&d>n;d--,h=h.prev)a.push(h.value);return a},e.prototype.splice=function(n,o,...a){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(var u=[],d=0;h&&d<o;d++)u.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var d=0;d<a.length;d++)h=t(this,h,a[d]);return u},e.prototype.reverse=function(){for(var n=this.head,o=this.tail,a=n;a!==null;a=a.prev){var d=a.prev;a.prev=a.next,a.next=d}return this.head=o,this.tail=n,this};function t(n,o,a){var d=o===n.head?new s(a,null,o,n):new s(a,o,o.next,n);return d.next===null&&(n.tail=d),d.prev===null&&(n.head=d),n.length++,d}function r(n,o){n.tail=new s(o,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function i(n,o){n.head=new s(o,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function s(n,o,a,d){if(!(this instanceof s))return new s(n,o,a,d);this.list=d,this.value=n,o?(o.next=this,this.prev=o):this.prev=null,a?(a.prev=this,this.next=a):this.next=null}try{Wc()(e)}catch{}return pr}var mr,zi;function Vc(){if(zi)return mr;zi=1;const e=zc(),t=Symbol("max"),r=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),n=Symbol("maxAge"),o=Symbol("dispose"),a=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),u=Symbol("updateAgeOnGet"),f=()=>1;class j{constructor(c){if(typeof c=="number"&&(c={max:c}),c||(c={}),c.max&&(typeof c.max!="number"||c.max<0))throw new TypeError("max must be a non-negative number");this[t]=c.max||1/0;const w=c.length||f;if(this[i]=typeof w!="function"?f:w,this[s]=c.stale||!1,c.maxAge&&typeof c.maxAge!="number")throw new TypeError("maxAge must be a number");this[n]=c.maxAge||0,this[o]=c.dispose,this[a]=c.noDisposeOnSet||!1,this[u]=c.updateAgeOnGet||!1,this.reset()}set max(c){if(typeof c!="number"||c<0)throw new TypeError("max must be a non-negative number");this[t]=c||1/0,S(this)}get max(){return this[t]}set allowStale(c){this[s]=!!c}get allowStale(){return this[s]}set maxAge(c){if(typeof c!="number")throw new TypeError("maxAge must be a non-negative number");this[n]=c,S(this)}get maxAge(){return this[n]}set lengthCalculator(c){typeof c!="function"&&(c=f),c!==this[i]&&(this[i]=c,this[r]=0,this[d].forEach(w=>{w.length=this[i](w.value,w.key),this[r]+=w.length})),S(this)}get lengthCalculator(){return this[i]}get length(){return this[r]}get itemCount(){return this[d].length}rforEach(c,w){w=w||this;for(let R=this[d].tail;R!==null;){const B=R.prev;N(this,c,R,w),R=B}}forEach(c,w){w=w||this;for(let R=this[d].head;R!==null;){const B=R.next;N(this,c,R,w),R=B}}keys(){return this[d].toArray().map(c=>c.key)}values(){return this[d].toArray().map(c=>c.value)}reset(){this[o]&&this[d]&&this[d].length&&this[d].forEach(c=>this[o](c.key,c.value)),this[h]=new Map,this[d]=new e,this[r]=0}dump(){return this[d].map(c=>E(this,c)?!1:{k:c.key,v:c.value,e:c.now+(c.maxAge||0)}).toArray().filter(c=>c)}dumpLru(){return this[d]}set(c,w,R){if(R=R||this[n],R&&typeof R!="number")throw new TypeError("maxAge must be a number");const B=R?Date.now():0,M=this[i](w,c);if(this[h].has(c)){if(M>this[t])return C(this,this[h].get(c)),!1;const z=this[h].get(c).value;return this[o]&&(this[a]||this[o](c,z.value)),z.now=B,z.maxAge=R,z.value=w,this[r]+=M-z.length,z.length=M,this.get(c),S(this),!0}const re=new _(c,w,M,B,R);return re.length>this[t]?(this[o]&&this[o](c,w),!1):(this[r]+=re.length,this[d].unshift(re),this[h].set(c,this[d].head),S(this),!0)}has(c){if(!this[h].has(c))return!1;const w=this[h].get(c).value;return!E(this,w)}get(c){return m(this,c,!0)}peek(c){return m(this,c,!1)}pop(){const c=this[d].tail;return c?(C(this,c),c.value):null}del(c){C(this,this[h].get(c))}load(c){this.reset();const w=Date.now();for(let R=c.length-1;R>=0;R--){const B=c[R],M=B.e||0;if(M===0)this.set(B.k,B.v);else{const re=M-w;re>0&&this.set(B.k,B.v,re)}}}prune(){this[h].forEach((c,w)=>m(this,w,!1))}}const m=(D,c,w)=>{const R=D[h].get(c);if(R){const B=R.value;if(E(D,B)){if(C(D,R),!D[s])return}else w&&(D[u]&&(R.value.now=Date.now()),D[d].unshiftNode(R));return B.value}},E=(D,c)=>{if(!c||!c.maxAge&&!D[n])return!1;const w=Date.now()-c.now;return c.maxAge?w>c.maxAge:D[n]&&w>D[n]},S=D=>{if(D[r]>D[t])for(let c=D[d].tail;D[r]>D[t]&&c!==null;){const w=c.prev;C(D,c),c=w}},C=(D,c)=>{if(c){const w=c.value;D[o]&&D[o](w.key,w.value),D[r]-=w.length,D[h].delete(w.key),D[d].removeNode(c)}};class _{constructor(c,w,R,B,M){this.key=c,this.value=w,this.length=R,this.now=B,this.maxAge=M||0}}const N=(D,c,w,R)=>{let B=w.value;E(D,B)&&(C(D,w),D[s]||(B=void 0)),B&&c.call(R,B.value,B.key,D)};return mr=j,mr}var Vi;function Gc(){if(Vi)return Pn.exports;Vi=1;var e=Ol,t=ps(),r=Pn.exports=qc(),i=Vc(),s=new i({max:1e3}),n={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function o(j){return n[j]||j.slice(0,-1)}var a={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Pn.exports.fromUrl=function(j,m){if(typeof j=="string"){var E=j+JSON.stringify(m||{});return s.has(E)||s.set(E,d(j,m)),s.get(E)}};function d(j,m){if(!(j==null||j==="")){var E=u(h(j)?"github:"+j:j),S=f(E),C=E.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),_=Object.keys(t).map(function(N){try{var D=t[N],c=null;S.auth&&a[S.protocol]&&(c=S.auth);var w=S.hash?decodeURIComponent(S.hash.substr(1)):null,R=null,B=null,M=null;if(C&&C[1]===N)R=C[2]&&decodeURIComponent(C[2]),B=decodeURIComponent(C[3].replace(/\.git$/,"")),M="shortcut";else{if(S.host&&S.host!==D.domain&&S.host.replace(/^www[.]/,"")!==D.domain||!D.protocols_re.test(S.protocol)||!S.path)return;var re=D.pathmatch,Z=S.path.match(re);if(!Z)return;Z[1]!==null&&Z[1]!==void 0&&(R=decodeURIComponent(Z[1].replace(/^:/,""))),B=decodeURIComponent(Z[2]),M=o(S.protocol)}return new r(N,R,c,B,w,M,m)}catch(z){if(!(z instanceof URIError))throw z}}).filter(function(N){return N});if(_.length===1)return _[0]}}function h(j){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(j)}function u(j){var m=e.parse(j);return m.protocol==="gist:"&&m.host&&!m.path?m.protocol+"/"+m.host:j}function f(j){var m=j.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!m){var E=e.parse(j);if(E.auth){const C=j.match(/[^@]+@[^:/]+/);if(C){var S=new e.URL(C[0]);E.auth=S.username||"",S.password&&(E.auth+=":"+S.password)}}return E}return{protocol:"git+ssh:",slashes:!0,auth:m[1],host:m[2],port:null,hostname:m[2],hash:m[4],search:null,query:null,pathname:"/"+m[3],path:"/"+m[3],href:"git+ssh://"+m[1]+"@"+m[2]+"/"+m[3]+(m[4]||"")}}return Pn.exports}var Vt={},ie={},Kc=null;const Hc=Object.freeze(Object.defineProperty({__proto__:null,default:Kc},Symbol.toStringTag,{value:"Module"})),ms=Vo(Hc);var gr,Gi;function Xc(){return Gi||(Gi=1,gr={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),gr}var vr,Ki;function Yc(){if(Ki)return vr;Ki=1;const{charsWide:e,charsFullWidth:t}=Xc(),r=new RegExp(`[${e.join("")}${t.join("")}]`,"g");return vr={default:s=>s.replace(r,"xx").length,charsRegex:r},vr}/*!
|
|
192
|
+
`;var kt={},Pn={exports:{}},dr={exports:{}},$i;function ps(){if($i)return dr.exports;$i=1;var e=dr.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(i){return"file-"+r(i)}}},t={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:r};Object.keys(e).forEach(function(i){Object.keys(t).forEach(function(s){e[i][s]||(e[i][s]=t[s])}),e[i].protocols_re=RegExp("^("+e[i].protocols.map(function(s){return s.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function r(i){return i.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}return dr.exports}var hr,Ui;function qc(){if(Ui)return hr;Ui=1;var e=ps(),t=Object.assign||function(s,n){if(n===null||typeof n!="object")return s;const o=Object.keys(n);let a=o.length;for(;a--;)s[o[a]]=n[o[a]];return s};hr=r;function r(i,s,n,o,a,d,h){var u=this;u.type=i,Object.keys(e[i]).forEach(function(f){u[f]=e[i][f]}),u.user=s,u.auth=n,u.project=o,u.committish=a,u.default=d,u.opts=h||{}}return r.prototype.hash=function(){return this.committish?"#"+this.committish:""},r.prototype._fill=function(i,s){if(i){var n=t({},s);n.path=n.path?n.path.replace(/^[/]+/g,""):"",s=t(t({},this.opts),s);var o=this;Object.keys(this).forEach(function(m){o[m]!=null&&n[m]==null&&(n[m]=o[m])});var a=n.auth,d=n.committish,h=n.fragment,u=n.path,f=n.project;Object.keys(n).forEach(function(m){var E=n[m];(m==="path"||m==="project")&&typeof E=="string"?n[m]=E.split("/").map(function(S){return encodeURIComponent(S)}).join("/"):m!=="domain"&&(n[m]=encodeURIComponent(E))}),n["auth@"]=a?a+"@":"",n["#fragment"]=h?"#"+this.hashformat(h):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=u?"#"+this.hashformat(u):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),s.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=d?"#"+d:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var j=i;return Object.keys(n).forEach(function(m){j=j.replace(new RegExp("[{]"+m+"[}]","g"),n[m])}),s.noGitPlus?j.replace(/^git[+]/,""):j}},r.prototype.ssh=function(i){return this._fill(this.sshtemplate,i)},r.prototype.sshurl=function(i){return this._fill(this.sshurltemplate,i)},r.prototype.browse=function(i,s,n){return typeof i=="string"?(typeof s!="string"&&(n=s,s=null),this._fill(this.browsefiletemplate,t({fragment:s,path:i},n))):this._fill(this.browsetemplate,i)},r.prototype.docs=function(i){return this._fill(this.docstemplate,i)},r.prototype.bugs=function(i){return this._fill(this.bugstemplate,i)},r.prototype.https=function(i){return this._fill(this.httpstemplate,i)},r.prototype.git=function(i){return this._fill(this.gittemplate,i)},r.prototype.shortcut=function(i){return this._fill(this.shortcuttemplate,i)},r.prototype.path=function(i){return this._fill(this.pathtemplate,i)},r.prototype.tarball=function(i){var s=t({},i,{noCommittish:!1});return this._fill(this.tarballtemplate,s)},r.prototype.file=function(i,s){return this._fill(this.filetemplate,t({path:i},s))},r.prototype.getDefaultRepresentation=function(){return this.default},r.prototype.toString=function(i){return this.default&&typeof this[this.default]=="function"?this[this.default](i):this.sshurl(i)},hr}var fr,qi;function Wc(){return qi||(qi=1,fr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),fr}var pr,Wi;function zc(){if(Wi)return pr;Wi=1,pr=e,e.Node=s,e.create=e;function e(n){var o=this;if(o instanceof e||(o=new e),o.tail=null,o.head=null,o.length=0,n&&typeof n.forEach=="function")n.forEach(function(h){o.push(h)});else if(arguments.length>0)for(var a=0,d=arguments.length;a<d;a++)o.push(arguments[a]);return o}e.prototype.removeNode=function(n){if(n.list!==this)throw new Error("removing node which does not belong to this list");var o=n.next,a=n.prev;return o&&(o.prev=a),a&&(a.next=o),n===this.head&&(this.head=o),n===this.tail&&(this.tail=a),n.list.length--,n.next=null,n.prev=null,n.list=null,o},e.prototype.unshiftNode=function(n){if(n!==this.head){n.list&&n.list.removeNode(n);var o=this.head;n.list=this,n.next=o,o&&(o.prev=n),this.head=n,this.tail||(this.tail=n),this.length++}},e.prototype.pushNode=function(n){if(n!==this.tail){n.list&&n.list.removeNode(n);var o=this.tail;n.list=this,n.prev=o,o&&(o.next=n),this.tail=n,this.head||(this.head=n),this.length++}},e.prototype.push=function(){for(var n=0,o=arguments.length;n<o;n++)r(this,arguments[n]);return this.length},e.prototype.unshift=function(){for(var n=0,o=arguments.length;n<o;n++)i(this,arguments[n]);return this.length},e.prototype.pop=function(){if(this.tail){var n=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,n}},e.prototype.shift=function(){if(this.head){var n=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,n}},e.prototype.forEach=function(n,o){o=o||this;for(var a=this.head,d=0;a!==null;d++)n.call(o,a.value,d,this),a=a.next},e.prototype.forEachReverse=function(n,o){o=o||this;for(var a=this.tail,d=this.length-1;a!==null;d--)n.call(o,a.value,d,this),a=a.prev},e.prototype.get=function(n){for(var o=0,a=this.head;a!==null&&o<n;o++)a=a.next;if(o===n&&a!==null)return a.value},e.prototype.getReverse=function(n){for(var o=0,a=this.tail;a!==null&&o<n;o++)a=a.prev;if(o===n&&a!==null)return a.value},e.prototype.map=function(n,o){o=o||this;for(var a=new e,d=this.head;d!==null;)a.push(n.call(o,d.value,this)),d=d.next;return a},e.prototype.mapReverse=function(n,o){o=o||this;for(var a=new e,d=this.tail;d!==null;)a.push(n.call(o,d.value,this)),d=d.prev;return a},e.prototype.reduce=function(n,o){var a,d=this.head;if(arguments.length>1)a=o;else if(this.head)d=this.head.next,a=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;d!==null;h++)a=n(a,d.value,h),d=d.next;return a},e.prototype.reduceReverse=function(n,o){var a,d=this.tail;if(arguments.length>1)a=o;else if(this.tail)d=this.tail.prev,a=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;d!==null;h--)a=n(a,d.value,h),d=d.prev;return a},e.prototype.toArray=function(){for(var n=new Array(this.length),o=0,a=this.head;a!==null;o++)n[o]=a.value,a=a.next;return n},e.prototype.toArrayReverse=function(){for(var n=new Array(this.length),o=0,a=this.tail;a!==null;o++)n[o]=a.value,a=a.prev;return n},e.prototype.slice=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(;h!==null&&d<o;d++,h=h.next)a.push(h.value);return a},e.prototype.sliceReverse=function(n,o){o=o||this.length,o<0&&(o+=this.length),n=n||0,n<0&&(n+=this.length);var a=new e;if(o<n||o<0)return a;n<0&&(n=0),o>this.length&&(o=this.length);for(var d=this.length,h=this.tail;h!==null&&d>o;d--)h=h.prev;for(;h!==null&&d>n;d--,h=h.prev)a.push(h.value);return a},e.prototype.splice=function(n,o,...a){n>this.length&&(n=this.length-1),n<0&&(n=this.length+n);for(var d=0,h=this.head;h!==null&&d<n;d++)h=h.next;for(var u=[],d=0;h&&d<o;d++)u.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var d=0;d<a.length;d++)h=t(this,h,a[d]);return u},e.prototype.reverse=function(){for(var n=this.head,o=this.tail,a=n;a!==null;a=a.prev){var d=a.prev;a.prev=a.next,a.next=d}return this.head=o,this.tail=n,this};function t(n,o,a){var d=o===n.head?new s(a,null,o,n):new s(a,o,o.next,n);return d.next===null&&(n.tail=d),d.prev===null&&(n.head=d),n.length++,d}function r(n,o){n.tail=new s(o,n.tail,null,n),n.head||(n.head=n.tail),n.length++}function i(n,o){n.head=new s(o,null,n.head,n),n.tail||(n.tail=n.head),n.length++}function s(n,o,a,d){if(!(this instanceof s))return new s(n,o,a,d);this.list=d,this.value=n,o?(o.next=this,this.prev=o):this.prev=null,a?(a.prev=this,this.next=a):this.next=null}try{Wc()(e)}catch{}return pr}var mr,zi;function Vc(){if(zi)return mr;zi=1;const e=zc(),t=Symbol("max"),r=Symbol("length"),i=Symbol("lengthCalculator"),s=Symbol("allowStale"),n=Symbol("maxAge"),o=Symbol("dispose"),a=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),u=Symbol("updateAgeOnGet"),f=()=>1;class j{constructor(c){if(typeof c=="number"&&(c={max:c}),c||(c={}),c.max&&(typeof c.max!="number"||c.max<0))throw new TypeError("max must be a non-negative number");this[t]=c.max||1/0;const w=c.length||f;if(this[i]=typeof w!="function"?f:w,this[s]=c.stale||!1,c.maxAge&&typeof c.maxAge!="number")throw new TypeError("maxAge must be a number");this[n]=c.maxAge||0,this[o]=c.dispose,this[a]=c.noDisposeOnSet||!1,this[u]=c.updateAgeOnGet||!1,this.reset()}set max(c){if(typeof c!="number"||c<0)throw new TypeError("max must be a non-negative number");this[t]=c||1/0,S(this)}get max(){return this[t]}set allowStale(c){this[s]=!!c}get allowStale(){return this[s]}set maxAge(c){if(typeof c!="number")throw new TypeError("maxAge must be a non-negative number");this[n]=c,S(this)}get maxAge(){return this[n]}set lengthCalculator(c){typeof c!="function"&&(c=f),c!==this[i]&&(this[i]=c,this[r]=0,this[d].forEach(w=>{w.length=this[i](w.value,w.key),this[r]+=w.length})),S(this)}get lengthCalculator(){return this[i]}get length(){return this[r]}get itemCount(){return this[d].length}rforEach(c,w){w=w||this;for(let R=this[d].tail;R!==null;){const B=R.prev;N(this,c,R,w),R=B}}forEach(c,w){w=w||this;for(let R=this[d].head;R!==null;){const B=R.next;N(this,c,R,w),R=B}}keys(){return this[d].toArray().map(c=>c.key)}values(){return this[d].toArray().map(c=>c.value)}reset(){this[o]&&this[d]&&this[d].length&&this[d].forEach(c=>this[o](c.key,c.value)),this[h]=new Map,this[d]=new e,this[r]=0}dump(){return this[d].map(c=>E(this,c)?!1:{k:c.key,v:c.value,e:c.now+(c.maxAge||0)}).toArray().filter(c=>c)}dumpLru(){return this[d]}set(c,w,R){if(R=R||this[n],R&&typeof R!="number")throw new TypeError("maxAge must be a number");const B=R?Date.now():0,M=this[i](w,c);if(this[h].has(c)){if(M>this[t])return C(this,this[h].get(c)),!1;const z=this[h].get(c).value;return this[o]&&(this[a]||this[o](c,z.value)),z.now=B,z.maxAge=R,z.value=w,this[r]+=M-z.length,z.length=M,this.get(c),S(this),!0}const re=new _(c,w,M,B,R);return re.length>this[t]?(this[o]&&this[o](c,w),!1):(this[r]+=re.length,this[d].unshift(re),this[h].set(c,this[d].head),S(this),!0)}has(c){if(!this[h].has(c))return!1;const w=this[h].get(c).value;return!E(this,w)}get(c){return m(this,c,!0)}peek(c){return m(this,c,!1)}pop(){const c=this[d].tail;return c?(C(this,c),c.value):null}del(c){C(this,this[h].get(c))}load(c){this.reset();const w=Date.now();for(let R=c.length-1;R>=0;R--){const B=c[R],M=B.e||0;if(M===0)this.set(B.k,B.v);else{const re=M-w;re>0&&this.set(B.k,B.v,re)}}}prune(){this[h].forEach((c,w)=>m(this,w,!1))}}const m=(D,c,w)=>{const R=D[h].get(c);if(R){const B=R.value;if(E(D,B)){if(C(D,R),!D[s])return}else w&&(D[u]&&(R.value.now=Date.now()),D[d].unshiftNode(R));return B.value}},E=(D,c)=>{if(!c||!c.maxAge&&!D[n])return!1;const w=Date.now()-c.now;return c.maxAge?w>c.maxAge:D[n]&&w>D[n]},S=D=>{if(D[r]>D[t])for(let c=D[d].tail;D[r]>D[t]&&c!==null;){const w=c.prev;C(D,c),c=w}},C=(D,c)=>{if(c){const w=c.value;D[o]&&D[o](w.key,w.value),D[r]-=w.length,D[h].delete(w.key),D[d].removeNode(c)}};class _{constructor(c,w,R,B,M){this.key=c,this.value=w,this.length=R,this.now=B,this.maxAge=M||0}}const N=(D,c,w,R)=>{let B=w.value;E(D,B)&&(C(D,w),D[s]||(B=void 0)),B&&c.call(R,B.value,B.key,D)};return mr=j,mr}var Vi;function Kc(){if(Vi)return Pn.exports;Vi=1;var e=sl,t=ps(),r=Pn.exports=qc(),i=Vc(),s=new i({max:1e3}),n={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function o(j){return n[j]||j.slice(0,-1)}var a={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Pn.exports.fromUrl=function(j,m){if(typeof j=="string"){var E=j+JSON.stringify(m||{});return s.has(E)||s.set(E,d(j,m)),s.get(E)}};function d(j,m){if(!(j==null||j==="")){var E=u(h(j)?"github:"+j:j),S=f(E),C=E.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),_=Object.keys(t).map(function(N){try{var D=t[N],c=null;S.auth&&a[S.protocol]&&(c=S.auth);var w=S.hash?decodeURIComponent(S.hash.substr(1)):null,R=null,B=null,M=null;if(C&&C[1]===N)R=C[2]&&decodeURIComponent(C[2]),B=decodeURIComponent(C[3].replace(/\.git$/,"")),M="shortcut";else{if(S.host&&S.host!==D.domain&&S.host.replace(/^www[.]/,"")!==D.domain||!D.protocols_re.test(S.protocol)||!S.path)return;var re=D.pathmatch,Z=S.path.match(re);if(!Z)return;Z[1]!==null&&Z[1]!==void 0&&(R=decodeURIComponent(Z[1].replace(/^:/,""))),B=decodeURIComponent(Z[2]),M=o(S.protocol)}return new r(N,R,c,B,w,M,m)}catch(z){if(!(z instanceof URIError))throw z}}).filter(function(N){return N});if(_.length===1)return _[0]}}function h(j){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(j)}function u(j){var m=e.parse(j);return m.protocol==="gist:"&&m.host&&!m.path?m.protocol+"/"+m.host:j}function f(j){var m=j.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!m){var E=e.parse(j);if(E.auth){const C=j.match(/[^@]+@[^:/]+/);if(C){var S=new e.URL(C[0]);E.auth=S.username||"",S.password&&(E.auth+=":"+S.password)}}return E}return{protocol:"git+ssh:",slashes:!0,auth:m[1],host:m[2],port:null,hostname:m[2],hash:m[4],search:null,query:null,pathname:"/"+m[3],path:"/"+m[3],href:"git+ssh://"+m[1]+"@"+m[2]+"/"+m[3]+(m[4]||"")}}return Pn.exports}var Vt={},ie={},Gc=null;const Hc=Object.freeze(Object.defineProperty({__proto__:null,default:Gc},Symbol.toStringTag,{value:"Module"})),ms=Vo(Hc);var gr,Ki;function Xc(){return Ki||(Ki=1,gr={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),gr}var vr,Gi;function Yc(){if(Gi)return vr;Gi=1;const{charsWide:e,charsFullWidth:t}=Xc(),r=new RegExp(`[${e.join("")}${t.join("")}]`,"g");return vr={default:s=>s.replace(r,"xx").length,charsRegex:r},vr}/*!
|
|
193
193
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
194
194
|
*
|
|
195
195
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
@@ -199,11 +199,11 @@ import{$ as F,j as l,p as Tt,ar as it,ak as oe,J as qt,T as je,O as Kt,bt as Jr,
|
|
|
199
199
|
*
|
|
200
200
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
201
201
|
* Released under the MIT License.
|
|
202
|
-
*/var br,Xi;function Qc(){if(Xi)return br;Xi=1;var e=Jc(),t={"{":"}","(":")","[":"]"},r=function(s){if(s[0]==="!")return!0;for(var n=0,o=-2,a=-2,d=-2,h=-2,u=-2;n<s.length;){if(s[n]==="*"||s[n+1]==="?"&&/[\].+)]/.test(s[n])||a!==-1&&s[n]==="["&&s[n+1]!=="]"&&(a<n&&(a=s.indexOf("]",n)),a>n&&(u===-1||u>a||(u=s.indexOf("\\",n),u===-1||u>a)))||d!==-1&&s[n]==="{"&&s[n+1]!=="}"&&(d=s.indexOf("}",n),d>n&&(u=s.indexOf("\\",n),u===-1||u>d))||h!==-1&&s[n]==="("&&s[n+1]==="?"&&/[:!=]/.test(s[n+2])&&s[n+3]!==")"&&(h=s.indexOf(")",n),h>n&&(u=s.indexOf("\\",n),u===-1||u>h))||o!==-1&&s[n]==="("&&s[n+1]!=="|"&&(o<n&&(o=s.indexOf("|",n)),o!==-1&&s[o+1]!==")"&&(h=s.indexOf(")",o),h>o&&(u=s.indexOf("\\",o),u===-1||u>h))))return!0;if(s[n]==="\\"){var f=s[n+1];n+=2;var j=t[f];if(j){var m=s.indexOf(j,n);m!==-1&&(n=m+1)}if(s[n]==="!")return!0}else n++}return!1},i=function(s){if(s[0]==="!")return!0;for(var n=0;n<s.length;){if(/[*?{}()[\]]/.test(s[n]))return!0;if(s[n]==="\\"){var o=s[n+1];n+=2;var a=t[o];if(a){var d=s.indexOf(a,n);d!==-1&&(n=d+1)}if(s[n]==="!")return!0}else n++}return!1};return br=function(n,o){if(typeof n!="string"||n==="")return!1;if(e(n))return!0;var a=r;return o&&o.strict===!1&&(a=i),a(n)},br}var Ln={exports:{}},Yi;function Zc(){return Yi||(Yi=1,function(e,t){var r={};t=e.exports=M;var i;typeof Xa=="object"&&r&&r.NODE_DEBUG&&/\bsemver\b/i.test(r.NODE_DEBUG)?i=function(){var p=Array.prototype.slice.call(arguments,0);p.unshift("SEMVER"),console.log.apply(console,p)}:i=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var s=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,a=s-6,d=t.re=[],h=t.safeRe=[],u=t.src=[],f=t.tokens={},j=0;function m(p){f[p]=j++}var E="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",s],[E,a]];function C(p){for(var x=0;x<S.length;x++){var k=S[x][0],L=S[x][1];p=p.split(k+"*").join(k+"{0,"+L+"}").split(k+"+").join(k+"{1,"+L+"}")}return p}m("NUMERICIDENTIFIER"),u[f.NUMERICIDENTIFIER]="0|[1-9]\\d*",m("NUMERICIDENTIFIERLOOSE"),u[f.NUMERICIDENTIFIERLOOSE]="\\d+",m("NONNUMERICIDENTIFIER"),u[f.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+E+"*",m("MAINVERSION"),u[f.MAINVERSION]="("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")",m("MAINVERSIONLOOSE"),u[f.MAINVERSIONLOOSE]="("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")",m("PRERELEASEIDENTIFIER"),u[f.PRERELEASEIDENTIFIER]="(?:"+u[f.NUMERICIDENTIFIER]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASEIDENTIFIERLOOSE"),u[f.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[f.NUMERICIDENTIFIERLOOSE]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASE"),u[f.PRERELEASE]="(?:-("+u[f.PRERELEASEIDENTIFIER]+"(?:\\."+u[f.PRERELEASEIDENTIFIER]+")*))",m("PRERELEASELOOSE"),u[f.PRERELEASELOOSE]="(?:-?("+u[f.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[f.PRERELEASEIDENTIFIERLOOSE]+")*))",m("BUILDIDENTIFIER"),u[f.BUILDIDENTIFIER]=E+"+",m("BUILD"),u[f.BUILD]="(?:\\+("+u[f.BUILDIDENTIFIER]+"(?:\\."+u[f.BUILDIDENTIFIER]+")*))",m("FULL"),m("FULLPLAIN"),u[f.FULLPLAIN]="v?"+u[f.MAINVERSION]+u[f.PRERELEASE]+"?"+u[f.BUILD]+"?",u[f.FULL]="^"+u[f.FULLPLAIN]+"$",m("LOOSEPLAIN"),u[f.LOOSEPLAIN]="[v=\\s]*"+u[f.MAINVERSIONLOOSE]+u[f.PRERELEASELOOSE]+"?"+u[f.BUILD]+"?",m("LOOSE"),u[f.LOOSE]="^"+u[f.LOOSEPLAIN]+"$",m("GTLT"),u[f.GTLT]="((?:<|>)?=?)",m("XRANGEIDENTIFIERLOOSE"),u[f.XRANGEIDENTIFIERLOOSE]=u[f.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",m("XRANGEIDENTIFIER"),u[f.XRANGEIDENTIFIER]=u[f.NUMERICIDENTIFIER]+"|x|X|\\*",m("XRANGEPLAIN"),u[f.XRANGEPLAIN]="[v=\\s]*("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:"+u[f.PRERELEASE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGEPLAINLOOSE"),u[f.XRANGEPLAINLOOSE]="[v=\\s]*("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:"+u[f.PRERELEASELOOSE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGE"),u[f.XRANGE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAIN]+"$",m("XRANGELOOSE"),u[f.XRANGELOOSE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAINLOOSE]+"$",m("COERCE"),u[f.COERCE]="(^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])",m("COERCERTL"),d[f.COERCERTL]=new RegExp(u[f.COERCE],"g"),h[f.COERCERTL]=new RegExp(C(u[f.COERCE]),"g"),m("LONETILDE"),u[f.LONETILDE]="(?:~>?)",m("TILDETRIM"),u[f.TILDETRIM]="(\\s*)"+u[f.LONETILDE]+"\\s+",d[f.TILDETRIM]=new RegExp(u[f.TILDETRIM],"g"),h[f.TILDETRIM]=new RegExp(C(u[f.TILDETRIM]),"g");var _="$1~";m("TILDE"),u[f.TILDE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAIN]+"$",m("TILDELOOSE"),u[f.TILDELOOSE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAINLOOSE]+"$",m("LONECARET"),u[f.LONECARET]="(?:\\^)",m("CARETTRIM"),u[f.CARETTRIM]="(\\s*)"+u[f.LONECARET]+"\\s+",d[f.CARETTRIM]=new RegExp(u[f.CARETTRIM],"g"),h[f.CARETTRIM]=new RegExp(C(u[f.CARETTRIM]),"g");var N="$1^";m("CARET"),u[f.CARET]="^"+u[f.LONECARET]+u[f.XRANGEPLAIN]+"$",m("CARETLOOSE"),u[f.CARETLOOSE]="^"+u[f.LONECARET]+u[f.XRANGEPLAINLOOSE]+"$",m("COMPARATORLOOSE"),u[f.COMPARATORLOOSE]="^"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+")$|^$",m("COMPARATOR"),u[f.COMPARATOR]="^"+u[f.GTLT]+"\\s*("+u[f.FULLPLAIN]+")$|^$",m("COMPARATORTRIM"),u[f.COMPARATORTRIM]="(\\s*)"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+"|"+u[f.XRANGEPLAIN]+")",d[f.COMPARATORTRIM]=new RegExp(u[f.COMPARATORTRIM],"g"),h[f.COMPARATORTRIM]=new RegExp(C(u[f.COMPARATORTRIM]),"g");var D="$1$2$3";m("HYPHENRANGE"),u[f.HYPHENRANGE]="^\\s*("+u[f.XRANGEPLAIN]+")\\s+-\\s+("+u[f.XRANGEPLAIN]+")\\s*$",m("HYPHENRANGELOOSE"),u[f.HYPHENRANGELOOSE]="^\\s*("+u[f.XRANGEPLAINLOOSE]+")\\s+-\\s+("+u[f.XRANGEPLAINLOOSE]+")\\s*$",m("STAR"),u[f.STAR]="(<|>)?=?\\s*\\*";for(var c=0;c<j;c++)i(c,u[c]),d[c]||(d[c]=new RegExp(u[c]),h[c]=new RegExp(C(u[c])));t.parse=w;function w(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof M)return p;if(typeof p!="string"||p.length>s)return null;var k=x.loose?h[f.LOOSE]:h[f.FULL];if(!k.test(p))return null;try{return new M(p,x)}catch{return null}}t.valid=R;function R(p,x){var k=w(p,x);return k?k.version:null}t.clean=B;function B(p,x){var k=w(p.trim().replace(/^[=v]+/,""),x);return k?k.version:null}t.SemVer=M;function M(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof M){if(p.loose===x.loose)return p;p=p.version}else if(typeof p!="string")throw new TypeError("Invalid Version: "+p);if(p.length>s)throw new TypeError("version is longer than "+s+" characters");if(!(this instanceof M))return new M(p,x);i("SemVer",p,x),this.options=x,this.loose=!!x.loose;var k=p.trim().match(x.loose?h[f.LOOSE]:h[f.FULL]);if(!k)throw new TypeError("Invalid Version: "+p);if(this.raw=p,this.major=+k[1],this.minor=+k[2],this.patch=+k[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");k[4]?this.prerelease=k[4].split(".").map(function(L){if(/^[0-9]+$/.test(L)){var U=+L;if(U>=0&&U<n)return U}return L}):this.prerelease=[],this.build=k[5]?k[5].split("."):[],this.format()}M.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},M.prototype.toString=function(){return this.version},M.prototype.compare=function(p){return i("SemVer.compare",this.version,this.options,p),p instanceof M||(p=new M(p,this.options)),this.compareMain(p)||this.comparePre(p)},M.prototype.compareMain=function(p){return p instanceof M||(p=new M(p,this.options)),W(this.major,p.major)||W(this.minor,p.minor)||W(this.patch,p.patch)},M.prototype.comparePre=function(p){if(p instanceof M||(p=new M(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;var x=0;do{var k=this.prerelease[x],L=p.prerelease[x];if(i("prerelease compare",x,k,L),k===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(k===void 0)return-1;if(k===L)continue;return W(k,L)}while(++x)},M.prototype.compareBuild=function(p){p instanceof M||(p=new M(p,this.options));var x=0;do{var k=this.build[x],L=p.build[x];if(i("prerelease compare",x,k,L),k===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(k===void 0)return-1;if(k===L)continue;return W(k,L)}while(++x)},M.prototype.inc=function(p,x){switch(p){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 k=this.prerelease.length;--k>=0;)typeof this.prerelease[k]=="number"&&(this.prerelease[k]++,k=-2);k===-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: "+p)}return this.format(),this.raw=this.version,this},t.inc=re;function re(p,x,k,L){typeof k=="string"&&(L=k,k=void 0);try{return new M(p,k).inc(x,L).version}catch{return null}}t.diff=Z;function Z(p,x){if(Pe(p,x))return null;var k=w(p),L=w(x),U="";if(k.prerelease.length||L.prerelease.length){U="pre";var ne="prerelease"}for(var le in k)if((le==="major"||le==="minor"||le==="patch")&&k[le]!==L[le])return U+le;return ne}t.compareIdentifiers=W;var z=/^[0-9]+$/;function W(p,x){var k=z.test(p),L=z.test(x);return k&&L&&(p=+p,x=+x),p===x?0:k&&!L?-1:L&&!k?1:p<x?-1:1}t.rcompareIdentifiers=H;function H(p,x){return W(x,p)}t.major=A;function A(p,x){return new M(p,x).major}t.minor=X;function X(p,x){return new M(p,x).minor}t.patch=$;function $(p,x){return new M(p,x).patch}t.compare=he;function he(p,x,k){return new M(p,k).compare(new M(x,k))}t.compareLoose=Oe;function Oe(p,x){return he(p,x,!0)}t.compareBuild=G;function G(p,x,k){var L=new M(p,k),U=new M(x,k);return L.compare(U)||L.compareBuild(U)}t.rcompare=we;function we(p,x,k){return he(x,p,k)}t.sort=de;function de(p,x){return p.sort(function(k,L){return t.compareBuild(k,L,x)})}t.rsort=Le;function Le(p,x){return p.sort(function(k,L){return t.compareBuild(L,k,x)})}t.gt=ve;function ve(p,x,k){return he(p,x,k)>0}t.lt=_e;function _e(p,x,k){return he(p,x,k)<0}t.eq=Pe;function Pe(p,x,k){return he(p,x,k)===0}t.neq=He;function He(p,x,k){return he(p,x,k)!==0}t.gte=et;function et(p,x,k){return he(p,x,k)>=0}t.lte=ht;function ht(p,x,k){return he(p,x,k)<=0}t.cmp=Ze;function Ze(p,x,k,L){switch(x){case"===":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p===k;case"!==":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p!==k;case"":case"=":case"==":return Pe(p,k,L);case"!=":return He(p,k,L);case">":return ve(p,k,L);case">=":return et(p,k,L);case"<":return _e(p,k,L);case"<=":return ht(p,k,L);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=te;function te(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof te){if(p.loose===!!x.loose)return p;p=p.value}if(!(this instanceof te))return new te(p,x);p=p.trim().split(/\s+/).join(" "),i("comparator",p,x),this.options=x,this.loose=!!x.loose,this.parse(p),this.semver===Ne?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}var Ne={};te.prototype.parse=function(p){var x=this.options.loose?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],k=p.match(x);if(!k)throw new TypeError("Invalid comparator: "+p);this.operator=k[1]!==void 0?k[1]:"",this.operator==="="&&(this.operator=""),k[2]?this.semver=new M(k[2],this.options.loose):this.semver=Ne},te.prototype.toString=function(){return this.value},te.prototype.test=function(p){if(i("Comparator.test",p,this.options.loose),this.semver===Ne||p===Ne)return!0;if(typeof p=="string")try{p=new M(p,this.options)}catch{return!1}return Ze(p,this.operator,this.semver,this.options)},te.prototype.intersects=function(p,x){if(!(p instanceof te))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var k;if(this.operator==="")return this.value===""?!0:(k=new ye(p.value,x),ot(this.value,k,x));if(p.operator==="")return p.value===""?!0:(k=new ye(this.value,x),ot(p.semver,k,x));var L=(this.operator===">="||this.operator===">")&&(p.operator===">="||p.operator===">"),U=(this.operator==="<="||this.operator==="<")&&(p.operator==="<="||p.operator==="<"),ne=this.semver.version===p.semver.version,le=(this.operator===">="||this.operator==="<=")&&(p.operator===">="||p.operator==="<="),Se=Ze(this.semver,"<",p.semver,x)&&(this.operator===">="||this.operator===">")&&(p.operator==="<="||p.operator==="<"),be=Ze(this.semver,">",p.semver,x)&&(this.operator==="<="||this.operator==="<")&&(p.operator===">="||p.operator===">");return L||U||ne&&le||Se||be},t.Range=ye;function ye(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof ye)return p.loose===!!x.loose&&p.includePrerelease===!!x.includePrerelease?p:new ye(p.raw,x);if(p instanceof te)return new ye(p.value,x);if(!(this instanceof ye))return new ye(p,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(k){return this.parseRange(k.trim())},this).filter(function(k){return k.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ye.prototype.format=function(){return this.range=this.set.map(function(p){return p.join(" ").trim()}).join("||").trim(),this.range},ye.prototype.toString=function(){return this.range},ye.prototype.parseRange=function(p){var x=this.options.loose,k=x?h[f.HYPHENRANGELOOSE]:h[f.HYPHENRANGE];p=p.replace(k,qe),i("hyphen replace",p),p=p.replace(h[f.COMPARATORTRIM],D),i("comparator trim",p,h[f.COMPARATORTRIM]),p=p.replace(h[f.TILDETRIM],_),p=p.replace(h[f.CARETTRIM],N),p=p.split(/\s+/).join(" ");var L=x?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],U=p.split(" ").map(function(ne){return Ot(ne,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(U=U.filter(function(ne){return!!ne.match(L)})),U=U.map(function(ne){return new te(ne,this.options)},this),U},ye.prototype.intersects=function(p,x){if(!(p instanceof ye))throw new TypeError("a Range is required");return this.set.some(function(k){return Be(k,x)&&p.set.some(function(L){return Be(L,x)&&k.every(function(U){return L.every(function(ne){return U.intersects(ne,x)})})})})};function Be(p,x){for(var k=!0,L=p.slice(),U=L.pop();k&&L.length;)k=L.every(function(ne){return U.intersects(ne,x)}),U=L.pop();return k}t.toComparators=jt;function jt(p,x){return new ye(p,x).set.map(function(k){return k.map(function(L){return L.value}).join(" ").trim().split(" ")})}function Ot(p,x){return i("comp",p,x),p=_t(p,x),i("caret",p),p=Ct(p,x),i("tildes",p),p=It(p,x),i("xrange",p),p=at(p,x),i("stars",p),p}function Me(p){return!p||p.toLowerCase()==="x"||p==="*"}function Ct(p,x){return p.trim().split(/\s+/).map(function(k){return Et(k,x)}).join(" ")}function Et(p,x){var k=x.loose?h[f.TILDELOOSE]:h[f.TILDE];return p.replace(k,function(L,U,ne,le,Se){i("tilde",p,L,U,ne,le,Se);var be;return Me(U)?be="":Me(ne)?be=">="+U+".0.0 <"+(+U+1)+".0.0":Me(le)?be=">="+U+"."+ne+".0 <"+U+"."+(+ne+1)+".0":Se?(i("replaceTilde pr",Se),be=">="+U+"."+ne+"."+le+"-"+Se+" <"+U+"."+(+ne+1)+".0"):be=">="+U+"."+ne+"."+le+" <"+U+"."+(+ne+1)+".0",i("tilde return",be),be})}function _t(p,x){return p.trim().split(/\s+/).map(function(k){return Ye(k,x)}).join(" ")}function Ye(p,x){i("caret",p,x);var k=x.loose?h[f.CARETLOOSE]:h[f.CARET];return p.replace(k,function(L,U,ne,le,Se){i("caret",p,L,U,ne,le,Se);var be;return Me(U)?be="":Me(ne)?be=">="+U+".0.0 <"+(+U+1)+".0.0":Me(le)?U==="0"?be=">="+U+"."+ne+".0 <"+U+"."+(+ne+1)+".0":be=">="+U+"."+ne+".0 <"+(+U+1)+".0.0":Se?(i("replaceCaret pr",Se),U==="0"?ne==="0"?be=">="+U+"."+ne+"."+le+"-"+Se+" <"+U+"."+ne+"."+(+le+1):be=">="+U+"."+ne+"."+le+"-"+Se+" <"+U+"."+(+ne+1)+".0":be=">="+U+"."+ne+"."+le+"-"+Se+" <"+(+U+1)+".0.0"):(i("no pr"),U==="0"?ne==="0"?be=">="+U+"."+ne+"."+le+" <"+U+"."+ne+"."+(+le+1):be=">="+U+"."+ne+"."+le+" <"+U+"."+(+ne+1)+".0":be=">="+U+"."+ne+"."+le+" <"+(+U+1)+".0.0"),i("caret return",be),be})}function It(p,x){return i("replaceXRanges",p,x),p.split(/\s+/).map(function(k){return Nt(k,x)}).join(" ")}function Nt(p,x){p=p.trim();var k=x.loose?h[f.XRANGELOOSE]:h[f.XRANGE];return p.replace(k,function(L,U,ne,le,Se,be){i("xRange",p,L,U,ne,le,Se,be);var $e=Me(ne),ze=$e||Me(le),Ue=ze||Me(Se),Ve=Ue;return U==="="&&Ve&&(U=""),be=x.includePrerelease?"-0":"",$e?U===">"||U==="<"?L="<0.0.0-0":L="*":U&&Ve?(ze&&(le=0),Se=0,U===">"?(U=">=",ze?(ne=+ne+1,le=0,Se=0):(le=+le+1,Se=0)):U==="<="&&(U="<",ze?ne=+ne+1:le=+le+1),L=U+ne+"."+le+"."+Se+be):ze?L=">="+ne+".0.0"+be+" <"+(+ne+1)+".0.0"+be:Ue&&(L=">="+ne+"."+le+".0"+be+" <"+ne+"."+(+le+1)+".0"+be),i("xRange return",L),L})}function at(p,x){return i("replaceStars",p,x),p.trim().replace(h[f.STAR],"")}function qe(p,x,k,L,U,ne,le,Se,be,$e,ze,Ue,Ve){return Me(k)?x="":Me(L)?x=">="+k+".0.0":Me(U)?x=">="+k+"."+L+".0":x=">="+x,Me(be)?Se="":Me($e)?Se="<"+(+be+1)+".0.0":Me(ze)?Se="<"+be+"."+(+$e+1)+".0":Ue?Se="<="+be+"."+$e+"."+ze+"-"+Ue:Se="<="+Se,(x+" "+Se).trim()}ye.prototype.test=function(p){if(!p)return!1;if(typeof p=="string")try{p=new M(p,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(tt(this.set[x],p,this.options))return!0;return!1};function tt(p,x,k){for(var L=0;L<p.length;L++)if(!p[L].test(x))return!1;if(x.prerelease.length&&!k.includePrerelease){for(L=0;L<p.length;L++)if(i(p[L].semver),p[L].semver!==Ne&&p[L].semver.prerelease.length>0){var U=p[L].semver;if(U.major===x.major&&U.minor===x.minor&&U.patch===x.patch)return!0}return!1}return!0}t.satisfies=ot;function ot(p,x,k){try{x=new ye(x,k)}catch{return!1}return x.test(p)}t.maxSatisfying=mt;function mt(p,x,k){var L=null,U=null;try{var ne=new ye(x,k)}catch{return null}return p.forEach(function(le){ne.test(le)&&(!L||U.compare(le)===-1)&&(L=le,U=new M(L,k))}),L}t.minSatisfying=V;function V(p,x,k){var L=null,U=null;try{var ne=new ye(x,k)}catch{return null}return p.forEach(function(le){ne.test(le)&&(!L||U.compare(le)===1)&&(L=le,U=new M(L,k))}),L}t.minVersion=ae;function ae(p,x){p=new ye(p,x);var k=new M("0.0.0");if(p.test(k)||(k=new M("0.0.0-0"),p.test(k)))return k;k=null;for(var L=0;L<p.set.length;++L){var U=p.set[L];U.forEach(function(ne){var le=new M(ne.semver.version);switch(ne.operator){case">":le.prerelease.length===0?le.patch++:le.prerelease.push(0),le.raw=le.format();case"":case">=":(!k||ve(k,le))&&(k=le);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+ne.operator)}})}return k&&p.test(k)?k:null}t.validRange=me;function me(p,x){try{return new ye(p,x).range||"*"}catch{return null}}t.ltr=Ce;function Ce(p,x,k){return O(p,x,"<",k)}t.gtr=ee;function ee(p,x,k){return O(p,x,">",k)}t.outside=O;function O(p,x,k,L){p=new M(p,L),x=new ye(x,L);var U,ne,le,Se,be;switch(k){case">":U=ve,ne=ht,le=_e,Se=">",be=">=";break;case"<":U=_e,ne=et,le=ve,Se="<",be="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ot(p,x,L))return!1;for(var $e=0;$e<x.set.length;++$e){var ze=x.set[$e],Ue=null,Ve=null;if(ze.forEach(function(lt){lt.semver===Ne&&(lt=new te(">=0.0.0")),Ue=Ue||lt,Ve=Ve||lt,U(lt.semver,Ue.semver,L)?Ue=lt:le(lt.semver,Ve.semver,L)&&(Ve=lt)}),Ue.operator===Se||Ue.operator===be||(!Ve.operator||Ve.operator===Se)&&ne(p,Ve.semver))return!1;if(Ve.operator===be&&le(p,Ve.semver))return!1}return!0}t.prerelease=Ie;function Ie(p,x){var k=w(p,x);return k&&k.prerelease.length?k.prerelease:null}t.intersects=Re;function Re(p,x,k){return p=new ye(p,k),x=new ye(x,k),p.intersects(x)}t.coerce=Fe;function Fe(p,x){if(p instanceof M)return p;if(typeof p=="number"&&(p=String(p)),typeof p!="string")return null;x=x||{};var k=null;if(!x.rtl)k=p.match(h[f.COERCE]);else{for(var L;(L=h[f.COERCERTL].exec(p))&&(!k||k.index+k[0].length!==p.length);)(!k||L.index+L[0].length!==k.index+k[0].length)&&(k=L),h[f.COERCERTL].lastIndex=L.index+L[1].length+L[2].length;h[f.COERCERTL].lastIndex=-1}return k===null?null:w(k[2]+"."+(k[3]||"0")+"."+(k[4]||"0"),x)}}(Ln,Ln.exports)),Ln.exports}var xr,Ji;function eu(){if(Ji)return xr;Ji=1;const e=ti(),t=Zc(),r="semver",i={base:e.string(),type:"semverRange",validate:function(o,{error:a}){return t.validRange(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver range"}},s={};return s.compare={method:!1,validate:function(o,a,{exp:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{exp:d})},args:[{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},["gt","gte","lt","lte","eq","neq"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compare",args:{exp:a}})}}}),s.cmp={method:function(o,a){return this.$_addRule({name:"cmp",args:{cmp:o,exp:a}})},validate:function(o,a,{cmp:d,exp:h}){return t.cmp(o,d,h)?o:a.error(`${r}.cmp`,{cmp:d,exp:h})},args:[{name:"cmp",assert:o=>["===","!==","","=","==","!=",">",">=","<","<="].includes(o),message:"needs to be a valid comparator"},{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},s.compareRange={method:!1,validate:function(o,a,{rng:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{rng:d})},args:[{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},["satisfies","gtr","ltr"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compareRange",args:{rng:a}})}}}),s.outside={method:function(o,a){return this.$_addRule({name:"outside",args:{hilo:o,rng:a}})},validate:function(o,a,{hilo:d,rng:h}){return t.outside(o,h,d)?o:a.error(`${r}.outside`,{hilo:d,rng:h})},args:[{name:"hilo",assert:o=>[">","<"].includes(o),message:"needs to be a valid comparator"},{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},xr={semver:{base:e.string(),type:"semver",validate:function(o,{error:a}){return t.valid(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver expression",[`${r}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${r}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${r}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${r}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${r}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${r}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${r}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${r}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${r}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${r}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${r}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:s},semverRange:i},xr}/*!
|
|
202
|
+
*/var br,Xi;function Qc(){if(Xi)return br;Xi=1;var e=Jc(),t={"{":"}","(":")","[":"]"},r=function(s){if(s[0]==="!")return!0;for(var n=0,o=-2,a=-2,d=-2,h=-2,u=-2;n<s.length;){if(s[n]==="*"||s[n+1]==="?"&&/[\].+)]/.test(s[n])||a!==-1&&s[n]==="["&&s[n+1]!=="]"&&(a<n&&(a=s.indexOf("]",n)),a>n&&(u===-1||u>a||(u=s.indexOf("\\",n),u===-1||u>a)))||d!==-1&&s[n]==="{"&&s[n+1]!=="}"&&(d=s.indexOf("}",n),d>n&&(u=s.indexOf("\\",n),u===-1||u>d))||h!==-1&&s[n]==="("&&s[n+1]==="?"&&/[:!=]/.test(s[n+2])&&s[n+3]!==")"&&(h=s.indexOf(")",n),h>n&&(u=s.indexOf("\\",n),u===-1||u>h))||o!==-1&&s[n]==="("&&s[n+1]!=="|"&&(o<n&&(o=s.indexOf("|",n)),o!==-1&&s[o+1]!==")"&&(h=s.indexOf(")",o),h>o&&(u=s.indexOf("\\",o),u===-1||u>h))))return!0;if(s[n]==="\\"){var f=s[n+1];n+=2;var j=t[f];if(j){var m=s.indexOf(j,n);m!==-1&&(n=m+1)}if(s[n]==="!")return!0}else n++}return!1},i=function(s){if(s[0]==="!")return!0;for(var n=0;n<s.length;){if(/[*?{}()[\]]/.test(s[n]))return!0;if(s[n]==="\\"){var o=s[n+1];n+=2;var a=t[o];if(a){var d=s.indexOf(a,n);d!==-1&&(n=d+1)}if(s[n]==="!")return!0}else n++}return!1};return br=function(n,o){if(typeof n!="string"||n==="")return!1;if(e(n))return!0;var a=r;return o&&o.strict===!1&&(a=i),a(n)},br}var Ln={exports:{}},Yi;function Zc(){return Yi||(Yi=1,function(e,t){var r={};t=e.exports=M;var i;typeof Xa=="object"&&r&&r.NODE_DEBUG&&/\bsemver\b/i.test(r.NODE_DEBUG)?i=function(){var p=Array.prototype.slice.call(arguments,0);p.unshift("SEMVER"),console.log.apply(console,p)}:i=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var s=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,a=s-6,d=t.re=[],h=t.safeRe=[],u=t.src=[],f=t.tokens={},j=0;function m(p){f[p]=j++}var E="[a-zA-Z0-9-]",S=[["\\s",1],["\\d",s],[E,a]];function C(p){for(var x=0;x<S.length;x++){var k=S[x][0],L=S[x][1];p=p.split(k+"*").join(k+"{0,"+L+"}").split(k+"+").join(k+"{1,"+L+"}")}return p}m("NUMERICIDENTIFIER"),u[f.NUMERICIDENTIFIER]="0|[1-9]\\d*",m("NUMERICIDENTIFIERLOOSE"),u[f.NUMERICIDENTIFIERLOOSE]="\\d+",m("NONNUMERICIDENTIFIER"),u[f.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+E+"*",m("MAINVERSION"),u[f.MAINVERSION]="("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")\\.("+u[f.NUMERICIDENTIFIER]+")",m("MAINVERSIONLOOSE"),u[f.MAINVERSIONLOOSE]="("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")\\.("+u[f.NUMERICIDENTIFIERLOOSE]+")",m("PRERELEASEIDENTIFIER"),u[f.PRERELEASEIDENTIFIER]="(?:"+u[f.NUMERICIDENTIFIER]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASEIDENTIFIERLOOSE"),u[f.PRERELEASEIDENTIFIERLOOSE]="(?:"+u[f.NUMERICIDENTIFIERLOOSE]+"|"+u[f.NONNUMERICIDENTIFIER]+")",m("PRERELEASE"),u[f.PRERELEASE]="(?:-("+u[f.PRERELEASEIDENTIFIER]+"(?:\\."+u[f.PRERELEASEIDENTIFIER]+")*))",m("PRERELEASELOOSE"),u[f.PRERELEASELOOSE]="(?:-?("+u[f.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+u[f.PRERELEASEIDENTIFIERLOOSE]+")*))",m("BUILDIDENTIFIER"),u[f.BUILDIDENTIFIER]=E+"+",m("BUILD"),u[f.BUILD]="(?:\\+("+u[f.BUILDIDENTIFIER]+"(?:\\."+u[f.BUILDIDENTIFIER]+")*))",m("FULL"),m("FULLPLAIN"),u[f.FULLPLAIN]="v?"+u[f.MAINVERSION]+u[f.PRERELEASE]+"?"+u[f.BUILD]+"?",u[f.FULL]="^"+u[f.FULLPLAIN]+"$",m("LOOSEPLAIN"),u[f.LOOSEPLAIN]="[v=\\s]*"+u[f.MAINVERSIONLOOSE]+u[f.PRERELEASELOOSE]+"?"+u[f.BUILD]+"?",m("LOOSE"),u[f.LOOSE]="^"+u[f.LOOSEPLAIN]+"$",m("GTLT"),u[f.GTLT]="((?:<|>)?=?)",m("XRANGEIDENTIFIERLOOSE"),u[f.XRANGEIDENTIFIERLOOSE]=u[f.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",m("XRANGEIDENTIFIER"),u[f.XRANGEIDENTIFIER]=u[f.NUMERICIDENTIFIER]+"|x|X|\\*",m("XRANGEPLAIN"),u[f.XRANGEPLAIN]="[v=\\s]*("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:\\.("+u[f.XRANGEIDENTIFIER]+")(?:"+u[f.PRERELEASE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGEPLAINLOOSE"),u[f.XRANGEPLAINLOOSE]="[v=\\s]*("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+u[f.XRANGEIDENTIFIERLOOSE]+")(?:"+u[f.PRERELEASELOOSE]+")?"+u[f.BUILD]+"?)?)?",m("XRANGE"),u[f.XRANGE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAIN]+"$",m("XRANGELOOSE"),u[f.XRANGELOOSE]="^"+u[f.GTLT]+"\\s*"+u[f.XRANGEPLAINLOOSE]+"$",m("COERCE"),u[f.COERCE]="(^|[^\\d])(\\d{1,"+o+"})(?:\\.(\\d{1,"+o+"}))?(?:\\.(\\d{1,"+o+"}))?(?:$|[^\\d])",m("COERCERTL"),d[f.COERCERTL]=new RegExp(u[f.COERCE],"g"),h[f.COERCERTL]=new RegExp(C(u[f.COERCE]),"g"),m("LONETILDE"),u[f.LONETILDE]="(?:~>?)",m("TILDETRIM"),u[f.TILDETRIM]="(\\s*)"+u[f.LONETILDE]+"\\s+",d[f.TILDETRIM]=new RegExp(u[f.TILDETRIM],"g"),h[f.TILDETRIM]=new RegExp(C(u[f.TILDETRIM]),"g");var _="$1~";m("TILDE"),u[f.TILDE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAIN]+"$",m("TILDELOOSE"),u[f.TILDELOOSE]="^"+u[f.LONETILDE]+u[f.XRANGEPLAINLOOSE]+"$",m("LONECARET"),u[f.LONECARET]="(?:\\^)",m("CARETTRIM"),u[f.CARETTRIM]="(\\s*)"+u[f.LONECARET]+"\\s+",d[f.CARETTRIM]=new RegExp(u[f.CARETTRIM],"g"),h[f.CARETTRIM]=new RegExp(C(u[f.CARETTRIM]),"g");var N="$1^";m("CARET"),u[f.CARET]="^"+u[f.LONECARET]+u[f.XRANGEPLAIN]+"$",m("CARETLOOSE"),u[f.CARETLOOSE]="^"+u[f.LONECARET]+u[f.XRANGEPLAINLOOSE]+"$",m("COMPARATORLOOSE"),u[f.COMPARATORLOOSE]="^"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+")$|^$",m("COMPARATOR"),u[f.COMPARATOR]="^"+u[f.GTLT]+"\\s*("+u[f.FULLPLAIN]+")$|^$",m("COMPARATORTRIM"),u[f.COMPARATORTRIM]="(\\s*)"+u[f.GTLT]+"\\s*("+u[f.LOOSEPLAIN]+"|"+u[f.XRANGEPLAIN]+")",d[f.COMPARATORTRIM]=new RegExp(u[f.COMPARATORTRIM],"g"),h[f.COMPARATORTRIM]=new RegExp(C(u[f.COMPARATORTRIM]),"g");var D="$1$2$3";m("HYPHENRANGE"),u[f.HYPHENRANGE]="^\\s*("+u[f.XRANGEPLAIN]+")\\s+-\\s+("+u[f.XRANGEPLAIN]+")\\s*$",m("HYPHENRANGELOOSE"),u[f.HYPHENRANGELOOSE]="^\\s*("+u[f.XRANGEPLAINLOOSE]+")\\s+-\\s+("+u[f.XRANGEPLAINLOOSE]+")\\s*$",m("STAR"),u[f.STAR]="(<|>)?=?\\s*\\*";for(var c=0;c<j;c++)i(c,u[c]),d[c]||(d[c]=new RegExp(u[c]),h[c]=new RegExp(C(u[c])));t.parse=w;function w(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof M)return p;if(typeof p!="string"||p.length>s)return null;var k=x.loose?h[f.LOOSE]:h[f.FULL];if(!k.test(p))return null;try{return new M(p,x)}catch{return null}}t.valid=R;function R(p,x){var k=w(p,x);return k?k.version:null}t.clean=B;function B(p,x){var k=w(p.trim().replace(/^[=v]+/,""),x);return k?k.version:null}t.SemVer=M;function M(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof M){if(p.loose===x.loose)return p;p=p.version}else if(typeof p!="string")throw new TypeError("Invalid Version: "+p);if(p.length>s)throw new TypeError("version is longer than "+s+" characters");if(!(this instanceof M))return new M(p,x);i("SemVer",p,x),this.options=x,this.loose=!!x.loose;var k=p.trim().match(x.loose?h[f.LOOSE]:h[f.FULL]);if(!k)throw new TypeError("Invalid Version: "+p);if(this.raw=p,this.major=+k[1],this.minor=+k[2],this.patch=+k[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");k[4]?this.prerelease=k[4].split(".").map(function(L){if(/^[0-9]+$/.test(L)){var U=+L;if(U>=0&&U<n)return U}return L}):this.prerelease=[],this.build=k[5]?k[5].split("."):[],this.format()}M.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},M.prototype.toString=function(){return this.version},M.prototype.compare=function(p){return i("SemVer.compare",this.version,this.options,p),p instanceof M||(p=new M(p,this.options)),this.compareMain(p)||this.comparePre(p)},M.prototype.compareMain=function(p){return p instanceof M||(p=new M(p,this.options)),W(this.major,p.major)||W(this.minor,p.minor)||W(this.patch,p.patch)},M.prototype.comparePre=function(p){if(p instanceof M||(p=new M(p,this.options)),this.prerelease.length&&!p.prerelease.length)return-1;if(!this.prerelease.length&&p.prerelease.length)return 1;if(!this.prerelease.length&&!p.prerelease.length)return 0;var x=0;do{var k=this.prerelease[x],L=p.prerelease[x];if(i("prerelease compare",x,k,L),k===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(k===void 0)return-1;if(k===L)continue;return W(k,L)}while(++x)},M.prototype.compareBuild=function(p){p instanceof M||(p=new M(p,this.options));var x=0;do{var k=this.build[x],L=p.build[x];if(i("prerelease compare",x,k,L),k===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(k===void 0)return-1;if(k===L)continue;return W(k,L)}while(++x)},M.prototype.inc=function(p,x){switch(p){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 k=this.prerelease.length;--k>=0;)typeof this.prerelease[k]=="number"&&(this.prerelease[k]++,k=-2);k===-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: "+p)}return this.format(),this.raw=this.version,this},t.inc=re;function re(p,x,k,L){typeof k=="string"&&(L=k,k=void 0);try{return new M(p,k).inc(x,L).version}catch{return null}}t.diff=Z;function Z(p,x){if(Pe(p,x))return null;var k=w(p),L=w(x),U="";if(k.prerelease.length||L.prerelease.length){U="pre";var ne="prerelease"}for(var le in k)if((le==="major"||le==="minor"||le==="patch")&&k[le]!==L[le])return U+le;return ne}t.compareIdentifiers=W;var z=/^[0-9]+$/;function W(p,x){var k=z.test(p),L=z.test(x);return k&&L&&(p=+p,x=+x),p===x?0:k&&!L?-1:L&&!k?1:p<x?-1:1}t.rcompareIdentifiers=H;function H(p,x){return W(x,p)}t.major=A;function A(p,x){return new M(p,x).major}t.minor=X;function X(p,x){return new M(p,x).minor}t.patch=$;function $(p,x){return new M(p,x).patch}t.compare=he;function he(p,x,k){return new M(p,k).compare(new M(x,k))}t.compareLoose=Oe;function Oe(p,x){return he(p,x,!0)}t.compareBuild=K;function K(p,x,k){var L=new M(p,k),U=new M(x,k);return L.compare(U)||L.compareBuild(U)}t.rcompare=we;function we(p,x,k){return he(x,p,k)}t.sort=de;function de(p,x){return p.sort(function(k,L){return t.compareBuild(k,L,x)})}t.rsort=Le;function Le(p,x){return p.sort(function(k,L){return t.compareBuild(L,k,x)})}t.gt=ve;function ve(p,x,k){return he(p,x,k)>0}t.lt=_e;function _e(p,x,k){return he(p,x,k)<0}t.eq=Pe;function Pe(p,x,k){return he(p,x,k)===0}t.neq=He;function He(p,x,k){return he(p,x,k)!==0}t.gte=et;function et(p,x,k){return he(p,x,k)>=0}t.lte=ht;function ht(p,x,k){return he(p,x,k)<=0}t.cmp=Ze;function Ze(p,x,k,L){switch(x){case"===":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p===k;case"!==":return typeof p=="object"&&(p=p.version),typeof k=="object"&&(k=k.version),p!==k;case"":case"=":case"==":return Pe(p,k,L);case"!=":return He(p,k,L);case">":return ve(p,k,L);case">=":return et(p,k,L);case"<":return _e(p,k,L);case"<=":return ht(p,k,L);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=te;function te(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof te){if(p.loose===!!x.loose)return p;p=p.value}if(!(this instanceof te))return new te(p,x);p=p.trim().split(/\s+/).join(" "),i("comparator",p,x),this.options=x,this.loose=!!x.loose,this.parse(p),this.semver===Ne?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}var Ne={};te.prototype.parse=function(p){var x=this.options.loose?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],k=p.match(x);if(!k)throw new TypeError("Invalid comparator: "+p);this.operator=k[1]!==void 0?k[1]:"",this.operator==="="&&(this.operator=""),k[2]?this.semver=new M(k[2],this.options.loose):this.semver=Ne},te.prototype.toString=function(){return this.value},te.prototype.test=function(p){if(i("Comparator.test",p,this.options.loose),this.semver===Ne||p===Ne)return!0;if(typeof p=="string")try{p=new M(p,this.options)}catch{return!1}return Ze(p,this.operator,this.semver,this.options)},te.prototype.intersects=function(p,x){if(!(p instanceof te))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var k;if(this.operator==="")return this.value===""?!0:(k=new ye(p.value,x),ot(this.value,k,x));if(p.operator==="")return p.value===""?!0:(k=new ye(this.value,x),ot(p.semver,k,x));var L=(this.operator===">="||this.operator===">")&&(p.operator===">="||p.operator===">"),U=(this.operator==="<="||this.operator==="<")&&(p.operator==="<="||p.operator==="<"),ne=this.semver.version===p.semver.version,le=(this.operator===">="||this.operator==="<=")&&(p.operator===">="||p.operator==="<="),Se=Ze(this.semver,"<",p.semver,x)&&(this.operator===">="||this.operator===">")&&(p.operator==="<="||p.operator==="<"),be=Ze(this.semver,">",p.semver,x)&&(this.operator==="<="||this.operator==="<")&&(p.operator===">="||p.operator===">");return L||U||ne&&le||Se||be},t.Range=ye;function ye(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof ye)return p.loose===!!x.loose&&p.includePrerelease===!!x.includePrerelease?p:new ye(p.raw,x);if(p instanceof te)return new ye(p.value,x);if(!(this instanceof ye))return new ye(p,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=p.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(k){return this.parseRange(k.trim())},this).filter(function(k){return k.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ye.prototype.format=function(){return this.range=this.set.map(function(p){return p.join(" ").trim()}).join("||").trim(),this.range},ye.prototype.toString=function(){return this.range},ye.prototype.parseRange=function(p){var x=this.options.loose,k=x?h[f.HYPHENRANGELOOSE]:h[f.HYPHENRANGE];p=p.replace(k,qe),i("hyphen replace",p),p=p.replace(h[f.COMPARATORTRIM],D),i("comparator trim",p,h[f.COMPARATORTRIM]),p=p.replace(h[f.TILDETRIM],_),p=p.replace(h[f.CARETTRIM],N),p=p.split(/\s+/).join(" ");var L=x?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],U=p.split(" ").map(function(ne){return Ot(ne,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(U=U.filter(function(ne){return!!ne.match(L)})),U=U.map(function(ne){return new te(ne,this.options)},this),U},ye.prototype.intersects=function(p,x){if(!(p instanceof ye))throw new TypeError("a Range is required");return this.set.some(function(k){return Be(k,x)&&p.set.some(function(L){return Be(L,x)&&k.every(function(U){return L.every(function(ne){return U.intersects(ne,x)})})})})};function Be(p,x){for(var k=!0,L=p.slice(),U=L.pop();k&&L.length;)k=L.every(function(ne){return U.intersects(ne,x)}),U=L.pop();return k}t.toComparators=jt;function jt(p,x){return new ye(p,x).set.map(function(k){return k.map(function(L){return L.value}).join(" ").trim().split(" ")})}function Ot(p,x){return i("comp",p,x),p=_t(p,x),i("caret",p),p=Ct(p,x),i("tildes",p),p=It(p,x),i("xrange",p),p=at(p,x),i("stars",p),p}function Me(p){return!p||p.toLowerCase()==="x"||p==="*"}function Ct(p,x){return p.trim().split(/\s+/).map(function(k){return Et(k,x)}).join(" ")}function Et(p,x){var k=x.loose?h[f.TILDELOOSE]:h[f.TILDE];return p.replace(k,function(L,U,ne,le,Se){i("tilde",p,L,U,ne,le,Se);var be;return Me(U)?be="":Me(ne)?be=">="+U+".0.0 <"+(+U+1)+".0.0":Me(le)?be=">="+U+"."+ne+".0 <"+U+"."+(+ne+1)+".0":Se?(i("replaceTilde pr",Se),be=">="+U+"."+ne+"."+le+"-"+Se+" <"+U+"."+(+ne+1)+".0"):be=">="+U+"."+ne+"."+le+" <"+U+"."+(+ne+1)+".0",i("tilde return",be),be})}function _t(p,x){return p.trim().split(/\s+/).map(function(k){return Ye(k,x)}).join(" ")}function Ye(p,x){i("caret",p,x);var k=x.loose?h[f.CARETLOOSE]:h[f.CARET];return p.replace(k,function(L,U,ne,le,Se){i("caret",p,L,U,ne,le,Se);var be;return Me(U)?be="":Me(ne)?be=">="+U+".0.0 <"+(+U+1)+".0.0":Me(le)?U==="0"?be=">="+U+"."+ne+".0 <"+U+"."+(+ne+1)+".0":be=">="+U+"."+ne+".0 <"+(+U+1)+".0.0":Se?(i("replaceCaret pr",Se),U==="0"?ne==="0"?be=">="+U+"."+ne+"."+le+"-"+Se+" <"+U+"."+ne+"."+(+le+1):be=">="+U+"."+ne+"."+le+"-"+Se+" <"+U+"."+(+ne+1)+".0":be=">="+U+"."+ne+"."+le+"-"+Se+" <"+(+U+1)+".0.0"):(i("no pr"),U==="0"?ne==="0"?be=">="+U+"."+ne+"."+le+" <"+U+"."+ne+"."+(+le+1):be=">="+U+"."+ne+"."+le+" <"+U+"."+(+ne+1)+".0":be=">="+U+"."+ne+"."+le+" <"+(+U+1)+".0.0"),i("caret return",be),be})}function It(p,x){return i("replaceXRanges",p,x),p.split(/\s+/).map(function(k){return Nt(k,x)}).join(" ")}function Nt(p,x){p=p.trim();var k=x.loose?h[f.XRANGELOOSE]:h[f.XRANGE];return p.replace(k,function(L,U,ne,le,Se,be){i("xRange",p,L,U,ne,le,Se,be);var $e=Me(ne),ze=$e||Me(le),Ue=ze||Me(Se),Ve=Ue;return U==="="&&Ve&&(U=""),be=x.includePrerelease?"-0":"",$e?U===">"||U==="<"?L="<0.0.0-0":L="*":U&&Ve?(ze&&(le=0),Se=0,U===">"?(U=">=",ze?(ne=+ne+1,le=0,Se=0):(le=+le+1,Se=0)):U==="<="&&(U="<",ze?ne=+ne+1:le=+le+1),L=U+ne+"."+le+"."+Se+be):ze?L=">="+ne+".0.0"+be+" <"+(+ne+1)+".0.0"+be:Ue&&(L=">="+ne+"."+le+".0"+be+" <"+ne+"."+(+le+1)+".0"+be),i("xRange return",L),L})}function at(p,x){return i("replaceStars",p,x),p.trim().replace(h[f.STAR],"")}function qe(p,x,k,L,U,ne,le,Se,be,$e,ze,Ue,Ve){return Me(k)?x="":Me(L)?x=">="+k+".0.0":Me(U)?x=">="+k+"."+L+".0":x=">="+x,Me(be)?Se="":Me($e)?Se="<"+(+be+1)+".0.0":Me(ze)?Se="<"+be+"."+(+$e+1)+".0":Ue?Se="<="+be+"."+$e+"."+ze+"-"+Ue:Se="<="+Se,(x+" "+Se).trim()}ye.prototype.test=function(p){if(!p)return!1;if(typeof p=="string")try{p=new M(p,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(tt(this.set[x],p,this.options))return!0;return!1};function tt(p,x,k){for(var L=0;L<p.length;L++)if(!p[L].test(x))return!1;if(x.prerelease.length&&!k.includePrerelease){for(L=0;L<p.length;L++)if(i(p[L].semver),p[L].semver!==Ne&&p[L].semver.prerelease.length>0){var U=p[L].semver;if(U.major===x.major&&U.minor===x.minor&&U.patch===x.patch)return!0}return!1}return!0}t.satisfies=ot;function ot(p,x,k){try{x=new ye(x,k)}catch{return!1}return x.test(p)}t.maxSatisfying=mt;function mt(p,x,k){var L=null,U=null;try{var ne=new ye(x,k)}catch{return null}return p.forEach(function(le){ne.test(le)&&(!L||U.compare(le)===-1)&&(L=le,U=new M(L,k))}),L}t.minSatisfying=V;function V(p,x,k){var L=null,U=null;try{var ne=new ye(x,k)}catch{return null}return p.forEach(function(le){ne.test(le)&&(!L||U.compare(le)===1)&&(L=le,U=new M(L,k))}),L}t.minVersion=ae;function ae(p,x){p=new ye(p,x);var k=new M("0.0.0");if(p.test(k)||(k=new M("0.0.0-0"),p.test(k)))return k;k=null;for(var L=0;L<p.set.length;++L){var U=p.set[L];U.forEach(function(ne){var le=new M(ne.semver.version);switch(ne.operator){case">":le.prerelease.length===0?le.patch++:le.prerelease.push(0),le.raw=le.format();case"":case">=":(!k||ve(k,le))&&(k=le);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+ne.operator)}})}return k&&p.test(k)?k:null}t.validRange=me;function me(p,x){try{return new ye(p,x).range||"*"}catch{return null}}t.ltr=Ce;function Ce(p,x,k){return O(p,x,"<",k)}t.gtr=ee;function ee(p,x,k){return O(p,x,">",k)}t.outside=O;function O(p,x,k,L){p=new M(p,L),x=new ye(x,L);var U,ne,le,Se,be;switch(k){case">":U=ve,ne=ht,le=_e,Se=">",be=">=";break;case"<":U=_e,ne=et,le=ve,Se="<",be="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ot(p,x,L))return!1;for(var $e=0;$e<x.set.length;++$e){var ze=x.set[$e],Ue=null,Ve=null;if(ze.forEach(function(lt){lt.semver===Ne&&(lt=new te(">=0.0.0")),Ue=Ue||lt,Ve=Ve||lt,U(lt.semver,Ue.semver,L)?Ue=lt:le(lt.semver,Ve.semver,L)&&(Ve=lt)}),Ue.operator===Se||Ue.operator===be||(!Ve.operator||Ve.operator===Se)&&ne(p,Ve.semver))return!1;if(Ve.operator===be&&le(p,Ve.semver))return!1}return!0}t.prerelease=Ie;function Ie(p,x){var k=w(p,x);return k&&k.prerelease.length?k.prerelease:null}t.intersects=Re;function Re(p,x,k){return p=new ye(p,k),x=new ye(x,k),p.intersects(x)}t.coerce=Fe;function Fe(p,x){if(p instanceof M)return p;if(typeof p=="number"&&(p=String(p)),typeof p!="string")return null;x=x||{};var k=null;if(!x.rtl)k=p.match(h[f.COERCE]);else{for(var L;(L=h[f.COERCERTL].exec(p))&&(!k||k.index+k[0].length!==p.length);)(!k||L.index+L[0].length!==k.index+k[0].length)&&(k=L),h[f.COERCERTL].lastIndex=L.index+L[1].length+L[2].length;h[f.COERCERTL].lastIndex=-1}return k===null?null:w(k[2]+"."+(k[3]||"0")+"."+(k[4]||"0"),x)}}(Ln,Ln.exports)),Ln.exports}var xr,Ji;function eu(){if(Ji)return xr;Ji=1;const e=ti(),t=Zc(),r="semver",i={base:e.string(),type:"semverRange",validate:function(o,{error:a}){return t.validRange(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver range"}},s={};return s.compare={method:!1,validate:function(o,a,{exp:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{exp:d})},args:[{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},["gt","gte","lt","lte","eq","neq"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compare",args:{exp:a}})}}}),s.cmp={method:function(o,a){return this.$_addRule({name:"cmp",args:{cmp:o,exp:a}})},validate:function(o,a,{cmp:d,exp:h}){return t.cmp(o,d,h)?o:a.error(`${r}.cmp`,{cmp:d,exp:h})},args:[{name:"cmp",assert:o=>["===","!==","","=","==","!=",">",">=","<","<="].includes(o),message:"needs to be a valid comparator"},{name:"exp",assert:t.valid,message:"needs to be a valid semver expression"}]},s.compareRange={method:!1,validate:function(o,a,{rng:d},{name:h}){return t[h](o,d)?o:a.error(`${r}.${h}`,{rng:d})},args:[{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},["satisfies","gtr","ltr"].forEach(function(o){s[o]={method:function(a){return this.$_addRule({name:o,method:"compareRange",args:{rng:a}})}}}),s.outside={method:function(o,a){return this.$_addRule({name:"outside",args:{hilo:o,rng:a}})},validate:function(o,a,{hilo:d,rng:h}){return t.outside(o,h,d)?o:a.error(`${r}.outside`,{hilo:d,rng:h})},args:[{name:"hilo",assert:o=>[">","<"].includes(o),message:"needs to be a valid comparator"},{name:"rng",assert:t.validRange,message:"needs to be a valid semver range"}]},xr={semver:{base:e.string(),type:"semver",validate:function(o,{error:a}){return t.valid(o)?{value:o}:{errors:a(`${r}.valid`)}},messages:{[`${r}.valid`]:"{{#label}} needs to be a valid semver expression",[`${r}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${r}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${r}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${r}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${r}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${r}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${r}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${r}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${r}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${r}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${r}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:s},semverRange:i},xr}/*!
|
|
203
203
|
* is-var-name | ISC (c) Shinnosuke Watanabe
|
|
204
204
|
* https://github.com/shinnn/is-var-name
|
|
205
|
-
*/function tu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const nu=Object.freeze(Object.defineProperty({__proto__:null,default:tu},Symbol.toStringTag,{value:"Module"})),ru=Vo(nu);var Je={},Qi;function iu(){if(Qi)return Je;Qi=1;const e=ti();function t(z){return z&&typeof z=="object"&&"default"in z?z.default:z}const r=t(e),i={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},s={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},n={"-rm":!0,"--name":!0,"--label":!0,"--network":!0,"--user":!0},o={"--volume":!0,"--publish":!0},a=new Set(["--publish","--volume"]),d=z=>{const[W]=z.split(":");return W?.startsWith("/")||W?.startsWith("./")||W?.startsWith("../")||W?.startsWith("~")||W?.startsWith("$BLOCKLET")};function h(z){return z.map(W=>{if(W.key!=="--volume"||W.value.startsWith("$BLOCKLET_APP_DIR/")||W.value.startsWith("$BLOCKLET_DATA_DIR/"))return W;const[H,...A]=W.value.split(":");if(!H||!d(W.value))return W;const X=H.startsWith("/")?`$BLOCKLET_DATA_DIR${H}`:`$BLOCKLET_DATA_DIR/${H}`;return{...W,value:[X,...A].join(":")}})}function u(z){let W=!0;return z.find(A=>A.key==="--publish"&&A.type==="web")?z.map(A=>{if(A.key==="--publish"){const X={...A,type:W?"docker":A.type};return W=A.type==="web",X}return A}):z.map(A=>{if(A.key==="--publish"){const X={...A,type:W?"web":"docker"};return W=!1,X}return A})}function f(z){if(!z)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(z=z.trim(),z.startsWith("$ docker run")&&(z=z.replace("$ docker run","docker run")),!z.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const H=z.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!H)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const A=[],X=[];let $=0,he="",Oe="";const
|
|
206
|
-
`)}const m={"--volume":z=>{const[W]=z.split(":");return W?d(z)&&!z.startsWith("$BLOCKLET_APP_DIR/")&&!z.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":z.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},E=z=>z.replace(/^[-]+/,"").replace(/-([a-z])/g,(A,X)=>X.toUpperCase()),S=z=>`--${z.replace(/([A-Z])/g,"-$1").toLowerCase()}`,C=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],_=["rm ","sudo "];function N(z){if(z==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(z))throw new Error("Docker CMD is invalid");const H=z.toLocaleLowerCase();if(_.some(X=>H.indexOf(X)!==-1))throw new Error("Docker CMD is invalid");if(C.some(X=>z.indexOf(X)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(z))throw new Error("Docker CMD is invalid")}const D=Array.from(new Set(Object.keys(s).map(E))),c=["publish","volume"],w=r.object({workdir:r.string().trim().optional(),image:r.string().trim().regex(/^[^\s]+$/).optional(),shell:r.string().trim().optional(),volumes:r.array().items(r.string().trim()).optional(),script:r.string().trim().optional(),installNodeModules:r.boolean().optional(),skipWrapDockerfile:r.boolean().optional(),command:r.string().allow("").default("").optional().custom((z,W)=>{try{return N(z),z}catch(H){return W.error("any.invalid",{message:H.message})}},"Docker CMD validation"),runBaseScript:r.boolean().optional(),...D.reduce((z,W)=>{const H=m[S(W)];return c.includes(W)?(z[W]=r.array().items(r.string().trim()).optional(),H?z[W]=r.array().items(r.string().trim().custom((A,X)=>{const $=H(A);return $?X.message($):A})).optional():z[W]=r.array().items(r.string().trim()).optional(),z):(H?z[W]=r.string().trim().custom((A,X)=>{const $=H(A);return $?X.message($):A}).optional():z[W]=r.string().trim().optional(),z)},{})}).optional(),R=z=>{const W=/^(?:[a-zA-Z0-9.-]+(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(:[a-zA-Z0-9_.-]+)?$/;return r.string().trim().regex(W).required().validate(z)},B=(z,W,H)=>{const A={};H.forEach($=>{const he=E($.key);c.includes(he)?A[he]=[...A[he]||[],$.value]:A[he]=$.value});const{error:X}=R(z);if(X)return{error:X,value:A};try{N(z)}catch($){return{error:$,value:A}}return A.image=z,A.command=W||"",w.validate(A)};function M(z,W){const H=JSON.parse(JSON.stringify(W)),A=new Map;let X=1;const $=[];return H.forEach(he=>{if(he.key==="--publish"){const G=he.value.split(":");let we="127.0.0.1",de="",Le="";G.length===2?[de,Le]=G:G.length===3?[we,de,Le]=G:G.length===1&&(Le=G[0]||"");let ve=A.get(de||"");if(ve||(ve=`$BLOCKLET_PORT_${X++}`,A.set(de||"",ve)),!$.find(_e=>_e.port===de)){const _e=he.type||"docker",Pe=`${z.replace(/\W/g,"-")}-${$.length+1}`;$.push({type:_e,proxyBehavior:he.proxyBehavior||"",name:Pe,path:`/${Pe}`,port:de||Le,containerPort:Number(Le)||0,hostIP:we,prefix:_e==="docker"?`/${Pe}`:he.prefix||"*"})}}}),$}function re(z,W=!1){const H=[];if(!z)return H;for(const A of z){const X={name:A.key,default:A.value===`$${A.key}`?"":A.value,secure:A.secure!==void 0?A.secure:!1,shared:A.shared!==void 0?A.shared:!1,required:A.required!==void 0?A.required:!1,description:A.description||A.key};W||(X.custom=A.custom||""),H.push(X)}return H}function Z(z,W){const H=JSON.parse(JSON.stringify(z));return W.split(".").map(X=>{const $=X.match(/(.+)\[(.+?)\]/);return $?[$[1],$[2]]:X}).flat().filter(Boolean).reduce((X,$)=>{if(!X||!$)return;const he=$?.match(/(.+?)=(.+)/);if(Array.isArray(X)&&he){const[,G,we]=he;return G&&we&&(X=X.find(de=>{const Le=Object.keys(de).find(ve=>ve.toLowerCase()===G.toLowerCase());return Le&&de[Le]===we})),X}const Oe=Object.keys(X).find(G=>G.toLowerCase()===$.toLowerCase());return Oe?X[Oe]:void 0},H)}return Je.addBlockletPrefixVolume=h,Je.allowDockerArgs=s,Je.autoSetDockerArgs=n,Je.dockerArgsToCamelCase=E,Je.dockerArgsValidator=m,Je.dockerBuildCommand=j,Je.dockerCamelCaseToDash=S,Je.dockerCmdValidator=N,Je.dockerParseCommand=f,Je.dockerParseEnvironments=re,Je.dockerParsePublishPorts=M,Je.dockerSchema=w,Je.getObjByPath=Z,Je.isVolumePath=d,Je.multiValueArgs=c,Je.notAllowUseCustomDockerArgs=o,Je.parseDockerArgsToSchema=B,Je.whiteDockerArgs=i,Je}var wr,Zi;function ou(){if(Zi)return wr;Zi=1;const e=tl(),t=nl(),r=Gn();return wr=s=>{if((0,r.isValid)(s))return s;const n=(0,t.toHex)(gl.from(typeof s=="string"?s.trim():s));return(0,r.fromPublicKey)(n,{role:e.types.RoleType.ROLE_ANY})},wr}var Lt={},eo;function su(){if(eo)return Lt;eo=1;var e=Lt&&Lt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.didExtension=Lt.fileExtension=void 0;const t=e(ms),r=e(Zl()),i=Gn(),s=o=>({type:"file",base:o.string(),validate(a,{error:d}){return a&&typeof a=="string"?{value:a}:{errors:d("file.empty",{file:a})}},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:a=null,canSkip:d=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:a,canSkip:d}})},args:[{name:"baseDir",assert:a=>t.default.existsSync(a),message:"baseDir must exist"},{name:"canSkip",assert:a=>typeof a=="function",message:"canSkip must be a function"}],validate(a,{error:d},{baseDir:h,canSkip:u}={}){if(typeof u=="function"&&u(h,a))return a;try{return t.default.statSync(r.default.join(h,a)),a}catch(f){switch(f.code){case"ENOENT":return d("file.enoent",{file:a})}return d("file.error.generic",{message:f.message})}}}}});Lt.fileExtension=s;const n=o=>({type:"DID",base:o.string(),validate(a,{error:d}){return!a||typeof a!="string"?{errors:d("did.empty",{did:a})}:(0,i.isValid)(a)===!1?{errors:d("did.invalid",{did:a})}:{value:a}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});return Lt.didExtension=n,Lt.default={fileExtension:s,didExtension:n},Lt}var gn={},Sr={exports:{}};const au=["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 to;function lu(){if(to)return Sr.exports;to=1;var e=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),t=au,r=["node_modules","favicon.ico"],i=Sr.exports=function(n){var o=[],a=[];if(n===null)return a.push("name cannot be null"),s(o,a);if(n===void 0)return a.push("name cannot be undefined"),s(o,a);if(typeof n!="string")return a.push("name must be a string"),s(o,a);if(n.length||a.push("name length must be greater than zero"),n.match(/^\./)&&a.push("name cannot start with a period"),n.match(/^_/)&&a.push("name cannot start with an underscore"),n.trim()!==n&&a.push("name cannot contain leading or trailing spaces"),r.forEach(function(f){n.toLowerCase()===f&&a.push(f+" is a blacklisted name")}),t.forEach(function(f){n.toLowerCase()===f&&o.push(f+" is a core module name")}),n.length>214&&o.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&o.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&o.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var d=n.match(e);if(d){var h=d[1],u=d[2];if(encodeURIComponent(h)===h&&encodeURIComponent(u)===u)return s(o,a)}a.push("name can only contain URL-friendly characters")}return s(o,a)};i.scopedPackagePattern=e;var s=function(n,o){var a={validForNewPackages:o.length===0&&n.length===0,validForOldPackages:o.length===0,warnings:n,errors:o};return a.warnings.length||delete a.warnings,a.errors.length||delete a.errors,a};return Sr.exports}var no;function gs(){return no||(no=1,function(e){var t=gn&&gn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const r=Gn(),i=t(lu()),s=32,n=a=>{if((0,r.toTypeInfo)(a).role!==r.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=n;const o=(a,{checkDid:d=!0}={})=>{if((0,r.isValid)(a))d&&(0,e.validateNewDid)(a);else{const{validForNewPackages:h,errors:u=[],warnings:f=[]}=(0,i.default)(a);if(!h)throw new Error(u[0]||f[0]);if(a.length>s)throw new Error("Blocklet name is too long")}};e.validateName=o,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}}(gn)),gn}var ro;function vs(){if(ro)return ie;ro=1;var e=ie&&ie.__createBinding||(Object.create?function(V,ae,me,Ce){Ce===void 0&&(Ce=me);var ee=Object.getOwnPropertyDescriptor(ae,me);(!ee||("get"in ee?!ae.__esModule:ee.writable||ee.configurable))&&(ee={enumerable:!0,get:function(){return ae[me]}}),Object.defineProperty(V,Ce,ee)}:function(V,ae,me,Ce){Ce===void 0&&(Ce=me),V[Ce]=ae[me]}),t=ie&&ie.__setModuleDefault||(Object.create?function(V,ae){Object.defineProperty(V,"default",{enumerable:!0,value:ae})}:function(V,ae){V.default=ae}),r=ie&&ie.__importStar||function(){var V=function(ae){return V=Object.getOwnPropertyNames||function(me){var Ce=[];for(var ee in me)Object.prototype.hasOwnProperty.call(me,ee)&&(Ce[Ce.length]=ee);return Ce},V(ae)};return function(ae){if(ae&&ae.__esModule)return ae;var me={};if(ae!=null)for(var Ce=V(ae),ee=0;ee<Ce.length;ee++)Ce[ee]!=="default"&&e(me,ae,Ce[ee]);return t(me,ae),me}}(),i=ie&&ie.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.Joi=ie.eventsSchema=ie.installBlockletDescriptionSchema=ie.installBlockletTitleSchema=ie.resourceBundleSchema=ie.authConfigSchema=ie.cacheableSchema=ie.statsSchema=ie.titleSchema=ie.themeSchema=ie.signatureSchema=ie.serviceSchema=ie.scriptsSchema=ie.personSchema=ie.navigationSchema=ie.navigationItemSchema=ie.updateMountPointSchema=ie.mountPointSchema=ie.logoSchema=ie.interfaceSchema=ie.environmentNameSchema=ie.environmentSchema=ie.engineSchema=ie.endpointSchema=ie.distSchema=ie.descriptionSchema=ie.createBlockletSchema=ie.componentSchema=ie.blockletNameSchema=ie.blockletMetaSchema=void 0;const s=i(ms),n=i(ti()),o=i(Yc()),a=i(Qc()),d=eu(),h=i(ru),u=rl(),f=Gn(),j=iu(),m=Qo(),E=i(ou()),S=su(),C=gs(),_=r(Cl()),N=o.default.default,D="/.well-known",c=n.default.extend(d.semver).extend(d.semverRange).extend(S.fileExtension).extend(S.didExtension);ie.Joi=c;const w=(V,ae)=>(0,_.checkLink)(V)?V:ae.message(`Invalid navigation link: ${V}
|
|
205
|
+
*/function tu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const nu=Object.freeze(Object.defineProperty({__proto__:null,default:tu},Symbol.toStringTag,{value:"Module"})),ru=Vo(nu);var Je={},Qi;function iu(){if(Qi)return Je;Qi=1;const e=ti();function t(z){return z&&typeof z=="object"&&"default"in z?z.default:z}const r=t(e),i={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},s={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},n={"-rm":!0,"--name":!0,"--label":!0,"--network":!0,"--user":!0},o={"--volume":!0,"--publish":!0},a=new Set(["--publish","--volume"]),d=z=>{const[W]=z.split(":");return W?.startsWith("/")||W?.startsWith("./")||W?.startsWith("../")||W?.startsWith("~")||W?.startsWith("$BLOCKLET")};function h(z){return z.map(W=>{if(W.key!=="--volume"||W.value.startsWith("$BLOCKLET_APP_DIR/")||W.value.startsWith("$BLOCKLET_DATA_DIR/"))return W;const[H,...A]=W.value.split(":");if(!H||!d(W.value))return W;const X=H.startsWith("/")?`$BLOCKLET_DATA_DIR${H}`:`$BLOCKLET_DATA_DIR/${H}`;return{...W,value:[X,...A].join(":")}})}function u(z){let W=!0;return z.find(A=>A.key==="--publish"&&A.type==="web")?z.map(A=>{if(A.key==="--publish"){const X={...A,type:W?"docker":A.type};return W=A.type==="web",X}return A}):z.map(A=>{if(A.key==="--publish"){const X={...A,type:W?"web":"docker"};return W=!1,X}return A})}function f(z){if(!z)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(z=z.trim(),z.startsWith("$ docker run")&&(z=z.replace("$ docker run","docker run")),!z.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const H=z.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!H)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const A=[],X=[];let $=0,he="",Oe="";const K=[];for(;$<H.length;){const de=H[$];if(!de){$++;continue}if(de==="docker"||de==="run"){$++;continue}if((de==="-e"||de==="--env")&&$+1<H.length){const Le=H[$+1]||"",[ve,..._e]=Le.split("=");if(ve){const Pe=_e.join("=").replace(/^['"]|['"]$/g,"");X.push({key:ve,value:Pe})}$+=2;continue}if(de.startsWith("-")&&K.length===0){const Le=de.indexOf("=");let ve=de,_e=null;Le!==-1&&(ve=de.substring(0,Le),_e=de.substring(Le+1).replace(/^['"]|['"]$/g,""));const Pe=i[ve];if(!Pe){$+=2;continue}if(Pe==="--publish"){let He="";if(_e)He=_e,A.push({key:Pe,value:He});else if($+1<H.length&&!(H[$+1]||"").startsWith("-")){He=(H[$+1]||"").replace(/^['"]|['"]$/g,""),A.push({key:Pe,value:He}),$+=2;continue}else{A.push({key:Pe,value:"true"}),$++;continue}$++;continue}if(_e!==null){A.push({key:Pe,value:_e}),$++;continue}else if($+1<H.length&&!(H[$+1]||"").startsWith("-")){const He=(H[$+1]||"").replace(/^['"]|['"]$/g,"");A.push({key:Pe,value:He}),$+=2;continue}else{A.push({key:Pe,value:"true"}),$++;continue}}K.push(de),$++}he=K[0]||"",Oe=K.slice(1).join(" ");const we=[];for(const de of A)de.name="",de.path="",de.prefix="",de.protocol="",de.proxyBehavior="service",de.type="docker",!(a.has(de.key)&&de.value==="true")&&we.push(de);for(const de of X)de.custom="",de.description="",de.secure=!1,de.shared=!1,de.required=!1;return{dockerArgs:u(h(we)),dockerEnvs:X,dockerImage:he,dockerCommand:Oe}}function j({dockerArgs:z,dockerEnvs:W,dockerImage:H,dockerCommand:A}){if(z.length===0&&W.length===0&&!H)return"";const X=["docker run \\"],$=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const he of z){const{key:Oe,value:K}=he;if($.has(Oe))if(K==="true")X.push(` ${Oe} \\`);else{const we=/[\s"']/g.test(K)?`"${K}"`:K;X.push(` ${Oe} ${we} \\`)}else if(!X.some(we=>we.startsWith(` ${Oe}`)))if(K==="true")X.push(` ${Oe} \\`);else{const we=/[\s"']/g.test(K)?`"${K}"`:K;X.push(` ${Oe} ${we} \\`)}}for(const he of W){const{key:Oe,value:K}=he,we=/["']/g.test(K)?K:`"${K}"`;X.push(` -e ${Oe}=${we} \\`)}return H&&X.push(` ${H} \\`),A&&X.push(` ${A} \\`),X[X.length-1]?.endsWith(" \\")&&(X[X.length-1]=(X[X.length-1]||"").slice(0,-2)),X.join(`
|
|
206
|
+
`)}const m={"--volume":z=>{const[W]=z.split(":");return W?d(z)&&!z.startsWith("$BLOCKLET_APP_DIR/")&&!z.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":z.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},E=z=>z.replace(/^[-]+/,"").replace(/-([a-z])/g,(A,X)=>X.toUpperCase()),S=z=>`--${z.replace(/([A-Z])/g,"-$1").toLowerCase()}`,C=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],_=["rm ","sudo "];function N(z){if(z==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(z))throw new Error("Docker CMD is invalid");const H=z.toLocaleLowerCase();if(_.some(X=>H.indexOf(X)!==-1))throw new Error("Docker CMD is invalid");if(C.some(X=>z.indexOf(X)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(z))throw new Error("Docker CMD is invalid")}const D=Array.from(new Set(Object.keys(s).map(E))),c=["publish","volume"],w=r.object({workdir:r.string().trim().optional(),image:r.string().trim().regex(/^[^\s]+$/).optional(),shell:r.string().trim().optional(),volumes:r.array().items(r.string().trim()).optional(),script:r.string().trim().optional(),installNodeModules:r.boolean().optional(),skipWrapDockerfile:r.boolean().optional(),command:r.string().allow("").default("").optional().custom((z,W)=>{try{return N(z),z}catch(H){return W.error("any.invalid",{message:H.message})}},"Docker CMD validation"),runBaseScript:r.boolean().optional(),...D.reduce((z,W)=>{const H=m[S(W)];return c.includes(W)?(z[W]=r.array().items(r.string().trim()).optional(),H?z[W]=r.array().items(r.string().trim().custom((A,X)=>{const $=H(A);return $?X.message($):A})).optional():z[W]=r.array().items(r.string().trim()).optional(),z):(H?z[W]=r.string().trim().custom((A,X)=>{const $=H(A);return $?X.message($):A}).optional():z[W]=r.string().trim().optional(),z)},{})}).optional(),R=z=>{const W=/^(?:[a-zA-Z0-9.-]+(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(:[a-zA-Z0-9_.-]+)?$/;return r.string().trim().regex(W).required().validate(z)},B=(z,W,H)=>{const A={};H.forEach($=>{const he=E($.key);c.includes(he)?A[he]=[...A[he]||[],$.value]:A[he]=$.value});const{error:X}=R(z);if(X)return{error:X,value:A};try{N(z)}catch($){return{error:$,value:A}}return A.image=z,A.command=W||"",w.validate(A)};function M(z,W){const H=JSON.parse(JSON.stringify(W)),A=new Map;let X=1;const $=[];return H.forEach(he=>{if(he.key==="--publish"){const K=he.value.split(":");let we="127.0.0.1",de="",Le="";K.length===2?[de,Le]=K:K.length===3?[we,de,Le]=K:K.length===1&&(Le=K[0]||"");let ve=A.get(de||"");if(ve||(ve=`$BLOCKLET_PORT_${X++}`,A.set(de||"",ve)),!$.find(_e=>_e.port===de)){const _e=he.type||"docker",Pe=`${z.replace(/\W/g,"-")}-${$.length+1}`;$.push({type:_e,proxyBehavior:he.proxyBehavior||"",name:Pe,path:`/${Pe}`,port:de||Le,containerPort:Number(Le)||0,hostIP:we,prefix:_e==="docker"?`/${Pe}`:he.prefix||"*"})}}}),$}function re(z,W=!1){const H=[];if(!z)return H;for(const A of z){const X={name:A.key,default:A.value===`$${A.key}`?"":A.value,secure:A.secure!==void 0?A.secure:!1,shared:A.shared!==void 0?A.shared:!1,required:A.required!==void 0?A.required:!1,description:A.description||A.key};W||(X.custom=A.custom||""),H.push(X)}return H}function Z(z,W){const H=JSON.parse(JSON.stringify(z));return W.split(".").map(X=>{const $=X.match(/(.+)\[(.+?)\]/);return $?[$[1],$[2]]:X}).flat().filter(Boolean).reduce((X,$)=>{if(!X||!$)return;const he=$?.match(/(.+?)=(.+)/);if(Array.isArray(X)&&he){const[,K,we]=he;return K&&we&&(X=X.find(de=>{const Le=Object.keys(de).find(ve=>ve.toLowerCase()===K.toLowerCase());return Le&&de[Le]===we})),X}const Oe=Object.keys(X).find(K=>K.toLowerCase()===$.toLowerCase());return Oe?X[Oe]:void 0},H)}return Je.addBlockletPrefixVolume=h,Je.allowDockerArgs=s,Je.autoSetDockerArgs=n,Je.dockerArgsToCamelCase=E,Je.dockerArgsValidator=m,Je.dockerBuildCommand=j,Je.dockerCamelCaseToDash=S,Je.dockerCmdValidator=N,Je.dockerParseCommand=f,Je.dockerParseEnvironments=re,Je.dockerParsePublishPorts=M,Je.dockerSchema=w,Je.getObjByPath=Z,Je.isVolumePath=d,Je.multiValueArgs=c,Je.notAllowUseCustomDockerArgs=o,Je.parseDockerArgsToSchema=B,Je.whiteDockerArgs=i,Je}var wr,Zi;function ou(){if(Zi)return wr;Zi=1;const e=el(),t=tl(),r=Kn();return wr=s=>{if((0,r.isValid)(s))return s;const n=(0,t.toHex)(Ol.from(typeof s=="string"?s.trim():s));return(0,r.fromPublicKey)(n,{role:e.types.RoleType.ROLE_ANY})},wr}var Lt={},eo;function su(){if(eo)return Lt;eo=1;var e=Lt&&Lt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.didExtension=Lt.fileExtension=void 0;const t=e(ms),r=e(Zl()),i=Kn(),s=o=>({type:"file",base:o.string(),validate(a,{error:d}){return a&&typeof a=="string"?{value:a}:{errors:d("file.empty",{file:a})}},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:a=null,canSkip:d=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:a,canSkip:d}})},args:[{name:"baseDir",assert:a=>t.default.existsSync(a),message:"baseDir must exist"},{name:"canSkip",assert:a=>typeof a=="function",message:"canSkip must be a function"}],validate(a,{error:d},{baseDir:h,canSkip:u}={}){if(typeof u=="function"&&u(h,a))return a;try{return t.default.statSync(r.default.join(h,a)),a}catch(f){switch(f.code){case"ENOENT":return d("file.enoent",{file:a})}return d("file.error.generic",{message:f.message})}}}}});Lt.fileExtension=s;const n=o=>({type:"DID",base:o.string(),validate(a,{error:d}){return!a||typeof a!="string"?{errors:d("did.empty",{did:a})}:(0,i.isValid)(a)===!1?{errors:d("did.invalid",{did:a})}:{value:a}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});return Lt.didExtension=n,Lt.default={fileExtension:s,didExtension:n},Lt}var gn={},Sr={exports:{}};const au=["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 to;function lu(){if(to)return Sr.exports;to=1;var e=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),t=au,r=["node_modules","favicon.ico"],i=Sr.exports=function(n){var o=[],a=[];if(n===null)return a.push("name cannot be null"),s(o,a);if(n===void 0)return a.push("name cannot be undefined"),s(o,a);if(typeof n!="string")return a.push("name must be a string"),s(o,a);if(n.length||a.push("name length must be greater than zero"),n.match(/^\./)&&a.push("name cannot start with a period"),n.match(/^_/)&&a.push("name cannot start with an underscore"),n.trim()!==n&&a.push("name cannot contain leading or trailing spaces"),r.forEach(function(f){n.toLowerCase()===f&&a.push(f+" is a blacklisted name")}),t.forEach(function(f){n.toLowerCase()===f&&o.push(f+" is a core module name")}),n.length>214&&o.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&o.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&o.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var d=n.match(e);if(d){var h=d[1],u=d[2];if(encodeURIComponent(h)===h&&encodeURIComponent(u)===u)return s(o,a)}a.push("name can only contain URL-friendly characters")}return s(o,a)};i.scopedPackagePattern=e;var s=function(n,o){var a={validForNewPackages:o.length===0&&n.length===0,validForOldPackages:o.length===0,warnings:n,errors:o};return a.warnings.length||delete a.warnings,a.errors.length||delete a.errors,a};return Sr.exports}var no;function gs(){return no||(no=1,function(e){var t=gn&&gn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const r=Kn(),i=t(lu()),s=32,n=a=>{if((0,r.toTypeInfo)(a).role!==r.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=n;const o=(a,{checkDid:d=!0}={})=>{if((0,r.isValid)(a))d&&(0,e.validateNewDid)(a);else{const{validForNewPackages:h,errors:u=[],warnings:f=[]}=(0,i.default)(a);if(!h)throw new Error(u[0]||f[0]);if(a.length>s)throw new Error("Blocklet name is too long")}};e.validateName=o,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}}(gn)),gn}var ro;function vs(){if(ro)return ie;ro=1;var e=ie&&ie.__createBinding||(Object.create?function(V,ae,me,Ce){Ce===void 0&&(Ce=me);var ee=Object.getOwnPropertyDescriptor(ae,me);(!ee||("get"in ee?!ae.__esModule:ee.writable||ee.configurable))&&(ee={enumerable:!0,get:function(){return ae[me]}}),Object.defineProperty(V,Ce,ee)}:function(V,ae,me,Ce){Ce===void 0&&(Ce=me),V[Ce]=ae[me]}),t=ie&&ie.__setModuleDefault||(Object.create?function(V,ae){Object.defineProperty(V,"default",{enumerable:!0,value:ae})}:function(V,ae){V.default=ae}),r=ie&&ie.__importStar||function(){var V=function(ae){return V=Object.getOwnPropertyNames||function(me){var Ce=[];for(var ee in me)Object.prototype.hasOwnProperty.call(me,ee)&&(Ce[Ce.length]=ee);return Ce},V(ae)};return function(ae){if(ae&&ae.__esModule)return ae;var me={};if(ae!=null)for(var Ce=V(ae),ee=0;ee<Ce.length;ee++)Ce[ee]!=="default"&&e(me,ae,Ce[ee]);return t(me,ae),me}}(),i=ie&&ie.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.Joi=ie.eventsSchema=ie.installBlockletDescriptionSchema=ie.installBlockletTitleSchema=ie.resourceBundleSchema=ie.authConfigSchema=ie.cacheableSchema=ie.statsSchema=ie.titleSchema=ie.themeSchema=ie.signatureSchema=ie.serviceSchema=ie.scriptsSchema=ie.personSchema=ie.navigationSchema=ie.navigationItemSchema=ie.updateMountPointSchema=ie.mountPointSchema=ie.logoSchema=ie.interfaceSchema=ie.environmentNameSchema=ie.environmentSchema=ie.engineSchema=ie.endpointSchema=ie.distSchema=ie.descriptionSchema=ie.createBlockletSchema=ie.componentSchema=ie.blockletNameSchema=ie.blockletMetaSchema=void 0;const s=i(ms),n=i(ti()),o=i(Yc()),a=i(Qc()),d=eu(),h=i(ru),u=al(),f=Kn(),j=iu(),m=Yo(),E=i(ou()),S=su(),C=gs(),_=r(ll()),N=o.default.default,D="/.well-known",c=n.default.extend(d.semver).extend(d.semverRange).extend(S.fileExtension).extend(S.didExtension);ie.Joi=c;const w=(V,ae)=>(0,_.checkLink)(V)?V:ae.message(`Invalid navigation link: ${V}
|
|
207
207
|
|
|
208
208
|
A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
|
|
209
209
|
- /en/home
|
|
@@ -217,7 +217,7 @@ A valid navigation id is should follow the rules of javascript variables, such a
|
|
|
217
217
|
- foo123
|
|
218
218
|
|
|
219
219
|
see detail in https://www.npmjs.com/package/is-var-name
|
|
220
|
-
`),B=c.string().trim().min(1).custom(V=>{if(N(V)>m.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${m.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return V}).meta({className:"TTitle"});ie.titleSchema=B;const M=c.string().trim().min(3).max(160).meta({className:"TDescription"});ie.descriptionSchema=M;const re=c.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});ie.installBlockletTitleSchema=re;const Z=c.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});ie.installBlockletDescriptionSchema=Z;const z=c.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((V,ae)=>V.includes(u.WELLKNOWN_BLOCKLET_LOGO_PATH)?ae.message(`logo url should not include ${u.WELLKNOWN_BLOCKLET_LOGO_PATH}`):V).meta({className:"TLogo"});ie.logoSchema=z;const W=c.string().trim().min(1),H=W.meta({className:"TMountPoint"}).custom((V,ae)=>(0,_.isValidUrlPath)(V)?V:ae.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));ie.mountPointSchema=H;const A=W.meta({className:"TUpdateMountPoint"}).custom(V=>(0,_.default)(V));ie.updateMountPointSchema=A;const X=c.string().custom(V=>((0,C.validateName)(V),V)).meta({className:"TBlockletName"});ie.blockletNameSchema=X;const $=[],he=c.string().trim().min(1).max(50).required().custom((V,ae)=>V.startsWith("BLOCKLET")&&!$.includes(V)?ae.message("Env name can not start with BLOCKLET_"):V.startsWith("COMPONENT")?ae.message("Env name can not start with COMPONENT_"):V.startsWith("ABTNODE")?ae.message("Env name can not start with ABTNODE_"):/[^\w]/.test(V)?ae.message('Env name can include only numbers or letters or "_"'):V).meta({className:"TEnvironmentName",unknownType:"any"});ie.environmentNameSchema=he;const Oe=c.object({name:he.required(),description:c.string().trim().required(),default:c.string().optional().allow("").default(""),required:c.boolean().default(!1),secure:c.boolean().default(!1),validation:c.string().optional(),shared:c.boolean().default(V=>V.secure?!1:void 0)}).custom((V,ae)=>V.secure&&V.default?ae.message(`Cannot declare default value for secure env ${V.name}`):V).meta({className:"TEnvironment",unknownType:"any"});ie.environmentSchema=Oe;const G=c.object({dev:c.string().trim().min(1),e2eDev:c.string().trim().min(1),preFlight:c.string().trim().min(1),preInstall:c.string().trim().min(1),postInstall:c.string().trim().min(1),preStart:c.string().trim().min(1),postStart:c.string().trim().min(1),preStop:c.string().trim().min(1),preUninstall:c.string().trim().min(1),preConfig:c.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});ie.scriptsSchema=G;const we=c.object({name:c.string().required().trim(),config:c.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});ie.serviceSchema=we;const de=c.object({type:c.string().trim(!0).min(1).required(),path:c.string().required(),meta:c.object({vcType:c.string(),payable:c.boolean(),params:c.array().items({name:c.string().required().trim(),description:c.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});ie.endpointSchema=de;const Le=c.string().trim().custom((V,ae)=>{const me=V.split("/").filter(Boolean);return me.length===0?ae.message("cacheable path must be a valid pathname that is not /"):`/${me.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});ie.cacheableSchema=Le;const ve=c.object({type:c.string().lowercase().valid(...m.BLOCKLET_INTERFACE_TYPES).required(),name:c.string().trim().required(),path:c.string().trim().default("/"),prefix:c.string().trim().min(1).default(m.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:c.number().port().optional(),hostIP:c.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:c.string().lowercase().valid(...m.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:c.alternatives().try(c.string().uppercase().default(m.BLOCKLET_DEFAULT_PORT_NAME),c.object({internal:c.string().uppercase().required(),external:c.number().port().required()})).default(m.BLOCKLET_DEFAULT_PORT_NAME),cacheable:c.array().items(Le).unique(),services:c.array().items(we).unique("name"),endpoints:c.array().items(de).unique("type"),pageGroups:c.array().items(c.string().min(1).max(255).trim()).unique(),proxyBehavior:c.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});ie.interfaceSchema=ve;const _e=c.alternatives().try(c.string().required(),c.object({url:c.string().uri({scheme:["http","https","file"]}).required(),name:X.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}).required(),name:X.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),Pe=c.object({platform:c.string().valid(...m.BLOCKLET_PLATFORMS).optional(),interpreter:c.string().valid("binary","node","blocklet").default("node"),source:_e,args:c.array().items(c.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});ie.engineSchema=Pe;const He=c.object({name:c.string().min(1).required(),email:c.string().email({tlds:!1}).optional(),url:c.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});ie.personSchema=He;const et=c.object({tarball:c.alternatives().try(c.string().uri(),c.string()).required(),integrity:c.string().required(),size:c.number().optional()}).meta({className:"TDist",unknownType:"any"});ie.distSchema=et;const ht=c.object({downloads:c.number().integer().greater(-1),star:c.number().default(0),purchases:c.number().default(0)}).meta({className:"TStats",unknownType:"any"});ie.statsSchema=ht;const te={source:c.alternatives().try(c.object({url:c.alternatives().try(c.string().uri(),c.array().items(c.string().uri()).min(1)).required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}),name:X.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})).required(),required:c.boolean(),title:B,description:M,mountPoint:H,name:X},Ne=(V,ae)=>c.object(V).custom((me,Ce)=>!ae&&me.source&&me.source.name&&!me.source.store?Ce.message(`missing 'store' in source of component ${me.name}`):me),ye=Ne(te).meta({className:"TComponent",unknownType:"any"});ie.componentSchema=ye;const Be=Ne(te,!0),jt=({checkStore:V}={})=>{const ae=[ye,Be];return c.array().items(V?ae[0]:ae[1]).optional().default([])},Ot=c.object({type:c.string().required(),name:c.string().required(),signer:c.string().required(),pk:c.string().required(),created:c.string().isoDate().required(),sig:c.string().required(),excludes:c.array().items(c.string()).optional(),appended:c.array().items(c.string()).optional(),delegatee:c.string(),delegateePk:c.string(),delegation:c.string()}).meta({className:"TSignature",unknownType:"any"});ie.signatureSchema=Ot;const Me=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Ct={id:c.string().custom(R),title:c.alternatives().try(c.string().min(1).max(m.MAX_TITLE_LENGTH),c.object().min(1).pattern(c.string().valid(...Me),c.string().min(1).max(m.MAX_TITLE_LENGTH))).required(),description:c.alternatives().try(c.string().min(1).max(m.MAX_DESCRIPTION_LENGTH),c.object().min(1).pattern(c.string().valid(...Me),c.string().min(1).max(m.MAX_DESCRIPTION_LENGTH))),link:c.alternatives().try(c.string().custom(w),c.object().min(1).pattern(c.string().valid(...Me),c.string().custom(w))),component:c.string().min(1),section:c.array().items(c.string().min(1)).single(),role:c.array().items(c.string().min(1)).single(),icon:c.string().min(1),visible:c.boolean()},Et=c.object({...Ct,items:c.array().items(c.object({...Ct}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});ie.navigationItemSchema=Et;const _t=c.array().items(Et).unique((V,ae)=>V.id&&ae.id?V.id===ae.id:!1).meta({className:"TNavigation",unknownType:"any"});ie.navigationSchema=_t;const Ye=c.object({background:c.alternatives().try(c.string().min(1),c.object({header:c.string().min(1),footer:c.string().min(1),default:c.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});ie.themeSchema=Ye;const It=c.object({whoCanAccess:c.string().valid("owner","invited","all"),profileFields:c.array().items(c.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:c.array().items(c.string().min(1)),allowSwitchProfile:c.boolean(),blockUnauthenticated:c.boolean(),blockUnauthorized:c.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});ie.authConfigSchema=It;const Nt=c.object({type:c.string().trim().min(1).required(),description:c.string().trim().min(1)}),at=c.object({did:c.DID().trim().required(),type:c.string().trim().min(1).required(),public:c.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});ie.resourceBundleSchema=at;const qe=c.array().items(c.object({type:c.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:c.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});ie.eventsSchema=qe;const tt={did:c.DID().trim().required(),version:c.semver().valid().required(),name:c.string().optional(),description:M.required(),group:c.string().valid(...m.BLOCKLET_GROUPS),main:c.string().trim(),title:B.optional().allow(""),logo:c.string().trim().optional(),specVersion:c.semver().valid().gte("1.0.0").optional(),author:He.optional(),contributors:c.array().items(He).optional(),maintainers:c.array().items(He).optional(),community:c.string().uri().optional().allow("").default(""),documentation:c.string().uri().optional().allow("").default(""),homepage:c.string().uri().optional().allow("").default(""),license:c.string().optional().allow("").default(""),support:c.alternatives().try(c.string().uri(),c.string().email({tlds:!1})).optional(),nftFactory:c.DID().optional().allow("").default(""),payment:c.object({price:c.array().max(1).items(c.object({value:c.number().greater(0).required(),address:c.DID().required()})).default([]),share:c.array().max(4).items(c.object({name:c.string().required(),address:c.DID().required(),value:c.number().greater(0).max(1).required()})).default([]).custom(V=>{if(V.length===0)return V;const ae=V.reduce((me,Ce)=>me+Ce.value,0);if(ae!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${ae}`);return V},"invalid blocklet share"),componentPrice:c.array().items(c.object({parentPriceRange:c.array().items(c.number()).custom((V,ae)=>V.length!==2?ae.message("length of range should be 2"):V[0]<0?ae.message("the first value should not less than 0 in range"):V[1]<=V[0]?ae.message("the second value should greater than the first value in range"):V),type:c.string().valid("fixed","percentage").required(),value:c.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),tags:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),gitHash:c.string().optional().allow(""),repository:c.alternatives().try(c.string().min(1),c.object({type:c.string().valid("git","https","svn").required(),url:c.string().uri().required(),directory:c.string()})).optional(),timeout:c.object({start:c.number().min(10).max(600),script:c.number().min(1).max(1800)}).default({start:60}),requirements:c.object({abtnode:c.semverRange().valid(),server:c.semverRange().valid(),os:c.alternatives().try(c.string().valid("*",...m.BLOCKLET_PLATFORMS),c.array().items(c.string().valid(...m.BLOCKLET_PLATFORMS)).min(1)),cpu:c.alternatives().try(c.string().valid("*",...m.BLOCKLET_ARCHITECTURES),c.array().items(c.string().valid(...m.BLOCKLET_ARCHITECTURES)).min(1)),fuels:c.array().items(c.object({endpoint:c.string().trim().required(),address:c.string().trim(),value:c.string().trim().required(),reason:c.string().trim().required()})),nodejs:c.semverRange().valid()}).default({server:m.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:c.array().items(ve).unique("name").custom((V,ae)=>{if(V.filter(ee=>ee.type===m.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return ae.message(`Only one ${m.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const Ce=V.filter(ee=>ee.type===m.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const ee of Ce)if(!ee.prefix.startsWith(D))return ae.message(`Wellknown path prefix must start with: ${D}`);return V}).default([]),environments:c.array().items(Oe).default([]).optional().custom((V,ae)=>{if(V&&V.length){const me=V.filter((Ce,ee)=>V.findIndex(O=>O.name===Ce.name)!==ee);if(me.length)return ae.message(`find duplicate environment names ${me.map(Ce=>Ce.name).join(", ")}`)}return V}),scripts:G,capabilities:c.object({clusterMode:c.boolean(),didSpace:c.string().valid(...Object.values(m.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:c.boolean().default(!0),serverless:c.boolean().optional(),component:c.boolean(),sitemap:c.boolean().optional(),mcp:c.boolean().optional()}).default({}),files:c.array().items(c.string().trim()).optional(),resource:c.object({exportApi:c.string().trim(),bundles:c.array().items(at),types:c.array().items(Nt).max(10)}),engine:c.alternatives().try(Pe,c.array().items(Pe)).optional(),screenshots:c.array().items(c.string().min(1)).optional().default([]),videos:c.array().items(c.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:c.string().optional().allow(""),dist:et.optional(),stats:ht.optional(),htmlAst:c.any().optional(),path:c.string().optional(),signatures:c.array().items(Ot).optional(),lastPublishedAt:c.string().isoDate().optional().allow(null),components:jt(),navigation:_t,theme:Ye,copyright:c.object({owner:c.string().min(1),year:c.alternatives().try(c.string(),c.number())}),bundleName:c.string(),bundleDid:c.DID().trim(),storeId:c.string(),events:qe.optional()},ot=c.object(tt).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});ie.blockletMetaSchema=ot;const mt=(V,{ensureFiles:ae=!1,ensureDist:me=!1,ensureComponentStore:Ce=!0,ensureName:ee=!1,skipValidateDidName:O=!1,...Ie}={})=>((!V||!s.default.existsSync(V))&&(ae=!1),c.object({...tt,owner:c.object({avatar:c.string().optional(),did:c.DID().trim().required(),fullName:c.string().trim().required(),email:c.string().optional().allow(null).empty("").default("")}).optional(),logo:ae?c.file().trim().exists({baseDir:V}).optional():c.string().trim().optional(),files:c.array().items(ae?c.file().exists({baseDir:V,canSkip:(Re,Fe)=>[m.BLOCKLET_ENTRY_FILE,m.BLOCKLET_BUNDLE_FILE].includes(Fe)||(0,a.default)(Fe)}):c.string().trim()).optional(),dist:me?et.required():et.optional(),components:jt({checkStore:Ce}),name:ee?c.string().optional():c.string().required(),egress:c.boolean().optional().default(!0),docker:j.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...Ie}).rename("children","components").custom((Re,Fe)=>{const{did:p,name:x,docker:k}=Re;if(k){const{image:U,dockerfile:ne,network:le}=k;if(!U&&!ne)return Fe.message("Image or dockerfile must be set");if(U&&ne)return Fe.message("Image and dockerfile cannot be set at the same time");if(le)return Fe.message("ExportPorts and network cannot be set at the same time");ne&&(Re.files||(Re.files=[]),Re.files.push(ne))}let L;if((0,f.isValid)(p))try{return(0,C.validateNewDid)(p),Re}catch(U){L=U}if(x){(0,C.validateName)(x,{checkDid:!O});const U=(0,E.default)(x);return U!==p?Fe.message(`The did of name "${x}" should be "${U}"`):Re}return L?Fe.message(L.message):Re}));return ie.createBlockletSchema=mt,ie.default={blockletNameSchema:X,componentSchema:ye,endpointSchema:de,serviceSchema:we,createBlockletSchema:mt,interfaceSchema:ve,environmentSchema:Oe,environmentNameSchema:he,scriptsSchema:G,personSchema:He,distSchema:et,titleSchema:B,descriptionSchema:M,logoSchema:z,navigationSchema:_t,themeSchema:Ye,mountPointSchema:H,updateMountPointSchema:A,authConfigSchema:It,resourceBundleSchema:at,installBlockletTitleSchema:re,installBlockletDescriptionSchema:Z,eventsSchema:qe,Joi:c},ie}var pt={},io;function cu(){if(io)return pt;io=1;var e=pt&&pt.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(pt,"__esModule",{value:!0}),pt.setService=pt.findService=pt.getDefaultServiceConfig=pt.getServiceConfig=void 0;const t=e(ec),r=vs(),i={},s=h=>{i[h.name]={validate:h.schema.validate.bind(h.schema),defaultConfig:h.default}};pt.setService=s,s({name:"auth",schema:r.authConfigSchema,default:{}});const n=h=>{if(!h)throw new Error("service name should not be empty");const u=i[h];if(!u)throw new Error(`service ${h} does not exist`);return u},o=(h,u,{validate:f}={})=>{const j=n(h),m=(0,t.default)(u||{}),{value:E,error:S}=j.validate(m);if(f&&S)throw new Error(`Invalid blocklet service config: ${S.details.map(C=>C.message).join(", ")}`);return E};pt.getServiceConfig=o;const a=h=>{const{defaultConfig:u}=n(h);return u};pt.getDefaultServiceConfig=a;const d=(h,u)=>{const f=[u];return(h||[]).find(j=>f.includes(j.name))};return pt.findService=d,pt.default={getServiceConfig:o,getDefaultServiceConfig:a,findService:d,setService:s},pt}var oo;function uu(){if(oo)return Vt;oo=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.fixAndValidateService=Vt.validateMeta=void 0;const e=vs(),t=cu(),r=s=>(!s.interfaces||!s.interfaces.length||s.interfaces.forEach(n=>{n.services&&n.services.length&&n.services.forEach(o=>{o.config=(0,t.getServiceConfig)(o.name,o.config,{validate:!0})})}),s);Vt.fixAndValidateService=r;const i=(s,{ensureFiles:n=!1,ensureDist:o=!1,ensureComponentStore:a=!0,ensureName:d=!1,skipValidateDidName:h=!1,schemaOptions:u={}}={})=>{const f=(0,e.createBlockletSchema)(null,{ensureFiles:n,ensureDist:o,ensureComponentStore:a,ensureName:d,skipValidateDidName:h,...u}),{value:j,error:m}=f.validate(s);if(m)throw new Error(`Invalid blocklet meta: ${m.details.map(E=>E.message).join(", ")}`);return j};return Vt.validateMeta=i,Vt.default=i,Vt}var so;function du(){return so||(so=1,function(e){var t=kt&&kt.__createBinding||(Object.create?function(w,R,B,M){M===void 0&&(M=B);var re=Object.getOwnPropertyDescriptor(R,B);(!re||("get"in re?!R.__esModule:re.writable||re.configurable))&&(re={enumerable:!0,get:function(){return R[B]}}),Object.defineProperty(w,M,re)}:function(w,R,B,M){M===void 0&&(M=B),w[M]=R[B]}),r=kt&&kt.__setModuleDefault||(Object.create?function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}:function(w,R){w.default=R}),i=kt&&kt.__importStar||function(){var w=function(R){return w=Object.getOwnPropertyNames||function(B){var M=[];for(var re in B)Object.prototype.hasOwnProperty.call(B,re)&&(M[M.length]=re);return M},w(R)};return function(R){if(R&&R.__esModule)return R;var B={};if(R!=null)for(var M=w(R),re=0;re<M.length;re++)M[re]!=="default"&&t(B,R,M[re]);return r(B,R),B}}(),s=kt&&kt.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};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 n=s(Il),o=i(Gc()),a=Qo(),d=uu();Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const h=gs(),u=(w,R)=>{w.description||(w.description=`Blocklet from ${R}`),w.version||(w.version=a.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=u;const f=w=>{if(w.repository&&(typeof w.repository=="string"&&(w.repository={type:"git",url:w.repository}),w.repository.url)){const R=o.fromUrl(w.repository.url);R&&(w.repository.url=R.getDefaultRepresentation()==="shortcut"?R.https():R.toString())}};e.fixRepository=f;const j=w=>{Array.isArray(w.files)?w.files&&(w.files=w.files.filter(R=>!(!R||typeof R!="string"))):delete w.files};e.fixFiles=j;const m=w=>{typeof w.keywords=="string"&&(w.keywords=w.keywords.split(/,\s+/)),w.keywords&&!Array.isArray(w.keywords)?delete w.keywords:w.keywords&&(w.keywords=w.keywords.filter(R=>!(typeof R!="string"||!R)))};e.fixKeywords=m;const E=w=>{typeof w.tags=="string"&&(w.tags=w.tags.split(/,\s+/)),w.tags&&!Array.isArray(w.tags)?delete w.tags:w.tags&&(w.tags=w.tags.filter(R=>!(typeof R!="string"||!R)))};e.fixTags=E;const S=(w,R)=>(w.author&&(w.author=R(w.author)),["maintainers","contributors"].forEach(B=>{Array.isArray(w[B])&&(w[B]=w[B].map(R))}),w),C=w=>{if(!w)return"";if(typeof w=="string")return w;const R=w.name||"",B=w.url||w.web,M=B?` (${B})`:"",re=w.email||w.mail,Z=re?` <${re}>`:"";return R+Z+M};e.formatPerson=C;const _=w=>{if(typeof w!="string")return w;const R=w.match(/^([^(<]+)/),B=w.match(/\(([^)]+)\)/),M=w.match(/<([^>]+)>/),re={};return R&&R[0].trim()&&(re.name=R[0].trim()),M&&([,re.email]=M),B&&([,re.url]=B),re};e.parsePerson=_;const N=w=>(S(w,C),S(w,_),w);e.fixPerson=N;const D=(w,R=!0)=>{if(Array.isArray(w.interfaces)||(w.interfaces=[]),w.interfaces.length)return w.interfaces.forEach(Z=>{Z.type===a.BLOCKLET_INTERFACE_TYPE_WEB&&(Z.protocol="http")}),w;const M=(0,n.default)(w,"capabilities.dynamicPathPrefix",!0)?a.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",re=({type:Z="web",name:z,path:W="/",protocol:H="http",port:A=a.BLOCKLET_DEFAULT_PORT_NAME})=>{w.interfaces.push({type:Z,name:z,path:W,prefix:M,port:A,protocol:H})};return[a.BLOCKLET_INTERFACE_PUBLIC].forEach(Z=>{w[Z]&&re({name:Z,path:w[Z]})}),Array.isArray(w.exposeServices)&&w.exposeServices.forEach(Z=>{re({type:"service",name:Z.protocol,protocol:Z.protocol,port:{internal:`BLOCKLET_${Z.protocol}_PORT`.toUpperCase(),external:Z.port}})}),R&&(delete w.publicUrl,delete w.adminUrl,delete w.configUrl,delete w.docUrl,delete w.exposeServices,w.capabilities&&delete w.capabilities.dynamicPathPrefix),w};e.fixInterfaces=D;const c=w=>{const{did:R}=w;try{(0,h.validateNewDid)(R),w.name=R}catch{}return w};e.fixName=c,e.default={fixRequired:u,fixRepository:f,fixFiles:j,fixKeywords:m,fixPerson:N,fixTags:E,fixName:c,formatPerson:C,parsePerson:_,fixInterfaces:D,fixService:d.fixAndValidateService}}(kt)),kt}var hu=du();function ys({owner:e,locale:t}){return l.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?l.jsx(Ko,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}ys.propTypes={owner:F.object.isRequired,locale:F.string.isRequired};const fu="install-blocklet-from-URL",bs=()=>{const[e,t]=ri(fu,"[]",{raw:!0}),r=s=>{const n=s.trim(),o=JSON.parse(e),a=o.findIndex(d=>d===n);a!==0&&(a>0&&o.splice(a,1),o.length>=10&&o.splice(9),o.unshift(n),t(JSON.stringify(o)))},i=s=>{if(!s)return;const n=JSON.parse(e),o=s.trim(),a=n.findIndex(d=>d===o);a>-1&&(n.splice(a,1),t(JSON.stringify(n)))};return{urls:e?JSON.parse(e):[],addUrlRecord:r,removeUrlRecord:i}};function xs({value:e="",onValueChange:t=()=>{},children:r=null,helperText:i=""}){const{urls:s,removeUrlRecord:n}=bs(),o=(a,d)=>{a.preventDefault(),a.stopPropagation(),n(d)};return l.jsxs(oe,{children:[l.jsx(No,{freeSolo:!0,options:s,inputValue:e,onInputChange:(a,d)=>{t(d)},disableClearable:!0,popupIcon:null,renderInput:a=>Ut.cloneElement(r,{...a}),renderOption:(a,d)=>q.createElement(Ao,{...a,key:d,secondaryAction:l.jsx(_o,{edge:"end","aria-label":"delete",onClick:h=>o(h,d),children:l.jsx(ya,{})})},l.jsx(ba,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:l.jsx(Do,{primary:d,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),l.jsx(xa,{style:{margin:0},children:i})]})}xs.propTypes={onValueChange:F.func,children:F.node,value:F.string,helperText:F.string};function ws({onClick:e}){const{t}=wt();return l.jsx(il,{title:t("launchBlocklet.withoutWallet"),icon:l.jsx(bt,{icon:ol,fontSize:"1em"}),onClick:e})}ws.propTypes={onClick:F.func.isRequired};function Ss({defaultUrl:e="",onCancel:t,onSuccess:r,onError:i=()=>{},mode:s="install",handleText:n={}}){const{api:o}=ln(),{api:a,session:d}=tc(),[h,u]=q.useState(!1),[f,j]=q.useState(""),{t:m,locale:E}=wt(),S={dist:{}},{encryptKey:C}=sl(),[_,N]=q.useState(e),[D,c]=q.useState(e?1:0),[w,R]=q.useState(S),[B,M]=q.useState(!1),[re,Z]=q.useState(""),[z]=ri("instant-blocklet-install",!1),[W,H]=q.useState({}),A=s==="component",X=A?!0:!e,{addUrlRecord:$}=bs(),he=q.useMemo(()=>(d.user?.connectedAccounts||[]).some(ye=>ye.provider===Bt.LOGIN_PROVIDER.WALLET),[d.user]),Oe=async()=>{R(S),j(null),u(!0);let te=_.trim();!te.startsWith("https://")&&!te.startsWith("http://")&&!te.startsWith("file://")&&(te=`file://${te}`);try{const Ne=decodeURIComponent(te);try{new URL(Ne)}catch{throw new Error("Invalid URL")}const{meta:ye,inStore:Be,registryUrl:jt}=await o.getBlockletMetaFromUrl({input:{url:Ne}});R(ye),H({inStore:Be,registryUrl:jt,inputUrl:te}),$(te)}catch(Ne){console.error(Ne);const ye=`Blocklet Install failed: ${Br(Ne)}`;j(ye),i(Ne)}finally{u(!1)}},G=()=>{if(A){r({meta:w,...W}),t();return}if(z){u(!0),M(!0);return}const te=Zt(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=Xn(te,{blocklet_meta_url:decodeURIComponent(_.trim()),from:"url"})},we=()=>{u(!1),M(!1),r({meta:w,...W}),t()},de=()=>{u(!1),M(!1)};q.useEffect(()=>{e&&Oe()},[e]);const Le=q.useMemo(()=>({title:w.title,wt:Rl(w),blockletMetaUrl:decodeURIComponent(_.trim())}),[w,_]),ve=q.useCallback(async()=>{if(he||z){Z("");return}const te=new URL(window.location.href);te.pathname=Zt(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),te.searchParams.set("_ek_",C),Object.keys(Le).forEach(ye=>{te.searchParams.set(ye,Le[ye])});const{data:Ne}=await a.get(te.href);Ne.url?Z(Ne.url):Z("")},[he,Le,a,C,z]);q.useEffect(()=>{ve()},[ve]);const _e=q.useMemo(()=>he&&re?{...Le,nw:re,skipMigrateAccount:!0}:Le,[Le,re,he]),Pe=[{name:m("common.name"),value:$t.getDisplayName({meta:w},!0)},{name:m("common.version"),value:w.version},{name:m("common.did"),value:w.did?l.jsx(nc,{did:w.did}):null},{name:m("common.author"),value:w.owner?l.jsx(ys,{owner:w.owner,locale:E}):hu.formatPerson(w.author)},{name:m("blocklet.dist.downloadLink"),value:w.dist.tarball}],He=()=>h?l.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:l.jsx(Tt,{})}):w.did?l.jsx("div",{style:{paddingLeft:"10%"},children:Pe.map(te=>te.name===m("common.did")?l.jsx(Pi,{valueComponent:"div",nameWidth:120,name:te.name,nameFormatter:()=>m("common.did"),children:te.value},te.name):l.jsx(Pi,{valueComponent:"div",nameWidth:120,name:te.name,children:te.value},te.name))}):null,et=Xl(async()=>{let te=w.title;d.user&&(te=`${d.user.fullName}'s ${w.title}`);try{we(),await o.launchBlockletWithoutWallet({input:{title:te,blockletMetaUrl:decodeURIComponent(_.trim()),type:"store",storeUrl:W.registryUrl,onlyRequired:!0}})}catch(Ne){console.error("launchBlockletWithoutWallet error:",Ne),Kn.error(Br(Ne),{autoHideDuration:3e3})}}),ht=[{label:m("blocklet.fromUrl.step0"),body:l.jsx(je,{component:"div",children:l.jsx(xs,{style:{marginBottom:32},value:_,helperText:m("blocklet.fromUrl.description"),onValueChange:te=>{j(null),N(te)},children:l.jsx(Vn,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:_,onChange:te=>{j(null),N(te.target.value)},disabled:h,onKeyPress:te=>{te.key==="Enter"&&(te.preventDefault(),Oe(),c(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:t,onConfirm:()=>{Oe(),c(1)}},{label:m("blocklet.fromUrl.step1"),body:He(),cancel:m(X?"common.pre":"common.cancel"),confirm:n?.confirm||m("blocklet.fromUrl.confirm"),onCancel:()=>{X?c(te=>te-1):t()},onConfirm:()=>{G()}}],Ze=ht[D];return l.jsxs(l.Fragment,{children:[l.jsxs(ni,{title:n?.title||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Ze.onCancel(),showCloseButton:D===0,disableEscapeKeyDown:!0,open:!0,actions:l.jsxs(l.Fragment,{children:[Ze.cancel&&l.jsx(yt,{onClick:te=>{te.stopPropagation(),j(null),Ze.onCancel()},color:"inherit",children:Ze.cancel||m("common.cancel")}),l.jsxs(yt,{onClick:te=>{te.stopPropagation(),Ze.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:h||!_||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[h&&D===0&&l.jsx(Tt,{size:16}),Ze.confirm]})]}),children:[X&&l.jsx(wa,{alternativeLabel:!0,activeStep:D,children:ht.map(({label:te})=>l.jsx(Sa,{children:l.jsx(Ea,{children:te})},te))}),l.jsx(ka,{component:"div",style:{marginTop:24},children:Ze.body}),!!f&&l.jsx(Mo,{severity:"error",style:{width:"100%",marginTop:8},children:f})]}),w&&B&&l.jsx(Ho,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!he&&!z?"bind-wallet":"launch-free-blocklet-by-session",checkFn:a.get,checkTimeout:5*60*1e3,onSuccess:we,extraParams:_e,messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:de,customItems:z?[]:[l.jsx(ws,{onClick:et})]})]})}Ss.propTypes={defaultUrl:F.string,onCancel:F.func.isRequired,onSuccess:F.func.isRequired,onError:F.func,mode:F.oneOf(["install","component"]),handleText:F.object};const pu={meta:F.object.isRequired,onCancel:F.func.isRequired};function Es({action:e,onSelect:t,onNext:r}){const{t:i}=wt(),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 l.jsxs(l.Fragment,{children:[l.jsx(Ta,{children:s.map(n=>l.jsxs(Ao,{button:!0,selected:e===n.action,onClick:()=>t(n.action),children:[l.jsx(ja,{sx:{minWidth:48},children:n.action==="purchase"?l.jsx(Oa,{style:{color:e==="purchase"?Ti.primary.main:"#AAA",fontSize:32}}):l.jsx(Ca,{style:{color:e==="verify"?Ti.primary.main:"#AAA",fontSize:32}})}),l.jsx(Do,{primary:n.title,secondary:n.description})]},n.action))}),r&&l.jsx(yt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:i("common.next")})]})}Es.propTypes={action:F.oneOf(["both","purchase","verify"]).isRequired,onSelect:F.func.isRequired,onNext:F.func.isRequired};function ks({meta:e,onCancel:t,mode:r,handlePaySuccess:i=()=>{}}){const{t:s,locale:n}=wt(),{info:o}=ln(),a=Pl(o),[d,h]=q.useState(null),u=new URL(e?.registryUrl).origin,f=$t.getDisplayName({meta:e}),j=async(E,S)=>{const C=({downloadTokenList:D})=>{i({downloadTokenList:D})},_=D=>{Kn.error(D),t(D)};function N(D){return al(()=>Li.get(D).then(async({data:c})=>{const w=c?.downloadTokenList;if(c.status==="succeed"){if(w&&w.length)await C({downloadTokenList:w});else return await _(s("blocklet.component.missDownloadTokenTip")),!0;return!0}return c.status==="error"?(console.error("vc error: ",c),await _(c?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:D}=Ll(d);await N(D)}else await C({downloadTokenList:E.downloadTokenList&&S(E.downloadTokenList)})};if(q.useEffect(()=>{if(r==="purchase"){const E=new URL(u);E.pathname="/api/did/verify-purchase-blocklet/token",E.searchParams.set("serverDid",o.did),E.searchParams.set("blockletDid",e?.did);try{Li.get(E.href).then(({data:S})=>{const C=`${S.url}`;h(C)})}catch(S){console.error("get next workflow url error: ",S)}}return()=>{h(null)}},[r]),r==="purchase"&&!d)return"";const m={verify:{action:"verify-purchase-blocklet",checkFn:Ii.create({baseURL:u}).get,extraParams:{serverDid:o.did,blockletDid:e?.did},messages:{title:s("store.purchase.verify.auth.title",{name:f}),scan:s("store.purchase.verify.auth.scan"),confirm:s("store.purchase.verify.auth.confirm"),success:s("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Ii.create({baseURL:Zt(u,"/store")}).get,extraParams:{factory:e.nftFactory,nw:d},messages:{title:s("store.purchase.auth.title",{name:f}),scan:s("store.purchase.auth.scan"),confirm:s("store.purchase.auth.confirm"),success:l.jsxs(l.Fragment,{children:[l.jsx("p",{children:s("store.purchase.auth.success")}),l.jsx("p",{children:s("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return l.jsx(Ho,{open:!0,locale:n,popup:!1,saveConnect:!1,className:"connect",baseUrl:u,onSuccess:j,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:a,disableClose:!0,showDownload:!1,...m[r]})}ks.propTypes={...pu,handlePaySuccess:F.func,mode:F.oneOf(["verify","purchase"]).isRequired};function Ts({ref:e=null,mode:t,...r}){const[i,s]=q.useState(t!=="both"?t:"verify"),[n,o]=q.useState(t!=="both"?2:1),a=h=>{h!==i&&s(h)},d=()=>{i&&n!==2&&o(2)};return q.useImperativeHandle(e,()=>({onNext:d,getCurrentStep:()=>n})),n===1?l.jsx("div",{style:{maxWidth:520},children:l.jsx(Es,{action:i,onNext:null,onSelect:a})}):l.jsx(ks,{...r,mode:i})}Ts.propTypes={mode:F.oneOf(["both","verify","purchase"]).isRequired,ref:F.any};function mu({...e}){return l.jsx(yt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function js({blocklet:e=null,onStartNow:t=()=>{},children:r=null,disabled:i=!1}){const{t:s}=wt(),n=is();return!e||_l(e.meta)?l.jsx(gu,{children:r}):l.jsxs(vu,{isMobile:n,children:[l.jsx(mu,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>t(),children:s("setup.startNow")}),l.jsx(oe,{sx:{display:"flex",alignItems:"center"},children:r})]})}js.propTypes={blocklet:F.object,onStartNow:F.func,children:F.any,disabled:F.bool};const gu=it(oe)`
|
|
220
|
+
`),B=c.string().trim().min(1).custom(V=>{if(N(V)>m.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${m.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return V}).meta({className:"TTitle"});ie.titleSchema=B;const M=c.string().trim().min(3).max(160).meta({className:"TDescription"});ie.descriptionSchema=M;const re=c.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});ie.installBlockletTitleSchema=re;const Z=c.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});ie.installBlockletDescriptionSchema=Z;const z=c.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((V,ae)=>V.includes(u.WELLKNOWN_BLOCKLET_LOGO_PATH)?ae.message(`logo url should not include ${u.WELLKNOWN_BLOCKLET_LOGO_PATH}`):V).meta({className:"TLogo"});ie.logoSchema=z;const W=c.string().trim().min(1),H=W.meta({className:"TMountPoint"}).custom((V,ae)=>(0,_.isValidUrlPath)(V)?V:ae.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));ie.mountPointSchema=H;const A=W.meta({className:"TUpdateMountPoint"}).custom(V=>(0,_.default)(V));ie.updateMountPointSchema=A;const X=c.string().custom(V=>((0,C.validateName)(V),V)).meta({className:"TBlockletName"});ie.blockletNameSchema=X;const $=[],he=c.string().trim().min(1).max(50).required().custom((V,ae)=>V.startsWith("BLOCKLET")&&!$.includes(V)?ae.message("Env name can not start with BLOCKLET_"):V.startsWith("COMPONENT")?ae.message("Env name can not start with COMPONENT_"):V.startsWith("ABTNODE")?ae.message("Env name can not start with ABTNODE_"):/[^\w]/.test(V)?ae.message('Env name can include only numbers or letters or "_"'):V).meta({className:"TEnvironmentName",unknownType:"any"});ie.environmentNameSchema=he;const Oe=c.object({name:he.required(),description:c.string().trim().required(),default:c.string().optional().allow("").default(""),required:c.boolean().default(!1),secure:c.boolean().default(!1),validation:c.string().optional(),shared:c.boolean().default(V=>V.secure?!1:void 0)}).custom((V,ae)=>V.secure&&V.default?ae.message(`Cannot declare default value for secure env ${V.name}`):V).meta({className:"TEnvironment",unknownType:"any"});ie.environmentSchema=Oe;const K=c.object({dev:c.string().trim().min(1),e2eDev:c.string().trim().min(1),preFlight:c.string().trim().min(1),preInstall:c.string().trim().min(1),postInstall:c.string().trim().min(1),preStart:c.string().trim().min(1),postStart:c.string().trim().min(1),preStop:c.string().trim().min(1),preUninstall:c.string().trim().min(1),preConfig:c.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});ie.scriptsSchema=K;const we=c.object({name:c.string().required().trim(),config:c.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});ie.serviceSchema=we;const de=c.object({type:c.string().trim(!0).min(1).required(),path:c.string().required(),meta:c.object({vcType:c.string(),payable:c.boolean(),params:c.array().items({name:c.string().required().trim(),description:c.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});ie.endpointSchema=de;const Le=c.string().trim().custom((V,ae)=>{const me=V.split("/").filter(Boolean);return me.length===0?ae.message("cacheable path must be a valid pathname that is not /"):`/${me.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});ie.cacheableSchema=Le;const ve=c.object({type:c.string().lowercase().valid(...m.BLOCKLET_INTERFACE_TYPES).required(),name:c.string().trim().required(),path:c.string().trim().default("/"),prefix:c.string().trim().min(1).default(m.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:c.number().port().optional(),hostIP:c.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:c.string().lowercase().valid(...m.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:c.alternatives().try(c.string().uppercase().default(m.BLOCKLET_DEFAULT_PORT_NAME),c.object({internal:c.string().uppercase().required(),external:c.number().port().required()})).default(m.BLOCKLET_DEFAULT_PORT_NAME),cacheable:c.array().items(Le).unique(),services:c.array().items(we).unique("name"),endpoints:c.array().items(de).unique("type"),pageGroups:c.array().items(c.string().min(1).max(255).trim()).unique(),proxyBehavior:c.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});ie.interfaceSchema=ve;const _e=c.alternatives().try(c.string().required(),c.object({url:c.string().uri({scheme:["http","https","file"]}).required(),name:X.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}).required(),name:X.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})),Pe=c.object({platform:c.string().valid(...m.BLOCKLET_PLATFORMS).optional(),interpreter:c.string().valid("binary","node","blocklet").default("node"),source:_e,args:c.array().items(c.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});ie.engineSchema=Pe;const He=c.object({name:c.string().min(1).required(),email:c.string().email({tlds:!1}).optional(),url:c.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});ie.personSchema=He;const et=c.object({tarball:c.alternatives().try(c.string().uri(),c.string()).required(),integrity:c.string().required(),size:c.number().optional()}).meta({className:"TDist",unknownType:"any"});ie.distSchema=et;const ht=c.object({downloads:c.number().integer().greater(-1),star:c.number().default(0),purchases:c.number().default(0)}).meta({className:"TStats",unknownType:"any"});ie.statsSchema=ht;const te={source:c.alternatives().try(c.object({url:c.alternatives().try(c.string().uri(),c.array().items(c.string().uri()).min(1)).required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid())}),c.object({store:c.string().uri({scheme:["http","https"]}),name:X.required(),version:c.alternatives().try(c.string().valid("latest"),c.semverRange().valid()).default("latest")})).required(),required:c.boolean(),title:B,description:M,mountPoint:H,name:X},Ne=(V,ae)=>c.object(V).custom((me,Ce)=>!ae&&me.source&&me.source.name&&!me.source.store?Ce.message(`missing 'store' in source of component ${me.name}`):me),ye=Ne(te).meta({className:"TComponent",unknownType:"any"});ie.componentSchema=ye;const Be=Ne(te,!0),jt=({checkStore:V}={})=>{const ae=[ye,Be];return c.array().items(V?ae[0]:ae[1]).optional().default([])},Ot=c.object({type:c.string().required(),name:c.string().required(),signer:c.string().required(),pk:c.string().required(),created:c.string().isoDate().required(),sig:c.string().required(),excludes:c.array().items(c.string()).optional(),appended:c.array().items(c.string()).optional(),delegatee:c.string(),delegateePk:c.string(),delegation:c.string()}).meta({className:"TSignature",unknownType:"any"});ie.signatureSchema=Ot;const Me=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Ct={id:c.string().custom(R),title:c.alternatives().try(c.string().min(1).max(m.MAX_TITLE_LENGTH),c.object().min(1).pattern(c.string().valid(...Me),c.string().min(1).max(m.MAX_TITLE_LENGTH))).required(),description:c.alternatives().try(c.string().min(1).max(m.MAX_DESCRIPTION_LENGTH),c.object().min(1).pattern(c.string().valid(...Me),c.string().min(1).max(m.MAX_DESCRIPTION_LENGTH))),link:c.alternatives().try(c.string().custom(w),c.object().min(1).pattern(c.string().valid(...Me),c.string().custom(w))),component:c.string().min(1),section:c.array().items(c.string().min(1)).single(),role:c.array().items(c.string().min(1)).single(),icon:c.string().min(1),visible:c.boolean()},Et=c.object({...Ct,items:c.array().items(c.object({...Ct}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});ie.navigationItemSchema=Et;const _t=c.array().items(Et).unique((V,ae)=>V.id&&ae.id?V.id===ae.id:!1).meta({className:"TNavigation",unknownType:"any"});ie.navigationSchema=_t;const Ye=c.object({background:c.alternatives().try(c.string().min(1),c.object({header:c.string().min(1),footer:c.string().min(1),default:c.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});ie.themeSchema=Ye;const It=c.object({whoCanAccess:c.string().valid("owner","invited","all"),profileFields:c.array().items(c.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:c.array().items(c.string().min(1)),allowSwitchProfile:c.boolean(),blockUnauthenticated:c.boolean(),blockUnauthorized:c.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});ie.authConfigSchema=It;const Nt=c.object({type:c.string().trim().min(1).required(),description:c.string().trim().min(1)}),at=c.object({did:c.DID().trim().required(),type:c.string().trim().min(1).required(),public:c.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});ie.resourceBundleSchema=at;const qe=c.array().items(c.object({type:c.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:c.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});ie.eventsSchema=qe;const tt={did:c.DID().trim().required(),version:c.semver().valid().required(),name:c.string().optional(),description:M.required(),group:c.string().valid(...m.BLOCKLET_GROUPS),main:c.string().trim(),title:B.optional().allow(""),logo:c.string().trim().optional(),specVersion:c.semver().valid().gte("1.0.0").optional(),author:He.optional(),contributors:c.array().items(He).optional(),maintainers:c.array().items(He).optional(),community:c.string().uri().optional().allow("").default(""),documentation:c.string().uri().optional().allow("").default(""),homepage:c.string().uri().optional().allow("").default(""),license:c.string().optional().allow("").default(""),support:c.alternatives().try(c.string().uri(),c.string().email({tlds:!1})).optional(),nftFactory:c.DID().optional().allow("").default(""),payment:c.object({price:c.array().max(1).items(c.object({value:c.number().greater(0).required(),address:c.DID().required()})).default([]),share:c.array().max(4).items(c.object({name:c.string().required(),address:c.DID().required(),value:c.number().greater(0).max(1).required()})).default([]).custom(V=>{if(V.length===0)return V;const ae=V.reduce((me,Ce)=>me+Ce.value,0);if(ae!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${ae}`);return V},"invalid blocklet share"),componentPrice:c.array().items(c.object({parentPriceRange:c.array().items(c.number()).custom((V,ae)=>V.length!==2?ae.message("length of range should be 2"):V[0]<0?ae.message("the first value should not less than 0 in range"):V[1]<=V[0]?ae.message("the second value should greater than the first value in range"):V),type:c.string().valid("fixed","percentage").required(),value:c.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),tags:c.alternatives().try(c.string().trim().min(1),c.array().items(c.string().min(1))).optional(),gitHash:c.string().optional().allow(""),repository:c.alternatives().try(c.string().min(1),c.object({type:c.string().valid("git","https","svn").required(),url:c.string().uri().required(),directory:c.string()})).optional(),timeout:c.object({start:c.number().min(10).max(600),script:c.number().min(1).max(1800)}).default({start:60}),requirements:c.object({abtnode:c.semverRange().valid(),server:c.semverRange().valid(),os:c.alternatives().try(c.string().valid("*",...m.BLOCKLET_PLATFORMS),c.array().items(c.string().valid(...m.BLOCKLET_PLATFORMS)).min(1)),cpu:c.alternatives().try(c.string().valid("*",...m.BLOCKLET_ARCHITECTURES),c.array().items(c.string().valid(...m.BLOCKLET_ARCHITECTURES)).min(1)),fuels:c.array().items(c.object({endpoint:c.string().trim().required(),address:c.string().trim(),value:c.string().trim().required(),reason:c.string().trim().required()})),nodejs:c.semverRange().valid()}).default({server:m.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:c.array().items(ve).unique("name").custom((V,ae)=>{if(V.filter(ee=>ee.type===m.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return ae.message(`Only one ${m.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const Ce=V.filter(ee=>ee.type===m.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const ee of Ce)if(!ee.prefix.startsWith(D))return ae.message(`Wellknown path prefix must start with: ${D}`);return V}).default([]),environments:c.array().items(Oe).default([]).optional().custom((V,ae)=>{if(V&&V.length){const me=V.filter((Ce,ee)=>V.findIndex(O=>O.name===Ce.name)!==ee);if(me.length)return ae.message(`find duplicate environment names ${me.map(Ce=>Ce.name).join(", ")}`)}return V}),scripts:K,capabilities:c.object({clusterMode:c.boolean(),didSpace:c.string().valid(...Object.values(m.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:c.boolean().default(!0),serverless:c.boolean().optional(),component:c.boolean(),sitemap:c.boolean().optional(),mcp:c.boolean().optional()}).default({}),files:c.array().items(c.string().trim()).optional(),resource:c.object({exportApi:c.string().trim(),bundles:c.array().items(at),types:c.array().items(Nt).max(10)}),engine:c.alternatives().try(Pe,c.array().items(Pe)).optional(),screenshots:c.array().items(c.string().min(1)).optional().default([]),videos:c.array().items(c.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:c.string().optional().allow(""),dist:et.optional(),stats:ht.optional(),htmlAst:c.any().optional(),path:c.string().optional(),signatures:c.array().items(Ot).optional(),lastPublishedAt:c.string().isoDate().optional().allow(null),components:jt(),navigation:_t,theme:Ye,copyright:c.object({owner:c.string().min(1),year:c.alternatives().try(c.string(),c.number())}),bundleName:c.string(),bundleDid:c.DID().trim(),storeId:c.string(),events:qe.optional()},ot=c.object(tt).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});ie.blockletMetaSchema=ot;const mt=(V,{ensureFiles:ae=!1,ensureDist:me=!1,ensureComponentStore:Ce=!0,ensureName:ee=!1,skipValidateDidName:O=!1,...Ie}={})=>((!V||!s.default.existsSync(V))&&(ae=!1),c.object({...tt,owner:c.object({avatar:c.string().optional(),did:c.DID().trim().required(),fullName:c.string().trim().required(),email:c.string().optional().allow(null).empty("").default("")}).optional(),logo:ae?c.file().trim().exists({baseDir:V}).optional():c.string().trim().optional(),files:c.array().items(ae?c.file().exists({baseDir:V,canSkip:(Re,Fe)=>[m.BLOCKLET_ENTRY_FILE,m.BLOCKLET_BUNDLE_FILE].includes(Fe)||(0,a.default)(Fe)}):c.string().trim()).optional(),dist:me?et.required():et.optional(),components:jt({checkStore:Ce}),name:ee?c.string().optional():c.string().required(),egress:c.boolean().optional().default(!0),docker:j.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...Ie}).rename("children","components").custom((Re,Fe)=>{const{did:p,name:x,docker:k}=Re;if(k){const{image:U,dockerfile:ne,network:le}=k;if(!U&&!ne)return Fe.message("Image or dockerfile must be set");if(U&&ne)return Fe.message("Image and dockerfile cannot be set at the same time");if(le)return Fe.message("ExportPorts and network cannot be set at the same time");ne&&(Re.files||(Re.files=[]),Re.files.push(ne))}let L;if((0,f.isValid)(p))try{return(0,C.validateNewDid)(p),Re}catch(U){L=U}if(x){(0,C.validateName)(x,{checkDid:!O});const U=(0,E.default)(x);return U!==p?Fe.message(`The did of name "${x}" should be "${U}"`):Re}return L?Fe.message(L.message):Re}));return ie.createBlockletSchema=mt,ie.default={blockletNameSchema:X,componentSchema:ye,endpointSchema:de,serviceSchema:we,createBlockletSchema:mt,interfaceSchema:ve,environmentSchema:Oe,environmentNameSchema:he,scriptsSchema:K,personSchema:He,distSchema:et,titleSchema:B,descriptionSchema:M,logoSchema:z,navigationSchema:_t,themeSchema:Ye,mountPointSchema:H,updateMountPointSchema:A,authConfigSchema:It,resourceBundleSchema:at,installBlockletTitleSchema:re,installBlockletDescriptionSchema:Z,eventsSchema:qe,Joi:c},ie}var pt={},io;function cu(){if(io)return pt;io=1;var e=pt&&pt.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(pt,"__esModule",{value:!0}),pt.setService=pt.findService=pt.getDefaultServiceConfig=pt.getServiceConfig=void 0;const t=e(ec),r=vs(),i={},s=h=>{i[h.name]={validate:h.schema.validate.bind(h.schema),defaultConfig:h.default}};pt.setService=s,s({name:"auth",schema:r.authConfigSchema,default:{}});const n=h=>{if(!h)throw new Error("service name should not be empty");const u=i[h];if(!u)throw new Error(`service ${h} does not exist`);return u},o=(h,u,{validate:f}={})=>{const j=n(h),m=(0,t.default)(u||{}),{value:E,error:S}=j.validate(m);if(f&&S)throw new Error(`Invalid blocklet service config: ${S.details.map(C=>C.message).join(", ")}`);return E};pt.getServiceConfig=o;const a=h=>{const{defaultConfig:u}=n(h);return u};pt.getDefaultServiceConfig=a;const d=(h,u)=>{const f=[u];return(h||[]).find(j=>f.includes(j.name))};return pt.findService=d,pt.default={getServiceConfig:o,getDefaultServiceConfig:a,findService:d,setService:s},pt}var oo;function uu(){if(oo)return Vt;oo=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.fixAndValidateService=Vt.validateMeta=void 0;const e=vs(),t=cu(),r=s=>(!s.interfaces||!s.interfaces.length||s.interfaces.forEach(n=>{n.services&&n.services.length&&n.services.forEach(o=>{o.config=(0,t.getServiceConfig)(o.name,o.config,{validate:!0})})}),s);Vt.fixAndValidateService=r;const i=(s,{ensureFiles:n=!1,ensureDist:o=!1,ensureComponentStore:a=!0,ensureName:d=!1,skipValidateDidName:h=!1,schemaOptions:u={}}={})=>{const f=(0,e.createBlockletSchema)(null,{ensureFiles:n,ensureDist:o,ensureComponentStore:a,ensureName:d,skipValidateDidName:h,...u}),{value:j,error:m}=f.validate(s);if(m)throw new Error(`Invalid blocklet meta: ${m.details.map(E=>E.message).join(", ")}`);return j};return Vt.validateMeta=i,Vt.default=i,Vt}var so;function du(){return so||(so=1,function(e){var t=kt&&kt.__createBinding||(Object.create?function(w,R,B,M){M===void 0&&(M=B);var re=Object.getOwnPropertyDescriptor(R,B);(!re||("get"in re?!R.__esModule:re.writable||re.configurable))&&(re={enumerable:!0,get:function(){return R[B]}}),Object.defineProperty(w,M,re)}:function(w,R,B,M){M===void 0&&(M=B),w[M]=R[B]}),r=kt&&kt.__setModuleDefault||(Object.create?function(w,R){Object.defineProperty(w,"default",{enumerable:!0,value:R})}:function(w,R){w.default=R}),i=kt&&kt.__importStar||function(){var w=function(R){return w=Object.getOwnPropertyNames||function(B){var M=[];for(var re in B)Object.prototype.hasOwnProperty.call(B,re)&&(M[M.length]=re);return M},w(R)};return function(R){if(R&&R.__esModule)return R;var B={};if(R!=null)for(var M=w(R),re=0;re<M.length;re++)M[re]!=="default"&&t(B,R,M[re]);return r(B,R),B}}(),s=kt&&kt.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};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 n=s(cl),o=i(Kc()),a=Yo(),d=uu();Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const h=gs(),u=(w,R)=>{w.description||(w.description=`Blocklet from ${R}`),w.version||(w.version=a.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=u;const f=w=>{if(w.repository&&(typeof w.repository=="string"&&(w.repository={type:"git",url:w.repository}),w.repository.url)){const R=o.fromUrl(w.repository.url);R&&(w.repository.url=R.getDefaultRepresentation()==="shortcut"?R.https():R.toString())}};e.fixRepository=f;const j=w=>{Array.isArray(w.files)?w.files&&(w.files=w.files.filter(R=>!(!R||typeof R!="string"))):delete w.files};e.fixFiles=j;const m=w=>{typeof w.keywords=="string"&&(w.keywords=w.keywords.split(/,\s+/)),w.keywords&&!Array.isArray(w.keywords)?delete w.keywords:w.keywords&&(w.keywords=w.keywords.filter(R=>!(typeof R!="string"||!R)))};e.fixKeywords=m;const E=w=>{typeof w.tags=="string"&&(w.tags=w.tags.split(/,\s+/)),w.tags&&!Array.isArray(w.tags)?delete w.tags:w.tags&&(w.tags=w.tags.filter(R=>!(typeof R!="string"||!R)))};e.fixTags=E;const S=(w,R)=>(w.author&&(w.author=R(w.author)),["maintainers","contributors"].forEach(B=>{Array.isArray(w[B])&&(w[B]=w[B].map(R))}),w),C=w=>{if(!w)return"";if(typeof w=="string")return w;const R=w.name||"",B=w.url||w.web,M=B?` (${B})`:"",re=w.email||w.mail,Z=re?` <${re}>`:"";return R+Z+M};e.formatPerson=C;const _=w=>{if(typeof w!="string")return w;const R=w.match(/^([^(<]+)/),B=w.match(/\(([^)]+)\)/),M=w.match(/<([^>]+)>/),re={};return R&&R[0].trim()&&(re.name=R[0].trim()),M&&([,re.email]=M),B&&([,re.url]=B),re};e.parsePerson=_;const N=w=>(S(w,C),S(w,_),w);e.fixPerson=N;const D=(w,R=!0)=>{if(Array.isArray(w.interfaces)||(w.interfaces=[]),w.interfaces.length)return w.interfaces.forEach(Z=>{Z.type===a.BLOCKLET_INTERFACE_TYPE_WEB&&(Z.protocol="http")}),w;const M=(0,n.default)(w,"capabilities.dynamicPathPrefix",!0)?a.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",re=({type:Z="web",name:z,path:W="/",protocol:H="http",port:A=a.BLOCKLET_DEFAULT_PORT_NAME})=>{w.interfaces.push({type:Z,name:z,path:W,prefix:M,port:A,protocol:H})};return[a.BLOCKLET_INTERFACE_PUBLIC].forEach(Z=>{w[Z]&&re({name:Z,path:w[Z]})}),Array.isArray(w.exposeServices)&&w.exposeServices.forEach(Z=>{re({type:"service",name:Z.protocol,protocol:Z.protocol,port:{internal:`BLOCKLET_${Z.protocol}_PORT`.toUpperCase(),external:Z.port}})}),R&&(delete w.publicUrl,delete w.adminUrl,delete w.configUrl,delete w.docUrl,delete w.exposeServices,w.capabilities&&delete w.capabilities.dynamicPathPrefix),w};e.fixInterfaces=D;const c=w=>{const{did:R}=w;try{(0,h.validateNewDid)(R),w.name=R}catch{}return w};e.fixName=c,e.default={fixRequired:u,fixRepository:f,fixFiles:j,fixKeywords:m,fixPerson:N,fixTags:E,fixName:c,formatPerson:C,parsePerson:_,fixInterfaces:D,fixService:d.fixAndValidateService}}(kt)),kt}var hu=du();function ys({owner:e,locale:t}){return l.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?l.jsx(Go,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}ys.propTypes={owner:F.object.isRequired,locale:F.string.isRequired};const fu="install-blocklet-from-URL",bs=()=>{const[e,t]=ri(fu,"[]",{raw:!0}),r=s=>{const n=s.trim(),o=JSON.parse(e),a=o.findIndex(d=>d===n);a!==0&&(a>0&&o.splice(a,1),o.length>=10&&o.splice(9),o.unshift(n),t(JSON.stringify(o)))},i=s=>{if(!s)return;const n=JSON.parse(e),o=s.trim(),a=n.findIndex(d=>d===o);a>-1&&(n.splice(a,1),t(JSON.stringify(n)))};return{urls:e?JSON.parse(e):[],addUrlRecord:r,removeUrlRecord:i}};function xs({value:e="",onValueChange:t=()=>{},children:r=null,helperText:i=""}){const{urls:s,removeUrlRecord:n}=bs(),o=(a,d)=>{a.preventDefault(),a.stopPropagation(),n(d)};return l.jsxs(oe,{children:[l.jsx(No,{freeSolo:!0,options:s,inputValue:e,onInputChange:(a,d)=>{t(d)},disableClearable:!0,popupIcon:null,renderInput:a=>Ut.cloneElement(r,{...a}),renderOption:(a,d)=>q.createElement(Ao,{...a,key:d,secondaryAction:l.jsx(_o,{edge:"end","aria-label":"delete",onClick:h=>o(h,d),children:l.jsx(ya,{})})},l.jsx(ba,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:l.jsx(Do,{primary:d,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),l.jsx(xa,{style:{margin:0},children:i})]})}xs.propTypes={onValueChange:F.func,children:F.node,value:F.string,helperText:F.string};function ws({onClick:e}){const{t}=wt();return l.jsx(ul,{title:t("launchBlocklet.withoutWallet"),icon:l.jsx(bt,{icon:dl,fontSize:"1em"}),onClick:e})}ws.propTypes={onClick:F.func.isRequired};function Ss({defaultUrl:e="",onCancel:t,onSuccess:r,onError:i=()=>{},mode:s="install",handleText:n={}}){const{api:o}=ln(),{api:a,session:d}=tc(),[h,u]=q.useState(!1),[f,j]=q.useState(""),{t:m,locale:E}=wt(),S={dist:{}},{encryptKey:C}=hl(),[_,N]=q.useState(e),[D,c]=q.useState(e?1:0),[w,R]=q.useState(S),[B,M]=q.useState(!1),[re,Z]=q.useState(""),[z]=ri("instant-blocklet-install",!1),[W,H]=q.useState({}),A=s==="component",X=A?!0:!e,{addUrlRecord:$}=bs(),he=q.useMemo(()=>(d.user?.connectedAccounts||[]).some(ye=>ye.provider===Bt.LOGIN_PROVIDER.WALLET),[d.user]),Oe=async()=>{R(S),j(null),u(!0);let te=_.trim();!te.startsWith("https://")&&!te.startsWith("http://")&&!te.startsWith("file://")&&(te=`file://${te}`);try{const Ne=decodeURIComponent(te);try{new URL(Ne)}catch{throw new Error("Invalid URL")}const{meta:ye,inStore:Be,registryUrl:jt}=await o.getBlockletMetaFromUrl({input:{url:Ne}});R(ye),H({inStore:Be,registryUrl:jt,inputUrl:te}),$(te)}catch(Ne){console.error(Ne);const ye=`Blocklet Install failed: ${Br(Ne)}`;j(ye),i(Ne)}finally{u(!1)}},K=()=>{if(A){r({meta:w,...W}),t();return}if(z){u(!0),M(!0);return}const te=Zt(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=Yn(te,{blocklet_meta_url:decodeURIComponent(_.trim()),from:"url"})},we=()=>{u(!1),M(!1),r({meta:w,...W}),t()},de=()=>{u(!1),M(!1)};q.useEffect(()=>{e&&Oe()},[e]);const Le=q.useMemo(()=>({title:w.title,wt:fl(w),blockletMetaUrl:decodeURIComponent(_.trim())}),[w,_]),ve=q.useCallback(async()=>{if(he||z){Z("");return}const te=new URL(window.location.href);te.pathname=Zt(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),te.searchParams.set("_ek_",C),Object.keys(Le).forEach(ye=>{te.searchParams.set(ye,Le[ye])});const{data:Ne}=await a.get(te.href);Ne.url?Z(Ne.url):Z("")},[he,Le,a,C,z]);q.useEffect(()=>{ve()},[ve]);const _e=q.useMemo(()=>he&&re?{...Le,nw:re,skipMigrateAccount:!0}:Le,[Le,re,he]),Pe=[{name:m("common.name"),value:$t.getDisplayName({meta:w},!0)},{name:m("common.version"),value:w.version},{name:m("common.did"),value:w.did?l.jsx(nc,{did:w.did}):null},{name:m("common.author"),value:w.owner?l.jsx(ys,{owner:w.owner,locale:E}):hu.formatPerson(w.author)},{name:m("blocklet.dist.downloadLink"),value:w.dist.tarball}],He=()=>h?l.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:l.jsx(Tt,{})}):w.did?l.jsx("div",{style:{paddingLeft:"10%"},children:Pe.map(te=>te.name===m("common.did")?l.jsx(Pi,{valueComponent:"div",nameWidth:120,name:te.name,nameFormatter:()=>m("common.did"),children:te.value},te.name):l.jsx(Pi,{valueComponent:"div",nameWidth:120,name:te.name,children:te.value},te.name))}):null,et=Xl(async()=>{let te=w.title;d.user&&(te=`${d.user.fullName}'s ${w.title}`);try{we(),await o.launchBlockletWithoutWallet({input:{title:te,blockletMetaUrl:decodeURIComponent(_.trim()),type:"store",storeUrl:W.registryUrl,onlyRequired:!0}})}catch(Ne){console.error("launchBlockletWithoutWallet error:",Ne),Gn.error(Br(Ne),{autoHideDuration:3e3})}}),ht=[{label:m("blocklet.fromUrl.step0"),body:l.jsx(je,{component:"div",children:l.jsx(xs,{style:{marginBottom:32},value:_,helperText:m("blocklet.fromUrl.description"),onValueChange:te=>{j(null),N(te)},children:l.jsx(Vn,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:_,onChange:te=>{j(null),N(te.target.value)},disabled:h,onKeyPress:te=>{te.key==="Enter"&&(te.preventDefault(),Oe(),c(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:t,onConfirm:()=>{Oe(),c(1)}},{label:m("blocklet.fromUrl.step1"),body:He(),cancel:m(X?"common.pre":"common.cancel"),confirm:n?.confirm||m("blocklet.fromUrl.confirm"),onCancel:()=>{X?c(te=>te-1):t()},onConfirm:()=>{K()}}],Ze=ht[D];return l.jsxs(l.Fragment,{children:[l.jsxs(ni,{title:n?.title||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>Ze.onCancel(),showCloseButton:D===0,disableEscapeKeyDown:!0,open:!0,actions:l.jsxs(l.Fragment,{children:[Ze.cancel&&l.jsx(yt,{onClick:te=>{te.stopPropagation(),j(null),Ze.onCancel()},color:"inherit",children:Ze.cancel||m("common.cancel")}),l.jsxs(yt,{onClick:te=>{te.stopPropagation(),Ze.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:h||!_||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[h&&D===0&&l.jsx(Tt,{size:16}),Ze.confirm]})]}),children:[X&&l.jsx(wa,{alternativeLabel:!0,activeStep:D,children:ht.map(({label:te})=>l.jsx(Sa,{children:l.jsx(Ea,{children:te})},te))}),l.jsx(ka,{component:"div",style:{marginTop:24},children:Ze.body}),!!f&&l.jsx(Mo,{severity:"error",style:{width:"100%",marginTop:8},children:f})]}),w&&B&&l.jsx(Jo,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!he&&!z?"bind-wallet":"launch-free-blocklet-by-session",checkFn:a.get,checkTimeout:5*60*1e3,onSuccess:we,extraParams:_e,messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:de,customItems:z?[]:[l.jsx(ws,{onClick:et})]})]})}Ss.propTypes={defaultUrl:F.string,onCancel:F.func.isRequired,onSuccess:F.func.isRequired,onError:F.func,mode:F.oneOf(["install","component"]),handleText:F.object};const pu={meta:F.object.isRequired,onCancel:F.func.isRequired};function Es({action:e,onSelect:t,onNext:r}){const{t:i}=wt(),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 l.jsxs(l.Fragment,{children:[l.jsx(Ta,{children:s.map(n=>l.jsxs(Ao,{button:!0,selected:e===n.action,onClick:()=>t(n.action),children:[l.jsx(ja,{sx:{minWidth:48},children:n.action==="purchase"?l.jsx(Oa,{style:{color:e==="purchase"?Ti.primary.main:"#AAA",fontSize:32}}):l.jsx(Ca,{style:{color:e==="verify"?Ti.primary.main:"#AAA",fontSize:32}})}),l.jsx(Do,{primary:n.title,secondary:n.description})]},n.action))}),r&&l.jsx(yt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:i("common.next")})]})}Es.propTypes={action:F.oneOf(["both","purchase","verify"]).isRequired,onSelect:F.func.isRequired,onNext:F.func.isRequired};function ks({meta:e,onCancel:t,mode:r,handlePaySuccess:i=()=>{}}){const{t:s,locale:n}=wt(),{info:o}=ln(),a=pl(o),[d,h]=q.useState(null),u=new URL(e?.registryUrl).origin,f=$t.getDisplayName({meta:e}),j=async(E,S)=>{const C=({downloadTokenList:D})=>{i({downloadTokenList:D})},_=D=>{Gn.error(D),t(D)};function N(D){return gl(()=>Li.get(D).then(async({data:c})=>{const w=c?.downloadTokenList;if(c.status==="succeed"){if(w&&w.length)await C({downloadTokenList:w});else return await _(s("blocklet.component.missDownloadTokenTip")),!0;return!0}return c.status==="error"?(console.error("vc error: ",c),await _(c?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:D}=ml(d);await N(D)}else await C({downloadTokenList:E.downloadTokenList&&S(E.downloadTokenList)})};if(q.useEffect(()=>{if(r==="purchase"){const E=new URL(u);E.pathname="/api/did/verify-purchase-blocklet/token",E.searchParams.set("serverDid",o.did),E.searchParams.set("blockletDid",e?.did);try{Li.get(E.href).then(({data:S})=>{const C=`${S.url}`;h(C)})}catch(S){console.error("get next workflow url error: ",S)}}return()=>{h(null)}},[r]),r==="purchase"&&!d)return"";const m={verify:{action:"verify-purchase-blocklet",checkFn:Ri.create({baseURL:u}).get,extraParams:{serverDid:o.did,blockletDid:e?.did},messages:{title:s("store.purchase.verify.auth.title",{name:f}),scan:s("store.purchase.verify.auth.scan"),confirm:s("store.purchase.verify.auth.confirm"),success:s("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Ri.create({baseURL:Zt(u,"/store")}).get,extraParams:{factory:e.nftFactory,nw:d},messages:{title:s("store.purchase.auth.title",{name:f}),scan:s("store.purchase.auth.scan"),confirm:s("store.purchase.auth.confirm"),success:l.jsxs(l.Fragment,{children:[l.jsx("p",{children:s("store.purchase.auth.success")}),l.jsx("p",{children:s("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return l.jsx(Jo,{open:!0,locale:n,popup:!1,saveConnect:!1,className:"connect",baseUrl:u,onSuccess:j,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:a,disableClose:!0,showDownload:!1,...m[r]})}ks.propTypes={...pu,handlePaySuccess:F.func,mode:F.oneOf(["verify","purchase"]).isRequired};function Ts({ref:e=null,mode:t,...r}){const[i,s]=q.useState(t!=="both"?t:"verify"),[n,o]=q.useState(t!=="both"?2:1),a=h=>{h!==i&&s(h)},d=()=>{i&&n!==2&&o(2)};return q.useImperativeHandle(e,()=>({onNext:d,getCurrentStep:()=>n})),n===1?l.jsx("div",{style:{maxWidth:520},children:l.jsx(Es,{action:i,onNext:null,onSelect:a})}):l.jsx(ks,{...r,mode:i})}Ts.propTypes={mode:F.oneOf(["both","verify","purchase"]).isRequired,ref:F.any};function mu({...e}){return l.jsx(yt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function js({blocklet:e=null,onStartNow:t=()=>{},children:r=null,disabled:i=!1}){const{t:s}=wt(),n=is();return!e||vl(e.meta)?l.jsx(gu,{children:r}):l.jsxs(vu,{isMobile:n,children:[l.jsx(mu,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>t(),children:s("setup.startNow")}),l.jsx(oe,{sx:{display:"flex",alignItems:"center"},children:r})]})}js.propTypes={blocklet:F.object,onStartNow:F.func,children:F.any,disabled:F.bool};const gu=it(oe)`
|
|
221
221
|
width: 100%;
|
|
222
222
|
margin-top: auto;
|
|
223
223
|
padding-top: 24px;
|
|
@@ -262,12 +262,12 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
262
262
|
justify-content: space-between;
|
|
263
263
|
gap: '32px',
|
|
264
264
|
}}
|
|
265
|
-
`;function Os({blockletMeta:e,onEndpointUpdate:t=()=>{}}){const r=is(),{blocklet:i}=
|
|
265
|
+
`;function Os({blockletMeta:e,onEndpointUpdate:t=()=>{}}){const r=is(),{blocklet:i}=Hn(),{updateSpaceGateway:s,loading:n,hasStorageEndpoint:o}=Bl();return q.useEffect(()=>{t?.()},[i]),n?l.jsx(El,{relative:"parent",children:l.jsx(Tt,{})}):l.jsxs(yu,{children:[l.jsx(oe,{sx:{width:r?"360px":"720px"},children:o?l.jsx(sc,{}):l.jsx(ac,{})}),e?.capabilities?.didSpace==="required"&&l.jsx(js,{mt:8,children:l.jsx(lc,{onConnect:s})})]})}Os.propTypes={blockletMeta:F.any.isRequired,onEndpointUpdate:Ia.func};const yu=it(oc)`
|
|
266
266
|
height: 100%;
|
|
267
267
|
overflow-y: auto;
|
|
268
268
|
padding-bottom: 32px;
|
|
269
269
|
overflow-x: hidden;
|
|
270
|
-
`;function Cs({onChange:e=()=>{},loading:t=!1,children:r,extra:i="",stores:s=[],storageKey:n=""}){const{t:o}=wt(),{info:a,inService:d}=ln(),{blocklet:h}=
|
|
270
|
+
`;function Cs({onChange:e=()=>{},loading:t=!1,children:r,extra:i="",stores:s=[],storageKey:n=""}){const{t:o}=wt(),{info:a,inService:d}=ln(),{blocklet:h}=Hn(),[u,f]=q.useState(!1),j=q.useRef(null),[m,E]=q.useState(),[S,C]=ri(n||"tmp"),[_,N]=n?[S,C]:[m,E],{storeList:D,teamDid:c}=Qo({fromBlocklet:d,blocklet:h,nodeInfo:a}),w=ts([...s.map(B=>({...B,protected:!0})),...D],"url"),R=_&&w.find(B=>_===B.url)||w[0];return l.jsxs(l.Fragment,{children:[l.jsxs(bu,{children:[l.jsx(yt,{ref:j,color:"primary","data-cy":"add-component-select-store",endIcon:l.jsx(Ra,{color:"primary"}),onClick:()=>{f(!0)},style:{padding:"0 2px"},children:l.jsx(je,{color:"primary",children:R.name})}),l.jsx(je,{color:"primary",children:i})]}),l.jsxs(Vn,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:o("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:R,autoFocus:!0,onChange:B=>{const M=B.target.value;N(M.url),e(M)},style:{display:"none"},margin:"normal",slotProps:{select:{open:u,MenuProps:{anchorEl:j.current},renderValue:B=>B?.name,onClose:()=>{f(!1)}}},children:[w?.map(B=>l.jsx(Zr,{sx:{width:"400px",maxWidth:"90vw"},value:B,"data-cy":B.url,children:l.jsx(Qa,{teamDid:c,store:B,onDelete:()=>{_===B.url&&N(w[0]?.url)}})},B.url)),!Ko.isInServerlessMode(a)&&l.jsx(Za,{disabled:t,storeList:w,teamDid:c,onAdd:B=>{N(B)}})]}),r({currentRegistry:R})]})}Cs.propTypes={onChange:F.func,loading:F.bool,children:F.any.isRequired,extra:F.node,storageKey:F.string,stores:F.arrayOf(F.shape({name:F.string.isRequired,url:F.string.isRequired}))};const bu=it.div`
|
|
271
271
|
display: flex;
|
|
272
272
|
justify-content: space-between;
|
|
273
273
|
align-items: center;
|
|
@@ -486,8 +486,8 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
486
486
|
color: ${e=>e.theme.palette.common.white}!important;
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
`;const ao=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),wu=(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`},Is={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 Fr({title:e,sx:t,children:r,slotProps:i,fontSize:s=12,fontWeight:n=500,color:o="text.contrast",...a}){return e?l.jsx(Bo,{title:e,placement:"top",...a,slotProps:{popper:{...i?.popper,sx:Xo({[`& .${Pa.tooltip}`]:{fontSize:s,fontWeight:n,boxShadow:2,marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:o,display:"flex",alignItems:"center"}},i?.popper?.sx)}},children:r}):r}function _n({icon:e=null,children:t=null,maxWidth:r=100,title:i=void 0,sx:s={}}){return(t===0||t)&&l.jsxs(ut,{direction:"row",sx:[{alignItems:"center",gap:.5},{maxWidth:r,overflow:"hidden"},...Array.isArray(s)?s:[s]],children:[e,l.jsx(Fr,{title:i||(typeof t=="string"?t:""),children:l.jsx(je,{variant:"body2",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function Su({...e}){const{title:t,description:r="",cover:i="",avatar:s,author:n,download:o,did:a,official:d,buttonText:h="Install",buttonDisabled:u,buttonLoading:f,button:j,onButtonClick:m=()=>{},onMainClick:E,className:S,ref:C,icons:_,status:N,...D}=e,c=qt(),w=(Z,z=()=>!1)=>(W,...H)=>{const A=Z instanceof Function;(z()||A)&&(W.preventDefault(),W.stopPropagation(),A&&Z(...H))},R=E&&w(E),B=w(m,()=>!!(j||u||f)),M=q.isValidElement(t)?{children:t}:{title:ao(t),dangerouslySetInnerHTML:{__html:t}},re=q.isValidElement(r)?{children:r}:{title:ao(r),dangerouslySetInnerHTML:{__html:r}};return l.jsxs(La,{variant:"outlined",onClick:R,...D,sx:{p:{xs:2,md:3},borderRadius:1,...D.sx},children:[l.jsxs(ut,{direction:"row",sx:{flex:1,gap:1,alignItems:"center",overflow:"hidden","& > *":{flexShrink:0}},children:[l.jsx(qn,{src:i,did:a,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),l.jsx(je,{className:"blocklet-title",...M,sx:[{fontWeight:"fontWeightMedium",fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...Array.isArray(M.sx)?M.sx:[M.sx]]}),l.jsxs(oe,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[d&&l.jsx(Fr,{title:d.tooltip,children:l.jsx(_a,{sx:{color:d.color||"#D97706",fontSize:d.size||18}})}),_?.map(Z=>l.jsx(Fr,{title:Z.title,children:typeof Z.icon=="string"?l.jsx(bt,{icon:Z.icon,style:{color:Z.color}}):Z.icon},Z.key))]}),m&&l.jsxs(yt,{variant:"outlined",size:"small",disabled:u||f,style:{color:c.palette.text.primary,borderColor:c.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:c.typography.fontWeightMedium},onClick:B,children:[f&&l.jsx(Tt,{size:15,style:{marginRight:3,color:"inherit"}}),h]}),j]}),l.jsx(ut,{sx:{py:2},children:l.jsx(je,{className:"blocklet-description",variant:"body2",...re,sx:[{color:"text.secondary",display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...Array.isArray(re.sx)?re.sx:[re.sx]]})}),l.jsxs(ut,{direction:"row",sx:{alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(_n,{icon:l.jsx(qn,{src:s,did:a,size:20,variant:"circle"}),maxWidth:200,children:n}),l.jsx(_n,{icon:l.jsx(bt,{icon:Is}),title:o,children:wu(o)}),N?.filter(Z=>Z.align!=="right").map(Z=>l.jsx(_n,{icon:typeof Z.icon=="string"?l.jsx(bt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,children:Z.text},Z.key)),l.jsx(oe,{sx:{flex:1}}),N?.filter(Z=>Z.align==="right").map(Z=>l.jsx(_n,{icon:typeof Z.icon=="string"?l.jsx(bt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,sx:{color:Z.color},children:Z.text},Z.key))]})]})}const Eu={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>'},bn=/^[a-z0-9]+(-[a-z0-9]+)*$/,Jn=(e,t,r,i="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),d=s.pop(),h={provider:s.length>0?s[0]:i,prefix:d,name:a};return t&&!Fn(h)?null:h}const n=s[0],o=n.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!Fn(a)?null:a}if(r&&i===""){const a={provider:i,prefix:"",name:n};return t&&!Fn(a,r)?null:a}return null},Fn=(e,t)=>e?!!((e.provider===""||e.provider.match(bn))&&(t&&e.prefix===""||e.prefix.match(bn))&&e.name.match(bn)):!1,Rs=Object.freeze({left:0,top:0,width:16,height:16}),Wn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ii=Object.freeze({...Rs,...Wn}),$r=Object.freeze({...ii,body:"",hidden:!1});function ku(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function lo(e,t){const r=ku(e,t);for(const i in $r)i in Wn?i in e&&!(i in r)&&(r[i]=Wn[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Tu(e,t){const r=e.icons,i=e.aliases||Object.create(null),s=Object.create(null);function n(o){if(r[o])return s[o]=[];if(!(o in s)){s[o]=null;const a=i[o]&&i[o].parent,d=a&&n(a);d&&(s[o]=[a].concat(d))}return s[o]}return Object.keys(r).concat(Object.keys(i)).forEach(n),s}function ju(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let n={};function o(a){n=lo(i[a]||s[a],n)}return o(t),r.forEach(o),lo(e,n)}function Ps(e,t){const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const i=Tu(e);for(const s in i){const n=i[s];n&&(t(s,ju(e,s,n)),r.push(s))}return r}const Ou={provider:"",aliases:{},not_found:{},...Rs};function Er(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Ls(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Er(e,Ou))return null;const r=t.icons;for(const s in r){const n=r[s];if(!s.match(bn)||typeof n.body!="string"||!Er(n,$r))return null}const i=t.aliases||Object.create(null);for(const s in i){const n=i[s],o=n.parent;if(!s.match(bn)||typeof o!="string"||!r[o]&&!i[o]||!Er(n,$r))return null}return t}const co=Object.create(null);function Cu(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function en(e,t){const r=co[e]||(co[e]=Object.create(null));return r[t]||(r[t]=Cu(e,t))}function oi(e,t){return Ls(t)?Ps(t,(r,i)=>{i?e.icons[r]=i:e.missing.add(r)}):[]}function Iu(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}let wn=!1;function _s(e){return typeof e=="boolean"&&(wn=e),wn}function Ru(e){const t=typeof e=="string"?Jn(e,!0,wn):e;if(t){const r=en(t.provider,t.prefix),i=t.name;return r.icons[i]||(r.missing.has(i)?null:void 0)}}function Pu(e,t){const r=Jn(e,!0,wn);if(!r)return!1;const i=en(r.provider,r.prefix);return Iu(i,r.name,t)}function Lu(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),wn&&!t&&!e.prefix){let s=!1;return Ls(e)&&(e.prefix="",Ps(e,(n,o)=>{o&&Pu(n,o)&&(s=!0)})),s}const r=e.prefix;if(!Fn({provider:t,prefix:r,name:"a"}))return!1;const i=en(t,r);return!!oi(i,e)}const Ns=Object.freeze({width:null,height:null}),As=Object.freeze({...Ns,...Wn}),_u=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Nu=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function uo(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(_u);if(i===null||!i.length)return e;const s=[];let n=i.shift(),o=Nu.test(n);for(;;){if(o){const a=parseFloat(n);isNaN(a)?s.push(n):s.push(Math.ceil(a*t*r)/r)}else s.push(n);if(n=i.shift(),n===void 0)return s.join("");o=!o}}const Au=e=>e==="unset"||e==="undefined"||e==="none";function Du(e,t){const r={...ii,...e},i={...As,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let n=r.body;[r,i].forEach(E=>{const S=[],C=E.hFlip,_=E.vFlip;let N=E.rotate;C?_?N+=2:(S.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),S.push("scale(-1 1)"),s.top=s.left=0):_&&(S.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),S.push("scale(1 -1)"),s.top=s.left=0);let D;switch(N<0&&(N-=Math.floor(N/4)*4),N=N%4,N){case 1:D=s.height/2+s.top,S.unshift("rotate(90 "+D.toString()+" "+D.toString()+")");break;case 2:S.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:D=s.width/2+s.left,S.unshift("rotate(-90 "+D.toString()+" "+D.toString()+")");break}N%2===1&&(s.left!==s.top&&(D=s.left,s.left=s.top,s.top=D),s.width!==s.height&&(D=s.width,s.width=s.height,s.height=D)),S.length&&(n='<g transform="'+S.join(" ")+'">'+n+"</g>")});const o=i.width,a=i.height,d=s.width,h=s.height;let u,f;o===null?(f=a===null?"1em":a==="auto"?h:a,u=uo(f,d/h)):(u=o==="auto"?d:o,f=a===null?uo(u,h/d):a==="auto"?h:a);const j={},m=(E,S)=>{Au(S)||(j[E]=S.toString())};return m("width",u),m("height",f),j.viewBox=s.left.toString()+" "+s.top.toString()+" "+d.toString()+" "+h.toString(),{attributes:j,body:n}}const Mu=/\sid="(\S+)"/g,Bu="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Fu=0;function $u(e,t=Bu){const r=[];let i;for(;i=Mu.exec(e);)r.push(i[1]);if(!r.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(n=>{const o=typeof t=="function"?t(n):t+(Fu++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const Ur=Object.create(null);function Uu(e,t){Ur[e]=t}function qr(e){return Ur[e]||Ur[""]}function si(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 ai=Object.create(null),vn=["https://api.simplesvg.com","https://api.unisvg.com"],$n=[];for(;vn.length>0;)vn.length===1||Math.random()>.5?$n.push(vn.shift()):$n.push(vn.pop());ai[""]=si({resources:["https://api.iconify.design"].concat($n)});function qu(e,t){const r=si(t);return r===null?!1:(ai[e]=r,!0)}function li(e){return ai[e]}const Wu=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ho=Wu();function zu(e,t){const r=li(e);if(!r)return 0;let i;if(!r.maxURL)i=0;else{let s=0;r.resources.forEach(o=>{s=Math.max(s,o.length)});const n=t+".json?icons=";i=r.maxURL-s-r.path.length-n.length}return i}function Vu(e){return e===404}const Gu=(e,t,r)=>{const i=[],s=zu(e,t),n="icons";let o={type:n,provider:e,prefix:t,icons:[]},a=0;return r.forEach((d,h)=>{a+=d.length+1,a>=s&&h>0&&(i.push(o),o={type:n,provider:e,prefix:t,icons:[]},a=d.length),o.icons.push(d)}),i.push(o),i};function Ku(e){if(typeof e=="string"){const t=li(e);if(t)return t.path}return"/"}const Hu=(e,t,r)=>{if(!ho){r("abort",424);return}let i=Ku(t.provider);switch(t.type){case"icons":{const n=t.prefix,a=t.icons.join(","),d=new URLSearchParams({icons:a});i+=n+".json?"+d.toString();break}case"custom":{const n=t.uri;i+=n.slice(0,1)==="/"?n.slice(1):n;break}default:r("abort",400);return}let s=503;ho(e+i).then(n=>{const o=n.status;if(o!==200){setTimeout(()=>{r(Vu(o)?"abort":"next",o)});return}return s=501,n.json()}).then(n=>{if(typeof n!="object"||n===null){setTimeout(()=>{n===404?r("abort",n):r("next",s)});return}setTimeout(()=>{r("success",n)})}).catch(()=>{r("next",s)})},Xu={prepare:Gu,send:Hu};function Yu(e){const t={loaded:[],missing:[],pending:[]},r=Object.create(null);e.sort((s,n)=>s.provider!==n.provider?s.provider.localeCompare(n.provider):s.prefix!==n.prefix?s.prefix.localeCompare(n.prefix):s.name.localeCompare(n.name));let i={provider:"",prefix:"",name:""};return e.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const n=s.provider,o=s.prefix,a=s.name,d=r[n]||(r[n]=Object.create(null)),h=d[o]||(d[o]=en(n,o));let u;a in h.icons?u=t.loaded:o===""||h.missing.has(a)?u=t.missing:u=t.pending;const f={provider:n,prefix:o,name:a};u.push(f)}),t}function Ds(e,t){e.forEach(r=>{const i=r.loaderCallbacks;i&&(r.loaderCallbacks=i.filter(s=>s.id!==t))})}function Ju(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let r=!1;const i=e.provider,s=e.prefix;t.forEach(n=>{const o=n.icons,a=o.pending.length;o.pending=o.pending.filter(d=>{if(d.prefix!==s)return!0;const h=d.name;if(e.icons[h])o.loaded.push({provider:i,prefix:s,name:h});else if(e.missing.has(h))o.missing.push({provider:i,prefix:s,name:h});else return r=!0,!0;return!1}),o.pending.length!==a&&(r||Ds([e],n.id),n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort))})}))}let Qu=0;function Zu(e,t,r){const i=Qu++,s=Ds.bind(null,r,i);if(!t.pending.length)return s;const n={id:i,icons:t,callback:e,abort:s};return r.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(n)}),s}function ed(e,t=!0,r=!1){const i=[];return e.forEach(s=>{const n=typeof s=="string"?Jn(s,t,r):s;n&&i.push(n)}),i}var td={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function nd(e,t,r,i){const s=e.resources.length,n=e.random?Math.floor(Math.random()*s):e.index;let o;if(e.random){let R=e.resources.slice(0);for(o=[];R.length>1;){const B=Math.floor(Math.random()*R.length);o.push(R[B]),R=R.slice(0,B).concat(R.slice(B+1))}o=o.concat(R)}else o=e.resources.slice(n).concat(e.resources.slice(0,n));const a=Date.now();let d="pending",h=0,u,f=null,j=[],m=[];typeof i=="function"&&m.push(i);function E(){f&&(clearTimeout(f),f=null)}function S(){d==="pending"&&(d="aborted"),E(),j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function C(R,B){B&&(m=[]),typeof R=="function"&&m.push(R)}function _(){return{startTime:a,payload:t,status:d,queriesSent:h,queriesPending:j.length,subscribe:C,abort:S}}function N(){d="failed",m.forEach(R=>{R(void 0,u)})}function D(){j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function c(R,B,M){const re=B!=="success";switch(j=j.filter(Z=>Z!==R),d){case"pending":break;case"failed":if(re||!e.dataAfterTimeout)return;break;default:return}if(B==="abort"){u=M,N();return}if(re){u=M,j.length||(o.length?w():N());return}if(E(),D(),!e.random){const Z=e.resources.indexOf(R.resource);Z!==-1&&Z!==e.index&&(e.index=Z)}d="completed",m.forEach(Z=>{Z(M)})}function w(){if(d!=="pending")return;E();const R=o.shift();if(R===void 0){if(j.length){f=setTimeout(()=>{E(),d==="pending"&&(D(),N())},e.timeout);return}N();return}const B={status:"pending",resource:R,callback:(M,re)=>{c(B,M,re)}};j.push(B),h++,f=setTimeout(w,e.rotate),r(R,t,B.callback)}return setTimeout(w),_}function Ms(e){const t={...td,...e};let r=[];function i(){r=r.filter(a=>a().status==="pending")}function s(a,d,h){const u=nd(t,a,d,(f,j)=>{i(),h&&h(f,j)});return r.push(u),u}function n(a){return r.find(d=>a(d))||null}return{query:s,find:n,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function fo(){}const kr=Object.create(null);function rd(e){if(!kr[e]){const t=li(e);if(!t)return;const r=Ms(t),i={config:t,redundancy:r};kr[e]=i}return kr[e]}function id(e,t,r){let i,s;if(typeof e=="string"){const n=qr(e);if(!n)return r(void 0,424),fo;s=n.send;const o=rd(e);o&&(i=o.redundancy)}else{const n=si(e);if(n){i=Ms(n);const o=e.resources?e.resources[0]:"",a=qr(o);a&&(s=a.send)}}return!i||!s?(r(void 0,424),fo):i.query(t,s,r)().abort}const po="iconify2",Sn="iconify",Bs=Sn+"-count",mo=Sn+"-version",Fs=36e5,od=168;function Wr(e,t){try{return e.getItem(t)}catch{}}function ci(e,t,r){try{return e.setItem(t,r),!0}catch{}}function go(e,t){try{e.removeItem(t)}catch{}}function zr(e,t){return ci(e,Bs,t.toString())}function Vr(e){return parseInt(Wr(e,Bs))||0}const Qn={local:!0,session:!0},$s={local:new Set,session:new Set};let ui=!1;function sd(e){ui=e}let Nn=typeof window>"u"?{}:window;function Us(e){const t=e+"Storage";try{if(Nn&&Nn[t]&&typeof Nn[t].length=="number")return Nn[t]}catch{}Qn[e]=!1}function qs(e,t){const r=Us(e);if(!r)return;const i=Wr(r,mo);if(i!==po){if(i){const a=Vr(r);for(let d=0;d<a;d++)go(r,Sn+d.toString())}ci(r,mo,po),zr(r,0);return}const s=Math.floor(Date.now()/Fs)-od,n=a=>{const d=Sn+a.toString(),h=Wr(r,d);if(typeof h=="string"){try{const u=JSON.parse(h);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>s&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}go(r,d)}};let o=Vr(r);for(let a=o-1;a>=0;a--)n(a)||(a===o-1?(o--,zr(r,o)):$s[e].add(a))}function Ws(){if(!ui){sd(!0);for(const e in Qn)qs(e,t=>{const r=t.data,i=t.provider,s=r.prefix,n=en(i,s);if(!oi(n,r).length)return!1;const o=r.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,o):o,!0})}}function ad(e,t){const r=e.lastModifiedCached;if(r&&r>=t)return r===t;if(e.lastModifiedCached=t,r)for(const i in Qn)qs(i,s=>{const n=s.data;return s.provider!==e.provider||n.prefix!==e.prefix||n.lastModified===t});return!0}function ld(e,t){ui||Ws();function r(i){let s;if(!Qn[i]||!(s=Us(i)))return;const n=$s[i];let o;if(n.size)n.delete(o=Array.from(n).shift());else if(o=Vr(s),!zr(s,o+1))return;const a={cached:Math.floor(Date.now()/Fs),provider:e.provider,data:t};return ci(s,Sn+o.toString(),JSON.stringify(a))}t.lastModified&&!ad(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),r("local")||r("session"))}function vo(){}function cd(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Ju(e)}))}function ud(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:r,prefix:i}=e,s=e.iconsToLoad;delete e.iconsToLoad;let n;if(!s||!(n=qr(r)))return;n.prepare(r,i,s).forEach(a=>{id(r,a,d=>{if(typeof d!="object")a.icons.forEach(h=>{e.missing.add(h)});else try{const h=oi(e,d);if(!h.length)return;const u=e.pendingIcons;u&&h.forEach(f=>{u.delete(f)}),ld(e,d)}catch(h){console.error(h)}cd(e)})})}))}const dd=(e,t)=>{const r=ed(e,!0,_s()),i=Yu(r);if(!i.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(i.loaded,i.missing,i.pending,vo)}),()=>{d=!1}}const s=Object.create(null),n=[];let o,a;return i.pending.forEach(d=>{const{provider:h,prefix:u}=d;if(u===a&&h===o)return;o=h,a=u,n.push(en(h,u));const f=s[h]||(s[h]=Object.create(null));f[u]||(f[u]=[])}),i.pending.forEach(d=>{const{provider:h,prefix:u,name:f}=d,j=en(h,u),m=j.pendingIcons||(j.pendingIcons=new Set);m.has(f)||(m.add(f),s[h][u].push(f))}),n.forEach(d=>{const{provider:h,prefix:u}=d;s[h][u].length&&ud(d,s[h][u])}),t?Zu(t,i,n):vo};function hd(e,t){const r={...e};for(const i in t){const s=t[i],n=typeof s;i in Ns?(s===null||s&&(n==="string"||n==="number"))&&(r[i]=s):n===typeof r[i]&&(r[i]=i==="rotate"?s%4:s)}return r}const fd=/[\s,]+/;function pd(e,t){t.split(fd).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function md(e,t=0){const r=e.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(r===""){const s=parseInt(e);return isNaN(s)?0:i(s)}else if(r!==e){let s=0;switch(r){case"%":s=25;break;case"deg":s=90}if(s){let n=parseFloat(e.slice(0,e.length-r.length));return isNaN(n)?0:(n=n/s,n%1===0?i(n):0)}}return t}function gd(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function vd(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function yd(e){return"data:image/svg+xml,"+vd(e)}function bd(e){return'url("'+yd(e)+'")'}let xn;function xd(){try{xn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{xn=null}}function wd(e){return xn===void 0&&xd(),xn?xn.createHTML(e):e}const zs={...As,inline:!1},Sd={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ed={display:"inline-block"},Gr={backgroundColor:"currentColor"},Vs={backgroundColor:"transparent"},yo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},bo={WebkitMask:Gr,mask:Gr,background:Vs};for(const e in bo){const t=bo[e];for(const r in yo)t[e+r]=yo[r]}const kd={...zs,inline:!0};function xo(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Td=(e,t,r,i)=>{const s=r?kd:zs,n=hd(s,t),o=t.mode||"svg",a={},d=t.style||{},h={...o==="svg"?Sd:{},ref:i};for(let _ in t){const N=t[_];if(N!==void 0)switch(_){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":n[_]=N===!0||N==="true"||N===1;break;case"flip":typeof N=="string"&&pd(n,N);break;case"color":a.color=N;break;case"rotate":typeof N=="string"?n[_]=md(N):typeof N=="number"&&(n[_]=N);break;case"ariaHidden":case"aria-hidden":N!==!0&&N!=="true"&&delete h["aria-hidden"];break;default:s[_]===void 0&&(h[_]=N)}}const u=Du(e,n),f=u.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){h.style={...a,...d},Object.assign(h,f);let _=0,N=t.id;return typeof N=="string"&&(N=N.replace(/-/g,"_")),h.dangerouslySetInnerHTML={__html:wd($u(u.body,N?()=>N+"ID"+_++:"iconifyReact"))},Ut.createElement("svg",h)}const{body:j,width:m,height:E}=e,S=o==="mask"||(o==="bg"?!1:j.indexOf("currentColor")!==-1),C=gd(j,{...f,width:m+"",height:E+""});return h.style={...a,"--svg":bd(C),width:xo(f.width),height:xo(f.height),...Ed,...S?Gr:Vs,...d},Ut.createElement("span",h)};_s(!0);Uu("",Xu);if(typeof document<"u"&&typeof window<"u"){Ws();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Lu(i))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let r in t){const i="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;qu(r,s)||console.error(i)}catch{console.error(i)}}}}class Gs extends Ut.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 r=this.state,i=this.props.icon;if(typeof i=="object"&&i!==null&&typeof i.body=="string"){this._icon="",this._abortLoading(),(t||r.icon===null)&&this._setData({data:i});return}let s;if(typeof i!="string"||(s=Jn(i,!1,!0))===null){this._abortLoading(),this._setData(null);return}const n=Ru(s);if(!n){(!this._loading||this._loading.name!==i)&&(this._abortLoading(),this._icon="",this._setData(null),n!==null&&(this._loading={name:i,abort:dd([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==i||r.icon===null){this._abortLoading(),this._icon=i;const o=["iconify"];s.prefix!==""&&o.push("iconify--"+s.prefix),s.provider!==""&&o.push("iconify--"+s.provider),this._setData({data:n,classes:o}),this.props.onLoad&&this.props.onLoad(i)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,r=this.state.icon;if(r===null)return t.children?t.children:Ut.createElement("span",{});let i=t;return r.classes&&(i={...t,className:(typeof t.className=="string"?t.className+" ":"")+r.classes.join(" ")}),Td({...ii,...r.data},i,t._inline,t._ref)}}const Ft=Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!1};return Ut.createElement(Gs,i)});Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!0};return Ut.createElement(Gs,i)});var Un={exports:{}},jd=Un.exports,wo;function Od(){return wo||(wo=1,function(e,t){(function(r,i){e.exports=i(Ya())})(jd,r=>(()=>{var i={703:(a,d,h)=>{var u=h(414);function f(){}function j(){}j.resetWarningCache=f,a.exports=function(){function m(C,_,N,D,c,w){if(w!==u){var R=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 R.name="Invariant Violation",R}}function E(){return m}m.isRequired=m;var S={array:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:E,element:m,elementType:m,instanceOf:E,node:m,objectOf:E,oneOf:E,oneOfType:E,shape:E,exact:E,checkPropTypes:j,resetWarningCache:f};return S.PropTypes=S,S}},697:(a,d,h)=>{a.exports=h(703)()},414:a=>{a.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:a=>{var d=typeof Element<"u",h=typeof Map=="function",u=typeof Set=="function",f=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function j(m,E){if(m===E)return!0;if(m&&E&&typeof m=="object"&&typeof E=="object"){if(m.constructor!==E.constructor)return!1;var S,C,_,N;if(Array.isArray(m)){if((S=m.length)!=E.length)return!1;for(C=S;C--!=0;)if(!j(m[C],E[C]))return!1;return!0}if(h&&m instanceof Map&&E instanceof Map){if(m.size!==E.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!E.has(C.value[0]))return!1;for(N=m.entries();!(C=N.next()).done;)if(!j(C.value[1],E.get(C.value[0])))return!1;return!0}if(u&&m instanceof Set&&E instanceof Set){if(m.size!==E.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!E.has(C.value[0]))return!1;return!0}if(f&&ArrayBuffer.isView(m)&&ArrayBuffer.isView(E)){if((S=m.length)!=E.length)return!1;for(C=S;C--!=0;)if(m[C]!==E[C])return!1;return!0}if(m.constructor===RegExp)return m.source===E.source&&m.flags===E.flags;if(m.valueOf!==Object.prototype.valueOf)return m.valueOf()===E.valueOf();if(m.toString!==Object.prototype.toString)return m.toString()===E.toString();if((S=(_=Object.keys(m)).length)!==Object.keys(E).length)return!1;for(C=S;C--!=0;)if(!Object.prototype.hasOwnProperty.call(E,_[C]))return!1;if(d&&m instanceof Element)return!1;for(C=S;C--!=0;)if((_[C]!=="_owner"&&_[C]!=="__v"&&_[C]!=="__o"||!m.$$typeof)&&!j(m[_[C]],E[_[C]]))return!1;return!0}return m!=m&&E!=E}a.exports=function(m,E){try{return j(m,E)}catch(S){if((S.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw S}}},359:a=>{a.exports=r}},s={};function n(a){var d=s[a];if(d!==void 0)return d.exports;var h=s[a]={exports:{}};return i[a](h,h.exports,n),h.exports}n.n=a=>{var d=a&&a.__esModule?()=>a.default:()=>a;return n.d(d,{a:d}),d},n.d=(a,d)=>{for(var h in d)n.o(d,h)&&!n.o(a,h)&&Object.defineProperty(a,h,{enumerable:!0,get:d[h]})},n.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),n.o=(a,d)=>Object.prototype.hasOwnProperty.call(a,d),n.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var o={};return(()=>{function a(b){var g,T,I="";if(typeof b=="string"||typeof b=="number")I+=b;else if(typeof b=="object")if(Array.isArray(b))for(g=0;g<b.length;g++)b[g]&&(T=a(b[g]))&&(I&&(I+=" "),I+=T);else for(g in b)b[g]&&(I&&(I+=" "),I+=g);return I}function d(){for(var b,g,T=0,I="";T<arguments.length;)(b=arguments[T++])&&(g=a(b))&&(I&&(I+=" "),I+=g);return I}n.r(o),n.d(o,{default:()=>ga});var h=n(359),u=n.n(h);const f=function(b){var g=typeof b;return b!=null&&(g=="object"||g=="function")},j=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn;var m=typeof self=="object"&&self&&self.Object===Object&&self;const E=j||m||Function("return this")(),S=function(){return E.Date.now()};var C=/\s/,_=/^\s+/;const N=function(b){return b&&b.slice(0,function(g){for(var T=g.length;T--&&C.test(g.charAt(T)););return T}(b)+1).replace(_,"")},D=E.Symbol;var c=Object.prototype,w=c.hasOwnProperty,R=c.toString,B=D?D.toStringTag:void 0,M=Object.prototype.toString,re=D?D.toStringTag:void 0;const Z=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":re&&re in Object(b)?function(g){var T=w.call(g,B),I=g[B];try{g[B]=void 0;var J=!0}catch{}var fe=R.call(g);return J&&(T?g[B]=I:delete g[B]),fe}(b):function(g){return M.call(g)}(b)};var z=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,H=/^0o[0-7]+$/i,A=parseInt;const X=function(b){if(typeof b=="number")return b;if(function(I){return typeof I=="symbol"||function(J){return J!=null&&typeof J=="object"}(I)&&Z(I)=="[object Symbol]"}(b))return NaN;if(f(b)){var g=typeof b.valueOf=="function"?b.valueOf():b;b=f(g)?g+"":g}if(typeof b!="string")return b===0?b:+b;b=N(b);var T=W.test(b);return T||H.test(b)?A(b.slice(2),T?2:8):z.test(b)?NaN:+b};var $=Math.max,he=Math.min;const Oe=function(b,g,T){var I,J,fe,Te,y,v,P=0,K=!1,Q=!1,Y=!0;if(typeof b!="function")throw new TypeError("Expected a function");function xe(pe){var ke=I,Ae=J;return I=J=void 0,P=pe,Te=b.apply(Ae,ke)}function ge(pe){return P=pe,y=setTimeout(se,g),K?xe(pe):Te}function Ee(pe){var ke=pe-v;return v===void 0||ke>=g||ke<0||Q&&pe-P>=fe}function se(){var pe=S();if(Ee(pe))return ce(pe);y=setTimeout(se,function(ke){var Ae=g-(ke-v);return Q?he(Ae,fe-(ke-P)):Ae}(pe))}function ce(pe){return y=void 0,Y&&I?xe(pe):(I=J=void 0,Te)}function ue(){var pe=S(),ke=Ee(pe);if(I=arguments,J=this,v=pe,ke){if(y===void 0)return ge(v);if(Q)return clearTimeout(y),y=setTimeout(se,g),xe(v)}return y===void 0&&(y=setTimeout(se,g)),Te}return g=X(g)||0,f(T)&&(K=!!T.leading,fe=(Q="maxWait"in T)?$(X(T.maxWait)||0,g):fe,Y="trailing"in T?!!T.trailing:Y),ue.cancel=function(){y!==void 0&&clearTimeout(y),P=0,I=v=J=y=void 0},ue.flush=function(){return y===void 0?Te:ce(S())},ue},G=function(b,g,T){var I=!0,J=!0;if(typeof b!="function")throw new TypeError("Expected a function");return f(T)&&(I="leading"in T?!!T.leading:I,J="trailing"in T?!!T.trailing:J),Oe(b,g,{leading:I,maxWait:g,trailing:J})};var we=n(590),de=n.n(we),Le=function(){if(typeof Map<"u")return Map;function b(g,T){var I=-1;return g.some(function(J,fe){return J[0]===T&&(I=fe,!0)}),I}return function(){function g(){this.__entries__=[]}return Object.defineProperty(g.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),g.prototype.get=function(T){var I=b(this.__entries__,T),J=this.__entries__[I];return J&&J[1]},g.prototype.set=function(T,I){var J=b(this.__entries__,T);~J?this.__entries__[J][1]=I:this.__entries__.push([T,I])},g.prototype.delete=function(T){var I=this.__entries__,J=b(I,T);~J&&I.splice(J,1)},g.prototype.has=function(T){return!!~b(this.__entries__,T)},g.prototype.clear=function(){this.__entries__.splice(0)},g.prototype.forEach=function(T,I){I===void 0&&(I=null);for(var J=0,fe=this.__entries__;J<fe.length;J++){var Te=fe[J];T.call(I,Te[1],Te[0])}},g}()}(),ve=typeof window<"u"&&typeof document<"u"&&window.document===document,_e=n.g!==void 0&&n.g.Math===Math?n.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Pe=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(_e):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},He=["top","right","bottom","left","width","height","size","weight"],et=typeof MutationObserver<"u",ht=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(g,T){var I=!1,J=!1,fe=0;function Te(){I&&(I=!1,g()),J&&v()}function y(){Pe(Te)}function v(){var P=Date.now();if(I){if(P-fe<2)return;J=!0}else I=!0,J=!1,setTimeout(y,20);fe=P}return v}(this.refresh.bind(this))}return b.prototype.addObserver=function(g){~this.observers_.indexOf(g)||this.observers_.push(g),this.connected_||this.connect_()},b.prototype.removeObserver=function(g){var T=this.observers_,I=T.indexOf(g);~I&&T.splice(I,1),!T.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var g=this.observers_.filter(function(T){return T.gatherActive(),T.hasActive()});return g.forEach(function(T){return T.broadcastActive()}),g.length>0},b.prototype.connect_=function(){ve&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),et?(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(){ve&&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(g){var T=g.propertyName,I=T===void 0?"":T;He.some(function(J){return!!~I.indexOf(J)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Ze=function(b,g){for(var T=0,I=Object.keys(g);T<I.length;T++){var J=I[T];Object.defineProperty(b,J,{value:g[J],enumerable:!1,writable:!1,configurable:!0})}return b},te=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||_e},Ne=Me(0,0,0,0);function ye(b){return parseFloat(b)||0}function Be(b){for(var g=[],T=1;T<arguments.length;T++)g[T-1]=arguments[T];return g.reduce(function(I,J){return I+ye(b["border-"+J+"-width"])},0)}var jt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof te(b).SVGGraphicsElement}:function(b){return b instanceof te(b).SVGElement&&typeof b.getBBox=="function"};function Ot(b){return ve?jt(b)?function(g){var T=g.getBBox();return Me(0,0,T.width,T.height)}(b):function(g){var T=g.clientWidth,I=g.clientHeight;if(!T&&!I)return Ne;var J=te(g).getComputedStyle(g),fe=function(Y){for(var xe={},ge=0,Ee=["top","right","bottom","left"];ge<Ee.length;ge++){var se=Ee[ge],ce=Y["padding-"+se];xe[se]=ye(ce)}return xe}(J),Te=fe.left+fe.right,y=fe.top+fe.bottom,v=ye(J.width),P=ye(J.height);if(J.boxSizing==="border-box"&&(Math.round(v+Te)!==T&&(v-=Be(J,"left","right")+Te),Math.round(P+y)!==I&&(P-=Be(J,"top","bottom")+y)),!function(Y){return Y===te(Y).document.documentElement}(g)){var K=Math.round(v+Te)-T,Q=Math.round(P+y)-I;Math.abs(K)!==1&&(v-=K),Math.abs(Q)!==1&&(P-=Q)}return Me(fe.left,fe.top,v,P)}(b):Ne}function Me(b,g,T,I){return{x:b,y:g,width:T,height:I}}var Ct=function(){function b(g){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Me(0,0,0,0),this.target=g}return b.prototype.isActive=function(){var g=Ot(this.target);return this.contentRect_=g,g.width!==this.broadcastWidth||g.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var g=this.contentRect_;return this.broadcastWidth=g.width,this.broadcastHeight=g.height,g},b}(),Et=function(b,g){var T,I,J,fe,Te,y,v,P=(I=(T=g).x,J=T.y,fe=T.width,Te=T.height,y=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,v=Object.create(y.prototype),Ze(v,{x:I,y:J,width:fe,height:Te,top:J,right:I+fe,bottom:Te+J,left:I}),v);Ze(this,{target:b,contentRect:P})},_t=function(){function b(g,T,I){if(this.activeObservations_=[],this.observations_=new Le,typeof g!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=g,this.controller_=T,this.callbackCtx_=I}return b.prototype.observe=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof te(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)||(T.set(g,new Ct(g)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof te(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)&&(T.delete(g),T.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var g=this;this.clearActive(),this.observations_.forEach(function(T){T.isActive()&&g.activeObservations_.push(T)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var g=this.callbackCtx_,T=this.activeObservations_.map(function(I){return new Et(I.target,I.broadcastRect())});this.callback_.call(g,T,g),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),Ye=typeof WeakMap<"u"?new WeakMap:new Le,It=function b(g){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 T=ht.getInstance(),I=new _t(g,T,this);Ye.set(this,I)};["observe","unobserve","disconnect"].forEach(function(b){It.prototype[b]=function(){var g;return(g=Ye.get(this))[b].apply(g,arguments)}});const Nt=_e.ResizeObserver!==void 0?_e.ResizeObserver:It,at="Left",qe="Right",tt="Up",ot="Down",mt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},V={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},ae="mousemove",me="mouseup";function Ce(b,g){if(g===0)return b;const T=Math.PI/180*g;return[b[0]*Math.cos(T)+b[1]*Math.sin(T),b[1]*Math.cos(T)-b[0]*Math.sin(T)]}function ee(b){const{trackMouse:g}=b,T=h.useRef(Object.assign({},V)),I=h.useRef(Object.assign({},mt)),J=h.useRef(Object.assign({},I.current));let fe;for(fe in J.current=Object.assign({},I.current),I.current=Object.assign(Object.assign({},mt),b),mt)I.current[fe]===void 0&&(I.current[fe]=mt[fe]);const[Te,y]=h.useMemo(()=>function(v,P){const K=se=>{const ce="touches"in se;ce&&se.touches.length>1||v((ue,pe)=>{pe.trackMouse&&!ce&&(document.addEventListener(ae,Q),document.addEventListener(me,xe));const{clientX:ke,clientY:Ae}=ce?se.touches[0]:se,Ke=Ce([ke,Ae],pe.rotationAngle);return pe.onTouchStartOrOnMouseDown&&pe.onTouchStartOrOnMouseDown({event:se}),Object.assign(Object.assign(Object.assign({},ue),V),{initial:Ke.slice(),xy:Ke,start:se.timeStamp||0})})},Q=se=>{v((ce,ue)=>{const pe="touches"in se;if(pe&&se.touches.length>1)return ce;if(se.timeStamp-ce.start>ue.swipeDuration)return ce.swiping?Object.assign(Object.assign({},ce),{swiping:!1}):ce;const{clientX:ke,clientY:Ae}=pe?se.touches[0]:se,[Ke,ft]=Ce([ke,Ae],ue.rotationAngle),ct=Ke-ce.xy[0],nt=ft-ce.xy[1],Ge=Math.abs(ct),De=Math.abs(nt),zt=(se.timeStamp||0)-ce.start,hn=Math.sqrt(Ge*Ge+De*De)/(zt||1),fn=[ct/(zt||1),nt/(zt||1)],Mt=function(pn,an,mn,gt){return pn>an?mn>0?qe:at:gt>0?ot:tt}(Ge,De,ct,nt),Jt=typeof ue.delta=="number"?ue.delta:ue.delta[Mt.toLowerCase()]||mt.delta;if(Ge<Jt&&De<Jt&&!ce.swiping)return ce;const Rt={absX:Ge,absY:De,deltaX:ct,deltaY:nt,dir:Mt,event:se,first:ce.first,initial:ce.initial,velocity:hn,vxvy:fn};Rt.first&&ue.onSwipeStart&&ue.onSwipeStart(Rt),ue.onSwiping&&ue.onSwiping(Rt);let sn=!1;return(ue.onSwiping||ue.onSwiped||ue[`onSwiped${Mt}`])&&(sn=!0),sn&&ue.preventScrollOnSwipe&&ue.trackTouch&&se.cancelable&&se.preventDefault(),Object.assign(Object.assign({},ce),{first:!1,eventData:Rt,swiping:!0})})},Y=se=>{v((ce,ue)=>{let pe;if(ce.swiping&&ce.eventData){if(se.timeStamp-ce.start<ue.swipeDuration){pe=Object.assign(Object.assign({},ce.eventData),{event:se}),ue.onSwiped&&ue.onSwiped(pe);const ke=ue[`onSwiped${pe.dir}`];ke&&ke(pe)}}else ue.onTap&&ue.onTap({event:se});return ue.onTouchEndOrOnMouseUp&&ue.onTouchEndOrOnMouseUp({event:se}),Object.assign(Object.assign(Object.assign({},ce),V),{eventData:pe})})},xe=se=>{document.removeEventListener(ae,Q),document.removeEventListener(me,xe),Y(se)},ge=(se,ce)=>{let ue=()=>{};if(se&&se.addEventListener){const pe=Object.assign(Object.assign({},mt.touchEventOptions),ce.touchEventOptions),ke=[["touchstart",K,pe],["touchmove",Q,Object.assign(Object.assign({},pe),ce.preventScrollOnSwipe?{passive:!1}:{})],["touchend",Y,pe]];ke.forEach(([Ae,Ke,ft])=>se.addEventListener(Ae,Ke,ft)),ue=()=>ke.forEach(([Ae,Ke])=>se.removeEventListener(Ae,Ke))}return ue},Ee={ref:se=>{se!==null&&v((ce,ue)=>{if(ce.el===se)return ce;const pe={};return ce.el&&ce.el!==se&&ce.cleanUpTouch&&(ce.cleanUpTouch(),pe.cleanUpTouch=void 0),ue.trackTouch&&se&&(pe.cleanUpTouch=ge(se,ue)),Object.assign(Object.assign(Object.assign({},ce),{el:se}),pe)})}};return P.trackMouse&&(Ee.onMouseDown=K),[Ee,ge]}(v=>T.current=v(T.current,I.current),{trackMouse:g}),[g]);return T.current=function(v,P,K,Q){return P.trackTouch&&v.el?v.cleanUpTouch?P.preventScrollOnSwipe!==K.preventScrollOnSwipe||P.touchEventOptions.passive!==K.touchEventOptions.passive?(v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,P)})):v:Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,P)}):(v.cleanUpTouch&&v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:void 0}))}(T.current,I.current,J.current,y),Te}var O=n(697);function Ie(b){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Ie(b)}function Re(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function Fe(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?Re(Object(T),!0).forEach(function(I){p(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):Re(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function p(b,g,T){return(g=function(I){var J=function(fe,Te){if(Ie(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Te);if(Ie(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return Ie(J)==="symbol"?J:String(J)}(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},k=u().memo(function(b){var g=Fe(Fe({},x),b),T=g.description,I=g.fullscreen,J=g.handleImageLoaded,fe=g.isFullscreen,Te=g.onImageError,y=g.original,v=g.originalAlt,P=g.originalHeight,K=g.originalWidth,Q=g.originalTitle,Y=g.sizes,xe=g.srcSet,ge=g.loading,Ee=fe&&I||y;return u().createElement(u().Fragment,null,u().createElement("img",{className:"image-gallery-image",src:Ee,alt:v,srcSet:xe,height:P,width:K,sizes:Y,title:Q,onLoad:function(se){return J(se,y)},onError:Te,loading:ge}),T&&u().createElement("span",{className:"image-gallery-description"},T))});k.displayName="Item",k.propTypes={description:O.string,fullscreen:O.string,handleImageLoaded:O.func.isRequired,isFullscreen:O.bool,onImageError:O.func.isRequired,original:O.string.isRequired,originalAlt:O.string,originalHeight:O.string,originalWidth:O.string,originalTitle:O.string,sizes:O.string,srcSet:O.string,loading:O.string};const L=k;function U(b){return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},U(b)}function ne(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function le(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ne(Object(T),!0).forEach(function(I){Se(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):ne(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function Se(b,g,T){return(g=function(I){var J=function(fe,Te){if(U(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Te);if(U(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return U(J)==="symbol"?J:String(J)}(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}var be={left:u().createElement("polyline",{points:"15 18 9 12 15 6"}),right:u().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:u().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:u().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:u().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:u().createElement(u().Fragment,null,u().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),u().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},$e={strokeWidth:1,viewBox:"0 0 24 24"},ze=function(b){var g=le(le({},$e),b),T=g.strokeWidth,I=g.viewBox,J=g.icon;return u().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:I,fill:"none",stroke:"currentColor",strokeWidth:T,strokeLinecap:"round",strokeLinejoin:"round"},be[J])};ze.propTypes={strokeWidth:O.number,viewBox:O.string,icon:(0,O.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ue=ze;var Ve=u().memo(function(b){var g=b.isFullscreen,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:T,"aria-label":"Open Fullscreen"},u().createElement(Ue,{strokeWidth:2,icon:g?"minimize":"maximize"}))});Ve.displayName="Fullscreen",Ve.propTypes={isFullscreen:O.bool.isRequired,onClick:O.func.isRequired};const lt=Ve;var cn=u().memo(function(b){var g=b.disabled,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:g,onClick:T,"aria-label":"Previous Slide"},u().createElement(Ue,{icon:"left",viewBox:"6 0 12 24"}))});cn.displayName="LeftNav",cn.propTypes={disabled:O.bool.isRequired,onClick:O.func.isRequired};const er=cn;var st=u().memo(function(b){var g=b.disabled,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:g,onClick:T,"aria-label":"Next Slide"},u().createElement(Ue,{icon:"right",viewBox:"6 0 12 24"}))});st.displayName="RightNav",st.propTypes={disabled:O.bool.isRequired,onClick:O.func.isRequired};const un=st;var Wt=u().memo(function(b){var g=b.isPlaying,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:T,"aria-label":"Play or Pause Slideshow"},u().createElement(Ue,{strokeWidth:2,icon:g?"pause":"play"}))});Wt.displayName="PlayPause",Wt.propTypes={isPlaying:O.bool.isRequired,onClick:O.func.isRequired};const tn=Wt;function At(b){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},At(b)}function Yt(){return Yt=Object.assign?Object.assign.bind():function(b){for(var g=1;g<arguments.length;g++){var T=arguments[g];for(var I in T)Object.prototype.hasOwnProperty.call(T,I)&&(b[I]=T[I])}return b},Yt.apply(this,arguments)}function dn(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function Dt(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?dn(Object(T),!0).forEach(function(I){nn(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):dn(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function nn(b,g,T){return(g=function(I){var J=function(fe,Te){if(At(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Te);if(At(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return At(J)==="symbol"?J:String(J)}(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}var rn={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},jn=function(b){var g=Dt(Dt({},rn),b),T=g.children,I=g.className,J=ee({delta:g.delta,onSwiping:g.onSwiping,onSwiped:g.onSwiped});return u().createElement("div",Yt({},J,{className:I}),T)};jn.propTypes={children:O.node.isRequired,className:O.string,delta:O.number,onSwiped:O.func,onSwiping:O.func};const mi=jn;function on(b){return on=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},on(b)}function gi(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function vi(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?gi(Object(T),!0).forEach(function(I){yi(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):gi(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function fa(b,g){for(var T=0;T<g.length;T++){var I=g[T];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(b,bi(I.key),I)}}function tr(b,g){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,I){return T.__proto__=I,T},tr(b,g)}function pa(b,g){if(g&&(on(g)==="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xe(b)}function Xe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function On(b){return On=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)},On(b)}function yi(b,g,T){return(g=bi(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}function bi(b){var g=function(T,I){if(on(T)!=="object"||T===null)return T;var J=T[Symbol.toPrimitive];if(J!==void 0){var fe=J.call(T,I);if(on(fe)!=="object")return fe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}(b,"string");return on(g)==="symbol"?g:String(g)}var xi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],ma=(0,O.arrayOf)((0,O.shape)({srcSet:O.string,media:O.string}));function wi(b){var g=parseInt(b.keyCode||b.which||0,10);return g===66||g===62}var nr=function(b){(function(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),v&&tr(y,v)})(Te,b);var g,T,I,J,fe=(I=Te,J=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 y,v=On(I);if(J){var P=On(this).constructor;y=Reflect.construct(v,arguments,P)}else y=v.apply(this,arguments);return pa(this,y)});function Te(y){var v;return function(P,K){if(!(P instanceof K))throw new TypeError("Cannot call a class as a function")}(this,Te),yi(Xe(v=fe.call(this,y)),"onBulletClick",function(P,K){var Q=v.props,Y=Q.onBulletClick,xe=Q.items,ge=v.state.currentIndex;P.target.blur(),ge!==K&&(xe.length===2?v.slideToIndexWithStyleReset(K,P):v.slideToIndex(K,P)),Y&&Y(P,K)}),v.state={currentIndex:y.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(y.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},v.loadedImages={},v.imageGallery=u().createRef(),v.thumbnailsWrapper=u().createRef(),v.thumbnails=u().createRef(),v.imageGallerySlideWrapper=u().createRef(),v.handleImageLoaded=v.handleImageLoaded.bind(Xe(v)),v.handleKeyDown=v.handleKeyDown.bind(Xe(v)),v.handleMouseDown=v.handleMouseDown.bind(Xe(v)),v.handleResize=v.handleResize.bind(Xe(v)),v.handleTouchMove=v.handleTouchMove.bind(Xe(v)),v.handleOnSwiped=v.handleOnSwiped.bind(Xe(v)),v.handleScreenChange=v.handleScreenChange.bind(Xe(v)),v.handleSwiping=v.handleSwiping.bind(Xe(v)),v.handleThumbnailSwiping=v.handleThumbnailSwiping.bind(Xe(v)),v.handleOnThumbnailSwiped=v.handleOnThumbnailSwiped.bind(Xe(v)),v.onThumbnailMouseLeave=v.onThumbnailMouseLeave.bind(Xe(v)),v.handleImageError=v.handleImageError.bind(Xe(v)),v.pauseOrPlay=v.pauseOrPlay.bind(Xe(v)),v.renderThumbInner=v.renderThumbInner.bind(Xe(v)),v.renderItem=v.renderItem.bind(Xe(v)),v.slideLeft=v.slideLeft.bind(Xe(v)),v.slideRight=v.slideRight.bind(Xe(v)),v.toggleFullScreen=v.toggleFullScreen.bind(Xe(v)),v.togglePlay=v.togglePlay.bind(Xe(v)),v.unthrottledSlideToIndex=v.slideToIndex,v.slideToIndex=G(v.unthrottledSlideToIndex,y.slideDuration,{trailing:!1}),y.lazyLoad&&(v.lazyLoaded=[]),v}return g=Te,T=[{key:"componentDidMount",value:function(){var y=this.props,v=y.autoPlay,P=y.useWindowKeyDown;v&&this.play(),P?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(y,v){var P=this.props,K=P.items,Q=P.lazyLoad,Y=P.slideDuration,xe=P.slideInterval,ge=P.startIndex,Ee=P.thumbnailPosition,se=P.showThumbnails,ce=P.useWindowKeyDown,ue=this.state,pe=ue.currentIndex,ke=ue.isPlaying,Ae=y.items.length!==K.length,Ke=!de()(y.items,K),ft=y.startIndex!==ge,ct=y.thumbnailPosition!==Ee,nt=y.showThumbnails!==se;xe===y.slideInterval&&Y===y.slideDuration||ke&&(this.pause(),this.play()),ct&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),nt&&se&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),nt&&!se&&this.removeThumbnailsResizeObserver(),(Ae||nt)&&this.handleResize(),v.currentIndex!==pe&&this.slideThumbnailBar(),y.slideDuration!==Y&&(this.slideToIndex=G(this.unthrottledSlideToIndex,Y,{trailing:!1})),!Q||y.lazyLoad&&!Ke||(this.lazyLoaded=[]),ce!==y.useWindowKeyDown&&(ce?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ft||Ke)&&this.setState({currentIndex:ge,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var y=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),y?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var y=this,v=this.state,P=v.currentIndex,K=v.isTransitioning,Q=this.props,Y=Q.onSlide,xe=Q.slideDuration;this.transitionTimer=window.setTimeout(function(){K&&(y.setState({isTransitioning:!K,isSwipingThumbnail:!1}),Y&&Y(P))},xe+50)}},{key:"onThumbnailClick",value:function(y,v){var P=this.props,K=P.onThumbnailClick,Q=P.items,Y=this.state.currentIndex;y.target.parentNode.parentNode.blur(),Y!==v&&(Q.length===2?this.slideToIndexWithStyleReset(v,y):this.slideToIndex(v,y)),K&&K(y,v)}},{key:"onThumbnailMouseOver",value:function(y,v){var P=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){P.slideToIndex(v),P.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var y=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,y&&this.play()}}},{key:"setThumbsTranslate",value:function(y){this.setState({thumbsTranslate:y})}},{key:"setModalFullscreen",value:function(y){var v=this.props.onScreenChange;this.setState({modalFullscreen:y}),v&&v(y)}},{key:"getThumbsTranslate",value:function(y){var v,P=this.props,K=P.disableThumbnailScroll,Q=P.items,Y=this.state,xe=Y.thumbnailsWrapperWidth,ge=Y.thumbnailsWrapperHeight,Ee=this.thumbnails&&this.thumbnails.current;if(K)return 0;if(Ee){if(this.isThumbnailVertical()){if(Ee.scrollHeight<=ge)return 0;v=Ee.scrollHeight-ge}else{if(Ee.scrollWidth<=xe||xe<=0)return 0;v=Ee.scrollWidth-xe}return y*(v/(Q.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(y){switch(y){case"left":y=" ".concat("image-gallery-thumbnails-left");break;case"right":y=" ".concat("image-gallery-thumbnails-right");break;case"bottom":y=" ".concat("image-gallery-thumbnails-bottom");break;case"top":y=" ".concat("image-gallery-thumbnails-top")}return y}},{key:"getAlignmentClassName",value:function(y){var v=this.state.currentIndex,P=this.props,K=P.infinite,Q=P.items,Y="",xe="image-gallery-left",ge="image-gallery-right";switch(y){case v-1:Y=" ".concat(xe);break;case v:Y=" ".concat("image-gallery-center");break;case v+1:Y=" ".concat(ge)}return Q.length>=3&&K&&(y===0&&v===Q.length-1?Y=" ".concat(ge):y===Q.length-1&&v===0&&(Y=" ".concat(xe))),Y}},{key:"getTranslateXForTwoSlide",value:function(y){var v=this.state,P=v.currentIndex,K=v.currentSlideOffset,Q=v.previousIndex,Y=P!==Q,xe=y===0&&Q===0,ge=y===1&&Q===1,Ee=y===0&&P===1,se=y===1&&P===0,ce=K===0,ue=-100*P+100*y+K;return K>0?this.direction="left":K<0&&(this.direction="right"),se&&K>0&&(ue=-100+K),Ee&&K<0&&(ue=100+K),Y?xe&&ce&&this.direction==="left"?ue=100:ge&&ce&&this.direction==="right"&&(ue=-100):(se&&ce&&this.direction==="left"&&(ue=-100),Ee&&ce&&this.direction==="right"&&(ue=100)),ue}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(y){var v=this.state,P=v.currentIndex,K=v.currentSlideOffset,Q=v.slideStyle,Y=this.props,xe=Y.infinite,ge=Y.items,Ee=Y.useTranslate3D,se=Y.isRTL,ce=-100*P,ue=ge.length-1,pe=(ce+100*y)*(se?-1:1)+K;xe&&ge.length>2&&(P===0&&y===ue?pe=-100*(se?-1:1)+K:P===ue&&y===0&&(pe=100*(se?-1:1)+K)),xe&&ge.length===2&&(pe=this.getTranslateXForTwoSlide(y));var ke="translate(".concat(pe,"%, 0)");return Ee&&(ke="translate3d(".concat(pe,"%, 0, 0)")),vi({display:this.isSlideVisible(y)?"inherit":"none",WebkitTransform:ke,MozTransform:ke,msTransform:ke,OTransform:ke,transform:ke},Q)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var y,v=this.props,P=v.useTranslate3D,K=v.isRTL,Q=this.state,Y=Q.thumbsTranslate,xe=Q.thumbsStyle,ge=K?-1*Y:Y;return this.isThumbnailVertical()?(y="translate(0, ".concat(Y,"px)"),P&&(y="translate3d(0, ".concat(Y,"px, 0)"))):(y="translate(".concat(ge,"px, 0)"),P&&(y="translate3d(".concat(ge,"px, 0, 0)"))),vi({WebkitTransform:y,MozTransform:y,msTransform:y,OTransform:y,transform:y},xe)}},{key:"getSlideItems",value:function(){var y=this,v=this.state.currentIndex,P=this.props,K=P.items,Q=P.slideOnThumbnailOver,Y=P.onClick,xe=P.lazyLoad,ge=P.onTouchMove,Ee=P.onTouchEnd,se=P.onTouchStart,ce=P.onMouseOver,ue=P.onMouseLeave,pe=P.renderItem,ke=P.renderThumbInner,Ae=P.showThumbnails,Ke=P.showBullets,ft=[],ct=[],nt=[];return K.forEach(function(Ge,De){var zt=y.getAlignmentClassName(De),hn=Ge.originalClass?" ".concat(Ge.originalClass):"",fn=Ge.thumbnailClass?" ".concat(Ge.thumbnailClass):"",Mt=Ge.renderItem||pe||y.renderItem,Jt=Ge.renderThumbInner||ke||y.renderThumbInner,Rt=!xe||zt||y.lazyLoaded[De];Rt&&xe&&!y.lazyLoaded[De]&&(y.lazyLoaded[De]=!0);var sn=y.getSlideStyle(De),pn=u().createElement("div",{"aria-label":"Go to Slide ".concat(De+1),key:"slide-".concat(De),tabIndex:"-1",className:"image-gallery-slide ".concat(zt," ").concat(hn),style:sn,onClick:Y,onKeyUp:y.handleSlideKeyUp,onTouchMove:ge,onTouchEnd:Ee,onTouchStart:se,onMouseOver:ce,onFocus:ce,onMouseLeave:ue,role:"button"},Rt?Mt(Ge):u().createElement("div",{style:{height:"100%"}}));if(ft.push(pn),Ae&&Ge.thumbnail){var an=d("image-gallery-thumbnail",fn,{active:v===De});ct.push(u().createElement("button",{key:"thumbnail-".concat(De),type:"button",tabIndex:"0","aria-pressed":v===De?"true":"false","aria-label":"Go to Slide ".concat(De+1),className:an,onMouseLeave:Q?y.onThumbnailMouseLeave:null,onMouseOver:function(gt){return y.handleThumbnailMouseOver(gt,De)},onFocus:function(gt){return y.handleThumbnailMouseOver(gt,De)},onKeyUp:function(gt){return y.handleThumbnailKeyUp(gt,De)},onClick:function(gt){return y.onThumbnailClick(gt,De)}},Jt(Ge)))}if(Ke){var mn=d("image-gallery-bullet",Ge.bulletClass,{active:v===De});nt.push(u().createElement("button",{type:"button",key:"bullet-".concat(De),className:mn,onClick:function(gt){return y.onBulletClick(gt,De)},"aria-pressed":v===De?"true":"false","aria-label":"Go to Slide ".concat(De+1)}))}}),{slides:ft,thumbnails:ct,bullets:nt}}},{key:"ignoreIsTransitioning",value:function(){var y=this.props.items,v=this.state,P=v.previousIndex,K=v.currentIndex,Q=y.length-1;return Math.abs(P-K)>1&&!(P===0&&K===Q)&&!(P===Q&&K===0)}},{key:"isFirstOrLastSlide",value:function(y){return y===this.props.items.length-1||y===0}},{key:"slideIsTransitioning",value:function(y){var v=this.state,P=v.isTransitioning,K=v.previousIndex,Q=v.currentIndex;return P&&!(y===K||y===Q)}},{key:"isSlideVisible",value:function(y){return!this.slideIsTransitioning(y)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(y)}},{key:"slideThumbnailBar",value:function(){var y=this.state,v=y.currentIndex,P=y.isSwipingThumbnail,K=-this.getThumbsTranslate(v);P||(v===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:K,thumbsSwipedTranslate:K}))}},{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(y){var v=y.event,P=y.absX,K=y.dir,Q=this.props,Y=Q.disableSwipe,xe=Q.stopPropagation,ge=this.state,Ee=ge.galleryWidth,se=ge.isTransitioning,ce=ge.swipingUpDown,ue=ge.swipingLeftRight;if(K!==tt&&K!==ot&&!ce||ue){if(K!==at&&K!==qe||ue||this.setState({swipingLeftRight:!0}),!Y){var pe=this.props.swipingTransitionDuration;if(xe&&v.preventDefault(),se)this.setState({currentSlideOffset:0});else{var ke=K===qe?1:-1,Ae=P/Ee*100;Math.abs(Ae)>=100&&(Ae=100);var Ke={transition:"transform ".concat(pe,"ms ease-out")};this.setState({currentSlideOffset:ke*Ae,slideStyle:Ke})}}}else ce||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(y){var v=y.event,P=y.absX,K=y.absY,Q=y.dir,Y=this.props,xe=Y.stopPropagation,ge=Y.swipingThumbnailTransitionDuration,Ee=this.state,se=Ee.thumbsSwipedTranslate,ce=Ee.thumbnailsWrapperHeight,ue=Ee.thumbnailsWrapperWidth,pe=Ee.swipingUpDown,ke=Ee.swipingLeftRight;if(this.isThumbnailVertical()){if((Q===at||Q===qe||ke)&&!pe)return void(ke||this.setState({swipingLeftRight:!0}));Q!==tt&&Q!==ot||pe||this.setState({swipingUpDown:!0})}else{if((Q===tt||Q===ot||pe)&&!ke)return void(pe||this.setState({swipingUpDown:!0}));Q!==at&&Q!==qe||ke||this.setState({swipingLeftRight:!0})}var Ae,Ke,ft,ct,nt,Ge=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(Ae=se+(Q===ot?K:-K),Ke=Ge.scrollHeight-ce+20,ft=Math.abs(Ae)>Ke,ct=Ae>20,nt=Ge.scrollHeight<=ce):(Ae=se+(Q===qe?P:-P),Ke=Ge.scrollWidth-ue+20,ft=Math.abs(Ae)>Ke,ct=Ae>20,nt=Ge.scrollWidth<=ue),!nt&&(Q!==at&&Q!==tt||!ft)&&(Q!==qe&&Q!==ot||!ct)){xe&&v.stopPropagation();var De={transition:"transform ".concat(ge,"ms ease-out")};this.setState({thumbsTranslate:Ae,thumbsStyle:De})}}},{key:"handleOnThumbnailSwiped",value:function(){var y=this.state.thumbsTranslate,v=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:y,thumbsStyle:{transition:"all ".concat(v,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var y=this.state.currentSlideOffset,v=this.props.swipeThreshold;return Math.abs(y)>v}},{key:"resetSwipingDirection",value:function(){var y=this.state,v=y.swipingUpDown,P=y.swipingLeftRight;v&&this.setState({swipingUpDown:!1}),P&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(y){var v=y.event,P=y.dir,K=y.velocity,Q=this.props,Y=Q.disableSwipe,xe=Q.stopPropagation,ge=Q.flickThreshold;if(!Y){var Ee=this.props.isRTL;xe&&v.stopPropagation(),this.resetSwipingDirection();var se=(P===at?1:-1)*(Ee?-1:1),ce=K>ge&&!(P===tt||P===ot);this.handleOnSwipedTo(se,ce)}}},{key:"handleOnSwipedTo",value:function(y,v){var P=this.state,K=P.currentIndex,Q=P.isTransitioning,Y=K;!this.sufficientSwipe()&&!v||Q||(Y+=y),(y===-1&&!this.canSlideLeft()||y===1&&!this.canSlideRight())&&(Y=K),this.unthrottledSlideToIndex(Y)}},{key:"handleTouchMove",value:function(y){this.state.swipingLeftRight&&y.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(y){var v=this.props,P=v.disableKeyDown,K=v.useBrowserFullscreen,Q=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!P)switch(parseInt(y.keyCode||y.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(y);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(y);break;case 27:Q&&!K&&this.exitFullScreen()}}},{key:"handleImageError",value:function(y){var v=this.props.onErrorImageURL;v&&y.target.src.indexOf(v)===-1&&(y.target.src=v)}},{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 y=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(y)))}},{key:"initSlideWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeSlideWrapperObserver=new Nt(Oe(function(P){P&&P.forEach(function(K){v.setState({thumbnailsWrapperWidth:K.contentRect.width},v.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(y.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeThumbnailWrapperObserver=new Nt(Oe(function(P){P&&P.forEach(function(K){v.setState({thumbnailsWrapperHeight:K.contentRect.height},v.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(y.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 y=this.props,v=y.onScreenChange,P=y.useBrowserFullscreen,K=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,Q=this.imageGallery.current===K;v&&v(Q),P&&this.setState({isFullscreen:Q})}},{key:"slideToIndex",value:function(y,v){var P=this.state,K=P.currentIndex,Q=P.isTransitioning,Y=this.props,xe=Y.items,ge=Y.slideDuration,Ee=Y.onBeforeSlide;if(!Q){v&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var se=xe.length-1,ce=y;y<0?ce=se:y>se&&(ce=0),Ee&&ce!==K&&Ee(ce),this.setState({previousIndex:K,currentIndex:ce,isTransitioning:ce!==K,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ge,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"right":"left")}},{key:"slideRight",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"left":"right")}},{key:"slideTo",value:function(y,v){var P=this.state,K=P.currentIndex,Q=P.isTransitioning,Y=this.props.items,xe=K+(v==="left"?-1:1);Q||(Y.length===2?this.slideToIndexWithStyleReset(xe,y):this.slideToIndex(xe,y))}},{key:"slideToIndexWithStyleReset",value:function(y,v){var P=this,K=this.state,Q=K.currentIndex,Y=K.currentSlideOffset;this.setState({currentSlideOffset:Y+(Q>y?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return P.slideToIndex(y,v)},25)})}},{key:"handleThumbnailMouseOver",value:function(y,v){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(y,v)}},{key:"handleThumbnailKeyUp",value:function(y,v){wi(y)&&this.onThumbnailClick(y,v)}},{key:"handleSlideKeyUp",value:function(y){wi(y)&&(0,this.props.onClick)(y)}},{key:"isThumbnailVertical",value:function(){var y=this.props.thumbnailPosition;return y==="left"||y==="right"}},{key:"addScreenChangeEvent",value:function(){var y=this;xi.forEach(function(v){document.addEventListener(v,y.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var y=this;xi.forEach(function(v){document.removeEventListener(v,y.handleScreenChange)})}},{key:"fullScreen",value:function(){var y=this.props.useBrowserFullscreen,v=this.imageGallery.current;y?v.requestFullscreen?v.requestFullscreen():v.msRequestFullscreen?v.msRequestFullscreen():v.mozRequestFullScreen?v.mozRequestFullScreen():v.webkitRequestFullscreen?v.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var y=this.state.isFullscreen,v=this.props.useBrowserFullscreen;y&&(v?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 y=this.props.infinite,v=this.state.currentIndex;y||this.canSlideRight()?this.slideToIndex(v+1):this.pause()}},{key:"play",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props,P=v.onPlay,K=v.slideInterval,Q=v.slideDuration,Y=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(K,Q)),P&&y&&P(Y))}},{key:"pause",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props.onPause,P=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),v&&y&&v(P))}},{key:"isImageLoaded",value:function(y){return!!this.loadedImages[y.original]||(this.loadedImages[y.original]=!0,!1)}},{key:"handleImageLoaded",value:function(y,v){var P=this.props.onImageLoad;!this.loadedImages[v]&&P&&(this.loadedImages[v]=!0,P(y))}},{key:"renderItem",value:function(y){var v=this.state.isFullscreen,P=this.props.onImageError||this.handleImageError;return u().createElement(L,{description:y.description,fullscreen:y.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:v,onImageError:P,original:y.original,originalAlt:y.originalAlt,originalHeight:y.originalHeight,originalWidth:y.originalWidth,originalTitle:y.originalTitle,sizes:y.sizes,loading:y.loading,srcSet:y.srcSet})}},{key:"renderThumbInner",value:function(y){var v=this.props.onThumbnailError||this.handleImageError;return u().createElement("span",{className:"image-gallery-thumbnail-inner"},u().createElement("img",{className:"image-gallery-thumbnail-image",src:y.thumbnail,height:y.thumbnailHeight,width:y.thumbnailWidth,alt:y.thumbnailAlt,title:y.thumbnailTitle,loading:y.thumbnailLoading,onError:v}),y.thumbnailLabel&&u().createElement("div",{className:"image-gallery-thumbnail-label"},y.thumbnailLabel))}},{key:"render",value:function(){var y=this.state,v=y.currentIndex,P=y.isFullscreen,K=y.modalFullscreen,Q=y.isPlaying,Y=this.props,xe=Y.additionalClass,ge=Y.disableThumbnailSwipe,Ee=Y.indexSeparator,se=Y.isRTL,ce=Y.items,ue=Y.thumbnailPosition,pe=Y.renderFullscreenButton,ke=Y.renderCustomControls,Ae=Y.renderLeftNav,Ke=Y.renderRightNav,ft=Y.showBullets,ct=Y.showFullscreenButton,nt=Y.showIndex,Ge=Y.showThumbnails,De=Y.showNav,zt=Y.showPlayButton,hn=Y.renderPlayPauseButton,fn=this.getThumbnailStyle(),Mt=this.getSlideItems(),Jt=Mt.slides,Rt=Mt.thumbnails,sn=Mt.bullets,pn=d("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ue),{"image-gallery-rtl":se}),an=u().createElement("div",{ref:this.imageGallerySlideWrapper,className:pn},ke&&ke(),this.canSlide()?u().createElement(u().Fragment,null,De&&u().createElement(u().Fragment,null,Ae(this.slideLeft,!this.canSlideLeft()),Ke(this.slideRight,!this.canSlideRight())),u().createElement(mi,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},u().createElement("div",{className:"image-gallery-slides"},Jt))):u().createElement("div",{className:"image-gallery-slides"},Jt),zt&&hn(this.togglePlay,Q),ft&&u().createElement("div",{className:"image-gallery-bullets"},u().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},sn)),ct&&pe(this.toggleFullScreen,P),nt&&u().createElement("div",{className:"image-gallery-index"},u().createElement("span",{className:"image-gallery-index-current"},v+1),u().createElement("span",{className:"image-gallery-index-separator"},Ee),u().createElement("span",{className:"image-gallery-index-total"},ce.length))),mn=d("image-gallery",xe,{"fullscreen-modal":K}),gt=d("image-gallery-content",this.getThumbnailPositionClassName(ue),{fullscreen:P}),va=d("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ue),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&se},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ge},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ge});return u().createElement("div",{ref:this.imageGallery,className:mn,"aria-live":"polite"},u().createElement("div",{className:gt},(ue==="bottom"||ue==="right")&&an,Ge&&Rt.length>0?u().createElement(mi,{className:va,delta:0,onSwiping:!ge&&this.handleThumbnailSwiping,onSwiped:!ge&&this.handleOnThumbnailSwiped},u().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},u().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:fn,"aria-label":"Thumbnail Navigation"},Rt))):null,(ue==="top"||ue==="left")&&an))}}],T&&fa(g.prototype,T),Object.defineProperty(g,"prototype",{writable:!1}),Te}(u().Component);nr.propTypes={flickThreshold:O.number,items:(0,O.arrayOf)((0,O.shape)({bulletClass:O.string,bulletOnClick:O.func,description:O.string,original:O.string,originalHeight:O.number,originalWidth:O.number,loading:O.string,thumbnailHeight:O.number,thumbnailWidth:O.number,thumbnailLoading:O.string,fullscreen:O.string,originalAlt:O.string,originalTitle:O.string,thumbnail:O.string,thumbnailAlt:O.string,thumbnailLabel:O.string,thumbnailTitle:O.string,originalClass:O.string,thumbnailClass:O.string,renderItem:O.func,renderThumbInner:O.func,imageSet:ma,srcSet:O.string,sizes:O.string})).isRequired,showNav:O.bool,autoPlay:O.bool,lazyLoad:O.bool,infinite:O.bool,showIndex:O.bool,showBullets:O.bool,showThumbnails:O.bool,showPlayButton:O.bool,showFullscreenButton:O.bool,disableThumbnailScroll:O.bool,disableKeyDown:O.bool,disableSwipe:O.bool,disableThumbnailSwipe:O.bool,useBrowserFullscreen:O.bool,onErrorImageURL:O.string,indexSeparator:O.string,thumbnailPosition:(0,O.oneOf)(["top","bottom","left","right"]),startIndex:O.number,slideDuration:O.number,slideInterval:O.number,slideOnThumbnailOver:O.bool,swipeThreshold:O.number,swipingTransitionDuration:O.number,swipingThumbnailTransitionDuration:O.number,onSlide:O.func,onBeforeSlide:O.func,onScreenChange:O.func,onPause:O.func,onPlay:O.func,onClick:O.func,onImageLoad:O.func,onImageError:O.func,onTouchMove:O.func,onTouchEnd:O.func,onTouchStart:O.func,onMouseOver:O.func,onMouseLeave:O.func,onBulletClick:O.func,onThumbnailError:O.func,onThumbnailClick:O.func,renderCustomControls:O.func,renderLeftNav:O.func,renderRightNav:O.func,renderPlayPauseButton:O.func,renderFullscreenButton:O.func,renderItem:O.func,renderThumbInner:O.func,stopPropagation:O.bool,additionalClass:O.string,useTranslate3D:O.bool,isRTL:O.bool,useWindowKeyDown:O.bool},nr.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,g){return u().createElement(er,{onClick:b,disabled:g})},renderRightNav:function(b,g){return u().createElement(un,{onClick:b,disabled:g})},renderPlayPauseButton:function(b,g){return u().createElement(tn,{onClick:b,isPlaying:g})},renderFullscreenButton:function(b,g){return u().createElement(lt,{onClick:b,isFullscreen:g})},useWindowKeyDown:!0};const ga=nr})(),o})())}(Un)),Un.exports}var Cd=Od();const Id=ei(Cd);function Rd(){var e=new Map;function t(r){var i=r.root,s=r.rootMargin,n=r.threshold,o=e.get(i);o||(o=new Map,e.set(i,o));var a=JSON.stringify({rootMargin:s,threshold:n}),d=o.get(a);if(!d){var h=new Map,u=new IntersectionObserver(function(f){f.forEach(function(j){var m=h.get(j.target);m?.(j)})},{root:i,rootMargin:s,threshold:n});d={observer:u,entryCallbacks:h},o.set(a,d)}return{observe:function(j,m){var E,S;(E=d)==null||E.entryCallbacks.set(j,m),(S=d)==null||S.observer.observe(j)},unobserve:function(j){var m,E;(m=d)==null||m.entryCallbacks.delete(j),(E=d)==null||E.observer.unobserve(j)}}}return{getObserver:t}}var Pd="0px",Ld=[0],_d=Rd();function Nd(e){var t,r,i=(t=e?.rootMargin)!=null?t:Pd,s=(r=e?.threshold)!=null?r:Ld,n=q.useRef(null),o=q.useRef(null),a=q.useRef(null),d=q.useState(),h=d[0],u=d[1],f=q.useCallback(function(){var S=n.current;if(!S){u(void 0);return}var C=_d.getObserver({root:o.current,rootMargin:i,threshold:s});C.observe(S,function(_){u(_)}),a.current=C},[i,s]),j=q.useCallback(function(){var S=a.current,C=n.current;C&&S?.unobserve(C),a.current=null},[]),m=q.useCallback(function(S){j(),n.current=S,f()},[f,j]),E=q.useCallback(function(S){j(),o.current=S,f()},[f,j]);return[m,{entry:h,rootRef:E}]}function Kr(){return Kr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Kr.apply(this,arguments)}function Ad(e){var t,r=Nd(e),i=r[0],s=r[1],n=!!((t=s.entry)!=null&&t.isIntersecting),o=q.useState(n),a=o[0],d=o[1];return n&&!a&&d(!0),[i,Kr({},s,{isVisible:n,wasEverVisible:a})]}var Dd=100;function Md(e){var t=e.loading,r=e.hasNextPage,i=e.onLoadMore,s=e.rootMargin,n=e.disabled,o=e.delayInMs,a=o===void 0?Dd:o,d=Ad({rootMargin:s}),h=d[0],u=d[1],f=u.rootRef,j=u.isVisible,m=!n&&!t&&j&&r;return q.useEffect(function(){if(m){var E=setTimeout(function(){i()},a);return function(){clearTimeout(E)}}},[i,m,a]),[h,{rootRef:f}]}const Bd={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"/>'},Fd={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>'},$d={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"/>'};var Tr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function jr(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),function(){r(window.event)})}function Ks(e,t){for(var r=t.slice(0,t.length-1),i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function Hs(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),r=t.lastIndexOf("");r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function Ud(e,t){for(var r=e.length>=t.length?e:t,i=e.length>=t.length?t:e,s=!0,n=0;n<r.length;n++)i.indexOf(r[n])===-1&&(s=!1);return s}var di={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Tr?173:189,"=":Tr?61:187,";":Tr?59:186,"'":222,"[":219,"]":221,"\\":220},Ht={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Hr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},rt={16:!1,18:!1,17:!1,91:!1},Qe={};for(var An=1;An<20;An++)di["f".concat(An)]=111+An;var We=[],So=!1,Xs="all",Ys=[],Zn=function(t){return di[t.toLowerCase()]||Ht[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Js(e){Xs=e||"all"}function En(){return Xs||"all"}function qd(){return We.slice(0)}function Wd(e){var t=e.target||e.srcElement,r=t.tagName,i=!0;return(t.isContentEditable||(r==="INPUT"||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function zd(e){return typeof e=="string"&&(e=Zn(e)),We.indexOf(e)!==-1}function Vd(e,t){var r,i;e||(e=En());for(var s in Qe)if(Object.prototype.hasOwnProperty.call(Qe,s))for(r=Qe[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1):i++;En()===e&&Js(t||"all")}function Gd(e){var t=e.keyCode||e.which||e.charCode,r=We.indexOf(t);if(r>=0&&We.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&We.splice(0,We.length),(t===93||t===224)&&(t=91),t in rt){rt[t]=!1;for(var i in Ht)Ht[i]===t&&(xt[i]=!1)}}function Kd(e){if(typeof e>"u")Object.keys(Qe).forEach(function(o){return delete Qe[o]});else if(Array.isArray(e))e.forEach(function(o){o.key&&Or(o)});else if(typeof e=="object")e.key&&Or(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var s=r[0],n=r[1];typeof s=="function"&&(n=s,s=""),Or({key:e,scope:s,method:n,splitKey:"+"})}}var Or=function(t){var r=t.key,i=t.scope,s=t.method,n=t.splitKey,o=n===void 0?"+":n,a=Hs(r);a.forEach(function(d){var h=d.split(o),u=h.length,f=h[u-1],j=f==="*"?"*":Zn(f);if(Qe[j]){i||(i=En());var m=u>1?Ks(Ht,h):[];Qe[j]=Qe[j].filter(function(E){var S=s?E.method===s:!0;return!(S&&E.scope===i&&Ud(E.mods,m))})}})};function Eo(e,t,r,i){if(t.element===i){var s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(var n in rt)Object.prototype.hasOwnProperty.call(rt,n)&&(!rt[n]&&t.mods.indexOf(+n)>-1||rt[n]&&t.mods.indexOf(+n)===-1)&&(s=!1);(t.mods.length===0&&!rt[16]&&!rt[18]&&!rt[17]&&!rt[91]||s||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function ko(e,t){var r=Qe["*"],i=e.keyCode||e.which||e.charCode;if(xt.filter.call(this,e)){if((i===93||i===224)&&(i=91),We.indexOf(i)===-1&&i!==229&&We.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(E){var S=Hr[E];e[E]&&We.indexOf(S)===-1?We.push(S):!e[E]&&We.indexOf(S)>-1?We.splice(We.indexOf(S),1):E==="metaKey"&&e[E]&&We.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(We=We.slice(We.indexOf(S))))}),i in rt){rt[i]=!0;for(var s in Ht)Ht[s]===i&&(xt[s]=!0);if(!r)return}for(var n in rt)Object.prototype.hasOwnProperty.call(rt,n)&&(rt[n]=e[Hr[n]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(We.indexOf(17)===-1&&We.push(17),We.indexOf(18)===-1&&We.push(18),rt[17]=!0,rt[18]=!0);var o=En();if(r)for(var a=0;a<r.length;a++)r[a].scope===o&&(e.type==="keydown"&&r[a].keydown||e.type==="keyup"&&r[a].keyup)&&Eo(e,r[a],o,t);if(i in Qe){for(var d=0;d<Qe[i].length;d++)if((e.type==="keydown"&&Qe[i][d].keydown||e.type==="keyup"&&Qe[i][d].keyup)&&Qe[i][d].key){for(var h=Qe[i][d],u=h.splitKey,f=h.key.split(u),j=[],m=0;m<f.length;m++)j.push(Zn(f[m]));j.sort().join("")===We.sort().join("")&&Eo(e,h,o,t)}}}}function Hd(e){return Ys.indexOf(e)>-1}function xt(e,t,r){We=[];var i=Hs(e),s=[],n="all",o=document,a=0,d=!1,h=!0,u="+",f=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(n=t.scope),t.element&&(o=t.element),t.keyup&&(d=t.keyup),t.keydown!==void 0&&(h=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(u=t.splitKey)),typeof t=="string"&&(n=t);a<i.length;a++)e=i[a].split(u),s=[],e.length>1&&(s=Ks(Ht,e)),e=e[e.length-1],e=e==="*"?"*":Zn(e),e in Qe||(Qe[e]=[]),Qe[e].push({keyup:d,keydown:h,scope:n,mods:s,shortcut:i[a],method:r,key:i[a],splitKey:u,element:o});typeof o<"u"&&!Hd(o)&&window&&(Ys.push(o),jr(o,"keydown",function(j){ko(j,o)},f),So||(So=!0,jr(window,"focus",function(){We=[]},f)),jr(o,"keyup",function(j){ko(j,o),Gd(j)},f))}function Xd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Qe).forEach(function(r){var i=Qe[r].find(function(s){return s.scope===t&&s.shortcut===e});i&&i.method&&i.method()})}var Cr={setScope:Js,getScope:En,deleteScope:Vd,getPressedKeyCodes:qd,isPressed:zd,filter:Wd,trigger:Xd,unbind:Kd,keyMap:di,modifier:Ht,modifierMap:Hr};for(var Ir in Cr)Object.prototype.hasOwnProperty.call(Cr,Ir)&&(xt[Ir]=Cr[Ir]);if(typeof window<"u"){var Yd=window.hotkeys;xt.noConflict=function(e){return e&&window.hotkeys===xt&&(window.hotkeys=Yd),xt},window.hotkeys=xt}xt.filter=function(){return!0};var Qs=function(t,r){var i=t.target,s=i&&i.tagName;return!!(s&&r&&r.includes(s))},Jd=function(t){return Qs(t,["INPUT","TEXTAREA","SELECT"])};function Qd(e,t,r,i){r instanceof Array&&(i=r,r=void 0);var s=r||{},n=s.enableOnTags,o=s.filter,a=s.keyup,d=s.keydown,h=s.filterPreventDefault,u=h===void 0?!0:h,f=s.enabled,j=f===void 0?!0:f,m=s.enableOnContentEditable,E=m===void 0?!1:m,S=q.useRef(null),C=q.useCallback(function(_,N){var D,c;return o&&!o(_)?!u:Jd(_)&&!Qs(_,n)||(D=_.target)!=null&&D.isContentEditable&&!E?!0:S.current===null||document.activeElement===S.current||(c=S.current)!=null&&c.contains(document.activeElement)?(t(_,N),!0):!1},i?[S,n,o].concat(i):[S,n,o]);return q.useEffect(function(){if(!j){xt.unbind(e,C);return}return a&&d!==!0&&(r.keydown=!1),xt(e,r||{},C),function(){return xt.unbind(e,C)}},[C,e,j]),S}xt.isPressed;const Zs=q.createContext({open:!1,toggleOpen:e=>{}});function Zd({children:e}){const[t,r]=q.useState(!1),i=n=>{r(n??!n)},s=q.useMemo(()=>({open:t,toggleOpen:i}),[t]);return l.jsx(Zs.Provider,{value:s,children:e})}function hi(){return q.useContext(Zs)}const St={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},eh=e=>Tn(async()=>{const{data:t}=await e.get(St.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function th(e,t){const r=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...bl(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:i,onSearchSelect:s=a=>{t.onFilterChange({...r,keyword:a.title})},emptyCategory:n}=t;!r.category&&!n&&(r.category="All");const o=a=>{const d={...r,...a};i(rr(d,h=>h===""||h===void 0))};return{filters:e,cleanFilter:a=>{const d=a?rr(r,(h,u)=>a.includes(u)):{};i(rr(d,h=>h===""||h===void 0))},handleActiveMenu:a=>{a!==e.menu&&i({menu:a})},handleSort:(a,d)=>{o({sortBy:a,sortDirection:d||a==="nameAsc"?"asc":"desc"})},handleKeyword:a=>{o({category:void 0,keyword:a||void 0})},handlePrice:a=>{o({price:a===e.price?void 0:a})},handleCategory:a=>{o({category:a===e.category?"":a})},handleDeveloper:a=>{o({owner:a||void 0})},handlePage:a=>{o({currentPage:a})},handleSwitchShowResources:a=>{o({showResources:a})},handleSearchSelect:a=>{s(a)}}}const nh=(e,t,r)=>e&&t||!r,ea=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ta=(e,t,r)=>{const i=xl(e),s=wl(i.search);if(Sl(e)?.endsWith(".gif"))return s.imageFilter?El({...i,search:""}):e;if(s.imageFilter)return e;const n=r||window.blocklet?.version,{w:o,h:a}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Xn(e,{...o||a?{imageFilter:"resize",w:o,h:a}:{},v:n})},rh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],ih=(e=[],t="en")=>e.map(r=>({name:r.locales[t]||r.locales.en,value:r._id})),oh=e=>Array.isArray(e)?e.map(t=>t.message).join(`
|
|
490
|
-
`):e.response?.data?.error?e.response.data.error.message||e.response.data.error:e.message||e,sh=(e,t)=>e?.replace(/{(\w*)}/g,(r,i)=>t.hasOwnProperty(i)?t[i]:""),ah=()=>window.innerWidth<=600,lh={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}"'}},ch={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}” 的所有搜索结果"}},Rr={en:ji(lh),zh:ji(ch)},na=(e,t)=>{const r={};return e&&(r["x-blocklet-server-version"]=e),t&&(r["x-blocklet-store-version"]=t),r},uh=e=>(t,r)=>{const i=Rr[e]?Rr[e][t]:Rr.en[t];return sh(i,r)||t},ra={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:()=>{}}},ia=q.createContext(ra),{Provider:dh,Consumer:Af}=ia;function hh(e){const{locale:t="zh",filters:r={},serverVersion:i="",onFilterChange:s=()=>{},minItemWidth:n=350,queryFilter:o=!0,layout:a={},wrapChildren:d=
|
|
489
|
+
`;const ao=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),wu=(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`},Is={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 Fr({title:e,sx:t,children:r,slotProps:i,fontSize:s=12,fontWeight:n=500,color:o="text.contrast",...a}){return e?l.jsx(Bo,{title:e,placement:"top",...a,slotProps:{popper:{...i?.popper,sx:Ho({[`& .${Pa.tooltip}`]:{fontSize:s,fontWeight:n,boxShadow:2,marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:o,display:"flex",alignItems:"center"}},i?.popper?.sx)}},children:r}):r}function _n({icon:e=null,children:t=null,maxWidth:r=100,title:i=void 0,sx:s={}}){return(t===0||t)&&l.jsxs(ut,{direction:"row",sx:[{alignItems:"center",gap:.5},{maxWidth:r,overflow:"hidden"},...Array.isArray(s)?s:[s]],children:[e,l.jsx(Fr,{title:i||(typeof t=="string"?t:""),children:l.jsx(je,{variant:"body2",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function Su({...e}){const{title:t,description:r="",cover:i="",avatar:s,author:n,download:o,did:a,official:d,buttonText:h="Install",buttonDisabled:u,buttonLoading:f,button:j,onButtonClick:m=()=>{},onMainClick:E,className:S,ref:C,icons:_,status:N,...D}=e,c=qt(),w=(Z,z=()=>!1)=>(W,...H)=>{const A=Z instanceof Function;(z()||A)&&(W.preventDefault(),W.stopPropagation(),A&&Z(...H))},R=E&&w(E),B=w(m,()=>!!(j||u||f)),M=q.isValidElement(t)?{children:t}:{title:ao(t),dangerouslySetInnerHTML:{__html:t}},re=q.isValidElement(r)?{children:r}:{title:ao(r),dangerouslySetInnerHTML:{__html:r}};return l.jsxs(La,{variant:"outlined",onClick:R,...D,sx:{p:{xs:2,md:3},borderRadius:1,...D.sx},children:[l.jsxs(ut,{direction:"row",sx:{flex:1,gap:1,alignItems:"center",overflow:"hidden","& > *":{flexShrink:0}},children:[l.jsx(qn,{src:i,did:a,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),l.jsx(je,{className:"blocklet-title",...M,sx:[{fontWeight:"fontWeightMedium",fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...Array.isArray(M.sx)?M.sx:[M.sx]]}),l.jsxs(oe,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[d&&l.jsx(Fr,{title:d.tooltip,children:l.jsx(_a,{sx:{color:d.color||"#D97706",fontSize:d.size||18}})}),_?.map(Z=>l.jsx(Fr,{title:Z.title,children:typeof Z.icon=="string"?l.jsx(bt,{icon:Z.icon,style:{color:Z.color}}):Z.icon},Z.key))]}),m&&l.jsxs(yt,{variant:"outlined",size:"small",disabled:u||f,style:{color:c.palette.text.primary,borderColor:c.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:c.typography.fontWeightMedium},onClick:B,children:[f&&l.jsx(Tt,{size:15,style:{marginRight:3,color:"inherit"}}),h]}),j]}),l.jsx(ut,{sx:{py:2},children:l.jsx(je,{className:"blocklet-description",variant:"body2",...re,sx:[{color:"text.secondary",display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...Array.isArray(re.sx)?re.sx:[re.sx]]})}),l.jsxs(ut,{direction:"row",sx:{alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(_n,{icon:l.jsx(qn,{src:s,did:a,size:20,variant:"circle"}),maxWidth:200,children:n}),l.jsx(_n,{icon:l.jsx(bt,{icon:Is}),title:o,children:wu(o)}),N?.filter(Z=>Z.align!=="right").map(Z=>l.jsx(_n,{icon:typeof Z.icon=="string"?l.jsx(bt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,children:Z.text},Z.key)),l.jsx(oe,{sx:{flex:1}}),N?.filter(Z=>Z.align==="right").map(Z=>l.jsx(_n,{icon:typeof Z.icon=="string"?l.jsx(bt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,sx:{color:Z.color},children:Z.text},Z.key))]})]})}const Eu={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>'},bn=/^[a-z0-9]+(-[a-z0-9]+)*$/,Jn=(e,t,r,i="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;i=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),d=s.pop(),h={provider:s.length>0?s[0]:i,prefix:d,name:a};return t&&!Fn(h)?null:h}const n=s[0],o=n.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!Fn(a)?null:a}if(r&&i===""){const a={provider:i,prefix:"",name:n};return t&&!Fn(a,r)?null:a}return null},Fn=(e,t)=>e?!!((e.provider===""||e.provider.match(bn))&&(t&&e.prefix===""||e.prefix.match(bn))&&e.name.match(bn)):!1,Rs=Object.freeze({left:0,top:0,width:16,height:16}),Wn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ii=Object.freeze({...Rs,...Wn}),$r=Object.freeze({...ii,body:"",hidden:!1});function ku(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function lo(e,t){const r=ku(e,t);for(const i in $r)i in Wn?i in e&&!(i in r)&&(r[i]=Wn[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Tu(e,t){const r=e.icons,i=e.aliases||Object.create(null),s=Object.create(null);function n(o){if(r[o])return s[o]=[];if(!(o in s)){s[o]=null;const a=i[o]&&i[o].parent,d=a&&n(a);d&&(s[o]=[a].concat(d))}return s[o]}return Object.keys(r).concat(Object.keys(i)).forEach(n),s}function ju(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let n={};function o(a){n=lo(i[a]||s[a],n)}return o(t),r.forEach(o),lo(e,n)}function Ps(e,t){const r=[];if(typeof e!="object"||typeof e.icons!="object")return r;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),r.push(s)});const i=Tu(e);for(const s in i){const n=i[s];n&&(t(s,ju(e,s,n)),r.push(s))}return r}const Ou={provider:"",aliases:{},not_found:{},...Rs};function Er(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Ls(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Er(e,Ou))return null;const r=t.icons;for(const s in r){const n=r[s];if(!s.match(bn)||typeof n.body!="string"||!Er(n,$r))return null}const i=t.aliases||Object.create(null);for(const s in i){const n=i[s],o=n.parent;if(!s.match(bn)||typeof o!="string"||!r[o]&&!i[o]||!Er(n,$r))return null}return t}const co=Object.create(null);function Cu(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function en(e,t){const r=co[e]||(co[e]=Object.create(null));return r[t]||(r[t]=Cu(e,t))}function oi(e,t){return Ls(t)?Ps(t,(r,i)=>{i?e.icons[r]=i:e.missing.add(r)}):[]}function Iu(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}let wn=!1;function _s(e){return typeof e=="boolean"&&(wn=e),wn}function Ru(e){const t=typeof e=="string"?Jn(e,!0,wn):e;if(t){const r=en(t.provider,t.prefix),i=t.name;return r.icons[i]||(r.missing.has(i)?null:void 0)}}function Pu(e,t){const r=Jn(e,!0,wn);if(!r)return!1;const i=en(r.provider,r.prefix);return Iu(i,r.name,t)}function Lu(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),wn&&!t&&!e.prefix){let s=!1;return Ls(e)&&(e.prefix="",Ps(e,(n,o)=>{o&&Pu(n,o)&&(s=!0)})),s}const r=e.prefix;if(!Fn({provider:t,prefix:r,name:"a"}))return!1;const i=en(t,r);return!!oi(i,e)}const Ns=Object.freeze({width:null,height:null}),As=Object.freeze({...Ns,...Wn}),_u=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Nu=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function uo(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(_u);if(i===null||!i.length)return e;const s=[];let n=i.shift(),o=Nu.test(n);for(;;){if(o){const a=parseFloat(n);isNaN(a)?s.push(n):s.push(Math.ceil(a*t*r)/r)}else s.push(n);if(n=i.shift(),n===void 0)return s.join("");o=!o}}const Au=e=>e==="unset"||e==="undefined"||e==="none";function Du(e,t){const r={...ii,...e},i={...As,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let n=r.body;[r,i].forEach(E=>{const S=[],C=E.hFlip,_=E.vFlip;let N=E.rotate;C?_?N+=2:(S.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),S.push("scale(-1 1)"),s.top=s.left=0):_&&(S.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),S.push("scale(1 -1)"),s.top=s.left=0);let D;switch(N<0&&(N-=Math.floor(N/4)*4),N=N%4,N){case 1:D=s.height/2+s.top,S.unshift("rotate(90 "+D.toString()+" "+D.toString()+")");break;case 2:S.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:D=s.width/2+s.left,S.unshift("rotate(-90 "+D.toString()+" "+D.toString()+")");break}N%2===1&&(s.left!==s.top&&(D=s.left,s.left=s.top,s.top=D),s.width!==s.height&&(D=s.width,s.width=s.height,s.height=D)),S.length&&(n='<g transform="'+S.join(" ")+'">'+n+"</g>")});const o=i.width,a=i.height,d=s.width,h=s.height;let u,f;o===null?(f=a===null?"1em":a==="auto"?h:a,u=uo(f,d/h)):(u=o==="auto"?d:o,f=a===null?uo(u,h/d):a==="auto"?h:a);const j={},m=(E,S)=>{Au(S)||(j[E]=S.toString())};return m("width",u),m("height",f),j.viewBox=s.left.toString()+" "+s.top.toString()+" "+d.toString()+" "+h.toString(),{attributes:j,body:n}}const Mu=/\sid="(\S+)"/g,Bu="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Fu=0;function $u(e,t=Bu){const r=[];let i;for(;i=Mu.exec(e);)r.push(i[1]);if(!r.length)return e;const s="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(n=>{const o=typeof t=="function"?t(n):t+(Fu++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+s+"$3")}),e=e.replace(new RegExp(s,"g"),""),e}const Ur=Object.create(null);function Uu(e,t){Ur[e]=t}function qr(e){return Ur[e]||Ur[""]}function si(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 ai=Object.create(null),vn=["https://api.simplesvg.com","https://api.unisvg.com"],$n=[];for(;vn.length>0;)vn.length===1||Math.random()>.5?$n.push(vn.shift()):$n.push(vn.pop());ai[""]=si({resources:["https://api.iconify.design"].concat($n)});function qu(e,t){const r=si(t);return r===null?!1:(ai[e]=r,!0)}function li(e){return ai[e]}const Wu=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ho=Wu();function zu(e,t){const r=li(e);if(!r)return 0;let i;if(!r.maxURL)i=0;else{let s=0;r.resources.forEach(o=>{s=Math.max(s,o.length)});const n=t+".json?icons=";i=r.maxURL-s-r.path.length-n.length}return i}function Vu(e){return e===404}const Ku=(e,t,r)=>{const i=[],s=zu(e,t),n="icons";let o={type:n,provider:e,prefix:t,icons:[]},a=0;return r.forEach((d,h)=>{a+=d.length+1,a>=s&&h>0&&(i.push(o),o={type:n,provider:e,prefix:t,icons:[]},a=d.length),o.icons.push(d)}),i.push(o),i};function Gu(e){if(typeof e=="string"){const t=li(e);if(t)return t.path}return"/"}const Hu=(e,t,r)=>{if(!ho){r("abort",424);return}let i=Gu(t.provider);switch(t.type){case"icons":{const n=t.prefix,a=t.icons.join(","),d=new URLSearchParams({icons:a});i+=n+".json?"+d.toString();break}case"custom":{const n=t.uri;i+=n.slice(0,1)==="/"?n.slice(1):n;break}default:r("abort",400);return}let s=503;ho(e+i).then(n=>{const o=n.status;if(o!==200){setTimeout(()=>{r(Vu(o)?"abort":"next",o)});return}return s=501,n.json()}).then(n=>{if(typeof n!="object"||n===null){setTimeout(()=>{n===404?r("abort",n):r("next",s)});return}setTimeout(()=>{r("success",n)})}).catch(()=>{r("next",s)})},Xu={prepare:Ku,send:Hu};function Yu(e){const t={loaded:[],missing:[],pending:[]},r=Object.create(null);e.sort((s,n)=>s.provider!==n.provider?s.provider.localeCompare(n.provider):s.prefix!==n.prefix?s.prefix.localeCompare(n.prefix):s.name.localeCompare(n.name));let i={provider:"",prefix:"",name:""};return e.forEach(s=>{if(i.name===s.name&&i.prefix===s.prefix&&i.provider===s.provider)return;i=s;const n=s.provider,o=s.prefix,a=s.name,d=r[n]||(r[n]=Object.create(null)),h=d[o]||(d[o]=en(n,o));let u;a in h.icons?u=t.loaded:o===""||h.missing.has(a)?u=t.missing:u=t.pending;const f={provider:n,prefix:o,name:a};u.push(f)}),t}function Ds(e,t){e.forEach(r=>{const i=r.loaderCallbacks;i&&(r.loaderCallbacks=i.filter(s=>s.id!==t))})}function Ju(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let r=!1;const i=e.provider,s=e.prefix;t.forEach(n=>{const o=n.icons,a=o.pending.length;o.pending=o.pending.filter(d=>{if(d.prefix!==s)return!0;const h=d.name;if(e.icons[h])o.loaded.push({provider:i,prefix:s,name:h});else if(e.missing.has(h))o.missing.push({provider:i,prefix:s,name:h});else return r=!0,!0;return!1}),o.pending.length!==a&&(r||Ds([e],n.id),n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort))})}))}let Qu=0;function Zu(e,t,r){const i=Qu++,s=Ds.bind(null,r,i);if(!t.pending.length)return s;const n={id:i,icons:t,callback:e,abort:s};return r.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(n)}),s}function ed(e,t=!0,r=!1){const i=[];return e.forEach(s=>{const n=typeof s=="string"?Jn(s,t,r):s;n&&i.push(n)}),i}var td={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function nd(e,t,r,i){const s=e.resources.length,n=e.random?Math.floor(Math.random()*s):e.index;let o;if(e.random){let R=e.resources.slice(0);for(o=[];R.length>1;){const B=Math.floor(Math.random()*R.length);o.push(R[B]),R=R.slice(0,B).concat(R.slice(B+1))}o=o.concat(R)}else o=e.resources.slice(n).concat(e.resources.slice(0,n));const a=Date.now();let d="pending",h=0,u,f=null,j=[],m=[];typeof i=="function"&&m.push(i);function E(){f&&(clearTimeout(f),f=null)}function S(){d==="pending"&&(d="aborted"),E(),j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function C(R,B){B&&(m=[]),typeof R=="function"&&m.push(R)}function _(){return{startTime:a,payload:t,status:d,queriesSent:h,queriesPending:j.length,subscribe:C,abort:S}}function N(){d="failed",m.forEach(R=>{R(void 0,u)})}function D(){j.forEach(R=>{R.status==="pending"&&(R.status="aborted")}),j=[]}function c(R,B,M){const re=B!=="success";switch(j=j.filter(Z=>Z!==R),d){case"pending":break;case"failed":if(re||!e.dataAfterTimeout)return;break;default:return}if(B==="abort"){u=M,N();return}if(re){u=M,j.length||(o.length?w():N());return}if(E(),D(),!e.random){const Z=e.resources.indexOf(R.resource);Z!==-1&&Z!==e.index&&(e.index=Z)}d="completed",m.forEach(Z=>{Z(M)})}function w(){if(d!=="pending")return;E();const R=o.shift();if(R===void 0){if(j.length){f=setTimeout(()=>{E(),d==="pending"&&(D(),N())},e.timeout);return}N();return}const B={status:"pending",resource:R,callback:(M,re)=>{c(B,M,re)}};j.push(B),h++,f=setTimeout(w,e.rotate),r(R,t,B.callback)}return setTimeout(w),_}function Ms(e){const t={...td,...e};let r=[];function i(){r=r.filter(a=>a().status==="pending")}function s(a,d,h){const u=nd(t,a,d,(f,j)=>{i(),h&&h(f,j)});return r.push(u),u}function n(a){return r.find(d=>a(d))||null}return{query:s,find:n,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function fo(){}const kr=Object.create(null);function rd(e){if(!kr[e]){const t=li(e);if(!t)return;const r=Ms(t),i={config:t,redundancy:r};kr[e]=i}return kr[e]}function id(e,t,r){let i,s;if(typeof e=="string"){const n=qr(e);if(!n)return r(void 0,424),fo;s=n.send;const o=rd(e);o&&(i=o.redundancy)}else{const n=si(e);if(n){i=Ms(n);const o=e.resources?e.resources[0]:"",a=qr(o);a&&(s=a.send)}}return!i||!s?(r(void 0,424),fo):i.query(t,s,r)().abort}const po="iconify2",Sn="iconify",Bs=Sn+"-count",mo=Sn+"-version",Fs=36e5,od=168;function Wr(e,t){try{return e.getItem(t)}catch{}}function ci(e,t,r){try{return e.setItem(t,r),!0}catch{}}function go(e,t){try{e.removeItem(t)}catch{}}function zr(e,t){return ci(e,Bs,t.toString())}function Vr(e){return parseInt(Wr(e,Bs))||0}const Qn={local:!0,session:!0},$s={local:new Set,session:new Set};let ui=!1;function sd(e){ui=e}let Nn=typeof window>"u"?{}:window;function Us(e){const t=e+"Storage";try{if(Nn&&Nn[t]&&typeof Nn[t].length=="number")return Nn[t]}catch{}Qn[e]=!1}function qs(e,t){const r=Us(e);if(!r)return;const i=Wr(r,mo);if(i!==po){if(i){const a=Vr(r);for(let d=0;d<a;d++)go(r,Sn+d.toString())}ci(r,mo,po),zr(r,0);return}const s=Math.floor(Date.now()/Fs)-od,n=a=>{const d=Sn+a.toString(),h=Wr(r,d);if(typeof h=="string"){try{const u=JSON.parse(h);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>s&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}go(r,d)}};let o=Vr(r);for(let a=o-1;a>=0;a--)n(a)||(a===o-1?(o--,zr(r,o)):$s[e].add(a))}function Ws(){if(!ui){sd(!0);for(const e in Qn)qs(e,t=>{const r=t.data,i=t.provider,s=r.prefix,n=en(i,s);if(!oi(n,r).length)return!1;const o=r.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,o):o,!0})}}function ad(e,t){const r=e.lastModifiedCached;if(r&&r>=t)return r===t;if(e.lastModifiedCached=t,r)for(const i in Qn)qs(i,s=>{const n=s.data;return s.provider!==e.provider||n.prefix!==e.prefix||n.lastModified===t});return!0}function ld(e,t){ui||Ws();function r(i){let s;if(!Qn[i]||!(s=Us(i)))return;const n=$s[i];let o;if(n.size)n.delete(o=Array.from(n).shift());else if(o=Vr(s),!zr(s,o+1))return;const a={cached:Math.floor(Date.now()/Fs),provider:e.provider,data:t};return ci(s,Sn+o.toString(),JSON.stringify(a))}t.lastModified&&!ad(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),r("local")||r("session"))}function vo(){}function cd(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Ju(e)}))}function ud(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:r,prefix:i}=e,s=e.iconsToLoad;delete e.iconsToLoad;let n;if(!s||!(n=qr(r)))return;n.prepare(r,i,s).forEach(a=>{id(r,a,d=>{if(typeof d!="object")a.icons.forEach(h=>{e.missing.add(h)});else try{const h=oi(e,d);if(!h.length)return;const u=e.pendingIcons;u&&h.forEach(f=>{u.delete(f)}),ld(e,d)}catch(h){console.error(h)}cd(e)})})}))}const dd=(e,t)=>{const r=ed(e,!0,_s()),i=Yu(r);if(!i.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(i.loaded,i.missing,i.pending,vo)}),()=>{d=!1}}const s=Object.create(null),n=[];let o,a;return i.pending.forEach(d=>{const{provider:h,prefix:u}=d;if(u===a&&h===o)return;o=h,a=u,n.push(en(h,u));const f=s[h]||(s[h]=Object.create(null));f[u]||(f[u]=[])}),i.pending.forEach(d=>{const{provider:h,prefix:u,name:f}=d,j=en(h,u),m=j.pendingIcons||(j.pendingIcons=new Set);m.has(f)||(m.add(f),s[h][u].push(f))}),n.forEach(d=>{const{provider:h,prefix:u}=d;s[h][u].length&&ud(d,s[h][u])}),t?Zu(t,i,n):vo};function hd(e,t){const r={...e};for(const i in t){const s=t[i],n=typeof s;i in Ns?(s===null||s&&(n==="string"||n==="number"))&&(r[i]=s):n===typeof r[i]&&(r[i]=i==="rotate"?s%4:s)}return r}const fd=/[\s,]+/;function pd(e,t){t.split(fd).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function md(e,t=0){const r=e.replace(/^-?[0-9.]*/,"");function i(s){for(;s<0;)s+=4;return s%4}if(r===""){const s=parseInt(e);return isNaN(s)?0:i(s)}else if(r!==e){let s=0;switch(r){case"%":s=25;break;case"deg":s=90}if(s){let n=parseFloat(e.slice(0,e.length-r.length));return isNaN(n)?0:(n=n/s,n%1===0?i(n):0)}}return t}function gd(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}function vd(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function yd(e){return"data:image/svg+xml,"+vd(e)}function bd(e){return'url("'+yd(e)+'")'}let xn;function xd(){try{xn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{xn=null}}function wd(e){return xn===void 0&&xd(),xn?xn.createHTML(e):e}const zs={...As,inline:!1},Sd={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ed={display:"inline-block"},Kr={backgroundColor:"currentColor"},Vs={backgroundColor:"transparent"},yo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},bo={WebkitMask:Kr,mask:Kr,background:Vs};for(const e in bo){const t=bo[e];for(const r in yo)t[e+r]=yo[r]}const kd={...zs,inline:!0};function xo(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Td=(e,t,r,i)=>{const s=r?kd:zs,n=hd(s,t),o=t.mode||"svg",a={},d=t.style||{},h={...o==="svg"?Sd:{},ref:i};for(let _ in t){const N=t[_];if(N!==void 0)switch(_){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":n[_]=N===!0||N==="true"||N===1;break;case"flip":typeof N=="string"&&pd(n,N);break;case"color":a.color=N;break;case"rotate":typeof N=="string"?n[_]=md(N):typeof N=="number"&&(n[_]=N);break;case"ariaHidden":case"aria-hidden":N!==!0&&N!=="true"&&delete h["aria-hidden"];break;default:s[_]===void 0&&(h[_]=N)}}const u=Du(e,n),f=u.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){h.style={...a,...d},Object.assign(h,f);let _=0,N=t.id;return typeof N=="string"&&(N=N.replace(/-/g,"_")),h.dangerouslySetInnerHTML={__html:wd($u(u.body,N?()=>N+"ID"+_++:"iconifyReact"))},Ut.createElement("svg",h)}const{body:j,width:m,height:E}=e,S=o==="mask"||(o==="bg"?!1:j.indexOf("currentColor")!==-1),C=gd(j,{...f,width:m+"",height:E+""});return h.style={...a,"--svg":bd(C),width:xo(f.width),height:xo(f.height),...Ed,...S?Kr:Vs,...d},Ut.createElement("span",h)};_s(!0);Uu("",Xu);if(typeof document<"u"&&typeof window<"u"){Ws();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!Lu(i))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let r in t){const i="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;qu(r,s)||console.error(i)}catch{console.error(i)}}}}class Ks extends Ut.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 r=this.state,i=this.props.icon;if(typeof i=="object"&&i!==null&&typeof i.body=="string"){this._icon="",this._abortLoading(),(t||r.icon===null)&&this._setData({data:i});return}let s;if(typeof i!="string"||(s=Jn(i,!1,!0))===null){this._abortLoading(),this._setData(null);return}const n=Ru(s);if(!n){(!this._loading||this._loading.name!==i)&&(this._abortLoading(),this._icon="",this._setData(null),n!==null&&(this._loading={name:i,abort:dd([s],this._checkIcon.bind(this,!1))}));return}if(this._icon!==i||r.icon===null){this._abortLoading(),this._icon=i;const o=["iconify"];s.prefix!==""&&o.push("iconify--"+s.prefix),s.provider!==""&&o.push("iconify--"+s.provider),this._setData({data:n,classes:o}),this.props.onLoad&&this.props.onLoad(i)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,r=this.state.icon;if(r===null)return t.children?t.children:Ut.createElement("span",{});let i=t;return r.classes&&(i={...t,className:(typeof t.className=="string"?t.className+" ":"")+r.classes.join(" ")}),Td({...ii,...r.data},i,t._inline,t._ref)}}const Ft=Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!1};return Ut.createElement(Ks,i)});Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!0};return Ut.createElement(Ks,i)});var Un={exports:{}},jd=Un.exports,wo;function Od(){return wo||(wo=1,function(e,t){(function(r,i){e.exports=i(Ya())})(jd,r=>(()=>{var i={703:(a,d,h)=>{var u=h(414);function f(){}function j(){}j.resetWarningCache=f,a.exports=function(){function m(C,_,N,D,c,w){if(w!==u){var R=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 R.name="Invariant Violation",R}}function E(){return m}m.isRequired=m;var S={array:m,bool:m,func:m,number:m,object:m,string:m,symbol:m,any:m,arrayOf:E,element:m,elementType:m,instanceOf:E,node:m,objectOf:E,oneOf:E,oneOfType:E,shape:E,exact:E,checkPropTypes:j,resetWarningCache:f};return S.PropTypes=S,S}},697:(a,d,h)=>{a.exports=h(703)()},414:a=>{a.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:a=>{var d=typeof Element<"u",h=typeof Map=="function",u=typeof Set=="function",f=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function j(m,E){if(m===E)return!0;if(m&&E&&typeof m=="object"&&typeof E=="object"){if(m.constructor!==E.constructor)return!1;var S,C,_,N;if(Array.isArray(m)){if((S=m.length)!=E.length)return!1;for(C=S;C--!=0;)if(!j(m[C],E[C]))return!1;return!0}if(h&&m instanceof Map&&E instanceof Map){if(m.size!==E.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!E.has(C.value[0]))return!1;for(N=m.entries();!(C=N.next()).done;)if(!j(C.value[1],E.get(C.value[0])))return!1;return!0}if(u&&m instanceof Set&&E instanceof Set){if(m.size!==E.size)return!1;for(N=m.entries();!(C=N.next()).done;)if(!E.has(C.value[0]))return!1;return!0}if(f&&ArrayBuffer.isView(m)&&ArrayBuffer.isView(E)){if((S=m.length)!=E.length)return!1;for(C=S;C--!=0;)if(m[C]!==E[C])return!1;return!0}if(m.constructor===RegExp)return m.source===E.source&&m.flags===E.flags;if(m.valueOf!==Object.prototype.valueOf)return m.valueOf()===E.valueOf();if(m.toString!==Object.prototype.toString)return m.toString()===E.toString();if((S=(_=Object.keys(m)).length)!==Object.keys(E).length)return!1;for(C=S;C--!=0;)if(!Object.prototype.hasOwnProperty.call(E,_[C]))return!1;if(d&&m instanceof Element)return!1;for(C=S;C--!=0;)if((_[C]!=="_owner"&&_[C]!=="__v"&&_[C]!=="__o"||!m.$$typeof)&&!j(m[_[C]],E[_[C]]))return!1;return!0}return m!=m&&E!=E}a.exports=function(m,E){try{return j(m,E)}catch(S){if((S.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw S}}},359:a=>{a.exports=r}},s={};function n(a){var d=s[a];if(d!==void 0)return d.exports;var h=s[a]={exports:{}};return i[a](h,h.exports,n),h.exports}n.n=a=>{var d=a&&a.__esModule?()=>a.default:()=>a;return n.d(d,{a:d}),d},n.d=(a,d)=>{for(var h in d)n.o(d,h)&&!n.o(a,h)&&Object.defineProperty(a,h,{enumerable:!0,get:d[h]})},n.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),n.o=(a,d)=>Object.prototype.hasOwnProperty.call(a,d),n.r=a=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})};var o={};return(()=>{function a(b){var g,T,I="";if(typeof b=="string"||typeof b=="number")I+=b;else if(typeof b=="object")if(Array.isArray(b))for(g=0;g<b.length;g++)b[g]&&(T=a(b[g]))&&(I&&(I+=" "),I+=T);else for(g in b)b[g]&&(I&&(I+=" "),I+=g);return I}function d(){for(var b,g,T=0,I="";T<arguments.length;)(b=arguments[T++])&&(g=a(b))&&(I&&(I+=" "),I+=g);return I}n.r(o),n.d(o,{default:()=>ga});var h=n(359),u=n.n(h);const f=function(b){var g=typeof b;return b!=null&&(g=="object"||g=="function")},j=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn;var m=typeof self=="object"&&self&&self.Object===Object&&self;const E=j||m||Function("return this")(),S=function(){return E.Date.now()};var C=/\s/,_=/^\s+/;const N=function(b){return b&&b.slice(0,function(g){for(var T=g.length;T--&&C.test(g.charAt(T)););return T}(b)+1).replace(_,"")},D=E.Symbol;var c=Object.prototype,w=c.hasOwnProperty,R=c.toString,B=D?D.toStringTag:void 0,M=Object.prototype.toString,re=D?D.toStringTag:void 0;const Z=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":re&&re in Object(b)?function(g){var T=w.call(g,B),I=g[B];try{g[B]=void 0;var J=!0}catch{}var fe=R.call(g);return J&&(T?g[B]=I:delete g[B]),fe}(b):function(g){return M.call(g)}(b)};var z=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,H=/^0o[0-7]+$/i,A=parseInt;const X=function(b){if(typeof b=="number")return b;if(function(I){return typeof I=="symbol"||function(J){return J!=null&&typeof J=="object"}(I)&&Z(I)=="[object Symbol]"}(b))return NaN;if(f(b)){var g=typeof b.valueOf=="function"?b.valueOf():b;b=f(g)?g+"":g}if(typeof b!="string")return b===0?b:+b;b=N(b);var T=W.test(b);return T||H.test(b)?A(b.slice(2),T?2:8):z.test(b)?NaN:+b};var $=Math.max,he=Math.min;const Oe=function(b,g,T){var I,J,fe,Te,y,v,P=0,G=!1,Q=!1,Y=!0;if(typeof b!="function")throw new TypeError("Expected a function");function xe(pe){var ke=I,Ae=J;return I=J=void 0,P=pe,Te=b.apply(Ae,ke)}function ge(pe){return P=pe,y=setTimeout(se,g),G?xe(pe):Te}function Ee(pe){var ke=pe-v;return v===void 0||ke>=g||ke<0||Q&&pe-P>=fe}function se(){var pe=S();if(Ee(pe))return ce(pe);y=setTimeout(se,function(ke){var Ae=g-(ke-v);return Q?he(Ae,fe-(ke-P)):Ae}(pe))}function ce(pe){return y=void 0,Y&&I?xe(pe):(I=J=void 0,Te)}function ue(){var pe=S(),ke=Ee(pe);if(I=arguments,J=this,v=pe,ke){if(y===void 0)return ge(v);if(Q)return clearTimeout(y),y=setTimeout(se,g),xe(v)}return y===void 0&&(y=setTimeout(se,g)),Te}return g=X(g)||0,f(T)&&(G=!!T.leading,fe=(Q="maxWait"in T)?$(X(T.maxWait)||0,g):fe,Y="trailing"in T?!!T.trailing:Y),ue.cancel=function(){y!==void 0&&clearTimeout(y),P=0,I=v=J=y=void 0},ue.flush=function(){return y===void 0?Te:ce(S())},ue},K=function(b,g,T){var I=!0,J=!0;if(typeof b!="function")throw new TypeError("Expected a function");return f(T)&&(I="leading"in T?!!T.leading:I,J="trailing"in T?!!T.trailing:J),Oe(b,g,{leading:I,maxWait:g,trailing:J})};var we=n(590),de=n.n(we),Le=function(){if(typeof Map<"u")return Map;function b(g,T){var I=-1;return g.some(function(J,fe){return J[0]===T&&(I=fe,!0)}),I}return function(){function g(){this.__entries__=[]}return Object.defineProperty(g.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),g.prototype.get=function(T){var I=b(this.__entries__,T),J=this.__entries__[I];return J&&J[1]},g.prototype.set=function(T,I){var J=b(this.__entries__,T);~J?this.__entries__[J][1]=I:this.__entries__.push([T,I])},g.prototype.delete=function(T){var I=this.__entries__,J=b(I,T);~J&&I.splice(J,1)},g.prototype.has=function(T){return!!~b(this.__entries__,T)},g.prototype.clear=function(){this.__entries__.splice(0)},g.prototype.forEach=function(T,I){I===void 0&&(I=null);for(var J=0,fe=this.__entries__;J<fe.length;J++){var Te=fe[J];T.call(I,Te[1],Te[0])}},g}()}(),ve=typeof window<"u"&&typeof document<"u"&&window.document===document,_e=n.g!==void 0&&n.g.Math===Math?n.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Pe=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(_e):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},He=["top","right","bottom","left","width","height","size","weight"],et=typeof MutationObserver<"u",ht=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(g,T){var I=!1,J=!1,fe=0;function Te(){I&&(I=!1,g()),J&&v()}function y(){Pe(Te)}function v(){var P=Date.now();if(I){if(P-fe<2)return;J=!0}else I=!0,J=!1,setTimeout(y,20);fe=P}return v}(this.refresh.bind(this))}return b.prototype.addObserver=function(g){~this.observers_.indexOf(g)||this.observers_.push(g),this.connected_||this.connect_()},b.prototype.removeObserver=function(g){var T=this.observers_,I=T.indexOf(g);~I&&T.splice(I,1),!T.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var g=this.observers_.filter(function(T){return T.gatherActive(),T.hasActive()});return g.forEach(function(T){return T.broadcastActive()}),g.length>0},b.prototype.connect_=function(){ve&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),et?(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(){ve&&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(g){var T=g.propertyName,I=T===void 0?"":T;He.some(function(J){return!!~I.indexOf(J)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Ze=function(b,g){for(var T=0,I=Object.keys(g);T<I.length;T++){var J=I[T];Object.defineProperty(b,J,{value:g[J],enumerable:!1,writable:!1,configurable:!0})}return b},te=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||_e},Ne=Me(0,0,0,0);function ye(b){return parseFloat(b)||0}function Be(b){for(var g=[],T=1;T<arguments.length;T++)g[T-1]=arguments[T];return g.reduce(function(I,J){return I+ye(b["border-"+J+"-width"])},0)}var jt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof te(b).SVGGraphicsElement}:function(b){return b instanceof te(b).SVGElement&&typeof b.getBBox=="function"};function Ot(b){return ve?jt(b)?function(g){var T=g.getBBox();return Me(0,0,T.width,T.height)}(b):function(g){var T=g.clientWidth,I=g.clientHeight;if(!T&&!I)return Ne;var J=te(g).getComputedStyle(g),fe=function(Y){for(var xe={},ge=0,Ee=["top","right","bottom","left"];ge<Ee.length;ge++){var se=Ee[ge],ce=Y["padding-"+se];xe[se]=ye(ce)}return xe}(J),Te=fe.left+fe.right,y=fe.top+fe.bottom,v=ye(J.width),P=ye(J.height);if(J.boxSizing==="border-box"&&(Math.round(v+Te)!==T&&(v-=Be(J,"left","right")+Te),Math.round(P+y)!==I&&(P-=Be(J,"top","bottom")+y)),!function(Y){return Y===te(Y).document.documentElement}(g)){var G=Math.round(v+Te)-T,Q=Math.round(P+y)-I;Math.abs(G)!==1&&(v-=G),Math.abs(Q)!==1&&(P-=Q)}return Me(fe.left,fe.top,v,P)}(b):Ne}function Me(b,g,T,I){return{x:b,y:g,width:T,height:I}}var Ct=function(){function b(g){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Me(0,0,0,0),this.target=g}return b.prototype.isActive=function(){var g=Ot(this.target);return this.contentRect_=g,g.width!==this.broadcastWidth||g.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var g=this.contentRect_;return this.broadcastWidth=g.width,this.broadcastHeight=g.height,g},b}(),Et=function(b,g){var T,I,J,fe,Te,y,v,P=(I=(T=g).x,J=T.y,fe=T.width,Te=T.height,y=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,v=Object.create(y.prototype),Ze(v,{x:I,y:J,width:fe,height:Te,top:J,right:I+fe,bottom:Te+J,left:I}),v);Ze(this,{target:b,contentRect:P})},_t=function(){function b(g,T,I){if(this.activeObservations_=[],this.observations_=new Le,typeof g!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=g,this.controller_=T,this.callbackCtx_=I}return b.prototype.observe=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof te(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)||(T.set(g,new Ct(g)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(g){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(g instanceof te(g).Element))throw new TypeError('parameter 1 is not of type "Element".');var T=this.observations_;T.has(g)&&(T.delete(g),T.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var g=this;this.clearActive(),this.observations_.forEach(function(T){T.isActive()&&g.activeObservations_.push(T)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var g=this.callbackCtx_,T=this.activeObservations_.map(function(I){return new Et(I.target,I.broadcastRect())});this.callback_.call(g,T,g),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),Ye=typeof WeakMap<"u"?new WeakMap:new Le,It=function b(g){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 T=ht.getInstance(),I=new _t(g,T,this);Ye.set(this,I)};["observe","unobserve","disconnect"].forEach(function(b){It.prototype[b]=function(){var g;return(g=Ye.get(this))[b].apply(g,arguments)}});const Nt=_e.ResizeObserver!==void 0?_e.ResizeObserver:It,at="Left",qe="Right",tt="Up",ot="Down",mt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},V={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},ae="mousemove",me="mouseup";function Ce(b,g){if(g===0)return b;const T=Math.PI/180*g;return[b[0]*Math.cos(T)+b[1]*Math.sin(T),b[1]*Math.cos(T)-b[0]*Math.sin(T)]}function ee(b){const{trackMouse:g}=b,T=h.useRef(Object.assign({},V)),I=h.useRef(Object.assign({},mt)),J=h.useRef(Object.assign({},I.current));let fe;for(fe in J.current=Object.assign({},I.current),I.current=Object.assign(Object.assign({},mt),b),mt)I.current[fe]===void 0&&(I.current[fe]=mt[fe]);const[Te,y]=h.useMemo(()=>function(v,P){const G=se=>{const ce="touches"in se;ce&&se.touches.length>1||v((ue,pe)=>{pe.trackMouse&&!ce&&(document.addEventListener(ae,Q),document.addEventListener(me,xe));const{clientX:ke,clientY:Ae}=ce?se.touches[0]:se,Ge=Ce([ke,Ae],pe.rotationAngle);return pe.onTouchStartOrOnMouseDown&&pe.onTouchStartOrOnMouseDown({event:se}),Object.assign(Object.assign(Object.assign({},ue),V),{initial:Ge.slice(),xy:Ge,start:se.timeStamp||0})})},Q=se=>{v((ce,ue)=>{const pe="touches"in se;if(pe&&se.touches.length>1)return ce;if(se.timeStamp-ce.start>ue.swipeDuration)return ce.swiping?Object.assign(Object.assign({},ce),{swiping:!1}):ce;const{clientX:ke,clientY:Ae}=pe?se.touches[0]:se,[Ge,ft]=Ce([ke,Ae],ue.rotationAngle),ct=Ge-ce.xy[0],nt=ft-ce.xy[1],Ke=Math.abs(ct),De=Math.abs(nt),zt=(se.timeStamp||0)-ce.start,hn=Math.sqrt(Ke*Ke+De*De)/(zt||1),fn=[ct/(zt||1),nt/(zt||1)],Mt=function(pn,an,mn,gt){return pn>an?mn>0?qe:at:gt>0?ot:tt}(Ke,De,ct,nt),Jt=typeof ue.delta=="number"?ue.delta:ue.delta[Mt.toLowerCase()]||mt.delta;if(Ke<Jt&&De<Jt&&!ce.swiping)return ce;const Rt={absX:Ke,absY:De,deltaX:ct,deltaY:nt,dir:Mt,event:se,first:ce.first,initial:ce.initial,velocity:hn,vxvy:fn};Rt.first&&ue.onSwipeStart&&ue.onSwipeStart(Rt),ue.onSwiping&&ue.onSwiping(Rt);let sn=!1;return(ue.onSwiping||ue.onSwiped||ue[`onSwiped${Mt}`])&&(sn=!0),sn&&ue.preventScrollOnSwipe&&ue.trackTouch&&se.cancelable&&se.preventDefault(),Object.assign(Object.assign({},ce),{first:!1,eventData:Rt,swiping:!0})})},Y=se=>{v((ce,ue)=>{let pe;if(ce.swiping&&ce.eventData){if(se.timeStamp-ce.start<ue.swipeDuration){pe=Object.assign(Object.assign({},ce.eventData),{event:se}),ue.onSwiped&&ue.onSwiped(pe);const ke=ue[`onSwiped${pe.dir}`];ke&&ke(pe)}}else ue.onTap&&ue.onTap({event:se});return ue.onTouchEndOrOnMouseUp&&ue.onTouchEndOrOnMouseUp({event:se}),Object.assign(Object.assign(Object.assign({},ce),V),{eventData:pe})})},xe=se=>{document.removeEventListener(ae,Q),document.removeEventListener(me,xe),Y(se)},ge=(se,ce)=>{let ue=()=>{};if(se&&se.addEventListener){const pe=Object.assign(Object.assign({},mt.touchEventOptions),ce.touchEventOptions),ke=[["touchstart",G,pe],["touchmove",Q,Object.assign(Object.assign({},pe),ce.preventScrollOnSwipe?{passive:!1}:{})],["touchend",Y,pe]];ke.forEach(([Ae,Ge,ft])=>se.addEventListener(Ae,Ge,ft)),ue=()=>ke.forEach(([Ae,Ge])=>se.removeEventListener(Ae,Ge))}return ue},Ee={ref:se=>{se!==null&&v((ce,ue)=>{if(ce.el===se)return ce;const pe={};return ce.el&&ce.el!==se&&ce.cleanUpTouch&&(ce.cleanUpTouch(),pe.cleanUpTouch=void 0),ue.trackTouch&&se&&(pe.cleanUpTouch=ge(se,ue)),Object.assign(Object.assign(Object.assign({},ce),{el:se}),pe)})}};return P.trackMouse&&(Ee.onMouseDown=G),[Ee,ge]}(v=>T.current=v(T.current,I.current),{trackMouse:g}),[g]);return T.current=function(v,P,G,Q){return P.trackTouch&&v.el?v.cleanUpTouch?P.preventScrollOnSwipe!==G.preventScrollOnSwipe||P.touchEventOptions.passive!==G.touchEventOptions.passive?(v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,P)})):v:Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,P)}):(v.cleanUpTouch&&v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:void 0}))}(T.current,I.current,J.current,y),Te}var O=n(697);function Ie(b){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},Ie(b)}function Re(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function Fe(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?Re(Object(T),!0).forEach(function(I){p(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):Re(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function p(b,g,T){return(g=function(I){var J=function(fe,Te){if(Ie(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Te);if(Ie(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return Ie(J)==="symbol"?J:String(J)}(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},k=u().memo(function(b){var g=Fe(Fe({},x),b),T=g.description,I=g.fullscreen,J=g.handleImageLoaded,fe=g.isFullscreen,Te=g.onImageError,y=g.original,v=g.originalAlt,P=g.originalHeight,G=g.originalWidth,Q=g.originalTitle,Y=g.sizes,xe=g.srcSet,ge=g.loading,Ee=fe&&I||y;return u().createElement(u().Fragment,null,u().createElement("img",{className:"image-gallery-image",src:Ee,alt:v,srcSet:xe,height:P,width:G,sizes:Y,title:Q,onLoad:function(se){return J(se,y)},onError:Te,loading:ge}),T&&u().createElement("span",{className:"image-gallery-description"},T))});k.displayName="Item",k.propTypes={description:O.string,fullscreen:O.string,handleImageLoaded:O.func.isRequired,isFullscreen:O.bool,onImageError:O.func.isRequired,original:O.string.isRequired,originalAlt:O.string,originalHeight:O.string,originalWidth:O.string,originalTitle:O.string,sizes:O.string,srcSet:O.string,loading:O.string};const L=k;function U(b){return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},U(b)}function ne(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function le(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ne(Object(T),!0).forEach(function(I){Se(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):ne(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function Se(b,g,T){return(g=function(I){var J=function(fe,Te){if(U(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Te);if(U(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return U(J)==="symbol"?J:String(J)}(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}var be={left:u().createElement("polyline",{points:"15 18 9 12 15 6"}),right:u().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:u().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:u().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:u().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:u().createElement(u().Fragment,null,u().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),u().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},$e={strokeWidth:1,viewBox:"0 0 24 24"},ze=function(b){var g=le(le({},$e),b),T=g.strokeWidth,I=g.viewBox,J=g.icon;return u().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:I,fill:"none",stroke:"currentColor",strokeWidth:T,strokeLinecap:"round",strokeLinejoin:"round"},be[J])};ze.propTypes={strokeWidth:O.number,viewBox:O.string,icon:(0,O.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ue=ze;var Ve=u().memo(function(b){var g=b.isFullscreen,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:T,"aria-label":"Open Fullscreen"},u().createElement(Ue,{strokeWidth:2,icon:g?"minimize":"maximize"}))});Ve.displayName="Fullscreen",Ve.propTypes={isFullscreen:O.bool.isRequired,onClick:O.func.isRequired};const lt=Ve;var cn=u().memo(function(b){var g=b.disabled,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:g,onClick:T,"aria-label":"Previous Slide"},u().createElement(Ue,{icon:"left",viewBox:"6 0 12 24"}))});cn.displayName="LeftNav",cn.propTypes={disabled:O.bool.isRequired,onClick:O.func.isRequired};const er=cn;var st=u().memo(function(b){var g=b.disabled,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:g,onClick:T,"aria-label":"Next Slide"},u().createElement(Ue,{icon:"right",viewBox:"6 0 12 24"}))});st.displayName="RightNav",st.propTypes={disabled:O.bool.isRequired,onClick:O.func.isRequired};const un=st;var Wt=u().memo(function(b){var g=b.isPlaying,T=b.onClick;return u().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:T,"aria-label":"Play or Pause Slideshow"},u().createElement(Ue,{strokeWidth:2,icon:g?"pause":"play"}))});Wt.displayName="PlayPause",Wt.propTypes={isPlaying:O.bool.isRequired,onClick:O.func.isRequired};const tn=Wt;function At(b){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},At(b)}function Yt(){return Yt=Object.assign?Object.assign.bind():function(b){for(var g=1;g<arguments.length;g++){var T=arguments[g];for(var I in T)Object.prototype.hasOwnProperty.call(T,I)&&(b[I]=T[I])}return b},Yt.apply(this,arguments)}function dn(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function Dt(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?dn(Object(T),!0).forEach(function(I){nn(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):dn(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function nn(b,g,T){return(g=function(I){var J=function(fe,Te){if(At(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Te);if(At(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(I,"string");return At(J)==="symbol"?J:String(J)}(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}var rn={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},jn=function(b){var g=Dt(Dt({},rn),b),T=g.children,I=g.className,J=ee({delta:g.delta,onSwiping:g.onSwiping,onSwiped:g.onSwiped});return u().createElement("div",Yt({},J,{className:I}),T)};jn.propTypes={children:O.node.isRequired,className:O.string,delta:O.number,onSwiped:O.func,onSwiping:O.func};const mi=jn;function on(b){return on=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g},on(b)}function gi(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(b);g&&(I=I.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,I)}return T}function vi(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?gi(Object(T),!0).forEach(function(I){yi(b,I,T[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):gi(Object(T)).forEach(function(I){Object.defineProperty(b,I,Object.getOwnPropertyDescriptor(T,I))})}return b}function fa(b,g){for(var T=0;T<g.length;T++){var I=g[T];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(b,bi(I.key),I)}}function tr(b,g){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,I){return T.__proto__=I,T},tr(b,g)}function pa(b,g){if(g&&(on(g)==="object"||typeof g=="function"))return g;if(g!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xe(b)}function Xe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function On(b){return On=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)},On(b)}function yi(b,g,T){return(g=bi(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}function bi(b){var g=function(T,I){if(on(T)!=="object"||T===null)return T;var J=T[Symbol.toPrimitive];if(J!==void 0){var fe=J.call(T,I);if(on(fe)!=="object")return fe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}(b,"string");return on(g)==="symbol"?g:String(g)}var xi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],ma=(0,O.arrayOf)((0,O.shape)({srcSet:O.string,media:O.string}));function wi(b){var g=parseInt(b.keyCode||b.which||0,10);return g===66||g===62}var nr=function(b){(function(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),v&&tr(y,v)})(Te,b);var g,T,I,J,fe=(I=Te,J=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 y,v=On(I);if(J){var P=On(this).constructor;y=Reflect.construct(v,arguments,P)}else y=v.apply(this,arguments);return pa(this,y)});function Te(y){var v;return function(P,G){if(!(P instanceof G))throw new TypeError("Cannot call a class as a function")}(this,Te),yi(Xe(v=fe.call(this,y)),"onBulletClick",function(P,G){var Q=v.props,Y=Q.onBulletClick,xe=Q.items,ge=v.state.currentIndex;P.target.blur(),ge!==G&&(xe.length===2?v.slideToIndexWithStyleReset(G,P):v.slideToIndex(G,P)),Y&&Y(P,G)}),v.state={currentIndex:y.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(y.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},v.loadedImages={},v.imageGallery=u().createRef(),v.thumbnailsWrapper=u().createRef(),v.thumbnails=u().createRef(),v.imageGallerySlideWrapper=u().createRef(),v.handleImageLoaded=v.handleImageLoaded.bind(Xe(v)),v.handleKeyDown=v.handleKeyDown.bind(Xe(v)),v.handleMouseDown=v.handleMouseDown.bind(Xe(v)),v.handleResize=v.handleResize.bind(Xe(v)),v.handleTouchMove=v.handleTouchMove.bind(Xe(v)),v.handleOnSwiped=v.handleOnSwiped.bind(Xe(v)),v.handleScreenChange=v.handleScreenChange.bind(Xe(v)),v.handleSwiping=v.handleSwiping.bind(Xe(v)),v.handleThumbnailSwiping=v.handleThumbnailSwiping.bind(Xe(v)),v.handleOnThumbnailSwiped=v.handleOnThumbnailSwiped.bind(Xe(v)),v.onThumbnailMouseLeave=v.onThumbnailMouseLeave.bind(Xe(v)),v.handleImageError=v.handleImageError.bind(Xe(v)),v.pauseOrPlay=v.pauseOrPlay.bind(Xe(v)),v.renderThumbInner=v.renderThumbInner.bind(Xe(v)),v.renderItem=v.renderItem.bind(Xe(v)),v.slideLeft=v.slideLeft.bind(Xe(v)),v.slideRight=v.slideRight.bind(Xe(v)),v.toggleFullScreen=v.toggleFullScreen.bind(Xe(v)),v.togglePlay=v.togglePlay.bind(Xe(v)),v.unthrottledSlideToIndex=v.slideToIndex,v.slideToIndex=K(v.unthrottledSlideToIndex,y.slideDuration,{trailing:!1}),y.lazyLoad&&(v.lazyLoaded=[]),v}return g=Te,T=[{key:"componentDidMount",value:function(){var y=this.props,v=y.autoPlay,P=y.useWindowKeyDown;v&&this.play(),P?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(y,v){var P=this.props,G=P.items,Q=P.lazyLoad,Y=P.slideDuration,xe=P.slideInterval,ge=P.startIndex,Ee=P.thumbnailPosition,se=P.showThumbnails,ce=P.useWindowKeyDown,ue=this.state,pe=ue.currentIndex,ke=ue.isPlaying,Ae=y.items.length!==G.length,Ge=!de()(y.items,G),ft=y.startIndex!==ge,ct=y.thumbnailPosition!==Ee,nt=y.showThumbnails!==se;xe===y.slideInterval&&Y===y.slideDuration||ke&&(this.pause(),this.play()),ct&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),nt&&se&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),nt&&!se&&this.removeThumbnailsResizeObserver(),(Ae||nt)&&this.handleResize(),v.currentIndex!==pe&&this.slideThumbnailBar(),y.slideDuration!==Y&&(this.slideToIndex=K(this.unthrottledSlideToIndex,Y,{trailing:!1})),!Q||y.lazyLoad&&!Ge||(this.lazyLoaded=[]),ce!==y.useWindowKeyDown&&(ce?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ft||Ge)&&this.setState({currentIndex:ge,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var y=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),y?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var y=this,v=this.state,P=v.currentIndex,G=v.isTransitioning,Q=this.props,Y=Q.onSlide,xe=Q.slideDuration;this.transitionTimer=window.setTimeout(function(){G&&(y.setState({isTransitioning:!G,isSwipingThumbnail:!1}),Y&&Y(P))},xe+50)}},{key:"onThumbnailClick",value:function(y,v){var P=this.props,G=P.onThumbnailClick,Q=P.items,Y=this.state.currentIndex;y.target.parentNode.parentNode.blur(),Y!==v&&(Q.length===2?this.slideToIndexWithStyleReset(v,y):this.slideToIndex(v,y)),G&&G(y,v)}},{key:"onThumbnailMouseOver",value:function(y,v){var P=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){P.slideToIndex(v),P.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var y=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,y&&this.play()}}},{key:"setThumbsTranslate",value:function(y){this.setState({thumbsTranslate:y})}},{key:"setModalFullscreen",value:function(y){var v=this.props.onScreenChange;this.setState({modalFullscreen:y}),v&&v(y)}},{key:"getThumbsTranslate",value:function(y){var v,P=this.props,G=P.disableThumbnailScroll,Q=P.items,Y=this.state,xe=Y.thumbnailsWrapperWidth,ge=Y.thumbnailsWrapperHeight,Ee=this.thumbnails&&this.thumbnails.current;if(G)return 0;if(Ee){if(this.isThumbnailVertical()){if(Ee.scrollHeight<=ge)return 0;v=Ee.scrollHeight-ge}else{if(Ee.scrollWidth<=xe||xe<=0)return 0;v=Ee.scrollWidth-xe}return y*(v/(Q.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(y){switch(y){case"left":y=" ".concat("image-gallery-thumbnails-left");break;case"right":y=" ".concat("image-gallery-thumbnails-right");break;case"bottom":y=" ".concat("image-gallery-thumbnails-bottom");break;case"top":y=" ".concat("image-gallery-thumbnails-top")}return y}},{key:"getAlignmentClassName",value:function(y){var v=this.state.currentIndex,P=this.props,G=P.infinite,Q=P.items,Y="",xe="image-gallery-left",ge="image-gallery-right";switch(y){case v-1:Y=" ".concat(xe);break;case v:Y=" ".concat("image-gallery-center");break;case v+1:Y=" ".concat(ge)}return Q.length>=3&&G&&(y===0&&v===Q.length-1?Y=" ".concat(ge):y===Q.length-1&&v===0&&(Y=" ".concat(xe))),Y}},{key:"getTranslateXForTwoSlide",value:function(y){var v=this.state,P=v.currentIndex,G=v.currentSlideOffset,Q=v.previousIndex,Y=P!==Q,xe=y===0&&Q===0,ge=y===1&&Q===1,Ee=y===0&&P===1,se=y===1&&P===0,ce=G===0,ue=-100*P+100*y+G;return G>0?this.direction="left":G<0&&(this.direction="right"),se&&G>0&&(ue=-100+G),Ee&&G<0&&(ue=100+G),Y?xe&&ce&&this.direction==="left"?ue=100:ge&&ce&&this.direction==="right"&&(ue=-100):(se&&ce&&this.direction==="left"&&(ue=-100),Ee&&ce&&this.direction==="right"&&(ue=100)),ue}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(y){var v=this.state,P=v.currentIndex,G=v.currentSlideOffset,Q=v.slideStyle,Y=this.props,xe=Y.infinite,ge=Y.items,Ee=Y.useTranslate3D,se=Y.isRTL,ce=-100*P,ue=ge.length-1,pe=(ce+100*y)*(se?-1:1)+G;xe&&ge.length>2&&(P===0&&y===ue?pe=-100*(se?-1:1)+G:P===ue&&y===0&&(pe=100*(se?-1:1)+G)),xe&&ge.length===2&&(pe=this.getTranslateXForTwoSlide(y));var ke="translate(".concat(pe,"%, 0)");return Ee&&(ke="translate3d(".concat(pe,"%, 0, 0)")),vi({display:this.isSlideVisible(y)?"inherit":"none",WebkitTransform:ke,MozTransform:ke,msTransform:ke,OTransform:ke,transform:ke},Q)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var y,v=this.props,P=v.useTranslate3D,G=v.isRTL,Q=this.state,Y=Q.thumbsTranslate,xe=Q.thumbsStyle,ge=G?-1*Y:Y;return this.isThumbnailVertical()?(y="translate(0, ".concat(Y,"px)"),P&&(y="translate3d(0, ".concat(Y,"px, 0)"))):(y="translate(".concat(ge,"px, 0)"),P&&(y="translate3d(".concat(ge,"px, 0, 0)"))),vi({WebkitTransform:y,MozTransform:y,msTransform:y,OTransform:y,transform:y},xe)}},{key:"getSlideItems",value:function(){var y=this,v=this.state.currentIndex,P=this.props,G=P.items,Q=P.slideOnThumbnailOver,Y=P.onClick,xe=P.lazyLoad,ge=P.onTouchMove,Ee=P.onTouchEnd,se=P.onTouchStart,ce=P.onMouseOver,ue=P.onMouseLeave,pe=P.renderItem,ke=P.renderThumbInner,Ae=P.showThumbnails,Ge=P.showBullets,ft=[],ct=[],nt=[];return G.forEach(function(Ke,De){var zt=y.getAlignmentClassName(De),hn=Ke.originalClass?" ".concat(Ke.originalClass):"",fn=Ke.thumbnailClass?" ".concat(Ke.thumbnailClass):"",Mt=Ke.renderItem||pe||y.renderItem,Jt=Ke.renderThumbInner||ke||y.renderThumbInner,Rt=!xe||zt||y.lazyLoaded[De];Rt&&xe&&!y.lazyLoaded[De]&&(y.lazyLoaded[De]=!0);var sn=y.getSlideStyle(De),pn=u().createElement("div",{"aria-label":"Go to Slide ".concat(De+1),key:"slide-".concat(De),tabIndex:"-1",className:"image-gallery-slide ".concat(zt," ").concat(hn),style:sn,onClick:Y,onKeyUp:y.handleSlideKeyUp,onTouchMove:ge,onTouchEnd:Ee,onTouchStart:se,onMouseOver:ce,onFocus:ce,onMouseLeave:ue,role:"button"},Rt?Mt(Ke):u().createElement("div",{style:{height:"100%"}}));if(ft.push(pn),Ae&&Ke.thumbnail){var an=d("image-gallery-thumbnail",fn,{active:v===De});ct.push(u().createElement("button",{key:"thumbnail-".concat(De),type:"button",tabIndex:"0","aria-pressed":v===De?"true":"false","aria-label":"Go to Slide ".concat(De+1),className:an,onMouseLeave:Q?y.onThumbnailMouseLeave:null,onMouseOver:function(gt){return y.handleThumbnailMouseOver(gt,De)},onFocus:function(gt){return y.handleThumbnailMouseOver(gt,De)},onKeyUp:function(gt){return y.handleThumbnailKeyUp(gt,De)},onClick:function(gt){return y.onThumbnailClick(gt,De)}},Jt(Ke)))}if(Ge){var mn=d("image-gallery-bullet",Ke.bulletClass,{active:v===De});nt.push(u().createElement("button",{type:"button",key:"bullet-".concat(De),className:mn,onClick:function(gt){return y.onBulletClick(gt,De)},"aria-pressed":v===De?"true":"false","aria-label":"Go to Slide ".concat(De+1)}))}}),{slides:ft,thumbnails:ct,bullets:nt}}},{key:"ignoreIsTransitioning",value:function(){var y=this.props.items,v=this.state,P=v.previousIndex,G=v.currentIndex,Q=y.length-1;return Math.abs(P-G)>1&&!(P===0&&G===Q)&&!(P===Q&&G===0)}},{key:"isFirstOrLastSlide",value:function(y){return y===this.props.items.length-1||y===0}},{key:"slideIsTransitioning",value:function(y){var v=this.state,P=v.isTransitioning,G=v.previousIndex,Q=v.currentIndex;return P&&!(y===G||y===Q)}},{key:"isSlideVisible",value:function(y){return!this.slideIsTransitioning(y)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(y)}},{key:"slideThumbnailBar",value:function(){var y=this.state,v=y.currentIndex,P=y.isSwipingThumbnail,G=-this.getThumbsTranslate(v);P||(v===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:G,thumbsSwipedTranslate:G}))}},{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(y){var v=y.event,P=y.absX,G=y.dir,Q=this.props,Y=Q.disableSwipe,xe=Q.stopPropagation,ge=this.state,Ee=ge.galleryWidth,se=ge.isTransitioning,ce=ge.swipingUpDown,ue=ge.swipingLeftRight;if(G!==tt&&G!==ot&&!ce||ue){if(G!==at&&G!==qe||ue||this.setState({swipingLeftRight:!0}),!Y){var pe=this.props.swipingTransitionDuration;if(xe&&v.preventDefault(),se)this.setState({currentSlideOffset:0});else{var ke=G===qe?1:-1,Ae=P/Ee*100;Math.abs(Ae)>=100&&(Ae=100);var Ge={transition:"transform ".concat(pe,"ms ease-out")};this.setState({currentSlideOffset:ke*Ae,slideStyle:Ge})}}}else ce||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(y){var v=y.event,P=y.absX,G=y.absY,Q=y.dir,Y=this.props,xe=Y.stopPropagation,ge=Y.swipingThumbnailTransitionDuration,Ee=this.state,se=Ee.thumbsSwipedTranslate,ce=Ee.thumbnailsWrapperHeight,ue=Ee.thumbnailsWrapperWidth,pe=Ee.swipingUpDown,ke=Ee.swipingLeftRight;if(this.isThumbnailVertical()){if((Q===at||Q===qe||ke)&&!pe)return void(ke||this.setState({swipingLeftRight:!0}));Q!==tt&&Q!==ot||pe||this.setState({swipingUpDown:!0})}else{if((Q===tt||Q===ot||pe)&&!ke)return void(pe||this.setState({swipingUpDown:!0}));Q!==at&&Q!==qe||ke||this.setState({swipingLeftRight:!0})}var Ae,Ge,ft,ct,nt,Ke=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(Ae=se+(Q===ot?G:-G),Ge=Ke.scrollHeight-ce+20,ft=Math.abs(Ae)>Ge,ct=Ae>20,nt=Ke.scrollHeight<=ce):(Ae=se+(Q===qe?P:-P),Ge=Ke.scrollWidth-ue+20,ft=Math.abs(Ae)>Ge,ct=Ae>20,nt=Ke.scrollWidth<=ue),!nt&&(Q!==at&&Q!==tt||!ft)&&(Q!==qe&&Q!==ot||!ct)){xe&&v.stopPropagation();var De={transition:"transform ".concat(ge,"ms ease-out")};this.setState({thumbsTranslate:Ae,thumbsStyle:De})}}},{key:"handleOnThumbnailSwiped",value:function(){var y=this.state.thumbsTranslate,v=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:y,thumbsStyle:{transition:"all ".concat(v,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var y=this.state.currentSlideOffset,v=this.props.swipeThreshold;return Math.abs(y)>v}},{key:"resetSwipingDirection",value:function(){var y=this.state,v=y.swipingUpDown,P=y.swipingLeftRight;v&&this.setState({swipingUpDown:!1}),P&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(y){var v=y.event,P=y.dir,G=y.velocity,Q=this.props,Y=Q.disableSwipe,xe=Q.stopPropagation,ge=Q.flickThreshold;if(!Y){var Ee=this.props.isRTL;xe&&v.stopPropagation(),this.resetSwipingDirection();var se=(P===at?1:-1)*(Ee?-1:1),ce=G>ge&&!(P===tt||P===ot);this.handleOnSwipedTo(se,ce)}}},{key:"handleOnSwipedTo",value:function(y,v){var P=this.state,G=P.currentIndex,Q=P.isTransitioning,Y=G;!this.sufficientSwipe()&&!v||Q||(Y+=y),(y===-1&&!this.canSlideLeft()||y===1&&!this.canSlideRight())&&(Y=G),this.unthrottledSlideToIndex(Y)}},{key:"handleTouchMove",value:function(y){this.state.swipingLeftRight&&y.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(y){var v=this.props,P=v.disableKeyDown,G=v.useBrowserFullscreen,Q=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!P)switch(parseInt(y.keyCode||y.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(y);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(y);break;case 27:Q&&!G&&this.exitFullScreen()}}},{key:"handleImageError",value:function(y){var v=this.props.onErrorImageURL;v&&y.target.src.indexOf(v)===-1&&(y.target.src=v)}},{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 y=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(y)))}},{key:"initSlideWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeSlideWrapperObserver=new Nt(Oe(function(P){P&&P.forEach(function(G){v.setState({thumbnailsWrapperWidth:G.contentRect.width},v.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(y.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(y){var v=this;y&&!y.current||(this.resizeThumbnailWrapperObserver=new Nt(Oe(function(P){P&&P.forEach(function(G){v.setState({thumbnailsWrapperHeight:G.contentRect.height},v.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(y.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 y=this.props,v=y.onScreenChange,P=y.useBrowserFullscreen,G=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,Q=this.imageGallery.current===G;v&&v(Q),P&&this.setState({isFullscreen:Q})}},{key:"slideToIndex",value:function(y,v){var P=this.state,G=P.currentIndex,Q=P.isTransitioning,Y=this.props,xe=Y.items,ge=Y.slideDuration,Ee=Y.onBeforeSlide;if(!Q){v&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var se=xe.length-1,ce=y;y<0?ce=se:y>se&&(ce=0),Ee&&ce!==G&&Ee(ce),this.setState({previousIndex:G,currentIndex:ce,isTransitioning:ce!==G,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ge,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"right":"left")}},{key:"slideRight",value:function(y){var v=this.props.isRTL;this.slideTo(y,v?"left":"right")}},{key:"slideTo",value:function(y,v){var P=this.state,G=P.currentIndex,Q=P.isTransitioning,Y=this.props.items,xe=G+(v==="left"?-1:1);Q||(Y.length===2?this.slideToIndexWithStyleReset(xe,y):this.slideToIndex(xe,y))}},{key:"slideToIndexWithStyleReset",value:function(y,v){var P=this,G=this.state,Q=G.currentIndex,Y=G.currentSlideOffset;this.setState({currentSlideOffset:Y+(Q>y?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return P.slideToIndex(y,v)},25)})}},{key:"handleThumbnailMouseOver",value:function(y,v){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(y,v)}},{key:"handleThumbnailKeyUp",value:function(y,v){wi(y)&&this.onThumbnailClick(y,v)}},{key:"handleSlideKeyUp",value:function(y){wi(y)&&(0,this.props.onClick)(y)}},{key:"isThumbnailVertical",value:function(){var y=this.props.thumbnailPosition;return y==="left"||y==="right"}},{key:"addScreenChangeEvent",value:function(){var y=this;xi.forEach(function(v){document.addEventListener(v,y.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var y=this;xi.forEach(function(v){document.removeEventListener(v,y.handleScreenChange)})}},{key:"fullScreen",value:function(){var y=this.props.useBrowserFullscreen,v=this.imageGallery.current;y?v.requestFullscreen?v.requestFullscreen():v.msRequestFullscreen?v.msRequestFullscreen():v.mozRequestFullScreen?v.mozRequestFullScreen():v.webkitRequestFullscreen?v.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var y=this.state.isFullscreen,v=this.props.useBrowserFullscreen;y&&(v?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 y=this.props.infinite,v=this.state.currentIndex;y||this.canSlideRight()?this.slideToIndex(v+1):this.pause()}},{key:"play",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props,P=v.onPlay,G=v.slideInterval,Q=v.slideDuration,Y=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(G,Q)),P&&y&&P(Y))}},{key:"pause",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props.onPause,P=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),v&&y&&v(P))}},{key:"isImageLoaded",value:function(y){return!!this.loadedImages[y.original]||(this.loadedImages[y.original]=!0,!1)}},{key:"handleImageLoaded",value:function(y,v){var P=this.props.onImageLoad;!this.loadedImages[v]&&P&&(this.loadedImages[v]=!0,P(y))}},{key:"renderItem",value:function(y){var v=this.state.isFullscreen,P=this.props.onImageError||this.handleImageError;return u().createElement(L,{description:y.description,fullscreen:y.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:v,onImageError:P,original:y.original,originalAlt:y.originalAlt,originalHeight:y.originalHeight,originalWidth:y.originalWidth,originalTitle:y.originalTitle,sizes:y.sizes,loading:y.loading,srcSet:y.srcSet})}},{key:"renderThumbInner",value:function(y){var v=this.props.onThumbnailError||this.handleImageError;return u().createElement("span",{className:"image-gallery-thumbnail-inner"},u().createElement("img",{className:"image-gallery-thumbnail-image",src:y.thumbnail,height:y.thumbnailHeight,width:y.thumbnailWidth,alt:y.thumbnailAlt,title:y.thumbnailTitle,loading:y.thumbnailLoading,onError:v}),y.thumbnailLabel&&u().createElement("div",{className:"image-gallery-thumbnail-label"},y.thumbnailLabel))}},{key:"render",value:function(){var y=this.state,v=y.currentIndex,P=y.isFullscreen,G=y.modalFullscreen,Q=y.isPlaying,Y=this.props,xe=Y.additionalClass,ge=Y.disableThumbnailSwipe,Ee=Y.indexSeparator,se=Y.isRTL,ce=Y.items,ue=Y.thumbnailPosition,pe=Y.renderFullscreenButton,ke=Y.renderCustomControls,Ae=Y.renderLeftNav,Ge=Y.renderRightNav,ft=Y.showBullets,ct=Y.showFullscreenButton,nt=Y.showIndex,Ke=Y.showThumbnails,De=Y.showNav,zt=Y.showPlayButton,hn=Y.renderPlayPauseButton,fn=this.getThumbnailStyle(),Mt=this.getSlideItems(),Jt=Mt.slides,Rt=Mt.thumbnails,sn=Mt.bullets,pn=d("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ue),{"image-gallery-rtl":se}),an=u().createElement("div",{ref:this.imageGallerySlideWrapper,className:pn},ke&&ke(),this.canSlide()?u().createElement(u().Fragment,null,De&&u().createElement(u().Fragment,null,Ae(this.slideLeft,!this.canSlideLeft()),Ge(this.slideRight,!this.canSlideRight())),u().createElement(mi,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},u().createElement("div",{className:"image-gallery-slides"},Jt))):u().createElement("div",{className:"image-gallery-slides"},Jt),zt&&hn(this.togglePlay,Q),ft&&u().createElement("div",{className:"image-gallery-bullets"},u().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},sn)),ct&&pe(this.toggleFullScreen,P),nt&&u().createElement("div",{className:"image-gallery-index"},u().createElement("span",{className:"image-gallery-index-current"},v+1),u().createElement("span",{className:"image-gallery-index-separator"},Ee),u().createElement("span",{className:"image-gallery-index-total"},ce.length))),mn=d("image-gallery",xe,{"fullscreen-modal":G}),gt=d("image-gallery-content",this.getThumbnailPositionClassName(ue),{fullscreen:P}),va=d("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ue),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&se},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ge},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ge});return u().createElement("div",{ref:this.imageGallery,className:mn,"aria-live":"polite"},u().createElement("div",{className:gt},(ue==="bottom"||ue==="right")&&an,Ke&&Rt.length>0?u().createElement(mi,{className:va,delta:0,onSwiping:!ge&&this.handleThumbnailSwiping,onSwiped:!ge&&this.handleOnThumbnailSwiped},u().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},u().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:fn,"aria-label":"Thumbnail Navigation"},Rt))):null,(ue==="top"||ue==="left")&&an))}}],T&&fa(g.prototype,T),Object.defineProperty(g,"prototype",{writable:!1}),Te}(u().Component);nr.propTypes={flickThreshold:O.number,items:(0,O.arrayOf)((0,O.shape)({bulletClass:O.string,bulletOnClick:O.func,description:O.string,original:O.string,originalHeight:O.number,originalWidth:O.number,loading:O.string,thumbnailHeight:O.number,thumbnailWidth:O.number,thumbnailLoading:O.string,fullscreen:O.string,originalAlt:O.string,originalTitle:O.string,thumbnail:O.string,thumbnailAlt:O.string,thumbnailLabel:O.string,thumbnailTitle:O.string,originalClass:O.string,thumbnailClass:O.string,renderItem:O.func,renderThumbInner:O.func,imageSet:ma,srcSet:O.string,sizes:O.string})).isRequired,showNav:O.bool,autoPlay:O.bool,lazyLoad:O.bool,infinite:O.bool,showIndex:O.bool,showBullets:O.bool,showThumbnails:O.bool,showPlayButton:O.bool,showFullscreenButton:O.bool,disableThumbnailScroll:O.bool,disableKeyDown:O.bool,disableSwipe:O.bool,disableThumbnailSwipe:O.bool,useBrowserFullscreen:O.bool,onErrorImageURL:O.string,indexSeparator:O.string,thumbnailPosition:(0,O.oneOf)(["top","bottom","left","right"]),startIndex:O.number,slideDuration:O.number,slideInterval:O.number,slideOnThumbnailOver:O.bool,swipeThreshold:O.number,swipingTransitionDuration:O.number,swipingThumbnailTransitionDuration:O.number,onSlide:O.func,onBeforeSlide:O.func,onScreenChange:O.func,onPause:O.func,onPlay:O.func,onClick:O.func,onImageLoad:O.func,onImageError:O.func,onTouchMove:O.func,onTouchEnd:O.func,onTouchStart:O.func,onMouseOver:O.func,onMouseLeave:O.func,onBulletClick:O.func,onThumbnailError:O.func,onThumbnailClick:O.func,renderCustomControls:O.func,renderLeftNav:O.func,renderRightNav:O.func,renderPlayPauseButton:O.func,renderFullscreenButton:O.func,renderItem:O.func,renderThumbInner:O.func,stopPropagation:O.bool,additionalClass:O.string,useTranslate3D:O.bool,isRTL:O.bool,useWindowKeyDown:O.bool},nr.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,g){return u().createElement(er,{onClick:b,disabled:g})},renderRightNav:function(b,g){return u().createElement(un,{onClick:b,disabled:g})},renderPlayPauseButton:function(b,g){return u().createElement(tn,{onClick:b,isPlaying:g})},renderFullscreenButton:function(b,g){return u().createElement(lt,{onClick:b,isFullscreen:g})},useWindowKeyDown:!0};const ga=nr})(),o})())}(Un)),Un.exports}var Cd=Od();const Id=ei(Cd);function Rd(){var e=new Map;function t(r){var i=r.root,s=r.rootMargin,n=r.threshold,o=e.get(i);o||(o=new Map,e.set(i,o));var a=JSON.stringify({rootMargin:s,threshold:n}),d=o.get(a);if(!d){var h=new Map,u=new IntersectionObserver(function(f){f.forEach(function(j){var m=h.get(j.target);m?.(j)})},{root:i,rootMargin:s,threshold:n});d={observer:u,entryCallbacks:h},o.set(a,d)}return{observe:function(j,m){var E,S;(E=d)==null||E.entryCallbacks.set(j,m),(S=d)==null||S.observer.observe(j)},unobserve:function(j){var m,E;(m=d)==null||m.entryCallbacks.delete(j),(E=d)==null||E.observer.unobserve(j)}}}return{getObserver:t}}var Pd="0px",Ld=[0],_d=Rd();function Nd(e){var t,r,i=(t=e?.rootMargin)!=null?t:Pd,s=(r=e?.threshold)!=null?r:Ld,n=q.useRef(null),o=q.useRef(null),a=q.useRef(null),d=q.useState(),h=d[0],u=d[1],f=q.useCallback(function(){var S=n.current;if(!S){u(void 0);return}var C=_d.getObserver({root:o.current,rootMargin:i,threshold:s});C.observe(S,function(_){u(_)}),a.current=C},[i,s]),j=q.useCallback(function(){var S=a.current,C=n.current;C&&S?.unobserve(C),a.current=null},[]),m=q.useCallback(function(S){j(),n.current=S,f()},[f,j]),E=q.useCallback(function(S){j(),o.current=S,f()},[f,j]);return[m,{entry:h,rootRef:E}]}function Gr(){return Gr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Gr.apply(this,arguments)}function Ad(e){var t,r=Nd(e),i=r[0],s=r[1],n=!!((t=s.entry)!=null&&t.isIntersecting),o=q.useState(n),a=o[0],d=o[1];return n&&!a&&d(!0),[i,Gr({},s,{isVisible:n,wasEverVisible:a})]}var Dd=100;function Md(e){var t=e.loading,r=e.hasNextPage,i=e.onLoadMore,s=e.rootMargin,n=e.disabled,o=e.delayInMs,a=o===void 0?Dd:o,d=Ad({rootMargin:s}),h=d[0],u=d[1],f=u.rootRef,j=u.isVisible,m=!n&&!t&&j&&r;return q.useEffect(function(){if(m){var E=setTimeout(function(){i()},a);return function(){clearTimeout(E)}}},[i,m,a]),[h,{rootRef:f}]}const Bd={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"/>'},Fd={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>'},$d={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M18 6L6 18M6 6l12 12"/>'};var Tr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function jr(e,t,r,i){e.addEventListener?e.addEventListener(t,r,i):e.attachEvent&&e.attachEvent("on".concat(t),function(){r(window.event)})}function Gs(e,t){for(var r=t.slice(0,t.length-1),i=0;i<r.length;i++)r[i]=e[r[i].toLowerCase()];return r}function Hs(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),r=t.lastIndexOf("");r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}function Ud(e,t){for(var r=e.length>=t.length?e:t,i=e.length>=t.length?t:e,s=!0,n=0;n<r.length;n++)i.indexOf(r[n])===-1&&(s=!1);return s}var di={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Tr?173:189,"=":Tr?61:187,";":Tr?59:186,"'":222,"[":219,"]":221,"\\":220},Ht={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Hr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},rt={16:!1,18:!1,17:!1,91:!1},Qe={};for(var An=1;An<20;An++)di["f".concat(An)]=111+An;var We=[],So=!1,Xs="all",Ys=[],Zn=function(t){return di[t.toLowerCase()]||Ht[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Js(e){Xs=e||"all"}function En(){return Xs||"all"}function qd(){return We.slice(0)}function Wd(e){var t=e.target||e.srcElement,r=t.tagName,i=!0;return(t.isContentEditable||(r==="INPUT"||r==="TEXTAREA"||r==="SELECT")&&!t.readOnly)&&(i=!1),i}function zd(e){return typeof e=="string"&&(e=Zn(e)),We.indexOf(e)!==-1}function Vd(e,t){var r,i;e||(e=En());for(var s in Qe)if(Object.prototype.hasOwnProperty.call(Qe,s))for(r=Qe[s],i=0;i<r.length;)r[i].scope===e?r.splice(i,1):i++;En()===e&&Js(t||"all")}function Kd(e){var t=e.keyCode||e.which||e.charCode,r=We.indexOf(t);if(r>=0&&We.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&We.splice(0,We.length),(t===93||t===224)&&(t=91),t in rt){rt[t]=!1;for(var i in Ht)Ht[i]===t&&(xt[i]=!1)}}function Gd(e){if(typeof e>"u")Object.keys(Qe).forEach(function(o){return delete Qe[o]});else if(Array.isArray(e))e.forEach(function(o){o.key&&Or(o)});else if(typeof e=="object")e.key&&Or(e);else if(typeof e=="string"){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];var s=r[0],n=r[1];typeof s=="function"&&(n=s,s=""),Or({key:e,scope:s,method:n,splitKey:"+"})}}var Or=function(t){var r=t.key,i=t.scope,s=t.method,n=t.splitKey,o=n===void 0?"+":n,a=Hs(r);a.forEach(function(d){var h=d.split(o),u=h.length,f=h[u-1],j=f==="*"?"*":Zn(f);if(Qe[j]){i||(i=En());var m=u>1?Gs(Ht,h):[];Qe[j]=Qe[j].filter(function(E){var S=s?E.method===s:!0;return!(S&&E.scope===i&&Ud(E.mods,m))})}})};function Eo(e,t,r,i){if(t.element===i){var s;if(t.scope===r||t.scope==="all"){s=t.mods.length>0;for(var n in rt)Object.prototype.hasOwnProperty.call(rt,n)&&(!rt[n]&&t.mods.indexOf(+n)>-1||rt[n]&&t.mods.indexOf(+n)===-1)&&(s=!1);(t.mods.length===0&&!rt[16]&&!rt[18]&&!rt[17]&&!rt[91]||s||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function ko(e,t){var r=Qe["*"],i=e.keyCode||e.which||e.charCode;if(xt.filter.call(this,e)){if((i===93||i===224)&&(i=91),We.indexOf(i)===-1&&i!==229&&We.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(E){var S=Hr[E];e[E]&&We.indexOf(S)===-1?We.push(S):!e[E]&&We.indexOf(S)>-1?We.splice(We.indexOf(S),1):E==="metaKey"&&e[E]&&We.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(We=We.slice(We.indexOf(S))))}),i in rt){rt[i]=!0;for(var s in Ht)Ht[s]===i&&(xt[s]=!0);if(!r)return}for(var n in rt)Object.prototype.hasOwnProperty.call(rt,n)&&(rt[n]=e[Hr[n]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(We.indexOf(17)===-1&&We.push(17),We.indexOf(18)===-1&&We.push(18),rt[17]=!0,rt[18]=!0);var o=En();if(r)for(var a=0;a<r.length;a++)r[a].scope===o&&(e.type==="keydown"&&r[a].keydown||e.type==="keyup"&&r[a].keyup)&&Eo(e,r[a],o,t);if(i in Qe){for(var d=0;d<Qe[i].length;d++)if((e.type==="keydown"&&Qe[i][d].keydown||e.type==="keyup"&&Qe[i][d].keyup)&&Qe[i][d].key){for(var h=Qe[i][d],u=h.splitKey,f=h.key.split(u),j=[],m=0;m<f.length;m++)j.push(Zn(f[m]));j.sort().join("")===We.sort().join("")&&Eo(e,h,o,t)}}}}function Hd(e){return Ys.indexOf(e)>-1}function xt(e,t,r){We=[];var i=Hs(e),s=[],n="all",o=document,a=0,d=!1,h=!0,u="+",f=!1;for(r===void 0&&typeof t=="function"&&(r=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(n=t.scope),t.element&&(o=t.element),t.keyup&&(d=t.keyup),t.keydown!==void 0&&(h=t.keydown),t.capture!==void 0&&(f=t.capture),typeof t.splitKey=="string"&&(u=t.splitKey)),typeof t=="string"&&(n=t);a<i.length;a++)e=i[a].split(u),s=[],e.length>1&&(s=Gs(Ht,e)),e=e[e.length-1],e=e==="*"?"*":Zn(e),e in Qe||(Qe[e]=[]),Qe[e].push({keyup:d,keydown:h,scope:n,mods:s,shortcut:i[a],method:r,key:i[a],splitKey:u,element:o});typeof o<"u"&&!Hd(o)&&window&&(Ys.push(o),jr(o,"keydown",function(j){ko(j,o)},f),So||(So=!0,jr(window,"focus",function(){We=[]},f)),jr(o,"keyup",function(j){ko(j,o),Kd(j)},f))}function Xd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Qe).forEach(function(r){var i=Qe[r].find(function(s){return s.scope===t&&s.shortcut===e});i&&i.method&&i.method()})}var Cr={setScope:Js,getScope:En,deleteScope:Vd,getPressedKeyCodes:qd,isPressed:zd,filter:Wd,trigger:Xd,unbind:Gd,keyMap:di,modifier:Ht,modifierMap:Hr};for(var Ir in Cr)Object.prototype.hasOwnProperty.call(Cr,Ir)&&(xt[Ir]=Cr[Ir]);if(typeof window<"u"){var Yd=window.hotkeys;xt.noConflict=function(e){return e&&window.hotkeys===xt&&(window.hotkeys=Yd),xt},window.hotkeys=xt}xt.filter=function(){return!0};var Qs=function(t,r){var i=t.target,s=i&&i.tagName;return!!(s&&r&&r.includes(s))},Jd=function(t){return Qs(t,["INPUT","TEXTAREA","SELECT"])};function Qd(e,t,r,i){r instanceof Array&&(i=r,r=void 0);var s=r||{},n=s.enableOnTags,o=s.filter,a=s.keyup,d=s.keydown,h=s.filterPreventDefault,u=h===void 0?!0:h,f=s.enabled,j=f===void 0?!0:f,m=s.enableOnContentEditable,E=m===void 0?!1:m,S=q.useRef(null),C=q.useCallback(function(_,N){var D,c;return o&&!o(_)?!u:Jd(_)&&!Qs(_,n)||(D=_.target)!=null&&D.isContentEditable&&!E?!0:S.current===null||document.activeElement===S.current||(c=S.current)!=null&&c.contains(document.activeElement)?(t(_,N),!0):!1},i?[S,n,o].concat(i):[S,n,o]);return q.useEffect(function(){if(!j){xt.unbind(e,C);return}return a&&d!==!0&&(r.keydown=!1),xt(e,r||{},C),function(){return xt.unbind(e,C)}},[C,e,j]),S}xt.isPressed;const Zs=q.createContext({open:!1,toggleOpen:e=>{}});function Zd({children:e}){const[t,r]=q.useState(!1),i=n=>{r(n??!n)},s=q.useMemo(()=>({open:t,toggleOpen:i}),[t]);return l.jsx(Zs.Provider,{value:s,children:e})}function hi(){return q.useContext(Zs)}const St={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},eh=e=>Tn(async()=>{const{data:t}=await e.get(St.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function th(e,t){const r=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...Rl(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:i,onSearchSelect:s=a=>{t.onFilterChange({...r,keyword:a.title})},emptyCategory:n}=t;!r.category&&!n&&(r.category="All");const o=a=>{const d={...r,...a};i(rr(d,h=>h===""||h===void 0))};return{filters:e,cleanFilter:a=>{const d=a?rr(r,(h,u)=>a.includes(u)):{};i(rr(d,h=>h===""||h===void 0))},handleActiveMenu:a=>{a!==e.menu&&i({menu:a})},handleSort:(a,d)=>{o({sortBy:a,sortDirection:d||a==="nameAsc"?"asc":"desc"})},handleKeyword:a=>{o({category:void 0,keyword:a||void 0})},handlePrice:a=>{o({price:a===e.price?void 0:a})},handleCategory:a=>{o({category:a===e.category?"":a})},handleDeveloper:a=>{o({owner:a||void 0})},handlePage:a=>{o({currentPage:a})},handleSwitchShowResources:a=>{o({showResources:a})},handleSearchSelect:a=>{s(a)}}}const nh=(e,t,r)=>e&&t||!r,ea=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ta=(e,t,r)=>{const i=Pl(e),s=Ll(i.search);if(_l(e)?.endsWith(".gif"))return s.imageFilter?Nl({...i,search:""}):e;if(s.imageFilter)return e;const n=r||window.blocklet?.version,{w:o,h:a}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Yn(e,{...o||a?{imageFilter:"resize",w:o,h:a}:{},v:n})},rh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],ih=(e=[],t="en")=>e.map(r=>({name:r.locales[t]||r.locales.en,value:r._id})),oh=e=>Array.isArray(e)?e.map(t=>t.message).join(`
|
|
490
|
+
`):e.response?.data?.error?e.response.data.error.message||e.response.data.error:e.message||e,sh=(e,t)=>e?.replace(/{(\w*)}/g,(r,i)=>t.hasOwnProperty(i)?t[i]:""),ah=()=>window.innerWidth<=600,lh={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}"'}},ch={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}” 的所有搜索结果"}},Rr={en:ji(lh),zh:ji(ch)},na=(e,t)=>{const r={};return e&&(r["x-blocklet-server-version"]=e),t&&(r["x-blocklet-store-version"]=t),r},uh=e=>(t,r)=>{const i=Rr[e]?Rr[e][t]:Rr.en[t];return sh(i,r)||t},ra={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:()=>{}}},ia=q.createContext(ra),{Provider:dh,Consumer:Af}=ia;function hh(e){const{locale:t="zh",filters:r={},serverVersion:i="",onFilterChange:s=()=>{},minItemWidth:n=350,queryFilter:o=!0,layout:a={},wrapChildren:d=K=>K,extraFilter:h=K=>K,baseSearch:u=!1,fetchCategoryDelay:f=0,showResourcesSwitch:j=!1,showCategory:m=!0,tagFilters:E=[],children:S,storeVersion:C,onSearchSelect:_=()=>{},endpoint:N,blockletRender:D,compact:c=!1}=e,w=na(i,C),R=q.useMemo(()=>Zo({baseURL:N,headers:w}),[N]),B=th(r,{onFilterChange:s,emptyCategory:!a.showExplore,onSearchSelect:_}),[M,re]=q.useState(""),{data:Z=[],error:z,loading:W,run:H}=eh(R),A=q.useMemo(()=>{const K=Il(Z,[de=>de.name],["asc"]),we=K.findIndex(de=>de.name==="All"||de.locales.en==="All");return we>-1?[{...K[we],_id:"All"},...K.slice(0,we),...K.slice(we+1)]:K},[Z]),X=q.useCallback(uh(t),[t]),$=q.useMemo(()=>ih(A,t),[A,t]),he=rh(X),Oe={search:B,compact:c,errors:{fetchCategoriesError:z},loadings:{fetchCategoriesLoading:W},extraFilter:h,endpoint:N,queryFilter:o,layout:{showExplore:a.showExplore??!1,showCategory:a.showCategory??!0,showTitle:a.showTitle??!0,showSearch:a.showSearch??!0},minItemWidth:n,wrapChildren:d,t:X,storeVersion:C,serverVersion:i,selectedCategory:B.filters.category||(a.showExplore?"":"All"),categoryList:A,blockletRender:D,locale:t,categoryOptions:$,priceOptions:he,storeApi:R,baseSearch:u,showResourcesSwitch:j,showCategory:m,tagFilters:E,onFilterChange:s,getCategoryLocale:K=>{if(!K)return null;const we=Z.find(de=>de._id===K||de.locales.en==="All");return we?we.locales[t]||we.locales.en:null},get developerName(){return M},updateDeveloperName:re};return q.useEffect(()=>{setTimeout(H,f||0)},[N,H,f]),l.jsx(dh,{value:Oe,children:S})}function dt(){return q.useContext(ia)||ra}function oa({children:e,onClick:t,size:r=32,...i}){return l.jsx(kn,{...i,onClick:t,variant:"outlined",sx:[{minWidth:r,height:r,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(i.sx)?i.sx:[i.sx]],children:e})}function Dn(e,t){return e===void 0?t:e}function fi({xs:e=void 0,sm:t=void 0,md:r=void 0,lg:i=void 0,xl:s=void 0,exact:n=!1}){const o=qt(),a=Gt(o.breakpoints.down("sm")),d=Gt(o.breakpoints.between("sm","md")),h=Gt(o.breakpoints.between("md","lg")),u=Gt(o.breakpoints.between("lg","xl"));if(n)return a?e||null:d?t||null:h?r||null:u?i||null:s||null;let f=e;return a||(f=Dn(t,f),d)||(f=Dn(r,f),h)||(f=Dn(i,f),u)?f:Dn(s,f)}function fh({children:e}){const{open:t,toggleOpen:r}=hi();return l.jsx(fi,{xs:l.jsx(Da,{open:t,onClose:()=>r(!1),children:e}),md:l.jsx(oe,{children:e})})}function ph({loading:e=!1,disabled:t,...r}){return l.jsx(kn,{disableElevation:!0,disabled:t||e===!0,...r,sx:[{borderRadius:"4px"},...Array.isArray(r.sx)?r.sx:[r.sx]],startIcon:e&&l.jsx(Tt,{size:"1em"})})}function Xr({value:e,options:t,onChange:r,placeholder:i="",...s}){const n=q.useRef(null),o=qt(),[a,d]=q.useState(!1),[h,u]=q.useState(e!==null?e:""),f=Gt(o.breakpoints.down("sm"));q.useEffect(()=>{u(e!==null?e:"")},[e]);const j=q.useCallback(()=>{d(!1)},[]),m=q.useCallback(()=>{d(!0)},[]);function E(C){u(C.value),r(C.value),f&&j()}function S(C){return C===h}return l.jsxs(l.Fragment,{children:[l.jsxs(mh,{ref:n,onClick:m,variant:"outlined",size:"medium",className:["my-select__selector",yn(h)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...s,children:[t.find(C=>C.value===h)?.name||i,l.jsx(Fa,{className:"my-select__arrowdown",component:$a,sx:{width:18,height:18}})]}),l.jsx(Ua,{open:a,anchorEl:n.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:C,placement:_})=>l.jsx(qa,{...C,style:{transformOrigin:_==="bottom"?"center top":"center bottom"},children:l.jsx(Wa,{children:l.jsx(za,{onClickAway:j,children:l.jsx(gh,{autoFocusItem:a,onMouseEnter:m,onMouseLeave:j,children:t.map(N=>l.jsxs(Zr,{onClick:()=>E(N),sx:{fontSize:14},children:[l.jsx(zo,{sx:{mr:1,fontSize:16,visibility:S(N.value)?"visible":"hidden"}}),N.name]},N.value))})})})})})]})}const mh=Xt(ph)`
|
|
491
491
|
border: 1px solid ${e=>e.theme.palette.divider};
|
|
492
492
|
padding: 6px 8px 6px 12px;
|
|
493
493
|
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 sa(){const{search:e,t}=dt(),{filters:r,handleSort:i,handlePrice:s}=e,n=ea(t);return l.jsxs(ut,{direction:{xs:"row",md:"column"},sx:{alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between"},children:[l.jsx(Jr,{control:l.jsx(Qr,{checked:r.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:o=>s(o.target.checked?"free":"")}),label:t("blocklet.free")}),l.jsx(Xr,{value:r.sortBy||n[0].value,options:n,onChange:o=>i(o),placeholder:t("sort.sort")})]})}function vh({menus:e=[]}){const{selectedCategory:t,search:r,t:i,categoryOptions:s,loadings:n,layout:o,baseSearch:a,compact:d}=dt(),{filters:h,handleActiveMenu:u,handleCategory:f,cleanFilter:j}=r,{toggleOpen:m}=hi();q.useEffect(()=>{m(!1)},[Object.values(h).join("")]);const E=nh(a,o.showSearch,h.keyword);return o.showCategory&&!d?l.jsxs(fh,{children:[l.jsx(fi,{xs:l.jsxs(ut,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[l.jsx(oa,{onClick:()=>m(!1),children:l.jsx(Uo,{})}),l.jsx(je,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:i("common.category")})]}),md:null}),l.jsx(ut,{visibility:n.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:E?l.jsxs(l.Fragment,{children:[o.showExplore&&l.jsxs(oe,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[l.jsxs(oe,{display:"flex",alignItems:"center",gap:1,children:[l.jsx(Ft,{icon:Eu,width:20,height:20}),l.jsx(je,{variant:"body1",color:!t&&!h.menu?"text.primary":"grey.400",fontWeight:!t&&!h.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),j()},children:i("explore.title")})]}),e.map(S=>l.jsxs(oe,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?l.jsx(Ft,{icon:S.icon,width:20,height:20}):S.icon,l.jsx(je,{variant:"body1",color:h.menu===S.key?"text.primary":"grey.400",fontWeight:h.menu===S.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),u(S.key),S.onClick?.()},children:S.title})]},S.key))]}),!!s.length&&l.jsx(ut,{gap:2,children:s.map(S=>l.jsx(je,{variant:"body1",title:S.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===S.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===S.value?j():f(S.value),m(!1)},children:S.name},S.value))})]}):l.jsx(sa,{})})]}):null}function pi(){const{endpoint:e,serverVersion:t,storeVersion:r}=dt(),i=na(t,r),s=q.useMemo(()=>Yo({baseURL:e,headers:i}),[e]);return{get:async n=>{const{data:o}=await s.get(n);return o},post:async(n,o)=>{const{data:a}=await s.post(n,o);return a}}}const aa=q.memo(function(e){return l.jsx(oe,{...e,sx:[{height:60,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(e.sx)?e.sx:[e.sx]],children:l.jsx(Tt,{})})});function To({icon:e=null,children:t=null,maxWidth:r=100,title:i=""}){return(t===0||t)&&l.jsxs(ut,{direction:"row",sx:{alignItems:"center",gap:1,maxWidth:r,overflow:"hidden"},children:[e,l.jsx(je,{variant:"body2",title:i||(typeof t=="string"?t:void 0),sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const yh=16/9,Pr=292,Yr=189,zn=336;function bh(){const{t:e,search:t}=dt(),{get:r}=pi(),i=qt(),s=Kt(i.breakpoints.down("md")),n=window.blocklet?.preferences?.homeBanner||[],{data:o=[],error:a,loading:d}=Tn(async()=>{const S=await r(Xn(St.blockletsPath,{didList:n.map(C=>C.did).join(",")}));return S?.dataList?n.map(C=>S.dataList.find(_=>_.did===C.did)):[]});a&&console.error("Get Banner Blocklets error:",a);const h={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!a&&n.length>0?l.jsxs(l.Fragment,{children:[l.jsx(je,{component:"h2",variant:"h2",sx:{mt:{xs:2,md:0},mb:3},children:e("explore.title")}),l.jsx(oe,{sx:{height:{xs:"auto",md:Pr},minHeight:Pr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden"},children:d?l.jsxs(oe,{sx:{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center"},children:[l.jsx(Gt,{variant:"rounded",height:Yr,width:zn}),l.jsxs(oe,{sx:{flex:1,height:"100%"},children:[l.jsx(Gt,{variant:"text",height:50,width:100}),l.jsx(Gt,{variant:"text",height:40,width:"100%"}),l.jsx(Gt,{variant:"text",height:40,width:300}),l.jsxs(oe,{sx:{display:"flex",gap:1,my:2},children:[l.jsx(Gt,{variant:"circular",height:20,width:20}),l.jsx(Gt,{variant:"text",height:20,width:50})]}),l.jsx(Gt,{variant:"rounded",height:30,width:100})]})]}):l.jsx(Id,{showNav:!0,autoPlay:!0,slideDuration:s?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:S=>l.jsx(oe,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Ba,{sx:{...h,left:5}})}),renderRightNav:S=>l.jsx(oe,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Ma,{sx:{...h,right:5}})}),items:n.map((S,C)=>({original:S.did,renderItem:()=>{const _=o[C]||{},N=S.cover||wh(S.did,_.screenshots?.[0]),D=ta(N,i.breakpoints.values.md*2);return l.jsxs(ut,{direction:{xs:"column",md:"row"},onClick:()=>t.handleSearchSelect(_),sx:{height:{xs:"auto",md:Pr},display:"flex",justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},gap:{xs:2,md:5},cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${D}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},children:[u(D),l.jsxs(ut,{sx:{flex:1,height:"100%",gap:3},children:[l.jsxs(oe,{sx:{flex:1},children:[f(S.name||_.title||S.name),j(S.desc||_.description)]}),_.did&&m(_,S.baseNum),E(_)]})]})}}))})})]}):null;function u(S){return l.jsx(oe,{sx:{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:zn}},children:l.jsx(Sh,{url:S})})}function f(S){return l.jsx(je,{variant:"h2",sx:{width:"100%"},children:S})}function j(S){return l.jsx(je,{variant:"body2",sx:{color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:71,pt:1,display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:S})}function m(S,C=0){const{did:_,owner:N,stats:D}=S;return l.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(To,{icon:l.jsx(qn,{src:N.avatar,did:_,size:20,variant:"circle"}),children:N.fullName}),l.jsx(To,{icon:l.jsx(Ft,{icon:Is}),title:`${D.downloads+C}`,children:xh(D.downloads+C)})]})}function E(S){return l.jsx(kn,{variant:"outlined",size:"small",onClick:()=>t.handleSearchSelect(S),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:e("explore.viewDetail")})}}const xh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,wh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Sh({url:e}){const[t,r]=q.useState(!0);return l.jsxs(l.Fragment,{children:[t&&l.jsx(Gt,{variant:"rectangular",sx:{width:{xs:"100%",md:zn},height:{xs:"auto",md:Yr}}}),l.jsx(oe,{component:"img",src:e,alt:"",onLoad:()=>r(!1),onError:()=>r(!1),sx:{display:t?"none":"block",width:{xs:"100%",md:zn},height:{xs:"auto",md:Yr},borderRadius:2,border:1,borderColor:"divider",objectFit:"container",cursor:"pointer",aspectRatio:yh}})]})}function Eh({title:e,blocklets:t}){const{blockletRender:r,serverVersion:i}=dt();return l.jsxs(oe,{sx:{mt:3},children:[l.jsx(je,{component:"h3",variant:"h3",sx:{mb:2},children:e}),l.jsx(Si,{container:!0,spacing:2,sx:{boxSizing:"border-box",maxWidth:"calc(100vw - 16px)"},children:t.map(s=>l.jsx(Si,{"data-blocklet-did":s.did,sx:{p:"2px"},size:{xs:12,md:6},children:l.jsx(oe,{sx:{padding:"1px"},children:r({blocklet:s,blocklets:t,serverVersion:i})})},s.did))})]})}function kh(){const{get:e}=pi(),{t}=dt(),{data:r=[],error:i,loading:s}=Tn(async()=>{const n=await e(St.explorePath);return Array.isArray(n)?n:[]});return i?l.jsx(Hn,{error:new Error(`Failed to fetch blocklets from ${St.explorePath}`)}):s?l.jsx(aa,{mt:15}):l.jsxs(l.Fragment,{children:[l.jsx(bh,{}),r.map(n=>n.blocklets?.length>0?l.jsx(Eh,{title:t(`explore.${n.type}`),blocklets:n.blocklets},n.type):null)]})}const Lr="__FREE_TEXT__",jo="__NO_RESULT__",_r=40;function la({endpoint:e,t,locale:r,filters:i,handleKeyword:s,handleSearchSelect:n,...o}){const a=q.useRef(null),d=q.useRef(!1),[h,u]=q.useState(!1),[f,j]=q.useState(""),[m,E]=q.useState(!1),S=pi(),[C,_]=q.useState(!1),N=o?.placeholder||t("common.searchStore"),D=async $=>{_(!0);const he=await S.get(Zt(e,Xn(St.blockletsPath,$)));return _(!1),he.dataList||[]},{data:c,run:w}=Tn($=>$?D({sortBy:St.nameDesc,page:1,pageSize:10,keyword:$,showResources:"true"}):Promise.resolve([]),{manual:!0});q.useEffect(()=>{_(!0),w(i.keyword),j(i.keyword||"")},[i.keyword,w]),Qd("ctrl + k, command + k",$=>($.stopPropagation(),$.preventDefault(),a.current?.querySelector("input")?.focus(),!1),{enableOnTags:["INPUT"]});const R=rs($=>w($),{wait:300}),B={name:Lr,title:f,did:""};let M=[];return f&&(C?M=[B]:c?.length?M=[B,...c]:M=[{name:jo,title:t("blocklet.noResults"),did:""}]),l.jsxs(l.Fragment,{children:[l.jsxs(Aa,{fullScreen:!0,open:m,sx:{display:{md:"none"}},children:[l.jsxs(oe,{sx:{p:2,pb:0,display:"flex",alignItems:"center",gap:2},children:[l.jsx(qo,{fullWidth:!0,sx:{bgcolor:"grey.50",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:N,className:"bl-autocomplete-input",value:f,onChange:$=>re($.target.value),startAdornment:A(m),endAdornment:X()}),l.jsx(kn,{variant:"outlined",onClick:()=>{E(!1),j(i.keyword||"")},children:t("common.cancel")})]}),l.jsx(Wo,{sx:{p:.5},children:M.map($=>W($))})]}),l.jsx(oe,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:l.jsx(Ft,{icon:or,style:{fontSize:22,color:"inherit"},onClick:()=>E(!0)})}),l.jsx(No,{ref:a,open:!!f&&h,size:"small",onOpen:()=>u(!0),onClose:($,he)=>{u(!1),he==="selectOption"&&!d.current&&s(f)},onKeyDown:$=>{$.key==="Enter"&&!f&&Z()},disableClearable:!0,inputValue:f,onInputChange:($,he)=>re(he),isOptionEqualToValue:($,he)=>$.name===he.name,getOptionLabel:$=>$.title,getOptionKey:$=>$.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:$=>l.jsx(Vn,{...$,InputProps:{...$.InputProps,autoFocus:!0,placeholder:N,className:"bl-autocomplete-input",value:f,startAdornment:A(h),endAdornment:X()}}),filterOptions:$=>$,...o,options:M,renderOption:($,he)=>W(he),value:B,sx:[{bgcolor:"grey.50",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(o.sx)?o.sx:[o.sx]]})]});function re($){_(!0),j($),d.current=!1,R.run($)}function Z(){E(!1),j(""),re(""),s("")}function z($){$?.did?(E(!1),d.current=!0,j(""),n($)):$.name===Lr&&(E(!1),s(f))}function W($){return l.jsxs(Zr,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>z($),children:[H($),l.jsxs(je,{variant:"body1",children:[l.jsx(je,{sx:{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1},children:$.title}),l.jsx(je,{sx:{fontSize:"13px",color:"text.hint"},children:$.category?.locales?.[r||"en"]||""})]})]},$.did)}function H($){if([Lr,jo].includes($.name))return l.jsx(oe,{sx:{width:_r,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px"},children:l.jsx(Ft,{icon:or,style:{fontSize:28}})});let he="";return $.logo&&(he=Zt(e,"assets",$.did,ta($.logo,_r,$.version))),l.jsx(qn,{src:he,size:_r,style:{borderRadius:"8px",overflow:"hidden"}})}function A($=!0){return l.jsx(oe,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:$&&f&&C?l.jsx(Tt,{color:"inherit",size:16}):l.jsx(Ft,{icon:or,style:{fontSize:16,cursor:"default"}})})}function X(){return f?l.jsx(oe,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:l.jsx(Ft,{icon:$d,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>Z()})}):null}}function Th({placeholder:e,...t}){const{search:r,t:i}=dt(),{filters:s,handleKeyword:n}=r,[o,a]=q.useState(s.keyword||""),d=rs(n,{wait:300}),h=j=>{const{value:m}=j.target;a(m),d.run(m)},u=()=>{a(""),n("")};q.useEffect(()=>{a(s.keyword||"")},[s.keyword]);const f=e||i("common.searchPlaceholder");return l.jsx(jh,{inputProps:{"data-cy":"search-blocklet"},startAdornment:l.jsx(ki,{position:"start",children:l.jsx(Oh,{sx:{fontSize:18,ml:-.5}})}),onChange:h,placeholder:f,value:o,title:f,"data-cy":"search",endAdornment:o&&l.jsx(ki,{position:"end",children:l.jsx(Ch,{"data-cy":"search-delete",onClick:u})}),...t})}const jh=Xt(qo)`
|
|
530
|
+
`;function sa(){const{search:e,t}=dt(),{filters:r,handleSort:i,handlePrice:s}=e,n=ea(t);return l.jsxs(ut,{direction:{xs:"row",md:"column"},sx:{alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between"},children:[l.jsx(Jr,{control:l.jsx(Qr,{checked:r.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:o=>s(o.target.checked?"free":"")}),label:t("blocklet.free")}),l.jsx(Xr,{value:r.sortBy||n[0].value,options:n,onChange:o=>i(o),placeholder:t("sort.sort")})]})}function vh({menus:e=[]}){const{selectedCategory:t,search:r,t:i,categoryOptions:s,loadings:n,layout:o,baseSearch:a,compact:d}=dt(),{filters:h,handleActiveMenu:u,handleCategory:f,cleanFilter:j}=r,{toggleOpen:m}=hi();q.useEffect(()=>{m(!1)},[Object.values(h).join("")]);const E=nh(a,o.showSearch,h.keyword);return o.showCategory&&!d?l.jsxs(fh,{children:[l.jsx(fi,{xs:l.jsxs(ut,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[l.jsx(oa,{onClick:()=>m(!1),children:l.jsx(Uo,{})}),l.jsx(je,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:i("common.category")})]}),md:null}),l.jsx(ut,{visibility:n.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:E?l.jsxs(l.Fragment,{children:[o.showExplore&&l.jsxs(oe,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[l.jsxs(oe,{display:"flex",alignItems:"center",gap:1,children:[l.jsx(Ft,{icon:Eu,width:20,height:20}),l.jsx(je,{variant:"body1",color:!t&&!h.menu?"text.primary":"grey.400",fontWeight:!t&&!h.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),j()},children:i("explore.title")})]}),e.map(S=>l.jsxs(oe,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?l.jsx(Ft,{icon:S.icon,width:20,height:20}):S.icon,l.jsx(je,{variant:"body1",color:h.menu===S.key?"text.primary":"grey.400",fontWeight:h.menu===S.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{m(!1),u(S.key),S.onClick?.()},children:S.title})]},S.key))]}),!!s.length&&l.jsx(ut,{gap:2,children:s.map(S=>l.jsx(je,{variant:"body1",title:S.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===S.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===S.value?j():f(S.value),m(!1)},children:S.name},S.value))})]}):l.jsx(sa,{})})]}):null}function pi(){const{endpoint:e,serverVersion:t,storeVersion:r}=dt(),i=na(t,r),s=q.useMemo(()=>Zo({baseURL:e,headers:i}),[e]);return{get:async n=>{const{data:o}=await s.get(n);return o},post:async(n,o)=>{const{data:a}=await s.post(n,o);return a}}}const aa=q.memo(function(e){return l.jsx(oe,{...e,sx:[{height:60,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(e.sx)?e.sx:[e.sx]],children:l.jsx(Tt,{})})});function To({icon:e=null,children:t=null,maxWidth:r=100,title:i=""}){return(t===0||t)&&l.jsxs(ut,{direction:"row",sx:{alignItems:"center",gap:1,maxWidth:r,overflow:"hidden"},children:[e,l.jsx(je,{variant:"body2",title:i||(typeof t=="string"?t:void 0),sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const yh=16/9,Pr=292,Yr=189,zn=336;function bh(){const{t:e,search:t}=dt(),{get:r}=pi(),i=qt(),s=Gt(i.breakpoints.down("md")),n=window.blocklet?.preferences?.homeBanner||[],{data:o=[],error:a,loading:d}=Tn(async()=>{const S=await r(Yn(St.blockletsPath,{didList:n.map(C=>C.did).join(",")}));return S?.dataList?n.map(C=>S.dataList.find(_=>_.did===C.did)):[]});a&&console.error("Get Banner Blocklets error:",a);const h={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!a&&n.length>0?l.jsxs(l.Fragment,{children:[l.jsx(je,{component:"h2",variant:"h2",sx:{mt:{xs:2,md:0},mb:3},children:e("explore.title")}),l.jsx(oe,{sx:{height:{xs:"auto",md:Pr},minHeight:Pr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden"},children:d?l.jsxs(oe,{sx:{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center"},children:[l.jsx(Kt,{variant:"rounded",height:Yr,width:zn}),l.jsxs(oe,{sx:{flex:1,height:"100%"},children:[l.jsx(Kt,{variant:"text",height:50,width:100}),l.jsx(Kt,{variant:"text",height:40,width:"100%"}),l.jsx(Kt,{variant:"text",height:40,width:300}),l.jsxs(oe,{sx:{display:"flex",gap:1,my:2},children:[l.jsx(Kt,{variant:"circular",height:20,width:20}),l.jsx(Kt,{variant:"text",height:20,width:50})]}),l.jsx(Kt,{variant:"rounded",height:30,width:100})]})]}):l.jsx(Id,{showNav:!0,autoPlay:!0,slideDuration:s?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:S=>l.jsx(oe,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Ba,{sx:{...h,left:5}})}),renderRightNav:S=>l.jsx(oe,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Ma,{sx:{...h,right:5}})}),items:n.map((S,C)=>({original:S.did,renderItem:()=>{const _=o[C]||{},N=S.cover||wh(S.did,_.screenshots?.[0]),D=ta(N,i.breakpoints.values.md*2);return l.jsxs(ut,{direction:{xs:"column",md:"row"},onClick:()=>t.handleSearchSelect(_),sx:{height:{xs:"auto",md:Pr},display:"flex",justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},gap:{xs:2,md:5},cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${D}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},children:[u(D),l.jsxs(ut,{sx:{flex:1,height:"100%",gap:3},children:[l.jsxs(oe,{sx:{flex:1},children:[f(S.name||_.title||S.name),j(S.desc||_.description)]}),_.did&&m(_,S.baseNum),E(_)]})]})}}))})})]}):null;function u(S){return l.jsx(oe,{sx:{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:zn}},children:l.jsx(Sh,{url:S})})}function f(S){return l.jsx(je,{variant:"h2",sx:{width:"100%"},children:S})}function j(S){return l.jsx(je,{variant:"body2",sx:{color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:71,pt:1,display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:S})}function m(S,C=0){const{did:_,owner:N,stats:D}=S;return l.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(To,{icon:l.jsx(qn,{src:N.avatar,did:_,size:20,variant:"circle"}),children:N.fullName}),l.jsx(To,{icon:l.jsx(Ft,{icon:Is}),title:`${D.downloads+C}`,children:xh(D.downloads+C)})]})}function E(S){return l.jsx(kn,{variant:"outlined",size:"small",onClick:()=>t.handleSearchSelect(S),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:e("explore.viewDetail")})}}const xh=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,wh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Sh({url:e}){const[t,r]=q.useState(!0);return l.jsxs(l.Fragment,{children:[t&&l.jsx(Kt,{variant:"rectangular",sx:{width:{xs:"100%",md:zn},height:{xs:"auto",md:Yr}}}),l.jsx(oe,{component:"img",src:e,alt:"",onLoad:()=>r(!1),onError:()=>r(!1),sx:{display:t?"none":"block",width:{xs:"100%",md:zn},height:{xs:"auto",md:Yr},borderRadius:2,border:1,borderColor:"divider",objectFit:"container",cursor:"pointer",aspectRatio:yh}})]})}function Eh({title:e,blocklets:t}){const{blockletRender:r,serverVersion:i}=dt();return l.jsxs(oe,{sx:{mt:3},children:[l.jsx(je,{component:"h3",variant:"h3",sx:{mb:2},children:e}),l.jsx(Si,{container:!0,spacing:2,sx:{boxSizing:"border-box",maxWidth:"calc(100vw - 16px)"},children:t.map(s=>l.jsx(Si,{"data-blocklet-did":s.did,sx:{p:"2px"},size:{xs:12,md:6},children:l.jsx(oe,{sx:{padding:"1px"},children:r({blocklet:s,blocklets:t,serverVersion:i})})},s.did))})]})}function kh(){const{get:e}=pi(),{t}=dt(),{data:r=[],error:i,loading:s}=Tn(async()=>{const n=await e(St.explorePath);return Array.isArray(n)?n:[]});return i?l.jsx(Xn,{error:new Error(`Failed to fetch blocklets from ${St.explorePath}`)}):s?l.jsx(aa,{mt:15}):l.jsxs(l.Fragment,{children:[l.jsx(bh,{}),r.map(n=>n.blocklets?.length>0?l.jsx(Eh,{title:t(`explore.${n.type}`),blocklets:n.blocklets},n.type):null)]})}const Lr="__FREE_TEXT__",jo="__NO_RESULT__",_r=40;function la({endpoint:e,t,locale:r,filters:i,handleKeyword:s,handleSearchSelect:n,...o}){const a=q.useRef(null),d=q.useRef(!1),[h,u]=q.useState(!1),[f,j]=q.useState(""),[m,E]=q.useState(!1),S=pi(),[C,_]=q.useState(!1),N=o?.placeholder||t("common.searchStore"),D=async $=>{_(!0);const he=await S.get(Zt(e,Yn(St.blockletsPath,$)));return _(!1),he.dataList||[]},{data:c,run:w}=Tn($=>$?D({sortBy:St.nameDesc,page:1,pageSize:10,keyword:$,showResources:"true"}):Promise.resolve([]),{manual:!0});q.useEffect(()=>{_(!0),w(i.keyword),j(i.keyword||"")},[i.keyword,w]),Qd("ctrl + k, command + k",$=>($.stopPropagation(),$.preventDefault(),a.current?.querySelector("input")?.focus(),!1),{enableOnTags:["INPUT"]});const R=rs($=>w($),{wait:300}),B={name:Lr,title:f,did:""};let M=[];return f&&(C?M=[B]:c?.length?M=[B,...c]:M=[{name:jo,title:t("blocklet.noResults"),did:""}]),l.jsxs(l.Fragment,{children:[l.jsxs(Aa,{fullScreen:!0,open:m,sx:{display:{md:"none"}},children:[l.jsxs(oe,{sx:{p:2,pb:0,display:"flex",alignItems:"center",gap:2},children:[l.jsx(qo,{fullWidth:!0,sx:{bgcolor:"grey.50",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:N,className:"bl-autocomplete-input",value:f,onChange:$=>re($.target.value),startAdornment:A(m),endAdornment:X()}),l.jsx(kn,{variant:"outlined",onClick:()=>{E(!1),j(i.keyword||"")},children:t("common.cancel")})]}),l.jsx(Wo,{sx:{p:.5},children:M.map($=>W($))})]}),l.jsx(oe,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:l.jsx(Ft,{icon:or,style:{fontSize:22,color:"inherit"},onClick:()=>E(!0)})}),l.jsx(No,{ref:a,open:!!f&&h,size:"small",onOpen:()=>u(!0),onClose:($,he)=>{u(!1),he==="selectOption"&&!d.current&&s(f)},onKeyDown:$=>{$.key==="Enter"&&!f&&Z()},disableClearable:!0,inputValue:f,onInputChange:($,he)=>re(he),isOptionEqualToValue:($,he)=>$.name===he.name,getOptionLabel:$=>$.title,getOptionKey:$=>$.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:$=>l.jsx(Vn,{...$,InputProps:{...$.InputProps,autoFocus:!0,placeholder:N,className:"bl-autocomplete-input",value:f,startAdornment:A(h),endAdornment:X()}}),filterOptions:$=>$,...o,options:M,renderOption:($,he)=>W(he),value:B,sx:[{bgcolor:"grey.50",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(o.sx)?o.sx:[o.sx]]})]});function re($){_(!0),j($),d.current=!1,R.run($)}function Z(){E(!1),j(""),re(""),s("")}function z($){$?.did?(E(!1),d.current=!0,j(""),n($)):$.name===Lr&&(E(!1),s(f))}function W($){return l.jsxs(Zr,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>z($),children:[H($),l.jsxs(je,{variant:"body1",children:[l.jsx(je,{sx:{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1},children:$.title}),l.jsx(je,{sx:{fontSize:"13px",color:"text.hint"},children:$.category?.locales?.[r||"en"]||""})]})]},$.did)}function H($){if([Lr,jo].includes($.name))return l.jsx(oe,{sx:{width:_r,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px"},children:l.jsx(Ft,{icon:or,style:{fontSize:28}})});let he="";return $.logo&&(he=Zt(e,"assets",$.did,ta($.logo,_r,$.version))),l.jsx(qn,{src:he,size:_r,style:{borderRadius:"8px",overflow:"hidden"}})}function A($=!0){return l.jsx(oe,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:$&&f&&C?l.jsx(Tt,{color:"inherit",size:16}):l.jsx(Ft,{icon:or,style:{fontSize:16,cursor:"default"}})})}function X(){return f?l.jsx(oe,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:l.jsx(Ft,{icon:$d,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>Z()})}):null}}function Th({placeholder:e,...t}){const{search:r,t:i}=dt(),{filters:s,handleKeyword:n}=r,[o,a]=q.useState(s.keyword||""),d=rs(n,{wait:300}),h=j=>{const{value:m}=j.target;a(m),d.run(m)},u=()=>{a(""),n("")};q.useEffect(()=>{a(s.keyword||"")},[s.keyword]);const f=e||i("common.searchPlaceholder");return l.jsx(jh,{inputProps:{"data-cy":"search-blocklet"},startAdornment:l.jsx(ki,{position:"start",children:l.jsx(Oh,{sx:{fontSize:18,ml:-.5}})}),onChange:h,placeholder:f,value:o,title:f,"data-cy":"search",endAdornment:o&&l.jsx(ki,{position:"end",children:l.jsx(Ch,{"data-cy":"search-delete",onClick:u})}),...t})}const jh=Xt(qo)`
|
|
531
531
|
background-color: ${e=>e.theme.palette.grey[50]};
|
|
532
532
|
font-size: 14px;
|
|
533
533
|
border-radius: 6px;
|
|
@@ -550,11 +550,11 @@ 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 Ih(){const{search:e,t,endpoint:r,locale:i,getCategoryLocale:s,developerName:n,showResourcesSwitch:o,layout:a,baseSearch:d,categoryOptions:h,compact:u}=dt(),{filters:f,handleSort:j,handlePrice:m,handleDeveloper:E,handleSwitchShowResources:S,cleanFilter:C,handleCategory:_}=e,N=ea(t);return l.jsxs(ut,{className:"filter-bar",direction:{xs:"column",md:"row"},spacing:{xs:1,md:0},sx:{position:"sticky",top:0,zIndex:1e3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,pt:{xs:2,md:0},px:0,pb:u?2:3,backgroundColor:"background.default"},children:[!u&&l.jsx(je,{variant:"h2",sx:{textTransform:"capitalize"},children:s(f.category)}),l.jsxs(ut,{direction:"row",sx:{flex:1,alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2},children:[a.showSearch?l.jsx(oe,{sx:{flex:1,flexBasis:{xs:"100%",md:"auto"}},children:d?l.jsx(Th,{}):l.jsx(la,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,f.owner&&n&&l.jsx(Ei,{label:t("blocklet.authorTag",{name:n}),size:"small",onDelete:()=>E("")}),f.resourceDid&&f.resourceBlocklet&&l.jsx(Ei,{label:t("blocklet.resourceTag",{name:f.resourceBlocklet}),size:"small",onDelete:()=>C(["resourceDid","resourceBlocklet","showResources"])}),o?l.jsx(Oo,{checked:f.showResources!=="false",onChange:D=>S(D?"true":"false"),label:t("common.showResources")}):null,l.jsx(Oo,{checked:f.price==="free",onChange:D=>m(D?"free":""),label:t("blocklet.free")}),u&&l.jsx(oe,{children:l.jsx(Xr,{value:f.category||h[0]?.value,options:h,placeholder:t("common.category"),onChange:D=>_(D)})}),l.jsx(Xr,{value:f.sortBy||N[0].value,options:N,placeholder:t("sort.sort"),onChange:D=>j(D)})]})]})}function Oo({checked:e,onChange:t,label:r}){const i=qt();return l.jsx(Jr,{sx:{m:0,p:0},className:"check-button",control:l.jsx(Qr,{checked:e,icon:l.jsx(Ft,{style:{padding:0,color:i.palette.text.secondary},icon:Bd}),checkedIcon:l.jsx(Ft,{style:{padding:0,color:i.palette.primary.main},icon:Fd}),size:"large",sx:{p:0,mr:1},onChange:s=>t(s.target.checked)}),label:r})}function Mn({children:e}){return l.jsxs(oe,{sx:{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint"},children:[l.jsx(dl,{}),e]})}function Co(){const{t:e}=dt();return l.jsx(je,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Nr({filterTip:e=!1,keywordTip:t=!1}){const{t:r,locale:i}=dt(),s=()=>i==="zh"?"、":" , ";return l.jsxs(oe,{sx:{mt:1,display:"flex"},children:[l.jsx(je,{style:{marginRight:"16px"},children:r("blocklet.emptyTip")}),e&&l.jsx(je,{children:r("blocklet.filterTip")}),e&&t&&s(),t&&l.jsx(je,{children:r("blocklet.keywordTip")})]})}function Ar({primaryStart:e,primaryEnd:t,filter:r}){return l.jsxs(je,{variant:"subtitle2",sx:{display:"flex",gap:.5,mx:.5},children:[l.jsx(je,{children:e}),l.jsx(je,{title:r,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r}),l.jsxs(je,{children:[t," "]})]})}function Rh(){const{t:e,search:t,getCategoryLocale:r,selectedCategory:i}=dt(),{filters:s}=t,n=!!i||!!s.price;if(s.keyword&&n)return l.jsxs(Mn,{children:[l.jsx(Ar,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Nr,{keywordTip:!0,filterTip:!0})]});if(s.keyword)return l.jsxs(Mn,{children:[l.jsx(Ar,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Nr,{keywordTip:!0})]});if(n){const o=r(i);return l.jsxs(Mn,{children:[o?l.jsx(Ar,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:o}):l.jsx(Co,{}),l.jsx(Nr,{filterTip:!0})]})}return l.jsx(Mn,{children:l.jsx(Co,{})})}const Ph=(e,t,r,i)=>Jl(async s=>{s||(r.currentPage=r.defaultCurrentPage);const{currentPage:n,pageSize:o}=r,a={...t,category:t.category==="All"?"":t.category,sortBy:St[t.sortBy],page:n,pageSize:o};i(null);const{data:d={}}=await e.get(St.blockletsPath,{params:a});return r.currentPage++,{page:n,pageSize:o,list:d?.dataList||[],total:d?.total||0}},{isNoMore:s=>s?s.page*s.pageSize>=s.total:!1,reloadDeps:[e,ul(t)],onError:i});function Lh(){const{storeApi:e,search:t,extraFilter:r,errors:i,updateDeveloperName:s}=dt(),{filters:n}=t,o=Yl({currentPage:St.currentPage,pageSize:ah()?St.mobilePageSize:St.pageSize,defaultCurrentPage:St.defaultCurrentPage}),[a,d]=q.useState(null),h=Ph(e,n,o,d),u=q.useMemo(()=>r?r(h.data?.list||[]):h.data?.list||[],[h.data,r]);return q.useEffect(()=>{const f=u.find(j=>j.owner.did===n.owner);s(f?.owner.fullName||f?.author.name||"")},[n.owner,u,s]),{blocklets:u,fetchBlockletsError:a,loadMore:h.loadMore,hasNextPage:!h.noMore,total:h.data?.total||0,loadings:{fetchBlockletsLoading:h.loading,loadingMore:h.loadingMore},errors:{...i,fetchBlockletsError:a}}}function _h(){const{t:e,search:t,endpoint:r,blockletRender:i,serverVersion:s,minItemWidth:n,layout:o,baseSearch:a,compact:d}=dt(),{filters:h}=t,{blocklets:u,errors:f,loadMore:j,loadings:m,hasNextPage:E,total:S}=Lh(),[C]=Md({loading:m.fetchBlockletsLoading||m.loadingMore,hasNextPage:E,onLoadMore:j});if(f.fetchBlockletsError){const c=new Error(`Failed to fetch blocklets from ${r}: ${oh(f.fetchBlockletsError)}`);return l.jsx(Hn,{error:c})}const _=a&&o.showSearch||!h.keyword;return l.jsxs(l.Fragment,{children:[_?l.jsx(Ih,{}):l.jsxs(l.Fragment,{children:[l.jsx(fi,{xs:l.jsx(sa,{}),md:null}),D()]}),N(),!m.fetchBlockletsLoading&&E&&l.jsx(oe,{ref:C,sx:{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden"},children:m.loadingMore?l.jsx(Tt,{}):null})]});function N(){return m.fetchBlockletsLoading?l.jsx(aa,{mt:15}):u.length?l.jsx(oe,{className:"blocklet-list",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${n}px, 1fr))`},p:"2px",rowGap:2,columnGap:d?0:2},children:u.map(c=>l.jsx(oe,{"data-blocklet-did":c.did,sx:{minWidth:{xs:"100%",sm:n},maxWidth:"calc(100vw - 32px)"},children:i({blocklet:c,blocklets:u,serverVersion:s})},c.did))}):l.jsx(Rh,{})}function D(){return l.jsxs(ut,{direction:"row",className:"search-result-title",sx:{alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0}},children:[l.jsx(je,{variant:"h3",title:h.keyword,sx:{maxWidth:"50vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:h.keyword})}),l.jsx(je,{variant:"body1",sx:{color:"text.hint",fontSize:13},children:e("blocklet.resultCount",{count:S})})]})}}function Nh(){const{t:e,selectedCategory:t,getCategoryLocale:r,locale:i,search:s}=dt(),{toggleOpen:n}=hi(),o=cl().arcSphere,a=!!window.blocklet?.navigation?.some(d=>d.section==="bottomNavigation");return l.jsxs(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs(je,{variant:"body1",sx:{display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium"},children:[l.jsx(oa,{onClick:()=>n(!0),children:l.jsx(Na,{})}),r(t)||e("common.category")]}),o&&a&&l.jsx(la,{locale:i,endpoint:window.blocklet?.prefix||"/",sx:{display:{md:"block",xs:"none"},mr:1,width:"350px"},t:e,filters:s.filters,handleKeyword:s.handleKeyword,handleSearchSelect:s.handleSearchSelect})]})}function Ah({menus:e=[],children:t=void 0}){const{search:r,layout:i,compact:s}=dt(),{filters:n}=r,o=q.useRef(null),a=n.category||n.keyword||n.price,d=e.find(h=>h.key===n.menu)?.key;return l.jsx(Zd,{children:l.jsxs(Jo,{FallbackComponent:Hn,children:[!s&&l.jsx(Nh,{}),l.jsxs(oe,{ref:o,className:"list-container",sx:{display:"flex",height:"100%",pt:{xs:0,md:s?0:5}},children:[l.jsx(vh,{menus:e}),l.jsxs(ut,{sx:[{height:"100%",position:"relative",flex:1},s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"}],children:[d&&t?.(d),!d&&(i.showExplore&&!a?l.jsx(kh,{}):l.jsx(_h,{}))]})]})]})})}function Dh(e){const{menus:t,children:r,...i}=e,s=qt(),n=Fo(vl({},s,{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 l.jsx($o,{theme:n,children:l.jsx(hh,{...i,children:l.jsx(Ah,{menus:t,children:r})})})}const Mh={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"/>'},Bh={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>'},Fh={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>'},$h={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"/>'},Uh=(e,t)=>!t||!e?!0:Mr.satisfies(Mr.coerce(e),t);function ca({children:e,serverVersion:t="",requirementVersion:r="",...i}){const{t:s}=wt();return Uh(t,r)?e:l.jsx(Bo,{title:s("store.tooltip.upgradeServer",{serverVersion:t,version:r}),arrow:!0,children:l.jsx(je,{children:l.jsx(kn,{disabled:!0,variant:"outlined",...i,children:s("common.upgradeServer")})})})}ca.propTypes={children:F.node.isRequired,serverVersion:F.string,requirementVersion:F.string};const qh=(e,t)=>Zt(t,`/blocklets/${e.did}`),Io=({blocklet:e,attribute:t,value:r})=>e._formatted?e._formatted[t]:r,Wh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1;function ua({blocklet:e,blocklets:t=[],handleButtonClick:r=null,endpoint:i="",serverVersion:s=""}){const{t:n}=wt();let o=Zt(i,Nl(e.did,e.logo||""));try{const C=new URL(o);C.searchParams.set("v",e.version||+new Date),o=C.href}catch{}const[a,d]=q.useState(!1),h=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:t})}catch(C){Kn.error(C.message)}finally{d(!1)}},{blocklet:u}=Yn(),f=()=>(u?.children||[]).find(N=>N.meta.bundleDid===e.did).meta.version,m=(()=>{const C=(u?.children||[]).find(_=>_.meta.bundleDid===e.did);if(C){try{const _=C.meta.version,N=e.version;if(Mr.gt(N,_))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),E=e.requirements?.server,S=[];return m==="upgrade"?S.push({key:"upgrade",icon:l.jsx(bt,{icon:$h,color:"success.light",width:20,height:20},"version"),title:`${f()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:l.jsx(oe,{sx:{fontWeight:"bold"},children:n("blocklet.component.upgradeAvailable")})}):m==="disable"?S.push({key:"disable",icon:l.jsx(bt,{icon:Mh,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:n("blocklet.component.installed")}):Wh(e)&&S.push({key:"purchase",icon:l.jsx(bt,{icon:Bh,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:n("blocklet.component.needBuy")}),l.jsx(zh,{title:Io({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Io({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?o:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:m!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:m==="disable"?void 0:h,icons:e.docker?.image?[{key:"docker",icon:l.jsx(oe,{sx:{display:"flex",color:"primary.main"},children:l.jsx(bt,{icon:Fh})}),title:n("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:n("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:S,button:l.jsx(ca,{serverVersion:s,requirementVersion:E,size:"small",children:l.jsx("div",{style:{display:"flex",alignItems:"center"},children:l.jsx(xu,{children:l.jsx(yt,{size:"small",disabled:a,variant:"outlined",color:"primary",onClick:C=>{C.preventDefault(),C.stopPropagation();const _=qh(e,i);_&&window.open(_,"_blank","noopener,noreferrer")},children:n("common.detail")},e.did)})})})})}ua.propTypes={blocklet:F.object.isRequired,blocklets:F.array,handleButtonClick:F.func,endpoint:F.string,serverVersion:F.string};function da({handleButtonClick:e=null,handleSearchSelect:t=null,storeUrl:r,handleBlockletRender:i=null,extraFilter:s=void 0,serverVersion:n="",resourceType:o="",resourceDid:a="",showResourcesSwitch:d=!0,showCategory:h=!0,compact:u=!1,...f}){const j=qt(),{locale:m}=wt(),[E,S]=q.useState(!1),[C,_]=q.useState({}),N=w=>{_(w)},D=r,c=q.useMemo(()=>Fo(j,{palette:{background:{default:j.palette.background.paper}}}),[j]);return q.useEffect(()=>{_({showResources:!0,resourceType:o,resourceDid:a})},[D,o,a]),q.useEffect(()=>{S(!0),_({showResources:!0,resourceType:o,resourceDid:a})},[]),l.jsx($o,{theme:c,children:l.jsx(Jo,{FallbackComponent:Hn,resetKeys:[D],children:l.jsxs(oe,{...f,sx:Xo({overflow:"auto",".title-bar + div":{height:"unset"}},f.sx),children:[E&&l.jsx(Dh,{showCategory:h,showResourcesSwitch:d,blockletRender:w=>{const R={...w,handleButtonClick:e,endpoint:D};return i({...w,defaultRender:l.jsx(ua,{...R})})},compact:u,minItemWidth:300,baseSearch:!0,endpoint:D,locale:m,onFilterChange:N,onSearchSelect:t,filters:C,extraFilter:s,serverVersion:n,fetchCategoryDelay:500}),l.jsx(oe,{sx:{mt:2},children:" "})]})})})}da.propTypes={storeUrl:F.string.isRequired,handleButtonClick:F.func,handleSearchSelect:F.func,handleBlockletRender:F.func,extraFilter:F.func,serverVersion:F.string,resourceType:F.string,resourceDid:F.string,showResourcesSwitch:F.bool,showCategory:F.bool,compact:F.bool};const zh=it(Su)`
|
|
553
|
+
`;function Ih(){const{search:e,t,endpoint:r,locale:i,getCategoryLocale:s,developerName:n,showResourcesSwitch:o,layout:a,baseSearch:d,categoryOptions:h,compact:u}=dt(),{filters:f,handleSort:j,handlePrice:m,handleDeveloper:E,handleSwitchShowResources:S,cleanFilter:C,handleCategory:_}=e,N=ea(t);return l.jsxs(ut,{className:"filter-bar",direction:{xs:"column",md:"row"},spacing:{xs:1,md:0},sx:{position:"sticky",top:0,zIndex:1e3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,pt:{xs:2,md:0},px:0,pb:u?2:3,backgroundColor:"background.default"},children:[!u&&l.jsx(je,{variant:"h2",sx:{textTransform:"capitalize"},children:s(f.category)}),l.jsxs(ut,{direction:"row",sx:{flex:1,alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2},children:[a.showSearch?l.jsx(oe,{sx:{flex:1,flexBasis:{xs:"100%",md:"auto"}},children:d?l.jsx(Th,{}):l.jsx(la,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,f.owner&&n&&l.jsx(Ei,{label:t("blocklet.authorTag",{name:n}),size:"small",onDelete:()=>E("")}),f.resourceDid&&f.resourceBlocklet&&l.jsx(Ei,{label:t("blocklet.resourceTag",{name:f.resourceBlocklet}),size:"small",onDelete:()=>C(["resourceDid","resourceBlocklet","showResources"])}),o?l.jsx(Oo,{checked:f.showResources!=="false",onChange:D=>S(D?"true":"false"),label:t("common.showResources")}):null,l.jsx(Oo,{checked:f.price==="free",onChange:D=>m(D?"free":""),label:t("blocklet.free")}),u&&l.jsx(oe,{children:l.jsx(Xr,{value:f.category||h[0]?.value,options:h,placeholder:t("common.category"),onChange:D=>_(D)})}),l.jsx(Xr,{value:f.sortBy||N[0].value,options:N,placeholder:t("sort.sort"),onChange:D=>j(D)})]})]})}function Oo({checked:e,onChange:t,label:r}){const i=qt();return l.jsx(Jr,{sx:{m:0,p:0},className:"check-button",control:l.jsx(Qr,{checked:e,icon:l.jsx(Ft,{style:{padding:0,color:i.palette.text.secondary},icon:Bd}),checkedIcon:l.jsx(Ft,{style:{padding:0,color:i.palette.primary.main},icon:Fd}),size:"large",sx:{p:0,mr:1},onChange:s=>t(s.target.checked)}),label:r})}function Mn({children:e}){return l.jsxs(oe,{sx:{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint"},children:[l.jsx(rl,{}),e]})}function Co(){const{t:e}=dt();return l.jsx(je,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Nr({filterTip:e=!1,keywordTip:t=!1}){const{t:r,locale:i}=dt(),s=()=>i==="zh"?"、":" , ";return l.jsxs(oe,{sx:{mt:1,display:"flex"},children:[l.jsx(je,{style:{marginRight:"16px"},children:r("blocklet.emptyTip")}),e&&l.jsx(je,{children:r("blocklet.filterTip")}),e&&t&&s(),t&&l.jsx(je,{children:r("blocklet.keywordTip")})]})}function Ar({primaryStart:e,primaryEnd:t,filter:r}){return l.jsxs(je,{variant:"subtitle2",sx:{display:"flex",gap:.5,mx:.5},children:[l.jsx(je,{children:e}),l.jsx(je,{title:r,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r}),l.jsxs(je,{children:[t," "]})]})}function Rh(){const{t:e,search:t,getCategoryLocale:r,selectedCategory:i}=dt(),{filters:s}=t,n=!!i||!!s.price;if(s.keyword&&n)return l.jsxs(Mn,{children:[l.jsx(Ar,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Nr,{keywordTip:!0,filterTip:!0})]});if(s.keyword)return l.jsxs(Mn,{children:[l.jsx(Ar,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Nr,{keywordTip:!0})]});if(n){const o=r(i);return l.jsxs(Mn,{children:[o?l.jsx(Ar,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:o}):l.jsx(Co,{}),l.jsx(Nr,{filterTip:!0})]})}return l.jsx(Mn,{children:l.jsx(Co,{})})}const Ph=(e,t,r,i)=>Jl(async s=>{s||(r.currentPage=r.defaultCurrentPage);const{currentPage:n,pageSize:o}=r,a={...t,category:t.category==="All"?"":t.category,sortBy:St[t.sortBy],page:n,pageSize:o};i(null);const{data:d={}}=await e.get(St.blockletsPath,{params:a});return r.currentPage++,{page:n,pageSize:o,list:d?.dataList||[],total:d?.total||0}},{isNoMore:s=>s?s.page*s.pageSize>=s.total:!1,reloadDeps:[e,yl(t)],onError:i});function Lh(){const{storeApi:e,search:t,extraFilter:r,errors:i,updateDeveloperName:s}=dt(),{filters:n}=t,o=Yl({currentPage:St.currentPage,pageSize:ah()?St.mobilePageSize:St.pageSize,defaultCurrentPage:St.defaultCurrentPage}),[a,d]=q.useState(null),h=Ph(e,n,o,d),u=q.useMemo(()=>r?r(h.data?.list||[]):h.data?.list||[],[h.data,r]);return q.useEffect(()=>{const f=u.find(j=>j.owner.did===n.owner);s(f?.owner.fullName||f?.author.name||"")},[n.owner,u,s]),{blocklets:u,fetchBlockletsError:a,loadMore:h.loadMore,hasNextPage:!h.noMore,total:h.data?.total||0,loadings:{fetchBlockletsLoading:h.loading,loadingMore:h.loadingMore},errors:{...i,fetchBlockletsError:a}}}function _h(){const{t:e,search:t,endpoint:r,blockletRender:i,serverVersion:s,minItemWidth:n,layout:o,baseSearch:a,compact:d}=dt(),{filters:h}=t,{blocklets:u,errors:f,loadMore:j,loadings:m,hasNextPage:E,total:S}=Lh(),[C]=Md({loading:m.fetchBlockletsLoading||m.loadingMore,hasNextPage:E,onLoadMore:j});if(f.fetchBlockletsError){const c=new Error(`Failed to fetch blocklets from ${r}: ${oh(f.fetchBlockletsError)}`);return l.jsx(Xn,{error:c})}const _=a&&o.showSearch||!h.keyword;return l.jsxs(l.Fragment,{children:[_?l.jsx(Ih,{}):l.jsxs(l.Fragment,{children:[l.jsx(fi,{xs:l.jsx(sa,{}),md:null}),D()]}),N(),!m.fetchBlockletsLoading&&E&&l.jsx(oe,{ref:C,sx:{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden"},children:m.loadingMore?l.jsx(Tt,{}):null})]});function N(){return m.fetchBlockletsLoading?l.jsx(aa,{mt:15}):u.length?l.jsx(oe,{className:"blocklet-list",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${n}px, 1fr))`},p:"2px",rowGap:2,columnGap:d?0:2},children:u.map(c=>l.jsx(oe,{"data-blocklet-did":c.did,sx:{minWidth:{xs:"100%",sm:n},maxWidth:"calc(100vw - 32px)"},children:i({blocklet:c,blocklets:u,serverVersion:s})},c.did))}):l.jsx(Rh,{})}function D(){return l.jsxs(ut,{direction:"row",className:"search-result-title",sx:{alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0}},children:[l.jsx(je,{variant:"h3",title:h.keyword,sx:{maxWidth:"50vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:h.keyword})}),l.jsx(je,{variant:"body1",sx:{color:"text.hint",fontSize:13},children:e("blocklet.resultCount",{count:S})})]})}}function Nh(){const{t:e,selectedCategory:t,getCategoryLocale:r,locale:i,search:s}=dt(),{toggleOpen:n}=hi(),o=nl().arcSphere,a=!!window.blocklet?.navigation?.some(d=>d.section==="bottomNavigation");return l.jsxs(oe,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs(je,{variant:"body1",sx:{display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium"},children:[l.jsx(oa,{onClick:()=>n(!0),children:l.jsx(Na,{})}),r(t)||e("common.category")]}),o&&a&&l.jsx(la,{locale:i,endpoint:window.blocklet?.prefix||"/",sx:{display:{md:"block",xs:"none"},mr:1,width:"350px"},t:e,filters:s.filters,handleKeyword:s.handleKeyword,handleSearchSelect:s.handleSearchSelect})]})}function Ah({menus:e=[],children:t=void 0}){const{search:r,layout:i,compact:s}=dt(),{filters:n}=r,o=q.useRef(null),a=n.category||n.keyword||n.price,d=e.find(h=>h.key===n.menu)?.key;return l.jsx(Zd,{children:l.jsxs(Xo,{FallbackComponent:Xn,children:[!s&&l.jsx(Nh,{}),l.jsxs(oe,{ref:o,className:"list-container",sx:{display:"flex",height:"100%",pt:{xs:0,md:s?0:5}},children:[l.jsx(vh,{menus:e}),l.jsxs(ut,{sx:[{height:"100%",position:"relative",flex:1},s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"}],children:[d&&t?.(d),!d&&(i.showExplore&&!a?l.jsx(kh,{}):l.jsx(_h,{}))]})]})]})})}function Dh(e){const{menus:t,children:r,...i}=e,s=qt(),n=Fo(Cl({},s,{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 l.jsx($o,{theme:n,children:l.jsx(hh,{...i,children:l.jsx(Ah,{menus:t,children:r})})})}const Mh={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"/>'},Bh={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>'},Fh={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>'},$h={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"/>'},Uh=(e,t)=>!t||!e?!0:Mr.satisfies(Mr.coerce(e),t);function ca({children:e,serverVersion:t="",requirementVersion:r="",...i}){const{t:s}=wt();return Uh(t,r)?e:l.jsx(Bo,{title:s("store.tooltip.upgradeServer",{serverVersion:t,version:r}),arrow:!0,children:l.jsx(je,{children:l.jsx(kn,{disabled:!0,variant:"outlined",...i,children:s("common.upgradeServer")})})})}ca.propTypes={children:F.node.isRequired,serverVersion:F.string,requirementVersion:F.string};const qh=(e,t)=>Zt(t,`/blocklets/${e.did}`),Io=({blocklet:e,attribute:t,value:r})=>e._formatted?e._formatted[t]:r,Wh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1;function ua({blocklet:e,blocklets:t=[],handleButtonClick:r=null,endpoint:i="",serverVersion:s=""}){const{t:n}=wt();let o=Zt(i,bl(e.did,e.logo||""));try{const C=new URL(o);C.searchParams.set("v",e.version||+new Date),o=C.href}catch{}const[a,d]=q.useState(!1),h=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:t})}catch(C){Gn.error(C.message)}finally{d(!1)}},{blocklet:u}=Hn(),f=()=>(u?.children||[]).find(N=>N.meta.bundleDid===e.did).meta.version,m=(()=>{const C=(u?.children||[]).find(_=>_.meta.bundleDid===e.did);if(C){try{const _=C.meta.version,N=e.version;if(Mr.gt(N,_))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),E=e.requirements?.server,S=[];return m==="upgrade"?S.push({key:"upgrade",icon:l.jsx(bt,{icon:$h,color:"success.light",width:20,height:20},"version"),title:`${f()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:l.jsx(oe,{sx:{fontWeight:"bold"},children:n("blocklet.component.upgradeAvailable")})}):m==="disable"?S.push({key:"disable",icon:l.jsx(bt,{icon:Mh,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:n("blocklet.component.installed")}):Wh(e)&&S.push({key:"purchase",icon:l.jsx(bt,{icon:Bh,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:n("blocklet.component.needBuy")}),l.jsx(zh,{title:Io({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Io({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?o:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:m!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:m==="disable"?void 0:h,icons:e.docker?.image?[{key:"docker",icon:l.jsx(oe,{sx:{display:"flex",color:"primary.main"},children:l.jsx(bt,{icon:Fh})}),title:n("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:n("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:S,button:l.jsx(ca,{serverVersion:s,requirementVersion:E,size:"small",children:l.jsx("div",{style:{display:"flex",alignItems:"center"},children:l.jsx(xu,{children:l.jsx(yt,{size:"small",disabled:a,variant:"outlined",color:"primary",onClick:C=>{C.preventDefault(),C.stopPropagation();const _=qh(e,i);_&&window.open(_,"_blank","noopener,noreferrer")},children:n("common.detail")},e.did)})})})})}ua.propTypes={blocklet:F.object.isRequired,blocklets:F.array,handleButtonClick:F.func,endpoint:F.string,serverVersion:F.string};function da({handleButtonClick:e=null,handleSearchSelect:t=null,storeUrl:r,handleBlockletRender:i=null,extraFilter:s=void 0,serverVersion:n="",resourceType:o="",resourceDid:a="",showResourcesSwitch:d=!0,showCategory:h=!0,compact:u=!1,...f}){const j=qt(),{locale:m}=wt(),[E,S]=q.useState(!1),[C,_]=q.useState({}),N=w=>{_(w)},D=r,c=q.useMemo(()=>Fo(j,{palette:{background:{default:j.palette.background.paper}}}),[j]);return q.useEffect(()=>{_({showResources:!0,resourceType:o,resourceDid:a})},[D,o,a]),q.useEffect(()=>{S(!0),_({showResources:!0,resourceType:o,resourceDid:a})},[]),l.jsx($o,{theme:c,children:l.jsx(Xo,{FallbackComponent:Xn,resetKeys:[D],children:l.jsxs(oe,{...f,sx:Ho({overflow:"auto",".title-bar + div":{height:"unset"}},f.sx),children:[E&&l.jsx(Dh,{showCategory:h,showResourcesSwitch:d,blockletRender:w=>{const R={...w,handleButtonClick:e,endpoint:D};return i({...w,defaultRender:l.jsx(ua,{...R})})},compact:u,minItemWidth:300,baseSearch:!0,endpoint:D,locale:m,onFilterChange:N,onSearchSelect:t,filters:C,extraFilter:s,serverVersion:n,fetchCategoryDelay:500}),l.jsx(oe,{sx:{mt:2},children:" "})]})})})}da.propTypes={storeUrl:F.string.isRequired,handleButtonClick:F.func,handleSearchSelect:F.func,handleBlockletRender:F.func,extraFilter:F.func,serverVersion:F.string,resourceType:F.string,resourceDid:F.string,showResourcesSwitch:F.bool,showCategory:F.bool,compact:F.bool};const zh=it(Su)`
|
|
554
554
|
.ms-highlight {
|
|
555
555
|
color: ${e=>e.theme.palette.primary.main};
|
|
556
556
|
}
|
|
557
|
-
`;function ha({ref:e=null,meta:t=null,isMobile:r,onStepChange:i}){const s=qt(),{steps:n,activeStep:o,setActiveStepByKey:a,setActiveStepByIndex:d}=
|
|
557
|
+
`;function ha({ref:e=null,meta:t=null,isMobile:r,onStepChange:i}){const s=qt(),{steps:n,activeStep:o,setActiveStepByKey:a,setActiveStepByIndex:d}=kl(),{t:h,locale:u}=wt(),f=n[o];return q.useEffect(()=>{i(o)},[i,o]),q.useImperativeHandle(e,()=>({setActiveStepByKey:a,setActiveStepByIndex:d})),l.jsx(Kh,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:l.jsx(Tl,{locale:u,blockletMeta:{title:" ",...t},pcWidth:"100%",pcHeight:"100%",logoUrl:t&&t.logo&&t.registryUrl?xl({did:t.did,version:t.version,baseUrl:t.registryUrl,logoPath:t.logo}):null,theme:s,stepTip:h("blocklet.component.add"),children:l.jsx(Vh,{children:typeof f?.body=="function"?f.body():f?.body})})})}ha.propTypes={ref:F.any,meta:F.any,onStepChange:F.func.isRequired,isMobile:F.bool.isRequired};const Ro=e=>e.isMobile?`
|
|
558
558
|
height: calc(100vh - 56px - 64px - 48px);
|
|
559
559
|
`:"",Vh=it.div`
|
|
560
560
|
width: 100%;
|
|
@@ -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
|
-
`,
|
|
575
|
+
`,Kh=it(oe)`
|
|
576
576
|
${({className:e})=>e==="mobileStyle"?`
|
|
577
577
|
& > div{
|
|
578
578
|
height: 100%;
|
|
@@ -695,7 +695,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
695
695
|
& .connect {
|
|
696
696
|
background: white;
|
|
697
697
|
}
|
|
698
|
-
`,Kh=(e,t)=>(e?.children||[]).find(r=>r.mountPoint===t)?.meta,Hh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1,Xh=e=>[Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Dr=e=>e?.configs?.find(t=>t.key===Bt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,Yh=e=>(e.environments||[]).some(t=>t.required),Po=(e,t)=>e?.some(r=>r.required&&!t[r.key]),Jh=({params:e,blocklet:t,t:r})=>{const i=e.title||e.name;return i?(t?.children||[]).find(n=>n.meta.bundleDid===e.bundleDid)?r("blocklet.component.upgradeNext",{name:i}):r("blocklet.component.addNext",{name:i}):r("common.next")},Lo=({componentDid:e,timeout:t=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},t)};function Qh({onClose:e=()=>{},mode:t="normal",stores:r=[],resourceType:i="",resourceDid:s="",storageKey:n="",inDialog:o=!0,selectedMeta:a=null,storeUrl:d="",showResourcesSwitch:h=!0,showFromUrl:u=!0,enableRunBackground:f=!0,showCategory:j=!0,installFromUrlParams:m=null}){const{t:E,locale:S}=wt(),[C,_]=q.useState(!1),[N,D]=q.useState(null),[c,w]=q.useState(""),[R,B]=q.useState(""),{api:M,ws:{useSubscription:re},inService:Z,info:z}=ln(),{blocklet:W,actions:{refreshBlocklet:H}}=Yn(),[A,X]=q.useState(null),[$,he]=q.useState(!1),Oe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[G,we]=q.useState(Oe),[de,Le]=q.useState(0),ve=q.useRef({}),_e=q.useRef({}),Pe=q.useRef({}),He=Kt(ee=>ee.breakpoints.down("md")),et=Ja(),[ht,Ze]=q.useState(!0),{meta:te}=ve.current,Ne=os(te),ye=q.useRef(!1),Be=ee=>we(O=>({...O,...ee}));q.useEffect(()=>{if(G.pathPrefix){const{errMsg:ee}=at({...G,pathPrefix:G.pathPrefix,locale:S});w(ee)}},[G.pathPrefix]),q.useEffect(()=>{de===0&&we(Oe)},[de]);const jt=()=>{const ee=Dr(W)??"";Be({didSpaceEndpoint:ee})},Ot=()=>ve?.current?.meta?$t.getDisplayName(ve.current):"",Me=()=>{_(!1),we({}),ye.current=!1,ve.current={},e()},Ct=ee=>{const O=Ie=>{Be({installResultProps:{variant:"error",title:Ot(),subTitle:ee,footer:l.jsx(yt,{className:"bottom-button",disabled:Ie,"data-cy":"retry-install-component",onClick:async()=>{O(!0),await Nt(ve.current.installInput)},children:l.jsxs(oe,{sx:{display:"flex",alignItems:"center"},children:[Ie&&l.jsx(Tt,{size:16,style:{marginRight:8}}),E("common.retry")]})})}})};O()},Et=ee=>O=>{(O?.meta?.did||O?.meta)===W?.meta?.did&&ee(O)},_t=()=>{Lo({timeout:0,componentDid:et.componentDid,manual:!0}),Me(),setTimeout(()=>{const ee=document.getElementsByClassName("dashboard-main")[0];ee&&(ee.scrollTop=ee.scrollHeight)},200)};re(Bt.BlockletEvents.componentInstalled,Et(()=>{Be({installResultProps:{variant:"success",title:Ot(),subTitle:E("blocklet.component.installSuccessTip")}}),Lo({componentDid:et.componentDid})}),[W?.meta?.did]),re(Bt.BlockletEvents.statusChange,Et(()=>{const ee=Dr(W);Be(O=>({...O,didSpaceEndpoint:ee}))}),[W?.meta?.did]),re(Bt.BlockletEvents.downloadFailed,Et(()=>{ye.current=!1,Ct(E("blocklet.component.installComponentError"))}),[W?.meta?.did]),re(Bt.BlockletEvents.installFailed,Et(()=>{ye.current=!1,Ct(E("blocklet.component.installComponentError"))}),[W?.meta?.did]);const Ye=[],It=ee=>(W?.children||[]).find(O=>O.meta.did===ee),Nt=async ee=>{ye.current=!0;const{pathPrefix:O,bundleDid:Ie,title:Re,componentName:Fe="",componentDid:p=""}=G,x=ve.current?.meta||{},{configs:k=[],registryUrl:L,inStore:U,inputUrl:ne,dist:le}=x,Se=ve.current?.downloadTokenList,be=ne||(U?Ri(L,Ie,le):"");_(!0);const $e={rootDid:W.meta.did,url:be,mountPoint:O?In(O):`/${In(x.title||x.name)}`,title:Re,name:Fe,did:G.isUpload&&G.upgradeDid?G.upgradeDid:p,dist:{tarball:"",integrity:""},onlyRequired:!ht,...G.hasEnvironmentsStep&&k.length>0?{configs:k.map(ze=>({...ze,value:G.configsValue[ze.key]||""}))}:{},...Se?{downloadTokenList:Se}:{},...ee};try{if(await M.installComponent({input:$e}),L){const{teamDid:ze,storeList:Ue}=ts({fromBlocklet:Z,nodeInfo:z,blocklet:W}),{isNew:Ve,decoded:lt}=Ml(L,Ue);Ve&&await M.addBlockletStore({input:{teamDid:ze,url:lt}})}Be({installResultProps:{}}),H({showError:!1,attachRuntimeInfo:!1})}catch(ze){const Ue=Br(ze);Kn.error(Ue),console.error("installComponent error: ",ze),Ct(Ue)}finally{_(!1),ve.current.installInput=$e}},at=ee=>{const O=rc({params:{...ee,did:ee.bundleDid},blocklets:[W],blocklet:W,locale:S,isUpload:G.isUpload});let Ie=O;const Re=Kh(W,G.pathPrefix);if(O==="overwrite"&&Re&&Re.did!==ee.bundleDid?(Be({upgradeDid:Re.did}),Ie=""):(Be({upgradeDid:""}),Ie=O),Ie){const Fe=It(ee.bundleDid),p=ic({params:{...ee,did:ee.bundleDid},blocklet:W});if(Fe&&Fe.mountPoint===p)return{errMsg:""}}return{errMsg:Ie}},qe=async ee=>{const{errMsg:O}=at({...G,locale:S});w(O),de===Ye.length-2&&!ye.current&&await Nt(ee),_e.current?.setActiveStepByIndex?.(Ie=>Ie+1)},tt=()=>{_e.current?.setActiveStepByIndex?.(ee=>ee-1)},ot=()=>{const{pathPrefix:ee,bundleDid:O,title:Ie,componentName:Re="",componentDid:Fe=""}=G,{meta:p={}}=ve.current||{},{registryUrl:x,inStore:k,inputUrl:L,dist:U}=p,ne=k?Ri(x,O,U):L;X({meta:p,installOpts:{type:"component",rootDid:W.meta.did,mountPoint:ee,url:ne,title:Ie,name:Re,did:Fe}})},mt=ee=>{he(!1),Be({purchaseResultProps:{variant:"error",title:Ot(),subTitle:ee,style:{paddingTop:120},footer:l.jsx(yt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Be({purchaseResultProps:{}})},children:E("common.retry")})}})},V=({downloadTokenList:ee})=>{ve.current.downloadTokenList=ee,he(!1),qe()},ae=({chooseParams:ee=ve.current,componentDid:O,isInit:Ie=!1,isUpload:Re=!1})=>{const{meta:Fe,registryUrl:p,inStore:x,inputUrl:k}=ee,{did:L,title:U,name:ne}=Fe,le=(W.settings?.children||[]).filter(st=>st.status==="deleted"&&st.meta.bundleDid===L),Se=O||"",be=Fe.environments?.map(st=>{const{name:un,validation:Wt,...tn}=st,At={validation:Tl(Wt)?"":Wt};return{...tn,key:un,...At}});ve.current={...ee,meta:{...Fe,configs:be,registryUrl:p,inStore:x,inputUrl:k}};let $e={};if(Ie){const st=[W],un=be||[],Wt=[],tn=es(kl([...un,...Wt]),"key").filter(Dt=>!!Dt.key).sort((Dt,nn)=>Dt.required&&!nn.required?-1:nn.required&&!Dt.required?1:0),At=$t.getSharedConfigObj(st[0],{configs:tn}),Yt={},dn=tn.map(Dt=>{const{default:nn,key:rn,...jn}=Dt;return Yt[rn]=At[rn]||nn,{...jn,key:rn,hidden:!!Bt.BLOCKLET_CONFIGURABLE_KEY[rn]}});$e={...$e,configsList:dn,configsValue:Yt,hasMissRequiredConfigs:Po(dn,Yt)}}const ze=W.children.some(st=>st.mountPoint==="/"),Ue=le.find(st=>st.meta.bundleDid===L),Ve=W.children.find(st=>st.meta.bundleDid===L);$e.title=U||"",Ue?$e={...$e,pathPrefix:Ue.mountPoint||"",componentName:Ue.meta.name,hasEnvironmentsStep:!1}:Ve?$e={...$e,pathPrefix:Ve.mountPoint||"",componentName:Ve.meta.name,hasEnvironmentsStep:!1}:$e={...$e,pathPrefix:ze?`/${In(U)||In(ne)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:ve.current.meta?.environments?.length>0};const lt=Hh(ve.current.meta),cn=Xh(ve.current.meta),er=Dr(W);Be({bundleDid:L,componentDid:Se,...$e,hasRequiredEnvironments:Yh(ve.current.meta),requirePurchase:lt,didSpaceIsRequiredSetup:cn,didSpaceEndpoint:er,isUpload:Re}),Ie&<&&ot()};q.useEffect(()=>{if(!a&&!m?.meta||de!==0||!W)return;const{meta:ee,inputUrl:O="",inStore:Ie=!0,registryUrl:Re="",isUpload:Fe=!1}=m||{};ae({chooseParams:{blocklets:[a||ee],meta:a||ee,registryUrl:Re||d||a.homepage,inStore:Ie,inputUrl:O},isInit:!0,isUpload:Fe}),Be({showFromUrlDialog:!1}),qe()},[a,de,W,m]),Ye.push({key:"selectComponent",name:E("blocklet.component.selectComponent"),body:l.jsxs(Qt,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[u&&G.showFromUrlDialog&&l.jsx(Ss,{mode:"component",onCancel:()=>{Be({showFromUrlDialog:!1})},onSuccess:({meta:ee,inputUrl:O,inStore:Ie,registryUrl:Re})=>{ae({chooseParams:{meta:ee,inputUrl:O,inStore:Ie,registryUrl:Re},isInit:!0}),Be({showFromUrlDialog:!1}),qe()},handleText:{title:E("blocklet.component.addComponentTip.fromUrl"),confirm:E("blocklet.component.choose")}}),l.jsx(Cs,{stores:r,extra:Go.isInServerlessMode(z)?null:u?l.jsxs(yt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Be({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[l.jsx(Ga,{style:{fontSize:20,marginRight:4}}),E("blocklet.component.addComponentTip.fromUrl")]}):null,loading:C,onChange:()=>{we({}),ve.current={}},storageKey:n,children:({currentRegistry:ee})=>l.jsx(da,{showResourcesSwitch:h,showCategory:j,serverVersion:z?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:ee.url,resourceType:i,resourceDid:s,handleButtonClick:O=>{ae({chooseParams:{...O,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:O,defaultRender:Ie})=>{const Re=G?.bundleDid&&G?.bundleDid===O?.did;return l.jsxs(ef,{children:[l.jsx(oe,{className:Re?"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",...Re?{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:Ie}),Re&&l.jsx(oe,{className:"check-container",children:l.jsx(zo,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:E("common.cancel"),confirm:Jh({params:G,blocklet:W,t:E}),onCancel:Me,onConfirm:()=>{qe()}}),Ye.push({key:"agreement",name:E("launchBlocklet.introduction"),body:l.jsxs(Qt,{component:"div",className:"agreement-wrapper",children:[l.jsx(Zo,{title:E("launchBlocklet.introduction"),subTitle:E("blocklet.component.addComponentTip.introduction")}),te?l.jsx(fs,{meta:te,onClickNext:qe,installRelated:ht,onChangeInstallRelated:Ze,handleDescEle:l.jsx("p",{children:E("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:a?void 0:E("common.pre"),disabled:!Ne,confirm:E(Ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:a?Me:tt,onConfirm:()=>{he(!1),qe()}}),te&&G.requirePurchase&&Ye.push({key:"purchase",name:l.jsxs(l.Fragment,{children:[E("common.verifyNFT"),l.jsx(ir,{})]}),body:l.jsxs(Qt,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(Pe.current?.getCurrentStep?.()===2||$)&&l.jsx(Bn,{title:E("common.verifyNFT"),subTitle:E("blocklet.component.addComponentTip.verifyNFT")}),yn(G.purchaseResultProps)?A&&l.jsx(Ts,{ref:Pe,meta:A.meta,mode:G.componentDid?"verify":"both",onCancel:mt,installOpts:A.installOpts,handlePaySuccess:V}):l.jsx("div",{className:"flex-align-center flex-justify-center",children:l.jsx(Ci,{...G.purchaseResultProps})})]}),disabled:Pe.current?.getCurrentStep?.()===2||$,cancel:E("common.pre"),confirm:E("common.next"),onConfirm:()=>{typeof Pe.current.onNext=="function"&&(Pe.current.onNext(),he(!0))},onCancel:()=>{tt()}}),$t.hasStartEngine(te)&&jl.hasMountPoint(te)?Ye.push({key:"config",name:E("common.config"),error:c,body:l.jsxs(Qt,{component:"div",children:[l.jsx(Bn,{title:E("common.config"),subTitle:E("blocklet.component.addComponentTip.config")}),l.jsx(Vn,{label:E("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:R||E("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:G.pathPrefix,onChange:ee=>{const O=ee.target.value;Be({pathPrefix:O}),B(E("common.slugifyHint",{value:Dl(O)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!c&&l.jsx(Mo,{severity:"error",style:{width:"100%",marginTop:8},children:c})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:tt,onConfirm:()=>{qe()}}):te&&(G.pathPrefix=te.interfaces?.[0]?.path||`/${te.did}`),te&&G?.hasEnvironmentsStep&&Ye.push({key:"environment",name:l.jsxs(l.Fragment,{children:[E("common.environment")," ",G.hasRequiredEnvironments&&l.jsx(ir,{})]}),disabled:!!N||G?.hasMissRequiredConfigs,body:()=>l.jsxs(Qt,{component:"div",style:{overflowY:"auto"},children:[l.jsx(Bn,{title:E("common.environment"),subTitle:E("blocklet.component.addComponentTip.environment")}),l.jsx($l,{style:{marginTop:-12,width:"100%"},schema:G.configsList,defaultValue:G.configsValue,onChange:(ee,{action:O,currentItem:Ie,allValues:Re})=>{O==="confirm"&&Be({hasMissRequiredConfigs:Po(G.configsList,Re),configsValue:Re}),O==="edit"?D(Ie):["cancel","confirm"].includes(O)&&D(null)}})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:tt,onConfirm:qe}),te&&G?.didSpaceIsRequiredSetup&&Ye.push({key:"didSpace",name:l.jsxs(l.Fragment,{children:[E("blocklet.component.didSpaceConfig")," ",G.didSpaceIsRequiredSetup==="required"&&l.jsx(ir,{})]}),disabled:G?.didSpaceIsRequiredSetup&&!G.didSpaceEndpoint,body:()=>l.jsx(Fl,{children:l.jsxs(Qt,{component:"div",children:[l.jsx(Bn,{title:E("blocklet.component.didSpaceConfig"),subTitle:E("blocklet.component.didSpaceConfigTip")}),l.jsx(oe,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:l.jsx(Os,{blockletMeta:ve.current.meta,onNext:()=>{qe()},onEndpointUpdate:jt})})]})}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:tt,onConfirm:qe}),Ye.push({key:"install",name:It(te?.did)?E("common.upgrade"):E("common.install"),disabled:f?!1:yn(G.installResultProps),loading:f?!1:yn(G.installResultProps),body:l.jsx(Qt,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:yn(G.installResultProps)?l.jsx(hl,{message:l.jsx(tf,{children:E(f?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):l.jsx("div",{style:{marginTop:120},children:l.jsx(Ci,{...G.installResultProps})})}),confirm:E("common.complete"),onConfirm:_t});const me=Ye[de]||{},Ce=()=>C||me.error||!G.bundleDid?!0:de>1?!G.pathPrefix:!1;return W?l.jsxs(Zh,{sx:o?{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:[l.jsx(ml,{steps:Ye,mode:"memory",children:l.jsx(ha,{ref:_e,meta:te,isMobile:He,onStepChange:ee=>{Le(ee)}})}),l.jsxs(oe,{className:"action-bar",children:[me.cancel&&l.jsx(yt,{onClick:ee=>{ee.stopPropagation(),me.onCancel()},disabled:de===Ye.length-2&&C,color:"inherit",children:me.cancel||E("common.cancel")}),me.confirm&&l.jsx(yt,{onClick:ee=>{ee.stopPropagation(),me.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof me.disabled=="boolean"?me.disabled:Ce()),variant:"contained",autoFocus:!0,title:me.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:l.jsxs(oe,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof me.loading=="boolean"?me.loading:C)&&l.jsx(Tt,{style:{marginRight:8},size:16}),l.jsx(oe,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:me.confirm})]})})]})]}):null}Qh.propTypes={onClose:F.func,mode:F.oneOf(["normal","embed"]),inDialog:F.bool,stores:F.arrayOf(F.string),storeUrl:F.string,resourceType:F.string,resourceDid:F.string,storageKey:F.string,selectedMeta:F.object,showResourcesSwitch:F.bool,showFromUrl:F.bool,enableRunBackground:F.bool,showCategory:F.bool,installFromUrlParams:F.object};const Zh=it(oe)`
|
|
698
|
+
`,Gh=(e,t)=>(e?.children||[]).find(r=>r.mountPoint===t)?.meta,Hh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1,Xh=e=>[Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Dr=e=>e?.configs?.find(t=>t.key===Bt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,Yh=e=>(e.environments||[]).some(t=>t.required),Po=(e,t)=>e?.some(r=>r.required&&!t[r.key]),Jh=({params:e,blocklet:t,t:r})=>{const i=e.title||e.name;return i?(t?.children||[]).find(n=>n.meta.bundleDid===e.bundleDid)?r("blocklet.component.upgradeNext",{name:i}):r("blocklet.component.addNext",{name:i}):r("common.next")},Lo=({componentDid:e,timeout:t=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},t)};function Qh({onClose:e=()=>{},mode:t="normal",stores:r=[],resourceType:i="",resourceDid:s="",storageKey:n="",inDialog:o=!0,selectedMeta:a=null,storeUrl:d="",showResourcesSwitch:h=!0,showFromUrl:u=!0,enableRunBackground:f=!0,showCategory:j=!0,installFromUrlParams:m=null}){const{t:E,locale:S}=wt(),[C,_]=q.useState(!1),[N,D]=q.useState(null),[c,w]=q.useState(""),[R,B]=q.useState(""),{api:M,ws:{useSubscription:re},inService:Z,info:z}=ln(),{blocklet:W,actions:{refreshBlocklet:H}}=Hn(),[A,X]=q.useState(null),[$,he]=q.useState(!1),Oe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[K,we]=q.useState(Oe),[de,Le]=q.useState(0),ve=q.useRef({}),_e=q.useRef({}),Pe=q.useRef({}),He=Gt(ee=>ee.breakpoints.down("md")),et=Ja(),[ht,Ze]=q.useState(!0),{meta:te}=ve.current,Ne=os(te),ye=q.useRef(!1),Be=ee=>we(O=>({...O,...ee}));q.useEffect(()=>{if(K.pathPrefix){const{errMsg:ee}=at({...K,pathPrefix:K.pathPrefix,locale:S});w(ee)}},[K.pathPrefix]),q.useEffect(()=>{de===0&&we(Oe)},[de]);const jt=()=>{const ee=Dr(W)??"";Be({didSpaceEndpoint:ee})},Ot=()=>ve?.current?.meta?$t.getDisplayName(ve.current):"",Me=()=>{_(!1),we({}),ye.current=!1,ve.current={},e()},Ct=ee=>{const O=Ie=>{Be({installResultProps:{variant:"error",title:Ot(),subTitle:ee,footer:l.jsx(yt,{className:"bottom-button",disabled:Ie,"data-cy":"retry-install-component",onClick:async()=>{O(!0),await Nt(ve.current.installInput)},children:l.jsxs(oe,{sx:{display:"flex",alignItems:"center"},children:[Ie&&l.jsx(Tt,{size:16,style:{marginRight:8}}),E("common.retry")]})})}})};O()},Et=ee=>O=>{(O?.meta?.did||O?.meta)===W?.meta?.did&&ee(O)},_t=()=>{Lo({timeout:0,componentDid:et.componentDid,manual:!0}),Me(),setTimeout(()=>{const ee=document.getElementsByClassName("dashboard-main")[0];ee&&(ee.scrollTop=ee.scrollHeight)},200)};re(Bt.BlockletEvents.componentInstalled,Et(()=>{Be({installResultProps:{variant:"success",title:Ot(),subTitle:E("blocklet.component.installSuccessTip")}}),Lo({componentDid:et.componentDid})}),[W?.meta?.did]),re(Bt.BlockletEvents.statusChange,Et(()=>{const ee=Dr(W);Be(O=>({...O,didSpaceEndpoint:ee}))}),[W?.meta?.did]),re(Bt.BlockletEvents.downloadFailed,Et(()=>{ye.current=!1,Ct(E("blocklet.component.installComponentError"))}),[W?.meta?.did]),re(Bt.BlockletEvents.installFailed,Et(()=>{ye.current=!1,Ct(E("blocklet.component.installComponentError"))}),[W?.meta?.did]);const Ye=[],It=ee=>(W?.children||[]).find(O=>O.meta.did===ee),Nt=async ee=>{ye.current=!0;const{pathPrefix:O,bundleDid:Ie,title:Re,componentName:Fe="",componentDid:p=""}=K,x=ve.current?.meta||{},{configs:k=[],registryUrl:L,inStore:U,inputUrl:ne,dist:le}=x,Se=ve.current?.downloadTokenList,be=ne||(U?Oi(L,Ie,le):"");_(!0);const $e={rootDid:W.meta.did,url:be,mountPoint:O?In(O):`/${In(x.title||x.name)}`,title:Re,name:Fe,did:K.isUpload&&K.upgradeDid?K.upgradeDid:p,dist:{tarball:"",integrity:""},onlyRequired:!ht,...K.hasEnvironmentsStep&&k.length>0?{configs:k.map(ze=>({...ze,value:K.configsValue[ze.key]||""}))}:{},...Se?{downloadTokenList:Se}:{},...ee};try{if(await M.installComponent({input:$e}),L){const{teamDid:ze,storeList:Ue}=Qo({fromBlocklet:Z,nodeInfo:z,blocklet:W}),{isNew:Ve,decoded:lt}=Sl(L,Ue);Ve&&await M.addBlockletStore({input:{teamDid:ze,url:lt}})}Be({installResultProps:{}}),H({showError:!1,attachRuntimeInfo:!1})}catch(ze){const Ue=Br(ze);Gn.error(Ue),console.error("installComponent error: ",ze),Ct(Ue)}finally{_(!1),ve.current.installInput=$e}},at=ee=>{const O=rc({params:{...ee,did:ee.bundleDid},blocklets:[W],blocklet:W,locale:S,isUpload:K.isUpload});let Ie=O;const Re=Gh(W,K.pathPrefix);if(O==="overwrite"&&Re&&Re.did!==ee.bundleDid?(Be({upgradeDid:Re.did}),Ie=""):(Be({upgradeDid:""}),Ie=O),Ie){const Fe=It(ee.bundleDid),p=ic({params:{...ee,did:ee.bundleDid},blocklet:W});if(Fe&&Fe.mountPoint===p)return{errMsg:""}}return{errMsg:Ie}},qe=async ee=>{const{errMsg:O}=at({...K,locale:S});w(O),de===Ye.length-2&&!ye.current&&await Nt(ee),_e.current?.setActiveStepByIndex?.(Ie=>Ie+1)},tt=()=>{_e.current?.setActiveStepByIndex?.(ee=>ee-1)},ot=()=>{const{pathPrefix:ee,bundleDid:O,title:Ie,componentName:Re="",componentDid:Fe=""}=K,{meta:p={}}=ve.current||{},{registryUrl:x,inStore:k,inputUrl:L,dist:U}=p,ne=k?Oi(x,O,U):L;X({meta:p,installOpts:{type:"component",rootDid:W.meta.did,mountPoint:ee,url:ne,title:Ie,name:Re,did:Fe}})},mt=ee=>{he(!1),Be({purchaseResultProps:{variant:"error",title:Ot(),subTitle:ee,style:{paddingTop:120},footer:l.jsx(yt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Be({purchaseResultProps:{}})},children:E("common.retry")})}})},V=({downloadTokenList:ee})=>{ve.current.downloadTokenList=ee,he(!1),qe()},ae=({chooseParams:ee=ve.current,componentDid:O,isInit:Ie=!1,isUpload:Re=!1})=>{const{meta:Fe,registryUrl:p,inStore:x,inputUrl:k}=ee,{did:L,title:U,name:ne}=Fe,le=(W.settings?.children||[]).filter(st=>st.status==="deleted"&&st.meta.bundleDid===L),Se=O||"",be=Fe.environments?.map(st=>{const{name:un,validation:Wt,...tn}=st,At={validation:Dl(Wt)?"":Wt};return{...tn,key:un,...At}});ve.current={...ee,meta:{...Fe,configs:be,registryUrl:p,inStore:x,inputUrl:k}};let $e={};if(Ie){const st=[W],un=be||[],Wt=[],tn=ts(Al([...un,...Wt]),"key").filter(Dt=>!!Dt.key).sort((Dt,nn)=>Dt.required&&!nn.required?-1:nn.required&&!Dt.required?1:0),At=$t.getSharedConfigObj(st[0],{configs:tn}),Yt={},dn=tn.map(Dt=>{const{default:nn,key:rn,...jn}=Dt;return Yt[rn]=At[rn]||nn,{...jn,key:rn,hidden:!!Bt.BLOCKLET_CONFIGURABLE_KEY[rn]}});$e={...$e,configsList:dn,configsValue:Yt,hasMissRequiredConfigs:Po(dn,Yt)}}const ze=W.children.some(st=>st.mountPoint==="/"),Ue=le.find(st=>st.meta.bundleDid===L),Ve=W.children.find(st=>st.meta.bundleDid===L);$e.title=U||"",Ue?$e={...$e,pathPrefix:Ue.mountPoint||"",componentName:Ue.meta.name,hasEnvironmentsStep:!1}:Ve?$e={...$e,pathPrefix:Ve.mountPoint||"",componentName:Ve.meta.name,hasEnvironmentsStep:!1}:$e={...$e,pathPrefix:ze?`/${In(U)||In(ne)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:ve.current.meta?.environments?.length>0};const lt=Hh(ve.current.meta),cn=Xh(ve.current.meta),er=Dr(W);Be({bundleDid:L,componentDid:Se,...$e,hasRequiredEnvironments:Yh(ve.current.meta),requirePurchase:lt,didSpaceIsRequiredSetup:cn,didSpaceEndpoint:er,isUpload:Re}),Ie&<&&ot()};q.useEffect(()=>{if(!a&&!m?.meta||de!==0||!W)return;const{meta:ee,inputUrl:O="",inStore:Ie=!0,registryUrl:Re="",isUpload:Fe=!1}=m||{};ae({chooseParams:{blocklets:[a||ee],meta:a||ee,registryUrl:Re||d||a.homepage,inStore:Ie,inputUrl:O},isInit:!0,isUpload:Fe}),Be({showFromUrlDialog:!1}),qe()},[a,de,W,m]),Ye.push({key:"selectComponent",name:E("blocklet.component.selectComponent"),body:l.jsxs(Qt,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[u&&K.showFromUrlDialog&&l.jsx(Ss,{mode:"component",onCancel:()=>{Be({showFromUrlDialog:!1})},onSuccess:({meta:ee,inputUrl:O,inStore:Ie,registryUrl:Re})=>{ae({chooseParams:{meta:ee,inputUrl:O,inStore:Ie,registryUrl:Re},isInit:!0}),Be({showFromUrlDialog:!1}),qe()},handleText:{title:E("blocklet.component.addComponentTip.fromUrl"),confirm:E("blocklet.component.choose")}}),l.jsx(Cs,{stores:r,extra:Ko.isInServerlessMode(z)?null:u?l.jsxs(yt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Be({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[l.jsx(Ka,{style:{fontSize:20,marginRight:4}}),E("blocklet.component.addComponentTip.fromUrl")]}):null,loading:C,onChange:()=>{we({}),ve.current={}},storageKey:n,children:({currentRegistry:ee})=>l.jsx(da,{showResourcesSwitch:h,showCategory:j,serverVersion:z?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:ee.url,resourceType:i,resourceDid:s,handleButtonClick:O=>{ae({chooseParams:{...O,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:O,defaultRender:Ie})=>{const Re=K?.bundleDid&&K?.bundleDid===O?.did;return l.jsxs(ef,{children:[l.jsx(oe,{className:Re?"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",...Re?{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:Ie}),Re&&l.jsx(oe,{className:"check-container",children:l.jsx(zo,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:E("common.cancel"),confirm:Jh({params:K,blocklet:W,t:E}),onCancel:Me,onConfirm:()=>{qe()}}),Ye.push({key:"agreement",name:E("launchBlocklet.introduction"),body:l.jsxs(Qt,{component:"div",className:"agreement-wrapper",children:[l.jsx(es,{title:E("launchBlocklet.introduction"),subTitle:E("blocklet.component.addComponentTip.introduction")}),te?l.jsx(fs,{meta:te,onClickNext:qe,installRelated:ht,onChangeInstallRelated:Ze,handleDescEle:l.jsx("p",{children:E("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:a?void 0:E("common.pre"),disabled:!Ne,confirm:E(Ne?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:a?Me:tt,onConfirm:()=>{he(!1),qe()}}),te&&K.requirePurchase&&Ye.push({key:"purchase",name:l.jsxs(l.Fragment,{children:[E("common.verifyNFT"),l.jsx(ir,{})]}),body:l.jsxs(Qt,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(Pe.current?.getCurrentStep?.()===2||$)&&l.jsx(Bn,{title:E("common.verifyNFT"),subTitle:E("blocklet.component.addComponentTip.verifyNFT")}),yn(K.purchaseResultProps)?A&&l.jsx(Ts,{ref:Pe,meta:A.meta,mode:K.componentDid?"verify":"both",onCancel:mt,installOpts:A.installOpts,handlePaySuccess:V}):l.jsx("div",{className:"flex-align-center flex-justify-center",children:l.jsx(Ii,{...K.purchaseResultProps})})]}),disabled:Pe.current?.getCurrentStep?.()===2||$,cancel:E("common.pre"),confirm:E("common.next"),onConfirm:()=>{typeof Pe.current.onNext=="function"&&(Pe.current.onNext(),he(!0))},onCancel:()=>{tt()}}),$t.hasStartEngine(te)&&Ml.hasMountPoint(te)?Ye.push({key:"config",name:E("common.config"),error:c,body:l.jsxs(Qt,{component:"div",children:[l.jsx(Bn,{title:E("common.config"),subTitle:E("blocklet.component.addComponentTip.config")}),l.jsx(Vn,{label:E("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:R||E("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:K.pathPrefix,onChange:ee=>{const O=ee.target.value;Be({pathPrefix:O}),B(E("common.slugifyHint",{value:wl(O)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!c&&l.jsx(Mo,{severity:"error",style:{width:"100%",marginTop:8},children:c})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:tt,onConfirm:()=>{qe()}}):te&&(K.pathPrefix=te.interfaces?.[0]?.path||`/${te.did}`),te&&K?.hasEnvironmentsStep&&Ye.push({key:"environment",name:l.jsxs(l.Fragment,{children:[E("common.environment")," ",K.hasRequiredEnvironments&&l.jsx(ir,{})]}),disabled:!!N||K?.hasMissRequiredConfigs,body:()=>l.jsxs(Qt,{component:"div",style:{overflowY:"auto"},children:[l.jsx(Bn,{title:E("common.environment"),subTitle:E("blocklet.component.addComponentTip.environment")}),l.jsx($l,{style:{marginTop:-12,width:"100%"},schema:K.configsList,defaultValue:K.configsValue,onChange:(ee,{action:O,currentItem:Ie,allValues:Re})=>{O==="confirm"&&Be({hasMissRequiredConfigs:Po(K.configsList,Re),configsValue:Re}),O==="edit"?D(Ie):["cancel","confirm"].includes(O)&&D(null)}})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:tt,onConfirm:qe}),te&&K?.didSpaceIsRequiredSetup&&Ye.push({key:"didSpace",name:l.jsxs(l.Fragment,{children:[E("blocklet.component.didSpaceConfig")," ",K.didSpaceIsRequiredSetup==="required"&&l.jsx(ir,{})]}),disabled:K?.didSpaceIsRequiredSetup&&!K.didSpaceEndpoint,body:()=>l.jsx(Fl,{children:l.jsxs(Qt,{component:"div",children:[l.jsx(Bn,{title:E("blocklet.component.didSpaceConfig"),subTitle:E("blocklet.component.didSpaceConfigTip")}),l.jsx(oe,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:l.jsx(Os,{blockletMeta:ve.current.meta,onNext:()=>{qe()},onEndpointUpdate:jt})})]})}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:tt,onConfirm:qe}),Ye.push({key:"install",name:It(te?.did)?E("common.upgrade"):E("common.install"),disabled:f?!1:yn(K.installResultProps),loading:f?!1:yn(K.installResultProps),body:l.jsx(Qt,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:yn(K.installResultProps)?l.jsx(il,{message:l.jsx(tf,{children:E(f?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):l.jsx("div",{style:{marginTop:120},children:l.jsx(Ii,{...K.installResultProps})})}),confirm:E("common.complete"),onConfirm:_t});const me=Ye[de]||{},Ce=()=>C||me.error||!K.bundleDid?!0:de>1?!K.pathPrefix:!1;return W?l.jsxs(Zh,{sx:o?{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:[l.jsx(jl,{steps:Ye,mode:"memory",children:l.jsx(ha,{ref:_e,meta:te,isMobile:He,onStepChange:ee=>{Le(ee)}})}),l.jsxs(oe,{className:"action-bar",children:[me.cancel&&l.jsx(yt,{onClick:ee=>{ee.stopPropagation(),me.onCancel()},disabled:de===Ye.length-2&&C,color:"inherit",children:me.cancel||E("common.cancel")}),me.confirm&&l.jsx(yt,{onClick:ee=>{ee.stopPropagation(),me.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:C||(typeof me.disabled=="boolean"?me.disabled:Ce()),variant:"contained",autoFocus:!0,title:me.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:l.jsxs(oe,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof me.loading=="boolean"?me.loading:C)&&l.jsx(Tt,{style:{marginRight:8},size:16}),l.jsx(oe,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:me.confirm})]})})]})]}):null}Qh.propTypes={onClose:F.func,mode:F.oneOf(["normal","embed"]),inDialog:F.bool,stores:F.arrayOf(F.string),storeUrl:F.string,resourceType:F.string,resourceDid:F.string,storageKey:F.string,selectedMeta:F.object,showResourcesSwitch:F.bool,showFromUrl:F.bool,enableRunBackground:F.bool,showCategory:F.bool,installFromUrlParams:F.object};const Zh=it(oe)`
|
|
699
699
|
.action-bar {
|
|
700
700
|
display: flex;
|
|
701
701
|
justify-content: flex-end;
|
|
@@ -711,7 +711,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
711
711
|
`,Qt=it(je)`
|
|
712
712
|
width: 100%;
|
|
713
713
|
height: 100%;
|
|
714
|
-
`,Bn=it(
|
|
714
|
+
`,Bn=it(es)`
|
|
715
715
|
margin-bottom: 24px;
|
|
716
716
|
`,ef=it.div`
|
|
717
717
|
position: relative;
|