PageSourceSearch

https://app.tutorcloud.ai/static/js/5692.0bd33412.chunk.js

js tutorcloud.ai collected 2026-10-05 15:57:54 UTC 29,387 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[5692],{65692(e,l,t){t.r(l),t.d(l,{default:()=>D});var n=t(9950),s=t(41413),a=t(22875),r=t(46389),i=t(32079),o=t(48304),d=t(15597),c=t(25366),u=t(44414);function p(e){let{planTier:l,billingCycle:t="monthly",label:n="Upgrade",variant:a="primary",className:r="",disabled:i=!1,source:d="settings_upgrade",planId:c=null,durationMonths:p=null}=e;const x=(0,s.Zp)(),m=String(l||"").toLowerCase(),y=null!=p?Number(p):null,g=12===y||"yearly"===t?"yearly":6===y||"semiannual"===t?"semiannual":1===y||"monthly"===t?"monthly":String(t||"monthly").toLowerCase(),h=String(c||"").trim()||(0,o.Px)(m,g);if("explore"===m||!h)return null;const b="navy"===a?"text-white hover:opacity-95":"outline"===a?"border bg-white text-gray-800 hover:bg-gray-50":"text-white hover:opacity-95",f="navy"===a?{backgroundColor:"#0B2340"}:"outline"===a?{borderColor:"#E5E7EB"}:{backgroundColor:"#F19500"};return(0,u.jsx)("button",{type:"button",onClick:()=>{const e=new URLSearchParams({source:d,plan:"semiannual"===g?"yearly":g,planId:h});p&&e.set("durationMonths",String(p)),x(`/student/payment?${e.toString()}`)},disabled:i,className:`inline-flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-sm font-semibold shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 ${b} ${r}`.trim(),style:f,children:n})}function x(e){let{planTier:l,billingCycle:t="monthly",label:n="Ask to pay",className:a="",disabled:r=!1,planId:i=null,durationMonths:d=null}=e;const c=(0,s.Zp)(),p=String(l||"").toLowerCase(),x=null!=d?Number(d):null,m=12===x||"yearly"===t?"yearly":6===x||"semiannual"===t?"semiannual":1===x||"monthly"===t?"monthly":String(t||"monthly").toLowerCase(),y=String(i||"").trim()||(0,o.Px)(p,m);if("explore"===p||!y)return null;return(0,u.jsx)("button",{type:"button",onClick:()=>{const e=new URLSearchParams({plan:"semiannual"===m?"yearly":m,planId:y});d&&e.set("durationMonths",String(d)),c(`/student/parent-invite?${e.toString()}`)},disabled:r,className:`inline-flex w-full items-center justify-center gap-2 rounded-xl border px-4 py-3 text-sm font-semibold text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 ${a}`.trim(),style:{borderColor:"#E5E7EB",backgroundColor:"#fff"},children:n})}const m="#0B2340",y={focus:"explore",plus:"focus",complete:"plus"};function g(e){const l=Number(e);return 12===l?"yearly":6===l?"semiannual":1===l?"monthly":"custom"}function h(e){let{value:l,onChange:t}=e;return(0,u.jsx)("div",{className:"flex justify-center",children:(0,u.jsx)("div",{className:"inline-flex rounded-full border bg-white p-1 shadow-sm",style:{borderColor:c.vU},role:"radiogroup","aria-label":"Billing cycle",children:["monthly","yearly"].map(e=>{const n=l===e;return(0,u.jsx)("button",{type:"button",role:"radio","aria-checked":n,onClick:()=>t(e),className:"rounded-full px-5 py-2 text-sm font-semibold transition-colors "+(n?"text-white shadow-sm":"text-gray-600 hover:text-gray-900"),style:n?{backgroundColor:c.bg}:void 0,children:"monthly"===e?"Monthly":"Yearly"},e)})})})}function b(e){let{options:l,value:t,onChange:n}=e;return Array.isArray(l)&&0!==l.length?(0,u.jsx)("div",{className:"flex justify-center",children:(0,u.jsx)("div",{className:"inline-flex flex-wrap justify-center rounded-full border bg-white p-1 shadow-sm",style:{borderColor:c.vU},role:"radiogroup","aria-label":"Billing cycle",children:l.map(e=>{const l=Number(t)===Number(e);return(0,u.jsx)("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>n(e),className:"rounded-full px-5 py-2 text-sm font-semibold transition-colors "+(l?"text-white shadow-sm":"text-gray-600 hover:text-gray-900"),style:l?{backgroundColor:c.bg}:void 0,children:(0,r.uT)(e)},e)})})}):null}function f(e){let{planDef:l}=e;return l?(0,u.jsxs)("section",{className:"rounded-2xl border-2 bg-white px-5 py-6 sm:px-7",style:{borderColor:c.bg},children:[(0,u.jsxs)("h2",{className:"text-xl font-bold text-gray-900 sm:text-2xl",children:["Your current plan: ",(0,u.jsx)("span",{style:{color:c.bg},children:l.name})]}),l.subheader?(0,u.jsx)("p",{className:"mt-2 text-xs font-bold uppercase tracking-wider text-gray-500",children:l.subheader}):null,l.headline||l.description?(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:l.headline||l.description}):null]}):null}function v(e){var l;let{planSet:t,durationMonths:n,canSelfPay:s}=e;if(!t)return null;const a=(0,r.Qs)(t),i=Array.isArray(t.terms)?t.terms:[],o=(0,r.q3)(t,n)||i[i.length-1]||null,d=i.filter(e=>Number(e.durationMonths)!==Number(null===o||void 0===o?void 0:o.durationMonths)),m=`Ready for unlimited learning? Upgrade to ${a.name}`,y=a.description||(a.features.length?a.features.join(". ")+".":`Upgrade to ${a.name} for full TutorCloud access.`),h=`Upgrade to ${a.name}`,b=null==(null===o||void 0===o?void 0:o.amount)&&null==(null===o||void 0===o||null===(l=o.pricing)||void 0===l?void 0:l.amountMajor),f=g(null===o||void 0===o?void 0:o.durationMonths);return(0,u.jsxs)("section",{className:"rounded-2xl border bg-white px-5 py-6 sm:px-7",style:{borderColor:c.vU},children:[(0,u.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,u.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-gray-500",children:m}),a.badge?(0,u.jsx)("span",{className:"shrink-0 rounded-full border px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide",style:{borderColor:c.bg,color:c.bg},children:a.badge}):null]}),o?(0,u.jsxs)("p",{className:"mt-2 text-lg font-bold text-gray-900",children:[(0,r.p1)(o),(0,u.jsxs)("span",{className:"ml-1 text-sm font-semibold text-gray-500",children:["/ ",(0,r.uT)(o.durationMonths).toLowerCase()]})]}):null,d.map(e=>(0,u.jsxs)("p",{className:"text-sm font-semibold text-gray-500",children:["or ",(0,r.p1)(e)," / ",(0,r.uT)(e.durationMonths).toLowerCase()]},(0,r.uT)(e.durationMonths))),(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:y}),(0,u.jsx)("div",{className:"mt-5 flex flex-col gap-3 "+(s?"sm:flex-row":""),children:b||!o?(0,u.jsx)("p",{className:"text-sm text-gray-500",children:"Price unavailable for this plan length."}):(0,u.jsxs)(u.Fragment,{children:[s?(0,u.jsx)(p,{planTier:String(t.name||"plan").toLowerCase(),billingCycle:f,planId:o.id||t.id,durationMonths:o.durationMonths,label:h,variant:"primary",className:s?"sm:flex-1":""}):null,(0,u.jsx)(x,{planTier:String(t.name||"plan").toLowerCase(),billingCycle:f,planId:o.id||t.id,durationMonths:o.durationMonths,label:"Ask to pay",className:s?"sm:flex-1":""})]})})]})}function j(e){var l;let{planSet:t,durationMonths:n,isCurrent:s,canSelfPay:i,featured:o=!1}=e;const d=(0,r.Qs)(t),y=(0,r.q3)(t,n);if(!y)return null;const h=null==y.amount&&null==(null===(l=y.pricing)||void 0===l?void 0:l.amountMajor),b=(0,r.p1)(y),f=o?c.bg:m,v=o?"border-2 shadow-[0_0_0_1px_rgba(241,149,0,0.25)]":"border",j=g(y.durationMonths);return(0,u.jsxs)("article",{className:`flex h-full flex-col rounded-2xl bg-white ${v} overflow-hidden`,style:{borderColor:o?c.bg:c.vU},children:[(0,u.jsxs)("div",{className:"flex flex-1 flex-col px-5 py-5 sm:px-6",children:[d.badge?(0,u.jsx)("span",{className:"mb-3 inline-block self-start rounded-full px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide text-white",style:{backgroundColor:o?c.bg:m},children:d.badge}):null,s?(0,u.jsx)("span",{className:"mb-3 inline-block self-start rounded-full px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide",style:{backgroundColor:c.yu,color:"#7C4A03"},children:"Current Plan"}):null,(0,u.jsx)("h3",{className:"text-lg font-bold uppercase tracking-wide text-gray-900",children:d.name}),d.subheader?(0,u.jsx)("p",{className:"mt-1 text-xs font-bold uppercase tracking-wider text-gray-500",children:d.subheader}):null,d.description?(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:d.description}):null,(0,u.jsxs)("div",{className:"mt-5 rounded-xl px-4 py-3 text-center text-white",style:{backgroundColor:f},children:[(0,u.jsx)("p",{className:"text-xl font-bold tabular-nums",children:b}),(0,u.jsx)("p",{className:"mt-1 text-xs font-semibold uppercase tracking-wide text-white/90",children:(0,r.uT)(y.durationMonths)})]}),d.features.length?(0,u.jsx)("ul",{className:"mt-5 space-y-2.5",children:d.features.map(e=>(0,u.jsxs)("li",{className:"flex items-start gap-2 text-sm text-gray-700",children:[(0,u.jsx)(a.CMH,{className:"mt-0.5 shrink-0",style:{color:c.bg},"aria-hidden":!0}),(0,u.jsx)("span",{children:e})]},e))}):null]}),(0,u.jsx)("div",{className:"border-t px-5 py-4 sm:px-6",style:{borderColor:c.vU},children:s?(0,u.jsx)("div",{className:"w-full rounded-xl border py-2.5 text-center text-sm font-semibold text-gray-400",style:{borderColor:c.vU},children:"Current Plan"}):h?(0,u.jsx)("p",{className:"text-center text-sm text-gray-500",children:"Price unavailable"}):(0,u.jsxs)("div",{className:"flex flex-col gap-2 ",children:[i?(0,u.jsx)(p,{planTier:String(t.name||"plan").toLowerCase(),billingCycle:j,planId:y.id||t.id,durationMonths:y.durationMonths,label:`Choose ${d.name}`,variant:o?"primary":"navy",className:"w-full"}):null,(0,u.jsx)(x,{planTier:String(t.name||"plan").toLowerCase(),billingCycle:j,planId:y.id||t.id,durationMonths:y.durationMonths,label:"Ask to pay",className:"w-full"})]})})]})}function N(e){var l,t;let{billingCycle:n,plans:s,currency:a,canSelfPay:r}=e;const i=s[o.xO];if(!i)return null;const d=(0,o.EK)(o.xO,"monthly",a,s),m=(0,o.EK)(o.xO,"yearly",a,s),y=(null===(l=i.upgradeCopy)||void 0===l?void 0:l.primaryTitle)||"Ready for unlimited learning? Upgrade to Complete",g=i.cardDescription||"Unlock every available subject for your child and extend the same access to a second child at no extra cost.",h=(null===(t=i.upgradeCopy)||void 0===t?void 0:t.primaryCta)||i.ctaLabel||"Upgrade to Complete",b=(0,o.Px)(o.xO,n,s);return(0,u.jsxs)("section",{className:"rounded-2xl border bg-white px-5 py-6 sm:px-7",style:{borderColor:c.vU},children:[(0,u.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,u.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-gray-500",children:y}),i.badge?(0,u.jsx)("span",{className:"shrink-0 rounded-full border px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide",style:{borderColor:c.bg,color:c.bg},children:i.badge}):null]}),(0,u.jsx)("p",{className:"mt-2 text-lg font-bold text-gray-900",children:d}),(0,u.jsxs)("p",{className:"text-sm font-semibold text-gray-500",children:["or ",m]}),(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:g}),(0,u.jsxs)("div",{className:"mt-5 flex flex-col gap-3 "+(r?"sm:flex-row":""),children:[r?(0,u.jsx)(p,{planTier:o.xO,billingCycle:n,planId:b,durationMonths:"yearly"===n?12:1,label:h,variant:"primary",className:r?"sm:flex-1":""}):null,(0,u.jsx)(x,{planTier:o.xO,billingCycle:n,planId:b,durationMonths:"yearly"===n?12:1,label:"Ask to pay",className:r?"sm:flex-1":""})]})]})}function w(e){let{fromTier:l,selectedTier:t,billingCycle:n,plans:s,currency:a,canSelfPay:r}=e;if(!t)return null;const i=function(e,l,t,n){const s=t[l];if(!s)return null;const a=t[y[l]||e]||t[e],r=(0,o.XS)(t,"focus","plus",n),i=(0,o.XS)(t,"plus","complete",n),d=null===a||void 0===a?void 0:a.upgradeCopy;return{title:(null===d||void 0===d?void 0:d.primaryTitle)||("focus"===l?"Ready for unlimited learning? Upgrade to Focus":"plus"===l?"Ready to add another subject? Upgrade to Plus":"Learning needs change. Your plan can too. Upgrade to Complete"),body:(null===d||void 0===d?void 0:d.primaryBody)||("focus"===l?"Keep learning in your selected subject without monthly session or activity limits. Unlock unlimited AI tutoring, practice and quizzes.":"plus"===l?`Unlock more learning${r?` for just ${r} more/month`:""}. Give your child a second subject and add another child to the same plan at no extra cost. You unlock 2 subjects for each child, access for up to 2 children, and unlimited AI tutoring, practice and quizzes.`:`As your children's learning needs change, Complete gives them every available subject, so you never have to choose which ones to leave out.${i?` For just ${i} more/month,`:""} unlock all available subjects for up to 2 children with unlimited AI tutoring, practice and quizzes.`),ctaLabel:(null===d||void 0===d?void 0:d.primaryCta)||("focus"===l?"Upgrade to Focus":"plus"===l?"Upgrade to Plus":"Upgrade to Complete"),priceMonthly:(0,o.EK)(l,"monthly",n,t),priceYearly:(0,o.EK)(l,"yearly",n,t),targetName:s.name}}(l,t,s,a);if(!i)return null;const{title:d,body:m,ctaLabel:g,priceMonthly:h,priceYearly:b}=i;return(0,u.jsxs)("section",{className:"rounded-2xl border bg-white px-5 py-6 sm:px-7",style:{borderColor:c.vU},children:[(0,u.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-gray-500",children:d}),(0,u.jsxs)("p",{className:"mt-2 text-lg font-bold text-gray-900",children:[h," or ",b]}),(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:m}),(0,u.jsxs)("div",{className:"mt-5 flex flex-col gap-3 "+(r?"sm:flex-row":""),children:[r?(0,u.jsx)(p,{planTier:t,billingCycle:n,planId:(0,o.Px)(t,
1n,s),durationMonths:"yearly"===n?12:1,label:g,variant:"primary",className:r?"sm:flex-1":""}):null,(0,u.jsx)(x,{planTier:t,billingCycle:n,planId:(0,o.Px)(t,n,s),durationMonths:"yearly"===n?12:1,label:"Ask to pay",className:r?"sm:flex-1":""})]})]})}function C(e){let{tier:l,planDef:t,plans:n,billingCycle:s,currency:r,isCurrent:i,isSelectable:d,isSelected:p,onSelect:x}=e;const y=(0,o.EK)(l,s,r,n),g=p&&d,h=g?c.bg:m,b=g?c.bg:c.vU,f=g?"border-2":"border";return(0,u.jsxs)("article",{role:d?"button":void 0,tabIndex:d?0:void 0,"aria-pressed":d?p:void 0,onClick:d?()=>x(l):void 0,onKeyDown:d?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),x(l))}:void 0,className:`flex h-full flex-col rounded-2xl bg-white ${f} overflow-hidden transition-all duration-200 ${d?"cursor-pointer":""} ${g?"shadow-[0_0_0_1px_rgba(241,149,0,0.25)]":""}`,style:{borderColor:b},children:[(0,u.jsxs)("div",{className:"flex flex-1 flex-col px-5 py-5 sm:px-6",children:[t.badge&&g?(0,u.jsx)("span",{className:"mb-3 inline-block self-start rounded-full px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide text-white",style:{backgroundColor:c.bg},children:t.badge}):t.badge&&!i?(0,u.jsx)("span",{className:"mb-3 inline-block self-start rounded-full px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide text-white opacity-80",style:{backgroundColor:m},children:t.badge}):null,i?(0,u.jsx)("span",{className:"mb-3 inline-block self-start rounded-full px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide",style:{backgroundColor:c.yu,color:"#7C4A03"},children:"Current Plan"}):null,(0,u.jsx)("h3",{className:"text-lg font-bold uppercase tracking-wide text-gray-900",children:t.name}),(0,u.jsx)("p",{className:"mt-1 text-xs font-bold uppercase tracking-wider text-gray-500",children:t.positioning}),(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:t.cardDescription}),(0,u.jsxs)("div",{className:"mt-5 rounded-xl px-4 py-3 text-center text-white transition-colors duration-200",style:{backgroundColor:h},children:[(0,u.jsx)("p",{className:"text-xl font-bold tabular-nums",children:y}),(0,u.jsx)("p",{className:"mt-1 text-xs font-semibold uppercase tracking-wide text-white/90",children:t.subheader})]}),(0,u.jsx)("ul",{className:"mt-5 space-y-2.5",children:t.features.map(e=>(0,u.jsxs)("li",{className:"flex items-start gap-2 text-sm text-gray-700",children:[(0,u.jsx)(a.CMH,{className:"mt-0.5 shrink-0",style:{color:c.bg},"aria-hidden":!0}),(0,u.jsx)("span",{children:e})]},e))}),t.footerNote?(0,u.jsx)("p",{className:"mt-4 text-[0.65rem] font-bold uppercase leading-relaxed tracking-wide text-gray-400",children:t.footerNote}):null]}),(0,u.jsx)("div",{className:"border-t px-5 py-4 sm:px-6",style:{borderColor:c.vU},children:i?(0,u.jsx)("div",{className:"w-full rounded-xl border py-2.5 text-center text-sm font-semibold text-gray-400",style:{borderColor:c.vU},children:"Current Plan"}):d?(0,u.jsx)("div",{className:"w-full rounded-xl py-2.5 text-center text-sm font-semibold transition-colors duration-200 "+(g?"text-white":"border text-gray-700"),style:g?{backgroundColor:c.bg}:{borderColor:c.vU,backgroundColor:"#fff"},children:g?(0,o.T2)(l,t):`Select ${t.name}`}):(0,u.jsx)("div",{className:"w-full cursor-not-allowed rounded-xl border py-2.5 text-center text-sm font-semibold text-gray-300",style:{borderColor:c.vU},children:"Included in your plan"})})]})}function S(e){var l;let{subscriptionSummary:t,studentRow:s=null,canSelfPay:a=!1}=e;
1const[c,p]=(0,n.useState)("monthly"),[x,m]=(0,n.useState)([]),[y,g]=(0,n.useState)(!1),[S,k]=(0,n.useState)(!1),[M,U]=(0,n.useState)(()=>String((null===t||void 0===t?void 0:t.currency)||"").toUpperCase()||""),[P,T]=(0,n.useState)(null);(0,n.useEffect)(()=>{const e=String((null===t||void 0===t?void 0:t.billingCycle)||"").toLowerCase();"monthly"!==e&&"yearly"!==e||p(e)},[null===t||void 0===t?void 0:t.billingCycle]),(0,n.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await(0,r.gG)("student_billing");if(e)return;if((0,r.E8)(t)){var l;const e=Array.isArray(t.plans)?t.plans:[];m(e),g(!0);const n=String((null===(l=e[0])||void 0===l?void 0:l.currency)||"").trim();return n&&U(n.toUpperCase()),void k(!0)}}catch{}try{var t;const l=await(0,r.Cy)();if(e)return;const n=Array.isArray(null===l||void 0===l?void 0:l.plans)?l.plans:[];m(n),g(!1);const s=String((null===(t=n[0])||void 0===t?void 0:t.currency)||"").trim();s&&U(s.toUpperCase())}catch{e||(m([]),g(!1))}finally{e||k(!0)}})(),(0,i.pS)().then(l=>{!e&&null!==l&&void 0!==l&&l.currency&&U(String(l.currency).toUpperCase())}),()=>{e=!0}},[]),(0,n.useEffect)(()=>{const e=String((null===t||void 0===t?void 0:t.currency)||"").trim();e&&U(e.toUpperCase())},[null===t||void 0===t?void 0:t.currency]);const A=(0,n.useMemo)(()=>(0,o.p_)(x),[x]),L=(0,n.useMemo)(()=>(0,o.er)(A),[A]),I=(0,n.useMemo)(()=>s?[s]:[],[s]),E=(0,n.useMemo)(()=>(0,d.qm)(t,I),[t,I]),$=A[E]||o.F1.explore,D=M||"USD",Y=(0,n.useMemo)(()=>y?(0,r.fz)(x):[],[y,x]),B=(0,n.useMemo)(()=>y?(0,r.UM)(x):[],[y,x]),[_,O]=(0,n.useState)(null);(0,n.useEffect)(()=>{y&&O(e=>(0,r.xZ)(B,null!==e&&void 0!==e?e:"yearly"===c?12:"monthly"===c?1:null))},[y,B,c]);const R=(0,n.useMemo)(()=>function(e){const l=Array.isArray(e)?e:[];if(!l.length)return null;return l.find(e=>(null===e||void 0===e?void 0:e.limits)&&null==e.limits.subjectLimit)||l[l.length-1]}(Y),[Y]),q=Y,z=String((null===t||void 0===t?void 0:t.planId)||(null===t||void 0===t||null===(l=t.planSnapshot)||void 0===l?void 0:l.planId)||"").trim(),F=(0,n.useMemo)(()=>z&&Y.find(e=>String(e.id)===z)||null,[Y,z]),K=F?(0,r.Qs)(F):{name:(null===t||void 0===t?void 0:t.planLabel)||(null===t||void 0===t?void 0:t.planName)||$.name||"Current plan",subheader:$.subheader,headline:$.headline,description:$.cardDescription},Q=R&&z&&String(R.id)===z;(0,n.useEffect)(()=>{if(y)return;const e=function(e){const l=o.WB[e];return l&&(0,d.bw)(e,l)?l:o.Qq.find(l=>(0,d.bw)(e,l))||null}(E);T(e)},[E,y]);const G=P&&(0,d.bw)(E,P)?P:null;return S?y?(0,u.jsxs)("div",{className:"space-y-5",children:[(0,u.jsx)(f,{planDef:K}),R&&!Q?(0,u.jsx)(v,{planSet:R,durationMonths:_,canSelfPay:a}):null,(0,u.jsx)("div",{className:"py-2",children:(0,u.jsx)(b,{options:B,value:_,onChange:O})}),(0,u.jsx)("div",{className:q.length<=1?"mx-auto grid w-full max-w-md grid-cols-1 gap-5":2===q.length?"mx-auto grid w-full max-w-3xl grid-cols-1 gap-5 sm:grid-cols-2":"grid grid-cols-1 gap-5 md:grid-cols-2 lg:grid-cols-3",children:q.map(e=>(0,u.jsx)(j,{planSet:e,durationMonths:_,isCurrent:Boolean(z&&String(e.id)===z),canSelfPay:a,featured:!!R&&String(e.id)===String(R.id)},e.id))}),a?null:(0,u.jsx)("p",{className:"text-center text-sm text-gray-500",children:"Students under 18 can ask a parent to subscribe. Your parent will receive a secure payment link."})]}):(0,u.jsxs)("div",{className:"space-y-5",children:[(0,u.jsx)(f,{planDef:$}),"complete"!==E?(0,u.jsx)(N,{billingCycle:c,plans:A,currency:D,canSelfPay:a}):null,(0,u.jsx)("div",{className:"py-2",children:(0,u.jsx)(h,{value:c,onChange:p})}),(0,u.jsx)("div",{className:"grid grid-cols-1 gap-5 lg:grid-cols-3",children:L.map(e=>{const l=A[e],t=e===E,n=(0,d.bw)(E,e),s=e===P;return(0,u.jsx)(C,{tier:e,planDef:l,plans:A,billingCycle:c,currency:D,isCurrent:t,isSelectable:n,isSelected:s,onSelect:T},e)})}),"complete"!==E&&G?(0,u.jsx)(w,{fromTier:E,selectedTier:G,billingCycle:c,plans:A,currency:D,canSelfPay:a}):null,a?null:(0,u.jsx)("p",{className:"text-center text-sm text-gray-500",children:"Students under 18 can ask a parent to subscribe. Your parent will receive a secure payment link."})]}):(0,u.jsx)("p",{className:"student-dash-text-muted text-sm py-6",children:"Loading subscription plans\u2026"})}var k=t(2889),M=t(92147);function U(e){let{planDef:l}=e;return(0,u.jsxs)("section",{className:"rounded-2xl border-2 bg-white px-5 py-6 sm:px-7",style:{borderColor:c.bg},children:[(0,u.jsxs)("h2",{className:"text-xl font-bold text-gray-900 sm:text-2xl",children:["Your current plan: ",(0,u.jsx)("span",{style:{color:c.bg},children:l.name})]}),l.subheader?(0,u.jsx)("p",{className:"mt-2 text-xs font-bold uppercase tracking-wider text-gray-500",children:l.subheader}):null,l.headline?(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:l.headline}):null]})}function P(e){let{subscriptionSummary:l,studentRow:t=null,canSelfPay:s=!1}
1=e;const[a,i]=(0,n.useState)([]),[o,d]=(0,n.useState)("");(0,n.useEffect)(()=>{let e=!1;return(0,r.gG)("student_billing").then(l=>{e||(i(Array.isArray(null===l||void 0===l?void 0:l.plans)?l.plans:[]),d(""))}).catch(()=>{e||(i([]),d("Plans could not be loaded."))}),()=>{e=!0}},[]);const c={name:(null===l||void 0===l?void 0:l.planLabel)||(null===l||void 0===l?void 0:l.planName)||"your plan"};return(0,u.jsxs)("div",{className:"space-y-5",children:[(0,u.jsx)(U,{planDef:c}),o?(0,u.jsx)("p",{className:"text-sm text-red-600",children:o}):null,(0,u.jsx)(M.A,{cards:a,mode:"billing",preferredDurationMonths:"monthly"===String((null===l||void 0===l?void 0:l.billingCycle)||"").toLowerCase()?1:"yearly"===String((null===l||void 0===l?void 0:l.billingCycle)||"").toLowerCase()?12:null,emptyMessage:"No catalog plans are available right now.",renderCta:function(e,l){let{amountMissing:t}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t?(0,u.jsx)("p",{className:"text-center text-sm text-gray-500",children:"Price unavailable for this plan length."}):(0,u.jsxs)("div",{className:"flex flex-col gap-3 "+(s?"sm:flex-row":""),children:[s?(0,u.jsx)(p,{planTier:"complete",billingCycle:e.cycle||"yearly",planId:e.id,durationMonths:e.durationMonths,label:`Choose ${l.name}`,variant:"primary",className:"sm:flex-1"}):null,(0,u.jsx)(x,{planTier:"complete",billingCycle:e.cycle||"yearly",planId:e.id,durationMonths:e.durationMonths,label:"Ask to pay",className:s?"sm:flex-1":""})]})}}),s?null:(0,u.jsx)("p",{className:"text-center text-sm text-gray-500",children:"Students under 18 can ask a parent to subscribe. Your parent will receive a secure payment link."})]})}function T(e){let{subscriptionSummary:l,studentRow:t=null,canSelfPay:s=!1}=e;
1const[a,o]=(0,n.useState)([]),[d,m]=(0,n.useState)("USD"),[y,g]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=!1;return Promise.all([(0,r.Cy)(),(0,r.mN)([k.U1.exploreYearly,k.U1.completeYearly])]).then(l=>{let[t,n]=l;e||o((0,r.cO)(Array.isArray(null===t||void 0===t?void 0:t.plans)?t.plans:[],n))}),(0,i.pS)().then(l=>{e||(g(l),null!==l&&void 0!==l&&l.currency&&m(String(l.currency).toUpperCase()))}),()=>{e=!0}},[]);const h=(0,n.useMemo)(()=>(0,k.Z$)(l,t?[t]:[],t),[l,t]),b=(0,n.useMemo)(()=>(0,k.L0)((0,k.bf)(a),k.ML),[a]),f=(0,n.useMemo)(()=>(0,k.L0)((0,k.BT)(a),k.O0),[a]),v=(0,n.useMemo)(()=>(0,k.Ff)(a,d,y),[a,d,y]),j="complete"===h?f:b;return(0,u.jsxs)("div",{className:"space-y-5",children:[(0,u.jsx)(U,{planDef:j}),"complete"!==h?(0,u.jsxs)("section",{className:"rounded-2xl border bg-white px-5 py-6 sm:px-7",style:{borderColor:c.vU},children:[(0,u.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,u.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-gray-500",children:f.upgradeTitle}),f.badge?(0,u.jsx)("span",{className:"shrink-0 rounded-full border px-2.5 py-1 text-[0.65rem] font-bold uppercase tracking-wide",style:{borderColor:c.bg,color:c.bg},children:f.badge}):null]}),v?(0,u.jsx)("p",{className:"mt-3 text-lg font-bold text-gray-900",children:v}):null,(0,u.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-gray-600",children:f.cardDescription}),(0,u.jsxs)("div",{className:"mt-5 flex flex-col gap-3 "+(s?"sm:flex-row":""),children:[s?(0,u.jsx)(p,{planTier:"complete",billingCycle:"yearly",planId:k.U1.completeYearly,label:f.upgradeCta,variant:"primary",className:"sm:flex-1"}):null,(0,u.jsx)(x,{planTier:"complete",billingCycle:"yearly",planId:k.U1.completeYearly,label:"Ask to pay",className:s?"sm:flex-1":""})]})]}):null,s?null:(0,u.jsx)("p",{className:"text-center text-sm text-gray-500",children:"Students under 18 can ask a parent to subscribe. Your parent will receive a secure payment link."})]})}function A(e){const[l,t]=(0,n.useState)("pending");return(0,n.useEffect)(()=>{let e=!1;return(0,r.gG)("student_billing").then(l=>{e||t((0,r.E8)(l)?"catalog":"legacy")}).catch(()=>{e||t("legacy")}),()=>{e=!0}},[]),"catalog"===l?(0,u.jsx)(P,{...e}):"legacy"===l?(0,u.jsx)(T,{...e}):(0,u.jsx)("p",{className:"text-sm text-gray-500",children:"Loading plans\u2026"})}var L=t(18555),I=t(51299),E=t(32799),$=t(3576);function D(){var e,l,t;const i=(0,s.Zp)(),[o]=(0,s.ok)(),c=(o.get("source")||"").trim(),p="paywall"===c?"/student/trial-ended":"/student/profile",x="paywall"===c?"Back to trial options":"Back to Settings",[m,y]=(0,n.useState)(!0),[g,h]=(0,n.useState)(null),[b,f]=(0,n.useState)(null),[v,j]=(0,n.useState)(!1),[N,w]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=!1;return(async()=>{try{const l=await(0,L.getCurrentUserProfile)("SubscriptionOptionsPage");if(e)return;if(h(l),j((0,E.pT)(l)),(0,E.pT)(l))return void y(!1);const t=await(0,L.getStudentSubscriptionSummary)("SubscriptionOptionsPage");e||f((null===t||void 0===t?void 0:t.subscriptionSummary)||null)}catch(l){console.error("[SubscriptionOptionsPage] load failed",l)}finally{e||y(!1)}})(),()=>{e=!0}},[]),(0,n.useEffect)(()=>{let e=!1;return(0,r.gG)("student_billing").then(l=>{e||w((0,r.E8)(l))}).catch(()=>{e||w(!1)}),()=>{e=!0}},[]);const C=null!==(e=null!==(l=null===g||void 0===g||null===(t=g.profile)||void 0===t?void 0:t.dateOfBirth)&&void 0!==l?l:null===g||void 0===g?void 0:g.dateOfBirth)&&void 0!==e?e:null,k=(0,n.useMemo)(()=>!!C&&!(0,I.MM)(C),[C]),M=(0,n.useMemo)(()=>!v&&(0,d.P6)(g),[v,g]),U=(0,n.useMemo)(()=>{const e=(0,$.vU)();return"in"===e||"ae"===e||"dev"===e||!M},[M]),P=(0,n.useMemo)(()=>{if(!g)return null;const e=g.userId||g.userid;return e?{userId:e,needsSubscriptionUpgrade:g.needsSubscriptionUpgrade,hasActiveSubscription:g.hasActiveSubscription,planId:null===b||void 0===b?void 0:b.planId,subscriptionStatus:null===b||void 0===b?void 0:b.status}:null},[g,b]);return m?(0,u.jsx)("div",{className:"student-page-shell student-subscription-page min-w-0 overflow-x-hidden p-6",children:(0,u.jsx)("p",{className:"student-dash-text-muted text-sm",children:"Loading subscription plans\u2026"})}):v?(0,u.jsx)("div",{className:"student-page-shell student-subscription-page min-w-0 overflow-x-hidden",children:(0,u.jsxs)("div",{className:"max-w-2xl mx-auto w-full min-w-0 p-3 sm:p-4 md:p-6 space-y-6",children:[(0,u.jsxs)("button",{type:"button",onClick:()=>i(p),className:"student-dash-btn student-dash-btn-outline-brand inline-flex items-center gap-2 px-3 py-2 rounded-lg text-sm",children:[(0,u.jsx)(a.QVr,{className:"text-xs","aria-hidden":!0}),x]}),(0,u.jsxs)("div",{className:"student-ui-surface-card p-6",children:[(0,u.jsx)("h1",{className:"student-dash-title text-xl font-semibold student-dash-text mb-2",children:"School subscription"}),(0,u.jsx)("p",{className:"student-dash-text-muted text-sm",children:"Your account is linked to a school. Subscription and billing are managed through your school."})]})]})}):(0,u.jsx)("div",{className:"student-page-shell student-subscription-page min-w-0 overflow-x-hidden",children:(0,u.jsxs)("div",{className:"max-w-6xl mx-auto w-full min-w-0 p-3 sm:p-4 md:p-6 space-y-6",children:[(0,u.jsxs)("header",{className:"space-y-4",children:[(0,u.jsxs)("button",{type:"button",onClick:()=>i(p),className:"student-dash-btn student-dash-btn-outline-brand inline-flex items-center gap-2 px-3 py-2 rounded-lg text-sm",children:[(0,u.jsx)(a.QVr,{className:"text-xs","aria-hidden":!0}),x]}),(0,u.jsxs)("div",{children:[(0,u.jsx)("h1",{className:"student-dash-title text-2xl sm:text-3xl font-semibold student-dash-text",children:"Subscription plans"}),(0,u.jsx)("p",{className:"student-dash-text-muted text-sm sm:text-base mt-1",children:k?"Upgrade your plan or ask a parent to pay.":"Choose a plan and ask your parent to subscribe."})]})]}),null===N?(0,u.jsx)("p",{className:"student-dash-text-muted text-sm",children:"Loading plans\u2026"}):U?(0,u.jsx)(S,{subscriptionSummary:b,studentRow:P,canSelfPay:k}):(0,u.jsx)(A,{subscriptionSummary:b,studentRow:P,canSelfPay:k})]})})}}}]);

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.