import{bK as I,ge as P,bN as S,hZ as b,az as j,aj as C,i1 as U,ax as V,bd as y,e9 as D,aI as M,ao as t,aq as r,at as k,aP as w,ag as R,fO as K,fW as i,r as d,dJ as N}from"./app-k0jcl5PQ.js";import{a as B}from"./BcYgJJPz.chunk.js";import{u as W,a as q,O as o,b as F,c as u}from"./JiP4blAc.chunk.js";import{L as H}from"./C_Or9fFB.chunk.js";import{M as z}from"./Pc6wfgHx.chunk.js";import"./BZ-tsgAq.chunk.js";import"./CCKlkV4O.chunk.js";import"./CECGJrz_.chunk.js";import"./Cq8Wr_gd.chunk.js";const J="_cover_1efda_1",Z="_presentationList_1efda_5",L={cover:J,presentationList:Z},$="onboarding.schoolLevel";function re(g){const{onClickBack:m,completeStepAsync:_,onSaveError:O}=W(g.redirectUrl),{logEvent:c}=q(),{availablePresentations:p}=I(),{setPreferredPresentation:f}=P();S({title:b["school-level"].getPageTitle()});const E=j(C.currentUser()),a=U(),[,A]=V(D.AUDIENCE_FILTER,void 0,{storage:y.SessionStorage}),[n,v]=M.useState();function T(e){c(d.Select,N.SelectPresentation,{presentationId:e.id,presentationName:e.name,presentationDescription:e.description}),v(e)}async function h(){c(d.Click,N.Next,{presentationId:n.id,presentationName:n.name,presentationDescription:n.description},{preferredPresentationOverride:n}),A(null);try{await f(n),await _({preferredPresentationOverride:n})}catch{return O(),Promise.reject()}}function x(){var l;const e=w.OnboardingV2.SchoolLevel,s=((l=E.data)==null?void 0:l.instanceRegion)===R.US;if(!n)return e.ANNOTATION_NONE_SELECTED;switch(K.getMappedPresentationLevel(n.learningLevel)){case i.Level_1:return a?e.ANNOTATION_LEVEL_1_ICP:e.ANNOTATION_LEVEL_1;case i.Level_2:return a?e.ANNOTATION_LEVEL_2_ICP:s?e.ANNOTATION_LEVEL_2_US:e.ANNOTATION_LEVEL_2;case i.Level_3:return a?s?e.ANNOTATION_LEVEL_3_ICP_US:e.ANNOTATION_LEVEL_3_ICP:s?e.ANNOTATION_LEVEL_3_US:e.ANNOTATION_LEVEL_3;default:return e.ANNOTATION_LEVEL_1}}return t.jsxs(o,{namespace:$,children:[t.jsx(o.Left,{className:"bg-ultramarine d-flex flex-column align-items-end justify-content-center",children:t.jsx(H,{contentPosition:"right",annotationUrl:x(),annotationPosition:"bottom-left",children:t.jsx(z,{presentation:n})})}),t.jsxs(o.Right,{hasCustomButtons:!1,onClickNext:h,onClickBack:m,disableNext:!n,children:[t.jsx(F,{children:t.jsx(r,{phrase:a?"headingKdm":"heading"})}),t.jsx(u,{children:t.jsx(r,{phrase:"info"})}),t.jsx("ul",{className:`list-unstyled mb-1 ${L.presentationList}`,children:p.map(e=>{var s;return t.jsx("li",{className:"mb-2",children:t.jsx(k,{onClick:()=>T(e),children:t.jsx(B,{data:e,coverUrl:(s=e.cover)==null?void 0:s.url,imageClassName:L.cover,isSelected:e.id===(n==null?void 0:n.id),className:"flex-grow-1"})})},e.id)})}),t.jsx(u,{children:t.jsx(r,{phrase:"dontWorry"})})]})]})}export{re as OnboardingSchoolLevelView};
//# sourceMappingURL=DzpOX5dK.chunk.js.map
