PageSourceSearch

https://xyrus.ai/_next/static/chunks/18.6026a0ca850c52dd.js

js xyrus.ai collected 2026-10-05 15:08:56 UTC 15,848 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18],{14441:(e,t,a)=>{a.d(t,{default:()=>C});var l=a(95155),i=a(12115),r=a(97003),n=a(33789),o=a(90235),s=a(67001),c=a(50060),d=a(50618),u=a(22544),_=a(33602),m=a(25016),p=a(99429),h=a(75358),v=a(42208),g=a(806),S=a(18720);let C=e=>{var t,a,C,f;let{project:x,onSubmit:b,onCancel:y,loading:E=!1}=e,[T,L]=i.useState(null),[j,A]=i.useState(""),{templates:N,loadInitialTemplates:w,isLoading:I,hasMore:P,totalItems:B,onSearchChange:R,loadMoreTemplates:O,users:M,loadInitialUsers:k,loadMoreUsers:q,isLoadingUsers:D,usersHasMore:U,usersTotalItems:F,onUsersSearchChange:z}=(0,v.d)(),K=i.useMemo(()=>j||(null==x?void 0:x.client_id)||"",[j,null==x?void 0:x.client_id]),{data:V,isLoading:Y,error:H,execute:J}=(0,h.sO)(e=>e.clientId?p.Sn.CLIENT.CLIENT_MEMBERS(e.clientId):"",{queryKey:e=>["client-poc-modal",e.clientId]}),W=Y||!1,Z=H||null,G=(0,h.L2)({method:x?"put":"post",url:x?p.Sn.PROJECT.EDIT_PROJECT(x.id):p.Sn.PROJECT.ADD_PROJECT}),Q=G.isPending,{data:X,isLoading:$,error:ee,execute:et}=(0,h.sO)(p.Sn.CLIENT.BASE,{queryKey:["clients"]}),{register:ea,handleSubmit:el,formState:{errors:ei},setValue:er,watch:en}=(0,u.mN)({resolver:(0,_.u)(g.$b),defaultValues:{title:(null==x?void 0:x.title)||"",description:(null==x?void 0:x.description)||"",location:(null==x?void 0:x.location)||"",client_id:(null==x?void 0:x.client_id)||"",client_poc_id:(null==x?void 0:x.client_poc_id)||"",xqtiv_poc_id:(null==x?void 0:x.xqtiv_poc_id)||"",rst_template_id:(null==x?void 0:x.rst_template_id)||""}}),eo=i.useRef(""),es=i.useRef(!1),ec=i.useRef(!1),ed=i.useRef(J),eu=i.useRef(et),e_=i.useRef(w),em=i.useRef(k);i.useEffect(()=>{ed.current=J,eu.current=et,e_.current=w,em.current=k},[J,et,w,k]),i.useEffect(()=>{eu.current(),em.current(),e_.current()},[]),i.useEffect(()=>{if((null==x?void 0:x.client_id)&&!es.current){ec.current=!0,es.current=!0;let e=x.client_id;er("client_id",e,{shouldDirty:!1}),x.client_poc_id&&er("client_poc_id",x.client_poc_id,{shouldDirty:!1}),x.xqtiv_poc_id&&er("xqtiv_poc_id",x.xqtiv_poc_id,{shouldDirty:!1}),x.rst_template_id&&er("rst_template_id",x.rst_template_id,{shouldDirty:!1}),A(e),ed.current&&(ed.current({clientId:e}),eo.current=e),requestAnimationFrame(()=>{ec.current=!1})}},[null==x?void 0:x.client_id,er]);let ep=en("client_id");i.useEffect(()=>{!ec.current&&ep&&ep!==j&&(A(ep),j&&er("client_poc_id",""))},[ep,j,er]),i.useEffect(()=>{K&&K!==eo.current&&ed.current&&(eo.current=K,ed.current({clientId:K}))},[K]);let eh=async e=>{L(null);try{let t={title:e.title,description:e.description,location:e.location,client_id:e.client_id,client_poc_id:e.client_poc_id,xqtiv_poc_id:e.xqtiv_poc_id,rst_template_id:e.rst_template_id},a=Object.fromEntries(Object.entries(t).filter(e=>{let[,t]=e;return""!==t&&null!=t}));await G.mutateAsync({data:a}),b(a)}catch(e){S.oR.error(e instanceof Error?e.message:"Failed to create project. Please try again."),L("Failed to create project. Please try again.")}},ev=i.useMemo(()=>{let e=(null==X?void 0:X.data)||[];return 0===e.length?[]:e.map(e=>({value:e.id,label:e.name}))},[X]),eg=i.useMemo(()=>{let e=[];
1if(V)if("object"==typeof V&&null!==V&&"data"in V){let t=V.data;Array.isArray(t)&&(e=t)}else Array.isArray(V)&&(e=V);return 0===e.length?[]:e.filter(e=>e.user_id||e.id).map((e,t)=>{let a="";return a=e.full_name?e.full_name:e.name?e.name:e.first_name&&e.last_name?"".concat(e.first_name," ").concat(e.last_name):e.first_name?e.first_name:"User ".concat(t+1),{value:e.id||e.user_id||"client-user-".concat(t),label:a}})},[V]);i.useEffect(()=>{x&&X&&ev.length>0&&er("client_id",x.client_id)},[x,X,ev]),i.useEffect(()=>{if((null==x?void 0:x.client_poc_id)&&V&&eg.length>0){let e=en("client_poc_id");e&&e===x.client_poc_id||er("client_poc_id",x.client_poc_id)}},[x,V,eg]);let eS=i.useMemo(()=>0===M.length?[]:M.filter(e=>e.user_id||e.id).map((e,t)=>{let a="";return a=e.full_name?e.full_name:e.name?e.name:e.first_name&&e.last_name?"".concat(e.first_name," ").concat(e.last_name):e.first_name?e.first_name:"User ".concat(t+1),{value:e.user_id||e.id||"user-".concat(t),label:a}}),[M]),eC=i.useMemo(()=>N.map(e=>({value:e.id,label:e.name||e.title||"Unnamed Template"})),[N]);return(0,l.jsx)("div",{className:"space-y-6 h-[500px] overflow-y-auto",children:(0,l.jsxs)("form",{onSubmit:el(eh),className:"space-y-4 relative",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)(o.Label,{htmlFor:"title",children:["Engagements Title ",(0,l.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,l.jsx)(n.Input,{id:"title",...ea("title"),placeholder:"Enter title",className:(0,m.cn)(ei.title?"border-red-500":"","bg-white shadow-none border border-gray-200")}),ei.title&&(0,l.jsx)("p",{className:"text-sm text-red-500",children:ei.title.message})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(o.Label,{htmlFor:"description",children:"Engagements Description "}),(0,l.jsx)(s.T,{id:"description",...ea("description"),placeholder:"Enter description (optional)",rows:3,className:(0,m.cn)("placeholder:text-gray-400 text-xs","bg-white shadow-none border border-gray-200")})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)(o.Label,{htmlFor:"location",children:["Engagements Location ",(0,l.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,l.jsx)(n.Input,{id:"location",...ea("location"),placeholder:"Enter location",className:(0,m.cn)(ei.location?"border-red-500":"","bg-white shadow-none border border-gray-200")}),ei.location&&(0,l.jsx)("p",{className:"text-sm text-red-500",children:ei.location.message})]}),(0,l.jsx)(c.SingleSelect,{label:"Choose Client",required:!0,placeholder:$?"Loading clients...":"Select",options:ev,value:en("client_id"),onChange:e=>er("client_id",e),error:null==(t=ei.client_id)?void 0:t.message,disabled:$||!!x}),(0,l.jsx)(c.SingleSelect,{label:"Choose Client POC",required:!0,noOptionsMessage:"No client POC for this client",placeholder:j?W?"Loading client members...":"Select":"Please select a client first",options:eg,value:en("client_poc_id"),onChange:e=>er("client_poc_id",e),error:null==(a=ei.client_poc_id)?void 0:a.message,disabled:!j||W||!!x}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(o.Label,{htmlFor:"xqtiv_poc_id",children:"Choose XQtiv POC"}),(0,l.jsx)(d.Combobox,{className:(0,m.cn)("h-10.5",ei.xqtiv_poc_id&&"border-red-500",D&&"bg-gray-50 cursor-not-allowed opacity-50"),options:eS,value:en("xqtiv_poc_id")||"",onValueChange:e=>er("xqtiv_poc_id",e),placeholder:D?"Loading users...":"Select XQtiv POC...",searchPlaceholder:"Search users...",emptyText:"No user found.",allowCustomValues:!1,isLoading:D,onSearchChange:z,hasMore:U||!1,totalCount:F||0,onLoadMore:q,onOpenChange:e=>{e&&k()},disabled:D}),(null==(C=ei.xqtiv_poc_id)?void 0:C.message)?(0,l.jsx)("p",{className:"text-sm text-red-500",children:ei.xqtiv_poc_id.message}):null]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(o.Label,{htmlFor:"rst_template_id",children:"Select Competency Matrix"}),(0,l.jsx)(d.Combobox,{className:(0,m.cn)("h-10.5",ei.rst_template_id&&"border-red-500",(I||!!x&&!!x.rst_template_id)&&"bg-gray-50 cursor-not-allowed opacity-50"),options:eC,value:en("rst_template_id")||"",onValueChange:e=>er("rst_template_id",e),placeholder:I?"Loading templates...":"Select Competency Matr
1ix...",searchPlaceholder:"Search templates...",emptyText:"No template found.",allowCustomValues:!1,isLoading:I,onSearchChange:R,hasMore:P||!1,totalCount:B||0,onLoadMore:O,onOpenChange:e=>{e&&w()},disabled:I||!!x&&!!x.rst_template_id}),(null==(f=ei.rst_template_id)?void 0:f.message)?(0,l.jsx)("p",{className:"text-sm text-red-500",children:ei.rst_template_id.message}):null]}),T&&(0,l.jsx)("div",{className:"p-3 bg-red-50 border border-red-200 rounded-md",children:(0,l.jsx)("p",{className:"text-sm text-red-600",children:T})}),(ee||Z)&&(0,l.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,l.jsxs)("p",{className:"text-sm text-yellow-600",children:["API Error: ",ee?"Clients: ".concat(ee):""," ",Z?"Client POC: ".concat(Z):""]})}),(0,l.jsxs)("div",{className:"flex gap-3 justify-start pt-4 ",children:[(0,l.jsx)(r.Button,{type:"submit",disabled:Q||E,children:Q||E?(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),x?"Updating...":"Creating..."]}):x?"Update engagement":"Create engagement"}),(0,l.jsx)(r.Button,{type:"button",variant:"outline",onClick:y,disabled:Q||E,children:"Cancel"})]})]})})}},20018:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var l=a(95155);a(12115);var i=a(14441);function r(e){let{data:t,onClose:a}=e,r={...{onSubmit:e=>{(null==t?void 0:t.onSubmit)&&"function"==typeof t.onSubmit&&t.onSubmit(e),a&&a()},onCancel:()=>{(null==t?void 0:t.onCancel)&&"function"==typeof t.onCancel&&t.onCancel(),a&&a()},loading:!!(null==t?void 0:t.loading)},...(null==t?void 0:t.project)?{project:t.project}:{},...(null==t?void 0:t.clientPocData)?{clientPocData:t.clientPocData}:{},...(null==t?void 0:t.loadingClientPoc)!==void 0?{loadingClientPoc:!!t.loadingClientPoc}:{},...(null==t?void 0:t.clientPocError)!==void 0?{clientPocError:t.clientPocError}:{},...(null==t?void 0:t.fetchClientPoc)?{fetchClientPoc:t.fetchClientPoc}:{}};return(0,l.jsx)(i.default,{...r})}},42208:(e,t,a)=>{a.d(t,{d:()=>_});var l=a(12115),i=a(75358),r=a(83098),n=a(99429),o=a(30590),s=a(92096),c=a(18720),d=a(41180),u=a(73977);function _(){let[e,t]=(0,l.useState)([]),[a,_]=(0,l.useState)(0),[m,p]=(0,l.useState)(0),[h,v]=(0,l.useState)(s.aw.NEWEST),[g,S]=(0,l.useState)(""),[C,f]=(0,l.useState)(s.mI.ALL),[x,b]=(0,l.useState)(null),[y,E]=(0,l.useState)([]),[T,L]=(0,l.useState)(1),[j,A]=(0,l.useState)(0),[N,w]=(0,l.useState)(""),I=(0,i.L2)({method:"put"}),P=(0,l.useRef)([]);P.current=e;let{execute:B}=(0,i.sO)(e=>n.Sn.RST_TEMPLATES.DETAILS(e),{queryKey:e=>["rst-template-details",e]}),{isLoading:R,error:O,execute:M}=(0,i.sO)(e=>{let t={[o.uB.SKIP]:e[o.uB.SKIP]||0,[o.uB.LIMIT]:e[o.uB.LIMIT]||10,[o.uB.SEARCH]:e[o.uB.SEARCH]||g};return e[o.uB.SORT_BY]&&(t[o.uB.SORT_BY]=e[o.uB.SORT_BY]||""),e[o.uB.STATUS]&&(t[o.uB.STATUS]=e[o.uB.STATUS]||""),n.Sn.RST_TEMPLATES.ADVANCED_RST_ENDPOINT(t)}),{isLoading:k,error:q,execute:D}=(0,i.sO)(e=>{let t=new URLSearchParams;return t.set(o.uB.PAGE,(e.page||1).toString()),t.set(o.uB.STATUS,"active"),t.set("page_size",(e.page_size||10).toString()),e.search&&e.search.trim()&&t.set(o.uB.SEARCH,e.search.trim()),"".concat(n.Sn.PROJECT.LIST,"?").concat(t.toString())}),U=(0,l.useCallback)(()=>{t([]),_(0),p(0)},[]),F=(0,l.useCallback)(async e=>{let a=e.trim();if(a&&!P.current.some(e=>e.id===a))try{var l,i,r,n,o,s,c,d;let e=await B(a);if((null==e?void 0:e.status_code)!==200||!e.data)return;let u={id:(l=e.data).id,name:l.name,description:null!=(i=l.description)?i:"",template_type:null!=(r=l.template_type)?r:"",is_active:l.is_active,created_by:null!=(n=l.created_by)?n:"",created_at:null!=(o=l.created_at)?o:"",modified_at:null!=(s=l.modified_at)?s:"",version:null!=(c=l.version)?c:0,domains_processed:null!=(d=l.domains_processed)?d:[]};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]),z=(0,l.useCallback)(async(e,a,l,i,r)=>{try{let n=void 0!==l?l:g;void 0!==l&&S(l);let c=await M({[o.uB.SKIP]:i||0,[o.uB.LIMIT]:r||10,[o.uB.SEARCH]:n,...a!==s.aw.NEWEST&&{[o.uB.SORT_BY]:a||h},...e!==s.mI.ALL&&{[o.uB.STATUS]:e||C}});(null==c?void 0:c.status_code)===200&&(t(c.data),_(1),p(c.total_count))}catch(e){c.oR.error("Failed to load initial templates"),console.error("Error loading initial templates:",e)}},[M,g,h,C]),K=(0,l.useCallback)(async()=>
1{if(!(e.length>=m))try{let e=await M({[o.uB.SKIP]:10*a,[o.uB.LIMIT]:10,[o.uB.SEARCH]:g,...h!==s.aw.NEWEST&&{[o.uB.SORT_BY]:h},...C!==s.mI.ALL&&{[o.uB.STATUS]:C}});if((null==e?void 0:e.status_code)===200){let a=e.data;t(e=>[...e,...a]),_(e=>e+1),p(e.total_count)}}catch(e){c.oR.error("Failed to load templates"),console.error("Error loading templates:",e)}},[M,a,g,h,C,m,e.length]),V=(0,l.useCallback)(async e=>{try{if(S(e),t(e=>e),U(),!e.trim())return void await z();let a=await M({[o.uB.SKIP]:0,[o.uB.LIMIT]:10,[o.uB.SEARCH]:e,...h!==s.aw.NEWEST&&{[o.uB.SORT_BY]:h},...C!==s.mI.ALL&&{[o.uB.STATUS]:C}});(null==a?void 0:a.status_code)===200&&(t(a.data),_(1),p(a.total_count))}catch(e){c.oR.error("Failed to search templates"),console.error("Error searching templates:",e)}},[M,z,U,h,C]),Y=(0,l.useCallback)(async(e,a)=>{try{b(e);let l=await I.mutateAsync({url:n.Sn.RST_TEMPLATES.ACTIVATE(e),data:{is_active:a}});(null==l?void 0:l.status_code)===200&&(t(t=>t.map(t=>t.id===e?{...t,is_active:a}:t)),c.oR.success("Template ".concat(a?"activated":"deactivated"," successfully")))}catch(e){c.oR.error("Failed to ".concat(a?"activate":"deactivate"," template")),console.error("Error updating template status:",e)}finally{b(null)}},[I]),H=(0,l.useMemo)(()=>({templates:e,isLoading:R,hasMore:e.length<m,error:O?String(O):null,totalItems:m,loadedItems:e.length}),[e,R,m,O]),J=(0,l.useCallback)((e,t)=>{v(e),t||(U(),setTimeout(()=>z(C,e,g,0,10),0))},[z,U,C,g]),W=(0,l.useMemo)(()=>(0,r.s)(V,400),[]),Z=(0,l.useCallback)((e,t)=>{S(e),t||W(e)},[W]),G=(0,l.useCallback)((e,t)=>{f(e),t||(U(),setTimeout(()=>z(e,h,g,0,10),0))},[z,U,h,g]),Q=(0,l.useCallback)(()=>{U(),z()},[U,z]),X=(0,l.useCallback)(()=>{d.Lx.openDialog("create-rst-template",{title:"Create New Competency Matrix",size:"full",width:"50vw",data:{onCancel:()=>{console.log("Template creation cancelled")},onUploadComplete:Q}})},[Q]),$=(0,l.useCallback)(e=>x===e,[x]),ee=(0,l.useCallback)(()=>{E([]),L(1),A(0)},[]),et=(0,l.useCallback)(async(e,t,a)=>{try{let l=await D({status:C,page:t||1,page_size:a||10,search:void 0!==e?e:N});if((null==l?void 0:l.status_code)===200){let e=(null==l?void 0:l.data)||[];E(e),L(1),A((null==l?void 0:l.total_count)||0)}}catch(e){console.error("Error loading initial users:",e)}},[D,N]),ea=(0,l.useCallback)(async()=>{try{let e=await D({page:T+1,page_size:10,search:N});if((null==e?void 0:e.status_code)===200){let t=(null==e?void 0:e.data)||[];E(e=>[...e,...t]),L(e=>e+1),A((null==e?void 0:e.total_count)||0)}}catch(e){console.error("Error loading more users:",e)}},[D,T,N]),el=(0,l.useCallback)(async e=>{try{if(ee(),!e.trim())return void await et("",1,10);let t=await D({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),L(1),A((null==t?void 0:t.total_count)||0)}}catch(e){console.error("Error searching users:",e)}},[D,et,ee]),ei=(0,l.useMemo)(()=>(0,r.s)(el,400),[el]),er=(0,l.useCallback)((e,t)=>{w(e),t||ei(e)},[ei]),en=(0,l.useMemo)(()=>({users:y,isLoadingUsers:k,usersHasMore:y.length<j,usersError:q?String(q):null,usersTotalItems:j,usersLoadedItems:y.length}),[y,k,j,q]);return{...H,loadInitialTemplates:z,loadMoreTemplates:K,ensureRstTemplateInList:F,resetTemplates:U,searchTemplates:V,sortBy:h,searchQuery:g,status:C,onSortChange:J,onSearchChange:Z,onStatusChange:G,onCreateTemplate:X,onActivateDeactivate:Y,isActivateDeactivateLoading:I.isPending,isTemplateLoading:$,...en,loadInitialUsers:et,loadMoreUsers:ea,resetUsers:ee,searchUsers:el,usersSearchQuery:N,xQtivPOCError:q,isLoadingXQtivPOC:k,onUsersSearchChange:er}}},92096:(e,t,a)=>{a.d(t,{UB:()=>r,aw:()=>o,ej:()=>i,mI:()=>n,u0:()=>s});var l=a(98734),i=function(e){return e.All="all",e.Active="active",e.Inactive="inactive",e}({}),r=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 n={ALL:"all",ACTIVE:"active",INACTIVE:"inactive"},o={NEWEST:"newest_to_oldest",OLDEST:"oldest_to_newest",AZ:"a_to_z",ZA:"z_to_a"},s=l.Ik({rstTemplate:l.KC([l.Yj().min(1,"Please select at least one RST template"),l.YO(l.Yj()).min(1,"Please select at least one RST template")])})}}]);

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.