PageSourceSearch

https://app.lingoleap.ai/static/js/2634.8f3810a1.chunk.js

js lingoleap.ai collected 2026-10-04 20:46:48 UTC 42,996 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunklingoleap=self.webpackChunklingoleap||[]).push([[2634],{690:(e,t,n)=>{n.d(t,{J:()=>m});var o=n(89379),s=n(80045),i=n(9950),r=n(24359),l=n(88119),a=n(62123),c=n(67818),d=n(22875),u=n(16339),h=n(44414);const x=["meteredCost","cost","free","freeLeft"],p={paid:{icon:u.S8s,bg:"orange.50",borderColor:"orange.200",color:"orange.700"},free:{icon:u.YyZ,bg:"green.50",borderColor:"green.200",color:"green.700"},premium:{icon:d.Hu1,bg:"yellow.50",borderColor:"yellow.300",color:"gray.700"}};function g(e){let{meteredCost:t,cost:n,free:i=!1,freeLeft:a=null}=e,d=(0,s.A)(e,x);const{t:u}=(0,c.Bd)();if(!t)return null;const g=0===n&&!i,m=p[g?"premium":i?"free":"paid"];let f;return f=g?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(r.EY,{as:"span",fontWeight:"600",mr:"6px",children:u("credit_cost_hint.premium_label")}),(0,h.jsx)(r.EY,{as:"s",color:"gray.400",mr:"6px",children:u("credit_cost_hint.price",{credits:t})}),(0,h.jsx)(r.EY,{as:"span",color:"red.500",fontWeight:"700",children:u("credit_cost_hint.premium")})]}):i?null===a?u("credit_cost_hint.free"):u("credit_cost_hint.free_left",{count:a}):u("credit_cost_hint.cost",{credits:t}),(0,h.jsxs)(r.so,(0,o.A)((0,o.A)({"data-testid":"credit-cost-hint",role:"note",display:"inline-flex",align:"center",gap:"6px",px:"14px",py:"6px",fontSize:"14px",fontWeight:"500",lineHeight:"20px",whiteSpace:"nowrap",rounded:"full",border:"1px solid",bg:m.bg,borderColor:m.borderColor,color:m.color,boxShadow:"md"},d),{},{children:[(0,h.jsx)(l.In,{as:m.icon,boxSize:"14px",color:g?"yellow.500":"currentColor",flexShrink:0}),(0,h.jsx)(r.EY,{as:"span",children:f})]}))}function m(){const e=(0,a.dj)();return i.useCallback(t=>{if(null===t||void 0===t||!t.meteredCost)return;e.closeAll();const n=window.innerWidth<768;e({position:n?"bottom":"top",duration:5e3,containerStyle:n?{marginBottom:"96px"}:{marginTop:"80px"},render:()=>(0,h.jsx)(r.az,{textAlign:"center",children:(0,h.jsx)(g,(0,o.A)({},t))})})},[e])}},12634:(e,t,n)=>{n.r(t),n.d(t,{default:()=>F});var o=n(24359),s=n(37235),i=n(9950),r=n(46920),l=n(61167),a=n(78309),c=n(13501),d=n(20265),u=(n(42104),n(41397)),h=n(44519),x=n(65319),p=n(4097),g=n(62329),m=n(87023),f=n(62123),j=n(3277),b=n(42992),y=n(37997),v=n(27065),_=n(67818),w=n(29949),S=n(2301),A=n(27257),E=n(77482),k=n(13056),z=n(52209),q=n(86416),C=n(44414);function I(e){const t=(0,c.d4)(d.qm),n=(0,c.wA)(),s=t.selectedPart,{t:r,i18n:l}=(0,_.Bd)(),[E,I]=(0,i.useState)(!1),[Y,T]=(0,i.useState)(!1),[L,W]=(0,i.useState)(!1),R=t.currentQuestionIdx,P=t.userAudios["question_".concat(R)],M=l.language,O=new URLSearchParams(window.location.search).get("qid"),D=(0,y.Z5)({qid:O}),[Q,F]=(0,y.n6)(),$=i.useRef(null);(0,i.useEffect)(()=>{t.isStreaming&&$.current&&$.current.scrollIntoView({behavior:"smooth",block:"start"})},[t.isStreaming]);let U=(0,a.W6)();const[B,H]=(0,i.useState)(!1),{isOpen:N,onOpen:G,onClose:K}=(0,h.j1)(),J=(0,f.dj)();(0,i.useEffect)(()=>{if(L){const e=setTimeout(()=>{W(!1)},3e3);return()=>clearTimeout(e)}},[L]);const[Z,V]=(0,i.useState)(null),[X,ee]=(0,i.useState)(""),[te,ne]=(0,i.useState)(!1),oe=(0,i.useCallback)(e=>{ee("Audio ".concat(e)),ne(!0),setTimeout(()=>ne(!1),2e3)},[]),se=(0,i.useCallback)((0,u.debounce)((e,t)=>((e,t)=>{const n="ielts_ipb_audio_".concat(O,"_").concat(e);(0,q.yI)(n,t,q.hv)&&(V(new Date),oe("saved"))})(e,t),1e3),[O,oe]);(0,i.useEffect)(()=>{var e;if("fulfilled"===D.status&&"success"===(null===(e=D.data)||void 0===e?void 0:e.status)){const e=re();for(let t=0;t<e;t++){const e="ielts_ipb_audio_".concat(O,"_").concat(t),o=localStorage.getItem(e);o&&n((0,d.nA)({data:o,key:"question_".concat(t),audio_name:"LOCAL"}))}for(let t=0;t<e;t++){const e="ielts_ipb_audio_".concat(O,"_").concat(t);if(!localStorage.getItem(e)){n((0,d.wn)(t));break}}}},[D.status,D.data,O,n]);const ie=e=>{T(!0),W(!1);const o="question_".concat(t.currentQuestionIdx);Q({file:e}).then(function(t){if(console.log("response",t),t.data.filename){const s=t.data.filename;n((0,d.nA)({data:e,key:o,audio_name:s})),se(R,e),console.log("User audio uploaded successfully!",t.data),W(!0),J({title:r("audio_uploaded_successfully")||"Audio uploaded successfully",status:"success",duration:2e3,isClosable:!0})}}).catch(function(e){console.log("User audio upload failed.",e),J({title:r("error_audio_save_failed"),status:"error",duration:2e3,isClosable:!0})}).finally(()=>{T(!1)})},re=()=>"fulfilled"===D.status&&"success"==D.data.status?D.data.data.questions.length:0,le=()=>{const e=re();return(0,C.jsx)(o.so,{alignItems:"center",display:e>1?"flex":"none",children:Array.from({length:e},(e,o)=>(0,C.jsx)(x.$n,{ml:"5px",bg:t.userAudios["question_".concat(o)]?"green.400":"grey",color:"white",height:"24px",onClick:()=>{n((0,d.wn)(o))},children:o+1},o+1))})},ae=()=>{const e="1"==s;return(0,C.jsxs)(o.so,{flexDirection:"row",m:5,padding:2,children:[(0,C.jsxs)(o.so,{flexDirection:"column",alignItems:"start",spacing:3,display:e||"2"==s?"flex":"none",children:[(0,C.jsxs)(o.DZ,{size:"md",mb:2,children:[r("topic"),":  ","object"===typeof D.data.data.short_summary[M]&&null!==D.data.data.short_summary[M]?D.data.data.short_summary[M].name:D.data.data.short_summary[M]||D.data.data.short_summary.cn||D.data.data.short_summary.en]}),(0,C.jsxs)(o.so,{alignItems:"center",children:[ce(),(0,C.jsx)(le,{})]})]}),(0,C.jsx)(o.az,{flex:"1"}),(0,C.jsx)(o.ov,{children:(0,C.jsx)(x.$n,{colorScheme:"yellow",rounded:"full",onClick:()=>{n((0,d.TJ)()),U.push("/ielts/speaking")},children:r("exit")})})]})},ce=()=>(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o.az,{ml:"5px",fontSize:"sm",color:"gray.600",display:"1"==s?"block":"none",children:(0,C.jsxs)(o.EY,{children:[" Part 1 Question ",t.currentQuestionIdx+1,"/",re()]})}),(0,C.jsx)(o.az,{ml:"5px",textAlign:"start",fontSize:"sm",color:"gray.600",display:2==s&&t.currentQuestionIdx<1?"block":"none",children:(0,C.jsx)(o.EY,{children:" Part 2 Question 1/1"})}),(0,C.jsx)(o.az,{ml:"5px",textAlign:"start",fontSize:"sm",color:"gray.600",display:2==s&&t.currentQuestionIdx>=1?"block":"none",children:(0,C.jsxs)(o.EY,{children:[" Part 3 Question ",t.currentQuestionIdx,"/",re()-1]})})]}),de=()=>1==t.selectedPart?r("question_text")+" "+(t.currentQuestionIdx+1):0==t.currentQuestionIdx?"Part 2 "+r("question_text"):"Part 3 "+r("question_text")+" "+t.currentQuestionIdx;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o.so,{direction:"column",gap:5,mb:10,children:"fulfilled"===D.status?(()=>{const e=re(),s=!E&&!Y&&R>0,i=!E&&!Y&&R<e-1;return(0,C.jsxs)(C.Fragment,{children:[ae(),(0,C.jsx)(o.ov,{children:(0,C.jsx)(p._V,{src:"/interviewer.png",boxSize:{base:"200px",md:"300px"},objectFit:"cover"})}),(0,C.jsxs)(o.so,{direction:"column",gap:5,mt:5,children:[(0,C.jsx)(o.ov,{children:(0,C.jsxs)(o.rS,{columns:3,columnGap:"25px",rowGap:"20px",children:[(0,C.jsx)(o.ov,{children:(0,C.jsx)(o.EY,{fontWeight:"bold",fontSize:"md",color:"blue.500",children:de()})}),D.data.data.questions[t.currentQuestionIdx].audio&&(0,C.jsx)(o.ov,{children:(0,C.jsx)(v.A,{src:D.data.data.questions[t.currentQuestionIdx].audio,autoPlay:!0,controls:!0})}),D.data.data.questions[t.currentQuestionIdx].audio?(0,C.jsxs)(j.AM,{isOpen:B,onClose:()=>H(!1),closeOnBlur:!1,placement:"top",children:[(0,C.jsx)(j.Wv,{children:(0,C.jsx)(o.ov,{children:(0,C.jsx)(x.$n,{colorScheme:"green",size:"xs",rounded:"full",px:"10px",onClick:()=>H(!0),children:r("transcript")})})}),(0,C.jsxs)(j.hl,{children:[(0,C.jsx)(j.Rp,{}),(0,C.jsx)(j.qR,{}),(0,C.jsx)(j.DI,{children:de()}),(0,C.jsx)(j.ej,{children:(0,C.jsx)("div",{dangerouslySetInnerHTML:{__html:D.data.data.questions[t.currentQuestionIdx].question}})})]})]}):(0,C.jsx)(o.ov,{children:(0,C.jsx)("div",{dangerouslySetInnerHTML:{__html:D.data.data.questions[t.currentQuestionIdx].question}})}),(0,C.jsx)(o.ov,{minHeight:"50px",display:"flex",alignItems:"center",children:(0,C.jsx)(o.EY,{fontWeight:"bold",fontSize:"md",color:"blue.500",visibility:P&&!E?"visible":"hidden",children:r("your_answer")})}),(0,C.jsx)(o.ov,{}),(0,C.jsx)(o.ov,{minHeight:"50px",display:"flex",alignItems:"center",children:(0,C.jsx)(o.az,{visibility:P&&!E?"visible":"hidden",children:P&&!E&&(0,C.jsx)(v.A,{src:P,autoPlay:!0,controls:!0})})})]})}),(0,C.jsx)(o.ov,{children:(0,C.jsxs)(o.az,{minHeight:"60px",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",children:[Y&&(0,C.jsxs)(o.Tk,{spacing:2,children:[(0,C.jsxs)(o.zt,{spacing:2,children:[(0,C.jsx)(g.y,{size:"sm",color:"blue.500"}),(0,C.jsx)(o.EY,{fontSize:"sm",color:"blue.600",fontWeight:"medium",children:r("uploading_audio")||"Uploading audio..."})]}),(0,C.jsx)(o.EY,{fontSize:"xs",color:"gray.500",textAlign:"center",children:r("please_wait_upload")||"Please wait, don't navigate away"})]}),L&&!Y&&(0,C.jsx)(o.Tk,{spacing:1,children:(0,C.jsxs)(o.zt,{spacing:2,children:[(0,C.jsx)(o.az,{w:"16px",h:"16px",bg:"green.500",borderRadius:"full",display:"flex",alignItems:"center",justifyContent:"center",children:(0,C.jsx)(o.EY,{color:"white",fontSize:"xs",fontWeight:"bold",children:"\u2713"})}),(0,C.jsx)(o.EY,{fontSize:"sm",color:"green.600",fontWeight:"medium",children:r("upload_complete")||"Upload complete!"})]})}),(0,C.jsx)(m.zW,{in:te,unmountOnExit:!0,children:(0,C.jsx)(o.EY,{position:"absolute",bottom:"10px",right:"10px",fontSize:"sm",color:"gray.500",bg:"white",px:2,py:1,children:X})})]})}),(0,C.jsx)(o.ov,{children:(0,C.jsxs)(o.so,{flexDirection:"row",children:[(0,C.jsxs)(x.$n,{onClick:()=>n((0,d.wn)(R-1)),isDisabled:!s,colorScheme:"green",rounded:"full",px:"20px",opacity:s?1:.
16,children:[(0,C.jsx)(S.A,{color:"inherit",h:"15px",w:"15px",children:(0,C.jsx)(w.XRr,{})}),(0,C.jsx)(o.EY,{ml:"5px",fontSize:"sm",children:r("previous_question")})]}),(0,C.jsx)(o.az,{m:"5px"}),(0,C.jsx)(z.A,{onLoadEnd:e=>{ie(e),se(R,e)},isDisabled:Y}),(0,C.jsx)(o.az,{m:"5px"}),(0,C.jsx)(b.A,{onAudioSave:e=>{ie(e),se(R,e)},isRecording:E,setIsRecording:I,showRecordingFunctions:!0}),(0,C.jsx)(o.az,{m:"5px"}),(0,C.jsxs)(x.$n,{onClick:()=>n((0,d.wn)(R+1)),isDisabled:!i,colorScheme:"green",rounded:"full",px:"20px",opacity:i?1:.6,children:[(0,C.jsx)(o.EY,{mr:"5px",fontSize:"sm",children:r(Y?"uploading":"next_question")}),(0,C.jsx)(S.A,{color:"inherit",h:"15px",w:"15px",children:(0,C.jsx)(w.CxP,{})})]})]})}),(0,C.jsx)(o.ov,{children:(0,C.jsx)(A.A,{isRecording:E})})]})]})})():(0,C.jsx)(o.EY,{children:" loading"})}),(0,C.jsx)(k.default,{ref:$,userAudios:t.userAudios,questionAnswerList:(()=>{var e,t;return"fulfilled"===D.status&&null!==(e=D.data)&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.questions?D.data.data.questions.map(e=>({question:e.question})):null})()})]})}var Y=n(22951),T=n(21950),L=n(46185);function W(e){const t=(0,c.d4)(d.qm),n=(0,c.wA)(),{t:s,i18n:r}=(t.selectedPart,(0,_.Bd)());let l=t.answerText?t.answerText:"",p=""===l.trim()?0:l.trim().split(/\s+/).length;const g=new URLSearchParams(window.location.search),f=g.get("qid"),j=(0,y.Z5)({qid:g.get("qid")});let b=(0,a.W6)();const[v,w]=(0,i.useState)(!1),{isOpen:S,onOpen:k,onClose:z}=(0,h.j1)(),{isOpen:q,onOpen:I,onClose:W}=(0,h.j1)(),[R,P]=(0,i.useState)(null),[M,O]=(0,i.useState)(""),[D,Q]=(0,i.useState)(!1),F=(0,i.useCallback)(e=>{O("Answer ".concat(e)),Q(!0),setTimeout(()=>Q(!1),2e3)},[]),$=(0,i.useCallback)((0,u.debounce)(e=>(e=>{const t="ielts_ipb_answer_".concat(f);localStorage.setItem(t,e),P(new Date),F("saved")})(e),2e3),[f,F]);(0,i.useEffect)(()=>{const e="ielts_ipb_answer_".concat(f),t=localStorage.getItem(e);t&&(n((0,d.s4)(t)),P(new Date),F("loaded"))},[f,n,F]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(o.so,{direction:"column",gap:5,children:"fulfilled"===j.status?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(o.az,{ml:"15px",mr:"15px",position:"relative",children:[(0,C.jsxs)(o.so,{flexDirection:"row",margin:0,children:[(0,C.jsx)(o.EY,{mt:"10px",fontWeight:600,fontSize:{base:"lg",lg:"xl"},mt:"10px",color:"gray.700",paddingLeft:3,children:s("question_text")}),(0,C.jsx)(o.az,{flex:"1"}),(0,C.jsx)(x.$n,{mb:2,mr:2,size:"sm",variant:"outline",colorScheme:"blue",rightIcon:(0,C.jsx)(T.Kyq,{fontSize:16}),onClick:I,children:s("feedback_button_text","Feedback")}),(0,C.jsx)(x.$n,{mb:2,colorScheme:"yellow",rounded:"full",onClick:()=>{n((0,d.TJ)()),b.push("g/ielts/writing")},children:s("exit")})]}),(0,C.jsx)(o.EY,{textAlign:"justify",whiteSpace:"pre-line",color:"gray.600",px:"20px",fontSize:"md",children:(0,C.jsx)("div",{dangerouslySetInnerHTML:{__html:t.questions[0]}})}),(0,C.jsx)(Y.T,{onChange:e=>{n((0,d.s4)(e.target.value)),$(e.target.value)},value:t.answerText,height:"200px",margin:"10px",spellCheck:"false"}),(0,C.jsxs)(o.EY,{align:"right",color:"grey",p:"0",m:"0",children:["words: ",p]}),(0,C.jsx)(m.zW,{in:D,unmountOnExit:!0,children:(0,C.jsx)(o.EY,{position:"absolute",bottom:"10px",right:"10px",fontSize:"sm",color:"gray.500",bg:"white",px:2,py:1,children:M})})]}),(0,C.jsx)(o.ov,{children:(0,C.jsx)(A.A,{})})]}):(0,C.jsx)(o.EY,{children:" loading "})}),(0,C.jsx)(E.A,{}),(0,C.jsx)(L.A,{isOpen:q,onOpen:I,onClose:W,questionContext:{section:t.section,qid:f,selectedPart:t.selectedPart,genType:t.gen_type}})]})}
1var R=n(89379),P=n(8959),M=n(45655);const O=function(e){let{audioUrl:t,onAudioEnd:n,autoPlay:s=!0,showControls:r=!0,volume:l=.5,playOnce:a=!0,minimal:c=!1,controlRef:d=null}=e;const[u,h]=(0,i.useState)(0),[p,g]=(0,i.useState)(!1),[m,f]=(0,i.useState)(0),[j,b]=(0,i.useState)(0),[y,v]=(0,i.useState)(!0),[_,w]=(0,i.useState)(null),[S,A]=(0,i.useState)(!1),[E,k]=(0,i.useState)(!1),z=(0,i.useRef)(null),q=(0,i.useRef)(!1);(0,i.useEffect)(()=>{if(z.current&&t){g(!1),h(0),b(0),f(0),v(!0),w(null),A(!1),k(!1),console.log("[IeltsAudio] Loading audio:",t),a||(q.current=!1);const e=()=>{console.log("[IeltsAudio] Audio loading started"),v(!0),w(null)},n=()=>{if(s&&z.current&&!p){if(a&&q.current)return;console.log("[IeltsAudio] Attempting auto-play on canplay"),z.current.play().then(()=>{console.log("[IeltsAudio] Audio playback started"),g(!0),A(!1)}).catch(e=>(console.warn("[IeltsAudio] Auto-play failed, trying muted playback:",e),z.current.muted=!0,k(!0),z.current.play().then(()=>{console.log("[IeltsAudio] Muted auto-play started"),g(!0),A(!1)}).catch(e=>{console.warn("[IeltsAudio] Muted auto-play also failed:",e),g(!1),A(!0),z.current.muted=!1,k(!1)})))}};(()=>{if(s&&z.current){if(a&&q.current)return;console.log("[IeltsAudio] Immediate auto-play attempt"),z.current.play().then(()=>{console.log("[IeltsAudio] Immediate auto-play successful"),g(!0),A(!1)}).catch(e=>{console.log("[IeltsAudio] Immediate auto-play failed:",e),A(!0)})}})();const o=()=>{console.log("[IeltsAudio] Audio can play"),v(!1),n()},i=()=>{console.log("[IeltsAudio] Audio data loaded"),v(!1),setTimeout(()=>n(),100)},r=e=>{console.error("[IeltsAudio] Audio loading error:",e),v(!1),w("\u97f3\u9891\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\u6216\u97f3\u9891\u6587\u4ef6")},l=()=>{console.log("[IeltsAudio] Audio metadata loaded"),setTimeout(()=>n(),200)};return z.current.addEventListener("loadstart",e),z.current.addEventListener("canplay",o),z.current.addEventListener("loadeddata",i),z.current.addEventListener("loadedmetadata",l),z.current.addEventListener("error",r),()=>{z.current&&(z.current.removeEventListener("loadstart",e),z.current.removeEventListener("canplay",o),z.current.removeEventListener("loadeddata",i),z.current.removeEventListener("loadedmetadata",l),z.current.removeEventListener("error",r))}}},[t,s,a]),(0,i.useEffect)(()=>{if(z.current)try{z.current.volume=Math.max(0,Math.min(1,null!==l&&void 0!==l?l:.5))}catch(e){}},[l]),(0,i.useEffect)(()=>{if(d)return d.current={play:()=>{if(z.current){if(a&&q.current)return void console.log("[IeltsAudio] playOnce is true and audio has already played, ignoring play");E&&(z.current.muted=!1,k(!1)),z.current.play().then(()=>{g(!0),A(!1)}).catch(()=>{})}},playFromStart:()=>{if(z.current){if(a&&q.current)return void console.log("[IeltsAudio] playOnce is true and audio has already played, ignoring playFromStart");z.current.currentTime=0,E&&(z.current.muted=!1,k(!1)),z.current.play().then(()=>{g(!0),A(!1)}).catch(()=>{})}},pause:()=>{z.current&&(z.current.pause(),g(!1))},setVolume:e=>{if(z.current)try{z.current.volume=Math.max(0,Math.min(1,null!==e&&void 0!==e?e:.5))}catch(t){}}},()=>{d&&(d.current=null)}},[d,E]),(0,i.useEffect)(()=>{if(!s||p||!z.current)return;const e=()=>{z.current&&(S||E)&&(console.log("[IeltsAudio] User interaction detected, attempting to resume/unmute audio"),E&&(z.current.muted=!1,k(!1),console.log("[IeltsAudio] Audio unmuted after user interaction")),S&&z.current.play().then(()=>{console.log("[IeltsAudio] Auto-play successful after user interaction"),g(!0),A(!1)}).catch(e=>{console.log("[IeltsAudio] Auto-play still blocked after user interaction:",e)}))},t=["click","keydown","touchstart","mousemove"];return t.forEach(t=>{document.addEventListener(t,e,{once:!0})}),()=>{t.forEach(t=>{document.removeEventListener(t,e)})}},[s,S,p]),(0,i.useEffect)(()=>{if(s&&t&&z.current){const e=setTimeout(()=>{p||y||!z.current||(console.log("[IeltsAudio] Delayed auto-play attempt after component mount"),z.current.play().then(()=>{console.log("[IeltsAudio] Delayed auto-play successful"),g(!0),A(!1)}).catch(e=>{console.log("[IeltsAudio] Delayed auto-play failed:",e),A(!0)}))},1e3);return()=>clearTimeout(e)}},[s,t,p,y]);const I=()=>
1{if(z.current){const e=z.current.currentTime,t=z.current.duration;if(b(e),t){h(e/t*100)}}},Y=()=>{z.current&&f(z.current.duration)},T=()=>{g(!1),h(100),q.current=!0,n&&n()},L=e=>{const t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))};return t?c?(0,C.jsx)("audio",{src:t,ref:z,onTimeUpdate:I,onLoadedMetadata:Y,onEnded:T,style:{display:"none"}}):(0,C.jsxs)(o.az,{maxWidth:"860px",margin:"auto",padding:"4",bg:"gray.50",borderRadius:"md",mb:"4",children:[(0,C.jsx)("audio",{src:t,ref:z,onTimeUpdate:I,onLoadedMetadata:Y,onEnded:T,style:{display:"none"}}),(0,C.jsxs)(o.az,{children:[(0,C.jsx)(o.EY,{fontSize:"lg",fontWeight:"bold",mb:"3",textAlign:"center",children:"\ud83c\udfa7 IELTS Listening Audio"}),y&&(0,C.jsx)(o.az,{textAlign:"center",mb:"3",children:(0,C.jsx)(o.EY,{fontSize:"sm",color:"blue.600",children:"\u23f3 \u97f3\u9891\u52a0\u8f7d\u4e2d..."})}),_&&(0,C.jsx)(o.az,{textAlign:"center",mb:"3",children:(0,C.jsxs)(o.EY,{fontSize:"sm",color:"red.500",children:["\u274c ",_]})}),S&&s&&(0,C.jsxs)(o.az,{textAlign:"center",mb:"3",bg:"orange.50",p:"3",borderRadius:"md",border:"1px solid",borderColor:"orange.200",children:[(0,C.jsx)(o.EY,{fontSize:"sm",color:"orange.600",fontWeight:"bold",mb:"2",children:"\ud83d\udd0a \u81ea\u52a8\u64ad\u653e\u88ab\u6d4f\u89c8\u5668\u963b\u6b62"}),(0,C.jsx)(o.EY,{fontSize:"xs",color:"orange.500",children:"\u8bf7\u70b9\u51fb\u4e0b\u65b9\u64ad\u653e\u6309\u94ae\u5f00\u59cb\u64ad\u653e\u97f3\u9891"})]}),E&&p&&(0,C.jsxs)(o.az,{textAlign:"center",mb:"3",bg:"yellow.50",p:"3",borderRadius:"md",border:"1px solid",borderColor:"yellow.200",children:[(0,C.jsx)(o.EY,{fontSize:"sm",color:"yellow.600",fontWeight:"bold",mb:"2",children:"\ud83d\udd07 \u97f3\u9891\u6b63\u5728\u9759\u97f3\u64ad\u653e"}),(0,C.jsx)(o.EY,{fontSize:"xs",color:"yellow.500",children:"\u70b9\u51fb\u9875\u9762\u4efb\u610f\u4f4d\u7f6e\u6216\u64ad\u653e\u6309\u94ae\u5373\u53ef\u5f00\u542f\u58f0\u97f3"})]}),(0,C.jsx)(o.az,{mb:"3",children:(0,C.jsx)(P.ke,{value:u,size:"lg",colorScheme:"teal",border:"1px solid",borderColor:"gray.300",width:"100%",borderRadius:"xl",bg:"white"})}),(0,C.jsx)(o.so,{justifyContent:"center",mb:"3",children:(0,C.jsxs)(o.EY,{fontSize:"sm",color:"gray.600",children:[L(j)," / ",L(m)]})}),r&&(0,C.jsxs)(o.so,{justifyContent:"center",gap:"4",children:[(0,C.jsx)(x.$n,{size:"md",colorScheme:"teal",onClick:()=>{z.current&&(p?(z.current.pause(),g(!1)):(E&&(z.current.muted=!1,k(!1)),z.current.play().then(()=>{g(!0),A(!1)}).catch(e=>{console.error("Error playing audio:",e)})))},leftIcon:p?"\u23f8\ufe0f":"\u25b6\ufe0f",children:p?"Pause":"Play"}),(0,C.jsx)(x.$n,{size:"md",variant:"outline",onClick:()=>{z.current&&(z.current.currentTime=0,h(0),b(0),E&&(z.current.muted=!1,k(!1)),p||z.current.play().then(()=>{g(!0),A(!1)}))},leftIcon:(0,C.jsx)(M.Ho,{}),children:"Restart"})]}),(0,C.jsxs)(o.az,{mt:"3",textAlign:"center",children:[(0,C.jsx)(o.EY,{fontSize:"sm",color:"gray.500",children:y?"\u52a0\u8f7d\u4e2d...":_?"\u52a0\u8f7d\u5931\u8d25":S?"\ud83d\udeab \u7b49\u5f85\u7528\u6237\u70b9\u51fb\u64ad\u653e":E&&p?"\ud83d\udd07 \u9759\u97f3\u64ad\u653e\u4e2d...":p?"\ud83c\udfb5 \u64ad\u653e\u4e2d...":"\u23f8\ufe0f \u5df2\u6682\u505c"}),s&&!p&&!y&&!_&&!S&&(0,C.jsx)(o.EY,{fontSize:"xs",color:"green.500",mt:"1",children:"\u2705 \u97f3\u9891\u5df2\u51c6\u5907\u5c31\u7eea\uff0c\u81ea\u52a8\u64ad\u653e\u5df2\u5f00\u59cb"})]})]})]}):null};function D(){var e,t;(0,c.wA)(),(0,a.W6)();const{t:n}=(0,_.Bd)(),{qid:s}=(0,a.g)(),r=(0,c.d4)(d.qm),[l,u]=(0,i.useState)(""),[h,p]=(0,i.useState)({}),[g,m]=(0,i.useState)(!1),f=(0,y.Z5)({qid:s||r.qid},{skip:!s&&!r.qid}),j=null===f||void 0===f||null===(e=f.data)||void 0===e?void 0:e.data,b=(null===j||void 0===j||null===(t=j.question)||void 0===t?void 0:t.questions)||[];(0,i.useEffect)(()=>{var e;null!==j&&void 0!==j&&null!==(e=j.question)&&void 0!==e&&e.audio_files&&j.question.audio_files.length>0?u(j.question.audio_files[0].url):null!==j&&void 0!==j&&j.audio&&j.audio.length>0?u(j.audio[0].url):null!==j&&void 0!==j&&j.listening_audio&&u(j.listening_audio)},[j]);const v=(e,t)=>
1{p(n=>(0,R.A)((0,R.A)({},n),{},{[e]:t}))};(0,i.useEffect)(()=>(window.handleMatchingAnswer=(e,t)=>{v(e,t)},()=>{delete window.handleMatchingAnswer}),[]);return f.isLoading?(0,C.jsx)(o.az,{p:4,children:(0,C.jsx)(o.EY,{children:"Loading..."})}):f.error||!j?(0,C.jsx)(o.az,{p:4,children:(0,C.jsx)(o.EY,{children:"Error loading question"})}):(0,C.jsxs)(o.so,{direction:"column",w:"100%",p:4,children:[(0,C.jsxs)(o.az,{mb:4,children:[(0,C.jsx)(o.EY,{fontSize:"2xl",fontWeight:"bold",color:"teal.600",children:n("ielts_listening")}),(0,C.jsxs)(o.EY,{fontSize:"sm",color:"gray.600",children:["Section ",r.selectedPart," of 4"]})]}),l&&(0,C.jsx)(O,{audioUrl:l,onAudioEnd:()=>{m(!0)},autoPlay:!0,showControls:!0}),!g&&(0,C.jsxs)(o.az,{mt:4,p:4,bg:"blue.50",borderRadius:"md",children:[(0,C.jsx)(o.EY,{fontSize:"md",color:"blue.800",children:'\ud83c\udfa7 Listen to the audio carefully. Questions will appear after the audio finishes, but you can also click "Show Questions" below to see them while listening.'}),(0,C.jsx)(x.$n,{mt:3,size:"sm",colorScheme:"blue",variant:"outline",onClick:()=>m(!0),children:"Show Questions Now"})]}),g&&(0,C.jsxs)(o.az,{mt:4,children:[(0,C.jsx)(o.cG,{mb:4}),(0,C.jsx)(o.EY,{fontSize:"lg",fontWeight:"bold",mb:4,children:"\ud83d\udcdd Questions"}),j.question_text&&(0,C.jsx)(o.az,{mb:4,p:3,bg:"gray.50",borderRadius:"md",children:(0,C.jsx)(o.EY,{fontSize:"sm",whiteSpace:"pre-wrap",children:j.question_text})}),(0,C.jsx)(o.Tk,{spacing:4,align:"stretch",children:b.map((e,t)=>((e,t)=>{var s;const i=e.questions||[],r=null===(s=i[0])||void 0===s?void 0:s.type;if("multiple_choice_sub"===r)return(0,C.jsxs)(o.Tk,{align:"start",spacing:4,children:[(0,C.jsx)(o.EY,{fontWeight:"bold",dangerouslySetInnerHTML:{__html:e.description}}),i.map((e,n)=>{var s;return(0,C.jsxs)(o.Tk,{align:"start",spacing:2,pl:4,children:[(0,C.jsxs)(o.EY,{fontWeight:"medium",fontSize:"sm",children:["Question ",e.question_number]}),(0,C.jsx)(o.EY,{dangerouslySetInnerHTML:{__html:e.question_text}}),null===(s=e.options)||void 0===s?void 0:s.map((e,o)=>(0,C.jsx)(x.$n,{variant:h["".concat(t,"_").concat(n)]===e.split(".")[0]?"solid":"outline",colorScheme:h["".concat(t,"_").concat(n)]===e.split(".")[0]?"teal":"gray",size:"sm",onClick:()=>v("".concat(t,"_").concat(n),e.split(".")[0]),textAlign:"left",justifyContent:"start",w:"full",children:e},o))]},n)})]},t);if("matching_choice"===r){var l;const n=i[0];return(0,C.jsxs)(o.Tk,{align:"start",spacing:4,children:[(0,C.jsx)(o.EY,{fontWeight:"bold",dangerouslySetInnerHTML:{__html:e.description}}),(0,C.jsxs)(o.az,{p:4,bg:"gray.50",borderRadius:"md",border:"1px solid",borderColor:"gray.300",children:[(0,C.jsx)(o.EY,{fontWeight:"medium",mb:2,children:"Options:"}),(0,C.jsx)(o.Tk,{align:"start",spacing:1,children:null===(l=n.options)||void 0===l?void 0:l.map((e,t)=>(0,C.jsx)(o.EY,{fontSize:"sm",children:e},t))})]}),(0,C.jsx)(o.az,{dangerouslySetInnerHTML:{__html:n.question_text.replace(/<input[^>]*placeholder="(\d+)"[^>]*sccode="([^"]*)"[^>]*\/>/g,'<input type="text" placeholder="Enter letter (A-I)" \n                         style="width: 60px; padding: 4px 8px; margin: 0 4px; border: 1px solid #E2E8F0; border-radius: 4px; display: inline-block;"\n                         data-question-key="'.concat(t,'_$1" \n                         onchange="window.handleMatchingAnswer && window.handleMatchingAnswer(\'').concat(t,"_$1', this.value)\" />"))}})]},t)}if("201"===r){var a;const e=i[0];return(0,C.jsxs)(o.Tk,{align:"start",spacing:2,children:[(0,C.jsxs)(o.EY,{fontWeight:"medium",fontSize:"sm",children:["Question ",e.question_number]}),(0,C.jsx)(o.EY,{dangerouslySetInnerHTML:{__html:e.question_text}}),null===(a=e.options)||void 0===a?void 0:a.map((e,n)=>(0,C.jsx)(x.$n,{variant:h[t]===e.split(".")[0]?"solid":"outline",colorScheme:h[t]===e.split(".")[0]?"teal":"gray",size:"sm",onClick:()=>v(t,e.split(".")[0]),textAlign:"left",justifyContent:"start",w:"full",children:e},n))]},t)}var c;return(0,C.jsxs)(o.Tk,{align:"start",spacing:2,children:[(0,C.jsx)(o.EY,{fontWeight:"medium",children:null===(c=i[0])||void 0===c?void 0:c.question}),(0,C.jsx)("input",{type:"text",value:h[t]||"",onChange:e=>v(t,e.target.value),placeholder:n("enter_your_answer"),style:{width:"100%",padding:"8px 12px",border:"1px solid #E2E8F0",borderRadius:"6px",fontSize:"14px"}})]},t)})(e,t))}),(0,C.jsxs)(o.az,{mt:6,children:[(0,C.jsx)(o.cG,{mb:4}),(0,C.jsxs)(o.zt,{children:[(0,C.jsx)(o.hK,{}),(0,C.jsx)(A.A,{onSubmit:async()=>{const e=Object.entries(h).map(e=>{var t;let[n,o]=e;return{question:(null===(t=b[n])||void 0===t?void 0:t.question)||"",answer:o||""}});console.log("Submitting answers:",e)},isDisabled:0===Object.keys(h).length})]})]})]})]})}function Q(){var e;(0,c.wA)(),(0,a.W6)();const{t:t}=(0,_.Bd)(),{qid:n}=(0,a.g)(),s=(0,c.d4)(d.qm),[r,l]=(0,i.useState)({}
1),u=(0,y.Z5)({qid:n||s.qid},{skip:!n&&!s.qid}),h=null===u||void 0===u||null===(e=u.data)||void 0===e?void 0:e.data,p=(null===h||void 0===h?void 0:h.questions)||[],g=(e,t)=>{l(n=>(0,R.A)((0,R.A)({},n),{},{[e]:t}))};return u.isLoading?(0,C.jsx)(o.az,{p:4,children:(0,C.jsx)(o.EY,{children:"Loading..."})}):u.error||!h?(0,C.jsx)(o.az,{p:4,children:(0,C.jsx)(o.EY,{children:"Error loading question"})}):(0,C.jsxs)(o.so,{direction:"column",w:"100%",children:[(0,C.jsxs)(o.az,{mb:4,children:[(0,C.jsx)(o.EY,{fontSize:"2xl",fontWeight:"bold",color:"teal.600",children:t("ielts_reading")}),(0,C.jsxs)(o.EY,{fontSize:"sm",color:"gray.600",children:["Passage ",s.selectedPart," of 3"]})]}),h.reading_text&&(0,C.jsxs)(o.az,{mb:6,p:4,bg:"gray.50",borderRadius:"md",maxH:"400px",overflowY:"auto",children:[(0,C.jsx)(o.EY,{fontSize:"lg",fontWeight:"bold",mb:3,children:"\ud83d\udcd6 Reading Passage"}),(0,C.jsx)(o.EY,{fontSize:"sm",lineHeight:"tall",whiteSpace:"pre-wrap",children:h.reading_text})]}),(0,C.jsx)(o.cG,{mb:4}),(0,C.jsxs)(o.az,{children:[(0,C.jsx)(o.EY,{fontSize:"lg",fontWeight:"bold",mb:4,children:"\ud83d\udcdd Questions"}),h.question_text&&h.question_text!==h.reading_text&&(0,C.jsx)(o.az,{mb:4,p:3,bg:"blue.50",borderRadius:"md",children:(0,C.jsx)(o.EY,{fontSize:"sm",whiteSpace:"pre-wrap",children:h.question_text})}),(0,C.jsx)(o.Tk,{spacing:4,align:"stretch",children:p.map((e,n)=>((e,n)=>{const s=e.question_type||"fill_in_blank";var i;if("multiple_choice"===s)return(0,C.jsxs)(o.Tk,{align:"start",spacing:2,children:[(0,C.jsx)(o.EY,{fontWeight:"medium",children:e.question}),null===(i=e.choices)||void 0===i?void 0:i.map((e,t)=>(0,C.jsx)(x.$n,{variant:r[n]===e?"solid":"outline",colorScheme:r[n]===e?"teal":"gray",size:"sm",onClick:()=>g(n,e),textAlign:"left",justifyContent:"start",w:"full",children:e},t))]},n);if("true_false_not_given"===s){const t=["True","False","Not Given"];return(0,C.jsxs)(o.Tk,{align:"start",spacing:2,children:[(0,C.jsx)(o.EY,{fontWeight:"medium",children:e.question}),(0,C.jsx)(o.zt,{spacing:3,children:t.map(e=>(0,C.jsx)(x.$n,{variant:r[n]===e?"solid":"outline",colorScheme:r[n]===e?"teal":"gray",size:"sm",onClick:()=>g(n,e),children:e},e))})]},n)}return(0,C.jsxs)(o.Tk,{align:"start",spacing:2,children:[(0,C.jsx)(o.EY,{fontWeight:"medium",children:e.question}),(0,C.jsx)("input",{type:"text",value:r[n]||"",onChange:e=>g(n,e.target.value),placeholder:t("enter_your_answer"),style:{width:"100%",padding:"8px 12px",border:"1px solid #E2E8F0",borderRadius:"6px",fontSize:"14px"}})]},n)})(e,n))}),(0,C.jsxs)(o.az,{mt:6,children:[(0,C.jsx)(o.cG,{mb:4}),(0,C.jsxs)(o.zt,{children:[(0,C.jsx)(o.hK,{}),(0,C.jsx)(A.A,{onSubmit:async()=>{const e=Object.entries(r).map(e=>{var t;let[n,o]=e;return{question:(null===(t=p[n])||void 0===t?void 0:t.question)||"",answer:o||""}});console.log("Submitting reading answers:",e)},isDisabled:0===Object.keys(r).length})]})]})]})]})}function F(e){const t=(0,c.d4)(d.qm),n="reading"===t.section,u="listening"===t.section,h="speaking"===t.section,x="writing"===t.section;let p=(0,a.W6)();return(0,i.useEffect)(()=>{console.log("load ipbs"),l.A.getCurrentUser()||p.push("/login")},[]),(0,C.jsx)(o.so,{flexDirection:"column",pt:"80px",children:(0,C.jsxs)(o.xA,{templateColumns:{sm:"1fr",lg:"4fr 1fr"},templateRows:{lg:"repeat(2, auto)"},gap:"20px",children:[(0,C.jsxs)(s.A,{overflowX:{sm:"scroll",xl:"hidden"},width:"100%",p:{base:"0px",xs:"22px"},py:"22px",children:[n&&(0,C.jsx)(Q,{}),u&&(0,C.jsx)(D,{}),h&&(0,C.jsx)(I,{}),x&&(0,C.jsx)(W,{})]}),(0,C.jsx)(r.b,{})]})})}},27065:(e,t,n)=>{n.d(t,{A:()=>l});var o=n(9950),s=n(24359),i=n(29949),r=(n(2301),n(44414));const l=function(e){let{src:t}=e;const[n,l]=(0,o.useState)(!1),a=o.useRef(null),[c,d]=o.useState(0),[u,h]=o.useState(0);return(0,r.jsxs)(s.so,{p:2,direction:"row",align:"center",spacing:4,children:[(0,r.jsx)("audio",{ref:a,src:t,onLoadedMetadata:()=>{a.current&&d(a.current.duration)},onTimeUpdate:()=>{a.current&&h(a.current.currentTime)},onEnded:()=>{l(!1)}}),(0,r.jsx)(s.az,{color:"blue.500",width:"35px",onClick:()=>{a.current&&(n?a.current.pause():a.current.play(),l(!n))},_hover:{color:"blue.300",cursor:"pointer"},children:n?(0,r.jsx)(i.c8T,{size:"lg",color:"inherit"}):(0,r.jsx)(i.Qpr,{size:"lg",color:"inherit"})})]})}},27257:(e,t,n)=>{n.d(t,{A:()=>v});var o=n(9950),s=(n(42104),n(43239)),i=n(44519),r=n(65319),l=n(40815),a=n(24359),c=n(44143),d=n(20265),u=n(67818),h=n(13501),x=n(37997),p=n(61167),g=n(74925),m=n(36981),f=n(89992),j=n(26605),b=n(690),y=n(44414);function v(e){const{t:t,i18n:n}=(0,u.Bd)(),v=(0,h.d4)(d.qm),_=(0,h.wA)(),[w,S]=(v.currentQuestionIdx,(0,x.Jt)());let A=(0,x.Pj)({}),E=(0,x.K6)({});const k=(0,m.k)(E),z=o.useRef(),[q,C]=o.useState(!1),[I,Y]=(0,x.xK)(),{isOpen:T,onOpen:L,onClose:W}=(0,i.j1)(),{isOpen:R,onOpen:P,onClose:M}=(0,i.j1)(),O="writing"===v.section?"iwriting_task".concat(v.selectedPart):1===v.selectedPart?"ispeaking_part1":"ispeaking_part2_3",D=(0,j.YK)(A.data,p.A.getCurrentUser()),Q=(0,f._U)(A.data,O,200,D),F=(0,b.J)(),$=()=>{if("speaking"==v.section){const e=(()=>{const e=Object.keys(v.userAudios),t=[],n=[],o=[];for(let i=0;i<e.length;i++){let s=e[i],r=v.userAudios[s],l=parseInt(s.match(/[0-9]+/)[0],10);t.push(v.questions[l]),n.push(r),v.userAudioNames[s]&&o.push(v.userAudioNames[s])}const s={questions:t};return o.length>0?s.audio_names=o:s.audios=n,s})();if(1===v.selectedPart){return{project:"ielts",type:"ispeaking_part1",questions:e.questions,audios:e.audios,audio_names:e.audio_names,qid:v.qid}}if(2===v.selectedPart){return{project:"ielts",type:"ispeaking_part2_3",questions:e.questions,audios:e.audios,audio_names:e.audio_names,qid:v.qid}}}else if("writing"==v.section){if(1===v.selectedPart){const e=v.questions[0];let t=null,n=e;if(e){const o=e.match(/<img[^>]+src="([^">]+)"/);o&&(t=o[1],n=e.replace(/<img[^>]+>/g,""))}const o={project:"ielts",type:"iwriting_task1",topic:n,content:v.answerText,qid:v.qid};return t&&(o.image=t),o}if(2===v.selectedPart){return{project:"ielts",type:"iwriting_task2",topic:v.questions[0],content:v.answerText,qid:v.qid}}}},U=()=>"speaking"==v.section?"shouldSilence_ispeaking_"+v.selectedPart:"writing"==v.section?"shouldSilence_iwriting_"+v.selectedPart:null,B=()=>
1{if(0===Q)return!1;if("fulfilled"!==A.status)return!0;if(null===k||k<=Q)return!0;const e=U();return!(e in A.data)||!A.data[e]},H=()=>{if(console.log("ielts submitting"),_((0,d.e0)(!0)),g.A.track("Submit Button Click",{project:"ielts",section:v.section,selectedPart:v.selectedPart,qid:v.qid}),B()&&q){let e={};e[U()]=!0,w(e).then(e=>e.json()).then(e=>{console.log(e)}).catch(console.error)}const e=$();if(!e)return;_((0,d.sx)(!0));let t=Math.floor(Date.now());e.authorization=p.A.getCurrentUser().token,e.lang=n.language;let o="https://ws.lingoleap.ai";o=o.replace("https://","wss://").replace("http://","ws://"),o+="/api/generate_ws";const s=new WebSocket(o);s.onopen=t=>{s.send(JSON.stringify(e))},s.onmessage=function(e){let n=JSON.parse(e.data);n&&"c"in n&&_((0,d.le)(n.c)),"data"===n.t?_((0,d.OK)(n)):"metadata"===n.t?(_((0,d.p4)(n.c)),I({type:"start_streaming",start_time:t/1e3,duration:(Math.floor(Date.now())-t)/1e3,gid:n.c.gid}).then(function(e){})):"error"===n.t&&_((0,d.Kg)(n))},s.onclose=function(e){_((0,d.sx)(!1)),_({type:"".concat(x.pn.reducerPath,"/invalidateTags"),payload:["History"]}),I({type:"finish_streaming",start_time:t/1e3,duration:(Math.floor(Date.now())-t)/1e3}).then(function(e){})},s.onerror=function(e){console.log("WebSocket error: ",e),I({type:"error_streaming",start_time:t/1e3,duration:(Math.floor(Date.now())-t)/1e3,error:e}).then(function(e){})}};return(0,y.jsxs)(r.$n,{onClick:()=>{var e;null===k&&Q>0?null===(e=E.refetch)||void 0===e||e.call(E):(null!==k&&void 0!==k?k:0)<Q?L():B()?P():(F({meteredCost:200,cost:Q}),H())},colorScheme:"yellow",rounded:"full",minWidth:"180px",display:("speaking"===v.section?Object.keys(v.userAudios).length!=v.questions.length||e.isRecording:"writing"!==v.section)?"none":"block",children:[t("grading"),(0,y.jsx)(l.Lt,{isOpen:R,leastDestructiveRef:z,onClose:M,children:(0,y.jsx)(l.LA,{children:(0,y.jsxs)(l.EO,{children:[(0,y.jsx)(l.wd,{fontSize:"lg",fontWeight:"bold",children:t("kind_notice")}),(0,y.jsxs)(l.vZ,{children:[(0,y.jsxs)(a.EY,{children:[t("this_will_cost")," ",Q,t("credit")]}),(0,y.jsx)(a.EY,{fontSize:"sm",style:{color:"#2e8ae6",fontWeight:"bold"},children:(0,y.jsx)("a",{href:"/purchase?source=submit_credits_notice",children:t("membership_plans")})}),(0,y.jsx)(c.Sc,{isChecked:q,onChange:e=>C(e.target.checked),children:t("dont_remind_me_again")})]}),(0,y.jsxs)(l.ck,{children:[(0,y.jsx)(r.$n,{ref:z,onClick:M,children:t("cancel")}),(0,y.jsx)(r.$n,{colorScheme:"green",onClick:()=>{M(),H()},ml:3,children:t("continue")})]})]})})}),(0,y.jsx)(s.A,{isOpen:T,onClose:W})]})}},36981:(e,t,n)=>{n.d(t,{k:()=>o});const o=e=>{var t;if("fulfilled"!==(null===e||void 0===e?void 0:e.status))return null;const n=null===(t=e.data)||void 0===t?void 0:t.balance;if(null===n||void 0===n||""===n)return null;const o=Number(n);return Number.isFinite(o)?o:null}},42992:(e,t,n)=>{n.d(t,{A:()=>x});var o=n(9950),s=n(62123),i=n(65319),r=n(24359),l=n(88119),a=n(67818);const c=e=>" "+Math.floor(e/60)+":"+String(e%60).padStart(2,"0");var d=n(22875),u=n(99319),h=n(44414);const x=function(e){let{onAudioSave:t,isRecording:n,setIsRecording:x,showRecordingFunctions:p}=e;const[g,m]=(0,o.useState)(null),[f,j]=(0,o.useState)(0),[b,y]=(0,o.useState)(null),{t:v,i18n:_}=(0,a.Bd)(),w=(0,s.dj)();return(0,h.jsx)(i.$n,{fontSize:"sm",rounded:"full",bg:"blue.400",color:"white",_hover:{bg:"blue.500"},_focus:{bg:"blue.500"},minWidth:120,maxWidth:120,onClick:()=>{"MediaRecorder"in window?n?(g&&g.stop(),x(!1),b&&clearInterval(b)):navigator.mediaDevices.getUserMedia({audio:!0}).then(e=>{const n=new MediaRecorder(e);m(n);const o=[];n.addEventListener("dataavailable",e=>{e.data&&e.data.size>0&&o.push(e.data)}),n.addEventListener("stop",()=>{try{var e;const s=(null===(e=o[0])||void 0===e?void 0:e.type)||"audio/webm;codecs=opus",i=new Blob(o,{type:s}),r=new File([i],"recorded_audio.webm",{type:i.type}),l=new FileReader;l.readAsDataURL(r),l.onloadend=()=>{t(l.result);try{n.stream.getTracks().forEach(e=>e.stop())}catch(e){}m(null)}}catch(s){console.log("Finalize recording failed:",s);try{n.stream.getTracks().forEach(e=>e.stop())}catch(i){}m(null)}}),n.start(1e3),x(!0),j(0);const s=setInterval(()=>{j(e=>e+1)},1e3);y(s)}).catch(e=>{const t=(0,u.R0)();let n="Please allow microphone access";"iOS"===t&&(n="Please go to Settings and allow microphone access for this app"),w({title:"Unable to access the microphone",description:n,status:"error",duration:9e3,isClosable:!0}),console.log("Error in obtaining media stream: ",e.message,t)}):alert("The MediaRecorder API is not supported in your browser.")},display:p?"block":"none",children:(0,h.jsx)(r.ov,{children:(0,h.jsxs)(r.so,{children:[(0,h.jsx)(r.ov,{children:(0,h.jsx)(l.In,{as:d.i0t,w:"17px",h:"17px",mr:"5px"})}),(0,h.jsx)(r.ov,{children:n?v("stop_record")+c(f):v("answer")})]})})})}},52209:(e,t,n)=>{n.d(t,{A:()=>x});var o=n(89379),s=n(80045),i=n(9950),r=(n(42104),n(65319)),l=n(24359),a=n(88119),c=n(67818),d=n(16339),u=n(44414);const h=["isCorpusGeneration","onLoadEnd","isDisabled"];function x(e){var{isCorpusGeneration:t,onLoadEnd:n,isDisabled:x}=e,p=(0,s.A)(e,h);const{t:g,i18n:m}=(0,c.Bd)(),f=i.useMemo(()=>"fileInput_".concat(Math.random().toString(36).substr(2,9)),[]);return(0,u.jsxs)(r.$n,(0,o.A)((0,o.A)({fontSize:"sm",rounded:"full",bg:"blue.400",color:"white",_hover:{bg:"blue.500"},_focus:{bg:"blue.500"},minWidth:120,onClick:()=>
1{if(!x){document.getElementById(f).click()}},isDisabled:x},p),{},{children:[(0,u.jsx)("input",{id:f,type:"file",accept:".m4a,audio/*",onChange:e=>{const t=new FileReader;let o=e.target.files[0];o&&(t.readAsDataURL(o),o.size>5e6&&alert("Audio file needs to be < 5M. Consider convert the audio to mp3 or other formats."),t.onloadend=async()=>{n(t.result)})},rounded:"full",style:{display:"none"}}),(0,u.jsx)(l.ov,{children:(0,u.jsxs)(l.so,{children:[(0,u.jsx)(l.ov,{children:(0,u.jsx)(a.In,{as:d.B88,w:"17px",h:"17px",mr:"5px"})}),(0,u.jsx)(l.ov,{children:g("upload_recording")})]})})]}))}},77482:(e,t,n)=>{n.d(t,{A:()=>w});var o=n(9950),s=n(87661),i=n(60452),r=n(24359),l=n(62329),a=n(65319),c=n(13501),d=n(20265),u=n(7859),h=n(63528),x=n.n(h),p=n(37997),g=n(56932),m=n(67818),f=n(52152),j=n(34311),b=n(81829),y=n(45655),v=n(11036),_=n(44414);function w(e){var t;const{t:h,i18n:w}=(0,m.Bd)(),S=(0,c.d4)(d.qm),A=(0,c.d4)(d.vw),E=(0,o.useRef)(null),k=S.shouldShowMarkdown||S.isStreaming;if("Duplicate"===(null===S||void 0===S?void 0:S.content))return(0,_.jsx)(r.az,{height:"7rem",backgroundColor:"gray.100",display:"flex",textAlign:"center",alignItems:"center",borderRadius:"2xl",justifyContent:"center",px:4,children:(0,_.jsx)(r.EY,{children:"We're working on a duplicate request you recently submitted. The evaluation result will be available under the history tab. Thank you for your patience!"})});const z=S.isStreaming,q="undefined"!==typeof window&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.includes("localhost"));(0,o.useEffect)(()=>{q&&!z&&A.result&&(console.log("=== IELTS Final Assembled Raw Markdown ==="),console.log(A.result),console.log("=== End of Markdown ==="))},[z,A.result,q]);let C=(0,p.s7)({gid:S.gid},{skip:!k||z||"writing"===S.section});const I=()=>"fulfilled"===C.status&&"speaking_question_answer_list"in C.data?C.data.speaking_question_answer_list:[],Y=k&&!z&&!S.hasStreamingError&&"speaking"===S.section&&"fulfilled"===C.status,T=null===(t=S.gen_type)||void 0===t?void 0:t.endsWith("_generation");(0,o.useEffect)(()=>{q&&console.log("isGenerationTask:",T)},[T,q]);let L="";L="cn"==w.language?"https://lingoleap.ai/zh/read/how-is-the-ielts-score-calculated-2/":"https://lingoleap.ai/read/how-is-the-ielts-score-calculated/";return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(r.az,{ml:5,mr:5,mt:10,p:5,bg:"gray.200",borderRadius:20,display:k?"block":"none",ref:E,children:[(0,_.jsx)(r.ov,{display:z?"block":"none",children:(0,_.jsx)(r.EY,{fontWeight:"bold",children:h("streaming_reminder")})}),(0,_.jsx)(s.$,{children:A.result?A.result:"",remarkPlugins:[i.A],rehypePlugins:[u.A],className:"ll-markdown",components:j.A}),(0,_.jsx)(r.ov,{children:(0,_.jsx)(l.y,{thickness:"4px",speed:"0.65s",emptyColor:"gray.200",color:"blue.500",size:"lg",mt:"20px",display:z?"block":"none"})}),(0,_.jsxs)(r.ov,{display:Y?"block":"none",children:[(0,_.jsx)(r.EY,{fontWeight:"bold",children:h("example_answers")}),T?(0,_.jsx)(r.Tk,{spacing:4,align:"start",children:I().map((e,t)=>{const n=e.example_audio_url||e.user_audio_url;return n&&(0,_.jsx)(x(),{src:n,controls:!0},t)})}):(0,_.jsx)(b.k,{data:I()})]}),(0,_.jsxs)(r.az,{mt:4,display:z?"none":"flex",justifyContent:"space-between",alignItems:"center",children:[(0,_.jsxs)(r.N_,{color:"blue.500",fontWeight:"bold",fontSize:"sm",href:L,isExternal:!0,children:["\u24d8 ",h("response_scoring_rubrics")]}),(0,_.jsx)(a.$n,{variant:"ghost",size:"sm",leftIcon:(0,_.jsx)(y.s3,{}),onClick:()=>{const e=E.current.cloneNode(!0);e.querySelectorAll(".pdf-exclude").forEach(e=>e.remove());const t=document.createElement("div");t.style.textAlign="center",t.style.marginBottom="20px";const o=document.createElement("img");o.src=v,o.style.height="50px",t.appendChild(o),e.insertBefore(t,e.firstChild);const s=(new Date).toISOString().split("T")[0],i={margin:1,filename:"Lingoleap_".concat(s,".pdf"),image:{type:"jpeg",quality:.98},html2canvas:{scale:2},jsPDF:{unit:"in",format:"letter",orientation:"portrait"}};n.e(7307).then(n.t.bind(n,87307,23)).then(t=>{let{default:n}=t;return n().set(i).from(e).save()})},display:A.result&&!z?"block":"none",children:h("download_pdf")})]}),(0,_.jsx)(r.ov,{mt:"10px",className:"pdf-exclude",children:(0,_.jsx)(f.n,{visible:S.shouldShowMarkdown&&!S.isStreaming,gid:S.gid})}),(0,_.jsx)(r.ov,{className:"pdf-exclude",children:(0,_.jsx)(r.az,{mt:10,p:5,bg:"gray.100",borderRadius:20,width:"full",display:S.shouldShowMarkdown&&!z?"block":"none",children:(0,_.jsxs)(r.Tk,{children:[(0,_.jsx)(r.EY,{as:"h3",fontSize:"md",children:h("your_santisfication_rate")}),(0,_.jsx)(g.A,{gid:S.gid,qid:S.qid,questionMeta:{test:"ielts",section:S.section,selectedPart:S.selectedPart,genType:S.gen_type}})]})})})]})})}}
1,81829:(e,t,n)=>{n.d(t,{k:()=>l});n(9950);var o=n(67818),s=n(24359),i=n(27065),r=n(44414);function l(e){const{t:t,i18n:n}=(0,o.Bd)();return(0,r.jsx)(s.az,{p:"20px",children:e.data.map((e,t)=>{const n=e.example_audio_url||e.user_audio_url,o=e.revised_answer||e.answer;return(0,r.jsxs)(s.so,{flexDirection:"column",mb:"24px",children:[(0,r.jsx)(s.EY,{fontSize:"md",color:"black",children:"".concat(t+1,". ").concat(e.question)}),n&&(0,r.jsx)(s.so,{ml:"10px",alignItems:"center",mb:"4px",children:(0,r.jsx)(i.A,{src:n})}),(0,r.jsx)(s.EY,{ml:"10px",children:o})]},t)})})}}}]);

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.