import{R as h,o as n,j as e,e9 as j,aR as g,aw as b,ar as F}from"./app-BgLa5dit.js";import{C as w}from"./BfMtaC_g.chunk.js";import{N as T}from"./C9Rwpp7a.chunk.js";import{g as D,C as P}from"./DXOqncq7.chunk.js";import{C as y,a as R}from"./DsVQ3BFu.chunk.js";import{C as S}from"./NOUvVBMO.chunk.js";import{C as p}from"./q-IBKcuF.chunk.js";import"./DJ0pq8J_.chunk.js";import"./CCcwLDvu.chunk.js";import"./DDfKZ_ng.chunk.js";import"./CmeGmsFm.chunk.js";import"./Zwjmkasg.chunk.js";import"./CsH2Nu4a.chunk.js";import"./Bs6fQ2wT.chunk.js";import"./BUT90D7O.chunk.js";import"./C1fMRwzQ.chunk.js";import"./DUpYPoLs.chunk.js";import"./EZim8aq-.chunk.js";import"./BD9MrUJP.chunk.js";import"./s6cGcwlA.chunk.js";import"./4qGb1BIY.chunk.js";import"./DnXDEnAR.chunk.js";import"./DpUpv6rY.chunk.js";import"./CG7zbly5.chunk.js";import"./m4aqaK_l.chunk.js";import"./MEkA24R1.chunk.js";import"./C53kfXmd.chunk.js";function q({id:a,currentCftDisplayName:d,filteredCFTs:u,onIsNextDisabledChange:m}){var c;const o=b(),r=o.values.cftName||"",t=n(r&&p.driftCustomerFormationTemplate(a,r)),i=!!r&&t.hasCompleted&&!((c=t.data)!=null&&c.canMigrate);h.useEffect(()=>{m(i)},[i]);function l(s){o.setValues({...o.values,cftName:s,enabledCurriculums:[],enabledPresentations:[],enabledProducts:[],enabledLibraries:[],hasCustomisations:!1})}return e.jsxs("div",{className:"crm-studio-wizard-form",children:[e.jsxs("div",{className:"d-flex flex-column gap-3 w-75 mt-3",children:[e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx("p",{className:"mb-0 w-25 fw-semibold",children:"Current CFT"}),e.jsx("p",{className:"mb-0",children:d})]}),e.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[e.jsx("p",{className:"mb-0 flex-shrink-0 w-25 fw-semibold",children:"New CFT"}),e.jsxs("select",{className:"form-select",value:r,onChange:s=>l(s.target.value),children:[e.jsx("option",{disabled:!0,value:"",children:"Select CFT ..."}),u.map(s=>e.jsx("option",{value:s.name,children:s.displayName},s.name))]})]})]}),r&&e.jsxs("div",{className:"w-50 mt-4",children:[e.jsx("h3",{className:"h4",children:"Review CFT change"}),t.hasCompleted?e.jsx(P,{drift:t.data}):e.jsx(F,{animation:"border",role:"status",size:"sm",variant:"info"})]})]})}function ie(a){var f,C,x;const[d,u]=h.useState(!1),m=n(p.customer(a.id)),o=n(g.currentUser()),r=w.isDev(o.data),t=n(p.customerFormationTemplate(a.id,void 0,()=>{})),i=D(t.data,m.data),l=n(i&&T.customerFormationTemplates(i.region,i.country,"")),c=((f=l.data)==null?void 0:f.filter(v=>r?!0:v.status!==S.Draft))??[];if(!t.hasCompleted)return null;const s={cftName:(C=t.data)==null?void 0:C.name,...a.queryParams},N=!m.hasCompleted||!!i&&!l.hasCompleted;return e.jsxs(y,{id:a.id,currentStepId:R.CFT,queryParams:s,isNextDisabled:d,children:[e.jsx("h2",{className:"h3",children:"Select a CFT"}),N?e.jsx(j,{}):e.jsx(q,{id:a.id,currentCftDisplayName:((x=t.data)==null?void 0:x.displayName)??"None",filteredCFTs:c,onIsNextDisabledChange:u})]})}export{ie as CustomerConvertingWizardCftView};
//# sourceMappingURL=Dc0ibLbp.chunk.js.map
