1import{a as te,b as se,c as G,r as c,o as le,d as $,e as H,j as i,P as ne,C as re,f as B,h as oe,i as C,k as v,l as ce,m as U,n as D,p as fe,q as de,s as q,u as me,v as J,w as ue,x as ge,y as V,W as he,E as be,z as xe,Q as pe,A as je,B as ke}from"./main-DrBhI0hH.js";import{getOfficialScoredWritingSamples as X,getOfficialScoredWritingQuestionModel as Y,getOfficialScoredWritingPracticeTask as Se}from"./officialScoredWritingSamples-BfB8b90J.js";import"./index-_tIqqp10.js";function T(a,t="en"){const o=String(a?.sourceReference||""),p=o.match(/^(Cambridge IELTS (\d+)) · (Academic|General Training) Test (\d+) · Task [12]$/);if(!p)return{label:o};const[,b,d,m,u]=p,x=`${b} · ${m} Test ${u}`,l=m==="General Training"?"general_training":"academic",g=te(Number(d),l);return g?{book:Number(d),bookLabel:b,contextLabel:`${m} Test ${u}`,href:se(g.path,t),label:x}:{label:x}}function M(a,t){return t==="zh-CN"?`/zh-CN${a}`:t==="vi"?`/vi${a}`:a}function Ie({page:a,locale:t,siteOrigin:o,search:p=""}){const b=G(a,t),d=X(a),m=H(p,d.length).pagination,u=d.slice(m.startIndex,m.endIndex),x=new URL(q(M(a.path,t),m.pageNumber),o).toString();return{"@context":"https://schema.org","@type":"CollectionPage",name:b.title,description:b.seoDescription,url:x,mainEntity:{"@type":"ItemList",numberOfItems:u.length,itemListElement:u.map((l,g)=>{const n=l.taskImagePath?J({locale:t,taskSubtype:l.taskGenre,prompt:l.taskPrompt,imageSourcePath:l.taskImagePath}):"";return{"@type":"ListItem",position:m.startIndex+g+1,url:`${x}#official-sample-${l.id}`,name:`${l.sourceReference} â ${l.sampleKind==="examiner_model"?b.examinerModel:V(Number(l.officialBand).toFixed(1),t)}`,...n?{image:{"@type":"ImageObject",contentUrl:new URL(l.taskImagePath,o).toString(),caption:n,description:n}}:{}}})}}}function Pe({page:a,locale:t,collectionLinks:o,bandDescriptorsHref:p,t:b,onUseTask:d,sampleTargets:m={},search:u="",imageViewerCopy:x,onLinkClick:l,onNavigate:g}){const n=G(a,t),r=c.useMemo(()=>X(a),[a]),j=c.useMemo(()=>a.id==="cambridge-18-20"?[...new Set(r.map(e=>T(e,t).book).filter(Number.isFinite))].sort((e,s)=>s-e):[],[t,a.id,r]),y=c.useMemo(()=>le.filter(e=>r.some(s=>$(s)===e)),[r]),[f,k]=c.useState("all"),[I,W]=c.useState("all"),[S,A]=c.useState("all");c.useEffect(()=>{k("all"),W("all"),A("all")},[a.id]);const Z=c.useMemo(()=>Object.fromEntries(j.map(e=>[e,r.filter(s=>T(s,t).book===e).length])),[j,t,r]),P=c.useMemo(()=>I==="all"?r:r.filter(e=>T(e,t).book===Number(I)),[I,t,r]),ee=c.useMemo(()=>Object.fromEntries(y.map(e=>[e,P.filter(s=>$(s)===e).length])),[P,y]),h=c.useMemo(()=>S==="all"?P:P.filter(e=>$(e)===S),[S,P]),L=c.useMemo(()=>[...new Set(h.filter(e=>Number.isFinite(Number(e.officialBand))).map(e=>Number(e.officialBand)))].sort((e,s)=>s-e),[h]),E=c.useMemo(()=>h.filter(e=>e.sampleKind==="examiner_model").length,[h]),O=c.useMemo(()=>f==="all"?h:f==="examiner_model"?h.filter(e=>e.sampleKind==="examiner_model"):h.filter(e=>Number(e.officialBand)===Number(f)),[f,h]),N=H(u,O.length).pagination,_=O.slice(N.startIndex,N.endIndex),ie=c.useMemo(()=>Object.fromEntries(L.map(e=>[e,h.filter(s=>Number(s.officialBand)===e).length])),[L,h]);function F(e){k(e),N.pageNumber>1&&g?.(M(a.path,t))}function w(e,s){return s==="all"?!0:s==="examiner_model"?e.sampleKind==="examiner_model":Number(e.officialBand)===Number(s)}function R(e,s){return s==="all"||T(e,t).book===Number(s)}function K(e){W(e),N.pageNumber>1&&g?.(M(a.path,t)),f!=="all"&&!r.some(s=>R(s,e)&&(S==="all"||$(s)===S)&&w(s,f))&&k("all")}function z(e){A(e),N.pageNumber>1&&g?.(M(a.path,t)),f!=="all"&&!r.some(s=>R(s,I)&&(e==="all"||$(s)===e)&&w(s,f))&&k("all")}return i.jsxs("section",{className:"official-samples-page","aria-labelledby":"official-samples-page-title",children:[i.jsx(ne,{titleId:"official-samples-page-title",title:n.title,subtitle:n.libraryDescription,className:"official-library-intro",actions:i.jsx("a",{className:"official-library-standard-link",href:p,onClick:e=>l(e,p),children:n.scoringCriteriaLink})}),i.jsxs("section",{className:"official-samples-controls","aria-labelledby":"official-samples-filter-title",children:[i.jsxs("div",{className:"official-samples-controls-heading",children:[i.jsx("h2",{id:"official-samples-filter-title",children:n.libraryTitle}),i.jsx("p",{className:"official-samples-controls-note",children:n.navDe
1scription}),n.showing?i.jsx("strong",{"aria-live":"polite",children:n.showing(_.length,O.length)}):null]}),i.jsxs(re,{className:"official-library-filter","aria-label":n.collectionNavLabel,children:[i.jsx(B,{label:n.collectionNavLabel,labelId:"official-source-filter-label",navigation:!0,children:o.map(e=>i.jsx(oe,{href:e.href,isActive:e.id===a.id,onClick:s=>l(s,e.href),children:e.label},e.id))}),j.length?i.jsxs(B,{label:n.bookFilterLabel,labelId:"official-book-filter-label",children:[i.jsxs(C,{isActive:I==="all",onClick:()=>K("all"),children:[n.allBooks,i.jsx(v,{children:r.length})]}),j.map(e=>i.jsxs(C,{isActive:Number(I)===e,onClick:()=>K(String(e)),children:["Book ",e,i.jsx(v,{children:Z[e]})]},e))]}):null,i.jsxs(B,{label:n.taskFilterLabel,labelId:"official-task-filter-label",children:[i.jsxs(C,{isActive:S==="all",onClick:()=>z("all"),children:[n.allTasks,i.jsx(v,{children:P.length})]}),y.map(e=>i.jsxs(C,{isActive:S===e,onClick:()=>z(e),children:[ce(e,t),i.jsx(v,{children:ee[e]})]},e))]}),i.jsxs(B,{label:n.bandFilterLabel,labelId:"official-band-filter-label",children:[i.jsxs(C,{isActive:f==="all",onClick:()=>F("all"),children:[n.allBands,i.jsx(v,{children:h.length})]}),L.map(e=>i.jsxs(C,{isActive:Number(f)===e,onClick:()=>F(String(e)),children:[U(e.toFixed(1),t),i.jsx(v,{children:ie[e]})]},e)),E?i.jsxs(C,{isActive:f==="examiner_model",onClick:()=>F("examiner_model"),children:[n.examinerModels,i.jsx(v,{children:E})]}):null]})]})]}),i.jsx("div",{className:"official-samples-list",children:_.map((e,s)=>{const Q=m[D(Y(e))],ae=fe(Q,t,M);return i.jsx(Ne,{sample:e,locale:t,copy:n,imageViewerCopy:x,sequence:N.startIndex+s+1,onLinkClick:l,onUseTask:d,sampleHref:ae,sampleTarget:Q},e.id)})}),i.jsx(de,{pagination:N,copy:me(t),getPageHref:e=>q(M(a.path,t),e),onLinkClick:l})]})}function Ne({sample:a,locale:t,copy:o,imageViewerCopy:p,sequence:b,onLinkClick:d,onUseTask:m,sampleHref:u="",sampleTarget:x=null}){const l=a.sampleKind==="examiner_model",g=l?"":Number(a.officialBand).toFixed(1),n=l?o.examinerModel:U(g,t),r=T(a,t),j=Y(a),y=D(j),f=a.taskImagePath?J({locale:t,taskSubtype:a.taskGenre,prompt:a.taskPrompt,imageSourcePath:a.taskImagePath}):"";return i.jsxs("article",{className:"official-sample-entry",id:`official-sample-${a.id}`,"aria-labelledby":`official-sample-${a.id}-source official-sample-${a.id}-title`,style:{"--entry-index":b},children:[i.jsxs("header",{className:"official-sample-entry-header",children:[i.jsxs("div",{className:"official-sample-entry-title",children:[i.jsx("span",{children:String(b).padStart(2,"0")}),i.jsxs("div",{children:[i.jsx("p",{id:`official-sample-${a.id}-source`,children:r.href?i.jsxs(i.Fragment,{children:[i.jsx("a",{className:"official-sample-entry-source-link",href:r.href,onClick:k=>d(k,r.href),children:r.bookLabel})," ","· ",r.contextLabel]}):r.label}),i.jsxs("h2",{id:`official-sample-${a.id}-title`,children:[ue(a,t)," · ",ge(a,t)]})]})]}),i.jsxs("div",{className:"official-band-mark","aria-label":l?o.examinerModel:V(g,t),children:[i.jsx("small",{children:l?o.examinerModelLabel:o.bandLabel}),i.jsx("strong",{children:n})]})]}),i.jsx("div",{className:"official-sample-prompt",children:i.jsx(he,{classificationQuestion:j,taskCategory:j.taskCategory,topicKey:y,topics:xe(j.taskCategory,y),locale:t,compact:!0,onLinkClick:d,children:i.jsxs("div",{className:`official-task-content official-study-prompt${a.taskImagePath?" official-study-prompt--with-image":""}`,children:[i.jsx("div",{className:"official-full-text",children:a.taskPrompt}),a.taskImagePath?i.jsx("figure",{className:"official-task-visual",children:i.jsx(be,{src:a.taskImagePath,alt:f,copy:p,loading:"lazy"})}):null]})})}),i.jsx(pe,{entryKey:`official:${a.id}`,locale:t,titleId:`official-sample-${a.id}-practice-title`,placement:"before-official-answer",ctaId:"official_samples_practice_offer_write",officialQuestion:!0,officialSample:l?{isExaminerModel:!0}:{score:n},writingTask:Se(a),onUseTask:m,children:u?i.jsx(je,{href:u,sampleTarget:x,locale:t,onClick:d&&!ke(x)?k=>d(k,u):void 0}):null}),i.jsxs("div",{className:"official-sample-reading-grid",children:[i.jsxs("section",{className:"official-sample-response","aria-labelledby":`official-sample-${a.id}-response`,children:[i.jsx("h3",{id:`official-sample-${a.id}-response`,children:l?o.examinerModelResponse:o.response}),i.jsx("div",{className:"official-full-response",lang:"en",children:a.candidateResponse})]}),i.jsxs("section",{className:"official-sample-feedback","aria-labelledby":`official-sample-${a.id}-feedback`,children:[i.jsx("h3",{id:`official-sample-${a.id}-feedback`,children:l?o.examinerModelFeedback:o.feedback}),i.jsx("div",{className:"official-full-comment",lang:"en",children:a.examinerComment})]})]})]})}export{Pe as default,Ie as getOfficialScoredWritingRouteStructuredData};
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.