@abtnode/blocklet-services 1.16.52-beta-20251003-083412-fdfc4e36 → 1.16.52-beta-20251005-235515-42ad5caf
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/api/libs/connect/session.js +16 -1
- package/api/middlewares/check-running.js +9 -8
- package/api/middlewares/ensure-org-enabled.js +17 -0
- package/api/routes/blocklet.js +3 -3
- package/api/routes/user.js +175 -1
- package/api/services/auth/connect/switch-passport.js +2 -1
- package/api/services/auth/session.js +30 -0
- package/dist/assets/{AdapterDayjs-CAaLcejt.js → AdapterDayjs-wck-CfDF.js} +1 -1
- package/dist/assets/{Google-BMeng9mn.js → Google-BFauCF2k.js} +1 -1
- package/dist/assets/{access-control-BbcaXOFy.js → access-control-0wy7XAQb.js} +1 -1
- package/dist/assets/{actions-DbBJOD0d.js → actions-B4VXcSRp.js} +1 -1
- package/dist/assets/{add-component-core--Z5nF5rL.js → add-component-core-BM7p_09p.js} +23 -23
- package/dist/assets/add-resource-DbQFT7Gg.js +1 -0
- package/dist/assets/{addon-CnJnEleb.js → addon-CUvC0k6Y.js} +1 -1
- package/dist/assets/{advanced-DlEH3ib_.js → advanced-BhCewgzQ.js} +3 -3
- package/dist/assets/{aigne-CnGxZFk3.js → aigne-BQckonxP.js} +1 -1
- package/dist/assets/api-rC33aBSs.js +1 -0
- package/dist/assets/{appearance-DKR3ZZ-t.js → appearance-CjrhZWhd.js} +1 -1
- package/dist/assets/ar-CHd3xUx5.js +7 -0
- package/dist/assets/{arrow-down.svg-B_TkYBj9.js → arrow-down.svg-f3YCmAji.js} +1 -1
- package/dist/assets/{audit-logs-CY22RcFd.js → audit-logs-CASGp36e.js} +2 -2
- package/dist/assets/{authorize-DoJw-6hl.js → authorize-CkVYs-vE.js} +1 -1
- package/dist/assets/{base-chart-BbbiwJIa.js → base-chart-UFWO9a3P.js} +1 -1
- package/dist/assets/{base32-CgLd9kUN.js → base32-Cyneng4p.js} +1 -1
- package/dist/assets/{bind-account-CKozG7iQ.js → bind-account-D6KenxOW.js} +1 -1
- package/dist/assets/{branding-T8GaJvdM.js → branding-BVr5wVa5.js} +5 -5
- package/dist/assets/{branding-DqgDW-Pg.js → branding-CHhPscOd.js} +2 -2
- package/dist/assets/branding-DLDF3ZZP.js +1 -0
- package/dist/assets/{bundle-avatar-BALJ_pZQ.js → bundle-avatar-BpummNxa.js} +1 -1
- package/dist/assets/button-DGHIlhos.js +1 -0
- package/dist/assets/{click-to-copy-CVHuu877.js → click-to-copy-B379bwP3.js} +1 -1
- package/dist/assets/{cloneDeep-E2Pxqpbv.js → cloneDeep-LRq4Ya2k.js} +1 -1
- package/dist/assets/{collapse-DhGi244c.js → collapse-DJGzUM1Q.js} +1 -1
- package/dist/assets/complete-CQkeXJPL.js +39 -0
- package/dist/assets/{component-tJC1J22-.js → component-DWN2cI-c.js} +34 -34
- package/dist/assets/{config-CuaqTz1E.js → config-BgdQYz7Z.js} +2 -2
- package/dist/assets/{config-DkBKIb7u.js → config-CPB45HHq.js} +4 -4
- package/dist/assets/{config-CiixR7JW.js → config-CRxOjKmb.js} +1 -1
- package/dist/assets/config-navigation-D1TBA90f.js +40 -0
- package/dist/assets/config-space-DpOC6rFp.js +1 -0
- package/dist/assets/{confirm-BUTyrkJR.js → confirm-BfJfcPyj.js} +1 -1
- package/dist/assets/{connect-C2T5mJpT.js → connect-BbLXTlyu.js} +1 -1
- package/dist/assets/{connect-CwCzBgdq.js → connect-ZcwxKVuN.js} +1 -1
- package/dist/assets/{connect-to-C62UBG81.js → connect-to-Skv-ek56.js} +1 -1
- package/dist/assets/{content-layout-CaGd-JXO.js → content-layout-B9tc9LCL.js} +1 -1
- package/dist/assets/create-passport-svg-DosyhcHP.js +1 -0
- package/dist/assets/{createClass-BuhPvJV8.js → createClass-HFwzUuOB.js} +1 -1
- package/dist/assets/dashboard-DJ6Tc_2L.js +106 -0
- package/dist/assets/de-CD44Obtw.js +7 -0
- package/dist/assets/{delete-confirm-zH2oZyqM.js → delete-confirm-DNg1Z1xV.js} +1 -1
- package/dist/assets/{did-address-CeTjTMC4.js → did-address-Dbg_LiWL.js} +1 -1
- package/dist/assets/{domain-BmzmdNfA.js → domain-3JvbKqlt.js} +1 -1
- package/dist/assets/{domain-action-card-BM27YVmt.js → domain-action-card-BixPviaZ.js} +2 -2
- package/dist/assets/domains-D8QMeppe.js +1 -0
- package/dist/assets/{email-vdkECdsC.js → email-C6m1mnbN.js} +1 -1
- package/dist/assets/{empty-spinner-CkCqfxFX.js → empty-spinner-LXNYl6_1.js} +1 -1
- package/dist/assets/engine-DkWTqqhM.js +1 -0
- package/dist/assets/es-DNFAt0y7.js +9 -0
- package/dist/assets/{exchange-passport-DdKgNabQ.js → exchange-passport-BraV0EOe.js} +1 -1
- package/dist/assets/{form-DD1zzF-R.js → form-BIoto8u8.js} +1 -1
- package/dist/assets/form-text-input-BgpOkOYh.js +11 -0
- package/dist/assets/{form-wrapper-DNqXvSru.js → form-wrapper-Dt1iJZge.js} +1 -1
- package/dist/assets/fr-C9xE9tD4.js +7 -0
- package/dist/assets/{fuel-h75SX900.js → fuel-Dwo_gklT.js} +1 -1
- package/dist/assets/gen-access-key-DuRApUI5.js +1 -0
- package/dist/assets/{gen-simple-access-key-Bq7DCyW7.js → gen-simple-access-key-xXyYChfi.js} +1 -1
- package/dist/assets/get-safe-url-HFT553nb.js +1 -0
- package/dist/assets/hi-D_0DFJcS.js +5 -0
- package/dist/assets/{home-B3HQdfZf.js → home-D0rR9_38.js} +1 -1
- package/dist/assets/id-BgJjfH2L.js +7 -0
- package/dist/assets/iframe-COascK-f.js +1 -0
- package/dist/assets/{index-Dr9NaKfR.js → index-3ePiAFIp.js} +1 -1
- package/dist/assets/{index-BjcHj49D.js → index-A5fXAFXl.js} +1 -1
- package/dist/assets/{index-BtHqqZ50.js → index-AMzbVwE1.js} +1 -1
- package/dist/assets/{index-C_YGTMJ4.js → index-B3o5bPY9.js} +1 -1
- package/dist/assets/{index-Chi1YHs4.js → index-BAMrdOx5.js} +1 -1
- package/dist/assets/{index-BVRSxJRS.js → index-BO080WnZ.js} +1 -1
- package/dist/assets/index-BU5Qj_Uf.js +93 -0
- package/dist/assets/index-BiMTr9N1.js +6 -0
- package/dist/assets/index-BkMwz7Ha.js +281 -0
- package/dist/assets/{index-CZkVe8t1.js → index-BoF74OVD.js} +12 -12
- package/dist/assets/{index-6IwthDxj.js → index-BrrIKxMS.js} +1 -1
- package/dist/assets/{index-3xeMR-Qg.js → index-Bx-RW9vi.js} +1 -1
- package/dist/assets/{index-CKsy2_Ph.js → index-CARCeLG0.js} +2 -2
- package/dist/assets/index-CX8XMi66.js +1 -0
- package/dist/assets/{index-BzFZ1zhO.js → index-CjUelepA.js} +1 -1
- package/dist/assets/{index-BNDipwdR.js → index-Cv0WQg6r.js} +3 -3
- package/dist/assets/{index-BiLQGAIi.js → index-DKQpQSIL.js} +2 -2
- package/dist/assets/index-DKp1VidC.js +7 -0
- package/dist/assets/index-DOTZtBXk.js +113 -0
- package/dist/assets/{index-ImKSuLO2.js → index-DXDOA6wf.js} +2 -2
- package/dist/assets/{index-CmjYsAgT.js → index-DcGTEgwU.js} +4 -4
- package/dist/assets/index-DnsQF6x_.js +1 -0
- package/dist/assets/{index-BYry2QZ3.js → index-Ds4S1_JK.js} +3 -3
- package/dist/assets/index-DsZw1jDU.js +1039 -0
- package/dist/assets/{index-DbXxI_D0.js → index-IYdn8PnM.js} +1 -1
- package/dist/assets/index-Z8qCN0P1.js +200 -0
- package/dist/assets/{index-CzlhyS8_.js → index-cc7PDHui.js} +1 -1
- package/dist/assets/{index-BluBXQJ4.js → index-d3X4O8S1.js} +4 -4
- package/dist/assets/{index-KJrnzKIu.js → index-g1J2WU69.js} +1 -1
- package/dist/assets/index-o5365tSi.js +124 -0
- package/dist/assets/{index-CD_JYNBB.js → index-pMD5HObM.js} +10 -10
- package/dist/assets/{index-C2DPoZpQ.js → index-un8ZaNww.js} +5 -5
- package/dist/assets/{index-CGXZRmKt.js → index-yINGgTD8.js} +6 -6
- package/dist/assets/{invitation-CMi0GWFt.js → invitation-HIuSHONR.js} +7 -7
- package/dist/assets/invitations-Bol3LHDV.js +3 -0
- package/dist/assets/invite--kfNCB-y.js +1 -0
- package/dist/assets/{isURL-CSKc4kTl.js → isURL-NLB1KXWU.js} +1 -1
- package/dist/assets/issue-passport-DEKfDU5Q.js +1 -0
- package/dist/assets/{item-DsH8hlQV.js → item-8d2bomfb.js} +1 -1
- package/dist/assets/ja-SFs9TI5a.js +9 -0
- package/dist/assets/ko-CHdBh-EI.js +9 -0
- package/dist/assets/{landing-page-CAdZF71_.js → landing-page-BKWBeaB2.js} +1 -1
- package/dist/assets/{launch-result-message-B0--4ubW.js → launch-result-message-DW948RfZ.js} +1 -1
- package/dist/assets/{layout-CN4YohUY.js → layout-BCGFP2fM.js} +1 -1
- package/dist/assets/{list-Bf1rfvw3.js → list-CLnYaffq.js} +2 -2
- package/dist/assets/{list-2lBZBVJD.js → list-CjwYZK4C.js} +2 -2
- package/dist/assets/{list-header-DlrmpNef.js → list-header-DMpz8A8v.js} +1 -1
- package/dist/assets/localization-D4M90esB.js +1 -0
- package/dist/assets/{log-CKMWqM_9.js → log-CwhRn7dG.js} +1 -1
- package/dist/assets/logger-GZGSMwyW.js +1 -0
- package/dist/assets/login-D6vdg4tV.js +1 -0
- package/dist/assets/{login-oauth-callback-B4wL5LK5.js → login-oauth-callback-DNSbhkTX.js} +1 -1
- package/dist/assets/{logo-uploader-CgW-ljTo.js → logo-uploader-CehwiZZl.js} +2 -2
- package/dist/assets/{lost-passport-BiaJ8Qil.js → lost-passport-JcRjjJMu.js} +3 -3
- package/dist/assets/{observability-3BjnzXRV.js → observability-pdEZhjSl.js} +1 -1
- package/dist/assets/{omit-r-0RLWOV.js → omit-BQZKecPT.js} +1 -1
- package/dist/assets/{open-window-BAToG1Zw.js → open-window-5tX5UogI.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-D4EbV_XU.js → over-due-invoice-payment-BQTpVcW4.js} +1 -1
- package/dist/assets/overview-8cijjh6D.js +85 -0
- package/dist/assets/{page-header-DP0csqkR.js → page-header-DvSb4Cmz.js} +1 -1
- package/dist/assets/passport-dBKTMShn.js +1 -0
- package/dist/assets/{passport-item-DTKCI96Q.js → passport-item-DybXmjDL.js} +1 -1
- package/dist/assets/{permission-DWlLl3B8.js → permission-DPZmpN88.js} +1 -1
- package/dist/assets/{playground-BEhnKrD-.js → playground-C0bWoIDS.js} +1 -1
- package/dist/assets/preferences-CSIWwAIC.js +1 -0
- package/dist/assets/profile-embed-Dxmu0kHv.js +1 -0
- package/dist/assets/pt-BJowi6tZ.js +5 -0
- package/dist/assets/publish-resource-BEWgZsl5.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-9QLg1KOC.js → react-beautiful-dnd.esm-BbVphn6n.js} +1 -1
- package/dist/assets/{react-stripe.esm-DWiCVD55.js → react-stripe.esm-C51Uah32.js} +1 -1
- package/dist/assets/{required-BUAaYcMZ.js → required-BT8zXV8U.js} +1 -1
- package/dist/assets/ru-DTjDV3Pw.js +5 -0
- package/dist/assets/runtime-Dw23IX1l.js +1 -0
- package/dist/assets/{sanitize-mRppk1lK.js → sanitize-C5jEFDvG.js} +1 -1
- package/dist/assets/sdk-BIWRdmX9.js +1 -0
- package/dist/assets/{section-CCfmWVdK.js → section-ZPKr6_ii.js} +1 -1
- package/dist/assets/{security-D--MQBTg.js → security-D_vkAC2F.js} +1 -1
- package/dist/assets/session-tOfkTx-G.js +1 -0
- package/dist/assets/{setup-BS5cDalg.js → setup-eJiK00ap.js} +1 -1
- package/dist/assets/{shorten-label-DAXPWCI6.js → shorten-label-DVy6K5I7.js} +1 -1
- package/dist/assets/simple-select-BeAlThKq.js +1 -0
- package/dist/assets/{spaces-6iUrdnzs.js → spaces-f3sezu1Y.js} +1 -1
- package/dist/assets/start-tshF2U2D.js +187 -0
- package/dist/assets/starting-progress-CNhbI5kz.js +40 -0
- package/dist/assets/status-aauXt2lH.js +1 -0
- package/dist/assets/{step-actions-3Nz2nPoP.js → step-actions-B_qluS-3.js} +1 -1
- package/dist/assets/{studio-C6g9y1mS.js → studio-ahebVj52.js} +1 -1
- package/dist/assets/{switch-control-Bs2D4JNi.js → switch-control-B8BKalcv.js} +1 -1
- package/dist/assets/{table-tips-B1dFVdej.js → table-tips-CIe4hASP.js} +1 -1
- package/dist/assets/team-DJZO6TyJ.js +146 -0
- package/dist/assets/th-A3GLGlJ1.js +5 -0
- package/dist/assets/traffic-Dh4U8pnc.js +1 -0
- package/dist/assets/{transfer-B90XYpQX.js → transfer-CuvzwKCQ.js} +1 -1
- package/dist/assets/{unsubscribe-DBJXxz9h.js → unsubscribe-B1yTQQGf.js} +1 -1
- package/dist/assets/{use-app-logo-Cs4SrcDi.js → use-app-logo-CqD9SoXr.js} +1 -1
- package/dist/assets/{use-mobile-BW9mTiYC.js → use-mobile-BQQpAf3i.js} +1 -1
- package/dist/assets/{use-mobile-B_fpUHD7.js → use-mobile-D6YQgajG.js} +1 -1
- package/dist/assets/{use-server-logo-R848M-JH.js → use-server-logo-ClR4qaF0.js} +1 -1
- package/dist/assets/{use-window-close-Dk0lXOqo.js → use-window-close-CLNOz9Uq.js} +1 -1
- package/dist/assets/{useAsync-DkQHu4t4.js → useAsync-DVtDVEv6.js} +1 -1
- package/dist/assets/{useAsync-DoI7Qt9M.js → useAsync-fWwm3Jbj.js} +1 -1
- package/dist/assets/{useAsyncRetry-DNTidBXG.js → useAsyncRetry-EEjDgDMR.js} +1 -1
- package/dist/assets/{useLocalStorage-BzRs3x-K.js → useLocalStorage-BPSCf_zz.js} +1 -1
- package/dist/assets/user-center-DDfna1uE.js +126 -0
- package/dist/assets/user-follower-Cc-51q-9.js +32 -0
- package/dist/assets/{user-sessions-DqMaEduy.js → user-sessions-DkchVQBO.js} +1 -1
- package/dist/assets/{util-C8ahPkmT.js → util-B8Xud4vY.js} +1 -1
- package/dist/assets/{util-CRzq0bMY.js → util-D8KMfML_.js} +1 -1
- package/dist/assets/{vendor-arcblock-BhtOu00C.js → vendor-arcblock-CSGgL93G.js} +1 -1
- package/dist/assets/{vendor-hooks-BtDnIwBH.js → vendor-hooks-BlA8TRnZ.js} +2 -2
- package/dist/assets/vendor-mui-core-DRxbhqaK.js +250 -0
- package/dist/assets/{vendor-mui-x-DWX99wt-.js → vendor-mui-x-Qp6zkx78.js} +1 -1
- package/dist/assets/{vendor-utils-CVwaKsP9.js → vendor-utils-CUDP56Ff.js} +1 -1
- package/dist/assets/{vendor-ux-Cfhaj-oj.js → vendor-ux-CDOuCaX1.js} +3 -3
- package/dist/assets/vi-DGXwnYQW.js +5 -0
- package/dist/assets/{wait-connect-E47qTAaT.js → wait-connect-CGOeOXHL.js} +1 -1
- package/dist/assets/{wizard-2kfr1LiF.js → wizard-B7NraPoW.js} +1 -1
- package/dist/assets/{wizard-components-De0Ol72d.js → wizard-components-Bl0PwqPC.js} +7 -7
- package/dist/assets/wrap-locale-BQiQiZG-.js +1 -0
- package/dist/assets/zh-CJ0qBy8e.js +10 -0
- package/dist/assets/{zh-Du23hKEW.js → zh-DQ2rCoQ5.js} +1 -1
- package/dist/assets/zh-tw-Cs-zRk58.js +9 -0
- package/dist/index.html +6 -6
- package/dist/service-worker.js +1 -1
- package/package.json +32 -32
- package/dist/assets/add-resource-DRGO7kDY.js +0 -1
- package/dist/assets/api-BUbloWod.js +0 -1
- package/dist/assets/ar-DDKSNNIB.js +0 -7
- package/dist/assets/branding-Dc9wDqPm.js +0 -1
- package/dist/assets/button-BG8yGG9e.js +0 -1
- package/dist/assets/complete-Td6_SOPf.js +0 -39
- package/dist/assets/config-navigation-BFl1_q-j.js +0 -40
- package/dist/assets/config-space-B8dCR8jO.js +0 -1
- package/dist/assets/dashboard-B0Fy6SmC.js +0 -106
- package/dist/assets/de-C5jW-Aco.js +0 -7
- package/dist/assets/domains-CEkJn9DL.js +0 -1
- package/dist/assets/engine-CCa9THLZ.js +0 -1
- package/dist/assets/es-DnE5Se03.js +0 -9
- package/dist/assets/form-text-input-CqoNK3mi.js +0 -11
- package/dist/assets/fr-BpXortYf.js +0 -7
- package/dist/assets/gen-access-key-BZebBcUZ.js +0 -1
- package/dist/assets/get-safe-url-CeMtySPx.js +0 -1
- package/dist/assets/hi-CeUu25BW.js +0 -5
- package/dist/assets/id-BugYMmLN.js +0 -7
- package/dist/assets/iframe-ASQIizLx.js +0 -1
- package/dist/assets/index-6B51asLP.js +0 -292
- package/dist/assets/index-BIIL1VhU.js +0 -1039
- package/dist/assets/index-BlTmYBsg.js +0 -124
- package/dist/assets/index-CmsJ8Fn7.js +0 -1
- package/dist/assets/index-DBJZdu-W.js +0 -113
- package/dist/assets/index-Dn4pwRtk.js +0 -1
- package/dist/assets/index-DwQNuuxR.js +0 -283
- package/dist/assets/index-ajyKTkxP.js +0 -7
- package/dist/assets/invite-DpA2tJ_s.js +0 -1
- package/dist/assets/issue-passport-B0QyEUjC.js +0 -1
- package/dist/assets/ja-DaREJWmX.js +0 -9
- package/dist/assets/ko-DGXdpX64.js +0 -9
- package/dist/assets/localization-D12SXxDi.js +0 -1
- package/dist/assets/logger-CsgnUk8i.js +0 -1
- package/dist/assets/login-y-09uRl4.js +0 -1
- package/dist/assets/overview-C734Rasc.js +0 -85
- package/dist/assets/preferences-DTgCHjY9.js +0 -1
- package/dist/assets/profile-embed-4R2fOO01.js +0 -1
- package/dist/assets/pt-CIqefLTL.js +0 -5
- package/dist/assets/publish-resource-CHMkx0I2.js +0 -1
- package/dist/assets/ru-B4h3WudR.js +0 -5
- package/dist/assets/runtime-CUzpUEb5.js +0 -1
- package/dist/assets/sdk-CxjuM-ya.js +0 -1
- package/dist/assets/session-B_RHNjCZ.js +0 -1
- package/dist/assets/simple-select-BHPmFba3.js +0 -1
- package/dist/assets/start-ByPfhiAj.js +0 -187
- package/dist/assets/starting-progress-CxdsmebW.js +0 -40
- package/dist/assets/status-DA0S9WgZ.js +0 -1
- package/dist/assets/team-CcIOrTIk.js +0 -146
- package/dist/assets/th-BjttL5p9.js +0 -5
- package/dist/assets/traffic-KIPRLJPY.js +0 -1
- package/dist/assets/user-center-bNIwz7Mp.js +0 -126
- package/dist/assets/user-follower-UoHvZnoE.js +0 -32
- package/dist/assets/vendor-mui-core-BIZOanxj.js +0 -250
- package/dist/assets/vi-C-IhikR1.js +0 -5
- package/dist/assets/wrap-locale-Ck3zJtU5.js +0 -1
- package/dist/assets/zh-CWvcoHsp.js +0 -10
- package/dist/assets/zh-tw-D_73qm-O.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{W as
|
|
1
|
+
import{W as B,j as c,a6 as jt,at as ot,ak as te,D as qt,T as Ie,J as Yt,b6 as ei,a5 as ti,I as No,bV as Ao,S as Do,bb as va,dR as ya,aP as Mo,F as ba,z as Gn,bI as xa,bJ as wa,bK as Sa,bD as Ea,aX as Bo,V as ka,aO as Ta,cS as ja,cT as Oa,bB as Ca,bE as Ia,M as ni,am as Fo,aq as Ra,b1 as ut,b7 as Pa,dH as La,a8 as $o,ad as Uo,aV as _a,aj as qo,Q as Tn,Y as Na,bw as Wo,o as zo,aU as Aa,ar as Xt,c7 as Da,c6 as Ma,c2 as ki,U as Ti,ah as Ba,dJ as Fa,O as $a,K as Ua,P as qa,ai as Wa,an as Vo,A as ji,aI as za,dO as Va}from"./vendor-mui-core-DRxbhqaK.js";import{r as q,g as ri,u as Ka,i as Ga,p as Ha,e as Xa,a as Ut,d as Ya,f as In,j as Ja}from"./vendor-react-Dvs43sk9.js";import{r as ii,S as Qa,s as Ko,A as Za}from"./item-8d2bomfb.js";import{n as bt,b as oi,f as Go,T as St,P as xt,a6 as el,r as tl,N as Hn,H as Xn,av as Oi,l as Qt,o as Ho,$ as zn,w as Xo,e as nl,k as rl,J as Fr,aX as il}from"./vendor-ux-CDOuCaX1.js";import{X as un,e as $t,c as ol,c6 as sl,b8 as al,c4 as Yo,c7 as ll,c8 as cl,c9 as ul,ca as dl,a5 as hl,V as Bt,bD as fl,t as Jo,aJ as pl,cb as ml,F as gl,cc as vl,a9 as Yn,cd as Qo,bg as Zo,k as Jn,ai as Ci,ce as yl,ap as bl,cf as xl,cg as wl,ch as Rn,ci as Ii,b9 as Sl}from"./index-DsZw1jDU.js";import{j as Ri,o as El,T as kl,L as Tl,P as jl}from"./vendor-arcblock-CSGgL93G.js";import{u as Pi}from"./launch-result-message-DW948RfZ.js";import{a as $r}from"./page-header-DvSb4Cmz.js";import{e as yt,B as Ol,C as nn,J as Qn,D as Li,R as es,Q as Cl,a7 as Il,A as Rl,o as or,V as Pl,al as Ll,am as _l,an as Nl,a as bn,S as Al,b as Dl}from"./vendor-utils-CUDP56Ff.js";import{f as Ur}from"./index-DBs9Ljax.js";import{e as Ml}from"./engine-DkWTqqhM.js";import{u as Bl,C as Fl}from"./config-space-DpOC6rFp.js";import{R as Pn}from"./required-BT8zXV8U.js";import{S as $l}from"./index-DKQpQSIL.js";import{a as ts,h as Ul,w as ql,f as Wl,b as zl,d as Vl,e as Kl,M as Gl}from"./index-Bx-RW9vi.js";import{k as jn,a as Hl,b as Xl,u as ns,g as Yl,o as Jl}from"./vendor-hooks-BlA8TRnZ.js";import{g as Ql}from"./get-safe-url-HFT553nb.js";import{r as rs,A as Zl}from"./config-CPB45HHq.js";import{r as ec}from"./index-BPy8_fa2.js";import{r as tc}from"./cloneDeep-LRq4Ya2k.js";import{u as si}from"./useLocalStorage-BPSCf_zz.js";import{v as _i}from"./index-IYdn8PnM.js";import{u as nc}from"./session-tOfkTx-G.js";import{W as rc}from"./did-address-Dbg_LiWL.js";import{a as Ni}from"./api-rC33aBSs.js";import{v as ic,e as oc}from"./util-B8Xud4vY.js";import{u as is}from"./use-mobile-BQQpAf3i.js";import{C as sc}from"./content-layout-B9tc9LCL.js";import{C as ac,D as lc,a as cc}from"./connect-to-Skv-ek56.js";import{d as sr}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}=un();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:B.bool,children:B.any.isRequired,onConfirm:B.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 c.jsxs(c.Fragment,{children:[c.jsx(uc,{children:c.jsxs(ss,{disabled:t,onConfirm:e,children:[c.jsx("div",{className:"eula-trigger",onClick:()=>o(a=>!a),children:i.listenName}),c.jsx(bt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:r?c.jsxs(c.Fragment,{children:[c.jsx(jt,{size:14}),i.launchingText]}):i.buttonNext})]})}),c.jsx(oi,{open:n,title:i.listenName,onClose:()=>o(!1),children:s})]})}as.propTypes={onContinue:B.func.isRequired,nextDisabled:B.bool,launching:B.bool,description:B.any,texts:B.object};const uc=ot.div`
|
|
2
2
|
margin: 0 auto;
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -27,18 +27,18 @@ import{W as F,j as l,a6 as jt,at as ot,ak as te,D as qt,T as Ie,J as Yt,b6 as Zr
|
|
|
27
27
|
.next-button {
|
|
28
28
|
min-width: 200px;
|
|
29
29
|
}
|
|
30
|
-
`;var Ln={exports:{}},ar,
|
|
31
|
-
`,h="/",u="*",f="",j="comment",m="declaration";ar=function(S,O){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];O=O||{};var P=1,_=1;function
|
|
30
|
+
`;var Ln={exports:{}},ar,Ai;function dc(){if(Ai)return ar;Ai=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";ar=function(S,O){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];O=O||{};var P=1,_=1;function $(H){var N=H.match(t);N&&(P+=N.length);var X=H.lastIndexOf(d);_=~X?H.length-X:_+H.length}function l(){var H={line:P,column:_};return function(N){return N.position=new w(H),D(),N}}function w(H){this.start=H,this.end={line:P,column:_},this.source=O.source}w.prototype.content=S;function I(H){var N=new Error(O.source+":"+P+":"+_+": "+H);if(N.reason=H,N.filename=O.source,N.line=P,N.column=_,N.source=S,!O.silent)throw N}function M(H){var N=H.exec(S);if(N){var X=N[0];return $(X),S=S.slice(X.length),N}}function D(){M(r)}function ne(H){var N;for(H=H||[];N=Z();)N!==!1&&H.push(N);return H}function Z(){var H=l();if(!(h!=S.charAt(0)||u!=S.charAt(1))){for(var N=2;f!=S.charAt(N)&&(u!=S.charAt(N)||h!=S.charAt(N+1));)++N;if(N+=2,f===S.charAt(N-1))return I("End of comment missing");var X=S.slice(2,N-2);return _+=2,$(X),S=S.slice(N),_+=2,H({type:j,comment:X})}}function z(){var H=l(),N=M(i);if(N){if(Z(),!M(s))return I("property missing ':'");var X=M(n),F=H({type:m,property:E(N[0].replace(e,f)),value:X?E(X[0].replace(e,f)):f});return M(o),F}}function W(){var H=[];ne(H);for(var N;N=z();)N!==!1&&(H.push(N),ne(H));return H}return D(),W()};function E(S){return S?S.replace(a,f):f}return ar}var Di;function hc(){if(Di)return Ln.exports;Di=1;var e=dc();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 Ln.exports=t,Ln.exports.default=t,Ln.exports}var fc=hc();const pc=ri(fc),mc={}.hasOwnProperty;function gc(e,t,r){if(typeof e!="function")throw new TypeError("h is not a function");const i=yc(e),s=wc(e),n=xc(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"?ts: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:bc(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=ts,r.schema=s);for(h in t.properties)t.properties&&mc.call(t.properties,h)&&vc(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 vc(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=Sc(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 yc(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function bc(e){return"context"in e&&"cleanup"in e}function xc(e){return e("div",{}).type==="VirtualNode"}function wc(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Sc(e,t){const r={};try{pc(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 lr,Mi;function Ec(){if(Mi)return lr;Mi=1,lr=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 lr}var cr,Bi;function kc(){if(Bi)return cr;Bi=1,cr=s;var e=Ec(),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 O=[],P;return(!a||u(m,E,S[S.length-1]||null))&&(O=n(d(m,S)),O[0]===i)?O:m.children&&O[0]!==r?(P=n(j(m.children,S.concat(m))),P[0]===i?P:O):O}function j(m,E){for(var S=-1,O=h?-1:1,P=(h?m.length:S)+O,_;P>S&&P<m.length;){if(_=f(m[P],P,E),_[0]===i)return _;P=typeof _[1]=="number"?_[1]:P+O}}}function n(o){return o!==null&&typeof o=="object"&&"length"in o?o:typeof o=="number"?[t,o]:[o]}return cr}var ur,Fi;function Tc(){if(Fi)return ur;Fi=1,ur=s;var e=kc(),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 ur}var dr,$i;function jc(){if($i)return dr;$i=1;var e=Tc(),t=Object.prototype.hasOwnProperty,r={align:"text-align",valign:"vertical-align",height:"height",width:"width"};dr=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 dr}var Oc=jc();const Cc=ri(Oc);function Ic(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 Rc={}.hasOwnProperty,Pc=new Set(["table","thead","tbody","tfoot","tr"]);function Lc(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=gc(s,r?Cc(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&&Pc.has(n)&&(a=a.filter(d=>!Ic(d))),e.components&&Rc.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 c.jsx(_c,{children:e})}const Ui="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",_c=ot(te)`
|
|
32
32
|
.highlight pre,
|
|
33
33
|
pre {
|
|
34
34
|
border-radius: 5px;
|
|
35
35
|
}
|
|
36
36
|
code {
|
|
37
|
-
font-family: ${
|
|
37
|
+
font-family: ${Ui};
|
|
38
38
|
}
|
|
39
39
|
pre code {
|
|
40
40
|
font-size: 14px;
|
|
41
|
-
font-family: ${
|
|
41
|
+
font-family: ${Ui};
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
h1,
|
|
@@ -62,7 +62,7 @@ import{W as F,j as l,a6 as jt,at as ot,ak as te,D as qt,T as Ie,J as Yt,b6 as Zr
|
|
|
62
62
|
.anchor {
|
|
63
63
|
display: none;
|
|
64
64
|
}
|
|
65
|
-
`;cs.propTypes={children:
|
|
65
|
+
`;cs.propTypes={children:B.any.isRequired};function us({infoList:e=[]}){return c.jsx(te,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>c.jsxs(c.Fragment,{children:[c.jsx(te,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),c.jsx(te,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}us.propTypes={infoList:B.arrayOf(B.shape({key:B.string,value:B.string}))};const Nc=e=>e.payment?(e.payment.price||[]).map(t=>t.value||0).every(t=>t===0):!0,Ac=new Lc({createElement:q.createElement}).Compiler,_t={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=jn(()=>n&&o?fetch(Ri(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?Ac(i.htmlAst):"",f=Nc(i);let j=yt(i,"owner.fullName");if(j){const S=yt(i,"owner.did");S&&(j=c.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[j,c.jsx(Go,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:S,compact:!0,size:14,locale:t})]}))}else j=yt(i,"author.name");const m=[{key:yt(_t[t],"appinfo.name"),value:$t.getDisplayName({meta:i})},{key:yt(_t[t],"appinfo.version"),value:i.version},{key:yt(_t[t],"appinfo.author"),value:j},{type:"description",key:yt(_t[t],"appinfo.description"),value:i.description}];i.requirements&&m.push({key:yt(_t[t],"appinfo.requirements"),value:i.requirements.server}),i.community&&m.push({key:yt(_t[t],"appinfo.community"),value:c.jsx("a",{href:i.community,target:"_blank",rel:"noreferrer",children:i.community})}),i.documentation&&m.push({key:yt(_t[t],"appinfo.documentation"),value:c.jsx("a",{href:i.documentation,target:"_blank",rel:"noreferrer",children:i.documentation})}),i.support&&m.push({key:yt(_t[t],"appinfo.support"),value:c.jsx("a",{href:`mailto:${i.support}`,target:"_blank",rel:"noreferrer",children:i.support})}),u&&m.push({key:yt(_t[t],"appinfo.overview"),value:""});let E;return t==="zh"?E=c.jsxs(c.Fragment,{children:[f?c.jsxs("p",{children:["您可以免费使用 ",c.jsx("b",{children:a}),";"]}):c.jsxs("p",{children:["您需要购买才能使用 ",c.jsx("b",{children:a}),";"]}),c.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),c.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),c.jsx("p",{children:"下面为该应用的信息:"})]}):E=c.jsxs(c.Fragment,{children:[f?c.jsxs("p",{children:["You can use ",c.jsx("b",{children:a})," for free;"]}):c.jsxs("p",{children:["You need to purchase before launch ",c.jsx("b",{children:a}),";"]}),c.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),c.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),c.jsx("p",{children:"Below is the information for the blocklet: "})]}),c.jsxs(Mc,{children:[r||E,c.jsx(us,{infoList:m}),h?c.jsxs("div",{className:"app-overview",children:[c.jsx(Ie,{variant:"h5",gutterBottom:!0,children:yt(_t[t],"appinfo.overview")}),c.jsx(cs,{children:c.jsx(Dc,{component:"div",className:"content-wrapper post-content",children:c.jsx(Gl,{source:h,wrapperElement:{"data-color-mode":s.palette.mode},urlTransform:(S,O,P)=>S.startsWith("/")?Ri(n,S):S})})})]}):u?c.jsx("div",{className:"app-overview",children:u}):null]})}const Dc=ot(Ie)`
|
|
66
66
|
width: 100%;
|
|
67
67
|
word-wrap: break-word;
|
|
68
68
|
word-break: break-word;
|
|
@@ -113,7 +113,7 @@ import{W as F,j as l,a6 as jt,at as ot,ak as te,D as qt,T as Ie,J as Yt,b6 as Zr
|
|
|
113
113
|
.wmde-markdown[data-color-mode='dark'] {
|
|
114
114
|
background: transparent;
|
|
115
115
|
}
|
|
116
|
-
`;ds.propTypes={blockletMeta:
|
|
116
|
+
`;ds.propTypes={blockletMeta:B.object.isRequired,locale:B.string.isRequired,handleDescEle:B.node};function Bc({...e}){return c.jsxs("div",{...e,style:{width:"100%"},children:[c.jsx("h3",{children:"End User License Agreement for Application"}),c.jsxs("p",{children:["Blocklet Server License Agreement ",ol.COPYRIGHT_OWNER," version 2020-08-28"]}),c.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),c.jsx("p",{children:"暂无"})]})}function Fc(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}=St(),a=Yt(f=>f.breakpoints.down("md"));if(!r)return null;const d=!n&&s.length===0,h=!n&&s.length!==0,u=40;return c.jsxs(oi,{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&&c.jsx(te,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:c.jsx(te,{component:xt,icon:"line-md:loading-loop",sx:{color:"primary.main",fontSize:32}})}),d&&c.jsx(te,{sx:{textAlign:"center"},children:o("blocklet.component.noDependencies",{name:t.title})}),h&&c.jsx(te,{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,c.jsxs(te,{sx:{opacity:m,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[c.jsx("img",{style:{width:u,height:u,minWidth:u,minHeight:u},src:Fc(f),alt:f.meta.title}),c.jsxs(te,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[c.jsxs(te,{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,c.jsx(te,{sx:{display:j?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:o("blocklet.component.required")}),c.jsxs(te,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[f.meta.version,c.jsx(te,{className:"link-icon",icon:"fluent:open-20-filled",component:xt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),c.jsx(te,{sx:{marginTop:0,opacity:.7},children:f.meta.description})]})]},f.meta.did)})})]})}hs.propTypes={meta:B.object,show:B.bool,onClose:B.func.isRequired,installRelated:B.func,components:B.array.isRequired,loading:B.bool.isRequired};function $c(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e?.did}/blocklet.json`:""}function Uc(e){const{api:t}=un(),[r]=Ka(),i=r.get("blocklet_meta_url")||$c(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=Ga(),{t:o,locale:a}=St(),[d,h]=q.useState(!1),{components:u,loading:f}=Uc(r),j=os(r),m=i||(()=>{n(`/launch-blocklet/install${window.location.search}`)}),E=()=>{h(!0)},S=()=>{h(!1)};return c.jsxs(qc,{children:[c.jsx("div",{className:"app-content",children:c.jsx("div",{className:"agreement",children:c.jsx("div",{className:"agreement-content",children:j?c.jsx(ds,{blockletMeta:{data:r},locale:a,handleDescEle:s}):c.jsx(te,{sx:{p:3},children:c.jsx(Ie,{children:o("launchBlocklet.dockerBlockletCantInstall")})})})})}),c.jsxs(te,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[f?c.jsx(xt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,j&&t&&u?.length?c.jsxs(te,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[c.jsx(ei,{sx:{mr:.5},checked:e,onChange:O=>t(O.currentTarget.checked),control:c.jsx(ti,{}),label:c.jsx("span",{children:o("launchBlocklet.installRelatedComponents")})}),c.jsx(te,{sx:{"> button svg":{color:"primary.main"}},children:c.jsx(No,{size:"small",onClick:E,children:c.jsx(xt,{icon:"octicon:package-dependencies-16"})})})]}):null,c.jsx("div",{className:"button-container","data-cy":"agree-all",children:j?c.jsx(as,{onContinue:m,description:c.jsx(Bc,{}),texts:{listenName:o("launchBlocklet.license"),buttonNext:o("launchBlocklet.next")}}):null})]}),c.jsx(hs,{installRelated:e,meta:r,show:d,onClose:S,components:u,loading:f})]})}fs.propTypes={meta:B.object.isRequired,onClickNext:B.func,handleDescEle:B.node,installRelated:B.bool,onChangeInstallRelated:B.func};const qc=ot.div`
|
|
117
117
|
display: flex;
|
|
118
118
|
flex-direction: column;
|
|
119
119
|
align-items: center;
|
|
@@ -189,21 +189,21 @@ import{W as F,j as l,a6 as jt,at as ot,ak as te,D as qt,T as Ie,J as Yt,b6 as Zr
|
|
|
189
189
|
padding-bottom: 16px;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
`;var Tt={},_n={exports:{}},hr={exports:{}},Ui;function ps(){if(Ui)return hr.exports;Ui=1;var e=hr.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 hr.exports}var fr,qi;function Wc(){if(qi)return fr;qi=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};fr=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)},fr}var pr,Wi;function zc(){return Wi||(Wi=1,pr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),pr}var mr,zi;function Vc(){if(zi)return mr;zi=1,mr=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{zc()(e)}catch{}return mr}var gr,Vi;function Kc(){if(Vi)return gr;Vi=1;const e=Vc(),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 I=this[d].tail;I!==null;){const B=I.prev;_(this,c,I,w),I=B}}forEach(c,w){w=w||this;for(let I=this[d].head;I!==null;){const B=I.next;_(this,c,I,w),I=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,I){if(I=I||this[n],I&&typeof I!="number")throw new TypeError("maxAge must be a number");const B=I?Date.now():0,M=this[i](w,c);if(this[h].has(c)){if(M>this[t])return O(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=I,z.value=w,this[r]+=M-z.length,z.length=M,this.get(c),S(this),!0}const ne=new P(c,w,M,B,I);return ne.length>this[t]?(this[o]&&this[o](c,w),!1):(this[r]+=ne.length,this[d].unshift(ne),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?(O(this,c),c.value):null}del(c){O(this,this[h].get(c))}load(c){this.reset();const w=Date.now();for(let I=c.length-1;I>=0;I--){const B=c[I],M=B.e||0;if(M===0)this.set(B.k,B.v);else{const ne=M-w;ne>0&&this.set(B.k,B.v,ne)}}}prune(){this[h].forEach((c,w)=>m(this,w,!1))}}const m=(D,c,w)=>{const I=D[h].get(c);if(I){const B=I.value;if(E(D,B)){if(O(D,I),!D[s])return}else w&&(D[u]&&(I.value.now=Date.now()),D[d].unshiftNode(I));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;O(D,c),c=w}},O=(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 P{constructor(c,w,I,B,M){this.key=c,this.value=w,this.length=I,this.now=B,this.maxAge=M||0}}const _=(D,c,w,I)=>{let B=w.value;E(D,B)&&(O(D,w),D[s]||(B=void 0)),B&&c.call(I,B.value,B.key,D)};return gr=j,gr}var Ki;function Gc(){if(Ki)return _n.exports;Ki=1;var e=sl,t=ps(),r=_n.exports=Wc(),i=Kc(),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};_n.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),O=E.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),P=Object.keys(t).map(function(_){try{var D=t[_],c=null;S.auth&&a[S.protocol]&&(c=S.auth);var w=S.hash?decodeURIComponent(S.hash.substr(1)):null,I=null,B=null,M=null;if(O&&O[1]===_)I=O[2]&&decodeURIComponent(O[2]),B=decodeURIComponent(O[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 ne=D.pathmatch,Z=S.path.match(ne);if(!Z)return;Z[1]!==null&&Z[1]!==void 0&&(I=decodeURIComponent(Z[1].replace(/^:/,""))),B=decodeURIComponent(Z[2]),M=o(S.protocol)}return new r(_,I,c,B,w,M,m)}catch(z){if(!(z instanceof URIError))throw z}}).filter(function(_){return _});if(P.length===1)return P[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 O=j.match(/[^@]+@[^:/]+/);if(O){var S=new e.URL(O[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 _n.exports}var Gt={},ie={},vr,Gi;function Hc(){return Gi||(Gi=1,vr={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),vr}var yr,Hi;function Xc(){if(Hi)return yr;Hi=1;const{charsWide:e,charsFullWidth:t}=Hc(),r=new RegExp(`[${e.join("")}${t.join("")}]`,"g");return yr={default:s=>s.replace(r,"xx").length,charsRegex:r},yr}/*!
|
|
192
|
+
`;var Tt={},_n={exports:{}},hr={exports:{}},qi;function ps(){if(qi)return hr.exports;qi=1;var e=hr.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 hr.exports}var fr,Wi;function Wc(){if(Wi)return fr;Wi=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};fr=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)},fr}var pr,zi;function zc(){return zi||(zi=1,pr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),pr}var mr,Vi;function Vc(){if(Vi)return mr;Vi=1,mr=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{zc()(e)}catch{}return mr}var gr,Ki;function Kc(){if(Ki)return gr;Ki=1;const e=Vc(),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(l){if(typeof l=="number"&&(l={max:l}),l||(l={}),l.max&&(typeof l.max!="number"||l.max<0))throw new TypeError("max must be a non-negative number");this[t]=l.max||1/0;const w=l.length||f;if(this[i]=typeof w!="function"?f:w,this[s]=l.stale||!1,l.maxAge&&typeof l.maxAge!="number")throw new TypeError("maxAge must be a number");this[n]=l.maxAge||0,this[o]=l.dispose,this[a]=l.noDisposeOnSet||!1,this[u]=l.updateAgeOnGet||!1,this.reset()}set max(l){if(typeof l!="number"||l<0)throw new TypeError("max must be a non-negative number");this[t]=l||1/0,S(this)}get max(){return this[t]}set allowStale(l){this[s]=!!l}get allowStale(){return this[s]}set maxAge(l){if(typeof l!="number")throw new TypeError("maxAge must be a non-negative number");this[n]=l,S(this)}get maxAge(){return this[n]}set lengthCalculator(l){typeof l!="function"&&(l=f),l!==this[i]&&(this[i]=l,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(l,w){w=w||this;for(let I=this[d].tail;I!==null;){const M=I.prev;_(this,l,I,w),I=M}}forEach(l,w){w=w||this;for(let I=this[d].head;I!==null;){const M=I.next;_(this,l,I,w),I=M}}keys(){return this[d].toArray().map(l=>l.key)}values(){return this[d].toArray().map(l=>l.value)}reset(){this[o]&&this[d]&&this[d].length&&this[d].forEach(l=>this[o](l.key,l.value)),this[h]=new Map,this[d]=new e,this[r]=0}dump(){return this[d].map(l=>E(this,l)?!1:{k:l.key,v:l.value,e:l.now+(l.maxAge||0)}).toArray().filter(l=>l)}dumpLru(){return this[d]}set(l,w,I){if(I=I||this[n],I&&typeof I!="number")throw new TypeError("maxAge must be a number");const M=I?Date.now():0,D=this[i](w,l);if(this[h].has(l)){if(D>this[t])return O(this,this[h].get(l)),!1;const z=this[h].get(l).value;return this[o]&&(this[a]||this[o](l,z.value)),z.now=M,z.maxAge=I,z.value=w,this[r]+=D-z.length,z.length=D,this.get(l),S(this),!0}const ne=new P(l,w,D,M,I);return ne.length>this[t]?(this[o]&&this[o](l,w),!1):(this[r]+=ne.length,this[d].unshift(ne),this[h].set(l,this[d].head),S(this),!0)}has(l){if(!this[h].has(l))return!1;const w=this[h].get(l).value;return!E(this,w)}get(l){return m(this,l,!0)}peek(l){return m(this,l,!1)}pop(){const l=this[d].tail;return l?(O(this,l),l.value):null}del(l){O(this,this[h].get(l))}load(l){this.reset();const w=Date.now();for(let I=l.length-1;I>=0;I--){const M=l[I],D=M.e||0;if(D===0)this.set(M.k,M.v);else{const ne=D-w;ne>0&&this.set(M.k,M.v,ne)}}}prune(){this[h].forEach((l,w)=>m(this,w,!1))}}const m=($,l,w)=>{const I=$[h].get(l);if(I){const M=I.value;if(E($,M)){if(O($,I),!$[s])return}else w&&($[u]&&(I.value.now=Date.now()),$[d].unshiftNode(I));return M.value}},E=($,l)=>{if(!l||!l.maxAge&&!$[n])return!1;const w=Date.now()-l.now;return l.maxAge?w>l.maxAge:$[n]&&w>$[n]},S=$=>{if($[r]>$[t])for(let l=$[d].tail;$[r]>$[t]&&l!==null;){const w=l.prev;O($,l),l=w}},O=($,l)=>{if(l){const w=l.value;$[o]&&$[o](w.key,w.value),$[r]-=w.length,$[h].delete(w.key),$[d].removeNode(l)}};class P{constructor(l,w,I,M,D){this.key=l,this.value=w,this.length=I,this.now=M,this.maxAge=D||0}}const _=($,l,w,I)=>{let M=w.value;E($,M)&&(O($,w),$[s]||(M=void 0)),M&&l.call(I,M.value,M.key,$)};return gr=j,gr}var Gi;function Gc(){if(Gi)return _n.exports;Gi=1;var e=sl,t=ps(),r=_n.exports=Wc(),i=Kc(),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};_n.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),O=E.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),P=Object.keys(t).map(function(_){try{var $=t[_],l=null;S.auth&&a[S.protocol]&&(l=S.auth);var w=S.hash?decodeURIComponent(S.hash.substr(1)):null,I=null,M=null,D=null;if(O&&O[1]===_)I=O[2]&&decodeURIComponent(O[2]),M=decodeURIComponent(O[3].replace(/\.git$/,"")),D="shortcut";else{if(S.host&&S.host!==$.domain&&S.host.replace(/^www[.]/,"")!==$.domain||!$.protocols_re.test(S.protocol)||!S.path)return;var ne=$.pathmatch,Z=S.path.match(ne);if(!Z)return;Z[1]!==null&&Z[1]!==void 0&&(I=decodeURIComponent(Z[1].replace(/^:/,""))),M=decodeURIComponent(Z[2]),D=o(S.protocol)}return new r(_,I,l,M,w,D,m)}catch(z){if(!(z instanceof URIError))throw z}}).filter(function(_){return _});if(P.length===1)return P[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 O=j.match(/[^@]+@[^:/]+/);if(O){var S=new e.URL(O[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 _n.exports}var Gt={},ie={},vr,Hi;function Hc(){return Hi||(Hi=1,vr={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),vr}var yr,Xi;function Xc(){if(Xi)return yr;Xi=1;const{charsWide:e,charsFullWidth:t}=Hc(),r=new RegExp(`[${e.join("")}${t.join("")}]`,"g");return yr={default:s=>s.replace(r,"xx").length,charsRegex:r},yr}/*!
|
|
193
193
|
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
194
194
|
*
|
|
195
195
|
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
196
196
|
* Licensed under the MIT License.
|
|
197
|
-
*/var br,
|
|
197
|
+
*/var br,Yi;function Yc(){return Yi||(Yi=1,br=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}),br}/*!
|
|
198
198
|
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
199
199
|
*
|
|
200
200
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
201
201
|
* Released under the MIT License.
|
|
202
|
-
*/var xr,Yi;function Jc(){if(Yi)return xr;Yi=1;var e=Yc(),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 xr=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)},xr}var Nn={exports:{}},Ji;function Qc(){return Ji||(Ji=1,function(e,t){var r={};t=e.exports=M;var i;typeof Ha=="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 O(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(O(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(O(u[f.TILDETRIM]),"g");var P="$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(O(u[f.CARETTRIM]),"g");var _="$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(O(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(O(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=I;function I(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=ne;function ne(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(_e(p,x))return null;var k=w(p),L=w(x),U="";if(k.prerelease.length||L.prerelease.length){U="pre";var ee="prerelease"}for(var re in k)if((re==="major"||re==="minor"||re==="patch")&&k[re]!==L[re])return U+re;return ee}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=N;function N(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=de;function de(p,x,k){return new M(p,k).compare(new M(x,k))}t.compareLoose=Le;function Le(p,x){return de(p,x,!0)}t.compareBuild=V;function V(p,x,k){var L=new M(p,k),U=new M(x,k);return L.compare(U)||L.compareBuild(U)}t.rcompare=ke;function ke(p,x,k){return de(x,p,k)}t.sort=ce;function ce(p,x){return p.sort(function(k,L){return t.compareBuild(k,L,x)})}t.rsort=$e;function $e(p,x){return p.sort(function(k,L){return t.compareBuild(L,k,x)})}t.gt=ve;function ve(p,x,k){return de(p,x,k)>0}t.lt=Ne;function Ne(p,x,k){return de(p,x,k)<0}t.eq=_e;function _e(p,x,k){return de(p,x,k)===0}t.neq=Ge;function Ge(p,x,k){return de(p,x,k)!==0}t.gte=tt;function tt(p,x,k){return de(p,x,k)>=0}t.lte=pt;function pt(p,x,k){return de(p,x,k)<=0}t.cmp=mt;function mt(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 _e(p,k,L);case"!=":return Ge(p,k,L);case">":return ve(p,k,L);case">=":return tt(p,k,L);case"<":return Ne(p,k,L);case"<=":return pt(p,k,L);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=xe;function xe(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof xe){if(p.loose===!!x.loose)return p;p=p.value}if(!(this instanceof xe))return new xe(p,x);p=p.trim().split(/\s+/).join(" "),i("comparator",p,x),this.options=x,this.loose=!!x.loose,this.parse(p),this.semver===he?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}var he={};xe.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=he},xe.prototype.toString=function(){return this.value},xe.prototype.test=function(p){if(i("Comparator.test",p,this.options.loose),this.semver===he||p===he)return!0;if(typeof p=="string")try{p=new M(p,this.options)}catch{return!1}return mt(p,this.operator,this.semver,this.options)},xe.prototype.intersects=function(p,x){if(!(p instanceof xe))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 ge(p.value,x),He(this.value,k,x));if(p.operator==="")return p.value===""?!0:(k=new ge(this.value,x),He(p.semver,k,x));var L=(this.operator===">="||this.operator===">")&&(p.operator===">="||p.operator===">"),U=(this.operator==="<="||this.operator==="<")&&(p.operator==="<="||p.operator==="<"),ee=this.semver.version===p.semver.version,re=(this.operator===">="||this.operator==="<=")&&(p.operator===">="||p.operator==="<="),Ee=mt(this.semver,"<",p.semver,x)&&(this.operator===">="||this.operator===">")&&(p.operator==="<="||p.operator==="<"),we=mt(this.semver,">",p.semver,x)&&(this.operator==="<="||this.operator==="<")&&(p.operator===">="||p.operator===">");return L||U||ee&&re||Ee||we},t.Range=ge;function ge(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof ge)return p.loose===!!x.loose&&p.includePrerelease===!!x.includePrerelease?p:new ge(p.raw,x);if(p instanceof xe)return new ge(p.value,x);if(!(this instanceof ge))return new ge(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()}ge.prototype.format=function(){return this.range=this.set.map(function(p){return p.join(" ").trim()}).join("||").trim(),this.range},ge.prototype.toString=function(){return this.range},ge.prototype.parseRange=function(p){var x=this.options.loose,k=x?h[f.HYPHENRANGELOOSE]:h[f.HYPHENRANGE];p=p.replace(k,st),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=p.replace(h[f.CARETTRIM],_),p=p.split(/\s+/).join(" ");var L=x?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],U=p.split(" ").map(function(ee){return Ot(ee,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(U=U.filter(function(ee){return!!ee.match(L)})),U=U.map(function(ee){return new xe(ee,this.options)},this),U},ge.prototype.intersects=function(p,x){if(!(p instanceof ge))throw new TypeError("a Range is required");return this.set.some(function(k){return We(k,x)&&p.set.some(function(L){return We(L,x)&&k.every(function(U){return L.every(function(ee){return U.intersects(ee,x)})})})})};function We(p,x){for(var k=!0,L=p.slice(),U=L.pop();k&&L.length;)k=L.every(function(ee){return U.intersects(ee,x)}),U=L.pop();return k}t.toComparators=Ue;function Ue(p,x){return new ge(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=Et(p,x),i("caret",p),p=Ct(p,x),i("tildes",p),p=Ye(p,x),i("xrange",p),p=lt(p,x),i("stars",p),p}function Be(p){return!p||p.toLowerCase()==="x"||p==="*"}function Ct(p,x){return p.trim().split(/\s+/).map(function(k){return It(k,x)}).join(" ")}function It(p,x){var k=x.loose?h[f.TILDELOOSE]:h[f.TILDE];return p.replace(k,function(L,U,ee,re,Ee){i("tilde",p,L,U,ee,re,Ee);var we;return Be(U)?we="":Be(ee)?we=">="+U+".0.0 <"+(+U+1)+".0.0":Be(re)?we=">="+U+"."+ee+".0 <"+U+"."+(+ee+1)+".0":Ee?(i("replaceTilde pr",Ee),we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+U+"."+(+ee+1)+".0"):we=">="+U+"."+ee+"."+re+" <"+U+"."+(+ee+1)+".0",i("tilde return",we),we})}function Et(p,x){return p.trim().split(/\s+/).map(function(k){return Rt(k,x)}).join(" ")}function Rt(p,x){i("caret",p,x);var k=x.loose?h[f.CARETLOOSE]:h[f.CARET];return p.replace(k,function(L,U,ee,re,Ee){i("caret",p,L,U,ee,re,Ee);var we;return Be(U)?we="":Be(ee)?we=">="+U+".0.0 <"+(+U+1)+".0.0":Be(re)?U==="0"?we=">="+U+"."+ee+".0 <"+U+"."+(+ee+1)+".0":we=">="+U+"."+ee+".0 <"+(+U+1)+".0.0":Ee?(i("replaceCaret pr",Ee),U==="0"?ee==="0"?we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+U+"."+ee+"."+(+re+1):we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+U+"."+(+ee+1)+".0":we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+(+U+1)+".0.0"):(i("no pr"),U==="0"?ee==="0"?we=">="+U+"."+ee+"."+re+" <"+U+"."+ee+"."+(+re+1):we=">="+U+"."+ee+"."+re+" <"+U+"."+(+ee+1)+".0":we=">="+U+"."+ee+"."+re+" <"+(+U+1)+".0.0"),i("caret return",we),we})}function Ye(p,x){return i("replaceXRanges",p,x),p.split(/\s+/).map(function(k){return At(k,x)}).join(" ")}function At(p,x){p=p.trim();var k=x.loose?h[f.XRANGELOOSE]:h[f.XRANGE];return p.replace(k,function(L,U,ee,re,Ee,we){i("xRange",p,L,U,ee,re,Ee,we);var nt=Be(ee),et=nt||Be(re),Ae=et||Be(Ee),Fe=Ae;return U==="="&&Fe&&(U=""),we=x.includePrerelease?"-0":"",nt?U===">"||U==="<"?L="<0.0.0-0":L="*":U&&Fe?(et&&(re=0),Ee=0,U===">"?(U=">=",et?(ee=+ee+1,re=0,Ee=0):(re=+re+1,Ee=0)):U==="<="&&(U="<",et?ee=+ee+1:re=+re+1),L=U+ee+"."+re+"."+Ee+we):et?L=">="+ee+".0.0"+we+" <"+(+ee+1)+".0.0"+we:Ae&&(L=">="+ee+"."+re+".0"+we+" <"+ee+"."+(+re+1)+".0"+we),i("xRange return",L),L})}function lt(p,x){return i("replaceStars",p,x),p.trim().replace(h[f.STAR],"")}function st(p,x,k,L,U,ee,re,Ee,we,nt,et,Ae,Fe){return Be(k)?x="":Be(L)?x=">="+k+".0.0":Be(U)?x=">="+k+"."+L+".0":x=">="+x,Be(we)?Ee="":Be(nt)?Ee="<"+(+we+1)+".0.0":Be(et)?Ee="<"+we+"."+(+nt+1)+".0":Ae?Ee="<="+we+"."+nt+"."+et+"-"+Ae:Ee="<="+Ee,(x+" "+Ee).trim()}ge.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(ze(this.set[x],p,this.options))return!0;return!1};function ze(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!==he&&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=He;function He(p,x,k){try{x=new ge(x,k)}catch{return!1}return x.test(p)}t.maxSatisfying=gt;function gt(p,x,k){var L=null,U=null;try{var ee=new ge(x,k)}catch{return null}return p.forEach(function(re){ee.test(re)&&(!L||U.compare(re)===-1)&&(L=re,U=new M(L,k))}),L}t.minSatisfying=K;function K(p,x,k){var L=null,U=null;try{var ee=new ge(x,k)}catch{return null}return p.forEach(function(re){ee.test(re)&&(!L||U.compare(re)===1)&&(L=re,U=new M(L,k))}),L}t.minVersion=le;function le(p,x){p=new ge(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(ee){var re=new M(ee.semver.version);switch(ee.operator){case">":re.prerelease.length===0?re.patch++:re.prerelease.push(0),re.raw=re.format();case"":case">=":(!k||ve(k,re))&&(k=re);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+ee.operator)}})}return k&&p.test(k)?k:null}t.validRange=Te;function Te(p,x){try{return new ge(p,x).range||"*"}catch{return null}}t.ltr=Pe;function Pe(p,x,k){return A(p,x,"<",k)}t.gtr=Se;function Se(p,x,k){return A(p,x,">",k)}t.outside=A;function A(p,x,k,L){p=new M(p,L),x=new ge(x,L);var U,ee,re,Ee,we;switch(k){case">":U=ve,ee=pt,re=Ne,Ee=">",we=">=";break;case"<":U=Ne,ee=tt,re=ve,Ee="<",we="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(He(p,x,L))return!1;for(var nt=0;nt<x.set.length;++nt){var et=x.set[nt],Ae=null,Fe=null;if(et.forEach(function(Ze){Ze.semver===he&&(Ze=new xe(">=0.0.0")),Ae=Ae||Ze,Fe=Fe||Ze,U(Ze.semver,Ae.semver,L)?Ae=Ze:re(Ze.semver,Fe.semver,L)&&(Fe=Ze)}),Ae.operator===Ee||Ae.operator===we||(!Fe.operator||Fe.operator===Ee)&&ee(p,Fe.semver))return!1;if(Fe.operator===we&&re(p,Fe.semver))return!1}return!0}t.prerelease=se;function se(p,x){var k=w(p,x);return k&&k.prerelease.length?k.prerelease:null}t.intersects=me;function me(p,x,k){return p=new ge(p,k),x=new ge(x,k),p.intersects(x)}t.coerce=Ce;function Ce(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)}}(Nn,Nn.exports)),Nn.exports}var wr,Qi;function Zc(){if(Qi)return wr;Qi=1;const e=ri(),t=Qc(),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"}]},wr={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},wr}/*!
|
|
202
|
+
*/var xr,Ji;function Jc(){if(Ji)return xr;Ji=1;var e=Yc(),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 xr=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)},xr}var Nn={exports:{}},Qi;function Qc(){return Qi||(Qi=1,function(e,t){var r={};t=e.exports=D;var i;typeof Ha=="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 O(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(O(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(O(u[f.TILDETRIM]),"g");var P="$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(O(u[f.CARETTRIM]),"g");var _="$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(O(u[f.COMPARATORTRIM]),"g");var $="$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 l=0;l<j;l++)i(l,u[l]),d[l]||(d[l]=new RegExp(u[l]),h[l]=new RegExp(O(u[l])));t.parse=w;function w(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof D)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 D(p,x)}catch{return null}}t.valid=I;function I(p,x){var k=w(p,x);return k?k.version:null}t.clean=M;function M(p,x){var k=w(p.trim().replace(/^[=v]+/,""),x);return k?k.version:null}t.SemVer=D;function D(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof D){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 D))return new D(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()}D.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},D.prototype.toString=function(){return this.version},D.prototype.compare=function(p){return i("SemVer.compare",this.version,this.options,p),p instanceof D||(p=new D(p,this.options)),this.compareMain(p)||this.comparePre(p)},D.prototype.compareMain=function(p){return p instanceof D||(p=new D(p,this.options)),W(this.major,p.major)||W(this.minor,p.minor)||W(this.patch,p.patch)},D.prototype.comparePre=function(p){if(p instanceof D||(p=new D(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)},D.prototype.compareBuild=function(p){p instanceof D||(p=new D(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)},D.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=ne;function ne(p,x,k,L){typeof k=="string"&&(L=k,k=void 0);try{return new D(p,k).inc(x,L).version}catch{return null}}t.diff=Z;function Z(p,x){if(_e(p,x))return null;var k=w(p),L=w(x),U="";if(k.prerelease.length||L.prerelease.length){U="pre";var ee="prerelease"}for(var re in k)if((re==="major"||re==="minor"||re==="patch")&&k[re]!==L[re])return U+re;return ee}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=N;function N(p,x){return new D(p,x).major}t.minor=X;function X(p,x){return new D(p,x).minor}t.patch=F;function F(p,x){return new D(p,x).patch}t.compare=de;function de(p,x,k){return new D(p,k).compare(new D(x,k))}t.compareLoose=Le;function Le(p,x){return de(p,x,!0)}t.compareBuild=V;function V(p,x,k){var L=new D(p,k),U=new D(x,k);return L.compare(U)||L.compareBuild(U)}t.rcompare=ke;function ke(p,x,k){return de(x,p,k)}t.sort=ce;function ce(p,x){return p.sort(function(k,L){return t.compareBuild(k,L,x)})}t.rsort=$e;function $e(p,x){return p.sort(function(k,L){return t.compareBuild(L,k,x)})}t.gt=ve;function ve(p,x,k){return de(p,x,k)>0}t.lt=Ne;function Ne(p,x,k){return de(p,x,k)<0}t.eq=_e;function _e(p,x,k){return de(p,x,k)===0}t.neq=Ge;function Ge(p,x,k){return de(p,x,k)!==0}t.gte=tt;function tt(p,x,k){return de(p,x,k)>=0}t.lte=pt;function pt(p,x,k){return de(p,x,k)<=0}t.cmp=mt;function mt(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 _e(p,k,L);case"!=":return Ge(p,k,L);case">":return ve(p,k,L);case">=":return tt(p,k,L);case"<":return Ne(p,k,L);case"<=":return pt(p,k,L);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=xe;function xe(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof xe){if(p.loose===!!x.loose)return p;p=p.value}if(!(this instanceof xe))return new xe(p,x);p=p.trim().split(/\s+/).join(" "),i("comparator",p,x),this.options=x,this.loose=!!x.loose,this.parse(p),this.semver===he?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}var he={};xe.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 D(k[2],this.options.loose):this.semver=he},xe.prototype.toString=function(){return this.value},xe.prototype.test=function(p){if(i("Comparator.test",p,this.options.loose),this.semver===he||p===he)return!0;if(typeof p=="string")try{p=new D(p,this.options)}catch{return!1}return mt(p,this.operator,this.semver,this.options)},xe.prototype.intersects=function(p,x){if(!(p instanceof xe))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 ge(p.value,x),He(this.value,k,x));if(p.operator==="")return p.value===""?!0:(k=new ge(this.value,x),He(p.semver,k,x));var L=(this.operator===">="||this.operator===">")&&(p.operator===">="||p.operator===">"),U=(this.operator==="<="||this.operator==="<")&&(p.operator==="<="||p.operator==="<"),ee=this.semver.version===p.semver.version,re=(this.operator===">="||this.operator==="<=")&&(p.operator===">="||p.operator==="<="),Ee=mt(this.semver,"<",p.semver,x)&&(this.operator===">="||this.operator===">")&&(p.operator==="<="||p.operator==="<"),we=mt(this.semver,">",p.semver,x)&&(this.operator==="<="||this.operator==="<")&&(p.operator===">="||p.operator===">");return L||U||ee&&re||Ee||we},t.Range=ge;function ge(p,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),p instanceof ge)return p.loose===!!x.loose&&p.includePrerelease===!!x.includePrerelease?p:new ge(p.raw,x);if(p instanceof xe)return new ge(p.value,x);if(!(this instanceof ge))return new ge(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()}ge.prototype.format=function(){return this.range=this.set.map(function(p){return p.join(" ").trim()}).join("||").trim(),this.range},ge.prototype.toString=function(){return this.range},ge.prototype.parseRange=function(p){var x=this.options.loose,k=x?h[f.HYPHENRANGELOOSE]:h[f.HYPHENRANGE];p=p.replace(k,st),i("hyphen replace",p),p=p.replace(h[f.COMPARATORTRIM],$),i("comparator trim",p,h[f.COMPARATORTRIM]),p=p.replace(h[f.TILDETRIM],P),p=p.replace(h[f.CARETTRIM],_),p=p.split(/\s+/).join(" ");var L=x?h[f.COMPARATORLOOSE]:h[f.COMPARATOR],U=p.split(" ").map(function(ee){return Ot(ee,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(U=U.filter(function(ee){return!!ee.match(L)})),U=U.map(function(ee){return new xe(ee,this.options)},this),U},ge.prototype.intersects=function(p,x){if(!(p instanceof ge))throw new TypeError("a Range is required");return this.set.some(function(k){return We(k,x)&&p.set.some(function(L){return We(L,x)&&k.every(function(U){return L.every(function(ee){return U.intersects(ee,x)})})})})};function We(p,x){for(var k=!0,L=p.slice(),U=L.pop();k&&L.length;)k=L.every(function(ee){return U.intersects(ee,x)}),U=L.pop();return k}t.toComparators=Ue;function Ue(p,x){return new ge(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=Et(p,x),i("caret",p),p=Ct(p,x),i("tildes",p),p=Ye(p,x),i("xrange",p),p=lt(p,x),i("stars",p),p}function Be(p){return!p||p.toLowerCase()==="x"||p==="*"}function Ct(p,x){return p.trim().split(/\s+/).map(function(k){return It(k,x)}).join(" ")}function It(p,x){var k=x.loose?h[f.TILDELOOSE]:h[f.TILDE];return p.replace(k,function(L,U,ee,re,Ee){i("tilde",p,L,U,ee,re,Ee);var we;return Be(U)?we="":Be(ee)?we=">="+U+".0.0 <"+(+U+1)+".0.0":Be(re)?we=">="+U+"."+ee+".0 <"+U+"."+(+ee+1)+".0":Ee?(i("replaceTilde pr",Ee),we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+U+"."+(+ee+1)+".0"):we=">="+U+"."+ee+"."+re+" <"+U+"."+(+ee+1)+".0",i("tilde return",we),we})}function Et(p,x){return p.trim().split(/\s+/).map(function(k){return Rt(k,x)}).join(" ")}function Rt(p,x){i("caret",p,x);var k=x.loose?h[f.CARETLOOSE]:h[f.CARET];return p.replace(k,function(L,U,ee,re,Ee){i("caret",p,L,U,ee,re,Ee);var we;return Be(U)?we="":Be(ee)?we=">="+U+".0.0 <"+(+U+1)+".0.0":Be(re)?U==="0"?we=">="+U+"."+ee+".0 <"+U+"."+(+ee+1)+".0":we=">="+U+"."+ee+".0 <"+(+U+1)+".0.0":Ee?(i("replaceCaret pr",Ee),U==="0"?ee==="0"?we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+U+"."+ee+"."+(+re+1):we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+U+"."+(+ee+1)+".0":we=">="+U+"."+ee+"."+re+"-"+Ee+" <"+(+U+1)+".0.0"):(i("no pr"),U==="0"?ee==="0"?we=">="+U+"."+ee+"."+re+" <"+U+"."+ee+"."+(+re+1):we=">="+U+"."+ee+"."+re+" <"+U+"."+(+ee+1)+".0":we=">="+U+"."+ee+"."+re+" <"+(+U+1)+".0.0"),i("caret return",we),we})}function Ye(p,x){return i("replaceXRanges",p,x),p.split(/\s+/).map(function(k){return At(k,x)}).join(" ")}function At(p,x){p=p.trim();var k=x.loose?h[f.XRANGELOOSE]:h[f.XRANGE];return p.replace(k,function(L,U,ee,re,Ee,we){i("xRange",p,L,U,ee,re,Ee,we);var nt=Be(ee),et=nt||Be(re),Ae=et||Be(Ee),Fe=Ae;return U==="="&&Fe&&(U=""),we=x.includePrerelease?"-0":"",nt?U===">"||U==="<"?L="<0.0.0-0":L="*":U&&Fe?(et&&(re=0),Ee=0,U===">"?(U=">=",et?(ee=+ee+1,re=0,Ee=0):(re=+re+1,Ee=0)):U==="<="&&(U="<",et?ee=+ee+1:re=+re+1),L=U+ee+"."+re+"."+Ee+we):et?L=">="+ee+".0.0"+we+" <"+(+ee+1)+".0.0"+we:Ae&&(L=">="+ee+"."+re+".0"+we+" <"+ee+"."+(+re+1)+".0"+we),i("xRange return",L),L})}function lt(p,x){return i("replaceStars",p,x),p.trim().replace(h[f.STAR],"")}function st(p,x,k,L,U,ee,re,Ee,we,nt,et,Ae,Fe){return Be(k)?x="":Be(L)?x=">="+k+".0.0":Be(U)?x=">="+k+"."+L+".0":x=">="+x,Be(we)?Ee="":Be(nt)?Ee="<"+(+we+1)+".0.0":Be(et)?Ee="<"+we+"."+(+nt+1)+".0":Ae?Ee="<="+we+"."+nt+"."+et+"-"+Ae:Ee="<="+Ee,(x+" "+Ee).trim()}ge.prototype.test=function(p){if(!p)return!1;if(typeof p=="string")try{p=new D(p,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(ze(this.set[x],p,this.options))return!0;return!1};function ze(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!==he&&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=He;function He(p,x,k){try{x=new ge(x,k)}catch{return!1}return x.test(p)}t.maxSatisfying=gt;function gt(p,x,k){var L=null,U=null;try{var ee=new ge(x,k)}catch{return null}return p.forEach(function(re){ee.test(re)&&(!L||U.compare(re)===-1)&&(L=re,U=new D(L,k))}),L}t.minSatisfying=K;function K(p,x,k){var L=null,U=null;try{var ee=new ge(x,k)}catch{return null}return p.forEach(function(re){ee.test(re)&&(!L||U.compare(re)===1)&&(L=re,U=new D(L,k))}),L}t.minVersion=le;function le(p,x){p=new ge(p,x);var k=new D("0.0.0");if(p.test(k)||(k=new D("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(ee){var re=new D(ee.semver.version);switch(ee.operator){case">":re.prerelease.length===0?re.patch++:re.prerelease.push(0),re.raw=re.format();case"":case">=":(!k||ve(k,re))&&(k=re);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+ee.operator)}})}return k&&p.test(k)?k:null}t.validRange=Te;function Te(p,x){try{return new ge(p,x).range||"*"}catch{return null}}t.ltr=Pe;function Pe(p,x,k){return A(p,x,"<",k)}t.gtr=Se;function Se(p,x,k){return A(p,x,">",k)}t.outside=A;function A(p,x,k,L){p=new D(p,L),x=new ge(x,L);var U,ee,re,Ee,we;switch(k){case">":U=ve,ee=pt,re=Ne,Ee=">",we=">=";break;case"<":U=Ne,ee=tt,re=ve,Ee="<",we="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(He(p,x,L))return!1;for(var nt=0;nt<x.set.length;++nt){var et=x.set[nt],Ae=null,Fe=null;if(et.forEach(function(Ze){Ze.semver===he&&(Ze=new xe(">=0.0.0")),Ae=Ae||Ze,Fe=Fe||Ze,U(Ze.semver,Ae.semver,L)?Ae=Ze:re(Ze.semver,Fe.semver,L)&&(Fe=Ze)}),Ae.operator===Ee||Ae.operator===we||(!Fe.operator||Fe.operator===Ee)&&ee(p,Fe.semver))return!1;if(Fe.operator===we&&re(p,Fe.semver))return!1}return!0}t.prerelease=se;function se(p,x){var k=w(p,x);return k&&k.prerelease.length?k.prerelease:null}t.intersects=me;function me(p,x,k){return p=new ge(p,k),x=new ge(x,k),p.intersects(x)}t.coerce=Ce;function Ce(p,x){if(p instanceof D)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)}}(Nn,Nn.exports)),Nn.exports}var wr,Zi;function Zc(){if(Zi)return wr;Zi=1;const e=ii(),t=Qc(),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"}]},wr={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},wr}/*!
|
|
203
203
|
* is-var-name | ISC (c) Shinnosuke Watanabe
|
|
204
204
|
* https://github.com/shinnn/is-var-name
|
|
205
|
-
*/function eu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const tu=Object.freeze(Object.defineProperty({__proto__:null,default:eu},Symbol.toStringTag,{value:"Module"})),nu=Xa(tu);var Je={},
|
|
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,(N,X)=>X.toUpperCase()),S=z=>`--${z.replace(/([A-Z])/g,"-$1").toLowerCase()}`,O=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],P=["rm ","sudo "];function _(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(P.some(X=>H.indexOf(X)!==-1))throw new Error("Docker CMD is invalid");if(O.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 _(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((N,X)=>{const $=H(N);return $?X.message($):N})).optional():z[W]=r.array().items(r.string().trim()).optional(),z):(H?z[W]=r.string().trim().custom((N,X)=>{const $=H(N);return $?X.message($):N}).optional():z[W]=r.string().trim().optional(),z)},{})}).optional(),I=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 N={};H.forEach($=>{const de=E($.key);c.includes(de)?N[de]=[...N[de]||[],$.value]:N[de]=$.value});const{error:X}=I(z);if(X)return{error:X,value:N};try{_(z)}catch($){return{error:$,value:N}}return N.image=z,N.command=W||"",w.validate(N)};function M(z,W){const H=JSON.parse(JSON.stringify(W)),N=new Map;let X=1;const $=[];return H.forEach(de=>{if(de.key==="--publish"){const V=de.value.split(":");let ke="127.0.0.1",ce="",$e="";V.length===2?[ce,$e]=V:V.length===3?[ke,ce,$e]=V:V.length===1&&($e=V[0]||"");let ve=N.get(ce||"");if(ve||(ve=`$BLOCKLET_PORT_${X++}`,N.set(ce||"",ve)),!$.find(Ne=>Ne.port===ce)){const Ne=de.type||"docker",_e=`${z.replace(/\W/g,"-")}-${$.length+1}`;$.push({type:Ne,proxyBehavior:de.proxyBehavior||"",name:_e,path:`/${_e}`,port:ce||$e,containerPort:Number($e)||0,hostIP:ke,prefix:Ne==="docker"?`/${_e}`:de.prefix||"*"})}}}),$}function ne(z,W=!1){const H=[];if(!z)return H;for(const N of z){const X={name:N.key,default:N.value===`$${N.key}`?"":N.value,secure:N.secure!==void 0?N.secure:!1,shared:N.shared!==void 0?N.shared:!1,required:N.required!==void 0?N.required:!1,description:N.description||N.key};W||(X.custom=N.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 de=$?.match(/(.+?)=(.+)/);if(Array.isArray(X)&&de){const[,V,ke]=de;return V&&ke&&(X=X.find(ce=>{const $e=Object.keys(ce).find(ve=>ve.toLowerCase()===V.toLowerCase());return $e&&ce[$e]===ke})),X}const Le=Object.keys(X).find(V=>V.toLowerCase()===$.toLowerCase());return Le?X[Le]: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=_,Je.dockerParseCommand=f,Je.dockerParseEnvironments=ne,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 Sr,eo;function iu(){if(eo)return Sr;eo=1;const e=el(),t=tl(),r=Hn();return Sr=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})},Sr}var Nt={},to;function ou(){if(to)return Nt;to=1;var e=Nt&&Nt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.didExtension=Nt.fileExtension=void 0;const t=e(rs),r=e(ec()),i=Hn(),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})}}}}});Nt.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 Nt.didExtension=n,Nt.default={fileExtension:s,didExtension:n},Nt}var vn={},Er={exports:{}};const su=["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 no;function au(){if(no)return Er.exports;no=1;var e=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),t=su,r=["node_modules","favicon.ico"],i=Er.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 Er.exports}var ro;function ms(){return ro||(ro=1,function(e){var t=vn&&vn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const r=Hn(),i=t(au()),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}}(vn)),vn}var io;function gs(){if(io)return ie;io=1;var e=ie&&ie.__createBinding||(Object.create?function(K,le,Te,Pe){Pe===void 0&&(Pe=Te);var Se=Object.getOwnPropertyDescriptor(le,Te);(!Se||("get"in Se?!le.__esModule:Se.writable||Se.configurable))&&(Se={enumerable:!0,get:function(){return le[Te]}}),Object.defineProperty(K,Pe,Se)}:function(K,le,Te,Pe){Pe===void 0&&(Pe=Te),K[Pe]=le[Te]}),t=ie&&ie.__setModuleDefault||(Object.create?function(K,le){Object.defineProperty(K,"default",{enumerable:!0,value:le})}:function(K,le){K.default=le}),r=ie&&ie.__importStar||function(){var K=function(le){return K=Object.getOwnPropertyNames||function(Te){var Pe=[];for(var Se in Te)Object.prototype.hasOwnProperty.call(Te,Se)&&(Pe[Pe.length]=Se);return Pe},K(le)};return function(le){if(le&&le.__esModule)return le;var Te={};if(le!=null)for(var Pe=K(le),Se=0;Se<Pe.length;Se++)Pe[Se]!=="default"&&e(Te,le,Pe[Se]);return t(Te,le),Te}}(),i=ie&&ie.__importDefault||function(K){return K&&K.__esModule?K:{default:K}};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(rs),n=i(ri()),o=i(Xc()),a=i(Jc()),d=Zc(),h=i(nu),u=al(),f=Hn(),j=ru(),m=Yo(),E=i(iu()),S=ou(),O=ms(),P=r(ll()),_=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=(K,le)=>(0,P.checkLink)(K)?K:le.message(`Invalid navigation link: ${K}
|
|
205
|
+
*/function eu(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const tu=Object.freeze(Object.defineProperty({__proto__:null,default:eu},Symbol.toStringTag,{value:"Module"})),nu=Xa(tu);var Je={},eo;function ru(){if(eo)return Je;eo=1;const e=ii();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,...N]=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,...N].join(":")}})}function u(z){let W=!0;return z.find(N=>N.key==="--publish"&&N.type==="web")?z.map(N=>{if(N.key==="--publish"){const X={...N,type:W?"docker":N.type};return W=N.type==="web",X}return N}):z.map(N=>{if(N.key==="--publish"){const X={...N,type:W?"web":"docker"};return W=!1,X}return N})}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 N=[],X=[];let F=0,de="",Le="";const V=[];for(;F<H.length;){const ce=H[F];if(!ce){F++;continue}if(ce==="docker"||ce==="run"){F++;continue}if((ce==="-e"||ce==="--env")&&F+1<H.length){const $e=H[F+1]||"",[ve,...Ne]=$e.split("=");if(ve){const _e=Ne.join("=").replace(/^['"]|['"]$/g,"");X.push({key:ve,value:_e})}F+=2;continue}if(ce.startsWith("-")&&V.length===0){const $e=ce.indexOf("=");let ve=ce,Ne=null;$e!==-1&&(ve=ce.substring(0,$e),Ne=ce.substring($e+1).replace(/^['"]|['"]$/g,""));const _e=i[ve];if(!_e){F+=2;continue}if(_e==="--publish"){let Ge="";if(Ne)Ge=Ne,N.push({key:_e,value:Ge});else if(F+1<H.length&&!(H[F+1]||"").startsWith("-")){Ge=(H[F+1]||"").replace(/^['"]|['"]$/g,""),N.push({key:_e,value:Ge}),F+=2;continue}else{N.push({key:_e,value:"true"}),F++;continue}F++;continue}if(Ne!==null){N.push({key:_e,value:Ne}),F++;continue}else if(F+1<H.length&&!(H[F+1]||"").startsWith("-")){const Ge=(H[F+1]||"").replace(/^['"]|['"]$/g,"");N.push({key:_e,value:Ge}),F+=2;continue}else{N.push({key:_e,value:"true"}),F++;continue}}V.push(ce),F++}de=V[0]||"",Le=V.slice(1).join(" ");const ke=[];for(const ce of N)ce.name="",ce.path="",ce.prefix="",ce.protocol="",ce.proxyBehavior="service",ce.type="docker",!(a.has(ce.key)&&ce.value==="true")&&ke.push(ce);for(const ce of X)ce.custom="",ce.description="",ce.secure=!1,ce.shared=!1,ce.required=!1;return{dockerArgs:u(h(ke)),dockerEnvs:X,dockerImage:de,dockerCommand:Le}}function j({dockerArgs:z,dockerEnvs:W,dockerImage:H,dockerCommand:N}){if(z.length===0&&W.length===0&&!H)return"";const X=["docker run \\"],F=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const de of z){const{key:Le,value:V}=de;if(F.has(Le))if(V==="true")X.push(` ${Le} \\`);else{const ke=/[\s"']/g.test(V)?`"${V}"`:V;X.push(` ${Le} ${ke} \\`)}else if(!X.some(ke=>ke.startsWith(` ${Le}`)))if(V==="true")X.push(` ${Le} \\`);else{const ke=/[\s"']/g.test(V)?`"${V}"`:V;X.push(` ${Le} ${ke} \\`)}}for(const de of W){const{key:Le,value:V}=de,ke=/["']/g.test(V)?V:`"${V}"`;X.push(` -e ${Le}=${ke} \\`)}return H&&X.push(` ${H} \\`),N&&X.push(` ${N} \\`),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,(N,X)=>X.toUpperCase()),S=z=>`--${z.replace(/([A-Z])/g,"-$1").toLowerCase()}`,O=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],P=["rm ","sudo "];function _(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(P.some(X=>H.indexOf(X)!==-1))throw new Error("Docker CMD is invalid");if(O.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 $=Array.from(new Set(Object.keys(s).map(E))),l=["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 _(z),z}catch(H){return W.error("any.invalid",{message:H.message})}},"Docker CMD validation"),runBaseScript:r.boolean().optional(),...$.reduce((z,W)=>{const H=m[S(W)];return l.includes(W)?(z[W]=r.array().items(r.string().trim()).optional(),H?z[W]=r.array().items(r.string().trim().custom((N,X)=>{const F=H(N);return F?X.message(F):N})).optional():z[W]=r.array().items(r.string().trim()).optional(),z):(H?z[W]=r.string().trim().custom((N,X)=>{const F=H(N);return F?X.message(F):N}).optional():z[W]=r.string().trim().optional(),z)},{})}).optional(),I=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)},M=(z,W,H)=>{const N={};H.forEach(F=>{const de=E(F.key);l.includes(de)?N[de]=[...N[de]||[],F.value]:N[de]=F.value});const{error:X}=I(z);if(X)return{error:X,value:N};try{_(z)}catch(F){return{error:F,value:N}}return N.image=z,N.command=W||"",w.validate(N)};function D(z,W){const H=JSON.parse(JSON.stringify(W)),N=new Map;let X=1;const F=[];return H.forEach(de=>{if(de.key==="--publish"){const V=de.value.split(":");let ke="127.0.0.1",ce="",$e="";V.length===2?[ce,$e]=V:V.length===3?[ke,ce,$e]=V:V.length===1&&($e=V[0]||"");let ve=N.get(ce||"");if(ve||(ve=`$BLOCKLET_PORT_${X++}`,N.set(ce||"",ve)),!F.find(Ne=>Ne.port===ce)){const Ne=de.type||"docker",_e=`${z.replace(/\W/g,"-")}-${F.length+1}`;F.push({type:Ne,proxyBehavior:de.proxyBehavior||"",name:_e,path:`/${_e}`,port:ce||$e,containerPort:Number($e)||0,hostIP:ke,prefix:Ne==="docker"?`/${_e}`:de.prefix||"*"})}}}),F}function ne(z,W=!1){const H=[];if(!z)return H;for(const N of z){const X={name:N.key,default:N.value===`$${N.key}`?"":N.value,secure:N.secure!==void 0?N.secure:!1,shared:N.shared!==void 0?N.shared:!1,required:N.required!==void 0?N.required:!1,description:N.description||N.key};W||(X.custom=N.custom||""),H.push(X)}return H}function Z(z,W){const H=JSON.parse(JSON.stringify(z));return W.split(".").map(X=>{const F=X.match(/(.+)\[(.+?)\]/);return F?[F[1],F[2]]:X}).flat().filter(Boolean).reduce((X,F)=>{if(!X||!F)return;const de=F?.match(/(.+?)=(.+)/);if(Array.isArray(X)&&de){const[,V,ke]=de;return V&&ke&&(X=X.find(ce=>{const $e=Object.keys(ce).find(ve=>ve.toLowerCase()===V.toLowerCase());return $e&&ce[$e]===ke})),X}const Le=Object.keys(X).find(V=>V.toLowerCase()===F.toLowerCase());return Le?X[Le]: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=_,Je.dockerParseCommand=f,Je.dockerParseEnvironments=ne,Je.dockerParsePublishPorts=D,Je.dockerSchema=w,Je.getObjByPath=Z,Je.isVolumePath=d,Je.multiValueArgs=l,Je.notAllowUseCustomDockerArgs=o,Je.parseDockerArgsToSchema=M,Je.whiteDockerArgs=i,Je}var Sr,to;function iu(){if(to)return Sr;to=1;const e=el(),t=tl(),r=Hn();return Sr=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})},Sr}var Nt={},no;function ou(){if(no)return Nt;no=1;var e=Nt&&Nt.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.didExtension=Nt.fileExtension=void 0;const t=e(rs),r=e(ec()),i=Hn(),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})}}}}});Nt.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 Nt.didExtension=n,Nt.default={fileExtension:s,didExtension:n},Nt}var vn={},Er={exports:{}};const su=["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 ro;function au(){if(ro)return Er.exports;ro=1;var e=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),t=su,r=["node_modules","favicon.ico"],i=Er.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 Er.exports}var io;function ms(){return io||(io=1,function(e){var t=vn&&vn.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const r=Hn(),i=t(au()),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}}(vn)),vn}var oo;function gs(){if(oo)return ie;oo=1;var e=ie&&ie.__createBinding||(Object.create?function(K,le,Te,Pe){Pe===void 0&&(Pe=Te);var Se=Object.getOwnPropertyDescriptor(le,Te);(!Se||("get"in Se?!le.__esModule:Se.writable||Se.configurable))&&(Se={enumerable:!0,get:function(){return le[Te]}}),Object.defineProperty(K,Pe,Se)}:function(K,le,Te,Pe){Pe===void 0&&(Pe=Te),K[Pe]=le[Te]}),t=ie&&ie.__setModuleDefault||(Object.create?function(K,le){Object.defineProperty(K,"default",{enumerable:!0,value:le})}:function(K,le){K.default=le}),r=ie&&ie.__importStar||function(){var K=function(le){return K=Object.getOwnPropertyNames||function(Te){var Pe=[];for(var Se in Te)Object.prototype.hasOwnProperty.call(Te,Se)&&(Pe[Pe.length]=Se);return Pe},K(le)};return function(le){if(le&&le.__esModule)return le;var Te={};if(le!=null)for(var Pe=K(le),Se=0;Se<Pe.length;Se++)Pe[Se]!=="default"&&e(Te,le,Pe[Se]);return t(Te,le),Te}}(),i=ie&&ie.__importDefault||function(K){return K&&K.__esModule?K:{default:K}};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(rs),n=i(ii()),o=i(Xc()),a=i(Jc()),d=Zc(),h=i(nu),u=al(),f=Hn(),j=ru(),m=Yo(),E=i(iu()),S=ou(),O=ms(),P=r(ll()),_=o.default.default,$="/.well-known",l=n.default.extend(d.semver).extend(d.semverRange).extend(S.fileExtension).extend(S.didExtension);ie.Joi=l;const w=(K,le)=>(0,P.checkLink)(K)?K:le.message(`Invalid navigation link: ${K}
|
|
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(K=>{if(_(K)>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 K}).meta({className:"TTitle"});ie.titleSchema=B;const M=c.string().trim().min(3).max(160).meta({className:"TDescription"});ie.descriptionSchema=M;const ne=c.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});ie.installBlockletTitleSchema=ne;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((K,le)=>K.includes(u.WELLKNOWN_BLOCKLET_LOGO_PATH)?le.message(`logo url should not include ${u.WELLKNOWN_BLOCKLET_LOGO_PATH}`):K).meta({className:"TLogo"});ie.logoSchema=z;const W=c.string().trim().min(1),H=W.meta({className:"TMountPoint"}).custom((K,le)=>(0,P.isValidUrlPath)(K)?K:le.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));ie.mountPointSchema=H;const N=W.meta({className:"TUpdateMountPoint"}).custom(K=>(0,P.default)(K));ie.updateMountPointSchema=N;const X=c.string().custom(K=>((0,O.validateName)(K),K)).meta({className:"TBlockletName"});ie.blockletNameSchema=X;const $=[],de=c.string().trim().min(1).max(50).required().custom((K,le)=>K.startsWith("BLOCKLET")&&!$.includes(K)?le.message("Env name can not start with BLOCKLET_"):K.startsWith("COMPONENT")?le.message("Env name can not start with COMPONENT_"):K.startsWith("ABTNODE")?le.message("Env name can not start with ABTNODE_"):/[^\w]/.test(K)?le.message('Env name can include only numbers or letters or "_"'):K).meta({className:"TEnvironmentName",unknownType:"any"});ie.environmentNameSchema=de;const Le=c.object({name:de.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(K=>K.secure?!1:void 0)}).custom((K,le)=>K.secure&&K.default?le.message(`Cannot declare default value for secure env ${K.name}`):K).meta({className:"TEnvironment",unknownType:"any"});ie.environmentSchema=Le;const V=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=V;const ke=c.object({name:c.string().required().trim(),config:c.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});ie.serviceSchema=ke;const ce=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=ce;const $e=c.string().trim().custom((K,le)=>{const Te=K.split("/").filter(Boolean);return Te.length===0?le.message("cacheable path must be a valid pathname that is not /"):`/${Te.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});ie.cacheableSchema=$e;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($e).unique(),services:c.array().items(ke).unique("name"),endpoints:c.array().items(ce).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 Ne=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")})),_e=c.object({platform:c.string().valid(...m.BLOCKLET_PLATFORMS).optional(),interpreter:c.string().valid("binary","node","blocklet","bun").default("node"),source:Ne,args:c.array().items(c.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});ie.engineSchema=_e;const Ge=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=Ge;const tt=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=tt;const pt=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=pt;const xe={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},he=(K,le)=>c.object(K).custom((Te,Pe)=>!le&&Te.source&&Te.source.name&&!Te.source.store?Pe.message(`missing 'store' in source of component ${Te.name}`):Te),ge=he(xe).meta({className:"TComponent",unknownType:"any"});ie.componentSchema=ge;const We=he(xe,!0),Ue=({checkStore:K}={})=>{const le=[ge,We];return c.array().items(K?le[0]:le[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 Be=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Ct={id:c.string().custom(I),title:c.alternatives().try(c.string().min(1).max(m.MAX_TITLE_LENGTH),c.object().min(1).pattern(c.string().valid(...Be),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(...Be),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(...Be),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(),private:c.boolean()},It=c.object({...Ct,items:c.array().items(c.object({...Ct}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});ie.navigationItemSchema=It;const Et=c.array().items(It).unique((K,le)=>K.id&&le.id?K.id===le.id:!1).meta({className:"TNavigation",unknownType:"any"});ie.navigationSchema=Et;const Rt=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=Rt;const Ye=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=Ye;const At=c.object({type:c.string().trim().min(1).required(),description:c.string().trim().min(1)}),lt=c.object({did:c.DID().trim().required(),type:c.string().trim().min(1).required(),public:c.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});ie.resourceBundleSchema=lt;const st=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=st;const ze={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:Ge.optional(),contributors:c.array().items(Ge).optional(),maintainers:c.array().items(Ge).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(K=>{if(K.length===0)return K;const le=K.reduce((Te,Pe)=>Te+Pe.value,0);if(le!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${le}`);return K},"invalid blocklet share"),componentPrice:c.array().items(c.object({parentPriceRange:c.array().items(c.number()).custom((K,le)=>K.length!==2?le.message("length of range should be 2"):K[0]<0?le.message("the first value should not less than 0 in range"):K[1]<=K[0]?le.message("the second value should greater than the first value in range"):K),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(),aigne:c.boolean().optional()}).default({server:m.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:c.array().items(ve).unique("name").custom((K,le)=>{if(K.filter(Se=>Se.type===m.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return le.message(`Only one ${m.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const Pe=K.filter(Se=>Se.type===m.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const Se of Pe)if(!Se.prefix.startsWith(D))return le.message(`Wellknown path prefix must start with: ${D}`);return K}).default([]),environments:c.array().items(Le).default([]).optional().custom((K,le)=>{if(K&&K.length){const Te=K.filter((Pe,Se)=>K.findIndex(A=>A.name===Pe.name)!==Se);if(Te.length)return le.message(`find duplicate environment names ${Te.map(Pe=>Pe.name).join(", ")}`)}return K}),scripts:V,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(lt),types:c.array().items(At).max(10)}),engine:c.alternatives().try(_e,c.array().items(_e)).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:tt.optional(),stats:pt.optional(),htmlAst:c.any().optional(),path:c.string().optional(),signatures:c.array().items(Ot).optional(),lastPublishedAt:c.string().isoDate().optional().allow(null),components:Ue(),navigation:Et,theme:Rt,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:st.optional()},He=c.object(ze).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});ie.blockletMetaSchema=He;const gt=(K,{ensureFiles:le=!1,ensureDist:Te=!1,ensureComponentStore:Pe=!0,ensureName:Se=!1,skipValidateDidName:A=!1,...se}={})=>((!K||!s.default.existsSync(K))&&(le=!1),c.object({...ze,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:le?c.file().trim().exists({baseDir:K}).optional():c.string().trim().optional(),files:c.array().items(le?c.file().exists({baseDir:K,canSkip:(me,Ce)=>[m.BLOCKLET_ENTRY_FILE,m.BLOCKLET_BUNDLE_FILE].includes(Ce)||(0,a.default)(Ce)}):c.string().trim()).optional(),dist:Te?tt.required():tt.optional(),components:Ue({checkStore:Pe}),name:Se?c.string().optional():c.string().required(),egress:c.boolean().optional().default(!0),docker:j.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...se}).rename("children","components").custom((me,Ce)=>{const{did:p,name:x,docker:k}=me;if(k){const{image:U,dockerfile:ee,network:re}=k;if(!U&&!ee)return Ce.message("Image or dockerfile must be set");if(U&&ee)return Ce.message("Image and dockerfile cannot be set at the same time");if(re)return Ce.message("ExportPorts and network cannot be set at the same time");ee&&(me.files||(me.files=[]),me.files.push(ee))}let L;if((0,f.isValid)(p))try{return(0,O.validateNewDid)(p),me}catch(U){L=U}if(x){(0,O.validateName)(x,{checkDid:!A});const U=(0,E.default)(x);return U!==p?Ce.message(`The did of name "${x}" should be "${U}"`):me}return L?Ce.message(L.message):me}));return ie.createBlockletSchema=gt,ie.default={blockletNameSchema:X,componentSchema:ge,endpointSchema:ce,serviceSchema:ke,createBlockletSchema:gt,interfaceSchema:ve,environmentSchema:Le,environmentNameSchema:de,scriptsSchema:V,personSchema:Ge,distSchema:tt,titleSchema:B,descriptionSchema:M,logoSchema:z,navigationSchema:Et,themeSchema:Rt,mountPointSchema:H,updateMountPointSchema:N,authConfigSchema:Ye,resourceBundleSchema:lt,installBlockletTitleSchema:ne,installBlockletDescriptionSchema:Z,eventsSchema:st,Joi:c},ie}var ft={},oo;function lu(){if(oo)return ft;oo=1;var e=ft&&ft.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(ft,"__esModule",{value:!0}),ft.setService=ft.findService=ft.getDefaultServiceConfig=ft.getServiceConfig=void 0;const t=e(tc),r=gs(),i={},s=h=>{i[h.name]={validate:h.schema.validate.bind(h.schema),defaultConfig:h.default}};ft.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(O=>O.message).join(", ")}`);return E};ft.getServiceConfig=o;const a=h=>{const{defaultConfig:u}=n(h);return u};ft.getDefaultServiceConfig=a;const d=(h,u)=>{const f=[u];return(h||[]).find(j=>f.includes(j.name))};return ft.findService=d,ft.default={getServiceConfig:o,getDefaultServiceConfig:a,findService:d,setService:s},ft}var so;function cu(){if(so)return Gt;so=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.fixAndValidateService=Gt.validateMeta=void 0;const e=gs(),t=lu(),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);Gt.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 Gt.validateMeta=i,Gt.default=i,Gt}var ao;function uu(){return ao||(ao=1,function(e){var t=Tt&&Tt.__createBinding||(Object.create?function(w,I,B,M){M===void 0&&(M=B);var ne=Object.getOwnPropertyDescriptor(I,B);(!ne||("get"in ne?!I.__esModule:ne.writable||ne.configurable))&&(ne={enumerable:!0,get:function(){return I[B]}}),Object.defineProperty(w,M,ne)}:function(w,I,B,M){M===void 0&&(M=B),w[M]=I[B]}),r=Tt&&Tt.__setModuleDefault||(Object.create?function(w,I){Object.defineProperty(w,"default",{enumerable:!0,value:I})}:function(w,I){w.default=I}),i=Tt&&Tt.__importStar||function(){var w=function(I){return w=Object.getOwnPropertyNames||function(B){var M=[];for(var ne in B)Object.prototype.hasOwnProperty.call(B,ne)&&(M[M.length]=ne);return M},w(I)};return function(I){if(I&&I.__esModule)return I;var B={};if(I!=null)for(var M=w(I),ne=0;ne<M.length;ne++)M[ne]!=="default"&&t(B,I,M[ne]);return r(B,I),B}}(),s=Tt&&Tt.__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(Gc()),a=Yo(),d=cu();Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const h=ms(),u=(w,I)=>{w.description||(w.description=`Blocklet from ${I}`),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 I=o.fromUrl(w.repository.url);I&&(w.repository.url=I.getDefaultRepresentation()==="shortcut"?I.https():I.toString())}};e.fixRepository=f;const j=w=>{Array.isArray(w.files)?w.files&&(w.files=w.files.filter(I=>!(!I||typeof I!="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(I=>!(typeof I!="string"||!I)))};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(I=>!(typeof I!="string"||!I)))};e.fixTags=E;const S=(w,I)=>(w.author&&(w.author=I(w.author)),["maintainers","contributors"].forEach(B=>{Array.isArray(w[B])&&(w[B]=w[B].map(I))}),w),O=w=>{if(!w)return"";if(typeof w=="string")return w;const I=w.name||"",B=w.url||w.web,M=B?` (${B})`:"",ne=w.email||w.mail,Z=ne?` <${ne}>`:"";return I+Z+M};e.formatPerson=O;const P=w=>{if(typeof w!="string")return w;const I=w.match(/^([^(<]+)/),B=w.match(/\(([^)]+)\)/),M=w.match(/<([^>]+)>/),ne={};return I&&I[0].trim()&&(ne.name=I[0].trim()),M&&([,ne.email]=M),B&&([,ne.url]=B),ne};e.parsePerson=P;const _=w=>(S(w,O),S(w,P),w);e.fixPerson=_;const D=(w,I=!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:"/",ne=({type:Z="web",name:z,path:W="/",protocol:H="http",port:N=a.BLOCKLET_DEFAULT_PORT_NAME})=>{w.interfaces.push({type:Z,name:z,path:W,prefix:M,port:N,protocol:H})};return[a.BLOCKLET_INTERFACE_PUBLIC].forEach(Z=>{w[Z]&&ne({name:Z,path:w[Z]})}),Array.isArray(w.exposeServices)&&w.exposeServices.forEach(Z=>{ne({type:"service",name:Z.protocol,protocol:Z.protocol,port:{internal:`BLOCKLET_${Z.protocol}_PORT`.toUpperCase(),external:Z.port}})}),I&&(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:I}=w;try{(0,h.validateNewDid)(I),w.name=I}catch{}return w};e.fixName=c,e.default={fixRequired:u,fixRepository:f,fixFiles:j,fixKeywords:m,fixPerson:_,fixTags:E,fixName:c,formatPerson:O,parsePerson:P,fixInterfaces:D,fixService:d.fixAndValidateService}}(Tt)),Tt}var du=uu();function vs({owner:e,locale:t}){return l.jsxs(te,{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]})}vs.propTypes={owner:F.object.isRequired,locale:F.string.isRequired};const hu="install-blocklet-from-URL",ys=()=>{const[e,t]=oi(hu,"[]",{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 bs({value:e="",onValueChange:t=()=>{},children:r=null,helperText:i=""}){const{urls:s,removeUrlRecord:n}=ys(),o=(a,d)=>{a.preventDefault(),a.stopPropagation(),n(d)};return l.jsxs(te,{children:[l.jsx(Ao,{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(Do,{...a,key:d,secondaryAction:l.jsx(No,{edge:"end","aria-label":"delete",onClick:h=>o(h,d),children:l.jsx(va,{})})},l.jsx(ya,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:l.jsx(Mo,{primary:d,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),l.jsx(ba,{style:{margin:0},children:i})]})}bs.propTypes={onValueChange:F.func,children:F.node,value:F.string,helperText:F.string};function xs({onClick:e}){const{t}=St();return l.jsx(ul,{title:t("launchBlocklet.withoutWallet"),icon:l.jsx(xt,{icon:dl,fontSize:"1em"}),onClick:e})}xs.propTypes={onClick:F.func.isRequired};function ws({defaultUrl:e="",onCancel:t,onSuccess:r,onError:i=()=>{},mode:s="install",handleText:n={}}){const{api:o}=un(),{api:a,session:d}=nc(),[h,u]=q.useState(!1),[f,j]=q.useState(""),{t:m,locale:E}=St(),S={dist:{}},{encryptKey:O}=hl(),[P,_]=q.useState(e),[D,c]=q.useState(e?1:0),[w,I]=q.useState(S),[B,M]=q.useState(!1),[ne,Z]=q.useState(""),[z]=oi("instant-blocklet-install",!1),[W,H]=q.useState({}),N=s==="component",X=N?!0:!e,{addUrlRecord:$}=ys(),de=q.useMemo(()=>(d.user?.connectedAccounts||[]).some(We=>We.provider===Bt.LOGIN_PROVIDER.WALLET),[d.user]),Le=q.useMemo(()=>{let he=P.trim();return!he.startsWith("https://")&&!he.startsWith("http://")&&!he.startsWith("file://")&&(he=`file://${he}`),he},[P]),V=async()=>{I(S),j(null),u(!0);const he=Le;try{const ge=decodeURIComponent(he);try{new URL(ge)}catch{throw new Error("Invalid URL")}const{meta:We,inStore:Ue,registryUrl:Ot}=await o.getBlockletMetaFromUrl({input:{url:ge}});I(We),H({inStore:Ue,registryUrl:Ot,inputUrl:he}),$(he)}catch(ge){console.error(ge);const We=`Blocklet Install failed: ${$r(ge)}`;j(We),i(ge)}finally{u(!1)}},ke=()=>{if(N){r({meta:w,...W}),t();return}if(z){u(!0),M(!0);return}const he=nn(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=Qn(he,{blocklet_meta_url:decodeURIComponent(Le.trim()),from:"url"})},ce=()=>{u(!1),M(!1),r({meta:w,...W}),t()},$e=()=>{u(!1),M(!1)};q.useEffect(()=>{e&&V()},[e]);const ve=q.useMemo(()=>({title:w.title,wt:fl(w),blockletMetaUrl:decodeURIComponent(P.trim())}),[w,P]),Ne=q.useCallback(async()=>{if(de||z){Z("");return}const he=new URL(window.location.href);he.pathname=nn(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),he.searchParams.set("_ek_",O),Object.keys(ve).forEach(We=>{he.searchParams.set(We,ve[We])});const{data:ge}=await a.get(he.href);ge.url?Z(ge.url):Z("")},[de,ve,a,O,z]);q.useEffect(()=>{Ne()},[Ne]);const _e=q.useMemo(()=>de&&ne?{...ve,nw:ne,skipMigrateAccount:!0}:ve,[ve,ne,de]),Ge=[{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(rc,{did:w.did}):null},{name:m("common.author"),value:w.owner?l.jsx(vs,{owner:w.owner,locale:E}):du.formatPerson(w.author)},{name:m("blocklet.dist.downloadLink"),value:w.dist.tarball}],tt=()=>h?l.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:l.jsx(jt,{})}):w.did?l.jsx("div",{style:{paddingLeft:"10%"},children:Ge.map(he=>he.name===m("common.did")?l.jsx(Li,{valueComponent:"div",nameWidth:120,name:he.name,nameFormatter:()=>m("common.did"),children:he.value},he.name):l.jsx(Li,{valueComponent:"div",nameWidth:120,name:he.name,children:he.value},he.name))}):null,pt=Xl(async()=>{let he=w.title;d.user&&(he=`${d.user.fullName}'s ${w.title}`);try{ce(),await o.launchBlockletWithoutWallet({input:{title:he,blockletMetaUrl:decodeURIComponent(P.trim()),type:"store",storeUrl:W.registryUrl,onlyRequired:!0}})}catch(ge){console.error("launchBlockletWithoutWallet error:",ge),Xn.error($r(ge),{autoHideDuration:3e3})}}),mt=[{label:m("blocklet.fromUrl.step0"),body:l.jsx(Ie,{component:"div",children:l.jsx(bs,{style:{marginBottom:32},value:P,helperText:m("blocklet.fromUrl.description"),onValueChange:he=>{j(null),_(he)},children:l.jsx(Gn,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:P,onChange:he=>{j(null),_(he.target.value)},disabled:h,onKeyPress:he=>{he.key==="Enter"&&(he.preventDefault(),V(),c(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:t,onConfirm:()=>{V(),c(1)}},{label:m("blocklet.fromUrl.step1"),body:tt(),cancel:m(X?"common.pre":"common.cancel"),confirm:n?.confirm||m("blocklet.fromUrl.confirm"),onCancel:()=>{X?c(he=>he-1):t()},onConfirm:()=>{ke()}}],xe=mt[D];return l.jsxs(l.Fragment,{children:[l.jsxs(ii,{title:n?.title||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>xe.onCancel(),showCloseButton:D===0,disableEscapeKeyDown:!0,open:!0,actions:l.jsxs(l.Fragment,{children:[xe.cancel&&l.jsx(bt,{onClick:he=>{he.stopPropagation(),j(null),xe.onCancel()},color:"inherit",children:xe.cancel||m("common.cancel")}),l.jsxs(bt,{onClick:he=>{he.stopPropagation(),xe.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:h||!P||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[h&&D===0&&l.jsx(jt,{size:16}),xe.confirm]})]}),children:[X&&l.jsx(xa,{alternativeLabel:!0,activeStep:D,children:mt.map(({label:he})=>l.jsx(wa,{children:l.jsx(Sa,{children:he})},he))}),l.jsx(Ea,{component:"div",style:{marginTop:24},children:xe.body}),!!f&&l.jsx(Bo,{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:!de&&!z?"bind-wallet":"launch-free-blocklet-by-session",checkFn:a.get,checkTimeout:5*60*1e3,onSuccess:ce,extraParams:_e,messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:$e,customItems:z?[]:[l.jsx(xs,{onClick:pt})]})]})}ws.propTypes={defaultUrl:F.string,onCancel:F.func.isRequired,onSuccess:F.func.isRequired,onError:F.func,mode:F.oneOf(["install","component"]),handleText:F.object};const fu={meta:F.object.isRequired,onCancel:F.func.isRequired};function Ss({action:e,onSelect:t,onNext:r}){const{t:i}=St(),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(ka,{children:s.map(n=>l.jsxs(Do,{button:!0,selected:e===n.action,onClick:()=>t(n.action),children:[l.jsx(Ta,{sx:{minWidth:48},children:n.action==="purchase"?l.jsx(ja,{style:{color:e==="purchase"?ji.primary.main:"#AAA",fontSize:32}}):l.jsx(Oa,{style:{color:e==="verify"?ji.primary.main:"#AAA",fontSize:32}})}),l.jsx(Mo,{primary:n.title,secondary:n.description})]},n.action))}),r&&l.jsx(bt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:i("common.next")})]})}Ss.propTypes={action:F.oneOf(["both","purchase","verify"]).isRequired,onSelect:F.func.isRequired,onNext:F.func.isRequired};function Es({meta:e,onCancel:t,mode:r,handlePaySuccess:i=()=>{}}){const{t:s,locale:n}=St(),{info:o}=un(),a=pl(o),[d,h]=q.useState(null),u=new URL(e?.registryUrl).origin,f=$t.getDisplayName({meta:e}),j=async(E,S)=>{const O=({downloadTokenList:D})=>{i({downloadTokenList:D})},P=D=>{Xn.error(D),t(D)};function _(D){return gl(()=>_i.get(D).then(async({data:c})=>{const w=c?.downloadTokenList;if(c.status==="succeed"){if(w&&w.length)await O({downloadTokenList:w});else return await P(s("blocklet.component.missDownloadTokenTip")),!0;return!0}return c.status==="error"?(console.error("vc error: ",c),await P(c?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:D}=ml(d);await _(D)}else await O({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{_i.get(E.href).then(({data:S})=>{const O=`${S.url}`;h(O)})}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:Pi.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:Pi.create({baseURL:nn(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]})}Es.propTypes={...fu,handlePaySuccess:F.func,mode:F.oneOf(["verify","purchase"]).isRequired};function ks({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(Ss,{action:i,onNext:null,onSelect:a})}):l.jsx(Es,{...r,mode:i})}ks.propTypes={mode:F.oneOf(["both","verify","purchase"]).isRequired,ref:F.any};function pu({...e}){return l.jsx(bt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Ts({blocklet:e=null,onStartNow:t=()=>{},children:r=null,disabled:i=!1}){const{t:s}=St(),n=is();return!e||vl(e.meta)?l.jsx(mu,{children:r}):l.jsxs(gu,{isMobile:n,children:[l.jsx(pu,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>t(),children:s("setup.startNow")}),l.jsx(te,{sx:{display:"flex",alignItems:"center"},children:r})]})}Ts.propTypes={blocklet:F.object,onStartNow:F.func,children:F.any,disabled:F.bool};const mu=ot(te)`
|
|
220
|
+
`),M=l.string().trim().min(1).custom(K=>{if(_(K)>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 K}).meta({className:"TTitle"});ie.titleSchema=M;const D=l.string().trim().min(3).max(160).meta({className:"TDescription"});ie.descriptionSchema=D;const ne=l.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});ie.installBlockletTitleSchema=ne;const Z=l.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});ie.installBlockletDescriptionSchema=Z;const z=l.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((K,le)=>K.includes(u.WELLKNOWN_BLOCKLET_LOGO_PATH)?le.message(`logo url should not include ${u.WELLKNOWN_BLOCKLET_LOGO_PATH}`):K).meta({className:"TLogo"});ie.logoSchema=z;const W=l.string().trim().min(1),H=W.meta({className:"TMountPoint"}).custom((K,le)=>(0,P.isValidUrlPath)(K)?K:le.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));ie.mountPointSchema=H;const N=W.meta({className:"TUpdateMountPoint"}).custom(K=>(0,P.default)(K));ie.updateMountPointSchema=N;const X=l.string().custom(K=>((0,O.validateName)(K),K)).meta({className:"TBlockletName"});ie.blockletNameSchema=X;const F=[],de=l.string().trim().min(1).max(50).required().custom((K,le)=>K.startsWith("BLOCKLET")&&!F.includes(K)?le.message("Env name can not start with BLOCKLET_"):K.startsWith("COMPONENT")?le.message("Env name can not start with COMPONENT_"):K.startsWith("ABTNODE")?le.message("Env name can not start with ABTNODE_"):/[^\w]/.test(K)?le.message('Env name can include only numbers or letters or "_"'):K).meta({className:"TEnvironmentName",unknownType:"any"});ie.environmentNameSchema=de;const Le=l.object({name:de.required(),description:l.string().trim().required(),default:l.string().optional().allow("").default(""),required:l.boolean().default(!1),secure:l.boolean().default(!1),validation:l.string().optional(),shared:l.boolean().default(K=>K.secure?!1:void 0)}).custom((K,le)=>K.secure&&K.default?le.message(`Cannot declare default value for secure env ${K.name}`):K).meta({className:"TEnvironment",unknownType:"any"});ie.environmentSchema=Le;const V=l.object({dev:l.string().trim().min(1),e2eDev:l.string().trim().min(1),preFlight:l.string().trim().min(1),preInstall:l.string().trim().min(1),postInstall:l.string().trim().min(1),preStart:l.string().trim().min(1),postStart:l.string().trim().min(1),preStop:l.string().trim().min(1),preUninstall:l.string().trim().min(1),preConfig:l.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=V;const ke=l.object({name:l.string().required().trim(),config:l.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});ie.serviceSchema=ke;const ce=l.object({type:l.string().trim(!0).min(1).required(),path:l.string().required(),meta:l.object({vcType:l.string(),payable:l.boolean(),params:l.array().items({name:l.string().required().trim(),description:l.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});ie.endpointSchema=ce;const $e=l.string().trim().custom((K,le)=>{const Te=K.split("/").filter(Boolean);return Te.length===0?le.message("cacheable path must be a valid pathname that is not /"):`/${Te.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});ie.cacheableSchema=$e;const ve=l.object({type:l.string().lowercase().valid(...m.BLOCKLET_INTERFACE_TYPES).required(),name:l.string().trim().required(),path:l.string().trim().default("/"),prefix:l.string().trim().min(1).default(m.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:l.number().port().optional(),hostIP:l.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:l.string().lowercase().valid(...m.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:l.alternatives().try(l.string().uppercase().default(m.BLOCKLET_DEFAULT_PORT_NAME),l.object({internal:l.string().uppercase().required(),external:l.number().port().required()})).default(m.BLOCKLET_DEFAULT_PORT_NAME),cacheable:l.array().items($e).unique(),services:l.array().items(ke).unique("name"),endpoints:l.array().items(ce).unique("type"),pageGroups:l.array().items(l.string().min(1).max(255).trim()).unique(),proxyBehavior:l.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});ie.interfaceSchema=ve;const Ne=l.alternatives().try(l.string().required(),l.object({url:l.string().uri({scheme:["http","https","file"]}).required(),name:X.required(),version:l.alternatives().try(l.string().valid("latest"),l.semverRange().valid())}),l.object({store:l.string().uri({scheme:["http","https"]}).required(),name:X.required(),version:l.alternatives().try(l.string().valid("latest"),l.semverRange().valid()).default("latest")})),_e=l.object({platform:l.string().valid(...m.BLOCKLET_PLATFORMS).optional(),interpreter:l.string().valid("binary","node","blocklet","bun").default("node"),source:Ne,args:l.array().items(l.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});ie.engineSchema=_e;const Ge=l.object({name:l.string().min(1).required(),email:l.string().email({tlds:!1}).optional(),url:l.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});ie.personSchema=Ge;const tt=l.object({tarball:l.alternatives().try(l.string().uri(),l.string()).required(),integrity:l.string().required(),size:l.number().optional()}).meta({className:"TDist",unknownType:"any"});ie.distSchema=tt;const pt=l.object({downloads:l.number().integer().greater(-1),star:l.number().default(0),purchases:l.number().default(0)}).meta({className:"TStats",unknownType:"any"});ie.statsSchema=pt;const xe={source:l.alternatives().try(l.object({url:l.alternatives().try(l.string().uri(),l.array().items(l.string().uri()).min(1)).required(),version:l.alternatives().try(l.string().valid("latest"),l.semverRange().valid())}),l.object({store:l.string().uri({scheme:["http","https"]}),name:X.required(),version:l.alternatives().try(l.string().valid("latest"),l.semverRange().valid()).default("latest")})).required(),required:l.boolean(),title:M,description:D,mountPoint:H,name:X},he=(K,le)=>l.object(K).custom((Te,Pe)=>!le&&Te.source&&Te.source.name&&!Te.source.store?Pe.message(`missing 'store' in source of component ${Te.name}`):Te),ge=he(xe).meta({className:"TComponent",unknownType:"any"});ie.componentSchema=ge;const We=he(xe,!0),Ue=({checkStore:K}={})=>{const le=[ge,We];return l.array().items(K?le[0]:le[1]).optional().default([])},Ot=l.object({type:l.string().required(),name:l.string().required(),signer:l.string().required(),pk:l.string().required(),created:l.string().isoDate().required(),sig:l.string().required(),excludes:l.array().items(l.string()).optional(),appended:l.array().items(l.string()).optional(),delegatee:l.string(),delegateePk:l.string(),delegation:l.string()}).meta({className:"TSignature",unknownType:"any"});ie.signatureSchema=Ot;const Be=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Ct={id:l.string().custom(I),title:l.alternatives().try(l.string().min(1).max(m.MAX_TITLE_LENGTH),l.object().min(1).pattern(l.string().valid(...Be),l.string().min(1).max(m.MAX_TITLE_LENGTH))).required(),description:l.alternatives().try(l.string().min(1).max(m.MAX_DESCRIPTION_LENGTH),l.object().min(1).pattern(l.string().valid(...Be),l.string().min(1).max(m.MAX_DESCRIPTION_LENGTH))),link:l.alternatives().try(l.string().custom(w),l.object().min(1).pattern(l.string().valid(...Be),l.string().custom(w))),component:l.string().min(1),section:l.array().items(l.string().min(1)).single(),role:l.array().items(l.string().min(1)).single(),icon:l.string().min(1),visible:l.boolean(),private:l.boolean()},It=l.object({...Ct,items:l.array().items(l.object({...Ct}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});ie.navigationItemSchema=It;const Et=l.array().items(It).unique((K,le)=>K.id&&le.id?K.id===le.id:!1).meta({className:"TNavigation",unknownType:"any"});ie.navigationSchema=Et;const Rt=l.object({background:l.alternatives().try(l.string().min(1),l.object({header:l.string().min(1),footer:l.string().min(1),default:l.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});ie.themeSchema=Rt;const Ye=l.object({whoCanAccess:l.string().valid("owner","invited","all"),profileFields:l.array().items(l.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:l.array().items(l.string().min(1)),allowSwitchProfile:l.boolean(),blockUnauthenticated:l.boolean(),blockUnauthorized:l.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});ie.authConfigSchema=Ye;const At=l.object({type:l.string().trim().min(1).required(),description:l.string().trim().min(1)}),lt=l.object({did:l.DID().trim().required(),type:l.string().trim().min(1).required(),public:l.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});ie.resourceBundleSchema=lt;const st=l.array().items(l.object({type:l.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:l.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});ie.eventsSchema=st;const ze={did:l.DID().trim().required(),version:l.semver().valid().required(),name:l.string().optional(),description:D.required(),group:l.string().valid(...m.BLOCKLET_GROUPS),main:l.string().trim(),title:M.optional().allow(""),logo:l.string().trim().optional(),specVersion:l.semver().valid().gte("1.0.0").optional(),author:Ge.optional(),contributors:l.array().items(Ge).optional(),maintainers:l.array().items(Ge).optional(),community:l.string().uri().optional().allow("").default(""),documentation:l.string().uri().optional().allow("").default(""),homepage:l.string().uri().optional().allow("").default(""),license:l.string().optional().allow("").default(""),support:l.alternatives().try(l.string().uri(),l.string().email({tlds:!1})).optional(),nftFactory:l.DID().optional().allow("").default(""),payment:l.object({price:l.array().max(1).items(l.object({value:l.number().greater(0).required(),address:l.DID().required()})).default([]),share:l.array().max(4).items(l.object({name:l.string().required(),address:l.DID().required(),value:l.number().greater(0).max(1).required()})).default([]).custom(K=>{if(K.length===0)return K;const le=K.reduce((Te,Pe)=>Te+Pe.value,0);if(le!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${le}`);return K},"invalid blocklet share"),componentPrice:l.array().items(l.object({parentPriceRange:l.array().items(l.number()).custom((K,le)=>K.length!==2?le.message("length of range should be 2"):K[0]<0?le.message("the first value should not less than 0 in range"):K[1]<=K[0]?le.message("the second value should greater than the first value in range"):K),type:l.string().valid("fixed","percentage").required(),value:l.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:l.alternatives().try(l.string().trim().min(1),l.array().items(l.string().min(1))).optional(),tags:l.alternatives().try(l.string().trim().min(1),l.array().items(l.string().min(1))).optional(),gitHash:l.string().optional().allow(""),repository:l.alternatives().try(l.string().min(1),l.object({type:l.string().valid("git","https","svn").required(),url:l.string().uri().required(),directory:l.string()})).optional(),timeout:l.object({start:l.number().min(10).max(600),script:l.number().min(1).max(1800)}).default({start:60}),requirements:l.object({abtnode:l.semverRange().valid(),server:l.semverRange().valid(),os:l.alternatives().try(l.string().valid("*",...m.BLOCKLET_PLATFORMS),l.array().items(l.string().valid(...m.BLOCKLET_PLATFORMS)).min(1)),cpu:l.alternatives().try(l.string().valid("*",...m.BLOCKLET_ARCHITECTURES),l.array().items(l.string().valid(...m.BLOCKLET_ARCHITECTURES)).min(1)),fuels:l.array().items(l.object({endpoint:l.string().trim().required(),address:l.string().trim(),value:l.string().trim().required(),reason:l.string().trim().required()})),nodejs:l.semverRange().valid(),aigne:l.boolean().optional()}).default({server:m.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:l.array().items(ve).unique("name").custom((K,le)=>{if(K.filter(Se=>Se.type===m.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return le.message(`Only one ${m.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const Pe=K.filter(Se=>Se.type===m.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const Se of Pe)if(!Se.prefix.startsWith($))return le.message(`Wellknown path prefix must start with: ${$}`);return K}).default([]),environments:l.array().items(Le).default([]).optional().custom((K,le)=>{if(K&&K.length){const Te=K.filter((Pe,Se)=>K.findIndex(A=>A.name===Pe.name)!==Se);if(Te.length)return le.message(`find duplicate environment names ${Te.map(Pe=>Pe.name).join(", ")}`)}return K}),scripts:V,capabilities:l.object({clusterMode:l.boolean(),didSpace:l.string().valid(...Object.values(m.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:l.boolean().default(!0),serverless:l.boolean().optional(),component:l.boolean(),sitemap:l.boolean().optional(),mcp:l.boolean().optional()}).default({}),files:l.array().items(l.string().trim()).optional(),resource:l.object({exportApi:l.string().trim(),bundles:l.array().items(lt),types:l.array().items(At).max(10)}),engine:l.alternatives().try(_e,l.array().items(_e)).optional(),screenshots:l.array().items(l.string().min(1)).optional().default([]),videos:l.array().items(l.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:l.string().optional().allow(""),dist:tt.optional(),stats:pt.optional(),htmlAst:l.any().optional(),path:l.string().optional(),signatures:l.array().items(Ot).optional(),lastPublishedAt:l.string().isoDate().optional().allow(null),components:Ue(),navigation:Et,theme:Rt,copyright:l.object({owner:l.string().min(1),year:l.alternatives().try(l.string(),l.number())}),bundleName:l.string(),bundleDid:l.DID().trim(),storeId:l.string(),events:st.optional()},He=l.object(ze).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});ie.blockletMetaSchema=He;const gt=(K,{ensureFiles:le=!1,ensureDist:Te=!1,ensureComponentStore:Pe=!0,ensureName:Se=!1,skipValidateDidName:A=!1,...se}={})=>((!K||!s.default.existsSync(K))&&(le=!1),l.object({...ze,owner:l.object({avatar:l.string().optional(),did:l.DID().trim().required(),fullName:l.string().trim().required(),email:l.string().optional().allow(null).empty("").default("")}).optional(),logo:le?l.file().trim().exists({baseDir:K}).optional():l.string().trim().optional(),files:l.array().items(le?l.file().exists({baseDir:K,canSkip:(me,Ce)=>[m.BLOCKLET_ENTRY_FILE,m.BLOCKLET_BUNDLE_FILE].includes(Ce)||(0,a.default)(Ce)}):l.string().trim()).optional(),dist:Te?tt.required():tt.optional(),components:Ue({checkStore:Pe}),name:Se?l.string().optional():l.string().required(),egress:l.boolean().optional().default(!0),docker:j.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...se}).rename("children","components").custom((me,Ce)=>{const{did:p,name:x,docker:k}=me;if(k){const{image:U,dockerfile:ee,network:re}=k;if(!U&&!ee)return Ce.message("Image or dockerfile must be set");if(U&&ee)return Ce.message("Image and dockerfile cannot be set at the same time");if(re)return Ce.message("ExportPorts and network cannot be set at the same time");ee&&(me.files||(me.files=[]),me.files.push(ee))}let L;if((0,f.isValid)(p))try{return(0,O.validateNewDid)(p),me}catch(U){L=U}if(x){(0,O.validateName)(x,{checkDid:!A});const U=(0,E.default)(x);return U!==p?Ce.message(`The did of name "${x}" should be "${U}"`):me}return L?Ce.message(L.message):me}));return ie.createBlockletSchema=gt,ie.default={blockletNameSchema:X,componentSchema:ge,endpointSchema:ce,serviceSchema:ke,createBlockletSchema:gt,interfaceSchema:ve,environmentSchema:Le,environmentNameSchema:de,scriptsSchema:V,personSchema:Ge,distSchema:tt,titleSchema:M,descriptionSchema:D,logoSchema:z,navigationSchema:Et,themeSchema:Rt,mountPointSchema:H,updateMountPointSchema:N,authConfigSchema:Ye,resourceBundleSchema:lt,installBlockletTitleSchema:ne,installBlockletDescriptionSchema:Z,eventsSchema:st,Joi:l},ie}var ft={},so;function lu(){if(so)return ft;so=1;var e=ft&&ft.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(ft,"__esModule",{value:!0}),ft.setService=ft.findService=ft.getDefaultServiceConfig=ft.getServiceConfig=void 0;const t=e(tc),r=gs(),i={},s=h=>{i[h.name]={validate:h.schema.validate.bind(h.schema),defaultConfig:h.default}};ft.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(O=>O.message).join(", ")}`);return E};ft.getServiceConfig=o;const a=h=>{const{defaultConfig:u}=n(h);return u};ft.getDefaultServiceConfig=a;const d=(h,u)=>{const f=[u];return(h||[]).find(j=>f.includes(j.name))};return ft.findService=d,ft.default={getServiceConfig:o,getDefaultServiceConfig:a,findService:d,setService:s},ft}var ao;function cu(){if(ao)return Gt;ao=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.fixAndValidateService=Gt.validateMeta=void 0;const e=gs(),t=lu(),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);Gt.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 Gt.validateMeta=i,Gt.default=i,Gt}var lo;function uu(){return lo||(lo=1,function(e){var t=Tt&&Tt.__createBinding||(Object.create?function(w,I,M,D){D===void 0&&(D=M);var ne=Object.getOwnPropertyDescriptor(I,M);(!ne||("get"in ne?!I.__esModule:ne.writable||ne.configurable))&&(ne={enumerable:!0,get:function(){return I[M]}}),Object.defineProperty(w,D,ne)}:function(w,I,M,D){D===void 0&&(D=M),w[D]=I[M]}),r=Tt&&Tt.__setModuleDefault||(Object.create?function(w,I){Object.defineProperty(w,"default",{enumerable:!0,value:I})}:function(w,I){w.default=I}),i=Tt&&Tt.__importStar||function(){var w=function(I){return w=Object.getOwnPropertyNames||function(M){var D=[];for(var ne in M)Object.prototype.hasOwnProperty.call(M,ne)&&(D[D.length]=ne);return D},w(I)};return function(I){if(I&&I.__esModule)return I;var M={};if(I!=null)for(var D=w(I),ne=0;ne<D.length;ne++)D[ne]!=="default"&&t(M,I,D[ne]);return r(M,I),M}}(),s=Tt&&Tt.__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(Gc()),a=Yo(),d=cu();Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return d.fixAndValidateService}});const h=ms(),u=(w,I)=>{w.description||(w.description=`Blocklet from ${I}`),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 I=o.fromUrl(w.repository.url);I&&(w.repository.url=I.getDefaultRepresentation()==="shortcut"?I.https():I.toString())}};e.fixRepository=f;const j=w=>{Array.isArray(w.files)?w.files&&(w.files=w.files.filter(I=>!(!I||typeof I!="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(I=>!(typeof I!="string"||!I)))};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(I=>!(typeof I!="string"||!I)))};e.fixTags=E;const S=(w,I)=>(w.author&&(w.author=I(w.author)),["maintainers","contributors"].forEach(M=>{Array.isArray(w[M])&&(w[M]=w[M].map(I))}),w),O=w=>{if(!w)return"";if(typeof w=="string")return w;const I=w.name||"",M=w.url||w.web,D=M?` (${M})`:"",ne=w.email||w.mail,Z=ne?` <${ne}>`:"";return I+Z+D};e.formatPerson=O;const P=w=>{if(typeof w!="string")return w;const I=w.match(/^([^(<]+)/),M=w.match(/\(([^)]+)\)/),D=w.match(/<([^>]+)>/),ne={};return I&&I[0].trim()&&(ne.name=I[0].trim()),D&&([,ne.email]=D),M&&([,ne.url]=M),ne};e.parsePerson=P;const _=w=>(S(w,O),S(w,P),w);e.fixPerson=_;const $=(w,I=!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 D=(0,n.default)(w,"capabilities.dynamicPathPrefix",!0)?a.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",ne=({type:Z="web",name:z,path:W="/",protocol:H="http",port:N=a.BLOCKLET_DEFAULT_PORT_NAME})=>{w.interfaces.push({type:Z,name:z,path:W,prefix:D,port:N,protocol:H})};return[a.BLOCKLET_INTERFACE_PUBLIC].forEach(Z=>{w[Z]&&ne({name:Z,path:w[Z]})}),Array.isArray(w.exposeServices)&&w.exposeServices.forEach(Z=>{ne({type:"service",name:Z.protocol,protocol:Z.protocol,port:{internal:`BLOCKLET_${Z.protocol}_PORT`.toUpperCase(),external:Z.port}})}),I&&(delete w.publicUrl,delete w.adminUrl,delete w.configUrl,delete w.docUrl,delete w.exposeServices,w.capabilities&&delete w.capabilities.dynamicPathPrefix),w};e.fixInterfaces=$;const l=w=>{const{did:I}=w;try{(0,h.validateNewDid)(I),w.name=I}catch{}return w};e.fixName=l,e.default={fixRequired:u,fixRepository:f,fixFiles:j,fixKeywords:m,fixPerson:_,fixTags:E,fixName:l,formatPerson:O,parsePerson:P,fixInterfaces:$,fixService:d.fixAndValidateService}}(Tt)),Tt}var du=uu();function vs({owner:e,locale:t}){return c.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?c.jsx(Go,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}vs.propTypes={owner:B.object.isRequired,locale:B.string.isRequired};const hu="install-blocklet-from-URL",ys=()=>{const[e,t]=si(hu,"[]",{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 bs({value:e="",onValueChange:t=()=>{},children:r=null,helperText:i=""}){const{urls:s,removeUrlRecord:n}=ys(),o=(a,d)=>{a.preventDefault(),a.stopPropagation(),n(d)};return c.jsxs(te,{children:[c.jsx(Ao,{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(Do,{...a,key:d,secondaryAction:c.jsx(No,{edge:"end","aria-label":"delete",onClick:h=>o(h,d),children:c.jsx(va,{})})},c.jsx(ya,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:c.jsx(Mo,{primary:d,sx:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}})})),slotProps:{listbox:{sx:{maxHeight:300,overflow:"auto"}}}}),c.jsx(ba,{style:{margin:0},children:i})]})}bs.propTypes={onValueChange:B.func,children:B.node,value:B.string,helperText:B.string};function xs({onClick:e}){const{t}=St();return c.jsx(ul,{title:t("launchBlocklet.withoutWallet"),icon:c.jsx(xt,{icon:dl,fontSize:"1em"}),onClick:e})}xs.propTypes={onClick:B.func.isRequired};function ws({defaultUrl:e="",onCancel:t,onSuccess:r,onError:i=()=>{},mode:s="install",handleText:n={}}){const{api:o}=un(),{api:a,session:d}=nc(),[h,u]=q.useState(!1),[f,j]=q.useState(""),{t:m,locale:E}=St(),S={dist:{}},{encryptKey:O}=hl(),[P,_]=q.useState(e),[$,l]=q.useState(e?1:0),[w,I]=q.useState(S),[M,D]=q.useState(!1),[ne,Z]=q.useState(""),[z]=si("instant-blocklet-install",!1),[W,H]=q.useState({}),N=s==="component",X=N?!0:!e,{addUrlRecord:F}=ys(),de=q.useMemo(()=>(d.user?.connectedAccounts||[]).some(We=>We.provider===Bt.LOGIN_PROVIDER.WALLET),[d.user]),Le=q.useMemo(()=>{let he=P.trim();return!he.startsWith("https://")&&!he.startsWith("http://")&&!he.startsWith("file://")&&(he=`file://${he}`),he},[P]),V=async()=>{I(S),j(null),u(!0);const he=Le;try{const ge=decodeURIComponent(he);try{new URL(ge)}catch{throw new Error("Invalid URL")}const{meta:We,inStore:Ue,registryUrl:Ot}=await o.getBlockletMetaFromUrl({input:{url:ge}});I(We),H({inStore:Ue,registryUrl:Ot,inputUrl:he}),F(he)}catch(ge){console.error(ge);const We=`Blocklet Install failed: ${Ur(ge)}`;j(We),i(ge)}finally{u(!1)}},ke=()=>{if(N){r({meta:w,...W}),t();return}if(z){u(!0),D(!0);return}const he=nn(window?.env?.apiPrefix??"/","/launch-blocklet/install");window.location.href=Qn(he,{blocklet_meta_url:decodeURIComponent(Le.trim()),from:"url"})},ce=()=>{u(!1),D(!1),r({meta:w,...W}),t()},$e=()=>{u(!1),D(!1)};q.useEffect(()=>{e&&V()},[e]);const ve=q.useMemo(()=>({title:w.title,wt:fl(w),blockletMetaUrl:decodeURIComponent(P.trim())}),[w,P]),Ne=q.useCallback(async()=>{if(de||z){Z("");return}const he=new URL(window.location.href);he.pathname=nn(window?.env?.apiPrefix??"/","/api/did/launch-free-blocklet-by-session/token"),he.searchParams.set("_ek_",O),Object.keys(ve).forEach(We=>{he.searchParams.set(We,ve[We])});const{data:ge}=await a.get(he.href);ge.url?Z(ge.url):Z("")},[de,ve,a,O,z]);q.useEffect(()=>{Ne()},[Ne]);const _e=q.useMemo(()=>de&&ne?{...ve,nw:ne,skipMigrateAccount:!0}:ve,[ve,ne,de]),Ge=[{name:m("common.name"),value:$t.getDisplayName({meta:w},!0)},{name:m("common.version"),value:w.version},{name:m("common.did"),value:w.did?c.jsx(rc,{did:w.did}):null},{name:m("common.author"),value:w.owner?c.jsx(vs,{owner:w.owner,locale:E}):du.formatPerson(w.author)},{name:m("blocklet.dist.downloadLink"),value:w.dist.tarball}],tt=()=>h?c.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:c.jsx(jt,{})}):w.did?c.jsx("div",{style:{paddingLeft:"10%"},children:Ge.map(he=>he.name===m("common.did")?c.jsx(_i,{valueComponent:"div",nameWidth:120,name:he.name,nameFormatter:()=>m("common.did"),children:he.value},he.name):c.jsx(_i,{valueComponent:"div",nameWidth:120,name:he.name,children:he.value},he.name))}):null,pt=Xl(async()=>{let he=w.title;d.user&&(he=`${d.user.fullName}'s ${w.title}`);try{ce(),await o.launchBlockletWithoutWallet({input:{title:he,blockletMetaUrl:decodeURIComponent(P.trim()),type:"store",storeUrl:W.registryUrl,onlyRequired:!0}})}catch(ge){console.error("launchBlockletWithoutWallet error:",ge),Xn.error(Ur(ge),{autoHideDuration:3e3})}}),mt=[{label:m("blocklet.fromUrl.step0"),body:c.jsx(Ie,{component:"div",children:c.jsx(bs,{style:{marginBottom:32},value:P,helperText:m("blocklet.fromUrl.description"),onValueChange:he=>{j(null),_(he)},children:c.jsx(Gn,{label:m("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:P,onChange:he=>{j(null),_(he.target.value)},disabled:h,onKeyPress:he=>{he.key==="Enter"&&(he.preventDefault(),V(),l(1))}})})}),cancel:m("common.cancel"),confirm:m("common.next"),onCancel:t,onConfirm:()=>{V(),l(1)}},{label:m("blocklet.fromUrl.step1"),body:tt(),cancel:m(X?"common.pre":"common.cancel"),confirm:n?.confirm||m("blocklet.fromUrl.confirm"),onCancel:()=>{X?l(he=>he-1):t()},onConfirm:()=>{ke()}}],xe=mt[$];return c.jsxs(c.Fragment,{children:[c.jsxs(oi,{title:n?.title||m("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>xe.onCancel(),showCloseButton:$===0,disableEscapeKeyDown:!0,open:!0,actions:c.jsxs(c.Fragment,{children:[xe.cancel&&c.jsx(bt,{onClick:he=>{he.stopPropagation(),j(null),xe.onCancel()},color:"inherit",children:xe.cancel||m("common.cancel")}),c.jsxs(bt,{onClick:he=>{he.stopPropagation(),xe.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:h||!P||f,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[h&&$===0&&c.jsx(jt,{size:16}),xe.confirm]})]}),children:[X&&c.jsx(xa,{alternativeLabel:!0,activeStep:$,children:mt.map(({label:he})=>c.jsx(wa,{children:c.jsx(Sa,{children:he})},he))}),c.jsx(Ea,{component:"div",style:{marginTop:24},children:xe.body}),!!f&&c.jsx(Bo,{severity:"error",style:{width:"100%",marginTop:8},children:f})]}),w&&M&&c.jsx(Jo,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!de&&!z?"bind-wallet":"launch-free-blocklet-by-session",checkFn:a.get,checkTimeout:5*60*1e3,onSuccess:ce,extraParams:_e,messages:{title:m("setup.keyPair.title"),scan:m("setup.keyPair.scan"),confirm:m("setup.keyPair.confirm"),success:m("setup.keyPair.success")},onClose:$e,customItems:z?[]:[c.jsx(xs,{onClick:pt})]})]})}ws.propTypes={defaultUrl:B.string,onCancel:B.func.isRequired,onSuccess:B.func.isRequired,onError:B.func,mode:B.oneOf(["install","component"]),handleText:B.object};const fu={meta:B.object.isRequired,onCancel:B.func.isRequired};function Ss({action:e,onSelect:t,onNext:r}){const{t:i}=St(),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 c.jsxs(c.Fragment,{children:[c.jsx(ka,{children:s.map(n=>c.jsxs(Do,{button:!0,selected:e===n.action,onClick:()=>t(n.action),children:[c.jsx(Ta,{sx:{minWidth:48},children:n.action==="purchase"?c.jsx(ja,{style:{color:e==="purchase"?Oi.primary.main:"#AAA",fontSize:32}}):c.jsx(Oa,{style:{color:e==="verify"?Oi.primary.main:"#AAA",fontSize:32}})}),c.jsx(Mo,{primary:n.title,secondary:n.description})]},n.action))}),r&&c.jsx(bt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:r,children:i("common.next")})]})}Ss.propTypes={action:B.oneOf(["both","purchase","verify"]).isRequired,onSelect:B.func.isRequired,onNext:B.func.isRequired};function Es({meta:e,onCancel:t,mode:r,handlePaySuccess:i=()=>{}}){const{t:s,locale:n}=St(),{info:o}=un(),a=pl(o),[d,h]=q.useState(null),u=new URL(e?.registryUrl).origin,f=$t.getDisplayName({meta:e}),j=async(E,S)=>{const O=({downloadTokenList:$})=>{i({downloadTokenList:$})},P=$=>{Xn.error($),t($)};function _($){return gl(()=>Ni.get($).then(async({data:l})=>{const w=l?.downloadTokenList;if(l.status==="succeed"){if(w&&w.length)await O({downloadTokenList:w});else return await P(s("blocklet.component.missDownloadTokenTip")),!0;return!0}return l.status==="error"?(console.error("vc error: ",l),await P(l?.error),!0):!1}),{interval:1e3})}if(r==="purchase"&&d){const{statusUrl:$}=ml(d);await _($)}else await O({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{Ni.get(E.href).then(({data:S})=>{const O=`${S.url}`;h(O)})}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:Li.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:Li.create({baseURL:nn(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:c.jsxs(c.Fragment,{children:[c.jsx("p",{children:s("store.purchase.auth.success")}),c.jsx("p",{children:s("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return c.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]})}Es.propTypes={...fu,handlePaySuccess:B.func,mode:B.oneOf(["verify","purchase"]).isRequired};function ks({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?c.jsx("div",{style:{maxWidth:520},children:c.jsx(Ss,{action:i,onNext:null,onSelect:a})}):c.jsx(Es,{...r,mode:i})}ks.propTypes={mode:B.oneOf(["both","verify","purchase"]).isRequired,ref:B.any};function pu({...e}){return c.jsx(bt,{className:"bottom-button",variant:"contained",color:"primary",...e})}function Ts({blocklet:e=null,onStartNow:t=()=>{},children:r=null,disabled:i=!1}){const{t:s}=St(),n=is();return!e||vl(e.meta)?c.jsx(mu,{children:r}):c.jsxs(gu,{isMobile:n,children:[c.jsx(pu,{className:"start-now",variant:"contained",color:"primary",disabled:i,onClick:()=>t(),children:s("setup.startNow")}),c.jsx(te,{sx:{display:"flex",alignItems:"center"},children:r})]})}Ts.propTypes={blocklet:B.object,onStartNow:B.func,children:B.any,disabled:B.bool};const mu=ot(te)`
|
|
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 js({blockletMeta:e,onEndpointUpdate:t=()=>{}}){const r=is(),{blocklet:i}=Yn(),{updateSpaceGateway:s,loading:n,hasStorageEndpoint:o}=Bl();return q.useEffect(()=>{t?.()},[i]),n?
|
|
265
|
+
`;function js({blockletMeta:e,onEndpointUpdate:t=()=>{}}){const r=is(),{blocklet:i}=Yn(),{updateSpaceGateway:s,loading:n,hasStorageEndpoint:o}=Bl();return q.useEffect(()=>{t?.()},[i]),n?c.jsx(El,{relative:"parent",children:c.jsx(jt,{})}):c.jsxs(vu,{children:[c.jsx(te,{sx:{width:r?"360px":"720px"},children:o?c.jsx(ac,{}):c.jsx(lc,{})}),e?.capabilities?.didSpace==="required"&&c.jsx(Ts,{mt:8,children:c.jsx(cc,{onConnect:s})})]})}js.propTypes={blockletMeta:B.any.isRequired,onEndpointUpdate:Ca.func};const vu=ot(sc)`
|
|
266
266
|
height: 100%;
|
|
267
267
|
overflow-y: auto;
|
|
268
268
|
padding-bottom: 32px;
|
|
269
269
|
overflow-x: hidden;
|
|
270
|
-
`;function Os({onChange:e=()=>{},loading:t=!1,children:r,extra:i="",stores:s=[],storageKey:n=""}){const{t:o}=St(),{info:a,inService:d}=un(),{blocklet:h}=Yn(),[u,f]=q.useState(!1),j=q.useRef(null),[m,E]=q.useState(),[S,O]=
|
|
270
|
+
`;function Os({onChange:e=()=>{},loading:t=!1,children:r,extra:i="",stores:s=[],storageKey:n=""}){const{t:o}=St(),{info:a,inService:d}=un(),{blocklet:h}=Yn(),[u,f]=q.useState(!1),j=q.useRef(null),[m,E]=q.useState(),[S,O]=si(n||"tmp"),[P,_]=n?[S,O]:[m,E],{storeList:$,teamDid:l}=Qo({fromBlocklet:d,blocklet:h,nodeInfo:a}),w=es([...s.map(M=>({...M,protected:!0})),...$],"url"),I=P&&w.find(M=>P===M.url)||w[0];return c.jsxs(c.Fragment,{children:[c.jsxs(yu,{children:[c.jsx(bt,{ref:j,color:"primary","data-cy":"add-component-select-store",endIcon:c.jsx(Ia,{color:"primary"}),onClick:()=>{f(!0)},style:{padding:"0 2px"},children:c.jsx(Ie,{color:"primary",children:I.name})}),c.jsx(Ie,{color:"primary",children:i})]}),c.jsxs(Gn,{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:I,autoFocus:!0,onChange:M=>{const D=M.target.value;_(D.url),e(D)},style:{display:"none"},margin:"normal",slotProps:{select:{open:u,MenuProps:{anchorEl:j.current},renderValue:M=>M?.name,onClose:()=>{f(!1)}}},children:[w?.map(M=>c.jsx(ni,{sx:{width:"400px",maxWidth:"90vw"},value:M,"data-cy":M.url,children:c.jsx(Qa,{teamDid:l,store:M,onDelete:()=>{P===M.url&&_(w[0]?.url)}})},M.url)),!Ko.isInServerlessMode(a)&&c.jsx(Za,{disabled:t,storeList:w,teamDid:l,onAdd:M=>{_(M)}})]}),r({currentRegistry:I})]})}Os.propTypes={onChange:B.func,loading:B.bool,children:B.any.isRequired,extra:B.node,storageKey:B.string,stores:B.arrayOf(B.shape({name:B.string.isRequired,url:B.string.isRequired}))};const yu=ot.div`
|
|
271
271
|
display: flex;
|
|
272
272
|
justify-content: space-between;
|
|
273
273
|
align-items: center;
|
|
@@ -437,7 +437,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
437
437
|
color: ${e=>e.theme.palette.grey[600]};
|
|
438
438
|
font-size: 12px;
|
|
439
439
|
}
|
|
440
|
-
`;
|
|
440
|
+
`;B.string||B.node,B.string,B.string||B.node,B.string,B.string,B.bool,B.bool,B.element,B.string,B.func,B.func,B.string;Qt("div")`
|
|
441
441
|
background-color: transparent !important;
|
|
442
442
|
& > :not(.Mui-disabled) {
|
|
443
443
|
position: relative;
|
|
@@ -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 lo=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),xu=(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`},Cs={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 Ur({title:e,sx:t,children:r,slotProps:i,fontSize:s=12,fontWeight:n=500,color:o="text.contrast",...a}){return e?l.jsx(Fo,{title:e,placement:"top",...a,slotProps:{popper:{...i?.popper,sx:Ho({[`& .${Ra.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 An({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(Ur,{title:i||(typeof t=="string"?t:""),children:l.jsx(Ie,{variant:"body2",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function wu({...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:O,icons:P,status:_,...D}=e,c=qt(),w=(Z,z=()=>!1)=>(W,...H)=>{const N=Z instanceof Function;(z()||N)&&(W.preventDefault(),W.stopPropagation(),N&&Z(...H))},I=E&&w(E),B=w(m,()=>!!(j||u||f)),M=q.isValidElement(t)?{children:t}:{title:lo(t),dangerouslySetInnerHTML:{__html:t}},ne=q.isValidElement(r)?{children:r}:{title:lo(r),dangerouslySetInnerHTML:{__html:r}};return l.jsxs(Pa,{variant:"outlined",onClick:I,...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(zn,{src:i,did:a,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),l.jsx(Ie,{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(te,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[d&&l.jsx(Ur,{title:d.tooltip,children:l.jsx(La,{sx:{color:d.color||"#D97706",fontSize:d.size||18}})}),P?.map(Z=>l.jsx(Ur,{title:Z.title,children:typeof Z.icon=="string"?l.jsx(xt,{icon:Z.icon,style:{color:Z.color}}):Z.icon},Z.key))]}),m&&l.jsxs(bt,{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(jt,{size:15,style:{marginRight:3,color:"inherit"}}),h]}),j]}),l.jsx(ut,{sx:{py:2},children:l.jsx(Ie,{className:"blocklet-description",variant:"body2",...ne,sx:[{color:"text.secondary",display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...Array.isArray(ne.sx)?ne.sx:[ne.sx]]})}),l.jsxs(ut,{direction:"row",sx:{alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(An,{icon:l.jsx(zn,{src:s,did:a,size:20,variant:"circle"}),maxWidth:200,children:n}),l.jsx(An,{icon:l.jsx(xt,{icon:Cs}),title:o,children:xu(o)}),_?.filter(Z=>Z.align!=="right").map(Z=>l.jsx(An,{icon:typeof Z.icon=="string"?l.jsx(xt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,children:Z.text},Z.key)),l.jsx(te,{sx:{flex:1}}),_?.filter(Z=>Z.align==="right").map(Z=>l.jsx(An,{icon:typeof Z.icon=="string"?l.jsx(xt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,sx:{color:Z.color},children:Z.text},Z.key))]})]})}const Su={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>'},xn=/^[a-z0-9]+(-[a-z0-9]+)*$/,Zn=(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&&!Un(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&&!Un(a)?null:a}if(r&&i===""){const a={provider:i,prefix:"",name:n};return t&&!Un(a,r)?null:a}return null},Un=(e,t)=>e?!!((e.provider===""||e.provider.match(xn))&&(t&&e.prefix===""||e.prefix.match(xn))&&e.name.match(xn)):!1,Is=Object.freeze({left:0,top:0,width:16,height:16}),Vn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),si=Object.freeze({...Is,...Vn}),qr=Object.freeze({...si,body:"",hidden:!1});function Eu(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 co(e,t){const r=Eu(e,t);for(const i in qr)i in Vn?i in e&&!(i in r)&&(r[i]=Vn[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function ku(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 Tu(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let n={};function o(a){n=co(i[a]||s[a],n)}return o(t),r.forEach(o),co(e,n)}function Rs(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=ku(e);for(const s in i){const n=i[s];n&&(t(s,Tu(e,s,n)),r.push(s))}return r}const ju={provider:"",aliases:{},not_found:{},...Is};function kr(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Ps(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!kr(e,ju))return null;const r=t.icons;for(const s in r){const n=r[s];if(!s.match(xn)||typeof n.body!="string"||!kr(n,qr))return null}const i=t.aliases||Object.create(null);for(const s in i){const n=i[s],o=n.parent;if(!s.match(xn)||typeof o!="string"||!r[o]&&!i[o]||!kr(n,qr))return null}return t}const uo=Object.create(null);function Ou(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function rn(e,t){const r=uo[e]||(uo[e]=Object.create(null));return r[t]||(r[t]=Ou(e,t))}function ai(e,t){return Ps(t)?Rs(t,(r,i)=>{i?e.icons[r]=i:e.missing.add(r)}):[]}function Cu(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}let Sn=!1;function Ls(e){return typeof e=="boolean"&&(Sn=e),Sn}function Iu(e){const t=typeof e=="string"?Zn(e,!0,Sn):e;if(t){const r=rn(t.provider,t.prefix),i=t.name;return r.icons[i]||(r.missing.has(i)?null:void 0)}}function Ru(e,t){const r=Zn(e,!0,Sn);if(!r)return!1;const i=rn(r.provider,r.prefix);return Cu(i,r.name,t)}function Pu(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Sn&&!t&&!e.prefix){let s=!1;return Ps(e)&&(e.prefix="",Rs(e,(n,o)=>{o&&Ru(n,o)&&(s=!0)})),s}const r=e.prefix;if(!Un({provider:t,prefix:r,name:"a"}))return!1;const i=rn(t,r);return!!ai(i,e)}const _s=Object.freeze({width:null,height:null}),Ns=Object.freeze({..._s,...Vn}),Lu=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_u=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ho(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(Lu);if(i===null||!i.length)return e;const s=[];let n=i.shift(),o=_u.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 Nu=e=>e==="unset"||e==="undefined"||e==="none";function Au(e,t){const r={...si,...e},i={...Ns,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let n=r.body;[r,i].forEach(E=>{const S=[],O=E.hFlip,P=E.vFlip;let _=E.rotate;O?P?_+=2:(S.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),S.push("scale(-1 1)"),s.top=s.left=0):P&&(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(_<0&&(_-=Math.floor(_/4)*4),_=_%4,_){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}_%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=ho(f,d/h)):(u=o==="auto"?d:o,f=a===null?ho(u,h/d):a==="auto"?h:a);const j={},m=(E,S)=>{Nu(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 Du=/\sid="(\S+)"/g,Mu="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Bu=0;function Fu(e,t=Mu){const r=[];let i;for(;i=Du.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+(Bu++).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 Wr=Object.create(null);function $u(e,t){Wr[e]=t}function zr(e){return Wr[e]||Wr[""]}function li(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 ci=Object.create(null),yn=["https://api.simplesvg.com","https://api.unisvg.com"],qn=[];for(;yn.length>0;)yn.length===1||Math.random()>.5?qn.push(yn.shift()):qn.push(yn.pop());ci[""]=li({resources:["https://api.iconify.design"].concat(qn)});function Uu(e,t){const r=li(t);return r===null?!1:(ci[e]=r,!0)}function ui(e){return ci[e]}const qu=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let fo=qu();function Wu(e,t){const r=ui(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 zu(e){return e===404}const Vu=(e,t,r)=>{const i=[],s=Wu(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=ui(e);if(t)return t.path}return"/"}const Gu=(e,t,r)=>{if(!fo){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;fo(e+i).then(n=>{const o=n.status;if(o!==200){setTimeout(()=>{r(zu(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)})},Hu={prepare:Vu,send:Gu};function Xu(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]=rn(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 As(e,t){e.forEach(r=>{const i=r.loaderCallbacks;i&&(r.loaderCallbacks=i.filter(s=>s.id!==t))})}function Yu(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||As([e],n.id),n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort))})}))}let Ju=0;function Qu(e,t,r){const i=Ju++,s=As.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 Zu(e,t=!0,r=!1){const i=[];return e.forEach(s=>{const n=typeof s=="string"?Zn(s,t,r):s;n&&i.push(n)}),i}var ed={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function td(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 I=e.resources.slice(0);for(o=[];I.length>1;){const B=Math.floor(Math.random()*I.length);o.push(I[B]),I=I.slice(0,B).concat(I.slice(B+1))}o=o.concat(I)}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(I=>{I.status==="pending"&&(I.status="aborted")}),j=[]}function O(I,B){B&&(m=[]),typeof I=="function"&&m.push(I)}function P(){return{startTime:a,payload:t,status:d,queriesSent:h,queriesPending:j.length,subscribe:O,abort:S}}function _(){d="failed",m.forEach(I=>{I(void 0,u)})}function D(){j.forEach(I=>{I.status==="pending"&&(I.status="aborted")}),j=[]}function c(I,B,M){const ne=B!=="success";switch(j=j.filter(Z=>Z!==I),d){case"pending":break;case"failed":if(ne||!e.dataAfterTimeout)return;break;default:return}if(B==="abort"){u=M,_();return}if(ne){u=M,j.length||(o.length?w():_());return}if(E(),D(),!e.random){const Z=e.resources.indexOf(I.resource);Z!==-1&&Z!==e.index&&(e.index=Z)}d="completed",m.forEach(Z=>{Z(M)})}function w(){if(d!=="pending")return;E();const I=o.shift();if(I===void 0){if(j.length){f=setTimeout(()=>{E(),d==="pending"&&(D(),_())},e.timeout);return}_();return}const B={status:"pending",resource:I,callback:(M,ne)=>{c(B,M,ne)}};j.push(B),h++,f=setTimeout(w,e.rotate),r(I,t,B.callback)}return setTimeout(w),P}function Ds(e){const t={...ed,...e};let r=[];function i(){r=r.filter(a=>a().status==="pending")}function s(a,d,h){const u=td(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 po(){}const Tr=Object.create(null);function nd(e){if(!Tr[e]){const t=ui(e);if(!t)return;const r=Ds(t),i={config:t,redundancy:r};Tr[e]=i}return Tr[e]}function rd(e,t,r){let i,s;if(typeof e=="string"){const n=zr(e);if(!n)return r(void 0,424),po;s=n.send;const o=nd(e);o&&(i=o.redundancy)}else{const n=li(e);if(n){i=Ds(n);const o=e.resources?e.resources[0]:"",a=zr(o);a&&(s=a.send)}}return!i||!s?(r(void 0,424),po):i.query(t,s,r)().abort}const mo="iconify2",En="iconify",Ms=En+"-count",go=En+"-version",Bs=36e5,id=168;function Vr(e,t){try{return e.getItem(t)}catch{}}function di(e,t,r){try{return e.setItem(t,r),!0}catch{}}function vo(e,t){try{e.removeItem(t)}catch{}}function Kr(e,t){return di(e,Ms,t.toString())}function Gr(e){return parseInt(Vr(e,Ms))||0}const er={local:!0,session:!0},Fs={local:new Set,session:new Set};let hi=!1;function od(e){hi=e}let Dn=typeof window>"u"?{}:window;function $s(e){const t=e+"Storage";try{if(Dn&&Dn[t]&&typeof Dn[t].length=="number")return Dn[t]}catch{}er[e]=!1}function Us(e,t){const r=$s(e);if(!r)return;const i=Vr(r,go);if(i!==mo){if(i){const a=Gr(r);for(let d=0;d<a;d++)vo(r,En+d.toString())}di(r,go,mo),Kr(r,0);return}const s=Math.floor(Date.now()/Bs)-id,n=a=>{const d=En+a.toString(),h=Vr(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{}vo(r,d)}};let o=Gr(r);for(let a=o-1;a>=0;a--)n(a)||(a===o-1?(o--,Kr(r,o)):Fs[e].add(a))}function qs(){if(!hi){od(!0);for(const e in er)Us(e,t=>{const r=t.data,i=t.provider,s=r.prefix,n=rn(i,s);if(!ai(n,r).length)return!1;const o=r.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,o):o,!0})}}function sd(e,t){const r=e.lastModifiedCached;if(r&&r>=t)return r===t;if(e.lastModifiedCached=t,r)for(const i in er)Us(i,s=>{const n=s.data;return s.provider!==e.provider||n.prefix!==e.prefix||n.lastModified===t});return!0}function ad(e,t){hi||qs();function r(i){let s;if(!er[i]||!(s=$s(i)))return;const n=Fs[i];let o;if(n.size)n.delete(o=Array.from(n).shift());else if(o=Gr(s),!Kr(s,o+1))return;const a={cached:Math.floor(Date.now()/Bs),provider:e.provider,data:t};return di(s,En+o.toString(),JSON.stringify(a))}t.lastModified&&!sd(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),r("local")||r("session"))}function yo(){}function ld(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Yu(e)}))}function cd(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=zr(r)))return;n.prepare(r,i,s).forEach(a=>{rd(r,a,d=>{if(typeof d!="object")a.icons.forEach(h=>{e.missing.add(h)});else try{const h=ai(e,d);if(!h.length)return;const u=e.pendingIcons;u&&h.forEach(f=>{u.delete(f)}),ad(e,d)}catch(h){console.error(h)}ld(e)})})}))}const ud=(e,t)=>{const r=Zu(e,!0,Ls()),i=Xu(r);if(!i.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(i.loaded,i.missing,i.pending,yo)}),()=>{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(rn(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=rn(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&&cd(d,s[h][u])}),t?Qu(t,i,n):yo};function dd(e,t){const r={...e};for(const i in t){const s=t[i],n=typeof s;i in _s?(s===null||s&&(n==="string"||n==="number"))&&(r[i]=s):n===typeof r[i]&&(r[i]=i==="rotate"?s%4:s)}return r}const hd=/[\s,]+/;function fd(e,t){t.split(hd).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function pd(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 md(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 gd(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function vd(e){return"data:image/svg+xml,"+gd(e)}function yd(e){return'url("'+vd(e)+'")'}let wn;function bd(){try{wn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{wn=null}}function xd(e){return wn===void 0&&bd(),wn?wn.createHTML(e):e}const Ws={...Ns,inline:!1},wd={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Sd={display:"inline-block"},Hr={backgroundColor:"currentColor"},zs={backgroundColor:"transparent"},bo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},xo={WebkitMask:Hr,mask:Hr,background:zs};for(const e in xo){const t=xo[e];for(const r in bo)t[e+r]=bo[r]}const Ed={...Ws,inline:!0};function wo(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const kd=(e,t,r,i)=>{const s=r?Ed:Ws,n=dd(s,t),o=t.mode||"svg",a={},d=t.style||{},h={...o==="svg"?wd:{},ref:i};for(let P in t){const _=t[P];if(_!==void 0)switch(P){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":n[P]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&fd(n,_);break;case"color":a.color=_;break;case"rotate":typeof _=="string"?n[P]=pd(_):typeof _=="number"&&(n[P]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete h["aria-hidden"];break;default:s[P]===void 0&&(h[P]=_)}}const u=Au(e,n),f=u.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){h.style={...a,...d},Object.assign(h,f);let P=0,_=t.id;return typeof _=="string"&&(_=_.replace(/-/g,"_")),h.dangerouslySetInnerHTML={__html:xd(Fu(u.body,_?()=>_+"ID"+P++:"iconifyReact"))},Ut.createElement("svg",h)}const{body:j,width:m,height:E}=e,S=o==="mask"||(o==="bg"?!1:j.indexOf("currentColor")!==-1),O=md(j,{...f,width:m+"",height:E+""});return h.style={...a,"--svg":yd(O),width:wo(f.width),height:wo(f.height),...Sd,...S?Hr:zs,...d},Ut.createElement("span",h)};Ls(!0);$u("",Hu);if(typeof document<"u"&&typeof window<"u"){qs();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"||!Pu(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;Uu(r,s)||console.error(i)}catch{console.error(i)}}}}class Vs 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=Zn(i,!1,!0))===null){this._abortLoading(),this._setData(null);return}const n=Iu(s);if(!n){(!this._loading||this._loading.name!==i)&&(this._abortLoading(),this._icon="",this._setData(null),n!==null&&(this._loading={name:i,abort:ud([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(" ")}),kd({...si,...r.data},i,t._inline,t._ref)}}const Ft=Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!1};return Ut.createElement(Vs,i)});Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!0};return Ut.createElement(Vs,i)});var Wn={exports:{}},Td=Wn.exports,So;function jd(){return So||(So=1,function(e,t){(function(r,i){e.exports=i(Ya())})(Td,r=>(()=>{var i={703:(a,d,h)=>{var u=h(414);function f(){}function j(){}j.resetWarningCache=f,a.exports=function(){function m(O,P,_,D,c,w){if(w!==u){var I=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 I.name="Invariant Violation",I}}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,O,P,_;if(Array.isArray(m)){if((S=m.length)!=E.length)return!1;for(O=S;O--!=0;)if(!j(m[O],E[O]))return!1;return!0}if(h&&m instanceof Map&&E instanceof Map){if(m.size!==E.size)return!1;for(_=m.entries();!(O=_.next()).done;)if(!E.has(O.value[0]))return!1;for(_=m.entries();!(O=_.next()).done;)if(!j(O.value[1],E.get(O.value[0])))return!1;return!0}if(u&&m instanceof Set&&E instanceof Set){if(m.size!==E.size)return!1;for(_=m.entries();!(O=_.next()).done;)if(!E.has(O.value[0]))return!1;return!0}if(f&&ArrayBuffer.isView(m)&&ArrayBuffer.isView(E)){if((S=m.length)!=E.length)return!1;for(O=S;O--!=0;)if(m[O]!==E[O])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=(P=Object.keys(m)).length)!==Object.keys(E).length)return!1;for(O=S;O--!=0;)if(!Object.prototype.hasOwnProperty.call(E,P[O]))return!1;if(d&&m instanceof Element)return!1;for(O=S;O--!=0;)if((P[O]!=="_owner"&&P[O]!=="__v"&&P[O]!=="__o"||!m.$$typeof)&&!j(m[P[O]],E[P[O]]))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,C="";if(typeof b=="string"||typeof b=="number")C+=b;else if(typeof b=="object")if(Array.isArray(b))for(g=0;g<b.length;g++)b[g]&&(T=a(b[g]))&&(C&&(C+=" "),C+=T);else for(g in b)b[g]&&(C&&(C+=" "),C+=g);return C}function d(){for(var b,g,T=0,C="";T<arguments.length;)(b=arguments[T++])&&(g=a(b))&&(C&&(C+=" "),C+=g);return C}n.r(o),n.d(o,{default:()=>ma});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 In=="object"&&In&&In.Object===Object&&In;var m=typeof self=="object"&&self&&self.Object===Object&&self;const E=j||m||Function("return this")(),S=function(){return E.Date.now()};var O=/\s/,P=/^\s+/;const _=function(b){return b&&b.slice(0,function(g){for(var T=g.length;T--&&O.test(g.charAt(T)););return T}(b)+1).replace(P,"")},D=E.Symbol;var c=Object.prototype,w=c.hasOwnProperty,I=c.toString,B=D?D.toStringTag:void 0,M=Object.prototype.toString,ne=D?D.toStringTag:void 0;const Z=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":ne&&ne in Object(b)?function(g){var T=w.call(g,B),C=g[B];try{g[B]=void 0;var J=!0}catch{}var fe=I.call(g);return J&&(T?g[B]=C: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,N=parseInt;const X=function(b){if(typeof b=="number")return b;if(function(C){return typeof C=="symbol"||function(J){return J!=null&&typeof J=="object"}(C)&&Z(C)=="[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=_(b);var T=W.test(b);return T||H.test(b)?N(b.slice(2),T?2:8):z.test(b)?NaN:+b};var $=Math.max,de=Math.min;const Le=function(b,g,T){var C,J,fe,Re,y,v,R=0,G=!1,Q=!1,Y=!0;if(typeof b!="function")throw new TypeError("Expected a function");function be(pe){var Oe=C,De=J;return C=J=void 0,R=pe,Re=b.apply(De,Oe)}function ye(pe){return R=pe,y=setTimeout(oe,g),G?be(pe):Re}function je(pe){var Oe=pe-v;return v===void 0||Oe>=g||Oe<0||Q&&pe-R>=fe}function oe(){var pe=S();if(je(pe))return ae(pe);y=setTimeout(oe,function(Oe){var De=g-(Oe-v);return Q?de(De,fe-(Oe-R)):De}(pe))}function ae(pe){return y=void 0,Y&&C?be(pe):(C=J=void 0,Re)}function ue(){var pe=S(),Oe=je(pe);if(C=arguments,J=this,v=pe,Oe){if(y===void 0)return ye(v);if(Q)return clearTimeout(y),y=setTimeout(oe,g),be(v)}return y===void 0&&(y=setTimeout(oe,g)),Re}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),R=0,C=v=J=y=void 0},ue.flush=function(){return y===void 0?Re:ae(S())},ue},V=function(b,g,T){var C=!0,J=!0;if(typeof b!="function")throw new TypeError("Expected a function");return f(T)&&(C="leading"in T?!!T.leading:C,J="trailing"in T?!!T.trailing:J),Le(b,g,{leading:C,maxWait:g,trailing:J})};var ke=n(590),ce=n.n(ke),$e=function(){if(typeof Map<"u")return Map;function b(g,T){var C=-1;return g.some(function(J,fe){return J[0]===T&&(C=fe,!0)}),C}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 C=b(this.__entries__,T),J=this.__entries__[C];return J&&J[1]},g.prototype.set=function(T,C){var J=b(this.__entries__,T);~J?this.__entries__[J][1]=C:this.__entries__.push([T,C])},g.prototype.delete=function(T){var C=this.__entries__,J=b(C,T);~J&&C.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,C){C===void 0&&(C=null);for(var J=0,fe=this.__entries__;J<fe.length;J++){var Re=fe[J];T.call(C,Re[1],Re[0])}},g}()}(),ve=typeof window<"u"&&typeof document<"u"&&window.document===document,Ne=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")(),_e=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ne):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Ge=["top","right","bottom","left","width","height","size","weight"],tt=typeof MutationObserver<"u",pt=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 C=!1,J=!1,fe=0;function Re(){C&&(C=!1,g()),J&&v()}function y(){_e(Re)}function v(){var R=Date.now();if(C){if(R-fe<2)return;J=!0}else C=!0,J=!1,setTimeout(y,20);fe=R}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_,C=T.indexOf(g);~C&&T.splice(C,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),tt?(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,C=T===void 0?"":T;Ge.some(function(J){return!!~C.indexOf(J)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),mt=function(b,g){for(var T=0,C=Object.keys(g);T<C.length;T++){var J=C[T];Object.defineProperty(b,J,{value:g[J],enumerable:!1,writable:!1,configurable:!0})}return b},xe=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||Ne},he=Be(0,0,0,0);function ge(b){return parseFloat(b)||0}function We(b){for(var g=[],T=1;T<arguments.length;T++)g[T-1]=arguments[T];return g.reduce(function(C,J){return C+ge(b["border-"+J+"-width"])},0)}var Ue=typeof SVGGraphicsElement<"u"?function(b){return b instanceof xe(b).SVGGraphicsElement}:function(b){return b instanceof xe(b).SVGElement&&typeof b.getBBox=="function"};function Ot(b){return ve?Ue(b)?function(g){var T=g.getBBox();return Be(0,0,T.width,T.height)}(b):function(g){var T=g.clientWidth,C=g.clientHeight;if(!T&&!C)return he;var J=xe(g).getComputedStyle(g),fe=function(Y){for(var be={},ye=0,je=["top","right","bottom","left"];ye<je.length;ye++){var oe=je[ye],ae=Y["padding-"+oe];be[oe]=ge(ae)}return be}(J),Re=fe.left+fe.right,y=fe.top+fe.bottom,v=ge(J.width),R=ge(J.height);if(J.boxSizing==="border-box"&&(Math.round(v+Re)!==T&&(v-=We(J,"left","right")+Re),Math.round(R+y)!==C&&(R-=We(J,"top","bottom")+y)),!function(Y){return Y===xe(Y).document.documentElement}(g)){var G=Math.round(v+Re)-T,Q=Math.round(R+y)-C;Math.abs(G)!==1&&(v-=G),Math.abs(Q)!==1&&(R-=Q)}return Be(fe.left,fe.top,v,R)}(b):he}function Be(b,g,T,C){return{x:b,y:g,width:T,height:C}}var Ct=function(){function b(g){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Be(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}(),It=function(b,g){var T,C,J,fe,Re,y,v,R=(C=(T=g).x,J=T.y,fe=T.width,Re=T.height,y=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,v=Object.create(y.prototype),mt(v,{x:C,y:J,width:fe,height:Re,top:J,right:C+fe,bottom:Re+J,left:C}),v);mt(this,{target:b,contentRect:R})},Et=function(){function b(g,T,C){if(this.activeObservations_=[],this.observations_=new $e,typeof g!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=g,this.controller_=T,this.callbackCtx_=C}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 xe(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 xe(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(C){return new It(C.target,C.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}(),Rt=typeof WeakMap<"u"?new WeakMap:new $e,Ye=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=pt.getInstance(),C=new Et(g,T,this);Rt.set(this,C)};["observe","unobserve","disconnect"].forEach(function(b){Ye.prototype[b]=function(){var g;return(g=Rt.get(this))[b].apply(g,arguments)}});const At=Ne.ResizeObserver!==void 0?Ne.ResizeObserver:Ye,lt="Left",st="Right",ze="Up",He="Down",gt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},K={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},le="mousemove",Te="mouseup";function Pe(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 Se(b){const{trackMouse:g}=b,T=h.useRef(Object.assign({},K)),C=h.useRef(Object.assign({},gt)),J=h.useRef(Object.assign({},C.current));let fe;for(fe in J.current=Object.assign({},C.current),C.current=Object.assign(Object.assign({},gt),b),gt)C.current[fe]===void 0&&(C.current[fe]=gt[fe]);const[Re,y]=h.useMemo(()=>function(v,R){const G=oe=>{const ae="touches"in oe;ae&&oe.touches.length>1||v((ue,pe)=>{pe.trackMouse&&!ae&&(document.addEventListener(le,Q),document.addEventListener(Te,be));const{clientX:Oe,clientY:De}=ae?oe.touches[0]:oe,Ke=Pe([Oe,De],pe.rotationAngle);return pe.onTouchStartOrOnMouseDown&&pe.onTouchStartOrOnMouseDown({event:oe}),Object.assign(Object.assign(Object.assign({},ue),K),{initial:Ke.slice(),xy:Ke,start:oe.timeStamp||0})})},Q=oe=>{v((ae,ue)=>{const pe="touches"in oe;if(pe&&oe.touches.length>1)return ae;if(oe.timeStamp-ae.start>ue.swipeDuration)return ae.swiping?Object.assign(Object.assign({},ae),{swiping:!1}):ae;const{clientX:Oe,clientY:De}=pe?oe.touches[0]:oe,[Ke,ht]=Pe([Oe,De],ue.rotationAngle),ct=Ke-ae.xy[0],rt=ht-ae.xy[1],Ve=Math.abs(ct),Me=Math.abs(rt),Kt=(oe.timeStamp||0)-ae.start,fn=Math.sqrt(Ve*Ve+Me*Me)/(Kt||1),pn=[ct/(Kt||1),rt/(Kt||1)],Mt=function(mn,cn,gn,vt){return mn>cn?gn>0?st:lt:vt>0?He:ze}(Ve,Me,ct,rt),tn=typeof ue.delta=="number"?ue.delta:ue.delta[Mt.toLowerCase()]||gt.delta;if(Ve<tn&&Me<tn&&!ae.swiping)return ae;const Lt={absX:Ve,absY:Me,deltaX:ct,deltaY:rt,dir:Mt,event:oe,first:ae.first,initial:ae.initial,velocity:fn,vxvy:pn};Lt.first&&ue.onSwipeStart&&ue.onSwipeStart(Lt),ue.onSwiping&&ue.onSwiping(Lt);let ln=!1;return(ue.onSwiping||ue.onSwiped||ue[`onSwiped${Mt}`])&&(ln=!0),ln&&ue.preventScrollOnSwipe&&ue.trackTouch&&oe.cancelable&&oe.preventDefault(),Object.assign(Object.assign({},ae),{first:!1,eventData:Lt,swiping:!0})})},Y=oe=>{v((ae,ue)=>{let pe;if(ae.swiping&&ae.eventData){if(oe.timeStamp-ae.start<ue.swipeDuration){pe=Object.assign(Object.assign({},ae.eventData),{event:oe}),ue.onSwiped&&ue.onSwiped(pe);const Oe=ue[`onSwiped${pe.dir}`];Oe&&Oe(pe)}}else ue.onTap&&ue.onTap({event:oe});return ue.onTouchEndOrOnMouseUp&&ue.onTouchEndOrOnMouseUp({event:oe}),Object.assign(Object.assign(Object.assign({},ae),K),{eventData:pe})})},be=oe=>{document.removeEventListener(le,Q),document.removeEventListener(Te,be),Y(oe)},ye=(oe,ae)=>{let ue=()=>{};if(oe&&oe.addEventListener){const pe=Object.assign(Object.assign({},gt.touchEventOptions),ae.touchEventOptions),Oe=[["touchstart",G,pe],["touchmove",Q,Object.assign(Object.assign({},pe),ae.preventScrollOnSwipe?{passive:!1}:{})],["touchend",Y,pe]];Oe.forEach(([De,Ke,ht])=>oe.addEventListener(De,Ke,ht)),ue=()=>Oe.forEach(([De,Ke])=>oe.removeEventListener(De,Ke))}return ue},je={ref:oe=>{oe!==null&&v((ae,ue)=>{if(ae.el===oe)return ae;const pe={};return ae.el&&ae.el!==oe&&ae.cleanUpTouch&&(ae.cleanUpTouch(),pe.cleanUpTouch=void 0),ue.trackTouch&&oe&&(pe.cleanUpTouch=ye(oe,ue)),Object.assign(Object.assign(Object.assign({},ae),{el:oe}),pe)})}};return R.trackMouse&&(je.onMouseDown=G),[je,ye]}(v=>T.current=v(T.current,C.current),{trackMouse:g}),[g]);return T.current=function(v,R,G,Q){return R.trackTouch&&v.el?v.cleanUpTouch?R.preventScrollOnSwipe!==G.preventScrollOnSwipe||R.touchEventOptions.passive!==G.touchEventOptions.passive?(v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,R)})):v:Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,R)}):(v.cleanUpTouch&&v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:void 0}))}(T.current,C.current,J.current,y),Re}var A=n(697);function se(b){return se=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},se(b)}function me(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function Ce(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?me(Object(T),!0).forEach(function(C){p(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):me(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function p(b,g,T){return(g=function(C){var J=function(fe,Re){if(se(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Re);if(se(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(C,"string");return se(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=Ce(Ce({},x),b),T=g.description,C=g.fullscreen,J=g.handleImageLoaded,fe=g.isFullscreen,Re=g.onImageError,y=g.original,v=g.originalAlt,R=g.originalHeight,G=g.originalWidth,Q=g.originalTitle,Y=g.sizes,be=g.srcSet,ye=g.loading,je=fe&&C||y;return u().createElement(u().Fragment,null,u().createElement("img",{className:"image-gallery-image",src:je,alt:v,srcSet:be,height:R,width:G,sizes:Y,title:Q,onLoad:function(oe){return J(oe,y)},onError:Re,loading:ye}),T&&u().createElement("span",{className:"image-gallery-description"},T))});k.displayName="Item",k.propTypes={description:A.string,fullscreen:A.string,handleImageLoaded:A.func.isRequired,isFullscreen:A.bool,onImageError:A.func.isRequired,original:A.string.isRequired,originalAlt:A.string,originalHeight:A.string,originalWidth:A.string,originalTitle:A.string,sizes:A.string,srcSet:A.string,loading:A.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 ee(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function re(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ee(Object(T),!0).forEach(function(C){Ee(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):ee(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function Ee(b,g,T){return(g=function(C){var J=function(fe,Re){if(U(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Re);if(U(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(C,"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 we={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"}))},nt={strokeWidth:1,viewBox:"0 0 24 24"},et=function(b){var g=re(re({},nt),b),T=g.strokeWidth,C=g.viewBox,J=g.icon;return u().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:C,fill:"none",stroke:"currentColor",strokeWidth:T,strokeLinecap:"round",strokeLinejoin:"round"},we[J])};et.propTypes={strokeWidth:A.number,viewBox:A.string,icon:(0,A.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ae=et;var Fe=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(Ae,{strokeWidth:2,icon:g?"minimize":"maximize"}))});Fe.displayName="Fullscreen",Fe.propTypes={isFullscreen:A.bool.isRequired,onClick:A.func.isRequired};const Ze=Fe;var Dt=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(Ae,{icon:"left",viewBox:"6 0 12 24"}))});Dt.displayName="LeftNav",Dt.propTypes={disabled:A.bool.isRequired,onClick:A.func.isRequired};const on=Dt;var dn=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(Ae,{icon:"right",viewBox:"6 0 12 24"}))});dn.displayName="RightNav",dn.propTypes={disabled:A.bool.isRequired,onClick:A.func.isRequired};const nr=dn;var at=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(Ae,{strokeWidth:2,icon:g?"pause":"play"}))});at.displayName="PlayPause",at.propTypes={isPlaying:A.bool.isRequired,onClick:A.func.isRequired};const hn=at;function Pt(b){return Pt=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},Pt(b)}function Wt(){return Wt=Object.assign?Object.assign.bind():function(b){for(var g=1;g<arguments.length;g++){var T=arguments[g];for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&(b[C]=T[C])}return b},Wt.apply(this,arguments)}function sn(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function an(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?sn(Object(T),!0).forEach(function(C){On(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):sn(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function On(b,g,T){return(g=function(C){var J=function(fe,Re){if(Pt(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Re);if(Pt(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(C,"string");return Pt(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 zt={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Zt=function(b){var g=an(an({},zt),b),T=g.children,C=g.className,J=Se({delta:g.delta,onSwiping:g.onSwiping,onSwiped:g.onSwiped});return u().createElement("div",Wt({},J,{className:C}),T)};Zt.propTypes={children:A.node.isRequired,className:A.string,delta:A.number,onSwiped:A.func,onSwiping:A.func};const en=Zt;function Vt(b){return Vt=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},Vt(b)}function vi(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function yi(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?vi(Object(T),!0).forEach(function(C){bi(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):vi(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function ha(b,g){for(var T=0;T<g.length;T++){var C=g[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,xi(C.key),C)}}function rr(b,g){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,C){return T.__proto__=C,T},rr(b,g)}function fa(b,g){if(g&&(Vt(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 Cn(b){return Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)},Cn(b)}function bi(b,g,T){return(g=xi(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}function xi(b){var g=function(T,C){if(Vt(T)!=="object"||T===null)return T;var J=T[Symbol.toPrimitive];if(J!==void 0){var fe=J.call(T,C);if(Vt(fe)!=="object")return fe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}(b,"string");return Vt(g)==="symbol"?g:String(g)}var wi=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],pa=(0,A.arrayOf)((0,A.shape)({srcSet:A.string,media:A.string}));function Si(b){var g=parseInt(b.keyCode||b.which||0,10);return g===66||g===62}var ir=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&&rr(y,v)})(Re,b);var g,T,C,J,fe=(C=Re,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=Cn(C);if(J){var R=Cn(this).constructor;y=Reflect.construct(v,arguments,R)}else y=v.apply(this,arguments);return fa(this,y)});function Re(y){var v;return function(R,G){if(!(R instanceof G))throw new TypeError("Cannot call a class as a function")}(this,Re),bi(Xe(v=fe.call(this,y)),"onBulletClick",function(R,G){var Q=v.props,Y=Q.onBulletClick,be=Q.items,ye=v.state.currentIndex;R.target.blur(),ye!==G&&(be.length===2?v.slideToIndexWithStyleReset(G,R):v.slideToIndex(G,R)),Y&&Y(R,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=V(v.unthrottledSlideToIndex,y.slideDuration,{trailing:!1}),y.lazyLoad&&(v.lazyLoaded=[]),v}return g=Re,T=[{key:"componentDidMount",value:function(){var y=this.props,v=y.autoPlay,R=y.useWindowKeyDown;v&&this.play(),R?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(y,v){var R=this.props,G=R.items,Q=R.lazyLoad,Y=R.slideDuration,be=R.slideInterval,ye=R.startIndex,je=R.thumbnailPosition,oe=R.showThumbnails,ae=R.useWindowKeyDown,ue=this.state,pe=ue.currentIndex,Oe=ue.isPlaying,De=y.items.length!==G.length,Ke=!ce()(y.items,G),ht=y.startIndex!==ye,ct=y.thumbnailPosition!==je,rt=y.showThumbnails!==oe;be===y.slideInterval&&Y===y.slideDuration||Oe&&(this.pause(),this.play()),ct&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),rt&&oe&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),rt&&!oe&&this.removeThumbnailsResizeObserver(),(De||rt)&&this.handleResize(),v.currentIndex!==pe&&this.slideThumbnailBar(),y.slideDuration!==Y&&(this.slideToIndex=V(this.unthrottledSlideToIndex,Y,{trailing:!1})),!Q||y.lazyLoad&&!Ke||(this.lazyLoaded=[]),ae!==y.useWindowKeyDown&&(ae?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ht||Ke)&&this.setState({currentIndex:ye,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,R=v.currentIndex,G=v.isTransitioning,Q=this.props,Y=Q.onSlide,be=Q.slideDuration;this.transitionTimer=window.setTimeout(function(){G&&(y.setState({isTransitioning:!G,isSwipingThumbnail:!1}),Y&&Y(R))},be+50)}},{key:"onThumbnailClick",value:function(y,v){var R=this.props,G=R.onThumbnailClick,Q=R.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 R=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){R.slideToIndex(v),R.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,R=this.props,G=R.disableThumbnailScroll,Q=R.items,Y=this.state,be=Y.thumbnailsWrapperWidth,ye=Y.thumbnailsWrapperHeight,je=this.thumbnails&&this.thumbnails.current;if(G)return 0;if(je){if(this.isThumbnailVertical()){if(je.scrollHeight<=ye)return 0;v=je.scrollHeight-ye}else{if(je.scrollWidth<=be||be<=0)return 0;v=je.scrollWidth-be}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,R=this.props,G=R.infinite,Q=R.items,Y="",be="image-gallery-left",ye="image-gallery-right";switch(y){case v-1:Y=" ".concat(be);break;case v:Y=" ".concat("image-gallery-center");break;case v+1:Y=" ".concat(ye)}return Q.length>=3&&G&&(y===0&&v===Q.length-1?Y=" ".concat(ye):y===Q.length-1&&v===0&&(Y=" ".concat(be))),Y}},{key:"getTranslateXForTwoSlide",value:function(y){var v=this.state,R=v.currentIndex,G=v.currentSlideOffset,Q=v.previousIndex,Y=R!==Q,be=y===0&&Q===0,ye=y===1&&Q===1,je=y===0&&R===1,oe=y===1&&R===0,ae=G===0,ue=-100*R+100*y+G;return G>0?this.direction="left":G<0&&(this.direction="right"),oe&&G>0&&(ue=-100+G),je&&G<0&&(ue=100+G),Y?be&&ae&&this.direction==="left"?ue=100:ye&&ae&&this.direction==="right"&&(ue=-100):(oe&&ae&&this.direction==="left"&&(ue=-100),je&&ae&&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,R=v.currentIndex,G=v.currentSlideOffset,Q=v.slideStyle,Y=this.props,be=Y.infinite,ye=Y.items,je=Y.useTranslate3D,oe=Y.isRTL,ae=-100*R,ue=ye.length-1,pe=(ae+100*y)*(oe?-1:1)+G;be&&ye.length>2&&(R===0&&y===ue?pe=-100*(oe?-1:1)+G:R===ue&&y===0&&(pe=100*(oe?-1:1)+G)),be&&ye.length===2&&(pe=this.getTranslateXForTwoSlide(y));var Oe="translate(".concat(pe,"%, 0)");return je&&(Oe="translate3d(".concat(pe,"%, 0, 0)")),yi({display:this.isSlideVisible(y)?"inherit":"none",WebkitTransform:Oe,MozTransform:Oe,msTransform:Oe,OTransform:Oe,transform:Oe},Q)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var y,v=this.props,R=v.useTranslate3D,G=v.isRTL,Q=this.state,Y=Q.thumbsTranslate,be=Q.thumbsStyle,ye=G?-1*Y:Y;return this.isThumbnailVertical()?(y="translate(0, ".concat(Y,"px)"),R&&(y="translate3d(0, ".concat(Y,"px, 0)"))):(y="translate(".concat(ye,"px, 0)"),R&&(y="translate3d(".concat(ye,"px, 0, 0)"))),yi({WebkitTransform:y,MozTransform:y,msTransform:y,OTransform:y,transform:y},be)}},{key:"getSlideItems",value:function(){var y=this,v=this.state.currentIndex,R=this.props,G=R.items,Q=R.slideOnThumbnailOver,Y=R.onClick,be=R.lazyLoad,ye=R.onTouchMove,je=R.onTouchEnd,oe=R.onTouchStart,ae=R.onMouseOver,ue=R.onMouseLeave,pe=R.renderItem,Oe=R.renderThumbInner,De=R.showThumbnails,Ke=R.showBullets,ht=[],ct=[],rt=[];return G.forEach(function(Ve,Me){var Kt=y.getAlignmentClassName(Me),fn=Ve.originalClass?" ".concat(Ve.originalClass):"",pn=Ve.thumbnailClass?" ".concat(Ve.thumbnailClass):"",Mt=Ve.renderItem||pe||y.renderItem,tn=Ve.renderThumbInner||Oe||y.renderThumbInner,Lt=!be||Kt||y.lazyLoaded[Me];Lt&&be&&!y.lazyLoaded[Me]&&(y.lazyLoaded[Me]=!0);var ln=y.getSlideStyle(Me),mn=u().createElement("div",{"aria-label":"Go to Slide ".concat(Me+1),key:"slide-".concat(Me),tabIndex:"-1",className:"image-gallery-slide ".concat(Kt," ").concat(fn),style:ln,onClick:Y,onKeyUp:y.handleSlideKeyUp,onTouchMove:ye,onTouchEnd:je,onTouchStart:oe,onMouseOver:ae,onFocus:ae,onMouseLeave:ue,role:"button"},Lt?Mt(Ve):u().createElement("div",{style:{height:"100%"}}));if(ht.push(mn),De&&Ve.thumbnail){var cn=d("image-gallery-thumbnail",pn,{active:v===Me});ct.push(u().createElement("button",{key:"thumbnail-".concat(Me),type:"button",tabIndex:"0","aria-pressed":v===Me?"true":"false","aria-label":"Go to Slide ".concat(Me+1),className:cn,onMouseLeave:Q?y.onThumbnailMouseLeave:null,onMouseOver:function(vt){return y.handleThumbnailMouseOver(vt,Me)},onFocus:function(vt){return y.handleThumbnailMouseOver(vt,Me)},onKeyUp:function(vt){return y.handleThumbnailKeyUp(vt,Me)},onClick:function(vt){return y.onThumbnailClick(vt,Me)}},tn(Ve)))}if(Ke){var gn=d("image-gallery-bullet",Ve.bulletClass,{active:v===Me});rt.push(u().createElement("button",{type:"button",key:"bullet-".concat(Me),className:gn,onClick:function(vt){return y.onBulletClick(vt,Me)},"aria-pressed":v===Me?"true":"false","aria-label":"Go to Slide ".concat(Me+1)}))}}),{slides:ht,thumbnails:ct,bullets:rt}}},{key:"ignoreIsTransitioning",value:function(){var y=this.props.items,v=this.state,R=v.previousIndex,G=v.currentIndex,Q=y.length-1;return Math.abs(R-G)>1&&!(R===0&&G===Q)&&!(R===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,R=v.isTransitioning,G=v.previousIndex,Q=v.currentIndex;return R&&!(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,R=y.isSwipingThumbnail,G=-this.getThumbsTranslate(v);R||(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,R=y.absX,G=y.dir,Q=this.props,Y=Q.disableSwipe,be=Q.stopPropagation,ye=this.state,je=ye.galleryWidth,oe=ye.isTransitioning,ae=ye.swipingUpDown,ue=ye.swipingLeftRight;if(G!==ze&&G!==He&&!ae||ue){if(G!==lt&&G!==st||ue||this.setState({swipingLeftRight:!0}),!Y){var pe=this.props.swipingTransitionDuration;if(be&&v.preventDefault(),oe)this.setState({currentSlideOffset:0});else{var Oe=G===st?1:-1,De=R/je*100;Math.abs(De)>=100&&(De=100);var Ke={transition:"transform ".concat(pe,"ms ease-out")};this.setState({currentSlideOffset:Oe*De,slideStyle:Ke})}}}else ae||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(y){var v=y.event,R=y.absX,G=y.absY,Q=y.dir,Y=this.props,be=Y.stopPropagation,ye=Y.swipingThumbnailTransitionDuration,je=this.state,oe=je.thumbsSwipedTranslate,ae=je.thumbnailsWrapperHeight,ue=je.thumbnailsWrapperWidth,pe=je.swipingUpDown,Oe=je.swipingLeftRight;if(this.isThumbnailVertical()){if((Q===lt||Q===st||Oe)&&!pe)return void(Oe||this.setState({swipingLeftRight:!0}));Q!==ze&&Q!==He||pe||this.setState({swipingUpDown:!0})}else{if((Q===ze||Q===He||pe)&&!Oe)return void(pe||this.setState({swipingUpDown:!0}));Q!==lt&&Q!==st||Oe||this.setState({swipingLeftRight:!0})}var De,Ke,ht,ct,rt,Ve=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(De=oe+(Q===He?G:-G),Ke=Ve.scrollHeight-ae+20,ht=Math.abs(De)>Ke,ct=De>20,rt=Ve.scrollHeight<=ae):(De=oe+(Q===st?R:-R),Ke=Ve.scrollWidth-ue+20,ht=Math.abs(De)>Ke,ct=De>20,rt=Ve.scrollWidth<=ue),!rt&&(Q!==lt&&Q!==ze||!ht)&&(Q!==st&&Q!==He||!ct)){be&&v.stopPropagation();var Me={transition:"transform ".concat(ye,"ms ease-out")};this.setState({thumbsTranslate:De,thumbsStyle:Me})}}},{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,R=y.swipingLeftRight;v&&this.setState({swipingUpDown:!1}),R&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(y){var v=y.event,R=y.dir,G=y.velocity,Q=this.props,Y=Q.disableSwipe,be=Q.stopPropagation,ye=Q.flickThreshold;if(!Y){var je=this.props.isRTL;be&&v.stopPropagation(),this.resetSwipingDirection();var oe=(R===lt?1:-1)*(je?-1:1),ae=G>ye&&!(R===ze||R===He);this.handleOnSwipedTo(oe,ae)}}},{key:"handleOnSwipedTo",value:function(y,v){var R=this.state,G=R.currentIndex,Q=R.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,R=v.disableKeyDown,G=v.useBrowserFullscreen,Q=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!R)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 At(Le(function(R){R&&R.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 At(Le(function(R){R&&R.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,R=y.useBrowserFullscreen,G=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,Q=this.imageGallery.current===G;v&&v(Q),R&&this.setState({isFullscreen:Q})}},{key:"slideToIndex",value:function(y,v){var R=this.state,G=R.currentIndex,Q=R.isTransitioning,Y=this.props,be=Y.items,ye=Y.slideDuration,je=Y.onBeforeSlide;if(!Q){v&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var oe=be.length-1,ae=y;y<0?ae=oe:y>oe&&(ae=0),je&&ae!==G&&je(ae),this.setState({previousIndex:G,currentIndex:ae,isTransitioning:ae!==G,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ye,"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 R=this.state,G=R.currentIndex,Q=R.isTransitioning,Y=this.props.items,be=G+(v==="left"?-1:1);Q||(Y.length===2?this.slideToIndexWithStyleReset(be,y):this.slideToIndex(be,y))}},{key:"slideToIndexWithStyleReset",value:function(y,v){var R=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 R.slideToIndex(y,v)},25)})}},{key:"handleThumbnailMouseOver",value:function(y,v){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(y,v)}},{key:"handleThumbnailKeyUp",value:function(y,v){Si(y)&&this.onThumbnailClick(y,v)}},{key:"handleSlideKeyUp",value:function(y){Si(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;wi.forEach(function(v){document.addEventListener(v,y.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var y=this;wi.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,R=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)),R&&y&&R(Y))}},{key:"pause",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props.onPause,R=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),v&&y&&v(R))}},{key:"isImageLoaded",value:function(y){return!!this.loadedImages[y.original]||(this.loadedImages[y.original]=!0,!1)}},{key:"handleImageLoaded",value:function(y,v){var R=this.props.onImageLoad;!this.loadedImages[v]&&R&&(this.loadedImages[v]=!0,R(y))}},{key:"renderItem",value:function(y){var v=this.state.isFullscreen,R=this.props.onImageError||this.handleImageError;return u().createElement(L,{description:y.description,fullscreen:y.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:v,onImageError:R,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,R=y.isFullscreen,G=y.modalFullscreen,Q=y.isPlaying,Y=this.props,be=Y.additionalClass,ye=Y.disableThumbnailSwipe,je=Y.indexSeparator,oe=Y.isRTL,ae=Y.items,ue=Y.thumbnailPosition,pe=Y.renderFullscreenButton,Oe=Y.renderCustomControls,De=Y.renderLeftNav,Ke=Y.renderRightNav,ht=Y.showBullets,ct=Y.showFullscreenButton,rt=Y.showIndex,Ve=Y.showThumbnails,Me=Y.showNav,Kt=Y.showPlayButton,fn=Y.renderPlayPauseButton,pn=this.getThumbnailStyle(),Mt=this.getSlideItems(),tn=Mt.slides,Lt=Mt.thumbnails,ln=Mt.bullets,mn=d("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ue),{"image-gallery-rtl":oe}),cn=u().createElement("div",{ref:this.imageGallerySlideWrapper,className:mn},Oe&&Oe(),this.canSlide()?u().createElement(u().Fragment,null,Me&&u().createElement(u().Fragment,null,De(this.slideLeft,!this.canSlideLeft()),Ke(this.slideRight,!this.canSlideRight())),u().createElement(en,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},u().createElement("div",{className:"image-gallery-slides"},tn))):u().createElement("div",{className:"image-gallery-slides"},tn),Kt&&fn(this.togglePlay,Q),ht&&u().createElement("div",{className:"image-gallery-bullets"},u().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},ln)),ct&&pe(this.toggleFullScreen,R),rt&&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"},je),u().createElement("span",{className:"image-gallery-index-total"},ae.length))),gn=d("image-gallery",be,{"fullscreen-modal":G}),vt=d("image-gallery-content",this.getThumbnailPositionClassName(ue),{fullscreen:R}),ga=d("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ue),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&oe},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ye},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ye});return u().createElement("div",{ref:this.imageGallery,className:gn,"aria-live":"polite"},u().createElement("div",{className:vt},(ue==="bottom"||ue==="right")&&cn,Ve&&Lt.length>0?u().createElement(en,{className:ga,delta:0,onSwiping:!ye&&this.handleThumbnailSwiping,onSwiped:!ye&&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:pn,"aria-label":"Thumbnail Navigation"},Lt))):null,(ue==="top"||ue==="left")&&cn))}}],T&&ha(g.prototype,T),Object.defineProperty(g,"prototype",{writable:!1}),Re}(u().Component);ir.propTypes={flickThreshold:A.number,items:(0,A.arrayOf)((0,A.shape)({bulletClass:A.string,bulletOnClick:A.func,description:A.string,original:A.string,originalHeight:A.number,originalWidth:A.number,loading:A.string,thumbnailHeight:A.number,thumbnailWidth:A.number,thumbnailLoading:A.string,fullscreen:A.string,originalAlt:A.string,originalTitle:A.string,thumbnail:A.string,thumbnailAlt:A.string,thumbnailLabel:A.string,thumbnailTitle:A.string,originalClass:A.string,thumbnailClass:A.string,renderItem:A.func,renderThumbInner:A.func,imageSet:pa,srcSet:A.string,sizes:A.string})).isRequired,showNav:A.bool,autoPlay:A.bool,lazyLoad:A.bool,infinite:A.bool,showIndex:A.bool,showBullets:A.bool,showThumbnails:A.bool,showPlayButton:A.bool,showFullscreenButton:A.bool,disableThumbnailScroll:A.bool,disableKeyDown:A.bool,disableSwipe:A.bool,disableThumbnailSwipe:A.bool,useBrowserFullscreen:A.bool,onErrorImageURL:A.string,indexSeparator:A.string,thumbnailPosition:(0,A.oneOf)(["top","bottom","left","right"]),startIndex:A.number,slideDuration:A.number,slideInterval:A.number,slideOnThumbnailOver:A.bool,swipeThreshold:A.number,swipingTransitionDuration:A.number,swipingThumbnailTransitionDuration:A.number,onSlide:A.func,onBeforeSlide:A.func,onScreenChange:A.func,onPause:A.func,onPlay:A.func,onClick:A.func,onImageLoad:A.func,onImageError:A.func,onTouchMove:A.func,onTouchEnd:A.func,onTouchStart:A.func,onMouseOver:A.func,onMouseLeave:A.func,onBulletClick:A.func,onThumbnailError:A.func,onThumbnailClick:A.func,renderCustomControls:A.func,renderLeftNav:A.func,renderRightNav:A.func,renderPlayPauseButton:A.func,renderFullscreenButton:A.func,renderItem:A.func,renderThumbInner:A.func,stopPropagation:A.bool,additionalClass:A.string,useTranslate3D:A.bool,isRTL:A.bool,useWindowKeyDown:A.bool},ir.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(on,{onClick:b,disabled:g})},renderRightNav:function(b,g){return u().createElement(nr,{onClick:b,disabled:g})},renderPlayPauseButton:function(b,g){return u().createElement(hn,{onClick:b,isPlaying:g})},renderFullscreenButton:function(b,g){return u().createElement(Ze,{onClick:b,isFullscreen:g})},useWindowKeyDown:!0};const ma=ir})(),o})())}(Wn)),Wn.exports}var Od=jd();const Cd=ni(Od);function Id(){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 Rd="0px",Pd=[0],Ld=Id();function _d(e){var t,r,i=(t=e?.rootMargin)!=null?t:Rd,s=(r=e?.threshold)!=null?r:Pd,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 O=Ld.getObserver({root:o.current,rootMargin:i,threshold:s});O.observe(S,function(P){u(P)}),a.current=O},[i,s]),j=q.useCallback(function(){var S=a.current,O=n.current;O&&S?.unobserve(O),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 Xr(){return Xr=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},Xr.apply(this,arguments)}function Nd(e){var t,r=_d(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,Xr({},s,{isVisible:n,wasEverVisible:a})]}var Ad=100;function Dd(e){var t=e.loading,r=e.hasNextPage,i=e.onLoadMore,s=e.rootMargin,n=e.disabled,o=e.delayInMs,a=o===void 0?Ad:o,d=Nd({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 Md={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"/>'},Bd={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>'},Fd={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 jr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Or(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 Gs(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 $d(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 fi={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,"-":jr?173:189,"=":jr?61:187,";":jr?59:186,"'":222,"[":219,"]":221,"\\":220},Jt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Yr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},it={16:!1,18:!1,17:!1,91:!1},Qe={};for(var Mn=1;Mn<20;Mn++)fi["f".concat(Mn)]=111+Mn;var qe=[],Eo=!1,Hs="all",Xs=[],tr=function(t){return fi[t.toLowerCase()]||Jt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Ys(e){Hs=e||"all"}function kn(){return Hs||"all"}function Ud(){return qe.slice(0)}function qd(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 Wd(e){return typeof e=="string"&&(e=tr(e)),qe.indexOf(e)!==-1}function zd(e,t){var r,i;e||(e=kn());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++;kn()===e&&Ys(t||"all")}function Vd(e){var t=e.keyCode||e.which||e.charCode,r=qe.indexOf(t);if(r>=0&&qe.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&qe.splice(0,qe.length),(t===93||t===224)&&(t=91),t in it){it[t]=!1;for(var i in Jt)Jt[i]===t&&(wt[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&&Cr(o)});else if(typeof e=="object")e.key&&Cr(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=""),Cr({key:e,scope:s,method:n,splitKey:"+"})}}var Cr=function(t){var r=t.key,i=t.scope,s=t.method,n=t.splitKey,o=n===void 0?"+":n,a=Gs(r);a.forEach(function(d){var h=d.split(o),u=h.length,f=h[u-1],j=f==="*"?"*":tr(f);if(Qe[j]){i||(i=kn());var m=u>1?Ks(Jt,h):[];Qe[j]=Qe[j].filter(function(E){var S=s?E.method===s:!0;return!(S&&E.scope===i&&$d(E.mods,m))})}})};function ko(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 it)Object.prototype.hasOwnProperty.call(it,n)&&(!it[n]&&t.mods.indexOf(+n)>-1||it[n]&&t.mods.indexOf(+n)===-1)&&(s=!1);(t.mods.length===0&&!it[16]&&!it[18]&&!it[17]&&!it[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 To(e,t){var r=Qe["*"],i=e.keyCode||e.which||e.charCode;if(wt.filter.call(this,e)){if((i===93||i===224)&&(i=91),qe.indexOf(i)===-1&&i!==229&&qe.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(E){var S=Yr[E];e[E]&&qe.indexOf(S)===-1?qe.push(S):!e[E]&&qe.indexOf(S)>-1?qe.splice(qe.indexOf(S),1):E==="metaKey"&&e[E]&&qe.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(qe=qe.slice(qe.indexOf(S))))}),i in it){it[i]=!0;for(var s in Jt)Jt[s]===i&&(wt[s]=!0);if(!r)return}for(var n in it)Object.prototype.hasOwnProperty.call(it,n)&&(it[n]=e[Yr[n]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(qe.indexOf(17)===-1&&qe.push(17),qe.indexOf(18)===-1&&qe.push(18),it[17]=!0,it[18]=!0);var o=kn();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)&&ko(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(tr(f[m]));j.sort().join("")===qe.sort().join("")&&ko(e,h,o,t)}}}}function Gd(e){return Xs.indexOf(e)>-1}function wt(e,t,r){qe=[];var i=Gs(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(Jt,e)),e=e[e.length-1],e=e==="*"?"*":tr(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"&&!Gd(o)&&window&&(Xs.push(o),Or(o,"keydown",function(j){To(j,o)},f),Eo||(Eo=!0,Or(window,"focus",function(){qe=[]},f)),Or(o,"keyup",function(j){To(j,o),Vd(j)},f))}function Hd(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 Ir={setScope:Ys,getScope:kn,deleteScope:zd,getPressedKeyCodes:Ud,isPressed:Wd,filter:qd,trigger:Hd,unbind:Kd,keyMap:fi,modifier:Jt,modifierMap:Yr};for(var Rr in Ir)Object.prototype.hasOwnProperty.call(Ir,Rr)&&(wt[Rr]=Ir[Rr]);if(typeof window<"u"){var Xd=window.hotkeys;wt.noConflict=function(e){return e&&window.hotkeys===wt&&(window.hotkeys=Xd),wt},window.hotkeys=wt}wt.filter=function(){return!0};var Js=function(t,r){var i=t.target,s=i&&i.tagName;return!!(s&&r&&r.includes(s))},Yd=function(t){return Js(t,["INPUT","TEXTAREA","SELECT"])};function Jd(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),O=q.useCallback(function(P,_){var D,c;return o&&!o(P)?!u:Yd(P)&&!Js(P,n)||(D=P.target)!=null&&D.isContentEditable&&!E?!0:S.current===null||document.activeElement===S.current||(c=S.current)!=null&&c.contains(document.activeElement)?(t(P,_),!0):!1},i?[S,n,o].concat(i):[S,n,o]);return q.useEffect(function(){if(!j){wt.unbind(e,O);return}return a&&d!==!0&&(r.keydown=!1),wt(e,r||{},O),function(){return wt.unbind(e,O)}},[O,e,j]),S}wt.isPressed;const Qs=q.createContext({open:!1,toggleOpen:e=>{}});function Qd({children:e}){const[t,r]=q.useState(!1),i=n=>{r(n??!n)},s=q.useMemo(()=>({open:t,toggleOpen:i}),[t]);return l.jsx(Qs.Provider,{value:s,children:e})}function pi(){return q.useContext(Qs)}const kt={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},Zd=e=>jn(async()=>{const{data:t}=await e.get(kt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function eh(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(or(d,h=>h===""||h===void 0))};return{filters:e,cleanFilter:a=>{const d=a?or(r,(h,u)=>a.includes(u)):{};i(or(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 th=(e,t,r)=>e&&t||!r,Zs=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ea=(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 Qn(e,{...o||a?{imageFilter:"resize",w:o,h:a}:{},v:n})},nh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],rh=(e=[],t="en")=>e.map(r=>({name:r.locales[t]||r.locales.en,value:r._id})),ih=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,oh=(e,t)=>e?.replace(/{(\w*)}/g,(r,i)=>t.hasOwnProperty(i)?t[i]:""),sh=()=>window.innerWidth<=600,ah={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later",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}"'}},lh={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}” 的所有搜索结果"}},Pr={en:
|
|
489
|
+
`;const co=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),xu=(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`},Cs={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function qr({title:e,sx:t,children:r,slotProps:i,fontSize:s=12,fontWeight:n=500,color:o="text.contrast",...a}){return e?c.jsx(Fo,{title:e,placement:"top",...a,slotProps:{popper:{...i?.popper,sx:Ho({[`& .${Ra.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 An({icon:e=null,children:t=null,maxWidth:r=100,title:i=void 0,sx:s={}}){return(t===0||t)&&c.jsxs(ut,{direction:"row",sx:[{alignItems:"center",gap:.5},{maxWidth:r,overflow:"hidden"},...Array.isArray(s)?s:[s]],children:[e,c.jsx(qr,{title:i||(typeof t=="string"?t:""),children:c.jsx(Ie,{variant:"body2",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function wu({...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:O,icons:P,status:_,...$}=e,l=qt(),w=(Z,z=()=>!1)=>(W,...H)=>{const N=Z instanceof Function;(z()||N)&&(W.preventDefault(),W.stopPropagation(),N&&Z(...H))},I=E&&w(E),M=w(m,()=>!!(j||u||f)),D=q.isValidElement(t)?{children:t}:{title:co(t),dangerouslySetInnerHTML:{__html:t}},ne=q.isValidElement(r)?{children:r}:{title:co(r),dangerouslySetInnerHTML:{__html:r}};return c.jsxs(Pa,{variant:"outlined",onClick:I,...$,sx:{p:{xs:2,md:3},borderRadius:1,...$.sx},children:[c.jsxs(ut,{direction:"row",sx:{flex:1,gap:1,alignItems:"center",overflow:"hidden","& > *":{flexShrink:0}},children:[c.jsx(zn,{src:i,did:a,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),c.jsx(Ie,{className:"blocklet-title",...D,sx:[{fontWeight:"fontWeightMedium",fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...Array.isArray(D.sx)?D.sx:[D.sx]]}),c.jsxs(te,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1},children:[d&&c.jsx(qr,{title:d.tooltip,children:c.jsx(La,{sx:{color:d.color||"#D97706",fontSize:d.size||18}})}),P?.map(Z=>c.jsx(qr,{title:Z.title,children:typeof Z.icon=="string"?c.jsx(xt,{icon:Z.icon,style:{color:Z.color}}):Z.icon},Z.key))]}),m&&c.jsxs(bt,{variant:"outlined",size:"small",disabled:u||f,style:{color:l.palette.text.primary,borderColor:l.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:l.typography.fontWeightMedium},onClick:M,children:[f&&c.jsx(jt,{size:15,style:{marginRight:3,color:"inherit"}}),h]}),j]}),c.jsx(ut,{sx:{py:2},children:c.jsx(Ie,{className:"blocklet-description",variant:"body2",...ne,sx:[{color:"text.secondary",display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...Array.isArray(ne.sx)?ne.sx:[ne.sx]]})}),c.jsxs(ut,{direction:"row",sx:{alignItems:"center",gap:2,color:"text.secondary"},children:[c.jsx(An,{icon:c.jsx(zn,{src:s,did:a,size:20,variant:"circle"}),maxWidth:200,children:n}),c.jsx(An,{icon:c.jsx(xt,{icon:Cs}),title:o,children:xu(o)}),_?.filter(Z=>Z.align!=="right").map(Z=>c.jsx(An,{icon:typeof Z.icon=="string"?c.jsx(xt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,children:Z.text},Z.key)),c.jsx(te,{sx:{flex:1}}),_?.filter(Z=>Z.align==="right").map(Z=>c.jsx(An,{icon:typeof Z.icon=="string"?c.jsx(xt,{icon:Z.icon}):Z.icon,title:Z.title,maxWidth:Z.maxWidth,sx:{color:Z.color},children:Z.text},Z.key))]})]})}const Su={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>'},xn=/^[a-z0-9]+(-[a-z0-9]+)*$/,Zn=(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&&!Un(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&&!Un(a)?null:a}if(r&&i===""){const a={provider:i,prefix:"",name:n};return t&&!Un(a,r)?null:a}return null},Un=(e,t)=>e?!!((e.provider===""||e.provider.match(xn))&&(t&&e.prefix===""||e.prefix.match(xn))&&e.name.match(xn)):!1,Is=Object.freeze({left:0,top:0,width:16,height:16}),Vn=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ai=Object.freeze({...Is,...Vn}),Wr=Object.freeze({...ai,body:"",hidden:!1});function Eu(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 uo(e,t){const r=Eu(e,t);for(const i in Wr)i in Vn?i in e&&!(i in r)&&(r[i]=Vn[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function ku(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 Tu(e,t,r){const i=e.icons,s=e.aliases||Object.create(null);let n={};function o(a){n=uo(i[a]||s[a],n)}return o(t),r.forEach(o),uo(e,n)}function Rs(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=ku(e);for(const s in i){const n=i[s];n&&(t(s,Tu(e,s,n)),r.push(s))}return r}const ju={provider:"",aliases:{},not_found:{},...Is};function kr(e,t){for(const r in t)if(r in e&&typeof e[r]!=typeof t[r])return!1;return!0}function Ps(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!kr(e,ju))return null;const r=t.icons;for(const s in r){const n=r[s];if(!s.match(xn)||typeof n.body!="string"||!kr(n,Wr))return null}const i=t.aliases||Object.create(null);for(const s in i){const n=i[s],o=n.parent;if(!s.match(xn)||typeof o!="string"||!r[o]&&!i[o]||!kr(n,Wr))return null}return t}const ho=Object.create(null);function Ou(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function rn(e,t){const r=ho[e]||(ho[e]=Object.create(null));return r[t]||(r[t]=Ou(e,t))}function li(e,t){return Ps(t)?Rs(t,(r,i)=>{i?e.icons[r]=i:e.missing.add(r)}):[]}function Cu(e,t,r){try{if(typeof r.body=="string")return e.icons[t]={...r},!0}catch{}return!1}let Sn=!1;function Ls(e){return typeof e=="boolean"&&(Sn=e),Sn}function Iu(e){const t=typeof e=="string"?Zn(e,!0,Sn):e;if(t){const r=rn(t.provider,t.prefix),i=t.name;return r.icons[i]||(r.missing.has(i)?null:void 0)}}function Ru(e,t){const r=Zn(e,!0,Sn);if(!r)return!1;const i=rn(r.provider,r.prefix);return Cu(i,r.name,t)}function Pu(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Sn&&!t&&!e.prefix){let s=!1;return Ps(e)&&(e.prefix="",Rs(e,(n,o)=>{o&&Ru(n,o)&&(s=!0)})),s}const r=e.prefix;if(!Un({provider:t,prefix:r,name:"a"}))return!1;const i=rn(t,r);return!!li(i,e)}const _s=Object.freeze({width:null,height:null}),Ns=Object.freeze({..._s,...Vn}),Lu=/(-?[0-9.]*[0-9]+[0-9.]*)/g,_u=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function fo(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(Lu);if(i===null||!i.length)return e;const s=[];let n=i.shift(),o=_u.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 Nu=e=>e==="unset"||e==="undefined"||e==="none";function Au(e,t){const r={...ai,...e},i={...Ns,...t},s={left:r.left,top:r.top,width:r.width,height:r.height};let n=r.body;[r,i].forEach(E=>{const S=[],O=E.hFlip,P=E.vFlip;let _=E.rotate;O?P?_+=2:(S.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),S.push("scale(-1 1)"),s.top=s.left=0):P&&(S.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),S.push("scale(1 -1)"),s.top=s.left=0);let $;switch(_<0&&(_-=Math.floor(_/4)*4),_=_%4,_){case 1:$=s.height/2+s.top,S.unshift("rotate(90 "+$.toString()+" "+$.toString()+")");break;case 2:S.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:$=s.width/2+s.left,S.unshift("rotate(-90 "+$.toString()+" "+$.toString()+")");break}_%2===1&&(s.left!==s.top&&($=s.left,s.left=s.top,s.top=$),s.width!==s.height&&($=s.width,s.width=s.height,s.height=$)),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=fo(f,d/h)):(u=o==="auto"?d:o,f=a===null?fo(u,h/d):a==="auto"?h:a);const j={},m=(E,S)=>{Nu(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 Du=/\sid="(\S+)"/g,Mu="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Bu=0;function Fu(e,t=Mu){const r=[];let i;for(;i=Du.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+(Bu++).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 zr=Object.create(null);function $u(e,t){zr[e]=t}function Vr(e){return zr[e]||zr[""]}function ci(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 ui=Object.create(null),yn=["https://api.simplesvg.com","https://api.unisvg.com"],qn=[];for(;yn.length>0;)yn.length===1||Math.random()>.5?qn.push(yn.shift()):qn.push(yn.pop());ui[""]=ci({resources:["https://api.iconify.design"].concat(qn)});function Uu(e,t){const r=ci(t);return r===null?!1:(ui[e]=r,!0)}function di(e){return ui[e]}const qu=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let po=qu();function Wu(e,t){const r=di(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 zu(e){return e===404}const Vu=(e,t,r)=>{const i=[],s=Wu(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=di(e);if(t)return t.path}return"/"}const Gu=(e,t,r)=>{if(!po){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;po(e+i).then(n=>{const o=n.status;if(o!==200){setTimeout(()=>{r(zu(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)})},Hu={prepare:Vu,send:Gu};function Xu(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]=rn(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 As(e,t){e.forEach(r=>{const i=r.loaderCallbacks;i&&(r.loaderCallbacks=i.filter(s=>s.id!==t))})}function Yu(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||As([e],n.id),n.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),n.abort))})}))}let Ju=0;function Qu(e,t,r){const i=Ju++,s=As.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 Zu(e,t=!0,r=!1){const i=[];return e.forEach(s=>{const n=typeof s=="string"?Zn(s,t,r):s;n&&i.push(n)}),i}var ed={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function td(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 I=e.resources.slice(0);for(o=[];I.length>1;){const M=Math.floor(Math.random()*I.length);o.push(I[M]),I=I.slice(0,M).concat(I.slice(M+1))}o=o.concat(I)}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(I=>{I.status==="pending"&&(I.status="aborted")}),j=[]}function O(I,M){M&&(m=[]),typeof I=="function"&&m.push(I)}function P(){return{startTime:a,payload:t,status:d,queriesSent:h,queriesPending:j.length,subscribe:O,abort:S}}function _(){d="failed",m.forEach(I=>{I(void 0,u)})}function $(){j.forEach(I=>{I.status==="pending"&&(I.status="aborted")}),j=[]}function l(I,M,D){const ne=M!=="success";switch(j=j.filter(Z=>Z!==I),d){case"pending":break;case"failed":if(ne||!e.dataAfterTimeout)return;break;default:return}if(M==="abort"){u=D,_();return}if(ne){u=D,j.length||(o.length?w():_());return}if(E(),$(),!e.random){const Z=e.resources.indexOf(I.resource);Z!==-1&&Z!==e.index&&(e.index=Z)}d="completed",m.forEach(Z=>{Z(D)})}function w(){if(d!=="pending")return;E();const I=o.shift();if(I===void 0){if(j.length){f=setTimeout(()=>{E(),d==="pending"&&($(),_())},e.timeout);return}_();return}const M={status:"pending",resource:I,callback:(D,ne)=>{l(M,D,ne)}};j.push(M),h++,f=setTimeout(w,e.rotate),r(I,t,M.callback)}return setTimeout(w),P}function Ds(e){const t={...ed,...e};let r=[];function i(){r=r.filter(a=>a().status==="pending")}function s(a,d,h){const u=td(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 mo(){}const Tr=Object.create(null);function nd(e){if(!Tr[e]){const t=di(e);if(!t)return;const r=Ds(t),i={config:t,redundancy:r};Tr[e]=i}return Tr[e]}function rd(e,t,r){let i,s;if(typeof e=="string"){const n=Vr(e);if(!n)return r(void 0,424),mo;s=n.send;const o=nd(e);o&&(i=o.redundancy)}else{const n=ci(e);if(n){i=Ds(n);const o=e.resources?e.resources[0]:"",a=Vr(o);a&&(s=a.send)}}return!i||!s?(r(void 0,424),mo):i.query(t,s,r)().abort}const go="iconify2",En="iconify",Ms=En+"-count",vo=En+"-version",Bs=36e5,id=168;function Kr(e,t){try{return e.getItem(t)}catch{}}function hi(e,t,r){try{return e.setItem(t,r),!0}catch{}}function yo(e,t){try{e.removeItem(t)}catch{}}function Gr(e,t){return hi(e,Ms,t.toString())}function Hr(e){return parseInt(Kr(e,Ms))||0}const er={local:!0,session:!0},Fs={local:new Set,session:new Set};let fi=!1;function od(e){fi=e}let Dn=typeof window>"u"?{}:window;function $s(e){const t=e+"Storage";try{if(Dn&&Dn[t]&&typeof Dn[t].length=="number")return Dn[t]}catch{}er[e]=!1}function Us(e,t){const r=$s(e);if(!r)return;const i=Kr(r,vo);if(i!==go){if(i){const a=Hr(r);for(let d=0;d<a;d++)yo(r,En+d.toString())}hi(r,vo,go),Gr(r,0);return}const s=Math.floor(Date.now()/Bs)-id,n=a=>{const d=En+a.toString(),h=Kr(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{}yo(r,d)}};let o=Hr(r);for(let a=o-1;a>=0;a--)n(a)||(a===o-1?(o--,Gr(r,o)):Fs[e].add(a))}function qs(){if(!fi){od(!0);for(const e in er)Us(e,t=>{const r=t.data,i=t.provider,s=r.prefix,n=rn(i,s);if(!li(n,r).length)return!1;const o=r.lastModified||-1;return n.lastModifiedCached=n.lastModifiedCached?Math.min(n.lastModifiedCached,o):o,!0})}}function sd(e,t){const r=e.lastModifiedCached;if(r&&r>=t)return r===t;if(e.lastModifiedCached=t,r)for(const i in er)Us(i,s=>{const n=s.data;return s.provider!==e.provider||n.prefix!==e.prefix||n.lastModified===t});return!0}function ad(e,t){fi||qs();function r(i){let s;if(!er[i]||!(s=$s(i)))return;const n=Fs[i];let o;if(n.size)n.delete(o=Array.from(n).shift());else if(o=Hr(s),!Gr(s,o+1))return;const a={cached:Math.floor(Date.now()/Bs),provider:e.provider,data:t};return hi(s,En+o.toString(),JSON.stringify(a))}t.lastModified&&!sd(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),r("local")||r("session"))}function bo(){}function ld(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Yu(e)}))}function cd(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=Vr(r)))return;n.prepare(r,i,s).forEach(a=>{rd(r,a,d=>{if(typeof d!="object")a.icons.forEach(h=>{e.missing.add(h)});else try{const h=li(e,d);if(!h.length)return;const u=e.pendingIcons;u&&h.forEach(f=>{u.delete(f)}),ad(e,d)}catch(h){console.error(h)}ld(e)})})}))}const ud=(e,t)=>{const r=Zu(e,!0,Ls()),i=Xu(r);if(!i.pending.length){let d=!0;return t&&setTimeout(()=>{d&&t(i.loaded,i.missing,i.pending,bo)}),()=>{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(rn(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=rn(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&&cd(d,s[h][u])}),t?Qu(t,i,n):bo};function dd(e,t){const r={...e};for(const i in t){const s=t[i],n=typeof s;i in _s?(s===null||s&&(n==="string"||n==="number"))&&(r[i]=s):n===typeof r[i]&&(r[i]=i==="rotate"?s%4:s)}return r}const hd=/[\s,]+/;function fd(e,t){t.split(hd).forEach(r=>{switch(r.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function pd(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 md(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 gd(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function vd(e){return"data:image/svg+xml,"+gd(e)}function yd(e){return'url("'+vd(e)+'")'}let wn;function bd(){try{wn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{wn=null}}function xd(e){return wn===void 0&&bd(),wn?wn.createHTML(e):e}const Ws={...Ns,inline:!1},wd={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Sd={display:"inline-block"},Xr={backgroundColor:"currentColor"},zs={backgroundColor:"transparent"},xo={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},wo={WebkitMask:Xr,mask:Xr,background:zs};for(const e in wo){const t=wo[e];for(const r in xo)t[e+r]=xo[r]}const Ed={...Ws,inline:!0};function So(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const kd=(e,t,r,i)=>{const s=r?Ed:Ws,n=dd(s,t),o=t.mode||"svg",a={},d=t.style||{},h={...o==="svg"?wd:{},ref:i};for(let P in t){const _=t[P];if(_!==void 0)switch(P){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":n[P]=_===!0||_==="true"||_===1;break;case"flip":typeof _=="string"&&fd(n,_);break;case"color":a.color=_;break;case"rotate":typeof _=="string"?n[P]=pd(_):typeof _=="number"&&(n[P]=_);break;case"ariaHidden":case"aria-hidden":_!==!0&&_!=="true"&&delete h["aria-hidden"];break;default:s[P]===void 0&&(h[P]=_)}}const u=Au(e,n),f=u.attributes;if(n.inline&&(a.verticalAlign="-0.125em"),o==="svg"){h.style={...a,...d},Object.assign(h,f);let P=0,_=t.id;return typeof _=="string"&&(_=_.replace(/-/g,"_")),h.dangerouslySetInnerHTML={__html:xd(Fu(u.body,_?()=>_+"ID"+P++:"iconifyReact"))},Ut.createElement("svg",h)}const{body:j,width:m,height:E}=e,S=o==="mask"||(o==="bg"?!1:j.indexOf("currentColor")!==-1),O=md(j,{...f,width:m+"",height:E+""});return h.style={...a,"--svg":yd(O),width:So(f.width),height:So(f.height),...Sd,...S?Xr:zs,...d},Ut.createElement("span",h)};Ls(!0);$u("",Hu);if(typeof document<"u"&&typeof window<"u"){qs();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"||!Pu(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;Uu(r,s)||console.error(i)}catch{console.error(i)}}}}class Vs 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=Zn(i,!1,!0))===null){this._abortLoading(),this._setData(null);return}const n=Iu(s);if(!n){(!this._loading||this._loading.name!==i)&&(this._abortLoading(),this._icon="",this._setData(null),n!==null&&(this._loading={name:i,abort:ud([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(" ")}),kd({...ai,...r.data},i,t._inline,t._ref)}}const Ft=Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!1};return Ut.createElement(Vs,i)});Ut.forwardRef(function(t,r){const i={...t,_ref:r,_inline:!0};return Ut.createElement(Vs,i)});var Wn={exports:{}},Td=Wn.exports,Eo;function jd(){return Eo||(Eo=1,function(e,t){(function(r,i){e.exports=i(Ya())})(Td,r=>(()=>{var i={703:(a,d,h)=>{var u=h(414);function f(){}function j(){}j.resetWarningCache=f,a.exports=function(){function m(O,P,_,$,l,w){if(w!==u){var I=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 I.name="Invariant Violation",I}}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,O,P,_;if(Array.isArray(m)){if((S=m.length)!=E.length)return!1;for(O=S;O--!=0;)if(!j(m[O],E[O]))return!1;return!0}if(h&&m instanceof Map&&E instanceof Map){if(m.size!==E.size)return!1;for(_=m.entries();!(O=_.next()).done;)if(!E.has(O.value[0]))return!1;for(_=m.entries();!(O=_.next()).done;)if(!j(O.value[1],E.get(O.value[0])))return!1;return!0}if(u&&m instanceof Set&&E instanceof Set){if(m.size!==E.size)return!1;for(_=m.entries();!(O=_.next()).done;)if(!E.has(O.value[0]))return!1;return!0}if(f&&ArrayBuffer.isView(m)&&ArrayBuffer.isView(E)){if((S=m.length)!=E.length)return!1;for(O=S;O--!=0;)if(m[O]!==E[O])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=(P=Object.keys(m)).length)!==Object.keys(E).length)return!1;for(O=S;O--!=0;)if(!Object.prototype.hasOwnProperty.call(E,P[O]))return!1;if(d&&m instanceof Element)return!1;for(O=S;O--!=0;)if((P[O]!=="_owner"&&P[O]!=="__v"&&P[O]!=="__o"||!m.$$typeof)&&!j(m[P[O]],E[P[O]]))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,C="";if(typeof b=="string"||typeof b=="number")C+=b;else if(typeof b=="object")if(Array.isArray(b))for(g=0;g<b.length;g++)b[g]&&(T=a(b[g]))&&(C&&(C+=" "),C+=T);else for(g in b)b[g]&&(C&&(C+=" "),C+=g);return C}function d(){for(var b,g,T=0,C="";T<arguments.length;)(b=arguments[T++])&&(g=a(b))&&(C&&(C+=" "),C+=g);return C}n.r(o),n.d(o,{default:()=>ma});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 In=="object"&&In&&In.Object===Object&&In;var m=typeof self=="object"&&self&&self.Object===Object&&self;const E=j||m||Function("return this")(),S=function(){return E.Date.now()};var O=/\s/,P=/^\s+/;const _=function(b){return b&&b.slice(0,function(g){for(var T=g.length;T--&&O.test(g.charAt(T)););return T}(b)+1).replace(P,"")},$=E.Symbol;var l=Object.prototype,w=l.hasOwnProperty,I=l.toString,M=$?$.toStringTag:void 0,D=Object.prototype.toString,ne=$?$.toStringTag:void 0;const Z=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":ne&&ne in Object(b)?function(g){var T=w.call(g,M),C=g[M];try{g[M]=void 0;var J=!0}catch{}var fe=I.call(g);return J&&(T?g[M]=C:delete g[M]),fe}(b):function(g){return D.call(g)}(b)};var z=/^[-+]0x[0-9a-f]+$/i,W=/^0b[01]+$/i,H=/^0o[0-7]+$/i,N=parseInt;const X=function(b){if(typeof b=="number")return b;if(function(C){return typeof C=="symbol"||function(J){return J!=null&&typeof J=="object"}(C)&&Z(C)=="[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=_(b);var T=W.test(b);return T||H.test(b)?N(b.slice(2),T?2:8):z.test(b)?NaN:+b};var F=Math.max,de=Math.min;const Le=function(b,g,T){var C,J,fe,Re,y,v,R=0,G=!1,Q=!1,Y=!0;if(typeof b!="function")throw new TypeError("Expected a function");function be(pe){var Oe=C,De=J;return C=J=void 0,R=pe,Re=b.apply(De,Oe)}function ye(pe){return R=pe,y=setTimeout(oe,g),G?be(pe):Re}function je(pe){var Oe=pe-v;return v===void 0||Oe>=g||Oe<0||Q&&pe-R>=fe}function oe(){var pe=S();if(je(pe))return ae(pe);y=setTimeout(oe,function(Oe){var De=g-(Oe-v);return Q?de(De,fe-(Oe-R)):De}(pe))}function ae(pe){return y=void 0,Y&&C?be(pe):(C=J=void 0,Re)}function ue(){var pe=S(),Oe=je(pe);if(C=arguments,J=this,v=pe,Oe){if(y===void 0)return ye(v);if(Q)return clearTimeout(y),y=setTimeout(oe,g),be(v)}return y===void 0&&(y=setTimeout(oe,g)),Re}return g=X(g)||0,f(T)&&(G=!!T.leading,fe=(Q="maxWait"in T)?F(X(T.maxWait)||0,g):fe,Y="trailing"in T?!!T.trailing:Y),ue.cancel=function(){y!==void 0&&clearTimeout(y),R=0,C=v=J=y=void 0},ue.flush=function(){return y===void 0?Re:ae(S())},ue},V=function(b,g,T){var C=!0,J=!0;if(typeof b!="function")throw new TypeError("Expected a function");return f(T)&&(C="leading"in T?!!T.leading:C,J="trailing"in T?!!T.trailing:J),Le(b,g,{leading:C,maxWait:g,trailing:J})};var ke=n(590),ce=n.n(ke),$e=function(){if(typeof Map<"u")return Map;function b(g,T){var C=-1;return g.some(function(J,fe){return J[0]===T&&(C=fe,!0)}),C}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 C=b(this.__entries__,T),J=this.__entries__[C];return J&&J[1]},g.prototype.set=function(T,C){var J=b(this.__entries__,T);~J?this.__entries__[J][1]=C:this.__entries__.push([T,C])},g.prototype.delete=function(T){var C=this.__entries__,J=b(C,T);~J&&C.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,C){C===void 0&&(C=null);for(var J=0,fe=this.__entries__;J<fe.length;J++){var Re=fe[J];T.call(C,Re[1],Re[0])}},g}()}(),ve=typeof window<"u"&&typeof document<"u"&&window.document===document,Ne=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")(),_e=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ne):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Ge=["top","right","bottom","left","width","height","size","weight"],tt=typeof MutationObserver<"u",pt=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 C=!1,J=!1,fe=0;function Re(){C&&(C=!1,g()),J&&v()}function y(){_e(Re)}function v(){var R=Date.now();if(C){if(R-fe<2)return;J=!0}else C=!0,J=!1,setTimeout(y,20);fe=R}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_,C=T.indexOf(g);~C&&T.splice(C,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),tt?(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,C=T===void 0?"":T;Ge.some(function(J){return!!~C.indexOf(J)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),mt=function(b,g){for(var T=0,C=Object.keys(g);T<C.length;T++){var J=C[T];Object.defineProperty(b,J,{value:g[J],enumerable:!1,writable:!1,configurable:!0})}return b},xe=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||Ne},he=Be(0,0,0,0);function ge(b){return parseFloat(b)||0}function We(b){for(var g=[],T=1;T<arguments.length;T++)g[T-1]=arguments[T];return g.reduce(function(C,J){return C+ge(b["border-"+J+"-width"])},0)}var Ue=typeof SVGGraphicsElement<"u"?function(b){return b instanceof xe(b).SVGGraphicsElement}:function(b){return b instanceof xe(b).SVGElement&&typeof b.getBBox=="function"};function Ot(b){return ve?Ue(b)?function(g){var T=g.getBBox();return Be(0,0,T.width,T.height)}(b):function(g){var T=g.clientWidth,C=g.clientHeight;if(!T&&!C)return he;var J=xe(g).getComputedStyle(g),fe=function(Y){for(var be={},ye=0,je=["top","right","bottom","left"];ye<je.length;ye++){var oe=je[ye],ae=Y["padding-"+oe];be[oe]=ge(ae)}return be}(J),Re=fe.left+fe.right,y=fe.top+fe.bottom,v=ge(J.width),R=ge(J.height);if(J.boxSizing==="border-box"&&(Math.round(v+Re)!==T&&(v-=We(J,"left","right")+Re),Math.round(R+y)!==C&&(R-=We(J,"top","bottom")+y)),!function(Y){return Y===xe(Y).document.documentElement}(g)){var G=Math.round(v+Re)-T,Q=Math.round(R+y)-C;Math.abs(G)!==1&&(v-=G),Math.abs(Q)!==1&&(R-=Q)}return Be(fe.left,fe.top,v,R)}(b):he}function Be(b,g,T,C){return{x:b,y:g,width:T,height:C}}var Ct=function(){function b(g){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Be(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}(),It=function(b,g){var T,C,J,fe,Re,y,v,R=(C=(T=g).x,J=T.y,fe=T.width,Re=T.height,y=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,v=Object.create(y.prototype),mt(v,{x:C,y:J,width:fe,height:Re,top:J,right:C+fe,bottom:Re+J,left:C}),v);mt(this,{target:b,contentRect:R})},Et=function(){function b(g,T,C){if(this.activeObservations_=[],this.observations_=new $e,typeof g!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=g,this.controller_=T,this.callbackCtx_=C}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 xe(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 xe(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(C){return new It(C.target,C.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}(),Rt=typeof WeakMap<"u"?new WeakMap:new $e,Ye=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=pt.getInstance(),C=new Et(g,T,this);Rt.set(this,C)};["observe","unobserve","disconnect"].forEach(function(b){Ye.prototype[b]=function(){var g;return(g=Rt.get(this))[b].apply(g,arguments)}});const At=Ne.ResizeObserver!==void 0?Ne.ResizeObserver:Ye,lt="Left",st="Right",ze="Up",He="Down",gt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},K={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},le="mousemove",Te="mouseup";function Pe(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 Se(b){const{trackMouse:g}=b,T=h.useRef(Object.assign({},K)),C=h.useRef(Object.assign({},gt)),J=h.useRef(Object.assign({},C.current));let fe;for(fe in J.current=Object.assign({},C.current),C.current=Object.assign(Object.assign({},gt),b),gt)C.current[fe]===void 0&&(C.current[fe]=gt[fe]);const[Re,y]=h.useMemo(()=>function(v,R){const G=oe=>{const ae="touches"in oe;ae&&oe.touches.length>1||v((ue,pe)=>{pe.trackMouse&&!ae&&(document.addEventListener(le,Q),document.addEventListener(Te,be));const{clientX:Oe,clientY:De}=ae?oe.touches[0]:oe,Ke=Pe([Oe,De],pe.rotationAngle);return pe.onTouchStartOrOnMouseDown&&pe.onTouchStartOrOnMouseDown({event:oe}),Object.assign(Object.assign(Object.assign({},ue),K),{initial:Ke.slice(),xy:Ke,start:oe.timeStamp||0})})},Q=oe=>{v((ae,ue)=>{const pe="touches"in oe;if(pe&&oe.touches.length>1)return ae;if(oe.timeStamp-ae.start>ue.swipeDuration)return ae.swiping?Object.assign(Object.assign({},ae),{swiping:!1}):ae;const{clientX:Oe,clientY:De}=pe?oe.touches[0]:oe,[Ke,ht]=Pe([Oe,De],ue.rotationAngle),ct=Ke-ae.xy[0],rt=ht-ae.xy[1],Ve=Math.abs(ct),Me=Math.abs(rt),Kt=(oe.timeStamp||0)-ae.start,fn=Math.sqrt(Ve*Ve+Me*Me)/(Kt||1),pn=[ct/(Kt||1),rt/(Kt||1)],Mt=function(mn,cn,gn,vt){return mn>cn?gn>0?st:lt:vt>0?He:ze}(Ve,Me,ct,rt),tn=typeof ue.delta=="number"?ue.delta:ue.delta[Mt.toLowerCase()]||gt.delta;if(Ve<tn&&Me<tn&&!ae.swiping)return ae;const Lt={absX:Ve,absY:Me,deltaX:ct,deltaY:rt,dir:Mt,event:oe,first:ae.first,initial:ae.initial,velocity:fn,vxvy:pn};Lt.first&&ue.onSwipeStart&&ue.onSwipeStart(Lt),ue.onSwiping&&ue.onSwiping(Lt);let ln=!1;return(ue.onSwiping||ue.onSwiped||ue[`onSwiped${Mt}`])&&(ln=!0),ln&&ue.preventScrollOnSwipe&&ue.trackTouch&&oe.cancelable&&oe.preventDefault(),Object.assign(Object.assign({},ae),{first:!1,eventData:Lt,swiping:!0})})},Y=oe=>{v((ae,ue)=>{let pe;if(ae.swiping&&ae.eventData){if(oe.timeStamp-ae.start<ue.swipeDuration){pe=Object.assign(Object.assign({},ae.eventData),{event:oe}),ue.onSwiped&&ue.onSwiped(pe);const Oe=ue[`onSwiped${pe.dir}`];Oe&&Oe(pe)}}else ue.onTap&&ue.onTap({event:oe});return ue.onTouchEndOrOnMouseUp&&ue.onTouchEndOrOnMouseUp({event:oe}),Object.assign(Object.assign(Object.assign({},ae),K),{eventData:pe})})},be=oe=>{document.removeEventListener(le,Q),document.removeEventListener(Te,be),Y(oe)},ye=(oe,ae)=>{let ue=()=>{};if(oe&&oe.addEventListener){const pe=Object.assign(Object.assign({},gt.touchEventOptions),ae.touchEventOptions),Oe=[["touchstart",G,pe],["touchmove",Q,Object.assign(Object.assign({},pe),ae.preventScrollOnSwipe?{passive:!1}:{})],["touchend",Y,pe]];Oe.forEach(([De,Ke,ht])=>oe.addEventListener(De,Ke,ht)),ue=()=>Oe.forEach(([De,Ke])=>oe.removeEventListener(De,Ke))}return ue},je={ref:oe=>{oe!==null&&v((ae,ue)=>{if(ae.el===oe)return ae;const pe={};return ae.el&&ae.el!==oe&&ae.cleanUpTouch&&(ae.cleanUpTouch(),pe.cleanUpTouch=void 0),ue.trackTouch&&oe&&(pe.cleanUpTouch=ye(oe,ue)),Object.assign(Object.assign(Object.assign({},ae),{el:oe}),pe)})}};return R.trackMouse&&(je.onMouseDown=G),[je,ye]}(v=>T.current=v(T.current,C.current),{trackMouse:g}),[g]);return T.current=function(v,R,G,Q){return R.trackTouch&&v.el?v.cleanUpTouch?R.preventScrollOnSwipe!==G.preventScrollOnSwipe||R.touchEventOptions.passive!==G.touchEventOptions.passive?(v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,R)})):v:Object.assign(Object.assign({},v),{cleanUpTouch:Q(v.el,R)}):(v.cleanUpTouch&&v.cleanUpTouch(),Object.assign(Object.assign({},v),{cleanUpTouch:void 0}))}(T.current,C.current,J.current,y),Re}var A=n(697);function se(b){return se=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},se(b)}function me(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function Ce(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?me(Object(T),!0).forEach(function(C){p(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):me(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function p(b,g,T){return(g=function(C){var J=function(fe,Re){if(se(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Re);if(se(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(C,"string");return se(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=Ce(Ce({},x),b),T=g.description,C=g.fullscreen,J=g.handleImageLoaded,fe=g.isFullscreen,Re=g.onImageError,y=g.original,v=g.originalAlt,R=g.originalHeight,G=g.originalWidth,Q=g.originalTitle,Y=g.sizes,be=g.srcSet,ye=g.loading,je=fe&&C||y;return u().createElement(u().Fragment,null,u().createElement("img",{className:"image-gallery-image",src:je,alt:v,srcSet:be,height:R,width:G,sizes:Y,title:Q,onLoad:function(oe){return J(oe,y)},onError:Re,loading:ye}),T&&u().createElement("span",{className:"image-gallery-description"},T))});k.displayName="Item",k.propTypes={description:A.string,fullscreen:A.string,handleImageLoaded:A.func.isRequired,isFullscreen:A.bool,onImageError:A.func.isRequired,original:A.string.isRequired,originalAlt:A.string,originalHeight:A.string,originalWidth:A.string,originalTitle:A.string,sizes:A.string,srcSet:A.string,loading:A.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 ee(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function re(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?ee(Object(T),!0).forEach(function(C){Ee(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):ee(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function Ee(b,g,T){return(g=function(C){var J=function(fe,Re){if(U(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Re);if(U(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(C,"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 we={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"}))},nt={strokeWidth:1,viewBox:"0 0 24 24"},et=function(b){var g=re(re({},nt),b),T=g.strokeWidth,C=g.viewBox,J=g.icon;return u().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:C,fill:"none",stroke:"currentColor",strokeWidth:T,strokeLinecap:"round",strokeLinejoin:"round"},we[J])};et.propTypes={strokeWidth:A.number,viewBox:A.string,icon:(0,A.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ae=et;var Fe=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(Ae,{strokeWidth:2,icon:g?"minimize":"maximize"}))});Fe.displayName="Fullscreen",Fe.propTypes={isFullscreen:A.bool.isRequired,onClick:A.func.isRequired};const Ze=Fe;var Dt=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(Ae,{icon:"left",viewBox:"6 0 12 24"}))});Dt.displayName="LeftNav",Dt.propTypes={disabled:A.bool.isRequired,onClick:A.func.isRequired};const on=Dt;var dn=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(Ae,{icon:"right",viewBox:"6 0 12 24"}))});dn.displayName="RightNav",dn.propTypes={disabled:A.bool.isRequired,onClick:A.func.isRequired};const nr=dn;var at=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(Ae,{strokeWidth:2,icon:g?"pause":"play"}))});at.displayName="PlayPause",at.propTypes={isPlaying:A.bool.isRequired,onClick:A.func.isRequired};const hn=at;function Pt(b){return Pt=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},Pt(b)}function Wt(){return Wt=Object.assign?Object.assign.bind():function(b){for(var g=1;g<arguments.length;g++){var T=arguments[g];for(var C in T)Object.prototype.hasOwnProperty.call(T,C)&&(b[C]=T[C])}return b},Wt.apply(this,arguments)}function sn(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function an(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?sn(Object(T),!0).forEach(function(C){On(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):sn(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function On(b,g,T){return(g=function(C){var J=function(fe,Re){if(Pt(fe)!=="object"||fe===null)return fe;var y=fe[Symbol.toPrimitive];if(y!==void 0){var v=y.call(fe,Re);if(Pt(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(fe)}(C,"string");return Pt(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 zt={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Zt=function(b){var g=an(an({},zt),b),T=g.children,C=g.className,J=Se({delta:g.delta,onSwiping:g.onSwiping,onSwiped:g.onSwiped});return u().createElement("div",Wt({},J,{className:C}),T)};Zt.propTypes={children:A.node.isRequired,className:A.string,delta:A.number,onSwiped:A.func,onSwiping:A.func};const en=Zt;function Vt(b){return Vt=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},Vt(b)}function yi(b,g){var T=Object.keys(b);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(b);g&&(C=C.filter(function(J){return Object.getOwnPropertyDescriptor(b,J).enumerable})),T.push.apply(T,C)}return T}function bi(b){for(var g=1;g<arguments.length;g++){var T=arguments[g]!=null?arguments[g]:{};g%2?yi(Object(T),!0).forEach(function(C){xi(b,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(T)):yi(Object(T)).forEach(function(C){Object.defineProperty(b,C,Object.getOwnPropertyDescriptor(T,C))})}return b}function ha(b,g){for(var T=0;T<g.length;T++){var C=g[T];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,wi(C.key),C)}}function rr(b,g){return rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,C){return T.__proto__=C,T},rr(b,g)}function fa(b,g){if(g&&(Vt(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 Cn(b){return Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(g){return g.__proto__||Object.getPrototypeOf(g)},Cn(b)}function xi(b,g,T){return(g=wi(g))in b?Object.defineProperty(b,g,{value:T,enumerable:!0,configurable:!0,writable:!0}):b[g]=T,b}function wi(b){var g=function(T,C){if(Vt(T)!=="object"||T===null)return T;var J=T[Symbol.toPrimitive];if(J!==void 0){var fe=J.call(T,C);if(Vt(fe)!=="object")return fe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(T)}(b,"string");return Vt(g)==="symbol"?g:String(g)}var Si=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],pa=(0,A.arrayOf)((0,A.shape)({srcSet:A.string,media:A.string}));function Ei(b){var g=parseInt(b.keyCode||b.which||0,10);return g===66||g===62}var ir=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&&rr(y,v)})(Re,b);var g,T,C,J,fe=(C=Re,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=Cn(C);if(J){var R=Cn(this).constructor;y=Reflect.construct(v,arguments,R)}else y=v.apply(this,arguments);return fa(this,y)});function Re(y){var v;return function(R,G){if(!(R instanceof G))throw new TypeError("Cannot call a class as a function")}(this,Re),xi(Xe(v=fe.call(this,y)),"onBulletClick",function(R,G){var Q=v.props,Y=Q.onBulletClick,be=Q.items,ye=v.state.currentIndex;R.target.blur(),ye!==G&&(be.length===2?v.slideToIndexWithStyleReset(G,R):v.slideToIndex(G,R)),Y&&Y(R,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=V(v.unthrottledSlideToIndex,y.slideDuration,{trailing:!1}),y.lazyLoad&&(v.lazyLoaded=[]),v}return g=Re,T=[{key:"componentDidMount",value:function(){var y=this.props,v=y.autoPlay,R=y.useWindowKeyDown;v&&this.play(),R?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(y,v){var R=this.props,G=R.items,Q=R.lazyLoad,Y=R.slideDuration,be=R.slideInterval,ye=R.startIndex,je=R.thumbnailPosition,oe=R.showThumbnails,ae=R.useWindowKeyDown,ue=this.state,pe=ue.currentIndex,Oe=ue.isPlaying,De=y.items.length!==G.length,Ke=!ce()(y.items,G),ht=y.startIndex!==ye,ct=y.thumbnailPosition!==je,rt=y.showThumbnails!==oe;be===y.slideInterval&&Y===y.slideDuration||Oe&&(this.pause(),this.play()),ct&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),rt&&oe&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),rt&&!oe&&this.removeThumbnailsResizeObserver(),(De||rt)&&this.handleResize(),v.currentIndex!==pe&&this.slideThumbnailBar(),y.slideDuration!==Y&&(this.slideToIndex=V(this.unthrottledSlideToIndex,Y,{trailing:!1})),!Q||y.lazyLoad&&!Ke||(this.lazyLoaded=[]),ae!==y.useWindowKeyDown&&(ae?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(ht||Ke)&&this.setState({currentIndex:ye,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,R=v.currentIndex,G=v.isTransitioning,Q=this.props,Y=Q.onSlide,be=Q.slideDuration;this.transitionTimer=window.setTimeout(function(){G&&(y.setState({isTransitioning:!G,isSwipingThumbnail:!1}),Y&&Y(R))},be+50)}},{key:"onThumbnailClick",value:function(y,v){var R=this.props,G=R.onThumbnailClick,Q=R.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 R=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){R.slideToIndex(v),R.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,R=this.props,G=R.disableThumbnailScroll,Q=R.items,Y=this.state,be=Y.thumbnailsWrapperWidth,ye=Y.thumbnailsWrapperHeight,je=this.thumbnails&&this.thumbnails.current;if(G)return 0;if(je){if(this.isThumbnailVertical()){if(je.scrollHeight<=ye)return 0;v=je.scrollHeight-ye}else{if(je.scrollWidth<=be||be<=0)return 0;v=je.scrollWidth-be}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,R=this.props,G=R.infinite,Q=R.items,Y="",be="image-gallery-left",ye="image-gallery-right";switch(y){case v-1:Y=" ".concat(be);break;case v:Y=" ".concat("image-gallery-center");break;case v+1:Y=" ".concat(ye)}return Q.length>=3&&G&&(y===0&&v===Q.length-1?Y=" ".concat(ye):y===Q.length-1&&v===0&&(Y=" ".concat(be))),Y}},{key:"getTranslateXForTwoSlide",value:function(y){var v=this.state,R=v.currentIndex,G=v.currentSlideOffset,Q=v.previousIndex,Y=R!==Q,be=y===0&&Q===0,ye=y===1&&Q===1,je=y===0&&R===1,oe=y===1&&R===0,ae=G===0,ue=-100*R+100*y+G;return G>0?this.direction="left":G<0&&(this.direction="right"),oe&&G>0&&(ue=-100+G),je&&G<0&&(ue=100+G),Y?be&&ae&&this.direction==="left"?ue=100:ye&&ae&&this.direction==="right"&&(ue=-100):(oe&&ae&&this.direction==="left"&&(ue=-100),je&&ae&&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,R=v.currentIndex,G=v.currentSlideOffset,Q=v.slideStyle,Y=this.props,be=Y.infinite,ye=Y.items,je=Y.useTranslate3D,oe=Y.isRTL,ae=-100*R,ue=ye.length-1,pe=(ae+100*y)*(oe?-1:1)+G;be&&ye.length>2&&(R===0&&y===ue?pe=-100*(oe?-1:1)+G:R===ue&&y===0&&(pe=100*(oe?-1:1)+G)),be&&ye.length===2&&(pe=this.getTranslateXForTwoSlide(y));var Oe="translate(".concat(pe,"%, 0)");return je&&(Oe="translate3d(".concat(pe,"%, 0, 0)")),bi({display:this.isSlideVisible(y)?"inherit":"none",WebkitTransform:Oe,MozTransform:Oe,msTransform:Oe,OTransform:Oe,transform:Oe},Q)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var y,v=this.props,R=v.useTranslate3D,G=v.isRTL,Q=this.state,Y=Q.thumbsTranslate,be=Q.thumbsStyle,ye=G?-1*Y:Y;return this.isThumbnailVertical()?(y="translate(0, ".concat(Y,"px)"),R&&(y="translate3d(0, ".concat(Y,"px, 0)"))):(y="translate(".concat(ye,"px, 0)"),R&&(y="translate3d(".concat(ye,"px, 0, 0)"))),bi({WebkitTransform:y,MozTransform:y,msTransform:y,OTransform:y,transform:y},be)}},{key:"getSlideItems",value:function(){var y=this,v=this.state.currentIndex,R=this.props,G=R.items,Q=R.slideOnThumbnailOver,Y=R.onClick,be=R.lazyLoad,ye=R.onTouchMove,je=R.onTouchEnd,oe=R.onTouchStart,ae=R.onMouseOver,ue=R.onMouseLeave,pe=R.renderItem,Oe=R.renderThumbInner,De=R.showThumbnails,Ke=R.showBullets,ht=[],ct=[],rt=[];return G.forEach(function(Ve,Me){var Kt=y.getAlignmentClassName(Me),fn=Ve.originalClass?" ".concat(Ve.originalClass):"",pn=Ve.thumbnailClass?" ".concat(Ve.thumbnailClass):"",Mt=Ve.renderItem||pe||y.renderItem,tn=Ve.renderThumbInner||Oe||y.renderThumbInner,Lt=!be||Kt||y.lazyLoaded[Me];Lt&&be&&!y.lazyLoaded[Me]&&(y.lazyLoaded[Me]=!0);var ln=y.getSlideStyle(Me),mn=u().createElement("div",{"aria-label":"Go to Slide ".concat(Me+1),key:"slide-".concat(Me),tabIndex:"-1",className:"image-gallery-slide ".concat(Kt," ").concat(fn),style:ln,onClick:Y,onKeyUp:y.handleSlideKeyUp,onTouchMove:ye,onTouchEnd:je,onTouchStart:oe,onMouseOver:ae,onFocus:ae,onMouseLeave:ue,role:"button"},Lt?Mt(Ve):u().createElement("div",{style:{height:"100%"}}));if(ht.push(mn),De&&Ve.thumbnail){var cn=d("image-gallery-thumbnail",pn,{active:v===Me});ct.push(u().createElement("button",{key:"thumbnail-".concat(Me),type:"button",tabIndex:"0","aria-pressed":v===Me?"true":"false","aria-label":"Go to Slide ".concat(Me+1),className:cn,onMouseLeave:Q?y.onThumbnailMouseLeave:null,onMouseOver:function(vt){return y.handleThumbnailMouseOver(vt,Me)},onFocus:function(vt){return y.handleThumbnailMouseOver(vt,Me)},onKeyUp:function(vt){return y.handleThumbnailKeyUp(vt,Me)},onClick:function(vt){return y.onThumbnailClick(vt,Me)}},tn(Ve)))}if(Ke){var gn=d("image-gallery-bullet",Ve.bulletClass,{active:v===Me});rt.push(u().createElement("button",{type:"button",key:"bullet-".concat(Me),className:gn,onClick:function(vt){return y.onBulletClick(vt,Me)},"aria-pressed":v===Me?"true":"false","aria-label":"Go to Slide ".concat(Me+1)}))}}),{slides:ht,thumbnails:ct,bullets:rt}}},{key:"ignoreIsTransitioning",value:function(){var y=this.props.items,v=this.state,R=v.previousIndex,G=v.currentIndex,Q=y.length-1;return Math.abs(R-G)>1&&!(R===0&&G===Q)&&!(R===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,R=v.isTransitioning,G=v.previousIndex,Q=v.currentIndex;return R&&!(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,R=y.isSwipingThumbnail,G=-this.getThumbsTranslate(v);R||(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,R=y.absX,G=y.dir,Q=this.props,Y=Q.disableSwipe,be=Q.stopPropagation,ye=this.state,je=ye.galleryWidth,oe=ye.isTransitioning,ae=ye.swipingUpDown,ue=ye.swipingLeftRight;if(G!==ze&&G!==He&&!ae||ue){if(G!==lt&&G!==st||ue||this.setState({swipingLeftRight:!0}),!Y){var pe=this.props.swipingTransitionDuration;if(be&&v.preventDefault(),oe)this.setState({currentSlideOffset:0});else{var Oe=G===st?1:-1,De=R/je*100;Math.abs(De)>=100&&(De=100);var Ke={transition:"transform ".concat(pe,"ms ease-out")};this.setState({currentSlideOffset:Oe*De,slideStyle:Ke})}}}else ae||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(y){var v=y.event,R=y.absX,G=y.absY,Q=y.dir,Y=this.props,be=Y.stopPropagation,ye=Y.swipingThumbnailTransitionDuration,je=this.state,oe=je.thumbsSwipedTranslate,ae=je.thumbnailsWrapperHeight,ue=je.thumbnailsWrapperWidth,pe=je.swipingUpDown,Oe=je.swipingLeftRight;if(this.isThumbnailVertical()){if((Q===lt||Q===st||Oe)&&!pe)return void(Oe||this.setState({swipingLeftRight:!0}));Q!==ze&&Q!==He||pe||this.setState({swipingUpDown:!0})}else{if((Q===ze||Q===He||pe)&&!Oe)return void(pe||this.setState({swipingUpDown:!0}));Q!==lt&&Q!==st||Oe||this.setState({swipingLeftRight:!0})}var De,Ke,ht,ct,rt,Ve=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(De=oe+(Q===He?G:-G),Ke=Ve.scrollHeight-ae+20,ht=Math.abs(De)>Ke,ct=De>20,rt=Ve.scrollHeight<=ae):(De=oe+(Q===st?R:-R),Ke=Ve.scrollWidth-ue+20,ht=Math.abs(De)>Ke,ct=De>20,rt=Ve.scrollWidth<=ue),!rt&&(Q!==lt&&Q!==ze||!ht)&&(Q!==st&&Q!==He||!ct)){be&&v.stopPropagation();var Me={transition:"transform ".concat(ye,"ms ease-out")};this.setState({thumbsTranslate:De,thumbsStyle:Me})}}},{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,R=y.swipingLeftRight;v&&this.setState({swipingUpDown:!1}),R&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(y){var v=y.event,R=y.dir,G=y.velocity,Q=this.props,Y=Q.disableSwipe,be=Q.stopPropagation,ye=Q.flickThreshold;if(!Y){var je=this.props.isRTL;be&&v.stopPropagation(),this.resetSwipingDirection();var oe=(R===lt?1:-1)*(je?-1:1),ae=G>ye&&!(R===ze||R===He);this.handleOnSwipedTo(oe,ae)}}},{key:"handleOnSwipedTo",value:function(y,v){var R=this.state,G=R.currentIndex,Q=R.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,R=v.disableKeyDown,G=v.useBrowserFullscreen,Q=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!R)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 At(Le(function(R){R&&R.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 At(Le(function(R){R&&R.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,R=y.useBrowserFullscreen,G=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,Q=this.imageGallery.current===G;v&&v(Q),R&&this.setState({isFullscreen:Q})}},{key:"slideToIndex",value:function(y,v){var R=this.state,G=R.currentIndex,Q=R.isTransitioning,Y=this.props,be=Y.items,ye=Y.slideDuration,je=Y.onBeforeSlide;if(!Q){v&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var oe=be.length-1,ae=y;y<0?ae=oe:y>oe&&(ae=0),je&&ae!==G&&je(ae),this.setState({previousIndex:G,currentIndex:ae,isTransitioning:ae!==G,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ye,"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 R=this.state,G=R.currentIndex,Q=R.isTransitioning,Y=this.props.items,be=G+(v==="left"?-1:1);Q||(Y.length===2?this.slideToIndexWithStyleReset(be,y):this.slideToIndex(be,y))}},{key:"slideToIndexWithStyleReset",value:function(y,v){var R=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 R.slideToIndex(y,v)},25)})}},{key:"handleThumbnailMouseOver",value:function(y,v){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(y,v)}},{key:"handleThumbnailKeyUp",value:function(y,v){Ei(y)&&this.onThumbnailClick(y,v)}},{key:"handleSlideKeyUp",value:function(y){Ei(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;Si.forEach(function(v){document.addEventListener(v,y.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var y=this;Si.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,R=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)),R&&y&&R(Y))}},{key:"pause",value:function(){var y=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],v=this.props.onPause,R=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),v&&y&&v(R))}},{key:"isImageLoaded",value:function(y){return!!this.loadedImages[y.original]||(this.loadedImages[y.original]=!0,!1)}},{key:"handleImageLoaded",value:function(y,v){var R=this.props.onImageLoad;!this.loadedImages[v]&&R&&(this.loadedImages[v]=!0,R(y))}},{key:"renderItem",value:function(y){var v=this.state.isFullscreen,R=this.props.onImageError||this.handleImageError;return u().createElement(L,{description:y.description,fullscreen:y.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:v,onImageError:R,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,R=y.isFullscreen,G=y.modalFullscreen,Q=y.isPlaying,Y=this.props,be=Y.additionalClass,ye=Y.disableThumbnailSwipe,je=Y.indexSeparator,oe=Y.isRTL,ae=Y.items,ue=Y.thumbnailPosition,pe=Y.renderFullscreenButton,Oe=Y.renderCustomControls,De=Y.renderLeftNav,Ke=Y.renderRightNav,ht=Y.showBullets,ct=Y.showFullscreenButton,rt=Y.showIndex,Ve=Y.showThumbnails,Me=Y.showNav,Kt=Y.showPlayButton,fn=Y.renderPlayPauseButton,pn=this.getThumbnailStyle(),Mt=this.getSlideItems(),tn=Mt.slides,Lt=Mt.thumbnails,ln=Mt.bullets,mn=d("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ue),{"image-gallery-rtl":oe}),cn=u().createElement("div",{ref:this.imageGallerySlideWrapper,className:mn},Oe&&Oe(),this.canSlide()?u().createElement(u().Fragment,null,Me&&u().createElement(u().Fragment,null,De(this.slideLeft,!this.canSlideLeft()),Ke(this.slideRight,!this.canSlideRight())),u().createElement(en,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},u().createElement("div",{className:"image-gallery-slides"},tn))):u().createElement("div",{className:"image-gallery-slides"},tn),Kt&&fn(this.togglePlay,Q),ht&&u().createElement("div",{className:"image-gallery-bullets"},u().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},ln)),ct&&pe(this.toggleFullScreen,R),rt&&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"},je),u().createElement("span",{className:"image-gallery-index-total"},ae.length))),gn=d("image-gallery",be,{"fullscreen-modal":G}),vt=d("image-gallery-content",this.getThumbnailPositionClassName(ue),{fullscreen:R}),ga=d("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ue),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&oe},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ye},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ye});return u().createElement("div",{ref:this.imageGallery,className:gn,"aria-live":"polite"},u().createElement("div",{className:vt},(ue==="bottom"||ue==="right")&&cn,Ve&&Lt.length>0?u().createElement(en,{className:ga,delta:0,onSwiping:!ye&&this.handleThumbnailSwiping,onSwiped:!ye&&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:pn,"aria-label":"Thumbnail Navigation"},Lt))):null,(ue==="top"||ue==="left")&&cn))}}],T&&ha(g.prototype,T),Object.defineProperty(g,"prototype",{writable:!1}),Re}(u().Component);ir.propTypes={flickThreshold:A.number,items:(0,A.arrayOf)((0,A.shape)({bulletClass:A.string,bulletOnClick:A.func,description:A.string,original:A.string,originalHeight:A.number,originalWidth:A.number,loading:A.string,thumbnailHeight:A.number,thumbnailWidth:A.number,thumbnailLoading:A.string,fullscreen:A.string,originalAlt:A.string,originalTitle:A.string,thumbnail:A.string,thumbnailAlt:A.string,thumbnailLabel:A.string,thumbnailTitle:A.string,originalClass:A.string,thumbnailClass:A.string,renderItem:A.func,renderThumbInner:A.func,imageSet:pa,srcSet:A.string,sizes:A.string})).isRequired,showNav:A.bool,autoPlay:A.bool,lazyLoad:A.bool,infinite:A.bool,showIndex:A.bool,showBullets:A.bool,showThumbnails:A.bool,showPlayButton:A.bool,showFullscreenButton:A.bool,disableThumbnailScroll:A.bool,disableKeyDown:A.bool,disableSwipe:A.bool,disableThumbnailSwipe:A.bool,useBrowserFullscreen:A.bool,onErrorImageURL:A.string,indexSeparator:A.string,thumbnailPosition:(0,A.oneOf)(["top","bottom","left","right"]),startIndex:A.number,slideDuration:A.number,slideInterval:A.number,slideOnThumbnailOver:A.bool,swipeThreshold:A.number,swipingTransitionDuration:A.number,swipingThumbnailTransitionDuration:A.number,onSlide:A.func,onBeforeSlide:A.func,onScreenChange:A.func,onPause:A.func,onPlay:A.func,onClick:A.func,onImageLoad:A.func,onImageError:A.func,onTouchMove:A.func,onTouchEnd:A.func,onTouchStart:A.func,onMouseOver:A.func,onMouseLeave:A.func,onBulletClick:A.func,onThumbnailError:A.func,onThumbnailClick:A.func,renderCustomControls:A.func,renderLeftNav:A.func,renderRightNav:A.func,renderPlayPauseButton:A.func,renderFullscreenButton:A.func,renderItem:A.func,renderThumbInner:A.func,stopPropagation:A.bool,additionalClass:A.string,useTranslate3D:A.bool,isRTL:A.bool,useWindowKeyDown:A.bool},ir.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(on,{onClick:b,disabled:g})},renderRightNav:function(b,g){return u().createElement(nr,{onClick:b,disabled:g})},renderPlayPauseButton:function(b,g){return u().createElement(hn,{onClick:b,isPlaying:g})},renderFullscreenButton:function(b,g){return u().createElement(Ze,{onClick:b,isFullscreen:g})},useWindowKeyDown:!0};const ma=ir})(),o})())}(Wn)),Wn.exports}var Od=jd();const Cd=ri(Od);function Id(){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 Rd="0px",Pd=[0],Ld=Id();function _d(e){var t,r,i=(t=e?.rootMargin)!=null?t:Rd,s=(r=e?.threshold)!=null?r:Pd,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 O=Ld.getObserver({root:o.current,rootMargin:i,threshold:s});O.observe(S,function(P){u(P)}),a.current=O},[i,s]),j=q.useCallback(function(){var S=a.current,O=n.current;O&&S?.unobserve(O),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 Yr(){return Yr=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},Yr.apply(this,arguments)}function Nd(e){var t,r=_d(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,Yr({},s,{isVisible:n,wasEverVisible:a})]}var Ad=100;function Dd(e){var t=e.loading,r=e.hasNextPage,i=e.onLoadMore,s=e.rootMargin,n=e.disabled,o=e.delayInMs,a=o===void 0?Ad:o,d=Nd({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 Md={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"/>'},Bd={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>'},Fd={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 jr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Or(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 Gs(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 $d(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 pi={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,"-":jr?173:189,"=":jr?61:187,";":jr?59:186,"'":222,"[":219,"]":221,"\\":220},Jt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Jr={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},it={16:!1,18:!1,17:!1,91:!1},Qe={};for(var Mn=1;Mn<20;Mn++)pi["f".concat(Mn)]=111+Mn;var qe=[],ko=!1,Hs="all",Xs=[],tr=function(t){return pi[t.toLowerCase()]||Jt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function Ys(e){Hs=e||"all"}function kn(){return Hs||"all"}function Ud(){return qe.slice(0)}function qd(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 Wd(e){return typeof e=="string"&&(e=tr(e)),qe.indexOf(e)!==-1}function zd(e,t){var r,i;e||(e=kn());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++;kn()===e&&Ys(t||"all")}function Vd(e){var t=e.keyCode||e.which||e.charCode,r=qe.indexOf(t);if(r>=0&&qe.splice(r,1),e.key&&e.key.toLowerCase()==="meta"&&qe.splice(0,qe.length),(t===93||t===224)&&(t=91),t in it){it[t]=!1;for(var i in Jt)Jt[i]===t&&(wt[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&&Cr(o)});else if(typeof e=="object")e.key&&Cr(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=""),Cr({key:e,scope:s,method:n,splitKey:"+"})}}var Cr=function(t){var r=t.key,i=t.scope,s=t.method,n=t.splitKey,o=n===void 0?"+":n,a=Gs(r);a.forEach(function(d){var h=d.split(o),u=h.length,f=h[u-1],j=f==="*"?"*":tr(f);if(Qe[j]){i||(i=kn());var m=u>1?Ks(Jt,h):[];Qe[j]=Qe[j].filter(function(E){var S=s?E.method===s:!0;return!(S&&E.scope===i&&$d(E.mods,m))})}})};function To(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 it)Object.prototype.hasOwnProperty.call(it,n)&&(!it[n]&&t.mods.indexOf(+n)>-1||it[n]&&t.mods.indexOf(+n)===-1)&&(s=!1);(t.mods.length===0&&!it[16]&&!it[18]&&!it[17]&&!it[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 jo(e,t){var r=Qe["*"],i=e.keyCode||e.which||e.charCode;if(wt.filter.call(this,e)){if((i===93||i===224)&&(i=91),qe.indexOf(i)===-1&&i!==229&&qe.push(i),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(E){var S=Jr[E];e[E]&&qe.indexOf(S)===-1?qe.push(S):!e[E]&&qe.indexOf(S)>-1?qe.splice(qe.indexOf(S),1):E==="metaKey"&&e[E]&&qe.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(qe=qe.slice(qe.indexOf(S))))}),i in it){it[i]=!0;for(var s in Jt)Jt[s]===i&&(wt[s]=!0);if(!r)return}for(var n in it)Object.prototype.hasOwnProperty.call(it,n)&&(it[n]=e[Jr[n]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(qe.indexOf(17)===-1&&qe.push(17),qe.indexOf(18)===-1&&qe.push(18),it[17]=!0,it[18]=!0);var o=kn();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)&&To(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(tr(f[m]));j.sort().join("")===qe.sort().join("")&&To(e,h,o,t)}}}}function Gd(e){return Xs.indexOf(e)>-1}function wt(e,t,r){qe=[];var i=Gs(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(Jt,e)),e=e[e.length-1],e=e==="*"?"*":tr(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"&&!Gd(o)&&window&&(Xs.push(o),Or(o,"keydown",function(j){jo(j,o)},f),ko||(ko=!0,Or(window,"focus",function(){qe=[]},f)),Or(o,"keyup",function(j){jo(j,o),Vd(j)},f))}function Hd(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 Ir={setScope:Ys,getScope:kn,deleteScope:zd,getPressedKeyCodes:Ud,isPressed:Wd,filter:qd,trigger:Hd,unbind:Kd,keyMap:pi,modifier:Jt,modifierMap:Jr};for(var Rr in Ir)Object.prototype.hasOwnProperty.call(Ir,Rr)&&(wt[Rr]=Ir[Rr]);if(typeof window<"u"){var Xd=window.hotkeys;wt.noConflict=function(e){return e&&window.hotkeys===wt&&(window.hotkeys=Xd),wt},window.hotkeys=wt}wt.filter=function(){return!0};var Js=function(t,r){var i=t.target,s=i&&i.tagName;return!!(s&&r&&r.includes(s))},Yd=function(t){return Js(t,["INPUT","TEXTAREA","SELECT"])};function Jd(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),O=q.useCallback(function(P,_){var $,l;return o&&!o(P)?!u:Yd(P)&&!Js(P,n)||($=P.target)!=null&&$.isContentEditable&&!E?!0:S.current===null||document.activeElement===S.current||(l=S.current)!=null&&l.contains(document.activeElement)?(t(P,_),!0):!1},i?[S,n,o].concat(i):[S,n,o]);return q.useEffect(function(){if(!j){wt.unbind(e,O);return}return a&&d!==!0&&(r.keydown=!1),wt(e,r||{},O),function(){return wt.unbind(e,O)}},[O,e,j]),S}wt.isPressed;const Qs=q.createContext({open:!1,toggleOpen:e=>{}});function Qd({children:e}){const[t,r]=q.useState(!1),i=n=>{r(n??!n)},s=q.useMemo(()=>({open:t,toggleOpen:i}),[t]);return c.jsx(Qs.Provider,{value:s,children:e})}function mi(){return q.useContext(Qs)}const kt={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},Zd=e=>jn(async()=>{const{data:t}=await e.get(kt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function eh(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(or(d,h=>h===""||h===void 0))};return{filters:e,cleanFilter:a=>{const d=a?or(r,(h,u)=>a.includes(u)):{};i(or(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})},handleSwitchIsOfficial:a=>{o({isOfficial:a==="true"?"true":""})},handleSwitchShowResources:a=>{o({showResources:a})},handleSearchSelect:a=>{s(a)}}}const th=(e,t,r)=>e&&t||!r,Zs=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],ea=(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 Qn(e,{...o||a?{imageFilter:"resize",w:o,h:a}:{},v:n})},nh=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],rh=(e=[],t="en")=>e.map(r=>({name:r.locales[t]||r.locales.en,value:r._id})),ih=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,oh=(e,t)=>e?.replace(/{(\w*)}/g,(r,i)=>t.hasOwnProperty(i)?t[i]:""),sh=()=>window.innerWidth<=600,ah={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",official:"Official Blocklets",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}"'}},lh={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",official:"官方 Blocklet",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}” 的所有搜索结果"}},Pr={en:Ci(ah),zh:Ci(lh)},ta=(e,t)=>{const r={};return e&&(r["x-blocklet-server-version"]=e),t&&(r["x-blocklet-store-version"]=t),r},ch=e=>(t,r)=>{const i=Pr[e]?Pr[e][t]:Pr.en[t];return oh(i,r)||t},na={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:()=>{},handleSwitchIsOfficial:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},ra=q.createContext(na),{Provider:uh,Consumer:Af}=ra;function dh(e){const{locale:t="zh",filters:r={},serverVersion:i="",onFilterChange:s=()=>{},minItemWidth:n=350,queryFilter:o=!0,layout:a={},wrapChildren:d=V=>V,extraFilter:h=V=>V,baseSearch:u=!1,fetchCategoryDelay:f=0,showResourcesSwitch:j=!1,showCategory:m=!0,tagFilters:E=[],children:S,storeVersion:O,onSearchSelect:P=()=>{},endpoint:_,blockletRender:$,compact:l=!1}=e,w=ta(i,O),I=q.useMemo(()=>Zo({baseURL:_,headers:w}),[_]),M=eh(r,{onFilterChange:s,emptyCategory:!a.showExplore,onSearchSelect:P}),[D,ne]=q.useState(""),{data:Z=[],error:z,loading:W,run:H}=Zd(I),N=q.useMemo(()=>{const V=Il(Z,[ce=>ce.name],["asc"]),ke=V.findIndex(ce=>ce.name==="All"||ce.locales.en==="All");return ke>-1?[{...V[ke],_id:"All"},...V.slice(0,ke),...V.slice(ke+1)]:V},[Z]),X=q.useCallback(ch(t),[t]),F=q.useMemo(()=>rh(N,t),[N,t]),de=nh(X),Le={search:M,compact:l,errors:{fetchCategoriesError:z},loadings:{fetchCategoriesLoading:W},extraFilter:h,endpoint:_,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:O,serverVersion:i,selectedCategory:M.filters.category||(a.showExplore?"":"All"),categoryList:N,blockletRender:$,locale:t,categoryOptions:F,priceOptions:de,storeApi:I,baseSearch:u,showResourcesSwitch:j,showCategory:m,tagFilters:E,onFilterChange:s,getCategoryLocale:V=>{if(!V)return null;const ke=Z.find(ce=>ce._id===V||ce.locales.en==="All");return ke?ke.locales[t]||ke.locales.en:null},get developerName(){return D},updateDeveloperName:ne};return q.useEffect(()=>{setTimeout(H,f||0)},[_,H,f]),c.jsx(uh,{value:Le,children:S})}function dt(){return q.useContext(ra)||na}function ia({children:e,onClick:t,size:r=32,...i}){return c.jsx(Tn,{...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 Bn(e,t){return e===void 0?t:e}function gi({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=Yt(o.breakpoints.down("sm")),d=Yt(o.breakpoints.between("sm","md")),h=Yt(o.breakpoints.between("md","lg")),u=Yt(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=Bn(t,f),d)||(f=Bn(r,f),h)||(f=Bn(i,f),u)?f:Bn(s,f)}function hh({children:e}){const{open:t,toggleOpen:r}=mi();return c.jsx(gi,{xs:c.jsx(Aa,{open:t,onClose:()=>r(!1),children:e}),md:c.jsx(te,{children:e})})}function fh({loading:e=!1,disabled:t,...r}){return c.jsx(Tn,{disableElevation:!0,disabled:t||e===!0,...r,sx:[{borderRadius:"4px"},...Array.isArray(r.sx)?r.sx:[r.sx]],startIcon:e&&c.jsx(jt,{size:"1em"})})}function Qr({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=Yt(o.breakpoints.down("sm"));q.useEffect(()=>{u(e!==null?e:"")},[e]);const j=q.useCallback(()=>{d(!1)},[]),m=q.useCallback(()=>{d(!0)},[]);function E(O){u(O.value),r(O.value),f&&j()}function S(O){return O===h}return c.jsxs(c.Fragment,{children:[c.jsxs(ph,{ref:n,onClick:m,variant:"outlined",size:"medium",className:["my-select__selector",bn(h)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...s,children:[t.find(O=>O.value===h)?.name||i,c.jsx(Ba,{className:"my-select__arrowdown",component:Fa,sx:{width:18,height:18}})]}),c.jsx($a,{open:a,anchorEl:n.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:O,placement:P})=>c.jsx(Ua,{...O,style:{transformOrigin:P==="bottom"?"center top":"center bottom"},children:c.jsx(qa,{children:c.jsx(Wa,{onClickAway:j,children:c.jsx(mh,{autoFocusItem:a,onMouseEnter:m,onMouseLeave:j,children:t.map(_=>c.jsxs(ni,{onClick:()=>E(_),sx:{fontSize:14},children:[c.jsx(Vo,{sx:{mr:1,fontSize:16,visibility:S(_.value)?"visible":"hidden"}}),_.name]},_.value))})})})})})]})}const ph=Qt(fh)`
|
|
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 oa(){const{search:e,t}=dt(),{filters:r,handleSort:i,handlePrice:s}=e,n=Zs(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(Zr,{control:l.jsx(ei,{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(Jr,{value:r.sortBy||n[0].value,options:n,onChange:o=>i(o),placeholder:t("sort.sort")})]})}function gh({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}=pi();q.useEffect(()=>{m(!1)},[Object.values(h).join("")]);const E=th(a,o.showSearch,h.keyword);return o.showCategory&&!d?l.jsxs(hh,{children:[l.jsx(mi,{xs:l.jsxs(ut,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[l.jsx(ia,{onClick:()=>m(!1),children:l.jsx(qo,{})}),l.jsx(Ie,{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(te,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[l.jsxs(te,{display:"flex",alignItems:"center",gap:1,children:[l.jsx(Ft,{icon:Su,width:20,height:20}),l.jsx(Ie,{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(te,{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(Ie,{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(Ie,{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(oa,{})})]}):null}function gi(){const{endpoint:e,serverVersion:t,storeVersion:r}=dt(),i=ta(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 sa=q.memo(function(e){return l.jsx(te,{...e,sx:[{height:60,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(e.sx)?e.sx:[e.sx]],children:l.jsx(jt,{})})});function jo({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(Ie,{variant:"body2",title:i||(typeof t=="string"?t:void 0),sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const vh=16/9,Lr=292,Qr=189,Kn=336;function yh(){const{t:e,search:t}=dt(),{get:r}=gi(),i=qt(),s=Yt(i.breakpoints.down("md")),n=window.blocklet?.preferences?.homeBanner||[],{data:o=[],error:a,loading:d}=jn(async()=>{const S=await r(Qn(kt.blockletsPath,{didList:n.map(O=>O.did).join(",")}));return S?.dataList?n.map(O=>S.dataList.find(P=>P.did===O.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(Ie,{component:"h2",variant:"h2",sx:{mt:{xs:2,md:0},mb:3},children:e("explore.title")}),l.jsx(te,{sx:{height:{xs:"auto",md:Lr},minHeight:Lr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden"},children:d?l.jsxs(te,{sx:{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center"},children:[l.jsx(Xt,{variant:"rounded",height:Qr,width:Kn}),l.jsxs(te,{sx:{flex:1,height:"100%"},children:[l.jsx(Xt,{variant:"text",height:50,width:100}),l.jsx(Xt,{variant:"text",height:40,width:"100%"}),l.jsx(Xt,{variant:"text",height:40,width:300}),l.jsxs(te,{sx:{display:"flex",gap:1,my:2},children:[l.jsx(Xt,{variant:"circular",height:20,width:20}),l.jsx(Xt,{variant:"text",height:20,width:50})]}),l.jsx(Xt,{variant:"rounded",height:30,width:100})]})]}):l.jsx(Cd,{showNav:!0,autoPlay:!0,slideDuration:s?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:S=>l.jsx(te,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Ma,{sx:{...h,left:5}})}),renderRightNav:S=>l.jsx(te,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:l.jsx(Da,{sx:{...h,right:5}})}),items:n.map((S,O)=>({original:S.did,renderItem:()=>{const P=o[O]||{},_=S.cover||xh(S.did,P.screenshots?.[0]),D=ea(_,i.breakpoints.values.md*2);return l.jsxs(ut,{direction:{xs:"column",md:"row"},onClick:()=>t.handleSearchSelect(P),sx:{height:{xs:"auto",md:Lr},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(te,{sx:{flex:1},children:[f(S.name||P.title||S.name),j(S.desc||P.description)]}),P.did&&m(P,S.baseNum),E(P)]})]})}}))})})]}):null;function u(S){return l.jsx(te,{sx:{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Kn}},children:l.jsx(wh,{url:S})})}function f(S){return l.jsx(Ie,{variant:"h2",sx:{width:"100%"},children:S})}function j(S){return l.jsx(Ie,{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,O=0){const{did:P,owner:_,stats:D}=S;return l.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:2,color:"text.secondary"},children:[l.jsx(jo,{icon:l.jsx(zn,{src:_.avatar,did:P,size:20,variant:"circle"}),children:_.fullName}),l.jsx(jo,{icon:l.jsx(Ft,{icon:Cs}),title:`${D.downloads+O}`,children:bh(D.downloads+O)})]})}function E(S){return l.jsx(Tn,{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 bh=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`,xh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function wh({url:e}){const[t,r]=q.useState(!0);return l.jsxs(l.Fragment,{children:[t&&l.jsx(Xt,{variant:"rectangular",sx:{width:{xs:"100%",md:Kn},height:{xs:"auto",md:Qr}}}),l.jsx(te,{component:"img",src:e,alt:"",onLoad:()=>r(!1),onError:()=>r(!1),sx:{display:t?"none":"block",width:{xs:"100%",md:Kn},height:{xs:"auto",md:Qr},borderRadius:2,border:1,borderColor:"divider",objectFit:"container",cursor:"pointer",aspectRatio:vh}})]})}function Sh({title:e,blocklets:t}){const{blockletRender:r,serverVersion:i}=dt();return l.jsxs(te,{sx:{mt:3},children:[l.jsx(Ie,{component:"h3",variant:"h3",sx:{mb:2},children:e}),l.jsx(Ei,{container:!0,spacing:2,sx:{boxSizing:"border-box",maxWidth:"calc(100vw - 16px)"},children:t.map(s=>l.jsx(Ei,{"data-blocklet-did":s.did,sx:{p:"2px"},size:{xs:12,md:6},children:l.jsx(te,{sx:{padding:"1px"},children:r({blocklet:s,blocklets:t,serverVersion:i})})},s.did))})]})}function Eh(){const{get:e}=gi(),{t}=dt(),{data:r=[],error:i,loading:s}=jn(async()=>{const n=await e(kt.explorePath);return Array.isArray(n)?n:[]});return i?l.jsx(Jn,{error:new Error(`Failed to fetch blocklets from ${kt.explorePath}`)}):s?l.jsx(sa,{mt:15}):l.jsxs(l.Fragment,{children:[l.jsx(yh,{}),r.map(n=>n.blocklets?.length>0?l.jsx(Sh,{title:t(`explore.${n.type}`),blocklets:n.blocklets},n.type):null)]})}const _r="__FREE_TEXT__",Oo="__NO_RESULT__",Nr=40;function aa({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=gi(),[O,P]=q.useState(!1),_=o?.placeholder||t("common.searchStore"),D=async $=>{P(!0);const de=await S.get(nn(e,Qn(kt.blockletsPath,$)));return P(!1),de.dataList||[]},{data:c,run:w}=jn($=>$?D({sortBy:kt.nameDesc,page:1,pageSize:10,keyword:$,showResources:"true"}):Promise.resolve([]),{manual:!0});q.useEffect(()=>{P(!0),w(i.keyword),j(i.keyword||"")},[i.keyword,w]),Jd("ctrl + k, command + k",$=>($.stopPropagation(),$.preventDefault(),a.current?.querySelector("input")?.focus(),!1),{enableOnTags:["INPUT"]});const I=ns($=>w($),{wait:300}),B={name:_r,title:f,did:""};let M=[];return f&&(O?M=[B]:c?.length?M=[B,...c]:M=[{name:Oo,title:t("blocklet.noResults"),did:""}]),l.jsxs(l.Fragment,{children:[l.jsxs(Na,{fullScreen:!0,open:m,sx:{display:{md:"none"}},children:[l.jsxs(te,{sx:{p:2,pb:0,display:"flex",alignItems:"center",gap:2},children:[l.jsx(Wo,{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:_,className:"bl-autocomplete-input",value:f,onChange:$=>ne($.target.value),startAdornment:N(m),endAdornment:X()}),l.jsx(Tn,{variant:"outlined",onClick:()=>{E(!1),j(i.keyword||"")},children:t("common.cancel")})]}),l.jsx(zo,{sx:{p:.5},children:M.map($=>W($))})]}),l.jsx(te,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:l.jsx(Ft,{icon:sr,style:{fontSize:22,color:"inherit"},onClick:()=>E(!0)})}),l.jsx(Ao,{ref:a,open:!!f&&h,size:"small",onOpen:()=>u(!0),onClose:($,de)=>{u(!1),de==="selectOption"&&!d.current&&s(f)},onKeyDown:$=>{$.key==="Enter"&&!f&&Z()},disableClearable:!0,inputValue:f,onInputChange:($,de)=>ne(de),isOptionEqualToValue:($,de)=>$.name===de.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(Gn,{...$,InputProps:{...$.InputProps,autoFocus:!0,placeholder:_,className:"bl-autocomplete-input",value:f,startAdornment:N(h),endAdornment:X()}}),filterOptions:$=>$,...o,options:M,renderOption:($,de)=>W(de),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 ne($){P(!0),j($),d.current=!1,I.run($)}function Z(){E(!1),j(""),ne(""),s("")}function z($){$?.did?(E(!1),d.current=!0,j(""),n($)):$.name===_r&&(E(!1),s(f))}function W($){return l.jsxs(ti,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>z($),children:[H($),l.jsxs(Ie,{variant:"body1",children:[l.jsx(Ie,{sx:{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1},children:$.title}),l.jsx(Ie,{sx:{fontSize:"13px",color:"text.hint"},children:$.category?.locales?.[r||"en"]||""})]})]},$.did)}function H($){if([_r,Oo].includes($.name))return l.jsx(te,{sx:{width:Nr,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px"},children:l.jsx(Ft,{icon:sr,style:{fontSize:28}})});let de="";return $.logo&&(de=nn(e,"assets",$.did,ea($.logo,Nr,$.version))),l.jsx(zn,{src:de,size:Nr,style:{borderRadius:"8px",overflow:"hidden"}})}function N($=!0){return l.jsx(te,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:$&&f&&O?l.jsx(jt,{color:"inherit",size:16}):l.jsx(Ft,{icon:sr,style:{fontSize:16,cursor:"default"}})})}function X(){return f?l.jsx(te,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:l.jsx(Ft,{icon:Fd,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>Z()})}):null}}function kh({placeholder:e,...t}){const{search:r,t:i}=dt(),{filters:s,handleKeyword:n}=r,[o,a]=q.useState(s.keyword||""),d=ns(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(Th,{inputProps:{"data-cy":"search-blocklet"},startAdornment:l.jsx(Ti,{position:"start",children:l.jsx(jh,{sx:{fontSize:18,ml:-.5}})}),onChange:h,placeholder:f,value:o,title:f,"data-cy":"search",endAdornment:o&&l.jsx(Ti,{position:"end",children:l.jsx(Oh,{"data-cy":"search-delete",onClick:u})}),...t})}const Th=Qt(Wo)`
|
|
530
|
+
`;function oa(){const{search:e,t}=dt(),{filters:r,handleSort:i,handlePrice:s}=e,n=Zs(t);return c.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:[c.jsx(ei,{control:c.jsx(ti,{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")}),c.jsx(Qr,{value:r.sortBy||n[0].value,options:n,onChange:o=>i(o),placeholder:t("sort.sort")})]})}function gh({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}=mi();q.useEffect(()=>{m(!1)},[Object.values(h).join("")]);const E=th(a,o.showSearch,h.keyword);return o.showCategory&&!d?c.jsxs(hh,{children:[c.jsx(gi,{xs:c.jsxs(ut,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[c.jsx(ia,{onClick:()=>m(!1),children:c.jsx(qo,{})}),c.jsx(Ie,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:i("common.category")})]}),md:null}),c.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?c.jsxs(c.Fragment,{children:[o.showExplore&&c.jsxs(te,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[c.jsxs(te,{display:"flex",alignItems:"center",gap:1,children:[c.jsx(Ft,{icon:Su,width:20,height:20}),c.jsx(Ie,{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=>c.jsxs(te,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof S.icon=="string"?c.jsx(Ft,{icon:S.icon,width:20,height:20}):S.icon,c.jsx(Ie,{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&&c.jsx(ut,{gap:2,children:s.map(S=>c.jsx(Ie,{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))})]}):c.jsx(oa,{})})]}):null}function vi(){const{endpoint:e,serverVersion:t,storeVersion:r}=dt(),i=ta(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 sa=q.memo(function(e){return c.jsx(te,{...e,sx:[{height:60,display:"flex",alignItems:"center",justifyContent:"center"},...Array.isArray(e.sx)?e.sx:[e.sx]],children:c.jsx(jt,{})})});function Oo({icon:e=null,children:t=null,maxWidth:r=100,title:i=""}){return(t===0||t)&&c.jsxs(ut,{direction:"row",sx:{alignItems:"center",gap:1,maxWidth:r,overflow:"hidden"},children:[e,c.jsx(Ie,{variant:"body2",title:i||(typeof t=="string"?t:void 0),sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})]})}const vh=16/9,Lr=292,Zr=189,Kn=336;function yh(){const{t:e,search:t}=dt(),{get:r}=vi(),i=qt(),s=Yt(i.breakpoints.down("md")),n=window.blocklet?.preferences?.homeBanner||[],{data:o=[],error:a,loading:d}=jn(async()=>{const S=await r(Qn(kt.blockletsPath,{didList:n.map(O=>O.did).join(",")}));return S?.dataList?n.map(O=>S.dataList.find(P=>P.did===O.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?c.jsxs(c.Fragment,{children:[c.jsx(Ie,{component:"h2",variant:"h2",sx:{mt:{xs:2,md:0},mb:3},children:e("explore.title")}),c.jsx(te,{sx:{height:{xs:"auto",md:Lr},minHeight:Lr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden"},children:d?c.jsxs(te,{sx:{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center"},children:[c.jsx(Xt,{variant:"rounded",height:Zr,width:Kn}),c.jsxs(te,{sx:{flex:1,height:"100%"},children:[c.jsx(Xt,{variant:"text",height:50,width:100}),c.jsx(Xt,{variant:"text",height:40,width:"100%"}),c.jsx(Xt,{variant:"text",height:40,width:300}),c.jsxs(te,{sx:{display:"flex",gap:1,my:2},children:[c.jsx(Xt,{variant:"circular",height:20,width:20}),c.jsx(Xt,{variant:"text",height:20,width:50})]}),c.jsx(Xt,{variant:"rounded",height:30,width:100})]})]}):c.jsx(Cd,{showNav:!0,autoPlay:!0,slideDuration:s?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:S=>c.jsx(te,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:c.jsx(Ma,{sx:{...h,left:5}})}),renderRightNav:S=>c.jsx(te,{onClick:S,sx:{display:{xs:"none",md:"block"}},children:c.jsx(Da,{sx:{...h,right:5}})}),items:n.map((S,O)=>({original:S.did,renderItem:()=>{const P=o[O]||{},_=S.cover||xh(S.did,P.screenshots?.[0]),$=ea(_,i.breakpoints.values.md*2);return c.jsxs(ut,{direction:{xs:"column",md:"row"},onClick:()=>t.handleSearchSelect(P),sx:{height:{xs:"auto",md:Lr},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("${$}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},children:[u($),c.jsxs(ut,{sx:{flex:1,height:"100%",gap:3},children:[c.jsxs(te,{sx:{flex:1},children:[f(S.name||P.title||S.name),j(S.desc||P.description)]}),P.did&&m(P,S.baseNum),E(P)]})]})}}))})})]}):null;function u(S){return c.jsx(te,{sx:{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Kn}},children:c.jsx(wh,{url:S})})}function f(S){return c.jsx(Ie,{variant:"h2",sx:{width:"100%"},children:S})}function j(S){return c.jsx(Ie,{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,O=0){const{did:P,owner:_,stats:$}=S;return c.jsxs(te,{sx:{display:"flex",alignItems:"center",gap:2,color:"text.secondary"},children:[c.jsx(Oo,{icon:c.jsx(zn,{src:_.avatar,did:P,size:20,variant:"circle"}),children:_.fullName}),c.jsx(Oo,{icon:c.jsx(Ft,{icon:Cs}),title:`${$.downloads+O}`,children:bh($.downloads+O)})]})}function E(S){return c.jsx(Tn,{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 bh=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`,xh=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function wh({url:e}){const[t,r]=q.useState(!0);return c.jsxs(c.Fragment,{children:[t&&c.jsx(Xt,{variant:"rectangular",sx:{width:{xs:"100%",md:Kn},height:{xs:"auto",md:Zr}}}),c.jsx(te,{component:"img",src:e,alt:"",onLoad:()=>r(!1),onError:()=>r(!1),sx:{display:t?"none":"block",width:{xs:"100%",md:Kn},height:{xs:"auto",md:Zr},borderRadius:2,border:1,borderColor:"divider",objectFit:"container",cursor:"pointer",aspectRatio:vh}})]})}function Sh({title:e,blocklets:t}){const{blockletRender:r,serverVersion:i}=dt();return c.jsxs(te,{sx:{mt:3},children:[c.jsx(Ie,{component:"h3",variant:"h3",sx:{mb:2},children:e}),c.jsx(ki,{container:!0,spacing:2,sx:{boxSizing:"border-box",maxWidth:"calc(100vw - 16px)"},children:t.map(s=>c.jsx(ki,{"data-blocklet-did":s.did,sx:{p:"2px"},size:{xs:12,md:6},children:c.jsx(te,{sx:{padding:"1px"},children:r({blocklet:s,blocklets:t,serverVersion:i})})},s.did))})]})}function Eh(){const{get:e}=vi(),{t}=dt(),{data:r=[],error:i,loading:s}=jn(async()=>{const n=await e(kt.explorePath);return Array.isArray(n)?n:[]});return i?c.jsx(Jn,{error:new Error(`Failed to fetch blocklets from ${kt.explorePath}`)}):s?c.jsx(sa,{mt:15}):c.jsxs(c.Fragment,{children:[c.jsx(yh,{}),r.map(n=>n.blocklets?.length>0?c.jsx(Sh,{title:t(`explore.${n.type}`),blocklets:n.blocklets},n.type):null)]})}const _r="__FREE_TEXT__",Co="__NO_RESULT__",Nr=40;function aa({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=vi(),[O,P]=q.useState(!1),_=o?.placeholder||t("common.searchStore"),$=async F=>{P(!0);const de=await S.get(nn(e,Qn(kt.blockletsPath,F)));return P(!1),de.dataList||[]},{data:l,run:w}=jn(F=>F?$({sortBy:kt.nameDesc,page:1,pageSize:10,keyword:F,showResources:"true"}):Promise.resolve([]),{manual:!0});q.useEffect(()=>{P(!0),w(i.keyword),j(i.keyword||"")},[i.keyword,w]),Jd("ctrl + k, command + k",F=>(F.stopPropagation(),F.preventDefault(),a.current?.querySelector("input")?.focus(),!1),{enableOnTags:["INPUT"]});const I=ns(F=>w(F),{wait:300}),M={name:_r,title:f,did:""};let D=[];return f&&(O?D=[M]:l?.length?D=[M,...l]:D=[{name:Co,title:t("blocklet.noResults"),did:""}]),c.jsxs(c.Fragment,{children:[c.jsxs(Na,{fullScreen:!0,open:m,sx:{display:{md:"none"}},children:[c.jsxs(te,{sx:{p:2,pb:0,display:"flex",alignItems:"center",gap:2},children:[c.jsx(Wo,{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:_,className:"bl-autocomplete-input",value:f,onChange:F=>ne(F.target.value),startAdornment:N(m),endAdornment:X()}),c.jsx(Tn,{variant:"outlined",onClick:()=>{E(!1),j(i.keyword||"")},children:t("common.cancel")})]}),c.jsx(zo,{sx:{p:.5},children:D.map(F=>W(F))})]}),c.jsx(te,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:c.jsx(Ft,{icon:sr,style:{fontSize:22,color:"inherit"},onClick:()=>E(!0)})}),c.jsx(Ao,{ref:a,open:!!f&&h,size:"small",onOpen:()=>u(!0),onClose:(F,de)=>{u(!1),de==="selectOption"&&!d.current&&s(f)},onKeyDown:F=>{F.key==="Enter"&&!f&&Z()},disableClearable:!0,inputValue:f,onInputChange:(F,de)=>ne(de),isOptionEqualToValue:(F,de)=>F.name===de.name,getOptionLabel:F=>F.title,getOptionKey:F=>F.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:F=>c.jsx(Gn,{...F,InputProps:{...F.InputProps,autoFocus:!0,placeholder:_,className:"bl-autocomplete-input",value:f,startAdornment:N(h),endAdornment:X()}}),filterOptions:F=>F,...o,options:D,renderOption:(F,de)=>W(de),value:M,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 ne(F){P(!0),j(F),d.current=!1,I.run(F)}function Z(){E(!1),j(""),ne(""),s("")}function z(F){F?.did?(E(!1),d.current=!0,j(""),n(F)):F.name===_r&&(E(!1),s(f))}function W(F){return c.jsxs(ni,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>z(F),children:[H(F),c.jsxs(Ie,{variant:"body1",children:[c.jsx(Ie,{sx:{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1},children:F.title}),c.jsx(Ie,{sx:{fontSize:"13px",color:"text.hint"},children:F.category?.locales?.[r||"en"]||""})]})]},F.did)}function H(F){if([_r,Co].includes(F.name))return c.jsx(te,{sx:{width:Nr,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px"},children:c.jsx(Ft,{icon:sr,style:{fontSize:28}})});let de="";return F.logo&&(de=nn(e,"assets",F.did,ea(F.logo,Nr,F.version))),c.jsx(zn,{src:de,size:Nr,style:{borderRadius:"8px",overflow:"hidden"}})}function N(F=!0){return c.jsx(te,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:F&&f&&O?c.jsx(jt,{color:"inherit",size:16}):c.jsx(Ft,{icon:sr,style:{fontSize:16,cursor:"default"}})})}function X(){return f?c.jsx(te,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:c.jsx(Ft,{icon:Fd,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>Z()})}):null}}function kh({placeholder:e,...t}){const{search:r,t:i}=dt(),{filters:s,handleKeyword:n}=r,[o,a]=q.useState(s.keyword||""),d=ns(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 c.jsx(Th,{inputProps:{"data-cy":"search-blocklet"},startAdornment:c.jsx(ji,{position:"start",children:c.jsx(jh,{sx:{fontSize:18,ml:-.5}})}),onChange:h,placeholder:f,value:o,title:f,"data-cy":"search",endAdornment:o&&c.jsx(ji,{position:"end",children:c.jsx(Oh,{"data-cy":"search-delete",onClick:u})}),...t})}const Th=Qt(Wo)`
|
|
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 Ch(){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:O,handleCategory:P}=e,_=Zs(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(Ie,{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(te,{sx:{flex:1,flexBasis:{xs:"100%",md:"auto"}},children:d?l.jsx(kh,{}):l.jsx(aa,{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(ki,{label:t("blocklet.authorTag",{name:n}),size:"small",onDelete:()=>E("")}),f.resourceDid&&f.resourceBlocklet&&l.jsx(ki,{label:t("blocklet.resourceTag",{name:f.resourceBlocklet}),size:"small",onDelete:()=>O(["resourceDid","resourceBlocklet","showResources"])}),o?l.jsx(Co,{checked:f.showResources!=="false",onChange:D=>S(D?"true":"false"),label:t("common.showResources")}):null,l.jsx(Co,{checked:f.price==="free",onChange:D=>m(D?"free":""),label:t("blocklet.free")}),u&&l.jsx(te,{children:l.jsx(Jr,{value:f.category||h[0]?.value,options:h,placeholder:t("common.category"),onChange:D=>P(D)})}),l.jsx(Jr,{value:f.sortBy||_[0].value,options:_,placeholder:t("sort.sort"),onChange:D=>j(D)})]})]})}function Co({checked:e,onChange:t,label:r}){const i=qt();return l.jsx(Zr,{sx:{m:0,p:0},className:"check-button",control:l.jsx(ei,{checked:e,icon:l.jsx(Ft,{style:{padding:0,color:i.palette.text.secondary},icon:Md}),checkedIcon:l.jsx(Ft,{style:{padding:0,color:i.palette.primary.main},icon:Bd}),size:"large",sx:{p:0,mr:1},onChange:s=>t(s.target.checked)}),label:r})}function Fn({children:e}){return l.jsxs(te,{sx:{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint"},children:[l.jsx(rl,{}),e]})}function Io(){const{t:e}=dt();return l.jsx(Ie,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Ar({filterTip:e=!1,keywordTip:t=!1}){const{t:r,locale:i}=dt(),s=()=>i==="zh"?"、":" , ";return l.jsxs(te,{sx:{mt:1,display:"flex"},children:[l.jsx(Ie,{style:{marginRight:"16px"},children:r("blocklet.emptyTip")}),e&&l.jsx(Ie,{children:r("blocklet.filterTip")}),e&&t&&s(),t&&l.jsx(Ie,{children:r("blocklet.keywordTip")})]})}function Dr({primaryStart:e,primaryEnd:t,filter:r}){return l.jsxs(Ie,{variant:"subtitle2",sx:{display:"flex",gap:.5,mx:.5},children:[l.jsx(Ie,{children:e}),l.jsx(Ie,{title:r,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r}),l.jsxs(Ie,{children:[t," "]})]})}function Ih(){const{t:e,search:t,getCategoryLocale:r,selectedCategory:i}=dt(),{filters:s}=t,n=!!i||!!s.price;if(s.keyword&&n)return l.jsxs(Fn,{children:[l.jsx(Dr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Ar,{keywordTip:!0,filterTip:!0})]});if(s.keyword)return l.jsxs(Fn,{children:[l.jsx(Dr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),l.jsx(Ar,{keywordTip:!0})]});if(n){const o=r(i);return l.jsxs(Fn,{children:[o?l.jsx(Dr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:o}):l.jsx(Io,{}),l.jsx(Ar,{filterTip:!0})]})}return l.jsx(Fn,{children:l.jsx(Io,{})})}const Rh=(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:kt[t.sortBy],page:n,pageSize:o};i(null);const{data:d={}}=await e.get(kt.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 Ph(){const{storeApi:e,search:t,extraFilter:r,errors:i,updateDeveloperName:s}=dt(),{filters:n}=t,o=Yl({currentPage:kt.currentPage,pageSize:sh()?kt.mobilePageSize:kt.pageSize,defaultCurrentPage:kt.defaultCurrentPage}),[a,d]=q.useState(null),h=Rh(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 Lh(){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}=Ph(),[O]=Dd({loading:m.fetchBlockletsLoading||m.loadingMore,hasNextPage:E,onLoadMore:j});if(f.fetchBlockletsError){const c=new Error(`Failed to fetch blocklets from ${r}: ${ih(f.fetchBlockletsError)}`);return l.jsx(Jn,{error:c})}const P=a&&o.showSearch||!h.keyword;return l.jsxs(l.Fragment,{children:[P?l.jsx(Ch,{}):l.jsxs(l.Fragment,{children:[l.jsx(mi,{xs:l.jsx(oa,{}),md:null}),D()]}),_(),!m.fetchBlockletsLoading&&E&&l.jsx(te,{ref:O,sx:{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden"},children:m.loadingMore?l.jsx(jt,{}):null})]});function _(){return m.fetchBlockletsLoading?l.jsx(sa,{mt:15}):u.length?l.jsx(te,{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(te,{"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(Ih,{})}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(Ie,{variant:"h3",title:h.keyword,sx:{maxWidth:"50vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:h.keyword})}),l.jsx(Ie,{variant:"body1",sx:{color:"text.hint",fontSize:13},children:e("blocklet.resultCount",{count:S})})]})}}function _h(){const{t:e,selectedCategory:t,getCategoryLocale:r,locale:i,search:s}=dt(),{toggleOpen:n}=pi(),o=nl().arcSphere,a=!!window.blocklet?.navigation?.some(d=>d.section==="bottomNavigation");return l.jsxs(te,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs(Ie,{variant:"body1",sx:{display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium"},children:[l.jsx(ia,{onClick:()=>n(!0),children:l.jsx(_a,{})}),r(t)||e("common.category")]}),o&&a&&l.jsx(aa,{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 Nh({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(Qd,{children:l.jsxs(Xo,{FallbackComponent:Jn,children:[!s&&l.jsx(_h,{}),l.jsxs(te,{ref:o,className:"list-container",sx:{display:"flex",height:"100%",pt:{xs:0,md:s?0:5}},children:[l.jsx(gh,{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(Eh,{}):l.jsx(Lh,{}))]})]})]})})}function Ah(e){const{menus:t,children:r,...i}=e,s=qt(),n=$o(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(Uo,{theme:n,children:l.jsx(dh,{...i,children:l.jsx(Nh,{menus:t,children:r})})})}const Dh={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"/>'},Mh={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>'},Bh={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>'},Fh={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"/>'},$h=(e,t)=>!t||!e?!0:Br.satisfies(Br.coerce(e),t);function la({children:e,serverVersion:t="",requirementVersion:r="",...i}){const{t:s}=St();return $h(t,r)?e:l.jsx(Fo,{title:s("store.tooltip.upgradeServer",{serverVersion:t,version:r}),arrow:!0,children:l.jsx(Ie,{children:l.jsx(Tn,{disabled:!0,variant:"outlined",...i,children:s("common.upgradeServer")})})})}la.propTypes={children:F.node.isRequired,serverVersion:F.string,requirementVersion:F.string};const Uh=(e,t)=>nn(t,`/blocklets/${e.did}`),Ro=({blocklet:e,attribute:t,value:r})=>e._formatted?e._formatted[t]:r,qh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1;function ca({blocklet:e,blocklets:t=[],handleButtonClick:r=null,endpoint:i="",serverVersion:s=""}){const{t:n}=St();let o=nn(i,bl(e.did,e.logo||""));try{const O=new URL(o);O.searchParams.set("v",e.version||+new Date),o=O.href}catch{}const[a,d]=q.useState(!1),h=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:t})}catch(O){Xn.error(O.message)}finally{d(!1)}},{blocklet:u}=Yn(),f=()=>(u?.children||[]).find(_=>_.meta.bundleDid===e.did).meta.version,m=(()=>{const O=(u?.children||[]).find(P=>P.meta.bundleDid===e.did);if(O){try{const P=O.meta.version,_=e.version;if(Br.gt(_,P))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),E=e.requirements?.server,S=[];return m==="upgrade"?S.push({key:"upgrade",icon:l.jsx(xt,{icon:Fh,color:"success.light",width:20,height:20},"version"),title:`${f()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:l.jsx(te,{sx:{fontWeight:"bold"},children:n("blocklet.component.upgradeAvailable")})}):m==="disable"?S.push({key:"disable",icon:l.jsx(xt,{icon:Dh,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:n("blocklet.component.installed")}):qh(e)&&S.push({key:"purchase",icon:l.jsx(xt,{icon:Mh,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:n("blocklet.component.needBuy")}),l.jsx(Wh,{title:Ro({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Ro({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(te,{sx:{display:"flex",color:"primary.main"},children:l.jsx(xt,{icon:Bh})}),title:n("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:n("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:S,button:l.jsx(la,{serverVersion:s,requirementVersion:E,size:"small",children:l.jsx("div",{style:{display:"flex",alignItems:"center"},children:l.jsx(bu,{children:l.jsx(bt,{size:"small",disabled:a,variant:"outlined",color:"primary",onClick:O=>{O.preventDefault(),O.stopPropagation();const P=Uh(e,i);P&&window.open(P,"_blank","noopener,noreferrer")},children:n("common.detail")},e.did)})})})})}ca.propTypes={blocklet:F.object.isRequired,blocklets:F.array,handleButtonClick:F.func,endpoint:F.string,serverVersion:F.string};function ua({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}=St(),[E,S]=q.useState(!1),[O,P]=q.useState({}),_=w=>{P(w)},D=r,c=q.useMemo(()=>$o(j,{palette:{background:{default:j.palette.background.paper}}}),[j]);return q.useEffect(()=>{P({showResources:!0,resourceType:o,resourceDid:a})},[D,o,a]),q.useEffect(()=>{S(!0),P({showResources:!0,resourceType:o,resourceDid:a})},[]),l.jsx(Uo,{theme:c,children:l.jsx(Xo,{FallbackComponent:Jn,resetKeys:[D],children:l.jsxs(te,{...f,sx:Ho({overflow:"auto",".title-bar + div":{height:"unset"}},f.sx),children:[E&&l.jsx(Ah,{showCategory:h,showResourcesSwitch:d,blockletRender:w=>{const I={...w,handleButtonClick:e,endpoint:D};return i({...w,defaultRender:l.jsx(ca,{...I})})},compact:u,minItemWidth:300,baseSearch:!0,endpoint:D,locale:m,onFilterChange:_,onSearchSelect:t,filters:O,extraFilter:s,serverVersion:n,fetchCategoryDelay:500}),l.jsx(te,{sx:{mt:2},children:" "})]})})})}ua.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 Wh=ot(wu)`
|
|
553
|
+
`;function Ch(){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:O,handleCategory:P,handleSwitchIsOfficial:_}=e,$=Zs(t);return c.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&&c.jsx(Ie,{variant:"h2",sx:{textTransform:"capitalize"},children:s(f.category)}),c.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?c.jsx(te,{sx:{flex:1,flexBasis:{xs:"100%",md:"auto"}},children:d?c.jsx(kh,{}):c.jsx(aa,{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&&c.jsx(Ti,{label:t("blocklet.authorTag",{name:n}),size:"small",onDelete:()=>E("")}),f.resourceDid&&f.resourceBlocklet&&c.jsx(Ti,{label:t("blocklet.resourceTag",{name:f.resourceBlocklet}),size:"small",onDelete:()=>O(["resourceDid","resourceBlocklet","showResources"])}),c.jsx(Ar,{checked:f.isOfficial==="true",onChange:l=>_(l?"true":"false"),label:t("common.official")}),o?c.jsx(Ar,{checked:f.showResources!=="false",onChange:l=>S(l?"true":"false"),label:t("common.showResources")}):null,c.jsx(Ar,{checked:f.price==="free",onChange:l=>m(l?"free":""),label:t("blocklet.free")}),u&&c.jsx(te,{children:c.jsx(Qr,{value:f.category||h[0]?.value,options:h,placeholder:t("common.category"),onChange:l=>P(l)})}),c.jsx(Qr,{value:f.sortBy||$[0].value,options:$,placeholder:t("sort.sort"),onChange:l=>j(l)})]})]})}function Ar({checked:e,onChange:t,label:r}){const i=qt();return c.jsx(ei,{sx:{m:0,p:0},className:"check-button",control:c.jsx(ti,{checked:e,icon:c.jsx(Ft,{style:{padding:0,color:i.palette.text.secondary},icon:Md}),checkedIcon:c.jsx(Ft,{style:{padding:0,color:i.palette.primary.main},icon:Bd}),size:"large",sx:{p:0,mr:1},onChange:s=>t(s.target.checked)}),label:r})}function Fn({children:e}){return c.jsxs(te,{sx:{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint"},children:[c.jsx(rl,{}),e]})}function Io(){const{t:e}=dt();return c.jsx(Ie,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Dr({filterTip:e=!1,keywordTip:t=!1}){const{t:r,locale:i}=dt(),s=()=>i==="zh"?"、":" , ";return c.jsxs(te,{sx:{mt:1,display:"flex"},children:[c.jsx(Ie,{style:{marginRight:"16px"},children:r("blocklet.emptyTip")}),e&&c.jsx(Ie,{children:r("blocklet.filterTip")}),e&&t&&s(),t&&c.jsx(Ie,{children:r("blocklet.keywordTip")})]})}function Mr({primaryStart:e,primaryEnd:t,filter:r}){return c.jsxs(Ie,{variant:"subtitle2",sx:{display:"flex",gap:.5,mx:.5},children:[c.jsx(Ie,{children:e}),c.jsx(Ie,{title:r,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r}),c.jsxs(Ie,{children:[t," "]})]})}function Ih(){const{t:e,search:t,getCategoryLocale:r,selectedCategory:i}=dt(),{filters:s}=t,n=!!i||!!s.price;if(s.keyword&&n)return c.jsxs(Fn,{children:[c.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),c.jsx(Dr,{keywordTip:!0,filterTip:!0})]});if(s.keyword)return c.jsxs(Fn,{children:[c.jsx(Mr,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:s.keyword}),c.jsx(Dr,{keywordTip:!0})]});if(n){const o=r(i);return c.jsxs(Fn,{children:[o?c.jsx(Mr,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:o}):c.jsx(Io,{}),c.jsx(Dr,{filterTip:!0})]})}return c.jsx(Fn,{children:c.jsx(Io,{})})}const Rh=(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:kt[t.sortBy],page:n,pageSize:o};i(null);const{data:d={}}=await e.get(kt.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 Ph(){const{storeApi:e,search:t,extraFilter:r,errors:i,updateDeveloperName:s}=dt(),{filters:n}=t,o=Yl({currentPage:kt.currentPage,pageSize:sh()?kt.mobilePageSize:kt.pageSize,defaultCurrentPage:kt.defaultCurrentPage}),[a,d]=q.useState(null),h=Rh(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 Lh(){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}=Ph(),[O]=Dd({loading:m.fetchBlockletsLoading||m.loadingMore,hasNextPage:E,onLoadMore:j});if(f.fetchBlockletsError){const l=new Error(`Failed to fetch blocklets from ${r}: ${ih(f.fetchBlockletsError)}`);return c.jsx(Jn,{error:l})}const P=a&&o.showSearch||!h.keyword;return c.jsxs(c.Fragment,{children:[P?c.jsx(Ch,{}):c.jsxs(c.Fragment,{children:[c.jsx(gi,{xs:c.jsx(oa,{}),md:null}),$()]}),_(),!m.fetchBlockletsLoading&&E&&c.jsx(te,{ref:O,sx:{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden"},children:m.loadingMore?c.jsx(jt,{}):null})]});function _(){return m.fetchBlockletsLoading?c.jsx(sa,{mt:15}):u.length?c.jsx(te,{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(l=>c.jsx(te,{"data-blocklet-did":l.did,sx:{minWidth:{xs:"100%",sm:n},maxWidth:"calc(100vw - 32px)"},children:i({blocklet:l,blocklets:u,serverVersion:s})},l.did))}):c.jsx(Ih,{})}function $(){return c.jsxs(ut,{direction:"row",className:"search-result-title",sx:{alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0}},children:[c.jsx(Ie,{variant:"h3",title:h.keyword,sx:{maxWidth:"50vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:h.keyword})}),c.jsx(Ie,{variant:"body1",sx:{color:"text.hint",fontSize:13},children:e("blocklet.resultCount",{count:S})})]})}}function _h(){const{t:e,selectedCategory:t,getCategoryLocale:r,locale:i,search:s}=dt(),{toggleOpen:n}=mi(),o=nl().arcSphere,a=!!window.blocklet?.navigation?.some(d=>d.section==="bottomNavigation");return c.jsxs(te,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[c.jsxs(Ie,{variant:"body1",sx:{display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium"},children:[c.jsx(ia,{onClick:()=>n(!0),children:c.jsx(_a,{})}),r(t)||e("common.category")]}),o&&a&&c.jsx(aa,{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 Nh({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 c.jsx(Qd,{children:c.jsxs(Xo,{FallbackComponent:Jn,children:[!s&&c.jsx(_h,{}),c.jsxs(te,{ref:o,className:"list-container",sx:{display:"flex",height:"100%",pt:{xs:0,md:s?0:5}},children:[c.jsx(gh,{menus:e}),c.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?c.jsx(Eh,{}):c.jsx(Lh,{}))]})]})]})})}function Ah(e){const{menus:t,children:r,...i}=e,s=qt(),n=$o(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 c.jsx(Uo,{theme:n,children:c.jsx(dh,{...i,children:c.jsx(Nh,{menus:t,children:r})})})}const Dh={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"/>'},Mh={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>'},Bh={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>'},Fh={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"/>'},$h=(e,t)=>!t||!e?!0:Fr.satisfies(Fr.coerce(e),t);function la({children:e,serverVersion:t="",requirementVersion:r="",...i}){const{t:s}=St();return $h(t,r)?e:c.jsx(Fo,{title:s("store.tooltip.upgradeServer",{serverVersion:t,version:r}),arrow:!0,children:c.jsx(Ie,{children:c.jsx(Tn,{disabled:!0,variant:"outlined",...i,children:s("common.upgradeServer")})})})}la.propTypes={children:B.node.isRequired,serverVersion:B.string,requirementVersion:B.string};const Uh=(e,t)=>nn(t,`/blocklets/${e.did}`),Ro=({blocklet:e,attribute:t,value:r})=>e._formatted?e._formatted[t]:r,qh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1;function ca({blocklet:e,blocklets:t=[],handleButtonClick:r=null,endpoint:i="",serverVersion:s=""}){const{t:n}=St();let o=nn(i,bl(e.did,e.logo||""));try{const O=new URL(o);O.searchParams.set("v",e.version||+new Date),o=O.href}catch{}const[a,d]=q.useState(!1),h=async()=>{try{d(!0),await r({meta:e,registryUrl:i,blocklets:t})}catch(O){Xn.error(O.message)}finally{d(!1)}},{blocklet:u}=Yn(),f=()=>(u?.children||[]).find(_=>_.meta.bundleDid===e.did).meta.version,m=(()=>{const O=(u?.children||[]).find(P=>P.meta.bundleDid===e.did);if(O){try{const P=O.meta.version,_=e.version;if(Fr.gt(_,P))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),E=e.requirements?.server,S=[];return m==="upgrade"?S.push({key:"upgrade",icon:c.jsx(xt,{icon:Fh,color:"success.light",width:20,height:20},"version"),title:`${f()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:c.jsx(te,{sx:{fontWeight:"bold"},children:n("blocklet.component.upgradeAvailable")})}):m==="disable"?S.push({key:"disable",icon:c.jsx(xt,{icon:Dh,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:n("blocklet.component.installed")}):qh(e)&&S.push({key:"purchase",icon:c.jsx(xt,{icon:Mh,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:n("blocklet.component.needBuy")}),c.jsx(Wh,{title:Ro({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Ro({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:c.jsx(te,{sx:{display:"flex",color:"primary.main"},children:c.jsx(xt,{icon:Bh})}),title:n("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:n("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:S,button:c.jsx(la,{serverVersion:s,requirementVersion:E,size:"small",children:c.jsx("div",{style:{display:"flex",alignItems:"center"},children:c.jsx(bu,{children:c.jsx(bt,{size:"small",disabled:a,variant:"outlined",color:"primary",onClick:O=>{O.preventDefault(),O.stopPropagation();const P=Uh(e,i);P&&window.open(P,"_blank","noopener,noreferrer")},children:n("common.detail")},e.did)})})})})}ca.propTypes={blocklet:B.object.isRequired,blocklets:B.array,handleButtonClick:B.func,endpoint:B.string,serverVersion:B.string};function ua({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}=St(),[E,S]=q.useState(!1),[O,P]=q.useState({}),_=w=>{P(w)},$=r,l=q.useMemo(()=>$o(j,{palette:{background:{default:j.palette.background.paper}}}),[j]);return q.useEffect(()=>{P({showResources:!0,resourceType:o,resourceDid:a})},[$,o,a]),q.useEffect(()=>{S(!0),P({showResources:!0,resourceType:o,resourceDid:a})},[]),c.jsx(Uo,{theme:l,children:c.jsx(Xo,{FallbackComponent:Jn,resetKeys:[$],children:c.jsxs(te,{...f,sx:Ho({overflow:"auto",".title-bar + div":{height:"unset"}},f.sx),children:[E&&c.jsx(Ah,{showCategory:h,showResourcesSwitch:d,blockletRender:w=>{const I={...w,handleButtonClick:e,endpoint:$};return i({...w,defaultRender:c.jsx(ca,{...I})})},compact:u,minItemWidth:300,baseSearch:!0,endpoint:$,locale:m,onFilterChange:_,onSearchSelect:t,filters:O,extraFilter:s,serverVersion:n,fetchCategoryDelay:500}),c.jsx(te,{sx:{mt:2},children:" "})]})})})}ua.propTypes={storeUrl:B.string.isRequired,handleButtonClick:B.func,handleSearchSelect:B.func,handleBlockletRender:B.func,extraFilter:B.func,serverVersion:B.string,resourceType:B.string,resourceDid:B.string,showResourcesSwitch:B.bool,showCategory:B.bool,compact:B.bool};const Wh=ot(wu)`
|
|
554
554
|
.ms-highlight {
|
|
555
555
|
color: ${e=>e.theme.palette.primary.main};
|
|
556
556
|
}
|
|
557
|
-
`;function da({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}=St(),f=n[o];return q.useEffect(()=>{i(o)},[i,o]),q.useImperativeHandle(e,()=>({setActiveStepByKey:a,setActiveStepByIndex:d})),
|
|
557
|
+
`;function da({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}=St(),f=n[o];return q.useEffect(()=>{i(o)},[i,o]),q.useImperativeHandle(e,()=>({setActiveStepByKey:a,setActiveStepByIndex:d})),c.jsx(Vh,{component:"div",className:r?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:c.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:c.jsx(zh,{children:typeof f?.body=="function"?f.body():f?.body})})})}da.propTypes={ref:B.any,meta:B.any,onStepChange:B.func.isRequired,isMobile:B.bool.isRequired};const Po=e=>e.isMobile?`
|
|
558
558
|
height: calc(100vh - 56px - 64px - 48px);
|
|
559
559
|
`:"",zh=ot.div`
|
|
560
560
|
width: 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,Gh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1,Hh=e=>[Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Mr=e=>e?.configs?.find(t=>t.key===Bt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,Xh=e=>(e.environments||[]).some(t=>t.required),Lo=(e,t)=>e?.some(r=>r.required&&!t[r.key]),Yh=({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")},_o=({componentDid:e,timeout:t=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},t)};function Jh({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}=St(),[O,P]=q.useState(!1),[_,D]=q.useState(null),[c,w]=q.useState(""),[I,B]=q.useState(""),{api:M,ws:{useSubscription:ne},inService:Z,info:z}=un(),{blocklet:W,actions:{refreshBlocklet:H}}=Yn(),[N,X]=q.useState(null),[$,de]=q.useState(!1),Le={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:""},[V,ke]=q.useState(Le),[ce,$e]=q.useState(0),ve=q.useRef({}),Ne=q.useRef({}),_e=q.useRef({}),Ge=Yt(se=>se.breakpoints.down("md")),tt=Ja(),[pt,mt]=q.useState(!0),{meta:xe}=ve.current,he=os(xe),ge=q.useRef(!1),We=q.useRef(null),Ue=se=>ke(me=>({...me,...se}));q.useEffect(()=>{if(V.pathPrefix){const{errMsg:se}=st({...V,pathPrefix:V.pathPrefix,locale:S});w(se)}},[V.pathPrefix]),q.useEffect(()=>{ce===0&&ke(Le)},[ce]);const Ot=()=>{const se=Mr(W)??"";Ue({didSpaceEndpoint:se})},Be=()=>ve?.current?.meta?$t.getDisplayName(ve.current):"",Ct=()=>{P(!1),ke({}),ge.current=!1,ve.current={},e()},It=se=>{const me=Ce=>{Ue({installResultProps:{variant:"error",title:Be(),subTitle:se,footer:l.jsx(bt,{className:"bottom-button",disabled:Ce,"data-cy":"retry-install-component",onClick:async()=>{me(!0),await lt(ve.current.installInput)},children:l.jsxs(te,{sx:{display:"flex",alignItems:"center"},children:[Ce&&l.jsx(jt,{size:16,style:{marginRight:8}}),E("common.retry")]})})}})};me()},Et=se=>me=>{(me?.meta?.did||me?.meta)===W?.meta?.did&&se(me)},Rt=()=>{_o({timeout:0,componentDid:tt.componentDid,manual:!0}),Ct(),setTimeout(()=>{const se=document.getElementsByClassName("dashboard-main")[0];se&&(se.scrollTop=se.scrollHeight)},200)};ne(Bt.BlockletEvents.componentInstalled,Et(()=>{Ue({installResultProps:{variant:"success",title:Be(),subTitle:E("blocklet.component.installSuccessTip")}}),_o({componentDid:tt.componentDid})}),[W?.meta?.did]),ne(Bt.BlockletEvents.statusChange,Et(()=>{const se=Mr(W);Ue(me=>({...me,didSpaceEndpoint:se}))}),[W?.meta?.did]),ne(Bt.BlockletEvents.downloadFailed,Et(()=>{ge.current=!1,It(E("blocklet.component.installComponentError"))}),[W?.meta?.did]),ne(Bt.BlockletEvents.installFailed,Et(()=>{ge.current=!1,It(E("blocklet.component.installComponentError"))}),[W?.meta?.did]);const Ye=[],At=se=>(W?.children||[]).find(me=>me.meta.did===se),lt=async se=>{ge.current=!0;const{pathPrefix:me,bundleDid:Ce,title:p,componentName:x="",componentDid:k=""}=V,L=ve.current?.meta||{},{configs:U=[],registryUrl:ee,inStore:re,inputUrl:Ee,dist:we}=L,nt=ve.current?.downloadTokenList,et=Ee||(re?Ci(ee,Ce,we):"");P(!0);const Ae={rootDid:W.meta.did,url:et,mountPoint:me?Rn(me):`/${Rn(L.title||L.name)}`,title:p,name:x,did:V.isUpload&&V.upgradeDid?V.upgradeDid:k,dist:{tarball:"",integrity:""},onlyRequired:!pt,...V.hasEnvironmentsStep&&U.length>0?{configs:U.map(Fe=>({...Fe,value:V.configsValue[Fe.key]||""}))}:{},...nt?{downloadTokenList:nt}:{},...se};try{if(await M.installComponent({input:Ae}),ee){const{teamDid:Fe,storeList:Ze}=Qo({fromBlocklet:Z,nodeInfo:z,blocklet:W}),{isNew:Dt,decoded:on}=Sl(ee,Ze);Dt&&await M.addBlockletStore({input:{teamDid:Fe,url:on}})}Ue({installResultProps:{}}),H({showError:!1,attachRuntimeInfo:!1})}catch(Fe){const Ze=$r(Fe);Xn.error(Ze),console.error("installComponent error: ",Fe),It(Ze)}finally{P(!1),ve.current.installInput=Ae}},st=se=>{const me=ic({params:{...se,did:se.bundleDid},blocklets:[W],blocklet:W,locale:S,isUpload:V.isUpload});let Ce=me;const p=Kh(W,V.pathPrefix);if(me==="overwrite"&&p&&p.did!==se.bundleDid?(Ue({upgradeDid:p.did}),Ce=""):(Ue({upgradeDid:""}),Ce=me),Ce){const x=At(se.bundleDid),k=oc({params:{...se,did:se.bundleDid},blocklet:W});if(x&&x.mountPoint===k)return{errMsg:""}}return{errMsg:Ce}},ze=async se=>{const{errMsg:me}=st({...V,locale:S});w(me),ce===Ye.length-2&&!ge.current&&await lt(se),Ne.current?.setActiveStepByIndex?.(Ce=>Ce+1)},He=()=>{Ne.current?.setActiveStepByIndex?.(se=>se-1)},gt=()=>{const{pathPrefix:se,bundleDid:me,title:Ce,componentName:p="",componentDid:x=""}=V,{meta:k={}}=ve.current||{},{registryUrl:L,inStore:U,inputUrl:ee,dist:re}=k,Ee=U?Ci(L,me,re):ee;X({meta:k,installOpts:{type:"component",rootDid:W.meta.did,mountPoint:se,url:Ee,title:Ce,name:p,did:x}})},K=se=>{de(!1),Ue({purchaseResultProps:{variant:"error",title:Be(),subTitle:se,style:{paddingTop:120},footer:l.jsx(bt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Ue({purchaseResultProps:{}})},children:E("common.retry")})}})},le=({downloadTokenList:se})=>{ve.current.downloadTokenList=se,de(!1),ze()},Te=({chooseParams:se=ve.current,componentDid:me,isInit:Ce=!1,isUpload:p=!1})=>{const{meta:x,registryUrl:k,inStore:L,inputUrl:U}=se,{did:ee,title:re,name:Ee}=x,we=(W.settings?.children||[]).filter(at=>at.status==="deleted"&&at.meta.bundleDid===ee),nt=me||"",et=x.environments?.map(at=>{const{name:hn,validation:Pt,...Wt}=at,sn={validation:Dl(Pt)?"":Pt};return{...Wt,key:hn,...sn}});ve.current={...se,meta:{...x,configs:et,registryUrl:k,inStore:L,inputUrl:U}};let Ae={};if(Ce){const at=[W],hn=et||[],Pt=[],Wt=es(Al([...hn,...Pt]),"key").filter(zt=>!!zt.key).sort((zt,Zt)=>zt.required&&!Zt.required?-1:Zt.required&&!zt.required?1:0),sn=$t.getSharedConfigObj(at[0],{configs:Wt}),an={},On=Wt.map(zt=>{const{default:Zt,key:en,...Vt}=zt;return an[en]=sn[en]||Zt,{...Vt,key:en,hidden:!!Bt.BLOCKLET_CONFIGURABLE_KEY[en]}});Ae={...Ae,configsList:On,configsValue:an,hasMissRequiredConfigs:Lo(On,an)}}const Fe=W.children.some(at=>at.mountPoint==="/"),Ze=we.find(at=>at.meta.bundleDid===ee),Dt=W.children.find(at=>at.meta.bundleDid===ee);Ae.title=re||"",Ze?Ae={...Ae,pathPrefix:Ze.mountPoint||"",componentName:Ze.meta.name,hasEnvironmentsStep:!1}:Dt?Ae={...Ae,pathPrefix:Dt.mountPoint||"",componentName:Dt.meta.name,hasEnvironmentsStep:!1}:Ae={...Ae,pathPrefix:Fe?`/${Rn(re)||Rn(Ee)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:ve.current.meta?.environments?.length>0};const on=Gh(ve.current.meta),dn=Hh(ve.current.meta),nr=Mr(W);Ue({bundleDid:ee,componentDid:nt,...Ae,hasRequiredEnvironments:Xh(ve.current.meta),requirePurchase:on,didSpaceIsRequiredSetup:dn,didSpaceEndpoint:nr,isUpload:p}),Ce&&on&>()},Pe=async()=>{if(!We.current.loading)try{P(!0),await We.current.onSubmit()&&ze()}catch(se){console.error("error",se)}finally{P(!1)}};q.useEffect(()=>{if(!a&&!m?.meta||ce!==0||!W)return;const{meta:se,inputUrl:me="",inStore:Ce=!0,registryUrl:p="",isUpload:x=!1}=m||{};Te({chooseParams:{blocklets:[a||se],meta:a||se,registryUrl:p||d||a.homepage,inStore:Ce,inputUrl:me},isInit:!0,isUpload:x}),Ue({showFromUrlDialog:!1}),ze()},[a,ce,W,m]),Ye.push({key:"selectComponent",name:E("blocklet.component.selectComponent"),body:l.jsxs(Ht,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[u&&V.showFromUrlDialog&&l.jsx(ws,{mode:"component",onCancel:()=>{Ue({showFromUrlDialog:!1})},onSuccess:({meta:se,inputUrl:me,inStore:Ce,registryUrl:p})=>{Te({chooseParams:{meta:se,inputUrl:me,inStore:Ce,registryUrl:p},isInit:!0}),Ue({showFromUrlDialog:!1}),ze()},handleText:{title:E("blocklet.component.addComponentTip.fromUrl"),confirm:E("blocklet.component.choose")}}),l.jsx(Os,{stores:r,extra:Ko.isInServerlessMode(z)?null:u?l.jsxs(bt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Ue({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[l.jsx(Va,{style:{fontSize:20,marginRight:4}}),E("blocklet.component.addComponentTip.fromUrl")]}):null,loading:O,onChange:()=>{ke({}),ve.current={}},storageKey:n,children:({currentRegistry:se})=>l.jsx(ua,{showResourcesSwitch:h,showCategory:j,serverVersion:z?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:se.url,resourceType:i,resourceDid:s,handleButtonClick:me=>{Te({chooseParams:{...me,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:me,defaultRender:Ce})=>{const p=V?.bundleDid&&V?.bundleDid===me?.did;return l.jsxs(Zh,{children:[l.jsx(te,{className:p?"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",...p?{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:Ce}),p&&l.jsx(te,{className:"check-container",children:l.jsx(Vo,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:E("common.cancel"),confirm:Yh({params:V,blocklet:W,t:E}),onCancel:Ct,onConfirm:()=>{ze()}}),Ye.push({key:"agreement",name:E("launchBlocklet.introduction"),body:l.jsxs(Ht,{component:"div",className:"agreement-wrapper",children:[l.jsx(Fr,{title:E("launchBlocklet.introduction"),subTitle:E("blocklet.component.addComponentTip.introduction")}),xe?l.jsx(fs,{meta:xe,onClickNext:ze,installRelated:pt,onChangeInstallRelated:mt,handleDescEle:l.jsx("p",{children:E("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:a?void 0:E("common.pre"),disabled:!he,confirm:E(he?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:a?Ct:He,onConfirm:()=>{de(!1),ze()}}),xe&&V.requirePurchase&&Ye.push({key:"purchase",name:l.jsxs(l.Fragment,{children:[E("common.verifyNFT"),l.jsx(Pn,{})]}),body:l.jsxs(Ht,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(_e.current?.getCurrentStep?.()===2||$)&&l.jsx($n,{title:E("common.verifyNFT"),subTitle:E("blocklet.component.addComponentTip.verifyNFT")}),bn(V.purchaseResultProps)?N&&l.jsx(ks,{ref:_e,meta:N.meta,mode:V.componentDid?"verify":"both",onCancel:K,installOpts:N.installOpts,handlePaySuccess:le}):l.jsx("div",{className:"flex-align-center flex-justify-center",children:l.jsx(Ri,{...V.purchaseResultProps})})]}),disabled:_e.current?.getCurrentStep?.()===2||$,cancel:E("common.pre"),confirm:E("common.next"),onConfirm:()=>{typeof _e.current.onNext=="function"&&(_e.current.onNext(),de(!0))},onCancel:()=>{He()}}),$t.hasStartEngine(xe)&&Ml.hasMountPoint(xe)?Ye.push({key:"config",name:E("common.config"),error:c,body:l.jsxs(Ht,{component:"div",children:[l.jsx($n,{title:E("common.config"),subTitle:E("blocklet.component.addComponentTip.config")}),l.jsx(Gn,{label:E("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:I||E("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:V.pathPrefix,onChange:se=>{const me=se.target.value;Ue({pathPrefix:me}),B(E("common.slugifyHint",{value:wl(me)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!c&&l.jsx(Bo,{severity:"error",style:{width:"100%",marginTop:8},children:c})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:He,onConfirm:()=>{ze()}}):xe&&(V.pathPrefix=xe.interfaces?.[0]?.path||`/${xe.did}`),xe&&xe?.requirements?.aigne&&Ye.push({key:"aigne",name:l.jsxs(Ie,{component:"div",title:E("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[E("setting.aigne.config")," ",l.jsx(Pn,{})]}),body:()=>l.jsxs(Ht,{component:"div",className:"aigne-config-wrapper",children:[l.jsx(Fr,{title:E("setting.aigne.config")}),l.jsx(te,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:l.jsx(Zl,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:We})})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:()=>{We.current.loading||He()},onConfirm:Pe,loading:O||We.current?.loading,disabled:O||We.current?.loading}),xe&&V?.hasEnvironmentsStep&&Ye.push({key:"environment",name:l.jsxs(l.Fragment,{children:[E("common.environment")," ",V.hasRequiredEnvironments&&l.jsx(Pn,{})]}),disabled:!!_||V?.hasMissRequiredConfigs,body:()=>l.jsxs(Ht,{component:"div",style:{overflowY:"auto"},children:[l.jsx($n,{title:E("common.environment"),subTitle:E("blocklet.component.addComponentTip.environment")}),l.jsx($l,{style:{marginTop:-12,width:"100%"},schema:V.configsList,defaultValue:V.configsValue,onChange:(se,{action:me,currentItem:Ce,allValues:p})=>{me==="confirm"&&Ue({hasMissRequiredConfigs:Lo(V.configsList,p),configsValue:p}),me==="edit"?D(Ce):["cancel","confirm"].includes(me)&&D(null)}})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:He,onConfirm:ze}),xe&&V?.didSpaceIsRequiredSetup&&Ye.push({key:"didSpace",name:l.jsxs(l.Fragment,{children:[E("blocklet.component.didSpaceConfig")," ",V.didSpaceIsRequiredSetup==="required"&&l.jsx(Pn,{})]}),disabled:V?.didSpaceIsRequiredSetup&&!V.didSpaceEndpoint,body:()=>l.jsx(Fl,{children:l.jsxs(Ht,{component:"div",children:[l.jsx($n,{title:E("blocklet.component.didSpaceConfig"),subTitle:E("blocklet.component.didSpaceConfigTip")}),l.jsx(te,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:l.jsx(js,{blockletMeta:ve.current.meta,onNext:()=>{ze()},onEndpointUpdate:Ot})})]})}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:He,onConfirm:ze}),Ye.push({key:"install",name:At(xe?.did)?E("common.upgrade"):E("common.install"),disabled:f?!1:bn(V.installResultProps),loading:f?!1:bn(V.installResultProps),body:l.jsx(Ht,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:bn(V.installResultProps)?l.jsx(il,{message:l.jsx(ef,{children:E(f?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):l.jsx("div",{style:{marginTop:120},children:l.jsx(Ri,{...V.installResultProps})})}),confirm:E("common.complete"),onConfirm:Rt});const Se=Ye[ce]||{},A=()=>O||Se.error||!V.bundleDid?!0:ce>1?!V.pathPrefix:!1;return W?l.jsxs(Qh,{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(da,{ref:Ne,meta:xe,isMobile:Ge,onStepChange:se=>{$e(se)}})}),l.jsxs(te,{className:"action-bar",children:[Se.cancel&&l.jsx(bt,{onClick:se=>{se.stopPropagation(),Se.onCancel()},disabled:ce===Ye.length-2&&O,color:"inherit",children:Se.cancel||E("common.cancel")}),Se.confirm&&l.jsx(bt,{onClick:se=>{se.stopPropagation(),Se.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:O||(typeof Se.disabled=="boolean"?Se.disabled:A()),variant:"contained",autoFocus:!0,title:Se.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:l.jsxs(te,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Se.loading=="boolean"?Se.loading:O)&&l.jsx(jt,{style:{marginRight:8},size:16}),l.jsx(te,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Se.confirm})]})})]})]}):null}Jh.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 Qh=ot(te)`
|
|
698
|
+
`,Kh=(e,t)=>(e?.children||[]).find(r=>r.mountPoint===t)?.meta,Gh=e=>e.inStore&&$t.isFreeBlocklet(e)===!1,Hh=e=>[Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,Bt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(e?.capabilities?.didSpace),Br=e=>e?.configs?.find(t=>t.key===Bt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT)?.value||null,Xh=e=>(e.environments||[]).some(t=>t.required),Lo=(e,t)=>e?.some(r=>r.required&&!t[r.key]),Yh=({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")},_o=({componentDid:e,timeout:t=1e3,manual:r=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:r},"*")},t)};function Jh({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}=St(),[O,P]=q.useState(!1),[_,$]=q.useState(null),[l,w]=q.useState(""),[I,M]=q.useState(""),{api:D,ws:{useSubscription:ne},inService:Z,info:z}=un(),{blocklet:W,actions:{refreshBlocklet:H}}=Yn(),[N,X]=q.useState(null),[F,de]=q.useState(!1),Le={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:""},[V,ke]=q.useState(Le),[ce,$e]=q.useState(0),ve=q.useRef({}),Ne=q.useRef({}),_e=q.useRef({}),Ge=Yt(se=>se.breakpoints.down("md")),tt=Ja(),[pt,mt]=q.useState(!0),{meta:xe}=ve.current,he=os(xe),ge=q.useRef(!1),We=q.useRef(null),Ue=se=>ke(me=>({...me,...se}));q.useEffect(()=>{if(V.pathPrefix){const{errMsg:se}=st({...V,pathPrefix:V.pathPrefix,locale:S});w(se)}},[V.pathPrefix]),q.useEffect(()=>{ce===0&&ke(Le)},[ce]);const Ot=()=>{const se=Br(W)??"";Ue({didSpaceEndpoint:se})},Be=()=>ve?.current?.meta?$t.getDisplayName(ve.current):"",Ct=()=>{P(!1),ke({}),ge.current=!1,ve.current={},e()},It=se=>{const me=Ce=>{Ue({installResultProps:{variant:"error",title:Be(),subTitle:se,footer:c.jsx(bt,{className:"bottom-button",disabled:Ce,"data-cy":"retry-install-component",onClick:async()=>{me(!0),await lt(ve.current.installInput)},children:c.jsxs(te,{sx:{display:"flex",alignItems:"center"},children:[Ce&&c.jsx(jt,{size:16,style:{marginRight:8}}),E("common.retry")]})})}})};me()},Et=se=>me=>{(me?.meta?.did||me?.meta)===W?.meta?.did&&se(me)},Rt=()=>{_o({timeout:0,componentDid:tt.componentDid,manual:!0}),Ct(),setTimeout(()=>{const se=document.getElementsByClassName("dashboard-main")[0];se&&(se.scrollTop=se.scrollHeight)},200)};ne(Bt.BlockletEvents.componentInstalled,Et(()=>{Ue({installResultProps:{variant:"success",title:Be(),subTitle:E("blocklet.component.installSuccessTip")}}),_o({componentDid:tt.componentDid})}),[W?.meta?.did]),ne(Bt.BlockletEvents.statusChange,Et(()=>{const se=Br(W);Ue(me=>({...me,didSpaceEndpoint:se}))}),[W?.meta?.did]),ne(Bt.BlockletEvents.downloadFailed,Et(()=>{ge.current=!1,It(E("blocklet.component.installComponentError"))}),[W?.meta?.did]),ne(Bt.BlockletEvents.installFailed,Et(()=>{ge.current=!1,It(E("blocklet.component.installComponentError"))}),[W?.meta?.did]);const Ye=[],At=se=>(W?.children||[]).find(me=>me.meta.did===se),lt=async se=>{ge.current=!0;const{pathPrefix:me,bundleDid:Ce,title:p,componentName:x="",componentDid:k=""}=V,L=ve.current?.meta||{},{configs:U=[],registryUrl:ee,inStore:re,inputUrl:Ee,dist:we}=L,nt=ve.current?.downloadTokenList,et=Ee||(re?Ii(ee,Ce,we):"");P(!0);const Ae={rootDid:W.meta.did,url:et,mountPoint:me?Rn(me):`/${Rn(L.title||L.name)}`,title:p,name:x,did:V.isUpload&&V.upgradeDid?V.upgradeDid:k,dist:{tarball:"",integrity:""},onlyRequired:!pt,...V.hasEnvironmentsStep&&U.length>0?{configs:U.map(Fe=>({...Fe,value:V.configsValue[Fe.key]||""}))}:{},...nt?{downloadTokenList:nt}:{},...se};try{if(await D.installComponent({input:Ae}),ee){const{teamDid:Fe,storeList:Ze}=Qo({fromBlocklet:Z,nodeInfo:z,blocklet:W}),{isNew:Dt,decoded:on}=Sl(ee,Ze);Dt&&await D.addBlockletStore({input:{teamDid:Fe,url:on}})}Ue({installResultProps:{}}),H({showError:!1,attachRuntimeInfo:!1})}catch(Fe){const Ze=Ur(Fe);Xn.error(Ze),console.error("installComponent error: ",Fe),It(Ze)}finally{P(!1),ve.current.installInput=Ae}},st=se=>{const me=ic({params:{...se,did:se.bundleDid},blocklets:[W],blocklet:W,locale:S,isUpload:V.isUpload});let Ce=me;const p=Kh(W,V.pathPrefix);if(me==="overwrite"&&p&&p.did!==se.bundleDid?(Ue({upgradeDid:p.did}),Ce=""):(Ue({upgradeDid:""}),Ce=me),Ce){const x=At(se.bundleDid),k=oc({params:{...se,did:se.bundleDid},blocklet:W});if(x&&x.mountPoint===k)return{errMsg:""}}return{errMsg:Ce}},ze=async se=>{const{errMsg:me}=st({...V,locale:S});w(me),ce===Ye.length-2&&!ge.current&&await lt(se),Ne.current?.setActiveStepByIndex?.(Ce=>Ce+1)},He=()=>{Ne.current?.setActiveStepByIndex?.(se=>se-1)},gt=()=>{const{pathPrefix:se,bundleDid:me,title:Ce,componentName:p="",componentDid:x=""}=V,{meta:k={}}=ve.current||{},{registryUrl:L,inStore:U,inputUrl:ee,dist:re}=k,Ee=U?Ii(L,me,re):ee;X({meta:k,installOpts:{type:"component",rootDid:W.meta.did,mountPoint:se,url:Ee,title:Ce,name:p,did:x}})},K=se=>{de(!1),Ue({purchaseResultProps:{variant:"error",title:Be(),subTitle:se,style:{paddingTop:120},footer:c.jsx(bt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Ue({purchaseResultProps:{}})},children:E("common.retry")})}})},le=({downloadTokenList:se})=>{ve.current.downloadTokenList=se,de(!1),ze()},Te=({chooseParams:se=ve.current,componentDid:me,isInit:Ce=!1,isUpload:p=!1})=>{const{meta:x,registryUrl:k,inStore:L,inputUrl:U}=se,{did:ee,title:re,name:Ee}=x,we=(W.settings?.children||[]).filter(at=>at.status==="deleted"&&at.meta.bundleDid===ee),nt=me||"",et=x.environments?.map(at=>{const{name:hn,validation:Pt,...Wt}=at,sn={validation:Dl(Pt)?"":Pt};return{...Wt,key:hn,...sn}});ve.current={...se,meta:{...x,configs:et,registryUrl:k,inStore:L,inputUrl:U}};let Ae={};if(Ce){const at=[W],hn=et||[],Pt=[],Wt=es(Al([...hn,...Pt]),"key").filter(zt=>!!zt.key).sort((zt,Zt)=>zt.required&&!Zt.required?-1:Zt.required&&!zt.required?1:0),sn=$t.getSharedConfigObj(at[0],{configs:Wt}),an={},On=Wt.map(zt=>{const{default:Zt,key:en,...Vt}=zt;return an[en]=sn[en]||Zt,{...Vt,key:en,hidden:!!Bt.BLOCKLET_CONFIGURABLE_KEY[en]}});Ae={...Ae,configsList:On,configsValue:an,hasMissRequiredConfigs:Lo(On,an)}}const Fe=W.children.some(at=>at.mountPoint==="/"),Ze=we.find(at=>at.meta.bundleDid===ee),Dt=W.children.find(at=>at.meta.bundleDid===ee);Ae.title=re||"",Ze?Ae={...Ae,pathPrefix:Ze.mountPoint||"",componentName:Ze.meta.name,hasEnvironmentsStep:!1}:Dt?Ae={...Ae,pathPrefix:Dt.mountPoint||"",componentName:Dt.meta.name,hasEnvironmentsStep:!1}:Ae={...Ae,pathPrefix:Fe?`/${Rn(re)||Rn(Ee)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:ve.current.meta?.environments?.length>0};const on=Gh(ve.current.meta),dn=Hh(ve.current.meta),nr=Br(W);Ue({bundleDid:ee,componentDid:nt,...Ae,hasRequiredEnvironments:Xh(ve.current.meta),requirePurchase:on,didSpaceIsRequiredSetup:dn,didSpaceEndpoint:nr,isUpload:p}),Ce&&on&>()},Pe=async()=>{if(!We.current.loading)try{P(!0),await We.current.onSubmit()&&ze()}catch(se){console.error("error",se)}finally{P(!1)}};q.useEffect(()=>{if(!a&&!m?.meta||ce!==0||!W)return;const{meta:se,inputUrl:me="",inStore:Ce=!0,registryUrl:p="",isUpload:x=!1}=m||{};Te({chooseParams:{blocklets:[a||se],meta:a||se,registryUrl:p||d||a.homepage,inStore:Ce,inputUrl:me},isInit:!0,isUpload:x}),Ue({showFromUrlDialog:!1}),ze()},[a,ce,W,m]),Ye.push({key:"selectComponent",name:E("blocklet.component.selectComponent"),body:c.jsxs(Ht,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[u&&V.showFromUrlDialog&&c.jsx(ws,{mode:"component",onCancel:()=>{Ue({showFromUrlDialog:!1})},onSuccess:({meta:se,inputUrl:me,inStore:Ce,registryUrl:p})=>{Te({chooseParams:{meta:se,inputUrl:me,inStore:Ce,registryUrl:p},isInit:!0}),Ue({showFromUrlDialog:!1}),ze()},handleText:{title:E("blocklet.component.addComponentTip.fromUrl"),confirm:E("blocklet.component.choose")}}),c.jsx(Os,{stores:r,extra:Ko.isInServerlessMode(z)?null:u?c.jsxs(bt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Ue({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[c.jsx(Va,{style:{fontSize:20,marginRight:4}}),E("blocklet.component.addComponentTip.fromUrl")]}):null,loading:O,onChange:()=>{ke({}),ve.current={}},storageKey:n,children:({currentRegistry:se})=>c.jsx(ua,{showResourcesSwitch:h,showCategory:j,serverVersion:z?.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:se.url,resourceType:i,resourceDid:s,handleButtonClick:me=>{Te({chooseParams:{...me,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:me,defaultRender:Ce})=>{const p=V?.bundleDid&&V?.bundleDid===me?.did;return c.jsxs(Zh,{children:[c.jsx(te,{className:p?"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",...p?{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:Ce}),p&&c.jsx(te,{className:"check-container",children:c.jsx(Vo,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:E("common.cancel"),confirm:Yh({params:V,blocklet:W,t:E}),onCancel:Ct,onConfirm:()=>{ze()}}),Ye.push({key:"agreement",name:E("launchBlocklet.introduction"),body:c.jsxs(Ht,{component:"div",className:"agreement-wrapper",children:[c.jsx($r,{title:E("launchBlocklet.introduction"),subTitle:E("blocklet.component.addComponentTip.introduction")}),xe?c.jsx(fs,{meta:xe,onClickNext:ze,installRelated:pt,onChangeInstallRelated:mt,handleDescEle:c.jsx("p",{children:E("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:a?void 0:E("common.pre"),disabled:!he,confirm:E(he?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:a?Ct:He,onConfirm:()=>{de(!1),ze()}}),xe&&V.requirePurchase&&Ye.push({key:"purchase",name:c.jsxs(c.Fragment,{children:[E("common.verifyNFT"),c.jsx(Pn,{})]}),body:c.jsxs(Ht,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(_e.current?.getCurrentStep?.()===2||F)&&c.jsx($n,{title:E("common.verifyNFT"),subTitle:E("blocklet.component.addComponentTip.verifyNFT")}),bn(V.purchaseResultProps)?N&&c.jsx(ks,{ref:_e,meta:N.meta,mode:V.componentDid?"verify":"both",onCancel:K,installOpts:N.installOpts,handlePaySuccess:le}):c.jsx("div",{className:"flex-align-center flex-justify-center",children:c.jsx(Pi,{...V.purchaseResultProps})})]}),disabled:_e.current?.getCurrentStep?.()===2||F,cancel:E("common.pre"),confirm:E("common.next"),onConfirm:()=>{typeof _e.current.onNext=="function"&&(_e.current.onNext(),de(!0))},onCancel:()=>{He()}}),$t.hasStartEngine(xe)&&Ml.hasMountPoint(xe)?Ye.push({key:"config",name:E("common.config"),error:l,body:c.jsxs(Ht,{component:"div",children:[c.jsx($n,{title:E("common.config"),subTitle:E("blocklet.component.addComponentTip.config")}),c.jsx(Gn,{label:E("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",fullWidth:!0,helperText:I||E("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:V.pathPrefix,onChange:se=>{const me=se.target.value;Ue({pathPrefix:me}),M(E("common.slugifyHint",{value:wl(me)}))},slotProps:{htmlInput:{"data-cy":"mount-point-input"}}}),!!l&&c.jsx(Bo,{severity:"error",style:{width:"100%",marginTop:8},children:l})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:He,onConfirm:()=>{ze()}}):xe&&(V.pathPrefix=xe.interfaces?.[0]?.path||`/${xe.did}`),xe&&xe?.requirements?.aigne&&Ye.push({key:"aigne",name:c.jsxs(Ie,{component:"div",title:E("setting.aigne.config"),sx:{whiteSpace:"break-spaces"},children:[E("setting.aigne.config")," ",c.jsx(Pn,{})]}),body:()=>c.jsxs(Ht,{component:"div",className:"aigne-config-wrapper",children:[c.jsx($r,{title:E("setting.aigne.config")}),c.jsx(te,{className:"form-container",sx:{"> div":{maxWidth:"unset",width:"100%"}},children:c.jsx(Zl,{orientation:"vertical",hideSubmitButton:!0,hideDivider:!0,source:"setup",forceValidate:!0,ref:We})})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:()=>{We.current.loading||He()},onConfirm:Pe,loading:O||We.current?.loading,disabled:O||We.current?.loading}),xe&&V?.hasEnvironmentsStep&&Ye.push({key:"environment",name:c.jsxs(c.Fragment,{children:[E("common.environment")," ",V.hasRequiredEnvironments&&c.jsx(Pn,{})]}),disabled:!!_||V?.hasMissRequiredConfigs,body:()=>c.jsxs(Ht,{component:"div",style:{overflowY:"auto"},children:[c.jsx($n,{title:E("common.environment"),subTitle:E("blocklet.component.addComponentTip.environment")}),c.jsx($l,{style:{marginTop:-12,width:"100%"},schema:V.configsList,defaultValue:V.configsValue,onChange:(se,{action:me,currentItem:Ce,allValues:p})=>{me==="confirm"&&Ue({hasMissRequiredConfigs:Lo(V.configsList,p),configsValue:p}),me==="edit"?$(Ce):["cancel","confirm"].includes(me)&&$(null)}})]}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:He,onConfirm:ze}),xe&&V?.didSpaceIsRequiredSetup&&Ye.push({key:"didSpace",name:c.jsxs(c.Fragment,{children:[E("blocklet.component.didSpaceConfig")," ",V.didSpaceIsRequiredSetup==="required"&&c.jsx(Pn,{})]}),disabled:V?.didSpaceIsRequiredSetup&&!V.didSpaceEndpoint,body:()=>c.jsx(Fl,{children:c.jsxs(Ht,{component:"div",children:[c.jsx($n,{title:E("blocklet.component.didSpaceConfig"),subTitle:E("blocklet.component.didSpaceConfigTip")}),c.jsx(te,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:c.jsx(js,{blockletMeta:ve.current.meta,onNext:()=>{ze()},onEndpointUpdate:Ot})})]})}),cancel:E("common.pre"),confirm:E("common.next"),onCancel:He,onConfirm:ze}),Ye.push({key:"install",name:At(xe?.did)?E("common.upgrade"):E("common.install"),disabled:f?!1:bn(V.installResultProps),loading:f?!1:bn(V.installResultProps),body:c.jsx(Ht,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:bn(V.installResultProps)?c.jsx(il,{message:c.jsx(ef,{children:E(f?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):c.jsx("div",{style:{marginTop:120},children:c.jsx(Pi,{...V.installResultProps})})}),confirm:E("common.complete"),onConfirm:Rt});const Se=Ye[ce]||{},A=()=>O||Se.error||!V.bundleDid?!0:ce>1?!V.pathPrefix:!1;return W?c.jsxs(Qh,{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:[c.jsx(jl,{steps:Ye,mode:"memory",children:c.jsx(da,{ref:Ne,meta:xe,isMobile:Ge,onStepChange:se=>{$e(se)}})}),c.jsxs(te,{className:"action-bar",children:[Se.cancel&&c.jsx(bt,{onClick:se=>{se.stopPropagation(),Se.onCancel()},disabled:ce===Ye.length-2&&O,color:"inherit",children:Se.cancel||E("common.cancel")}),Se.confirm&&c.jsx(bt,{onClick:se=>{se.stopPropagation(),Se.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:O||(typeof Se.disabled=="boolean"?Se.disabled:A()),variant:"contained",autoFocus:!0,title:Se.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:c.jsxs(te,{sx:{display:"flex",alignItems:"center",overflow:"hidden"},children:[(typeof Se.loading=="boolean"?Se.loading:O)&&c.jsx(jt,{style:{marginRight:8},size:16}),c.jsx(te,{component:"span",sx:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Se.confirm})]})})]})]}):null}Jh.propTypes={onClose:B.func,mode:B.oneOf(["normal","embed"]),inDialog:B.bool,stores:B.arrayOf(B.string),storeUrl:B.string,resourceType:B.string,resourceDid:B.string,storageKey:B.string,selectedMeta:B.object,showResourcesSwitch:B.bool,showFromUrl:B.bool,enableRunBackground:B.bool,showCategory:B.bool,installFromUrlParams:B.object};const Qh=ot(te)`
|
|
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
|
`,Ht=ot(Ie)`
|
|
712
712
|
width: 100%;
|
|
713
713
|
height: 100%;
|
|
714
|
-
`,$n=ot(
|
|
714
|
+
`,$n=ot($r)`
|
|
715
715
|
margin-bottom: 24px;
|
|
716
716
|
`,Zh=ot.div`
|
|
717
717
|
position: relative;
|