PageSourceSearch

https://olibr.com/_next/static/chunks/pages/client/candidates-da8b03517ba355a9.js

js olibr.com collected 2026-09-24 13:19:23 UTC 118,303 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9934],{5137:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/client/candidates",function(){return a(35614)}])},65617:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])},7216:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},51645:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]])},29936:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]])},95675:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]])},87296:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]])},25855:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]])},59140:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},4053:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},74909:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},38144:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},30948:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("file-spreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]])},40773:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]])},97852:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},11557:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]])},9910:(e,t,a)=>{"use strict";a.d(t,{A:()=>s});let s=(0,a(86899).A)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},8220:(e,t,a)=>{"use strict";a.d(t,{d:()=>n});var s=a(74848),l=a(96540),r=a(79014),i=a(18019);let n=l.forwardRef((e,t)=>
1{let{className:a,...l}=e;return(0,s.jsx)(r.bL,{className:(0,i.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...l,ref:t,children:(0,s.jsx)(r.zi,{className:(0,i.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});n.displayName=r.bL.displayName},35614:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>ev});var s=a(74848),l=a(84117),r=a(96540),i=a(51645),n=a(29936),c=a(65617),d=a(66253),o=a(90708),u=a(30948),x=a(40199),m=a(69893),p=a(11557),h=a(76897),g=a(96010),y=a(74909),f=a(9910),b=a(82705),j=a(63761),v=a(83004),N=a(90325),w=a(11988),k=a(86039),C=a(64721),S=a(71468),A=a(61386),E=a(11963),P=a(88153),D=a(81121),O=a(81791),L=a(8742),M=a(66908);function R(e){var t,a;let{onSelectCandidate:l,onNewCandidate:R,onBulkUpload:U,onCsvUpload:T,onUploadHistory:z,searchTags:F,onSearchTagsChange:I,sourceFilter:B,onSourceFilterChange:_,uploadedByFilter:q,onUploadedByFilterChange:K,currentPage:W,onCurrentPageChange:V,itemsPerPage:$,onItemsPerPageChange:Z}=e,H=(0,S.wA)(),{candidatesList:J,isCandidatesListLoading:G}=(0,S.d4)(e=>e.clientReducer),[Y,X]=(0,r.useState)(""),[Q,ee]=(0,r.useState)([]),et=null!=F?F:Q,ea=null!=I?I:ee,[es,el]=(0,r.useState)(""),er=null!=B?B:es,ei=null!=_?_:el,[en,ec]=(0,r.useState)(""),ed=null!=q?q:en,eo=null!=K?K:ec,[eu,ex]=(0,r.useState)({sources:[],uploaders:[]}),[em,ep]=(0,r.useState)(null),[eh,eg]=(0,r.useState)(null),[ey,ef]=(0,r.useState)(!1),[eb,ej]=(0,r.useState)([]),[ev,eN]=(0,r.useState)(""),[ew,ek]=(0,r.useState)(new Set),eC=(0,r.useRef)(null),eS=async()=>{if(0!==ew.size)try{let e=Array.from(ew),t=await P.default.post("/client/candidates/export",{candidateIds:e},{responseType:"blob"}),a=new Blob([t.data],{type:"text/csv"}),s=window.URL.createObjectURL(a),l=document.createElement("a");l.href=s,l.download="candidates-export-".concat(Date.now(),".csv"),document.body.appendChild(l),l.click(),l.remove(),window.URL.revokeObjectURL(s),C.toast.success("Exported ".concat(e.length," candidate(s) to CSV."))}catch(t){var e;(null==t?void 0:null===(e=t.response)||void 0===e?void 0:e.status)===402?C.toast.error("Insufficient credits to export data."):C.toast.error("Failed to export candidates.")}},eA=(0,O.E)({featureKey:"create"===eC.current?"ADDING_CANDIDATE_PROFILE":"bulk-upload"===eC.current?"BULK_UPLOAD":"EXPORT_DATA",quantity:"export"===eC.current&&ew.size||1,onProceed:()=>{"create"===eC.current?R():"bulk-upload"===eC.current?U():"export"===eC.current&&eS()}}),[eE,eP]=(0,r.useState)(1),eD=null!=W?W:eE,eO=null!=V?V:eP,[eL,eM]=(0,r.useState)(10),eR=null!=$?$:eL,eU=null!=Z?Z:eM,[eT,ez]=(0,r.useState)(null),[eF,eI]=(0,r.useState)(null),eB=(null==J?void 0:J.candidates)?J.candidates.map(e=>({id:e._id,firstName:e.firstName,lastName:e.lastName,email:e.email,contactNumber:e.phone,mobile:e.phone,city:e.location,position:e.designation,currentOrganization:e.company,totalExperience:e.experience,skills:e.skills,source:e.source,currentEmploymentStatus:e.status,resumeUrl:e.resumeUrl,createdAt:e.registeredDate,updatedAt:e.lastUpdated,addedBy:e.createdBy||"System",owner:e.owner||"",ownerName:e.ownerName||e.createdBy||"",willingToRelocate:!1,noticePeriod:30})):[],[e_,eq]=(0,r.useState)(Y);(0,r.useEffect)(()=>{let e=[...et.map(e=>e.title),Y].filter(Boolean).join(","),t=setTimeout(()=>{eq(e),eO(1)},500);return()=>clearTimeout(t)},[Y,et]),(0,r.useEffect)(()=>{P.default.get("/client/candidates/filter-options").then(e=>{var t;(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.data)&&ex(e.data.data)}).catch(()=>{})},[]),(0,r.useEffect)(()=>{let e={page:eD,limit:eR};e_&&(e.search=e_),er&&(e.source=er),ed&&(e.uploadedBy=ed),H((0,A.LO)({params:e}))},[H,eD,eR,e_,er,ed]);let eK=[...eB].sort((e,t)=>
1{let a,s;if(!eT||!eF||("employmentStatus"===eT?(a=e.currentEmploymentStatus,s=t.currentEmploymentStatus):"source"===eT?(a=e.source,s=t.source):"willingToRelocate"===eT?(a=e.willingToRelocate,s=t.willingToRelocate):"addedBy"===eT?(a=e.addedBy,s=t.addedBy):"noticePeriodDays"===eT&&(a=e.noticePeriod,s=t.noticePeriod),void 0===a&&void 0===s))return 0;if(void 0===a)return"asc"===eF?1:-1;if(void 0===s)return"asc"===eF?-1:1;if("willingToRelocate"===eT&&"boolean"==typeof a&&"boolean"==typeof s){let e=a===s?0:a?-1:1;return"asc"===eF?e:-e}if("noticePeriodDays"===eT&&"number"==typeof a&&"number"==typeof s){let e=a-s;return"asc"===eF?e:-e}if("string"==typeof a&&"string"==typeof s){let e=a.localeCompare(s);return"asc"===eF?e:-e}return 0}),eW=(null==J?void 0:J.pagination)||{currentPage:1,totalPages:1,totalCount:0,limit:10,hasNextPage:!1,hasPrevPage:!1},eV=eW.totalPages,e$=eW.totalCount,eZ=(eW.currentPage-1)*eW.limit,eH=eZ+eK.length,eJ=e=>{eT===e?"asc"===eF?eI("desc"):"desc"===eF&&(ez(null),eI(null)):(ez(e),eI("asc"))},eG=e=>eT!==e?(0,s.jsx)(i.A,{className:"h-3 w-3 ml-1 text-muted-foreground"}):"asc"===eF?(0,s.jsx)(n.A,{className:"h-3 w-3 ml-1 text-primary"}):(0,s.jsx)(c.A,{className:"h-3 w-3 ml-1 text-primary"}),eY=e=>{eU(Number(e)),eO(1)},eX=e=>{let t=new Set(ew);t.has(e)?t.delete(e):t.add(e),ek(t)},eQ=(e,t)=>"".concat(e.charAt(0)).concat(t.charAt(0)).toUpperCase(),e0=e=>{switch(e){case"Job Applicant":return"bg-blue-100 text-blue-800";case"Olibr Talent Search":return"bg-purple-100 text-purple-800";case"Bulk Upload":return"bg-green-100 text-green-800";case"Manual Upload":return"bg-orange-100 text-orange-800";default:return"bg-gray-100 text-gray-800"}},e1=e=>{switch(e){case"Employed":return"bg-green-100 text-green-800";case"Unemployed":return"bg-red-100 text-red-800";case"Notice Period":return"bg-yellow-100 text-yellow-800";case"Actively Looking":return"bg-orange-100 text-orange-800";case"Open to Opportunities":return"bg-blue-100 text-blue-800";case"Not Looking":default:return"bg-gray-100 text-gray-800";case"Freelancer":return"bg-purple-100 text-purple-800"}},e2=e=>void 0===e?"bg-gray-100 text-gray-800":!1===e?"bg-red-100 text-red-800":"bg-green-100 text-green-800",e5=async()=>{if(0===ew.size||!confirm("Delete ".concat(ew.size," candidate(s)? This cannot be undone.")))return;let e=Array.from(ew),t=0,a=0;for(let s of e)try{await P.default.delete("/client/candidates/".concat(s,"?permanent=true")),t++}catch(e){a++}ek(new Set),H((0,A.LO)({params:{page:1,limit:20}})),0===a?C.toast.success("".concat(t," candidate(s) deleted successfully")):C.toast.error("".concat(t," deleted, ").concat(a," failed"))},[e4,e3]=(0,r.useState)(!1),[e6,e7]=(0,r.useState)({}),[e8,e9]=(0,r.useState)(!1),[te,tt]=(0,r.useState)(!1),[ta,ts]=(0,r.useState)(""),[tl,tr]=(0,r.useState)(!1),{jobList:ti}=(0,S.d4)(e=>e.clientReducer),tn=async()=>{if(0===ew.size)return;let e={};if(e6.employmentStatus&&(e.currentEmploymentStatus=e6.employmentStatus),void 0!==e6.noticePeriodDays&&""!==e6.noticePeriodDays&&(e.noticePeriodDays=Number(e6.noticePeriodDays)),0===Object.keys(e).length){C.toast.error("Please select at least one field to update");return}e9(!0);let t=Array.from(ew),a=0,s=0;await Promise.all(t.map(async t=>{try{await P.default.patch("/client/candidates/".concat(t),e),a++}catch(e){s++}})),e9(!1),e3(!1),e7({}),0===s?C.toast.success("Updated ".concat(a," candidate(s) successfully")):C.toast.error("".concat(a," updated, ").concat(s," failed")),ek(new Set),H((0,A.LO)({}))},tc=async()=>{if(!ta||0===ew.size)return;tr(!0);let e=eK.filter(e=>ew.has(e.id)),t=0,a=0;for(let s of(e.length,e))try{await new Promise((e,l)=>{H((0,A.vH)({data:{candidateId:s.id,jobId:ta,assignmentSource:"candidate_page",candidateFirstName:s.firstName||"",candidateLastName:s.lastName||"",candidateEmail:s.email||"",candidateName:"".concat(s.firstName||""," ").concat(s.lastName||"").trim(),candidateSkills:s.skills||[],candidateTotalExperience:s.totalExperience||0,candidateCity:s.city||"",candidatePositionTitle:s.position||"",candidateCurrentOrganization:s.currentOrganization||""},cb:()=>{t++,e()},errorCB:()=>{a++,e()}}))})}catch(e){a++}tr(!1),tt(!1),ts(""),0===a?C.toast.success("Assigned ".concat(t," candidate(s) to job successfully")):t>0?C.toast.warning("".concat(t," assigned, ").concat(a," failed (may already be assigned)")):C.toast.error("Failed to assign candidates. They may already be assigned to this job."),ek(new Set)},td=e=>{H((0,E.L)({sendEmailModal:{isOpen:!0,candidateData:{email:e.email,firstName:e.firstName,lastName:e.lastName}}}))},to=async e=>{var t,a,s;let l=e.resumeUrl||(null===(t=e.resume)||void 0===t?void 0:t.fileUrl);if(!l){C.toast.error("No resume file available for this candidate");return}try{let e=await P.default.get("/client/resume-upload/presigned-url",{params:{url:l}}),t=null==e?void 0:null===(s=e.data)||void 0===s?void 0:null===(a=s.data)||void 0===a?void 0:a.resumeUrl;if(t){window.open(t,"_blank");return}}catch(e){console.error("Presigned URL failed:",e)}window.open(l,"_blank")},tu=async()=>{try{var e;let t=await P.default.get("/client/team");ej((null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data)||[])}catch(e){ej([])}},tx=async e=>{eg(e),ef(!1),eN(e.owner||""),await tu()},tm=async()=>{0!==ew.size&&(eg({id:"bulk"}),ef(!0),eN(""),await tu())},tp=async()=>
1{if(!ev)return;let e=eb.find(e=>e.userId===ev||e._id===ev),t=e?"".concat(e.firstName||""," ").concat(e.lastName||"").trim():"";try{if(ey){let e=Array.from(ew);await Promise.all(e.map(e=>P.default.patch("/client/candidates/".concat(e,"/owner"),{ownerId:ev,ownerName:t}))),C.toast.success("Owner updated for ".concat(e.length," candidate(s)")),ek(new Set)}else eh&&(await P.default.patch("/client/candidates/".concat(eh.id,"/owner"),{ownerId:ev,ownerName:t}),C.toast.success("Owner updated successfully"));eg(null),H((0,A.LO)({params:{page:eD,limit:eR}}))}catch(e){C.toast.error("Failed to update owner")}},th=e=>{ep(e),H((0,E.L)({assignJobModal:{isOpen:!0,candidate:e,assignmentSource:"candidate_page"}}))};return(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,s.jsx)(D.A,{isOpen:eA.showCreditsChoiceModal,onClose:()=>eA.setShowCreditsChoiceModal(!1),title:"How would you like to proceed?",content:(0,s.jsx)(L.R,{...eA.creditsModalProps}),hasFooter:!1}),(0,s.jsx)(D.A,{isOpen:eA.showManualConfirm,onClose:eA.handleManualConfirmCancel,title:"Confirm Credit Deduction",content:(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{className:"rounded-lg bg-gray-50 border border-gray-200 p-4",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,s.jsx)("span",{className:"font-semibold text-gray-900",children:eA.manualConfirmProps.creditCost})," credit",1!==eA.manualConfirmProps.creditCost?"s":""," will be deducted for this action."]}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-2",children:["Available balance: ",(0,s.jsx)("span",{className:"font-medium text-gray-700",children:eA.manualConfirmProps.currentBalance})," credits"]}),(0,s.jsxs)("p",{className:"text-xs text-gray-500 mt-1",children:["Balance after deduction: ",(0,s.jsx)("span",{className:"font-medium text-gray-700",children:eA.manualConfirmProps.currentBalance-eA.manualConfirmProps.creditCost})," credits"]})]})}),primaryButtonLabel:"Proceed",primaryButtonOnClick:eA.handleManualConfirmProceed,secondaryButtonLabel:"Cancel",secondaryButtonOnClick:eA.handleManualConfirmCancel}),(0,s.jsx)(D.A,{isOpen:eA.showFallbackModal,onClose:eA.handleFallbackCancel,title:(null===(t=eA.fallbackInfo)||void 0===t?void 0:t.contributionMode)==="PAY_ONLY"?"Insufficient Balance":(null===(a=eA.fallbackInfo)||void 0===a?void 0:a.failedMethod)==="CREDITS"?"Insufficient Credits":"Insufficient Profiles",content:eA.fallbackModalProps?(0,s.jsx)(M.X,{...eA.fallbackModalProps}):null,hasFooter:!1}),(0,s.jsx)("div",{className:"p-4 sm:p-6",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,s.jsx)("div",{className:"mb-6",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:"Candidates"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage and track all your candidates"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)(w.$,{variant:"outline",size:"sm",onClick:z,className:"hidden md:flex",children:[(0,s.jsx)(d.A,{className:"h-4 w-4 mr-1"}),"Upload History"]}),(0,s.jsxs)(w.$,{variant:"outline",size:"sm",onClick:()=>{U()},className:"hidden md:flex",children:[(0,s.jsx)(o.A,{className:"h-4 w-4 mr-1"}),"Bulk Upload"]}),(0,s.jsxs)(w.$,{variant:"outline",size:"sm",onClick:T,className:"hidden md:flex",children:[(0,s.jsx)(u.A,{className:"h-4 w-4 mr-1"}),"CSV Upload"]}),(0,s.jsxs)(w.$,{size:"sm",onClick:()=>{eC.current="create",eA.runCreditCheck()},children:[(0,s.jsx)(x.A,{className:"h-4 w-4 mr-1"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"New Candidate"}),(0,s.jsx)("span",{className:"sm:hidden",children:"New"})]})]})]})}),(0,s.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 shadow-sm p-3 md:p-6",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-1.5 border border-gray-200 rounded-md bg-[#f0f5f7] min-h-[42px] focus-within:ring-2 focus-within:ring-blue-500 focus-within:bg-white focus-within:border-blue-500 transition-colors",children:[(0,s.jsx)(m.A,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),et.map((e,t)=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs ".concat(e.required?"bg-blue-100 text-blue-800 border border-blue-300":"bg-gray-100 text-gray-700 border border-gray-300"),children:[(0,s.jsx)("button",{type:"button",onClick:()=>{let e=[...et];e[t]={...e[t],required:!e[t].required},ea(e)},className:"hover:opacity-70",title:e.required?"Required (click to make optional)":"Optional (click to make required)",children:(0,s.jsx)(p.A,{className:"w-3 h-3 ".concat(e.required?"fill-blue-600 text-blue-600":"text-gray-400")})}),(0,s.jsx)("span",{children:e.title}),(0,s.jsx)("button",{type:"button",onClick:()=>ea(et.filter((e,a)=>a!==t)),className:"hover:opacity-70",children:(0,s.jsx)(h.A,{className:"w-3 h-3"})})]},t)),(0,s.jsx)("input",{type:"text",className:"flex-1 min-w-[150px] text-sm placeholder:text-gray-400 focus:outline-none bg-transparent",placeholder:0===et.length?"Search by name, email, position, or skills...":"Add more...",value:Y,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key&&Y.trim()?(e.preventDefault(),et.find(e=>e.title.toLowerCase()===Y.trim().toLowerCase())||ea([...et,{title:Y.trim(),required:!1}]),X("")):"Backspace"===e.key&&!Y&&et.length>0&&ea(et.slice(0,-1))}})]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 mt-1",children:["Press Enter to add. Click ",(0,s.jsx)(p.A,{className:"w-3 h-3 inline"})," to mark as required."]})]}),(0,s.jsxs)(w.$,{onClick:()=>{Y.trim()&&(et.find(e=>e.title.toLowerCase()===Y.trim().toLowerCase())||ea([...et,{title:Y.trim(),required:!1}]),X(""))},className:"h-[42px] px-5 flex-shrink-0",children:[(0,s.jsx)(m.A,{className:"w-4 h-4 mr-1.5"}),"Search"]})]}),ew.size>0&&(0,s.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg px-4 py-3 md:px-6 sticky top-0 z-10",children:(0,s.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[(0,s.jsxs)("p",{className:"text-sm text-blue-800 font-medium",children:[ew.size," candidate(s) selected"]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)(w.$,{variant:"outline",size:"sm",className:"h-8 text-xs bg-white",onClick:()=>
1{if(0===ew.size)return;let e=eK.filter(e=>ew.has(e.id)).filter(e=>e.email);if(0===e.length){C.toast.error("No email addresses found for selected candidates");return}H((0,E.L)({sendEmailModal:{isOpen:!0,candidateData:null,bulkRecipients:e.map(e=>({email:e.email,firstName:e.firstName,lastName:e.lastName}))}}))},children:[(0,s.jsx)(g.A,{className:"h-3.5 w-3.5 mr-1.5"}),"Send Email"]}),(0,s.jsxs)(w.$,{variant:"outline",size:"sm",className:"h-8 text-xs bg-white",onClick:()=>{0!==ew.size&&(eC.current="export",eA.runCreditCheck())},children:[(0,s.jsx)(y.A,{className:"h-3.5 w-3.5 mr-1.5"}),"Export"]}),(0,s.jsxs)(w.$,{variant:"outline",size:"sm",className:"h-8 text-xs bg-white",onClick:tm,children:[(0,s.jsx)(f.A,{className:"h-3.5 w-3.5 mr-1.5"}),"Change Owner"]}),(0,s.jsxs)(w.$,{variant:"outline",size:"sm",className:"h-8 text-xs bg-white",onClick:()=>{0!==ew.size&&(ts(""),H((0,A.O4)({})),tt(!0))},children:[(0,s.jsx)(b.A,{className:"h-3.5 w-3.5 mr-1.5"}),"Assign Job"]}),(0,s.jsxs)(w.$,{variant:"outline",size:"sm",className:"h-8 text-xs bg-white",onClick:()=>e3(!0),children:[(0,s.jsx)(j.A,{className:"h-3.5 w-3.5 mr-1.5"}),"Bulk Edit"]}),(0,s.jsxs)(w.$,{variant:"outline",size:"sm",className:"h-8 text-xs bg-white text-red-600 hover:text-red-700 hover:bg-red-50",onClick:e5,children:[(0,s.jsx)(v.A,{className:"h-3.5 w-3.5 mr-1.5"}),"Delete"]}),(0,s.jsx)(w.$,{variant:"ghost",size:"sm",onClick:()=>ek(new Set),className:"h-8 text-xs",children:"Clear"})]})]})}),e$>0&&(0,s.jsxs)("div",{className:"px-6 py-4 border-b border-gray-200 flex items-center justify-between flex-wrap gap-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[eu.sources.length>0&&(0,s.jsxs)("select",{value:er,onChange:e=>{ei(e.target.value),eO(1)},className:"border border-gray-300 rounded-md px-2 py-1 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[(0,s.jsx)("option",{value:"",children:"All Sources"}),eu.sources.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),eu.uploaders.length>0&&(0,s.jsxs)("select",{value:ed,onChange:e=>{eo(e.target.value),eO(1)},className:"border border-gray-300 rounded-md px-2 py-1 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[(0,s.jsx)("option",{value:"",children:"All Uploaders"}),eu.uploaders.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]}),(er||ed)&&(0,s.jsxs)("button",{onClick:()=>{ei(""),eo(""),eO(1)},className:"text-sm text-gray-500 hover:text-gray-700 flex items-center gap-1",children:[(0,s.jsx)(h.A,{className:"w-3.5 h-3.5"})," Clear"]}),(0,s.jsxs)("div",{className:"text-sm text-gray-700",children:["Showing ",eZ+1," to"," ",Math.min(eH,e$)," of"," ",e$," candidates"]})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("label",{htmlFor:"itemsPerPage",className:"text-sm text-gray-700",children:"Show:"}),(0,s.jsxs)("select",{id:"itemsPerPage",value:eR,onChange:e=>eY(e.target.value),className:"border border-gray-300 rounded-md px-2 py-1 text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[(0,s.jsx)("option",{value:10,children:"10"}),(0,s.jsx)("option",{value:25,children:"25"}),(0,s.jsx)("option",{value:50,children:"50"}),(0,s.jsx)("option",{value:100,children:"100"})]})]})]}),(0,s.jsx)("div",{className:"overflow-x-auto mt-6",children:(0,s.jsxs)("table",{className:"min-w-full divide-y divide-gray-200",children:[(0,s.jsx)("thead",{className:"bg-gray-50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-6 py-3 text-left",children:(0,s.jsx)("input",{type:"checkbox",checked:ew.size===eK.length&&eK.length>0,onChange:()=>{ew.size===eK.length?ek(new Set):ek(new Set(eK.map(e=>e.id)))},className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"})}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Candidate"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Email"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Mobile"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Location"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Employment Status"}),(0,s.jsx)("button",{onClick:()=>eJ("employmentStatus"),className:"ml-1 flex items-center space-x-1 hover:text-gray-700",children:eG("employmentStatus")})]})}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Willing to Relocate"}),(0,s.jsx)("button",{onClick:()=>eJ("willingToRelocate"),className:"ml-1 flex items-center space-x-1 hover:text-gray-700",children:eG("willingToRelocate")})]})}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Notice Period Days"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Skills"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Source"}),(0,s.jsx)("button",{onClick:()=>eJ("source"),className:"ml-1 flex items-center space-x-1 hover:text-gray-700",children:eG("source")})]})}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:"Uploaded By"}),(0,s.jsx)("button",{onClick:()=>eJ("addedBy"),className:"ml-1 flex items-center space-x-1 hover:text-gray-700",children:eG("addedBy")})]})}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Owner"}),(0,s.jsx)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Uploaded Date"}),(0,s.jsx)("th",{className:"px-3 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider sticky right-0 bg-gray-50 shadow-[-4px_0_6px_-2px_rgba(0,0,0,0.1)] z-[1]",children:"Actions"})]})}),(0,s.jsx)("tbody",{className:"bg-white divide-y divide-gray-200",children:eK.map(e=>(0,s.jsxs)("tr",{className:"hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>l(e),children:[(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",onClick:e=>e.stopPropagation(),children:(0,s.jsx)("input",{type:"checkbox",checked:ew.has(e.id),onChange:()=>eX(e.id),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"})}),(0,s.jsx)("td",{className:"px-6 py-4",style:{maxWidth:"400px"},children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"w-8 h-8 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white font-semibold text-xs mr-3 shrink-0",children:eQ(e.f
1irstName,e.lastName)}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("div",{className:"text-sm font-medium text-gray-900 truncate",children:[e.firstName," ",e.lastName]}),e.position&&(0,s.jsx)("div",{className:"text-sm text-gray-500 truncate",children:e.position})]})]})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:e.email}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:e.mobile||"-"}),(0,s.jsxs)("td",{className:"px-6 py-4 text-sm text-gray-900 max-w-[180px]",children:[e.city&&(0,s.jsx)("div",{className:"truncate",children:e.city}),e.currentOrganization&&(0,s.jsx)("div",{className:"text-gray-500 text-xs truncate",title:e.currentOrganization,children:e.currentOrganization})]}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:e.currentEmploymentStatus&&(0,s.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-medium rounded-full ".concat(e1(e.currentEmploymentStatus)),children:e.currentEmploymentStatus})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:void 0!==e.willingToRelocate&&(0,s.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-medium rounded-full ".concat(e2(e.willingToRelocate)),children:e.willingToRelocate?"Yes":"No"})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:void 0!==e.noticePeriod?"".concat(e.noticePeriod," days"):"-"}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:e.skills&&e.skills.length>0&&(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[e.skills.slice(0,3).map(e=>(0,s.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:e},e)),e.skills.length>3&&(0,s.jsxs)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:["+",e.skills.length-3]})]})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,s.jsx)("span",{className:"inline-flex px-2 py-1 text-xs font-medium rounded-full ".concat(e0(e.source)),children:e.source})}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.addedBy||"-"}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900",children:e.ownerName||e.addedBy||"-"}),(0,s.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:e.createdAt?new Date(e.createdAt).toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"}):"-"}),(0,s.jsx)("td",{className:"px-3 py-4 whitespace-nowrap text-center text-sm font-medium sticky right-0 bg-white shadow-[-4px_0_6px_-2px_rgba(0,0,0,0.1)]",children:(0,s.jsxs)("div",{className:"flex items-center gap-1 justify-center",children:[(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),to(e)},className:"inline-flex items-center justify-center p-1.5 rounded-md hover:bg-blue-50 text-gray-400 hover:text-blue-600 transition-colors",title:"Download Resume",children:(0,s.jsx)(y.A,{className:"w-4 h-4"})}),(0,s.jsxs)(k.rI,{children:[(0,s.jsx)(k.ty,{asChild:!0,onClick:e=>e.stopPropagation(),children:(0,s.jsx)("button",{className:"inline-flex items-center p-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none",children:(0,s.jsx)(N.A,{className:"w-4 h-4"})})}),(0,s.jsxs)(k.SQ,{align:"end",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(k._2,{onClick:()=>l(e),children:"View Profile"}),(0,s.jsx)(k._2,{onClick:()=>td(e),children:"Send Email"}),(0,s.jsx)(k._2,{onClick:()=>th(e),children:"Assign to Job"}),(0,s.jsx)(k._2,{onClick:()=>to(e),children:"Download Resume"}),(0,s.jsx)(k._2,{onClick:()=>tx(e),children:"Change Owner"})]})]})]})})]},e.id))})]})}),0===e$&&!G&&(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)("p",{className:"text-muted-foreground",children:"No candidates found"}),(0,s.jsx)(w.$,{variant:"link",onClick:()=>X(""),children:"Clear search"})]}),G&&(0,s.jsx)("div",{className:"text-center py-12",children:(0,s.jsx)("p",{className:"text-muted-foreground",children:"Loading c
1andidates..."})}),e$>0&&eV>1&&(0,s.jsxs)("div",{className:"px-6 py-4 border-t border-gray-200 flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"text-sm text-gray-700",children:["Page ",eW.currentPage," of ",eV]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)("button",{onClick:()=>eO(Math.max(1,eD-1)),disabled:!eW.hasPrevPage||G,className:"px-3 py-1 text-sm border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),(0,s.jsxs)("div",{className:"flex items-center space-x-1",children:[eW.currentPage>3&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>eO(1),disabled:G,className:"px-3 py-1 text-sm border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50",children:"1"}),eW.currentPage>4&&(0,s.jsx)("span",{className:"px-2 text-gray-500",children:"..."})]}),Array.from({length:Math.min(5,eV)},(e,t)=>{let a=Math.max(1,Math.min(eV-4,eW.currentPage-2))+t;return a>eV?null:(0,s.jsx)("button",{onClick:()=>eO(a),disabled:G,className:"px-3 py-1 text-sm border rounded-md disabled:opacity-50 ".concat(eW.currentPage===a?"bg-blue-600 text-white border-blue-600":"border-gray-300 hover:bg-gray-50"),children:a},a)}),eW.currentPage<eV-2&&(0,s.jsxs)(s.Fragment,{children:[eW.currentPage<eV-3&&(0,s.jsx)("span",{className:"px-2 text-gray-500",children:"..."}),(0,s.jsx)("button",{onClick:()=>eO(eV),disabled:G,className:"px-3 py-1 text-sm border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50",children:eV})]})]}),(0,s.jsx)("button",{onClick:()=>eO(Math.min(eV,eD+1)),disabled:!eW.hasNextPage||G,className:"px-3 py-1 text-sm border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})]})}),eh&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:()=>eg(null),children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-6 w-96 max-w-[90vw]",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("h3",{className:"text-lg font-semibold mb-4",children:"Change Owner"}),(0,s.jsx)("p",{className:"text-sm text-gray-600 mb-3",children:ey?"Assign ".concat(ew.size," selected candidate(s) to a new owner:"):(0,s.jsxs)(s.Fragment,{children:["Assign ",(0,s.jsxs)("strong",{children:[eh.firstName," ",eh.lastName]})," to a new owner:"]})}),(0,s.jsxs)("select",{className:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm mb-4 focus:outline-none focus:ring-2 focus:ring-blue-500",value:ev,onChange:e=>eN(e.target.value),children:[(0,s.jsx)("option",{value:"",children:"Select team member..."}),eb.map(e=>(0,s.jsxs)("option",{value:e.userId||e._id,children:[e.firstName," ",e.lastName," (",e.email,")"]},e.userId||e._id))]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)(w.$,{variant:"outline",size:"sm",onClick:()=>eg(null),children:"Cancel"}),(0,s.jsx)(w.$,{size:"sm",onClick:tp,disabled:!ev,children:"Save"})]})]})}),e4&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:()=>{e3(!1),e7({})},children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-6 w-[420px] max-w-[90vw]",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("h3",{className:"text-lg font-semibold mb-1",children:"Bulk Edit Candidates"}),(0,s.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Update ",ew.size," selected candidate(s). Only filled fields will be updated."]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Employment Status"}),(0,s.jsxs)("select",{className:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",value:e6.employmentStatus||"",onChange:e=>e7(t=>({...t,employmentStatus:e.target.value})),children:[(0,s.jsx)("option",{value:"",children:"— Don't change —"}),(0,s.jsx)("option",{value:"Employed",children:"Employed"}),(0,s.jsx)("option",{value:"Unemployed",children:"Unemployed"}),(0,s.jsx)("option",{value:"Freelance",children:"Freelance"}),(0,s.jsx)("option",{value:"Contract",children:"Contract"}),(0,s.jsx)("option",{value:"Student",children:"Student"}),(0,s.jsx)("option",{value:"Notice Period",children:"Notice Period"}),(0,s.jsx)("option",{value:"Actively Looking",children:"Actively Looking"}),(0,s.jsx)("option",{value:"Open to Opportunities",children:"Open to Opportunities"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Notice Period (Days)"}),(0,s.jsx)("input",{type:"number",min:"0",max:"180",placeholder:"— Don't change —",className:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",value:e6.noticePeriodDays||"",onChange:e=>e7(t=>({...t,noticePeriodDays:e.target.value}))})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,s.jsx)(w.$,{variant:"outline",size:"sm",onClick:()=>{e3(!1),e7({})},children:"Cancel"}),(0,s.jsx)(w.$,{size:"sm",onClick:tn,disabled:e8,children:e8?"Updating...":"Update ".concat(ew.size," Candidate(s)")})]})]})}),te&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:()=>{tt(!1),ts("")},children:(0,s.jsxs)("div",{className:"bg-white rounded-lg p-6 w-[480px] max-w-[90vw]",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,s.jsx)(b.A,{className:"h-5 w-5 text-blue-600"}),(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"Assign Candidates to Job"})]}),(0,s.jsxs)("p",{className:"text-sm text-gray-500 mb-4",children:["Assign ",ew.size," selected candidate(s) to a job. They will appear as applicants for the selected job."]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Select Job"}),(0,s.jsxs)("select",{className:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",value:ta,onChange:e=>ts(e.target.value),children:[(0,s.jsx)("option",{value:"",children:"— Choose a job —"}),((null==ti?void 0:ti.jobs)||[]).filter(e=>"active"===e.jobStatus).map(e=>
1(0,s.jsxs)("option",{value:e.jobId,children:[e.jobTitle,e.jobLocation?" — ".concat(e.jobLocation):""]},e.jobId))]}),0===((null==ti?void 0:ti.jobs)||[]).filter(e=>"active"===e.jobStatus).length&&(0,s.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"No active jobs available. Create a job first."})]}),(0,s.jsxs)("div",{className:"bg-gray-50 rounded-md p-3 max-h-40 overflow-y-auto",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-gray-600 mb-2",children:"Candidates to assign:"}),(0,s.jsx)("div",{className:"space-y-1",children:eK.filter(e=>ew.has(e.id)).map(e=>{var t,a;return(0,s.jsxs)("div",{className:"text-xs text-gray-700 flex items-center gap-2",children:[(0,s.jsxs)("span",{className:"w-5 h-5 bg-blue-100 rounded-full flex items-center justify-center text-blue-600 font-medium text-[10px] flex-shrink-0",children:[((null===(t=e.firstName)||void 0===t?void 0:t[0])||"").toUpperCase(),((null===(a=e.lastName)||void 0===a?void 0:a[0])||"").toUpperCase()]}),(0,s.jsxs)("span",{children:[e.firstName," ",e.lastName]}),(0,s.jsxs)("span",{className:"text-gray-400",children:["— ",e.email]})]},e.id)})})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-6",children:[(0,s.jsx)(w.$,{variant:"outline",size:"sm",onClick:()=>{tt(!1),ts("")},children:"Cancel"}),(0,s.jsx)(w.$,{size:"sm",onClick:tc,disabled:!ta||tl,children:tl?"Assigning...":"Assign ".concat(ew.size," Candidate(s)")})]})]})})]})}var U=a(87296),T=a(82995),z=a(41556),F=a(47212),I=a(92955),B=a(40773),_=a(68638);function q(e){let{onClose:t,onComplete:a,onProgress:l}=e,i=(0,S.wA)(),n=(0,S.d4)(e=>{var t;return null===(t=e.clientReducer)||void 0===t?void 0:t.contributionConfig}),c="PAY_ONLY"!==((null==n?void 0:n.mode)||"FULL_AUTO"),[d,u]=(0,r.useState)([]),[x,m]=(0,r.useState)(!1),[p,y]=(0,r.useState)(!1),[b,j]=(0,r.useState)(null),[v,N]=(0,r.useState)([]),[w,k]=(0,r.useState)(!1),A=(0,r.useRef)(null);(0,r.useRef)(null);let D=(e,t,a)=>{i((0,E.L)({uploadProgress:{isActive:!0,batchId:null,totalFiles:e.total,processed:e.processed,saved:e.succeeded,errors:e.failed,duplicates:0,status:t,files:d.map((t,a)=>({name:t.name,status:a<e.processed?e.succeeded>a?"saved":"error":"pending"})),source:"candidates",...a}}))},O=(0,r.useCallback)(e=>{let t=e.filter(e=>{let t=e.name.toLowerCase();return t.endsWith(".pdf")||t.endsWith(".docx")||t.endsWith(".doc")}),a=t.filter(e=>e.size>7864320);a.length&&C.toast.error("".concat(a.length," file(s) exceed 7.5MB limit")),t.length!==e.length&&C.toast.error("Only PDF and DOCX files are accepted");let s=t.filter(e=>e.size<=7864320);u(e=>{let t=[...e,...s];return t.length>100?(C.toast.error("Max 100 files per upload"),t.slice(0,100)):t})},[]),L=e=>{u(t=>t.filter((t,a)=>a!==e))},M=async()=>{if(0===d.length)return C.toast.error("Select files first");y(!0),N([]),j({total:d.length,processed:0,succeeded:0,failed:0}),D({total:d.length,processed:0,succeeded:0,failed:0},"uploading",{batchId:null});try{var e;let t=new FormData;d.forEach(e=>t.append("resumes",e));let a=await P.default.post("/client/resume-upload",t,{headers:{"Content-Type":"multipart/form-data"},timeout:3e4}),s=null===(e=a.data)||void 0===e?void 0:e.batchId;if(!s)throw Error("No batch ID returned");D({total:d.length,processed:0,succeeded:0,failed:0},"uploading",{batchId:s}),y(!0)}catch(e){await (0,_.W)(e,"Upload failed"),y(!1)}},R=(0,S.d4)(e=>{var t;return null===(t=e.eventReducer)||void 0===t?void 0:t.uploadProgress});r.useEffect(()=>{(null==R?void 0:R.isActive)&&"complete"===R.status&&p?(k(!0),y(!1),j({total:R.totalFiles,processed:R.processed,succeeded:R.saved,failed:R.errors}),null==a||a()):(null==R?void 0:R.isActive)&&p&&R.processed>0&&j({total:R.totalFiles,processed:R.processed,succeeded:R.saved,failed:R.errors})},[null==R?void 0:R.processed,null==R?void 0:R.status]);let q=b?Math.round(b.processed/b.total*100):0,K=v.filter(e=>"success"===e.status),W=v.filter(e=>"failed"===e.status||"duplicate"===e.status);return(0,s.jsxs)("div",{className:"space-y-5",children:[!p&&!w&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{onDragOver:e=>{e.preventDefault(),m(!0)},onDragLeave:e=>{e.preventDefault(),m(!1)},onDrop:e=>{e.preventDefault(),m(!1),O(Array.from(e.dataTransfer.files))},onClick:()=>{var e;return null===(e=A.current)||void 0===e?void 0:e.click()},className:"border-2 border-dashed rounded-xl p-8 text-center cursor-pointer transition-all ".concat(x?"border-blue-400 bg-blue-50":"border-gray-200 hover:border-blue-300 bg-gray-50/50"),children:[(0,s.jsx)("input",{ref:A,type:"file",accept:".pdf,.docx,.doc",multiple:!0,onChange:e=>{e.target.files&&O(Array.from(e.target.files)),e.target.value=""},className:"hidden"}),(0,s.jsx)(U.A,{className:"w-10 h-10 text-gray-400 mx-auto mb-3"}),(0,s.jsxs)("p",{className:"text-sm text-gray-600 font-medium",children:["Drag & drop resumes or ",(0,s.jsx)("span",{className:"text-blue-600",children:"browse"})]}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"PDF, DOCX — max 7.5MB per file, up to 100 files"})]}),d.length>0&&(0,s.jsx)("div",{className:"space-y-1.5 max-h-40 overflow-y-auto",children:d.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-50 rounded-lg text-sm",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(T.A,{className:"w-4 h-4 text-blue-500 flex-shrink-0"}),(0,s.jsx)("span",{className:"truncate text-gray-700",children:e.name}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["(",(e.size/1024).toFixed(0)," KB)"]})]}),(0,s.jsx)("button",{onClick:()=>L(t),className:"text-gray-400 hover:text-red-500",children:(0,s.jsx)(h.A,{className:"w-4 h-4"})})]},t))}),d.length>0&&(0,s.jsxs)("button",{onClick:M,className:"w-full py-3 px-4 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",children:[(0,s.jsx)(o.A,{className:"w-4 h-4"}),"Upload & Parse ",d.length," Resume",1!==d.length?"s":""]})]}),(p||w)&&b&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:w?"Processing complete":"Processing ".concat(b.processed," of ").concat(b.total," resumes...")}),(0,s.jsxs)("span",{className:"text-sm font-bold text-blue-600",children:[q,"%"]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-3 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full transition-all duration-500 ".concat(w?"bg-green-500":"bg-blue-600"),style:{width:"".concat(q,"%")}})}),(0,s.jsxs)("div",{className:"flex items-center gap-4 text-xs",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1 text-green-600",children:[(0,s.jsx)(z.A,{className:"w-3.5 h-3.5"})," ",b.succeeded," succeeded"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1 text-red-500",children:[(0,s.jsx)(F.A,{className:"w-3.5 h-3.5"})," ",b.failed," failed"]}),!w&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-gray-400",children:[(0,s.jsx)(I.A,{className:"w-3.5 h-3.5 animate-spin"})," ",b.total-b.processed," remaining"]})]})]}),v.length>0&&(0,s.jsxs)("div",{className:"space-y-3",children:[K.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("h4",{className:"text-sm font-medium text-green-700 mb-2 flex items-center gap-1.5",children:[(0,s.jsx)(z.A,{className:"w-4 h-4"})," Successfully Parsed (",K.length,")"]}),(0,s.jsx)("div",{className:"border border-green-100 rounded-lg overflow-hidden",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-green-50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs text-green-700 font-medium",children:"Name"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs text-green-700 font-medium",children:"Email"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs text-green-700 font-medium",children:"Phone"})]})}),(0,s.jsx)("tbody",{children:K.map((e,t)=>(0,s.jsxs)("tr",{className:"border-t border-green-50",children:[(0,s.jsxs)("td",{className:"px-3 py-2 text-gray-800 flex items-center gap-1.5",children:[(0,s.jsx)(f.A,{className:"w-3.5 h-3.5 text-gray-400"})," ",e.name||"-"]}),(0,s.jsxs)("td",{className:"px-3 py-2 text-gray-600 flex items-center gap-1.5",children:[(0,s.jsx)(g.A,{className:"w-3.5 h-3.5 text-gray-400"})," ",e.email||"-"]}),(0,s.jsxs)("td",{className:"px-3 py-2 text-gray-600 flex items-center gap-1.5",children:[(0,s.jsx)(B.A,{className:"w-3.5 h-3.5 text-gray-400"})," ",e.phone||"-"]})]},t))})]})})]}),W.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("h4",{className:"text-sm font-medium text-red-600 mb-2 flex items-center gap-1.5",children:[(0,s.jsx)(F.A,{className:"w-4 h-4"})," Failed (",W.length,")"]}),(0,s.jsx)("div",{className:"border border-red-100 rounded-lg overflow-hidden",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-red-50",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs text-red-700 font-medium",children:"File"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs text-red-700 font-medium",children:"Reason"})]})}),(0,s.jsx)("tbody",{children:W.map((e,t)=>(0,s.jsxs)("tr",{className:"border-t border-red-50",children:[(0,s.jsx)("td",{className:"px-3 py-2 text-gray-800",children:e.fileName}),(0,s.jsx)("td",{className:"px-3 py-2 text-red-600 text-xs",children:e.error||"Unknown error"})]},t))})]})})]})]}),w&&c&&b&&b.succeeded>0&&(0,s.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3 text-sm text-blue-800",children:[b.succeeded," profile",b.succeeded>1?"s":""," uploaded."]}),w&&!c&&b&&b.succeeded>0&&(0,s.jsxs)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 text-sm text-gray-600",children:[b.succeeded," candidate",b.succeeded>1?"s":""," saved to your private workspace."]}),w&&(0,s.jsx)("div",{className:"flex justify-end gap-3 pt-2",children:(0,s.jsx)("button",{onClick:t,className:"px-6 py-2.5 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700",children:"Done"})})]})}var K=a(10867),W=a(62027),V=a(7216),$=a(52698);let Z=[{key:"firstName",label:"First Name",required:!0,group:"basic"},{key:"lastName",label:"Last Name",required:!0,group:"basic"},{key:"email",label:"Email",required:!0,group:"basic"},{key:"contactNumber",label:"Phone Number",required:!0,group:"basic"},{key:"positionTitle",label:"Position / Job Title",required:!1,group:"basic"},{key:"currentOrganization",label:"Current Organization",required:!1,group:"basic"},{key:"totalExperience",label:"Total Experience (years)",required:!1,group:"basic"},{key:"skills",label:"Skills (comma-separated)",required:!1,group:"basic"},{key:"city",label:"City",required:!1,group:"basic"},{key:"state",label:"State",required:!1,group:"basic"},{key:"country",label:"Country",required:!1,group:"basic"},{key:"qualification",label:"Qualification / Degree",required:!1,group:"basic"},{key:"specialization",label:"Specialization / Field",required:!1,group:"basic"},{key:"currentSalary",label:"Current Salary",required:!1,group:"basic"},{key:"expectedSalary",label:"Expected Salary",required:!1,group:"basic"},{key:"currencyType",label:"Currency (INR/USD/EUR/GBP)",required:!1,group:"basic"},{key:"currentEmploymentStatus",label:"Employment Status",required:!1,group:"basic"},{key:"noticePeriodDays",label:"Notice Period (days)",required:!1,group:"basic"},{key:"linkedinProfileUrl",label:"LinkedIn URL",required:!1,group:"basic"},{key:"summary",label:"Summary / About",required:!1,group:"basic"},{key:"gender",label:"Gender (Male/Female/Other)",required:!1,group:"basic"},{key:"note",label:"Notes",required:!1,group:"basic"}],H=[{groupKey:"workExperience",groupLabel:"Work Experience",fields:[{subKey:"company",label:"Company"},{subKey:"position",label:"Position"},{subKey:"startDate",label:"Start Date"},{subKey:"endDate",label:"End Date"},{subKey:"description",label:"Description"}]},{groupKey:"education",groupLabel:"Education",fields:[{subKey:"institution",label:"Institution"},{subKey:"degree",label:"Degree"},{subKey:"field",label:"Field of Study"},{subKey:"startDate",label:"Start Date"},{subKey:"endDate",label:"End Date"}]},{groupKey:"certifications",groupLabel:"Certifications",fields:[{subKey:"name",label:"Certification Name"},{subKey:"issuingOrganization",label:"Issuing Organization"},{subKey:"issueDate",label:"Issue Date"},{subKey:"expiryDate",label:"Expiry Date"}]}],J=function(){let e=[];for(let t of H)for(let a=1;a<=5;a++)for(let s of t.fields)e.push({key:"".concat(t.groupKey,"_").concat(a,"_").concat(s.subKey),label:"".concat(t.groupLabel," ").concat(a," - ").concat(s.label),groupKey:t.groupKey,index:a,subKey:s.subKey});return e}();function G(e){let{fieldKey:t,label:a,required:l,csvHeaders:r,columnMapping:i,setColumnMapping:n,defaultValues:c,setDefaultValues:d}=e,o=!!i[t],u=!!(null==c?void 0:c[t]);return(0,s.jsxs)("div",{className:"flex items-center gap-2 py-1.5",children:[(0,s.jsxs)("div",{className:"w-44 flex-shrink-0",children:[(0,s.jsx)("span",{className:"text-sm text-gray-700",children:a}),l&&(0,s.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,s.jsx)(K.A,{className:"w-4 h-4 text-gray-300 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1 relative",children:[(0,s.jsxs)("select",{value:i[t]||"",onChange:e=>{n(a=>{let s={...a};return e.target.value?s[t]=e.target.value:delete s[t],s})},className:"w-full px-3 py-1.5 border border-gray-200 rounded-lg text-sm bg-white appearance-none pr-8 focus:outline-none focus:ring-1 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"",children:"— Skip —"}),r.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]}),(0,s.jsx)(W.A,{className:"w-4 h-4 absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 pointer-events-none"})]}),!o&&d&&(0,s.jsx)("input",{type:"text",placeholder:"Default",value:(null==c?void 0:c[t])||"",onChange:e=>d(a=>({...a,[t]:e.target.value})),className:"w-24 px-2 py-1.5 border border-gray-200 rounded-lg text-xs bg-gray-50 focus:outline-none focus:ring-1 focus:ring-blue-400 placeholder:text-gray-300",title:"Default value when no CSV column is mapped"}),(o||u)&&(0,s.jsx)(z.A,{className:"w-4 h-4 text-green-500 flex-shrink-0"})]})}function Y(e){let{group:t,csvHeaders:a,columnMapping:l,setColumnMapping:i}=e,[n,c]=(0,r.useState)(!1),d=J.filter(e=>e.groupKey===t.groupKey&&l[e.key]).length;return(0,s.jsxs)("div",{className:"border border-gray-100 rounded-lg mt-2",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>c(!n),className:"w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 rounded-lg",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:[t.groupLabel," (up to ",5,")"]}),(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[d>0&&(0,s.jsxs)("span",{className:"text-xs text-green-600 font-medium",children:[d," mapped"]}),(0,s.jsx)(W.A,{className:"w-4 h-4 text-gray-400 transition-transform ".concat(n?"rotate-180":"")})]})]}),n&&(0,s.jsx)("div",{className:"px-3 pb-3 space-y-1",children:Array.from({length:5},(e,t)=>t+1).map(e=>(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-xs text-gray-400 font-medium mt
1-2 mb-1",children:[t.groupLabel," ",e]}),t.fields.map(r=>{let n="".concat(t.groupKey,"_").concat(e,"_").concat(r.subKey);return(0,s.jsx)(G,{fieldKey:n,label:r.label,csvHeaders:a,columnMapping:l,setColumnMapping:i},n)})]},e))})]})}function X(e){let{onClose:t,onComplete:a}=e,[l,i]=(0,r.useState)("upload"),[n,c]=(0,r.useState)(null),[d,x]=(0,r.useState)([]),[m,p]=(0,r.useState)([]),[h,g]=(0,r.useState)({}),[f,b]=(0,r.useState)({}),[j,v]=(0,r.useState)(!1),[N,w]=(0,r.useState)(!1),[k,S]=(0,r.useState)("skip"),[A,E]=(0,r.useState)([]),[D,O]=(0,r.useState)({processed:0,total:0}),L=(0,r.useRef)(null),M=(0,r.useCallback)(e=>{let t={},a=e.map(e=>e.toLowerCase().replace(/[^a-z0-9]/g,""));for(let s of Z){let l=s.key.toLowerCase(),r=s.label.toLowerCase().replace(/[^a-z0-9]/g,""),i=a.findIndex(e=>e===l);if(-1===i&&(i=a.findIndex(e=>e===r)),-1===i){let e={firstName:["firstname","first","fname"],lastName:["lastname","last","lname","surname"],email:["email","emailaddress","emailid","mail"],contactNumber:["phone","phonenumber","mobile","contact","contactnumber","cell","telephone"],positionTitle:["position","title","jobtitle","designation","role","positiontitle"],currentOrganization:["company","organization","organisation","employer","currentcompany","currentorganization"],totalExperience:["experience","totalexperience","yearsofexperience","exp","years"],skills:["skills","skill","technologies","tech","techstack"],city:["city","location"],state:["state","province","region"],country:["country","nation"],qualification:["qualification","degree","education"],specialization:["specialization","field","major","branch","stream"],currentSalary:["currentsalary","salary","ctc","currentctc"],expectedSalary:["expectedsalary","expectedctc","ectc"],currencyType:["currency","currencytype"],currentEmploymentStatus:["employmentstatus","status","currentemploymentstatus"],noticePeriodDays:["noticeperiod","noticeperioddays","notice"],linkedinProfileUrl:["linkedin","linkedinurl","linkedinprofileurl","linkedinprofile"],summary:["summary","about","bio","profile","description"],gender:["gender","sex"],note:["note","notes","comments","remarks"]}[s.key]||[];i=a.findIndex(t=>e.some(e=>t.includes(e)))}
1-1!==i&&(t[s.key]=e[i])}for(let s of J){let l=s.label.toLowerCase().replace(/[^a-z0-9]/g,""),r=a.findIndex(e=>e===l);-1!==r&&(t[s.key]=e[r])}return t},[]),R=(0,r.useCallback)(e=>{if(!e.name.toLowerCase().endsWith(".csv")){C.toast.error("Only CSV files are accepted");return}if(e.size>0x3200000){C.toast.error("File too large. Max 50MB.");return}c(e);let t=new FileReader;t.onload=e=>{var t;let{headers:a,rows:s}=function(e){let t=[],a="",s=!1;for(let l=0;l<e.length;l++){let r=e[l];'"'===r?s&&'"'===e[l+1]?(a+='"',l++):s=!s:"\n"!==r&&"\r"!==r||s?a+=r:((a.length>0||t.length>0)&&t.push(a),a="","\r"===r&&"\n"===e[l+1]&&l++)}a.length>0&&t.push(a);let l=e=>{let t=[],a="",s=!1;for(let l=0;l<e.length;l++){let r=e[l];'"'===r?s&&'"'===e[l+1]?(a+='"',l++):s=!s:","!==r||s?a+=r:(t.push(a.trim()),a="")}return t.push(a.trim()),t};return 0===t.length?{headers:[],rows:[]}:{headers:l(t[0]),rows:t.slice(1).map(l).filter(e=>e.some(e=>e.length>0))}}(null===(t=e.target)||void 0===t?void 0:t.result);if(0===a.length){C.toast.error("CSV file appears to be empty");return}if(0===s.length){C.toast.error("CSV file has headers but no data rows");return}if(s.length>1e4){C.toast.error("Max 10,000 rows per upload. Your file has "+s.length+" rows.");return}x(a),p(s),g(M(a)),i("map"),C.toast.success("Loaded ".concat(s.length," rows with ").concat(a.length," columns"))},t.onerror=()=>C.toast.error("Failed to read file"),t.readAsText(e)},[M]),U=(0,r.useMemo)(()=>{if("verify"!==l)return[];let e=[],t=new Set;return m.forEach((a,s)=>{let l=e=>{let t=h[e];if(!t)return f[e]||"";let s=d.indexOf(t);return(s>=0?(a[s]||"").trim():"")||f[e]||""},r=l("email"),i=l("firstName");r?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)?t.has(r.toLowerCase())?e.push({row:s+2,field:"Email",message:"Duplicate email in CSV: ".concat(r)}):t.add(r.toLowerCase()):e.push({row:s+2,field:"Email",message:"Invalid email: ".concat(r)}):e.push({row:s+2,field:"Email",message:"Email is required"}),i||e.push({row:s+2,field:"First Name",message:"First name is required"})}),e},[l,m,d,h]),T=(0,r.useMemo)(()=>m.map(e=>{let t={};for(let a of Z){let s=h[a.key],l="";if(s){let t=d.indexOf(s);t>=0&&(l=(e[t]||"").trim())}!l&&f[a.key]&&(l=f[a.key]),l&&(["totalExperience","currentSalary","expectedSalary","noticePeriodDays"].includes(a.key)?t[a.key]=parseFloat(l)||0:"skills"===a.key?t[a.key]=l.split(",").map(e=>e.trim()).filter(Boolean):t[a.key]=l)}for(let a of H){let s=[];for(let t=1;t<=5;t++){let l={},r=!1;for(let s of a.fields){let i=h["".concat(a.groupKey,"_").concat(t,"_").concat(s.subKey)];if(!i)continue;let n=d.indexOf(i);if(n<0)continue;let c=(e[n]||"").trim();c&&(l[s.subKey]=c,r=!0)}r&&s.push(l)}s.length>0&&(t[a.groupKey]=s)}return t}),[m,d,h]),z=async()=>{var e,t,a;if(U.length>0){C.toast.error("Fix ".concat(U.length," validation error(s) before uploading"));return}w(!0),E([]),O({processed:0,total:T.length});try{let t=[],a=0;for(let s=0;s<T.length;s+=500){let l=T.slice(s,s+500),r=s+2,i=await P.default.post("/client/csv-upload",{candidates:l,duplicateAction:k,batchStartRow:r},{timeout:12e4}),n=(null===(e=i.data)||void 0===e?void 0:e.results)||[];t.push(...n),a+=l.length,O({processed:a,total:T.length}),E([...t])}i("results");let s=t.filter(e=>"success"===e.status).length,l=t.filter(e=>"skipped"===e.status||"duplicate"===e.status).length,r=t.filter(e=>"failed"===e.status).length;C.toast.success("Upload complete: ".concat(s," added, ").concat(l," skipped, ").concat(r," failed"))}catch(e){C.toast.error((null===(a=e.response)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.message)||e.message||"Upload failed")}finally{w(!1)}},I=h.email&&h.firstName,B=D.total>0?Math.round(D.processed/D.total*100):0;return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsx)("div",{className:"flex items-center justify-center gap-1 text-xs",children:["upload","map","verify","results"].map((e,t)=>{let a=e===l,i=["upload","map","verify","results"].indexOf(l)>t;return(0,s.jsxs)(r.Fragment,{children:[t>0&&(0,s.jsx)("div",{className:"w-8 h-0.5 ".concat(i?"bg-blue-500":"bg-gray-200")}),(0,s.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 rounded-full ".concat(a?"bg-blue-100 text-blue-700 font-medium":i?"text-blue-600":"text-gray-400"),children:[(0,s.jsx)("span",{className:"w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold ".concat(i?"bg-blue-500 text-white":a?"bg-blue-600 text-white":"bg-gray-200 text-gray-500"),children:i?"✓":t+1}),(0,s.jsx)("span",{className:"hidden sm:inline",children:["Upload","Map Fields","Verify","Results"][t]})]})]},e)})}),"upload"===l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg border border-blue-100",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-blue-800",children:"Download Template"}),(0,s.jsx)("p",{className:"text-xs text-blue-600",children:"Use our template to ensure correct formatting"})]}),(0,s.jsxs)("button",{onClick:()=>{let e=new Blob([function(){let e=Z.map(e=>e.label),t=[];for(let e of H)for(let a=1;a<=2;a++)for(let s of e.fields)t.push("".concat(e.groupLabel," ").concat(a," - ").concat(s.label));let a=[...e,...t],s=e=>e.includes(",")?'"'.concat(e,'"'):e,l=["John","Doe","[email protected]","9876
1543210","Software Engineer","Acme Corp","5",s("React,Node.js,TypeScript"),"Bangalore","Karnataka","India","B.Tech","Computer Science","1200000","1500000","INR","Employed","30","https://linkedin.com/in/johndoe","Experienced full-stack developer","Male","","Acme Corp","Software Engineer","2020-01","Present","Full-stack development","StartupXYZ","Junior Developer","2018-06","2019-12","Frontend development","IIT Delhi","B.Tech","Computer Science","2014","2018","","","","","","AWS Solutions Architect","Amazon","2021-03","2024-03","","","",""],r=["Jane","Smith","[email protected]","+1-555-0123","Product Manager","Tech Inc","8",s("Product Strategy,Agile,Data Analysis"),"New York","NY","USA","MBA","Business Administration","120000","150000","USD","Employed","60","https://linkedin.com/in/janesmith","Product leader with 8 years experience","Female","","Tech Inc","Product Manager","2019-01","Present","Leading product strategy","Big Corp","Associate PM","2016-06","2018-12","Product analytics","Stanford University","MBA","Business Administration","2014","2016","UCLA","BS","Computer Science","2010","2014","PMP","PMI","2020-06","",s("Certified Scrum Master"),"Scrum Alliance","2019-01",""];return[a.join(","),l.join(","),r.join(",")].join("\n")}()],{type:"text/csv"}),t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download="candidate_upload_template.csv",a.click(),URL.revokeObjectURL(t)},className:"flex items-center gap-1.5 px-3 py-1.5 bg-white border border-blue-200 rounded-lg text-sm text-blue-700 hover:bg-blue-50 transition-colors",children:[(0,s.jsx)(y.A,{className:"w-4 h-4"}),"Template"]})]}),(0,s.jsxs)("div",{onDragOver:e=>{e.preventDefault(),v(!0)},onDragLeave:e=>{e.preventDefault(),v(!1)},onDrop:e=>{e.preventDefault(),v(!1);let t=e.dataTransfer.files[0];t&&R(t)},onClick:()=>{var e;return null===(e=L.current)||void 0===e?void 0:e.click()},className:"border-2 border-dashed rounded-xl p-8 text-center cursor-pointer transition-all ".concat(j?"border-green-400 bg-green-50":"border-gray-200 hover:border-green-300 bg-gray-50/50"),children:[(0,s.jsx)("input",{ref:L,type:"file",accept:".csv",onChange:e=>{var t;(null===(t=e.target.files)||void 0===t?void 0:t[0])&&R(e.target.files[0]),e.target.value=""},className:"hidden"}),(0,s.jsx)(u.A,{className:"w-10 h-10 text-gray-400 mx-auto mb-3"}),(0,s.jsxs)("p",{className:"text-sm text-gray-600 font-medium",children:["Drag & drop a CSV file or ",(0,s.jsx)("span",{className:"text-green-600",children:"browse"})]}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"CSV format — max 10,000 rows, 50MB"})]})]}),"map"===l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-sm text-gray-600",children:["Map your CSV columns to candidate fields. We auto-detected ",Object.keys(h).length," matches."]}),(0,s.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-2 pr-1",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:"Basic Information"}),Z.map(e=>(0,s.jsx)(G,{fieldKey:e.key,label:e.label,required:e.required,csvHeaders:d,columnMapping:h,setColumnMapping:g,defaultValues:f,setDefaultValues:b},e.key)),H.map(e=>(0,s.jsx)(Y,{group:e,csvHeaders:d,columnMapping:h,setColumnMapping:g},e.groupKey))]}),(0,s.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-gray-500 mb-2",children:"Preview (first 3 rows)"}),(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"text-xs w-full",children:[(0,s.jsx)("thead",{children:(0,s.jsx)("tr",{children:Z.filter(e=>h[e.key]).map(e=>(0,s.jsx)("th",{className:"px-2 py-1 text-left text-gray-500 font-medium whitespace-nowrap",children:e.label},e.key))})}),(0,s.jsx)("tbody",{children:m.slice(0,3).map((e,t)=>(0,s.jsx)("tr",{className:"border-t border-gray-100",children:Z.filter(e=>h[e.key]).map(t=>{let a=d.indexOf(h[t.key]);return(0,s.jsx)("td",{className:"px-2 py-1 text-gray-700 whitespace-nowrap max-w-[150px] truncate",children:a>=0&&e[a]||"-"},t.key)})},t))})]})})]}),(0,s.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,s.jsxs)("button",{onClick:()=>{i("upload"),c(null),x([]),p([])},className:"flex items-center gap-1.5 px-4 py-2 text-sm text-gray-600 hover:text-gray-800",children:[(0,s.jsx)(V.A,{className:"w-4 h-4"})," Back"]}),(0,s.jsxs)("button",{onClick:()=>
1{if(!I){C.toast.error("Map at least Email and First Name");return}i("verify")},className:"flex items-center gap-1.5 px-5 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700",children:["Next ",(0,s.jsx)(K.A,{className:"w-4 h-4"})]})]})]}),"verify"===l&&!N&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"bg-blue-50 rounded-lg p-3 text-center",children:[(0,s.jsx)("p",{className:"text-2xl font-bold text-blue-700",children:m.length}),(0,s.jsx)("p",{className:"text-xs text-blue-600",children:"Total Rows"})]}),(0,s.jsxs)("div",{className:"bg-green-50 rounded-lg p-3 text-center",children:[(0,s.jsx)("p",{className:"text-2xl font-bold text-green-700",children:Object.keys(h).length}),(0,s.jsx)("p",{className:"text-xs text-green-600",children:"Fields Mapped"})]}),(0,s.jsxs)("div",{className:"rounded-lg p-3 text-center ".concat(U.length>0?"bg-red-50":"bg-green-50"),children:[(0,s.jsx)("p",{className:"text-2xl font-bold ".concat(U.length>0?"text-red-700":"text-green-700"),children:U.length}),(0,s.jsx)("p",{className:"text-xs ".concat(U.length>0?"text-red-600":"text-green-600"),children:"Errors"})]})]}),U.length>0&&(0,s.jsx)("div",{className:"max-h-40 overflow-y-auto border border-red-100 rounded-lg",children:(0,s.jsxs)("table",{className:"w-full text-xs",children:[(0,s.jsx)("thead",{className:"bg-red-50 sticky top-0",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-red-700 font-medium",children:"Row"}),(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-red-700 font-medium",children:"Field"}),(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-red-700 font-medium",children:"Issue"})]})}),(0,s.jsxs)("tbody",{children:[U.slice(0,50).map((e,t)=>(0,s.jsxs)("tr",{className:"border-t border-red-50",children:[(0,s.jsx)("td",{className:"px-3 py-1.5 text-gray-700",children:e.row}),(0,s.jsx)("td",{className:"px-3 py-1.5 text-gray-700",children:e.field}),(0,s.jsx)("td",{className:"px-3 py-1.5 text-red-600",children:e.message})]},t)),U.length>50&&(0,s.jsx)("tr",{children:(0,s.jsxs)("td",{colSpan:3,className:"px-3 py-1.5 text-gray-400 text-center",children:["...and ",U.length-50," more errors"]})})]})]})}),(0,s.jsx)("div",{className:"bg-amber-50 rounded-lg p-4 border border-amber-100",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)($.A,{className:"w-4 h-4 text-amber-600 mt-0.5 flex-shrink-0"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-amber-800",children:"Duplicate Handling"}),(0,s.jsx)("p",{className:"text-xs text-amber-600 mt-0.5 mb-3",children:"If a candidate with the same email already exists:"}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer transition-colors ".concat("skip"===k?"bg-white border-amber-300 shadow-sm":"border-transparent hover:bg-amber-100"),children:[(0,s.jsx)("input",{type:"radio",name:"dup",value:"skip",checked:"skip"===k,onChange:()=>S("skip"),className:"accent-amber-600"}),(0,s.jsx)("span",{className:"text-sm text-amber-800",children:"Skip duplicates"})]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border cursor-pointer transition-colors ".concat("overwrite"===k?"bg-white border-amber-300 shadow-sm":"border-transparent hover:bg-amber-100"),children:[(0,s.jsx)("input",{type:"radio",name:"dup",value:"overwrite",checked:"overwrite"===k,onChange:()=>S("overwrite"),className:"accent-amber-600"}),(0,s.jsx)("span",{className:"text-sm text-amber-800",children:"Overwrite existing"})]})]})]})]})}),(0,s.jsxs)("div",{className:"flex justify-between pt-2",children:[(0,s.jsxs)("button",{onClick:()=>i("map"),className:"flex items-center gap-1.5 px-4 py-2 text-sm text-gray-600 hover:text-gray-800",children:[(0,s.jsx)(V.A,{className:"w-4 h-4"})," Back"]}),(0,s.jsxs)("button",{onClick:z,disabled:U.length>0,className:"flex items-center gap-1.5 px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)(o.A,{className:"w-4 h-4"}),"Upload ",m.length," Candidate",1!==m.length?"s":""]})]})]}),N&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:["Processing ",D.processed," of ",D.total," candidates..."]}),(0,s.jsxs)("span",{className:"text-sm font-bold text-blue-600",children:[B,"%"]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-3 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-blue-600 rounded-full transition-all duration-500",style:{width:"".concat(B,"%")}
1})}),(0,s.jsx)("p",{className:"text-xs text-gray-400 text-center",children:"This may take a moment for large uploads..."})]}),"results"===l&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,s.jsxs)("div",{className:"bg-blue-50 rounded-lg p-3 text-center",children:[(0,s.jsx)("p",{className:"text-xl font-bold text-blue-700",children:A.length}),(0,s.jsx)("p",{className:"text-xs text-blue-600",children:"Total"})]}),(0,s.jsxs)("div",{className:"bg-green-50 rounded-lg p-3 text-center",children:[(0,s.jsx)("p",{className:"text-xl font-bold text-green-700",children:A.filter(e=>"success"===e.status).length}),(0,s.jsx)("p",{className:"text-xs text-green-600",children:"Added"})]}),(0,s.jsxs)("div",{className:"bg-amber-50 rounded-lg p-3 text-center",children:[(0,s.jsx)("p",{className:"text-xl font-bold text-amber-700",children:A.filter(e=>"skipped"===e.status||"duplicate"===e.status).length}),(0,s.jsx)("p",{className:"text-xs text-amber-600",children:"Skipped"})]}),(0,s.jsxs)("div",{className:"bg-red-50 rounded-lg p-3 text-center",children:[(0,s.jsx)("p",{className:"text-xl font-bold text-red-700",children:A.filter(e=>"failed"===e.status).length}),(0,s.jsx)("p",{className:"text-xs text-red-600",children:"Failed"})]})]}),A.filter(e=>"failed"===e.status).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsxs)("h4",{className:"text-sm font-medium text-red-600 flex items-center gap-1.5",children:[(0,s.jsx)(F.A,{className:"w-4 h-4"})," Failed Rows"]}),(0,s.jsxs)("button",{onClick:()=>{let e=A.filter(e=>"failed"===e.status);if(0===e.length)return;let t=new Blob([[d.join(",")+",Error",...e.map(e=>{let t=m[e.row-2];return t?t.map(e=>'"'.concat((e||"").replace(/"/g,'""'),'"')).join(",")+',"'.concat((e.error||"").replace(/"/g,'""'),'"'):""}).filter(Boolean)].join("\n")],{type:"text/csv"}),a=URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download="upload_errors.csv",s.click(),URL.revokeObjectURL(a)},className:"flex items-center gap-1.5 px-3 py-1.5 bg-red-50 border border-red-200 rounded-lg text-xs text-red-700 hover:bg-red-100",children:[(0,s.jsx)(y.A,{className:"w-3.5 h-3.5"})," Download Errors CSV"]})]}),(0,s.jsx)("div",{className:"max-h-40 overflow-y-auto border border-red-100 rounded-lg",children:(0,s.jsxs)("table",{className:"w-full text-xs",children:[(0,s.jsx)("thead",{className:"bg-red-50 sticky top-0",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-red-700 font-medium",children:"Row"}),(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-red-700 font-medium",children:"Email"}),(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-red-700 font-medium",children:"Error"})]})}),(0,s.jsx)("tbody",{children:A.filter(e=>"failed"===e.status).slice(0,50).map((e,t)=>(0,s.jsxs)("tr",{className:"border-t border-red-50",children:[(0,s.jsx)("td",{className:"px-3 py-1.5 text-gray-700",children:e.row}),(0,s.jsx)("td",{className:"px-3 py-1.5 text-gray-700",children:e.email||"-"}),(0,s.jsx)("td",{className:"px-3 py-1.5 text-red-600",children:e.error})]},t))})]})})]}),A.filter(e=>"skipped"===e.status||"duplicate"===e.status).length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("h4",{className:"text-sm font-medium text-amber-600 mb-2 flex items-center gap-1.5",children:[(0,s.jsx)($.A,{className:"w-4 h-4"})," Skipped (Duplicates)"]}),(0,s.jsx)("div",{className:"max-h-32 overflow-y-auto border border-amber-100 rounded-lg",children:(0,s.jsxs)("table",{className:"w-full text-xs",children:[(0,s.jsx)("thead",{className:"bg-amber-50 sticky top-0",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-amber-700 font-medium",children:"Row"}),(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-amber-700 font-medium",children:"Email"}),(0,s.jsx)("th",{className:"px-3 py-1.5 text-left text-amber-700 font-medium",children:"Reason"})]})}),(0,s.jsx)("tbody",{children:A.filter(e=>"skipped"===e.status||"duplicate"===e.status).slice(0,30).map((e,t)=>(0,s.jsxs)("tr",{className:"border-t border-amber-50",children:[(0,s.jsx)("td",{className:"px-3 py-1.5 text-gray-700",children:e.row}),(0,s.jsx)("td",{className:"px-3 py-1.5 text-gray-700",children:e.email||"-"}),(0,s.jsx)("td",{className:"px-3 py-1.5 text-amber-600",children:e.error||"Already exists"})]},t))})]})})]}),(0,s.jsx)("div",{className:"flex justify-end pt-2",children:(0,s.jsx)("button",{onClick:()=>{null==a||a(),t()},className:"px-6 py-2.5 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700",children:"Done"})})]})]})}var Q=a(73807),ee=a(32942),et=a(77711);function ea(){let[e,t]=(0,r.useState)([]),[a,l]=(0,r.useState)(!0),[i,n]=(0,r.useState)(null),[c,d]=(0,r.useState)({}),[u,x]=(0,r.useState)(null);(0,r.useEffect)(()=>{m()},[]);let m=async()=>{try{var e;let a=await P.default.get("/client/candidates/bulk-upload-batch-info",{params:{page:1,limit:20}}),s=(null===(e=a.data)||void 0===e?void 0:e.data)||a.data||[],l=Array.isArray(s)?s:s.batches||[];t(l.map(e=>{let t=e.processedCount||0,a=e.invalidCount||0,s=e.duplicateCount||0,l=e.total_upload_file||e.totalFiles||t+a+s||0;return{...e,batchId:e.trackingId||e.batchId||e._id,uploadedAt:e.upload_time||e.uploadedAt||e.createdAt,totalFiles:l,succeeded:t,failed:a,duplicates:s}}))}catch(e){console.error("Failed to fetch upload batches:",e)}finally{l(!1)}},p=async e=>{if(i===e){n(null);return}if(n(e),!c[e]){x(e);try{var t;let a=await P.default.get("/client/candidates/bulk-upload-detail/".concat(e)),s=(null===(t=a.data)||void 0===t?void 0:t.data)||[];d(t=>({...t,[e]:s}))}catch(t){console.error("Failed to fetch batch records:",t),d(t=>({...t,[e]:[]}))}finally{x(null)}}},h=e=>
1e?new Date(e).toLocaleString("en-IN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0}):"-";return a?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(I.A,{className:"h-6 w-6 animate-spin text-blue-600"})}):0===e.length?(0,s.jsxs)("div",{className:"text-center py-12",children:[(0,s.jsx)(o.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-3"}),(0,s.jsx)("p",{className:"text-gray-500 text-sm",children:"No resumes uploaded via bulk upload yet."})]}):(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-500",children:[e.length," upload batch(es)"]}),e.map(e=>{let t=e.batchId||e._id,a=i===t,l=c[t]||[],r=e.succeeded||0,n=e.failed||0,d=e.duplicates||0;return(0,s.jsxs)("div",{className:"border rounded-lg overflow-hidden",children:[(0,s.jsxs)("button",{onClick:()=>p(t),className:"w-full flex items-center justify-between px-4 py-3 bg-gray-50 hover:bg-gray-100 transition-colors text-left",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(T.A,{className:"h-4 w-4 text-gray-400"}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium text-gray-800",children:[e.totalFiles," file",1!==e.totalFiles?"s":""," uploaded"]}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:h(e.uploadedAt)})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[r>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-green-600",children:[(0,s.jsx)(Q.A,{className:"h-3.5 w-3.5"})," ",r," saved"]}),n>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-red-600",children:[(0,s.jsx)(F.A,{className:"h-3.5 w-3.5"})," ",n," failed"]}),d>0&&(0,s.jsxs)("span",{className:"flex items-center gap-1 text-amber-600",children:[(0,s.jsx)($.A,{className:"h-3.5 w-3.5"})," ",d," dup"]})]}),a?(0,s.jsx)(ee.A,{className:"h-4 w-4 text-gray-400"}):(0,s.jsx)(W.A,{className:"h-4 w-4 text-gray-400"})]})]}),a&&(0,s.jsx)("div",{className:"border-t",children:u===t?(0,s.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,s.jsx)(I.A,{className:"h-5 w-5 animate-spin text-blue-500"})}):0===l.length?(0,s.jsx)("p",{className:"text-sm text-gray-400 text-center py-4",children:"No detailed records available"}):(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 border-b",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500",children:"File"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500",children:"Name"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500",children:"Email"}),(0,s.jsx)("th",{className:"px-3 py-2 text-center text-xs font-medium text-gray-500",children:"Status"}),(0,s.jsx)("th",{className:"px-3 py-2 text-left text-xs font-medium text-gray-500",children:"Reason / Error"})]})}),(0,s.jsx)("tbody",{className:"divide-y",children:l.map((e,t)=>{var a,l,r,i,n,c,d;let o=e.name||(null===(l=e.extractedData)||void 0===l?void 0:null===(a=l.personalInfo)||void 0===a?void 0:a.name)||"",u=e.email||(null===(i=e.extractedData)||void 0===i?void 0:null===(r=i.personalInfo)||void 0===r?void 0:r.email)||"",x=e.fileName||e.originalFileName||"File ".concat(t+1),m=e.saved||e.savedToDatabase,p=e.isDuplicate||(null===(n=e.emailDuplicationCheck)||void 0===n?void 0:n.isDuplicate),h=e.errorMessage||(null===(c=e.errorDetails)||void 0===c?void 0:c.hasError),g=e.errorMessage||(null===(d=e.errorDetails)||void 0===d?void 0:d.errorMessage)||"",y=e.status||e.validationStatus||e.processingStatus||"unknown";return(0,s.jsxs)("tr",{className:"".concat(h?"bg-red-50/40":p?"bg-amber-50/40":""),children:[(0,s.jsx)("td",{className:"px-3 py-2 text-xs text-gray-600 max-w-[150px] truncate",title:x,children:x}),(0,s.jsx)("td",{className:"px-3 py-2 text-xs font-medium",children:o||(0,s.jsx)("span",{className:"text-gray-300",children:"—"})}),(0,s.jsx)("td",{className:"px-3 py-2 text-xs text-gray-600",children:u||(0,s.jsx)("span",{className:"text-gray-300",children:"—"})}),(0,s.jsx)("td",{className:"px-3 py-2 text-center",children:m?(0,s.jsx)(et.E,{className:"bg-green-100 text-green-700 text-[10px]",children:"Saved"}):p?(0,s.jsx)(et.E,{className:"bg-amber-100 text-amber-700 text-[10px]",children:"Duplicate"}):h?(0,s.jsx)(et.E,{className:"bg-red-100 text-red-700 text-[10px]",children:"Error"}):"valid"===y?(0,s.jsx)(et.E,{className:"bg-blue-100 text-blue-700 text-[10px]",children:"Valid"}):(0,s.jsx)(et.E,{className:"bg-gray-100 text-gray-600 text-[10px]",children:y})}),(0,s.jsx)("td",{className:"px-3 py-2 text-xs max-w-[200px]",children:h?(0,s.jsx)("span",{className:"text-red-600",children:g}):p?(0,s.jsx)("span",{className:"text-amber-600",children:"Email already exists"}):m?(0,s.jsx)("span",{className:"text-green-600",children:"Parsed and saved"}):(0,s.jsx)("span",{className:"text-gray-400",children:"—"})})]},e._id||t)})})]})})]},t)})]})}var es=a(14512),el=a(98097),er=a(33566),ei=a(8220),en=a(89923),ec=a(6402);let ed=e=>{let{label:t,options:a,selectedValues:l,onChange:i,placeholder:n="Type to search...",leftIcon:c,required:d=!1,onInputChange:o}=e,[u,x]=(0,r.useState)(!1),[m,p]=(0,r.useState)(""),g=(0,r.useRef)(null),y=(0,r.useRef)(null),f=a.filter(e=>e.label.toLowerCase().includes(m.toLowerCase())&&!l.includes(e.value)),b=e=>{l.includes(e)||i([...l,e]),p(""),x(!1)},j=e=>{i(l.filter(t=>t!==e))};return(0,r.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&(x(!1),p(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,s.jsxs)("div",{className:"relative",ref:g,children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:[t,d&&(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:c&&(0,s.jsx)(c,{className:"h-5 w-5 text-gray-400"})}),(0,s.jsx)("input",{ref:y,type:"text",value:m,onChange:e=>{p(e.target.value),x(!0),o&&o(e.target.value)},onFocus:()=>x(!0),className:"block w-full ".concat(c?"pl-10":"pl-3"," pr-10 py-2 bg-primary-100 border border-gray-200 rounded-md h-[45px] focus:bg-white focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500"),placeholder:n}),(0,s.jsx)("div",{className:"absolute inset-y-0 right-0 pr-3 flex items-center",children:(0,s.jsx)(W.A,{className:"h-5 w-5 text-gray-400 transition-transform ".concat(u?"rotate-180":"")})})]}),u&&(0,s.jsx)("div",{className:"absolute z-10 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-60 overflow-auto",children:f.length>0?f.map(e=>(0,s.jsx)("button",{dangerouslySetInnerHTML:{__html:"string"==typeof e.label?e.label.replace(/<[^>]*>/g,""):e.label},onClick:()=>b(e.value),className:"w-full text-left px-3 py-2 hover:bg-gray-100 focus:outline-none focus:bg-gray-100"},e.value)):(0,s.jsx)("div",{className:"px-3 py-2 text-gray-500 text-sm",children:m?"No matches found":"Start typing to search..."})}),l.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2 mt-2",children:l.map(e=>{let t=a.find(t=>t.value===e);return t?t.label:e}).map((e,t)=>(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-blue-100 text-blue-800 text-sm rounded-full",children:[e.replace(/<[^>]*>/g,""),(0,s.jsx)("button",{onClick:()=>j(l[t]),className:"hover:bg-blue-200 rounded-full p-0.5",children:(0,s.jsx)(h.A,{className:"w-3 h-3"})})]},l[t]))})]})};var eo=a(95773),eu=a(82035),ex=a(23572);let em=[{value:"₹",label:"₹ INR"},{value:"$",label:"$ USD"},{value:"€",label:"€ EUR"}],ep=Array.from({length:100},(e,t)=>({value:(t+1).toString(),label:"".concat(t+1," Lac").concat(t>0?"s":"")})),eh=Array.from({length:100},(e,t)=>({value:t.toString(),label:"".concat(t," Thousand").concat(1!==t?"s":"")}));function eg(e){var t,a,l,i,n,c,d,o;let{onClose:u,onSave:x,initialData:m,isEditing:p=!1}=e,g=(0,S.wA)(),{isCreatingCandidate:y=!1,createCandidateResponse:f,
1isUpdatingCandidate:b=!1,updateCandidateResponse:j}=(0,S.d4)(e=>(null==e?void 0:e.clientReducer)||{}),{locationSuggestions:N}=(0,S.d4)(e=>e.commonReducer),[k,E]=(0,r.useState)(m||{source:"Internal Upload",willingToRelocate:!1,skills:[],languageSkills:[],salaryType:"Annual"}),[D,O]=(0,r.useState)(""),[L,M]=(0,r.useState)(""),[R,U]=(0,r.useState)(null),[z,F]=(0,r.useState)(""),[I,B]=(0,r.useState)(!1),[q,K]=(0,r.useState)("₹"),[W,V]=(0,r.useState)(""),[$,Z]=(0,r.useState)(""),[H,J]=(0,r.useState)(""),[G,Y]=(0,r.useState)(""),[X,Q]=(0,r.useState)({currentSalaryLacs:"",currentSalaryThousands:"",expectedSalaryLacs:"",expectedSalaryThousands:""});(0,r.useEffect)(()=>{f&&(C.toast.success("Candidate created successfully!"),g((0,A.LO)({params:{page:1,limit:10}})),x(k),u())},[f,g,k,x,u]),(0,r.useEffect)(()=>{j&&(C.toast.success("Candidate updated successfully!"),g((0,A.LO)({params:{page:1,limit:10}})),x(k),u())},[j,g,k,x,u]),(0,r.useEffect)(()=>{if(m){if(m.resumeUrl&&F(m.resumeUrl),m.currentSalary){let e=m.currentSalary,t=Math.floor(e),a=Math.round((e-t)*100);V(t>0?t.toString():""),Z(a>0?a.toString():"")}if(m.expectedSalary){let e=m.expectedSalary,t=Math.floor(e),a=Math.round((e-t)*100);J(t>0?t.toString():""),Y(a>0?a.toString():"")}m.currencyType&&K({INR:"₹",USD:"$",EUR:"€"}[m.currencyType]||"₹")}},[m]);let ee=(e,t)=>{let a=parseInt(e||"0")+parseInt(t||"0")/100;E(e=>({...e,currentSalary:a>0?Number(a.toFixed(2)):void 0}))},ea=(e,t)=>{let a=parseInt(e||"0")+parseInt(t||"0")/100;E(e=>({...e,expectedSalary:a>0?Number(a.toFixed(2)):void 0}))},es=e=>{let t={"₹":"INR",$:"USD","€":"EUR"};E(a=>({...a,currencyType:t[e]||"INR"}))},eg=async e=>{var t,a;B(!0),U(e);let s=new FormData;s.append("resume",e),g((0,ex.VW)({data:s,cb:e=>{var t;let a=(null==e?void 0:null===(t=e.file)||void 0===t?void 0:t.url)||(null==e?void 0:e.url)||(null==e?void 0:e.resumeUrl);a&&F(a)},errorCB:()=>{}}));try{let a=new FormData;a.append("resume",e);let s=await P.default.post("/client/resume-upload/parse-only",a,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4}),l=null==s?void 0:null===(t=s.data)||void 0===t?void 0:t.data;l&&(E(e=>{var t,a,s,r;return{...e,firstName:l.firstName||e.firstName||"",lastName:l.lastName||e.lastName||"",email:l.email||e.email||"",contactNumber:l.contactNumber||e.contactNumber||"",positionTitle:l.positionTitle||e.positionTitle||"",currentOrganization:l.currentOrganization||e.currentOrganization||"",totalExperience:l.totalExperience||e.totalExperience||0,skills:(null===(t=l.skills)||void 0===t?void 0:t.length)>0?l.skills:e.skills||[],city:l.city||e.city||"",state:l.state||e.state||"",country:l.country||e.country||"",fullAddress:l.fullAddress||e.fullAddress||"",qualification:l.qualification||e.qualification||"",specialization:l.specialization||e.specialization||"",summary:l.summary||e.summary||"",linkedinProfileUrl:l.linkedinProfileUrl||e.linkedinProfileUrl||"",githubProfileUrl:l.githubProfileUrl||e.githubProfileUrl||"",workExperience:(null===(a=l.workExperience)||void 0===a?void 0:a.length)>0?l.workExperience:e.workExperience||[],education:(null===(s=l.education)||void 0===s?void 0:s.length)>0?l.education:e.education||[],languageSkills:(null===(r=l.languageSkills)||void 0===r?void 0:r.length)>0?l.languageSkills:e.languageSkills||[]}}),C.toast.success("Resume parsed — fields auto-filled!"))}catch(e){console.error("Resume parse failed:",e),(null==e?void 0:null===(a=e.response)||void 0===a?void 0:a.status)===402?await (0,_.W)(e,"Wallet balance too low for resume auto-fill"):C.toast.info("Resume uploaded but auto-fill unavailable.")}B(!1)},ey=e=>e.replace(/<[^>]*>/g,""),ef=()=>{var e;!D.trim()||(null===(e=k.skills)||void 0===e?void 0:e.includes(D.trim()))||(E({...k,skills:[...k.skills||[],D.trim()]}),O(""))},eb=e=>{var t;E({...k,skills:null===(t=k.skills)||void 0===t?void 0:t.filter(t=>t!==e)})},ej=()=>{var e;!L.trim()||(null===(e=k.languageSkills)||void 0===e?void 0:e.includes(L.trim()))||(E({...k,languageSkills:[...k.languageSkills||[],L.trim()]}),M(""))},ev=e=>{var t;E({...k,languageSkills:null===(t=k.languageSkills)||void 0===t?void 0:t.filter(t=>t!==e)})};return(0,s.jsx)("div",{className:"flex flex-col h-full bg-background",children:(0,s.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),!k.firstName||!k.lastName||!k.email||!k.contactNumber){C.toast.error("Please fill in all required fields");return}if(Object.values(X).some(e=>
1""!==e)){C.toast.error("Please fix salary validation errors before submitting");return}if((W||$)&&(!W||"0"===W)){C.toast.error("Please select a valid current salary in lacs");return}if(H||G){if(!H||"0"===H){C.toast.error("Please select a valid expected salary in lacs");return}if(k.currentSalary&&k.expectedSalary&&k.expectedSalary<=k.currentSalary){C.toast.error("Expected salary should be higher than current salary");return}}let t={firstName:k.firstName,lastName:k.lastName,email:k.email,contactNumber:k.contactNumber,totalExperience:k.totalExperience||0,positionTitle:k.position||"",skills:k.skills||[],city:k.city||"",fullAddress:k.fullAddress||"",gender:k.gender||"",dateOfBirth:k.dateOfBirth||"",currentOrganization:k.currentOrganization||"",summary:k.summary||"",resumeUrl:z||k.resumeUrl||"",salaryType:"Annual",currentSalary:k.currentSalary||void 0,expectedSalary:k.expectedSalary||void 0,currencyType:k.currencyType||"INR",workExperience:k.workExperience||[],education:k.education||[],certifications:(k.certifications||[]).filter(e=>{var t;return null===(t=e.name)||void 0===t?void 0:t.trim()}),relevantExperience:k.relevantExperience||k.totalExperience||0,currentEmploymentStatus:k.currentEmploymentStatus||"",noticePeriodDays:k.noticePeriodDays||0,linkedinProfileUrl:k.linkedinUrl||"",githubProfileUrl:k.githubUrl||"",twitterProfileUrl:k.twitterUrl||"",facebookProfileUrl:k.facebookUrl||"",languageSkills:k.languageSkills||[],note:k.note||""};p&&(null==m?void 0:m.id)?g((0,A.jy)({candidateId:m.id,data:t})):(console.log("CREATE MODE: isEditing =",p,"initialData =",m),g((0,A.Yf)({data:t})))},className:"flex-1 overflow-auto",children:[(0,s.jsxs)("div",{className:"space-y-6 max-w-4xl mx-auto",children:[(0,s.jsxs)(er.Zp,{children:[(0,s.jsxs)(er.aR,{children:[(0,s.jsx)(er.ZB,{children:"Basic Information"}),(0,s.jsx)(er.BT,{children:"Personal details and contact information"})]}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(en.A,{label:"First Name",required:!0,value:k.firstName||"",onChange:e=>E({...k,firstName:e.target.value})}),(0,s.jsx)(en.A,{label:"Last Name",required:!0,value:k.lastName||"",onChange:e=>E({...k,lastName:e.target.value})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(en.A,{label:"Email",type:"email",required:!0,value:k.email||"",onChange:e=>E({...k,email:e.target.value})}),(0,s.jsx)(en.A,{label:"Contact Number",type:"tel",required:!0,value:k.contactNumber||"",onChange:e=>E({...k,contactNumber:e.target.value})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(ec.A,{label:"Gender",value:k.gender,onChange:e=>E({...k,gender:e}),optionArray:[{value:"Male",label:"Male"},{value:"Female",label:"Female"},{value:"Other",label:"Other"}],placeholder:"Select gender"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2 text-gray-700",children:"Date of Birth"}),(0,s.jsx)(eu.A,{initialView:"fullDate",name:"dateOfBirth",placeholder:"DD/MM/YYYY",maxDate:new Date().toISOString().split("T")[0],formik:{values:{dateOfBirth:k.dateOfBirth||""},setFieldValue:(e,t)=>E({...k,dateOfBirth:t||""})}})]})]})]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsxs)(er.aR,{children:[(0,s.jsx)(er.ZB,{children:"Resume"}),(0,s.jsx)(er.BT,{children:"Upload your resume (PDF, DOC, DOCX)"})]}),(0,s.jsx)(er.Wu,{className:"space-y-4",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("div",{className:"flex items-center justify-center w-full",children:(0,s.jsxs)("label",{className:"flex flex-col items-center justify-center w-full h-32 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 hover:bg-gray-100",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,s.jsx)(T.A,{className:"w-8 h-8 mb-4 text-gray-500"}),(0,s.jsxs)("p",{className:"mb-2 text-sm text-gray-500",children:[(0,s.jsx)("span",{className:"font-semibold",children:"Click to upload"})," or drag and drop"]}),(0,s.jsx)("p",{className:"text-xs text-gray-500",children:"PDF, DOC, or DOCX (MAX. 10MB)"})]}),(0,s.jsx)("input",{type:"file",className:"hidden",accept:".pdf,.doc,.docx",onChange:e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];a&&eg(a)}})]})}),I&&(0,s.jsx)("div",{className:"flex items-center justify-center",children:(0,s.jsx)("div",{className:"text-sm text-blue-600",children:"Uploading resume..."})}),(R||z||k.resumeUrl)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-3 bg-green-50 border border-green-200 rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(T.A,{className:"w-4 h-4 text-green-600"}),(0,s.jsx)("span",{className:"text-sm text-green-800",children:(null==R?void 0:R.name)||"Resume uploaded successfully"})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{U(null),F(""),E({...k,resumeUrl:""})},className:"text-red-600 hover:text-red-800",children:(0,s.jsx)(h.A,{className:"w-4 h-4"})})]})]})})]}
1),(0,s.jsxs)(er.Zp,{children:[(0,s.jsx)(er.aR,{children:(0,s.jsx)(er.ZB,{children:"Location Information"})}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsx)(ed,{label:"Full Address",options:N?N.map(e=>({label:ey(e),value:ey(e)})):[],selectedValues:k.fullAddress?[k.fullAddress]:[],onChange:e=>{let t=e.length>0?e[0]:"";E({...k,fullAddress:t})},onInputChange:e=>{e&&e.trim()&&g((0,ex.ir)({data:e}))},placeholder:"Search and select location..."})}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)("label",{htmlFor:"willingToRelocate",children:"Willing to Relocate"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Is the candidate open to relocation?"})]}),(0,s.jsx)(ei.d,{id:"willingToRelocate",checked:k.willingToRelocate||!1,onCheckedChange:e=>E({...k,willingToRelocate:e})})]})]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsx)(er.aR,{children:(0,s.jsx)(er.ZB,{children:"Professional Information"})}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(en.A,{label:"Position/Title",value:k.position||"",onChange:e=>E({...k,position:e.target.value})}),(0,s.jsx)(en.A,{label:"Current Organization",value:k.currentOrganization||"",onChange:e=>E({...k,currentOrganization:e.target.value})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(en.A,{label:"Total Experience (years)",type:"number",value:(null===(t=k.totalExperience)||void 0===t?void 0:t.toString())||"",onChange:e=>E({...k,totalExperience:Number.parseFloat(e.target.value)})}),(0,s.jsx)(en.A,{label:"Relevant Experience (years)",type:"number",value:(null===(a=k.relevantExperience)||void 0===a?void 0:a.toString())||"",onChange:e=>E({...k,relevantExperience:Number.parseFloat(e.target.value)})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(ec.A,{label:"Employment Status",value:k.currentEmploymentStatus,onChange:e=>E({...k,currentEmploymentStatus:e}),optionArray:[{value:"Employed",label:"Employed"},{value:"Unemployed",label:"Unemployed"},{value:"Freelance",label:"Freelance"},{value:"Contract",label:"Contract"},{value:"Self-Employed",label:"Self-Employed"}],placeholder:"Select status"}),(0,s.jsx)(en.A,{label:"Notice Period (days)",type:"number",value:(null===(l=k.noticePeriod)||void 0===l?void 0:l.toString())||"",onChange:e=>E({...k,noticePeriod:Number.parseInt(e.target.value)})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"summary",children:"Summary"}),(0,s.jsx)(eo.A,{id:"summary",rows:4,placeholder:"Brief professional summary...",value:k.summary||"",onChange:e=>E({...k,summary:e.target.value})})]})]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsx)(er.aR,{children:(0,s.jsx)(er.ZB,{children:"Compensation (Annual)"})}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Currency"}),(0,s.jsx)("div",{className:"w-40",children:(0,s.jsx)(ec.A,{optionArray:em,closeMenuOnSelect:!0,state:q?{value:q,label:(null===(i=em.find(e=>e.value===q))||void 0===i?void 0:i.label)||""}:{value:"₹",label:"₹ INR"},onChangeFunction:e=>{let t=(null==e?void 0:e.value)||"₹";K(t),es(t)},placeholder:"Currency",variant:"input",height:"45px"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Current Salary (LPA)",(0,s.jsx)("span",{className:"text-xs text-gray-500 font-normal ml-2",children:"Optional"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 items-start",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-600 mb-1",children:"Lacs"}),(0,s.jsx)(ec.A,{closeMenuOnSelect:!0,optionArray:ep,state:W?{value:W,label:(null===(n=ep.find(e=>e.value===W))||void 0===n?void 0:n.label)||""}:null,onChangeFunction:e=>{let t=(null==e?void 0:e.value)||"";if(Q(e=>({...e,currentSalaryLacs:""})),t&&(isNaN(Number(t))||1>Number(t)||Number(t)>100)){Q(e=>({...e,currentSalaryLacs:"Lacs value must be between 1 and 100"}));return}V(t),ee(t,$)},placeholder:"Select Lacs",variant:"input",height:"45px"}),X.currentSalaryLacs&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-600",children:X.currentSalaryLacs})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-600 mb-1",children:"Thousands"}),(0,s.jsx)(ec.A,{closeMenuOnSelect:!0,optionArray:eh,state:$?{value:$,label:(null===(c=eh.find(e=>e.value===$))||void 0===c?void 0:c.label)||""}:null,onChangeFunction:e=>{let t=(null==e?void 0:e.value)||"";if(Q(e=>({...e,currentSalaryThousands:""})),t&&(isNaN(Number(t))||0>Number(t)||Number(t)>99)){Q(e=>({...e,currentSalaryThousands:"Thousands value must be between 0 and 99"}));return}Z(t),ee(W,t)},placeholder:"Select Thousands",variant:"input",height:"45px"}),X.currentSalaryThousands&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-600",children:X.currentSalaryThousands})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Expected Salary (LPA)",(0,s.jsx)("span",{className:"text-xs text-gray-500 font-normal ml-2",children:"Optional"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 items-start",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-600 mb-1",children:"Lacs"}),(0,s.jsx)(ec.A,{closeMenuOnSelect:!0,optionArray:(e=>{let t=parseInt(e||"0");return ep.filter(e=>parseInt(e.value)>t)})(W),state:H?{value:H,label:(null===(d=ep.find(e=>e.value===H))||void 0===d?void 0:d.label)||""}:null,onChangeFunction:e=>{let t=(null==e?void 0:e.value)||"";if(Q(e=>({...e,expectedSalaryLacs:""})),t&&(isNaN(Number(t))||1>Number(t)||Number(t)>100)){Q(e=>({...e,expectedSalaryLacs:"Lacs value must be between 1 and 100"}));return}if(W&&t){let e=Number(W);if(Number(t)<e){Q(e=>({...e,expectedSalaryLacs:"Expected salary should be equal to or higher than current salary"}));return}}J(t),ea(t,G)},placeholder:"Select Lacs",variant:"input",height:"45px"}),X.expectedSalaryLacs&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-600",children:X.expectedSalaryLacs})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs text-gray-600 mb-1",children:"Thousands"}),(0,s.jsx)(ec.A,{closeMenuOnSelect:!0,optionArray:((e,t,a)=>{let s=parseInt(e||"0"),l=parseInt(t||"0"),r=parseInt(a||"0");return l>s?eh:l===s?eh.filter(e=>parseInt(e.value)>r):eh})(W,H,$),state:G?{value:G,label:(null===(o=eh.find(e=>e.value===G))||void 0===o?void 0:o.label)||""}:null,onChangeFunction:e=>{let t=(null==e?void 0:e.value)||"";if(Q(e=>({...e,expectedSalaryThousands:""})),t&&(isNaN(Number(t))||0>Number(t)||Number(t)>99)){Q(e=>({...e,expectedSalaryThousands:"Thousands value must be between 0 and 99"}));return}if(W&&H&&t){let e=1e5*Number(W)+1e3*Number($||"0");if(1e5*Number(H)+1e3*Number(t)<e){Q(e=>({...e,expectedSalaryThousands:"Expected salary should be equal to or higher than current salary"}));return}}Y(t),ea(H,t)},placeholder:"Select Thousands",variant:"input",height:"45px"}),X.expectedSalaryThousands&&(0,s.jsx)("p",{className:"mt-1 text-xs text-red-600",children:X.expectedSalaryThousands})]})]})]})]})]}
1),(0,s.jsxs)(er.Zp,{children:[(0,s.jsx)(er.aR,{children:(0,s.jsx)(er.ZB,{children:"Skills"})}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(en.A,{placeholder:"Add a skill...",value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ef())},fullWidth:!0}),(0,s.jsx)(w.$,{type:"button",onClick:ef,size:"icon",children:(0,s.jsx)(el.A,{className:"h-4 w-4"})})]}),k.skills&&k.skills.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:k.skills.map(e=>(0,s.jsxs)(et.E,{variant:"secondary",className:"gap-1",children:[e,(0,s.jsx)("button",{type:"button",onClick:()=>eb(e),className:"ml-1 hover:text-destructive",children:(0,s.jsx)(h.A,{className:"h-3 w-3"})})]},e))})]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsx)(er.aR,{children:(0,s.jsx)(er.ZB,{children:"Language Skills"})}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(en.A,{placeholder:"Add a language...",value:L,onChange:e=>M(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ej())},fullWidth:!0}),(0,s.jsx)(w.$,{type:"button",onClick:ej,size:"icon",children:(0,s.jsx)(el.A,{className:"h-4 w-4"})})]}),k.languageSkills&&k.languageSkills.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:k.languageSkills.map(e=>(0,s.jsxs)(et.E,{variant:"outline",className:"gap-1",children:[e,(0,s.jsx)("button",{type:"button",onClick:()=>ev(e),className:"ml-1 hover:text-destructive",children:(0,s.jsx)(h.A,{className:"h-3 w-3"})})]},e))})]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsxs)(er.aR,{className:"flex flex-row items-center justify-between",children:[(0,s.jsx)(er.ZB,{children:"Work Experience"}),(0,s.jsxs)(w.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e=k.workExperience||[];E({...k,workExperience:[...e,{company:"",position:"",startDate:"",endDate:"",description:"",isCurrentJob:!1}]})},children:[(0,s.jsx)(el.A,{className:"h-4 w-4 mr-1"})," Add Experience"]})]}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[0===(k.workExperience||[]).length&&(0,s.jsx)("p",{className:"text-sm text-gray-400 text-center py-4",children:'No work experience added. Click "Add Experience" to add.'}),(k.workExperience||[]).map((e,t)=>(0,s.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 space-y-3 relative",children:[(0,s.jsx)("button",{type:"button",className:"absolute top-3 right-3 text-gray-400 hover:text-red-500",onClick:()=>{let e=[...k.workExperience||[]];e.splice(t,1),E({...k,workExperience:e})},children:(0,s.jsx)(v.A,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,s.jsx)(en.A,{label:"Position/Title",placeholder:"e.g. Senior Software Engineer",value:e.position||"",onChange:e=>{let a=[...k.workExperience||[]];a[t]={...a[t],position:e.target.value},E({...k,workExperience:a})}}),(0,s.jsx)(en.A,{label:"Company",placeholder:"e.g. Google",value:e.company||"",onChange:e=>{let a=[...k.workExperience||[]];a[t]={...a[t],company:e.target.value},E({...k,workExperience:a})}}),(0,s.jsx)(en.A,{label:"Start Date",placeholder:"e.g. Jan 2020",value:e.startDate||"",onChange:e=>{let a=[...k.workExperience||[]];a[t]={...a[t],startDate:e.target.value},E({...k,workExperience:a})}}),(0,s.jsx)(en.A,{label:"End Date",placeholder:"Present or e.g. Dec 2023",value:e.isCurrentJob?"Present":e.endDate||"",onChange:e=>{let a=[...k.workExperience||[]],s=e.target.value;a[t]={...a[t],endDate:s,isCurrentJob:"present"===s.toLowerCase()},E({...k,workExperience:a})}})]}),(0,s.jsx)(eo.A,{id:"exp-desc-".concat(t),rows:6,placeholder:"Brief description of responsibilities...",value:e.description||"",className:"resize-y min-h-[120px] whitespace-pre-wrap",onChange:e=>{let a=[...k.workExperience||[]];a[t]={...a[t],description:e.target.value},E({...k,workExperience:a})}})]},t))]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsxs)(er.aR,{className:"flex flex-row items-center justify-between",children:[(0,s.jsx)(er.ZB,{children:"Education"}),(0,s.jsxs)(w.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e=k.education||[];E({...k,education:[...e,{institution:"",degree:"",field:"",startDate:"",endDate:"",grade:""}]})},children:[(0,s.jsx)(el.A,{className:"h-4 w-4 mr-1"})," Add Education"]})]}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[0===(k.education||[]).length&&(0,s.jsx)("p",{className:"text-sm text-gray-400 text-center py-4",children:'No education added. Click "Add Education" to add.'}),(k.education||[]).map((e,t)=>(0,s.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 space-y-3 relative",children:[(0,s.jsx)("button",{type:"button",className:"absolute top-3 right-3 text-gray-400 hover:text-red-500",onClick:()=>{let e=[...k.education||[]];e.splice(t,1),E({...k,education:e})},children:(0,s.jsx)(v.A,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[(0,s.jsx)(en.A,{label:"Degree",placeholder:"e.g. Bachelor of Technology",value:e.degree||"",onChange:e=>{let a=[...k.education||[]];a[t]={...a[t],degree:e.target.value},E({...k,education:a})}}),(0,s.jsx)(en.A,{label:"Field of Study",placeholder:"e.g. Computer Science",value:e.field||"",onChange:e=>{let a=[...k.education||[]];a[t]={...a[t],field:e.target.value},E({...k,education:a})}}),(0,s.jsx)(en.A,{label:"Institution",placeholder:"e.g. IIT Delhi",value:e.institution||"",onChange:e=>{let a=[...k.education||[]];a[t]={...a[t],institution:e.target.value},E({...k,education:a})}}),(0,s.jsx)(en.A,{label:"Grade/GPA",placeholder:"e.g. 8.5/10 or First Class",value:e.grade||"",onChange:e=>{let a=[...k.education||[]];a[t]={...a[t],grade:e.target.value},E({...k,education:a})}}),(0,s.jsx)(en.A,{label:"Start Date",placeholder:"e.g. 2016",value:e.startDate||"",onChange:e=>{let a=[...k.education||[]];a[t]={...a[t],startDate:e.target.value},E({...k,education:a})}}),(0,s.jsx)(en.A,{label:"End Date",placeholder:"e.g. 2020",value:e.endDate||"",onChange:e=>{let a=[...k.education||[]];a[t]={...a[t],endDate:e.target.value},E({...k,education:a})}})]})]},t))]})]}
1),(0,s.jsxs)(er.Zp,{children:[(0,s.jsxs)(er.aR,{className:"flex flex-row items-center justify-between",children:[(0,s.jsx)(er.ZB,{children:"Certifications"}),(0,s.jsxs)(w.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e=k.certifications||[];E({...k,certifications:[...e,{name:"",issuingOrganization:"",issueDate:""}]})},children:[(0,s.jsx)(el.A,{className:"h-4 w-4 mr-1"})," Add Certification"]})]}),(0,s.jsxs)(er.Wu,{className:"space-y-4",children:[0===(k.certifications||[]).length&&(0,s.jsx)("p",{className:"text-sm text-gray-400 text-center py-4",children:'No certifications added. Click "Add Certification" to add.'}),(k.certifications||[]).map((e,t)=>(0,s.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 relative",children:[(0,s.jsx)("button",{type:"button",className:"absolute top-3 right-3 text-gray-400 hover:text-red-500",onClick:()=>{let e=[...k.certifications||[]];e.splice(t,1),E({...k,certifications:e})},children:(0,s.jsx)(v.A,{className:"h-4 w-4"})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,s.jsx)(en.A,{label:"Certification Name",placeholder:"e.g. AWS Solutions Architect",value:e.name||"",onChange:e=>{let a=[...k.certifications||[]];a[t]={...a[t],name:e.target.value},E({...k,certifications:a})}}),(0,s.jsx)(en.A,{label:"Issuing Organization",placeholder:"e.g. Amazon Web Services",value:e.issuingOrganization||"",onChange:e=>{let a=[...k.certifications||[]];a[t]={...a[t],issuingOrganization:e.target.value},E({...k,certifications:a})}}),(0,s.jsx)(en.A,{label:"Date",placeholder:"e.g. Jan 2024",value:e.issueDate||"",onChange:e=>{let a=[...k.certifications||[]];a[t]={...a[t],issueDate:e.target.value},E({...k,certifications:a})}})]})]},t))]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsx)(er.aR,{children:(0,s.jsx)(er.ZB,{children:"Social Profiles"})}),(0,s.jsxs)(er.Wu,{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,s.jsx)(en.A,{label:"LinkedIn Profile URL",type:"url",placeholder:"https://linkedin.com/in/...",value:k.linkedinUrl||"",onChange:e=>E({...k,linkedinUrl:e.target.value})}),(0,s.jsx)(en.A,{label:"GitHub Profile URL",type:"url",placeholder:"https://github.com/...",value:k.githubUrl||"",onChange:e=>E({...k,githubUrl:e.target.value})}),(0,s.jsx)(en.A,{label:"Twitter Profile URL",type:"url",placeholder:"https://twitter.com/...",value:k.twitterUrl||"",onChange:e=>E({...k,twitterUrl:e.target.value})}),(0,s.jsx)(en.A,{label:"Facebook Profile URL",type:"url",placeholder:"https://facebook.com/...",value:k.facebookUrl||"",onChange:e=>E({...k,facebookUrl:e.target.value})})]})]}),(0,s.jsxs)(er.Zp,{children:[(0,s.jsx)(er.aR,{children:(0,s.jsx)(er.ZB,{children:"Notes"})}),(0,s.jsx)(er.Wu,{children:(0,s.jsx)(eo.A,{id:"note",rows:4,placeholder:"Add any additional notes about the candidate...",value:k.note||"",onChange:e=>E({...k,note:e.target.value})})})]})]}),(0,s.jsxs)("div",{className:"pt-6 bg-background flex justify-end gap-2 sticky bottom-0",children:[(0,s.jsx)(w.$,{type:"button",variant:"outline",onClick:u,children:"Cancel"}),(0,s.jsx)(w.$,{type:"submit",disabled:y||b,children:y||b?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),p?"Updating...":"Creating..."]}):p?"Update Candidate":"Save Candidate"})]})]})})}var ey=a(4853),ef=a(86715),eb=a(64903),ej=a(18441);function ev(){var e;let t=(0,S.wA)(),a=(0,ef.useRouter)(),{editProfileModal:i,sendEmailModal:n}=(0,S.d4)(e=>e.eventReducer),c=(0,S.d4)(e=>{var t;return null===(t=e.clientReducer)||void 0===t?void 0:t.oauthStatus}),d=(0,S.d4)(e=>{var t;return null===(t=e.clientReducer)||void 0===t?void 0:t.emailConfig});(0,r.useEffect)(()=>{t((0,A._l)({hideErrorMsg:!0})),t((0,A.tw)({hideErrorMsg:!0}))},[t]);let o=(null==c?void 0:c.providerEmail)||(null==d?void 0:d.providerEmail)||"[email protected]",u=(0,r.useRef)(null),[x,m]=(0,r.useState)(null),[p,h]=(0,r.useState)(!1),[g,y]=(0,r.useState)(!1),[f,b]=(0,r.useState)(!1),[j,v]=(0,r.useState)(!1),[N,w]=(0,r.useState)([]),[k,C]=(0,r.useState)(""),[P,O]=(0,r.useState)(""),[L,M]=(0,r.useState)(1),[U,T]=(0,r.useState)(10),[z,F]=(0,r.useState)(null);(0,r.useEffect)(()=>
1{if(a.isReady&&"1"===a.query.bulkUpload){y(!0);let{bulkUpload:e,...t}=a.query;a.replace({pathname:a.pathname,query:t},void 0,{shallow:!0})}if(a.isReady&&a.query.viewCandidate){m(a.query.viewCandidate);let{viewCandidate:e,tab:t,...s}=a.query;a.replace({pathname:a.pathname,query:s},void 0,{shallow:!0})}},[a.isReady,a.query.bulkUpload,a.query.viewCandidate]);let I=()=>{t((0,E.L)({editProfileModal:{isOpen:!1,candidateData:null}}))},B=()=>{t((0,E.L)({sendEmailModal:{isOpen:!1,candidateData:null}}))};return(0,s.jsxs)(l.A,{children:[(0,s.jsx)(ey.bV,{title:"Candidates",description:"Manage your candidate pool, bulk-uploads, and candidate details on Olibr."}),(0,s.jsxs)("main",{className:"flex-1 overflow-y-auto",children:[x?(0,s.jsx)(es.f,{candidateId:x,onBack:()=>m(null),onSave:()=>{}}):(0,s.jsx)(R,{onSelectCandidate:e=>{m(e.id)},onNewCandidate:()=>h(!0),onBulkUpload:()=>y(!0),onCsvUpload:()=>b(!0),onUploadHistory:()=>v(!0),searchTags:N,onSearchTagsChange:w,sourceFilter:k,onSourceFilterChange:C,uploadedByFilter:P,onUploadedByFilterChange:O,currentPage:L,onCurrentPageChange:M,itemsPerPage:U,onItemsPerPageChange:T}),(0,s.jsx)(ej.A,{isOpen:p,onClose:()=>h(!1),content:(0,s.jsx)(eg,{onClose:()=>h(!1),onSave:e=>{h(!1)}}),width:"60vw",desktopDefaultToModal:!1,title:"Add New Candidate"}),z&&!z.isComplete&&!g&&(0,s.jsxs)("div",{className:"fixed bottom-4 right-4 z-50 bg-white border border-blue-200 rounded-xl shadow-lg p-4 w-80 cursor-pointer hover:shadow-xl transition-shadow",onClick:()=>y(!0),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-gray-700",children:"Processing resumes..."}),(0,s.jsxs)("span",{className:"text-sm font-bold text-blue-600",children:[z.processed,"/",z.total]})]}),(0,s.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full bg-blue-600 rounded-full transition-all duration-500",style:{width:"".concat(Math.round(z.processed/z.total*100),"%")}})}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1.5",children:"Click to view details"})]}),(0,s.jsx)(D.A,{isOpen:g,onClose:()=>y(!1),content:(0,s.jsx)(q,{onClose:()=>{y(!1),t((0,A.LO)({params:{page:1,limit:20}}))},onProgress:e=>F(e)}),maxWidth:"2xl",height:"auto",title:"Upload Resumes",hasFooter:!1,preventBackdropClose:!0}),(0,s.jsx)(D.A,{isOpen:f,onClose:()=>b(!1),content:(0,s.jsx)(X,{onClose:()=>{b(!1),t((0,A.LO)({params:{page:1,limit:20}}))},onComplete:()=>{t((0,A.LO)({params:{page:1,limit:20}}))}}),maxWidth:"4xl",height:"auto",title:"CSV Upload — Import Candidates",hasFooter:!1,preventBackdropClose:!0}),(0,s.jsx)(D.A,{isOpen:j,onClose:()=>v(!1),content:(0,s.jsx)(ea,{}),maxWidth:"4xl",height:"80vh",title:"Upload History — Bulk Uploaded Candidates",hasFooter:!1}),(0,s.jsx)(D.A,{isOpen:(null==n?void 0:n.isOpen)||!1,onClose:B,title:(null==n?void 0:null===(e=n.bulkRecipients)||void 0===e?void 0:e.length)>1?"Send Email To ".concat(n.bulkRecipients.length," Candidates"):"Send Email To Candidate",content:(0,s.jsx)(eb.R,{ref:u,fromEmail:o,recipients:(null==n?void 0:n.bulkRecipients)?n.bulkRecipients.map(e=>({email:e.email,name:"".concat(e.firstName||""," ").concat(e.lastName||"").trim()})):(null==n?void 0:n.candidateData)?[{email:n.candidateData.email,name:"".concat(n.candidateData.firstName||""," ").concat(n.candidateData.lastName||"").trim()}]:[],onSend:()=>{B()}}),maxWidth:"4xl",primaryButtonLabel:"SEND EMAIL",primaryButtonOnClick:()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.send()},secondaryButtonLabel:"CANCEL",secondaryButtonOnClick:B}),(0,s.jsx)(D.A,{isOpen:i.isOpen,onClose:I,content:(0,s.jsx)(eg,{onClose:I,onSave:e=>{var a,s;let l=(null===(a=i.candidateData)||void 0===a?void 0:a.id)||(null===(s=i.candidateData)||void 0===s?void 0:s._id);l&&(t((0,A.jy)({candidateId:l,candidateData:e})),t((0,E.L)({editProfileModal:{isOpen:!1,candidateData:null}})))},initialData:i.candidateData,isEditing:!0}),maxWidth:"6xl",height:"90vh",title:"Edit Candidate Profile",hasFooter:!1})]})]})}},23572:(e,t,a)=>{"use strict";a.d(t,{C_:()=>o,Jl:()=>c,TR:()=>i,VW:()=>n,gq:()=>x,i_:()=>d,ir:()=>r,vk:()=>l,zv:()=>u});var s=a(8);let l=e=>({type:s.t.UPLOAD_IMAGE,payload:e}),r=e=>({type:s.t.GET_LOCATION,payload:e}),i=e=>({type:s.t.GET_PERK_AND_BENEFIT,payload:e}),n=e=>({type:s.t.UPLOAD_RESUME,payload:e}),c=e=>({type:s.t.GET_CANDIDATE_PROFILE,payload:e}),d=e=>({type:s.t.GET_OPEN_JOB_LISTS,payload:e}),o=e=>({type:s.t.APPLLY_JOB,payload:e}),u=e=>({type:s.t.GET_APPLIED_JOB_LISTS,payload:e}),x=e=>({type:s.t.GET_JOB_BY_SLUG,payload:e})},79014:(e,t,a)=>{"use strict";a.d(t,{bL:()=>N,zi:()=>w});var s=a(96540),l=a(9957),r=a(91071),i=a(62133),n=a(81351),c=a(85357),d=a(31769),o=a(20078),u=a(74848),x="Switch",[m,p]=(0,i.A)(x),[h,g]=m(x),y=s.forwardRef((e,t)=>
1{let{__scopeSwitch:a,name:i,checked:c,defaultChecked:d,required:m,disabled:p,value:g="on",onCheckedChange:y,form:f,...b}=e,[N,w]=s.useState(null),k=(0,r.s)(t,e=>w(e)),C=s.useRef(!1),S=!N||f||!!N.closest("form"),[A,E]=(0,n.i)({prop:c,defaultProp:d??!1,onChange:y,caller:x});return(0,u.jsxs)(h,{scope:a,checked:A,disabled:p,children:[(0,u.jsx)(o.sG.button,{type:"button",role:"switch","aria-checked":A,"aria-required":m,"data-state":v(A),"data-disabled":p?"":void 0,disabled:p,value:g,...b,ref:k,onClick:(0,l.mK)(e.onClick,e=>{E(e=>!e),S&&(C.current=e.isPropagationStopped(),C.current||e.stopPropagation())})}),S&&(0,u.jsx)(j,{control:N,bubbles:!C.current,name:i,value:g,checked:A,required:m,disabled:p,form:f,style:{transform:"translateX(-100%)"}})]})});y.displayName=x;var f="SwitchThumb",b=s.forwardRef((e,t)=>{let{__scopeSwitch:a,...s}=e,l=g(f,a);return(0,u.jsx)(o.sG.span,{"data-state":v(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:t})});b.displayName=f;var j=s.forwardRef(({__scopeSwitch:e,control:t,checked:a,bubbles:l=!0,...i},n)=>{let o=s.useRef(null),x=(0,r.s)(o,n),m=(0,c.Z)(a),p=(0,d.X)(t);return s.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(m!==a&&t){let s=new Event("click",{bubbles:l});t.call(e,a),e.dispatchEvent(s)}},[m,a,l]),(0,u.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...i,tabIndex:-1,ref:x,style:{...i.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}j.displayName="SwitchBubbleInput";var N=y,w=b}},e=>{var t=t=>e(e.s=t);e.O(0,[3197,1106,399,8419,6902,607,2093,719,4976,4625,9993,9210,4642,4117,9923,45,8208,6400,4903,5440,636,6593,8792],()=>t(5137)),_N_E=e.O()}]);

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.