1import{a2 as Bt,u as _t,t as Ct,b as gt,c as r,cK as Mt,A as Et,f as Pt,h$ as Dt,j as t,aA as zt,x as tt,i as ye,Q as Nt}from"./index-B9q78oLf.js";import{c as $t}from"./conversationalInterview-DIIC78VZ.js";import{u as Wt}from"./use-animation-frame-D7FTHVTK.js";const Lt=m=>{const b=String(Math.floor(m/60)).padStart(2,"0"),A=String(m%60).padStart(2,"0");return`${b}:${A}`},rt=m=>{const b=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(m);return b?{r:parseInt(b[1],16),g:parseInt(b[2],16),b:parseInt(b[3],16)}:null},Ot=(m,b,A)=>"#"+[m,b,A].map(v=>{const f=Math.round(v).toString(16);return f.length===1?"0"+f:f}).join(""),E=(m,b,A)=>{const v=rt(m),f=rt(b);if(!v||!f)return m;const w=v.r+(f.r-v.r)*A,H=v.g+(f.g-v.g)*A,ee=v.b+(f.b-v.b)*A;return Ot(w,H,ee)},xt=(m,b,A)=>{const v=P=>{if(P.startsWith("rgba")){const F=P.match(/rgba?\((\d+),\s*(\d+),\s*(\d+),?\s*([\d.]+)?\)/);if(F)return{r:parseInt(F[1]),g:parseInt(F[2]),b:parseInt(F[3]),a:parseFloat(F[4]||1)}}const O=rt(P);return O?{...O,a:1}:{r:255,g:255,b:255,a:1}},f=v(m),w=v(b),H=f.r+(w.r-f.r)*A,ee=f.g+(w.g-f.g)*A,M=f.b+(w.b-f.b)*A,R=f.a+(w.a-f.a)*A;return`rgba(${Math.round(H)}, ${Math.round(ee)}, ${Math.round(M)}, ${R.toFixed(2)})`},Ze=m=>({color:m,fontSize:"11px",fontWeight:"700",letterSpacing:"0.5px",textTransform:"uppercase",marginBottom:"4px"}),T={background:"#F4F2F8",cardBackground:"#FFFFFF",cardBorder:"#E5E7EE",transcriptBackground:"#FFFFFF",transcriptBorder:"#D9D9D9",textPrimary:"#1B1B1B",textSecondary:"#424242",textMuted:"#A2A2A2",textTranscript:"#B0B0B0",timerBackground:"#FFFFFF",recordingBarBackground:"#FFFFFF",buttonBackground:"#FFFFFF",buttonBorder:"#502F99",buttonText:"#502F99",separatorColor:"#1B1B1B",waveformActive:"#6B3BAB",waveformInactive:"#D9D9D9"},j={background:"#16151A",cardBackground:"#1F1E25",cardBorder:"#36353C",transcriptBackground:"rgba(31, 30, 37, 0.3)",transcriptBorder:"#36353C",textPrimary:"#FFFFFF",textSecondary:"#A2A2A2",textMuted:"#A2A2A2",textTranscript:"#B0B0B0",timerBackground:"#1F1E25",recordingBarBackground:"#1F1E25",buttonBackground:"#1F1E25",buttonBorder:"rgba(255, 255, 255, 0.2)",buttonText:"#A2A2A2",separatorColor:"#FFFFFF",waveformActive:"#6B3BAB",waveformInactive:"#36353C"},Ut=600,Ht=.04,ht=50,Gt=500,qt=3,Jt=800,Yt=6e3,Kt=250,mt=5e3,yt=[{size:150,color:"#4B00B4",opacity:.6,blur:18,breathDur:4,freq:1,phase:0},{size:135,color:"#8B5CF6",opacity:.55,blur:16,breathDur:5.5,freq:.75,phase:Math.PI*.7},{size:140,color:"#a855f7",opacity:.5,blur:20,breathDur:3.2,freq:1.3,phase:Math.PI*1.4},{size:125,color:"#2D1B69",opacity:.5,blur:22,breathDur:6,freq:.6,phase:Math.PI*2.1}],et=10;function Qt({isConnected:m,isSpeaking:b,logoSrc:A}){const v=r.useRef([]),f=r.useRef(null),w=r.useRef([]),H=r.useRef(b),ee=r.useRef(m);return r.useEffect(()=>{H.current=b},[b]),r.useEffect(()=>{ee.current=m},[m]),Wt(M=>{const R=M/1e3,P=H.current,O=ee.current,F=O?P?2:1:.2,U=O?P?1.5:1:.3,ke=O?1:.15;if(yt.forEach((B,Q)=>{const S=v.current[Q];if(!S)return;const te=R*F,ue=B.freq,V=B.phase,_=[];for(let q=0;q<8;q++)_.push(Math.round(40+20*U*Math.sin(te*ue+V+q*.9)));S.style.borderRadius=`${_[0]}% ${_[1]}% ${_[2]}% ${_[3]}% / ${_[4]}% ${_[5]}% ${_[6]}% ${_[7]}%`;const G=1+.06*U*Math.sin(te*(2*Math.PI)/B.breathDur+V),de=(Q%2===0?1:-1)*15*F,se=R*de%360;S.style.transform=`scale(${G.toFixed(4)}) rotate(${se.toFixed(2)}deg)`,S.style.opacity=(B.opacity*ke).toFixed(3)}),f.current){const B=O?.8:.1,S=1+.15*Math.sin(R*F*1.5),te=B+B*.3*Math.sin(R*F*1.2);f.current.style.transform=`scale(${S.toFixed(4)})`,f.current.style.opacity=te.toFixed(3)}for(let B=0;B<et;B++){const Q=w.current[B];if(!Q)continue;const S=B/et*Math.PI*2+R*F*.3,te=85+10*Math.sin(R*F*.5+B*1.2),ue=Math.cos(S)*te,V=Math.sin(S)*te;Q.style.transform=`translate(${ue.toFixed(1)}px, ${V.toFixed(1)}px)`,Q.style.opacity=O?P?(.4+.3*Math.sin(R*3+B)).toFixed(2):(.3+.1*Math.sin(R+B)).toFixed(2):"0.05"}}),t.jsxs("div",{style:{width:200,height:200,position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx("div",{ref:f,style:{position:"absolute",width:180,height:180,borderRadius:"50%",background:"radial-gradient(circle, rgba(139,92,246,0.25) 0%, rgba(107,59,171,0.12) 40%, transparent 70%)",filter:"blur(30px)",willChange:"transform, opacity"}}),yt.map((M,R)=>t.jsx("div",{ref:P=>v.current[R]=P,style:{position:"absolute",width:M.size,height:M.size,background:`radial-gradient(circle at 40% 40%, ${M.color}cc, ${M.color}88 50%, ${M.color}
133 100%)`,filter:`blur(${M.blur}px)`,opacity:M.opacity,willChange:"transform, border-radius, opacity",zIndex:R+1}},R)),Array.from({length:et}).map((M,R)=>t.jsx("div",{ref:P=>w.current[R]=P,style:{position:"absolute",width:3,height:3,borderRadius:"50%",background:"#a855f7",opacity:.3,willChange:"transform, opacity",zIndex:5}},`p-${R}`)),t.jsx(tt.div,{style:{position:"relative",width:60,height:60,borderRadius:"50%",background:"transparent",border:"none",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10},animate:{scale:m?[1,1.04,1]:.95,opacity:m?1:.25},transition:m?{scale:{repeat:1/0,duration:3,ease:"easeInOut"},opacity:{type:"spring",stiffness:100,damping:15}}:{type:"spring",stiffness:100,damping:15},children:t.jsx("img",{src:A,alt:"Avua AI",style:{width:36,height:36,objectFit:"contain",filter:b?"brightness(1.5) drop-shadow(0 0 14px rgba(139, 92, 246, 0.8))":"brightness(1.2) drop-shadow(0 0 8px rgba(139, 92, 246, 0.5))",transition:"filter 0.6s ease"}})})]})}function er(){const m=Bt(),b=_t(),A=Ct(),v=gt(e=>e.auth.token),f=gt(e=>e.deferredApply.jobId),{interviewRoomId:w,audioSource:H,jobTitle:ee,jobDescription:M,experienceLevel:R,language:P,technicalRatio:O,culturalFit:F}=m.state||{};console.log("[DEBUG culturalFit] InterviewStart received:",F);const[U,ke]=r.useState(!1),[B,Q]=r.useState(!1),[S,te]=r.useState(ee||""),[ue,V]=r.useState(!1),[_,re]=r.useState([]),[G,de]=r.useState(""),[se,q]=r.useState(""),[pe,nt]=r.useState(!1),[De,ze]=r.useState(0),[ne,bt]=r.useState(0),[Ne,ot]=r.useState(!1),[vt,st]=r.useState(!1),[wt,Rt]=r.useState(""),[kt,St]=r.useState("error"),[It,it]=r.useState(!1),[Se,Tt]=r.useState(!1),[Ie,jt]=r.useState(!1),[y,At]=r.useState(window.innerWidth<768);r.useEffect(()=>{const e=()=>At(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const J=r.useMemo(()=>Se===!0?1:Se===!1?0:Math.min(ne/Ut,1),[ne,Se]),o=r.useMemo(()=>{const e=J;return{background:E(T.background,j.background,e),cardBackground:E(T.cardBackground,j.cardBackground,e),cardBorder:E(T.cardBorder,j.cardBorder,e),transcriptBackground:xt(T.transcriptBackground,j.transcriptBackground,e),transcriptBorder:E(T.transcriptBorder,j.transcriptBorder,e),textPrimary:E(T.textPrimary,j.textPrimary,e),textSecondary:E(T.textSecondary,j.textSecondary,e),textMuted:E(T.textMuted,j.textMuted,e),textTranscript:E(T.textTranscript,j.textTranscript,e),timerBackground:E(T.timerBackground,j.timerBackground,e),recordingBarBackground:E(T.recordingBarBackground,j.recordingBarBackground,e),buttonBackground:E(T.buttonBackground,j.buttonBackground,e),buttonBorder:xt(T.buttonBorder,j.buttonBorder,e),buttonText:E(T.buttonText,j.buttonText,e),separatorColor:E(T.separatorColor,j.separatorColor,e),waveformActive:E(T.waveformActive,j.waveformActive,e),waveformInactive:E(T.waveformInactive,j.waveformInactive,e)}},[J]),Ft=r.useCallback(()=>{Tt(e=>!e)},[]),Y=r.useCallback((e,u="error")=>{Rt(e),St(u),it(!0)},[]),be=r.useRef(null),$e=r.useRef(null),ie=r.useRef(null),at=r.useRef(null),Te=r.useRef(null),ve=r.useRef(null),we=r.useRef(null),ae=r.useRef(null),je=r.useRef(null),C=r.useRef(""),x=r.useRef(null),fe=r.useRef(null),Ae=r.useRef(null),Fe=r.useRef(""),We=r.useRef(!1),ce=r.useRef(!0),Le=r.useRef(!1),z=r.useRef([]),K=r.useRef(null),Oe=r.useRef([]),Ue=r.useRef(null),ge=r.useRef(""),He=r.useRef(null),Ge=r.useRef(!1),Be=r.useRef(!1),D=r.useRef(null),_e=r.useRef(!1),Ce=r.useRef(!1),N=r.useRef(null),Me=r.useRef(!1),qe=r.useRef(null),Ee=r.useRef(null),Je=r.useRef(null),Ye=r.useRef(null),oe=r.useRef(null),ct=r.useRef(0),Ke=r.useRef({voiceMs:0,quietTicks:0}),lt=r.useRef(!1),$=r.useRef(new Set),xe=r.useRef({}),Re=r.useRef(new Set);r.useEffect(()=>{Fe.current=G},[G]),r.useEffect(()=>{We.current=U},[U]),r.useEffect(()=>{z.current=_},[_]);const he=r.useCallback(e=>{(ae.current?.getAudioTracks()||[]).forEach(n=>{n.enabled=e})},[]),le=r.useCallback(()=>{oe.current&&(clearInterval(oe.current),oe.current=null),Ke.current={voiceMs:0,quietTicks:0}},[]),ut=r.useCallback(e=>{le();const u=Ae.current;if(!(!u||u.readyState!=="open")){console.log(`[BARGE-IN] sustained voice during assistant audio (rms=${e.toFixed(3)}
1) â cancelling response`);try{u.send(JSON.stringify({type:"response.cancel"})),u.send(JSON.stringify({type:"output_audio_buffer.clear"}))}catch(n){console.error("[BARGE-IN] failed to send cancel events:",n)}_e.current=!1,he(!0),D.current&&(clearTimeout(D.current),D.current=null)}},[he,le]),dt=r.useCallback(()=>{if(oe.current)return;const e=Je.current;e&&(Ke.current={voiceMs:0,quietTicks:0},ct.current=Date.now(),oe.current=setInterval(()=>{if(Ce.current||Me.current){le();return}const u=ie.current;if(!u||u.state!=="running"){u?.resume?.().catch(()=>{});return}if(Date.now()-ct.current<Jt)return;const n=Ye.current;e.getFloatTimeDomainData(n);let s=0;for(let i=0;i<n.length;i++)s+=n[i]*n[i];const a=Math.sqrt(s/n.length),l=Ke.current;a>Ht?(l.quietTicks=0,l.voiceMs+=ht,l.voiceMs>=Gt&&ut(a)):(l.quietTicks+=1,l.quietTicks>=qt&&(l.voiceMs=0))},ht))},[le,ut]),pt=r.useCallback(e=>{const{type:u}=e;switch(u){case"input_audio_buffer.committed":e.item_id&&($.current.add(e.item_id),ze($.current.size),console.log("[TRANSCRIPT] audio committed, awaiting transcription:",e.item_id));break;case"conversation.item.input_audio_transcription.delta":e.item_id&&(xe.current[e.item_id]=(xe.current[e.item_id]||"")+(e.delta||"")),de(n=>n+(e.delta||""));break;case"conversation.item.input_audio_transcription.completed":{e.item_id?$.current.delete(e.item_id):$.current.clear(),ze($.current.size);const n=(e.transcript||"").trim(),s=(e.item_id&&xe.current[e.item_id]||Fe.current||"").trim();e.item_id&&delete xe.current[e.item_id];const a=s.length>n.length?s:n;s.length>n.length&&console.log("[TRANSCRIPT] deltas longer than completed transcript â using deltas"),console.log("[TRANSCRIPT] user done:",a),a&&re(l=>{const i=l[l.length-1];if(Me.current&&i?.role==="user"&&a.startsWith(i.content)){const p=[...l.slice(0,-1),{role:"user",content:a,timestamp:Date.now()}];return z.current=p,p}const d=[...l,{role:"user",content:a,timestamp:Date.now()}];return z.current=d,d}),de("");break}case"conversation.item.input_audio_transcription.failed":{console.error("[TRANSCRIPT] user transcription failed:",e.error||e),e.item_id?$.current.delete(e.item_id):$.current.clear(),ze($.current.size);const n=(e.item_id&&xe.current[e.item_id]||Fe.current||"").trim();e.item_id&&delete xe.current[e.item_id],n&&(console.log("[TRANSCRIPT] salvaging partial transcript after failure:",n),re(s=>{const a=[...s,{role:"user",content:n,timestamp:Date.now()}];return z.current=a,a})),de("");break}case"response.created":Be.current=!0;break;case"response.output_audio_transcript.delta":console.log("[TRANSCRIPT] output_audio_transcript.delta:",e.delta),Be.current=!0,C.current+=e.delta||"",x.current||(x.current=setInterval(()=>{if(C.current.length>0){const n=C.current.slice(0,2);C.current=C.current.slice(2),q(s=>s+n)}else clearInterval(x.current),x.current=null},60));break;case"response.output_audio_transcript.done":{console.log("[TRANSCRIPT] output_audio_transcript.done:",e.transcript),e.item_id&&Re.current.add(e.item_id),x.current&&(clearInterval(x.current),x.current=null);const n=(e.transcript||"").trim();C.current="",q(()=>(n&&re(s=>{const a=[...s].reverse().find(l=>l.role==="assistant");return a&&a.content===n?s:[...s,{role:"assistant",content:n,timestamp:Date.now()}]}),""));break}case"response.output_text.delta":console.log("[TRANSCRIPT] output_text.delta:",e.delta),C.current+=e.delta||"",x.current||(x.current=setInterval(()=>{if(C.current.length>0){const n=C.current.slice(0,2);C.current=C.current.slice(2),q(s=>s+n)}else clearInterval(x.current),x.current=null},60));break;case"response.output_text.done":{console.log("[TRANSCRIPT] output_text.done:",e.text),e.item_id&&Re.current.add(e.item_id),x.current&&(clearInterval(x.current),x.current=null);const n=(e.text||"").trim();C.current="",q(()=>(n&&re(s=>[...s,{role:"assistant",content:n,timestamp:Date.now()}]),""));break}case"response.done":{console.log("[TRANSCRIPT] response.done:",e.response),x.current&&(clearInterval(x.current),x.current=null),C.current="";const n=(e.response?.output||[]).filter(s=>!(s.id&&Re.current.has(s.id))).map(s=>({id:s.id,content:(s.content||[]).map(a=>
1a.transcript||a.text||"").filter(Boolean).join(" ").trim()})).filter(s=>s.content);q(()=>(n.length>0&&re(s=>{let a=s;return n.forEach(({id:l,content:i})=>{l&&Re.current.add(l);const d=[...a].reverse().find(p=>p.role==="assistant");d&&d.content===i||(a=[...a,{role:"assistant",content:i,timestamp:Date.now()}])}),a}),""));break}case"input_audio_buffer.speech_started":nt(!0);break;case"input_audio_buffer.speech_stopped":nt(!1);break;case"output_audio_buffer.started":Be.current=!0,_e.current=!0,he(!1),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{D.current=null,he(!0),le()},6e4),dt();break;case"output_audio_buffer.stopped":case"output_audio_buffer.cleared":_e.current=!1,he(!0),le(),D.current&&(clearTimeout(D.current),D.current=null),Ce.current&&N.current&&(clearTimeout(N.current),N.current=setTimeout(()=>{N.current=null,ce.current&&qe.current?.()},1500));break;case"error":{console.error("[Realtime error]",e.error||e);const n=JSON.stringify(e.error||e);!lt.current&&/turn_detection|semantic_vad|eagerness/i.test(n)&&Ae.current?.readyState==="open"&&(lt.current=!0,console.warn("[VAD] turn_detection rejected â re-sending patient server_vad"),Ae.current.send(JSON.stringify({type:"session.update",session:{type:"realtime",audio:{input:{transcription:{model:"gpt-4o-transcribe"},turn_detection:{type:"server_vad",threshold:.6,prefix_padding_ms:300,silence_duration_ms:mt,create_response:!0,interrupt_response:!0}}}}})));break}}if(e.transcript&&e.transcript.toLowerCase().includes("end_of_interview")&&!Ce.current){Ce.current=!0;const n=_e.current?2e4:5e3;N.current=setTimeout(()=>{N.current=null,ce.current&&qe.current?.()},n)}},[he,dt,le]),Pe=r.useCallback(()=>{const e=$e.current;if(!e)return;const u=e.getContext("2d"),n=at.current,s=()=>{if(!ce.current)return;Te.current=requestAnimationFrame(s);const a=e.width,l=e.height;if(u.fillStyle="#000000",u.fillRect(0,0,a,l),!We.current||!n){const i=Date.now()/1e3,d=window.innerWidth<768?40:70,p=a/d;for(let k=0;k<d;k++){const c=k*p,h=20+Math.sin(i*2+k*.3)*10,g=u.createLinearGradient(0,0,0,l);g.addColorStop(0,"#00FFA3"),g.addColorStop(1,"#00AA66"),u.fillStyle=g,u.fillRect(c,l/2-h/2,p-2,h)}}else{const i=n.frequencyBinCount,d=new Uint8Array(i);n.getByteFrequencyData(d);const p=window.innerWidth<768?40:70,k=a/p;for(let c=0;c<p;c++){const h=Math.floor(c/p*i),g=d[h]/255*l*.8,I=c*k,W=l/2-g/2,Z=d[h]/255,L=Math.floor(Z*0),me=Math.floor(255*Z),ft=Math.floor(163*Z),Xe=u.createLinearGradient(0,W,0,W+g);Xe.addColorStop(0,`rgb(${L}, ${me+50}, ${ft+50})`),Xe.addColorStop(1,`rgb(${L}, ${me}, ${ft})`),u.fillStyle=Xe,u.fillRect(I,W,k-2,g||2)}}};s()},[]),X=r.useCallback(()=>{if(be.current){try{be.current.signalingState!=="closed"&&be.current.close()}catch(e){console.error("Error closing peer connection:",e)}be.current=null}if(ie.current){try{ie.current.state!=="closed"&&ie.current.close()}catch(e){console.error("Error closing audio context:",e)}ie.current=null,He.current=null,Ge.current=!1}if(ve.current){try{ve.current.pause(),ve.current.srcObject=null}catch(e){console.error("Error cleaning up audio element:",e)}ve.current=null}if(ae.current){try{ae.current.getTracks().forEach(e=>e.stop())}catch(e){console.error("Error stopping local stream tracks:",e)}ae.current=null}if(K.current){try{K.current.state!=="inactive"&&(console.log("Stopping media recorder during cleanup"),K.current.stop())}catch(e){console.error("Error stopping media recorder:",e)}K.current=null,Oe.current=[],Ue.current=null}if(we.current)try{we.current.srcObject=null}catch(e){console.error("Error cleaning up video element:",e)}if(x.current&&(clearInterval(x.current),x.current=null),C.current="",Re.current.clear(),D.current&&(clearTimeout(D.current),D.current=null),oe.current&&(clearInterval(oe.current),oe.current=null),Ee.current){try{Ee.current.stop()}catch(e){console.error("Error stopping mic monitor track:",e)}Ee.current=null}Je.current=null,Ye.current=null,N.current&&(clearTimeout(N.current),N.current=null),fe.current&&(clearInterval(fe.current),fe.current=null),Te.current&&(cancelAnimationFrame(Te.current),Te.current=null)},[]),Qe=r.useCallback(async()=>
1{if(!Me.current){Me.current=!0;try{jt(!0),N.current&&(clearTimeout(N.current),N.current=null),fe.current&&clearInterval(fe.current);const e=Date.now();for($.current.size>0&&console.log("[TRANSCRIPT] draining",$.current.size,"pending transcription(s)...");$.current.size>0&&Date.now()-e<Yt;)await new Promise(i=>setTimeout(i,Kt));$.current.size>0&&console.warn("[TRANSCRIPT] drain timed out; flushing partial deltas instead"),x.current&&(clearInterval(x.current),x.current=null);const u=C.current;C.current="",q(i=>{const d=(i+u).trim();return d&&re(p=>{const k=[...p].reverse().find(h=>h.role==="assistant");if(k&&k.content===d)return p;const c=[...p,{role:"assistant",content:d,timestamp:Date.now()}];return z.current=c,c}),""});const n=(Fe.current||"").trim(),s=z.current[z.current.length-1],a=s?.role==="user"&&s.content.startsWith(n);n&&!a&&(re(i=>{const d=[...i,{role:"user",content:n,timestamp:Date.now()}];return z.current=d,d}),de("")),await new Promise(i=>setTimeout(i,100));let l=null;try{K.current&&K.current.state!=="inactive"&&(console.log("Stopping audio recording..."),await new Promise(d=>{const p=K.current.onstop;K.current.onstop=k=>{p&&p(k),d()},K.current.stop()}),console.log("Audio recording stopped successfully"));const i=Ue.current;if(i&&i.size>0){const p=ge.current&&ge.current.includes("webm")?"webm":"mp4",k=`conv_interview_${w}_${Mt()}.${p}`;console.log("Getting presigned URL for audio upload:",k);const{data:{data:c}}=await Et(k,"smarthire_audio_file",v);console.log("Presigned URL received, uploading to S3...",{fileName:k,size:i.size,mimeType:ge.current});const h=async()=>{try{return await Pt.put(c.url,i,{headers:{"Content-Type":c.type}})}catch(I){return console.error("S3 upload attempt failed:",I),{status:null}}};let g=await h();g?.status!==200&&(console.warn("Audio upload failed, retrying once..."),g=await h()),g?.status===200?(l=c?.path,console.log("Audio uploaded successfully to S3:",l)):console.error("Audio upload failed after retry")}}catch(i){console.error("Error uploading interview audio:",i)}if(w)try{const d=z.current.map(({role:p,content:k})=>({role:p,content:k}));if(d.length===0)console.warn("No messages to submit. Skipping report submission.");else{const p=await Dt(w,f,d,v,l,"main")}}catch(i){console.error("Error generating report and applying:",i)}X(),await new Promise(i=>setTimeout(i,3e3)),b("/interview/conversational/interview/end",{state:{interviewRoomId:w,transcripts:z.current,duration:ne,interviewType:"conversational",alreadyApplied:!0}})}catch(e){console.error("Error ending interview:",e),X(),Y("Failed to end interview properly. Redirecting anyway...","error"),setTimeout(()=>{b("/interview/conversational/interview/end",{state:{interviewRoomId:w,transcripts:z.current,duration:ne,interviewType:"conversational",alreadyApplied:!0}})},2e3)}}},[w,v,f,ne,X,b,Y]);r.useEffect(()=>{qe.current=Qe},[Qe]);const Ve=r.useCallback(async()=>{if(!(ue||U)){if(!S.trim()){Y("Job title is required to start the interview","error");return}V(!0);try{const u={iceServers:[{urls:"stun:stun.l.google.com:19302"}]},n=new RTCPeerConnection(u);be.current=n;const s=n.createDataChannel("oai-events");Ae.current=s,s.onopen=()=>{ke(!0),Q(!0),s.send(JSON.stringify({type:"session.update",session:{modalities:["audio","text"],output_audio_format:"pcm16",input_audio_transcription:{model:"gpt-4o-transcribe"}}})),s.send(JSON.stringify({type:"session.update",session:{type:"realtime",audio:{input:{transcription:{model:"gpt-4o-transcribe"},turn_detection:{type:"server_vad",threshold:.6,prefix_padding_ms:300,silence_duration_ms:mt,create_response:!0,interrupt_response:!0}}}}})),setTimeout(()=>{Be.current||s.send(JSON.stringify({type:"response.create"}))},1e3),fe.current=setInterval(()=>{bt(c=>c+1)},1e3)},s.onmessage=c=>{try{const h=JSON.parse(c.data);console.log("Realtime event:",h),pt(h)}catch(h){console.error("Error parsing data channel message:",h)}},s.onerror=c=>{console.error("Data channel error:",c),Y("Connection error occurred. Please check your network.","error")},s.onclose=()=>{};const a=await navigator.mediaDevices.getUserMedia({audio:{deviceId:H?{exact:H}:void 0,echoCancellation:!0,noiseSuppression:!0,sampleRate:48e3},video:{width:{ideal:391},height:{ideal:249},facingMode:"user"}});
1if(!ce.current){a.getTracks().forEach(c=>c.stop());return}ae.current&&ae.current.getTracks().forEach(c=>c.stop()),ae.current=a,we.current&&(we.current.srcObject=a);const l=new(window.AudioContext||window.webkitAudioContext);ie.current=l,l.state==="suspended"&&l.resume().catch(()=>{});const i=l.createAnalyser();i.fftSize=256,at.current=i;const d=l.createMediaStreamSource(a);d.connect(i);try{const c=a.getAudioTracks()[0];if(c){const h=c.clone();Ee.current=h;const g=l.createMediaStreamSource(new MediaStream([h])),I=l.createAnalyser();I.fftSize=1024,g.connect(I),Je.current=I,Ye.current=new Float32Array(I.fftSize)}}catch(c){console.error("[BARGE-IN] failed to create mic monitor:",c)}Pe();try{const c=l.createMediaStreamDestination();He.current=c,d.connect(c);const h=["audio/mp4","audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus"];let g="";for(const L of h)if(MediaRecorder.isTypeSupported(L)){g=L;break}console.log("Selected recording MIME type:",g||"browser default"),ge.current=g;const I=g?{mimeType:g}:{},W=new MediaRecorder(c.stream,I),Z=[];Oe.current=Z,W.ondataavailable=L=>{L.data.size>0&&Z.push(L.data)},W.onstop=()=>{console.log("Finished stopping recording");const L=ge.current||"audio/mp4",me=new Blob(Z,{type:L});console.log("Audio blob created:",{size:me.size,type:me.type,recordedAs:ge.current}),Oe.current=Z,Ue.current=me},W.onerror=L=>{console.error("Recorder error:",L.error)},console.log("Starting audio recording now..."),W.start(1e3),K.current=W,console.log("Audio recording started")}catch(c){console.error("Failed to start audio recording:",c)}if(n.signalingState==="closed")throw console.error("Peer connection is closed! Cannot add tracks."),new Error("Peer connection was closed during initialization");a.getTracks().forEach(c=>{n.addTrack(c,a)}),n.ontrack=c=>{const[h]=c.streams,g=new Audio;g.srcObject=h,g.autoplay=!0,ve.current=g,g.play().catch(I=>{console.error("Error playing remote audio:",I)});try{const I=ie.current,W=He.current;I&&I.state!=="closed"&&W&&!Ge.current&&(I.createMediaStreamSource(h).connect(W),Ge.current=!0)}catch(I){console.error("Failed to mix assistant audio into recording:",I)}};const p=await n.createOffer();await n.setLocalDescription(p),console.log("[DEBUG culturalFit] InterviewStart â RTC connect:",F);const k=await $t(p.sdp,{jobTitle:S,jobDescription:M,experienceLevel:R,language:P,technicalRatio:O,culturalFit:F,interviewRoomId:w},v);await n.setRemoteDescription({type:"answer",sdp:k}),V(!1)}catch(e){console.error("Error initializing connection:",e),V(!1),X(),e.name==="NotAllowedError"||e.name==="NotFoundError"?Y("Please allow microphone and camera access to start the interview","error"):e.message?.includes("RTCPeerConnection")||e.message?.includes("RTCIceServer")?(Y("Network configuration error. Please check your connection and try again.","error"),console.error("RTCPeerConnection configuration error:",e.message)):e.message==="Network Error"?ot(!0):e.message?.includes("Peer connection was closed")?Y("Connection was interrupted. Please try again.","error"):st(!0)}}},[ue,U,S,M,R,P,O,H,pt,Pe,Y,X]);return r.useCallback(()=>{const e=z.current;e.map(({role:l,content:i})=>({role:l,content:i}));const u={interviewRoomId:w,jobTitle:S,duration:ne,timestamp:Date.now(),transcripts:e},n=new Blob([JSON.stringify(u,null,2)],{type:"application/json"}),s=URL.createObjectURL(n),a=document.createElement("a");a.href=s,a.download=`interview_${w}_${Date.now()}.json`,a.click(),URL.revokeObjectURL(s)},[w,S,ne]),r.useEffect(()=>{je.current&&(je.current.scrollTop=je.current.scrollHeight)},[_,se,G]),r.useEffect(()=>{$e.current&&Pe()},[Pe]),r.useEffect(()=>{if(Le.current)return;if(!S.trim()){console.error("Job title is empty or invalid!"),Y("Job title is required. Please go back to the previous screen.","error");return}const e=setTimeout(()=>{Le.current||(Le.current=!0,ce.current&&!We.current&&Ve())},100);return()=>{clearTimeout(e)}},[S,Y,Ve]),r.useEffect(()=>(ce.current=!0,()=>{ce.current=!1,X()}),[X]),t.jsxs("div",{style:{minHeight:"100vh",width:"100%",background:o.background,color:o.textPrimary,fontFamily:"Poppins, sans-serif",position:"relative",overflow:"hidden",transition:"background 0.5s ease, color 0.5s ease"},children:[(Ne||vt)&&t.jsx("div",{style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)"}
1,children:t.jsxs("div",{style:{background:o.cardBackground,border:`1px solid ${o.cardBorder}`,borderRadius:"20px",padding:"40px 36px 32px",maxWidth:"400px",width:"90%",textAlign:"center",boxShadow:"0 8px 32px rgba(0,0,0,0.25)",transition:"background 0.5s ease, border 0.5s ease"},children:[t.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"50%",background:"rgba(239, 68, 68, 0.12)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:t.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",children:t.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{style:{color:o.textPrimary,fontSize:"20px",fontWeight:600,margin:"0 0 8px",fontFamily:"Poppins, sans-serif",transition:"color 0.5s ease"},children:Ne?"Connection Lost":"Something Went Wrong"}),t.jsx("p",{style:{color:o.textSecondary,fontSize:"14px",lineHeight:"1.5",margin:"0 0 28px",fontFamily:"Poppins, sans-serif",transition:"color 0.5s ease"},children:Ne?"Your network connection was interrupted. Please check your internet and try again.":"An unexpected error occurred. Please try again or return to the home page."}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[t.jsx("button",{onClick:()=>{ot(!1),st(!1),X(),ke(!1),V(!1),setTimeout(()=>Ve(),100)},style:{width:"100%",padding:"12px 24px",borderRadius:"12px",border:"none",background:"linear-gradient(135deg, #6B3BAB, #4B00B4)",color:"#FFFFFF",fontSize:"15px",fontWeight:600,fontFamily:"Poppins, sans-serif",cursor:"pointer",transition:"opacity 0.2s ease"},onMouseEnter:e=>e.currentTarget.style.opacity="0.9",onMouseLeave:e=>e.currentTarget.style.opacity="1",children:"Try Again"}),t.jsx("button",{onClick:()=>{X(),A(zt()),window.location.href="/"},style:{width:"100%",padding:"12px 24px",borderRadius:"12px",border:`1px solid ${o.buttonBorder}`,background:"transparent",color:o.textSecondary,fontSize:"15px",fontWeight:500,fontFamily:"Poppins, sans-serif",cursor:"pointer",transition:"color 0.5s ease, border 0.5s ease"},children:"Go to Home"})]})]})}),Ie&&t.jsx(tt.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.4,ease:"easeOut"},style:{position:"fixed",inset:0,zIndex:1e4,background:o.background,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",fontFamily:"Poppins, sans-serif"},children:t.jsxs(tt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.15,ease:"easeOut"},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"28px"},children:[t.jsxs("div",{style:{position:"relative",width:120,height:120},children:[[0,1,2].map(e=>t.jsx("div",{style:{position:"absolute",inset:`${e*14}px`,borderRadius:"50%",border:`2px solid ${o.waveformActive}`,opacity:.6-e*.15,animation:`endingPulse 2s ease-in-out ${e*.3}s infinite`}},e)),t.jsx("div",{style:{position:"absolute",inset:"42px",borderRadius:"50%",background:o.waveformActive,opacity:.25,animation:"endingPulse 2s ease-in-out 0.1s infinite"}})]}),t.jsxs("div",{style:{textAlign:"center"},children:[t.jsx("p",{style:{fontSize:"20px",fontWeight:600,color:o.textPrimary,margin:"0 0 8px 0",transition:"color 0.5s ease"},children:"Wrapping up your interview..."}),t.jsx("p",{style:{fontSize:"14px",fontWeight:400,color:o.textSecondary,margin:0,transition:"color 0.5s ease"},children:"Please wait while we save your responses"})]})]})}),t.jsxs("div",{style:{width:"100%",maxWidth:"1440px",margin:"0 auto",display:"flex",justifyContent:"space-between",alignItems:"center",padding:"14px 24px",background:o.background,transition:"background 0.5s ease",borderBottom:`1px solid ${o.cardBorder}`},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"13px"},children:[t.jsx("img",{src:ye.CommonHeader?.avua_header_logo,alt:"Avua Logo",style:{height:"18px",filter:J>.5?"brightness(0) invert(1)":"none",transition:"filter 0.5s ease"}}),!y&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{fontSize:"17.78px",fontWeight:"500",color:o.separatorColor,lineHeight:"1.2",transition:"color 0.5s ease"},children:"|"}),t.jsx("span",{style:{fontSize:"13px",fontWeight:"500",color:o.textSecondary,lineHeight:"1.2",transition:"color 0.5s ease",border:`1px solid ${o.cardBorder}`,padding:"7px 14px",borderRadius:"999px",background:`${o.timerBackground}`},children:S||"Company name"})]})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{style:{background:o.timerBackground,borderRadius:"50px",padding:"7px 14px",display:"flex",alignItems:"center",gap:y?"6px":"10px",transition:"background 0.5s ease"},children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:o.textPrimary,strokeWidth:"2",style:{transition:"stroke 0.5s ease"},children:[t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("polyline",{points:"12 6 12 12 16 14"})]}),t.jsx("span",{style:{fontSize:"13px",color:o.textPrimary,lineHeight:"1.5",transition:"color 0.5s ease"},children:Lt(ne)})]}),t.jsx("button",{style:{background:o.buttonBackground,border:`0.2px solid ${o.buttonBorder}`,borderRadius:"50px",padding:"10px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.5s ease"},onClick:Ft,title:Se?"Dark (click to force light)":"Light (click to force dark)",children:J>.5?t.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:o.buttonText,strokeWidth:"2",style:{transition:"stroke 0.5s ease"},children:t.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:o.buttonText,strokeWidth:"2",style:{transition:"stroke 0.5s ease"},children:[t.jsx("circle",{cx:"12",cy:"12",r:"5"}),t.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),t.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),t.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),t.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),t.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),t.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),t.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),t.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})]})]}),t.jsxs("div",{style:{width:"100%",maxWidth:"1380px",margin:"0 auto",display:"flex",flexDirection:y?"column":"row",gap:y?"12px":"18px",marginTop:"17px",padding:"16px 16px 140px",boxSizing:"border-box"},children:[t.jsxs("div",{style:{flex:"1",minWidth:0,background:o.transcriptBackgroun
1d,border:`1px solid ${o.transcriptBorder}`,borderRadius:"16px",height:y?"400px":"570px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",transition:"background 0.5s ease, border-color 0.5s ease",position:"relative",overflow:"hidden"},children:[J>.3&&t.jsx("div",{style:{position:"absolute",right:"-100px",bottom:"-100px",width:"334px",height:"334px",borderRadius:"50%",background:`radial-gradient(circle, rgba(107, 59, 171, ${.3*J}) 0%, transparent 70%)`,pointerEvents:"none",transition:"opacity 0.5s ease"}}),t.jsxs("div",{ref:je,className:"scrollbar-hide",style:{width:"100%",maxWidth:"830px",height:y?"342px":"512px",padding:y?"16px":"30px",overflowY:"auto",display:"flex",flexDirection:"column",justifyContent:_.length===0&&!G&&!se&&!pe&&De===0?"center":"flex-start",position:"relative",zIndex:1},children:[_.length===0&&!G&&!se&&!pe&&De===0&&t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:o.textMuted,fontSize:y?"16px":"20px",fontWeight:"500",textAlign:"center",lineHeight:"1.5",transition:"color 0.5s ease"},children:"Waiting for conversation to start..."}),_.map((e,u)=>t.jsxs("div",{style:{marginBottom:"20px",animation:"fadeIn 0.3s ease-in",display:"flex",gap:"15px",alignItems:"flex-start"},children:[e.role==="assistant"?t.jsx("div",{style:{width:"31px",height:"31px",borderRadius:"50%",background:J>.5?"rgba(255,255,255,0.1)":"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 2px 8px rgba(107, 59, 171, 0.2)"},children:t.jsx("img",{src:ye.conversationalAI.avuaIcon,alt:"Avua AI",style:{width:"16px",height:"16px",objectFit:"contain"}})}):t.jsx("div",{style:{width:"31px",height:"31px",borderRadius:"50%",background:J>.5?"rgba(255,255,255,0.1)":"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 2px 8px rgba(107, 59, 171, 0.2)"},children:t.jsx("img",{src:ye.conversationalAI.avuaIcon,alt:"User",style:{width:"16px",height:"16px",objectFit:"contain"}})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:Ze(e.role==="assistant"?"#6B3BAB":o.textMuted),children:e.role==="assistant"?"AI Interviewer":"You"}),t.jsx("div",{style:{color:o.textTranscript,fontSize:y?"15px":"18px",lineHeight:"1.5",transition:"color 0.5s ease"},children:e.content})]})]},u)),(G||pe||De>0)&&t.jsxs("div",{style:{marginBottom:"20px",opacity:.8,display:"flex",gap:"15px",alignItems:"flex-start"},children:[t.jsx("div",{style:{width:"31px",height:"31px",borderRadius:"50%",background:J>.5?"rgba(255,255,255,0.1)":"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 2px 8px rgba(107, 59, 171, 0.2)"},children:t.jsx("img",{src:ye.conversationalAI.avuaIcon,alt:"User",style:{width:"16px",height:"16px",objectFit:"contain"}})}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{style:Ze(o.textMuted),children:["You"," ",t.jsx("span",{style:{fontWeight:"400"},children:pe?"(speakingâ¦)":"(transcribingâ¦)"})]}),t.jsx("div",{style:{color:o.textTranscript,fontSize:y?"15px":"18px",lineHeight:"1.5",transition:"color 0.5s ease"},children:G||t.jsx("span",{style:{display:"inline-flex",gap:"5px",alignItems:"center",height:"1em"},children:[0,1,2].map(e=>t.jsx("span",{style:{width:"7px",height:"7px",borderRadius:"50%",background:o.textTranscript,display:"inline-block",animation:`listeningDot 1.2s ease-in-out ${e*.2}s infinite`}},e))})})]})]}),se&&t.jsxs("div",{style:{marginBottom:"20px",opacity:.8,display:"flex",gap:"15px",alignItems:"flex-start"},children:[t.jsx("div",{style:{width:"31px",height:"31px",borderRadius:"50%",background:J>.5?"rgba(255,255,255,0.1)":"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 2px 8px rgba(107, 59, 171, 0.2)"},children:t.jsx("img",{src:ye.conversationalAI.avuaIcon,alt:"Avua AI",style:{width:"16px",height:"16px",objectFit:"contain"}})}),t.jsxs("div",{style:{flex:1},children:[t.jsx("div",{style:Ze("#6B3BAB"),children:"AI Interviewer"}),t.jsxs("div",{style:{color:o.textTranscript,fontSize:y?"15px":"18px",lineHeight:"1.5",transition:"color 0.5s ease"},children:[se,t.jsx("span",{style:{animation:"blink 1s infinite",marginLeft:"2px"},children:"|"})]})]})]})]})]}),t.jsxs("div",{style:{width:y?"100%":"414px",flexShrink:0,display:"flex",flexDirection:y?"row":"column",gap:y?"12px":"18px"},children:[t.jsx("div",{style:{flex:y?"1":"none",background:o.cardBackgroun
1d,border:`1px solid ${o.cardBorder}`,borderRadius:"16px",height:y?"200px":"275px",padding:"13px",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",transition:"background 0.5s ease, border-color 0.5s ease"},children:t.jsx(Qt,{isConnected:U,isSpeaking:pe,logoSrc:ye.conversationalAI.avuaIcon})}),t.jsx("div",{style:{flex:y?"1":"none",background:o.cardBackground,border:`1px solid ${o.cardBorder}`,borderRadius:"16px",height:y?"200px":"275px",padding:"13px",position:"relative",transition:"background 0.5s ease, border-color 0.5s ease"},children:t.jsxs("div",{style:{width:"100%",height:"100%",background:"#AAAAAA",borderRadius:"13px",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},children:[t.jsx("video",{ref:we,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"13px",transform:"scaleX(-1)"}}),!U&&t.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"35px",height:"35px",background:"rgba(255, 255, 255, 0.9)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"#2B1845",children:t.jsx("polygon",{points:"5 3 19 12 5 21 5 3"})})})]})})]})]}),t.jsx(Nt,{message:wt,type:kt,isVisible:It,onClose:()=>it(!1)}),t.jsxs("div",{style:{position:"fixed",bottom:"0",left:"0",right:"0px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",width:"100%"},children:[t.jsx("div",{className:"w-full mx-auto max-w-[1380px] px-4",children:t.jsxs("div",{style:{background:o.recordingBarBackground,borderRadius:"10px",padding:"10px",width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background 0.5s ease"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx("div",{style:{width:"15px",height:"15px",borderRadius:"50%",background:U?"#FF0000":"#CCC",animation:U?"recordingPulse 1.5s infinite":"none"}}),t.jsx("span",{style:{fontSize:"16px",fontWeight:"600",color:o.textPrimary,lineHeight:"1.2",transition:"color 0.5s ease"},children:"Recording"})]}),t.jsx("div",{style:{width:y?"70px":"140px",height:"15px",overflow:"hidden",display:"flex",alignItems:"center",gap:"2px"},children:[...Array(y?25:40)].map((e,u)=>t.jsx("div",{style:{width:"3px",height:pe?`${Math.random()*14+2}px`:`${Math.sin(u*.3)*4+6}px`,background:u<20?o.waveformActive:o.waveformInactive,borderRadius:"1px",transition:"height 0.1s ease, background 0.5s ease"}},u))})]}),t.jsxs("button",{onClick:Qe,disabled:Ie,style:{background:o.buttonBackground,border:`0.2px solid ${o.buttonBorder}`,borderRadius:"50px",padding:"10px 15px",cursor:Ie?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:y?"6px":"10px",transition:"all 0.5s ease",opacity:Ie?.5:1},children:[t.jsx("span",{style:{fontSize:"14px",fontWeight:"500",color:o.buttonText,lineHeight:"1.2",transition:"color 0.5s ease"},children:"Finish Interview"}),!y&&t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:o.buttonText,strokeWidth:"2",style:{transform:"rotate(180deg) scaleY(-1)",transition:"stroke 0.5s ease"},children:[t.jsx("polyline",{points:"9 10 4 15 9 20"}),t.jsx("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"})]})]})]})}),t.jsx("div",{style:{fontSize:"14px",color:o.textMuted,textAlign:"center",width:"100%",lineHeight:"1.5",transition:"color 0.5s ease",padding:"10px 0px"},children:"Attention: Please refrain from refreshing the page to prevent any loss of data."})]}),t.jsx("canvas",{ref:$e,width:391,height:249,style:{display:"none"}}),t.jsx("style",{children:` 2 @keyframes fadeIn { 3 from { 4 opacity: 0; 5 transform: translateY(-5px); 6 } 7 to { 8 opacity: 1; 9 transform: translateY(0); 10 } 11 } 12 13 @keyframes blink { 14 0%, 50% { 15 opacity: 1; 16 } 17 51%, 100% { 18 opacity: 0; 19 } 20 } 21 22 @keyframes pulse { 23 0%, 100% { 24 transform: scale(1); 25 opacity: 0.8; 26 } 27 50% { 28 transform: scale(1.15); 29 opacity: 1; 30 } 31 } 32 33 @keyframes recordingPulse { 34 0%, 100% { 35 opacity: 1; 36 } 37 50% { 38 opacity: 0.4; 39 } 40 } 41 42 @keyframes endingPulse { 43 0%, 100% { 44 transform: scale(1); 45 opacity: 0.6; 46 } 47 50% { 48 transform: scale(1.08); 49 opacity: 1; 50 } 51 } 52 53 @keyframes listeningDot { 54 0%, 60%, 100% { 55 opacity: 0.25; 56 transform: translateY(0); 57 } 58 30% { 59 opacity: 1; 60 transform: translateY(-3px); 61 } 62 } 63 64 `})]})}
64export{er as default}; 65//# sourceMappingURL=InterviewStart-zUE8BV48.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.