1import{a as Wt}from"./chunk-2U6RV3LO.js";import{a as Jt}from"./chunk-V5SP25K2.js";import{a as Zt}from"./chunk-SGMLPF5V.js";import{a as Gt,b as Xt,c as ye,d as Yt,e as Qt}from"./chunk-7YVFTKHC.js";import"./chunk-OHETVC3G.js";import"./chunk-R4EYQLJT.js";import{a as _e,b as Bt,c as $t,e as Kt,f as ve,g as qt}from"./chunk-NZ4VQSBE.js";import"./chunk-IR4JIF5W.js";import{b as jt,c as Ut,d as ee,h as Ht}from"./chunk-3ZKEHOYR.js";import{a as Ce}from"./chunk-5BRN7YD3.js";import"./chunk-7KEZJJYQ.js";import{c as ke,d as Le,e as Me}from"./chunk-2WG7I46D.js";import"./chunk-C4MS7DNK.js";import{a as Vt}from"./chunk-IHJMD6TU.js";import"./chunk-A4FIOM7M.js";import{a as Rt,b as V}from"./chunk-YZMJNOQO.js";import{a as zt}from"./chunk-ZM2M4T7I.js";import"./chunk-VNC3NFO5.js";import"./chunk-4QBFOCAY.js";import"./chunk-YHU7MHLI.js";import{a as At}from"./chunk-4WROE6D2.js";import"./chunk-DWBJ3FFW.js";import"./chunk-KZNNECHN.js";import"./chunk-VQV5QB5X.js";import"./chunk-N56KERXN.js";import"./chunk-MDZNRQS6.js";import{a as Ot}from"./chunk-F3UQTJ3A.js";import"./chunk-63K2LES7.js";import{a as Dt}from"./chunk-Q47B5CFJ.js";import{a as Mt}from"./chunk-THNUPQ7V.js";import{a as Lt}from"./chunk-6FYLJLJR.js";import"./chunk-DG3V3SWL.js";import"./chunk-63S7Z45L.js";import{a as kt}from"./chunk-GA4ZWRQ2.js";import"./chunk-4MPIUD7L.js";import"./chunk-XEDJBE7K.js";import"./chunk-PU4BAJCF.js";import"./chunk-RDBQLGOI.js";import"./chunk-WWE47JCL.js";import"./chunk-72DQ4U6K.js";import"./chunk-W6QVGQJH.js";import"./chunk-D2HMEQE7.js";import{a as fe}from"./chunk-BENDDUCM.js";import"./chunk-D7TP2RB2.js";import"./chunk-FJ2I7HMZ.js";import"./chunk-CCGT3L3J.js";import{a as Ft}from"./chunk-D6UX732D.js";import"./chunk-BRMPHYYJ.js";import"./chunk-VADS3VHW.js";import{a as Tt}from"./chunk-IDTQSFGF.js";import{c as ge}from"./chunk-QSR4XSOW.js";import"./chunk-EYV3GWVO.js";import"./chunk-F2XU6FO6.js";import{b as xt}from"./chunk-HB4JGH6L.js";import{e as he}from"./chunk-VJX6N2HB.js";import"./chunk-H4EPMV5Z.js";import"./chunk-MYI3YS2M.js";import{a as ce}from"./chunk-6PXU6RTR.js";import"./chunk-6DH3EJIN.js";import"./chunk-UZY2R5Q5.js";import"./chunk-5GAGQHFR.js";import"./chunk-RXRKGCUL.js";import"./chunk-LW7CZM4G.js";import"./chunk-EW2NZJHY.js";import"./chunk-GAHMBGQ7.js";import{a as ct}from"./chunk-UAWJ3VGL.js";import"./chunk-VT7CJSCD.js";import"./chunk-EDTOPITP.js";import{a as It}from"./chunk-R2ER225G.js";import{Aa as ue,C as gt,Ca as Pt,E as Ct,I as _t,N as vt,O as yt,Q as de,R as Z,T as St,Z as bt,_ as wt,j as A,l as D,m as mt,n as me,pa as Et,q as pt,u as dt,v as ut,w as ht,x as ft,y as pe,ya as Nt}from"./chunk-TU3JUKDL.js";import"./chunk-6JETGMQG.js";import"./chunk-VRQFSSVW.js";import"./chunk-E3FOSCHV.js";import"./chunk-J2VV25SD.js";import"./chunk-RGZN3DMZ.js";import{a as Fe}from"./chunk-Y4544WYO.js";import"./chunk-73R64QIM.js";import{a as J}from"./chunk-KOEZPSOA.js";import{I as lt,r as z,t as le,u as Q}from"./chunk-ZEL44FAF.js";import"./chunk-RT33Z4W3.js";import{L as Y,M as se,e as Qe,h as Je,i as Ze,k as et,n as tt,p as it,t as nt,w as ot,x as rt,y as at,z as st}from"./chunk-CTTXKPH2.js";import"./chunk-EURTYAWN.js";import"./chunk-CT5YU3F2.js";import{e as Ge,h as Xe,i as Ye,j as Te}from"./chunk-B5NVKW3K.js";import{w as qe,z as O}from"./chunk-MRC2PHN7.js";import{A as Ae,Bc as Re,Bd as je,Cc as K,Cd as Ue,Dc as q,Dd as He,Eb as De,Ec as d,Fa as x,Fc as a,Gc as s,Hc as N,Id as xe,Jb as c,Jd as Be,Kd as $e,Qc as H,Sa as S,Ta as b,Wb as u,Xc as f,Zc as _,bc as M,cc as T,ee as Ke,gc as ae,hd as ze,i as re,ld as p,md as L,nd as B,od as Ve,sd as W,td as G,ud as X,ue as We,w as Oe,xc as F,zc as k}from"./chunk-77LCFR2D.js";import{a as U,b as te,l as v}from"./chunk-6G35VSEK.js";var li=(n,g)=>g.value;function ci(n,g){if(n&1&&(a(0,"option",10),p(1),s()),n&2){let e=g.$implicit;d("value",e.value),c(),L(e.label)}}var be=(()=>{class n{get statusError(){let e=this.updateForm?.get("status");return e&&e.touched&&e.invalid?"Select a status to apply.":""}constructor(e,i){this.activeModal=e,this.nominationService=i,this.selectedNominations=[],this.isLoading=!1,this.title="",this.message="",this.statusOptions=[]}ngOnInit(){this.title=`Update ${this.selectedNominations.length} nomination(s)`,this.message="Select a new status for the selected nominations.",this.updateForm=new et({status:new tt("",Qe.required)}),this.statusOptions=this.nominationService.getStatusOptions.filter(e=>e!=="registered").map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1)}))}onSubmit(){return v(this,null,function*(){if(this.updateForm.invali
1d){this.updateForm.markAllAsTouched();return}this.isLoading=!0;let e=this.updateForm.get("status")?.value;try{let i=yield this.nominationService.bulkUpdateStatus(this.selectedNominations,e);if(i?.success)this.activeModal.close({success:!0,updatedCount:this.selectedNominations.length,newStatus:e});else{this.activeModal.close({success:!1,error:i?.error||"Failed to update nomination status."});return}}catch(i){console.error("Error updating nomination status:",i),this.activeModal.close({success:!1,error:"Failed to update nomination status. Please try again."})}finally{this.isLoading=!1}})}static{this.\u0275fac=function(i){return new(i||n)(u(z),u(V))}}static{this.\u0275cmp=M({type:n,selectors:[["ng-component"]],decls:20,vars:8,consts:[[1,"modal-header"],[1,"modal-title"],["variant","ghost","ariaLabel","Close",1,"dialog-close",3,"click","iconOnly","disabled"],["name","close"],[3,"ngSubmit","formGroup"],[1,"modal-body"],[1,"message"],["label","Status","controlId","bulk-update-status",3,"error"],["cnpInput","","id","bulk-update-status","formControlName","status"],["value",""],[3,"value"],[1,"modal-footer"],["variant","secondary",3,"click"],["type","submit","loadingLabel","Updating",3,"disabled","loading"]],template:function(i,t){i&1&&(a(0,"div",0)(1,"h4",1),p(2),s(),a(3,"cnp-button",2),f("click",function(){return t.activeModal.dismiss("Close")}),N(4,"cnp-icon",3),s()(),a(5,"form",4),f("ngSubmit",function(){return t.onSubmit()}),a(6,"div",5)(7,"p",6),p(8),s(),a(9,"cnp-field",7)(10,"select",8)(11,"option",9),p(12,"Select a status\u2026"),s(),K(13,ci,2,2,"option",10,li),s()()(),a(15,"div",11)(16,"cnp-button",12),f("click",function(){return t.activeModal.dismiss()}),p(17,"Cancel"),s(),a(18,"cnp-button",13),p(19," Update "),s()()()),i&2&&(c(2),L(t.title),c(),d("iconOnly",!0)("disabled",t.isLoading),c(2),d("formGroup",t.updateForm),c(3),L(t.message),c(),d("error",t.statusError),c(4),q(t.statusOptions),c(5),d("disabled",t.updateForm.invalid||t.isLoading)("loading",t.isLoading))},dependencies:[Y,it,at,st,rt,Je,Ze,se,nt,ot,D,Et,A,dt],styles:[".message[_ngcontent-%COMP%]{margin-block-end:var(--cnp-space-4);color:var(--cnp-color-text-muted)}"]})}}return n})();var ei=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=T({type:n})}static{this.\u0275inj=x({imports:[O,Y,se,Ft,At,Q,be]})}}return n})();var we=(()=>{class n{constructor(e,i,t){this.nominationService=e,this.utilitiesService=i,this.modal=t,this.isLoading=!1}ngOnInit(){}onSave(e){return v(this,null,function*(){this.isLoading=!0;let i=yield this.nominationService.create(e);i&&i.success?(this.isLoading=!1,this.modal.close(i.data)):(this.isLoading=!1,this.utilitiesService.alert({header:"Error",message:i.message?i.message:"Unknown error: "+i}))})}static{this.\u0275fac=function(i){return new(i||n)(u(V),u(J),u(z))}}static{this.\u0275cmp=M({type:n,selectors:[["app-create"]],decls:6,vars:2,consts:[[1,"modal-header"],[1,"modal-title"],["variant","ghost","ariaLabel","Close",1,"dialog-close",3,"click","iconOnly"],["name","close"],[3,"save","isLoading"]],template:function(i,t){i&1&&(a(0,"div",0)(1,"h4",1),p(2,"Create nomination"),s(),a(3,"cnp-button",2),f("click",function(){return t.modal.dismiss()}),N(4,"cnp-icon",3),s()(),a(5,"app-form",4),f("save",function(r){return t.onSave(r)}),s()),i&2&&(c(3),d("iconOnly",!0),c(2),d("isLoading",t.isLoading))},dependencies:[Xt,D,A],encapsulation:2})}}return n})();var ii=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=T({type:n})}static{this.\u0275inj=x({imports:[O,ye,we]})}}return n})();var Ee=(()=>{class n{constructor(e){this.modal=e,this.isLoading=!1}ngOnInit(){}close(){this.modal.close()}static{this.\u0275fac=function(i){return new(i||n)(u(z))}}static{this.\u0275cmp=M({type:n,selectors:[["app-nomination-framework-guidance"]],decls:14,vars:1,consts:[[1,"modal-header"],[1,"modal-title"],["variant","ghost","ariaLabel","Close",1,"dialog-close",3,"click","iconOnly"],["name","close"],[1,"modal-body"],["href","https://canapii-assets-prod.s3.eu-west-1.amazonaws.com/event-hp-reinvent-2022-d003b55d/Partner+Nomination+Form.xlsx"],[1,"modal-footer"],["variant","secondary",3,"click"]],template:function(i,t){i&1&&(a(0,"div",0)(1,"h4",1),p(2,"Nomination framework guidance"),s(),a(3,"cnp-button",2),f("click",function(){return t.close()}),N(4,"cnp-icon",3),s()(),a(5,"div",4)(6,"p"),p(7,"Please download attached document for guidance on how nomination fields should be filled
1in"),s(),a(8,"p")(9,"a",5),p(10,"Partner nomination form"),s()()(),a(11,"div",6)(12,"cnp-button",7),f("click",function(){return t.modal.dismiss()}),p(13,"Close"),s()()),i&2&&(c(3),d("iconOnly",!0))},dependencies:[D,A],encapsulation:2})}}return n})();var ni=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=T({type:n})}static{this.\u0275inj=x({imports:[O,ye,Ee]})}}return n})();function mi(n,g){if(n&1&&(a(0,"cnp-status-pill",4),p(1),s()),n&2){let e=_();c(),B("",e.successCount," valid")}}function pi(n,g){if(n&1&&(a(0,"cnp-status-pill",5),p(1),s()),n&2){let e=_();c(),Ve("",e.errorCount," error",e.errorCount===1?"":"s")}}function di(n,g){if(n&1&&(a(0,"cnp-status-pill",4),p(1),s()),n&2){let e=_().$implicit,i=_();c(),L(i.validLabel(e.__item))}}function ui(n,g){if(n&1&&(a(0,"li"),p(1),s()),n&2){let e=g.$implicit;c(),B("",e,".")}}function hi(n,g){if(n&1&&(a(0,"cnp-status-pill",5),p(1,"Error"),s(),a(2,"ul",15),K(3,ui,2,1,"li",null,Re),s()),n&2){let e=_().$implicit;c(3),q(e.__item.error)}}function fi(n,g){if(n&1&&F(0,di,2,1,"cnp-status-pill",4)(1,hi,5,0),n&2){let e=g.$implicit,i=_();k(i.isValid(e.__item)?0:1)}}var gi=3e3,Ne=(()=>{class n{constructor(e,i,t,o){this.activeModal=e,this.nominationService=i,this.utilitiesService=t,this.http=o,this.errorCount=0,this.successCount=0,this.totalCount=0,this.csvHeaders=[],this.isLoading=!1,this.updateExisting=!1,this.canUpdate=0,this.dataToDisplay=[],this.previewRows=[],this.previewColumns=[],this.rowKey=r=>`${r.__index}`,this.setPasswordOnLogin=!1,this.setWelcomeEmail=!1,this.destroyed=!1}static toPreviewItem(e){let i=e??{};return te(U({},i),{error:Array.isArray(i.error)?i.error:["This row could not be read."],data:i.data&&typeof i.data=="object"?i.data:{}})}loadRows(){return v(this,null,function*(){let e=typeof this.data=="string"?yield this.fetchRows(this.data):this.data;return Array.isArray(e)?e.map(i=>n.toPreviewItem(i)):(this.utilitiesService.alert({header:"Error",message:"The import preview could not be loaded. Please try again."}),[])})}fetchRows(e){return v(this,null,function*(){try{return yield Oe(this.http.get(e))}catch(i){console.error("Error loading the import preview:",i);return}})}ngOnInit(){return v(this,null,function*(){this.canUpdate=0,this.dataToDisplay=yield this.loadRows(),this.dataToDisplay.forEach(e=>{e.error.length?this.errorCount++:this.successCount++,e.error.length===1&&e.error[0]==="Email already exists"&&(this.canUpdate++,e.exist=!0)}),this.csvHeaders=this.headers?this.headers:Object.keys(this.dataToDisplay[0]?.data??{}),this.previewRows=this.dataToDisplay.map((e,i)=>te(U({},e.data),{__index:i+1,__item:e})),this.buildPreviewColumns()})}static{this.RESERVED_KEYS=["__index","__result","__item"]}buildPreviewColumns(){this.previewColumns=[{key:"__index",header:"#",width:"56px"},{key:"__result",header:"Result",width:"200px"},...[...new Set(this.csvHeaders)].filter(e=>!n.RESERVED_KEYS.includes(e)).map(e=>({key:e,header:e}))]}isValid(e){return!e.error.length||!!e.exist&&this.updateExisting}validLabel(e){return this.updateExisting&&e.exist?"To update":"To add"}import(){return v(this,null,function*(){this.isLoading=!0;try{yield this.commitImport()}catch(e){console.error("Error importing nominations:",e),this.reportFailure("Import failed, please try again later.")}finally{this.isLoading=!1}})}ngOnDestroy(){this.destroyed=!0}commitImport(){return v(this,null,function*(){let e=yield this.runImport();if(!e)return;let i=e.imported??0;this.utilitiesService.alert({header:"Success",message:`Imported ${i} nomination${i>1?"s":""}.`}),this.activeModal.dismiss(),this.nominationService.load(!0)})}runImport(){return v(this,null,function*(){let e=yield this.nominationService.import(this.result.PK,"import",this.updateExisting,this.setPasswordOnLogin,this.setWelcomeEmail);if(this.destroyed)return null;if(!e?.success)return this.reportFailure(e?.message||"Import failed, please try again later."),null;let i=e.data;return ve(e.data)&&(i=yield this.pollImport(e.data.PK),!i)?(this.reportFailure($t),null):i?.result?.success?i:(this.reportFailure(i?.result?.message||"Import failed, please try again later."),null)})}pollImport(e){return v(this,null,function*(){let i=0,t="";for(;i<=_e;){i++,yield new Promise(w=>setTimeout(w,gi));let o=yield this.nominationService.import(e,"status");if(this.destroyed)return null;let r=o?.data;if(r?.status==="done")return r;let l=this.recordProgress(r);l&&l!==t&&(t=l,i=0)}return null})}recordProgress(e){return e?.total&&(this.totalCount=e.total,this.successCount=e.current??this.successCount),Kt(e)}reportFailure(e){this.destroyed||this.utilitiesService.alert({header:"Error",message:e})}toggleOverwrite(e){this.updateExisting=e,this.updateExisting?(this.successCount+=this.canUpdate,this.errorCount-=this.canUpdate):(this.successCount-=this.canUpdate,this.errorCount+=this.canUpdate)}toggleSetPassword(e){this.setPasswordOnLogin=e}toggleWelcomeEmail(e){this.setWelcomeEmail=e}static{this.\u0275fac=function(i){return new(i||n)(u(z),u(V),u(J),u(We))}}static{this.\u0275cmp=M({type:n,selectors:[["app-preview"]],decls:19,vars:12,consts:[[1,"modal-header"],[1,"modal-title"],[1,"preview-counts"],["tone","neutral"],["tone","success","icon","status-active"],["tone","danger","icon","status-declined"],["variant","ghost","ariaLabel","Close",1,"dialog-close",3,"click","iconOnly"],["name","close"],[1,"modal-body"],["ariaLabel","Import preview","emptyMessage","There is nothing to preview.",3,"columns","rows","rowKey"],["cnpCell","__result"],[1,"modal-footer"],["label","Overwrite existing",1,"footer-start",3,"checkedChange","disabled","checked"],["variant","secondary",3,"click"],[3,"click","loading","disabled"],[1,"preview-errors"]],template:function(i,t){i&1&&(a(0,"div",0)(1,"h4",1),p(2,"Preview import"),s(),a(3,"div",2)(4,"cnp-status-pill",3),p(5),s(),F(6,mi,2,1,"cnp-status-pill",4),F(7,pi,2,2,"cnp-status-pill",5),s(),a(8,"cnp-button",6),f("
1click",function(){return t.activeModal.dismiss()}),N(9,"cnp-icon",7),s()(),a(10,"div",8)(11,"cnp-table",9),ae(12,fi,2,1,"ng-template",10),s()(),a(13,"div",11)(14,"cnp-checkbox",12),f("checkedChange",function(r){return t.toggleOverwrite(r)}),s(),a(15,"cnp-button",13),f("click",function(){return t.activeModal.dismiss()}),p(16,"Close"),s(),a(17,"cnp-button",14),f("click",function(){return t.import()}),p(18),s()()),i&2&&(c(5),B("",t.successCount+t.errorCount," total"),c(),k(t.successCount?6:-1),c(),k(t.errorCount?7:-1),c(),d("iconOnly",!0),c(3),d("columns",t.previewColumns)("rows",t.previewRows)("rowKey",t.rowKey),c(3),d("disabled",t.isLoading)("checked",t.updateExisting),c(3),d("loading",t.isLoading)("disabled",t.isLoading||!t.successCount),c(),B(" Import ",t.successCount?"("+t.successCount+(t.totalCount?"/"+t.totalCount:"")+(t.successCount===1&&!t.totalCount?" row)":" rows)"):""," "))},dependencies:[D,de,yt,A,me,Z],styles:[".preview-counts[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--cnp-space-2);margin-inline-start:auto}.preview-errors[_ngcontent-%COMP%]{margin:var(--cnp-space-2) 0 0;padding-inline-start:var(--cnp-space-5);color:var(--cnp-color-text-muted)}.footer-start[_ngcontent-%COMP%]{margin-inline-end:auto}"]})}}return n})();function yi(n,g){if(n&1&&(a(0,"cnp-callout",11),p(1),s()),n&2){let e=_();d("heading",e.errorHeading),c(),L(e.error)}}var Si=3e3,Pe=(()=>{class n{onFilePicked(e){let i=e[0]??null;this.error="",this.errorHeading=ee;let t=Ht(i);if(t){this.selectedFile=null,this.dropzoneFiles=[],this.error=t,this.errorHeading=Ut;return}if(i&&!n.isImportFile(i)){this.selectedFile=null,this.dropzoneFiles=[],this.error="Please select a CSV/XLSX file.";return}this.selectedFile=i}static isImportFile(e){let i=e.name.substring(e.name.lastIndexOf(".")).toLowerCase();return i===".csv"||i===".xlsx"}onFileRemoved(){this.selectedFile=null,this.error="",this.errorHeading=ee}constructor(e,i,t,o,r,l,w,j){this.attendeeService=e,this.modal=i,this.utilitiesService=t,this.eventService=o,this.activeModal=r,this.nominationService=l,this.settingService=w,this.csvDownloadTemplateService=j,this.selectedFile=null,this.dropzoneFiles=[],this.fileHint=jt,this.errorHeading=ee,this.guideColumns=[{key:"name",header:"Header name",width:"22%"},{key:"format",header:"Data format",width:"26%"},{key:"required",header:"Required field",width:"16%"},{key:"description",header:"Definition",width:"36%"}],this.guideRowKey=C=>`${this.importHeaders.indexOf(C)}-${C?.name}`,this.importHeaders=[{name:"Email",format:"String",required:"Required",description:"Email of nominated attendee"},{name:"First_name",format:"String",required:"Required",description:"First name of nominated attendee"},{name:"Last_name",format:"String",required:"Required",description:"Last name of nominated attendee"},{name:"Status",format:"String",required:"Required",description:'Should be "Send invite"'}],this.fileFormat=["csv","xlsx"],this.templateFormatItems=this.fileFormat.map(C=>({id:C,label:C.toUpperCase(),icon:"file"})),this.isLoading=!1,this.showGuide=!1,this.error="",this.isImporting=!1,this.subscription$=[],this.destroyed=!1}upload(){return v(this,null,function*(){if(this.selectedFile){this.error="",this.errorHeading=ee,this.isLoading=!0;try{yield this.analyzeAndPreview(this.selectedFile)}catch(e){console.error("Error analyzing the import file:",e),this.reportFailure("Import failed, please try again later.")}finally{this.isLoading=!1}}})}ngOnDestroy(){this.destroyed=!0,this.subscription$.forEach(e=>e.unsubscribe())}analyzeAndPreview(e){return v(this,null,function*(){let i=yield this.attendeeService.uploadCsvForImport(e);if(this.destroyed)return;if(!i.success){this.reportFailure(i.message);return}let t=yield this.analyze(i.data);if(!t||this.destroyed)return;this.activeModal.dismiss();let o=this.modal.open(Ne,{size:"lg",backdrop:"static",windowClass:"cnp-dialog"});o.componentInstance.result=t.job,o.componentInstance.data=t.outcome.data,o.componentInstance.headers=t.outcome.headers,o.componentInstance.csv=i.data})}analyze(e){return v(this,null,function*(){let i=yield this.nominationService.import(e,"analyze");if(this.destroyed)return null;if(!i?.success)return this.reportFailure(i?.message||"Import failed, please try again later."),null;if(!i.data?.PK)return this.reportFailure("Import failed, please try again later."),null;let t=qt(i.data);return ve(i.data)&&(t=yield this.pollAnalysis(i.data.PK),!t)?(this.reportFailure(Bt),null):t?.success?{job:i.data,outcome:t}:(this.reportFailure(t?.message||"Import failed, please try again later."),null)})}pollAnalysis(e){return v(this,null,function*(){for(let i=0;i<_e&&!this.destroyed;i++){if(yield new Promise(o=>setTimeout(o,Si)),this.destroyed)return null;let t=yield this.nominationService.import(e,"status");if(t?.data?.status==="done")return t.data.result}return null})}reportFailure(e,i=ee){this.destroyed||(this.error=e,this.errorHeading=i,this.utilitiesService.alert({header:"Error",message:e}))}
1downloadTemplate(e){let i=["Header name","Data format","Required field","Definition"];this.csvDownloadTemplateService.downloadTemplate("nominations",this.importHeaders,i,e)}ngOnInit(){let e=i=>i&&i[0].toUpperCase()+i.slice(1);this.subscription$.push(this.nominationService.onNominationFieldsChanged(i=>{let t=["text","textarea","select","selectmultiple","radio","checkbox"];for(let o of i.filter(r=>t.includes(r.type)).sort((r,l)=>r.sort-l.sort)){let r=e(o.name.toLowerCase().replace(/ /g,"_"));if(o.type==="radio"||o.type==="select"||o.type==="checkbox"||o.type==="selectmultiple"){let l=o.options.replace(/\n/g,", ");o.otherOption!=="disabled"&&(l=l.concat(", Other"));let w=o.optionsFileUrl!==""?"Refer to attribute's valid list of options.":o.type==="radio"||o.type==="select"?`Must be one of [${l}]`:`One or more from [${l}], separated by comma`,j={name:r,format:"String",required:"Optional",description:w};this.importHeaders=[...this.importHeaders,j];continue}else if(o.type==="text"){let l={name:r,format:"String",required:"Optional",description:"Any line of text"};this.importHeaders=[...this.importHeaders,l]}else if(o.type==="textarea"){let l={name:r,format:"String",required:"Optional",description:"Single or muliple lines of text"};this.importHeaders=[...this.importHeaders,l]}else{let l={name:r,format:"String",required:o.mandatory==="mandatory"?"Required":"Optional",description:o.name+" custom attribute of the nomination."};this.importHeaders=[...this.importHeaders,l]}}})),this.load()}load(){return v(this,null,function*(){let e=["company","country","jobTitle","phone_number","type","attendance","nickName"],i={jobTitle:{name:"Job_title",format:"String",required:"Optional",description:"Job title of the attendee"},company:{name:"Company",format:"String",required:"Optional",description:"Company of the attendee"},phone_number:{name:"Mobile_number",format:"String",required:"Optional",description:"Mobile number of the attendee"},country:{name:"Country",format:"String",required:"Optional",description:"Country of the attendee."},attendance:{name:"Experience",format:"String",required:"Optional",description:"Event experience (remote/onsite)."},type:{name:"Type",format:"String",required:"Optional",description:"Attendee type"}},{data:t}=yield this.settingService.get("custom-registration");t&&(t.telNum&&t.telNum.visible&&delete t.telNum,e.forEach(o=>{if(t[o]&&t[o]?.linkToNomination){let r=t[o]?.attribute??t[o]?.form;i[r]&&(this.importHeaders=[...this.importHeaders,te(U({},i[r]),{required:t[o]?.mandatory?"Required":"Optional"})])}}))})}static{this.\u0275fac=function(i){return new(i||n)(u(fe),u(le),u(J),u(ce),u(z),u(V),u(he),u(Ce))}}static{this.\u0275cmp=M({type:n,selectors:[["app-import"]],features:[je([Ce])],decls:22,vars:13,consts:[[1,"modal-header"],[1,"dialog-heading"],[1,"modal-title"],[1,"dialog-description"],["variant","ghost","ariaLabel","Close",1,"dialog-close",3,"click","iconOnly"],["name","close"],[1,"modal-body","import-select"],[3,"headingLevel"],["heading","Import guide","description","The headers this import accepts, and what each one expects.",3,"expandedChange","expanded"],["ariaLabel","Import guide","emptyMessage","No import headers are configured for this event.",3,"columns","rows","rowKey"],["controlId","nominationImportFile","label","Drop your CSV or XLSX file here, or choose one","accept",".csv,.xlsx",3,"filesChange","picked","removed","hint","disabled","files"],["tone","danger","live","status",3,"heading"],[1,"modal-footer"],["ariaLabel","Download template",1,"footer-start",3,"select","items"],["name","export"],["variant","secondary",3,"click"],["loadingLabel","Checking the file",3,"click","loading","disabled"]],template:function(i,t){i&1&&(a(0,"div",0)(1,"div",1)(2,"h4",2),p(3,"Import nominations"),s(),a(4,"p",3),p(5,"To import nominations, please select CSV/XLSX file."),s()(),a(6,"cnp-button",4),f("click",function(){return t.activeModal.dismiss()}),N(7,"cnp-icon",5),s()(),a(8,"div",6)(9,"cnp-accordion",7)(10,"cnp-accordion-item",8),f("expandedChange",function(r){return t.showGuide=r}),N(11,"cnp-table",9),s()(),a(12,"cnp-dropzone",10),X("filesChange",function(r){return G(t.dropzoneFiles,r)||(t.dropzoneFiles=r),r}),f("picked",function(r){return t.onFilePicked(r)})("removed",function(){return t.onFileRemoved()}),s(),F(13,yi,2,2,"cnp-callout",11),s(),a(14,"div",12)(15,"cnp-dropdown",13),f("select",function(r){return t.downloadTemplate(r)}),N(16,"cnp-icon",14),p(17," Download template "),s(),a(18,"cnp-button",15),f("click",function(){return t.activeModal.dismiss()}),p(19,"Close"),s(),a(20,"cnp-button",16),f("click",function(){return t.upload()}),p(21," Preview "),s()()),i&2&&(c(6),d("iconOnly",!0),c(3),d("headingLevel",3),c(),d("expanded",t.showGuide),c(),d("columns",t.guideColumns)("rows",t.importHeaders)("rowKey",t.guideRowKey),c(),d("hint",t.fileHint)("disabled",t.isLoading),W("files",t.dropzoneFiles),c(),k(t.error?13:-1),c(2),d("items",t.templateFormatItems),c(5
1),d("loading",t.isLoading)("disabled",!t.selectedFile||t.isLoading))},dependencies:[wt,bt,D,ue,pe,Nt,A,Z],styles:[".dialog-heading[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-description[_ngcontent-%COMP%]{margin:var(--cnp-space-1) 0 0;font-size:var(--cnp-font-size-body);color:var(--cnp-color-text-muted)}.import-select[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cnp-space-5)}.footer-start[_ngcontent-%COMP%]{margin-inline-end:auto}"]})}}return n})();var oi=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=T({type:n})}static{this.\u0275inj=x({imports:[O,Ne]})}}return n})();var ri=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=T({type:n})}static{this.\u0275inj=x({imports:[O,oi,Q,lt,Pe]})}}return n})();var bi=()=>["settings"],wi=n=>[n],Ei=(n,g)=>g.key;function Ni(n,g){if(n&1&&(a(0,"a",4),p(1),s()),n&2){let e=_();d("href",e.registrationLink,De),c(),L(e.registrationLink)}}function Pi(n,g){n&1&&N(0,"cnp-skeleton",5),n&2&&d("rows",1)}function Ii(n,g){if(n&1&&(a(0,"span",27),p(1),a(2,"strong"),p(3),s()()),n&2){let e=g.$implicit;c(),B(" ",e.key," "),c(2),L(e.value)}}function xi(n,g){if(n&1&&(a(0,"div",6),K(1,Ii,4,2,"span",27,Ei),xe(3,"keyvalue"),s()),n&2){let e=_();c(),q($e(3,0,e.nominationSummary,e.onCompare))}}function Ti(n,g){if(n&1){let e=H();a(0,"cnp-bulk-bar",28),f("clear",function(){S(e);let t=_();return b(t.clearSelection())}),a(1,"cnp-button",29),f("click",function(){S(e);let t=_();return b(t.bulkUpdateStatus())}),N(2,"cnp-icon",30),p(3," Status "),s()()}if(n&2){let e=_();d("count",e.selectedKeys.size)}}function Fi(n,g){if(n&1){let e=H();a(0,"cnp-dropdown",32),X("openChange",function(t){S(e);let o=_(2);return G(o.exportMenuOpen,t)||(o.exportMenuOpen=t),b(t)}),f("select",function(t){S(e);let o=_(2);return b(o.onHpExportSelect(t))}),N(1,"cnp-icon",33),p(2," Export "),s()}if(n&2){let e=_(2);d("items",e.hpExportItems),W("open",e.exportMenuOpen)}}function ki(n,g){n&1&&(a(0,"cnp-button",31),p(1," Export "),s()),n&2&&d("disabled",!0)("loading",!0)}function Li(n,g){if(n&1&&F(0,Fi,3,2,"cnp-dropdown",12)(1,ki,2,2,"cnp-button",31),n&2){let e=_();k(e.dataLoadedForExport?0:1)}}function Mi(n,g){if(n&1){let e=H();a(0,"cnp-button",11),f("click",function(){S(e);let t=_(2);return b(t.downloadCSV())}),p(1,"Export"),s()}}function Oi(n,g){if(n&1){let e=H();F(0,Mi,2,0,"cnp-button",34),a(1,"cnp-button",11),f("click",function(){S(e);let t=_();return b(t.nominationFrameworkGuidance())}),p(2," Nomination framework guidance "),s()}if(n&2){let e=_();k(e.filterSource.data.length?0:-1)}}function Ai(n,g){if(n&1){let e=H();a(0,"cnp-dropdown",32),X("openChange",function(t){S(e);let o=_();return G(o.exportMenuOpen,t)||(o.exportMenuOpen=t),b(t)}),f("select",function(t){S(e);let o=_();return b(o.onExportSelect(t))}),N(1,"cnp-icon",33),p(2," Export "),s()}if(n&2){let e=_();d("items",e.exportItems),W("open",e.exportMenuOpen)}}function Di(n,g){if(n&1&&N(0,"cnp-count-badge",18),n&2){let e=_();d("value",e.activeFilterLength)}}function Ri(n,g){if(n&1&&(a(0,"a",35),p(1),s()),n&2){let e=g.$implicit,i=g.value,t=_();d("routerLink",He(3,wi,e.PK))("queryParams",t.queryParams),c(),L(i)}}function zi(n,g){if(n&1&&(a(0,"cnp-status-pill",36),p(1),s()),n&2){let e=g.value,i=_();d("tone",i.statusTone(e)),c(),L(i.statusLabel(e))}}function Vi(n,g){if(n&1&&(p(0),xe(1,"dateFormat")),n&2){let e=g.value;L(Be(1,1,e))}}var Ie=(()=>{class n{static{this.BASE_PAGE_SIZES=[50,100,150,200,300,500]}buildPageSizeOptions(){let e=this.filterSource.data.length,i=n.BASE_PAGE_SIZES;this.pageSizeOptions=e>0&&!i.includes(e)?[...i,e]:i}onCompare(e,i){return 1}constructor(e,i,t,o,r,l,w,j,C,P,I,y,E,ne,m){this.modal=e,this.router=i,this.route=t,this.nominationService=o,this.csvDownloadService=r,this.dateFormatPipe=l,this.attendeeService=w,this.eventService=j,this.cdr=C,this.attendeeTypeService=P,this.domainService=I,this.toastService=y,this.settingService=E,this.settingfieldService=ne,this.eventBespokeService=m,this.columnsToDisplay=[],this.filterSource=new Jt(()=>this.refreshRows()),this.columns=[],this.visibleRows=[],this.filteredCount=0,this.sort={key:"status",direction:"asc"},this.currentPage=1,this.pageSize=50,this.pageSizeOptions=n.BASE_PAGE_SIZES,this.selectedKeys=new Set,this.filterPanelOpen=!1,this.exportMenuOpen=!1,this.rowKey=h=>`${h.PK}`,this.selectLabel=h=>`${h.email||h.name||h.PK}`,this.isSelectionDisabled=h=>h.status==="registered"&&!this.eventBespokeService.isCanalysEvent2025,this.isImporting=!1,this.validNominationFields=["email","firstName","lastName"],this.formattedNominationFields=["Attendee Type","Invitee Email","Prefix","Invitee First Name","Invitee Last Name","Invitee Job Title","Invitee Company","Invitee Company Level","Business Function","Geographic Market","Country","Assistant First Name","Assistant Last Name","Assistant Email","Partner Type","Partner Id","Preferred Lang","Nominator First Name","Nominator Last Name","Nominator Email","PBM First Name","PBM Last Name","PBM Email","Account Status","Amplify Impact Status","Job Category","Organization","Location ID","Sales Team","Sales Leader","Sales Manager","City","State","Mobile Phone Number","LinkedIn Profile"],this.subscription$=[],this.attendees=[],this.nominationTypes=Rt,this.isHpReinvent=!1,this.isHpPs=!1,this.isHpReinvent2022=!1,this.isCCF2022=!1,this.nominationSummary={},this.customNominationFields=[],this.isNominationsEnabled=!1,this.isAmplify2023=!1,this.nominationFieldsToShow=[],this.activeFilterLength=null,this.customAttributes=[],this.filterableColumns=[],this.isLoading=!0,this.tableOptions=[],this.nominationsLoaded$=new re(!1),this.nominationAttributesLoaded$=new re(!1),this.customAttributesLoaded$=new re(!1),this.exportItems=[{id:"nomination",label:"Nomination data"},{id:"attendee",label:"Attendee and nomination data"}],this.hpExportItems=[{id:n.EXPORT_ALL,label:"Export all"}]}ngOnInit(){this.isNominationsEnabled=this.eventService.data?.isNominationsEnabled,this.isAmplify2023=this.eventService.data?.url==="amplify-partner-conference-2023",this.nominationService.load(!0),this.eventService.data.url==="hp-reinvent"&&(this.nominationTypes=["Partner","Vendor","ELT","Employee","Admin","BoD"],this.buildHpExportItems(),this.isHpReinvent=!0),this.eventService.data.url==="hp-ps-unleashed"&&(this.isHpPs=!0),(this.eventService.data.url==="hp-reinvent-2022"||this.eventService.data.url==="hp-amplify-partner-conference-2022")&&(this.isHpReinvent2022=!0),["emea-2022","apac-2022"].includes(this.eventService.data.url)&&(this.isCCF2022=!0,this.validNominationFields=[],this.formattedNominationFields=[],Gt.forEach(e
1=>{this.validNominationFields.push(e.key),this.formattedNominationFields.push(e.label)}),this.columnsToDisplay.splice(6,0,"dinner","golf")),(this.isHpReinvent2022||this.isCCF2022||this.isNominationsEnabled)&&(this.subscription$.push(this.attendeeTypeService.onChanged(e=>{this.nominationTypes=[],e.forEach(i=>{this.nominationTypes.push(i.name)}),this.buildHpExportItems()})),this.attendeeTypeService.load()),this.generateRegistrationLink(),this.getNominationSettings(),this.nominationService.loadNominationFields(),this.subscription$.push(this.nominationService.onNominationFieldsChanged(e=>{this.customNominationFields=e,this.tableOptions.length>0||(this.nominationFieldsToShow=[]),this.filterableColumns=[{key:"firstName",name:"Name"},{key:"email",name:"Email"},{key:"status",name:"Status",type:"select",options:this.nominationService.getStatusOptions.map(t=>({name:this.toTitleCase(t),value:t}))},{key:"type",name:"Type",type:"select",options:this.nominationTypes.map(t=>({name:this.toTitleCase(t),value:t}))},{key:"country",name:"Country",type:"select",options:xt.map(t=>({name:t,value:t}))}],this.customNominationFields.forEach(t=>{this.filterableColumns.push(U({key:t.attribute,name:t.name},t.options&&{type:t.type,options:t.options.split(` 2`).map(o=>({name:o,value:o}))}))}),this.nominationAttributesLoaded$.next(!0)})),this.subscription$.push(Ae([this.customAttributesLoaded$,this.nominationAttributesLoaded$,this.nominationsLoaded$]).subscribe(([e,i,t])=>{!e||!i||!t||this.processNominationAttributesForExport(this.filterSource.data)})),this.subscription$.push(this.settingfieldService.onChanged(e=>{this.customAttributes=e||[],this.customAttributesLoaded$.next(!0)})),this.settingfieldService.load(!0),this.subscription$.push(this.route.queryParams.subscribe(e=>{e&&(this.queryParams=e,this.searchBox=e.search)}))}ngAfterViewInit(){this.nominationSubscription=this.nominationService.onChanged(e=>{this.setData(e),this.isHpPs&&(this.nominationTypes=e.reduce((i,t)=>(t.type&&!i.includes(t.type)&&i.push(t.type),i),[]),this.buildHpExportItems())}),this.subscription$.push(this.attendeeService.onAttendeesChanged(e=>{this.attendees=e.filter(i=>i.email!=="[email protected]")})),this.attendeeService.load()}setData(e){e.length&&(this.isCCF2022&&(this.pageSize=e.length,Object.keys(this.nominationSummary).forEach(i=>this.nominationSummary[i]=0)),this.filterSource.data=e.map(i=>(i.name=`${i.firstName} ${i.lastName}`,i.status=i.status.toLowerCase(),i)),(this.isCCF2022||this.isNominationsEnabled)&&(this.nominationService.getStatusOptions.forEach(i=>{this.nominationSummary[i]=0}),this.filterSource.data.forEach(({status:i,dinner:t})=>{i in this.nominationSummary&&this.nominationSummary[i]++,this.isCCF2022&&t&&(t in this.nominationSummary?this.nominationSummary[t]++:this.nominationSummary[t]=0)}),["north-america-2023","emea-2023","apac-2023"].includes(this.eventService.data.url)||(this.nominationSummary.nominated=this.filterSource.data.length)),this.dataLoadedForExport=!0,this.buildPageSizeOptions(),this.refreshRows(),this.cdr.detectChanges(),this.nominationsLoaded$.next(!0)),this.filterBySearchParam(),this.isLoading=!1}ngOnDestroy(){this.nominationSubscription.unsubscribe(),this.subscription$.forEach(e=>e.unsubscribe())}create(){return v(this,null,function*(){let e=this.modal.open(we,{size:"lg",backdrop:"static",windowClass:"cnp-dialog"});try{let i=yield e.result;this.router.navigate([i.PK],{relativeTo:this.route})}catch{}})}refresh(){return v(this,null,function*(){this.isLoading=!0,this.filterSource.data=[],this.buildPageSizeOptions(),this.refreshRows(),yield this.nominationService.load(!0)})}view(e){this.router.navigate(["nomination",e])}applyFilter(e){this.searchBox=e,this.currentPage=1,this.filterSource.filter=e.trim().toLowerCase(),this.setUrlParams(e),this.filterLength(null)}downloadCSV(e="",i=!1){return v(this,null,function*(){try{let t=structuredClone(this.filterSource.data),o=yield this.nominationService.getLinkedAttributes(i),r=yield this.getNominationLinkedAttributes(i);t=t.reduce((C,P)=>{if(e&&P.type&&e.toLowerCase()!==P.type.toLowerCase())return C;let I={},y=this.attendees.find(m=>m.email===P.email),E=P;y&&(delete y.status,delete y.lastUpdate,delete y.updatedBy,delete y.lastUpdatedAttributes,I=y,this.isAmplify2023&&y.breakOutSessionQuestion&&y.activitiesRateQuestion&&["activitiesRateQuestion","breakOutSessionQuestion"].forEach(m=>
2{Object.values(y[m]).forEach(h=>{E[h.question]=h.answer})}));let ne=["dateCreated"];return Object.keys(P).forEach(m=>{(I[m]&&I[m]!==""||!E.hasOwnProperty(m))&&!ne.includes(m)&&(E[m]=I[m])}),y&&(E.dateRegistered=this.dateFormatPipe.transform(y.dateCreated,!1,!1,"YYYY-MM-DD").trim(),this.isHpReinvent&&y.survey&&Object.keys(y.survey).forEach((m,h)=>{E[`survey-Q${h+1}`]=y.survey[m]}),this.includeMaritzDetails(E,y)),E.dateCreated=this.dateFormatPipe.transform(P.dateCreated,!1,!1,"YYYY-MM-DD").trim(),P.lastUpdate&&(E.lastUpdate=this.dateFormatPipe.transform(P.lastUpdate,!1,!1,"YYYY-MM-DD").trim()),E.status=this.toTitleCase(E.status),this.isHpReinvent&&E.status==="Send Invite"&&(E.status="Invited"),this.mergeNominationAttributeData(E,r,y,o),C.push(E),C},[]);let l=this.validNominationFields;if(this.customNominationFields.length)l=["email","firstName","lastName",...this.customNominationFields.map(C=>C.name.replace(/ /g,"_"))];else{let C=[],P=[];e==="Partner"?(C=["companyLevel","businessFunction","assistantFirstName","assistantLastName","assistantEmail","organization"],P=["survey-Q1","survey-Q2","survey-Q3","survey-Q4","survey-Q5","survey-Q6","survey-Q7"]):e==="Employee"&&(C=["partnerType","partnerId","preferredLang","pbmFirstName","pbmLastName","pbmEmail","accountStatus","amplifyImpactStatus","jobCategory","locationId","salesTeam","salesLeader","salesManager"]),l=l.filter(I=>!C.includes(I)),l=l.concat(P)}l.push(...r),this.eventService?.data?.maritzSiteUrl&&(l.push(["Maritz - Departure Date","maritzDepartureDate"],["Maritz - Arrival Date","maritzArrivalDate"],["Maritz - Hotel Name","maritzHotelName"],["Maritz - Reservation Status","maritzReservationStatus"]),t.forEach(C=>{C.maritzDetails&&(C.maritzDepartureDate=C.maritzDetails.departureDate?.split("T").shift(),C.maritzArrivalDate=C.maritzDetails.arrivalDate?.split("T").shift(),C.maritzHotelName=C.maritzDetails.hotelName,C.maritzReservationStatus=C.maritzDetails.reservationStatus)})),this.isCCF2022||l.unshift("status"),this.isAmplify2023&&l.push("Networking with Peers","Guest Speaker","Product Showcase/Demo Room","Sustainability of event","Meeting with HP executives 1:1","Wellness Activities","Diversity and Inclusion Activities","Evening Events","Workforce Services and Solutions","Software Solutions","Collaboration","3D Printing","Peripherals","Gaming","Subscription Models","Hybrid Work"),this.processNominationAttributesForExport(t),t.sort((C,P)=>{let I=C.dateCreated,y=P.dateCreated;return!I&&!y?0:I?y&&I<y?1:-1:1});let w=yield this.sortColumnsByAttributeOrder(l),j=i?"nominations_attendee-nomination":"nominations";this.csvDownloadService.fromJsonList(j,t,w.concat(["dateCreated","dateRegistered","lastUpdate","updatedBy","lastUpdatedAttributes"]))}catch{}})}processNominationAttributesForExport(e){e.forEach(i=>{for(let t in i){let o=i[t];i[t]=this.processAttributeValue(o,t)}})}findCustomField(e){return this.customNominationFields.find(i=>i.attribute===e)||this.customAttributes.find(i=>i.attribute===e)}processAttributeValue(e,i){let t=this.findCustomField(i);if(typeof e=="string"){let o=t?.otherOptionSelection||"Other";e.startsWith(`${o} - `)&&(e=e.substring(`${o} - `.length))}return Array.isArray(e)?this.processArrayValueWithObjects(e,t):ke(e)?Le(e,t):typeof e=="string"?Me(e,t):typeof e=="object"&&e!==null&&e!==void 0?JSON.stringify(e):e}processArrayValueWithObjects(e,i){return e.map(o=>typeof o=="string"?o:typeof o=="object"&&o!==null?o.other===!0?!o.value||o.value.trim()===""?null:`${i?.otherOptionSelection||"Other"} - ${o.value}`:o.value?o.value:JSON.stringify(o):String(o)).filter(o=>o!==null&&o!=="").join(", ")}includeMaritzDetails(e,i){this.eventService?.data?.maritzSiteUrl&&i?.maritzDetails&&(e.maritzDetails=i.maritzDetails)}toTitleCase(e){return e.replace(/\w\S*/g,i=>i.charAt(0).toUpperCase()+i.substr(1).toLowerCase())}mergeNominationAttributeData(e,i,t,o){this.customNominationFields.length&&this.customNominationFields.forEach(r=>{e[r.name.replace(/ /g,"_")]=this.extractCustomData(e.email,r.attribute)}),i.length&&i.forEach(r=>{if(!e[r[1]]){let l=t?t[r[1]]:"";e[r[1]]=this.processLinkedAttributeValue(l,r[1],o)}})}processLinkedAttributeValue(e,i,t){return e&&(t?.success&&t.data?this.processValueWithLinkedData(e,i,t):this.processValueWithoutLinkedData(e))}processValueWithLinkedData(e,i,t){let o=t.data.find(r=>r.attribute===i);return Array.isArray(e)?this.processArrayValueWithObjects(e,o):this.isLinkedAttributeWithOtherOption(o)?this.processOtherOptionValue(e,o):this.processObjectValue(e)}processValueWithoutLinkedData(e){return Array.isArray(e)?this.processArrayValueWithObjects(e,null):this.processObjectValue(e)}isLinkedAttributeWithOtherOption(e){return e?.options&&e?.otherOptionSelection}processOtherOptionValue(e,i){return i.options.includes(e)?e:`${i.otherOptionSelection} - ${e}`}processObjectValue(e){return typeof e=="object"&&e!==null?"value"in e?e.value:JSON.stringify(e):e}
2extractCustomData(e,i){let t=this.filterSource.data.find(l=>l.email===e);if(!t?.[i])return"";let o=t[i],r=this.findCustomField(i);return this.processCustomDataValue(o,r)}processCustomDataValue(e,i){return Array.isArray(e)?this.processArrayValueWithObjects(e,i):ke(e)?Le(e,i):typeof e=="object"&&e!==null&&"value"in e?e.value:typeof e=="string"?Me(e,i):e}camelize(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(i,t)=>t===0?i.toLowerCase():i.toUpperCase()).replace(/\s+/g,"")}nominationFrameworkGuidance(){this.modal.open(Ee,{size:"md",windowClass:"cnp-dialog"})}import(){this.modal.open(Pe,{size:"xl",backdrop:"static",windowClass:"cnp-dialog"})}filterChange(){this.clearSelection(),this.currentPage=1,this.refreshRows()}filterLength(e){this.activeFilterLength=e}onSelectedChange(e){this.selectedKeys=e}pruneSelection(e){if(!this.selectedKeys.size)return;let i=new Set(e.map(o=>this.rowKey(o))),t=[...this.selectedKeys].filter(o=>i.has(o));t.length!==this.selectedKeys.size&&(this.selectedKeys=new Set(t))}clearSelection(){this.selectedKeys=new Set}onSortChange(e){this.sort=e,this.refreshRows()}onPageChange(e){this.currentPage=e,this.refreshRows()}onPageSizeChange(e){this.pageSize=e,this.currentPage=1,this.refreshRows()}refreshRows(){let e=Qt(this.filterSource.filteredData,this.sort,Yt);this.filteredCount=e.length,this.pruneSelection(e);let i=Math.max(1,Math.ceil(e.length/this.pageSize));this.currentPage>i&&(this.currentPage=i);let t=(this.currentPage-1)*this.pageSize;this.visibleRows=e.slice(t,t+this.pageSize)}bulkUpdateStatus(){return v(this,null,function*(){if(!this.selectedKeys.size){this.toastService.showWarning("Error","Please select nominations to update.");return}let e=this.filterSource.data.filter(r=>this.selectedKeys.has(r.PK)),i,t;if(this.eventBespokeService.isCanalysEvent2025?(i=e,t=0):(i=e.filter(r=>r.status!=="registered"),t=e.length-i.length),i.length===0){this.toastService.showWarning("Error","No nominations can be updated (all selected nominations are registered).");return}let o=this.modal.open(be,{size:"md",backdrop:"static",windowClass:"cnp-dialog"});o.componentInstance.selectedNominations=i.map(r=>r.PK),t>0&&!this.eventBespokeService.isCanalysEvent2025&&(o.componentInstance.message=`Update status for ${i.length} selected nomination(s). ${t} registered nomination(s) will be skipped.`);try{let r=yield o.result;r.success?(this.toastService.showSuccess("Success",`Successfully updated ${r.updatedCount} nominations to "${r.newStatus}".`),this.clearSelection(),this.refresh()):r.error&&this.toastService.showDanger("Error",r.error)}catch{console.log("Modal dismissed")}})}filterBySearchParam(){if(this.searchBox){let e=this.searchBox;this.clearSelection(),this.currentPage=1,this.filterSource.filter=e.trim().toLowerCase(),this.setUrlParams(e)}}setUrlParams(e){let i={search:e};this.router.navigate([],{queryParams:i,replaceUrl:!0})}setQueryParams(e){let i={};e.value.forEach(t=>{let o=this.filterableColumns.find(r=>r.key===t.name);i[o.name]=t.value}),this.router.navigate([],{queryParams:i,replaceUrl:!0})}generateRegistrationLink(){return v(this,null,function*(){let e=yield this.domainService.loadData(this.eventService.data.PK);if(e?.activated===!0&&e?.domainName)this.domainURL=`https://${e.domainName}`;else{let t=Fe.stage==="prod"?"app":`app-${Fe.stage}`;this.domainURL=`https://${t}.canapii.com`}let i=this.eventService.data.url;this.registrationLink=`${this.domainURL}/register-welcome?e=${i}`})}getNominationSettings(){return v(this,null,function*(){let e=yield this.nominationService.getNominationSettings();if(e?.data?.tableOptions?.length){let i=e.data.tableOptions.filter(t=>t.enabled);this.tableOptions=i,this.columnsToDisplay=["checked",...i.map(t=>t.attributeId)],this.tableOptions.push({attributeId:"dateCreated",name:"Created",enabled:!0}),this.columnsToDisplay.push("dateCreated")}else this.columnsToDisplay=["checked","email","name","status","dateCreated"];this.columnsToDisplay=[...new Set(this.columnsToDisplay)],this.buildColumns()})}buildColumns(){let e={email:"Email",name:"Name",type:"Type",title:"Job title",company:"Company",status:"Status",dinner:"Dinner",golf:"Golf",dateCreated:"Created"},i=this.columnsToDisplay.filter(t=>t!=="checked");this.columns=i.map(t=>{let o=this.tableOptions.find(w=>w.attributeId===t),r=this.nominationFieldsToShow.find(w=>w.name===t),l=o?.name??e[t]??r?.name??t;return U({key:t,header:o?this.ellipsis(l,20):l,sortable:!0},o?{truncate:!0,width:"180px"}:{})})}ellipsis(e,i){return e&&e.length>i?e.substring(0,i)+"...":e}get countLabel(){let e=this.filteredCount;return`${e} ${e===1?"nomination":"nominations"}`}get emptyMessage(){return this.isFiltered?"No nominations match your filters.":"No nominations yet."}get emptyIcon(){return this.isFiltered?"no-results":"inbox"}
2get isFiltered(){return!!this.filterSource.filter||!!this.activeFilterLength}statusTone(e){return e==="registered"?"success":e==="send invite"?"info":"danger"}statusLabel(e){return this.isHpReinvent&&!this.tableOptions.length&&e==="send invite"?"Invited":this.toSentenceCase(e)}toSentenceCase(e){return!e||typeof e!="string"?e:e.toLowerCase()==="(not set)"?"(Not set)":e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}static{this.EXPORT_ALL="export:all"}static{this.EXPORT_TYPE_PREFIX="type:"}buildHpExportItems(){this.hpExportItems=[{id:n.EXPORT_ALL,label:"Export all"},...this.nominationTypes.map(e=>({id:`${n.EXPORT_TYPE_PREFIX}${e}`,label:e}))]}onExportSelect(e){this.downloadCSV("",e==="attendee")}onHpExportSelect(e){if(e===n.EXPORT_ALL){this.downloadCSV();return}this.downloadCSV(e.slice(n.EXPORT_TYPE_PREFIX.length))}getNominationLinkedAttributes(e=!1){return v(this,null,function*(){let i=[];try{let t=yield this.nominationService.getLinkedAttributes(e);return t.success&&i.push(...t.data.map(o=>[o.name.replace(/ /g,"_"),o.attribute])),i}catch{return[]}})}sortColumnsByAttributeOrder(e){return v(this,null,function*(){try{let[i,t]=yield Promise.all([this.settingService.get("custom-registration"),this.settingfieldService.load(!0)]),o=i?.data||{},r=t||[],l=new Map,w=new Map;Object.keys(o).forEach(m=>{let h=o[m];h?.sort!==void 0&&(l.set(m,h.sort),h.form&&h.form!==m&&l.set(h.form,h.sort))}),r.forEach(m=>{if(m?.sort!==void 0&&(w.set(m.attribute,m.sort),m.name)){let h=m.name.replace(/ /g,"_");w.set(h,m.sort)}});let j=["email","firstName","lastName","status"],C=[],P=[],I=[],y=[],E=[];return e.forEach(m=>{let h=Array.isArray(m)?m[1]||m[0]:m;if(j.includes(h))C.push(m);else if(this.customNominationFields.some($=>{let oe=$.name.replace(/ /g,"_");return $.attribute===h||oe===h})){let $=this.customNominationFields.find(oe=>{let si=oe.name.replace(/ /g,"_");return oe.attribute===h||si===h});$&&w.has($.attribute)?P.push({column:m,sort:w.get($.attribute)}):E.push(m)}else l.has(h)?I.push({column:m,sort:l.get(h)}):w.has(h)?y.push({column:m,sort:w.get(h)}):E.push(m)}),P.sort((m,h)=>m.sort-h.sort),I.sort((m,h)=>m.sort-h.sort),y.sort((m,h)=>m.sort-h.sort),[...C,...E,...P.map(m=>m.column),...I.map(m=>m.column),...y.map(m=>m.column)]}catch(i){return console.error("Error sorting columns by attribute order:",i),e}})}static{this.\u0275fac=function(i){return new(i||n)(u(le),u(Xe),u(Ge),u(V),u(kt),u(ge),u(fe),u(ce),u(Ke),u(Vt),u(Dt),u(It),u(he),u(zt),u(ct))}}static{this.\u0275cmp=M({type:n,selectors:[["app-nomination"]],decls:33,vars:31,consts:[["filterPanel",""],[1,"container-fluid","py-3","nomination-list"],["heading","Nominations"],["tone","info","heading","Registration link",1,"registration-callout"],["target","_blank","rel","noopener",1,"registration-link",3,"href"],["preset","text","label","Loading registration link",1,"registration-link-loading",3,"rows"],[1,"summary"],["noun","nomination",3,"count"],["padding","none"],["ariaLabel","Nomination list controls",3,"count"],[3,"click"],["variant","secondary",3,"click"],["ariaLabel","Export options","align","end",3,"items","open"],["cnpButton","","variant","secondary",3,"routerLink"],["align","end","density","flush","heading","Filter",3,"openChange","open"],["cnpPopoverTrigger","",1,"filter-trigger"],["variant","secondary","ariaHasPopup","dialog",3,"click","ariaExpanded","ariaControls"],["name","filter"],["label","active filters",3,"value"],[1,"filter-panel"],[3,"filterChange","filterLength","setQueryParams","attributes","dataSource","queryParams"],["label","Search nominations","placeholder","Search",1,"search",3,"valueChange","value"],["ariaLabel","Nominations",3,"selectedChange","sortChange","emptyIcon","emptyMessage","columns","rows","rowKey","loading","selectable","selectionBar","selectLabel","selectionDisabled","selected","sort"],["cnpCell","email"],["cnpCell","status"],["cnpCell","dateCreated"],["noun","nominations",3,"pageChange","pageSizeChange","total","page","pageSize","pageSizeOptions"],[1,"summary-item"],["noun","nomination",3,"clear","count"],["variant","secondary","size","sm",3,"click"],["name","edit"],["variant","secondary","loadingLabel","Loading",3,"disabled","loading"],["ariaLabel","Export options","align","end",3,"openChange","select","items","open"],["name","export"],["variant","secondary"],[3,"routerLink","queryParams"],[3,"tone"]],template:function(i,t){if(i&1){let o=H();a(0,"div",1),N(1,"cnp-page-header",2),a(2,"cnp-callout",3),F(3,Ni,2,2,"a",4)(4,Pi,1,1,"cnp-skeleton",5),s(),F(5,xi,4,3,"div",6),F(6,Ti,4,1,"cnp-bulk-bar",7),a(7,"cnp-card",8)(8,"cnp-toolbar",9)(9,"cnp-button",10),f("click",function(){return S(o),b(t.create())}),p(10,"Create"),s(),a(11,"cnp-button",11),f("click",function(){return S(o),b(t.import())}),p(12,"Import"),s(),F(13,Li,2,1)(14,Oi,3,1)(15,Ai,3,2,"cnp-dropdown",12),a(16,"a",13),p(17,"Settings"),s(),a(18,"cnp-popover",14,0),X("openChange",function(l){return S(o),G(t.filterPanelOpen,l)||(t.filterPanelOpen=l),b(l)}),a(20,"span",15)(21,"cnp-button",16),f("click",function(){return S(o),b(t.filterPanelOpen=!t.filterPanelOpen)}),N(22,"cnp-icon",17),p(23," Filter "),F(24,Di,1,1,"cnp-count-badge",18),s()(),a(25,"div",19)(26,"app-mat-table-search-column",20),f("filterChange",function(){return S(o),b(t.filterChange())})("filterLength",function(l){return S(o),b(t.filterLength(l))}
2)("setQueryParams",function(l){return S(o),b(t.setQueryParams(l))}),s()()(),a(27,"cnp-search-field",21),f("valueChange",function(l){return S(o),b(t.applyFilter(l))}),s()(),a(28,"cnp-table",22),f("selectedChange",function(l){return S(o),b(t.onSelectedChange(l))})("sortChange",function(l){return S(o),b(t.onSortChange(l))}),ae(29,Ri,2,5,"ng-template",23)(30,zi,2,2,"ng-template",24)(31,Vi,2,3,"ng-template",25),s(),a(32,"cnp-paginator",26),f("pageChange",function(l){return S(o),b(t.onPageChange(l))})("pageSizeChange",function(l){return S(o),b(t.onPageSizeChange(l))}),s()()()}if(i&2){let o=ze(19);c(3),k(t.registrationLink?3:4),c(2),k(t.isCCF2022||t.isNominationsEnabled?5:-1),c(),k(t.selectedKeys.size?6:-1),c(2),d("count",t.countLabel),c(5),k(t.isHpReinvent||t.isHpPs?13:t.isHpReinvent2022?14:15),c(3),d("routerLink",Ue(30,bi)),c(2),W("open",t.filterPanelOpen),c(3),d("ariaExpanded",t.filterPanelOpen)("ariaControls",t.filterPanelOpen?o.panelId():""),c(3),k(t.activeFilterLength?24:-1),c(2),d("attributes",t.filterableColumns)("dataSource",t.filterSource)("queryParams",t.queryParams),c(),d("value",t.searchBox||""),c(),d("emptyIcon",t.emptyIcon)("emptyMessage",t.emptyMessage)("columns",t.columns)("rows",t.visibleRows)("rowKey",t.rowKey)("loading",t.isLoading)("selectable",!0)("selectionBar",!1)("selectLabel",t.selectLabel)("selectionDisabled",t.isSelectionDisabled)("selected",t.selectedKeys)("sort",t.sort),c(4),d("total",t.filteredCount)("page",t.currentPage)("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)}},dependencies:[Ye,Lt,vt,D,mt,ue,Ct,de,pt,pe,A,gt,St,ht,ft,ut,Pt,me,Z,_t,qe,ge],styles:[".nomination-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cnp-space-card-gap)}.registration-callout[_ngcontent-%COMP%]{--cnp-callout-measure: none}.registration-link[_ngcontent-%COMP%]{color:var(--cnp-color-link);text-decoration:underline;overflow-wrap:anywhere}.registration-link-loading[_ngcontent-%COMP%]{display:grid;align-content:center;min-height:calc(var(--cnp-font-size-body) * var(--cnp-font-leading-base))}.summary[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:var(--cnp-space-4)}.summary-item[_ngcontent-%COMP%]{color:var(--cnp-color-text-muted)}.summary-item[_ngcontent-%COMP%]:first-letter{text-transform:capitalize}.search[_ngcontent-%COMP%]{--cnp-search-field-width: 220px;min-width:0}.filter-trigger[_ngcontent-%COMP%]{display:inline-flex}.filter-panel[_ngcontent-%COMP%]{padding:var(--cnp-space-4)}"]})}}return n})();var ji=[{path:"",component:Ie},{path:"settings",loadChildren:()=>import("./chunk-JW7SQUTL.js").then(n=>n.SettingsModule)},{path:":id",loadChildren:()=>import("./chunk-JHLNHNA4.js").then(n=>n.ViewModule)}],ai=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=T({type:n})}static{this.\u0275inj=x({imports:[Te.forChild(ji),Te]})}}return n})();var To=(()=>{class n{static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275mod=T({type:n})}static{this.\u0275inj=x({imports:[ri,O,ai,ii,Zt,ni,Tt,Q,Mt,Y,Wt,Ot,ei,Ie]})}}return n})();export{To as NominationModule};
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.