PageSourceSearch

https://xyrus.ai/_next/static/chunks/8359-d0f5d30866ca1a68.js

js xyrus.ai collected 2026-10-05 15:08:53 UTC 40,900 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8359],{15992:(e,t,a)=>{a.d(t,{A7:()=>S,DI:()=>g,Dz:()=>h,M9:()=>d,Rt:()=>s,Tm:()=>u,V_:()=>_,Wl:()=>o,bR:()=>r,cZ:()=>m,ds:()=>p,h2:()=>l,lU:()=>y,oW:()=>i,sJ:()=>v,wp:()=>c,z5:()=>n});let n="/images/icons/pencil-edit.svg",r="/images/icons/phone-icon.svg",o="/images/icons/globe-icon.svg",l="/images/icons/email-icon.svg",i="/images/icons/location-icon.svg",s="/images/icons/link-icon.svg",d="/images/icons/refresh-icon.svg",c="/images/icons/share-icon.svg",u="/images/icons/bag-icon.svg",m="/images/icons/document-icon.svg",p="/images/icons/right-arrow-icon.svg",_="/images/icons/linkedinIcon.svg",h="/images/icons/scheduled-calendar-icon.svg",g="/images/icons/placeholder-no-engagements.svg",v="/images/icons/impersonate-user-icon.svg",y="/images/icons/UserContactsExpand.svg",S="/images/client/client-information-circle.svg"},41608:(e,t,a)=>{a.d(t,{B:()=>f});var n=a(12115),r=a(97582),o=a(41180),l=a(18720),i=a(99429),s=a(95621),d=a(75358),c=a(9143),u=a(60919),m=a(73977),p=a(80587),_=a.n(p),h=a(78923),g=a(83098),v=a(20063),y=a(30590),S=a(42208);let f=(e,t,a,p)=>{var f,T,A,C,E,R,w,P,O;let L=(0,v.useSearchParams)(),I=e?"":null!=(P=null==(f=L.get(y.uB.RST_TEMPLATE_ID))?void 0:f.trim())?P:"",M=e?"":null!=(O=null==(T=L.get(y.uB.STATUS))?void 0:T.trim())?O:"",[D,b]=n.useState(1),[x,k]=n.useState(),[B,j]=n.useState(""),[N,q]=n.useState([]),[F,U]=n.useState(!1),[J,z]=n.useState(null),[K,V]=n.useState(null),[Y,H]=n.useState({poc:["All"],company:["All"],competencyMap:I?[I]:["All"],sortBy:["All"]}),[W,G]=n.useState({skip:0,limit:20,sort_by:"created_at",sort_order:"desc"}),[Z,Q]=n.useState([]),[X,$]=n.useState(!1),{profileData:ee}=(0,c.GV)(e=>e.userProfile),et=(null==ee?void 0:ee.user_type)==="client",{data:ea,isLoading:en,execute:er}=(0,d.sO)(i.Sn.PROJECT.BASE,{queryKey:["projects",W],queryFn:()=>(0,s.query)(i.Sn.PROJECT.BASE,{params:W})}),{data:eo,isLoading:el,error:ei,execute:es}=(0,d.sO)(i.Sn.PROJECT.PROJECT_CANDIDATE_LIST(K||""),{queryKey:["project-candidate",e]});n.useEffect(()=>{eo&&"object"==typeof eo&&"data"in eo&&Array.isArray(eo.data)&&(q(eo.data.map(e=>{var t;return{id:e.id||"",name:e.name||e.full_name||"",role:e.role||"",avatar:e.avatar||e.avatar_url||(null==(t=e.name)?void 0:t.charAt(0))||"U",cdoRstScore:e.cdoRstScore||e.rst_score||0,ccmScore:e.ccmScore||e.ccm_score||0,status:e.status||"Active"}})),U(el),z((null==ei?void 0:ei.message)||null))},[eo,el,ei]);let[ed,ec]=n.useState([]),[eu,em]=n.useState(0),[ep,e_]=n.useState(0),[eh,eg]=n.useState(""),[ev,ey]=n.useState([]),[eS,ef]=n.useState(1),[eT,eA]=n.useState(0),[eC,eE]=n.useState(""),[eR,ew]=n.useState(!1),{templates:eP,loadInitialTemplates:eO,loadMoreTemplates:eL,ensureRstTemplateInList:eI,isLoading:eM,hasMore:eD,totalItems:eb}=(0,S.d)(),[ex,ek]=n.useState(),eB=n.useRef(null),ej=n.useRef(null),eN=n.useMemo(()=>eP.map(e=>({value:e.id,label:e.name})),[eP]),eq=n.useMemo(()=>{var e;let t=Y.competencyMap[0];if(t&&"All"!==t)return null!=ex?ex:null==(e=eP.find(e=>e.id===t))?void 0:e.name},[Y.competencyMap,ex,eP]);n.useEffect(()=>{let e=Y.competencyMap[0];if(!e||"All"===e){eB.current=null;return}eB.current!==e&&(eB.current=e,eI(e))},[Y.competencyMap,eI]),n.useEffect(()=>{I&&ej.current!==I&&(ej.current=I,ew(!0),eO(),eI(I))},[eI,I]);let{execute:eF,isLoading:eU}=(0,d.sO)(i.Sn.CLIENT.COMMON_LIST),{execute:eJ,isLoading:ez}=(0,d.sO)(i.Sn.USERS.COMMON_LIST),eK=n.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let n=await eF({params:{skip:e,limit:20,search:t||void 0}});if(null==n?void 0:n.data){let t=n.data.map(e=>({id:e.id,name:e.name}));
1ec(e=>a?[...e,...t]:t),e_(n.total_count||0),em(e)}}catch(e){console.error("Error fetching clients:",e)}},[eF]),eV=n.useCallback(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let n=await eJ({params:{page:e,page_size:20,search:t||void 0}});if((null==n?void 0:n.data)&&Array.isArray(n.data)){let t=n.data.map(e=>{let t=e._id||e.id||e.user_id||"",a=e.full_name||e.name||"";return{id:t,name:a}}).filter(e=>e.id&&e.name);ey(e=>a?[...e,...t]:t),eA(n.total_count||0),ef(e)}}catch(e){console.error("Error fetching POCs:",e)}},[eJ]),eY=async()=>{eU||ed.length>=ep||await eK(eu+20,eh,!0)},eH=async()=>{ez||ev.length>=eT||await eV(eS+1,eC,!0)},eW=n.useMemo(()=>(0,g.s)(e=>eK(0,e,!1),400),[eK]),eG=n.useMemo(()=>(0,g.s)(e=>eV(1,e,!1),400),[eV]),eZ=n.useCallback(()=>{eR||0!==eP.length||(ew(!0),eO())},[eO,eR,eP.length]),eQ=n.useCallback(e=>{eO(void 0,void 0,e.toLowerCase())},[eO]),eX=n.useMemo(()=>(0,g.s)(eQ,300),[eQ]);n.useEffect(()=>{(null==ea?void 0:ea.data)&&Q(ea.data)},[ea]),n.useEffect(()=>{$(en)},[en]);let e$=(0,d.L2)({method:"put",url:i.Sn.PROJECT.UPDATE_PROJECT_STATUS(e||K||"")}),e0=(0,d.L2)({method:"put",url:i.Sn.PROJECT.EDIT_PROJECT(e||"")}),e1=(0,d.L2)({method:"put",url:i.Sn.PROJECT.UPLOAD_JD_DOCUMENT(e||"")}),e2=(0,d.L2)({method:"put",url:i.Sn.PROJECT.UPLOAD_DOCUMENT(e||"")}),e5=(0,d.L2)({method:"delete",url:i.Sn.PROJECT.REMOVE_PROJECT_DOCUMENT(e||"","")}),e3=(0,d.L2)({method:"put",url:""});(0,n.useEffect)(()=>{null!=p&&p.skipInitialProjectsFetch||((async()=>{if(I||M){let e={skip:0,limit:20,sort_by:"created_at",sort_order:"desc"};I&&(e.rst_template_id=I),M&&(e.status=M,H(e=>({...e,sortBy:[M]}))),G(e),$(!0);try{let t=await (0,s.query)(i.Sn.PROJECT.BASE,{params:e});(null==t?void 0:t.data)&&Q(t.data)}catch(e){console.error("API error:",e)}finally{$(!1)}return}er()})(),eK(),eV())},[]),(0,n.useEffect)(()=>()=>{e8.current&&clearTimeout(e8.current)},[]);let e9=n.useMemo(()=>{let e=new Map,t=eC.toLowerCase().trim();return ev.forEach(t=>{t.id&&t.name&&e.set(t.id,t.name)}),Z.forEach(a=>{a.xqtiv_poc_id&&a.xqtiv_poc_name&&(!t||a.xqtiv_poc_name.toLowerCase().includes(t))&&e.set(a.xqtiv_poc_id,a.xqtiv_poc_name)}),Array.from(e.entries()).map(e=>{let[t,a]=e;return{id:t,name:a}}).sort((e,t)=>e.name.localeCompare(t.name))},[Z,ev,eC]),e7=n.useMemo(()=>{let e=new Map,t=eh.toLowerCase().trim();return ed.forEach(t=>{t.id&&t.name&&e.set(t.id,t.name)}),Z.forEach(a=>{a.client_id&&a.client_name&&(!t||a.client_name.toLowerCase().includes(t))&&e.set(a.client_id,a.client_name)}),Array.from(e.entries()).map(e=>{let[t,a]=e;return{id:t,name:a}}).sort((e,t)=>e.name.localeCompare(t.name))},[Z,ed,eh]),e4={currentPage:D,totalPages:Math.ceil(Z.length/10),totalItems:Z.length,itemsPerPage:10},e8=n.useRef(null),e6=e=>{e8.current&&clearTimeout(e8.current),e8.current=setTimeout(()=>{k(e),b(1);let t={...W,skip:0};e.search&&e.search.trim()?t.search=e.search:delete t.search,e.status&&(t.status=e.status),e.client_id&&(t.client_id=e.client_id),e.xqtiv_poc_id&&(t.xqtiv_poc_id=e.xqtiv_poc_id),G(t),$(!0),(0,s.query)(i.Sn.PROJECT.BASE,{params:t}).then(e=>{(null==e?void 0:e.data)&&Q(e.data),$(!1)}).catch(e=>{console.error("API error:",e),$(!1)})},500)},te=t=>{let a=Z.find(e=>e.id===t);a&&o.Lx.openDialog("edit-project",{title:"Edit Engagement",size:"lg",data:{project:a,...tJ&&"object"==typeof tJ?{clientPocData:tJ,loadingClientPoc:tz,clientPocError:tK,fetchClientPoc:tV}:{},onSubmit:async()=>{await er(),e===t&&await tj(),l.oR.success("Project updated successfully"),o.Lx.closeAllModals()},onCancel:()=>{o.Lx.closeAllModals()}}})},tt=()=>{er()},ta=async t=>{V(t);let a=Z.find(e=>e.id===t);if(a)try{var n;let d=await (0,s.query)(i.Sn.PROJECT.RECOMMENDATIONS(t));o.Lx.openDialog("update-status",{title:"Update Status",size:"lg",data:{project:a,recommendationsData:d,loading:e$.isPending,error:(null==(n=e$.error)?void 0:n.message)||null,onSubmit:async a=>{try{let n=await e$.mutateAsync({url:i.Sn.PROJECT.UPDATE_PROJECT_STATUS(t),data:(0,r.$V)(a)});(null==n?void 0:n.status_code)===200?(l.oR.success(n.message||"Project status updated successfully"),await er()
1):l.oR.error(n.message||"Failed to update project status"),e===t&&await tj(),o.Lx.closeAllModals()}catch(e){console.error("Failed to update project status:",e)}},onCancel:()=>{o.Lx.closeAllModals()}}})}catch(e){console.error("Failed to fetch recommendations:",e),l.oR.error("Failed to load recommendations data")}},tn=async t=>{try{let a=await e$.mutateAsync({url:i.Sn.PROJECT.UPDATE_PROJECT_STATUS(t),data:{status:r.Ks.Active}});(null==a?void 0:a.status_code)===200?(l.oR.success(a.message||"Project reopened successfully"),await er(),e===t&&await tj()):l.oR.error((null==a?void 0:a.message)||"Failed to reopen project")}catch(e){console.error("Failed to reopen project:",e),l.oR.error("Failed to reopen project")}},tr=e=>(0,r.N1)(e)?r.kF[r.Ks.Abandon]:r.kF[e]||"bg-gray-100 text-gray-800",to=e=>(0,r.md)(e),[tl,ti]=n.useState([]),[ts,td]=n.useState([{id:"1",name:"Yanik Muler",role:"Lead Engineer",gender:"Male",location:"Texas",company:"Texas Corps.",status:r.Kk.Accepted,invitationStatus:"Recommended on 27/07/2025",client_candidate_status:"unselected"},{id:"2",name:"Ted Lasso",role:"Software engineer",gender:"Male",location:"Texas",company:"Texas Machinaries",status:r.Kk.InProgress,invitationStatus:"Recommended on 27/07/2025",client_candidate_status:"unselected"},{id:"3",name:"Miles Adam",role:"Asst. Project Manager",gender:"Male",location:"Texas",company:"Stark Enterprise",status:r.Kk.Rejected,invitationStatus:"Scheduled on 27/07/2025",client_candidate_status:"unselected"},{id:"4",name:"Hubort Dian",role:"Sr. Developer",gender:"Male",location:"Texas",company:"Dev Innovations",status:r.Kk.InProgress,invitationStatus:"Scheduled on 27/07/2025",client_candidate_status:"selected"}]),[tc]=n.useState([{id:"1",role:"Chief Data Officer",context:"Enterprise",description:"Ted Mosby is an empathetic and transformative leader with over a decade of experience in data strategy and digital transformation. He has successfully led multiple enterprise-wide initiatives that have resulted in significant improvements in data quality, operational efficiency, and customer experience.",fullDescription:"Ted Mosby is an empathetic and transformative leader with over a decade of experience in data strategy and digital transformation. He has successfully led multiple enterprise-wide initiatives that have resulted in significant improvements in data quality, operational efficiency, and customer experience.",linkedOn:"12/06/2025, 11:24 AM"}]),[tu]=n.useState({others:[{id:"1",name:"Document1.pdf",fileType:"pdf",url:"",uploadedAt:""},{id:"2",name:"Document2.doc",fileType:"doc",url:"",uploadedAt:""},{id:"3",name:"Document3.pdf",fileType:"pdf",url:"",uploadedAt:""},{id:"4",name:"Document3.pdf",fileType:"pdf",url:"",uploadedAt:""}]}),[tm,tp]=n.useState(void 0),[t_,th]=n.useState(!1),tg=async(t,a)=>{let n={id:String(tl.length+1),text:t};ti([...tl,n]),e&&await tv(a,t)},tv=async(t,a)=>{if(!e){console.error("❌ No projectId provided"),l.oR.error("Project ID is required for document upload");return}if(t&&0===t.size){console.error("❌ Empty file provided"),l.oR.error("Please select a valid file to upload");return}try{let n=new FormData;t&&n.append("jd_file",t,t.name),n.append("requirements",a||"");let r=await e1.mutateAsync({data:n,config:{headers:{"Content-Type":"multipart/form-data"}}});l.oR.success("Saved",{description:null==r?void 0:r.message}),t&&tp(void 0),(null==r?void 0:r.status_code)===200&&(await er(),e&&await tj()),o.Lx.closeAllModals()}catch(e){var n,r;throw l.oR.error("Save Failed",{description:e instanceof u.pe?null==e||null==(r=e.response)||null==(n=r.data)?void 0:n.detail:"Failed to save critical requirements. Please try again."}),e}},ty=async(t,a)=>{if(!e){console.error("❌ No projectId provided"),l.oR.error("Project ID is required");return}try{let n=i.Sn.PROJECT.UPDATE_CANDIDATE_STATUS(e,t),r=await e3.mutateAsync({url:n,data:{status:a}});(null==r?void 0:r.status_code)===200?(td(e=>e.map(e=>e.id===t?{...e,status:a}:e)),await tH(),l.oR.success(r.message||"Candidate status updated successfully")):l.oR.error(r.message||"Failed to update candidate status")}catch(e){console.error("❌ Error updating candidate status:",e),l.oR.error("Failed to update candidate status. Please try again.")}},{execute:tS}=(0,d.sO)(i.Sn.PROJECT.GET_PROJECT_DOCUMENTS(e||""),{queryKey:["project-documents",e]}),[tf,tT]=n.useState(0),[tA]=n.useState(20),[tC,tE]=n.useState([]),[tR,tw]=n.useState(!0),[tP,tO]=n.useState(!1),tL=async t=>{if(!e){console.error("❌ No projectId provided"),l.oR.error("Project ID is required for document upload");return}if(!t||0===t.size){console.error("❌ No file provided or empty file"),l.oR.error("Please select a valid file to upload");return}try{let a=new FormData;a.append("file",t);let n=await e2.mutateAsync({data:a,config:{headers:{"Content-Type":"multipart/form-data"}}});return(null==n?void 0:n.status_code)===200&&e&&(tj(),tS({params:{skip:0,limit:tA}}).then(e=>{let t=(Array.isArray(e)?e:e&&"object"==typeof e&&"data"in e?e.data:[]).map(e=>{var t,a,n,r,o,l,i;return{id:e.id,name:null!=(a=null!=(t=e.document_name)?t:e.name)?a:"",fileType:null!=(n=e.document_type)?n:"other",url:null!=(o=null!=(r=e.file_url)?r:e.url)?o:"",uploadedAt:null!=(i=null!=(l=e.created_at)?l:e.uploadedAt)?i:""}});tE(t)})),er(),n}catch(e){var a,n;throw l.oR.error("Upload Failed",{description:e instanceof u.pe?null==e||null==(n=e.response)||null==(a=n.data)?void 0:a.detail:"Failed to upload document. Please try again."}),e}},tI=async t=>{if(!e)return void l.oR.error("Project ID is required for document removal");try{let a=await e5.mutateAsync({url:i.Sn.PROJECT.REMOVE_PROJECT_DOCUMENT(e,t)});return(null==a?void 0:a.status_code)===200&&(tE(e=>e.filter(e=>e.id!==t)),tj(),l.oR.success("Document Removed",{description:"Document has been removed successfully"})),a}catch(e){throw l.oR.error("Removal Failed",{description:"Failed to remove document. Please try again."}),e}};(0,n.useEffect)(()=>{null!=p&&p.skipProjectDocumentsFetch||(async()=>
1{if(e){tT(0),tw(!0),tE([]);try{let e=await tS({params:{skip:0,limit:tA}}),t=(Array.isArray(e)?e:e&&"object"==typeof e&&"data"in e?e.data:[]).map(e=>{var t,a,n,r,o,l,i;return{id:e.id,name:null!=(a=null!=(t=e.document_name)?t:e.name)?a:"",fileType:null!=(n=e.document_type)?n:"other",url:null!=(o=null!=(r=e.file_url)?r:e.url)?o:"",uploadedAt:null!=(i=null!=(l=e.created_at)?l:e.uploadedAt)?i:""}});tE(t),tw(t.length===tA)}catch(e){tw(!1)}}})()},[e,tA]);let tM=async()=>{if(!tP&&tR){tO(!0);try{let e=tf+tA,t=await tS({params:{skip:e,limit:tA}}),a=(Array.isArray(t)?t:t&&"object"==typeof t&&"data"in t?t.data:[]).map(e=>{var t,a,n,r,o,l,i;return{id:e.id,name:null!=(a=null!=(t=e.document_name)?t:e.name)?a:"",fileType:null!=(n=e.document_type)?n:"other",url:null!=(o=null!=(r=e.file_url)?r:e.url)?o:"",uploadedAt:null!=(i=null!=(l=e.created_at)?l:e.uploadedAt)?i:""}});tE(e=>[...e,...a]),tT(e),tw(a.length===tA)}finally{tO(!1)}}},tD=e=>{let t=document.createElement("div");t.innerHTML=e;let a=t.querySelectorAll("li");if(a.length>0)return a.length>3;let n=t.querySelectorAll("p");if(n.length>0)return n.length>3;let r=t.textContent||"",o=r.split("\n").filter(e=>e.trim().length>0);return o.length<=1?Math.ceil(r.length/50)>3:o.length>3},tb=e=>{let t=document.createElement("div");t.innerHTML=e;let a=t.querySelectorAll("li");if(a.length>0){var n;let e=null==(n=a[0])?void 0:n.parentElement;if(e&&("UL"===e.tagName||"OL"===e.tagName)){let t=e.cloneNode(!1);t.className=e.className;for(let e=0;e<Math.min(3,a.length);e++){let n=a[e];n&&t.appendChild(n.cloneNode(!0))}return t.outerHTML}}let r=t.querySelectorAll("p");if(r.length>0){let e=document.createElement("div");for(let t=0;t<Math.min(3,r.length);t++){let a=r[t];a&&e.appendChild(a.cloneNode(!0))}return e.innerHTML}let o=t.textContent||"",l=o.split("\n").filter(e=>e.trim().length>0);return l.length<=1?o.length>150?o.substring(0,150)+"...":o:l.slice(0,3).join("\n")},{data:tx,isLoading:tk,error:tB,execute:tj}=(0,d.sO)(i.Sn.PROJECT.BASE_BY_ID(e||""),{queryKey:["project",e]});(0,n.useEffect)(()=>{e&&tj()},[e]);let{data:tN,isLoading:tq,execute:tF}=(0,d.sO)(i.Sn.PROJECT.PROJECT_CLIENT_CONTACT_LIST(e||""),{queryKey:["client-contacts",e]}),tU=async t=>{try{if(tq)return;let a=et?tN:await tF();o.Lx.openDrawer("client-contacts",{title:"Client Contacts",anchor:"right",width:420,size:"full",data:{clientId:t,projectId:e,contacts:a||[],onPrimaryUpdated:async()=>{await Promise.all([tj()])},projectData:{clientPocData:tJ,loadingClientPoc:tz,addProjectCandidatesMutation:t0,handleUpdateClientContacts:t3}}}),(null==tN?void 0:tN.data)||await tF()}catch(t){let e=t instanceof Error?t.message:"Unknown error occurred";l.oR.error("Failed to load client contacts: ".concat(e))}},{data:tJ,isLoading:tz,error:tK,execute:tV}=(0,d.sO)(e=>e.clientId?i.Sn.CLIENT.CLIENT_MEMBERS(e.clientId):"",{queryKey:e=>["client-poc",e.clientId]});(0,n.useEffect)(()=>{t&&tV({clientId:t})},[t,tV]);let{data:tY,execute:tH}=(0,d.sO)(i.Sn.PROJECT.RECOMMENDATIONS(e||""),{queryKey:["recommendations",e],queryFn:()=>(0,s.query)(i.Sn.PROJECT.RECOMMENDATIONS(e||""),{params:{[y.uB.SORT_BY]:"ccm_score",[y.uB.SORT_ORDER2]:"desc"}})}),{data:tW,isLoading:tG,execute:tZ}=(0,d.sO)(i.Sn.PROJECT.RECOMMENDATIONS_CANDIDATE_LIST(e||""),{queryKey:["candidates-list",e],queryFn:()=>(0,s.query)(i.Sn.PROJECT.RECOMMENDATIONS_CANDIDATE_LIST(e||""),{params:{[y.uB.SKIP]:0,[y.uB.LIMIT]:10,[y.uB.SORT_BY]:"ccm_score",[y.uB.SORT_ORDER2]:"desc"}})}),tQ=(0,d.L2)({method:"post",url:i.Sn.PROJECT.RECOMMENDATIONS(e||"")}),tX=(0,d.L2)({method:"put",url:i.Sn.PROJECT.RECOMMENDATIONS_STATUS_UPDATE(e||"","")}),t$=(0,d.L2)({method:"post",url:i.Sn.PROJECT.ADD_EVENT}),t0=(0,d.L2)({method:"post",url:i.Sn.PROJECT.PROJECT_CLIENT_ADD(e||"")}),t1=(0,d.L2)({method:"put",url:i.Sn.PROJECT.PROJECT_CLIENT_ADD(e||"")});(0,n.useEffect)(()=>{e&&tH()},[e]);let t2=(e,t,a)=>{if(t){let n=null!=e?e:new Date;return _().tz({year:n.getFullYear(),month:n.getMonth(),date:n.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),millisecond:t.getMilliseconds()},a).toISOString()}if(e)return _().tz({year:e.getFullYear(),month:e.getMonth(),date:e.getDate(),hour:0,minute:0,second:0,millisecond:0},a).toISOString()},t5=async(t,a,n)=>{if(!e||!a)return void l.oR.error("Project ID and Candidate ID are required");if(!t.selected_member_id||!t.selected_member_type)return void l.oR.error("Please select a person for interaction");if(!t.date)return void l.oR.error("Please select a date for the event");try{let r=t.timezone||(0,h.FJ)(),o=t2(t.date,t.startTime,r),i=t2(t.date,t.endTime,r),s={project_id:e,candidate_id:a,..."client"===t.selected_member_type?{client_member_id:t.selected_member_id}:{},..."org"===t.selected_member_type?{organization_member_id:t.selected_member_id}:{}
1,event_type:t.type,scheduled_at:o,title:t.type,description:t.description||"",timezone:r};i&&(s.ends_at=i),t.mode_of_interaction&&(s.mode_of_interaction=t.mode_of_interaction),s.timezone=r,await t$.mutateAsync({data:s}),l.oR.success("Event created successfully"),n&&n()}catch(e){throw console.error("Failed to create event:",e),l.oR.error("Failed to create event. Please try again."),e}},t3=async e=>{try{let t=await t1.mutateAsync({data:e});if((null==t?void 0:t.status_code)===200||(null==t?void 0:t.status_code)===201)l.oR.success("Client contacts set as primary");else throw Error((null==t?void 0:t.message)||"Failed to update client contacts")}catch(e){l.oR.error("Failed to update client contacts",e)}};return{projects:Z,loading:X,currentPage:D,searchData:x,searchQuery:B,filters:Y,pagination:e4,columns:[{key:"title",label:"Engagement Name",sortable:!1,width:"171"},{key:"client_name",label:"Client",sortable:!1,width:"140"},{key:"xqtiv_poc_name",label:"XQtiv POC",sortable:!1,width:"140"},{key:"status",label:"Engagement Status",sortable:!1,width:"160"},{key:"recommendations_count",label:"Recommendations",sortable:!1,width:"160"},{key:"last_updated_on",label:"Last Updated On",sortable:!1,width:"184"},{key:"actions",label:"Actions",sortable:!1,width:"157"}],uniquePOCs:e9,uniqueClients:e7,candidateData:N,loadingCandidate:F,candidateError:J,currentProjectId:K,clientPocData:tJ,loadingClientPoc:tz,clientPocError:tK,fetchClientPoc:tV,isUpdatingStatus:e$.isPending,updateStatusError:(null==(A=e$.error)?void 0:A.message)||null,isUploadingDocument:e1.isPending,uploadDocumentError:(null==(C=e1.error)?void 0:C.message)||null,requirements:tl,recommendations:ts,rstItems:tc,projectDocuments:tu,pdfFile:tm,clientContactsData:tN,isExpanded:t_,projectCardData:tx,loadingProject:tk,projectError:tB,recommendationsData:tY,candidatesListData:tW,loadingCandidatesList:tG,fetchCandidatesList:tZ,handleAddCandidateToRecommendations:async e=>{try{let t=await tQ.mutateAsync({data:{candidate_ids:[e],remove_candidate_ids:[]}});t&&"status_code"in t&&200===t.status_code&&(l.oR.success("Candidate added to recommendations successfully"),await tH())}catch(t){throw(0,m.yG)("error","Failed to add candidate to recommendations",{candidateId:e,error:t,component:"TopPicks"}),t}},isAddingRecommendations:tQ.isPending,addRecommendationsError:(null==(E=tQ.error)?void 0:E.message)||null,isUpdatingRecommendationStatus:tX.isPending,updateRecommendationStatusError:(null==(R=tX.error)?void 0:R.message)||null,isCreatingEvent:t$.isPending,createEventError:(null==(w=t$.error)?void 0:w.message)||null,addProjectCandidatesMutation:t0,updateProjectClientContactsMutation:t1,handleUpdateClientContacts:t3,handleSearch:e6,handleSearchChange:e=>{j(e);let t={};e.trim()&&(t.search=e.trim()),e6(t)},handlePageChange:e=>{b(e);let t={...W,skip:(e-1)*(W.limit||20)};G(t),$(!0),(0,s.query)(i.Sn.PROJECT.BASE,{params:t}).then(e=>{(null==e?void 0:e.data)&&Q(e.data),$(!1)}).catch(e=>{console.error("API error:",e),$(!1)})},handlePageSizeChange:e=>{let t={...W,limit:e,skip:0};G(t),b(1),$(!0),(0,s.query)(i.Sn.PROJECT.BASE,{params:t}).then(e=>{(null==e?void 0:e.data)&&Q(e.data),$(!1)}).catch(e=>{console.error("API error:",e),$(!1)})},handleCreate:()=>{o.Lx.openDialog("create-project",{title:"Create Engagement",size:"lg",data:{clientPocData:tJ,loadingClientPoc:tz,clientPocError:tK,fetchClientPoc:tV,onSubmit:async()=>{await er(),o.Lx.closeAllModals()},onCancel:()=>{o.Lx.closeAllModals()}}})},handleEdit:te,handleDelete:tt,handleUpdateStatus:ta,handleReopenEngagement:tn,handleReset:()=>{k(void 0),j(""),H({poc:["All"],company:["All"],competencyMap:["All"],sortBy:["All"]}),ek(void 0),eB.current=null,b(1),eg(""),eK(0,"",!1),eE(""),eV(1,"",!1);let e={skip:0,limit:20,sort_by:"created_at",sort_order:"desc"};delete e.search,delete e.status,delete e.client_id,delete e.xqtiv_poc_id,delete e.project_type,delete e.rst_template_id,G(e),$(!0),(0,s.query)(i.Sn.PROJECT.BASE,{params:e}).then(e=>{(null==e?void 0:e.data)&&Q(e.data),$(!1)}).catch(e=>{console.error("API error:",e),$(!1)})},handleFilterChange:(e,t)=>
1{H(a=>({...a,[e]:t}));let a={...W,skip:0};switch(e){case"poc":t[0]&&"All"!==t[0]?a.xqtiv_poc_id=t[0]:delete a.xqtiv_poc_id;break;case"company":t[0]&&"All"!==t[0]?a.client_id=t[0]:delete a.client_id;break;case"competencyMap":if(t[0]&&"All"!==t[0]){a.rst_template_id=t[0],eB.current=t[0];let e=eN.find(e=>e.value===t[0]);(null==e?void 0:e.label)&&ek(e.label),eI(t[0])}else delete a.rst_template_id,eB.current=null,ek(void 0);break;case"sortBy":t[0]&&"All"!==t[0]?a.status=t[0]:delete a.status}G(a),b(1),$(!0),(0,s.query)(i.Sn.PROJECT.BASE,{params:a}).then(e=>{(null==e?void 0:e.data)&&Q(e.data),$(!1)}).catch(e=>{console.error("API error:",e),$(!1)})},setCurrentProject:e=>{V(e),e&&es()},handleAddRequirement:tg,handleUploadFile:e=>{tp({name:e.name,size:"".concat((e.size/1024/1024).toFixed(1)," MB"),url:URL.createObjectURL(e)})},handleUploadJdDocument:tv,uploadDocument:tL,removeDocument:tI,handleAddRecommendation:()=>{o.Lx.openDrawer("add-recommendations",{title:"Add Recommendations",anchor:"right",width:550,data:{fetchCandidates:async()=>{try{var e;let t=await tZ();return(null==t||null==(e=t.data)?void 0:e.map(e=>{var t,a,n;return{id:e.id,name:e.name,role:e.current_role||"Role not specified",avatar:(null==(t=e.name)?void 0:t.charAt(0))||"U",cdoRstScore:e.ai_score||0,ccmScore:null!=(a=e.ccm_score)?a:0,status:e.status,fit_reason:null!=(n=e.fit_reason)?n:null,added:e.added,extra_data:e.extra_data,ai_score_summary:e.ai_score_summary}}))||[]}catch(e){throw console.error("Failed to fetch candidates list:",e),e}},getCandidatesPage:async function(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;try{var o,l,d;let c={skip:(t-1)*a,limit:a};("ai_score"===r||"ccm_score"===r)&&(c[y.uB.SORT_BY]=r,c[y.uB.SORT_ORDER2]="desc"),null!=n&&""!==n.trim()&&(c.search=n.trim());let u=await (0,s.query)(i.Sn.PROJECT.RECOMMENDATIONS_CANDIDATE_LIST(e||""),{params:c}),m=(null==u||null==(o=u.data)?void 0:o.map(e=>{var t,a,n;return{id:e.id,name:e.name,role:e.current_role||"Role not specified",avatar:(null==(t=e.name)?void 0:t.charAt(0))||"U",cdoRstScore:e.ai_score||0,ccmScore:null!=(a=e.ccm_score)?a:0,status:e.status,fit_reason:null!=(n=e.fit_reason)?n:null,added:e.added,extra_data:e.extra_data,ai_score_summary:e.ai_score_summary}}))||[],p=null!=(l=null==u?void 0:u.total_count)?l:m.length,_=null!=(d=null==u?void 0:u.limit)?d:a,h=Math.max(1,Math.ceil(p/_));return{items:m,totalPages:h}}catch(e){throw console.error("Failed to fetch candidates page:",e),e}},onSave:async e=>{try{let t=await tQ.mutateAsync({data:e});t&&"status_code"in t&&200===t.status_code&&(await tH(),l.oR.success("Recommendations updated successfully"))}catch(e){console.error("Failed to update recommendations:",e),l.oR.error("Failed to update recommendations")}}}})},handleEditRecommendation:t=>{let a=ts.find(e=>e.id===t);if(!a&&tY&&Array.isArray(null==tY?void 0:tY.data)){let e=tY.data.find(e=>e.id===t);e&&(a={id:e.id,name:e.name,role:e.current_role||"Role not specified",gender:"Male",location:e.location||"Location not specified",company:e.organization||"Company not specified",status:e.status,client_candidate_status:e.status})}a&&o.Lx.openDrawer("edit-recommendation",{title:"Update Status",anchor:"right",width:550,data:{recommendation:a,onSave:async a=>{try{await tX.mutateAsync({url:i.Sn.PROJECT.RECOMMENDATIONS_STATUS_UPDATE(e||"",t),data:{status:a.status}}),td(e=>e.map(e=>e.id===t?{...e,...a}:e)),await tH(),l.oR.success("Recommendation status updated successfully")}catch(e){console.error("Failed to update recommendation status:",e),l.oR.error("Failed to update recommendation status")}}}})},handleUpdateCandidateStatus:ty,handleUInviteRecommendation:()=>{o.Lx.openDrawer("share-project-invite",{title:"Share Project Invite",anchor:"right",width:500,size:"full",data:{}})},handleAddRST:t=>{console.log("handleAddRST"),o.Lx.openDrawer("share-rst",{anchor:"right",width:500,customContentStyle:{backgroundColor:"white",paddingTop:0,height:"100vh",display:"flex",flexDirection:"column"},showCloseButton:!1,data:{allowMultiSelect:!1,modalTitle:"Link Competency Matr
1ix",modalDescription:"",loadingText:"Linking...",submitText:"Link",candidateId:"",isUpdating:!1,linkFn:async t=>{try{await e0.mutateAsync({data:{rst_template_id:t}}),er(),e&&await tj(),o.Lx.closeAllModals()}catch(e){console.error("Failed to link Competency Matrix to project",e)}}}})},handleOpenProjectDocuments:()=>{let t=async e=>{let t=await tL(e.file);return o.Lx.closeAllModals(),t},n=async e=>tI(e.documentId),r=tC.filter(e=>!(null==a?void 0:a.has(e.id)));o.Lx.openDrawer("documents",{anchor:"right",width:500,size:"full",showCloseButton:!1,data:{uploadDocument:t,removeDocument:n,onSuccess:()=>{e&&tj()},documents:r,mode:"add",allowTypes:!1,deletedDocumentIds:a,showLoading:(e,t)=>{o.Lx.setModalLoading("documents",e,t)}}})},handleViewAllDocuments:()=>{let e=async e=>tI(e.documentId),t=async e=>{await tL(e.file),o.Lx.closeAllModals()};o.Lx.openDrawer("documents",{anchor:"right",width:500,size:"full",showCloseButton:!1,data:{documents:tC,mode:"list",allowTypes:!1,uploadDocument:t,removeDocument:e,loadMoreDocuments:tM,hasMoreDocuments:tR,isLoadingMoreDocuments:tP,showLoading:(e,t)=>
1{o.Lx.setModalLoading("documents",e,t)}}})},handleOpenClientContacts:tU,loadingClientContacts:tq,getClientContacts:tF,handleCreateEvent:t5,setRequirements:ti,setRecommendations:td,setPdfFile:tp,handleAddRequirementCritical:()=>{var t,a,n,r,i,s;let d=e||K||"";if(!d)return void l.oR.error("Project ID is required for document upload");let c=(null==tx||null==(a=tx.data)||null==(t=a.requirements)?void 0:t.data)||"",u=null==tx||null==(n=tx.data)?void 0:n.jd_document,m=(null==tx||null==(i=tx.data)||null==(r=i.requirements)?void 0:r.data)||"",p=(null==tx||null==(s=tx.data)?void 0:s.jd_document)?{name:tx.data.jd_document.document_name,size:tx.data.jd_document.file_size?"".concat((tx.data.jd_document.file_size/1024/1024).toFixed(1)," MB"):"Unknown size",url:tx.data.jd_document.file_url||""}:void 0;o.Lx.openDrawer("critical-requirements",{title:"Additional Requirements",anchor:"right",width:550,fixWidth:!0,data:{onSave:tg,initialDescription:m,initialDocument:p,projectId:d,existingRequirements:c,existingJdDocument:u}})},toggleExpanded:()=>{th(!t_)},shouldTruncate:tD,truncateContent:tb,getDisplayContent:e=>{var t;let a=(null==(t=e[e.length-1])?void 0:t.text)||"No requirements added yet.";return t_?a:tD(a)?tb(a):a},shouldShowButton:e=>{var t;return tD((null==(t=e[e.length-1])?void 0:t.text)||"")},getStatusColor:tr,getStatusText:to,getActionsCell:e=>({projectId:e.id,onView:()=>te(e.id),onEdit:()=>te(e.id),onDelete:()=>tt()}),getStatusCell:e=>({status:e.status,color:tr(e.status),text:to(e.status)}),getCardData:e=>e?{...e,xqtiv_poc_email:(null==e?void 0:e.xqtiv_poc_email)||"",xqtiv_poc_phone:(null==e?void 0:e.xqtiv_poc_phone)||"",xqtiv_poc_role:(null==e?void 0:e.xqtiv_poc_role)||"",project:e,startedOn:e.last_updated_on||e.created_at,description:e.description||"",requirementLocation:e.location||"",clientFullName:"".concat(e.client_id," Pvt Ltd"),invitationStatus:e.client_invitation_status||""}:{id:"",title:"",status:"Active",startedOn:"",description:"",requirementLocation:"",clientFullName:"",invitationStatus:"",location:"",recommendations_count:0,last_updated_on:"",created_at:"",updated_at:"",client_id:"",client_invitation_status:"",xqtiv_poc_id:"",xqtiv_poc_name:"",rst_template_id:"",rst_template_name:""},openRecommendationDrawer:(t,a,n)=>{var l,i,s;let d=Array.isArray(t)?t:[t],c=null==tx||null==(i=tx.data)||null==(l=i.project)?void 0:l.status;o.Lx.openDrawer("recommended-profile",{title:1===d.length&&(null==(s=d[0])?void 0:s.name)||"Recommended Profiles",anchor:"right",width:"notes"===n||"events"===n?1e3:500,data:{profiles:d.map(e=>{var t,a;let n={id:e.id,name:e.name,title:e.role,gender:e.gender,location:e.location,company:e.company,rstScore:null!=(t=e.ai_score)?t:0,ccmScore:null!=(a=e.ccm_score)?a:0,status:(e=>{let t=e.status;if(t)switch(t.toLowerCase().replace(/\s+/g,"_")){case"accepted":return r.Kk.Accepted;case"offer_extended":return r.Kk.OfferExtended;case"in_progress":case"inprogress":default:return r.Kk.InProgress;case"rejected":return r.Kk.Rejected;case"rejected_by_client":return r.Kk.RejectedByClient;case"rejected_by_candidate":return r.Kk.RejectedByCandidate;case"abandoned":return r.Kk.Abandoned}let a=(e.invitationStatus||"").toLowerCase();return a.includes("offer extended")?r.Kk.OfferExtended:a.includes("accepted")?r.Kk.Accepted:a.includes("rejected by candidate")?r.Kk.RejectedByCandidate:a.includes("rejected")?r.Kk.RejectedByClient:a.includes("abandon")||a.includes("abandoned")?r.Kk.Abandoned:r.Kk.InProgress})(e),metaText:e.invitationStatus};return{...e,...n}}),selectedId:n?a:void 0,highlightedCandidateId:n?void 0:a,hideClientDetails:!0,initialTab:n,projectId:e||K,candidateId:a,isStatusLostOrAbandoned:!!(c&&(c.toLowerCase().includes("lost")||(0,r.N1)(c)||c.toLowerCase().includes("abandon")||c.toLowerCase().includes("won"))),refreshRecommendations:tH,handleCreateEvent:t5}})},hasMoreClients:ed.length<ep,isClientsLoading:eU,totalClientsCount:ep,handleLoadMoreClients:eY,handleSearchClients:e=>{eg(e),eW(e)},hasMorePocs:ev.length<eT,isPocsLoading:ez,totalPocsCount:eT,handleLoadMorePocs:eH,handleSearchPocs:e=>{eE(e),eG(e)}
1,rstTemplateOptions:eN,rstLoading:eM,loadRstTemplates:eZ,searchRstTemplates:eX,rstHasMore:eD,rstTotalCount:eb,loadMoreRstTemplates:eL,...eq?{selectedCompetencyMapLabel:eq}:{}}}},42208:(e,t,a)=>{a.d(t,{d:()=>m});var n=a(12115),r=a(75358),o=a(83098),l=a(99429),i=a(30590),s=a(92096),d=a(18720),c=a(41180),u=a(73977);function m(){let[e,t]=(0,n.useState)([]),[a,m]=(0,n.useState)(0),[p,_]=(0,n.useState)(0),[h,g]=(0,n.useState)(s.aw.NEWEST),[v,y]=(0,n.useState)(""),[S,f]=(0,n.useState)(s.mI.ALL),[T,A]=(0,n.useState)(null),[C,E]=(0,n.useState)([]),[R,w]=(0,n.useState)(1),[P,O]=(0,n.useState)(0),[L,I]=(0,n.useState)(""),M=(0,r.L2)({method:"put"}),D=(0,n.useRef)([]);D.current=e;let{execute:b}=(0,r.sO)(e=>l.Sn.RST_TEMPLATES.DETAILS(e),{queryKey:e=>["rst-template-details",e]}),{isLoading:x,error:k,execute:B}=(0,r.sO)(e=>{let t={[i.uB.SKIP]:e[i.uB.SKIP]||0,[i.uB.LIMIT]:e[i.uB.LIMIT]||10,[i.uB.SEARCH]:e[i.uB.SEARCH]||v};return e[i.uB.SORT_BY]&&(t[i.uB.SORT_BY]=e[i.uB.SORT_BY]||""),e[i.uB.STATUS]&&(t[i.uB.STATUS]=e[i.uB.STATUS]||""),l.Sn.RST_TEMPLATES.ADVANCED_RST_ENDPOINT(t)}),{isLoading:j,error:N,execute:q}=(0,r.sO)(e=>{let t=new URLSearchParams;return t.set(i.uB.PAGE,(e.page||1).toString()),t.set(i.uB.STATUS,"active"),t.set("page_size",(e.page_size||10).toString()),e.search&&e.search.trim()&&t.set(i.uB.SEARCH,e.search.trim()),"".concat(l.Sn.PROJECT.LIST,"?").concat(t.toString())}),F=(0,n.useCallback)(()=>{t([]),m(0),_(0)},[]),U=(0,n.useCallback)(async e=>{let a=e.trim();if(a&&!D.current.some(e=>e.id===a))try{var n,r,o,l,i,s,d,c;let e=await b(a);if((null==e?void 0:e.status_code)!==200||!e.data)return;let u={id:(n=e.data).id,name:n.name,description:null!=(r=n.description)?r:"",template_type:null!=(o=n.template_type)?o:"",is_active:n.is_active,created_by:null!=(l=n.created_by)?l:"",created_at:null!=(i=n.created_at)?i:"",modified_at:null!=(s=n.modified_at)?s:"",version:null!=(d=n.version)?d:0,domains_processed:null!=(c=n.domains_processed)?c:[]};t(e=>e.some(e=>e.id===u.id)?e:[u,...e])}catch(e){(0,u.yG)("error","Failed to resolve competency matrix for display",{templateId:a,error:e})}},[b]),J=(0,n.useCallback)(async(e,a,n,r,o)=>{try{let l=void 0!==n?n:v;void 0!==n&&y(n);let d=await B({[i.uB.SKIP]:r||0,[i.uB.LIMIT]:o||10,[i.uB.SEARCH]:l,...a!==s.aw.NEWEST&&{[i.uB.SORT_BY]:a||h},...e!==s.mI.ALL&&{[i.uB.STATUS]:e||S}});(null==d?void 0:d.status_code)===200&&(t(d.data),m(1),_(d.total_count))}catch(e){d.oR.error("Failed to load initial templates"),console.error("Error loading initial templates:",e)}},[B,v,h,S]),z=(0,n.useCallback)(async()=>{if(!(e.length>=p))try{let e=await B({[i.uB.SKIP]:10*a,[i.uB.LIMIT]:10,[i.uB.SEARCH]:v,...h!==s.aw.NEWEST&&{[i.uB.SORT_BY]:h},...S!==s.mI.ALL&&{[i.uB.STATUS]:S}});if((null==e?void 0:e.status_code)===200){let a=e.data;t(e=>[...e,...a]),m(e=>e+1),_(e.total_count)}}catch(e){d.oR.error("Failed to load templates"),console.error("Error loading templates:",e)}},[B,a,v,h,S,p,e.length]),K=(0,n.useCallback)(async e=>{try{if(y(e),t(e=>e),F(),!e.trim())return void await J();let a=await B({[i.uB.SKIP]:0,[i.uB.LIMIT]:10,[i.uB.SEARCH]:e,...h!==s.aw.NEWEST&&{[i.uB.SORT_BY]:h},...S!==s.mI.ALL&&{[i.uB.STATUS]:S}});(null==a?void 0:a.status_code)===200&&(t(a.data),m(1),_(a.total_count))}catch(e){d.oR.error("Failed to search templates"),console.error("Error searching templates:",e)}},[B,J,F,h,S]),V=(0,n.useCallback)(async(e,a)=>{try{A(e);let n=await M.mutateAsync({url:l.Sn.RST_TEMPLATES.ACTIVATE(e),data:{is_active:a}});(null==n?void 0:n.status_code)===200&&(t(t=>t.map(t=>t.id===e?{...t,is_active:a}:t)),d.oR.success("Template ".concat(a?"activated":"deactivated"," successfully")))}catch(e){d.oR.error("Failed to ".concat(a?"activate":"deactivate"," template")),console.error("Error updating template status:",e)}finally{A(null)}},[M]),Y=(0,n.useMemo)(()=>({templates:e,isLoading:x,hasMore:e.length<p,error:k?String(k):null,totalItems:p,loadedItems:e.length}),[e,x,p,k]),H=(0,n.useCallback)((e,t)=>{g(e),t||(F(),setTimeout(()=>J(S,e,v,0,10),0))},[J,F,S,v]),W=(0,n.useMemo)(()=>(0,o.s)(K,400),[]),G=(0,n.useCallback)((e,t)=>{y(e),t||W(e)},[W]),Z=(0,n.useCallback)((e,t)=>{f(e),t||(F(),setTimeout(()=>J(e,h,v,0,10),0))},[J,F,h,v]),Q=(0,n.useCallback)(()=>{F(),J()},[F,J]),X=(0,n.useCallback)(()=>{c.Lx.openDialog("create-rst-template",{title:"Create New Competency Matr
1ix",size:"full",width:"50vw",data:{onCancel:()=>{console.log("Template creation cancelled")},onUploadComplete:Q}})},[Q]),$=(0,n.useCallback)(e=>T===e,[T]),ee=(0,n.useCallback)(()=>{E([]),w(1),O(0)},[]),et=(0,n.useCallback)(async(e,t,a)=>{try{let n=await q({status:S,page:t||1,page_size:a||10,search:void 0!==e?e:L});if((null==n?void 0:n.status_code)===200){let e=(null==n?void 0:n.data)||[];E(e),w(1),O((null==n?void 0:n.total_count)||0)}}catch(e){console.error("Error loading initial users:",e)}},[q,L]),ea=(0,n.useCallback)(async()=>{try{let e=await q({page:R+1,page_size:10,search:L});if((null==e?void 0:e.status_code)===200){let t=(null==e?void 0:e.data)||[];E(e=>[...e,...t]),w(e=>e+1),O((null==e?void 0:e.total_count)||0)}}catch(e){console.error("Error loading more users:",e)}},[q,R,L]),en=(0,n.useCallback)(async e=>{try{if(ee(),!e.trim())return void await et("",1,10);let t=await q({page:1,page_size:10,search:e});if((null==t?void 0:t.status_code)===200){let e=(null==t?void 0:t.data)||[];E(e),w(1),O((null==t?void 0:t.total_count)||0)}}catch(e){console.error("Error searching users:",e)}},[q,et,ee]),er=(0,n.useMemo)(()=>(0,o.s)(en,400),[en]),eo=(0,n.useCallback)((e,t)=>{I(e),t||er(e)},[er]),el=(0,n.useMemo)(()=>({users:C,isLoadingUsers:j,usersHasMore:C.length<P,usersError:N?String(N):null,usersTotalItems:P,usersLoadedItems:C.length}),[C,j,P,N]);return{...Y,loadInitialTemplates:J,loadMoreTemplates:z,ensureRstTemplateInList:U,resetTemplates:F,searchTemplates:K,sortBy:h,searchQuery:v,status:S,onSortChange:H,onSearchChange:G,onStatusChange:Z,onCreateTemplate:X,onActivateDeactivate:V,isActivateDeactivateLoading:M.isPending,isTemplateLoading:$,...el,loadInitialUsers:et,loadMoreUsers:ea,resetUsers:ee,searchUsers:en,usersSearchQuery:L,xQtivPOCError:N,isLoadingXQtivPOC:j,onUsersSearchChange:eo}}},78923:(e,t,a)=>{a.d(t,{FJ:()=>i,QG:()=>o,yn:()=>l});var n=a(80587),r=a.n(n);let o=()=>r().tz.names().filter(e=>!e.startsWith("Etc/")&&!e.includes("GMT+")&&!e.includes("GMT-")).map(e=>({label:"".concat(e.replace(/_/g," ")," (").concat(r().tz(e).format("Z"),")"),value:e})),l=()=>["America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Europe/Rome","Europe/Madrid","Asia/Dubai","Asia/Kolkata","Asia/Singapore","Asia/Tokyo","Asia/Hong_Kong","Asia/Shanghai","Australia/Sydney","Australia/Melbourne","Pacific/Auckland"].map(e=>({label:"".concat(e.replace(/_/g," ")," (").concat(r().tz(e).format("Z"),")"),value:e})),i=()=>r().tz.guess()},92096:(e,t,a)=>{a.d(t,{UB:()=>o,aw:()=>i,ej:()=>r,mI:()=>l,u0:()=>s});var n=a(98734),r=function(e){return e.All="all",e.Active="active",e.Inactive="inactive",e}({}),o=function(e){return e.Newest="newest_to_oldest",e.Oldest="oldest_to_newest",e.AZ="a_to_z",e.ZA="z_to_a",e}({});let l={ALL:"all",ACTIVE:"active",INACTIVE:"inactive"},i={NEWEST:"newest_to_oldest",OLDEST:"oldest_to_newest",AZ:"a_to_z",ZA:"z_to_a"},s=n.Ik({rstTemplate:n.KC([n.Yj().min(1,"Please select at least one RST template"),n.YO(n.Yj()).min(1,"Please select at least one RST template")])})},97582:(e,t,a)=>{a.d(t,{$V:()=>s,Kk:()=>p,Ks:()=>r,N1:()=>o,_Y:()=>l,eX:()=>u,eb:()=>d,kF:()=>m,md:()=>i});var n=a(30590),r=function(e){return e.Active="Active",e.ClosedWon="Close WON",e.ClosedLost="Closed LOST",e.Abandon="Inactive",e}({});function o(e){let t=e.toLowerCase();return t===n.gc.INACTIVE||t.includes("abandon")}function l(e){return o(e)?"Inactive":Object.values(r).includes(e)?e:"Active"}function i(e){return o(e)?d.Inactive:d[e]||e}function s(e){let t=(e.lost_reason||"").trim();return"Inactive"===e.status?{status:"Inactive",lost_reason:t}:{status:e.status,...Array.isArray(e.candidate_id)&&e.candidate_id.length>0?{candidate_id:e.candidate_id}:{},lost_reason:t}}let d={Active:"Active","Close WON":"Closed won","Closed LOST":"Closed lost",Inactive:"Inactive"},c={CLOSED:"closed",INACTIVE:n.gc.INACTIVE};function u(e){return e&&"All"!==e?e===c.CLOSED?"Closed":e===c.INACTIVE?"Inactive":d[e]||e:"All"}let m={Active:"bg-success-bg text-success-solid","Close WON":"bg-brand-4th/10 text-brand-4th","Closed LOST":"bg-error-bg text-error-solid",Inactive:"bg-gray-100 text-gray-600"};var p=function(e){return e.Accepted="accepted",e.OfferExtended="offer_extended",e.InProgress="in_progress",e.Rejected="rejected",e.RejectedByClient="rejected_by_client",e.RejectedByCandidate="rejected_by_candidate",e.Abandoned="abandoned",e}({})}}]);

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.