"use strict";(self.webpackChunk_digicms_admin=self.webpackChunk_digicms_admin||[]).push([[3677],{15415:(A,v,t)=>{t.r(v),t.d(v,{default:()=>F});var e=t(32735),g=t(88425),p=t(99357),y=t(5636),P=t(83983),T=t(29270),d=t(11856),E=t(16540),c=t(95602),a=t(53214),M=t(84968),L=t(17247),b=(n,s,l)=>new Promise((f,r)=>{var h=i=>{try{o(l.next(i))}catch(u){r(u)}},m=i=>{try{o(l.throw(i))}catch(u){r(u)}},o=i=>i.done?f(i.value):Promise.resolve(i.value).then(h,m);o((l=l.apply(n,s)).next())});const C=()=>b(void 0,null,function*(){const{data:n}=yield L.be.get("/admin/plugins");return n}),I=n=>{const s=(0,g.useNotification)();return(0,M.useQuery)("list-enabled-plugins",()=>C(),{onSuccess(){n&&n()},onError(){s({type:"warning",message:{id:"notification.error",defaultMessage:"An error occured"}})}})},N=()=>{var n,s;const{formatMessage:l}=(0,y.useIntl)(),{notifyStatus:f}=(0,T.useNotifyAT)();(0,g.useFocusWhenNavigate)();const r=l({id:"global.plugins",defaultMessage:"Plugins"}),h=()=>{f(l({id:"app.utils.notify.data-loaded",defaultMessage:"The {target} has loaded"},{target:r}))},{status:m,data:o}=I(h);return m!=="success"&&m!=="error"?e.createElement(d.Layout,null,e.createElement(E.Main,{"aria-busy":!0},e.createElement(g.LoadingIndicatorPage,null))):e.createElement(d.Layout,null,e.createElement(E.Main,null,e.createElement(d.HeaderLayout,{title:r,subtitle:l({id:"app.components.ListPluginsPage.description",defaultMessage:"List of the installed plugins in the project."})}),e.createElement(d.ContentLayout,null,e.createElement(a.Table,{colCount:2,rowCount:(s=(n=o==null?void 0:o.plugins)==null?void 0:n.length)!=null?s:0+1},e.createElement(a.Thead,null,e.createElement(a.Tr,null,e.createElement(a.Th,null,e.createElement(c.Typography,{variant:"sigma",textColor:"neutral600"},l({id:"global.name",defaultMessage:"Name"}))),e.createElement(a.Th,null,e.createElement(c.Typography,{variant:"sigma",textColor:"neutral600"},l({id:"global.description",defaultMessage:"description"}))))),e.createElement(a.Tbody,null,o.plugins.map(({name:u,displayName:x,description:H})=>e.createElement(a.Tr,{key:u},e.createElement(a.Td,null,e.createElement(c.Typography,{textColor:"neutral800",variant:"omega",fontWeight:"bold"},l({id:`global.plugins.${u}`,defaultMessage:x}))),e.createElement(a.Td,null,e.createElement(c.Typography,{textColor:"neutral800"},l({id:`global.plugins.${u}.description`,defaultMessage:H}))))))))))},F=()=>{const{formatMessage:n}=(0,y.useIntl)(),s=n({id:"global.plugins",defaultMessage:"Plugins"});return e.createElement(g.CheckPagePermissions,{permissions:P.Z.marketplace.main},e.createElement(p.Helmet,{title:s}),e.createElement(N,null))}}}]);
