1import{j as e,r as x}from"./react-vendor-aZeK6R-U.js";import{A as b}from"./arrow-left-C_Fw7f6I.js";import{i as g}from"./index-BX1nXRHR.js";import{C as f}from"./chevron-right-C7VksepJ.js";const N="/assets/srs-chevron-v1-CRqDHgIN.webp",y="/assets/srs-motion-controls-v1-tlTU6eHi.webp",k=["play","pause","left","right","fullscreen","captions","volume","muted","check","plus","grip","pointer","replay","book","close","settings"];function j({name:r,size:s=24,className:t=""}){const a=`ml-painted-icon ${t}`;if(r==="chevron-left"||r==="chevron-right")return e.jsx("svg",{className:a,width:s,height:s,viewBox:"180 130 900 1000","aria-hidden":"true",focusable:"false",style:{overflow:"hidden",transform:r==="chevron-left"?"scaleX(-1)":void 0},children:e.jsx("image",{href:N,width:"1254",height:"1254"})});const c=k.indexOf(r),l=[193,485,777,1066][c%4]-110,n=[188,477,770,1050][Math.floor(c/4)]-110;return e.jsx("svg",{className:a,width:s,height:s,viewBox:`${l} ${n} 220 220`,"aria-hidden":"true",focusable:"false",style:{overflow:"hidden"},children:e.jsx("image",{href:y,width:"1254",height:"1254"})})}function L({label:r,options:s,value:t,disabled:a=!1,onChange:c}){const l=x.useId();return e.jsxs("fieldset",{className:"ml-choice-group",disabled:a,children:[e.jsx("legend",{children:r}),e.jsx("div",{className:`ml-group-options${s.length>2?" ml-group-options--four":""}`,children:s.map(n=>e.jsxs("label",{className:"ml-group-option",children:[e.jsx("input",{type:"radio",name:l,value:n.value,checked:t===n.value,onChange:()=>c(n.value)}),e.jsxs("span",{className:"ml-group-choice-body",children:[e.jsx("span",{className:"ml-group-choice-dot","aria-hidden":"true"}),e.jsxs("span",{className:"ml-group-choice-copy",children:[e.jsx("span",{children:n.label}),n.description&&e.jsx("small",{children:n.description})]})]})]},n.value))})]})}function w({count:r,current:s,progress:t=1,label:a,onSeek:c}){const l=!!c&&r>1;return e.jsxs("div",{className:`lesson-timeline${l?" lesson-timeline--seekable":""}`,role:l?void 0:"progressbar","aria-label":l?void 0:a,"aria-valuemin":l?void 0:0,"aria-valuemax":l?void 0:r,"aria-valuenow":l?void 0:s+Math.max(0,Math.min(1,t)),children:[e.jsx("div",{className:"lesson-timeline-strokes","aria-hidden":"true",children:Array.from({length:r},(n,o)=>e.jsx("span",{className:o===s?"is-current":"",children:e.jsx("span",{style:{width:`${o<s?100:o===s?Math.max(0,Math.min(1,t))*100:0}%`}})},o))}),l&&e.jsx("input",{type:"range",min:0,max:r-1,step:1,value:s,"aria-label":a,"aria-valuetext":`Step ${s+1} of ${r}`,onChange:n=>c(Number(n.currentTarget.value))})]})}function S({title:r,chapters:s,preview:t,progress:a,withinPlayer:c=!1}){const l=x.useRef(null),[n,o]=x.useState(!1),m=()=>{const i=[...l.current?.querySelectorAll("img")||[]];o(!!t&&i.every(d=>d.complete&&d.naturalWidth>0))};x.useEffect(m,[t]);const v=a?[a.narration,a.models,a.feedback]:[0,0,0],p=Math.round(v.reduce((i,d)=>i+d,0)/3*100),u=(i="")=>e.jsx("span",{className:`lls-text-slot ${i}`,"aria-hidden":"true",children:"â¢â¢â¢"});return e.jsxs("section",{className:`lesson-loading-skeleton ${c?"is-in-player":""}`,"aria-busy":"true","aria-label":"Loading lesson",children:[!c&&e.jsxs("div",{className:"lls-navigation",inert:!0,"aria-hidden":"true",children:[e.jsx(j,{name:"left",size:18}),e.jsx("span",{children:"Lesson"}),e.jsx("span",{children:"Practice"}),e.jsx("span",{children:"Recap"})]}),e.jsx("div",{className:"ml-chapters lls-chapters",children:(s?.length?s:["","",""]).map((i,d)=>e.jsxs("span",{children:[e.jsx("b",{children:["ä¸","äº","ä¸","å","äº","å
"][d]||d+1}),i||u()]},d))}),e.jsxs("div",{className:"lls-content",children:[e.jsx("div",{className:"lls-heading",children:r?e.jsx("h1",{children:r}):u("lls-title")}),e.jsx("div",{className:"lls-art",children:t&&e.jsx("div",{ref:l,className:`ml-stage lls-preview ${n?"is-ready":""}`,inert:!0,"aria-hidden":"true",onLoadCapture:m,onErrorCapture:m,children:t})}),!t&&e.jsx("div",{className:"lls-sentence","aria-hidden":"true",children:u()}),!t&&e.jsx("div",{className:"lls-choices",inert:!0,"aria-hidden":"true",children:e.jsx(L,{label:"",disabled:!0,options:[{value:"a",label:u()},{value:"b",label:u()}],onChange:()=>{}})})]}),e.jsxs("div",{className:"lls-footer",children:[e.jsx("div",{className:"lls-caption","aria-hidden":"true",children:u()}),e.jsx("div",{role:"progressbar","aria-label":"Lesson preparation","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":a?p:void 0,className:"lls-progress",children:e.jsx("div",{"aria-hidden":"true",style:{width:"100%"},children:e.jsx(w,{count:30,current:Math.min(29,Math.floor(p*.3)),progress:p===100?1:p*.3%1,label:"Preparation strokes"})})}
1),e.jsxs("div",{className:"ml-controls lls-controls",inert:!0,"aria-hidden":"true",children:[e.jsxs("div",{className:"ml-control-group",children:[["left","play","replay"].map(i=>e.jsx("button",{className:"ml-icon-button",disabled:!0,tabIndex:-1,children:e.jsx(j,{name:i})},i)),e.jsx("span",{className:"ml-time",children:"0:00 / â:â"})]}),e.jsxs("div",{className:"ml-control-group lls-options",children:[e.jsx("span",{className:"ml-time",children:"1Ã"}),["volume","captions","book"].map(i=>e.jsx("button",{className:"ml-icon-button",disabled:!0,tabIndex:-1,children:e.jsx(j,{name:i})},i))]}),e.jsx("button",{className:"wc-cta-square wc-cta-square--sakura ml-next",disabled:!0,tabIndex:-1,children:"Continue"})]})]}),e.jsx("span",{className:"sr-only",role:"status",children:a?`Lesson preparation ${p}% complete`:"Loading lesson"})]})}const h=["primer","deck","practice","codex"],C={primer:"Intro",deck:"Lesson",practice:"Practice",codex:"Recap"};function $({currentPhase:r,onPhase:s,compact:t=!0}){const a=h.indexOf(r),c=t?h.filter(l=>l!=="primer"):h;return e.jsxs("nav",{className:`gr-phase-nav${t?" gr-phase-nav--compact":""}`,"data-tour-id":"grammar-phase-nav",children:[e.jsx("div",{className:"gr-phase-pills",children:c.map(l=>{const n=h.indexOf(l),o=l===r,m=n<a;return e.jsxs("button",{type:"button",onClick:()=>s(l),className:"gr-phase-pill","aria-current":o?"step":void 0,"data-active":o?"true":"false","data-past":m?"true":"false",children:[e.jsx("span",{className:"gr-phase-pill-label",children:C[l]}),o&&e.jsx("span",{className:"gr-phase-pill-brush wc-shl-brush","aria-hidden":"true"})]},l)})}),!t&&e.jsxs("div",{className:"gr-phase-arrows",children:[e.jsx("button",{type:"button",onClick:()=>a>0&&s(h[a-1]),disabled:a===0,className:"gr-phase-arrow","aria-label":"Previous phase",children:e.jsx(g,{size:14,strokeWidth:1.8})}),e.jsx("button",{type:"button",onClick:()=>a<h.length-1&&s(h[a+1]),disabled:a===h.length-1,className:"gr-phase-arrow","aria-label":"Next phase",children:e.jsx(f,{size:14,strokeWidth:1.8})})]})]})}function E({phase:r,onPhase:s,onBack:t}){return e.jsxs("header",{className:"gr-lesson-studybar",children:[t&&e.jsxs("button",{type:"button",onClick:t,className:"gr-lesson-studybar-back","aria-label":"Back to lessons",title:"Back to lessons",children:[e.jsx(b,{size:16,strokeWidth:1.8,"aria-hidden":"true"}),e.jsx("span",{children:"Back"})]}),e.jsx($,{currentPhase:r,onPhase:s,compact:!0})]})}export{S as L,j as M,$ as P,w as a,E as b,h as c,L as d};
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.