PageSourceSearch

https://www.chinesetrack.com/current/assets/AccountPage-D1Wqk5ZX.js

js chinesetrack.com collected 2026-10-02 15:17:40 UTC 21,802 bytes, 2 lines download raw bytes

1import{cK as q,j as t,cL as J,cM as X,cN as z,cO as Q,r as u,d as Z,L as P,_ as ee}from"./index-BkeBWTNd.js";import{D as te}from"./demoProducts-Cboo9yP5.js";import{J as se,m as ne}from"./oneOnOneLessons-5xwnvtqE.js";const re={upgrade:{title:"Upgrade to Full Chinese Track",body:"Get full access to all 420 lessons, transcripts, activities, vocabulary tools, and progress tracking.",button:"Choose a Subscription Plan"},renew:{title:"Renew your Chinese Track subscription",body:"Restore full access to your lessons, activities, and progress tracking.",button:"Renew Now"}},ae=({variant:e})=>{const{title:s,body:n,button:r}=re[e],o=q();return t.jsxs("div",{className:"rounded-xl border-2 border-orange-200 bg-orange-50 px-4 py-4 mb-4",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-900 mt-0 mb-2",children:s}),t.jsx("p",{className:"text-sm text-gray-700 mb-4",children:n}),t.jsx("a",{href:o,className:"inline-flex items-center rounded-md bg-orange-500 px-4 py-2 text-sm font-semibold text-white hover:bg-orange-600",children:r})]})},T={4:"1 year recurring (Renewal Special)",7:"1 month Premium Online",8:"3 months Premium Online",10:"1 year Premium Online",84:"Teacher Access"},oe={1:1,2:61,3:121,4:181,5:241,6:301,7:361},ce=10;function ie(e){const s=te.find(o=>o.productId===e);if(!s)return null;const n=oe[s.level];if(!n)return null;const r=n+ce-1;return`Demo of Level ${s.level} (Lessons ${n} to ${r})`}function le(e){const s=Number(e);return!Number.isFinite(s)||s<=0?null:T[s]?T[s]:ie(s)}function ue(e,s){const n=new Map;if(e?.length){for(const c of e)if(typeof c=="object"&&c&&Number(c.id)>0){const i=(c.title||"").trim();i&&n.set(Number(c.id),i)}}const r=[],o=new Set,a=c=>{const i=Number(c);!Number.isFinite(i)||i<=0||o.has(i)||(o.add(i),r.push(i))};if(s?.length)for(const c of s)a(c);if(e?.length)for(const c of e){const i=typeof c=="number"?c:Number(c?.id);a(i)}return r.map(c=>{const i=n.get(c);if(i)return i;const l=le(c);return l||`Product ${c}`})}function de(e){return e?.schemaVersion===2&&e.membership!=null}function L(e){if(!e)return null;const s=String(e).trim();if(!s)return null;const n=s.match(/^(\d{4})-(\d{2})-(\d{2})$/),r=n?new Date(Number(n[1]),Number(n[2])-1,Number(n[3])):new Date(s);if(Number.isNaN(r.getTime()))return s;try{return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric"}).format(r)}catch{return s}}function N(e,s){const n=typeof e=="string"?e.trim():"";return n&&(n.startsWith("/")||/^https?:\/\//i.test(n))?n:s}function A(e,s){const n=typeof e=="string"?e.trim():"";return!n||/^Product \d+$/i.test(n)?s:n}function me(e){return e.status==="teacher"?"Teacher Access":A(e.plan?.title,"Chinese Track course access")}function he(e){switch(e.status){case"active":return"Active";case"demo":return"Demo access";case"expired":return"Expired";case"manual_grant":return"Access active";case"teacher":return"Lifetime access";case"none":default:return"No active course membership"}}function fe(e){if(e.status==="teacher")return"Teacher access is active. Subscription management is not required for this access type.";if(e.accessDates?.isLifetime)return"Lifetime access";const s=L(e.accessDates?.expiresAt);return s?e.status==="expired"?`Access ended on ${s}`:`Access active through ${s}`:e.status==="demo"?"Demo access is available for the levels listed below.":e.status==="none"?"You do not currently have an active course membership.":"Course access is active. Billing details are handled in the account system."}function xe(e){const s=Array.from(new Set((e??[]).map(n=>Number(n)).filter(n=>Number.isFinite(n)))).sort((n,r)=>n-r);return s.length===0?null:`Level${s.length===1?"":"s"} ${s.join(", ")}`}function pe(e){if(!e)return!1;const s=e.ownedPacks?.length??0,n=e.legacyProductIds?.length??0,r=typeof e.creditBalance=="number"&&Number.isFinite(e.creditBalance)&&e.creditBalance>0;return s>0||n>0||r}function ge(e){const s=e.legacyProductIds?.length??0;return e.ownedPacks?.length||s===0?null:`You own ${s} legacy download pack${s===1?"":"s"}.`}function be(e){return e!=null}function Ne(e){return e.isLoggedIn&&e.accessStatus!=="unknown"&&!e.hasFullAccess}function ye(e){return null}function je(e){return null}function we(e){return N(e.bookingUrl,"")}function M(e){if(!e?.packages?.length)return null;const s=e.packages.find(r=>N(r.purchaseUrl,""));if(s)return s;const n=N(e.purchaseUrl,"");return n?e.packages.find(o=>N(o.purchaseUrl,"")===n)??e.packages[0]??null:e.purchaseAvailable?e.packages.find(o=>typeof o.price=="string"&&o.price.trim()!==""||typeof o.hours=="number"&&o.hours>0)??e.packages[0]??null:null}function ve(e){if(!e)return"";const s=M(e),n=N(s?.purchaseUrl,"");return n||N(e.purchaseUrl,"")}function ke(e){return e&&A(e.title,"")||null}function Ee(e){if(!e)return null;const s=typeof e.price=="string"?e.price.trim():"";if(!s)return null;const n=typeof e.currency=="string"?e.currency.trim():"";return n?`$${s} ${n}`:`$${s}`}function Oe(e){if(!e)return null;const s=typeof e.hours=="number"&&Number.isFinite(e.hours)?e.hours:null;return s===null||s<=0?null:`Adds ${s} lesson hour${s===1?"":"s"} after payment is confirmed.`}const S="Purchase 5 lesson hours",_e="Need more hours?",Le="Checkout opens in a new tab.",Pe="Payment is completed securely in the billing system. Your lesson balance updates after payment is confirmed.",Ae="Lesson balance refreshed.",U="We couldn't refresh your lesson balance. Please try again.",Se="Refreshing…",D="View one-on-one lessons",H="Available lesson hours";function F(e){return!!e?.purchaseAvailable}function Be(e){if(!F(e))return"";const s=typeof e?.purchaseLinkEndpoint=="string"?e.purchaseLinkEndpoint.trim():"";return!s||!s.startsWith("/wp-json/")?"":s}function Ce(e){const s=ve(e);return s?{href:s,target:"_blank",rel:"noopener noreferrer",label:S}:null}function Re(e){const s=M(e)??(F(e)&&e.packages?.length?e.packages[0]:null),n=Ce(e),r=Be(e),o=we(e),a=ke(s),c=Ee(s),i=Oe(s),l=!!r||!!n,f=l?_e:null,m=l?Pe:null,d=l?Le:null,x=ye(),g=je(),p=[x,g,H,D,f,a,c,i,l?S:null,m,d].filter(
1Boolean).join(" ");return{balanceText:x,supportingText:g,packageTitle:a,priceText:c,hoursNote:i,purchaseLink:n,purchaseLinkEndpoint:r,bookingUrl:o,showPurchaseButton:l,showBookingButton:!!o,needMoreHoursLabel:f,paymentDisclaimer:m,checkoutHint:d,renderedCopy:p}}function Te(e){return N(e?.manageUrl,"/amember/member")}function Ue(e){return N(e?.invoicesUrl,"/amember/member/payment-history")}async function $e(e,s){try{const n=await fetch(`${e}/wp-json/chinese-track-access/v2/account/summary`,{credentials:"include",signal:s?.signal});return n.ok?{ok:!0,summary:await n.json(),message:Ae}:{ok:!1,summary:null,message:U}}catch{return{ok:!1,summary:null,message:U}}}function Ie(e){try{return new URLSearchParams(e.startsWith("?")?e.slice(1):e).get("purchase")==="one-on-one"}catch{return!1}}const Me="Opening checkout…",De="We couldn't open checkout. Please try again.",He="/wp-json/chinese-track-auth/v1/nonce";function Fe(e){try{return new URL(e).protocol==="https:"}catch{return!1}}function We(e,s){const n=e.replace(/\/$/,""),r=s.startsWith("/")?s:`/${s}`;return`${n}${r}`}async function W(e,s=""){X();try{const n=await e(We(s,He),{method:"GET",credentials:"include",headers:{Accept:"application/json"}});if(!n.ok)return;const r=await n.json(),o=typeof r.nonce=="string"?r.nonce.trim():"";if(!o)return;const a=r.restUrl??r.rest_url,c=typeof a=="string"&&a.length>0?a:typeof window<"u"?`${window.location.origin}/wp-json/`:"/wp-json/";return z({nonce:o,restUrl:c}),o}catch{return}}async function Ve(e,s,n,r){if(r){const a=await W(e,s);if(a)return a}const o=n();if(o)return o;try{return await J()}catch{return}}function $(e){try{e.close()}catch{}}async function Ge(e){const s=e.openWindow??window.open.bind(window),n=e.fetchImpl??fetch.bind(window),r=e.getNonce??Q,o=e.getNonce==null&&e.resolveNonce==null,a=e.resolveNonce??(()=>Ve(n,e.apiBase??"",r,o)),c=e.apiBase??"",i=e.endpoint.startsWith("/")?e.endpoint:`/${e.endpoint}`,l=s("about:blank","_blank");if(!l)return{ok:!1,error:"popup_blocked"};try{l.opener=null}catch{}const f=async d=>n(`${c}${i}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-WP-Nonce":d},body:"{}"});let m=await a();if(!m)return $(l),{ok:!1,error:"no_nonce"};try{let d=await f(m);if(!d.ok&&d.status===403&&o){const p=await W(n,c);p&&p!==m&&(m=p,d=await f(m))}if(!d.ok)throw new Error(`HTTP ${d.status}`);const x=await d.json(),g=typeof x.url=="string"?x.url.trim():"";if(!g||!Fe(g))throw new Error("bad_response");return l.location.replace(g),{ok:!0}}catch{return $(l),{ok:!1,error:"mint_failed"}}}function _(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}const Ye=()=>{const[e,s]=u.useState(null),[n,r]=u.useState(!0),[o,a]=u.useState(null);return u.useEffect(()=>{let c=!1;return(async()=>{try{r(!0),a(null);const l=await se();c||s(l)}catch(l){c||(s(null),a(ne(l,"Lesson-hour balance is unavailable.").message))}finally{c||r(!1)}})(),()=>{c=!0}},[]),t.jsxs("div",{className:"mt-3",children:[n?t.jsxs("p",{className:"inline-flex items-center gap-1.5 text-sm text-slate-500",children:[t.jsx(Z,{className:"h-3.5 w-3.5 animate-spin"}),"Loading…"]}):null,!n&&o?t.jsx("p",{className:"text-sm text-slate-600",children:o}):null,!n&&!o&&e?t.jsxs("div",{children:[t.jsxs("p",{className:"text-sm leading-6 text-slate-700",children:[H,":"," ",t.jsx("span",{className:"font-semibold text-slate-950",children:_(e.availableHours)})]}),(e.reservedHours>0||e.consumedHours>0)&&t.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:["Reserved ",_(e.reservedHours)," · ","Completed ",_(e.consumedHours)]})]}):null,t.jsx("div",{className:"mt-3",children:t.jsx(P,{to:"/one-on-one-lessons",className:"text-sm font-medium text-orange-600 hover:text-orange-700",children:D})})]})},Ke="",v=Ke;function at(){const e=ee(),[s,n]=u.useState(!0),[r,o]=u.useState(null),[a,c]=u.useState(null),[i,l]=u.useState(null),[f,m]=u.useState(!1),[d,x]=u.useState(null),[g,p]=u.useState(!1),B=u.useRef(!1),C=u.useCallback(async h=>{const b=await fetch(`${v}/wp-json/chinese-track-access/v2/account/summary`,{credentials:"include"}).then(w=>
1{if(!w.ok)throw new Error(`HTTP ${w.status}`);return w.json()});return h()?(o(b),b):null},[]),k=u.useCallback(async()=>{if(f)return;m(!0),x(null),p(!1);const h=await $e(v);h.ok?(o(h.summary),x(h.message),p(!1)):(x(h.message),p(!0)),m(!1)},[f]);u.useEffect(()=>{let h=!0;return(async()=>{try{n(!0),l(null);const b=await C(()=>h);if(!h||!b)return;if(!b?.billing?.last_invoice&&!b?.amember?.active_products?.length)try{const R=await fetch(`${v}/wp-json/chinese-track-access/v2/account/health?debug=0`,{credentials:"include"});if(R.ok){const K=await R.json();if(!h)return;c(K)}}catch{}}catch(b){if(!h)return;l(b?.message||"Failed to load account data")}finally{h&&n(!1)}})(),()=>{h=!1}},[C]),u.useEffect(()=>{s||!r||B.current||typeof window>"u"||Ie(window.location.search)&&(B.current=!0,k())},[s,r,k]);const E=de(r),G=u.useMemo(()=>E?[]:ue(r?.amember?.active_products,r?.amember?.active_product_ids),[E,r]),O=Ne(e),Y=O&&r?.billing?.last_invoice!=null;return s?t.jsx("div",{className:"mx-auto max-w-5xl px-4 py-6 text-sm text-slate-700",role:"status","aria-live":"polite",children:"Loading account…"}):i?t.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-6 text-sm text-red-700",role:"alert",children:["Error: ",i]}):t.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-6 sm:px-6",children:[t.jsx("h1",{className:"mb-2 text-2xl font-semibold text-slate-950",children:"My Account"}),t.jsxs("p",{className:"mb-6 text-sm text-slate-600",children:["Signed in as ",t.jsx("strong",{children:r?.wp?.displayName})," (",r?.wp?.email,")"]}),E?t.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[t.jsx(qe,{membership:r.membership,health:a,showUpgradeCta:O}),be(r.oneOnOne)&&t.jsx(Xe,{oneOnOne:r.oneOnOne,refreshing:f,refreshMessage:d,refreshError:g,onRefreshBalance:k}),pe(r.downloads)&&t.jsx(Je,{downloads:r.downloads}),t.jsx(ze,{billingV2:r.billingV2,legacyBilling:r.billing})]}):t.jsxs(t.Fragment,{children:[t.jsx(Qe,{health:a,productNames:G}),t.jsx(Ze,{})]}),O&&t.jsx("div",{className:"mt-4",children:t.jsx(ae,{variant:Y?"renew":"upgrade"})}),t.jsx(et,{})]})}function y({children:e,className:s=""}){return t.jsx("section",{className:`rounded-xl border border-slate-200 bg-white p-5 shadow-sm ${s}`,children:e})}function j({href:e,children:s,variant:n="neutral"}){if(!e)return null;const r=n==="orange"?"border-orange-200 bg-orange-50 text-orange-800 hover:bg-orange-100":"border-slate-200 bg-slate-50 text-slate-800 hover:bg-slate-100",o=e.startsWith("http")||e.startsWith("/amember");return t.jsx("a",{href:e,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,className:`inline-flex min-h-10 items-center justify-center rounded-lg border px-4 py-2 text-sm font-semibold transition-colors ${r}`,children:s})}function V({health:e}){if(!e||e.ok)return null;const s=e.steps?.some(n=>{const r=n.error||"";return r.includes("API Error 10002")||r.includes("key is not found or disabled")||r.toLowerCase().includes("[key] is not found or disabled")});return t.jsxs("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm",children:[t.jsx("div",{className:"mb-2 font-semibold text-amber-950",children:"Membership info not available."}),t.jsx("div",{className:"text-amber-900",children:s?"aMember API key mismatch or disabled. In aMember settings, confirm the API key and Remote API GET permissions.":"In aMember Remote API Permissions, enable GET for users and check-access (by-email)."})]})}function qe({membership:e,health:s,showUpgradeCta:n}){const r=xe(e.demoLevels);return t.jsxs(y,{children:[t.jsxs("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-slate-950",children:"Course Membership"}),t.jsx("p",{className:"mt-1 text-base font-semibold text-slate-800",children:me(e)})]}),t.jsxs("span",{className:"inline-flex w-fit rounded-full bg-slate-100 px-3 py-1 text-xs font-semibold text-slate-700",children:["Status: ",he(e)]})]}),t.jsx(V,{health:s}),t.jsx("p",{className:"text-sm leading-6 text-slate-700",children:fe(e)}
1),r&&t.jsxs("p",{className:"mt-3 rounded-lg bg-orange-50 px-3 py-2 text-sm font-medium text-orange-900",children:["Accessible demo ",r]}),n&&e.status!=="teacher"&&t.jsx("p",{className:"mt-3 text-sm text-slate-600",children:"Upgrade options are shown below when your account is eligible."})]})}function Je({downloads:e}){const s=ge(e),n=tt(e.ownedPacks??[]);return t.jsxs(y,{children:[t.jsx("h2",{className:"text-lg font-semibold text-slate-950",children:"Owned Downloads"}),t.jsx("p",{className:"mt-1 text-sm text-slate-600",children:"Offline learning packs"}),e.creditBalance!==null&&t.jsxs("p",{className:"mt-3 text-sm text-slate-700",children:[t.jsx("strong",{children:e.creditBalance})," download credit",e.creditBalance===1?"":"s"," remaining."]}),n.length>0&&t.jsx("div",{className:"mt-4 space-y-3",children:n.map(([r,o])=>t.jsxs("div",{className:"rounded-lg border border-slate-100 bg-slate-50 px-3 py-3",children:[t.jsx("p",{className:"text-xs font-semibold text-slate-600",children:r==="other"?"Other packs":`Level ${r}`}),t.jsx("ul",{className:"mt-2 space-y-1 text-sm text-slate-800",children:o.map(a=>t.jsx("li",{children:A(a.title,"Download pack")},a.packId))})]},r))}),s&&t.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-700",children:s}),t.jsx("div",{className:"mt-5",children:t.jsx(P,{to:"/account/downloads",className:"inline-flex min-h-10 items-center justify-center rounded-lg border border-orange-200 bg-orange-50 px-4 py-2 text-sm font-semibold text-orange-800 transition-colors hover:bg-orange-100",children:"Manage downloads"})})]})}function Xe({oneOnOne:e,refreshing:s,refreshMessage:n,refreshError:r,onRefreshBalance:o}){const a=Re(e),[c,i]=u.useState(!1),[l,f]=u.useState(null),m=async()=>{if(c||!a.purchaseLinkEndpoint)return;i(!0),f(null),(await Ge({apiBase:v,endpoint:a.purchaseLinkEndpoint})).ok||f(De),i(!1)};return t.jsxs(y,{children:[t.jsx("h2",{className:"text-lg font-semibold text-slate-950",children:"One-on-One Lessons"}),t.jsx(Ye,{}),a.needMoreHoursLabel&&t.jsx("p",{className:"mt-5 text-sm font-semibold text-slate-900",children:a.needMoreHoursLabel}),a.packageTitle&&a.showPurchaseButton&&t.jsxs("div",{className:"mt-2 rounded-lg border border-slate-100 bg-slate-50 px-3 py-3",children:[t.jsx("p",{className:"text-sm font-semibold text-slate-900",children:a.packageTitle}),a.priceText&&t.jsx("p",{className:"mt-1 text-sm text-slate-700",children:a.priceText}),a.hoursNote&&t.jsx("p",{className:"mt-1 text-sm text-slate-600",children:a.hoursNote})]}),a.paymentDisclaimer&&t.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-600",children:a.paymentDisclaimer}),(a.showPurchaseButton||a.showBookingButton)&&t.jsxs("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[a.purchaseLinkEndpoint&&t.jsx("button",{type:"button",onClick:m,disabled:c,className:"inline-flex min-h-10 items-center justify-center rounded-lg bg-orange-600 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-orange-700 disabled:cursor-not-allowed disabled:opacity-60",children:c?Me:S}),!a.purchaseLinkEndpoint&&a.purchaseLink&&t.jsx(j,{href:a.purchaseLink.href,variant:"orange",children:a.purchaseLink.label}),a.showBookingButton&&t.jsx(j,{href:a.bookingUrl,variant:"orange",children:"Book Lesson"})]}),a.checkoutHint&&t.jsx("p",{className:"mt-2 text-xs text-slate-500",children:a.checkoutHint}),l&&t.jsx("p",{className:"mt-2 text-sm text-red-700",role:"alert",children:l}),t.jsxs("div",{className:"mt-4",children:[t.jsx("button",{type:"button",onClick:o,disabled:s,className:"inline-flex min-h-10 items-center justify-center rounded-lg border border-slate-200 bg-slate-50 px-4 py-2 text-sm font-semibold text-slate-800 transition-colors hover:bg-slate-100 disabled:cursor-not-allowed disabled:opacity-60",children:s?Se:"Refresh balance"}),n&&t.jsx("p",{className:`mt-2 text-sm ${r?"text-red-700":"text-slate-600"}`,role:"status","aria-live":"polite",children:n})]})]})}function ze({billingV2:e,legacyBilling:s}){const n=L(e?.nextBillingAt??s?.next_billing??null),r=e?.lastInvoice??null,o=L(r?.createdAt??null),a=I(r?.amount),c=I(r?.status);return t.jsxs(y,{children:[t.jsx("h2",{className:"text-lg font-semibold text-slate-950",children:"Billing & Orders"}),t.jsx("p",{className:"mt-1 text-sm text-slate-600",children:"Account system"}),t.jsx("p",{className:"mt-3 text-sm leading-6 text-slate-700",children:"Billing is handled in our secure account system. For security, you may be asked to log in again before viewing invoices, payment history, or subscription settings."}),t.jsxs("dl",{className:"mt-4 space-y-2 text-sm",children:[n&&t.jsxs("div",{children:[t.jsx("dt",{className:"font-semibold text-slate-900",children:"Next billing date"}),t.jsx("dd",{className:"text-slate-700",children:n})]}),(o||c||a)&&t.jsxs("div",{children:[t.jsx("dt",{className:"font-semibold text-slate-900",children:"Last invoice"}),t.jsx("dd",{className:"text-slate-700",children:[o,c,a].filter(
1Boolean).join(" · ")})]})]}),t.jsxs("div",{className:"mt-5 flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[t.jsx(j,{href:Te(e),children:"Open billing account"}),t.jsx(j,{href:Ue(e),children:"View payment history"})]})]})}function Qe({health:e,productNames:s}){return t.jsxs(y,{className:"mb-4",children:[t.jsx("h2",{className:"mt-0 text-lg font-semibold text-slate-950",children:"Membership"}),t.jsx(V,{health:e}),t.jsxs("div",{className:"mb-2",children:[t.jsx("div",{className:"font-semibold text-slate-900",children:"Active products:"}),s.length?t.jsx("ul",{className:"mt-1 list-disc pl-5 text-sm text-slate-700",children:s.map((n,r)=>t.jsx("li",{children:n},`${n}-${r}`))}):t.jsx("div",{className:"mt-1 text-sm text-slate-500",children:e&&!e.ok?"Permissions missing (see note below)":"None detected (or not exposed by API)"})]}),t.jsxs("div",{className:"mt-4",children:[t.jsx(j,{href:"/amember/member",children:"Manage billing in account system"}),t.jsx("p",{className:"mt-2 text-sm text-slate-600",children:"Billing is handled in our secure account system. For security, you may be asked to log in again before viewing invoices, payment history, or subscription settings."})]})]})}function Ze(){return t.jsxs(y,{className:"mb-4",children:[t.jsx("h2",{className:"mt-0 text-lg font-semibold text-slate-950",children:"Offline Downloads"}),t.jsx("p",{className:"mb-4 text-sm text-slate-600",children:"Redeem download credits to unlock offline lesson MP3s, review audio, and printable PDF packs."}),t.jsx(P,{to:"/account/downloads",className:"inline-flex min-h-10 items-center rounded-lg border border-orange-200 bg-orange-50 px-4 py-2 text-sm font-semibold text-orange-800 transition-colors hover:bg-orange-100",children:"Offline Downloads"})]})}function et(){return t.jsxs(y,{className:"mt-4",children:[t.jsx("h2",{className:"mt-0 text-lg font-semibold text-slate-950",children:"Learning Preferences"}),t.jsx("p",{className:"mb-4 text-sm text-slate-600",children:"Control how Chinese Track displays characters, pinyin, and practice activities."}),t.jsx("a",{href:"#/learning-preferences",className:"inline-flex min-h-10 items-center rounded-lg border border-slate-200 bg-slate-50 px-4 py-2 text-sm font-semibold text-slate-800 transition-colors hover:bg-slate-100",children:"Edit preferences"})]})}function tt(e){const s=new Map;for(const n of e){const r=typeof n.level=="number"&&Number.isFinite(n.level)?n.level:"other";s.set(r,[...s.get(r)??[],n])}return Array.from(s.entries()).sort(([n],[r])=>n==="other"?1:r==="other"?-1:n-r)}function I(e){return(typeof e=="string"?e.trim():"")||null}export{at as default};
2//# sourceMappingURL=AccountPage-D1Wqk5ZX.js.map

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.