@abtnode/blocklet-services 1.16.45-beta-20250620-082630-c0c76051 → 1.16.45-beta-20250624-134945-a23c15fc
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/index.js +1 -0
- package/dist/assets/{AdapterDayjs-T0keO70D.js → AdapterDayjs-DPGZ06jw.js} +1 -1
- package/dist/assets/{ArrowDropDown-DKq28w-B.js → ArrowDropDown-BRjvameu.js} +1 -1
- package/dist/assets/{CheckCircle-DYKWpCjc.js → CheckCircle-s6iPVCo6.js} +1 -1
- package/dist/assets/{ChevronLeft-C5ZElVOZ.js → ChevronLeft-CMWjvJzl.js} +1 -1
- package/dist/assets/{ChevronRight-BDtG7F9C.js → ChevronRight-BvGLpFbz.js} +1 -1
- package/dist/assets/{DeleteOutline-CYuYysba.js → DeleteOutline-CZy9YJmZ.js} +1 -1
- package/dist/assets/{Done-C4iTqhTW.js → Done-ANHHWPOL.js} +1 -1
- package/dist/assets/{Download-CkjiFBw2.js → Download-BOwjcgZ3.js} +1 -1
- package/dist/assets/{Edit-D-oqMZ6h.js → Edit-DI_6xJCL.js} +1 -1
- package/dist/assets/{Error-Dt1QvSlR.js → Error-C_wmKEzR.js} +1 -1
- package/dist/assets/{ExpandLess-CRv5O8qM.js → ExpandLess-CDM2P9kE.js} +1 -1
- package/dist/assets/{Google-DboCD85r.js → Google-BO9divfd.js} +1 -1
- package/dist/assets/{Home-CROW9qUz.js → Home-BCeQyZgM.js} +1 -1
- package/dist/assets/{InfoOutlined-B5f3YRb4.js → InfoOutlined-CRqiKRaY.js} +1 -1
- package/dist/assets/{Launch-Cy-UlooC.js → Launch-WjfnHu3Q.js} +1 -1
- package/dist/assets/{LaunchOutlined-Bcn_86ca.js → LaunchOutlined-DD-CBO2C.js} +1 -1
- package/dist/assets/{MoreHoriz-H_VQNQ9b.js → MoreHoriz-D2G1BR_j.js} +1 -1
- package/dist/assets/{PlayArrow-DZsdEeq_.js → PlayArrow-DLymwoC2.js} +1 -1
- package/dist/assets/{TuneOutlined-GyTVf3HU.js → TuneOutlined-DeQKb3nj.js} +1 -1
- package/dist/assets/{ViewList-D0tVfaVX.js → ViewList-BhbcPArj.js} +1 -1
- package/dist/assets/{access-control-C9hWo6TU.js → access-control-BwZXbzhK.js} +1 -1
- package/dist/assets/{actions-BgkGoToI.js → actions-BAixAheW.js} +1 -1
- package/dist/assets/add-component-core-ExhcVQ0D.js +768 -0
- package/dist/assets/{add-resource-YRx2pKzx.js → add-resource-BG-amVdp.js} +1 -1
- package/dist/assets/{addon-DZBLWIf7.js → addon-D7Eawt60.js} +1 -1
- package/dist/assets/{advanced-C9eBqn30.js → advanced-neAeEOLu.js} +1 -1
- package/dist/assets/{appearance-DzftIlmu.js → appearance-B2ZPQ1TJ.js} +1 -1
- package/dist/assets/ar-BN95HEFs.js +7 -0
- package/dist/assets/{audit-logs-Cljb9yLV.js → audit-logs-B7WzzNCo.js} +1 -1
- package/dist/assets/{authorize-BS4vDs5i.js → authorize-Bk0btugo.js} +1 -1
- package/dist/assets/{base32-Cbt7-U8e.js → base32-kNwk0OEz.js} +1 -1
- package/dist/assets/{branding-uCV5ZREf.js → branding-CLZf514m.js} +2 -2
- package/dist/assets/{branding-BuuaXyqZ.js → branding-CM3w7b9c.js} +1 -1
- package/dist/assets/{bundle-avatar-CH2OoDP-.js → bundle-avatar-NjLcf8la.js} +1 -1
- package/dist/assets/{button-ogiWKbo_.js → button-DhAI_y8t.js} +1 -1
- package/dist/assets/{click-to-copy-D0HginOX.js → click-to-copy-Q6B8UnF1.js} +1 -1
- package/dist/assets/{collapse-D4xd-ptF.js → collapse-B1s6QHCm.js} +1 -1
- package/dist/assets/{complete-D2In_TeH.js → complete-BGbK1STn.js} +1 -1
- package/dist/assets/{component-DN1QsNYm.js → component-BKEHSLyn.js} +110 -81
- package/dist/assets/{config-DEbtcbH9.js → config-CwY8zv8V.js} +1 -1
- package/dist/assets/{config-DS_kGhWk.js → config-Dv--ET9N.js} +1 -1
- package/dist/assets/{config-navigation-BB2LlxWl.js → config-navigation-Cmb8QFnC.js} +3 -3
- package/dist/assets/{config-space-DlQnLPiY.js → config-space-ChP6tztJ.js} +1 -1
- package/dist/assets/{confirm-Bbp7EOHO.js → confirm-DrIfevZQ.js} +1 -1
- package/dist/assets/{connect-CtbQgg8c.js → connect-D_bwW55Y.js} +1 -1
- package/dist/assets/{connect-hUOpYByL.js → connect-f41b9wKv.js} +1 -1
- package/dist/assets/{connect-to-EzXJLWP1.js → connect-to-BMgSpYfM.js} +1 -1
- package/dist/assets/{dashboard-CpxtvWAW.js → dashboard-Cpd1IklF.js} +3 -3
- package/dist/assets/de-BmXl3Jnb.js +7 -0
- package/dist/assets/{delete-confirm-BdthpUzC.js → delete-confirm-DYG8CWSB.js} +1 -1
- package/dist/assets/{did-address-DFiM35OM.js → did-address-uKFe7d9V.js} +1 -1
- package/dist/assets/{domain-C7iO-bfS.js → domain-CunmRVp2.js} +1 -1
- package/dist/assets/{domain-action-card-CqcqlPAn.js → domain-action-card-Dzf6si5U.js} +1 -1
- package/dist/assets/domains-CWSUTDgJ.js +1 -0
- package/dist/assets/{email-CH6lvIGE.js → email-BvDqqXub.js} +1 -1
- package/dist/assets/es-C0fHeuzj.js +9 -0
- package/dist/assets/{exchange-passport-F8-Xn3rX.js → exchange-passport-DckgOVoA.js} +1 -1
- package/dist/assets/fr-CO0NFjy0.js +7 -0
- package/dist/assets/{fuel-BRI4NZNF.js → fuel-DtREt_8O.js} +1 -1
- package/dist/assets/{gen-access-key-CjcE_UoL.js → gen-access-key-Ct3FGVE9.js} +1 -1
- package/dist/assets/{get-safe-url-BS4IIyYC.js → get-safe-url-CJEvMc5P.js} +1 -1
- package/dist/assets/{get-safe-url-CuT70yLx.js → get-safe-url-DNGUXA66.js} +1 -1
- package/dist/assets/hi-Cms3dwY-.js +5 -0
- package/dist/assets/{home-B7IeN8M_.js → home-DyrzEdv2.js} +1 -1
- package/dist/assets/id-Bo8dj7EE.js +7 -0
- package/dist/assets/{iframe-DYXqfKJj.js → iframe-CaeDKfYB.js} +1 -1
- package/dist/assets/{index-BEyvIdTp.js → index-B1dgnXJh.js} +1 -1
- package/dist/assets/{index-BW2DapLf.js → index-B2lZxLm9.js} +3 -3
- package/dist/assets/{index-DyCrJT9-.js → index-BBsJrATj.js} +1 -1
- package/dist/assets/{index-ZdwmM3LS.js → index-BDWfKVVU.js} +1 -1
- package/dist/assets/{index-BMCGWiyM.js → index-BRdhpmU2.js} +7 -7
- package/dist/assets/{index-0KJGv8YB.js → index-BfZya8qo.js} +1 -1
- package/dist/assets/{index-Dl0q_c7r.js → index-CF76kaIz.js} +1 -1
- package/dist/assets/{index-CqrC0g0e.js → index-C_ENS0dl.js} +1 -1
- package/dist/assets/index-CcYwTst5.js +110 -0
- package/dist/assets/{index-DhXQuL-K.js → index-CkctlESe.js} +1 -1
- package/dist/assets/{index-DECQi8Vb.js → index-Cle-zfXD.js} +1 -1
- package/dist/assets/{index-ClFIRXfV.js → index-Cu4BdzAo.js} +1 -1
- package/dist/assets/{index-BAtw7eB6.js → index-CuDTJqx_.js} +1 -1
- package/dist/assets/{index-D6ye_M7F.js → index-D2lFJ3sU.js} +1 -1
- package/dist/assets/{index-DDI23z2P.js → index-DBZhb75O.js} +1 -1
- package/dist/assets/{index-mitJwLHE.js → index-DCD3ZWse.js} +4 -4
- package/dist/assets/{index-Dj3HMPh8.js → index-D_F1ag51.js} +1 -1
- package/dist/assets/{index-DeekZg9t.js → index-mDCgbH0P.js} +1 -1
- package/dist/assets/{index-WjR0qttM.js → index-oDHaQu27.js} +1 -1
- package/dist/assets/{invitation-D7jOoJzU.js → invitation-DxxODOR-.js} +1 -1
- package/dist/assets/{invite-BiE9G1lr.js → invite-CI0E7UGP.js} +1 -1
- package/dist/assets/{issue-passport-BxmBoE32.js → issue-passport-CqP-uLPp.js} +1 -1
- package/dist/assets/{item-BuWWRgL8.js → item-DG5gNLUw.js} +1 -1
- package/dist/assets/ja-zaAhH8mE.js +9 -0
- package/dist/assets/ko-CoZQ7a7T.js +9 -0
- package/dist/assets/{layout-Balq-c2F.js → layout-D-TZFmkw.js} +1 -1
- package/dist/assets/{list-DBhbLnjZ.js → list-CDkARaW2.js} +2 -2
- package/dist/assets/{list-C4l_W2F_.js → list-D3co1lE_.js} +1 -1
- package/dist/assets/localization-DdPHn52Y.js +1 -0
- package/dist/assets/{log-CcBqhBEJ.js → log-Befdpc-G.js} +1 -1
- package/dist/assets/{logger-tBhN561y.js → logger-DueMU2XV.js} +1 -1
- package/dist/assets/{login-BF1AdZ-L.js → login-BBSSJs7f.js} +1 -1
- package/dist/assets/{login-oauth-callback-Cv5MlgIc.js → login-oauth-callback-CVwRxsRg.js} +1 -1
- package/dist/assets/{logo-uploader-C1N-bsM2.js → logo-uploader-B-M7yFxC.js} +3 -3
- package/dist/assets/{lost-passport-C2Km75Ka.js → lost-passport-BAJU8v9K.js} +1 -1
- package/dist/assets/{open-window-uY95lBbB.js → open-window-DTfKdl9d.js} +1 -1
- package/dist/assets/{overview-BgK_P3ko.js → overview-oelilgIt.js} +1 -1
- package/dist/assets/{page-header-CiTTXRdM.js → page-header-BfzUNAXD.js} +1 -1
- package/dist/assets/{passport-item-fJ88Wv4t.js → passport-item-BZ2PDs40.js} +1 -1
- package/dist/assets/{permission-CQWJVo4a.js → permission-pKosyod0.js} +1 -1
- package/dist/assets/{preferences-Uz2t9auQ.js → preferences-xjKgRqmh.js} +1 -1
- package/dist/assets/{profile-embed-C7ypVv2q.js → profile-embed-QQJQ7iQM.js} +1 -1
- package/dist/assets/pt-D4wJ-rZD.js +5 -0
- package/dist/assets/{publish-resource-DLqFuWGv.js → publish-resource-DI9RoK5q.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-DMJVQVbv.js → react-beautiful-dnd.esm-D4AqzL2w.js} +1 -1
- package/dist/assets/ru-CmWrzb7M.js +5 -0
- package/dist/assets/{runtime-XL6C0WHV.js → runtime-wFrO-XwO.js} +1 -1
- package/dist/assets/sdk-Dv5_9dL5.js +1 -0
- package/dist/assets/{security-C5-rO801.js → security-Muzez6Sy.js} +1 -1
- package/dist/assets/{session-BDyIB4uh.js → session-DocEIP6S.js} +1 -1
- package/dist/assets/{setup-Dpq6lpy4.js → setup-CEV9qa6q.js} +3 -3
- package/dist/assets/{spaces-BR4I2U0t.js → spaces-CCo1ZRC-.js} +1 -1
- package/dist/assets/{start-BTmB0MgK.js → start-D1wx_swP.js} +1 -1
- package/dist/assets/{starting-progress-BsYL_5xB.js → starting-progress-BdIQ-div.js} +1 -1
- package/dist/assets/{status-D8GKQyA3.js → status-DmvoK-2H.js} +1 -1
- package/dist/assets/{step-actions-njetG0Iy.js → step-actions-BIy9iLaD.js} +1 -1
- package/dist/assets/{studio-DSEHQtAw.js → studio-CGisGAXN.js} +1 -1
- package/dist/assets/{switch-control-BCB3_Ctk.js → switch-control-DuXtjpWN.js} +1 -1
- package/dist/assets/{table-tips-Cjv8HIcF.js → table-tips-ClAYiT8W.js} +1 -1
- package/dist/assets/th-DkqBkRH_.js +5 -0
- package/dist/assets/{traffic-DAzuj4ZR.js → traffic-BZEjFNTD.js} +1 -1
- package/dist/assets/{transfer-NRpeYO3B.js → transfer-BrPnaaOx.js} +1 -1
- package/dist/assets/{unsubscribe-CBvTeTZf.js → unsubscribe-D4NKMBZT.js} +1 -1
- package/dist/assets/{use-blocklet-logo-DwwmdicD.js → use-blocklet-logo-Due3V0N2.js} +1 -1
- package/dist/assets/{useLocalStorage-iQ2AmaOA.js → useLocalStorage-D_xU3zzI.js} +1 -1
- package/dist/assets/{user-center-CCOO4S3Y.js → user-center-D1KDLD8O.js} +3 -3
- package/dist/assets/{util-paKPrRHx.js → util-YJ_KBZfa.js} +1 -1
- package/dist/assets/{util-BK7oThoq.js → util-lAtUh3oi.js} +1 -1
- package/dist/assets/{vendor-arcblock-f1tICt1E.js → vendor-arcblock-BUFJsma5.js} +3 -3
- package/dist/assets/{vendor-ux-did-connect-BbCim3WZ.js → vendor-ux-did-connect-mISLpoxA.js} +1 -1
- package/dist/assets/vi-D4Y0EZ10.js +5 -0
- package/dist/assets/wrap-locale-BGuH0-0r.js +1 -0
- package/dist/assets/{zh-DJTjvgj8.js → zh-CXbCDXZ8.js} +1 -1
- package/dist/assets/zh-tw-DaTNZcVC.js +9 -0
- package/dist/index.html +3 -3
- package/dist/service-worker.js +1 -1
- package/package.json +22 -22
- package/dist/assets/add-component-core-CpBArNQj.js +0 -768
- package/dist/assets/ar-DLXKKOGO.js +0 -7
- package/dist/assets/de-CnbmrteH.js +0 -7
- package/dist/assets/domains-z_Wu9ucc.js +0 -1
- package/dist/assets/es-C7oXJBWv.js +0 -9
- package/dist/assets/fr-DzleTcLj.js +0 -7
- package/dist/assets/hi-B24wH0bs.js +0 -5
- package/dist/assets/id-BIjW1vW9.js +0 -7
- package/dist/assets/index-D7U3pqVe.js +0 -110
- package/dist/assets/ja-mu0bc5Fx.js +0 -9
- package/dist/assets/ko-CSWdQF8q.js +0 -9
- package/dist/assets/localization-crkTHEvo.js +0 -1
- package/dist/assets/pt-Odg8daEV.js +0 -5
- package/dist/assets/ru-OkiNIvy3.js +0 -5
- package/dist/assets/sdk-D3QR4FNa.js +0 -1
- package/dist/assets/th-esLoaeiE.js +0 -5
- package/dist/assets/vi-BF6u6-98.js +0 -5
- package/dist/assets/wrap-locale-BLcZ6jMd.js +0 -1
- package/dist/assets/zh-tw-B7cFexwg.js +0 -9
|
@@ -0,0 +1,768 @@
|
|
|
1
|
+
import{a9 as Cl,j as o,H as _,ab as St,ah as Ve,aa as Y,T as ge,v as Qt,bs as ki,bR as Oi,I as Os,bJ as Is,bY as Rs,A as Cs,be as Pl,b8 as Ps,bq as Ll,O as Tr,bE as _l,bF as Nl,bG as Al,bx as Dl,ak as Ls,L as Ml,b7 as Fl,b5 as Bl,q as Ii,ad as _s,af as $l,al as rt,e as Zt,bK as Ul,y as ar,Z as Ns,a1 as As,M as Ds,bT as Ms,an as Wl,ai as Yt,as as ko,D as zl,E as Oo,a7 as ql,P as Kl,G as Gl,w as Hl,a8 as Vl,N as Io}from"./vendor-mui-core-Bq8gXTan.js";import{r as A,g as Ri,h as Xl,f as Yl,a as Ci,e as Te,b as Wt,l as Ql}from"./vendor-react-DEoibe3W.js";import{j as Fs,d as Jl,S as Zl,s as Bs,A as ec}from"./item-DG5gNLUw.js";import{r as tc,B as ft,ar as Pi,a1 as $s,k as Us,a as gt,I as pt,aR as nc,aI as rc,i as jr,bd as ic,bz as oc,bA as sc,aY as ac,at as Ws,a3 as kr,bB as Ro,aw as lc,F as cc,s as en,a2 as xr,aD as Co,ao as zs,bC as uc,d as qs,bh as Ks,p as dc,E as Gs,a5 as hc,bD as fc,b as li,Q as pc,bE as mc}from"./vendor-ux-did-connect-mISLpoxA.js";import{m as Po,c as wt,n as gc,E as Or,q as vc,s as yc,t as bc,L as xc,S as wc}from"./vendor-arcblock-BUFJsma5.js";import{L as Lo}from"./launch-result-message-AharZGq2.js";import{P as Hs}from"./page-header-BfzUNAXD.js";import{e as ht,v as Ec,B as Sc,A as vn,z as Ir,E as _o,a1 as Vs,a9 as Tc,ai as jc,J as kc,o as Br,$ as Oc,aj as Ic,ak as Rc,al as Cc,b as Jn,am as Pc,c as Lc}from"./vendor-utils-BfZ4tlod.js";import{f as ci}from"./index-8eXqqyHQ.js";import{D as Nn,f as Ut,a0 as _c,a1 as Nc,a2 as Ac,H as Dc,a3 as Mc,a4 as Fc,a5 as Bc,G as Rr,a6 as Xs,_ as $c,a7 as Uc,a8 as Wc,a9 as zc,aa as ur,ab as No,ac as qc}from"./index-BRdhpmU2.js";import{u as Kc,C as Gc}from"./config-space-ChP6tztJ.js";import{R as $r}from"./logo-uploader-B-M7yFxC.js";import{S as Hc}from"./index-BBsJrATj.js";import{s as Ys,h as Vc,w as Xc,f as Yc,a as Qc,b as Jc,c as Zc,M as eu}from"./index-CTlzm-Mc.js";import{l as lr,b as tu,u as nu,f as Qs,a as ru,t as iu}from"./vendor-hooks-DqdmWCmo.js";import{g as ou}from"./get-safe-url-CJEvMc5P.js";import{p as su}from"./index-BxJZWVOT.js";import{r as au}from"./cloneDeep-CDl5kZTY.js";import{_ as Li}from"./useLocalStorage-D_xU3zzI.js";import{I as Ao}from"./index-DBZhb75O.js";import{u as lu}from"./session-DocEIP6S.js";import{W as cu}from"./did-address-uKFe7d9V.js";import{a as Do}from"./api-C1S8LUld.js";import{d as uu,a as du,v as hu,e as fu}from"./util-lAtUh3oi.js";import{u as Js}from"./use-mobile-DwzRjjku.js";import{C as pu}from"./content-layout-BC2QkTYi.js";import{C as mu,D as gu,a as vu}from"./connect-to-BMgSpYfM.js";import{d as yu}from"./ArrowDropDown-BRjvameu.js";import{d as bu}from"./ChevronLeft-CMWjvJzl.js";import{d as xu}from"./ChevronRight-BvGLpFbz.js";import{d as Ur}from"./search-4YYphs0l.js";const yg="blocklet-add-component-registry",bg="server-add-registry",xg=e=>`resource-${e}-add-registry`;var _i={},wu=Cl;Object.defineProperty(_i,"__esModule",{value:!0});var Zs=_i.default=void 0,Eu=wu(tc()),Su=o;Zs=_i.default=(0,Eu.default)((0,Su.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function ea(e){const{info:t}=Nn();return A.useMemo(()=>{var n,r,i;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((i=e.docker)!=null&&i.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function Ni({disabled:e,children:t,onConfirm:n}){return A.useEffect(()=>{if(e)return()=>{};const r=i=>{i.code==="Enter"&&(i.metaKey===!0||i.ctrlKey===!0)&&(i.preventDefault(),i.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}Ni.propTypes={disabled:_.bool,children:_.any.isRequired,onConfirm:_.func.isRequired};Ni.defaultProps={disabled:!1};function Ai({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=A.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(Tu,{children:o.jsxs(Ni,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(ft,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(St,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(Pi,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}Ai.propTypes={onContinue:_.func.isRequired,nextDisabled:_.bool,launching:_.bool,description:_.any,texts:_.object};Ai.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const Tu=Ve.div`
|
|
2
|
+
margin: 0 auto;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-items: center;
|
|
6
|
+
|
|
7
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.eula-trigger {
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
text-decoration: underline;
|
|
14
|
+
${e=>e.theme.breakpoints.up("md")} {
|
|
15
|
+
padding-right: 24px;
|
|
16
|
+
}
|
|
17
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
18
|
+
padding: 16px;
|
|
19
|
+
}
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
&:hover {
|
|
23
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.next-button {
|
|
28
|
+
min-width: 200px;
|
|
29
|
+
}
|
|
30
|
+
`;var Di={exports:{}},Mo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ju=/\n/g,ku=/^\s*/,Ou=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Iu=/^:\s*/,Ru=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Cu=/^[;\s]*/,Pu=/^\s+|\s+$/g,Lu=`
|
|
31
|
+
`,Fo="/",Bo="*",pn="",_u="comment",Nu="declaration",Au=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var j=w.match(ju);j&&(n+=j.length);var D=w.lastIndexOf(Lu);r=~D?w.length-D:r+w.length}function s(){var w={line:n,column:r};return function(j){return j.position=new a(w),v(),j}}function a(w){this.start=w,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function c(w){var j=new Error(t.source+":"+n+":"+r+": "+w);if(j.reason=w,j.filename=t.source,j.line=n,j.column=r,j.source=e,!t.silent)throw j}function f(w){var j=w.exec(e);if(j){var D=j[0];return i(D),e=e.slice(D.length),j}}function v(){f(ku)}function l(w){var j;for(w=w||[];j=u();)j!==!1&&w.push(j);return w}function u(){var w=s();if(!(Fo!=e.charAt(0)||Bo!=e.charAt(1))){for(var j=2;pn!=e.charAt(j)&&(Bo!=e.charAt(j)||Fo!=e.charAt(j+1));)++j;if(j+=2,pn===e.charAt(j-1))return c("End of comment missing");var D=e.slice(2,j-2);return r+=2,i(D),e=e.slice(j),r+=2,w({type:_u,comment:D})}}function k(){var w=s(),j=f(Ou);if(j){if(u(),!f(Iu))return c("property missing ':'");var D=f(Ru),C=w({type:Nu,property:$o(j[0].replace(Mo,pn)),value:D?$o(D[0].replace(Mo,pn)):pn});return f(Cu),C}}function b(){var w=[];l(w);for(var j;j=k();)j!==!1&&(w.push(j),l(w));return w}return v(),b()};function $o(e){return e?e.replace(Pu,pn):pn}var Du=Au;function ta(e,t){var n=null;if(!e||typeof e!="string")return n;for(var r,i=Du(e),s=typeof t=="function",a,c,f=0,v=i.length;f<v;f++)r=i[f],a=r.property,c=r.value,s?t(a,c,r):c&&(n||(n={}),n[a]=c);return n}Di.exports=ta;Di.exports.default=ta;var Mu=Di.exports;const Fu=Ri(Mu),Bu={}.hasOwnProperty;function $u(e,t,n){if(typeof e!="function")throw new TypeError("h is not a function");const r=Wu(e),i=Ku(e),s=qu(e);let a,c;if(typeof n=="string"||typeof n=="boolean"?(a=n,n={}):(n||(n={}),a=n.prefix),t&&t.type==="root"){const f=t.children[0];c=t.children.length===1&&f.type==="element"?f:{type:"element",tagName:"div",properties:{},children:t.children}}else if(t&&t.type==="element")c=t;else throw new Error("Expected root or element, not `"+(t&&t.type||t)+"`");return na(e,c,{schema:n.space==="svg"?Ys:Vc,prefix:a==null?r||i||s?"h-":void 0:typeof a=="string"?a:a?"h-":void 0,key:0,react:r,vue:i,vdom:s,hyperscript:zu(e)})}function na(e,t,n){const r=n.schema;let i=r,s=t.tagName;const a={},c=[];let f=-1,v;r.space==="html"&&s.toLowerCase()==="svg"&&(i=Ys,n.schema=i);for(v in t.properties)t.properties&&Bu.call(t.properties,v)&&Uu(a,v,t.properties[v],n,s);if(n.vdom&&(i.space==="html"?s=s.toUpperCase():i.space&&(a.namespace=Xc[i.space])),n.prefix&&(n.key++,a.key=n.prefix+n.key),t.children)for(;++f<t.children.length;){const l=t.children[f];l.type==="element"?c.push(na(e,l,n)):l.type==="text"&&c.push(l.value)}return n.schema=r,c.length>0?e.call(t,s,a,c):e.call(t,s,a)}function Uu(e,t,n,r,i){const s=Yc(r.schema,t);let a;n==null||typeof n=="number"&&Number.isNaN(n)||n===!1&&(r.vue||r.vdom||r.hyperscript)||!n&&s.boolean&&(r.vue||r.vdom||r.hyperscript)||(Array.isArray(n)&&(n=s.commaSeparated?Qc(n):Jc(n)),s.boolean&&r.hyperscript&&(n=""),s.property==="style"&&typeof n=="string"&&(r.react||r.vue||r.vdom)&&(n=Gu(n,i)),r.vue?s.property!=="style"&&(a="attrs"):s.mustUseProperty||(r.vdom?s.property!=="style"&&(a="attributes"):r.hyperscript&&(a="attrs")),a?e[a]=Object.assign(e[a]||{},{[s.attribute]:n}):s.space&&r.react?e[Zc[s.property]||s.property]=n:e[s.attribute]=n)}function Wu(e){const t=e("div",{});return!!(t&&("_owner"in t||"_store"in t)&&(t.key===void 0||t.key===null))}function zu(e){return"context"in e&&"cleanup"in e}function qu(e){return e("div",{}).type==="VirtualNode"}function Ku(e){const t=e("div",{});return!!(t&&t.context&&t.context._isVue)}function Gu(e,t){const n={};try{Fu(e,(r,i)=>{r.slice(0,4)==="-ms-"&&(r="ms-"+r.slice(4)),n[r.replace(/-([a-z])/g,(s,a)=>a.toUpperCase())]=i})}catch(r){const i=r;throw i.message=t+"[style]"+i.message.slice(9),i}return n}var Hu=ra;function ra(e){if(typeof e=="string")return Qu(e);if(e==null)return Ju;if(typeof e=="object")return("length"in e?Yu:Xu)(e);if(typeof e=="function")return e;throw new Error("Expected function, string, or object as test")}function Vu(e){for(var t=[],n=e.length,r=-1;++r<n;)t[r]=ra(e[r]);return t}function Xu(e){return t;function t(n){var r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function Yu(e){var t=Vu(e),n=t.length;return r;function r(){for(var i=-1;++i<n;)if(t[i].apply(this,arguments))return!0;return!1}}function Qu(e){return t;function t(n){return!!(n&&n.type===e)}}function Ju(){return!0}var Zu=Cr,ed=Hu,ia=!0,oa="skip",vr=!1;Cr.CONTINUE=ia;Cr.SKIP=oa;Cr.EXIT=vr;function Cr(e,t,n,r){var i;typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),i=ed(t),s(e,null,[]);function s(c,f,v){var l=[],u;return(!t||i(c,f,v[v.length-1]||null))&&(l=Uo(n(c,v)),l[0]===vr)?l:c.children&&l[0]!==oa?(u=Uo(a(c.children,v.concat(c))),u[0]===vr?u:l):l}function a(c,f){for(var v=-1,l=r?-1:1,u=(r?c.length:v)+l,k;u>v&&u<c.length;){if(k=s(c[u],u,f),k[0]===vr)return k;u=typeof k[1]=="number"?k[1]:u+l}}}function Uo(e){return e!==null&&typeof e=="object"&&"length"in e?e:typeof e=="number"?[ia,e]:[e]}var td=Lr,Pr=Zu,nd=Pr.CONTINUE,rd=Pr.SKIP,id=Pr.EXIT;Lr.CONTINUE=nd;Lr.SKIP=rd;Lr.EXIT=id;function Lr(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),Pr(e,t,i,r);function i(s,a){var c=a[a.length-1],f=c?c.children.indexOf(s):null;return n(s,f,c)}}var od=td,sd=Object.prototype.hasOwnProperty,Wr={align:"text-align",valign:"vertical-align",height:"height",width:"width"},ad=function(t){return od(t,"element",ld),t};function ld(e){if(!(e.tagName!=="tr"&&e.tagName!=="td"&&e.tagName!=="th")){var t,n;for(t in Wr)!sd.call(Wr,t)||e.properties[t]===void 0||(n=Wr[t],cd(e,n,e.properties[t]),delete e.properties[t])}}function cd(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var i=r+t+": "+n+";";e.properties.style=i}const ud=Ri(ad);function dd(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 hd={}.hasOwnProperty,fd=new Set(["table","thead","tbody","tfoot","tr"]);function pd(e){if(!e||typeof e.createElement!="function")throw new TypeError("createElement is not a function");const t=e.createElement,n=e.fixTableCellAlign!==!1;Object.assign(this,{Compiler:r});function r(s){let a=$u(i,n?ud(s):s,e.prefix);return s.type==="root"?(a=a&&typeof a=="object"&&"type"in a&&"props"in a&&a.type==="div"&&(s.children.length!==1||s.children[0].type!=="element")?a.props.children:[a],t(e.Fragment||"div",{},a)):a}function i(s,a,c){if(c&&fd.has(s)&&(c=c.filter(f=>!dd(f))),e.components&&hd.call(e.components,s)){const f=e.components[s];return e.passNode&&typeof f=="function"&&(a=Object.assign({node:this},a)),t(f,a,c)}return t(s,a,c)}}function Mi({children:e}){return o.jsx(md,{children:e})}const Wo="source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace !important",md=Ve(Y)`
|
|
32
|
+
.highlight pre,
|
|
33
|
+
pre {
|
|
34
|
+
border-radius: 5px;
|
|
35
|
+
}
|
|
36
|
+
code {
|
|
37
|
+
font-family: ${Wo};
|
|
38
|
+
}
|
|
39
|
+
pre code {
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
font-family: ${Wo};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
h1,
|
|
45
|
+
h2,
|
|
46
|
+
h3,
|
|
47
|
+
h4,
|
|
48
|
+
h5,
|
|
49
|
+
h6 {
|
|
50
|
+
font-weight: 700 !important;
|
|
51
|
+
font-size: 1.2rem !important;
|
|
52
|
+
line-height: 1.5 !important;
|
|
53
|
+
margin-bottom: 16px;
|
|
54
|
+
margin-top: 24px;
|
|
55
|
+
border-bottom: initial !important;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.CodeMirror pre {
|
|
59
|
+
background-color: ${e=>e.theme.palette.grey[50]} !important;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.anchor {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
`;Mi.propTypes={children:_.any.isRequired};Mi.defaultProps={};function sa({infoList:e=[]}){return o.jsx(Y,{className:"info-table",sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"max-content 1fr"},columnGap:4,rowGap:1.5},children:e.map(t=>o.jsxs(o.Fragment,{children:[o.jsx(Y,{component:"span",sx:{fontWeight:"bold",whiteSpace:"nowrap"},children:t.key}),o.jsx(Y,{component:"span",sx:{marginTop:{xs:-1,md:0}},children:t.value})]}))})}sa.propTypes={infoList:_.arrayOf(_.shape({key:_.string,value:_.string}))};const gd=e=>e.payment?(e.payment.price||[]).map(n=>n.value||0).every(n=>n===0):!0,vd=new pd({createElement:A.createElement}).Compiler,Lt={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 Fi({blockletMeta:e,locale:t,handleDescEle:n}){const{data:r}=e,{registryUrl:i,did:s}=r,a=Ut.getDisplayName({meta:r}),c=lr(()=>i&&s?fetch(Po(i,"/api/blocklets",s,"readme")).then(w=>w.json()):null,{refreshDeps:[i,s]}),f=tu(()=>c.data?c.data[t]||c.data.en||c.data[Object.keys(c.data)[0]]:"",[c]),v=r&&r.htmlAst?vd(r.htmlAst):"",l=gd(r);let u=ht(r,"owner.fullName");if(u){const w=ht(r,"owner.did");w&&(u=o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[u,o.jsx($s,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:w,compact:!0,size:14,locale:t})]}))}else u=ht(r,"author.name");const k=[{key:ht(Lt[t],"appinfo.name"),value:Ut.getDisplayName({meta:r})},{key:ht(Lt[t],"appinfo.version"),value:r.version},{key:ht(Lt[t],"appinfo.author"),value:u},{type:"description",key:ht(Lt[t],"appinfo.description"),value:r.description}];r.requirements&&k.push({key:ht(Lt[t],"appinfo.requirements"),value:r.requirements.server}),r.community&&k.push({key:ht(Lt[t],"appinfo.community"),value:o.jsx("a",{href:r.community,target:"_blank",rel:"noreferrer",children:r.community})}),r.documentation&&k.push({key:ht(Lt[t],"appinfo.documentation"),value:o.jsx("a",{href:r.documentation,target:"_blank",rel:"noreferrer",children:r.documentation})}),r.support&&k.push({key:ht(Lt[t],"appinfo.support"),value:o.jsx("a",{href:`mailto:${r.support}`,target:"_blank",rel:"noreferrer",children:r.support})}),v&&k.push({key:ht(Lt[t],"appinfo.overview"),value:""});let b;return t==="zh"?b=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["您可以免费使用 ",o.jsx("b",{children:a}),";"]}):o.jsxs("p",{children:["您需要购买才能使用 ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"在应用启动前,需要选择您的节点;"}),o.jsx("p",{children:"如果您没有节点,我们会引导您创建新的节点;"}),o.jsx("p",{children:"下面为该应用的信息:"})]}):b=o.jsxs(o.Fragment,{children:[l?o.jsxs("p",{children:["You can use ",o.jsx("b",{children:a})," for free;"]}):o.jsxs("p",{children:["You need to purchase before launch ",o.jsx("b",{children:a}),";"]}),o.jsx("p",{children:"Before the blocklet starts, you need to select your Blocklet Server; "}),o.jsx("p",{children:"If you do not have any Blocklet Server, we will guide you to create a new one; "}),o.jsx("p",{children:"Below is the information for the blocklet: "})]}),o.jsxs(bd,{children:[n||b,o.jsx(sa,{infoList:k}),f?o.jsxs("div",{className:"app-overview",children:[o.jsx(ge,{variant:"h5",gutterBottom:!0,children:ht(Lt[t],"appinfo.overview")}),o.jsx(Mi,{children:o.jsx(yd,{component:"div",className:"content-wrapper post-content",children:o.jsx(eu,{source:f,wrapperElement:{"data-color-mode":"light"},urlTransform:(w,j,D)=>w.startsWith("/")?Po(i,w):w})})})]}):v?o.jsx("div",{className:"app-overview",children:v}):null]})}const yd=Ve(ge)`
|
|
66
|
+
width: 100%;
|
|
67
|
+
word-wrap: break-word;
|
|
68
|
+
word-break: break-word;
|
|
69
|
+
line-height: 1.5em;
|
|
70
|
+
min-height: 10vh;
|
|
71
|
+
margin-bottom: 40px !important;
|
|
72
|
+
|
|
73
|
+
.alert-content {
|
|
74
|
+
max-width: 100%;
|
|
75
|
+
p:last-of-type {
|
|
76
|
+
margin-bottom: 0;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
iframe {
|
|
81
|
+
width: 100% !important;
|
|
82
|
+
}
|
|
83
|
+
`,bd=Ve.div`
|
|
84
|
+
.info-table {
|
|
85
|
+
a {
|
|
86
|
+
word-break: break-all;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
.app-overview {
|
|
90
|
+
font-size: 16px;
|
|
91
|
+
margin: 16px 0 0 16px;
|
|
92
|
+
h1 {
|
|
93
|
+
margin: 8px 0;
|
|
94
|
+
font-size: 20px;
|
|
95
|
+
}
|
|
96
|
+
h2 {
|
|
97
|
+
margin: 8px 0;
|
|
98
|
+
font-size: 18px;
|
|
99
|
+
}
|
|
100
|
+
ul {
|
|
101
|
+
display: block;
|
|
102
|
+
list-style-type: disc;
|
|
103
|
+
padding-left: 2em;
|
|
104
|
+
li {
|
|
105
|
+
display: list-item;
|
|
106
|
+
list-style: disc;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
blockquote {
|
|
110
|
+
margin-left: 2em;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`;Fi.propTypes={blockletMeta:_.object.isRequired,locale:_.string.isRequired,handleDescEle:_.node};Fi.defaultProps={handleDescEle:""};function xd({...e}){return o.jsxs("div",{...e,style:{width:"100%"},children:[o.jsx("h3",{children:"End User License Agreement for Application"}),o.jsxs("p",{children:["Blocklet Server License Agreement ",Us.COPYRIGHT_OWNER," version 2020-08-28"]}),o.jsx("p",{children:"BLOCKLET SERVER LICENSE AGREEMENT"}),o.jsx("p",{children:"暂无"})]})}function wd(e){var t,n,r,i;return`${((t=e.bundleSource)==null?void 0:t.store)||e.meta.homepage}/assets/${(n=e.meta)==null?void 0:n.did}/${((r=e.meta)==null?void 0:r.logo)||"logo.png"}?v=${(i=e.meta)==null?void 0:i.version}`}function Bi({installRelated:e,meta:t,show:n,onClose:r,components:i,loading:s}){const{t:a}=gt(),c=Qt(u=>u.breakpoints.down("md"));if(!n)return null;const f=!s&&i.length===0,v=!s&&i.length!==0,l=40;return o.jsxs(Pi,{title:a("blocklet.component.relatedComponents",{name:t.title}),maxWidth:!1,fullWidth:!1,onClose:(u,k)=>{k!=="backdropClick"&&r(!1)},PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:500,minWidth:300,width:"80%"}},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:[s&&o.jsx(Y,{sx:{marginTop:4,display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center"},children:o.jsx(Y,{sx:{fontSize:32},color:"primary.main",component:pt,icon:"line-md:loading-loop"})}),f&&o.jsx(Y,{sx:{textAlign:"center"},children:a("blocklet.component.noDependencies",{name:t.title})}),v&&o.jsx(Y,{sx:{marginBottom:2},children:i.map(u=>{if(!u.meta)return null;const{required:k}=u;let b;return e||k?b=1:b=.5,o.jsxs(Y,{sx:{opacity:b,padding:"10px 0px",paddingBottom:.5,marginTop:0,display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"flex-start"},children:[o.jsx("img",{style:{width:l,height:l,minWidth:l,minHeight:l},src:wd(u),alt:u.meta.title}),o.jsxs(Y,{sx:{display:"flex",flexDirection:"column",justifyContent:"start",alignItems:"start",flex:1,marginLeft:2},children:[o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"start",alignItems:"center",fontSize:"16px",fontWeight:"bold",cursor:"pointer",".link-icon":{opacity:0},":hover .link-icon":{opacity:1}},onClick:()=>{var w;window.open(ou(`${((w=u.bundleSource)==null?void 0:w.store)||u.meta.homepage}/blocklets/${u.meta.did}`,{allowDomains:null}),"_blank")},children:[u.meta.title,o.jsx(Y,{sx:{display:k?"inline-block":"none",fontSize:"12px",fontWeight:"bold",marginLeft:1},children:a("blocklet.component.required")}),o.jsxs(Y,{sx:{paddingLeft:1,fontSize:"13px",fontWeight:"400"},component:"span",children:[u.meta.version,o.jsx(Y,{className:"link-icon",icon:"fluent:open-20-filled",component:pt,sx:{color:"primary.main",fontSize:16,transform:"translate(6px, 3px)",transition:"all 0.1s"}})]})]}),o.jsx(Y,{sx:{marginTop:0,opacity:.7},children:u.meta.description})]})]},u.meta.did)})})]})}Bi.propTypes={meta:_.object,show:_.bool,onClose:_.func.isRequired,installRelated:_.func,components:_.array.isRequired,loading:_.bool.isRequired};Bi.defaultProps={meta:null,show:!1,installRelated:!1};function Ed(e){return e&&(e.registryUrl||e.homepage)&&e.did?`${e.registryUrl||e.homepage}/api/blocklets/${e==null?void 0:e.did}/blocklet.json`:""}function Sd(e){const{api:t}=Nn(),[n]=Xl(),r=n.get("blocklet_meta_url")||Ed(e),[i,s]=A.useState([]),[a,c]=A.useState(!1);return A.useEffect(()=>{!r||e!=null&&e.inputUrl||(c(!0),t.getDynamicComponents({input:{url:r}}).then(f=>{s(f.components)}).finally(()=>{c(!1)}))},[r]),{components:i,loading:a}}function $i({installRelated:e,onChangeInstallRelated:t,meta:n,onClickNext:r,handleDescEle:i}){const s=Yl(),{t:a,locale:c}=gt(),[f,v]=A.useState(!1),{components:l,loading:u}=Sd(n),k=ea(n),b=r||(()=>{s(`/launch-blocklet/install${window.location.search}`)}),w=()=>{v(!0)},j=()=>{v(!1)};return o.jsxs(Td,{children:[o.jsx("div",{className:"app-content",children:o.jsx("div",{className:"agreement",children:o.jsx("div",{className:"agreement-content",children:k?o.jsx(Fi,{blockletMeta:{data:n},locale:c,handleDescEle:i}):o.jsx(Y,{sx:{p:3},children:o.jsx(ge,{children:a("launchBlocklet.dockerBlockletCantInstall")})})})})}),o.jsxs(Y,{className:"agreement-bottom",sx:{"> .agreement-loading":{color:"primary.main"}},children:[u?o.jsx(pt,{className:"agreement-loading",icon:"line-md:loading-loop",style:{fontSize:42,transform:"scale(0.6)"}}):null,k&&t&&(l!=null&&l.length)?o.jsxs(Y,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"},children:[o.jsx(ki,{sx:{mr:.5},checked:e,onChange:D=>t(D.currentTarget.checked),control:o.jsx(Oi,{}),label:o.jsx("span",{children:a("launchBlocklet.installRelatedComponents")})}),o.jsx(Y,{sx:{"> button svg":{color:"primary.main"}},children:o.jsx(Os,{size:"small",onClick:w,children:o.jsx(pt,{icon:"octicon:package-dependencies-16"})})})]}):null,o.jsx("div",{className:"button-container","data-cy":"agree-all",children:k?o.jsx(Ai,{onContinue:b,description:o.jsx(xd,{}),texts:{listenName:a("launchBlocklet.license"),buttonNext:a("launchBlocklet.next")}}):null})]}),o.jsx(Bi,{installRelated:e,meta:n,show:f,onClose:j,components:l,loading:u})]})}$i.propTypes={meta:_.object.isRequired,onClickNext:_.func,handleDescEle:_.node,installRelated:_.bool,onChangeInstallRelated:_.func};$i.defaultProps={onClickNext:null,handleDescEle:"",installRelated:!0,onChangeInstallRelated:null};const Td=Ve.div`
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
width: 100%;
|
|
118
|
+
height: 100%;
|
|
119
|
+
flex: 1;
|
|
120
|
+
.app-content {
|
|
121
|
+
padding: 2px 24px 24px;
|
|
122
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
123
|
+
padding-top: 10px;
|
|
124
|
+
}
|
|
125
|
+
width: 100%;
|
|
126
|
+
flex: 1;
|
|
127
|
+
letter-spacing: normal;
|
|
128
|
+
}
|
|
129
|
+
.agreement {
|
|
130
|
+
position: relative;
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
width: 100%;
|
|
134
|
+
height: 100%;
|
|
135
|
+
border: 1px solid ${e=>e.theme.palette.grey[100]};
|
|
136
|
+
border-radius: 12px;
|
|
137
|
+
${e=>e.theme.breakpoints.up("md")} {
|
|
138
|
+
margin-top: 24px;
|
|
139
|
+
}
|
|
140
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
141
|
+
margin-top: 16px;
|
|
142
|
+
}
|
|
143
|
+
.agreement-content {
|
|
144
|
+
position: absolute;
|
|
145
|
+
left: 0;
|
|
146
|
+
top: 0;
|
|
147
|
+
width: 100%;
|
|
148
|
+
height: 100%;
|
|
149
|
+
font-size: 14px;
|
|
150
|
+
overflow-y: auto;
|
|
151
|
+
${e=>e.theme.breakpoints.up("md")} {
|
|
152
|
+
padding: 0 24px;
|
|
153
|
+
}
|
|
154
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
155
|
+
padding: 0 16px;
|
|
156
|
+
}
|
|
157
|
+
&:after {
|
|
158
|
+
display: block;
|
|
159
|
+
content: '';
|
|
160
|
+
height: 24px;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
.agreement-bottom {
|
|
165
|
+
display: flex;
|
|
166
|
+
width: 100%;
|
|
167
|
+
padding: 24px;
|
|
168
|
+
${e=>e.theme.breakpoints.up("md")} {
|
|
169
|
+
flex-direction: row;
|
|
170
|
+
align-items: center;
|
|
171
|
+
margin-left: auto;
|
|
172
|
+
}
|
|
173
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
174
|
+
flex-direction: column;
|
|
175
|
+
align-items: center;
|
|
176
|
+
padding-top: 0;
|
|
177
|
+
padding-bottom: 16px;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
.button-container {
|
|
181
|
+
${e=>e.theme.breakpoints.up("md")} {
|
|
182
|
+
margin-left: auto;
|
|
183
|
+
}
|
|
184
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
185
|
+
padding-top: 0;
|
|
186
|
+
padding-bottom: 16px;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`;var aa={},Ui={exports:{}},la={exports:{}},Vn=la.exports={github:{protocols:["git","http","git+ssh","git+https","ssh","https"],domain:"github.com",treepath:"tree",filetemplate:"https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",bugstemplate:"https://{domain}/{user}/{project}/issues",gittemplate:"git://{auth@}{domain}/{user}/{project}.git{#committish}",tarballtemplate:"https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"},bitbucket:{protocols:["git+ssh","git+https","ssh","https"],domain:"bitbucket.org",treepath:"src",tarballtemplate:"https://{domain}/{user}/{project}/get/{committish}.tar.gz"},gitlab:{protocols:["git+ssh","git+https","ssh","https"],domain:"gitlab.com",treepath:"tree",bugstemplate:"https://{domain}/{user}/{project}/issues",httpstemplate:"git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",tarballtemplate:"https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",pathmatch:/^\/([^/]+)\/((?!.*(\/-\/|\/repository(\/[^/]+)?\/archive\.tar\.gz)).*?)(?:\.git|\/)?$/},gist:{protocols:["git","git+ssh","git+https","ssh","https"],domain:"gist.github.com",pathmatch:/^[/](?:([^/]+)[/])?([a-z0-9]{7,})(?:[.]git)?$/,filetemplate:"https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",bugstemplate:"https://{domain}/{project}",gittemplate:"git://{domain}/{project}.git{#committish}",sshtemplate:"git@{domain}:/{project}.git{#committish}",sshurltemplate:"git+ssh://git@{domain}/{project}.git{#committish}",browsetemplate:"https://{domain}/{project}{/committish}",browsefiletemplate:"https://{domain}/{project}{/committish}{#path}",docstemplate:"https://{domain}/{project}{/committish}",httpstemplate:"git+https://{domain}/{project}.git{#committish}",shortcuttemplate:"{type}:{project}{#committish}",pathtemplate:"{project}{#committish}",tarballtemplate:"https://codeload.github.com/gist/{project}/tar.gz/{committish}",hashformat:function(e){return"file-"+ca(e)}}},zo={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:ca};Object.keys(Vn).forEach(function(e){Object.keys(zo).forEach(function(t){Vn[e][t]||(Vn[e][t]=zo[t])}),Vn[e].protocols_re=RegExp("^("+Vn[e].protocols.map(function(t){return t.replace(/([\\+*{}()[\]$^|])/g,"\\$1")}).join("|")+"):$")});function ca(e){return e.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-")}var ua=la.exports,qo=ua,Pn=Object.assign||function(t,n){if(n===null||typeof n!="object")return t;const r=Object.keys(n);let i=r.length;for(;i--;)t[r[i]]=n[r[i]];return t},jd=Je;function Je(e,t,n,r,i,s,a){var c=this;c.type=e,Object.keys(qo[e]).forEach(function(f){c[f]=qo[e][f]}),c.user=t,c.auth=n,c.project=r,c.committish=i,c.default=s,c.opts=a||{}}Je.prototype.hash=function(){return this.committish?"#"+this.committish:""};Je.prototype._fill=function(e,t){if(e){var n=Pn({},t);n.path=n.path?n.path.replace(/^[/]+/g,""):"",t=Pn(Pn({},this.opts),t);var r=this;Object.keys(this).forEach(function(l){r[l]!=null&&n[l]==null&&(n[l]=r[l])});var i=n.auth,s=n.committish,a=n.fragment,c=n.path,f=n.project;Object.keys(n).forEach(function(l){var u=n[l];(l==="path"||l==="project")&&typeof u=="string"?n[l]=u.split("/").map(function(k){return encodeURIComponent(k)}).join("/"):l!=="domain"&&(n[l]=encodeURIComponent(u))}),n["auth@"]=i?i+"@":"",n["#fragment"]=a?"#"+this.hashformat(a):"",n.fragment=n.fragment?n.fragment:"",n["#path"]=c?"#"+this.hashformat(c):"",n["/path"]=n.path?"/"+n.path:"",n.projectPath=f.split("/").map(encodeURIComponent).join("/"),t.noCommittish?(n["#committish"]="",n["/tree/committish"]="",n["/committish"]="",n.committish=""):(n["#committish"]=s?"#"+s:"",n["/tree/committish"]=n.committish?"/"+n.treepath+"/"+n.committish:"",n["/committish"]=n.committish?"/"+n.committish:"",n.committish=n.committish||"master");var v=e;return Object.keys(n).forEach(function(l){v=v.replace(new RegExp("[{]"+l+"[}]","g"),n[l])}),t.noGitPlus?v.replace(/^git[+]/,""):v}};Je.prototype.ssh=function(e){return this._fill(this.sshtemplate,e)};Je.prototype.sshurl=function(e){return this._fill(this.sshurltemplate,e)};Je.prototype.browse=function(e,t,n){return typeof e=="string"?(typeof t!="string"&&(n=t,t=null),this._fill(this.browsefiletemplate,Pn({fragment:t,path:e},n))):this._fill(this.browsetemplate,e)};Je.prototype.docs=function(e){return this._fill(this.docstemplate,e)};Je.prototype.bugs=function(e){return this._fill(this.bugstemplate,e)};Je.prototype.https=function(e){return this._fill(this.httpstemplate,e)};Je.prototype.git=function(e){return this._fill(this.gittemplate,e)};Je.prototype.shortcut=function(e){return this._fill(this.shortcuttemplate,e)};Je.prototype.path=function(e){return this._fill(this.pathtemplate,e)};Je.prototype.tarball=function(e){var t=Pn({},e,{noCommittish:!1});return this._fill(this.tarballtemplate,t)};Je.prototype.file=function(e,t){return this._fill(this.filetemplate,Pn({path:e},t))};Je.prototype.getDefaultRepresentation=function(){return this.default};Je.prototype.toString=function(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)};var zr,Ko;function kd(){return Ko||(Ko=1,zr=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),zr}var Od=ye;ye.Node=yn;ye.create=ye;function ye(e){var t=this;if(t instanceof ye||(t=new ye),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var n=0,r=arguments.length;n<r;n++)t.push(arguments[n]);return t}ye.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t};ye.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};ye.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};ye.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Rd(this,arguments[e]);return this.length};ye.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Cd(this,arguments[e]);return this.length};ye.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};ye.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};ye.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next};ye.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev};ye.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value};ye.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value};ye.prototype.map=function(e,t){t=t||this;for(var n=new ye,r=this.head;r!==null;)n.push(e.call(t,r.value,this)),r=r.next;return n};ye.prototype.mapReverse=function(e,t){t=t||this;for(var n=new ye,r=this.tail;r!==null;)n.push(e.call(t,r.value,this)),r=r.prev;return n};ye.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n};ye.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n};ye.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e};ye.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e};ye.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ye;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(;i!==null&&r<t;r++,i=i.next)n.push(i.value);return n};ye.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var n=new ye;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var r=this.length,i=this.tail;i!==null&&r>t;r--)i=i.prev;for(;i!==null&&r>e;r--,i=i.prev)n.push(i.value);return n};ye.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,i=this.head;i!==null&&r<e;r++)i=i.next;for(var s=[],r=0;i&&r<t;r++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var r=0;r<n.length;r++)i=Id(this,i,n[r]);return s};ye.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function Id(e,t,n){var r=t===e.head?new yn(n,null,t,e):new yn(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function Rd(e,t){e.tail=new yn(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Cd(e,t){e.head=new yn(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function yn(e,t,n,r){if(!(this instanceof yn))return new yn(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{kd()(ye)}catch{}const Pd=Od,mn=Symbol("max"),Bt=Symbol("length"),Cn=Symbol("lengthCalculator"),Zn=Symbol("allowStale"),gn=Symbol("maxAge"),Ft=Symbol("dispose"),Go=Symbol("noDisposeOnSet"),ze=Symbol("lruList"),xt=Symbol("cache"),da=Symbol("updateAgeOnGet"),qr=()=>1;class Ld{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[mn]=t.max||1/0;const n=t.length||qr;if(this[Cn]=typeof n!="function"?qr:n,this[Zn]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[gn]=t.maxAge||0,this[Ft]=t.dispose,this[Go]=t.noDisposeOnSet||!1,this[da]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[mn]=t||1/0,Xn(this)}get max(){return this[mn]}set allowStale(t){this[Zn]=!!t}get allowStale(){return this[Zn]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[gn]=t,Xn(this)}get maxAge(){return this[gn]}set lengthCalculator(t){typeof t!="function"&&(t=qr),t!==this[Cn]&&(this[Cn]=t,this[Bt]=0,this[ze].forEach(n=>{n.length=this[Cn](n.value,n.key),this[Bt]+=n.length})),Xn(this)}get lengthCalculator(){return this[Cn]}get length(){return this[Bt]}get itemCount(){return this[ze].length}rforEach(t,n){n=n||this;for(let r=this[ze].tail;r!==null;){const i=r.prev;Ho(this,t,r,n),r=i}}forEach(t,n){n=n||this;for(let r=this[ze].head;r!==null;){const i=r.next;Ho(this,t,r,n),r=i}}keys(){return this[ze].toArray().map(t=>t.key)}values(){return this[ze].toArray().map(t=>t.value)}reset(){this[Ft]&&this[ze]&&this[ze].length&&this[ze].forEach(t=>this[Ft](t.key,t.value)),this[xt]=new Map,this[ze]=new Pd,this[Bt]=0}dump(){return this[ze].map(t=>wr(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[ze]}set(t,n,r){if(r=r||this[gn],r&&typeof r!="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0,s=this[Cn](n,t);if(this[xt].has(t)){if(s>this[mn])return Ln(this,this[xt].get(t)),!1;const f=this[xt].get(t).value;return this[Ft]&&(this[Go]||this[Ft](t,f.value)),f.now=i,f.maxAge=r,f.value=n,this[Bt]+=s-f.length,f.length=s,this.get(t),Xn(this),!0}const a=new _d(t,n,s,i,r);return a.length>this[mn]?(this[Ft]&&this[Ft](t,n),!1):(this[Bt]+=a.length,this[ze].unshift(a),this[xt].set(t,this[ze].head),Xn(this),!0)}has(t){if(!this[xt].has(t))return!1;const n=this[xt].get(t).value;return!wr(this,n)}get(t){return Kr(this,t,!0)}peek(t){return Kr(this,t,!1)}pop(){const t=this[ze].tail;return t?(Ln(this,t),t.value):null}del(t){Ln(this,this[xt].get(t))}load(t){this.reset();const n=Date.now();for(let r=t.length-1;r>=0;r--){const i=t[r],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const a=s-n;a>0&&this.set(i.k,i.v,a)}}}prune(){this[xt].forEach((t,n)=>Kr(this,n,!1))}}const Kr=(e,t,n)=>{const r=e[xt].get(t);if(r){const i=r.value;if(wr(e,i)){if(Ln(e,r),!e[Zn])return}else n&&(e[da]&&(r.value.now=Date.now()),e[ze].unshiftNode(r));return i.value}},wr=(e,t)=>{if(!t||!t.maxAge&&!e[gn])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[gn]&&n>e[gn]},Xn=e=>{if(e[Bt]>e[mn])for(let t=e[ze].tail;e[Bt]>e[mn]&&t!==null;){const n=t.prev;Ln(e,t),t=n}},Ln=(e,t)=>{if(t){const n=t.value;e[Ft]&&e[Ft](n.key,n.value),e[Bt]-=n.length,e[xt].delete(n.key),e[ze].removeNode(t)}};class _d{constructor(t,n,r,i,s){this.key=t,this.value=n,this.length=r,this.now=i,this.maxAge=s||0}}const Ho=(e,t,n,r)=>{let i=n.value;wr(e,i)&&(Ln(e,n),e[Zn]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};var Nd=Ld,ui=_c,Vo=ua,Ad=Ui.exports=jd,Dd=Nd,Gr=new Dd({max:1e3}),Md={"git+ssh:":"sshurl","git+https:":"https","ssh:":"sshurl","git:":"git"};function Fd(e){return Md[e]||e.slice(0,-1)}var Bd={"git:":!0,"https:":!0,"git+https:":!0,"http:":!0,"git+http:":!0};Ui.exports.fromUrl=function(e,t){if(typeof e=="string"){var n=e+JSON.stringify(t||{});return Gr.has(n)||Gr.set(n,$d(e,t)),Gr.get(n)}};function $d(e,t){if(!(e==null||e==="")){var n=Wd(Ud(e)?"github:"+e:e),r=zd(n),i=n.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/),s=Object.keys(Vo).map(function(a){try{var c=Vo[a],f=null;r.auth&&Bd[r.protocol]&&(f=r.auth);var v=r.hash?decodeURIComponent(r.hash.substr(1)):null,l=null,u=null,k=null;if(i&&i[1]===a)l=i[2]&&decodeURIComponent(i[2]),u=decodeURIComponent(i[3].replace(/\.git$/,"")),k="shortcut";else{if(r.host&&r.host!==c.domain&&r.host.replace(/^www[.]/,"")!==c.domain||!c.protocols_re.test(r.protocol)||!r.path)return;var b=c.pathmatch,w=r.path.match(b);if(!w)return;w[1]!==null&&w[1]!==void 0&&(l=decodeURIComponent(w[1].replace(/^:/,""))),u=decodeURIComponent(w[2]),k=Fd(r.protocol)}return new Ad(a,l,f,u,v,k,t)}catch(j){if(!(j instanceof URIError))throw j}}).filter(function(a){return a});if(s.length===1)return s[0]}}function Ud(e){return/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(e)}function Wd(e){var t=ui.parse(e);return t.protocol==="gist:"&&t.host&&!t.path?t.protocol+"/"+t.host:e}function zd(e){var t=e.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);if(!t){var n=ui.parse(e);if(n.auth){const i=e.match(/[^@]+@[^:/]+/);if(i){var r=new ui.URL(i[0]);n.auth=r.username||"",r.password&&(n.auth+=":"+r.password)}}return n}return{protocol:"git+ssh:",slashes:!0,auth:t[1],host:t[2],port:null,hostname:t[2],hash:t[4],search:null,query:null,pathname:"/"+t[3],path:"/"+t[3],href:"git+ssh://"+t[1]+"@"+t[2]+"/"+t[3]+(t[4]||"")}}var qd=Ui.exports,bn={},re={},Kd=null;const Gd=Object.freeze(Object.defineProperty({__proto__:null,default:Kd},Symbol.toStringTag,{value:"Module"})),ha=Ci(Gd),Hd=["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],Vd=["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"];var Xd={charsWide:Hd,charsFullWidth:Vd};const{charsWide:Yd,charsFullWidth:Qd}=Xd,fa=new RegExp(`[${Yd.join("")}${Qd.join("")}]`,"g"),Jd=e=>e.replace(fa,"xx").length;var Zd={default:Jd,charsRegex:fa};/*!
|
|
190
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
191
|
+
*
|
|
192
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
193
|
+
* Licensed under the MIT License.
|
|
194
|
+
*/var eh=function(t){if(typeof t!="string"||t==="")return!1;for(var n;n=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(n[2])return!0;t=t.slice(n.index+n[0].length)}return!1};/*!
|
|
195
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
196
|
+
*
|
|
197
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
198
|
+
* Released under the MIT License.
|
|
199
|
+
*/var th=eh,pa={"{":"}","(":")","[":"]"},nh=function(e){if(e[0]==="!")return!0;for(var t=0,n=-2,r=-2,i=-2,s=-2,a=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||r!==-1&&e[t]==="["&&e[t+1]!=="]"&&(r<t&&(r=e.indexOf("]",t)),r>t&&(a===-1||a>r||(a=e.indexOf("\\",t),a===-1||a>r)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(a=e.indexOf("\\",t),a===-1||a>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(a=e.indexOf("\\",t),a===-1||a>s))||n!==-1&&e[t]==="("&&e[t+1]!=="|"&&(n<t&&(n=e.indexOf("|",t)),n!==-1&&e[n+1]!==")"&&(s=e.indexOf(")",n),s>n&&(a=e.indexOf("\\",n),a===-1||a>s))))return!0;if(e[t]==="\\"){var c=e[t+1];t+=2;var f=pa[c];if(f){var v=e.indexOf(f,t);v!==-1&&(t=v+1)}if(e[t]==="!")return!0}else t++}return!1},rh=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var n=e[t+1];t+=2;var r=pa[n];if(r){var i=e.indexOf(r,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1},ih=function(t,n){if(typeof t!="string"||t==="")return!1;if(th(t))return!0;var r=nh;return n&&n.strict===!1&&(r=rh),r(t)},di={exports:{}};(function(e,t){var n={};t=e.exports=$;var r;typeof Ec=="object"&&n&&n.NODE_DEBUG&&/\bsemver\b/i.test(n.NODE_DEBUG)?r=function(){var d=Array.prototype.slice.call(arguments,0);d.unshift("SEMVER"),console.log.apply(console,d)}:r=function(){},t.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,a=16,c=i-6,f=t.re=[],v=t.safeRe=[],l=t.src=[],u=t.tokens={},k=0;function b(d){u[d]=k++}var w="[a-zA-Z0-9-]",j=[["\\s",1],["\\d",i],[w,c]];function D(d){for(var x=0;x<j.length;x++){var E=j[x][0],L=j[x][1];d=d.split(E+"*").join(E+"{0,"+L+"}").split(E+"+").join(E+"{1,"+L+"}")}return d}b("NUMERICIDENTIFIER"),l[u.NUMERICIDENTIFIER]="0|[1-9]\\d*",b("NUMERICIDENTIFIERLOOSE"),l[u.NUMERICIDENTIFIERLOOSE]="\\d+",b("NONNUMERICIDENTIFIER"),l[u.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+w+"*",b("MAINVERSION"),l[u.MAINVERSION]="("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")\\.("+l[u.NUMERICIDENTIFIER]+")",b("MAINVERSIONLOOSE"),l[u.MAINVERSIONLOOSE]="("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")\\.("+l[u.NUMERICIDENTIFIERLOOSE]+")",b("PRERELEASEIDENTIFIER"),l[u.PRERELEASEIDENTIFIER]="(?:"+l[u.NUMERICIDENTIFIER]+"|"+l[u.NONNUMERICIDENTIFIER]+")",b("PRERELEASEIDENTIFIERLOOSE"),l[u.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[u.NUMERICIDENTIFIERLOOSE]+"|"+l[u.NONNUMERICIDENTIFIER]+")",b("PRERELEASE"),l[u.PRERELEASE]="(?:-("+l[u.PRERELEASEIDENTIFIER]+"(?:\\."+l[u.PRERELEASEIDENTIFIER]+")*))",b("PRERELEASELOOSE"),l[u.PRERELEASELOOSE]="(?:-?("+l[u.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[u.PRERELEASEIDENTIFIERLOOSE]+")*))",b("BUILDIDENTIFIER"),l[u.BUILDIDENTIFIER]=w+"+",b("BUILD"),l[u.BUILD]="(?:\\+("+l[u.BUILDIDENTIFIER]+"(?:\\."+l[u.BUILDIDENTIFIER]+")*))",b("FULL"),b("FULLPLAIN"),l[u.FULLPLAIN]="v?"+l[u.MAINVERSION]+l[u.PRERELEASE]+"?"+l[u.BUILD]+"?",l[u.FULL]="^"+l[u.FULLPLAIN]+"$",b("LOOSEPLAIN"),l[u.LOOSEPLAIN]="[v=\\s]*"+l[u.MAINVERSIONLOOSE]+l[u.PRERELEASELOOSE]+"?"+l[u.BUILD]+"?",b("LOOSE"),l[u.LOOSE]="^"+l[u.LOOSEPLAIN]+"$",b("GTLT"),l[u.GTLT]="((?:<|>)?=?)",b("XRANGEIDENTIFIERLOOSE"),l[u.XRANGEIDENTIFIERLOOSE]=l[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",b("XRANGEIDENTIFIER"),l[u.XRANGEIDENTIFIER]=l[u.NUMERICIDENTIFIER]+"|x|X|\\*",b("XRANGEPLAIN"),l[u.XRANGEPLAIN]="[v=\\s]*("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:\\.("+l[u.XRANGEIDENTIFIER]+")(?:"+l[u.PRERELEASE]+")?"+l[u.BUILD]+"?)?)?",b("XRANGEPLAINLOOSE"),l[u.XRANGEPLAINLOOSE]="[v=\\s]*("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[u.XRANGEIDENTIFIERLOOSE]+")(?:"+l[u.PRERELEASELOOSE]+")?"+l[u.BUILD]+"?)?)?",b("XRANGE"),l[u.XRANGE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAIN]+"$",b("XRANGELOOSE"),l[u.XRANGELOOSE]="^"+l[u.GTLT]+"\\s*"+l[u.XRANGEPLAINLOOSE]+"$",b("COERCE"),l[u.COERCE]="(^|[^\\d])(\\d{1,"+a+"})(?:\\.(\\d{1,"+a+"}))?(?:\\.(\\d{1,"+a+"}))?(?:$|[^\\d])",b("COERCERTL"),f[u.COERCERTL]=new RegExp(l[u.COERCE],"g"),v[u.COERCERTL]=new RegExp(D(l[u.COERCE]),"g"),b("LONETILDE"),l[u.LONETILDE]="(?:~>?)",b("TILDETRIM"),l[u.TILDETRIM]="(\\s*)"+l[u.LONETILDE]+"\\s+",f[u.TILDETRIM]=new RegExp(l[u.TILDETRIM],"g"),v[u.TILDETRIM]=new RegExp(D(l[u.TILDETRIM]),"g");var C="$1~";b("TILDE"),l[u.TILDE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAIN]+"$",b("TILDELOOSE"),l[u.TILDELOOSE]="^"+l[u.LONETILDE]+l[u.XRANGEPLAINLOOSE]+"$",b("LONECARET"),l[u.LONECARET]="(?:\\^)",b("CARETTRIM"),l[u.CARETTRIM]="(\\s*)"+l[u.LONECARET]+"\\s+",f[u.CARETTRIM]=new RegExp(l[u.CARETTRIM],"g"),v[u.CARETTRIM]=new RegExp(D(l[u.CARETTRIM]),"g");var M="$1^";b("CARET"),l[u.CARET]="^"+l[u.LONECARET]+l[u.XRANGEPLAIN]+"$",b("CARETLOOSE"),l[u.CARETLOOSE]="^"+l[u.LONECARET]+l[u.XRANGEPLAINLOOSE]+"$",b("COMPARATORLOOSE"),l[u.COMPARATORLOOSE]="^"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+")$|^$",b("COMPARATOR"),l[u.COMPARATOR]="^"+l[u.GTLT]+"\\s*("+l[u.FULLPLAIN]+")$|^$",b("COMPARATORTRIM"),l[u.COMPARATORTRIM]="(\\s*)"+l[u.GTLT]+"\\s*("+l[u.LOOSEPLAIN]+"|"+l[u.XRANGEPLAIN]+")",f[u.COMPARATORTRIM]=new RegExp(l[u.COMPARATORTRIM],"g"),v[u.COMPARATORTRIM]=new RegExp(D(l[u.COMPARATORTRIM]),"g");var K="$1$2$3";b("HYPHENRANGE"),l[u.HYPHENRANGE]="^\\s*("+l[u.XRANGEPLAIN]+")\\s+-\\s+("+l[u.XRANGEPLAIN]+")\\s*$",b("HYPHENRANGELOOSE"),l[u.HYPHENRANGELOOSE]="^\\s*("+l[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+l[u.XRANGEPLAINLOOSE]+")\\s*$",b("STAR"),l[u.STAR]="(<|>)?=?\\s*\\*";for(var G=0;G<k;G++)r(G,l[G]),f[G]||(f[G]=new RegExp(l[G]),v[G]=new RegExp(D(l[G])));t.parse=T;function T(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $)return d;if(typeof d!="string"||d.length>i)return null;var E=x.loose?v[u.LOOSE]:v[u.FULL];if(!E.test(d))return null;try{return new $(d,x)}catch{return null}}t.valid=F;function F(d,x){var E=T(d,x);return E?E.version:null}t.clean=V;function V(d,x){var E=T(d.trim().replace(/^[=v]+/,""),x);return E?E.version:null}t.SemVer=$;function $(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof $){if(d.loose===x.loose)return d;d=d.version}else if(typeof d!="string")throw new TypeError("Invalid Version: "+d);if(d.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof $))return new $(d,x);r("SemVer",d,x),this.options=x,this.loose=!!x.loose;var E=d.trim().match(x.loose?v[u.LOOSE]:v[u.FULL]);if(!E)throw new TypeError("Invalid Version: "+d);if(this.raw=d,this.major=+E[1],this.minor=+E[2],this.patch=+E[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");E[4]?this.prerelease=E[4].split(".").map(function(L){if(/^[0-9]+$/.test(L)){var B=+L;if(B>=0&&B<s)return B}return L}):this.prerelease=[],this.build=E[5]?E[5].split("."):[],this.format()}$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.toString=function(){return this.version},$.prototype.compare=function(d){return r("SemVer.compare",this.version,this.options,d),d instanceof $||(d=new $(d,this.options)),this.compareMain(d)||this.comparePre(d)},$.prototype.compareMain=function(d){return d instanceof $||(d=new $(d,this.options)),oe(this.major,d.major)||oe(this.minor,d.minor)||oe(this.patch,d.patch)},$.prototype.comparePre=function(d){if(d instanceof $||(d=new $(d,this.options)),this.prerelease.length&&!d.prerelease.length)return-1;if(!this.prerelease.length&&d.prerelease.length)return 1;if(!this.prerelease.length&&!d.prerelease.length)return 0;var x=0;do{var E=this.prerelease[x],L=d.prerelease[x];if(r("prerelease compare",x,E,L),E===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(E===void 0)return-1;if(E===L)continue;return oe(E,L)}while(++x)},$.prototype.compareBuild=function(d){d instanceof $||(d=new $(d,this.options));var x=0;do{var E=this.build[x],L=d.build[x];if(r("prerelease compare",x,E,L),E===void 0&&L===void 0)return 0;if(L===void 0)return 1;if(E===void 0)return-1;if(E===L)continue;return oe(E,L)}while(++x)},$.prototype.inc=function(d,x){switch(d){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",x);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",x);break;case"prepatch":this.prerelease.length=0,this.inc("patch",x),this.inc("pre",x);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",x),this.inc("pre",x);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var E=this.prerelease.length;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);E===-1&&this.prerelease.push(0)}x&&(this.prerelease[0]===x?isNaN(this.prerelease[1])&&(this.prerelease=[x,0]):this.prerelease=[x,0]);break;default:throw new Error("invalid increment argument: "+d)}return this.format(),this.raw=this.version,this},t.inc=le;function le(d,x,E,L){typeof E=="string"&&(L=E,E=void 0);try{return new $(d,E).inc(x,L).version}catch{return null}}t.diff=Q;function Q(d,x){if(ut(d,x))return null;var E=T(d),L=T(x),B="";if(E.prerelease.length||L.prerelease.length){B="pre";var R="prerelease"}for(var N in E)if((N==="major"||N==="minor"||N==="patch")&&E[N]!==L[N])return B+N;return R}t.compareIdentifiers=oe;var Oe=/^[0-9]+$/;function oe(d,x){var E=Oe.test(d),L=Oe.test(x);return E&&L&&(d=+d,x=+x),d===x?0:E&&!L?-1:L&&!E?1:d<x?-1:1}t.rcompareIdentifiers=Xe;function Xe(d,x){return oe(x,d)}t.major=_e;function _e(d,x){return new $(d,x).major}t.minor=Ye;function Ye(d,x){return new $(d,x).minor}t.patch=ie;function ie(d,x){return new $(d,x).patch}t.compare=he;function he(d,x,E){return new $(d,E).compare(new $(x,E))}t.compareLoose=Fe;function Fe(d,x){return he(d,x,!0)}t.compareBuild=X;function X(d,x,E){var L=new $(d,E),B=new $(x,E);return L.compare(B)||L.compareBuild(B)}t.rcompare=Be;function Be(d,x,E){return he(x,d,E)}t.sort=Ne;function Ne(d,x){return d.sort(function(E,L){return t.compareBuild(E,L,x)})}t.rsort=ct;function ct(d,x){return d.sort(function(E,L){return t.compareBuild(L,E,x)})}t.gt=ve;function ve(d,x,E){return he(d,x,E)>0}t.lt=Ze;function Ze(d,x,E){return he(d,x,E)<0}t.eq=ut;function ut(d,x,E){return he(d,x,E)===0}t.neq=zt;function zt(d,x,E){return he(d,x,E)!==0}t.gte=Tt;function Tt(d,x,E){return he(d,x,E)>=0}t.lte=yt;function yt(d,x,E){return he(d,x,E)<=0}t.cmp=qe;function qe(d,x,E,L){switch(x){case"===":return typeof d=="object"&&(d=d.version),typeof E=="object"&&(E=E.version),d===E;case"!==":return typeof d=="object"&&(d=d.version),typeof E=="object"&&(E=E.version),d!==E;case"":case"=":case"==":return ut(d,E,L);case"!=":return zt(d,E,L);case">":return ve(d,E,L);case">=":return Tt(d,E,L);case"<":return Ze(d,E,L);case"<=":return yt(d,E,L);default:throw new TypeError("Invalid operator: "+x)}}t.Comparator=H;function H(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof H){if(d.loose===!!x.loose)return d;d=d.value}if(!(this instanceof H))return new H(d,x);d=d.trim().split(/\s+/).join(" "),r("comparator",d,x),this.options=x,this.loose=!!x.loose,this.parse(d),this.semver===be?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var be={};H.prototype.parse=function(d){var x=this.options.loose?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],E=d.match(x);if(!E)throw new TypeError("Invalid comparator: "+d);this.operator=E[1]!==void 0?E[1]:"",this.operator==="="&&(this.operator=""),E[2]?this.semver=new $(E[2],this.options.loose):this.semver=be},H.prototype.toString=function(){return this.value},H.prototype.test=function(d){if(r("Comparator.test",d,this.options.loose),this.semver===be||d===be)return!0;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}return qe(d,this.operator,this.semver,this.options)},H.prototype.intersects=function(d,x){if(!(d instanceof H))throw new TypeError("a Comparator is required");(!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1});var E;if(this.operator==="")return this.value===""?!0:(E=new de(d.value,x),st(this.value,E,x));if(d.operator==="")return d.value===""?!0:(E=new de(this.value,x),st(d.semver,E,x));var L=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),B=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),R=this.semver.version===d.semver.version,N=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),te=qe(this.semver,"<",d.semver,x)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),Z=qe(this.semver,">",d.semver,x)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return L||B||R&&N||te||Z},t.Range=de;function de(d,x){if((!x||typeof x!="object")&&(x={loose:!!x,includePrerelease:!1}),d instanceof de)return d.loose===!!x.loose&&d.includePrerelease===!!x.includePrerelease?d:new de(d.raw,x);if(d instanceof H)return new de(d.value,x);if(!(this instanceof de))return new de(d,x);if(this.options=x,this.loose=!!x.loose,this.includePrerelease=!!x.includePrerelease,this.raw=d.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(E){return this.parseRange(E.trim())},this).filter(function(E){return E.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}de.prototype.format=function(){return this.range=this.set.map(function(d){return d.join(" ").trim()}).join("||").trim(),this.range},de.prototype.toString=function(){return this.range},de.prototype.parseRange=function(d){var x=this.options.loose,E=x?v[u.HYPHENRANGELOOSE]:v[u.HYPHENRANGE];d=d.replace(E,$e),r("hyphen replace",d),d=d.replace(v[u.COMPARATORTRIM],K),r("comparator trim",d,v[u.COMPARATORTRIM]),d=d.replace(v[u.TILDETRIM],C),d=d.replace(v[u.CARETTRIM],M),d=d.split(/\s+/).join(" ");var L=x?v[u.COMPARATORLOOSE]:v[u.COMPARATOR],B=d.split(" ").map(function(R){return nn(R,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(B=B.filter(function(R){return!!R.match(L)})),B=B.map(function(R){return new H(R,this.options)},this),B},de.prototype.intersects=function(d,x){if(!(d instanceof de))throw new TypeError("a Range is required");return this.set.some(function(E){return Ee(E,x)&&d.set.some(function(L){return Ee(L,x)&&E.every(function(B){return L.every(function(R){return B.intersects(R,x)})})})})};function Ee(d,x){for(var E=!0,L=d.slice(),B=L.pop();E&&L.length;)E=L.every(function(R){return B.intersects(R,x)}),B=L.pop();return E}t.toComparators=tn;function tn(d,x){return new de(d,x).set.map(function(E){return E.map(function(L){return L.value}).join(" ").trim().split(" ")})}function nn(d,x){return r("comp",d,x),d=Dn(d,x),r("caret",d),d=rn(d,x),r("tildes",d),d=on(d,x),r("xrange",d),d=bt(d,x),r("stars",d),d}function Ie(d){return!d||d.toLowerCase()==="x"||d==="*"}function rn(d,x){return d.trim().split(/\s+/).map(function(E){return qt(E,x)}).join(" ")}function qt(d,x){var E=x.loose?v[u.TILDELOOSE]:v[u.TILDE];return d.replace(E,function(L,B,R,N,te){r("tilde",d,L,B,R,N,te);var Z;return Ie(B)?Z="":Ie(R)?Z=">="+B+".0.0 <"+(+B+1)+".0.0":Ie(N)?Z=">="+B+"."+R+".0 <"+B+"."+(+R+1)+".0":te?(r("replaceTilde pr",te),Z=">="+B+"."+R+"."+N+"-"+te+" <"+B+"."+(+R+1)+".0"):Z=">="+B+"."+R+"."+N+" <"+B+"."+(+R+1)+".0",r("tilde return",Z),Z})}function Dn(d,x){return d.trim().split(/\s+/).map(function(E){return Qe(E,x)}).join(" ")}function Qe(d,x){r("caret",d,x);var E=x.loose?v[u.CARETLOOSE]:v[u.CARET];return d.replace(E,function(L,B,R,N,te){r("caret",d,L,B,R,N,te);var Z;return Ie(B)?Z="":Ie(R)?Z=">="+B+".0.0 <"+(+B+1)+".0.0":Ie(N)?B==="0"?Z=">="+B+"."+R+".0 <"+B+"."+(+R+1)+".0":Z=">="+B+"."+R+".0 <"+(+B+1)+".0.0":te?(r("replaceCaret pr",te),B==="0"?R==="0"?Z=">="+B+"."+R+"."+N+"-"+te+" <"+B+"."+R+"."+(+N+1):Z=">="+B+"."+R+"."+N+"-"+te+" <"+B+"."+(+R+1)+".0":Z=">="+B+"."+R+"."+N+"-"+te+" <"+(+B+1)+".0.0"):(r("no pr"),B==="0"?R==="0"?Z=">="+B+"."+R+"."+N+" <"+B+"."+R+"."+(+N+1):Z=">="+B+"."+R+"."+N+" <"+B+"."+(+R+1)+".0":Z=">="+B+"."+R+"."+N+" <"+(+B+1)+".0.0"),r("caret return",Z),Z})}function on(d,x){return r("replaceXRanges",d,x),d.split(/\s+/).map(function(E){return sn(E,x)}).join(" ")}function sn(d,x){d=d.trim();var E=x.loose?v[u.XRANGELOOSE]:v[u.XRANGE];return d.replace(E,function(L,B,R,N,te,Z){r("xRange",d,L,B,R,N,te,Z);var Se=Ie(R),Ae=Se||Ie(N),je=Ae||Ie(te),Re=je;return B==="="&&Re&&(B=""),Z=x.includePrerelease?"-0":"",Se?B===">"||B==="<"?L="<0.0.0-0":L="*":B&&Re?(Ae&&(N=0),te=0,B===">"?(B=">=",Ae?(R=+R+1,N=0,te=0):(N=+N+1,te=0)):B==="<="&&(B="<",Ae?R=+R+1:N=+N+1),L=B+R+"."+N+"."+te+Z):Ae?L=">="+R+".0.0"+Z+" <"+(+R+1)+".0.0"+Z:je&&(L=">="+R+"."+N+".0"+Z+" <"+R+"."+(+N+1)+".0"+Z),r("xRange return",L),L})}function bt(d,x){return r("replaceStars",d,x),d.trim().replace(v[u.STAR],"")}function $e(d,x,E,L,B,R,N,te,Z,Se,Ae,je,Re){return Ie(E)?x="":Ie(L)?x=">="+E+".0.0":Ie(B)?x=">="+E+"."+L+".0":x=">="+x,Ie(Z)?te="":Ie(Se)?te="<"+(+Z+1)+".0.0":Ie(Ae)?te="<"+Z+"."+(+Se+1)+".0":je?te="<="+Z+"."+Se+"."+Ae+"-"+je:te="<="+te,(x+" "+te).trim()}de.prototype.test=function(d){if(!d)return!1;if(typeof d=="string")try{d=new $(d,this.options)}catch{return!1}for(var x=0;x<this.set.length;x++)if(ot(this.set[x],d,this.options))return!0;return!1};function ot(d,x,E){for(var L=0;L<d.length;L++)if(!d[L].test(x))return!1;if(x.prerelease.length&&!E.includePrerelease){for(L=0;L<d.length;L++)if(r(d[L].semver),d[L].semver!==be&&d[L].semver.prerelease.length>0){var B=d[L].semver;if(B.major===x.major&&B.minor===x.minor&&B.patch===x.patch)return!0}return!1}return!0}t.satisfies=st;function st(d,x,E){try{x=new de(x,E)}catch{return!1}return x.test(d)}t.maxSatisfying=jt;function jt(d,x,E){var L=null,B=null;try{var R=new de(x,E)}catch{return null}return d.forEach(function(N){R.test(N)&&(!L||B.compare(N)===-1)&&(L=N,B=new $(L,E))}),L}t.minSatisfying=an;function an(d,x,E){var L=null,B=null;try{var R=new de(x,E)}catch{return null}return d.forEach(function(N){R.test(N)&&(!L||B.compare(N)===1)&&(L=N,B=new $(L,E))}),L}t.minVersion=Kt;function Kt(d,x){d=new de(d,x);var E=new $("0.0.0");if(d.test(E)||(E=new $("0.0.0-0"),d.test(E)))return E;E=null;for(var L=0;L<d.set.length;++L){var B=d.set[L];B.forEach(function(R){var N=new $(R.semver.version);switch(R.operator){case">":N.prerelease.length===0?N.patch++:N.prerelease.push(0),N.raw=N.format();case"":case">=":(!E||ve(E,N))&&(E=N);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+R.operator)}})}return E&&d.test(E)?E:null}t.validRange=Ke;function Ke(d,x){try{return new de(d,x).range||"*"}catch{return null}}t.ltr=Sn;function Sn(d,x,E){return P(d,x,"<",E)}t.gtr=Tn;function Tn(d,x,E){return P(d,x,">",E)}t.outside=P;function P(d,x,E,L){d=new $(d,L),x=new de(x,L);var B,R,N,te,Z;switch(E){case">":B=ve,R=yt,N=Ze,te=">",Z=">=";break;case"<":B=Ze,R=Tt,N=ve,te="<",Z="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(st(d,x,L))return!1;for(var Se=0;Se<x.set.length;++Se){var Ae=x.set[Se],je=null,Re=null;if(Ae.forEach(function(Me){Me.semver===be&&(Me=new H(">=0.0.0")),je=je||Me,Re=Re||Me,B(Me.semver,je.semver,L)?je=Me:N(Me.semver,Re.semver,L)&&(Re=Me)}),je.operator===te||je.operator===Z||(!Re.operator||Re.operator===te)&&R(d,Re.semver))return!1;if(Re.operator===Z&&N(d,Re.semver))return!1}return!0}t.prerelease=kt;function kt(d,x){var E=T(d,x);return E&&E.prerelease.length?E.prerelease:null}t.intersects=ln;function ln(d,x,E){return d=new de(d,E),x=new de(x,E),d.intersects(x)}t.coerce=Nt;function Nt(d,x){if(d instanceof $)return d;if(typeof d=="number"&&(d=String(d)),typeof d!="string")return null;x=x||{};var E=null;if(!x.rtl)E=d.match(v[u.COERCE]);else{for(var L;(L=v[u.COERCERTL].exec(d))&&(!E||E.index+E[0].length!==d.length);)(!E||L.index+L[0].length!==E.index+E[0].length)&&(E=L),v[u.COERCERTL].lastIndex=L.index+L[1].length+L[2].length;v[u.COERCERTL].lastIndex=-1}return E===null?null:T(E[2]+"."+(E[3]||"0")+"."+(E[4]||"0"),x)}})(di,di.exports);var oh=di.exports;const ma=Fs,_t=oh,We="semver",sh={base:ma.string(),type:"semverRange",validate:function(e,{error:t}){return _t.validRange(e)?{value:e}:{errors:t(`${We}.valid`)}},messages:{[`${We}.valid`]:"{{#label}} needs to be a valid semver range"}},En={};En.compare={method:!1,validate:function(e,t,{exp:n},{name:r}){return _t[r](e,n)?e:t.error(`${We}.${r}`,{exp:n})},args:[{name:"exp",assert:_t.valid,message:"needs to be a valid semver expression"}]};["gt","gte","lt","lte","eq","neq"].forEach(function(e){En[e]={method:function(t){return this.$_addRule({name:e,method:"compare",args:{exp:t}})}}});En.cmp={method:function(e,t){return this.$_addRule({name:"cmp",args:{cmp:e,exp:t}})},validate:function(e,t,{cmp:n,exp:r}){return _t.cmp(e,n,r)?e:t.error(`${We}.cmp`,{cmp:n,exp:r})},args:[{name:"cmp",assert:e=>["===","!==","","=","==","!=",">",">=","<","<="].includes(e),message:"needs to be a valid comparator"},{name:"exp",assert:_t.valid,message:"needs to be a valid semver expression"}]};En.compareRange={method:!1,validate:function(e,t,{rng:n},{name:r}){return _t[r](e,n)?e:t.error(`${We}.${r}`,{rng:n})},args:[{name:"rng",assert:_t.validRange,message:"needs to be a valid semver range"}]};["satisfies","gtr","ltr"].forEach(function(e){En[e]={method:function(t){return this.$_addRule({name:e,method:"compareRange",args:{rng:t}})}}});En.outside={method:function(e,t){return this.$_addRule({name:"outside",args:{hilo:e,rng:t}})},validate:function(e,t,{hilo:n,rng:r}){return _t.outside(e,r,n)?e:t.error(`${We}.outside`,{hilo:n,rng:r})},args:[{name:"hilo",assert:e=>[">","<"].includes(e),message:"needs to be a valid comparator"},{name:"rng",assert:_t.validRange,message:"needs to be a valid semver range"}]};const ah={base:ma.string(),type:"semver",validate:function(e,{error:t}){return _t.valid(e)?{value:e}:{errors:t(`${We}.valid`)}},messages:{[`${We}.valid`]:"{{#label}} needs to be a valid semver expression",[`${We}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${We}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${We}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${We}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${We}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${We}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${We}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${We}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${We}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${We}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${We}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:En};var lh={semver:ah,semverRange:sh};/*!
|
|
200
|
+
* is-var-name | ISC (c) Shinnosuke Watanabe
|
|
201
|
+
* https://github.com/shinnn/is-var-name
|
|
202
|
+
*/function ch(e){if(typeof e!="string"||e.trim()!==e)return!1;try{new Function(e,"var "+e)}catch{return!1}return!0}const uh=Object.freeze(Object.defineProperty({__proto__:null,default:ch},Symbol.toStringTag,{value:"Module"})),dh=Ci(uh),hh=Ci(Jl),fh=nc,ph=rc,Xo=jr,mh=e=>{if((0,Xo.isValid)(e))return e;const t=(0,ph.toHex)(Sc.from(typeof e=="string"?e.trim():e));return(0,Xo.fromPublicKey)(t,{role:fh.types.RoleType.ROLE_ANY})};var gh=mh,xn={},ga=Te&&Te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xn,"__esModule",{value:!0});xn.didExtension=xn.fileExtension=void 0;const Yo=ga(ha),vh=ga(su),yh=jr,va=e=>({type:"file",base:e.string(),validate(t,{error:n}){return t&&typeof t=="string"?{value:t}:{errors:n("file.empty",{file:t})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:t=null,canSkip:n=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:t,canSkip:n}})},args:[{name:"baseDir",assert:t=>Yo.default.existsSync(t),message:"baseDir must exist"},{name:"canSkip",assert:t=>typeof t=="function",message:"canSkip must be a function"}],validate(t,{error:n},{baseDir:r,canSkip:i}={}){if(typeof i=="function"&&i(r,t))return t;try{return Yo.default.statSync(vh.default.join(r,t)),t}catch(s){switch(s.code){case"ENOENT":return n("file.enoent",{file:t})}return n("file.error.generic",{message:s.message})}}}}});xn.fileExtension=va;const ya=e=>({type:"DID",base:e.string(),validate(t,{error:n}){return!t||typeof t!="string"?{errors:n("did.empty",{did:t})}:(0,yh.isValid)(t)===!1?{errors:n("did.invalid",{did:t})}:{value:t}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});xn.didExtension=ya;xn.default={fileExtension:va,didExtension:ya};var Wi={},ba={exports:{}};const bh=["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 xa=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),xh=bh,wh=["node_modules","favicon.ico"],Eh=ba.exports=function(e){var t=[],n=[];if(e===null)return n.push("name cannot be null"),Yn(t,n);if(e===void 0)return n.push("name cannot be undefined"),Yn(t,n);if(typeof e!="string")return n.push("name must be a string"),Yn(t,n);if(e.length||n.push("name length must be greater than zero"),e.match(/^\./)&&n.push("name cannot start with a period"),e.match(/^_/)&&n.push("name cannot start with an underscore"),e.trim()!==e&&n.push("name cannot contain leading or trailing spaces"),wh.forEach(function(a){e.toLowerCase()===a&&n.push(a+" is a blacklisted name")}),xh.forEach(function(a){e.toLowerCase()===a&&t.push(a+" is a core module name")}),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var r=e.match(xa);if(r){var i=r[1],s=r[2];if(encodeURIComponent(i)===i&&encodeURIComponent(s)===s)return Yn(t,n)}n.push("name can only contain URL-friendly characters")}return Yn(t,n)};Eh.scopedPackagePattern=xa;var Yn=function(e,t){var n={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return n.warnings.length||delete n.warnings,n.errors.length||delete n.errors,n},Sh=ba.exports;(function(e){var t=Te&&Te.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(e,"__esModule",{value:!0}),e.validateName=e.validateNewDid=void 0;const n=jr,r=t(Sh),i=32,s=c=>{if((0,n.toTypeInfo)(c).role!==n.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};e.validateNewDid=s;const a=(c,{checkDid:f=!0}={})=>{if((0,n.isValid)(c))f&&(0,e.validateNewDid)(c);else{const{validForNewPackages:v,errors:l=[],warnings:u=[]}=(0,r.default)(c);if(!v)throw new Error(l[0]||u[0]);if(c.length>i)throw new Error("Blocklet name is too long")}};e.validateName=a,e.default={validateName:e.validateName,validateNewDid:e.validateNewDid}})(Wi);var Th=Te&&Te.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),jh=Te&&Te.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),kh=Te&&Te.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&Th(n,t,r[i]);return jh(n,t),n}}(),An=Te&&Te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(re,"__esModule",{value:!0});re.Joi=re.eventsSchema=re.installBlockletDescriptionSchema=re.installBlockletTitleSchema=re.resourceBundleSchema=re.authConfigSchema=re.cacheableSchema=re.statsSchema=re.titleSchema=re.themeSchema=re.signatureSchema=re.serviceSchema=re.scriptsSchema=re.personSchema=re.navigationSchema=re.navigationItemSchema=re.updateMountPointSchema=re.mountPointSchema=re.logoSchema=re.interfaceSchema=re.environmentNameSchema=re.environmentSchema=re.engineSchema=re.endpointSchema=re.distSchema=re.descriptionSchema=re.createBlockletSchema=re.componentSchema=re.blockletNameSchema=re.blockletMetaSchema=void 0;const Oh=An(ha),Ih=An(Fs),Rh=An(Zd),Ch=An(ih),Qo=lh,Ph=An(dh),Jo=Us,Lh=jr,_h=hh,Pe=wt,Nh=An(gh),Zo=xn,hi=Wi,zi=kh(Nc),Ah=Rh.default.default,es="/.well-known",h=Ih.default.extend(Qo.semver).extend(Qo.semverRange).extend(Zo.fileExtension).extend(Zo.didExtension);re.Joi=h;const ts=(e,t)=>(0,zi.checkLink)(e)?e:t.message(`Invalid navigation link: ${e}
|
|
203
|
+
|
|
204
|
+
A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
|
|
205
|
+
- /en/home
|
|
206
|
+
- /zh/home
|
|
207
|
+
- https://www.arcblock.io
|
|
208
|
+
`),Dh=(e,t)=>!e||(0,Ph.default)(e)?e:t.message(`Invalid navigation id: ${e}
|
|
209
|
+
|
|
210
|
+
A valid navigation id is should follow the rules of javascript variables, such as:
|
|
211
|
+
- foo
|
|
212
|
+
- fooBar
|
|
213
|
+
- foo123
|
|
214
|
+
|
|
215
|
+
see detail in https://www.npmjs.com/package/is-var-name
|
|
216
|
+
`),_r=h.string().trim().min(1).custom(e=>{if(Ah(e)>Pe.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${Pe.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return e}).meta({className:"TTitle"});re.titleSchema=_r;const Nr=h.string().trim().min(3).max(160).meta({className:"TDescription"});re.descriptionSchema=Nr;const wa=h.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});re.installBlockletTitleSchema=wa;const Ea=h.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});re.installBlockletDescriptionSchema=Ea;const Sa=h.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((e,t)=>e.includes(Jo.WELLKNOWN_BLOCKLET_LOGO_PATH)?t.message(`logo url should not include ${Jo.WELLKNOWN_BLOCKLET_LOGO_PATH}`):e).meta({className:"TLogo"});re.logoSchema=Sa;const Ta=h.string().trim().min(1),qi=Ta.meta({className:"TMountPoint"}).custom((e,t)=>(0,zi.isValidUrlPath)(e)?e:t.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));re.mountPointSchema=qi;const ja=Ta.meta({className:"TUpdateMountPoint"}).custom(e=>(0,zi.default)(e));re.updateMountPointSchema=ja;const _n=h.string().custom(e=>((0,hi.validateName)(e),e)).meta({className:"TBlockletName"});re.blockletNameSchema=_n;const Mh=[],Ki=h.string().trim().min(1).max(50).required().custom((e,t)=>e.startsWith("BLOCKLET")&&!Mh.includes(e)?t.message("Env name can not start with BLOCKLET_"):e.startsWith("COMPONENT")?t.message("Env name can not start with COMPONENT_"):e.startsWith("ABTNODE")?t.message("Env name can not start with ABTNODE_"):/[^\w]/.test(e)?t.message('Env name can include only numbers or letters or "_"'):e).meta({className:"TEnvironmentName",unknownType:"any"});re.environmentNameSchema=Ki;const Gi=h.object({name:Ki.required(),description:h.string().trim().required(),default:h.string().optional().allow("").default(""),required:h.boolean().default(!1),secure:h.boolean().default(!1),validation:h.string().optional(),shared:h.boolean().default(e=>e.secure?!1:void 0)}).custom((e,t)=>e.secure&&e.default?t.message(`Cannot declare default value for secure env ${e.name}`):e).meta({className:"TEnvironment",unknownType:"any"});re.environmentSchema=Gi;const Hi=h.object({dev:h.string().trim().min(1),e2eDev:h.string().trim().min(1),preFlight:h.string().trim().min(1),preInstall:h.string().trim().min(1),postInstall:h.string().trim().min(1),preStart:h.string().trim().min(1),postStart:h.string().trim().min(1),preStop:h.string().trim().min(1),preUninstall:h.string().trim().min(1),preConfig:h.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});re.scriptsSchema=Hi;const Vi=h.object({name:h.string().required().trim(),config:h.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});re.serviceSchema=Vi;const Xi=h.object({type:h.string().trim(!0).min(1).required(),path:h.string().required(),meta:h.object({vcType:h.string(),payable:h.boolean(),params:h.array().items({name:h.string().required().trim(),description:h.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});re.endpointSchema=Xi;const ka=h.string().trim().custom((e,t)=>{const n=e.split("/").filter(Boolean);return n.length===0?t.message("cacheable path must be a valid pathname that is not /"):`/${n.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});re.cacheableSchema=ka;const Yi=h.object({type:h.string().lowercase().valid(...Pe.BLOCKLET_INTERFACE_TYPES).required(),name:h.string().trim().required(),path:h.string().trim().default("/"),prefix:h.string().trim().min(1).default(Pe.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:h.number().port().optional(),hostIP:h.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:h.string().lowercase().valid(...Pe.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:h.alternatives().try(h.string().uppercase().default(Pe.BLOCKLET_DEFAULT_PORT_NAME),h.object({internal:h.string().uppercase().required(),external:h.number().port().required()})).default(Pe.BLOCKLET_DEFAULT_PORT_NAME),cacheable:h.array().items(ka).unique(),services:h.array().items(Vi).unique("name"),endpoints:h.array().items(Xi).unique("type"),pageGroups:h.array().items(h.string().min(1).max(255).trim()).unique(),proxyBehavior:h.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});re.interfaceSchema=Yi;const Fh=h.alternatives().try(h.string().required(),h.object({url:h.string().uri({scheme:["http","https","file"]}).required(),name:_n.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}).required(),name:_n.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),fi=h.object({platform:h.string().valid(...Pe.BLOCKLET_PLATFORMS).optional(),interpreter:h.string().valid("binary","node","blocklet").default("node"),source:Fh,args:h.array().items(h.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});re.engineSchema=fi;const er=h.object({name:h.string().min(1).required(),email:h.string().email({tlds:!1}).optional(),url:h.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});re.personSchema=er;const rr=h.object({tarball:h.alternatives().try(h.string().uri(),h.string()).required(),integrity:h.string().required(),size:h.number().optional()}).meta({className:"TDist",unknownType:"any"});re.distSchema=rr;const Oa=h.object({downloads:h.number().integer().greater(-1),star:h.number().default(0),purchases:h.number().default(0)}).meta({className:"TStats",unknownType:"any"});re.statsSchema=Oa;const Bh=h.alternatives().try(h.object({url:h.alternatives().try(h.string().uri(),h.array().items(h.string().uri()).min(1)).required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid())}),h.object({store:h.string().uri({scheme:["http","https"]}),name:_n.required(),version:h.alternatives().try(h.string().valid("latest"),h.semverRange().valid()).default("latest")})),Ia={source:Bh.required(),required:h.boolean(),title:_r,description:Nr,mountPoint:qi,name:_n},Ra=(e,t)=>h.object(e).custom((n,r)=>!t&&n.source&&n.source.name&&!n.source.store?r.message(`missing 'store' in source of component ${n.name}`):n),Qi=Ra(Ia).meta({className:"TComponent",unknownType:"any"});re.componentSchema=Qi;const $h=Ra(Ia,!0),Ca=({checkStore:e}={})=>{const t=[Qi,$h];return h.array().items(e?t[0]:t[1]).optional().default([])},Pa=h.object({type:h.string().required(),name:h.string().required(),signer:h.string().required(),pk:h.string().required(),created:h.string().isoDate().required(),sig:h.string().required(),excludes:h.array().items(h.string()).optional(),appended:h.array().items(h.string()).optional(),delegatee:h.string(),delegateePk:h.string(),delegation:h.string()}).meta({className:"TSignature",unknownType:"any"});re.signatureSchema=Pa;const Hr=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],ns={id:h.string().custom(Dh),title:h.alternatives().try(h.string().min(1).max(Pe.MAX_TITLE_LENGTH),h.object().min(1).pattern(h.string().valid(...Hr),h.string().min(1).max(Pe.MAX_TITLE_LENGTH))).required(),description:h.alternatives().try(h.string().min(1).max(Pe.MAX_DESCRIPTION_LENGTH),h.object().min(1).pattern(h.string().valid(...Hr),h.string().min(1).max(Pe.MAX_DESCRIPTION_LENGTH))),link:h.alternatives().try(h.string().custom(ts),h.object().min(1).pattern(h.string().valid(...Hr),h.string().custom(ts))),component:h.string().min(1),section:h.array().items(h.string().min(1)).single(),role:h.array().items(h.string().min(1)).single(),icon:h.string().min(1),visible:h.boolean()},La=h.object({...ns,items:h.array().items(h.object({...ns}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});re.navigationItemSchema=La;const Ji=h.array().items(La).unique((e,t)=>e.id&&t.id?e.id===t.id:!1).meta({className:"TNavigation",unknownType:"any"});re.navigationSchema=Ji;const Zi=h.object({background:h.alternatives().try(h.string().min(1),h.object({header:h.string().min(1),footer:h.string().min(1),default:h.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});re.themeSchema=Zi;const _a=h.object({whoCanAccess:h.string().valid("owner","invited","all"),profileFields:h.array().items(h.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:h.array().items(h.string().min(1)),allowSwitchProfile:h.boolean(),blockUnauthenticated:h.boolean(),blockUnauthorized:h.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});re.authConfigSchema=_a;const Uh=h.object({type:h.string().trim().min(1).required(),description:h.string().trim().min(1)}),eo=h.object({did:h.DID().trim().required(),type:h.string().trim().min(1).required(),public:h.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});re.resourceBundleSchema=eo;const to=h.array().items(h.object({type:h.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:h.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});re.eventsSchema=to;const Na={did:h.DID().trim().required(),version:h.semver().valid().required(),name:h.string().optional(),description:Nr.required(),group:h.string().valid(...Pe.BLOCKLET_GROUPS),main:h.string().trim(),title:_r.optional().allow(""),logo:h.string().trim().optional(),specVersion:h.semver().valid().gte("1.0.0").optional(),author:er.optional(),contributors:h.array().items(er).optional(),maintainers:h.array().items(er).optional(),community:h.string().uri().optional().allow("").default(""),documentation:h.string().uri().optional().allow("").default(""),homepage:h.string().uri().optional().allow("").default(""),license:h.string().optional().allow("").default(""),support:h.alternatives().try(h.string().uri(),h.string().email({tlds:!1})).optional(),nftFactory:h.DID().optional().allow("").default(""),payment:h.object({price:h.array().max(1).items(h.object({value:h.number().greater(0).required(),address:h.DID().required()})).default([]),share:h.array().max(4).items(h.object({name:h.string().required(),address:h.DID().required(),value:h.number().greater(0).max(1).required()})).default([]).custom(e=>{if(e.length===0)return e;const t=e.reduce((n,r)=>n+r.value,0);if(t!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${t}`);return e},"invalid blocklet share"),componentPrice:h.array().items(h.object({parentPriceRange:h.array().items(h.number()).custom((e,t)=>e.length!==2?t.message("length of range should be 2"):e[0]<0?t.message("the first value should not less than 0 in range"):e[1]<=e[0]?t.message("the second value should greater than the first value in range"):e),type:h.string().valid("fixed","percentage").required(),value:h.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),tags:h.alternatives().try(h.string().trim().min(1),h.array().items(h.string().min(1))).optional(),gitHash:h.string().optional().allow(""),repository:h.alternatives().try(h.string().min(1),h.object({type:h.string().valid("git","https","svn").required(),url:h.string().uri().required(),directory:h.string()})).optional(),timeout:h.object({start:h.number().min(10).max(600),script:h.number().min(1).max(1800)}).default({start:60}),requirements:h.object({abtnode:h.semverRange().valid(),server:h.semverRange().valid(),os:h.alternatives().try(h.string().valid("*",...Pe.BLOCKLET_PLATFORMS),h.array().items(h.string().valid(...Pe.BLOCKLET_PLATFORMS)).min(1)),cpu:h.alternatives().try(h.string().valid("*",...Pe.BLOCKLET_ARCHITECTURES),h.array().items(h.string().valid(...Pe.BLOCKLET_ARCHITECTURES)).min(1)),fuels:h.array().items(h.object({endpoint:h.string().trim().required(),address:h.string().trim(),value:h.string().trim().required(),reason:h.string().trim().required()})),nodejs:h.semverRange().valid()}).default({server:Pe.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:h.array().items(Yi).unique("name").custom((e,t)=>{if(e.filter(i=>i.type===Pe.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return t.message(`Only one ${Pe.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const r=e.filter(i=>i.type===Pe.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const i of r)if(!i.prefix.startsWith(es))return t.message(`Wellknown path prefix must start with: ${es}`);return e}).default([]),environments:h.array().items(Gi).default([]).optional().custom((e,t)=>{if(e&&e.length){const n=e.filter((r,i)=>e.findIndex(s=>s.name===r.name)!==i);if(n.length)return t.message(`find duplicate environment names ${n.map(r=>r.name).join(", ")}`)}return e}),scripts:Hi,capabilities:h.object({clusterMode:h.boolean(),didSpace:h.string().valid(...Object.values(Pe.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:h.boolean().default(!0),serverless:h.boolean().optional(),component:h.boolean(),sitemap:h.boolean().optional(),mcp:h.boolean().optional()}).default({}),files:h.array().items(h.string().trim()).optional(),resource:h.object({exportApi:h.string().trim(),bundles:h.array().items(eo),types:h.array().items(Uh).max(10)}),engine:h.alternatives().try(fi,h.array().items(fi)).optional(),screenshots:h.array().items(h.string().min(1)).optional().default([]),videos:h.array().items(h.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:h.string().optional().allow(""),dist:rr.optional(),stats:Oa.optional(),htmlAst:h.any().optional(),path:h.string().optional(),signatures:h.array().items(Pa).optional(),lastPublishedAt:h.string().isoDate().optional().allow(null),components:Ca(),navigation:Ji,theme:Zi,copyright:h.object({owner:h.string().min(1),year:h.alternatives().try(h.string(),h.number())}),bundleName:h.string(),bundleDid:h.DID().trim(),storeId:h.string(),events:to.optional()},Wh=h.object(Na).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});re.blockletMetaSchema=Wh;const Aa=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,...a}={})=>((!e||!Oh.default.existsSync(e))&&(t=!1),h.object({...Na,owner:h.object({avatar:h.string().optional(),did:h.DID().trim().required(),fullName:h.string().trim().required(),email:h.string().optional().allow(null).empty("").default("")}).optional(),logo:t?h.file().trim().exists({baseDir:e}).optional():h.string().trim().optional(),files:h.array().items(t?h.file().exists({baseDir:e,canSkip:(c,f)=>[Pe.BLOCKLET_ENTRY_FILE,Pe.BLOCKLET_BUNDLE_FILE].includes(f)||(0,Ch.default)(f)}):h.string().trim()).optional(),dist:n?rr.required():rr.optional(),components:Ca({checkStore:r}),name:i?h.string().optional():h.string().required(),egress:h.boolean().optional().default(!0),docker:_h.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...a}).rename("children","components").custom((c,f)=>{const{did:v,name:l,docker:u}=c;if(u){const{image:b,dockerfile:w,network:j}=u;if(!b&&!w)return f.message("Image or dockerfile must be set");if(b&&w)return f.message("Image and dockerfile cannot be set at the same time");if(j)return f.message("ExportPorts and network cannot be set at the same time");w&&(c.files||(c.files=[]),c.files.push(w))}let k;if((0,Lh.isValid)(v))try{return(0,hi.validateNewDid)(v),c}catch(b){k=b}if(l){(0,hi.validateName)(l,{checkDid:!s});const b=(0,Nh.default)(l);return b!==v?f.message(`The did of name "${l}" should be "${b}"`):c}return k?f.message(k.message):c}));re.createBlockletSchema=Aa;re.default={blockletNameSchema:_n,componentSchema:Qi,endpointSchema:Xi,serviceSchema:Vi,createBlockletSchema:Aa,interfaceSchema:Yi,environmentSchema:Gi,environmentNameSchema:Ki,scriptsSchema:Hi,personSchema:er,distSchema:rr,titleSchema:_r,descriptionSchema:Nr,logoSchema:Sa,navigationSchema:Ji,themeSchema:Zi,mountPointSchema:qi,updateMountPointSchema:ja,authConfigSchema:_a,resourceBundleSchema:eo,installBlockletTitleSchema:wa,installBlockletDescriptionSchema:Ea,eventsSchema:to,Joi:h};var Et={},zh=Te&&Te.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Et,"__esModule",{value:!0});Et.setService=Et.findService=Et.getDefaultServiceConfig=Et.getServiceConfig=void 0;const qh=zh(au),Kh=re,Da={},no=e=>{Da[e.name]={validate:e.schema.validate.bind(e.schema),defaultConfig:e.default}};Et.setService=no;no({name:"auth",schema:Kh.authConfigSchema,default:{}});const Ma=e=>{if(!e)throw new Error("service name should not be empty");const t=Da[e];if(!t)throw new Error(`service ${e} does not exist`);return t},Fa=(e,t,{validate:n}={})=>{const r=Ma(e),i=(0,qh.default)(t||{}),{value:s,error:a}=r.validate(i);if(n&&a)throw new Error(`Invalid blocklet service config: ${a.details.map(c=>c.message).join(", ")}`);return s};Et.getServiceConfig=Fa;const Ba=e=>{const{defaultConfig:t}=Ma(e);return t};Et.getDefaultServiceConfig=Ba;const $a=(e,t)=>{const n=[t];return(e||[]).find(r=>n.includes(r.name))};Et.findService=$a;Et.default={getServiceConfig:Fa,getDefaultServiceConfig:Ba,findService:$a,setService:no};Object.defineProperty(bn,"__esModule",{value:!0});bn.fixAndValidateService=bn.validateMeta=void 0;const Gh=re,Hh=Et,Vh=e=>(!e.interfaces||!e.interfaces.length||e.interfaces.forEach(t=>{t.services&&t.services.length&&t.services.forEach(n=>{n.config=(0,Hh.getServiceConfig)(n.name,n.config,{validate:!0})})}),e);bn.fixAndValidateService=Vh;const Ua=(e,{ensureFiles:t=!1,ensureDist:n=!1,ensureComponentStore:r=!0,ensureName:i=!1,skipValidateDidName:s=!1,schemaOptions:a={}}={})=>{const c=(0,Gh.createBlockletSchema)(null,{ensureFiles:t,ensureDist:n,ensureComponentStore:r,ensureName:i,skipValidateDidName:s,...a}),{value:f,error:v}=c.validate(e);if(v)throw new Error(`Invalid blocklet meta: ${v.details.map(l=>l.message).join(", ")}`);return f};bn.validateMeta=Ua;bn.default=Ua;(function(e){var t=Te&&Te.__createBinding||(Object.create?function(T,F,V,$){$===void 0&&($=V);var le=Object.getOwnPropertyDescriptor(F,V);(!le||("get"in le?!F.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return F[V]}}),Object.defineProperty(T,$,le)}:function(T,F,V,$){$===void 0&&($=V),T[$]=F[V]}),n=Te&&Te.__setModuleDefault||(Object.create?function(T,F){Object.defineProperty(T,"default",{enumerable:!0,value:F})}:function(T,F){T.default=F}),r=Te&&Te.__importStar||function(){var T=function(F){return T=Object.getOwnPropertyNames||function(V){var $=[];for(var le in V)Object.prototype.hasOwnProperty.call(V,le)&&($[$.length]=le);return $},T(F)};return function(F){if(F&&F.__esModule)return F;var V={};if(F!=null)for(var $=T(F),le=0;le<$.length;le++)$[le]!=="default"&&t(V,F,$[le]);return n(V,F),V}}(),i=Te&&Te.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(e,"__esModule",{value:!0}),e.fixService=e.fixInterfaces=e.parsePerson=e.formatPerson=e.fixName=e.fixTags=e.fixPerson=e.fixKeywords=e.fixFiles=e.fixRepository=e.fixRequired=void 0;const s=i(Ac),a=r(qd),c=wt,f=bn;Object.defineProperty(e,"fixService",{enumerable:!0,get:function(){return f.fixAndValidateService}});const v=Wi,l=(T,F)=>{T.description||(T.description=`Blocklet from ${F}`),T.version||(T.version=c.BLOCKLET_DEFAULT_VERSION)};e.fixRequired=l;const u=T=>{if(T.repository&&(typeof T.repository=="string"&&(T.repository={type:"git",url:T.repository}),T.repository.url)){const F=a.fromUrl(T.repository.url);F&&(T.repository.url=F.getDefaultRepresentation()==="shortcut"?F.https():F.toString())}};e.fixRepository=u;const k=T=>{Array.isArray(T.files)?T.files&&(T.files=T.files.filter(F=>!(!F||typeof F!="string"))):delete T.files};e.fixFiles=k;const b=T=>{typeof T.keywords=="string"&&(T.keywords=T.keywords.split(/,\s+/)),T.keywords&&!Array.isArray(T.keywords)?delete T.keywords:T.keywords&&(T.keywords=T.keywords.filter(F=>!(typeof F!="string"||!F)))};e.fixKeywords=b;const w=T=>{typeof T.tags=="string"&&(T.tags=T.tags.split(/,\s+/)),T.tags&&!Array.isArray(T.tags)?delete T.tags:T.tags&&(T.tags=T.tags.filter(F=>!(typeof F!="string"||!F)))};e.fixTags=w;const j=(T,F)=>(T.author&&(T.author=F(T.author)),["maintainers","contributors"].forEach(V=>{Array.isArray(T[V])&&(T[V]=T[V].map(F))}),T),D=T=>{if(!T)return"";if(typeof T=="string")return T;const F=T.name||"",V=T.url||T.web,$=V?` (${V})`:"",le=T.email||T.mail,Q=le?` <${le}>`:"";return F+Q+$};e.formatPerson=D;const C=T=>{if(typeof T!="string")return T;const F=T.match(/^([^(<]+)/),V=T.match(/\(([^)]+)\)/),$=T.match(/<([^>]+)>/),le={};return F&&F[0].trim()&&(le.name=F[0].trim()),$&&([,le.email]=$),V&&([,le.url]=V),le};e.parsePerson=C;const M=T=>(j(T,D),j(T,C),T);e.fixPerson=M;const K=(T,F=!0)=>{if(Array.isArray(T.interfaces)||(T.interfaces=[]),T.interfaces.length)return T.interfaces.forEach(Q=>{Q.type===c.BLOCKLET_INTERFACE_TYPE_WEB&&(Q.protocol="http")}),T;const $=(0,s.default)(T,"capabilities.dynamicPathPrefix",!0)?c.BLOCKLET_DYNAMIC_PATH_PREFIX:"/",le=({type:Q="web",name:Oe,path:oe="/",protocol:Xe="http",port:_e=c.BLOCKLET_DEFAULT_PORT_NAME})=>{T.interfaces.push({type:Q,name:Oe,path:oe,prefix:$,port:_e,protocol:Xe})};return[c.BLOCKLET_INTERFACE_PUBLIC].forEach(Q=>{T[Q]&&le({name:Q,path:T[Q]})}),Array.isArray(T.exposeServices)&&T.exposeServices.forEach(Q=>{le({type:"service",name:Q.protocol,protocol:Q.protocol,port:{internal:`BLOCKLET_${Q.protocol}_PORT`.toUpperCase(),external:Q.port}})}),F&&(delete T.publicUrl,delete T.adminUrl,delete T.configUrl,delete T.docUrl,delete T.exposeServices,T.capabilities&&delete T.capabilities.dynamicPathPrefix),T};e.fixInterfaces=K;const G=T=>{const{did:F}=T;try{(0,v.validateNewDid)(F),T.name=F}catch{}return T};e.fixName=G,e.default={fixRequired:l,fixRepository:u,fixFiles:k,fixKeywords:b,fixPerson:M,fixTags:w,fixName:G,formatPerson:D,parsePerson:C,fixInterfaces:K,fixService:f.fixAndValidateService}})(aa);function Wa({owner:e,locale:t}){return o.jsxs(Y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.fullName,e.did?o.jsx($s,{sx:{lineHeight:"initial","&::before":{content:'"("'},"&::after":{content:'")"'}},did:e.did,compact:!0,size:14,locale:t}):null]})}Wa.propTypes={owner:_.object.isRequired,locale:_.string.isRequired};const Xh="install-blocklet-from-URL",za=()=>{const[e,t]=Li(Xh,"[]",{raw:!0}),n=i=>{const s=i.trim(),a=JSON.parse(e),c=a.findIndex(f=>f===s);c!==0&&(c>0&&a.splice(c,1),a.length>=10&&a.splice(9),a.unshift(s),t(JSON.stringify(a)))},r=i=>{if(!i)return;const s=JSON.parse(e),a=i.trim(),c=s.findIndex(f=>f===a);c>-1&&(s.splice(c,1),t(JSON.stringify(s)))};return{urls:e?JSON.parse(e):[],addUrlRecord:n,removeUrlRecord:r}},Yh=Is(()=>({listItemText:{"& span":{display:"block",width:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}}));function ro(e){const{value:t,onValueChange:n,children:r,helperText:i}=e,{urls:s,removeUrlRecord:a}=za(),c=(v,l)=>{v.preventDefault(),v.stopPropagation(),a(l)},f=Yh();return o.jsxs(Y,{children:[o.jsx(Rs,{freeSolo:!0,options:s,inputValue:t,onInputChange:(v,l)=>{n(l)},disableClearable:!0,popupIcon:null,renderInput:v=>Wt.cloneElement(r,{...v}),renderOption:(v,l)=>A.createElement(Cs,{...v,key:l,secondaryAction:o.jsx(Os,{edge:"end","aria-label":"delete",onClick:u=>c(u,l),children:o.jsx(ic,{})})},o.jsx(Pl,{role:void 0,dense:!0,sx:{paddingLeft:0,paddingRight:30,"&:hover":{backgroundColor:"transparent"}},children:o.jsx(Ps,{primary:l,className:f.listItemText})})),ListboxProps:{sx:{maxHeight:300,overflow:"auto"}}}),o.jsx(Ll,{style:{margin:0},children:i})]})}ro.propTypes={onValueChange:_.func,children:_.node,value:_.string,helperText:_.string};ro.defaultProps={onValueChange:()=>{},children:null,value:"",helperText:""};function qa({onClick:e}){const{t}=gt();return o.jsx(oc,{title:t("launchBlocklet.withoutWallet"),icon:o.jsx(pt,{icon:sc,fontSize:"1em"}),onClick:e})}qa.propTypes={onClick:_.func.isRequired};function io({defaultUrl:e,onCancel:t,onSuccess:n,onError:r,mode:i,handleText:s}){const{api:a}=Nn(),{api:c,session:f}=lu(),[v,l]=A.useState(!1),[u,k]=A.useState(""),{t:b,locale:w}=gt(),j={dist:{}},{encryptKey:D}=ac(),[C,M]=A.useState(e),[K,G]=A.useState(e?1:0),[T,F]=A.useState(j),[V,$]=A.useState(!1),[le,Q]=A.useState(""),[Oe]=Li("instant-blocklet-install",!1),[oe,Xe]=A.useState({}),_e=i==="component",Ye=_e?!0:!e,{addUrlRecord:ie}=za(),he=A.useMemo(()=>{var de;return(((de=f.user)==null?void 0:de.connectedAccounts)||[]).some(Ee=>Ee.provider===wt.LOGIN_PROVIDER.WALLET)},[f.user]),Fe=async()=>{F(j),k(null),l(!0);let H=C.trim();!H.startsWith("https://")&&!H.startsWith("http://")&&!H.startsWith("file://")&&(H=`file://${H}`);try{const be=decodeURIComponent(H);try{new URL(be)}catch{throw new Error("Invalid URL")}const{meta:de,inStore:Ee,registryUrl:tn}=await a.getBlockletMetaFromUrl({input:{url:be}});F(de),Xe({inStore:Ee,registryUrl:tn,inputUrl:H}),ie(H)}catch(be){console.error(be);const de=`Blocklet Install failed: ${ci(be)}`;k(de),r(be)}finally{l(!1)}},X=()=>{var be;if(_e){n({meta:T,...oe}),t();return}if(Oe){l(!0),$(!0);return}const H=vn(((be=window==null?void 0:window.env)==null?void 0:be.apiPrefix)??"/","/launch-blocklet/install");window.location.href=Ir(H,{blocklet_meta_url:decodeURIComponent(C.trim()),from:"url"})},Be=()=>{l(!1),$(!1),n({meta:T,...oe}),t()},Ne=()=>{l(!1),$(!1)};A.useEffect(()=>{e&&Fe()},[e]);const ct=A.useMemo(()=>({title:T.title,wt:Dc(T),blockletMetaUrl:decodeURIComponent(C.trim())}),[T,C]),ve=A.useCallback(async()=>{var de;if(he||Oe){Q("");return}const H=new URL(window.location.href);H.pathname=vn(((de=window==null?void 0:window.env)==null?void 0:de.apiPrefix)??"/","/api/did/launch-free-blocklet-by-session/token"),H.searchParams.set("_ek_",D),Object.keys(ct).forEach(Ee=>{H.searchParams.set(Ee,ct[Ee])});const{data:be}=await c.get(H.href);be.url?Q(be.url):Q("")},[he,ct,c,D,Oe]);A.useEffect(()=>{ve()},[ve]);const Ze=A.useMemo(()=>he&&le?{...ct,nw:le,skipMigrateAccount:!0}:ct,[ct,le,he]),ut=[{name:b("common.name"),value:Ut.getDisplayName({meta:T},!0)},{name:b("common.version"),value:T.version},{name:b("common.did"),value:T.did?o.jsx(cu,{did:T.did}):null},{name:b("common.author"),value:T.owner?o.jsx(Wa,{owner:T.owner,locale:w}):aa.formatPerson(T.author)},{name:b("blocklet.dist.downloadLink"),value:T.dist.tarball}],zt=()=>v?o.jsx("div",{style:{height:200,width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:o.jsx(St,{})}):T.did?o.jsx("div",{style:{paddingLeft:"10%"},children:ut.map(H=>H.name===b("common.did")?o.jsx(Ao,{valueComponent:"div",nameWidth:120,name:H.name,nameFormatter:()=>b("common.did"),children:H.value},H.name):o.jsx(Ao,{valueComponent:"div",nameWidth:120,name:H.name,children:H.value},H.name))}):null,Tt=nu(async()=>{let H=T.title;f.user&&(H=`${f.user.fullName}'s ${T.title}`);try{Be(),await a.launchBlockletWithoutWallet({input:{title:H,blockletMetaUrl:decodeURIComponent(C.trim()),type:"store",storeUrl:oe.registryUrl,onlyRequired:!0}})}catch(be){console.error("launchBlockletWithoutWallet error:",be),kr.error(ci(be),{autoHideDuration:3e3})}}),yt=[{label:b("blocklet.fromUrl.step0"),body:o.jsx(ge,{component:"div",children:o.jsx(ro,{style:{marginBottom:32},value:C,helperText:b("blocklet.fromUrl.description"),onValueChange:H=>{k(null),M(H)},children:o.jsx(Tr,{label:b("blocklet.fromUrl.label"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"blocklet-url-input",fullWidth:!0,autoFocus:!0,margin:"dense",value:C,onChange:H=>{k(null),M(H.target.value)},disabled:v,onKeyPress:H=>{H.key==="Enter"&&(H.preventDefault(),Fe(),G(1))}})})}),cancel:b("common.cancel"),confirm:b("common.next"),onCancel:t,onConfirm:()=>{Fe(),G(1)}},{label:b("blocklet.fromUrl.step1"),body:zt(),cancel:b(Ye?"common.pre":"common.cancel"),confirm:(s==null?void 0:s.confirm)||b("blocklet.fromUrl.confirm"),onCancel:()=>{Ye?G(H=>H-1):t()},onConfirm:()=>{X()}}],qe=yt[K];return o.jsxs(o.Fragment,{children:[o.jsxs(Pi,{title:(s==null?void 0:s.title)||b("blocklet.fromUrl.title"),fullWidth:!0,maxWidth:"md",onClose:()=>qe.onCancel(),showCloseButton:K===0,disableEscapeKeyDown:!0,open:!0,actions:o.jsxs(o.Fragment,{children:[qe.cancel&&o.jsx(ft,{onClick:H=>{H.stopPropagation(),k(null),qe.onCancel()},color:"inherit",children:qe.cancel||b("common.cancel")}),o.jsxs(ft,{onClick:H=>{H.stopPropagation(),qe.onConfirm()},color:"primary","data-cy":"install-blocklet-next-step",disabled:v||!C||u,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[v&&K===0&&o.jsx(St,{size:16}),qe.confirm]})]}),children:[Ye&&o.jsx(_l,{alternativeLabel:!0,activeStep:K,children:yt.map(({label:H})=>o.jsx(Nl,{children:o.jsx(Al,{children:H})},H))}),o.jsx(Dl,{component:"div",style:{marginTop:24},children:qe.body}),!!u&&o.jsx(Ls,{severity:"error",style:{width:"100%",marginTop:8},children:u})]}),T&&V&&o.jsx(Ws,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:!he&&!Oe?"bind-wallet":"launch-free-blocklet-by-session",checkFn:c.get,checkTimeout:5*60*1e3,onSuccess:Be,extraParams:Ze,messages:{title:b("setup.keyPair.title"),scan:b("setup.keyPair.scan"),confirm:b("setup.keyPair.confirm"),success:b("setup.keyPair.success")},onClose:Ne,customItems:Oe?[]:[o.jsx(qa,{onClick:Tt})]})]})}io.propTypes={defaultUrl:_.string,onCancel:_.func.isRequired,onSuccess:_.func.isRequired,onError:_.func,mode:_.oneOf(["install","component"]),handleText:_.object};io.defaultProps={onError:()=>{},defaultUrl:"",mode:"install",handleText:{}};const Qh={meta:_.object.isRequired,onCancel:_.func.isRequired},Jh=Is(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function Ka({action:e,onSelect:t,onNext:n}){const r=Jh(),{t:i}=gt(),s=[{action:"purchase",title:i("store.purchase.purchase.title"),description:i("store.purchase.purchase.description")},{action:"verify",title:i("store.purchase.verify.title"),description:i("store.purchase.verify.description")}];return o.jsxs(o.Fragment,{children:[o.jsx(Ml,{className:r.tabPanel,children:s.map(a=>o.jsxs(Cs,{button:!0,selected:e===a.action,onClick:()=>t(a.action),children:[o.jsx(Fl,{className:r.iconRoot,children:a.action==="purchase"?o.jsx(uu,{style:{color:e==="purchase"?Ro.primary.main:"#AAA",fontSize:32}}):o.jsx(du,{style:{color:e==="verify"?Ro.primary.main:"#AAA",fontSize:32}})}),o.jsx(Ps,{primary:a.title,secondary:a.description})]},a.action))}),n&&o.jsx(ft,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:n,children:i("common.next")})]})}Ka.propTypes={action:_.oneOf(["both","purchase","verify"]).isRequired,onSelect:_.func.isRequired,onNext:_.func.isRequired};function oo({meta:e,onCancel:t,mode:n,handlePaySuccess:r}){const{t:i,locale:s}=gt(),{info:a}=Nn(),c=Mc(a),[f,v]=A.useState(null),l=new URL(e==null?void 0:e.registryUrl).origin,u=Ut.getDisplayName({meta:e}),k=async(w,j)=>{const D=({downloadTokenList:K})=>{r({downloadTokenList:K})},C=K=>{kr.error(K),t(K)};function M(K){return lc(()=>Do.get(K).then(async({data:G})=>{const T=G==null?void 0:G.downloadTokenList;if(G.status==="succeed"){if(T&&T.length)await D({downloadTokenList:T});else return await C(i("blocklet.component.missDownloadTokenTip")),!0;return!0}return G.status==="error"?(console.error("vc error: ",G),await C(G==null?void 0:G.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&f){const{statusUrl:K}=Fc(f);await M(K)}else await D({downloadTokenList:w.downloadTokenList&&j(w.downloadTokenList)})};if(A.useEffect(()=>{if(n==="purchase"){const w=new URL(l);w.pathname="/api/did/verify-purchase-blocklet/token",w.searchParams.set("serverDid",a.did),w.searchParams.set("blockletDid",e==null?void 0:e.did);try{Do.get(w.href).then(({data:j})=>{const D=`${j.url}`;v(D)})}catch(j){console.error("get next workflow url error: ",j)}}return()=>{v(null)}},[n]),n==="purchase"&&!f)return"";const b={verify:{action:"verify-purchase-blocklet",checkFn:_o.create({baseURL:l}).get,extraParams:{serverDid:a.did,blockletDid:e==null?void 0:e.did},messages:{title:i("store.purchase.verify.auth.title",{name:u}),scan:i("store.purchase.verify.auth.scan"),confirm:i("store.purchase.verify.auth.confirm"),success:i("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:_o.create({baseURL:vn(l,"/store")}).get,extraParams:{factory:e.nftFactory,nw:f},messages:{title:i("store.purchase.auth.title",{name:u}),scan:i("store.purchase.auth.scan"),confirm:i("store.purchase.auth.confirm"),success:o.jsxs(o.Fragment,{children:[o.jsx("p",{children:i("store.purchase.auth.success")}),o.jsx("p",{children:i("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return o.jsx(Ws,{open:!0,locale:s,popup:!1,saveConnect:!1,className:"connect",baseUrl:l,onSuccess:k,cancelWhenScanned:t,onClose:t,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...b[n]})}oo.propTypes={...Qh,handlePaySuccess:_.func,mode:_.oneOf(["verify","purchase"]).isRequired};oo.defaultProps={handlePaySuccess:()=>{}};const so=A.forwardRef(({mode:e,...t},n)=>{const[r,i]=A.useState(e!=="both"?e:"verify"),[s,a]=A.useState(e!=="both"?2:1),c=v=>{v!==r&&i(v)},f=()=>{r&&s!==2&&a(2)};return A.useImperativeHandle(n,()=>({onNext:f,getCurrentStep:()=>s})),s===1?o.jsx("div",{style:{maxWidth:520},children:o.jsx(Ka,{action:r,onNext:null,onSelect:c})}):o.jsx(oo,{...t,mode:r})});so.propTypes={mode:_.oneOf(["both","verify","purchase"]).isRequired,ref:_.any};so.defaultProps={ref:{}};const Zh=so;function ef({...e}){return o.jsx(ft,{className:"bottom-button",variant:"contained",color:"primary",...e})}function ao({blocklet:e,onStartNow:t,children:n,disabled:r}){const{t:i}=gt(),s=Js();return!e||Bc(e.meta)?o.jsx(tf,{children:n}):o.jsxs(nf,{isMobile:s,children:[o.jsx(ef,{className:"start-now",variant:"contained",color:"primary",disabled:r,onClick:()=>t(),children:i("setup.startNow")}),o.jsx(Y,{display:"flex",alignItems:"center",children:n})]})}ao.propTypes={blocklet:_.object,onStartNow:_.func,children:_.any,disabled:_.bool};ao.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const tf=Ve(Y)`
|
|
217
|
+
width: 100%;
|
|
218
|
+
margin-top: auto;
|
|
219
|
+
padding-top: 24px;
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: center;
|
|
222
|
+
justify-content: center;
|
|
223
|
+
.bottom-button {
|
|
224
|
+
min-width: 200px;
|
|
225
|
+
}
|
|
226
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
227
|
+
.bottom-button {
|
|
228
|
+
width: 100%;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`,nf=Ve(Y)`
|
|
232
|
+
padding-top: 24px;
|
|
233
|
+
margin-top: auto;
|
|
234
|
+
width: 100%;
|
|
235
|
+
display: flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
justify-content: space-between;
|
|
238
|
+
.start-now {
|
|
239
|
+
min-width: 140px;
|
|
240
|
+
}
|
|
241
|
+
.bottom-button {
|
|
242
|
+
min-width: 120px;
|
|
243
|
+
}
|
|
244
|
+
${e=>e.theme.breakpoints.down("lg")} {
|
|
245
|
+
width: 100%;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
249
|
+
.start-now {
|
|
250
|
+
min-width: inherit;
|
|
251
|
+
}
|
|
252
|
+
.bottom-button {
|
|
253
|
+
min-width: 100px;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
${e=>e.isMobile} {
|
|
258
|
+
justify-content: space-between;
|
|
259
|
+
gap: '32px',
|
|
260
|
+
}}
|
|
261
|
+
`;function lo({blockletMeta:e,onEndpointUpdate:t}){var c;const n=Js(),{blocklet:r}=Rr(),{updateSpaceGateway:i,loading:s,hasStorageEndpoint:a}=Kc();return A.useEffect(()=>{t==null||t()},[r]),s?o.jsx(cc,{relative:"parent",children:o.jsx(St,{})}):o.jsxs(rf,{children:[o.jsx(Y,{width:n?"360px":"720px",children:a?o.jsx(mu,{}):o.jsx(gu,{})}),((c=e==null?void 0:e.capabilities)==null?void 0:c.didSpace)==="required"&&o.jsx(ao,{mt:8,children:o.jsx(vu,{onConnect:i})})]})}lo.propTypes={blockletMeta:_.any.isRequired,onEndpointUpdate:Bl.func};lo.defaultProps={onEndpointUpdate:()=>{}};const rf=Ve(pu)`
|
|
262
|
+
height: 100%;
|
|
263
|
+
overflow-y: auto;
|
|
264
|
+
padding-bottom: 32px;
|
|
265
|
+
overflow-x: hidden;
|
|
266
|
+
`;function co({onChange:e,loading:t,children:n,extra:r,stores:i,storageKey:s}){const{t:a}=gt(),{info:c,inService:f}=Nn(),{blocklet:v}=Rr(),[l,u]=A.useState(!1),k=A.useRef(null),[b,w]=A.useState(),[j,D]=Li(s||"tmp"),[C,M]=s?[j,D]:[b,w],{storeList:K,teamDid:G}=Xs({fromBlocklet:f,blocklet:v,nodeInfo:c}),T=Vs([...i.map(V=>({...V,protected:!0})),...K],"url"),F=C&&T.find(V=>C===V.url)||T[0];return o.jsxs(o.Fragment,{children:[o.jsxs(of,{children:[o.jsx(ft,{ref:k,color:"primary","data-cy":"add-component-select-store",endIcon:o.jsx(yu,{color:"primary"}),onClick:()=>{u(!0)},style:{padding:"0 2px"},children:o.jsx(ge,{color:"primary",children:F.name})}),o.jsx(ge,{color:"primary",children:r})]}),o.jsxs(Tr,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:a("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:F,autoFocus:!0,onChange:V=>{const $=V.target.value;M($.url),e($)},SelectProps:{open:l,MenuProps:{anchorEl:k.current},renderValue:V=>V==null?void 0:V.name,onClose:()=>{u(!1)}},style:{display:"none"},margin:"normal",children:[T==null?void 0:T.map(V=>o.jsx(Ii,{sx:{width:"400px",maxWidth:"90vw"},value:V,"data-cy":V.url,children:o.jsx(Zl,{teamDid:G,store:V,onDelete:()=>{var $;C===V.url&&M(($=T[0])==null?void 0:$.url)}})},V.url)),!Bs.isInServerlessMode(c)&&o.jsx(ec,{disabled:t,storeList:T,teamDid:G,onAdd:V=>{M(V)}})]}),n({currentRegistry:F})]})}co.propTypes={onChange:_.func,loading:_.bool,children:_.any.isRequired,extra:_.node,storageKey:_.string,stores:_.arrayOf(_.shape({name:_.string.isRequired,url:_.string.isRequired}))};co.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const of=Ve.div`
|
|
267
|
+
display: flex;
|
|
268
|
+
justify-content: space-between;
|
|
269
|
+
align-items: center;
|
|
270
|
+
margin-bottom: 16px;
|
|
271
|
+
|
|
272
|
+
span {
|
|
273
|
+
font-size: 16px;
|
|
274
|
+
color: ${e=>e.theme.palette.text.primary};
|
|
275
|
+
// font-weight: bold;
|
|
276
|
+
}
|
|
277
|
+
`,sf=en("div")`
|
|
278
|
+
background-color: transparent !important;
|
|
279
|
+
& > :not(.Mui-disabled) {
|
|
280
|
+
position: relative;
|
|
281
|
+
z-index: 1;
|
|
282
|
+
&::before {
|
|
283
|
+
content: '';
|
|
284
|
+
position: absolute;
|
|
285
|
+
height: 100%;
|
|
286
|
+
width: 100%;
|
|
287
|
+
left: 0;
|
|
288
|
+
top: 0;
|
|
289
|
+
transition: opacity 0.3s;
|
|
290
|
+
}
|
|
291
|
+
&:hover::before {
|
|
292
|
+
opacity: 0;
|
|
293
|
+
}
|
|
294
|
+
&::after {
|
|
295
|
+
content: '';
|
|
296
|
+
position: absolute;
|
|
297
|
+
height: 100%;
|
|
298
|
+
width: 100%;
|
|
299
|
+
top: 0;
|
|
300
|
+
left: 0;
|
|
301
|
+
border-radius: 2px;
|
|
302
|
+
background-color: ${e=>e.theme.palette.primary.main};
|
|
303
|
+
transform: scale(0.1);
|
|
304
|
+
opacity: 0;
|
|
305
|
+
z-index: -1;
|
|
306
|
+
transition:
|
|
307
|
+
transform 0.3s,
|
|
308
|
+
opacity 0.3s,
|
|
309
|
+
background-color 0.3s;
|
|
310
|
+
}
|
|
311
|
+
&:hover::after {
|
|
312
|
+
opacity: 1;
|
|
313
|
+
transform-origin: center;
|
|
314
|
+
transform: scale(1);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
& > :not(.Mui-disabled) {
|
|
318
|
+
background-color: transparent !important;
|
|
319
|
+
color: ${e=>e.theme.palette.primary.main}!important;
|
|
320
|
+
}
|
|
321
|
+
& > :not(.Mui-disabled) {
|
|
322
|
+
&:hover {
|
|
323
|
+
color: ${e=>e.theme.palette.common.white}!important;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
`;en("div")`
|
|
327
|
+
&.arcblock-blocklet {
|
|
328
|
+
padding: ${e=>e.theme.spacing(2)} ${e=>e.theme.spacing(2)} 0
|
|
329
|
+
${e=>e.theme.spacing(2)};
|
|
330
|
+
}
|
|
331
|
+
.arcblock-blocklet__content {
|
|
332
|
+
cursor: pointer;
|
|
333
|
+
display: flex;
|
|
334
|
+
${e=>e.theme.breakpoints.up("sm")} {
|
|
335
|
+
align-items: center;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
.arcblock-blocklet__cover {
|
|
339
|
+
width: 64px;
|
|
340
|
+
height: 64px;
|
|
341
|
+
margin-right: ${e=>e.theme.spacing(2)};
|
|
342
|
+
overflow: hidden;
|
|
343
|
+
border-radius: 12px;
|
|
344
|
+
/* see: https://stackoverflow.com/questions/49066011/overflow-hidden-with-border-radius-not-working-on-safari */
|
|
345
|
+
transform: translateZ(0);
|
|
346
|
+
${e=>e.theme.breakpoints.up("sm")} {
|
|
347
|
+
width: 80px;
|
|
348
|
+
height: 80px;
|
|
349
|
+
margin-bottom: 12px;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
.arcblock-blocklet__button--hover {
|
|
353
|
+
&:not(.Mui-disabled) {
|
|
354
|
+
position: relative;
|
|
355
|
+
z-index: 1;
|
|
356
|
+
&::before {
|
|
357
|
+
content: '';
|
|
358
|
+
position: absolute;
|
|
359
|
+
height: 100%;
|
|
360
|
+
width: 100%;
|
|
361
|
+
left: 0;
|
|
362
|
+
top: 0;
|
|
363
|
+
transition: opacity 0.3s;
|
|
364
|
+
}
|
|
365
|
+
&:hover::before {
|
|
366
|
+
opacity: 0;
|
|
367
|
+
}
|
|
368
|
+
&::after {
|
|
369
|
+
content: '';
|
|
370
|
+
position: absolute;
|
|
371
|
+
height: 100%;
|
|
372
|
+
width: 100%;
|
|
373
|
+
background-color: ${e=>e.theme.palette.primary.main};
|
|
374
|
+
transform: scale(0.1);
|
|
375
|
+
opacity: 0;
|
|
376
|
+
z-index: -1;
|
|
377
|
+
transition:
|
|
378
|
+
transform 0.3s,
|
|
379
|
+
opacity 0.3s,
|
|
380
|
+
background-color 0.3s;
|
|
381
|
+
}
|
|
382
|
+
&:hover::after {
|
|
383
|
+
opacity: 1;
|
|
384
|
+
transform-origin: center;
|
|
385
|
+
transform: scale(1);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
&:not(.Mui-disabled) {
|
|
390
|
+
background-color: transparent !important;
|
|
391
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
392
|
+
}
|
|
393
|
+
&:not(.Mui-disabled) {
|
|
394
|
+
&:hover {
|
|
395
|
+
color: ${e=>e.theme.palette.common.white};
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
.arcblock-blocklet__info {
|
|
400
|
+
flex: 1;
|
|
401
|
+
overflow: hidden;
|
|
402
|
+
border-bottom: 1px solid ${e=>e.theme.palette.divider};
|
|
403
|
+
padding-bottom: ${e=>e.theme.spacing(2)};
|
|
404
|
+
}
|
|
405
|
+
.arcblock-blocklet__text {
|
|
406
|
+
height: 65px;
|
|
407
|
+
overflow: hidden;
|
|
408
|
+
}
|
|
409
|
+
/* 设置多行文本溢出显示省略号 兼容fireFox、safari */
|
|
410
|
+
.arcblock-blocklet__title {
|
|
411
|
+
margin: 0;
|
|
412
|
+
font-size: 16px;
|
|
413
|
+
font-weight: 500;
|
|
414
|
+
overflow: hidden;
|
|
415
|
+
text-overflow: ellipsis;
|
|
416
|
+
white-space: nowrap;
|
|
417
|
+
}
|
|
418
|
+
.arcblock-blocklet__describe {
|
|
419
|
+
margin-top: ${e=>e.theme.spacing(.5)};
|
|
420
|
+
color: ${e=>e.theme.palette.grey[600]};
|
|
421
|
+
font-size: 14px;
|
|
422
|
+
font-weight: 500;
|
|
423
|
+
line-height: 17px;
|
|
424
|
+
max-height: 34px;
|
|
425
|
+
overflow: hidden;
|
|
426
|
+
text-overflow: ellipsis;
|
|
427
|
+
display: -webkit-box;
|
|
428
|
+
-webkit-line-clamp: 2;
|
|
429
|
+
-webkit-box-orient: vertical;
|
|
430
|
+
word-break: break-word;
|
|
431
|
+
}
|
|
432
|
+
.arcblock-blocklet__version {
|
|
433
|
+
color: ${e=>e.theme.palette.grey[600]};
|
|
434
|
+
font-size: 12px;
|
|
435
|
+
}
|
|
436
|
+
`;_.string||_.node,_.string,_.string||_.node,_.string,_.string,_.bool,_.bool,_.element,_.string,_.func,_.func,_.string;en("div")`
|
|
437
|
+
background-color: transparent !important;
|
|
438
|
+
& > :not(.Mui-disabled) {
|
|
439
|
+
position: relative;
|
|
440
|
+
z-index: 1;
|
|
441
|
+
&::before {
|
|
442
|
+
content: '';
|
|
443
|
+
position: absolute;
|
|
444
|
+
height: 100%;
|
|
445
|
+
width: 100%;
|
|
446
|
+
left: 0;
|
|
447
|
+
top: 0;
|
|
448
|
+
transition: opacity 0.3s;
|
|
449
|
+
}
|
|
450
|
+
&:hover::before {
|
|
451
|
+
opacity: 0;
|
|
452
|
+
}
|
|
453
|
+
&::after {
|
|
454
|
+
content: '';
|
|
455
|
+
position: absolute;
|
|
456
|
+
height: 100%;
|
|
457
|
+
width: 100%;
|
|
458
|
+
top: 0;
|
|
459
|
+
left: 0;
|
|
460
|
+
border-radius: 2px;
|
|
461
|
+
background-color: ${e=>e.theme.palette.primary.main};
|
|
462
|
+
transform: scale(0.1);
|
|
463
|
+
opacity: 0;
|
|
464
|
+
z-index: -1;
|
|
465
|
+
transition:
|
|
466
|
+
transform 0.3s,
|
|
467
|
+
opacity 0.3s,
|
|
468
|
+
background-color 0.3s;
|
|
469
|
+
}
|
|
470
|
+
&:hover::after {
|
|
471
|
+
opacity: 1;
|
|
472
|
+
transform-origin: center;
|
|
473
|
+
transform: scale(1);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
& > :not(.Mui-disabled) {
|
|
477
|
+
background-color: transparent !important;
|
|
478
|
+
color: ${e=>e.theme.palette.primary.main}!important;
|
|
479
|
+
}
|
|
480
|
+
& > :not(.Mui-disabled) {
|
|
481
|
+
&:hover {
|
|
482
|
+
color: ${e=>e.theme.palette.common.white}!important;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
`;const rs=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),af=(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`},Ga={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 pi({title:e,sx:t,children:n,slotProps:r,fontSize:i=12,fontWeight:s=500,color:a="text.contrast",...c}){var f,v;return e?o.jsx(_s,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${$l.tooltip}`]:{fontSize:i,fontWeight:s,boxShadow:2,marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:a,display:"flex",alignItems:"center"}},...Array.isArray((f=r==null?void 0:r.popper)==null?void 0:f.sx)?r.popper.sx:[(v=r==null?void 0:r.popper)==null?void 0:v.sx]]}},children:n}):n}function dr({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(i)?i:[i]],children:[e,o.jsx(pi,{title:r||(typeof t=="string"?t:""),children:o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function lf(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:v="Install",buttonDisabled:l,buttonLoading:u,button:k,onButtonClick:b=()=>{},onMainClick:w,className:j,ref:D,icons:C,status:M,...K}=e,G=Zt(),T=(Q,Oe=()=>!1)=>(oe,...Xe)=>{const _e=Q instanceof Function;(Oe()||_e)&&(oe.preventDefault(),oe.stopPropagation(),_e&&Q(...Xe))},F=w&&T(w),V=T(b,()=>!!(k||l||u)),$=A.isValidElement(t)?{children:t}:{title:rs(t),dangerouslySetInnerHTML:{__html:t}},le=A.isValidElement(n)?{children:n}:{title:rs(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Ul,{variant:"outlined",onClick:F,...K,sx:{p:{xs:2,md:3},borderRadius:1,...K.sx},children:[o.jsxs(rt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(xr,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...$}),o.jsxs(Y,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[f&&o.jsx(pi,{title:f.tooltip,children:o.jsx(gc,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),C==null?void 0:C.map(Q=>o.jsx(pi,{title:Q.title,children:typeof Q.icon=="string"?o.jsx(pt,{icon:Q.icon,style:{color:Q.color}}):Q.icon},Q.key))]}),b&&o.jsxs(ft,{variant:"outlined",size:"small",disabled:l||u,style:{color:G.palette.text.primary,borderColor:G.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:G.typography.fontWeightMedium},onClick:V,children:[u&&o.jsx(St,{size:15,style:{marginRight:3,color:"inherit"}}),v]}),k]}),o.jsx(rt,{py:2,children:o.jsx(ge,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...le})}),o.jsxs(rt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(dr,{icon:o.jsx(xr,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(dr,{icon:o.jsx(pt,{icon:Ga}),title:a,children:af(a)}),M==null?void 0:M.filter(Q=>Q.align!=="right").map(Q=>o.jsx(dr,{icon:typeof Q.icon=="string"?o.jsx(pt,{icon:Q.icon}):Q.icon,title:Q.title,maxWidth:Q.maxWidth,children:Q.text},Q.key)),o.jsx(Y,{sx:{flex:1}}),M==null?void 0:M.filter(Q=>Q.align==="right").map(Q=>o.jsx(dr,{icon:typeof Q.icon=="string"?o.jsx(pt,{icon:Q.icon}):Q.icon,title:Q.title,maxWidth:Q.maxWidth,sx:{color:Q.color},children:Q.text},Q.key))]})]})}const cf={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>'},tr=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ar=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),f=i.pop(),v={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!yr(v)?null:v}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!yr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!yr(c,n)?null:c}return null},yr=(e,t)=>e?!!((e.provider===""||e.provider.match(tr))&&(t&&e.prefix===""||e.prefix.match(tr))&&e.name.match(tr)):!1,Ha=Object.freeze({left:0,top:0,width:16,height:16}),Er=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),uo=Object.freeze({...Ha,...Er}),mi=Object.freeze({...uo,body:"",hidden:!1});function uf(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function is(e,t){const n=uf(e,t);for(const r in mi)r in Er?r in e&&!(r in n)&&(n[r]=Er[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function df(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,f=c&&s(c);f&&(i[a]=[c].concat(f))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function hf(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=is(r[c]||i[c],s)}return a(t),n.forEach(a),is(e,s)}function Va(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=df(e);for(const i in r){const s=r[i];s&&(t(i,hf(e,i,s)),n.push(i))}return n}const ff={provider:"",aliases:{},not_found:{},...Ha};function Vr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Xa(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Vr(e,ff))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(tr)||typeof s.body!="string"||!Vr(s,mi))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(tr)||typeof a!="string"||!n[a]&&!r[a]||!Vr(s,mi))return null}return t}const os=Object.create(null);function pf(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function wn(e,t){const n=os[e]||(os[e]=Object.create(null));return n[t]||(n[t]=pf(e,t))}function ho(e,t){return Xa(t)?Va(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function mf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let ir=!1;function Ya(e){return typeof e=="boolean"&&(ir=e),ir}function gf(e){const t=typeof e=="string"?Ar(e,!0,ir):e;if(t){const n=wn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function vf(e,t){const n=Ar(e,!0,ir);if(!n)return!1;const r=wn(n.provider,n.prefix);return mf(r,n.name,t)}function yf(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ir&&!t&&!e.prefix){let i=!1;return Xa(e)&&(e.prefix="",Va(e,(s,a)=>{a&&vf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!yr({provider:t,prefix:n,name:"a"}))return!1;const r=wn(t,n);return!!ho(r,e)}const Qa=Object.freeze({width:null,height:null}),Ja=Object.freeze({...Qa,...Er}),bf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,xf=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ss(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(bf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=xf.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}const wf=e=>e==="unset"||e==="undefined"||e==="none";function Ef(e,t){const n={...uo,...e},r={...Ja,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(w=>{const j=[],D=w.hFlip,C=w.vFlip;let M=w.rotate;D?C?M+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):C&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let K;switch(M<0&&(M-=Math.floor(M/4)*4),M=M%4,M){case 1:K=i.height/2+i.top,j.unshift("rotate(90 "+K.toString()+" "+K.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:K=i.width/2+i.left,j.unshift("rotate(-90 "+K.toString()+" "+K.toString()+")");break}M%2===1&&(i.left!==i.top&&(K=i.left,i.left=i.top,i.top=K),i.width!==i.height&&(K=i.width,i.width=i.height,i.height=K)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,v=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?v:c,l=ss(u,f/v)):(l=a==="auto"?f:a,u=c===null?ss(l,v/f):c==="auto"?v:c);const k={},b=(w,j)=>{wf(j)||(k[w]=j.toString())};return b("width",l),b("height",u),k.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+v.toString(),{attributes:k,body:s}}const Sf=/\sid="(\S+)"/g,Tf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let jf=0;function kf(e,t=Tf){const n=[];let r;for(;r=Sf.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(jf++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const gi=Object.create(null);function Of(e,t){gi[e]=t}function vi(e){return gi[e]||gi[""]}function fo(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 po=Object.create(null),Qn=["https://api.simplesvg.com","https://api.unisvg.com"],br=[];for(;Qn.length>0;)Qn.length===1||Math.random()>.5?br.push(Qn.shift()):br.push(Qn.pop());po[""]=fo({resources:["https://api.iconify.design"].concat(br)});function If(e,t){const n=fo(t);return n===null?!1:(po[e]=n,!0)}function mo(e){return po[e]}const Rf=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let as=Rf();function Cf(e,t){const n=mo(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Pf(e){return e===404}const Lf=(e,t,n)=>{const r=[],i=Cf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,v)=>{c+=f.length+1,c>=i&&v>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function _f(e){if(typeof e=="string"){const t=mo(e);if(t)return t.path}return"/"}const Nf=(e,t,n)=>{if(!as){n("abort",424);return}let r=_f(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),f=new URLSearchParams({icons:c});r+=s+".json?"+f.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;as(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Pf(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},Af={prepare:Lf,send:Nf};function Df(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,f=n[s]||(n[s]=Object.create(null)),v=f[a]||(f[a]=wn(s,a));let l;c in v.icons?l=t.loaded:a===""||v.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Za(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Mf(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(f=>{if(f.prefix!==i)return!0;const v=f.name;if(e.icons[v])a.loaded.push({provider:r,prefix:i,name:v});else if(e.missing.has(v))a.missing.push({provider:r,prefix:i,name:v});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Za([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Ff=0;function Bf(e,t,n){const r=Ff++,i=Za.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function $f(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?Ar(i,t,n):i;s&&r.push(s)}),r}var Uf={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Wf(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let F=e.resources.slice(0);for(a=[];F.length>1;){const V=Math.floor(Math.random()*F.length);a.push(F[V]),F=F.slice(0,V).concat(F.slice(V+1))}a=a.concat(F)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",v=0,l,u=null,k=[],b=[];typeof r=="function"&&b.push(r);function w(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),w(),k.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),k=[]}function D(F,V){V&&(b=[]),typeof F=="function"&&b.push(F)}function C(){return{startTime:c,payload:t,status:f,queriesSent:v,queriesPending:k.length,subscribe:D,abort:j}}function M(){f="failed",b.forEach(F=>{F(void 0,l)})}function K(){k.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),k=[]}function G(F,V,$){const le=V!=="success";switch(k=k.filter(Q=>Q!==F),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(V==="abort"){l=$,M();return}if(le){l=$,k.length||(a.length?T():M());return}if(w(),K(),!e.random){const Q=e.resources.indexOf(F.resource);Q!==-1&&Q!==e.index&&(e.index=Q)}f="completed",b.forEach(Q=>{Q($)})}function T(){if(f!=="pending")return;w();const F=a.shift();if(F===void 0){if(k.length){u=setTimeout(()=>{w(),f==="pending"&&(K(),M())},e.timeout);return}M();return}const V={status:"pending",resource:F,callback:($,le)=>{G(V,$,le)}};k.push(V),v++,u=setTimeout(T,e.rotate),n(F,t,V.callback)}return setTimeout(T),C}function el(e){const t={...Uf,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,v){const l=Wf(t,c,f,(u,k)=>{r(),v&&v(u,k)});return n.push(l),l}function s(c){return n.find(f=>c(f))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function ls(){}const Xr=Object.create(null);function zf(e){if(!Xr[e]){const t=mo(e);if(!t)return;const n=el(t),r={config:t,redundancy:n};Xr[e]=r}return Xr[e]}function qf(e,t,n){let r,i;if(typeof e=="string"){const s=vi(e);if(!s)return n(void 0,424),ls;i=s.send;const a=zf(e);a&&(r=a.redundancy)}else{const s=fo(e);if(s){r=el(s);const a=e.resources?e.resources[0]:"",c=vi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),ls):r.query(t,i,n)().abort}const cs="iconify2",or="iconify",tl=or+"-count",us=or+"-version",nl=36e5,Kf=168;function yi(e,t){try{return e.getItem(t)}catch{}}function go(e,t,n){try{return e.setItem(t,n),!0}catch{}}function ds(e,t){try{e.removeItem(t)}catch{}}function bi(e,t){return go(e,tl,t.toString())}function xi(e){return parseInt(yi(e,tl))||0}const Dr={local:!0,session:!0},rl={local:new Set,session:new Set};let vo=!1;function Gf(e){vo=e}let hr=typeof window>"u"?{}:window;function il(e){const t=e+"Storage";try{if(hr&&hr[t]&&typeof hr[t].length=="number")return hr[t]}catch{}Dr[e]=!1}function ol(e,t){const n=il(e);if(!n)return;const r=yi(n,us);if(r!==cs){if(r){const c=xi(n);for(let f=0;f<c;f++)ds(n,or+f.toString())}go(n,us,cs),bi(n,0);return}const i=Math.floor(Date.now()/nl)-Kf,s=c=>{const f=or+c.toString(),v=yi(n,f);if(typeof v=="string"){try{const l=JSON.parse(v);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>i&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&t(l,c))return!0}catch{}ds(n,f)}};let a=xi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,bi(n,a)):rl[e].add(c))}function sl(){if(!vo){Gf(!0);for(const e in Dr)ol(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=wn(r,i);if(!ho(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function Hf(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Dr)ol(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Vf(e,t){vo||sl();function n(r){let i;if(!Dr[r]||!(i=il(r)))return;const s=rl[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=xi(i),!bi(i,a+1))return;const c={cached:Math.floor(Date.now()/nl),provider:e.provider,data:t};return go(i,or+a.toString(),JSON.stringify(c))}t.lastModified&&!Hf(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function hs(){}function Xf(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Mf(e)}))}function Yf(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=vi(n)))return;s.prepare(n,r,i).forEach(c=>{qf(n,c,f=>{if(typeof f!="object")c.icons.forEach(v=>{e.missing.add(v)});else try{const v=ho(e,f);if(!v.length)return;const l=e.pendingIcons;l&&v.forEach(u=>{l.delete(u)}),Vf(e,f)}catch(v){console.error(v)}Xf(e)})})}))}const Qf=(e,t)=>{const n=$f(e,!0,Ya()),r=Df(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,hs)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:v,prefix:l}=f;if(l===c&&v===a)return;a=v,c=l,s.push(wn(v,l));const u=i[v]||(i[v]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:v,prefix:l,name:u}=f,k=wn(v,l),b=k.pendingIcons||(k.pendingIcons=new Set);b.has(u)||(b.add(u),i[v][l].push(u))}),s.forEach(f=>{const{provider:v,prefix:l}=f;i[v][l].length&&Yf(f,i[v][l])}),t?Bf(t,r,s):hs};function Jf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Qa?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Zf=/[\s,]+/;function ep(e,t){t.split(Zf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function tp(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function np(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function rp(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function ip(e){return"data:image/svg+xml,"+rp(e)}function op(e){return'url("'+ip(e)+'")'}let nr;function sp(){try{nr=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{nr=null}}function ap(e){return nr===void 0&&sp(),nr?nr.createHTML(e):e}const al={...Ja,inline:!1},lp={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},cp={display:"inline-block"},wi={backgroundColor:"currentColor"},ll={backgroundColor:"transparent"},fs={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},ps={WebkitMask:wi,mask:wi,background:ll};for(const e in ps){const t=ps[e];for(const n in fs)t[e+n]=fs[n]}const up={...al,inline:!0};function ms(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const dp=(e,t,n,r)=>{const i=n?up:al,s=Jf(i,t),a=t.mode||"svg",c={},f=t.style||{},v={...a==="svg"?lp:{},ref:r};for(let C in t){const M=t[C];if(M!==void 0)switch(C){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[C]=M===!0||M==="true"||M===1;break;case"flip":typeof M=="string"&&ep(s,M);break;case"color":c.color=M;break;case"rotate":typeof M=="string"?s[C]=tp(M):typeof M=="number"&&(s[C]=M);break;case"ariaHidden":case"aria-hidden":M!==!0&&M!=="true"&&delete v["aria-hidden"];break;default:i[C]===void 0&&(v[C]=M)}}const l=Ef(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){v.style={...c,...f},Object.assign(v,u);let C=0,M=t.id;return typeof M=="string"&&(M=M.replace(/-/g,"_")),v.dangerouslySetInnerHTML={__html:ap(kf(l.body,M?()=>M+"ID"+C++:"iconifyReact"))},Wt.createElement("svg",v)}const{body:k,width:b,height:w}=e,j=a==="mask"||(a==="bg"?!1:k.indexOf("currentColor")!==-1),D=np(k,{...u,width:b+"",height:w+""});return v.style={...c,"--svg":op(D),width:ms(u.width),height:ms(u.height),...cp,...j?wi:ll,...f},Wt.createElement("span",v)};Ya(!0);Of("",Af);if(typeof document<"u"&&typeof window<"u"){sl();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!yf(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;If(n,i)||console.error(r)}catch{console.error(r)}}}}class cl extends Wt.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||n.icon===null)&&this._setData({data:r});return}let i;if(typeof r!="string"||(i=Ar(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=gf(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:Qf([i],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const a=["iconify"];i.prefix!==""&&a.push("iconify--"+i.prefix),i.provider!==""&&a.push("iconify--"+i.provider),this._setData({data:s,classes:a}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,n=this.state.icon;if(n===null)return t.children?t.children:Wt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),dp({...uo,...n.data},r,t._inline,t._ref)}}const $t=Wt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Wt.createElement(cl,r)});Wt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Wt.createElement(cl,r)});var ul={exports:{}};(function(e,t){(function(n,r){e.exports=r(A)})(Te,n=>(()=>{var r={703:(c,f,v)=>{var l=v(414);function u(){}function k(){}k.resetWarningCache=u,c.exports=function(){function b(D,C,M,K,G,T){if(T!==l){var F=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}}function w(){return b}b.isRequired=b;var j={array:b,bool:b,func:b,number:b,object:b,string:b,symbol:b,any:b,arrayOf:w,element:b,elementType:b,instanceOf:w,node:b,objectOf:w,oneOf:w,oneOfType:w,shape:w,exact:w,checkPropTypes:k,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,v)=>{c.exports=v(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",v=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(b,w){if(b===w)return!0;if(b&&w&&typeof b=="object"&&typeof w=="object"){if(b.constructor!==w.constructor)return!1;var j,D,C,M;if(Array.isArray(b)){if((j=b.length)!=w.length)return!1;for(D=j;D--!=0;)if(!k(b[D],w[D]))return!1;return!0}if(v&&b instanceof Map&&w instanceof Map){if(b.size!==w.size)return!1;for(M=b.entries();!(D=M.next()).done;)if(!w.has(D.value[0]))return!1;for(M=b.entries();!(D=M.next()).done;)if(!k(D.value[1],w.get(D.value[0])))return!1;return!0}if(l&&b instanceof Set&&w instanceof Set){if(b.size!==w.size)return!1;for(M=b.entries();!(D=M.next()).done;)if(!w.has(D.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(b)&&ArrayBuffer.isView(w)){if((j=b.length)!=w.length)return!1;for(D=j;D--!=0;)if(b[D]!==w[D])return!1;return!0}if(b.constructor===RegExp)return b.source===w.source&&b.flags===w.flags;if(b.valueOf!==Object.prototype.valueOf)return b.valueOf()===w.valueOf();if(b.toString!==Object.prototype.toString)return b.toString()===w.toString();if((j=(C=Object.keys(b)).length)!==Object.keys(w).length)return!1;for(D=j;D--!=0;)if(!Object.prototype.hasOwnProperty.call(w,C[D]))return!1;if(f&&b instanceof Element)return!1;for(D=j;D--!=0;)if((C[D]!=="_owner"&&C[D]!=="__v"&&C[D]!=="__o"||!b.$$typeof)&&!k(b[C[D]],w[C[D]]))return!1;return!0}return b!=b&&w!=w}c.exports=function(b,w){try{return k(b,w)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var v=i[c]={exports:{}};return r[c](v,v.exports,s),v.exports}s.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return s.d(f,{a:f}),f},s.d=(c,f)=>{for(var v in f)s.o(f,v)&&!s.o(c,v)&&Object.defineProperty(c,v,{enumerable:!0,get:f[v]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),s.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};return(()=>{function c(y){var p,S,O="";if(typeof y=="string"||typeof y=="number")O+=y;else if(typeof y=="object")if(Array.isArray(y))for(p=0;p<y.length;p++)y[p]&&(S=c(y[p]))&&(O&&(O+=" "),O+=S);else for(p in y)y[p]&&(O&&(O+=" "),O+=p);return O}function f(){for(var y,p,S=0,O="";S<arguments.length;)(y=arguments[S++])&&(p=c(y))&&(O&&(O+=" "),O+=p);return O}s.r(a),s.d(a,{default:()=>Il});var v=s(359),l=s.n(v);const u=function(y){var p=typeof y;return y!=null&&(p=="object"||p=="function")},k=typeof Te=="object"&&Te&&Te.Object===Object&&Te;var b=typeof self=="object"&&self&&self.Object===Object&&self;const w=k||b||Function("return this")(),j=function(){return w.Date.now()};var D=/\s/,C=/^\s+/;const M=function(y){return y&&y.slice(0,function(p){for(var S=p.length;S--&&D.test(p.charAt(S)););return S}(y)+1).replace(C,"")},K=w.Symbol;var G=Object.prototype,T=G.hasOwnProperty,F=G.toString,V=K?K.toStringTag:void 0,$=Object.prototype.toString,le=K?K.toStringTag:void 0;const Q=function(y){return y==null?y===void 0?"[object Undefined]":"[object Null]":le&&le in Object(y)?function(p){var S=T.call(p,V),O=p[V];try{p[V]=void 0;var z=!0}catch{}var se=F.call(p);return z&&(S?p[V]=O:delete p[V]),se}(y):function(p){return $.call(p)}(y)};var Oe=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,Xe=/^0o[0-7]+$/i,_e=parseInt;const Ye=function(y){if(typeof y=="number")return y;if(function(O){return typeof O=="symbol"||function(z){return z!=null&&typeof z=="object"}(O)&&Q(O)=="[object Symbol]"}(y))return NaN;if(u(y)){var p=typeof y.valueOf=="function"?y.valueOf():y;y=u(p)?p+"":p}if(typeof y!="string")return y===0?y:+y;y=M(y);var S=oe.test(y);return S||Xe.test(y)?_e(y.slice(2),S?2:8):Oe.test(y)?NaN:+y};var ie=Math.max,he=Math.min;const Fe=function(y,p,S){var O,z,se,me,g,m,I=0,U=!1,q=!1,W=!0;if(typeof y!="function")throw new TypeError("Expected a function");function ue(ae){var pe=O,xe=z;return O=z=void 0,I=ae,me=y.apply(xe,pe)}function ce(ae){return I=ae,g=setTimeout(J,p),U?ue(ae):me}function fe(ae){var pe=ae-m;return m===void 0||pe>=p||pe<0||q&&ae-I>=se}function J(){var ae=j();if(fe(ae))return ee(ae);g=setTimeout(J,function(pe){var xe=p-(pe-m);return q?he(xe,se-(pe-I)):xe}(ae))}function ee(ae){return g=void 0,W&&O?ue(ae):(O=z=void 0,me)}function ne(){var ae=j(),pe=fe(ae);if(O=arguments,z=this,m=ae,pe){if(g===void 0)return ce(m);if(q)return clearTimeout(g),g=setTimeout(J,p),ue(m)}return g===void 0&&(g=setTimeout(J,p)),me}return p=Ye(p)||0,u(S)&&(U=!!S.leading,se=(q="maxWait"in S)?ie(Ye(S.maxWait)||0,p):se,W="trailing"in S?!!S.trailing:W),ne.cancel=function(){g!==void 0&&clearTimeout(g),I=0,O=m=z=g=void 0},ne.flush=function(){return g===void 0?me:ee(j())},ne},X=function(y,p,S){var O=!0,z=!0;if(typeof y!="function")throw new TypeError("Expected a function");return u(S)&&(O="leading"in S?!!S.leading:O,z="trailing"in S?!!S.trailing:z),Fe(y,p,{leading:O,maxWait:p,trailing:z})};var Be=s(590),Ne=s.n(Be),ct=function(){if(typeof Map<"u")return Map;function y(p,S){var O=-1;return p.some(function(z,se){return z[0]===S&&(O=se,!0)}),O}return function(){function p(){this.__entries__=[]}return Object.defineProperty(p.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),p.prototype.get=function(S){var O=y(this.__entries__,S),z=this.__entries__[O];return z&&z[1]},p.prototype.set=function(S,O){var z=y(this.__entries__,S);~z?this.__entries__[z][1]=O:this.__entries__.push([S,O])},p.prototype.delete=function(S){var O=this.__entries__,z=y(O,S);~z&&O.splice(z,1)},p.prototype.has=function(S){return!!~y(this.__entries__,S)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(S,O){O===void 0&&(O=null);for(var z=0,se=this.__entries__;z<se.length;z++){var me=se[z];S.call(O,me[1],me[0])}},p}()}(),ve=typeof window<"u"&&typeof document<"u"&&window.document===document,Ze=s.g!==void 0&&s.g.Math===Math?s.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),ut=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ze):function(y){return setTimeout(function(){return y(Date.now())},1e3/60)},zt=["top","right","bottom","left","width","height","size","weight"],Tt=typeof MutationObserver<"u",yt=function(){function y(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,S){var O=!1,z=!1,se=0;function me(){O&&(O=!1,p()),z&&m()}function g(){ut(me)}function m(){var I=Date.now();if(O){if(I-se<2)return;z=!0}else O=!0,z=!1,setTimeout(g,20);se=I}return m}(this.refresh.bind(this))}return y.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},y.prototype.removeObserver=function(p){var S=this.observers_,O=S.indexOf(p);~O&&S.splice(O,1),!S.length&&this.connected_&&this.disconnect_()},y.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},y.prototype.updateObservers_=function(){var p=this.observers_.filter(function(S){return S.gatherActive(),S.hasActive()});return p.forEach(function(S){return S.broadcastActive()}),p.length>0},y.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)},y.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)},y.prototype.onTransitionEnd_=function(p){var S=p.propertyName,O=S===void 0?"":S;zt.some(function(z){return!!~O.indexOf(z)})&&this.refresh()},y.getInstance=function(){return this.instance_||(this.instance_=new y),this.instance_},y.instance_=null,y}(),qe=function(y,p){for(var S=0,O=Object.keys(p);S<O.length;S++){var z=O[S];Object.defineProperty(y,z,{value:p[z],enumerable:!1,writable:!1,configurable:!0})}return y},H=function(y){return y&&y.ownerDocument&&y.ownerDocument.defaultView||Ze},be=Ie(0,0,0,0);function de(y){return parseFloat(y)||0}function Ee(y){for(var p=[],S=1;S<arguments.length;S++)p[S-1]=arguments[S];return p.reduce(function(O,z){return O+de(y["border-"+z+"-width"])},0)}var tn=typeof SVGGraphicsElement<"u"?function(y){return y instanceof H(y).SVGGraphicsElement}:function(y){return y instanceof H(y).SVGElement&&typeof y.getBBox=="function"};function nn(y){return ve?tn(y)?function(p){var S=p.getBBox();return Ie(0,0,S.width,S.height)}(y):function(p){var S=p.clientWidth,O=p.clientHeight;if(!S&&!O)return be;var z=H(p).getComputedStyle(p),se=function(W){for(var ue={},ce=0,fe=["top","right","bottom","left"];ce<fe.length;ce++){var J=fe[ce],ee=W["padding-"+J];ue[J]=de(ee)}return ue}(z),me=se.left+se.right,g=se.top+se.bottom,m=de(z.width),I=de(z.height);if(z.boxSizing==="border-box"&&(Math.round(m+me)!==S&&(m-=Ee(z,"left","right")+me),Math.round(I+g)!==O&&(I-=Ee(z,"top","bottom")+g)),!function(W){return W===H(W).document.documentElement}(p)){var U=Math.round(m+me)-S,q=Math.round(I+g)-O;Math.abs(U)!==1&&(m-=U),Math.abs(q)!==1&&(I-=q)}return Ie(se.left,se.top,m,I)}(y):be}function Ie(y,p,S,O){return{x:y,y:p,width:S,height:O}}var rn=function(){function y(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ie(0,0,0,0),this.target=p}return y.prototype.isActive=function(){var p=nn(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},y.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},y}(),qt=function(y,p){var S,O,z,se,me,g,m,I=(O=(S=p).x,z=S.y,se=S.width,me=S.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),qe(m,{x:O,y:z,width:se,height:me,top:z,right:O+se,bottom:me+z,left:O}),m);qe(this,{target:y,contentRect:I})},Dn=function(){function y(p,S,O){if(this.activeObservations_=[],this.observations_=new ct,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=S,this.callbackCtx_=O}return y.prototype.observe=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof H(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var S=this.observations_;S.has(p)||(S.set(p,new rn(p)),this.controller_.addObserver(this),this.controller_.refresh())}},y.prototype.unobserve=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof H(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var S=this.observations_;S.has(p)&&(S.delete(p),S.size||this.controller_.removeObserver(this))}},y.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},y.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(S){S.isActive()&&p.activeObservations_.push(S)})},y.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,S=this.activeObservations_.map(function(O){return new qt(O.target,O.broadcastRect())});this.callback_.call(p,S,p),this.clearActive()}},y.prototype.clearActive=function(){this.activeObservations_.splice(0)},y.prototype.hasActive=function(){return this.activeObservations_.length>0},y}(),Qe=typeof WeakMap<"u"?new WeakMap:new ct,on=function y(p){if(!(this instanceof y))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var S=yt.getInstance(),O=new Dn(p,S,this);Qe.set(this,O)};["observe","unobserve","disconnect"].forEach(function(y){on.prototype[y]=function(){var p;return(p=Qe.get(this))[y].apply(p,arguments)}});const sn=Ze.ResizeObserver!==void 0?Ze.ResizeObserver:on,bt="Left",$e="Right",ot="Up",st="Down",jt={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},an={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Kt="mousemove",Ke="mouseup";function Sn(y,p){if(p===0)return y;const S=Math.PI/180*p;return[y[0]*Math.cos(S)+y[1]*Math.sin(S),y[1]*Math.cos(S)-y[0]*Math.sin(S)]}function Tn(y){const{trackMouse:p}=y,S=v.useRef(Object.assign({},an)),O=v.useRef(Object.assign({},jt)),z=v.useRef(Object.assign({},O.current));let se;for(se in z.current=Object.assign({},O.current),O.current=Object.assign(Object.assign({},jt),y),jt)O.current[se]===void 0&&(O.current[se]=jt[se]);const[me,g]=v.useMemo(()=>function(m,I){const U=J=>{const ee="touches"in J;ee&&J.touches.length>1||m((ne,ae)=>{ae.trackMouse&&!ee&&(document.addEventListener(Kt,q),document.addEventListener(Ke,ue));const{clientX:pe,clientY:xe}=ee?J.touches[0]:J,De=Sn([pe,xe],ae.rotationAngle);return ae.onTouchStartOrOnMouseDown&&ae.onTouchStartOrOnMouseDown({event:J}),Object.assign(Object.assign(Object.assign({},ne),an),{initial:De.slice(),xy:De,start:J.timeStamp||0})})},q=J=>{m((ee,ne)=>{const ae="touches"in J;if(ae&&J.touches.length>1)return ee;if(J.timeStamp-ee.start>ne.swipeDuration)return ee.swiping?Object.assign(Object.assign({},ee),{swiping:!1}):ee;const{clientX:pe,clientY:xe}=ae?J.touches[0]:J,[De,lt]=Sn([pe,xe],ne.rotationAngle),nt=De-ee.xy[0],Ge=lt-ee.xy[1],Le=Math.abs(nt),we=Math.abs(Ge),Xt=(J.timeStamp||0)-ee.start,qn=Math.sqrt(Le*Le+we*we)/(Xt||1),Kn=[nt/(Xt||1),Ge/(Xt||1)],Mt=function(Gn,Rn,Hn,dt){return Gn>Rn?Hn>0?$e:bt:dt>0?st:ot}(Le,we,nt,Ge),hn=typeof ne.delta=="number"?ne.delta:ne.delta[Mt.toLowerCase()]||jt.delta;if(Le<hn&&we<hn&&!ee.swiping)return ee;const Pt={absX:Le,absY:we,deltaX:nt,deltaY:Ge,dir:Mt,event:J,first:ee.first,initial:ee.initial,velocity:qn,vxvy:Kn};Pt.first&&ne.onSwipeStart&&ne.onSwipeStart(Pt),ne.onSwiping&&ne.onSwiping(Pt);let In=!1;return(ne.onSwiping||ne.onSwiped||ne[`onSwiped${Mt}`])&&(In=!0),In&&ne.preventScrollOnSwipe&&ne.trackTouch&&J.cancelable&&J.preventDefault(),Object.assign(Object.assign({},ee),{first:!1,eventData:Pt,swiping:!0})})},W=J=>{m((ee,ne)=>{let ae;if(ee.swiping&&ee.eventData){if(J.timeStamp-ee.start<ne.swipeDuration){ae=Object.assign(Object.assign({},ee.eventData),{event:J}),ne.onSwiped&&ne.onSwiped(ae);const pe=ne[`onSwiped${ae.dir}`];pe&&pe(ae)}}else ne.onTap&&ne.onTap({event:J});return ne.onTouchEndOrOnMouseUp&&ne.onTouchEndOrOnMouseUp({event:J}),Object.assign(Object.assign(Object.assign({},ee),an),{eventData:ae})})},ue=J=>{document.removeEventListener(Kt,q),document.removeEventListener(Ke,ue),W(J)},ce=(J,ee)=>{let ne=()=>{};if(J&&J.addEventListener){const ae=Object.assign(Object.assign({},jt.touchEventOptions),ee.touchEventOptions),pe=[["touchstart",U,ae],["touchmove",q,Object.assign(Object.assign({},ae),ee.preventScrollOnSwipe?{passive:!1}:{})],["touchend",W,ae]];pe.forEach(([xe,De,lt])=>J.addEventListener(xe,De,lt)),ne=()=>pe.forEach(([xe,De])=>J.removeEventListener(xe,De))}return ne},fe={ref:J=>{J!==null&&m((ee,ne)=>{if(ee.el===J)return ee;const ae={};return ee.el&&ee.el!==J&&ee.cleanUpTouch&&(ee.cleanUpTouch(),ae.cleanUpTouch=void 0),ne.trackTouch&&J&&(ae.cleanUpTouch=ce(J,ne)),Object.assign(Object.assign(Object.assign({},ee),{el:J}),ae)})}};return I.trackMouse&&(fe.onMouseDown=U),[fe,ce]}(m=>S.current=m(S.current,O.current),{trackMouse:p}),[p]);return S.current=function(m,I,U,q){return I.trackTouch&&m.el?m.cleanUpTouch?I.preventScrollOnSwipe!==U.preventScrollOnSwipe||I.touchEventOptions.passive!==U.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:q(m.el,I)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:q(m.el,I)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(S.current,O.current,z.current,g),me}var P=s(697);function kt(y){return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},kt(y)}function ln(y,p){var S=Object.keys(y);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(y);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(y,z).enumerable})),S.push.apply(S,O)}return S}function Nt(y){for(var p=1;p<arguments.length;p++){var S=arguments[p]!=null?arguments[p]:{};p%2?ln(Object(S),!0).forEach(function(O){d(y,O,S[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(S)):ln(Object(S)).forEach(function(O){Object.defineProperty(y,O,Object.getOwnPropertyDescriptor(S,O))})}return y}function d(y,p,S){return(p=function(O){var z=function(se,me){if(kt(se)!=="object"||se===null)return se;var g=se[Symbol.toPrimitive];if(g!==void 0){var m=g.call(se,me);if(kt(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(se)}(O,"string");return kt(z)==="symbol"?z:String(z)}(p))in y?Object.defineProperty(y,p,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[p]=S,y}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},E=l().memo(function(y){var p=Nt(Nt({},x),y),S=p.description,O=p.fullscreen,z=p.handleImageLoaded,se=p.isFullscreen,me=p.onImageError,g=p.original,m=p.originalAlt,I=p.originalHeight,U=p.originalWidth,q=p.originalTitle,W=p.sizes,ue=p.srcSet,ce=p.loading,fe=se&&O||g;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:fe,alt:m,srcSet:ue,height:I,width:U,sizes:W,title:q,onLoad:function(J){return z(J,g)},onError:me,loading:ce}),S&&l().createElement("span",{className:"image-gallery-description"},S))});E.displayName="Item",E.propTypes={description:P.string,fullscreen:P.string,handleImageLoaded:P.func.isRequired,isFullscreen:P.bool,onImageError:P.func.isRequired,original:P.string.isRequired,originalAlt:P.string,originalHeight:P.string,originalWidth:P.string,originalTitle:P.string,sizes:P.string,srcSet:P.string,loading:P.string};const L=E;function B(y){return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},B(y)}function R(y,p){var S=Object.keys(y);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(y);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(y,z).enumerable})),S.push.apply(S,O)}return S}function N(y){for(var p=1;p<arguments.length;p++){var S=arguments[p]!=null?arguments[p]:{};p%2?R(Object(S),!0).forEach(function(O){te(y,O,S[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(S)):R(Object(S)).forEach(function(O){Object.defineProperty(y,O,Object.getOwnPropertyDescriptor(S,O))})}return y}function te(y,p,S){return(p=function(O){var z=function(se,me){if(B(se)!=="object"||se===null)return se;var g=se[Symbol.toPrimitive];if(g!==void 0){var m=g.call(se,me);if(B(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(se)}(O,"string");return B(z)==="symbol"?z:String(z)}(p))in y?Object.defineProperty(y,p,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[p]=S,y}var Z={left:l().createElement("polyline",{points:"15 18 9 12 15 6"}),right:l().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:l().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:l().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:l().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:l().createElement(l().Fragment,null,l().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),l().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Se={strokeWidth:1,viewBox:"0 0 24 24"},Ae=function(y){var p=N(N({},Se),y),S=p.strokeWidth,O=p.viewBox,z=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:O,fill:"none",stroke:"currentColor",strokeWidth:S,strokeLinecap:"round",strokeLinejoin:"round"},Z[z])};Ae.propTypes={strokeWidth:P.number,viewBox:P.string,icon:(0,P.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const je=Ae;var Re=l().memo(function(y){var p=y.isFullscreen,S=y.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:S,"aria-label":"Open Fullscreen"},l().createElement(je,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Re.displayName="Fullscreen",Re.propTypes={isFullscreen:P.bool.isRequired,onClick:P.func.isRequired};const Me=Re;var Ot=l().memo(function(y){var p=y.disabled,S=y.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:S,"aria-label":"Previous Slide"},l().createElement(je,{icon:"left",viewBox:"6 0 12 24"}))});Ot.displayName="LeftNav",Ot.propTypes={disabled:P.bool.isRequired,onClick:P.func.isRequired};const cn=Ot;var un=l().memo(function(y){var p=y.disabled,S=y.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:S,"aria-label":"Next Slide"},l().createElement(je,{icon:"right",viewBox:"6 0 12 24"}))});un.displayName="RightNav",un.propTypes={disabled:P.bool.isRequired,onClick:P.func.isRequired};const jn=un;var Gt=l().memo(function(y){var p=y.isPlaying,S=y.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:S,"aria-label":"Play or Pause Slideshow"},l().createElement(je,{strokeWidth:2,icon:p?"pause":"play"}))});Gt.displayName="PlayPause",Gt.propTypes={isPlaying:P.bool.isRequired,onClick:P.func.isRequired};const et=Gt;function It(y){return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},It(y)}function Rt(){return Rt=Object.assign?Object.assign.bind():function(y){for(var p=1;p<arguments.length;p++){var S=arguments[p];for(var O in S)Object.prototype.hasOwnProperty.call(S,O)&&(y[O]=S[O])}return y},Rt.apply(this,arguments)}function at(y,p){var S=Object.keys(y);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(y);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(y,z).enumerable})),S.push.apply(S,O)}return S}function Ct(y){for(var p=1;p<arguments.length;p++){var S=arguments[p]!=null?arguments[p]:{};p%2?at(Object(S),!0).forEach(function(O){Mn(y,O,S[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(S)):at(Object(S)).forEach(function(O){Object.defineProperty(y,O,Object.getOwnPropertyDescriptor(S,O))})}return y}function Mn(y,p,S){return(p=function(O){var z=function(se,me){if(It(se)!=="object"||se===null)return se;var g=se[Symbol.toPrimitive];if(g!==void 0){var m=g.call(se,me);if(It(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(se)}(O,"string");return It(z)==="symbol"?z:String(z)}(p))in y?Object.defineProperty(y,p,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[p]=S,y}var Fn={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Bn=function(y){var p=Ct(Ct({},Fn),y),S=p.children,O=p.className,z=Tn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",Rt({},z,{className:O}),S)};Bn.propTypes={children:P.node.isRequired,className:P.string,delta:P.number,onSwiped:P.func,onSwiping:P.func};const $n=Bn;function At(y){return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},At(y)}function Un(y,p){var S=Object.keys(y);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(y);p&&(O=O.filter(function(z){return Object.getOwnPropertyDescriptor(y,z).enumerable})),S.push.apply(S,O)}return S}function tt(y){for(var p=1;p<arguments.length;p++){var S=arguments[p]!=null?arguments[p]:{};p%2?Un(Object(S),!0).forEach(function(O){zn(y,O,S[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(S)):Un(Object(S)).forEach(function(O){Object.defineProperty(y,O,Object.getOwnPropertyDescriptor(S,O))})}return y}function Wn(y,p){for(var S=0;S<p.length;S++){var O=p[S];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(y,Dt(O.key),O)}}function Ht(y,p){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,O){return S.__proto__=O,S},Ht(y,p)}function kn(y,p){if(p&&(At(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ke(y)}function ke(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function Vt(y){return Vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},Vt(y)}function zn(y,p,S){return(p=Dt(p))in y?Object.defineProperty(y,p,{value:S,enumerable:!0,configurable:!0,writable:!0}):y[p]=S,y}function Dt(y){var p=function(S,O){if(At(S)!=="object"||S===null)return S;var z=S[Symbol.toPrimitive];if(z!==void 0){var se=z.call(S,O);if(At(se)!=="object")return se;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(S)}(y,"string");return At(p)==="symbol"?p:String(p)}var dn=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],On=(0,P.arrayOf)((0,P.shape)({srcSet:P.string,media:P.string}));function cr(y){var p=parseInt(y.keyCode||y.which||0,10);return p===66||p===62}var Fr=function(y){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&Ht(g,m)})(me,y);var p,S,O,z,se=(O=me,z=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=Vt(O);if(z){var I=Vt(this).constructor;g=Reflect.construct(m,arguments,I)}else g=m.apply(this,arguments);return kn(this,g)});function me(g){var m;return function(I,U){if(!(I instanceof U))throw new TypeError("Cannot call a class as a function")}(this,me),zn(ke(m=se.call(this,g)),"onBulletClick",function(I,U){var q=m.props,W=q.onBulletClick,ue=q.items,ce=m.state.currentIndex;I.target.blur(),ce!==U&&(ue.length===2?m.slideToIndexWithStyleReset(U,I):m.slideToIndex(U,I)),W&&W(I,U)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=l().createRef(),m.thumbnailsWrapper=l().createRef(),m.thumbnails=l().createRef(),m.imageGallerySlideWrapper=l().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(ke(m)),m.handleKeyDown=m.handleKeyDown.bind(ke(m)),m.handleMouseDown=m.handleMouseDown.bind(ke(m)),m.handleResize=m.handleResize.bind(ke(m)),m.handleTouchMove=m.handleTouchMove.bind(ke(m)),m.handleOnSwiped=m.handleOnSwiped.bind(ke(m)),m.handleScreenChange=m.handleScreenChange.bind(ke(m)),m.handleSwiping=m.handleSwiping.bind(ke(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(ke(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(ke(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(ke(m)),m.handleImageError=m.handleImageError.bind(ke(m)),m.pauseOrPlay=m.pauseOrPlay.bind(ke(m)),m.renderThumbInner=m.renderThumbInner.bind(ke(m)),m.renderItem=m.renderItem.bind(ke(m)),m.slideLeft=m.slideLeft.bind(ke(m)),m.slideRight=m.slideRight.bind(ke(m)),m.toggleFullScreen=m.toggleFullScreen.bind(ke(m)),m.togglePlay=m.togglePlay.bind(ke(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=X(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return p=me,S=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,I=g.useWindowKeyDown;m&&this.play(),I?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var I=this.props,U=I.items,q=I.lazyLoad,W=I.slideDuration,ue=I.slideInterval,ce=I.startIndex,fe=I.thumbnailPosition,J=I.showThumbnails,ee=I.useWindowKeyDown,ne=this.state,ae=ne.currentIndex,pe=ne.isPlaying,xe=g.items.length!==U.length,De=!Ne()(g.items,U),lt=g.startIndex!==ce,nt=g.thumbnailPosition!==fe,Ge=g.showThumbnails!==J;ue===g.slideInterval&&W===g.slideDuration||pe&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ge&&J&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ge&&!J&&this.removeThumbnailsResizeObserver(),(xe||Ge)&&this.handleResize(),m.currentIndex!==ae&&this.slideThumbnailBar(),g.slideDuration!==W&&(this.slideToIndex=X(this.unthrottledSlideToIndex,W,{trailing:!1})),!q||g.lazyLoad&&!De||(this.lazyLoaded=[]),ee!==g.useWindowKeyDown&&(ee?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(lt||De)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,I=m.currentIndex,U=m.isTransitioning,q=this.props,W=q.onSlide,ue=q.slideDuration;this.transitionTimer=window.setTimeout(function(){U&&(g.setState({isTransitioning:!U,isSwipingThumbnail:!1}),W&&W(I))},ue+50)}},{key:"onThumbnailClick",value:function(g,m){var I=this.props,U=I.onThumbnailClick,q=I.items,W=this.state.currentIndex;g.target.parentNode.parentNode.blur(),W!==m&&(q.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),U&&U(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var I=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){I.slideToIndex(m),I.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,I=this.props,U=I.disableThumbnailScroll,q=I.items,W=this.state,ue=W.thumbnailsWrapperWidth,ce=W.thumbnailsWrapperHeight,fe=this.thumbnails&&this.thumbnails.current;if(U)return 0;if(fe){if(this.isThumbnailVertical()){if(fe.scrollHeight<=ce)return 0;m=fe.scrollHeight-ce}else{if(fe.scrollWidth<=ue||ue<=0)return 0;m=fe.scrollWidth-ue}return g*(m/(q.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,I=this.props,U=I.infinite,q=I.items,W="",ue="image-gallery-left",ce="image-gallery-right";switch(g){case m-1:W=" ".concat(ue);break;case m:W=" ".concat("image-gallery-center");break;case m+1:W=" ".concat(ce)}return q.length>=3&&U&&(g===0&&m===q.length-1?W=" ".concat(ce):g===q.length-1&&m===0&&(W=" ".concat(ue))),W}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,I=m.currentIndex,U=m.currentSlideOffset,q=m.previousIndex,W=I!==q,ue=g===0&&q===0,ce=g===1&&q===1,fe=g===0&&I===1,J=g===1&&I===0,ee=U===0,ne=-100*I+100*g+U;return U>0?this.direction="left":U<0&&(this.direction="right"),J&&U>0&&(ne=-100+U),fe&&U<0&&(ne=100+U),W?ue&&ee&&this.direction==="left"?ne=100:ce&&ee&&this.direction==="right"&&(ne=-100):(J&&ee&&this.direction==="left"&&(ne=-100),fe&&ee&&this.direction==="right"&&(ne=100)),ne}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,I=m.currentIndex,U=m.currentSlideOffset,q=m.slideStyle,W=this.props,ue=W.infinite,ce=W.items,fe=W.useTranslate3D,J=W.isRTL,ee=-100*I,ne=ce.length-1,ae=(ee+100*g)*(J?-1:1)+U;ue&&ce.length>2&&(I===0&&g===ne?ae=-100*(J?-1:1)+U:I===ne&&g===0&&(ae=100*(J?-1:1)+U)),ue&&ce.length===2&&(ae=this.getTranslateXForTwoSlide(g));var pe="translate(".concat(ae,"%, 0)");return fe&&(pe="translate3d(".concat(ae,"%, 0, 0)")),tt({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:pe,MozTransform:pe,msTransform:pe,OTransform:pe,transform:pe},q)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,I=m.useTranslate3D,U=m.isRTL,q=this.state,W=q.thumbsTranslate,ue=q.thumbsStyle,ce=U?-1*W:W;return this.isThumbnailVertical()?(g="translate(0, ".concat(W,"px)"),I&&(g="translate3d(0, ".concat(W,"px, 0)"))):(g="translate(".concat(ce,"px, 0)"),I&&(g="translate3d(".concat(ce,"px, 0, 0)"))),tt({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},ue)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,I=this.props,U=I.items,q=I.slideOnThumbnailOver,W=I.onClick,ue=I.lazyLoad,ce=I.onTouchMove,fe=I.onTouchEnd,J=I.onTouchStart,ee=I.onMouseOver,ne=I.onMouseLeave,ae=I.renderItem,pe=I.renderThumbInner,xe=I.showThumbnails,De=I.showBullets,lt=[],nt=[],Ge=[];return U.forEach(function(Le,we){var Xt=g.getAlignmentClassName(we),qn=Le.originalClass?" ".concat(Le.originalClass):"",Kn=Le.thumbnailClass?" ".concat(Le.thumbnailClass):"",Mt=Le.renderItem||ae||g.renderItem,hn=Le.renderThumbInner||pe||g.renderThumbInner,Pt=!ue||Xt||g.lazyLoaded[we];Pt&&ue&&!g.lazyLoaded[we]&&(g.lazyLoaded[we]=!0);var In=g.getSlideStyle(we),Gn=l().createElement("div",{"aria-label":"Go to Slide ".concat(we+1),key:"slide-".concat(we),tabIndex:"-1",className:"image-gallery-slide ".concat(Xt," ").concat(qn),style:In,onClick:W,onKeyUp:g.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:fe,onTouchStart:J,onMouseOver:ee,onFocus:ee,onMouseLeave:ne,role:"button"},Pt?Mt(Le):l().createElement("div",{style:{height:"100%"}}));if(lt.push(Gn),xe&&Le.thumbnail){var Rn=f("image-gallery-thumbnail",Kn,{active:m===we});nt.push(l().createElement("button",{key:"thumbnail-".concat(we),type:"button",tabIndex:"0","aria-pressed":m===we?"true":"false","aria-label":"Go to Slide ".concat(we+1),className:Rn,onMouseLeave:q?g.onThumbnailMouseLeave:null,onMouseOver:function(dt){return g.handleThumbnailMouseOver(dt,we)},onFocus:function(dt){return g.handleThumbnailMouseOver(dt,we)},onKeyUp:function(dt){return g.handleThumbnailKeyUp(dt,we)},onClick:function(dt){return g.onThumbnailClick(dt,we)}},hn(Le)))}if(De){var Hn=f("image-gallery-bullet",Le.bulletClass,{active:m===we});Ge.push(l().createElement("button",{type:"button",key:"bullet-".concat(we),className:Hn,onClick:function(dt){return g.onBulletClick(dt,we)},"aria-pressed":m===we?"true":"false","aria-label":"Go to Slide ".concat(we+1)}))}}),{slides:lt,thumbnails:nt,bullets:Ge}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,I=m.previousIndex,U=m.currentIndex,q=g.length-1;return Math.abs(I-U)>1&&!(I===0&&U===q)&&!(I===q&&U===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,I=m.isTransitioning,U=m.previousIndex,q=m.currentIndex;return I&&!(g===U||g===q)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,I=g.isSwipingThumbnail,U=-this.getThumbsTranslate(m);I||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:U,thumbsSwipedTranslate:U}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,I=g.absX,U=g.dir,q=this.props,W=q.disableSwipe,ue=q.stopPropagation,ce=this.state,fe=ce.galleryWidth,J=ce.isTransitioning,ee=ce.swipingUpDown,ne=ce.swipingLeftRight;if(U!==ot&&U!==st&&!ee||ne){if(U!==bt&&U!==$e||ne||this.setState({swipingLeftRight:!0}),!W){var ae=this.props.swipingTransitionDuration;if(ue&&m.preventDefault(),J)this.setState({currentSlideOffset:0});else{var pe=U===$e?1:-1,xe=I/fe*100;Math.abs(xe)>=100&&(xe=100);var De={transition:"transform ".concat(ae,"ms ease-out")};this.setState({currentSlideOffset:pe*xe,slideStyle:De})}}}else ee||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,I=g.absX,U=g.absY,q=g.dir,W=this.props,ue=W.stopPropagation,ce=W.swipingThumbnailTransitionDuration,fe=this.state,J=fe.thumbsSwipedTranslate,ee=fe.thumbnailsWrapperHeight,ne=fe.thumbnailsWrapperWidth,ae=fe.swipingUpDown,pe=fe.swipingLeftRight;if(this.isThumbnailVertical()){if((q===bt||q===$e||pe)&&!ae)return void(pe||this.setState({swipingLeftRight:!0}));q!==ot&&q!==st||ae||this.setState({swipingUpDown:!0})}else{if((q===ot||q===st||ae)&&!pe)return void(ae||this.setState({swipingUpDown:!0}));q!==bt&&q!==$e||pe||this.setState({swipingLeftRight:!0})}var xe,De,lt,nt,Ge,Le=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(xe=J+(q===st?U:-U),De=Le.scrollHeight-ee+20,lt=Math.abs(xe)>De,nt=xe>20,Ge=Le.scrollHeight<=ee):(xe=J+(q===$e?I:-I),De=Le.scrollWidth-ne+20,lt=Math.abs(xe)>De,nt=xe>20,Ge=Le.scrollWidth<=ne),!Ge&&(q!==bt&&q!==ot||!lt)&&(q!==$e&&q!==st||!nt)){ue&&m.stopPropagation();var we={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:xe,thumbsStyle:we})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,I=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),I&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,I=g.dir,U=g.velocity,q=this.props,W=q.disableSwipe,ue=q.stopPropagation,ce=q.flickThreshold;if(!W){var fe=this.props.isRTL;ue&&m.stopPropagation(),this.resetSwipingDirection();var J=(I===bt?1:-1)*(fe?-1:1),ee=U>ce&&!(I===ot||I===st);this.handleOnSwipedTo(J,ee)}}},{key:"handleOnSwipedTo",value:function(g,m){var I=this.state,U=I.currentIndex,q=I.isTransitioning,W=U;!this.sufficientSwipe()&&!m||q||(W+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(W=U),this.unthrottledSlideToIndex(W)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,I=m.disableKeyDown,U=m.useBrowserFullscreen,q=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!I)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:q&&!U&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new sn(Fe(function(I){I&&I.forEach(function(U){m.setState({thumbnailsWrapperWidth:U.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new sn(Fe(function(I){I&&I.forEach(function(U){m.setState({thumbnailsWrapperHeight:U.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,I=g.useBrowserFullscreen,U=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,q=this.imageGallery.current===U;m&&m(q),I&&this.setState({isFullscreen:q})}},{key:"slideToIndex",value:function(g,m){var I=this.state,U=I.currentIndex,q=I.isTransitioning,W=this.props,ue=W.items,ce=W.slideDuration,fe=W.onBeforeSlide;if(!q){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var J=ue.length-1,ee=g;g<0?ee=J:g>J&&(ee=0),fe&&ee!==U&&fe(ee),this.setState({previousIndex:U,currentIndex:ee,isTransitioning:ee!==U,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var I=this.state,U=I.currentIndex,q=I.isTransitioning,W=this.props.items,ue=U+(m==="left"?-1:1);q||(W.length===2?this.slideToIndexWithStyleReset(ue,g):this.slideToIndex(ue,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var I=this,U=this.state,q=U.currentIndex,W=U.currentSlideOffset;this.setState({currentSlideOffset:W+(q>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return I.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){cr(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){cr(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;dn.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;dn.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,I=m.onPlay,U=m.slideInterval,q=m.slideDuration,W=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(U,q)),I&&g&&I(W))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,I=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(I))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var I=this.props.onImageLoad;!this.loadedImages[m]&&I&&(this.loadedImages[m]=!0,I(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,I=this.props.onImageError||this.handleImageError;return l().createElement(L,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:I,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return l().createElement("span",{className:"image-gallery-thumbnail-inner"},l().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,I=g.isFullscreen,U=g.modalFullscreen,q=g.isPlaying,W=this.props,ue=W.additionalClass,ce=W.disableThumbnailSwipe,fe=W.indexSeparator,J=W.isRTL,ee=W.items,ne=W.thumbnailPosition,ae=W.renderFullscreenButton,pe=W.renderCustomControls,xe=W.renderLeftNav,De=W.renderRightNav,lt=W.showBullets,nt=W.showFullscreenButton,Ge=W.showIndex,Le=W.showThumbnails,we=W.showNav,Xt=W.showPlayButton,qn=W.renderPlayPauseButton,Kn=this.getThumbnailStyle(),Mt=this.getSlideItems(),hn=Mt.slides,Pt=Mt.thumbnails,In=Mt.bullets,Gn=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(ne),{"image-gallery-rtl":J}),Rn=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:Gn},pe&&pe(),this.canSlide()?l().createElement(l().Fragment,null,we&&l().createElement(l().Fragment,null,xe(this.slideLeft,!this.canSlideLeft()),De(this.slideRight,!this.canSlideRight())),l().createElement($n,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},hn))):l().createElement("div",{className:"image-gallery-slides"},hn),Xt&&qn(this.togglePlay,q),lt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},In)),nt&&ae(this.toggleFullScreen,I),Ge&&l().createElement("div",{className:"image-gallery-index"},l().createElement("span",{className:"image-gallery-index-current"},m+1),l().createElement("span",{className:"image-gallery-index-separator"},fe),l().createElement("span",{className:"image-gallery-index-total"},ee.length))),Hn=f("image-gallery",ue,{"fullscreen-modal":U}),dt=f("image-gallery-content",this.getThumbnailPositionClassName(ne),{fullscreen:I}),Rl=f("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(ne),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&J},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ce},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ce});return l().createElement("div",{ref:this.imageGallery,className:Hn,"aria-live":"polite"},l().createElement("div",{className:dt},(ne==="bottom"||ne==="right")&&Rn,Le&&Pt.length>0?l().createElement($n,{className:Rl,delta:0,onSwiping:!ce&&this.handleThumbnailSwiping,onSwiped:!ce&&this.handleOnThumbnailSwiped},l().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},l().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:Kn,"aria-label":"Thumbnail Navigation"},Pt))):null,(ne==="top"||ne==="left")&&Rn))}}],S&&Wn(p.prototype,S),Object.defineProperty(p,"prototype",{writable:!1}),me}(l().Component);Fr.propTypes={flickThreshold:P.number,items:(0,P.arrayOf)((0,P.shape)({bulletClass:P.string,bulletOnClick:P.func,description:P.string,original:P.string,originalHeight:P.number,originalWidth:P.number,loading:P.string,thumbnailHeight:P.number,thumbnailWidth:P.number,thumbnailLoading:P.string,fullscreen:P.string,originalAlt:P.string,originalTitle:P.string,thumbnail:P.string,thumbnailAlt:P.string,thumbnailLabel:P.string,thumbnailTitle:P.string,originalClass:P.string,thumbnailClass:P.string,renderItem:P.func,renderThumbInner:P.func,imageSet:On,srcSet:P.string,sizes:P.string})).isRequired,showNav:P.bool,autoPlay:P.bool,lazyLoad:P.bool,infinite:P.bool,showIndex:P.bool,showBullets:P.bool,showThumbnails:P.bool,showPlayButton:P.bool,showFullscreenButton:P.bool,disableThumbnailScroll:P.bool,disableKeyDown:P.bool,disableSwipe:P.bool,disableThumbnailSwipe:P.bool,useBrowserFullscreen:P.bool,onErrorImageURL:P.string,indexSeparator:P.string,thumbnailPosition:(0,P.oneOf)(["top","bottom","left","right"]),startIndex:P.number,slideDuration:P.number,slideInterval:P.number,slideOnThumbnailOver:P.bool,swipeThreshold:P.number,swipingTransitionDuration:P.number,swipingThumbnailTransitionDuration:P.number,onSlide:P.func,onBeforeSlide:P.func,onScreenChange:P.func,onPause:P.func,onPlay:P.func,onClick:P.func,onImageLoad:P.func,onImageError:P.func,onTouchMove:P.func,onTouchEnd:P.func,onTouchStart:P.func,onMouseOver:P.func,onMouseLeave:P.func,onBulletClick:P.func,onThumbnailError:P.func,onThumbnailClick:P.func,renderCustomControls:P.func,renderLeftNav:P.func,renderRightNav:P.func,renderPlayPauseButton:P.func,renderFullscreenButton:P.func,renderItem:P.func,renderThumbInner:P.func,stopPropagation:P.bool,additionalClass:P.string,useTranslate3D:P.bool,isRTL:P.bool,useWindowKeyDown:P.bool},Fr.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(y,p){return l().createElement(cn,{onClick:y,disabled:p})},renderRightNav:function(y,p){return l().createElement(jn,{onClick:y,disabled:p})},renderPlayPauseButton:function(y,p){return l().createElement(et,{onClick:y,isPlaying:p})},renderFullscreenButton:function(y,p){return l().createElement(Me,{onClick:y,isFullscreen:p})},useWindowKeyDown:!0};const Il=Fr})(),a})())})(ul);var hp=ul.exports;const fp=Ri(hp);function pp(){var e=new Map;function t(n){var r=n.root,i=n.rootMargin,s=n.threshold,a=e.get(r);a||(a=new Map,e.set(r,a));var c=JSON.stringify({rootMargin:i,threshold:s}),f=a.get(c);if(!f){var v=new Map,l=new IntersectionObserver(function(u){u.forEach(function(k){var b=v.get(k.target);b==null||b(k)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:v},a.set(c,f)}return{observe:function(k,b){var w,j;(w=f)==null||w.entryCallbacks.set(k,b),(j=f)==null||j.observer.observe(k)},unobserve:function(k){var b,w;(b=f)==null||b.entryCallbacks.delete(k),(w=f)==null||w.observer.unobserve(k)}}}return{getObserver:t}}var mp="0px",gp=[0],vp=pp();function yp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:mp,i=(n=e==null?void 0:e.threshold)!=null?n:gp,s=A.useRef(null),a=A.useRef(null),c=A.useRef(null),f=A.useState(),v=f[0],l=f[1],u=A.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var D=vp.getObserver({root:a.current,rootMargin:r,threshold:i});D.observe(j,function(C){l(C)}),c.current=D},[r,i]),k=A.useCallback(function(){var j=c.current,D=s.current;D&&(j==null||j.unobserve(D)),c.current=null},[]),b=A.useCallback(function(j){k(),s.current=j,u()},[u,k]),w=A.useCallback(function(j){k(),a.current=j,u()},[u,k]);return[b,{entry:v,rootRef:w}]}function Ei(){return Ei=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ei.apply(this,arguments)}function bp(e){var t,n=yp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=A.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,Ei({},i,{isVisible:s,wasEverVisible:c})]}var xp=100;function wp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?xp:a,f=bp({rootMargin:i}),v=f[0],l=f[1],u=l.rootRef,k=l.isVisible,b=!s&&!t&&k&&n;return A.useEffect(function(){if(b){var w=setTimeout(function(){r()},c);return function(){clearTimeout(w)}}},[r,b,c]),[v,{rootRef:u}]}const Ep={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"/>'},Sp={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>'},Tp={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 Yr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Qr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function dl(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function hl(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function jp(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}var yo={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,"-":Yr?173:189,"=":Yr?61:187,";":Yr?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},Si={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},He={16:!1,18:!1,17:!1,91:!1},Ue={};for(var fr=1;fr<20;fr++)yo["f".concat(fr)]=111+fr;var Ce=[],gs=!1,fl="all",pl=[],Mr=function(t){return yo[t.toLowerCase()]||Jt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function ml(e){fl=e||"all"}function sr(){return fl||"all"}function kp(){return Ce.slice(0)}function Op(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function Ip(e){return typeof e=="string"&&(e=Mr(e)),Ce.indexOf(e)!==-1}function Rp(e,t){var n,r;e||(e=sr());for(var i in Ue)if(Object.prototype.hasOwnProperty.call(Ue,i))for(n=Ue[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;sr()===e&&ml(t||"all")}function Cp(e){var t=e.keyCode||e.which||e.charCode,n=Ce.indexOf(t);if(n>=0&&Ce.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ce.splice(0,Ce.length),(t===93||t===224)&&(t=91),t in He){He[t]=!1;for(var r in Jt)Jt[r]===t&&(mt[r]=!1)}}function Pp(e){if(typeof e>"u")Object.keys(Ue).forEach(function(a){return delete Ue[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Jr(a)});else if(typeof e=="object")e.key&&Jr(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],s=n[1];typeof i=="function"&&(s=i,i=""),Jr({key:e,scope:i,method:s,splitKey:"+"})}}var Jr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=hl(n);c.forEach(function(f){var v=f.split(a),l=v.length,u=v[l-1],k=u==="*"?"*":Mr(u);if(Ue[k]){r||(r=sr());var b=l>1?dl(Jt,v):[];Ue[k]=Ue[k].filter(function(w){var j=i?w.method===i:!0;return!(j&&w.scope===r&&jp(w.mods,b))})}})};function vs(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var s in He)Object.prototype.hasOwnProperty.call(He,s)&&(!He[s]&&t.mods.indexOf(+s)>-1||He[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!He[16]&&!He[18]&&!He[17]&&!He[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function ys(e,t){var n=Ue["*"],r=e.keyCode||e.which||e.charCode;if(mt.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ce.indexOf(r)===-1&&r!==229&&Ce.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(w){var j=Si[w];e[w]&&Ce.indexOf(j)===-1?Ce.push(j):!e[w]&&Ce.indexOf(j)>-1?Ce.splice(Ce.indexOf(j),1):w==="metaKey"&&e[w]&&Ce.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ce=Ce.slice(Ce.indexOf(j))))}),r in He){He[r]=!0;for(var i in Jt)Jt[i]===r&&(mt[i]=!0);if(!n)return}for(var s in He)Object.prototype.hasOwnProperty.call(He,s)&&(He[s]=e[Si[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ce.indexOf(17)===-1&&Ce.push(17),Ce.indexOf(18)===-1&&Ce.push(18),He[17]=!0,He[18]=!0);var a=sr();if(n)for(var c=0;c<n.length;c++)n[c].scope===a&&(e.type==="keydown"&&n[c].keydown||e.type==="keyup"&&n[c].keyup)&&vs(e,n[c],a,t);if(r in Ue){for(var f=0;f<Ue[r].length;f++)if((e.type==="keydown"&&Ue[r][f].keydown||e.type==="keyup"&&Ue[r][f].keyup)&&Ue[r][f].key){for(var v=Ue[r][f],l=v.splitKey,u=v.key.split(l),k=[],b=0;b<u.length;b++)k.push(Mr(u[b]));k.sort().join("")===Ce.sort().join("")&&vs(e,v,a,t)}}}}function Lp(e){return pl.indexOf(e)>-1}function mt(e,t,n){Ce=[];var r=hl(e),i=[],s="all",a=document,c=0,f=!1,v=!0,l="+",u=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(v=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(l=t.splitKey)),typeof t=="string"&&(s=t);c<r.length;c++)e=r[c].split(l),i=[],e.length>1&&(i=dl(Jt,e)),e=e[e.length-1],e=e==="*"?"*":Mr(e),e in Ue||(Ue[e]=[]),Ue[e].push({keyup:f,keydown:v,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Lp(a)&&window&&(pl.push(a),Qr(a,"keydown",function(k){ys(k,a)},u),gs||(gs=!0,Qr(window,"focus",function(){Ce=[]},u)),Qr(a,"keyup",function(k){ys(k,a),Cp(k)},u))}function _p(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Ue).forEach(function(n){var r=Ue[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Zr={setScope:ml,getScope:sr,deleteScope:Rp,getPressedKeyCodes:kp,isPressed:Ip,filter:Op,trigger:_p,unbind:Pp,keyMap:yo,modifier:Jt,modifierMap:Si};for(var ei in Zr)Object.prototype.hasOwnProperty.call(Zr,ei)&&(mt[ei]=Zr[ei]);if(typeof window<"u"){var Np=window.hotkeys;mt.noConflict=function(e){return e&&window.hotkeys===mt&&(window.hotkeys=Np),mt},window.hotkeys=mt}mt.filter=function(){return!0};var gl=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},Ap=function(t){return gl(t,["INPUT","TEXTAREA","SELECT"])};function Dp(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,c=i.keyup,f=i.keydown,v=i.filterPreventDefault,l=v===void 0?!0:v,u=i.enabled,k=u===void 0?!0:u,b=i.enableOnContentEditable,w=b===void 0?!1:b,j=A.useRef(null),D=A.useCallback(function(C,M){var K,G;return a&&!a(C)?!l:Ap(C)&&!gl(C,s)||(K=C.target)!=null&&K.isContentEditable&&!w?!0:j.current===null||document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement)?(t(C,M),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return A.useEffect(function(){if(!k){mt.unbind(e,D);return}return c&&f!==!0&&(n.keydown=!1),mt(e,n||{},D),function(){return mt.unbind(e,D)}},[D,e,k]),j}mt.isPressed;const vl=A.createContext({open:!1,toggleOpen:e=>{}});function Mp({children:e}){const[t,n]=A.useState(!1),r=s=>{n(s??!s)},i=A.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(vl.Provider,{value:i,children:e})}function bo(){return A.useContext(vl)}const vt={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},Fp=e=>lr(async()=>{const{data:t}=await e.get(vt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Bp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...kc(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:i=c=>{t.onFilterChange({...n,keyword:c.title})},emptyCategory:s}=t;!n.category&&!s&&(n.category="All");const a=c=>{const f={...n,...c};r(Br(f,v=>v===""||v===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Br(n,(v,l)=>c.includes(l)):{};r(Br(f,v=>v===""||v===void 0))},handleActiveMenu:c=>{c!==e.menu&&r({menu:c})},handleSort:(c,f)=>{a({sortBy:c,sortDirection:f||c==="nameAsc"?"asc":"desc"})},handleKeyword:c=>{a({category:void 0,keyword:c||void 0})},handlePrice:c=>{a({price:c===e.price?void 0:c})},handleCategory:c=>{a({category:c===e.category?"":c})},handleDeveloper:c=>{a({owner:c||void 0})},handlePage:c=>{a({currentPage:c})},handleSwitchShowResources:c=>{a({showResources:c})},handleSearchSelect:c=>{i(c)}}}const $p=(e,t,n)=>e&&t||!n,yl=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],bl=(e,t,n)=>{var r,i;const s=Oc(e),a=Ic(s.search);if((r=Rc(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Cc({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:v}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Ir(e,{...f||v?{imageFilter:"resize",w:f,h:v}:{},v:c})},Up=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Wp=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),zp=e=>{var t,n;return Array.isArray(e)?e.map(r=>r.message).join(`
|
|
486
|
+
`):(n=(t=e.response)==null?void 0:t.data)!=null&&n.error?e.response.data.error.message||e.response.data.error:e.message||e},qp=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Kp=()=>window.innerWidth<=600,Gp={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}"'}},Hp={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}” 的所有搜索结果"}},ti={en:Co(Gp),zh:Co(Hp)},xl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Vp=e=>(t,n)=>{const r=ti[e]?ti[e][t]:ti.en[t];return qp(r,n)||t},wl={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!1,endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},El=A.createContext(wl),{Provider:Xp,Consumer:wg}=El;function Yp(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=X=>X,extraFilter:v=X=>X,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:k=!1,showCategory:b=!0,tagFilters:w=[],children:j,storeVersion:D,onSearchSelect:C=()=>{},endpoint:M,blockletRender:K,compact:G=!1}=e,T=xl(r,D),F=A.useMemo(()=>zs({baseURL:M,headers:T}),[M]),V=Bp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:C}),[$,le]=A.useState(""),{data:Q=[],error:Oe,loading:oe,run:Xe}=Fp(F),_e=A.useMemo(()=>{const X=jc(Q,[Ne=>Ne.name],["asc"]),Be=X.findIndex(Ne=>Ne.name==="All"||Ne.locales.en==="All");return Be>-1?[{...X[Be],_id:"All"},...X.slice(0,Be),...X.slice(Be+1)]:X},[Q]),Ye=A.useCallback(Vp(t),[t]),ie=A.useMemo(()=>Wp(_e,t),[_e,t]),he=Up(Ye),Fe={search:V,compact:G,errors:{fetchCategoriesError:Oe},loadings:{fetchCategoriesLoading:oe},extraFilter:v,endpoint:M,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Ye,storeVersion:D,serverVersion:r,selectedCategory:V.filters.category||(c.showExplore?"":"All"),categoryList:_e,blockletRender:K,locale:t,categoryOptions:ie,priceOptions:he,storeApi:F,baseSearch:l,showResourcesSwitch:k,showCategory:b,tagFilters:w,onFilterChange:i,getCategoryLocale:X=>{if(!X)return null;const Be=Q.find(Ne=>Ne._id===X||Ne.locales.en==="All");return Be?Be.locales[t]||Be.locales.en:null},get developerName(){return $},updateDeveloperName:le};return A.useEffect(()=>{setTimeout(Xe,u||0)},[M,Xe,u]),o.jsx(Xp,{value:Fe,children:j})}function it(){return A.useContext(El)||wl}function Sl({children:e,onClick:t,size:n=32,...r}){return o.jsx(ar,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function pr(e,t){return e===void 0?t:e}function xo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=Zt(),c=Qt(a.breakpoints.down("sm")),f=Qt(a.breakpoints.between("sm","md")),v=Qt(a.breakpoints.between("md","lg")),l=Qt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:v?n||null:l?r||null:i||null;let u=e;return c||(u=pr(t,u),f)||(u=pr(n,u),v)||(u=pr(r,u),l)?u:pr(i,u)}function Qp({children:e}){const{open:t,toggleOpen:n}=bo();return o.jsx(xo,{xs:o.jsx(Wl,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const Jp=A.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(ar,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(St,{size:"1em"})}));function Ti({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=A.useRef(null),c=Zt(),[f,v]=A.useState(!1),[l,u]=A.useState(e!==null?e:""),k=Qt(c.breakpoints.down("sm"));A.useEffect(()=>{u(e!==null?e:"")},[e]);const b=A.useCallback(()=>{v(!1)},[]),w=A.useCallback(()=>{v(!0)},[]);function j(C){u(C.value),n(C.value),k&&b()}function D(C){return C===l}return o.jsxs(o.Fragment,{children:[o.jsxs(Zp,{ref:a,onClick:w,variant:"outlined",size:"medium",className:["my-select__selector",Jn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(C=>C.value===l))==null?void 0:s.name)||r,o.jsx(ql,{className:"my-select__arrowdown",component:yc,sx:{width:18,height:18}})]}),o.jsx(Kl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:C,placement:M})=>o.jsx(Gl,{...C,style:{transformOrigin:M==="bottom"?"center top":"center bottom"},children:o.jsx(Hl,{children:o.jsx(Vl,{onClickAway:b,children:o.jsx(em,{autoFocusItem:f,onMouseEnter:w,onMouseLeave:b,children:t.map(K=>o.jsxs(Ii,{onClick:()=>j(K),sx:{fontSize:14},children:[o.jsx(Gs,{sx:{mr:1,fontSize:16,visibility:D(K.value)?"visible":"hidden"}}),K.name]},K.value))})})})})})]})}const Zp=en(Jp)`
|
|
487
|
+
border: 1px solid ${e=>e.theme.palette.divider};
|
|
488
|
+
padding: 6px 8px 6px 12px;
|
|
489
|
+
font-weight: ${e=>e.theme.typography.fontWeightRegular};
|
|
490
|
+
font-size: 14px;
|
|
491
|
+
color: ${e=>e.theme.palette.text.secondary};
|
|
492
|
+
line-height: 1;
|
|
493
|
+
text-transform: none;
|
|
494
|
+
& + & {
|
|
495
|
+
margin-left: 10px;
|
|
496
|
+
}
|
|
497
|
+
&.my-select__selector--active {
|
|
498
|
+
&,
|
|
499
|
+
.my-select__arrowdown,
|
|
500
|
+
}
|
|
501
|
+
.my-select__arrowdown {
|
|
502
|
+
color: ${e=>e.theme.palette.grey[400]};
|
|
503
|
+
font-size: 14px;
|
|
504
|
+
margin-left: 6px;
|
|
505
|
+
}
|
|
506
|
+
.my-select__icon {
|
|
507
|
+
font-size: 0;
|
|
508
|
+
svg {
|
|
509
|
+
color: ${e=>e.theme.palette.grey[400]};
|
|
510
|
+
font-size: 18px;
|
|
511
|
+
margin-right: 3px;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
`,em=en(Ds)`
|
|
515
|
+
.my-select__option__icon {
|
|
516
|
+
color: transparent;
|
|
517
|
+
font-size: 14px;
|
|
518
|
+
margin: 0 3px 0 -5px;
|
|
519
|
+
}
|
|
520
|
+
.my-select__option {
|
|
521
|
+
font-size: 14px;
|
|
522
|
+
color: #999;
|
|
523
|
+
}
|
|
524
|
+
.my-select__option--active {
|
|
525
|
+
&,
|
|
526
|
+
.my-select__option__icon {
|
|
527
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
`;function Tl(){const{search:e,t}=it(),{filters:n,handleSort:r,handlePrice:i}=e,s=yl(t);return o.jsxs(rt,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[o.jsx(ki,{control:o.jsx(Oi,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.hint"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(Ti,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function tm({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v,handleActiveMenu:l,handleCategory:u,cleanFilter:k}=n,{toggleOpen:b}=bo();A.useEffect(()=>{b(!1)},[Object.values(v).join("")]);const w=$p(c,a.showSearch,v.keyword);return a.showCategory&&!f?o.jsxs(Qp,{children:[o.jsx(xo,{xs:o.jsxs(rt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(Sl,{onClick:()=>b(!1),children:o.jsx(qs,{})}),o.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(rt,{visibility:s.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:w?o.jsxs(o.Fragment,{children:[a.showExplore&&o.jsxs(Y,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[o.jsxs(Y,{display:"flex",alignItems:"center",gap:1,children:[o.jsx($t,{icon:cf,width:20,height:20}),o.jsx(ge,{variant:"body1",color:!t&&!v.menu?"text.primary":"grey.400",fontWeight:!t&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{b(!1),k()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx($t,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ge,{variant:"body1",color:v.menu===j.key?"text.primary":"grey.400",fontWeight:v.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var D;b(!1),l(j.key),(D=j.onClick)==null||D.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(rt,{gap:2,children:i.map(j=>o.jsx(ge,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"grey.400",textTransform:"capitalize",onClick:()=>{t===j.value?k():u(j.value),b(!1)},children:j.name},j.value))})]}):o.jsx(Tl,{})})]}):null}function wo(){const{endpoint:e,serverVersion:t,storeVersion:n}=it(),r=xl(t,n),i=A.useMemo(()=>zs({baseURL:e,headers:r}),[e]);return{get:async s=>{const{data:a}=await i.get(s);return a},post:async(s,a)=>{const{data:c}=await i.post(s,a);return c}}}const jl=A.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(St,{})})});function bs({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const nm=16/9,ni=292,ji=189,Sr=336;function rm(){var e,t;const{t:n,search:r}=it(),{get:i}=wo(),s=Zt(),a=Qt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:v,loading:l}=lr(async()=>{const C=await i(Ir(vt.blockletsPath,{didList:c.map(M=>M.did).join(",")}));return C!=null&&C.dataList?c.map(M=>C.dataList.find(K=>K.did===M.did)):[]});v&&console.error("Get Banner Blocklets error:",v);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.hint"};return!v&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:ni},minHeight:ni,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:l?o.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[o.jsx(Yt,{variant:"rounded",height:ji,width:Sr}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(Yt,{variant:"text",height:50,width:100}),o.jsx(Yt,{variant:"text",height:40,width:"100%"}),o.jsx(Yt,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(Yt,{variant:"circular",height:20,width:20}),o.jsx(Yt,{variant:"text",height:20,width:50})]}),o.jsx(Yt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(fp,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:C=>o.jsx(Y,{onClick:C,sx:{display:{xs:"none",md:"block"}},children:o.jsx(bu,{sx:{...u,left:5}})}),renderRightNav:C=>o.jsx(Y,{onClick:C,sx:{display:{xs:"none",md:"block"}},children:o.jsx(xu,{sx:{...u,right:5}})}),items:c.map((C,M)=>({original:C.did,renderItem:()=>{var K;const G=f[M]||{},T=C.cover||om(C.did,(K=G.screenshots)==null?void 0:K[0]),F=bl(T,s.breakpoints.values.md*2);return o.jsxs(rt,{height:{xs:"auto",md:ni},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${F}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(G),gap:{xs:2,md:5},children:[k(F),o.jsxs(rt,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[b(C.name||G.title||C.name),w(C.desc||G.description)]}),G.did&&j(G,C.baseNum),D(G)]})]})}}))})})]}):null;function k(C){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Sr},children:o.jsx(sm,{url:C})})}function b(C){return o.jsx(ge,{variant:"h2",width:"100%",children:C})}function w(C){return o.jsx(ge,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:C})}function j(C,M=0){const{did:K,owner:G,stats:T}=C;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(bs,{icon:o.jsx(xr,{src:G.avatar,did:K,size:20,variant:"circle"}),children:G.fullName}),o.jsx(bs,{icon:o.jsx($t,{icon:Ga}),title:`${T.downloads+M}`,children:im(T.downloads+M)})]})}function D(C){return o.jsx(ar,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(C),sx:{width:"fit-content",textTransform:"none",borderRadius:1,borderColor:"grey.300","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const im=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`,om=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function sm({url:e}){const[t,n]=A.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(Yt,{variant:"rectangular",sx:{width:{xs:"100%",md:Sr},height:{xs:"auto",md:ji}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Sr},height:{xs:"auto",md:ji},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:nm},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function am({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=it();return o.jsxs(Y,{mt:3,children:[o.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(ko,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(ko,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":i.did,children:o.jsx(Y,{padding:"1px",children:n({blocklet:i,blocklets:t,serverVersion:r})})},i.did))})]})}function lm(){const{get:e}=wo(),{t}=it(),{data:n=[],error:r,loading:i}=lr(async()=>{const s=await e(vt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(Or,{error:new Error(`Failed to fetch blocklets from ${vt.explorePath}`)}):i?o.jsx(jl,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(rm,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(am,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const ri="__FREE_TEXT__",xs="__NO_RESULT__",ii=40;function kl({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=A.useRef(null),f=A.useRef(!1),[v,l]=A.useState(!1),[u,k]=A.useState(""),[b,w]=A.useState(!1),j=wo(),[D,C]=A.useState(!1),M=(a==null?void 0:a.placeholder)||t("common.searchStore"),K=async ie=>{C(!0);const he=await j.get(vn(e,Ir(vt.blockletsPath,ie)));return C(!1),he.dataList||[]},{data:G,run:T}=lr(ie=>ie?K({sortBy:vt.nameDesc,page:1,pageSize:10,keyword:ie,showResources:"true"}):Promise.resolve([]),{manual:!0});A.useEffect(()=>{C(!0),T(r.keyword),k(r.keyword||"")},[r.keyword,T]),Dp("ctrl + k, command + k",ie=>{var he,Fe;return ie.stopPropagation(),ie.preventDefault(),(Fe=(he=c.current)==null?void 0:he.querySelector("input"))==null||Fe.focus(),!1},{enableOnTags:["INPUT"]});const F=Qs(ie=>T(ie),{wait:300}),V={name:ri,title:u,did:""};let $=[];return u&&(D?$=[V]:G!=null&&G.length?$=[V,...G]:$=[{name:xs,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(zl,{fullScreen:!0,open:b,sx:{display:{md:"none"}},children:[o.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[o.jsx(Ms,{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:M,className:"bl-autocomplete-input",value:u,onChange:ie=>le(ie.target.value),startAdornment:_e(b),endAdornment:Ye()}),o.jsx(ar,{variant:"outlined",onClick:()=>{w(!1),k(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ds,{sx:{p:.5},children:$.map(ie=>oe(ie))})]}),o.jsx(Y,{sx:{display:{sx:"block",md:"none"},paddingTop:1,opacity:.5},children:o.jsx($t,{icon:Ur,style:{fontSize:22,color:"inherit"},onClick:()=>w(!0)})}),o.jsx(Rs,{ref:c,open:!!u&&v,size:"small",onOpen:()=>l(!0),onClose:(ie,he)=>{l(!1),he==="selectOption"&&!f.current&&i(u)},onKeyDown:ie=>{ie.key==="Enter"&&!u&&Q()},disableClearable:!0,inputValue:u,onInputChange:(ie,he)=>le(he),isOptionEqualToValue:(ie,he)=>ie.name===he.name,getOptionLabel:ie=>ie.title,getOptionKey:ie=>ie.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:ie=>o.jsx(Tr,{...ie,InputProps:{...ie.InputProps,autoFocus:!0,placeholder:M,className:"bl-autocomplete-input",value:u,startAdornment:_e(v),endAdornment:Ye()}}),filterOptions:ie=>ie,...a,options:$,renderOption:(ie,he)=>oe(he),value:V,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(a.sx)?a.sx:[a.sx]]})]});function le(ie){C(!0),k(ie),f.current=!1,F.run(ie)}function Q(){w(!1),k(""),le(""),i("")}function Oe(ie){ie!=null&&ie.did?(w(!1),f.current=!0,k(""),s(ie)):ie.name===ri&&(w(!1),i(u))}function oe(ie){var he,Fe;return o.jsxs(Ii,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>Oe(ie),children:[Xe(ie),o.jsxs(ge,{variant:"body1",children:[o.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:ie.title}),o.jsx(ge,{sx:{color:"text.hint"},fontSize:"13px",children:((Fe=(he=ie.category)==null?void 0:he.locales)==null?void 0:Fe[n||"en"])||""})]})]},ie.did)}function Xe(ie){if([ri,xs].includes(ie.name))return o.jsx(Y,{width:ii,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.hint",bgcolor:"grey.100",borderRadius:"8px",children:o.jsx($t,{icon:Ur,style:{fontSize:28}})});let he="";return ie.logo&&(he=vn(e,"assets",ie.did,bl(ie.logo,ii,ie.version))),o.jsx(xr,{src:he,size:ii,style:{borderRadius:"8px",overflow:"hidden"}})}function _e(ie=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.hint"},children:ie&&u&&D?o.jsx(St,{color:"inherit",size:16}):o.jsx($t,{icon:Ur,style:{fontSize:16,cursor:"default"}})})}function Ye(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.hint"},children:o.jsx($t,{icon:Tp,style:{fontSize:20,cursor:"pointer",color:"inherit"},onClick:()=>Q()})}):null}}function cm({placeholder:e,...t}){const{search:n,t:r}=it(),{filters:i,handleKeyword:s}=n,[a,c]=A.useState(i.keyword||""),f=Qs(s,{wait:300}),v=k=>{const{value:b}=k.target;c(b),f.run(b)},l=()=>{c(""),s("")};A.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(um,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(Io,{position:"start",children:o.jsx(dm,{sx:{fontSize:18,ml:-.5}})}),onChange:v,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(Io,{position:"end",children:o.jsx(hm,{"data-cy":"search-delete",onClick:l})}),...t})}const um=en(Ms)`
|
|
531
|
+
background-color: ${e=>e.theme.palette.grey[50]};
|
|
532
|
+
font-size: 14px;
|
|
533
|
+
border-radius: 6px;
|
|
534
|
+
width: 100%;
|
|
535
|
+
.MuiInputBase-input {
|
|
536
|
+
padding: 8px 0 8px 0px;
|
|
537
|
+
}
|
|
538
|
+
.MuiOutlinedInput-notchedOutline {
|
|
539
|
+
border: none;
|
|
540
|
+
}
|
|
541
|
+
.Mui-focused {
|
|
542
|
+
background-color: #f6f6f6;
|
|
543
|
+
.MuiInputBase-input::placeholder {
|
|
544
|
+
color: transparent;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
`,dm=en(uc)`
|
|
548
|
+
color: ${e=>e.theme.palette.grey[500]};
|
|
549
|
+
`,hm=en(qs)`
|
|
550
|
+
color: ${e=>e.theme.palette.grey[500]};
|
|
551
|
+
font-size: 16px;
|
|
552
|
+
cursor: pointer;
|
|
553
|
+
`;function fm(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:v,categoryOptions:l,compact:u}=it(),{filters:k,handleSort:b,handlePrice:w,handleDeveloper:j,handleSwitchShowResources:D,cleanFilter:C,handleCategory:M}=t,K=yl(n);return o.jsxs(rt,{position:"sticky",top:0,zIndex:1e3,className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:u?2:3,sx:{backgroundColor:"background.default"},children:[!u&&o.jsx(ge,{variant:"h2",textTransform:"capitalize",children:s(k.category)}),o.jsxs(rt,{flex:1,direction:"row",alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2,children:[f.showSearch?o.jsx(Y,{flex:1,flexBasis:{xs:"100%",md:"auto"},children:v?o.jsx(cm,{}):o.jsx(kl,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:t.filters,handleKeyword:t.handleKeyword,handleSearchSelect:t.handleSearchSelect})}):null,k.owner&&a&&o.jsx(Oo,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),k.resourceDid&&k.resourceBlocklet&&o.jsx(Oo,{label:n("blocklet.resourceTag",{name:k.resourceBlocklet}),size:"small",onDelete:()=>C(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(ws,{checked:k.showResources!=="false",onChange:G=>D(G?"true":"false"),label:n("common.showResources")}):null,o.jsx(ws,{checked:k.price==="free",onChange:G=>w(G?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(Ti,{value:k.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:G=>M(G)})}),o.jsx(Ti,{value:k.sortBy||K[0].value,options:K,placeholder:n("sort.sort"),onChange:G=>b(G)})]})]})}function ws({checked:e,onChange:t,label:n}){const r=Zt();return o.jsx(ki,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Oi,{checked:e,icon:o.jsx($t,{style:{padding:0,color:r.palette.text.secondary},icon:Ep}),checkedIcon:o.jsx($t,{style:{padding:0,color:r.palette.primary.main},icon:Sp}),size:"large",sx:{p:0,mr:1},onChange:i=>t(i.target.checked)}),label:n})}function mr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.hint",children:[o.jsx(hc,{}),e]})}function Es(){const{t:e}=it();return o.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function oi({filterTip:e,keywordTip:t}){const{t:n,locale:r}=it(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ge,{children:n("blocklet.keywordTip")})]})}function si({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ge,{children:e}),o.jsx(ge,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ge,{children:[t," "]})]})}function pm(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=it(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(mr,{children:[o.jsx(si,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(oi,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(mr,{children:[o.jsx(si,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(oi,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(mr,{children:[a?o.jsx(si,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(Es,{}),o.jsx(oi,{filterTip:!0})]})}return o.jsx(mr,{children:o.jsx(Es,{})})}const mm=(e,t,n,r)=>iu(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:vt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(vt.blockletsPath,{params:c});return n.currentPage++,{page:s,pageSize:a,list:(f==null?void 0:f.dataList)||[],total:(f==null?void 0:f.total)||0}},{isNoMore:i=>i?i.page*i.pageSize>=i.total:!1,reloadDeps:[e,fc(t)],onError:r});function gm(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=it(),{filters:a}=n,c=ru({currentPage:vt.currentPage,pageSize:Kp()?vt.mobilePageSize:vt.pageSize,defaultCurrentPage:vt.defaultCurrentPage}),[f,v]=A.useState(null),l=mm(t,a,c,v),u=A.useMemo(()=>{var k,b;return r?r(((k=l.data)==null?void 0:k.list)||[]):((b=l.data)==null?void 0:b.list)||[]},[l.data,r]);return A.useEffect(()=>{const k=u.find(b=>b.owner.did===a.owner);s((k==null?void 0:k.owner.fullName)||(k==null?void 0:k.author.name)||"")},[a.owner,u,s]),{blocklets:u,fetchBlockletsError:f,loadMore:l.loadMore,hasNextPage:!l.noMore,total:((e=l.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:l.loading,loadingMore:l.loadingMore},errors:{...i,fetchBlockletsError:f}}}function vm(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v}=t,{blocklets:l,errors:u,loadMore:k,loadings:b,hasNextPage:w,total:j}=gm(),[D]=wp({loading:b.fetchBlockletsLoading||b.loadingMore,hasNextPage:w,onLoadMore:k});if(u.fetchBlockletsError){const G=new Error(`Failed to fetch blocklets from ${n}: ${zp(u.fetchBlockletsError)}`);return o.jsx(Or,{error:G})}const C=c&&a.showSearch||!v.keyword;return o.jsxs(o.Fragment,{children:[C?o.jsx(fm,{}):o.jsxs(o.Fragment,{children:[o.jsx(xo,{xs:o.jsx(Tl,{}),md:null}),K()]}),M(),!b.fetchBlockletsLoading&&w&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:D,children:b.loadingMore?o.jsx(St,{}):null})]});function M(){return b.fetchBlockletsLoading?o.jsx(jl,{mt:15}):l.length?o.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${s}px, 1fr))`},p:"2px",rowGap:2,columnGap:f?0:2,children:l.map(G=>o.jsx(Y,{"data-blocklet-did":G.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:G,blocklets:l,serverVersion:i})},G.did))}):o.jsx(pm,{})}function K(){return o.jsxs(rt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ge,{variant:"h3",title:v.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:v.keyword})}),o.jsx(ge,{variant:"body1",color:"text.hint",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function ym(){var e,t,n;const{t:r,selectedCategory:i,getCategoryLocale:s,locale:a,search:c}=it(),{toggleOpen:f}=bo(),v=dc().arcSphere,l=!!((t=(e=window.blocklet)==null?void 0:e.navigation)!=null&&t.some(u=>u.section==="bottomNavigation"));return o.jsxs(Y,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[o.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(Sl,{onClick:()=>f(!0),children:o.jsx(vc,{})}),s(i)||r("common.category")]}),v&&l&&o.jsx(kl,{locale:a,endpoint:((n=window.blocklet)==null?void 0:n.prefix)||"/",sx:{display:{md:"block",xs:"none"},mr:1,width:"350px"},t:r,filters:c.filters,handleKeyword:c.handleKeyword,handleSearchSelect:c.handleSearchSelect})]})}function bm({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=it(),{filters:a}=r,c=A.useRef(null),f=a.category||a.keyword||a.price,v=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Mp,{children:o.jsxs(Ks,{FallbackComponent:Or,children:[!s&&o.jsx(ym,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(tm,{menus:e}),o.jsxs(rt,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[v&&(t==null?void 0:t(v)),!v&&(i.showExplore&&!f?o.jsx(lm,{}):o.jsx(vm,{}))]})]})]})})}function xm(e){const{menus:t,children:n,...r}=e,i=Zt(),s=Ns(Tc({},i,{typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return o.jsx(As,{theme:s,children:o.jsx(Yp,{...r,children:o.jsx(bm,{menus:t,children:n})})})}const wm={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"/>'},Em={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>'},Sm={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>'},Tm=Sm,jm={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"/>'},km=(e,t)=>!t||!e?!0:li.satisfies(li.coerce(e),t);function Eo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=gt();return km(t,n)?e:o.jsx(_s,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ge,{children:o.jsx(ar,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}Eo.propTypes={children:_.node.isRequired,serverVersion:_.string,requirementVersion:_.string};Eo.defaultProps={serverVersion:"",requirementVersion:""};const Om=(e,t)=>vn(t,`/blocklets/${e.did}`),Ss=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Im=e=>e.inStore&&Ut.isFreeBlocklet(e)===!1;function So({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var D,C;const{t:s}=gt();let a=vn(r,$c(e.did,e.logo||""));try{const M=new URL(a);M.searchParams.set("v",e.version||+new Date),a=M.href}catch{}const[c,f]=A.useState(!1),v=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(M){kr.error(M.message)}finally{f(!1)}},{blocklet:l}=Rr(),u=()=>((l==null?void 0:l.children)||[]).find(G=>G.meta.bundleDid===e.did).meta.version,b=(()=>{const M=((l==null?void 0:l.children)||[]).find(K=>K.meta.bundleDid===e.did);if(M){try{const K=M.meta.version,G=e.version;if(li.gt(G,K))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),w=(D=e.requirements)==null?void 0:D.server,j=[];return b==="upgrade"?j.push({key:"upgrade",icon:o.jsx(pt,{icon:jm,color:"success.light",width:20,height:20},"version"),title:`${u()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:o.jsx(Y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):b==="disable"?j.push({key:"disable",icon:o.jsx(pt,{icon:wm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Im(e)&&j.push({key:"purchase",icon:o.jsx(pt,{icon:Em,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(Rm,{title:Ss({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Ss({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:b!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:b==="disable"?void 0:v,icons:(C=e.docker)!=null&&C.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(pt,{icon:Tm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(Eo,{serverVersion:i,requirementVersion:w,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(sf,{children:o.jsx(ft,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:M=>{M.preventDefault(),M.stopPropagation();const K=Om(e,r);K&&window.open(K,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}So.propTypes={blocklet:_.object.isRequired,blocklets:_.array,handleButtonClick:_.func,endpoint:_.string,serverVersion:_.string};So.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function To({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:v,compact:l,...u}){const k=Zt(),{locale:b}=gt(),[w,j]=A.useState(!1),[D,C]=A.useState({}),M=T=>{C(T)},K=n,G=A.useMemo(()=>Ns(k,{palette:{background:{default:k.palette.background.paper}}}),[k]);return A.useEffect(()=>{C({showResources:!0,resourceType:a,resourceDid:c})},[K,a,c]),A.useEffect(()=>{j(!0),C({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(As,{theme:G,children:o.jsx(Ks,{FallbackComponent:Or,resetKeys:[K],children:o.jsxs(Y,{...u,sx:pc({overflow:"auto",".title-bar + div":{height:"unset"}},u.sx),children:[w&&o.jsx(xm,{showCategory:v,showResourcesSwitch:f,blockletRender:T=>{const F={...T,handleButtonClick:e,endpoint:K};return r({...T,defaultRender:o.jsx(So,{...F})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:K,locale:b,onFilterChange:M,onSearchSelect:t,filters:D,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}To.propTypes={storeUrl:_.string.isRequired,handleButtonClick:_.func,handleSearchSelect:_.func,handleBlockletRender:_.func,extraFilter:_.func,serverVersion:_.string,resourceType:_.string,resourceDid:_.string,showResourcesSwitch:_.bool,showCategory:_.bool,compact:_.bool};To.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Rm=Ve(lf)`
|
|
554
|
+
.ms-highlight {
|
|
555
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
556
|
+
}
|
|
557
|
+
`,jo=A.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=Zt(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=bc(),{t:v,locale:l}=gt(),u=s[a];return A.useEffect(()=>{n(a)},[n,a]),A.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(Pm,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:o.jsx(xc,{locale:l,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?Uc({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:i,stepTip:v("blocklet.component.add"),children:o.jsx(Cm,{children:typeof(u==null?void 0:u.body)=="function"?u.body():u==null?void 0:u.body})})})});jo.propTypes={meta:_.any,onStepChange:_.func.isRequired,isMobile:_.bool.isRequired};jo.defaultProps={meta:null};const Ts=e=>e.isMobile?`
|
|
558
|
+
height: calc(100vh - 56px - 64px - 48px);
|
|
559
|
+
`:"",Cm=Ve.div`
|
|
560
|
+
width: 100%;
|
|
561
|
+
height: 100%;
|
|
562
|
+
display: flex;
|
|
563
|
+
flex-direction: column;
|
|
564
|
+
justify-content: flex-start;
|
|
565
|
+
align-items: flex-start;
|
|
566
|
+
|
|
567
|
+
.bottom-button {
|
|
568
|
+
min-width: 200px;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// blocklet-select-side
|
|
572
|
+
aside {
|
|
573
|
+
width: 140px;
|
|
574
|
+
}
|
|
575
|
+
`,Pm=Ve(Y)`
|
|
576
|
+
${({className:e})=>e==="mobileStyle"?`
|
|
577
|
+
& > div{
|
|
578
|
+
height: 100%;
|
|
579
|
+
}
|
|
580
|
+
.root-header {
|
|
581
|
+
.app-name-content {
|
|
582
|
+
display: none;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// content-panel
|
|
587
|
+
.root-header + div{
|
|
588
|
+
padding-top: 0;
|
|
589
|
+
position: relative;
|
|
590
|
+
& > div {
|
|
591
|
+
padding-top: 0;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
header + div {
|
|
596
|
+
padding-top: 0;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
header {
|
|
600
|
+
.header-title {
|
|
601
|
+
margin-left: 0;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.header-title-name {
|
|
605
|
+
max-width: 100% !important;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
.app-content {
|
|
609
|
+
padding: 0!important;
|
|
610
|
+
}
|
|
611
|
+
`:`
|
|
612
|
+
position: relative;
|
|
613
|
+
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
614
|
+
width: 100%;
|
|
615
|
+
height: 100%;
|
|
616
|
+
border-radius: 0;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.root-header {
|
|
620
|
+
z-index: auto !important;
|
|
621
|
+
position: fixed !important;
|
|
622
|
+
}
|
|
623
|
+
& > div {
|
|
624
|
+
height: 100%;
|
|
625
|
+
width: 100%;
|
|
626
|
+
max-width: 100%;
|
|
627
|
+
& > div {
|
|
628
|
+
max-height: unset !important;
|
|
629
|
+
max-width: 100%;
|
|
630
|
+
& > div {
|
|
631
|
+
// left-panel
|
|
632
|
+
&:first-of-type {
|
|
633
|
+
padding: 0;
|
|
634
|
+
width: 20%;
|
|
635
|
+
min-width: 180px;
|
|
636
|
+
|
|
637
|
+
& > div:first-of-type {
|
|
638
|
+
display: none;
|
|
639
|
+
}
|
|
640
|
+
// step
|
|
641
|
+
& > div:last-child {
|
|
642
|
+
// margin-top: 32px;
|
|
643
|
+
margin-top: 0;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
// right-panel
|
|
647
|
+
&:last-child {
|
|
648
|
+
padding-top: 0;
|
|
649
|
+
padding-right: 0px;
|
|
650
|
+
overflow-y: hidden;
|
|
651
|
+
.app-content {
|
|
652
|
+
padding: 0 0 24px 0;
|
|
653
|
+
}
|
|
654
|
+
.button-container {
|
|
655
|
+
padding-right: 0;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
`}
|
|
663
|
+
|
|
664
|
+
& .ll-container {
|
|
665
|
+
background: ${({theme:e})=>e.palette.background.paper};
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
& .app-overview {
|
|
669
|
+
margin-left: 0 !important;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
& .flex-justify-center {
|
|
673
|
+
display: flex;
|
|
674
|
+
justify-content: center;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
& .flex-align-center {
|
|
678
|
+
display: flex;
|
|
679
|
+
height: 100%;
|
|
680
|
+
align-items: center;
|
|
681
|
+
${e=>Ts(e)}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
& .agreement-wrapper {
|
|
685
|
+
${e=>Ts(e)}
|
|
686
|
+
max-height: 60vh;
|
|
687
|
+
.eula-trigger {
|
|
688
|
+
padding-right: 0;
|
|
689
|
+
}
|
|
690
|
+
.next-button {
|
|
691
|
+
display: none;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
& .connect {
|
|
696
|
+
background: white;
|
|
697
|
+
}
|
|
698
|
+
`,Lm=jo,_m=(e,t)=>{var n;return(n=((e==null?void 0:e.children)||[]).find(r=>r.mountPoint===t))==null?void 0:n.meta},Nm=e=>e.inStore&&Ut.isFreeBlocklet(e)===!1,Am=e=>{var t;return[wt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,wt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},ai=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===wt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Dm=e=>(e.environments||[]).some(t=>t.required),js=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Mm=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},ks=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Ol({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:v,showFromUrl:l,enableRunBackground:u,showCategory:k,installFromUrlParams:b}){var Tn,P,kt,ln,Nt,d,x,E,L,B;const{t:w,locale:j}=gt(),[D,C]=A.useState(!1),[M,K]=A.useState(null),[G,T]=A.useState(""),[F,V]=A.useState(""),{api:$,ws:{useSubscription:le},inService:Q,info:Oe}=Nn(),{blocklet:oe,actions:{refreshBlocklet:Xe}}=Rr(),[_e,Ye]=A.useState(null),[ie,he]=A.useState(!1),Fe={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:""},[X,Be]=A.useState(Fe),[Ne,ct]=A.useState(0),ve=A.useRef({}),Ze=A.useRef({}),ut=A.useRef({}),zt=Qt(R=>R.breakpoints.down("md")),Tt=Ql(),[yt,qe]=A.useState(!0),{meta:H}=ve.current,be=ea(H),de=A.useRef(!1),Ee=R=>Be(N=>({...N,...R}));A.useEffect(()=>{if(X.pathPrefix){const{errMsg:R}=bt({...X,pathPrefix:X.pathPrefix,locale:j});T(R)}},[X.pathPrefix]),A.useEffect(()=>{Ne===0&&Be(Fe)},[Ne]);const tn=()=>{const R=ai(oe)??"";Ee({didSpaceEndpoint:R})},nn=()=>{var R;return(R=ve==null?void 0:ve.current)!=null&&R.meta?Ut.getDisplayName(ve.current):""},Ie=()=>{C(!1),Be({}),de.current=!1,ve.current={},e()},rn=R=>{const N=te=>{Ee({installResultProps:{variant:"error",title:nn(),subTitle:R,footer:o.jsx(ft,{className:"bottom-button",disabled:te,"data-cy":"retry-install-component",onClick:async()=>{N(!0),await sn(ve.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[te&&o.jsx(St,{size:16,style:{marginRight:8}}),w("common.retry")]})})}})};N()},qt=R=>N=>{var te,Z;(((te=N==null?void 0:N.meta)==null?void 0:te.did)||(N==null?void 0:N.meta))===((Z=oe==null?void 0:oe.meta)==null?void 0:Z.did)&&R(N)},Dn=()=>{ks({timeout:0,componentDid:Tt.componentDid,manual:!0}),Ie(),setTimeout(()=>{const R=document.getElementsByClassName("dashboard-main")[0];R&&(R.scrollTop=R.scrollHeight)},200)};le(wt.BlockletEvents.componentInstalled,qt(()=>{Ee({installResultProps:{variant:"success",title:nn(),subTitle:w("blocklet.component.installSuccessTip")}}),ks({componentDid:Tt.componentDid})}),[(Tn=oe==null?void 0:oe.meta)==null?void 0:Tn.did]),le(wt.BlockletEvents.statusChange,qt(()=>{const R=ai(oe);Ee(N=>({...N,didSpaceEndpoint:R}))}),[(P=oe==null?void 0:oe.meta)==null?void 0:P.did]),le(wt.BlockletEvents.downloadFailed,qt(()=>{de.current=!1,rn(w("blocklet.component.installComponentError"))}),[(kt=oe==null?void 0:oe.meta)==null?void 0:kt.did]),le(wt.BlockletEvents.installFailed,qt(()=>{de.current=!1,rn(w("blocklet.component.installComponentError"))}),[(ln=oe==null?void 0:oe.meta)==null?void 0:ln.did]);const Qe=[],on=R=>((oe==null?void 0:oe.children)||[]).find(N=>N.meta.did===R),sn=async R=>{var It,Rt;de.current=!0;const{pathPrefix:N,bundleDid:te,title:Z,componentName:Se="",componentDid:Ae=""}=X,je=((It=ve.current)==null?void 0:It.meta)||{},{configs:Re=[],registryUrl:Me,inStore:Ot,inputUrl:cn,dist:un}=je,jn=(Rt=ve.current)==null?void 0:Rt.downloadTokenList,Gt=cn||(Ot?No(Me,te,un):"");C(!0);const et={rootDid:oe.meta.did,url:Gt,mountPoint:N?ur(N):`/${ur(je.title||je.name)}`,title:Z,name:Se,did:X.isUpload&&X.upgradeDid?X.upgradeDid:Ae,dist:{tarball:"",integrity:""},onlyRequired:!yt,...X.hasEnvironmentsStep&&Re.length>0?{configs:Re.map(at=>({...at,value:X.configsValue[at.key]||""}))}:{},...jn?{downloadTokenList:jn}:{},...R};try{if(await $.installComponent({input:et}),Me){const{teamDid:at,storeList:Ct}=Xs({fromBlocklet:Q,nodeInfo:Oe,blocklet:oe}),{isNew:Mn,decoded:Fn}=qc(Me,Ct);Mn&&await $.addBlockletStore({input:{teamDid:at,url:Fn}})}Ee({installResultProps:{}}),Xe({showError:!1,attachRuntimeInfo:!1})}catch(at){const Ct=ci(at);kr.error(Ct),console.error("installComponent error: ",at),rn(Ct)}finally{C(!1),ve.current.installInput=et}},bt=R=>{const N=hu({params:{...R,did:R.bundleDid},blocklets:[oe],blocklet:oe,locale:j,isUpload:X.isUpload});let te=N;const Z=_m(oe,X.pathPrefix);if(N==="overwrite"&&Z&&Z.did!==R.bundleDid?(Ee({upgradeDid:Z.did}),te=""):(Ee({upgradeDid:""}),te=N),te){const Se=on(R.bundleDid),Ae=fu({params:{...R,did:R.bundleDid},blocklet:oe});if(Se&&Se.mountPoint===Ae)return{errMsg:""}}return{errMsg:te}},$e=async R=>{var te,Z;const{errMsg:N}=bt({...X,locale:j});T(N),Ne===Qe.length-2&&!de.current&&await sn(R),(Z=(te=Ze.current)==null?void 0:te.setActiveStepByIndex)==null||Z.call(te,Se=>Se+1)},ot=()=>{var R,N;(N=(R=Ze.current)==null?void 0:R.setActiveStepByIndex)==null||N.call(R,te=>te-1)},st=()=>{const{pathPrefix:R,bundleDid:N,title:te,componentName:Z="",componentDid:Se=""}=X,{meta:Ae={}}=ve.current||{},{registryUrl:je,inStore:Re,inputUrl:Me,dist:Ot}=Ae,cn=Re?No(je,N,Ot):Me;Ye({meta:Ae,installOpts:{type:"component",rootDid:oe.meta.did,mountPoint:R,url:cn,title:te,name:Z,did:Se}})},jt=R=>{he(!1),Ee({purchaseResultProps:{variant:"error",title:nn(),subTitle:R,style:{paddingTop:120},footer:o.jsx(ft,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{Ee({purchaseResultProps:{}})},children:w("common.retry")})}})},an=({downloadTokenList:R})=>{ve.current.downloadTokenList=R,he(!1),$e()},Kt=({chooseParams:R=ve.current,componentDid:N,isInit:te=!1,isUpload:Z=!1})=>{var Bn,$n,At,Un;const{meta:Se,registryUrl:Ae,inStore:je,inputUrl:Re}=R,{did:Me,title:Ot,name:cn}=Se,un=(((Bn=oe.settings)==null?void 0:Bn.children)||[]).filter(tt=>tt.status==="deleted"&&tt.meta.bundleDid===Me),jn=N||"",Gt=($n=Se.environments)==null?void 0:$n.map(tt=>{const{name:Wn,validation:Ht,...kn}=tt,ke={validation:Lc(Ht)?"":Ht};return{...kn,key:Wn,...ke}});ve.current={...R,meta:{...Se,configs:Gt,registryUrl:Ae,inStore:je,inputUrl:Re}};let et={};if(te){const tt=[oe],Wn=Gt||[],Ht=[],kn=Vs(Pc([...Wn,...Ht]),"key").filter(Dt=>!!Dt.key).sort((Dt,dn)=>Dt.required&&!dn.required?-1:dn.required&&!Dt.required?1:0),ke=Ut.getSharedConfigObj(tt[0],{configs:kn}),Vt={},zn=kn.map(Dt=>{const{default:dn,key:On,...cr}=Dt;return Vt[On]=ke[On]||dn,{...cr,key:On,hidden:!!wt.BLOCKLET_CONFIGURABLE_KEY[On]}});et={...et,configsList:zn,configsValue:Vt,hasMissRequiredConfigs:js(zn,Vt)}}const It=oe.children.some(tt=>tt.mountPoint==="/"),Rt=un.find(tt=>tt.meta.bundleDid===Me),at=oe.children.find(tt=>tt.meta.bundleDid===Me);et.title=Ot||"",Rt?et={...et,pathPrefix:Rt.mountPoint||"",componentName:Rt.meta.name,hasEnvironmentsStep:!1}:at?et={...et,pathPrefix:at.mountPoint||"",componentName:at.meta.name,hasEnvironmentsStep:!1}:et={...et,pathPrefix:It?`/${ur(Ot)||ur(cn)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Un=(At=ve.current.meta)==null?void 0:At.environments)==null?void 0:Un.length)>0};const Ct=Nm(ve.current.meta),Mn=Am(ve.current.meta),Fn=ai(oe);Ee({bundleDid:Me,componentDid:jn,...et,hasRequiredEnvironments:Dm(ve.current.meta),requirePurchase:Ct,didSpaceIsRequiredSetup:Mn,didSpaceEndpoint:Fn,isUpload:Z}),te&&Ct&&st()};A.useEffect(()=>{if(!c&&!(b!=null&&b.meta)||Ne!==0||!oe)return;const{meta:R,inputUrl:N="",inStore:te=!0,registryUrl:Z="",isUpload:Se=!1}=b||{};Kt({chooseParams:{blocklets:[c||R],meta:c||R,registryUrl:Z||f||c.homepage,inStore:te,inputUrl:N},isInit:!0,isUpload:Se}),Ee({showFromUrlDialog:!1}),$e()},[c,Ne,oe,b]),Qe.push({key:"selectComponent",name:w("blocklet.component.selectComponent"),body:o.jsxs(fn,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&X.showFromUrlDialog&&o.jsx(io,{mode:"component",onCancel:()=>{Ee({showFromUrlDialog:!1})},onSuccess:({meta:R,inputUrl:N,inStore:te,registryUrl:Z})=>{Kt({chooseParams:{meta:R,inputUrl:N,inStore:te,registryUrl:Z},isInit:!0}),Ee({showFromUrlDialog:!1}),$e()},handleText:{title:w("blocklet.component.addComponentTip.fromUrl"),confirm:w("blocklet.component.choose")}}),o.jsx(co,{stores:n,extra:Bs.isInServerlessMode(Oe)?null:l?o.jsxs(ft,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{Ee({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Zs,{style:{fontSize:20,marginRight:4}}),w("blocklet.component.addComponentTip.fromUrl")]}):null,loading:D,onChange:()=>{Be({}),ve.current={}},storageKey:s,children:({currentRegistry:R})=>o.jsx(To,{showResourcesSwitch:v,showCategory:k,serverVersion:Oe==null?void 0:Oe.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:R.url,resourceType:r,resourceDid:i,handleButtonClick:N=>{Kt({chooseParams:{...N,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:N,defaultRender:te})=>{const Z=(X==null?void 0:X.bundleDid)&&(X==null?void 0:X.bundleDid)===(N==null?void 0:N.did);return o.jsxs(Bm,{children:[o.jsx(Y,{className:Z?"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",...Z?{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:te}),Z&&o.jsx(Y,{className:"check-container",children:o.jsx(Gs,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:w("common.cancel"),confirm:Mm({params:X,blocklet:oe,t:w}),onCancel:Ie,onConfirm:()=>{$e()}}),Qe.push({key:"agreement",name:w("launchBlocklet.introduction"),body:o.jsxs(fn,{component:"div",className:"agreement-wrapper",children:[o.jsx(Hs,{title:w("launchBlocklet.introduction"),subTitle:w("blocklet.component.addComponentTip.introduction")}),H?o.jsx($i,{meta:H,onClickNext:$e,installRelated:yt,onChangeInstallRelated:qe,handleDescEle:o.jsx("p",{children:w("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:w("common.pre"),disabled:!be,confirm:w(be?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Ie:ot,onConfirm:()=>{he(!1),$e()}}),H&&X.requirePurchase&&Qe.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[w("common.verifyNFT"),o.jsx($r,{})]}),body:o.jsxs(fn,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((d=(Nt=ut.current)==null?void 0:Nt.getCurrentStep)==null?void 0:d.call(Nt))===2||ie)&&o.jsx(gr,{title:w("common.verifyNFT"),subTitle:w("blocklet.component.addComponentTip.verifyNFT")}),Jn(X.purchaseResultProps)?_e&&o.jsx(Zh,{ref:ut,meta:_e.meta,mode:X.componentDid?"verify":"both",onCancel:jt,installOpts:_e.installOpts,handlePaySuccess:an}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Lo,{...X.purchaseResultProps})})]}),disabled:((E=(x=ut.current)==null?void 0:x.getCurrentStep)==null?void 0:E.call(x))===2||ie,cancel:w("common.pre"),confirm:w("common.next"),onConfirm:()=>{typeof ut.current.onNext=="function"&&(ut.current.onNext(),he(!0))},onCancel:()=>{ot()}}),Ut.hasStartEngine(H)&&Wc.hasMountPoint(H)?Qe.push({key:"config",name:w("common.config"),error:G,body:o.jsxs(fn,{component:"div",children:[o.jsx(gr,{title:w("common.config"),subTitle:w("blocklet.component.addComponentTip.config")}),o.jsx(Tr,{label:w("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:F||w("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:X.pathPrefix,onChange:R=>{const N=R.target.value;Ee({pathPrefix:N}),V(w("common.slugifyHint",{value:zc(N)}))}}),!!G&&o.jsx(Ls,{severity:"error",style:{width:"100%",marginTop:8},children:G})]}),cancel:w("common.pre"),confirm:w("common.next"),onCancel:ot,onConfirm:()=>{$e()}}):H&&(X.pathPrefix=((B=(L=H.interfaces)==null?void 0:L[0])==null?void 0:B.path)||`/${H.did}`),H&&(X!=null&&X.hasEnvironmentsStep)&&Qe.push({key:"environment",name:o.jsxs(o.Fragment,{children:[w("common.environment")," ",X.hasRequiredEnvironments&&o.jsx($r,{})]}),disabled:!!M||(X==null?void 0:X.hasMissRequiredConfigs),body:()=>o.jsxs(fn,{component:"div",style:{overflowY:"auto"},children:[o.jsx(gr,{title:w("common.environment"),subTitle:w("blocklet.component.addComponentTip.environment")}),o.jsx(Hc,{style:{marginTop:-12,width:"100%"},schema:X.configsList,defaultValue:X.configsValue,onChange:(R,{action:N,currentItem:te,allValues:Z})=>{N==="confirm"&&Ee({hasMissRequiredConfigs:js(X.configsList,Z),configsValue:Z}),N==="edit"?K(te):["cancel","confirm"].includes(N)&&K(null)}})]}),cancel:w("common.pre"),confirm:w("common.next"),onCancel:ot,onConfirm:$e}),H&&(X!=null&&X.didSpaceIsRequiredSetup)&&Qe.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[w("blocklet.component.didSpaceConfig")," ",X.didSpaceIsRequiredSetup==="required"&&o.jsx($r,{})]}),disabled:(X==null?void 0:X.didSpaceIsRequiredSetup)&&!X.didSpaceEndpoint,body:()=>o.jsx(Gc,{children:o.jsxs(fn,{component:"div",children:[o.jsx(gr,{title:w("blocklet.component.didSpaceConfig"),subTitle:w("blocklet.component.didSpaceConfigTip")}),o.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:o.jsx(lo,{blockletMeta:ve.current.meta,onNext:()=>{$e()},onEndpointUpdate:tn})})]})}),cancel:w("common.pre"),confirm:w("common.next"),onCancel:ot,onConfirm:$e}),Qe.push({key:"install",name:on(H==null?void 0:H.did)?w("common.upgrade"):w("common.install"),disabled:u?!1:Jn(X.installResultProps),loading:u?!1:Jn(X.installResultProps),body:o.jsx(fn,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Jn(X.installResultProps)?o.jsx(mc,{message:o.jsx($m,{children:w(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Lo,{...X.installResultProps})})}),confirm:w("common.complete"),onConfirm:Dn});const Ke=Qe[Ne]||{},Sn=()=>D||Ke.error||!X.bundleDid?!0:Ne>1?!X.pathPrefix:!1;return oe?o.jsxs(Fm,{sx:a?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[o.jsx(wc,{steps:Qe,mode:"memory",children:o.jsx(Lm,{ref:Ze,meta:H,isMobile:zt,onStepChange:R=>{ct(R)}})}),o.jsxs(Y,{className:"action-bar",children:[Ke.cancel&&o.jsx(ft,{onClick:R=>{R.stopPropagation(),Ke.onCancel()},disabled:Ne===Qe.length-2&&D,color:"inherit",children:Ke.cancel||w("common.cancel")}),Ke.confirm&&o.jsx(ft,{onClick:R=>{R.stopPropagation(),Ke.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:D||(typeof Ke.disabled=="boolean"?Ke.disabled:Sn()),variant:"contained",autoFocus:!0,title:Ke.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ke.loading=="boolean"?Ke.loading:D)&&o.jsx(St,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke.confirm})]})})]})]}):null}Ol.propTypes={onClose:_.func,mode:_.oneOf(["normal","embed"]),inDialog:_.bool,stores:_.arrayOf(_.string),storeUrl:_.string,resourceType:_.string,resourceDid:_.string,storageKey:_.string,selectedMeta:_.object,showResourcesSwitch:_.bool,showFromUrl:_.bool,enableRunBackground:_.bool,showCategory:_.bool,installFromUrlParams:_.object};Ol.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0,installFromUrlParams:null};const Fm=Ve(Y)`
|
|
699
|
+
.action-bar {
|
|
700
|
+
display: flex;
|
|
701
|
+
justify-content: flex-end;
|
|
702
|
+
position: sticky;
|
|
703
|
+
bottom: 0;
|
|
704
|
+
padding-top: 16px;
|
|
705
|
+
z-index: 100;
|
|
706
|
+
width: 100%;
|
|
707
|
+
background: ${({theme:e})=>e.palette.background.paper};
|
|
708
|
+
border-top: '1px solid';
|
|
709
|
+
border-color: ${({theme:e})=>e.palette.divider};
|
|
710
|
+
}
|
|
711
|
+
`,fn=Ve(ge)`
|
|
712
|
+
width: 100%;
|
|
713
|
+
height: 100%;
|
|
714
|
+
`,gr=Ve(Hs)`
|
|
715
|
+
margin-bottom: 24px;
|
|
716
|
+
`,Bm=Ve.div`
|
|
717
|
+
position: relative;
|
|
718
|
+
|
|
719
|
+
.choose-blocklet {
|
|
720
|
+
background-color: rgb(236, 251, 253);
|
|
721
|
+
border-color: rgb(236, 251, 253);
|
|
722
|
+
border-radius: 8px;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.check-container {
|
|
726
|
+
position: absolute;
|
|
727
|
+
right: 0;
|
|
728
|
+
bottom: 0;
|
|
729
|
+
display: flex;
|
|
730
|
+
justify-content: flex-end;
|
|
731
|
+
align-items: flex-end;
|
|
732
|
+
width: 30px;
|
|
733
|
+
height: 30px;
|
|
734
|
+
border-radius: 0 0 8px 0;
|
|
735
|
+
color: ${e=>e.theme.palette.common.white};
|
|
736
|
+
overflow: hidden;
|
|
737
|
+
transition: all ease 0.3s;
|
|
738
|
+
&:after {
|
|
739
|
+
position: absolute;
|
|
740
|
+
z-index: 0;
|
|
741
|
+
display: block;
|
|
742
|
+
width: 0;
|
|
743
|
+
height: 0;
|
|
744
|
+
border-top: transparent solid 15px;
|
|
745
|
+
border-left: transparent solid 15px;
|
|
746
|
+
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
747
|
+
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
748
|
+
transition: all ease 0.1s;
|
|
749
|
+
content: '';
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.check-icon {
|
|
753
|
+
position: relative;
|
|
754
|
+
z-index: 2;
|
|
755
|
+
margin: 0 1px 1px 0;
|
|
756
|
+
font-size: 16px;
|
|
757
|
+
transition: all ease 0.2s;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
`,$m=Ve.div`
|
|
761
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
762
|
+
.msg-before {
|
|
763
|
+
display: inline-block;
|
|
764
|
+
color: #aaa;
|
|
765
|
+
font-size: 14px;
|
|
766
|
+
margin-right: 6px;
|
|
767
|
+
}
|
|
768
|
+
`;export{Ol as A,Wa as B,io as I,xg as S,yg as a,bg as b,Tm as c,Zs as d,aa as f};
|