@abtnode/blocklet-services 1.16.42-beta-20250408-050422-92c8eef3 → 1.16.42-beta-20250408-072924-4b6a877a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{access-control-Bp6fLweq.js → access-control-BCncVk0F.js} +1 -1
- package/dist/assets/{add-component-core-e0A2r7mm.js → add-component-core-DmGxO5Gt.js} +15 -14
- package/dist/assets/{add-resource-tZ8OPVzc.js → add-resource-CJU0s3QQ.js} +1 -1
- package/dist/assets/{advanced-vuRNp9gZ.js → advanced-0AsHuHlx.js} +1 -1
- package/dist/assets/{appearance-CFcde0Qw.js → appearance-Bw3QRuyJ.js} +1 -1
- package/dist/assets/{audit-logs-C51Acdy3.js → audit-logs-7qd9PUxe.js} +1 -1
- package/dist/assets/{branding-PF95Dp3j.js → branding-BZ7cTCXC.js} +2 -2
- package/dist/assets/{branding-B4OmIbxT.js → branding-NhPjoLxG.js} +1 -1
- package/dist/assets/{bundle-avatar-xyEwd0kl.js → bundle-avatar-Ue_TyBqv.js} +1 -1
- package/dist/assets/{complete-BnqT6D6R.js → complete-Tyckm-4M.js} +1 -1
- package/dist/assets/{component-BbpzttYw.js → component-D1Fsjeuf.js} +1 -1
- package/dist/assets/{config-BRGxJ2eh.js → config-DoKTS37s.js} +1 -1
- package/dist/assets/{config-navigation-Bp_tpZTf.js → config-navigation-DO0UJG5K.js} +3 -3
- package/dist/assets/{config-space-DLpGXOv3.js → config-space-BNW8EpAm.js} +1 -1
- package/dist/assets/{confirm-DMfA-cen.js → confirm-C-7TGRgW.js} +1 -1
- package/dist/assets/{connect-DrhKSeJG.js → connect-BLlTMxXk.js} +1 -1
- package/dist/assets/{connect-BbnPPMBE.js → connect-ZYp_tU0D.js} +1 -1
- package/dist/assets/{connect-to-BWtx4RxY.js → connect-to-h4a_nz1y.js} +1 -1
- package/dist/assets/{dashboard-D1IAu0pg.js → dashboard-B9esZ0M-.js} +3 -3
- package/dist/assets/{delete-confirm-BOPmqCDE.js → delete-confirm-C_4zg33B.js} +1 -1
- package/dist/assets/{domain-C058D5cL.js → domain-3zeLA-KU.js} +1 -1
- package/dist/assets/{domain-action-card-hJylsZDf.js → domain-action-card-BQASO--e.js} +1 -1
- package/dist/assets/{domains-CHSNHTzm.js → domains-DTccX50O.js} +1 -1
- package/dist/assets/{email-DTd5dLMw.js → email-hHeKrz9y.js} +1 -1
- package/dist/assets/{exchange-passport-CUoEzJAn.js → exchange-passport-Bt6kGDIV.js} +1 -1
- package/dist/assets/{fuel-D1-QzTfA.js → fuel-CDRdGVHi.js} +1 -1
- package/dist/assets/{index-Bn6qMcz9.js → index-BKSHPTts.js} +1 -1
- package/dist/assets/{index-DUqEJSX8.js → index-BnqjZUkY.js} +1 -1
- package/dist/assets/{index-Bcipz7Xh.js → index-Br2EGTW4.js} +1 -1
- package/dist/assets/{index-Bgbz960f.js → index-BvyKTiWe.js} +1 -1
- package/dist/assets/{index-Dja0MgHa.js → index-BvyQFiS_.js} +3 -3
- package/dist/assets/{index-DvX6CH9d.js → index-C07T63uR.js} +1 -1
- package/dist/assets/{index-Tc7h84RU.js → index-C7X4Y3ad.js} +1 -1
- package/dist/assets/{index-DOTrxWIb.js → index-Cc1EUVvj.js} +1 -1
- package/dist/assets/{index-r4W5xGua.js → index-CfxqxAZd.js} +1 -1
- package/dist/assets/{index-DY7FozBP.js → index-CgA3yF4z.js} +1 -1
- package/dist/assets/{index-BQddb9SV.js → index-D1iI5v2e.js} +4 -4
- package/dist/assets/{index-BmIHv0Ao.js → index-IaaNyqXG.js} +1 -1
- package/dist/assets/{index-Biod65HH.js → index-IqOEMaG7.js} +1 -1
- package/dist/assets/{index--QvOAcHK.js → index-_IytyGrM.js} +22 -20
- package/dist/assets/{index-COXsk6dn.js → index-njqCeZqY.js} +1 -1
- package/dist/assets/{invitation-CLrDi0w3.js → invitation-CXLQmmNG.js} +1 -1
- package/dist/assets/{invite-BlqLHSHA.js → invite-BZt83O3H.js} +1 -1
- package/dist/assets/{issue-passport-0xgFeiRm.js → issue-passport-CrCyp4XY.js} +1 -1
- package/dist/assets/{item-DFeRxihy.js → item-BMOFJ72c.js} +1 -1
- package/dist/assets/{layout-BQ9Qhixa.js → layout-DdaOYlXg.js} +1 -1
- package/dist/assets/{list-BO1EU3G2.js → list-Df4vHNiY.js} +1 -1
- package/dist/assets/{log-Qir3lxDV.js → log-B1ojA9lx.js} +1 -1
- package/dist/assets/{login-C780ZUv4.js → login-BkqQC8IM.js} +1 -1
- package/dist/assets/{logo-uploader-gCM0_9lk.js → logo-uploader-D6hawLMA.js} +2 -2
- package/dist/assets/{lost-passport-ieF1z1Fq.js → lost-passport-CnWrxxcj.js} +1 -1
- package/dist/assets/{overview-CqE5Qd7t.js → overview-vOO_cwfO.js} +1 -1
- package/dist/assets/{publish-resource-BFGnGhHk.js → publish-resource-OeE_Sv8p.js} +1 -1
- package/dist/assets/{relative-time-BUHtgSDe.js → relative-time-BnXa0sIK.js} +1 -1
- package/dist/assets/{runtime-B5YY9Qgr.js → runtime-DmT1MY2S.js} +1 -1
- package/dist/assets/{security-Dad28Y4W.js → security-CQrJSvNH.js} +1 -1
- package/dist/assets/{setup-DEJbIHrj.js → setup-CH6etNsI.js} +3 -3
- package/dist/assets/{spaces-CcqmBId2.js → spaces-BBAv0vs3.js} +1 -1
- package/dist/assets/{start-9UMY8DNC.js → start-BC37Pmt4.js} +1 -1
- package/dist/assets/{status-BFrUchan.js → status-Dz-0ViGp.js} +1 -1
- package/dist/assets/{step-actions-DZ9FTtHm.js → step-actions-BIyonirh.js} +1 -1
- package/dist/assets/{traffic-DPZuINtB.js → traffic-D72BUoUS.js} +1 -1
- package/dist/assets/{transfer-PY0D3H2H.js → transfer-DCQoefO3.js} +1 -1
- package/dist/assets/{unsubscribe-B3uFNG06.js → unsubscribe-DiXKNJyN.js} +1 -1
- package/dist/assets/{user-center-C2i8ji9Q.js → user-center-BjZ6YsoY.js} +1 -1
- package/dist/assets/{util-BL-qFiRh.js → util-CllYCEyt.js} +1 -1
- package/dist/assets/{wrap-locale-BFOSjPWa.js → wrap-locale-Bn6cqCkC.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +33 -33
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a2 as Il,j as o,E as N,a3 as xt,aa as He,a4 as Y,T as ge,t as qt,bp as Ei,bM as Si,I as ks,bD as Os,bU as Is,z as Cs,bg as Cl,b4 as Rs,bn as Rl,M as Tr,bw as Pl,bx as Ll,by as _l,bs as Nl,ad as Ps,L as Al,b3 as Dl,b1 as Ml,ak as Ti,a5 as Ls,a7 as Fl,ae as rt,e as Pn,bF as Bl,x as or,R as $l,W as _s,an as Ns,bP as As,ag as Ul,ab as zt,bf as jo,A as ko,$ as Wl,P as zl,G as ql,v as Kl,a0 as Vl,D as Gl,K as Oo}from"./vendor-mui-core-C-PhacC8.js";import{r as M,g as ji,f as Hl,k as Xl,a as ki,e as Se,b as Mt,l as Yl}from"./vendor-react-DoD83n6N.js";import{j as Ds,d as Ql,S as Jl,s as Ms,A as Zl}from"./item-
|
|
1
|
+
import{a2 as Il,j as o,E as N,a3 as xt,aa as He,a4 as Y,T as ge,t as qt,bp as Ei,bM as Si,I as ks,bD as Os,bU as Is,z as Cs,bg as Cl,b4 as Rs,bn as Rl,M as Tr,bw as Pl,bx as Ll,by as _l,bs as Nl,ad as Ps,L as Al,b3 as Dl,b1 as Ml,ak as Ti,a5 as Ls,a7 as Fl,ae as rt,e as Pn,bF as Bl,x as or,R as $l,W as _s,an as Ns,bP as As,ag as Ul,ab as zt,bf as jo,A as ko,$ as Wl,P as zl,G as ql,v as Kl,a0 as Vl,D as Gl,K as Oo}from"./vendor-mui-core-C-PhacC8.js";import{r as M,g as ji,f as Hl,k as Xl,a as ki,e as Se,b as Mt,l as Yl}from"./vendor-react-DoD83n6N.js";import{j as Ds,d as Ql,S as Jl,s as Ms,A as Zl}from"./item-BMOFJ72c.js";import{r as ec,B as dt,aj as Oi,P as Fs,m as Bs,u as gt,g as pt,aE as tc,aD as nc,ai as jr,a$ as rc,al as $s,bh as Io,ao as ic,V as Ii,C as oc,s as Vt,U as xr,av as Co,ae as Us,bi as gr,d as Ci,b4 as Ws,e as zs,X as sc,bj as ac,ah as oi,w as lc,bk as cc}from"./vendor-ux-did-connect-BQ3cvv_1.js";import{A as Ln,f as Dt,Z as uc,_ as dc,h as kt,$ as hc,E as fc,a0 as pc,a1 as mc,a2 as gc,D as kr,a3 as qs,X as vc,a4 as yc,a5 as bc,a6 as xc,a7 as cr,a8 as Ro,a9 as wc}from"./index-_IytyGrM.js";import{l as Po,n as Ec,E as Or,q as Sc,r as Tc,s as jc,L as kc,S as Oc}from"./vendor-arcblock-D8eCUoJY.js";import{L as Lo}from"./launch-result-message-DvcvHHH1.js";import{P as Ks}from"./page-header-D3dCkXy7.js";import{c as ut,p as Ic,B as Cc,D as _o,y as Zn,Y as Vs,a0 as Rc,ab as Pc,H as Lc,o as Mr,x as Ri,W as _c,ac as Nc,ad as Ac,ae as Dc,z as Hn,af as Mc,b as Fc}from"./vendor-utils-CRBr0QUY.js";import{u as Bc,C as $c}from"./config-space-BNW8EpAm.js";import{R as Fr}from"./logo-uploader-D6hawLMA.js";import{S as Uc}from"./index-IqOEMaG7.js";import{s as Gs,h as Wc,w as zc,f as qc,a as Kc,b as Vc,c as Gc,M as Hc}from"./index-CKv9guDo.js";import{m as sr,f as Xc,a as Yc,e as Hs,x as Qc}from"./vendor-hooks-DtYI0-rF.js";import{g as Jc}from"./get-safe-url-M62JolcK.js";import{p as Zc}from"./index-B9lZsGBd.js";import{r as eu}from"./cloneDeep-C7Ok409J.js";import{I as No}from"./index-CqRb1YIC.js";import{u as tu}from"./session-Clq9kJzg.js";import{W as nu}from"./did-address-_2BUka_2.js";import{_ as Xs}from"./useLocalStorage-C1_Fkr6_.js";import{f as Ys}from"./format-error-LAoTjvJe.js";import{a as Ao}from"./api-DlN8K5Jg.js";import{d as ru,a as iu,v as ou,e as su}from"./util-CllYCEyt.js";import{u as Qs}from"./use-mobile-DudfIz3d.js";import{C as au}from"./content-layout-uPtoKIAs.js";import{C as lu,D as cu,a as uu}from"./connect-to-h4a_nz1y.js";import{d as du}from"./ArrowDropDown-WXsjNpSB.js";import{d as hu}from"./ChevronLeft-DeulnkX8.js";import{d as fu}from"./ChevronRight-CACHNf5Y.js";const ug="blocklet-add-component-registry",dg="server-add-registry",hg=e=>`resource-${e}-add-registry`;var Pi={},pu=Il;Object.defineProperty(Pi,"__esModule",{value:!0});var Js=Pi.default=void 0,mu=pu(ec()),gu=o;Js=Pi.default=(0,mu.default)((0,gu.jsx)("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function Zs(e){const{info:t}=Ln();return M.useMemo(()=>{var n,r,i;return!e||!((n=e.docker)!=null&&n.image)||(r=e.docker)!=null&&r.image&&((i=e.docker)!=null&&i.runBaseScript)?!0:window.blocklet?window.blocklet.enableDocker&&window.blocklet.enableDockerNetwork:t.enableDocker&&t.enableDockerNetwork},[e,t])}function Li({disabled:e,children:t,onConfirm:n}){return M.useEffect(()=>{if(e)return()=>{};const r=i=>{i.code==="Enter"&&(i.metaKey===!0||i.ctrlKey===!0)&&(i.preventDefault(),i.stopPropagation(),n())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[e,n]),t}Li.propTypes={disabled:N.bool,children:N.any.isRequired,onConfirm:N.func.isRequired};Li.defaultProps={disabled:!1};function _i({onContinue:e,nextDisabled:t,launching:n,texts:r,description:i}){const[s,a]=M.useState(!1),c=()=>a(f=>!f);return o.jsxs(o.Fragment,{children:[o.jsx(vu,{children:o.jsxs(Li,{disabled:t,onConfirm:e,children:[o.jsx("div",{className:"eula-trigger",onClick:c,children:r.listenName}),o.jsx(dt,{disabled:t,color:"primary",variant:"contained",className:"next-button",onClick:e,children:n?o.jsxs(o.Fragment,{children:[o.jsx(xt,{size:14}),r.launchingText]}):r.buttonNext})]})}),o.jsx(Oi,{open:s,title:r.listenName,onClose:()=>a(!1),children:i})]})}_i.propTypes={onContinue:N.func.isRequired,nextDisabled:N.bool,launching:N.bool,description:N.any,texts:N.object};_i.defaultProps={nextDisabled:!1,launching:!1,description:"",texts:{listenName:"",launchingText:"",buttonNext:""}};const vu=He.div`
|
|
2
2
|
margin: 0 auto;
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -482,7 +482,8 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
482
482
|
color: ${e=>e.theme.palette.common.white}!important;
|
|
483
483
|
}
|
|
484
484
|
}
|
|
485
|
-
`;const ns=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Zh=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},qa={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function ui({title:e,sx:t,children:n,slotProps:r,fontSize:i=12,fontWeight:s=500,color:a="text.secondary",...c}){var f,v;return e?o.jsx(Ls,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Fl.tooltip}`]:{backgroundColor:"common.white",fontSize:i,fontWeight:s,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:a,display:"flex",alignItems:"center"}},...Array.isArray((f=r==null?void 0:r.popper)==null?void 0:f.sx)?r.popper.sx:[(v=r==null?void 0:r.popper)==null?void 0:v.sx]]}},children:n}):n}function ur({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(i)?i:[i]],children:[e,o.jsx(ui,{title:r||(typeof t=="string"?t:""),children:o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function ef(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:v="Install",buttonDisabled:l,buttonLoading:u,button:T,onButtonClick:y=()=>{},onMainClick:S,className:j,ref:_,icons:D,status:A,...B}=e,V=Pn(),I=(H,se=()=>!1)=>(je,...We)=>{const Me=H instanceof Function;(se()||Me)&&(je.preventDefault(),je.stopPropagation(),Me&&H(...We))},F=S&&I(S),G=I(y,()=>!!(T||l||u)),$=M.isValidElement(t)?{children:t}:{title:ns(t),dangerouslySetInnerHTML:{__html:t}},le=M.isValidElement(n)?{children:n}:{title:ns(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Bl,{variant:"outlined",onClick:F,...B,sx:{p:{xs:2,md:3},borderRadius:2,...B.sx},children:[o.jsxs(rt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(xr,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...$}),o.jsxs(Y,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[f&&o.jsx(ui,{title:f.tooltip,children:o.jsx(Ec,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),D==null?void 0:D.map(H=>o.jsx(ui,{title:H.title,children:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon,style:{color:H.color}}):H.icon},H.key))]}),y&&o.jsxs(dt,{color:"reverse",variant:"outlined",size:"small",disabled:l||u,style:{borderColor:V.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:V.typography.fontWeightMedium},onClick:G,children:[u&&o.jsx(xt,{size:15,style:{marginRight:3,color:"inherit"}}),v]}),T]}),o.jsx(rt,{py:2,children:o.jsx(ge,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...le})}),o.jsxs(rt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(ur,{icon:o.jsx(xr,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(ur,{icon:o.jsx(pt,{icon:qa}),title:a,children:Zh(a)}),A==null?void 0:A.filter(H=>H.align!=="right").map(H=>o.jsx(ur,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,children:H.text},H.key)),o.jsx(Y,{sx:{flex:1}}),A==null?void 0:A.filter(H=>H.align==="right").map(H=>o.jsx(ur,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,sx:{color:H.color},children:H.text},H.key))]})]})}const tf={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'},Qn=/^[a-z0-9]+(-[a-z0-9]+)*$/,_r=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),f=i.pop(),v={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!yr(v)?null:v}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!yr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!yr(c,n)?null:c}return null},yr=(e,t)=>e?!!((e.provider===""||e.provider.match(Qn))&&(t&&e.prefix===""||e.prefix.match(Qn))&&e.name.match(Qn)):!1,Ka=Object.freeze({left:0,top:0,width:16,height:16}),Er=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),lo=Object.freeze({...Ka,...Er}),di=Object.freeze({...lo,body:"",hidden:!1});function nf(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function rs(e,t){const n=nf(e,t);for(const r in di)r in Er?r in e&&!(r in n)&&(n[r]=Er[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function rf(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,f=c&&s(c);f&&(i[a]=[c].concat(f))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function of(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=rs(r[c]||i[c],s)}return a(t),n.forEach(a),rs(e,s)}function Va(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=rf(e);for(const i in r){const s=r[i];s&&(t(i,of(e,i,s)),n.push(i))}return n}const sf={provider:"",aliases:{},not_found:{},...Ka};function Kr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ga(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Kr(e,sf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Qn)||typeof s.body!="string"||!Kr(s,di))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(Qn)||typeof a!="string"||!n[a]&&!r[a]||!Kr(s,di))return null}return t}const is=Object.create(null);function af(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function vn(e,t){const n=is[e]||(is[e]=Object.create(null));return n[t]||(n[t]=af(e,t))}function co(e,t){return Ga(t)?Va(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function lf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let tr=!1;function Ha(e){return typeof e=="boolean"&&(tr=e),tr}function cf(e){const t=typeof e=="string"?_r(e,!0,tr):e;if(t){const n=vn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function uf(e,t){const n=_r(e,!0,tr);if(!n)return!1;const r=vn(n.provider,n.prefix);return lf(r,n.name,t)}function df(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),tr&&!t&&!e.prefix){let i=!1;return Ga(e)&&(e.prefix="",Va(e,(s,a)=>{a&&uf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!yr({provider:t,prefix:n,name:"a"}))return!1;const r=vn(t,n);return!!co(r,e)}const Xa=Object.freeze({width:null,height:null}),Ya=Object.freeze({...Xa,...Er}),hf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ff=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function os(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(hf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=ff.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}const pf=e=>e==="unset"||e==="undefined"||e==="none";function mf(e,t){const n={...lo,...e},r={...Ya,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(S=>{const j=[],_=S.hFlip,D=S.vFlip;let A=S.rotate;_?D?A+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):D&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let B;switch(A<0&&(A-=Math.floor(A/4)*4),A=A%4,A){case 1:B=i.height/2+i.top,j.unshift("rotate(90 "+B.toString()+" "+B.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:B=i.width/2+i.left,j.unshift("rotate(-90 "+B.toString()+" "+B.toString()+")");break}A%2===1&&(i.left!==i.top&&(B=i.left,i.left=i.top,i.top=B),i.width!==i.height&&(B=i.width,i.width=i.height,i.height=B)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,v=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?v:c,l=os(u,f/v)):(l=a==="auto"?f:a,u=c===null?os(l,v/f):c==="auto"?v:c);const T={},y=(S,j)=>{pf(j)||(T[S]=j.toString())};return y("width",l),y("height",u),T.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+v.toString(),{attributes:T,body:s}}const gf=/\sid="(\S+)"/g,vf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let yf=0;function bf(e,t=vf){const n=[];let r;for(;r=gf.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(yf++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const hi=Object.create(null);function xf(e,t){hi[e]=t}function fi(e){return hi[e]||hi[""]}function uo(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ho=Object.create(null),Vn=["https://api.simplesvg.com","https://api.unisvg.com"],br=[];for(;Vn.length>0;)Vn.length===1||Math.random()>.5?br.push(Vn.shift()):br.push(Vn.pop());ho[""]=uo({resources:["https://api.iconify.design"].concat(br)});function wf(e,t){const n=uo(t);return n===null?!1:(ho[e]=n,!0)}function fo(e){return ho[e]}const Ef=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ss=Ef();function Sf(e,t){const n=fo(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Tf(e){return e===404}const jf=(e,t,n)=>{const r=[],i=Sf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,v)=>{c+=f.length+1,c>=i&&v>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function kf(e){if(typeof e=="string"){const t=fo(e);if(t)return t.path}return"/"}const Of=(e,t,n)=>{if(!ss){n("abort",424);return}let r=kf(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),f=new URLSearchParams({icons:c});r+=s+".json?"+f.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;ss(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Tf(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},If={prepare:jf,send:Of};function Cf(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,f=n[s]||(n[s]=Object.create(null)),v=f[a]||(f[a]=vn(s,a));let l;c in v.icons?l=t.loaded:a===""||v.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Qa(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Rf(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(f=>{if(f.prefix!==i)return!0;const v=f.name;if(e.icons[v])a.loaded.push({provider:r,prefix:i,name:v});else if(e.missing.has(v))a.missing.push({provider:r,prefix:i,name:v});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Qa([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Pf=0;function Lf(e,t,n){const r=Pf++,i=Qa.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function _f(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?_r(i,t,n):i;s&&r.push(s)}),r}var Nf={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Af(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let F=e.resources.slice(0);for(a=[];F.length>1;){const G=Math.floor(Math.random()*F.length);a.push(F[G]),F=F.slice(0,G).concat(F.slice(G+1))}a=a.concat(F)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",v=0,l,u=null,T=[],y=[];typeof r=="function"&&y.push(r);function S(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),S(),T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function _(F,G){G&&(y=[]),typeof F=="function"&&y.push(F)}function D(){return{startTime:c,payload:t,status:f,queriesSent:v,queriesPending:T.length,subscribe:_,abort:j}}function A(){f="failed",y.forEach(F=>{F(void 0,l)})}function B(){T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function V(F,G,$){const le=G!=="success";switch(T=T.filter(H=>H!==F),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(G==="abort"){l=$,A();return}if(le){l=$,T.length||(a.length?I():A());return}if(S(),B(),!e.random){const H=e.resources.indexOf(F.resource);H!==-1&&H!==e.index&&(e.index=H)}f="completed",y.forEach(H=>{H($)})}function I(){if(f!=="pending")return;S();const F=a.shift();if(F===void 0){if(T.length){u=setTimeout(()=>{S(),f==="pending"&&(B(),A())},e.timeout);return}A();return}const G={status:"pending",resource:F,callback:($,le)=>{V(G,$,le)}};T.push(G),v++,u=setTimeout(I,e.rotate),n(F,t,G.callback)}return setTimeout(I),D}function Ja(e){const t={...Nf,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,v){const l=Af(t,c,f,(u,T)=>{r(),v&&v(u,T)});return n.push(l),l}function s(c){return n.find(f=>c(f))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function as(){}const Vr=Object.create(null);function Df(e){if(!Vr[e]){const t=fo(e);if(!t)return;const n=Ja(t),r={config:t,redundancy:n};Vr[e]=r}return Vr[e]}function Mf(e,t,n){let r,i;if(typeof e=="string"){const s=fi(e);if(!s)return n(void 0,424),as;i=s.send;const a=Df(e);a&&(r=a.redundancy)}else{const s=uo(e);if(s){r=Ja(s);const a=e.resources?e.resources[0]:"",c=fi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),as):r.query(t,i,n)().abort}const ls="iconify2",nr="iconify",Za=nr+"-count",cs=nr+"-version",el=36e5,Ff=168;function pi(e,t){try{return e.getItem(t)}catch{}}function po(e,t,n){try{return e.setItem(t,n),!0}catch{}}function us(e,t){try{e.removeItem(t)}catch{}}function mi(e,t){return po(e,Za,t.toString())}function gi(e){return parseInt(pi(e,Za))||0}const Nr={local:!0,session:!0},tl={local:new Set,session:new Set};let mo=!1;function Bf(e){mo=e}let dr=typeof window>"u"?{}:window;function nl(e){const t=e+"Storage";try{if(dr&&dr[t]&&typeof dr[t].length=="number")return dr[t]}catch{}Nr[e]=!1}function rl(e,t){const n=nl(e);if(!n)return;const r=pi(n,cs);if(r!==ls){if(r){const c=gi(n);for(let f=0;f<c;f++)us(n,nr+f.toString())}po(n,cs,ls),mi(n,0);return}const i=Math.floor(Date.now()/el)-Ff,s=c=>{const f=nr+c.toString(),v=pi(n,f);if(typeof v=="string"){try{const l=JSON.parse(v);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>i&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&t(l,c))return!0}catch{}us(n,f)}};let a=gi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,mi(n,a)):tl[e].add(c))}function il(){if(!mo){Bf(!0);for(const e in Nr)rl(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=vn(r,i);if(!co(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function $f(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Nr)rl(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Uf(e,t){mo||il();function n(r){let i;if(!Nr[r]||!(i=nl(r)))return;const s=tl[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=gi(i),!mi(i,a+1))return;const c={cached:Math.floor(Date.now()/el),provider:e.provider,data:t};return po(i,nr+a.toString(),JSON.stringify(c))}t.lastModified&&!$f(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function ds(){}function Wf(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Rf(e)}))}function zf(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=fi(n)))return;s.prepare(n,r,i).forEach(c=>{Mf(n,c,f=>{if(typeof f!="object")c.icons.forEach(v=>{e.missing.add(v)});else try{const v=co(e,f);if(!v.length)return;const l=e.pendingIcons;l&&v.forEach(u=>{l.delete(u)}),Uf(e,f)}catch(v){console.error(v)}Wf(e)})})}))}const qf=(e,t)=>{const n=_f(e,!0,Ha()),r=Cf(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,ds)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:v,prefix:l}=f;if(l===c&&v===a)return;a=v,c=l,s.push(vn(v,l));const u=i[v]||(i[v]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:v,prefix:l,name:u}=f,T=vn(v,l),y=T.pendingIcons||(T.pendingIcons=new Set);y.has(u)||(y.add(u),i[v][l].push(u))}),s.forEach(f=>{const{provider:v,prefix:l}=f;i[v][l].length&&zf(f,i[v][l])}),t?Lf(t,r,s):ds};function Kf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Xa?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Vf=/[\s,]+/;function Gf(e,t){t.split(Vf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Hf(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function Xf(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Yf(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Qf(e){return"data:image/svg+xml,"+Yf(e)}function Jf(e){return'url("'+Qf(e)+'")'}let Jn;function Zf(){try{Jn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Jn=null}}function ep(e){return Jn===void 0&&Zf(),Jn?Jn.createHTML(e):e}const ol={...Ya,inline:!1},tp={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},np={display:"inline-block"},vi={backgroundColor:"currentColor"},sl={backgroundColor:"transparent"},hs={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},fs={WebkitMask:vi,mask:vi,background:sl};for(const e in fs){const t=fs[e];for(const n in hs)t[e+n]=hs[n]}const rp={...ol,inline:!0};function ps(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const ip=(e,t,n,r)=>{const i=n?rp:ol,s=Kf(i,t),a=t.mode||"svg",c={},f=t.style||{},v={...a==="svg"?tp:{},ref:r};for(let D in t){const A=t[D];if(A!==void 0)switch(D){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[D]=A===!0||A==="true"||A===1;break;case"flip":typeof A=="string"&&Gf(s,A);break;case"color":c.color=A;break;case"rotate":typeof A=="string"?s[D]=Hf(A):typeof A=="number"&&(s[D]=A);break;case"ariaHidden":case"aria-hidden":A!==!0&&A!=="true"&&delete v["aria-hidden"];break;default:i[D]===void 0&&(v[D]=A)}}const l=mf(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){v.style={...c,...f},Object.assign(v,u);let D=0,A=t.id;return typeof A=="string"&&(A=A.replace(/-/g,"_")),v.dangerouslySetInnerHTML={__html:ep(bf(l.body,A?()=>A+"ID"+D++:"iconifyReact"))},Mt.createElement("svg",v)}const{body:T,width:y,height:S}=e,j=a==="mask"||(a==="bg"?!1:T.indexOf("currentColor")!==-1),_=Xf(T,{...u,width:y+"",height:S+""});return v.style={...c,"--svg":Jf(_),width:ps(u.width),height:ps(u.height),...np,...j?vi:sl,...f},Mt.createElement("span",v)};Ha(!0);xf("",If);if(typeof document<"u"&&typeof window<"u"){il();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!df(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;wf(n,i)||console.error(r)}catch{console.error(r)}}}}class al extends Mt.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||n.icon===null)&&this._setData({data:r});return}let i;if(typeof r!="string"||(i=_r(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=cf(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:qf([i],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const a=["iconify"];i.prefix!==""&&a.push("iconify--"+i.prefix),i.provider!==""&&a.push("iconify--"+i.provider),this._setData({data:s,classes:a}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,n=this.state.icon;if(n===null)return t.children?t.children:Mt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),ip({...lo,...n.data},r,t._inline,t._ref)}}const rr=Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Mt.createElement(al,r)});Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Mt.createElement(al,r)});var ll={exports:{}};(function(e,t){(function(n,r){e.exports=r(M)})(Se,n=>(()=>{var r={703:(c,f,v)=>{var l=v(414);function u(){}function T(){}T.resetWarningCache=u,c.exports=function(){function y(_,D,A,B,V,I){if(I!==l){var F=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}}function S(){return y}y.isRequired=y;var j={array:y,bool:y,func:y,number:y,object:y,string:y,symbol:y,any:y,arrayOf:S,element:y,elementType:y,instanceOf:S,node:y,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:T,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,v)=>{c.exports=v(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",v=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function T(y,S){if(y===S)return!0;if(y&&S&&typeof y=="object"&&typeof S=="object"){if(y.constructor!==S.constructor)return!1;var j,_,D,A;if(Array.isArray(y)){if((j=y.length)!=S.length)return!1;for(_=j;_--!=0;)if(!T(y[_],S[_]))return!1;return!0}if(v&&y instanceof Map&&S instanceof Map){if(y.size!==S.size)return!1;for(A=y.entries();!(_=A.next()).done;)if(!S.has(_.value[0]))return!1;for(A=y.entries();!(_=A.next()).done;)if(!T(_.value[1],S.get(_.value[0])))return!1;return!0}if(l&&y instanceof Set&&S instanceof Set){if(y.size!==S.size)return!1;for(A=y.entries();!(_=A.next()).done;)if(!S.has(_.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(S)){if((j=y.length)!=S.length)return!1;for(_=j;_--!=0;)if(y[_]!==S[_])return!1;return!0}if(y.constructor===RegExp)return y.source===S.source&&y.flags===S.flags;if(y.valueOf!==Object.prototype.valueOf)return y.valueOf()===S.valueOf();if(y.toString!==Object.prototype.toString)return y.toString()===S.toString();if((j=(D=Object.keys(y)).length)!==Object.keys(S).length)return!1;for(_=j;_--!=0;)if(!Object.prototype.hasOwnProperty.call(S,D[_]))return!1;if(f&&y instanceof Element)return!1;for(_=j;_--!=0;)if((D[_]!=="_owner"&&D[_]!=="__v"&&D[_]!=="__o"||!y.$$typeof)&&!T(y[D[_]],S[D[_]]))return!1;return!0}return y!=y&&S!=S}c.exports=function(y,S){try{return T(y,S)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var v=i[c]={exports:{}};return r[c](v,v.exports,s),v.exports}s.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return s.d(f,{a:f}),f},s.d=(c,f)=>{for(var v in f)s.o(f,v)&&!s.o(c,v)&&Object.defineProperty(c,v,{enumerable:!0,get:f[v]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),s.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};return(()=>{function c(b){var p,E,k="";if(typeof b=="string"||typeof b=="number")k+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(E=c(b[p]))&&(k&&(k+=" "),k+=E);else for(p in b)b[p]&&(k&&(k+=" "),k+=p);return k}function f(){for(var b,p,E=0,k="";E<arguments.length;)(b=arguments[E++])&&(p=c(b))&&(k&&(k+=" "),k+=p);return k}s.r(a),s.d(a,{default:()=>kl});var v=s(359),l=s.n(v);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},T=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var y=typeof self=="object"&&self&&self.Object===Object&&self;const S=T||y||Function("return this")(),j=function(){return S.Date.now()};var _=/\s/,D=/^\s+/;const A=function(b){return b&&b.slice(0,function(p){for(var E=p.length;E--&&_.test(p.charAt(E)););return E}(b)+1).replace(D,"")},B=S.Symbol;var V=Object.prototype,I=V.hasOwnProperty,F=V.toString,G=B?B.toStringTag:void 0,$=Object.prototype.toString,le=B?B.toStringTag:void 0;const H=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":le&&le in Object(b)?function(p){var E=I.call(p,G),k=p[G];try{p[G]=void 0;var q=!0}catch{}var re=F.call(p);return q&&(E?p[G]=k:delete p[G]),re}(b):function(p){return $.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,We=/^0o[0-7]+$/i,Me=parseInt;const Qe=function(b){if(typeof b=="number")return b;if(function(k){return typeof k=="symbol"||function(q){return q!=null&&typeof q=="object"}(k)&&H(k)=="[object Symbol]"}(b))return NaN;if(u(b)){var p=typeof b.valueOf=="function"?b.valueOf():b;b=u(p)?p+"":p}if(typeof b!="string")return b===0?b:+b;b=A(b);var E=je.test(b);return E||We.test(b)?Me(b.slice(2),E?2:8):se.test(b)?NaN:+b};var Z=Math.max,pe=Math.min;const ee=function(b,p,E){var k,q,re,me,g,m,C=0,U=!1,K=!1,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");function ue(ie){var fe=k,be=q;return k=q=void 0,C=ie,me=b.apply(be,fe)}function ce(ie){return C=ie,g=setTimeout(X,p),U?ue(ie):me}function he(ie){var fe=ie-m;return m===void 0||fe>=p||fe<0||K&&ie-C>=re}function X(){var ie=j();if(he(ie))return Q(ie);g=setTimeout(X,function(fe){var be=p-(fe-m);return K?pe(be,re-(fe-C)):be}(ie))}function Q(ie){return g=void 0,z&&k?ue(ie):(k=q=void 0,me)}function J(){var ie=j(),fe=he(ie);if(k=arguments,q=this,m=ie,fe){if(g===void 0)return ce(m);if(K)return clearTimeout(g),g=setTimeout(X,p),ue(m)}return g===void 0&&(g=setTimeout(X,p)),me}return p=Qe(p)||0,u(E)&&(U=!!E.leading,re=(K="maxWait"in E)?Z(Qe(E.maxWait)||0,p):re,z="trailing"in E?!!E.trailing:z),J.cancel=function(){g!==void 0&&clearTimeout(g),C=0,k=m=q=g=void 0},J.flush=function(){return g===void 0?me:Q(j())},J},ye=function(b,p,E){var k=!0,q=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(E)&&(k="leading"in E?!!E.leading:k,q="trailing"in E?!!E.trailing:q),ee(b,p,{leading:k,maxWait:p,trailing:q})};var oe=s(590),Ae=s.n(oe),we=function(){if(typeof Map<"u")return Map;function b(p,E){var k=-1;return p.some(function(q,re){return q[0]===E&&(k=re,!0)}),k}return function(){function p(){this.__entries__=[]}return Object.defineProperty(p.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),p.prototype.get=function(E){var k=b(this.__entries__,E),q=this.__entries__[k];return q&&q[1]},p.prototype.set=function(E,k){var q=b(this.__entries__,E);~q?this.__entries__[q][1]=k:this.__entries__.push([E,k])},p.prototype.delete=function(E){var k=this.__entries__,q=b(k,E);~q&&k.splice(q,1)},p.prototype.has=function(E){return!!~b(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,k){k===void 0&&(k=null);for(var q=0,re=this.__entries__;q<re.length;q++){var me=re[q];E.call(k,me[1],me[0])}},p}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,qe=s.g!==void 0&&s.g.Math===Math?s.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Gt=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(qe):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Ht=["top","right","bottom","left","width","height","size","weight"],Ft=typeof MutationObserver<"u",Xt=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var k=!1,q=!1,re=0;function me(){k&&(k=!1,p()),q&&m()}function g(){Gt(me)}function m(){var C=Date.now();if(k){if(C-re<2)return;q=!0}else k=!0,q=!1,setTimeout(g,20);re=C}return m}(this.refresh.bind(this))}return b.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},b.prototype.removeObserver=function(p){var E=this.observers_,k=E.indexOf(p);~k&&E.splice(k,1),!E.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var p=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return p.forEach(function(E){return E.broadcastActive()}),p.length>0},b.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ft?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){Je&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(p){var E=p.propertyName,k=E===void 0?"":E;Ht.some(function(q){return!!~k.indexOf(q)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Pe=function(b,p){for(var E=0,k=Object.keys(p);E<k.length;E++){var q=k[E];Object.defineProperty(b,q,{value:p[q],enumerable:!1,writable:!1,configurable:!0})}return b},Le=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||qe},Ze=ke(0,0,0,0);function de(b){return parseFloat(b)||0}function Yt(b){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(k,q){return k+de(b["border-"+q+"-width"])},0)}var Qt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof Le(b).SVGGraphicsElement}:function(b){return b instanceof Le(b).SVGElement&&typeof b.getBBox=="function"};function Jt(b){return Je?Qt(b)?function(p){var E=p.getBBox();return ke(0,0,E.width,E.height)}(b):function(p){var E=p.clientWidth,k=p.clientHeight;if(!E&&!k)return Ze;var q=Le(p).getComputedStyle(p),re=function(z){for(var ue={},ce=0,he=["top","right","bottom","left"];ce<he.length;ce++){var X=he[ce],Q=z["padding-"+X];ue[X]=de(Q)}return ue}(q),me=re.left+re.right,g=re.top+re.bottom,m=de(q.width),C=de(q.height);if(q.boxSizing==="border-box"&&(Math.round(m+me)!==E&&(m-=Yt(q,"left","right")+me),Math.round(C+g)!==k&&(C-=Yt(q,"top","bottom")+g)),!function(z){return z===Le(z).document.documentElement}(p)){var U=Math.round(m+me)-E,K=Math.round(C+g)-k;Math.abs(U)!==1&&(m-=U),Math.abs(K)!==1&&(C-=K)}return ke(re.left,re.top,m,C)}(b):Ze}function ke(b,p,E,k){return{x:b,y:p,width:E,height:k}}var Bt=function(){function b(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ke(0,0,0,0),this.target=p}return b.prototype.isActive=function(){var p=Jt(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},b}(),Nn=function(b,p){var E,k,q,re,me,g,m,C=(k=(E=p).x,q=E.y,re=E.width,me=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Pe(m,{x:k,y:q,width:re,height:me,top:q,right:k+re,bottom:me+q,left:k}),m);Pe(this,{target:b,contentRect:C})},et=function(){function b(p,E,k){if(this.activeObservations_=[],this.observations_=new we,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=k}return b.prototype.observe=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new Bt(p)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)&&(E.delete(p),E.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(k){return new Nn(k.target,k.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),Zt=typeof WeakMap<"u"?new WeakMap:new we,en=function b(p){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var E=Xt.getInstance(),k=new et(p,E,this);Zt.set(this,k)};["observe","unobserve","disconnect"].forEach(function(b){en.prototype[b]=function(){var p;return(p=Zt.get(this))[b].apply(p,arguments)}});const tn=qe.ResizeObserver!==void 0?qe.ResizeObserver:en,Fe="Left",tt="Right",wt="Up",ot="Down",Et={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},It={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ke="mousemove",bn="mouseup";function nn(b,p){if(p===0)return b;const E=Math.PI/180*p;return[b[0]*Math.cos(E)+b[1]*Math.sin(E),b[1]*Math.cos(E)-b[0]*Math.sin(E)]}function xn(b){const{trackMouse:p}=b,E=v.useRef(Object.assign({},It)),k=v.useRef(Object.assign({},Et)),q=v.useRef(Object.assign({},k.current));let re;for(re in q.current=Object.assign({},k.current),k.current=Object.assign(Object.assign({},Et),b),Et)k.current[re]===void 0&&(k.current[re]=Et[re]);const[me,g]=v.useMemo(()=>function(m,C){const U=X=>{const Q="touches"in X;Q&&X.touches.length>1||m((J,ie)=>{ie.trackMouse&&!Q&&(document.addEventListener(Ke,K),document.addEventListener(bn,ue));const{clientX:fe,clientY:be}=Q?X.touches[0]:X,_e=nn([fe,be],ie.rotationAngle);return ie.onTouchStartOrOnMouseDown&&ie.onTouchStartOrOnMouseDown({event:X}),Object.assign(Object.assign(Object.assign({},J),It),{initial:_e.slice(),xy:_e,start:X.timeStamp||0})})},K=X=>{m((Q,J)=>{const ie="touches"in X;if(ie&&X.touches.length>1)return Q;if(X.timeStamp-Q.start>J.swipeDuration)return Q.swiping?Object.assign(Object.assign({},Q),{swiping:!1}):Q;const{clientX:fe,clientY:be}=ie?X.touches[0]:X,[_e,lt]=nn([fe,be],J.rotationAngle),nt=_e-Q.xy[0],Ve=lt-Q.xy[1],Re=Math.abs(nt),xe=Math.abs(Ve),Wt=(X.timeStamp||0)-Q.start,Bn=Math.sqrt(Re*Re+xe*xe)/(Wt||1),$n=[nt/(Wt||1),Ve/(Wt||1)],_t=function(Un,kn,Wn,ct){return Un>kn?Wn>0?tt:Fe:ct>0?ot:wt}(Re,xe,nt,Ve),cn=typeof J.delta=="number"?J.delta:J.delta[_t.toLowerCase()]||Et.delta;if(Re<cn&&xe<cn&&!Q.swiping)return Q;const Tt={absX:Re,absY:xe,deltaX:nt,deltaY:Ve,dir:_t,event:X,first:Q.first,initial:Q.initial,velocity:Bn,vxvy:$n};Tt.first&&J.onSwipeStart&&J.onSwipeStart(Tt),J.onSwiping&&J.onSwiping(Tt);let jn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${_t}`])&&(jn=!0),jn&&J.preventScrollOnSwipe&&J.trackTouch&&X.cancelable&&X.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Tt,swiping:!0})})},z=X=>{m((Q,J)=>{let ie;if(Q.swiping&&Q.eventData){if(X.timeStamp-Q.start<J.swipeDuration){ie=Object.assign(Object.assign({},Q.eventData),{event:X}),J.onSwiped&&J.onSwiped(ie);const fe=J[`onSwiped${ie.dir}`];fe&&fe(ie)}}else J.onTap&&J.onTap({event:X});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:X}),Object.assign(Object.assign(Object.assign({},Q),It),{eventData:ie})})},ue=X=>{document.removeEventListener(Ke,K),document.removeEventListener(bn,ue),z(X)},ce=(X,Q)=>{let J=()=>{};if(X&&X.addEventListener){const ie=Object.assign(Object.assign({},Et.touchEventOptions),Q.touchEventOptions),fe=[["touchstart",U,ie],["touchmove",K,Object.assign(Object.assign({},ie),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",z,ie]];fe.forEach(([be,_e,lt])=>X.addEventListener(be,_e,lt)),J=()=>fe.forEach(([be,_e])=>X.removeEventListener(be,_e))}return J},he={ref:X=>{X!==null&&m((Q,J)=>{if(Q.el===X)return Q;const ie={};return Q.el&&Q.el!==X&&Q.cleanUpTouch&&(Q.cleanUpTouch(),ie.cleanUpTouch=void 0),J.trackTouch&&X&&(ie.cleanUpTouch=ce(X,J)),Object.assign(Object.assign(Object.assign({},Q),{el:X}),ie)})}};return C.trackMouse&&(he.onMouseDown=U),[he,ce]}(m=>E.current=m(E.current,k.current),{trackMouse:p}),[p]);return E.current=function(m,C,U,K){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==U.preventScrollOnSwipe||C.touchEventOptions.passive!==U.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,k.current,q.current,g),me}var R=s(697);function St(b){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},St(b)}function Ct(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function rn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Ct(Object(E),!0).forEach(function(k){d(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Ct(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function d(b,p,E){return(p=function(k){var q=function(re,me){if(St(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(St(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return St(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=l().memo(function(b){var p=rn(rn({},x),b),E=p.description,k=p.fullscreen,q=p.handleImageLoaded,re=p.isFullscreen,me=p.onImageError,g=p.original,m=p.originalAlt,C=p.originalHeight,U=p.originalWidth,K=p.originalTitle,z=p.sizes,ue=p.srcSet,ce=p.loading,he=re&&k||g;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:he,alt:m,srcSet:ue,height:C,width:U,sizes:z,title:K,onLoad:function(X){return q(X,g)},onError:me,loading:ce}),E&&l().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:R.string,fullscreen:R.string,handleImageLoaded:R.func.isRequired,isFullscreen:R.bool,onImageError:R.func.isRequired,original:R.string.isRequired,originalAlt:R.string,originalHeight:R.string,originalWidth:R.string,originalTitle:R.string,sizes:R.string,srcSet:R.string,loading:R.string};const P=w;function O(b){return O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},O(b)}function L(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function W(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?L(Object(E),!0).forEach(function(k){ne(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):L(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function ne(b,p,E){return(p=function(k){var q=function(re,me){if(O(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(O(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return O(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var ae={left:l().createElement("polyline",{points:"15 18 9 12 15 6"}),right:l().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:l().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:l().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:l().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:l().createElement(l().Fragment,null,l().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),l().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Be={strokeWidth:1,viewBox:"0 0 24 24"},Ne=function(b){var p=W(W({},Be),b),E=p.strokeWidth,k=p.viewBox,q=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:k,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},ae[q])};Ne.propTypes={strokeWidth:R.number,viewBox:R.string,icon:(0,R.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ee=Ne;var Te=l().memo(function(b){var p=b.isFullscreen,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},l().createElement(Ee,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Te.displayName="Fullscreen",Te.propTypes={isFullscreen:R.bool.isRequired,onClick:R.func.isRequired};const Xe=Te;var Rt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},l().createElement(Ee,{icon:"left",viewBox:"6 0 12 24"}))});Rt.displayName="LeftNav",Rt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const An=Rt;var Pt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},l().createElement(Ee,{icon:"right",viewBox:"6 0 12 24"}))});Pt.displayName="RightNav",Pt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const st=Pt;var $t=l().memo(function(b){var p=b.isPlaying,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},l().createElement(Ee,{strokeWidth:2,icon:p?"pause":"play"}))});$t.displayName="PlayPause",$t.propTypes={isPlaying:R.bool.isRequired,onClick:R.func.isRequired};const Ut=$t;function ft(b){return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},ft(b)}function at(){return at=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var k in E)Object.prototype.hasOwnProperty.call(E,k)&&(b[k]=E[k])}return b},at.apply(this,arguments)}function Lt(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function wn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Lt(Object(E),!0).forEach(function(k){En(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Lt(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function En(b,p,E){return(p=function(k){var q=function(re,me){if(ft(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(ft(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return ft(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var ar={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Dn=function(b){var p=wn(wn({},ar),b),E=p.children,k=p.className,q=xn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",at({},q,{className:k}),E)};Dn.propTypes={children:R.node.isRequired,className:R.string,delta:R.number,onSwiped:R.func,onSwiping:R.func};const Mn=Dn;function $e(b){return $e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},$e(b)}function Sn(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function on(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Sn(Object(E),!0).forEach(function(k){an(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Sn(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function Tn(b,p){for(var E=0;E<p.length;E++){var k=p[E];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(b,ln(k.key),k)}}function sn(b,p){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,k){return E.__proto__=k,E},sn(b,p)}function Fn(b,p){if(p&&($e(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oe(b)}function Oe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function vt(b){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},vt(b)}function an(b,p,E){return(p=ln(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}function ln(b){var p=function(E,k){if($e(E)!=="object"||E===null)return E;var q=E[Symbol.toPrimitive];if(q!==void 0){var re=q.call(E,k);if($e(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(b,"string");return $e(p)==="symbol"?p:String(p)}var lr=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],jl=(0,R.arrayOf)((0,R.shape)({srcSet:R.string,media:R.string}));function To(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Dr=function(b){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&sn(g,m)})(me,b);var p,E,k,q,re=(k=me,q=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=vt(k);if(q){var C=vt(this).constructor;g=Reflect.construct(m,arguments,C)}else g=m.apply(this,arguments);return Fn(this,g)});function me(g){var m;return function(C,U){if(!(C instanceof U))throw new TypeError("Cannot call a class as a function")}(this,me),an(Oe(m=re.call(this,g)),"onBulletClick",function(C,U){var K=m.props,z=K.onBulletClick,ue=K.items,ce=m.state.currentIndex;C.target.blur(),ce!==U&&(ue.length===2?m.slideToIndexWithStyleReset(U,C):m.slideToIndex(U,C)),z&&z(C,U)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=l().createRef(),m.thumbnailsWrapper=l().createRef(),m.thumbnails=l().createRef(),m.imageGallerySlideWrapper=l().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(Oe(m)),m.handleKeyDown=m.handleKeyDown.bind(Oe(m)),m.handleMouseDown=m.handleMouseDown.bind(Oe(m)),m.handleResize=m.handleResize.bind(Oe(m)),m.handleTouchMove=m.handleTouchMove.bind(Oe(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Oe(m)),m.handleScreenChange=m.handleScreenChange.bind(Oe(m)),m.handleSwiping=m.handleSwiping.bind(Oe(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Oe(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Oe(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Oe(m)),m.handleImageError=m.handleImageError.bind(Oe(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Oe(m)),m.renderThumbInner=m.renderThumbInner.bind(Oe(m)),m.renderItem=m.renderItem.bind(Oe(m)),m.slideLeft=m.slideLeft.bind(Oe(m)),m.slideRight=m.slideRight.bind(Oe(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Oe(m)),m.togglePlay=m.togglePlay.bind(Oe(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=ye(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return p=me,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,C=g.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var C=this.props,U=C.items,K=C.lazyLoad,z=C.slideDuration,ue=C.slideInterval,ce=C.startIndex,he=C.thumbnailPosition,X=C.showThumbnails,Q=C.useWindowKeyDown,J=this.state,ie=J.currentIndex,fe=J.isPlaying,be=g.items.length!==U.length,_e=!Ae()(g.items,U),lt=g.startIndex!==ce,nt=g.thumbnailPosition!==he,Ve=g.showThumbnails!==X;ue===g.slideInterval&&z===g.slideDuration||fe&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ve&&X&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ve&&!X&&this.removeThumbnailsResizeObserver(),(be||Ve)&&this.handleResize(),m.currentIndex!==ie&&this.slideThumbnailBar(),g.slideDuration!==z&&(this.slideToIndex=ye(this.unthrottledSlideToIndex,z,{trailing:!1})),!K||g.lazyLoad&&!_e||(this.lazyLoaded=[]),Q!==g.useWindowKeyDown&&(Q?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(lt||_e)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,C=m.currentIndex,U=m.isTransitioning,K=this.props,z=K.onSlide,ue=K.slideDuration;this.transitionTimer=window.setTimeout(function(){U&&(g.setState({isTransitioning:!U,isSwipingThumbnail:!1}),z&&z(C))},ue+50)}},{key:"onThumbnailClick",value:function(g,m){var C=this.props,U=C.onThumbnailClick,K=C.items,z=this.state.currentIndex;g.target.parentNode.parentNode.blur(),z!==m&&(K.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),U&&U(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,C=this.props,U=C.disableThumbnailScroll,K=C.items,z=this.state,ue=z.thumbnailsWrapperWidth,ce=z.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(U)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=ce)return 0;m=he.scrollHeight-ce}else{if(he.scrollWidth<=ue||ue<=0)return 0;m=he.scrollWidth-ue}return g*(m/(K.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,C=this.props,U=C.infinite,K=C.items,z="",ue="image-gallery-left",ce="image-gallery-right";switch(g){case m-1:z=" ".concat(ue);break;case m:z=" ".concat("image-gallery-center");break;case m+1:z=" ".concat(ce)}return K.length>=3&&U&&(g===0&&m===K.length-1?z=" ".concat(ce):g===K.length-1&&m===0&&(z=" ".concat(ue))),z}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.previousIndex,z=C!==K,ue=g===0&&K===0,ce=g===1&&K===1,he=g===0&&C===1,X=g===1&&C===0,Q=U===0,J=-100*C+100*g+U;return U>0?this.direction="left":U<0&&(this.direction="right"),X&&U>0&&(J=-100+U),he&&U<0&&(J=100+U),z?ue&&Q&&this.direction==="left"?J=100:ce&&Q&&this.direction==="right"&&(J=-100):(X&&Q&&this.direction==="left"&&(J=-100),he&&Q&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.slideStyle,z=this.props,ue=z.infinite,ce=z.items,he=z.useTranslate3D,X=z.isRTL,Q=-100*C,J=ce.length-1,ie=(Q+100*g)*(X?-1:1)+U;ue&&ce.length>2&&(C===0&&g===J?ie=-100*(X?-1:1)+U:C===J&&g===0&&(ie=100*(X?-1:1)+U)),ue&&ce.length===2&&(ie=this.getTranslateXForTwoSlide(g));var fe="translate(".concat(ie,"%, 0)");return he&&(fe="translate3d(".concat(ie,"%, 0, 0)")),on({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:fe,MozTransform:fe,msTransform:fe,OTransform:fe,transform:fe},K)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,C=m.useTranslate3D,U=m.isRTL,K=this.state,z=K.thumbsTranslate,ue=K.thumbsStyle,ce=U?-1*z:z;return this.isThumbnailVertical()?(g="translate(0, ".concat(z,"px)"),C&&(g="translate3d(0, ".concat(z,"px, 0)"))):(g="translate(".concat(ce,"px, 0)"),C&&(g="translate3d(".concat(ce,"px, 0, 0)"))),on({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},ue)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,C=this.props,U=C.items,K=C.slideOnThumbnailOver,z=C.onClick,ue=C.lazyLoad,ce=C.onTouchMove,he=C.onTouchEnd,X=C.onTouchStart,Q=C.onMouseOver,J=C.onMouseLeave,ie=C.renderItem,fe=C.renderThumbInner,be=C.showThumbnails,_e=C.showBullets,lt=[],nt=[],Ve=[];return U.forEach(function(Re,xe){var Wt=g.getAlignmentClassName(xe),Bn=Re.originalClass?" ".concat(Re.originalClass):"",$n=Re.thumbnailClass?" ".concat(Re.thumbnailClass):"",_t=Re.renderItem||ie||g.renderItem,cn=Re.renderThumbInner||fe||g.renderThumbInner,Tt=!ue||Wt||g.lazyLoaded[xe];Tt&&ue&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var jn=g.getSlideStyle(xe),Un=l().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Wt," ").concat(Bn),style:jn,onClick:z,onKeyUp:g.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:he,onTouchStart:X,onMouseOver:Q,onFocus:Q,onMouseLeave:J,role:"button"},Tt?_t(Re):l().createElement("div",{style:{height:"100%"}}));if(lt.push(Un),be&&Re.thumbnail){var kn=f("image-gallery-thumbnail",$n,{active:m===xe});nt.push(l().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:kn,onMouseLeave:K?g.onThumbnailMouseLeave:null,onMouseOver:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onFocus:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onKeyUp:function(ct){return g.handleThumbnailKeyUp(ct,xe)},onClick:function(ct){return g.onThumbnailClick(ct,xe)}},cn(Re)))}if(_e){var Wn=f("image-gallery-bullet",Re.bulletClass,{active:m===xe});Ve.push(l().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Wn,onClick:function(ct){return g.onBulletClick(ct,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:lt,thumbnails:nt,bullets:Ve}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,C=m.previousIndex,U=m.currentIndex,K=g.length-1;return Math.abs(C-U)>1&&!(C===0&&U===K)&&!(C===K&&U===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,C=m.isTransitioning,U=m.previousIndex,K=m.currentIndex;return C&&!(g===U||g===K)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,C=g.isSwipingThumbnail,U=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:U,thumbsSwipedTranslate:U}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,C=g.absX,U=g.dir,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=this.state,he=ce.galleryWidth,X=ce.isTransitioning,Q=ce.swipingUpDown,J=ce.swipingLeftRight;if(U!==wt&&U!==ot&&!Q||J){if(U!==Fe&&U!==tt||J||this.setState({swipingLeftRight:!0}),!z){var ie=this.props.swipingTransitionDuration;if(ue&&m.preventDefault(),X)this.setState({currentSlideOffset:0});else{var fe=U===tt?1:-1,be=C/he*100;Math.abs(be)>=100&&(be=100);var _e={transition:"transform ".concat(ie,"ms ease-out")};this.setState({currentSlideOffset:fe*be,slideStyle:_e})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,C=g.absX,U=g.absY,K=g.dir,z=this.props,ue=z.stopPropagation,ce=z.swipingThumbnailTransitionDuration,he=this.state,X=he.thumbsSwipedTranslate,Q=he.thumbnailsWrapperHeight,J=he.thumbnailsWrapperWidth,ie=he.swipingUpDown,fe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((K===Fe||K===tt||fe)&&!ie)return void(fe||this.setState({swipingLeftRight:!0}));K!==wt&&K!==ot||ie||this.setState({swipingUpDown:!0})}else{if((K===wt||K===ot||ie)&&!fe)return void(ie||this.setState({swipingUpDown:!0}));K!==Fe&&K!==tt||fe||this.setState({swipingLeftRight:!0})}var be,_e,lt,nt,Ve,Re=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=X+(K===ot?U:-U),_e=Re.scrollHeight-Q+20,lt=Math.abs(be)>_e,nt=be>20,Ve=Re.scrollHeight<=Q):(be=X+(K===tt?C:-C),_e=Re.scrollWidth-J+20,lt=Math.abs(be)>_e,nt=be>20,Ve=Re.scrollWidth<=J),!Ve&&(K!==Fe&&K!==wt||!lt)&&(K!==tt&&K!==ot||!nt)){ue&&m.stopPropagation();var xe={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,C=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,C=g.dir,U=g.velocity,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=K.flickThreshold;if(!z){var he=this.props.isRTL;ue&&m.stopPropagation(),this.resetSwipingDirection();var X=(C===Fe?1:-1)*(he?-1:1),Q=U>ce&&!(C===wt||C===ot);this.handleOnSwipedTo(X,Q)}}},{key:"handleOnSwipedTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=U;!this.sufficientSwipe()&&!m||K||(z+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(z=U),this.unthrottledSlideToIndex(z)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,C=m.disableKeyDown,U=m.useBrowserFullscreen,K=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:K&&!U&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperWidth:U.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperHeight:U.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,C=g.useBrowserFullscreen,U=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,K=this.imageGallery.current===U;m&&m(K),C&&this.setState({isFullscreen:K})}},{key:"slideToIndex",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props,ue=z.items,ce=z.slideDuration,he=z.onBeforeSlide;if(!K){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var X=ue.length-1,Q=g;g<0?Q=X:g>X&&(Q=0),he&&Q!==U&&he(Q),this.setState({previousIndex:U,currentIndex:Q,isTransitioning:Q!==U,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props.items,ue=U+(m==="left"?-1:1);K||(z.length===2?this.slideToIndexWithStyleReset(ue,g):this.slideToIndex(ue,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var C=this,U=this.state,K=U.currentIndex,z=U.currentSlideOffset;this.setState({currentSlideOffset:z+(K>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){To(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){To(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;lr.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;lr.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,U=m.slideInterval,K=m.slideDuration,z=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(U,K)),C&&g&&C(z))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(C))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return l().createElement(P,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return l().createElement("span",{className:"image-gallery-thumbnail-inner"},l().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,C=g.isFullscreen,U=g.modalFullscreen,K=g.isPlaying,z=this.props,ue=z.additionalClass,ce=z.disableThumbnailSwipe,he=z.indexSeparator,X=z.isRTL,Q=z.items,J=z.thumbnailPosition,ie=z.renderFullscreenButton,fe=z.renderCustomControls,be=z.renderLeftNav,_e=z.renderRightNav,lt=z.showBullets,nt=z.showFullscreenButton,Ve=z.showIndex,Re=z.showThumbnails,xe=z.showNav,Wt=z.showPlayButton,Bn=z.renderPlayPauseButton,$n=this.getThumbnailStyle(),_t=this.getSlideItems(),cn=_t.slides,Tt=_t.thumbnails,jn=_t.bullets,Un=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":X}),kn=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:Un},fe&&fe(),this.canSlide()?l().createElement(l().Fragment,null,xe&&l().createElement(l().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),_e(this.slideRight,!this.canSlideRight())),l().createElement(Mn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},cn))):l().createElement("div",{className:"image-gallery-slides"},cn),Wt&&Bn(this.togglePlay,K),lt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},jn)),nt&&ie(this.toggleFullScreen,C),Ve&&l().createElement("div",{className:"image-gallery-index"},l().createElement("span",{className:"image-gallery-index-current"},m+1),l().createElement("span",{className:"image-gallery-index-separator"},he),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),Wn=f("image-gallery",ue,{"fullscreen-modal":U}),ct=f("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:C}),Ol=f("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(J),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&X},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ce},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ce});return l().createElement("div",{ref:this.imageGallery,className:Wn,"aria-live":"polite"},l().createElement("div",{className:ct},(J==="bottom"||J==="right")&&kn,Re&&Tt.length>0?l().createElement(Mn,{className:Ol,delta:0,onSwiping:!ce&&this.handleThumbnailSwiping,onSwiped:!ce&&this.handleOnThumbnailSwiped},l().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},l().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:$n,"aria-label":"Thumbnail Navigation"},Tt))):null,(J==="top"||J==="left")&&kn))}}],E&&Tn(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),me}(l().Component);Dr.propTypes={flickThreshold:R.number,items:(0,R.arrayOf)((0,R.shape)({bulletClass:R.string,bulletOnClick:R.func,description:R.string,original:R.string,originalHeight:R.number,originalWidth:R.number,loading:R.string,thumbnailHeight:R.number,thumbnailWidth:R.number,thumbnailLoading:R.string,fullscreen:R.string,originalAlt:R.string,originalTitle:R.string,thumbnail:R.string,thumbnailAlt:R.string,thumbnailLabel:R.string,thumbnailTitle:R.string,originalClass:R.string,thumbnailClass:R.string,renderItem:R.func,renderThumbInner:R.func,imageSet:jl,srcSet:R.string,sizes:R.string})).isRequired,showNav:R.bool,autoPlay:R.bool,lazyLoad:R.bool,infinite:R.bool,showIndex:R.bool,showBullets:R.bool,showThumbnails:R.bool,showPlayButton:R.bool,showFullscreenButton:R.bool,disableThumbnailScroll:R.bool,disableKeyDown:R.bool,disableSwipe:R.bool,disableThumbnailSwipe:R.bool,useBrowserFullscreen:R.bool,onErrorImageURL:R.string,indexSeparator:R.string,thumbnailPosition:(0,R.oneOf)(["top","bottom","left","right"]),startIndex:R.number,slideDuration:R.number,slideInterval:R.number,slideOnThumbnailOver:R.bool,swipeThreshold:R.number,swipingTransitionDuration:R.number,swipingThumbnailTransitionDuration:R.number,onSlide:R.func,onBeforeSlide:R.func,onScreenChange:R.func,onPause:R.func,onPlay:R.func,onClick:R.func,onImageLoad:R.func,onImageError:R.func,onTouchMove:R.func,onTouchEnd:R.func,onTouchStart:R.func,onMouseOver:R.func,onMouseLeave:R.func,onBulletClick:R.func,onThumbnailError:R.func,onThumbnailClick:R.func,renderCustomControls:R.func,renderLeftNav:R.func,renderRightNav:R.func,renderPlayPauseButton:R.func,renderFullscreenButton:R.func,renderItem:R.func,renderThumbInner:R.func,stopPropagation:R.bool,additionalClass:R.string,useTranslate3D:R.bool,isRTL:R.bool,useWindowKeyDown:R.bool},Dr.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(b,p){return l().createElement(An,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(st,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Ut,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(Xe,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const kl=Dr})(),a})())})(ll);var op=ll.exports;const sp=ji(op);function ap(){var e=new Map;function t(n){var r=n.root,i=n.rootMargin,s=n.threshold,a=e.get(r);a||(a=new Map,e.set(r,a));var c=JSON.stringify({rootMargin:i,threshold:s}),f=a.get(c);if(!f){var v=new Map,l=new IntersectionObserver(function(u){u.forEach(function(T){var y=v.get(T.target);y==null||y(T)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:v},a.set(c,f)}return{observe:function(T,y){var S,j;(S=f)==null||S.entryCallbacks.set(T,y),(j=f)==null||j.observer.observe(T)},unobserve:function(T){var y,S;(y=f)==null||y.entryCallbacks.delete(T),(S=f)==null||S.observer.unobserve(T)}}}return{getObserver:t}}var lp="0px",cp=[0],up=ap();function dp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:lp,i=(n=e==null?void 0:e.threshold)!=null?n:cp,s=M.useRef(null),a=M.useRef(null),c=M.useRef(null),f=M.useState(),v=f[0],l=f[1],u=M.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var _=up.getObserver({root:a.current,rootMargin:r,threshold:i});_.observe(j,function(D){l(D)}),c.current=_},[r,i]),T=M.useCallback(function(){var j=c.current,_=s.current;_&&(j==null||j.unobserve(_)),c.current=null},[]),y=M.useCallback(function(j){T(),s.current=j,u()},[u,T]),S=M.useCallback(function(j){T(),a.current=j,u()},[u,T]);return[y,{entry:v,rootRef:S}]}function yi(){return yi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yi.apply(this,arguments)}function hp(e){var t,n=dp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=M.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,yi({},i,{isVisible:s,wasEverVisible:c})]}var fp=100;function pp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?fp:a,f=hp({rootMargin:i}),v=f[0],l=f[1],u=l.rootRef,T=l.isVisible,y=!s&&!t&&T&&n;return M.useEffect(function(){if(y){var S=setTimeout(function(){r()},c);return function(){clearTimeout(S)}}},[r,y,c]),[v,{rootRef:u}]}const mp={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},gp={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'};var Gr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Hr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function cl(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function ul(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function vp(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}var go={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Gr?173:189,"=":Gr?61:187,";":Gr?59:186,"'":222,"[":219,"]":221,"\\":220},Kt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},bi={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ge={16:!1,18:!1,17:!1,91:!1},De={};for(var hr=1;hr<20;hr++)go["f".concat(hr)]=111+hr;var Ie=[],ms=!1,dl="all",hl=[],Ar=function(t){return go[t.toLowerCase()]||Kt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function fl(e){dl=e||"all"}function ir(){return dl||"all"}function yp(){return Ie.slice(0)}function bp(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function xp(e){return typeof e=="string"&&(e=Ar(e)),Ie.indexOf(e)!==-1}function wp(e,t){var n,r;e||(e=ir());for(var i in De)if(Object.prototype.hasOwnProperty.call(De,i))for(n=De[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;ir()===e&&fl(t||"all")}function Ep(e){var t=e.keyCode||e.which||e.charCode,n=Ie.indexOf(t);if(n>=0&&Ie.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ie.splice(0,Ie.length),(t===93||t===224)&&(t=91),t in Ge){Ge[t]=!1;for(var r in Kt)Kt[r]===t&&(ht[r]=!1)}}function Sp(e){if(typeof e>"u")Object.keys(De).forEach(function(a){return delete De[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Xr(a)});else if(typeof e=="object")e.key&&Xr(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],s=n[1];typeof i=="function"&&(s=i,i=""),Xr({key:e,scope:i,method:s,splitKey:"+"})}}var Xr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=ul(n);c.forEach(function(f){var v=f.split(a),l=v.length,u=v[l-1],T=u==="*"?"*":Ar(u);if(De[T]){r||(r=ir());var y=l>1?cl(Kt,v):[];De[T]=De[T].filter(function(S){var j=i?S.method===i:!0;return!(j&&S.scope===r&&vp(S.mods,y))})}})};function gs(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var s in Ge)Object.prototype.hasOwnProperty.call(Ge,s)&&(!Ge[s]&&t.mods.indexOf(+s)>-1||Ge[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!Ge[16]&&!Ge[18]&&!Ge[17]&&!Ge[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function vs(e,t){var n=De["*"],r=e.keyCode||e.which||e.charCode;if(ht.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ie.indexOf(r)===-1&&r!==229&&Ie.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var j=bi[S];e[S]&&Ie.indexOf(j)===-1?Ie.push(j):!e[S]&&Ie.indexOf(j)>-1?Ie.splice(Ie.indexOf(j),1):S==="metaKey"&&e[S]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(j))))}),r in Ge){Ge[r]=!0;for(var i in Kt)Kt[i]===r&&(ht[i]=!0);if(!n)return}for(var s in Ge)Object.prototype.hasOwnProperty.call(Ge,s)&&(Ge[s]=e[bi[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),Ge[17]=!0,Ge[18]=!0);var a=ir();if(n)for(var c=0;c<n.length;c++)n[c].scope===a&&(e.type==="keydown"&&n[c].keydown||e.type==="keyup"&&n[c].keyup)&&gs(e,n[c],a,t);if(r in De){for(var f=0;f<De[r].length;f++)if((e.type==="keydown"&&De[r][f].keydown||e.type==="keyup"&&De[r][f].keyup)&&De[r][f].key){for(var v=De[r][f],l=v.splitKey,u=v.key.split(l),T=[],y=0;y<u.length;y++)T.push(Ar(u[y]));T.sort().join("")===Ie.sort().join("")&&gs(e,v,a,t)}}}}function Tp(e){return hl.indexOf(e)>-1}function ht(e,t,n){Ie=[];var r=ul(e),i=[],s="all",a=document,c=0,f=!1,v=!0,l="+",u=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(v=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(l=t.splitKey)),typeof t=="string"&&(s=t);c<r.length;c++)e=r[c].split(l),i=[],e.length>1&&(i=cl(Kt,e)),e=e[e.length-1],e=e==="*"?"*":Ar(e),e in De||(De[e]=[]),De[e].push({keyup:f,keydown:v,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Tp(a)&&window&&(hl.push(a),Hr(a,"keydown",function(T){vs(T,a)},u),ms||(ms=!0,Hr(window,"focus",function(){Ie=[]},u)),Hr(a,"keyup",function(T){vs(T,a),Ep(T)},u))}function jp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(De).forEach(function(n){var r=De[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Yr={setScope:fl,getScope:ir,deleteScope:wp,getPressedKeyCodes:yp,isPressed:xp,filter:bp,trigger:jp,unbind:Sp,keyMap:go,modifier:Kt,modifierMap:bi};for(var Qr in Yr)Object.prototype.hasOwnProperty.call(Yr,Qr)&&(ht[Qr]=Yr[Qr]);if(typeof window<"u"){var kp=window.hotkeys;ht.noConflict=function(e){return e&&window.hotkeys===ht&&(window.hotkeys=kp),ht},window.hotkeys=ht}ht.filter=function(){return!0};var pl=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},Op=function(t){return pl(t,["INPUT","TEXTAREA","SELECT"])};function Ip(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,c=i.keyup,f=i.keydown,v=i.filterPreventDefault,l=v===void 0?!0:v,u=i.enabled,T=u===void 0?!0:u,y=i.enableOnContentEditable,S=y===void 0?!1:y,j=M.useRef(null),_=M.useCallback(function(D,A){var B,V;return a&&!a(D)?!l:Op(D)&&!pl(D,s)||(B=D.target)!=null&&B.isContentEditable&&!S?!0:j.current===null||document.activeElement===j.current||(V=j.current)!=null&&V.contains(document.activeElement)?(t(D,A),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return M.useEffect(function(){if(!T){ht.unbind(e,_);return}return c&&f!==!0&&(n.keydown=!1),ht(e,n||{},_),function(){return ht.unbind(e,_)}},[_,e,T]),j}ht.isPressed;const ml=M.createContext({open:!1,toggleOpen:e=>{}});function Cp({children:e}){const[t,n]=M.useState(!1),r=s=>{n(s??!s)},i=M.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(ml.Provider,{value:i,children:e})}function vo(){return M.useContext(ml)}const mt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},Rp=e=>sr(async()=>{const{data:t}=await e.get(mt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Pp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...Lc(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:i=c=>{t.onFilterChange({...n,keyword:c.title})},emptyCategory:s}=t;!n.category&&!s&&(n.category="All");const a=c=>{const f={...n,...c};r(Mr(f,v=>v===""||v===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Mr(n,(v,l)=>c.includes(l)):{};r(Mr(f,v=>v===""||v===void 0))},handleActiveMenu:c=>{c!==e.menu&&r({menu:c})},handleSort:(c,f)=>{a({sortBy:c,sortDirection:f||c==="nameAsc"?"asc":"desc"})},handleKeyword:c=>{a({category:void 0,keyword:c||void 0})},handlePrice:c=>{a({price:c===e.price?void 0:c})},handleCategory:c=>{a({category:c===e.category?"":c})},handleDeveloper:c=>{a({owner:c||void 0})},handlePage:c=>{a({currentPage:c})},handleSwitchShowResources:c=>{a({showResources:c})},handleSearchSelect:c=>{i(c)}}}const Lp=(e,t,n)=>e&&t||!n,gl=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],vl=(e,t,n)=>{var r,i;const s=_c(e),a=Nc(s.search);if((r=Ac(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Dc({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:v}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Ri(e,{...f||v?{imageFilter:"resize",w:f,h:v}:{},v:c})},_p=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Np=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Ap=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Dp=()=>window.innerWidth<=600,Mp={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later"},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}"'}},Fp={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}” 的所有搜索结果"}},Jr={en:Co(Mp),zh:Co(Fp)},yl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},Bp=e=>(t,n)=>{const r=Jr[e]?Jr[e][t]:Jr.en[t];return Ap(r,n)||t},bl={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!1,endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},xl=M.createContext(bl),{Provider:$p,Consumer:hg}=xl;function Up(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=ye=>ye,extraFilter:v=ye=>ye,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:T=!1,showCategory:y=!0,tagFilters:S=[],children:j,storeVersion:_,onSearchSelect:D=()=>{},endpoint:A,blockletRender:B,compact:V=!1}=e,I=yl(r,_),F=M.useMemo(()=>Us({baseURL:A,headers:I}),[A]),G=Pp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:D}),[$,le]=M.useState(""),{data:H=[],error:se,loading:je,run:We}=Rp(F),Me=M.useMemo(()=>{const ye=Pc(H,[Ae=>Ae.name],["asc"]),oe=ye.findIndex(Ae=>Ae.name==="All"||Ae.locales.en==="All");return oe>-1?[{...ye[oe],_id:"All"},...ye.slice(0,oe),...ye.slice(oe+1)]:ye},[H]),Qe=M.useCallback(Bp(t),[t]),Z=M.useMemo(()=>Np(Me,t),[Me,t]),pe=_p(Qe),ee={search:G,compact:V,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:je},extraFilter:v,endpoint:A,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Qe,storeVersion:_,serverVersion:r,selectedCategory:G.filters.category||(c.showExplore?"":"All"),categoryList:Me,blockletRender:B,locale:t,categoryOptions:Z,priceOptions:pe,storeApi:F,baseSearch:l,showResourcesSwitch:T,showCategory:y,tagFilters:S,onFilterChange:i,getCategoryLocale:ye=>{if(!ye)return null;const oe=H.find(Ae=>Ae._id===ye||Ae.locales.en==="All");return oe?oe.locales[t]||oe.locales.en:null},get developerName(){return $},updateDeveloperName:le};return M.useEffect(()=>{setTimeout(We,u||0)},[A,We,u]),o.jsx($p,{value:ee,children:j})}function it(){return M.useContext(xl)||bl}function wl({children:e,onClick:t,size:n=32,...r}){return o.jsx(or,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function fr(e,t){return e===void 0?t:e}function yo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=Pn(),c=qt(a.breakpoints.down("sm")),f=qt(a.breakpoints.between("sm","md")),v=qt(a.breakpoints.between("md","lg")),l=qt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:v?n||null:l?r||null:i||null;let u=e;return c||(u=fr(t,u),f)||(u=fr(n,u),v)||(u=fr(r,u),l)?u:fr(i,u)}function Wp({children:e}){const{open:t,toggleOpen:n}=vo();return o.jsx(yo,{xs:o.jsx(Ul,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const zp=M.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(or,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(xt,{size:"1em"})}));function xi({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=M.useRef(null),c=Pn(),[f,v]=M.useState(!1),[l,u]=M.useState(e!==null?e:""),T=qt(c.breakpoints.down("sm"));M.useEffect(()=>{u(e!==null?e:"")},[e]);const y=M.useCallback(()=>{v(!1)},[]),S=M.useCallback(()=>{v(!0)},[]);function j(D){u(D.value),n(D.value),T&&y()}function _(D){return D===l}return o.jsxs(o.Fragment,{children:[o.jsxs(qp,{ref:a,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Hn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(D=>D.value===l))==null?void 0:s.name)||r,o.jsx(Wl,{className:"my-select__arrowdown",component:Tc,sx:{width:18,height:18}})]}),o.jsx(zl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:D,placement:A})=>o.jsx(ql,{...D,style:{transformOrigin:A==="bottom"?"center top":"center bottom"},children:o.jsx(Kl,{children:o.jsx(Vl,{onClickAway:y,children:o.jsx(Kp,{autoFocusItem:f,onMouseEnter:S,onMouseLeave:y,children:t.map(B=>o.jsxs(Ti,{onClick:()=>j(B),sx:{fontSize:14},children:[o.jsx(zs,{sx:{mr:1,fontSize:16,visibility:_(B.value)?"visible":"hidden"}}),B.name]},B.value))})})})})})]})}const qp=Vt(zp)`
|
|
485
|
+
`;const ns=(e="")=>e.replace(/(<([^>]+)>)/gi,"").trim(),Zh=(e="")=>{const t=parseInt(e,10);return Number.isNaN(t)?e:t<1e3?t:t<1e6?`${(t/1e3).toFixed(1)}k`:t<1e9?`${(t/1e6).toFixed(1)}m`:`${(t/1e9).toFixed(1)}b`},qa={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 18a3.5 3.5 0 0 0 0-7h-1A5 4.5 0 0 0 7 9a4.6 4.4 0 0 0-2.1 8.4M12 13v9m-3-3l3 3l3-3"/>'};function ui({title:e,sx:t,children:n,slotProps:r,fontSize:i=12,fontWeight:s=500,color:a="text.secondary",...c}){var f,v;return e?o.jsx(Ls,{title:e,placement:"top",...c,slotProps:{popper:{...r==null?void 0:r.popper,sx:[{[`& .${Fl.tooltip}`]:{backgroundColor:"common.white",fontSize:i,fontWeight:s,boxShadow:"0px 4px 8px 0px #03071214, 0px 0px 0px 1px #03071214",marginBottom:"6px !important",borderRadius:"8px",cursor:"default",color:a,display:"flex",alignItems:"center"}},...Array.isArray((f=r==null?void 0:r.popper)==null?void 0:f.sx)?r.popper.sx:[(v=r==null?void 0:r.popper)==null?void 0:v.sx]]}},children:n}):n}function ur({icon:e,children:t,maxWidth:n=100,title:r,sx:i}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:.5,sx:[{maxWidth:n,overflow:"hidden"},...Array.isArray(i)?i:[i]],children:[e,o.jsx(ui,{title:r||(typeof t=="string"?t:""),children:o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"default"},children:t})})]})}function ef(e){const{title:t,description:n="",cover:r="",avatar:i,author:s,download:a,did:c,official:f,buttonText:v="Install",buttonDisabled:l,buttonLoading:u,button:T,onButtonClick:y=()=>{},onMainClick:S,className:j,ref:_,icons:D,status:A,...B}=e,V=Pn(),I=(H,se=()=>!1)=>(je,...We)=>{const Me=H instanceof Function;(se()||Me)&&(je.preventDefault(),je.stopPropagation(),Me&&H(...We))},F=S&&I(S),G=I(y,()=>!!(T||l||u)),$=M.isValidElement(t)?{children:t}:{title:ns(t),dangerouslySetInnerHTML:{__html:t}},le=M.isValidElement(n)?{children:n}:{title:ns(n),dangerouslySetInnerHTML:{__html:n}};return o.jsxs(Bl,{variant:"outlined",onClick:F,...B,sx:{p:{xs:2,md:3},borderRadius:2,...B.sx},children:[o.jsxs(rt,{flex:1,direction:"row",gap:1,alignItems:"center",overflow:"hidden",sx:{"& > *":{flexShrink:0}},children:[o.jsx(xr,{src:r,did:c,size:48,variant:"rounded",style:{borderRadius:"8px",overflow:"hidden"}}),o.jsx(ge,{className:"blocklet-title",fontWeight:"fontWeightMedium",sx:{fontSize:16,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",cursor:"default",pl:.5,"&&":{flexShrink:1}},...$}),o.jsxs(Y,{flex:1,display:"flex",alignItems:"center",justifyContent:"flex-start",gap:1,children:[f&&o.jsx(ui,{title:f.tooltip,children:o.jsx(Ec,{sx:{color:f.color||"#D97706",fontSize:f.size||18}})}),D==null?void 0:D.map(H=>o.jsx(ui,{title:H.title,children:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon,style:{color:H.color}}):H.icon},H.key))]}),y&&o.jsxs(dt,{color:"reverse",variant:"outlined",size:"small",disabled:l||u,style:{borderColor:V.palette.grey[300],borderRadius:8,fontSize:13,fontWeight:V.typography.fontWeightMedium},onClick:G,children:[u&&o.jsx(xt,{size:15,style:{marginRight:3,color:"inherit"}}),v]}),T]}),o.jsx(rt,{py:2,children:o.jsx(ge,{className:"blocklet-description",variant:"body2",color:"text.secondary",sx:{display:"-webkit-box",lineClamp:2,WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",cursor:"default",height:40},...le})}),o.jsxs(rt,{direction:"row",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(ur,{icon:o.jsx(xr,{src:i,did:c,size:20,variant:"circle"}),maxWidth:200,children:s}),o.jsx(ur,{icon:o.jsx(pt,{icon:qa}),title:a,children:Zh(a)}),A==null?void 0:A.filter(H=>H.align!=="right").map(H=>o.jsx(ur,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,children:H.text},H.key)),o.jsx(Y,{sx:{flex:1}}),A==null?void 0:A.filter(H=>H.align==="right").map(H=>o.jsx(ur,{icon:typeof H.icon=="string"?o.jsx(pt,{icon:H.icon}):H.icon,title:H.title,maxWidth:H.maxWidth,sx:{color:H.color},children:H.text},H.key))]})]})}const tf={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m8 16l2-6l6-2l-2 6l-6 2"/><path d="M3 12a9 9 0 1 0 18 0a9 9 0 1 0-18 0m9-9v2m0 14v2m-9-9h2m14 0h2"/></g>'},Qn=/^[a-z0-9]+(-[a-z0-9]+)*$/,_r=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),f=i.pop(),v={provider:i.length>0?i[0]:r,prefix:f,name:c};return t&&!yr(v)?null:v}const s=i[0],a=s.split("-");if(a.length>1){const c={provider:r,prefix:a.shift(),name:a.join("-")};return t&&!yr(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:s};return t&&!yr(c,n)?null:c}return null},yr=(e,t)=>e?!!((e.provider===""||e.provider.match(Qn))&&(t&&e.prefix===""||e.prefix.match(Qn))&&e.name.match(Qn)):!1,Ka=Object.freeze({left:0,top:0,width:16,height:16}),Er=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),lo=Object.freeze({...Ka,...Er}),di=Object.freeze({...lo,body:"",hidden:!1});function nf(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function rs(e,t){const n=nf(e,t);for(const r in di)r in Er?r in e&&!(r in n)&&(n[r]=Er[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function rf(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function s(a){if(n[a])return i[a]=[];if(!(a in i)){i[a]=null;const c=r[a]&&r[a].parent,f=c&&s(c);f&&(i[a]=[c].concat(f))}return i[a]}return Object.keys(n).concat(Object.keys(r)).forEach(s),i}function of(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let s={};function a(c){s=rs(r[c]||i[c],s)}return a(t),n.forEach(a),rs(e,s)}function Va(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=rf(e);for(const i in r){const s=r[i];s&&(t(i,of(e,i,s)),n.push(i))}return n}const sf={provider:"",aliases:{},not_found:{},...Ka};function Kr(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function Ga(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Kr(e,sf))return null;const n=t.icons;for(const i in n){const s=n[i];if(!i.match(Qn)||typeof s.body!="string"||!Kr(s,di))return null}const r=t.aliases||Object.create(null);for(const i in r){const s=r[i],a=s.parent;if(!i.match(Qn)||typeof a!="string"||!n[a]&&!r[a]||!Kr(s,di))return null}return t}const is=Object.create(null);function af(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function vn(e,t){const n=is[e]||(is[e]=Object.create(null));return n[t]||(n[t]=af(e,t))}function co(e,t){return Ga(t)?Va(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function lf(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let tr=!1;function Ha(e){return typeof e=="boolean"&&(tr=e),tr}function cf(e){const t=typeof e=="string"?_r(e,!0,tr):e;if(t){const n=vn(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function uf(e,t){const n=_r(e,!0,tr);if(!n)return!1;const r=vn(n.provider,n.prefix);return lf(r,n.name,t)}function df(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),tr&&!t&&!e.prefix){let i=!1;return Ga(e)&&(e.prefix="",Va(e,(s,a)=>{a&&uf(s,a)&&(i=!0)})),i}const n=e.prefix;if(!yr({provider:t,prefix:n,name:"a"}))return!1;const r=vn(t,n);return!!co(r,e)}const Xa=Object.freeze({width:null,height:null}),Ya=Object.freeze({...Xa,...Er}),hf=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ff=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function os(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(hf);if(r===null||!r.length)return e;const i=[];let s=r.shift(),a=ff.test(s);for(;;){if(a){const c=parseFloat(s);isNaN(c)?i.push(s):i.push(Math.ceil(c*t*n)/n)}else i.push(s);if(s=r.shift(),s===void 0)return i.join("");a=!a}}const pf=e=>e==="unset"||e==="undefined"||e==="none";function mf(e,t){const n={...lo,...e},r={...Ya,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,r].forEach(S=>{const j=[],_=S.hFlip,D=S.vFlip;let A=S.rotate;_?D?A+=2:(j.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),j.push("scale(-1 1)"),i.top=i.left=0):D&&(j.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),j.push("scale(1 -1)"),i.top=i.left=0);let B;switch(A<0&&(A-=Math.floor(A/4)*4),A=A%4,A){case 1:B=i.height/2+i.top,j.unshift("rotate(90 "+B.toString()+" "+B.toString()+")");break;case 2:j.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:B=i.width/2+i.left,j.unshift("rotate(-90 "+B.toString()+" "+B.toString()+")");break}A%2===1&&(i.left!==i.top&&(B=i.left,i.left=i.top,i.top=B),i.width!==i.height&&(B=i.width,i.width=i.height,i.height=B)),j.length&&(s='<g transform="'+j.join(" ")+'">'+s+"</g>")});const a=r.width,c=r.height,f=i.width,v=i.height;let l,u;a===null?(u=c===null?"1em":c==="auto"?v:c,l=os(u,f/v)):(l=a==="auto"?f:a,u=c===null?os(l,v/f):c==="auto"?v:c);const T={},y=(S,j)=>{pf(j)||(T[S]=j.toString())};return y("width",l),y("height",u),T.viewBox=i.left.toString()+" "+i.top.toString()+" "+f.toString()+" "+v.toString(),{attributes:T,body:s}}const gf=/\sid="(\S+)"/g,vf="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let yf=0;function bf(e,t=vf){const n=[];let r;for(;r=gf.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const a=typeof t=="function"?t(s):t+(yf++).toString(),c=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const hi=Object.create(null);function xf(e,t){hi[e]=t}function fi(e){return hi[e]||hi[""]}function uo(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const ho=Object.create(null),Vn=["https://api.simplesvg.com","https://api.unisvg.com"],br=[];for(;Vn.length>0;)Vn.length===1||Math.random()>.5?br.push(Vn.shift()):br.push(Vn.pop());ho[""]=uo({resources:["https://api.iconify.design"].concat(br)});function wf(e,t){const n=uo(t);return n===null?!1:(ho[e]=n,!0)}function fo(e){return ho[e]}const Ef=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ss=Ef();function Sf(e,t){const n=fo(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(a=>{i=Math.max(i,a.length)});const s=t+".json?icons=";r=n.maxURL-i-n.path.length-s.length}return r}function Tf(e){return e===404}const jf=(e,t,n)=>{const r=[],i=Sf(e,t),s="icons";let a={type:s,provider:e,prefix:t,icons:[]},c=0;return n.forEach((f,v)=>{c+=f.length+1,c>=i&&v>0&&(r.push(a),a={type:s,provider:e,prefix:t,icons:[]},c=f.length),a.icons.push(f)}),r.push(a),r};function kf(e){if(typeof e=="string"){const t=fo(e);if(t)return t.path}return"/"}const Of=(e,t,n)=>{if(!ss){n("abort",424);return}let r=kf(t.provider);switch(t.type){case"icons":{const s=t.prefix,c=t.icons.join(","),f=new URLSearchParams({icons:c});r+=s+".json?"+f.toString();break}case"custom":{const s=t.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let i=503;ss(e+r).then(s=>{const a=s.status;if(a!==200){setTimeout(()=>{n(Tf(a)?"abort":"next",a)});return}return i=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",i)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",i)})},If={prepare:jf,send:Of};function Cf(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,s)=>i.provider!==s.provider?i.provider.localeCompare(s.provider):i.prefix!==s.prefix?i.prefix.localeCompare(s.prefix):i.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const s=i.provider,a=i.prefix,c=i.name,f=n[s]||(n[s]=Object.create(null)),v=f[a]||(f[a]=vn(s,a));let l;c in v.icons?l=t.loaded:a===""||v.missing.has(c)?l=t.missing:l=t.pending;const u={provider:s,prefix:a,name:c};l.push(u)}),t}function Qa(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Rf(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(s=>{const a=s.icons,c=a.pending.length;a.pending=a.pending.filter(f=>{if(f.prefix!==i)return!0;const v=f.name;if(e.icons[v])a.loaded.push({provider:r,prefix:i,name:v});else if(e.missing.has(v))a.missing.push({provider:r,prefix:i,name:v});else return n=!0,!0;return!1}),a.pending.length!==c&&(n||Qa([e],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}let Pf=0;function Lf(e,t,n){const r=Pf++,i=Qa.bind(null,n,r);if(!t.pending.length)return i;const s={id:r,icons:t,callback:e,abort:i};return n.forEach(a=>{(a.loaderCallbacks||(a.loaderCallbacks=[])).push(s)}),i}function _f(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const s=typeof i=="string"?_r(i,t,n):i;s&&r.push(s)}),r}var Nf={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Af(e,t,n,r){const i=e.resources.length,s=e.random?Math.floor(Math.random()*i):e.index;let a;if(e.random){let F=e.resources.slice(0);for(a=[];F.length>1;){const G=Math.floor(Math.random()*F.length);a.push(F[G]),F=F.slice(0,G).concat(F.slice(G+1))}a=a.concat(F)}else a=e.resources.slice(s).concat(e.resources.slice(0,s));const c=Date.now();let f="pending",v=0,l,u=null,T=[],y=[];typeof r=="function"&&y.push(r);function S(){u&&(clearTimeout(u),u=null)}function j(){f==="pending"&&(f="aborted"),S(),T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function _(F,G){G&&(y=[]),typeof F=="function"&&y.push(F)}function D(){return{startTime:c,payload:t,status:f,queriesSent:v,queriesPending:T.length,subscribe:_,abort:j}}function A(){f="failed",y.forEach(F=>{F(void 0,l)})}function B(){T.forEach(F=>{F.status==="pending"&&(F.status="aborted")}),T=[]}function V(F,G,$){const le=G!=="success";switch(T=T.filter(H=>H!==F),f){case"pending":break;case"failed":if(le||!e.dataAfterTimeout)return;break;default:return}if(G==="abort"){l=$,A();return}if(le){l=$,T.length||(a.length?I():A());return}if(S(),B(),!e.random){const H=e.resources.indexOf(F.resource);H!==-1&&H!==e.index&&(e.index=H)}f="completed",y.forEach(H=>{H($)})}function I(){if(f!=="pending")return;S();const F=a.shift();if(F===void 0){if(T.length){u=setTimeout(()=>{S(),f==="pending"&&(B(),A())},e.timeout);return}A();return}const G={status:"pending",resource:F,callback:($,le)=>{V(G,$,le)}};T.push(G),v++,u=setTimeout(I,e.rotate),n(F,t,G.callback)}return setTimeout(I),D}function Ja(e){const t={...Nf,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,f,v){const l=Af(t,c,f,(u,T)=>{r(),v&&v(u,T)});return n.push(l),l}function s(c){return n.find(f=>c(f))||null}return{query:i,find:s,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function as(){}const Vr=Object.create(null);function Df(e){if(!Vr[e]){const t=fo(e);if(!t)return;const n=Ja(t),r={config:t,redundancy:n};Vr[e]=r}return Vr[e]}function Mf(e,t,n){let r,i;if(typeof e=="string"){const s=fi(e);if(!s)return n(void 0,424),as;i=s.send;const a=Df(e);a&&(r=a.redundancy)}else{const s=uo(e);if(s){r=Ja(s);const a=e.resources?e.resources[0]:"",c=fi(a);c&&(i=c.send)}}return!r||!i?(n(void 0,424),as):r.query(t,i,n)().abort}const ls="iconify2",nr="iconify",Za=nr+"-count",cs=nr+"-version",el=36e5,Ff=168;function pi(e,t){try{return e.getItem(t)}catch{}}function po(e,t,n){try{return e.setItem(t,n),!0}catch{}}function us(e,t){try{e.removeItem(t)}catch{}}function mi(e,t){return po(e,Za,t.toString())}function gi(e){return parseInt(pi(e,Za))||0}const Nr={local:!0,session:!0},tl={local:new Set,session:new Set};let mo=!1;function Bf(e){mo=e}let dr=typeof window>"u"?{}:window;function nl(e){const t=e+"Storage";try{if(dr&&dr[t]&&typeof dr[t].length=="number")return dr[t]}catch{}Nr[e]=!1}function rl(e,t){const n=nl(e);if(!n)return;const r=pi(n,cs);if(r!==ls){if(r){const c=gi(n);for(let f=0;f<c;f++)us(n,nr+f.toString())}po(n,cs,ls),mi(n,0);return}const i=Math.floor(Date.now()/el)-Ff,s=c=>{const f=nr+c.toString(),v=pi(n,f);if(typeof v=="string"){try{const l=JSON.parse(v);if(typeof l=="object"&&typeof l.cached=="number"&&l.cached>i&&typeof l.provider=="string"&&typeof l.data=="object"&&typeof l.data.prefix=="string"&&t(l,c))return!0}catch{}us(n,f)}};let a=gi(n);for(let c=a-1;c>=0;c--)s(c)||(c===a-1?(a--,mi(n,a)):tl[e].add(c))}function il(){if(!mo){Bf(!0);for(const e in Nr)rl(e,t=>{const n=t.data,r=t.provider,i=n.prefix,s=vn(r,i);if(!co(s,n).length)return!1;const a=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,a):a,!0})}}function $f(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const r in Nr)rl(r,i=>{const s=i.data;return i.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Uf(e,t){mo||il();function n(r){let i;if(!Nr[r]||!(i=nl(r)))return;const s=tl[r];let a;if(s.size)s.delete(a=Array.from(s).shift());else if(a=gi(i),!mi(i,a+1))return;const c={cached:Math.floor(Date.now()/el),provider:e.provider,data:t};return po(i,nr+a.toString(),JSON.stringify(c))}t.lastModified&&!$f(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function ds(){}function Wf(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Rf(e)}))}function zf(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;delete e.iconsToLoad;let s;if(!i||!(s=fi(n)))return;s.prepare(n,r,i).forEach(c=>{Mf(n,c,f=>{if(typeof f!="object")c.icons.forEach(v=>{e.missing.add(v)});else try{const v=co(e,f);if(!v.length)return;const l=e.pendingIcons;l&&v.forEach(u=>{l.delete(u)}),Uf(e,f)}catch(v){console.error(v)}Wf(e)})})}))}const qf=(e,t)=>{const n=_f(e,!0,Ha()),r=Cf(n);if(!r.pending.length){let f=!0;return t&&setTimeout(()=>{f&&t(r.loaded,r.missing,r.pending,ds)}),()=>{f=!1}}const i=Object.create(null),s=[];let a,c;return r.pending.forEach(f=>{const{provider:v,prefix:l}=f;if(l===c&&v===a)return;a=v,c=l,s.push(vn(v,l));const u=i[v]||(i[v]=Object.create(null));u[l]||(u[l]=[])}),r.pending.forEach(f=>{const{provider:v,prefix:l,name:u}=f,T=vn(v,l),y=T.pendingIcons||(T.pendingIcons=new Set);y.has(u)||(y.add(u),i[v][l].push(u))}),s.forEach(f=>{const{provider:v,prefix:l}=f;i[v][l].length&&zf(f,i[v][l])}),t?Lf(t,r,s):ds};function Kf(e,t){const n={...e};for(const r in t){const i=t[r],s=typeof i;r in Xa?(i===null||i&&(s==="string"||s==="number"))&&(n[r]=i):s===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const Vf=/[\s,]+/;function Gf(e,t){t.split(Vf).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Hf(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/i,s%1===0?r(s):0)}}return t}function Xf(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function Yf(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Qf(e){return"data:image/svg+xml,"+Yf(e)}function Jf(e){return'url("'+Qf(e)+'")'}let Jn;function Zf(){try{Jn=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Jn=null}}function ep(e){return Jn===void 0&&Zf(),Jn?Jn.createHTML(e):e}const ol={...Ya,inline:!1},tp={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},np={display:"inline-block"},vi={backgroundColor:"currentColor"},sl={backgroundColor:"transparent"},hs={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},fs={WebkitMask:vi,mask:vi,background:sl};for(const e in fs){const t=fs[e];for(const n in hs)t[e+n]=hs[n]}const rp={...ol,inline:!0};function ps(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const ip=(e,t,n,r)=>{const i=n?rp:ol,s=Kf(i,t),a=t.mode||"svg",c={},f=t.style||{},v={...a==="svg"?tp:{},ref:r};for(let D in t){const A=t[D];if(A!==void 0)switch(D){case"icon":case"style":case"children":case"onLoad":case"mode":case"_ref":case"_inline":break;case"inline":case"hFlip":case"vFlip":s[D]=A===!0||A==="true"||A===1;break;case"flip":typeof A=="string"&&Gf(s,A);break;case"color":c.color=A;break;case"rotate":typeof A=="string"?s[D]=Hf(A):typeof A=="number"&&(s[D]=A);break;case"ariaHidden":case"aria-hidden":A!==!0&&A!=="true"&&delete v["aria-hidden"];break;default:i[D]===void 0&&(v[D]=A)}}const l=mf(e,s),u=l.attributes;if(s.inline&&(c.verticalAlign="-0.125em"),a==="svg"){v.style={...c,...f},Object.assign(v,u);let D=0,A=t.id;return typeof A=="string"&&(A=A.replace(/-/g,"_")),v.dangerouslySetInnerHTML={__html:ep(bf(l.body,A?()=>A+"ID"+D++:"iconifyReact"))},Mt.createElement("svg",v)}const{body:T,width:y,height:S}=e,j=a==="mask"||(a==="bg"?!1:T.indexOf("currentColor")!==-1),_=Xf(T,{...u,width:y+"",height:S+""});return v.style={...c,"--svg":Jf(_),width:ps(u.width),height:ps(u.height),...np,...j?vi:sl,...f},Mt.createElement("span",v)};Ha(!0);xf("",If);if(typeof document<"u"&&typeof window<"u"){il();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!df(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;wf(n,i)||console.error(r)}catch{console.error(r)}}}}class al extends Mt.Component{constructor(t){super(t),this.state={icon:null}}_abortLoading(){this._loading&&(this._loading.abort(),this._loading=null)}_setData(t){this.state.icon!==t&&this.setState({icon:t})}_checkIcon(t){const n=this.state,r=this.props.icon;if(typeof r=="object"&&r!==null&&typeof r.body=="string"){this._icon="",this._abortLoading(),(t||n.icon===null)&&this._setData({data:r});return}let i;if(typeof r!="string"||(i=_r(r,!1,!0))===null){this._abortLoading(),this._setData(null);return}const s=cf(i);if(!s){(!this._loading||this._loading.name!==r)&&(this._abortLoading(),this._icon="",this._setData(null),s!==null&&(this._loading={name:r,abort:qf([i],this._checkIcon.bind(this,!1))}));return}if(this._icon!==r||n.icon===null){this._abortLoading(),this._icon=r;const a=["iconify"];i.prefix!==""&&a.push("iconify--"+i.prefix),i.provider!==""&&a.push("iconify--"+i.provider),this._setData({data:s,classes:a}),this.props.onLoad&&this.props.onLoad(r)}}componentDidMount(){this._checkIcon(!1)}componentDidUpdate(t){t.icon!==this.props.icon&&this._checkIcon(!0)}componentWillUnmount(){this._abortLoading()}render(){const t=this.props,n=this.state.icon;if(n===null)return t.children?t.children:Mt.createElement("span",{});let r=t;return n.classes&&(r={...t,className:(typeof t.className=="string"?t.className+" ":"")+n.classes.join(" ")}),ip({...lo,...n.data},r,t._inline,t._ref)}}const rr=Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!1};return Mt.createElement(al,r)});Mt.forwardRef(function(t,n){const r={...t,_ref:n,_inline:!0};return Mt.createElement(al,r)});var ll={exports:{}};(function(e,t){(function(n,r){e.exports=r(M)})(Se,n=>(()=>{var r={703:(c,f,v)=>{var l=v(414);function u(){}function T(){}T.resetWarningCache=u,c.exports=function(){function y(_,D,A,B,V,I){if(I!==l){var F=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw F.name="Invariant Violation",F}}function S(){return y}y.isRequired=y;var j={array:y,bool:y,func:y,number:y,object:y,string:y,symbol:y,any:y,arrayOf:S,element:y,elementType:y,instanceOf:S,node:y,objectOf:S,oneOf:S,oneOfType:S,shape:S,exact:S,checkPropTypes:T,resetWarningCache:u};return j.PropTypes=j,j}},697:(c,f,v)=>{c.exports=v(703)()},414:c=>{c.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},590:c=>{var f=typeof Element<"u",v=typeof Map=="function",l=typeof Set=="function",u=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function T(y,S){if(y===S)return!0;if(y&&S&&typeof y=="object"&&typeof S=="object"){if(y.constructor!==S.constructor)return!1;var j,_,D,A;if(Array.isArray(y)){if((j=y.length)!=S.length)return!1;for(_=j;_--!=0;)if(!T(y[_],S[_]))return!1;return!0}if(v&&y instanceof Map&&S instanceof Map){if(y.size!==S.size)return!1;for(A=y.entries();!(_=A.next()).done;)if(!S.has(_.value[0]))return!1;for(A=y.entries();!(_=A.next()).done;)if(!T(_.value[1],S.get(_.value[0])))return!1;return!0}if(l&&y instanceof Set&&S instanceof Set){if(y.size!==S.size)return!1;for(A=y.entries();!(_=A.next()).done;)if(!S.has(_.value[0]))return!1;return!0}if(u&&ArrayBuffer.isView(y)&&ArrayBuffer.isView(S)){if((j=y.length)!=S.length)return!1;for(_=j;_--!=0;)if(y[_]!==S[_])return!1;return!0}if(y.constructor===RegExp)return y.source===S.source&&y.flags===S.flags;if(y.valueOf!==Object.prototype.valueOf)return y.valueOf()===S.valueOf();if(y.toString!==Object.prototype.toString)return y.toString()===S.toString();if((j=(D=Object.keys(y)).length)!==Object.keys(S).length)return!1;for(_=j;_--!=0;)if(!Object.prototype.hasOwnProperty.call(S,D[_]))return!1;if(f&&y instanceof Element)return!1;for(_=j;_--!=0;)if((D[_]!=="_owner"&&D[_]!=="__v"&&D[_]!=="__o"||!y.$$typeof)&&!T(y[D[_]],S[D[_]]))return!1;return!0}return y!=y&&S!=S}c.exports=function(y,S){try{return T(y,S)}catch(j){if((j.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw j}}},359:c=>{c.exports=n}},i={};function s(c){var f=i[c];if(f!==void 0)return f.exports;var v=i[c]={exports:{}};return r[c](v,v.exports,s),v.exports}s.n=c=>{var f=c&&c.__esModule?()=>c.default:()=>c;return s.d(f,{a:f}),f},s.d=(c,f)=>{for(var v in f)s.o(f,v)&&!s.o(c,v)&&Object.defineProperty(c,v,{enumerable:!0,get:f[v]})},s.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),s.o=(c,f)=>Object.prototype.hasOwnProperty.call(c,f),s.r=c=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})};var a={};return(()=>{function c(b){var p,E,k="";if(typeof b=="string"||typeof b=="number")k+=b;else if(typeof b=="object")if(Array.isArray(b))for(p=0;p<b.length;p++)b[p]&&(E=c(b[p]))&&(k&&(k+=" "),k+=E);else for(p in b)b[p]&&(k&&(k+=" "),k+=p);return k}function f(){for(var b,p,E=0,k="";E<arguments.length;)(b=arguments[E++])&&(p=c(b))&&(k&&(k+=" "),k+=p);return k}s.r(a),s.d(a,{default:()=>kl});var v=s(359),l=s.n(v);const u=function(b){var p=typeof b;return b!=null&&(p=="object"||p=="function")},T=typeof Se=="object"&&Se&&Se.Object===Object&&Se;var y=typeof self=="object"&&self&&self.Object===Object&&self;const S=T||y||Function("return this")(),j=function(){return S.Date.now()};var _=/\s/,D=/^\s+/;const A=function(b){return b&&b.slice(0,function(p){for(var E=p.length;E--&&_.test(p.charAt(E)););return E}(b)+1).replace(D,"")},B=S.Symbol;var V=Object.prototype,I=V.hasOwnProperty,F=V.toString,G=B?B.toStringTag:void 0,$=Object.prototype.toString,le=B?B.toStringTag:void 0;const H=function(b){return b==null?b===void 0?"[object Undefined]":"[object Null]":le&&le in Object(b)?function(p){var E=I.call(p,G),k=p[G];try{p[G]=void 0;var q=!0}catch{}var re=F.call(p);return q&&(E?p[G]=k:delete p[G]),re}(b):function(p){return $.call(p)}(b)};var se=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,We=/^0o[0-7]+$/i,Me=parseInt;const Qe=function(b){if(typeof b=="number")return b;if(function(k){return typeof k=="symbol"||function(q){return q!=null&&typeof q=="object"}(k)&&H(k)=="[object Symbol]"}(b))return NaN;if(u(b)){var p=typeof b.valueOf=="function"?b.valueOf():b;b=u(p)?p+"":p}if(typeof b!="string")return b===0?b:+b;b=A(b);var E=je.test(b);return E||We.test(b)?Me(b.slice(2),E?2:8):se.test(b)?NaN:+b};var Z=Math.max,pe=Math.min;const ee=function(b,p,E){var k,q,re,me,g,m,C=0,U=!1,K=!1,z=!0;if(typeof b!="function")throw new TypeError("Expected a function");function ue(ie){var fe=k,be=q;return k=q=void 0,C=ie,me=b.apply(be,fe)}function ce(ie){return C=ie,g=setTimeout(X,p),U?ue(ie):me}function he(ie){var fe=ie-m;return m===void 0||fe>=p||fe<0||K&&ie-C>=re}function X(){var ie=j();if(he(ie))return Q(ie);g=setTimeout(X,function(fe){var be=p-(fe-m);return K?pe(be,re-(fe-C)):be}(ie))}function Q(ie){return g=void 0,z&&k?ue(ie):(k=q=void 0,me)}function J(){var ie=j(),fe=he(ie);if(k=arguments,q=this,m=ie,fe){if(g===void 0)return ce(m);if(K)return clearTimeout(g),g=setTimeout(X,p),ue(m)}return g===void 0&&(g=setTimeout(X,p)),me}return p=Qe(p)||0,u(E)&&(U=!!E.leading,re=(K="maxWait"in E)?Z(Qe(E.maxWait)||0,p):re,z="trailing"in E?!!E.trailing:z),J.cancel=function(){g!==void 0&&clearTimeout(g),C=0,k=m=q=g=void 0},J.flush=function(){return g===void 0?me:Q(j())},J},ye=function(b,p,E){var k=!0,q=!0;if(typeof b!="function")throw new TypeError("Expected a function");return u(E)&&(k="leading"in E?!!E.leading:k,q="trailing"in E?!!E.trailing:q),ee(b,p,{leading:k,maxWait:p,trailing:q})};var oe=s(590),Ae=s.n(oe),we=function(){if(typeof Map<"u")return Map;function b(p,E){var k=-1;return p.some(function(q,re){return q[0]===E&&(k=re,!0)}),k}return function(){function p(){this.__entries__=[]}return Object.defineProperty(p.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),p.prototype.get=function(E){var k=b(this.__entries__,E),q=this.__entries__[k];return q&&q[1]},p.prototype.set=function(E,k){var q=b(this.__entries__,E);~q?this.__entries__[q][1]=k:this.__entries__.push([E,k])},p.prototype.delete=function(E){var k=this.__entries__,q=b(k,E);~q&&k.splice(q,1)},p.prototype.has=function(E){return!!~b(this.__entries__,E)},p.prototype.clear=function(){this.__entries__.splice(0)},p.prototype.forEach=function(E,k){k===void 0&&(k=null);for(var q=0,re=this.__entries__;q<re.length;q++){var me=re[q];E.call(k,me[1],me[0])}},p}()}(),Je=typeof window<"u"&&typeof document<"u"&&window.document===document,qe=s.g!==void 0&&s.g.Math===Math?s.g:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")(),Gt=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(qe):function(b){return setTimeout(function(){return b(Date.now())},1e3/60)},Ht=["top","right","bottom","left","width","height","size","weight"],Ft=typeof MutationObserver<"u",Xt=function(){function b(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(p,E){var k=!1,q=!1,re=0;function me(){k&&(k=!1,p()),q&&m()}function g(){Gt(me)}function m(){var C=Date.now();if(k){if(C-re<2)return;q=!0}else k=!0,q=!1,setTimeout(g,20);re=C}return m}(this.refresh.bind(this))}return b.prototype.addObserver=function(p){~this.observers_.indexOf(p)||this.observers_.push(p),this.connected_||this.connect_()},b.prototype.removeObserver=function(p){var E=this.observers_,k=E.indexOf(p);~k&&E.splice(k,1),!E.length&&this.connected_&&this.disconnect_()},b.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},b.prototype.updateObservers_=function(){var p=this.observers_.filter(function(E){return E.gatherActive(),E.hasActive()});return p.forEach(function(E){return E.broadcastActive()}),p.length>0},b.prototype.connect_=function(){Je&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Ft?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},b.prototype.disconnect_=function(){Je&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},b.prototype.onTransitionEnd_=function(p){var E=p.propertyName,k=E===void 0?"":E;Ht.some(function(q){return!!~k.indexOf(q)})&&this.refresh()},b.getInstance=function(){return this.instance_||(this.instance_=new b),this.instance_},b.instance_=null,b}(),Pe=function(b,p){for(var E=0,k=Object.keys(p);E<k.length;E++){var q=k[E];Object.defineProperty(b,q,{value:p[q],enumerable:!1,writable:!1,configurable:!0})}return b},Le=function(b){return b&&b.ownerDocument&&b.ownerDocument.defaultView||qe},Ze=ke(0,0,0,0);function de(b){return parseFloat(b)||0}function Yt(b){for(var p=[],E=1;E<arguments.length;E++)p[E-1]=arguments[E];return p.reduce(function(k,q){return k+de(b["border-"+q+"-width"])},0)}var Qt=typeof SVGGraphicsElement<"u"?function(b){return b instanceof Le(b).SVGGraphicsElement}:function(b){return b instanceof Le(b).SVGElement&&typeof b.getBBox=="function"};function Jt(b){return Je?Qt(b)?function(p){var E=p.getBBox();return ke(0,0,E.width,E.height)}(b):function(p){var E=p.clientWidth,k=p.clientHeight;if(!E&&!k)return Ze;var q=Le(p).getComputedStyle(p),re=function(z){for(var ue={},ce=0,he=["top","right","bottom","left"];ce<he.length;ce++){var X=he[ce],Q=z["padding-"+X];ue[X]=de(Q)}return ue}(q),me=re.left+re.right,g=re.top+re.bottom,m=de(q.width),C=de(q.height);if(q.boxSizing==="border-box"&&(Math.round(m+me)!==E&&(m-=Yt(q,"left","right")+me),Math.round(C+g)!==k&&(C-=Yt(q,"top","bottom")+g)),!function(z){return z===Le(z).document.documentElement}(p)){var U=Math.round(m+me)-E,K=Math.round(C+g)-k;Math.abs(U)!==1&&(m-=U),Math.abs(K)!==1&&(C-=K)}return ke(re.left,re.top,m,C)}(b):Ze}function ke(b,p,E,k){return{x:b,y:p,width:E,height:k}}var Bt=function(){function b(p){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ke(0,0,0,0),this.target=p}return b.prototype.isActive=function(){var p=Jt(this.target);return this.contentRect_=p,p.width!==this.broadcastWidth||p.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var p=this.contentRect_;return this.broadcastWidth=p.width,this.broadcastHeight=p.height,p},b}(),Nn=function(b,p){var E,k,q,re,me,g,m,C=(k=(E=p).x,q=E.y,re=E.width,me=E.height,g=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(g.prototype),Pe(m,{x:k,y:q,width:re,height:me,top:q,right:k+re,bottom:me+q,left:k}),m);Pe(this,{target:b,contentRect:C})},et=function(){function b(p,E,k){if(this.activeObservations_=[],this.observations_=new we,typeof p!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=p,this.controller_=E,this.callbackCtx_=k}return b.prototype.observe=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)||(E.set(p,new Bt(p)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(p){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element<"u"&&Element instanceof Object){if(!(p instanceof Le(p).Element))throw new TypeError('parameter 1 is not of type "Element".');var E=this.observations_;E.has(p)&&(E.delete(p),E.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var p=this;this.clearActive(),this.observations_.forEach(function(E){E.isActive()&&p.activeObservations_.push(E)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var p=this.callbackCtx_,E=this.activeObservations_.map(function(k){return new Nn(k.target,k.broadcastRect())});this.callback_.call(p,E,p),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0},b}(),Zt=typeof WeakMap<"u"?new WeakMap:new we,en=function b(p){if(!(this instanceof b))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var E=Xt.getInstance(),k=new et(p,E,this);Zt.set(this,k)};["observe","unobserve","disconnect"].forEach(function(b){en.prototype[b]=function(){var p;return(p=Zt.get(this))[b].apply(p,arguments)}});const tn=qe.ResizeObserver!==void 0?qe.ResizeObserver:en,Fe="Left",tt="Right",wt="Up",ot="Down",Et={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},It={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Ke="mousemove",bn="mouseup";function nn(b,p){if(p===0)return b;const E=Math.PI/180*p;return[b[0]*Math.cos(E)+b[1]*Math.sin(E),b[1]*Math.cos(E)-b[0]*Math.sin(E)]}function xn(b){const{trackMouse:p}=b,E=v.useRef(Object.assign({},It)),k=v.useRef(Object.assign({},Et)),q=v.useRef(Object.assign({},k.current));let re;for(re in q.current=Object.assign({},k.current),k.current=Object.assign(Object.assign({},Et),b),Et)k.current[re]===void 0&&(k.current[re]=Et[re]);const[me,g]=v.useMemo(()=>function(m,C){const U=X=>{const Q="touches"in X;Q&&X.touches.length>1||m((J,ie)=>{ie.trackMouse&&!Q&&(document.addEventListener(Ke,K),document.addEventListener(bn,ue));const{clientX:fe,clientY:be}=Q?X.touches[0]:X,_e=nn([fe,be],ie.rotationAngle);return ie.onTouchStartOrOnMouseDown&&ie.onTouchStartOrOnMouseDown({event:X}),Object.assign(Object.assign(Object.assign({},J),It),{initial:_e.slice(),xy:_e,start:X.timeStamp||0})})},K=X=>{m((Q,J)=>{const ie="touches"in X;if(ie&&X.touches.length>1)return Q;if(X.timeStamp-Q.start>J.swipeDuration)return Q.swiping?Object.assign(Object.assign({},Q),{swiping:!1}):Q;const{clientX:fe,clientY:be}=ie?X.touches[0]:X,[_e,lt]=nn([fe,be],J.rotationAngle),nt=_e-Q.xy[0],Ve=lt-Q.xy[1],Re=Math.abs(nt),xe=Math.abs(Ve),Wt=(X.timeStamp||0)-Q.start,Bn=Math.sqrt(Re*Re+xe*xe)/(Wt||1),$n=[nt/(Wt||1),Ve/(Wt||1)],_t=function(Un,kn,Wn,ct){return Un>kn?Wn>0?tt:Fe:ct>0?ot:wt}(Re,xe,nt,Ve),cn=typeof J.delta=="number"?J.delta:J.delta[_t.toLowerCase()]||Et.delta;if(Re<cn&&xe<cn&&!Q.swiping)return Q;const Tt={absX:Re,absY:xe,deltaX:nt,deltaY:Ve,dir:_t,event:X,first:Q.first,initial:Q.initial,velocity:Bn,vxvy:$n};Tt.first&&J.onSwipeStart&&J.onSwipeStart(Tt),J.onSwiping&&J.onSwiping(Tt);let jn=!1;return(J.onSwiping||J.onSwiped||J[`onSwiped${_t}`])&&(jn=!0),jn&&J.preventScrollOnSwipe&&J.trackTouch&&X.cancelable&&X.preventDefault(),Object.assign(Object.assign({},Q),{first:!1,eventData:Tt,swiping:!0})})},z=X=>{m((Q,J)=>{let ie;if(Q.swiping&&Q.eventData){if(X.timeStamp-Q.start<J.swipeDuration){ie=Object.assign(Object.assign({},Q.eventData),{event:X}),J.onSwiped&&J.onSwiped(ie);const fe=J[`onSwiped${ie.dir}`];fe&&fe(ie)}}else J.onTap&&J.onTap({event:X});return J.onTouchEndOrOnMouseUp&&J.onTouchEndOrOnMouseUp({event:X}),Object.assign(Object.assign(Object.assign({},Q),It),{eventData:ie})})},ue=X=>{document.removeEventListener(Ke,K),document.removeEventListener(bn,ue),z(X)},ce=(X,Q)=>{let J=()=>{};if(X&&X.addEventListener){const ie=Object.assign(Object.assign({},Et.touchEventOptions),Q.touchEventOptions),fe=[["touchstart",U,ie],["touchmove",K,Object.assign(Object.assign({},ie),Q.preventScrollOnSwipe?{passive:!1}:{})],["touchend",z,ie]];fe.forEach(([be,_e,lt])=>X.addEventListener(be,_e,lt)),J=()=>fe.forEach(([be,_e])=>X.removeEventListener(be,_e))}return J},he={ref:X=>{X!==null&&m((Q,J)=>{if(Q.el===X)return Q;const ie={};return Q.el&&Q.el!==X&&Q.cleanUpTouch&&(Q.cleanUpTouch(),ie.cleanUpTouch=void 0),J.trackTouch&&X&&(ie.cleanUpTouch=ce(X,J)),Object.assign(Object.assign(Object.assign({},Q),{el:X}),ie)})}};return C.trackMouse&&(he.onMouseDown=U),[he,ce]}(m=>E.current=m(E.current,k.current),{trackMouse:p}),[p]);return E.current=function(m,C,U,K){return C.trackTouch&&m.el?m.cleanUpTouch?C.preventScrollOnSwipe!==U.preventScrollOnSwipe||C.touchEventOptions.passive!==U.touchEventOptions.passive?(m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)})):m:Object.assign(Object.assign({},m),{cleanUpTouch:K(m.el,C)}):(m.cleanUpTouch&&m.cleanUpTouch(),Object.assign(Object.assign({},m),{cleanUpTouch:void 0}))}(E.current,k.current,q.current,g),me}var R=s(697);function St(b){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},St(b)}function Ct(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function rn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Ct(Object(E),!0).forEach(function(k){d(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Ct(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function d(b,p,E){return(p=function(k){var q=function(re,me){if(St(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(St(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return St(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var x={description:"",fullscreen:"",isFullscreen:!1,originalAlt:"",originalHeight:"",originalWidth:"",originalTitle:"",sizes:"",srcSet:"",loading:"eager"},w=l().memo(function(b){var p=rn(rn({},x),b),E=p.description,k=p.fullscreen,q=p.handleImageLoaded,re=p.isFullscreen,me=p.onImageError,g=p.original,m=p.originalAlt,C=p.originalHeight,U=p.originalWidth,K=p.originalTitle,z=p.sizes,ue=p.srcSet,ce=p.loading,he=re&&k||g;return l().createElement(l().Fragment,null,l().createElement("img",{className:"image-gallery-image",src:he,alt:m,srcSet:ue,height:C,width:U,sizes:z,title:K,onLoad:function(X){return q(X,g)},onError:me,loading:ce}),E&&l().createElement("span",{className:"image-gallery-description"},E))});w.displayName="Item",w.propTypes={description:R.string,fullscreen:R.string,handleImageLoaded:R.func.isRequired,isFullscreen:R.bool,onImageError:R.func.isRequired,original:R.string.isRequired,originalAlt:R.string,originalHeight:R.string,originalWidth:R.string,originalTitle:R.string,sizes:R.string,srcSet:R.string,loading:R.string};const P=w;function O(b){return O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},O(b)}function L(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function W(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?L(Object(E),!0).forEach(function(k){ne(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):L(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function ne(b,p,E){return(p=function(k){var q=function(re,me){if(O(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(O(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return O(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var ae={left:l().createElement("polyline",{points:"15 18 9 12 15 6"}),right:l().createElement("polyline",{points:"9 18 15 12 9 6"}),maximize:l().createElement("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"}),minimize:l().createElement("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"}),play:l().createElement("polygon",{points:"5 3 19 12 5 21 5 3"}),pause:l().createElement(l().Fragment,null,l().createElement("rect",{x:"6",y:"4",width:"4",height:"16"}),l().createElement("rect",{x:"14",y:"4",width:"4",height:"16"}))},Be={strokeWidth:1,viewBox:"0 0 24 24"},Ne=function(b){var p=W(W({},Be),b),E=p.strokeWidth,k=p.viewBox,q=p.icon;return l().createElement("svg",{className:"image-gallery-svg",xmlns:"http://www.w3.org/2000/svg",viewBox:k,fill:"none",stroke:"currentColor",strokeWidth:E,strokeLinecap:"round",strokeLinejoin:"round"},ae[q])};Ne.propTypes={strokeWidth:R.number,viewBox:R.string,icon:(0,R.oneOf)(["left","right","maximize","minimize","play","pause"]).isRequired};const Ee=Ne;var Te=l().memo(function(b){var p=b.isFullscreen,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-fullscreen-button",onClick:E,"aria-label":"Open Fullscreen"},l().createElement(Ee,{strokeWidth:2,icon:p?"minimize":"maximize"}))});Te.displayName="Fullscreen",Te.propTypes={isFullscreen:R.bool.isRequired,onClick:R.func.isRequired};const Xe=Te;var Rt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-left-nav",disabled:p,onClick:E,"aria-label":"Previous Slide"},l().createElement(Ee,{icon:"left",viewBox:"6 0 12 24"}))});Rt.displayName="LeftNav",Rt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const An=Rt;var Pt=l().memo(function(b){var p=b.disabled,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-right-nav",disabled:p,onClick:E,"aria-label":"Next Slide"},l().createElement(Ee,{icon:"right",viewBox:"6 0 12 24"}))});Pt.displayName="RightNav",Pt.propTypes={disabled:R.bool.isRequired,onClick:R.func.isRequired};const st=Pt;var $t=l().memo(function(b){var p=b.isPlaying,E=b.onClick;return l().createElement("button",{type:"button",className:"image-gallery-icon image-gallery-play-button",onClick:E,"aria-label":"Play or Pause Slideshow"},l().createElement(Ee,{strokeWidth:2,icon:p?"pause":"play"}))});$t.displayName="PlayPause",$t.propTypes={isPlaying:R.bool.isRequired,onClick:R.func.isRequired};const Ut=$t;function ft(b){return ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},ft(b)}function at(){return at=Object.assign?Object.assign.bind():function(b){for(var p=1;p<arguments.length;p++){var E=arguments[p];for(var k in E)Object.prototype.hasOwnProperty.call(E,k)&&(b[k]=E[k])}return b},at.apply(this,arguments)}function Lt(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function wn(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Lt(Object(E),!0).forEach(function(k){En(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Lt(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function En(b,p,E){return(p=function(k){var q=function(re,me){if(ft(re)!=="object"||re===null)return re;var g=re[Symbol.toPrimitive];if(g!==void 0){var m=g.call(re,me);if(ft(m)!=="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(re)}(k,"string");return ft(q)==="symbol"?q:String(q)}(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}var ar={className:"",delta:0,onSwiping:function(){},onSwiped:function(){}},Dn=function(b){var p=wn(wn({},ar),b),E=p.children,k=p.className,q=xn({delta:p.delta,onSwiping:p.onSwiping,onSwiped:p.onSwiped});return l().createElement("div",at({},q,{className:k}),E)};Dn.propTypes={children:R.node.isRequired,className:R.string,delta:R.number,onSwiped:R.func,onSwiping:R.func};const Mn=Dn;function $e(b){return $e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},$e(b)}function Sn(b,p){var E=Object.keys(b);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(b);p&&(k=k.filter(function(q){return Object.getOwnPropertyDescriptor(b,q).enumerable})),E.push.apply(E,k)}return E}function on(b){for(var p=1;p<arguments.length;p++){var E=arguments[p]!=null?arguments[p]:{};p%2?Sn(Object(E),!0).forEach(function(k){an(b,k,E[k])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(E)):Sn(Object(E)).forEach(function(k){Object.defineProperty(b,k,Object.getOwnPropertyDescriptor(E,k))})}return b}function Tn(b,p){for(var E=0;E<p.length;E++){var k=p[E];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(b,ln(k.key),k)}}function sn(b,p){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,k){return E.__proto__=k,E},sn(b,p)}function Fn(b,p){if(p&&($e(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oe(b)}function Oe(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function vt(b){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(p){return p.__proto__||Object.getPrototypeOf(p)},vt(b)}function an(b,p,E){return(p=ln(p))in b?Object.defineProperty(b,p,{value:E,enumerable:!0,configurable:!0,writable:!0}):b[p]=E,b}function ln(b){var p=function(E,k){if($e(E)!=="object"||E===null)return E;var q=E[Symbol.toPrimitive];if(q!==void 0){var re=q.call(E,k);if($e(re)!=="object")return re;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(E)}(b,"string");return $e(p)==="symbol"?p:String(p)}var lr=["fullscreenchange","MSFullscreenChange","mozfullscreenchange","webkitfullscreenchange"],jl=(0,R.arrayOf)((0,R.shape)({srcSet:R.string,media:R.string}));function To(b){var p=parseInt(b.keyCode||b.which||0,10);return p===66||p===62}var Dr=function(b){(function(g,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(m&&m.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),m&&sn(g,m)})(me,b);var p,E,k,q,re=(k=me,q=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var g,m=vt(k);if(q){var C=vt(this).constructor;g=Reflect.construct(m,arguments,C)}else g=m.apply(this,arguments);return Fn(this,g)});function me(g){var m;return function(C,U){if(!(C instanceof U))throw new TypeError("Cannot call a class as a function")}(this,me),an(Oe(m=re.call(this,g)),"onBulletClick",function(C,U){var K=m.props,z=K.onBulletClick,ue=K.items,ce=m.state.currentIndex;C.target.blur(),ce!==U&&(ue.length===2?m.slideToIndexWithStyleReset(U,C):m.slideToIndex(U,C)),z&&z(C,U)}),m.state={currentIndex:g.startIndex,thumbsTranslate:0,thumbsSwipedTranslate:0,currentSlideOffset:0,galleryWidth:0,thumbnailsWrapperWidth:0,thumbnailsWrapperHeight:0,thumbsStyle:{transition:"all ".concat(g.slideDuration,"ms ease-out")},isFullscreen:!1,isSwipingThumbnail:!1,isPlaying:!1},m.loadedImages={},m.imageGallery=l().createRef(),m.thumbnailsWrapper=l().createRef(),m.thumbnails=l().createRef(),m.imageGallerySlideWrapper=l().createRef(),m.handleImageLoaded=m.handleImageLoaded.bind(Oe(m)),m.handleKeyDown=m.handleKeyDown.bind(Oe(m)),m.handleMouseDown=m.handleMouseDown.bind(Oe(m)),m.handleResize=m.handleResize.bind(Oe(m)),m.handleTouchMove=m.handleTouchMove.bind(Oe(m)),m.handleOnSwiped=m.handleOnSwiped.bind(Oe(m)),m.handleScreenChange=m.handleScreenChange.bind(Oe(m)),m.handleSwiping=m.handleSwiping.bind(Oe(m)),m.handleThumbnailSwiping=m.handleThumbnailSwiping.bind(Oe(m)),m.handleOnThumbnailSwiped=m.handleOnThumbnailSwiped.bind(Oe(m)),m.onThumbnailMouseLeave=m.onThumbnailMouseLeave.bind(Oe(m)),m.handleImageError=m.handleImageError.bind(Oe(m)),m.pauseOrPlay=m.pauseOrPlay.bind(Oe(m)),m.renderThumbInner=m.renderThumbInner.bind(Oe(m)),m.renderItem=m.renderItem.bind(Oe(m)),m.slideLeft=m.slideLeft.bind(Oe(m)),m.slideRight=m.slideRight.bind(Oe(m)),m.toggleFullScreen=m.toggleFullScreen.bind(Oe(m)),m.togglePlay=m.togglePlay.bind(Oe(m)),m.unthrottledSlideToIndex=m.slideToIndex,m.slideToIndex=ye(m.unthrottledSlideToIndex,g.slideDuration,{trailing:!1}),g.lazyLoad&&(m.lazyLoaded=[]),m}return p=me,E=[{key:"componentDidMount",value:function(){var g=this.props,m=g.autoPlay,C=g.useWindowKeyDown;m&&this.play(),C?window.addEventListener("keydown",this.handleKeyDown):this.imageGallery.current.addEventListener("keydown",this.handleKeyDown),window.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),this.addScreenChangeEvent()}},{key:"componentDidUpdate",value:function(g,m){var C=this.props,U=C.items,K=C.lazyLoad,z=C.slideDuration,ue=C.slideInterval,ce=C.startIndex,he=C.thumbnailPosition,X=C.showThumbnails,Q=C.useWindowKeyDown,J=this.state,ie=J.currentIndex,fe=J.isPlaying,be=g.items.length!==U.length,_e=!Ae()(g.items,U),lt=g.startIndex!==ce,nt=g.thumbnailPosition!==he,Ve=g.showThumbnails!==X;ue===g.slideInterval&&z===g.slideDuration||fe&&(this.pause(),this.play()),nt&&(this.removeResizeObserver(),this.initSlideWrapperResizeObserver(this.imageGallerySlideWrapper),this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper)),Ve&&X&&this.initThumbnailWrapperResizeObserver(this.thumbnailsWrapper),Ve&&!X&&this.removeThumbnailsResizeObserver(),(be||Ve)&&this.handleResize(),m.currentIndex!==ie&&this.slideThumbnailBar(),g.slideDuration!==z&&(this.slideToIndex=ye(this.unthrottledSlideToIndex,z,{trailing:!1})),!K||g.lazyLoad&&!_e||(this.lazyLoaded=[]),Q!==g.useWindowKeyDown&&(Q?(this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown),window.addEventListener("keydown",this.handleKeyDown)):(window.removeEventListener("keydown",this.handleKeyDown),this.imageGallery.current.addEventListener("keydown",this.handleKeyDown))),(lt||_e)&&this.setState({currentIndex:ce,slideStyle:{transition:"none"}})}},{key:"componentWillUnmount",value:function(){var g=this.props.useWindowKeyDown;window.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("touchmove",this.handleTouchMove),this.removeScreenChangeEvent(),this.removeResizeObserver(),this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null),this.transitionTimer&&window.clearTimeout(this.transitionTimer),g?window.removeEventListener("keydown",this.handleKeyDown):this.imageGallery.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"onSliding",value:function(){var g=this,m=this.state,C=m.currentIndex,U=m.isTransitioning,K=this.props,z=K.onSlide,ue=K.slideDuration;this.transitionTimer=window.setTimeout(function(){U&&(g.setState({isTransitioning:!U,isSwipingThumbnail:!1}),z&&z(C))},ue+50)}},{key:"onThumbnailClick",value:function(g,m){var C=this.props,U=C.onThumbnailClick,K=C.items,z=this.state.currentIndex;g.target.parentNode.parentNode.blur(),z!==m&&(K.length===2?this.slideToIndexWithStyleReset(m,g):this.slideToIndex(m,g)),U&&U(g,m)}},{key:"onThumbnailMouseOver",value:function(g,m){var C=this;this.thumbnailMouseOverTimer&&(window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null),this.thumbnailMouseOverTimer=window.setTimeout(function(){C.slideToIndex(m),C.pause()},300)}},{key:"onThumbnailMouseLeave",value:function(){if(this.thumbnailMouseOverTimer){var g=this.props.autoPlay;window.clearTimeout(this.thumbnailMouseOverTimer),this.thumbnailMouseOverTimer=null,g&&this.play()}}},{key:"setThumbsTranslate",value:function(g){this.setState({thumbsTranslate:g})}},{key:"setModalFullscreen",value:function(g){var m=this.props.onScreenChange;this.setState({modalFullscreen:g}),m&&m(g)}},{key:"getThumbsTranslate",value:function(g){var m,C=this.props,U=C.disableThumbnailScroll,K=C.items,z=this.state,ue=z.thumbnailsWrapperWidth,ce=z.thumbnailsWrapperHeight,he=this.thumbnails&&this.thumbnails.current;if(U)return 0;if(he){if(this.isThumbnailVertical()){if(he.scrollHeight<=ce)return 0;m=he.scrollHeight-ce}else{if(he.scrollWidth<=ue||ue<=0)return 0;m=he.scrollWidth-ue}return g*(m/(K.length-1))}return 0}},{key:"getThumbnailPositionClassName",value:function(g){switch(g){case"left":g=" ".concat("image-gallery-thumbnails-left");break;case"right":g=" ".concat("image-gallery-thumbnails-right");break;case"bottom":g=" ".concat("image-gallery-thumbnails-bottom");break;case"top":g=" ".concat("image-gallery-thumbnails-top")}return g}},{key:"getAlignmentClassName",value:function(g){var m=this.state.currentIndex,C=this.props,U=C.infinite,K=C.items,z="",ue="image-gallery-left",ce="image-gallery-right";switch(g){case m-1:z=" ".concat(ue);break;case m:z=" ".concat("image-gallery-center");break;case m+1:z=" ".concat(ce)}return K.length>=3&&U&&(g===0&&m===K.length-1?z=" ".concat(ce):g===K.length-1&&m===0&&(z=" ".concat(ue))),z}},{key:"getTranslateXForTwoSlide",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.previousIndex,z=C!==K,ue=g===0&&K===0,ce=g===1&&K===1,he=g===0&&C===1,X=g===1&&C===0,Q=U===0,J=-100*C+100*g+U;return U>0?this.direction="left":U<0&&(this.direction="right"),X&&U>0&&(J=-100+U),he&&U<0&&(J=100+U),z?ue&&Q&&this.direction==="left"?J=100:ce&&Q&&this.direction==="right"&&(J=-100):(X&&Q&&this.direction==="left"&&(J=-100),he&&Q&&this.direction==="right"&&(J=100)),J}},{key:"getThumbnailBarHeight",value:function(){return this.isThumbnailVertical()?{height:this.state.gallerySlideWrapperHeight}:{}}},{key:"getSlideStyle",value:function(g){var m=this.state,C=m.currentIndex,U=m.currentSlideOffset,K=m.slideStyle,z=this.props,ue=z.infinite,ce=z.items,he=z.useTranslate3D,X=z.isRTL,Q=-100*C,J=ce.length-1,ie=(Q+100*g)*(X?-1:1)+U;ue&&ce.length>2&&(C===0&&g===J?ie=-100*(X?-1:1)+U:C===J&&g===0&&(ie=100*(X?-1:1)+U)),ue&&ce.length===2&&(ie=this.getTranslateXForTwoSlide(g));var fe="translate(".concat(ie,"%, 0)");return he&&(fe="translate3d(".concat(ie,"%, 0, 0)")),on({display:this.isSlideVisible(g)?"inherit":"none",WebkitTransform:fe,MozTransform:fe,msTransform:fe,OTransform:fe,transform:fe},K)}},{key:"getCurrentIndex",value:function(){return this.state.currentIndex}},{key:"getThumbnailStyle",value:function(){var g,m=this.props,C=m.useTranslate3D,U=m.isRTL,K=this.state,z=K.thumbsTranslate,ue=K.thumbsStyle,ce=U?-1*z:z;return this.isThumbnailVertical()?(g="translate(0, ".concat(z,"px)"),C&&(g="translate3d(0, ".concat(z,"px, 0)"))):(g="translate(".concat(ce,"px, 0)"),C&&(g="translate3d(".concat(ce,"px, 0, 0)"))),on({WebkitTransform:g,MozTransform:g,msTransform:g,OTransform:g,transform:g},ue)}},{key:"getSlideItems",value:function(){var g=this,m=this.state.currentIndex,C=this.props,U=C.items,K=C.slideOnThumbnailOver,z=C.onClick,ue=C.lazyLoad,ce=C.onTouchMove,he=C.onTouchEnd,X=C.onTouchStart,Q=C.onMouseOver,J=C.onMouseLeave,ie=C.renderItem,fe=C.renderThumbInner,be=C.showThumbnails,_e=C.showBullets,lt=[],nt=[],Ve=[];return U.forEach(function(Re,xe){var Wt=g.getAlignmentClassName(xe),Bn=Re.originalClass?" ".concat(Re.originalClass):"",$n=Re.thumbnailClass?" ".concat(Re.thumbnailClass):"",_t=Re.renderItem||ie||g.renderItem,cn=Re.renderThumbInner||fe||g.renderThumbInner,Tt=!ue||Wt||g.lazyLoaded[xe];Tt&&ue&&!g.lazyLoaded[xe]&&(g.lazyLoaded[xe]=!0);var jn=g.getSlideStyle(xe),Un=l().createElement("div",{"aria-label":"Go to Slide ".concat(xe+1),key:"slide-".concat(xe),tabIndex:"-1",className:"image-gallery-slide ".concat(Wt," ").concat(Bn),style:jn,onClick:z,onKeyUp:g.handleSlideKeyUp,onTouchMove:ce,onTouchEnd:he,onTouchStart:X,onMouseOver:Q,onFocus:Q,onMouseLeave:J,role:"button"},Tt?_t(Re):l().createElement("div",{style:{height:"100%"}}));if(lt.push(Un),be&&Re.thumbnail){var kn=f("image-gallery-thumbnail",$n,{active:m===xe});nt.push(l().createElement("button",{key:"thumbnail-".concat(xe),type:"button",tabIndex:"0","aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1),className:kn,onMouseLeave:K?g.onThumbnailMouseLeave:null,onMouseOver:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onFocus:function(ct){return g.handleThumbnailMouseOver(ct,xe)},onKeyUp:function(ct){return g.handleThumbnailKeyUp(ct,xe)},onClick:function(ct){return g.onThumbnailClick(ct,xe)}},cn(Re)))}if(_e){var Wn=f("image-gallery-bullet",Re.bulletClass,{active:m===xe});Ve.push(l().createElement("button",{type:"button",key:"bullet-".concat(xe),className:Wn,onClick:function(ct){return g.onBulletClick(ct,xe)},"aria-pressed":m===xe?"true":"false","aria-label":"Go to Slide ".concat(xe+1)}))}}),{slides:lt,thumbnails:nt,bullets:Ve}}},{key:"ignoreIsTransitioning",value:function(){var g=this.props.items,m=this.state,C=m.previousIndex,U=m.currentIndex,K=g.length-1;return Math.abs(C-U)>1&&!(C===0&&U===K)&&!(C===K&&U===0)}},{key:"isFirstOrLastSlide",value:function(g){return g===this.props.items.length-1||g===0}},{key:"slideIsTransitioning",value:function(g){var m=this.state,C=m.isTransitioning,U=m.previousIndex,K=m.currentIndex;return C&&!(g===U||g===K)}},{key:"isSlideVisible",value:function(g){return!this.slideIsTransitioning(g)||this.ignoreIsTransitioning()&&!this.isFirstOrLastSlide(g)}},{key:"slideThumbnailBar",value:function(){var g=this.state,m=g.currentIndex,C=g.isSwipingThumbnail,U=-this.getThumbsTranslate(m);C||(m===0?this.setState({thumbsTranslate:0,thumbsSwipedTranslate:0}):this.setState({thumbsTranslate:U,thumbsSwipedTranslate:U}))}},{key:"canSlide",value:function(){return this.props.items.length>=2}},{key:"canSlideLeft",value:function(){return this.props.infinite||this.canSlidePrevious()}},{key:"canSlideRight",value:function(){return this.props.infinite||this.canSlideNext()}},{key:"canSlidePrevious",value:function(){return this.state.currentIndex>0}},{key:"canSlideNext",value:function(){return this.state.currentIndex<this.props.items.length-1}},{key:"handleSwiping",value:function(g){var m=g.event,C=g.absX,U=g.dir,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=this.state,he=ce.galleryWidth,X=ce.isTransitioning,Q=ce.swipingUpDown,J=ce.swipingLeftRight;if(U!==wt&&U!==ot&&!Q||J){if(U!==Fe&&U!==tt||J||this.setState({swipingLeftRight:!0}),!z){var ie=this.props.swipingTransitionDuration;if(ue&&m.preventDefault(),X)this.setState({currentSlideOffset:0});else{var fe=U===tt?1:-1,be=C/he*100;Math.abs(be)>=100&&(be=100);var _e={transition:"transform ".concat(ie,"ms ease-out")};this.setState({currentSlideOffset:fe*be,slideStyle:_e})}}}else Q||this.setState({swipingUpDown:!0})}},{key:"handleThumbnailSwiping",value:function(g){var m=g.event,C=g.absX,U=g.absY,K=g.dir,z=this.props,ue=z.stopPropagation,ce=z.swipingThumbnailTransitionDuration,he=this.state,X=he.thumbsSwipedTranslate,Q=he.thumbnailsWrapperHeight,J=he.thumbnailsWrapperWidth,ie=he.swipingUpDown,fe=he.swipingLeftRight;if(this.isThumbnailVertical()){if((K===Fe||K===tt||fe)&&!ie)return void(fe||this.setState({swipingLeftRight:!0}));K!==wt&&K!==ot||ie||this.setState({swipingUpDown:!0})}else{if((K===wt||K===ot||ie)&&!fe)return void(ie||this.setState({swipingUpDown:!0}));K!==Fe&&K!==tt||fe||this.setState({swipingLeftRight:!0})}var be,_e,lt,nt,Ve,Re=this.thumbnails&&this.thumbnails.current;if(this.isThumbnailVertical()?(be=X+(K===ot?U:-U),_e=Re.scrollHeight-Q+20,lt=Math.abs(be)>_e,nt=be>20,Ve=Re.scrollHeight<=Q):(be=X+(K===tt?C:-C),_e=Re.scrollWidth-J+20,lt=Math.abs(be)>_e,nt=be>20,Ve=Re.scrollWidth<=J),!Ve&&(K!==Fe&&K!==wt||!lt)&&(K!==tt&&K!==ot||!nt)){ue&&m.stopPropagation();var xe={transition:"transform ".concat(ce,"ms ease-out")};this.setState({thumbsTranslate:be,thumbsStyle:xe})}}},{key:"handleOnThumbnailSwiped",value:function(){var g=this.state.thumbsTranslate,m=this.props.slideDuration;this.resetSwipingDirection(),this.setState({isSwipingThumbnail:!0,thumbsSwipedTranslate:g,thumbsStyle:{transition:"all ".concat(m,"ms ease-out")}})}},{key:"sufficientSwipe",value:function(){var g=this.state.currentSlideOffset,m=this.props.swipeThreshold;return Math.abs(g)>m}},{key:"resetSwipingDirection",value:function(){var g=this.state,m=g.swipingUpDown,C=g.swipingLeftRight;m&&this.setState({swipingUpDown:!1}),C&&this.setState({swipingLeftRight:!1})}},{key:"handleOnSwiped",value:function(g){var m=g.event,C=g.dir,U=g.velocity,K=this.props,z=K.disableSwipe,ue=K.stopPropagation,ce=K.flickThreshold;if(!z){var he=this.props.isRTL;ue&&m.stopPropagation(),this.resetSwipingDirection();var X=(C===Fe?1:-1)*(he?-1:1),Q=U>ce&&!(C===wt||C===ot);this.handleOnSwipedTo(X,Q)}}},{key:"handleOnSwipedTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=U;!this.sufficientSwipe()&&!m||K||(z+=g),(g===-1&&!this.canSlideLeft()||g===1&&!this.canSlideRight())&&(z=U),this.unthrottledSlideToIndex(z)}},{key:"handleTouchMove",value:function(g){this.state.swipingLeftRight&&g.preventDefault()}},{key:"handleMouseDown",value:function(){this.imageGallery.current.classList.add("image-gallery-using-mouse")}},{key:"handleKeyDown",value:function(g){var m=this.props,C=m.disableKeyDown,U=m.useBrowserFullscreen,K=this.state.isFullscreen;if(this.imageGallery.current.classList.remove("image-gallery-using-mouse"),!C)switch(parseInt(g.keyCode||g.which||0,10)){case 37:this.canSlideLeft()&&!this.playPauseIntervalId&&this.slideLeft(g);break;case 39:this.canSlideRight()&&!this.playPauseIntervalId&&this.slideRight(g);break;case 27:K&&!U&&this.exitFullScreen()}}},{key:"handleImageError",value:function(g){var m=this.props.onErrorImageURL;m&&g.target.src.indexOf(m)===-1&&(g.target.src=m)}},{key:"removeThumbnailsResizeObserver",value:function(){this.resizeThumbnailWrapperObserver&&this.thumbnailsWrapper&&this.thumbnailsWrapper.current&&(this.resizeThumbnailWrapperObserver.unobserve(this.thumbnailsWrapper.current),this.resizeThumbnailWrapperObserver=null)}},{key:"removeResizeObserver",value:function(){this.resizeSlideWrapperObserver&&this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&(this.resizeSlideWrapperObserver.unobserve(this.imageGallerySlideWrapper.current),this.resizeSlideWrapperObserver=null),this.removeThumbnailsResizeObserver()}},{key:"handleResize",value:function(){var g=this.state.currentIndex;this.imageGallery&&(this.imageGallery&&this.imageGallery.current&&this.setState({galleryWidth:this.imageGallery.current.offsetWidth}),this.imageGallerySlideWrapper&&this.imageGallerySlideWrapper.current&&this.setState({gallerySlideWrapperHeight:this.imageGallerySlideWrapper.current.offsetHeight}),this.setThumbsTranslate(-this.getThumbsTranslate(g)))}},{key:"initSlideWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeSlideWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperWidth:U.contentRect.width},m.handleResize)})},50)),this.resizeSlideWrapperObserver.observe(g.current))}},{key:"initThumbnailWrapperResizeObserver",value:function(g){var m=this;g&&!g.current||(this.resizeThumbnailWrapperObserver=new tn(ee(function(C){C&&C.forEach(function(U){m.setState({thumbnailsWrapperHeight:U.contentRect.height},m.handleResize)})},50)),this.resizeThumbnailWrapperObserver.observe(g.current))}},{key:"toggleFullScreen",value:function(){this.state.isFullscreen?this.exitFullScreen():this.fullScreen()}},{key:"togglePlay",value:function(){this.playPauseIntervalId?this.pause():this.play()}},{key:"handleScreenChange",value:function(){var g=this.props,m=g.onScreenChange,C=g.useBrowserFullscreen,U=document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement,K=this.imageGallery.current===U;m&&m(K),C&&this.setState({isFullscreen:K})}},{key:"slideToIndex",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props,ue=z.items,ce=z.slideDuration,he=z.onBeforeSlide;if(!K){m&&this.playPauseIntervalId&&(this.pause(!1),this.play(!1));var X=ue.length-1,Q=g;g<0?Q=X:g>X&&(Q=0),he&&Q!==U&&he(Q),this.setState({previousIndex:U,currentIndex:Q,isTransitioning:Q!==U,currentSlideOffset:0,slideStyle:{transition:"all ".concat(ce,"ms ease-out")}},this.onSliding)}}},{key:"slideLeft",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"right":"left")}},{key:"slideRight",value:function(g){var m=this.props.isRTL;this.slideTo(g,m?"left":"right")}},{key:"slideTo",value:function(g,m){var C=this.state,U=C.currentIndex,K=C.isTransitioning,z=this.props.items,ue=U+(m==="left"?-1:1);K||(z.length===2?this.slideToIndexWithStyleReset(ue,g):this.slideToIndex(ue,g))}},{key:"slideToIndexWithStyleReset",value:function(g,m){var C=this,U=this.state,K=U.currentIndex,z=U.currentSlideOffset;this.setState({currentSlideOffset:z+(K>g?.001:-.001),slideStyle:{transition:"none"}},function(){window.setTimeout(function(){return C.slideToIndex(g,m)},25)})}},{key:"handleThumbnailMouseOver",value:function(g,m){this.props.slideOnThumbnailOver&&this.onThumbnailMouseOver(g,m)}},{key:"handleThumbnailKeyUp",value:function(g,m){To(g)&&this.onThumbnailClick(g,m)}},{key:"handleSlideKeyUp",value:function(g){To(g)&&(0,this.props.onClick)(g)}},{key:"isThumbnailVertical",value:function(){var g=this.props.thumbnailPosition;return g==="left"||g==="right"}},{key:"addScreenChangeEvent",value:function(){var g=this;lr.forEach(function(m){document.addEventListener(m,g.handleScreenChange)})}},{key:"removeScreenChangeEvent",value:function(){var g=this;lr.forEach(function(m){document.removeEventListener(m,g.handleScreenChange)})}},{key:"fullScreen",value:function(){var g=this.props.useBrowserFullscreen,m=this.imageGallery.current;g?m.requestFullscreen?m.requestFullscreen():m.msRequestFullscreen?m.msRequestFullscreen():m.mozRequestFullScreen?m.mozRequestFullScreen():m.webkitRequestFullscreen?m.webkitRequestFullscreen():this.setModalFullscreen(!0):this.setModalFullscreen(!0),this.setState({isFullscreen:!0})}},{key:"exitFullScreen",value:function(){var g=this.state.isFullscreen,m=this.props.useBrowserFullscreen;g&&(m?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():this.setModalFullscreen(!1):this.setModalFullscreen(!1),this.setState({isFullscreen:!1}))}},{key:"pauseOrPlay",value:function(){var g=this.props.infinite,m=this.state.currentIndex;g||this.canSlideRight()?this.slideToIndex(m+1):this.pause()}},{key:"play",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props,C=m.onPlay,U=m.slideInterval,K=m.slideDuration,z=this.state.currentIndex;this.playPauseIntervalId||(this.setState({isPlaying:!0}),this.playPauseIntervalId=window.setInterval(this.pauseOrPlay,Math.max(U,K)),C&&g&&C(z))}},{key:"pause",value:function(){var g=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],m=this.props.onPause,C=this.state.currentIndex;this.playPauseIntervalId&&(window.clearInterval(this.playPauseIntervalId),this.playPauseIntervalId=null,this.setState({isPlaying:!1}),m&&g&&m(C))}},{key:"isImageLoaded",value:function(g){return!!this.loadedImages[g.original]||(this.loadedImages[g.original]=!0,!1)}},{key:"handleImageLoaded",value:function(g,m){var C=this.props.onImageLoad;!this.loadedImages[m]&&C&&(this.loadedImages[m]=!0,C(g))}},{key:"renderItem",value:function(g){var m=this.state.isFullscreen,C=this.props.onImageError||this.handleImageError;return l().createElement(P,{description:g.description,fullscreen:g.fullscreen,handleImageLoaded:this.handleImageLoaded,isFullscreen:m,onImageError:C,original:g.original,originalAlt:g.originalAlt,originalHeight:g.originalHeight,originalWidth:g.originalWidth,originalTitle:g.originalTitle,sizes:g.sizes,loading:g.loading,srcSet:g.srcSet})}},{key:"renderThumbInner",value:function(g){var m=this.props.onThumbnailError||this.handleImageError;return l().createElement("span",{className:"image-gallery-thumbnail-inner"},l().createElement("img",{className:"image-gallery-thumbnail-image",src:g.thumbnail,height:g.thumbnailHeight,width:g.thumbnailWidth,alt:g.thumbnailAlt,title:g.thumbnailTitle,loading:g.thumbnailLoading,onError:m}),g.thumbnailLabel&&l().createElement("div",{className:"image-gallery-thumbnail-label"},g.thumbnailLabel))}},{key:"render",value:function(){var g=this.state,m=g.currentIndex,C=g.isFullscreen,U=g.modalFullscreen,K=g.isPlaying,z=this.props,ue=z.additionalClass,ce=z.disableThumbnailSwipe,he=z.indexSeparator,X=z.isRTL,Q=z.items,J=z.thumbnailPosition,ie=z.renderFullscreenButton,fe=z.renderCustomControls,be=z.renderLeftNav,_e=z.renderRightNav,lt=z.showBullets,nt=z.showFullscreenButton,Ve=z.showIndex,Re=z.showThumbnails,xe=z.showNav,Wt=z.showPlayButton,Bn=z.renderPlayPauseButton,$n=this.getThumbnailStyle(),_t=this.getSlideItems(),cn=_t.slides,Tt=_t.thumbnails,jn=_t.bullets,Un=f("image-gallery-slide-wrapper",this.getThumbnailPositionClassName(J),{"image-gallery-rtl":X}),kn=l().createElement("div",{ref:this.imageGallerySlideWrapper,className:Un},fe&&fe(),this.canSlide()?l().createElement(l().Fragment,null,xe&&l().createElement(l().Fragment,null,be(this.slideLeft,!this.canSlideLeft()),_e(this.slideRight,!this.canSlideRight())),l().createElement(Mn,{className:"image-gallery-swipe",delta:0,onSwiping:this.handleSwiping,onSwiped:this.handleOnSwiped},l().createElement("div",{className:"image-gallery-slides"},cn))):l().createElement("div",{className:"image-gallery-slides"},cn),Wt&&Bn(this.togglePlay,K),lt&&l().createElement("div",{className:"image-gallery-bullets"},l().createElement("div",{className:"image-gallery-bullets-container",role:"navigation","aria-label":"Bullet Navigation"},jn)),nt&&ie(this.toggleFullScreen,C),Ve&&l().createElement("div",{className:"image-gallery-index"},l().createElement("span",{className:"image-gallery-index-current"},m+1),l().createElement("span",{className:"image-gallery-index-separator"},he),l().createElement("span",{className:"image-gallery-index-total"},Q.length))),Wn=f("image-gallery",ue,{"fullscreen-modal":U}),ct=f("image-gallery-content",this.getThumbnailPositionClassName(J),{fullscreen:C}),Ol=f("image-gallery-thumbnails-wrapper",this.getThumbnailPositionClassName(J),{"thumbnails-wrapper-rtl":!this.isThumbnailVertical()&&X},{"thumbnails-swipe-horizontal":!this.isThumbnailVertical()&&!ce},{"thumbnails-swipe-vertical":this.isThumbnailVertical()&&!ce});return l().createElement("div",{ref:this.imageGallery,className:Wn,"aria-live":"polite"},l().createElement("div",{className:ct},(J==="bottom"||J==="right")&&kn,Re&&Tt.length>0?l().createElement(Mn,{className:Ol,delta:0,onSwiping:!ce&&this.handleThumbnailSwiping,onSwiped:!ce&&this.handleOnThumbnailSwiped},l().createElement("div",{className:"image-gallery-thumbnails",ref:this.thumbnailsWrapper,style:this.getThumbnailBarHeight()},l().createElement("nav",{ref:this.thumbnails,className:"image-gallery-thumbnails-container",style:$n,"aria-label":"Thumbnail Navigation"},Tt))):null,(J==="top"||J==="left")&&kn))}}],E&&Tn(p.prototype,E),Object.defineProperty(p,"prototype",{writable:!1}),me}(l().Component);Dr.propTypes={flickThreshold:R.number,items:(0,R.arrayOf)((0,R.shape)({bulletClass:R.string,bulletOnClick:R.func,description:R.string,original:R.string,originalHeight:R.number,originalWidth:R.number,loading:R.string,thumbnailHeight:R.number,thumbnailWidth:R.number,thumbnailLoading:R.string,fullscreen:R.string,originalAlt:R.string,originalTitle:R.string,thumbnail:R.string,thumbnailAlt:R.string,thumbnailLabel:R.string,thumbnailTitle:R.string,originalClass:R.string,thumbnailClass:R.string,renderItem:R.func,renderThumbInner:R.func,imageSet:jl,srcSet:R.string,sizes:R.string})).isRequired,showNav:R.bool,autoPlay:R.bool,lazyLoad:R.bool,infinite:R.bool,showIndex:R.bool,showBullets:R.bool,showThumbnails:R.bool,showPlayButton:R.bool,showFullscreenButton:R.bool,disableThumbnailScroll:R.bool,disableKeyDown:R.bool,disableSwipe:R.bool,disableThumbnailSwipe:R.bool,useBrowserFullscreen:R.bool,onErrorImageURL:R.string,indexSeparator:R.string,thumbnailPosition:(0,R.oneOf)(["top","bottom","left","right"]),startIndex:R.number,slideDuration:R.number,slideInterval:R.number,slideOnThumbnailOver:R.bool,swipeThreshold:R.number,swipingTransitionDuration:R.number,swipingThumbnailTransitionDuration:R.number,onSlide:R.func,onBeforeSlide:R.func,onScreenChange:R.func,onPause:R.func,onPlay:R.func,onClick:R.func,onImageLoad:R.func,onImageError:R.func,onTouchMove:R.func,onTouchEnd:R.func,onTouchStart:R.func,onMouseOver:R.func,onMouseLeave:R.func,onBulletClick:R.func,onThumbnailError:R.func,onThumbnailClick:R.func,renderCustomControls:R.func,renderLeftNav:R.func,renderRightNav:R.func,renderPlayPauseButton:R.func,renderFullscreenButton:R.func,renderItem:R.func,renderThumbInner:R.func,stopPropagation:R.bool,additionalClass:R.string,useTranslate3D:R.bool,isRTL:R.bool,useWindowKeyDown:R.bool},Dr.defaultProps={onErrorImageURL:"",additionalClass:"",showNav:!0,autoPlay:!1,lazyLoad:!1,infinite:!0,showIndex:!1,showBullets:!1,showThumbnails:!0,showPlayButton:!0,showFullscreenButton:!0,disableThumbnailScroll:!1,disableKeyDown:!1,disableSwipe:!1,disableThumbnailSwipe:!1,useTranslate3D:!0,isRTL:!1,useBrowserFullscreen:!0,flickThreshold:.4,stopPropagation:!1,indexSeparator:" / ",thumbnailPosition:"bottom",startIndex:0,slideDuration:450,swipingTransitionDuration:0,swipingThumbnailTransitionDuration:0,onSlide:null,onBeforeSlide:null,onScreenChange:null,onPause:null,onPlay:null,onClick:null,onImageLoad:null,onImageError:null,onTouchMove:null,onTouchEnd:null,onTouchStart:null,onMouseOver:null,onMouseLeave:null,onBulletClick:null,onThumbnailError:null,onThumbnailClick:null,renderCustomControls:null,renderThumbInner:null,renderItem:null,slideInterval:3e3,slideOnThumbnailOver:!1,swipeThreshold:30,renderLeftNav:function(b,p){return l().createElement(An,{onClick:b,disabled:p})},renderRightNav:function(b,p){return l().createElement(st,{onClick:b,disabled:p})},renderPlayPauseButton:function(b,p){return l().createElement(Ut,{onClick:b,isPlaying:p})},renderFullscreenButton:function(b,p){return l().createElement(Xe,{onClick:b,isFullscreen:p})},useWindowKeyDown:!0};const kl=Dr})(),a})())})(ll);var op=ll.exports;const sp=ji(op);function ap(){var e=new Map;function t(n){var r=n.root,i=n.rootMargin,s=n.threshold,a=e.get(r);a||(a=new Map,e.set(r,a));var c=JSON.stringify({rootMargin:i,threshold:s}),f=a.get(c);if(!f){var v=new Map,l=new IntersectionObserver(function(u){u.forEach(function(T){var y=v.get(T.target);y==null||y(T)})},{root:r,rootMargin:i,threshold:s});f={observer:l,entryCallbacks:v},a.set(c,f)}return{observe:function(T,y){var S,j;(S=f)==null||S.entryCallbacks.set(T,y),(j=f)==null||j.observer.observe(T)},unobserve:function(T){var y,S;(y=f)==null||y.entryCallbacks.delete(T),(S=f)==null||S.observer.unobserve(T)}}}return{getObserver:t}}var lp="0px",cp=[0],up=ap();function dp(e){var t,n,r=(t=e==null?void 0:e.rootMargin)!=null?t:lp,i=(n=e==null?void 0:e.threshold)!=null?n:cp,s=M.useRef(null),a=M.useRef(null),c=M.useRef(null),f=M.useState(),v=f[0],l=f[1],u=M.useCallback(function(){var j=s.current;if(!j){l(void 0);return}var _=up.getObserver({root:a.current,rootMargin:r,threshold:i});_.observe(j,function(D){l(D)}),c.current=_},[r,i]),T=M.useCallback(function(){var j=c.current,_=s.current;_&&(j==null||j.unobserve(_)),c.current=null},[]),y=M.useCallback(function(j){T(),s.current=j,u()},[u,T]),S=M.useCallback(function(j){T(),a.current=j,u()},[u,T]);return[y,{entry:v,rootRef:S}]}function yi(){return yi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yi.apply(this,arguments)}function hp(e){var t,n=dp(e),r=n[0],i=n[1],s=!!((t=i.entry)!=null&&t.isIntersecting),a=M.useState(s),c=a[0],f=a[1];return s&&!c&&f(!0),[r,yi({},i,{isVisible:s,wasEverVisible:c})]}var fp=100;function pp(e){var t=e.loading,n=e.hasNextPage,r=e.onLoadMore,i=e.rootMargin,s=e.disabled,a=e.delayInMs,c=a===void 0?fp:a,f=hp({rootMargin:i}),v=f[0],l=f[1],u=l.rootRef,T=l.isVisible,y=!s&&!t&&T&&n;return M.useEffect(function(){if(y){var S=setTimeout(function(){r()},c);return function(){clearTimeout(S)}}},[r,y,c]),[v,{rootRef:u}]}const mp={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>'},gp={width:24,height:24,body:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M18.333 2c1.96 0 3.56 1.537 3.662 3.472l.005.195v12.666c0 1.96-1.537 3.56-3.472 3.662l-.195.005H5.667a3.667 3.667 0 0 1-3.662-3.472L2 18.333V5.667c0-1.96 1.537-3.56 3.472-3.662L5.667 2h12.666zm-2.626 7.293a1 1 0 0 0-1.414 0L11 12.585l-1.293-1.292l-.094-.083a1 1 0 0 0-1.32 1.497l2 2l.094.083a1 1 0 0 0 1.32-.083l4-4l.083-.094a1 1 0 0 0-.083-1.32z"/></g>'};var Gr=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Hr(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function cl(e,t){for(var n=t.slice(0,t.length-1),r=0;r<n.length;r++)n[r]=e[n[r].toLowerCase()];return n}function ul(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");for(var t=e.split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}function vp(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,i=!0,s=0;s<n.length;s++)r.indexOf(n[s])===-1&&(i=!1);return i}var go={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Gr?173:189,"=":Gr?61:187,";":Gr?59:186,"'":222,"[":219,"]":221,"\\":220},Kt={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},bi={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ge={16:!1,18:!1,17:!1,91:!1},De={};for(var hr=1;hr<20;hr++)go["f".concat(hr)]=111+hr;var Ie=[],ms=!1,dl="all",hl=[],Ar=function(t){return go[t.toLowerCase()]||Kt[t.toLowerCase()]||t.toUpperCase().charCodeAt(0)};function fl(e){dl=e||"all"}function ir(){return dl||"all"}function yp(){return Ie.slice(0)}function bp(e){var t=e.target||e.srcElement,n=t.tagName,r=!0;return(t.isContentEditable||(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")&&!t.readOnly)&&(r=!1),r}function xp(e){return typeof e=="string"&&(e=Ar(e)),Ie.indexOf(e)!==-1}function wp(e,t){var n,r;e||(e=ir());for(var i in De)if(Object.prototype.hasOwnProperty.call(De,i))for(n=De[i],r=0;r<n.length;)n[r].scope===e?n.splice(r,1):r++;ir()===e&&fl(t||"all")}function Ep(e){var t=e.keyCode||e.which||e.charCode,n=Ie.indexOf(t);if(n>=0&&Ie.splice(n,1),e.key&&e.key.toLowerCase()==="meta"&&Ie.splice(0,Ie.length),(t===93||t===224)&&(t=91),t in Ge){Ge[t]=!1;for(var r in Kt)Kt[r]===t&&(ht[r]=!1)}}function Sp(e){if(typeof e>"u")Object.keys(De).forEach(function(a){return delete De[a]});else if(Array.isArray(e))e.forEach(function(a){a.key&&Xr(a)});else if(typeof e=="object")e.key&&Xr(e);else if(typeof e=="string"){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n[0],s=n[1];typeof i=="function"&&(s=i,i=""),Xr({key:e,scope:i,method:s,splitKey:"+"})}}var Xr=function(t){var n=t.key,r=t.scope,i=t.method,s=t.splitKey,a=s===void 0?"+":s,c=ul(n);c.forEach(function(f){var v=f.split(a),l=v.length,u=v[l-1],T=u==="*"?"*":Ar(u);if(De[T]){r||(r=ir());var y=l>1?cl(Kt,v):[];De[T]=De[T].filter(function(S){var j=i?S.method===i:!0;return!(j&&S.scope===r&&vp(S.mods,y))})}})};function gs(e,t,n,r){if(t.element===r){var i;if(t.scope===n||t.scope==="all"){i=t.mods.length>0;for(var s in Ge)Object.prototype.hasOwnProperty.call(Ge,s)&&(!Ge[s]&&t.mods.indexOf(+s)>-1||Ge[s]&&t.mods.indexOf(+s)===-1)&&(i=!1);(t.mods.length===0&&!Ge[16]&&!Ge[18]&&!Ge[17]&&!Ge[91]||i||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}}function vs(e,t){var n=De["*"],r=e.keyCode||e.which||e.charCode;if(ht.filter.call(this,e)){if((r===93||r===224)&&(r=91),Ie.indexOf(r)===-1&&r!==229&&Ie.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(S){var j=bi[S];e[S]&&Ie.indexOf(j)===-1?Ie.push(j):!e[S]&&Ie.indexOf(j)>-1?Ie.splice(Ie.indexOf(j),1):S==="metaKey"&&e[S]&&Ie.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(Ie=Ie.slice(Ie.indexOf(j))))}),r in Ge){Ge[r]=!0;for(var i in Kt)Kt[i]===r&&(ht[i]=!0);if(!n)return}for(var s in Ge)Object.prototype.hasOwnProperty.call(Ge,s)&&(Ge[s]=e[bi[s]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(Ie.indexOf(17)===-1&&Ie.push(17),Ie.indexOf(18)===-1&&Ie.push(18),Ge[17]=!0,Ge[18]=!0);var a=ir();if(n)for(var c=0;c<n.length;c++)n[c].scope===a&&(e.type==="keydown"&&n[c].keydown||e.type==="keyup"&&n[c].keyup)&&gs(e,n[c],a,t);if(r in De){for(var f=0;f<De[r].length;f++)if((e.type==="keydown"&&De[r][f].keydown||e.type==="keyup"&&De[r][f].keyup)&&De[r][f].key){for(var v=De[r][f],l=v.splitKey,u=v.key.split(l),T=[],y=0;y<u.length;y++)T.push(Ar(u[y]));T.sort().join("")===Ie.sort().join("")&&gs(e,v,a,t)}}}}function Tp(e){return hl.indexOf(e)>-1}function ht(e,t,n){Ie=[];var r=ul(e),i=[],s="all",a=document,c=0,f=!1,v=!0,l="+",u=!1;for(n===void 0&&typeof t=="function"&&(n=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(s=t.scope),t.element&&(a=t.element),t.keyup&&(f=t.keyup),t.keydown!==void 0&&(v=t.keydown),t.capture!==void 0&&(u=t.capture),typeof t.splitKey=="string"&&(l=t.splitKey)),typeof t=="string"&&(s=t);c<r.length;c++)e=r[c].split(l),i=[],e.length>1&&(i=cl(Kt,e)),e=e[e.length-1],e=e==="*"?"*":Ar(e),e in De||(De[e]=[]),De[e].push({keyup:f,keydown:v,scope:s,mods:i,shortcut:r[c],method:n,key:r[c],splitKey:l,element:a});typeof a<"u"&&!Tp(a)&&window&&(hl.push(a),Hr(a,"keydown",function(T){vs(T,a)},u),ms||(ms=!0,Hr(window,"focus",function(){Ie=[]},u)),Hr(a,"keyup",function(T){vs(T,a),Ep(T)},u))}function jp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(De).forEach(function(n){var r=De[n].find(function(i){return i.scope===t&&i.shortcut===e});r&&r.method&&r.method()})}var Yr={setScope:fl,getScope:ir,deleteScope:wp,getPressedKeyCodes:yp,isPressed:xp,filter:bp,trigger:jp,unbind:Sp,keyMap:go,modifier:Kt,modifierMap:bi};for(var Qr in Yr)Object.prototype.hasOwnProperty.call(Yr,Qr)&&(ht[Qr]=Yr[Qr]);if(typeof window<"u"){var kp=window.hotkeys;ht.noConflict=function(e){return e&&window.hotkeys===ht&&(window.hotkeys=kp),ht},window.hotkeys=ht}ht.filter=function(){return!0};var pl=function(t,n){var r=t.target,i=r&&r.tagName;return!!(i&&n&&n.includes(i))},Op=function(t){return pl(t,["INPUT","TEXTAREA","SELECT"])};function Ip(e,t,n,r){n instanceof Array&&(r=n,n=void 0);var i=n||{},s=i.enableOnTags,a=i.filter,c=i.keyup,f=i.keydown,v=i.filterPreventDefault,l=v===void 0?!0:v,u=i.enabled,T=u===void 0?!0:u,y=i.enableOnContentEditable,S=y===void 0?!1:y,j=M.useRef(null),_=M.useCallback(function(D,A){var B,V;return a&&!a(D)?!l:Op(D)&&!pl(D,s)||(B=D.target)!=null&&B.isContentEditable&&!S?!0:j.current===null||document.activeElement===j.current||(V=j.current)!=null&&V.contains(document.activeElement)?(t(D,A),!0):!1},r?[j,s,a].concat(r):[j,s,a]);return M.useEffect(function(){if(!T){ht.unbind(e,_);return}return c&&f!==!0&&(n.keydown=!1),ht(e,n||{},_),function(){return ht.unbind(e,_)}},[_,e,T]),j}ht.isPressed;const ml=M.createContext({open:!1,toggleOpen:e=>{}});function Cp({children:e}){const[t,n]=M.useState(!1),r=s=>{n(s??!s)},i=M.useMemo(()=>({open:t,toggleOpen:r}),[t]);return o.jsx(ml.Provider,{value:i,children:e})}function vo(){return M.useContext(ml)}const mt={nameAsc:"title",nameDesc:"title",popularity:"stats.downloads",publishAt:"lastPublishedAt",mobilePageSize:10,pageSize:18,currentPage:1,defaultCurrentPage:1,blockletsPath:"/api/v2/blocklets.json",categoriesPath:"/api/blocklets/categories",explorePath:"/api/blocklets/explore",exploreDidsPath:"/api/blocklets/dids",cacheSize:100},Rp=e=>sr(async()=>{const{data:t}=await e.get(mt.categoriesPath);return Array.isArray(t)?t:[]},{manual:!0});function Pp(e,t){const n=e.menu?{sortBy:"popularity",sortDirection:"desc",showResources:"true",...Lc(e,["sortBy","sortDirection","showResources"])}:{sortBy:"popularity",sortDirection:"desc",showResources:"true",...e,menu:void 0},{onFilterChange:r,onSearchSelect:i=c=>{t.onFilterChange({...n,keyword:c.title})},emptyCategory:s}=t;!n.category&&!s&&(n.category="All");const a=c=>{const f={...n,...c};r(Mr(f,v=>v===""||v===void 0))};return{filters:e,cleanFilter:c=>{const f=c?Mr(n,(v,l)=>c.includes(l)):{};r(Mr(f,v=>v===""||v===void 0))},handleActiveMenu:c=>{c!==e.menu&&r({menu:c})},handleSort:(c,f)=>{a({sortBy:c,sortDirection:f||c==="nameAsc"?"asc":"desc"})},handleKeyword:c=>{a({category:void 0,keyword:c||void 0})},handlePrice:c=>{a({price:c===e.price?void 0:c})},handleCategory:c=>{a({category:c===e.category?"":c})},handleDeveloper:c=>{a({owner:c||void 0})},handlePage:c=>{a({currentPage:c})},handleSwitchShowResources:c=>{a({showResources:c})},handleSearchSelect:c=>{i(c)}}}const Lp=(e,t,n)=>e&&t||!n,gl=e=>[{name:e("sort.popularity"),value:"popularity"},{name:e("sort.lastPublished"),value:"publishAt"}],vl=(e,t,n)=>{var r,i;const s=_c(e),a=Nc(s.search);if((r=Ac(e,{strict:!0}))!=null&&r.endsWith(".gif"))return a.imageFilter?Dc({...s,search:""}):e;if(a.imageFilter)return e;const c=n||((i=window.blocklet)==null?void 0:i.version),{w:f,h:v}=typeof t=="object"?{w:t.w,h:t.h}:{w:t,h:t};return Ri(e,{...f||v?{imageFilter:"resize",w:f,h:v}:{},v:c})},_p=e=>[{name:e("blocklet.free"),value:"free"},{name:e("blocklet.payment"),value:"payment"}],Np=(e=[],t="en")=>e.map(n=>({name:n.locales[t]||n.locales.en,value:n._id})),Ap=e=>{var t,n;return Array.isArray(e)?e.map(r=>r.message).join(`
|
|
486
|
+
`):(n=(t=e.response)==null?void 0:t.data)!=null&&n.error?e.response.data.error.message||e.response.data.error:e.message||e},Dp=(e,t)=>e==null?void 0:e.replace(/{(\w*)}/g,(n,r)=>t.hasOwnProperty(r)?t[r]:""),Mp=()=>window.innerWidth<=600,Fp={common:{title:"Blocklet Store",searchStore:"Search Blocklet",showResources:"Show extensions",price:"Price",category:"Category",categories:"Categories",resourceType:"Resource Type",clear:"Clear",cancel:"Cancel",search:"Search",fetchError:"Failed to fetch data, please try again later",searchPlaceholder:"Search blocklet"},explore:{title:"Explore",trending:"Trending",topRated:"Top Rated",recentlyUpdated:"Recently Updated",viewDetail:"View Details"},sort:{sort:"Sort",rating:"Rating",popularity:"Most Popular",lastPublished:"Latest Published"},category:{all:"All",placeholder:"Category name",helperText:"Please select a category"},blocklet:{noResults:"No blocklet found.",free:"Free",search:'Results for "{keyword}"',authorTag:"Blocklet by {name}",resourceTag:"Extensions for {name}",resultCount:"{count} Blocklets",emptyTip:"Tips:",filterTip:"Appropriately reduce the filter conditions",keywordTip:"Try other keywords",owner:"Blocklets from {name}",noBlockletPart1:'No Blocklets associated with"',noBlockletPart2:'"were found',noCategoryResults1:'No "',noCategoryResults2:'" Blocklets'},autocomplete:{expandResult:'View all search results for "{name}"'}},Bp={common:{title:"Blocklet 商店",searchStore:"搜索 Blocklet",showResources:"显示扩展",price:"价格",category:"类别",categories:"类别",resourceType:"资源类型",clear:"清除",cancel:"取消",search:"搜索",fetchError:"获取数据失败, 请稍后再试",searchPlaceholder:"搜索 Blocklet"},explore:{title:"探索",trending:"趋势",topRated:"评分最高",recentlyUpdated:"最近更新",viewDetail:"查看详情"},sort:{sort:"排序",rating:"评分",popularity:"最热门",lastPublished:"最新发布"},category:{all:"全部",placeholder:"分类名称",helperText:"请选择分类"},blocklet:{noResults:"未搜索到 Blocklet",free:"免费",search:'搜索 "{keyword}" 的结果',authorTag:"{name} 的 Blocklet",resourceTag:"{name} 的拓展",resultCount:"{count} 个 Blocklet",emptyTip:"建议:",filterTip:"适当减少筛选条件",keywordTip:"尝试其他关键字",owner:"来自 {name} 的 Blocklets",noBlockletPart1:'没有找到与"',noBlockletPart2:'"相关的 Blocklets',noCategoryResults1:'无 "',noCategoryResults2:'" 类别的 Blocklets'},autocomplete:{expandResult:"查看 “{name}” 的所有搜索结果"}},Jr={en:Co(Fp),zh:Co(Bp)},yl=(e,t)=>{const n={};return e&&(n["x-blocklet-server-version"]=e),t&&(n["x-blocklet-store-version"]=t),n},$p=e=>(t,n)=>{const r=Jr[e]?Jr[e][t]:Jr.en[t];return Dp(r,n)||t},bl={errors:{fetchCategoriesError:null},loadings:{fetchCategoriesLoading:!1},compact:!1,endpoint:"",wrapChildren:()=>null,t:e=>e,storeVersion:"",minItemWidth:350,serverVersion:"",layout:{},selectedCategory:void 0,categoryList:[],blockletRender:()=>null,locale:"en",categoryOptions:[],priceOptions:[],storeApi:null,baseSearch:!1,showResourcesSwitch:!1,showCategory:!1,tagFilters:[],developerName:"",onFilterChange:()=>{},updateDeveloperName:()=>{},getCategoryLocale:()=>null,search:{filters:{},cleanFilter:()=>{},handleActiveMenu:()=>{},handleSort:()=>{},handleKeyword:()=>{},handlePrice:()=>{},handleCategory:()=>{},handleDeveloper:()=>{},handleSwitchShowResources:()=>{},handleSearchSelect:()=>{},handlePage:()=>{}}},xl=M.createContext(bl),{Provider:Up,Consumer:fg}=xl;function Wp(e){const{locale:t="zh",filters:n={},serverVersion:r="",onFilterChange:i=()=>{},minItemWidth:s=350,queryFilter:a=!0,layout:c={},wrapChildren:f=ye=>ye,extraFilter:v=ye=>ye,baseSearch:l=!1,fetchCategoryDelay:u=0,showResourcesSwitch:T=!1,showCategory:y=!0,tagFilters:S=[],children:j,storeVersion:_,onSearchSelect:D=()=>{},endpoint:A,blockletRender:B,compact:V=!1}=e,I=yl(r,_),F=M.useMemo(()=>Us({baseURL:A,headers:I}),[A]),G=Pp(n,{onFilterChange:i,emptyCategory:!c.showExplore,onSearchSelect:D}),[$,le]=M.useState(""),{data:H=[],error:se,loading:je,run:We}=Rp(F),Me=M.useMemo(()=>{const ye=Pc(H,[Ae=>Ae.name],["asc"]),oe=ye.findIndex(Ae=>Ae.name==="All"||Ae.locales.en==="All");return oe>-1?[{...ye[oe],_id:"All"},...ye.slice(0,oe),...ye.slice(oe+1)]:ye},[H]),Qe=M.useCallback($p(t),[t]),Z=M.useMemo(()=>Np(Me,t),[Me,t]),pe=_p(Qe),ee={search:G,compact:V,errors:{fetchCategoriesError:se},loadings:{fetchCategoriesLoading:je},extraFilter:v,endpoint:A,queryFilter:a,layout:{showExplore:c.showExplore??!1,showCategory:c.showCategory??!0,showTitle:c.showTitle??!0,showSearch:c.showSearch??!0},minItemWidth:s,wrapChildren:f,t:Qe,storeVersion:_,serverVersion:r,selectedCategory:G.filters.category||(c.showExplore?"":"All"),categoryList:Me,blockletRender:B,locale:t,categoryOptions:Z,priceOptions:pe,storeApi:F,baseSearch:l,showResourcesSwitch:T,showCategory:y,tagFilters:S,onFilterChange:i,getCategoryLocale:ye=>{if(!ye)return null;const oe=H.find(Ae=>Ae._id===ye||Ae.locales.en==="All");return oe?oe.locales[t]||oe.locales.en:null},get developerName(){return $},updateDeveloperName:le};return M.useEffect(()=>{setTimeout(We,u||0)},[A,We,u]),o.jsx(Up,{value:ee,children:j})}function it(){return M.useContext(xl)||bl}function wl({children:e,onClick:t,size:n=32,...r}){return o.jsx(or,{...r,onClick:t,variant:"outlined",sx:[{minWidth:n,height:n,p:0,borderColor:"divider","&:hover":{borderColor:"divider"},borderRadius:2,color:"text.secondary"},...Array.isArray(r.sx)?r.sx:[r.sx]],children:e})}function fr(e,t){return e===void 0?t:e}function yo({xs:e,sm:t,md:n,lg:r,xl:i,exact:s}){const a=Pn(),c=qt(a.breakpoints.down("sm")),f=qt(a.breakpoints.between("sm","md")),v=qt(a.breakpoints.between("md","lg")),l=qt(a.breakpoints.between("lg","xl"));if(s)return c?e||null:f?t||null:v?n||null:l?r||null:i||null;let u=e;return c||(u=fr(t,u),f)||(u=fr(n,u),v)||(u=fr(r,u),l)?u:fr(i,u)}function zp({children:e}){const{open:t,toggleOpen:n}=vo();return o.jsx(yo,{xs:o.jsx(Ul,{open:t,onClose:()=>n(!1),children:e}),md:o.jsx(Y,{children:e})})}const qp=M.forwardRef(({loading:e,disabled:t,...n},r)=>o.jsx(or,{ref:r,disableElevation:!0,disabled:t||e,...n,sx:[{borderRadius:"4px"},...Array.isArray(n.sx)?n.sx:[n.sx]],startIcon:e&&o.jsx(xt,{size:"1em"})}));function xi({value:e,options:t,onChange:n,placeholder:r,...i}){var s;const a=M.useRef(null),c=Pn(),[f,v]=M.useState(!1),[l,u]=M.useState(e!==null?e:""),T=qt(c.breakpoints.down("sm"));M.useEffect(()=>{u(e!==null?e:"")},[e]);const y=M.useCallback(()=>{v(!1)},[]),S=M.useCallback(()=>{v(!0)},[]);function j(D){u(D.value),n(D.value),T&&y()}function _(D){return D===l}return o.jsxs(o.Fragment,{children:[o.jsxs(Kp,{ref:a,onClick:S,variant:"outlined",size:"medium",className:["my-select__selector",Hn(l)?"":"my-select__selector--active"].join(" "),sx:{minWidth:{xs:"100px",md:"auto"},color:"text.primary",borderRadius:"8px"},...i,children:[((s=t.find(D=>D.value===l))==null?void 0:s.name)||r,o.jsx(Wl,{className:"my-select__arrowdown",component:Tc,sx:{width:18,height:18}})]}),o.jsx(zl,{open:f,anchorEl:a.current,transition:!0,sx:{zIndex:"9999"},children:({TransitionProps:D,placement:A})=>o.jsx(ql,{...D,style:{transformOrigin:A==="bottom"?"center top":"center bottom"},children:o.jsx(Kl,{children:o.jsx(Vl,{onClickAway:y,children:o.jsx(Vp,{autoFocusItem:f,onMouseEnter:S,onMouseLeave:y,children:t.map(B=>o.jsxs(Ti,{onClick:()=>j(B),sx:{fontSize:14},children:[o.jsx(zs,{sx:{mr:1,fontSize:16,visibility:_(B.value)?"visible":"hidden"}}),B.name]},B.value))})})})})})]})}const Kp=Vt(qp)`
|
|
486
487
|
border: 1px solid #f0f0f0;
|
|
487
488
|
padding: 6px 8px 6px 12px;
|
|
488
489
|
font-weight: ${e=>e.theme.typography.fontWeightRegular};
|
|
@@ -510,7 +511,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
510
511
|
margin-right: 3px;
|
|
511
512
|
}
|
|
512
513
|
}
|
|
513
|
-
`,
|
|
514
|
+
`,Vp=Vt(Ns)`
|
|
514
515
|
.my-select__option__icon {
|
|
515
516
|
color: transparent;
|
|
516
517
|
font-size: 14px;
|
|
@@ -526,7 +527,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
526
527
|
color: ${e=>e.theme.palette.primary.main};
|
|
527
528
|
}
|
|
528
529
|
}
|
|
529
|
-
`;function El(){const{search:e,t}=it(),{filters:n,handleSort:r,handlePrice:i}=e,s=gl(t);return o.jsxs(rt,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[o.jsx(Ei,{control:o.jsx(Si,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(xi,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function Vp({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v,handleActiveMenu:l,handleCategory:u,cleanFilter:T}=n,{toggleOpen:y}=vo();M.useEffect(()=>{y(!1)},[Object.values(v).join("")]);const S=Lp(c,a.showSearch,v.keyword);return a.showCategory&&!f?o.jsxs(Wp,{children:[o.jsx(yo,{xs:o.jsxs(rt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(wl,{onClick:()=>y(!1),children:o.jsx(Ci,{})}),o.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(rt,{visibility:s.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?o.jsxs(o.Fragment,{children:[a.showExplore&&o.jsxs(Y,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[o.jsxs(Y,{display:"flex",alignItems:"center",gap:1,children:[o.jsx(rr,{icon:tf,width:20,height:20}),o.jsx(ge,{variant:"body1",color:!t&&!v.menu?"text.primary":"text.lighter",fontWeight:!t&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{y(!1),T()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx(rr,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ge,{variant:"body1",color:v.menu===j.key?"text.primary":"text.lighter",fontWeight:v.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var _;y(!1),l(j.key),(_=j.onClick)==null||_.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(rt,{gap:2,children:i.map(j=>o.jsx(ge,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{t===j.value?T():u(j.value),y(!1)},children:j.name},j.value))})]}):o.jsx(El,{})})]}):null}function bo(){const{endpoint:e,serverVersion:t,storeVersion:n}=it(),r=yl(t,n),i=M.useMemo(()=>Us({baseURL:e,headers:r}),[e]);return{get:async s=>{const{data:a}=await i.get(s);return a},post:async(s,a)=>{const{data:c}=await i.post(s,a);return c}}}const Sl=M.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(xt,{})})});function ys({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Gp=16/9,Zr=292,wi=189,Sr=336;function Hp(){var e,t;const{t:n,search:r}=it(),{get:i}=bo(),s=Pn(),a=qt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:v,loading:l}=sr(async()=>{const D=await i(Ri(mt.blockletsPath,{didList:c.map(A=>A.did).join(",")}));return D!=null&&D.dataList?c.map(A=>D.dataList.find(B=>B.did===A.did)):[]});v&&console.error("Get Banner Blocklets error:",v);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!v&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:Zr},minHeight:Zr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:l?o.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[o.jsx(zt,{variant:"rounded",height:wi,width:Sr}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(zt,{variant:"text",height:50,width:100}),o.jsx(zt,{variant:"text",height:40,width:"100%"}),o.jsx(zt,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(zt,{variant:"circular",height:20,width:20}),o.jsx(zt,{variant:"text",height:20,width:50})]}),o.jsx(zt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(sp,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(hu,{sx:{...u,left:5}})}),renderRightNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(fu,{sx:{...u,right:5}})}),items:c.map((D,A)=>({original:D.did,renderItem:()=>{var B;const V=f[A]||{},I=D.cover||Yp(D.did,(B=V.screenshots)==null?void 0:B[0]),F=vl(I,s.breakpoints.values.md*2);return o.jsxs(rt,{height:{xs:"auto",md:Zr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${F}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(V),gap:{xs:2,md:5},children:[T(F),o.jsxs(rt,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[y(D.name||V.title||D.name),S(D.desc||V.description)]}),V.did&&j(V,D.baseNum),_(V)]})]})}}))})})]}):null;function T(D){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Sr},children:o.jsx(Qp,{url:D})})}function y(D){return o.jsx(ge,{variant:"h2",width:"100%",children:D})}function S(D){return o.jsx(ge,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:D})}function j(D,A=0){const{did:B,owner:V,stats:I}=D;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(ys,{icon:o.jsx(xr,{src:V.avatar,did:B,size:20,variant:"circle"}),children:V.fullName}),o.jsx(ys,{icon:o.jsx(rr,{icon:qa}),title:`${I.downloads+A}`,children:Xp(I.downloads+A)})]})}function _(D){return o.jsx(or,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(D),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Xp=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`,Yp=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Qp({url:e}){const[t,n]=M.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(zt,{variant:"rectangular",sx:{width:{xs:"100%",md:Sr},height:{xs:"auto",md:wi}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Sr},height:{xs:"auto",md:wi},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Gp},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Jp({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=it();return o.jsxs(Y,{mt:3,children:[o.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(jo,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(jo,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":i.did,children:o.jsx(Y,{padding:"1px",children:n({blocklet:i,blocklets:t,serverVersion:r})})},i.did))})]})}function Zp(){const{get:e}=bo(),{t}=it(),{data:n=[],error:r,loading:i}=sr(async()=>{const s=await e(mt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(Or,{error:new Error(`Failed to fetch blocklets from ${mt.explorePath}`)}):i?o.jsx(Sl,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(Hp,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(Jp,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const ei="__FREE_TEXT__",bs="__NO_RESULT__",ti=40;function em({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=M.useRef(null),f=M.useRef(!1),[v,l]=M.useState(!1),[u,T]=M.useState(""),[y,S]=M.useState(!1),j=bo(),[_,D]=M.useState(!1),A=(a==null?void 0:a.placeholder)||t("common.searchStore"),B=async Z=>{D(!0);const pe=await j.get(Zn(e,Ri(mt.blockletsPath,Z)));return D(!1),pe.dataList||[]},{data:V,run:I}=sr(Z=>Z?B({sortBy:mt.nameDesc,page:1,pageSize:10,keyword:Z,showResources:"true"}):Promise.resolve([]),{manual:!0});M.useEffect(()=>{D(!0),I(r.keyword),T(r.keyword||"")},[r.keyword,I]),Ip("ctrl + k, command + k",Z=>{var pe,ee;return Z.stopPropagation(),Z.preventDefault(),(ee=(pe=c.current)==null?void 0:pe.querySelector("input"))==null||ee.focus(),!1},{enableOnTags:["INPUT"]});const F=Hs(Z=>I(Z),{wait:300}),G={name:ei,title:u,did:""};let $=[];return u&&(_?$=[G]:V!=null&&V.length?$=[G,...V]:$=[{name:bs,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(Gl,{fullScreen:!0,open:y,sx:{display:{md:"none"}},children:[o.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[o.jsx(As,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:A,className:"bl-autocomplete-input",value:u,onChange:Z=>le(Z.target.value),startAdornment:Me(y),endAdornment:Qe()}),o.jsx(or,{variant:"outlined",onClick:()=>{S(!1),T(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ns,{sx:{p:.5},children:$.map(Z=>je(Z))})]}),o.jsx(gr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),o.jsx(Is,{ref:c,open:!!u&&v,size:"small",onOpen:()=>l(!0),onClose:(Z,pe)=>{l(!1),pe==="selectOption"&&!f.current&&i(u)},onKeyDown:Z=>{Z.key==="Enter"&&!u&&H()},disableClearable:!0,inputValue:u,onInputChange:(Z,pe)=>le(pe),isOptionEqualToValue:(Z,pe)=>Z.name===pe.name,getOptionLabel:Z=>Z.title,getOptionKey:Z=>Z.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:Z=>o.jsx(Tr,{...Z,InputProps:{...Z.InputProps,autoFocus:!0,placeholder:A,className:"bl-autocomplete-input",value:u,startAdornment:Me(v),endAdornment:Qe()}}),filterOptions:Z=>Z,...a,options:$,renderOption:(Z,pe)=>je(pe),value:G,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(a.sx)?a.sx:[a.sx]]})]});function le(Z){D(!0),T(Z),f.current=!1,F.run(Z)}function H(){S(!1),T(""),le(""),i("")}function se(Z){Z!=null&&Z.did?(S(!1),f.current=!0,T(""),s(Z)):Z.name===ei&&(S(!1),i(u))}function je(Z){var pe,ee;return o.jsxs(Ti,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(Z),children:[We(Z),o.jsxs(ge,{variant:"body1",children:[o.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Z.title}),o.jsx(ge,{sx:{color:"text.lighter"},fontSize:"13px",children:((ee=(pe=Z.category)==null?void 0:pe.locales)==null?void 0:ee[n||"en"])||""})]})]},Z.did)}function We(Z){if([ei,bs].includes(Z.name))return o.jsx(Y,{width:ti,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:o.jsx(gr,{sx:{fontSize:28}})});let pe="";return Z.logo&&(pe=Zn(e,"assets",Z.did,vl(Z.logo,ti,Z.version))),o.jsx(xr,{src:pe,size:ti,style:{borderRadius:"8px",overflow:"hidden"}})}function Me(Z=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:Z&&u&&_?o.jsx(xt,{color:"inherit",size:16}):o.jsx(gr,{sx:{fontSize:16,cursor:"default"}})})}function Qe(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:o.jsx(Ci,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>H()})}):null}}function tm({placeholder:e="Type to search...",...t}){const{search:n}=it(),{filters:r,handleKeyword:i}=n,[s,a]=M.useState(r.keyword||""),c=Hs(i,{wait:300}),f=l=>{const{value:u}=l.target;a(u),c.run(u)},v=()=>{a(""),i("")};return M.useEffect(()=>{a(r.keyword||"")},[r.keyword]),o.jsx(nm,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(Oo,{position:"start",children:o.jsx(rm,{sx:{fontSize:18,ml:-.5}})}),onChange:f,placeholder:e,value:s,title:e,"data-cy":"search",endAdornment:s&&o.jsx(Oo,{position:"end",children:o.jsx(im,{"data-cy":"search-delete",onClick:v})}),...t})}const nm=Vt(As)`
|
|
530
|
+
`;function El(){const{search:e,t}=it(),{filters:n,handleSort:r,handlePrice:i}=e,s=gl(t);return o.jsxs(rt,{direction:{xs:"row",md:"column"},alignItems:{xs:"center",md:"flex-start"},gap:{xs:1,md:2},width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[o.jsx(Ei,{control:o.jsx(Si,{checked:n.price==="free",size:"small",sx:{"& .MuiSvgIcon-fontSizeSmall":{fontSize:16,color:"text.lighter"}},onChange:a=>i(a.target.checked?"free":"")}),label:t("blocklet.free")}),o.jsx(xi,{value:n.sortBy||s[0].value,options:s,onChange:a=>r(a),placeholder:t("sort.sort")})]})}function Gp({menus:e}){const{selectedCategory:t,search:n,t:r,categoryOptions:i,loadings:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v,handleActiveMenu:l,handleCategory:u,cleanFilter:T}=n,{toggleOpen:y}=vo();M.useEffect(()=>{y(!1)},[Object.values(v).join("")]);const S=Lp(c,a.showSearch,v.keyword);return a.showCategory&&!f?o.jsxs(zp,{children:[o.jsx(yo,{xs:o.jsxs(rt,{direction:"row",justifyContent:"space-between",alignItems:"center",p:2,mb:.5,gap:2,borderBottom:1,borderColor:"divider",children:[o.jsx(wl,{onClick:()=>y(!1),children:o.jsx(Ci,{})}),o.jsx(ge,{flex:1,variant:"body1",fontWeight:"fontWeightMedium",children:r("common.category")})]}),md:null}),o.jsx(rt,{visibility:s.fetchCategoriesLoading?"hidden":"visible",width:{xs:268,md:200},boxSizing:"content-box",p:{xs:2,md:0},pr:{md:6},children:S?o.jsxs(o.Fragment,{children:[a.showExplore&&o.jsxs(Y,{mb:3,pb:3,borderBottom:1,borderColor:"divider",children:[o.jsxs(Y,{display:"flex",alignItems:"center",gap:1,children:[o.jsx(rr,{icon:tf,width:20,height:20}),o.jsx(ge,{variant:"body1",color:!t&&!v.menu?"text.primary":"text.lighter",fontWeight:!t&&!v.menu?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{y(!1),T()},children:r("explore.title")})]}),e==null?void 0:e.map(j=>o.jsxs(Y,{display:"flex",alignItems:"center",mt:2,gap:1,children:[typeof j.icon=="string"?o.jsx(rr,{icon:j.icon,width:20,height:20}):j.icon,o.jsx(ge,{variant:"body1",color:v.menu===j.key?"text.primary":"text.lighter",fontWeight:v.menu===j.key?"fontWeightMedium":void 0,sx:{cursor:"pointer"},onClick:()=>{var _;y(!1),l(j.key),(_=j.onClick)==null||_.call(j)},children:j.title})]},j.key))]}),!!i.length&&o.jsx(rt,{gap:2,children:i.map(j=>o.jsx(ge,{variant:"body1",title:j.name,sx:{cursor:"pointer"},"data-cy":"filter",color:t===j.value?"text.primary":"text.lighter",textTransform:"capitalize",onClick:()=>{t===j.value?T():u(j.value),y(!1)},children:j.name},j.value))})]}):o.jsx(El,{})})]}):null}function bo(){const{endpoint:e,serverVersion:t,storeVersion:n}=it(),r=yl(t,n),i=M.useMemo(()=>Us({baseURL:e,headers:r}),[e]);return{get:async s=>{const{data:a}=await i.get(s);return a},post:async(s,a)=>{const{data:c}=await i.post(s,a);return c}}}const Sl=M.memo(function(e){return o.jsx(Y,{height:60,display:"flex",alignItems:"center",justifyContent:"center",...e,children:o.jsx(xt,{})})});function ys({icon:e,children:t,maxWidth:n=100,title:r}){return(t===0||t)&&o.jsxs(rt,{direction:"row",alignItems:"center",gap:1,sx:{maxWidth:n,overflow:"hidden"},children:[e,o.jsx(ge,{flex:1,variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:r||(typeof t=="string"?t:void 0),children:t})]})}const Hp=16/9,Zr=292,wi=189,Sr=336;function Xp(){var e,t;const{t:n,search:r}=it(),{get:i}=bo(),s=Pn(),a=qt(s.breakpoints.down("md")),c=((t=(e=window.blocklet)==null?void 0:e.preferences)==null?void 0:t.homeBanner)||[],{data:f=[],error:v,loading:l}=sr(async()=>{const D=await i(Ri(mt.blockletsPath,{didList:c.map(A=>A.did).join(",")}));return D!=null&&D.dataList?c.map(A=>D.dataList.find(B=>B.did===A.did)):[]});v&&console.error("Get Banner Blocklets error:",v);const u={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:100,cursor:"pointer",color:"text.lighter"};return!v&&c.length>0?o.jsxs(o.Fragment,{children:[o.jsx(ge,{component:"h2",variant:"h2",mt:{xs:2,md:0},mb:3,children:n("explore.title")}),o.jsx(Y,{height:{xs:"auto",md:Zr},minHeight:Zr,position:"relative",border:1,borderColor:"divider",borderRadius:3,overflow:"hidden",children:l?o.jsxs(Y,{p:5,display:{md:"flex"},gap:5,alignItems:"center",justifyContent:"center",children:[o.jsx(zt,{variant:"rounded",height:wi,width:Sr}),o.jsxs(Y,{flex:1,height:"100%",children:[o.jsx(zt,{variant:"text",height:50,width:100}),o.jsx(zt,{variant:"text",height:40,width:"100%"}),o.jsx(zt,{variant:"text",height:40,width:300}),o.jsxs(Y,{display:"flex",gap:1,my:2,children:[o.jsx(zt,{variant:"circular",height:20,width:20}),o.jsx(zt,{variant:"text",height:20,width:50})]}),o.jsx(zt,{variant:"rounded",height:30,width:100})]})]}):o.jsx(sp,{showNav:!0,autoPlay:!0,slideDuration:a?500:1e3,slideInterval:5e3,showPlayButton:!1,showIndex:!1,showBullets:!1,showThumbnails:!1,showFullscreenButton:!1,renderLeftNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(hu,{sx:{...u,left:5}})}),renderRightNav:D=>o.jsx(Y,{onClick:D,sx:{display:{xs:"none",md:"block"}},children:o.jsx(fu,{sx:{...u,right:5}})}),items:c.map((D,A)=>({original:D.did,renderItem:()=>{var B;const V=f[A]||{},I=D.cover||Qp(D.did,(B=V.screenshots)==null?void 0:B[0]),F=vl(I,s.breakpoints.values.md*2);return o.jsxs(rt,{height:{xs:"auto",md:Zr},sx:{cursor:"pointer","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundImage:`url("${F}")`,backgroundSize:"cover",filter:"blur(50px)",opacity:.15,zIndex:0}},display:"flex",direction:{xs:"column",md:"row"},justifyContent:"center",alignItems:{xs:"flex-start",md:"center"},p:{xs:2,md:5},onClick:()=>r.handleSearchSelect(V),gap:{xs:2,md:5},children:[T(F),o.jsxs(rt,{flex:1,height:"100%",gap:3,children:[o.jsxs(Y,{flex:1,children:[y(D.name||V.title||D.name),S(D.desc||V.description)]}),V.did&&j(V,D.baseNum),_(V)]})]})}}))})})]}):null;function T(D){return o.jsx(Y,{borderRadius:2,overflow:"hidden",position:"relative",width:{xs:"100%",md:Sr},children:o.jsx(Jp,{url:D})})}function y(D){return o.jsx(ge,{variant:"h2",width:"100%",children:D})}function S(D){return o.jsx(ge,{variant:"body2",color:"text.secondary",textAlign:"left",width:"100%",minHeight:70,maxHeight:70,pt:1,sx:{display:"-webkit-box",lineClamp:3,WebkitLineClamp:3,maxHeight:71,textWrap:"wrap",overflow:"hidden",WebkitBoxOrient:"vertical"},children:D})}function j(D,A=0){const{did:B,owner:V,stats:I}=D;return o.jsxs(Y,{display:"flex",alignItems:"center",gap:2,color:"text.secondary",children:[o.jsx(ys,{icon:o.jsx(xr,{src:V.avatar,did:B,size:20,variant:"circle"}),children:V.fullName}),o.jsx(ys,{icon:o.jsx(rr,{icon:qa}),title:`${I.downloads+A}`,children:Yp(I.downloads+A)})]})}function _(D){return o.jsx(or,{variant:"outlined",size:"small",onClick:()=>r.handleSearchSelect(D),sx:{width:"fit-content",textTransform:"none",bgcolor:"white",borderRadius:"8px",borderColor:"divider","&:hover":{borderColor:"divider"}},children:n("explore.viewDetail")})}}const Yp=e=>Number.isNaN(e)?0:e<1e3?e:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(1)}m`:`${(e/1e9).toFixed(1)}b`,Qp=(e,t)=>e&&t?`/assets/${e}/screenshots/${t}`:"";function Jp({url:e}){const[t,n]=M.useState(!0);return o.jsxs(o.Fragment,{children:[t&&o.jsx(zt,{variant:"rectangular",sx:{width:{xs:"100%",md:Sr},height:{xs:"auto",md:wi}}}),o.jsx(Y,{display:t?"none":"block",component:"img",src:e,alt:"",width:{xs:"100%",md:Sr},height:{xs:"auto",md:wi},borderRadius:2,border:1,borderColor:"divider",sx:{objectFit:"container",cursor:"pointer",aspectRatio:Hp},onLoad:()=>n(!1),onError:()=>n(!1)})]})}function Zp({title:e,blocklets:t}){const{blockletRender:n,serverVersion:r}=it();return o.jsxs(Y,{mt:3,children:[o.jsx(ge,{component:"h3",variant:"h3",sx:{mb:2},children:e}),o.jsx(jo,{container:!0,spacing:2,boxSizing:"border-box",maxWidth:"calc(100vw - 16px)",children:t.map(i=>o.jsx(jo,{item:!0,xs:12,md:6,p:"2px","data-blocklet-did":i.did,children:o.jsx(Y,{padding:"1px",children:n({blocklet:i,blocklets:t,serverVersion:r})})},i.did))})]})}function em(){const{get:e}=bo(),{t}=it(),{data:n=[],error:r,loading:i}=sr(async()=>{const s=await e(mt.explorePath);return Array.isArray(s)?s:[]});return r?o.jsx(Or,{error:new Error(`Failed to fetch blocklets from ${mt.explorePath}`)}):i?o.jsx(Sl,{mt:15}):o.jsxs(o.Fragment,{children:[o.jsx(Xp,{}),n.map(s=>{var a;return((a=s.blocklets)==null?void 0:a.length)>0?o.jsx(Zp,{title:t(`explore.${s.type}`),blocklets:s.blocklets},s.type):null})]})}const ei="__FREE_TEXT__",bs="__NO_RESULT__",ti=40;function tm({endpoint:e,t,locale:n,filters:r,handleKeyword:i,handleSearchSelect:s,...a}){const c=M.useRef(null),f=M.useRef(!1),[v,l]=M.useState(!1),[u,T]=M.useState(""),[y,S]=M.useState(!1),j=bo(),[_,D]=M.useState(!1),A=(a==null?void 0:a.placeholder)||t("common.searchStore"),B=async Z=>{D(!0);const pe=await j.get(Zn(e,Ri(mt.blockletsPath,Z)));return D(!1),pe.dataList||[]},{data:V,run:I}=sr(Z=>Z?B({sortBy:mt.nameDesc,page:1,pageSize:10,keyword:Z,showResources:"true"}):Promise.resolve([]),{manual:!0});M.useEffect(()=>{D(!0),I(r.keyword),T(r.keyword||"")},[r.keyword,I]),Ip("ctrl + k, command + k",Z=>{var pe,ee;return Z.stopPropagation(),Z.preventDefault(),(ee=(pe=c.current)==null?void 0:pe.querySelector("input"))==null||ee.focus(),!1},{enableOnTags:["INPUT"]});const F=Hs(Z=>I(Z),{wait:300}),G={name:ei,title:u,did:""};let $=[];return u&&(_?$=[G]:V!=null&&V.length?$=[G,...V]:$=[{name:bs,title:t("blocklet.noResults"),did:""}]),o.jsxs(o.Fragment,{children:[o.jsxs(Gl,{fullScreen:!0,open:y,sx:{display:{md:"none"}},children:[o.jsxs(Y,{p:2,pb:0,display:"flex",alignItems:"center",gap:2,children:[o.jsx(As,{fullWidth:!0,sx:{bgcolor:"#F9FAFB",px:1,py:.5,".MuiInputBase-input":{p:1},".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},autoFocus:!0,placeholder:A,className:"bl-autocomplete-input",value:u,onChange:Z=>le(Z.target.value),startAdornment:Me(y),endAdornment:Qe()}),o.jsx(or,{variant:"outlined",onClick:()=>{S(!1),T(r.keyword||"")},children:t("common.cancel")})]}),o.jsx(Ns,{sx:{p:.5},children:$.map(Z=>je(Z))})]}),o.jsx(gr,{sx:{display:{sx:"block",md:"none"},fontSize:28,color:"text.lighter"},onClick:()=>S(!0)}),o.jsx(Is,{ref:c,open:!!u&&v,size:"small",onOpen:()=>l(!0),onClose:(Z,pe)=>{l(!1),pe==="selectOption"&&!f.current&&i(u)},onKeyDown:Z=>{Z.key==="Enter"&&!u&&H()},disableClearable:!0,inputValue:u,onInputChange:(Z,pe)=>le(pe),isOptionEqualToValue:(Z,pe)=>Z.name===pe.name,getOptionLabel:Z=>Z.title,getOptionKey:Z=>Z.name,noOptionsText:t("blocklet.noResults"),autoHighlight:!0,forcePopupIcon:!1,slotProps:{paper:{sx:{mt:.5,minWidth:"100%",width:"fit-content","& > ul":{p:.5}}}},renderInput:Z=>o.jsx(Tr,{...Z,InputProps:{...Z.InputProps,autoFocus:!0,placeholder:A,className:"bl-autocomplete-input",value:u,startAdornment:Me(v),endAdornment:Qe()}}),filterOptions:Z=>Z,...a,options:$,renderOption:(Z,pe)=>je(pe),value:G,sx:[{bgcolor:"#F9FAFB",borderRadius:"8px",overflow:"hidden",".MuiOutlinedInput-notchedOutline":{borderRadius:"8px",borderColor:"transparent"},"&&:hover .MuiOutlinedInput-notchedOutline, &&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"divider",borderWidth:"1px"}},...Array.isArray(a.sx)?a.sx:[a.sx]]})]});function le(Z){D(!0),T(Z),f.current=!1,F.run(Z)}function H(){S(!1),T(""),le(""),i("")}function se(Z){Z!=null&&Z.did?(S(!1),f.current=!0,T(""),s(Z)):Z.name===ei&&(S(!1),i(u))}function je(Z){var pe,ee;return o.jsxs(Ti,{sx:{display:"flex",alignItems:"center",gap:1,p:1.5,borderRadius:"8px"},onClick:()=>se(Z),children:[We(Z),o.jsxs(ge,{variant:"body1",children:[o.jsx(ge,{fontWeight:"fontWeightMedium",display:"flex",alignItems:"center",gap:1,children:Z.title}),o.jsx(ge,{sx:{color:"text.lighter"},fontSize:"13px",children:((ee=(pe=Z.category)==null?void 0:pe.locales)==null?void 0:ee[n||"en"])||""})]})]},Z.did)}function We(Z){if([ei,bs].includes(Z.name))return o.jsx(Y,{width:ti,p:"6px",display:"flex",justifyContent:"center",alignItems:"center",color:"text.lighter",bgcolor:"#F1F3F5",borderRadius:"8px",children:o.jsx(gr,{sx:{fontSize:28}})});let pe="";return Z.logo&&(pe=Zn(e,"assets",Z.did,vl(Z.logo,ti,Z.version))),o.jsx(xr,{src:pe,size:ti,style:{borderRadius:"8px",overflow:"hidden"}})}function Me(Z=!0){return o.jsx(Y,{sx:{display:"flex",pl:.5,alignItems:"center",color:"text.lighter"},children:Z&&u&&_?o.jsx(xt,{color:"inherit",size:16}):o.jsx(gr,{sx:{fontSize:16,cursor:"default"}})})}function Qe(){return u?o.jsx(Y,{sx:{display:"flex",alignItems:"center",color:"text.lighter"},children:o.jsx(Ci,{sx:{fontSize:20,cursor:"pointer"},onClick:()=>H()})}):null}}function nm({placeholder:e,...t}){const{search:n,t:r}=it(),{filters:i,handleKeyword:s}=n,[a,c]=M.useState(i.keyword||""),f=Hs(s,{wait:300}),v=T=>{const{value:y}=T.target;c(y),f.run(y)},l=()=>{c(""),s("")};M.useEffect(()=>{c(i.keyword||"")},[i.keyword]);const u=e||r("common.searchPlaceholder");return o.jsx(rm,{inputProps:{"data-cy":"search-blocklet"},startAdornment:o.jsx(Oo,{position:"start",children:o.jsx(im,{sx:{fontSize:18,ml:-.5}})}),onChange:v,placeholder:u,value:a,title:u,"data-cy":"search",endAdornment:a&&o.jsx(Oo,{position:"end",children:o.jsx(om,{"data-cy":"search-delete",onClick:l})}),...t})}const rm=Vt(As)`
|
|
530
531
|
background-color: ${e=>e.theme.palette.grey[50]};
|
|
531
532
|
font-size: 14px;
|
|
532
533
|
border-radius: 6px;
|
|
@@ -543,19 +544,19 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
543
544
|
color: transparent;
|
|
544
545
|
}
|
|
545
546
|
}
|
|
546
|
-
`,
|
|
547
|
+
`,im=Vt(gr)`
|
|
547
548
|
color: ${e=>e.theme.palette.grey[500]};
|
|
548
|
-
`,
|
|
549
|
+
`,om=Vt(Ci)`
|
|
549
550
|
color: ${e=>e.theme.palette.grey[500]};
|
|
550
551
|
font-size: 16px;
|
|
551
552
|
cursor: pointer;
|
|
552
|
-
`;function om(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:v,categoryOptions:l,compact:u}=it(),{filters:T,handleSort:y,handlePrice:S,handleDeveloper:j,handleSwitchShowResources:_,cleanFilter:D,handleCategory:A}=t,B=gl(n);return o.jsxs(rt,{position:"sticky",top:0,zIndex:1e3,className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:u?2:3,sx:{backgroundColor:"background.default"},children:[!u&&o.jsx(ge,{variant:"h2",textTransform:"capitalize",children:s(T.category)}),o.jsxs(rt,{flex:1,direction:"row",alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2,children:[f.showSearch?o.jsx(Y,{flex:1,flexBasis:{xs:"100%",md:"auto"},children:v?o.jsx(tm,{}):o.jsx(em,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:t.filters,handleKeyword:t.handleKeyword,handleSearchSelect:t.handleSearchSelect})}):null,T.owner&&a&&o.jsx(ko,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),T.resourceDid&&T.resourceBlocklet&&o.jsx(ko,{label:n("blocklet.resourceTag",{name:T.resourceBlocklet}),size:"small",onDelete:()=>D(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(xs,{checked:T.showResources!=="false",onChange:V=>_(V?"true":"false"),label:n("common.showResources")}):null,o.jsx(xs,{checked:T.price==="free",onChange:V=>S(V?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(xi,{value:T.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:V=>A(V)})}),o.jsx(xi,{value:T.sortBy||B[0].value,options:B,placeholder:n("sort.sort"),onChange:V=>y(V)})]})]})}function xs({checked:e,onChange:t,label:n}){return o.jsx(Ei,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Si,{checked:e,icon:o.jsx(rr,{style:{padding:0},icon:mp}),checkedIcon:o.jsx(rr,{style:{padding:0,color:"#3478E2"},icon:gp}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function pr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[o.jsx(sc,{}),e]})}function ws(){const{t:e}=it();return o.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function ni({filterTip:e,keywordTip:t}){const{t:n,locale:r}=it(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ge,{children:n("blocklet.keywordTip")})]})}function ri({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ge,{children:e}),o.jsx(ge,{color:"primary",children:n}),o.jsxs(ge,{children:[t," "]})]})}function sm(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=it(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(pr,{children:[o.jsx(ri,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ni,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(pr,{children:[o.jsx(ri,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ni,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(pr,{children:[a?o.jsx(ri,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(ws,{}),o.jsx(ni,{filterTip:!0})]})}return o.jsx(pr,{children:o.jsx(ws,{})})}const am=(e,t,n,r)=>Qc(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:mt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(mt.blockletsPath,{params:c});return n.currentPage++,{page:s,pageSize:a,list:(f==null?void 0:f.dataList)||[],total:(f==null?void 0:f.total)||0}},{isNoMore:i=>i?i.page*i.pageSize>=i.total:!1,reloadDeps:[e,ac(t)],onError:r});function lm(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=it(),{filters:a}=n,c=Yc({currentPage:mt.currentPage,pageSize:Dp()?mt.mobilePageSize:mt.pageSize,defaultCurrentPage:mt.defaultCurrentPage}),[f,v]=M.useState(null),l=am(t,a,c,v),u=M.useMemo(()=>{var T,y;return r?r(((T=l.data)==null?void 0:T.list)||[]):((y=l.data)==null?void 0:y.list)||[]},[l.data,r]);return M.useEffect(()=>{const T=u.find(y=>y.owner.did===a.owner);s((T==null?void 0:T.owner.fullName)||(T==null?void 0:T.author.name)||"")},[a.owner,u,s]),{blocklets:u,fetchBlockletsError:f,loadMore:l.loadMore,hasNextPage:!l.noMore,total:((e=l.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:l.loading,loadingMore:l.loadingMore},errors:{...i,fetchBlockletsError:f}}}function cm(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v}=t,{blocklets:l,errors:u,loadMore:T,loadings:y,hasNextPage:S,total:j}=lm(),[_]=pp({loading:y.fetchBlockletsLoading||y.loadingMore,hasNextPage:S,onLoadMore:T});if(u.fetchBlockletsError){const V=new Error(`Failed to fetch blocklets from ${n}: ${u.fetchBlockletsError.message}`);return o.jsx(Or,{error:V})}const D=c&&a.showSearch||!v.keyword;return o.jsxs(o.Fragment,{children:[D?o.jsx(om,{}):o.jsxs(o.Fragment,{children:[o.jsx(yo,{xs:o.jsx(El,{}),md:null}),B()]}),A(),!y.fetchBlockletsLoading&&S&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:_,children:o.jsx(xt,{})})]});function A(){return y.fetchBlockletsLoading?o.jsx(Sl,{mt:15}):l.length?o.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${s}px, 1fr))`},p:"2px",rowGap:2,columnGap:f?0:2,children:l.map(V=>o.jsx(Y,{"data-blocklet-did":V.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:V,blocklets:l,serverVersion:i})},V.did))}):o.jsx(sm,{})}function B(){return o.jsxs(rt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ge,{variant:"h3",children:e("blocklet.search",{keyword:v.keyword})}),o.jsx(ge,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function um(){const{t:e,selectedCategory:t,getCategoryLocale:n}=it(),{toggleOpen:r}=vo();return o.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(wl,{onClick:()=>r(!0),children:o.jsx(Sc,{})}),n(t)||e("common.category")]})}function dm({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=it(),{filters:a}=r,c=M.useRef(null),f=a.category||a.keyword||a.price,v=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Cp,{children:o.jsxs(Ws,{FallbackComponent:Or,children:[!s&&o.jsx(um,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(Vp,{menus:e}),o.jsxs(rt,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[v&&(t==null?void 0:t(v)),!v&&(i.showExplore&&!f?o.jsx(Zp,{}):o.jsx(cm,{}))]})]})]})})}function hm(e){const{menus:t,children:n,...r}=e,i=Pn(),s=$l(Rc({...i,typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return o.jsx(_s,{theme:s,children:o.jsx(Up,{...r,children:o.jsx(dm,{menus:t,children:n})})})}const fm={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},pm={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},mm={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},gm=mm,vm={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},ym=(e,t)=>!t||!e?!0:oi.satisfies(oi.coerce(e),t);function xo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=gt();return ym(t,n)?e:o.jsx(Ls,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ge,{children:o.jsx(or,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}xo.propTypes={children:N.node.isRequired,serverVersion:N.string,requirementVersion:N.string};xo.defaultProps={serverVersion:"",requirementVersion:""};const Gn=getComputedStyle(document.documentElement),bm=lc({palette:{storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:Gn.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:Gn.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:Gn.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:Gn.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:Gn.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{button:{textTransform:"none"},allVariants:{textTransform:"none"},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},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),xm=(e,t)=>Zn(t,`/blocklets/${e.did}`),Es=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,wm=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1;function wo({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var _,D;const{t:s}=gt();let a=Zn(r,vc(e.did,e.logo||""));try{const A=new URL(a);A.searchParams.set("v",e.version||+new Date),a=A.href}catch{}const[c,f]=M.useState(!1),v=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(A){Ii.error(A.message)}finally{f(!1)}},{blocklet:l}=kr(),u=()=>((l==null?void 0:l.children)||[]).find(V=>V.meta.bundleDid===e.did).meta.version,y=(()=>{const A=((l==null?void 0:l.children)||[]).find(B=>B.meta.bundleDid===e.did);if(A){try{const B=A.meta.version,V=e.version;if(oi.gt(V,B))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),S=(_=e.requirements)==null?void 0:_.server,j=[];return y==="upgrade"?j.push({key:"upgrade",icon:o.jsx(pt,{icon:vm,color:"success.light",width:20,height:20},"version"),title:`${u()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:o.jsx(Y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):y==="disable"?j.push({key:"disable",icon:o.jsx(pt,{icon:fm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):wm(e)&&j.push({key:"purchase",icon:o.jsx(pt,{icon:pm,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(Em,{title:Es({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Es({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:y!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:y==="disable"?void 0:v,icons:(D=e.docker)!=null&&D.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(pt,{icon:gm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(xo,{serverVersion:i,requirementVersion:S,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(Jh,{children:o.jsx(dt,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:A=>{A.preventDefault(),A.stopPropagation();const B=xm(e,r);B&&window.open(B,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}wo.propTypes={blocklet:N.object.isRequired,blocklets:N.array,handleButtonClick:N.func,endpoint:N.string,serverVersion:N.string};wo.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function Eo({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:v,compact:l,...u}){const{locale:T}=gt(),[y,S]=M.useState(!1),[j,_]=M.useState({}),D=B=>{_(B)},A=n;return M.useEffect(()=>{_({showResources:!0,resourceType:a,resourceDid:c})},[A,a,c]),M.useEffect(()=>{S(!0),_({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(_s,{theme:bm,children:o.jsx(Ws,{FallbackComponent:Or,resetKeys:[A],children:o.jsxs(Y,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[y&&o.jsx(hm,{showCategory:v,showResourcesSwitch:f,blockletRender:B=>{const V={...B,handleButtonClick:e,endpoint:A};return r({...B,defaultRender:o.jsx(wo,{...V})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:A,locale:T,onFilterChange:D,onSearchSelect:t,filters:j,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}Eo.propTypes={storeUrl:N.string.isRequired,handleButtonClick:N.func,handleSearchSelect:N.func,handleBlockletRender:N.func,extraFilter:N.func,serverVersion:N.string,resourceType:N.string,resourceDid:N.string,showResourcesSwitch:N.bool,showCategory:N.bool,compact:N.bool};Eo.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Em=He(ef)`
|
|
553
|
+
`;function sm(){var e;const{search:t,t:n,endpoint:r,locale:i,getCategoryLocale:s,developerName:a,showResourcesSwitch:c,layout:f,baseSearch:v,categoryOptions:l,compact:u}=it(),{filters:T,handleSort:y,handlePrice:S,handleDeveloper:j,handleSwitchShowResources:_,cleanFilter:D,handleCategory:A}=t,B=gl(n);return o.jsxs(rt,{position:"sticky",top:0,zIndex:1e3,className:"filter-bar",direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",gap:2,spacing:{xs:1,md:0},pt:{xs:2,md:0},px:0,pb:u?2:3,sx:{backgroundColor:"background.default"},children:[!u&&o.jsx(ge,{variant:"h2",textTransform:"capitalize",children:s(T.category)}),o.jsxs(rt,{flex:1,direction:"row",alignItems:"center",flexWrap:{xs:"wrap",md:"nowrap"},width:"100%",justifyContent:{xs:"flex-start",md:"flex-end"},gap:2,children:[f.showSearch?o.jsx(Y,{flex:1,flexBasis:{xs:"100%",md:"auto"},children:v?o.jsx(nm,{}):o.jsx(tm,{locale:i,endpoint:r,sx:{display:{md:"block",xs:"none"},flex:1,mr:1,width:"350px"},t:n,filters:t.filters,handleKeyword:t.handleKeyword,handleSearchSelect:t.handleSearchSelect})}):null,T.owner&&a&&o.jsx(ko,{label:n("blocklet.authorTag",{name:a}),size:"small",onDelete:()=>j("")}),T.resourceDid&&T.resourceBlocklet&&o.jsx(ko,{label:n("blocklet.resourceTag",{name:T.resourceBlocklet}),size:"small",onDelete:()=>D(["resourceDid","resourceBlocklet","showResources"])}),c?o.jsx(xs,{checked:T.showResources!=="false",onChange:V=>_(V?"true":"false"),label:n("common.showResources")}):null,o.jsx(xs,{checked:T.price==="free",onChange:V=>S(V?"free":""),label:n("blocklet.free")}),u&&o.jsx(Y,{children:o.jsx(xi,{value:T.category||((e=l[0])==null?void 0:e.value),options:l,placeholder:n("common.category"),onChange:V=>A(V)})}),o.jsx(xi,{value:T.sortBy||B[0].value,options:B,placeholder:n("sort.sort"),onChange:V=>y(V)})]})]})}function xs({checked:e,onChange:t,label:n}){return o.jsx(Ei,{sx:{m:0,p:0},className:"check-button",control:o.jsx(Si,{checked:e,icon:o.jsx(rr,{style:{padding:0},icon:mp}),checkedIcon:o.jsx(rr,{style:{padding:0,color:"#3478E2"},icon:gp}),size:"large",sx:{p:0,mr:1},onChange:r=>t(r.target.checked)}),label:n})}function pr({children:e}){return o.jsxs(Y,{display:"flex",mt:2,flexDirection:"column",alignItems:"center",justifyContent:"center",color:"text.lighter",children:[o.jsx(sc,{}),e]})}function ws(){const{t:e}=it();return o.jsx(ge,{style:{textAlign:"center"},variant:"subtitle2",children:e("blocklet.noResults")})}function ni({filterTip:e,keywordTip:t}){const{t:n,locale:r}=it(),i=()=>r==="zh"?"、":" , ";return o.jsxs(Y,{mt:1,display:"flex",children:[o.jsx(ge,{style:{marginRight:"16px"},children:n("blocklet.emptyTip")}),e&&o.jsx(ge,{children:n("blocklet.filterTip")}),e&&t&&i(),t&&o.jsx(ge,{children:n("blocklet.keywordTip")})]})}function ri({primaryStart:e,primaryEnd:t,filter:n}){return o.jsxs(ge,{variant:"subtitle2",display:"flex",gap:.5,mx:.5,children:[o.jsx(ge,{children:e}),o.jsx(ge,{title:n,color:"primary",sx:{maxWidth:"30vw",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}),o.jsxs(ge,{children:[t," "]})]})}function am(){const{t:e,search:t,getCategoryLocale:n,selectedCategory:r}=it(),{filters:i}=t,s=!!r||!!i.price;if(i.keyword&&s)return o.jsxs(pr,{children:[o.jsx(ri,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ni,{keywordTip:!0,filterTip:!0})]});if(i.keyword)return o.jsxs(pr,{children:[o.jsx(ri,{primaryStart:e("blocklet.noBlockletPart1"),primaryEnd:e("blocklet.noBlockletPart2"),filter:i.keyword}),o.jsx(ni,{keywordTip:!0})]});if(s){const a=n(r);return o.jsxs(pr,{children:[a?o.jsx(ri,{primaryStart:e("blocklet.noCategoryResults1"),primaryEnd:e("blocklet.noCategoryResults2"),filter:a}):o.jsx(ws,{}),o.jsx(ni,{filterTip:!0})]})}return o.jsx(pr,{children:o.jsx(ws,{})})}const lm=(e,t,n,r)=>Qc(async i=>{i||(n.currentPage=n.defaultCurrentPage);const{currentPage:s,pageSize:a}=n,c={...t,category:t.category==="All"?"":t.category,sortBy:mt[t.sortBy],page:s,pageSize:a};r(null);const{data:f={}}=await e.get(mt.blockletsPath,{params:c});return n.currentPage++,{page:s,pageSize:a,list:(f==null?void 0:f.dataList)||[],total:(f==null?void 0:f.total)||0}},{isNoMore:i=>i?i.page*i.pageSize>=i.total:!1,reloadDeps:[e,ac(t)],onError:r});function cm(){var e;const{storeApi:t,search:n,extraFilter:r,errors:i,updateDeveloperName:s}=it(),{filters:a}=n,c=Yc({currentPage:mt.currentPage,pageSize:Mp()?mt.mobilePageSize:mt.pageSize,defaultCurrentPage:mt.defaultCurrentPage}),[f,v]=M.useState(null),l=lm(t,a,c,v),u=M.useMemo(()=>{var T,y;return r?r(((T=l.data)==null?void 0:T.list)||[]):((y=l.data)==null?void 0:y.list)||[]},[l.data,r]);return M.useEffect(()=>{const T=u.find(y=>y.owner.did===a.owner);s((T==null?void 0:T.owner.fullName)||(T==null?void 0:T.author.name)||"")},[a.owner,u,s]),{blocklets:u,fetchBlockletsError:f,loadMore:l.loadMore,hasNextPage:!l.noMore,total:((e=l.data)==null?void 0:e.total)||0,loadings:{fetchBlockletsLoading:l.loading,loadingMore:l.loadingMore},errors:{...i,fetchBlockletsError:f}}}function um(){const{t:e,search:t,endpoint:n,blockletRender:r,serverVersion:i,minItemWidth:s,layout:a,baseSearch:c,compact:f}=it(),{filters:v}=t,{blocklets:l,errors:u,loadMore:T,loadings:y,hasNextPage:S,total:j}=cm(),[_]=pp({loading:y.fetchBlockletsLoading||y.loadingMore,hasNextPage:S,onLoadMore:T});if(u.fetchBlockletsError){const V=new Error(`Failed to fetch blocklets from ${n}: ${Ap(u.fetchBlockletsError)}`);return o.jsx(Or,{error:V})}const D=c&&a.showSearch||!v.keyword;return o.jsxs(o.Fragment,{children:[D?o.jsx(sm,{}):o.jsxs(o.Fragment,{children:[o.jsx(yo,{xs:o.jsx(El,{}),md:null}),B()]}),A(),!y.fetchBlockletsLoading&&S&&o.jsx(Y,{height:70,minHeight:70,display:"flex",justifyContent:"center",py:2,overflow:"hidden",ref:_,children:o.jsx(xt,{})})]});function A(){return y.fetchBlockletsLoading?o.jsx(Sl,{mt:15}):l.length?o.jsx(Y,{className:"blocklet-list",display:"grid",gridTemplateColumns:{xs:"1fr",sm:`repeat(auto-fill, minmax(${s}px, 1fr))`},p:"2px",rowGap:2,columnGap:f?0:2,children:l.map(V=>o.jsx(Y,{"data-blocklet-did":V.did,minWidth:{xs:"100%",sm:s},maxWidth:"calc(100vw - 32px)",children:r({blocklet:V,blocklets:l,serverVersion:i})},V.did))}):o.jsx(am,{})}function B(){return o.jsxs(rt,{direction:"row",className:"search-result-title",alignItems:"center",justifyContent:"space-between",mb:2,mt:{xs:2,md:0},children:[o.jsx(ge,{variant:"h3",title:v.keyword,maxWidth:"50vw",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e("blocklet.search",{keyword:v.keyword})}),o.jsx(ge,{variant:"body1",color:"text.lighter",fontSize:13,children:e("blocklet.resultCount",{count:j})})]})}}function dm(){const{t:e,selectedCategory:t,getCategoryLocale:n}=it(),{toggleOpen:r}=vo();return o.jsxs(ge,{variant:"body1",display:{xs:"flex",md:"none"},alignItems:"center",gap:1,py:2,fontWeight:"fontWeightMedium",children:[o.jsx(wl,{onClick:()=>r(!0),children:o.jsx(Sc,{})}),n(t)||e("common.category")]})}function hm({menus:e,children:t}){var n;const{search:r,layout:i,compact:s}=it(),{filters:a}=r,c=M.useRef(null),f=a.category||a.keyword||a.price,v=(n=e==null?void 0:e.find(l=>l.key===a.menu))==null?void 0:n.key;return o.jsx(Cp,{children:o.jsxs(Ws,{FallbackComponent:Or,children:[!s&&o.jsx(dm,{}),o.jsxs(Y,{ref:c,display:"flex",height:"100%",className:"list-container",pt:{xs:0,md:s?0:5},children:[o.jsx(Gp,{menus:e}),o.jsxs(rt,{height:"100%",position:"relative",flex:1,sx:s?{overflowY:"auto",ml:-2,pr:1,pb:2}:{overflow:"visible"},children:[v&&(t==null?void 0:t(v)),!v&&(i.showExplore&&!f?o.jsx(em,{}):o.jsx(um,{}))]})]})]})})}function fm(e){const{menus:t,children:n,...r}=e,i=Pn(),s=$l(Rc({...i,typography:{h1:{fontSize:32,fontWeight:700,lineHeight:1.375,textAlign:"left"},h2:{fontSize:24,fontWeight:700,lineHeight:1.3333333,textAlign:"left"},h3:{fontSize:18,fontWeight:600,lineHeight:1.5,textAlign:"left"},fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:700}}));return o.jsx(_s,{theme:s,children:o.jsx(Wp,{...r,children:o.jsx(hm,{menus:t,children:n})})})}const pm={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},mm={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},gm={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M22 12.54c-1.804-.345-2.701-1.08-3.523-2.94c-.487.696-1.102 1.568-.92 2.4c.028.238-.32 1-.557 1H3c0 5.208 3.164 7 6.196 7c4.124.022 7.828-1.376 9.854-5c1.146-.101 2.296-1.505 2.95-2.46z"/><path d="M5 10h3v3H5zm3 0h3v3H8zm3 0h3v3h-3zM8 7h3v3H8zm3 0h3v3h-3zm0-3h3v3h-3zM4.571 18c1.5 0 2.047-.074 2.958-.78M10 16v.01"/></g>'},vm=gm,ym={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},bm=(e,t)=>!t||!e?!0:oi.satisfies(oi.coerce(e),t);function xo({children:e,serverVersion:t="",requirementVersion:n="",...r}){const{t:i}=gt();return bm(t,n)?e:o.jsx(Ls,{title:i("store.tooltip.upgradeServer",{serverVersion:t,version:n}),arrow:!0,children:o.jsx(ge,{children:o.jsx(or,{disabled:!0,variant:"outlined",...r,children:i("common.upgradeServer")})})})}xo.propTypes={children:N.node.isRequired,serverVersion:N.string,requirementVersion:N.string};xo.defaultProps={serverVersion:"",requirementVersion:""};const Gn=getComputedStyle(document.documentElement),xm=lc({palette:{storeSecondary:{main:"#EBFEFF",contrastText:"#fff"},divider:Gn.getPropertyValue("--stroke-sep").trim()||"#EFF1F5",text:{primary:Gn.getPropertyValue("--foregrounds-fg-base").trim()||"#030712",secondary:Gn.getPropertyValue("--foregrounds-fg-subtle").trim()||"#4b5563",lighter:Gn.getPropertyValue("--foregrounds-fg-muted").trim()||"#9ca3af",link:Gn.getPropertyValue("--foregrounds-fg-interactive").trim()||"#0086FF"}},typography:{button:{textTransform:"none"},allVariants:{textTransform:"none"},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},overrides:{MuiTableRow:{root:{"&:nth-child(even)":{backgroundColor:"rgba(0, 0, 0, 0.02)"}},head:{backgroundColor:"transparent"}}},breakpoints:{values:{xs:0,sm:600,md:960,lg:1280,xl:1920}}}),wm=(e,t)=>Zn(t,`/blocklets/${e.did}`),Es=({blocklet:e,attribute:t,value:n})=>e._formatted?e._formatted[t]:n,Em=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1;function wo({blocklet:e,blocklets:t,handleButtonClick:n,endpoint:r,serverVersion:i}){var _,D;const{t:s}=gt();let a=Zn(r,vc(e.did,e.logo||""));try{const A=new URL(a);A.searchParams.set("v",e.version||+new Date),a=A.href}catch{}const[c,f]=M.useState(!1),v=async()=>{try{f(!0),await n({meta:e,registryUrl:r,blocklets:t})}catch(A){Ii.error(A.message)}finally{f(!1)}},{blocklet:l}=kr(),u=()=>((l==null?void 0:l.children)||[]).find(V=>V.meta.bundleDid===e.did).meta.version,y=(()=>{const A=((l==null?void 0:l.children)||[]).find(B=>B.meta.bundleDid===e.did);if(A){try{const B=A.meta.version,V=e.version;if(oi.gt(V,B))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),S=(_=e.requirements)==null?void 0:_.server,j=[];return y==="upgrade"?j.push({key:"upgrade",icon:o.jsx(pt,{icon:ym,color:"success.light",width:20,height:20},"version"),title:`${u()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:o.jsx(Y,{sx:{fontWeight:"bold"},children:s("blocklet.component.upgradeAvailable")})}):y==="disable"?j.push({key:"disable",icon:o.jsx(pt,{icon:pm,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:s("blocklet.component.installed")}):Em(e)&&j.push({key:"purchase",icon:o.jsx(pt,{icon:mm,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:s("blocklet.component.needBuy")}),o.jsx(Sm,{title:Es({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:Es({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?a:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:y!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:y==="disable"?void 0:v,icons:(D=e.docker)!=null&&D.image?[{key:"docker",icon:o.jsx(Y,{display:"flex",color:"primary.main",children:o.jsx(pt,{icon:vm})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:j,button:o.jsx(xo,{serverVersion:i,requirementVersion:S,size:"small",children:o.jsx("div",{style:{display:"flex",alignItems:"center"},children:o.jsx(Jh,{children:o.jsx(dt,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:A=>{A.preventDefault(),A.stopPropagation();const B=wm(e,r);B&&window.open(B,"_blank","noopener,noreferrer")},children:s("common.detail")},e.did)})})})})}wo.propTypes={blocklet:N.object.isRequired,blocklets:N.array,handleButtonClick:N.func,endpoint:N.string,serverVersion:N.string};wo.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function Eo({handleButtonClick:e,handleSearchSelect:t,storeUrl:n,handleBlockletRender:r,extraFilter:i,serverVersion:s,resourceType:a,resourceDid:c,showResourcesSwitch:f,showCategory:v,compact:l,...u}){const{locale:T}=gt(),[y,S]=M.useState(!1),[j,_]=M.useState({}),D=B=>{_(B)},A=n;return M.useEffect(()=>{_({showResources:!0,resourceType:a,resourceDid:c})},[A,a,c]),M.useEffect(()=>{S(!0),_({showResources:!0,resourceType:a,resourceDid:c})},[]),o.jsx(_s,{theme:xm,children:o.jsx(Ws,{FallbackComponent:Or,resetKeys:[A],children:o.jsxs(Y,{...u,sx:[{overflow:"auto",".title-bar + div":{height:"unset"}},Array.isArray(u.sx)?u.sx:[u.sx]],children:[y&&o.jsx(fm,{showCategory:v,showResourcesSwitch:f,blockletRender:B=>{const V={...B,handleButtonClick:e,endpoint:A};return r({...B,defaultRender:o.jsx(wo,{...V})})},compact:l,minItemWidth:300,baseSearch:!0,endpoint:A,locale:T,onFilterChange:D,onSearchSelect:t,filters:j,extraFilter:i,serverVersion:s,fetchCategoryDelay:500}),o.jsx(Y,{sx:{mt:2},children:" "})]})})})}Eo.propTypes={storeUrl:N.string.isRequired,handleButtonClick:N.func,handleSearchSelect:N.func,handleBlockletRender:N.func,extraFilter:N.func,serverVersion:N.string,resourceType:N.string,resourceDid:N.string,showResourcesSwitch:N.bool,showCategory:N.bool,compact:N.bool};Eo.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const Sm=He(ef)`
|
|
553
554
|
.ms-highlight {
|
|
554
555
|
color: ${e=>e.theme.palette.primary.main};
|
|
555
556
|
}
|
|
556
|
-
`,So=M.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=Pn(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=jc(),{t:v,locale:l}=gt(),u=s[a];return M.useEffect(()=>{n(a)},[n,a]),M.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(
|
|
557
|
+
`,So=M.forwardRef(({meta:e,isMobile:t,onStepChange:n},r)=>{const i=Pn(),{steps:s,activeStep:a,setActiveStepByKey:c,setActiveStepByIndex:f}=jc(),{t:v,locale:l}=gt(),u=s[a];return M.useEffect(()=>{n(a)},[n,a]),M.useImperativeHandle(r,()=>({setActiveStepByKey:c,setActiveStepByIndex:f})),o.jsx(jm,{component:"div",className:t?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-child":{flex:{md:1}}},children:o.jsx(kc,{locale:l,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?yc({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:i,stepTip:v("blocklet.component.add"),children:o.jsx(Tm,{children:typeof(u==null?void 0:u.body)=="function"?u.body():u==null?void 0:u.body})})})});So.propTypes={meta:N.any,onStepChange:N.func.isRequired,isMobile:N.bool.isRequired};So.defaultProps={meta:null};const Ss=e=>e.isMobile?`
|
|
557
558
|
height: calc(100vh - 56px - 64px - 48px);
|
|
558
|
-
`:"",
|
|
559
|
+
`:"",Tm=He.div`
|
|
559
560
|
width: 100%;
|
|
560
561
|
height: 100%;
|
|
561
562
|
display: flex;
|
|
@@ -571,7 +572,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
571
572
|
aside {
|
|
572
573
|
width: 140px;
|
|
573
574
|
}
|
|
574
|
-
`,
|
|
575
|
+
`,jm=He(Y)`
|
|
575
576
|
${({className:e})=>e==="mobileStyle"?`
|
|
576
577
|
& > div{
|
|
577
578
|
height: 100%;
|
|
@@ -689,7 +690,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
689
690
|
& .connect {
|
|
690
691
|
background: white;
|
|
691
692
|
}
|
|
692
|
-
`,jm=So,km=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1,Om=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},ii=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Im=e=>(e.environments||[]).some(t=>t.required),Ts=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Cm=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},js=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Tl({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:v,showFromUrl:l,enableRunBackground:u,showCategory:T}){var nn,xn,R,St,Ct,rn,d,x,w,P;const{t:y,locale:S}=gt(),[j,_]=M.useState(!1),[D,A]=M.useState(null),[B,V]=M.useState(""),[I,F]=M.useState(""),{api:G,ws:{useSubscription:$},inService:le,info:H}=Ln(),{blocklet:se,actions:{refreshBlocklet:je}}=kr(),[We,Me]=M.useState(null),[Qe,Z]=M.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ee,ye]=M.useState(pe),[oe,Ae]=M.useState(0),we=M.useRef({}),Je=M.useRef({}),qe=M.useRef({}),Gt=qt(O=>O.breakpoints.down("md")),Ht=Yl(),[Ft,Xt]=M.useState(!0),{meta:Pe}=we.current,Le=Zs(Pe),Ze=M.useRef(!1),de=O=>ye(L=>({...L,...O}));M.useEffect(()=>{if(ee.pathPrefix){const{errMsg:O}=tn({...ee,pathPrefix:ee.pathPrefix,locale:S});V(O)}},[ee.pathPrefix]),M.useEffect(()=>{oe===0&&ye(pe)},[oe]);const Yt=()=>{const O=ii(se)??"";de({didSpaceEndpoint:O})},Qt=()=>{var O;return(O=we==null?void 0:we.current)!=null&&O.meta?Dt.getDisplayName(we.current):""},Jt=()=>{_(!1),ye({}),Ze.current=!1,we.current={},e()},ke=O=>{const L=W=>{de({installResultProps:{variant:"error",title:Qt(),subTitle:O,footer:o.jsx(dt,{className:"bottom-button",disabled:W,"data-cy":"retry-install-component",onClick:async()=>{L(!0),await en(we.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[W&&o.jsx(xt,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};L()},Bt=O=>L=>{var W,ne;(((W=L==null?void 0:L.meta)==null?void 0:W.did)||(L==null?void 0:L.meta))===((ne=se==null?void 0:se.meta)==null?void 0:ne.did)&&O(L)},Nn=()=>{js({timeout:0,componentDid:Ht.componentDid,manual:!0}),Jt(),setTimeout(()=>{const O=document.getElementsByClassName("dashboard-main")[0];O&&(O.scrollTop=O.scrollHeight)},200)};$(kt.BlockletEvents.componentInstalled,Bt(()=>{de({installResultProps:{variant:"success",title:Qt(),subTitle:y("blocklet.component.installSuccessTip")}}),js({componentDid:Ht.componentDid})}),[(nn=se==null?void 0:se.meta)==null?void 0:nn.did]),$(kt.BlockletEvents.statusChange,Bt(()=>{const O=ii(se);de(L=>({...L,didSpaceEndpoint:O}))}),[(xn=se==null?void 0:se.meta)==null?void 0:xn.did]),$(kt.BlockletEvents.downloadFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(R=se==null?void 0:se.meta)==null?void 0:R.did]),$(kt.BlockletEvents.installFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(St=se==null?void 0:se.meta)==null?void 0:St.did]);const et=[],Zt=O=>((se==null?void 0:se.children)||[]).find(L=>L.meta.did===O),en=async O=>{var Ut,ft;Ze.current=!0;const{pathPrefix:L,bundleDid:W,title:ne,componentName:ae="",componentDid:Be=""}=ee,Ne=((Ut=we.current)==null?void 0:Ut.meta)||{},{configs:Ee=[],registryUrl:Te,inStore:Xe,inputUrl:Rt,dist:An}=Ne,Pt=(ft=we.current)==null?void 0:ft.downloadTokenList,st=Rt||(Xe?Ro(Te,W,An):"");_(!0);const $t={rootDid:se.meta.did,url:st,mountPoint:L?cr(L):`/${cr(Ne.title||Ne.name)}`,title:ne,name:ae,did:Be,onlyRequired:!Ft,...ee.hasEnvironmentsStep&&Ee.length>0?{configs:Ee.map(at=>({...at,value:ee.configsValue[at.key]||""}))}:{},...Pt?{downloadTokenList:Pt}:{},...O};try{if(await G.installComponent({input:$t}),Te){const{teamDid:at,storeList:Lt}=qs({fromBlocklet:le,nodeInfo:H,blocklet:se}),{isNew:wn,decoded:En}=wc(Te,Lt);wn&&await G.addBlockletStore({input:{teamDid:at,url:En}})}de({installResultProps:{}}),je({showError:!1,attachRuntimeInfo:!1})}catch(at){const Lt=Ys(at);Ii.error(Lt),console.error("installComponent error: ",at),ke(Lt)}finally{_(!1),we.current.installInput=$t}},tn=O=>{const L=ou({params:{...O,did:O.bundleDid},blocklets:[se],blocklet:se,locale:S});if(L){const W=Zt(O.bundleDid),ne=su({params:{...O,did:O.bundleDid},blocklet:se});if(W&&W.mountPoint===ne)return{errMsg:""}}return{errMsg:L}},Fe=async O=>{var W,ne;const{errMsg:L}=tn({...ee,locale:S});V(L),oe===et.length-2&&!Ze.current&&await en(O),(ne=(W=Je.current)==null?void 0:W.setActiveStepByIndex)==null||ne.call(W,ae=>ae+1)},tt=()=>{var O,L;(L=(O=Je.current)==null?void 0:O.setActiveStepByIndex)==null||L.call(O,W=>W-1)},wt=()=>{const{pathPrefix:O,bundleDid:L,title:W,componentName:ne="",componentDid:ae=""}=ee,{meta:Be={}}=we.current||{},{registryUrl:Ne,inStore:Ee,inputUrl:Te,dist:Xe}=Be,Rt=Ee?Ro(Ne,L,Xe):Te;Me({meta:Be,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:O,url:Rt,title:W,name:ne,did:ae}})},ot=O=>{Z(!1),de({purchaseResultProps:{variant:"error",title:Qt(),subTitle:O,style:{paddingTop:120},footer:o.jsx(dt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},Et=({downloadTokenList:O})=>{we.current.downloadTokenList=O,Z(!1),Fe()},It=({chooseParams:O=we.current,componentDid:L,isInit:W=!1})=>{var En,ar,Dn,Mn;const{meta:ne,registryUrl:ae,inStore:Be,inputUrl:Ne}=O,{did:Ee,title:Te,name:Xe}=ne,Rt=(((En=se.settings)==null?void 0:En.children)||[]).filter($e=>$e.status==="deleted"&&$e.meta.bundleDid===Ee),An=L||"",Pt=(ar=ne.environments)==null?void 0:ar.map($e=>{const{name:Sn,validation:on,...Tn}=$e,sn={validation:Fc(on)?"":on};return{...Tn,key:Sn,...sn}});we.current={...O,meta:{...ne,configs:Pt,registryUrl:ae,inStore:Be,inputUrl:Ne}};let st={};if(W){const $e=[se],Sn=Pt||[],on=[],Tn=Vs(Mc([...Sn,...on]),"key").filter(vt=>!!vt.key).sort((vt,an)=>vt.required&&!an.required?-1:an.required&&!vt.required?1:0),sn=Dt.getSharedConfigObj($e[0],{configs:Tn}),Fn={},Oe=Tn.map(vt=>{const{default:an,key:ln,...lr}=vt;return Fn[ln]=sn[ln]||an,{...lr,key:ln,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[ln]}});st={...st,configsList:Oe,configsValue:Fn,hasMissRequiredConfigs:Ts(Oe,Fn)}}const $t=se.children.some($e=>$e.mountPoint==="/"),Ut=Rt.find($e=>$e.meta.bundleDid===Ee),ft=se.children.find($e=>$e.meta.bundleDid===Ee);st.title=Te||"",Ut?st={...st,pathPrefix:Ut.mountPoint||"",componentName:Ut.meta.name,hasEnvironmentsStep:!1}:ft?st={...st,pathPrefix:ft.mountPoint||"",componentName:ft.meta.name,hasEnvironmentsStep:!1}:st={...st,pathPrefix:$t?`/${cr(Te)||cr(Xe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(Dn=we.current.meta)==null?void 0:Dn.environments)==null?void 0:Mn.length)>0};const at=km(we.current.meta),Lt=Om(we.current.meta),wn=ii(se);de({bundleDid:Ee,componentDid:An,...st,hasRequiredEnvironments:Im(we.current.meta),requirePurchase:at,didSpaceIsRequiredSetup:Lt,didSpaceEndpoint:wn}),W&&at&&wt()};M.useEffect(()=>{!c||oe!==0||!se||(It({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Fe())},[c,oe,se]),et.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:o.jsxs(un,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ee.showFromUrlDialog&&o.jsx(no,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:O,inputUrl:L,inStore:W,registryUrl:ne})=>{It({chooseParams:{meta:O,inputUrl:L,inStore:W,registryUrl:ne},isInit:!0}),de({showFromUrlDialog:!1}),Fe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),o.jsx(ao,{stores:n,extra:Ms.isInServerlessMode(H)?null:l?o.jsxs(dt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Js,{style:{fontSize:20,marginRight:4}})," ",y("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:j,onChange:()=>{ye({}),we.current={}},storageKey:s,children:({currentRegistry:O})=>o.jsx(Eo,{showResourcesSwitch:v,showCategory:T,serverVersion:H==null?void 0:H.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:O.url,resourceType:r,resourceDid:i,handleButtonClick:L=>{It({chooseParams:{...L,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:L,defaultRender:W})=>{const ne=(ee==null?void 0:ee.bundleDid)&&(ee==null?void 0:ee.bundleDid)===(L==null?void 0:L.did);return o.jsxs(Pm,{children:[o.jsx(Y,{className:ne?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...ne?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:W}),ne&&o.jsx(Y,{className:"check-container",children:o.jsx(zs,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:Cm({params:ee,blocklet:se,t:y}),onCancel:Jt,onConfirm:()=>{Fe()}}),et.push({key:"agreement",name:y("launchBlocklet.introduction"),body:o.jsxs(un,{component:"div",className:"agreement-wrapper",children:[o.jsx(Ks,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),o.jsx(Fi,{meta:Pe,onClickNext:Fe,installRelated:Ft,onChangeInstallRelated:Xt,handleDescEle:o.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:y("common.pre"),disabled:!Le,confirm:y(Le?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Jt:tt,onConfirm:()=>{Z(!1),Fe()}}),Pe&&ee.requirePurchase&&et.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[y("common.verifyNFT"),o.jsx(Fr,{})]}),body:o.jsxs(un,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((rn=(Ct=qe.current)==null?void 0:Ct.getCurrentStep)==null?void 0:rn.call(Ct))===2||Qe)&&o.jsx(mr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Hn(ee.purchaseResultProps)?We&&o.jsx(Vh,{ref:qe,meta:We.meta,mode:ee.componentDid?"verify":"both",onCancel:ot,installOpts:We.installOpts,handlePaySuccess:Et}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Lo,{...ee.purchaseResultProps})})]}),disabled:((x=(d=qe.current)==null?void 0:d.getCurrentStep)==null?void 0:x.call(d))===2||Qe,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof qe.current.onNext=="function"&&(qe.current.onNext(),Z(!0))},onCancel:()=>{tt()}}),Dt.hasStartEngine(Pe)&&bc.hasMountPoint(Pe)?et.push({key:"config",name:y("common.config"),error:B,body:o.jsxs(un,{component:"div",children:[o.jsx(mr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),o.jsx(Tr,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:I||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ee.pathPrefix,onChange:O=>{const L=O.target.value;de({pathPrefix:L}),F(y("common.slugifyHint",{value:xc(L)}))}}),!!B&&o.jsx(Ps,{severity:"error",style:{width:"100%",marginTop:8},children:B})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:()=>{Fe()}}):Pe&&(ee.pathPrefix=((P=(w=Pe.interfaces)==null?void 0:w[0])==null?void 0:P.path)||`/${Pe.did}`),Pe&&(ee!=null&&ee.hasEnvironmentsStep)&&et.push({key:"environment",name:o.jsxs(o.Fragment,{children:[y("common.environment")," ",ee.hasRequiredEnvironments&&o.jsx(Fr,{})]}),disabled:!!D||(ee==null?void 0:ee.hasMissRequiredConfigs),body:()=>o.jsxs(un,{component:"div",style:{overflowY:"auto"},children:[o.jsx(mr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),o.jsx(Uc,{style:{marginTop:-12,width:"100%"},schema:ee.configsList,defaultValue:ee.configsValue,onChange:(O,{action:L,currentItem:W,allValues:ne})=>{L==="confirm"&&de({hasMissRequiredConfigs:Ts(ee.configsList,ne),configsValue:ne}),L==="edit"?A(W):["cancel","confirm"].includes(L)&&A(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),Pe&&(ee!=null&&ee.didSpaceIsRequiredSetup)&&et.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",ee.didSpaceIsRequiredSetup==="required"&&o.jsx(Fr,{})]}),disabled:(ee==null?void 0:ee.didSpaceIsRequiredSetup)&&!ee.didSpaceEndpoint,body:()=>o.jsx($c,{children:o.jsxs(un,{component:"div",children:[o.jsx(mr,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),o.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:o.jsx(so,{blockletMeta:we.current.meta,onNext:()=>{Fe()},onEndpointUpdate:Yt})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),et.push({key:"install",name:Zt(Pe==null?void 0:Pe.did)?y("common.upgrade"):y("common.install"),disabled:u?!1:Hn(ee.installResultProps),loading:u?!1:Hn(ee.installResultProps),body:o.jsx(un,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Hn(ee.installResultProps)?o.jsx(cc,{message:o.jsx(Lm,{children:y(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Lo,{...ee.installResultProps})})}),confirm:y("common.complete"),onConfirm:Nn});const Ke=et[oe]||{},bn=()=>j||Ke.error||!ee.bundleDid?!0:oe>1?!ee.pathPrefix:!1;return se?o.jsxs(Rm,{sx:a?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[o.jsx(Oc,{steps:et,mode:"memory",children:o.jsx(jm,{ref:Je,meta:Pe,isMobile:Gt,onStepChange:O=>{Ae(O)}})}),o.jsxs(Y,{className:"action-bar",children:[Ke.cancel&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onCancel()},disabled:oe===et.length-2&&j,color:"inherit",children:Ke.cancel||y("common.cancel")}),Ke.confirm&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Ke.disabled=="boolean"?Ke.disabled:bn()),variant:"contained",autoFocus:!0,title:Ke.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ke.loading=="boolean"?Ke.loading:j)&&o.jsx(xt,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke.confirm})]})})]})]}):null}Tl.propTypes={onClose:N.func,mode:N.oneOf(["normal","embed"]),inDialog:N.bool,stores:N.arrayOf(N.string),storeUrl:N.string,resourceType:N.string,resourceDid:N.string,storageKey:N.string,selectedMeta:N.object,showResourcesSwitch:N.bool,showFromUrl:N.bool,enableRunBackground:N.bool,showCategory:N.bool};Tl.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Rm=He(Y)`
|
|
693
|
+
`,km=So,Om=e=>e.inStore&&Dt.isFreeBlocklet(e)===!1,Im=e=>{var t;return[kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,kt.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((t=e==null?void 0:e.capabilities)==null?void 0:t.didSpace)},ii=e=>{var t,n;return((n=(t=e==null?void 0:e.configs)==null?void 0:t.find(r=>r.key===kt.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Cm=e=>(e.environments||[]).some(t=>t.required),Ts=(e,t)=>e==null?void 0:e.some(n=>n.required&&!t[n.key]),Rm=({params:e,blocklet:t,t:n})=>{const r=e.title||e.name;return r?((t==null?void 0:t.children)||[]).find(s=>s.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:r}):n("blocklet.component.addNext",{name:r}):n("common.next")},js=({componentDid:e,timeout:t=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},t)};function Tl({onClose:e,mode:t,stores:n,resourceType:r,resourceDid:i,storageKey:s,inDialog:a,selectedMeta:c,storeUrl:f,showResourcesSwitch:v,showFromUrl:l,enableRunBackground:u,showCategory:T}){var nn,xn,R,St,Ct,rn,d,x,w,P;const{t:y,locale:S}=gt(),[j,_]=M.useState(!1),[D,A]=M.useState(null),[B,V]=M.useState(""),[I,F]=M.useState(""),{api:G,ws:{useSubscription:$},inService:le,info:H}=Ln(),{blocklet:se,actions:{refreshBlocklet:je}}=kr(),[We,Me]=M.useState(null),[Qe,Z]=M.useState(!1),pe={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1},[ee,ye]=M.useState(pe),[oe,Ae]=M.useState(0),we=M.useRef({}),Je=M.useRef({}),qe=M.useRef({}),Gt=qt(O=>O.breakpoints.down("md")),Ht=Yl(),[Ft,Xt]=M.useState(!0),{meta:Pe}=we.current,Le=Zs(Pe),Ze=M.useRef(!1),de=O=>ye(L=>({...L,...O}));M.useEffect(()=>{if(ee.pathPrefix){const{errMsg:O}=tn({...ee,pathPrefix:ee.pathPrefix,locale:S});V(O)}},[ee.pathPrefix]),M.useEffect(()=>{oe===0&&ye(pe)},[oe]);const Yt=()=>{const O=ii(se)??"";de({didSpaceEndpoint:O})},Qt=()=>{var O;return(O=we==null?void 0:we.current)!=null&&O.meta?Dt.getDisplayName(we.current):""},Jt=()=>{_(!1),ye({}),Ze.current=!1,we.current={},e()},ke=O=>{const L=W=>{de({installResultProps:{variant:"error",title:Qt(),subTitle:O,footer:o.jsx(dt,{className:"bottom-button",disabled:W,"data-cy":"retry-install-component",onClick:async()=>{L(!0),await en(we.current.installInput)},children:o.jsxs(Y,{display:"flex",alignItems:"center",children:[W&&o.jsx(xt,{size:16,style:{marginRight:8}}),y("common.retry")]})})}})};L()},Bt=O=>L=>{var W,ne;(((W=L==null?void 0:L.meta)==null?void 0:W.did)||(L==null?void 0:L.meta))===((ne=se==null?void 0:se.meta)==null?void 0:ne.did)&&O(L)},Nn=()=>{js({timeout:0,componentDid:Ht.componentDid,manual:!0}),Jt(),setTimeout(()=>{const O=document.getElementsByClassName("dashboard-main")[0];O&&(O.scrollTop=O.scrollHeight)},200)};$(kt.BlockletEvents.componentInstalled,Bt(()=>{de({installResultProps:{variant:"success",title:Qt(),subTitle:y("blocklet.component.installSuccessTip")}}),js({componentDid:Ht.componentDid})}),[(nn=se==null?void 0:se.meta)==null?void 0:nn.did]),$(kt.BlockletEvents.statusChange,Bt(()=>{const O=ii(se);de(L=>({...L,didSpaceEndpoint:O}))}),[(xn=se==null?void 0:se.meta)==null?void 0:xn.did]),$(kt.BlockletEvents.downloadFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(R=se==null?void 0:se.meta)==null?void 0:R.did]),$(kt.BlockletEvents.installFailed,Bt(()=>{Ze.current=!1,ke(y("blocklet.component.installComponentError"))}),[(St=se==null?void 0:se.meta)==null?void 0:St.did]);const et=[],Zt=O=>((se==null?void 0:se.children)||[]).find(L=>L.meta.did===O),en=async O=>{var Ut,ft;Ze.current=!0;const{pathPrefix:L,bundleDid:W,title:ne,componentName:ae="",componentDid:Be=""}=ee,Ne=((Ut=we.current)==null?void 0:Ut.meta)||{},{configs:Ee=[],registryUrl:Te,inStore:Xe,inputUrl:Rt,dist:An}=Ne,Pt=(ft=we.current)==null?void 0:ft.downloadTokenList,st=Rt||(Xe?Ro(Te,W,An):"");_(!0);const $t={rootDid:se.meta.did,url:st,mountPoint:L?cr(L):`/${cr(Ne.title||Ne.name)}`,title:ne,name:ae,did:Be,onlyRequired:!Ft,...ee.hasEnvironmentsStep&&Ee.length>0?{configs:Ee.map(at=>({...at,value:ee.configsValue[at.key]||""}))}:{},...Pt?{downloadTokenList:Pt}:{},...O};try{if(await G.installComponent({input:$t}),Te){const{teamDid:at,storeList:Lt}=qs({fromBlocklet:le,nodeInfo:H,blocklet:se}),{isNew:wn,decoded:En}=wc(Te,Lt);wn&&await G.addBlockletStore({input:{teamDid:at,url:En}})}de({installResultProps:{}}),je({showError:!1,attachRuntimeInfo:!1})}catch(at){const Lt=Ys(at);Ii.error(Lt),console.error("installComponent error: ",at),ke(Lt)}finally{_(!1),we.current.installInput=$t}},tn=O=>{const L=ou({params:{...O,did:O.bundleDid},blocklets:[se],blocklet:se,locale:S});if(L){const W=Zt(O.bundleDid),ne=su({params:{...O,did:O.bundleDid},blocklet:se});if(W&&W.mountPoint===ne)return{errMsg:""}}return{errMsg:L}},Fe=async O=>{var W,ne;const{errMsg:L}=tn({...ee,locale:S});V(L),oe===et.length-2&&!Ze.current&&await en(O),(ne=(W=Je.current)==null?void 0:W.setActiveStepByIndex)==null||ne.call(W,ae=>ae+1)},tt=()=>{var O,L;(L=(O=Je.current)==null?void 0:O.setActiveStepByIndex)==null||L.call(O,W=>W-1)},wt=()=>{const{pathPrefix:O,bundleDid:L,title:W,componentName:ne="",componentDid:ae=""}=ee,{meta:Be={}}=we.current||{},{registryUrl:Ne,inStore:Ee,inputUrl:Te,dist:Xe}=Be,Rt=Ee?Ro(Ne,L,Xe):Te;Me({meta:Be,installOpts:{type:"component",rootDid:se.meta.did,mountPoint:O,url:Rt,title:W,name:ne,did:ae}})},ot=O=>{Z(!1),de({purchaseResultProps:{variant:"error",title:Qt(),subTitle:O,style:{paddingTop:120},footer:o.jsx(dt,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{de({purchaseResultProps:{}})},children:y("common.retry")})}})},Et=({downloadTokenList:O})=>{we.current.downloadTokenList=O,Z(!1),Fe()},It=({chooseParams:O=we.current,componentDid:L,isInit:W=!1})=>{var En,ar,Dn,Mn;const{meta:ne,registryUrl:ae,inStore:Be,inputUrl:Ne}=O,{did:Ee,title:Te,name:Xe}=ne,Rt=(((En=se.settings)==null?void 0:En.children)||[]).filter($e=>$e.status==="deleted"&&$e.meta.bundleDid===Ee),An=L||"",Pt=(ar=ne.environments)==null?void 0:ar.map($e=>{const{name:Sn,validation:on,...Tn}=$e,sn={validation:Fc(on)?"":on};return{...Tn,key:Sn,...sn}});we.current={...O,meta:{...ne,configs:Pt,registryUrl:ae,inStore:Be,inputUrl:Ne}};let st={};if(W){const $e=[se],Sn=Pt||[],on=[],Tn=Vs(Mc([...Sn,...on]),"key").filter(vt=>!!vt.key).sort((vt,an)=>vt.required&&!an.required?-1:an.required&&!vt.required?1:0),sn=Dt.getSharedConfigObj($e[0],{configs:Tn}),Fn={},Oe=Tn.map(vt=>{const{default:an,key:ln,...lr}=vt;return Fn[ln]=sn[ln]||an,{...lr,key:ln,hidden:!!kt.BLOCKLET_CONFIGURABLE_KEY[ln]}});st={...st,configsList:Oe,configsValue:Fn,hasMissRequiredConfigs:Ts(Oe,Fn)}}const $t=se.children.some($e=>$e.mountPoint==="/"),Ut=Rt.find($e=>$e.meta.bundleDid===Ee),ft=se.children.find($e=>$e.meta.bundleDid===Ee);st.title=Te||"",Ut?st={...st,pathPrefix:Ut.mountPoint||"",componentName:Ut.meta.name,hasEnvironmentsStep:!1}:ft?st={...st,pathPrefix:ft.mountPoint||"",componentName:ft.meta.name,hasEnvironmentsStep:!1}:st={...st,pathPrefix:$t?`/${cr(Te)||cr(Xe)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Mn=(Dn=we.current.meta)==null?void 0:Dn.environments)==null?void 0:Mn.length)>0};const at=Om(we.current.meta),Lt=Im(we.current.meta),wn=ii(se);de({bundleDid:Ee,componentDid:An,...st,hasRequiredEnvironments:Cm(we.current.meta),requirePurchase:at,didSpaceIsRequiredSetup:Lt,didSpaceEndpoint:wn}),W&&at&&wt()};M.useEffect(()=>{!c||oe!==0||!se||(It({chooseParams:{blocklets:[c],meta:c,registryUrl:f||c.homepage,inStore:!0},isInit:!0}),de({showFromUrlDialog:!1}),Fe())},[c,oe,se]),et.push({key:"selectComponent",name:y("blocklet.component.selectComponent"),body:o.jsxs(un,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[l&&ee.showFromUrlDialog&&o.jsx(no,{mode:"component",onCancel:()=>{de({showFromUrlDialog:!1})},onSuccess:({meta:O,inputUrl:L,inStore:W,registryUrl:ne})=>{It({chooseParams:{meta:O,inputUrl:L,inStore:W,registryUrl:ne},isInit:!0}),de({showFromUrlDialog:!1}),Fe()},handleText:{title:y("blocklet.component.addComponentTip.fromUrl"),confirm:y("blocklet.component.choose")}}),o.jsx(ao,{stores:n,extra:Ms.isInServerlessMode(H)?null:l?o.jsxs(dt,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{de({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[o.jsx(Js,{style:{fontSize:20,marginRight:4}})," ",y("blocklet.component.addComponentTip.fromUrl")," "]}):null,loading:j,onChange:()=>{ye({}),we.current={}},storageKey:s,children:({currentRegistry:O})=>o.jsx(Eo,{showResourcesSwitch:v,showCategory:T,serverVersion:H==null?void 0:H.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:O.url,resourceType:r,resourceDid:i,handleButtonClick:L=>{It({chooseParams:{...L,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:L,defaultRender:W})=>{const ne=(ee==null?void 0:ee.bundleDid)&&(ee==null?void 0:ee.bundleDid)===(L==null?void 0:L.did);return o.jsxs(Lm,{children:[o.jsx(Y,{className:ne?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...ne?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:W}),ne&&o.jsx(Y,{className:"check-container",children:o.jsx(zs,{className:"check-icon"})})]})}})})]}),cancel:t==="embed"?void 0:y("common.cancel"),confirm:Rm({params:ee,blocklet:se,t:y}),onCancel:Jt,onConfirm:()=>{Fe()}}),et.push({key:"agreement",name:y("launchBlocklet.introduction"),body:o.jsxs(un,{component:"div",className:"agreement-wrapper",children:[o.jsx(Ks,{title:y("launchBlocklet.introduction"),subTitle:y("blocklet.component.addComponentTip.introduction")}),o.jsx(Fi,{meta:Pe,onClickNext:Fe,installRelated:Ft,onChangeInstallRelated:Xt,handleDescEle:o.jsx("p",{children:y("blocklet.component.addComponentTip.belowInformation")})})]}),cancel:c?void 0:y("common.pre"),disabled:!Le,confirm:y(Le?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Jt:tt,onConfirm:()=>{Z(!1),Fe()}}),Pe&&ee.requirePurchase&&et.push({key:"purchase",name:o.jsxs(o.Fragment,{children:[y("common.verifyNFT"),o.jsx(Fr,{})]}),body:o.jsxs(un,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((rn=(Ct=qe.current)==null?void 0:Ct.getCurrentStep)==null?void 0:rn.call(Ct))===2||Qe)&&o.jsx(mr,{title:y("common.verifyNFT"),subTitle:y("blocklet.component.addComponentTip.verifyNFT")}),Hn(ee.purchaseResultProps)?We&&o.jsx(Vh,{ref:qe,meta:We.meta,mode:ee.componentDid?"verify":"both",onCancel:ot,installOpts:We.installOpts,handlePaySuccess:Et}):o.jsx("div",{className:"flex-align-center flex-justify-center",children:o.jsx(Lo,{...ee.purchaseResultProps})})]}),disabled:((x=(d=qe.current)==null?void 0:d.getCurrentStep)==null?void 0:x.call(d))===2||Qe,cancel:y("common.pre"),confirm:y("common.next"),onConfirm:()=>{typeof qe.current.onNext=="function"&&(qe.current.onNext(),Z(!0))},onCancel:()=>{tt()}}),Dt.hasStartEngine(Pe)&&bc.hasMountPoint(Pe)?et.push({key:"config",name:y("common.config"),error:B,body:o.jsxs(un,{component:"div",children:[o.jsx(mr,{title:y("common.config"),subTitle:y("blocklet.component.addComponentTip.config")}),o.jsx(Tr,{label:y("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:I||y("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:ee.pathPrefix,onChange:O=>{const L=O.target.value;de({pathPrefix:L}),F(y("common.slugifyHint",{value:xc(L)}))}}),!!B&&o.jsx(Ps,{severity:"error",style:{width:"100%",marginTop:8},children:B})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:()=>{Fe()}}):Pe&&(ee.pathPrefix=((P=(w=Pe.interfaces)==null?void 0:w[0])==null?void 0:P.path)||`/${Pe.did}`),Pe&&(ee!=null&&ee.hasEnvironmentsStep)&&et.push({key:"environment",name:o.jsxs(o.Fragment,{children:[y("common.environment")," ",ee.hasRequiredEnvironments&&o.jsx(Fr,{})]}),disabled:!!D||(ee==null?void 0:ee.hasMissRequiredConfigs),body:()=>o.jsxs(un,{component:"div",style:{overflowY:"auto"},children:[o.jsx(mr,{title:y("common.environment"),subTitle:y("blocklet.component.addComponentTip.environment")}),o.jsx(Uc,{style:{marginTop:-12,width:"100%"},schema:ee.configsList,defaultValue:ee.configsValue,onChange:(O,{action:L,currentItem:W,allValues:ne})=>{L==="confirm"&&de({hasMissRequiredConfigs:Ts(ee.configsList,ne),configsValue:ne}),L==="edit"?A(W):["cancel","confirm"].includes(L)&&A(null)}})]}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),Pe&&(ee!=null&&ee.didSpaceIsRequiredSetup)&&et.push({key:"didSpace",name:o.jsxs(o.Fragment,{children:[y("blocklet.component.didSpaceConfig")," ",ee.didSpaceIsRequiredSetup==="required"&&o.jsx(Fr,{})]}),disabled:(ee==null?void 0:ee.didSpaceIsRequiredSetup)&&!ee.didSpaceEndpoint,body:()=>o.jsx($c,{children:o.jsxs(un,{component:"div",children:[o.jsx(mr,{title:y("blocklet.component.didSpaceConfig"),subTitle:y("blocklet.component.didSpaceConfigTip")}),o.jsx(Y,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:o.jsx(so,{blockletMeta:we.current.meta,onNext:()=>{Fe()},onEndpointUpdate:Yt})})]})}),cancel:y("common.pre"),confirm:y("common.next"),onCancel:tt,onConfirm:Fe}),et.push({key:"install",name:Zt(Pe==null?void 0:Pe.did)?y("common.upgrade"):y("common.install"),disabled:u?!1:Hn(ee.installResultProps),loading:u?!1:Hn(ee.installResultProps),body:o.jsx(un,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:Hn(ee.installResultProps)?o.jsx(cc,{message:o.jsx(_m,{children:y(u?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):o.jsx("div",{style:{marginTop:120},children:o.jsx(Lo,{...ee.installResultProps})})}),confirm:y("common.complete"),onConfirm:Nn});const Ke=et[oe]||{},bn=()=>j||Ke.error||!ee.bundleDid?!0:oe>1?!ee.pathPrefix:!1;return se?o.jsxs(Pm,{sx:a?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[o.jsx(Oc,{steps:et,mode:"memory",children:o.jsx(km,{ref:Je,meta:Pe,isMobile:Gt,onStepChange:O=>{Ae(O)}})}),o.jsxs(Y,{className:"action-bar",children:[Ke.cancel&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onCancel()},disabled:oe===et.length-2&&j,color:"inherit",children:Ke.cancel||y("common.cancel")}),Ke.confirm&&o.jsx(dt,{onClick:O=>{O.stopPropagation(),Ke.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:j||(typeof Ke.disabled=="boolean"?Ke.disabled:bn()),variant:"contained",autoFocus:!0,title:Ke.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:o.jsxs(Y,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof Ke.loading=="boolean"?Ke.loading:j)&&o.jsx(xt,{style:{marginRight:8},size:16}),o.jsx(Y,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ke.confirm})]})})]})]}):null}Tl.propTypes={onClose:N.func,mode:N.oneOf(["normal","embed"]),inDialog:N.bool,stores:N.arrayOf(N.string),storeUrl:N.string,resourceType:N.string,resourceDid:N.string,storageKey:N.string,selectedMeta:N.object,showResourcesSwitch:N.bool,showFromUrl:N.bool,enableRunBackground:N.bool,showCategory:N.bool};Tl.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0};const Pm=He(Y)`
|
|
693
694
|
.action-bar {
|
|
694
695
|
display: flex;
|
|
695
696
|
justify-content: flex-end;
|
|
@@ -706,7 +707,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
706
707
|
height: 100%;
|
|
707
708
|
`,mr=He(Ks)`
|
|
708
709
|
margin-bottom: 24px;
|
|
709
|
-
`,
|
|
710
|
+
`,Lm=He.div`
|
|
710
711
|
position: relative;
|
|
711
712
|
|
|
712
713
|
.choose-blocklet {
|
|
@@ -750,7 +751,7 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
750
751
|
transition: all ease 0.2s;
|
|
751
752
|
}
|
|
752
753
|
}
|
|
753
|
-
`,
|
|
754
|
+
`,_m=He.div`
|
|
754
755
|
color: ${e=>e.theme.palette.primary.main};
|
|
755
756
|
.msg-before {
|
|
756
757
|
display: inline-block;
|
|
@@ -758,4 +759,4 @@ see detail in https://www.npmjs.com/package/is-var-name
|
|
|
758
759
|
font-size: 14px;
|
|
759
760
|
margin-right: 6px;
|
|
760
761
|
}
|
|
761
|
-
`;export{Tl as A,Ua as B,
|
|
762
|
+
`;export{Tl as A,Ua as B,hg as S,ug as a,dg as b,vm as c,Js as d,sa as f};
|