PageSourceSearch

https://app.janus-ai.com/681.6f3e0c7d88c9c6e3.js

js janus-ai.com collected 2026-10-06 18:16:35 UTC 18,274 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkjanus_ui=self.webpackChunkjanus_ui||[]).push([[681],{67681:(gt,P,r)=>{r.r(P),r.d(P,{OpportunitiesPage:()=>dt});var I=r(76733),m=r(43226),O=r(39129),C=r(38513),g=r(64288),u=r(87865),D=r(6307),w=r(11983),$=r(38075),_=r(56424),U=r(31570),S=r(92425),Z=r(78748),h=r(81749),L=r(71209),J=r(21813),G=r(77083),t=r(94966);let Q=(()=>{class i{constructor(){this.deleting=!1,this.confirm=new t.vpe,this.cancel=new t.vpe}delete(){this.deleting=!0,this.confirm.emit()}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=t.Xpm({type:i,selectors:[["app-opportunity-delete-dialog"]],inputs:{title:"title",opportunity:"opportunity"},outputs:{confirm:"confirm",cancel:"cancel"},standalone:!0,features:[t.jDz],decls:11,vars:4,consts:[[3,"title"],[1,"d-flex","buttons"],["variant","error",3,"isProcessing","disabled","click"],["variant","light",3,"click"]],template:function(o,e){1&o&&(t.TgZ(0,"jui-dialog",0)(1,"p"),t._uU(2,"Are you sure you want to delete "),t.TgZ(3,"b"),t._uU(4),t.qZA(),t._uU(5,"?"),t.qZA(),t.TgZ(6,"div",1)(7,"jui-button",2),t.NdJ("click",function(){return e.delete()}),t._uU(8,"Delete"),t.qZA(),t.TgZ(9,"jui-button",3),t.NdJ("click",function(){return e.cancel.emit()}),t._uU(10,"Cancel"),t.qZA()()()),2&o&&(t.Q6J("title",e.title),t.xp6(4),t.Oqu(e.opportunity.name),t.xp6(3),t.Q6J("isProcessing",e.deleting)("disabled",e.deleting))},dependencies:[u._j,u.zb,D.IJ],styles:[".buttons[_ngcontent-%COMP%]{gap:5px}jui-dialog[_ngcontent-%COMP%]     .body{transform:translateY(0)!important;top:5em!important}"],changeDetection:0})}}return i})();var R=r(40468),d=r(70555),Y=r(4354),k=r(22866),F=r.n(k),j=r(77807),E=r(7668),K=r(29586),z=r(37417),B=r(39391),A=r(51960),V=r(20382),H=r(17560),W=r(30453),M=r(22923);let q=(()=>{class i{constructor(n,o){this.opportunityService=n,this.denialsReportingService=o}getBlob(n,o){return n.type===d.Lw.DenialInsights?this.getDenialsBlob(n,o):this.getProcessMapBlob(n)}getProcessMapBlob(n){return this.opportunityService.getEvents(n.id).pipe((0,S.U)(({events:o})=>{const e=w.Q.convertJsonToCsv(o);return new Blob([e],{type:"text/csv"})}))}getDenialsBlob(n,o){const e=n.metadata?.denialsDrilldownParams?.variables;if(!e)return(0,A._)(()=>new Error("Missing denials drilldown parameters"));const s=this.denialsReportingService.buildDrilldownAsyncStatementInput(e);return(0,V.D)(this.denialsReportingService.runAsyncStatementForCsvBlob(s,{signal:o})).pipe((0,H.K)(p=>p instanceof M.PO||o?.aborted?W.E:(0,A._)(()=>p)))}static{this.\u0275fac=function(o){return new(o||i)(t.LFG(j.E),t.LFG(M.dn))}}static{this.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function X(i,a){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&i){const n=a.item;t.xp6(),t.Oqu(n.data.name)}}function tt(i,a){if(1&i&&t._UZ(0,"fa-icon",14),2&i){const n=t.oxw(2);t.Q6J("icon",n.iconUser)("fixedWidth",!0)}}function et(i,a){if(1&i&&t._UZ(0,"fa-icon",14),2&i){const n=t.oxw(2);t.Q6J("icon",n.iconRobot)("fixedWidth",!0)}}function nt(i,a){if(1&i&&t.YNc(0,tt,1,2,"fa-icon",14)(1,et,1,2),2&i){const n=a.value;t.um2(0,"user"===n?0:"discovered"===n?1:-1)}}function ot(i,a){if(1&i&&(t.TgZ(0,"a",15),t._uU(1),t.qZA()),2&i){const n=a.value,o=a.row,e=t.oxw();t.Q6J("routerLink",e.getOpportunityLink(o)),t.xp6(),t.Oqu(n)}}function it(i,a){if(1&i&&(t.TgZ(0,"jui-badge",16),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&i){const n=a.value,o=t.oxw();t.Q6J("variant",o.getOpportunityStatusVariant(n)),t.xp6(),t.Oqu(t.lcZ(2,2,n))}}const rt=(i,a)=>a.id;function at(i,a){if(1&i&&(t.TgZ(0,"li",18)(1,"div",19),t._uU(2),t.ALo(3,"titlecase"),t.qZA(),t.TgZ(4,"div",20),t._uU(5),t.qZA()()),2&i){const n=a.$implicit,o=t.oxw(2);t.xp6(2),t.Oqu(t.lcZ(3,2,o.getKpiName(n))),t.xp6(3),t.Oqu(o.getFormattedValue(n))}}function st(i,a){if(1&i&&(t.TgZ(0,"ul",17),t.SjG(1,at,6,4,"li",21,rt),t.qZA()),2&i){const n=a.row,o=t.oxw();t.xp6(),t.wJu(o.getLatestKpis(n.kpis))}}function lt(i,a){if(1&i){const n=t.EpF();t.TgZ(0,"jui-button",22,23),t._UZ(2,"fa-icon",2),t.qZA(),t.TgZ(3,"jui-menu",24,25)(5,"li",26),t.NdJ("click",function(){const s=t.CHM(n).value,p=t.oxw();return t.KtG(p.viewOpportunity(s))}),t._uU(6,"View"),t.qZA(),t.TgZ(7,"li",26),t.NdJ("click",function(){const s=t.CHM(n).value,p=t.oxw();return t.KtG(p.openSaveAsOpportunityDialog(s))}),t._uU(8,"Update"),t.qZA(),t._UZ(9,"li",27),t.TgZ(10,"li",26),t.NdJ("click",function(){const s=t.CHM(n).value,p=t.oxw();return t.KtG(p.downloadOpportunity(s))}),t._UZ(11,"fa-icon",2),t._uU(12," Download data "),t.qZA(),t.TgZ(13,"li",26),t.NdJ("click",function(){const s=t.CHM(n).value,p=t.oxw();return t.KtG(p.deleteOpportunity(s))}),t._UZ(14,"fa-icon",2),t._uU(15," Delete "),t.qZA()()}if(2&i){const n=t.MAs(1),o=t.MAs(4),e=t.oxw();t.Q6J("juiMenuToggle",o),t.xp6(2),t.Q6J("icon",e.iconEllipsis),t.xp6(),t.Q6J("juiPopper",n.elementRef),t.xp6(8),t.Q6J("icon",e.iconDownload),t.xp6(3),t.Q6J("icon",e.iconTrash)}}function pt(i,a){if(1&i&&(t.TgZ(0,"span",28),t._uU(1),t.qZA()),2&i){const n=a.value;t.xp6(),t.Oqu(n)}}const ct={name:"name",type:"type",opportunityStatus:"opportunityStatus",score:"score",createdAt:"createdAt",startDate:"startDate",endDate:"endDate"};class ut{constructor(a,n,o){this.orgId=a,this.opportunityService=n,this.getFilters=o,this.total=new _.X(0),this.cache=new Map}getData(a){const n={...this.getFilters(),...this.mapSorting(a.sorting)};return this.opportunityService.fetchOpportunities(this.orgId,a.page*a.pageSize,a.pageSize,n).pipe((0,U.b)(o=>
1{this.total.next(o.total),o.opportunities.forEach(e=>{this.cache.set(e.id,e)})}),(0,S.U)(o=>o.opportunities))}mapSorting(a){const[n,o]=Object.entries(a??{})[0]??[],e=n?ct[n]:void 0;return e&&o?{sortField:e,sortDirection:o.direction}:{}}getTotal(){return this.total.asObservable()}get(a){return this.cache.get(a)}}const x=i=>(0,Y.startCase)(String(i)).replaceAll("_"," "),T=i=>{if("string"!=typeof i||i.length<=100)return i;const n=i.slice(0,100),o=n.lastIndexOf(" ");return n.slice(0,o>=0?o:100)+"..."},N=(i,a)=>{if(!i||"object"!=typeof i)return"";const n=i,o=n.processMapGraphParams?n.processMapGraphParams[a]:n.denialsDrilldownParams?.variables[a],e=F().utc(o);return e.isValid()?e.format("YYYY-MM-DD"):""};let dt=(()=>{class i{constructor(n,o,e,s,p,f,b,y,mt){this.opportunityService=n,this.opportunityFormService=o,this.authenticationService=e,this.router=s,this.activatedRoute=p,this.dialogService=f,this.toastService=b,this.opportunityKpiService=y,this.opportunityDownloadService=mt,this.objectKeys=Object.keys,this.iconPlus=g.KtF,this.iconEllipsis=g.S6C,this.iconTrash=g.$aW,this.iconDownload=g.kwI,this.iconUser=g.ILF,this.iconRobot=g.VE0,this.destroy$=new Z.x,this.refresh$=new Z.x,this.filterForm=new m.cw({type:new m.NI([],{nonNullable:!0}),opportunityStatus:new m.NI([],{nonNullable:!0}),opportunityGroupId:new m.NI([],{nonNullable:!0})}),this.typeOptions=Object.values(d.Lw).map(l=>({id:l,name:x(l)})),this.statusOptions=Object.values(d.Qr).map(l=>({id:l,name:this.opportunityService.getOpportunityStatusLabel(l)})),this.groupOptions$=new _.X([]),this.groupSearch=l=>this.groupOptions$.pipe((0,S.U)(c=>c.filter(v=>v.name.toLowerCase().includes((l??"").toLowerCase())))),this.tableConfig={small:!0,columns:[{field:"origin",header:"",sortable:!1,searchable:!1,templateName:"origin"},{field:"name",header:"Name",sortable:!0,searchable:!1,templateName:"name"},{field:"description",header:"Description",sortable:!1,searchable:!1,format:T},{field:"type",header:"Type",sortable:!0,searchable:!1,format:(l,c,v)=>T("string"==typeof l?x(l):l)},{field:"detectionMethod",header:"Detection Method",sortable:!1,searchable:!1,format:(l,c,v)=>T("string"==typeof l?x(l):"")},{field:"createdAt",header:"Created",sortable:!0,searchable:!1,templateName:"metadata-date",format:l=>{const c=F().utc(l);return c.isValid()?c.format("YYYY-MM-DD"):""}},{field:"startDate",header:"Start date",sortable:!0,searchable:!1,templateName:"metadata-date",format:(l,c)=>N(c.metadata,"startDate")},{field:"endDate",header:"End date",sortable:!0,searchable:!1,templateName:"metadata-date",format:(l,c)=>N(c.metadata,"endDate")},{field:"opportunityStatus",header:"Status",templateName:"status",sortable:!0,searchable:!1},{field:"score",header:"Score",sortable:!0,searchable:!1,format:l=>"number"==typeof l?Math.round(10*l):l},{field:"kpis",header:"KPIs",templateName:"kpis",sortable:!1,searchable:!1},{field:"creator",header:"Creator",format:l=>l?l.name:"System"},{field:"id",header:"Actions",templateName:"view-opportunity",sortable:!1,searchable:!1},{field:"opportunityGroupId",header:"",visibleInRow:!1}],groupByField:"opportunityGroupId",groupByRowFormat:(l,c)=>c.opportunityGroup?c.opportunityGroup.name:"Uncategorized"},this.tableDataSource=new ut(this.authenticationService.getUser().orgId,this.opportunityService,()=>this.activeFilters())}ngOnInit(){this.activatedRoute.queryParams.pipe((0,h.R)(this.destroy$)).subscribe(({type:n,opportunityStatus:o,opportunityGroupId:e})=>{this.filterForm.setValue({type:n?n.split(","):[],opportunityStatus:o?o.split(","):[],opportunityGroupId:e?e.split(","):[]}),this.refresh$.next(!0)}),this.opportunityService.getOpportunityGroups().pipe((0,h.R)(this.destroy$)).subscribe(n=>{this.groupOptions$.next(n.opportunityGroups.map(o=>({id:o.id,name:o.name})))})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}activeFilters(){const{type:n,opportunityStatus:o,opportunityGroupId:e}=this.filterForm.getRawValue();return{...n.length?{type:n}:{},...o.length?{opportunityStatus:o}:{},...e.length?{opportunityGroupId:e}:{}}}onFilterChange(n,o,e){const s=[...o.value];n.forEach(({control:p,data:f})=>{const b=p.value,y=s.indexOf(f.id);b&&-1===y?s.push(f.id):!b&&-1!==y&&s.splice(y,1)}),this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{[e]:s.length?s.join(","):null},queryParamsHandling:"merge"})}searchOptions(n){return o=>(0,L.of)(n.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())))}clearFilters(){this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{type:null,opportunityStatus:null,opportunityGroupId:null},queryParamsHandling:"merge"})}createOpportunity(){this.router.navigate(["process-intelligence/process-maps"])}getOpportunityLink(n){switch(n.type){case d.Lw.DenialInsights:return["/process-intelligence/denials-reporting/drilldown",n.id];case d.Lw.WorkforceManagement:return["/illuminate/workforce-management"];default:return["/process-intelligence/process-maps",n.id]}}getSelectedFilterText(n){return this.filterForm.controls[n].value.length?this.filterForm.controls[n].value.length+" selected":`All ${{type:"types",opportunityStatus:"statuses",opportunityGroupId:"groups"}[n]}`}viewOpportunity(n){const o=this.tableDataSource.get(n),e=this.getOpportunityLink(o);this.router.navigate(e)}deleteOpportunity(n){const o=this.dialogService.openDialog(Q);o.componentInstance.opportunity=this.tableDataSource.get(n),o.componentInstance.title="Delete Opportunity",o.componentInstance.confirm.pipe((0,h.R)(this.destroy$)).subscribe(()=>{this.opportunityService.deleteOpportunity(n).subscribe({next:()=>{this.refresh$.next(!0),o.close()},error:e=>this.toastService.error("Error deleting opportunity",e)})}),o.componentInstance.cancel.subscribe(()=>{o.close()})}downloadOpportunity(n){const o=this.tableDataSource.get(n),e=this.dialogService.openDialog($.m);
1e.componentInstance.title="Download Opportunity",e.componentInstance.loading$.next(!0),e.componentInstance.message$.next(`Downloading data for ${o.name}`),e.componentInstance.close.subscribe(()=>{e.close()});const s=new AbortController;e.closed.pipe((0,J.q)(1)).subscribe(()=>s.abort()),this.opportunityDownloadService.getBlob(o,s.signal).pipe((0,h.R)(e.closed)).subscribe({next:p=>{if(!p.size)return e.componentInstance.message$.next("No data found"),e.componentInstance.messageType$.next("warning"),void e.componentInstance.loading$.next(!1);try{e.componentInstance.message$.next("Preparing file"),w.Q.downloadCsvFile(p,`${o.name} - data.csv`),e.componentInstance.loading$.next(!1),e.componentInstance.message$.next("File downloaded successfully"),e.componentInstance.messageType$.next("success"),e.componentInstance.buttonLabel$.next("Close")}catch{e.componentInstance.loading$.next(!1),e.componentInstance.message$.next("Error preparing file for download."),e.componentInstance.messageType$.next("danger"),e.componentInstance.buttonLabel$.next("Close")}},error:()=>{e.componentInstance.loading$.next(!1),e.componentInstance.message$.next("Failed to fetch opportunity data."),e.componentInstance.messageType$.next("danger"),e.componentInstance.buttonLabel$.next("Close")}})}getOpportunityStatusVariant(n){const o=new Map([[d.Qr.New,"info"],[d.Qr.Reviewing,"info"],[d.Qr.Implementing,"warning"],[d.Qr.Deleted,"error"],[d.Qr.Completed,"success"]]);return o.has(n)?o.get(n):"default"}openSaveAsOpportunityDialog(n){const o=this.tableDataSource.get(n);o&&this.opportunityFormService.getForm().patchValue(o);const e=this.dialogService.openDialog(R.D);e.componentInstance.processMapGraphParams=o.metadata.processMapGraphParams,e.componentInstance.denialsDrilldownParams=o.metadata.denialsDrilldownParams,e.componentInstance.title="Update Opportunity",e.componentInstance.save.pipe((0,h.R)(this.destroy$)).subscribe(s=>{const p={...o,...s};this.opportunityService.updateOpportunity(p).subscribe({next:()=>{this.refresh$.next(!0),e.close()},error:f=>this.toastService.error("Error saving opportunity",f)})}),e.componentInstance.cancel.subscribe(()=>{e.close()})}getLatestKpis(n){return Array.isArray(n)?this.opportunityKpiService.getLatestKpis(n):[]}getKpiName(n){return this.opportunityKpiService.getKpiName(n)}getFormattedValue(n){return this.opportunityKpiService.getFormattedValue(n)}static{this.\u0275fac=function(o){return new(o||i)(t.Y36(j.E),t.Y36(E.z),t.Y36(K.$),t.Y36(O.F0),t.Y36(O.gz),t.Y36(u.x_),t.Y36(z.k),t.Y36(B.q),t.Y36(q))}}static{this.\u0275cmp=t.Xpm({type:i,selectors:[["app-opportunities-page"]],standalone:!0,features:[t.jDz],decls:27,vars:18,consts:[[3,"config","dataSource","enableSearch","refresh$"],["ngProjectAs","toolbar-top",5,["toolbar-top"],1,"add-button",3,"click"],[3,"icon"],["ngProjectAs","toolbar-middle",5,["toolbar-middle"],1,"opportunity-filter-bar",3,"formGroup"],["filterLabel",""],[1,"filter-field"],[3,"filterLabel","fetchOnSearch","selectedIds","placeholderText","onSelect"],["type","button",1,"clear-filters-btn",3,"click"],["juiTableTemplateName","origin"],["juiTableTemplateName","name"],["juiTableTemplateName","status"],["juiTableTemplateName","kpis"],["juiTableTemplateName","view-opportunity"],["juiTableTemplateName","metadata-date"],[3,"icon","fixedWidth"],[3,"routerLink"],[3,"variant"],[1,"list-group","list-group-flush","m-0"],[1,"list-group-item","list-group-item-action","bg-transparent","py-0"],[1,"font-weight-bold"],["title","KPI value"],["class","list-group-item list-group-item-action bg-transparent py-0"],["variant","text",1,"action-button",3,"juiMenuToggle"],["toggleButton",""],["juiPopperPlacement","bottom-end",3,"juiPopper"],["menu",""],["jui-menu-item","",3,"click"],["jui-menu-divider",""],[1,"text-nowrap"]],template:function(o,e){if(1&o&&(t.TgZ(0,"jui-data-table-view",0)(1,"jui-button",1),t.NdJ("click",function(){return e.createOpportunity()}),t._UZ(2,"fa-icon",2),t._uU(3," Create opportunity "),t.qZA(),t.TgZ(4,"div",3),t.YNc(5,X,2,1,"ng-template",null,4,t.W1O),t.TgZ(7,"div",5)(8,"label"),t._uU(9,"Group"),t.qZA(),t.TgZ(10,"app-multiselect-typeahead",6),t.NdJ("onSelect",function(p){return e.onFilterChange(p,e.filterForm.controls.opportunityGroupId,"opportunityGroupId")}),t.qZA()(),t.TgZ(11,"div",5)(12,"label"),t._uU(13,"Type"),t.qZA(),t.TgZ(14,"app-multiselect-typeahead",6),t.NdJ("onSelect",function(p){return e.onFilterChange(p,e.filterForm.controls.type,"type")}),t.qZA()(),t.TgZ(15,"div",5)(16,"label"),t._uU(17,"Status"),t.qZA(),t.TgZ(18,"app-multiselect-typeahead",6),t.NdJ("onSelect",function(p){return e.onFilterChange(p,e.filterForm.controls.opportunityStatus,"opportunityStatus")}),t.qZA()(),t.TgZ(19,"button",7),t.NdJ("click",function(){return e.clearFilters()}),t._uU(20,"Clear all"),t.qZA()(),t.YNc(21,nt,2,1,"ng-template",8)(22,ot,2,2,"ng-template",9)(23,it,3,4,"ng-template",10)(24,st,3,0,"ng-template",11)(25,lt,16,5,"ng-template",12)(26,pt,2,1,"ng-template",13),t.qZA()),2&o){const s=t.MAs(6);t.Q6J("config",e.tableConfig)("dataSource",e.tableDataSource)("enableSearch",!1)("refresh$",e.refresh$),t.xp6(2),t.Q6J("icon",e.iconPlus),t.xp6(2),t.Q6J("formGroup",e.filterForm),t.xp6(6),t.Q6J("filterLabel",s)("fetchOnSearch",e.groupSearch)("selectedIds",e.filterForm.controls.opportunityGroupId.value)("placeholderText",e.getSelectedFilterText("opportunityGroupId")),t.xp6(4),t.Q6J("filterLabel",s)("fetchOnSearch",e.searchOptions(e.typeOptions))("selectedIds",e.filterForm.controls.type.value)("placeholderText",e.getSelectedFilterText("type")),t.xp6(4),t.Q6J("filterLabel",s)("fetchOnSearch",e.searchOptions(e.statusOptions))("selectedIds",e.filterForm.controls.opportunityStatus.value)("placeholderText",e.getSelectedFilterText("opportunityStatus"))}},dependencies:[I.ez,I.rS,m.UX,m.JL,m.sg,u._,u.Cb,u.zb,u.NU,u.c_,u.wk,u.aF,u.bW,u.M2,u.h4,C.uH,C.BN,O.rH,D.IJ,G.k],styles:["jui-button.action-button[_ngcontent-%COMP%]     button{padding:.25rem .75rem!important}jui-button.add-button[_ngcontent-%COMP%]{margin-right:.5em}jui-menu[_ngcontent-%COMP%]{z-index:2}.opportunity-filter-bar[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-end;
1gap:.75rem 1rem;margin-bottom:1.5rem;padding:1rem 1.5rem;width:100%;border:1px solid #ced4da;border-radius:6px;background:#fbfcfe}.opportunity-filter-bar[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:11rem}.opportunity-filter-bar[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:700;letter-spacing:.025rem;text-transform:uppercase;color:#6b7280}.opportunity-filter-bar[_ngcontent-%COMP%]   .clear-filters-btn[_ngcontent-%COMP%]{font-size:1.4rem;margin-left:auto;padding:.5rem .25rem;background:none;border:none;font-weight:600;color:var(--bs-primary, #1f9bd2);cursor:pointer}.opportunity-filter-bar[_ngcontent-%COMP%]   .clear-filters-btn[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})}}return i})()}}]);

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.