1import{t as ae,b as R,c as B,h as o,j as e,a3 as Pe,y as ht,bw as jt,bx as _t,a4 as gt,i as H,by as vt,a5 as fe,bz as U,aa as ee,ae as me,bA as Ae,bB as Ve,e as ke,bC as Nt,bD as $e,bE as wt,bF as St,bG as Ct,u as Fe,ai as Je,am as kt,bH as Dt,bh as Ft,bv as qt,bI as It,bJ as Et,a2 as Tt,bK as Ee,bq as Ce,x as Bt,f as Te,bL as Lt,bM as Pt,bN as At,bO as Vt}from"./index-B9q78oLf.js";import{e as ce}from"./editIcon-l_iBD7GC.js";import{L as Re}from"./LocationSearchInput-B6D4CweL.js";import{S as Me}from"./SearchInputField-Xu2MeW4L.js";import{M as Be}from"./MultiButtonField-zu1mDuZR.js";import{g as De}from"./CurrencySalaryDropdown-YciAkfHL.js";import{T as Ne}from"./TextInputField-DNJqyglp.js";import{J as $t}from"./JobSpaceInputFeild-B0sEHB1P.js";import{a as Oe,d as He,p as Jt}from"./employerDashboard-D_amyCIH.js";import{C as Rt}from"./CurrenciesDropdown-D_LkE7Kw.js";import{D as Le}from"./DropdownField-B2-c6sm_.js";import{g as Ge}from"./currency-symbol-map-CjPMGLKU.js";import{S as Mt}from"./Slider-1NO0ydnR.js";import"./index-4bdnOsvc.js";import"./moment-BJba-qMG.js";/* empty css */import{b as Ot}from"./index.esm-GAhwvDqC.js";import"./index-Cq9UrQZH.js";import"./___vite-browser-external_commonjs-proxy-CeLqxiRG.js";import"./unsupportedIterableToArray-yxopmGhp.js";const Ht=({theme:N,hideLabels:a,onSkillChange:y,handleSkillsSave:t=()=>{},skills:g,maxItems:s,postJob:h,loading:n,setSkillInputFocus:p=()=>{},setIsEditSkills:u=()=>{},isEditSkills:q})=>{ae();const C=R(l=>l.postJobData),m=R(l=>l.auth.token),[k,w]=B.useState(""),[j,f]=B.useState([]),[b,E]=B.useState([]),[$,I]=B.useState(0),[L,x]=o.useState([]),[J,P]=o.useState(0),A=async l=>{try{const T=await jt(C?.job_title?.title,m),O=await _t(C?.job_title?.title,m);x(T?.data&&O?.data?[...T?.data,...O?.data?.data]:[])}catch(T){console.log(T,"ERROR")}},Q=l=>{J!==0&&clearTimeout(J);const T=setTimeout(()=>A(C?.job_title?.title),250);P(T)},W=(l,T)=>{$!==0&&clearTimeout($);const O=setTimeout(()=>M(l),600);I(O)},M=async l=>{await gt(l,m).then(T=>{const Y=T.data.data;E(Y)}
1).catch(T=>{console.error("Error fetching skill suggestions:",T)})},D=async l=>{const{value:T}=l.target;if(l.key==="Enter"&&T.trim()!==""){if(j.length<s){const O={name:T};j.some(Y=>Y.name===T)||(f([...j,O]),w(""))}}else w(T),T?W(T):E([])},v=l=>{console.log("add: ",l,j),!!j?.length<s&&(j?.length&&j.find(O=>O.id===l.id)||(f([...j,l]),w(""),E([])))},r=()=>{t(j),u(!1)},X=l=>{const T=j.filter(O=>O!==l);f(T)},te=()=>b?.length===0||k===""?null:e.jsx("div",{className:"absolute max-h-[310px] z-40 left-0 mt-[-70px] w-full bg-white border border-gray-300 shadow-xl rounded-sm overflow-scroll",children:b?.map(l=>e.jsx("div",{className:"px-4 py-2 cursor-pointer hover:bg-gray-100 border-b",onClick:()=>v(l),children:l.name},l.id))});return B.useEffect(()=>{console.log(C.skills,L,"total skills");const l=C?.skills?.length>0?C.skills:L;l?.length>0&&(f(l),t(l))},[C?.skills,L]),o.useEffect(()=>{C?.job_title?.title,Q()},[C?.job_title?.title]),e.jsxs(e.Fragment,{children:[!q&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-5 items-center justify-between",children:[e.jsx("h3",{className:"text-[23px] leading-7 font-normal text-[#1b1b1b]",children:"Skills"}),e.jsx("img",{src:ce,alt:"",className:"mr-4 cursor-pointer",onClick:()=>u(!0)})]}),e.jsx("div",{className:"flex flex-wrap gap-[20px]",children:!!C?.skills&&C?.skills.map((l,T)=>e.jsx("span",{className:"border border-[#d9d9d9] rounded-full px-[15px] py-[2px]",children:l.name},T))})]}),q&&e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"w-full p-5 bg-[#ffffff] rounded-[10px]",children:[e.jsx("h4",{className:"text-[18px] leading-6 font-semibold text-[#000000] pb-[20px]",children:"Edit skill"}),a?e.jsx(e.Fragment,{}):e.jsx("label",{htmlFor:name,className:"block text-subtitle2 font-poppins pb-2 font-[500]",children:"Skills"}),h?e.jsx("p",{className:" text-caption font-poppins mb-2",children:"Add skill keywords (max 30) to make your job more visible to the right candidates."}):e.jsx(e.Fragment,{}),e.jsxs("div",{className:"relative border border-sandDune rounded focus:outline-none focus:shadow-outline flex flex-wrap items-center bg-[#f8f9fe]",children:[j?.map(l=>e.jsx("div",{className:N=="dark"?"flex px-2 w-min-[50px] h-[25px] border rounded-full bg-btnDarkPurple text-white justify-center items-center m-1 cursor-pointer":"flex bg-white px-2 w-min-[50px] h-[25px] border rounded-full border-btnDarkPurple text-btnDarkPurple justify-center items-center m-1 cursor-pointer",children:e.jsxs("p",{className:"flex justify-between items-center text-center text-caption font-poppins",children:[l?.name,n?e.jsx("div",{className:"ml-2",children:e.jsx(Pe,{width:"15px",height:"15px",color:"#FF8383"})}):e.jsx(ht,{className:"w-[15px] h-[15px] ml-1",onClick:()=>X(l)})]})},l?.id)),e.jsx("div",{className:"w-full flex flex-row items-center",children:e.jsx("input",{type:"text",placeholder:"Search...",className:"outline-none rounded py-2 px-4 flex-1",onFocus:()=>p(!0),onBlur:()=>p(!1),value:k,onChange:D,onKeyDown:D})})]}),L?.length!==0?e.jsxs("div",{className:"w-full mt-4 ",children:[e.jsx("label",{htmlFor:name,className:"block text-subtitle2 font-poppins pb-2 font-[500]",children:"Suggested skills"}),e.jsx("div",{className:"flex flex-wrap w-full",children:L?.map(l=>e.jsx("div",{className:"flex px-3 w-min-[50px] min-h-[25px] border border-btnDarkPurple rounded-tr-lg rounded-bl-lg text-btnDarkPurple justify-center items-center m-1 cursor-pointer",onClick:()=>v(l),children:e.jsx("p",{className:" justify-center text-center text-caption font-poppins text-btnDarkPurple",children:l.name})},l.id))})]}):e.jsx(e.Fragment,{}),te(),e.jsxs("div",{className:" w-full flex justify-end mt-[50px] gap-[20px]",children:[e.jsx("button",{type:"button",onClick:()=>u(!1),children:"Cancel"}),e.jsx("button",{onClick:r,type:"button",className:"bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[30px] py-[10px] rounded-full",children:"Save"})]})]})})]})},Gt=({title:N,label:a,name:y,value:t,handleSaveJobRole:g,placeholder:s,onChange:h=()=>{},onBlur:n,error:p,querySearchResults:u,mandatory:q,customClass:C="",postJobData:m})=>{console.log(t,"querySearchResults");
1const k=B.useRef(null),[w,j]=B.useState(!1),[f,b]=B.useState(!0),E=x=>{k.current&&!k.current.contains(x.target)&&j(!1)},$=()=>{j(!0)},I=x=>{j(!1),h(x)},L=x=>{console.log("handleInputChange : ",w),j(!0),h(x.target.value)};return B.useEffect(()=>(document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}),[]),e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"flex gap-5 items-center",children:[e.jsx("div",{className:"w-[20px]",children:e.jsx("img",{src:H.CommonHeader.header_logo,alt:""})}),e.jsx("p",{className:"",children:N})]}),e.jsxs("div",{className:"w-full flex justify-end",children:[!f&&e.jsxs("div",{className:"w-full flex justify-end items-center",children:[e.jsx("img",{src:ce,alt:"",className:"mr-4 cursor-pointer",onClick:()=>b(!0)}),e.jsx("p",{className:"py-5 px-8 text-end bg-[#ffffff] rounded-full",children:m?.job_title?.title||""})]}),f&&e.jsxs("div",{className:`w-[50%] p-5 bg-[#ffffff] rounded-full relative ${C} flex items-center`,children:[e.jsx("div",{className:"mr-[100px]",children:e.jsx("input",{id:y,className:` rounded-md w-full outline-none px-[14px] ${p?"border-red":""}`,type:"text",name:y,placeholder:s,onBlur:n,value:t,onChange:x=>L(x),autoComplete:"off",onClick:$})}),e.jsx("button",{type:"button",onClick:()=>{b(!1),g()},className:"absolute right-4 bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[30px] py-[10px] rounded-full",children:"Save"}),p&&e.jsx("p",{className:"text-red text-caption",children:p}),u&&u?.length!==0&&w&&e.jsx("div",{ref:k,children:e.jsx("div",{className:"absolute scrollbar-hide z-40 left-0 top-[90px] w-full bg-white border shadow-xl rounded-sm max-h-72 md:max-h-96 overflow-scroll",children:u?.map(x=>e.jsx("div",{className:"px-4 py-2 cursor-pointer hover:bg-gray-100 border-b",onClick:()=>I(x),children:x.title?x.title:x.name},x.id))})})]})]})]})},Qe=({label:N,name:a,value:y,onChange:t,error:g,placeholder:s,saveCountry:h,inputStyle:n="",isPrefered:p,mandatory:u=!1,is_international:q=!1})=>{const[C,m]=B.useState([]),[k,w]=B.useState(0),[j,f]=B.useState(!1),[b,E]=B.useState(!1),$=(P,A)=>{k!==0&&clearTimeout(k);const Q=setTimeout(()=>I(P),600);w(Q)},I=async P=>{if(P==""){E(!1);return}f(!0);try{const A=await vt(P);console.log("LOCATIONS : ",A?.data),A==null?(E(!1),m([])):(console.log(A?.data,"COUNTRIES"),m(A?.data),E(!0))}catch(A){console.error("Error:",A)}finally{f(!1)}},L=P=>{const A=P.target.value;$(A),t(P)},x=P=>{console.log("LOC PICKED : ",P),E(!1),h(P)},J=()=>C?.length===0||b==!1?null:e.jsx("div",{className:"absolute z-40 left-0 mt-2 w-full bg-white border shadow-xl rounded-sm",children:C?.map(P=>e.jsx("div",{className:"px-4 py-2 cursor-pointer border-b",onClick:()=>x(P),children:P?.name},P.id))});return e.jsxs("div",{className:n?.length?" w-full relative":" w-full relative",children:[e.jsxs("label",{htmlFor:a,className:` ${p?"block text-h5 font-poppins pb-2 font-[500]":"block text-subtitle2 font-poppins pb-2 font-[500]"}`,children:[N,u?e.jsx("span",{className:"text-red ml-1",children:"*"}):""]}),e.jsx("input",{className:n?.length?n:`border-[1px] border-sandDune hover:border-pureBlack p-2 rounded-md w-full outline-purple px-[14px] py-2 ${g?"border-red":""}`,autoComplete:"off",type:"text",name:a,placeholder:s,value:y,onChange:L,disabled:!q}),j&&e.jsx("p",{className:"text-caption absolute",children:"Loading..."}),g&&e.jsx("p",{className:"text-red text-caption",children:g}),J()]})},Qt=({title:N,setShowContinueButton:a,disabledQuestions:y=!1,setIsLocationNeeded:t})=>{const g=ae(),[s,h]=B.useState([]),[n,p]=B.useState(!0),[u,q]=B.useState(0),[C,m]=B.useState(!1),[k,w]=B.useState(!1),j=R(I=>I.employerProfileData.is_international),f=R(I=>I.postJobData),b=fe({initialValues:{country:{id:"",code:"",name:""},job_location:{id:"",city:"",state:"",country:"",code:""}}
1,validationSchema:ee({country:ee({id:me().required("Required. Please select a country from dropdown only")}).required("Required")}),onSubmit:I=>{console.log(I,"valuessssssss"),g(U({...f,country:I?.country||"",job_location:I?.job_location||null})),p(!1),t(!1),a(!0)}}),E=I=>{console.log("Country",I),b.setFieldValue("country",I)},$=I=>{b.setFieldValue("job_location",I)};return o.useEffect(()=>{b.setFieldValue("country",f?.country),b.setFieldValue("job_location",f.job_location===null?{id:"",city:"",state:"",country:""}:f.job_location)},[f]),console.log(y,"check"),e.jsxs("div",{className:"",children:[e.jsxs("div",{className:"flex gap-5 items-center mb-5",children:[e.jsx("div",{className:"w-[20px]",children:e.jsx("img",{src:H.CommonHeader.header_logo,alt:""})}),e.jsx("p",{className:"text-[18px] leading-[21px] text-[#000000]",children:N})]}),e.jsxs("div",{className:"w-full flex justify-end ",children:[!n&&e.jsxs("div",{className:"w-full flex justify-end items-center",children:[!y&&e.jsx("img",{src:ce,alt:"",className:"mr-4 cursor-pointer",onClick:()=>p(!0)}),e.jsxs("p",{className:"py-5 px-8 text-end bg-[#ffffff] rounded-full",children:[" ",f?.job_location?.city&&`${f.job_location.city}, `,f?.job_location?.state&&`${f.job_location.state}, `,f?.job_location?.country&&`${f.job_location.country}.`,f?.job_location?.country?"":`${f?.country?.name}`]})]}),n&&e.jsx("div",{className:"w-[70%] px-5 pb-5 pt-3 bg-[#ffffff] rounded-full relative flex items-center",children:e.jsxs("form",{onSubmit:b.handleSubmit,className:"mr-[100px]",children:[e.jsxs("div",{className:"w-full flex flex-col md:flex-row gap-[20px] justify-between",children:[e.jsx(Qe,{name:"country",value:b.values.country?.name,onChange:b.handleChange,error:(b?.touched?.country?.id||b.submitCount>0)&&b?.errors?.country?.id,placeholder:"Enter country",saveCountry:E,is_international:j}),e.jsx(Re,{name:"job_location",value:b.values.job_location?.city&&b.values.job_location?.state&&b.values.job_location?.country?`${b.values.job_location.city}, ${b.values.job_location.state}, ${b.values.job_location.country}`:b.values.job_location?.state,onChange:b.handleChange,error:(b.touched.job_location?.id||b.submitCount>0)&&b.errors.job_location?.id,placeholder:"Enter location",saveLocation:$,countryCode:b.values.country?.code})]}),e.jsx("button",{type:"submit",className:"absolute right-4 top-[18px] bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[30px] py-[10px] rounded-full",children:"Save"})]})})]})]})},zt=({title:N,options:a,selected:y,onSelect:t,errors:g,mandatory:s,isPrefered:h})=>e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex gap-5 items-center",children:[e.jsx("div",{className:"w-[20px]",children:e.jsx("img",{src:H.CommonHeader.header_logo,alt:""})}),e.jsx("p",{className:"text-[18px] leading-[21px] text-[#000000]",children:N})]}),e.jsx("div",{className:"flex space-x-2 gap-2 md:gap-0 flex-wrap ml-[40px]",children:a.map((n,p)=>e.jsx("button",{type:"button",className:`border px-[25px] py-[10px] rounded-full border-[#d9d9d9] 2 ${y?.min===n.min&&y?.max===n.max?"bg-darkPurple text-white":"bg-white text-textLightGray"}`,onClick:()=>t(n),children:e.jsx("p",{className:"text-subtitle2",children:typeof n=="object"?n.label:n})},p))}),e.jsx("p",{className:"text-caption text-red",children:g})]}),Ut=({isEditJobRequirements:N,setIsEditJobRequirements:a})=>{const y=ae(),t=R(i=>i.postJobData),[g,s]=o.useState([]),[h,n]=o.useState(0),p=R(i=>i.auth.token),u=R(i=>i.employerProfileData.is_international),[q,C]=o.useState(""),[m,k]=o.useState(""),[w,j]=o.useState([]),[f,b]=o.useState(!1),[E,$]=o.useState(!1),[I,L]=o.useState([]),[x,J]=o.useState([]),[P,A]=o.useState(""),[Q,W]=o.useState([]),[M,D]=o.useState([]),[v,r]=o.useState(!1),[X,te]=o.useState(""),l=fe({initialValues:{job_title:{id:"",title:"",UserGenerated:!1},industry:"",country:{id:"",code:"",name:""},job_location:{id:"",city:"",state:"",country:"",code:""},is_international:!1,employment_mode:[],job_type:[],required_exp:{min:0,max:0},job_space:{id:"",title:"untitled"}}
2,validationSchema:ee({job_title:ee({title:me().required("Required")}).required("Required"),country:ee().when("employment_mode",{is:i=>!i?.includes("Remote"),then:()=>ee().shape({id:me().required("Country is required")}),otherwise:()=>ee().shape({id:me().notRequired()})})}),onSubmit:i=>{console.log(i,"bsadnkjnjcdnajvnj"),y(U({...t,job_title:{id:i.job_title.id,title:i.job_title.title,UserGenerated:i.job_title.UserGenerated},industry:i?.industry||"",country:i?.country||"",job_location:i?.job_location||null,job_type:i?.job_type||"",employment_mode:i?.employment_mode||"",is_international:i?.is_international||!1,required_exp:i?.required_exp,job_space:i?.job_space})),a(!1)}}),T=[{id:"On-site",label:"On-site"},{id:"Hybrid",label:"Hybrid"},{id:"Remote",label:"Remote"}],O=[{id:"full_time",label:"Full Time"},{id:"part_time",label:"Part Time"},{id:"contract_freelancer",label:"Contract/Freelance"},{id:"internship",label:"Internship"}],Y=i=>{if(typeof i=="object"){l.setFieldValue("job_title",i);return}const F={id:i?.id?i.id:"",title:i?.title?i.title:i,UserGenerated:!1};l.setFieldValue("job_title",F)},de=i=>{console.log("EMP MODE : ",i);let F=[];i!=="no_preference"?F=[i]:F=["no_preference"],l.setFieldValue("employment_mode",F)},be=i=>{l.setFieldValue("job_type",[i])},le=async i=>{try{let F;const K=t?.industry?.id||t?.industry;if(K?F=await Ae(i,K,p):F=await Ve(i,p),F?.data==null){s([]);return}else{const ne=F.data?.filter(Z=>{Z.title!=i});s(F?.data)}}catch(F){console.error("Error:",F)}},ue=i=>{h!==0&&clearTimeout(h);const F=setTimeout(()=>le(i),250);n(F)},ie=i=>{console.log("Country",i),l.setFieldValue("country",i)},ye=i=>{l.setFieldValue("job_location",i)},he=i=>{l.setFieldValue("is_international",i.target.checked)},se=i=>{l.setFieldValue("from_location_only",i.target.checked)},xe=i=>{if(i.target.value?.[0]===0&&i.target.value.length>1)return;const F={...l.values.required_exp};F.min=i.target.value?Number(i.target.value):0,l.setFieldValue("required_exp",F)},oe=i=>{const F={...l.values.required_exp};F.max=parseInt(i.target.value)||"",l.setFieldValue("required_exp",F)},c=i=>{const F=Q.filter(K=>K.title.toLowerCase().includes(i.toLowerCase()));D(F),i.trim()===""&&D(Q)},_=i=>{if(r(!0),console.log(i,"space"),i?.id)l.setFieldValue("job_space",i);else{c(i);const F={id:"",title:i};l.setFieldValue("job_space",F)}},V=async()=>{try{const i=await Oe(p);console.log("JOB SPACES : ",i.data.job_spaces),W(i.data.job_spaces),D(i.data.job_spaces)}catch{console.log("Error getting JOB SPACES : ",response.data.job_spaces)}};return o.useMemo(()=>{const i=l.values?.job_title?.title;ue(i)},[l?.values?.job_title?.title]),o.useEffect(()=>{V()},[]),o.useEffect(()=>{l.setFieldValue("job_title",t?.job_title),l.setFieldValue("industry",t?.industry),l.setFieldValue("country",t?.country),l.setFieldValue("job_location",t.job_location===null?{id:"",city:"",state:"",country:""}:t.job_location),l.setFieldValue("job_type",t.job_type),l.setFieldValue("employment_mode",t.employment_mode),l.setFieldValue("required_exp",t.required_exp),l.setFieldValue("is_international",t.is_international),l.setFieldValue("job_space",t.job_space)},[t]),o.useEffect(()=>{{const i=t?.country?.code==="IN"||t?.country?.name==="India"?"INR":"USD",F=t?.country?.code,K=De(i,F);J(K)}},[t,u]),e.jsxs(e.Fragment,{children:[!N&&e.jsxs("div",{className:"flex flex-col gap-[20px] ",children:[e.jsxs("div",{className:"flex gap-5 items-center justify-between",children:[e.jsx("h3",{className:"text-[23px] leading-7 font-normal text-[#1b1b1b]",children:t.job_title.title}),e.jsx("img",{src:ce,alt:"",className:"mr-4 cursor-pointer",onClick:()=>a(!0)})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-[5px]",children:[e.jsx("div",{children:e.jsx("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:t?.required_exp?.min===void 0&&t?.required_exp?.max===void 0?"Experience: Not Disclosed":t?.required_exp?.max===void 0||t?.required_exp?.max===99||t?.required_exp?.max===0?`${t.required_exp.min} year${t.required_exp.min>1?"s":""} experience`:`${t.required_exp.min} - ${t.required_exp.max} years experience`})}),e.jsx("div",{children:e.jsx("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:t?.country?.name?t?.country?.name:"Country: Not Disclosed"})}),e.jsx("div",{children:e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[" ",t?.job_location?.city&&`${t.job_location.city}, `,t?.job_location?.state&&`${t.job_location.state}, `,t?.job_location?.country&&`${t.job_location.country}.`,t?.job_location?.id===""&&"Location: Not Disclosed"]})}),!t?.is_basic_job&&e.jsx("div",{children:e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[t?.industry==="it"&&"IT",t?.industry==="pharma"&&"Pharma",t?.industry==="finance"&&"Finance",t?.industry==="energy"&&"Energy"]})}),e.jsx("div",{children:e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[t?.employment_mode?.[0]==="On-site"&&"On site",t?.employment_mode?.[0]==="Hybrid"&&"Hybrid",t?.employment_mode?.[0]==="Remote"&&"Remote"]})}),e.jsx("div",{children:e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[t.job_type?.[0]==="full_time"&&"Full Time",t.job_type?.[0]==="part_time"&&"Part Time",t.job_type?.[0]==="contract_freelancer"&&"Contract/Freelance",t.job_type?.[0]==="internship"&&"Internship"]})})]})]}),N&&e.jsx("div",{className:"p-5 rounded-[10px] bg-[#ffffff]",children:e.jsxs("form",{onSubmit:l.handleSubmit,className:"flex flex-col space-y-[30px]",children:[e.jsx("h3",{className:"text-[18px] leading-6 font-semibold text-[#424242]",children:"Job Requirements"}),e.jsx("div",{className:"",children:e.jsx(Me,{name:"job_title",label:"Job Title",placeholder:"Enter Job Title",onCh
2ange:Y,value:l.values?.job_title?.title||"",error:l.touched.job_title?.title&&l.errors.job_title?.title,onBlur:l.handleBlur,querySearchResults:g})}),e.jsx("div",{className:"w-full flex flex-col gap-4",children:e.jsx(Be,{title:"Workplace Type",options:T,selected:l.values.employment_mode,errors:l.touched.employment_mode&&l.errors.employment_mode,onSelect:de})}),e.jsxs("div",{className:"w-full flex flex-col md:flex-row gap-[20px] justify-between",children:[e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Qe,{label:"Country",name:"country",value:l.values.country?.name,onChange:l.handleChange,error:(l?.touched?.country?.id||l.submitCount>0)&&l?.errors?.country?.id,placeholder:"Enter country",saveCountry:ie,is_international:u}),e.jsxs("div",{className:"flex items-center text-checkbox text-[#5C5C5C] font-poppins gap-2 flex-[0.5]",children:[e.jsx("input",{type:"checkbox",name:"is_international",onChange:he,checked:l.values.is_international,className:"w-[15px] h-[15px]"}),e.jsx("p",{children:"Open to global applicants"})]})]}),e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Re,{label:"Job Location",name:"job_location",value:l.values.job_location?.city&&l.values.job_location?.state&&l.values.job_location?.country?`${l.values.job_location.city}, ${l.values.job_location.state}, ${l.values.job_location.country}`:l.values.job_location?.state,onChange:l.handleChange,error:(l.touched.job_location?.id||l.submitCount>0)&&l.errors.job_location?.id,placeholder:"Enter location",saveLocation:ye,countryCode:l.values.country?.code}),!t.is_basic_job&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex items-center text-checkbox text-[#5C5C5C] font-poppins gap-2 flex-[0.5] pr-1",children:[e.jsx("input",{type:"checkbox",name:"from_location_only",onChange:se,checked:l.values.from_location_only,className:"w-[15px] h-[15px]"}),e.jsx("p",{children:"Show candidates from selected location only."})]})})]})]}),e.jsx("div",{className:"w-full flex flex-col gap-4",children:e.jsx(Be,{title:"Employment Type",options:O,selected:l.values.job_type,onSelect:be})}),e.jsx("div",{children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("div",{className:"w-full flex space-x-3",children:[e.jsx("div",{className:"flex w-1/2",children:e.jsx(Ne,{label:"Minimum Experience (in years)",name:"required_exp.min",value:String(l.values.required_exp?.min||0),onChange:xe,error:l.touched.required_exp?.min&&l.errors.required_exp?.min,placeholder:"2",type:"number",mandatory:!1,isPrefered:!0})}),e.jsx("div",{className:"flex w-1/2",children:e.jsx(Ne,{label:"Maximum Experience (in years)",name:"required_exp.max",mandatory:!1,value:l.values.required_exp&&l.values.required_exp.max||"",onChange:oe,error:l.touched.required_exp?.max&&l.errors.required_exp?.max,placeholder:"7",type:"number",isPrefered:!0})})]})})}),e.jsx("div",{children:e.jsx($t,{name:"job_space",label:"Add to Jobspace",placeholder:"Search through your jobspaces",onChange:_,newJobSpaceInput:P,setNewJobSpaceInput:A,getJobSpaces:V,value:v||l?.values?.job_space?.title?l?.values?.job_space?.title:"untitled",querySearchResults:M,error:X,setError:te})}),e.jsxs("div",{className:" w-full flex justify-end mt-[50px] gap-[20px]",children:[e.jsx("button",{type:"button",onClick:()=>a(!1),children:"Cancel"}),e.jsx("button",{type:"submit",className:"bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[30px] py-[10px] rounded-full",children:"Save"})]})]})})]})},Wt=({isEditJobDescriptions:N,setIsEditJobDescriptions:a,isDescriptionLoading:y,setIsDescriptionLoading:t})=>{const[g,s]=o.useState(!1),h={toolbar:[["bold","italic","underline"],[{list:"bullet"}]]},n=R(m=>m.postJobData),p=ae();o.useRef(null),o.useRef(null);const u=fe({initialValues:{roles:""},validationSchema:ee({roles:me().required("This field is required").min(100,"Roles and Responsibilty must have 100 characters")}),onSubmit:m=>{console.log(m.roles,"values"),p(U({...n,roles:m.roles})),a(!1)},enableReinitialize:!0}),q=(m=!1,k,w)=>{const j=m;if(console.log("Fetching AI job description..."),!k){console.log("Title or sector is empty. Skipping AI job description fetch.");return}u.values.roles="",console.log("Fetching AI job description..."),t(!0);let f=u.values.roles||"";const b=[];let E=!1;const $=()=>{for(;b.length>0;){t(!0);let L=b.shift();L=L.replace(/\n/g,"<br />"),f+=L,u.setFieldValue("roles",f)}E=!1},I=new EventSource(`https://api.avua.com/autofill/external/v1/roles-responsiblities-stream?title=${k} ${w?`§or=${w}`:""}`);I.onmessage=L=>{const x=JSON.parse(L.data),J=x.choices[0]?.delta?.content;J&&(b.push(J),E||(E=!0,$())),x.choices[0]?.finish_reason==="stop"&&(f=f.replace(/-\s\*\*(.+?)\*\*/g,"**$1**").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/(\<br\s*\/?\>)\s*-\s/g,"$1 ⢠"),u.setFieldValue("roles",f),I.close(),t(!1),j&&(console.log("autosavecalled"),p(U({...n,roles:f}))))},I.onerror=L=>{I.close(),console.log("Error in fetching job description:",L)}},C=m=>!m||typeof m!="string"?(console.log("Description is empty or invalid:",m),""):m.replace(/^<strong>Job Description<\/strong><br\s*\/?>\s*/i,"").replace(/\n/g,"<br>").replace(/-\s\*\*(.+?)\*\*/g,"**$1**").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/(\<br\s*\/?\>)\s*-\s/g,"$1 ⢠");return console.log(n?.roles,"dxfcgvhbjnm"),o.useMemo(()=>{n?.roles?u.setFieldValue("roles",n?.roles):q(!0,n?.prompt,n?.industry)},[n.prompt,n.industry]),e.jsxs(e.Fragment,{children:[!N&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-5 items-center justify-between",children:[e.jsx("h3",{className:"text-[23px] leading-7 font-normal text-[#1b1b1b]",children:"Job Description "}),e.jsx("img",{src:ce,alt:"",className:"mr-4 cursor-pointer",onClick:()=>a(!0)})]}),e.jsx("div",{className:"w-full text-[16px] leading-6 ",children:e.jsx(ke,{id:"RTR",readOnly:!0,style:{height:"100%",width:"100%"},theme:"bubble",value:C(n?.roles||u.values.roles)})})]}),N&&e.jsx("div",{className:"p-5 rounded-[10px] bg-[#ffffff]",children:e.jsxs("form",{className:"flex flex-col space-y-[30px]",onSubmit:u.handleSubmit,children:[e.jsx("h3",{className:"text-[18px] leading-6 font-semibold text-[#424242]",children:"Job Requirements"}),e.jsxs("div",{className:"w-full relative",children:[e.jsx("div",{className:"absolute right-2 top-2",children:e.jsx("button",{type:"button",className:" flex justify-center items-center text-purple bg-lightPurple roun
2ded-md p-1 space-x-1 cursor-pointer hover:scale-[102%] active:scale-100 transition-all duration-300 text-caption",children:y?e.jsxs("div",{className:"flex w-fit justify-center items-center space-x-1",children:[e.jsx("p",{children:"Generating"}),e.jsx(Pe,{color:"#604289",height:15,width:15,strokeWidth:5})]}):e.jsxs("div",{className:"flex w-fit justify-center items-center space-x-1",onClick:()=>q(!1,n?.job_title?.title,n?.industry),children:[e.jsx(Nt,{}),e.jsx("p",{children:"Generate with AI"})]})})}),e.jsx(ke,{placeholder:"Enter job description",id:"RTR",modules:h,style:{height:"500px",width:"100%",backgroundColor:"#f8f9fe",paddingBottom:"40px"},theme:"snow",value:C(u.values.roles),onChange:m=>u.setFieldValue("roles",m)}),u.touched.roles&&u.errors.roles&&e.jsx("div",{className:"text-caption text-red w-fit",children:u.errors.roles})]}),y?e.jsx("div",{className:"flex justify-end items-center ",children:e.jsx($e,{visible:!0,height:"70",width:"100",color:"#4fa94d",ariaLabel:"line-wave-loading",wrapperStyle:{marginTop:"-30px"},wrapperClass:"",firstLineColor:"purple",middleLineColor:"purple",lastLineColor:"purple"})}):e.jsxs("div",{className:" w-full flex justify-end mt-[50px] gap-[20px]",children:[e.jsx("button",{type:"button",onClick:()=>a(!1),children:"Cancel"}),e.jsx("button",{type:"submit",className:"bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[30px] py-[10px] rounded-full",children:"Save"})]})]})})]})},Yt=[{value:"diploma",label:"Diploma"},{value:"graduate",label:"Undergraduate (Bachelor's)"},{value:"post_graduate",label:"Post Graduate (Master's)"},{value:"doctorate",label:"Doctorate"}],ve=["BH","EG","IR","IQ","IL","JO","KW","LB","OM","PS","QA","SA","SY","AE","YE"],Kt=({isEditPreferredCandidates:N,setIsEditPreferredCandidates:a})=>{const y=ae(),t=R(c=>c.postJobData);R(c=>c.auth.token);const g=R(c=>c.employerProfileData.is_international),[s,h]=o.useState(""),[n,p]=o.useState(""),[u,q]=o.useState([]),[C,m]=o.useState(!1),[k,w]=o.useState(!1),[j,f]=o.useState([]),[b,E]=o.useState([]),[$,I]=o.useState([]),[L,x]=o.useState([]),[J,P]=o.useState([]),[A,Q]=o.use
2State(0),[W,M]=o.useState(0),[D,v]=o.useState({min:{id:"",salary:""},max:{id:"",salary:""},visibility:!1}),r=fe({initialValues:{qualification_level:"",qualification:{id:"",name:""},currency:{id:"",country_id:"",code:""},field_of_study:{id:"",name:""},salary_type:"",required_exp:{min:0,max:0},field_of_study_pref:!1,availability:0},onSubmit:c=>{!s&&!n&&(y(U({...t,qualification_level:c.qualification_level,qualification:c.qualification,field_of_study:c.field_of_study,field_of_study_pref:c.field_of_study_pref,salary_type:c.salary_type,currency:c.currency,min_expected_salary:D.min,max_expected_salary:D.max,expected_salary:{visibility:D.visibility},availability:c.availability??0})),a(!1))}}),X=c=>{A!==0&&clearTimeout(A);const _=setTimeout(()=>l(c),250);Q(_)},te=async c=>{try{const _=await St(c);console.log("Qualification fields : ",_.data.data),I(_.data.data),x(_.data.data)}catch(_){console.error("Error:",_)}},l=async c=>{try{const _=await Ct(c);_.data.data&&P(_.data.data)}catch(_){console.error("Error:",_)}},T=async c=>{console.log("update qualification level : ",c.target.value),await r.setFieldValue("qualification_level",c.target.value),r.setFieldValue("field_of_study",{id:"",name:""}),r.validateField("qualification_level"),te(c.target.value)},O=c=>{typeof c=="object"?r.setFieldValue("field_of_study",c):(X(c),r.setFieldValue("field_of_study",{id:"",name:c}))},Y=c=>{r.setFieldValue("field_of_study_pref",c.target.checked)},de=()=>{let c=null,_=null;const V=parseInt(D?.min?.id),i=parseInt(D?.max?.id),F=parseInt(D?.min?.id),K=parseInt(D?.max?.id);r?.values?.currency?.code==="USD"||t?.is_edit?D?.max?.salary?F<=1?c="Minimum expected salary should be greater than 1.":K<=1?_="Maximum expected salary should be greater than 1.":K<F&&(_="Maximum expected salary must be greater than or equal to minimum expected salary."):_="":!D?.max?.id&&D?.max?.salary&&!t?.is_edit?_="Please select maximum salary from dropdown only ":!D?.min?.id&&D?.min?.salary&&!t?.is_edit?c="Please select minimum salary from dropdown only":i<V&&(_="Maximum expected salary must be greater than minimum expected salary."),h(c),p(_)},be=async c=>{const _=c.target.value,V=j.find(i=>i.code===_);if(V){r.setFieldValue("currency",V),v({min:{id:"",salary:""},max:{id:"",salary:""},visibility:!1}),h(null),p(null),m(!1),w(!1);const i=De(V.code,t?.job_location?.code);E(i)}else console.error("Invalid currency selected")},le=c=>{const _=c.target.value;if(h(null),r?.values?.currency?.code==="INR"||r?.values?.currency?.code==="USD"){const V=b.filter(i=>i.salary.startsWith(_));q(V),m(!0),w(!1)}v({...D,min:{id:t?.is_edit?_:"",salary:_}})},ue=c=>{const _=c.target.value;if(p(null),r?.values?.currency?.code==="INR"||r?.values?.currency?.code==="USD"){const V=b.filter(i=>i.salary.startsWith(_));q(V),w(!0),m(!1)}v({...D,max:{id:t?.is_edit?_:"",salary:_}})},ie=c=>{v({...D,min:{id:c.id,salary:c.salary}}),m(!1),w(!1)},ye=c=>{v({...D,max:{id:c.id,salary:c.salary}}),m(!1),w(!1)},he=c=>{switch(c){case 0:r.setFieldValue("availability",0),M(0);break;case 17:r.setFieldValue("availability",7),M(17);break;case 34:r.setFieldValue("availability",14),M(34);break;case 51:r.setFieldValue("availability",30),M(51);break;case 68:r.setFieldValue("availability",60),M(68);break;case 85:r.setFieldValue("availability",90),M(85);break;case 100:r.setFieldValue("availability",180),M(100);break}},se=async()=>{try{const c=await wt();if(c?.msg=="success"){const _=[];c?.data&&c?.data?.forEach(V=>{(V?.code==="INR"||V?.code==="USD")&&_.push(V)}),f(_),r.setFieldValue("currency",t.country.code==="IN"?{id:"7b321ae2-a821-4064-b841-d4e8d6840090",country_id:"af6432c2-2800-4029-9014-786d8063d885",code:"INR"}:t?.currency)}}catch(c){console.log("ERROR",c)}},xe=c=>{v({...D,visibility:c.target.checked})};o.useEffect(()=>{se()},[]),o.useEffect(()=>{r.setFieldValue("qualification_level",t.qualification_level?t.qualification_level:null),r.setFieldValue("qualification",t.qualification),r.setFieldValue("field_of_study",t.field_of_study),r.setFieldValue("salary_type",t.salary_type?t.salary_type:ve.includes(t?.country?.code)?"monthly":"annually"),r.setFieldValue("field_of_study_pref",t.field_of_study_pref),r.setFieldValue("availability",t.availability),v({visibility:t?.expected_salary?.visibility,min:t?.min_expected_salary,max:t?.max_expected_salary}),M(t?.availability?t?.availability:0)},[t]),o.useEffect(()=>{{const c=t?.country?.code==="IN"||t?.country?.name==="India"?"INR":"USD",_=t?.country?.code,V=De(c,_);E(V)}},[t,g]);const oe=()=>{de(),r.handleSubmit()};return e.jsxs(e.Fragment,{children:[!N&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col gap-[10px]",children:[e.jsxs("div",{className:"flex gap-5 items-center justify-between",children:[e.jsxs("h3",{className:"text-[23px] leading-7 font-normal text-[#1b1b1b]",children:["Preferred Candidate Details"," "]}),e.jsx("img",{src:ce,alt:"",className:"mr-4 cursor-pointer",onClick:()=>a(!0)})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-[20px]",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-[16px] leading-6 font-normal text-[#424242]",children:"Qualification Level"}),e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[!t?.qualification_level&&"Not Disclosed",t?.qualification_level=="diploma"&&"Diploma",t?.qualification_level=="graduate"&&"Undergraduate (Bachelor's)",t?.qualification_level=="post_graduate"&&"Post Graduate (Master's)",t?.qualification_level=="doctorate"&&"Doctorate"]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-[16px] leading-6 font-normal text-[#424242]",children:"Field of Study"}),e.jsx("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:t?.field_of_study?.name?t?.field_of_study?.name:"Not Disclosed"})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-[16px] leading-6 font-normal text-[#424242]",children:"Salary"}),e.jsx("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:t?.min_expected_salary?.id||t?.max_expected_salary?.id?`${Ge(t?.currency?.code)} ${t?.min_expected_salary?.id?t?.min_expected_salary?.id:""} to ${t?.max_expected_salary?.id?t?.max_expected_salary?.id:""}`:"Not Disclosed"})]}),!t?.is_basic_job&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-[16px] leading-6 font-normal text-[#424242]",children:"Availability"}),e.jsx("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:t.availability?`${t.availability} days`:"Immediate Joiner"})]})]})]})}),N&&e.jsx("div",{className:"p-5 rounded-[10px] bg-[#ffffff]",children:e.jsxs("form",{className:"flex flex-col space-y-[30px]",children:[e.jsx("h3",{className:"text-[18px] leading-6 font-semibold text-[#424242]",children:"Preferred candidate details"}),e.jsx("div",{className:"",children:e.jsx("div",{className:"w-full",children:e.jsx(Le,{label:"Qualification Level",name:"qualification_level",value:r.values.qualification_level||t.qualification_level,onChange:c=>T(c),error:r.touched.qualification_level&&r.errors.qualification_level?r.errors.qualification_level:"",options:Yt,style:"relative",mandatory:!1})})}),e.jsxs("div",{className:" w-full flex mt-2 space-x-4 justify-center items-center",children:[e.jsx(Me,{label:"Field of study",name:"field_of_study",value:r?.values?.field_of_study&&r?.values?.field_of_study?.name||"",onChange:O,error:r?.values?.field_of_study?.name&&r?.errors?.field_of_study?.id,placeholder:"Ex: Computer Science",querySearchResults:J})," ",!t.is_basic_job&&e.jsxs("div",{className:" w-[99px] flex whitespace-nowrap justify-center items-center space-x-1 mt-6",children:[e.jsx("input",{type:"checkbox",className:"w-[23px] h-[22px] border border-[#746C80] rounded-sm",checked:r.values.field_of_study_pref,onCh
2ange:Y}),e.jsx("label",{className:" font-poppins text-[#5C5C5C] font-[500] text-subtitle2",children:"Must Have"})]})]}),e.jsx("div",{className:"mt-2",children:e.jsx(Le,{label:"Salary Type",name:"salary_type",value:r.values.salary_type||t.salary_type,onChange:r.handleChange,error:r.touched.salary_type&&r.errors.salary_type,options:ve?.includes(t?.country?.code)||t?.salary_type==="monthly"?[{value:"monthly",label:"Monthly"}]:[{value:"annually",label:"Annually"}],style:"relative ",noTitle:!0})}),e.jsxs("div",{className:"flex flex-col gap-[20px]",children:[e.jsxs("div",{className:"flex w-full h-fit justify-start items-start space-x-3 ",children:[e.jsx("div",{className:"flex flex-col w-full",children:e.jsx(Rt,{label:"Currency",name:"currency",value:r.values.currency&&r.values.currency.code||"",onChange:be,style:"h-full mt-3 w-full",geoResponse:t?.country?.code,mandatory:!0,options:j,noTitle:!!r.values.currency})}),e.jsx("div",{className:"w-full",children:e.jsxs("div",{className:" flex flex-col",children:[e.jsx(Ne,{label:"Minimum Salary",name:"min_expected_salary",value:D?.min?.salary,onChange:le,placeholder:t?.country?ve?.includes(t.country.code||r?.values?.country?.code)?"5k":t?.country?.code==="IN"?"8LPA":"50k":r?.values?.currency?.code!=="INR"?"50k":"8LPA",filteredDropDown:u,isSalary:!0,isPrefered:!0,showDropDown:C,setShowDropdown:m,setExpectedSalaryDropDown:w,handleItemClick:ie,type:"text"}),s&&e.jsx("p",{className:" text-red text-caption",children:s})]})}),e.jsx("div",{className:" w-full",children:e.jsxs("div",{className:" flex flex-col",children:[e.jsx(Ne,{label:"Maximum Salary",name:"max_expected_salary",value:D?.max?.salary,onChange:ue,placeholder:t?.country?ve?.includes(t.country.code)?"12k":t?.country?.code==="IN"?"10LPA":"75k":r?.values?.currency?.code!=="INR"?"75k":"10LPA",filteredDropDown:u,isSalary:!0,showExpSalaryDropDown:k,setExpectedSalaryDropDown:w,setShowDropdown:m,isPrefered:!0,handleItemClick:ye,type:"text"}),n&&e.jsx("p",{className:" text-red text-caption",children:n})]})})]}),e.jsxs("label",{className:"flex w-full items-center space-x-2",children:[e.jsx("input",{name:"salary visibility",type:"checkbox",className:"form-checkbox w-5 h-5 outline-none",checked:D?.visibility,onChange:xe}),e.jsx("span",{className:"text-subtitle2 font-poppins",children:"Do not show salary to applicants"})]})]}),!t?.is_basic_job&&e.jsxs("div",{className:"flex flex-col mt-5",children:[e.jsx("p",{className:"text-body1 mb-2",children:"Availability"}),e.jsxs("div",{className:"flex",children:[e.jsx(Mt,{styles:{track:{backgroundColor:"#2B1845",height:10},rail:{backgroundColor:"#E5D7FF",height:10},handle:{borderColor:"#F5DFD6",height:20,width:20,backgroundColor:"#F5DFD6"}},dotStyle:{borderColor:"transparent",backgroundColor:"transparent"},activeDotStyle:{borderColor:"transparent",backgroundColor:"transparent"},steps:null,value:W,dots:!0,min:0,step:17,onChange:c=>he(c)}),e.jsx("div",{className:"flex justify-center items-center border border-gray rounded-full w-1/3 ml-5 text-caption cursor-default",children:r.values.availability===0||r.values.availability===null?"Immediate Joiner":r.values.availability+" Days"})]})]}),e.jsxs("div",{className:" w-full flex justify-end mt-[50px] gap-[20px]",children:[e.jsx("button",{type:"button",onClick:()=>a(!1),children:"Cancel"}),e.jsx("button",{type:"button",onClick:oe,className:"bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[30px] py-[10px] rounded-full",children:"Save"})]})]})})]})},Xt=({title:N,options:a,selected:y,onSelect:t,errors:g,mandatory:s,isPrefered:h})=>e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex gap-5 items-center",children:[e.jsx("div",{className:"w-[20px]",children:e.jsx("img",{src:H.CommonHeader.header_logo,alt:""})}),e.jsx("p",{className:"text-[18px] leading-[21px] text-[#000000]",children:N})]}),e.jsx("div",{className:"flex space-x-2 gap-2 md:gap-0 flex-wrap ml-[40px]",children:a.map((n,p)=>e.jsx("button",{type:"button",className:` border px-[25px] py-[10px] rounded-full border-[#d9d9d9] 3 ${y?.includes(typeof n=="object"?n.id:n)?"bg-darkPurple text-white":"bg-white text-textLightGray"}`,onClick:()=>t(typeof n=="object"?n.id:n),children:e.jsx("p",{className:"text-subtitle2",children:typeof n=="object"?n.label:n})},p))}),e.jsx("p",{className:"text-caption text-red",children:g})]}),Zt=({setOpenDraftModal:N})=>{const a=R(h=>h.postJobData),y=R(h=>h.auth.token),t=Fe(),g=async h=>{try{const n=await He(y,a?.id);console.log(n,"isdeleted"),n&&t("/employer/dashboard")}catch(n){console.log(n)}},s=async()=>{const h=[];a?.skills?.map(u=>h.push(u.name));const n={job_title:a.job_title.title?.trim(),jd_path:a?.jd_url,prompt:a?.prompt,roles:a?.roles,skills:h,company:a?.company?.id||null,industry:a?.industry?.id||a?.industry||null,industry_sub_domain:a?.industry?.title||null,employment_mode:a?.employment_mode,location_id:a?.job_location?.id||null,job_type:a?.job_type,country_id:a?.country?.id,vacancies:null,job_space_id:a?.job_space?.i
3d==""?null:a?.job_space?.id,qualification_level:a?.qualification_level||null,qualification:null,fields_of_study:a?.field_of_study?.name?[a?.field_of_study?.name?.trim()]:null,required_exp:a?.required_exp||null,salary_type:a?.salary_type,currency_id:!a?.min_expected_salary?.id&&!a?.min_expected_salary?.id||!a?.max_expected_salary?.id&&!a?.max_expected_salary?.salary?null:a?.currency?.id,expected_salary:a?.min_expected_salary?.id&&a?.min_expected_salary?.salary||a?.max_expected_salary?.id&&a?.max_expected_salary?.salary?{min:typeof a.min_expected_salary?.id=="string"?Number(a.min_expected_salary.salary):a.min_expected_salary?.id,max:typeof a.max_expected_salary?.id=="string"?Number(a.max_expected_salary.salary):a.max_expected_salary?.id,visibility:a?.expected_salary?.visibility}:null,availability:a?.is_basic_job?null:a?.availability??0,is_private:a?.is_basic_job?null:a?.is_private,is_draft:!0,keywords:null,field_of_study_pref:a.is_basic_job?!1:a?.field_of_study_pref,from_location_only:a.is_basic_job?!1:a?.from_location_only,include_relocation:a.is_basic_job?!1:a?.include_relocation,is_basic_job:!!a?.is_basic_job,is_international:a?.is_international},p={Authorization:`Bearer ${y}`};try{if(a?.id){const u=a?.id,q=await Je(p,n,u);
3(q.status===201||q.status===200)&&t("/employer/dashboard")}}catch(u){console.log(u,"Error in post draft job")}};return console.log(a,"draft post job data"),e.jsx("div",{className:"w-full fixed inset-0 z-50 flex items-center justify-center backdrop-blur-lg",children:e.jsxs("div",{className:"md:w-[539px] md:h-[348px] drop-shadow-2xl bg-white relative flex flex-col justify-center items-center px-[40px] py-[30px] gap-[50px]",children:[e.jsx("img",{src:H.verify.x_circle,alt:"",className:" absolute right-2 top-3",onClick:()=>N(!1)}),e.jsxs("div",{className:" w-full flex flex-col gap-[20px] justify-center items-center",children:[e.jsx("img",{src:H.jobPost.draft_job,alt:""}),e.jsx("p",{className:" font-poppins font-normal text-center text-[18px] leading-[27px] text-[#7B7B7B]",children:"Would you like to save this as a draft? If you leave the page, all information will be lost."})]}),e.jsxs("div",{className:" w-full flex justify-between gap-[40px]",children:[e.jsx("button",{onClick:g,className:"w-full min-w-[180px] px-[10px] py-[20px] border border-[#2B1845] rounded-full ",children:e.jsx("p",{className:" text-[#2B1845] font-poppins font-[500] text-[16px] leading-[19.2px]",children:"Delete"})}),e.jsx("button",{onClick:s,className:"w-full min-w-[199px] px-[10px] py-[20px] bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] rounded-full ",children:e.jsx("p",{className:" text-white font-poppins font-[500] text-[16px] leading-[19.2px]",children:"Save"})})]})]})})},es=({label:N,name:a,value:y,placeholder:t,onChange:g,onBlur:s,error:h,setError:n,querySearchResults:p,getJobSpaces:u,newJobSpaceInput:q,setNewJobSpaceInput:C})=>{const m=B.useRef(null),[k,w]=B.useState(!1),[j,f]=B.useState(!1),[b,E]=B.useState(""),$=R(v=>v.auth.token),[I,L]=B.useState(!1),[x,J]=B.useState(!1),P=v=>{m.current&&!m.current.contains(v.target)&&w(!1)},A=()=>{w(!0)},Q=v=>{w(!1),g(v),C("")},W=v=>{const r=v.target.value;C(r),r.trim()?(w(!0),J(!1)):w(!1),g(r)},M=async()=>{console.log("Creating new job space:",q);const v={company_name:"",title:q,description:""};try{const r=await Jt($,v);if(r.msg==="success"){const X={id:r.data,title:q};g(X),L(!0),qt.success(" New jobspace created",{autoClose:1e4}),C(""),u(),J(!0)}}catch(r){console.log(r)}};B.useEffect(()=>(document.addEventListener("mousedown",P),()=>{document.removeEventListener("mousedown",P)}),[]);const D=p?.some(v=>v?.title?.toLowerCase()===q?.toLowerCase());return e.jsxs("div",{className:"relative",children:[e.jsxs("label",{htmlFor:a,className:"",children:[j&&e.jsx("div",{style:{position:"absolute",width:"200px",height:"50px",backgroundColor:"rgba(0,0,0,0.8)",color:"#fff",borderRadius:"5px"},children:e.jsx("p",{className:"text-caption p-2",children:b})}),e.jsx("input",{id:a,className:` w-full outline-none border border-[#d9d9d9] px-[15px] py-[2px] bg-[#ffffff] rounded-full 4 `,type:"text",name:a,placeholder:t,onBlur:s,value:y,onChange:W,autoComplete:"off",onClick:A,onKeyPress:v=>{v.key==="Enter"&&q.trim()!==""&&(v.preventDefault(),M())}}),e.jsx(kt,{className:"absolute top-[7px] right-4 text-[15px]"})]}),p&&p?.length!==0&&k&&!x&&e.jsx("div",{ref:m,children:e.jsx("div",{className:"absolute scrollbar-hide z-50 left-0 top-10 w-full bg-white border border-[#d9d9d9] shadow-md rounded-2xl max-h-[225px] overflow-scroll py-2",children:p?.map(v=>e.jsx("div",{className:"px-4 py-2 cursor-pointer hover:bg-[#f5f5f5] border-b border-b-[#d9d9d9] mx-2 rounded-md",onClick:()=>Q(v),children:v.title?v.title:v.name},v.id))})}),!D&&q.trim()!==""&&e.jsxs("div",{className:"absolute z-40 left-0 top-10 w-full px-4 py-2 flex cursor-pointer hover:bg-gray-100 border justify-between items-center rounded-2xl border-[#d9d9d9]",onClick:M,children:[e.jsx("p",{children:"Create New"}),e.jsx(Dt,{})]}),h&&e.jsx("p",{className:"text-red text-caption mt-1",children:h}),e.jsx(Ft,{position:"bottom-left"})]})},ts=["A jobspace helps you to manage your job posts and applicants ."],ss=({handleEmployerNavigation:N})=>{const a=ae(),y=R(x=>x.postJobData),[t,g]=o.useState(""),[s,h]=o.useState([]),[n,p]=o.useState([]),[u,q]=o.useState(!1),[C,m]=B.useState(!1),[k,w]=B.useState(""),j=R(x=>x.auth.token),f=x=>{m(!0),w(x)},b=()=>{m(!1),w("")},E=fe({initialValues:{job_space:""},onSubmit:x=>{setSubmitting(!0)}}),$=x=>{const J=s.filter(P=>P.title.toLowerCase().includes(x.toLowerCase()));p(J),x.trim()===""&&p(s)},I=x=>
4{if(q(!0),x?.id)E.setFieldValue("job_space",x),a(U({...y,job_space:{id:x.id,title:x.title}}));else{$(x);const J={id:"",title:x};E.setFieldValue("job_space",J)}},L=async()=>{try{const x=await Oe(j);h(x.data.job_spaces),p(x.data.job_spaces)}catch{console.log("Error getting JOB SPACES : ",response.data.job_spaces)}};return o.useEffect(()=>{L()},[]),o.useEffect(()=>{E.setFieldValue("job_space",y.job_space)},[y.job_space]),e.jsx("div",{className:"w-full relative h-[100px] flex justify-center",children:e.jsxs("div",{className:"max-w-7xl items-center flex w-full h-full gap-5",children:[e.jsx("img",{onClick:N,src:H.CommonHeader.avua_header_logo,className:"cursor-pointer pl- h-[28px]",alt:"header_logo"}),e.jsxs("div",{className:"flex items-center gap-[10px]",children:[e.jsxs("div",{className:"text-[18px] leading-[27px] text-[#424242] flex gap-1",children:[e.jsx("span",{children:"Jobspace"}),e.jsx("img",{src:H.Profile.IButton,alt:"",className:"w-3 mt-1 ",onMouseEnter:()=>f(ts[0]),onMouseLeave:b}),C&&e.jsx("div",{style:{position:"absolute",width:"300px",height:"50px",backgroundColor:"rgba(0,0,0,0.8)",color:"#fff",borderRadius:"5px",top:"70px"},children:e.jsx("p",{className:"text-caption p-2",children:k})})]}),e.jsx(es,{placeholder:"Search jobspaces",onChange:I,newJobSpaceInput:t,setNewJobSpaceInput:g,getJobSpaces:L,value:u||E?.values?.job_space?.title?E?.values?.job_space?.title:"untitled",querySearchResults:n})]})]})})},as=()=>{const N=Fe();return e.jsx("div",{className:"w-screen h-sceem fixed z-[60] inset-0 flex items-center justify-center backdrop-blur-lg",children:e.jsx("div",{className:"md:w-[628px] w-full drop-shadow-2xl bg-white p-[40px] items-center",children:e.jsxs("div",{className:"w-full h-full flex flex-col items-center gap-[50px]",children:[e.jsx("img",{src:H.jobPost.postedJob,alt:"",className:"h-[127px] w-[127px]"}),e.jsxs("div",{className:"flex flex-col items-center gap-[20px]",children:[e.jsx("p",{className:"text-center font-poppins font-[500] text-[35px] leading-[42px] text-[#1B1B1B]",children:"Thank you for posting the new job."}),e.jsxs("p",{className:" text-center font-poppins text-[18px] leading-[27px] text-[#424242]",children:["The post is live and candidates can apply to your job. You can see applicant details in your",e.jsx("span",{style:{color:"transparent"},className:" bg-gradient-to-r from-[#864EFF] to-[#502F99] bg-clip-text font-poppins text-[18px] leading-[27px] ml-1",children:"jobspace."})," "]})]}),e.jsx("button",{onClick:()=>N("/employer/dashboard"),className:" border border-[#2B1845] px-[50px] py-[20px] rounded-full",children:e.jsx("p",{className:" font-poppins font-[500] text-[16px] leading-[19.2px] text-[#2B1845]",children:"Go to dashboard"})})]})})})},ls=["Applicants from all over the world can apply to your jobs."],is=({title:N,options:a,selected:y,onSelect:t,errors:g,mandatory:s,isPrefered:h})=>{const[n,p]=o.useState(!1),[u,q]=o.useState(""),C=k=>{p(!0),q(k)},m=()=>{p(!1),q("")};return e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex gap-5 items-center",children:[e.jsx("div",{className:"w-[20px]",children:e.jsx("img",{src:H.CommonHeader.header_logo,alt:""})}),e.jsxs("div",{className:"flex gap-1 relative",children:[e.jsx("p",{className:"text-[18px] leading-[21px] text-[#000000]",children:N}),e.jsx("img",{src:H.Profile.IButton,alt:"",className:"w-3",onMouseEnter:()=>C(ls[0]),onMouseLeave:m}),n&&e.jsx("div",{style:{position:"absolute",width:"300px",height:"50px",backgroundColor:"rgba(0,0,0,0.8)",color:"#fff",borderRadius:"5px",bottom:"25px"},children:e.jsx("p",{className:"text-caption p-2",children:u})})]})]}),e.jsx("div",{className:"flex space-x-2 gap-2 md:gap-0 flex-wrap ml-[40px]",children:a.map(k=>e.jsx("button",{type:"button",className:`border px-[25px] py-[10px] rounded-full border-[#d9d9d9] ${y===k.id?"bg-darkPurple text-white":"bg-white text-textLightGray"}`,onClick:()=>t(k.id),children:e.jsx("p",{className:"text-subtitle2",children:k.label})},k.id))}),g&&e.jsx("p",{className:"text-caption text-red",children:g})]})}
4,os=({job:N,postJobData:a,setShowPreviewModal:y,companyInfo:t,handleSubmitjobDetails:g})=>{const s=It().format("YYYY-MM-DD"),h=n=>!n||typeof n!="string"?(console.log("Description is empty or invalid:",n),""):n.replace(/^<strong>Job Description<\/strong><br\s*\/?>\s*/i,"").replace(/\n/g,"<br>").replace(/-\s\*\*(.+?)\*\*/g,"**$1**").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/(\<br\s*\/?\>)\s*-\s/g,"$1 ⢠");return console.log(t,"companyinfo"),e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-40 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-[#f8f9fe] w-[998px] max-w-full rounded-2xl shadow-lg flex flex-col max-h-[90vh] p-[20px]",children:[e.jsx("div",{className:"flex items-center justify-end sticky top-0 right-0 z-10",children:e.jsx("img",{src:H.verify.x_circle,className:"text-gray-400 hover:text-black text-2xl cursor-pointer",onClick:()=>y(!1)})}),e.jsxs("div",{className:"overflow-y-auto flex-grow p-6",children:[e.jsxs("div",{className:"rounded-lg p-4 bg-gray-50 mb-6 bg-[#ffffff] flex flex-col space-y-5",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("div",{className:"flex items-center gap-[20px]",children:[e.jsx("div",{children:e.jsx("img",{src:t?.logo||H.Recommended_Jobs.default_company_logo,alt:"",className:"h-[70px] w-[70px]"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[23px] leading-7 text-[#1b1b1b]",children:a.job_title.title}),e.jsx("p",{className:"text-[18px] leading-7 text-[#7b7b7b]",children:t.name}),e.jsx("p",{className:"text-[18px] leading-7 text-[#7b7b7b]",children:a?.job_location?e.jsxs(e.Fragment,{children:[a.job_location.name&&`${a.job_location.name}, `,a.job_location.state&&`${a.job_location.state}, `,a.job_location.country&&`${a.job_location.country}.`]}):a?.country_details?.name?e.jsx(e.Fragment,{children:a.country_details.name}):"Location: Not Disclosed"})]})]}),e.jsxs("div",{className:"flex space-x-2 items-center",children:[e.jsx("p",{className:"text-[14px] leading-5 text-[#424242]",children:"Share"}),e.jsx(Ot,{className:""}),e.jsx(Et,{})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-3 text-sm text-gray-600",children:[e.jsx("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:a?.required_exp?.min===void 0&&a?.required_exp?.max===void 0?"Experience: Not Disclosed":a?.required_exp?.max===void 0||a?.required_exp?.max===99||a?.required_exp?.max===0?`${a.required_exp.min} year${a.required_exp.min>1?"s":""} experience`:`${a.required_exp.min} - ${a.required_exp.max} years experience`}),e.jsx("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:a?.min_expected_salary?.id||a?.max_expected_salary?.id?`${Ge(a?.currency?.code)} ${a?.min_expected_salary?.id?a?.min_expected_salary?.id:""} to ${a?.max_expected_salary?.id?a?.max_expected_salary?.id:""}`:"Salary: Not Disclosed"}),e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[a?.employment_mode?.[0]==="On-site"&&"On site",a?.employment_mode?.[0]==="Hybrid"&&"Hybrid",a?.employment_mode?.[0]==="Remote"&&"Remote"]}),e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[a.job_type?.[0]==="full_time"&&"Full Time",a.job_type?.[0]==="part_time"&&"Part Time",a.job_type?.[0]==="contract_freelancer"&&"Contract/Freelance",a.job_type?.[0]==="internship"&&"Internship"]}),!a?.is_basic_job&&e.jsx("div",{children:e.jsxs("p",{className:"text-[16px] leading-6 text-[#7b7b7b]",children:[a?.industry==="it"&&"IT",a?.industry==="pharma"&&"Pharma",a?.industry==="finance"&&"Finance",a?.industry==="energy"&&"Energy"]})})]}),e.jsx("div",{className:"flex border w-full border-[#d9d9d9]"}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("p",{className:"text-[16px] leading-6 font-normal text-[#7b7b7b]",children:["Posted: ",s]}),e.jsx("button",{className:"bg-[#d9d9d9] px-[20px] py-[10px] rounded-full text-[#F8F9FE]",children:"Apply"})]})]}),e.jsxs("div",{className:"bg-[#ffffff] p-[20px] rounded-lg",children:[e.jsx("h3",{className:"text-[23px] leading-7 font-normal text-[#1b1b1b]",children:"Job Description "}),e.jsx("div",{className:"w-full text-[16px] leading-6 ",children:e.jsx(ke,{id:"RTR",readOnly:!0,style:{height:"100%",width:"100%"},theme:"bubble",value:h(a?.roles||"")})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-[23px] leading-7 font-normal text-[#1b1b1b] pb-[20px]",children:"Skills"}),e.jsx("div",{className:"flex flex-wrap gap-[10px]",children:!!a?.skills&&a?.skills.map((n,p)=>e.jsx("span",{className:"border border-[#d9d9d9] rounded-full px-[15px] py-[2px]",children:n.name},p))})]})]})]}),e.jsxs("div",{className:" border-t pt-[20px] flex justify-between sticky bottom-0 z-10",children:[e.jsx("button",{className:"text-[16px] text-[#6B3BAB] px-[50px] py-[20px] rounded-full font-semibold",onClick:()=>y(!1),children:"Close"}),e.jsx("button",{className:"bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[50px] py-[20px] rounded-full",onClick:g,children:"Publish"})]})]})})},ks=()=>{const N=Fe(),a=Tt(),y=ae(),t=a?.state?.jobData,g=R(d=>d.auth.token),s=R(d=>d.postJobData),h=R(d=>d.employerProfileData.is_international),n=!!t?.industry,p=!!t?.job_title?.t
4itle,u=!h&&t?.job_location?.country!=="India"?!1:!!t?.job_location?.city||!!t?.job_location?.state||!!t?.job_location?.country,[q,C]=o.useState(!0),m=h?!!t?.country_details?.name:!0,k=!!t?.required_exp?.min||!!t?.required_exp?.max,w=t?.is_international===null,[j,f]=o.useState({...s}),[b,E]=o.useState(!1),[$,I]=o.useState(0),[L,x]=o.useState([]),[J,P]=o.useState([]),[A,Q]=o.useState(!1),[W,M]=o.useState(!1),[D,v]=o.useState(!1),[r,X]=o.useState(!1),[te,l]=o.useState(!1),[T,O]=o.useState(!1),[Y,de]=o.useState({}),[be,le]=o.useState(!1),[ue,ie]=o.useState(!1),[ye,he]=o.useState(!1),[se,xe]=o.useState(!1),[oe,c]=o.useState({}),[_,V]=o.useState(!1),[i,F]=o.useState(!1),[K,ne]=o.useState(!1),[Z,ze]=o.useState(!1),[Ue,we]=o.useState(!1),We=o.useRef(null),[je,Ye]=o.useState(!1),[Ke,_e]=o.useState(!1),Xe=[{id:"",label:"Fresher",min:0,max:1},{id:"",label:"1-3 years",min:1,max:3},{id:"",label:"3-7 years",min:3,max:7},{id:"",label:"7-15 years",min:7,max:15},{id:"",label:"15+ years",min:15,max:99}],Ze=[{id:"pharma",label:"Pharma"},{id:"it",label:"IT"},{id:"finance",label:"Finance"},{id:"energy",label:"Energy"}],et=[{id:!0,label:"Yes"},{id:!1,label:"No"}],tt=d=>{console.log("Sector : ",d),!Z&&(ne(!0),f(S=>({...S,industry:d})),y(U({...s,industry:d})))},[st,at]=o.useState(null),[qe,lt]=o.useState(null),it=async()=>{try{const d=await Te.get(Lt.svg.mockInterviewLoader),S=await Te.get(Pt.Employer.similarCvLoading);at(d?.data),lt(S?.data)}catch(d){console.log(d)}};o.useEffect(()=>{it()},[]);const ot=d=>{$!==0&&clearTimeout($);const S=setTimeout(()=>nt(d),250);I(S)},nt=async d=>{try{let S;const z=s?.industry?.id||s?.industry;if(z?S=await Ae(d,z,g):S=await Ve(d,g),console.log("RES : ",S.data),S?.data==null){x([]);return}else{const ge=S.data?.filter(G=>{G.title!=d});x(S?.data)}}catch(S){console.error("Error:",S)}},rt=d=>{if(typeof d=="object"){f(z=>({...z,job_title:d}));return}const S={id:d?.id?d.id:"",title:d?.title?d.title:d,UserGenerated:!1};f(z=>({...z,job_title:S}))},ct=()=>{ne(!0),y(U({...s,job_title:{id:j.job_title.id,title:j.job_title.title,UserGenerated:j.job_title.UserGenerated}}))},dt=d=>{Z||(console.log(d,"experience"),ne(!0),f(S=>({...S,required_exp:{min:d.min,max:d.max}})),y(U({...s,required_exp:{min:d.min,max:d.max}})))},ut=d=>{y(U({...s,skills:d}))},xt=d=>{Z||(console.log(d,"global applicants"),ne(!0),f(S=>({...S,is_international:d})),y(U({...s,is_international:d})))},pt=()=>{ie(!0)},mt=()=>{ze(!0),F(!0),setTimeout(()=>{V(!0),F(!1)},2e3)};Y.public_job_creds,Y.incognito_job_creds,Y.basic_job_creds;const ft=async d=>{try{const S=await He(g,s?.id);console.log(S,"isdeleted"),S&&N("/employer/dashboard")}catch(S){console.log(S)}},Ie=async()=>{const{currency:d}=s;d&&d.id;const S=[];s?.skills?.map(G=>S.push(G.name));const z={job_title:s.job_title.title?.trim(),jd_path:s?.jd_url,roles:s?.roles,skills:S,company:oe.id||null,industry:s?.industry?.id||s?.industry||null,industry_sub_domain:s?.industry?.title||null,employment_mode:s?.employment_mode,country_id:s?.country?.id,location_id:s?.job_location?.id||null,job_type:s?.job_type||null,vacancies:null,job_space_id:s?.job_space?.id==""?null:s?.job_space?.id,qualification_level:s?.qualification_level,qualification:null,fields_of_study:s?.field_of_study?.name?[s?.field_of_study?.name?.trim()]:null,required_exp:!s?.required_exp?.min&&!s?.required_exp?.max?null:s?.required_exp?.min>0&&!s?.required_exp?.max?{min:s?.required_exp?.min,max:99}:s?.required_exp?.max>0&&!s?.required_exp?.min?{min:0,max:s?.required_exp?.max}:{min:s?.required_exp?.min,max:s?.required_exp?.max},salary_type:s?.salary_type,currency_id:s?.currency?.id||null,expected_salary:s?.min_expected_salary?.id&&s?.min_expected_salary?.salary||s?.max_expected_salary?.id&&s?.max_expected_salary?.salary?{min:typeof s.min_expected_salary?.id=="string"?Number(s.min_expected_salary.salary):s.min_expected_salary?.id,max:typeof s.max_expected_salary?.id=="string"?Number(s.max_expected_salary.salary):s.max_expected_salary?.id,visibility:s?.expected_salary?.visibility===!1}:null,availability:s?.is_basic_job?null:s?.availability??0,is_private:s?.is_basic_job?null:!!s?.is_private,is_draft:!1,field_of_study_pref:s?.is_basic_job?!1:s?.field_of_study_pref,from_location_only:s?.is_basic_job?!1:s?.from_location_only,include_relocation:s?.is_basic_job?!1:s?.include_relocation,is_basic_job:!!s?.is_basic_job,is_international:s?.is_international},ge={Authorization:`Bearer ${g}`};try{if(s?.id){l(!0),we(!1),_e(!1);const G=s?.id,re=await Je(ge,z,G);if(re.status===201||resData.status===200){const Se=re.data.data,pe=re.data.msg;!z.is_draft&&!s.is_basic_job?N("/employer/recommended-candidates",{state:{id:Se,message:pe,hasCreds:!0}}):s.is_basic_job&&!z.is_draft?O(!0):N("/employer/dashboard")}}}catch(G){G?.response?.data?.msg?.err==="no Applicants found for this Job"?(setStep("Applicant-not-found"),console.log("No applicants found for this job")):G?.response?.data?.msg?.err==="insufficient credits"||G?.response?.data?.msg?.err==="no credits"?setShowPaymentModel(!0):console.log(G)}finally{l(!1)}},bt=async()=>{try{le(!0);const d=await At(g);de(d.data.data)}catch(d){console.log(d)}finally{le(!1)}},yt=async()=>{try{console.log("comapany functions called");const d=await Vt(g),S={id:d.data[0].id,name:d.data[0].name,logo:d.data[0].logo};console.log(S,"functoincalled"),c(S)}catch(d){console.error("Error:",d)}};return o.useEffect(()=>{bt(),yt()},[]),o.useEffect(()=>
4{const d=j?.job_title?.title;ot(d)},[j?.job_title?.title]),o.useEffect(()=>{if(console.log(t,"editpaostjobs"),t?.id){const d={id:"147d3656-bdb9-4d9a-9ec5-e5888be55e64",country_id:"d797732d-1ca2-4e60-8ea3-a4f835bd10c1",code:"USD"},S=pe=>pe<100?pe*1e5:pe,z=parseInt(t?.expected_salary?.min||0),ge=parseInt(t?.expected_salary?.max||0),G=S(z).toString(),re=S(ge).toString(),Se={id:t?.id,prompt:t?.prompt,job_title:t?.job_title,is_basic_job:t?.is_basic_job,is_draft:t?.is_draft,is_private:t?.is_basic_job===!0?null:t?.is_private===!0?!0:t?.is_private==!1?!1:s.is_private,roles:t?.roles,jd_url:t?.jd_url,skills:t?.skills,company:t?.company?.id,industry:t?.industry,industry_sub_domain:t?.industry?.title,employment_mode:t?.employment_mode||["On-site"],job_location:!h&&t?.job_location?.country!=="India"?{id:"",city:"",state:"",country:""}:{id:t?.job_location?.id||"",city:t?.job_location?.name||"",state:t?.job_location?.state||"",country:t?.job_location?.country||""},job_type:t?.job_type||["full_time"],vacancies:parseInt(t.vacancies),job_space:t?.job_space,qualification_level:t?.qualification_level,qualification:t?.qualification,field_of_study:t?.fields_of_study?.[0],required_exp:t?.required_exp,salary_type:h===!0?"monthly":"annually",currency:t?.currency!==null?t?.currency:d,expected_salary:{visibility:t?.expected_salary?.visibility===!1},min_expected_salary:{id:t?.currency?.code==="INR"?G:t?.expected_salary?.min,salary:t?.currency?.code==="INR"?G:t?.expected_salary?.min},max_expected_salary:{id:t?.currency?.code==="INR"?re:t?.expected_salary?.max,salary:t?.currency?.code==="INR"?re:t?.expected_salary?.max},availability:t?.is_basic_job?null:t?.availability?t?.availability:0,field_of_study_pref:t?.field_of_study_pref,from_location_only:t?.from_location_only,include_relocation:t?.include_relocation,country:h?t?.country_details?t?.country_details:{id:"",name:"",code:""}:{id:"af6432c2-2800-4029-9014-786d8063d885",name:"India",code:"IN"},is_international:t?.is_international};y(U(Se))}},[t,s?.is_private,h]),B.useEffect(()=>{s.is_basic_job?p&&m&&u&&k&&!w&&V(!0):s.is_basic_job||n&&p&&m&&u&&k&&!w&&V(!0)},[s]),e.jsxs(e.Fragment,{children:[te&&!s.is_basic_job&&e.jsx("div",{className:" flex justify-center items-center w-screen h-screen z-50 backdrop-blur",children:e.jsxs("div",{className:"flex items-center flex-col bg-[#ffffff] py-[30px] px-[20px] rounded-[10px] shadow-lg",children:[e.jsx("div",{className:"w-fit ",children:!!qe&&e.jsx(Ee,{animationData:qe,style:{height:"200px"}})}),e.jsxs("div",{className:" flex font-poppins text-h5 font-[500] text-[#2B1845]",children:[e.jsx("div",{children:"Searching for candidates "}),e.jsx("div",{className:"mt-[4px] ml-1",children:e.jsx(Ce,{color:"#2B1845",height:30,width:30,strokeWidth:4})})]})]})}),ue&&e.jsx(Zt,{setOpenDraftModal:ie}),e.jsxs("div",{className:"w-full min-h-screen bg-[#f8f9fe] px-[20px] ",children:[e.jsx(ss,{handleEmployerNavigation:pt}),e.jsxs("div",{className:"max-w-4xl m-auto flex flex-col gap-[40px]",children:[!_&&!i&&e.jsxs("div",{className:"flex flex-col space-y-[40px]",children:[!!s?.prompt&&e.jsx(e.Fragment,{children:e.jsxs("div",{children:[e.jsx("div",{className:" flex w-full justify-end ",children:e.jsx("div",{className:"w-fit py-5 px-10 bg-[#ffffff] rounded-full ",children:e.jsx(Bt.p,{initial:{height:"auto"},animate:{height:"auto"},transition:{duration:.5},className:`text-[16px] text-end leading-[24px] ${je?"auto":"line-clamp-4"}`,children:s.prompt})})}),s.prompt.length>444&&e.jsx("div",{className:"flex justify-end w-full px-4",children:e.jsxs("span",{className:"text-[#6A2CBE] cursor-pointer underline",onClick:()=>Ye(!je),children:[" ",je?"less":"more"]})})]})}),!n&&!s?.is_basic_job&&e.jsx(Xt,{title:"In order to create your job post, please select a sector you are hiring in?",options:Ze,selected:j.industry||"",onSelect:tt}),!p&&e.jsx(Gt,{name:"job_title",title:"Hi! Let's start by creating your job post. What's the job title?",placeholder:"Enter Job Title",handleSaveJobRole:ct,value:j?.job_title?.title||"",setInitialState:f,onChange:rt,querySearchResults:L,postJobData:s}),(!u||!m)&&(s.is_basic_job?!0:!!s.industry)&&e.jsx(Qt,{title:s?.is_basic_job||n?"In order to create your job post, please tell me where is the job located?":"Where is the job located?",setShowContinueButton:ne,disabledQuestions:Z,setIsLocationNeeded:C}),!k&&(s.is_basic_job?!0:!!s.industry)&&(Object.values(s.job_location||{}).some(d=>d!=="")||!q)&&Object.values(s.country).some(d=>d!=="")&&e.jsx(zt,{title:s?.is_basic_job&&u||n&&u?" In order to create your job post, please tell me what level of professional experience is required for this position?":"What level of professional experience is required for this position?",options:Xe,selected:j?.required_exp,onSelect:dt}),w&&(s.is_basic_job?!0:!!s.industry)&&s?.job_title&&(Object.values(s?.job_location||{}).some(d=>d!=="")||!q)&&!!s?.country?.name&&(!!s?.required_exp?.min||!!s?.required_exp?.max)&&e.jsx(is,{title:s?.is_basic_job&&u&&k||n&&u&&k?" In order to create your job post, please tell me is the job open to global applicants?":"Is the job open to global applicants?",options:et,selected:j?.is_international,onSelect:xt}),K&&(s.is_basic_job?!0:!!s.industry)&&s?.job_title&&(Object.values(s?.job_location||{}).some(d=>d!=="")||!q)&&!!s?.country?.name&&(!!s?.required_exp?.min||!!s?.required_exp?.max)&&(s?.is_international===!0||s?.is_international===!1)&&e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:mt,disabled:Z,className:`bg-gradient-to-r px-[50px] py-[10px] rounded-full text-[#ffffff] ${Z?"bg-lightGray":"from-[#6B3BAB] to-[#2B1845]"}`,children:"continue"})})]}),i&&e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-40",children:e.jsx("div",{className:"flex justify-center items-center",children:e.jsxs("div",{className:"px-[100px] py-[60px] w-full h-full flex flex-col items-center justify-center max-w-[415px] max-h-[342px] bg-[#ffffff] border border-[#d9d9d9] rounded-[15p
4x]",children:[e.jsx(Ee,{className:"w-[200px] h-[200px]",animationData:st}),e.jsxs("div",{className:"relative text-center -top-[50px]",children:[e.jsx("h2",{className:"text-[20px] font-[500] text-[#1b1b1b] leading-[24px] pb-[10px] whitespace-nowrap",children:"Generating your job post"}),e.jsxs("p",{className:"text-[16px] font-[540] text-[#1b1b1b] leading-[19px]",children:["Please wait",e.jsx("span",{className:"inline-block relative top-3 left-1",children:e.jsx(Ce,{color:"#2B1845",height:30,width:30,strokeWidth:4})})]})]})]})})}),e.jsx("div",{ref:We,children:_&&e.jsxs("div",{className:"flex flex-col space-y-10",children:[e.jsxs("div",{className:"flex gap-5 items-center",children:[e.jsx("div",{className:"w-[20px]",children:e.jsx("img",{src:H.CommonHeader.header_logo,alt:""})}),e.jsx("p",{className:"text-[18px] leading-[21px] text-[#000000]",children:"Hereâs a draft JD based on your requirements. Please review to ensure it has all required information"})]}),e.jsxs("div",{className:"border border-[#d9d9d9] rounded-[20px] p-5 shadow-md ",children:[e.jsxs("div",{className:"flex justify-between border-b border-[#d9d9d9] pb-[20px] mb-[20px]",children:[e.jsx("h2",{className:"text-[23px] leading-[34px] text-[#1b1b1b]",children:"Finalize your job details"}),se?e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex justify-center items-center ",children:e.jsx(Ce,{color:"#2B1845",height:30,width:30,strokeWidth:4})})}):e.jsx(e.Fragment,{children:e.jsx("div",{className:"px-[15px] py-[5px] bg-[#f4eeff] border-[#d9d9d9] border rounded-[5px]",children:e.jsx("button",{onClick:()=>_e(!0),children:"Preview"})})})]}),e.jsxs("div",{className:"flex flex-col space-y-10",children:[e.jsx("div",{className:" bg-[#ffffff] p-[20px] rounded-[10px]",children:e.jsx(Ut,{isEditJobRequirements:W,setIsEditJobRequirements:M})}),e.jsx("div",{className:" bg-[#ffffff] p-[20px] rounded-[10px]",children:e.jsx(Kt,{isEditPreferredCandidates:D,setIsEditPreferredCandidates:v})}),e.jsx("div",{className:"flex flex-col gap-[10px] bg-[#ffffff] p-[20px] rounded-[10px]",children:e.jsx(Ht,{handleSkillsSave:ut,setSkillInputFocus:E,maxItems:30,setIsEditSkills:Q,isEditSkills:A})}),e.jsx("div",{className:"flex flex-col gap-[20px] bg-[#ffffff] p-[20px] rounded-[10px]",children:e.jsx(Wt,{isEditJobDescriptions:r,setIsEditJobDescriptions:X,isDescriptionLoading:se,setIsDescriptionLoading:xe})})]})]}),e.jsx("div",{className:"",children:e.jsx("div",{className:"flex justify-end",children:se&&!r?e.jsx("div",{className:"flex justify-center items-center ",children:e.jsx($e,{visible:!0,height:"70",width:"100",color:"#4fa94d",ariaLabel:"line-wave-loading",wrapperStyle:{marginTop:"-30px"},wrapperClass:"",firstLineColor:"purple",middleLineColor:"purple",lastLineColor:"purple"})}):e.jsxs("div",{className:"w-full flex justify-between items-center",children:[e.jsx("button",{className:"text-[16px] text-[#6B3BAB] px-[50px] py-[20px] rounded-full mb-[20px] font-semibold",onClick:ft,children:"Cancel"}),e.jsxs("div",{className:"flex gap-5",children:[e.jsx("button",{onClick:()=>_e(!0),className:`px-[50px] py-[20px] rounded-full mb-[20px] border border-[#6B3BAB] text-[#6B3BAB] ${W||D||A||r?"hidden":"flex"}`,children:"Preview"}),e.jsx("button",{onClick:()=>we(!0),className:`bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] text-[#ffffff] px-[50px] py-[20px] rounded-full mb-[20px] ${W||D||A||r?"hidden":"flex"}`,children:"Publish"})]})]})})})]})})]})]}),T&&e.jsx(as,{}),Ke&&e.jsx(os,{postJobData:s,setShowPreviewModal:_e,companyInfo:oe,handleSubmitjobDetails:Ie}),Ue&&e.jsx("div",{className:"w-full fixed inset-0 z-50 flex items-center justify-center backdrop-blur-lg",children:e.jsxs("div",{className:"md:w-[539px] md:h-[348px] drop-shadow-2xl bg-white relative flex flex-col justify-center items-center px-[40px] py-[30px] gap-[30px] rounded-[20px]",children:[e.jsxs("div",{className:" w-full flex flex-col gap-[30px] justify-center items-center",children:[e.jsx("img",{src:H.jobPost.draft_job,alt:""}),e.jsx("p",{className:" font-poppins font-bold text-center text-[18px] leading-[27px] text-[#424242]",children:"Publish your job post"})]}),e.jsxs("div",{className:" w-full flex justify-between gap-[40px]",children:[e.jsx("button",{type:"button",onClick:()=>we(!1),className:"w-full min-w-[180px] px-[10px] py-[20px] border border-[#2B1845] rounded-full ",children:e.jsx("p",{className:" text-[#2B1845] font-poppins font-[600] text-[16px] leading-[19.2px]",children:"Cancel"})}),e.jsx("button",{type:"button",onClick:Ie,className:"w-full min-w-[199px] px-[10px] py-[20px] bg-gradient-to-r from-[#6B3BAB] to-[#2B1845] rounded-full ",children:e.jsx("p",{className:" text-white font-poppins font-[600] text-[16px] leading-[19.2px]",children:"Post"})})]})]})})]})};export{ks as default}; 5//# sourceMappingURL=AiJobDetails-BRauThak.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.