@abtnode/webapp 1.16.33 → 1.16.34-beta-20241120-080738-bbbe036c
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/README.md +1 -1
- package/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{Add-1IpBHqiQ.js → Add-Dh_DeTW0.js} +1 -1
- package/dist/assets/{ArrowDropDown-CO_v_gGe.js → ArrowDropDown-CFRRmuNz.js} +1 -1
- package/dist/assets/{Autocomplete-BNAhky76.js → Autocomplete-BBeQ6-hj.js} +1 -1
- package/dist/assets/{Breadcrumbs-bwWUdzXH.js → Breadcrumbs-la_h0jmE.js} +1 -1
- package/dist/assets/{ButtonGroup-6y7yf9hV.js → ButtonGroup-stQLgH3W.js} +1 -1
- package/dist/assets/{CSSTransition-DnBIou_i.js → CSSTransition-CLx0i89t.js} +1 -1
- package/dist/assets/{CheckCircle-D7oERMFD.js → CheckCircle-Cnr4La0N.js} +1 -1
- package/dist/assets/{ChevronLeft-BphFdKoe.js → ChevronLeft-46fJs4Nx.js} +1 -1
- package/dist/assets/{ChevronRight-CLG1ay4A.js → ChevronRight-CAETeava.js} +1 -1
- package/dist/assets/{Close-DaUTq1SJ.js → Close-DTQrAVX4.js} +1 -1
- package/dist/assets/{Delete-Ctg2zeKs.js → Delete-BF5FxXLc.js} +1 -1
- package/dist/assets/{DeleteOutline-BlYvTbWy.js → DeleteOutline-DPxWTBB6.js} +1 -1
- package/dist/assets/{Done-CaIeE7qp.js → Done-DOjWCsLg.js} +1 -1
- package/dist/assets/{Edit-Df1qVd3M.js → Edit-B3-Fr9Tj.js} +1 -1
- package/dist/assets/{EditIcon-RrUDe7G9.js → EditIcon-BrPLxRwL.js} +1 -1
- package/dist/assets/{ExpandMore-v0D4A-jC.js → ExpandMore-CVyKHY4x.js} +1 -1
- package/dist/assets/{Google-1CqVsK9-.js → Google-Cnxb_l0p.js} +1 -1
- package/dist/assets/{HelpOutline-D2GlWrSn.js → HelpOutline-6TC2ROi9.js} +1 -1
- package/dist/assets/{Https-CnQMz8bU.js → Https-DnghL9tF.js} +1 -1
- package/dist/assets/{InputAdornment-CZ1xQxbJ.js → InputAdornment-BZCjodnq.js} +1 -1
- package/dist/assets/{InputLabel-CBKMP0kd.js → InputLabel-do0oj_cA.js} +1 -1
- package/dist/assets/{LastPage-O0R3NHtX.js → LastPage-BUGLoStw.js} +1 -1
- package/dist/assets/{Launch-BSF3J60R.js → Launch-DFcuOomh.js} +1 -1
- package/dist/assets/{Link-v9IWh6cd.js → Link-CSWVpt77.js} +1 -1
- package/dist/assets/{ListSubheader-CIqta_y7.js → ListSubheader-UNIM44v3.js} +1 -1
- package/dist/assets/{LoadingButton-DyT3S3FL.js → LoadingButton-D_RPeOOx.js} +1 -1
- package/dist/assets/{LockIcon-YcQjwpaB.js → LockIcon-B1ad8URq.js} +1 -1
- package/dist/assets/{Loop-CyRqHFwv.js → Loop-WIH3HPCS.js} +1 -1
- package/dist/assets/{MoreHoriz-BuJY4jyH.js → MoreHoriz-Du5Tf-OZ.js} +1 -1
- package/dist/assets/{MoreVert-B-UcAPyF.js → MoreVert-CQDScAiQ.js} +1 -1
- package/dist/assets/{Pagination-DCfuW4XM.js → Pagination-BcMuhf2X.js} +1 -1
- package/dist/assets/{Public-Dwmx99ns.js → Public-CP2wvAUH.js} +1 -1
- package/dist/assets/{SchemaReference.es-MroxBk7t.js → SchemaReference.es-SxViH3rT.js} +1 -1
- package/dist/assets/{Search-cMjY7-w9.js → Search-DIjK_pEi.js} +1 -1
- package/dist/assets/{Select-DMrgQlpi.js → Select-BjFMRCFC.js} +1 -1
- package/dist/assets/{Skeleton-D9vyaoYF.js → Skeleton-CWJ5kMp8.js} +1 -1
- package/dist/assets/{Slider-Dkmvlog2.js → Slider-Doh2hHer.js} +1 -1
- package/dist/assets/{Stepper-4TPScSpn.js → Stepper-DcyZplpy.js} +1 -1
- package/dist/assets/{TextField-Ck96Zj1i.js → TextField-CffC6XHW.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Bx3WaqEd.js → ToggleButtonGroup-DPzxadRI.js} +1 -1
- package/dist/assets/{ViewColumn-Dh3y3SOn.js → ViewColumn-81MArwOv.js} +1 -1
- package/dist/assets/{ViewList-CSwdI9xa.js → ViewList-C2PZp7Ah.js} +1 -1
- package/dist/assets/{_createAggregator-CC8samq7.js → _createAggregator-h86wTnGB.js} +1 -1
- package/dist/assets/{actions-DCoY4ND_.js → actions-Bx59OiFa.js} +1 -1
- package/dist/assets/actions-j2SGu6Ou.js +11 -0
- package/dist/assets/{agreement-Dm4gD1iv.js → agreement-XlWwj2S4.js} +1 -1
- package/dist/assets/api-Di8RsrU-.js +1 -0
- package/dist/assets/{app-avatar-rCMCHSVi.js → app-avatar-kyTZFM62.js} +1 -1
- package/dist/assets/{audit-logs-7Liwu019.js → audit-logs-CqPNdVpf.js} +1 -1
- package/dist/assets/{base32-7h1_w7qX.js → base32-Kw73pSzm.js} +1 -1
- package/dist/assets/blocklet-CpvMNcyR.js +1 -0
- package/dist/assets/{brace-fold.es-Cu37dStD.js → brace-fold.es-dNadKjdU.js} +1 -1
- package/dist/assets/{bundle-avatar-BGPsgY2n.js → bundle-avatar-DVvrB_hk.js} +1 -1
- package/dist/assets/{chart-CVsNPRkp.js → chart-8UOrjLJn.js} +1 -1
- package/dist/assets/{click-to-copy-A5WCwDlw.js → click-to-copy-BHPvbJ6H.js} +1 -1
- package/dist/assets/{closebrackets.es-CTJZzL0l.js → closebrackets.es-Cy6yh08f.js} +1 -1
- package/dist/assets/{codemirror.es-DNZDhAgz.js → codemirror.es-22B2FS1I.js} +1 -1
- package/dist/assets/{comment.es-FqVc1tUC.js → comment.es-CPuWlK9d.js} +1 -1
- package/dist/assets/{config-navigation-TqkqgYat.js → config-navigation-B8rbcuth.js} +1 -1
- package/dist/assets/{connect-to-BYaKsqLT.js → connect-to-iWwfwBUr.js} +1 -1
- package/dist/assets/{delete-confirm-CSfka7us.js → delete-confirm-BvTjtXVg.js} +1 -1
- package/dist/assets/{detail-Cl_ipErR.js → detail-CbgKOW0-.js} +3 -3
- package/dist/assets/{dialog.es-B2g1Md2H.js → dialog.es-C2q4_MT5.js} +1 -1
- package/dist/assets/{download-rfA-BgeB.js → download-B57AHfX0.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-7BXVq9Fp.js +1 -0
- package/dist/assets/{foldgutter.es-CDRazssP.js → foldgutter.es-YTVPMmZG.js} +1 -1
- package/dist/assets/getValidReactChildren-B0SBEHgb.js +1 -0
- package/dist/assets/{hint.es-DPt0iO5-.js → hint.es-DzlqosAN.js} +1 -1
- package/dist/assets/{hint.es2-Cb56J6wD.js → hint.es2-C0dFJXPn.js} +1 -1
- package/dist/assets/{iframe-Dkdmu2fU.js → iframe-CNi4eFHU.js} +1 -1
- package/dist/assets/{index-r95Ymzg4.js → index--381hgpI.js} +1 -1
- package/dist/assets/{index-CpGwNSQ5.js → index-0asJnBTm.js} +1 -1
- package/dist/assets/{index-Ca9M3B8h.js → index-2wQ3tu6m.js} +1 -1
- package/dist/assets/{index-DB5iie93.js → index-B0wMsD8P.js} +3 -3
- package/dist/assets/{index-CId0olRH.js → index-BD-_sxeY.js} +1 -1
- package/dist/assets/{index-DYxj4bsg.js → index-BJnzhtRd.js} +3 -3
- package/dist/assets/{index-BHnQz9ut.js → index-BLAXOuyV.js} +1 -1
- package/dist/assets/{index-BkQeHFWv.js → index-BMDwhPjF.js} +1 -1
- package/dist/assets/{index-Cx0pTn8V.js → index-BPwHguXO.js} +1 -1
- package/dist/assets/{index-C_H-un3r.js → index-BRubCfOC.js} +1 -1
- package/dist/assets/{index-D8yTZoR9.js → index-BTUjLSxo.js} +1 -1
- package/dist/assets/{index-D6rWCRih.js → index-BZIaRptn.js} +1 -1
- package/dist/assets/{index-B4FJ57Sl.js → index-B_neISJG.js} +1 -1
- package/dist/assets/{index-BvGfyxwm.js → index-BfSSkn6W.js} +1 -1
- package/dist/assets/{index-BessETTM.js → index-Bgd6dClm.js} +1 -1
- package/dist/assets/{index-Deih0d9w.js → index-BkDozNly.js} +1 -1
- package/dist/assets/{index-BALhaKtR.js → index-BkrLS-vH.js} +1 -1
- package/dist/assets/{index-BmJR2grL.js → index-Btxwim6f.js} +3 -3
- package/dist/assets/{index-Bn9YgWiZ.js → index-BweS_goE.js} +1 -1
- package/dist/assets/{index-j0AXsS2r.js → index-BxngBW5S.js} +1 -1
- package/dist/assets/{index-fqtLEedX.js → index-C0airVMt.js} +1 -1
- package/dist/assets/{index-CFR1XYQc.js → index-C4dTigzK.js} +1 -1
- package/dist/assets/{index-D4yD9wCL.js → index-CMZcjkA4.js} +1 -1
- package/dist/assets/{index-BcaBGkyp.js → index-CP7qtUGh.js} +1 -1
- package/dist/assets/{index-B3esz3LS.js → index-CTU8UxFT.js} +1 -1
- package/dist/assets/{index-B2tDACFP.js → index-Cb9RaNpS.js} +1 -1
- package/dist/assets/{index-67oWSwtN.js → index-Cbh5ETtr.js} +1 -1
- package/dist/assets/{index-DMjshc-U.js → index-CcXQVpnD.js} +1 -1
- package/dist/assets/{index-msCsCKKf.js → index-ChZGJi2F.js} +1 -1
- package/dist/assets/index-CkXRE3yy.js +5 -0
- package/dist/assets/{index-xwOBGVcu.js → index-D-ozzI7w.js} +1 -1
- package/dist/assets/{index-BkDbIMQb.js → index-DEPIq3Ep.js} +3 -3
- package/dist/assets/{index-DhjpRk6v.js → index-DHcEznQE.js} +1 -1
- package/dist/assets/{index-kGpBMKCz.js → index-DHf3-jHo.js} +1 -1
- package/dist/assets/{index-D-hrDvN6.js → index-DVCF6ypc.js} +1 -1
- package/dist/assets/{index-DtvC5owf.js → index-DpaWBoah.js} +1 -1
- package/dist/assets/{index-Fu4xuw11.js → index-DrtnF2Ne.js} +1 -1
- package/dist/assets/{index-DLagUrz3.js → index-T3PzDQk5.js} +1 -1
- package/dist/assets/{index-CNd74BR0.js → index-Un4UNZxQ.js} +1 -1
- package/dist/assets/{index-DfFXqsLX.js → index-bw-c4iIy.js} +1 -1
- package/dist/assets/{index-qcRGUCNe.js → index-c9RCKtxM.js} +5 -5
- package/dist/assets/{index-Bl77Q4pX.js → index-cFdzntdI.js} +1 -1
- package/dist/assets/{index-DVhqctGu.js → index-cJ8AIyQl.js} +1 -1
- package/dist/assets/index-srZBzsVC.js +23 -0
- package/dist/assets/{index-B6A5anpq.js → index-z7L9EHH-.js} +1 -1
- package/dist/assets/{index.esm-COz0rluF.js → index.esm-Ckwd_Oui.js} +1 -1
- package/dist/assets/{info-addon.es-BKKs8WFv.js → info-addon.es-BohNUKc-.js} +1 -1
- package/dist/assets/{info.es-C7gsHsn9.js → info.es-BnW1Do_Y.js} +1 -1
- package/dist/assets/{install-from-url-q76xLrvq.js → install-from-url-BiicPj9r.js} +1 -1
- package/dist/assets/{invitation-BW39GEcj.js → invitation-B6Icjnbl.js} +1 -1
- package/dist/assets/{is-path-prefix-equal-DWPB--12.js → is-path-prefix-equal-C2z6ul9S.js} +1 -1
- package/dist/assets/{item-DVTe-0gW.js → item-CtFxCPVi.js} +4 -4
- package/dist/assets/{javascript.es-CeTA0JKb.js → javascript.es-BwfQfmqf.js} +1 -1
- package/dist/assets/{jump-to-line.es-a_ngctA3.js → jump-to-line.es-DW43cy5p.js} +1 -1
- package/dist/assets/{jump.es-BWFjhcCo.js → jump.es-BUWLv8sH.js} +1 -1
- package/dist/assets/{lint.es-0gIIjnyf.js → lint.es-CUD4uJk8.js} +1 -1
- package/dist/assets/{lint.es2-CK1foe9-.js → lint.es2-Ctzkd-tt.js} +1 -1
- package/dist/assets/{lint.es3-B47_eujS.js → lint.es3-D6NsAVnc.js} +1 -1
- package/dist/assets/{list-header-CAC5y8Zb.js → list-header-D2LZ98zO.js} +1 -1
- package/dist/assets/{log-D9Z8kQgA.js → log-BUmAf7kF.js} +1 -1
- package/dist/assets/{logo-uploader-BGLx9vI_.js → logo-uploader-C63-zwbL.js} +3 -3
- package/dist/assets/{lottie-react.esm-BJprpjVk.js → lottie-react.esm-ZfnMm-33.js} +1 -1
- package/dist/assets/{matchbrackets.es-UzgJNlKv.js → matchbrackets.es-CqNvocTD.js} +1 -1
- package/dist/assets/{memory-ZSDA0OPQ.js → memory-Bd4JzDMd.js} +1 -1
- package/dist/assets/{mode.es-1zi4TBuR.js → mode.es-CGqn8n8L.js} +1 -1
- package/dist/assets/{mode.es2-BYT5Jd2Q.js → mode.es2-CMlQj1rc.js} +1 -1
- package/dist/assets/{mode.es3-BQkosdMI.js → mode.es3-BKGLApK7.js} +1 -1
- package/dist/assets/{onlineParser.es-BQLNL2qV.js → onlineParser.es-CmEFRZkl.js} +1 -1
- package/dist/assets/{overview-21qvx5BN.js → overview-DyU-Gr76.js} +1 -1
- package/dist/assets/{redux-D0hsiq_w.js → redux-uxGspPZE.js} +1 -1
- package/dist/assets/{resource-dialog-BoHq8v69.js → resource-dialog-BUSTiKav.js} +1 -1
- package/dist/assets/{runtime-Bd-F8WXx.js → runtime-rQYdRlsi.js} +1 -1
- package/dist/assets/{schema-B0T6A2Gz.js → schema-BDun2IRa.js} +1 -1
- package/dist/assets/sdk-DOSc1EPd.js +1 -0
- package/dist/assets/{search.es-BRUyj6I8.js → search.es-D6OrQ2zK.js} +1 -1
- package/dist/assets/{searchcursor.es-DzF-ECNC.js → searchcursor.es-BLA8FXL_.js} +1 -1
- package/dist/assets/{service-CufKunUa.js → service-nYvoJZ4V.js} +1 -1
- package/dist/assets/{shorten-label-BmNhwxO2.js → shorten-label-DZ9hQKJE.js} +1 -1
- package/dist/assets/{show-hint.es-_DytH3OZ.js → show-hint.es-CBMrYmmg.js} +1 -1
- package/dist/assets/{simple-select-DQMt4spB.js → simple-select-wsKOgQkD.js} +1 -1
- package/dist/assets/{slicedToArray-BsFyrH9P.js → slicedToArray-CDGik_Tm.js} +1 -1
- package/dist/assets/{spaces-BH8l3rDt.js → spaces-DztvnP2G.js} +1 -1
- package/dist/assets/{status-BwD-EBJu.js → status-_kkqAfEb.js} +1 -1
- package/dist/assets/{sublime.es-Dwi03jzh.js → sublime.es-CUR6yVxx.js} +1 -1
- package/dist/assets/{switch-control-B41nAAlH.js → switch-control-xOZw1m8W.js} +1 -1
- package/dist/assets/{table-icons-DLP-yfOz.js → table-icons-CBn5a_I0.js} +1 -1
- package/dist/assets/{team-C9C-b8dk.js → team-DvBIHwmh.js} +1 -1
- package/dist/assets/{toUpper-CRVjMgiU.js → toUpper-BOYZhoca.js} +1 -1
- package/dist/assets/{traffic-2e_bhX4O.js → traffic-BLoZjYrO.js} +1 -1
- package/dist/assets/{trim-a3cAMo7n.js → trim-BIGD4a61.js} +1 -1
- package/dist/assets/{uniqBy-COL9eNcG.js → uniqBy-4pHrjjeb.js} +1 -1
- package/dist/assets/{url-evaluation-_cliB2H6.js → url-evaluation-C1MAR5hw.js} +1 -1
- package/dist/assets/{url-join-BN5FuiJc.js → url-join-pEynD2Ji.js} +1 -1
- package/dist/assets/{useLocalStorage-BHwD0007.js → useLocalStorage-CQuk9gV7.js} +1 -1
- package/dist/assets/{useThemeProps-D02eSTIA.js → useThemeProps-BHp4rQcT.js} +1 -1
- package/dist/assets/{util-dakRC-rv.js → util-D9I2y3jU.js} +1 -1
- package/dist/assets/{wait-container-CvST8QRD.js → wait-container-BCP-KbSz.js} +1 -1
- package/dist/assets/{withStyles-GBXoa1NK.js → withStyles-7lCw-2jD.js} +1 -1
- package/dist/assets/{wrap-locale-_cUmGXc1.js → wrap-locale-Drqc-Zcp.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/actions-CYK55IDo.js +0 -11
- package/dist/assets/api-C59NHs3o.js +0 -1
- package/dist/assets/blocklet-q3h8NbCP.js +0 -1
- package/dist/assets/emotion-react.browser.esm-BNqOuiVX.js +0 -1
- package/dist/assets/getValidReactChildren-BxcBBj68.js +0 -1
- package/dist/assets/index-Bh8rfP9m.js +0 -23
- package/dist/assets/index-DoOoNVVw.js +0 -6
- package/dist/assets/sdk-CFjHlo2e.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{cl as Ge,r as L,ci as ut,bb as Ti,bc as Oi,bk as gt,f5 as bt,cj as st,f6 as Ei,f7 as _i,f8 as Ci,bR as $n,a7 as Ot,bP as ot,cY as Ri,bW as Kn,j as t,g as sr,f9 as Ii,fa as Pi,aO as Xe,aP as Ye,cQ as at,cI as Un,e0 as xe,C as Ee,s as Be,N as Y,am as Qe,dj as Mi,a4 as Li,dx as Di,fb as lr,eM as cr,fc as en,aD as zi,aE as tn,aW as Se,fd as Bt,m as X,cX as ur,fe as Ni,H as Fe,ff as Fi,b1 as dr,S as hr,f4 as nn,aw as rn,G as Hn,dZ as qn,aS as Bi,fg as Wi,fh as Ai,fi as $i,fj as Ki,O as Ui,eO as Hi,eN as qi,e8 as Vi,dR as Gi,eL as Xi,Q as St,a0 as Yi,fk as pr,fl as Qi,a3 as Pe,P,q as We,aB as fr,aR as Vn,cA as Ji,B as kt,a9 as Zi,aa as mr,aH as eo,fm as Gn,ab as to,bo as on,D as no,w as ro,U as io,cx as oo,V as lt,F as gr,A as Ne,b as ao,t as so,b2 as lo,af as co,eQ as br,cf as uo,ek as ho,W as po}from"./index-DYxj4bsg.js";import{d as fo}from"./ChevronLeft-BphFdKoe.js";import{d as mo}from"./ChevronRight-CLG1ay4A.js";import{d as wt}from"./Search-cMjY7-w9.js";import{E as go}from"./index-DVhqctGu.js";import{E as bo}from"./index-BALhaKtR.js";import{O as vr}from"./Select-DMrgQlpi.js";import{S as Ie}from"./Skeleton-D9vyaoYF.js";import{A as vo}from"./Autocomplete-BNAhky76.js";import{T as yr}from"./TextField-Ck96Zj1i.js";import{I as Xn}from"./InputAdornment-CZ1xQxbJ.js";import{d as yo}from"./Add-1IpBHqiQ.js";import{d as xr}from"./Launch-BSF3J60R.js";import{d as xo}from"./Done-CaIeE7qp.js";import{d as wr}from"./DeleteOutline-BlYvTbWy.js";import{C as wo}from"./delete-confirm-CSfka7us.js";import{u as So}from"./blocklet-q3h8NbCP.js";import{d as ko}from"./MoreVert-B-UcAPyF.js";import{B as Yn}from"./ButtonGroup-6y7yf9hV.js";var jo=function(e){return e===document||e===document.documentElement||e===document.body?Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop):e.scrollTop},To=function(e){return e.scrollHeight||Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)},Oo=function(e){return e.clientHeight||Math.max(document.documentElement.clientHeight,document.body.clientHeight)},Eo=function(e,n){n===void 0&&(n={});var s=n.target,l=n.isNoMore,p=n.threshold,f=p===void 0?100:p,g=n.reloadDeps,d=g===void 0?[]:g,v=n.manual,b=n.onBefore,h=n.onSuccess,S=n.onError,k=n.onFinally,x=Ge(L.useState(),2),w=x[0],_=x[1],I=Ge(L.useState(!1),2),C=I[0],W=I[1],D=L.useMemo(function(){return l?l(w):!1},[w]),$=ut(function(R){return Ti(void 0,void 0,void 0,function(){var V,ce,re;return Oi(this,function(fe){switch(fe.label){case 0:return[4,e(R)];case 1:return V=fe.sent(),_(R?gt(gt({},V),{list:bt(bt([],Ge((re=R.list)!==null&&re!==void 0?re:[]),!1),Ge(V.list),!1)}):gt(gt({},V),{list:bt([],Ge((ce=V.list)!==null&&ce!==void 0?ce:[]),!1)})),[2,V]}})})},{manual:v,onFinally:function(R,V,ce){W(!1),k==null||k(V,ce)},onBefore:function(){return b==null?void 0:b()},onSuccess:function(R){setTimeout(function(){ye()}),h==null||h(R)},onError:function(R){return S==null?void 0:S(R)}}),Q=$.loading,ee=$.error,U=$.run,le=$.runAsync,ve=$.cancel,ke=st(function(){D||(W(!0),U(w))}),je=st(function(){return D?Promise.reject():(W(!0),le(w))}),Te=function(){return W(!1),U()},ae=function(){return W(!1),le()},ye=function(){var R=Ei(s);if(R){R=R===document?document.documentElement:R;var V=jo(R),ce=To(R),re=Oo(R);ce-V<=re+f&&ke()}};return _i("scroll",function(){Q||C||ye()},{target:s}),Ci(function(){U()},bt([],Ge(d),!1)),{data:w,loading:!C&&Q,error:ee,loadingMore:C,noMore:D,loadMore:ke,loadMoreAsync:je,reload:st(Te),reloadAsync:st(ae),mutate:_,cancel:ve}};const _o=["name"],Co=["children","className","clone","component"];function Ro(e,n){const s={};return Object.keys(e).forEach(l=>{n.indexOf(l)===-1&&(s[l]=e[l])}),s}function Io(e){return(s,l={})=>{const{name:p}=l,f=$n(l,_o);let g=p;const v=Ot(typeof s=="function"?S=>({root:k=>s(ot({theme:S},k))}):{root:s},ot({Component:e,name:p||e.displayName,classNamePrefix:g},f));let b;s.filterProps&&(b=s.filterProps,delete s.filterProps),s.propTypes&&(s.propTypes,delete s.propTypes);const h=L.forwardRef(function(k,x){const{children:w,className:_,clone:I,component:C}=k,W=$n(k,Co),D=v(k),$=Kn(D.root,_);let Q=W;if(b&&(Q=Ro(Q,b)),I)return L.cloneElement(w,ot({className:Kn(w.props.className,$)},Q));if(typeof w=="function")return w(ot({className:$},Q));const ee=C||e;return t.jsx(ee,ot({ref:x,className:$},Q,{children:w}))});return Ri(h,e),h}}const zs="blocklet-add-component-registry",Ns="server-add-registry",Po={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'};var Mo=Ii,Qn=Pi;function Lo(e,n,s,l){return e==null?[]:(Qn(n)||(n=n==null?[]:[n]),s=l?void 0:s,Qn(s)||(s=s==null?[]:[s]),Mo(e,n,s))}var Do=Lo;const zo=sr(Do);var an={},No=Ye;Object.defineProperty(an,"__esModule",{value:!0});var Sr=an.default=void 0,Fo=No(Xe()),Bo=t;Sr=an.default=(0,Fo.default)((0,Bo.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");const Wo={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"/>'};var kr={exports:{}};(function(e,n){(function(s,l){e.exports=l(L)})(at,s=>(()=>{var l={703:(d,v,b)=>{var h=b(414);function S(){}function k(){}k.resetWarningCache=S,d.exports=function(){function x(I,C,W,D,$,Q){if(Q!==h){var ee=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 ee.name="Invariant Violation",ee}}function w(){return x}x.isRequired=x;var _={array:x,bool:x,func:x,number:x,object:x,string:x,symbol:x,any:x,arrayOf:w,element:x,elementType:x,instanceOf:w,node:x,objectOf:w,oneOf:w,oneOfType:w,shape:w,exact:w,checkPropTypes:k,resetWarningCache:S};return _.PropTypes=_,_}},697:(d,v,b)=>{d.exports=b(703)()},414:d=>{d.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:d=>{var v=typeof Element<"u",b=typeof Map=="function",h=typeof Set=="function",S=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(x,w){if(x===w)return!0;if(x&&w&&typeof x=="object"&&typeof w=="object"){if(x.constructor!==w.constructor)return!1;var _,I,C,W;if(Array.isArray(x)){if((_=x.length)!=w.length)return!1;for(I=_;I--!=0;)if(!k(x[I],w[I]))return!1;return!0}if(b&&x instanceof Map&&w instanceof Map){if(x.size!==w.size)return!1;for(W=x.entries();!(I=W.next()).done;)if(!w.has(I.value[0]))return!1;for(W=x.entries();!(I=W.next()).done;)if(!k(I.value[1],w.get(I.value[0])))return!1;return!0}if(h&&x instanceof Set&&w instanceof Set){if(x.size!==w.size)return!1;for(W=x.entries();!(I=W.next()).done;)if(!w.has(I.value[0]))return!1;return!0}if(S&&ArrayBuffer.isView(x)&&ArrayBuffer.isView(w)){if((_=x.length)!=w.length)return!1;for(I=_;I--!=0;)if(x[I]!==w[I])return!1;return!0}if(x.constructor===RegExp)return x.source===w.source&&x.flags===w.flags;if(x.valueOf!==Object.prototype.valueOf)return x.valueOf()===w.valueOf();if(x.toString!==Object.prototype.toString)return x.toString()===w.toString();if((_=(C=Object.keys(x)).length)!==Object.keys(w).length)return!1;for(I=_;I--!=0;)if(!Object.prototype.hasOwnProperty.call(w,C[I]))return!1;if(v&&x instanceof Element)return!1;for(I=_;I--!=0;)if((C[I]!=="_owner"&&C[I]!=="__v"&&C[I]!=="__o"||!x.$$typeof)&&!k(x[C[I]],w[C[I]]))return!1;return!0}return x!=x&&w!=w}d.exports=function(x,w){try{return k(x,w)}catch(_){if((_.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw _}}},359:d=>{d.exports=s}},p={};function f(d){var v=p[d];if(v!==void 0)return v.exports;var b=p[d]={exports:{}};return l[d](b,b.exports,f),b.exports}f.n=d=>{var v=d&&d.__esModule?()=>d.default:()=>d;return f.d(v,{a:v}),v},f.d=(d,v)=>{for(var b in v)f.o(v,b)&&!f.o(d,b)&&Object.defineProperty(d,b,{enumerable:!0,get:v[b]})},f.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),f.o=(d,v)=>Object.prototype.hasOwnProperty.call(d,v),f.r=d=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})};var g={};return(()=>{function d(a){var r,c,u="";if(typeof a=="string"||typeof a=="number")u+=a;else if(typeof a=="object")if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]&&(c=d(a[r]))&&(u&&(u+=" "),u+=c);else for(r in a)a[r]&&(u&&(u+=" "),u+=r);return u}function v(){for(var a,r,c=0,u="";c<arguments.length;)(a=arguments[c++])&&(r=d(a))&&(u&&(u+=" "),u+=r);return u}f.r(g),f.d(g,{default:()=>ki});var b=f(359),h=f.n(b);const S=function(a){var r=typeof a;return a!=null&&(r=="object"||r=="function")},k=typeof at=="object"&&at&&at.Object===Object&&at;var x=typeof self=="object"&&self&&self.Object===Object&&self;const w=k||x||Function("return this")(),_=function(){return w.Date.now()};var I=/\s/,C=/^\s+/;const W=function(a){return a&&a.slice(0,function(r){for(var c=r.length;c--&&I.test(r.charAt(c)););return c}(a)+1).replace(C,"")},D=w.Symbol;var $=Object.prototype,Q=$.hasOwnProperty,ee=$.toString,U=D?D.toStringTag:void 0,le=Object.prototype.toString,ve=D?D.toStringTag:void 0;const ke=function(a){return a==null?a===void 0?"[object Undefined]":"[object Null]":ve&&ve in Object(a)?function(r){var c=Q.call(r,U),u=r[U];try{r[U]=void 0;var O=!0}catch{}var F=ee.call(r);return O&&(c?r[U]=u:delete r[U]),F}(a):function(r){return le.call(r)}(a)};var je=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,ae=/^0o[0-7]+$/i,ye=parseInt;const R=function(a){if(typeof a=="number")return a;if(function(u){return typeof u=="symbol"||function(O){return O!=null&&typeof O=="object"}(u)&&ke(u)=="[object Symbol]"}(a))return NaN;if(S(a)){var r=typeof a.valueOf=="function"?a.valueOf():a;a=S(r)?r+"":r}if(typeof a!="string")return a===0?a:+a;a=W(a);var c=Te.test(a);return c||ae.test(a)?ye(a.slice(2),c?2:8):je.test(a)?NaN:+a};var V=Math.max,ce=Math.min;const re=function(a,r,c){var u,O,F,G,o,i,m=0,j=!1,E=!1,T=!0;if(typeof a!="function")throw new TypeError("Expected a function");function K(B){var q=u,J=O;return u=O=void 0,m=B,G=a.apply(J,q)}function A(B){return m=B,o=setTimeout(M,r),j?K(B):G}function H(B){var q=B-i;return i===void 0||q>=r||q<0||E&&B-m>=F}function M(){var B=_();if(H(B))return z(B);o=setTimeout(M,function(q){var J=r-(q-i);return E?ce(J,F-(q-m)):J}(B))}function z(B){return o=void 0,T&&u?K(B):(u=O=void 0,G)}function N(){var B=_(),q=H(B);if(u=arguments,O=this,i=B,q){if(o===void 0)return A(i);if(E)return clearTimeout(o),o=setTimeout(M,r),K(i)}return o===void 0&&(o=setTimeout(M,r)),G}return r=R(r)||0,S(c)&&(j=!!c.leading,F=(E="maxWait"in c)?V(R(c.maxWait)||0,r):F,T="trailing"in c?!!c.trailing:T),N.cancel=function(){o!==void 0&&clearTimeout(o),m=0,u=i=O=o=void 0},N.flush=function(){return o===void 0?G:z(_())},N},fe=function(a,r,c){var u=!0,O=!0;if(typeof a!="function")throw new TypeError("Expected a function");return S(c)&&(u="leading"in c?!!c.leading:u,O="trailing"in c?!!c.trailing:O),re(a,r,{leading:u,maxWait:r,trailing:O})};var _e=f(590),Qr=f.n(_e),bn=function(){if(typeof Map<"u")return Map;function a(r,c){var u=-1;return r.some(function(O,F){return O[0]===c&&(u=F,!0)}),u}return function(){function r(){this.__entries__=[]}return Object.defineProperty(r.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),r.prototype.get=function(c){var u=a(this.__entries__,c),O=this.__entries__[u];return O&&O[1]},r.prototype.set=function(c,u){var O=a(this.__entries__,c);~O?this.__entries__[O][1]=u:this.__entries__.push([c,u])},r.prototype.delete=function(c){var u=this.__entries__,O=a(u,c);~O&&u.splice(O,1)},r.prototype.has=function(c){return!!~a(this.__entries__,c)},r.prototype.clear=function(){this.__entries__.splice(0)},r.prototype.forEach=function(c,u){u===void 0&&(u=null);for(var O=0,F=this.__entries__;O<F.length;O++){var G=F[O];c.call(u,G[1],G[0])}},r}()}(),Ct=typeof window<"u"&&typeof document<"u"&&window.document===document,dt=f.g!==void 0&&f.g.Math===Math?f.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Jr=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(dt):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)},Zr=["top","right","bottom","left","width","height","size","weight"],ei=typeof MutationObserver<"u",ti=function(){function a(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(r,c){var u=!1,O=!1,F=0;function G(){u&&(u=!1,r()),O&&i()}function o(){Jr(G)}function i(){var m=Date.now();if(u){if(m-F<2)return;O=!0}else u=!0,O=!1,setTimeout(o,20);F=m}return i}(this.refresh.bind(this))}return a.prototype.addObserver=function(r){~this.observers_.indexOf(r)||this.observers_.push(r),this.connected_||this.connect_()},a.prototype.removeObserver=function(r){var c=this.observers_,u=c.indexOf(r);~u&&c.splice(u,1),!c.length&&this.connected_&&this.disconnect_()},a.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},a.prototype.updateObservers_=function(){var r=this.observers_.filter(function(c){return c.gatherActive(),c.hasActive()});return r.forEach(function(c){return c.broadcastActive()}),r.length>0},a.prototype.connect_=function(){Ct&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ei?(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)},a.prototype.disconnect_=function(){Ct&&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)},a.prototype.onTransitionEnd_=function(r){var c=r.propertyName,u=c===void 0?"":c;Zr.some(function(O){return!!~u.indexOf(O)})&&this.refresh()},a.getInstance=function(){return this.instance_||(this.instance_=new a),this.instance_},a.instance_=null,a}(),vn=function(a,r){for(var c=0,u=Object.keys(r);c<u.length;c++){var O=u[c];Object.defineProperty(a,O,{value:r[O],enumerable:!1,writable:!1,configurable:!0})}return a},Ae=function(a){return a&&a.ownerDocument&&a.ownerDocument.defaultView||dt},yn=pt(0,0,0,0);function ht(a){return parseFloat(a)||0}function xn(a){for(var r=[],c=1;c<arguments.length;c++)r[c-1]=arguments[c];return r.reduce(function(u,O){return u+ht(a["border-"+O+"-width"])},0)}var ni=typeof SVGGraphicsElement<"u"?function(a){return a instanceof Ae(a).SVGGraphicsElement}:function(a){return a instanceof Ae(a).SVGElement&&typeof a.getBBox=="function"};function ri(a){return Ct?ni(a)?function(r){var c=r.getBBox();return pt(0,0,c.width,c.height)}(a):function(r){var c=r.clientWidth,u=r.clientHeight;if(!c&&!u)return yn;var O=Ae(r).getComputedStyle(r),F=function(T){for(var K={},A=0,H=["top","right","bottom","left"];A<H.length;A++){var M=H[A],z=T["padding-"+M];K[M]=ht(z)}return K}(O),G=F.left+F.right,o=F.top+F.bottom,i=ht(O.width),m=ht(O.height);if(O.boxSizing==="border-box"&&(Math.round(i+G)!==c&&(i-=xn(O,"left","right")+G),Math.round(m+o)!==u&&(m-=xn(O,"top","bottom")+o)),!function(T){return T===Ae(T).document.documentElement}(r)){var j=Math.round(i+G)-c,E=Math.round(m+o)-u;Math.abs(j)!==1&&(i-=j),Math.abs(E)!==1&&(m-=E)}return pt(F.left,F.top,i,m)}(a):yn}function pt(a,r,c,u){return{x:a,y:r,width:c,height:u}}var ii=function(){function a(r){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=pt(0,0,0,0),this.target=r}return a.prototype.isActive=function(){var r=ri(this.target);return this.contentRect_=r,r.width!==this.broadcastWidth||r.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var r=this.contentRect_;return this.broadcastWidth=r.width,this.broadcastHeight=r.height,r},a}(),oi=function(a,r){var c,u,O,F,G,o,i,m=(u=(c=r).x,O=c.y,F=c.width,G=c.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(o.prototype),vn(i,{x:u,y:O,width:F,height:G,top:O,right:u+F,bottom:G+O,left:u}),i);vn(this,{target:a,contentRect:m})},ai=function(){function a(r,c,u){if(this.activeObservations_=[],this.observations_=new bn,typeof r!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=r,this.controller_=c,this.callbackCtx_=u}return a.prototype.observe=function(r){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(r instanceof Ae(r).Element))throw new TypeError('parameter 1 is not of type "Element".');var c=this.observations_;c.has(r)||(c.set(r,new ii(r)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(r){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(r instanceof Ae(r).Element))throw new TypeError('parameter 1 is not of type "Element".');var c=this.observations_;c.has(r)&&(c.delete(r),c.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var r=this;this.clearActive(),this.observations_.forEach(function(c){c.isActive()&&r.activeObservations_.push(c)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var r=this.callbackCtx_,c=this.activeObservations_.map(function(u){return new oi(u.target,u.broadcastRect())});this.callback_.call(r,c,r),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),wn=typeof WeakMap<"u"?new WeakMap:new bn,Sn=function a(r){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var c=ti.getInstance(),u=new ai(r,c,this);wn.set(this,u)};["observe","unobserve","disconnect"].forEach(function(a){Sn.prototype[a]=function(){var r;return(r=wn.get(this))[a].apply(r,arguments)}});const kn=dt.ResizeObserver!==void 0?dt.ResizeObserver:Sn,$e="Left",Le="Right",Ke="Up",De="Down",Ue={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Rt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},jn="mousemove",Tn="mouseup";function On(a,r){if(r===0)return a;const c=Math.PI/180*r;return[a[0]*Math.cos(c)+a[1]*Math.sin(c),a[1]*Math.cos(c)-a[0]*Math.sin(c)]}function si(a){const{trackMouse:r}=a,c=b.useRef(Object.assign({},Rt)),u=b.useRef(Object.assign({},Ue)),O=b.useRef(Object.assign({},u.current));let F;for(F in O.current=Object.assign({},u.current),u.current=Object.assign(Object.assign({},Ue),a),Ue)u.current[F]===void 0&&(u.current[F]=Ue[F]);const[G,o]=b.useMemo(()=>function(i,m){const j=M=>{const z="touches"in M;z&&M.touches.length>1||i((N,B)=>{B.trackMouse&&!z&&(document.addEventListener(jn,E),document.addEventListener(Tn,K));const{clientX:q,clientY:J}=z?M.touches[0]:M,ie=On([q,J],B.rotationAngle);return B.onTouchStartOrOnMouseDown&&B.onTouchStartOrOnMouseDown({event:M}),Object.assign(Object.assign(Object.assign({},N),Rt),{initial:ie.slice(),xy:ie,start:M.timeStamp||0})})},E=M=>{i((z,N)=>{const B="touches"in M;if(B&&M.touches.length>1)return z;if(M.timeStamp-z.start>N.swipeDuration)return z.swiping?Object.assign(Object.assign({},z),{swiping:!1}):z;const{clientX:q,clientY:J}=B?M.touches[0]:M,[ie,me]=On([q,J],N.rotationAngle),he=ie-z.xy[0],ue=me-z.xy[1],ne=Math.abs(he),Z=Math.abs(ue),Re=(M.timeStamp||0)-z.start,tt=Math.sqrt(ne*ne+Z*Z)/(Re||1),nt=[he/(Re||1),ue/(Re||1)],Ce=function(rt,Ve,it,ge){return rt>Ve?it>0?Le:$e:ge>0?De:Ke}(ne,Z,he,ue),ze=typeof N.delta=="number"?N.delta:N.delta[Ce.toLowerCase()]||Ue.delta;if(ne<ze&&Z<ze&&!z.swiping)return z;const Oe={absX:ne,absY:Z,deltaX:he,deltaY:ue,dir:Ce,event:M,first:z.first,initial:z.initial,velocity:tt,vxvy:nt};Oe.first&&N.onSwipeStart&&N.onSwipeStart(Oe),N.onSwiping&&N.onSwiping(Oe);let qe=!1;return(N.onSwiping||N.onSwiped||N[`onSwiped${Ce}`])&&(qe=!0),qe&&N.preventScrollOnSwipe&&N.trackTouch&&M.cancelable&&M.preventDefault(),Object.assign(Object.assign({},z),{first:!1,eventData:Oe,swiping:!0})})},T=M=>{i((z,N)=>{let B;if(z.swiping&&z.eventData){if(M.timeStamp-z.start<N.swipeDuration){B=Object.assign(Object.assign({},z.eventData),{event:M}),N.onSwiped&&N.onSwiped(B);const q=N[`onSwiped${B.dir}`];q&&q(B)}}else N.onTap&&N.onTap({event:M});return N.onTouchEndOrOnMouseUp&&N.onTouchEndOrOnMouseUp({event:M}),Object.assign(Object.assign(Object.assign({},z),Rt),{eventData:B})})},K=M=>{document.removeEventListener(jn,E),document.removeEventListener(Tn,K),T(M)},A=(M,z)=>{let N=()=>{};if(M&&M.addEventListener){const B=Object.assign(Object.assign({},Ue.touchEventOptions),z.touchEventOptions),q=[["touchstart",j,B],["touchmove",E,Object.assign(Object.assign({},B),z.preventScrollOnSwipe?{passive:!1}:{})],["touchend",T,B]];q.forEach(([J,ie,me])=>M.addEventListener(J,ie,me)),N=()=>q.forEach(([J,ie])=>M.removeEventListener(J,ie))}return N},H={ref:M=>{M!==null&&i((z,N)=>{if(z.el===M)return z;const B={};return z.el&&z.el!==M&&z.cleanUpTouch&&(z.cleanUpTouch(),B.cleanUpTouch=void 0),N.trackTouch&&M&&(B.cleanUpTouch=A(M,N)),Object.assign(Object.assign(Object.assign({},z),{el:M}),B)})}};return m.trackMouse&&(H.onMouseDown=j),[H,A]}(i=>c.current=i(c.current,u.current),{trackMouse:r}),[r]);return c.current=function(i,m,j,E){return m.trackTouch&&i.el?i.cleanUpTouch?m.preventScrollOnSwipe!==j.preventScrollOnSwipe||m.touchEventOptions.passive!==j.touchEventOptions.passive?(i.cleanUpTouch(),Object.assign(Object.assign({},i),{cleanUpTouch:E(i.el,m)})):i:Object.assign(Object.assign({},i),{cleanUpTouch:E(i.el,m)}):(i.cleanUpTouch&&i.cleanUpTouch(),Object.assign(Object.assign({},i),{cleanUpTouch:void 0}))}(c.current,u.current,O.current,o),G}var y=f(697);function Je(a){return Je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Je(a)}function En(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function _n(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?En(Object(c),!0).forEach(function(u){li(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):En(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function li(a,r,c){return(r=function(u){var O=function(F,G){if(Je(F)!=="object"||F===null)return F;var o=F[Symbol.toPrimitive];if(o!==void 0){var i=o.call(F,G);if(Je(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(u,"string");return Je(O)==="symbol"?O:String(O)}(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}var ci={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},It=h().memo(function(a){var r=_n(_n({},ci),a),c=r.description,u=r.fullscreen,O=r.handleImageLoaded,F=r.isFullscreen,G=r.onImageError,o=r.original,i=r.originalAlt,m=r.originalHeight,j=r.originalWidth,E=r.originalTitle,T=r.sizes,K=r.srcSet,A=r.loading,H=F&&u||o;return h().createElement(h().Fragment,null,h().createElement("img",{className:"image-gallery-image",src:H,alt:i,srcSet:K,height:m,width:j,sizes:T,title:E,onLoad:function(M){return O(M,o)},onError:G,loading:A}),c&&h().createElement("span",{className:"image-gallery-description"},c))});It.displayName="Item",It.propTypes={description:y.string,fullscreen:y.string,handleImageLoaded:y.func.isRequired,isFullscreen:y.bool,onImageError:y.func.isRequired,original:y.string.isRequired,originalAlt:y.string,originalHeight:y.string,originalWidth:y.string,originalTitle:y.string,sizes:y.string,srcSet:y.string,loading:y.string};const ui=It;function Ze(a){return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ze(a)}function Cn(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function Rn(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?Cn(Object(c),!0).forEach(function(u){di(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):Cn(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function di(a,r,c){return(r=function(u){var O=function(F,G){if(Ze(F)!=="object"||F===null)return F;var o=F[Symbol.toPrimitive];if(o!==void 0){var i=o.call(F,G);if(Ze(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(u,"string");return Ze(O)==="symbol"?O:String(O)}(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}var hi={left:h().createElement("polyline",{points:"15 18 9 12 15 6"}),right:h().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:h().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:h().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:h().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:h().createElement(h().Fragment,null,h().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),h().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},pi={strokeWidth:1,viewBox:"0 0 24 24"},In=function(a){var r=Rn(Rn({},pi),a),c=r.strokeWidth,u=r.viewBox,O=r.icon;return h().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:u,fill:"none",stroke:"currentColor",strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round"},hi[O])};In.propTypes={strokeWidth:y.number,viewBox:y.string,icon:(0,y.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const ft=In;var Pt=h().memo(function(a){var r=a.isFullscreen,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:c,"aria-label":"Open Fullscreen"},h().createElement(ft,{strokeWidth:2,icon:r?"minimize":"maximize"}))});Pt.displayName="Fullscreen",Pt.propTypes={isFullscreen:y.bool.isRequired,onClick:y.func.isRequired};const fi=Pt;var Mt=h().memo(function(a){var r=a.disabled,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:r,onClick:c,"aria-label":"Previous Slide"},h().createElement(ft,{icon:"left",viewBox:"6 0 12 24"}))});Mt.displayName="LeftNav",Mt.propTypes={disabled:y.bool.isRequired,onClick:y.func.isRequired};const mi=Mt;var Lt=h().memo(function(a){var r=a.disabled,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:r,onClick:c,"aria-label":"Next Slide"},h().createElement(ft,{icon:"right",viewBox:"6 0 12 24"}))});Lt.displayName="RightNav",Lt.propTypes={disabled:y.bool.isRequired,onClick:y.func.isRequired};const gi=Lt;var Dt=h().memo(function(a){var r=a.isPlaying,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:c,"aria-label":"Play or Pause Slideshow"},h().createElement(ft,{strokeWidth:2,icon:r?"pause":"play"}))});Dt.displayName="PlayPause",Dt.propTypes={isPlaying:y.bool.isRequired,onClick:y.func.isRequired};const bi=Dt;function et(a){return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},et(a)}function zt(){return zt=Object.assign?Object.assign.bind():function(a){for(var r=1;r<arguments.length;r++){var c=arguments[r];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(a[u]=c[u])}return a},zt.apply(this,arguments)}function Pn(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function Mn(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?Pn(Object(c),!0).forEach(function(u){vi(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):Pn(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function vi(a,r,c){return(r=function(u){var O=function(F,G){if(et(F)!=="object"||F===null)return F;var o=F[Symbol.toPrimitive];if(o!==void 0){var i=o.call(F,G);if(et(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(u,"string");return et(O)==="symbol"?O:String(O)}(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}var yi={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Ln=function(a){var r=Mn(Mn({},yi),a),c=r.children,u=r.className,O=si({delta:r.delta,onSwiping:r.onSwiping,onSwiped:r.onSwiped});return h().createElement("div",zt({},O,{className:u}),c)};Ln.propTypes={children:y.node.isRequired,className:y.string,delta:y.number,onSwiped:y.func,onSwiping:y.func};const Dn=Ln;function He(a){return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},He(a)}function zn(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function Nn(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?zn(Object(c),!0).forEach(function(u){Fn(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):zn(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function xi(a,r){for(var c=0;c<r.length;c++){var u=r[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(a,Bn(u.key),u)}}function Nt(a,r){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,u){return c.__proto__=u,c},Nt(a,r)}function wi(a,r){if(r&&(He(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oe(a)}function oe(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function mt(a){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mt(a)}function Fn(a,r,c){return(r=Bn(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}function Bn(a){var r=function(c,u){if(He(c)!=="object"||c===null)return c;var O=c[Symbol.toPrimitive];if(O!==void 0){var F=O.call(c,u);if(He(F)!=="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a,"string");return He(r)==="symbol"?r:String(r)}var Wn=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Si=(0,y.arrayOf)((0,y.shape)({srcSet:y.string,media:y.string}));function An(a){var r=parseInt(a.keyCode||a.which||0,10);return r===66||r===62}var Ft=function(a){(function(o,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(i&&i.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),i&&Nt(o,i)})(G,a);var r,c,u,O,F=(u=G,O=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 o,i=mt(u);if(O){var m=mt(this).constructor;o=Reflect.construct(i,arguments,m)}else o=i.apply(this,arguments);return wi(this,o)});function G(o){var i;return function(m,j){if(!(m instanceof j))throw new TypeError("Cannot call a class as a function")}(this,G),Fn(oe(i=F.call(this,o)),"onBulletClick",function(m,j){var E=i.props,T=E.onBulletClick,K=E.items,A=i.state.currentIndex;m.target.blur(),A!==j&&(K.length===2?i.slideToIndexWithStyleReset(j,m):i.slideToIndex(j,m)),T&&T(m,j)}),i.state={currentIndex:o.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(o.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},i.loadedImages={},i.imageGallery=h().createRef(),i.thumbnailsWrapper=h().createRef(),i.thumbnails=h().createRef(),i.imageGallerySlideWrapper=h().createRef(),i.handleImageLoaded=i.handleImageLoaded.bind(oe(i)),i.handleKeyDown=i.handleKeyDown.bind(oe(i)),i.handleMouseDown=i.handleMouseDown.bind(oe(i)),i.handleResize=i.handleResize.bind(oe(i)),i.handleTouchMove=i.handleTouchMove.bind(oe(i)),i.handleOnSwiped=i.handleOnSwiped.bind(oe(i)),i.handleScreenChange=i.handleScreenChange.bind(oe(i)),i.handleSwiping=i.handleSwiping.bind(oe(i)),i.handleThumbnailSwiping=i.handleThumbnailSwiping.bind(oe(i)),i.handleOnThumbnailSwiped=i.handleOnThumbnailSwiped.bind(oe(i)),i.onThumbnailMouseLeave=i.onThumbnailMouseLeave.bind(oe(i)),i.handleImageError=i.handleImageError.bind(oe(i)),i.pauseOrPlay=i.pauseOrPlay.bind(oe(i)),i.renderThumbInner=i.renderThumbInner.bind(oe(i)),i.renderItem=i.renderItem.bind(oe(i)),i.slideLeft=i.slideLeft.bind(oe(i)),i.slideRight=i.slideRight.bind(oe(i)),i.toggleFullScreen=i.toggleFullScreen.bind(oe(i)),i.togglePlay=i.togglePlay.bind(oe(i)),i.unthrottledSlideToIndex=i.slideToIndex,i.slideToIndex=fe(i.unthrottledSlideToIndex,o.slideDuration,{trailing:!1}),o.lazyLoad&&(i.lazyLoaded=[]),i}return r=G,c=[{key:"componentDidMount",value:function(){var o=this.props,i=o.autoPlay,m=o.useWindowKeyDown;i&&this.play(),m?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(o,i){var m=this.props,j=m.items,E=m.lazyLoad,T=m.slideDuration,K=m.slideInterval,A=m.startIndex,H=m.thumbnailPosition,M=m.showThumbnails,z=m.useWindowKeyDown,N=this.state,B=N.currentIndex,q=N.isPlaying,J=o.items.length!==j.length,ie=!Qr()(o.items,j),me=o.startIndex!==A,he=o.thumbnailPosition!==H,ue=o.showThumbnails!==M;K===o.slideInterval&&T===o.slideDuration||q&&(this.pause(),this.play()),he&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),ue&&M&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),ue&&!M&&this.removeThumbnailsResizeObserver(),(J||ue)&&this.handleResize(),i.currentIndex!==B&&this.slideThumbnailBar(),o.slideDuration!==T&&(this.slideToIndex=fe(this.unthrottledSlideToIndex,T,{trailing:!1})),!E||o.lazyLoad&&!ie||(this.lazyLoaded=[]),z!==o.useWindowKeyDown&&(z?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(me||ie)&&this.setState({currentIndex:A,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var o=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),o?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var o=this,i=this.state,m=i.currentIndex,j=i.isTransitioning,E=this.props,T=E.onSlide,K=E.slideDuration;this.transitionTimer=window.setTimeout(function(){j&&(o.setState({isTransitioning:!j,isSwipingThumbnail:!1}),T&&T(m))},K+50)}},{key:"onThumbnailClick",value:function(o,i){var m=this.props,j=m.onThumbnailClick,E=m.items,T=this.state.currentIndex;o.target.parentNode.parentNode.blur(),T!==i&&(E.length===2?this.slideToIndexWithStyleReset(i,o):this.slideToIndex(i,o)),j&&j(o,i)}},{key:"onThumbnailMouseOver",value:function(o,i){var m=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){m.slideToIndex(i),m.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var o=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,o&&this.play()}}},{key:"setThumbsTranslate",value:function(o){this.setState({thumbsTranslate:o})}},{key:"setModalFullscreen",value:function(o){var i=this.props.onScreenChange;this.setState({modalFullscreen:o}),i&&i(o)}},{key:"getThumbsTranslate",value:function(o){var i,m=this.props,j=m.disableThumbnailScroll,E=m.items,T=this.state,K=T.thumbnailsWrapperWidth,A=T.thumbnailsWrapperHeight,H=this.thumbnails&&this.thumbnails.current;if(j)return 0;if(H){if(this.isThumbnailVertical()){if(H.scrollHeight<=A)return 0;i=H.scrollHeight-A}else{if(H.scrollWidth<=K||K<=0)return 0;i=H.scrollWidth-K}return o*(i/(E.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(o){switch(o){case"left":o=" ".concat("image-gallery-thumbnails-left");break;case"right":o=" ".concat("image-gallery-thumbnails-right");break;case"bottom":o=" ".concat("image-gallery-thumbnails-bottom");break;case"top":o=" ".concat("image-gallery-thumbnails-top")}return o}},{key:"getAlignmentClassName",value:function(o){var i=this.state.currentIndex,m=this.props,j=m.infinite,E=m.items,T="",K="image-gallery-left",A="image-gallery-right";switch(o){case i-1:T=" ".concat(K);break;case i:T=" ".concat("image-gallery-center");break;case i+1:T=" ".concat(A)}return E.length>=3&&j&&(o===0&&i===E.length-1?T=" ".concat(A):o===E.length-1&&i===0&&(T=" ".concat(K))),T}},{key:"getTranslateXForTwoSlide",value:function(o){var i=this.state,m=i.currentIndex,j=i.currentSlideOffset,E=i.previousIndex,T=m!==E,K=o===0&&E===0,A=o===1&&E===1,H=o===0&&m===1,M=o===1&&m===0,z=j===0,N=-100*m+100*o+j;return j>0?this.direction="left":j<0&&(this.direction="right"),M&&j>0&&(N=-100+j),H&&j<0&&(N=100+j),T?K&&z&&this.direction==="left"?N=100:A&&z&&this.direction==="right"&&(N=-100):(M&&z&&this.direction==="left"&&(N=-100),H&&z&&this.direction==="right"&&(N=100)),N}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(o){var i=this.state,m=i.currentIndex,j=i.currentSlideOffset,E=i.slideStyle,T=this.props,K=T.infinite,A=T.items,H=T.useTranslate3D,M=T.isRTL,z=-100*m,N=A.length-1,B=(z+100*o)*(M?-1:1)+j;K&&A.length>2&&(m===0&&o===N?B=-100*(M?-1:1)+j:m===N&&o===0&&(B=100*(M?-1:1)+j)),K&&A.length===2&&(B=this.getTranslateXForTwoSlide(o));var q="translate(".concat(B,"%, 0)");return H&&(q="translate3d(".concat(B,"%, 0, 0)")),Nn({display:this.isSlideVisible(o)?"inherit":"none",WebkitTransform:q,MozTransform:q,msTransform:q,OTransform:q,transform:q},E)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var o,i=this.props,m=i.useTranslate3D,j=i.isRTL,E=this.state,T=E.thumbsTranslate,K=E.thumbsStyle,A=j?-1*T:T;return this.isThumbnailVertical()?(o="translate(0, ".concat(T,"px)"),m&&(o="translate3d(0, ".concat(T,"px, 0)"))):(o="translate(".concat(A,"px, 0)"),m&&(o="translate3d(".concat(A,"px, 0, 0)"))),Nn({WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,transform:o},K)}},{key:"getSlideItems",value:function(){var o=this,i=this.state.currentIndex,m=this.props,j=m.items,E=m.slideOnThumbnailOver,T=m.onClick,K=m.lazyLoad,A=m.onTouchMove,H=m.onTouchEnd,M=m.onTouchStart,z=m.onMouseOver,N=m.onMouseLeave,B=m.renderItem,q=m.renderThumbInner,J=m.showThumbnails,ie=m.showBullets,me=[],he=[],ue=[];return j.forEach(function(ne,Z){var Re=o.getAlignmentClassName(Z),tt=ne.originalClass?" ".concat(ne.originalClass):"",nt=ne.thumbnailClass?" ".concat(ne.thumbnailClass):"",Ce=ne.renderItem||B||o.renderItem,ze=ne.renderThumbInner||q||o.renderThumbInner,Oe=!K||Re||o.lazyLoaded[Z];Oe&&K&&!o.lazyLoaded[Z]&&(o.lazyLoaded[Z]=!0);var qe=o.getSlideStyle(Z),rt=h().createElement("div",{"aria-label":"Go to Slide ".concat(Z+1),key:"slide-".concat(Z),tabIndex:"-1",className:"image-gallery-slide ".concat(Re," ").concat(tt),style:qe,onClick:T,onKeyUp:o.handleSlideKeyUp,onTouchMove:A,onTouchEnd:H,onTouchStart:M,onMouseOver:z,onFocus:z,onMouseLeave:N,role:"button"},Oe?Ce(ne):h().createElement("div",{style:{height:"100%"}}));if(me.push(rt),J&&ne.thumbnail){var Ve=v("image-gallery-thumbnail",nt,{active:i===Z});he.push(h().createElement("button",{key:"thumbnail-".concat(Z),type:"button",tabIndex:"0","aria-pressed":i===Z?"true":"false","aria-label":"Go to Slide ".concat(Z+1),className:Ve,onMouseLeave:E?o.onThumbnailMouseLeave:null,onMouseOver:function(ge){return o.handleThumbnailMouseOver(ge,Z)},onFocus:function(ge){return o.handleThumbnailMouseOver(ge,Z)},onKeyUp:function(ge){return o.handleThumbnailKeyUp(ge,Z)},onClick:function(ge){return o.onThumbnailClick(ge,Z)}},ze(ne)))}if(ie){var it=v("image-gallery-bullet",ne.bulletClass,{active:i===Z});ue.push(h().createElement("button",{type:"button",key:"bullet-".concat(Z),className:it,onClick:function(ge){return o.onBulletClick(ge,Z)},"aria-pressed":i===Z?"true":"false","aria-label":"Go to Slide ".concat(Z+1)}))}}),{slides:me,thumbnails:he,bullets:ue}}},{key:"ignoreIsTransitioning",value:function(){var o=this.props.items,i=this.state,m=i.previousIndex,j=i.currentIndex,E=o.length-1;return Math.abs(m-j)>1&&!(m===0&&j===E)&&!(m===E&&j===0)}},{key:"isFirstOrLastSlide",value:function(o){return o===this.props.items.length-1||o===0}},{key:"slideIsTransitioning",value:function(o){var i=this.state,m=i.isTransitioning,j=i.previousIndex,E=i.currentIndex;return m&&!(o===j||o===E)}},{key:"isSlideVisible",value:function(o){return!this.slideIsTransitioning(o)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(o)}},{key:"slideThumbnailBar",value:function(){var o=this.state,i=o.currentIndex,m=o.isSwipingThumbnail,j=-this.getThumbsTranslate(i);m||(i===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:j,thumbsSwipedTranslate:j}))}},{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(o){var i=o.event,m=o.absX,j=o.dir,E=this.props,T=E.disableSwipe,K=E.stopPropagation,A=this.state,H=A.galleryWidth,M=A.isTransitioning,z=A.swipingUpDown,N=A.swipingLeftRight;if(j!==Ke&&j!==De&&!z||N){if(j!==$e&&j!==Le||N||this.setState({swipingLeftRight:!0}),!T){var B=this.props.swipingTransitionDuration;if(K&&i.preventDefault(),M)this.setState({currentSlideOffset:0});else{var q=j===Le?1:-1,J=m/H*100;Math.abs(J)>=100&&(J=100);var ie={transition:"transform ".concat(B,"ms ease-out")};this.setState({currentSlideOffset:q*J,slideStyle:ie})}}}else z||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(o){var i=o.event,m=o.absX,j=o.absY,E=o.dir,T=this.props,K=T.stopPropagation,A=T.swipingThumbnailTransitionDuration,H=this.state,M=H.thumbsSwipedTranslate,z=H.thumbnailsWrapperHeight,N=H.thumbnailsWrapperWidth,B=H.swipingUpDown,q=H.swipingLeftRight;if(this.isThumbnailVertical()){if((E===$e||E===Le||q)&&!B)return void(q||this.setState({swipingLeftRight:!0}));E!==Ke&&E!==De||B||this.setState({swipingUpDown:!0})}else{if((E===Ke||E===De||B)&&!q)return void(B||this.setState({swipingUpDown:!0}));E!==$e&&E!==Le||q||this.setState({swipingLeftRight:!0})}var J,ie,me,he,ue,ne=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(J=M+(E===De?j:-j),ie=ne.scrollHeight-z+20,me=Math.abs(J)>ie,he=J>20,ue=ne.scrollHeight<=z):(J=M+(E===Le?m:-m),ie=ne.scrollWidth-N+20,me=Math.abs(J)>ie,he=J>20,ue=ne.scrollWidth<=N),!ue&&(E!==$e&&E!==Ke||!me)&&(E!==Le&&E!==De||!he)){K&&i.stopPropagation();var Z={transition:"transform ".concat(A,"ms ease-out")};this.setState({thumbsTranslate:J,thumbsStyle:Z})}}},{key:"handleOnThumbnailSwiped",value:function(){var o=this.state.thumbsTranslate,i=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:o,thumbsStyle:{transition:"all ".concat(i,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var o=this.state.currentSlideOffset,i=this.props.swipeThreshold;return Math.abs(o)>i}},{key:"resetSwipingDirection",value:function(){var o=this.state,i=o.swipingUpDown,m=o.swipingLeftRight;i&&this.setState({swipingUpDown:!1}),m&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(o){var i=o.event,m=o.dir,j=o.velocity,E=this.props,T=E.disableSwipe,K=E.stopPropagation,A=E.flickThreshold;if(!T){var H=this.props.isRTL;K&&i.stopPropagation(),this.resetSwipingDirection();var M=(m===$e?1:-1)*(H?-1:1),z=j>A&&!(m===Ke||m===De);this.handleOnSwipedTo(M,z)}}},{key:"handleOnSwipedTo",value:function(o,i){var m=this.state,j=m.currentIndex,E=m.isTransitioning,T=j;!this.sufficientSwipe()&&!i||E||(T+=o),(o===-1&&!this.canSlideLeft()||o===1&&!this.canSlideRight())&&(T=j),this.unthrottledSlideToIndex(T)}},{key:"handleTouchMove",value:function(o){this.state.swipingLeftRight&&o.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(o){var i=this.props,m=i.disableKeyDown,j=i.useBrowserFullscreen,E=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!m)switch(parseInt(o.keyCode||o.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(o);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(o);break;case 27:E&&!j&&this.exitFullScreen()}}},{key:"handleImageError",value:function(o){var i=this.props.onErrorImageURL;i&&o.target.src.indexOf(i)===-1&&(o.target.src=i)}},{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 o=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(o)))}},{key:"initSlideWrapperResizeObserver",value:function(o){var i=this;o&&!o.current||(this.resizeSlideWrapperObserver=new kn(re(function(m){m&&m.forEach(function(j){i.setState({thumbnailsWrapperWidth:j.contentRect.width},i.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(o.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(o){var i=this;o&&!o.current||(this.resizeThumbnailWrapperObserver=new kn(re(function(m){m&&m.forEach(function(j){i.setState({thumbnailsWrapperHeight:j.contentRect.height},i.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(o.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 o=this.props,i=o.onScreenChange,m=o.useBrowserFullscreen,j=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,E=this.imageGallery.current===j;i&&i(E),m&&this.setState({isFullscreen:E})}},{key:"slideToIndex",value:function(o,i){var m=this.state,j=m.currentIndex,E=m.isTransitioning,T=this.props,K=T.items,A=T.slideDuration,H=T.onBeforeSlide;if(!E){i&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var M=K.length-1,z=o;o<0?z=M:o>M&&(z=0),H&&z!==j&&H(z),this.setState({previousIndex:j,currentIndex:z,isTransitioning:z!==j,currentSlideOffset:0,slideStyle:{transition:"all ".concat(A,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(o){var i=this.props.isRTL;this.slideTo(o,i?"right":"left")}},{key:"slideRight",value:function(o){var i=this.props.isRTL;this.slideTo(o,i?"left":"right")}},{key:"slideTo",value:function(o,i){var m=this.state,j=m.currentIndex,E=m.isTransitioning,T=this.props.items,K=j+(i==="left"?-1:1);E||(T.length===2?this.slideToIndexWithStyleReset(K,o):this.slideToIndex(K,o))}},{key:"slideToIndexWithStyleReset",value:function(o,i){var m=this,j=this.state,E=j.currentIndex,T=j.currentSlideOffset;this.setState({currentSlideOffset:T+(E>o?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return m.slideToIndex(o,i)},25)})}},{key:"handleThumbnailMouseOver",value:function(o,i){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(o,i)}},{key:"handleThumbnailKeyUp",value:function(o,i){An(o)&&this.onThumbnailClick(o,i)}},{key:"handleSlideKeyUp",value:function(o){An(o)&&(0,this.props.onClick)(o)}},{key:"isThumbnailVertical",value:function(){var o=this.props.thumbnailPosition;return o==="left"||o==="right"}},{key:"addScreenChangeEvent",value:function(){var o=this;Wn.forEach(function(i){document.addEventListener(i,o.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var o=this;Wn.forEach(function(i){document.removeEventListener(i,o.handleScreenChange)})}},{key:"fullScreen",value:function(){var o=this.props.useBrowserFullscreen,i=this.imageGallery.current;o?i.requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var o=this.state.isFullscreen,i=this.props.useBrowserFullscreen;o&&(i?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 o=this.props.infinite,i=this.state.currentIndex;o||this.canSlideRight()?this.slideToIndex(i+1):this.pause()}},{key:"play",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],i=this.props,m=i.onPlay,j=i.slideInterval,E=i.slideDuration,T=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(j,E)),m&&o&&m(T))}},{key:"pause",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],i=this.props.onPause,m=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),i&&o&&i(m))}},{key:"isImageLoaded",value:function(o){return!!this.loadedImages[o.original]||(this.loadedImages[o.original]=!0,!1)}},{key:"handleImageLoaded",value:function(o,i){var m=this.props.onImageLoad;!this.loadedImages[i]&&m&&(this.loadedImages[i]=!0,m(o))}},{key:"renderItem",value:function(o){var i=this.state.isFullscreen,m=this.props.onImageError||this.handleImageError;return h().createElement(ui,{description:o.description,fullscreen:o.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:i,onImageError:m,original:o.original,originalAlt:o.originalAlt,originalHeight:o.originalHeight,originalWidth:o.originalWidth,originalTitle:o.originalTitle,sizes:o.sizes,loading:o.loading,srcSet:o.srcSet})}},{key:"renderThumbInner",value:function(o){var i=this.props.onThumbnailError||this.handleImageError;return h().createElement("span",{className:"image-gallery-thumbnail-inner"},h().createElement("img",{className:"image-gallery-thumbnail-image",src:o.thumbnail,height:o.thumbnailHeight,width:o.thumbnailWidth,alt:o.thumbnailAlt,title:o.thumbnailTitle,loading:o.thumbnailLoading,onError:i}),o.thumbnailLabel&&h().createElement("div",{className:"image-gallery-thumbnail-label"},o.thumbnailLabel))}},{key:"render",value:function(){var o=this.state,i=o.currentIndex,m=o.isFullscreen,j=o.modalFullscreen,E=o.isPlaying,T=this.props,K=T.additionalClass,A=T.disableThumbnailSwipe,H=T.indexSeparator,M=T.isRTL,z=T.items,N=T.thumbnailPosition,B=T.renderFullscreenButton,q=T.renderCustomControls,J=T.renderLeftNav,ie=T.renderRightNav,me=T.showBullets,he=T.showFullscreenButton,ue=T.showIndex,ne=T.showThumbnails,Z=T.showNav,Re=T.showPlayButton,tt=T.renderPlayPauseButton,nt=this.getThumbnailStyle(),Ce=this.getSlideItems(),ze=Ce.slides,Oe=Ce.thumbnails,qe=Ce.bullets,rt=v("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(N),{"image-gallery-rtl":M}),Ve=h().createElement("div",{ref:this.imageGallerySlideWrapper,className:rt},q&&q(),this.canSlide()?h().createElement(h().Fragment,null,Z&&h().createElement(h().Fragment,null,J(this.slideLeft,!this.canSlideLeft()),ie(this.slideRight,!this.canSlideRight())),h().createElement(Dn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},h().createElement("div",{className:"image-gallery-slides"},ze))):h().createElement("div",{className:"image-gallery-slides"},ze),Re&&tt(this.togglePlay,E),me&&h().createElement("div",{className:"image-gallery-bullets"},h().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},qe)),he&&B(this.toggleFullScreen,m),ue&&h().createElement("div",{className:"image-gallery-index"},h().createElement("span",{className:"image-gallery-index-current"},i+1),h().createElement("span",{className:"image-gallery-index-separator"},H),h().createElement("span",{className:"image-gallery-index-total"},z.length))),it=v("image-gallery",K,{"fullscreen-modal":j}),ge=v("image-gallery-content",this.getThumbnailPositionClassName(N),{fullscreen:m}),ji=v("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(N),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&M},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!A},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!A});return h().createElement("div",{ref:this.imageGallery,className:it,"aria-live":"polite"},h().createElement("div",{className:ge},(N==="bottom"||N==="right")&&Ve,ne&&Oe.length>0?h().createElement(Dn,{className:ji,delta:0,onSwiping:!A&&this.handleThumbnailSwiping,onSwiped:!A&&this.handleOnThumbnailSwiped},h().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},h().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:nt,"aria-label":"Thumbnail Navigation"},Oe))):null,(N==="top"||N==="left")&&Ve))}}],c&&xi(r.prototype,c),Object.defineProperty(r,"prototype",{writable:!1}),G}(h().Component);Ft.propTypes={flickThreshold:y.number,items:(0,y.arrayOf)((0,y.shape)({bulletClass:y.string,bulletOnClick:y.func,description:y.string,original:y.string,originalHeight:y.number,originalWidth:y.number,loading:y.string,thumbnailHeight:y.number,thumbnailWidth:y.number,thumbnailLoading:y.string,fullscreen:y.string,originalAlt:y.string,originalTitle:y.string,thumbnail:y.string,thumbnailAlt:y.string,thumbnailLabel:y.string,thumbnailTitle:y.string,originalClass:y.string,thumbnailClass:y.string,renderItem:y.func,renderThumbInner:y.func,imageSet:Si,srcSet:y.string,sizes:y.string})).isRequired,showNav:y.bool,autoPlay:y.bool,lazyLoad:y.bool,infinite:y.bool,showIndex:y.bool,showBullets:y.bool,showThumbnails:y.bool,showPlayButton:y.bool,showFullscreenButton:y.bool,disableThumbnailScroll:y.bool,disableKeyDown:y.bool,disableSwipe:y.bool,disableThumbnailSwipe:y.bool,useBrowserFullscreen:y.bool,onErrorImageURL:y.string,indexSeparator:y.string,thumbnailPosition:(0,y.oneOf)(["top","bottom","left","right"]),startIndex:y.number,slideDuration:y.number,slideInterval:y.number,slideOnThumbnailOver:y.bool,swipeThreshold:y.number,swipingTransitionDuration:y.number,swipingThumbnailTransitionDuration:y.number,onSlide:y.func,onBeforeSlide:y.func,onScreenChange:y.func,onPause:y.func,onPlay:y.func,onClick:y.func,onImageLoad:y.func,onImageError:y.func,onTouchMove:y.func,onTouchEnd:y.func,onTouchStart:y.func,onMouseOver:y.func,onMouseLeave:y.func,onBulletClick:y.func,onThumbnailError:y.func,onThumbnailClick:y.func,renderCustomControls:y.func,renderLeftNav:y.func,renderRightNav:y.func,renderPlayPauseButton:y.func,renderFullscreenButton:y.func,renderItem:y.func,renderThumbInner:y.func,stopPropagation:y.bool,additionalClass:y.string,useTranslate3D:y.bool,isRTL:y.bool,useWindowKeyDown:y.bool},Ft.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(a,r){return h().createElement(mi,{onClick:a,disabled:r})},renderRightNav:function(a,r){return h().createElement(gi,{onClick:a,disabled:r})},renderPlayPauseButton:function(a,r){return h().createElement(bi,{onClick:a,isPlaying:r})},renderFullscreenButton:function(a,r){return h().createElement(fi,{onClick:a,isFullscreen:r})},useWindowKeyDown:!0};const ki=Ft})(),g})())})(kr);var Ao=kr.exports;const $o=sr(Ao);function Ko(){var e=new Map;function n(s){var l=s.root,p=s.rootMargin,f=s.threshold,g=e.get(l);g||(g=new Map,e.set(l,g));var d=JSON.stringify({rootMargin:p,threshold:f}),v=g.get(d);if(!v){var b=new Map,h=new IntersectionObserver(function(S){S.forEach(function(k){var x=b.get(k.target);x==null||x(k)})},{root:l,rootMargin:p,threshold:f});v={observer:h,entryCallbacks:b},g.set(d,v)}return{observe:function(k,x){var w,_;(w=v)==null||w.entryCallbacks.set(k,x),(_=v)==null||_.observer.observe(k)},unobserve:function(k){var x,w;(x=v)==null||x.entryCallbacks.delete(k),(w=v)==null||w.observer.unobserve(k)}}}return{getObserver:n}}var Uo="0px",Ho=[0],qo=Ko();function Vo(e){var n,s,l=(n=e==null?void 0:e.rootMargin)!=null?n:Uo,p=(s=e==null?void 0:e.threshold)!=null?s:Ho,f=L.useRef(null),g=L.useRef(null),d=L.useRef(null),v=L.useState(),b=v[0],h=v[1],S=L.useCallback(function(){var _=f.current;if(!_){h(void 0);return}var I=qo.getObserver({root:g.current,rootMargin:l,threshold:p});I.observe(_,function(C){h(C)}),d.current=I},[l,p]),k=L.useCallback(function(){var _=d.current,I=f.current;I&&(_==null||_.unobserve(I)),d.current=null},[]),x=L.useCallback(function(_){k(),f.current=_,S()},[S,k]),w=L.useCallback(function(_){k(),g.current=_,S()},[S,k]);return[x,{entry:b,rootRef:w}]}function Qt(){return Qt=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e},Qt.apply(this,arguments)}function Go(e){var n,s=Vo(e),l=s[0],p=s[1],f=!!((n=p.entry)!=null&&n.isIntersecting),g=L.useState(f),d=g[0],v=g[1];return f&&!d&&v(!0),[l,Qt({},p,{isVisible:f,wasEverVisible:d})]}var Xo=100;function Yo(e){var n=e.loading,s=e.hasNextPage,l=e.onLoadMore,p=e.rootMargin,f=e.disabled,g=e.delayInMs,d=g===void 0?Xo:g,v=Go({rootMargin:p}),b=v[0],h=v[1],S=h.rootRef,k=h.isVisible,x=!f&&!n&&k&&s;return L.useEffect(function(){if(x){var w=setTimeout(function(){l()},d);return function(){clearTimeout(w)}}},[l,x,d]),[b,{rootRef:S}]}var Wt=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function At(e,n,s,l){e.addEventListener?e.addEventListener(n,s,l):e.attachEvent&&e.attachEvent("on".concat(n),function(){s(window.event)})}function jr(e,n){for(var s=n.slice(0,n.length-1),l=0;l<s.length;l++)s[l]=e[s[l].toLowerCase()];return s}function Tr(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var n=e.split(","),s=n.lastIndexOf("");s>=0;)n[s-1]+=",",n.splice(s,1),s=n.lastIndexOf("");return n}function Qo(e,n){for(var s=e.length>=n.length?e:n,l=e.length>=n.length?n:e,p=!0,f=0;f<s.length;f++)l.indexOf(s[f])===-1&&(p=!1);return p}var sn={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,"-":Wt?173:189,"=":Wt?61:187,";":Wt?59:186,"'":222,"[":219,"]":221,"\\":220},Me={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Jt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},de={16:!1,18:!1,17:!1,91:!1},se={};for(var vt=1;vt<20;vt++)sn["f".concat(vt)]=111+vt;var te=[],Jn=!1,Or="all",Er=[],Et=function(n){return sn[n.toLowerCase()]||Me[n.toLowerCase()]||n.toUpperCase().charCodeAt(0)};function _r(e){Or=e||"all"}function ct(){return Or||"all"}function Jo(){return te.slice(0)}function Zo(e){var n=e.target||e.srcElement,s=n.tagName,l=!0;return(n.isContentEditable||(s==="INPUT"||s==="TEXTAREA"||s==="SELECT")&&!n.readOnly)&&(l=!1),l}function ea(e){return typeof e=="string"&&(e=Et(e)),te.indexOf(e)!==-1}function ta(e,n){var s,l;e||(e=ct());for(var p in se)if(Object.prototype.hasOwnProperty.call(se,p))for(s=se[p],l=0;l<s.length;)s[l].scope===e?s.splice(l,1):l++;ct()===e&&_r(n||"all")}function na(e){var n=e.keyCode||e.which||e.charCode,s=te.indexOf(n);if(s>=0&&te.splice(s,1),e.key&&e.key.toLowerCase()==="meta"&&te.splice(0,te.length),(n===93||n===224)&&(n=91),n in de){de[n]=!1;for(var l in Me)Me[l]===n&&(be[l]=!1)}}function ra(e){if(typeof e>"u")Object.keys(se).forEach(function(g){return delete se[g]});else if(Array.isArray(e))e.forEach(function(g){g.key&&$t(g)});else if(typeof e=="object")e.key&&$t(e);else if(typeof e=="string"){for(var n=arguments.length,s=new Array(n>1?n-1:0),l=1;l<n;l++)s[l-1]=arguments[l];var p=s[0],f=s[1];typeof p=="function"&&(f=p,p=""),$t({key:e,scope:p,method:f,splitKey:"+"})}}var $t=function(n){var s=n.key,l=n.scope,p=n.method,f=n.splitKey,g=f===void 0?"+":f,d=Tr(s);d.forEach(function(v){var b=v.split(g),h=b.length,S=b[h-1],k=S==="*"?"*":Et(S);if(se[k]){l||(l=ct());var x=h>1?jr(Me,b):[];se[k]=se[k].filter(function(w){var _=p?w.method===p:!0;return!(_&&w.scope===l&&Qo(w.mods,x))})}})};function Zn(e,n,s,l){if(n.element===l){var p;if(n.scope===s||n.scope==="all"){p=n.mods.length>0;for(var f in de)Object.prototype.hasOwnProperty.call(de,f)&&(!de[f]&&n.mods.indexOf(+f)>-1||de[f]&&n.mods.indexOf(+f)===-1)&&(p=!1);(n.mods.length===0&&!de[16]&&!de[18]&&!de[17]&&!de[91]||p||n.shortcut==="*")&&n.method(e,n)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function er(e,n){var s=se["*"],l=e.keyCode||e.which||e.charCode;if(be.filter.call(this,e)){if((l===93||l===224)&&(l=91),te.indexOf(l)===-1&&l!==229&&te.push(l),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(w){var _=Jt[w];e[w]&&te.indexOf(_)===-1?te.push(_):!e[w]&&te.indexOf(_)>-1?te.splice(te.indexOf(_),1):w==="metaKey"&&e[w]&&te.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(te=te.slice(te.indexOf(_))))}),l in de){de[l]=!0;for(var p in Me)Me[p]===l&&(be[p]=!0);if(!s)return}for(var f in de)Object.prototype.hasOwnProperty.call(de,f)&&(de[f]=e[Jt[f]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(te.indexOf(17)===-1&&te.push(17),te.indexOf(18)===-1&&te.push(18),de[17]=!0,de[18]=!0);var g=ct();if(s)for(var d=0;d<s.length;d++)s[d].scope===g&&(e.type==="keydown"&&s[d].keydown||e.type==="keyup"&&s[d].keyup)&&Zn(e,s[d],g,n);if(l in se){for(var v=0;v<se[l].length;v++)if((e.type==="keydown"&&se[l][v].keydown||e.type==="keyup"&&se[l][v].keyup)&&se[l][v].key){for(var b=se[l][v],h=b.splitKey,S=b.key.split(h),k=[],x=0;x<S.length;x++)k.push(Et(S[x]));k.sort().join("")===te.sort().join("")&&Zn(e,b,g,n)}}}}function ia(e){return Er.indexOf(e)>-1}function be(e,n,s){te=[];var l=Tr(e),p=[],f="all",g=document,d=0,v=!1,b=!0,h="+",S=!1;for(s===void 0&&typeof n=="function"&&(s=n),Object.prototype.toString.call(n)==="[object Object]"&&(n.scope&&(f=n.scope),n.element&&(g=n.element),n.keyup&&(v=n.keyup),n.keydown!==void 0&&(b=n.keydown),n.capture!==void 0&&(S=n.capture),typeof n.splitKey=="string"&&(h=n.splitKey)),typeof n=="string"&&(f=n);d<l.length;d++)e=l[d].split(h),p=[],e.length>1&&(p=jr(Me,e)),e=e[e.length-1],e=e==="*"?"*":Et(e),e in se||(se[e]=[]),se[e].push({keyup:v,keydown:b,scope:f,mods:p,shortcut:l[d],method:s,key:l[d],splitKey:h,element:g});typeof g<"u"&&!ia(g)&&window&&(Er.push(g),At(g,"keydown",function(k){er(k,g)},S),Jn||(Jn=!0,At(window,"focus",function(){te=[]},S)),At(g,"keyup",function(k){er(k,g),na(k)},S))}function oa(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(se).forEach(function(s){var l=se[s].find(function(p){return p.scope===n&&p.shortcut===e});l&&l.method&&l.method()})}var Kt={setScope:_r,getScope:ct,deleteScope:ta,getPressedKeyCodes:Jo,isPressed:ea,filter:Zo,trigger:oa,unbind:ra,keyMap:sn,modifier:Me,modifierMap:Jt};for(var Ut in Kt)Object.prototype.hasOwnProperty.call(Kt,Ut)&&(be[Ut]=Kt[Ut]);if(typeof window<"u"){var aa=window.hotkeys;be.noConflict=function(e){return e&&window.hotkeys===be&&(window.hotkeys=aa),be},window.hotkeys=be}be.filter=function(){return!0};var Cr=function(n,s){var l=n.target,p=l&&l.tagName;return!!(p&&s&&s.includes(p))},sa=function(n){return Cr(n,["INPUT","TEXTAREA","SELECT"])};function la(e,n,s,l){s instanceof Array&&(l=s,s=void 0);var p=s||{},f=p.enableOnTags,g=p.filter,d=p.keyup,v=p.keydown,b=p.filterPreventDefault,h=b===void 0?!0:b,S=p.enabled,k=S===void 0?!0:S,x=p.enableOnContentEditable,w=x===void 0?!1:x,_=L.useRef(null),I=L.useCallback(function(C,W){var D,$;return g&&!g(C)?!h:sa(C)&&!Cr(C,f)||(D=C.target)!=null&&D.isContentEditable&&!w?!0:_.current===null||document.activeElement===_.current||($=_.current)!=null&&$.contains(document.activeElement)?(n(C,W),!0):!1},l?[_,f,g].concat(l):[_,f,g]);return L.useEffect(function(){if(!k){be.unbind(e,I);return}return d&&v!==!0&&(s.keydown=!1),be(e,s||{},I),function(){return be.unbind(e,I)}},[I,e,k]),_}be.isPressed;const Rr=L.createContext({open:!1,toggleOpen:e=>{}});function ca({children:e}){const[n,s]=L.useState(!1),l=f=>{s(f??!f)},p=L.useMemo(()=>({open:n,toggleOpen:l}),[n]);return t.jsx(Rr.Provider,{value:p,children:e})}function ln(){return L.useContext(Rr)}const we={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},ua=e=>ut(async()=>{const{data:n}=await e.get(we.categoriesPath);return Array.isArray(n)?n:[]},{manual:!0});function da(e,n){const s={sortBy:"popularity",sortDirection:"desc",...e},{onFilterChange:l,onSearchSelect:p=d=>{n.onFilterChange({...s,keyword:d.title})},emptyCategory:f}=n;!s.category&&!f&&(s.category="All");const g=d=>{const v={...s,...d};l(Bt(v,b=>b===""||b===void 0))};return{filters:e,cleanFilter:d=>{const v=d?Bt(s,(b,h)=>d.includes(h)):{};l(Bt(v,b=>b===""||b===void 0))},handleSort:(d,v)=>{g({sortBy:d,sortDirection:v||d==="nameAsc"?"asc":"desc"})},handleKeyword:d=>{g({category:void 0,keyword:d||void 0})},handlePrice:d=>{g({price:d===e.price?void 0:d})},handleCategory:d=>{g({category:d===e.category?"":d})},handleDeveloper:d=>{g({owner:d||void 0})},handlePage:d=>{g({currentPage:d})},handleSwitchShowResources:d=>{g({showResources:d})},handleSearchSelect:d=>{p(d)}}}const ha=(e,n,s)=>e&&n||!s,Ir=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],Pr=(e,n,s)=>{var l,p;const f=Wi(e),g=Ai(f.search);if((l=$i(e,{strict:!0}))!=null&&l.endsWith(".gif"))return g.imageFilter?Ki({...f,search:""}):e;if(g.imageFilter)return e;const d=s||((p=window.blocklet)==null?void 0:p.version),{w:v,h:b}=typeof n=="object"?{w:n.w,h:n.h}:{w:n,h:n};return nn(e,{...v||b?{imageFilter:"resize",w:v,h:b}:{},v:d})},pa=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],fa=(e=[],n="en")=>e.map(s=>({name:s.locales[n]||s.locales.en,value:s._id})),ma=(e,n)=>e==null?void 0:e.replace(/{(\w*)}/g,(s,l)=>n.hasOwnProperty(l)?n[l]:""),ga=()=>window.innerWidth<=600,ba={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show resources",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},va={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示资源型应用",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Ht={en:Un(ba),zh:Un(va)},Mr=(e,n)=>{const s={};return e&&(s["x-blocklet-server-version"]=e),n&&(s["x-blocklet-store-version"]=n),s},ya=e=>(n,s)=>{const l=Ht[e]?Ht[e][n]:Ht.en[n];return ma(l,s)||n},Lr={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},Dr=L.createContext(Lr),{Provider:xa,Consumer:Fs}=Dr;function wa(e){const{locale:n="zh",filters:s={},serverVersion:l="",onFilterChange:p=()=>{},minItemWidth:f=350,queryFilter:g=!0,layout:d={},wrapChildren:v=re=>re,extraFilter:b=re=>re,baseSearch:h=!1,fetchCategoryDelay:S=0,showResourcesSwitch:k=!1,showCategory:x=!0,tagFilters:w=[],children:_,storeVersion:I,onSearchSelect:C=()=>{},endpoint:W,blockletRender:D}=e,$=Mr(l,I),Q=L.useMemo(()=>lr({baseURL:W,headers:$}),[W]),ee=da(s,{onFilterChange:p,emptyCategory:!d.showExplore,onSearchSelect:C}),[U,le]=L.useState(""),{data:ve=[],error:ke,loading:je,run:Te}=ua(Q),ae=L.useMemo(()=>{const re=zo(ve,[_e=>_e.name],["asc"]),fe=re.findIndex(_e=>_e.name==="All"||_e.locales.en==="All");return fe>-1?[{...re[fe],_id:"All"},...re.slice(0,fe),...re.slice(fe+1)]:re},[ve]),ye=L.useCallback(ya(n),[n]),R=L.useMemo(()=>fa(ae,n),[ae,n]),V=pa(ye),ce={search:ee,errors:{fetchCategoriesError:ke},loadings:{fetchCategoriesLoading:je},extraFilter:b,endpoint:W,queryFilter:g,layout:{showExplore:d.showExplore??!1,showCategory:d.showCategory??!0,showTitle:d.showTitle??!0,showSearch:d.showSearch??!0},minItemWidth:f,wrapChildren:v,t:ye,storeVersion:I,serverVersion:l,selectedCategory:ee.filters.category||(d.showExplore?"":"All"),categoryList:ae,blockletRender:D,locale:n,categoryOptions:R,priceOptions:V,storeApi:Q,baseSearch:h,showResourcesSwitch:k,showCategory:x,tagFilters:w,onFilterChange:p,getCategoryLocale:re=>{if(!re)return null;const fe=ve.find(_e=>_e._id===re||_e.locales.en==="All");return fe?fe.locales[n]||fe.locales.en:null},get developerName(){return U},updateDeveloperName:le};return L.useEffect(()=>{setTimeout(Te,S||0)},[W,Te,S]),t.jsx(xa,{value:ce,children:_})}function pe(){return L.useContext(Dr)||Lr}function zr({children:e,onClick:n,size:s=32,...l}){return t.jsx(xe,{...l,onClick:n,variant:"outlined",sx:[{minWidth:s,height:s,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(l.sx)?l.sx:[l.sx]],children:e})}function yt(e,n){return e===void 0?n:e}function cn({xs:e,sm:n,md:s,lg:l,xl:p,exact:f}){const g=Qe(),d=Fe(g.breakpoints.down("sm")),v=Fe(g.breakpoints.between("sm","md")),b=Fe(g.breakpoints.between("md","lg")),h=Fe(g.breakpoints.between("lg","xl"));if(f)return d?e||null:v?n||null:b?s||null:h?l||null:p||null;let S=e;return d||(S=yt(n,S),v)||(S=yt(s,S),b)||(S=yt(l,S),h)?S:yt(p,S)}function Sa({children:e}){const{open:n,toggleOpen:s}=ln();return t.jsx(cn,{xs:t.jsx(Fi,{open:n,onClose:()=>s(!1),children:e}),md:t.jsx(Y,{children:e})})}const ka=L.forwardRef(({loading:e,disabled:n,...s},l)=>t.jsx(xe,{ref:l,disableElevation:!0,disabled:n||e,...s,sx:[{borderRadius:"4px"},...Array.isArray(s.sx)?s.sx:[s.sx]],startIcon:e&&t.jsx(Ee,{size:"1em"})}));function Nr({value:e,options:n,onChange:s,placeholder:l,...p}){var f;const g=L.useRef(null),d=Qe(),[v,b]=L.useState(!1),[h,S]=L.useState(e!==null?e:""),k=Fe(d.breakpoints.down("sm"));L.useEffect(()=>{S(e!==null?e:"")},[e]);const x=L.useCallback(()=>{b(!1)},[]),w=L.useCallback(()=>{b(!0)},[]);function _(C){S(C.value),s(C.value),k&&x()}function I(C){return C===h}return t.jsxs(t.Fragment,{children:[t.jsxs(ja,{ref:g,onClick:w,variant:"outlined",size:"small",className:["my-select__selector",Ui(h)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary"},...p,children:[((f=n.find(C=>C.value===h))==null?void 0:f.name)||l,t.jsx(Hi,{className:"my-select__arrowdown",component:Sr,fontSize:"small"})]}),t.jsx(qi,{open:v,anchorEl:g.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:C,placement:W})=>t.jsx(Vi,{...C,style:{transformOrigin:W==="bottom"?"center top":"center bottom"},children:t.jsx(Gi,{children:t.jsx(Xi,{onClickAway:x,children:t.jsx(Ta,{autoFocusItem:v,onMouseEnter:w,onMouseLeave:x,children:n.map(D=>t.jsxs(St,{onClick:()=>_(D),children:[t.jsx(Yi,{sx:{mr:1,fontSize:16,visibility:I(D.value)?"visible":"hidden"}}),D.name]},D.value))})})})})})]})}const ja=Be(ka)`
|
|
1
|
+
import{cl as Ge,r as D,ci as ut,bb as Ti,bc as Oi,bk as gt,f5 as bt,cj as st,f6 as Ei,f7 as _i,f8 as Ci,bR as $n,a7 as Ot,bP as ot,cY as Ri,bW as Kn,j as t,g as sr,f9 as Ii,fa as Pi,aO as Xe,aP as Ye,cQ as at,cI as Un,e0 as xe,C as Ee,s as Be,N as Y,am as Qe,dj as Mi,a4 as Li,dx as Di,fb as lr,eM as cr,fc as en,aD as zi,aE as tn,aW as Se,fd as Bt,m as X,cX as ur,fe as Ni,H as Fe,ff as Fi,b1 as dr,S as hr,f4 as nn,aw as rn,G as Hn,dZ as qn,aS as Bi,fg as Wi,fh as Ai,fi as $i,fj as Ki,O as Ui,eO as Hi,eN as qi,e8 as Vi,dR as Gi,eL as Xi,Q as St,a0 as Yi,fk as pr,fl as Qi,a3 as Pe,P,q as We,aB as fr,aR as Vn,cA as Ji,B as kt,a9 as Zi,aa as mr,aH as eo,fm as Gn,ab as to,bo as on,D as no,w as ro,U as io,cx as oo,V as lt,F as gr,A as Ne,b as ao,t as so,b2 as lo,af as co,eQ as br,cf as uo,ek as ho,W as po}from"./index-BJnzhtRd.js";import{d as fo}from"./ChevronLeft-46fJs4Nx.js";import{d as mo}from"./ChevronRight-CAETeava.js";import{d as wt}from"./Search-DIjK_pEi.js";import{E as go}from"./index-cJ8AIyQl.js";import{E as bo}from"./index-BkrLS-vH.js";import{O as vr}from"./Select-BjFMRCFC.js";import{S as Ie}from"./Skeleton-CWJ5kMp8.js";import{A as vo}from"./Autocomplete-BBeQ6-hj.js";import{T as yr}from"./TextField-CffC6XHW.js";import{I as Xn}from"./InputAdornment-BZCjodnq.js";import{d as yo}from"./Add-Dh_DeTW0.js";import{d as xr}from"./Launch-DFcuOomh.js";import{d as xo}from"./Done-DOjWCsLg.js";import{d as wr}from"./DeleteOutline-DPxWTBB6.js";import{C as wo}from"./delete-confirm-BvTjtXVg.js";import{u as So}from"./blocklet-CpvMNcyR.js";import{d as ko}from"./MoreVert-CQDScAiQ.js";import{B as Yn}from"./ButtonGroup-stQLgH3W.js";var jo=function(e){return e===document||e===document.documentElement||e===document.body?Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop):e.scrollTop},To=function(e){return e.scrollHeight||Math.max(document.documentElement.scrollHeight,document.body.scrollHeight)},Oo=function(e){return e.clientHeight||Math.max(document.documentElement.clientHeight,document.body.clientHeight)},Eo=function(e,n){n===void 0&&(n={});var s=n.target,l=n.isNoMore,p=n.threshold,f=p===void 0?100:p,g=n.reloadDeps,d=g===void 0?[]:g,v=n.manual,b=n.onBefore,h=n.onSuccess,S=n.onError,k=n.onFinally,x=Ge(D.useState(),2),w=x[0],_=x[1],I=Ge(D.useState(!1),2),C=I[0],B=I[1],M=D.useMemo(function(){return l?l(w):!1},[w]),$=ut(function(R){return Ti(void 0,void 0,void 0,function(){var V,ce,re;return Oi(this,function(fe){switch(fe.label){case 0:return[4,e(R)];case 1:return V=fe.sent(),_(R?gt(gt({},V),{list:bt(bt([],Ge((re=R.list)!==null&&re!==void 0?re:[]),!1),Ge(V.list),!1)}):gt(gt({},V),{list:bt([],Ge((ce=V.list)!==null&&ce!==void 0?ce:[]),!1)})),[2,V]}})})},{manual:v,onFinally:function(R,V,ce){B(!1),k==null||k(V,ce)},onBefore:function(){return b==null?void 0:b()},onSuccess:function(R){setTimeout(function(){ye()}),h==null||h(R)},onError:function(R){return S==null?void 0:S(R)}}),Q=$.loading,ee=$.error,U=$.run,le=$.runAsync,ve=$.cancel,ke=st(function(){M||(B(!0),U(w))}),je=st(function(){return M?Promise.reject():(B(!0),le(w))}),Te=function(){return B(!1),U()},ae=function(){return B(!1),le()},ye=function(){var R=Ei(s);if(R){R=R===document?document.documentElement:R;var V=jo(R),ce=To(R),re=Oo(R);ce-V<=re+f&&ke()}};return _i("scroll",function(){Q||C||ye()},{target:s}),Ci(function(){U()},bt([],Ge(d),!1)),{data:w,loading:!C&&Q,error:ee,loadingMore:C,noMore:M,loadMore:ke,loadMoreAsync:je,reload:st(Te),reloadAsync:st(ae),mutate:_,cancel:ve}};const _o=["name"],Co=["children","className","clone","component"];function Ro(e,n){const s={};return Object.keys(e).forEach(l=>{n.indexOf(l)===-1&&(s[l]=e[l])}),s}function Io(e){return(s,l={})=>{const{name:p}=l,f=$n(l,_o);let g=p;const v=Ot(typeof s=="function"?S=>({root:k=>s(ot({theme:S},k))}):{root:s},ot({Component:e,name:p||e.displayName,classNamePrefix:g},f));let b;s.filterProps&&(b=s.filterProps,delete s.filterProps),s.propTypes&&(s.propTypes,delete s.propTypes);const h=D.forwardRef(function(k,x){const{children:w,className:_,clone:I,component:C}=k,B=$n(k,Co),M=v(k),$=Kn(M.root,_);let Q=B;if(b&&(Q=Ro(Q,b)),I)return D.cloneElement(w,ot({className:Kn(w.props.className,$)},Q));if(typeof w=="function")return w(ot({className:$},Q));const ee=C||e;return t.jsx(ee,ot({ref:x,className:$},Q,{children:w}))});return Ri(h,e),h}}const zs="blocklet-add-component-registry",Ns="server-add-registry",Po={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'};var Mo=Ii,Qn=Pi;function Lo(e,n,s,l){return e==null?[]:(Qn(n)||(n=n==null?[]:[n]),s=l?void 0:s,Qn(s)||(s=s==null?[]:[s]),Mo(e,n,s))}var Do=Lo;const zo=sr(Do);var an={},No=Ye;Object.defineProperty(an,"__esModule",{value:!0});var Sr=an.default=void 0,Fo=No(Xe()),Bo=t;Sr=an.default=(0,Fo.default)((0,Bo.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");const Wo={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"/>'};var kr={exports:{}};(function(e,n){(function(s,l){e.exports=l(D)})(at,s=>(()=>{var l={703:(d,v,b)=>{var h=b(414);function S(){}function k(){}k.resetWarningCache=S,d.exports=function(){function x(I,C,B,M,$,Q){if(Q!==h){var ee=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 ee.name="Invariant Violation",ee}}function w(){return x}x.isRequired=x;var _={array:x,bool:x,func:x,number:x,object:x,string:x,symbol:x,any:x,arrayOf:w,element:x,elementType:x,instanceOf:w,node:x,objectOf:w,oneOf:w,oneOfType:w,shape:w,exact:w,checkPropTypes:k,resetWarningCache:S};return _.PropTypes=_,_}},697:(d,v,b)=>{d.exports=b(703)()},414:d=>{d.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:d=>{var v=typeof Element<"u",b=typeof Map=="function",h=typeof Set=="function",S=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function k(x,w){if(x===w)return!0;if(x&&w&&typeof x=="object"&&typeof w=="object"){if(x.constructor!==w.constructor)return!1;var _,I,C,B;if(Array.isArray(x)){if((_=x.length)!=w.length)return!1;for(I=_;I--!=0;)if(!k(x[I],w[I]))return!1;return!0}if(b&&x instanceof Map&&w instanceof Map){if(x.size!==w.size)return!1;for(B=x.entries();!(I=B.next()).done;)if(!w.has(I.value[0]))return!1;for(B=x.entries();!(I=B.next()).done;)if(!k(I.value[1],w.get(I.value[0])))return!1;return!0}if(h&&x instanceof Set&&w instanceof Set){if(x.size!==w.size)return!1;for(B=x.entries();!(I=B.next()).done;)if(!w.has(I.value[0]))return!1;return!0}if(S&&ArrayBuffer.isView(x)&&ArrayBuffer.isView(w)){if((_=x.length)!=w.length)return!1;for(I=_;I--!=0;)if(x[I]!==w[I])return!1;return!0}if(x.constructor===RegExp)return x.source===w.source&&x.flags===w.flags;if(x.valueOf!==Object.prototype.valueOf)return x.valueOf()===w.valueOf();if(x.toString!==Object.prototype.toString)return x.toString()===w.toString();if((_=(C=Object.keys(x)).length)!==Object.keys(w).length)return!1;for(I=_;I--!=0;)if(!Object.prototype.hasOwnProperty.call(w,C[I]))return!1;if(v&&x instanceof Element)return!1;for(I=_;I--!=0;)if((C[I]!=="_owner"&&C[I]!=="__v"&&C[I]!=="__o"||!x.$$typeof)&&!k(x[C[I]],w[C[I]]))return!1;return!0}return x!=x&&w!=w}d.exports=function(x,w){try{return k(x,w)}catch(_){if((_.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw _}}},359:d=>{d.exports=s}},p={};function f(d){var v=p[d];if(v!==void 0)return v.exports;var b=p[d]={exports:{}};return l[d](b,b.exports,f),b.exports}f.n=d=>{var v=d&&d.__esModule?()=>d.default:()=>d;return f.d(v,{a:v}),v},f.d=(d,v)=>{for(var b in v)f.o(v,b)&&!f.o(d,b)&&Object.defineProperty(d,b,{enumerable:!0,get:v[b]})},f.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),f.o=(d,v)=>Object.prototype.hasOwnProperty.call(d,v),f.r=d=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(d,"__esModule",{value:!0})};var g={};return(()=>{function d(a){var r,c,u="";if(typeof a=="string"||typeof a=="number")u+=a;else if(typeof a=="object")if(Array.isArray(a))for(r=0;r<a.length;r++)a[r]&&(c=d(a[r]))&&(u&&(u+=" "),u+=c);else for(r in a)a[r]&&(u&&(u+=" "),u+=r);return u}function v(){for(var a,r,c=0,u="";c<arguments.length;)(a=arguments[c++])&&(r=d(a))&&(u&&(u+=" "),u+=r);return u}f.r(g),f.d(g,{default:()=>ki});var b=f(359),h=f.n(b);const S=function(a){var r=typeof a;return a!=null&&(r=="object"||r=="function")},k=typeof at=="object"&&at&&at.Object===Object&&at;var x=typeof self=="object"&&self&&self.Object===Object&&self;const w=k||x||Function("return this")(),_=function(){return w.Date.now()};var I=/\s/,C=/^\s+/;const B=function(a){return a&&a.slice(0,function(r){for(var c=r.length;c--&&I.test(r.charAt(c)););return c}(a)+1).replace(C,"")},M=w.Symbol;var $=Object.prototype,Q=$.hasOwnProperty,ee=$.toString,U=M?M.toStringTag:void 0,le=Object.prototype.toString,ve=M?M.toStringTag:void 0;const ke=function(a){return a==null?a===void 0?"[object Undefined]":"[object Null]":ve&&ve in Object(a)?function(r){var c=Q.call(r,U),u=r[U];try{r[U]=void 0;var O=!0}catch{}var F=ee.call(r);return O&&(c?r[U]=u:delete r[U]),F}(a):function(r){return le.call(r)}(a)};var je=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,ae=/^0o[0-7]+$/i,ye=parseInt;const R=function(a){if(typeof a=="number")return a;if(function(u){return typeof u=="symbol"||function(O){return O!=null&&typeof O=="object"}(u)&&ke(u)=="[object Symbol]"}(a))return NaN;if(S(a)){var r=typeof a.valueOf=="function"?a.valueOf():a;a=S(r)?r+"":r}if(typeof a!="string")return a===0?a:+a;a=B(a);var c=Te.test(a);return c||ae.test(a)?ye(a.slice(2),c?2:8):je.test(a)?NaN:+a};var V=Math.max,ce=Math.min;const re=function(a,r,c){var u,O,F,G,o,i,m=0,j=!1,E=!1,T=!0;if(typeof a!="function")throw new TypeError("Expected a function");function K(W){var q=u,J=O;return u=O=void 0,m=W,G=a.apply(J,q)}function A(W){return m=W,o=setTimeout(L,r),j?K(W):G}function H(W){var q=W-i;return i===void 0||q>=r||q<0||E&&W-m>=F}function L(){var W=_();if(H(W))return z(W);o=setTimeout(L,function(q){var J=r-(q-i);return E?ce(J,F-(q-m)):J}(W))}function z(W){return o=void 0,T&&u?K(W):(u=O=void 0,G)}function N(){var W=_(),q=H(W);if(u=arguments,O=this,i=W,q){if(o===void 0)return A(i);if(E)return clearTimeout(o),o=setTimeout(L,r),K(i)}return o===void 0&&(o=setTimeout(L,r)),G}return r=R(r)||0,S(c)&&(j=!!c.leading,F=(E="maxWait"in c)?V(R(c.maxWait)||0,r):F,T="trailing"in c?!!c.trailing:T),N.cancel=function(){o!==void 0&&clearTimeout(o),m=0,u=i=O=o=void 0},N.flush=function(){return o===void 0?G:z(_())},N},fe=function(a,r,c){var u=!0,O=!0;if(typeof a!="function")throw new TypeError("Expected a function");return S(c)&&(u="leading"in c?!!c.leading:u,O="trailing"in c?!!c.trailing:O),re(a,r,{leading:u,maxWait:r,trailing:O})};var _e=f(590),Qr=f.n(_e),bn=function(){if(typeof Map<"u")return Map;function a(r,c){var u=-1;return r.some(function(O,F){return O[0]===c&&(u=F,!0)}),u}return function(){function r(){this.__entries__=[]}return Object.defineProperty(r.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),r.prototype.get=function(c){var u=a(this.__entries__,c),O=this.__entries__[u];return O&&O[1]},r.prototype.set=function(c,u){var O=a(this.__entries__,c);~O?this.__entries__[O][1]=u:this.__entries__.push([c,u])},r.prototype.delete=function(c){var u=this.__entries__,O=a(u,c);~O&&u.splice(O,1)},r.prototype.has=function(c){return!!~a(this.__entries__,c)},r.prototype.clear=function(){this.__entries__.splice(0)},r.prototype.forEach=function(c,u){u===void 0&&(u=null);for(var O=0,F=this.__entries__;O<F.length;O++){var G=F[O];c.call(u,G[1],G[0])}},r}()}(),Ct=typeof window<"u"&&typeof document<"u"&&window.document===document,dt=f.g!==void 0&&f.g.Math===Math?f.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Jr=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(dt):function(a){return setTimeout(function(){return a(Date.now())},1e3/60)},Zr=["top","right","bottom","left","width","height","size","weight"],ei=typeof MutationObserver<"u",ti=function(){function a(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(r,c){var u=!1,O=!1,F=0;function G(){u&&(u=!1,r()),O&&i()}function o(){Jr(G)}function i(){var m=Date.now();if(u){if(m-F<2)return;O=!0}else u=!0,O=!1,setTimeout(o,20);F=m}return i}(this.refresh.bind(this))}return a.prototype.addObserver=function(r){~this.observers_.indexOf(r)||this.observers_.push(r),this.connected_||this.connect_()},a.prototype.removeObserver=function(r){var c=this.observers_,u=c.indexOf(r);~u&&c.splice(u,1),!c.length&&this.connected_&&this.disconnect_()},a.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},a.prototype.updateObservers_=function(){var r=this.observers_.filter(function(c){return c.gatherActive(),c.hasActive()});return r.forEach(function(c){return c.broadcastActive()}),r.length>0},a.prototype.connect_=function(){Ct&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ei?(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)},a.prototype.disconnect_=function(){Ct&&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)},a.prototype.onTransitionEnd_=function(r){var c=r.propertyName,u=c===void 0?"":c;Zr.some(function(O){return!!~u.indexOf(O)})&&this.refresh()},a.getInstance=function(){return this.instance_||(this.instance_=new a),this.instance_},a.instance_=null,a}(),vn=function(a,r){for(var c=0,u=Object.keys(r);c<u.length;c++){var O=u[c];Object.defineProperty(a,O,{value:r[O],enumerable:!1,writable:!1,configurable:!0})}return a},Ae=function(a){return a&&a.ownerDocument&&a.ownerDocument.defaultView||dt},yn=pt(0,0,0,0);function ht(a){return parseFloat(a)||0}function xn(a){for(var r=[],c=1;c<arguments.length;c++)r[c-1]=arguments[c];return r.reduce(function(u,O){return u+ht(a["border-"+O+"-width"])},0)}var ni=typeof SVGGraphicsElement<"u"?function(a){return a instanceof Ae(a).SVGGraphicsElement}:function(a){return a instanceof Ae(a).SVGElement&&typeof a.getBBox=="function"};function ri(a){return Ct?ni(a)?function(r){var c=r.getBBox();return pt(0,0,c.width,c.height)}(a):function(r){var c=r.clientWidth,u=r.clientHeight;if(!c&&!u)return yn;var O=Ae(r).getComputedStyle(r),F=function(T){for(var K={},A=0,H=["top","right","bottom","left"];A<H.length;A++){var L=H[A],z=T["padding-"+L];K[L]=ht(z)}return K}(O),G=F.left+F.right,o=F.top+F.bottom,i=ht(O.width),m=ht(O.height);if(O.boxSizing==="border-box"&&(Math.round(i+G)!==c&&(i-=xn(O,"left","right")+G),Math.round(m+o)!==u&&(m-=xn(O,"top","bottom")+o)),!function(T){return T===Ae(T).document.documentElement}(r)){var j=Math.round(i+G)-c,E=Math.round(m+o)-u;Math.abs(j)!==1&&(i-=j),Math.abs(E)!==1&&(m-=E)}return pt(F.left,F.top,i,m)}(a):yn}function pt(a,r,c,u){return{x:a,y:r,width:c,height:u}}var ii=function(){function a(r){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=pt(0,0,0,0),this.target=r}return a.prototype.isActive=function(){var r=ri(this.target);return this.contentRect_=r,r.width!==this.broadcastWidth||r.height!==this.broadcastHeight},a.prototype.broadcastRect=function(){var r=this.contentRect_;return this.broadcastWidth=r.width,this.broadcastHeight=r.height,r},a}(),oi=function(a,r){var c,u,O,F,G,o,i,m=(u=(c=r).x,O=c.y,F=c.width,G=c.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(o.prototype),vn(i,{x:u,y:O,width:F,height:G,top:O,right:u+F,bottom:G+O,left:u}),i);vn(this,{target:a,contentRect:m})},ai=function(){function a(r,c,u){if(this.activeObservations_=[],this.observations_=new bn,typeof r!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=r,this.controller_=c,this.callbackCtx_=u}return a.prototype.observe=function(r){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(r instanceof Ae(r).Element))throw new TypeError('parameter 1 is not of type "Element".');var c=this.observations_;c.has(r)||(c.set(r,new ii(r)),this.controller_.addObserver(this),this.controller_.refresh())}},a.prototype.unobserve=function(r){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(r instanceof Ae(r).Element))throw new TypeError('parameter 1 is not of type "Element".');var c=this.observations_;c.has(r)&&(c.delete(r),c.size||this.controller_.removeObserver(this))}},a.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},a.prototype.gatherActive=function(){var r=this;this.clearActive(),this.observations_.forEach(function(c){c.isActive()&&r.activeObservations_.push(c)})},a.prototype.broadcastActive=function(){if(this.hasActive()){var r=this.callbackCtx_,c=this.activeObservations_.map(function(u){return new oi(u.target,u.broadcastRect())});this.callback_.call(r,c,r),this.clearActive()}},a.prototype.clearActive=function(){this.activeObservations_.splice(0)},a.prototype.hasActive=function(){return this.activeObservations_.length>0},a}(),wn=typeof WeakMap<"u"?new WeakMap:new bn,Sn=function a(r){if(!(this instanceof a))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var c=ti.getInstance(),u=new ai(r,c,this);wn.set(this,u)};["observe","unobserve","disconnect"].forEach(function(a){Sn.prototype[a]=function(){var r;return(r=wn.get(this))[a].apply(r,arguments)}});const kn=dt.ResizeObserver!==void 0?dt.ResizeObserver:Sn,$e="Left",Le="Right",Ke="Up",De="Down",Ue={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Rt={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},jn="mousemove",Tn="mouseup";function On(a,r){if(r===0)return a;const c=Math.PI/180*r;return[a[0]*Math.cos(c)+a[1]*Math.sin(c),a[1]*Math.cos(c)-a[0]*Math.sin(c)]}function si(a){const{trackMouse:r}=a,c=b.useRef(Object.assign({},Rt)),u=b.useRef(Object.assign({},Ue)),O=b.useRef(Object.assign({},u.current));let F;for(F in O.current=Object.assign({},u.current),u.current=Object.assign(Object.assign({},Ue),a),Ue)u.current[F]===void 0&&(u.current[F]=Ue[F]);const[G,o]=b.useMemo(()=>function(i,m){const j=L=>{const z="touches"in L;z&&L.touches.length>1||i((N,W)=>{W.trackMouse&&!z&&(document.addEventListener(jn,E),document.addEventListener(Tn,K));const{clientX:q,clientY:J}=z?L.touches[0]:L,ie=On([q,J],W.rotationAngle);return W.onTouchStartOrOnMouseDown&&W.onTouchStartOrOnMouseDown({event:L}),Object.assign(Object.assign(Object.assign({},N),Rt),{initial:ie.slice(),xy:ie,start:L.timeStamp||0})})},E=L=>{i((z,N)=>{const W="touches"in L;if(W&&L.touches.length>1)return z;if(L.timeStamp-z.start>N.swipeDuration)return z.swiping?Object.assign(Object.assign({},z),{swiping:!1}):z;const{clientX:q,clientY:J}=W?L.touches[0]:L,[ie,me]=On([q,J],N.rotationAngle),he=ie-z.xy[0],ue=me-z.xy[1],ne=Math.abs(he),Z=Math.abs(ue),Re=(L.timeStamp||0)-z.start,tt=Math.sqrt(ne*ne+Z*Z)/(Re||1),nt=[he/(Re||1),ue/(Re||1)],Ce=function(rt,Ve,it,ge){return rt>Ve?it>0?Le:$e:ge>0?De:Ke}(ne,Z,he,ue),ze=typeof N.delta=="number"?N.delta:N.delta[Ce.toLowerCase()]||Ue.delta;if(ne<ze&&Z<ze&&!z.swiping)return z;const Oe={absX:ne,absY:Z,deltaX:he,deltaY:ue,dir:Ce,event:L,first:z.first,initial:z.initial,velocity:tt,vxvy:nt};Oe.first&&N.onSwipeStart&&N.onSwipeStart(Oe),N.onSwiping&&N.onSwiping(Oe);let qe=!1;return(N.onSwiping||N.onSwiped||N[`onSwiped${Ce}`])&&(qe=!0),qe&&N.preventScrollOnSwipe&&N.trackTouch&&L.cancelable&&L.preventDefault(),Object.assign(Object.assign({},z),{first:!1,eventData:Oe,swiping:!0})})},T=L=>{i((z,N)=>{let W;if(z.swiping&&z.eventData){if(L.timeStamp-z.start<N.swipeDuration){W=Object.assign(Object.assign({},z.eventData),{event:L}),N.onSwiped&&N.onSwiped(W);const q=N[`onSwiped${W.dir}`];q&&q(W)}}else N.onTap&&N.onTap({event:L});return N.onTouchEndOrOnMouseUp&&N.onTouchEndOrOnMouseUp({event:L}),Object.assign(Object.assign(Object.assign({},z),Rt),{eventData:W})})},K=L=>{document.removeEventListener(jn,E),document.removeEventListener(Tn,K),T(L)},A=(L,z)=>{let N=()=>{};if(L&&L.addEventListener){const W=Object.assign(Object.assign({},Ue.touchEventOptions),z.touchEventOptions),q=[["touchstart",j,W],["touchmove",E,Object.assign(Object.assign({},W),z.preventScrollOnSwipe?{passive:!1}:{})],["touchend",T,W]];q.forEach(([J,ie,me])=>L.addEventListener(J,ie,me)),N=()=>q.forEach(([J,ie])=>L.removeEventListener(J,ie))}return N},H={ref:L=>{L!==null&&i((z,N)=>{if(z.el===L)return z;const W={};return z.el&&z.el!==L&&z.cleanUpTouch&&(z.cleanUpTouch(),W.cleanUpTouch=void 0),N.trackTouch&&L&&(W.cleanUpTouch=A(L,N)),Object.assign(Object.assign(Object.assign({},z),{el:L}),W)})}};return m.trackMouse&&(H.onMouseDown=j),[H,A]}(i=>c.current=i(c.current,u.current),{trackMouse:r}),[r]);return c.current=function(i,m,j,E){return m.trackTouch&&i.el?i.cleanUpTouch?m.preventScrollOnSwipe!==j.preventScrollOnSwipe||m.touchEventOptions.passive!==j.touchEventOptions.passive?(i.cleanUpTouch(),Object.assign(Object.assign({},i),{cleanUpTouch:E(i.el,m)})):i:Object.assign(Object.assign({},i),{cleanUpTouch:E(i.el,m)}):(i.cleanUpTouch&&i.cleanUpTouch(),Object.assign(Object.assign({},i),{cleanUpTouch:void 0}))}(c.current,u.current,O.current,o),G}var y=f(697);function Je(a){return Je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Je(a)}function En(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function _n(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?En(Object(c),!0).forEach(function(u){li(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):En(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function li(a,r,c){return(r=function(u){var O=function(F,G){if(Je(F)!=="object"||F===null)return F;var o=F[Symbol.toPrimitive];if(o!==void 0){var i=o.call(F,G);if(Je(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(u,"string");return Je(O)==="symbol"?O:String(O)}(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}var ci={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},It=h().memo(function(a){var r=_n(_n({},ci),a),c=r.description,u=r.fullscreen,O=r.handleImageLoaded,F=r.isFullscreen,G=r.onImageError,o=r.original,i=r.originalAlt,m=r.originalHeight,j=r.originalWidth,E=r.originalTitle,T=r.sizes,K=r.srcSet,A=r.loading,H=F&&u||o;return h().createElement(h().Fragment,null,h().createElement("img",{className:"image-gallery-image",src:H,alt:i,srcSet:K,height:m,width:j,sizes:T,title:E,onLoad:function(L){return O(L,o)},onError:G,loading:A}),c&&h().createElement("span",{className:"image-gallery-description"},c))});It.displayName="Item",It.propTypes={description:y.string,fullscreen:y.string,handleImageLoaded:y.func.isRequired,isFullscreen:y.bool,onImageError:y.func.isRequired,original:y.string.isRequired,originalAlt:y.string,originalHeight:y.string,originalWidth:y.string,originalTitle:y.string,sizes:y.string,srcSet:y.string,loading:y.string};const ui=It;function Ze(a){return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ze(a)}function Cn(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function Rn(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?Cn(Object(c),!0).forEach(function(u){di(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):Cn(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function di(a,r,c){return(r=function(u){var O=function(F,G){if(Ze(F)!=="object"||F===null)return F;var o=F[Symbol.toPrimitive];if(o!==void 0){var i=o.call(F,G);if(Ze(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(u,"string");return Ze(O)==="symbol"?O:String(O)}(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}var hi={left:h().createElement("polyline",{points:"15 18 9 12 15 6"}),right:h().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:h().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:h().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:h().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:h().createElement(h().Fragment,null,h().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),h().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},pi={strokeWidth:1,viewBox:"0 0 24 24"},In=function(a){var r=Rn(Rn({},pi),a),c=r.strokeWidth,u=r.viewBox,O=r.icon;return h().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:u,fill:"none",stroke:"currentColor",strokeWidth:c,strokeLinecap:"round",strokeLinejoin:"round"},hi[O])};In.propTypes={strokeWidth:y.number,viewBox:y.string,icon:(0,y.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const ft=In;var Pt=h().memo(function(a){var r=a.isFullscreen,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:c,"aria-label":"Open Fullscreen"},h().createElement(ft,{strokeWidth:2,icon:r?"minimize":"maximize"}))});Pt.displayName="Fullscreen",Pt.propTypes={isFullscreen:y.bool.isRequired,onClick:y.func.isRequired};const fi=Pt;var Mt=h().memo(function(a){var r=a.disabled,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:r,onClick:c,"aria-label":"Previous Slide"},h().createElement(ft,{icon:"left",viewBox:"6 0 12 24"}))});Mt.displayName="LeftNav",Mt.propTypes={disabled:y.bool.isRequired,onClick:y.func.isRequired};const mi=Mt;var Lt=h().memo(function(a){var r=a.disabled,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:r,onClick:c,"aria-label":"Next Slide"},h().createElement(ft,{icon:"right",viewBox:"6 0 12 24"}))});Lt.displayName="RightNav",Lt.propTypes={disabled:y.bool.isRequired,onClick:y.func.isRequired};const gi=Lt;var Dt=h().memo(function(a){var r=a.isPlaying,c=a.onClick;return h().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:c,"aria-label":"Play or Pause Slideshow"},h().createElement(ft,{strokeWidth:2,icon:r?"pause":"play"}))});Dt.displayName="PlayPause",Dt.propTypes={isPlaying:y.bool.isRequired,onClick:y.func.isRequired};const bi=Dt;function et(a){return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},et(a)}function zt(){return zt=Object.assign?Object.assign.bind():function(a){for(var r=1;r<arguments.length;r++){var c=arguments[r];for(var u in c)Object.prototype.hasOwnProperty.call(c,u)&&(a[u]=c[u])}return a},zt.apply(this,arguments)}function Pn(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function Mn(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?Pn(Object(c),!0).forEach(function(u){vi(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):Pn(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function vi(a,r,c){return(r=function(u){var O=function(F,G){if(et(F)!=="object"||F===null)return F;var o=F[Symbol.toPrimitive];if(o!==void 0){var i=o.call(F,G);if(et(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(F)}(u,"string");return et(O)==="symbol"?O:String(O)}(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}var yi={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Ln=function(a){var r=Mn(Mn({},yi),a),c=r.children,u=r.className,O=si({delta:r.delta,onSwiping:r.onSwiping,onSwiped:r.onSwiped});return h().createElement("div",zt({},O,{className:u}),c)};Ln.propTypes={children:y.node.isRequired,className:y.string,delta:y.number,onSwiped:y.func,onSwiping:y.func};const Dn=Ln;function He(a){return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},He(a)}function zn(a,r){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);r&&(u=u.filter(function(O){return Object.getOwnPropertyDescriptor(a,O).enumerable})),c.push.apply(c,u)}return c}function Nn(a){for(var r=1;r<arguments.length;r++){var c=arguments[r]!=null?arguments[r]:{};r%2?zn(Object(c),!0).forEach(function(u){Fn(a,u,c[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):zn(Object(c)).forEach(function(u){Object.defineProperty(a,u,Object.getOwnPropertyDescriptor(c,u))})}return a}function xi(a,r){for(var c=0;c<r.length;c++){var u=r[c];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(a,Bn(u.key),u)}}function Nt(a,r){return Nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,u){return c.__proto__=u,c},Nt(a,r)}function wi(a,r){if(r&&(He(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oe(a)}function oe(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function mt(a){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},mt(a)}function Fn(a,r,c){return(r=Bn(r))in a?Object.defineProperty(a,r,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[r]=c,a}function Bn(a){var r=function(c,u){if(He(c)!=="object"||c===null)return c;var O=c[Symbol.toPrimitive];if(O!==void 0){var F=O.call(c,u);if(He(F)!=="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(c)}(a,"string");return He(r)==="symbol"?r:String(r)}var Wn=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],Si=(0,y.arrayOf)((0,y.shape)({srcSet:y.string,media:y.string}));function An(a){var r=parseInt(a.keyCode||a.which||0,10);return r===66||r===62}var Ft=function(a){(function(o,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(i&&i.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),i&&Nt(o,i)})(G,a);var r,c,u,O,F=(u=G,O=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 o,i=mt(u);if(O){var m=mt(this).constructor;o=Reflect.construct(i,arguments,m)}else o=i.apply(this,arguments);return wi(this,o)});function G(o){var i;return function(m,j){if(!(m instanceof j))throw new TypeError("Cannot call a class as a function")}(this,G),Fn(oe(i=F.call(this,o)),"onBulletClick",function(m,j){var E=i.props,T=E.onBulletClick,K=E.items,A=i.state.currentIndex;m.target.blur(),A!==j&&(K.length===2?i.slideToIndexWithStyleReset(j,m):i.slideToIndex(j,m)),T&&T(m,j)}),i.state={currentIndex:o.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(o.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},i.loadedImages={},i.imageGallery=h().createRef(),i.thumbnailsWrapper=h().createRef(),i.thumbnails=h().createRef(),i.imageGallerySlideWrapper=h().createRef(),i.handleImageLoaded=i.handleImageLoaded.bind(oe(i)),i.handleKeyDown=i.handleKeyDown.bind(oe(i)),i.handleMouseDown=i.handleMouseDown.bind(oe(i)),i.handleResize=i.handleResize.bind(oe(i)),i.handleTouchMove=i.handleTouchMove.bind(oe(i)),i.handleOnSwiped=i.handleOnSwiped.bind(oe(i)),i.handleScreenChange=i.handleScreenChange.bind(oe(i)),i.handleSwiping=i.handleSwiping.bind(oe(i)),i.handleThumbnailSwiping=i.handleThumbnailSwiping.bind(oe(i)),i.handleOnThumbnailSwiped=i.handleOnThumbnailSwiped.bind(oe(i)),i.onThumbnailMouseLeave=i.onThumbnailMouseLeave.bind(oe(i)),i.handleImageError=i.handleImageError.bind(oe(i)),i.pauseOrPlay=i.pauseOrPlay.bind(oe(i)),i.renderThumbInner=i.renderThumbInner.bind(oe(i)),i.renderItem=i.renderItem.bind(oe(i)),i.slideLeft=i.slideLeft.bind(oe(i)),i.slideRight=i.slideRight.bind(oe(i)),i.toggleFullScreen=i.toggleFullScreen.bind(oe(i)),i.togglePlay=i.togglePlay.bind(oe(i)),i.unthrottledSlideToIndex=i.slideToIndex,i.slideToIndex=fe(i.unthrottledSlideToIndex,o.slideDuration,{trailing:!1}),o.lazyLoad&&(i.lazyLoaded=[]),i}return r=G,c=[{key:"componentDidMount",value:function(){var o=this.props,i=o.autoPlay,m=o.useWindowKeyDown;i&&this.play(),m?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(o,i){var m=this.props,j=m.items,E=m.lazyLoad,T=m.slideDuration,K=m.slideInterval,A=m.startIndex,H=m.thumbnailPosition,L=m.showThumbnails,z=m.useWindowKeyDown,N=this.state,W=N.currentIndex,q=N.isPlaying,J=o.items.length!==j.length,ie=!Qr()(o.items,j),me=o.startIndex!==A,he=o.thumbnailPosition!==H,ue=o.showThumbnails!==L;K===o.slideInterval&&T===o.slideDuration||q&&(this.pause(),this.play()),he&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),ue&&L&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),ue&&!L&&this.removeThumbnailsResizeObserver(),(J||ue)&&this.handleResize(),i.currentIndex!==W&&this.slideThumbnailBar(),o.slideDuration!==T&&(this.slideToIndex=fe(this.unthrottledSlideToIndex,T,{trailing:!1})),!E||o.lazyLoad&&!ie||(this.lazyLoaded=[]),z!==o.useWindowKeyDown&&(z?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(me||ie)&&this.setState({currentIndex:A,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var o=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),o?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var o=this,i=this.state,m=i.currentIndex,j=i.isTransitioning,E=this.props,T=E.onSlide,K=E.slideDuration;this.transitionTimer=window.setTimeout(function(){j&&(o.setState({isTransitioning:!j,isSwipingThumbnail:!1}),T&&T(m))},K+50)}},{key:"onThumbnailClick",value:function(o,i){var m=this.props,j=m.onThumbnailClick,E=m.items,T=this.state.currentIndex;o.target.parentNode.parentNode.blur(),T!==i&&(E.length===2?this.slideToIndexWithStyleReset(i,o):this.slideToIndex(i,o)),j&&j(o,i)}},{key:"onThumbnailMouseOver",value:function(o,i){var m=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){m.slideToIndex(i),m.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var o=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,o&&this.play()}}},{key:"setThumbsTranslate",value:function(o){this.setState({thumbsTranslate:o})}},{key:"setModalFullscreen",value:function(o){var i=this.props.onScreenChange;this.setState({modalFullscreen:o}),i&&i(o)}},{key:"getThumbsTranslate",value:function(o){var i,m=this.props,j=m.disableThumbnailScroll,E=m.items,T=this.state,K=T.thumbnailsWrapperWidth,A=T.thumbnailsWrapperHeight,H=this.thumbnails&&this.thumbnails.current;if(j)return 0;if(H){if(this.isThumbnailVertical()){if(H.scrollHeight<=A)return 0;i=H.scrollHeight-A}else{if(H.scrollWidth<=K||K<=0)return 0;i=H.scrollWidth-K}return o*(i/(E.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(o){switch(o){case"left":o=" ".concat("image-gallery-thumbnails-left");break;case"right":o=" ".concat("image-gallery-thumbnails-right");break;case"bottom":o=" ".concat("image-gallery-thumbnails-bottom");break;case"top":o=" ".concat("image-gallery-thumbnails-top")}return o}},{key:"getAlignmentClassName",value:function(o){var i=this.state.currentIndex,m=this.props,j=m.infinite,E=m.items,T="",K="image-gallery-left",A="image-gallery-right";switch(o){case i-1:T=" ".concat(K);break;case i:T=" ".concat("image-gallery-center");break;case i+1:T=" ".concat(A)}return E.length>=3&&j&&(o===0&&i===E.length-1?T=" ".concat(A):o===E.length-1&&i===0&&(T=" ".concat(K))),T}},{key:"getTranslateXForTwoSlide",value:function(o){var i=this.state,m=i.currentIndex,j=i.currentSlideOffset,E=i.previousIndex,T=m!==E,K=o===0&&E===0,A=o===1&&E===1,H=o===0&&m===1,L=o===1&&m===0,z=j===0,N=-100*m+100*o+j;return j>0?this.direction="left":j<0&&(this.direction="right"),L&&j>0&&(N=-100+j),H&&j<0&&(N=100+j),T?K&&z&&this.direction==="left"?N=100:A&&z&&this.direction==="right"&&(N=-100):(L&&z&&this.direction==="left"&&(N=-100),H&&z&&this.direction==="right"&&(N=100)),N}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(o){var i=this.state,m=i.currentIndex,j=i.currentSlideOffset,E=i.slideStyle,T=this.props,K=T.infinite,A=T.items,H=T.useTranslate3D,L=T.isRTL,z=-100*m,N=A.length-1,W=(z+100*o)*(L?-1:1)+j;K&&A.length>2&&(m===0&&o===N?W=-100*(L?-1:1)+j:m===N&&o===0&&(W=100*(L?-1:1)+j)),K&&A.length===2&&(W=this.getTranslateXForTwoSlide(o));var q="translate(".concat(W,"%, 0)");return H&&(q="translate3d(".concat(W,"%, 0, 0)")),Nn({display:this.isSlideVisible(o)?"inherit":"none",WebkitTransform:q,MozTransform:q,msTransform:q,OTransform:q,transform:q},E)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var o,i=this.props,m=i.useTranslate3D,j=i.isRTL,E=this.state,T=E.thumbsTranslate,K=E.thumbsStyle,A=j?-1*T:T;return this.isThumbnailVertical()?(o="translate(0, ".concat(T,"px)"),m&&(o="translate3d(0, ".concat(T,"px, 0)"))):(o="translate(".concat(A,"px, 0)"),m&&(o="translate3d(".concat(A,"px, 0, 0)"))),Nn({WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,transform:o},K)}},{key:"getSlideItems",value:function(){var o=this,i=this.state.currentIndex,m=this.props,j=m.items,E=m.slideOnThumbnailOver,T=m.onClick,K=m.lazyLoad,A=m.onTouchMove,H=m.onTouchEnd,L=m.onTouchStart,z=m.onMouseOver,N=m.onMouseLeave,W=m.renderItem,q=m.renderThumbInner,J=m.showThumbnails,ie=m.showBullets,me=[],he=[],ue=[];return j.forEach(function(ne,Z){var Re=o.getAlignmentClassName(Z),tt=ne.originalClass?" ".concat(ne.originalClass):"",nt=ne.thumbnailClass?" ".concat(ne.thumbnailClass):"",Ce=ne.renderItem||W||o.renderItem,ze=ne.renderThumbInner||q||o.renderThumbInner,Oe=!K||Re||o.lazyLoaded[Z];Oe&&K&&!o.lazyLoaded[Z]&&(o.lazyLoaded[Z]=!0);var qe=o.getSlideStyle(Z),rt=h().createElement("div",{"aria-label":"Go to Slide ".concat(Z+1),key:"slide-".concat(Z),tabIndex:"-1",className:"image-gallery-slide ".concat(Re," ").concat(tt),style:qe,onClick:T,onKeyUp:o.handleSlideKeyUp,onTouchMove:A,onTouchEnd:H,onTouchStart:L,onMouseOver:z,onFocus:z,onMouseLeave:N,role:"button"},Oe?Ce(ne):h().createElement("div",{style:{height:"100%"}}));if(me.push(rt),J&&ne.thumbnail){var Ve=v("image-gallery-thumbnail",nt,{active:i===Z});he.push(h().createElement("button",{key:"thumbnail-".concat(Z),type:"button",tabIndex:"0","aria-pressed":i===Z?"true":"false","aria-label":"Go to Slide ".concat(Z+1),className:Ve,onMouseLeave:E?o.onThumbnailMouseLeave:null,onMouseOver:function(ge){return o.handleThumbnailMouseOver(ge,Z)},onFocus:function(ge){return o.handleThumbnailMouseOver(ge,Z)},onKeyUp:function(ge){return o.handleThumbnailKeyUp(ge,Z)},onClick:function(ge){return o.onThumbnailClick(ge,Z)}},ze(ne)))}if(ie){var it=v("image-gallery-bullet",ne.bulletClass,{active:i===Z});ue.push(h().createElement("button",{type:"button",key:"bullet-".concat(Z),className:it,onClick:function(ge){return o.onBulletClick(ge,Z)},"aria-pressed":i===Z?"true":"false","aria-label":"Go to Slide ".concat(Z+1)}))}}),{slides:me,thumbnails:he,bullets:ue}}},{key:"ignoreIsTransitioning",value:function(){var o=this.props.items,i=this.state,m=i.previousIndex,j=i.currentIndex,E=o.length-1;return Math.abs(m-j)>1&&!(m===0&&j===E)&&!(m===E&&j===0)}},{key:"isFirstOrLastSlide",value:function(o){return o===this.props.items.length-1||o===0}},{key:"slideIsTransitioning",value:function(o){var i=this.state,m=i.isTransitioning,j=i.previousIndex,E=i.currentIndex;return m&&!(o===j||o===E)}},{key:"isSlideVisible",value:function(o){return!this.slideIsTransitioning(o)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(o)}},{key:"slideThumbnailBar",value:function(){var o=this.state,i=o.currentIndex,m=o.isSwipingThumbnail,j=-this.getThumbsTranslate(i);m||(i===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:j,thumbsSwipedTranslate:j}))}},{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(o){var i=o.event,m=o.absX,j=o.dir,E=this.props,T=E.disableSwipe,K=E.stopPropagation,A=this.state,H=A.galleryWidth,L=A.isTransitioning,z=A.swipingUpDown,N=A.swipingLeftRight;if(j!==Ke&&j!==De&&!z||N){if(j!==$e&&j!==Le||N||this.setState({swipingLeftRight:!0}),!T){var W=this.props.swipingTransitionDuration;if(K&&i.preventDefault(),L)this.setState({currentSlideOffset:0});else{var q=j===Le?1:-1,J=m/H*100;Math.abs(J)>=100&&(J=100);var ie={transition:"transform ".concat(W,"ms ease-out")};this.setState({currentSlideOffset:q*J,slideStyle:ie})}}}else z||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(o){var i=o.event,m=o.absX,j=o.absY,E=o.dir,T=this.props,K=T.stopPropagation,A=T.swipingThumbnailTransitionDuration,H=this.state,L=H.thumbsSwipedTranslate,z=H.thumbnailsWrapperHeight,N=H.thumbnailsWrapperWidth,W=H.swipingUpDown,q=H.swipingLeftRight;if(this.isThumbnailVertical()){if((E===$e||E===Le||q)&&!W)return void(q||this.setState({swipingLeftRight:!0}));E!==Ke&&E!==De||W||this.setState({swipingUpDown:!0})}else{if((E===Ke||E===De||W)&&!q)return void(W||this.setState({swipingUpDown:!0}));E!==$e&&E!==Le||q||this.setState({swipingLeftRight:!0})}var J,ie,me,he,ue,ne=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(J=L+(E===De?j:-j),ie=ne.scrollHeight-z+20,me=Math.abs(J)>ie,he=J>20,ue=ne.scrollHeight<=z):(J=L+(E===Le?m:-m),ie=ne.scrollWidth-N+20,me=Math.abs(J)>ie,he=J>20,ue=ne.scrollWidth<=N),!ue&&(E!==$e&&E!==Ke||!me)&&(E!==Le&&E!==De||!he)){K&&i.stopPropagation();var Z={transition:"transform ".concat(A,"ms ease-out")};this.setState({thumbsTranslate:J,thumbsStyle:Z})}}},{key:"handleOnThumbnailSwiped",value:function(){var o=this.state.thumbsTranslate,i=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:o,thumbsStyle:{transition:"all ".concat(i,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var o=this.state.currentSlideOffset,i=this.props.swipeThreshold;return Math.abs(o)>i}},{key:"resetSwipingDirection",value:function(){var o=this.state,i=o.swipingUpDown,m=o.swipingLeftRight;i&&this.setState({swipingUpDown:!1}),m&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(o){var i=o.event,m=o.dir,j=o.velocity,E=this.props,T=E.disableSwipe,K=E.stopPropagation,A=E.flickThreshold;if(!T){var H=this.props.isRTL;K&&i.stopPropagation(),this.resetSwipingDirection();var L=(m===$e?1:-1)*(H?-1:1),z=j>A&&!(m===Ke||m===De);this.handleOnSwipedTo(L,z)}}},{key:"handleOnSwipedTo",value:function(o,i){var m=this.state,j=m.currentIndex,E=m.isTransitioning,T=j;!this.sufficientSwipe()&&!i||E||(T+=o),(o===-1&&!this.canSlideLeft()||o===1&&!this.canSlideRight())&&(T=j),this.unthrottledSlideToIndex(T)}},{key:"handleTouchMove",value:function(o){this.state.swipingLeftRight&&o.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(o){var i=this.props,m=i.disableKeyDown,j=i.useBrowserFullscreen,E=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!m)switch(parseInt(o.keyCode||o.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(o);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(o);break;case 27:E&&!j&&this.exitFullScreen()}}},{key:"handleImageError",value:function(o){var i=this.props.onErrorImageURL;i&&o.target.src.indexOf(i)===-1&&(o.target.src=i)}},{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 o=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(o)))}},{key:"initSlideWrapperResizeObserver",value:function(o){var i=this;o&&!o.current||(this.resizeSlideWrapperObserver=new kn(re(function(m){m&&m.forEach(function(j){i.setState({thumbnailsWrapperWidth:j.contentRect.width},i.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(o.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(o){var i=this;o&&!o.current||(this.resizeThumbnailWrapperObserver=new kn(re(function(m){m&&m.forEach(function(j){i.setState({thumbnailsWrapperHeight:j.contentRect.height},i.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(o.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 o=this.props,i=o.onScreenChange,m=o.useBrowserFullscreen,j=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,E=this.imageGallery.current===j;i&&i(E),m&&this.setState({isFullscreen:E})}},{key:"slideToIndex",value:function(o,i){var m=this.state,j=m.currentIndex,E=m.isTransitioning,T=this.props,K=T.items,A=T.slideDuration,H=T.onBeforeSlide;if(!E){i&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var L=K.length-1,z=o;o<0?z=L:o>L&&(z=0),H&&z!==j&&H(z),this.setState({previousIndex:j,currentIndex:z,isTransitioning:z!==j,currentSlideOffset:0,slideStyle:{transition:"all ".concat(A,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(o){var i=this.props.isRTL;this.slideTo(o,i?"right":"left")}},{key:"slideRight",value:function(o){var i=this.props.isRTL;this.slideTo(o,i?"left":"right")}},{key:"slideTo",value:function(o,i){var m=this.state,j=m.currentIndex,E=m.isTransitioning,T=this.props.items,K=j+(i==="left"?-1:1);E||(T.length===2?this.slideToIndexWithStyleReset(K,o):this.slideToIndex(K,o))}},{key:"slideToIndexWithStyleReset",value:function(o,i){var m=this,j=this.state,E=j.currentIndex,T=j.currentSlideOffset;this.setState({currentSlideOffset:T+(E>o?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return m.slideToIndex(o,i)},25)})}},{key:"handleThumbnailMouseOver",value:function(o,i){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(o,i)}},{key:"handleThumbnailKeyUp",value:function(o,i){An(o)&&this.onThumbnailClick(o,i)}},{key:"handleSlideKeyUp",value:function(o){An(o)&&(0,this.props.onClick)(o)}},{key:"isThumbnailVertical",value:function(){var o=this.props.thumbnailPosition;return o==="left"||o==="right"}},{key:"addScreenChangeEvent",value:function(){var o=this;Wn.forEach(function(i){document.addEventListener(i,o.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var o=this;Wn.forEach(function(i){document.removeEventListener(i,o.handleScreenChange)})}},{key:"fullScreen",value:function(){var o=this.props.useBrowserFullscreen,i=this.imageGallery.current;o?i.requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var o=this.state.isFullscreen,i=this.props.useBrowserFullscreen;o&&(i?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 o=this.props.infinite,i=this.state.currentIndex;o||this.canSlideRight()?this.slideToIndex(i+1):this.pause()}},{key:"play",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],i=this.props,m=i.onPlay,j=i.slideInterval,E=i.slideDuration,T=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(j,E)),m&&o&&m(T))}},{key:"pause",value:function(){var o=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],i=this.props.onPause,m=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),i&&o&&i(m))}},{key:"isImageLoaded",value:function(o){return!!this.loadedImages[o.original]||(this.loadedImages[o.original]=!0,!1)}},{key:"handleImageLoaded",value:function(o,i){var m=this.props.onImageLoad;!this.loadedImages[i]&&m&&(this.loadedImages[i]=!0,m(o))}},{key:"renderItem",value:function(o){var i=this.state.isFullscreen,m=this.props.onImageError||this.handleImageError;return h().createElement(ui,{description:o.description,fullscreen:o.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:i,onImageError:m,original:o.original,originalAlt:o.originalAlt,originalHeight:o.originalHeight,originalWidth:o.originalWidth,originalTitle:o.originalTitle,sizes:o.sizes,loading:o.loading,srcSet:o.srcSet})}},{key:"renderThumbInner",value:function(o){var i=this.props.onThumbnailError||this.handleImageError;return h().createElement("span",{className:"image-gallery-thumbnail-inner"},h().createElement("img",{className:"image-gallery-thumbnail-image",src:o.thumbnail,height:o.thumbnailHeight,width:o.thumbnailWidth,alt:o.thumbnailAlt,title:o.thumbnailTitle,loading:o.thumbnailLoading,onError:i}),o.thumbnailLabel&&h().createElement("div",{className:"image-gallery-thumbnail-label"},o.thumbnailLabel))}},{key:"render",value:function(){var o=this.state,i=o.currentIndex,m=o.isFullscreen,j=o.modalFullscreen,E=o.isPlaying,T=this.props,K=T.additionalClass,A=T.disableThumbnailSwipe,H=T.indexSeparator,L=T.isRTL,z=T.items,N=T.thumbnailPosition,W=T.renderFullscreenButton,q=T.renderCustomControls,J=T.renderLeftNav,ie=T.renderRightNav,me=T.showBullets,he=T.showFullscreenButton,ue=T.showIndex,ne=T.showThumbnails,Z=T.showNav,Re=T.showPlayButton,tt=T.renderPlayPauseButton,nt=this.getThumbnailStyle(),Ce=this.getSlideItems(),ze=Ce.slides,Oe=Ce.thumbnails,qe=Ce.bullets,rt=v("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(N),{"image-gallery-rtl":L}),Ve=h().createElement("div",{ref:this.imageGallerySlideWrapper,className:rt},q&&q(),this.canSlide()?h().createElement(h().Fragment,null,Z&&h().createElement(h().Fragment,null,J(this.slideLeft,!this.canSlideLeft()),ie(this.slideRight,!this.canSlideRight())),h().createElement(Dn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},h().createElement("div",{className:"image-gallery-slides"},ze))):h().createElement("div",{className:"image-gallery-slides"},ze),Re&&tt(this.togglePlay,E),me&&h().createElement("div",{className:"image-gallery-bullets"},h().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},qe)),he&&W(this.toggleFullScreen,m),ue&&h().createElement("div",{className:"image-gallery-index"},h().createElement("span",{className:"image-gallery-index-current"},i+1),h().createElement("span",{className:"image-gallery-index-separator"},H),h().createElement("span",{className:"image-gallery-index-total"},z.length))),it=v("image-gallery",K,{"fullscreen-modal":j}),ge=v("image-gallery-content",this.getThumbnailPositionClassName(N),{fullscreen:m}),ji=v("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(N),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&L},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!A},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!A});return h().createElement("div",{ref:this.imageGallery,className:it,"aria-live":"polite"},h().createElement("div",{className:ge},(N==="bottom"||N==="right")&&Ve,ne&&Oe.length>0?h().createElement(Dn,{className:ji,delta:0,onSwiping:!A&&this.handleThumbnailSwiping,onSwiped:!A&&this.handleOnThumbnailSwiped},h().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},h().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:nt,"aria-label":"Thumbnail Navigation"},Oe))):null,(N==="top"||N==="left")&&Ve))}}],c&&xi(r.prototype,c),Object.defineProperty(r,"prototype",{writable:!1}),G}(h().Component);Ft.propTypes={flickThreshold:y.number,items:(0,y.arrayOf)((0,y.shape)({bulletClass:y.string,bulletOnClick:y.func,description:y.string,original:y.string,originalHeight:y.number,originalWidth:y.number,loading:y.string,thumbnailHeight:y.number,thumbnailWidth:y.number,thumbnailLoading:y.string,fullscreen:y.string,originalAlt:y.string,originalTitle:y.string,thumbnail:y.string,thumbnailAlt:y.string,thumbnailLabel:y.string,thumbnailTitle:y.string,originalClass:y.string,thumbnailClass:y.string,renderItem:y.func,renderThumbInner:y.func,imageSet:Si,srcSet:y.string,sizes:y.string})).isRequired,showNav:y.bool,autoPlay:y.bool,lazyLoad:y.bool,infinite:y.bool,showIndex:y.bool,showBullets:y.bool,showThumbnails:y.bool,showPlayButton:y.bool,showFullscreenButton:y.bool,disableThumbnailScroll:y.bool,disableKeyDown:y.bool,disableSwipe:y.bool,disableThumbnailSwipe:y.bool,useBrowserFullscreen:y.bool,onErrorImageURL:y.string,indexSeparator:y.string,thumbnailPosition:(0,y.oneOf)(["top","bottom","left","right"]),startIndex:y.number,slideDuration:y.number,slideInterval:y.number,slideOnThumbnailOver:y.bool,swipeThreshold:y.number,swipingTransitionDuration:y.number,swipingThumbnailTransitionDuration:y.number,onSlide:y.func,onBeforeSlide:y.func,onScreenChange:y.func,onPause:y.func,onPlay:y.func,onClick:y.func,onImageLoad:y.func,onImageError:y.func,onTouchMove:y.func,onTouchEnd:y.func,onTouchStart:y.func,onMouseOver:y.func,onMouseLeave:y.func,onBulletClick:y.func,onThumbnailError:y.func,onThumbnailClick:y.func,renderCustomControls:y.func,renderLeftNav:y.func,renderRightNav:y.func,renderPlayPauseButton:y.func,renderFullscreenButton:y.func,renderItem:y.func,renderThumbInner:y.func,stopPropagation:y.bool,additionalClass:y.string,useTranslate3D:y.bool,isRTL:y.bool,useWindowKeyDown:y.bool},Ft.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(a,r){return h().createElement(mi,{onClick:a,disabled:r})},renderRightNav:function(a,r){return h().createElement(gi,{onClick:a,disabled:r})},renderPlayPauseButton:function(a,r){return h().createElement(bi,{onClick:a,isPlaying:r})},renderFullscreenButton:function(a,r){return h().createElement(fi,{onClick:a,isFullscreen:r})},useWindowKeyDown:!0};const ki=Ft})(),g})())})(kr);var Ao=kr.exports;const $o=sr(Ao);function Ko(){var e=new Map;function n(s){var l=s.root,p=s.rootMargin,f=s.threshold,g=e.get(l);g||(g=new Map,e.set(l,g));var d=JSON.stringify({rootMargin:p,threshold:f}),v=g.get(d);if(!v){var b=new Map,h=new IntersectionObserver(function(S){S.forEach(function(k){var x=b.get(k.target);x==null||x(k)})},{root:l,rootMargin:p,threshold:f});v={observer:h,entryCallbacks:b},g.set(d,v)}return{observe:function(k,x){var w,_;(w=v)==null||w.entryCallbacks.set(k,x),(_=v)==null||_.observer.observe(k)},unobserve:function(k){var x,w;(x=v)==null||x.entryCallbacks.delete(k),(w=v)==null||w.observer.unobserve(k)}}}return{getObserver:n}}var Uo="0px",Ho=[0],qo=Ko();function Vo(e){var n,s,l=(n=e==null?void 0:e.rootMargin)!=null?n:Uo,p=(s=e==null?void 0:e.threshold)!=null?s:Ho,f=D.useRef(null),g=D.useRef(null),d=D.useRef(null),v=D.useState(),b=v[0],h=v[1],S=D.useCallback(function(){var _=f.current;if(!_){h(void 0);return}var I=qo.getObserver({root:g.current,rootMargin:l,threshold:p});I.observe(_,function(C){h(C)}),d.current=I},[l,p]),k=D.useCallback(function(){var _=d.current,I=f.current;I&&(_==null||_.unobserve(I)),d.current=null},[]),x=D.useCallback(function(_){k(),f.current=_,S()},[S,k]),w=D.useCallback(function(_){k(),g.current=_,S()},[S,k]);return[x,{entry:b,rootRef:w}]}function Qt(){return Qt=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e},Qt.apply(this,arguments)}function Go(e){var n,s=Vo(e),l=s[0],p=s[1],f=!!((n=p.entry)!=null&&n.isIntersecting),g=D.useState(f),d=g[0],v=g[1];return f&&!d&&v(!0),[l,Qt({},p,{isVisible:f,wasEverVisible:d})]}var Xo=100;function Yo(e){var n=e.loading,s=e.hasNextPage,l=e.onLoadMore,p=e.rootMargin,f=e.disabled,g=e.delayInMs,d=g===void 0?Xo:g,v=Go({rootMargin:p}),b=v[0],h=v[1],S=h.rootRef,k=h.isVisible,x=!f&&!n&&k&&s;return D.useEffect(function(){if(x){var w=setTimeout(function(){l()},d);return function(){clearTimeout(w)}}},[l,x,d]),[b,{rootRef:S}]}var Wt=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function At(e,n,s,l){e.addEventListener?e.addEventListener(n,s,l):e.attachEvent&&e.attachEvent("on".concat(n),function(){s(window.event)})}function jr(e,n){for(var s=n.slice(0,n.length-1),l=0;l<s.length;l++)s[l]=e[s[l].toLowerCase()];return s}function Tr(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var n=e.split(","),s=n.lastIndexOf("");s>=0;)n[s-1]+=",",n.splice(s,1),s=n.lastIndexOf("");return n}function Qo(e,n){for(var s=e.length>=n.length?e:n,l=e.length>=n.length?n:e,p=!0,f=0;f<s.length;f++)l.indexOf(s[f])===-1&&(p=!1);return p}var sn={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,"-":Wt?173:189,"=":Wt?61:187,";":Wt?59:186,"'":222,"[":219,"]":221,"\\":220},Me={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Jt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},de={16:!1,18:!1,17:!1,91:!1},se={};for(var vt=1;vt<20;vt++)sn["f".concat(vt)]=111+vt;var te=[],Jn=!1,Or="all",Er=[],Et=function(n){return sn[n.toLowerCase()]||Me[n.toLowerCase()]||n.toUpperCase().charCodeAt(0)};function _r(e){Or=e||"all"}function ct(){return Or||"all"}function Jo(){return te.slice(0)}function Zo(e){var n=e.target||e.srcElement,s=n.tagName,l=!0;return(n.isContentEditable||(s==="INPUT"||s==="TEXTAREA"||s==="SELECT")&&!n.readOnly)&&(l=!1),l}function ea(e){return typeof e=="string"&&(e=Et(e)),te.indexOf(e)!==-1}function ta(e,n){var s,l;e||(e=ct());for(var p in se)if(Object.prototype.hasOwnProperty.call(se,p))for(s=se[p],l=0;l<s.length;)s[l].scope===e?s.splice(l,1):l++;ct()===e&&_r(n||"all")}function na(e){var n=e.keyCode||e.which||e.charCode,s=te.indexOf(n);if(s>=0&&te.splice(s,1),e.key&&e.key.toLowerCase()==="meta"&&te.splice(0,te.length),(n===93||n===224)&&(n=91),n in de){de[n]=!1;for(var l in Me)Me[l]===n&&(be[l]=!1)}}function ra(e){if(typeof e>"u")Object.keys(se).forEach(function(g){return delete se[g]});else if(Array.isArray(e))e.forEach(function(g){g.key&&$t(g)});else if(typeof e=="object")e.key&&$t(e);else if(typeof e=="string"){for(var n=arguments.length,s=new Array(n>1?n-1:0),l=1;l<n;l++)s[l-1]=arguments[l];var p=s[0],f=s[1];typeof p=="function"&&(f=p,p=""),$t({key:e,scope:p,method:f,splitKey:"+"})}}var $t=function(n){var s=n.key,l=n.scope,p=n.method,f=n.splitKey,g=f===void 0?"+":f,d=Tr(s);d.forEach(function(v){var b=v.split(g),h=b.length,S=b[h-1],k=S==="*"?"*":Et(S);if(se[k]){l||(l=ct());var x=h>1?jr(Me,b):[];se[k]=se[k].filter(function(w){var _=p?w.method===p:!0;return!(_&&w.scope===l&&Qo(w.mods,x))})}})};function Zn(e,n,s,l){if(n.element===l){var p;if(n.scope===s||n.scope==="all"){p=n.mods.length>0;for(var f in de)Object.prototype.hasOwnProperty.call(de,f)&&(!de[f]&&n.mods.indexOf(+f)>-1||de[f]&&n.mods.indexOf(+f)===-1)&&(p=!1);(n.mods.length===0&&!de[16]&&!de[18]&&!de[17]&&!de[91]||p||n.shortcut==="*")&&n.method(e,n)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function er(e,n){var s=se["*"],l=e.keyCode||e.which||e.charCode;if(be.filter.call(this,e)){if((l===93||l===224)&&(l=91),te.indexOf(l)===-1&&l!==229&&te.push(l),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(w){var _=Jt[w];e[w]&&te.indexOf(_)===-1?te.push(_):!e[w]&&te.indexOf(_)>-1?te.splice(te.indexOf(_),1):w==="metaKey"&&e[w]&&te.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(te=te.slice(te.indexOf(_))))}),l in de){de[l]=!0;for(var p in Me)Me[p]===l&&(be[p]=!0);if(!s)return}for(var f in de)Object.prototype.hasOwnProperty.call(de,f)&&(de[f]=e[Jt[f]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(te.indexOf(17)===-1&&te.push(17),te.indexOf(18)===-1&&te.push(18),de[17]=!0,de[18]=!0);var g=ct();if(s)for(var d=0;d<s.length;d++)s[d].scope===g&&(e.type==="keydown"&&s[d].keydown||e.type==="keyup"&&s[d].keyup)&&Zn(e,s[d],g,n);if(l in se){for(var v=0;v<se[l].length;v++)if((e.type==="keydown"&&se[l][v].keydown||e.type==="keyup"&&se[l][v].keyup)&&se[l][v].key){for(var b=se[l][v],h=b.splitKey,S=b.key.split(h),k=[],x=0;x<S.length;x++)k.push(Et(S[x]));k.sort().join("")===te.sort().join("")&&Zn(e,b,g,n)}}}}function ia(e){return Er.indexOf(e)>-1}function be(e,n,s){te=[];var l=Tr(e),p=[],f="all",g=document,d=0,v=!1,b=!0,h="+",S=!1;for(s===void 0&&typeof n=="function"&&(s=n),Object.prototype.toString.call(n)==="[object Object]"&&(n.scope&&(f=n.scope),n.element&&(g=n.element),n.keyup&&(v=n.keyup),n.keydown!==void 0&&(b=n.keydown),n.capture!==void 0&&(S=n.capture),typeof n.splitKey=="string"&&(h=n.splitKey)),typeof n=="string"&&(f=n);d<l.length;d++)e=l[d].split(h),p=[],e.length>1&&(p=jr(Me,e)),e=e[e.length-1],e=e==="*"?"*":Et(e),e in se||(se[e]=[]),se[e].push({keyup:v,keydown:b,scope:f,mods:p,shortcut:l[d],method:s,key:l[d],splitKey:h,element:g});typeof g<"u"&&!ia(g)&&window&&(Er.push(g),At(g,"keydown",function(k){er(k,g)},S),Jn||(Jn=!0,At(window,"focus",function(){te=[]},S)),At(g,"keyup",function(k){er(k,g),na(k)},S))}function oa(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(se).forEach(function(s){var l=se[s].find(function(p){return p.scope===n&&p.shortcut===e});l&&l.method&&l.method()})}var Kt={setScope:_r,getScope:ct,deleteScope:ta,getPressedKeyCodes:Jo,isPressed:ea,filter:Zo,trigger:oa,unbind:ra,keyMap:sn,modifier:Me,modifierMap:Jt};for(var Ut in Kt)Object.prototype.hasOwnProperty.call(Kt,Ut)&&(be[Ut]=Kt[Ut]);if(typeof window<"u"){var aa=window.hotkeys;be.noConflict=function(e){return e&&window.hotkeys===be&&(window.hotkeys=aa),be},window.hotkeys=be}be.filter=function(){return!0};var Cr=function(n,s){var l=n.target,p=l&&l.tagName;return!!(p&&s&&s.includes(p))},sa=function(n){return Cr(n,["INPUT","TEXTAREA","SELECT"])};function la(e,n,s,l){s instanceof Array&&(l=s,s=void 0);var p=s||{},f=p.enableOnTags,g=p.filter,d=p.keyup,v=p.keydown,b=p.filterPreventDefault,h=b===void 0?!0:b,S=p.enabled,k=S===void 0?!0:S,x=p.enableOnContentEditable,w=x===void 0?!1:x,_=D.useRef(null),I=D.useCallback(function(C,B){var M,$;return g&&!g(C)?!h:sa(C)&&!Cr(C,f)||(M=C.target)!=null&&M.isContentEditable&&!w?!0:_.current===null||document.activeElement===_.current||($=_.current)!=null&&$.contains(document.activeElement)?(n(C,B),!0):!1},l?[_,f,g].concat(l):[_,f,g]);return D.useEffect(function(){if(!k){be.unbind(e,I);return}return d&&v!==!0&&(s.keydown=!1),be(e,s||{},I),function(){return be.unbind(e,I)}},[I,e,k]),_}be.isPressed;const Rr=D.createContext({open:!1,toggleOpen:e=>{}});function ca({children:e}){const[n,s]=D.useState(!1),l=f=>{s(f??!f)},p=D.useMemo(()=>({open:n,toggleOpen:l}),[n]);return t.jsx(Rr.Provider,{value:p,children:e})}function ln(){return D.useContext(Rr)}const we={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},ua=e=>ut(async()=>{const{data:n}=await e.get(we.categoriesPath);return Array.isArray(n)?n:[]},{manual:!0});function da(e,n){const s={sortBy:"popularity",sortDirection:"desc",...e},{onFilterChange:l,onSearchSelect:p=d=>{n.onFilterChange({...s,keyword:d.title})},emptyCategory:f}=n;!s.category&&!f&&(s.category="All");const g=d=>{const v={...s,...d};l(Bt(v,b=>b===""||b===void 0))};return{filters:e,cleanFilter:d=>{const v=d?Bt(s,(b,h)=>d.includes(h)):{};l(Bt(v,b=>b===""||b===void 0))},handleSort:(d,v)=>{g({sortBy:d,sortDirection:v||d==="nameAsc"?"asc":"desc"})},handleKeyword:d=>{g({category:void 0,keyword:d||void 0})},handlePrice:d=>{g({price:d===e.price?void 0:d})},handleCategory:d=>{g({category:d===e.category?"":d})},handleDeveloper:d=>{g({owner:d||void 0})},handlePage:d=>{g({currentPage:d})},handleSwitchShowResources:d=>{g({showResources:d})},handleSearchSelect:d=>{p(d)}}}const ha=(e,n,s)=>e&&n||!s,Ir=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],Pr=(e,n,s)=>{var l,p;const f=Wi(e),g=Ai(f.search);if((l=$i(e,{strict:!0}))!=null&&l.endsWith(".gif"))return g.imageFilter?Ki({...f,search:""}):e;if(g.imageFilter)return e;const d=s||((p=window.blocklet)==null?void 0:p.version),{w:v,h:b}=typeof n=="object"?{w:n.w,h:n.h}:{w:n,h:n};return nn(e,{...v||b?{imageFilter:"resize",w:v,h:b}:{},v:d})},pa=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],fa=(e=[],n="en")=>e.map(s=>({name:s.locales[n]||s.locales.en,value:s._id})),ma=(e,n)=>e==null?void 0:e.replace(/{(\w*)}/g,(s,l)=>n.hasOwnProperty(l)?n[l]:""),ga=()=>window.innerWidth<=600,ba={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show resources",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},va={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示资源型应用",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Ht={en:Un(ba),zh:Un(va)},Mr=(e,n)=>{const s={};return e&&(s["x-blocklet-server-version"]=e),n&&(s["x-blocklet-store-version"]=n),s},ya=e=>(n,s)=>{const l=Ht[e]?Ht[e][n]:Ht.en[n];return ma(l,s)||n},Lr={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},Dr=D.createContext(Lr),{Provider:xa,Consumer:Fs}=Dr;function wa(e){const{locale:n="zh",filters:s={},serverVersion:l="",onFilterChange:p=()=>{},minItemWidth:f=350,queryFilter:g=!0,layout:d={},wrapChildren:v=re=>re,extraFilter:b=re=>re,baseSearch:h=!1,fetchCategoryDelay:S=0,showResourcesSwitch:k=!1,showCategory:x=!0,tagFilters:w=[],children:_,storeVersion:I,onSearchSelect:C=()=>{},endpoint:B,blockletRender:M}=e,$=Mr(l,I),Q=D.useMemo(()=>lr({baseURL:B,headers:$}),[B]),ee=da(s,{onFilterChange:p,emptyCategory:!d.showExplore,onSearchSelect:C}),[U,le]=D.useState(""),{data:ve=[],error:ke,loading:je,run:Te}=ua(Q),ae=D.useMemo(()=>{const re=zo(ve,[_e=>_e.name],["asc"]),fe=re.findIndex(_e=>_e.name==="All"||_e.locales.en==="All");return fe>-1?[{...re[fe],_id:"All"},...re.slice(0,fe),...re.slice(fe+1)]:re},[ve]),ye=D.useCallback(ya(n),[n]),R=D.useMemo(()=>fa(ae,n),[ae,n]),V=pa(ye),ce={search:ee,errors:{fetchCategoriesError:ke},loadings:{fetchCategoriesLoading:je},extraFilter:b,endpoint:B,queryFilter:g,layout:{showExplore:d.showExplore??!1,showCategory:d.showCategory??!0,showTitle:d.showTitle??!0,showSearch:d.showSearch??!0},minItemWidth:f,wrapChildren:v,t:ye,storeVersion:I,serverVersion:l,selectedCategory:ee.filters.category||(d.showExplore?"":"All"),categoryList:ae,blockletRender:M,locale:n,categoryOptions:R,priceOptions:V,storeApi:Q,baseSearch:h,showResourcesSwitch:k,showCategory:x,tagFilters:w,onFilterChange:p,getCategoryLocale:re=>{if(!re)return null;const fe=ve.find(_e=>_e._id===re||_e.locales.en==="All");return fe?fe.locales[n]||fe.locales.en:null},get developerName(){return U},updateDeveloperName:le};return D.useEffect(()=>{setTimeout(Te,S||0)},[B,Te,S]),t.jsx(xa,{value:ce,children:_})}function pe(){return D.useContext(Dr)||Lr}function zr({children:e,onClick:n,size:s=32,...l}){return t.jsx(xe,{...l,onClick:n,variant:"outlined",sx:[{minWidth:s,height:s,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(l.sx)?l.sx:[l.sx]],children:e})}function yt(e,n){return e===void 0?n:e}function cn({xs:e,sm:n,md:s,lg:l,xl:p,exact:f}){const g=Qe(),d=Fe(g.breakpoints.down("sm")),v=Fe(g.breakpoints.between("sm","md")),b=Fe(g.breakpoints.between("md","lg")),h=Fe(g.breakpoints.between("lg","xl"));if(f)return d?e||null:v?n||null:b?s||null:h?l||null:p||null;let S=e;return d||(S=yt(n,S),v)||(S=yt(s,S),b)||(S=yt(l,S),h)?S:yt(p,S)}function Sa({children:e}){const{open:n,toggleOpen:s}=ln();return t.jsx(cn,{xs:t.jsx(Fi,{open:n,onClose:()=>s(!1),children:e}),md:t.jsx(Y,{children:e})})}const ka=D.forwardRef(({loading:e,disabled:n,...s},l)=>t.jsx(xe,{ref:l,disableElevation:!0,disabled:n||e,...s,sx:[{borderRadius:"4px"},...Array.isArray(s.sx)?s.sx:[s.sx]],startIcon:e&&t.jsx(Ee,{size:"1em"})}));function Nr({value:e,options:n,onChange:s,placeholder:l,...p}){var f;const g=D.useRef(null),d=Qe(),[v,b]=D.useState(!1),[h,S]=D.useState(e!==null?e:""),k=Fe(d.breakpoints.down("sm"));D.useEffect(()=>{S(e!==null?e:"")},[e]);const x=D.useCallback(()=>{b(!1)},[]),w=D.useCallback(()=>{b(!0)},[]);function _(C){S(C.value),s(C.value),k&&x()}function I(C){return C===h}return t.jsxs(t.Fragment,{children:[t.jsxs(ja,{ref:g,onClick:w,variant:"outlined",size:"small",className:["my-select__selector",Ui(h)?"":"my-select__selector--active"].join(" "),sx:{minWidth:"auto",color:"text.primary"},...p,children:[((f=n.find(C=>C.value===h))==null?void 0:f.name)||l,t.jsx(Hi,{className:"my-select__arrowdown",component:Sr,fontSize:"small"})]}),t.jsx(qi,{open:v,anchorEl:g.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:C,placement:B})=>t.jsx(Vi,{...C,style:{transformOrigin:B==="bottom"?"center top":"center bottom"},children:t.jsx(Gi,{children:t.jsx(Xi,{onClickAway:x,children:t.jsx(Ta,{autoFocusItem:v,onMouseEnter:w,onMouseLeave:x,children:n.map(M=>t.jsxs(St,{onClick:()=>_(M),children:[t.jsx(Yi,{sx:{mr:1,fontSize:16,visibility:I(M.value)?"visible":"hidden"}}),M.name]},M.value))})})})})})]})}const ja=Be(ka)`
|
|
2
2
|
border: 1px solid #f0f0f0;
|
|
3
3
|
padding: 6px 8px 6px 12px;
|
|
4
4
|
font-weight: ${e=>e.theme.typography.fontWeightRegular};
|
|
@@ -42,7 +42,7 @@ import{cl as Ge,r as L,ci as ut,bb as Ti,bc as Oi,bk as gt,f5 as bt,cj as st,f6
|
|
|
42
42
|
color: ${e=>e.theme.palette.primary.main};
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
`;function Fr(){const{search:e,t:n}=pe(),{filters:s,handleSort:l,handlePrice:p}=e,f=Ir(n);return t.jsxs(Se,{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:[t.jsx(dr,{control:t.jsx(hr,{checked:s.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:g=>p(g.target.checked?"free":"")}),label:n("blocklet.free")}),t.jsx(Nr,{value:s.sortBy||f[0].value,options:f,onChange:g=>l(g),placeholder:n("sort.sort")})]})}function Oa(){const{selectedCategory:e,search:n,t:s,categoryOptions:l,loadings:p,layout:f,baseSearch:g}=pe(),{filters:d,handleCategory:v,cleanFilter:b}=n,{toggleOpen:h}=ln();L.useEffect(()=>{h(!1)},[Object.values(d).join("")]);const S=ha(g,f.showSearch,d.keyword);return f.showCategory?t.jsxs(Sa,{children:[t.jsx(cn,{xs:t.jsxs(Se,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[t.jsx(zr,{onClick:()=>h(!1),children:t.jsx(en,{})}),t.jsx(X,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:s("common.category")})]}),md:null}),t.jsx(Se,{visibility:p.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?t.jsxs(t.Fragment,{children:[f.showExplore&&t.jsxs(Y,{display:"flex",alignItems:"center",gap:1,mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[t.jsx(ur,{icon:Po}),t.jsx(X,{variant:"body1",color:e?"text.lighter":"text.primary",fontWeight:e?void 0:"fontWeightMedium",sx:{cursor:"pointer"},onClick:()=>{h(!1),b()},children:s("explore.title")})]}),!!l.length&&t.jsx(Se,{gap:2,children:l.map(k=>t.jsx(X,{variant:"body1",title:k.name,sx:{cursor:"pointer"},"data-cy":"filter",color:e===k.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{e===k.value?b():v(k.value),h(!1)},children:k.name},k.value))})]}):t.jsx(Fr,{})})]}):null}function un(){const{endpoint:e,serverVersion:n,storeVersion:s}=pe(),l=Mr(n,s),p=L.useMemo(()=>lr({baseURL:e,headers:l}),[e]);return{get:async f=>{const{data:g}=await p.get(f);return g},post:async(f,g)=>{const{data:d}=await p.post(f,g);return d}}}const Br=L.memo(function(e){return t.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:t.jsx(Ee,{})})});function tr({icon:e,children:n,maxWidth:s=100,title:l}){return(n===0||n)&&t.jsxs(Se,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:s,overflow:"hidden"},children:[e,t.jsx(X,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:l||(typeof n=="string"?n:void 0),children:n})]})}const qt=292,Zt=210,jt=336;function Ea(){var e,n;const{t:s,search:l}=pe(),{get:p}=un(),f=Qe(),g=Fe(f.breakpoints.down("md")),d=((n=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:n.homeBanner)||[],{data:v=[],error:b,loading:h}=ut(async()=>{const C=await p(nn(we.blockletsPath,{didList:d.map(W=>W.did).join(",")}));return C!=null&&C.dataList?d.map(W=>C.dataList.find(D=>D.did===W.did)):[]});b&&console.error("Get Banner Blocklets error:",b);const S={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!b&&d.length>0?t.jsxs(t.Fragment,{children:[t.jsx(X,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:s("explore.title")}),t.jsx(Y,{height:{xs:"auto",md:qt},minHeight:qt,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:h?t.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[t.jsx(Ie,{variant:"rounded",height:Zt,width:jt}),t.jsxs(Y,{flex:1,height:"100%",children:[t.jsx(Ie,{variant:"text",height:50,width:100}),t.jsx(Ie,{variant:"text",height:40,width:"100%"}),t.jsx(Ie,{variant:"text",height:40,width:300}),t.jsxs(Y,{display:"flex",gap:1,my:2,children:[t.jsx(Ie,{variant:"circular",height:20,width:20}),t.jsx(Ie,{variant:"text",height:20,width:50})]}),t.jsx(Ie,{variant:"rounded",height:30,width:100})]})]}):t.jsx($o,{showNav:!0,autoPlay:!0,slideDuration:g?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:C=>t.jsx(Y,{onClick:C,sx:{display:{xs:"none",md:"block"}},children:t.jsx(fo,{sx:{...S,left:5}})}),renderRightNav:C=>t.jsx(Y,{onClick:C,sx:{display:{xs:"none",md:"block"}},children:t.jsx(mo,{sx:{...S,right:5}})}),items:d.map((C,W)=>({original:C.did,renderItem:()=>{var D;const $=v[W]||{},Q=C.cover||Ca(C.did,(D=$.screenshots)==null?void 0:D[0]),ee=Pr(Q,f.breakpoints.values.md*2);return t.jsxs(Se,{height:{xs:"auto",md:qt},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${ee}")`,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:()=>l.handleSearchSelect($),gap:{xs:2,md:5},children:[k(ee),t.jsxs(Se,{flex:1,height:"100%",gap:3,children:[t.jsxs(Y,{flex:1,children:[x(C.name||$.title||C.name),w(C.desc||$.description)]}),$.did&&_($,C.baseNum),I($)]})]})}}))})})]}):null;function k(C){return t.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:jt},children:t.jsx(Ra,{url:C})})}function x(C){return t.jsx(X,{variant:"h2",width:"100%",children:C})}function w(C){return t.jsx(X,{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 _(C,W=0){const{did:D,owner:$,stats:Q}=C;return t.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[t.jsx(tr,{icon:t.jsx(rn,{src:$.avatar,did:D,size:20,variant:"circle"}),children:$.fullName}),t.jsx(tr,{icon:t.jsx(ur,{icon:Wo}),title:`${Q.downloads+W}`,children:_a(Q.downloads+W)})]})}function I(C){return t.jsx(xe,{variant:"outlined",size:"small",onClick:()=>l.handleSearchSelect(C),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:s("explore.viewDetail")})}}const _a=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`,Ca=(e,n)=>e&&n?`/assets/${e}/screenshots/${n}`:"";function Ra({url:e}){const[n,s]=L.useState(!0);return t.jsxs(t.Fragment,{children:[n&&t.jsx(Ie,{variant:"rectangular",sx:{width:{xs:"100%",md:jt},height:{xs:"auto",md:Zt}}}),t.jsx(Y,{display:n?"none":"block",component:"img",src:e,width:{xs:"100%",md:jt},height:{xs:"auto",md:Zt},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:16/10},onLoad:()=>s(!1),onError:()=>s(!1)})]})}function Ia({title:e,blocklets:n}){const{blockletRender:s,serverVersion:l}=pe();return t.jsxs(Y,{mt:3,children:[t.jsx(X,{component:"h3",variant:"h3",sx:{mb:2},children:e}),t.jsx(Hn,{container:!0,spacing:2,children:n.map(p=>t.jsx(Hn,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":p.did,children:t.jsx(Y,{padding:"1px",children:s({blocklet:p,blocklets:n,serverVersion:l})})},p.did))})]})}function Pa(){const{get:e}=un(),{t:n}=pe(),{data:s=[],error:l,loading:p}=ut(async()=>{const f=await e(we.explorePath);return Array.isArray(f)?f:[]});return l?t.jsx(tn,{error:new Error(`Failed to fetch blocklets from ${we.explorePath}`)}):p?t.jsx(Br,{mt:15}):t.jsxs(t.Fragment,{children:[t.jsx(Ea,{}),s.map(f=>f.blocklets.length>0?t.jsx(Ia,{title:n(`explore.${f.type}`),blocklets:f.blocklets},f.type):null)]})}const Vt="__FREE_TEXT__",nr="__NO_RESULT__",Gt=40;function Ma({endpoint:e,t:n,locale:s,filters:l,handleKeyword:p,handleSearchSelect:f,...g}){const d=L.useRef(null),v=L.useRef(!1),[b,h]=L.useState(!1),[S,k]=L.useState(""),[x,w]=L.useState(!1),_=un(),[I,C]=L.useState(!1),W=async R=>{C(!0);const V=await _.get(Pe(e,nn(we.blockletsPath,R)));return C(!1),V.dataList||[]},{data:D,run:$}=ut(R=>R?W({sortBy:we.nameDesc,page:1,pageSize:10,keyword:R,showResources:"true"}):Promise.resolve([]),{manual:!0});L.useEffect(()=>{C(!0),$(l.keyword),k(l.keyword||"")},[l.keyword,$]),la("ctrl + k, command + k",R=>{var V,ce;return R.stopPropagation(),R.preventDefault(),(ce=(V=d.current)==null?void 0:V.querySelector("input"))==null||ce.focus(),!1},{enableOnTags:["INPUT"]});const Q=pr(R=>$(R),{wait:300}),ee={name:Vt,title:S,did:""};let U=[];return S&&(I?U=[ee]:D!=null&&D.length?U=[ee,...D]:U=[{name:nr,title:n("blocklet.noResults"),did:""}]),t.jsxs(t.Fragment,{children:[t.jsxs(Qi,{fullScreen:!0,open:x,sx:{display:{md:"none"}},children:[t.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[t.jsx(vr,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:n("common.searchStore"),className:"bl-autocomplete-input",value:S,onChange:R=>le(R.target.value),startAdornment:ae(x),endAdornment:ye()}),t.jsx(xe,{variant:"outlined",onClick:()=>{w(!1),k(l.keyword||"")},children:n("common.cancel")})]}),t.jsx(cr,{sx:{p:.5},children:U.map(R=>je(R))})]}),t.jsx(wt,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>w(!0)}),t.jsx(vo,{ref:d,open:!!S&&b,size:"small",onOpen:()=>h(!0),onClose:(R,V)=>{h(!1),V==="selectOption"&&!v.current&&p(S)},disableClearable:!0,inputValue:S,onInputChange:(R,V)=>le(V),isOptionEqualToValue:(R,V)=>R.name===V.name,getOptionLabel:R=>R.title,getOptionKey:R=>R.name,noOptionsText:n("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:R=>t.jsx(yr,{...R,InputProps:{...R.InputProps,autoFocus:!0,placeholder:n("common.searchStore"),className:"bl-autocomplete-input",value:S,startAdornment:ae(b),endAdornment:ye()}}),filterOptions:R=>R,...g,options:U,renderOption:(R,V)=>je(V),value:ee,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(g.sx)?g.sx:[g.sx]]})]});function le(R){C(!0),k(R),v.current=!1,Q.run(R)}function ve(){w(!1),k(""),le(""),p("")}function ke(R){R!=null&&R.did?(w(!1),v.current=!0,k(""),f(R)):R.name===Vt&&(w(!1),p(S))}function je(R){var V,ce;return t.jsxs(St,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ke(R),children:[Te(R),t.jsxs(X,{variant:"body1",children:[t.jsx(X,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:R.title}),t.jsx(X,{sx:{color:"text.lighter"},fontSize:"13px",children:((ce=(V=R.category)==null?void 0:V.locales)==null?void 0:ce[s||"en"])||""})]})]},R.did)}function Te(R){if([Vt,nr].includes(R.name))return t.jsx(Y,{width:Gt,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:t.jsx(wt,{sx:{fontSize:28}})});let V="";return R.logo&&(V=Pe(e,"assets",R.did,Pr(R.logo,Gt,R.version))),t.jsx(rn,{src:V,size:Gt,style:{borderRadius:"8px",overflow:"hidden"}})}function ae(R=!0){return t.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:R&&S&&I?t.jsx(Ee,{color:"inherit",size:16}):t.jsx(wt,{sx:{fontSize:16,cursor:"default"}})})}function ye(){return S?t.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:t.jsx(en,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>ve()})}):null}}function La({placeholder:e="Type to search...",...n}){const{search:s}=pe(),{filters:l,handleKeyword:p}=s,[f,g]=L.useState(l.keyword||""),d=pr(p,{wait:300}),v=h=>{const{value:S}=h.target;g(S),d.run(S)},b=()=>{g(""),p("")};return L.useEffect(()=>{g(l.keyword||"")},[l.keyword]),t.jsx(Da,{inputProps:{"data-cy":"search-blocklet"},startAdornment:t.jsx(Xn,{position:"start",children:t.jsx(za,{})}),onChange:v,placeholder:e,value:f,title:e,"data-cy":"search",endAdornment:f&&t.jsx(Xn,{position:"end",children:t.jsx(Na,{"data-cy":"search-delete",onClick:b})}),...n})}const Da=Be(vr)`
|
|
45
|
+
`;function Fr(){const{search:e,t:n}=pe(),{filters:s,handleSort:l,handlePrice:p}=e,f=Ir(n);return t.jsxs(Se,{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:[t.jsx(dr,{control:t.jsx(hr,{checked:s.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:g=>p(g.target.checked?"free":"")}),label:n("blocklet.free")}),t.jsx(Nr,{value:s.sortBy||f[0].value,options:f,onChange:g=>l(g),placeholder:n("sort.sort")})]})}function Oa(){const{selectedCategory:e,search:n,t:s,categoryOptions:l,loadings:p,layout:f,baseSearch:g}=pe(),{filters:d,handleCategory:v,cleanFilter:b}=n,{toggleOpen:h}=ln();D.useEffect(()=>{h(!1)},[Object.values(d).join("")]);const S=ha(g,f.showSearch,d.keyword);return f.showCategory?t.jsxs(Sa,{children:[t.jsx(cn,{xs:t.jsxs(Se,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[t.jsx(zr,{onClick:()=>h(!1),children:t.jsx(en,{})}),t.jsx(X,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:s("common.category")})]}),md:null}),t.jsx(Se,{visibility:p.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?t.jsxs(t.Fragment,{children:[f.showExplore&&t.jsxs(Y,{display:"flex",alignItems:"center",gap:1,mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[t.jsx(ur,{icon:Po}),t.jsx(X,{variant:"body1",color:e?"text.lighter":"text.primary",fontWeight:e?void 0:"fontWeightMedium",sx:{cursor:"pointer"},onClick:()=>{h(!1),b()},children:s("explore.title")})]}),!!l.length&&t.jsx(Se,{gap:2,children:l.map(k=>t.jsx(X,{variant:"body1",title:k.name,sx:{cursor:"pointer"},"data-cy":"filter",color:e===k.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{e===k.value?b():v(k.value),h(!1)},children:k.name},k.value))})]}):t.jsx(Fr,{})})]}):null}function un(){const{endpoint:e,serverVersion:n,storeVersion:s}=pe(),l=Mr(n,s),p=D.useMemo(()=>lr({baseURL:e,headers:l}),[e]);return{get:async f=>{const{data:g}=await p.get(f);return g},post:async(f,g)=>{const{data:d}=await p.post(f,g);return d}}}const Br=D.memo(function(e){return t.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:t.jsx(Ee,{})})});function tr({icon:e,children:n,maxWidth:s=100,title:l}){return(n===0||n)&&t.jsxs(Se,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:s,overflow:"hidden"},children:[e,t.jsx(X,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:l||(typeof n=="string"?n:void 0),children:n})]})}const qt=292,Zt=210,jt=336;function Ea(){var e,n;const{t:s,search:l}=pe(),{get:p}=un(),f=Qe(),g=Fe(f.breakpoints.down("md")),d=((n=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:n.homeBanner)||[],{data:v=[],error:b,loading:h}=ut(async()=>{const C=await p(nn(we.blockletsPath,{didList:d.map(B=>B.did).join(",")}));return C!=null&&C.dataList?d.map(B=>C.dataList.find(M=>M.did===B.did)):[]});b&&console.error("Get Banner Blocklets error:",b);const S={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!b&&d.length>0?t.jsxs(t.Fragment,{children:[t.jsx(X,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:s("explore.title")}),t.jsx(Y,{height:{xs:"auto",md:qt},minHeight:qt,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:h?t.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[t.jsx(Ie,{variant:"rounded",height:Zt,width:jt}),t.jsxs(Y,{flex:1,height:"100%",children:[t.jsx(Ie,{variant:"text",height:50,width:100}),t.jsx(Ie,{variant:"text",height:40,width:"100%"}),t.jsx(Ie,{variant:"text",height:40,width:300}),t.jsxs(Y,{display:"flex",gap:1,my:2,children:[t.jsx(Ie,{variant:"circular",height:20,width:20}),t.jsx(Ie,{variant:"text",height:20,width:50})]}),t.jsx(Ie,{variant:"rounded",height:30,width:100})]})]}):t.jsx($o,{showNav:!0,autoPlay:!0,slideDuration:g?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:C=>t.jsx(Y,{onClick:C,sx:{display:{xs:"none",md:"block"}},children:t.jsx(fo,{sx:{...S,left:5}})}),renderRightNav:C=>t.jsx(Y,{onClick:C,sx:{display:{xs:"none",md:"block"}},children:t.jsx(mo,{sx:{...S,right:5}})}),items:d.map((C,B)=>({original:C.did,renderItem:()=>{var M;const $=v[B]||{},Q=C.cover||Ca(C.did,(M=$.screenshots)==null?void 0:M[0]),ee=Pr(Q,f.breakpoints.values.md*2);return t.jsxs(Se,{height:{xs:"auto",md:qt},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${ee}")`,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:()=>l.handleSearchSelect($),gap:{xs:2,md:5},children:[k(ee),t.jsxs(Se,{flex:1,height:"100%",gap:3,children:[t.jsxs(Y,{flex:1,children:[x(C.name||$.title||C.name),w(C.desc||$.description)]}),$.did&&_($,C.baseNum),I($)]})]})}}))})})]}):null;function k(C){return t.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:jt},children:t.jsx(Ra,{url:C})})}function x(C){return t.jsx(X,{variant:"h2",width:"100%",children:C})}function w(C){return t.jsx(X,{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 _(C,B=0){const{did:M,owner:$,stats:Q}=C;return t.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[t.jsx(tr,{icon:t.jsx(rn,{src:$.avatar,did:M,size:20,variant:"circle"}),children:$.fullName}),t.jsx(tr,{icon:t.jsx(ur,{icon:Wo}),title:`${Q.downloads+B}`,children:_a(Q.downloads+B)})]})}function I(C){return t.jsx(xe,{variant:"outlined",size:"small",onClick:()=>l.handleSearchSelect(C),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:s("explore.viewDetail")})}}const _a=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`,Ca=(e,n)=>e&&n?`/assets/${e}/screenshots/${n}`:"";function Ra({url:e}){const[n,s]=D.useState(!0);return t.jsxs(t.Fragment,{children:[n&&t.jsx(Ie,{variant:"rectangular",sx:{width:{xs:"100%",md:jt},height:{xs:"auto",md:Zt}}}),t.jsx(Y,{display:n?"none":"block",component:"img",src:e,width:{xs:"100%",md:jt},height:{xs:"auto",md:Zt},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:16/10},onLoad:()=>s(!1),onError:()=>s(!1)})]})}function Ia({title:e,blocklets:n}){const{blockletRender:s,serverVersion:l}=pe();return t.jsxs(Y,{mt:3,children:[t.jsx(X,{component:"h3",variant:"h3",sx:{mb:2},children:e}),t.jsx(Hn,{container:!0,spacing:2,children:n.map(p=>t.jsx(Hn,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":p.did,children:t.jsx(Y,{padding:"1px",children:s({blocklet:p,blocklets:n,serverVersion:l})})},p.did))})]})}function Pa(){const{get:e}=un(),{t:n}=pe(),{data:s=[],error:l,loading:p}=ut(async()=>{const f=await e(we.explorePath);return Array.isArray(f)?f:[]});return l?t.jsx(tn,{error:new Error(`Failed to fetch blocklets from ${we.explorePath}`)}):p?t.jsx(Br,{mt:15}):t.jsxs(t.Fragment,{children:[t.jsx(Ea,{}),s.map(f=>f.blocklets.length>0?t.jsx(Ia,{title:n(`explore.${f.type}`),blocklets:f.blocklets},f.type):null)]})}const Vt="__FREE_TEXT__",nr="__NO_RESULT__",Gt=40;function Ma({endpoint:e,t:n,locale:s,filters:l,handleKeyword:p,handleSearchSelect:f,...g}){const d=D.useRef(null),v=D.useRef(!1),[b,h]=D.useState(!1),[S,k]=D.useState(""),[x,w]=D.useState(!1),_=un(),[I,C]=D.useState(!1),B=async R=>{C(!0);const V=await _.get(Pe(e,nn(we.blockletsPath,R)));return C(!1),V.dataList||[]},{data:M,run:$}=ut(R=>R?B({sortBy:we.nameDesc,page:1,pageSize:10,keyword:R,showResources:"true"}):Promise.resolve([]),{manual:!0});D.useEffect(()=>{C(!0),$(l.keyword),k(l.keyword||"")},[l.keyword,$]),la("ctrl + k, command + k",R=>{var V,ce;return R.stopPropagation(),R.preventDefault(),(ce=(V=d.current)==null?void 0:V.querySelector("input"))==null||ce.focus(),!1},{enableOnTags:["INPUT"]});const Q=pr(R=>$(R),{wait:300}),ee={name:Vt,title:S,did:""};let U=[];return S&&(I?U=[ee]:M!=null&&M.length?U=[ee,...M]:U=[{name:nr,title:n("blocklet.noResults"),did:""}]),t.jsxs(t.Fragment,{children:[t.jsxs(Qi,{fullScreen:!0,open:x,sx:{display:{md:"none"}},children:[t.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[t.jsx(vr,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:n("common.searchStore"),className:"bl-autocomplete-input",value:S,onChange:R=>le(R.target.value),startAdornment:ae(x),endAdornment:ye()}),t.jsx(xe,{variant:"outlined",onClick:()=>{w(!1),k(l.keyword||"")},children:n("common.cancel")})]}),t.jsx(cr,{sx:{p:.5},children:U.map(R=>je(R))})]}),t.jsx(wt,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>w(!0)}),t.jsx(vo,{ref:d,open:!!S&&b,size:"small",onOpen:()=>h(!0),onClose:(R,V)=>{h(!1),V==="selectOption"&&!v.current&&p(S)},disableClearable:!0,inputValue:S,onInputChange:(R,V)=>le(V),isOptionEqualToValue:(R,V)=>R.name===V.name,getOptionLabel:R=>R.title,getOptionKey:R=>R.name,noOptionsText:n("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:R=>t.jsx(yr,{...R,InputProps:{...R.InputProps,autoFocus:!0,placeholder:n("common.searchStore"),className:"bl-autocomplete-input",value:S,startAdornment:ae(b),endAdornment:ye()}}),filterOptions:R=>R,...g,options:U,renderOption:(R,V)=>je(V),value:ee,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(g.sx)?g.sx:[g.sx]]})]});function le(R){C(!0),k(R),v.current=!1,Q.run(R)}function ve(){w(!1),k(""),le(""),p("")}function ke(R){R!=null&&R.did?(w(!1),v.current=!0,k(""),f(R)):R.name===Vt&&(w(!1),p(S))}function je(R){var V,ce;return t.jsxs(St,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>ke(R),children:[Te(R),t.jsxs(X,{variant:"body1",children:[t.jsx(X,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:R.title}),t.jsx(X,{sx:{color:"text.lighter"},fontSize:"13px",children:((ce=(V=R.category)==null?void 0:V.locales)==null?void 0:ce[s||"en"])||""})]})]},R.did)}function Te(R){if([Vt,nr].includes(R.name))return t.jsx(Y,{width:Gt,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:t.jsx(wt,{sx:{fontSize:28}})});let V="";return R.logo&&(V=Pe(e,"assets",R.did,Pr(R.logo,Gt,R.version))),t.jsx(rn,{src:V,size:Gt,style:{borderRadius:"8px",overflow:"hidden"}})}function ae(R=!0){return t.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:R&&S&&I?t.jsx(Ee,{color:"inherit",size:16}):t.jsx(wt,{sx:{fontSize:16,cursor:"default"}})})}function ye(){return S?t.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:t.jsx(en,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>ve()})}):null}}function La({placeholder:e="Type to search...",...n}){const{search:s}=pe(),{filters:l,handleKeyword:p}=s,[f,g]=D.useState(l.keyword||""),d=pr(p,{wait:300}),v=h=>{const{value:S}=h.target;g(S),d.run(S)},b=()=>{g(""),p("")};return D.useEffect(()=>{g(l.keyword||"")},[l.keyword]),t.jsx(Da,{inputProps:{"data-cy":"search-blocklet"},startAdornment:t.jsx(Xn,{position:"start",children:t.jsx(za,{})}),onChange:v,placeholder:e,value:f,title:e,"data-cy":"search",endAdornment:f&&t.jsx(Xn,{position:"end",children:t.jsx(Na,{"data-cy":"search-delete",onClick:b})}),...n})}const Da=Be(vr)`
|
|
46
46
|
background-color: ${e=>e.theme.palette.grey[50]};
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
border-radius: 6px;
|
|
@@ -69,7 +69,7 @@ import{cl as Ge,r as L,ci as ut,bb as Ti,bc as Oi,bk as gt,f5 as bt,cj as st,f6
|
|
|
69
69
|
color: ${e=>e.theme.palette.grey[500]};
|
|
70
70
|
font-size: 16px;
|
|
71
71
|
cursor: pointer;
|
|
72
|
-
`;function Fa(){const{search:e,t:n,endpoint:s,locale:l,getCategoryLocale:p,developerName:f,showResourcesSwitch:g,layout:d,baseSearch:v}=pe(),{filters:b,handleSort:h,handlePrice:S,handleDeveloper:k,handleSwitchShowResources:x,cleanFilter:w}=e,_=Ir(n);return t.jsxs(Se,{className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:3,children:[t.jsx(X,{variant:"h2",textTransform:"capitalize",children:p(b.category)}),t.jsxs(Se,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[d.showSearch?t.jsx(Y,{flex:1,children:v?t.jsx(La,{}):t.jsx(Ma,{locale:l,endpoint:s,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,b.owner&&f&&t.jsx(qn,{label:n("blocklet.authorTag",{name:f}),size:"small",onDelete:()=>k("")}),b.resourceDid&&b.resourceBlocklet&&t.jsx(qn,{label:n("blocklet.resourceTag",{name:b.resourceBlocklet}),size:"small",onDelete:()=>w(["resourceDid","resourceBlocklet","showResources"])}),g?t.jsx(rr,{checked:b.showResources==="true",onChange:I=>x(I?"true":""),label:n("common.showResources")}):null,t.jsx(rr,{checked:b.price==="free",onChange:I=>S(I?"free":""),label:n("blocklet.free")}),t.jsx(Nr,{value:b.sortBy||_[0].value,options:_,placeholder:n("sort.sort"),onChange:I=>h(I)})]})]})}function rr({checked:e,onChange:n,label:s}){return t.jsx(dr,{sx:{m:0},control:t.jsx(hr,{checked:e,size:"small",sx:{p:0,pr:1,"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:l=>n(l.target.checked)}),label:s})}function xt({children:e}){return t.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[t.jsx(go,{}),e]})}function ir(){const{t:e}=pe();return t.jsx(X,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Xt({filterTip:e,keywordTip:n}){const{t:s,locale:l}=pe(),p=()=>l==="zh"?"、":" , ";return t.jsxs(Y,{mt:1,display:"flex",children:[t.jsx(X,{style:{marginRight:"16px"},children:s("blocklet.emptyTip")}),e&&t.jsx(X,{children:s("blocklet.filterTip")}),e&&n&&p(),n&&t.jsx(X,{children:s("blocklet.keywordTip")})]})}function Yt({primaryStart:e,primaryEnd:n,filter:s}){return t.jsxs(X,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[t.jsx(X,{children:e}),t.jsx(X,{color:"primary",children:s}),t.jsxs(X,{children:[n," "]})]})}function Ba(){const{t:e,search:n,getCategoryLocale:s,selectedCategory:l}=pe(),{filters:p}=n,f=!!l||!!p.price;if(p.keyword&&f)return t.jsxs(xt,{children:[t.jsx(Yt,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:p.keyword}),t.jsx(Xt,{keywordTip:!0,filterTip:!0})]});if(p.keyword)return t.jsxs(xt,{children:[t.jsx(Yt,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:p.keyword}),t.jsx(Xt,{keywordTip:!0})]});if(f){const g=s(l);return t.jsxs(xt,{children:[g?t.jsx(Yt,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:g}):t.jsx(ir,{}),t.jsx(Xt,{filterTip:!0})]})}return t.jsx(xt,{children:t.jsx(ir,{})})}const Wa=(e,n,s,l)=>Eo(async p=>{p||(s.currentPage=s.defaultCurrentPage);const{currentPage:f,pageSize:g}=s,d={...n,category:n.category==="All"?"":n.category,sortBy:we[n.sortBy],page:f,pageSize:g};l(null);const{data:v={}}=await e.get(we.blockletsPath,{params:d});return s.currentPage++,{page:f,pageSize:g,list:(v==null?void 0:v.dataList)||[],total:(v==null?void 0:v.total)||0}},{isNoMore:p=>p?p.page*p.pageSize>=p.total:!1,reloadDeps:[e,bo(n)],onError:l});function Aa(){var e;const{storeApi:n,search:s,extraFilter:l,errors:p,updateDeveloperName:f}=pe(),{filters:g}=s,d=Bi({currentPage:we.currentPage,pageSize:ga()?we.mobilePageSize:we.pageSize,defaultCurrentPage:we.defaultCurrentPage}),[v,b]=
|
|
72
|
+
`;function Fa(){const{search:e,t:n,endpoint:s,locale:l,getCategoryLocale:p,developerName:f,showResourcesSwitch:g,layout:d,baseSearch:v}=pe(),{filters:b,handleSort:h,handlePrice:S,handleDeveloper:k,handleSwitchShowResources:x,cleanFilter:w}=e,_=Ir(n);return t.jsxs(Se,{className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:3,children:[t.jsx(X,{variant:"h2",textTransform:"capitalize",children:p(b.category)}),t.jsxs(Se,{flex:1,direction:"row",alignItems:"center",width:"100%",justifyContent:{xs:"space-between",md:"flex-end"},gap:2,children:[d.showSearch?t.jsx(Y,{flex:1,children:v?t.jsx(La,{}):t.jsx(Ma,{locale:l,endpoint:s,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:e.filters,handleKeyword:e.handleKeyword,handleSearchSelect:e.handleSearchSelect})}):null,b.owner&&f&&t.jsx(qn,{label:n("blocklet.authorTag",{name:f}),size:"small",onDelete:()=>k("")}),b.resourceDid&&b.resourceBlocklet&&t.jsx(qn,{label:n("blocklet.resourceTag",{name:b.resourceBlocklet}),size:"small",onDelete:()=>w(["resourceDid","resourceBlocklet","showResources"])}),g?t.jsx(rr,{checked:b.showResources==="true",onChange:I=>x(I?"true":""),label:n("common.showResources")}):null,t.jsx(rr,{checked:b.price==="free",onChange:I=>S(I?"free":""),label:n("blocklet.free")}),t.jsx(Nr,{value:b.sortBy||_[0].value,options:_,placeholder:n("sort.sort"),onChange:I=>h(I)})]})]})}function rr({checked:e,onChange:n,label:s}){return t.jsx(dr,{sx:{m:0},control:t.jsx(hr,{checked:e,size:"small",sx:{p:0,pr:1,"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:l=>n(l.target.checked)}),label:s})}function xt({children:e}){return t.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[t.jsx(go,{}),e]})}function ir(){const{t:e}=pe();return t.jsx(X,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function Xt({filterTip:e,keywordTip:n}){const{t:s,locale:l}=pe(),p=()=>l==="zh"?"、":" , ";return t.jsxs(Y,{mt:1,display:"flex",children:[t.jsx(X,{style:{marginRight:"16px"},children:s("blocklet.emptyTip")}),e&&t.jsx(X,{children:s("blocklet.filterTip")}),e&&n&&p(),n&&t.jsx(X,{children:s("blocklet.keywordTip")})]})}function Yt({primaryStart:e,primaryEnd:n,filter:s}){return t.jsxs(X,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[t.jsx(X,{children:e}),t.jsx(X,{color:"primary",children:s}),t.jsxs(X,{children:[n," "]})]})}function Ba(){const{t:e,search:n,getCategoryLocale:s,selectedCategory:l}=pe(),{filters:p}=n,f=!!l||!!p.price;if(p.keyword&&f)return t.jsxs(xt,{children:[t.jsx(Yt,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:p.keyword}),t.jsx(Xt,{keywordTip:!0,filterTip:!0})]});if(p.keyword)return t.jsxs(xt,{children:[t.jsx(Yt,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:p.keyword}),t.jsx(Xt,{keywordTip:!0})]});if(f){const g=s(l);return t.jsxs(xt,{children:[g?t.jsx(Yt,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:g}):t.jsx(ir,{}),t.jsx(Xt,{filterTip:!0})]})}return t.jsx(xt,{children:t.jsx(ir,{})})}const Wa=(e,n,s,l)=>Eo(async p=>{p||(s.currentPage=s.defaultCurrentPage);const{currentPage:f,pageSize:g}=s,d={...n,category:n.category==="All"?"":n.category,sortBy:we[n.sortBy],page:f,pageSize:g};l(null);const{data:v={}}=await e.get(we.blockletsPath,{params:d});return s.currentPage++,{page:f,pageSize:g,list:(v==null?void 0:v.dataList)||[],total:(v==null?void 0:v.total)||0}},{isNoMore:p=>p?p.page*p.pageSize>=p.total:!1,reloadDeps:[e,bo(n)],onError:l});function Aa(){var e;const{storeApi:n,search:s,extraFilter:l,errors:p,updateDeveloperName:f}=pe(),{filters:g}=s,d=Bi({currentPage:we.currentPage,pageSize:ga()?we.mobilePageSize:we.pageSize,defaultCurrentPage:we.defaultCurrentPage}),[v,b]=D.useState(null),h=Wa(n,g,d,b),S=D.useMemo(()=>{var k,x;return l?l(((k=h.data)==null?void 0:k.list)||[]):((x=h.data)==null?void 0:x.list)||[]},[h.data,l]);return D.useEffect(()=>{const k=S.find(x=>x.owner.did===g.owner);f((k==null?void 0:k.owner.fullName)||(k==null?void 0:k.author.name)||"")},[g.owner,S,f]),{blocklets:S,fetchBlockletsError:v,loadMore:h.loadMore,hasNextPage:!h.noMore,total:((e=h.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:h.loading,loadingMore:h.loadingMore},errors:{...p,fetchBlockletsError:v}}}function $a(){const{t:e,search:n,endpoint:s,blockletRender:l,serverVersion:p,minItemWidth:f,layout:g,baseSearch:d}=pe(),{filters:v}=n,{blocklets:b,errors:h,loadMore:S,loadings:k,hasNextPage:x,total:w}=Aa(),[_]=Yo({loading:k.fetchBlockletsLoading||k.loadingMore,hasNextPage:x,onLoadMore:S});if(h.fetchBlockletsError){const M=new Error(`Failed to fetch blocklets from ${s}: ${h.fetchBlockletsError.message}`);return t.jsx(tn,{error:M})}const I=d&&g.showSearch||!v.keyword;return t.jsxs(t.Fragment,{children:[I?t.jsx(Fa,{}):t.jsxs(t.Fragment,{children:[t.jsx(cn,{xs:t.jsx(Fr,{}),md:null}),B()]}),C(),!k.fetchBlockletsLoading&&x&&t.jsx(Y,{height:60,display:"flex",justifyContent:"center",py:2,ref:_,children:t.jsx(Ee,{})})]});function C(){return k.fetchBlockletsLoading?t.jsx(Br,{mt:15}):b.length?t.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${f}px, 1fr))`,p:"2px",gap:2,children:b.map(M=>t.jsx(Y,{"data-blocklet-did":M.did,sx:{minWidth:f},children:l({blocklet:M,blocklets:b,serverVersion:p})},M.did))}):t.jsx(Ba,{})}function B(){return t.jsxs(Se,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[t.jsx(X,{variant:"h3",children:e("blocklet.search",{keyword:v.keyword})}),t.jsx(X,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:w})})]})}}function Ka(){const{t:e,selectedCategory:n,getCategoryLocale:s}=pe(),{toggleOpen:l}=ln();return t.jsxs(X,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[t.jsx(zr,{onClick:()=>l(!0),children:t.jsx(Ni,{})}),s(n)||e("common.category")]})}function Ua(){const{search:e,layout:n}=pe(),{filters:s}=e,l=s.category||s.keyword||s.price;return t.jsx(ca,{children:t.jsxs(zi,{FallbackComponent:tn,children:[t.jsx(Ka,{}),t.jsxs(Y,{display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:5},children:[t.jsx(Oa,{}),t.jsx(Se,{height:"100%",position:"relative",flex:1,overflow:"visible",children:n.showExplore&&!l?t.jsx(Pa,{}):t.jsx($a,{})})]})]})})}function Bs(e){const n=Qe(),s=Mi(Li({...n,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 t.jsx(Di,{theme:s,children:t.jsx(wa,{...e,children:t.jsx(Ua,{})})})}const Ha=(e,n)=>!n||!e?!0:Vn.satisfies(Vn.coerce(e),n);function Wr({children:e,serverVersion:n="",requirementVersion:s="",...l}){const{t:p}=We();return Ha(n,s)?e:t.jsx(fr,{title:p("store.tooltip.upgradeServer",{serverVersion:n,version:s}),arrow:!0,children:t.jsx(X,{children:t.jsx(xe,{disabled:!0,variant:"outlined",...l,children:p("common.upgradeServer")})})})}Wr.propTypes={children:P.node.isRequired,serverVersion:P.string,requirementVersion:P.string};Wr.defaultProps={serverVersion:"",requirementVersion:""};const Ws=Be("div")`
|
|
73
73
|
background-color: transparent !important;
|
|
74
74
|
& > :not(.Mui-disabled) {
|
|
75
75
|
position: relative;
|
|
@@ -228,4 +228,4 @@ import{cl as Ge,r as L,ci as ut,bb as Ti,bc as Oi,bk as gt,f5 as bt,cj as st,f6
|
|
|
228
228
|
color: ${e=>e.theme.palette.grey[600]};
|
|
229
229
|
font-size: 12px;
|
|
230
230
|
}
|
|
231
|
-
`;function Ar({title:e,did:n,description:s,cover:l,version:p,button:f,buttonText:g,buttonDisabled:d,buttonLoading:v,onButtonClick:b,onMainClick:h,className:S,...k}){const x=(D,$=()=>!1)=>(Q,...ee)=>{$()?(Q.preventDefault(),Q.stopPropagation()):D instanceof Function&&(Q.preventDefault(),Q.stopPropagation(),D(...ee))},w=x(b,()=>!!(f||d||v)),_=Qe(),I=Fe(_.breakpoints.up("sm")),C=x(h),W=I?80:64;return t.jsx(qa,{className:`${S} arcblock-blocklet`,...k,children:t.jsxs("div",{className:"arcblock-blocklet__content",onClick:C,children:[l?t.jsx("div",{className:"arcblock-blocklet__cover",children:t.jsx(Ji,{src:l})}):n&&t.jsx("div",{className:"arcblock-blocklet__cover",children:t.jsx(rn,{did:n,size:W})}),t.jsxs("div",{className:"arcblock-blocklet__info",children:[t.jsxs("div",{className:"arcblock-blocklet__text",children:[L.isValidElement(e)?t.jsx(X,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",children:e}):t.jsx(X,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",title:or(e),dangerouslySetInnerHTML:{__html:e}}),L.isValidElement(s)?t.jsx(X,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",children:s}):t.jsx(X,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",title:or(s),dangerouslySetInnerHTML:{__html:s}})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"10px",flexFlow:"wrap"},children:[t.jsx("div",{onClick:w,style:{marginRight:"12px"},children:f||b&&t.jsxs(kt,{className:"arcblock-blocklet__button--hover",variant:"outlined",color:"primary",size:"small",disabled:d||v,style:{padding:"3px 6px",fontSize:"14px",minWidth:"92px",textAlign:"center"},children:[v&&t.jsx(Ee,{size:15,style:{marginRight:3,color:"inherit"}}),g]})}),t.jsx("div",{className:"arcblock-blocklet__version",children:p&&`v${p}`})]})]})]})})}Ar.propTypes={title:P.string||P.node,did:P.string,description:P.string||P.node,cover:P.string,buttonText:P.string,buttonDisabled:P.bool,buttonLoading:P.bool,button:P.element,version:P.string,onButtonClick:P.func,onMainClick:P.func,className:P.string};Ar.defaultProps={title:"",description:"",cover:null,did:null,buttonText:"Install",buttonDisabled:!1,buttonLoading:!1,button:null,version:null,onButtonClick:null,onMainClick:null,className:null};var dn={},Va=Ye;Object.defineProperty(dn,"__esModule",{value:!0});var $r=dn.default=void 0,Ga=Va(Xe()),Xa=t;$r=dn.default=(0,Ga.default)((0,Xa.jsx)("path",{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2M1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2"}),"ShoppingCart");var hn={},Ya=Ye;Object.defineProperty(hn,"__esModule",{value:!0});var Kr=hn.default=void 0,Qa=Ya(Xe()),Ja=t;Kr=hn.default=(0,Qa.default)((0,Ja.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const As={meta:P.object.isRequired,onCancel:P.func.isRequired},Za=Ot(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function es({action:e,onSelect:n,onNext:s}){const l=Za(),{t:p}=We(),f=[{action:"purchase",title:p("store.purchase.purchase.title"),description:p("store.purchase.purchase.description")},{action:"verify",title:p("store.purchase.verify.title"),description:p("store.purchase.verify.description")}];return t.jsxs(t.Fragment,{children:[t.jsx(Zi,{className:l.tabPanel,children:f.map(g=>t.jsxs(mr,{button:!0,selected:e===g.action,onClick:()=>n(g.action),children:[t.jsx(eo,{className:l.iconRoot,children:g.action==="purchase"?t.jsx($r,{style:{color:e==="purchase"?Gn.primary.main:"#AAA",fontSize:32}}):t.jsx(Kr,{style:{color:e==="verify"?Gn.primary.main:"#AAA",fontSize:32}})}),t.jsx(to,{primary:g.title,secondary:g.description})]},g.action))}),s&&t.jsx(kt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:s,children:p("common.next")})]})}es.propTypes={action:P.oneOf(["both","purchase","verify"]).isRequired,onSelect:P.func.isRequired,onNext:P.func.isRequired};const ts=Ot(e=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}));function Ur({disabled:e,storeList:n,teamDid:s,onAdd:l,scope:p,hiddenChildren:f,open:g,onClose:d}){const{api:v}=on(),[b,h]=L.useState(!1),[S,k]=L.useState(!0),[x,w]=L.useState(!1),[_,I]=L.useState(""),[C,W]=L.useState(""),{t:D}=We(),$=ts(),Q=async()=>{h(!0);try{const{decoded:U}=oo(_,n);await v.addBlockletStore({input:{teamDid:s,url:U,scope:p}}),l(U),w(!1),d()}catch(U){const le=`${D("store.blockletRegistry.addFailed")} ${lt(U)}`;W(le)}finally{h(!1)}},ee=()=>{w(!1),d()};return t.jsxs(t.Fragment,{children:[!f&&t.jsxs(mr,{button:!0,disabled:e,className:$.addMenuItemRoot,onClick:()=>{w(!0)},children:[t.jsx(yo,{font:!0}),t.jsx(X,{variant:"inherit",children:D("store.blockletRegistry.addRegistry")})]}),t.jsxs(no,{title:D("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:g||x,onClose:ee,PaperProps:{style:{minHeight:"auto"}},actions:t.jsxs(t.Fragment,{children:[t.jsx(kt,{onClick:U=>{U.stopPropagation(),ee()},color:"inherit",children:D("common.cancel")}),t.jsxs(kt,{onClick:U=>{U.stopPropagation(),Q()},color:"primary","data-cy":"install-blocklet-next-step",disabled:b||!_||S,variant:"contained",autoFocus:!0,children:[b&&t.jsx(Ee,{size:16}),D("common.confirm")]})]}),children:[t.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:t.jsx(ro,{component:"div",children:t.jsx(X,{component:"div",children:t.jsx(yr,{label:D("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url",fullWidth:!0,value:_,onChange:U=>{W(null);let le=!1;U.target.value.trim()||(le=!0),U.target.value.trim()||W(D("store.blockletRegistry.registryUrlEmpty")),I(U.target.value),k(le)},disabled:b,onKeyPress:U=>{U.key==="Enter"&&(U.preventDefault(),U.target.value.trim()?Q():W(D("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!C&&t.jsx(io,{severity:"error",style:{width:"100%"},children:C})]})]})}Ur.propTypes={teamDid:P.string.isRequired,disabled:P.bool,storeList:P.array,onAdd:P.func,scope:P.string,hiddenChildren:P.bool,open:P.bool,onClose:P.func};Ur.defaultProps={disabled:!1,storeList:[],onAdd:()=>{},scope:"",hiddenChildren:!1,open:!1,onClose:()=>{}};var pn={},ns=Ye;Object.defineProperty(pn,"__esModule",{value:!0});var Hr=pn.default=void 0,rs=ns(Xe()),is=t;Hr=pn.default=(0,rs.default)((0,is.jsx)("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}),"LinkOutlined");var fn={},os=Ye;Object.defineProperty(fn,"__esModule",{value:!0});var qr=fn.default=void 0,as=os(Xe()),ss=t;qr=fn.default=(0,as.default)((0,ss.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"BackupOutlined");const{NODE_MODES:ar}=gr,ls=({mode:e,previousMode:n}={})=>e===ar.SERVERLESS||n===ar.SERVERLESS;var cs={isInServerlessMode:ls};function _t({store:e,teamDid:n,onDelete:s,children:l,projectId:p="",scope:f=""}){const{api:g}=on(),{t:d}=We(),v=So(),[b,h]=L.useState(!1),[S,k]=L.useState(null),x=Qe(),w=()=>{h(!1),k(null)},_=async()=>{try{h(!0),await g.deleteBlockletStore({input:{teamDid:n,url:e.url,projectId:p,scope:f}}),await(v==null?void 0:v.actions.refreshBlocklet()),s&&typeof s=="function"&&s()}catch(W){Ne.error(`Remove Blocklet Store Error: ${lt(W)}`)}finally{h(!1),k(null)}},I={keyName:e.url,title:d("store.blockletRegistry.deleteRegistry"),description:d("store.blockletRegistry.deleteDesc",{name:`<b>${e.url}</b>`,color:x.palette.error.main}),confirmPlaceholder:d("store.blockletRegistry.confirmDesc",{name:e.url}),confirm:d("common.delConfirm"),cancel:d("common.cancel"),onConfirm:_,onCancel:w},C=W=>{e.protected||(W.stopPropagation(),k(I))};return t.jsxs(t.Fragment,{children:[l?t.jsx("span",{onClick:C,children:l}):t.jsx(xe,{color:"primary",disabled:b,onClick:C,size:"small",children:t.jsx(wr,{sx:{zoom:.95}})}),S&&t.jsx(wo,{keyName:S.keyName,title:S.title,description:S.description,confirmPlaceholder:S.confirmPlaceholder,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]})}_t.propTypes={children:P.node,teamDid:P.string.isRequired,store:P.object.isRequired,onDelete:P.func,projectId:P.string,scope:P.string};_t.defaultProps={children:null,projectId:"",scope:"",onDelete:()=>{}};var mn={},us=Ye;Object.defineProperty(mn,"__esModule",{value:!0});var Vr=mn.default=void 0,ds=us(Xe()),hs=t;Vr=mn.default=(0,ds.default)((0,hs.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff");const ps=({store:e,userDid:n})=>{var l;const s=((l=window.blocklet)==null?void 0:l.tenantMode)!==ao.BLOCKLET_TENANT_MODES.MULTIPLE;return e.protected?!1:e.scope&&e.scope===n?!0:s?e.scope==="studio":!1};function gn({connectedStore:e,onDisconnect:n,onDelete:s,store:l,teamDid:p,projectId:f}){var W;const[g,d]=L.useState(null),v=!!g,{t:b}=We(),{session:h}=so(),[S,k]=L.useState(!1),x=D=>{if(D.stopPropagation(),e!=null&&e.developerDid){const $=br.from(JSON.stringify({forceConnected:e==null?void 0:e.developerDid}),"utf8").toString("base64");window.open(`${Pe(l.url,"developer/blocklets")}?__did-connect__=${$}`)}else window.open(`${Pe(l.url,"developer/blocklets")}`)},w=D=>{d(D.currentTarget)},_=()=>{d(null)},I=()=>{k(!1),n()},C=[{label:b("common.visitStore"),action:x,icon:xr},{label:b("common.disconnect"),action:()=>{_(),k(!0)},icon:Vr,hidden:!e}];return t.jsxs(t.Fragment,{children:[t.jsx(xe,{ref:g,color:"primary",onClick:w,size:"small",children:t.jsx(ko,{sx:{zoom:.95}})}),t.jsxs(lo,{anchorEl:g,open:v,onClose:_,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[C.map(D=>D.hidden?null:t.jsxs(St,{dense:!0,onClick:D.action,disabled:D.disabled,children:[D.icon&&t.jsx(D.icon,{color:"action",sx:{marginRight:1}}),t.jsx(Y,{color:"action",children:D.label})]},D.label)),ps({store:l,userDid:(W=h==null?void 0:h.user)==null?void 0:W.did})&&t.jsx(_t,{store:l,onDelete:s,teamDid:p,projectId:f,scope:l.scope||"studio",children:t.jsxs(St,{dense:!0,disabled:l.protected,children:[t.jsx(wr,{sx:{color:l.protected?"action":"error.main",marginRight:1}}),t.jsx(Y,{color:l.protected?"action":"error.main",children:b("common.delete")})]})})]}),S&&t.jsx(co,{displayError:!0,title:`${b("common.disconnect")} ${l.name}`,description:b("blocklet.publish.disconnectStoreTip"),confirm:b("common.confirm"),onConfirm:I,onCancel:()=>k(!1)})]})}gn.propTypes={connectedStore:P.object.isRequired,onDisconnect:P.func,onDelete:P.func,store:P.object.isRequired,teamDid:P.string.isRequired,projectId:P.string};gn.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function fs({messageType:e,onOpen:n,onClose:s}){const l=L.useRef(null),p=L.useRef(null),f=async d=>{setTimeout(()=>{try{s==null||s()}catch{}},10*1e3),l.current&&(clearInterval(p.current),l.current.close());const v=Math.random().toString(36).slice(2);l.current=window.open(`${gr.WELLKNOWN_SERVICE_PATH_PREFIX}/open-window?key=${v}`,"_blank"),n==null||n(l.current),p.current=setInterval(()=>{(!l.current||l.current.closed)&&(l.current=null,clearInterval(p.current),setTimeout(()=>{s==null||s()},1100))},200),await Promise.resolve(d(l.current,b=>{if(!l.current){localStorage.setItem(`open-window-url-${v}`,JSON.stringify({url:b,time:Date.now()}));return}l.current.location.href=b}))},g=st(d=>{const{type:v,error:b}=d.data;l.current&&v===e&&b&&(Ne.error(b),s==null||s())});return L.useEffect(()=>(window.addEventListener("message",g),()=>{window.removeEventListener("message",g)}),[g]),f}function Tt({connectedStore:e,sx:n,...s}){return t.jsx(uo,{sx:{width:24,height:24,...n},src:Pe(e.storeUrl,`/.well-known/service/user/avatar/${e.developerDid}?imageFilter=resize&w=120&h=120`),...s})}Tt.propTypes={connectedStore:P.object.isRequired,sx:P.object};Tt.defaultProps={sx:{}};function Gr({storeUrl:e,storeName:n,developerDid:s,published:l}){const{t:p}=We(),f=()=>{if(s){const g=br.from(JSON.stringify({forceConnected:s}),"utf8").toString("base64");window.open(`${Pe(e,"developer/blocklets")}?__did-connect__=${g}`)}else window.open(`${Pe(e,"developer/blocklets")}`)};return t.jsxs(Y,{children:[t.jsx(X,{variant:"subtitle2",children:p(l?"blocklet.publish.publishToStoreSuccess":"blocklet.publish.uploadToStoreSuccess",{name:n})}),t.jsx(xe,{size:"small",sx:{mt:1},onClick:f,variant:"contained",color:"success",children:p("common.visitTarget",{name:n})})]})}Gr.propTypes={storeName:P.string.isRequired,storeUrl:P.string.isRequired,developerDid:P.string.isRequired,published:P.bool.isRequired};const Xr={CONNECT:"connect",SELECT:"select"},ms=Ot(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),gs=Io(({className:e,...n})=>t.jsx(fr,{...n,classes:{popper:e}}))(({theme:e})=>({[`& .${ho.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:e.spacing(2),fontSize:e.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function Yr({teamDid:e,projectId:n,releaseId:s,store:l,onDelete:p,kind:f,published:g,connectedStore:d,releaseType:v,onPublish:b,onOpenConnectStore:h,onSelectConnectStore:S,behavior:k,scope:x=""}){const w=ms(),{t:_}=We(),{api:I,info:C,inService:W}=on(),[D,$]=L.useState(!1),Q=fs({messageType:"connect-store-message",onOpen:()=>$(!0),onClose:()=>$(!1)}),ee=f==="publish",U=!!d,le=ae=>{if(ae.stopPropagation(),ee){window.open(Pe(l.url,"developer/blocklets"));return}window.open(l.url)},ve=()=>{if(k===Xr.SELECT){S(l);return}Q(async(ae,ye)=>{try{const R=await I.connectToStore({input:{did:e,storeUrl:l.url,storeId:l.id,storeName:l.name,projectId:n}});if(!(R!=null&&R.url)){Ne.error("failed to connect to store");return}ye(R.url),await h({did:e,projectId:n,storeId:l.id}),$(!1)}catch(R){const V=lt(R);Ne.error(V),$(!1)}})},ke=async()=>{try{await I.disconnectFromStore({input:{did:e,storeId:l.id,projectId:n,storeScope:x}}),p()}catch(ae){Ne.error(lt(ae))}},je=()=>{$(!0),I.publishToStore({input:{did:e,storeId:l.id,storeName:l.name,projectId:n,releaseId:s,type:v}}).then(ae=>{Ne.success(t.jsx(Gr,{storeName:d.storeName,storeUrl:d.storeUrl,developerDid:d.developerDid,published:ae.url==="published"}),{duration:1e4}),b==null||b(null)}).catch(ae=>{Ne.error(lt(ae)),b==null||b(ae)}).finally(()=>{$(!1)})};L.useEffect(()=>{U&&$(!1)},[U]);const Te=L.useMemo(()=>!(W&&cs.isInServerlessMode(C)),[W,C]);return t.jsxs("div",{className:w.box,children:[!ee&&D&&t.jsx(Ee,{sx:{marginRight:2},size:16}),t.jsxs("div",{className:w.menuName,children:[t.jsx(Y,{sx:{display:"flex",flexDirection:"row"},children:t.jsx(X,{component:"span",className:w.title,variant:"subtitle1",children:l.name})}),t.jsx(X,{className:w.url,component:"span",variant:"inherit",children:`${l.url}`})]}),t.jsxs("div",{className:w.actions,children:[d&&t.jsx(gs,{placement:"top",title:t.jsxs(Y,{children:[t.jsx(X,{component:"span",variant:"caption",sx:{opacity:.7},children:_("blocklet.publish.developerInfo")}),t.jsxs(Y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[t.jsx(Tt,{connectedStore:d,sx:{width:42,height:42}}),t.jsxs(Y,{sx:{flex:1},children:[t.jsx(X,{component:"span",variant:"subtitle1",children:d.developerName}),t.jsx(po,{size:14,copyable:!0,compact:!0,responsive:!1,did:d.developerDid})]})]})]}),children:t.jsx("div",{children:t.jsx(Tt,{connectedStore:d,sx:{marginRight:1,cursor:"help"}})})}),ee&&t.jsxs(Yn,{disabled:D,variant:"outlined",sx:{height:38},size:"small",children:[!U&&t.jsxs(xe,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:ve,children:[D?t.jsx(Ee,{sx:{marginRight:1},size:16}):t.jsx(Hr,{sx:{marginRight:1}}),_("common.connect")]}),U&&g&&t.jsxs(xe,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[D?t.jsx(Ee,{sx:{marginRight:1},size:16}):t.jsx(xo,{sx:{marginRight:1}}),_("common.uploaded")]}),U&&!g&&t.jsxs(xe,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:je,children:[D?t.jsx(Ee,{sx:{marginRight:1},size:16}):t.jsx(qr,{sx:{marginRight:1,fontSize:20}}),_("common.upload")]}),t.jsx(gn,{projectId:n,connectedStore:d,store:l,onDelete:p,teamDid:e,onDisconnect:ke})]}),!ee&&t.jsxs(Yn,{disabled:D,variant:"outlined",sx:{height:36},size:"small",children:[t.jsx(xe,{onClick:le,children:t.jsx(xr,{sx:{zoom:.9}})}),!l.protected&&Te&&t.jsx(_t,{store:l,onDelete:p,teamDid:e,scope:""})]})]})]})}Yr.propTypes={kind:P.string,teamDid:P.string.isRequired,published:P.bool,connectedStore:P.shape({storeName:P.string,storeId:P.string,storeUrl:P.string,developerDid:P.string,developerName:P.string}),projectId:P.string,releaseId:P.string,releaseType:P.string,store:P.shape({id:P.string.isRequired,name:P.string.isRequired,url:P.string.isRequired,protected:P.bool,connected:P.bool}).isRequired,scope:P.string,onDelete:P.func,onPublish:P.func,onOpenConnectStore:P.func,behavior:P.string,onSelectConnectStore:P.func};Yr.defaultProps={kind:"store",published:!1,connectedStore:null,releaseId:"",projectId:"",releaseType:"",scope:"",behavior:Xr.CONNECT,onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{}};export{Ws as A,Ar as B,es as C,Ns as S,Bs as a,Wr as b,As as c,Yr as d,Ur as e,zs as f,cs as s};
|
|
231
|
+
`;function Ar({title:e,did:n,description:s,cover:l,version:p,button:f,buttonText:g,buttonDisabled:d,buttonLoading:v,onButtonClick:b,onMainClick:h,className:S,...k}){const x=(M,$=()=>!1)=>(Q,...ee)=>{$()?(Q.preventDefault(),Q.stopPropagation()):M instanceof Function&&(Q.preventDefault(),Q.stopPropagation(),M(...ee))},w=x(b,()=>!!(f||d||v)),_=Qe(),I=Fe(_.breakpoints.up("sm")),C=x(h),B=I?80:64;return t.jsx(qa,{className:`${S} arcblock-blocklet`,...k,children:t.jsxs("div",{className:"arcblock-blocklet__content",onClick:C,children:[l?t.jsx("div",{className:"arcblock-blocklet__cover",children:t.jsx(Ji,{src:l})}):n&&t.jsx("div",{className:"arcblock-blocklet__cover",children:t.jsx(rn,{did:n,size:B})}),t.jsxs("div",{className:"arcblock-blocklet__info",children:[t.jsxs("div",{className:"arcblock-blocklet__text",children:[D.isValidElement(e)?t.jsx(X,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",children:e}):t.jsx(X,{component:"h3",variant:"h3",className:"arcblock-blocklet__title",title:or(e),dangerouslySetInnerHTML:{__html:e}}),D.isValidElement(s)?t.jsx(X,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",children:s}):t.jsx(X,{component:"div",variant:"body2",className:"arcblock-blocklet__describe",title:or(s),dangerouslySetInnerHTML:{__html:s}})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",marginTop:"10px",flexFlow:"wrap"},children:[t.jsx("div",{onClick:w,style:{marginRight:"12px"},children:f||b&&t.jsxs(kt,{className:"arcblock-blocklet__button--hover",variant:"outlined",color:"primary",size:"small",disabled:d||v,style:{padding:"3px 6px",fontSize:"14px",minWidth:"92px",textAlign:"center"},children:[v&&t.jsx(Ee,{size:15,style:{marginRight:3,color:"inherit"}}),g]})}),t.jsx("div",{className:"arcblock-blocklet__version",children:p&&`v${p}`})]})]})]})})}Ar.propTypes={title:P.string||P.node,did:P.string,description:P.string||P.node,cover:P.string,buttonText:P.string,buttonDisabled:P.bool,buttonLoading:P.bool,button:P.element,version:P.string,onButtonClick:P.func,onMainClick:P.func,className:P.string};Ar.defaultProps={title:"",description:"",cover:null,did:null,buttonText:"Install",buttonDisabled:!1,buttonLoading:!1,button:null,version:null,onButtonClick:null,onMainClick:null,className:null};var dn={},Va=Ye;Object.defineProperty(dn,"__esModule",{value:!0});var $r=dn.default=void 0,Ga=Va(Xe()),Xa=t;$r=dn.default=(0,Ga.default)((0,Xa.jsx)("path",{d:"M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2M1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2"}),"ShoppingCart");var hn={},Ya=Ye;Object.defineProperty(hn,"__esModule",{value:!0});var Kr=hn.default=void 0,Qa=Ya(Xe()),Ja=t;Kr=hn.default=(0,Qa.default)((0,Ja.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"}),"VerifiedUser");const As={meta:P.object.isRequired,onCancel:P.func.isRequired},Za=Ot(()=>({dialogAuth:{padding:"0 0 24px !important","& .auth-title":{textAlign:"center !important",marginBottom:"4px !important"},"& .auth-tip--scan":{textAlign:"center !important"}},iconRoot:{minWidth:48}}));function es({action:e,onSelect:n,onNext:s}){const l=Za(),{t:p}=We(),f=[{action:"purchase",title:p("store.purchase.purchase.title"),description:p("store.purchase.purchase.description")},{action:"verify",title:p("store.purchase.verify.title"),description:p("store.purchase.verify.description")}];return t.jsxs(t.Fragment,{children:[t.jsx(Zi,{className:l.tabPanel,children:f.map(g=>t.jsxs(mr,{button:!0,selected:e===g.action,onClick:()=>n(g.action),children:[t.jsx(eo,{className:l.iconRoot,children:g.action==="purchase"?t.jsx($r,{style:{color:e==="purchase"?Gn.primary.main:"#AAA",fontSize:32}}):t.jsx(Kr,{style:{color:e==="verify"?Gn.primary.main:"#AAA",fontSize:32}})}),t.jsx(to,{primary:g.title,secondary:g.description})]},g.action))}),s&&t.jsx(kt,{fullWidth:!0,disabled:!e,variant:"contained",color:"primary",style:{marginTop:16},onClick:s,children:p("common.next")})]})}es.propTypes={action:P.oneOf(["both","purchase","verify"]).isRequired,onSelect:P.func.isRequired,onNext:P.func.isRequired};const ts=Ot(e=>({addMenuItemRoot:{marginTop:"8px",justifyContent:"center",color:e.palette.primary.main,lineHeight:"3.2"}}));function Ur({disabled:e,storeList:n,teamDid:s,onAdd:l,scope:p,hiddenChildren:f,open:g,onClose:d}){const{api:v}=on(),[b,h]=D.useState(!1),[S,k]=D.useState(!0),[x,w]=D.useState(!1),[_,I]=D.useState(""),[C,B]=D.useState(""),{t:M}=We(),$=ts(),Q=async()=>{h(!0);try{const{decoded:U}=oo(_,n);await v.addBlockletStore({input:{teamDid:s,url:U,scope:p}}),l(U),w(!1),d()}catch(U){const le=`${M("store.blockletRegistry.addFailed")} ${lt(U)}`;B(le)}finally{h(!1)}},ee=()=>{w(!1),d()};return t.jsxs(t.Fragment,{children:[!f&&t.jsxs(mr,{button:!0,disabled:e,className:$.addMenuItemRoot,onClick:()=>{w(!0)},children:[t.jsx(yo,{font:!0}),t.jsx(X,{variant:"inherit",children:M("store.blockletRegistry.addRegistry")})]}),t.jsxs(no,{title:M("store.blockletRegistry.addRegistry"),fullWidth:!0,maxWidth:"md",open:g||x,onClose:ee,PaperProps:{style:{minHeight:"auto"}},actions:t.jsxs(t.Fragment,{children:[t.jsx(kt,{onClick:U=>{U.stopPropagation(),ee()},color:"inherit",children:M("common.cancel")}),t.jsxs(kt,{onClick:U=>{U.stopPropagation(),Q()},color:"primary","data-cy":"install-blocklet-next-step",disabled:b||!_||S,variant:"contained",autoFocus:!0,children:[b&&t.jsx(Ee,{size:16}),M("common.confirm")]})]}),children:[t.jsx("div",{style:{paddingTop:12,overflowY:"hidden"},children:t.jsx(ro,{component:"div",children:t.jsx(X,{component:"div",children:t.jsx(yr,{label:M("store.blockletRegistry.registryUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"add-blocklet-store-url",fullWidth:!0,value:_,onChange:U=>{B(null);let le=!1;U.target.value.trim()||(le=!0),U.target.value.trim()||B(M("store.blockletRegistry.registryUrlEmpty")),I(U.target.value),k(le)},disabled:b,onKeyPress:U=>{U.key==="Enter"&&(U.preventDefault(),U.target.value.trim()?Q():B(M("store.blockletRegistry.registryUrlEmpty")))}})})})}),!!C&&t.jsx(io,{severity:"error",style:{width:"100%"},children:C})]})]})}Ur.propTypes={teamDid:P.string.isRequired,disabled:P.bool,storeList:P.array,onAdd:P.func,scope:P.string,hiddenChildren:P.bool,open:P.bool,onClose:P.func};Ur.defaultProps={disabled:!1,storeList:[],onAdd:()=>{},scope:"",hiddenChildren:!1,open:!1,onClose:()=>{}};var pn={},ns=Ye;Object.defineProperty(pn,"__esModule",{value:!0});var Hr=pn.default=void 0,rs=ns(Xe()),is=t;Hr=pn.default=(0,rs.default)((0,is.jsx)("path",{d:"M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5m-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4zm-3-4h8v2H8z"}),"LinkOutlined");var fn={},os=Ye;Object.defineProperty(fn,"__esModule",{value:!0});var qr=fn.default=void 0,as=os(Xe()),ss=t;qr=fn.default=(0,as.default)((0,ss.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3M8 13h2.55v3h2.9v-3H16l-4-4z"}),"BackupOutlined");const{NODE_MODES:ar}=gr,ls=({mode:e,previousMode:n}={})=>e===ar.SERVERLESS||n===ar.SERVERLESS;var cs={isInServerlessMode:ls};function _t({store:e,teamDid:n,onDelete:s,children:l,projectId:p="",scope:f=""}){const{api:g}=on(),{t:d}=We(),v=So(),[b,h]=D.useState(!1),[S,k]=D.useState(null),x=Qe(),w=()=>{h(!1),k(null)},_=async()=>{var B;try{h(!0),await g.deleteBlockletStore({input:{teamDid:n,url:e.url,projectId:p,scope:f}}),await((B=v==null?void 0:v.actions)==null?void 0:B.refreshBlocklet()),s&&typeof s=="function"&&s()}catch(M){Ne.error(`Remove Blocklet Store Error: ${lt(M)}`)}finally{h(!1),k(null)}},I={keyName:e.url,title:d("store.blockletRegistry.deleteRegistry"),description:d("store.blockletRegistry.deleteDesc",{name:`<b>${e.url}</b>`,color:x.palette.error.main}),confirmPlaceholder:d("store.blockletRegistry.confirmDesc",{name:e.url}),confirm:d("common.delConfirm"),cancel:d("common.cancel"),onConfirm:_,onCancel:w},C=B=>{e.protected||(B.stopPropagation(),k(I))};return t.jsxs(t.Fragment,{children:[l?t.jsx("span",{onClick:C,children:l}):t.jsx(xe,{"data-cy":"store-action-delete",color:"primary",disabled:b,onClick:C,size:"small",children:t.jsx(wr,{sx:{zoom:.95}})}),S&&t.jsx(wo,{keyName:S.keyName,title:S.title,description:S.description,confirmPlaceholder:S.confirmPlaceholder,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]})}_t.propTypes={children:P.node,teamDid:P.string.isRequired,store:P.object.isRequired,onDelete:P.func,projectId:P.string,scope:P.string};_t.defaultProps={children:null,projectId:"",scope:"",onDelete:()=>{}};var mn={},us=Ye;Object.defineProperty(mn,"__esModule",{value:!0});var Vr=mn.default=void 0,ds=us(Xe()),hs=t;Vr=mn.default=(0,ds.default)((0,hs.jsx)("path",{d:"M17 7h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1 0 1.43-.98 2.63-2.31 2.98l1.46 1.46C20.88 15.61 22 13.95 22 12c0-2.76-2.24-5-5-5m-1 4h-2.19l2 2H16zM2 4.27l3.11 3.11C3.29 8.12 2 9.91 2 12c0 2.76 2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1 0-1.59 1.21-2.9 2.76-3.07L8.73 11H8v2h2.73L13 15.27V17h1.73l4.01 4L20 19.74 3.27 3z"}),"LinkOff");const ps=({store:e,userDid:n})=>{var l;const s=((l=window.blocklet)==null?void 0:l.tenantMode)!==ao.BLOCKLET_TENANT_MODES.MULTIPLE;return e.protected?!1:e.scope&&e.scope===n?!0:s?e.scope==="studio":!1};function gn({connectedStore:e,onDisconnect:n,onDelete:s,store:l,teamDid:p,projectId:f}){var B;const[g,d]=D.useState(null),v=!!g,{t:b}=We(),{session:h}=so(),[S,k]=D.useState(!1),x=M=>{if(M.stopPropagation(),e!=null&&e.developerDid){const $=br.from(JSON.stringify({forceConnected:e==null?void 0:e.developerDid}),"utf8").toString("base64");window.open(`${Pe(l.url,"developer/blocklets")}?__did-connect__=${$}`)}else window.open(`${Pe(l.url,"developer/blocklets")}`)},w=M=>{d(M.currentTarget)},_=()=>{d(null)},I=()=>{k(!1),n()},C=[{label:b("common.visitStore"),action:x,icon:xr},{label:b("common.disconnect"),action:()=>{_(),k(!0)},icon:Vr,hidden:!e}];return t.jsxs(t.Fragment,{children:[t.jsx(xe,{ref:g,color:"primary",onClick:w,size:"small",children:t.jsx(ko,{sx:{zoom:.95}})}),t.jsxs(lo,{anchorEl:g,open:v,onClose:_,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[C.map(M=>M.hidden?null:t.jsxs(St,{dense:!0,onClick:M.action,disabled:M.disabled,children:[M.icon&&t.jsx(M.icon,{color:"action",sx:{marginRight:1}}),t.jsx(Y,{color:"action",children:M.label})]},M.label)),ps({store:l,userDid:(B=h==null?void 0:h.user)==null?void 0:B.did})&&t.jsx(_t,{store:l,onDelete:s,teamDid:p,projectId:f,scope:l.scope||"studio",children:t.jsxs(St,{dense:!0,disabled:l.protected,children:[t.jsx(wr,{sx:{color:l.protected?"action":"error.main",marginRight:1}}),t.jsx(Y,{color:l.protected?"action":"error.main",children:b("common.delete")})]})})]}),S&&t.jsx(co,{displayError:!0,title:`${b("common.disconnect")} ${l.name}`,description:b("blocklet.publish.disconnectStoreTip"),confirm:b("common.confirm"),onConfirm:I,onCancel:()=>k(!1)})]})}gn.propTypes={connectedStore:P.object.isRequired,onDisconnect:P.func,onDelete:P.func,store:P.object.isRequired,teamDid:P.string.isRequired,projectId:P.string};gn.defaultProps={projectId:"",onDelete:()=>{},onDisconnect:()=>{}};function fs({messageType:e,onOpen:n,onClose:s}){const l=D.useRef(null),p=D.useRef(null),f=async d=>{setTimeout(()=>{try{s==null||s()}catch{}},10*1e3),l.current&&(clearInterval(p.current),l.current.close());const v=Math.random().toString(36).slice(2);l.current=window.open(`${gr.WELLKNOWN_SERVICE_PATH_PREFIX}/open-window?key=${v}`,"_blank"),n==null||n(l.current),p.current=setInterval(()=>{(!l.current||l.current.closed)&&(l.current=null,clearInterval(p.current),setTimeout(()=>{s==null||s()},1100))},200),await Promise.resolve(d(l.current,b=>{if(!l.current){localStorage.setItem(`open-window-url-${v}`,JSON.stringify({url:b,time:Date.now()}));return}l.current.location.href=b}))},g=st(d=>{const{type:v,error:b}=d.data;l.current&&v===e&&b&&(Ne.error(b),s==null||s())});return D.useEffect(()=>(window.addEventListener("message",g),()=>{window.removeEventListener("message",g)}),[g]),f}function Tt({connectedStore:e,sx:n,...s}){return t.jsx(uo,{sx:{width:24,height:24,...n},src:Pe(e.storeUrl,`/.well-known/service/user/avatar/${e.developerDid}?imageFilter=resize&w=120&h=120`),...s})}Tt.propTypes={connectedStore:P.object.isRequired,sx:P.object};Tt.defaultProps={sx:{}};function Gr({storeUrl:e,storeName:n,developerDid:s,published:l}){const{t:p}=We(),f=()=>{if(s){const g=br.from(JSON.stringify({forceConnected:s}),"utf8").toString("base64");window.open(`${Pe(e,"developer/blocklets")}?__did-connect__=${g}`)}else window.open(`${Pe(e,"developer/blocklets")}`)};return t.jsxs(Y,{children:[t.jsx(X,{variant:"subtitle2",children:p(l?"blocklet.publish.publishToStoreSuccess":"blocklet.publish.uploadToStoreSuccess",{name:n})}),t.jsx(xe,{size:"small",sx:{mt:1},onClick:f,variant:"contained",color:"success",children:p("common.visitTarget",{name:n})})]})}Gr.propTypes={storeName:P.string.isRequired,storeUrl:P.string.isRequired,developerDid:P.string.isRequired,published:P.bool.isRequired};const Xr={CONNECT:"connect",SELECT:"select"},ms=Ot(()=>({buttonText:{textTransform:"none !important"},iconRoot:{minWidth:24},box:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",overflow:"hidden",width:"100%"},menuName:{flexShrink:1,display:"flex",flexDirection:"column",overflow:"hidden",flex:1},actions:{flex:1,display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},title:{fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},url:{fontSize:14,opacity:.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},buttonLine:{height:"100%",width:"1px",backgroundColor:"#e0e0e0"}})),gs=Io(({className:e,...n})=>t.jsx(fr,{...n,classes:{popper:e}}))(({theme:e})=>({[`& .${ho.tooltip}`]:{backgroundColor:"#fff",color:"rgba(0, 0, 0, 0.87)",borderRadius:8,padding:e.spacing(2),fontSize:e.typography.pxToRem(12),border:"1px solid rgba(0,0,0,0.08)",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.05)"}}));function Yr({teamDid:e,projectId:n,releaseId:s,store:l,onDelete:p,kind:f,published:g,connectedStore:d,releaseType:v,onPublish:b,onOpenConnectStore:h,onSelectConnectStore:S,behavior:k,scope:x=""}){const w=ms(),{t:_}=We(),{api:I,info:C,inService:B}=on(),[M,$]=D.useState(!1),Q=fs({messageType:"connect-store-message",onOpen:()=>$(!0),onClose:()=>$(!1)}),ee=f==="publish",U=!!d,le=ae=>{if(ae.stopPropagation(),ee){window.open(Pe(l.url,"developer/blocklets"));return}window.open(l.url)},ve=()=>{if(k===Xr.SELECT){S(l);return}Q(async(ae,ye)=>{try{const R=await I.connectToStore({input:{did:e,storeUrl:l.url,storeId:l.id,storeName:l.name,projectId:n}});if(!(R!=null&&R.url)){Ne.error("failed to connect to store");return}ye(R.url),await h({did:e,projectId:n,storeId:l.id}),$(!1)}catch(R){const V=lt(R);Ne.error(V),$(!1)}})},ke=async()=>{try{await I.disconnectFromStore({input:{did:e,storeId:l.id,projectId:n,storeScope:x}}),p()}catch(ae){Ne.error(lt(ae))}},je=()=>{$(!0),I.publishToStore({input:{did:e,storeId:l.id,storeName:l.name,projectId:n,releaseId:s,type:v}}).then(ae=>{Ne.success(t.jsx(Gr,{storeName:d.storeName,storeUrl:d.storeUrl,developerDid:d.developerDid,published:ae.url==="published"}),{duration:1e4}),b==null||b(null)}).catch(ae=>{Ne.error(lt(ae)),b==null||b(ae)}).finally(()=>{$(!1)})};D.useEffect(()=>{U&&$(!1)},[U]);const Te=D.useMemo(()=>!(B&&cs.isInServerlessMode(C)),[B,C]);return t.jsxs("div",{className:w.box,children:[!ee&&M&&t.jsx(Ee,{sx:{marginRight:2},size:16}),t.jsxs("div",{className:w.menuName,children:[t.jsx(Y,{sx:{display:"flex",flexDirection:"row"},children:t.jsx(X,{component:"span",className:w.title,variant:"subtitle1",children:l.name})}),t.jsx(X,{className:w.url,component:"span",variant:"inherit",children:`${l.url}`})]}),t.jsxs("div",{className:w.actions,children:[d&&t.jsx(gs,{placement:"top",title:t.jsxs(Y,{children:[t.jsx(X,{component:"span",variant:"caption",sx:{opacity:.7},children:_("blocklet.publish.developerInfo")}),t.jsxs(Y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:1,mt:1},children:[t.jsx(Tt,{connectedStore:d,sx:{width:42,height:42}}),t.jsxs(Y,{sx:{flex:1},children:[t.jsx(X,{component:"span",variant:"subtitle1",children:d.developerName}),t.jsx(po,{size:14,copyable:!0,compact:!0,responsive:!1,did:d.developerDid})]})]})]}),children:t.jsx("div",{children:t.jsx(Tt,{connectedStore:d,sx:{marginRight:1,cursor:"help"}})})}),ee&&t.jsxs(Yn,{disabled:M,variant:"outlined",sx:{height:38},size:"small",children:[!U&&t.jsxs(xe,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:ve,children:[M?t.jsx(Ee,{sx:{marginRight:1},size:16}):t.jsx(Hr,{sx:{marginRight:1}}),_("common.connect")]}),U&&g&&t.jsxs(xe,{disabled:!0,sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},children:[M?t.jsx(Ee,{sx:{marginRight:1},size:16}):t.jsx(xo,{sx:{marginRight:1}}),_("common.uploaded")]}),U&&!g&&t.jsxs(xe,{sx:{paddingLeft:2,paddingRight:2,fontSize:15,width:130},onClick:je,children:[M?t.jsx(Ee,{sx:{marginRight:1},size:16}):t.jsx(qr,{sx:{marginRight:1,fontSize:20}}),_("common.upload")]}),t.jsx(gn,{projectId:n,connectedStore:d,store:l,onDelete:p,teamDid:e,onDisconnect:ke})]}),!ee&&t.jsxs(Yn,{disabled:M,variant:"outlined",sx:{height:36},size:"small",children:[t.jsx(xe,{"data-cy":"store-open-url",onClick:le,children:t.jsx(xr,{sx:{zoom:.9}})}),!l.protected&&Te&&t.jsx(_t,{store:l,onDelete:p,teamDid:e,scope:""})]})]})]})}Yr.propTypes={kind:P.string,teamDid:P.string.isRequired,published:P.bool,connectedStore:P.shape({storeName:P.string,storeId:P.string,storeUrl:P.string,developerDid:P.string,developerName:P.string}),projectId:P.string,releaseId:P.string,releaseType:P.string,store:P.shape({id:P.string.isRequired,name:P.string.isRequired,url:P.string.isRequired,protected:P.bool,connected:P.bool}).isRequired,scope:P.string,onDelete:P.func,onPublish:P.func,onOpenConnectStore:P.func,behavior:P.string,onSelectConnectStore:P.func};Yr.defaultProps={kind:"store",published:!1,connectedStore:null,releaseId:"",projectId:"",releaseType:"",scope:"",behavior:Xr.CONNECT,onPublish:()=>{},onDelete:()=>{},onOpenConnectStore:()=>{},onSelectConnectStore:()=>{}};export{Ws as A,Ar as B,es as C,Ns as S,Bs as a,Wr as b,As as c,Yr as d,Ur as e,zs as f,cs as s};
|