PageSourceSearch

https://trueresume.ai/_next/static/chunks/pages/admin/jobs-1ae9b54152796637.js

js trueresume.ai collected 2026-10-02 01:12:51 UTC 32,702 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[82],{69519:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/jobs",function(){return a(52134)}])},43765:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},185:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]])},60493:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},61258:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},4307:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},89354:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("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"}]])},43832:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]])},15928:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},3350:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},31855:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Pen",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}]])},4270:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},69819:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]])},36127:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},37864:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},89176:function(e,t,a){"use strict";a.d(t,{Z:function(){return s}});let s=(0,a(63759).Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},52134:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return D}});var s=a(85893),l=a(67294),r=a(9008),n=a.n(r),o=a(11163),d=a(85412),i=a(67694),c=a(61258),u=a(4270),x=a(89354),h=a(60493),m=a(43765),b=a(62190),p=a(37864),g=a(60641),y=a(36127),j=a(80893),v=a(185),f=a(3350),N=a(89176),k=a(43832),w=a(71707),S=a(31855),
1C=a(15928),F=a(4307),Z=a(69819);function D(){var e,t,a,r,Z,D,T,M,L,J,_,P,R,I,O;let{theme:z}=(0,i.F)(),U=(0,o.useRouter)(),[q,V]=(0,l.useState)([]),[B,G]=(0,l.useState)(!0),[H,K]=(0,l.useState)(""),[X,$]=(0,l.useState)("all"),[Q,W]=(0,l.useState)("all"),[Y,ee]=(0,l.useState)(1),[et,ea]=(0,l.useState)(1),[es,el]=(0,l.useState)(null),[er,en]=(0,l.useState)(!1),[eo,ed]=(0,l.useState)(!1),[ei,ec]=(0,l.useState)(""),[eu,ex]=(0,l.useState)(""),[eh,em]=(0,l.useState)(""),[eb,ep]=(0,l.useState)(!1),[eg,ey]=(0,l.useState)(""),[ej,ev]=(0,l.useState)(""),[ef,eN]=(0,l.useState)("createdAt"),[ek,ew]=(0,l.useState)("all"),[eS,eC]=(0,l.useState)("all"),[eF,eZ]=(0,l.useState)(!1),[eD,eE]=(0,l.useState)(null),[eA,eT]=(0,l.useState)(!1),[eM,eL]=(0,l.useState)(!1),[eJ,e_]=(0,l.useState)("");(0,l.useEffect)(()=>{let e=localStorage.getItem("admin_key");if(!e){U.push("/admin");return}ec(e),eP(e)},[Y,X,Q]),(0,l.useEffect)(()=>{let e=setTimeout(()=>{ei&&eP(ei)},500);return()=>clearTimeout(e)},[H]);let eP=async e=>{try{var t,a;G(!0);let s=new URLSearchParams({page:Y.toString(),limit:"20",search:H,source:X,status:Q}),l=await fetch("/api/admin/jobs?".concat(s),{headers:{"x-admin-key":e}});if(!l.ok)throw Error("Failed to fetch jobs");let r=null;try{r=await l.json()}catch(e){console.warn("Failed to parse jobs response as JSON:",e),r=null}if(!r||!Array.isArray(r.jobs)){console.warn("Unexpected jobs response payload:",r),V([]),ea((null==r?void 0:null===(a=r.pagination)||void 0===a?void 0:a.pages)?Number(r.pagination.pages):1);return}V(r.jobs),ea((null===(t=r.pagination)||void 0===t?void 0:t.pages)?Number(r.pagination.pages):1)}catch(e){ex(e.message)}finally{G(!1)}},eR=async(e,t)=>{try{if(!(await fetch("/api/admin/jobs",{method:"PUT",headers:{"x-admin-key":ei,"Content-Type":"application/json"},body:JSON.stringify({jobId:e,updates:{isActive:!t}})})).ok)throw Error("Failed to update job");em("Job ".concat(t?"deactivated":"activated"," successfully")),eP(ei),setTimeout(()=>em(""),3e3)}catch(e){ex(e.message)}},eI=async e=>{try{if(!(await fetch("/api/admin/jobs",{method:"PUT",headers:{"x-admin-key":ei,"Content-Type":"application/json"},body:JSON.stringify({jobId:null==es?void 0:es._id,updates:e})})).ok)throw Error("Failed to update job");em("Job updated successfully"),en(!1),eP(ei),setTimeout(()=>em(""),3e3)}catch(e){ex(e.message)}},eO=async e=>{if(confirm("Are you sure? This will delete the job and all applications."))try{let t;G(!0);let a=await fetch("/api/admin/jobs",{method:"DELETE",headers:{"x-admin-key":ei,"Content-Type":"application/json"},body:JSON.stringify({jobId:e})}),s=await a.text();try{t=JSON.parse(s)}catch(e){throw Error(s||"Failed to delete job")}if(!a.ok)throw Error((null==t?void 0:t.error)||"Failed to delete job");em("Job deleted successfully"),eP(ei),setTimeout(()=>em(""),3e3)}catch(e){ex(e.message||"Failed to delete job")}finally{G(!1)}},ez=async e=>{try{if(!(await fetch("/api/admin/jobs",{method:"POST",headers:{"x-admin-key":ei,"Content-Type":"application/json"},body:JSON.stringify({jobData:e})})).ok)throw Error("Failed to create job");em("Job created successfully"),ed(!1),eP(ei),setTimeout(()=>em(""),3e3)}catch(e){ex(e.message)}},eU=async()=>{if(!eg||!ej){ex("Please select both start and end dates");return}try{var e;let t;eT(!0),ex("");let a=await fetch("/api/admin/jobs-bulk-delete",{method:"POST",headers:{"x-admin-key":ei,"Content-Type":"application/json"},body:JSON.stringify({startDate:eg,endDate:ej,dateField:ef,country:ek,source:eS,includeActive:eF})}),s=await a.text();try{t=JSON.parse(s)}catch(e){throw Error(s||"Failed to preview - Invalid response")}if(!a.ok)throw Error((null==t?void 0:t.error)||"Failed to preview");if(!((e=t)&&"object"==typeof e&&e.counts&&"object"==typeof e.counts&&"number"==typeof e.counts.jobs&&"number"==typeof e.counts.applications&&"number"==typeof e.counts.total&&e.breakdown&&"object"==typeof e.breakdown&&Array.isArray(e.breakdown.byCountry)&&Array.isArray(e.breakdown.bySource)&&e.dateRange&&"object"==typeof e.dateRange))throw console.warn("Invalid bulk preview payload received:",t),Error("Preview returned unexpected data format");eE(t)}catch(e){ex(e.message||"Failed to preview"),eE(null)}finally{eT(!1)}},eq=async()=>
1{if("DELETE"!==eJ){ex("Type DELETE to confirm");return}try{var e,t,a;let s;eL(!0),ex("");let l=await fetch("/api/admin/jobs-bulk-delete",{method:"DELETE",headers:{"x-admin-key":ei,"Content-Type":"application/json"},body:JSON.stringify({startDate:eg,endDate:ej,dateField:ef,country:ek,source:eS,includeActive:eF,confirmationCode:"DELETE_CONFIRMED"})}),r=await l.text();try{s=JSON.parse(r)}catch(e){throw Error(r||"Failed to delete - Invalid response")}if(!l.ok)throw Error((null==s?void 0:s.error)||"Failed to delete");em("Successfully deleted ".concat((null===(e=s.deleted)||void 0===e?void 0:e.jobs)||0," jobs, ").concat((null===(t=s.deleted)||void 0===t?void 0:t.applications)||0," applications, and ").concat((null===(a=s.deleted)||void 0===a?void 0:a.artifacts)||0," artifacts")),eE(null),e_(""),ep(!1),eP(ei),setTimeout(()=>em(""),5e3)}catch(e){ex(e.message||"Failed to delete")}finally{eL(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n(),{children:(0,s.jsx)("title",{children:"Jobs Management - Admin Dashboard"})}),(0,s.jsx)(d.Z,{}),(0,s.jsxs)("div",{className:"min-h-screen pt-16 ".concat("dark"===z?"bg-[#030303]":"bg-gray-50"),children:[(0,s.jsx)("div",{className:"border-b ".concat("dark"===z?"bg-[#1A1A1B] border-[#343536]":"bg-white  border-[#EDEFF1]"),children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("button",{onClick:()=>U.push("/admin"),className:"p-2 rounded-lg ".concat("dark"===z?"hover:bg-[#272729]":"hover:bg-gray-100"),children:(0,s.jsx)(c.Z,{className:"w-5 h-5"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-sharp text-3xl font-bold",style:{fontFamily:"Rajdhani, sans-serif"},children:"Jobs Management"}),(0,s.jsxs)("p",{className:"text-sm mt-1 ".concat("dark"===z?"text-[#818384]":"text-gray-600"),children:[null!==(M=null==q?void 0:q.length)&&void 0!==M?M:0," jobs loaded"]})]})]}),(0,s.jsxs)("button",{onClick:()=>ed(!0),className:"btn-premium flex items-center gap-2",children:[(0,s.jsx)(u.Z,{className:"w-5 h-5"}),"Add Job"]}),(0,s.jsxs)("button",{onClick:()=>ep(!eb),className:"flex items-center gap-2 px-4 py-2 rounded-xl border transition-colors ".concat(eb?"bg-red-600 text-white border-red-600":"dark"===z?"border-red-500 text-red-400 hover:bg-red-500/20":"border-red-500 text-red-600 hover:bg-red-50"),children:[(0,s.jsx)(x.Z,{className:"w-5 h-5"}),"Bulk Delete"]})]})})}),(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[eh&&(0,s.jsxs)("div",{className:"mb-4 glass rounded-xl p-4 border-l-4 border-green-500 flex items-center gap-2",children:[(0,s.jsx)(h.Z,{className:"w-5 h-5 text-green-500"}),(0,s.jsx)("span",{children:eh})]}),eu&&(0,s.jsxs)("div",{className:"mb-4 glass rounded-xl p-4 border-l-4 border-red-500 flex items-center gap-2",children:[(0,s.jsx)(m.Z,{className:"w-5 h-5 text-red-500"}),(0,s.jsx)("span",{children:eu}),(0,s.jsx)("button",{onClick:()=>ex(""),className:"ml-auto",children:(0,s.jsx)(b.Z,{className:"w-4 h-4"})})]}),eb&&(0,s.jsxs)("div",{className:"glass rounded-2xl p-6 mb-6 shadow-premium border-2 border-red-500/50 ".concat("dark"===z?"glass-dark":""),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsx)(p.Z,{className:"w-6 h-6 text-red-500"}),(0,s.jsx)("h2",{className:"text-xl font-bold text-red-500",children:"Bulk Delete Jobs by Date Range"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-1 ".concat("dark"===z?"text-[#D7DADC]":"text-gray-700"),children:"Start Date"}),(0,s.jsx)("input",{type:"date",value:eg,onChange:e=>ey(e.target.value),className:"w-full px-4 py-2 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-1 ".concat("dark"===z?"text-[#D7DADC]":"text-gray-700"),children:"End Date"}),(0,s.jsx)("input",{type:"date",value:ej,onChange:e=>ev(e.target.value),className:"w-full px-4 py-2 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-1 ".concat("dark"===z?"text-[#D7DADC]":"text-gray-700"),children:"Date Field"}),(0,s.jsxs)("select",{value:ef,onChange:e=>eN(e.target.value),className:"w-full px-4 py-2 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]"),children:[(0,s.jsx)("option",{value:"createdAt",children:"Created At (Scraped Time)"}),(0,s.jsx)("option",{value:"updatedAt",children:"Updated At"}),(0,s.jsx)("option",{value:"postedDate",children:"Posted Date"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-1 ".concat("dark"===z?"text-[#D7DADC]":"text-gray-700"),children:"Country"}),(0,s.jsxs)("select",{value:ek,onChange:e=>ew(e.target.value),className:"w-full px-4 py-2 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]"),children:[(0,s.jsx)("option",{value:"all",children:"All Countries"}),(0,s.jsx)("option",{value:"USA",children:"USA"}),(0,s.jsx)("option",{value:"India",children:"India"}),(0,s.jsx)("option",{value:"UK",children:"UK"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-1 ".concat("dark"===z?"text-[#D7DADC]":"text-gray-700"),children:"Source"}),(0,s.jsxs)("select",{value:eS,onChange:e=>eC(e.target.value),className:"w-full px-4 py-2 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]"),children:[(0,s.jsx)("option",{value:"all",children:"All Sources"}),(0,s.jsx)("option",{value:"indeed",children:"Indeed"}),(0,s.jsx)("option",{value:"linkedin",children:"LinkedIn"}),(0,s.jsx)("option",{value:"glassdoor",children:"Glassdoor"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 pt-6",children:[(0,s.jsx)("input",{type:"checkbox",id:"includeActive",checked:eF,onChange:e=>eZ(e.target.checked),className:"w-5 h-5 rounded border-gray-300"}),(0,s.jsx)("label",{htmlFor:"includeActive",className:"text-sm ".concat("dark"===z?"text-[#D7DADC]":"text-gray-700"),children:"Include active jobs (⚠️ dangerous)"})]})]}),(0,s.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,s.jsxs)("button",{onClick:eU,disabled:eA||!eg||!ej,className:"flex items-center gap-2 px-4 py-2 rounded-xl transition-colors ".concat(!eA&&eg&&ej?"bg-blue-600 hover:bg-blue-700 text-white":"bg-gray-400 cursor-not-allowed"),children:[eA?(0,s.jsx)(g.Z,{className:"w-5 h-5 animate-spin"}):(0,s.jsx)(y.Z,{className:"w-5 h-5"}),"Preview"]}),(0,s.jsx)("button",{onClick:()=>{ey(""),ev(""),eN("createdAt"),ew("all"),eC("all"),eZ(!1),eE(null),e_("")},className:"px-4 py-2 rounded-xl border ".concat("dark"===z?"border-[#343536] hover:bg-[#272729]":"border-gray-300 hover:bg-gray-100"),children:"Reset"})]}),eD&&(0,s.jsxs)("div",{className:"p-4 rounded-xl mb-4 ".concat("dark"===z?"bg-[#272729]":"bg-gray-100"),children:[(0,s.jsx)("h3",{className:"font-bold text-lg mb-3",children:"⚠️ Preview - Jobs to be Deleted:"}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[(0,s.jsxs)("div",{className:"p-3 rounded-lg ".concat("dark"===z?"bg-[#343536]":"bg-white"),children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-red-500",children:(null!==(L=null==eD?void 0:null===(e=eD.counts)||void 0===e?void 0:e.jobs)&&void 0!==L?L:0).toLocaleStr
1ing()}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"Jobs"})]}),(0,s.jsxs)("div",{className:"p-3 rounded-lg ".concat("dark"===z?"bg-[#343536]":"bg-white"),children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-orange-500",children:(null!==(J=null==eD?void 0:null===(t=eD.counts)||void 0===t?void 0:t.applications)&&void 0!==J?J:0).toLocaleString()}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"Applications"})]}),(0,s.jsxs)("div",{className:"p-3 rounded-lg ".concat("dark"===z?"bg-[#343536]":"bg-white"),children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-[#FF4500]",children:(null!==(_=null==eD?void 0:null===(a=eD.counts)||void 0===a?void 0:a.total)&&void 0!==_?_:0).toLocaleString()}),(0,s.jsx)("div",{className:"text-sm text-gray-500",children:"Total Records"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold mb-2",children:"By Country:"}),(0,s.jsx)("ul",{className:"space-y-1",children:(null!==(P=null==eD?void 0:null===(r=eD.breakdown)||void 0===r?void 0:r.byCountry)&&void 0!==P?P:[]).map(e=>(0,s.jsxs)("li",{className:"text-sm",children:[e.country,": ",(0,s.jsx)("span",{className:"font-mono",children:e.count.toLocaleString()})]},e.country))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold mb-2",children:"By Source:"}),(0,s.jsx)("ul",{className:"space-y-1",children:(null!==(R=null==eD?void 0:null===(Z=eD.breakdown)||void 0===Z?void 0:Z.bySource)&&void 0!==R?R:[]).map(e=>(0,s.jsxs)("li",{className:"text-sm",children:[e.source,": ",(0,s.jsx)("span",{className:"font-mono",children:e.count.toLocaleString()})]},e.source))})]})]}),(null==eD?void 0:null===(D=eD.dateRange)||void 0===D?void 0:D.oldest)&&(0,s.jsxs)("div",{className:"text-sm text-gray-500 mb-4",children:["Date range: ",new Date(eD.dateRange.oldest).toLocaleDateString()," → ",eD.dateRange.newest&&new Date(eD.dateRange.newest).toLocaleDateString()]}),(null!==(I=null==eD?void 0:null===(T=eD.counts)||void 0===T?void 0:T.jobs)&&void 0!==I?I:0)>0&&(0,s.jsx)("div",{className:"border-t border-red-500/30 pt-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("label",{className:"text-sm font-medium text-red-500",children:"Type DELETE to confirm:"}),(0,s.jsx)("input",{type:"text",value:eJ,onChange:e=>e_(e.target.value),placeholder:"DELETE",className:"px-3 py-2 rounded-lg border-2 border-red-500 focus:outline-none ".concat("dark"===z?"bg-[#272729] text-white":"bg-white")}),(0,s.jsxs)("button",{onClick:eq,disabled:eM||"DELETE"!==eJ,className:"flex items-center gap-2 px-4 py-2 rounded-xl transition-colors ".concat(eM||"DELETE"!==eJ?"bg-gray-400 cursor-not-allowed":"bg-red-600 hover:bg-red-700 text-white"),children:[eM?(0,s.jsx)(g.Z,{className:"w-5 h-5 animate-spin"}):(0,s.jsx)(p.Z,{className:"w-5 h-5"}),"Delete ",eD.counts.jobs.toLocaleString()," Jobs"]})]})})]})]}),(0,s.jsx)("div",{className:"glass rounded-2xl p-6 mb-6 shadow-premium ".concat("dark"===z?"glass-dark":""),children:(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(y.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,s.jsx)("input",{type:"text",value:H,onChange:e=>K(e.target.value),placeholder:"Search jobs, companies, locations...",className:"w-full pl-10 pr-4 py-3 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]")})]}),(0,s.jsxs)("select",{value:X,onChange:e=>$(e.target.value),className:"px-4 py-3 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]"),children:[(0,s.jsx)("option",{value:"all",children:"All Sources"}),(0,s.jsx)("option",{value:"indeed",children:"Indeed"}),(0,s.jsx)("option",{value:"linkedin",children:"LinkedIn"}),(0,s.jsx)("option",{value:"glassdoor",children:"Glassdoor"}),(0,s.jsx)("option",{value:"manual",children:"Manual"})]}),(0,s.jsxs)("select",{value:Q,onChange:e=>W(e.target.value),className:"px-4 py-3 rounded-xl border focus:outline-none focus:ring-2 ".concat("dark"===z?"bg-[#272729] border-[#343536] text-white focus:ring-[#FF4500]":"bg-white border-gray-300 text-gray-900 focus:ring-[#FF4500]"),children:[(0,s.jsx)("option",{value:"all",children:"All Status"}),(0,s.jsx)("option",{value:"active",children:"Active"}),(0,s.jsx)("option",{value:"inactive",children:"Inactive"})]})]})}),B?(0,s.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,s.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})}):(null!==(O=null==q?void 0:q.length)&&void 0!==O?O:0)===0?(0,s.jsxs)("div",{className:"text-center py-20",children:[(0,s.jsx)(j.Z,{className:"w-16 h-16 mx-auto mb-4 text-gray-400"}),(0,s.jsx)("p",{className:"text-xl font-semibold",children:"No jobs found"})]}):(0,s.jsxs)("div",{className:"glass rounded-2xl shadow-premium overflow-hidden ".concat("dark"===z?"glass-dark":""),children:[(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"w-full",children:[(0,s.jsx)("thead",{className:"".concat("dark"===z?"bg-[#272729]":"bg-gray-50"),children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase tracking-wider",children:"Job Details"}),(0,s.jsx)("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase tracking-wider",children:"Source"}),(0,s.jsx)("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase tracking-wider",children:"Applications"}),(0,s.jsx)("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase tracking-wider",children:"Status"}),(0,s.jsx)("th",{className:"px-6 py-4 text-left text-xs font-semibold uppercase tracking-wider",children:"Actions"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-[#343536]",children:(q||[]).map(e=>(0,s.jsxs)("tr",{className:"hover:bg-[#272729]",children:[(0,s.jsx)("td",{className:"px-6 py-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-semibold text-sharp",children:e.title}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400 mt-1",children:[(0,s.jsx)(v.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:e.company})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400 mt-1",children:[(0,s.jsx)(f.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{children:e.location})]}),e.salary&&(0,s.jsx)("div",{className:"text-sm text-green-400 mt-1",children:e.salary})]})}),(0,s.jsx)("td",{className:"px-6 py-4",children:(0,s.jsx)("span",{className:"px-3 py-1 rounded-full text-xs font-bold ".concat("linkedin"===e.source||"linkedin-fast"===e.source?"bg-blue-500/20 text-blue-400":"indeed"===e.source?"bg-[#FF4500]/20 text-[#FF4500]":"google-jobs"===e.source?"bg-red-500/20 text-red-400":"zip_recruiter"===e.source?"bg-orange-500/20 text-orange-400":"glassdoor"===e.source?"bg-[#0079D3]/20 text-[#0079D3]":"greenhouse"===e.source?"bg-green-500/20 text-green-400":"lever"===e.source?"bg-[#0079D3]/20 text-[#0079D3]":"workday"===e.source?"bg-[#FF4500]/20 text-yellow-400":"career_page"===e.source?"bg-[#0079D3]/20 text-[#0079D3]":"manual"===e.source?"bg-emerald-500/20 text-emerald-400":"bg-gray-500/20 text-gray-400"),children:"linkedin-fast"===e.source?"LinkedIn":"google-jobs"===e.source?"Google Jobs":"zip_recruiter"===e.source?"ZipRecruiter":"career_page"===e.source?"Career Page":e.source})}),(0,s.jsx)("td",{className:"px-6 py-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(N.Z,{className:"w-4 h-4"}),(0,s.jsx)("span",{className:"font-semibold",children:e.applicationCount})]})}),(0,s.jsx)("td",{className:"px-6 py-4",children:e.isActive?(0,s.jsxs)("span",{className:"flex items-center gap-2 text-green-500",children:[(0,s.jsx)(h.Z,{className:"w-4 h-4"}),"Active"]}):(0,s.jsxs)("span",{className:"flex items-center gap-2 text-gray-500",children:[(0,s.jsx)(k.Z,{className:"w-4 h-4"}),"Inactive"]})}),(0,s.jsx)("td",{className:"px-6 py-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[e.url&&(0,s.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-lg hover:bg-blue-500/20 text-blue-500",title:"View Job",children:(0,s.jsx)(w.Z,{className:"w-4 h-4"})}),(0,s.jsx)("button",{onClick:()=>{el(e),en(!0)},className:"p-2 rounded-lg hover:bg-blue-500/20 text-blue-500",title:"Edit",children:(0,s.jsx)(S.Z,{className:"w-4 h-4"})}),(0,s.jsx)("button",{onClick:()=>
1eR(e._id,e.isActive),className:"p-2 rounded-lg ".concat(e.isActive?"hover:bg-[#FF4500]/20 text-[#FF4500]":"hover:bg-green-500/20 text-green-500"),title:e.isActive?"Deactivate":"Activate",children:e.isActive?(0,s.jsx)(k.Z,{className:"w-4 h-4"}):(0,s.jsx)(C.Z,{className:"w-4 h-4"})}),(0,s.jsx)("button",{onClick:()=>eO(e._id),className:"p-2 rounded-lg hover:bg-red-500/20 text-red-500",title:"Delete",children:(0,s.jsx)(p.Z,{className:"w-4 h-4"})})]})})]},e._id))})]})}),(0,s.jsxs)("div",{className:"px-6 py-4 border-t flex items-center justify-between ".concat("dark"===z?"border-[#343536]":"border-gray-200"),children:[(0,s.jsxs)("button",{onClick:()=>ee(e=>Math.max(1,e-1)),disabled:1===Y,className:"flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 btn-premium",children:[(0,s.jsx)(c.Z,{className:"w-4 h-4"}),"Previous"]}),(0,s.jsxs)("span",{className:"text-sm",children:["Page ",Y," of ",et]}),(0,s.jsxs)("button",{onClick:()=>ee(e=>Math.min(et,e+1)),disabled:Y===et,className:"flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 btn-premium",children:["Next",(0,s.jsx)(F.Z,{className:"w-4 h-4"})]})]})]})]})]}),er&&es&&(0,s.jsx)(E,{job:es,theme:z,onClose:()=>en(!1),onSave:eI}),eo&&(0,s.jsx)(A,{theme:z,onClose:()=>ed(!1),onCreate:ez})]})}function E(e){let{job:t,theme:a,onClose:r,onSave:n}=e,[o,d]=(0,l.useState)(t.title),[i,c]=(0,l.useState)(t.company),[u,x]=(0,l.useState)(t.location),[h,m]=(0,l.useState)(t.salary||""),[p,g]=(0,l.useState)(t.url||"");return(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50  flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"glass rounded-2xl p-6 max-w-md w-full shadow-premium-lg max-h-[90vh] overflow-y-auto ".concat("dark"===a?"glass-dark":""),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsx)("h2",{className:"text-xl font-bold",children:"Edit Job"}),(0,s.jsx)("button",{onClick:r,className:"p-2 rounded-lg hover:bg-[#343536]",children:(0,s.jsx)(b.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Title"}),(0,s.jsx)("input",{type:"text",value:o,onChange:e=>d(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===a?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Company"}),(0,s.jsx)("input",{type:"text",value:i,onChange:e=>c(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===a?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Location"}),(0,s.jsx)("input",{type:"text",value:u,onChange:e=>x(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===a?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Salary (optional)"}),(0,s.jsx)("input",{type:"text",value:h,onChange:e=>m(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===a?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"URL (optional)"}),(0,s.jsx)("input",{type:"url",value:p,onChange:e=>g(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===a?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]})]}),(0,s.jsxs)("div",{className:"flex gap-3 mt-6",children:[(0,s.jsxs)("button",{onClick:()=>n({title:o,company:i,location:u,salary:h,url:p}),className:"btn-premium flex-1",children:[(0,s.jsx)(Z.Z,{className:"w-4 h-4 mr-2 inline"}),"Save Changes"]}),(0,s.jsx)("button",{onClick:r,className:"flex-1 px-4 py-3 rounded-xl ".concat("dark"===a?"bg-[#272729] hover:bg-[#343536]":"bg-gray-200 hover:bg-gray-300"),children:"Cancel"})]})]})})}function A(e){let{theme:t,onClose:a,onCreate:r}=e,[n,o]=(0,l.useState)(""),[d,i]=(0,l.useState)(""),[c,x]=(0,l.useState)(""),[h,m]=(0,l.useState)(""),[p,g]=(0,l.useState)("");return(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50  flex items-center justify-center z-50 p-4",children:(0,s.jsxs)("div",{className:"glass rounded-2xl p-6 max-w-md w-full shadow-premium-lg ".concat("dark"===t?"glass-dark":""),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsx)("h2",{className:"text-xl font-bold",children:"Create Job"}),(0,s.jsx)("button",{onClick:a,className:"p-2 rounded-lg hover:bg-[#343536]",children:(0,s.jsx)(b.Z,{className:"w-5 h-5"})})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Title *"}),(0,s.jsx)("input",{type:"text",value:n,onChange:e=>o(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===t?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Company *"}),(0,s.jsx)("input",{type:"text",value:d,onChange:e=>i(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===t?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Location *"}),(0,s.jsx)("input",{type:"text",value:c,onChange:e=>x(e.target.value),className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===t?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Salary"}),(0,s.jsx)("input",{type:"text",value:h,onChange:e=>m(e.target.value),placeholder:"e.g., $80k-$120k",className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===t?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"URL"}),(0,s.jsx)("input",{type:"url",value:p,onChange:e=>g(e.target.value),placeholder:"https://...",className:"w-full px-4 py-3 rounded-xl border ".concat("dark"===t?"bg-[#272729] border-[#343536]":"bg-white border-gray-300")})]})]}),(0,s.jsxs)("div",{className:"flex gap-3 mt-6",children:[(0,s.jsxs)("button",{onClick:()=>r({title:n,company:d,location:c,salary:h,url:p}),disabled:!n||!d||!c,className:"btn-premium flex-1 disabled:opacity-50",children:[(0,s.jsx)(u.Z,{className:"w-4 h-4 mr-2 inline"}),"Create Job"]}),(0,s.jsx)("button",{onClick:a,className:"flex-1 px-4 py-3 rounded-xl ".concat("dark"===t?"bg-[#272729] hover:bg-[#343536]":"bg-gray-200 hover:bg-gray-300"),children:"Cancel"})]})]})})}}},function(e){e.O(0,[4968,1296,5412,2888,9774,179],function(){return e(e.s=69519)}),_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.