PageSourceSearch

https://my.workdeck.com/3.37e7aad3cf7798ab.js

js workdeck.com collected 2026-10-04 08:50:44 UTC 105,359 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksapenta=self.webpackChunksapenta||[]).push([[3],{48003:(dn,ne,c)=>{c.r(ne),c.d(ne,{ReportsModule:()=>L});var f=c(69808),M=c(93075),Ce=c(46209),Q=c(40520),T=c(65477),re=c(94327),ie=c(15439),y=c(591),B=c(8929),be=c(61737),ye=c(27221),x=c(92340),F=c(4077),R=c(94483);const m={NONE:0,"CONSUMED-TIME":1,"PLANNED-TIME":2,LEAVE:3,EXPENDITURE:4,"CONSUMED-PERSONAL-COSTS":5,"PLANNED-PERSONAL-COSTS":6,"USER-TASKS":7,ACTIVITY:8},v=new T.JY(n=>n.value.toString());v.push(new R.VJ({value:m.NONE,name:"NONE",translationTag:"reportType"})),v.push(new R.VJ({value:m.EXPENDITURE,name:"EXPENDITURE",translationTag:"reportType"})),v.push(new R.VJ({value:m.LEAVE,name:"LEAVE",translationTag:"reportType"})),v.push(new R.VJ({value:m["CONSUMED-TIME"],name:"CONSUMED-TIME",translationTag:"reportType"})),v.push(new R.VJ({value:m["PLANNED-TIME"],name:"PLANNED-TIME",translationTag:"reportType"})),v.push(new R.VJ({value:m["CONSUMED-PERSONAL-COSTS"],name:"CONSUMED-PERSONAL-COSTS",translationTag:"reportType"})),v.push(new R.VJ({value:m["PLANNED-PERSONAL-COSTS"],name:"PLANNED-PERSONAL-COSTS",translationTag:"reportType"})),v.push(new R.VJ({value:m["USER-TASKS"],name:"USER-TASKS",translationTag:"reportType"})),v.push(new R.VJ({value:m.ACTIVITY,name:"ACTIVITY",translationTag:"reportType"}));class _{static get options(){return v}static get NONE(){return m.NONE}
1static get EXPENDITURE(){return m.EXPENDITURE}static get CONSUMED_TIME(){return m["CONSUMED-TIME"]}static get PLANNED_TIME(){return m["PLANNED-TIME"]}static get OUT_OF_OFFICE(){return m.LEAVE}static get PLANNED_PERSONAL_COSTS(){return m["PLANNED-PERSONAL-COSTS"]}static get CONSUMED_PERSONAL_COSTS(){return m["CONSUMED-PERSONAL-COSTS"]}static get USER_TASKS(){return m["USER-TASKS"]}static get ACTIVITY(){return m.ACTIVITY}}var X=c(8648),V=c(90161),ve=c(8855),se=c(88513),Se=c(21126),w=c(22134),e=c(5e3),ae=function(n,o,t,r){return new(t||(t=Promise))(function(s,a){function l(p){try{d(r.next(p))}catch(h){a(h)}}function u(p){try{d(r.throw(p))}catch(h){a(h)}}function d(p){p.done?s(p.value):function i(s){return s instanceof t?s:new t(function(a){a(s)})}(p.value).then(l,u)}d((r=r.apply(n,o||[])).next())})};class b{constructor(o,t,r,i,s){this.ela=o,this.authGuard=t,this.api=r,this.http=i,this.envService=s,this._selectedReportTypeSource=new y.X(void 0),this._selectedTemplateSource=new y.X(void 0),this._resetFilterSource=new B.xQ,this._changeGroupFilter=new y.X(void 0),this.selectedReportType$=this._selectedReportTypeSource.asObservable(),this.selectedTemplate$=this._selectedTemplateSource.asObservable(),this.resetFilter$=this._resetFilterSource.asObservable(),this.changeGroupFilter$=this._changeGroupFilter.asObservable(),this._currentConsumedPersonalCost=[],this._reportExported=new B.xQ,this.reportExported$=this._reportExported.asObservable(),this._exportReport=new B.xQ,this.exportReport$=this._exportReport.asObservable(),this.downloadMode="xlsx",this.isXeroAuthenticated=!1,this.excelScriptLoaded=!1,this.pdfScriptLoaded=!1,this.eventReportAp=this.ela.adapter(F.hq),this.reportFilterAp=this.ela.adapter(F.pG),this.reportTemplateAp=this.ela.adapter(F.qw),this._eventReportAdapter=this.ela.adapters(F.hq),this._reportFilterAdapter=this.ela.adapters(F.pG),this._reportTemplateAdapter=this.ela.adapters(F.qw)}get filteredReportTypes(){return this._filteredReportTypes}init(){sessionStorage.getItem("xeroAccessToken")&&"undefined"!==sessionStorage.getItem("xeroAccessToken")&&(this.isXeroAuthenticated=!0),this.initVars(),this._eventReportSelectData={body:void 0,filter:{type:void 0,filter:void 0}},this._selectEventReportChannel=this.eventReportAp.insert(this._eventReportSelectData),this._reportFilterData={body:void 0,filter:{type:void 0}},this._selectReportFilterChannel=this.reportFilterAp.insert(this._reportFilterData),this._selectReportTemplatesData={reportType:void 0},this._selectReportTemplatesChannel=this.reportTemplateAp.select(this._selectReportTemplatesData),this._selectReportTemplateFiltersData={reportTemplate:void 0},this._selectReportTemplateFiltersChannel=this.reportTemplateAp.select(this._selectReportTemplateFiltersData),this._insertReportTemplateData={body:void 0},this._insertReportTemplateChannel=this.reportTemplateAp.insert(this._insertReportTemplateData),this._deleteReportTemplateData={filter:{reportTemplate:void 0}},this._deleteReportTemplateChannel=this.reportTemplateAp.delete(this._deleteReportTemplateData),this.channelSubscriptions=[this._selectEventReportChannel,this._selectReportFilterChannel,this._selectReportTemplatesChannel,this._selectReportTemplateFiltersChannel,this._insertReportTemplateChannel,this._deleteReportTemplateChannel,this._selectReportFilterChannel.successChannel().subscribe(o=>this.onGetFiltersSuccess(o)),this._selectReportTemplateFiltersChannel.successFirstChannel().subscribe(o=>{for(const t of o.template.filters){const r=this._currFilters.filters.find(i=>i.name===t.name);if(r.disabled=t.disabled,r.activated=t.activated,t.activated){const i=!t.items.toArray().some(s=>!s.checked);r.activated=!0,r.isCollapsed=t.isCollapsed,i?r.items.forEach(s=>s.checked=!0):r.feed(t)}}this._currFilters.feed(this._currFilters),this.requestSelectedTemplateSource(o)}),this._selectEventReportChannel.successChannel().subscribe(()=>{this._previousFilters!==this._currFilters&&(this._previousFilters=this._currFilters)})]}destroy(){this.initVars(),this.ela.unsubscribe(this.channelSubscriptions)}initVars(){this._currFilters=void 0,this._previousFilters=void 0}get selectEventReportChannel(){return this._selectEventReportChannel}get selectReportFilterChannel(){return this._selectReportFilterChannel}get selectReportTemplatesChannel(){return this._selectReportTemplatesChannel}get selectReportTemplateFiltersChannel(){return this._selectReportTemplateFiltersChannel}get insertReportTemplateChannel(){return this._insertReportTemplateChannel}get deleteReportTemplateChannel(){return this._deleteReportTemplateChannel}get eventReportAdapter(){return this._eventReportAdapter}get reportFilterAdapter(){return this._reportFilterAdapter}get reportTemplateAdapter(){return this._reportTemplateAdapter}setSelectEventReportFilterData(o,t){const r=this.filteredReportTypes.getValue(o.toString());return this._reportFilterData.filter.type=r.name.toLowerCase(),this._reportFilterData.body=void 0!==t?t.isolate():void 0,this._selectReportFilterChannel}getEventReportFilter(o,t){return this.setSelectEventReportFilterData(o,t).consume()}getXeroRefreshToken(){const o=x.N.production?window.__env.apiUrl.includes("test-api")?"494273B034E14747BBB00D8F535DE0BA":"DEC5E0D1BE9442F68056C4660022950F":"5C353AD384754358B4989944F4111965",t=x.N.production?window.__env.apiUrl.includes("test-api")?"truIp2ZwafzRTYpqZPUSLy5uabHEsEaAqLVhPRr_x3qtE39v":"TGugs5vmP3ulZ9Qg8DqXTP-X-6i1n6XUcB64CXmV0Gf_C0Jm":"Je90r__Q8wNDH6-Z0KzdNaGPNMuE7PVwGCW0CLRYrTyadDxV",r=new Q.WM({Authorization:"Basic "+btoa(o+":"+t)}),i={grant_type:"refresh_token",refresh_token:sessionStorage.getItem("xeroRefreshToken")};return this.http.post(this.envService.apiUrl+"/"+x.N.api.endpoints.xero.proxy,i,{headers:r}).pipe((0,ye.K)(s=>(0,be._)(s)))}setCurrentConsumedPersonalCost(o){this._currentConsumedPersonalCost=[...o]}getCurrentConsumedPersonalCost(){return this._currentConsumedPersonalCost}setSelectEventReportData(o,t,r,i){return this._eventReportSelectData.filter.filter=o,this._eventReportSelectData.filter.type=t,this._eventReportSelectData.filter.from=r,this._eventReportSelectData.filter.to=i,this._selectEventReportChannel}setSelectTemplatesReportData(o){return this._selectReportTemplatesData.reportType=o,this._selectReportTemplatesChannel}setSelectTemplateFiltersReportData(o){return this._selectReportTemplateFiltersData.reportTemplate=o,this._selectReportTemplateFiltersChannel}setInsertTemplateReportData(o){return this._insertReportTemplateData.body=o,this._insertReportTemplateChannel}setDeleteTemplateReportData(o){return this._deleteReportTemplateData.filter.reportTemplate=o.id,this._deleteReportTemplateData.body=o,this._deleteReportTemplateChannel}getEventReport(o,t,r,i){this.setSelectEventReportData(o,t,r,i).consume()}get currFilters(){return this._currFilters}set currFilters(o){this._currFilters=o}requestSelectedReportTypeSource(o){this._selectedReportTypeSource.value!==o&&(this.currFilters=void 0,this._selectedReportTypeSource.next(o))}requestSelectedTemplateSource(o){this._selectedTemplateSource.next(o)}requestResetFilters(){this._resetFilterSource.next(),this._selectedTemplateSource.next(void 0)}requestExport(o="xslx"){this.downloadMode=o,this._exportReport.next()}reportExported(){this._reportExported.next()}loadXLSXScript(){return new Promise(o=>{if(this.excelScriptLoaded)return void o("already loaded");const t=document.createElement("script");t.type="text/javascript",t.src="https://unpkg.com/[email protected]/dist/xlsx.min.js",t.onload=()=>{this.excelScriptLoaded=!0,o("loaded")},t.onerror=r=>o("failed to load xslx script"),document.getElementsByTagName("head")[0].appendChild(t)})}loadPDFScript(){return new Promise(o=>{if(this.pdfScriptLoaded)return void o("already loaded");const t=document.createElement("script");t.type="text/javascript",t.src="https://unpkg.com/[email protected]/build/pdfmake.min.js",t.onload=()=>{this.pdfMake=window.pdfMake,this.pdfMake.fonts={workdeck:{normal:"https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/fonts/roboto/Roboto-Regular.ttf",bold:"https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.1/fonts/roboto/Roboto-Bold.ttf"}},this.pdfScriptLoaded=!0,o("loaded")},t.onerror=r=>o("failed to load pdf script"),document.getElementsByTagName("head")[0].appendChild(t)})}exportReport(o,t){return ae(this,void 0,void 0,function*(){switch(this.downloadMode){case"csv":this.exportAsCSV(o.body,t);break;case"xlsx":try{yield this.loadXLSXScript(),this.exportAsExcelFile(o.body,t)}catch(r){console.error("error loading xlsx script")}break;case"pdf":try{yield this.loadPDFScript(),yield this.exportAsPDFFile(o.headers,o.body,o.footer,t)}catch(r){console.error("error loading pdf script")}break;default:try{yield this.loadXLSXScript(),this.exportAsExcelFile(o.body,t)}catch(r){console.error("error loading xlsx script")}}this.reportExported()})}exportAsPDFFile(o,t,r,i){return ae(this,void 0,void 0,function*(){const s=yield this.api.get(x.N.api.endpoints.storage.companyLogo).toPromise(),a=i.replace("-"," ").toUpperCase()+" REPORT",l=[],u=o.length>2?"landscape":"portrait",d=o.length<3?12:o.length<5?11:o.length<7?9:o.length<10?8:7,p=[];for(let A=0;A<o.length;++A)p.push("auto");l.push(Object.keys(t[0]).map(A=>({text:A,style:"tableHeader"})));for(const A of t)l.push(Object.entries(A).map(([un,G])=>{"Hours"===un&&(G=(new ve.Q).transform(+G));const Te=this.findLinks(G.toString());let xe=G.toString(),H=[];if(Te){let Z=[];for(const oe of Te)Z=xe.split(oe),Z[1]=Z[1]?Z[1]:"",H.push({text:this.limitWordLength(Z[0]),fontSize:d}),H.push({text:this.limitWordLength(oe,70),fontSize:d,link:oe,style:"link"}),xe=Z[1];return H.push({text:this.limitWordLength(Z[1]),fontSize:d}),{text:H}}return{text:this.limitWordLength(G.toString()),fontSize:d}}));const h={pageOrientation:u,content:[{layout:"noBorders",table:{widths:["*","auto"],body:[[{text:a,fontSize:18,bold:!0},{image:"logo",fit:[100,50]}]]}},{style:"tableExample",table:{dontBreakRows:!0,keepWithHeaderRows:1,widths:p,headerRows:1,body:l},layout:"lightHorizontalLines"},{style:"tableExample",table:{body:r},layout:"lightHorizontalLines"}],defaultStyle:{font:"workdeck"},styles:{tableExample:{margin:[0,5,0,10]},tableHeader:{bold:!0,fontSize:d+2,color:"black"},footer:{bold:!0,fontSize:12,color:"black"},link:{color:"#3366CC"}},images:{logo:s}};yield this.pdfMake.createPdf(h).download(i+".pdf")})}limitWordLength(o,t=18){const r=new RegExp(`(.|[\r\n]){1,${t}}`,"g"),i=o.split(" ");let s="";
1return i.forEach(a=>{a.length>t?s+=`${a.match(r).join("\n")} `:s+=`${a} `}),s}exportAsExcelFile(o,t){const r=XLSX.utils.json_to_sheet(o),i=[];let s,a;for(let h=0;h<Object.keys(o[0]).length;++h)a=r[XLSX.utils.encode_cell({r:0,c:h})],a.s={font:{bold:!0,sz:13},border:{bottom:{style:"medium",color:{rgb:"000000"}}}},s=o.reduce((E,A)=>Math.max(E,Object.values(A)[h].toString().length),0),s<15?s=15:s>100&&(s=100),i.push({wch:s});r["!cols"]=i;const l=Object.keys(o[0]).length-1;for(let h=1;h<=o.length;++h){var u=r[XLSX.utils.encode_cell({r:h,c:l})];u&&(u.z="0.00")}const d={Sheets:{data:r},SheetNames:["data"]},p=XLSX.write(d,{bookType:"xlsx",type:"array"});this.saveAsExcelFile(p,t)}saveAsExcelFile(o,t){const r=new Blob([o],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"});re.saveAs(r,t+"_export_"+ie().format("DD-MM-YYYY")+".xlsx")}exportAsCSV(o,t){const r=new Blob([this.convertToCSV(o)],{type:"text/csv"});re.saveAs(r,t+"_export_"+ie().format("DD-MM-YYYY")+".csv")}convertToCSV(o){let t=o,r="",i="";for(let s in o[0])i+=s+",";i=i.slice(0,-1),r+=i+"\r\n";for(let s=0;s<t.length;s++){let a="";for(const l in t[s])""!=a&&(a+=","),a+=t[s][l];r+=a+"\r\n"}return r}onGetFiltersSuccess(o){const t=o[0].new,r=o[0].old;if(void 0===this._currFilters)this._currFilters=(new X.KW8).fromJson(t),this._previousFilters=(new X.KW8).fromJson(t);else if(this._currFilters.feed(t),void 0!==r)for(let s=0;s<Math.min(this.currFilters.filters.length,r.filters.length);s++)this._currFilters.filters[s].isCollapsed=r.filters[s].isCollapsed;if(t.filters.find(s=>s.mandatory&&!s.items.toArray().find(a=>a.checked)))for(const s of this._currFilters.filters)s.mandatory?s.isCollapsed=!1:s.disabled=!0}isXeroCompany(){return"f3ab8695-634e-4623-a535-359123d6887f"===this.authGuard.authorized().companyId||!x.N.production||window.__env.apiUrl.includes("test-api")}updateReportTypes(){this._filteredReportTypes=new T.JY(s=>s.value.toString());const o=this.authGuard.authorized(),t=o.isProjectManager&&o.financialEnabled;_.options.forEach(s=>{t?this._filteredReportTypes.push(s):s.value===m["CONSUMED-PERSONAL-COSTS"]||s.value===m["PLANNED-PERSONAL-COSTS"]||this._filteredReportTypes.push(s)});const r=this.authGuard.allowComponent("Expenses"),i=this.authGuard.allowComponent("Purchases");r&&this._filteredReportTypes.filter(s=>s.value!==m.EXPENSES),i&&this._filteredReportTypes.filter(s=>s.value!==m.PURCHASES)}findLinks(o){var t=w.S4.LINKS;return o.match(t)}onChangeGroupFilter(o){this._changeGroupFilter.next(o)}getChangeGroupFilter(){return this._changeGroupFilter.value}}b.\u0275fac=function(o){return new(o||b)(e.LFG(T.pM),e.LFG(V.a),e.LFG(Se.S),e.LFG(Q.eN),e.LFG(se.D))},b.\u0275prov=e.Yz7({token:b,factory:b.\u0275fac});var Ae=c(43841),Re=c(50327),we=c(75973),O=c(74202);class k{constructor(o,t,r){this.auth=o,this.reportService=t,this.router=r}canActivate(o){this.reportService.updateReportTypes();const t=o.params["report-path"];return(!this.reportService.filteredReportTypes.toArray().find(s=>s.name.toLocaleLowerCase()===t)||"none"===t)&&this.router.navigate(["/site/reports"]),!0}}k.\u0275fac=function(o){return new(o||k)(e.LFG(we.$),e.LFG(b),e.LFG(O.F0))},k.\u0275prov=e.Yz7({token:k,factory:k.\u0275fac});var q=c(9224),C=c(42466);class N{constructor(){this.emptyImage=x.N.images.gantt.select_gantt}}N.\u0275fac=function(o){return new(o||N)},N.\u0275cmp=e.Xpm({type:N,selectors:[["app-report-empty"]],decls:9,vars:7,consts:[[1,"empty","empty-report"],[3,"src"]],template:function(o,t){1&o&&(e.TgZ(0,"mat-card")(1,"div",0)(2,"div"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"div"),e._uU(6),e.ALo(7,"translate"),e.qZA(),e._UZ(8,"img",1),e.qZA()()),2&o&&(e.xp6(3),e.Oqu(e.lcZ(4,3,"report.selectReport")),e.xp6(3),e.Oqu(e.lcZ(7,5,"report.selectReportFromTheTop")),e.xp6(2),e.Q6J("src",t.emptyImage,e.LSH))},directives:[q.a8],pipes:[C.X$],styles:[".empty-report[_ngcontent-%COMP%]{margin:8rem 0!important}.empty-report[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{font-size:1rem}.empty-report[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]:first-child{font-size:1.125rem;font-weight:700;margin-bottom:1rem}.empty-report[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{max-width:15rem;margin-top:2rem}"]});var le=c(86087),W=c(84847),Oe=c(36787),ke=c(2994),Ze=c(65697),ce=c(20449),Me=c(57451),Fe=c(24850),Pe=c(57202),z=c(85759);class Ie extends ce.o2{constructor(o,t,r){super(),this.ela=o,this.reportService=t,this.translate=r,this.sortKeySource=new y.X(null),this.sortDirectionSource=new y.X(null),this.pageIndexSource=new y.X(null),this.pageSizeSource=new y.X(null),this.eventsSource=new y.X([]),this.loadingSource=new y.X(!1),this.isEmptySource=new y.X(!0),this.columnsToDisplay=[],this.loading$=this.loadingSource.asObservable(),this.isEmpty$=this.isEmptySource.asObservable(),this.data=[],this.totalTime=void 0,this.totalAmount=void 0,this.totalAmounts=new T.JY(i=>i.currency.id),this.init()}connect(){return this.eventsSource.asObservable()}disconnect(){this.eventsSource.complete(),this.loadingSource.complete(),this.isEmptySource.complete(),this.sortKeySource.complete(),this.sortDirectionSource.complete()}adjustPage(o,t,r,i){this.sortKeySource.next(o),this.sortDirectionSource.next(t),this.pageIndexSource.next(r),this.pageSizeSource.next(i)}init(){this._subscriptions=[Me.y.combineLatest(this.reportService.selectEventReportChannel.successChannel
1().pipe((0,Fe.U)(o=>o.filter(t=>void 0!==t).map(t=>t.new))),this.sortKeySource,this.sortDirectionSource,this.pageIndexSource,this.pageSizeSource).debounceTime(200).map(o=>{this.loadingSource.next(!0);let[t,r,i,s,a]=o;return t.length!==this.data.length&&(this.paginator.firstPage(),s=0),this.data=t,this.reportService.setCurrentConsumedPersonalCost(t),this.reportService.selectedReportType$.subscribe(l=>{switch(l.value){case _.CONSUMED_TIME:case _.PLANNED_TIME:this.columnsToDisplay=this.timeReportColumsToDisplay(l.value),this.totalTime=this.data.reduce((u,d)=>u+d.spentSeconds,0),this.reportFooter=[[{text:"Total:"},{text:`${new z.C(this.translate).transform(this.totalTime,"VHM")}`,style:"footer"}]];break;case _.EXPENDITURE:this.columnsToDisplay=this.expenditureReportColumsToDisplay,this.totalAmounts=new T.JY(u=>u.currency.id),this.data.forEach(u=>{const d=this.totalAmounts.getValue(u.currency.id)?this.totalAmounts.getValue(u.currency.id).totalAmount+u.amount:u.amount,p=u.currency;this.totalAmounts.push({currency:p,totalAmount:d})}),this.reportFooter=[[{text:"Total:"},{text:`${(0,f.uf)(this.totalAmounts.toArray()[0].totalAmount,"en-US","1.2-2")} ${this.totalAmounts.toArray()[0].currency.id}`,style:"footer"}]];break;case _.OUT_OF_OFFICE:this.columnsToDisplay=this.outOfOfficeReportColumsToDisplay,this.totalTime=this.data.reduce((u,d)=>u+d.spentSeconds,0),this.reportFooter=[[{text:"Total:"},{text:`${this.totalTime/86400} ${this.translate.instant("report.table.column.days")}`,style:"footer"}]];break;case _.CONSUMED_PERSONAL_COSTS:case _.PLANNED_PERSONAL_COSTS:this.columnsToDisplay=this.financialsReportColumsToDisplay,this.totalAmount=this.data.reduce((u,d)=>u+d.amount,0),this.totalTime=this.data.reduce((u,d)=>u+d.spentSeconds,0),this.reportFooter=[[{text:`${this.translate.instant("header.time.title")}:`},{text:`${new z.C(this.translate).transform(this.totalTime,"VHM")}`,style:"footer"}],[{text:"Total:"},{text:`${(0,f.uf)(this.totalAmount,"en-US","1.2-2")} ${this.data[0].currency.id}`,style:"footer"}]];break;case _.USER_TASKS:this.columnsToDisplay=this.userTasksReportColumsToDisplay,this.reportFooter=[[]];break;case _.ACTIVITY:this.columnsToDisplay=this.activityReportColumsToDisplay,this.totalTime=this.data.reduce((u,d)=>u+d.spentSeconds,0),this.reportFooter=[[{text:"Total:"},{text:`${new z.C(this.translate).transform(this.totalTime,"VHM")}`,style:"footer"}]]}}),this.updatePageEvents(t,r||"project",i||"asc",s||0,a||20)}).subscribe(o=>{this.loadingSource.next(!1),this.eventsSource.next(o),this.isEmptySource.next(0===o.length)}),this.reportService.selectedReportType$.subscribe(()=>{this.resetSources()}),this.reportService.resetFilter$.subscribe(()=>{this.resetSources()}),this.reportService.changeGroupFilter$.subscribe(o=>{this.groupFilters(o)})]}destroy(){this.ela.unsubscribe(this._subscriptions)}resetSources(){this.data=[],this.eventsSource.next(void 0),this.isEmptySource.next(!0),this.totalTime=void 0,this.totalAmounts=void 0}updatePageEvents(o,t,r,i,s){if(!t||""===r)return o;const a=o.sort((l,u)=>{let d="",p="";switch(t){case"hours":[d,p]=[l.spentSeconds,u.spentSeconds];break;case"month":return(w.cQ.monthNameToNumber(l[t])>w.cQ.monthNameToNumber(u[t])?1:-1)*("asc"===r?1:-1);case"project":case"projectType":case"financialType":case"event":case"activity":case"client":case"costType":case"costCenter":case"task":case"department":case"expenditureType":case"leaveType":case"billableType":case"column":[d,p]=[this.sortNormalizeText(l[t]?l[t].name:"",r),this.sortNormalizeText(u[t]?u[t].name:"",r)];break;case"eventDescription":case"taskDescription":[d,p]=[this.sortNormalizeText(l[t]?l[t]:"",r),this.sortNormalizeText(u[t]?u[t]:"",r)];break;case"currency":[d,p]=[this.sortNormalizeText(l[t]?l[t].id:"",r),this.sortNormalizeText(u[t]?u[t].id:"",r)];break;case"employee":[d,p]=[this.sortNormalizeText(l.user?l.user.name:"",r),this.sortNormalizeText(u.user?u.user.name:"",r)];break;default:[d,p]=[l[t],u[t]]}return((isNaN(+d)?d:+d)<(isNaN(+p)?p:+p)?-1:1)*("asc"===r?1:-1)});return w.cQ.paginate(a,s,i)}sortNormalizeText(o,t){return"-"===o?"asc"===t?"1":"-1":"0-"+w.cQ.normalizeText(o)}timeReportColumsToDisplay(o){const t=this.reportService.currFilters?this.reportService.currFilters.filters:[],r=t.find(a=>"task"===a.name),i=t.find(a=>"employee"===a.name),s=["project"];return s.push(...t.filter(a=>!0===a.activated&&"project"!==a.name).map(a=>a.name)),r&&r.activated&&s.push("taskDescription"),o===_.PLANNED_TIME?(s.push("projectAvailableHours"),s.push("hoursPlanned")):s.push("hours"),o===_.PLANNED_TIME&&i&&i.activated&&(s.push("availableHours"),s.push("remainingHours")),s}get expenditureReportColumsToDisplay(){return["expenditureType",...(this.reportService.currFilters?this.reportService.currFilters.filters:[]).filter(t=>!0===t.activated&&"expenditureType"!==t.name).map(t=>t.name),"amount","currency"]}get outOfOfficeReportColumsToDisplay(){return["leaveType",...(this.reportService.currFilters?this.reportService.currFilters.filters:[]).filter(t=>!0===t.activated&&"leaveType"!==t.name).map(t=>t.name),"days-out-of-office"]}get userTasksReportColumsToDisplay(){return["employee","project","activity","task","taskDescription"]}get activityReportColumsToDisplay(){const o=this.reportService.currFilters?this.reportService.currFilters.filters:[],t=["event","eventDescription"];return t.push(...o.filter(r=>!0===r.activated).map(r=>r.name)),t.push("hours"),t}get financialsReportColumsToDisplay(){const o=this.reportService.currFilters?this.reportService.currFilters.filters:[],t=o.find(i=>"task"===i.name),r=["project"];return r.push(...o.filter(i=>!0===i.activated&&"project"!==i.name).map(i=>i.name)),t&&t.activated&&r.push("taskDescription"),r.push("hours","amount","currency"),r}groupFilters(o){o?(this.data=this.data.reduce((t,r)=>{let i;if(i=r.user?t.find(s=>
1s.project.id===r.project.id&&s.user.id===r.user.id):t.find(s=>s.project.id===r.project.id),i)i.spentSeconds+=r.spentSeconds,i.amount+=r.amount;else{const{amount:s,currency:a,project:l,spentSeconds:u,user:d}=r,p=(new Pe.n).fromJson({amount:s,currency:a,project:l,spentSeconds:u,user:d});d&&(p.user=new X.GLX,p.user.id=d.id,p.user.name=d.name),t.push(p)}return t},[]),this.columnsToDisplay=["project"],this.data[0].user&&this.columnsToDisplay.push("employee"),this.columnsToDisplay.push("hours"),this.data[0].amount&&this.columnsToDisplay.push("amount","currency"),this.eventsSource.next(this.data)):this.pageIndexSource.next(0)}}var pe=c(48883),Ue=c(54374),S=c(88279),K=c(87238),g=c(77093),Ye=function(n,o,t,r){return new(t||(t=Promise))(function(s,a){function l(p){try{d(r.next(p))}catch(h){a(h)}}function u(p){try{d(r.throw(p))}catch(h){a(h)}}function d(p){p.done?s(p.value):function i(s){return s instanceof t?s:new t(function(a){a(s)})}(p.value).then(l,u)}d((r=r.apply(n,o||[])).next())})};function je(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.expenditureType")," "))}function Je(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"translate"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",e.lcZ(2,2,"report.table.column.expenditureType-translate."+t.expenditureType.name)),e.xp6(2),e.hij(" ",e.lcZ(4,4,"report.table.column.expenditureType-translate."+t.expenditureType.name)," ")}}function Ge(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.billableType")," "))}function Qe(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"translate"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",e.lcZ(2,2,"report.table.column.billableType-translate."+t.billableType.name.toLowerCase())),e.xp6(2),e.hij(" ",e.lcZ(4,4,"report.table.column.billableType-translate."+t.billableType.name.toLowerCase())," ")}}function Be(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.leaveType")," "))}function qe(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"translate"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null!=t.leaveType&&t.leaveType.translate?e.lcZ(2,2,"report.table.column.leaveType-translate."+t.leaveType.name.toLowerCase()):null==t.leaveType?null:t.leaveType.name),e.xp6(2),e.hij(" ",null!=t.leaveType&&t.leaveType.translate?e.lcZ(4,4,"report.table.column.leaveType-translate."+t.leaveType.name.toLowerCase()):null==t.leaveType?null:t.leaveType.name," ")}}function ze(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.project")," "))}function $e(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.project?null:t.project.name),e.xp6(1),e.hij(" ",null==t.project?null:t.project.name," ")}}function He(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.event")," "))}function Xe(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.event?null:t.event.name),e.xp6(1),e.hij(" ",null==t.event?null:t.event.name," ")}}function Ve(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.eventDescription")," "))}function We(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",t.eventDescription),e.xp6(1),e.hij(" ",t.eventDescription," ")}}function Ke(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.costType")," "))}function et(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"translate"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null!=t.costType&&t.costType.translate?e.lcZ(2,2,"report.table.column.costType-translate."+t.costType.name.toLowerCase()):null==t.costType?null:t.costType.name),e.xp6(2),e.hij(" ",null!=t.costType&&t.costType.translate?e.lcZ(4,4,"report.table.column.costType-translate."+t.costType.name.toLowerCase()):null==t.costType?null:t.costType.name," ")}}function tt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.projectType")," "))}function ot(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.projectType?null:t.projectType.name),e.xp6(1),e.hij(" ",null==t.projectType?null:t.projectType.name," ")}}function nt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.financialType")," "))}function rt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.financialType?null:t.financialType.name),e.xp6(1),e.hij(" ",null==t.financialType?null:t.financialType.name," ")}}function it(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.costCenter")," "))}function st(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.costCenter?null:t.costCenter.name),e.xp6(1),e.hij(" ",null==t.costCenter?null:t.costCenter.name," ")}}function at(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.status")," "))}function lt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"translate"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.MGl("matTooltip"," ",e.lcZ(2,2,"report.table.column.status-translate.status"+t.status),""),e.xp6(2),e.hij(" ",e.lcZ(4,4,"report.table.column.status-translate.status"+t.status)," ")}}function ct(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.activity")," "))}function pt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.activity?null:t.activity.name),e.xp6(1),e.hij(" ",null==t.activity?null:t.activity.name," ")}}function ut(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.task")," "))}function dt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.task?null:t.task.name),e.xp6(1),e.hij(" ",null==t.task?null:t.task.name," ")}}function ht(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.taskDescription")," "))}function mt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",t.descriptionParsed),e.xp6(1),e.hij(" ",t.descriptionParsed," ")}}function ft(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.client")," "))}function gt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.client?null:t.client.name),e.xp6(1),e.hij(" ",null==t.client?null:t.client.name," ")}}function _t(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.employee")," "))}function Tt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.user?null:t.user.name),e.xp6(1),e.hij(" ",null==t.user?null:t.user.name," ")}}function xt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.department")," "))}function Ct(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.department?null:t.department.name),e.xp6(1),e.hij(" ",null==t.department?null:t.department.name," ")}}function bt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.year")," "))}function yt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",t.year),e.xp6(1),e.hij(" ",t.year," ")}}function vt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.month")," "))}function St(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"translate"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",e.lcZ(2,2,"report.table.column.month-translate."+t.month.toLowerCase())),e.xp6(2),e.hij(" ",e.lcZ(4,4,"report.table.column.month-translate."+t.month.toLowerCase())," ")}}function At(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.day")," "))}function Rt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",t.day),e.xp6(1),e.hij(" ",t.day," ")}}function wt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.contractedhours")," "))}function Ot(n,o){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.projectAvailableHours,"1.0-2")," h ")}}function kt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.allocatedHours")," "))}function Zt(n,o){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",t.availableHours," h ")}}function Mt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.unscheduledHours")," "))}function Ft(n,o){if(1&n&&(e.TgZ(0,"td",45),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=o.$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.availableHours-t.spentSeconds/3600,"1.0-0")," h ")}}function Pt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.consumedHoursPlanned")," "))}function Lt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"toDDHHMMSS"),e._uU(3),e.ALo(4,"toDDHHMMSS"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",e.xi3(2,2,t.spentSeconds,"VHM")),e.xp6(2),e.hij(" ",e.xi3(4,5,t.spentSeconds,"VHM")," ")}}function Et(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.consumedHours")," "))}function Nt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"toDDHHMMSS"),e._uU(3),e.ALo(4,"toDDHHMMSS"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",e.xi3(2,2,t.spentSeconds,"VHM")),e.xp6(2),e.hij(" ",e.xi3(4,5,t.spentSeconds,"VHM")," ")}}function Dt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.duration")," "))}function It(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.ALo(3,"number"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",t.spentSeconds/86400),e.xp6(1),e.hij(" ",e.xi3(3,2,t.spentSeconds/86400,"1.2-2")," ")}}function Ut(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.days")," "))}function Yt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.ALo(3,"toDDHHMMSS"),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",t.spentSeconds),e.xp6(1),e.hij(" ",e.xi3(3,2,t.spentSeconds,"VDHM")," ")}}function jt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.amount")," "))}function Jt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e.ALo(2,"number"),e.TgZ(3,"span"),e._uU(4),e.ALo(5,"number"),e.qZA()()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",e.xi3(2,2,t.amount,"1.2-2")),e.xp6(3),e.hij("",e.xi3(5,5,t.amount,"1.2-2")," ")}}function Gt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.currency")," "))}function Qt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46)(2,"span"),e._uU(3),e.qZA()()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",t.currency.id),e.xp6(2),e.Oqu(t.currency.id)}}function Bt(n,o){1&n&&(e.TgZ(0,"th",44),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.table.column.column")," "))}function qt(n,o){if(1&n&&(e.TgZ(0,"td",45)(1,"div",46),e._uU(2),e.qZA()()),2&n){const t=o.$implicit;e.xp6(1),e.s9C("matTooltip",null==t.column?null:t.column.name),e.xp6(1),e.hij(" ",null==t.column?null:t.column.name," ")}}function zt(n,o){1&n&&e._UZ(0,"tr",47)}function $t(n,o){1&n&&e._UZ(0,"tr",48)}function Ht(n,o){if(1&n&&(e.TgZ(0,"div",49),e._UZ(1,"img",50),e.TgZ(2,"span"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("src",t.imgNoData.empty,e.LSH),e.xp6(2),e.hij(" ",e.lcZ(4,2,"work.projects.table.noRecordsFound"),". ")}}function Xt(n,o){if(1&n&&(e.TgZ(0,"div",57)(1,"span"),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA()()),2&n){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(e.xi3(3,2,t.totalAmount,"1.2-2")),e.xp6(3),e.Oqu(t.currency.id)}}function Vt(n,o){if(1&n&&(e.TgZ(0,"mat-card",54)(1,"div",55),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.YNc(4,Xt,6,5,"div",56),e.qZA()),2&n){const t=o.$implicit;e.xp6(2),e.hij("",e.lcZ(3,2,"report.summary.total"),":"),e.xp6(2),e.Q6J("ngIf",t.totalAmount>0)}}function Wt(n,o){if(1&n&&(e.TgZ(0,"div",52),e.YNc(1,Vt,5,4,"mat-card",53),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.datasource.totalAmounts)}}function Kt(n,o){if(1&n&&(e.ynx(0),e.YNc(1,Wt,2,1,"div",51),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(null==t.datasource.totalAmounts?null:t.datasource.totalAmounts.length)>0)}}function eo(n,o){if(1&n&&(e.TgZ(0,"div",64),e._uU(1),e.ALo(2,"toDDHHMMSS"),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.hij(" ",e.xi3(2,1,t.datasource.totalTime,"VHM")," ")}}function to(n,o){if(1&n&&(e.TgZ(0,"div",57)(1,"span"),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.qZA()()),2&n){const t=e.oxw(3);e.xp6(2),e.Oqu(e.xi3(3,2,t.datasource.totalAmount,"1.2-2")),e.xp6(3),e.Oqu(null==t.mainOfficeCurrency?null:t.mainOfficeCurrency.id)}}function oo(n,o){if(1&n&&(e.TgZ(0,"mat-card",59)(1,"div",60)(2,"div",55),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.YNc(5,eo,3,4,"div",61),e.qZA(),e._UZ(6,"span",62),e.TgZ(7,"div",63),e.YNc(8,to,6,5,"div",56),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(3),e.hij("",e.lcZ(4,3,"report.summary.total"),":"),e.xp6(2),e.Q6J("ngIf",t.datasource.totalTime),e.xp6(3),e.Q6J("ngIf",t.datasource.totalAmount)}}function no(n,o){if(1&n&&(e.ynx(0),e.YNc(1,oo,9,5,"mat-card",58),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.datasource.totalTime&&t.datasource.totalAmount)}}function ro(n,o){if(1&n&&(e.TgZ(0,"mat-card",66)(1,"div",55),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div",64),e._uU(5),e.ALo(6,"toDDHHMMSS"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.hij("",e.lcZ(3,2,"report.summary.total"),":"),e.xp6(3),e.hij(" ",e.xi3(6,4,t.datasource.totalTime,"VHM")," ")}}function io(n,o){if(1&n&&(e.ynx(0),e.YNc(1,ro,7,7,"mat-card",65),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.datasource.totalTime)}}function so(n,o){if(1&n&&(e.TgZ(0,"mat-card",66)(1,"div",55),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div",64),e._uU(5),e.ALo(6,"number"),e.ALo(7,"translate"),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.hij("",e.lcZ(3,3,"report.summary.total"),":"),e.xp6(3),e.AsE(" ",e.xi3(6,5,t.datasource.totalTime/86400,"1.2-2")," ",e.lcZ(7,8,"report.table.column.days")," ")}}function ao(n,o){if(1&n&&(e.ynx(0),e.YNc(1,so,8,10,"mat-card",65),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.datasource.totalTime)}}const lo=function(){return[5,
110,20,50]};class D{constructor(o,t,r,i,s,a){this.ela=o,this.reportService=t,this.currencyService=r,this.activatedRoute=i,this.translateService=s,this.authGuard=a,this.someField=!0,this.imgNoData=x.N.images.dashboard.noticeBoard,this.subscriptions=[],this.datasource=this.reportService.selectedDatasource=new Ie(o,t,s),this.subscriptions=[this.reportService.exportReport$.subscribe(()=>{this.exportDataSource()}),this.reportService.selectedReportType$.subscribe(l=>{this.type=l?l.name.toLocaleLowerCase():void 0,l&&(l.value===_.CONSUMED_PERSONAL_COSTS||l.value===_.PLANNED_PERSONAL_COSTS)&&this.currencyService.getMainOfficeCurrency()}),this.currencyService.mainOfficeCurrency$.subscribe(l=>this.mainOfficeCurrency=l)]}ngOnInit(){this.activatedRoutePath=this.activatedRoute.routeConfig.path}ngOnDestroy(){this.ela.unsubscribe(this.subscriptions)}get columnsToDisplay(){return this.datasource.columnsToDisplay}ngAfterViewInit(){this.sort.sortChange.subscribe(()=>this.paginator.pageIndex=0),this.datasource.paginator=this.paginator,(0,Oe.T)(this.sort.sortChange,this.paginator.page).pipe((0,ke.b)(()=>{this.datasource.adjustPage(this.sort.active,this.sort.direction,this.paginator.pageIndex,this.paginator.pageSize)})).subscribe()}exportDataSource(){return Ye(this,void 0,void 0,function*(){const o=this.prepareObjectToExport(this.datasource.data),t={headers:this.datasource.columnsToDisplay,body:o,footer:this.datasource.reportFooter};yield this.reportService.exportReport(t,this.type)})}prepareObjectToExport(o){return o.map(t=>{const r={};return this.datasource.columnsToDisplay.forEach(i=>{"days-out-of-office"===i&&(i="days");const s=this.translateService.instant("report.table.column."+i);r[s]=this.getString(t,i)}),r})}getString(o,t){switch(t){case"project":case"projectType":case"financialType":case"event":case"activity":case"task":case"client":case"costType":case"costCenter":case"leaveType":case"department":case"column":return o[t]?o[t].name:"";case"expenditureType":case"billableType":return this.translateService.instant(`report.table.column.${t}-translate.${o[t].name.toLowerCase()}`);case"status":return this.translateService.instant(`report.table.column.${t}-translate.${t}${o[t]}`);case"employee":return o.user?o.user.name:"";case"startDate":return o.startDate.format("DD/MM/YYYY");case"endDate":return o.endDate.format("DD/MM/YYYY");case"hours":if("7dd07895-4a6b-43f0-8ad0-80da6298b074"===this.authGuard.authorized().companyId){let r=o.spentSeconds;const i=Math.floor(o.spentSeconds/3600).toString();r%=3600;const s=Math.floor(r/60).toString();return r%=60,`${i.padStart(2,"0")}:${s.padStart(2,"0")}:${r.toString().padStart(2,"0")}`}return+(o.spentSeconds/3600).toFixed(2);case"days":return+(o.spentSeconds/24/3600).toFixed(2);case"amount":return+o[t].toFixed(2);case"currency":return o[t].id;case"day":case"year":return+o[t];case"month":return this.translateService.instant("report.table.column.month-translate."+o[t].toLowerCase());case"taskDescription":return o.descriptionParsed;case"eventDescription":return o[t]}return""}}D.\u0275fac=function(o){return new(o||D)(e.Y36(T.pM),e.Y36(b),e.Y36(Ze.i),e.Y36(O.gz),e.Y36(C.sK),e.Y36(V.a))},D.\u0275cmp=e.Xpm({type:D,selectors:[["app-report-table"]],viewQuery:function(o,t){if(1&o&&(e.Gf(le.NW,5),e.Gf(W.YE,5)),2&o){let r;e.iGM(r=e.CRH())&&(t.paginator=r.first),e.iGM(r=e.CRH())&&(t.sort=r.first)}},hostVars:2,hostBindings:function(o,t){2&o&&e.ekj("sapenta-window",t.someField)},decls:106,vars:17,consts:[["appFullHeight","",1,"container","sapenta-window-content"],[1,"card-container"],[1,"card-content"],[1,"scrollbar-table-container",3,"visibility"],["mat-table","","matSort","","id","user-table","matSortActive","project","matSortDirection","asc","matSortDisableClear","",1,"wd",3,"dataSource"],["matColumnDef","expenditureType"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","billableType"],["matColumnDef","leaveType"],["matColumnDef","project","sticky",""],["matColumnDef","event","sticky",""],["matColumnDef","eventDescription"],["matColumnDef","costType"],["matColumnDef","projectType"],["matColumnDef","financialType"],["matColumnDef","costCenter"],["matColumnDef","status"],["matColumnDef","activity"],["matColumnDef","task"],["matColumnDef","taskDescription"],["matColumnDef","client"],["matColumnDef","employee"],["matColumnDef","department"],["matColumnDef","year"],["matColumnDef","month"],["matColumnDef","day"],["matColumnDef","projectAvailableHours"],["matColumnDef","availableHours"],["matColumnDef","remainingHours"],["matColumnDef","hoursPlanned"],["matColumnDef","hours"],["matColumnDef","days-out-of-office"],["matColumnDef","days"],["matColumnDef","amount"],["matColumnDef","currency"],["matColumnDef","column"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["class","empty",4,"ngIf"],["showFirstLastButtons","",3,"length","pageSize","pageSizeOptions"],["fxLayout","row","fxLayoutAlign","end center","fxLayoutGap","1rem",1,"summary-card-container"],[3,"ngSwitch"],[4,"ngSwitchCase"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"dots",3,"matTooltip"],["mat-header-row",""],["mat-row",""],[1,"empty"],[3,"src"],["fxLayout","row","fxLayoutGap","1rem",4,"ngIf"],["fxLayout","row","fxLayoutGap","1rem"],["fxLayout","row","fxLayoutGap","0.5rem","fxLayoutAlign","end center",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutGap","0.5rem","fxLayoutAlign","end center"],["fxFlex","",1,"total","label"],["class","total result","fxLayoutGap","0.25rem",4,"ngIf"],["fxLayoutGap","0.25rem",1,"total","result"],["class","two-card","fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","0.5rem",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxLayoutGap","0.5rem",1,"two-card"],["fxLayoutGap","0.5rem",1,"two-left-card"],["class","total result",4,"ngIf"],[1,"vertical-divider"],["fxLayoutGap","0.5rem",1,"two-right-card"],[1,"total","result"],["fxLayout","row","fxLayoutAlign","end center","fxLayoutGap","0.5rem",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxLayoutGap","0.5rem"]],template:function(o,t){1&o&&(e.TgZ(0,"div",0)(1,"mat-card",1)(2,"mat-card-content",2)(3,"ng-scrollbar",3)(4,"table",4),e.ynx(5,5),e.YNc(6,je,3,3,"th",6),e.YNc(7,Je,5,6,"td",7),e.BQk(),e.ynx(8,8),e.YNc(9,Ge,3,3,"th",6),e.YNc(10,Qe,5,6,"td",7),e.BQk(),e.ynx(11,9),e.YNc(12,Be,3,3,"th",6),e.YNc(13,qe,5,6,"td",7),e.BQk(),e.ynx(14,10),e.YNc(15,ze,3,3,"th",6),e.YNc(16,$e,3,2,"td",7),e.BQk(),e.ynx(17,11),e.YNc(18,He,3,3,"th",6),e.YNc(19,Xe,3,2,"td",7),e.BQk(),e.ynx(20,12),e.YNc(21,Ve,3,3,"th",6),e.YNc(22,We,3,2,"td",7),e.BQk(),e.ynx(23,13),e.YNc(24,Ke,3,3,"th",6),e.YNc(25,et,5,6,"td",7),e.BQk(),e.ynx(26,14),e.YNc(27,tt,3,3,"th",6),e.YNc(28,ot,3,2,"td",7),e.BQk(),e.ynx(29,15),e.YNc(30,nt,3,3,"th",6),e.YNc(31,rt,3,2,"td",7),e.BQk(),e.ynx(32,16),e.YNc(33,it,3,3,"th",6),e.YNc(34,st,3,2,"td",7),e.BQk(),e.ynx(35,17),e.YNc(36,at,3,3,"th",6),e.YNc(37,lt,5,6,"td",7),e.BQk(),e.ynx(38,18),e.YNc(39,ct,3,3,"th",6),e.YNc(40,pt,3,2,"td",7),e.BQk(),e.ynx(41,19),e.YNc(42,ut,3,3,"th",6),e.YNc(43,dt,3,2,"td",7),e.BQk(),e.ynx(44,20),e.YNc(45,ht,3,3,"th",6),e.YNc(46,mt,3,2,"td",7),e.BQk(),e.ynx(47,21),e.YNc(48,ft,3,3,"th",6),e.YNc(49,gt,3,2,"td",7),e.BQk(),e.ynx(50,22),e.YNc(51,_t,3,3,"th",6),e.YNc(52,Tt,3,2,"td",7),e.BQk(),e.ynx(53,23),e.YNc(54,xt,3,3,"th",6),e.YNc(55,Ct,3,2,"td",7),e.BQk(),e.ynx(56,24),e.YNc(57,bt,3,3,"th",6),e.YNc(58,yt,3,2,"td",7),e.BQk(),e.ynx(59,25),e.YNc(60,vt,3,3,"th",6),e.YNc(61,St,5,6,"td",7),e.BQk(),e.ynx(62,26),e.YNc(63,At,3,3,"th",6),e.YNc(64,Rt,3,2,"td",7),e.BQk(),e.ynx(65,27),e.YNc(66,wt,3,3,"th",6),e.YNc(67,Ot,3,4,"td",7),e.BQk(),e.ynx(68,28),e.YNc(69,kt,3,3,"th",6),e.YNc(70,Zt,2,1,"td",7),e.BQk(),e.ynx(71,29),e.YNc(72,Mt,3,3,"th",6),e.YNc(73,Ft,3,4,"td",7),e.BQk(),e.ynx(74,30),e.YNc(75,Pt,3,3,"th",6),e.YNc(76,Lt,5,8,"td",7),e.BQk(),e.ynx(77,31),e.YNc(78,Et,3,3,"th",6),e.YNc(79,Nt,5,8,"td",7),e.BQk(),e.ynx(80,32),e.YNc(81,Dt,3,3,"th",6),e.YNc(82,It,4,5,"td",7),e.BQk(),e.ynx(83,33),e.YNc(84,Ut,3,3,"th",6),e.YNc(85,Yt,4,5,"td",7),e.BQk(),e.ynx(86,34),e.YNc(87,jt,3,3,"th",6),e.YNc(88,Jt,6,8,"td",7),e.BQk(),e.ynx(89,35),e.YNc(90,Gt,3,3,"th",6),e.YNc(91,Qt,4,2,"td",7),e.BQk(),e.ynx(92,36),e.YNc(93,Bt,3,3,"th",6),e.YNc(94,qt,3,2,"td",7),e.BQk(),e.YNc(95,zt,1,0,"tr",37),e.YNc(96,$t,1,0,"tr",38),e.qZA()(),e.YNc(97,Ht,5,4,"div",39),e.ALo(98,"async"),e._UZ(99,"mat-paginator",40),e.qZA()(),e.TgZ(100,"div",41),e.ynx(101,42),e.YNc(102,Kt,2,1,"ng-container",43),e.YNc(103,no,2,1,"ng-container",43),e.YNc(104,io,2,1,"ng-container",43),e.YNc(105,ao,2,1,"ng-container",43),e.BQk(),e.qZA()()),2&o&&(e.xp6(3),e.Q6J("visibility","hover"),e.xp6(1),e.Q6J("dataSource",t.datasource),e.xp6(91),e.Q6J("matHeaderRowDef",t.columnsToDisplay)("matHeaderRowDefSticky",!0),e.xp6(1),e.Q6J("matRowDefColumns",t.columnsToDisplay),e.xp6(1),e.Q6J("ngIf",e.lcZ(98,14,t.datasource.isEmpty$)),e.xp6(2),e.Q6J("length",null==t.datasource.data?null:t.datasource.data.length)("pageSize",20)("pageSizeOptions",e.DdM(16,lo)),e.xp6(2),e.Q6J("ngSwitch",t.type),e.xp6(1),e.Q6J("ngSwitchCase","expenditure"),e.xp6(1),e.Q6J("ngSwitchCase","consumed-personal-costs"===t.type||"planned-personal-costs"===t.type?t.type:""),e.xp6(1),e.Q6J("ngSwitchCase","consumed-time"===t.type||"planned-time"===t.type||"activity"===t.type?t.type:""),e.xp6(1),e.Q6J("ngSwitchCase","leave"===t.type?t.type:""))},directives:[pe.h,q.a8,q.dn,Ue.KC,S.BZ,W.YE,S.w1,S.fO,S.ge,W.nU,S.Dz,S.ev,K.gM,S.as,S.XQ,S.nj,S.Gk,f.O5,le.NW,g.xw,g.Wh,g.SQ,f.RF,f.n9,f.sg,g.yH],pipes:[C.X$,f.JJ,z.C,f.Ov],styles:["@keyframes flex-in{0%{flex:.0001}to{flex:1}}@keyframes flex-out{0%{flex:1}to{flex:.0001}}@keyframes fadeAndScale{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes zoom-in-out-text{0%{font-size:16px}5%{font-size:16.5px}10%{font-size:17px}15%{font-size:17.5px}20%{font-size:18px}25%{font-size:18.5px}30%{font-size:19px}35%{font-size:19.5px}40%{font-size:20px}45%{font-size:20.5px}50%{font-size:20.5px}55%{font-size:20.5px}60%{font-size:20px}65%{font-size:19.5px}70%{font-size:19px}75%{font-size:18.5px}80%{font-size:18px}85%{font-size:17.5px}90%{font-size:17px}95%{font-size:16.5px}to{font-size:16px}}@keyframes fadein{0%{opacity:0}
166%{opacity:0}to{opacity:1}}@keyframes shake{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-4px)}40%,60%{transform:translate(4px)}}@keyframes kf_shake{0%{transform:translate(8px)}20%{transform:translate(-8px)}40%{transform:translate(4px)}60%{transform:translate(-4px)}80%{transform:translate(2px)}to{transform:translate(0)}}@keyframes sk-bounce{0%,to{transform:scale(0)}50%{transform:scale(1)}}@keyframes flicker{0%{background-color:#cdeaff}33%{background-color:#fff}66%{background-color:#cdeaff}to{background-color:#fff}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}[_nghost-%COMP%]   .mat-paginator[_ngcontent-%COMP%]{display:flex;justify-content:left;padding-left:.75rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-project[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-projectType[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-financialType[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-activity[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-event[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-eventDescription[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-task[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-taskDescription[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-client[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-employee[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .mat-table[_ngcontent-%COMP%]   .mat-column-department[_ngcontent-%COMP%]{flex:0 0 7rem;min-width:7rem;max-width:7rem}[_nghost-%COMP%]   .summary-card-container[_ngcontent-%COMP%]{margin:2rem 0}[_nghost-%COMP%]   .summary-card-container[_ngcontent-%COMP%]   .vertical-divider[_ngcontent-%COMP%]{width:.1875rem;background-color:#f8f9fb;height:3.125rem}[_nghost-%COMP%]   .summary-card-container[_ngcontent-%COMP%]   .total[_ngcontent-%COMP%]{font-size:1rem;font-weight:500}[_nghost-%COMP%]   .summary-card-container[_ngcontent-%COMP%]   .total.label[_ngcontent-%COMP%]{color:#9295a9}"]});var co=c(92198),ue=c(28607),de=c(10654),po=c(64733),$=c(23322),he=c(73949),ee=c(92181),uo=c(40630),te=c(47423),ho=c(58520),mo=c(61051);const fo=["toggleBtn"],go=["toggleIcon"],_o=["moreBtn"],To=function(n){return{hovered:n}};function xo(n,o){if(1&n&&(e.TgZ(0,"div",8)(1,"i",9,10),e._uU(3,"more_vert"),e.qZA()()),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,To,t.showMoreHoverButton))}}const Co=[[["",8,"toggle-title"]],[["",8,"toggle-content"]]],bo=function(n){return{"rotate-90":n}},yo=function(n){return{disabled:n}},vo=function(n){return{"margin-left":n}};class I{constructor(){this._isCollapsed=!0,this._moreEnabled=!0,this._showCollapseIndicator=!0,this.timer=0,this.delay=200,this.prevent=!1,this._mouseOver=!1,this.onSelected=new e.vpe,this.onMore=new e.vpe,this.isCollapsedChange=new e.vpe}get showMoreHoverButton(){return this._moreEnabled&&this._mouseOver}get isCollapsed(){return this._isCollapsed}set isCollapsed(o){this._isCollapsed=o,this.isCollapsedChange.emit(this._isCollapsed)}set showCollapseIndicator(o){this._showCollapseIndicator=o}get showCollapseIndicator(){return this._showCollapseIndicator}set moreEnabled(o){this._moreEnabled=o}get moreEnabled(){return this._moreEnabled}get marginLeft(){return 30}onClick(o){this.timer=setTimeout(()=>{this.prevent||this.doClickAction(o),this.prevent=!1},this.delay)}doClickAction(o){this.toggleBtn&&o.target===this.toggleBtn._elementRef.nativeElement||this.toggleIcon&&o.target===this.toggleIcon.nativeElement?this.toggleCollapsed():this.moreBtn&&o.target===this.moreBtn.nativeElement?this.onMore.emit(o):this.onSelected.emit()}onDblClick(o){clearTimeout(this.timer),this.prevent=!0}toggleCollapsed(){this.isCollapsed=!this._isCollapsed}onHoverItem(o){this._mouseOver=!0}onNotHoverItem(o){this._mouseOver=!1}}I.\u0275fac=function(o){return new(o||I)},I.\u0275cmp=e.Xpm({type:I,selectors:[["app-expand-collapse-toggle"]],viewQuery:function(o,t){if(1&o&&(e.Gf(fo,5),e.Gf(go,5),e.Gf(_o,5)),2&o){let r;e.iGM(r=e.CRH())&&(t.toggleBtn=r.first),e.iGM(r=e.CRH())&&(t.toggleIcon=r.first),e.iGM(r=e.CRH())&&(t.moreBtn=r.first)}},inputs:{isCollapsed:"isCollapsed",showCollapseIndicator:"showCollapseIndicator",moreEnabled:"moreEnabled"},outputs:{onSelected:"onSelected",onMore:"onMore",isCollapsedChange:"isCollapsedChange"},ngContentSelectors:[".toggle-title",".toggle-content"],decls:10,vars:12,consts:[["fxLayout","row","fxLayoutAlign","center center",1,"toggle-item","unselectable",3,"click","dblclick","mouseenter","mouseleave"],["mat-button","","type","button","fxLayoutAlign","left center",1,"toggle-btn","icon","icon-center",3,"disabled"],["toggleBtn",""],[1,"icon-wd-arrow-right",3,"ngClass"],["toggleIcon",""],["fxFlex","",1,"toggle-element",3,"ngClass"],["fxFlex","20p
1x","class","more-btn click-pointer","fxLayoutAlign","right center",3,"ngClass",4,"ngIf"],[3,"hidden","ngStyle"],["fxFlex","20px","fxLayoutAlign","right center",1,"more-btn","click-pointer",3,"ngClass"],[1,"material-icons","click-pointer"],["moreBtn",""]],template:function(o,t){1&o&&(e.F$t(Co),e.TgZ(0,"div",0),e.NdJ("click",function(i){return t.onClick(i)})("dblclick",function(i){return t.onDblClick(i)})("mouseenter",function(i){return t.onHoverItem(i)})("mouseleave",function(i){return t.onNotHoverItem(i)}),e.TgZ(1,"button",1,2),e._UZ(3,"span",3,4),e.qZA(),e.TgZ(5,"div",5),e.Hsn(6),e.qZA(),e.YNc(7,xo,4,3,"div",6),e.qZA(),e.TgZ(8,"div",7),e.Hsn(9,1),e.qZA()),2&o&&(e.xp6(1),e.Q6J("disabled",!t.showCollapseIndicator),e.xp6(2),e.Q6J("ngClass",e.VKq(6,bo,!t.isCollapsed)),e.xp6(2),e.Q6J("ngClass",e.VKq(8,yo,!t.showCollapseIndicator)),e.xp6(2),e.Q6J("ngIf",t.moreEnabled),e.xp6(1),e.Q6J("hidden",t.isCollapsed)("ngStyle",e.VKq(10,vo,t.marginLeft+"px")))},directives:[g.xw,g.Wh,te.lW,f.mk,$.oO,g.yH,f.O5,f.PC,$.Zl],styles:["button.toggle-btn[_ngcontent-%COMP%]:disabled   span.icon-wd-arrow-right[_ngcontent-%COMP%]:before{color:#9295a9!important}.toggle-element.disabled[_ngcontent-%COMP%]     .toggle-title{color:#9295a9!important}"]});var Ro=c(32368),wo=c(80013),Oo=c(51218),me=c(71645),ko=c(54607),Zo=c(25245),Mo=c(52533),fe=c(77446),ge=c(4834);function Fo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-checkbox",16),e.NdJ("click",function(i){return i.stopPropagation()})("change",function(i){return e.CHM(t),e.oxw().onToggleFilteredOptions(i)}),e.ALo(1,"translate"),e.qZA()}if(2&n){const t=e.oxw();e.s9C("matTooltip",e.lcZ(1,4,t.selectAllTooltip?t.selectAllTooltip:"dropdown.selectAllResults")),e.Q6J("disabled",t.disabled||0===t.filteredOptions.length)("checked",t.allFilteredChecked)("indeterminate",t.someFilteredChecked)}}function Po(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-checkbox",18),e.NdJ("click",function(i){return i.stopPropagation()})("change",function(){const s=e.CHM(t).$implicit;return e.oxw(2).onToggleOption(s)}),e.TgZ(1,"div",19),e._uU(2),e.qZA()()}if(2&n){const t=o.$implicit,r=e.oxw(2);e.s9C("matTooltip",r.getOptionLabel(t)),e.Q6J("disabled",r.disabled)("checked",r.isOptionChecked(t)),e.xp6(2),e.Oqu(r.getOptionLabel(t))}}function Lo(n,o){if(1&n&&(e.ynx(0),e.YNc(1,Po,3,4,"mat-checkbox",17),e.BQk()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.filteredOptions)}}function Eo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",22),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).select(null)}),e._uU(1),e.ALo(2,"translate"),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.hij(" ",t.blankLabel?t.blankLabel:e.lcZ(2,1,"dropdown.none")," ")}}function No(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",23),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw(2).select(s)}),e._uU(1),e.qZA()}if(2&n){const t=o.$implicit,r=e.oxw(2);e.ekj("selected",r.identifier?r.value&&r.value[r.identifier]===t[r.identifier]:r.value===t),e.xp6(1),e.hij(" ",r.getOptionLabel(t)," ")}}function Do(n,o){if(1&n&&(e.YNc(0,Eo,3,3,"button",20),e.YNc(1,No,2,3,"button",21)),2&n){const t=e.oxw();e.Q6J("ngIf",t.showBlank),e.xp6(1),e.Q6J("ngForOf",t.filteredOptions)}}function Io(n,o){if(1&n&&(e.TgZ(0,"div",24),e._UZ(1,"img",25),e.TgZ(2,"p"),e._uU(3),e.ALo(4,"translate"),e.qZA()()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("src",t.images.empty,e.LSH),e.xp6(2),e.Oqu(e.lcZ(4,2,"noResults"))}}const Uo=function(n){return{"empty-field":n}};class P extends Oo.y{constructor(o){super(),this.translateService=o,this.translate=!1,this.disabled=!1,this.showSelectedValue=!0,this.readonly=!1,this.multiSelect=!1,this.checkedProperty="checked",this.changeOption=new e.vpe,this.toggleOption=new e.vpe,this.toggleFilteredOptions=new e.vpe,this.filteredOptions=[],this.keyEvent=new B.xQ,this.searchTerm="",this.images=x.N.images.dashboard.noticeBoard,this.seq=T._e.sequence++}ngOnInit(){this._subscriptions=[this.keyEvent.pipe((0,wo.b)(100)).subscribe(()=>this.applyFilter())]}ngOnChanges(o){o.options&&this.applyFilter()}ngOnDestroy(){this._subscriptions.forEach(o=>o.unsubscribe())}get allOptions(){return this.options?this.options instanceof T.JY?this.options.toArray():this.options:[]}get allFilteredChecked(){return this.filteredOptions.length>0&&this.checkedFilteredCount===this.filteredOptions.length}get someFilteredChecked(){const o=this.checkedFilteredCount;return o>0&&o<this.filteredOptions.length}get checkedFilteredCount(){return this.filteredOptions.filter(o=>this.isOptionChecked(o)).length}setData(o){this.filteredOptions=o instanceof T.JY?o.toArray():o||[]}isOptionChecked(o){return!(!o||!o[this.checkedProperty])}getOptionLabel(o){if(null==o)return"";const t=this.label&&o[this.label]?o[this.label]:o;if("string"!=typeof t)return`${t}`;if(!this.translate)return t;const r=this.translationPath&&o[this.translationPath]?o[this.translationPath]:t,i=this.translateService.instant(r,o.translationData);return"string"==typeof i?i:t}select(o){this.value=o,this.changeOption.emit(this.value),this.change.emit(this.value),this.dropdown.hide(),this.value=void 0}onToggleOption(o){this.toggleOption.emit(o)}onToggleFilteredOptions(o){!o||this.toggleFilteredOptions.emit({checked:o.checked,options:this.filteredOptions.slice()})}onSearch(o){this.searchTerm=o.target.value,this.keyEvent.next(this.searchTerm)}resetFilter(){this.searchTerm="",this.setData(this.allOptions)}toggleDropdown(o){this.disabled||this.readonly?this.dropdown.hide():this.dropdown.toggle(),this.dropdown.showing&&(this.focusText(),this.resetFilter())}applyFilter(){const o=w.cQ.normalizeText(this.searchTerm,!1);this.setData(o?this.filterOptions(o):this.allOptions)}filterOptions(o){return this.allOptions.filter(t=>w.cQ.normalizeText(this.getOptionLabel(t),!1).includes(o))}focusText(){setTimeout(()=>{const o=document.getElementById(`search-term-${this.seq}`);o&&o.focus()},100)}onChange(o){}}function Yo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"app-report-searchable-dropdown",12),e.NdJ("toggleOption",function(i){return e.CHM(t),e.oxw().onToggleSearchItem(i)})("toggleFilteredOptions",function(i){return e.CHM(t),e.oxw().onToggleSearchResults(i)}),e.ALo(2,"translate"),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.s9C("placeholder",e.lcZ(2,5,"work.projects.search")),e.Q6J("options",t.reportSearchList)("translate",!0)("multiSelect",!0)("disabled",t.disabled)}}function jo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-checkbox",13),e.NdJ("change",function(i){return e.CHM(t),e.oxw().onChangeMaster(i)}),e.TgZ(1,"div",14),e._uU(2),e.ALo(3,"translate"),e.qZA()()}if(2&n){const t=e.oxw();e.Q6J("disabled",t.disabled||t.group.items.length<=1)("checked",t.selection.hasValue()&&t.isAllSelected())("indeterminate",t.selection.hasValue()&&!t.isAllSelected()),e.xp6(2),e.hij(" ",e.lcZ(3,4,t.allTranslationTag)," ")}}function Jo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-checkbox",15),e.NdJ("change",function(i){const a=e.CHM(t).$implicit;return e.oxw().onChangeSlave(i,a.id)}),e.TgZ(1,"div",16),e._uU(2),e.qZA()()}if(2&n){const t=o.$implicit,r=e.oxw();e.Q6J("disabled",r.disabled)("checked",t.checked&&r.isAllSlaveSelected(t.id))("indeterminate",t.checked&&!r.isAllSlaveSelected(t.id)),e.xp6(2),e.hij(" ",t.translate||r.group.translate?t.translatedName:t.name," ")}}function Go(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-checkbox",18),e.NdJ("ngModelChange",function(i){return e.CHM(t).$implicit.checked=i})("click",function(i){return i.stopPropagation()})("change",function(){const s=e.CHM(t).$implicit;return e.oxw(2).onChangeItemReportStateToggle(s)}),e.TgZ(1,"div",16),e._uU(2),e.qZA()()}if(2&n){const t=o.$implicit,r=e.oxw(2);e.s9C("matTooltip",t.translate||r.group.translate?t.translatedName:t.name),e.Q6J("disabled",r.disabled)("ngModel",t.checked)("checked",r.selection.isSelected(t)),e.xp6(2),e.hij(" ",t.translate||r.group.translate?t.translatedName:t.name," ")}}function Qo(n,o){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Go,3,5,"mat-checkbox",17),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.reportChecklist)}}function Bo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"mat-checkbox",18),e.NdJ("ngModelChange",function(i){return e.CHM(t).$implicit.checked=i})("click",function(i){return i.stopPropagation()})("change",function(i){const a=e.CHM(t).$implicit;return e.oxw(2).onChangeItemState(i,a)}),e.TgZ(1,"div",16),e._uU(2),e.qZA()()}if(2&n){const t=o.$implicit,r=e.oxw(2);e.s9C("matTooltip",t.translate||r.group.translate?t.translatedName:t.name),e.Q6J("disabled",r.disabled)("ngModel",t.checked)("checked",r.selection.isSelected(t)),e.xp6(2),e.hij(" ",t.translate||r.group.translate?t.translatedName:t.name," ")}}function qo(n,o){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,Bo,3,5,"mat-checkbox",17),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.reportItemList)}}function zo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",19)(1,"mat-checkbox",20),e.NdJ("change",function(i){return e.CHM(t),e.oxw().onChangeGroupFil(i)}),e.TgZ(2,"div",21),e._uU(3),e.ALo(4,"translate"),e.qZA()()()}2&n&&(e.xp6(3),e.hij(" ",e.lcZ(4,1,"report.filters.group")," "))}P.\u0275fac=function(o){return new(o||P)(e.Y36(C.sK))},P.\u0275cmp=e.Xpm({type:P,selectors:[["app-report-searchable-dropdown"]],viewQuery:function(o,t){if(1&o&&e.Gf(me.b,7),2&o){let r;e.iGM(r=e.CRH())&&(t.dropdown=r.first)}},inputs:{options:"options",identifier:"identifier",label:"label",translationPath:"translationPath",translate:"translate",placeholder:"placeholder",searchPlaceholder:"searchPlaceholder",expandableWidth:"expandableWidth",disabled:"disabled",showSelectedValue:"showSelectedValue",readonly:"readonly",showBlank:"showBlank",blankLabel:"blankLabel",multiSelect:"multiSelect",checkedProperty:"checkedProperty",selectAllTooltip:"selectAllTooltip"},outputs:{changeOption:"changeOption",toggleOption:"toggleOption",toggleFilteredOptions:"toggleFilteredOptions"},features:[e._Bn([{provide:M.JU,useExisting:(0,e.Gpc)(()=>P),multi:!0}]),e.qOj,e.TTD],decls:23,vars:24,consts:[["appProvideParentForm","",1,"searchable-dropdown"],["mat-button","","type","button",1,"toggle",3,"disabled","ngClass","click"],[1,"dropdown-container"],["dropreference",""],["autoScrollSelector",".selected",3,"reference","height","expandableWidth"],["dropdownComp",""],["headerContainer",""],["fxLayout","row","fxLayoutAlign","start center",1,"search-options-container"],["fxFlex","","type","text","autocomplete","off",3,"appAutofocus","id","name","value","placeholder","click","input"],["class","select-all-results","color","primary",3,"disabled","checked","indeterminate","matTooltip","click","change",4,"ngIf"],["fxLayoutAlign","start center",1,"search-icon"],[1,"icon-wd-search"],["fxLayout","column",1,"floating-dropdown-options-container"],[4,"ngIf","ngIfElse"],["singleSelectOptions",""],["class","empty-results",4,"ngIf"],["color","primary",1,"select-all-results",3,"disabled","checked","indeterminate","matTooltip","click","change"],["class","option-checkbox","color","primary","fxLayout","row",3,"disabled","checked","matTooltip","click","change",4,"ngFor","ngForOf"],["color","primary","fxLayout","row",1,"option-checkbox",3,"disabled","checked","matTooltip","click","change"],[1,"option-name","dots"],["mat-button","","class","blank","type","button",3,"click",4,"ngIf"],["mat-button","","type","button",3,"selected","click",4,"ngFor","ngForOf"],["mat-button","","type","button",1,"blank",3,"click"],["mat-button","","type","button",3,"click"],[1,"empty-results"],[3,"src"]],template:function(o,t){if(1&o&&(e.TgZ(0,"div",0)(1,"button",1),e.NdJ("click",function(i){return t.toggleDropdown(i)}),e._uU(2),e.ALo(3,"translate"),e.TgZ(4,"mat-icon"),e._uU(5,"keyboard_arrow_down"),e.qZA()(),e.TgZ(6,"div",2,3)(8,"app-floating-dropdown-box",4,5),e.ynx(10,6),e.TgZ(11,"div",7)(12,"input",8),e.NdJ("click",function(i){return i.stopPropagation()})("input",function(i){return t.onSearch(i)}),e.ALo(13,"translate"),e.qZA(),e.YNc(14,Fo,2,6,"mat-checkbox",9),e.TgZ(15,"div",10),e._UZ(16,"span",11),e.qZA()(),e._UZ(17,"mat-divider"),e.BQk(),e.TgZ(18,"div",12),e.YNc(19,Lo,2,1,"ng-container",13),e.YNc(20,Do,2,2,"ng-template",null,14,e.W1O),e.qZA(),e.YNc(22,Io,5,4,"div",15),e.qZA()()()),2&o){const r=e.MAs(7),i=e.MAs(21);e.xp6(1),e.ekj("readonly",t.readonly),e.Q6J("disabled",t.disabled)("ngClass",e.VKq(22,Uo,!t.value)),e.xp6(1),e.hij(" ",t.showSelectedValue&&t.value?t.value[t.label]?t.translate?e.xi3(3,17,t.value[t.label],t.value.translationData):t.value[t.label]:t.value:t.placeholder," "),e.xp6(6),e.Q6J("reference",r)("height",12.5)("expandableWidth",t.expandableWidth),e.xp6(4),e.MGl("id","search-term-",t.seq,"")("name","search-term-",t.seq,""),e.s9C("placeholder",t.searchPlaceholder?t.searchPlaceholder:e.l
1cZ(13,20,t.placeholder)),e.Q6J("appAutofocus",null==t.dropdown?null:t.dropdown.showing)("value",t.searchTerm),e.xp6(2),e.Q6J("ngIf",t.multiSelect),e.xp6(5),e.Q6J("ngIf",t.multiSelect)("ngIfElse",i),e.xp6(3),e.Q6J("ngIf",!t.filteredOptions||0===t.filteredOptions.length)}},directives:[ko.h,te.lW,f.mk,$.oO,Zo.Hw,me.b,g.xw,g.Wh,g.yH,Mo.U,f.O5,fe.oG,K.gM,ge.d,f.sg],pipes:[C.X$],styles:["[_nghost-%COMP%]{z-index:11}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]{border:.0625rem solid #dae0e9;border-radius:.375rem;line-height:2rem;width:100%;padding:0 .25rem 0 .75rem;text-overflow:ellipsis;overflow:hidden;position:relative;font-size:.75rem;font-weight:400;background-color:#fff}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]:not(.readonly):focus{border-color:#009aff}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]:not(.readonly):focus     .mat-button-wrapper .mat-icon{color:#009aff}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button.readonly[_ngcontent-%COMP%]{border-color:transparent;background-color:transparent}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button.readonly.mat-button[_ngcontent-%COMP%]:hover     .mat-button-focus-overlay{opacity:0}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button.readonly[_ngcontent-%COMP%]     .mat-button-wrapper .mat-icon{display:none}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]     .mat-button-wrapper{width:calc(100% - 1.5rem);overflow:hidden;display:block;text-overflow:ellipsis;text-align:left}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button[_ngcontent-%COMP%]     .mat-button-wrapper .mat-icon{color:#9295a9;position:absolute;top:0;right:.25rem;display:flex;height:100%;align-items:center}[_nghost-%COMP%]   .searchable-dropdown[_ngcontent-%COMP%] > button.empty-field[_ngcontent-%COMP%]     span:not(.mat-button-focus-overlay):not(.mat-ripple){opacity:.5}"]});const U_PROJECT="project",U_EXPENDITURE_TYPE="expenditureType",U_LEAVE_TYPE="leaveType",U_STATUS="status",_e=[U_STATUS];class Y{constructor(o,t){this.translateService=o,this.reportService=t,this.disabled=!1,this.showAll=!0,this.changeGroupState=new e.vpe,this.changeItemState=new e.vpe,this.changeSystemState=new e.vpe,this.selection=new ce.Ov(!0,[]),this.slaveItems=new T.JY(r=>r.id.toString()),this.allTranslationTag="",this.groupName="",this.groupNameTranslate="",this.reportItemList=[],this.reportChecklist=[],this.reportOptionList=[],this.reportSearchList=[],this.showGroupFilters=!1}ngOnInit(){this.groupName=`report.table.column.${this.group.name}`,this.groupNameTranslate=`${this.groupName}-translate`,this.reportService.selectedReportType$.subscribe(o=>{["CONSUMED-PERSONAL-COSTS","PLANNED-PERSONAL-COSTS","CONSUMED-TIME"].includes(o.name)?this.showGroupFilters=!0:this.showGroupFilters=!1}),this.organizeItems()}ngOnChanges(o){const t=[U_PROJECT,U_EXPENDITURE_TYPE,U_LEAVE_TYPE];o.group&&(this.groupName=`report.table.column.${this.group.name}`,this.groupNameTranslate=`${this.groupName}-translate`,_e.includes(this.group.name)&&(this.group.translate=!0),this.group.disabled&&!this.group.activated&&!t.includes(this.group.name)&&(this.group.isCollapsed=!0),this.group.items.forEach(r=>{r.checked?this.selection.select(r):this.selection.deselect(r);const i=`${this.groupNameTranslate}.${r.name.toLowerCase()}`;(r.translate||this.group.translate)&&!_e.includes(this.group.name)&&(r.translatedName=this.translateService.instant(i),r.translationPath=i)}),this.group.name===U_STATUS&&this.group.items.forEach(r=>{const i=`${this.groupNameTranslate}.${this.group.name}${r.name}`;r.translatedName=this.translateService.instant(i)}),this.allTranslationTag=`report.filters.${this.group.name}.all`)}organizeItems(){this.slaveItems.clean(),this.reportChecklist=[],this.reportOptionList=[],this.reportItemList=[],this.reportSearchList=[],this.group.items.forEach(o=>{const t=`${this.groupNameTranslate}.${o.name.toLowerCase()}`;o.translationPath=o.translate?t:o.name,o.hasChildrenItems?this.slaveItems.push(o):this.group.items.length>10?(this.reportSearchList.push(o),o.checked?this.reportChecklist.push(o):this.reportOptionList.push(o)):this.reportItemList.push(o)})}isItemParentIdOfItem(o,t){return void 0===t&&void 0===o||t&&o.itemParent&&t===o.itemParent.id}isAllSelected(){return this.selection.selected.filter(r=>!1===r.system).length===this.group.items.filter(r=>!1===r.system).length}isAllSlaveSelected(o){return this.selection.selected.filter(i=>!1===i.system&&this.isItemParentIdOfItem(i,o)).length===this.group.items.filter(i=>!1===i.system&&this.isItemParentIdOfItem(i,o)).length}markAllItemsUnchecked(o){this.selection.clear(),this.group.items.forEac
1h(t=>{(void 0===o||this.isItemParentIdOfItem(t,o))&&(t.checked=!1)})}markAllItemsChecked(o){this.group.items.forEach(t=>{t.system||(this.selection.select(t),(void 0===o||this.isItemParentIdOfItem(t,o))&&(t.checked=!0))})}masterToggle(o){void 0===o?this.isAllSelected()?this.markAllItemsUnchecked():this.markAllItemsChecked():o?this.markAllItemsChecked():this.markAllItemsUnchecked(),this.updateGroupState(),this.changeGroupState.emit(!0)}slaveToggle(o,t){void 0===t?this.isAllSlaveSelected(o)?this.markAllItemsUnchecked(o):this.markAllItemsChecked(o):t?this.markAllItemsChecked(o):this.markAllItemsUnchecked(o),this.updateGroupState(),this.changeGroupState.emit(!0)}updateGroupState(){this.group.mandatory||(this.group.activated=this.selection.hasValue()),this.organizeItems()}onChangeItemState(o,t){t.hasChildrenItems&&this.markAllItemsChecked(t.id),o&&(t.system&&o.checked&&this.changeSystemState.emit(!0),this.selection.toggle(t),t.checked=o.checked,this.updateGroupState(),this.changeItemState.emit({item:t,group:this.group.name}))}onChangeItemReportStateToggle(o){o.hasChildrenItems&&this.markAllItemsChecked(o.id),this.selection.toggle(o),this.updateGroupState(),this.changeItemState.emit({item:o,group:this.group.name})}onChangeGroupState(o){this.group.activated=o.checked,this.masterToggle(o.checked)}onChangeMaster(o){o&&this.masterToggle()}onChangeGroupSlaveState(o,t){this.group.activated=o.checked,this.slaveToggle(t,o.checked)}onChangeSlave(o,t){this.slaveItems.getValue(t).checked=o.checked,o&&this.slaveToggle(t)}onToggleSearchItem(o){this.setItemChecked(o,!o.checked),this.updateGroupState(),this.changeItemState.emit({item:o,group:this.group.name})}onToggleSearchResults(o){const t=o.options.filter(r=>r.checked!==o.checked);0!==t.length&&(t.forEach(r=>this.setItemChecked(r,o.checked)),this.updateGroupState(),this.changeGroupState.emit(!0))}setItemChecked(o,t){o.checked=t,t?this.selection.select(o):this.selection.deselect(o)}onChangeGroupFil(o){this.reportService.onChangeGroupFilter(o.checked)}}function $o(n,o){1&n&&e._UZ(0,"app-loading-overlay")}function Ho(n,o){if(1&n){const t=e.EpF();e.ynx(0),e.TgZ(1,"app-filter-group-box",16),e.NdJ("changeGroupState",function(){return e.CHM(t),e.oxw().refreshFilters()})("changeItemState",function(i){return e.CHM(t),e.oxw().refreshFilters(i)})("changeSystemState",function(){return e.CHM(t),e.oxw().cleanSystemFilters()}),e.qZA(),e._UZ(2,"mat-divider",9),e.BQk()}if(2&n){const t=o.$implicit,r=e.oxw();e.xp6(1),e.Q6J("group",t)("disabled",r.loading),e.xp6(1),e.Q6J("inset",!0)}}function Xo(n,o){1&n&&(e.TgZ(0,"div",17),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&n&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"report.filters.actions.showMessage")," "))}function Vo(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"app-button",18),e.NdJ("onClick",function(){return e.CHM(t),e.oxw().onClickDeleteTemplate()}),e.ALo(1,"translate"),e.qZA()}if(2&n){const t=e.oxw();e.s9C("label",e.lcZ(1,3,"report.filters.actions.deleteTemplate")),e.Q6J("disabled",!t.reportTemplate)("isSubmitting",t.isDeleting)}}Y.\u0275fac=function(o){return new(o||Y)(e.Y36(C.sK),e.Y36(b))},Y.\u0275cmp=e.Xpm({type:Y,selectors:[["app-filter-group-box"]],inputs:{group:"group",disabled:"disabled",showAll:"showAll"},outputs:{changeGroupState:"changeGroupState",changeItemState:"changeItemState",changeSystemState:"changeSystemState"},features:[e.TTD],decls:14,vars:14,consts:[[1,"expand-collapse-toggle-container"],[3,"isCollapsed","showCollapseIndicator","moreEnabled","isCollapsedChange"],["fxLayout","row","fxLayoutAlign","start center",1,"toggle-title"],["fxFlex","",1,"dots"],[1,"wd-toggle",3,"disabled","checked","change"],["fxLayout","column",1,"toggle-content"],["class","searchable-report-dropdown",4,"ngIf"],["class","all-options","color","primary","fxLayout","row",3,"disabled","checked","indeterminate","change",4,"ngIf"],["class","slave-options","color","primary","fxLayout","row",3,"disabled","checked","indeterminate","change",4,"ngFor","ngForOf"],[4,"ngIf"],["class","group-filter",4,"ngIf"],[1,"searchable-report-dropdown"],["label","name","translationPath","translationPath",3,"options","translate","multiSelect","disabled","placeholder","toggleOption","toggleFilteredOptions"],["color","primary","fxLayout","row",1,"all-options",3,"disabled","checked","indeterminate","change"],[1,"all-options-name","dots"],["color","primary","fxLayout","row",1,"slave-options",3,"disabled","checked","indeterminate","change"],[1,"item-name","dots"],["color","primary","fxLayout","row",3,"disabled","ngModel","checked","matTooltip","ngModelChange","click","change",4,"ngFor","ngForOf"],["color","primary","fxLayout","row",3,"disabled","ngModel","checked","matTooltip","ngModelChange","click","change"],[1,"group-filter"],["color","primary","fxLayout","row",1,"group-checkbox",3,"change"],[1,"group-filter-name","dots"]],template:function(o,t){1&o&&(e.TgZ(0,"div",0)(1,"app-expand-collapse-toggle",1),e.NdJ("isCollapsedChange",function(i){return t.group.isCollapsed=i}),e.TgZ(2,"div",2)(3,"label",3),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"mat-slide-toggle",4),e.NdJ("change",function(i){return t.onChangeGroupState(i)}),e.qZA()(),e.TgZ(7,"div",5),e.YNc(8,Yo,3,7,"div",6),e.YNc(9,jo,4,6,"mat-checkbox",7),e.YNc(10,Jo,3,4,"mat-checkbox",8),e.YNc(11,Qo,2,1,"div",9),e.YNc(12,qo,2,1,"div",9),e.YNc(13,zo,5,3,"div",10),e.qZA()()()),2&o&&(e.xp6(1),e.Q6J("isCollapsed",t.group.isCollapsed)("showCollapseIndicator",t.group.hasItems&&(!t.group.disabled||t.group.activated))("moreEnabled",!1),e.xp6(3),e.Oqu(e.l
1cZ(5,12,t.groupName)),e.xp6(2),e.Q6J("disabled",t.group.mandatory||t.disabled||!t.group.hasItems||t.group.disabled)("checked",t.group.mandatory||t.group.activated),e.xp6(2),e.Q6J("ngIf",t.group.items.length>10),e.xp6(1),e.Q6J("ngIf",t.showAll),e.xp6(1),e.Q6J("ngForOf",t.slaveItems),e.xp6(1),e.Q6J("ngIf",t.group.items.length>10),e.xp6(1),e.Q6J("ngIf",t.group.items.length<=10),e.xp6(1),e.Q6J("ngIf",t.showGroupFilters&&"month"===t.group.name))},directives:[I,g.xw,g.Wh,g.yH,Ro.Rr,f.O5,P,C.Pi,fe.oG,f.sg,M.JJ,M.On,K.gM],pipes:[C.X$],styles:[".expand-collapse-toggle-container[_ngcontent-%COMP%]   .toggle-title[_ngcontent-%COMP%]{color:#0069df;font-size:.875rem;font-weight:500}.expand-collapse-toggle-container[_ngcontent-%COMP%]   .toggle-content[_ngcontent-%COMP%]{position:relative}.expand-collapse-toggle-container[_ngcontent-%COMP%]   .toggle-content[_ngcontent-%COMP%]   .group-filter[_ngcontent-%COMP%]{position:absolute;right:0;bottom:0}.expand-collapse-toggle-container[_ngcontent-%COMP%]   mat-checkbox[_ngcontent-%COMP%]    {font-size:.75rem;font-weight:400}.expand-collapse-toggle-container[_ngcontent-%COMP%]   mat-checkbox[_ngcontent-%COMP%]     label.mat-checkbox-layout{max-width:100%}.expand-collapse-toggle-container[_ngcontent-%COMP%]   mat-checkbox[_ngcontent-%COMP%]     label.mat-checkbox-layout .mat-checkbox-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.searchable-report-dropdown[_ngcontent-%COMP%]{margin-bottom:.875rem}"]});
1class j{constructor(o,t,r){this.reportService=o,this.ela=t,this.dialogsService=r,this.close=new e.vpe,this.isFiltering=!1,this.isResetting=!1,this.isDeleting=!1,this.loading=!1,this.showFilteringMessage=!1,this.filteringStarted=!1,this.subscriptions=[]}get currFilters(){return this.reportService._currFilters}set currFilters(o){this.reportService._currFilters=o}ngOnInit(){this.subscriptions=[this.reportService.selectedReportType$.debounceTime(20).subscribe(o=>{o&&(void 0===this.currFilters||void 0!==this.reportType&&o!==this.reportType)&&this.getFiltersByReportType(o),this.reportType=o}),this.reportService.selectedTemplate$.debounceTime(20).subscribe(o=>{this.reportTemplate=o}),this.reportService.selectReportFilterChannel.successChannel().subscribe(o=>this.onGetFiltersSuccess(o)),this.reportService.selectReportFilterChannel.exceptionChannel().subscribe(o=>this.onGetFilterException(o)),this.reportService.selectEventReportChannel.exceptionChannel().subscribe(o=>this.onGetReportException(o))]}ngOnDestroy(){this.ela.unsubscribe(this.subscriptions)}getFiltersByReportType(o,t){o.value!==_.NONE&&(this.loading=!0,this.reportTemplate=void 0,this.reportService.getEventReportFilter(o.value,t))}onClickApply(){this.isFiltering=!0,this.showFilteringMessage=!1,this.reportService.setSelectEventReportData(this.currFilters,this.reportType.name.toLowerCase(),this.from,this.to).subscribeFirst(o=>{this.isFiltering=!1,this.reportService._previousFilters=this.currFilters,this.showFilteringMessage=!1},o=>{this.isFiltering=!1,this.filteringCompleted()}),setTimeout(()=>
1{this.isFiltering&&(this.showFilteringMessage=!0)},5e3)}filteringCompleted(){this.isFiltering=!1,this.filteringMessageTimeout&&clearTimeout(this.filteringMessageTimeout),this.showFilteringMessage=!1}onClickReset(){this.isResetting=!0,this.reportService.setSelectEventReportFilterData(this.reportType.value).subscribeFirst(o=>{this.from=void 0,this.to=void 0,this.isResetting=!1,this.reportTemplate=void 0,this.reportService.requestResetFilters()},o=>{this.isResetting=!1})}onGetReportException(o){uo.e[o.type]||this.refreshFilters()}onGetFilterException(o){this.loading=!1,this.resetFilters()}onGetFiltersSuccess(o){this.loading=!1}resetFilters(){this.currFilters=void 0}deleteTemplate(){this.isDeleting=!0,this.reportService.setDeleteTemplateReportData(this.reportTemplate).subscribeFirst(o=>{this.isDeleting=!1,this.onClickReset(),this.reportTemplate=void 0},o=>{this.isDeleting=!1})}onClickDeleteTemplate(){this.dialogsService.openConfirmationDialog(this.deleteConfirmationContent()).afterClosed().filter(o=>o).subscribe(()=>{this.deleteTemplate()})}deleteConfirmationContent(){return{title:{message:"dialogs.reportTemplate.deleteTitle",translate:!0},messages:[{message:"dialogs.reportTemplate.deleteMessage",data:{data:this.reportTemplate.name},translate:!0}],buttons:{accept:{message:"dialogs.buttons.delete",translate:!0},cancel:{message:"dialogs.flagConfirmation.cancel",style:"secondary",translate:!0}}}}refreshFilters(o){this.updateFilters(this.reportType,this.currFilters,o)}updateFilters(o,t,r){let i=!0,s=[];if(o.value===m.ACTIVITY){for(const a of t.filters)if("project"===a.name&&a.items.toArray().some(l=>l.checked))i=!1;else if(["activity","task","projectType","financialType"].includes(a.name)){if(a.disabled=i,i){a.activated=!1;for(const l of a.items)l.checked=!1}}else if("month"===a.name){const l=t.filters.find(u=>"year"===u.name);a.disabled=!l.activated,l.activated||(a.activated=!1)}else if("day"===a.name){const l=t.filters.find(u=>"month"===u.name);a.disabled=!l.activated,l.activated||(a.activated=!1)}}else for(const a of t.filters)if(a.mandatory)s=a.items.filter(l=>l.checked).map(l=>l.id),s.length>0&&(i=!1);else if(["month","day"].includes(a.name))if("month"===a.name){const l=t.filters.find(u=>"year"===u.name);a.disabled=!l.activated,l.activated||(a.activated=!1)}else{const l=t.filters.find(u=>"month"===u.name);a.disabled=!l.activated,l.activated||(a.activated=!1)}else if(a.disabled=i,i){a.activated=!1;for(const l of a.items)l.checked=!1}}cleanSystemFilters(){this.currFilters.filters.filter(o=>"year"===o.name||"month").forEach(o=>o.items.filter(t=>t.system).forEach(t=>t.checked=!1))}}j.\u0275fac=function(o){return new(o||j)(e.Y36(b),e.Y36(T.pM),e.Y36(ue.H))},j.\u0275cmp=e.Xpm({type:j,selectors:[["app-report-filters"]],outputs:{close:"close"},decls:22,vars:17,consts:[["fxLayout","column",1,"report-filters"],["fxLayout","row",1,"report-filters-header"],["fxFlex",""],["mat-button","",1,"icon",3,"click"],[1,"icon-wd-x-close-blue-1"],["fxFlex","","fxLayout","column"],[4,"ngIf"],["fxFlex","",1,"report-filters-body",2,"overflow","auto"],[4,"ngFor","ngForOf"],[3,"inset"],["fxLayout","column","fxLayoutGap","1rem",1,"report-filter-footer"],["fxLayout","row","fxLayoutGap","1rem",1,"buttons"],["fxFlex","","buttonStyle","secondary",3,"label","isSubmitting","onClick"],["fxFlex","",3,"label","disabled","isSubmitting","onClick"],["class","filtering-message",4,"ngIf"],["fxFlex","","buttonStyle","deny",3,"label","disabled","isSubmitting","onClick",4,"ngIf"],[3,"group","disabled","changeGroupState","changeItemState","changeSystemState"],[1,"filtering-message"],["fxFlex","","buttonStyle","deny",3,"label","disabled","isSubmitting","onClick"]],template:function(o,t){1&o&&(e.TgZ(0,"mat-card",0)(1,"div",1)(2,"h2",2),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"button",3),e.NdJ("click",function(){return t.close.emit()}),e._UZ(6,"span",4),e.qZA()(),e.TgZ(7,"div",5),e.YNc(8,$o,1,0,"app-loading-overlay",6),e.TgZ(9,"div",7)(10,"app-scroll-box"),e.YNc(11,Ho,3,3,"ng-container",8),e.qZA()(),e._UZ(12,"mat-divider",9),e.TgZ(13,"div",10)(14,"div",11)(15,"app-button",12),e.NdJ("onClick",function(){return t.onClickReset()}),e.ALo(16,"translate"),e.qZA(),e.TgZ(17,"app-button",13),e.NdJ("onClick",function(){return t.onClickApply()}),e.ALo(18,"translate"),e.qZA()(),e.YNc(19,Xo,3,3,"div",14),e.TgZ(20,"div",11),e.YNc(21,Vo,2,5,"app-button",15),e.qZA()()()()),2&o&&(e.xp6(3),e.Oqu(e.l
1cZ(4,11,"report.filters.title")),e.xp6(5),e.Q6J("ngIf",t.loading),e.xp6(3),e.Q6J("ngForOf",null==t.currFilters?null:t.currFilters.filters),e.xp6(1),e.Q6J("inset",!0),e.xp6(3),e.s9C("label",e.lcZ(16,13,"report.filters.actions.reset")),e.Q6J("isSubmitting",t.isResetting),e.xp6(2),e.s9C("label",e.lcZ(18,15,t.reportTemplate?"report.filters.actions.applyTemplate":"report.filters.actions.apply")),e.Q6J("disabled",!t.currFilters)("isSubmitting",t.isFiltering),e.xp6(2),e.Q6J("ngIf",t.showFilteringMessage),e.xp6(2),e.Q6J("ngIf",t.reportTemplate))},directives:[q.a8,g.xw,g.yH,te.lW,f.O5,ho.d,mo.Y,f.sg,Y,ge.d,g.SQ,he.r],pipes:[C.X$],styles:["mat-card.report-filters[_ngcontent-%COMP%]{width:20.5rem;padding:0;height:calc(100vh - 4rem);margin-top:4rem;border-radius:0}mat-card.report-filters[_ngcontent-%COMP%]   .report-filters-header[_ngcontent-%COMP%]{padding:1rem;border-bottom:.0625rem solid rgba(0,0,0,.05);min-height:4rem}mat-card.report-filters[_ngcontent-%COMP%]   .report-filters-header[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{color:#0069df;font-size:.875rem;font-weight:500;vertical-align:middle;margin:0 auto;width:100%;align-self:center}mat-card.report-filters[_ngcontent-%COMP%]   .report-filters-body[_ngcontent-%COMP%]{height:calc(100% - 27rem)}mat-card.report-filters[_ngcontent-%COMP%]   .report-filters-body[_ngcontent-%COMP%]   app-filter-group-box[_ngcontent-%COMP%]     .expand-collapse-toggle-container{margin:.7rem}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]{margin:1rem}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]   .report-date-range[_ngcontent-%COMP%]{color:#0069df;font-size:.875rem;font-weight:500}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]   .report-date-range[_ngcontent-%COMP%]   app-date-picker-dropdown#from[_ngcontent-%COMP%]     .container.fade-in{top:-16.5rem}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]   .report-date-range[_ngcontent-%COMP%]   app-date-picker-dropdown#to[_ngcontent-%COMP%]     .container.fade-in{top:-16.5rem;left:-3.2rem}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]   .buttons[_ngcontent-%COMP%]{margin-bottom:1.5rem}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]   .buttons[_ngcontent-%COMP%]   app-button[_ngcontent-%COMP%]     button[mat-button]{width:100%;line-height:2rem;text-transform:none;font-size:.75rem;margin:0}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]   .buttons[_ngcontent-%COMP%]   app-button[_ngcontent-%COMP%]     button[mat-button] .spinner>div{width:.65rem;height:.65rem}mat-card.report-filters[_ngcontent-%COMP%]   .report-filter-footer[_ngcontent-%COMP%]   .filtering-message[_ngcontent-%COMP%]{color:#9295a9}"]});var Wo=function(n,o,t,r){return new(t||(t=Promise))(function(s,a){function l(p){try{d(r.next(p))}catch(h){a(h)}}function u(p){try{d(r.throw(p))}catch(h){a(h)}}function d(p){p.done?s(p.value):function i(s){return s instanceof t?s:new t(function(a){a(s)})}(p.value).then(l,u)}d((r=r.apply(n,o||[])).next())})};function Ko(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"div",4)(1,"div",5),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"app-select-dropdown",18),e.NdJ("ngModelChange",function(i){e.CHM(t);return e.oxw().selectedTemplate=i})("change",function(i){return e.CHM(t),e.oxw().onChangeTemplate(i)}),e.ALo(5,"translate"),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(2),e.hij(" ",e.lcZ(3,4,"report.templates")," "),e.xp6(2),e.s9C("placeholder",e.lcZ(5,6,"report.selectTemplate")),e.Q6J("options",t.reportTemplates)("ngModel",t.selectedTemplate)}}function en(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"app-button",19),e.NdJ("click",function(){return e.CHM(t),e.oxw().authenticateXero()}),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("label",t.authenticateXeroButtonLabel())("disabled",t.reportService.isXeroAuthenticated)}}function tn(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"button",11),e.NdJ("click",function(){return e.CHM(t),e.oxw().onExport("xero")}),e.TgZ(1,"div",12)(2,"span"),e._uU(3),e.ALo(4,"translate"),e.qZA()()()}2&n&&(e.xp6(3),e.hij(" ",e.lcZ(4,1,"report.exportMode.xero")," "))}function on(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"app-button",20),e.NdJ("onClick",function(){return e.CHM(t),e.oxw().saveAsTemplate()}),e.ALo(1,"translate"),e.qZA()}if(2&n){const t=e.oxw();e.s9C("label",e.lcZ(1,2,"report.saveAsTemplate")),e.Q6J("isSubmitting",t.savingTemplateReport)}}function nn(n,o){if(1&n&&(e._UZ(0,"app-button",21),e.ALo(1,"translate")),2&n){const t=e.oxw(),r=e.MAs(13);e.s9C("label",e.lcZ(1,3,"report.export")),e.Q6J("isSubmitting",t.downloadingReport)("matMenuTriggerFor",r)}}const rn=function(n){return{"rotate-180":n}};function sn(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"app-button",22),e.NdJ("onClick",function(){return e.CHM(t),e.oxw().toggleFilters()}
1),e.ALo(1,"translate"),e._UZ(2,"span",23),e.qZA()}if(2&n){const t=e.oxw();e.s9C("label",e.lcZ(1,2,"report.filters.btn")),e.xp6(2),e.Q6J("ngClass",e.VKq(4,rn,t.filtersOpen))}}function an(n,o){if(1&n){const t=e.EpF();e.TgZ(0,"app-report-filters",24),e.NdJ("close",function(){return e.CHM(t),e.oxw().closeFilters()}),e.qZA()}if(2&n){const t=e.oxw();e.ekj("drawer-right-closing",t.filtersClosing)}}const ln=function(n){return{empty:n}};class J{constructor(o,t,r,i,s,a,l,u,d){this.reportService=o,this.dialogsService=t,this.router=r,this.http=i,this.route=s,this.envService=a,this.translate=l,this._authGuard=u,this.ela=d,this.someField=!0,this.filtersOpen=!1,this.filtersClosing=!1,this.downloadingReport=!1,this.savingTemplateReport=!1,this.tableWithRecords=!1,this.subscriptions=[],this.xeroRedirectUri=x.N.production?window.__env.apiUrl.includes("test-api")?"https://test.workdeck.com/site/reports":"https://my.workdeck.com/site/reports":"https://f1dd-185-196-255-104.ngrok-free.app/site/reports",this.xeroClientId=x.N.production?window.__env.apiUrl.includes("test-api")?"494273B034E14747BBB00D8F535DE0BA":"DEC5E0D1BE9442F68056C4660022950F":"5C353AD384754358B4989944F4111965",this.xeroClientSecret=x.N.production?window.__env.apiUrl.includes("test-api")?"truIp2ZwafzRTYpqZPUSLy5uabHEsEaAqLVhPRr_x3qtE39v":"TGugs5vmP3ulZ9Qg8DqXTP-X-6i1n6XUcB64CXmV0Gf_C0Jm":"Je90r__Q8wNDH6-Z0KzdNaGPNMuE7PVwGCW0CLRYrTyadDxV",this.xeroAuth="Basic "+btoa(this.xeroClientId+":"+this.xeroClientSecret),this.xeroAuthorization=new Q.WM({Authorization:this.xeroAuth}),this.reportService.init(),this.reportService.updateReportTypes(),this.reportTypes=this.reportService.filteredReportTypes,this.filterReports(),this.subscriptions=[this.reportService.selectedReportType$.subscribe(p=>{void 0!==p&&this.changeReportType(p.value)}),this.router.events.pipe((0,co.h)(p=>p instanceof O.m2)).subscribe(p=>{this.reportTemplates=de.C.empty;let h=p.urlAfterRedirects.split("/").pop();h="reports"===h?null:h,setTimeout(()=>{this.selectedReportType=this.reportTypes.getValue(m[h?h.toUpperCase():"NONE"]),this.selectedReportType||(this.selectedReportType=this.reportTypes.getValue(m.NONE.toString())),this.reportService.requestSelectedReportTypeSource(this.selectedReportType),h&&(this.reportService.setSelectTemplatesReportData(this.selectedReportType.value).consume(),this.reportService.selectReportTemplatesChannel.successChannel().subscribe(E=>{E.forEach(A=>{this.reportTemplates.push(A)})}))},0)}),this.reportService.deleteReportTemplateChannel.successChannel().subscribe(p=>{this.deleteReportTemplate(p[0].new)}),this.reportService.selectReportFilterChannel.successChannel().subscribe(()=>this.selectedTemplate=void 0),this.reportService.reportExported$.subscribe(()=>{this.savingTemplateReport=!1,this.downloadingReport=!1}),this.reportService.selectEventReportChannel.successChannel().subscribe(p=>p.length>0?this.tableWithRecords=!0:this.tableWithRecords=!1)]}ngOnInit(){this.checkAccessRevoked(this._authGuard.authorized()),this.route.queryParams.subscribe(o=>Wo(this,void 0,void 0,function*(){o.code&&this.getXeroToken(o.code).subscribe(t=>{t.access_token?(sessionStorage.setItem("xeroAccessToken",t.access_token),sessionStorage.setItem("xeroRefreshToken",t.refresh_token)):this.reportService.getXeroRefreshToken().subscribe(r=>{sessionStorage.setItem("xeroAccessToken",r.access_token),sessionStorage.setItem("xeroRefreshToken",r.refresh_token),this.reportService.isXeroAuthenticated=!0}),this.reportService.isXeroAuthenticated=!0})}))}filterReports(){const o=this._authGuard.allowComponent("Leave"),t=this._authGuard.allowComponent("Purchases");if(!o){const r=this.reportService.filteredReportTypes.getValue("3");this.reportTypes.splice(r)}if(!t){const r=this.reportService.filteredReportTypes.getValue("4");this.reportTypes.splice(r)}}ngOnDestroy(){this.ela.unsubscribe(this.subscriptions),this.resetDropdown(),this.reportService.destroy()}getXeroToken(o){const t={code:o,grant_type:"authorization_code",redirect_uri:this.xeroRedirectUri};return this.http.post(this.envService.apiUrl+"/"+x.N.api.endpoints.xero.proxy,t,{headers:this.xeroAuthorization})}
1toggleFilters(){this.filtersOpen?this.closeFilters():this.showFilters()}showFilters(){this.filtersOpen=!0}closeFilters(){this.filtersClosing=!0,setTimeout(()=>{this.filtersOpen=!1,this.filtersClosing=!1},400)}onExport(o="xlsx"){"xero"===o?this.dialogsService.openSelectXeroContactDialog({title:{message:"dialogs.xeroInvoice.title",translate:!0},reportService:this.reportService}):(this.downloadingReport=!0,this.reportService.requestExport(o))}changeReportType(o){this.selectedTemplate=void 0,o===_.NONE||this.filtersOpen?o===_.NONE&&this.filtersOpen&&this.closeFilters():this.showFilters(),this.selectedReportType=this.reportTypes.getValue(o.toString()),setTimeout(()=>{const t=this.isEmptySelected()?"":this.selectedReportType.name.toLocaleLowerCase();this.router.navigate([`/site/reports/${t}`])},0)}onChangeReportType(o){this.reportService.requestSelectedReportTypeSource(o)}onChangeTemplate(o){this.reportService.setSelectTemplateFiltersReportData(o.id).consume()}saveAsTemplate(){this.savingTemplateReport=!0,this.dialogsService.openEditSaveAsTemplateDialog(this.deleteConfirmationContent()).afterClosed().filter(o=>(o||(this.savingTemplateReport=!1),o)).subscribe(o=>{this.savingTemplateReport=!1,this.createReportTemplate(o)})}authenticateXero(){window.location.href="https://login.xero.com/identity/connect/authorize?response_type=code&client_id="+this.xeroClientId+"&redirect_uri="+this.xeroRedirectUri+"&scope=openid profile email accounting.transactions accounting.settings accounting.contacts offline_access&state=123"}deleteConfirmationContent(){return{title:{message:"dialogs.reportTemplate.title",translate:!0},templates:this.reportTemplates}}createReportTemplate(o){const t=de.C.volatile(this.selectedReportType.value,o.name,this.reportService._previousFilters.toJson(),!!o.schedule,o.schedule);this.reportService.setInsertTemplateReportData(t).subscribeFirst(r=>{this.reportTemplates.push(r.new)})}deleteReportTemplate(o){this.selectedTemplate=void 0,this.reportTemplates.splice(o)}isEmptySelected(){return this.selectedReportType&&this.selectedReportType.value===_.NONE}checkAccessRevoked(o){o.isProjectManager||o.isManager||this.router.navigate(["/site/not-allowed?return=/site/reports"]),this.reportService.updateReportTypes(),this.reportTypes=this.reportService.filteredReportTypes,this.filterReports()}resetDropdown(){setTimeout(()=>{this.selectedReportType=this.reportTypes.getValue(m.NONE.toString()),this.reportService.requestSelectedReportTypeSource(this.selectedReportType)},0)}authenticateXeroButtonLabel(){return this.reportService.isXeroAuthenticated?this.translate.instant("dialogs.xeroInvoice.connectedToXero"):this.translate.instant("dialogs.xeroInvoice.loginWithXero")}}J.\u0275fac=function(o){return new(o||J)(e.Y36(b),e.Y36(ue.H),e.Y36(O.F0),e.Y36(Q.eN),e.Y36(O.gz),e.Y36(se.D),e.Y36(C.sK),e.Y36(V.a),e.Y36(T.pM))},J.\u0275cmp=e.Xpm({type:J,selectors:[["app-reports"]],hostVars:2,hostBindings:function(o,t){2&o&&e.ekj("sapenta-window",t.someField)},decls:35,vars:29,consts:[["appFullHeight","","fxLayout","row",1,"reports-container","sapenta-window-content"],["fxLayout","column","fxLayoutGap","1rem",1,"left-panel"],["fxLayout","row",1,"reports-header"],["fxFlex","","fxLayoutAlign","start center","fxLayoutGap","2rem",1,"left-reports-header"],["fxLayoutAlign","start center","fxLayoutGap","0.875rem"],[1,"report-type-selector-title"],["name","reportType","label","translationPath",3,"translate","options","ngModel","ngClass","ngModelChange","change"],["fxLayoutAlign","start center","fxLayoutGap","0.875rem",4,"ngIf"],[3,"label","disabled","click",4,"ngIf"],["fxLayout","row","fxLayoutGap","1rem",1,"right-reports-header"],["exportMenu","matMenu"],["mat-menu-item","",3,"click"],["fxLayoutAlign","start center"],["mat-menu-item","",3,"click",4,"ngIf"],["buttonStyle","secondary",3,"label","isSubmitting","onClick",4,"ngIf"],[3,"label","isSubmitting","matMenuTriggerFor",4,"ngIf"],["class","filters-button","buttonStyle","secondary",3,"label","onClick",4,"ngIf"],["class","drawer-right",3,"drawer-right-closing","close",4,"ngIf"],["name","reportTemplates","label","name",3,"options","ngModel","placeholder","ngModelChange","change"],[3,"label","disabled","click"],["buttonStyle","secondary",3,"label","isSubmitting","onClick"],[3,"label","isSubmitting","matMenuTriggerFor"],["buttonStyle","secondary",1,"filters-button",3,"label","onClick"],["appButtonEndIcon","",1,"icon","icon-wd-arrow-right-outline",3,"ngClass"],[1,"drawer-right",3,"close"]],template:function(o,t){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"app-select-dropdown",6),e.NdJ("ngModelChange",function(i){return t.selectedReportType=i})("change",function(i){return t.onChangeReportType(i)}),e.qZA()(),e.YNc(9,Ko,6,8,"div",7),e.YNc(10,en,1,2,"app-button",8),e.qZA(),e.TgZ(11,"div",9)(12,"mat-menu",null,10)(14,"button",11),e.NdJ("click",function(){return t.onExport("pdf")}),e.TgZ(15,"div",12)(16,"span"),e._uU(17),e.ALo(18,"translate"),e.qZA()()(),e.TgZ(19,"button",11),e.NdJ("click",function(){return t.onExport("xlsx")}),e.TgZ(20,"div",12)(21,"span"),e._uU(22),e.ALo(23,"translate"),e.qZA()()(),e.TgZ(24,"button",11),e.NdJ("click",function(){return t.onExport("csv")}),e.TgZ(25,"div",12)(26,"span"),e._uU(27),e.ALo(28,"translate"),e.qZA()()(),e.YNc(29,tn,5,3,"button",13),e.qZA(),e.YNc(30,on,2,4,"app-button",14),e.YNc(31,nn,2,5,"app-button",15),e.YNc(32,sn,3,6,"app-button",16),e.qZA()(),e._UZ(33,"router-outlet"),e.qZA(),e.YNc(34,an,1,2,"app-report-filters",17),e.qZA()),2&o&&(e.xp6(1),e.ekj("right-card-open",t.filtersOpen)("right-card-closing",t.filtersClosing),e.xp6(5),e.hij(" ",e.lcZ(7,19,"report.reportBy")," "),e.xp6(2),e.Q6J("translate",!0)("options",t.reportTypes)("ngModel",t.selectedReportType)("ngClass",e.VKq(27,ln,0===(null==t.selectedReportType?null:t.selectedReportType.value))),e.xp6(1),e.Q6J("ngIf",!!t.reportTemplates&&0!==(null==t.reportTemplates?null:t.reportTemplates.length)),e.xp6(1),e.Q6J("ngIf",t.reportService.isXeroCompany()&&5===(null==t.selectedReportType?null:t.selectedReportType.value)),e.xp6(7),e.hij(" ",e.lcZ(18,21,"report.exportMode.pdf")," "),e.xp6(5),e.hij(" ",e.lcZ(23,23,"report.exportMode.excel")," "),e.xp6(5),e.hij(" ",e.lcZ(28,25,"report.exportMode.csv")," "),e.xp6(2),e.Q6J("ngIf",5===(null==t.selectedReportType?null:t.selectedReportType.value)&&t.reportService.isXeroCompany()&&t.reportService.isXeroAuthenticated),e.xp6(1),e.Q6J("ngIf",t.tableWithRecords),e.xp6(1),e.Q6J("ngIf",t.tableWithRecords),e.xp6(1),e.Q6J("ngIf",!t.isEmptySelected()),e.xp6(2),e.Q6J("ngIf",t.filtersOpen))},directives:[pe.h,g.xw,g.SQ,g.yH,g.Wh,po.J,C.Pi,M.JJ,M.On,f.mk,$.oO,f.O5,he.r,ee.VK,ee.OP,ee.p6,O.lC,j],pipes:[C.X$],styles:["@keyframes flex-in{0%{flex:.0001}to{flex:1}}@keyframes flex-out{0%{flex:1}to{flex:.0001}}@keyframes fadeAndScale{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes zoom-in-out-text{0%{font-size:16px}5%{font-size:16.5px}10%{font-size:17px}15%{font-size:17.5px}20%{font-size:18px}25%{font-size:18.5px}30%{font-size:19px}35%{font-size:19.5px}40%{font-size:20px}45%{font-size:20.5px}50%{font-size:20.5px}55%{font-size:20.5px}60%{font-size:20px}65%{font-size:19.5px}70%{font-size:19px}75%{font-size:18.5px}80%{font-size:18px}85%{font-size:17.5px}90%{font-size:17px}95%{font-size:16.5px}to{font-size:16px}}@keyframes fadein{0%{opacity:0}
166%{opacity:0}to{opacity:1}}@keyframes shake{10%,90%{transform:translate(-1px)}20%,80%{transform:translate(2px)}30%,50%,70%{transform:translate(-4px)}40%,60%{transform:translate(4px)}}@keyframes kf_shake{0%{transform:translate(8px)}20%{transform:translate(-8px)}40%{transform:translate(4px)}60%{transform:translate(-4px)}80%{transform:translate(2px)}to{transform:translate(0)}}@keyframes sk-bounce{0%,to{transform:scale(0)}50%{transform:scale(1)}}@keyframes flicker{0%{background-color:#cdeaff}33%{background-color:#fff}66%{background-color:#cdeaff}to{background-color:#fff}}@keyframes sk-bouncedelay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]{height:100%;margin:2rem}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .header[_ngcontent-%COMP%]{margin-bottom:1.9rem!important}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]   .reports-header[_ngcontent-%COMP%]{font-size:.75rem;font-weight:400}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]   .reports-header[_ngcontent-%COMP%]   .left-reports-header[_ngcontent-%COMP%]   app-select-dropdown[_ngcontent-%COMP%]     button[mat-button]{min-width:12rem}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]   .reports-header[_ngcontent-%COMP%]   .left-reports-header[_ngcontent-%COMP%]   app-select-dropdown.empty[_ngcontent-%COMP%]{opacity:.75}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]     router-outlet+* mat-card.card-container{padding:0}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]     router-outlet+* mat-card.card-container .card-content ng-scrollbar.scrollbar-table-container>.ng-scrollbar-wrapper .ng-scroll-content{max-height:calc(100vh - 21.2rem)!important}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]     router-outlet+* mat-card.card-container .card-content ng-scrollbar.scrollbar-table-container>.ng-scrollbar-wrapper>scrollbar-y.scrollbar-control{top:3.5rem!important}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]     router-outlet+* mat-card.card-container .card-content perfect-scrollbar.scrollbar-table-container>.ps.ps--active-y>.ps__rail-y{top:3.5rem!important;bottom:3.5rem!important}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .left-panel[_ngcontent-%COMP%]     router-outlet+* mat-card.card-container .card-content ng-scrollbar.scrollbar-table-container .mat-table{width:100%;color:#003}[_nghost-%COMP%]   .sapenta-window-content[_ngcontent-%COMP%]   .filters-button[_ngcontent-%COMP%]   .icon-wd-arrow-right-outline.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}"]});const cn=[{path:"",redirectTo:"site/reports",pathMatch:"full"},{path:"",component:J,children:[{path:":report-path",component:D,canActivate:[k]},{path:"",component:N}]}],pn=O.Bz.forChild(cn);class L{}L.\u0275fac=function(o){return new(o||L)},L.\u0275mod=e.oAB({type:L}),L.\u0275inj=e.cJS({providers:[b,k],imports:[[f.ez,Ce.I,M.u5,Re.V,Ae.z,pn]]})}}]);

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.