1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[452424],{884665:function(e,t,n){"use strict";var r,a,i=n(523590);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-check-circle"},e),r||(r=i.createElement("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"})),a||(a=i.createElement("polyline",{points:"22 4 12 14.01 9 11.01"})))}},18215:function(e,t,n){"use strict";var r,a,i=n(523590);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:25,height:24,viewBox:"0 0 25 24",fill:"currentColor"},e),r||(r=i.createElement("path",{d:"M12.5 14.5C14.16 14.5 15.5 13.16 15.5 11.5V5.5C15.5 3.84 14.16 2.5 12.5 2.5C10.84 2.5 9.5 3.84 9.5 5.5V11.5C9.5 13.16 10.84 14.5 12.5 14.5Z",fill:"current"})),a||(a=i.createElement("path",{d:"M17.5 11.5C17.5 14.26 15.26 16.5 12.5 16.5C9.74 16.5 7.5 14.26 7.5 11.5H5.5C5.5 15.03 8.11 17.93 11.5 18.42V21.5H13.5V18.42C16.89 17.93 19.5 15.03 19.5 11.5H17.5Z",fill:"current"})))}},304084:function(e,t,n){"use strict";var r,a=n(523590);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),r||(r=a.createElement("path",{d:"M12.5 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm4-4h-8V8h8v8Z",fill:"current"})))}},304024:function(e,t,n){"use strict";var r,a=n(523590);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return a.createElement("svg",i({width:24,height:24,fill:"current",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=a.createElement("path",{d:"M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z",fill:"current"})))}},960564:function(e,t,n){"use strict";var r,a=n(523590);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",height:24,width:24,viewBox:"0 0 24 24"},e),r||(r=a.createElement("path",{d:"M6.4 19 5 17.6 10.6 12 5 6.4 6.4 5 12 10.6 17.6 5 19 6.4 13.4 12 19 17.6 17.6 19 12 13.4Z"})))}},449286:function(e,t,n){"use strict";var r,a=n(523590);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-check"},e),r||(r=a.createElement("polyline",{points:"20 6 9 17 4 12"})))}},758136:function(e,t,n){"use strict";var r,a,i=n(523590);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"
1currentColor",viewBox:"0 0 25 24"},e),r||(r=i.createElement("path",{d:"M12.5 14.5c1.66 0 3-1.34 3-3v-6c0-1.66-1.34-3-3-3s-3 1.34-3 3v6c0 1.66 1.34 3 3 3"})),a||(a=i.createElement("path",{d:"M17.5 11.5c0 2.76-2.24 5-5 5s-5-2.24-5-5h-2c0 3.53 2.61 6.43 6 6.92v3.08h2v-3.08c3.39-.49 6-3.39 6-6.92z"})))}},774601:function(e,t,n){"use strict";var r,a,i,o=n(523590);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return o.createElement("svg",l({xmlns:"http://www.w3.org/2000/svg",width:41,height:8,viewBox:"0 0 41 8",fill:"none"},e),r||(r=o.createElement("circle",{cx:4.5,cy:4,r:4,fill:"current"})),a||(a=o.createElement("circle",{cx:20.5,cy:4,r:4,fill:"current"})),i||(i=o.createElement("circle",{cx:36.5,cy:4,r:4,fill:"current"})))}},797131:function(e,t,n){"use strict";var r,a=n(523590);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return a.createElement("svg",i({width:22,height:18,viewBox:"0 0 22 18",fill:"current",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.5 7L0.51 0L21.5 9L0.51 18L0.5 11L15.5 9L0.5 7ZM2.51 3.03L10.02 6.25L2.5 5.25L2.51 3.03ZM10.01 11.75L2.5 14.97V12.75L10.01 11.75Z",fill:"current"})))}},996666:function(e,t,n){"use strict";var r,a=n(523590);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return a.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",viewBox:"0 0 25 24"},e),r||(r=a.createElement("path",{d:"M12.5 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm4-4h-8V8h8v8Z",fill:"current"})))}},447511:function(e,t,n){"use strict";var r,a=n(523590);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}t.Z=function(e){return a.createElement("svg",i({width:16,height:16,viewBox:"0 0 16 16",fill:"current",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=a.createElement("path",{d:"M8.6 7.07143C8.6 7.30812 8.40812 7.5 8.17143 7.5H7.82857C7.59188 7.5 7.4 7.30812 7.4 7.07143V4.82857C7.4 4.59188 7.59188 4.4 7.82857 4.4H8.17143C8.40812 4.4 8.6 4.59188 8.6 4.82857V7.07143ZM8.6 8.42857C8.6 8.19188 8.40812 8 8.17143 8H7.82857C7.59188 8 7.4 8.19188 7.4 8.42857V8.77143C7.4 9.00812 7.59188 9.2 7.82857 9.2H8.17143C8.40812 9.2 8.6 9.00812 8.6 8.77143V8.42857ZM14 3.2V10.4C14 10.7183 13.8736 11.0235 13.6485 11.2485C13.4235 11.4736 13.1183 11.6 12.8 11.6H4.4L2 14V3.2C2 2.88174 2.12643 2.57652 2.35147 2.35147C2.57652 2.12643 2.88174 2 3.2 2H12.8C13.1183 2 13.4235 2.12643 13.6485 2.35147C13.8736 2.57652 14 2.88174 14 3.2ZM12.8 3.62857C12.8 3.39188 12.6081 3.2 12.3714 3.2H3.62857C3.39188 3.2 3.2 3.39188 3.2 3.62857V11.12L3.79447 10.5255C3.87485 10.4452 3.98386 10.4 4.09752 10.4H12.3714C12.6081 10.4 12.8 10.2081 12.8 9.97143V3.62857Z",fill:"current"})))}},586223:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r,a,i,o=n(574101);n(441386);var l=n(43228),s=n(523590);function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var d=function(e){return s.createElement("svg",c({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-info"},e),r||(r=s.createElement("circle",{cx:12,cy:12,r:10})),a||(a=s.createElement("line",{x1:12,y1:16,x2:12,y2:12})),i||(i=s.createElement("line",{x1:12,y1:8,x2:12.01,y2:8})))},u=e=>{let{subText:t,onClose:n}=e;return(0,o.jsx)("div",{className:"flex items-center",style:{maxWidth:"280px"},children:(0,o.jsxs)("div",{className:"flex rounded border-0 border-l-8 border-solid border-red-500 bg-white p-4 shadow-md dark:border-red-400 dark:bg-gray-D1100",children:[(0,o.jsx)("div",{className:"mr-2",children:(0,o.jsx)(d,{className:"h-6 w-6 text-red-500 dark:text-red-400"})}),(0,o.jsxs)("div",{className:"mr-4 mt-0.5 text-gray-D1000 dark:text-gray-D200",children:[(0,o.jsx)("span",{className:"body-small font-bold",children:"Alert: "}),(0,o.jsx)("span",{className:"caption-text",children:t})]}),(0,o.jsx)("div",{className:"cursor-pointer pt-0.5",onClick:n,children:(0,o.jsx)(l.Z,{className:"h-5 w-5 fill-gray-L400"})})]})})}},439184:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});var r=n(574101),a=n(441386),i=n(384097),o=n(669473),l=n(18215),s=n(304084),c=n(162030),d=n(185078),u=n(17552);let _=async(e,t,n,r)=>{try{let a=new FileReader;a.onloadend=async()=>{try{let e=a.result,i=await (0,u.l)({endpoint:"ai/audio/transcribe",method:"POST",body:JSON.stringify({user_id:t,audio:e})});i.ok||(n(i),(0,d.u)(i,{},{userId:String(t)}));let o=await i.json();r(o.transcribedText)}catch(e){n(e),(0,d.u)(e,{},{userId:String(t)})}},a.readAsDataURL(e)}catch(e){n(e),(0,d.u)(e,{},{userId:String(t)})}};var m=n(586223),g=n(130114);let h=e=>{let{setShowTimeLimitTooltip:t}=e;return(0,a.useEffect)(()=>{setTimeout(()=>{t(!1)},1e4)},[]),(0,r.jsx)("div",{className:"caption-text rounded-lg bg-gray-D1300 px-4 py-1.5 text-white dark:bg-indigo-400",children:"You have 30 seconds left for this answer"})},p=()=>(0,r.jsxs)("div",{className:"caption-text flex items-center space-x-1 rounded-lg bg-gray-D1300 px-4 py-1.5 text-white dark:bg-indigo-400",children:[(0,r.jsx)("div",{children:"Tap the "}),(0,r.jsx)(s.Z,{className:"fill-white",height:"18",width:"18"}),(0,r.jsx)("div",{children:"again to stop recording"})]}),E=e=>{let{setSeenStartRecodingTooltip:t}=e;return(0,a.useEffect)(()=>{setTimeout(()=>{(0,c.LS)("seenStartRecodingTooltip","true"),t(!0)},1e4)},[]),(0,r.jsxs)("div",{className:"caption-text flex flex-col items-center space-y-1 rounded-lg bg-gray-D1300 px-4 py-2 text-center text-white dark:bg-indigo-400",children:[(0,r.jsx)("div",{children:"Voice Input now available"}),(0,r.jsxs)("div",{className:"flex items-center",children:["Tap ",(0,r.jsx)(l.Z,{width:"18",height:"18",className:"fill-white"})," to start recording"]})]})},f=e=>{let{setSeenMicDisabledTooltip:t}=e;return(0,a.useEffect)(()=>{setTimeout(()=>{(0,c.LS)("seenMicDisabledTooltip","true"),t(!0)},1e4)},[]),(0,r.jsxs)("div",{className:"caption-text flex flex-col items-center space-y-1 rounded-lg bg-gray-D1300 px-4 py-2 text-center text-white dark:bg-indigo-400",children:[(0,r.jsx)("div",{children:"Microphone access not granted"}),(0,r.jsx)("div",{className:"flex items-center",children:"Please enable it in your browser settings to proceed"})]})},v=(e,t)=>
1({[i.E.NOT_ALLOWED]:{comp:(0,r.jsx)(f,{setSeenMicDisabledTooltip:t}),position:"bottom-16"},[i.E.INACTIVE]:{comp:(0,r.jsx)(E,{setSeenStartRecodingTooltip:e}),position:"bottom-16"},[i.E.RECORDING]:{comp:(0,r.jsx)(p,{}),position:"bottom-10"},[i.E.PROCESSING]:{comp:(0,r.jsx)(r.Fragment,{}),position:""}});var N=e=>{let{onGoingInputValue:t,setOnGoingInputValue:n,userId:l,setSecondsRecording:s,disableRecording:u,inputDisabled:p,renderAudioIcon:E,name:f="",eventCategory:N="AI_MOCK_INTERVIEW",isUserLoggedOut:I=!1,isUserInfoLoading:S=!1,returnUrl:b="/",onShowSignupModal:T}=e,x=(0,a.useRef)(null),[A,w]=(0,a.useState)(i.E.INACTIVE),[C,y]=(0,a.useState)(!1),[O,R]=(0,a.useState)(!1),[k,D]=(0,a.useState)(!1),[L,P]=(0,a.useState)(!1),[j,M]=(0,a.useState)(""),[U,G]=(0,a.useState)(!1),[F,V]=(0,a.useState)(!1),[Z,B]=(0,a.useState)(0),[W,q]=(0,a.useState)([]),K=async()=>{try{let e=await navigator.permissions.query({name:"microphone"});"granted"===e.state?w(i.E.INACTIVE):"denied"===e.state?w(i.E.NOT_ALLOWED):w(i.E.INACTIVE),e.onchange=()=>{"granted"===e.state?w(i.E.INACTIVE):"denied"===e.state&&(n(""),M(""),s(void 0),w(i.E.NOT_ALLOWED))}}catch(e){w(i.E.INACTIVE)}},H=async()=>{try{if(A!==i.E.INACTIVE||u||p)return;y(!0),D(!0),(0,c.LS)("seenStartRecodingTooltip","true"),(0,o.Z)(N,"Clicked_AudioInput_Button",f),t.length>0?(M(t+" "),n("")):M(""),s(0),B(Date.now());let e=await navigator.mediaDevices.getUserMedia({audio:!0});w(i.E.RECORDING);let r=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/mp4",a=new MediaRecorder(e,{mimeType:r});x.current=a,x.current.start();let l=[];x.current.ondataavailable=e=>{void 0!==e.data&&0!==e.data.size&&l.push(e.data)},q(l)}catch(e){"granted"===(await navigator.permissions.query({name:"microphone"})).state?w(i.E.INACTIVE):(w(i.E.NOT_ALLOWED),G(!0),setTimeout(()=>{G(!1)},5e3)),s(void 0);return}},z=()=>{let e=(Date.now()-Z)/1e3;w(i.E.PROCESSING),s(-1),(0,o.Z)(N,"STOPPED_AUDIO_INPUT_BUTTON",f),(0,c.LS)("seenStopRecodingTooltip","true"),R(!0),x.current.stop(),x.current.onstop=()=>{let t=new Blob(W,{type:x.current.mimeType});e<1?((0,d.u)(Error("Recording too short spotted"),{recordingTimeUTC:new Date(Z).toUTCString()},{userId:String(l)}),w(i.E.INACTIVE),s(void 0),V(!0),n(j),setTimeout(()=>{V(!1)},8e3)):J(t),q([]),x.current.stream.getTracks().forEach(e=>{e.enabled=!1,e.stop()}),x.current=null}},Y=async()=>{try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){w(i.E.NOT_ALLOWED);return}await navigator.mediaDevices.getUserMedia({audio:!0}),n(""),w(i.E.INACTIVE),D(!0),(0,c.LS)("seenMicDisabledTooltip","true")}catch(e){w(i.E.NOT_ALLOWED),D(!1),(0,c.LS)("seenMicDisabledTooltip","false")}},J=e=>{_(e,l,e=>{w(i.E.INACTIVE),s(void 0),G(!0),n(j),setTimeout(()=>{G(!1)},5e3)},e=>{u?n(""):n((j+e).replace(/\n/g,"")),s(void 0),w(i.E.INACTIVE)}).then()};(0,a.useEffect)(()=>{K(),y("true"===(0,c.rV)("seenStartRecodingTooltip")),R("true"===(0,c.rV)("seenStopRecodingTooltip")),D("true"===(0,c.rV)("seenMicDisabledTooltip")),G(!1),V(!1)},[]),(0,a.useEffect)(()=>{if(A===i.E.RECORDING){let e=setInterval(()=>{s(e=>{let t=e+1;return(210===t&&(P(!0),(0,c.LS)("seenStopRecodingTooltip","true"),R(!0)),240===t)?(z(),-1):t})},1e3);return()=>clearInterval(e)}},[A]);let X=v(y,D);return(0,r.jsxs)(g.Z,{position:"custom",className:"".concat(X[A].position," h-full"),mainClassName:"h-full",renderTooltip:A===i.E.RECORDING&&L?(0,r.jsx)(h,{setShowTimeLimitTooltip:P}):A===i.E.INACTIVE&&!C||A===i.E.RECORDING&&!O||A===i.E.NOT_ALLOWED&&!k&&X[A].comp,closeable:!0,children:[(0,r.jsx)("div",{onClick:()=>{if(!S){if(I&&T){T({ru:b});return}A!==i.E.PROCESSING&&(A===i.E.NOT_ALLOWED?Y():A===i.E.INACTIVE?H():z())}},className:"".concat((u||p)&&A===i.E.INACTIVE?"cursor-not-allowed":""),children:E(A)}),U&&(0,r.jsx)("div",{className:"fixed right-6 top-24 z-20 flex flex-col",children:(0,r.jsx)(m.Z,{subText:"Something went wrong.",onClose:()=>G(!1)})}),F&&(0,r.jsx)("div",{className:"fixed right-6 top-24 z-20 flex flex-col",children:(0,r.jsx)(m.Z,{subText:"Recording too short. Please record for at least 1 second.",onClose:()=>V(!1)})})]})}},673172:function(e,t,n){"use strict";var r,a;n.d(t,{C:function(){return r}}
1),(a=r||(r={})).SEND_FEEDBACK="send-feedback",a.ASK_AUTHOR="ask-author"},863276:function(e,t,n){"use strict";var r,a;n.d(t,{B:function(){return r}}),(a=r||(r={}))[a.PATHS_LANDING_PAGE=3017]="PATHS_LANDING_PAGE",a[a.CLOUD_LABS_LANDING_PAGE=3018]="CLOUD_LABS_LANDING_PAGE",a[a.LEARNING_PLAN_LANDING_PAGE=3019]="LEARNING_PLAN_LANDING_PAGE",a[a.PROJECTS_LANDING_PAGE=3020]="PROJECTS_LANDING_PAGE",a[a.ASSESSMENTS_LANDING_PAGE=3021]="ASSESSMENTS_LANDING_PAGE",a[a.EXPLORE_LANDING_PAGE=3022]="EXPLORE_LANDING_PAGE",a[a.COURSE_HOMEPAGE=3023]="COURSE_HOMEPAGE",a[a.PROJECT_HOMEPAGE=3024]="PROJECT_HOMEPAGE",a[a.CLOUD_LAB_HOMEPAGE=3025]="CLOUD_LAB_HOMEPAGE",a[a.SKILL_PATH_HOME_PAGE=3026]="SKILL_PATH_HOME_PAGE",a[a.L2C_LANDING_PAGE=3027]="L2C_LANDING_PAGE",a[a.PERSONALIZED_PATHS_LANDING_PAGE=3029]="PERSONALIZED_PATHS_LANDING_PAGE",a[a.LEARN_HOME_PAGE=3030]="LEARN_HOME_PAGE",a[a.LEARN_IN_PROGRESS_PAGE=3031]="LEARN_IN_PROGRESS_PAGE",a[a.LEARN_SAVED_PAGE=3032]="LEARN_SAVED_PAGE",a[a.LEARN_COMPLETED_PAGE=3033]="LEARN_COMPLETED_PAGE",a[a.LEARN_MY_COURSES_PAGE=3034]="LEARN_MY_COURSES_PAGE",a[a.LEARN_DEFAULT_LANDING_PAGE=3035]="LEARN_DEFAULT_LANDING_PAGE",a[a.EDUCATIVE_HOMEPAGE=3036]="EDUCATIVE_HOMEPAGE",a[a.EDUCATIVE_PRICING_PAGE=3037]="EDUCATIVE_PRICING_PAGE",a[a.EDUCATIVE_ANSWERS_PAGE=3038]="EDUCATIVE_ANSWERS_PAGE",a[a.INTERVIEW_PREP_LANDING_PAGE=3039]="INTERVIEW_PREP_LANDING_PAGE",a[a.GENERATIVE_AI_LANDING_PAGE=3040]="GENERATIVE_AI_LANDING_PAGE",a[a.DATA_SCIENCE_LANDING_PAGE=3041]="DATA_SCIENCE_LANDING_PAGE",a[a.DATA_SCIENCE_SUBLANDING_PAGE=3042]="DATA_SCIENCE_SUBLANDING_PAGE",a[a.CATALOG_LANDING_PAGE=3043]="CATALOG_LANDING_PAGE",a[a.TRANSACTION_PAGE=3044]="TRANSACTION_PAGE",a[a.AGENT_LANDING_PAGE=3052]="AGENT_LANDING_PAGE"},832437:function(e,t,n){"use strict";var r,a;n.d(t,{d:function(){return r}}),(a=r||(r={}))[a.COURSE_COMPLETION=3001]="COURSE_COMPLETION",a[a.COURSE=3002]="COURSE",a[a.PATH=3003]="PATH",a[a.PATH_COMPLETION=3004]="PATH_COMPLETION",a[a.STANDALONE_PROJECT=3005]="STANDALONE_PROJECT",a[a.IN_CONTENT_PROJECT=3006]="IN_CONTENT_PROJECT",a[a.PROJECT_COMPLETION=3007]="PROJECT_COMPLETION",a[a.STANDALONE_ASSESSMENT=3008]="STANDALONE_ASSESSMENT",a[a.IN_CONTENT_ASSESSMENT=3009]="IN_CONTENT_ASSESSMENT",a[a.ASSESSMENT_COMPLETION=3010]="ASSESSMENT_COMPLETION",a[a.IN_CONTENT_CLOUD_LAB=3012]="IN_CONTENT_CLOUD_LAB",a[a.STANDALONE_CLOUD_LAB=3013]="STANDALONE_CLOUD_LAB",a[a.LEARNING_PLAN=3014]="LEARNING_PLAN",a[a.PRIVATE_CONTENT=3015]="PRIVATE_CONTENT",a[a.STANDALONE_MODULE=3016]="STANDALONE_MODULE",a[a.USERBACK_FEEDBACK=3028]="USERBACK_FEEDBACK",a[a.REQUEST_A_CALL=3045]="REQUEST_A_CALL",a[a.INTERVIEW_PREP=3046]="INTERVIEW_PREP",a[a.COURSE_COMPLETION_TESTIMONIAL=3047]="COURSE_COMPLETION_TESTIMONIAL",a[a.COURSE_COMPLETION_REQUEST_A_CALL=3048]="COURSE_COMPLETION_REQUEST_A_CALL",a[a.MOCK_INTERVIEW_TESTIMONIAL=3049]="MOCK_INTERVIEW_TESTIMONIAL",a[a.MOCK_INTERVIEW_REQUEST_A_CALL=3050]="MOCK_INTERVIEW_REQUEST_A_CALL",a[a.MOCK_INTERVIEW=3051]="MOCK_INTERVIEW",a[a.ARABIC_COURSE_FEEDBACK=3053]="ARABIC_COURSE_FEEDBACK",a[a.SANDPACK_FEEDBACK=3054]="SANDPACK_FEEDBACK",a[a.CODE_TEST_FEEDBACK=3055]="CODE_TEST_FEEDBACK",a[a.DEBUGGER_FEEDBACK=3056]="DEBUGGER_FEEDBACK",a[a.CLOUD_LAB_AGENT_FEEDBACK=3058]="CLOUD_LAB_AGENT_FEEDBACK",a[a.SPA_FEEDBACK=3059]="SPA_FEEDBACK",a[a.MOBILE_APP=3060]="MOBILE_APP",a[a.AUDIO_PLAYER_FEEDBACK=3061]="AUDIO_PLAYER_FEEDBACK"},438587:function(e,t,n){"use strict";n.d(t,{F:function(){return r}});let r=(0,n(939189).Ue)(e=>({loading:!1,listening:!1,enabled:!1,endSession:!1,streamingMessageIds:[],aiSpeaking:!1,userSpeaking:!1,realtimeChatStartHandler:null,realtimeChatEndHandler:null,setLoading:t=>e({loading:t}),setListening:t=>e({listening:t}),setEnabled:t=>e({enabled:t}),setEndSession:t=>e({endSession:t}),addStreamingMessageId:t=>e(e=>({streamingMessageIds:[...e.streamingMessageIds,t]})),removeStreamingMessageId:t=>e(e=>({streamingMessageIds:e.streamingMessageIds.filter(e=>e!==t)})),clearStreamingMessageIds:()=>e({streamingMessageIds:[]}),setAISpeaking:t=>e({aiSpeaking:t}),setUserSpeaking:t=>e({userSpeaking:t}),setRealtimeChatStartHandler:t=>e({realtimeChatStartHandler:t}),setRealtimeChatEndHandler:t=>e({realtimeChatEndHandler:t})}))},467493:function(e,t,n){"use strict";n.d(t,{s:function(){return r}});let r=e=>window.btoa(e)},17552:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var r=n(794996),a=n(290559);let i=()=>{var e,t,n,i,o,l,s,c,d,u,_,m,g,h,p,E,f,v,N,I,S,b,T;return(0,r.Z)()?"http://".concat((null===(t=window)||void 0===t?void 0:null===(e=t.location)||void 0===e?void 0:e.hostname)||"localhost",":8088"):(0,a.ZP)()?(null===(o=window)||void 0===o?void 0:null===(i=o.location)||void 0===i?void 0:null===(n=i.hostname)||void 0===n?void 0:n.includes("educative.io"))?"https://".concat(null===(s=window)||void 0===s?void 0:null===(l=s.location)||void 0===l?void 0:l.hostname.split(".")[0],"-magicbox.x.educative.io"):(null===(u=window)||void 0===u?void 0:null===(d=u.location)||void 0===d?void 0:null===(c=d.hostname)||void 0===c?void 0:c.includes("eduqative.com"))?"https://magicbox.eduqative.com":(null===(m=window)||void 0===m?void 0:null===(_=m.location)||void 0===_?void 0:_.hostname.split(".")[0].startsWith("pr"))?"https://".concat(null===(h=window)||void 0===h?void 0:null===(g=h.location)||void 0===g?void 0:g.hostname.split(".")[0],"-magicbox.d8888ea9.com"):"https://magicbox.d8888ea9.com":(null===(f=window)||void 0===f?void 0:null===(E=f.location)||void 0===E?void 0:null===(p=E.hostname)||void 0===p?void 0:p.includes("educative.io"))?"https://magicbox.educative.io":(null===(I=window)||void 0===I?void 0:null===(N=I.location)||void 0===N?void 0:null===(v=N.hostname)||void 0===v?void 0:v.includes("devpath.com"))||(null===(T=window)||void 0===T?void 0:null===(b=T.location)||void 0===b?void 0:null===(S=b.hostname)||void 0===S?void 0:S.includes("beta.x.eduqative.com"))?"https://magicbox.devpath.com":"https://magicbox.mockinterviews.dev"},o=e=>{let{method:t,headers:n={},body:r,endpoint:a}=e;return fetch("".concat(i(),"/").concat(a),{method:t,headers:{...n,"Content-Type":"application/json"},credentials:"include",body:r})}},197410:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(940938),a=n(669473),i=n(185078);let o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",l=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=window.location.pathname+window.location.search;o=o||s;let c=l?"INTERVIEW_PREP":"PAL";(0,a.Z)(c,e,n,null,t),(0,r.Z)({url:"/api/userdata/pal/interaction?is_interview_prep=".concat("INT
1ERVIEW_PREP"===c),type:"POST",data:{event_type:e,interaction_map:JSON.stringify({...t,page:o})}}).catch(e=>{(0,i.u)(e)})}},760173:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(574101),a=n(167506);let i=e=>{Promise.all([n.e(671804),n.e(737382)]).then(n.bind(n,737382)).then(t=>{let n=t.default;(0,a.K)((0,r.jsx)(n,{params:e}))})}},549514:function(e,t,n){"use strict";n.d(t,{I:function(){return r}});let r=e=>(null==e?void 0:e.is_basic_user)||(null==e?void 0:e.is_standard_user)||(null==e?void 0:e.is_premium_user)||(null==e?void 0:e.is_premium_plus_user)},737218:function(e,t,n){"use strict";n.d(t,{Xg:function(){return ep},_C:function(){return Y}});var r,a,i,o,l=n(574101),s=n(169357),c=n(940938),d=n(922738),u=n.n(d),_=n(441386),m=n(723731),g=n(239301),h=n(673172),p=n(628761),E=n(930079),f=n(863276),v=n(832437),N=n(669473),I=n(695509),S=function(){let[e,t]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=window.matchMedia("(pointer: fine)"),n=()=>{t(!e.matches)};return n(),e.addEventListener("change",n),()=>{e.removeEventListener("change",n)}},[]),e},b=n(181423),T=n(757401),x=n(863844),A=n(697279),w=n(523590);function C(){return(C=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var y=function(e){return w.createElement("svg",C({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"currentColor",viewBox:"0 0 24 24"},e),r||(r=w.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 6.5h-3v3h-2v-3h-3v-2h3v-3h2v3h3v2Zm9.8 0h3.2a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-16a2 2 0 0 1-2-2v-9h2v9h16v-12h-4l-1.9-2h-5.1v-2h6l1.8 2Zm-4.8 13a5 5 0 1 1 0-10 5 5 0 0 1 0 10Zm0-8a3 3 0 0 1 3 3 3 3 0 0 1-3 3 3 3 0 0 1-3-3 3 3 0 0 1 3-3Z"})))},O=n(373018);let R={on:!1,startX:0,startY:0,endX:0,endY:0,isMouseDown:!1,windowWidth:0,windowHeight:0,borderWidth:0,cropPositionTop:0,cropPositionLeft:0,cropWidth:0,cropHeight:0,showBorder:!0};var k=e=>{let{onEndCapture:t,afterSelection:n,takingScreenshot:r,touchScreenDevice:a}=e,[i,o]=(0,_.useState)({...R}),s=()=>{let e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;o(n=>({...n,windowWidth:e,windowHeight:t}))};(0,_.useEffect)(()=>(s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)),[]),(0,_.useEffect)(()=>{if(!i.showBorder){let e={isMouseDown:!1,borderWidth:0,showBorder:!1};0!==i.cropHeight&&0!==i.cropWidth?(n(),(0,A.flushSync)(()=>o(t=>({...t,...e,on:!1}))),d()):o(t=>({...t,...e}))}},[i.showBorder]),(0,_.useEffect)(()=>{r&&c()},[r]);let c=()=>o(e=>({...e,on:!0})),d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{cropPositionTop:n,cropPositionLeft:r,cropWidth:a,cropHeight:o}=e,l=document.querySelector("body");return l?x.rT(l,{filter:e=>!(e instanceof HTMLImageElement&&e.complete&&0===e.naturalHeight&&0===e.naturalWidth&&""!==e.src)}).then(e=>{let i=document.createElement("canvas"),l=i.getContext("2d");i.width=a,i.height=o,l&&l.drawImage(e,r*window.devicePixelRatio,(n+window.scrollY+20)*window.devicePixelRatio,a,o,0,0,a,o),i&&t(i.toDataURL())}):Promise.resolve()},[u,m,g,h]=i.borderWidth.toString().split(" ");return i.on?(0,l.jsxs)("div",{onMouseMove:a?null:e=>{let{isMouseDown:t,windowWidth:n,windowHeight:r,startX:a,startY:l,borderWidth:s}=i,c=l,d=a,u=e.clientX,_=e.clientY,m=_>=l,g=_<=l,h=u>=a,p=u<=a,E=s,f=0,v=0;t&&(m&&h&&(E="".concat(l,"px ").concat(n-u,"px ").concat(r-_,"px ").concat(a,"px"),f=u-a,v=_-l),m&&p&&(E="".concat(l,"px ").concat(n-a,"px ").concat(r-_,"px ").concat(u,"px"),f=a-u,v=_-l,d=u),g&&h&&(E="".concat(_,"px ").concat(n-u,"px ").concat(r-l,"px ").concat(a,"px"),f=u-a,v=l-_,c=_),g&&p&&(E="".concat(_,"px ").concat(n-a,"px ").concat(r-l,"px ").concat(u,"px"),f=a-u,v=l-_,d=u,c=_)),f*=window.devicePixelRatio,v*=window.devicePixelRatio,o(e=>({...e,borderWidth:E,cropWidth:f,cropHeight:v,cropPositionTop:c,cropPositionLeft:d,showBorder:!0}))},onMouseDown:a?null:e=>{let t=e.clientX,n=e.clientY;o(e=>({...e,startX:t,startY:n,cropPositionTop:n,cropPositionLeft:t,isMouseDown:!0,borderWidth:"".concat(e.windowWidth,"px ").concat(e.windowHeight,"px")}))},onMouseUp:a?null:()=>{o(e=>({...e,showBorder:!1}))},className:a?"":"cursor-crosshair",children:[(0,l.jsx)("div",{className:"fixed outline outline-indigo-500 ".concat(i.isMouseDown&&
10!==i.cropWidth&&0!==i.cropHeight?"border-solid/50 border-black":"bg-black/50"),style:{borderWidth:"".concat(parseInt(u)-7,"px ").concat(parseInt(m)-7,"px ").concat(parseInt(g)-7,"px ").concat(parseInt(h)-7,"px"),width:"calc(100% - 14px)",height:"calc(100% - 14px)",top:"7px",left:"7px",outlineWidth:"7px"}}),(0,l.jsx)("div",{className:"fixed right-0 top-0 h-6 w-6 cursor-pointer bg-indigo-500",style:{zIndex:9999999},onClick:()=>{n().then(()=>{t("")}),o(e=>({...e,on:!1}))},children:(0,l.jsx)(O.Z,{className:"text-white"})}),a&&(0,l.jsx)("div",{className:"bg-brand-default fixed left-0 top-0 h-6 w-6 cursor-pointer",style:{zIndex:9999999},onClick:()=>{var e;(0,A.flushSync)(()=>o(e=>({...e,on:!1,showBorder:!1}))),null===(e=d({cropPositionTop:0,cropPositionLeft:0,cropWidth:i.windowWidth*window.devicePixelRatio,cropHeight:i.windowHeight*window.devicePixelRatio}))||void 0===e||e.then(()=>n())},children:(0,l.jsx)(y,{className:"content-on-colour"})}),!a&&i.showBorder&&(0,l.jsx)("div",{className:"fixed border-2 border-solid border-indigo-500",style:{to
1p:u,left:h,width:"calc(".concat(i.windowWidth,"px - ").concat(m," - ").concat(h,")"),height:"calc(".concat(i.windowHeight,"px - ").concat(g," - ").concat(u,")")},children:0!==i.cropWidth&&0!==i.cropHeight&&(0,l.jsx)("div",{className:"fixed left-0 top-0 h-4 w-4 -translate-x-1/2 -translate-y-1/2 transform rounded-full bg-indigo-500",style:{top:i.startY,left:i.startX}})})]}):null},D=n(304024),L=n(984321),P=n(29309);function j(){return(j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var M=function(e){return w.createElement("svg",j({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-camera"},e),a||(a=w.createElement("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"})),i||(i=w.createElement("circle",{cx:12,cy:13,r:4})))},U=n(449286);function G(){return(G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var F=function(e){return w.createElement("svg",G({width:9,height:17,viewBox:"0 0 9 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),o||(o=w.createElement("path",{d:"M7.125 4.06315V12.7789C7.125 14.4539 5.7825 15.8105 4.125 15.8105C2.4675 15.8105 1.125 14.4539 1.125 12.7789V3.30526C1.125 2.25937 1.965 1.41052 3 1.41052C4.035 1.41052 4.875 2.25937 4.875 3.30526V11.2632C4.875 11.68 4.5375 12.021 4.125 12.021C3.7125 12.021 3.375 11.68 3.375 11.2632V4.06315H2.25V11.2632C2.25 12.309 3.09 13.1579 4.125 13.1579C5.16 13.1579 6 12.309 6 11.2632V3.30526C6 1.63031 4.6575 0.273682 3 0.273682C1.3425 0.273682 0 1.63031 0 3.30526V12.7789C0 15.0829 1.845 16.9474 4.125 16.9474C6.405 16.9474 8.25 15.0829 8.25 12.7789V4.06315H7.125Z",fill:"currentColor"})))},V=n(953006),Z=n(370001),B=n(865273),W=n(811860),q=n(186692),K=n(583263),H=n.n(K);let z={ERROR:"ERROR",SUCCESS:"SUCCESS",INITIAL:"INITIAL",PENDING:"PENDING"},Y={CODING:"coding",DRAWING:"drawing"},J={ISSUE:"Report an issue",IMPROVEMENT:"Suggest an improvement",CONTENT_REQUEST:"Content Request",CONTENT_FEEDBACK:"Content Feedback",LESSON_CUSTOMIZATION:"Lesson Customization",REQUEST_REFUND:"Request a Refund",OTHER:"Other"},X={ISSUE:"Report an issue",IMPROVEMENT:"Suggest an improvement",SLOW_RESPONSES:"Responses are slow",POOR_ANSWER_QUALITY:"Answer quality is consistently poor",IMAGES_AND_CODE_FAILING_TO_LOAD:"Images and code failing to load",OTHER:"Other"},Q={TRANSLATION_ISSUE:"Report a translation issue",...J},$={AUDIO_PLAYER_ISSUE:"Report an audio issue",...Object.fromEntries(Object.entries(J).filter(e=>{let[t]=e;return!["ISSUE","REQUEST_REFUND"].includes(t)}))},ee={RESOURCE_CREATION_RESTRICTED:"Resource Creation Restricted",TERMINAL_DISCONNECT:"Terminal Keeps Disconnecting",VSCODE_ISSUE:"VSCode Stopped Working",CODE_ISSUE:"Code Not Working",AUTH_ERROR:"Authorization Error",TEST_FAILED:"Test Failed",INSTRUCTION_MISMATCH:"Instruction Mismatch",OTHER:"Other"},et={FREQUENT_SESSION_TIMEOUTS:"Frequent Session Timeouts",TERMINAL_DISCONNECT:"Terminal Keeps Disconnecting",VSCODE_ISSUE:"VSCode Stopped Working",API_KEY_ISSUE:"API Key Issue",DEPRECATED_TECHNOLOGY:"Deprecated/Outdated Technology",CODE_ISSUE:"Code Not Working",INSTRUCTION_MISMATCH:"Instruction Mismatch",MEMORY_LIMIT_REACHED:"Memory Resource Limit Reached",OTHER:"Other"},en={INTERVIEW_CRASHED:"Interview crashed",POOR_OR_REPETITIVE_QUESTION_SELECTION:"Poor or repetitive question selection",HINTS_WERE_UNCLEAR_OR_UNHELPFUL:"Hints were unclear or unhelpful",NO_FEEDBACK_RECEIVED:"No feedback received",OTHER:"Other"},er={DIAGRAMMING_WIDGET_DID_NOT_LOAD:"Diagramming widget didn't load",...en},ea={TEST_CASES_MISSING_OR_INCORRECT:"Test cases missing or incorrect",CODING_WIDGET_DID_NOT_LOAD:"Coding widget didn't load",...en},ei={UPLOADING:"uploading",UPLOADED:"uploaded",ERROR:"error"},eo=[v.d.STANDALONE_CLOUD_LAB,v.d.MOCK_INTERVIEW,v.d.STANDALONE_PROJECT],el=[v.d.STANDALONE_CLOUD_LAB,v.d.MOCK_INTERVIEW],es={[v.d.STANDALONE_CLOUD_LAB]:ee.RESOURCE_CREATION_RESTRICTED,[v.d.MOCK_INTERVIEW]:en.HINTS_WERE_UNCLEAR_OR_UNHELPFUL,[v.d.STANDALONE_PROJECT]:et.FREQUENT_SESSION_TIMEOUTS},ec=(e,t)=>{var n,r,a;let{subject:i,details:o,imageId:l,email:s,issueType:c,rating:d}=t;return{author_id:e.authorId,collection_id:e.collectionId,page_id:e.pageId,path_id:null!==(n=e.pathId)&&void 0!==n?n:null,path_author_id:null!==(r=e.pathAuthorId)&&void 0!==r?r:null,image_id:l,url:e.shotUrl,subject:i,message:o,type:e.type,email:s,issue_type:c||"",is_ask_author:null!==(a=e.isAskAuthor)&&void 0!==a&&a,page_url:e.pageURL,category_id:e.categoryId||"",interview_id:e.interviewId||"",number_of_prompts_used:e.promptsUsed||
10,time_consumed_in_seconds:e.timeConsumed||0,interview_attempt_id:e.interviewAttemptId||"",rating:d,agent_id:e.agentId}},ed=(e,t)=>(0,c.Z)({url:"/api/userfeedback",type:"POST",data:ec(e,t)}),eu=async(e,t)=>{let n=ec(e,t),r=e.getUserWidgetDataForFeedback(),a={author_id:n.author_id,work_id:n.collection_id,page_id:n.page_id,message:n.message,comp_id:r.comp_id,widget_type:r.widget_type,widget_user_data:r.widget_user_data,rating:n.rating};try{await (0,c.Z)({url:"/api/widget/feedback",type:"POST",data:a})}catch(e){}},e_={fileName:"",fileStatus:null,imageId:null,error:null},em={SIZE_EXCEEDED:"Your file has exceeded 100 MB limit",MULTIPLE_FILES:"You cannot upload multiple files",TYPE_ERROR:"File type not allowed",UPLOAD_ERROR:"Unable to upload file"},eg=["image/png","image/jpeg","image/jpg"],eh=e=>{var t;let{authorId:n,collectionId:r,pageId:a,onImageChange:i,onImageUpload:o,afterImageUpload:s,pastedFile:c,takingScreenshot:d,setTakingScreenshot:u}=e,[m,g]=(0,_.useState)(e_),[h,p]=(0,_.useState)(!1),f=(0,_.useRef)(null),[v,N]=(0,_.useState)(!1);(0,_.useEffect)(()=>{(m===e_||m.error)&&c&&1===c.length&&y(c)&&(x(c[0]),N(!1))},[c]);let I=()=>{g(e=>({...e,error:em.UPLOAD_ERROR,fileStatus:ei.ERROR,fileName:""})),f.current.value=null,m.imageId&&R(!0)},x=e=>{g(t=>({...t,fileName:e.name,fileStatus:ei.UPLOADING})),o(),h?(0,b.OE)(m.imageId,n,r,a,e).then(C).catch(I):(0,b.Ix)(n,r,a,e).then(C).catch(I)},A=e=>{e.preventDefault(),e.stopPropagation()},w=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.preventDefault(),t?p(!0):p(!1),f.current.click(),t||N(!1)},C=e=>{let{image_id:t}=JSON.parse(e);i(t),g(e=>({...e,fileStatus:ei.UPLOADED,imageId:t,error:null})),s()},y=e=>{if(e.length>1)g(e=>({...e,error:em.MULTIPLE_FILES,fileStatus:ei.ERROR}));else if(eg.find(t=>e[0].type===t)){if(!(e[0].size>100*E.A.ONE_MB))return g(e=>({...e,error:null})),!0;g(e=>({...e,error:em.SIZE_EXCEEDED,fileStatus:ei.ERROR}))}else g(e=>({...e,error:em.TYPE_ERROR,fileStatus:ei.ERROR}));return!1},O=e=>{var t,n;e.preventDefault();let r=(null===(t=e.target)||void 0===t?void 0:t.files)||(null===(n=e.dataTransfer)||void 0===n?void 0:n.files);if(null==r?void 0:r[0]){if(!y(r)){m.imageId&&R(!0);return}x(r[0])}},R=e=>{let t=m.imageId;e?g(e=>({...e,fileName:"",imageId:null})):g(e_),p(!1),f.current.value=null,(0,b.ao)(t).then(()=>{i(null)})},D=S();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(k,{touchScreenDevice:D,takingScreenshot:d,afterSelection:async()=>{u(!1),g(e=>({...e,fileStatus:ei.UPLOADING,fileName:"Screenshot.jpg"}))},onEndCapture:e=>{e?fetch(e).then(e=>e.blob()).then(e=>{let t=new File([e],"Screenshot.jpg",{type:"image/jpeg"}),n=new DataTransfer;n.items.add(t);let r=n.files;y(r)&&x(r[0])}).catch(()=>{g(e=>({...e,error:em.UPLOAD_ERROR,fileStatus:ei.ERROR,fileName:""}))}):g(e_)}}),!d&&(0,l.jsxs)("div",{className:"".concat(H().fileUpload__container),onDrop:e=>{p(!1),O(e),N(!1)},onDragEnter:A,onDragOver:A,children:[(0,l.jsx)("input",{id:"fileUploadInput",className:"".concat(H().fileUpload__input),ref:f,type:"file",accept:eg.reduce((e,t)=>"".concat(e).concat(t,", "),""),onChange:O}),null===m.fileStatus||m.fileStatus===ei.ERROR?(0,l.jsxs)("div",{className:H().buttonsContainer,children:[(0,l.jsxs)("div",{className:H().AttachButtonsInnerContainer,children:[(0,l.jsx)("div",{className:H().attachAnImageContainer,children:(0,l.jsxs)("button",{className:H().attachButton,onClick:w,children:[(0,l.jsx)(F,{}),(0,l.jsx)("span",{className:H().navigationText,children:"Attach an image"})]})}),(0,l.jsxs)("button",{className:"".concat(H().attachButton," ").concat(H().takeScreenshotButton),onClick:e=>{e.preventDefault(),u(!0),N(!0)},children:[(0,l.jsx)(M,{className:"".concat(H().cameraIcon)}),(0,l.jsx)("span",{className:"".concat(H().navigationText," ").concat(H().marginLeft),children:"Take Screenshot"})]})]}),(0,l.jsxs)("div",{className:"".concat(H().dragNDropContainer," ").concat(H().dragNDropCommon," ").concat(m.error?H().dragNDropContainerFileStatusError:H().dragNDropContainerFileStatusOK," "),children:[(0,l.jsx)("span",{className:"".concat(H().dragNDropInnerContainer," ").concat(H().dragNDropCommon),children:"or drag and drop an image"}),null!==(t=m.error)&&void 0!==t?t:"Max file size: 100 MB"]})]}):(0,l.jsxs)("div",{className:"".concat(H().uploadedContainer),children:[(0,l.jsxs)("button",{className:"".concat(H().completeButton),onClick:e=>e.preventDefault(),children:[m.fileStatus===ei.UPLOADING?(0,l.jsx)(T.Z,{}):(0,l.jsx)(U.Z,{className:"".concat(H().completeIcon),style:{minWidth:"1rem"}}),(0,l.jsx)("span",{className:"".concat(H().uploadingFileName," ").concat(m.fileStatus===ei.UPLOADING?H().marginLeft4:H().marginLeft3),children:m.fileName})]}),m.fileStatus===ei.UPLOADED&&(0,l.jsxs)("div",{className:"".concat(H().editDeleteContainer),children:[(0,l.jsx)(P.Z,{className:"".concat(H().editDeleteIcon),onClick:e=>{v?(e.preventDefault(),u(!0),p(!0)):w(e,!0)}}),(0,l.jsx)(L.Z,{className:"".concat(H().editDeleteIcon),onClick:()=>R(!1)})]})]})]})]})}
1,ep=e=>{var t,n,r,a,i,o,c,d;let{onClose:E,params:S,pageSlug:T,showCaptchaModal:x,isLoggedOut:A,pageURL:w}=e,[C,y]=(0,_.useState)(z.INITIAL),[R,k]=(0,_.useState)(!1),[L,P]=(0,_.useState)(null),[j,M]=(0,_.useState)(!1),[U,G]=(0,_.useState)(!1),F=(0,_.useRef)(null);(0,_.useEffect)(()=>{var e;null===(e=document.activeElement)||void 0===e||e.blur()},[]),(0,_.useEffect)(()=>{{let e=document.getElementById("NEW_MODAL");e&&(j&&e.classList.remove(H().takingScreenshot),j||e.classList.add(H().takingScreenshot))}},[j]),(0,_.useEffect)(()=>{let e=F.current;if(!e)return;let t=e=>{j||U||e.preventDefault()};return e.addEventListener("wheel",t,{passive:!1}),e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("wheel",t),e.removeEventListener("touchmove",t)}},[j,U]);let K=g.Ry({subject:g.Z_().trim().required("Please enter your subject").min(3).max(140).label("Subject"),details:g.Z_().trim().max(1400).label("Details").when(["subject"],{is:e=>!el.includes(S.type)||e!==J.ISSUE,then:e=>e.required("Please enter your feedback").min(3)}),...A&&{email:g.Z_().email().label("Email").required("Please enter your email")},...eo.includes(S.type)&&{issueType:g.Z_().trim().required("Please enter issue type").min(3).max(140).label("Issue Type")},imageId:g.Rx().nullable(!0),...S.getUserWidgetDataForFeedback&&{rating:g.Rx().required("Please enter a rating")}}),ei={[v.d.STANDALONE_CLOUD_LAB]:ee,[v.d.STANDALONE_PROJECT]:et,[v.d.MOCK_INTERVIEW]:S.mockInterviewType===Y.CODING?ea:S.mockInterviewType===Y.DRAWING?er:en},{register:ec,formState:{errors:e_},handleSubmit:em,setValue:ep,getValues:eE,watch:ef,clearErrors:ev}=(0,m.cI)({defaultValues:{subject:S.type===v.d.ARABIC_COURSE_FEEDBACK?Q.TRANSLATION_ISSUE:S.type===v.d.AUDIO_PLAYER_FEEDBACK?$.AUDIO_PLAYER_ISSUE:J.ISSUE,issueType:es[S.type]||"",details:"",email:"",imageId:null,rating:void 0},mode:"all",resolver:(0,s.X)(K)}),eN=e=>{let t=eE("imageId");t&&(0,b.ao)(t),E(e)},eI=e=>
1x({src:"/api/recaptcha?email=".concat(e.email),onSuccess:()=>eS(e),data:e}),eS=e=>{y(z.PENDING),(S.getUserWidgetDataForFeedback?eu(S,e):ed({...S,pageURL:w},e)).then(()=>{E(document.createEvent("Event")),y(z.SUCCESS),(0,N.Z)(S.type in f.B?"LANDING_HOMEPAGE_FEEDBACK":S.workType===p.dL.SKILL_ASSESSMENT?"ASSESSMENT":S.workType===p.dL.STANDALONE_PROJECT?"STANDALONE_PROJECT":"INTERACTION",S.type in f.B?"SUBMITTED_FEEDBACK":S.modalType===h.C.SEND_FEEDBACK?"INTERACTION_USER_FEEDBACK_SENT":"INTERACTION_ASK_AUTHOR_SENT",S.type in f.B?T:S.workName||""),S.onSuccess()}).catch(()=>{y(z.ERROR)})},eb=!!e_.subject,eT=!!e_.issueType,ex=eE("subject"),eA=eE("issueType"),ew=ef("rating",0),eC=S.type===v.d.INTERVIEW_PREP?Object.keys(J).reduce((e,t)=>("LESSON_CUSTOMIZATION"!==t&&"CONTENT_REQUEST"!==t&&(e[t]=J[t]),e),{}):[v.d.STANDALONE_CLOUD_LAB,v.d.STANDALONE_PROJECT].includes(S.type)?Object.keys(J).reduce((e,t)=>("LESSON_CUSTOMIZATION"!==t&&"CONTENT_REQUEST"!==t&&"CONTENT_FEEDBACK"!==t&&(e[t]=J[t]),e),{}):S.type===f.B.AGENT_LANDING_PAGE?X:S.type===v.d.ARABIC_COURSE_FEEDBACK?Q:S.type===v.d.AUDIO_PLAYER_FEEDBACK?$:J;return(0,l.jsx)("div",{ref:F,className:"".concat(H().formContainer," ").concat(j?"":H().withFrame," "),children:(0,l.jsxs)("form",{children:[(0,l.jsxs)("div",{className:"".concat(H().formInnerContainer),children:[!j&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:H().NotTakingSSForm__headerContainer,children:[(null==S?void 0:S.onBackButtonClick)&&(0,l.jsx)(D.Z,{className:H().NotTakingSSForm__backIcon,onClick:e=>{eN(e),null==S||S.onBackButtonClick()}}),(0,l.jsx)("p",{className:H().NotTakingSSForm__heading,children:S.isAskAuthor?"Ask the Author":"Share Feedback"}),(0,l.jsx)(O.Z,{className:H().NotTakingSSForm__closeIcon,onClick:eN})]}),C===z.ERROR&&(0,l.jsx)("p",{className:H().NotTakingSSForm__feedbackErrorText,children:"Unable to submit feedback due to an error. Please try again."}),(0,l.jsxs)("div",{className:"".concat(H().NotTakingSSForm__inputsContainer),children:[S.isAskAuthor?(0,l.jsx)(q.Z,{placeholder:"Write your subject here..",placeholderClasses:H().isAskAuthor__SubjectInput__placeholder,type:"text",label:"Subject",error:!!e_.subject,errorText:null===(t=e_.subject)||void 0===t?void 0:t.message,borderStyling:H().isAskAuthor__SubjectInput__border,...ec("subject"),onKeyDown:e=>{e.keyCode===u().codes.enter&&e.preventDefault()},showMaxLength:!1,maxLength:140,bgClasses:""}):(0,l.jsxs)(l.Fragment,{children:[!eo.includes(S.type)&&(0,l.jsx)(B.Z,{onChange:e=>ep("subject",String(e),{shouldValidate:!0}),label:"Select your subject",labelClasses:H().feedbackTypesNotRequiringIssueSelection__dropdown__label,error:eb,errorText:null===(n=e_.subject)||void 0===n?void 0:n.message,additionalButtonClasses:"".concat(H().feedbackTypesNotRequiringIssueSelection__dropdown__button," ").concat(eb?H().feedbackTypesNotRequiringIssueSelection__dropdown__button__error:H().feedbackTypesNotRequiringIssueSelection__dropdown__button__normal),customChevronClasses:H().feedbackTypesNotRequiringIssueSelection__dropdown__chevron,register:ec("subject"),renderValue:()=>(0,l.jsx)("span",{className:ex?"":H().feedbackTypesNotRequiringIssueSelection__dropdown__placeholder,children:ex||"Choose one"}),children:Object.values(eC).map((e,t)=>(0,l.jsx)(W.Z,{value:e,className:"".concat(H().feedbackTypesNotRequiringIssueSelection__dropdown__listItem," ").concat(0===t?H().feedbackTypesNotRequiringIssueSelection__dropdown__listItem__first:H().feedbackTypesNotRequiringIssueSelection__dropdown__listItem__middle),children:(0,l.jsx)("p",{className:H().feedbackTypesNotRequiringIssueSelection__dropdown__listItem__text,children:e})},e))}),eo.includes(S.type)&&(0,l.jsxs)("div",{className:H().feedbackRequiringIssueSelection__container,children:[(0,l.jsx)("label",{className:H().feedbackRequiringIssueSelection__label,children:"Report an Issue"}),eT&&(0,l.jsx)("p",{className:H().feedbackRequiringIssueSelection__errorText,children:null===(r=e_.issueType)||void 0===r?void 0:r.message}),(0,l.jsx)("div",{className:H().feedbackRequiringIssueSelection__radioGrid,children:Object.values(ei[S.type]||{}).map(e=>(0,l.jsxs)("div",{className:H().feedbackRequiringIssueSelection__radioOption,children:[(0,l.jsx)(V.Z,{id:e,checked:eA===e,disabled:!1,ariaLabel:e,onChecked:()=>{ep("issueType",e,{shouldValidate:!0})}}),(0,l.jsx)("label",{htmlFor:e,className:H().feedbackRequiringIssueSelection__radioLabel,children:e})]},e))})]})]}),A&&(0,l.jsx)(q.Z,{placeholder:"Enter email",placeholderClasses:"".concat(H().loggedOutInputs__placeholder),type:"text",label:"Email",error:!!e_.email,errorText:null===(a=e_.email)||void 0===a?void 0:a.message,borderStyling:"".concat(H().loggedOutInputs__border),...e
1c("email"),onKeyDown:e=>{e.keyCode===u().codes.enter&&e.preventDefault()},showMaxLength:!1,maxLength:140,bgClasses:"",autoFocus:!0,className:"logged-out"}),S.getUserWidgetDataForFeedback&&(0,l.jsxs)("div",{className:"flex w-full flex-col",children:[(0,l.jsx)("p",{className:"text-base",children:S.type===v.d.DEBUGGER_FEEDBACK?"Tried our debugger? Share your thoughts!":"Tried our widget? Share your thoughts!"}),(0,l.jsx)("div",{className:"flex w-full select-none justify-center border border-solid ".concat((null===(i=e_.rating)||void 0===i?void 0:i.message)?"border-red-500 dark:border-red-400":"border-transparent"),children:(0,l.jsx)(Z.Z,{givenRating:ew,onRatingChange:e=>{ep("rating",e),ev("rating")}})}),(null===(o=e_.rating)||void 0===o?void 0:o.message)&&(0,l.jsx)("p",{className:"caption-text font-semibold text-red-700 dark:text-red-400",children:null===(c=e_.rating)||void 0===c?void 0:c.message})]}),(0,l.jsx)("div",{onPaste:e=>{if(0===e.clipboardData.files.length)return;e.preventDefault();let t=e.clipboardData.items,n=[];for(let e of t)eg.some(t=>e.type===t)&&n.push(e.getAsFile());P(n)},children:(0,l.jsx)(q.Z,{type:"text",label:"Details",placeholder:"Write details here. Press ".concat((0,I.KM)("mod")," + V to paste a screenshot"),multiline:!0,className:H().loggedOutInputs__detailsInput,error:!!e_.details,errorText:null===(d=e_.details)||void 0===d?void 0:d.message,inputClass:"".concat(H().loggedOutInputs__placeholder," ").concat(H().pasteInput),borderStyling:"".concat(H().loggedOutInputs__border),...ec("details"),showMaxLengthInTextArea:!0,showMaxLength:!1,maxLength:1400,endIcon:(0,l.jsx)(l.Fragment,{}),bgClasses:"",onFocus:()=>G(!0),onBlur:()=>G(!1)})})]})]}),(0,l.jsx)(eh,{authorId:S.authorId,collectionId:S.collectionId,pageId:S.pageId,onImageChange:e=>ep("imageId",e),onImageUpload:()=>k(!0),afterImageUpload:()=>k(!1),pastedFile:L,takingScreenshot:j,setTakingScreenshot:M})]}),!j&&(0,l.jsxs)("div",{className:H().formFooter__container,children:[(0,l.jsxs)("p",{className:H().formFooter__text,children:["Your email will be shared with the"," ",S.isAskAuthor?"author":"team"]}),(0,l.jsxs)("div",{className:H().formFooter__buttons,children:[(0,l.jsx)("button",{className:H().formFooter__cancelButton,onClick:eN,children:"Cancel"}),(0,l.jsx)("button",{className:H().formFooter__submitButton,onClick:em(e=>A&&e.email?eI(e):eS(e)),disabled:C===z.PENDING||R,children:"Submit"})]})]})]})})}},21648:function(e,t){"use strict";let n=e=>e.startsWith("/")?e.slice(1):e;t.Z=e=>{let{src:t,width:r,quality:a=75}=e;return"/cdn-cgi/image/format=auto,width=".concat(r,",quality=").concat(a,"/").concat(n(t))}},431418:function(e,t,n){"use strict";n.d(t,{P:function(){return N}});var r=n(574101),a=n(158455),i=n.n(a),o=n(13858),l=n(441386),s=n(435128);n(773368);var c=n(718102),d=n(819559),u=n(403272),_=n(467493),m=n(21648),g=n(185078),h=n(226690),p=n.n(h);let E=e=>{let{src:t}=e;return t},f={borderWidth:"1px !important",width:"100%",display:"block"},v=l.forwardRef((e,t)=>{let{imageSrc:n,alt:a,width:h,height:v,customStyle:N={},customImageClasses:I="",progressive:S=!1,title:b="",priority:T=!1,coverImage:x=!1,onImageLoad:A=()=>{},onImageLoaded:w=()=>{},onError:C=()=>{},background:y="",zoomStylesForNonProgressiveImage:O={borderWidth:"1px !important",width:"100%",display:"block"},zoomOverlayColor:R="rgba(255, 255, 255, 0.95)",sizes:k="(max-width: 950px) 100vw, 30vw",layout:D="responsive",disableImageSrcSet:L=!1,id:P,unoptimized:j=!1,quality:M=75,setShouldFocus:U,invertZoom:G,resetInvertZoom:F,showLandingPageImage:V,zoomSizes:Z=null,allowZoom:B=!0}=e,W=(0,o.usePathname)(),{data:q}=(0,d.Pc)(),K=!(null==q?void 0:q.user_id),[H,z]=l.useState(!1),Y=l.useCallback(e=>{if(B){if(K&&e){(0,c.q)({isEnterprise:!1,ru:W});return}z(e),e||(null==F||F(),null==U||U(!1))}},[B,K,W]);l.useEffect(()=>{G&&z(e=>!e)},[G]);let J=u.v||T;n&&0!==n.length||(n="/static/imgs/covers/default.svg",(0,g.u)(Error("imageSrc is empty.")));let X="";h&&v&&(X='<svg width="'.concat(5*h||700,'" height="').concat(5*v||400,'" xmlns="http://www.w3.org/2000/svg" version="1.1"/>'));let[Q,$]=l.useState(!1),ee="".concat(Q?y:""),et={...J?{}:{placeholder:"blur",blurDataURL:"data:image/svg+xml;base64,".concat((0,_.s)(X))}},en=!!X,er=S?en?(0,r.jsx)(i(),{...et,loader:L?E:m.Z,src:n,alt:a,className:ee,onLoad:A,onError:C,priority:J,width:h,height:v,layout:D,style:N,sizes:H&&null!=Z?Z:k,title:b||a,onLoadingComplete:()=>{$(!0),w()},id:P,unoptimized:j,quality:M}):(0,r.jsx)(i(),{loader:L?E:m.Z,src:n,alt:a,className:ee,onLoad:A,onError:C,priority:J,width:h,height:v,layout:D,style:N,sizes:H&&null!=Z?Z:k,title:b||a,onLoadingComplete:()=>{$(!0),w()},id:P,unoptimized:j,quality:M}):null,ea=(0,r.jsx)("div",{className:"".concat(p().imageContainer),style:N,children:(0,r.jsx)(i(),{src:n,loader:L?E:m.Z,alt:a,layout:"fill",className:"".concat(p().image," ").concat(ee||"bg-transparent"," h-full w-full"),sizes:k,title:b||a,style:N,onLoadingComplete:()=>{$(!0),w()},onError:C,priority:J,id:P,unoptimized:j,quality:M})});return V?(0,r.jsx)("div",{className:"".concat(p().landingPageImageContainer),ref:t,style:N,children:B?(0,r.jsx)(s.Z,{zoomMargin:0,wrapElement:"div",wrapStyle:f,isZoomed:H,onZoomChange:Y,children:er}):er}):S?(0,r.jsx)("div",{className:"".concat(p().imageContainerProgressive," ").concat(I
1),ref:t,style:N,children:!x&&B?(0,r.jsx)(s.Z,{zoomMargin:0,wrapElement:"div",wrapStyle:f,isZoomed:H,onZoomChange:Y,children:er}):er}):X?x?(0,r.jsx)("div",{className:"".concat(p().coverImageContainer," ").concat(I),ref:t,style:N,children:(0,r.jsx)(i(),{loader:L?E:m.Z,src:n,alt:a,style:N,className:ee,onLoad:A,width:h,height:v,priority:J,layout:D,sizes:k,title:b||a,onLoadingComplete:()=>{$(!0),w()},onError:C,id:P,unoptimized:j,quality:M})}):B?(0,r.jsx)(s.Z,{zoomMargin:0,wrapElement:"div",wrapStyle:O,overlayBgColorEnd:R,overlayBgColorStart:R,isZoomed:H,onZoomChange:Y,children:(0,r.jsx)("div",{className:I,ref:t,style:N,children:(0,r.jsx)(i(),{loader:L?E:m.Z,src:n,alt:a,style:N,className:ee,onLoad:A,width:h,height:v,priority:J,layout:D,sizes:H&&null!=Z?Z:k,title:b||a,onLoadingComplete:()=>{$(!0),w()},onError:C,id:P,unoptimized:j,quality:M})})}):(0,r.jsx)("div",{className:I,ref:t,style:N,children:(0,r.jsx)(i(),{loader:L?E:m.Z,src:n,alt:a,style:N,className:ee,onLoad:A,width:h,height:v,priority:J,layout:D,sizes:H&&null!=Z?Z:k,title:b||a,onLoadingComplete:()=>{$(!0),w()},onError:C,id:P,unoptimized:j,quality:M})}):ea});t.Z=l.memo(v);let N=(e,t)=>{if(0===Object.keys(null!=e?e:{}).length)return null;if(e.cover_image_serving_url)return e.cover_image_serving_url;if(e.cover_image_url)return e.cover_image_url;let{id:n,doc_type:r,author_id:a,cover_image_id:i}=e;return n&&r&&i&&a?"/api/".concat(r,"/").concat(a,"/").concat(n,"/image/").concat(i,".png"):null}},181423:function(e,t,n){"use strict";n.d(t,{Ix:function(){return a},OE:function(){return o},ao:function(){return i}});var r=n(940938);let a=(e,t,n,a)=>{let i=new FormData;i.append("image",a);let o="/api/userfeedback",l=e&&t&&n?"".concat(o,"/").concat(e,"/").concat(t,"/").concat(n,"/imageupload"):"".concat(o,"/imageupload");return(0,r.Z)({url:l,type:"POST",processData:!1,data:i})},i=e=>(0,r.Z)({url:"/api/userfeedback/imagedelete",type:"DELETE",data:{image_id:e}}),o=(e,t,n,a,i)=>{let o=new FormData;o.append("image",i),o.append("image_id",String(e));let l="/api/userfeedback",s=t&&n&&a?"".concat(l,"/").concat(t,"/").concat(n,"/").concat(a,"/imageupload"):"".concat(l,"/imageupload");return(0,r.Z)({url:s,type:"PUT",processData:!1,data:o})}},279916:function(e,t,n){"use strict";n.d(t,{P:function(){return i},w:function(){return l}});var r=n(940938),a=n(697421);let i=(e,t)=>(0,r.Z)({url:"/api/ai-coach/evict-feedback-cache/".concat(e,"/").concat(t),type:"POST"}),o=(e,t,n)=>"SDPAL_ViewFeedback_".concat(e,"_").concat(t,"_").concat(n),l=(e,t,n,r,i)=>{let l=o(e,r,i),s="".concat(t,"_").concat(n);return(0,a.P)({mapName:l,data:{[s]:!0}})}},130592:function(e,t,n){"use strict";var r=n(574101),a=n(441386),i=n(234780),o=n(409288),l=n(961574);t.Z=e=>{let{cancelText:t="CANCEL",children:n,confirmText:s="YES",danger:c,disableTrigger:d=!1,element:u,handleCancel:_=()=>{},handleConfirm:m,invertButtons:g,onClick:h=()=>{},overlayParentStyles:p,parentClasses:E="",popoverTitle:f,position:v=i.xR,showPointer:N=!0,...I}=e,S=a.useRef(null),b=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"m-0 text-center text-sm font-semibold",children:f}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center",children:[(0,r.jsx)("button",{className:"m-2 py-2 ".concat(g?"text-default":c?"contained-error":"contained-primary"),onClick:e=>{e.preventDefault(),m(e),S.current()},"aria-label":"confirm",children:s}),(0,r.jsx)("button",{className:"m-2 py-2 ".concat(g?c?"contained-error":"contained-primary":"text-default"),onClick:e=>{e.preventDefault(),_(e),S.current()},children:t})]})]});return(0,r.jsx)(o.default,{backgroundColor:"bg-white border-white dark:bg-gray-D1400 dark:border-gray-D1400",element:u,onClick:h,overlay:!d&&b,overlayParentClasses:"flex flex-col px-9 py-7 max-w-xs space-y-4",overlayParentStyles:p,overlayParentTextColorClasses:"text-black dark:text-gray-D200",parentClasses:["cursor-pointer",E].filter(Boolean).join(" "),position:v,rootClose:!0,setRef:(e,t)=>S.current=t,trigger:l.t4,showPointer:N,...I,children:n})}},391056:function(e,t,n){"use strict";var r=n(574101),a=n(718102),i=n(439184);t.Z=e=>(0,r.jsx)(i.Z,{...e,onShowSignupModal:a.q})},560529:function(e,t,n){"use strict";n.d(t,{Z:function(){return eZ}});var r,a,i,o,l,s=n(574101),c=n(441386),d=n(718102),u=n(549514),_=n(185078),m=n(697279),g=e=>
1{let{aiSpeaking:t,localStream:n}=e,[r,a]=(0,c.useState)(!1),[i,o]=(0,c.useState)({top:0,left:0}),l=(0,c.useRef)(null),d=(0,c.useRef)(null),u=(0,c.useRef)(null),_=(0,c.useRef)(null);return((0,c.useEffect)(()=>{let e=()=>{let e=document.getElementById("ai-speaking-icon");if(e){let t=e.getBoundingClientRect();o({top:t.top-110,left:t.left})}};if(r)return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[r]),(0,c.useEffect)(()=>{if(!n||!t){_.current&&(cancelAnimationFrame(_.current),_.current=null),u.current&&(u.current.close(),u.current=null),d.current=null;return}let e=new AudioContext,r=e.createAnalyser();e.createMediaStreamSource(n).connect(r),r.fftSize=256,r.smoothingTimeConstant=.8,u.current=e,d.current=r;let i=new Uint8Array(r.frequencyBinCount),o=()=>{if(!d.current||!t)return;r.getByteFrequencyData(i);let e=i.reduce((e,t)=>e+t)/i.length,n=Math.max(...Array.from(i));e>15&&n>80&&(a(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{a(!1)},500)),_.current=requestAnimationFrame(o)};return o(),()=>{_.current&&cancelAnimationFrame(_.current),l.current&&clearTimeout(l.current),u.current&&u.current.close()}},[n,t]),(0,c.useEffect)(()=>{!t&&(a(!1),l.current&&clearTimeout(l.current))},[t]),r&&t)?(0,m.createPortal)((0,s.jsxs)("div",{className:"relative flex flex-col rounded-xl bg-indigo-1000 p-4 text-white shadow-lg",style:{zIndex:99999,position:"fixed",top:"".concat(i.top,"px"),left:"".concat(i.left,"px"),width:"248px",overflow:"visible"},children:[(0,s.jsx)("span",{className:"mb-1 text-sm font-bold",children:"Trying to speak?"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:"Please wait for the interviewer response to finish, before giving your answer"}),(0,s.jsx)("div",{className:"absolute bg-indigo-1000",style:{bottom:"-8px",left:"25px",transform:"translateX(-50%) rotate(45deg)",width:"16px",height:"16px"}})]}),document.body):null},h=n(17552);let p=async(e,t,n,r,a,i)=>{let o=await (0,h.l)({endpoint:"".concat(e,"ai/interview/mint-rt-token"),method:"POST",body:JSON.stringify({interviewId:t,categoryId:n,yearsOfExperience:r,attemptCount:a,role:i})});return await o.json()};var E=n(940938);let f=(e,t,n,r,a,i)=>{let o=new FormData;return o.append("attempt_id",String(r)),o.append("item_id",a),o.append("audio",i,"".concat(a,".webm")),(0,E.Z)({url:"".concat(e,"/api/mock-interview/realtime/").concat(n,"/").concat(t,"/save-audio"),type:"POST",data:o,processData:!1})},v=(e,t,n,r,a)=>(0,E.Z)({url:"".concat(e,"/api/mock-interview/realtime/").concat(n,"/").concat(t,"/save-message"),type:"POST",data:{attempt_id:r,message:JSON.stringify(a)}}),N={HUMAN_MESSAGE:"human",AI_MESSAGE:"ai"},I={TEXT:"text"};(r=i||(i={}))[r.INTERNAL_ONLY=1e3]="INTERNAL_ONLY",r[r.EVERYONE=1001]="EVERYONE",r[r.DISABLED=1002]="DISABLED",(a=o||(o={}))[a.EDUCATIVE=1e3]="EDUCATIVE",a[a.MOCK_INTERVIEW_APP=1001]="MOCK_INTERVIEW_APP",a[a.ALL=1002]="ALL";let S={RECEIVE_EVENTS:{CONVERSATION_ITEM_ADDED:"conversation.item.added",CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTAL:"conversation.item.input_audio_transcription.delta",CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED:"conversation.item.input_audio_transcription.completed",RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA:"response.output_audio_transcript.delta",RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE:"response.output_audio_transcript.done",SESSION_CREATED:"session.created",SESSION_UPDATED:"session.updated",OUTPUT_AUDIO_BUFFER_STARTED:"output_audio_buffer.started",INPUT_AUDIO_BUFFER_COMMITTED:"input_audio_buffer.committed",OUTPUT_AUDIO_BUFFER_STOPPED:"output_audio_buffer.stopped"},SEND_EVENTS:{SESSION_UPDATE:"session.update",RESPONSE_CANCEL:"response.cancel",OUTPUT_AUDIO_BUFFER_CLEAR:"output_audio_buffer.clear"}};var b=n(438587),T=e=>{let{platform:t,realtimeMIData:n,setRealtimeInProgress:r,endSession:a,sendGAEvent:i}=e,{setLoading:l,setUserSpeaking:d,setAISpeaking:u,setListening:m,setEndSession:h,setRealtimeChatStartHandler:E,setRealtimeChatEndHandler:T,listening:x,enabled:A,aiSpeaking:w,addStreamingMessageId:C,removeStreamingMessageId:y}=(0,b.F)(),O=(0,c.useRef)(null),R=(0,c.useRef)(null),k=(0,c.useRef)(null),D=(0,c.useRef)(null),L=(0,c.useRef)(null),P=(0,c.useRef)(null),j=(0,c.useRef)(null),M=(0,c.useRef)(null),U=(0,c.useRef)(new Map),G=(0,c.useRef)(null),F=(0,c.useRef)(null),V=(0,c.useRef)(new Map),Z=(0,c.useRef)(null),B=(0,c.useRef)(new Set),W=(0,c.useRef)(null),q=(0,c.useRef)("");(0,c.useEffect)(()=>{h(a)},[a]),(0,c.useEffect)(()=>{a&&A&&x&&et()},[a,A,x]);let K=async()=>{try{let e=await navigator.permissions.query({name:"microphone"});if("denied"===e.state)throw Error("Microphone permission was denied. Please enable microphone access in your browser settings.");return(await navigator.mediaDevices.getUserMedia({audio:!0}
1)).getTracks().forEach(e=>e.stop()),!0}catch(e){if("NotAllowedError"===e.name)throw Error("Microphone permission is required for voice mode. Please allow microphone access and try again.");if("NotFoundError"===e.name)throw Error("No microphone found. Please connect a microphone and try again.");throw e}},H=async()=>{try{var e;let t=(await navigator.mediaDevices.enumerateDevices()).filter(e=>"audioinput"===e.kind);if(0===t.length)return;let n=["iphone","ipad","continuity"],r=["macbook","built-in","internal","imac","mac mini"],a=t.find(e=>{let t=(e.label||"").toLowerCase();return r.some(e=>t.includes(e))});if(a)return a.deviceId;let i=t.find(e=>{let t=(e.label||"").toLowerCase();return!n.some(e=>t.includes(e))});if(i)return i.deviceId;return null===(e=t[0])||void 0===e?void 0:e.deviceId}catch(e){return}},z=()=>{let e=new AudioContext,t=e.createOscillator(),n=e.createMediaStreamDestination(),r=e.createGain();return r.gain.value=0,t.connect(r),r.connect(n),t.start(),j.current=e,M.current=t,n.stream.getAudioTracks()[0]},Y=(e,t)=>{if("undefined"==typeof MediaRecorder)return null;let n="audio/webm";if(!MediaRecorder.isTypeSupported(n))return null;let r=[],a=new MediaRecorder(e,{mimeType:n}),i=new Promise(e=>{a.ondataavailable=e=>{e.data.size>0&&r.push(e.data)},a.onstop=()=>e(new Blob(r,{type:n}))});return V.current.set(t,i),a.start(),a},J=e=>{let r=V.current.get(e);r&&r.then(r=>{f(t===o.MOCK_INTERVIEW_APP?"/mi":"",n.interview.id,n.interview.categoryId,n.attemptCount,e,r).catch(e=>(0,_.u)(Error("Failed to save realtime mock interview audio with error ".concat(JSON.stringify(e))))),V.current.delete(e)})},X=t===o.MOCK_INTERVIEW_APP?"SAMI_REALTIME_CHAT":"EDU_REALTIME_CHAT",Q=t===o.MOCK_INTERVIEW_APP?"SAMI_REALTIME_CHAT_START_CLICKED":"EDU_REALTIME_CHAT_START_CLICKED",$=t===o.MOCK_INTERVIEW_APP?"SAMI_REALTIME_CHAT_END_CLICKED":"EDU_REALTIME_CHAT_END_CLICKED",ee=(0,c.useCallback)(async e=>{r(!0),l(!0),e.preventDefault();try{var a;i(X,Q,null==n?void 0:null===(a=n.interview)||void 0===a?void 0:a.id),await K(),p(t===o.MOCK_INTERVIEW_APP?"mi/":"",n.interview.id,n.interview.categoryId,n.yearsOfExperience,n.attemptCount,n.role).then(async e=>{if(null==e?void 0:e.error)n.onError(null==e?void 0:e.error),r(!1),l(!1),m(!1);else{let{model:r,voice:a,vad_type:i,eagerness:s,create_response:c,silence_duration:_,threshold:g,client_secret:h}=e,p=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),E=document.createElement("audio");E.autoplay=!0,p.addTransceiver("audio",{direction:"recvonly"}),p.ontrack=e=>{var t;let n=null!==(t=e.streams[0])&&void 0!==t?t:new MediaStream([e.track]);E.srcObject=n,G.current=n},document.body.appendChild(E),k.current=E;let f=await H(),b=await navigator.mediaDevices.getUserMedia(f?{audio:{deviceId:{exact:f}}}:{audio:!0}),T=p.addTrack(b.getTracks()[0]);L.current=T,D.current=b,P.current=z();let A=new AudioContext,w=A.createAnalyser();A.createMediaStreamSource(b).connect(w),w.fftSize=256,w.smoothingTimeConstant=.8,d(!0);let j=p.createDataChannel("oai-events");j.addEventListener("message",async e=>{var r,a,i,s;let c=JSON.parse(e.data);switch(c.type){case S.RECEIVE_EVENTS.CONVERSATION_ITEM_ADDED:{let e=c.item,t=e.id,r=e.role,a=Date.now();if("user"===r&&null!==W.current){B.current.add(t);break}C(t),U.current.set(t,a),"user"===r?(W.current=t,D.current&&(F.current=Y(D.current,t))):"assistant"===r&&(Z.current=t),n.messagesData.setMessages(n=>[...n,{type:"user"===r?N.HUMAN_MESSAGE:N.AI_MESSAGE,content:"",item_id:t,previous_item_id:e.previous_item_id,timestamp:a}]);break}case S.RECEIVE_EVENTS.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_DELTAL:{let e=c.item_id;n.messagesData.setMessages(t=>t.map(t=>t.item_id===e?{...t,content:t.content+c.delta}:t));break}case S.RECEIVE_EVENTS.CONVERSATION_ITEM_INPUT_AUDIO_TRANSCRIPTION_COMPLETED:if(B.current.has(c.item_id)){B.current.delete(c.item_id),q.current+=" "+c.transcript,n.messagesData.setMessages(e=>e.map(e=>e.item_id===W.current?{...e,content:q.current}:e)),v(t===o.MOCK_INTERVIEW_APP?"/mi":"",n.interview.id,n.interview.categoryId,n.attemptCount,{type:N.HUMAN_MESSAGE,content:q.current,contentType:I.TEXT,item_id:W.current,previous_item_id:c.previous_item_id,timestamp:U.current.get(W.current)});break}y(c.item_id),J(c.item_id),q.current=c.transcript,v(t===o.MOCK_INTERVIEW_APP?"/mi":"",n.interview.id,n.interview.categoryId,n.attemptCount,{type:N.HUMAN_MESSAGE,content:c.transcript,contentType:I.TEXT,item_id:c.item_id,previous_item_id:c.previous_item_id,timestamp:U.current.get(c.item_id)}),n.incrementPromptConsumed();break;case S.RECEIVE_EVENTS.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DELTA:{let e=c.item_id;n.messagesData.setMessages(t=>t.map(t=>t.item_id===e?{...t,content:t.content+c.delta}:t));break}case S.RECEIVE_EVENTS.RESPONSE_OUTPUT_AUDIO_TRANSCRIPT_DONE:B.current.clear(),W.current=null,q.current="",y(c.item_id),J(c.item_id),v(t===o.MOCK_INTERVIEW_APP?"/mi":"",n.interview.id,n.interview.categoryId,n.attemptCount,{type:N.AI_MESSAGE,content:c.transcript,contentType:I.TEXT,item_id:c.item_id,previous_item_id:c.previous_item_id,timestamp:U.current.get(c.item_id)}),await n.onSessionUpdate();break;case S.RECEIVE_EVENTS.SESSION_CREATED:case S.RECEIVE_EVENTS.SESSION_UPDATED:x||(m(!0),l(!1));break;case S.RECEIVE_EVENTS.OUTPUT_AUDIO_BUFFER_STARTED:u(!0),d(!1),L.current&&P.current&&L.current.replaceTrack(P.current).catch(e=>{if(D.current){var t;
1null===(t=D.current)||void 0===t||t.getTracks().forEach(e=>e.enabled=!1)}}),G.current&&Z.current&&(F.current=Y(G.current,Z.current));break;case S.RECEIVE_EVENTS.INPUT_AUDIO_BUFFER_COMMITTED:d(!1),(null===(r=F.current)||void 0===r?void 0:r.state)!=="inactive"&&(null===(a=F.current)||void 0===a||a.stop()),F.current=null;break;case S.RECEIVE_EVENTS.OUTPUT_AUDIO_BUFFER_STOPPED:if(d(!0),u(!1),L.current&&D.current){let e=D.current.getAudioTracks()[0];e&&L.current.replaceTrack(e).catch(e=>{if(D.current){var t;null===(t=D.current)||void 0===t||t.getTracks().forEach(e=>e.enabled=!0)}})}(null===(i=F.current)||void 0===i?void 0:i.state)!=="inactive"&&(null===(s=F.current)||void 0===s||s.stop()),F.current=null}});let M=await p.createOffer();await p.setLocalDescription(M),R.current=p,O.current=j;let V=JSON.stringify({type:"realtime",model:r,output_modalities:["audio"],audio:{output:{voice:a},input:{turn_detection:{type:i,..."server_vad"===i&&{silence_duration_ms:_,threshold:g},..."semantic_vad"===i&&{eagerness:s,create_response:c}}}}}),K=new FormData;K.set("sdp",M.sdp),K.set("session",V);let X=await fetch("https://api.openai.com/v1/realtime/calls",{method:"POST",body:K,headers:{Authorization:"Bearer ".concat(h)}}),Q={type:"answer",sdp:await X.text()};await p.setRemoteDescription(Q)}}).catch(e=>{n.onError(e),r(!1),l(!1),m(!1)})}catch(e){n.onError(e.message),r(!1),l(!1),m(!1)}},[n,r,l,m]),et=(0,c.useCallback)(()=>{r(!1);try{var e,t,a,o,l,s,c,d,u,_,g;try{i(X,$,null==n?void 0:null===(e=n.interview)||void 0===e?void 0:e.id),(null===(t=O.current)||void 0===t?void 0:t.readyState)==="open"&&O.current.send(JSON.stringify({type:S.SEND_EVENTS.RESPONSE_CANCEL})),(null===(a=O.current)||void 0===a?void 0:a.readyState)==="open"&&O.current.send(JSON.stringify({type:S.SEND_EVENTS.OUTPUT_AUDIO_BUFFER_CLEAR}))}catch(e){console.error("Error stopping any reply")}try{null===(o=D.current)||void 0===o||o.getTracks().forEach(e=>e.stop()),D.current=null}catch(e){console.error("Error stopping local stream")}try{null===(l=P.current)||void 0===l||l.stop(),P.current=null,null===(s=M.current)||void 0===s||s.stop(),M.current=null,null===(c=j.current)||void 0===c||c.close(),j.current=null,L.current=null}catch(e){console.error("Error stopping silent track")}try{(null===(d=F.current)||void 0===d?void 0:d.state)!=="inactive"&&(null===(u=F.current)||void 0===u||u.stop()),F.current=null,G.current=null,V.current.clear(),Z.current=null}catch(e){console.error("Error stopping audio recorders")}try{null===(_=O.current)||void 0===_||_.close()}catch(e){console.error("Error closing data channel")}try{null===(g=R.current)||void 0===g||g.close()}catch(e){console.error("Error closing peer connection")}O.current=null,R.current=null,B.current.clear(),W.current=null,q.current="",k.current&&(k.current.srcObject=null,k.current.remove(),k.current=null),m(!1)}catch(e){console.error("Error closing realtime chat")}},[r,m]);return(0,c.useEffect)(()=>(E(ee),T(et),()=>{E(null),T(null);try{var e,t,n;null===(e=P.current)||void 0===e||e.stop(),null===(t=M.current)||void 0===t||t.stop(),null===(n=j.current)||void 0===n||n.close()}catch(e){console.error("Error cleaning up audio resources:",e)}}),[]),(0,s.jsx)(g,{aiSpeaking:w,localStream:D.current},"tooltip-".concat(w))},x=n(823694),A=n(96157),w=n(729282),C=n(822557),y=n(669473),O=n(162030),R=n(276835),k=n(453263),D=n(98530),L=n(279916),P=n(363545),j=n(737218),M=n(752628),U=n(610285),G=n(872049),F=n(767854),V=n(760173),Z=n(835851),B=e=>{let{mainBarColor:t}=e,n=(0,Z.R)(),[r,a]=(0,c.useState)(!1),[i,o]=(0,c.useState)(1450),l=(0,c.useRef)(null);return(0,c.useEffect)(()=>{n.startRecording();let e=setTimeout(()=>{a(!0)},500);return()=>{clearTimeout(e),n.stopRecording()}},[]),(0,c.useEffect)(()=>{l.current&&o(l.current.offsetWidth);let e=new ResizeObserver(e=>{for(let t of e)t.target===l.current&&o(t.contentRect.width)});return l.current&&e.observe(l.current),()=>{e.disconnect()}},[]),(0,s.jsx)("div",{ref:l,className:"relative h-full w-full",children:(0,s.jsx)("div",{className:"absolute top-1/2 -ml-12 w-full -translate-y-1/2 sm:translate-x-1/2",style:{opacity:r?1:0},children:(0,s.jsx)(Z.Z,{controls:n,isControlPanelShown:!1,width:2*i,height:70,backgroundColor:"transparent",mainBarColor:t,secondaryBarColor:"transparent",barWidth:5,roun
1ded:5,gap:1,speed:1})})})},W=e=>{let{active:t=!1}=e;return(0,s.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("g",{"clip-path":"url(#clip0_12128_15948)",children:(0,s.jsx)("path",{d:"M6.66667 15C7.125 15 7.5 14.625 7.5 14.1667V5.83335C7.5 5.37502 7.125 5.00002 6.66667 5.00002C6.20833 5.00002 5.83333 5.37502 5.83333 5.83335V14.1667C5.83333 14.625 6.20833 15 6.66667 15ZM10 18.3334C10.4583 18.3334 10.8333 17.9584 10.8333 17.5V2.50002C10.8333 2.04169 10.4583 1.66669 10 1.66669C9.54167 1.66669 9.16667 2.04169 9.16667 2.50002V17.5C9.16667 17.9584 9.54167 18.3334 10 18.3334ZM3.33333 11.6667C3.79167 11.6667 4.16667 11.2917 4.16667 10.8334V9.16669C4.16667 8.70835 3.79167 8.33335 3.33333 8.33335C2.875 8.33335 2.5 8.70835 2.5 9.16669V10.8334C2.5 11.2917 2.875 11.6667 3.33333 11.6667ZM13.3333 15C13.7917 15 14.1667 14.625 14.1667 14.1667V5.83335C14.1667 5.37502 13.7917 5.00002 13.3333 5.00002C12.875 5.00002 12.5 5.37502 12.5 5.83335V14.1667C12.5 14.625 12.875 15 13.3333 15ZM15.8333 9.16669V10.8334C15.8333 11.2917 16.2083 11.6667 16.6667 11.6667C17.125 11.6667 17.5 11.2917 17.5 10.8334V9.16669C17.5 8.70835 17.125 8.33335 16.6667 8.33335C16.2083 8.33335 15.8333 8.70835 15.8333 9.16669Z",fill:"#D1D5DB",className:"".concat(t?"fill-[#5553FF]":"fill-[#D1D5DB]")})}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_12128_15948",children:(0,s.jsx)("rect",{width:"20",height:"20",fill:"white"})})})]})},q=n(234780),K=n(409288),H=n(186037),z=n(960564),Y=n(758136),J=n(774601),X=n(797131),Q=n(996666),$=n(391056),ee=n(995541),et=n(899921),en=n(383198),er=n(832592);let ea={[U.Em.NOT_ALLOWED]:(0,s.jsx)(Y.Z,{className:"fill-indigo-500 dark:fill-indigo-400"}),[U.Em.INACTIVE]:(0,s.jsx)(Y.Z,{className:"fill-indigo-500 dark:fill-indigo-400"}),[U.Em.RECORDING]:(0,s.jsx)(Q.Z,{className:"fill-indigo-500 dark:fill-indigo-400"}),[U.Em.PROCESSING]:(0,s.jsx)(J.Z,{className:"fill-gray-L300"})};var ei=e=>{var t,n,r,a,i,o;let{onSendClick:l,inputValue:d,setInputValue:u,maxTurnReached:m,fetchingResponse:g,mockInterview:h,promptsRemaining:p,timeOver:E,userInfo:f,interviewCategory:v,timeConsumed:N,onGoBackCTA:I,feedbackReqSubmitted:S=!1,mcqRendered:T=!1,name:x="",drawing:A=null,setDrawing:w=()=>{},containerMaxWidthStyles:C={},realtimeInProgress:y=!1,isBreakoutSession:R,isLinkedAISession:k}=e;(0,c.useEffect)(()=>{m&&u("")},[m]);let{loading:D,aiSpeaking:L,userSpeaking:P}=(0,b.F)(),j=(0,F.T9)(f.data),M=(0,F.YK)(f.data)||(null===(t=f.data)||void 0===t?void 0:t.has_valid_enterprise_sub),Z=null==f?void 0:f.loggedOut,Y=!(j||M)&&!Z,Q=(0,er.Z)(),ei=null===(r=Q.data)||void 0===r?void 0:null===(n=r.subscription_feature_type)||void 0===n?void 0:n.is_basic_user,eo=null===(i=Q.data)||void 0===i?void 0:null===(a=i.subscription_feature_type)||void 0===a?void 0:a.is_standard_user,el=ei||eo,[es,ec]=c.useState(void 0),ed=e=>{e.shiftKey||"Enter"!==e.key||g||(e.preventDefault(),l(!1))},[eu,e_]=c.useState(null);(0,c.useEffect)(()=>{A?(0,et.gu)(A.blob,100).then(e=>{e_(e)}):e_(null)},[null==A?void 0:A.blob]);let em=y||m||E||void 0!==es||S||T,eg=em||g||!(null==d?void 0:d.trim())&&!A||void 0!==es;return((0,c.useEffect)(()=>{if(em&&!y&&!m&&!E&&!S){var e;(0,_.u)(Error("Non-error Prompt input incorrectly disabled"),{realtimeInProgress:y,maxTurnReached:m,timeOver:E,secondsRecording:es,feedbackReqSubmitted:S,mcqRendered:T,userId:null===(e=f.data)||void 0===e?void 0:e.user_id})}},[em,y,m,E]),(0,c.useEffect)(()=>{h&&(E||0===p)&&(!R&&(Y||eo)||R&&Y)&&!h.skipAttemptConsumption&&setTimeout(()=>{(0,ee.V9)(v.id,h.id,{interview_duration_in_seconds:N,completion_status:!1}),k||R||(0,V.Z)({interviewCategory:v,interviewId:h.id,isFreeUser:Y,isMonthlyOrStandardUser:el,onGoBackCTA:I})},7e3)},[E,p]),h&&S)?null:(0,s.jsx)("div",{className:h?"fixed bottom-0 left-0 right-0 w-full lg:static lg:flex":"w-full",children:(0,s.jsx)("div",{className:"".concat(h?"px-2 sm:px-0":""," flex w-full justify-center"),style:C,children:h?(0,s.jsxs)("div",{className:"flex w-full space-x-2 sm:space-x-4",children:[(0,s.jsxs)("div",{className:"mb-6 mt-0 flex w-full items-center overflow-hidden rounded-xl border border-solid border-gray-L300 ".concat(void 0!==es?"bg-gray-L100 dark:bg-gray-D1500":m||em?"bg-gray-L100 dark:bg-gray-D1400":"bg-white dark:bg-gray-D1500"," shadow-md dark:border-gray-D900"),children:[void 0!==es?-1===es?(0,s.jsx)(J.Z,{className:"ml-4 fill-indigo-500 dark:fill-indigo-400"}):(0,s.jsxs)("div",{className:"ml-4 rounded-full bg-indigo-500 px-2 text-white dark:bg-indigo-400",children:["0",Math.floor(es/60),":",(0,ee.f2)(es%60)]}):(0,s.jsx)(s.Fragment,{}),(0,s.jsxs)("div",{className:"flex w-full flex-col",children:[eu&&(0,s.jsxs)("div",{className:"my-4 ml-4 flex max-w-fit",children:[(0,s.jsx)("img",{src:eu,alt:"PNG",style:{maxWidth:"100px",height:"auto"}}),(0,s.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-gray-L200",children:(0,s.jsx)(z.Z,{className:"flex h-4 w-4 cursor-pointer items-start justify-start fill-current",onClick:()=>{w(null),e_(null)}})})]}),y?D?(0,s.jsxs)("div",{className:"flex h-16 items-center justify-start gap-2 p-4",children:[(0,s.jsx)(W,{}),(0,s.jsx)("div",{className:"text-sm text-gray-L400",children:"Loading"})]}):P?(0,s.jsx)("div",{className:"flex h-16 w-full items-center",children:(0,s.jsx)(B,{mainBarColor:H.colors.indigo[500]})}):L?(0,s.jsxs)("div",{id:"ai-speaking-icon",className:"flex h-16 items-center justify-start gap-2 p-4",children:[(0,s.jsx)(W,{}),(0,s.jsx)("div",{className:"text-sm text-gray-L400",children:"AI is responding..."})]}):(0,s.jsxs)("div",{className:"flex h-16 items-center justify-start gap-2 p-4",children:[(0,s.jsx)(W,{active:!0}),(0,s.jsx)("div",{className:"content-brand-default text-sm",children:"Start speaking to answer"})]}):(0,s.jsx)(G.Z,{className:"body-medium no-scrollbar max-h-48 w-full resize-none overflow-y-auto border-none p-4 text-gray-L700 placeholder:text-gray-L400 focus:outline-none dark:bg-gray-D1500 dark:text-gray-D100 dar
1k:placeholder:text-gray-D400",maxRows:8,placeholder:void 0!==es?-1===es?U.Oh.CONVERTING_AUDIO:U.Oh.RECORDING_AUDIO:S&&g?U.Oh.GENERATING_FEEDBACK:S?U.Oh.INTERVIEW_CONCLUDED:m?U.Oh.MAX_TURN_REACHED:U.Oh.DEFAULT,onChange:e=>{(0,O.LS)("inputValue",e.target.value),(0,O.LS)("inputRows",String(e.target.value.split("\n").length||1)),u(e.target.value)},onKeyDown:ed,value:em?"":d,disabled:em})]}),(0,s.jsx)(K.default,{id:"message-send-button",className:"mx-2 p-2 pb-0.5 ".concat(eg?"":"cursor-pointer"),onClick:()=>{eg||l(!1)},overlay:eg?"":"Enter",position:q.YS,children:(0,s.jsx)(X.Z,{className:eg?"fill-gray-D50 dark:fill-gray-D400":"fill-indigo-500 dark:fill-indigo-400"})})]}),!y&&(0,s.jsx)("div",{className:"mb-6 cursor-pointer",children:(0,s.jsx)($.Z,{setOnGoingInputValue:u,onGoingInputValue:d,userId:null===(o=f.data)||void 0===o?void 0:o.user_id,setSecondsRecording:ec,disableRecording:m||E,inputDisabled:em,isUserLoggedOut:Z,renderAudioIcon:e=>(0,s.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-xl border border-solid border-indigo-400 bg-white p-4 shadow-md dark:border-gray-D900 dark:bg-transparent",children:ea[e]}),name:x})})]}):(0,s.jsxs)("div",{className:"w-4/5 lg:w-3/5 ".concat(m?"bg-gray-L300":"bg-white"," mb-2 flex rounded-md shadow-md"),children:[(0,s.jsx)("div",{className:"w-5/6 dark:bg-gray-D1100",children:(0,s.jsx)(G.Z,{className:"no-scrollbar h-full w-full resize-none rounded border-0 p-2 outline-none dark:bg-gray-D1100",onChange:e=>{u(e.target.value)},maxRows:4,placeholder:"Enter Prompt Here...",onKeyDown:ed,value:d,disabled:m})}),(0,s.jsxs)("div",{className:"flex h-full w-1/6 items-center dark:bg-gray-D1100",children:[(0,s.jsx)("div",{className:"h-full py-2",children:(0,s.jsx)(en.Z,{isVertical:!0,height:"h-full",width:10,className:"ml-2",color:"border-gray-L400"})}),(0,s.jsx)("div",{className:"flex w-full justify-center dark:bg-gray-D1100",children:(0,s.jsx)(K.default,{onClick:()=>{},overlay:m||!(null==d?void 0:d.trim())||g?"":"Enter",position:q.YS,children:(0,s.jsx)(X.Z,{className:"".concat(m?"fill-gray-L400 dark:fill-gray-D700":(null==d?void 0:d.trim())&&!g?"cursor-pointer fill-gray-L500 dark:fill-gray-D100":"fill-gray-L300 dark:fill-gray-D700"),onClick:()=>{g||l(!1)}})})})]})]})})})},eo=n(570056),el=n(251953),es=n(436097),ec=n(768317),ed=e=>{let{setFeedbackReqSubmitted:t,onFeedbackButtonClick:n,onContinueInterview:r,onGetFeedback:a,feedbackButtonContent:i,feedbackButtonClassName:o="",mobileSheetClassName:l="",desktopButtonsClassName:d="",optionButtonClassName:u="",continueText:_="Continue Interview",continueSubText:m="Finish the mock before ending",feedbackText:g="End & get feedback",feedbackSubText:h="Ends interview and shows feedback now"}=e,[p,E]=(0,c.useState)(!1),f=[{mainText:_,subText:m,onClick:()=>{r(),E(!1)}},{mainText:g,subText:h,onClick:()=>{a(),t(!0)}}];return(0,c.useEffect)(()=>{p&&setTimeout(()=>{E(!1)},1e4)},[p]),(0,s.jsxs)(s.Fragment,{children:[!p&&(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)("div",{onClick:()=>{n(),E(!0)},className:o,children:i})}),(0,s.jsx)("div",{className:"sm:hidden",children:(0,s.jsx)(()=>{let[e,t]=(0,c.useState)(0),[n,r]=(0,c.useState)(!1),[a,i]=(0,c.useState)(0),[o,d]=(0,c.useState)(!1);return((0,c.useEffect)(()=>{if(!n)return;let l=e=>{let n=e.clientY-a;Math.abs(n)>5&&(d(!0),t(Math.max(0,n)))},s=()=>{r(!1),o&&e>100&&E(!1),t(0),i(0),d(!1)};return document.addEventListener("mousemove",l),document.addEventListener("mouseup",s),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",s)}},[n,a,o]),p)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:()=>E(!1)}),(0,s.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 rounded-t-2xl ".concat(l),style:{transform:"translateY(".concat(e,"px)"),opacity:Math.max(.5,1-e/300)},children:[(0,s.jsx)("div",{"data-drag-handle":!0,className:"flex cursor-grab justify-center py-3 active:cursor-grabbing",onTouchStart:e=>{e.target.closest("[data-drag-handle]")&&(r(!0),i(e.touches[0].clientY),d(!1),e.preventDefault())},onTouchMove:e=>{if(!n)return;let r=e.touches[0].clientY-a;Math.abs(r)>5&&(d(!0),t(Math.max(0,r)),e.preventDefault())},onTouchEnd:()=>{n&&(r(!1),o&&e>100&&E(!1),t(0),i(0),d(!1))},onMouseDown:e=>{e.target.closest("[data-drag-handle]")&&(r(!0),i(e.clientY),d(!1),e.preventDefault())},children:(0,s.jsx)("div",{className:"bg-gray-300 h-1 w-10 rounded-full"})}),(0,s.jsx)("div",{className:"space-y-3 px-6",style:{paddingBottom:"90px"},children:f.map(e=>(0,s.jsxs)("button",{onClick:e.onClick,className:"mb-4 flex cursor-pointer flex-col items-start rounded-lg border border-solid p-2 ".concat(u),children:[(0,s.jsx)("span",{className:"mb-1 text-base font-semibold",children:e.mainText}),(0,s.jsx)("span",{className:"text-sm",children:e.subText})]},e.mainText))}),(0,s.jsx)("div",{className:"h-safe-area-inset-bottom"})]})]}):null},{})}),p&&(0,s.jsx)("div",{className:"tailwind-hidden justify-center gap-2 sm:flex ".concat(d),children:f.map(e=>(0,s.jsxs)("div",{onClick:e.onClick,className:"mb-4 flex cursor-pointer flex-col items-start rounded-lg px-4 py-2 pl-4 ".concat(u),children:[(0,s.jsx)("span",{className:"font-semibold",children:e.mainText}),(0,s.jsx)("span",{className:"text-sm",children:e.subText})]},e.mainText))})]})},eu=n(447511),e_=e=>{let{categoryId:t,interviewId:n,interviewName:r,setFeedbackReqSubmitted:a}=e,i=(0,R.useRouter)(),{realtimeChatEndHandler:o,setEndSession:l}=(0,b.F)(),c={category_id:t,interview_id:n},d=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"pt-1",children:(0,s.jsx)(eu.Z,{className:"content-default-subdued h-6 w-6 fill-current group-hover:text-indigo-400"})}),(0,s.jsx)("span",{className:"body-small content-default-subdued group-hover:text-indigo-400",children:"Get your feedback"})]});return(0,s.jsx)(ed,{setFeedbackReqSubmitted:a,onFeedbackButtonClick:()=>{null==o||o(),l(!0),(0,y.Z)("AI_MOCK_INTERVIEW","Clicked_Feedback_Prompt",r),(0,ec.d)("Clicked_Feedback_Prompt",JSON.stringify(c),i)},onContinueInterview:()=>{(0,y.Z)("AI_MOCK_INTERVIEW","Select_ContinueInterview",r),(0,ec.d)("Select_ContinueInterview",JSON.stringify(c),i)},onGetFeedback:()=>{(0,y.Z)("AI_MOCK_INTERVIEW","Select_GiveFeedback",r),(0,ec.d)("Select_GiveFeedback",JSON.stringify(c),i)},feedbackButtonContent:d,feedbackButtonClassName:"border-def-neutral-rest group mb-4 flex w-fit cursor-pointer items-center space-x-2 rounded-lg border border-solid px-4 py-1 hover:border-indigo-400",mobileSheetClassName:"bg-neutral-default",optionButtonClassName:"bg-neutral-default hover:bg-neutral-hover border-gray-L200 hover:border-indigo-400"})},em=e=>{let{humanPromptCount:t,totalPromptCount:n,isPremium:r,interviewName:a=""}=e,i=t/n>.75;return(0,s.jsxs)("div",{className:"flex items-center justify-center",children:[(0,s.jsxs)("p",{className:"".concat(i?"content-caution-default":"text-gray-L500 dark:text-gray-D100"," mb-0"),children:[t," / ",n," Responses"]}),!r&&i&&(0,s.jsx)("button",{onClick:()=>{(0,y.Z)("AI_MOCK_INTERVIEW","Clicked_Upgrade_FreemiumPrompts",a),window.open("/unlimited","_blank")},className:"outlined-primary ml-2 h-9 w-20 rounded",children:"Upgrade"})]})};let eg=(e,t,n)=>fetch("/api/mock-interview/".concat(e,"/").concat(t,"/").concat(n,"/regenerate-drawing-urls"),{method:"POST"}),eh=(e,t,n,r)=>fetch("/api/mock-interview/".concat(e,"/").concat(t,"/").concat(n,"/regenerate-message-drawing-url"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message_index:r})});class ep{removeDrawingContentBlobFromMessages(e){return e.map(e=>{var t;let n=JSON.parse(JSON.stringify(e));return(null===(t=n.drawingContent)||void 0===t?void 0:t.blob)&&(delete n.drawingContent.blob,delete n.drawingContent.privateURL),n})}constructor({categoryId:e,interviewId:t,attemptId:n,userId:r,getMe
1ssages:a,getChatAnalysisData:i,getAttemptData:o,setMessages:l,setChatAnalysisData:s,setIsAnyDetailedAnalysisInProgress:c}){var d=this;this.isDetailedAnalysisInProgress=!1,this.regenerateSingleMessageUrl=async e=>{try{let t=await eh(this.categoryId,this.interviewId,this.attemptId,e);if(!t.ok)throw Error("Failed to regenerate drawing URL: ".concat(t.statusText));let n=await t.json(),r=[...this.getMessages()];return n.success&&(r[e]={...r[e],...n.message}),this.setMessages(r),r}catch(n){let t=n instanceof Error?n.message:String(n);throw(0,_.u)(Error("Failed to regenerate drawing URL for user: ".concat(this.userId,", interview: ").concat(this.interviewId,", category: ").concat(this.categoryId,", attempt: ").concat(this.attemptId,", messageIndex: ").concat(e,", error: ").concat(t))),n}},this.regenerateAllMessagesUrls=async()=>{try{let e=await eg(this.categoryId,this.interviewId,this.attemptId);if(!e.ok)throw Error("Failed to regenerate drawing URLs: ".concat(e.statusText));let t=await e.json(),n=t.success&&t.messages?t.messages:this.getMessages();return this.setMessages(n),n}catch(t){let e=t instanceof Error?t.message:String(t);throw(0,_.u)(Error("Failed to regenerate all drawing URLs for user: ".concat(this.userId,", interview: ").concat(this.interviewId,", category: ").concat(this.categoryId,", attempt: ").concat(this.attemptId,", error: ").concat(e))),t}},this.generateDetailedAnalysis=async e=>{var t,n,r,a,i,o,l,s;if(this.isDetailedAnalysisInProgress)return;let c=this.getMessages(),d=this.getChatAnalysisData(),u=this.getAttemptData();if(c&&(null===(t=c[e])||void 0===t?void 0:t.analysisData)&&!(e>=c.length)&&(null===(r=c[e])||void 0===r||null===(n=r.analysisData)||void 0===n||!n.strengths)){this.isDetailedAnalysisInProgress=!0,null===(a=this.setIsAnyDetailedAnalysisInProgress)||void 0===a||a.call(this,!0);try{c=await this.regenerateSingleMessageUrl(e);let t=this.removeDrawingContentBlobFromMessages(c),n=await (0,D.le)({endpoint:"ai/mock-interview/message-detailed-analysis",method:"POST",body:JSON.stringify({category_id:this.categoryId,interview_id:this.interviewId,user_id:this.userId,attempt_count:this.attemptId,years_of_experience:(null==u?void 0:u.yearsOfExperience)||"",role:(null==u?void 0:u.role)||"",language:(null==u?void 0:u.preferredLanguage)||"",company:(null==u?void 0:u.company)||"",overall_feedback:(null===(i=c[c.length-1])||void 0===i?void 0:i.content)||"",conversation_snippet:t.slice(Math.max(0,e-3),e+3),question_to_analyze:c[e-1]||null,candidate_answer:t[e]||null,message_index:e,response_original_rating:(null===(l=c[e])||void 0===l?void 0:null===(o=l.analysisData)||void 0===o?void 0:o.rating)||"",chat_analysis_data:d.data})}),r=await n.json();if(!r||r.error)throw Error((null==r?void 0:r.message)||"Something went wrong");let a=r.analysisResult,s={...c[e].analysisData,...a},_=[...c];_[e]={..._[e],analysisData:s};let m=d.data.map(t=>t.messageIndex===e?{...t,analysis:s}:t);this.setMessages(_),this.setChatAnalysisData({executed:!0,loading:!1,data:m})}catch(t){this.setChatAnalysisData({executed:!0,loading:!1,data:d.data});let e=t instanceof Error?t.message:String(t);(0,_.u)(Error("Failed to generate chat message detailed analysis for user: ".concat(this.userId,", interview: ").concat(this.interviewId,", category: ").concat(this.categoryId,", attempt: ").concat(this.attemptId,", error: ").concat(e)))}finally{this.isDetailedAnalysisInProgress=!1,null===(s=this.setIsAnyDetailedAnalysisInProgress)||void 0===s||s.call(this,!1)}}},this.generateChatAnalysis=async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=d.getMessages(),n=d.getAttemptData();d.setChatAnalysisData({executed:!1,loading:!0,data:[]});try{e&&(t=await d.regenerateAllMessagesUrls());let r=d.removeDrawingContentBlobFromMessages(t),a=await (0,D.le)({endpoint:"ai/mock-interview/chat-analysis",method:"POST",body:JSON.stringify({category_id:d.categoryId,interview_id:d.interviewId,user_id:d.userId,attempt_count:d.attemptId,category_name:(null==n?void 0:n.categoryName)||"",years_of_experience:(null==n?void 0:n.yearsOfExperience)||"",role:(null==n?void 0:n.role)||"",messages:r})}),i=await a.json();if(!i||i.error)throw Error((null==i?void 0:i.message)||"Something went wrong");let o=i.analysisResults,l=[...t];
1o.forEach(e=>{let{messageIndex:t,analysis:n}=e;l[t]&&(l[t]={...l[t],analysisData:n})}),d.setMessages(l),d.setChatAnalysisData({executed:!0,loading:!1,data:o})}catch(t){d.setChatAnalysisData({executed:!0,loading:!1,data:[]});let e=t instanceof Error?t.message:String(t);(0,_.u)(Error("Failed to generate chat analysis for user: ".concat(d.userId,", interview: ").concat(d.interviewId,", category: ").concat(d.categoryId,", attempt: ").concat(d.attemptId,", error: ").concat(e)))}},this.analysisThumbClick=(e,t)=>{let n=this.getMessages(),r={...n[t].analysisData,feedback:e};n[t].analysisData=r,this.setMessages([...n])},this.categoryId=e,this.interviewId=t,this.attemptId=n,this.userId=r,this.getMessages=a,this.getChatAnalysisData=i,this.getAttemptData=o,this.setMessages=l,this.setChatAnalysisData=s,this.setIsAnyDetailedAnalysisInProgress=c}}var eE=n(815629),ef=n(968700),ev=n(383234),eN=n(797863),eI=n(259816),eS=n(274975),eb=n(937185),eT=n(605862),ex=n(466577),eA=n(390847),ew=n(861208),eC=n(978755),ey=n(450206),eO=n(436264),eR=n(833737),ek=n(874049),eD=n(197410),eL=n(130592),eP=n(316153),ej=n(523590);function eM(){return(eM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var eU=function(e){return ej.createElement("svg",eM({width:14,height:12,viewBox:"0 0 14 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=ej.createElement("path",{d:"M0.416626 11.375V7.7275L5.51913 6L0.416626 4.2725V0.625L13.9262 6L0.416626 11.375Z",fill:"current"})))};let eG={[U.Em.INACTIVE]:(0,s.jsx)(Y.Z,{className:"content-default-default h-full w-full"}),[U.Em.RECORDING]:(0,s.jsx)(Q.Z,{className:"h-full w-full fill-indigo-500 dark:fill-indigo-400"}),[U.Em.PROCESSING]:(0,s.jsx)(J.Z,{className:"h-full w-full fill-gray-L300"})};var eF=e=>{var t,n;let{onSendClick:r,inputValue:a,setInputValue:i,maxTurnReached:o,fetchingResponse:l,timeOver:d,userInfo:u,feedbackReqSubmitted:_=!1,messages:m=[],showResetButton:g=!1,handleConfirmReset:h,compId:p,name:E="",realtimeInProgress:f=!1,isMockInterview:v=!1}=e,N=(0,c.useRef)(null);(0,c.useEffect)(()=>{o&&i("")},[o,i]);let[I,S]=c.useState(void 0),b=(0,c.useCallback)(()=>{let e=N.current;if(e){if(e.style.height="auto",a){let t=Math.min(e.scrollHeight,140);e.style.height="".concat(t,"px")}else e.style.height="24px"}},[a]);(0,c.useEffect)(()=>{b()},[a,b]),(0,c.useEffect)(()=>{N.current&&(N.current.style.height="24px")},[]);let T=f||o||d||void 0!==I||_,x=T||l||!(null==a?void 0:a.trim())||void 0!==I,A=(0,R.useRouter)(),w=(0,eA.Z)(),y=(0,eN.M)(w||A.asPath),O=(0,eN.i)(w||A.asPath,!0,!0);return v&&_?null:(0,s.jsxs)("div",{className:"flex w-full flex-col justify-center gap-4 px-4 pb-6 pt-4 lg:px-6 lg:pb-8 lg:pt-6 ",children:[!m.length&&(0,s.jsx)("div",{className:"content-default-default font-nunito text-center text-xl font-medium",children:"How can I assist you?"}),(0,s.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,s.jsxs)("div",{className:"bg-def-neutral-secondary border-def-neutral-default flex h-auto max-h-36 flex-1 flex-shrink-0 items-start gap-2 overflow-y-hidden rounded-md px-4 py-2",children:[(0,s.jsx)("div",{className:"ml-2 mt-1.5",children:void 0!==I?-1===I?(0,s.jsx)(J.Z,{className:"fill-indigo-500 dark:fill-indigo-400"}):(0,s.jsxs)("div",{className:"rounded-full bg-indigo-500 px-2 text-white dark:bg-indigo-400",children:["0",Math.floor(I/60),":",(0,ee.f2)(I%60)]}):(0,s.jsx)(s.Fragment,{})}),(0,s.jsx)("textarea",{ref:N,className:"bg-def-neutral-secondary mt-1.5 w-full flex-grow-0 resize-none overflow-y-auto border-0 outline-none",onChange:e=>{i(e.target.value)},placeholder:void 0!==I?-1===I?U.Oh.CONVERTING_AUDIO:U.Oh.RECORDING_AUDIO:o?U.Oh.MAX_TURN_REACHED:U.Oh.DEFAULT,onKeyDown:e=>{e.shiftKey||"Enter"!==e.key||l||(e.preventDefault(),r(!1))},value:T?"":a,disabled:T,rows:1}),a?(0,s.jsx)(K.default,{overlay:"Send message",position:q.YS,overlayParentClasses:"max-w-xs",backgroundColor:"bg-gray-L900 dark:bg-gray-D1100",overlayParentTextColorClasses:"text-white",showPointer:!1,children:(0,s.jsx)("div",{className:"hover:bg-def-neutral-tertiary flex h-8 w-8 items-center justify-center rounded",children:(0,s.jsx)(eU,{className:"h-4 w-4 flex-shrink-0 fill-gray-L700 dark:fill-gray-D100 ".concat(x?"cursor-not-allowed":"cursor-pointer"),onClick:()=>{l||r(!1)}})})}):(0,s.jsx)(K.default,{overlay:void 0===I?"Use microphone":-1===I?"Convert
1ing audio to text...":"Tap again to stop recording",position:q.YS,overlayParentClasses:"max-w-xs",backgroundColor:"bg-gray-L900 dark:bg-gray-D1100",overlayParentTextColorClasses:"text-white",showPointer:!1,children:(0,s.jsx)("div",{className:"hover:bg-def-neutral-tertiary flex h-8 w-8 items-center justify-center rounded",children:(0,s.jsx)($.Z,{setOnGoingInputValue:i,onGoingInputValue:a,userId:null===(t=u.data)||void 0===t?void 0:t.user_id,setSecondsRecording:S,disableRecording:o||d,inputDisabled:T,name:E,isUserLoggedOut:!(null===(n=u.data)||void 0===n?void 0:n.user_id),renderAudioIcon:e=>(0,s.jsx)("div",{className:"h-5 w-5 flex-shrink-0 cursor-pointer",onClick:()=>{e===U.Em.INACTIVE&&(O||y)&&(0,eD.O)("CLICKED_USE_MICROPHONE",{pathAuthorId:A.query.pathAuthorId,pathId:A.query.pathId,authorId:A.query.authorId,collectionId:A.query.collectionId,pageId:A.query.pageId,compType:C.L.AI_PROMPT,compId:p},"",w||A.asPath,O)},children:eG[e]})})})})]}),g&&m.length>0&&(0,s.jsx)("div",{onMouseDown:e=>e.stopPropagation(),className:"flex h-10 items-center",children:(0,s.jsx)(eL.Z,{element:"button",handleConfirm:h,parentClasses:"outlined-default py-1.5 px-3 text-sm font-medium rounded-md",popoverTitle:"Discard your changes?",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(eP.Z,{className:"mr-1 h-4 w-4"}),"Reset"]})})})]})]})};let eV=e=>e.filter(e=>"human"===e.type).length;var eZ=e=>{var t,n,r,a,i,l,m,g,h,p,E;let{compId:f,content:v,authorId:N,collectionId:I,pageId:S,isDraft:G,widgetType:F,interviewCategory:V,interview:Z,setPromptsConsumed:B,timeOver:W=!1,yearsOfExperience:q,preferredLanguage:K,role:H,timeConsumed:z,attemptCount:Y,onGoBackCTA:J,feedbackReqSubmitted:X,setFeedbackReqSubmitted:Q,fetchingResponse:$,updateFetchingResponse:et,style:en={},sessionInProgress:ea=!1,inProgressChat:ec=[],setProblemId:ed=()=>{},executionResult:eu={code:{content:""},result:{}},editorPageId:eg=null,drawing:eh=null,setDrawing:eD=()=>{},codeEditorContent:eL=null,fullScreen:eP=!1,toggleFullScreen:ej=()=>{},mcqRendered:eM,updateMcqRendered:eU,showResetButton:eG=!1,getTimeConsumed:eZ=()=>0,onBackClick:eB=()=>{},setUserFeedback:eW=()=>{},userFeedback:eq=null,containerMaxWidthStyles:eK={},promptCount:eH,setInterviewCrashed:ez,isBreakoutSession:eY=!1,isLinkedAISession:eJ=!1}=e,{setEnabled:eX}=(0,b.F)(),eQ=(0,el.P)(N.toString(),I.toString(),!!Z),{userInfoState:e$}=(0,ew.su)(),e0=(0,eO.S4)(null===(t=e$.data)||void 0===t?void 0:t.full_name),e1=(0,ey.TL)(),e2=(0,ek.P)("ai_mock_interview_default_message",!1),e3=!!Z&&(Z.initialMessage?Z.initialMessage.replace(/{user_name}/g,(0,eI.f)(e0)):e2?e2.replace(/{user_name}/g,(0,eI.f)(e0)).replace(/{category_name}/g,V.name):"Hello ".concat((0,eI.f)(e0),"! I'm Edward, an AI interviewer specializing in mock technical interviews. Let's start by letting me know your experience with ").concat(V.name," problems?")),e5=e=>{let t=P.f$,n=e.match(t),r="";return n&&(r=n[1]),r.trim()},[e4,e6]=(0,c.useState)(ea&&ec&&ec.length>0?ec:Z?[{type:eo.oK.AI_MESSAGE,content:e3}]:[]),e8=(0,c.useRef)(e4);(0,c.useEffect)(()=>{e8.current=e4},[e4]),(0,c.useEffect)(()=>{if(ea&&ec&&ec.length>0){let e;e="",ec.forEach(t=>{let n=e5(t.content);n&&(e=n)}),e&&ed(e)}},[]);let[e7,e9]=(0,c.useState)({content:null,feedback:eo.Eo.NEUTRAL,type:eo.oK.AI_MESSAGE}),[te,tt]=(0,c.useState)(ea?eV(ec):0),[tn,tr]=(0,c.useState)("");(0,c.useEffect)(()=>{tr((0,O.rV)("inputValue")||"")},[]);let ta=te>=v.turnLimit,ti="".concat(N,"_").concat(I,"_").concat(S,"_").concat(f),to=parseInt((0,ek.P)(x.Z,!1)||"0"),tl=(0,R.useRouter)(),ts=(0,er.Z)(),tc=(0,u.I)(null===(n=ts.data)||void 0===n?void 0:n.subscription_feature_type),td=tl.query.pageType===w.s.NEWSLETTER?eg:null,tu=tc&&!!td,t_=(null===(a=(0,eS.q6)())||void 0===a?void 0:null===(r=a.instance)||void 0===r?void 0:r.owned_by_reader)||G||tu,tm=(0,k.mn)(),tg=!!(null===(l=ts.data)||void 0===l?void 0:null===(i=l.subscription_feature_type)||void 0===i?void 0:i.is_premium_user),th=!!(null===(g=ts.data)||void 0===g?void 0:null===(m=g.subscription_feature_type)||void 0===m?void 0:m.is_premium_plus_user),tp=to===A.C.LEARNER_FF_L6_FULL_B2B||to===A.C.LEARNER_FF_L2_FULL_INTERNAL&&(null===(h=e$.data)||void 0===h?void 0:h.email.endsWith("@educative.io")),tE=null===(p=e$.data)||void 0===p?void 0:p.user_id,tf=()=>{var e,t,n,r,a,i;let o=null==eu?void 0:null===(t=eu.result)||void 0===t?void 0:null===(e=t.result)||void 0===e?void 0:e.total_testcases,l=null==eu?void 0:null===(r=eu.result)||void 0===r?void 0:null===(n=r.result)||void 0===n?void 0:n.passed_testcases;return"Here's my code for this problem:\n \nCode:\n ```".concat(null==eu?void 0:null===(a=eu.code)||void 0===a?void 0:a.language,"\n ").concat(null==eu?void 0:null===(i=eu.code)||void 0===i?void 0:i.content,"\n ").concat(o?"\nPassed Test Cases: ".concat(l||0,"/").concat(o):"","\n \n```")},tv=(0,ex.x)(),tN=(0,eS.q6)(),{collectionArticlePreview:tI}=(0,eb.nF)(),[tS,tb]=c.useState(!1);(0,c.useEffect)(()=>{eX(!!(null==Z?void 0:Z.realtimeEnabled))},[]);let tT=e=>{e1(eC.n.show(es.m6,{timeConsumed:eZ(),categoryId:V.id,interviewId:Z.id,attemptCount:Y,onBackClick:eB,turnCount:te,interviewName:Z.name,token:e,mockInterviewType:Z.isDrawingWidgetEnabled?j._C.DRAWING:Z.isCodingEnv?j._C.CODING:null,promptCount:eH}))},tx=(0,c.useRef)(!1),tA=(0,c.useRef)(!1),[tw,tC]=(0,c.useState)({executed:!1,loading:!1,data:[]}),[ty,tO]=(0,c.useState)(!1),tR=(th||tg)&&X&&!!Z&&!Z.freemiumEnabled&&!Z.isBreakoutRoom,tk={yearsOfExperience:q,role:H,preferredLanguage:K,categoryName:null==V?void 0:V.name,company:(null==Z?void 0:null===(E=Z.companies)||void 0===E?void 0:E[0])||""},tD=function(e){let{categoryId:t,interviewId:n,attemptId:r,userId:a,messages:i,chatAnalysisData:o,attemptData:l,setChatAnalysisData:s,setMessages:d,setIsAnyDetailedAnalysisInProgress:u}=e;return c.useMemo(()=>t&&n&&r&&a?new ep({categoryId:t,interviewId:n,attemptId:r,userId:a,getMessages:()=>i,getChatAnalysisData:()=>o,getAttemptData:()=>l,setMessages:d,setChatAnalysisData:s,setIsAnyDetailedAnalysisInProgress:u}):null,[t,n,r,a,i])}({categoryId:null==V?void 0:V.id,interviewId:null==Z?void 0:Z.id,attemptId:null==Y?void 0:Y.toString(),userId:tE,messages:e4,chatAnalysisData:tw,attemptData:tk,setChatAnalysisData:t
1C,setMessages:e6,setIsAnyDetailedAnalysisInProgress:tO});(0,c.useEffect)(()=>{tv&&ea&&ec&&ec.length>0&&(e6(ec),tt(eV(ec)))},[ea,ec,tv]);let{SDI_MASTER_PATH:tL}=(0,eT.K)(),tP=()=>{null==B||B(te+1),tt(e=>e+1)},tj=async(e,t,n,r,a)=>{var i,o,l,s,c;let u=!!eh&&!n&&!t&&!a;if(!tE){(0,d.q)({isEnterprise:!1,ru:tl.asPath});return}if(!t_){tm();return}if((!(null==tn?void 0:tn.trim())&&!t&&!n&&!u&&!a||ta)&&!e)return;et(!0);let m=!!(null==e7?void 0:e7.content);e9({content:null,feedback:eo.Eo.NEUTRAL,type:eo.oK.AI_MESSAGE});let g=[...e4];e||(m&&g.pop(),g.push({type:eo.oK.HUMAN_MESSAGE,content:u?null!=tn?tn:"":n?r:t?tf():a?eL:tn,...u&&{drawingContent:eh},hidden:t||a,contentType:u?eo.zv.IMAGE:eo.zv.TEXT}),e6(g));let h=[...g],p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&e9(e=>({...e,content:null}));let n=e5(e);h.push({type:eo.oK.AI_MESSAGE,content:e,feedback:eo.Eo.NEUTRAL}),e6([...h]),n&&(null==ed||ed(n))},E=e=>{let t=h[h.length-1].content,n=e5(t+=e);h[h.length-1].content=t,e6([...h]),n&&(null==ed||ed(n))};tr(""),eD(null),(0,O.cl)("inputValue"),(0,O.cl)("inputRows");try{if(Z){let e=g.map((e,t)=>{let n=JSON.parse(JSON.stringify(e));return n.drawingContent&&n.drawingContent.blob&&t!==g.length-1&&(delete n.drawingContent.blob,delete n.drawingContent.privateURL),n});await (0,U.A5)(Z.id,e,tE,q,H,K,V.id,Y,X,Z.freemiumEnabled,e=>{(0,_.u)(e,"Something went wrong in Mock Interview",{userId:String(tE)},{interviewId:null==Z?void 0:Z.id,categoryId:null==V?void 0:V.id,turnCount:te,currentUrl:tl.asPath}),e9(t=>{var n;return{...t,content:(null==e?void 0:null===(n=e.responseJSON)||void 0===n?void 0:n.errorText)||"Something went wrong. Please try again.",feedback:eo.Eo.NEUTRAL}})},E,p,tT,ez)}else{if((0,y.Z)("PROMPT_WIDGET","Prompt_Send_Success",ti),tv&&(null===L.P||void 0===L.P||(0,L.P)(null===(i=tI.data)||void 0===i?void 0:i.author_id,null===(o=tI.data)||void 0===o?void 0:o.collection_id),(0,L.w)(tE,null===(l=tI.data)||void 0===l?void 0:l.author_id,null===(s=tI.data)||void 0===s?void 0:s.collection_id,tL.pathIds[0],tL.pathIds[1])),tp)await (0,U.z5)(N,Number(I),f,v.systemPrompt,v.turnLimit,g,Number(S),tE,F,G,t=>{(0,_.u)(t,"Something went wrong in Mock Interview",{userId:String(tE)},{interviewId:null==Z?void 0:Z.id,categoryId:null==V?void 0:V.id,turnCount:te,currentUrl:tl.asPath}),e9(e=>{var n;return{...e,content:(null==t?void 0:null===(n=t.responseJSON)||void 0===n?void 0:n.errorText)||"Something went wrong. Please try again.",feedback:eo.Eo.NEUTRAL}}),e||tt(e=>e-1)},E,p,v.selectedAIModel,v.temperature,td);else{let e=await (0,U.rx)(g,N,f,Number(I),Number(S),G,v.systemPrompt,v.turnLimit,F,v.selectedAIModel,v.temperature);e6(t=>[...t,{type:eo.oK.AI_MESSAGE,content:e,feedback:eo.Eo.NEUTRAL}])}(0,y.Z)("PROMPT_WIDGET","Prompt_Resp_Success",ti),te+1>=v.turnLimit&&(0,y.Z)("PROMPT_WIDGET","All_Prompts_Used",ti)}et(!1),h[h.length-1].content.length<=0&&Z&&(0,_.u)(Error("AI response is empty for user :".concat(tE,", interview:").concat(Z.id,", category:").concat(V.id,", attempt:").concat(Y)),"AI response is empty for user ".concat(tE,", interview:").concat(Z.id,", category:").concat(V.id,", attempt:").concat(Y),{userId:String(tE)}),e||(2===eV(g)&&Z&&!tA.current&&(tA.current=!0,await (0,ev.b8)(Z.id,V.id)),tP())}catch(t){et(!1);let e=(null==t?void 0:null===(c=t.responseJSON)||void 0===c?void 0:c.errorText)||"Something went wrong. Please try again.";(0,_.u)(t,"Something went wrong in Mock Interview",{userId:String(tE)},{interviewId:null==Z?void 0:Z.id,categoryId:null==V?void 0:V.id,turnCount:te,currentUrl:tl.asPath}),e9(t=>({...t,content:e,feedback:eo.Eo.NEUTRAL}
1)),(0,y.Z)("PROMPT_WIDGET","Prompt_Resp_Failure","".concat(ti,"--").concat(e))}},tM=(0,eA.Z)(),tU=!!(null==Z?void 0:Z.showFeedbackFlow)&&te>ee.J5&&!X;(0,c.useEffect)(()=>{tR&&(null==tD||tD.generateChatAnalysis())},[tR]),(0,c.useEffect)(()=>{X&&(!tR||tw.executed)&&((null==eq?void 0:eq.loading)||eW({loading:!0,data:null,showFeedbackOnExit:tU}),tj(!0))},[X,tw.executed]);let tG=(e=>{if(e.length<2)return!1;let t=e.slice(-2);return t[0].type===eo.oK.AI_MESSAGE&&t[1].type===eo.oK.AI_MESSAGE})(e4)?e4[e4.length-1]:null;!tU||tG||X?!tG||(null==eq?void 0:eq.data)||eW({loading:!1,data:tG,showFeedbackOnExit:tU}):(null==eq?void 0:eq.showFeedbackOnExit)||eW({loading:!1,data:null,showFeedbackOnExit:tU}),(0,c.useEffect)(()=>{eL&&tj(!1,!1,!1,"",!0)},[eL]),(0,c.useEffect)(()=>{var e;(null==eu?void 0:null===(e=eu.code)||void 0===e?void 0:e.content)&&tj(!1,!0)},[eu]);let tF=(0,c.useRef)(),tV=(e,t)=>{var n,r,a,i,o,l,s,c,d,u,m,g,h;let p=(0,eN.M)(tl.asPath);if(tv||p){let m={feedback_category:tv?eE.fi.SDI_LOCAL:eE.fi.PAL_LOCAL,source:eE.r7.AI_EVALUATION,path_author_id:tl.query.pathAuthorId?Number(tl.query.pathAuthorId):null==tN?void 0:null===(r=tN.instance)||void 0===r?void 0:null===(n=r.details)||void 0===n?void 0:n.path_author_id,path_id:tl.query.pathId?Number(tl.query.pathId):null==tN?void 0:null===(i=tN.instance)||void 0===i?void 0:null===(a=i.details)||void 0===a?void 0:a.path_id,author_id:tl.query.authorId?Number(tl.query.authorId):null==tI?void 0:null===(o=tI.data)||void 0===o?void 0:o.author_id,collection_id:tl.query.collectionId?Number(tl.query.collectionId):null==tI?void 0:null===(l=tI.data)||void 0===l?void 0:l.collection_id,page_id:tl.query.pageId?Number(tl.query.pageId):null==tI?void 0:null===(s=tI.data)||void 0===s?void 0:s.page_id,comp_id:f,comp_type:C.L.AI_PROMPT,pattern_name:(null==tN?void 0:null===(d=tN.instance)||void 0===d?void 0:null===(c=d.details)||void 0===c?void 0:c.title)||"",page_title:(null==tI?void 0:null===(u=tI.data)||void 0===u?void 0:u.title)||"",reaction_value:e,message:t};(0,ev.F4)(m).catch(e=>(0,_.u)(e))}else{let n=e4.slice().reverse().find(e=>e.type===eo.oK.AI_MESSAGE),r=e4.slice().reverse().find(e=>e.type===eo.oK.HUMAN_MESSAGE),a={author_id:tl.query.authorId?Number(tl.query.authorId):null==tI?void 0:null===(m=tI.data)||void 0===m?void 0:m.author_id,collection_id:tl.query.collectionId?Number(tl.query.collectionId):null==tI?void 0:null===(g=tI.data)||void 0===g?void 0:g.collection_id,page_id:tl.query.pageId?Number(tl.query.pageId):null==tI?void 0:null===(h=tI.data)||void 0===h?void 0:h.page_id,comp_id:f,comp_type:C.L.AI_PROMPT,reaction_value:e,message:t,ai_feedback:(null==n?void 0:n.content)||"",ai_content:(null==r?void 0:r.content)||"",source:eE.r7.AI_EVALUATION};(0,eR.Mq)(a).catch(e=>(0,_.u)(e))}};return null==Z||!Z.freemiumEnabled||10!==e4.filter(e=>"human"===e.type).length||11!==e4.filter(e=>"ai"===e.type).length||$||th||tg||tx.current||(tx.current=!0,e1(eC.n.show(es.zN,{title:"No More Attempts Left!",description:"You've used all your available attempts. Upgrade your plan to continue practicing and unlock unlimited access.",cancelText:"Get Your Feedback",confirmText:"Upgrade",onCancel:()=>{(0,y.Z)("AI_MOCK_INTERVIEW","Select_GiveFeedback",(null==Z?void 0:Z.name)||(null==Z?void 0:Z.id)||""),Q(!0)},onConfirm:()=>{(0,y.Z)("AI_MOCK_INTERVIEW","ClickedModal_Upgrade_FreemiumPrompts",(null==Z?void 0:Z.name)||(null==Z?void 0:Z.id)||""),tl.push("/unlimited")},styleType:"leftAligned"}))),(0,s.jsxs)("div",{className:"flex h-full w-full flex-col ".concat(eQ?"border-def-primary-selected rounded-lg":Z?"":"bg-gray-L50 dark:bg-gray-D1400"),style:en,children:[eQ?(0,s.jsx)(U.Zm,{turnCount:te,turnLimit:v.turnLimit,fullScreen:eP,toggleFullScreen:ej}):!Z&&(0,s.jsx)(U.h4,{isViewer:!0,turnCount:te,turnLimit:v.turnLimit}),(0,s.jsx)(M.ZP,{messages:e4,error:e7,onSendClick:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return!$&&tj(e,t,n,r)},onThumbClick:Z?(e,t,n)=>{n?e9(t=>({...t,feedback:e})):e6(n=>{let r=[...n];return r[t]={...r[t],feedback:e},r})}:(e,t,n)=>{(0,D.WG)(tl,String(N),String(I),String(S),String(f),n?e7.content:e4[t].content,n?e4[e4.length-1].content:e4[t-1].content,e===eo.Eo.POSITIVE,"PromptAIWidget",()=>{n?e9(t=>({...t,feedback:e})):e6(n=>{let r=[...n];return r[t]={...r[t],feedback:e},r}),(0,y.Z)("PROMPT_WIDGET",e!==eo.Eo.NEGATIVE?"Prompt_Resp_Like":"Prompt_Resp_Dislike",ti)},F,"",tM)},userInfo:e$.data,isInterviewFetchingResponse:!!Z&&$||tw.loading,fetchingResponse:!tp&&$,isMockInterview:!!Z,useQuizWidget:null==Z?void 0:Z.useQuizWidget,setMcqRendered:eU,isSDPal:tv,isRevampedDesignEnabled:eQ,fullScreen:eP,compId:f,freemiumEnabled:(null==Z?void 0:Z.freemiumEnabled)&&!(th||tg),interviewName:null==Z?void 0:Z.name,containerMaxWidthStyles:eK,feedbackReqSubmitted:X,generateMIDetailedAnalysisForChat:null==tD?void 0:tD.generateDetailedAnalysis,mockInterviewAnalysisThumbClick:null==tD?void 0:tD.analysisThumbClick,isPremiumUser:tg,isBreakoutSession:eY,isAnyDetailedAnalysisInProgress:ty,preferredLanguage:K}),!!Z&&Z.realtimeEnabled&&(0,s.jsx)(T,{platform:o.EDUCATIVE,endSession:W||ta,sendGAEvent:y.Z,realtimeMIData:{attemptCount:Y,yearsOfExperience:q,interview:Z,role:H,messagesData:{messages:e4,setMessages:e6},incrementPromptConsumed:tP,onError:e=>{(0,_.u)(e,"Something went wrong in Mock Interview",{userId:String(tE)},{interviewId:null==Z?void 0:Z.id,categoryId:null==V?void 0:V.id,turnCount:te,currentUrl:tl.asPath}),e9(t=>{var n;return{...t,content:(null==e?void 0:null===(n=e.responseJSON)||void 0===n?void 0:n.errorText)||("string"==typeof e?e:"Something went wrong. Please try again."),feedback:eo.Eo.NEUTRAL}})},onSessionUpdate:async()=>{tA.current||3!==e8.current.filter(e=>e.type===eo.oK.AI_MESSAGE).length||(await (0,ev.b8)(Z.id,V.id),tA.current=!0)}},setRealtimeInProgress:tb}),(tU||(null==Z?void 0:Z.freemiumEnabled))&&(0,s.jsxs)("div",{className:"bg-def-neutral-secondary fixed bottom-20 left-0 right-0 flex h-14 min-h-fit w-full items-center justify-between px-2 sm:px-0 lg:static",style:eK,children:[(null==Z?void 0:Z.freemiumEnabled)&&!(tg||th)&&(0,s.jsx)(em,{humanPromptCount:e4.filter(e=>"human"===e.type).length,totalPromptCount:Z.maxPrompts,isPremium:tg||th,interviewName:null==Z?void 0:Z.name}),tU&&(0,s.jsx)(e_,{categoryId:V.id,interviewId:Z.id,interviewName:null==Z?void 0:Z.name,setFeedbackReqSubmitted:Q})]}),eQ?(0,s.jsx)(eF,{maxTurnReached:ta,inputValue:tn,setInputValue:tr,onSendClick:tj,fetchingResponse:$,timeOver:W,userInfo:e$,setError:e9,feedbackReqSubmitted:X,messages:e4,showResetButton:eG,handleConfirmReset:()=>{var e,t;e6([]),tt(0),(0,U.qW)(Number(N),Number(I),Number(S),f),null===L.P||void 0===L.P||(0,L.P)(null===(e=tI.data)||void 0===e?void 0:e.author_id,null===(t=tI.data)||void 0===t?void 0:t.collection_id)},compId:f,name:null==Z?void 0:Z.name,realtimeInProgress:tS,isMockInterview:!!Z}):(0,s.jsx)(ei,{maxTurnReached:ta,inputValue:tn,setInputValue:tr,onSendClick:tj,fetchingResponse:$,mockInterview:Z,promptsRemaining:v.turnLimit-te,timeOver:W,userInfo:e$,interviewCategory:V,setError:e9,timeConsumed:z,onGoBackCTA:J,feedbackReqSubmitted:X,mcqRendered:eM,name:null==Z?void 0:Z.name,drawing:eh,setDrawing:eD,containerMaxWidthStyles:eK,realtimeInProgress:tS,isBreakoutSession:eY,isLinkedAISession:eJ}),tv&&eQ&&(0,s.jsx)("div",{className:"bg-def-neutral-secondary flex-start flex",children:(0,s.jsx)(ef.default,{variation:eE.v_.ThumbsFeedbackWithText,feedbackQuestion:"Did
1you like this update?",thumbsUpTooltip:"I like it",thumbsDownTooltip:"I donât like it",customBackgroundClassVariant2:"bg-transparent",showTextAreaOn:"both",sticky:!0,stickyPosition:"top-left",onThumbsUpClick:()=>{tF.current="Like"},onThumbsDownClick:()=>{tF.current="Dislike"},onSkipClick:()=>{tV(tF.current,"")},onSubmitClick:e=>{tV(tF.current,e)},fadeOutAfterThankYou:!0,keepTouchpointAfterFeedback:!0})})]})}},953006:function(e,t,n){"use strict";var r=n(574101);n(441386),t.Z=e=>{let{id:t,checked:n,onChecked:a=()=>{},ariaLabel:i="",disabled:o=!1,className:l="border-2 border-solid border-gray-L600"}=e;return(0,r.jsx)("input",{type:"radio",checked:n,className:"peer relative !mt-0 flex h-5 w-5 cursor-pointer appearance-none items-center justify-center rounded-full ".concat(l," checked:border-indigo-500 checked:after:absolute checked:after:h-2.5 checked:after:w-2.5 checked:after:rounded-full checked:after:bg-indigo-500 checked:after:content-[''] hover:outline hover:outline-4 hover:outline-gray-L50 checked:hover:outline-none focus:!outline-none dark:border-gray-D200 dark:checked:border-indigo-400 dark:checked:after:bg-indigo-400 hover:dark:bg-gray-D1100 hover:dark:outline-gray-D1100 checked:hover:dark:bg-transparent checked:hover:dark:outline-none"),onChange:e=>e.target.checked&&a(),id:t,"aria-label":i,disabled:o})}},370001:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r,a,i=n(574101);n(441386);var o=n(523590);function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var s=function(e){return o.createElement("svg",l({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.81 9.12L22 9.74L16.55 14.47L18.18 21.5L12 17.77L5.82 21.5L7.46 14.47L2 9.74L9.19 9.13L12 2.5L14.81 9.12ZM8.24 18.17L12 15.9L15.77 18.18L14.77 13.9L18.09 11.02L13.71 10.64L12 6.6L10.3 10.63L5.92 11.01L9.24 13.89L8.24 18.17Z",fill:"current",fillOpacity:.54})))};function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}var d=function(e){return o.createElement("svg",c({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),a||(a=o.createElement("path",{d:"M12 17.77L18.18 21.5L16.54 14.47L22 9.74L14.81 9.13L12 2.5L9.19 9.13L2 9.74L7.46 14.47L5.82 21.5L12 17.77Z",fill:"#FF715B"})))},u=e=>{let{givenRating:t,onRatingChange:n,error:r,errorMessage:a="Please select a rating.",FilledIcon:o=d,EmptyIcon:l=s,containerClasses:c="",iconClasses:u="fill-current text-black dark:text-white"}=e;return(0,i.jsxs)("div",{className:"flex flex-col",children:[r&&(0,i.jsx)("div",{children:(0,i.jsx)("span",{className:"text-red-500",children:a})}),(0,i.jsx)("div",{className:"flex flex-row justify-center bg-transparent ".concat(c),children:[void 0,void 0,void 0,void 0,void 0].map((e,r)=>(0,i.jsx)("div",{"data-testid":"star-".concat(r+1),onClick:()=>{n(r+1)},children:(0,i.jsx)("span",{className:"cursor-pointer",children:r+1<=t?(0,i.jsx)(o,{}):(0,i.jsx)(l,{className:u})})},r+1))})]})}},259816:function(e,t,n){"use strict";n.d(t,{f:function(){return r}}),n(574101),n(441386),n(431418),n(523590);let r=e=>e&&"string"==typeof e&&e.length>0?e.charAt(0).toUpperCase()+e.substring(1).toLowerCase():""},466577:function(e,t,n){"use strict";n.d(t,{x:function(){return o}});var r=n(13858),a=n(390847),i=n(605862);let o=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,r.usePathname)(),n=(0,a.Z)(),o=(0,r.useParams)(),l=null==o?void 0:o.pathUrlSlug,{SDI_MASTER_PATH:s}=(0,i.K)();return t.startsWith("/interview-prep".concat(e?"/":""))&&l===s.slug||n.startsWith("/interview-prep/".concat(s.slug))}},833737:function(e,t,n){"use strict";n.d(t,{SV:function(){return g},vQ:function(){return a},dN:function(){return u},Mq:function(){return d},d0:function(){return m},lm:function(){return _}});var r,a,i=n(574101),o=n(940938),l=n(669473),s=n(436097),c=n(978755);let d=e=>(0,o.Z)({url:"/api/code/review/feedback",type:"POST",data:{author_id:e.author_id,work_id:e.collection_id,page_id:e.page_id,comp_id:e.comp_id,sender_message:e.message,review:e.ai_feedback,prompt_text:e.ai_content,is_helpful:"Like"===e.reaction_value,user_code:e.code_submitted,widget_type:e.comp_type,source:e.source}});(r=a||(a={}))[r.NotesAndHighlights=5001]="NotesAndHighlights",r[r.LearningStreaks=5002]="LearningStreaks",r[r.ExplorePage=5003]="ExplorePage",r[r.AdaptiveLearning=5004]="AdaptiveLearning",r[r.LearningTracker=5005]="LearningTracker",r[r.LTCPath=5006]="LTCPath";let u={5001:"My Notes and Highlights",5002:"Learning Streaks",5003:"content exploration",5005:"My Learning Tracker",5004:"Adaptive Learning Mode"},_=(e,t,n,r,a)=>e(c.n.show(s.bT,{featureType:t,FeedbackQuestion:a,onSubmit:()=>(0,l.Z)(n,r)})),m=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,o.Z)({url:"/api/feature-feedback",type:"POST",data:{rating:e,feedback:n,type:t}})},g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;return(0,i.jsxs)("span",{className:"body-small text-gray-L700 dark:text-gray-D200",children:[e,(0,i.jsx)("span",{className:"font-bold dark:text-gray-D200",children:r||u[t]}),n]})}},583263:function(e){e.exports={buttonsContainer:"author_feedback_modal_common_buttonsContainer__YvyD_",dark:"dark",AttachButtonsInnerContainer:"author_feedback_modal_common_AttachButtonsInnerContainer__ce6hn",attachAnImageContainer:"author_feedback_modal_common_attachAnImageContainer__QwNDB",attachButton:"author_feedback_modal_common_attachButton__wqrGH",takeScreenshotButton:"author_feedback_modal_common_takeScreenshotButton__Z0TRd",marginLeft:"author_feedback_modal_common_marginLeft__0ZDy1",cameraIcon:"author_feedback_modal_common_cameraIcon__OPjza",dragNDropContainer:"author_feedback_modal_common_dragNDropContainer__lgSJr",dragNDropCommon:"author_feedback_modal_common_dragNDropCommon__PDuRy",dragNDropInnerContainer:"author_feedback_modal_common_dragNDropInnerContainer__Za6pP",dragNDropContainerFileStatusError:"author_feedback_modal_common_dragNDropContainerFileStatusError__w3MIm",dragNDropContainerFileStatusOK:"author_feedback_modal_common_dragNDropContainerFileStatusOK__3vR
15k",uploadedContainer:"author_feedback_modal_common_uploadedContainer__k0zaM",completeButton:"author_feedback_modal_common_completeButton__M5KWK",completeIcon:"author_feedback_modal_common_completeIcon__U7m85",uploadingFileName:"author_feedback_modal_common_uploadingFileName__gGCdP",marginLeft4:"author_feedback_modal_common_marginLeft4__Lzuki",marginLeft3:"author_feedback_modal_common_marginLeft3__5_tja",editDeleteContainer:"author_feedback_modal_common_editDeleteContainer___lo_A",editDeleteIcon:"author_feedback_modal_common_editDeleteIcon__sfvGW",navigationText:"author_feedback_modal_common_navigationText__0ZCMF",takingScreenshot:"author_feedback_modal_common_takingScreenshot__cJZ40",formContainer:"author_feedback_modal_common_formContainer__WcNvl",withFrame:"author_feedback_modal_common_withFrame__dFwLT",formInnerContainer:"author_feedback_modal_common_formInnerContainer__kgUjk",NotTakingSSForm__headerContainer:"author_feedback_modal_common_NotTakingSSForm__headerContainer__jHTZO",NotTakingSSForm__backIcon:"author_feedback_modal_common_NotTakingSSForm__backIcon__ARm26",NotTakingSSForm__heading:"author_feedback_modal_common_NotTakingSSForm__heading__Oqhvz",NotTakingSSForm__closeIcon:"author_feedback_modal_common_NotTakingSSForm__closeIcon__i6ejp",NotTakingSSForm__feedbackErrorText:"author_feedback_modal_common_NotTakingSSForm__feedbackErrorText__QNNUT",NotTakingSSForm__inputsContainer:"author_feedback_modal_common_NotTakingSSForm__inputsContainer__xRKsW",isAskAuthor__SubjectInput__placeholder:"author_feedback_modal_common_isAskAuthor__SubjectInput__placeholder__4vUYU",isAskAuthor__SubjectInput__border:"author_feedback_modal_common_isAskAuthor__SubjectInput__border__CZIfO",feedbackTypesNotRequiringIssueSelection__dropdown__label:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__label__woXvN",feedbackTypesNotRequiringIssueSelection__dropdown__chevron:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__chevron__HZaWu",feedbackTypesNotRequiringIssueSelection__dropdown__button:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__button__XfALB",feedbackTypesNotRequiringIssueSelection__dropdown__button__error:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__button__error___6YuN",feedbackTypesNotRequiringIssueSelection__dropdown__button__normal:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__button__normal__ioQ0L",feedbackTypesNotRequiringIssueSelection__dropdown__placeholder:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__placeholder__jjy9_",feedbackTypesNotRequiringIssueSelection__dropdown__listItem:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__listItem__UtLXZ",feedbackTypesNotRequiringIssueSelection__dropdown__listItem__first:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__listItem__first__3H4Ai",feedbackTypesNotRequiringIssueSelection__dropdown__listItem__middle:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__listItem__middle__ihU7z",feedbackTypesNotRequiringIssueSelection__dropdown__listItem__text:"author_feedback_modal_common_feedbackTypesNotRequiringIssueSelection__dropdown__listItem__text__St3Og",feedbackRequiringIssueSelection__container:"author_feedback_modal_common_feedbackRequiringIssueSelection__container__IDv1Z",feedbackRequiringIssueSelection__label:"author_feedback_modal_common_feedbackRequiringIssueSelection__label__fOyAT",feedbackRequiringIssueSelection__errorText:"author_feedback_modal_common_feedbackRequiringIssueSelection__errorText__1WLrT",feedbackRequiringIssueSelection__radioGrid:"author_feedback_modal_common_feedbackRequiringIssueSelection__radioGrid__FkXJS",feedbackRequiringIssueSelection__radioOption:"author_feedback_modal_common_feedbackRequiringIssueSelection__radioOption___rmKQ",feedbackRequiringIssueSelection__radioLabel:"author_feedback_modal_common_feedbackRequiringIssueSelection__radioLabel__WlNhX",loggedOutInputs__detailsInput:"author_feedback_modal_common_loggedOutInputs__detailsInput__zMY14",pasteInput:"author_feedback_modal_common_pasteInput__N2wvv",loggedOutInputs__placeholder:"author_feedback_modal_common_loggedOutInputs__placeholder__SGt_4",loggedOutInputs__border:"author_feedback_modal_common_loggedOutInputs__border__rNmwX",formFooter__container:"author_feedback_modal_common_formFooter__container__bPrzL",fileUpload__container:"author_feedback_modal_common_fileUpload__container__in5i1",fileUpload__input:"author_feedback_modal_common_fileUpload__input__XoZBt",formFooter__text:"author_feedback_modal_common_formFooter__text__E02b4",formFooter__buttons:"author_feedback_modal_common_formFooter__buttons__y4Zc0",formFooter__cancelButton:"author_feedback_modal_common_formFooter__cancelButton__7Fhdr",formFooter__submitButton:"author_feedback_modal_common_formFooter__submitButton__jUpWy"}},226690:function(e){e.exports={imageContainer:"NextImage_imageContainer__3_3sT",image:"NextImage_image__hQc4V",landingPageImageContainer:"NextImage_landingPageImageContainer__L2zZY",dark:"dark",imageContainerProgressive:"NextImage_imageContainerProgressive__GpKlV",coverImageContainer:"NextImage_coverImageContainer__Yy7bO"}}}]);
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.