import{ge as k,i6 as P,bN as U,hZ as v,az as I,aj as y,aI as u,ao as e,aP as d,ag as L,aq as t,at as w,r as m,dJ as g}from"./app-k0jcl5PQ.js";import{a as A}from"./BcYgJJPz.chunk.js";import{u as B,a as R,O as s,b as T,c as f}from"./JiP4blAc.chunk.js";import{L as E}from"./C_Or9fFB.chunk.js";import{M as _}from"./Pc6wfgHx.chunk.js";import"./BZ-tsgAq.chunk.js";import"./CCKlkV4O.chunk.js";import"./CECGJrz_.chunk.js";import"./Cq8Wr_gd.chunk.js";const q="_annotation_1q6bx_1",D={annotation:q},F="onboarding.selectCurriculum";function Q(p){var c;const{onClickBack:x,exitOnboarding:h,completeStepAsync:C,onSaveError:b}=B(p.redirectUrl),{logEvent:i}=R(),{preferredPresentation:j}=k(),n=P();U({title:v["select-curriculum"].getPageTitle()});const N=I(y.currentUser()),[r,o]=u.useState(n.preferredCurriculum);u.useEffect(()=>{var a;n.hasCompleted&&(a=n.preferredCurriculum)!=null&&a.id&&o(n.preferredCurriculum)},[n.hasCompleted]);function S(a){i(m.Select,g.SelectCurriculum,{curriculumId:a.id,curriculumName:a.name}),o(a)}async function O(){i(m.Click,g.Next,{curriculumId:r==null?void 0:r.id,curriculumName:r==null?void 0:r.name});try{await n.updateCurriculum(r.id,{shouldLog:!1}),await C()}catch{return b(),Promise.reject()}}return e.jsxs(s,{namespace:F,children:[e.jsx(s.Left,{className:"bg-ultramarine d-flex flex-column align-items-end justify-content-center",children:e.jsx(E,{contentPosition:"right",annotationClassName:D.annotation,annotationUrl:((c=N.data)==null?void 0:c.instanceRegion)===L.US?d.OnboardingV2.SelectCurriculum.ANNOTATION_US:d.OnboardingV2.SelectCurriculum.ANNOTATION,annotationPosition:"top-left",children:e.jsx(_,{presentation:j,curriculum:r,editingCurriculum:!0})})}),e.jsxs(s.Right,{hasCustomButtons:!1,onClickNext:O,onClickBack:x,onClickComeBackLater:h,disableNext:!r,children:[e.jsx(T,{children:e.jsx(t,{phrase:"heading"})}),e.jsx(f,{children:e.jsx(t,{phrase:"info"})}),e.jsx("ul",{className:"list-unstyled mb-2 row g-2",children:n.availableCurriculums.map(a=>{var l;return e.jsx("li",{className:"col-12 col-xl-12 col-lg-12 col-md-6 col-sm-6",children:e.jsx(w,{onClick:()=>S(a),children:e.jsx(A,{data:a,coverUrl:(l=a.cover)==null?void 0:l.url,imageClassName:"border-end",isSelected:a.id===(r==null?void 0:r.id),showFallbackBackgroundColour:!1,hideCheckmark:!0,multiline:!0,hideFallback:!0,className:"flex-grow-1"})})},a.id)})}),e.jsx(f,{children:e.jsx(t,{phrase:"dontWorry"})})]})]})}export{Q as OnboardingSelectCurriculumView};
//# sourceMappingURL=D5m6qVy7.chunk.js.map
