PageSourceSearch

https://www.superhr.ai/assets/ApplyJob-BTqUhcYm.js

js superhr.ai collected 2026-10-05 15:52:50 UTC 14,340 bytes, 1 lines download raw bytes

1import{v as te,w as re,r as a,x as oe,j as e,y as se,z as ae,J as $,A as ie,D as ne,K as be,i as fe,k as le,f as pe,B as d,C as ce,h as P,e as ge,a as he,N as je}from"./index-DleV31JD.js";import{b as ye}from"./jobs-qAZQXZot.js";import{L as ve}from"./Logo-D5rdZj19.js";import{J as Se,a as q,b as H,c as G}from"./JobStructuredData-DGEGQznd.js";import{T as J}from"./Typography-t5rNnCv1.js";import{S as ue}from"./Stack-7sdsg7_h.js";import{T as k,I as V,F as O}from"./TextField-DLcWYVI-.js";import{F as K,S as Q}from"./Select-DGzxwN2h.js";import{M as X}from"./MenuItem-C8f_CZRf.js";import{B as U}from"./Button-DO9dHYXi.js";import{U as Ce}from"./UploadFile-grXSmjEN.js";import{D as Ae}from"./Divider-D5HfkRMV.js";import{T as Te}from"./triangle-alert-BNmiiWWN.js";import{P as W}from"./Paper-Cn38ySNm.js";import"./formatSalary-DWnu92tt.js";import"./experienceUtils-Bn5LD9iJ.js";import"./Avatar-DGDsKNWA.js";import"./useSlot-Bbaq3GVA.js";import"./ButtonBase-Cp1wa53r.js";import"./Grid-20fKmfiz.js";import"./briefcase-D_4hAhBW.js";import"./createLucideIcon-bF2adt16.js";import"./indian-rupee-Dmr3fNKv.js";import"./map-pin-HIzYH48z.js";import"./TextEditor-DKA9-9IB.js";import"./with-selector-hypWduxx.js";import"./Tabs-C9kPMlZG.js";import"./Modal-DNIINny5.js";import"./Backdrop-D6heS1hq.js";import"./Link-C-hFGeWK.js";import"./ListContext-Dr45aVFE.js";import"./useControlled-RYBmo7YQ.js";import"./dividerClasses-hmStqNqK.js";function Be(t){return te("MuiAppBar",t)}re("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Ne=t=>{const{color:o,position:p,classes:n}=t,h={root:["root",`color${$(o)}`,`position${$(p)}`]};return ie(h,Be,n)},Z=(t,o)=>t?`${t==null?void 0:t.replace(")","")}, ${o})`:o,we=se(W,{name:"MuiAppBar",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:p}=t;return[o.root,o[`position${$(p.position)}`],o[`color${$(p.color)}`]]}})(ne(({theme:t})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(be(["contrastText"])).map(([o])=>({props:{color:o},style:{"--AppBar-background":(t.vars??t).palette[o].main,"--AppBar-color":(t.vars??t).palette[o].contrastText}})),{props:o=>o.enableColorOnDark===!0&&!["inherit","transparent"].includes(o.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:o=>o.enableColorOnDark===!1&&!["inherit","transparent"].includes(o.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?Z(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?Z(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}))),Fe=a.forwardRef(function(o,p){const n=oe({props:o,name:"MuiAppBar"}),{className:h,color:c="primary",enableColorOnDark:m=!1,position:g="fixed",...S}=n,x={...n,color:c,position:g,enableColorOnDark:m},C=Ne(x);return e.jsx(we,{square:!0,component:"header",ownerState:x,elevation:4,className:ae(C.root,h,g==="fixed"&&"mui-fixed"),ref:p,...S})});function Ie(t){return te("MuiToolbar",t)}re("MuiToolbar",["root","gutters","regular","dense"]);const ke=t=>{const{classes:o,disableGutters:p,variant:n}=t;return ie({root:["root",!p&&"gutters",n]},Ie,o)},Ee=se("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:p}=t;return[o.root,!p.disableGutters&&o.gutters,o[p.variant]]}})(ne(({theme:t})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:o})=>!o.disableGutters,style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}))),De=a.forwardRef(function(o,p){const n=oe({props:o,name:"MuiToolbar"}),{className:h,component:c="div",disableGutters:m=!1,variant:g="regular",...S}=n,x={...n,component:c,disableGutters:m,variant:g},C=ke(x);return e.jsx(Ee,{as:c,className:ae(C.root,h),ref:p,ownerState:x,...S})}),Re=(t,o)=>fe(()=>le.post(`/public/jobs/${t}/apply`,o,{headers:{"Content-Type":"multipart/form-data"}}),{showErrorToast:!0,showSuccessToast:!0}),Oe=["Direct","Indeed","Linkedin","Naukri","Other"],ee=({initialEmail:t="",initialFullName:o="",jobId:p,screeningQuestions:n,onSuccess:h})=>{const{jobId:c}=pe(),m=p??c,[g,S]=a.useState(o),[x,C]=a.useState(t),[j,E]=a.useState(""),[B,w]=a.useState(""),[y,F]=a.use
1State(""),[b,z]=a.useState(null),[N,I]=a.useState({}),[i,f]=a.useState({}),[v,l]=a.useState(!1),[D,Y]=a.useState(!1),M=a.useRef(null),de=()=>{const r={};g.trim()||(r.fullName="Full name is required"),x.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x)||(r.email="Enter a valid email"):r.email="Email is required",j.trim()?/^\+[1-9]\d{7,14}$/.test(j.trim())||(r.phoneNumber="Enter a valid phone number in E.164 format (e.g. +919876543210)"):r.phoneNumber="Phone number is required";const s=parseFloat(B);return B===""||isNaN(s)?r.totalYearsOfExperience="Years of experience is required":s<0?r.totalYearsOfExperience="Cannot be negative":s>99&&(r.totalYearsOfExperience="Cannot exceed 99 years"),y||(r.source="Source is required"),b?b.type!=="application/pdf"?r.resume="Only PDF files are accepted":b.size>5*1024*1024&&(r.resume="File must be under 5 MB"):r.resume="Resume is required",n==null||n.forEach(u=>{var T;(T=N[u.id])!=null&&T.trim()||(r[`q_${u.id}`]="This answer is required")}),f(r),Object.keys(r).length===0},me=async r=>{var u,T,L;const s=((u=r.target.files)==null?void 0:u[0])??null;if(z(s),!!s&&(f(R=>({...R,resume:void 0})),!(s.type!=="application/pdf"||s.size>5*1024*1024))){Y(!0);try{const R=new FormData;R.append("resume",s);const _=await le.post("/public/resume/extract-details",R),A=((T=_.data)==null?void 0:T.data)??((L=_.data)==null?void 0:L.result);A&&(A.fullName&&S(A.fullName),A.email&&C(A.email),A.phoneNumber&&E(A.phoneNumber),A.totalYearsOfExperience!=null&&w(String(A.totalYearsOfExperience)),P.success("Details extracted from resume"))}catch{}finally{Y(!1)}}},xe=async r=>{if(r.preventDefault(),!de()||!m)return;const s=new FormData;if(s.append("resume",b),s.append("email",x.trim()),s.append("fullName",g.trim()),s.append("phoneNumber",j.trim()),s.append("totalYearsOfExperience",String(parseFloat(B))),s.append("source",y),n&&n.length>0){const u=n.map(T=>({questionId:T.id,answer:N[T.id]??""}));s.append("screeningAnswers",JSON.stringify(u))}l(!0);try{await Re(m,s),h()}catch{}finally{l(!1)}};return e.jsxs(d,{component:"form",onSubmit:xe,noValidate:!0,children:[e.jsx(J,{variant:"h6",fontWeight:600,mb:3,children:"Apply for this Job"}),e.jsxs(ue,{spacing:3,children:[e.jsx(k,{label:"Full Name",value:g,onChange:r=>{S(r.target.value),f(s=>({...s,fullName:void 0}))},error:!!i.fullName,helperText:i.fullName,fullWidth:!0,required:!0}),e.jsx(k,{label:"Email",type:"email",value:x,onChange:r=>{C(r.target.value),f(s=>({...s,email:void 0}))},error:!!i.email,helperText:i.email,fullWidth:!0,required:!0}),e.jsx(k,{label:"Phone Number",placeholder:"+919876543210",value:j,onChange:r=>{E(r.target.value),f(s=>({...s,phoneNumber:void 0}))},error:!!i.phoneNumber,helperText:i.phoneNumber||"Include country code, e.g. +919876543210",fullWidth:!0,required:!0}),e.jsx(k,{label:"Total Years of Experience",type:"number",value:B,onChange:r=>{w(r.target.value),f(s=>({...s,totalYearsOfExperience:void 0}))},error:!!i.totalYearsOfExperience,helperText:i.totalYearsOfExperience,inputProps:{min:0,max:99,step:.5},fullWidth:!0,required:!0}),e.jsxs(K,{fullWidth:!0,required:!0,error:!!i.source,children:[e.jsx(V,{children:"How did you hear about this job?"}),e.jsx(Q,{value:y,label:"How did you hear about this job?",onChange:r=>{F(r.target.value),f(s=>({...s,source:void 0}))},children:Oe.map(r=>e.jsx(X,{value:r,children:r},r))}),i.source&&e.jsx(O,{children:i.source})]}),e.jsxs(d,{children:[e.jsx("input",{ref:M,type:"file",accept:"application/pdf",style:{display:"none"},onChange:me}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e.jsx(U,{variant:"outlined",startIcon:e.jsx(Ce,{}),onClick:()=>{var r;return(r=M.current)==null?void 0:r.click()},color:i.resume?"error":"primary",disabled:D,children:b?b.name:"Upload Resume (PDF)"}),D&&e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(ce,{size:16}),e.jsx(J,{variant:"caption",color:"text.secondary",children:"Extracting details…"})]})]}),i.resume&&e.jsx(O,{error:!0,sx:{mt:.5},children:i.resume}),b&&!i.resume&&e.jsxs(O,{sx:{mt:.5},children:[(b.size/1024).toFixed(0)," KB"]})]}),n&&n.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Ae,{}),e.jsx(J,{variant:"subtitle1",fontWeight:600,children:"Screening Questions"}),n.map(r=>e.jsx(d,{children:r.options&&r.options.length>0?e.jsxs(K,{fullWidth:!0,required:!0,error:!!i[`q_${r.id}`],children:[e.jsx(V,{children:r.question}),e.jsx(Q,{value:N[r.id]??"",label:r.question,onChange:s=>{I(u=>({...u,[r.id]:s.target.value})),f(u=>({...u,[`q_${r.id}`]:void 0}))},children:r.options.map(s=>e.jsx(X,{value:s,children:s},s))}),i[`q_${r.id}`]&&e.jsx(O,{children:i[`q_${r.id}`]})]}):e.jsx(k,{label:r.question,value:N[r.id]??"",onChange:s=>{I(u=>({...u,[r.id]:s.target.value})),f(u=>({...u,[`q_${r.id}`]:void 0}))},error:!!i[`q_${r.id}`],helperText:i[`q_${r.id}`],fullWidth:!0,required:!0,multiline:!0,minRows:2})},r.id))]}),e.jsx(d,{display:"flex",justifyContent:"flex-end",children:e.jsx(U,{type:"submit",variant:"contained",size:"large",disabled:v,sx:{minWidth:140},children:v?"Submitting...":"Submit Application"})})]})]})},bt=()=>{var I,i,f;const{jobId:t}=pe(),o=ge(v=>v.user),[p,n]=a.useState(!0),h=he(),[c,m]=a.useState("jobApplication"),[g,S]=a.useState("description"),[x,C]=a.useState("profile");if(!t)return e.jsx(je,{to:"/candidate/jobs"});
1const[j,E]=a.useState(null),[B,w]=a.useState(!1),[y,F]=a.useState(!1),[b,z]=a.useState(null);a.useEffect(()=>{console.log("screeningQuestions inside useEffect is ",b)},[b]);async function N(v){try{const l=await ye(v),D=(l==null?void 0:l.roleName)||(l==null?void 0:l.title);if(!l||!l.jobId||!D){w(!0),n(!1);return}E(l),console.log("response.screeningQuestions",l.screeningQuestions),l.screeningQuestions&&(console.log("response.screeningQuestions",l.screeningQuestions),z(l.screeningQuestions)),l.isApplied&&F(!0)}catch{w(!0)}finally{n(!1)}}return a.useEffect(()=>{N(t)},[t]),a.useEffect(()=>{y&&c==="jobApplication"&&m("jobDetails")},[y,c]),p?e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh"},children:e.jsx(ce,{})}):B?e.jsxs(d,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",flex:1,minHeight:"80vh"},children:[e.jsxs(ue,{direction:"row",alignItems:"center",spacing:1.5,sx:{pb:2},children:[e.jsx(Te,{className:"w-8 h-8"}),e.jsx(J,{variant:"h5",sx:{fontWeight:600,color:"text.secondary"},children:"Job does not exist!"})]}),e.jsx(U,{variant:"contained",onClick:()=>h("/candidate/jobs"),sx:{mt:2},children:"Go to Jobs"})]}):e.jsxs(d,{sx:{minHeight:"100vh",bgcolor:"#FCFCF6"},children:[e.jsx(Se,{job:j}),o.data?e.jsx(e.Fragment,{children:e.jsx(d,{sx:{display:"flex"},children:e.jsx(d,{sx:{pt:1.5,width:"100%"},children:e.jsxs(d,{sx:{mx:{xs:1,sm:2},py:1},children:[e.jsx(q,{jobDetails:j,mainTab:c,isApplied:y,onTabChange:m,onShareJob:()=>{const v=`${window.location.origin}/job/apply/${t}`;navigator.clipboard.writeText(v),P.success("Job URL copied to clipboard")}}),e.jsx(H,{mainTab:c,onTabChange:m,onApplicationStepChange:C,applicationStep:x,isApplied:y}),e.jsxs(W,{elevation:1,sx:{mt:2,pb:6,bgcolor:"white",borderRadius:3,border:1,borderColor:"#FEF7CD",px:{xs:2,sm:3},py:{xs:2,sm:3}},children:[c==="jobDetails"&&e.jsx(G,{jobDetails:j,subTab:g,onSubTabChange:S}),c==="jobApplication"&&!y&&e.jsx(ee,{initialEmail:((I=o.data)==null?void 0:I.email)??"",initialFullName:[(i=o.data)==null?void 0:i.firstName,(f=o.data)==null?void 0:f.lastName].filter(Boolean).join(" "),screeningQuestions:b??void 0,onSuccess:()=>{F(!0),m("jobDetails")}})]})]})})})}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{position:"fixed",sx:{top:0,height:60,zIndex:40,bgcolor:"white",borderBottom:1,borderColor:"grey.300",boxShadow:1},children:e.jsx(De,{sx:{px:{xs:2,sm:4},py:1.5},children:e.jsx(d,{component:"img",src:ve,alt:"logo",sx:{height:33}})})}),e.jsx(d,{sx:{pt:3,mt:"60px",width:"100%",maxWidth:{sm:"80%"},mx:"auto",bgcolor:"#FCFCF6"},children:e.jsxs(d,{sx:{mx:{xs:1,sm:2},py:1},children:[e.jsx(q,{jobDetails:j,mainTab:c,isApplied:y,onTabChange:m,onShareJob:()=>{const v=window.location.href;navigator.clipboard.writeText(v),P.success("Job URL copied to clipboard")}}),e.jsx(H,{mainTab:c,onTabChange:m,onApplicationStepChange:C,applicationStep:x}),e.jsxs(W,{elevation:1,sx:{mt:2,pb:6,bgcolor:"white",borderRadius:3,border:1,borderColor:"#FEF7CD",px:{xs:2,sm:3},py:{xs:2,sm:3}},children:[c==="jobDetails"&&e.jsx(G,{jobDetails:j,subTab:g,onSubTabChange:S}),c==="jobApplication"&&e.jsx(ee,{screeningQuestions:b??void 0,onSuccess:()=>{F(!0),m("jobDetails")}})]})]})})]})]})};export{bt as default};

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.