1"use strict";(self.webpackChunkgetyouhire=self.webpackChunkgetyouhire||[]).push([[8953],{574:(e,t,r)=>{r.d(t,{Tm:()=>i,g:()=>n,ti:()=>s});let a=null;function s(e){return a=e,()=>{a=null}}function i(e){a&&a(e)}function n(e){if(!e)return!1;const t=(e instanceof Error?e.message:"")||("string"===typeof e?e:"")||("string"===typeof(null===e||void 0===e?void 0:e.error)?e.error:"");return t.includes("free AI request limit")||t.includes("Upgrade to Pro")||403===(null===e||void 0===e?void 0:e.status)}},2180:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var a=r(5043),s=r(1318),i=r(1009),n=r(2308),l=r(3546),o=r(3768),d=r(3003),c=r(6391),m=r(2998),u=r(9066),x=r(8472),p=r(574),h=r(6652),g=r(3710),b=r(4015),f=r(851),y=r(3174);function w(e,t,r){for(let a=0;a<r.length;a++)e.setUint8(t+a,r.charCodeAt(a))}async function k(e){const t=await e.arrayBuffer(),r=new AudioContext;try{return function(e){const t=e.numberOfChannels,r=e.sampleRate,a=2*t,s=e.length,i=s*a,n=new ArrayBuffer(44+i),l=new DataView(n);w(l,0,"RIFF"),l.setUint32(4,36+i,!0),w(l,8,"WAVE"),w(l,12,"fmt "),l.setUint32(16,16,!0),l.setUint16(20,1,!0),l.setUint16(22,t,!0),l.setUint32(24,r,!0),l.setUint32(28,r*a,!0),l.setUint16(32,a,!0),l.setUint16(34,16,!0),w(l,36,"data"),l.setUint32(40,i,!0);const o=[];for(let c=0;c<t;c++)o.push(e.getChannelData(c));let d=44;for(let c=0;c<s;c++)for(let e=0;e<t;e++){const t=Math.max(-1,Math.min(1,o[e][c]));l.setInt16(d,t<0?32768*t:32767*t,!0),d+=2}return new Blob([n],{type:"audio/wav"})}(await r.decodeAudioData(t.slice(0)))}finally{await r.close()}}const v={n:0};function j(){try{const e=window.speechSynthesis;if(!e)return;e.resume();const t=new SpeechSynthesisUtterance(" ");t.volume=0,t.rate=2,e.speak(t)}catch{}}function N(){v.n+=1;try{const e=window.speechSynthesis;if(!e)return;e.pause(),e.cancel()}catch{}}const S="Google US English";function C(e,t,r){const a=e.replace(/\s+/g," ").trim();return a?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;const t=window.speechSynthesis;return!t||t.getVoices().length>0?Promise.resolve():new Promise((r=>{let a=!1;const s=()=>{a||(a=!0,t.removeEventListener("voiceschanged",i),r())},i=()=>{t.getVoices().length>0&&s()};t.addEventListener("voiceschanged",i),window.setTimeout(s,e);try{t.getVoices()}catch{s()}}))}().then((()=>new Promise((e=>{var s,i,n;if(void 0!==r&&v.n!==r)return void e();const l=window.speechSynthesis;if(!l)return void e();l.pause(),l.cancel();try{l.resume()}catch{}if(void 0!==r&&v.n!==r)return void e();const o=new SpeechSynthesisUtterance(a);if(o.rate=null!==(s=null===t||void 0===t?void 0:t.rate)&&void 0!==s?s:.96,o.pitch=null!==(i=null===t||void 0===t?void 0:t.pitch)&&void 0!==i?i:1.02,o.volume=null!==(n=null===t||void 0===t?void 0:t.volume)&&void 0!==n?n:1,t&&"voice"in t&&void 0!==t.voice)t.voice&&(o.voice=t.voice);else{const e=function(){var e;const t=(null===(e=window.speechSynthesis)||void 0===e?void 0:e.getVoices())||[];if(!t.length)return null;const r=t.find((e=>e.name===S))||t.find((e=>e.name.includes(S)));if(r)return r;const a=["Microsoft Jenny","Microsoft Aria","Microsoft Sonia","Microsoft Zira","Samantha","Karen","Moira","Google UK English Female","Tessa","Fiona","Daniel","Microsoft Guy","Arthur"];for(const n of a){const e=t.find((e=>e.name.includes(n)));if(e)return e}const s=t.filter((e=>{var t;return null===(t=e.lang)||void 0===t?void 0:t.toLowerCase().startsWith("en")})),i=/female|woman|zira|jenny|aria|sonia|samantha|karen|victoria|linda|susan|hazel|michelle/i;return s.filter((e=>i.test(`${e.name} ${e.voiceURI||""}`)))[0]||s[0]||t[0]||null}();e&&(o.voice=e)}o.onend=()=>e(),o.onerror=()=>e();try{l.resume()}catch{}l.speak(o)})))):Promise.resolve()}const A=r.p+"static/media/mira-avatar-host.bb0d709071ca3e91ff42.png";var T=r(579);function E(e){let{mode:t,label:r,className:s="",variant:i="default"}=e;const l="speaking"===t,o="listening"===t,d="thinking"===t,[c,m]=(0,a.useState)(!1),u="compact"===i;return(0,T.jsxs)("div",{className:`relative flex flex-col items-center ${s}`,role:"img","aria-label":`${r}, your AI interview partner`,children:[(0,T.jsxs)(n.P.div,{className:"relative",animate:{scale:l?[1,1.018,1]:o?[1,1.008,1]:1},transition:{repeat:l||o?1/0:0,duration:l?.75:1.5,ease:"easeInOut"},children:[(0,T.jsx)("div",{className:`pointer-events-none rounded-[2rem] blur-3xl transition-all duration-700 ${u?"absolute -inset-5":"absolute -inset-8"} ${l?"bg-gradient-to-b from-cyan-400/35 via-cyan-300/15 to-transparent opacity-100 dark:from-cyan-400/25":o?"bg-gradient-to-b from-violet-400/25 via-v
1iolet-300/10 to-transparent opacity-90 dark:from-violet-400/20":d?"bg-gradient-to-b from-sky-400/20 to-transparent opacity-80 dark:from-sky-400/15":"bg-gradient-to-b from-slate-300/20 to-transparent opacity-50 dark:from-slate-500/10"}`}),(0,T.jsxs)("div",{className:`relative z-[1] overflow-hidden rounded-3xl shadow-2xl ring-2 transition-all duration-500 dark:shadow-[0_25px_60px_-12px_rgba(0,0,0,0.85)] ${u?"h-[11rem] w-[8.75rem] shadow-slate-900/20 sm:h-[12rem] sm:w-[9.25rem]":"h-[15.5rem] w-[12rem] shadow-slate-900/25 sm:h-[17rem] sm:w-[12.75rem]"} ${l?"ring-cyan-400/75 dark:ring-cyan-400/55":o?"ring-violet-400/60 dark:ring-violet-400/45":d?"ring-sky-400/50 dark:ring-cyan-500/40":"ring-slate-200/90 dark:ring-white/20"}`,children:[c?(0,T.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center bg-gradient-to-br from-cyan-100 via-white to-violet-100 dark:from-slate-800 dark:via-slate-900 dark:to-cyan-950",children:[(0,T.jsx)("span",{className:"text-4xl font-bold tracking-tight text-primary-700 dark:text-cyan-200",children:r.slice(0,1)}),(0,T.jsx)("span",{className:"mt-1 text-[10px] font-medium uppercase tracking-widest text-slate-500 dark:text-slate-400",children:r})]}):(0,T.jsx)("img",{src:A,alt:r,width:450,height:570,className:"h-full w-full scale-[1.02] object-cover object-[center_18%] sm:object-[center_16%]",onError:()=>m(!0),draggable:!1}),(0,T.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t from-black/25 to-transparent dark:from-black/35"}),l?(0,T.jsx)(n.P.div,{className:"pointer-events-none absolute inset-0 bg-gradient-to-tr from-white/0 via-white/25 to-white/0",initial:{x:"-100%",opacity:0}
1,animate:{x:"120%",opacity:[0,.35,0]},transition:{duration:2.2,repeat:1/0,ease:"easeInOut",repeatDelay:.3}}):null,l?(0,T.jsx)("div",{className:"pointer-events-none absolute bottom-3 left-1/2 z-10 flex h-9 -translate-x-1/2 items-end justify-center gap-1","aria-hidden":!0,children:[0,1,2,3,4].map((e=>(0,T.jsx)(n.P.div,{className:"w-1.5 rounded-full bg-white shadow-sm",animate:{height:[10,26,14,22,12,28,10],opacity:[.85,1,.9,1,.85,1,.85]},transition:{duration:.55,repeat:1/0,ease:"easeInOut",delay:.06*e}},e)))}):null,o&&!l?(0,T.jsx)(n.P.div,{className:"pointer-events-none absolute inset-2 rounded-2xl border-2 border-violet-300/50 dark:border-violet-400/35",initial:{opacity:.4},animate:{opacity:[.35,.85,.35],scale:[1,1.01,1]},transition:{duration:1.8,repeat:1/0,ease:"easeInOut"}}):null,d&&!l?(0,T.jsx)(n.P.div,{className:"pointer-events-none absolute right-3 top-3 z-10 h-2.5 w-2.5 rounded-full bg-cyan-300 shadow-[0_0_12px_rgba(34,211,238,0.9)] dark:bg-cyan-400",animate:{scale:[1,1.25,1],opacity:[.7,1,.7]},transition:{duration:1.1,repeat:1/0}}):null]})]}),(0,T.jsx)("span",{className:"rounded-full bg-primary-600 font-bold uppercase tracking-wider text-white shadow-md shadow-primary-500/25 dark:bg-cyan-600 dark:shadow-cyan-500/20 "+(u?"mt-1.5 px-2.5 py-0.5 text-[8px]":"mt-2 px-3 py-0.5 text-[9px]"),children:r})]})}const P=[{id:"behavioral",label:"Behavioral",hint:"STAR & culture",icon:(0,T.jsx)(i.X6_,{className:"h-5 w-5"})},{id:"technical",label:"Technical",hint:"Depth & systems",icon:(0,T.jsx)(i.Ojn,{className:"h-5 w-5"})},{id:"mixed",label:"Mixed",hint:"Realistic blend",icon:(0,T.jsx)(i.ARf,{className:"h-5 w-5"})}],R=[5,10,15,30];function I(e){return Math.min(120,Math.max(1,Math.round(e)))}const U="Mira",$="Your interview partner";function F(e){const t=Math.max(0,e);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`}function _(e){var t,r;return!!e&&Boolean((null===(t=e.summary)||void 0===t?void 0:t.trim())||e.strengths.length>0||e.toImprove.length>0||(null===(r=e.nextFocus)||void 0===r?void 0:r.trim()))}function D(e){const{turns:t,draftPreview:r,compact:a,variant:s="live",fillParent:i=!1}=e,n=i?"h-full min-h-0 flex-1":a?"max-h-56":"summary"===s?"max-h-80 sm:max-h-96":"min-h-0 max-h-[38vh] flex-1 lg:max-h-none";return(0,T.jsxs)("div",{className:`flex min-h-0 flex-col overflow-hidden rounded-2xl border border-gray-200/90 bg-white/90 shadow-sm backdrop-blur-md dark:border-white/10 dark:bg-slate-900/50 ${n}`,children:[(0,T.jsxs)("div",{className:"shrink-0 border-b border-gray-100 px-3 py-2 dark:border-white/10 sm:px-4",children:[(0,T.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-500 dark:text-slate-400",children:"Conversation"}),(0,T.jsxs)("p",{className:"text-[11px] text-gray-500 dark:text-slate-500",children:[U," and your answers \u2014 this clears when you start a new briefing."]})]}),(0,T.jsx)("div",{className:"min-h-0 flex-1 space-y-3 overflow-y-auto px-3 py-3 sm:px-4 sm:py-3",children:0===t.length?(0,T.jsx)("p",{className:"text-center text-xs text-gray-500 dark:text-slate-500",children:"No turns yet."}):t.map(((e,a)=>{const s=a===t.length-1&&null===e.answer&&(null===r||void 0===r?void 0:r.trim());return(0,T.jsxs)("div",{className:"space-y-2 border-b border-gray-100 pb-3 last:border-0 last:pb-0 dark:border-white/5",children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-primary-600 dark:text-cyan-400/90",children:[U," \xb7 Q",e.round]}),(0,T.jsx)("p",{className:"mt-1 text-sm leading-relaxed text-gray-900 dark:text-slate-100",children:e.question})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-violet-700 dark:text-violet-300",children:"You"}),null!==e.answer?(0,T.jsx)("p",{className:"mt-1 text-sm leading-relaxed text-gray-800 dark:text-slate-200",children:e.answer}):(0,T.jsx)("p",{className:"mt-1 text-sm italic text-gray-500 dark:text-slate-500",children:s?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("span",{className:"font-medium not-italic text-gray-600 dark:text-slate-400",children:"Draft: "}),r.trim()]}):"Your answer will appear here after you send."})]})]},`${e.round}-${a}`)}))})]})}const q=25,M=["All","Interview","Applied","Offer","Rejected"],L=40,z=50;function B(){var e,t;const r=(0,d.wA)(),[w]=(0,s.ok)(),{currentUser:S}=(0,u.A)(),A=(0,d.d4)(m.tB),B=(0,d.d4)(c.TQ);(0,a.useEffect)((()=>{S&&r((0,c.Wu)())}),[S,r]);const[O,Y]=(0,a.useState)(""),[K,G]=(0,a.useState)(!1),[Q,V]=(0,a.useState)(""),[W,Z]=(0,a.useState)("All"),[J,H]=(0,a.useState)([]),[X,ee]=(0,a.useState)(0),[te,re]=(0,a.useState)(!1),[ae,se]=(0,a.useState)(0),[ie,ne]=(0,a.useState)(!1),[le,oe]=(0,a.useState)(!1),[de,ce]=(0,a.useState)("setup"),[me,ue]=(0,a.useState)("behavioral"),[xe,pe]=(0,a.useState)(5),[he,ge]=(0,a.useState)(""),[be,fe]=(0,a.useState)(""),[ye,we]=(0,a.useState)(""),[ke,ve]=(0,a.useState)(""),[je,Ne]=(0,a.useState)(""),[Se,Ce]=(0,a.useState)(!1),[Ae,Te]=(0,a.useState)(!1),Ee=(0,a.useMemo)((()=>{return(e={loadingTrackerApplication:Se,loadingResumeFromPdf:Ae,companyName:he,jobDescription:ye,resumeText:ke}).loadingTrackerApplication||e.loadingResumeFromPdf?"loading":e.companyName.trim()?e.jobDescription.trim().length<L?"jd":e.resumeText.trim().length<z?"resume":"ok":"company";var e}),[Se,Ae,he,ye,ke]),Pe="ok"===Ee,Re=function(e){switch(e){case"ok":default:return;case"loading":return"Wait for your application and resume to finish loading.";case"company":return"Add the company name you are interviewing with.";case"jd":return"Paste a fuller job description (a few sentences or more).";case"resume":return"Add resume highlights or use Import from profile."}}(Ee),Ie=(0,a.useMemo)((()=>`${me}|${he.trim()}|${be.trim()}|${ye.trim()}|${ke.trim()}`),[me,he,be,ye,ke]),[Ue,$e]=(0,a.useState)([]),[Fe,_e]=(0,a.useState)(!1),[De,qe]=(0,a.useState)(null);(0,a.useEffect)((()=>{$e([]),qe(null)}),[Ie]);const[Me,Le]=(0,a.useState)(null),[ze,Be]=(0,a.useState)(""),[,Oe]=(0,a.useState)(""),[Ye,Ke]=(0,a.useState)(""),[Ge,Qe]=(0,a.useState)(1),[Ve,We]=(0,a.useState)(""),[Ze,Je]=(0,a.useState)(null),[He,Xe]=(0,a.useState)(!1),[et,tt]=(0,a.useState)(null),[rt,at]=(0,a.useState)(!0),[st,it]=(0,a.useState)([]),[nt,lt]=(0,a.useState)(!1),[ot,dt]=(0,a.useState)(!1),[ct,mt]=(0,a.useState)(!1),[ut,xt]=(0,a.useState)(""),[pt,ht]=(0,a.useState)(null),[gt,bt]=(0,a.useState)(!0),[ft,yt]=(0,a.useState)(!1),[wt,kt]=(0,a.useState)(!1),[vt,jt]=(0,a.useState)(!1),[Nt,St]=(0,a.useState)(null),[Ct,At]=(0,a.useState)(!1),[Tt,Et]=(0,a.useState)(1),Pt=(0,a.useRef)(null),Rt=(0,a.useRef)(null),It=(0,a.useRef)([]),Ut=(0,a.useRef)(null),$t=(0,a.useRef)(null),Ft=(0,a.useRef)(!1),_t=(0,a.useRef)("setup"),Dt=(0,a.useRef)(!1),qt=(0,a.useRef)(!1),Mt=(0,a.useRef)(!1),Lt=(0,a.useRef)(1);(0,a.useEffect)((()=>{Ut.current=Me}),[Me]),(0,a.useEffect)((()=>{Lt.current=Ge}),[Ge]),(0,a.useEffect)((()=>{$t.current=Nt}
1),[Nt]),(0,a.useEffect)((()=>{Ft.current=nt}),[nt]),(0,a.useEffect)((()=>{_t.current=de}),[de]),(0,a.useEffect)((()=>{var e;ht(function(){if("undefined"===typeof MediaRecorder)return null;const e=["audio/webm;codecs=opus","audio/webm","audio/mp4"];for(const t of e)if(MediaRecorder.isTypeSupported(t))return t;return null}());const t=()=>function(){try{var e;null===(e=window.speechSynthesis)||void 0===e||e.getVoices()}catch{}}();return t(),null===(e=window.speechSynthesis)||void 0===e||e.addEventListener("voiceschanged",t),()=>{var e;return null===(e=window.speechSynthesis)||void 0===e?void 0:e.removeEventListener("voiceschanged",t)}}),[]),(0,a.useEffect)((()=>{null!==S&&void 0!==S&&S.id&&!A&&r((0,m.l2)(S.id))}),[null===S||void 0===S?void 0:S.id,A,r]),(0,a.useEffect)((()=>{if(je)return;const e=window.setTimeout((()=>V(O.trim())),320);return()=>window.clearTimeout(e)}),[O,je]),(0,a.useEffect)((()=>{if(null===S||void 0===S||!S.id)return;let e=!1;return ne(!0),se(0),(async()=>{try{var t,r;const a=await x.Kp.getApplications({page:0,limit:q,...Q?{search:Q}:{},..."All"!==W?{status:W}:{},sort:"newest",timezoneOffset:(new Date).getTimezoneOffset()});if(e)return;if(!a.success||!a.data)return o.Ay.error(a.error||"Could not load applications."),H([]),ee(0),void re(!1);H(a.data);const s=a.pagination;ee(null!==(t=null===s||void 0===s?void 0:s.total)&&void 0!==t?t:a.data.length),re(null!==(r=null===s||void 0===s?void 0:s.hasNextPage)&&void 0!==r?r:a.data.length>=q)}finally{e||ne(!1)}})(),()=>{e=!0}}),[null===S||void 0===S?void 0:S.id,Q,W]);const zt=(0,a.useCallback)((async()=>{if(null===S||void 0===S||!S.id||le||ie)return;if(!te)return;const e=ae+1;oe(!0);try{const t=await x.Kp.getApplications({page:e,limit:q,...Q?{search:Q}:{},..."All"!==W?{status:W}:{},sort:"newest",timezoneOffset:(new Date).getTimezoneOffset()});if(!t.success||!t.data)return void o.Ay.error(t.error||"Could not load more applications.");H((e=>{const r=new Set(e.map((e=>e._id)).filter(Boolean)),a=[...e];for(const s of t.data)s._id&&!r.has(s._id)&&(r.add(s._id),a.push(s));return a})),se(e);const r=t.pagination;r?(re(r.hasNextPage),"number"===typeof r.total&&ee(r.total)):re(t.data.length>=q)}finally{oe(!1)}}),[null===S||void 0===S?void 0:S.id,le,ie,te,ae,Q,W]),Bt=(0,a.useCallback)((async e=>{if(e.trim()){Ce(!0),Te(!1);try{var t,r;const s=await x.Kp.getApplicationDetails(e);if(!s.success||!s.data)throw new Error(s.error||"Failed to load application");const i=s.data,n=i.application,l=null!==(t=null===n||void 0===n?void 0:n.userId)&&void 0!==t?t:null===S||void 0===S?void 0:S.id;n&&(ge("string"===typeof n.company?n.company:""),fe("string"===typeof n.jobTitle?n.jobTitle:""),"string"===typeof n.company&&"string"===typeof n.jobTitle&&Y(`${n.company} \u2014 ${n.jobTitle}`));let d="";if(null!==(r=i.jobDescription)&&void 0!==r&&r.content){const e=(0,g.J)(i.jobDescription.content);d=(0,f.F8)(e)}we(d.trim());const c=i.resumeContent,m=null===c||void 0===c?void 0:c.resumeStoragePath,u=()=>{if(null===c||void 0===c||!c.content)return"";let e=c.content;!0===c.isCompressed&&(e=(0,g.J)(e));let t=(0,f.QZ)(e);return t.trim()||(t=e),t.trim()};if(m&&l){ve(""),Te(!0);try{var a;const e=m.split("/").pop();if(!e)throw new Error("Invalid resume storage path");const t=await x.Kp.getSignedDownloadUrl(l,e);if(!t.success||null===(a=t.data)||void 0===a||!a.downloadUrl)throw new Error(t.error||"No download URL");const r=await(0,b.E)(t.data.downloadUrl);if(r.trim().length>0)ve(r);else{const e=u();ve(e),e||o.Ay.error("Could not read text from the stored resume PDF.")}}catch{const e=u();ve(e),e.trim()?o.Ay.error("Could not open your saved PDF; showing the text we have on file."):o.Ay.error("Could not load your saved resume. Use Import from profile or paste your resume here.")}finally{Te(!1)}}else ve(u());Ne(e);const p=i.application;null!==p&&void 0!==p&&p._id&&H((e=>e.some((e=>e._id===p._id))?e:[p,...e])),o.Ay.success("Loaded company, job description, and resume from your tracker.")}catch{o.Ay.error("Could not load that application from the tracker.")}finally{Ce(!1)}}}),[null===S||void 0===S?void 0:S.id]),Ot=w.get("applicationId");(0,a.useEffect)((()=>{Ot&&Bt(Ot)}),[Ot,Bt]),(0,a.useEffect)((()=>()=>{var e;
1N(),null===(e=Rt.current)||void 0===e||e.getTracks().forEach((e=>e.stop())),Rt.current=null,Pt.current=null}),[]),(0,a.useEffect)((()=>{const e=()=>N();return window.addEventListener("pagehide",e),()=>window.removeEventListener("pagehide",e)}),[]);const Yt=(0,a.useCallback)((async()=>{if(Pe){_e(!0),qe(null);try{const e=await x.Kp.mockInterviewLikelyQuestions({track:me,companyName:he,jobTitle:be,jobDescription:ye,resumeText:ke});if(!e.success||!e.data)throw new Error(e.error||"Could not generate questions");r((0,c.NR)());const t=e.data.questions;if(!t||0===t.length)throw new Error("Could not parse questions \u2014 try again");$e(t),o.Ay.success(`Prepared ${t.length} practice questions for this role.`)}catch(e){if($e([]),(0,p.g)(e))(0,p.Tm)("resume"),qe("You have reached your plan limit. Upgrade to generate question banks.");else{const t=e instanceof Error?e.message:"string"===typeof e?e:"Could not generate questions";qe(t),o.Ay.error(t)}}finally{_e(!1)}}else o.Ay.error("Add company, job description, and resume context first.")}),[Pe,me,he,be,ye,ke,r]),Kt=(0,a.useCallback)((async(e,t)=>{if(gt){yt(!0);try{await async function(e,t,r){const a=v.n,s=e.replace(/\s+/g," ").trim(),i=t.replace(/\s+/g," ").trim(),n=r?{voice:r}:{};s&&s.length>0&&s.length<280&&await C(s,{rate:1.02,pitch:1,...n},a),v.n===a&&i&&await C(i,{rate:.93,pitch:.98,...n},a)}(e,t)}finally{yt(!1)}}}),[gt]),Gt=(0,a.useCallback)((async()=>{const e=Ut.current;if(e&&!(Lt.current<1)){Xe(!0),tt(null),Je(null);try{const t=await x.Kp.mockInterviewDebrief({sessionId:e});if(!t.success||!t.data)throw new Error(t.error||"Could not load feedback");r((0,c.NR)()),Je(t.data)}catch(t){if(Je(null),(0,p.g)(t))(0,p.Tm)("resume"),tt("You have reached your plan limit. Upgrade to get coaching feedback.");else{const e=t instanceof Error?t.message:"string"===typeof t?t:"Could not load coaching feedback";tt(e)}}finally{Xe(!1)}}}),[r]),Qt=(0,a.useCallback)((()=>{var e;N(),null===(e=Rt.current)||void 0===e||e.getTracks().forEach((e=>e.stop())),Rt.current=null,Pt.current=null}),[]),Vt=(0,a.useCallback)((()=>{At(!1),Et(1)}),[]);(0,y.s)(Ct&&"live"===de,Vt);const Wt=(0,a.useCallback)((e=>{Qt(),Mt.current=!0,qt.current=!1,dt(!1),mt(!1),yt(!1),lt(!1),kt(!1),jt(!1),St(null),Be(""),We("You ended the session early. Review the conversation below when you are ready."),Je(null),tt(null),Xe(!1),at(!0),ce("done"),Vt(),e&&(Lt.current<1||!Ut.current?o.Ay.error("Not enough back-and-forth yet for full coaching. You can still request feedback from the recap screen."):Gt())}),[Qt,Gt,Vt]),Zt=(0,a.useCallback)((async()=>{if(!Mt.current){Mt.current=!0,qt.current=!1,N(),lt(!0);try{const e=Ut.current;if(!e||Lt.current<1)return We("Time is up \u2014 session ended."),St(null),Be(""),ce("done"),void Gt();const t=await x.Kp.mockInterviewWrapUp({sessionId:e});if(!t.success||!t.data)throw new Error(t.error||"Could not close session");r((0,c.NR)());const{acknowledgment:a,coachingTip:s}=t.data;it((e=>{if(0===e.length)return e;const t=[...e],r=t[t.length-1];return null===r.answer&&(t[t.length-1]={...r,answer:"(No reply \u2014 time ran out)"}),t}));const i=[a,s].filter(Boolean).join(" ").trim();We(i||"Time is up \u2014 nice work today."),St(null),Be(""),ce("done"),lt(!1),await Kt(a,""),Gt()}catch(e){if((0,p.g)(e))return Mt.current=!0,(0,p.Tm)("resume"),We("Time is up \u2014 session ended."),St(null),ce("done"),void Gt();Mt.current=!1;const t=e instanceof Error?e.message:"string"===typeof e?e:"Could not close session";o.Ay.error(t),We("Time is up \u2014 session ended."),St(null),ce("done"),Gt()}finally{lt(!1)}}}),[Kt,Gt,r]),Jt=(0,a.useCallback)((()=>{var e;Vt(),N(),null===(e=Rt.current)||void 0===e||e.getTracks().forEach((e=>e.stop())),Rt.current=null,Pt.current=null,ce("setup"),Le(null),Be(""),Oe(""),Ke(""),Qe(1),We(""),Je(null),Xe(!1),tt(null),at(!0),it([]),xt(""),lt(!1),dt(!1),mt(!1),yt(!1),kt(!1),jt(!1),St(null),Dt.current=!1,qt.current=!1,Mt.current=!1}),[Vt]);(0,a.useEffect)((()=>{if("live"!==de)return;const e=window.setInterval((()=>{St((e=>null===e?e:e<=0?0:e-1))}),1e3);return()=>clearInterval(e)}),[de]),(0,a.useEffect)((()=>{"live"===de&&0===Nt&&(Mt.current||(Dt.current=!0,Ft.current?qt.current=!0:Zt()))}),[de,Nt,Zt]);const Ht=async()=>
1{if(!(()=>{switch(Ee){case"ok":return!0;case"loading":return o.Ay.error("Still loading application data \u2014 try again in a moment."),!1;case"company":return o.Ay.error("Add the company name you are interviewing with."),!1;case"jd":return o.Ay.error("Paste a fuller job description (at least a few sentences)."),!1;case"resume":return o.Ay.error("Add resume highlights or tap \u201cImport from profile\u201d."),!1;default:return!1}})())return;j();const e=I(xe);pe(e),Dt.current=!1,qt.current=!1,Mt.current=!1,lt(!0);try{const t=await x.Kp.mockInterviewStartSession({track:me,minutes:e,companyName:he,jobTitle:be,jobDescription:ye,resumeText:ke});if(!t.success||!t.data)throw new Error(t.error||"AI did not return an opening question. Try again.");r((0,c.NR)());const{sessionId:a,acknowledgment:s,coachingTip:i,nextQuestion:n}=t.data;Le(a),Be(n),Oe(s),Ke(i),Qe(1),it([{round:1,question:n,answer:null}]),ce("live"),St(60*e),xt(""),kt(!1),lt(!1),await Kt(s,n)}catch(t){if((0,p.g)(t))return void(0,p.Tm)("resume");const e=t instanceof Error?t.message:"string"===typeof t?t:"Failed to start session";o.Ay.error(e)}finally{lt(!1)}},Xt=async e=>{const t=e.trim();if(t)if(Me){N(),j(),lt(!0);try{var a;const e=null!==(a=$t.current)&&void 0!==a?a:0,s=Dt.current||e<=0,i=await x.Kp.mockInterviewSubmitAnswer({sessionId:Me,transcript:t,roundNumber:Ge,secondsRemaining:Math.max(0,e),timeExpired:s});if(!i.success||!i.data)throw new Error(i.error||"AI request failed");r((0,c.NR)());const{acknowledgment:n,coachingTip:l,nextQuestion:o,usedAcknowledgmentFallback:d,shouldEnd:m}=i.data;if(it((e=>{const r=[...e];if(r.length>0){const e=r[r.length-1];r[r.length-1]={...e,answer:t}}return!m&&o.trim()&&r.push({round:Ge+1,question:o,answer:null}),r})),mt(!1),m){Mt.current=!0,qt.current=!1;const e=[n,l].filter(Boolean).join(" ").trim();We(e||(s?"Time is up \u2014 nice work today.":"Session complete. Strong work.")),St(null),ce("done"),Be(""),lt(!1),await Kt(n,""),Gt()}else Ke(l),d?(Oe(""),Be(o)):(Oe(n),Be(o)),lt(!1),d?await Kt("",o):await Kt(n,o),Qe((e=>e+1)),xt(""),kt(!1)}catch(s){if((0,p.g)(s))return void(0,p.Tm)("resume");const e=s instanceof Error?s.message:"string"===typeof s?s:"Failed to continue session";o.Ay.error(e)}finally{lt(!1),qt.current&&Dt.current&&!Mt.current&&"live"===_t.current&&(qt.current=!1,Zt())}}else o.Ay.error("Session not ready. Start again.");else o.Ay.error("Record your answer or type a response before sending.")},er=ot||ct,tr=gt&&ft,rr=nt||tr||ct,ar=gt&&ft?"speaking":ct?"thinking":ot?"listening":nt&&!ot?"thinking":"idle";if(!B){const e=["Live mock interviews with AI interviewer","Tailored questions from your JD & resume","Real-time coaching tips each round","Post-session debrief with actionable feedback"];return(0,T.jsxs)("div",{className:"relative min-h-screen w-full overflow-x-hidden bg-gradient-to-b from-slate-50 via-white to-primary-50/30 px-4 py-12 dark:from-gray-950 dark:via-gray-900 dark:to-primary-950/20 sm:px-6 sm:py-16 lg:px-8",children:[(0,T.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -left-24 top-0 h-72 w-72 rounded-full bg-primary-400/15 blur-3xl dark:bg-primary-500/10"}),(0,T.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -right-16 bottom-0 h-64 w-64 rounded-full bg-violet-400/10 blur-3xl dark:bg-violet-500/10"}),(0,T.jsx)(n.P.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{type:"spring",damping:28,stiffness:260},className:"relative mx-auto w-full max-w-lg",children:(0,T.jsxs)("div",{className:"overflow-hidden rounded-3xl border border-slate-200/90 bg-white/90 shadow-xl shadow-slate-200/50 ring-1 ring-slate-100 backdrop-blur-sm dark:border-white/10 dark:bg-slate-900/90 dark:shadow-black/40 dark:ring-white/5",children:[(0,T.jsx)("div",{className:"border-b border-slate-100 bg-gradient-to-r from-primary-600/10 via-primary-500/5 to-transparent px-8 pb-6 pt-8 dark:border-white/5 dark:from-primary-500/15 dark:via-primary-400/5 dark:to-transparent",children:(0,T.jsxs)("div",{className:"flex flex-col items-center text-center sm:items-start sm:text-left",children:[(0,T.jsxs)("span",{className:"mb-4 inline-flex items-center gap-1.5 rounded-full border border-primary-200/80 bg-primary-50 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-primary-800 dark:border-primary-500/30 dark:bg-primary-950/50 dark:text-primary-200",children:[(0,T.jsx)(i.FrA,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Pro"]}),(0,T.jsxs)("div",{className:"mb-5 flex w-full max-w-md items-center gap-4 sm:max-w-none",children:[(0,T.jsx)("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-gradient-to-br from-primary-500 to-primary-700 text-white shadow-lg shadow-primary-500/25",children:(0,T.jsx)(i.Rrl,{className:"h-7 w-7 opacity-95","aria-hidden":!0})}),(0,T.jsx)("h1",{className:"text-left text-2xl font-bold tracking-tight text-slate-900 dark:text-white sm:text-[1.65rem]",children:"Unlock Interview Prep"})]}),(0,T.jsx)("p",{className:"max-w-md text-[15px] leading-relaxed text-slate-600 dar
1k:text-slate-400",children:"Pro includes AI mock interviews with personalized coaching, live feedback, and a clear debrief after every session."})]})}),(0,T.jsxs)("div",{className:"px-8 py-7",children:[(0,T.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-slate-500 dark:text-slate-500",children:"Included with Pro"}),(0,T.jsx)("ul",{className:"space-y-3",children:e.map((e=>(0,T.jsxs)("li",{className:"flex gap-3 rounded-xl border border-slate-100 bg-slate-50/80 px-3.5 py-3 text-sm text-slate-800 dark:border-white/5 dark:bg-white/[0.04] dark:text-slate-200",children:[(0,T.jsx)("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary-100 text-primary-700 dark:bg-primary-500/20 dark:text-primary-300",children:(0,T.jsx)(i.YrT,{className:"h-3 w-3 stroke-[3]",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0})}),(0,T.jsx)("span",{className:"leading-snug",children:e})]},e)))}),(0,T.jsxs)(s.N_,{to:"/pricing",className:"group mt-8 flex w-full items-center justify-center gap-2 rounded-2xl bg-primary-600 px-6 py-3.5 text-sm font-semibold text-white shadow-lg shadow-primary-600/25 transition hover:bg-primary-700 hover:shadow-xl hover:shadow-primary-600/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600",children:["Upgrade to Pro",(0,T.jsx)(i.dyV,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5","aria-hidden":!0})]}),(0,T.jsx)("p",{className:"mt-4 text-center text-xs text-slate-500 dark:text-slate-500",children:"View plans and billing on the pricing page."})]})]})})]})}return(0,T.jsxs)("div",{className:"relative min-h-screen w-full overflow-x-hidden bg-gradient-to-b from-gray-50 to-white text-gray-900 dark:from-gray-900 dark:to-gray-900 dark:text-slate-100",children:[(0,T.jsx)(l.N,{children:Ct&&"live"===de&&(0,T.jsxs)(n.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[100] flex items-end justify-center p-4 sm:items-center sm:p-6",role:"dialog","aria-modal":"true","aria-labelledby":"leave-session-title",children:[(0,T.jsx)("button",{type:"button","aria-label":"Dismiss",className:"absolute inset-0 bg-slate-950/55 backdrop-blur-[2px] dark:bg-black/65",onClick:Vt}),(0,T.jsx)(n.P.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.98},transition:{type:"spring",damping:28,stiffness:320},className:"relative z-10 w-full max-w-md rounded-2xl border border-slate-200 bg-white p-5 shadow-2xl dark:border-white/10 dark:bg-slate-900 sm:p-6",onClick:e=>e.stopPropagation(),children:1===Tt?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("h2",{id:"leave-session-title",className:"text-lg font-semibold text-slate-900 dark:text-white",children:"End this session?"}),(0,T.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-slate-600 dark:text-slate-400",children:"You will leave the mock interview. Your answers so far stay on the recap screen\u2014you will not lose this run."}),(0,T.jsxs)("div",{className:"mt-6 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[(0,T.jsx)("button",{type:"button",onClick:Vt,className:"rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-sm font-medium text-slate-800 transition hover:bg-slate-50 dark:border-white/10 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-slate-700/80",children:"Stay in session"}),(0,T.jsx)("button",{type:"button",onClick:()=>Et(2),className:"rounded-xl border border-red-200 bg-red-600 px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-red-500 dark:border-red-500/40 dark:bg-red-600 dark:hover:bg-red-500",children:"End session"})]})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("h2",{id:"leave-session-title",className:"text-lg font-semibold text-slate-900 dark:text-white",children:"Generate coaching feedback?"}),(0,T.jsxs)("p",{className:"mt-2 text-sm leading-relaxed text-slate-600 dark:text-slate-400",children:[U," can summarize strengths and next steps from this practice session. This uses"," ",(0,T.jsx)("span",{className:"font-medium text-slate-800 dark:text-slate-200",children:"one AI request"})," from your plan. You can skip now and request feedback later on the recap screen."]}),(0,T.jsxs)("div",{className:"mt-6 flex flex-col gap-2",children:[(0,T.jsx)("button",{type:"button",onClick:()=>Wt(!0),className:"w-full rounded-xl border border-primary-500/30 bg-primary-600 px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-primary-500 dark:border-cyan-500/35 dark:bg-cyan-600 dark:hover:bg-cyan-500",children:"End and generate feedback"}),(0,T.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-between",children:[(0,T.jsx)("button",{type:"button",onClick:()=>Et(1),className:"rounded-xl border border-slate-200 bg-white px-4 py-2.5 text-sm font-medium text-slate-800 transition hover:bg-slate-50 dark:border-white/10 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-slate-700/80 sm:mr-auto",children:"Back"}),(0,T.jsx)("button",{type:"button",onClick:()=>Wt(!1),className:"rounded-xl border border-slate-200 bg-slate-100 px-4 py-2.5 text-sm font-medium text-slate-800 transition hover:bg-slate-200/80 dark:border-white/10 dark:bg-slate-800 dark:text-slate-200 dark:hover:bg-slate-700",children:"End without feedback"})]})]})]})})]},"leave-session-modal")}),(0,T.jsxs)("div",{className:"relative w-full px-4 sm:px-6 lg:px-8 "+("live"===de?"flex h-[calc(100dvh-4rem)] max-h-[calc(100dvh-4rem)] min-h-0 flex-col overflow-hidden py-2 sm:py-3":"py-6 sm:py-8"),children:["live"!==de&&(0,T.jsxs)(n.P.header,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mb-8 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-primary-300/60 bg-primary-50 px-3 py-1 text-[10px] font-semibold uppercase tracking-[0.2em] text-primary-700 dark:border-cyan-500/30 dark:bg-cyan-500/10 dark:text-cyan-300",children:[(0,T.jsx)("span",{className:"font-semibold tracking-tight text-primary-800 dark:text-cyan-100",children:U}),(0,T.jsx)("span",{className:"text-primary-600/80 dark:text-cyan-400/80",children:"\xb7"}),(0,T.jsx)("span",{children:$})]}),(0,T.jsx)("h1",{className:"mt-2 bg-gradient-to-r from-primary-700 via-gray-800 to-violet-700 bg-clip-text text-2xl font-bold tracking-tight text-transparent dark:from-cyan-200 dark:via-white dark:to-violet-200 sm:text-3xl",children:"Interview prep"}),(0,T.jsxs)("p",{className:"mt-1 max-w-xl text-sm text-gray-600 dark:text-slate-400",children:["Practice out loud with ",U,"\u2014realistic questions, your voice and your pacing, in a calm space built for confidence."]})]}),"setup"!==de&&(0,T.jsxs)("button",{type:"button",onClick:Jt,title:"Leave and return to briefing",className:"inline-flex items-center gap-2 self
1-start rounded-xl border border-gray-200 bg-white px-4 py-2 text-sm text-gray-800 shadow-sm transition hover:border-primary-300 hover:bg-primary-50/50 dark:border-white/10 dark:bg-white/5 dark:text-slate-200 dark:shadow-none dark:backdrop-blur dark:hover:border-cyan-500/40 dark:hover:bg-white/10",children:[(0,T.jsx)(i.x6R,{className:"h-4 w-4 text-primary-600 dark:text-cyan-400"}),"Exit"]})]}),(0,T.jsx)("div",{className:"live"===de?"flex min-h-0 flex-1 flex-col overflow-hidden":"contents",children:(0,T.jsxs)(l.N,{mode:"wait",children:["setup"===de&&(0,T.jsxs)(n.P.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-12},transition:{duration:.35},className:"grid gap-8 lg:grid-cols-5",children:[(0,T.jsxs)("div",{className:"space-y-6 lg:col-span-3",children:[(0,T.jsxs)("section",{className:"rounded-2xl border border-gray-200 bg-white/90 p-6 shadow-sm backdrop-blur-xl dark:border-white/10 dark:bg-slate-900/50 sm:p-8",children:[(0,T.jsx)("h2",{className:"text-sm font-semibold uppercase tracking-wider text-primary-600 dark:text-cyan-400/90",children:"Mission briefing"}),(0,T.jsx)("p",{className:"mt-1 text-sm text-gray-600 dark:text-slate-400",children:"Ground the simulation in a real company, role, and JD \u2014 plus your resume so questions hit your actual background."}),(0,T.jsxs)("div",{className:"mt-5 rounded-xl border border-dashed border-gray-200 bg-gray-50/80 p-4 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,T.jsx)("label",{htmlFor:"interview-tracker-combo",className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-slate-500",children:"From application tracker"}),(0,T.jsx)("p",{className:"mt-1 text-xs text-gray-500 dark:text-slate-500",children:"Type to search, pick from the list, or narrow by status \u2014 results load in pages."}),(0,T.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:items-stretch",children:[(0,T.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,T.jsx)(i.CKj,{className:"pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-gray-400 dark:text-slate-500"}),(0,T.jsx)("input",{id:"interview-tracker-combo",type:"search",role:"combobox","aria-expanded":K,"aria-controls":"interview-tracker-combo-list",autoComplete:"off",value:O,onChange:e=>{const t=e.target.value;Y(t),je&&Ne(""),G(!0)},onFocus:()=>G(!0),onBlur:()=>{window.setTimeout((()=>G(!1)),200)},placeholder:"Search or choose a tracked application\u2026",disabled:"setup"!==de||Se||Ae,className:"w-full rounded-xl border border-gray-200 bg-white py-2.5 pl-9 pr-10 text-sm text-gray-900 placeholder:text-gray-400 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500/30 disabled:opacity-60 dark:border-white/10 dark:bg-black/40 dark:text-slate-100 dark:placeholder:text-slate-600 dark:focus:border-cyan-500/50"}),(Se||Ae||ie)&&(0,T.jsx)(i.TwU,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 animate-spin text-primary-600 dark:text-cyan-400"}),K&&"setup"===de&&(0,T.jsxs)("div",{id:"interview-tracker-combo-list",role:"listbox",className:"absolute left-0 right-0 top-full z-40 mt-1 max-h-56 overflow-auto rounded-xl border border-gray-200 bg-white py-1 shadow-lg dark:border-white/10 dark:bg-slate-900",children:[ie&&0===J.length?(0,T.jsx)("div",{className:"px-3 py-2.5 text-xs text-gray-500 dark:text-slate-400",children:"Loading applications\u2026"}):null,ie||0!==J.length?null:(0,T.jsx)("div",{className:"px-3 py-2.5 text-xs text-gray-500 dark:text-slate-400",children:"No applications match. Try different words or change the status filter."}),J.filter((e=>e._id)).map((e=>(0,T.jsxs)("button",{type:"button",role:"option","aria-selected":je===e._id,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left text-sm text-gray-900 transition hover:bg-primary-50 dark:text-slate-100 dark:hover:bg-cyan-500/10",onMouseDown:e=>e.preventDefault(),onClick:()=>{Y(`${e.company} \u2014 ${e.jobTitle}`),G(!1),Bt(e._id)},children:[(0,T.jsxs)("span",{className:"font-medium",children:[e.company," \u2014 ",e.jobTitle]}),e.status?(0,T.jsx)("span",{className:"text-xs text-gray-500 dark:text-slate-500",children:e.status}):null]},e._id))),te?(0,T.jsx)("button",{type:"button",className:"flex w-full items-center justify-center gap-2 border-t border-gray-100 px-3 py-2 text-xs font-medium text-primary-700 transition hover:bg-primary-50 disabled:opacity-50 dark:border-white/10 dark:text-cyan-300 dark:hover:bg-white/5",disabled:le||ie,onMouseDown:e=>e.preventDefault(),onClick:()=>{zt()},children:le?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i.TwU,{className:"h-3.5 w-3.5 animate-spin"}),"Loading\u2026"]}):(0,T.jsxs)(T.Fragment,{children:["Load more",X>0?` (${J.length} of ${X})`:""]})}):null]})]}),(0,T.jsxs)("div",{className:"shrink-0 sm:w-44",children:[(0,T.jsx)("label",{htmlFor:"interview-tracker-status",className:"sr-only",children:"Filter by status"}),(0,T.jsx)("select",{id:"interview-tracker-status",value:W,onChange:e=>Z(e.target.value),disabled:"setup"!==de||Se||Ae,className:"h-full min-h-[2.625rem] w-full rounded-xl border border-gray-200 bg-white px-3 py-2.5 text-sm text-gray-900 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500/30 disabled:opacity-60 dark:border-white/10 dark:bg-black/40 dark:text-slate-100 dar
1k:focus:border-cyan-500/50",children:M.map((e=>(0,T.jsx)("option",{value:e,children:"All"===e?"All statuses":e},e)))})]})]}),(0,T.jsxs)("p",{className:"mt-2 text-xs text-gray-500 dark:text-slate-500",children:["Or use ",(0,T.jsx)("span",{className:"font-medium text-gray-700 dark:text-slate-400",children:"Interview prep"})," ","from the tracker\u2019s view-details modal \u2014 the same fields load here automatically."]})]}),(0,T.jsxs)("div",{className:"mt-6 grid gap-4 sm:grid-cols-2",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("label",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-slate-500",children:"Company"}),(0,T.jsx)("input",{value:he,onChange:e=>ge(e.target.value),placeholder:"e.g. Northwind Labs",className:"mt-1.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2.5 text-sm text-gray-900 placeholder:text-gray-400 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500/30 dark:border-white/10 dark:bg-black/40 dark:text-slate-100 dark:placeholder:text-slate-600 dark:focus:border-cyan-500/50 dark:focus:ring-cyan-500/40"})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("label",{className:"text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-slate-500",children:"Role / title"}),(0,T.jsx)("input",{value:be,onChange:e=>fe(e.target.value),placeholder:"e.g. Senior Product Engineer",className:"mt-1.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2.5 text-sm text-gray-900 placeholder:text-gray-400 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500/30 dark:border-white/10 dark:bg-black/40 dark:text-slate-100 dark:placeholder:text-slate-600 dark:focus:border-cyan-500/50 dark:focus:ring-cyan-500/40"})]})]}),(0,T.jsxs)("div",{className:"mt-4",children:[(0,T.jsxs)("label",{className:"flex items-center gap-2 text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-slate-500",children:[(0,T.jsx)(i.qYx,{className:"h-3.5 w-3.5 text-primary-600 dark:text-cyan-500/80"}),"Job description"]}),(0,T.jsx)("textarea",{value:ye,onChange:e=>we(e.target.value),rows:5,placeholder:"Paste the posting: responsibilities, requirements, stack, team context\u2026",className:"mt-1.5 w-full rounded-xl border border-gray-200 bg-white px-3 py-2.5 text-sm text-gray-900 placeholder:text-gray-400 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500/30 dark:border-white/10 dark:bg-black/40 dark:text-slate-100 dark:placeholder:text-slate-600 dark:focus:border-cyan-500/50 dark:focus:ring-cyan-500/40"})]}),(0,T.jsxs)("div",{className:"mt-4",children:[(0,T.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,T.jsxs)("label",{className:"flex items-center gap-2 text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-slate-500",children:[(0,T.jsx)(i.jH2,{className:"h-3.5 w-3.5 text-violet-600 dark:text-violet-400/90"}),"Resume / profile context",Ae?(0,T.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-normal normal-case text-violet-600 dark:text-violet-400",children:[(0,T.jsx)(i.TwU,{className:"h-3.5 w-3.5 animate-spin"}),"Loading from stored PDF\u2026"]}):null]}),(0,T.jsxs)("button",{type:"button",onClick:()=>{const e=(0,h.zt)(A);e.trim()?(ve(e),o.Ay.success("Imported profile into resume context.")):o.Ay.error("Profile is empty or still loading \u2014 fill your profile first.")},disabled:Ae,className:"inline-flex items-center gap-1.5 rounded-lg border border-violet-200 bg-violet-50 px-2.5 py-1 text-xs font-medium text-violet-800 transition hover:bg-violet-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-violet-500/30 dark:bg-violet-500/10 dark:text-violet-200 dark:hover:bg-violet-500/20",children:[(0,T.jsx)(i.JXP,{className:"h-3.5 w-3.5"}),"Import from profile"]})]}),(0,T.jsxs)("div",{className:"relative mt-1.5",children:[(0,T.jsx)("textarea",{value:ke,onChange:e=>ve(e.target.value),rows:6,readOnly:Ae,placeholder:Ae?"Loading your saved resume and extracting the text\u2026":"Paste key bullets, or import from your GetYouHire profile\u2026",className:"w-full rounded-xl border border-gray-200 bg-white px-3 py-2.5 text-sm text-gray-900 placeholder:text-gray-400 focus:border-violet-500 focus:outline-none focus:ring-1 focus:ring-violet-500/30 read-only:bg-gray-50 dark:border-white/10 dark:bg-black/40 dark:text-slate-100 dar
1k:placeholder:text-slate-600 dark:read-only:bg-black/25 dark:focus:border-violet-500/40 dark:focus:ring-violet-500/30"}),Ae?(0,T.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center rounded-xl bg-white/70 dark:bg-black/50",children:(0,T.jsx)(i.TwU,{className:"h-9 w-9 animate-spin text-violet-600 dark:text-violet-400"})}):null]})]})]}),(0,T.jsxs)("section",{className:"rounded-2xl border border-gray-200 bg-white/80 p-6 shadow-md backdrop-blur-xl dark:border-white/10 dark:bg-slate-900/30 sm:p-7",children:[(0,T.jsx)("h2",{className:"text-sm font-semibold text-gray-900 dark:text-slate-200",children:"Interview mode"}),(0,T.jsx)("div",{className:"mt-4 grid gap-3 sm:grid-cols-3",children:P.map((e=>{const t=me===e.id;return(0,T.jsxs)("button",{type:"button",onClick:()=>ue(e.id),disabled:nt,className:"rounded-xl border px-4 py-3 text-left transition disabled:opacity-50 "+(t?"border-primary-500 bg-primary-50 shadow-md shadow-primary-500/10 dark:border-cyan-400/50 dark:bg-cyan-500/15 dark:shadow-[0_0_24px_rgba(34,211,238,0.12)]":"border-gray-200 bg-gray-50/80 hover:border-primary-300 dark:border-white/10 dark:bg-black/20 dark:hover:border-cyan-500/25"),children:[(0,T.jsx)("span",{className:"flex items-center gap-2 text-primary-600 dark:text-cyan-300",children:e.icon}),(0,T.jsx)("span",{className:"mt-1 block font-medium text-gray-900 dark:text-slate-100",children:e.label}),(0,T.jsx)("span",{className:"text-xs text-gray-500 dark:text-slate-500",children:e.hint})]},e.id)}))}),(0,T.jsxs)("div",{className:"mt-6",children:[(0,T.jsxs)("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-sm font-semibold text-gray-900 dark:text-slate-100",children:"Session length"}),(0,T.jsx)("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-slate-500",children:"Ends when the timer reaches zero. Custom: 1\u2013120 min."})]}),(0,T.jsxs)("div",{className:"flex items-center gap-2",children:[(0,T.jsx)("label",{htmlFor:"custom-session-duration",className:"sr-only",children:"Custom duration in minutes"}),(0,T.jsx)("input",{id:"custom-session-duration",type:"number",inputMode:"numeric",min:1,max:120,value:xe,onChange:e=>{const t=parseInt(e.target.value,10);Number.isNaN(t)||pe(I(t))},disabled:nt,title:"Minutes (1\u2013120)",className:"w-16 rounded-lg border border-gray-200 bg-white px-2 py-1.5 text-center text-sm tabular-nums text-gray-900 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500/25 disabled:opacity-50 dark:border-white/10 dark:bg-black/40 dark:text-slate-100 dark:focus:border-cyan-500/50 dark:focus:ring-cyan-500/20"}),(0,T.jsx)("span",{className:"text-xs text-gray-500 dark:text-slate-500",children:"min"})]})]}),(0,T.jsx)("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:R.map((e=>{const t=xe===e;return(0,T.jsxs)("button",{type:"button",onClick:()=>pe(e),disabled:nt,className:"rounded-lg border px-3 py-2.5 text-sm font-medium tabular-nums transition disabled:opacity-50 "+(t?"border-primary-600 bg-primary-600 text-white dark:border-cyan-500 dark:bg-cyan-600":"border-gray-200 bg-white text-gray-800 hover:border-gray-300 dark:border-white/10 dark:bg-black/30 dark:text-slate-200 dark:hover:border-white/20"),children:[e," min"]},e)}))})]}),(0,T.jsx)("button",{type:"button",onClick:()=>{Ht()},disabled:nt||!Pe,title:nt?"Starting your mock interview...":Re,className:"mt-8 inline-flex w-full items-center justify-center gap-2 rounded-lg bg-primary-600 px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition-all duration-200 hover:bg-primary-700 hover:shadow disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:shadow-sm",children:nt?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i.TwU,{className:"h-5 w-5 animate-spin"}),"Starting..."]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i.Rrl,{className:"h-5 w-5"}),"Start mock interview"]})}),(0,T.jsx)("p",{className:"mt-3 text-center text-[11px] text-gray-500 dark:text-slate-500",children:"Prefer to speak? Use the mic when you are in session. You can always type your answers instead."})]})]}),(0,T.jsxs)("aside",{className:"space-y-6 lg:col-span-2",children:[(0,T.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-white/95 p-6 shadow-sm backdrop-blur-xl dark:border-white/10 dark:bg-slate-900/50",children:[(0,T.jsxs)("div",{className:"flex items-start gap-3",children:[(0,T.jsx)("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-primary-100 text-primary-700 dark:bg-cyan-500/15 dark:text-cyan-300",children:(0,T.jsx)(i.Y19,{className:"h-4 w-4"})}),(0,T.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,T.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-primary-700 dark:text-cyan-400/90",children:"Likely questions for this role"}),(0,T.jsxs)("p",{className:"mt-1 text-xs text-gray-600 dark:text-slate-400",children:["A tailored shortlist from your briefing and the interview mode you selected (",null!==(e=null===(t=P.find((e=>e.id===me)))||void 0===t?void 0:t.label)&&void 0!==e?e:me,"). Uses one AI request each time you generate."]})]})]}),(0,T.jsx)("button",{type:"button",onClick:()=>{Yt()},disabled:!Pe||Fe||nt,title:Pe?"Generate a fresh question bank":Re,className:"mt-4 inline-flex w-full items-center justify-center gap-2 rounded-xl border border-primary-300/80 bg-primary-50 px-4 py-2.5 text-sm font-medium text-primary-800 transition hover:bg-primary-100 disabled:cursor-not-allowed disabled:opacity-50 dark:border-cyan-500/30 dark:bg-cyan-500/10 dark:text-cyan-100 dark:hover:bg-cyan-500/20",children:Fe?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i.TwU,{className:"h-4 w-4 animate-spin"}),"Generating\u2026"]}):Ue.length>0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i.jTZ,{className:"h-4 w-4"}),"Regenerate questions"]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(i.FrA,{className:"h-4 w-4"}),"Generate likely questions"]})}),De?(0,T.jsx)("p",{className:"mt-3 text-xs text-red-600 dark:text-red-400",children:De}):null,(0,T.jsxs)("div",{className:"mt-4 max-h-[min(52vh,28rem)] space-y-3 overflow-y-auto pr-1",children:[0!==Ue.length||Fe?null:(0,T.jsx)("p",{className:"text-center text-xs text-gray-500 dark:text-slate-500",children:Pe?"When you are ready, generate a list to rehearse before you start the mock.":"Complete company, job description, and resume on the left to unlock this."}),Ue.map(((e,t)=>(0,T.jsxs)("div",{className:"rounded-xl border border-gray-100 bg-gray-50/80 px-3 py-2.5 dark:border-white/10 dark:bg-black/25",children:[(0,T.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-primary-600 dark:text-cyan-400/90",children:["Question ",t+1]}),(0,T.jsx)("p",{className:"mt-1 text-sm leading-snug text-gray-900 dark:text-slate-100",children:e.question}),e.whyTheyAsk?(0,T.jsxs)("p",{className:"mt-2 border-t border-gray-200/80 pt-2 text-[11px] leading-relaxed text-gray-600 dark:border-white/10 dark:text-slate-400",children:[(0,T.jsxs)("span",{className:"font-medium text-gray-700 dark:text-slate-300",children:["Why they ask:"," "]}),e.whyTheyAsk]}):null]},`${t}-${e.question.slice(0,48)}`)))]})]}),(0,T.jsxs)("div",{className:"rounded-2xl border border-violet-200 bg-gradient-to-b from-violet-50/90 to-white p-6 shadow-md backdrop-blur-xl dark:border-violet-500/20 dark:from-violet-950/40 dark:to-slate-900/60",children:[(0,T.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-violet-700 dark:text-violet-300",children:"How it works"}),(0,T.jsx)("ul",{className:"mt-4 space-y-4 text-sm text-gray-700 dark:text-slate-300",children:[{t:"Tailored to you",d:"The company, role, resume, and job description you add shape the questions\u2014so practice tracks what you are applying for."},{t:"Natural rhythm",d:`${U} listens to each answer, then moves the conversation forward like a real interviewer.`},{t:"Audio you control",d:"Questions can be read aloud; use the speaker control in session to mute if you prefer to read on screen only."}].map((e=>(0,T.jsxs)("li",{className:"flex gap-3 border-b border-gray-200 pb-3 last:border-0 dark:border-white/5",children:[(0,T.jsx)("span",{className:"mt-0.5 h-2 w-2 shrink-0 rounded-full bg-primary-500 shadow-sm dark:bg-cyan-400 dark:shadow-[0_0_10px_rgba(34,211,238,0.8)]"}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"font-medium text-gray-900 dark:text-slate-100",children:e.t}),(0,T.jsx)("p",{className:"text-xs text-gray-500 dark:text-slate-500",children:e.d})]})]},e.t)))})]})]})]},"setup"),"live"===de&&(0,T.jsxs)(n.P.div,{initial:{opacity:0,scale:.98}
1,animate:{opacity:1,scale:1},exit:{opacity:0},className:"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden",children:[(0,T.jsxs)("div",{className:"flex shrink-0 items-center gap-2 rounded-2xl border border-slate-200 bg-white px-3 py-2 text-slate-900 shadow-sm dark:border-white/10 dark:bg-slate-950 dark:text-white sm:gap-3 sm:px-4 sm:py-2.5",children:[(0,T.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5 rounded-xl px-2.5 py-1.5 font-mono text-sm font-semibold tabular-nums sm:gap-2 sm:px-3 "+(null!==Nt&&Nt<=120?"bg-amber-100 text-amber-900 ring-1 ring-amber-300/80 dark:bg-amber-500/20 dark:text-amber-100 dark:ring-amber-400/40":"bg-slate-100 text-slate-800 ring-1 ring-slate-200/80 dark:bg-white/10 dark:text-white/95 dark:ring-white/10"),children:[(0,T.jsx)(i.Ohp,{className:"h-3.5 w-3.5 shrink-0 opacity-90 sm:h-4 sm:w-4"}),(0,T.jsx)("span",{children:null!==Nt?F(Nt):"\u2014"})]}),(0,T.jsxs)("div",{className:"min-w-0 flex-1 text-center sm:text-left",children:[(0,T.jsxs)("p",{className:"truncate text-sm font-semibold tracking-tight sm:text-base",children:[he||"Mock interview",be?(0,T.jsxs)("span",{className:"font-normal text-slate-500 dark:text-white/60",children:[" \xb7 ",be]}):null]}),(0,T.jsxs)("p",{className:"truncate text-[10px] text-slate-500 dark:text-white/45 sm:text-[11px]",children:["with ",U]})]}),(0,T.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-1.5",children:[(0,T.jsx)("button",{type:"button",title:gt?"Mute AI voice":"Turn on AI voice",onClick:()=>{N(),yt(!1),bt((e=>{const t=!e;return t&&j(),t}))},className:"flex h-9 w-9 items-center justify-center rounded-full bg-slate-100 text-slate-700 transition hover:bg-slate-200 dark:bg-white/10 dark:text-white/90 dark:hover:bg-white/20",children:gt?(0,T.jsx)(i.o77,{className:"h-4 w-4 text-primary-600 dark:text-cyan-300"}):(0,T.jsx)(i.cKW,{className:"h-4 w-4 text-slate-400 dark:text-white/50"})}),(0,T.jsx)("button",{type:"button",title:vt?"Hide conversation log":"Show conversation log",onClick:()=>jt((e=>!e)),className:"flex h-9 w-9 items-center justify-center rounded-full transition "+(vt?"bg-primary-100 text-primary-800 dark:bg-cyan-500/30 dark:text-cyan-100":"bg-slate-100 text-slate-700 hover:bg-slate-200 dark:bg-white/10 dark:text-white/90 dark:hover:bg-white/20"),children:(0,T.jsx)(i.E19,{className:"h-4 w-4"})}),(0,T.jsx)("button",{type:"button",title:"Leave session",onClick:()=>{Et(1),At(!0)},className:"flex h-9 w-9 items-center justify-center rounded-full bg-red-500 text-white shadow-sm transition hover:bg-red-600 dark:bg-red-500/90 dark:hover:bg-red-500",children:(0,T.jsx)(i.x6R,{className:"h-4 w-4"})})]})]}),(0,T.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden lg:flex-row lg:items-stretch lg:gap-3",children:[(0,T.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden rounded-3xl border border-slate-200/90 bg-gradient-to-b from-slate-100 via-white to-slate-100 shadow-lg ring-1 ring-slate-200/60 dark:border-white/10 dark:from-slate-900 dark:via-slate-800 dark:to-slate-900 dark:shadow-2xl dark:ring-white/5",children:[(0,T.jsx)("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden overflow-x-hidden",children:(0,T.jsxs)("div",{className:"relative flex min-h-0 w-full flex-1 flex-col items-stretch gap-3 px-3 py-3 sm:gap-4 sm:px-5 sm:py-4 md:flex-row md:gap-4 lg:gap-5",children:[(0,T.jsxs)("div",{className:"flex w-full min-w-0 flex-col items-center md:flex-1 md:basis-0 md:min-h-0 md:justify-center",children:[(0,T.jsx)(E,{mode:ar,label:U,variant:"compact",className:"dark:[&_span]:bg-white/15 dark:[&_span]:text-white/90 dark:[&_span]:shadow-none"}),(0,T.jsx)("p",{className:"mt-2 max-w-[16rem] text-center text-[10px] font-medium uppercase tracking-[0.24em] text-slate-500 dark:text-white/50 sm:mt-3",children:gt&&ft?`${U} is speaking`:er?ct?"Processing your answer":"Listening \u2014 tap mic to stop and send":nt?"Please wait\u2026":"Your turn \u2014 tap mic to answer"})]}),(0,T.jsxs)(n.P.div,{layout:!0,className:"flex w-full min-h-0 min-w-0 flex-1 flex-col overflow-y-auto rounded-2xl border border-slate-200/90 bg-white/90 px-3 py-2.5 shadow-sm backdrop-blur-sm dark:border-white/10 dark:bg-black/25 dark:shadow-inner sm:px-4 sm:py-3 md:flex-1 md:basis-0 md:max-h-none md:self-stretch max-h-[min(30vh,13.5rem)] sm:max-h-[min(34vh,15rem)]",children:[Ye?(0,T.jsx)("p",{className:"mb-1.5 text-left text-xs leading-relaxed text-violet-700 dark:text-violet-200/90 sm:mb-2",children:Ye}):null,(0,T.jsx)("p",{className:"text-left text-sm leading-relaxed text-slate-900 dark:text-white/95 sm:text-[15px]",children:ze})]})]})}),(0,T.jsx)("div",{className:"shrink-0 border-t border-slate-200/90 bg-slate-50/95 px-3 py-3 backdrop-blur-md dark:border-white/10 dark:bg-slate-950/85 sm:px-5 sm:py-3.5 pb-[max(0.75rem,env(safe-area-inset-bottom,0px))]",children:(0,T.jsxs)("div",{className:"mx-auto flex max-w-md flex-col items-center gap-2 sm:gap-3",children:[(0,T.jsxs)(n.P.button,{type:"button",whileTap:{scale:.96},onClick:()=>{ot?(async()=>{var e;const t=Pt.current;if(!t||!ot)return;j(),dt(!1),await new Promise((e=>{t.onstop=()=>e();try{t.stop()}catch{e()}}
1)),null===(e=Rt.current)||void 0===e||e.getTracks().forEach((e=>e.stop())),Rt.current=null,Pt.current=null;const r=new Blob(It.current,{type:pt||"audio/webm"});if(It.current=[],r.size){mt(!0);try{var a;let e;try{e=await k(r)}catch{return void o.Ay.error("Could not process audio. Type your answer under Refine.")}const t=new FormData;t.append("audio",e,"answer.wav");const s=await x.Kp.transcribeMockInterviewAudio(t);if(!s.success||null===(a=s.data)||void 0===a||!a.transcript)throw new Error(s.error||"Empty transcript");const i=s.data.transcript.trim();if(!i)return void o.Ay.error("Transcription empty \u2014 try again or type your answer.");xt(""),await Xt(i)}catch(s){const e=s instanceof Error?s.message:"string"===typeof s?s:"Transcription failed";o.Ay.error(e)}finally{mt(!1)}}else o.Ay.error("No audio captured. Try again.")})():(async()=>{if(!gt||!ft)if(pt){if(!(ot||nt||ct))try{const e=await navigator.mediaDevices.getUserMedia({audio:!0});Rt.current=e,It.current=[];const t=new MediaRecorder(e,{mimeType:pt});t.ondataavailable=e=>{e.data.size&&It.current.push(e.data)},t.start(),Pt.current=t,dt(!0)}catch{o.Ay.error("Microphone permission is required to speak your answer.")}}else o.Ay.error("Recording is not supported in this browser. Expand \u201cRefine\u201d and type your answer.")})()},disabled:rr,"aria-label":ot?"Stop recording and send answer":"Start speaking your answer",className:"relative flex h-14 w-14 items-center justify-center rounded-full border-2 shadow-lg transition disabled:opacity-40 sm:h-16 sm:w-16 "+(ot?"border-red-400 bg-red-500 text-white shadow-red-500/20 dark:shadow-red-500/25":"border-primary-400 bg-primary-600 text-white shadow-primary-500/25 hover:bg-primary-500 dark:border-cyan-400/80 dark:bg-cyan-500 dark:shadow-cyan-500/25 dark:hover:bg-cyan-400"),children:[ct?(0,T.jsx)(i.TwU,{className:"h-7 w-7 animate-spin sm:h-8 sm:w-8"}):ot?(0,T.jsx)(i.TG1,{className:"h-6 w-6 sm:h-7 sm:w-7"}):(0,T.jsx)(i.Rrl,{className:"h-7 w-7 sm:h-8 sm:w-8"}),ot&&(0,T.jsx)(n.P.span,{className:"absolute inset-0 rounded-full border-2 border-white/40",animate:{scale:[1,1.15,1],opacity:[.45,0,.45]},transition:{duration:1.5,repeat:1/0}})]}),(0,T.jsx)("p",{className:"text-center text-[10px] text-slate-500 dark:text-white/45 sm:text-[11px]",children:"Tap to speak \xb7 tap again to stop \u2014 your answer sends automatically."}),(0,T.jsxs)("button",{type:"button",onClick:()=>kt((e=>!e)),className:"flex items-center justify-center gap-1.5 text-xs font-medium text-primary-700 transition hover:text-primary-800 dark:text-cyan-300/90 dark:hover:text-cyan-200",children:[wt?(0,T.jsx)(i.wAb,{className:"h-4 w-4"}):(0,T.jsx)(i.fK4,{className:"h-4 w-4"}),"Type answer instead"]}),(0,T.jsx)(l.N,{children:wt&&(0,T.jsxs)(n.P.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"w-full overflow-hidden",children:[(0,T.jsx)("textarea",{value:ut,onChange:e=>xt(e.target.value),rows:2,disabled:nt&&!ot||ct,placeholder:"Type your answer here\u2026",className:"w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500/25 disabled:opacity-50 dark:border-white/15 dark:bg-black/30 dark:text-white dark:placeholder:text-white/35 dark:focus:border-cyan-500/50 dark:focus:ring-cyan-500/30"}),(0,T.jsxs)("button",{type:"button",onClick:()=>{Xt(ut)},disabled:nt||ct||tr||!ut.trim(),className:"mt-2 flex w-full items-center justify-center gap-2 rounded-xl border border-slate-200 bg-slate-900 px-4 py-2.5 text-sm font-semibold text-white shadow-md transition hover:bg-slate-800 disabled:opacity-40 dark:border-white/10 dark:bg-white dark:text-slate-900 dark:hover:bg-white/90",children:[nt?(0,T.jsx)(i.TwU,{className:"h-5 w-5 animate-spin"}):(0,T.jsx)(i.kGk,{className:"h-5 w-5"}),"Send typed answer"]})]})})]})})]}),(0,T.jsx)(l.N,{children:vt&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(n.P.button,{type:"button",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[60] bg-slate-950/50 backdrop-blur-[2px] lg:hidden","aria-label":"Close conversation log",onClick:()=>jt(!1)}),(0,T.jsxs)(n.P.aside,{initial:{x:"100%",opacity:.85},animate:{x:0,opacity:1},exit:{x:"100%",opacity:.85},transition:{type:"spring",damping:28,stiffness:320},className:"fixed inset-y-0 right-0 z-[70] flex w-full max-w-md min-h-0 flex-col border-l border-slate-200 bg-white pt-[max(0px,env(safe-area-inset-top,0px))] shadow-2xl dark:border-white/10 dark:bg-slate-900 lg:relative lg:inset-auto lg:right-auto lg:z-0 lg:max-h-full lg:w-80 lg:min-h-0 lg:shrink-0 lg:self-stretch lg:rounded-2xl lg:border lg:pt-0 lg:shadow-xl",children:[(0,T.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-gray-200 px-3 py-2.5 dark:border-white/10 sm:px-4",children:[(0,T.jsx)("p",{className:"min-w-0 truncate text-xs font-semibold uppercase tracking-wide text-gray-600 dark:text-slate-400",children:"Conversation log"}),(0,T.jsx)("button",{type:"button",onClick:()=>jt(!1),className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg text-gray-600 transition hover:bg-gray-100 dark:text-slate-300 dark:hover:bg-white/10","aria-label":"Close conversation log",children:(0,T.jsx)(i.yGN,{className:"h-5 w-5"})})]}),(0,T.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden p-3 sm:p-4",children:(0,T.jsx)(D,{turns:st,draftPreview:ut,fillParent:!0})})]})]})})]})]},"live"),"done"===de&&(0,T.jsxs)(n.P.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},className:"mx-auto flex w-full max-w-4xl flex-col rounded-3xl border border-emerald-200/90 bg-gradient-to-b from-emerald-50 via-white to-slate-50/80 px-4 py-8 shadow-xl shadow-emerald-900/5 dark:border-emerald-500/20 dark:from-slate-900 dark:via-slate-900 dark:to-slate-950 sm:px-8 sm:py-10",children:[(0,T.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,T.jsx)(n.P.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:200,damping:15},className:"flex h-16 w-16 items-center justify-center rounded-full border border-emerald-300 bg-emerald-100 text-emerald-700 shadow-md dark:border-emerald-400/35 dark:bg-emerald-500/15 dark:text-emerald-200 dark:shadow-[0_0_32px_rgba(52,211,153,0.2)] sm:h-20 sm:w-20",children:(0,T.jsx)(i.FrA,{className:"h-8 w-8 sm:h-9 sm:w-9"})}),(0,T.jsx)("h2",{className:"mt-5 text-xl font-bold text-slate-900 dark:text-white sm:text-2xl",children:"Session complete"}),(0,T.jsx)("p",{className:"mt-1 text-xs font-medium uppercase tracking-wide text-primary-600 dark:text-cyan-400/90",children:U})]}),(0,T.jsxs)("div",{className:"mx-auto mt-6 w-full max-w-xl rounded-2xl border border-slate-200/90 bg-white p-4 text-left shadow-sm dark:border-white/10 dark:bg-slate-800/90 dark:shadow-none sm:p-5",children:[(0,T.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-emerald-700 dark:text-emerald-400/90",children:"Quick recap"}),(0,T.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-slate-800 dark:text-slate-100",children:Ve.trim()?Ve:"Great job finishing this run \u2014 review the conversation and coaching notes below when you are ready."})]}),(0,T.jsxs)("div",{className:"mt-6 grid w-full gap-5 text-left md:grid-cols-2 md:gap-6",children:[(0,T.jsx)("div",{className:"min-w-0 rounded-2xl border border-slate-200/90 bg-white/90 p-1 dark:border-white/10 dark:bg-slate-800/60 sm:p-0",children:(0,T.jsx)(D,{turns:st,variant:"summary"})}),(0,T.jsx)("div",{className:"flex min-h-0 flex-col gap-3",children:rt?(0,T.jsxs)("div",{className:"w-full rounded-2xl border border-slate-200/90 bg-white p-4 shadow-sm dark:border-emerald-500/15 dark:bg-slate-800/95 dark:shadow-[0_0_0_1px_rgba(16,185,129,0.08)] sm:p-5",children:[(0,T.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,T.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-violet-700 dark:text-violet-300",children:"Coaching feedback"}),(0,T.jsx)("button",{type:"button",onClick:()=>at(!1),className:"shrink-0 text-[11px] font-medium text-slate-500 underline decoration-slate-300 underline-offset-2 hover:text-slate-700 dark:text-slate-400 dark:decoration-white/20 dark:hover:text-slate-300",children:"Hide"})]}),(0,T.jsxs)("p",{className:"mt-1 text-[11px] leading-snug text-slate-500 dark:text-slate-400",children:["Optional: personalized tips from ",U," based on your answers. Uses one AI request."]}),He?(0,T.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-2 rounded-xl border border-slate-100 bg-slate-50/80 py-6 dark:border-white/5 dark:bg-slate-900/50",children:[(0,T.jsx)(i.TwU,{className:"h-6 w-6 animate-spin text-primary-600 dark:text-cyan-400"}),(0,T.jsx)("p",{className:"text-sm font-medium text-slate-700 dark:text-slate-200",children:"Preparing your feedback\u2026"})]}):et?(0,T.jsxs)("div",{className:"mt-4 rounded-xl border border-amber-200/80 bg-amber-50/90 p-3 dark:border-amber-500/25 dark:bg-amber-950/40",children:[(0,T.jsx)("p",{className:"text-sm text-amber-900 dark:text-amber-100/95",children:et}),(0,T.jsxs)("button",{type:"button",onClick:()=>{Gt()},className:"mt-3 inline-flex items-center gap-2 rounded-lg bg-amber-600 px-3 py-2 text-xs font-semibold text-white transition hover:bg-amber-500 dark:bg-amber-600 dar
1k:hover:bg-amber-500",children:[(0,T.jsx)(i.jTZ,{className:"h-3.5 w-3.5"}),"Try again"]})]}):Ze&&_(Ze)?(0,T.jsxs)("div",{className:"mt-4 space-y-4 text-sm text-slate-800 dark:text-slate-200",children:[Ze.summary?(0,T.jsx)("p",{className:"leading-relaxed text-slate-700 dark:text-slate-300",children:Ze.summary}):null,Ze.strengths.length>0?(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-emerald-700 dark:text-emerald-400",children:"Strengths"}),(0,T.jsx)("ul",{className:"mt-1.5 list-inside list-disc space-y-1.5 text-slate-700 dark:text-slate-300",children:Ze.strengths.map((e=>(0,T.jsx)("li",{children:e},e)))})]}):null,Ze.toImprove.length>0?(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-amber-800 dark:text-amber-300/90",children:"Level up"}),(0,T.jsx)("ul",{className:"mt-1.5 list-inside list-disc space-y-1.5 text-slate-700 dark:text-slate-300",children:Ze.toImprove.map((e=>(0,T.jsx)("li",{children:e},e)))})]}):null,Ze.nextFocus?(0,T.jsxs)("p",{className:"rounded-lg border border-primary-200/70 bg-primary-50/80 px-3 py-2.5 text-slate-800 dark:border-cyan-500/30 dark:bg-cyan-500/15 dark:text-slate-100",children:[(0,T.jsxs)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-primary-700 dark:text-cyan-300",children:["Next focus \xb7"," "]}),Ze.nextFocus]}):null]}):(0,T.jsxs)("div",{className:"mt-4 rounded-xl border border-dashed border-slate-200 bg-slate-50/50 p-4 dark:border-white/10 dark:bg-slate-900/30",children:[(0,T.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"No detailed coaching returned this time. Your quick recap above still summarizes the session."}),(0,T.jsx)("button",{type:"button",onClick:()=>{Gt()},className:"mt-3 text-xs font-semibold text-primary-600 hover:text-primary-700 dark:text-cyan-400 dark:hover:text-cyan-300",children:"Request feedback again"})]})]}):(0,T.jsx)("button",{type:"button",onClick:()=>{at(!0),He||Ze&&!et||Gt()},className:"w-full rounded-2xl border border-dashed border-slate-300 bg-slate-50/80 px-4 py-4 text-center text-sm font-medium text-slate-700 transition hover:border-primary-300 hover:bg-primary-50/50 dark:border-white/15 dark:bg-slate-800/50 dark:text-slate-200 dark:hover:border-cyan-500/30 dark:hover:bg-slate-800",children:"Show coaching feedback"})})]}),(0,T.jsx)("div",{className:"mx-auto mt-8 flex flex-col items-center gap-3 sm:flex-row sm:justify-center",children:(0,T.jsxs)("button",{type:"button",onClick:Jt,className:"inline-flex items-center gap-2 rounded-xl border border-slate-200 bg-white px-6 py-2.5 text-sm font-medium text-slate-800 shadow-sm transition hover:bg-slate-50 dark:border-white/10 dark:bg-slate-800 dark:text-slate-100 dark:hover:bg-slate-700/80",children:[(0,T.jsx)(i.jTZ,{className:"h-4 w-4"}),"New briefing"]})})]},"done")]})})]})]})}},3174:(e,t,r)=>{r.d(t,{s:()=>s});var a=r(5043);function s(e,t){const r=(0,a.useRef)(t);r.current=t,(0,a.useEffect)((()=>{if(!e)return;const t=e=>{"Escape"===e.key&&r.current()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e])}},3710:(e,t,r)=>{r.d(t,{J:()=>s});var a=r(932);function s(e){try{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const s=a.Ay.inflate(r);return(new TextDecoder).decode(s)}catch{return e}}},4015:(e,t,r)=>{async function a(e){const t=await Promise.all([r.e(6749),r.e(903)]).then(r.t.bind(r,6749,23));t.GlobalWorkerOptions.workerSrc="https://unpkg.com/[email protected]/build/pdf.worker.min.js";const a=t.getDocument(e),s=await a.promise;let i="";for(let r=1;r<=s.numPages;r++){const e=await s.getPage(r),t=(await e.getTextContent()).items.sort(((e,t)=>{const r=e.transform[5];return t.transform[5]-r})),a=[],n=3;for(const r of t){if(!("transform"in r))continue;const e=r.transform[5];if(""===("str"in r?r.str:"").trim())continue;let t=a.find((t=>Math.abs(t.y-e)<=n));t||(t={y:e,items:[]},a.push(t)),t.items.push(r)}a.sort(((e,t)=>t.y-e.y));i+=a.map((e=>e.items.filter((e=>"transform"in e)).sort(((e,t)=>e.transform[4]-t.transform[4])).map((e=>"str"in e?e.str:"")).join(" ").replace(/\s+/g," ").trim())).join("\n")+"\n\n"}return i.trim()}async function s(e){const t=URL.createObjectURL(e);try{return await a(t)}finally{URL.revokeObjectURL(t)}}r.d(t,{E:()=>a,H:()=>s})},6652:(e,t,r)=>{r.d(t,{zt:()=>s});var a=r(851);function s(e){var t,r,s,i;if(!e)return"";
1const n=[],l=[e.firstName,e.lastName].filter(Boolean).join(" ").trim();return l&&n.push(`Name: ${l}`),e.location&&n.push(`Location: ${e.location}`),e.summary&&n.push(`Professional summary:\n${(0,a.QZ)(e.summary)}`),e.technicalSkills&&n.push(`Technical skills: ${(0,a.QZ)(e.technicalSkills)}`),null!==(t=e.skills)&&void 0!==t&&t.length&&n.push(`Skills: ${e.skills.filter(Boolean).slice(0,60).map((e=>(0,a.QZ)(e))).filter(Boolean).join(", ")}`),null!==(r=e.experience)&&void 0!==r&&r.length&&e.experience.forEach((e=>{const t=[e.position,e.company,[e.startDate,e.endDate].filter(Boolean).join(" \u2013 ")].filter(Boolean).join(" \xb7 "),r=(0,a.QZ)(e.description||"").split("\n").map((e=>e.replace(/\s+/g," ").trim())).filter(Boolean).join("\n").slice(0,600);n.push(`Experience: ${t}${r?`\n${r}`:""}`)})),null!==(s=e.education)&&void 0!==s&&s.length&&e.education.forEach((e=>{n.push(`Education: ${[e.degree,e.school,e.major].filter(Boolean).join(", ")}`)})),null!==(i=e.certifications)&&void 0!==i&&i.length&&n.push(`Certifications: ${e.certifications.map((e=>e.name)).filter(Boolean).slice(0,15).join("; ")}`),n.join("\n\n").slice(0,14e3)}}}]); 2//# sourceMappingURL=8953.d43816fa.chunk.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.