import{j as s,bE as h,ex as d,E as f,a9 as x}from"./app-BgLa5dit.js";import{a}from"./Zwjmkasg.chunk.js";function j({label:n,data:r}){return r.length?s.jsxs("li",{children:[s.jsxs("strong",{children:[n,":"]}),s.jsx("ul",{children:r.map(([e,c])=>s.jsxs("li",{children:[s.jsx("span",{className:"text-capitalize",children:c.name}),":",s.jsx("em",{children:c.value?" Enabled":" Disabled"})]},e))})]},n):s.jsx(s.Fragment,{})}function u({label:n,data:r}){return s.jsxs("li",{children:[s.jsx("strong",{children:n}),r!=null&&r.length?s.jsx("ul",{children:r.map(e=>s.jsx("li",{children:e.name},e.id||e.name))}):s.jsx("em",{children:": N/A"})]},n)}function T(n){const{type:r,label:e,data:c,onClick:i}=n,o=c.sort((l,t)=>l.name.localeCompare(t.name));return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-2",children:s.jsx("strong",{children:e})}),s.jsx("div",{className:"row gy-2",children:o.map(l=>s.jsx("div",{className:"col col-12",children:s.jsxs("div",{className:"d-inline-flex align-items-center justify-content-between p-2 border rounded w-100 h-100",children:[s.jsx("span",{className:"text-capitalize me-1",children:l.name}),s.jsx("div",{children:s.jsx(h,{on:l.enabled,onClick:()=>i(r,{...l,enabled:!l.enabled}),showStateWhenDisabled:!0})})]})},l.name))})]})}function b(n){function r(i){return i?Object.entries(i).filter(([,o])=>!o.hidden):[]}function e(i){return i?i.filter(o=>o.enabled):[]}function c(i){return i?i==null?void 0:i.filter(o=>{const l=+o.id;return!(l===d.PresentationIds.DEFAULT_CURRICULUM||l===d.PresentationIds.DEFAULT)}):[]}return{features:r(n==null?void 0:n.features),options:r(n==null?void 0:n.options),products:e(n==null?void 0:n.products),subjectPresentations:c(n==null?void 0:n.subjectPresentations),curriculumPresentations:c(n==null?void 0:n.curriculumPresentations)}}function m(n){function r(i){return i?i.filter(o=>o.optional):[]}const e=r(n.libraries),c=r(n.curriculumPresentations);return{libraries:e,curriculumPresentations:c,hasCustomisations:!!(e!=null&&e.length)||!!c.length}}function g(n){var t;const r=(t=n.cft)==null?void 0:t.data,{features:e,options:c,products:i,subjectPresentations:o,curriculumPresentations:l}=b(r);return s.jsx("div",{children:r&&s.jsxs("ul",{children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Name: "}),n.cft.displayName]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Description: "}),n.cft.description]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Type: "}),a[r==null?void 0:r.customerType]]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Country: "}),s.jsx("span",{className:"text-capitalize",children:n.cft.country})]}),s.jsx(u,{label:"Libraries",data:r==null?void 0:r.libraries}),s.jsx(u,{label:"Shared Libraries",data:r==null?void 0:r.sharedLibraries}),s.jsx(j,{label:"Features",data:e}),s.jsx(j,{label:"Options",data:c}),s.jsx(u,{label:"Products",data:i}),s.jsx(u,{label:"Topic Presentations",data:o}),s.jsx(u,{label:"Curriculum Presentations",data:l}),s.jsx(u,{label:"Year Groups",data:r==null?void 0:r.yearGroups})]})})}function v(n){return s.jsxs(f,{title:"Preview CFT",closePopup:n.closeTemplatePreview,children:[s.jsx(g,{cft:n.previewTemplate}),s.jsx(x,{children:s.jsx(x.Submit,{variant:"dark",onClick:n.closeTemplatePreview,text:"Close",disabled:!1})})]})}export{v as C,T as a,b,u as c,j as d,m as g};
//# sourceMappingURL=MzD4y3tN.chunk.js.map
