1"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[5227],{89485(e,t,r){r.d(t,{A:()=>i});r(9950);var o=r(51365),s=r(9605),a=r(44414);const l="Your tutor profile changes how your AI Tutor name and avatar appear during learning sessions. Tutoring quality and learning behavior remain the same across all tutor profiles.";function n(e){let{tutor:t,isSelected:r,onSelect:o,showRoleLabel:l=!1,useUsLayout:n=!1}=e;const i=["student-tutor-profile-card",n?"student-tutor-profile-card--us":"",r?"student-tutor-profile-card--selected":""].filter(Boolean).join(" ");return(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":r,onClick:()=>o(t.id),className:i,"aria-label":`Select ${t.name} as AI tutor`,children:[r&&(0,a.jsx)("span",{className:"student-tutor-profile-card__check","aria-hidden":"true",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,a.jsx)("span",{className:"student-tutor-profile-card__avatar-wrap",children:(0,a.jsx)("img",{src:(0,s.k$)(t.imageName),alt:"",width:80,height:80,className:"student-tutor-profile-card__avatar",loading:"lazy",decoding:"async"})}),l?(0,a.jsx)("p",{className:"student-tutor-profile-card__role student-tutor-profile-card__role--above-name",children:"AI Tutor"}):null,(0,a.jsx)("p",{className:r?"student-tutor-profile-card__name student-tutor-profile-card__name--selected":"student-tutor-profile-card__name",children:t.name})]})}function i(e){let{selectedTutorId:t,onSelect:r,tutors:i=[],loading:d=!1,showSectionHeader:u=!0,allowDeselect:c=!0}=e;const p=e=>{r(c&&t===e?null:e)},f=Array.isArray(i)?i:[],h=(0,s.Ks)(f),m=(0,s.tY)(f),x=e=>(0,a.jsx)(n,{tutor:e,isSelected:t===e.id,onSelect:p,showRoleLabel:h,useUsLayout:h},e.id);return(0,a.jsxs)("section",{className:"student-tutor-profile-section","aria-labelledby":u?"tutor-profile-heading":void 0,children:[u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("h4",{id:"tutor-profile-heading",className:"student-tutor-profile-section__title",children:["Tutor Profile",(0,a.jsx)(o.Ay,{text:l,ariaLabel:l,showTitleInPopup:!1,placement:"top-start",className:"inline-flex shrink-0 items-center"})]}),(0,a.jsx)("p",{className:"student-tutor-profile-section__description",children:"Choose how your AI Tutor appears during learning sessions. If you do not select a tutor, Lumio is used by default."})]}):null,d?(0,a.jsx)("p",{className:"student-dash-text-muted text-sm",children:"Loading tutor profiles..."}):h&&m?(0,a.jsxs)("div",{className:"student-tutor-profile-layout-us",role:"listbox","aria-label":"Choose your AI tutor",children:[(0,a.jsx)("div",{className:"student-tutor-profile-grid student-tutor-profile-grid--us-row student-tutor-profile-grid--us-row-top",children:m.neutral.map(x)}),(0,a.jsx)("div",{className:"student-tutor-profile-grid student-tutor-profile-grid--us-row",children:m.female.map(x)}),(0,a.jsx)("div",{className:"student-tutor-profile-grid student-tutor-profile-grid--us-row",children:m.male.map(x)})]}):(0,a.jsx)("div",{className:"student-tutor-profile-grid",role:"listbox","aria-label":"Choose your AI tutor",children:f.map(x)})]})}},1511(e,t,r){r.d(t,{I:()=>a});var o=r(9950),s=r(18555);function a(){const[e,t]=(0,o.useState)([]),[r,a]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{let e=!1;return(0,s.getTutorProfiles)("useTutorProfiles").then(r=>{e||t(Array.isArray(r)?r:[])}).catch(()=>{e||t([])}).finally(()=>{e||a(!1)}),()=>{e=!0}},[]),{tutors:e,loading:r}}},65227(e,t,r){r.r(t),r.d(t,{default:()=>p});var o=r(9950),s=r(41413),a=r(89485),l=r(92906),n=r(18555),i=r(34349),d=r(1511),u=r(9605),c=r(44414);const p=function(){const e=(0,s.Zp)(),t=(0,s.zy)(),{student:r,userProfile:p,refreshUserProfile:f}=(0,l.Fj)(),{tutors:h,loading:m}=(0,d.I)(),x=p||r||{},[g,b]=(0,o.useState)(!0),[y,w]=(0,o.useState)(()=>(0,u.lg)(null===x||void 0===x?void 0:x.profile)||null),[v,j]=(0,o.useState)(!1),[N,P]=(0,o.useState)(null),[C,k]=(0,o.useState)(""),S=(0,o.useRef)(!1),_=()=>{const{createdMetasForChoice:r,nextPathAfterLater:o,nextPathState:s}=t.state||{};Array.isArray(r)&&r.length>0?e("/student/onboarding/goal-selection",{replace:!0,state:{resumeILPChoice:!0,createdMetasForChoice:r,nextPathAfterLater:o||"/student/dashboard",nextPathState:s}}):e(o||"/student/dashboard",{replace:!0,state:s})};if((0,o.useEffect)(()=>
1{if(S.current)return;if(!r&&!p)return;(async()=>{S.current=!0;const t=p||r||{};if((0,u.es)(t))if((0,u.KP)(t.profile))_();else{try{const t=await(0,i.c)(r,p);if("profile-completion"===t.step||"system-check"===t.step||"goal-selection"===t.step)return void e(t.path,{replace:!0})}catch(o){console.error("Tutor profile onboarding status check failed:",o)}if(!(0,u.q8)(t.profile))try{await(0,n.updateCurrentUserProfile)({profile:(0,u.Qt)()}),f&&await f("TutorProfileOnboardingPage (pending)")}catch(s){console.warn("Could not mark tutor profile onboarding pending:",s)}w((0,u.lg)(t.profile)||null),b(!1)}else e("/student/dashboard",{replace:!0})})()},[r,p,e]),g)return(0,c.jsx)("div",{className:"student-page-shell flex items-center justify-center",children:(0,c.jsxs)("div",{className:"text-center",children:[(0,c.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-[color:var(--accent-brand)] mx-auto mb-4"}),(0,c.jsx)("p",{className:"student-dash-text-muted",children:"Loading..."})]})});const T=v||Boolean(N);return(0,c.jsx)("div",{className:"student-page-shell flex items-center justify-center px-3 py-4 sm:p-6 w-full min-w-0",children:(0,c.jsxs)("div",{className:"max-w-3xl w-full min-w-0",children:[(0,c.jsxs)("div",{className:"text-center mb-8",children:[(0,c.jsx)("h1",{className:"text-3xl sm:text-4xl font-bold student-dash-text mb-3",children:"Choose Your Tutor Profile"}),(0,c.jsx)("p",{className:"text-base sm:text-lg student-dash-text-muted max-w-2xl mx-auto",children:"Select the tutor name and avatar you would like to see during your AI learning sessions."})]}),(0,c.jsxs)("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-2xl shadow-sm p-4 sm:p-6 mb-6",children:[(0,c.jsx)(a.A,{selectedTutorId:y,onSelect:async e=>{k(""),w(e||null),P(e||"lumio");try{await(async e=>{const t=e?(0,u.F1)((0,u.w4)(e,h)):(0,u.zb)();if(!t)throw new Error("Invalid tutor profile selection.");await(0,n.updateCurrentUserProfile)({profile:t}),f&&await f("TutorProfileOnboardingPage (select)")})(e||null)}catch(t){console.error("Failed to save tutor profile:",t),k("Could not save your tutor profile. Please try again.")}finally{P(null)}},tutors:h,loading:m,showSectionHeader:!1}),N?(0,c.jsx)("p",{className:"text-xs student-dash-text-muted mt-3 text-center",children:"Saving your selection..."}):null]}),C?(0,c.jsx)("p",{className:"text-sm text-[var(--destructive)] text-center mb-4",role:"alert",children:C}):null,(0,c.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row gap-3 sm:justify-center",children:[(0,c.jsx)("button",{type:"button",onClick:async()=>{j(!0),k("");try{await(0,n.updateCurrentUserProfile)({profile:(0,u.WX)()}),f&&await f("TutorProfileOnboardingPage (skip)"),_()}catch(e){console.error("Failed to skip tutor profile onboarding:",e),k("Could not skip this step. Please try again.")}finally{j(!1)}},disabled:v,className:"flex-1 sm:flex-none sm:min-w-[160px] bg-[var(--muted)] hover:bg-[var(--switch-background)] student-dash-text font-semibold py-3 px-6 rounded-lg transition-colors disabled:opacity-60",children:"Skip for Now"}),(0,c.jsx)("button",{type:"button",onClick:async()=>{if(!N){j(!0),k("");try{y?await(async()=>{await(0,n.updateCurrentUserProfile)({profile:(0,u.ex)()}),f&&await f("TutorProfileOnboardingPage (complete)")})():(await(0,n.updateCurrentUserProfile)({profile:(0,u.WX)()}),f&&await f("TutorProfileOnboardingPage (continue default)")),_()}catch(e){console.error("Failed to complete tutor profile onboarding:",e),k("Could not continue. Please try again.")}finally{j(!1)}}},disabled:T,className:"flex-1 sm:flex-none sm:min-w-[160px] bg-[#003D5C] hover:bg-[#002D44] text-white font-semibold py-3 px-6 rounded-lg transition-colors disabled:opacity-60",children:v?"Continuing...":"Continue"})]})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.