PageSourceSearch

https://app.cadynce.com/998.aad8db66630265d6.js

js cadynce.com collected 2026-09-28 08:27:41 UTC 1,241,564 bytes, 1 lines download raw bytes

1(self.webpackChunkcadynce_client=self.webpackChunkcadynce_client||[]).push([[998],{25998:(lr,dr,F)=>{"use strict";F.r(dr),F.d(dr,{AdHocReportingModule:()=>ex});var M=F(60177),R=F(89417),cn=F(51653),$e=F.n(cn),cr=F(75714),ge=F(6898),ue=F(45286),L=F(7605),ne=F(77312),w=F(43288),Ue=F(95702),e=F(54438),It=F(32100),Ye=F(83779),ce=F(22043),q=F(60131),Le=F(28833),ee=F(68834);function Aa(i,a){if(1&i&&(e.j41(0,"p",11),e.EFF(1," Testing "),e.j41(2,"strong"),e.EFF(3),e.k0s()()),2&i){const t=e.XpG();e.R7$(3),e.JRh(t.formName)}}function pr(i,a){if(1&i&&(e.j41(0,"small",12),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.JRh(t.loadError)}}function pn(i,a){1&i&&(e.j41(0,"small",13),e.EFF(1," The form will be rendered with this item's field values auto-filled into mapped parameters. "),e.k0s())}function ur(i,a){1&i&&(e.j41(0,"span"),e.EFF(1,"Render PDF"),e.k0s())}function La(i,a){1&i&&(e.j41(0,"span"),e.nrm(1,"i",14),e.EFF(2," Rendering..."),e.k0s())}let m=(()=>{class i{constructor(t,n,o,r,s){this._ref=t,this._apiService=o,this._itemsService=r,this._messagingService=s,this._destroyed$=new ue.B7,this.loadingItems=!1,this.rendering=!1,this.items=[],this.selectedItem=null,this.loadError="";const c=n.data||{};this.formId=c.formId,this.elementId=c.elementId,this.formName=c.formName||""}ngOnInit(){this.loadItems()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}loadItems(){this.loadingItems=!0,this.loadError="",this._itemsService.getElementItems(this.elementId,{page:1,pageSize:200}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loadingItems=!1)).subscribe({next:t=>{this.items=(t?.items||[]).filter(n=>!!n.itemGuid).map(n=>({itemGuid:n.itemGuid,label:this._formatLabel(n)})),0===this.items.length&&(this.loadError="No items found for this element.")},error:t=>{console.error("Failed to load items for test dialog:",t),this.loadError="Failed to load items."}})}onRender(){!this.selectedItem||this.rendering||(this.rendering=!0,this._apiService.renderFormForInstance(this.formId,this.elementId,this.selectedItem.itemGuid).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.rendering=!1)).subscribe({next:t=>{const n=URL.createObjectURL(t);window.open(n,"_blank"),this._ref.close({itemGuid:this.selectedItem?.itemGuid})},error:t=>{console.error("Failed to render form for instance:",t),this._messagingService.error("Failed to render form against the selected item.","Error")}}))}onCancel(){this._ref.close()}_formatLabel(t){const n=[];return null!=t.relativeId&&n.push(`#${t.relativeId}`),t.title&&n.push(t.title),n.join(" \xb7 ")||t.itemGuid}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(It.Pw),e.rXU(It.sb),e.rXU(Ye.F),e.rXU(ce._B),e.rXU(q.Ui))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-form-test-instance-dialog"]],decls:14,vars:13,consts:[[1,"test-instance-dialog"],["class","form-name",4,"ngIf"],[1,"field"],["for","item-select"],["inputId","item-select","optionLabel","label","filterBy","label","appendTo","body",3,"ngModelChange","options","ngModel","disabled","filter","showClear","placeholder"],["class","error",4,"ngIf"],["class","hint",4,"ngIf"],[1,"actions"],["type","button",1,"button","button_flat",3,"click","disabled"],["type","button",1,"button","button_primary",3,"click","disabled"],[4,"ngIf"],[1,"form-name"],[1,"error"],[1,"hint"],[1,"mdi","mdi-loading","mdi-spin"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.DNE(1,Aa,4,1,"p",1),e.j41(2,"div",2)(3,"label",3),e.EFF(4,"Select an item instance"),e.k0s(),e.j41(5,"p-dropdown",4),e.mxI("ngModelChange",function(s){return e.DH7(o.selectedItem,s)||(o.selectedItem=s),s}),e.k0s(),e.DNE(6,pr,2,1,"small",5)(7,pn,2,0,"small",6),e.k0s(),e.j41(8,"div",7)(9,"button",8),e.bIt("click",function(){return o.onCancel()}),e.EFF(10," Cancel "),e.k0s(),e.j41(11,"button",9),e.bIt("click",function(){return o.onRender()}),e.DNE(12,ur,2,0,"span",10)(13,La,3,0,"span",10),e.k0s()()()),2&n&&(e.R7$(),e.Y8G("ngIf",o.formName),e.R7$(4),e.FS9("placeholder",o.loadingItems?"Loading items...":"Pick an item"),e.Y8G("options",o.items),e.R50("ngModel",o.selectedItem),e.Y8G("disabled",o.loadingItems||!!o.loadError)("filter",!0)("showClear",!0),e.R7$(),e.Y8G("ngIf",o.loadError&&!o.loadingItems),e.R7$(),e.Y8G("ngIf",!o.loadError&&!o.loadingItems),e.R7$(2),e.Y8G("disabled",o.rendering),e.R7$(2),e.Y8G("disabled",!o.selectedItem||o.rendering),e.R7$(),e.Y8G("ngIf",!o.rendering),e.R7$(),e.Y8G("ngIf",o.rendering))},dependencies:[M.bT,R.BC,R.vS,Le.ms,ee.C3],styles:[".test-instance-dialog[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:.25rem 0;min-width:380px}
1.form-name[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--text-color-secondary, #6b7280)}.field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-weight:600;font-size:.85rem}.field[_ngcontent-%COMP%]     .p-dropdown{width:100%}.field[_ngcontent-%COMP%]   .hint[_ngcontent-%COMP%]{color:var(--text-color-secondary, #6b7280);font-size:.75rem}.field[_ngcontent-%COMP%]   .error[_ngcontent-%COMP%]{color:var(--p-red-600, #dc2626);font-size:.8rem}.actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;margin-top:.25rem}"]})}}return i})();var ke=F(5779),_e=F(22242),On=F(74945),Mt=F(38542),ze=F(71878),Re=F(94799),he=F(54420);const Ba=["*",[["p-header"]],[["p-footer"]]],ja=["*","p-header","p-footer"];function Nt(i,a){1&i&&e.eu8(0)}function Gi(i,a){if(1&i&&(e.j41(0,"div",8),e.SdG(1,1),e.DNE(2,Nt,1,0,"ng-container",6),e.k0s()),2&i){const t=e.XpG();e.R7$(2),e.Y8G("ngTemplateOutlet",t.headerTemplate)}}function un(i,a){1&i&&e.eu8(0)}function _r(i,a){if(1&i&&(e.j41(0,"div",9),e.EFF(1),e.DNE(2,un,1,0,"ng-container",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.SpI(" ",t.header," "),e.R7$(),e.Y8G("ngTemplateOutlet",t.titleTemplate)}}function mr(i,a){1&i&&e.eu8(0)}function gr(i,a){if(1&i&&(e.j41(0,"div",10),e.EFF(1),e.DNE(2,mr,1,0,"ng-container",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.SpI(" ",t.subheader," "),e.R7$(),e.Y8G("ngTemplateOutlet",t.subtitleTemplate)}}function Ai(i,a){1&i&&e.eu8(0)}function hr(i,a){1&i&&e.eu8(0)}function Va(i,a){if(1&i&&(e.j41(0,"div",11),e.SdG(1,2),e.DNE(2,hr,1,0,"ng-container",6),e.k0s()),2&i){const t=e.XpG();e.R7$(2),e.Y8G("ngTemplateOutlet",t.footerTemplate)}}let _n=(()=>{class i{el;header;subheader;set style(t){he.BF.equals(this._style(),t)||this._style.set(t)}styleClass;headerFacet;footerFacet;templates;headerTemplate;titleTemplate;subtitleTemplate;contentTemplate;footerTemplate;_style=(0,e.vPA)(null);constructor(t){this.el=t}
1ngAfterContentInit(){this.templates.forEach(t=>{switch(t.getType()){case"header":this.headerTemplate=t.template;break;case"title":this.titleTemplate=t.template;break;case"subtitle":this.subtitleTemplate=t.template;break;case"content":default:this.contentTemplate=t.template;break;case"footer":this.footerTemplate=t.template}})}getBlockableElement(){return this.el.nativeElement.children[0]}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT))};static \u0275cmp=e.VBU({type:i,selectors:[["p-card"]],contentQueries:function(n,o,r){if(1&n&&(e.wni(r,ke.Y9,5),e.wni(r,ke.wi,5),e.wni(r,ke.Ei,4)),2&n){let s;e.mGM(s=e.lsd())&&(o.headerFacet=s.first),e.mGM(s=e.lsd())&&(o.footerFacet=s.first),e.mGM(s=e.lsd())&&(o.templates=s)}},hostAttrs:[1,"p-element"],inputs:{header:"header",subheader:"subheader",style:"style",styleClass:"styleClass"},ngContentSelectors:ja,decls:9,vars:10,consts:[[3,"ngClass","ngStyle"],["class","p-card-header",4,"ngIf"],[1,"p-card-body"],["class","p-card-title",4,"ngIf"],["class","p-card-subtitle",4,"ngIf"],[1,"p-card-content"],[4,"ngTemplateOutlet"],["class","p-card-footer",4,"ngIf"],[1,"p-card-header"],[1,"p-card-title"],[1,"p-card-subtitle"],[1,"p-card-footer"]],template:function(n,o){1&n&&(e.NAR(Ba),e.j41(0,"div",0),e.DNE(1,Gi,3,1,"div",1),e.j41(2,"div",2),e.DNE(3,_r,3,2,"div",3)(4,gr,3,2,"div",4),e.j41(5,"div",5),e.SdG(6),e.DNE(7,Ai,1,0,"ng-container",6),e.k0s(),e.DNE(8,Va,3,1,"div",7),e.k0s()()),2&n&&(e.HbH(o.styleClass),e.Y8G("ngClass","p-card p-component")("ngStyle",o._style()),e.BMQ("data-pc-name","card"),e.R7$(),e.Y8G("ngIf",o.headerFacet||o.headerTemplate),e.R7$(2),e.Y8G("ngIf",o.header||o.titleTemplate),e.R7$(),e.Y8G("ngIf",o.subheader||o.subtitleTemplate),e.R7$(3),e.Y8G("ngTemplateOutlet",o.contentTemplate),e.R7$(),e.Y8G("ngIf",o.footerFacet||o.footerTemplate))},dependencies:[M.YU,M.bT,M.T3,M.B3],styles:["@layer primeng{.p-card-header img{width:100%}}\n"],encapsulation:2,changeDetection:0})}return i})(),$a=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[M.MD,ke.Gg]})}return i})();var ni=F(20935),fr=F(25111),ft=F(8537),ut=F(65430),_t=F(86781);const ii=()=>({width:"500px"}),oi=()=>({width:"100%"});function Ua(i,a){if(1&i&&(e.j41(0,"div",23)(1,"span",24),e.EFF(2),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.JRh(t.report.name)}}function Li(i,a){if(1&i&&(e.j41(0,"div",27)(1,"span",28),e.EFF(2),e.k0s(),e.j41(3,"span",29),e.EFF(4),e.k0s()()),2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.displayName),e.R7$(2),e.JRh(t.email)}}function ri(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",10)(1,"label"),e.EFF(2,"Share with User"),e.k0s(),e.j41(3,"p-autoComplete",25),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedUser,o)||(r.selectedUser=o),e.Njj(o)}),e.bIt("completeMethod",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onUserSearch(o))}),e.DNE(4,Li,5,2,"ng-template",26),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.Aen(e.lJ4(5,oi)),e.R50("ngModel",t.selectedUser),e.Y8G("suggestions",t.searchResults)("dropdown",!1)}}function Gt(i,a){if(1&i&&(e.j41(0,"div",31),e.nrm(1,"i",6),e.j41(2,"span",32),e.EFF(3),e.k0s()()),2&i){const t=a.$implicit;e.R7$(3),e.JRh(t.name)}}function Ya(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",10)(1,"label"),e.EFF(2,"Share with Role"),e.k0s(),e.j41(3,"p-autoComplete",30),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedRole,o)||(r.selectedRole=o),e.Njj(o)}),e.bIt("completeMethod",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onRoleSearch(o))}),e.DNE(4,Gt,4,1,"ng-template",26),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.Aen(e.lJ4(5,oi)),e.R50("ngModel",t.selectedRole),e.Y8G("suggestions",t.roleSearchResults)("dropdown",!0)}}function Ha(i,a){1&i&&e.nrm(0,"i",33)}function Xa(i,a){1&i&&e.nrm(0,"i",34)}function Ft(i,a){1&i&&(e.j41(0,"div",35),e.nrm(1,"kendo-loader",36),e.k0s())}function xn(i,a){1&i&&(e.j41(0,"div",37),e.EFF(1," This report has not been shared with anyone yet. "),e.k0s())}function Mn(i,a){1&i&&(e.j41(0,"span"),e.EFF(1," \u2022 Can reshare"),e.k0s())}function te(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",41)(1,"div",42),e.nrm(2,"i",5),e.j41(3,"div",43)(4,"span",28),e.EFF(5),e.k0s(),e.j41(6,"span",44),e.EFF(7),e.DNE(8,Mn,2,0,"span",45),e.k0s()()(),e.j41(9,"button",46),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2);return e.Njj(r.onRemoveShare(o))}),e.nrm(10,"i",47),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG(2);e.R7$(5),e.JRh(t.sharedWithUserName||t.sharedWithUserId),e.R7$(2),e.SpI(" ",n.getPermissionLabel(t.permission)," "),e.R7$(),e.Y8G("ngIf",t.canReshare)}}
1function tt(i,a){if(1&i&&(e.j41(0,"div",38)(1,"h5"),e.EFF(2,"Users"),e.k0s(),e.j41(3,"div",39),e.DNE(4,te,11,3,"div",40),e.k0s()()),2&i){const t=e.XpG();e.R7$(4),e.Y8G("ngForOf",t.currentShares)}}function Wa(i,a){1&i&&(e.j41(0,"span"),e.EFF(1," \u2022 Can reshare"),e.k0s())}function za(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",41)(1,"div",42),e.nrm(2,"i",6),e.j41(3,"div",43)(4,"span",28),e.EFF(5),e.k0s(),e.j41(6,"span",44),e.EFF(7),e.DNE(8,Wa,2,0,"span",45),e.k0s()()(),e.j41(9,"button",46),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2);return e.Njj(r.onRemoveRoleShare(o))}),e.nrm(10,"i",47),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG(2);e.R7$(5),e.JRh(t.sharedWithRoleName),e.R7$(2),e.SpI(" ",n.getPermissionLabel(t.permission)," "),e.R7$(),e.Y8G("ngIf",t.canReshare)}}function Ka(i,a){if(1&i&&(e.j41(0,"div",38)(1,"h5"),e.EFF(2,"Roles"),e.k0s(),e.j41(3,"div",39),e.DNE(4,za,11,3,"div",40),e.k0s()()),2&i){const t=e.XpG();e.R7$(4),e.Y8G("ngForOf",t.currentRoleShares)}}function Cr(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",48),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onClose())}),e.EFF(1," Close "),e.k0s()}}let Bi=(()=>{class i{constructor(t,n,o,r){this._apiService=t,this._usersService=n,this._roleDataService=o,this._messagingService=r,this.report=null,this.visible=!1,this.closed=new e.bkB,this._destroyed$=new ue.B7,this.loading=!1,this.sharing=!1,this.shareMode="user",this.currentShares=[],this.currentRoleShares=[],this.selectedUser=null,this.selectedPermission=w.uG.View,this.canReshare=!1,this.selectedRole=null,this.userSearchTerm="",this.searchResults=[],this.searching=!1,this.roleSearchResults=[],this._allRoles=[],this._allUsers=[],this.permissionOptions=[{label:"View",value:w.uG.View},{label:"Edit",value:w.uG.Edit}]}ngOnInit(){this.report&&this.loadCurrentShares(),this.loadUsers(),this.loadRoles()}loadUsers(){this._usersService.getAll().pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this._allUsers=t},error:t=>{console.error("Error loading users:",t)}})}loadRoles(){this._roleDataService.getAll().pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this._allRoles=t},error:t=>{console.error("Error loading roles:",t)}})}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}loadCurrentShares(){this.report&&(this.loading=!0,this._apiService.getReportShares(this.report.adHocReportId).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:t=>{this.currentShares=t.userShares||[],this.currentRoleShares=t.roleShares||[]},error:t=>{console.error("Error loading shares:",t)}}))}onUserSearch(t){const n=(t.query||"").toLowerCase();this.searchResults=n.length<2?[]:this._allUsers.filter(o=>o.firstName?.toLowerCase().includes(n)||o.lastName?.toLowerCase().includes(n)||o.email?.toLowerCase().includes(n)).map(o=>({userId:o.email,displayName:`${o.firstName} ${o.lastName}`.trim(),email:o.email}))}onRoleSearch(t){const n=(t.query||"").toLowerCase();this.roleSearchResults=n.length<1?[...this._allRoles]:this._allRoles.filter(o=>o.name?.toLowerCase().includes(n))}onShare(){"user"===this.shareMode?this.onShareWithUser():this.onShareWithRole()}onShareWithUser(){this.report&&this.selectedUser?this.currentShares.find(o=>o.sharedWithUserId===this.selectedUser?.userId)?this._messagingService.warning("This report is already shared with this user","Already Shared"):(this.sharing=!0,this._apiService.shareReport(this.report.adHocReportId,{sharedWithUserId:this.selectedUser.userId,permission:this.selectedPermission,canReshare:this.canReshare}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.sharing=!1)).subscribe({next:()=>{this._messagingService.success("Report shared successfully","Success"),this.currentShares.push({shareId:"",adHocReportId:this.report.adHocReportId,sharedWithUserId:this.selectedUser.userId,sharedWithUserName:this.selectedUser.displayName,permission:this.selectedPermission,sharedBy:"",sharedDate:(new Date).toISOString(),canReshare:this.canReshare}),this.selectedUser=null,this.selectedPermission=w.uG.View,this.canReshare=!1},error:o=>
1{this._messagingService.error("Failed to share report","Error"),console.error("Error sharing report:",o)}})):this._messagingService.warning("Please select a user to share with","Validation")}onShareWithRole(){this.report&&this.selectedRole?this.currentRoleShares.find(o=>o.sharedWithRoleId===this.selectedRole?.id)?this._messagingService.warning("This report is already shared with this role","Already Shared"):(this.sharing=!0,this._apiService.shareReportWithRole(this.report.adHocReportId,{sharedWithRoleId:this.selectedRole.id,permission:this.selectedPermission,canReshare:this.canReshare}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.sharing=!1)).subscribe({next:()=>{this._messagingService.success("Report shared with role successfully","Success"),this.currentRoleShares.push({shareId:"",adHocReportId:this.report.adHocReportId,sharedWithRoleId:this.selectedRole.id,sharedWithRoleName:this.selectedRole.name||"",permission:this.selectedPermission,sharedBy:"",sharedDate:(new Date).toISOString(),canReshare:this.canReshare}),this.selectedRole=null,this.selectedPermission=w.uG.View,this.canReshare=!1},error:o=>{this._messagingService.error("Failed to share report with role","Error"),console.error("Error sharing report with role:",o)}})):this._messagingService.warning("Please select a role to share with","Validation")}onRemoveShare(t){this.report&&this._apiService.unshareReport(this.report.adHocReportId,t.sharedWithUserId).pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>{this._messagingService.success("Share removed successfully","Success"),this.currentShares=this.currentShares.filter(n=>n.sharedWithUserId!==t.sharedWithUserId)},error:n=>{this._messagingService.error("Failed to remove share","Error"),console.error("Error removing share:",n)}})}onRemoveRoleShare(t){this.report&&this._apiService.unshareReportRole(this.report.adHocReportId,t.sharedWithRoleId).pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>{this._messagingService.success("Role share removed successfully","Success"),this.currentRoleShares=this.currentRoleShares.filter(n=>n.sharedWithRoleId!==t.sharedWithRoleId)},error:n=>{this._messagingService.error("Failed to remove role share","Error"),console.error("Error removing role share:",n)}})}getPermissionLabel(t){return t===w.uG.Edit?"Edit":"View"}get hasAnyShares(){return this.currentShares.length>0||this.currentRoleShares.length>0}onClose(){this.closed.emit()}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ye.F),e.rXU(ce.gs),e.rXU(fr.E),e.rXU(q.Ui))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-share-report-dialog"]],inputs:{report:"report",visible:"visible"},outputs:{closed:"closed"},decls:34,vars:27,consts:[["header","Share Report",3,"visibleChange","onHide","visible","modal","closable"],[1,"share-dialog-content"],["class","report-info",4,"ngIf"],[1,"share-mode-toggle"],["type","button",1,"toggle-btn",3,"click"],[1,"mdi","mdi-account"],[1,"mdi","mdi-account-group"],[1,"share-form"],["class","form-field",4,"ngIf"],[1,"form-row"],[1,"form-field"],["optionLabel","label","optionValue","value",3,"ngModelChange","ngModel","options"],[1,"form-field","checkbox-field"],["inputId","canReshare",3,"ngModelChange","ngModel","binary"],["for","canReshare"],["type","button","title","Share",1,"button","button_colorSuccess",3,"click","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-share-variant buttonIcon_right",4,"ngIf"],[1,"current-shares"],["class","loading",4,"ngIf"],["class","no-shares",4,"ngIf"],["class","shares-section",4,"ngIf"],["pTemplate","footer"],[1,"report-info"],[1,"report-name"],["field","displayName","placeholder","Search for a user...",3,"ngModelChange","completeMethod","ngModel","suggestions","dropdown"],["pTemplate","item"],[1,"user-item"],[1,"user-name"],[1,"user-email"],["field","name","placeholder","Search for a role...",3,"ngModelChange","completeMethod","ngModel","suggestions","dropdown"],[1,"role-item"],[1,"role-name"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-share-variant","buttonIcon_right"],[1,"loading"],["type","pulsing","size","small"],[1,"no-shares"],[1,"shares-section"],[1,"shares-list"],["class","share-item",4,"ngFor","ngForOf"],[1,"share-item"],[1,"share-user"],[1,"user-info"],[1,"share-meta"],[4,"ngIf"],["type","button","title","Remove share","pTooltip","Remove",1,"button","button_round","remove-share-btn",3,"click"],[1,"mdi","mdi-trash-can"],["type","button","title","Close",1,"button","button_clear","button_colorAlt",3,"click"]],template:function(n,o){1&n&&(e.j41(0,"p-dialog",0),e.mxI("visibleChange",function(s){return e.DH7(o.visible,s)||(o.visible=s),s}),e.bIt("onHide",function(){return o.onClose()}),e.j41(1,"div",1),e.DNE(2,Ua,3,1,"div",2),e.j41(3,"div",3)(4,"button",4),e.bIt("click",function(){return o.shareMode="user"}),e.nrm(5,"i",5),e.EFF(6," User "),e.k0s(),e.j41(7,"button",4),e.bIt("click",function(){return o.shareMode="role"}),e.nrm(8,"i",6),e.EFF(9," Role "),e.k0s()(),e.j41(10,"div",7),e.DNE(11,ri,5,6,"div",8)(12,Ya,5,6,"div",8),e.j41(13,"div",9)(14,"div",10)(15,"label"),e.EFF(16,"Permission"),e.k0s(),e.j41(17,"p-dropdown",11),e.mxI("ngModelChange",function(s){return e.DH7(o.selectedPermission,s)||(o.selectedPermission=s),s}),e.k0s()(),e.j41(18,"div",12)(19,"p-checkbox",13),e.mxI("ngModelChange",function(s){return e.DH7(o.canReshare,s)||(o.c
1anReshare=s),s}),e.k0s(),e.j41(20,"label",14),e.EFF(21,"Allow resharing"),e.k0s()()(),e.j41(22,"button",15),e.bIt("click",function(){return o.onShare()}),e.DNE(23,Ha,1,0,"i",16)(24,Xa,1,0,"i",17),e.EFF(25," Share "),e.k0s()(),e.j41(26,"div",18)(27,"h4"),e.EFF(28,"Currently Shared With"),e.k0s(),e.DNE(29,Ft,2,0,"div",19)(30,xn,2,0,"div",20)(31,tt,5,1,"div",21)(32,Ka,5,1,"div",21),e.k0s()(),e.DNE(33,Cr,2,0,"ng-template",22),e.k0s()),2&n&&(e.Aen(e.lJ4(25,ii)),e.R50("visible",o.visible),e.Y8G("modal",!0)("closable",!0),e.R7$(2),e.Y8G("ngIf",o.report),e.R7$(2),e.AVh("active","user"===o.shareMode),e.R7$(3),e.AVh("active","role"===o.shareMode),e.R7$(4),e.Y8G("ngIf","user"===o.shareMode),e.R7$(),e.Y8G("ngIf","role"===o.shareMode),e.R7$(5),e.Aen(e.lJ4(26,oi)),e.R50("ngModel",o.selectedPermission),e.Y8G("options",o.permissionOptions),e.R7$(2),e.R50("ngModel",o.canReshare),e.Y8G("binary",!0),e.R7$(3),e.Y8G("disabled",("user"===o.shareMode?!o.selectedUser:!o.selectedRole)||o.sharing),e.R7$(),e.Y8G("ngIf",o.sharing),e.R7$(),e.Y8G("ngIf",!o.sharing),e.R7$(5),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading&&!o.hasAnyShares),e.R7$(),e.Y8G("ngIf",!o.loading&&o.currentShares.length>0),e.R7$(),e.Y8G("ngIf",!o.loading&&o.currentRoleShares.length>0))},dependencies:[M.Sq,M.bT,R.BC,R.vS,ke.Ei,ft.j9,ut.Sc,_t.l,Le.ms,Mt.m,ee.C3,ze.VU],styles:[".share-dialog-content[_ngcontent-%COMP%]   .report-info[_ngcontent-%COMP%]{padding:12px;background:#fafafa;border-radius:4px;margin-bottom:20px}.share-dialog-content[_ngcontent-%COMP%]   .report-info[_ngcontent-%COMP%]   .report-name[_ngcontent-%COMP%]{font-weight:600;color:#000}.share-dialog-content[_ngcontent-%COMP%]   .share-mode-toggle[_ngcontent-%COMP%]{display:flex;margin-bottom:16px;border:1px solid #dedede;border-radius:4px;overflow:hidden}.share-dialog-content[_ngcontent-%COMP%]   .share-mode-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]{flex:1;padding:8px 16px;border:none;background:#fff;cursor:pointer;font-size:14px;font-weight:500;color:#7b7b7b;display:flex;align-items:center;justify-content:center;gap:6px;transition:background-color .2s,color .2s}.share-dialog-content[_ngcontent-%COMP%]   .share-mode-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]:first-child{border-right:1px solid #dedede}.share-dialog-content[_ngcontent-%COMP%]   .share-mode-toggle[_ngcontent-%COMP%]   .toggle-btn.active[_ngcontent-%COMP%]{background:#5f84fc;color:#fff}.share-dialog-content[_ngcontent-%COMP%]   .share-mode-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]:not(.active):hover{background:#fafafa}.share-dialog-content[_ngcontent-%COMP%]   .share-mode-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:16px}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]{margin-bottom:24px;padding-bottom:24px;border-bottom:1px solid #dedede}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-field[_ngcontent-%COMP%]{margin-bottom:16px}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:6px;font-weight:500;font-size:14px;color:#000}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-field[_ngcontent-%COMP%]     .p-autocomplete, .share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-field[_ngcontent-%COMP%]     .p-dropdown{width:100%}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-row[_ngcontent-%COMP%]{display:flex;gap:16px;align-items:flex-end}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-row[_ngcontent-%COMP%]   .form-field[_ngcontent-%COMP%]{flex:1}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-row[_ngcontent-%COMP%]   .checkbox-field[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding-bottom:8px}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   .form-row[_ngcontent-%COMP%]   .checkbox-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0;font-weight:400;cursor:pointer}.share-dialog-content[_ngcontent-%COMP%]   .share-form[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{margin-top:8px}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   h4[_ng
1content-%COMP%]{margin:0 0 12px;font-size:14px;font-weight:600;color:#000}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .loading[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:20px}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .no-shares[_ngcontent-%COMP%]{padding:16px;text-align:center;color:#7b7b7b;font-size:14px;background:#fafafa;border-radius:4px}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-section[_ngcontent-%COMP%]{margin-bottom:16px}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-section[_ngcontent-%COMP%]:last-child{margin-bottom:0}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-section[_ngcontent-%COMP%]   h5[_ngcontent-%COMP%]{margin:0 0 8px;font-size:12px;font-weight:600;color:#7b7b7b;text-transform:uppercase;letter-spacing:.5px}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border:1px solid #dedede;border-radius:4px;margin-bottom:8px}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]:last-child{margin-bottom:0}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]   .remove-share-btn[_ngcontent-%COMP%]{color:#0009;background:none;border:none}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]   .remove-share-btn[_ngcontent-%COMP%]:hover{color:#000000de}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]   .share-user[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]   .share-user[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:16px;color:#7b7b7b}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]   .share-user[_ngcontent-%COMP%]   .user-info[_ngcontent-%COMP%]   .user-name[_ngcontent-%COMP%]{display:block;font-weight:500;font-size:14px;color:#000}.share-dialog-content[_ngcontent-%COMP%]   .current-shares[_ngcontent-%COMP%]   .shares-list[_ngcontent-%COMP%]   .share-item[_ngcontent-%COMP%]   .share-user[_ngcontent-%COMP%]   .user-info[_ngcontent-%COMP%]   .share-meta[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b}.user-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:4px 0}.user-item[_ngcontent-%COMP%]   .user-name[_ngcontent-%COMP%]{font-weight:500;color:#000}.user-item[_ngcontent-%COMP%]   .user-email[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b}.role-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:4px 0}.role-item[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:16px;color:#7b7b7b}.role-item[_ngcontent-%COMP%]   .role-name[_ngcontent-%COMP%]{font-weight:500;color:#000}"]})}}return i})();var nt=F(73955);const At=()=>({width:"650px"}),en=()=>({fontSize:"10px"}),mn=i=>({days:i});function Ja(i,a){1&i&&(e.nrm(0,"p-tag",35),e.nI1(1,"translate")),2&i&&(e.Aen(e.lJ4(5,en)),e.Y8G("value",e.bMT(1,3,"AD_HOC_REPORTS.CREATE_MODAL.SYSTEM")))}function ai(i,a){if(1&i&&(e.j41(0,"span"),e.nrm(1,"i",18),e.EFF(2),e.nI1(3,"translate"),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",e.i5U(3,1,"AD_HOC_REPORTS.CREATE_MODAL.LAST_DAYS",e.eq3(4,mn,t.defaultDateRangeDays))," ")}}function vr(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",27),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2);return e.Njj(r.onSelectTemplate(o))}),e.j41(1,"div",28),e.nrm(2,"i",29),e.k0s(),e.j41(3,"div",8)(4,"div",30)(5,"h4"),e.EFF(6),e.k0s(),e.DNE(7,Ja,2,6,"p-tag",31),e.k0s(),e.j41(8,"p"),e.EFF(9),e.k0s(),e.j41(10,"div",32)(11,"span"),e.nrm(12,"i",33),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.DNE(15,ai,4,6,"span",34),e.k0s()(),e.j41(16,"div",10),e.nrm(17,"i"),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG(2);e.AVh("selected",(null==n.selectedTemplate?null:n.selectedTemplate.templateId)===t.templateId),e.R7$(6),e.JRh(t.name),e.R7$(),e.Y8G("ngIf",t.isSystemTemplate),e.R7$(2),e.JRh(t.description),e.R7$(4),e.SpI(" ",e.bMT(14,9,n.getEntityTypeLabel(t.entityType)),""),e.R7$(2),e.Y8G("ngIf",t.defaultDateRangeDays),e.R7$(2),e.HbH((null==n.selectedTemplate?null:n.selectedTemplate.templateId)===t.templateId?"mdi mdi-check-circle":"mdi mdi-circle-outline")}}function br(i,a){if(1&i&&(e.j41(0,"div",25)(1,"h5",3),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,vr,18,11,"div",26),e.k0s()),2&i){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"AD_HOC_REPORTS.CREATE_MODAL.OR_CHOOSE_TEMPLATE")),e.R7$(2),e.Y8G("ngForOf",t.templates)}}function qa(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",38),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onCreatePivotGrid())}),e.nrm(2,"i",39),e.EFF(3),e.nI1(4,"translate"),e.k0s()}
12&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_PIVOT")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_PIVOT")," "))}function gn(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",38),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onCreateDashboard())}),e.nrm(2,"i",40),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_DASHBOARD")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_DASHBOARD")," "))}function Fn(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",38),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onCreateDataGrid())}),e.nrm(2,"i",41),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_DATA_GRID")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_DATA_GRID")," "))}function Tr(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",38),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onCreateCalendar())}),e.nrm(2,"i",42),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_CALENDAR")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_CALENDAR")," "))}function Er(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",38),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onCreateGantt())}),e.nrm(2,"i",43),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_GANTT")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.CREATE_MODAL.CREATE_GANTT")," "))}function Ct(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",38),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onUseTemplate())}),e.nrm(2,"i",44),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.CREATE_MODAL.USE_TEMPLATE")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.CREATE_MODAL.USE_TEMPLATE")," "))}function it(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",36),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onClose())}),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,qa,5,6,"button",37)(5,gn,5,6,"button",37)(6,Fn,5,6,"button",37)(7,Tr,5,6,"button",37)(8,Er,5,6,"button",37)(9,Ct,5,6,"button",37)}if(2&i){const t=e.XpG();e.Y8G("title",e.bMT(1,8,"GENERAL.CANCEL")),e.R7$(2),e.SpI(" ",e.bMT(3,10,"GENERAL.CANCEL")," "),e.R7$(2),e.Y8G("ngIf","pivot"===t.selectedReportType&&null===t.selectedTemplate),e.R7$(),e.Y8G("ngIf","dashboard"===t.selectedReportType),e.R7$(),e.Y8G("ngIf","datagrid"===t.selectedReportType),e.R7$(),e.Y8G("ngIf","calendar"===t.selectedReportType),e.R7$(),e.Y8G("ngIf","gantt"===t.selectedReportType),e.R7$(),e.Y8G("ngIf","pivot"===t.selectedReportType&&null!==t.selectedTemplate)}}let ji=(()=>{class i{constructor(){this.templates=[],this.visible=!1,this.selected=new e.bkB,this.closed=new e.bkB,this.selectedReportType="pivot",this.selectedTemplate=null}onSelectReportType(t){this.selectedReportType=t,this.selectedTemplate=null}onSelectTemplate(t){this.selectedTemplate=t}onCreatePivotGrid(){this.selected.emit({type:"pivot",template:null})}onCreateDashboard(){this.selected.emit({type:"dashboard",template:null})}onCreateDataGrid(){this.selected.emit({type:"datagrid",template:null})}onCreateCalendar(){this.selected.emit({type:"calendar",template:null})}onCreateGantt(){this.selected.emit({type:"gantt",template:null})}onUseTemplate(){this.selected.emit({type:"pivot",template:this.selectedTemplate})}onClose(){this.selectedReportType="pivot",this.selectedTemplate=null,this.closed.emit()}getEntityTypeLabel(t){switch(t){case w.dX.Workflow:return"AD_HOC_REPORTS.ENTITY_TYPES.WORKFLOW";case w.dX.MasterData:return"AD_HOC_REPORTS.ENTITY_TYPES.MASTER_DATA";case w.dX.Documents:return"AD_HOC_REPORTS.ENTITY_TYPES.DOCUMENTS";case w.dX.SystemData:return"AD_HOC_REPORTS.ENTITY_TYPES.SYSTEM_DATA";default:return"GENERAL.UNKNOWN"}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-template-picker"]],inputs:{templates:"templates",visible:"visible"},outputs:{selected:"selected",closed:"closed"},decls:72,vars:66,consts:[[3,"visibleChange","onHide","header","visible","modal","closable"],[1,"template-picker-content"],[1,"subtitle"],[1,"section-header"],[1,"report-types-grid"],[1,"report-type-card",3,"click"],[1,"card-icon","pivot-icon"],[1,"mdi","mdi-table"],[1,"card-content"],[1,"pivot-label"],[1,"card-select"],[1,"card-icon","dashboard-icon"],[1,"mdi","mdi-view-dashboard"],[1,"dashboard-label"],[1,"card-icon","datagrid-icon"],[1,"mdi","mdi-table-large"],[1,"datagrid-label"],[1,"card-icon","calendar-icon"],[1,"mdi","mdi-calendar"],[1,"calendar-label"],[1,"card-icon","gantt-icon"],[1,"mdi","mdi-chart-gantt"],[1,"gantt
1-label"],["class","templates-section",4,"ngIf"],["pTemplate","footer"],[1,"templates-section"],["class","template-card",3,"selected","click",4,"ngFor","ngForOf"],[1,"template-card",3,"click"],[1,"card-icon","template-icon"],[1,"mdi","mdi-file-document"],[1,"card-header"],["severity","info",3,"value","style",4,"ngIf"],[1,"card-meta"],[1,"mdi","mdi-tag"],[4,"ngIf"],["severity","info",3,"value"],["type","button",1,"button","button_clear","button_colorAlt",3,"click","title"],["type","button","class","button button_colorSuccess",3,"title","click",4,"ngIf"],["type","button",1,"button","button_colorSuccess",3,"click","title"],[1,"mdi","mdi-table","buttonIcon_right"],[1,"mdi","mdi-view-dashboard","buttonIcon_right"],[1,"mdi","mdi-table-large","buttonIcon_right"],[1,"mdi","mdi-calendar","buttonIcon_right"],[1,"mdi","mdi-chart-gantt","buttonIcon_right"],[1,"mdi","mdi-check","buttonIcon_right"]],template:function(n,o){1&n&&(e.j41(0,"p-dialog",0),e.nI1(1,"translate"),e.mxI("visibleChange",function(s){return e.DH7(o.visible,s)||(o.visible=s),s}),e.bIt("onHide",function(){return o.onClose()}),e.j41(2,"div",1)(3,"p",2),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"h5",3),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.j41(9,"div",4)(10,"div",5),e.bIt("click",function(){return o.onSelectReportType("pivot")}),e.j41(11,"div",6),e.nrm(12,"i",7),e.k0s(),e.j41(13,"div",8)(14,"h4",9),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"p"),e.EFF(18),e.nI1(19,"translate"),e.k0s()(),e.j41(20,"div",10),e.nrm(21,"i"),e.k0s()(),e.j41(22,"div",5),e.bIt("click",function(){return o.onSelectReportType("dashboard")}),e.j41(23,"div",11),e.nrm(24,"i",12),e.k0s(),e.j41(25,"div",8)(26,"h4",13),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"p"),e.EFF(30),e.nI1(31,"translate"),e.k0s()(),e.j41(32,"div",10),e.nrm(33,"i"),e.k0s()(),e.j41(34,"div",5),e.bIt("click",function(){return o.onSelectReportType("datagrid")}),e.j41(35,"div",14),e.nrm(36,"i",15),e.k0s(),e.j41(37,"div",8)(38,"h4",16),e.EFF(39),e.nI1(40,"translate"),e.k0s(),e.j41(41,"p"),e.EFF(42),e.nI1(43,"translate"),e.k0s()(),e.j41(44,"div",10),e.nrm(45,"i"),e.k0s()(),e.j41(46,"div",5),e.bIt("click",function(){return o.onSelectReportType("calendar")}),e.j41(47,"div",17),e.nrm(48,"i",18),e.k0s(),e.j41(49,"div",8)(50,"h4",19),e.EFF(51),e.nI1(52,"translate"),e.k0s(),e.j41(53,"p"),e.EFF(54),e.nI1(55,"translate"),e.k0s()(),e.j41(56,"div",10),e.nrm(57,"i"),e.k0s()(),e.j41(58,"div",5),e.bIt("click",function(){return o.onSelectReportType("gantt")}),e.j41(59,"div",20),e.nrm(60,"i",21),e.k0s(),e.j41(61,"div",8)(62,"h4",22),e.EFF(63),e.nI1(64,"translate"),e.k0s(),e.j41(65,"p"),e.EFF(66),e.nI1(67,"translate"),e.k0s()(),e.j41(68,"div",10),e.nrm(69,"i"),e.k0s()()(),e.DNE(70,br,5,4,"div",23),e.k0s(),e.DNE(71,it,10,12,"ng-template",24),e.k0s()),2&n&&(e.Aen(e.lJ4(65,At)),e.Y8G("header",e.bMT(1,39,"AD_HOC_REPORTS.CREATE_MODAL.TITLE")),e.R50("visible",o.visible),e.Y8G("modal",!0)("closable",!0),e.R7$(4),e.SpI(" ",e.bMT(5,41,"AD_HOC_REPORTS.CREATE_MODAL.SUBTITLE")," "),e.R7$(3),e.JRh(e.bMT(8,43,"AD_HOC_REPORTS.CREATE_MODAL.REPORT_TYPES_LABEL")),e.R7$(3),e.AVh("selected","pivot"===o.selectedReportType&&null===o.selectedTemplate),e.R7$(5),e.JRh(e.bMT(16,45,"AD_HOC_REPORTS.CREATE_MODAL.TYPES.PIVOT_GRID")),e.R7$(3),e.JRh(e.bMT(19,47,"AD_HOC_REPORTS.CREATE_MODAL.DESCRIPTIONS.PIVOT_GRID")),e.R7$(3),e.HbH("pivot"===o.selectedReportType&&null===o.selectedTemplate?"mdi mdi-check-circle":"mdi mdi-circle-outline"),e.R7$(),e.AVh("selected","dashboard"===o.selectedReportType),e.R7$(5),e.JRh(e.bMT(28,49,"AD_HOC_REPORTS.CREATE_MODAL.TYPES.DASHBOARD")),e.R7$(3),e.JRh(e.bMT(31,51,"AD_HOC_REPORTS.CREATE_MODAL.DESCRIPTIONS.DASHBOARD")),e.R7$(3),e.HbH("dashboard"===o.selectedReportType?"mdi mdi-check-circle":"mdi mdi-circle-outline"),e.R7$(),e.AVh("selected","datagrid"===o.selectedReportType),e.R7$(5),e.JRh(e.bMT(40,53,"AD_HOC_REPORTS.CREATE_MODAL.TYPES.DATA_GRID")),e.R7$(3),e.JRh(e.bMT(43,55,"AD_HOC_REPORTS.CREATE_MODAL.DESCRIPTIONS.DATA_GRID")),e.R7$(3),e.HbH("datagrid"===o.selectedReportType?"mdi mdi-check-circle":"mdi mdi-circle-outline"),e.R7$(),e.AVh("selected","calendar"===o.selectedReportType),e.R7$(5),e.JRh(e.bMT(52,57,"AD_HOC_REPORTS.CREATE_MODAL.TYPES.CALENDAR")),e.R7$(3),e.JRh(e.bMT(55,59,"AD_HOC_REPORTS.CREATE_MODAL.DESCRIPTIONS.CALENDAR")),e.R7$(3),e.HbH("calendar"===o.selectedReportType?"mdi mdi-check-circle":"mdi mdi-circle-outline"),e.R7$(),e.AVh("selected","gantt"===o.selectedReportType),e.R7$(5),e.JRh(e.bMT(64,61,"AD_HOC_REPORTS.CREATE_MODAL.TYPES.GANTT")),e.R7$(3),e.JRh(e.bMT(67,63,"AD_HOC_REPORTS.CREATE_MODAL.DESCRIPTIONS.GANTT")),e.R7$(3),e.HbH("gantt"===o.selectedReportType?"mdi mdi-check-circle":"mdi mdi-circle-outline"),e.R7$(),e.Y8G("ngIf","pivot"===o.selectedReportType&&o.templates.length>0))},dependencies:[M.Sq,M.bT,ke.Ei,_t.l,ni.v,nt.D9],styles:[".template-picker-content[_ngcontent-%COMP%]   .subtitle[_ngcontent-%COMP%]{margin:0 0 20px;color:#7b7b7b;font-size:14px}.template-picker-content[_ngcontent-%COMP%]   .section-header[_ngcontent-%COMP%]{margin:0 0 12px;font-size:13px;font-weight:600;color:#7b7b7b;text-transform:uppercase;letter-spacing:.5px}.template-picker-content[_ngcontent-%COMP%]   .report-types-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:12px;padding:16px;border:2px solid #dedede;border-radius:8px;
1cursor:pointer;transition:all .2s}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]:hover{border-color:#c5c5c5;background:#fafafa}.template-picker-content[_ngcontent-%COMP%]   .report-type-card.selected[_ngcontent-%COMP%]{border-color:#5f84fc;background:#0000000f}.template-picker-content[_ngcontent-%COMP%]   .report-type-card.selected[_ngcontent-%COMP%]   .card-select[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#5f84fc}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon[_ngcontent-%COMP%]{flex-shrink:0;width:44px;height:44px;display:flex;align-items:center;justify-content:center;border-radius:8px}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:20px}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.pivot-icon[_ngcontent-%COMP%]{background:#0080ff}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.pivot-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#fff}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.dashboard-icon[_ngcontent-%COMP%]{background:#00ce7e}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.dashboard-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#fff}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.datagrid-icon[_ngcontent-%COMP%]{background:#e82077}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.datagrid-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#fff}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.calendar-icon[_ngcontent-%COMP%]{background:#0d2c54}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.calendar-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#fff}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.gantt-icon[_ngcontent-%COMP%]{background:#f97316}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-icon.gantt-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#fff}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]{flex:1;min-width:0}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{margin:0 0 4px;font-size:14px;font-weight:600;color:#000}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   h4.pivot-label[_ngcontent-%COMP%]{color:#0080ff}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   h4.dashboard-label[_ngcontent-%COMP%]{color:#00ce7e}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   h4.datagrid-label[_ngcontent-%COMP%]{color:#e82077}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   h4.calendar-label[_ngcontent-%COMP%]{color:#0d2c54}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   h4.gantt-label[_ngcontent-%COMP%]{color:#f97316}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;font-size:12px;color:#7b7b7b;line-height:1.4}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-select[_ngcontent-%COMP%]{flex-shrink:0;align-self:center}.template-picker-content[_ngcontent-%COMP%]   .report-type-card[_ngcontent-%COMP%]   .card-select[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:18px;color:#dedede}.template-picker-content[_ngcontent-%COMP%]   .templates-section[_ngcontent-%COMP%]{margin-top:16px;padding-top:16px;border-top:1px solid #dedede}.template-picker-content[_ngcontent-%COMP%]   .templates-section[_ngcontent-%COMP%]   h5[_ngcontent-%COMP%]{margin:0 0 12px;font-size:13px;font-weight:600;color:#7b7b7b;text-transform:uppercase;letter-spacing:.5px}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:16px;padding:16px;border:2px solid #dedede;border-radius:8px;margin-bottom:12px;cursor:pointer;transition:all .2s}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]:hover{border-color:#c5c5c5;background:#fafafa}.template-picker-content[_ngcontent-%COMP%]   .template-card.selected[_ngcontent-%COMP%]{border-color:#5f84fc;background:#0000000f}.template-picker-content[_ngcontent-%COMP%]   .template-card.selected[_ngcontent-%COMP%]   .card-select[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#5f84fc}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-icon[_ngcontent-%COMP%]{flex-shrink:0;width:48px;height:48px;display:flex;align-items:center;justify-content:center;border-radius:8px}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:24px}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-icon.template-icon[_ngcontent-%COMP%]{background:#fff3e0}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-icon.template-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#e65100}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]{flex:1;min-width:0}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:4px}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   h4[_ng
1content-%COMP%]{margin:0;font-size:15px;font-weight:600;color:#000}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 8px;font-size:13px;color:#7b7b7b;line-height:1.4}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .card-meta[_ngcontent-%COMP%]{display:flex;gap:16px;font-size:12px;color:#7b7b7b}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .card-meta[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .card-meta[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:11px}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-select[_ngcontent-%COMP%]{flex-shrink:0}.template-picker-content[_ngcontent-%COMP%]   .template-card[_ngcontent-%COMP%]   .card-select[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:20px;color:#dedede}"]})}}return i})();const si=()=>({"min-width":"150px"}),Vi=()=>({backgroundColor:"#7b7b7b",color:"#fff",fontSize:"11px"}),Sr=()=>({backgroundColor:"#6366f1",color:"#fff"});function hn(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",13),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onNewReport())}),e.nrm(2,"i",14),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.NEW_REPORT")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.NEW_REPORT")," "))}function fn(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",13),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onNewDataSet())}),e.nrm(2,"i",14),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.BUTTONS.NEW_DATA_SET")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.BUTTONS.NEW_DATA_SET")," "))}function $i(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",13),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onNewForm())}),e.nrm(2,"i",14),e.EFF(3),e.nI1(4,"translate"),e.k0s()}2&i&&(e.Y8G("title",e.bMT(1,2,"AD_HOC_REPORTS.BUTTONS.NEW_FORM")),e.R7$(3),e.SpI(" ",e.bMT(4,4,"AD_HOC_REPORTS.BUTTONS.NEW_FORM")," "))}function li(i,a){1&i&&(e.j41(0,"div",15),e.nrm(1,"kendo-loader",16),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"AD_HOC_REPORTS.LOADING")))}function Qa(i,a){if(1&i&&(e.nrm(0,"i",22),e.j41(1,"span",23),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",24),e.EFF(5),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"AD_HOC_REPORTS.TABS.MY_REPORTS")),e.R7$(3),e.JRh(t.filteredMyReports.length)}}function Za(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",25),e.nrm(1,"i",26),e.j41(2,"h3"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"button",27),e.nI1(9,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onNewReport())}),e.nrm(10,"i",14),e.EFF(11),e.nI1(12,"translate"),e.k0s()()}2&i&&(e.R7$(3),e.JRh(e.bMT(4,4,"AD_HOC_REPORTS.EMPTY.TITLE")),e.R7$(3),e.JRh(e.bMT(7,6,"AD_HOC_REPORTS.EMPTY.SUBTITLE")),e.R7$(2),e.Y8G("title",e.bMT(9,8,"AD_HOC_REPORTS.EMPTY.CTA")),e.R7$(3),e.SpI(" ",e.bMT(12,10,"AD_HOC_REPORTS.EMPTY.CTA")," "))}function es(i,a){1&i&&e.nrm(0,"p-tag",41)}function kr(i,a){if(1&i&&(e.j41(0,"div",38),e.nrm(1,"p-tag",39),e.nI1(2,"translate"),e.DNE(3,es,1,0,"p-tag",40),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(),e.Aen(n.getVisualizationTypeTagStyle(t.visualizationType)),e.Y8G("value",e.bMT(2,5,n.getVisualizationTypeLabel(t.visualizationType)))("icon",n.getVisualizationTypeIcon(t.visualizationType)),e.R7$(2),e.Y8G("ngIf",t.isTemplate)}}function ts(i,a){if(1&i&&(e.j41(0,"span"),e.nrm(1,"i",42),e.EFF(2),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",t.workflowTypeName," ")}}function ns(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",54),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(3);return e.Njj(r.onEditReport(o))}),e.nrm(1,"i",55),e.k0s()}}function Rr(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",56),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(3);return e.Njj(r.onDeleteReport(o))}),e.nrm(1,"i",57),e.k0s()}}function is(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",43)(1,"button",44),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onOpenReport(o))}),e.nrm(2,"i",45),e.k0s(),e.DNE(3,ns,2,0,"button",46),e.j41(4,"button",47),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onShareReport(o))}),e.nrm(5,"i",48),e.k0s(),e.j41(6,"button",49),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onCopyReport(o))}),e.nrm(7,"i",50),e.k0s(),e.DNE(8,Rr,2,0,"button",51),e.j41(9,"div",52),e.nrm(10,"p-tag",53),e.nI1(11,"translate"),e.k0s()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(3),e.Y8G("ngIf",!t.isReadOnly),e.R7$(5),e.Y8G("ngIf",!t.isReadOnly),e.R7$(2),e.Aen(e.lJ4(7,Vi)),e.Y8G("value",e.bMT(11,5,n.getEntityTypeLabel(t.entityType)))}}function Cn(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",30),e.DNE(1,kr,4,7,"ng-template",19),e.j41(2,"div",31),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return e.Njj(r.onOpenReport(o))}),e.j41(3,"h4",32),e.EFF(4),e.k0s(),e.j41(5,"p",33),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"div",34),e.DNE(9,ts,3,1,"span",35),e.j41(10,"span"),e.nrm(11,"i",36),e.EFF(12),e.k0s()()(),e.DNE(13,is,12,8,"ng-template",37),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(4),e.JRh(t.name),e.R7$(2),e.JRh(t.description||e.bMT(7,4,"AD_HOC_REPORTS.NO_DESCRIPTION")),e.R7$(3),e.Y8G("ngIf",t.workflowTypeName),e.R7$(3),e.SpI(" ",n.formatDate(t.modifiedDate)," ")}}function Ir(i,a){if(1&i&&(e.j41(0,"div",28),e.DNE(1,Cn,14,6,"p-card",29),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.filteredMyReports)}}function Ui(i,a){if(1&i&&(e.nrm(0,"i",58),e.j41(1,"span",23),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",24),e.EFF(5),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"AD_HOC_REPORTS.TABS.SHARED_WITH_ME")),e.R7$(3),e.JRh(t.filteredSharedReports.length)}}function Yi(i,a){1&i&&(e.j41(0,"div",25),e.nrm(1,"i",48),e.j41(2,"h3"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"AD_HOC_REPORTS.SHARED.EMPTY_TITLE")),e.R7$(3),e.JRh(e.bMT(7,4,"AD_HOC_REPORTS.SHARED.EMPTY_SUBTITLE")))}function di(i,a){if(1&i&&(e.j41(0,"div",38),e.nrm(1,"p-tag",39),e.nI1(2,"translate"),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(),e.Aen(n.getVisualizationTypeTagStyle(t.visualizationType)),e.Y8G("value",e.bMT(2,4,n.getVisualizationTypeLabel(t.visualizationType)))("icon",n.getVisualizationTypeIcon(t.visualizationType))}}function yr(i,a){if(1&i&&(e.j41(0,"span"),e.nrm(1,"i",42),e.EFF(2),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",t.workflowTypeName," ")}}function os(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",54),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(3);return e.Njj(r.onEditReport(o))}),e.nrm(1,"i",55),e.k0s()}}function Pn(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",43)(1,"button",44),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onOpenReport(o))}),e.nrm(2,"i",45),e.k0s(),e.DNE(3,os,2,0,"button",46),e.j41(4,"div",52),e.nrm(5,"p-tag",53),e.nI1(6,"translate"),e.k0s()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(3),e.Y8G("ngIf",!t.isReadOnly),e.R7$(2),e.Aen(e.lJ4(6,Vi)),e.Y8G("value",e.bMT(6,4,n.getEntityTypeLabel(t.entityType)))}}function wr(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",30),e.DNE(1,di,3,6,"ng-template",19),e.j41(2,"div",31),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return e.Njj(r.onOpenReport(o))}),e.j41(3,"h4",32),e.EFF(4),e.k0s(),e.j41(5,"p",33),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"div",34),e.DNE(9,yr,3,1,"span",35),e.j41(10,"span"),e.nrm(11,"i",36),e.EFF(12),e.k0s()(),e.j41(13,"div",59),e.EFF(14),e.nI1(15,"translate"),e.k0s()(),e.DNE(16,Pn,7,7,"ng-template",37),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(4),e.JRh(t.name),e.R7$(2),e.JRh(t.description||e.bMT(7,6,"AD_HOC_REPORTS.NO_DESCRIPTION")),e.R7$(3),e.Y8G("ngIf",t.workflowTypeName),e.R7$(3),e.SpI(" ",n.formatDate(t.modifiedDate)," "),e.R7$(2),e.Lme("",e.bMT(15,8,"AD_HOC_REPORTS.SHARED.SHARED_BY")," ",t.ownerName,"")}}function Dr(i,a){if(1&i&&(e.j41(0,"div",28),e.DNE(1,wr,17,10,"p-card",29),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.filteredSharedReports)}}function Or(i,a){if(1&i&&(e.nrm(0,"i",60),e.j41(1,"span",23),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",24),e.EFF(5),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"AD_HOC_REPORTS.TABS.DATA_SETS")),e.R7$(3),e.JRh(t.filteredDataSets.length)}}function xr(i,a){1&i&&(e.j41(0,"div",25),e.nrm(1,"i",61),e.j41(2,"h3"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"AD_HOC_REPORTS.DATA_SETS.E
1MPTY_TITLE")),e.R7$(3),e.JRh(e.bMT(7,4,"AD_HOC_REPORTS.DATA_SETS.EMPTY_SUBTITLE")))}function rs(i,a){1&i&&(e.j41(0,"div",38),e.nrm(1,"p-tag",62),e.k0s())}function Hi(i,a){if(1&i&&(e.j41(0,"span"),e.nrm(1,"i",63),e.EFF(2),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",t.primaryElementName," ")}}function as(i,a){if(1&i&&(e.j41(0,"span"),e.nrm(1,"i",64),e.EFF(2),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",t.joinedElementName," ")}}function ss(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",43)(1,"button",65),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onEditDataSet(o))}),e.nrm(2,"i",55),e.k0s(),e.j41(3,"button",66),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onDeleteDataSet(o))}),e.nrm(4,"i",57),e.k0s()()}}function Mr(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",30),e.DNE(1,rs,2,0,"ng-template",19),e.j41(2,"div",31),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return e.Njj(r.onEditDataSet(o))}),e.j41(3,"h4",32),e.EFF(4),e.k0s(),e.j41(5,"p",33),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"div",34),e.DNE(9,Hi,3,1,"span",35)(10,as,3,1,"span",35),e.j41(11,"span"),e.nrm(12,"i",36),e.EFF(13),e.k0s()()(),e.DNE(14,ss,5,0,"ng-template",37),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(4),e.JRh(t.name),e.R7$(2),e.JRh(t.description||e.bMT(7,5,"AD_HOC_REPORTS.NO_DESCRIPTION")),e.R7$(3),e.Y8G("ngIf",t.primaryElementName),e.R7$(),e.Y8G("ngIf",t.joinedElementName),e.R7$(3),e.SpI(" ",n.formatDate(t.modifiedDate)," ")}}function Fr(i,a){if(1&i&&(e.j41(0,"div",28),e.DNE(1,Mr,15,7,"p-card",29),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.filteredDataSets)}}function Xi(i,a){if(1&i&&(e.nrm(0,"i",67),e.j41(1,"span",23),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"span",24),e.EFF(5),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,2,"AD_HOC_REPORTS.TABS.FORMS")),e.R7$(3),e.JRh(t.filteredForms.length)}}function Pr(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",25),e.nrm(1,"i",68),e.j41(2,"h3"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"button",27),e.nI1(9,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onNewForm())}),e.nrm(10,"i",14),e.EFF(11),e.nI1(12,"translate"),e.k0s()()}2&i&&(e.R7$(3),e.JRh(e.bMT(4,4,"AD_HOC_REPORTS.FORMS.EMPTY_TITLE")),e.R7$(3),e.JRh(e.bMT(7,6,"AD_HOC_REPORTS.FORMS.EMPTY_SUBTITLE")),e.R7$(2),e.Y8G("title",e.bMT(9,8,"AD_HOC_REPORTS.FORMS.CREATE")),e.R7$(3),e.SpI(" ",e.bMT(12,10,"AD_HOC_REPORTS.FORMS.CREATE")," "))}function ot(i,a){if(1&i&&(e.j41(0,"div",38),e.nrm(1,"p-tag",69),e.nI1(2,"translate"),e.nrm(3,"p-tag",70),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(),e.Aen(e.lJ4(7,Sr)),e.Y8G("value",e.bMT(2,5,"AD_HOC_REPORTS.FORMS.TAG")),e.R7$(2),e.Y8G("value",n.getFormStatusLabel(t.status))("severity",n.getFormStatusSeverity(t.status))}}function vn(i,a){if(1&i&&(e.j41(0,"span"),e.nrm(1,"i",64),e.EFF(2),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(2),e.SpI(" ",t.elementAttachments.length," element(s) ")}}function ci(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",43)(1,"button",71),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onDesignForm(o))}),e.nrm(2,"i",72),e.k0s(),e.j41(3,"button",73),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onPreviewForm(o))}),e.nrm(4,"i",45),e.k0s(),e.j41(5,"button",74),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.onDeleteForm(o))}),e.nrm(6,"i",57),e.k0s()()}}function ls(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",30),e.DNE(1,ot,4,8,"ng-template",19),e.j41(2,"div",31),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return e.Njj(r.onDesignForm(o))}),e.j41(3,"h4",32),e.EFF(4),e.k0s(),e.j41(5,"p",33),e.EFF(6),e.nI1(7,"translate"),e.k0s(),e.j41(8,"div",34),e.DNE(9,vn,3,1,"span",35),e.j41(10,"span"),e.nrm(11,"i",36),e.EFF(12),e.k0s()()(),e.DNE(13,ci,7,0,"ng-template",37),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(4),e.JRh(t.name),e.R7$(2),e.JRh(t.description||e.bMT(7,4,"AD_HOC_REPORTS.NO_DESCRIPTION")),e.R7$(3),e.Y8G("ngIf",null==t.elementAttachments?null:t.elementAttachments.length),e.R7$(3),e.SpI(" ",n.formatDate(t.lastModified)," ")}}function ds(i,a){if(1&i&&(e.j41(0,"div",28),e.DNE(1,ls,14,6,"p-card",29),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.filteredForms)}}function Wi(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-tabView",17),e.mxI("activeIndexChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.activeTabIndex,o)||(r.activeTabIndex=o),e.Njj(o)}),e.j41(1,"p-tabPanel",18),e.nI1(2,"translate"),e.DNE(3,Qa,6,4,"ng-template",19)(4,Za,13,12,"div",20)(5,Ir,2,1,"div",21),e.k0s(),e.j41(6,"p-tabPanel",18),e.nI1(7,"translate"),e.DNE(8,Ui,6,4,"ng-template",19)(9,Yi,8,6,"div",20)(10,Dr,2,1,"div",21),e.k0s(),e.j41(11,"p-tabPanel",18),e.nI1(12,"translate"),e.DNE(13,Or,6,4,"ng-template",19)(14,xr,8,6,"div",20)(15,Fr,2,1,"div",21),e.k0s(),e.j41(16,"p-tabPanel",18),e.nI1(17,"translate"),e.DNE(18,Xi,6,4,"ng-template",19)(19,Pr,13,12,"div",20)(20,ds,2,1,"div",21),e.k0s()()}if(2&i){const t=e.XpG();e.R50("activeIndex",t.activeTabIndex),e.R7$(),e.Y8G("header",e.bMT(2,17,"AD_HOC_REPORTS.TABS.MY_REPORTS"))("headerStyle",e.lJ4(25,si)),e.R7$(3),e.Y8G("ngIf",0===t.filteredMyReports.length),e.R7$(),e.Y8G("ngIf",t.filteredMyReports.length>0),e.R7$(),e.Y8G("header",e.bMT(7,19,"AD_HOC_REPORTS.TABS.SHARED_WITH_ME"))("headerStyle",e.lJ4(26,si)),e.R7$(3),e.Y8G("ngIf",0===t.filteredSharedReports.length),e.R7$(),e.Y8G("ngIf",t.filteredSharedReports.length>0),e.R7$(),e.Y8G("header",e.bMT(12,21,"AD_HOC_REPORTS.TABS.DATA_SETS"))("headerStyle",e.lJ4(27,si)),e.R7$(3),e.Y8G("ngIf",0===t.filteredDataSets.length),e.R7$(),e.Y8G("ngIf",t.filteredDataSets.length>0),e.R7$(),e.Y8G("header",e.bMT(17,23,"AD_HOC_REPORTS.TABS.FORMS"))("headerStyle",e.lJ4(28,si)),e.R7$(3),e.Y8G("ngIf",0===t.filteredForms.length),e.R7$(),e.Y8G("ngIf",t.filteredForms.length>0)}}function Nr(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-template-picker",75),e.bIt("selected",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onTemplateSelected(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.showTemplateDialog=!1)}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("templates",t.templates)("visible",t.showTemplateDialog)}}function pi(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-share-report-dialog",76),e.bIt("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onShareDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("report",t.selectedReport)("visible",!!t.selectedReport)}}let Gr=(()=>{class i{constructor(t,n,o,r,s,c){this._router=t,this._route=n,this._apiService=o,this._messagingService=r,this._confirmationService=s,this._dialogService=c,this._destroyed$=new ue.B7,this.myReports=[],this.sharedReports=[],this.templates=[],this.dataSets=[],this.forms=[],this.filteredMyReports=[],this.filteredSharedReports=[],this.filteredDataSets=[],this.filteredForms=[],this.loading=!1,this.activeTabIndex=0,this.searchTerm="",this.showTemplateDialog=!1,this.selectedReport=null}ngOnInit(){const t=this._route.snapshot.queryParams.tab;null!=t&&(this.activeTabIndex=+t),this.loadData()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}loadData(){this.loading=!0,this._apiService.getUserReports().pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.myReports=t,this.filterReports()},error:t=>{this._messagingService.error("Failed to load your reports","Error"),console.error("Error loading user reports:",t)}}),this._apiService.getSharedReports().pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.sharedReports=t,this.filterReports()},error:t=>{this._messagingService.error("Failed to load shared reports","Error"),console.error("Error loading shared reports:",t)}}),this._apiService.getTemplates().pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:t=>{this.templates=t},error:t=>{this._messagingService.error("Failed to load templates","Error"),console.error("Error loading templates:",t)}}),this._apiService.getDataSets().pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.dataSets=t,this.filterReports()},error:()=>{this.dataSets=[],this.filteredDataSets=[]}}),this._apiService.getForms().pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.forms=t,this.filterReports()},error:()=>{this.forms=[],this.filteredForms=[]}})}onSearchChange(){this.filterReports()}filterReports(){const t=this.searchTerm.toLowerCase().trim();if(!t)return this.filteredMyReports=[...this.myReports],this.filteredSharedReports=[...this.sharedReports],this.filteredDataSets=[...this.dataSets],void(this.filteredForms=[...this.forms]);this.filteredMyReports=this.myReports.filter(n=>n.name.toLowerCase().includes(t)||n.description?.toLowerCase().includes(t)||n.workflowTypeName?.toLowerCase().includes(t)),this.filteredSharedReports=this.sharedReports.filter(n=>n.name.toLowerCase().includes(t)||n.description?.toLowerCase().includes(t)||n.ownerName?.toLowerCase().includes(t)||n.workflowTypeName?.toLowerCase().includes(t)),this.filteredDataSets=this.dataSets.filter(n=>n.name.toLowerCase().includes(t)||n.description?.toLowerCase().includes(t)||n.primaryElementName?.toLowerCase().includes(t)||n.joinedElementName?.toLowerCase().includes(t)),this.filteredForms=this.forms.filter(n=>n.name.toLowerCase().includes(t)||n.description?.toLowerCase().includes(t))}onNewReport(){this.showTemplateDialog=!0}onTemplateSelected(t){this.showTemplateDialog=!1,this._router.navigate("gantt"===t.type?["/private/ad-hoc-reports/gantt/new"]:"calendar"===t.type?["/private/ad-hoc-reports/calendar/new"]:"dashboard"===t.type?["/private/ad-hoc-reports/dashboard/new"]:"datagrid"===t.type?["/private/ad-hoc-reports/datagrid/new"]:t.template?["/private/ad-hoc-reports/new",t.template.templateId]:["/private/ad-hoc-reports/new"])}onOpenReport(t){this._router.navigate(["/private/ad-hoc-reports/view",t.adHocReportId])}onEditReport(t){t.isReadOnly?this._messagingService.warning("This report is read-only. Create a copy to modify it.","Read Only"):this._router.navigate(t.visualizationType===w.vi.Gantt?["/private/ad-hoc-reports/gantt/edit",t.adHocReportId]:t.visualizationType===w.vi.Calendar?["/private/ad-hoc-reports/calendar/edit",t.adHocReportId]:t.visualizationType===w.vi.Dashboard?["/private/ad-hoc-reports/dashboard/edit",t.adHocReportId]:t.visualizationType===w.vi.DataGrid?["/private/ad-hoc-reports/datagrid/edit",t.adHocReportId]:["/private/ad-hoc-reports/edit",t.adHocReportId])}onDeleteReport(t){this._confirmationService.confirm({message:`Are you sure you want to delete "${t.name}"?`,header:"Confirm Delete",icon:"mdi mdi-alert",accept:()=>{this._apiService.deleteReport(t.adHocReportId).pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>{this._messagingService.success("Report deleted successfully","Success"),this.myReports=this.myReports.filter(n=>n.adHocReportId!==t.adHocReportId),this.filterReports()},error:n=>
1{this._messagingService.error("Failed to delete report","Error"),console.error("Error deleting report:",n)}})}})}onCopyReport(t){this._apiService.copyReport(t.adHocReportId,`${t.name} (Copy)`).pipe((0,L.Q)(this._destroyed$)).subscribe({next:o=>{this._messagingService.success("Report copied successfully","Success"),this.myReports.unshift(o),this.filterReports()},error:o=>{this._messagingService.error("Failed to copy report","Error"),console.error("Error copying report:",o)}})}onShareReport(t){this.selectedReport=t}onShareDialogClosed(){this.selectedReport=null}onNewDataSet(){this._router.navigate(["/private/ad-hoc-reports/datasets/new"])}onEditDataSet(t){this._router.navigate(["/private/ad-hoc-reports/datasets/edit",t.dataSetId])}onDeleteDataSet(t){this._confirmationService.confirm({message:`Are you sure you want to delete "${t.name}"?`,header:"Confirm Delete",icon:"mdi mdi-alert",accept:()=>{this._apiService.deleteDataSet(t.dataSetId).pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>{this._messagingService.success("Data set deleted successfully","Success"),this.dataSets=this.dataSets.filter(n=>n.dataSetId!==t.dataSetId),this.filterReports()},error:n=>{this._messagingService.error("Failed to delete data set","Error"),console.error("Error deleting data set:",n)}})}})}onNewForm(){this._apiService.createForm({name:"Untitled Form",description:""}).pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this._router.navigate(["/private/ad-hoc-reports/forms",t.id,"design"])},error:t=>{this._messagingService.error("Failed to create form","Error"),console.error("Error creating form:",t)}})}onDesignForm(t){this._router.navigate(["/private/ad-hoc-reports/forms",t.id,"design"])}onPreviewForm(t){this._apiService.renderForm(t.id).pipe((0,L.Q)(this._destroyed$)).subscribe({next:n=>{const o=URL.createObjectURL(n);window.open(o,"_blank")},error:n=>{this._messagingService.error("Failed to render form","Error"),console.error("Error rendering form:",n)}})}canTestAgainstInstance(t){return null!=t.dataSourceElementId}onTestForm(t){this.canTestAgainstInstance(t)&&this._dialogService.open(m,{header:`Test "${t.name}"`,data:{formId:t.id,elementId:t.dataSourceElementId,formName:t.name}})}onDeleteForm(t){this._confirmationService.confirm({message:`Are you sure you want to delete "${t.name}"?`,header:"Confirm Delete",icon:"mdi mdi-alert",accept:()=>{this._apiService.deleteForm(t.id).pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>{this._messagingService.success("Form deleted successfully","Success"),this.forms=this.forms.filter(n=>n.id!==t.id),this.filterReports()},error:n=>{this._messagingService.error("Failed to delete form","Error"),console.error("Error deleting form:",n)}})}})}getFormStatusLabel(t){return t===Ue.HB.Published?"Published":"Draft"}getFormStatusSeverity(t){return t===Ue.HB.Published?"success":"warning"}getEntityTypeLabel(t){switch(t){case w.dX.Workflow:return"AD_HOC_REPORTS.ENTITY_TYPES.WORKFLOW";case w.dX.MasterData:return"AD_HOC_REPORTS.ENTITY_TYPES.MASTER_DATA";case w.dX.Documents:return"AD_HOC_REPORTS.ENTITY_TYPES.DOCUMENTS";case w.dX.SystemData:return"AD_HOC_REPORTS.ENTITY_TYPES.SYSTEM_DATA";default:return"GENERAL.UNKNOWN"}}getEntityTypeSeverity(t){switch(t){case w.dX.Workflow:return"info";case w.dX.MasterData:return"success";case w.dX.Documents:return"warning";case w.dX.SystemData:return"danger";default:return"info"}}getVisualizationTypeLabel(t){switch(t){case w.vi.Pivot:return"AD_HOC_REPORTS.CREATE_MODAL.TYPES.PIVOT_GRID";case w.vi.Calendar:return"AD_HOC_REPORTS.CREATE_MODAL.TYPES.CALENDAR";case w.vi.Dashboard:return"AD_HOC_REPORTS.CREATE_MODAL.TYPES.DASHBOARD";case w.vi.DataGrid:return"AD_HOC_REPORTS.CREATE_MODAL.TYPES.DATA_GRID";case w.vi.Gantt:return"AD_HOC_REPORTS.CREATE_MODAL.TYPES.GANTT";default:return"AD_HOC_REPORTS.CREATE_MODAL.TYPES.PIVOT_GRID"}}getVisualizationTypeTagStyle(t){switch(t){case w.vi.Pivot:return{backgroundColor:"#3f6bfa",color:"#fff"};case w.vi.Calendar:return{backgroundColor:"#0d2c54",color:"#fff"};case w.vi.Dashboard:return{backgroundColor:"#09a564",color:"#fff"};case w.vi.DataGrid:return{backgroundColor:"#e82077",color:"#fff"};case w.vi.Gantt:return{backgroundColor:"#f97316",color:"#fff"};default:return{backgroundColor:"#3f6bfa",color:"#fff"}}}getVisualizationTypeIcon(t){switch(t){case w.vi.Pivot:return"mdi mdi-table";case w.vi.Calendar:return"mdi mdi-calendar";case w.vi.Dashboard:return"mdi mdi-chart-bar";case w.vi.DataGrid:return"mdi mdi-table-large";case w.vi.Gantt:return"mdi mdi-chart-gantt";default:return"mdi mdi-table"}}formatDate(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(Ye.F),e.rXU(q.Ui),e.rXU(ke.td),e.rXU(It.o3))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-report-library"]],decls:22,vars:17,consts:[[1,"report-library-container"],[1,"library-header"],[1,"header-title"],[1,"subtitle"],[1,"header-actions"],[1,"p-input-icon-left","search-box"],[1,"mdi","mdi-magnify"],["type","text","pInputText","",3,"ngModelChange","ngModel","placeholder"],["type","button","class","button button_colorSuccess button_shadow",3,"title","click",4,"ngIf"],["class","loading-container",4,"ngIf"],[3,"activeIndex","activeIndexChange",4,"ngIf"],[3,"templates","visible","selected","closed",4,"ngIf"],[3,"report","visible","closed",4,"ngIf"],["type","button",1,"button","button_colorSuccess","button_shadow",3,"click","title"],[1,"mdi","mdi-plus","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[3,"activeIndexChange","activeIndex"],[3,"header","headerStyle"],["pTemplate","header"],["class","empty-state",4,"ngIf"],["class","reports-grid",4,"ngIf"],[1,"mdi","mdi-file-document-edit"],[1,"ml-2"],[1,"badge"],[1,"empty-state"],[1,"mdi","mdi-inbox"],["type","button",1,"button","button_colorSuccess",3,"click","title"],[1,"reports-grid"],["class","report-card",4,"ngFor","ngForOf"],[1,"report-card"],[1,"card-content",3,"click"],[1,"report-name"],[1,"report-description"],[1,"report-meta"],[4,"ngIf"],[1,"mdi","mdi-calendar"],["pTemplate","footer"],[1,"card-header"],[3,"value","icon"],["value","Template","severity","secondary",4,"ngIf"],["value","Template","severity","secondary"],[1,"mdi","mdi-sitemap"],[1,"card-actions"],["type","button","title","View Report","pTooltip","View Report",1,"button","button_round",3,"click"],[1,"mdi","mdi-eye"],["type","button","title","Edit Report","class","button button_round","pTooltip","Edit Report",3,"click",4,"ngIf"],["type","button","title","Share Report","pTooltip","Share Report",1,"button","button_round",3,"click"],[1,"mdi","mdi-share-variant"],["type","button","title","Copy Report","pTooltip","Copy Report",1,"button","button_round",3,"click"],[1,"mdi","mdi-content-copy"],["type","button","title","Delete Report","class","button button_round delete-btn","pTooltip","Delete Report",3,"click",4,"ngIf"],[1,"entity-type-tag"],[3,"value"],["type","button","title","Edit Report","pTooltip","Edit Report",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil"],["type","button","title","Delete Report","pTooltip","Delete Report",1,"button","button_round","delete-btn",3,"click"],[1,"mdi","mdi-trash-can"],[1,"mdi","mdi-account-multiple"],[1,"shared-by"],[1,"mdi","mdi-database"],[1,"mdi","mdi-database-plus"],["value","Data Set","icon","mdi mdi-database","severity","info"],[1,"mdi","mdi-table"],[1,"mdi","mdi-link-variant"],["type","button","title","Edit Data Set","pTooltip","Edit Data Set",1,"button","button_round",3,"click"],["type","button","title","Delete Data Set","pTooltip","Delete Data Set",1,"button","button_round","delete-btn",3,"click"],[1,"mdi","mdi-form-select"],[1,"mdi","mdi-file-document-outline"],["icon","mdi mdi-form-select",3,"value"],[3,"value","severity"],["type","button","title","Design Form","pTooltip","Design Form",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil-ruler"],["type","button","title","Preview Form","pTooltip","Preview Form",1,"button","button_round",3,"click"],["type","button","title","Delete Form","pTooltip","Delete Form",1,"button","button_round","delete-btn",3,"click"],[3,"selected","closed","templates","visible"],[3,"closed","report","visible"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"h2"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"span",3),e.
1EFF(7),e.nI1(8,"translate"),e.k0s()(),e.j41(9,"div",4)(10,"span",5),e.nrm(11,"i",6),e.j41(12,"input",7),e.nI1(13,"translate"),e.mxI("ngModelChange",function(s){return e.DH7(o.searchTerm,s)||(o.searchTerm=s),s}),e.bIt("ngModelChange",function(){return o.onSearchChange()}),e.k0s()(),e.DNE(14,hn,5,6,"button",8)(15,fn,5,6,"button",8)(16,$i,5,6,"button",8),e.k0s()(),e.DNE(17,li,5,3,"div",9)(18,Wi,21,29,"p-tabView",10),e.k0s(),e.DNE(19,Nr,1,2,"cad-template-picker",11)(20,pi,1,2,"cad-share-report-dialog",12),e.nrm(21,"p-confirmDialog")),2&n&&(e.R7$(4),e.JRh(e.bMT(5,11,"AD_HOC_REPORTS.TITLE")),e.R7$(3),e.JRh(e.bMT(8,13,"AD_HOC_REPORTS.SUBTITLE")),e.R7$(5),e.R50("ngModel",o.searchTerm),e.Y8G("placeholder",e.bMT(13,15,"AD_HOC_REPORTS.SEARCH_PLACEHOLDER")),e.R7$(2),e.Y8G("ngIf",2!==o.activeTabIndex&&3!==o.activeTabIndex),e.R7$(),e.Y8G("ngIf",2===o.activeTabIndex),e.R7$(),e.Y8G("ngIf",3===o.activeTabIndex),e.R7$(),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading),e.R7$(),e.Y8G("ngIf",o.showTemplateDialog),e.R7$(),e.Y8G("ngIf",o.selectedReport))},dependencies:[M.Sq,M.bT,R.me,R.BC,R.vS,ke.Ei,_e.S,On.JQ,On.Kp,Mt.m,ze.VU,Re.T,_n,ni.v,Bi,ji,nt.D9],styles:[".report-library-container[_ngcontent-%COMP%]{padding:24px;height:100%;overflow:auto}.library-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:24px;flex-wrap:wrap;gap:16px}.library-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0 0 4px;font-size:24px;font-weight:600;color:#000}.library-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   .subtitle[_ngcontent-%COMP%]{color:#7b7b7b;font-size:14px}.library-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:center}.library-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .search-box[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:250px}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px;gap:16px;color:#7b7b7b}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 24px;text-align:center}.empty-state[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:48px;color:#dedede;margin-bottom:16px}.empty-state[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0 0 8px;color:#000}.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 24px;color:#7b7b7b}.reports-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:20px;padding:8px 0}.reports-grid[_ngcontent-%COMP%]   .datasets-header[_ngcontent-%COMP%]{grid-column:1/-1;display:flex;justify-content:flex-end;margin-bottom:4px}.report-card[_ngcontent-%COMP%]     .p-card{height:100%;display:flex;flex-direction:column;transition:box-shadow .2s,transform .2s}.report-card[_ngcontent-%COMP%]     .p-card:hover{box-shadow:0 4px 16px #0000001f;transform:translateY(-2px)}.report-card[_ngcontent-%COMP%]     .p-card .p-card-body{flex:1;display:flex;flex-direction:column}.report-card[_ngcontent-%COMP%]     .p-card .p-card-content{flex:1;padding-top:0}.report-card[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#fafafa;border-bottom:1px solid #dedede}.report-card[_ngcontent-%COMP%]   .card-header[_ngcontent-%COMP%]   .shared-by[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b;font-style:italic}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]{cursor:pointer;padding:8px 0}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .report-name[_ngcontent-%COMP%]{margin:0 0 8px;font-size:16px;font-weight:600;color:#000;line-height:1.3}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .report-name[_ngcontent-%COMP%]:hover{color:#5f84fc}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .report-description[_ngcontent-%COMP%]{margin:0 0 12px;font-size:14px;color:#7b7b7b;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .report-meta[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:16px;font-size:12px;color:#7b7b7b}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .report-meta[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .report-meta[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:12px}.report-card[_ngcontent-%COMP%]   .card-content[_ngcontent-%COMP%]   .shared-by[_ngcontent-%COMP%]{font-size:12px;font-style:italic;color:#7b7b7b;margin-top:4px}.report-card[_ngcontent-%COMP%]   .card-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;padding-top:8px;border-top:1px solid #dedede}.report-card[_ngcontent-%COMP%]   .card-actions[_ngcontent-%COMP%]   .entity-type-tag[_ngcontent-%COMP%]{margin-left:auto}.report-card[_ngcontent-%COMP%]   .card-actions[_ngcontent-%COMP%]   .button[_ngcontent-%COMP%]{color:#0009}.report-card[_ngcontent-%COMP%]   .card-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{background-color:transparent;border:none;color:#0009}.report-card[_ngcontent-%COMP%]   .card-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]:hover{background-color:#0000000a}  .p-tabview .p-tabview-nav{background:transparent;border:none}  .p-tabview .p-tabview-nav li .p-tabview-nav-link{background:transparent;border:none;border-bottom:2px solid transparent;color:#7b7b7b;padding:12px 20px}  .p-tabview .p-tabview-nav li .p-tabview-nav-link:hover{color:#5f84fc}  .p-tabview .p-tabview-nav li .p-tabview-nav-link .badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;margin-left:8px;font-size:11px;font-weight:600;color:#fff;background:#7b7b7b;border-radius:10px}  .p-tabview .p-tabview-nav li.p-highlight .p-tabview-nav-link{color:#5f84fc;border-bottom-color:#5f84fc}  .p-tabview .p-tabview-nav li.p-highlight .p-tabview-nav-link .badge{background:#5f84fc}  .p-tabview .p-tabview-nav li:first-child.p-highlight .p-tabview-nav-link{color:#09a564;border-bottom-color:#09a564}  .p-tabview .p-tabview-nav li:first-child.p-highlight .p-tabview-nav-link .badge{background:#09a564}  .p-tabview .p-tabview-nav li:first-child .p-tabview-nav-link:hover{color:#09a564}  .p-tabview .p-tabview-panels{background:transparent;padding:16px 0;border:none}@media (max-width: 768px){.library-header[_ngcontent-%COMP%]{flex-direction:column}.library-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{width:100%}.library-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .search-box[_ngcontent-%COMP%]{flex:1}.library-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .search-box[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%}.reports-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}"]})}}return i})();var le=F(14421),vt=F(90696),Te=F(15539),ye=F(83921),ve=F(76763);let Ar=(()=>{class i{buildFieldDefinitions(t){const n=[];return t.commonFields?.forEach(o=>{n.push({name:o.name,type:this.mapFieldType(o.type),caption:o.displayName})}),t.elementFields?.forEach(o=>{n.push({name:o.name,type:this.mapFieldType(o.type),caption:o.displayName})}),n}mapFieldType(t){switch(t){case"number":return"number";case"datetime":return"date";case"boolean":return"boolean";default:return"string"}}flattenElementData(t){return t.map(n=>{const o={elementId:n.elementId,createdDate:n.createdDate,modifiedDate:n.modifiedDate,createdBy:n.createdBy,modifiedBy:n.modifiedBy,currentStage:n.currentStage,currentStageId:n.currentStageId,assignedUser:n.assignedUser,assignedUserId:n.assignedUserId,statusValue:n.statusValue,statusId:n.statusId,daysInCurrentStage:n.daysInCurrentStage,totalDaysOpen:n.totalDaysOpen};
1return Object.keys(n).forEach(r=>{o.hasOwnProperty(r)||(o[r]=n[r])}),o})}getFieldNamesFromData(t){if(!t||0===t.length)return[];const n=new Set;return t.forEach(o=>{Object.keys(o).forEach(r=>n.add(r))}),Array.from(n)}inferFieldType(t){return null==t?"string":"number"==typeof t?"number":"boolean"==typeof t?"boolean":"string"==typeof t&&this.isISODateString(t)?"datetime":"string"}isISODateString(t){return!!t&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(t)}generateDefaultConfig(t){const n={rows:[],columns:[],values:[]},o=t.elementFields?.find(s=>"currentStage"===s.name);o&&n.rows.push(o.name);const r=t.commonFields?.find(s=>"elementId"===s.name);return r&&n.values.push({field:r.name,aggregate:"count",caption:"Count"}),n}validateConfig(t,n){const o=[],r=new Set([...n.commonFields?.map(s=>s.name)||[],...n.elementFields?.map(s=>s.name)||[]]);return t.rows.forEach(s=>{r.has(s)||o.push(`Row field "${s}" not found in metadata`)}),t.columns.forEach(s=>{r.has(s)||o.push(`Column field "${s}" not found in metadata`)}),t.values.forEach(s=>{r.has(s.field)||o.push(`Value field "${s.field}" not found in metadata`)}),0===t.values.length&&o.push("At least one value aggregation is required"),o}calculateAgeGroup(t){return t<=7?"0-7 days":t<=30?"8-30 days":t<=90?"31-90 days":"90+ days"}extractMonth(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short"}):"Unknown"}addCalculatedFields(t){return t.map(n=>({...n,ageGroup:this.calculateAgeGroup(n.daysInCurrentStage||0),createdMonth:this.extractMonth(n.createdDate),modifiedMonth:this.extractMonth(n.modifiedDate)}))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var ui=F(29851),mt=F(91305);const tn=()=>({width:"100px"});function zi(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",36),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.clearFieldSearch())}),e.nrm(1,"i",37),e.k0s()}}function cs(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",38),e.bIt("dragstart",function(o){const r=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.onDragStart(o,r))})("dragend",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onDragEnd())}),e.nrm(1,"i"),e.j41(2,"span",39),e.EFF(3),e.k0s(),e.j41(4,"span",40),e.EFF(5),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG();e.R7$(),e.HbH(n.getFieldTypeIcon(t.type)),e.R7$(2),e.JRh(t.displayName),e.R7$(),e.HbH(t.category),e.R7$(),e.SpI(" ","common"===t.category?"C":"W"," ")}}function Nn(i,a){1&i&&(e.j41(0,"div",41),e.EFF(1," No matching fields "),e.k0s())}function Lr(i,a){1&i&&(e.j41(0,"div",41),e.EFF(1," No fields available "),e.k0s())}function Ki(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",42),e.bIt("dragstart",function(o){const r=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.onDragStart(o,r))})("dragend",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onDragEnd())}),e.nrm(1,"i"),e.j41(2,"span",39),e.EFF(3),e.k0s(),e.j41(4,"button",43),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.removeFromRows(o))}),e.nrm(5,"i",37),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG();e.R7$(),e.HbH(n.getFieldTypeIcon(t.type)),e.R7$(2),e.JRh(t.displayName)}}function Br(i,a){1&i&&(e.j41(0,"div",44),e.nrm(1,"i",45),e.j41(2,"span"),e.EFF(3,"Drop fields here for row grouping"),e.k0s()())}function jr(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",42),e.bIt("dragstart",function(o){const r=e.eBV(t).$implicit,s=e.XpG();return e.Njj(s.onDragStart(o,r))})("dragend",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onDragEnd())}),e.nrm(1,"i"),e.j41(2,"span",39),e.EFF(3),e.k0s(),e.j41(4,"button",43),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.removeFromColumns(o))}),e.nrm(5,"i",37),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG();e.R7$(),e.HbH(n.getFieldTypeIcon(t.type)),e.R7$(2),e.JRh(t.displayName)}}function ps(i,a){1&i&&(e.j41(0,"div",44),e.nrm(1,"i",45),e.j41(2,"span"),e.EFF(3,"Drop fields here for column grouping"),e.k0s()())}function Vr(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",46)(1,"div",47),e.nrm(2,"i"),e.j41(3,"span",39),e.EFF(4),e.k0s()(),e.j41(5,"div",48)(6,"p-dropdown",49),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.aggregate,o)||(r.aggregate=o),e.Njj(o)}),e.bIt("onChange",function(o){const r=e.eBV(t).index,s=e.XpG();return e.Njj(s.onAggregateChange(r,o.value))}),e.k0s(),e.j41(7,"input",50),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.caption,o)||(r.caption=o),e.Njj(o)}),e.bIt("change",function(){const o=e.eBV(t),r=o.$implicit,s=o.index,c=e.XpG();return e.Njj(c.onCaptionChange(s,r.caption))}),e.k0s(),e.j41(8,"button",43),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG();return e.Njj(r.removeFromValues(o))}),e.nrm(9,"i",37),e.k0s()(),e.j41(10,"div",51)(11,"p-checkbox",52),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.formatCurrency,o)||(r.formatCurrency=o),e.Njj(o)}),e.bIt("onChange",function(){const o=e.eBV(t).index,r=e.XpG();return e.Njj(r.onFormatCurrencyChange(o))}),e.k0s(),e.j41(12,"p-checkbox",53),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.formatCommas,o)||(r.formatCommas=o),e.Njj(o)}),e.bIt("onChange",function(){const o=e.eBV(t).index,r=e.XpG();return e.Njj(r.onFormatDecimalChange(o))}),e.k0s()()()}if(2&i){const t=a.$implicit,n=e.XpG();e.R7$(2),e.HbH(n.getFieldTypeIcon(t.field.type)),e.R7$(2),e.JRh(t.field.displayName),e.R7$(2),e.Aen(e.lJ4(12,tn)),e.Y8G("options",n.aggregateOptions),e.R50("ngModel",t.aggregate),e.R7$(),e.R50("ngModel",t.caption),e.R7$(4),e.R50("ngModel",t.formatCurrency),e.Y8G("binary",!0),e.R7$(),e.R50("ngModel",t.formatCommas),e.Y8G("binary",!0)}}function us(i,a){1&i&&(e.j41(0,"div",44),e.nrm(1,"i",45),e.j41(2,"span"),e.EFF(3,"Drop fields here for aggregation"),e.k0s()())}let _s=(()=>{class i{constructor(){this.fieldMetadata=null,this.configuration={rows:[],columns:[],values:[]},this.configurationChange=new e.bkB,this.columnHeadersWidth=100,this.availableFields=[],this.rowFields=[],this.columnFields=[],this.valueFields=[],this.aggregateOptions=[{label:"Count",value:"count"},{label:"Sum",value:"sum"},{label:"Average",value:"average"},{label:"Min",value:"min"},{label:"Max",value:"max"}],this.fieldSearchText="",this.filteredAvailableFields=[],this.draggedField=null}ngOnInit(){this.initializeFields()}ngOnChanges(t){(t.fieldMetadata||t.configuration)&&(console.log("PivotConfigurator ngOnChanges:",{hasFieldMetadata:!!this.fieldMetadata,commonFieldsCount:this.fieldMetadata?.commonFields?.length||0,elementFieldsCount:this.fieldMetadata?.elementFields?.length||0,configRows:this.configuration?.rows?.length||0,configColumns:this.configuration?.columns?.length||0,configValues:this.configuration?.values?.length||0}),this.initializeFields())}initializeFields(){if(!this.fieldMetadata)return void(this.availableFields=[]);const t=[];this.fieldMetadata.commonFields?.forEach(n=>{t.push({...n,category:"common",isUsed:!1}
1)}),this.fieldMetadata.elementFields?.forEach(n=>{t.push({...n,category:"workflow",isUsed:!1})}),this.rowFields=[],this.columnFields=[],this.valueFields=[],this.configuration&&(this.configuration.rows?.forEach(n=>{const o=t.find(r=>r.name===n);o&&(o.isUsed=!0,o.usedIn="rows",this.rowFields.push(o))}),this.configuration.columns?.forEach(n=>{const o=t.find(r=>r.name===n);o&&(o.isUsed=!0,o.usedIn="columns",this.columnFields.push(o))}),this.configuration.values?.forEach(n=>{const o=t.find(r=>r.name===n.field);o&&(o.isUsed=!0,o.usedIn="values",this.valueFields.push({field:o,aggregate:n.aggregate,caption:n.caption,formatCurrency:n.formatCurrency||!1,formatCommas:n.formatCommas||!1}))})),this.availableFields=t.filter(n=>!n.isUsed),this.applyFieldFilter(),console.log("PivotConfigurator initializeFields result:",{totalFields:t.length,availableFields:this.availableFields.length,rowFields:this.rowFields.length,columnFields:this.columnFields.length,valueFields:this.valueFields.length}),this.configuration?.columnHeadersWidth&&(this.columnHeadersWidth=this.configuration.columnHeadersWidth)}onColumnWidthChange(t){this.columnHeadersWidth=t,this.emitConfiguration()}onDragStart(t,n){this.draggedField=n,t.dataTransfer&&(t.dataTransfer.setData("text/plain",n.name),t.dataTransfer.effectAllowed="move")}onDragEnd(){this.draggedField=null}onDragOver(t){t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move")}onDropToRows(t){t.preventDefault(),this.draggedField&&(this.removeFieldFromAll(this.draggedField),this.draggedField.isUsed=!0,this.draggedField.usedIn="rows",this.rowFields.push(this.draggedField),this.updateAvailableFields(),this.emitConfiguration())}onDropToColumns(t){t.preventDefault(),this.draggedField&&(this.removeFieldFromAll(this.draggedField),this.draggedField.isUsed=!0,this.draggedField.usedIn="columns",this.columnFields.push(this.draggedField),this.updateAvailableFields(),this.emitConfiguration())}onDropToValues(t){if(t.preventDefault(),!this.draggedField)return;const n="number"===this.draggedField.type;this.removeFieldFromAll(this.draggedField),this.draggedField.isUsed=!0,this.draggedField.usedIn="values",this.valueFields.push({field:this.draggedField,aggregate:n?"sum":"count",caption:n?`Sum of ${this.draggedField.displayName}`:`Count of ${this.draggedField.displayName}`,formatCurrency:!1,formatCommas:!1}),this.updateAvailableFields(),this.emitConfiguration()}onDropToAvailable(t){t.preventDefault(),this.draggedField&&(this.removeFieldFromAll(this.draggedField),this.draggedField.isUsed=!1,this.draggedField.usedIn=void 0,this.updateAvailableFields(),this.emitConfiguration())}removeFieldFromAll(t){this.rowFields=this.rowFields.filter(n=>n.name!==t.name),this.columnFields=this.columnFields.filter(n=>n.name!==t.name),this.valueFields=this.valueFields.filter(n=>n.field.name!==t.name)}updateAvailableFields(){const t=new Set([...this.rowFields.map(o=>o.name),...this.columnFields.map(o=>o.name),...this.valueFields.map(o=>o.field.name)]),n=[...(this.fieldMetadata?.commonFields||[]).map(o=>({...o,category:"common"})),...(this.fieldMetadata?.elementFields||[]).map(o=>({...o,category:"workflow"}))];this.availableFields=n.filter(o=>!t.has(o.name)).map(o=>({...o,isUsed:!1})),this.applyFieldFilter()}removeFromRows(t){this.rowFields=this.rowFields.filter(n=>n.name!==t.name),t.isUsed=!1,t.usedIn=void 0,this.updateAvailableFields(),this.emitConfiguration()}removeFromColumns(t){this.columnFields=this.columnFields.filter(n=>n.name!==t.name),t.isUsed=!1,t.usedIn=void 0,this.updateAvailableFields(),this.emitConfiguration()}removeFromValues(t){const n=this.valueFields.splice(t,1)[0];n&&(n.field.isUsed=!1,n.field.usedIn=void 0,this.updateAvailableFields()),this.emitConfiguration()}onAggregateChange(t,n){this.valueFields[t]&&(this.valueFields[t].aggregate=n,this.valueFields[t].caption=`${this.getAggregateLabel(n)} of ${this.valueFields[t].field.displayName}`,this.emitConfiguration())}onCaptionChange(t,n){this.valueFields[t]&&(this.valueFields[t].caption=n,this.emitConfiguration())}onFormatCurrencyChange(t){this.valueFields[t]?.formatCurrency&&(this.valueFields[t].formatCommas=!1),this.emitConfiguration()}onFormatDecimalChange(t){this.valueFields[t]?.formatCommas&&(this.valueFields[t].formatCurrency=!1),this.emitConfiguration()}getAggregateLabel(t){return this.aggregateOptions.find(o=>o.value===t)?.label||t}emitConfiguration(){const t={rows:this.rowFields.map(n=>n.name),columns:this.columnFields.map(n=>n.name),values:this.valueFields.map(n=>({field:n.field.name,aggregate:n.aggregate,caption:n.caption,formatCurrency:n.formatCurrency||void 0,formatCommas:n.formatCommas||void 0})),columnHeadersWidth:this.columnHeadersWidth};this.configurationChange.emit(t)}onFieldSearch(t){this.fieldSearchText=t,this.applyFieldFilter()}clearFieldSearch(){this.fieldSearchText="",this.applyFieldFilter()}applyFieldFilter(){if(!this.fieldSearchText)return void(this.filteredAvailableFields=this.availableFields);const t=this.fieldSearchText.toLowerCase();this.filteredAvailableFields=this.availableFields.filter(n=>n.displayName.toLowerCase().includes(t)||n.name.toLowerCase().includes(t))}getFieldTypeIcon(t){switch(t){case"string":return"mdi mdi-format-text";case"number":return"mdi mdi-pound";case"datetime":return"mdi mdi-calendar";case"boolean":return"mdi mdi-checkbox-marked";default:return"mdi mdi-help-circle"}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-pivot-configurator"]],inputs:{fieldMetadata:"fieldMetadata",configuration:"configuration"},outputs:{configurationChange:"configurationChange"},features:[e.OA$],decls:62,vars:25,consts:[[1,"pivot-configurator"],[1,"config-grid"],[1,"field-panel","available-panel"],[1,"panel-header"],[1,"field-count"],[1,"field-search"],[1,"p-input-icon-left"],[1,"mdi","mdi-magnify"],["type","text","pInputText","","placeholder","Filter fields...",1,"search-input",3,"ngModelChange","ngModel"],["class","clear-search-btn","title","Clear filter",3,"click",4,"ngIf"],[1,"field-list",3,"dragover","drop"],["class","field-chip available","draggable","true",3,"dragstart","dragend",4,"ngFor","ngForOf"],["class","empty-message",4,"ngIf"],[1,"config-panels"],[1,"field-panel","rows-panel"],[1,"mdi","mdi-menu"],[1,"drop-zone",3,"dragover","drop"],["class","field-chip configured","draggable","true",3,"dragstart","dragend",4,"ngFor","ngForOf"],["class","drop-hint",4,"ngIf"],[1,"field-panel","columns-panel"],[1,"mdi","mdi-table"],[1,"field-panel","values-panel"],[1,"mdi","mdi-calculator"],[1,"drop-zone","values-zone",3,"dragover","drop"],["class","value-config",4,"ngFor","ngForOf"],[1,"layout-sett
1ings"],[1,"mdi","mdi-tune"],[1,"setting-row"],["for","columnWidth"],[1,"width-control"],["id","columnWidth","type","number","pInputText","","min","50","max","400","step","10",1,"width-input",3,"ngModelChange","change","ngModel"],[1,"width-hint"],[1,"legend"],[1,"legend-item"],[1,"field-category","common"],[1,"field-category","workflow"],["title","Clear filter",1,"clear-search-btn",3,"click"],[1,"mdi","mdi-close"],["draggable","true",1,"field-chip","available",3,"dragstart","dragend"],[1,"field-name"],[1,"field-category"],[1,"empty-message"],["draggable","true",1,"field-chip","configured",3,"dragstart","dragend"],["title","Remove",1,"remove-btn",3,"click"],[1,"drop-hint"],[1,"mdi","mdi-arrow-down"],[1,"value-config"],[1,"value-field-info"],[1,"value-config-controls"],["optionLabel","label","optionValue","value","appendTo","body",3,"ngModelChange","onChange","options","ngModel"],["type","text","pInputText","","placeholder","Caption",1,"caption-input",3,"ngModelChange","change","ngModel"],[1,"value-format-options"],["label","Currency",3,"ngModelChange","onChange","ngModel","binary"],["label","Decimal",3,"ngModelChange","onChange","ngModel","binary"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h4"),e.EFF(5,"Available Fields"),e.k0s(),e.j41(6,"span",4),e.EFF(7),e.k0s()(),e.j41(8,"div",5)(9,"span",6),e.nrm(10,"i",7),e.j41(11,"input",8),e.mxI("ngModelChange",function(s){return e.DH7(o.fieldSearchText,s)||(o.fieldSearchText=s),s}),e.bIt("ngModelChange",function(s){return o.onFieldSearch(s)}),e.k0s()(),e.DNE(12,zi,2,0,"button",9),e.k0s(),e.j41(13,"div",10),e.bIt("dragover",function(s){return o.onDragOver(s)})("drop",function(s){return o.onDropToAvailable(s)}),e.DNE(14,cs,6,6,"div",11)(15,Nn,2,0,"div",12)(16,Lr,2,0,"div",12),e.k0s()(),e.j41(17,"div",13)(18,"div",14)(19,"div",3)(20,"h4"),e.nrm(21,"i",15),e.EFF(22," Row Fields"),e.k0s()(),e.j41(23,"div",16),e.bIt("dragover",function(s){return o.onDragOver(s)})("drop",function(s){return o.onDropToRows(s)}),e.DNE(24,Ki,6,3,"div",17)(25,Br,4,0,"div",18),e.k0s()(),e.j41(26,"div",19)(27,"div",3)(28,"h4"),e.nrm(29,"i",20),e.EFF(30," Column Fields"),e.k0s()(),e.j41(31,"div",16),e.bIt("dragover",function(s){return o.onDragOver(s)})("drop",function(s){return o.onDropToColumns(s)}),e.DNE(32,jr,6,3,"div",17)(33,ps,4,0,"div",18),e.k0s()(),e.j41(34,"div",21)(35,"div",3)(36,"h4"),e.nrm(37,"i",22),e.EFF(38," Value Fields (Aggregations)"),e.k0s()(),e.j41(39,"div",23),e.bIt("dragover",function(s){return o.onDragOver(s)})("drop",function(s){return o.onDropToValues(s)}),e.DNE(40,Vr,13,13,"div",24)(41,us,4,0,"div",18),e.k0s()()()(),e.j41(42,"div",25)(43,"h4"),e.nrm(44,"i",26),e.EFF(45," Layout Settings"),e.k0s(),e.j41(46,"div",27)(47,"label",28),e.EFF(48,"Value Column Width (px)"),e.k0s(),e.j41(49,"div",29)(50,"input",30),e.mxI("ngModelChange",function(s){return e.DH7(o.columnHeadersWidth,s)||(o.columnHeadersWidth=s),s}),e.bIt("change",function(){return o.onColumnWidthChange(o.columnHeadersWidth)}),e.k0s(),e.j41(51,"span",31),e.EFF(52,"50-400px (default: 100)"),e.k0s()()()(),e.j41(53,"div",32)(54,"div",33)(55,"span",34),e.EFF(56,"C"),e.k0s(),e.EFF(57," Common Fields "),e.k0s(),e.j41(58,"div",33)(59,"span",35),e.EFF(60,"W"),e.k0s(),e.EFF(61," Workflow Fields "),e.k0s()()()),2&n&&(e.R7$(7),e.JRh(o.filteredAvailableFields.length),e.R7$(4),e.R50("ngModel",o.fieldSearchText),e.R7$(),e.Y8G("ngIf",o.fieldSearchText),e.R7$(2),e.Y8G("ngForOf",o.filteredAvailableFields),e.R7$(),e.Y8G("ngIf",0===o.filteredAvailableFields.length&&o.availableFields.length>0),e.R7$(),e.Y8G("ngIf",0===o.availableFields.length),e.R7$(7),e.AVh("has-items",o.rowFields.length>0)("drag-over",null!==o.draggedField),e.R7$(),e.Y8G("ngForOf",o.rowFields),e.R7$(),e.Y8G("ngIf",0===o.rowFields.length),e.R7$(6),e.AVh("has-items",o.columnFields.length>0)("drag-over",null!==o.draggedField),e.R7$(),e.Y8G("ngForOf",o.columnFields),e.R7$(),e.Y8G("ngIf",0===o.columnFields.length),e.R7$(6),e.AVh("has-items",o.valueFields.length>0)("drag-over",null!==o.draggedField),e.R7$(),e.Y8G("ngForOf",o.valueFields),e.R7$(),e.Y8G("ngIf",0===o.valueFields.length),e.R7$(9),e.R50("ngModel",o.columnHeadersWidth))},dependencies:[M.Sq,M.bT,R.me,R.Q0,R.BC,R.VZ,R.zX,R.vS,ut.Sc,Le.ms,_e.S,ee.C3],styles:[".pivot-configurator[_ng
1content-%COMP%]{display:flex;flex-direction:column}.config-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:250px 1fr;gap:16px;min-height:400px}.field-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;background:#fafafa;border-radius:6px;overflow:hidden}.field-panel[_ngcontent-%COMP%]   .panel-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;background:#dedede;border-bottom:1px solid #dedede}.field-panel[_ngcontent-%COMP%]   .panel-header[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{margin:0;font-size:13px;font-weight:600;color:#000;display:flex;align-items:center;gap:6px}.field-panel[_ngcontent-%COMP%]   .panel-header[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:12px}.field-panel[_ngcontent-%COMP%]   .panel-header[_ngcontent-%COMP%]   .field-count[_ngcontent-%COMP%]{font-size:11px;color:#7b7b7b;background:#fff;padding:2px 8px;border-radius:10px}.available-panel[_ngcontent-%COMP%]{max-height:500px}.available-panel[_ngcontent-%COMP%]   .field-search[_ngcontent-%COMP%]{display:flex;align-items:center;padding:8px 8px 0;gap:4px;flex-shrink:0}.available-panel[_ngcontent-%COMP%]   .field-search[_ngcontent-%COMP%]   .p-input-icon-left[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center}.available-panel[_ngcontent-%COMP%]   .field-search[_ngcontent-%COMP%]   .p-input-icon-left[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:12px}.available-panel[_ngcontent-%COMP%]   .field-search[_ngcontent-%COMP%]   .p-input-icon-left[_ngcontent-%COMP%]   .search-input[_ngcontent-%COMP%]{width:100%;padding:6px 10px 6px 30px;font-size:12px}.available-panel[_ngcontent-%COMP%]   .field-search[_ngcontent-%COMP%]   .clear-search-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;color:#7b7b7b;cursor:pointer;border-radius:50%}.available-panel[_ngcontent-%COMP%]   .field-search[_ngcontent-%COMP%]   .clear-search-btn[_ngcontent-%COMP%]:hover{background:#dedede;color:#000}.available-panel[_ngcontent-%COMP%]   .field-search[_ngcontent-%COMP%]   .clear-search-btn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:10px}.available-panel[_ngcontent-%COMP%]   .field-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;padding:8px;min-height:100px}.config-panels[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;overflow-y:auto;padding-right:4px;min-height:0;padding-bottom:8px}.drop-zone[_ngcontent-%COMP%]{flex:1;min-height:60px;padding:8px;border:2px dashed #dedede;border-radius:4px;margin:8px;transition:all .2s}.drop-zone.drag-over[_ngcontent-%COMP%]{border-color:#5f84fc;background:#5f84fc0d}.drop-zone.has-items[_ngcontent-%COMP%]{border-style:solid;border-color:transparent;background:transparent}.values-zone[_ngcontent-%COMP%]{min-height:100px;overflow:visible}.field-chip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:6px 10px;margin-bottom:6px;background:#fff;border:1px solid #dedede;border-radius:4px;cursor:grab;transition:all .15s;font-size:13px}.field-chip[_ngcontent-%COMP%]:hover{border-color:#5f84fc;box-shadow:0 2px 4px #0000001a}.field-chip[_ngcontent-%COMP%]:active{cursor:grabbing}.field-chip.configured[_ngcontent-%COMP%]{background-color:#fff;border-color:#dedede}.field-chip[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#7b7b7b;font-size:12px}.field-chip[_ngcontent-%COMP%]   .field-name[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.field-chip[_ngcontent-%COMP%]   .field-category[_ngcontent-%COMP%]{font-size:10px;font-weight:600;padding:2px 6px;border-radius:3px}.field-chip[_ngcontent-%COMP%]   .field-category.common[_ngcontent-%COMP%]{background:#fafafa;color:#09a564}.field-chip[_ngcontent-%COMP%]   .field-category.workflow[_ngcontent-%COMP%]{background:#fafafa;color:#5f84fc}.field-chip[_ngcontent-%COMP%]   .remove-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:none;background:transparent;color:#7b7b7b;cursor:pointer;border-radius:50%;transition:all .15s}.field-chip[_ngcontent-%COMP%]   .remove-btn[_ngcontent-%COMP%]:hover{background:#ff6868;color:#eb1212}.field-chip[_ngcontent-%COMP%]   .remove-btn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:10px}.value-config[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:10px;margin-bottom:8px;background:#fff;border:1px solid #dedede;border-radius:4px}.value-config[_ngcontent-%COMP%]   .value-field-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500}.value-config[_ngcontent-%COMP%]   .value-field-info[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#7b7b7b}
1.value-config[_ngcontent-%COMP%]   .value-config-controls[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.value-config[_ngcontent-%COMP%]   .value-config-controls[_ngcontent-%COMP%]     .p-dropdown .p-dropdown-label{padding:6px 10px;font-size:12px}.value-config[_ngcontent-%COMP%]   .value-config-controls[_ngcontent-%COMP%]   .caption-input[_ngcontent-%COMP%]{flex:1;padding:6px 10px;font-size:12px}.value-config[_ngcontent-%COMP%]   .value-config-controls[_ngcontent-%COMP%]   .remove-btn[_ngcontent-%COMP%]{flex-shrink:0}.value-config[_ngcontent-%COMP%]   .value-format-options[_ngcontent-%COMP%]{display:flex;gap:12px;padding-top:4px}.value-config[_ngcontent-%COMP%]   .value-format-options[_ngcontent-%COMP%]     .p-checkbox-label{font-size:11px;color:#7b7b7b}.drop-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;color:#7b7b7b;text-align:center}.drop-hint[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:20px;margin-bottom:8px}.drop-hint[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:12px}.empty-message[_ngcontent-%COMP%]{padding:16px;text-align:center;color:#7b7b7b;font-size:12px}.layout-settings[_ngcontent-%COMP%]{padding:12px 0;margin-top:12px;border-top:1px solid #dedede}.layout-settings[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{margin:0 0 12px;font-size:13px;font-weight:600;color:#000;display:flex;align-items:center;gap:6px}.layout-settings[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:12px}.layout-settings[_ngcontent-%COMP%]   .setting-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.layout-settings[_ngcontent-%COMP%]   .setting-row[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-size:13px;color:#7b7b7b;min-width:150px}.layout-settings[_ngcontent-%COMP%]   .setting-row[_ngcontent-%COMP%]   .width-control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.layout-settings[_ngcontent-%COMP%]   .setting-row[_ngcontent-%COMP%]   .width-control[_ngcontent-%COMP%]   .width-input[_ngcontent-%COMP%]{width:80px;padding:6px 10px;font-size:13px;text-align:center}.layout-settings[_ngcontent-%COMP%]   .setting-row[_ngcontent-%COMP%]   .width-control[_ngcontent-%COMP%]   .width-hint[_ngcontent-%COMP%]{font-size:11px;color:#7b7b7b}.legend[_ngcontent-%COMP%]{display:flex;gap:16px;padding:12px 0 0;margin-top:12px;border-top:1px solid #dedede;font-size:11px;color:#7b7b7b}.legend[_ngcontent-%COMP%]   .legend-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}"]})}}return i})();const Ji=()=>({width:"500px"});function ms(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",2)(1,"label"),e.EFF(2,"Data Source *"),e.k0s(),e.j41(3,"p-dropdown",10),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedWorkflowTypeId,o)||(r.selectedWorkflowTypeId=o),e.Njj(o)}),e.bIt("onChange",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onWorkflowChange())}),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.Y8G("options",t.groupedDataSourceOptions),e.R50("ngModel",t.selectedWorkflowTypeId),e.Y8G("group",!0)("filter",!0)}}function gs(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",2)(1,"label"),e.EFF(2,"Field *"),e.k0s(),e.j41(3,"p-dropdown",11),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedFieldName,o)||(r.selectedFieldName=o),e.Njj(o)}),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.Y8G("options",t.fieldOptions),e.R50("ngModel",t.selectedFieldName),e.Y8G("filter",!0)}}function hs(i,a){1&i&&(e.j41(0,"div",2)(1,"span",12),e.nrm(2,"i",13),e.EFF(3," Parameter will show all active users by full name. Map to a _name field (e.g., Created By_name, Assigned User_name) on each widget. "),e.k0s()())}function fs(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",2)(1,"label"),e.EFF(2,"Default Value"),e.k0s(),e.j41(3,"input",14),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.defaultValue,o)||(r.defaultValue=o),e.Njj(o)}),e.k0s(),e.j41(4,"span",12),e.EFF(5,"For multi-select, use comma-separated values"),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(3),e.R50("ngModel",t.defaultValue)}}function Cs(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCancel())}),e.EFF(1," Cancel "),e.k0s(),e.j41(2,"button",16),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onSave())}),e.EFF(3," Save Parameter "),e.k0s()}if(2&i){const t=e.XpG();e.R7$(2),e.Y8G("disabled",!t.canSave)}}let Gn=(()=>{class i{constructor(){this.parameter=null,this.visible=!1,this.workflowTypes=[],this.loadFieldMetadataFn=null,this.saved=new e.bkB,this.closed=new e.bkB,this.name="",this.description="",this.selectedWorkflowTypeId=null,this.selectedFieldName="",this.parameterType="dropdown",this.defaultValue="",this.required=!1,this.fieldOptions=[],this.fieldsLoading=!1,this.parameterTypeOptions=[{label:"Dropdown",value:"dropdown"},{label:"Multi-Select",value:"multi-select"},{label:"Text Input",value:"text"},{label:"Date Range",value:"date-range"}]}get isTenantUsers(){return this.selectedWorkflowTypeId===w.dg}get groupedDataSourceOptions(){return[{label:"System Data",items:[{workflowTypeId:w.dg,name:"Tenant Users",description:"All active users in the tenant",instanceCount:0,elementType:"SYSTEM"}]},{label:"Elements",items:this.workflowTypes}]}get canSave(){return!!(this.name.trim()&&("date-range"===this.parameterType||this.isTenantUsers||this.selectedWorkflowTypeId&&this.selectedFieldName))}ngOnChanges(t){t.parameter&&this.parameter&&(this.name=this.parameter.name||"",this.description=this.parameter.description||"",this.selectedWorkflowTypeId=this.parameter.workflowTypeId||null,this.selectedFieldName=this.parameter.fieldName||"",this.parameterType=this.parameter.parameterType||"dropdown",this.defaultValue=this.parameter.defaultValue||"",this.required=this.parameter.required||!1,this.selectedWorkflowTypeId&&this.selectedWorkflowTypeId!==w.dg&&this.loadFields(this.selectedWorkflowTypeId))}onWorkflowChange(){this.selectedFieldName="",this.fieldOptions=[],this.isTenantUsers?this.selectedFieldName=w.Ll:this.selectedWorkflowTypeId&&this.loadFields(this.selectedWorkflowTypeId)}onParameterTypeChange(){"date-range"===this.parameterType&&(this.selectedWorkflowTypeId=null,this.selectedFieldName="",this.defaultValue="",this.fieldOptions=[])}loadFields(t){this.loadFieldMetadataFn&&(this.fieldsLoading=!0,this.loadFieldMetadataFn(t).subscribe({next:n=>{const o=[...n.commonFields||[],...n.elementFields||[]];this.fieldOptions=o.filter(r=>"string"===r.type||"number"===r.type||"datetime"===r.type),this.fieldsLoading=!1},error:()=>{this.fieldsLoading=!1}}))}onSave(){if(!this.canSave||!this.parameter)return;const t={id:this.parameter.id,name:this.name.trim(),description:this.description.trim()||void 0,workflowTypeId:this.selectedWorkflowTypeId||0,fieldName:this.selectedFieldName,parameterType:this.parameterType,defaultValue:this.defaultValue||void 0,required:this.required};this.saved.emit(t)}
1onCancel(){this.closed.emit()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-parameter-configurator"]],inputs:{parameter:"parameter",visible:"visible",workflowTypes:"workflowTypes",loadFieldMetadataFn:"loadFieldMetadataFn"},outputs:{saved:"saved",closed:"closed"},features:[e.OA$],decls:21,vars:16,consts:[["header","Configure Parameter",3,"visibleChange","onHide","visible","modal","closable"],[1,"parameter-config-form"],[1,"form-field"],["type","text","pInputText","","placeholder","e.g., Status Filter",3,"ngModelChange","ngModel"],["type","text","pInputText","","placeholder","Optional description",3,"ngModelChange","ngModel"],["optionLabel","label","optionValue","value",3,"ngModelChange","onChange","options","ngModel"],["class","form-field",4,"ngIf"],[1,"form-field","checkbox-field"],["label","Required",3,"ngModelChange","ngModel","binary"],["pTemplate","footer"],["optionGroupLabel","label","optionGroupChildren","items","optionLabel","name","optionValue","workflowTypeId","filterBy","name","placeholder","Select data source...",3,"ngModelChange","onChange","options","ngModel","group","filter"],["optionLabel","displayName","optionValue","name","filterBy","displayName","placeholder","Select field...",3,"ngModelChange","options","ngModel","filter"],[1,"help-text"],[1,"mdi","mdi-information-outline"],["type","text","pInputText","","placeholder","Optional default value",3,"ngModelChange","ngModel"],["type","button",1,"button","button_outline",3,"click"],["type","button",1,"button","button_colorSuccess",3,"click","disabled"]],template:function(n,o){1&n&&(e.j41(0,"p-dialog",0),e.mxI("visibleChange",function(s){return e.DH7(o.visible,s)||(o.visible=s),s}),e.bIt("onHide",function(){return o.onCancel()}),e.j41(1,"div",1)(2,"div",2)(3,"label"),e.EFF(4,"Parameter Name *"),e.k0s(),e.j41(5,"input",3),e.mxI("ngModelChange",function(s){return e.DH7(o.name,s)||(o.name=s),s}),e.k0s()(),e.j41(6,"div",2)(7,"label"),e.EFF(8,"Description"),e.k0s(),e.j41(9,"input",4),e.mxI("ngModelChange",function(s){return e.DH7(o.description,s)||(o.description=s),s}),e.k0s()(),e.j41(10,"div",2)(11,"label"),e.EFF(12,"Parameter Type *"),e.k0s(),e.j41(13,"p-dropdown",5),e.mxI("ngModelChange",function(s){return e.DH7(o.parameterType,s)||(o.parameterType=s),s}),e.bIt("onChange",function(){return o.onParameterTypeChange()}),e.k0s()(),e.DNE(14,ms,4,4,"div",6)(15,gs,4,3,"div",6)(16,hs,4,0,"div",6)(17,fs,6,1,"div",6),e.j41(18,"div",7)(19,"p-checkbox",8),e.mxI("ngModelChange",function(s){return e.DH7(o.required,s)||(o.required=s),s}),e.k0s()()(),e.DNE(20,Cs,4,1,"ng-template",9),e.k0s()),2&n&&(e.Aen(e.lJ4(15,Ji)),e.R50("visible",o.visible),e.Y8G("modal",!0)("closable",!0),e.R7$(5),e.R50("ngModel",o.name),e.R7$(4),e.R50("ngModel",o.description),e.R7$(4),e.Y8G("options",o.parameterTypeOptions),e.R50("ngModel",o.parameterType),e.R7$(),e.Y8G("ngIf","date-range"!==o.parameterType),e.R7$(),e.Y8G("ngIf","date-range"!==o.parameterType&&o.selectedWorkflowTypeId&&!o.isTenantUsers),e.R7$(),e.Y8G("ngIf",o.isTenantUsers),e.R7$(),e.Y8G("ngIf","date-range"!==o.parameterType&&!o.isTenantUsers),e.R7$(2),e.R50("ngModel",o.required),e.Y8G("binary",!0))},dependencies:[M.bT,R.me,R.BC,R.vS,ke.Ei,ut.Sc,_t.l,Le.ms,_e.S],styles:[".parameter-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.form-field[_ngcontent-%COMP%]{margin-bottom:0}.form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:var(--text-color)}.form-field[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{width:100%}.form-field[_ngcontent-%COMP%]     .p-dropdown{width:100%}.form-field[_ngcontent-%COMP%]   .help-text[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.75rem;color:var(--text-color-secondary)}.checkbox-field[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}"]})}}return i})();const _i=()=>({standalone:!0});function $r(i,a){if(1&i&&(e.j41(0,"span",14),e.EFF(1),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.SpI(" From template: ",t.selectedTemplate.name," ")}}function qi(i,a){1&i&&e.nrm(0,"i",15)}function Ur(i,a){1&i&&e.nrm(0,"i",16)}function Qi(i,a){1&i&&(e.j41(0,"div",17),e.nrm(1,"kendo-loader",18),e.j41(2,"span"),e.EFF(3,"Loading..."),e.k0s()())}function Yr(i,a){1&i&&(e.j41(0,"small",40),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"AD_HOC_REPORTS.PIVOT.NAME_REQUIRED")," "))}function Hr(i,a){if(1&i){const t=e.RV6();e.j41(0,"label",43)(1,"input",44),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.dataSourceType,o)||(r.dataSourceType=o),e.Njj(o)}),e.bIt("change",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onDataSourceTypeChange())}),e.k0s(),e.EFF(2),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.AVh("active",n.dataSourceType===t.value),e.R7$(),e.Y8G("value",t.value),e.R50("ngModel",n.dataSourceType),e.Y8G("ngModelOptions",e.lJ4(6,_i)),e.R7$(),e.SpI(" ",t.label," ")}}function Zi(i,a){if(1&i&&(e.j41(0,"div",24)(1,"label"),e.EFF(2,"Data Source"),e.k0s(),e.j41(3,"div",41),e.DNE(4,Hr,3,7,"label",42),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(4),e.Y8G("ngForOf",t.dataSourceOptions)}}function vs(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",24)(1,"label",45),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",46),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);
1return e.DH7(r.selectedElementType,o)||(r.selectedElementType=o),e.Njj(o)}),e.bIt("onChange",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onElementTypeChange())}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,4,"AD_HOC_REPORTS.PIVOT.ENDPOINT_TYPE")),e.R7$(2),e.Y8G("options",t.elementTypeOptions),e.R50("ngModel",t.selectedElementType),e.Y8G("ngModelOptions",e.lJ4(6,_i))}}function bs(i,a){if(1&i&&(e.j41(0,"div",50)(1,"span",51),e.EFF(2),e.k0s(),e.j41(3,"span",52),e.EFF(4),e.k0s()()),2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.name),e.R7$(2),e.SpI("",t.instanceCount," instances")}}function Ts(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",24)(1,"label",47),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",48),e.nI1(5,"translate"),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onWorkflowTypeChange(o.value))}),e.DNE(6,bs,5,2,"ng-template",49),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.SpI("",e.bMT(3,5,"AD_HOC_REPORTS.PIVOT.ENDPOINT")," *"),e.R7$(2),e.FS9("placeholder",e.bMT(5,7,"AD_HOC_REPORTS.PIVOT.ENDPOINT_PLACEHOLDER")),e.Y8G("options",t.filteredWorkflowTypes)("showClear",!0)("filter",!0)}}function An(i,a){if(1&i&&(e.j41(0,"div",50)(1,"span",51),e.EFF(2),e.k0s(),e.j41(3,"span",52),e.EFF(4),e.k0s()()),2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.name),e.R7$(2),e.Lme("",t.primaryElementName," + ",t.joinedElementName,"")}}function Xr(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",24)(1,"label",53),e.EFF(2,"Data Set *"),e.k0s(),e.j41(3,"p-dropdown",54),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onDataSetChange(o.value))}),e.DNE(4,An,5,3,"ng-template",49),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(3),e.Y8G("options",t.dataSets)("showClear",!0)("filter",!0)}}function eo(i,a){if(1&i&&(e.j41(0,"div",24)(1,"label",55),e.EFF(2,"Date Range Field"),e.k0s(),e.nrm(3,"p-dropdown",56),e.j41(4,"small",57),e.EFF(5,"Which date field the date range applies to"),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(3),e.Y8G("options",t.dateFieldOptions)}}function Es(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",58),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.predefinedDateRange,o)||(r.predefinedDateRange=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("options",t.predefinedDateOptions),e.R50("ngModel",t.predefinedDateRange),e.Y8G("ngModelOptions",e.lJ4(3,_i))}}function Ss(i,a){if(1&i&&(e.j41(0,"div",59)(1,"div",24)(2,"label",60),e.EFF(3,"Date From"),e.k0s(),e.nrm(4,"p-calendar",61),e.k0s(),e.j41(5,"div",24)(6,"label",62),e.EFF(7,"Date To"),e.k0s(),e.nrm(8,"p-calendar",63),e.k0s()()),2&i){let t,n;const o=e.XpG(2);e.R7$(4),e.Y8G("showIcon",!0)("maxDate",(null==(t=o.reportForm.get("dateTo"))?null:t.value)||o.maxDate)("minDate",o.minDate),e.R7$(4),e.Y8G("showIcon",!0)("minDate",(null==(n=o.reportForm.get("dateFrom"))?null:n.value)||o.minDate)("maxDate",o.maxDate)}}function ks(i,a){if(1&i&&(e.j41(0,"div",66)(1,"span",67),e.EFF(2,"Description:"),e.k0s(),e.j41(3,"span",68),e.EFF(4),e.k0s()()),2&i){let t;const n=e.XpG(3);e.R7$(4),e.JRh(null==(t=n.getSelectedWorkflowType())?null:t.description)}}function l(i,a){if(1&i&&(e.j41(0,"p-card",64)(1,"div",65)(2,"div",66)(3,"span",67),e.EFF(4,"Name:"),e.k0s(),e.j41(5,"span",68),e.EFF(6),e.k0s()(),e.j41(7,"div",66)(8,"span",67),e.EFF(9,"Total Instances:"),e.k0s(),e.j41(10,"span",68),e.EFF(11),e.nI1(12,"number"),e.k0s()(),e.DNE(13,ks,5,1,"div",69),e.k0s()()),2&i){let t,n,o;const r=e.XpG(2);e.R7$(6),e.JRh(null==(t=r.getSelectedWorkflowType())?null:t.name),e.R7$(5),e.JRh(e.bMT(12,3,null==(n=r.getSelectedWorkflowType())?null:n.instanceCount)),e.R7$(2),e.Y8G("ngIf",null==(o=r.getSelectedWorkflowType())?null:o.description)}}function d(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",77)(1,"div",78)(2,"span",79),e.EFF(3),e.k0s(),e.j41(4,"span",80),e.EFF(5),e.k0s()(),e.j41(6,"div",81)(7,"button",82),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(4);return e.Njj(r.onEditParameter(o))}),e.nrm(8,"i",83),e.k0s(),e.j41(9,"button",84),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(4);return e.Njj(r.onDeleteParameter(o))}),e.nrm(10,"i",85),e.k0s()()()}if(2&i){const t=a.$implicit;e.R7$(3),e.JRh(t.name),e.R7$(2),e.JRh(t.parameterType)}}function p(i,a){if(1&i&&(e.j41(0,"div",75),e.DNE(1,d,11,2,"div",76),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.Y8G("ngForOf",t.parameters)}}function _(i,a){1&i&&(e.j41(0,"div",86)(1,"span"),e.EFF(2,"No parameters configured"),e.k0s()())}function h(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",70),e.DNE(1,p,2,1,"div",71)(2,_,3,0,"div",72),e.j41(3,"button",73),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onAddParameter())}),e.nrm(4,"i",74),e.EFF(5," Add Parameter "),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.parameters.length),e.R7$(),e.Y8G("ngIf",!t.parameters.length)}}function f(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-pivot-configurator",87),e.bIt("configurationChange",function(o){e.eBV(t);const r=e.XpG(2);
1return e.Njj(r.onPivotConfigChange(o))}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("fieldMetadata",t.fieldMetadata)("configuration",t.pivotConfig)}}function C(i,a){1&i&&(e.j41(0,"div",88),e.nrm(1,"i",89),e.j41(2,"p"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"AD_HOC_REPORTS.PIVOT.PIVOT_EMPTY")))}function S(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",19)(1,"form",20)(2,"div",21)(3,"div",22)(4,"p-card",23),e.nI1(5,"translate"),e.j41(6,"div",24)(7,"label",25),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.nrm(10,"input",26),e.nI1(11,"translate"),e.DNE(12,Yr,3,3,"small",27),e.k0s(),e.j41(13,"div",24)(14,"label",28),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.nrm(17,"textarea",29),e.nI1(18,"translate"),e.k0s(),e.DNE(19,Zi,5,1,"div",30)(20,vs,5,7,"div",30)(21,Ts,7,9,"div",30)(22,Xr,5,3,"div",30)(23,eo,6,1,"div",30),e.j41(24,"div",24)(25,"div",31)(26,"p-checkbox",32),e.nI1(27,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.usePredefinedDate,o)||(r.usePredefinedDate=o),e.Njj(o)}),e.k0s()(),e.DNE(28,Es,1,4,"p-dropdown",33),e.k0s(),e.DNE(29,Ss,9,6,"div",34),e.k0s(),e.DNE(30,l,14,5,"p-card",35)(31,h,6,2,"p-card",36),e.k0s(),e.j41(32,"div",37)(33,"p-card",23),e.nI1(34,"translate"),e.DNE(35,f,1,2,"cad-pivot-configurator",38)(36,C,5,3,"div",39),e.k0s()()()()()}if(2&i){let t,n;const o=e.XpG();e.R7$(),e.Y8G("formGroup",o.reportForm),e.R7$(3),e.Y8G("header",e.bMT(5,25,"AD_HOC_REPORTS.PIVOT.SETTINGS_TITLE")),e.R7$(4),e.SpI("",e.bMT(9,27,"AD_HOC_REPORTS.PIVOT.NAME_LABEL")," *"),e.R7$(2),e.AVh("ng-invalid",(null==(t=o.reportForm.get("name"))?null:t.invalid)&&(null==(t=o.reportForm.get("name"))?null:t.touched)),e.FS9("placeholder",e.bMT(11,29,"AD_HOC_REPORTS.PIVOT.NAME_PLACEHOLDER")),e.R7$(2),e.Y8G("ngIf",(null==(n=o.reportForm.get("name"))||null==n.errors?null:n.errors.required)&&(null==(n=o.reportForm.get("name"))?null:n.touched)),e.R7$(3),e.JRh(e.bMT(16,31,"AD_HOC_REPORTS.PIVOT.DESCRIPTION_LABEL")),e.R7$(2),e.FS9("placeholder",e.bMT(18,33,"AD_HOC_REPORTS.PIVOT.DESCRIPTION_PLACEHOLDER")),e.R7$(2),e.Y8G("ngIf",o.dataSets.length>0),e.R7$(),e.Y8G("ngIf","workflow"===o.dataSourceType),e.R7$(),e.Y8G("ngIf","workflow"===o.dataSourceType),e.R7$(),e.Y8G("ngIf","dataset"===o.dataSourceType),e.R7$(),e.Y8G("ngIf",o.dateFieldOptions.length>0),e.R7$(3),e.R50("ngModel",o.usePredefinedDate),e.Y8G("ngModelOptions",e.lJ4(39,_i))("binary",!0)("label",e.bMT(27,35,"AD_HOC_REPORTS.PIVOT.PREDEFINED_DATE")),e.R7$(2),e.Y8G("ngIf",o.usePredefinedDate),e.R7$(),e.Y8G("ngIf",o.isEditMode&&!o.usePredefinedDate),e.R7$(),e.Y8G("ngIf",o.getSelectedWorkflowType()),e.R7$(),e.Y8G("ngIf",o.fieldMetadata),e.R7$(2),e.Y8G("header",e.bMT(34,37,"AD_HOC_REPORTS.PIVOT.PIVOT_CONFIG")),e.R7$(2),e.Y8G("ngIf",o.fieldMetadata),e.R7$(),e.Y8G("ngIf",!o.fieldMetadata)}}function E(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-parameter-configurator",90),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onParameterSaved(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onParameterDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("parameter",t.editingParameter)("visible",t.showParameterDialog)("workflowTypes",t.workflowTypes)("loadFieldMetadataFn",t.loadFieldMetadataCallback)}}let y=(()=>{class i{get filteredWorkflowTypes(){return this.selectedElementType?this.workflowTypes.filter("HISTORY_WORKFLOW"===this.selectedElementType||"TIME_TRACKING_HISTORY"===this.selectedElementType?t=>t.elementType===ve.Q8.WORKFLOW:t=>t.elementType===this.selectedElementType):this.workflowTypes}onElementTypeChange(){this.reportForm.patchValue({workflowTypeId:null}),this.fieldMetadata=null,this.dateFieldOptions=[],this.filterFieldOptions=[]}constructor(t,n,o,r,s,c){this._router=t,this._route=n,this._fb=o,this._apiService=r,this._pivotService=s,this._messagingService=c,this._destroyed$=new ue.B7,this.workflowTypes=[],this.dataSets=[],this.templates=[],this.fieldMetadata=null,this.dataSourceType="workflow",this.dataSourceOptions=[{label:"Endpoint",value:"workflow"},{label:"Data Set",value:"dataset"}],this.elementTypeOptions=[{label:"Element: Workflow",value:ve.Q8.WORKFLOW},{label:"Element: Master Data",value:ve.Q8.MASTERDATA},{label:"Element: Documents",value:ve.Q8.DOCUMENT},{label:"Element: System Data",value:ve.Q8.SYSTEMDATA},{label:"History: Workflow",value:"HISTORY_WORKFLOW"},{label:"Time Tracking: History",value:"TIME_TRACKING_HISTORY"}],this.selectedElementType=ve.Q8.WORKFLOW,this.loading=!1,this.saving=!1,this.isEditMode=!1,this.reportId=null,this.templateId=null,this.report=null,this.selectedTemplate=null,this.dateFieldOptions=[],this.usePredefinedDate=!1,this.predefinedDateRange=null,this.predefinedDateOptions=[{label:"Current Week",value:"currentWeek"},{label:"Current Month",value:"currentMonth"},{label:"Current Quarter",value:"currentQuarter"},{label:"Current Year",value:"currentYear"}],this.parameters=[],this.showParameterDialog=!1,this.editingParameterIndex=-1,this.editingParameter=null,this.filterFieldOptions=[],this.fieldMetadataCache=new Map,this.loadFieldMetadataCallback=u=>{const g=this.fieldMetadataCache.get(u);return g?(0,le.of)(g):this._apiService.getFieldMetadata(u).pipe((0,Te.M)(b=>{this.fieldMetadataCache.set(u,b)}))},this.initForm(),this.initDates(),this.initPivotConfig()}ngOnInit(){this.reportId=this._route.snapshot.params.reportId,this.templateId=this._route.snapshot.params.templateId,this.isEditMode=!!this.reportId,this.loadInitialData()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}initForm(){this.reportForm=this._fb.group({name:["",[R.k0.required,R.k0.maxLength(200)]],description:["",[R.k0.maxLength(1e3)]],workflowTypeId:[null],dataSetId:[null],dateFrom:[null],dateTo:[null],dateField:["createdDate"]})}initDates(){this.maxDate=new Date,this.minDate=new Date,this.minDate.setFullYear(this.minDate.getFullYear()-2),this.dateTo=new Date,this.dateFrom=new Date,this.dateFrom.setDate(1),this.dateFrom.setMonth(this.dateFrom.getMonth()-1),this.reportForm.patchValue({dateFrom:this.dateFrom,dateTo:this.dateTo})}initPivotConfig(){this.pivotConfig={rows:[],columns:[],values:[]}}loadInitialData(){this.loading=!0;const t={workflowTypes:this._apiService.getWorkflowTypes().pipe((0,ye.W)(n=>(console.error("Error loading workflow types:",n),(0,le.of)([])))),templates:this._apiService.getTemplates().pipe((0,ye.W)(n=>(console.error("Error loading templates:",n),(0,le.of)([])))),dataSets:this._apiService.getDataSets().pipe((0,ye.W)(()=>(0,le.of)([])))};this.isEditMode&&this.reportId&&(t.report=this._apiService.getReportById(this.reportId).pipe((0,ye.W)(n=>(console.error("Error loading report:",n),(0,le.of)(null))))),(0,vt.p)(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:n=>{this.workflowTypes=n.workflowTypes||[],this.templates=n.templates||[],this.dataSets=n.dataSets||[],this.isEditMode&&n.report?(this.report=n.report,this.populateFormFromReport(n.report)):this.templateId&&this.applyTemplate(this.templateId)},error:n=>{this._messagingService.error("Failed to load data","Error"),console.error("Error loading initial data:",n)}})}populateFormFromReport(t){this.dataSourceType=t.dataSetId?"dataset":"workflow";const n=t.workflowTypeId?Number(t.workflowTypeId):null;let o;if(this.reportForm.patchValue({name:t.name,description:t.description,workflowTypeId:n,dataSetId:t.dataSetId||null}),t.endpointParameters)try{const s=JSON.parse(t.endpointParameters);s.standardDateRange?(this.usePredefinedDate=!0,this.predefinedDateRange=s.standardDateRange):(s.dateFrom&&this.reportForm.patchValue({dateFrom:new Date(s.dateFrom)}),s.dateTo&&this.reportForm.patchValue({dateTo:new Date(s.dateTo)})),s.dateField&&this.reportForm.patchValue({dateField:s.dateField}),s.endpointType&&(o=s.endpointType)}
1catch(s){console.error("Error parsing endpoint parameters:",s)}this.restoreElementType(o,t.endpointPath);let r=null;if(t.dataSetId?r=this._apiService.getDataSetFields(t.dataSetId):"HISTORY_WORKFLOW"===this.selectedElementType?r=(0,le.of)(this.getStagePresenceFieldMetadata()):"TIME_TRACKING_HISTORY"===this.selectedElementType?r=(0,le.of)(this.getTimeTrackingFieldMetadata()):n&&(r=this._apiService.getFieldMetadata(n)),r)r.pipe((0,L.Q)(this._destroyed$)).subscribe({next:s=>{if(this.fieldMetadata=s,this.buildDateFieldOptions(s),this.buildFilterFieldOptions(s),t.pivotConfiguration){const c=this._apiService.parsePivotConfig(t.pivotConfiguration);c&&(this.pivotConfig={...c},c.parameters?.length&&(this.parameters=[...c.parameters]))}},error:s=>{this._messagingService.error("Failed to load field metadata","Error"),console.error("Error loading field metadata:",s)}});else if(t.pivotConfiguration){const s=this._apiService.parsePivotConfig(t.pivotConfiguration);s&&(this.pivotConfig=s,s.parameters?.length&&(this.parameters=[...s.parameters]))}}applyTemplate(t){if(this.selectedTemplate=this.templates.find(n=>n.templateId===t)||null,this.selectedTemplate){if(this.selectedTemplate.defaultDateRangeDays){const n=new Date,o=new Date;o.setDate(o.getDate()-this.selectedTemplate.defaultDateRangeDays),this.reportForm.patchValue({dateFrom:o,dateTo:n})}if(this.selectedTemplate.defaultPivotConfiguration){const n=this._apiService.parsePivotConfig(this.selectedTemplate.defaultPivotConfiguration);n&&(this.pivotConfig=n)}this.reportForm.patchValue({name:`${this.selectedTemplate.name} - ${(new Date).toLocaleDateString()}`})}}onDataSourceTypeChange(){if(this.fieldMetadata=null,this.dateFieldOptions=[],"workflow"===this.dataSourceType){this.reportForm.patchValue({dataSetId:null});const t=this.reportForm.get("workflowTypeId")?.value;t&&this.loadFieldMetadata(t)}else{this.reportForm.patchValue({workflowTypeId:null});const t=this.reportForm.get("dataSetId")?.value;t&&this.loadDataSetFieldMetadata(t)}}onWorkflowTypeChange(t){t?this.loadFieldMetadata(t):(this.fieldMetadata=null,this.dateFieldOptions=[])}onDataSetChange(t){t?this.loadDataSetFieldMetadata(t):(this.fieldMetadata=null,this.dateFieldOptions=[])}loadFieldMetadata(t){if("HISTORY_WORKFLOW"===this.selectedElementType){const n=this.getStagePresenceFieldMetadata();return this.fieldMetadata=n,this.buildDateFieldOptions(n),void this.buildFilterFieldOptions(n)}if("TIME_TRACKING_HISTORY"===this.selectedElementType){const n=this.getTimeTrackingFieldMetadata();return this.fieldMetadata=n,this.buildDateFieldOptions(n),void this.buildFilterFieldOptions(n)}this._apiService.getFieldMetadata(t).pipe((0,L.Q)(this._destroyed$)).subscribe({next:n=>{this.fieldMetadata=n,this.buildDateFieldOptions(n),this.buildFilterFieldOptions(n)},error:n=>{this._messagingService.error("Failed to load field metadata","Error"),console.error("Error loading field metadata:",n)}})}getStagePresenceFieldMetadata(){return{commonFields:[],elementFields:[{name:"instanceId",displayName:"Instance ID",type:"string"},{name:"relativeId",displayName:"Relative ID",type:"number"},{name:"stageId",displayName:"Stage ID",type:"number"},{name:"title",displayName:"Title",type:"string"},{name:"stageName",displayName:"Stage Name",type:"string"},{name:"startDate",displayName:"Start Date",type:"datetime"},{name:"endDate",displayName:"End Date",type:"datetime"},{name:"durationHours",displayName:"Duration (Hours)",type:"number"},{name:"currentStageId",displayName:"Current Stage ID",type:"number"},{name:"currentStageName",displayName:"Current Stage Name",type:"string"},{name:"isNewInStageDuringPeriod",displayName:"New In Stage During Perio
1d",type:"boolean"},{name:"username",displayName:"User",type:"string"},{name:"usernameName",displayName:"User_name",type:"string"},{name:"url",displayName:"URL",type:"string"}]}}getTimeTrackingFieldMetadata(){return{commonFields:[],elementFields:[{name:"workflowId",displayName:"Workflow ID",type:"number"},{name:"workflowName",displayName:"Workflow Name",type:"string"},{name:"stageId",displayName:"Stage ID",type:"number"},{name:"stageName",displayName:"Stage Name",type:"string"},{name:"userId",displayName:"User ID",type:"number"},{name:"userName",displayName:"User Name",type:"string"},{name:"entries",displayName:"Entries",type:"number"},{name:"totalMinutes",displayName:"Total Minutes",type:"number"}]}}loadDataSetFieldMetadata(t){this._apiService.getDataSetFields(t).pipe((0,L.Q)(this._destroyed$)).subscribe({next:n=>{this.fieldMetadata=n,this.buildDateFieldOptions(n),this.buildFilterFieldOptions(n)},error:n=>{this._messagingService.error("Failed to load data set field metadata","Error"),console.error("Error loading data set field metadata:",n)}})}buildDateFieldOptions(t){const n=[...t.commonFields,...t.elementFields];this.dateFieldOptions=[{label:"Created Date (default)",value:"createdDate"},{label:"Modified Date",value:"modifiedDate"},...n.filter(o=>"datetime"===o.type&&"createdDate"!==o.name&&"modifiedDate"!==o.name).map(o=>({label:o.displayName,value:o.name}))]}buildFilterFieldOptions(t){const n=[...t.commonFields||[],...t.elementFields||[]],o=["string","text","lookup","dropdown","status"];this.filterFieldOptions=n.filter(r=>o.includes(r.type?.toLowerCase()||"")).map(r=>({label:r.displayName,value:r.name}))}onPivotConfigChange(t){this.pivotConfig=t}onAddParameter(){this.editingParameter={id:"param-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),name:"",workflowTypeId:0,fieldName:"",parameterType:"dropdown",required:!1},this.editingParameterIndex=-1,this.showParameterDialog=!0}onEditParameter(t){this.editingParameter={...this.parameters[t]},this.editingParameterIndex=t,this.showParameterDialog=!0}onDeleteParameter(t){this.parameters.splice(t,1)}onParameterSaved(t){this.editingParameterIndex>=0?this.parameters[this.editingParameterIndex]=t:this.parameters.push(t),this.showParameterDialog=!1,this.editingParameter=null}onParameterDialogClosed(){this.showParameterDialog=!1,this.editingParameter=null,this.editingParameterIndex=-1}onSave(){const t=this.reportForm.value;if(!t.name?.trim())return this.reportForm.get("name")?.markAsTouched(),void this._messagingService.warning("Please enter a report name","Validation");if("workflow"===this.dataSourceType&&!t.workflowTypeId)return void this._messagingService.warning("Please select an endpoint","Validation");if("dataset"===this.dataSourceType&&!t.dataSetId)return void this._messagingService.warning("Please select a data set","Validation");this.saving=!0;const n="HISTORY_WORKFLOW"===this.selectedElementType||"TIME_TRACKING_HISTORY"===this.selectedElementType,o=JSON.stringify({dateFrom:this.usePredefinedDate?void 0:t.dateFrom?.toISOString(),dateTo:this.usePredefinedDate?void 0:t.dateTo?.toISOString(),dateField:t.dateField||"createdDate",standardDateRange:this.usePredefinedDate?this.predefinedDateRange:void 0,endpointType:n?this.selectedElementType:void 0}),r={...this.pivotConfig,parameters:this.parameters.length>0?this.parameters:void 0},s=this._apiService.stringifyPivotConfig(r);if(this.isEditMode&&this.reportId)this._apiService.updateReport(this.reportId,{name:t.name,description:t.description,workflowTypeId:"workflow"===this.dataSourceType?t.workflowTypeId:void 0,dataSetId:"dataset"===this.dataSourceType?t.dataSetId:void 0,endpointParameters:o,pivotConfiguration:s}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:u=>{this._messagingService.success("Report updated successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",u.adHocReportId])},error:u=>{this._messagingService.error(u?.error?.message||"Failed to update report","
1Error"),console.error("Error updating report:",u)}});else{const c={name:t.name,description:t.description,entityType:w.dX.Workflow,workflowTypeId:"workflow"===this.dataSourceType?t.workflowTypeId:void 0,dataSetId:"dataset"===this.dataSourceType?t.dataSetId:void 0,templateId:this.templateId||void 0,endpointPath:"workflow"===this.dataSourceType?this.getEndpointPath(t.workflowTypeId):`/reporting/datasets/${t.dataSetId}`,endpointParameters:o,pivotConfiguration:s};this._apiService.createReport(c).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:u=>{this._messagingService.success("Report created successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",u.adHocReportId])},error:u=>{this._messagingService.error(u?.error?.message||"Failed to create report","Error"),console.error("Error creating report:",u)}})}}onCancel(){this._router.navigate(["/private/ad-hoc-reports"])}getEndpointPath(t){return"HISTORY_WORKFLOW"===this.selectedElementType?`/elements/element/${t}/stagePresenceReport`:"TIME_TRACKING_HISTORY"===this.selectedElementType?"/time-tracking/report":`/reporting/workflow/${t}`}restoreElementType(t,n){if(t)return void(this.selectedElementType=t);if(n){if(n.includes("stagePresenceReport"))return void(this.selectedElementType="HISTORY_WORKFLOW");if(n.includes("time-tracking/report"))return void(this.selectedElementType="TIME_TRACKING_HISTORY")}const o=this.reportForm.get("workflowTypeId")?.value;if(o&&this.workflowTypes.length>0){const r=this.workflowTypes.find(s=>s.workflowTypeId===o);r?.elementType&&(this.selectedElementType=r.elementType)}}getSelectedWorkflowType(){const t=this.reportForm.get("workflowTypeId")?.value;return this.workflowTypes.find(n=>n.workflowTypeId===t)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(R.ok),e.rXU(Ye.F),e.rXU(Ar),e.rXU(q.Ui))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-report-builder"]],decls:25,vars:27,consts:[[1,"report-builder-container"],[1,"builder-header"],[1,"header-title"],["type","button",1,"button","button_clear","button_colorAlt",3,"click","title"],[1,"mdi","mdi-arrow-left"],["class","template-badge",4,"ngIf"],[1,"header-actions"],["type","button",1,"button","button_outline",3,"click","title"],["type","button",1,"button","button_colorSuccess",3,"click","title","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-content-save buttonIcon_right",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","builder-content",4,"ngIf"],[3,"parameter","visible","workflowTypes","loadFieldMetadataFn","saved","closed",4,"ngIf"],[1,"template-badge"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-content-save","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[1,"builder-content"],[3,"formGroup"],[1,"builder-grid"],[1,"settings-panel"],[3,"header"],[1,"form-field"],["for","name"],["id","name","type","text","pInputText","","formControlName","name",3,"placeholder"],["class","p-error",4,"ngIf"],["for","description"],["id","description","pInputTextarea","","formControlName","description","rows","3",3,"placeholder"],["class","form-field",4,"ngIf"],[1,"predefined-toggle"],[3,"ngModelChange","ngModel","ngModelOptions","binary","label"],["optionLabel","label","optionValue","value","placeholder","Select date range...",3,"options","ngModel","ngModelOptions","ngModelChange",4,"ngIf"],["class","form-row",4,"ngIf"],["header","Endpoint Information","class","workflow-info-card",4,"ngIf"],["header","Parameters","class","parameters-card",4,"ngIf"],[1,"pivot-panel"],[3,"fieldMetadata","configuration","configurationChange",4,"ngIf"],["class","pivot-placeholder",4,"ngIf"],[1,"p-error"],[1,"data-source-toggle"],["class","toggle-option",3,"active",4,"ngFor","ngForOf"],[1,"toggle-option"],["type","radio",3,"ngModelChange","change","value","ngModel","ngModelOptions"],["for","elementType"],["id","elementType","optionLabel","label","optionValue","value","placeholder","Select endpoint type",3,"ngModelChange","onChange","options","ngModel","ngModelOptions"],["for","workflowType"],["id","workflowType","formControlName","workflowTypeId","optionLabel","name","optionValue","workflowTypeId","filterBy","name",3,"onChange","options","placeholder","showClear","filter"],["pTemplate","item"],[1,"workflow-option"],[1,"name"],[1,"count"],["for","dataSet"],["id","dataSet","formControlName","dataSetId","optionLabel","name","optionValue","dataSetId","placeholder","Select data set","filterBy","name",3,"onChange","options","showClear","filter"],["for","dateField"],["id","dateField","formControlName","dateField","optionLabel","label","optionValue","value","placeholder","Select date field for filtering",3,"options"],[1,"help-text"],["o
1ptionLabel","label","optionValue","value","placeholder","Select date range...",3,"ngModelChange","options","ngModel","ngModelOptions"],[1,"form-row"],["for","dateFrom"],["id","dateFrom","formControlName","dateFrom","dateFormat","mm/dd/yy","placeholder","Select start date","appendTo","body",3,"showIcon","maxDate","minDate"],["for","dateTo"],["id","dateTo","formControlName","dateTo","dateFormat","mm/dd/yy","placeholder","Select end date","appendTo","body",3,"showIcon","minDate","maxDate"],["header","Endpoint Information",1,"workflow-info-card"],[1,"workflow-info"],[1,"info-row"],[1,"label"],[1,"value"],["class","info-row",4,"ngIf"],["header","Parameters",1,"parameters-card"],["class","parameter-list",4,"ngIf"],["class","no-parameters",4,"ngIf"],["type","button",1,"button","button_outline","button_sm","add-parameter-btn",3,"click"],[1,"mdi","mdi-plus"],[1,"parameter-list"],["class","parameter-item",4,"ngFor","ngForOf"],[1,"parameter-item"],[1,"parameter-info"],[1,"parameter-name"],[1,"parameter-type-badge"],[1,"parameter-actions"],["type","button","title","Edit Parameter",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil"],["type","button","title","Delete Parameter",1,"button","button_round","delete-btn",3,"click"],[1,"mdi","mdi-trash-can"],[1,"no-parameters"],[3,"configurationChange","fieldMetadata","configuration"],[1,"pivot-placeholder"],[1,"mdi","mdi-table"],[3,"saved","closed","parameter","visible","workflowTypes","loadFieldMetadataFn"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),e.nI1(4,"translate"),e.bIt("click",function(){return o.onCancel()}),e.nrm(5,"i",4),e.k0s(),e.j41(6,"h2"),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"translate"),e.k0s(),e.DNE(10,$r,2,1,"span",5),e.k0s(),e.j41(11,"div",6)(12,"button",7),e.nI1(13,"translate"),e.bIt("click",function(){return o.onCancel()}),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.j41(16,"button",8),e.nI1(17,"translate"),e.bIt("click",function(){return o.onSave()}),e.DNE(18,qi,1,0,"i",9)(19,Ur,1,0,"i",10),e.EFF(20),e.nI1(21,"translate"),e.k0s()()(),e.DNE(22,Qi,4,0,"div",11)(23,S,37,40,"div",12),e.k0s(),e.DNE(24,E,1,4,"cad-parameter-configurator",13)),2&n&&(e.R7$(3),e.Y8G("title",e.bMT(4,13,"GENERAL.GO_BACK")),e.R7$(4),e.JRh(o.isEditMode?e.bMT(8,15,"AD_HOC_REPORTS.PIVOT.EDIT_TITLE"):e.bMT(9,17,"AD_HOC_REPORTS.PIVOT.NEW_TITLE")),e.R7$(3),e.Y8G("ngIf",o.selectedTemplate),e.R7$(2),e.Y8G("title",e.bMT(13,19,"GENERAL.CANCEL")),e.R7$(2),e.SpI(" ",e.bMT(15,21,"GENERAL.CANCEL")," "),e.R7$(2),e.Y8G("title",e.bMT(17,23,"AD_HOC_REPORTS.PIVOT.SAVE"))("disabled",o.saving),e.R7$(2),e.Y8G("ngIf",o.saving),e.R7$(),e.Y8G("ngIf",!o.saving),e.R7$(),e.SpI(" ",e.bMT(21,25,"AD_HOC_REPORTS.PIVOT.SAVE")," "),e.R7$(2),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading),e.R7$(),e.Y8G("ngIf",o.showParameterDialog&&o.editingParameter))},dependencies:[M.Sq,M.bT,R.qT,R.me,R.Fm,R.BC,R.cb,R.vS,R.j4,R.JD,ke.Ei,ui.Vv,ut.Sc,Le.ms,_e.S,mt.Z,ee.C3,ze.VU,_n,_s,Gn,M.QX,nt.D9],styles:[".report-builder-container[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;overflow:hidden}.builder-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;background:#fff;border-bottom:1px solid #dedede;flex-shrink:0}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-size:20px;font-weight:600}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   .template-badge[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b;background:#fafafa;padding:4px 12px;border-radius:12px}.builder-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:12px}.loading-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:#7b7b7b}.builder-content[_ngcontent-%COMP%]{flex:1;overflow:auto;padding:24px;background:#fafafa}.builder-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:400px 1fr;gap:24px;min-height:100%}@media (max-width: 1200px){.builder-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.settings-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px}.settings-panel[_ngcontent-%COMP%]     .p-card .p-card-body{padding:16px}.settings-panel[_ngcontent-%COMP%]     .p-card .p-card-title{font-size:16px;font-weight:600;margin-bottom:16px}.form-field[_ngcontent-%COMP%]{margin-bottom:16px}.form-field[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:6px;font-weight:500;font-size:14px;color:#000}.form-field[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]     .p-dropdown, .form-field[_ngcontent-%COMP%]     .p-calendar{width:100%}.form-field[_ngcontent-%COMP%]   .p-error[_ngcontent-%COMP%]{font-size:12px;margin-top:4px;display:block}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:16px}.workflow-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.workflow-option[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{font-weight:500}.workflow-option[_ngcontent-%COMP%]   .count[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b}.workflow-info-card[_ngcontent-%COMP%]   .workflow-info[_ngcontent-%COMP%]   .info-row[_ngcontent-%COMP%]{display:flex;gap:8px;margin-bottom:8px}.workflow-info-card[_ngcontent-%COMP%]   .workflow-info[_ngcontent-%COMP%]   .info-row[_ngcontent-%COMP%]:last-child{margin-bottom:0}.workflow-info-card[_ngcontent-%COMP%]   .workflow-info[_ngcontent-%COMP%]   .info-row[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{font-weight:500;color:#7b7b7b;min-width:100px}.workflow-info-card[_ngcontent-%COMP%]   .workflow-info[_ngcontent-%COMP%]   .info-row[_ngcontent-%COMP%]   .value[_ngcontent-%COMP%]{color:#000}.pivot-panel[_ngcontent-%COMP%]     .p-card{height:100%}.pivot-panel[_ngcontent-%COMP%]     .p-card .p-card-body{height:100%;padding:16px}.pivot-panel[_ngcontent-%COMP%]     .p-card .p-card-content{height:calc(100% - 40px)}.pivot-panel[_ngcontent-%COMP%]     .p-card .p-card-title{font-size:16px;font-weight:600;margin-bottom:16px}.data-source-toggle[_ngcontent-%COMP%]{display:flex;gap:0;border:1px solid #dedede;border-radius:6px;overflow:hidden}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;justify-content:center;padding:8px 12px;cursor:pointer;font-size:13px;font-weight:500;color:#7b7b7b;background:#fff;transition:all .2s;border-right:1px solid #dedede}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option[_ngcontent-%COMP%]:last-child{border-right:none}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option.active[_ngcontent-%COMP%]{background:#5f84fc;color:#fff}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]{display:none}.help-text[_ngcontent-%COMP%]{display:block;margin-top:4px;font-size:12px;color:#7b7b7b}.pivot-placeholder[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px;color:#7b7b7b;text-align:center}.pivot-placeholder[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:48px;margin-bottom:16px}.pivot-placeholder[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;font-size:14px}.parameters-card[_ngcontent-%COMP%]{margin-top:12px}.parameter-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}.parameter-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:#f8f9fa;border-radius:6px;border:1px solid #e9ecef}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-name[_ng
1content-%COMP%]{font-weight:500;font-size:13px}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-type-badge[_ngcontent-%COMP%]{font-size:11px;padding:2px 6px;border-radius:4px;background:#e3f2fd;color:#1565c0}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]{display:flex;gap:4px}.parameter-item[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{color:#dc3545}.no-parameters[_ngcontent-%COMP%]{color:#6c757d;font-size:13px;padding:8px 0}.add-parameter-btn[_ngcontent-%COMP%]{margin-top:8px}"]})}}return i})();var O=F(19493),N=F(56964),v=F(64256),A=F(83974),z=F(8543),me=F(91730),ie=F(30982),we=F(44670),Ne=F(73586),rt=F(8982),gt=F(79928),K=F(74337),nn=F(85113),Ee=F(78160),Fe=F(39601),on=F(45817),to=F(59204),Oe=F(49090),Me=F(95006),yt=F(20522),ae=F(58728),Wt=F(2819),bt=F(17753),mi=F(25703),Lt=F(54641),wt=F(9611),no=F(63020),Wr=F(65987),H=F(95580),Se=F(79668),He=F(68430),Tt=F(345),de=F(48936),Ie=F(89514),Pe=F(81553),je=F(68911),Et=F(69120),at=F(43206),Be=F(27610),st=F(49969),Bt=F(31638),lt=F(53699),dt=F(34542);F(23720);const Rs=["kendoTreeListLoading",""],gi=["kendoTreeListCell",""],hi=i=>({"aria-label":i});function io(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",8),2&i){const t=e.XpG(3);e.Y8G("svgIcon",t.noneIcon)}}function Is(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",9),2&i){const t=e.XpG(3);e.Y8G("name",t.arrowIcon)("svgIcon",t.arrowSVGIcon)}}function oo(i,a){1&i&&e.nrm(0,"span",10)}function zr(i,a){if(1&i&&(e.qex(0),e.DNE(1,io,1,1,"kendo-icon-wrapper",5),e.nI1(2,"levelItems"),e.DNE(3,Is,1,2,"kendo-icon-wrapper",6)(4,oo,1,0,"span",7),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",e.i5U(2,3,t.level,t.hasChildren&&t.expandIcons)),e.R7$(2),e.Y8G("ngIf",t.hasChildren&&t.expandIcons&&!t.loading),e.R7$(),e.Y8G("ngIf",t.hasChildren&&t.expandIcons&&t.loading)}}function T(i,a){if(1&i&&e.eu8(0,11),2&i){const t=e.XpG(2);e.Y8G("ngTemplateOutlet",t.column.templateRef)("ngTemplateOutletContext",t.templateContext)}}function I(i,a){if(1&i&&(e.qex(0),e.EFF(1),e.nI1(2,"valueOf"),e.bVm()),2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(),e.SpI(" ",e.brH(2,1,n.dataItem,t.field,t.format)," ")}}function x(i,a){if(1&i&&(e.qex(0),e.DNE(1,I,3,5,"ng-container",12),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.childColumns)}}function P(i,a){if(1&i&&(e.qex(0),e.EFF(1),e.nI1(2,"valueOf"),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.JRh(e.brH(2,1,t.dataItem,t.column.field,t.column.format))}}function G(i,a){if(1&i&&e.nrm(0,"kendo-checkbox",13),2&i){const t=e.XpG(2);e.Y8G("inputAttributes",e.eq3(2,hi,t.messageFor("selectRowCheckboxLabel")))("checkedState",t.selected)}}function j(i,a){if(1&i&&(e.qex(0),e.nrm(1,"kendo-icon-wrapper",14),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("svgIcon",t.reorderIcon)}}function X(i,a){if(1&i&&(e.qex(0),e.DNE(1,zr,5,6,"ng-container",2)(2,T,1,2,"ng-container",3)(3,x,2,1,"ng-container",2)(4,P,3,5,"ng-container",2)(5,G,1,4,"ng-template",4)(6,j,2,1,"ng-container",2),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.column.expandable),e.R7$(),e.Y8G("ngIf",t.column.templateRef),e.R7$(),e.Y8G("ngIf",t.isSpanColumn),e.R7$(),e.Y8G("ngIf",t.isBoundColumn),e.R7$(),e.Y8G("ngIf",t.column.isCheckboxColumn&&!t.isNew),e.R7$(),e.Y8G("ngIf",t.column.isRowReorderColumn&&!t.isNew)}}function Q(i,a){if(1&i&&e.eu8(0,11),2&i){const t=e.XpG(2);e.Y8G("ngTemplateOutlet",t.column.editTemplateRef)("ngTemplateOutletContext",t.editTemplateContext)}}function W(i,a){if(1&i&&e.nrm(0,"kendo-numerictextbox",19),2&i){const t=e.XpG(3);e.Y8G("format",t.format)("formControl",t.formGroup.get(t.column.field))}}function fe(i,a){if(1&i&&e.nrm(0,"kendo-datepicker",19),2&i){const t=e.XpG(3);e.Y8G("format",t.format)("formControl",t.formGroup.get(t.column.field))}}function re(i,a){if(1&i&&e.nrm(0,"kendo-checkbox",20),2&i){const t=e.XpG(3);e.Y8G("formControl",t.formGroup.get(t.column.field))}}function se(i,a){if(1&i&&e.nrm(0,"kendo-textbox",20),2&i){const t=e.XpG(3);e.Y8G("formControl",t.formGroup.get(t.column.field))}}function Ce(i,a){if(1&i&&(e.qex(0,0),e.DNE(1,W,1,2,"kendo-numerictextbox",16)(2,fe,1,2,"kendo-datepicker",16)(3,re,1,1,"kendo-checkbox",17)(4,se,1,1,"kendo-textbox",18),e.bVm()),2&i){const t=e.XpG(2);e.Y8G("ngSwitch",t.column.editor),e.R7$(),e.Y8G("ngSwitchCase","numeric"),e.R7$(),e.Y8G("ngSwitchCase","date"),e.R7$(),e.Y8G("ngSwitchCase","boolean")}}function oe(i,a){if(1&i&&(e.qex(0),e.DNE(1,Q,1,2,"ng-container",3)(2,Ce,5,4,"ng-container",15),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.column.editTemplateRef),e.R7$(),e.Y8G("ngIf",!t.column.editTemplateRef)}}const xe=["kendoTreeListTableBody",""],ct=(i,a)=>({dataItem:i,index:a}),Ke=(i,a,t,n,o,r,s)=>({$implicit:i,aggregates:a,column:t,columnIndex:n,field:o,items:r,parentItem:s});function St(i,a){if(1&i&&e.eu8(0,6),2&i){const t=e.XpG(2);e.Y8G("ngTemplateOutlet",t.noRecordsTemplate.templateRef)}}function Pt(i,a){if(1&i&&(e.qex(0),e.EFF(1),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.SpI(" ",t.noRecordsText," ")}}function bn(i,a){if(1&i&&(e.j41(0,"tr",2)(1,"td",3),e.DNE(2,St,1,1,"ng-container",4)(3,Pt,2,1,"ng-container",5),e.k0s()()),2&i){const t=e.XpG();e.R7$(),e.BMQ("colspan",t.colSpan),e.R7$(),e.Y8G("ngIf",null==t.noRecordsTemplate?null:t.noRecordsTemplate.templateRef),e.R7$(),e.Y8G("ngIf",!(null!=t.noRecordsTemplate&&t.noRecordsTemplate.templateRef))}}function Qe(i,a){if(1&i&&e.nrm(0,"td",11),2&i){const t=a.$implicit,n=a.index,o=e.XpG(2).$implicit,r=e.XpG();e.AVh("k-grid-edit-cell",r.isEditingCell(o,t))("k-selected",r.isCellSelected(o.data,t,r.lockedColumnsCount+n)),e.Y8G("columnIndex",r.lockedColumnsCount+n)("column",t)("viewItem",o)("dataItem",o.data)("level",o.level)("hasChildren",o.hasChildren)("isExpanded",o.expanded)("rowIndex",o.rowIndex)("loading",o.loading)("isNew",o.isNew)("selected",o.selected)("expandIcons",r.expandIcons)("logicalRowIndex",r.logicalRowIndex(o.rowIndex))("logicalColIndex",r.logicalColIndex(t))("dataRowIndex",o.index)("column",t)("colIndex",n)("colSpan",t.colspan)("expandable",r.cellExpandable(o,t))("ngClass",t.cssClass)("ngStyle",t.style),e.BMQ("aria-expanded",r.lockedColumnsCount<1?r.ariaExpanded(o,t):void 0)("aria-selected",r.lockedColumnsCount<1?r.ariaSelected(o,t,r.lockedColumnsCount+n):void 0)("role",t.tableCellsRole)("colspan",t.colspan)}}function a_(i,a){if(1&i&&(e.j41(0,"tr",9),e.DNE(1,Qe,1,29,"td",10),e.k0s()),2&i){const t=e.XpG(),n=t.$implicit,o=t.index,r=e.XpG();e.ZvI("k-table-row",r.isOdd(n)?" k-alt k-table-alt-row":"",""),e.AVh("k-grid-edit-row",r.isEditingRow(n))("k-grid-add-row",n.isNew)("k-selected",n.selected),e.Y8G("dataRowIndex",n.index)("dataItem",n.data)("logicalRowIndex",r.logicalRowIndex(n.rowIndex))("logicalSlaveRow",r.lockedColumnsCount>0)("logicalCellsCount",r.columns.length)("logicalSlaveCellsCount",r.unlockedColumnsCount(n))("totalColumns",r.totalColumns)("isNew",n.isNew)("ngClass",r.rowClass(e.l_i(23,ct,n.data,n.index))),e.BMQ("aria-expanded",r.ariaRowExpanded(n))("aria-selected",r.ariaRowSelected(n))("data-treelist-view-index",o),e.R7$(),e.Y8G("ngForOf",r.columns)("ngForTrackBy",r.trackByColumns)}}function s_(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",17),2&i){const t=e.XpG(5);e.Y8G("svgIcon",t.noneIcon)}}function l_(i,a){if(1&i&&(e.qex(0),e.DNE(1,s_,1,1,"kendo-icon-wrapper",16),e.nI1(2,"levelItems"),e.bVm()),2&i){const t=e.XpG(3).$implicit;e.R7$(),e.Y8G("ngForOf",e.bMT(2,1,t.level))}}function d_(i,a){if(1&i&&(e.j41(0,"td",14),e.DNE(1,l_,3,3,"ng-container",5),e.eu8(2,15),e.k0s()),2&i){const t=a.$implicit,n=a.index,o=e.XpG(2).$implicit,r=e.XpG();e.Y8G("logicalRowIndex",r.logicalRowIndex(o.rowIndex))("logicalColIndex",r.logicalColIndex(t))("column",t)("colIndex",n)("ngClass",t.footerClass)("ngStyle",t.footerStyle),e.BMQ("role",t.tableCellsRole),e.R7$(),e.Y8G("ngIf",t.expandable),e.R7$(),e.Y8G("ngTemplateOutlet",t.footerTemplateRef)("ngTemplateOutletContext",e.sGs(10,Ke,o.aggregates,o.aggregates,t,n,t.field,o.items,o.parentItem))}}function c_(i,a){if(1&i&&(e.j41(0,"tr",12),e.DNE(1,d_,3,18,"td",13),e.k0s()),2&i){const t=e.XpG(),n=t.$implicit,o=t.index,r=e.XpG();e.Y8G("logicalRowIndex",r.logicalRowIndex(n.rowIndex))("logicalSlaveRow",r.lockedColumnsCount>0)("logicalCellsCount",r.columns.length)("logicalSlaveCellsCount",r.unlockedColumnsCount(n))("totalColumns",r.totalColumns),e.BMQ("data-treelist-view-index",o),e.R7$(),e.Y8G("ngForOf",r.footerColumns)("ngForTrackBy",r.trackByColumns)}}function p_(i,a){if(1&i&&(e.qex(0),e.DNE(1,a_,2,26,"tr",7)(2,c_,2,8,"tr",8),e.bVm()),2&i){const t=a.$implicit,n=e.XpG();e.R7$(),e.Y8G("ngIf","data"===t.type),e.R7$(),e.Y8G("ngIf","footer"===t.type&&n.hasFooter)}}const u_=["kendoTreeListColGroup",""];function __(i,a){1&i&&e.nrm(0,"col"),2&i&&e.xc7("width",a.$implicit.width,"px")}
1const m_=["container"],g_=["table"],h_=["lockedContainer"],f_=["lockedTable"],C_=(i,a,t,n)=>({keydown:i,scroll:a,mousewheel:t,DOMMouseScroll:n});function v_(i,a){if(1&i&&(e.j41(0,"div",14,2)(2,"div",6)(3,"table",15,3),e.nrm(5,"colgroup",8)(6,"tbody",16),e.k0s(),e.nrm(7,"kendo-resize-sensor"),e.k0s(),e.j41(8,"div",11),e.nrm(9,"div"),e.k0s()()),2&i){const t=e.XpG();e.xc7("width",t.lockedWidth,"px"),e.Y8G("kendoEventsOutsideAngular",e.ziG(21,C_,t.lockedKeydown,t.lockedScroll,t.lockedMousewheel,t.lockedMousewheel))("scope",t),e.R7$(3),e.xc7("width",t.lockedWidth,"px"),e.Y8G("locked",!0),e.R7$(2),e.Y8G("columns",t.lockedLeafColumns),e.R7$(),e.Y8G("isLocked",!0)("view",t.view)("noRecordsText","")("columns",t.lockedLeafColumns)("totalColumnsCount",t.leafColumns.length)("totalColumns",t.columns)("skip",t.skip)("trackBy",t.trackBy)("filterable",t.filterable)("rowClass",t.rowClass)("expandIcons",t.expandIcons),e.R7$(3),e.xc7("height",t.totalHeight,"px")}}function b_(i,a){1&i&&e.nrm(0,"kendo-resize-sensor")}function T_(i,a){1&i&&e.nrm(0,"kendo-resize-sensor")}function E_(i,a){if(1&i&&(e.j41(0,"div",17),e.nrm(1,"div"),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.xc7("width",t.totalWidth,"px")}}function S_(i,a){1&i&&e.nrm(0,"div",18)}const k_=["dropdown"],hd=()=>({width:"auto"});function R_(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-dropdownlist",3,0),e.bIt("valueChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onChange(o))})("keydown",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.dropdownKeydown(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("data",t.operators)("value",t.value)("svgIcon",t.filterSVGIcon)("valuePrimitive",!0)("popupSettings",e.lJ4(6,hd)),e.BMQ("aria-label",t.column&&t.columnLabel)}}function I_(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",4),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.clearClick())})("keydown",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.clearKeydown(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("svgIcon",t.filterClearIcon)("title",t.clearText)}}const zt=["*"],y_=["kendoTreeListFilterCell",""];function w_(i,a){if(1&i&&(e.qex(0),e.eu8(1,3),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("column",t.column)("filter",t.filter)}}function D_(i,a){}function O_(i,a){if(1&i&&e.DNE(0,D_,0,0,"ng-template",4),2&i){const t=e.XpG(3);e.Y8G("ngTemplateOutlet",t.column.filterCellTemplateRef)("ngTemplateOutletContext",t.templateContext)}}function x_(i,a){if(1&i&&(e.qex(0),e.DNE(1,O_,1,2,null,0),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.column.filterCellTemplateRef)}}function M_(i,a){if(1&i&&(e.qex(0)(1,1),e.DNE(2,w_,2,2,"ng-container",2)(3,x_,2,1,"ng-container",2),e.bVm()()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngSwitch",t.hasTemplate),e.R7$(),e.Y8G("ngSwitchCase",!1),e.R7$(),e.Y8G("ngSwitchCase",!0)}}const F_=["kendoTreeListFilterRow",""];function P_(i,a){if(1&i&&e.nrm(0,"td",1),2&i){const t=a.$implicit,n=a.index,o=e.XpG();e.Y8G("column",t)("filter",o.filter)("logicalRowIndex",o.logicalRowIndex)("logicalColIndex",o.lockedColumnsCount+n)("column",o.getColumnComponent(t))("colIndex",n),e.BMQ("aria-label",o.filterLabel)}}function N_(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-dropdownlist",3),e.bIt("valueChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.logicChange(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("data",t.logicOperators)("valuePrimitive",!0)("value",null==t.filter?null:t.filter.logic)}}function G_(i,a){if(1&i&&e.nrm(0,"kendo-treelist-string-filter-menu-input",4),2&i){const t=e.XpG();e.Y8G("operators",t.operators)("currentFilter",t.secondFilter)("filterService",t.filterService)("column",t.column)("filter",t.filter)("placeholder",t.extraPlaceholder)}}function A_(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-dropdownlist",3),e.bIt("valueChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.logicChange(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("data",t.logicOperators)("valuePrimitive",!0)("value",null==t.filter?null:t.filter.logic)}}function L_(i,a){if(1&i&&e.nrm(0,"kendo-treelist-numeric-filter-menu-input",4),2&i){const t=e.XpG();e.Y8G("operators",t.operators)("currentFilter",t.secondFilter)("filterService",t.filterService)("column",t.column)("filter",t.filter)("format",t.format)("decimals",t.decimals)("spinners",t.spinners)("min",t.min)("max",t.max)("step",t.step)("placeholder",t.extraPlaceholder)}}function B_(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-dropdownlist",3),e.bIt("valueChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.logicChange(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("data",t.logicOperators)("valuePrimitive",!0)("value",null==t.filter?null:t.filter.logic)}}function j_(i,a){if(1&i&&e.nrm(0,"kendo-treelist-date-filter-menu
1-input",4),2&i){const t=e.XpG();e.Y8G("operators",t.operators)("currentFilter",t.secondFilter)("filterService",t.filterService)("column",t.column)("filter",t.filter)("activeView",t.activeView)("bottomView",t.bottomView)("topView",t.topView)("format",t.format)("formatPlaceholder",t.formatPlaceholder)("placeholder",t.placeholder)("min",t.min)("max",t.max)("weekNumber",t.weekNumber)}}const V_=["inputElem"];function $_(i,a){if(1&i){const t=e.RV6();e.j41(0,"li")(1,"kendo-radiobutton",3,0),e.bIt("checkedChange",function(){const o=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.onChange(o.value))}),e.k0s(),e.j41(3,"label",4),e.EFF(4),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG();e.R7$(),e.Y8G("columnLabel",n.columnLabel)("name",n.idPrefix)("checked",n.isSelected(t.value)),e.BMQ("id",n.radioId(t.value)),e.R7$(2),e.BMQ("for",n.radioId(t.value)),e.R7$(),e.JRh(t.text)}}function U_(i,a){if(1&i&&(e.qex(0),e.eu8(1,7),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("filterService",t.childService)("column",t.column)("filter",t.childFilter)}}function Y_(i,a){}function H_(i,a){if(1&i&&e.DNE(0,Y_,0,0,"ng-template",9),2&i){const t=e.XpG(2);e.Y8G("ngTemplateOutlet",t.column.filterMenuTemplateRef)("ngTemplateOutletContext",t.templateContext)}}function X_(i,a){if(1&i&&(e.qex(0),e.DNE(1,H_,1,2,null,8),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.column.filterMenuTemplateRef)}}function W_(i,a){if(1&i&&(e.j41(0,"div",2),e.eu8(1,3),e.k0s()),2&i){e.XpG();const t=e.sdS(2);e.R7$(),e.Y8G("ngTemplateOutlet",t)}}function z_(i,a){1&i&&e.nrm(0,"span",9)}function K_(i,a){if(1&i&&(e.j41(0,"span",10),e.nrm(1,"kendo-icon-wrapper",5),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("name",t.expandedIcon)("svgIcon",t.expandedSvgIcon)}}function J_(i,a){if(1&i&&(e.j41(0,"div",11),e.eu8(1,3),e.k0s()),2&i){const t=e.XpG(2);e.xc7("overflow","hidden"),e.Y8G("@state",t.contentState),e.R7$(),e.Y8G("ngTemplateOutlet",t.contentTemplate.templateRef)}}function q_(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",4),e.bIt("click",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onClick(o))}),e.nrm(1,"kendo-icon-wrapper",5),e.EFF(2),e.DNE(3,z_,1,0,"span",6)(4,K_,2,2,"span",7),e.k0s(),e.DNE(5,J_,2,4,"div",8)}if(2&i){const t=e.XpG();e.AVh("k-selected",t.selected)("k-disabled",t.disabled),e.R7$(),e.Y8G("name",t.icon)("svgIcon",t.svgIcon),e.R7$(),e.SpI(" ",t.text," "),e.R7$(),e.Y8G("ngIf",t.contentTemplate),e.R7$(),e.Y8G("ngIf",t.contentTemplate),e.R7$(),e.Y8G("ngIf",t.contentTemplate)}}function Q_(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-treelist-filter-menu-container",2),e.bIt("close",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.close())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("column",t.service.column)("filter",t.service.filter)("actionsClass",t.actionsClass)}}const Z_=i=>({"data-index":i});function em(i,a){if(1&i&&(e.j41(0,"label",3),e.nrm(1,"kendo-checkbox",4),e.j41(2,"span",5),e.EFF(3),e.k0s()()),2&i){const t=a.$implicit,n=a.index,o=e.XpG();e.R7$(),e.Y8G("inputAttributes",e.eq3(4,Z_,n.toString()))("checkedState",!t.hidden)("disabled",o.isDisabled(t)),e.R7$(2),e.JRh(t.displayTitle)}}function tm(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",6)(1,"button",7),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.cancelChanges())}),e.EFF(2),e.k0s(),e.j41(3,"button",8),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.applyChanges())}),e.EFF(4),e.k0s()()}if(2&i){const t=e.XpG();e.Y8G("ngClass",t.actionsClass),e.R7$(2),e.SpI(" ",t.resetText," "),e.R7$(2),e.SpI(" ",t.applyText," ")}}function nm(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-treelist-columnlist",2),e.bIt("apply",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onApply(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("applyText",t.localization.get("columnsApply"))("resetText",t.localization.get("columnsReset"))("columns",t.columns)("autoSync",!1)("allowHideAll",!1)("actionsClass",t.actionsClass)}}const im=i=>({"k-active":i}),om=(i,a)=>({service:i,column:a});function rm(i,a){if(1&i&&e.eu8(0,5),2&i){const t=e.XpG(),n=e.sdS(6);e.Y8G("ngTemplateOutlet",t.column.columnMenuTemplateRef||t.columnMenuTemplate||n)("ngTemplateOutletContext",e.l_i(2,om,t.service,t.column))}}function am(i,a){if(1&i&&e.nrm(0,"kendo-treelist-columnmenu-sort",8),2&i){const t=e.XpG(2);e.Y8G("service",t.service)}}function sm(i,a){if(1&i&&e.nrm(0,"kendo-treelist-columnmenu-lock",8),2&i){const t=e.XpG(2);e.Y8G("service",t.service)}}function lm(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-treelist-columnmenu-chooser",9),e.bIt("expand",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onColumnsExpand())}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("service",t.service)("expanded",t.expandedColumns)}}function dm(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-treelist-columnmenu-filter",9),e.bIt("expand",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onFilterExpand())}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("service",t.service)("expanded",t.expandedFilter)}}function cm(i,a){if(1&i&&e.DNE(0,am,1,1,"kendo-treelist-columnmenu-sort",6)(1,sm,1,1,"kendo-treelist-columnmenu-lock",6)(2,lm,1,2,"kendo-treelist-columnmenu-chooser",7)(3,dm,1,2,"kendo-treelist-columnmenu-filter",7),2&i){const t=e.XpG();e.Y8G("ngIf",t.hasSort),e.R7$(),e.Y8G("ngIf",t.hasLock),e.R7$(),e.Y8G("ngIf",t.hasColumnChooser),e.R7$(),e.Y8G("ngIf",t.hasFilter)}}function pm(i,a){if(1&i){const t=e.RV6();
1e.j41(0,"kendo-treelist-filter-menu-container",4),e.bIt("close",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.close())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("column",t.column)("filter",t.filter)}}const um=["kendoTreeListHeader",""],_m=(i,a,t,n)=>({field:i,type:"column",column:a,hint:t,lastColumn:n}),ys=(i,a,t,n)=>({templateRef:i,columnIndex:a,column:t,$implicit:n}),mm=(i,a,t)=>({type:"columnGroup",column:i,hint:a,lastColumn:t});function gm(i,a){if(1&i&&e.nrm(0,"kendo-treelist-filter-menu",13),2&i){const t=e.XpG(3).$implicit,n=e.XpG(2);e.Y8G("column",n.getColumnComponent(t))("filter",n.filter)}}function hm(i,a){if(1&i&&e.nrm(0,"kendo-treelist-column-menu",14),2&i){const t=e.XpG(3).$implicit,n=e.XpG(2);e.Y8G("standalone",!1)("settings",n.columnMenuSettings)("column",t)("columnMenuTemplate",n.columnMenuTemplate)("sort",n.sort)("filter",n.filter)("sortable",n.sortable)}}function fm(i,a){}function Cm(i,a){if(1&i&&e.EFF(0),2&i){const t=e.XpG(3).$implicit;e.JRh(t.displayTitle)}}function vm(i,a){if(1&i&&e.DNE(0,gm,1,2,"kendo-treelist-filter-menu",10)(1,hm,1,7,"kendo-treelist-column-menu",11)(2,fm,0,0,"ng-template",12)(3,Cm,1,1,"ng-template",8),2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("ngIf",n.showFilterMenu&&n.isFilterable(n.getColumnComponent(t))),e.R7$(),e.Y8G("ngIf",n.showColumnMenu(t)),e.R7$(),e.Y8G("templateContext",e.ziG(4,ys,t.headerTemplateRef,t.leafIndex,t,t)),e.R7$(),e.Y8G("ngIf",!t.headerTemplateRef)}}function bm(i,a){}function Tm(i,a){if(1&i&&(e.qex(0),e.j41(1,"span",20),e.EFF(2),e.k0s(),e.bVm()),2&i){const t=e.XpG(3).$implicit;e.R7$(2),e.JRh(t.displayTitle)}}function Em(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",21),2&i){const t=e.XpG(3).$implicit,n=e.XpG(2);e.Mz_("name","sort-",n.sortDescriptor(n.getColumnComponent(t).field).dir,"-small"),e.Y8G("svgIcon","asc"===n.sortDescriptor(n.getColumnComponent(t).field).dir?n.sortAscSmallIcon:n.sortDescSmallIcon),e.BMQ("aria-label",n.sortableLabel)}}function Sm(i,a){if(1&i&&(e.j41(0,"span",22),e.EFF(1),e.k0s()),2&i){const t=e.XpG(3).$implicit,n=e.XpG(2);e.R7$(),e.JRh(n.sortOrder(n.getColumnComponent(t).field))}}function km(i,a){if(1&i&&e.nrm(0,"kendo-treelist-filter-menu",13),2&i){const t=e.XpG(3).$implicit,n=e.XpG(2);e.Y8G("column",n.getColumnComponent(t))("filter",n.filter)}}function Rm(i,a){if(1&i&&e.nrm(0,"kendo-treelist-column-menu",14),2&i){const t=e.XpG(3).$implicit,n=e.XpG(2);e.Y8G("standalone",!1)("settings",n.columnMenuSettings)("column",t)("columnMenuTemplate",n.columnMenuTemplate)("sort",n.sort)("filter",n.filter)("sortable",n.sortable)}}function Im(i,a){if(1&i){const t=e.RV6();e.j41(0,"span",15)(1,"span",16,0),e.bIt("click",function(o){e.eBV(t);const r=e.sdS(2),s=e.XpG(2).$implicit,c=e.XpG(2);return e.Njj(c.sortColumn(c.getColumnComponent(s),o,r))}),e.DNE(3,bm,0,0,"ng-template",12)(4,Tm,3,1,"ng-container",17),e.j41(5,"span"),e.DNE(6,Em,1,4,"kendo-icon-wrapper",18),e.k0s(),e.DNE(7,Sm,2,1,"span",19),e.k0s(),e.DNE(8,km,1,2,"kendo-treelist-filter-menu",10)(9,Rm,1,7,"kendo-treelist-column-menu",11),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.R7$(3),e.Y8G("templateContext",e.ziG(8,ys,t.headerTemplateRef,t.leafIndex,t,t)),e.R7$(),e.Y8G("ngIf",!t.headerTemplateRef),e.R7$(),e.AVh("k-sort-icon",n.sortDescriptor(n.getColumnComponent(t).field).dir),e.R7$(),e.Y8G("ngIf",n.sortDescriptor(n.getColumnComponent(t).field).dir),e.R7$(),e.Y8G("ngIf",n.showSortNumbering(n.getColumnComponent(t))),e.R7$(),e.Y8G("ngIf",n.showFilterMenu&&n.isFilterable(n.getColumnComponent(t))),e.R7$(),e.Y8G("ngIf",n.showColumnMenu(t))}}function ym(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-checkbox",23),e.bIt("checkedStateChange",function(o){e.eBV(t);const r=e.XpG(4);return e.Njj(r.selectAllChange(o))}),e.k0s()}if(2&i){const t=e.XpG(4);e.Y8G("inputAttributes",e.eq3(1,hi,t.messageFor("selectAllRowsCheckboxLabel")))}}function wm(i,a){if(1&i&&e.nrm(0,"span",24),2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("column",t)("columns",n.columns)}}function Dm(i,a){if(1&i){const t=e.RV6();e.j41(0,"th",7),e.bIt("keydown",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(2);return e.Njj(s.onHeaderKeydown(s.getColumnComponent(r),o))}),e.DNE(1,vm,4,9,"ng-template",8)(2,Im,10,13,"ng-template",8)(3,ym,1,3,"
1ng-template",8)(4,wm,1,2,"span",9),e.k0s()}if(2&i){const t=e.XpG(),n=t.$implicit,o=t.index,r=t.last,s=e.XpG().index,c=e.XpG();e.AVh("k-filterable",c.showFilterMenu&&c.isFilterable(c.getColumnComponent(n))||c.showColumnMenu(n))("k-first",c.isFirstOnRow(c.getColumnComponent(n),o)),e.Y8G("logicalRowIndex",s)("logicalColIndex",c.logicalColumnIndex(n))("colSpan",n.colspan)("rowSpan",n.rowspan(c.totalColumnLevels))("enableDrag",c.shouldActivate(n))("context",e.ziG(20,_m,c.getColumnComponent(n).field,n,n.title||c.getColumnComponent(n).field,r&&0===o))("ngClass",n.headerClass)("ngStyle",n.headerStyle),e.BMQ("aria-sort",c.sortState(c.getColumnComponent(n)))("aria-haspopup",c.showFilterMenu||c.showColumnMenu(n)?"dialog":void 0)("rowspan",n.rowspan(c.totalColumnLevels))("colspan",n.colspan),e.R7$(),e.Y8G("ngIf",!c.isSortable(c.getColumnComponent(n))),e.R7$(),e.Y8G("ngIf",c.isSortable(c.getColumnComponent(n))),e.R7$(),e.Y8G("ngIf",c.renderSelectAll(n)),e.R7$(),e.Y8G("ngIf",c.resizable)}}function Om(i,a){if(1&i&&e.nrm(0,"kendo-treelist-column-menu",27),2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("standalone",!1)("settings",n.columnMenuSettings)("column",t)("columnMenuTemplate",n.columnMenuTemplate)}}function xm(i,a){}function Mm(i,a){if(1&i&&e.EFF(0),2&i){const t=e.XpG(2).$implicit;e.JRh(t.displayTitle)}}function Fm(i,a){if(1&i&&e.nrm(0,"span",24),2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("column",t)("columns",n.columns)}}function Pm(i,a){if(1&i&&(e.j41(0,"th",25),e.DNE(1,Om,1,4,"kendo-treelist-column-menu",26)(2,xm,0,0,"ng-template",12)(3,Mm,1,1,"ng-template",8)(4,Fm,1,2,"span",9),e.k0s()),2&i){const t=e.XpG(),n=t.$implicit,o=t.index,r=t.last,s=e.XpG().index,c=e.XpG();e.AVh("k-first",c.isFirstOnRow(c.getColumnComponent(n),o))("k-filterable",c.showColumnMenu(n)),e.Y8G("logicalRowIndex",s)("logicalColIndex",c.logicalColumnIndex(n))("rowSpan",n.rowspan(c.totalColumnLevels))("colSpan",n.colspan)("enableDrag",c.shouldActivate(n))("context",e.sMw(20,mm,n,n.title,r&&0===o))("ngClass",n.headerClass)("ngStyle",n.headerStyle),e.BMQ("aria-haspopup",c.showFilterMenu||c.showColumnMenu(n)?"dialog":void 0)("aria-expanded",c.showColumnMenu(n))("rowspan",n.rowspan(c.totalColumnLevels))("colspan",n.colspan),e.R7$(),e.Y8G("ngIf",c.showColumnMenu(n)),e.R7$(),e.Y8G("templateContext",e.ziG(24,ys,n.headerTemplateRef,c.lockedColumnsCount+o,n,n)),e.R7$(),e.Y8G("ngIf",!n.headerTemplateRef),e.R7$(),e.Y8G("ngIf",c.resizable)}}function Nm(i,a){if(1&i&&e.DNE(0,Dm,5,25,"th",5)(1,Pm,5,29,"th",6),2&i){const t=a.$implicit,n=e.XpG(2);e.Y8G("ngIf",!n.isColumnGroupComponent(t)),e.R7$(),e.Y8G("ngIf",n.isColumnGroupComponent(t))}}function Gm(i,a){if(1&i&&(e.j41(0,"tr",3),e.DNE(1,Nm,2,2,"ng-template",4),e.k0s()),2&i){const t=a.index,n=e.XpG();e.Y8G("logicalRowIndex",t)("logicalSlaveRow",n.lockedColumnsCount>0)("logicalCellsCount",n.columns.length)("totalColumns",n.totalColumns)("logicalSlaveCellsCount",n.unlockedColumnsCount),e.R7$(),e.Y8G("ngForOf",n.columnsForLevel(t))("ngForTrackBy",n.trackByIndex)}}function Am(i,a){if(1&i&&e.nrm(0,"tr",28),2&i){const t=e.XpG();e.Y8G("columns",t.leafColumns)("filter",t.filter)("lockedColumnsCount",t.lockedColumnsCount)("totalColumns",t.totalColumns)("logicalRowIndex",t.totalColumnLevels+1)("logicalSlaveRow",t.lockedColumnsCount>0)("logicalCellsCount",t.columns.length)("logicalSlaveCellsCount",t.unlockedColumnsCount)}}function Lm(i,a){}function Bm(i,a){if(1&i&&e.DNE(0,Lm,0,0,"ng-template",1),2&i){const t=e.XpG();e.Y8G("ngTemplateOutlet",t.toolbarTemplateRef)("ngTemplateOutletContext",t.context)}}const jm=["lockedHeader"],Vm=["header"],$m=["ariaRoot"],Um=["footer"],Ym=[[["kendo-toolbar"]]],Hm=["kendo-toolbar"],Xm=i=>({hintTemplate:i});function Wm(i,a){if(1&i&&e.nrm(0,"kendo-treelist-toolbar",13),2&i){const t=e.XpG();e.Y8G("navigable",t.navigable),e.BMQ("aria-label",t.messageFor("topToolbarLabel"))("aria-controls",t.ariaRootId)}}function zm(i,a){if(1&i&&(e.j41(0,"div",23,4)(2,"table",24),e.nrm(3,"colgroup",20)(4,"thead",25),e.k0s()()),2&i){const t=e.XpG(3);e.xc7("width",t.lockedWidth,"px"),e.R7$(2),e.xc7("width",t.lockedWidth,"px"),e.Y8G("locked",!0),e.R7$(),e.Y8G("columns",t.lockedLeafColumns),e.R7$(),e.Y8G("resizable",t.resizable)("scrollable",!0)("columns",t.lockedColumns)("totalColumnLevels",t.totalColumnLevels)("sort",t.sort)("filter",t.filter)("filterable",t.filterable)("reorderable",t.reorderable)("sortable",t.sortable)("columnMenu",t.columnMenuOptions)("columnMenuTemplate",t.columnMenuTemplate)("totalColumnsCount",t.leafColumns.length)("totalColumns",t.columnsContainer)}}function Km(i,a){if(1&i&&(e.j41(0,"div",26),e.nrm(1,"div"),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.xc7("width",t.columnsContainer.unlockedWidth,"px")}
1}function Jm(i,a){if(1&i&&(e.j41(0,"div",16),e.DNE(1,zm,5,19,"div",17),e.j41(2,"div",18,3)(4,"table",19),e.nrm(5,"colgroup",20)(6,"thead",21),e.k0s(),e.DNE(7,Km,2,2,"div",22),e.k0s()()),2&i){const t=e.XpG(2);e.xc7("padding",t.headerPadding),e.R7$(),e.Y8G("ngIf",t.isLocked),e.R7$(),e.Y8G("kendoTreeListResizableContainer",t.lockedLeafColumns.length>0)("lockedWidth",t.lockedWidth+t.scrollbarWidth+2),e.R7$(2),e.xc7("width",t.nonLockedWidth,"px"),e.Y8G("virtualColumns",t.virtualColumns),e.R7$(),e.Y8G("columns",t.headerLeafColumns),e.R7$(),e.Y8G("resizable",t.resizable)("scrollable",!0)("columns",t.headerColumns)("totalColumnLevels",t.totalColumnLevels)("sort",t.sort)("filter",t.filter)("filterable",t.filterable)("reorderable",t.reorderable)("sortable",t.sortable)("columnMenu",t.columnMenuOptions)("columnMenuTemplate",t.columnMenuTemplate)("lockedColumnsCount",t.lockedLeafColumns.length)("totalColumnsCount",t.leafColumns.length)("totalColumns",t.columnsContainer),e.R7$(),e.Y8G("ngIf",t.virtualColumns)}}function qm(i,a){if(1&i){const t=e.RV6();e.DNE(0,Jm,8,24,"div",14),e.j41(1,"kendo-treelist-list",15),e.bIt("pageChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.notifyPageChange("list",o))})("scrollBottom",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.notifyScrollBottom())})("contentScroll",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.contentScroll.emit(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("ngIf",!t.hideHeader),e.R7$(),e.Y8G("view",t.view)("loading",t.showLoading)("rowHeight",t.rowHeight)("total",t.totalCount)("take",t.pageSize)("skip",t.skip)("trackBy",t.trackBy)("columns",t.columnsContainer)("filterable",t.filterable)("noRecordsTemplate",t.noRecordsTemplate)("rowClass",t.rowClass)("isVirtual",t.isVirtual)("virtualColumns",t.virtualColumns)("expandIcons",t.expandIcons)("enableDrag",t.marqueeSelection)}}function Qm(i,a){if(1&i&&e.nrm(0,"thead",31),2&i){const t=e.XpG(2);e.Y8G("resizable",t.resizable)("scrollable",!1)("columns",t.visibleColumns)("totalColumnLevels",t.totalColumnLevels)("reorderable",t.reorderable)("sort",t.sort)("sortable",t.sortable)("filter",t.filter)("filterable",t.filterable)("columnMenu",t.columnMenuOptions)("columnMenuTemplate",t.columnMenuTemplate)("totalColumns",t.columnsContainer)}}function Zm(i,a){1&i&&e.nrm(0,"div",32)}function eg(i,a){if(1&i&&(e.j41(0,"table",27),e.nrm(1,"colgroup",20),e.DNE(2,Qm,1,12,"thead",28),e.nrm(3,"tbody",29),e.k0s(),e.DNE(4,Zm,1,0,"div",30)),2&i){const t=e.XpG();e.xc7("table-layout",t.resizable?"fixed":null),e.R7$(),e.Y8G("columns",t.leafColumns),e.R7$(),e.Y8G("ngIf",!t.hideHeader),e.R7$(),e.Y8G("view",t.view)("skip",t.skip)("columns",t.leafColumns)("filterable",t.filterable)("noRecordsTemplate",t.noRecordsTemplate)("trackBy",t.trackBy)("rowClass",t.rowClass)("expandIcons",t.expandIcons)("enableDrag",t.marqueeSelection),e.R7$(),e.Y8G("ngIf",t.showLoading)}}function tg(i,a){if(1&i&&e.eu8(0,36),2&i){e.XpG();const t=e.sdS(1),n=e.XpG(),o=e.sdS(13);e.Y8G("ngTemplateOutlet",n.pagerTemplate?null==n.pagerTemplate?null:n.pagerTemplate.templateRef:o)("ngTemplateOutletContext",t.templateContext)}}function ng(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-pager",33,5),e.bIt("pageChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.notifyPageChange("pager",o))}),e.DNE(2,tg,1,2,"ng-template",34),e.nrm(3,"kendo-pager-messages",35),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("navigable",t.navigable)("pageSize",t.pageSize)("total",t.view.totalVisible)("skip",t.skip)("responsive",t.normalizedPageableSettings.responsive&&!t.pagerTemplate)("buttonCount",t.normalizedPageableSettings.buttonCount)("info",t.normalizedPageableSettings.info)("pageSizeValues",t.normalizedPageableSettings.pageSizes)("previousNext",t.normalizedPageableSettings.previousNext)("type",t.normalizedPageableSettings.type),e.R7$(3),e.Y8G("ariaLabel",t.messageFor("pagerLabel"))("firstPage",t.messageFor("pagerFirstPage"))("inputLabel",t.messageFor("pagerInputLabel"))("previousPage",t.messageFor("pagerPreviousPage"))("nextPage",t.messageFor("pagerNextPage"))("lastPage",t.messageFor("pagerLastPage"))("selectPage",t.messageFor("pagerSelectPage"))("page",t.messageFor("pagerPage"))("itemsPerPage",t.messageFor("pagerItemsPerPage"))("items",t.messageFor("pagerItems"))("of",t.messageFor("pagerOf"))("pageNumberInputTitle",t.messageFor("pagerPageNumberInputTitle"))}}function ig(i,a){if(1&i&&e.nrm(0,"kendo-treelist-toolbar",37),2&i){const t=e.XpG();e.Y8G("navigable",t.navigable),e.BMQ("aria-label",t.messageFor("bottomToolbarLabel"))("aria-controls",t.ariaRootId)}}function og(i,a){if(1&i&&(e.nrm(0,"kendo-icon-wrapper",38),e.EFF(1)),2&i){const t=e.XpG();e.Y8G("name",t.getHintSettings("hintIcon"))("svgIcon",t.getHintSettings("hintSVGIcon")),e.R7$(),e.SpI(" ",t.hintText," ")}}function rg(i,a){1&i&&e.nrm(0,"kendo-pager-prev-buttons")}function ag(i,a){if(1&i&&e.nrm(0,"kendo-pager-numeric-buttons",43),2&i){const t=e.XpG(2);e.Y8G("buttonCount",t.normalizedPageableSettings.buttonCount)}}function sg(i,a){1&i&&e.nrm(0,"kendo-pager-input")}function lg(i,a){1&i&&e.nrm(0,"kendo-pager-next-buttons")}function dg(i,a){if(1&i&&e.nrm(0,"kendo-pager-page-sizes",44),2&i){const t=e.XpG(2);e.Y8G("pageSizes",t.normalizedPageableSettings.pageSizes)}}function cg(i,a){1&i&&e.nrm(0,"kendo-pager-info")}function pg(i,a){if(1&i&&(e.j41(0,"div",39),e.DNE(1,rg,1,0,"kendo-pager-prev-buttons",40)(2,ag,1,1,"kendo-pager-numeric-buttons",41)(3,sg,1,0,"kendo-pager-input",40)(4,lg,1,0,"kendo-pager-next-buttons",40),e.k0s(),e.DNE(5,dg,1,1,"kendo-pager-page-sizes",42)(6,cg,1,0,"kendo-pager-info",40),e.nrm(7,"kendo-pager-messages",35)),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.normalizedPageableSettings.previousNext),e.R7$(),e.Y8G("ngIf","numeric"===t.normalizedPageableSettings.type&&t.normalizedPageableSettings.buttonCount>
10),e.R7$(),e.Y8G("ngIf","input"===t.normalizedPageableSettings.type),e.R7$(),e.Y8G("ngIf",t.normalizedPageableSettings.previousNext),e.R7$(),e.Y8G("ngIf",t.normalizedPageableSettings.pageSizes),e.R7$(),e.Y8G("ngIf",t.normalizedPageableSettings.info),e.R7$(),e.Y8G("ariaLabel",t.messageFor("pagerLabel"))("firstPage",t.messageFor("pagerFirstPage"))("inputLabel",t.messageFor("pagerInputLabel"))("previousPage",t.messageFor("pagerPreviousPage"))("nextPage",t.messageFor("pagerNextPage"))("lastPage",t.messageFor("pagerLastPage"))("selectPage",t.messageFor("pagerSelectPage"))("page",t.messageFor("pagerPage"))("itemsPerPage",t.messageFor("pagerItemsPerPage"))("items",t.messageFor("pagerItems"))("of",t.messageFor("pagerOf"))("pageNumberInputTitle",t.messageFor("pagerPageNumberInputTitle"))}}const ug=["kendoTreeListBaseCommand",""];function _g(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function mg(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function gg(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}const hg=["kendoTreeListEditCommand",""];function fg(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function Cg(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function vg(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}const bg=["kendoTreeListCancelCommand",""];function Tg(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function Eg(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function Sg(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}const kg=["kendoTreeListSaveCommand",""];function Rg(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function Ig(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function yg(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}const wg=["kendoTreeListRemoveCommand",""];function Dg(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function Og(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function xg(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}const Mg=["kendoTreeListAddCommand",""];function Fg(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function Pg(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function Ng(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}function Gg(i,a){if(1&i){const t=e.RV6();
1e.j41(0,"span",3),e.EFF(1),e.k0s(),e.j41(2,"kendo-treelist-columnlist",4),e.bIt("apply",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onApply(o))})("columnChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onChange(o))}),e.k0s()}if(2&i){const t=e.XpG();e.R7$(),e.JRh(t.localization.get("columns")),e.R7$(),e.Y8G("columns",t.columns)("applyText",t.localization.get("columnsApply"))("resetText",t.localization.get("columnsReset"))("autoSync",t.autoSync)("allowHideAll",t.allowHideAll)}}const Ag=["kendoTreeListExcelCommand",""];function Lg(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function Bg(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function jg(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}const Vg=["kendoTreeListPDFCommand",""];function $g(i,a){if(1&i&&e.nrm(0,"kendo-icon-wrapper",4),2&i){const t=e.XpG();e.Y8G("name",t.icon)("svgIcon",t.svgIcon)}}function Ug(i,a){if(1&i&&(e.j41(0,"span",5),e.nrm(1,"img",6),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("src",t.imageUrl,e.B4B)}}function Yg(i,a){if(1&i&&e.nrm(0,"span",7),2&i){const t=e.XpG();e.Y8G("ngClass",t.iconClass)}}const Hg={name:"@progress/kendo-angular-treelist",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1734681955,version:"17.2.0",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/"};let ro=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListCellTemplate",""]],standalone:!0})}return i})(),ws=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListEditTemplate",""]],standalone:!0})}return i})(),Ds=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListColumnMenuTemplate",""]],standalone:!0})}return i})(),Tn=(()=>{class i{columns=new e.bkB;options=new e.bkB;optionChanged(){this.options.emit()}columnChanged(){this.columns.emit()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),fd=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListFooterTemplate",""]],standalone:!0})}return i})(),Cd=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListHeaderTemplate",""]],standalone:!0})}return i})();const Os=i=>i.isSpanColumn,vd=i=>i.isRowReorderColumn;let Ge=(()=>{class i{parent;optionChanges;matchesMedia=!0;orderIndex=0;set leafIndex(t){this._leafIndex=t}get leafIndex(){return this._leafIndex}_leafIndex;isColumnGroup=!1;isSpanColumn=!1;resizable=!0;reorderable=!0;minResizableWidth=10;title;set width(t){this._width=parseInt(t,10)}get width(){return this._width}autoSize;set locked(t){this._locked=t}get locked(){return this._locked}_locked=!1;hidden;media;lockable=!0;columnMenu=!0;includeInChooser=!0;tableCellsRole="gridcell";style;headerStyle;footerStyle;cssClass;headerClass;footerClass;headerTemplates=new e.rOR;footerTemplate;columnMenuTemplates=new e.rOR;resizeStartWidth;get level(){return this.parent&&Os(this.parent)?this.parent.level:this.parent?this.parent.level+1:0}get isLocked(){return this.parent?this.parent.isLocked:this.locked}_width;get colspan(){return 1}rowspan(t){return this.level<t?t-this.level+1:1}get headerTemplateRef(){const t=this.headerTemplates.first;return t?t.templateRef:void 0}get footerTemplateRef(){return this.footerTemplate?this.footerTemplate.templateRef:void 0}get columnMenuTemplateRef(){const t=this.columnMenuTemplates.first;return t?t.templateRef:null}get displayTitle(){return this.title}get isVisible(){return!this.hidden&&this.matchesMedia}get isEditable(){return!1}constructor(t,n){if(this.parent=t,this.optionChanges=n,t&&!(i=>i.isColumnGroup||Os(i))(t))throw new Error("Columns can be nested only inside ColumnGroupComponent")}ngOnChanges(t){this.optionChanges&&this.optionChanges.columnChanged()}static \u0275fac=function(n){return new(n||i)(e.rXU(i),e.rXU(Tn))};static \u0275dir=e.FsC({type:i,contentQueries:function(n,o,r){if(1&n&&(e.wni(r,fd,5),e.wni(r,Cd,4),e.wni(r,Ds,4)),2&n){let s;e.mGM(s=e.lsd())&&(o.footerTemplate=s.first),e.mGM(s=e.lsd())&&(o.headerTemplates=s),e.mGM(s=e.lsd())&&(o.columnMenuTemplates=s)}},inputs:{resizable:"resizable",reorderable:"reorderable",minResizableWidth:"minResizableWidth",title:"title",width:"width",autoSize:"autoSize",locked:"locked",hidden:"hidden",media:"media",lockable:"lockable",columnMenu:"columnMenu",includeInChooser:"includeInChooser",tableCellsRole:"tableCellsRole",style:"style",headerStyle:"headerStyle",footerStyle:"footerStyle",cssClass:[0,"class","cssClass"],headerClass:"headerClass",footerClass:"footerClass"},features:[e.OA$]})}return i})();const zg=/^\s*$/,pe=i=>null!=i,xs=i=>null==i,Dt=i=>!!i,Ve=i=>xs(i)||zg.test(i),Ms=i=>(0,we.h)((0,le.of)(i),i.changes),fi=()=>typeof document>"u",ao=i=>"string"==typeof i,bd=i=>"number"==typeof i&&!isNaN(i),Fs=i=>ao(i)&&!Ve(i)&&i.startsWith("{0:")?i.slice(3,i.length-1):i,so=i=>(...a)=>!i(...a),Td=(...i)=>a=>i.reduce((t,n)=>t||n(a),!1),Ed=(...i)=>a=>i.reduce((t,n)=>t&&n(a),!0);
1new e.nKC("Skip"),function qg(){if("function"==typeof Symbol&&Symbol.iterator)return Symbol.iterator;const i=Object.getOwnPropertyNames(Map.prototype),a=Map.prototype;for(let t=0;t<i.length;++t){const n=i[t];if("entries"!==n&&"size"!==n&&a[n]===a.entries)return n}}();const Qg=1e3/60,Kr=typeof window<"u"?window:{},Zg=Kr.requestAnimationFrame||Kr.msRequestAnimationFrame||(i=>setTimeout(i,Qg)),eh=Kr.cancelAnimationFrame||Kr.msCancelRequestAnimationFrame||clearTimeout,Ps=(i,a)=>!1!==i.isEditable&&(i.editTemplate||a&&i.field&&a.get(i.field)),En=(i,a,t)=>i.replace(new RegExp(`{\\s*${a}\\s*}`,"g"),t);let Sd=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListFilterCellTemplate",""]],standalone:!0})}return i})(),kd=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListFilterMenuTemplate",""]],standalone:!0})}return i})();function Rd(i){return pe(i.field)}let lo=(()=>{class i extends Ge{expandable;field;format;sortable=!0;editor="text";filter="text";filterable=!0;editable=!0;template;editTemplate;filterCellTemplate;filterMenuTemplate;constructor(t,n){super(t,n)}get templateRef(){return this.template?this.template.templateRef:void 0}get editTemplateRef(){return this.editTemplate?this.editTemplate.templateRef:void 0}get filterCellTemplateRef(){return this.filterCellTemplate?this.filterCellTemplate.templateRef:void 0}get filterMenuTemplateRef(){return this.filterMenuTemplate?this.filterMenuTemplate.templateRef:void 0}get displayTitle(){return void 0===this.title?this.field:this.title}get isEditable(){return!1!==this.editable}static \u0275fac=function(n){return new(n||i)(e.rXU(Ge,13),e.rXU(Tn))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-column"]],contentQueries:function(n,o,r){if(1&n&&(e.wni(r,ro,5),e.wni(r,ws,5),e.wni(r,Sd,5),e.wni(r,kd,5)),2&n){let s;e.mGM(s=e.lsd())&&(o.template=s.first),e.mGM(s=e.lsd())&&(o.editTemplate=s.first),e.mGM(s=e.lsd())&&(o.filterCellTemplate=s.first),e.mGM(s=e.lsd())&&(o.filterMenuTemplate=s.first)}},inputs:{expandable:"expandable",field:"field",format:"format",sortable:"sortable",editor:"editor",filter:"filter",filterable:"filterable",editable:"editable"},standalone:!0,features:[e.Jv_([{provide:Ge,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})();function Jr(i){return i.isSpanColumn}let Id=(()=>{class i extends Ge{expandable;isSpanColumn=!0;title;headerClass;footerClass;headerStyle;footerStyle;template=new e.rOR;editTemplate=new e.rOR;childColumns=new e.rOR;includeInChooser=!1;set editable(t){this._editable=t}get editable(){return pe(this.editTemplateRef)&&this._editable}set width(t){}get width(){return this.childColumns.reduce((t,n)=>t+n.width,0)}get leafIndex(){return this.childColumns.first.leafIndex}_editable=!0;constructor(t,n){if(super(t,n),t&&t.isSpanColumn)throw new Error("SpanColumn cannot be nested inside another SpanColumn")}get templateRef(){const t=this.template.first;return t?t.templateRef:void 0}get editTemplateRef(){const t=this.editTemplate.first;return t?t.templateRef:void 0}get colspan(){return this.childColumns.filter(t=>t.isVisible).length}set locked(t){this._locked=t}get locked(){return this._locked||this.childColumns.some(t=>t.locked)}get isEditable(){return!!this.editTemplateRef}get childrenArray(){return this.childColumns.toArray()}get hasChildren(){return this.childColumns.length>0}static \u0275fac=function(n){return new(n||i)(e.rXU(Ge,13),e.rXU(Tn))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-span-column"]],contentQueries:function(n,o,r){if(1&n&&(e.wni(r,ro,4),e.wni(r,ws,4),e.wni(r,lo,4)),2&n){let s;e.mGM(s=e.lsd())&&(o.template=s),e.mGM(s=e.lsd())&&(o.editTemplate=s),e.mGM(s=e.lsd())&&(o.childColumns=s)}},inputs:{expandable:"expandable",title:"title",headerClass:"headerClass",footerClass:"footerClass",headerStyle:"headerStyle",footerStyle:"footerStyle",editable:"editable",locked:"locked"},standalone:!0,features:[e.Jv_([{provide:Ge,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})();const Sn=i=>i.reduce((a,t)=>a.concat(Jr(t)?t.childrenArray:[t]),[]),yd=i=>i.reduce((a,t)=>a.concat(Jr(t)?[t].concat(t.childrenArray):[t]),[]),Bn=i=>Sn(i).filter(a=>a.isVisible),wd=i=>a=>(a||[]).reduce((t,n)=>t+(n[i]||0),0),th=wd("width"),Ns=wd("colspan"),nh=new RegExp("^[$A-Z_a-z][$A-Z_a-z0-9\\.]*$"),co=i=>i.reduce((a,t)=>(t.isColumnGroup?a=a.concat(co((i=>i.children.filter(a=>a!==i))(t))):t.isSpanColumn?a=a.concat(t.childrenArray):a.push(t),a),[]).filter(a=>a.isVisible),jn=i=>(0,He.My)(i,[{field:"orderIndex",dir:"asc"}]),Dd=i=>Dt(i.parent)&&Jr(i.parent);function po(i){return i.isColumnGroup}let Gs=(()=>{class i extends Ge{includeInChooser=!1;
1isColumnGroup=!0;minResizableWidth=10;children;constructor(t,n){if(super(t,n),t&&t.isSpanColumn)throw new Error("ColumnGroupComponent cannot be nested inside SpanColumnComponent")}rowspan(){return 1}get colspan(){return this.children?Ns(this.children.filter(t=>t!==this&&t.isVisible)):1}get leafIndex(){return this.children?(this.firstChild||{}).leafIndex:-1}get childrenArray(){return this.children.filter(t=>t!==this)}get hasChildren(){return!!this.firstChild}get firstChild(){return this.children.find(t=>t!==this)}static \u0275fac=function(n){return new(n||i)(e.rXU(Ge,13),e.rXU(Tn))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-column-group"]],contentQueries:function(n,o,r){if(1&n&&e.wni(r,Ge,4),2&n){let s;e.mGM(s=e.lsd())&&(o.children=s)}},standalone:!0,features:[e.Jv_([{provide:Ge,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})();const Od=()=>(0,v.nm)()&&document.createElement;let xd,qr=null,As=null,Ls=(()=>{class i{zone;changeDetector;changes=new e.bkB;subscriptions;constructor(t,n){this.zone=t,this.changeDetector=n,typeof window<"u"&&this.zone.runOutsideAngular(()=>{this.subscriptions=(0,Ne.R)(window,"resize").pipe((0,to.Z)(100)).subscribe(()=>{xd!==window.devicePixelRatio&&t.run(()=>{qr=null,this.changes.emit(),this.changeDetector.markForCheck()})})})}ngOnDestroy(){this.subscriptions&&(this.subscriptions.unsubscribe(),this.subscriptions=null)}get scrollbarWidth(){return function sh(){if(null===qr&&Od()){xd=window.devicePixelRatio||1;const i=document.createElement("div");i.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",i.innerHTML="&nbsp;",document.body.appendChild(i),qr=i.offsetWidth-i.scrollWidth,document.body.removeChild(i)}return qr}()}get rtlScrollLeft(){return function lh(){if(null===As&&Od()){const i=document.createElement("div");i.style.cssText="overflow:scroll;zoom:1;clear:both;display:block;width:100px;visibility:hidden;position:absolute;left:-10000px;direction:rtl;";const a=document.createElement("div");
1a.style.width="200px",a.style.height="1px",i.appendChild(a),document.body.appendChild(i);const t=i.scrollLeft;i.scrollLeft=-1,As=i.scrollLeft<0?i.scrollLeft:t,document.body.removeChild(i)}return As}()}static \u0275fac=function(n){return new(n||i)(e.KVO(e.SKi),e.KVO(e.gRc))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Bs={isExpanded:()=>!0},dh={isRowSelected:()=>!1},ch={hasNew:()=>!1,context:()=>null},ph=i=>i;function js(i,a){i.loadData(),i.loading?i.dataLoaded.pipe((0,O.s)(1)).subscribe(()=>{js(i,a)}):i._data?a.next(i):js(i,a)}const Md="loading";class uo{skip;pageSize;pageable;expandAll;static create(a){const{skip:t,pageSize:n,pageable:o,isVirtual:r}=a;let s=uo;return n&&(o?s=_h:r&&(s=mh)),new s(t,n,o)}constructor(a,t,n){this.skip=a,this.pageSize=t,this.pageable=n}inRange(a,t){return!0}levelInRange(a,t,n){return!0}includeParents(a){}}class _h extends uo{expandAll=!0;constructor(a,t,n){super(a,t,n),function uh(i){return"object"==typeof i}(n)&&(this.expandAll=!1!==n.countChildren)}inRange(a,t){return this.skip<=a&&a<this.skip+this.pageSize}levelInRange(a,t,n){return-1===a.level||this.skip<=a.index+t.length&&a.index+1<this.skip+this.pageSize}includeParents(a){let t=a.parentLevel;for(;t&&!t.inRange;)t.inRange=!0,t=t.parentLevel}}class mh extends uo{inRange(a,t){return this.skip<=t&&t<this.skip+this.pageSize}levelInRange(a,t,n){return this.inRange(a.index,n)}}class Fd{expandState;editState;selectionState;loaded;fieldAccessor;observables=[];rowIndex=0;rootLevel;fetchChildren;hasChildren;idGetter;hasFooter;viewRange;offsetFirst;constructor(a,t,n,o,r,s){this.expandState=a,this.editState=t,this.selectionState=n,this.loaded=o,this.fieldAccessor=r;const c=this.fieldAccessor();this.fetchChildren=c.fetchChildren,this.hasChildren=c.hasChildren,this.idGetter=c.idGetter,this.hasFooter=c.hasFooter,this.viewRange=uo.create(c),this.rootLevel=s?this.loadChildren(s):this.dataLevel({level:-1,id:null,expanded:!0},c.data)}generate(){const a=[],t=[this.rootLevel];let n=0,o=0;for(this.addNew(a);t.length;){for(;t[0]&&t[0].idx>=t[0].items.length;){const g=t.shift();this.hasFooter&&g.expanded&&g.items.length&&((g.inRange||this.viewRange.levelInRange(g.parent,g.items,this.rowIndex))&&(a.push({type:"footer",items:g.items,aggregates:g.aggregates,level:g.level,parentItem:g.parent.data,parentIndex:g.parentIndex,rowIndex:this.rowIndex}),this.viewRange.includeParents(g)),this.rowIndex++)}if(!t.length)break;const r=t[0],s=r.items[r.idx++],c={type:"data",data:s,id:this.idGetter(s),rowIndex:this.rowIndex,index:n,level:r.level,hasChildren:this.hasChildren(s),parent:r.parent};r.expanded&&(this.rowIndex++,this.viewRange.inRange(n,c.rowIndex)&&(this.offsetFirst&&(c.rowIndex++,this.rowIndex++,this.offsetFirst=!1),a.push(c),c.editContext=this.editState.context(c.data),c.selected=this.selectionState.isRowSelected(s),this.addNew(a,s)),n++),o++;const u=c.hasChildren&&this.expandState.isExpanded(c.data);if(c.hasChildren&&(u||this.viewRange.expandAll)){c.expanded=u&&r.expanded;const g=this.loadChildren(c);g&&(t.unshift(g),g.parentLevel=r)}}return{items:a,observables:this.observables,total:o,totalVisible:n,totalRows:this.rowIndex}}loadChildren(a){const t=a.id;if(this.loaded.has(t)){const n=this.loaded.get(t);if(n!==Md)return this.dataLevel(a,n);a.loading=!0}else{const n=this.fetchChildren(a.data);if((0,rt.A)(n))this.observables.push({observable:n,parentId:t}),a.loading=!0;else if(n)return this.loaded.set(t,n),this.dataLevel(a,n)}}dataLevel(a,t){const n=(t=t||{}).data||t;return{idx:0,level:a.level+1,items:n&&n.length?n:[],aggregates:t.aggregates,expanded:a.expanded,parentIndex:a.index,parent:a}}addNew(a,t){if(this.editState.hasNew(t)){const n=this.viewRange.inRange(0,this.rowIndex);a.push({parent:t,isNew:!0,type:"data",data:this.editState.newItem.dataItem,editContext:this.editState.newItem,rowIndex:t||n?this.rowIndex:this.viewRange.skip}),t||n?this.rowIndex++:this.offsetFirst=!0}}}class Vn{fieldAccessor;expandState;editState;selectionState;childrenLoaded=new e.bkB;dataLoaded=new e.bkB;resetPage=new e.bkB;total=0;totalVisible=0;loaded=new Map;loading=!1;_totalRows=0;loadingCount=0;
1childrenSubscription;_data;static loadView(a){const t=new gt.t(null),o=new Vn(()=>Object.assign({idGetter:ph,pageable:!1,isVirtual:!1,skip:0},a.fields),a.expandState||Bs,a.editState||ch,a.selectionState||dh);return a.loaded&&(o.loaded=a.loaded),js(o,t),t}get totalRows(){return this._data||this.loadData(),this._totalRows}get data(){return this._data||this.loadData(),this._data}constructor(a,t,n,o){this.fieldAccessor=a,this.expandState=t,this.editState=n,this.selectionState=o}get length(){return this.data.length}get first(){return this.data[0]}get firstItem(){return this.find(a=>"data"===a.type)}get last(){return this.data[this.data.length-1]}at(a){return this.data[a]}itemIndex(a){const t=this.fieldAccessor().idGetter;return this.data.findIndex(n=>n.id===t(a))}map(a){return this.data.map(a)}filter(a){return this.data.filter(a)}findIndex(a){return this.data.findIndex(a)}reduce(a,t){return this.data.reduce(a,t)}forEach(a){this.data.forEach(a)}some(a){return this.data.some(a)}find(a){return this.data.find(a)}toString(){return this.data.toString()}updateSelectedState(){this.forEach(a=>{"data"===a.type&&(a.selected=this.selectionState.isRowSelected(a.data))})}updateEditedState(){this.forEach(a=>{"data"===a.type&&(a.editContext=this.editState.context(a.data))})}reset(){this.loaded.clear(),this.clear(),this.unsubscribeChildren()}resetItem(a,t){const n=this.fieldAccessor().idGetter,o=[a];for(;o.length;){const s=n(o.shift());if(this.loaded.has(s)){const c=this.loaded.get(s);this.loaded.delete(s),t&&o.push(...c.data||c)}}this.clear()}clear(){this._data=null}loadData(){let t=new Fd(this.expandState,this.editState,this.selectionState,this.loaded,this.fieldAccessor).generate();!t.loading&&t.total&&(!t.items.length||!t.items.some(n=>"data"===n.type))&&(this.resetPage.emit(),t=new Fd(this.expandState,this.editState,this.selectionState,this.loaded,this.fieldAccessor).generate()),this._data=t.items,this.total=t.total,this.totalVisible=t.totalVisible,this._totalRows=t.totalRows,t.observables&&t.observables.length?(this.loading=!0,this.loadingCount+=t.observables.length,this.childrenSubscription||(this.childrenSubscription=new K.y),t.observables.forEach(n=>{this.loaded.set(n.parentId,Md),this.childrenSubscription.add(n.observable.subscribe(o=>{this.clear(),this.loaded.set(n.parentId,o),this.childrenLoaded.emit(),this.loadingCount--,0===this.loadingCount&&(this.loading=!1,this.unsubscribeChildren(),this.dataLoaded.emit())}))})):this.dataLoaded.emit()}unsubscribeChildren(){this.childrenSubscription&&(this.childrenSubscription.unsubscribe(),this.childrenSubscription=null,this.loadingCount=0)}}class Ci{prevented=!1;preventDefault(){this.prevented=!0}isDefaultPrevented(){return this.prevented}}class Pd extends Ci{isNew;dataItem;sender;action="cellClose";column;formGroup;originalEvent;constructor(a){super(),Object.assign(this,a)}}const gh=i=>i;let Ot=(()=>{class i{ngZone;changes=new e.bkB;changed;get newItemGroup(){return this.newItem?this.newItem.group:null}newItem;idGetter=gh;edited=new Map;keepEditCell=!1;keepCellTimeout;column;closingCell=!1;changedSource=new ue.B7;constructor(t){this.ngZone=t,this.changed=this.changedSource.asObservable().pipe((0,Oe.n)(()=>this.ngZone.onStable.asObservable().pipe((0,O.s)(1))))}editRow(t,n=void 0){this.edited.set(this.idGetter(t),{group:n,item:t}),this.onChanged()}addRow(t,n){this.newItem={parent:t,group:n,dataItem:n?n.value:null},this.onChanged()}editCell(t,n,o){Ps(n,o)&&(this.preventCellClose(),this.closeCell()||(this.editRow(t,o),this.column=n,this.onChanged()))}isEditing(){return this.edited.size>0}isEdited(t){return this.newItem&&this.newItem.dataItem===t||this.edited.has(this.idGetter(t))}isEditingCell(){return pe(this.column)}isEditingColumn(t){return this.column===t}isEditedColumn(t){return!this.column||this.column===t}hasNew(t){return!(!this.newItem||(this.newItem.parent||t)&&this.idGetter(this.newItem.parent)!==this.idGetter(t))}get newDataItem(){if(this.newItem)return this.newItem.group.value}close(t,n){n?this.newItem=void 0:(this.edited.delete(this.idGetter(t)),delete this.column,this.onChanged())}closeCell(t){if(this.column&&!this.closingCell)return this.ngZone.run(()=>{const{item:n,group:o}=this.first,r=new Pd({column:this.column,formGroup:o,originalEvent:t,dataItem:n});return this.closingCell=!0,this.changes.emit(r),this.closingCell=!1,r.isDefaultPrevented()||this.cancelCell(
1),r.isDefaultPrevented()})}cancelCell(){this.column&&(this.edited.clear(),this.column=null,this.onChanged())}shouldCloseCell(){return this.column&&!this.keepEditCell}preventCellClose(){this.ngZone.runOutsideAngular(()=>{window.clearTimeout(this.keepCellTimeout),this.keepEditCell=!0,this.keepCellTimeout=window.setTimeout(()=>{this.keepEditCell=!1},0)})}context(t){return this.edited.get(this.idGetter(t))}beginEdit(t){this.changes.emit({action:"edit",dataItem:t})}beginAdd(t){this.changes.emit({action:"add",parent:t})}endEdit(t,n){const o=n?this.newItemGroup:this.context(t).group;this.changes.emit({action:"cancel",dataItem:t,formGroup:o,isNew:n})}save(t,n){const o={action:"save",isNew:n};n?(o.parent=this.newItem.parent,o.formGroup=this.newItem.group,o.dataItem=t):(o.dataItem=t,o.formGroup=this.context(t).group),this.changes.emit(o)}remove(t,n){this.changes.emit({action:"remove",dataItem:t,parent:n})}onChanged(){this.ngZone.runOutsideAngular(()=>{this.changedSource.next()})}get first(){if(this.isEditing())return this.edited.values().next().value}static \u0275fac=function(n){return new(n||i)(e.KVO(e.SKi))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();class Vs{columns;allColumns=new e.rOR;leafColumns=new e.rOR;lockedColumns=new e.rOR;nonLockedColumns=new e.rOR;lockedLeafColumns=new e.rOR;nonLockedLeafColumns=new e.rOR;totalLevels=0;changes=new e.bkB;leafColumnsToRender=[];lockedColumnsToRender=[];nonLockedColumnsToRender=[];hasFooter=!1;unlockedWidth=0;constructor(a){this.columns=a}refresh(){const a=this.totalLevels,t=new Array,n=new Array,o=new Array,r=new Array,s=new Array,c=new Array,u=new Array,g=new Array,b=new Array;let k=!1,D=0,V=0;this.totalLevels=0,this.columns().forEach(B=>{const De=!0===B.isLocked?n:o,et=!0===B.isLocked?r:s,Ht=!0===B.isLocked?g:b;po(B)||(De.push(B),t.push(B),u.push(...Bn([B])),Ht.push(...Bn([B])),k=k||((i,...a)=>co(a).some(i))(Xt=>!!Xt.footerTemplateRef,B),B.isLocked||(D+=B.width||0),B.isSpanColumn?B.childColumns.forEach(Xt=>{Xt.leafIndex=V++}):B.leafIndex=V++),et.push(B),c.push(B),this.totalLevels=B.level>this.totalLevels?B.level:this.totalLevels}),this.hasFooter=k,this.leafColumnsToRender=u,this.lockedColumnsToRender=g,this.nonLockedColumnsToRender=b,this.unlockedWidth=D;const U=((...i)=>{let a=!1;for(let t=0;t<i.length;t++){const[n,o]=i[t];a=a||n.length!==o.length,n.reset(o)}return a})([this.leafColumns,t],[this.lockedLeafColumns,n],[this.nonLockedLeafColumns,o],[this.lockedColumns,r],[this.allColumns,c],[this.nonLockedColumns,s])||a!==this.totalLevels;return U&&this.changes.emit(),U}}let Qr=(()=>{class i{ngZone;changes=new e.bkB;subscription;constructor(t){this.ngZone=t}notify(){(!this.subscription||this.subscription.closed)&&(this.subscription=this.ngZone.onStable.asObservable().pipe((0,O.s)(1)).subscribe(()=>this.changes.emit()))}static \u0275fac=function(n){return new(n||i)(e.KVO(e.SKi))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Nd=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListNoRecordsTemplate",""]],standalone:!0})}return i})();const Gd=i=>a=>a.forEach(t=>t.style.height=i),Ad=(i,a)=>{if(!(0,v.nm)())return;const t=document.activeElement,n=((i,a)=>{const t=[];for(let n=0,o=i.length;n<o&&a[n];n++)t.push([i[n],a[n]]);return t})(i.rows,a.rows);(i=>{i.filter(([a,t])=>a.style.height||t.style.height).forEach(Gd(""))})(n);const o=(i=>i.map(([a,t])=>{const n=a.offsetHeight,o=t.offsetHeight;return n<o?o:n}))(n);[i,a].forEach(r=>r.style.display="none"),n.forEach((i=>(a,t)=>Gd(`${i[t]+1}px`)(a))(o)),[i,a].forEach(r=>r.style.display=""),document.activeElement!==t&&(i.contains(t)||a.contains(t))&&t.focus()};let Je=(()=>{class i{changes=new ue.B7;filter(t){this.changes.next(t)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),vi=(()=>{class i{savePDF=new e.bkB;drawPDF=new e.bkB;exportClick=new e.bkB;dataChanged=new e.bkB;exporting;save(t){this.emitEvent(this.savePDF,t)}draw(t,n){this.emitEvent(this.drawPDF,{component:t,promise:n})}emitEvent(t,n){if(0===t.observers.length){if((0,e.naY)())throw new Error("Creating PDF requires including the PDFModule and adding the <kendo-treelist-pdf> component.")}else t.emit(n)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();class Th extends Ci{constructor(){super()}}let $s=(()=>
1{class i{scroll=!1;static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Sh=i=>window.matchMedia(i).matches;let Ld=(()=>{class i{matchMedia=Sh;matchesMedia(t){return!t||this.matchMedia((i=>({xs:"(max-width: 576px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)"}[i]||i))(t))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),_o=(()=>{class i{saveToExcel=new e.bkB;exportClick=new e.bkB;loadingChange=new e.bkB;loading;save(t){if(0===this.saveToExcel.observers.length){if((0,e.naY)())throw new Error("Saving excel requires including the ExcelModule and adding the <kendo-treelist-excel> component.")}else this.saveToExcel.emit(t)}toggleLoading(t){this.loading=t,this.loadingChange.emit()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Zr=(i,a)=>{i.forEach(t=>{a(t),t.isColumnGroup&&t.hasChildren&&Zr(t.childrenArray,a)})},Bd=(i,a)=>
1{jn(i).forEach(t=>{a(t),t.isColumnGroup&&t.hasChildren&&Bd(t.childrenArray,a)})},Us=(i,a)=>{const t=[];return jn(i).forEach(n=>{if(a(n))if(n.isColumnGroup){const o=Us(n.childrenArray,a);o.length&&t.push(n,...o)}else(!n.isSpanColumn||Us(n.childrenArray,a).length)&&t.push(n)}),t.sort((n,o)=>Number(o.locked)-Number(n.locked))};class ea{columns;static empty(){return new ea(new e.rOR)}constructor(a){this.columns=a}forEach(a){Zr(this.columns,a)}filter(a){const t=[];return Zr(this.columns,n=>{a(n)&&t.push(n)}),t}filterHierarchy(a){return Us(this.columns.toArray(),a)}filterSort(a){const t=[];return Bd(this.columns.toArray(),n=>{a(n)&&t.push(n)}),t}toArray(){const a=[];return Zr(this.columns,t=>{a.push(t)}),a}rootColumns(){return this.columns.toArray()}totalColumnLevels(){let a=0;return this.forEach(t=>{a=Math.max(t.level,a)}),a}}let jd=(()=>{class i{templateRef;optionChanges;_position="top";set position(t){this._position=t,this.optionChanges.optionChanged()}get position(){return this._position}constructor(t,n){this.templateRef=t,this.optionChanges=n}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8),e.rXU(Tn))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListToolbarTemplate",""]],inputs:{position:"position"},standalone:!0})}return i})(),ta=(()=>{class i{ngZone;changes=new ue.B7;elements=[];source;subscriptions=new K.y;headerSubscription=new K.y;bodySubscription=new K.y;constructor(t){this.ngZone=t,this.subscriptions.add(this.changes.subscribe(n=>this.scrollLeft(n)))}registerEmitter(t,n){this.unregister(n),this.elements.push({element:t,sourceType:n}),("body"===n||"header"===n)&&this.ngZone.runOutsideAngular(()=>{const o=(0,Ne.R)(t,"scroll").pipe((0,Me.T)(({target:{scrollLeft:s}})=>({scrollLeft:s,sourceType:n}))),r=o.pipe((0,yt.F)((s,c)=>s.scrollLeft===c.scrollLeft),(0,ae.p)(s=>!this.source||this.source===s.sourceType),(0,Te.M)(s=>this.source=s.sourceType)).subscribe(s=>this.changes.next(s));r.add(o.pipe((0,ae.p)(s=>this.source&&this.source!==s.sourceType)).subscribe(()=>this.source=void 0)),"body"===n?this.bodySubscription.add(r):this.headerSubscription.add(r)})}destroy(){this.subscriptions.unsubscribe(),this.headerSubscription.unsubscribe(),this.bodySubscription.unsubscribe()}scrollLeft({scrollLeft:t,sourceType:n}){this.ngZone.runOutsideAngular(()=>{this.elements.filter(o=>n!==o.sourceType).forEach(({element:o})=>o.scrollLeft=t)})}unregister(t){const n=this.elements.findIndex(o=>o.sourceType===t);n>-1&&("header"===t?(this.headerSubscription.unsubscribe(),this.headerSubscription=new K.y):"body"===t&&(this.bodySubscription.unsubscribe(),this.bodySubscription=new K.y),this.elements.splice(n,1))}static \u0275fac=function(n){return new(n||i)(e.KVO(e.SKi))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Ys=(()=>{class i{resizeSubscription=new K.y(()=>{});dispatcher=new ue.B7;changes=this.dispatcher.asObservable().pipe((0,Wt.c)(100));connect(t){this.resizeSubscription.add(t.subscribe(this.dispatcher))}destroy(){this.resizeSubscription&&this.resizeSubscription.unsubscribe()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const kh=/^(?:a|input|select|option|textarea|button|object)$/i,Hs={},Vd=i=>String(i).trim().split(" "),kn=(i,a)=>{const t=Vd(a);return!!Vd(i.className).find(n=>t.indexOf(n)>=0)},Kt=i=>a=>kn(a,i),qe=i=>(Hs[i]||(Hs[i]=a=>String(a.nodeName).toLowerCase()===i.toLowerCase()),Hs[i]),pt=(i,a)=>{for(;i&&!a(i);)i=i.parentNode;return i},Xs=(i,a,t)=>{for(;i&&i!==t&&!a(i);)i=i.parentNode;if(i!==t)return i},Ws=i=>{const a=i.getBoundingClientRect();return(a.width>0&&a.height>0||0!==a.x&&0!==a.y)&&"hidden"!==window.getComputedStyle(i).visibility},$d=i=>{if(!i.tagName)return!1;const a=i.tagName.toLowerCase(),t=!!i.getAttribute("tabIndex");return!i.disabled&&kh.test(a)||t},bi=(i,a=!0)=>{if(!$d(i))return!1;const t=i.getAttribute("tabIndex"),n="true"===i.getAttribute("aria-hidden");return(!a||Ws(i))&&!n&&"-1"!==t},jt=(i,a,t=!0)=>{if(i){if(t&&a(i))return i;for(i=i.firstChild;i;){if(1===i.nodeType){const n=jt(i,a);if(n)return n}i=i.nextSibling}}};let na=(()=>{class i{cellClick=new e.bkB;cellMousedown=new e.bkB;click=new e.bkB;keydown=new e.bkB;focus=new e.bkB;focusIn=new e.bkB;focusOut=new e.bkB;windowBlur=new e.bkB;static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const zs=i=>i.parent?zs(i.parent):!!i.locked,Ud=(i,a)=>Object.assign({columns:co([i]),locked:zs(i)},a);let Ti=(()=>{class i{changes=new e.bkB;column;resizedColumns;tables=[];batch=null;start(t){this.trackColumns(t);const n=(this.column.isColumnGroup?[t]:[]).concat(co([t]));this.changes.emit({columns:n,locked:zs(this.column),type:"start"})}resizeColumns(t){const n=Ud(this.column,{deltaPercent:t,type:"resizeColumn"});this.changes.emit(n)}resizeTable(t,n){const o=Ud(t,{delta:n,type:"resizeTable"});this.changes.emit(o)}resizedColumn(t){this.resizedColumns.push(t)}end(){this.changes.emit({columns:[],resizedColumns:this.resizedColumns,type:"end"})}registerTable(t){return this.tables.push(t),()=>{this.tables.splice(this.tables.indexOf(t),1)}}measureColumns(t){null!==this.batch?this.batch.push(...t):this.autoFitBatch(t,()=>this.end())}autoFit(...t){const n=t.filter(o=>!o.isLocked);this.autoFitStart(n),this.autoFitBatch(this.batch,()=>{if(n.length<t.length){const o=t.filter(r=>r.isLocked);this.autoFitStart(o),this.autoFitBatch(this.batch,()=>this.end())}else this.end()})}trackColumns(t){this.resizedColumns=[],this.column=t}autoFitStart(t){if(this.batch=[],this.resizedColumns=[],0===t.length)return;const n=t[0].isLocked;this.changes.emit({type:"start",columns:t,locked:n}),this.changes.emit({type:"triggerAutoFit",columns:t,locked:n})}autoFitBatch(t,n){const o=t.length>0&&t[0].column.isLocked,r=this.tables.filter(s=>s.locked===o).map(s=>s.autoFit(t));(0,nn.yU)(...r).pipe((0,O.s)(1)).subscribe(s=>{this.changes.emit({columns:t.map(c=>c.column),type:"autoFitComplete",widths:s,locked:o}),n&&n()}),this.batch=null}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();const Ks=i=>!0===i||"string"==typeof i&&i.indexOf("row")>-1;class Mh extends Ci{originalEvent;
1constructor(a){super(),this.originalEvent=a}}let mo=(()=>{class i{popupService;renderer;ngZone;localization;onClose=new ue.B7;removeClick;popupRef;scrollSubscription;constructor(t,n,o,r,s){this.popupService=t,this.renderer=n,this.ngZone=o,this.localization=s,this.scrollSubscription=r.changes.pipe((0,bt.i)(1)).subscribe(()=>this.destroy())}open(t,n,o,r="k-grid-filter-popup"){const s=pe(o)&&this.popupRef===o;if(this.destroy(),!s){const c=this.localization.rtl?"right":"left";this.popupRef=this.popupService.open({anchorAlign:{vertical:"bottom",horizontal:c},popupAlign:{vertical:"top",horizontal:c},anchor:t,popupClass:r,content:n,positionMode:"absolute"}),this.renderer.setAttribute(this.popupRef.popupElement,"dir",this.localization.rtl?"rtl":"ltr"),this.attachClose(t)}return this.popupRef}destroy(){this.popupRef&&(this.detachClose(),this.popupRef.close(),this.popupRef=null)}ngOnDestroy(){this.destroy(),this.scrollSubscription.unsubscribe()}detachClose(){this.removeClick&&this.removeClick()}attachClose(t){this.detachClose(),(0,v.nm)()&&this.ngZone.runOutsideAngular(()=>this.removeClick=this.renderer.listen("document","click",n=>{if(!((i,a)=>{for(;i;){if(a(i))return!0;i=i.parentNode}return!1})(n.target,o=>this.popupRef.popupElement===o||o===t)){const o=new Mh(n);this.onClose.next(o),o.isDefaultPrevented()||this.destroy()}}))}static \u0275fac=function(n){return new(n||i)(e.KVO(me.OQ),e.KVO(e.sFG),e.KVO(e.SKi),e.KVO(ta),e.KVO(H.Pi))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Yd=i=>{if(!(0,v.nm)())return;let a=!1;return()=>(a||(document.body.appendChild(i),a=!0),i)},Hd=i=>{const{clientTop:a,clientLeft:t}=(i=>i.ownerDocument.documentElement)(i),{pageYOffset:n,pageXOffset:o}=(i=>i.ownerDocument.defaultView)(i),{top:r,left:s}=i.getBoundingClientRect();return{top:r+n-a,left:s+o-t}},Ah=(i,a)=>i===a||!!(16&a.compareDocumentPosition(i));let Js=(()=>{class i{changes=new e.bkB;register=[];lastTarget=null;add(t){this.register.push(t)}remove(t){this.register=this.register.filter(n=>n!==t)}notifyDrag(t,n,o){const r=this.targetFor(n);this.lastTarget!==r&&(this.changes.next({draggable:t,mouseEvent:o,target:this.lastTarget,type:"leave"}),r&&this.changes.next({draggable:t,mouseEvent:o,target:r,type:"enter"}),this.lastTarget=r)}notifyDrop(t,n){const o=t&&t.element&&this.targetFor(t.element.nativeElement);o&&this.lastTarget===o||this.changes.next({draggable:t,mouseEvent:n,target:this.lastTarget,type:"drop"}),this.lastTarget=null}targetFor(t){const n=Ah.bind(null,t);return this.register.find(({element:{nativeElement:o}})=>n(o))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Xd=(i,a,t)=>{const n=i.querySelector(".k-icon");if(t){const o=n.firstElementChild;o.removeChild(o.firstElementChild),n.firstElementChild.innerHTML=(a?de.WWM.content:de.YAr.content)+n.firstElementChild.innerHTML}n.setAttribute("class",n.getAttribute("class").replace(/(plus|cancel)/,a?"plus":"cancel"))},Wd=(i,a=null,t)=>{const n=i.querySelectorAll(".k-icon")[1],o=null===a?"":a?`k${t?"-svg":""}-i-lock`:`k${t?"-svg":""}-i-unlock`;t?(n.setAttribute("class",n.getAttribute("class").replace(/(k-svg-i-unlock|k-svg-i-lock)/,"").trim()+` ${o}`),n.firstElementChild.innerHTML=a?de.hzW.content:de.qqX.content):n.setAttribute("class",n.getAttribute("class").replace(/(k-i-unlock|k-i-lock)/,"").trim()+` ${o}`)};let qs=(()=>{class i{santizer;iconsService;dom;cancelIcon=de.YAr;constructor(t,n){this.santizer=t,this.iconsService=n}create(t){if(!(0,v.nm)())return;this.dom=document.createElement("div"),(i=>{i.className="k-header k-drag-clue",i.style.position="absolute",i.style.zIndex="20000"})(this.dom);const n=this.santizer.sanitize(e.WPN.HTML,t),o=this.isSVG?((i,a,t)=>`\n    <span class="k-icon k-svg-icon k-drag-status k-svg-i-cancel">\n        <svg \n            xmlns="http://www.w3.org/2000/svg"\n            xmlns:xlink="http://www.w3.org/1999/xlink"\n            viewB
1ox="${i}"\n            aria-hidden="true">\n            ${this.cancelIcon.content}\n        </svg>\n        <span class="k-icon k-svg-icon k-icon-modifier">\n            <svg\n                xmlns="http://www.w3.org/2000/svg"\n                xmlns:xlink="http://www.w3.org/1999/xlink"\n                viewBox="${i}"\n                aria-hidden="true">\n            </svg>\n        </span>\n    </span>\n    ${t}`)(this.cancelIcon.viewBox,0,n):(i=>`\n    <span class="k-icon k-font-icon k-drag-status k-i-cancel">\n        <span class="k-icon k-font-icon k-icon-modifier"></span>\n    </span>\n    ${i}`)(n);this.dom.innerHTML=o}attach(){return Yd(this.dom)}remove(){var t;this.dom&&this.dom.parentNode&&(t=this.dom,setTimeout(()=>document.body.removeChild(t)),this.dom=null)}show(){this.dom.style.display=""}hide(){this.dom.style.display="none"}enable(){Xd(this.dom,!0,this.isSVG)}disable(){Xd(this.dom,!1,this.isSVG)}removeLock(){Wd(this.dom,!1,this.isSVG)}toggleLock(t){Wd(this.dom,t,this.isSVG)}move(t){this.dom.style.top=t.pageY+"px",this.dom.style.left=t.pageX+"px"}get isSVG(){return"svg"===(this.iconsService.iconSettings?.type||this.iconsService.changes.value.type)}static \u0275fac=function(n){return new(n||i)(e.KVO(Tt.up),e.KVO(A.o3))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Qs=(()=>{class i{dom;create(){(0,v.nm)()&&(this.dom=document.createElement("div"),this.dom.className="k-grouping-dropclue",this.hide())}attach(){return Yd(this.dom)}remove(){this.dom&&this.dom.parentElement&&(document.body.removeChild(this.dom),this.dom=null)}hide(){this.dom.style.display="none"}position({left:t,top:n,height:o}){this.dom.style.display="block",this.dom.style.height=o+"px",this.dom.style.top=n+"px",this.dom.style.left=t-this.dom.offsetWidth/2+"px"}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Zs=(()=>{class i{changes=new e.bkB;reorder(t){this.changes.emit(t)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();class $h extends Ci{column;newIndex;oldIndex;constructor({column:a,newIndex:t,oldIndex:n}){super(),this.column=a,this.newIndex=t,this.oldIndex=n}}const Uh=new e.nKC("focus-root-initial-active-state");let ia=(()=>{class i{active;groups=new Set;constructor(t=!1){this.active=t}registerGroup(t){this.active&&this.groups.add(t)}unregisterGroup(t){this.active&&this.groups.delete(t)}activate(){this.active&&this.groups.forEach(t=>t.activate())}deactivate(){this.active&&this.groups.forEach(t=>t.deactivate())}static \u0275fac=function(n){return new(n||i)(e.KVO(Uh,8))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Yh=qe("button"),Hh=qe("input"),Xh=qe("kendo-checkbox")||qe("kendo-textbox"),Wh=/(button|checkbox|color|file|radio|reset|submit)/i;class Jh{renderer;get enabled(){return this.focusable&&!this.focusable.disabled}get visible(){return this.focusable&&Ws(this.focusable)}element;focusable;constructor(a,t){this.renderer=t,this.element=a.nativeElement,this.focusable=((i,a=!0)=>jt(this.element,t=>bi(t,a)))(0,!1)||this.element}isNavigable(){return this.canFocus()&&(i=>!i.disabled&&(Yh(i)||(i=>Hh(i)&&Wh.test(i.type))(i)||Xh(i)))(this.element)}toggle(a){this.renderer.setAttribute(this.focusable,"tabIndex",a?"0":"-1")}focus(){this.focusable&&this.focusable.focus()}canFocus(){return this.visible&&this.enabled}hasFocus(){return document&&document.activeElement!==this.element&&pt(document.activeElement,a=>a===this.element)}}let Ei=(()=>{class i{root;active=!0;children=[];get focusableChildren(){return this.children.filter(t=>t.canFocus())}get isActive(){return this.active}constructor(t){this.root=t,this.root.registerGroup(this)}ngOnDestroy(){this.root.unregisterGroup(this),this.active=!0}registerElement(t){this.unregisterElement(t),this.children.push(t)}unregisterElement(t){this.children=this.children.filter(n=>n!==t)}isNavigable(){const t=this.focusableChildren;return 1===t.length&&t[0].isNavigable()}canFocus(){return this.focusableChildren.length>0}focus(){this.canFocus()&&!this.hasFocus()&&this.focusableChildren[0].focus()}activate(){this.toggleState(!0)}deactivate(){this.toggleState(!1)}hasFocus(){return this.children.reduce((t,n)=>t||n.hasFocus(),!1)}toggleState(t){this.active!==t&&(this.active=t,this.children.forEac
1h(n=>n.toggle(t)))}static \u0275fac=function(n){return new(n||i)(e.KVO(ia))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),$n=(()=>{class i{hostElement;renderer;group;cellContext;set enabled(t){t!==this.enabled&&(this._enabled=t,this.element&&this.element.toggle(this.active&&t))}get enabled(){return this._enabled}set addCellContext(t){this.cellContext=t,this.enabled=!0}set editCellContext(t){this.cellContext=t,this.enabled=!0}set removeCellContext(t){this.cellContext=t,this.enabled=!0}set saveCellContext(t){this.cellContext=t,this.enabled=!0}set cancelCellContext(t){this.cellContext=t,this.enabled=!0}active=!0;_enabled=!0;element;constructor(t,n,o){this.hostElement=t,this.renderer=n,this.group=o}ngOnInit(){this.cellContext&&this.cellContext.focusGroup&&(this.group=this.cellContext.focusGroup),this.group&&this.group.registerElement(this)}ngAfterViewInit(){this.element||(this.element=new Jh(this.hostElement,this.renderer)),this.group&&this.toggle(this.group.isActive)}ngOnDestroy(){this.group&&this.group.unregisterElement(this)}toggle(t){this.element&&t!==this.active&&(this.active=t,this.element.toggle(this.enabled&&t))}canFocus(){return this.enabled&&this.element&&this.element.canFocus()}isNavigable(){return this.enabled&&this.element&&this.element.isNavigable()}focus(){this.enabled&&this.element&&this.element.focus()}hasFocus(){return this.enabled&&this.element&&this.element.hasFocus()}registerElement(t){this.element=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(Ei,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListFocusable",""],["","kendoTreeListAddCommand",""],["","kendoTreeListEditCommand",""],["","kendoTreeListRemoveCommand",""],["","kendoTreeListSaveCommand",""],["","kendoTreeListCancelCommand",""]],inputs:{cellContext:[0,"kendoTreeListFocusable","cellContext"],enabled:"enabled",addCellContext:[0,"kendoTreeListAddCommand","addCellContext"],editCellContext:[0,"kendoTreeListEditCommand","editCellContext"],removeCellContext:[0,"kendoTreeListRemoveCommand","removeCellContext"],saveCellContext:[0,"kendoTreeListSaveCommand","saveCellContext"],cancelCellContext:[0,"kendoTreeListCancelCommand","cancelCellContext"]},standalone:!0})}return i})();class qh{model;changes=new ue.B7;metadata;activeRow=0;activeCol=0;virtualCol=0;virtualRow=0;get row(){return this.model.findRow(this.activeRow)}get cell(){const a=this.row;if(a)return this.model.findCell(this.activeCol,a)}get dataRowIndex(){const a=this.row;return a?a.dataRowIndex:-1}constructor(a){this.model=a}reset(a=this.activeRow,t=this.activeCol,n=!0){this.activate(a,t,n)&&(this.virtualRow=a,this.virtualCol=t)}activate(a,t,n){if(!n&&this.isActiveRange(a,t))return!1;const o=this.activeCol,r=this.activeRow;return this.activeCol=t,this.activeRow=a,this.changes.next({colIndex:t,prevColIndex:o,prevRowIndex:r,rowIndex:a}),!0}isActiveRange(a,t){if(this.activeRow!==a)return!1;const n=this.cell,{start:o,end:r}=this.model.cellRange(n);return!n||o<=t&&t<=r}assume(a=this.activeRow,t=this.activeCol){this.virtualRow=a,this.virtualCol=t,this.activeCol=t,this.activeRow=a}announce(){this.changes.next({colIndex:this.activeCol,prevColIndex:this.activeCol,prevRowIndex:this.activeRow,rowIndex:this.activeRow})}activateVirtualCell(a){const t=this.model.rowRange(a),n=this.model.cellRange(a),o=this.activeCol,r=this.activeRow;if(t.start<=r&&r<=t.end&&n.start<=o&&o<=n.end)return this.activeRow=a.rowIndex,this.activeCol=a.colIndex,!0}isActive(a,t){return this.activeCol===t&&this.activeRow===a}moveUp(a=1){return this.offsetRow(-a)}moveDown(a=1){return this.offsetRow(a)}moveLeft(a=1){return this.offsetCol(-a)}moveRight(a=1){return this.offsetCol(a)}lastCellIndex(){return this.metadata.columns.leafColumnsToRender.length-1}offsetCol(a){const t=this.model.findRow(this.virtualRow),n=this.lastCellIndex(),o=this.virtualCol;this.virtualCol=Math.max(0,Math.min(o+a,n));let r=this.virtualCol;const s=this.virtualRow;let c=this.model.findCell(this.virtualCol,t);if(!c&&this.metadata.virtualColumns)return this.activate(s,r);if(c.colSpan>1&&c.colIndex<=o&&o<c.colIndex+c.colSpan){r=a>0?Math.min(c.colIndex+c.colSpan,n):Math.max(0,c.colIndex+a);const u=this.model.findCell(r,t);c!==u?(c=u,this.virtualCol=c.colIndex):this.virtualCol=o}return this.activate(c.rowIndex,c.colIndex)}offsetRow(a){let t=this.virtualCol;if(this.metadata&&this.metadata.isVirtual){let s=Math.max(0,Math.min(this.activeRow+a,this.metadata.maxLogicalRowIndex));const c=this.model.findRow(s);if(c){let u=this.model.findCell(this.virtualCol,c);u.rowIndex<=this.virtualRow&&a>0&&u.rowSpan>1&&(u=this.model.findCell(this.virtualCol,this.model.findRow(u.rowIndex+u.rowSpan-1+a))),s=u.rowIndex,t=u.colIndex}return this.virtualRow=s,this.activate(s,t)}const n=this.model.findRow(this.virtualRow+a)||this.model.nextRow(this.virtualRow,a);if(!n)return!1;let o=this.model.findCell(this.virtualCol,n);return o&&o.rowIndex<=this.virtualRow&&a>0&&o.rowSpan>1&&(o=this.model.findCell(this.virtualCol,this.model.findRow(o.rowIndex+o.rowSpan-1+a))),!o&&this.metadata.virtualColumns?this.activate(this.virtualRow+a,this.virtualCol):(this.virtualRow=o.rowIndex,this.activate(this.virtualRow,o.colIndex))}}class zd{count=0;items={};get first(){if(this.count>0){let a;return this.forEach(t=>(a=t,!0)),a}}get last(){if(this.count>0){const a=Object.keys(this.items);return this.items[a[a.length-1]]}}removeItem(a){this.items[a]&&(delete this.items[a],this.count--)}setItem(a,t){this.items[a]||this.count++,this.items[a]=t}getItem(a){return this.items[a]}toArray(){const a=[];return this.forEach(t=>{a.push(t)}),a}forEach(a){for(const t in this.items)if(this.items.hasOwnProperty(t)&&a(this.items[t]))return this.items[t]}find(a){return this.forEach(a)}}class Qh{uid;column;colIndex;rowIndex;colSpan;rowSpan;dataRowIndex;dataItem;parent;focusGroup;expandable;constructor(a,t){this.uid=t.uid,this.column=t.column,this.colIndex=t.logicalColIndex,this.rowIndex=a.index,this.colSpan=t.colSpan,this.rowSpan=t.rowSpan,this.dataItem=a.dataItem,this.dataRowIndex=a.dataRowIndex,this.focusGroup=t.focusGroup,this.expandable=t.expandable}focusContent(){this.focusGroup&&this.focusGroup.focus()}}class Zh{rows=new zd;get firstRow(){return this.rows.first}get lastRow(){return this.rows.last}registerCell(a){const t=this.rows.getItem(a.logicalRowIndex);if(!t)return;const n=new Qh(t,a);return t.cells.setItem(a.logicalColIndex,n),n}unregisterCell(a,t,n){const o=this.rows.getItem(t);if(o){const r=o.cells.getItem(a);r&&r.uid===n.uid&&o.cells.removeItem(a)}}registerRow(a){const t={uid:a.uid,index:a.logicalRowIndex,dataItem:a.dataItem,dataRowIndex:a.dataRowIndex,cells:new zd,isNew:a.isNew};this.rows.setItem(a.logicalRowIndex,t)}updateRow(a){const t=this.rows.getItem(a.logicalRowIndex);t&&Object.assign(t,{dataItem:a.dataItem,dataRowIndex:a.dataRowIndex})}unregisterRow(a,t){const n=this.rows.getItem(a);n&&n.uid===t.uid&&this.rows.removeItem(a)}cellRange(a){return a?{start:a.colIndex,end:a.colIndex+(a.colSpan||1)-1}:{}}rowRange(a){return a?{start:a.rowIndex,end:a.rowIndex+(a.rowSpan||1)-1}:{}}nextRow(a,t){const n=this.rows.toArray(),o=this.rows.getItem(a),r=n.indexOf(o);return n[r+t]}findRow(a){return this.rows.getItem(a)}findCell(a,t){if(!t)return;const n=t.index;let o=t.cells.getItem(a),r=n;for(;!o&&t;)t=this.rows.getItem(r),o=this.rowCell(a,t),r--;return o&&n<=t.index+(o.rowSpan||1)-1?o:void 0}rowCell(a,t){if(!t||!t.cells.count)return;const n=t.cells.first;let o,r=a;for(;!o&&r>=n.colIndex;)o=t.cells.getItem(r),r--;return o&&a<=o.colIndex+(o.colSpan||1)-1?o:void 0}}class ef{navigationService;constructor(a){this.navigationService=a}focus(){this.navigationService.focusCell()}toggle(a){this.navigationService.toggle(a)}canFocus(){return!0}hasFocus(){return this.navigationService.hasFocus()}isNavigable(){return!1}}class el extends Ci{dataItem;sender;expand;
1constructor(a){super(),this.expand=a.expand,this.dataItem=a.dataItem}}const Kd=i=>!0;let oa=(()=>{class i{changes=new ue.B7;isExpanded=Kd;toggleState(t){const n=this.isExpanded(t);this.changes.next(new el({dataItem:t,expand:!n}))}expand(t){this.isExpanded(t)||this.changes.next(new el({dataItem:t,expand:!0}))}collapse(t){this.isExpanded(t)&&this.changes.next(new el({dataItem:t,expand:!1}))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),ra=(()=>{class i{requests=new ue.B7;scrollTo(t){this.requests.next(t)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();class go{action;items;sender;constructor(a,t){this.action=a,this.items=t}}const tf=i=>!1,Si=()=>!1;let Rn=(()=>{class i{changes=new ue.B7;state=[];set settings(t){this._settings="object"==typeof t?t:{enabled:t},this.enabled=!1!==this._settings.enabled&&!this._settings.readonly,!1!==this._settings.enabled?"cell"===this._settings.mode?(this.isCellSelected=this.cellSelected,this.isRowSelected=Si):(this.isCellSelected=Si,this.isRowSelected=this.rowSelected):(this.isCellSelected=Si,this.isRowSelected=Si)}get settings(){return this._settings}get enableMarquee(){const t=this.settings?.checkboxOnly;if(!this.settings||t)return!1;const n="object"==typeof this.settings&&(0,v.Wo)(this.settings)&&this.settings.multiple&&!1!==this.settings.enabled&&!this.settings.checkboxOnly&&!1!==this.settings.drag;return this.enabled&&n}get enableMultiple(){return this.enabled&&this.settings.multiple}get rowSelection(){return"cell"!==this.settings.mode}isSelected=tf;isRowSelected=Si;isCellSelected=Si;enabled=!1;dragging=!1;view;columnsContainer;_settings={};selectionOrigin;tables=[];subscriptions=new K.y;init(t){this.view=t.view,this.columnsContainer=t.columnsContainer,this.subscriptions.add((0,we.h)(t.pageChange,t.dataStateChange).subscribe(()=>{this.selectionOrigin=null})),this.subscriptions.add(t.domEvents.cellMousedown.subscribe(n=>{this.enabled&&this._settings.multiple&&n.originalEvent.shiftKey&&n.originalEvent.preventDefault()}))}ngOnDestroy(){this.subscriptions.unsubscribe()}registerTable(t){this.tables.push(t)}unregisterTable(t){this.tables=this.tables.filter(n=>n!==t)}click(t,n){if(this.dragging)return void(this.dragging=!1);const o=!t.originalEvent.target||(0,v.Rq)(t.originalEvent.target,"k-checkbox");if(this.rowSelection&&this.settings.checkboxOnly&&!o)return;const{dataItem:r,column:s,columnIndex:c,originalEvent:u}=t;if(u.keyCode===v.D$.Enter||u.button&&0!==u.button)return;const g=this.isSelected(r,s,c),b=u.ctrlKey||u.metaKey,k=b||n;this._settings.multiple?u.shiftKey?this.selectRange({item:r,column:s,columnIndex:c},this.selectionOrigin||{columnIndex:0,column:this.leafColumns[0],item:this.view.firstItem.data}):(this.selectionOrigin={item:r,column:s,columnIndex:c},this.changes.next(new go(k?g?"remove":"add":"select",[{dataItem:r,column:s,columnIndex:c}]))):g&&!k||this.changes.next(new go(g&&k?"remove":"select",[{dataItem:r,column:s,columnIndex:c}])),b&&u.preventDefault()}checkboxClick(t){if(this.dragging)this.dragging=!1;else if(t.column.checkChildren&&t.viewItem.hasChildren&&!t.originalEvent.shiftKey&&!t.originalEvent.ctrlKey){const n=[t.dataItem],o=!!t.viewItem.selected;Vn.loadView({fields:Object.assign({},this.view.fieldAccessor(),{data:n,hasFooter:!1,pageable:!1,isVirtual:!1}),loaded:this.view.loaded,selectionState:this.view.selectionState}).subscribe(r=>{if(!r)return;const s=r.data.filter(c=>!!c.selected===o).map(c=>({dataItem:c.data}));this.changes.next(new go(o?"remove":"add",s))})}else this.click(t,!0)}toggleAll(t){Vn.loadView({fields:Object.assign({},this.view.fieldAccessor(),{hasFooter:!1,pageable:!1,isVirtual:!1}),loaded:this.view.loaded,selectionState:this.view.selectionState}).subscribe(n=>{if(!n)return;const o=n.data.filter(r=>!!r.selected!==t).map(r=>({dataItem:r.data}));this.changes.next(new go(t?"add":"remove",o))})}selectRange(t,n){const o=this.rangeItems(t,n);this.changes.next(new go("select",o))}rangeItems(t,n){const o=this.view.findIndex(g=>g.data===t.item||g===t.item),r=this.view.findIndex(g=>g.data===n.item||g===n.item),s=Math.min(o,r),c=Math.max(o,r),u=this.view.data.slice(s,c+1).filter(g=>"data"===g.type);if("cell"===this._settings.mode){const g=this.leafColumns,b=Math.min(t.columnIndex,n.columnIndex),k=Math.max(t.columnIndex,n.columnIndex),D=[];for(let V=0;V<u.length;V++)for(let U=b;U<=k;U++)D.push({dataItem:u[V].data,column:g[U],columnIndex:U});return D}return u.map(g=>({dataItem:g.data}))}updateSelectedState(){this.rowSelection&&this.view.updateSelectedState()}targetArgs(t,n){let o;return this.tables.some(r=>(o=r.targetArgs(t,n),o)),o}rowSelected(t){return this.isSelected(t)}cellSelected(t,n,o){return this.isSelected(t,n,o)}get leafColumns(){return this.columnsContainer.lockedLeafColumns.toArray().concat(this.columnsContainer.nonLockedLeafColumns.toArray())}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const nf=(i,a)=>pt(i,qe("kendo-treelist"))===a,of=qe("th"),rf=qe("td"),Jd=i=>rf(i)||of(i),qd=(i,a)=>{const t=((i,a)=>{let t=pt(i,Jd);for(;t&&!nf(t,a);)t=pt(t.parentElement,Jd);return t})(i,a),n=pt(t,qe("tr"));if(t&&n){let o=n.getAttribute("aria-rowindex")||n.getAttribute("data-kendo-treelist-row-index");o=o?parseInt(o,10)-1:null;let r=t.getAttribute("aria-colindex");if(r=r?parseInt(r,10)-1:null,null!==o&&null!==r)return{colIndex:r,rowIndex:o,element:t}}},Qd=i=>(i=>i===v.D$.ArrowLeft||i===v.D$.ArrowRight||i===v.D$.ArrowUp||i===v.D$.ArrowDown)(i)||i===v.D$.PageUp||i===v.D$.PageDown||i===v.D$.Home||i===v.D$.End,lf=qe("input");class Zd{firstItemIndex;lastItemIndex;constructor(a,t){this.firstItemIndex=a,this.lastItemIndex=t}containsRow(a){return a<0||a>=this.firstItemIndex&&a<=this.lastItemIndex}intersects(a,t){return a<=this.firstItemIndex&&this.lastItemIndex<=t||this.firstItemIndex<=a&&a<=this.lastItemIndex||this.firstItemIndex<=t&&t<=this.lastItemIndex}}let Un=(()=>{class i{zone;domEvents;pagerContextService;scrollRequestService;focusRoot;editService;localization;expandState;selectionService;changeDetector;focusableParent;changes;cellKeydown=new e.bkB;set metadata(t){this.meta=t,this.cursor.metadata=t}get metadata(){return this.meta}get enabled(){return this.alive}get activeCell(){if(0!==this.mode)return this.cursor.cell}get activeRow(){if(0!==this.mode)return Object.assign({},this.cursor.row,{cells:this.cursor.row.cells.toArray()})}viewport;columnViewport;activeRowIndex=0;alive=!1;active=!0;mode=0;model=new Zh;cursor=new qh(this.model);meta;subs;pendingRowIndex;virtualCell;get activeDataRow(){return Math.max(0,this.activeRowIndex-this.meta.headerRows)}constructor(t,n,o,r,s,c,u,g,b,k,D){this.zone=t,this.domEvents=n,this.pagerContextService=o,this.scrollRequestService=r,this.focusRoot=s,this.editService=c,this.localization=u,this.expandState=g,this.selectionService=b,this.changeDetector=k,this.focusableParent=D,this.changes=this.cursor.changes}init(t){this.alive=!0,this.focusRoot.active=!0,this.metadata=t;const n=(...r)=>s=>this.zone.isStable?(0,Ee.H)([!0]).pipe((0,Me.T)(()=>s)):this.zone.onStable.pipe((0,O.s)(1),(0,Me.T)(()=>s),...r),o=n();if(this.subs=new K.y,this.subs.add(this.cursor.changes.subscribe(r=>this.onCursorChanges(r))),this.subs.add(this.domEvents.focus.pipe((0,Oe.n)(o)).subscribe(r=>this.navigateTo(r.target))),this.subs.add(this.domEvents.focusOut.pipe((0,ae.p)(()=>0!==this.mode),(0,Oe.n)(n((0,L.Q)(this.domEvents.focus)))).subscribe(r=>this.onFocusOut(r))),this.subs.add(this.domEvents.windowBlur.pipe((0,ae.p)(()=>0!==this.mode)).subscribe(()=>this.onWindowBlur())),this.subs.add(this.editService.changes.pipe((0,ae.p)(r=>r instanceof Pd?!r.isDefaultPrevented():"edit"!==r.action&&2===this.mode),(0,Oe.n)(o)).subscribe(()=>
1this.leaveCell())),this.subs.add(this.pagerContextService.pageChange.subscribe(()=>this.cursor.reset(0,0))),this.subs.add(this.domEvents.keydown.subscribe(r=>this.onKeydown(r))),this.subs.add(this.domEvents.keydown.pipe((0,ae.p)(r=>r.keyCode===v.D$.Tab&&2===this.mode),(0,mi.K)(this.domEvents.focusOut.pipe((0,L.Q)((0,Fe.Y)(0).pipe((0,O.s)(1)))))).subscribe(()=>this.onTabout())),this.focusableParent){const r=new ef(this);this.focusableParent.registerElement(r)}this.deactivateElements()}ngOnDestroy(){this.subs&&this.subs.unsubscribe(),this.alive=!1}registerCell(t){if(t.logicalRowIndex!==this.pendingRowIndex){const n=this.model.registerCell(t);this.virtualCell&&this.cursor.activateVirtualCell(n)&&(this.virtualCell=!1)}}registerCellOnCurrentRow(t){t.logicalRowIndex===this.pendingRowIndex&&this.model.registerCell(t)}unregisterCell(t,n,o){this.model.unregisterCell(t,n,o)}registerRow(t){this.model.registerRow(t),this.pendingRowIndex=t.logicalRowIndex}updateRow(t){this.model.updateRow(t)}unregisterRow(t,n){this.model.unregisterRow(t,n)}isCellFocusable(t){return this.alive&&this.active&&2!==this.mode&&this.cursor.isActive(t.logicalRowIndex,t.logicalColIndex)}isCellFocused(t){return 1===this.mode&&this.isCellFocusable(t)}navigateTo(t){if(!this.alive||!(0,v.nm)())return;const n=qd(t,this.meta.treelistElement.nativeElement);if(!n)return;const o=this.mode,r=((i,a,t=!1)=>{if(!pt(a,r=>r===i))return!1;const o=pt(a,r=>r===a);return o&&(t||o!==i)})(n.element,document.activeElement),s=2===this.mode&&this.activeRowIndex===n.rowIndex&&t!==n.element;if(r)this.mode=2,this.cursor.reset(n.rowIndex,n.colIndex),this.activateRow();else if(!s){this.mode=1,this.deactivateElements();const c=this.cursor.isActive(n.rowIndex,n.colIndex);1===o&&c||this.cursor.reset(n.rowIndex,n.colIndex)}}tryFocus(t){this.activateElements();const n=((i,a=!0)=>jt(i,t=>bi(t,a),!1))(t);if(n){const o=qd(n,this.meta.treelistElement.nativeElement);o&&(this.cursor.reset(o.rowIndex,o.colIndex),this.deactivateElements(),this.enterCell()),n.focus()}else this.deactivateElements();return!!n}needsViewport(){return this.meta&&this.meta.isVirtual}setViewport(t,n){if(this.viewport=new Zd(t,n),this.enabled&&this.meta&&this.meta.isVirtual&&this.activeDataRow>-1){const o=this.activeDataRow,s=o-n;t-o>0?this.cursor.reset(t+this.meta.headerRows):s>0&&this.cursor.reset(n-this.meta.headerRows)}}setColumnViewport(t,n){this.columnViewport=new Zd(t,n)}focusCell(t=void 0,n=void 0){return this.mode=1,this.cursor.reset(t,n),this.activeCell}focusNextCell(t=!0){return this.focusAdjacentCell(!0,t)}focusPrevCell(t=!0){return this.focusAdjacentCell(!1,t)}toggle(t){this.active=t,this.cursor.announce()}hasFocus(){return 1===this.mode||2===this.mode}autoFocusCell(t,n){return!this.meta.virtualColumns||n<this.meta.columns.lockedLeafColumns.length||this.columnViewport.intersects(t,n)}focusAdjacentCell(t,n){this.focusCell();let o=t?this.moveCursorFwd():this.moveCursorBwd();if(n&&!o&&(o=t?this.cursor.moveDown(1):this.cursor.moveUp(1),o)){const r=this.cursor.row,s=t?0:this.cursor.lastCellIndex();this.cursor.reset(r.index,s)}return o?this.activeCell:(this.mode=0,this.cursor.announce(),null)}enterCell(){const t=this.cursor.cell;if(!t)return;const n=t.focusGroup,o=n&&n.canFocus();this.mode=o?2:1,this.cursor.announce(),o&&(this.activateRow(),n.focus())}leaveCell(){const t=this.cursor.cell;if(!t)return;const n=t.focusGroup;n&&n.canFocus()||this.deactivateElements(),this.mode=1,this.cursor.announce()}activateElements(){this.focusRoot.activate()}deactivateElements(){this.focusRoot.deactivate()}activateRow(){this.cursor.row.cells.forEach(t=>t.focusGroup&&t.focusGroup.activate())}moveCursorFwd(){return this.localization.rtl?this.cursor.moveLeft():this.cursor.moveRight()}moveCursorBwd(){return this.localization.rtl?this.cursor.moveRight():this.cursor.moveLeft()}updateSelection(t){this.selectionService.enabled&&this.selectionService.click({dataItem:this.cursor.row.dataItem,column:this.cursor.cell.column,columnIndex:this.cursor.cell.colIndex,originalEvent:t})}onCursorKeydown(t){let n=!1;const o=t.ctrlKey||t.metaKey,r=o?5:1;if(!this.onCellKeydown(t))return;const s=this.cursor.row;switch(t.keyCode){case v.D$.Space:this.updateSelection(t),n=this.selectionService.enabled;break;case v.D$.KeyA:t.ctrlKey&&this.selectionService.enabled&&(this.zone.run(()=>this.selectionService.toggleAll(!0)),n=!0);break;case v.D$.ArrowDown:n=this.cursor.moveDown(r),n&&t.shiftKey&&this.updateSelection(t);break;case v.D$.ArrowUp:n=this.cursor.moveUp(r),n&&t.shiftKey&&this.updateSelection(t);break;case v.D$.ArrowRight:t.altKey?(this.zone.run(()=>{this.expandState.expand(s.dataItem)}),n=!0):(n=this.moveCursorFwd(),n&&t.shiftKey&&this.updateSelection(t));break;case v.D$.ArrowLeft:t.altKey?(this.zone.run(()=>{this.expandState.collapse(s.dataItem)}),n=!0):(n=this.moveCursorBwd(),n&&t.shiftKey&&this.updateSelection(t));break;case v.D$.PageDown:if(this.metadata.isVirtual&&this.viewport){let c=this.meta.headerRows+this.viewport.lastItemIndex+1;c=Math.min(this.meta.maxLogicalRowIndex,c),this.cursor.reset(c),n=!0}else this.metadata.hasPager&&(this.zone.run(()=>this.pagerContextService.nextPage()),n=!0);break;case v.D$.PageUp:if(this.metadata.isVirtual&&this.viewport){const g=Math.max(this.meta.headerRows,this.viewport.firstItemIndex-(this.viewport.lastItemIndex-this.viewport.firstItemIndex)-1);this.cursor.reset(g),n=!0}else this.metadata.hasPager&&(this.zone.run(()=>this.pagerContextService.prevPage()),n=!0);break;case v.D$.Home:this.cursor.reset(o?this.meta.isVirtual?this.meta.headerRows:this.model.firstRow.index:s.index,0,!1),n=!0;break;case v.D$.End:if(o)this.cursor.reset(this.meta.isVirtual?this.meta.maxLogicalRowIndex:this.model.lastRow.index,this.cursor.lastCellIndex(),!1);else{const c=this.cursor.lastCellIndex(),u=this.model.findCell(c,s);u?this.cursor.reset(u.rowIndex,u.colIndex):this.cursor.reset(s.index,c)}n=!0;break;case v.D$.Enter:if(!t.ctrlKey&&!t.shiftKey){const c=this.editService.isEditingCell(),u=this.cursor.cell;c||!0!==u.expandable?(this.enterCell(),u.focusGroup.isNavigable()||(n=!0)):this.zone.run(()=>{this.expandState.toggleState(s.dataItem)})}break;
1default:!t.ctrlKey&&!t.altKey&&(i=>1===i.length&&i.match(/\S/))(t.key)&&this.enterCell()}n&&t.preventDefault()}onContentKeydown(t){if(!this.onCellKeydown(t))return;const n=!t.defaultPrevented&&t.keyCode===v.D$.Enter&&(i=>i&&lf(i)&&"text"===i.type.toLowerCase())(t.srcElement);t.keyCode===v.D$.Escape||t.keyCode===v.D$.F2||n?(this.leaveCell(),this.cursor.reset(),t.stopPropagation()):Qd(t.keyCode)&&this.cursor.cell.focusGroup.isNavigable()&&(this.onCursorKeydown(t),t.defaultPrevented&&this.leaveCell())}onCellKeydown(t){if(this.editService.isEditingCell()){const n=t.keyCode===v.D$.Enter,o=t.keyCode===v.D$.Escape,r=Qd(t.keyCode);if(n)return!this.editService.closeCell(t);if(o)this.editService.cancelCell(),this.meta.view.updateEditedState(),this.changeDetector.detectChanges();else if(r)return!1}return this.cellKeydown.emit(t),!0}onCursorChanges(t){this.activeRowIndex=t.rowIndex;const n=this.activeDataRow;if(this.meta&&this.meta.isVirtual&&this.viewport&&!this.viewport.containsRow(n)&&n>-1&&this.scrollRequestService.scrollTo({row:n}),this.meta.virtualColumns&&t.colIndex>=this.meta.columns.lockedLeafColumns.length){const o=this.activeCell,{start:r,end:s}=this.model.cellRange(o);o||(this.virtualCell=!0),(!o&&0!==this.mode||o&&!this.columnViewport.intersects(r,s))&&this.scrollRequestService.scrollTo({column:t.colIndex})}}onFocusOut(t){this.mode=Ws(t.target)?0:1,this.deactivateElements(),this.cursor.announce()}onWindowBlur(){this.mode=0,this.deactivateElements(),this.cursor.announce()}onKeydown(t){1===this.mode?this.onCursorKeydown(t):2===this.mode&&this.onContentKeydown(t)}onTabout(){this.cursor.cell.focusGroup.isNavigable()||(this.leaveCell(),this.cursor.reset())}static \u0275fac=function(n){return new(n||i)(e.KVO(e.SKi),e.KVO(na),e.KVO(Ie.OT),e.KVO(ra),e.KVO(ia),e.KVO(Ot),e.KVO(H.Pi),e.KVO(oa),e.KVO(Rn),e.KVO(e.gRc),e.KVO($n,8))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();class pf{view;headerRows;isVirtual;hasPager;treelistElement;virtualColumns;columns;get maxLogicalRowIndex(){return this.headerRows+this.dataRows-1}get dataRows(){return this.view.totalRows}constructor(a,t,n,o,r,s,c){this.view=a,this.headerRows=t,this.isVirtual=n,this.hasPager=o,this.treelistElement=r,this.virtualColumns=s,this.columns=c}}let uf=0,tl=(()=>{class i{prefix;constructor(){this.prefix="k-treelist"+uf++}cellId(t,n){return`${this.prefix}-r${t}c${n}`}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),In=(()=>{class i{visibilityChange=new e.bkB;lockedChange=new e.bkB;columnRangeChange=new e.bkB;columnsContainer=new Vs(()=>[]);list;get lockedLeafColumns(){return this.columnsContainer.lockedLeafColumns}get nonLockedLeafColumns(){return this.columnsContainer.nonLockedLeafColumns}get isLocked(){return this.lockedLeafColumns.length>0}get totalLevels(){return this.columnsContainer.totalLevels}get leafNamedColumns(){const t=Sn(this.list().filterSort(n=>!n.isColumnGroup)).filter(n=>n.matchesMedia&&n.displayTitle);return(0,He.My)(t,[{field:"locked",dir:"desc"}])}get unlockedRootCount(){return this.list().rootColumns().filter(t=>!t.locked&&t.isVisible).length}init(t,n){this.columnsContainer=t,this.list=n}changeVisibility(t){this.visibilityChange.emit(t)}changeLocked(t){this.lockedChange.emit(t)}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();class aa{changes=new ue.B7;sort(a){this.changes.next(a)}}class _f{columns;constructor(a){this.columns=a}}class ec{columns;constructor(a){this.columns=a}}function nl(i,a){return"data"===a.type&&a.isEditing?a.data:i}class il{create(a,t,n){this.throwUnsupportedError()}update(a){}remove(a){this.throwUnsupportedError()}assignValues(a,t){Object.assign(a,t)}throwUnsupportedError(){if((0,e.naY)())throw new Error("The default edit service of the editing directives can only update the items.Please provide an editService.")}}let ho=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),ol=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),tc=(()=>{class i{renderer;navigableElements=[];currentActiveIndex=0;defaultFocusableSelector="\n        [kendoTreeListToolbarFocusable],\n        [kendoTreeListAddCommand],\n        [kendoTreeListCancelCommand],\n        [kendoTreeListEditCommand],\n        [kendoTreeListRemoveCommand],\n        [kendoTreeListSaveCommand],\n        [kendoTreeListExcelCommand],\n        [kendoTreeListPDFCommand]\n    ";constructor(t){this.renderer=t}notify(){this.navigableElements=this.navigableElements.length&&Array.from(this.navigableElements[0].parentElement.querySelectorAll(this.defaultFocusableSelector))||[],this.currentActiveIndex=0,this.updateFocus()}focus(){this.navigableElements[this.currentActiveIndex]?.focus()}updateFocus(){this.navigableElements.length&&(this.navigableElements.forEac
1h(t=>{this.renderer.setAttribute(t,"tabindex","-1")}),this.renderer.setAttribute(this.navigableElements[this.currentActiveIndex],"tabindex","0"),(0,v.nm)()&&document.activeElement.closest(".k-toolbar")&&this.navigableElements[this.currentActiveIndex].focus())}static \u0275fac=function(n){return new(n||i)(e.KVO(e.sFG))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),fo=(()=>{class i{treelist;topToolbarNavigation;bottomToolbarNavigation;constructor(t){this.topToolbarNavigation=new tc(t),this.bottomToolbarNavigation=new tc(t)}static \u0275fac=function(n){return new(n||i)(e.KVO(e.sFG))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const ff={forbidden:"cancel",before:"insert-middle",after:"insert-middle",over:"plus"},Cf={forbidden:de.YAr,before:de.yWw,after:de.yWw,over:de.WWM},nc={zIndex:"20000",display:"flex",position:"fixed"},vf=["k-drag-clue","k-reorder-clue"],ic={zIndex:"19000",position:"absolute"},bf=["k-drop-hint","k-drop-hint-h"],Tf={handle:".k-table-td.k-drag-cell",dragTarget:".k-table-row[data-treelist-view-index]",dropTarget:".k-table-row[data-treelist-view-index]"};let rn=(()=>{class i{renderer;defaultSelectors=Tf;dragTarget=null;dropTarget=null;view;bindingDirective;offsetY;dropIndicator;lastDropPosition="forbidden";hintElement=null;rowReorder=new e.bkB;constructor(t){this.renderer=t}press(t){this.dragTarget=t.dragTarget,this.offsetY=t.dragEvent.offsetY}dragStart(){this.createDropIndicator()}drag(t){(0,v.Wo)(t.hintElement)&&!(0,v.Wo)(this.hintElement)&&(this.hintElement=t.hintElement,this.decorateHint());const n_x=t.dragEvent.clientX,n_y=t.dragEvent.clientY-this.offsetY;(0,v.Wo)(this.hintElement)&&(this.renderer.setStyle(this.hintElement,"left",`${n_x}px`),this.renderer.setStyle(this.hintElement,"top",`${n_y}px`)),this.positionDropIndicator(t)}dragEnter(t){this.dropTarget=t.dropTarget,this.view=t.dragData}dragLeave(){this.dropTarget=null,"forbidden"===this.lastDropPosition&&this.hide()}dragEnd(){this.destroyDropIndicator(),this.dragTarget=null,this.dropTarget=null,this.hintElement=null}drop(){this.destroyDropIndicator();const t=this.rowReorderArgs(this.dragTarget,this.dropTarget,this.view);this.rowReorder.emit(t)}get hintIcon(){return ff[this.lastDropPosition]}get hintSVGIcon(){return Cf[this.lastDropPosition]}getDefaultHintText(t,n){let o="";const r=t.toArray().filter(u=>!u.hidden&&(0,v.Wo)(u.field)).map(u=>u.field),c=this.getDragRowPerElement(this.dragTarget,n)?.dataItem;return(0,v.Wo)(c)&&r.forEach(u=>{const g=c[u];(0,v.Wo)(g)&&(o+=`${g} `)}),o.trim()}rowReorderArgs(t,n,o){return{draggedRows:[this.getDragRowPerElement(t,o)],dropTargetRow:this.getDragRowPerElement(n,o),dropPosition:this.lastDropPosition}}isOverChild(t){return!1}reorderRows(t,n,o){}get parentIdField(){return this.bindingDirective.parentIdField}get idField(){return this.bindingDirective.idField}get childrenField(){return this.bindingDirective.childrenField}get data(){return this.bindingDirective.data}getDragRowPerElement(t,n){let o=t?.getAttribute("data-treelist-view-index");return o=o?parseInt(o,10):-1,{dataItem:-1===o?null:n?.at(o)?.data,rowIndex:o,element:t}}createDropIndicator(){(0,v.nm)()&&(this.dropIndicator=document.createElement("div"),this.decorateDropIndicator(),this.dropIndicator.innerHTML='\n            <div class="k-drop-hint-start"></div>\n            <div class="k-drop-hint-line"></div>\n        ',document.body.appendChild(this.dropIndicator),this.hide())}destroyDropIndicator(){(0,v.nm)()&&this.dropIndicator&&this.dropIndicator.parentElement&&(document.body.removeChild(this.dropIndicator),this.dropIndicator=null)}decorateHint(){vf.forEach(t=>this.renderer.addClass(this.hintElement,t)),Object.keys(nc).forEach(t=>this.renderer.setStyle(this.hintElement,t,nc[t]))}positionDropIndicator(t){this.lastDropPosition=this.getDropPosition(t.dragEvent),this.updateDropIndicatorPosition()}decorateDropIndicator(){bf.forEach(t=>this.renderer.addClass(this.dropIndicator,t)),Object.keys(ic).forEach(t=>this.renderer.setStyle(this.dropIndicator,t,ic[t]))}getDropPosition(t){if(this.dropTarget===this.dragTarget||!(0,v.Wo)(this.dropTarget))return"forbidden";
1const n=this.dropTarget.getBoundingClientRect(),r=n.height/3,{dropTargetRow:s}=this.rowReorderArgs(this.dragTarget,this.dropTarget,this.view),c=t.clientY,u=n.top;let g=null;return g=c<=u+r?"before":c>=u+n.height-r?"after":"over",("before"===g&&(()=>this.dropTarget===this.dragTarget.nextElementSibling)()||"after"===g&&(()=>this.dropTarget===this.dragTarget.previousElementSibling)())&&(g="forbidden"),(0,v.Wo)(s.dataItem)?this.isOverChild(s.dataItem)&&(g="forbidden"):g="forbidden",g}updateDropIndicatorPosition(){if(this.shouldHideDropIndicator()||!this.dropTarget)return void this.hide();this.show();const t=function hf(i){const{clientTop:a,clientLeft:t}=(i=>i?.ownerDocument.documentElement)(i),{pageYOffset:n,pageXOffset:o}=(i=>i?.ownerDocument.defaultView)(i),{top:r,left:s}=i.getBoundingClientRect();return{top:r+n-a,left:s+o-t}}(this.dropTarget);let n=t.top;"after"===this.lastDropPosition&&(n+=this.dropTarget.offsetHeight),this.renderer.setStyle(this.dropIndicator,"left",`${t.left+this.dropIndicator.offsetWidth/2}px`),this.renderer.setStyle(this.dropIndicator,"top",`${n}px`)}shouldHideDropIndicator(){return"forbidden"===this.lastDropPosition||"over"===this.lastDropPosition}hide(){(0,v.Wo)(this.dropIndicator)&&this.renderer.setStyle(this.dropIndicator,"display","none")}show(){(0,v.Wo)(this.dropIndicator)&&this.renderer.removeStyle(this.dropIndicator,"display")}static \u0275fac=function(n){return new(n||i)(e.KVO(e.sFG))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),al=(()=>{class i{localization;hostClass=!0;get loadingText(){return this.localization.get("loading")}constructor(t){this.localization=t}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListLoading",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-loading-mask",o.hostClass)},standalone:!0,features:[e.aNF],attrs:Rs,decls:4,vars:1,consts:[[1,"k-loading-text"],[1,"k-loading-image"],[1,"k-loading-color"]],template:function(n,o){1&n&&(e.j41(0,"span",0),e.EFF(1),e.k0s(),e.nrm(2,"div",1)(3,"div",2)),2&n&&(e.R7$(),e.JRh(o.loadingText))},encapsulation:2})}return i})();const oc="k-hierarchy-cell k-detail-cell k-group-cell",rc="k-i-none k-svg-i-none";let ac=(()=>{class i{transform(t,n){const o=[],r=t+1-(n?1:0);for(let s=0;s<r;s++)o.push(s);return o}static \u0275fac=function(n){return new(n||i)};static \u0275pipe=e.EJ8({name:"levelItems",type:i,pure:!0,standalone:!0})}return i})(),Df=0,sa=(()=>{class i{focusGroup;element;columnInfoService;idService;navigationService;renderer;zone;logicalColIndex;logicalRowIndex;logicalSlaveCell=!1;column;colIndex;colSpan=1;rowSpan=1;dataRowIndex=-1;dataItem;expandable=!1;uid=function Of(){return Df++}();get id(){if(!this.logicalSlaveCell&&this.columnInfoService.isLocked)return this.idService.cellId(this.logicalRowIndex,this.logicalColIndex)}get ariaColIndex(){if(!this.logicalSlaveCell&&-1!==this.logicalColIndex)return this.logicalColIndex+1}navigationChange;constructor(t,n,o,r,s,c,u){this.focusGroup=t,this.element=n,this.columnInfoService=o,this.idService=r,this.navigationService=s,this.renderer=c,this.zone=u}ngOnInit(){this.navigationService.enabled&&(this.navigationChange=this.navigationService.changes.subscribe(t=>this.onNavigationChange(t)))}ngDoCheck(){!this.navigationService.enabled||-1===this.logicalColIndex||this.registerNoChanges()}ngOnChanges(t){if(!this.navigationService.enabled||-1===this.logicalColIndex)return;const n=t.logicalColIndex,o=t.logicalRowIndex,r=n&&!n.isFirstChange()?n.previousValue:this.logicalColIndex,s=o&&!o.isFirstChange()?o.previousValue:this.logicalRowIndex;this.navigationService.unregisterCell(r,s,this),this.registerChanges(),this.updateElement()}ngOnDestroy(){this.navigationChange&&this.navigationChange.unsubscribe(),this.navigationService.unregisterCell(this.logicalColIndex,this.logicalRowIndex,this)}onNavigationChange(t){(this.logicalColIndex===t.colIndex&&this.logicalRowIndex===t.rowIndex||this.logicalColIndex===t.prevColIndex&&this.logicalRowIndex===t.prevRowIndex)&&this.updateElement()}updateElement(){const t=this.element.nativeElement;this.renderer.setAttribute(t,"tabIndex",this.isFocusable()&&!this.logicalSlaveCell?"0":"-1"),this.isFocused()?this.focusGroup.isNavigable()?this.focusGroup.focus():(!this.logicalSlaveCell&&this.navigationService.autoFocusCell(this.logicalColIndex,this.logicalColIndex+this.colSpan-1)&&this.microtask(()=>
1this.isFocused()&&t.focus()),this.renderer.addClass(t,"k-focus")):this.renderer.removeClass(t,"k-focus")}microtask(t){this.zone.runOutsideAngular(()=>Promise.resolve(null).then(t))}registerChanges(){this.logicalSlaveCell||this.navigationService.registerCell(this)}registerNoChanges(){this.logicalSlaveCell||this.navigationService.registerCellOnCurrentRow(this)}isFocusable(){return this.navigationService.isCellFocusable(this)}isFocused(){return this.navigationService.isCellFocused(this)}static \u0275fac=function(n){return new(n||i)(e.rXU(Ei),e.rXU(e.aKT),e.rXU(In),e.rXU(tl),e.rXU(Un),e.rXU(e.sFG),e.rXU(e.SKi))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListLogicalCell",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.BMQ("id",o.id)("aria-colindex",o.ariaColIndex)},inputs:{logicalColIndex:"logicalColIndex",logicalRowIndex:"logicalRowIndex",logicalSlaveCell:"logicalSlaveCell",column:"column",colIndex:"colIndex",colSpan:"colSpan",rowSpan:"rowSpan",dataRowIndex:"dataRowIndex",dataItem:"dataItem",expandable:"expandable"},standalone:!0,features:[e.Jv_([{provide:Ei,deps:[ia],useClass:Ei}]),e.OA$]})}return i})();const xf=/\{\d+:?/;let sc=(()=>{class i{intlService;constructor(t){this.intlService=t}transform(t,n,o){if(!Ve(n)){const r=(0,Pe.oK)(n)(t);return Ve(o)?r:this.formatValue(o,r)}return t}formatValue(t,n){const o=this.intlService;return ao(t)&&t.match(xf)?o.format(t,n):o.toString(n,t)}static \u0275fac=function(n){return new(n||i)(e.rXU(Et.Bs,16))};static \u0275pipe=e.EJ8({name:"valueOf",type:i,pure:!1,standalone:!0})}return i})(),sl=(()=>{class i{editService;localization;focusGroup;get commandCellClass(){return this.column.isCommand}get isCheckboxColumn(){return(()=>this.column.isCheckboxColumn)()}get textNoWrapClass(){return this.column.expandable}get dragHandleCellClass(){return vd(this.column)}get dragRowHandleLabel(){return vd(this.column)?this.localization.get("dragRowHandleLabel"):void 0}column;columnIndex;isNew=!1;level=0;hasChildren;isExpanded;loading;expandIcons;rowIndex;selected;dataItem;set viewItem(t){this._viewItem=t,this.cellContext.viewItem=this.viewItem}get viewItem(){return this._viewItem}get formGroup(){return this.viewItem.isNew?this.editService.newItemGroup:this.viewItem.editContext?this.viewItem.editContext.group:null}get isEdited(){return!!(this.viewItem.isNew&&Ps(this.column,this.editService.newItemGroup)||Ps(this.column,this.formGroup)&&this.viewItem.editContext&&this.editService.isEditedColumn(this.column))}get templateContext(){return this._templateContext}get editTemplateContext(){return this._editTemplateContext.$implicit=this.formGroup,this._editTemplateContext.cellContext=this.cellContext,this._editTemplateContext.column=this.column,this._editTemplateContext.dataItem=this.dataItem,this._editTemplateContext.formGroup=this.formGroup,this._editTemplateContext.isNew=this.isNew,this._editTemplateContext.rowIndex=this.isNew?-1:this.rowIndex,this._editTemplateContext}get format(){if(Rd(this.column)&&!Ve(this.column.format))return Fs(this.column.format)}get isBoundColumn(){return this.column.field&&!this.column.templateRef}get isSpanColumn(){return Os(this.column)&&!this.column.templateRef}get childColumns(){return Bn([this.column])}caretAltDownIcon=de.Y8K;caretAltRightIcon=de.yVr;caretAltLeftIcon=de.ner;reorderIcon=de.Zu2;noneIcon={name:"none",content:"",viewBox:"0 0 24 24"};cellContext={};_templateContext={};_editTemplateContext={};_viewItem;constructor(t,n,o){this.editService=t,this.localization=n,this.focusGroup=o,this.templateContext.cellContext=this.cellContext,this.cellContext.focusGroup=o}ngDoCheck(){this.updateTemplateContext()}ngAfterContentChecked(){this.updateTemplateContext()}updateTemplateContext(){if(!this.column.templateRef)return;const t=this._templateContext;t.$implicit=this.dataItem,t.column=this.column,t.columnIndex=this.columnIndex,t.dataItem=this.dataItem,t.hasChildren=this.hasChildren,t.isExpanded=this.isExpanded,t.isNew=this.isNew,t.level=this.level,t.loading=this.loading,t.rowIndex=this.viewItem.rowIndex}get arrowIcon(){return this.isExpanded?"caret-alt-down":this.localization.rtl?"caret-alt-left":"caret-alt-right"}get arrowSVGIcon(){return this.isExpanded?this.caretAltDownIcon:this.localization.rtl?this.caretAltLeftIcon:this.caretAltRightIcon}messageFor(t){return this.localization.get(t)}static \u0275fac=function(n){return new(n||i)(e.rXU(Ot),e.rXU(H.Pi),e.rXU(Ei))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListCell",""]],hostVars:11,hostBindings:function(n,o){2&n&&(e.BMQ("aria-label",o.dragRowHandleLabel),e.AVh("k-command-cell",o.commandCellClass)("k-checkbox-cell",o.isCheckboxColumn)("k-text-nowrap",o.textNoWrapClass)("k-drag-cell",o.dragHandleCellClass)("k-touch-action-none",o.dragHandleCellClass))},inputs:{column:"column",columnIndex:"columnIndex",isNew:"isNew",level:"level",hasChildren:"hasChildren",isExpanded:"isExpanded",loading:"loading",expandIcons:"expandIcons",rowIndex:"rowIndex",selected:"selected",dataItem:"dataItem",viewItem:"viewItem"},standalone:!0,features:[e.aNF],attrs:gi,decls:3,vars:3,consts:[[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],[3,"ngIf"],["name","none","innerCssClass","k-treelist-toggle",3,"svgIcon",4,"ngFor","ngForOf"],["innerCssClass","k-treelist-toggle","aria-hidden","true",3,"name","svgIcon",4,"ngIf"],["class","k-icon k-i-loading",4,"ngIf"],["name","none","innerCssClass","k-treelist-toggle",3,"svgIcon"],["innerCssClass","k-treelist-toggle","aria-hidden","true",3,"name","svgIcon"],[1,"k-icon","k-i-loading"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngFor","ngForOf"],["kendoTreeListFocusable","",3,"inputAttributes","checkedState"],["name","reorder",3,"svgIcon"],[3,"ngSwitch",4,"ngIf"],["kendoTreeListFocusable","",3,"format","formControl",4,"ngSwitchCase"],["kendoTreeListFocusable","",3,"formControl",4,"ngSwitchCase"],["kendoTreeListFocusable","",3,"formControl",4,"ngSwitchDefault"],["kendoTreeListFocusable","",3,"format","formControl"],["kendoTreeListFocusable","",3,"formControl"]],template:function(n,o){1&n&&(e.qex(0,0),e.DNE(1,X,7,6,"ng-container",1)(2,oe,3,2,"ng-container",1),e.bVm()),2&n&&(e.Y8G("ngSwitch",o.isEdited),e.R7$(),e.Y8G("ngSwitchCase",!1),e.R7$(),e.Y8G("ngSwitchCase",!0))},dependencies:[M.ux,M.e1,M.bT,M.pM,A.QK,M.T3,$n,je.Jh,R.X1,R.BC,R.l_,z.I,M.fG,sc,ac,je.$W,je.OV],encapsulation:2})}return i})(),Mf=0,ll=(()=>{class i{idService;navigation;logicalRowIndex;logicalSlaveRow=!1;logicalCellsCount;logicalSlaveCellsCount=0;dataRowIndex=-1;dataItem;isNew=!1;totalColumns;uid=function Ff(){return Mf++}();get hostRole(){return this.logicalSlaveRow?"presentation":"row"}get ariaRowIndex(){return this.logicalSlaveRow?null:this.logicalRowIndex+1}get rowIndex(){return this.logicalSlaveRow?this.logicalRowIndex+1:null}get ariaOwns(){if(this.logicalSlaveRow||0===this.logicalSlaveCellsCount)return;const t=[];if(this.dataRowIndex<0){let n=this.logicalCellsCount+this.logicalSlaveCellsCount;this.columnsArray.forEach(o=>{o.isSpanColumn&&(n+=o.colspan-1)});for(let o=this.logicalCellsCount;o<n;o++)t.push(this.idService.cellId(this.logicalRowIndex,o))}else{let n=0;this.columnsArray.forEach(o=>{o.isLocked||t.push(this.idService.cellId(this.logicalRowIndex,n)),n+=o.isSpanColumn?o.
1colspan:1})}return t.join(" ")}tableRowClass=!0;constructor(t,n){this.idService=t,this.navigation=n}ngOnChanges(t){if(!this.navigation.enabled||this.logicalSlaveRow)return;const n=t.logicalRowIndex;if(n||t.logicalSlaveRow||t.isNew){const s=n&&!n.isFirstChange()?n.previousValue:this.logicalRowIndex;this.navigation.unregisterRow(s,this),this.navigation.registerRow(this)}else(0,v.TI)(["dataRowIndex","dataItem"],t)&&this.navigation.updateRow(this)}ngOnDestroy(){this.navigation.unregisterRow(this.logicalRowIndex,this)}get columnsArray(){return this.totalColumns?.allColumns.toArray()||[]}static \u0275fac=function(n){return new(n||i)(e.rXU(tl),e.rXU(Un))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListLogicalRow",""]],hostVars:6,hostBindings:function(n,o){2&n&&(e.BMQ("role",o.hostRole)("aria-rowindex",o.ariaRowIndex)("data-kendo-treelist-row-index",o.rowIndex)("aria-owns",o.ariaOwns),e.AVh("k-table-row",o.tableRowClass))},inputs:{logicalRowIndex:"logicalRowIndex",logicalSlaveRow:"logicalSlaveRow",logicalCellsCount:"logicalCellsCount",logicalSlaveCellsCount:"logicalSlaveCellsCount",dataRowIndex:"dataRowIndex",dataItem:"dataItem",isNew:"isNew",totalColumns:"totalColumns"},standalone:!0,features:[e.OA$]})}return i})();const lc=(i,a)=>{for(let t=0;t<a.length;t++)if(a[t]===i)return t};let dc=(()=>{class i{changeNotification;editService;localization;ngZone;renderer;element;domEvents;columnInfoService;navigationService;expandState;selection;hostClass=!0;columns=[];allColumns;noRecordsTemplate;view;skip=0;filterable;noRecordsText;isLocked=!1;lockedColumnsCount=0;totalColumnsCount=0;virtualColumns;expandIcons;trackBy=nl;totalColumns;noneIcon={name:"none",content:"",viewBox:"0 0 24 24"};clickSubscription;l10nSubscription;cellKeydownSubscription;clickTimeout;headerOffset;rowClass=()=>null;constructor(t,n,o,r,s,c,u,g,b,k,D){this.changeNotification=t,this.editService=n,this.localization=o,this.ngZone=r,this.renderer=s,this.element=c,this.domEvents=u,this.columnInfoService=g,this.navigationService=b,this.expandState=k,this.selection=D,this.cellKeydownSubscription=this.navigationService.cellKeydown.subscribe(V=>this.cellKeydownHandler(V)),this.trackByWrapper=this.trackByWrapper.bind(this),this.trackByColumns=this.trackByColumns.bind(this),this.noRecordsText=this.localization.get("noRecords"),this.selection.registerTable(this)}get newDataItem(){return this.editService.newDataItem}unlockedColumnsCount(t){const n=this.allColumns||this.columns;let o=n.length;return n.forEach(c=>{c.isSpanColumn&&(o+=c.colspan-1)}),t&&"data"===t.type?this.totalColumnsCount-this.lockedColumnsCount-o:this.totalColumnsCount-this.lockedColumnsCount-(this.allColumns||this.columns).length}get hasData(){const t=this.view;return t&&null!=t.data&&t.data.length>0}isOdd(t){return t.index%2!=0}trackByWrapper(t,n){return"data"===n.type&&(n.isEditing=this.editService.isEdited(n.data)),this.trackBy(t,n)}trackByColumns(t,n){return this.virtualColumns?t:n}ngOnChanges(t){(0,v.Hq)("columns",t,!1)&&this.changeNotification.notify()}addRowLogicalIndex(){return this.columnInfoService.totalLevels+1}logicalColIndex(t){return pe(t.leafIndex)?t.leafIndex:-1}cellExpandable(t,n){return!(!n.expandable||!t.hasChildren)}ariaRowExpanded(t){return this.lockedColumnsCount<1?!!t.expanded:void 0}ariaRowSelected(t){return this.lockedColumnsCount<1?!!t.selected:void 0}ariaExpanded(t,n){if(n.expandable&&t.hasChildren)return!!t.expanded}ariaSelected(t,n,o){if(this.selection.enabled)return t.selected||this.isCellSelected(t.data,n,o)}ngOnInit(){this.ngZone.runOutsideAngular(()=>{const n=this.clickHandler.bind(this),o=this.renderer.listen(this.element.nativeElement,"mousedown",n),r=this.renderer.listen(this.element.nativeElement,"click",n),s=this.renderer.listen(this.element.nativeElement,"contextmenu",n);this.clickSubscription=()=>{o(),r(),s()}});let t=this.localization.get("noRecords");this.l10nSubscription=this.localization.changes.subscribe(()=>{this.noRecordsText===t&&(this.noRecordsText=this.localization.get("noRecords"),t=this.noRecordsText)})}ngDoCheck(){this.headerOffset=this.columnInfoService.totalLevels+(Ks(this.filterable)?1:0)}ngOnDestroy(){this.clickSubscription&&this.clickSubscription(),this.l10nSubscription&&this.l10nSubscription.unsubscribe(),this.cellKeydownSubscription.unsubscribe(),this.selection.unregisterTable(this),clearTimeout(this.clickTimeout)}isEditingCell(t,n){return!(!t.editContext||!this.editService.isEditingColumn(n))}isEditingRow(t){return!!t.editContext||t.isNew}get columnsContainer(){return this.columnInfoService.columnsContainer}get hasFooter(){return this.columnsContainer.hasFooter}get columnsSpan(){return Ns(this.columns)}get allColumnsSpan(){return Ns(this.allColumns||this.columns)}get colSpan(){return this.columnsSpan}get footerColumns(){return this.isLocked?this.columnsContainer.lockedColumnsToRender:this.columnsContainer.nonLockedColumnsToRender}logicalRowIndex(t){return 1+t+this.headerOffset}isCellSelected(t,n,o){return this.selection.isCellSelected(t,n,o)}targetArgs(t,n){const{cell:o,row:r}=this.targetElements(t);
1if(o&&(!n||t===o||!bi(t,!1))){const s=lc(o,r.cells),c=this.columns.toArray()[s],u=this.lockedColumnsCount+s;return{item:this.rowItem(r),column:c,columnIndex:u}}}checkIfClickable(t,n){return!qe("label")(t)&&(!kn(t,"k-icon k-svg-icon")||kn(t,rc))&&!Xs(t,Kt("k-treelist-ignore-click"),n)}clickHandler(t){const n=t.target,{cell:o,row:r}=this.targetElements(n),s=oc.concat(" k-drag-cell"),c=!!o&&!kn(o,s);if(r&&!kn(r,"k-grouping-row k-group-footer k-detail-row k-grid-norecords")&&c){if(this.expandClick(t,r)||this.checkboxClick(o,r,t)&&!this.selection.dragging)return;this.editService.preventCellClose();const g=n!==o&&bi(n,!1),b=this.checkIfClickable(n,o);if(!g&&b){const k=this.cellClickArgs(o,r,t);if(!k)return;"mousedown"===t.type?this.domEvents.cellMousedown.emit(k):(k.isEditedColumn||!this.editService.closeCell(t))&&("click"===t.type?this.clickTimeout=setTimeout(()=>{this.emitCellClick(k)},0):this.emitCellClick(k))}}}emitCellClick(t){this.domEvents.cellClick.emit(t)}cellKeydownHandler(t){t.keyCode===v.D$.Enter&&this.clickHandler(t)}cellClickArgs(t,n,o){const r=lc(t,n.cells),s=this.columns.toArray()[r],c=this.lockedColumnsCount+r,u=this.rowItem(n);if("data"!==u.type)return;const g="keydown"===o.type?"click":o.type;return{column:s,columnIndex:c,viewItem:u,dataItem:u.data,rowIndex:u.index,index:u.index,isEditedColumn:u.editContext&&this.editService.isEditingColumn(s),isEdited:u.isNew||u.editContext&&this.editService.isEditedColumn(s),originalEvent:o,type:g}}targetElements(t){const n=this.element.nativeElement;let o,r,s,c,u=t;do{o=pt(u,qe("td")),r=pt(o,qe("tr")),s=pt(r,qe("tbody")),u=s,c=Xs(u,Kt("k-treelist k-grid"),n)}while(s&&s!==n&&!c);return o&&s===n&&!c?{cell:o,row:r}:{}}expandClick(t,n){if("click"===t.type&&!kn(t.target,rc)&&t.target.closest(".k-treelist-toggle")){t.preventDefault();const o=this.rowItem(n);if("data"===o.type)return this.ngZone.run(()=>{this.expandState.toggleState(o.data)}),!0}}checkboxClick(t,n,o){const r=kn(t,"k-checkbox-cell"),s=o.target.closest(".k-checkbox-wrap");if((!r||s||!this.selection.settings.checkboxOnly)&&"click"===o.type&&r&&this.selection.enabled&&this.selection.rowSelection){const c=this.cellClickArgs(t,n,o);return this.selection.checkboxClick(c),s?.firstElementChild.classList.contains("k-checked")!==this.selection.isRowSelected(c.dataItem)&&o.preventDefault(),!0}}rowItem(t){let n=t.getAttribute("data-treelist-view-index");return n=n?parseInt(n,10):-1,this.view.at(n)}static \u0275fac=function(n){return new(n||i)(e.rXU(Qr),e.rXU(Ot),e.rXU(H.Pi),e.rXU(e.SKi),e.rXU(e.sFG),e.rXU(e.aKT),e.rXU(na),e.rXU(In),e.rXU(Un),e.rXU(oa),e.rXU(Rn))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListTableBody",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-table-tbody",o.hostClass)},inputs:{columns:"columns",allColumns:"allColumns",noRecordsTemplate:"noRecordsTemplate",view:"view",skip:"skip",filterable:"filterable",noRecordsText:"noRecordsText",isLocked:"isLocked",lockedColumnsCount:"lockedColumnsCount",totalColumnsCount:"totalColumnsCount",virtualColumns:"virtualColumns",expandIcons:"expandIcons",trackBy:"trackBy",totalColumns:"totalColumns",rowClass:"rowClass"},standalone:!0,features:[e.OA$,e.aNF],attrs:xe,decls:2,vars:3,consts:[["class","k-grid-norecords",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[1,"k-grid-norecords"],[1,"k-table-td"],[3,"ngTemplateOutlet",4,"ngIf"],[4,"ngIf"],[3,"ngTemplateOutlet"],["kendoTreeListLogicalRow","",3,"dataRowIndex","dataItem","logicalRowIndex","logicalSlaveRow","logicalCellsCount","logicalSlaveCellsCount","totalColumns","isNew","ngClass","class","k-grid-edit-row","k-grid-add-row","k-selected",4,"ngIf"],["role","row","class","k-footer","kendoTreeListLogicalRow","",3,"logicalRowIndex","logicalSlaveRow","logicalCellsCount","logicalSlaveCellsCount","totalColumns",4,"ngIf"],["kendoTreeListLogicalRow","",3,"dataRowIndex","dataItem","logicalRowIndex","logicalSlaveRow","logicalCellsCount","logicalSlaveCellsCount","totalColumns","isNew","ngClass"],["kendoTreeListCell","","kendoTreeListLogicalCell","","class","k-table-td",3,"columnIndex","column","viewItem","dataItem","level","hasChildren","isExpanded","rowIndex","loading","isNew","selected","expandIcons","logicalRowIndex","logicalColIndex","dataRowIndex","colIndex","colSpan","expandable","ngClass","k-grid-edit-cell","k-selected","ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],["kendoTreeListCell","","kendoTreeListLogicalCell","",1,"k-table-td",3,"columnIndex","column","viewItem","dataItem","level","hasChildren","isExpanded","rowIndex","loading","isNew","selected","expandIcons","logicalRowIndex","logicalColIndex","dataRowIndex","colIndex","colSpan","expandable","ngClass","ngStyle"],["role","row","kendoTreeListLogicalRow","",1,"k-footer",3,"logicalRowIndex","logicalSlaveRow","logicalCellsCount","logicalSlaveCellsCount","totalColumns"],["kendoTreeListLogicalCell","","class","k-table-td",3,"logicalRowIndex","logicalColIndex","column","colIndex","
1ngClass","ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],["kendoTreeListLogicalCell","",1,"k-table-td",3,"logicalRowIndex","logicalColIndex","column","colIndex","ngClass","ngStyle"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["name","none","innerCssClass","k-treelist-toggle",3,"svgIcon",4,"ngFor","ngForOf"],["name","none","innerCssClass","k-treelist-toggle",3,"svgIcon"]],template:function(n,o){1&n&&e.DNE(0,bn,4,3,"tr",0)(1,p_,3,2,"ng-container",1),2&n&&(e.Y8G("ngIf",!o.hasData),e.R7$(),e.Y8G("ngForOf",null==o.view?null:o.view.data)("ngForTrackBy",o.trackByWrapper))},dependencies:[M.bT,M.T3,M.pM,ll,M.YU,sl,sa,M.B3,A.QK,ac],encapsulation:2})}return i})();class cc{keys=new Set;clear(){this.keys.clear()}has(a){return this.keys.has(a)}add(a){this.keys.add(a)}remove(a){this.keys.delete(a)}toArray(){const a=[];return this.keys.forEach(t=>{a.push({itemKey:t})}),a}fromArray(a){this.keys.clear(),a.forEach(t=>{this.add(t.itemKey)})}}class Pf{keys=new Map;clear(){this.keys.clear()}has(a,t){return this.keys.has(a)&&this.keys.get(a).has(t)}add(a,t){this.keys.has(a)||this.keys.set(a,new Set),this.keys.get(a).add(t)}remove(a,t){if(this.keys.has(a)){const n=this.keys.get(a);n.delete(t),n.size||this.keys.delete(a)}}toArray(){const a=[];return this.forEach((t,n)=>{a.push({itemKey:t,columnKey:n})}),a}fromArray(a){this.keys.clear(),a.forEach(t=>{this.add(t.itemKey,t.columnKey)})}updateColumKeys(a){let t=!1;return this.keys.forEach((n,o)=>{const r=[];n.forEach(s=>{a.has(s)?(r.push(a.get(s)),t=!0):r.push(s)}),this.keys.set(o,new Set(r))}),t}forEach(a){this.keys.forEach((t,n)=>{t.forEach(o=>{a(n,o)})})}}const pc=i=>"cell"===i.mode?new Pf:new cc;let Lf=(()=>{class i{draggable;selection;changeDetector;get userSelection(){return this.selection.enableMarquee?"none":null}pressArgs;marqueeElement;pressTarget;currentTarget;selectionSelected;state;subscriptions;selectionStarted=!1;constructor(t,n,o){this.draggable=t,this.selection=n,this.changeDetector=o,this.cellSelected=this.cellSelected.bind(this),this.rowSelected=this.rowSelected.bind(this)}ngOnInit(){this.subscriptions=this.draggable.kendoPress.subscribe(this.start.bind(this)),this.subscriptions.add(this.draggable.kendoDrag.subscribe(this.moveMarquee.bind(this))),this.subscriptions.add(this.draggable.kendoRelease.subscribe(this.endSelection.bind(this)))}ngOnDestroy(){this.subscriptions.unsubscribe(),this.clean()}cellSelected(t,n){return this.state.has(t,n)}rowSelected(t){return this.state.has(t)}start(t){const n=this.targetArgs(t,!0);n&&(this.pressTarget=n,this.pressArgs=t)}moveMarquee(t){const n=this.pressArgs;if(!this.selectionStarted&&n){if(!(Math.sqrt((t.pageX-n.pageX)**2+(t.pageY-n.pageY)**2)>5))return;this.selectionStarted=!0}if(this.pressTarget&&!this.state&&this.initMarquee(),this.marqueeElement){const o=this.marqueeElement,r=Math.min(t.pageX,n.pageX),s=Math.min(t.pageY,n.pageY),c=Math.abs(t.pageX-n.pageX),u=Math.abs(t.pageY-n.pageY);o.style.left=`${r}px`,o.style.top=`${s}px`,o.style.width=`${c}px`,o.style.height=`${u}px`}else if(this.state){const o=this.targetArgs(t);o&&(!this.currentTarget||this.currentTarget.item.data!==o.item.data||"cell"===this.selection.settings.mode&&this.currentTarget.column!==o.column)&&(this.currentTarget=o,this.state.fromArray(this.selection.rangeItems(this.pressTarget,o).map(r=>({itemKey:r.dataItem,columnKey:r.column}))),this.selection.updateSelectedState(),this.changeDetector.detectChanges())}}endSelection(t){if(this.state)if(this.pressArgs.pageX!==t.pageX||this.pressArgs.pageY!==t.pageY){const n=this.pressTarget,o=this.targetArgs(t);this.clean(),n&&o?(this.selection.dragging=!0,this.selection.selectRange(n,o)):this.changeDetector.detectChanges()}else this.clean(),this.changeDetector.detectChanges()}clean(){this.marqueeElement&&(document.body.removeChild(this.marqueeElement),this.marqueeElement=null),this.selectionSelected&&("cell"===this.selection.settings.mode?this.selection.isCellSelected=this.selectionSelected:this.selection.isRowSelected=this.selectionSelected,this.selectionSelected=null),this.state&&(this.state.clear(),this.state=null),this.pressTarget=null,this.pressArgs=null,this.selectionStarted=!1,this.selection.dragging=!1}targetArgs(t,n){let o=t.originalEvent.target;return this.marqueeElement&&(this.marqueeElement.style.display="none",o=(({clientX:i,clientY:a})=>document&&document.elementFromPoint(i,a))(t),this.marqueeElement.style.display="block"),this.selection.targetArgs(o,n)}initMarquee(){this.state=pc(this.selection.settings),"cell"===this.selection.settings.mode?(this.selectionSelected=this.selection.isCellSelected,this.selection.isCellSelected=this.cellSelected):(this.selectionSelected=this.selection.isRowSelected,this.selection.isRowSelected=this.rowSelected),this.changeDetector.detectChanges();const t=this.selection.settings.drag;t&&t.snap||(this.marqueeElement=(()=>
1{if(!(0,v.nm)())return;const i=document.createElement("div");i.className="k-marquee";const a=document.createElement("div");return a.className="k-marquee-color",i.appendChild(a),i})(),document.body.appendChild(this.marqueeElement))}static \u0275fac=function(n){return new(n||i)(e.rXU(v.T5),e.rXU(Rn),e.rXU(e.gRc))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListSelectionMarquee",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.xc7("user-select",o.userSelection)},standalone:!0})}return i})();class Bf{total;rowHeight;constructor(a=0,t){this.total=a,this.rowHeight=t,this.rowHeight=t||0}index(a){if(!(a<0))return Math.min(Math.floor(a/this.rowHeight),this.total-1)}offset(a){if(0<=a&&a<this.total)return a*this.rowHeight}totalHeight(){return this.total*this.rowHeight}}class la{offset;constructor(a){this.offset=a}}class dl{skip;take;constructor(a,t){this.skip=a,this.take=t}}class uc{}class Vf{scrollObservable;firstLoaded=0;lastLoaded;lastScrollTop=0;take;total;rowHeightService;scrollSubscription;subscription;constructor(a){this.scrollObservable=a}create(a,t,n,o,r=0){this.rowHeightService=a,this.firstLoaded=t,this.lastLoaded=t+n,this.take=n,this.total=o,this.lastScrollTop=r;const s=new gt.t(new la(this.rowHeightService.offset(t)));return this.subscription=on.c.create(c=>{this.unsubscribe(),this.scrollSubscription=this.scrollObservable.subscribe(u=>this.onScroll(u,c))}).subscribe(c=>s.next(c)),s}destroy(){this.unsubscribe(),this.subscription&&this.subscription.unsubscribe()}onScroll({scrollTop:a,offsetHeight:t,scrollHeight:n,clientHeight:o},r){if(this.lastScrollTop===a)return;const s=this.lastScrollTop>=a;this.lastScrollTop=a;let c=this.rowHeightService.index(a),u=this.rowHeightService.offset(c);const g=this.rowHeightService.index(a+t);if(!s)if(g>=this.lastLoaded&&this.lastLoaded<this.total){const b=c+this.take-this.total;b>0&&(c-=b,u=this.rowHeightService.offset(c)),this.firstLoaded=c,r.next(new la(u));let k=this.firstLoaded+this.take;this.lastLoaded=Math.min(k,this.total),k=k>this.total?this.total-this.firstLoaded:this.take,r.next(new dl(this.firstLoaded,this.take))}else n-o-a<1&&r.next(new uc);if(s&&c<this.firstLoaded){const b=Math.floor(.3*this.take);this.firstLoaded=Math.max(c-b,0),r.next(new la(this.rowHeightService.offset(this.firstLoaded))),this.lastLoaded=Math.min(this.firstLoaded+this.take,this.total),r.next(new dl(this.firstLoaded,this.take))}}unsubscribe(){this.scrollSubscription&&(this.scrollSubscription.unsubscribe(),this.scrollSubscription=void 0)}}let cl=(()=>{class i{el;renderer;resizeService;ctx;_lockedWidth;set lockedWidth(t){this._lockedWidth=t,this.enabled&&(this.attachResize(),this.resize())}set kendoTreeListResizableContainer(t){const n=t!==this.enabled;this.enabled=t,n&&(this.attachResize(),this.resize())}enabled=!1;resizeSubscription;constructor(t,n,o,r){this.el=t,this.renderer=n,this.resizeService=o,this.ctx=r}ngOnDestroy(){this.resizeSubscription&&this.resizeSubscription.unsubscribe()}attachResize(){this.resizeSubscription&&!this.enabled&&(this.resizeSubscription.unsubscribe(),this.resizeSubscription=null),!this.resizeSubscription&&this.enabled&&(this.resizeSubscription=this.resizeService.changes.subscribe(this.resize.bind(this)))}resize(){if(this.ctx.treelist&&this.ctx.treelist.wrapper){const n=Math.max(this.ctx.treelist.wrapper.nativeElement.clientWidth-this._lockedWidth,0);this.renderer.setStyle(this.el.nativeElement,"width",this.enabled&&n>0?n+"px":"")}}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(Ys),e.rXU(fo))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListResizableContainer",""]],inputs:{lockedWidth:"lockedWidth",kendoTreeListResizableContainer:"kendoTreeListResizableContainer"},standalone:!0})}return i})(),pl=(()=>{class i{columns=[];get columnsToRender(){return Bn(this.columns)}trackBy(t,n){return t}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListColGroup",""]],inputs:{columns:"columns"},standalone:!0,features:[e.aNF],attrs:u_,decls:1,vars:2,consts:[[3,"width",4,"ngFor","ngForOf","ngForTrackBy"]],template:function(n,o){1&n&&e.DNE(0,__,1,2,"col",0),2&n&&e.Y8G("ngForOf",o.columnsToRender)("ngForTrackBy",o.trackBy)},dependencies:[M.pM],encapsulation:2})}return i})();const $f=({columns:i})=>Math.max(1,(i=>i.filter(a=>Dt(a.resizable)&&a.isVisible))(i).length),_c=(i,a="td")=>t=>t.querySelectorAll(`${a}
1:not(.k-group-cell):not(.k-hierarchy-cell)`)[i],ul=i=>i.offsetWidth,mc=(...i)=>a=>i.reduce((t,n)=>t?n(t):0,a);let gc=(()=>{class i{element;renderer;service;zone;cdr;locked=!1;virtualColumns;get minWidth(){return this.firstResize?0:null}originalWidth;firstResize=!1;subscription;autoFitSubscription;constructor(t,n,o,r,s){this.element=t,this.renderer=n,this.service=o,this.zone=r,this.cdr=s}ngOnInit(){const t=this.service.changes.pipe((0,ae.p)(n=>this.locked===n.locked));this.subscription=t.pipe((0,ae.p)(n=>"start"===n.type),(0,Te.M)(this.initState.bind(this)),(0,Me.T)($f),(0,Oe.n)(n=>t.pipe((0,ae.p)(o=>"resizeTable"===o.type),(0,Me.T)(o=>o.delta),(0,Lt.S)(n)))).subscribe(this.resize.bind(this)),this.autoFitSubscription=this.service.registerTable({autoFit:this.autoFitObservable.bind(this),locked:this.locked})}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),this.autoFitSubscription&&(this.autoFitSubscription(),this.autoFitSubscription=null)}initState(){this.firstResize=!0,(!this.virtualColumns||this.locked)&&(this.originalWidth=ul(this.element.nativeElement))}resize(t){if(!this.virtualColumns||this.locked){const n=t.reduce((r,s)=>r+s,0);this.renderer.setStyle(this.element.nativeElement,"width",this.originalWidth+n+"px")}this.cdr.detectChanges()}autoFitObservable(t){return on.c.create(n=>{this.zone.runOutsideAngular(()=>{this.renderer.addClass(this.element.nativeElement,"k-autofitting"),this.cdr.detectChanges();const o=t.map(this.measureColumn.bind(this));this.renderer.removeClass(this.element.nativeElement,"k-autofitting"),n.next(o)})})}measureColumn(t){const n=this.element.nativeElement,o=mc((i=>a=>a.querySelectorAll("thead>tr")[i])(t.level),_c(t.headerIndex,"th"),ul)(n);let r=0;return(!t.isParentSpan||t.isParentSpan&&t.isLastInSpan)&&(r=mc(a=>a.querySelector("tbody>tr:not(.k-grouping-row):not(.k-grid-norecords)"),_c(t.index),ul)(n)),Math.max(o,r)}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(Ti),e.rXU(e.SKi),e.rXU(e.gRc))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListResizableTable",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.xc7("min-width",o.minWidth)},inputs:{locked:"locked",virtualColumns:"virtualColumns"},standalone:!0})}return i})();const hc=(i,a,t)=>{for(let n=0,o=0;n<a.length;n++){const r=t(a[n]);if(o<=i&&i<=o+r-1)return a[n];o+=r}},fc=(i,a)=>hc(i,a,t=>t.hasAttribute("data-treelist-view-index")?1:0),Cc={},vc=new e.nKC("treelist-scroll-service-factory");function Xf(i){return new Vf(i)}const bc=i=>{const a=i.wheelDeltaY;return i.wheelDelta&&(void 0===a||a)?i.wheelDelta:i.detail&&i.axis===i.VERTICAL_AXIS?10*-i.detail:0},_l=i=>i?i.nativeElement:null;let qf=(()=>{class i{changeNotification;suspendService;ngZone;renderer;scrollSyncService;resizeService;editService;supportService;navigationService;localization;columnResizingService;changeDetector;pdfService;columnInfo;get hostClass(){return!0}get hostRole(){return"presentation"}view;total;rowHeight;take;skip=0;columns=new Vs(()=>[]);noRecordsTemplate;filterable;rowClass;loading;trackBy=nl;virtualColumns;isVirtual;expandIcons;contentScroll=new e.bkB;pageChange=new e.bkB;scrollBottom=new e.bkB;totalHeight;columnsStartIdx=0;get totalWidth(){if(this.virtualColumns&&this.columns.unlockedWidth)return this.columns.unlockedWidth}container;table;lockedContainer;lockedTable;resizeSensors=new e.rOR;scroller;subscriptions=new K.y;scrollerSubscription;dispatcher=new ue.B7;rowHeightService;skipScroll;rebind;containerScrollTop=0;viewportColumns;columnsEndIdx;viewportColumnsWidth;scrollLeft=0;get lockedLeafColumns(){return this.columns.lockedLeafColumns}get nonLockedLeafColumns(){return this.columns.nonLockedLeafColumns}get nonLockedColumnsToRender(){return this.virtualColumns&&!this.pdfService.exporting?this.viewportColumns:this.nonLockedLeafColumns}get leafColumns(){return this.columns.leafColumnsToRender}get lockedWidth(){return Sn(this.lockedLeafColumns.toArray()).reduce((t,n)=>t+(n.width||0),0)}get nonLockedWidth(){if(!this.rtl&&this.lockedLeafColumns.length||this.virtualColumns)return th(Sn(this.nonLockedColumnsToRender.toArray()))}get isLocked(){return this.lockedLeafColumns.length>0}rtl=!1;columnUpdateFrame;hasLockedContainer;constructor(t,n,o,r,s,c,u,g,b,k,D,V,U,B,De,et){this.changeNotification=n,this.suspendService=o,this.ngZone=r,this.renderer=s,this.scrollSyncService=c,this.resizeService=u,this.editService=g,this.supportService=b,this.navigationService=k,this.localization=V,this.columnResizingService=U,this.changeDetector=B,this.pdfService=De,this.columnInfo=et,this.scroller=t(this.dispatcher),this.subscriptions=D.requests.subscribe(Ht=>this.scrollTo(Ht))}ngOnInit(){this.init(),this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowSync.bind(this))),this.subscriptions.add(this.ngZone.runOutsideAngular(this.handleRowNavigationLocked.bind(this))),this.subscriptions.add((0,we.h)(this.columns.changes,this.resizeService.changes).subscribe(()=>{this.virtualColumns&&this.ngZone.run(()=>{this.updateViewportColumns(),this.changeDetector.markForCheck()})})),this.subscriptions.add(this.localization.changes.subscribe(({rtl:t})=>this.rtl=t))}ngOnChanges(t){(0,v.Hq)("skip",t)&&!this.rebind&&(this.skipScroll=!0,this.container.nativeElement.scrollTop=this.rowHeightService.offset(this.skip)),(0,v.TI)(["total","take"],t)&&this.init(),this.rebind=!1}ngDoCheck(){this.virtualColumns&&(!this.viewportColumns||this.viewportWidthChange())&&this.updateViewportColumns()}ngAfterViewInit(){this.skip&&this.isVirtual&&(this.container.nativeElement.scrollTop=this.rowHeightService.offset(this.skip)),this.resetNavigationViewport(),this.attachContainerScroll(),this.initResizeService()}ngAfterViewChecked(){const t=this.isLocked;t&&!this.hasLockedContainer&&this.syncRowsHeight(),this.hasLockedContainer=t}syncRowsHeight(){this.lockedContainer&&Ad(this.lockedTable.nativeElement,this.table.nativeElement)}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe(),this.resizeService&&this.resizeService.destroy(),this.cleanupScroller()}init(){this.suspendService.scroll||(this.rowHeightService=new Bf(this.total,this.rowHeight),this.totalHeight=this.rowHeightService.totalHeight(),fi()||this.ngZone.runOutsideAngular(this.createScroller.bind(this)))}lockedScroll(){if(!this.suspendService.scroll){const t=this.lockedContainer.nativeElement.scrollTop;t!==this.containerScrollTop&&(this.container.nativeElement.scrollTop=this.containerScrollTop=t)}}lockedMousewheel(t){if(!t.ctrlKey){((i,a)=>{const t=bc(i),n=a.scrollTop;0===n&&0<t||a.scrollHeight<=a.offsetHeight+n&&t<0||event.preventDefault()})(t,this.container.nativeElement);const n=bc(t);this.container.nativeElement.scrollTop-=n}}lockedKeydown(t){if(t.keyCode===v.D$.PageDown||t.keyCode===v.D$.PageUp){const o=this.container.nativeElement;o.scrollTop+=o.offsetHeight*(t.keyCode===v.D$.PageDown?1:-1)*.8,t.preventDefault()}}attachContainerScroll(){fi()||(this.ngZone.runOutsideAngular(()=>{this.subscriptions.add((0,Ne.R)(this.container.nativeElement,"scroll").pipe((0,Me.T)(t=>t.target),(0,ae.p)(()=>!this.suspendService.scroll),(0,Te.M)(t=>{this.onContainerScroll(t),this.resetNavigationViewport(),this.virtualColumns&&this.handleColumnScroll();const n=this.navigationService.viewport||Cc,o=this.navigationService.columnViewport||Cc;this.contentScroll.emit({scrollLeft:t.scrollLeft,scrollTop:t.scrollTop,startRow:n.firstItemIndex,endRow:n.lastItemIndex,startColumn:o.firstItemIndex,endColumn:o.lastItemIndex})})).subscribe(this.dispatcher))}),this.scrollSyncService.registerEmitter(this.container.nativeElement,"body"))}createScroller(){this.cleanupScroller();const t=this.scroller.create(this.rowHeightService,this.skip,this.take,this.total,this.containerScrollTop);this.skipScroll=!1,this.scrollerSubscription=t.pipe((0,ae.p)(n=>n instanceof dl),(0,ae.p)(()=>{const n=this.skipScroll;return this.skipScroll=!1,!n}
1),(0,Te.M)(()=>this.rebind=!0)).subscribe(n=>this.ngZone.run(()=>this.pageChange.emit(n))),this.scrollerSubscription.add(t.pipe((0,ae.p)(n=>n instanceof la)).subscribe(this.scroll.bind(this))),this.scrollerSubscription.add(t.pipe((0,ae.p)(n=>n instanceof uc)).subscribe(()=>this.scrollBottom.emit()))}scroll({offset:t=0}){this.isVirtual&&[_l(this.table),_l(this.lockedTable)].filter(pe).forEach(((i,a)=>t=>i.setStyle(t,"transform",`translateY(${a}px)`))(this.renderer,t)),this.resetNavigationViewport()}onContainerScroll({scrollTop:t}){this.containerScrollTop=t,this.lockedContainer&&(this.lockedContainer.nativeElement.scrollTop=t)}handleRowSync(){return(0,we.h)(this.changeNotification.changes,this.editService.changed,this.resizeService.changes,this.columnResizingService.changes.pipe((0,ae.p)(n=>"end"===n.type)),this.supportService.changes).pipe((0,Te.M)(()=>this.resetNavigationViewport()),(0,ae.p)(()=>pe(this.lockedContainer))).subscribe(()=>{const n=this.container.nativeElement.scrollTop,o=this.container.nativeElement.scrollLeft;this.syncRowsHeight(),this.syncContainerHeight(),this.lockedContainer.nativeElement.scrollTop=this.container.nativeElement.scrollTop=n,this.container.nativeElement.scrollLeft=o,this.resizeSensors.forEach(r=>r.acceptSize())})}handleRowNavigationLocked(){return this.navigationService.changes.pipe((0,ae.p)(()=>pe(this.lockedContainer)),(0,wt.c)(10)).subscribe(t=>{if(this.lockedLeafColumns.length<=t.prevColIndex&&t.colIndex<this.lockedLeafColumns.length){const n=this.navigationService.activeCell;n&&n.colIndex+n.colSpan<t.prevColIndex&&(this.container.nativeElement.scrollLeft=0)}})}scrollToVirtualRow(t){const n=this.rowHeightService.offset(t);this.container.nativeElement.scrollTop=n,this.resetNavigationViewport()}scrollTo({row:t,column:n}){if(bd(t))if(this.isVirtual)this.scrollToVirtualRow(t);else{const o=fc(t,this.table.nativeElement.rows);o&&(this.container.nativeElement.scrollTop=o.offsetTop)}if(bd(n))if(n-=this.lockedLeafColumns.length,this.virtualColumns){const o=this.columns.leafColumnsToRender;let r=0;for(let s=0;s<n;s++)r+=o[s].width||0;this.container.nativeElement.scrollLeft=this.normalizeScrollLeft(r)}else{const o=fc(0,this.table.nativeElement.rows);if(o){const r=((i,a)=>hc(i,a,t=>kn(t,oc)?0:parseInt(t.getAttribute("colSpan"),10)||1))(n,o.cells);r&&(this.container.nativeElement.scrollLeft=this.elementScrollLeft(r))}}}resetNavigationViewport(){if(!this.container||!this.navigationService.needsViewport()||0===this.view.length)return;const{scrollTop:t,offsetHeight:n}=this.container.nativeElement,o=t+n,r=this.rowHeightService.index(t);let s=this.rowHeightService.index(o);const u=this.rowHeightService.offset(s)+this.rowHeight>o;s>0&&u&&s--,this.navigationService.setViewport(r,s)}cleanupScroller(){this.scrollerSubscription&&this.scrollerSubscription.unsubscribe(),this.scroller&&this.scroller.destroy()}initResizeService(){this.resizeService.connect((0,we.h)(...this.resizeSensors.map(t=>t.resize)))}syncContainerHeight(){[_l(this.lockedContainer)].filter(pe).map(t=>{t.style.height="";let n=this.container.nativeElement.offsetHeight;return(()=>this.table.nativeElement.offsetWidth>this.container.nativeElement.clientWidth)()&&(n-=this.supportService.scrollbarWidth),{el:t,height:n}}).forEach((i=>({el:a,height:t})=>i.setStyle(a,"height",`${t}px`))(this.renderer))}updateViewportColumns(t){const n=this.columns.nonLockedLeafColumns.toArray();let{startIdx:o,endIdx:r,offset:s}=t||this.calculateViewportColumns();const c=Math.max(0,o-1),u=Math.min(r+1,n.length-1);if(c<o)for(let b=o-1;b>=c;b--)s-=n[b].width;const g=n.slice(c,u+1);if(this.viewportColumnsWidth=g.reduce((b,k)=>b+k.width,0),c>0){const b=new Ge;b.width=s,g.unshift(b)}this.viewportColumns=new e.rOR,this.viewportColumns.reset(g),this.columnsStartIdx=c,this.columnsEndIdx=u,this.columnInfo.columnRangeChange.emit({start:c,end:u,offset:s}),t||this.updateColumnViewport(o,r)}handleColumnScroll(){const n=this.container.nativeElement.scrollLeft;if(this.scrollLeft!==n){this.scrollLeft=n;const o=this.calculateViewportColumns();this.updateColumnViewport(o.startIdx,o.endIdx),(o.startIdx<this.columnsStartIdx||this.columnsEndIdx<o.endIdx)&&(eh(this.columnUpdateFrame),this.columnUpdateFrame=Zg(()=>{this.ngZone.run(()=>{this.updateViewportColumns(o),this.changeDetector.markForCheck()})}))}}updateColumnViewport(t,n){const o=this.lockedLeafColumns.length,r=this.nonLockedLeafColumns.toArray(),s=o+t;
1let c=o+n;for(let u=0;u<r.length;u++){const g=r[u];g.isSpanColumn&&(c+=g.childColumns.length)}this.navigationService.setColumnViewport(s,c)}calculateViewportColumns(){const{scrollLeft:t,clientWidth:n}=this.container.nativeElement,o=this.columns.nonLockedLeafColumns.toArray(),r=this.normalizeScrollLeft(t),s=r+n;let c,k,u=0,g=0,b=0;for(k=0;k<o.length;k++){const D=o[k];if(g+=D.width||0,void 0===c&&g>r&&(c=k,b=g-(D.width||0)),g>=s){u=k;break}}return!u&&k>0&&(u=o.length-1),{startIdx:c,endIdx:u,offset:b}}viewportWidthChange(){return this.viewportColumns.toArray().reduce((n,o)=>n+o.width,0)!==this.viewportColumnsWidth}normalizeScrollLeft(t){return this.rtl?function Dh(i,a,t){let n=i;return t<0?n=-i:t>0&&(n=a.scrollWidth-a.offsetWidth-i),n}(t,this.container.nativeElement,this.supportService.rtlScrollLeft):t}elementScrollLeft(t){return this.rtl?this.normalizeScrollLeft(this.container.nativeElement.scrollWidth-t.offsetLeft-t.offsetWidth):t.offsetLeft}static \u0275fac=function(n){return new(n||i)(e.rXU(vc),e.rXU(Qr),e.rXU($s),e.rXU(e.SKi),e.rXU(e.sFG),e.rXU(ta),e.rXU(Ys),e.rXU(Ot),e.rXU(Ls),e.rXU(Un),e.rXU(ra),e.rXU(H.Pi),e.rXU(Ti),e.rXU(e.gRc),e.rXU(vi),e.rXU(In))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-list"]],viewQuery:function(n,o){if(1&n&&(e.GBs(m_,7),e.GBs(g_,7),e.GBs(h_,5),e.GBs(f_,5),e.GBs(v.M0,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.container=r.first),e.mGM(r=e.lsd())&&(o.table=r.first),e.mGM(r=e.lsd())&&(o.lockedContainer=r.first),e.mGM(r=e.lsd())&&(o.lockedTable=r.first),e.mGM(r=e.lsd())&&(o.resizeSensors=r)}},hostVars:3,hostBindings:function(n,o){2&n&&(e.BMQ("role",o.hostRole),e.AVh("k-grid-container",o.hostClass))},inputs:{view:"view",total:"total",rowHeight:"rowHeight",take:"take",skip:"skip",columns:"columns",noRecordsTemplate:"noRecordsTemplate",filterable:"filterable",rowClass:"rowClass",loading:"loading",trackBy:"trackBy",virtualColumns:"virtualColumns",isVirtual:"isVirtual",expandIcons:"expandIcons"},outputs:{contentScroll:"contentScroll",pageChange:"pageChange",scrollBottom:"scrollBottom"},standalone:!0,features:[e.Jv_([{provide:vc,useValue:Xf}]),e.OA$,e.aNF],decls:14,vars:26,consts:[["container",""],["table",""],["lockedContainer",""],["lockedTable",""],["class","k-grid-content-locked","role","presentation",3,"width","kendoEventsOutsideAngular","scope",4,"ngIf"],[1,"k-grid-content","k-virtual-content",3,"kendoTreeListResizableContainer","lockedWidth"],["role","presentation"],["kendoTreeListResizableTable","","role","presentation",1,"k-table","k-grid-table","k-table-md",3,"virtualColumns"],["kendoTreeListColGroup","",3,"columns"],["kendoTreeListTableBody","","role","rowgroup",3,"view","columns","allColumns","noRecordsTemplate","lockedColumnsCount","totalColumnsCount","totalColumns","skip","trackBy","filterable","rowClass","virtualColumns","expandIcons"],[4,"ngIf"],["role","presentation",1,"k-height-container"],["class","k-width-container","role","presentation",4,"ngIf"],["kendoTreeListLoading","",4,"ngIf"],["role","presentation",1,"k-grid-content-locked",3,"kendoEventsOutsideAngular","scope"],["kendoTreeListResizableTable","","role","presentation",1,"k-table","k-grid-table","k-table-md",3,"locked"],["kendoTreeListTableBody","","role","presentation",3,"isLocked","view","noRecordsText","columns","totalColumnsCount","totalColumns","skip","trackBy","filterable","rowClass","expandIcons"],["role","presentation",1,"k-width-container"],["kendoTreeListLoading",""]],template:function(n,o){1&n&&(e.DNE(0,v_,10,26,"div",4),e.j41(1,"div",5,0)(3,"div",6)(4,"table",7,1),e.nrm(6,"colgroup",8)(7,"tbody",9),e.k0s(),e.DNE(8,b_,1,0,"kendo-resize-sensor",10),e.k0s(),e.DNE(9,T_,1,0,"kendo-resize-sensor",10),e.j41(10,"div",11),e.nrm(11,"div"),e.k0s(),e.DNE(12,E_,2,2,"div",12),e.k0s(),e.DNE(13,S_,1,0,"div",13)),2&n&&(e.Y8G("ngIf",o.isLocked),e.R7$(),e.Y8G("kendoTreeListResizableContainer",o.lockedLeafColumns.length>0)("lockedWidth",o.lockedWidth+1),e.R7$(3),e.xc7("width",o.nonLockedWidth,"px"),e.Y8G("virtualColumns",o.virtualColumns),e.R7$(2),e.Y8G("columns",o.nonLockedColumnsToRender),e.R7$(),e.Y8G("view",o.view)("columns",o.nonLockedColumnsToRender)("allColumns",o.nonLockedLeafColumns)("noRecordsTemplate",o.noRecordsTemplate)("lockedColumnsCount",o.lockedLeafColumns.length)("totalColumnsCount",o.leafColumns.length)("totalColumns",o.columns)("skip",o.skip)("trackBy",o.trackBy)("filterable",o.filterable)("rowClass",o.rowClass)("virtualColumns",o.virtualColumns)("expandIcons",o.expandIcons),e.R7$(),e.Y8G("ngIf",o.isLocked),e.R7$(),e.Y8G("ngIf",o.isLocked||o.virtualColumns),e.R7$(2),e.xc7("height",o.totalHeight,"px"),e.R7$(),e.Y8G("ngIf",o.virtualColumns),e.R7$(),e.Y8G("ngIf",o.loading))},dependencies:[M.bT,v.Uj,gc,pl,dc,v.M0,cl,al],encapsulation:2})}return i})();const Qf={allowUnsort:!0,mode:"single",showIndexes:!0,initialDirection:"asc"},ml=(...i)=>Object.assign({},Qf,...i);let Ec=(()=>{class i{element;service;context={};enter=new e.bkB;
1leave=new e.bkB;drop=new e.bkB;subscriptions=new K.y;constructor(t,n){this.element=t,this.service=n}ngOnInit(){this.service.add(this);const t=this.service.changes.pipe((0,ae.p)(({target:n})=>n===this));this.subscriptions.add(t.pipe((0,ae.p)(({type:n})=>"leave"===n)).subscribe(n=>{this.leave.next(this.eventArgs(n))})),this.subscriptions.add(t.pipe((0,ae.p)(({type:n})=>"enter"===n)).subscribe(n=>{this.enter.next(this.eventArgs(n))})),this.subscriptions.add(t.pipe((0,ae.p)(({type:n})=>"drop"===n)).subscribe(n=>{this.drop.next(this.eventArgs(n))}))}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe()}eventArgs(t){return{target:this,mouseEvent:t.mouseEvent,draggable:t.draggable}}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(Js))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoDropTarget",""]],inputs:{context:"context"},outputs:{enter:"enter",leave:"leave",drop:"drop"},standalone:!0})}return i})();const Yn=i=>a=>new RegExp(`(^| )${i}( |$)`).test(a.className),eC=Td(Yn("k-i-x"),Yn("k-svg-i-x"),Yn("k-icon-button")),tC=Td(Yn("k-i-sort-asc-small"),Yn("k-i-sort-desc-small"),Yn("k-svg-i-sort-asc-small"),Yn("k-svg-i-sort-desc-small")),nC=Ed(so(eC),so(tC),so(bi),so(qe("label"))),Sc=({clientX:i,clientY:a})=>document.elementFromPoint(i,a);let oC=(()=>{class i{draggable;element;zone;service;hint;cue;nav;renderer;context={};set enableDrag(t){this.enabled=t,this.updateTouchAction()}drag=new e.bkB;get hostClass(){return this.enabled}subscriptions=new K.y;enabled;constructor(t,n,o,r,s,c,u,g){this.draggable=t,this.element=n,this.zone=o,this.service=r,this.hint=s,this.cue=c,this.nav=u,this.renderer=g}ngOnInit(){this.subscriptions.add(this.zone.runOutsideAngular(()=>this.draggable.kendoPress.pipe((0,ae.p)(t=>this.enabled),(0,ae.p)(({originalEvent:{target:t}})=>t===this.element.nativeElement||nC(t)),(0,Te.M)(t=>{const n=t.originalEvent;t.isTouch||n.preventDefault(),this.nav.navigateTo(n.target)}),(0,Oe.n)((i=>a=>(0,le.of)(a).pipe((0,wt.c)(150),(0,L.Q)(i)))(this.draggable.kendoRelease)),(0,Te.M)(()=>{this.hint.create(this.context.hint),this.cue.create()}),(0,Oe.n)(t=>this.draggable.kendoDrag.pipe((0,Te.M)(n=>{n.isTouch&&n.originalEvent.preventDefault()}),(0,Te.M)(this.hint.attach()),(0,Te.M)(this.cue.attach()),(0,L.Q)(this.draggable.kendoRelease),(0,Me.T)(n=>({move:n,down:t})))),(0,Te.M)(this.performDrag.bind(this)),(0,mi.K)(this.draggable.kendoRelease)).subscribe(this.drop.bind(this))))}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe()}drop(t){this.hint.remove(),this.cue.remove(),this.service.notifyDrop(this,t)}performDrag({move:t}){this.hint.move(t);const n=this.elementUnderCursor(t);n&&this.service.notifyDrag(this,n,t),this.drag.emit({draggable:this,mouseEvent:t})}elementUnderCursor(t){this.hint.hide();let n=Sc(t);return n&&/k-grouping-dropclue/.test(n.className)&&(n=((i,a)=>{i.style.display="none";const t=a();return i.style.display="block",t})(n,Sc.bind(this,t))),this.hint.show(),n}updateTouchAction(){this.element&&this.renderer.setStyle(this.element.nativeElement,"touch-action",this.enabled?"none":"")}static \u0275fac=function(n){return new(n||i)(e.rXU(v.T5,1),e.rXU(e.aKT),e.rXU(e.SKi),e.rXU(Js),e.rXU(qs),e.rXU(Qs),e.rXU(Un),e.rXU(e.sFG))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoDraggableColumn",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-grid-draggable-header",o.hostClass)},inputs:{context:"context",enableDrag:"enableDrag"},outputs:{drag:"drag"},standalone:!0})}return i})();const kc=(i,a)=>!1!==i.filter&&a.field&&a.filterable,Rc=(i,a)=>!1!==i.sort&&a.field&&a.sortable,Ic=(i,a)=>i.lock&&a.lockable&&!(a.parent&&!a.parent.isSpanColumn),yc=i=>!1!==i.columnChooser,da=i=>{if(i)return(0,He.HG)(i)?{filters:da(i.filters),logic:i.logic}:Array.isArray(i)?i.map(da):(i=>(i=>{const a={};if(Object.assign(a,i),i.constructor!==Object){const t=i.constructor.prototype;Object.getOwnPropertyNames(t).forEach(n=>{"constructor"!==n&&t.hasOwnProperty(n)&&(a[n]=i[n])})}return a})(i))(i)};let wc=(()=>{class i{host;resolver;column;filter;component;constructor(t,n){this.host=t,this.resolver=n}ngOnInit(){this.component=this.host.createComponent(this.resolver.resolve
1ComponentFactory(this.componentType())),this.initComponent({column:this.column,filter:this.filter})}ngOnDestroy(){this.component&&(this.component.destroy(),this.component=null)}ngOnChanges(t){(0,v.TI)(["column","filter"],t)&&this.initComponent({column:this.column,filter:this.filter})}initComponent({column:t,filter:n}){const o=this.component.instance;o.column=t,o.filter=n}static \u0275fac=function(n){return new(n||i)(e.rXU(e.c1b),e.rXU(e.OM3))};static \u0275dir=e.FsC({type:i,inputs:{column:"column",filter:"filter"},features:[e.OA$]})}return i})();const Dc=(i={filterEqOperator:"eq",filterNotEqOperator:"neq",filterGteOperator:"gte",filterGtOperator:"gt",filterLteOperator:"lte",filterLtOperator:"lt",filterIsNullOperator:"isnull",filterIsNotNullOperator:"isnotnull",filterIsEmptyOperator:"isempty",filterIsNotEmptyOperator:"isnotempty",filterContainsOperator:"contains",filterNotContainsOperator:"doesnotcontain",filterStartsWithOperator:"startswith",filterEndsWithOperator:"endswith",filterAfterOrEqualOperator:"after-eq",filterAfterOperator:"after",filterBeforeOrEqualOperator:"before-eq",filterBeforeOperator:"before"},a=>Object.keys(i).reduce((t,n)=>(t[i[n]]=a.get(n),t),{})),ca=i=>i.map(a=>a.toJSON());var i;let be=(()=>{class i{operator;localization;get text(){return this._text}set text(t){this._text=Ve(t)?this.messages[this.operator]:t}subscription;messages;_text;constructor(t,n){this.operator=t,this.localization=n,this.messages=Dc(this.localization),this._text=this.messages[this.operator],this.subscription=this.localization.changes.subscribe(this.refreshText.bind(this))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}toJSON(){return{text:this.text,value:this.operator}}refreshText(){const t=this._text===this.messages[this.operator];this.messages=Dc(this.localization),t&&(this._text=this.messages[this.operator])}static \u0275fac=function(n){return new(n||i)(e.rXU("filterOperator"),e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,inputs:{text:"text"}})}return i})();const ki=(i,a,t,n)=>pe(a)&&pe(a.filters)&&a.filters.length>i?a.filters[i]:((i,a,t)=>((a=a||{filters:[],logic:"and"}).filters[i]=t,t))(i,a,{field:t,operator:n}),Ri=i=>[{text:i.get("filterAndLogic"),value:"and"},{text:i.get("filterOrLogic"),value:"or"}],gl=i=>pe(i.filters)?i.filters.reduce((a,t)=>a.concat((0,He.HG)(t)?gl(t):[t]),[]):[],Oc=(i,a)=>{pe(i)&&pe(i.filters)&&(i.filters=i.filters.filter(t=>(0,He.HG)(t)?(Oc(t,a),t.filters.length):t.field!==a))},Co=(i,a)=>gl(i||{}).filter(t=>t.field===a),hl=(i,a)=>(Oc(i,a),i),pa=i=>a=>Object.keys(i).map(t=>({text:a.get(t),value:i[t]}));let Ii=(()=>{class i{filterService;get hostClasses(){return!0}operatorList=new e.rOR;get operators(){return this._operators?.length?this._operators:this.defaultOperators}set operators(t){this._operators=t}filter;defaultOperators;_operators;operationListSubscription;constructor(t){this.filterService=t}ngAfterContentInit(){this.operationListSubscription=Ms(this.operatorList).pipe((0,Me.T)(t=>t.toArray()),(0,Me.T)(ca)).subscribe(t=>{this.operators=t})}ngOnDestroy(){this.operationListSubscription&&this.operationListSubscription.unsubscribe()}filterByField(t){return((i,a)=>{const[t]=Co(i,a);return t})(this.filter,t)}filtersByField(t){return Co(this.filter,t)}removeFilter(t){return hl(this.filter,t)}updateFilter(t){const n=this.filter||{filters:[],logic:"and"},[o]=gl(n).filter(r=>r.field===t.field);return pe(o)?Object.assign(o,t):n.filters.push(t),n}applyFilter(t){this.filterService.filter(t)}static \u0275fac=function(n){return new(n||i)(e.rXU(Je))};static \u0275dir=e.FsC({type:i,contentQueries:function(n,o,r){if(1&n&&e.wni(r,be,4),2&n){let s;e.mGM(s=e.lsd())&&(o.operatorList=s)}},hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-filtercell",o.hostClasses)},inputs:{operators:"operators",filter:"filter"}})}return i})();const _C=pa({filterEqOperator:"eq",filterNotEqOperator:"neq",filterContainsOperator:"contains",filterNotContainsOperator:"doesnotcontain",filterStartsWithOperator:"startswith",filterEndsWithOperator:"endswith",filterIsNullOperator:"isnull",filterIsNotNullOperator:"isnotnull",filterIsEmptyOperator:"isempty",filterIsNotEmptyOperator:"isnotempty"});let xc=(()=>{class i extends Ii{localization;column;
1operator="contains";get currentFilter(){return this.filterByField((this.column||{}).field)}get currentOperator(){return this.currentFilter?this.currentFilter.operator:this.operator}subscription;constructor(t,n){super(t),this.localization=n}ngOnInit(){this.subscription=this.localization.changes.subscribe(this.localizationChange.bind(this))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),super.ngOnDestroy()}localizationChange(){this.defaultOperators=_C(this.localization),this.operatorList.length&&(this.operators=ca(this.operatorList.toArray()))}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,inputs:{column:"column",operator:"operator"},features:[e.Vt3]})}return i})(),Jt=(()=>{class i{element;renderer;change=new e.bkB;composing=!1;kendoInput;filterDelay=500;columnLabel;column;set value(t){this.accessor.writeValue(t)}set disabled(t){this.accessor.setDisabledState(t)}accessor;changeRequests=new ue.B7;changeRequestsSubscription;unsubscribeEvents;constructor(t,n,o,r){this.element=o,this.renderer=r,this.accessor=t[0],n.runOutsideAngular(()=>{const s=r.listen(o.nativeElement,"compositionstart",()=>this.composing=!0),c=r.listen(o.nativeElement,"compositionend",()=>this.composing=!1);this.unsubscribeEvents=()=>{s(),c()}})}ngAfterViewInit(){this.addAriaAttributes(),this.accessor.registerOnChange(t=>this.filterDelay>0?this.changeRequests.next(t):this.change.emit(t)),this.subscribeChanges()}ngOnChanges(t){(0,v.Hq)("filterDelay",t)&&(this.unsubscribeChanges(),this.subscribeChanges())}ngOnDestroy(){this.unsubscribeChanges(),this.unsubscribeEvents()}subscribeChanges(){this.changeRequestsSubscription=this.changeRequests.pipe((0,no.B)(this.filterDelay),(0,ae.p)(()=>!this.composing)).subscribe(t=>this.change.emit(t))}unsubscribeChanges(){this.changeRequestsSubscription&&this.changeRequestsSubscription.unsubscribe()}addAriaAttributes(){const t=this.columnLabel;if(this.kendoInput&&this.kendoInput.focusableId&&(0,v.nm)()){const n=this.element.nativeElement.querySelector(`#${this.kendoInput.focusableId}`)||this.element.nativeElement;this.renderer.setAttribute(n,"aria-label",t)}else{const n=this.element.nativeElement.querySelector(".k-input-inner");t&&this.renderer.setAttribute(n||this.element.nativeElement,"aria-label",t)}}static \u0275fac=function(n){return new(n||i)(e.rXU(R.kq,2),e.rXU(e.SKi),e.rXU(e.aKT),e.rXU(e.sFG))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoFilterInput",""]],contentQueries:function(n,o,r){if(1&n&&e.wni(r,v.eW,7),2&n){let s;
1e.mGM(s=e.lsd())&&(o.kendoInput=s.first)}},inputs:{filterDelay:"filterDelay",columnLabel:"columnLabel",column:"column",value:"value"},standalone:!0,features:[e.OA$]})}return i})();const mC=new Set(["isnull","isnotnull","isempty","isnotempty"]),ua=i=>mC.has(i);let Mc=(()=>{class i extends Ii{column;input;get currentFilter(){return this.filterByField(this.column.field)}get currentOperator(){const t=this.currentFilter;return this._operator||(this._operator=t?t.operator:this.defaultOperator),this._operator}set currentOperator(t){this._operator=t;const n=ua(t);this.filterInputDisabled=n,n?this.applyNoValueFilter(t):!xs(t)&&pe(this.currentFilter)&&this.onChange(this.currentFilter.value)}get defaultOperator(){return Ve(this._defaultOperator)?this.operators&&this.operators.length?this.operators[0].value:"eq":this._defaultOperator}set defaultOperator(t){this._defaultOperator=t}set filterInputDisabled(t){this.input&&(this.input.disabled=t)}_defaultOperator;_operator;changeSubscription;constructor(t){super(t)}ngAfterContentInit(){pe(this.input)&&(this.changeSubscription=this.input.change.subscribe(this.onChange.bind(this)),this.filterInputDisabled=ua(this.currentOperator))}ngOnDestroy(){super.ngOnDestroy(),this.changeSubscription&&this.changeSubscription.unsubscribe()}onChange(t){(!Ve(t)||this.filterByField(this.column.field))&&this.filterChange(Ve(t)?this.removeFilter(this.column.field):this.updateFilter({field:this.column.field,operator:this.currentOperator,value:t}))}onClear(){this.onChange(null),this.filterInputDisabled=ua(this.defaultOperator)}applyNoValueFilter(t){this.filterChange(this.updateFilter({field:this.column.field,operator:t,value:null}))}ngOnChanges(t){(0,v.Hq)("filter",t,!1)&&(this._operator=null,this.filterInputDisabled=ua(this.currentOperator))}static \u0275fac=function(n){return new(n||i)(e.rXU(Je))};static \u0275dir=e.FsC({type:i,contentQueries:function(n,o,r){if(1&n&&e.wni(r,Jt,5),2&n){let s;e.mGM(s=e.lsd())&&(o.input=s.first)}},inputs:{column:"column",defaultOperator:"defaultOperator"},features:[e.Vt3,e.OA$]})}return i})(),yi=(()=>{class i{localization;clearText="Clear";filterClearIcon=de.LjL;filterSVGIcon=de.Sj_;get hostClasses(){return!0}dropdown;operators=[];showButton;showOperators=!0;value;column;valueChange=new e.bkB;clear=new e.bkB;subscription;constructor(t){this.localization=t}onChange(t){this.valueChange.emit(t)}clearClick(){return this.clear.emit(),!1}clearKeydown(t){(t.keyCode===v.D$.Enter||t.keyCode===v.D$.Space)&&this.clear.emit()}dropdownKeydown(t){t.defaultPrevented||t.keyCode===v.D$.Enter&&!this.dropdown.isOpen&&(this.dropdown.toggle(!0),t.preventDefault())}ngOnInit(){this.subscription=this.localization.changes.subscribe(()=>this.clearText=this.localization.get("filterClearButton"))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}get columnLabel(){const t=this.localization.get("filterCellOperatorLabel")||"";return En(t,"columnName",this.column.title||this.column.field)}messageFor(t){return this.localization.get(t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-cell-operators"]],viewQuery:function(n,o){if(1&n&&e.GBs(k_,5),2&n){let r;e.mGM(r=e.lsd())&&(o.dropdown=r.first)}},hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-filtercell-operator",o.hostClasses)},inputs:{operators:"operators",showButton:"showButton",showOperators:"showOperators",value:"value",column:"column"},outputs:{valueChange:"valueChange",clear:"clear"},standalone:!0,features:[e.aNF],decls:2,vars:2,consts:[["dropdown",""],["kendoTreeListFocusable","","class","k-dropdown-operator","icon","filter","textField","text","valueField","value",3,"data","value","svgIcon","valuePrimitive","popupSettings","valueChange","keydown",4,"ngIf"],["type","button","kendoButton","","kendoTreeListFocusable","","icon","filter-clear",3,"svgIcon","title","click","keydown",4,"ngIf"],["kendoTreeListFocusable","","icon","filter","textField","text","valueField","value",1,"k-dropdown-operator",3,"valueChange","keydown","data","value","svgIcon","valuePrimitive","popupSettings"],["type","button","kendoButton","","kendoTreeListFocusable","","icon","filter-clear",3,"click","keydown","svgIcon","title"]],template:function(n,o){1&n&&e.DNE(0,R_,2,7,"kendo-dropdownlist",1)(1,I_,1,2,"button",2),2&n&&(e.Y8G("ngIf",o.showOperators),e.R7$(),e.Y8G("ngIf",o.showButton))},dependencies:[M.bT,at.V9,$n,Be.Qp],encapsulation:2})}return i})();const gC=["isnull","isnotnull","isempty","isnotempty"];let Hn=(()=>{class i extends Mc{get hostClasses(){return!0}get overrideBaseClasses(){return!1}showOperators=!0;get showButton(){const t=this.currentFilter;return pe(t)&&(!Ve(t.value)||gC.indexOf(String(t.operator))>=0)}constructor(t){super(t)}filterChange(t){this.applyFilter(t)}static \u0275fac=function(n){return new(n||i)(e.rXU(Je))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-wrapper-cell"]],hostVars:4,hostBindings:function(n,o){2&n&&e.AVh("k-filtercell-wrapper",o.hostClasses)("k-filtercell",o.overrideBaseClasses)},inputs:{showOperators:"showOperators"},standalone:!0,features:[e.Vt3,e.aNF],ngContentSelectors:zt,decls:2,vars:5,consts:[[3,"clear","valueChange","showOperators","operators","column","showButton","value"]],template:function(n,o){1&n&&(e.NAR(),e.SdG(0),e.j41(1,"kendo-treelist-filter-cell-operators",0),e.bIt("clear",function(){return o.onClear()}),e.mxI("valueChange",function(s){return e.DH7(o.currentOperator,s)||(o.currentOperator=s),s}),e.k0s()),2&n&&(e.R7$(),e.Y8G("showOperators",o.showOperators)("operators",o.operators)("column",o.column)("showButton",o.showButton),e.R50("value",o.currentOperator))},dependencies:[yi],encapsulation:2})}return i})(),_a=(()=>{class i extends xc{filterDelay=500;showOperators=!0;placeholder;constructor(t,n){super(t,n)}get columnLabel(){const t=this.localization.get("filterInputLabel")||"";return En(t,"columnName",this.column.title||this.column.field)}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-string-filter-cell"]],inputs:{filterDelay:"filterDelay",showOperators:"showOperators",placeholder:"placeholder"},standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:9,consts:[[3,"column","filter","operators","defaultOperator","showOperators"],["kendoTreeListFocusable","","kendoFilterInput","",3,"columnLabel","filterDelay","placeholder","ngModel"]],template:function(n,o){if(1&n&&(e.j41(0,"kendo-treelist-filter-wrapper-cell",0),e.nrm(1,"kendo-textbox",1),e.k0s()),2&n){let r;e.Y8G("column",o.column)("filter",o.filter)("operators",o.operators)("defaultOperator",o.operator)("showOperators",o.showOperators),e.R7$(),e.Y8G("columnLabel",o.columnLabel)("filterDelay",o.filterDelay)("placeholder",o.placeholder)("ngModel",null!==(r=null==o.currentFilter?null:o.currentFilter.value)&&void 0!==r?r:null)}},dependencies:[Hn,R.X1,R.BC,$n,Jt,R.YN,R.vS,je.OV],encapsulation:2})}return i})();const Fc=pa({filterEqOperator:"eq",filterNotEqOperator:"neq",filterGteOperator:"gte",filterGtOperator:"gt",filterLteOperator:"lte",filterLtOperator:"lt",filterIsNullOperator:"isnull",filterIsNotNullOperator:"isnotnull"});let Pc=(()=>{class i extends Ii{localization;column;operator="eq";step=1;min;max;spinners=!0;decimals;get format(){return Ve(this._format)?this.columnFormat:this._format}set format(t){this._format=t}
1get currentFilter(){return this.filterByField(this.column.field)}get currentOperator(){return this.currentFilter?this.currentFilter.operator:this.operator}get columnFormat(){return this.column&&!Ve(this.column.format)?Fs(this.column.format):"n2"}_format;subscription;constructor(t,n){super(t),this.localization=n,this.defaultOperators=Fc(this.localization)}ngOnInit(){this.subscription=this.localization.changes.subscribe(this.localizationChange.bind(this))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),super.ngOnDestroy()}localizationChange(){this.defaultOperators=Fc(this.localization),this.operatorList.length&&(this.operators=ca(this.operatorList.toArray()))}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,inputs:{column:"column",operator:"operator",step:"step",min:"min",max:"max",spinners:"spinners",decimals:"decimals",format:"format"},features:[e.Vt3]})}return i})(),fl=(()=>{class i extends Pc{localization;filterDelay=500;showOperators=!0;placeholder;constructor(t,n){super(t,n),this.localization=n}get columnLabel(){const t=this.localization.get("filterInputLabel")||"";return En(t,"columnName",this.column.title||this.column.field)}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-numeric-filter-cell"]],inputs:{filterDelay:"filterDelay",showOperators:"showOperators",placeholder:"placeholder"},standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:16,consts:[[3,"column","filter","operators","defaultOperator","showOperators"],["kendoTreeListFocusable","","kendoFilterInput","",3,"columnLabel","filterDelay","autoCorrect","value","format","decimals","spinners","min","max","step","placeholder"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-filter-wrapper-cell",0),e.nrm(1,"kendo-numerictextbox",1),e.k0s()),2&n&&(e.Y8G("column",o.column)("filter",o.filter)("operators",o.operators)("defaultOperator",o.operator)("showOperators",o.showOperators),e.R7$(),e.Y8G("columnLabel",o.columnLabel)("filterDelay",o.filterDelay)("autoCorrect",!0)("value",null==o.currentFilter?null:o.currentFilter.value)("format",o.format)("decimals",o.decimals)("spinners",o.spinners)("min",o.min)("max",o.max)("step",o.step)("placeholder",o.placeholder))},dependencies:[Hn,je.Jh,$n,Jt],encapsulation:2})}return i})(),Nc=(()=>{class i extends Ii{localization;get hostClasses(){return!0}column;operator="eq";get currentFilter(){return this.filterByField(this.column.field)}get currentOperator(){return this.currentFilter?this.currentFilter.operator:this.operator}items;defaultItem;subscription;constructor(t,n){super(t),this.localization=n,this.items=[{text:this.localization.get("filterIsTrue"),value:!0},{text:this.localization.get("filterIsFalse"),value:!1}],this.defaultItem={text:this.localization.get("filterBooleanAll"),value:null}}ngOnInit(){this.subscription=this.localization.changes.subscribe(this.localizationChange.bind(this))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),super.ngOnDestroy()}localizationChange(){this.items=[{text:this.localization.get("filterIsTrue"),value:!0},{text:this.localization.get("filterIsFalse"),value:!1}],this.defaultItem={text:this.localization.get("filterBooleanAll"),value:null}}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,inputs:{column:"column"},features:[e.Vt3]})}return i})(),Cl=(()=>{class i extends Nc{cd;constructor(t,n,o){super(t,n),this.cd=o}localizationChange(){super.localizationChange(),this.cd.markForCheck()}messageFor(t){return this.localization.get(t)}get columnLabel(){const t=this.localization.get("booleanFilterCellLabel")||"";return En(t,"columnName",this.column.title||this.column.field)}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-boolean-filter-cell"]],standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:11,consts:[[3,"column","filter","showOperators","defaultOperator"],["kendoFilterInput","","textField","text","valueField","value",3,"defaultItem","columnLabel","data","popupSettings","valuePrimitive","value"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-filter-wrapper-cell",0),e.nrm(1,"kendo-dropdownlist",1),e.k0s()),2&n&&(e.Y8G("column",o.column)("filter",o.filter)("showOperators",!1)("defaultOperator",o.operator),e.R7$(),e.Y8G("defaultItem",o.defaultItem)("columnLabel",o.columnLabel)("data",o.items)("popupSettings",e.lJ4(10,hd))("valuePrimitive",!0)("value",null==o.currentFilter?null:o.currentFilter.value))},dependencies:[Hn,at.V9,Jt],encapsulation:2})}return i})();const Gc=pa({filterEqOperator:"eq",filterNotEqOperator:"neq",filterAfterOrEqualOperator:"gte",filterAfterOperator:"gt",filterBeforeOrEqualOperator:"lte",filterBeforeOperator:"lt",filterIsNullOperator:"isnull",filterIsNotNullOperator:"isnotnull"});let Ac=(()=>{class i extends Ii{localization;column;operator="gte";get currentFilter(){return this.filterByField(this.column.field)}set format(t){this._format=t}get format(){return Ve(this._format)?this.columnFormat:this._format}min;max;formatPlaceholder;placeholder;activeView="month";bottomView="month";topView="century";weekNumber=!1;get columnFormat(){return this.column&&!Ve(this.column.format)?Fs(this.column.format):"d"}get currentOperator(){return this.currentFilter?this.currentFilter.operator:this.operator}_format;subscription;constructor(t,n){super(t),this.localization=n,this.defaultOperators=Gc(this.localization)}ngOnInit(){this.subscription=this.localization.changes.subscribe(this.localizationChange.bind(this))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe(),super.ngOnDestroy()}localizationChange(){this.defaultOperators=Gc(this.localization),this.operatorList.length&&(this.operators=ca(this.operatorList.toArray()))}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,inputs:{column:"column",operator:"operator",format:"format",min:"min",max:"max",formatPlaceholder:"formatPlaceholder",placeholder:"placeholder",activeView:"activeView",bottomView:"bottomView",topView:"topView",weekNumber:"weekNumber"},features:[e.Vt3]})}return i})(),vl=(()=>{class i extends Ac{localization;showOperators=!0;constructor(t,n){super(t,n),this.localization=n}get columnLabel(){const t=this.localization.get("filterInputLabel")||"";return En(t,"columnName",this.column.title||this.column.field)}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-date-filter-cell"]],inputs:{showOperators:"showOperators"},standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:16,consts:[[3,"column","filter","operators","defaultOperator","showOperators"],["kendoFilterInput","",3,"value","format","columnLabel","formatPlaceholder","placeholder","activeView","bottomView","topView","min","max","weekNumber"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-filter-wrapper-cell",0),e.nrm(1,"kendo-datepicker",1),e.k0s()),2&n&&(e.Y8G("column",o.column)("filter",o.filter)("operators",o.operators)("defaultOperator",o.operator)("showOperators",o.showOperators),e.R7$(),e.Y8G("value",null==o.currentFilter?null:o.currentFilter.value)("format",o.format)("columnLabel",o.columnLabel)("formatPlaceholder",o.formatPlaceholder)("placeholder",o.placeholder)("activeView",o.activeView)("bottomView",o.bottomView)("topView",o.topView)("min",o.min)("max",o.max)("weekNumber",o.weekNumber))},dependencies:[Hn,z.I,Jt],encapsulation:2})}return i})(),Lc=(()=>{class i extends wc{constructor(t,n){super(t,n)}componentType(){return Ve(this.column.filter)?_a:(()=>({boolean:Cl,date:vl,numeric:fl,text:_a}[this.column.filter]))()}static \u0275fac=function(n){return new(n||i)(e.rXU(e.c1b),e.rXU(e.OM3))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoFilterCellHost",""]],standalone:!0,features:[e.Vt3]})}return i})(),Bc=(()=>{class i{focusGroup;column;get filter(){return this._filter}set filter(t){this._filter=da(t)}_templateContext={};_filter;constructor(t){this.focusGroup=t}get templateContext(){return this._templateContext.$implicit=this.filter,this._templateContext.column=this.column,this._templateContext.filter=this.filter,this._templateContext.cellContext={focusGroup:this.focusGroup},this._templateContext}get hasTemplate(){return pe(this.column.filterCellTemplateRef)}get isFilterable(){return pe(this.column)&&!Ve(this.column.field)&&this.column.filterable}static \u0275fac=function(n){return new(n||i)(e.rXU(Ei))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListFilterCell",""]],inputs:{column:"column",filter:"filter"},standalone:!0,features:[e.aNF],attrs:y_,decls:1,vars:1,consts:[[4,"ngIf"],[3,"ngSwitch"],[4,"ngSwitchCase"],["kendoFilterCellHost","",3,"column","filter"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,o){1&n&&e.DNE(0,M_,4,3,"ng-container",0),2&n&&e.Y8G("ngIf",o.isFilterable)},dependencies:[M.bT,M.ux,M.e1,Lc,M.T3],encapsulation:2})}return i})(),jc=(()=>{class i{columns=[];filter;logicalRowIndex;lockedColumnsCount;filterRowClass=!0;filterLabel;constructor(t){this.filterLabel=t.get("filter")}getColumnComponent(t){return t}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListFilterRow",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-filter-row",o.filterRowClass)},inputs:{columns:"columns",filter:"filter",logicalRowIndex:"logicalRowIndex",lockedColumnsCount:"lockedColumnsCount"},standalone:!0,features:[e.aNF],attrs:F_,decls:1,vars:1,consts:[["role","gridcell","kendoTreeListFilterCell","","kendoTreeListLogicalCell","","class","k-table-td",3,"column","filter","logicalRowIndex","logicalColIndex","colIndex",4,"ngFor","ngForOf"],["role","gridcell","kendoTreeListFilterCell","","kendoTreeListLogicalCell","",1,"k-table-td",3,"column","filter","logicalRowIndex","logicalColIndex","colIndex"]],template:function(n,o){1&n&&e.DNE(0,P_,1,7,"td",0),2&n&&e.Y8G("ngForOf",o.columns)},dependencies:[M.pM,Bc,sa],encapsulation:2})}return i})();const Vc=i=>i.nativeElement.parentElement.offsetWidth,$c=i=>Sn(i).filter(a=>!a.isColumnGroup),vC=({originalEvent:i})=>{i.stopPropagation(),i.preventDefault()},Uc=i=>!(!i.parent||!i.parent.isSpanColumn);let Yc=(()=>{class i{draggable;element;service;zone;cdr;localization;columns=[];column;get visible(){return this.column.resizable?"block":"none"}get leftStyle(){return Dt(this.rtl)?0:null}get rightStyle(){return Dt(this.rtl)?null:0}subscriptions=new K.y;rtl=!1;autoFit(){const t=$c(this.columns),n=co([this.column]).filter(r=>Dt(r.resizable)),o=n.map(r=>{const s=Uc(r),c=!!s&&r.parent.childColumns.last===r,u=((i,a)=>{let t=0,n=0,o=0;for(;t<a.length;){const r=a[t],s=Uc(r);if(r===i)break;n--<=0&&s&&(n=r.parent.childColumns.length-1,o+=n),t++}return t-o})(r,t);return{column:r,headerIndex:this.columnsForLevel(r.level).indexOf(r),index:u,isLastInSpan:c,isParentSpan:s,level:r.level}});
1n.forEach(r=>r.width=0),this.service.measureColumns(o)}constructor(t,n,o,r,s,c){this.draggable=t,this.element=n,this.service=o,this.zone=r,this.cdr=s,this.localization=c}ngOnInit(){const t=this.service.changes.pipe((0,ae.p)(()=>this.column.resizable),(0,ae.p)(n=>pe(n.columns.find(o=>o===this.column))));this.subscriptions.add(t.pipe((0,ae.p)(n=>"start"===n.type)).subscribe(this.initState.bind(this))),this.subscriptions.add(t.pipe((0,ae.p)(n=>"resizeColumn"===n.type)).subscribe(this.resize.bind(this))),this.subscriptions.add(this.service.changes.pipe((0,ae.p)(n=>"start"===n.type),(0,ae.p)(this.shouldUpdate.bind(this)),(0,O.s)(1)).subscribe(this.initColumnWidth.bind(this))),this.subscriptions.add(this.zone.runOutsideAngular(()=>this.draggable.kendoPress.pipe((0,Te.M)(vC),(0,Te.M)(()=>this.service.start(this.column)),(0,Oe.n)((i=>a=>(0,le.of)(a).pipe((0,wt.c)(150),(0,L.Q)(i)))(this.draggable.kendoRelease)),(0,Oe.n)(((i,a)=>t=>a.kendoDrag.pipe((0,L.Q)(a.kendoRelease.pipe((0,Te.M)(()=>i.end()))),(0,Me.T)(({pageX:n})=>({originalX:t.pageX,pageX:n}))))(this.service,this.draggable))).subscribe(({pageX:n,originalX:o})=>{const s=(i=>i/(this.column.resizeStartWidth||this.column.width)*100)(n-o);this.service.resizeColumns(s)}))),this.subscriptions.add(t.pipe((0,ae.p)(n=>"autoFitComplete"===n.type)).subscribe(this.sizeToFit.bind(this))),this.subscriptions.add(t.pipe((0,ae.p)(n=>"triggerAutoFit"===n.type)).subscribe(this.autoFit.bind(this))),this.subscriptions.add(this.localization.changes.subscribe(({rtl:n})=>this.rtl=n))}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe()}shouldUpdate(){return!$c(this.columns).map(t=>t.width).some(xs)}initColumnWidth(){this.column.width=Vc(this.element)}initState(){this.column.resizeStartWidth=Vc(this.element),this.service.resizedColumn({column:this.column,oldWidth:this.column.resizeStartWidth})}resize({deltaPercent:t}){let n=((i,a)=>{const t=a<0?-1:1;return Math.ceil(Math.abs(a)/100*i)*t})(this.column.resizeStartWidth,t);Dt(this.rtl)&&(n*=-1);const o=Math.max(this.column.resizeStartWidth+n,this.column.minResizableWidth),r=o>this.column.minResizableWidth?n:this.column.minResizableWidth-this.column.resizeStartWidth;this.updateWidth(this.column,o),this.service.resizeTable(this.column,r)}sizeToFit({columns:t,widths:n}){const o=t.indexOf(this.column),r=Math.max(...n.map(c=>c[o]))+1,s=r-this.column.resizeStartWidth;this.updateWidth(this.column,r),this.service.resizeTable(this.column,s)}updateWidth(t,n){t.width=n,this.cdr.markForCheck()}columnsForLevel(t){return Bn(this.columns?this.columns.filter(n=>n.level===t):[])}static \u0275fac=function(n){return new(n||i)(e.rXU(v.T5,1),e.rXU(e.aKT),e.rXU(Ti),e.rXU(e.SKi),e.rXU(e.gRc),e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListColumnHandle",""]],hostVars:6,hostBindings:function(n,o){1&n&&e.bIt("dblclick",function(){return o.autoFit()}),2&n&&e.xc7("display",o.visible)("left",o.leftStyle)("right",o.rightStyle)},inputs:{columns:"columns",column:"column"},standalone:!0})}return i})(),Hc=(()=>{class i{closeMenu=new e.bkB;column;sort;filter;sortable;close(){this.closeMenu.emit()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),ma=(()=>{class i{service;hostClass=!0;ngOnInit(){if((0,e.naY)()&&!this.service)throw new Error("The service input of the predefined column menu components is mandatory.")}close(){this.service.close()}static \u0275fac=function(n){return new(n||i)};static \u0275dir=e.FsC({type:i,hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-columnmenu-item-wrapper",o.hostClass)},inputs:{service:"service"}})}return i})(),vo=(()=>{class i extends Mc{filterService;_currentFilter;get hostClasses(){return!1}constructor(){super(null)}operatorChange(t){this.currentOperator=t}filterChange(t){this.applyFilter(t)}get currentFilter(){return this._currentFilter}set currentFilter(t){this._currentFilter=t}updateFilter(t){return Object.assign(this.currentFilter,t),this.filter}onChange(t){this.filterChange(this.updateFilter({field:this.column.field,operator:this.currentOperator,value:t}))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-menu
1-input-wrapper"]],inputs:{filterService:"filterService",currentFilter:"currentFilter"},standalone:!0,features:[e.Vt3,e.aNF],ngContentSelectors:zt,decls:2,vars:3,consts:[["textField","text","valueField","value",3,"valueChange","data","value","valuePrimitive"]],template:function(n,o){1&n&&(e.NAR(),e.j41(0,"kendo-dropdownlist",0),e.bIt("valueChange",function(s){return o.operatorChange(s)}),e.k0s(),e.SdG(1)),2&n&&e.Y8G("data",o.operators)("value",o.currentOperator)("valuePrimitive",!0)},dependencies:[at.V9],encapsulation:2})}return i})(),bl=(()=>{class i{localization;operators=[];column;filter;operator;currentFilter;filterService;placeholder;constructor(t){this.localization=t}get columnLabel(){const t=this.localization.get("filterInputLabel")||"";return En(t,"columnName",this.column?this.column.title||this.column.field:"")}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-string-filter-menu-input"]],inputs:{operators:"operators",column:"column",filter:"filter",operator:"operator",currentFilter:"currentFilter",filterService:"filterService",placeholder:"placeholder"},standalone:!0,features:[e.aNF],decls:2,vars:10,consts:[[3,"column","filter","operators","defaultOperator","currentFilter","filterService"],["kendoFilterInput","",3,"columnLabel","filterDelay","placeholder","ngModel"]],template:function(n,o){if(1&n&&(e.j41(0,"kendo-treelist-filter-menu-input-wrapper",0),e.nrm(1,"kendo-textbox",1),e.k0s()),2&n){let r;e.Y8G("column",o.column)("filter",o.filter)("operators",o.operators)("defaultOperator",o.operator)("currentFilter",o.currentFilter)("filterService",o.filterService),e.R7$(),e.Y8G("columnLabel",o.columnLabel)("filterDelay",0)("placeholder",o.placeholder)("ngModel",null!==(r=null==o.currentFilter?null:o.currentFilter.value)&&void 0!==r?r:null)}},dependencies:[vo,je.OV,R.X1,R.BC,Jt,R.YN,R.vS],encapsulation:2})}return i})(),ga=(()=>{class i extends xc{logicOperators=Ri(this.localization);get hostClasses(){return!1}filter={filters:[],logic:"and"};extra=!0;filterService;placeholder;extraPlaceholder;constructor(t){super(null,t)}get firstFilter(){return ki(0,this.filter,(this.column||{}).field,this.operator)}get secondFilter(){return ki(1,this.filter,(this.column||{}).field,this.operator)}logicChange(t){this.filter.logic=t}localizationChange(){this.logicOperators=Ri(this.localization),super.localizationChange()}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-string-filter-menu"]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-filtercell",o.hostClasses)},inputs:{filter:"filter",extra:"extra",filterService:"filterService",placeholder:"placeholder",extraPlaceholder:"extraPlaceholder"},standalone:!0,features:[e.Vt3,e.aNF],decls:3,vars:8,consts:[[3,"currentFilter","operators","filterService","column","filter","placeholder"],["class","k-filter-and","textField","text","valueField","value",3,"data","valuePrimitive","value","valueChange",4,"ngIf"],[3,"operators","currentFilter","filterService","column","filter","placeholder",4,"ngIf"],["textField","text","valueField","value",1,"k-filter-and",3,"valueChange","data","valuePrimitive","value"],[3,"operators","currentFilter","filterService","column","filter","placeholder"]],template:function(n,o){1&n&&(e.nrm(0,"kendo-treelist-string-filter-menu-input",0),e.DNE(1,N_,1,3,"kendo-dropdownlist",1)(2,G_,1,6,"kendo-treelist-string-filter-menu-input",2)),2&n&&(e.Y8G("currentFilter",o.firstFilter)("operators",o.operators)("filterService",o.filterService)("column",o.column)("filter",o.filter)("placeholder",o.placeholder),e.R7$(),e.Y8G("ngIf",o.extra),e.R7$(),e.Y8G("ngIf",o.extra))},dependencies:[bl,M.bT,at.V9],encapsulation:2})}return i})(),Tl=(()=>{class i{operators=[];column;filter;operator;currentFilter;filterService;placeholder;step=1;min;max;spinners=!0;decimals;format;static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-numeric-filter-menu-input"]],inputs:{operators:"operators",column:"column",filter:"filter",operator:"operator",currentFilter:"currentFilter",filterService:"filterService",placeholder:"placeholder",step:"step",min:"min",max:"max",spinners:"spinners",decimals:"decimals",format:"format"},standalone:!0,features:[e.aNF],decls:2,vars:16,consts:[[3,"column","filter","operators","defaultOperator","currentFilter","filterService"],["kendoFilterInput","",3,"filterDelay","autoCorrect","value","format","decimals","spinners","min","max","step","placeholder"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-filter-menu
1-input-wrapper",0),e.nrm(1,"kendo-numerictextbox",1),e.k0s()),2&n&&(e.Y8G("column",o.column)("filter",o.filter)("operators",o.operators)("defaultOperator",o.operator)("currentFilter",o.currentFilter)("filterService",o.filterService),e.R7$(),e.Y8G("filterDelay",0)("autoCorrect",!0)("value",null==o.currentFilter?null:o.currentFilter.value)("format",o.format)("decimals",o.decimals)("spinners",o.spinners)("min",o.min)("max",o.max)("step",o.step)("placeholder",o.placeholder))},dependencies:[vo,je.Jh,Jt],encapsulation:2})}return i})(),El=(()=>{class i extends Pc{logicOperators=Ri(this.localization);get hostClasses(){return!1}filter={filters:[],logic:"and"};extra=!0;filterService;placeholder="";extraPlaceholder="";constructor(t){super(null,t)}get firstFilter(){return ki(0,this.filter,(this.column||{}).field,this.operator)}get secondFilter(){return ki(1,this.filter,(this.column||{}).field,this.operator)}logicChange(t){this.filter.logic=t}localizationChange(){this.logicOperators=Ri(this.localization),super.localizationChange()}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-numeric-filter-menu"]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-filtercell",o.hostClasses)},inputs:{filter:"filter",extra:"extra",filterService:"filterService",placeholder:"placeholder",extraPlaceholder:"extraPlaceholder"},standalone:!0,features:[e.Vt3,e.aNF],decls:3,vars:14,consts:[[3,"currentFilter","operators","filterService","column","filter","format","decimals","spinners","min","max","step","placeholder"],["class","k-filter-and","textField","text","valueField","value",3,"data","valuePrimitive","value","valueChange",4,"ngIf"],[3,"operators","currentFilter","filterService","column","filter","format","decimals","spinners","min","max","step","placeholder",4,"ngIf"],["textField","text","valueField","value",1,"k-filter-and",3,"valueChange","data","valuePrimitive","value"],[3,"operators","currentFilter","filterService","column","filter","format","decimals","spinners","min","max","step","placeholder"]],template:function(n,o){1&n&&(e.nrm(0,"kendo-treelist-numeric-filter-menu-input",0),e.DNE(1,A_,1,3,"kendo-dropdownlist",1)(2,L_,1,12,"kendo-treelist-numeric-filter-menu-input",2)),2&n&&(e.Y8G("currentFilter",o.firstFilter)("operators",o.operators)("filterService",o.filterService)("column",o.column)("filter",o.filter)("format",o.format)("decimals",o.decimals)("spinners",o.spinners)("min",o.min)("max",o.max)("step",o.step)("placeholder",o.placeholder),e.R7$(),e.Y8G("ngIf",o.extra),e.R7$(),e.Y8G("ngIf",o.extra))},dependencies:[Tl,M.bT,at.V9],encapsulation:2})}return i})(),Sl=(()=>{class i{popupService;operators=[];column;filter;operator;currentFilter;filterService;format;formatPlaceholder;placeholder;min;max;activeView;bottomView;topView;weekNumber;subscription;constructor(t){this.popupService=t}open(t){this.subscription=this.popupService.onClose.pipe((0,ae.p)(()=>t.isActive)).subscribe(n=>n.preventDefault())}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}static \u0275fac=function(n){return new(n||i)(e.rXU(mo))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-date-filter-menu-input"]],inputs:{operators:"operators",column:"column",filter:"filter",operator:"operator",currentFilter:"currentFilter",filterService:"filterService",format:"format",formatPlaceholder:"formatPlaceholder",placeholder:"placeholder",min:"min",max:"max",activeView:"activeView",bottomView:"bottomView",topView:"topView",weekNumber:"weekNumber"},standalone:!0,features:[e.aNF],decls:3,vars:17,consts:[["picker",""],[3,"column","filter","operators","defaultOperator","currentFilter","filterService"],["kendoFilterInput","",3,"open","filterDelay","value","placeholder","formatPlaceholder","format","min","max","activeView","bottomView","topView","weekNumber"]],template:function(n,o){if(1&n){const r=e.RV6();e.j41(0,"kendo-treelist-filter-menu-input-wrapper",1)(1,"kendo-datepicker",2,0),e.bIt("open",function(){e.eBV(r);const c=e.sdS(2);return e.Njj(o.open(c))}),e.k0s()()}2&n&&(e.Y8G("column",o.column)("filter",o.filter)("operators",o.operators)("defaultOperator",o.operator)("currentFilter",o.currentFilter)("filterService",o.filterService),e.R7$(),e.Y8G("filterDelay",0)("value",null==o.currentFilter?null:o.currentFilter.value)("placeholder",o.placeholder)("formatPlaceholder",o.formatPlaceholder)("format",o.format)("min",o.min)("max",o.max)("activeView",o.activeView)("bottomView",o.bottomView)("topView",o.topView)("weekNumber",o.weekNumber))},dependencies:[vo,z.I,Jt],encapsulation:2})}return i})(),kl=(()=>{class i extends Ac{logicOperators=Ri(this.localization);get hostClasses(){return!1}filter={filters:[],logic:"and"};extra=!0;filterService;constructor(t){super(null,t)}get firstFilter(){return ki(0,this.filter,(this.column||{}).field,this.operator)}get secondFilter(){return ki(1,this.filter,(this.column||{}).field,this.operator)}logicChange(t){this.filter.logic=t}localizationChange(){this.logicOperators=Ri(this.localization),super.localizationChange()}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-date-filter-menu"]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-filtercell",o.hostClasses)},inputs:{filter:"filter",extra:"extra",filterService:"filterService"},standalone:!0,features:[e.Vt3,e.aNF],decls:3,vars:16,consts:[[3,"currentFilter","operators","filterService","column","filter","activeView","bottomView","topView","format","formatPlaceholder","placeholder","min","max","weekNumber"],["class","k-filter-and","textField","text","valueField","value",3,"data","valuePrimitive","value","valueChange",4,"ngIf"],[3,"operators","currentFilter","filterService","column","filter","activeView","bottomView","topView","format","formatPlaceholder","placeholder","min","max","weekNumber",4,"ngIf"],["textField","text","valueField","value",1,"k-filter-and",3,"valueChange","data","valuePrimitive","value"],[3,"operators","currentFilter","filterService","column","filter","activeView","bottomView","topView","format","formatPlaceholder","placeholder","min","max","weekNumber"]],template:function(n,o){1&n&&(e.nrm(0,"kendo-treelist-date-filter-menu
1-input",0),e.DNE(1,B_,1,3,"kendo-dropdownlist",1)(2,j_,1,14,"kendo-treelist-date-filter-menu-input",2)),2&n&&(e.Y8G("currentFilter",o.firstFilter)("operators",o.operators)("filterService",o.filterService)("column",o.column)("filter",o.filter)("activeView",o.activeView)("bottomView",o.bottomView)("topView",o.topView)("format",o.format)("formatPlaceholder",o.formatPlaceholder)("placeholder",o.placeholder)("min",o.min)("max",o.max)("weekNumber",o.weekNumber),e.R7$(),e.Y8G("ngIf",o.extra),e.R7$(),e.Y8G("ngIf",o.extra))},dependencies:[Sl,M.bT,at.V9],encapsulation:2})}return i})(),Xc=(()=>{class i{hostElement;renderer;columnLabel;radioButtonEl;constructor(t,n){this.hostElement=t,this.renderer=n}ngAfterViewInit(){this.radioButtonEl=this.hostElement.nativeElement,this.renderer.setAttribute(this.hostElement.nativeElement,"aria-label",this.columnLabel)}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(e.sFG))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoFilterMenuRadioButton",""]],inputs:{columnLabel:"columnLabel"},standalone:!0})}return i})(),Rl=(()=>{class i extends Nc{renderer;domSanitizer;get hostClasses(){return!1}inputElem;filter={filters:[],logic:"and"};filterService;idPrefix=(0,v.Os)();constructor(t,n,o){super(null,n),this.renderer=t,this.domSanitizer=o}radioId(t){return`${this.idPrefix}_${t}`}onChange(t){this.applyFilter(this.updateFilter({field:this.column.field,operator:"eq",value:t}))}isSelected(t){return this.filtersByField(this.column.field).some(({value:n})=>n===t)}get columnLabel(){const t=this.localization.get("filterInputLabel")||"";return En(t,"columnName",this.column.title||this.column.field)}static \u0275fac=function(n){return new(n||i)(e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(Tt.up))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-boolean-filter-menu"]],viewQuery:function(n,o){if(1&n&&e.GBs(V_,5),2&n){let r;e.mGM(r=e.lsd())&&(o.inputElem=r.first)}},hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-filtercell",o.hostClasses)},inputs:{filter:"filter",filterService:"filterService"},standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:1,consts:[["inputElem",""],[1,"k-radio-list","k-reset"],[4,"ngFor","ngForOf"],["kendoFilterMenuRadioButton","",3,"checkedChange","columnLabel","name","checked"],[1,"k-radio-label"]],template:function(n,o){1&n&&(e.j41(0,"ul",1),e.DNE(1,$_,5,6,"li",2),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngForOf",o.items))},dependencies:[M.pM,je.dx,Xc],encapsulation:2})}return i})(),Wc=(()=>{class i extends wc{filterService;constructor(t,n){super(t,n)}componentType(){return pe(this.column)&&!Ve(this.column.filter)?(()=>({boolean:Rl,date:kl,numeric:El,text:ga}[this.column.filter]))():ga}initComponent(t){super.initComponent(t),this.component.instance.filterService=this.filterService}static \u0275fac=function(n){return new(n||i)(e.rXU(e.c1b),e.rXU(e.OM3))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoFilterMenuHost",""]],inputs:{filterService:"filterService"},standalone:!0,features:[e.Vt3]})}return i})();const zc=({value:i,operator:a})=>!Ve(i)||(i=>"isnull"===i||"isnotnull"===i||"isempty"===i||"isnotempty"===i)(a),Kc=(i,a,t)=>i.reduce((n,o)=>n||(o.filters?Kc(o.filters,a,o):o.field===a?t:n),void 0),IC=(i,a,t="and")=>{const n=Kc((i||{}).filters||[],a);return pe(n)?n.logic:t};let ha=(()=>{class i{parentService;childService;localization;cd;close=new e.bkB;column;get filter(){return this._filter}set filter(t){this._filter=da(t)}actionsClass="k-actions k-button-group";get childFilter(){return pe(this._childFilter)||(this._childFilter={filters:Co(this.filter,(this.column||{}).field),logic:IC(this.filter,(this.column||{}).field)}),this._childFilter}_childFilter;subscription;_templateContext={};_filter;constructor(t,n,o,r){this.parentService=t,this.childService=n,this.localization=o,this.cd=r}ngOnInit(){this.subscription=this.childService.changes.subscribe(t=>this._childFilter=t),this.subscription.add(this.localization.changes.subscribe(()=>this.cd.markForCheck()))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}get disabled(){return!this.childFilter.filters.some(zc)}get templateContext(){return this._templateContext.column=this.column,this._templateContext.filter=this.childFilter,this._templateContext.filterService=this.childService,this._templateContext.$implicit=this.childFilter,this._templateContext}get hasTemplate(){return pe(this.column)&&pe(this.column.filterMenuTemplateRef)}submit(){const t=(i=>(i.filters=i.filters.filter(zc),i))(this.childFilter);if(t.filters.length){const n=this.filter||{filters:[],logic:"and"};hl(n,this.column.field),n.filters.push(t),this.parentService.filter(n)}return this.close.emit(),!1}reset(){const t=this.filter||{filters:[],logic:"and"};hl(t,this.column.field),this.parentService.filter(t),this.close.emit()}get clearText(){return this.localization.get("filterClearButton")}get filterText(){return this.localization.get("filterFilterButton")}static \u0275fac=function(n){return new(n||i)(e.rXU(Je,4),e.rXU(Je),e.rXU(H.Pi),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-menu
1-container"]],inputs:{column:"column",filter:"filter",actionsClass:"actionsClass"},outputs:{close:"close"},standalone:!0,features:[e.Jv_([Je]),e.aNF],decls:10,vars:7,consts:[[1,"k-filter-menu",3,"submit","reset"],[1,"k-filter-menu-container"],[3,"ngSwitch"],[4,"ngSwitchCase"],[3,"ngClass"],["type","reset",1,"k-button","k-button-solid-base","k-button-solid","k-button-md","k-rounded-md","k-button-rectangle"],["type","submit",1,"k-button","k-button-solid-primary","k-button-solid","k-button-md","k-rounded-md","k-button-rectangle",3,"disabled"],["kendoFilterMenuHost","",3,"filterService","column","filter"],[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,o){1&n&&(e.j41(0,"form",0),e.bIt("submit",function(){return o.submit()})("reset",function(){return o.reset()}),e.j41(1,"div",1),e.qex(2,2),e.DNE(3,U_,2,3,"ng-container",3)(4,X_,2,1,"ng-container",3),e.bVm(),e.j41(5,"div",4)(6,"button",5),e.EFF(7),e.k0s(),e.j41(8,"button",6),e.EFF(9),e.k0s()()()()),2&n&&(e.R7$(2),e.Y8G("ngSwitch",o.hasTemplate),e.R7$(),e.Y8G("ngSwitchCase",!1),e.R7$(),e.Y8G("ngSwitchCase",!0),e.R7$(),e.Y8G("ngClass",o.actionsClass),e.R7$(2),e.SpI(" ",o.clearText," "),e.R7$(),e.Y8G("disabled",o.disabled),e.R7$(),e.SpI(" ",o.filterText," "))},dependencies:[R.X1,R.qT,R.cb,R.YN,R.cV,M.ux,M.e1,Wc,M.bT,M.T3,M.YU],encapsulation:2})}return i})(),fa=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListColumnMenuItemContentTemplate",""]],standalone:!0})}return i})(),wi=(()=>{class i{itemClick=new e.bkB;expand=new e.bkB;collapse=new e.bkB;icon;svgIcon;text;selected;disabled;expanded;contentTemplate;contentState="collapsed";chevronUpIcon=de.mAq;chevronDownIcon=de.brG;get expandedIcon(){return this.expanded?"arrow-chevron-up":"arrow-chevron-down"}get expandedSvgIcon(){return this.expanded?this.chevronUpIcon:this.chevronDownIcon}ngOnChanges(t){t.expanded&&this.updateContentState()}onClick(t){this.itemClick.emit(t),this.contentTemplate&&(this.expanded=!this.expanded,this.updateContentState(),this.expanded?this.expand.emit():this.collapse.emit())}updateContentState(){this.contentState=this.expanded?"expanded":"collapsed"}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-columnmenu-item"]],contentQueries:function(n,o,r){if(1&n&&e.wni(r,fa,5),2&n){let s;e.mGM(s=e.lsd())&&(o.contentTemplate=s.first)}},inputs:{icon:"icon",svgIcon:"svgIcon",text:"text",selected:"selected",disabled:"disabled",expanded:"expanded"},outputs:{itemClick:"itemClick",expand:"expand",collapse:"collapse"},standalone:!0,features:[e.OA$,e.aNF],decls:3,vars:2,consts:[["content",""],["class","k-expander",4,"ngIf","ngIfElse"],[1,"k-expander"],[3,"ngTemplateOutlet"],[1,"k-columnmenu-item",3,"click"],[3,"name","svgIcon"],["class","k-spacer",4,"ngIf"],["class","k-expander-indicator",4,"ngIf"],["class","k-columnmenu-item-content",3,"overflow",4,"ngIf"],[1,"k-spacer"],[1,"k-expander-indicator"],[1,"k-columnmenu-item-content"]],template:function(n,o){if(1&n&&e.DNE(0,W_,2,1,"div",1)(1,q_,6,10,"ng-template",null,0,e.C5r),2&n){const r=e.sdS(2);e.Y8G("ngIf",o.contentTemplate)("ngIfElse",r)}},dependencies:[A.QK,M.bT,M.T3],encapsulation:2,data:{animation:[(0,st.hZ)("state",[(0,st.wk)("collapsed",(0,st.iF)({display:"none"})),(0,st.wk)("expanded",(0,st.iF)({display:"block"})),(0,st.kY)("collapsed => expanded",[(0,st.iF)({height:"0px",display:"block"}),(0,st.i0)("100ms ease-in",(0,st.iF)({height:"*"}))]),(0,st.kY)("expanded => collapsed",[(0,st.iF)({height:"*"}),(0,st.i0)("100ms ease-in",(0,st.iF)({height:"0px"}))])])]}})}return i})(),Il=(()=>{class i extends ma{localization;expand=new e.bkB;collapse=new e.bkB;expanded=!1;actionsClass="k-actions";filterIcon=de.Sj_;constructor(t){super(),this.localization=t}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-columnmenu-filter"]],inputs:{expanded:"expanded"},outputs:{expand:"expand",collapse:"collapse"},standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:3,consts:[["icon","filter",3,"collapse","expand","text","svgIcon","expanded"],["kendoTreeListColumnMenuItemContentTemplate",""],[3,"close","column","filter","actionsClass"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-columnmenu-item",0),e.bIt("collapse",function(){return o.collapse.emit()})("expand",function(){return o.expand.emit()}),e.DNE(1,Q_,1,3,"ng-template",1),e.k0s()),2&n&&e.Y8G("text",o.localization.get("filter"))("svgIcon",o.filterIcon)("expanded",o.expanded)},dependencies:[wi,fa,ha],encapsulation:2})}return i})(),Jc=(()=>{class i{element;ngZone;renderer;get className(){return!0}reset=new e.bkB;apply=new e.bkB;columnChange=new e.bkB;set columns(t){this._columns=t.filter(n=>!1!==n.includeInChooser),this.allColumns=t,this.updateColumnState()}get columns(){return this._columns}autoSync=!0;allowHideAll=!1;applyText;resetText;actionsClass="k-actions";checkboxes;hasLocked;hasVisibleLocked;unlockedCount=0;hasUnlockedFiltered;hasFiltered;_columns;allColumns;domSubscriptions;constructor(t,n,o){this.element=t,this.ngZone=n,this.renderer=o}isDisabled(t){return!(this.allowHideAll||this.hasFiltered||t.hidden||this.columns.find(n=>n!==t&&!n.hidden))||this.hasVisibleLocked&&!this.hasUnlockedFiltered&&
11===this.unlockedCount&&!t.locked&&!t.hidden}ngOnInit(){this.element&&this.ngZone.runOutsideAngular(()=>{this.domSubscriptions=this.renderer.listen(this.element.nativeElement,"click",t=>{this.ngZone.onStable.pipe((0,O.s)(1)).subscribe(()=>{const n=t.target.closest(".k-checkbox-wrap");if(n)if(this.autoSync){const o=this.checkboxes.find(u=>u.hostElement.nativeElement===n),r=parseInt(n.firstElementChild.getAttribute("data-index"),10),s=this.columns[r],c=!o.checkedState;!!s.hidden!==c&&this.ngZone.run(()=>{s.hidden=c,this.columnChange.emit([s])})}else this.ngZone.run(()=>this.updateDisabled())})})})}ngOnDestroy(){this.domSubscriptions&&this.domSubscriptions()}cancelChanges(){this.checkboxes.forEach((t,n)=>{t.checkedState=!this.columns[n].hidden}),this.updateDisabled(),this.reset.emit()}applyChanges(){const t=[];this.checkboxes.forEach((n,o)=>{const r=this.columns[o],s=!n.checkedState;!!r.hidden!==s&&(r.hidden=s,t.push(r))}),this.updateDisabled(),this.apply.emit(t)}updateDisabled(){if(this.allowHideAll&&!this.hasLocked)return;const t=[];if(this.checkboxes.forEach((n,o)=>{n.checkedState&&t.push({checkbox:n,index:o}),n.disabled=!1}),this.allowHideAll||1!==t.length||this.hasFiltered){if(this.hasLocked&&!this.hasUnlockedFiltered){const n=this.columns,o=t.filter(r=>!n[r.index].locked);1===o.length&&(o[0].checkbox.disabled=!0)}}else t[0].checkbox.disabled=!0}updateColumnState(){this.hasLocked=this.allColumns.filter(n=>n.locked&&(!n.hidden||!1!==n.includeInChooser)).length>0,this.hasVisibleLocked=this.allColumns.filter(n=>n.locked&&!n.hidden).length>0,this.unlockedCount=this.columns.filter(n=>!n.locked&&!n.hidden).length;const t=this.allColumns.filter(n=>!1===n.includeInChooser&&!n.hidden);t.length?(this.hasFiltered=t.length>0,this.hasUnlockedFiltered=t.filter(n=>!n.locked).length>0):(this.hasFiltered=!1,this.hasUnlockedFiltered=!1)}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(e.SKi),e.rXU(e.sFG))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-columnlist"]],viewQuery:function(n,o){if(1&n&&e.GBs(je.$W,5),2&n){let r;e.mGM(r=e.lsd())&&(o.checkboxes=r)}},hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-column-list-wrapper",o.className)},inputs:{columns:"columns",autoSync:"autoSync",allowHideAll:"allowHideAll",applyText:"applyText",resetText:"resetText",actionsClass:"actionsClass"},outputs:{reset:"reset",apply:"apply",columnChange:"columnChange"},standalone:!0,features:[e.aNF],decls:3,vars:2,consts:[[1,"k-column-list"],["class","k-column-list-item",4,"ngFor","ngForOf"],[3,"ngClass",4,"ngIf"],[1,"k-column-list-item"],[3,"inputAttributes","checkedState","disabled"],[1,"k-checkbox-label"],[3,"ngClass"],["type","button",1,"k-button","k-button-solid-base","k-button-solid","k-button-md","k-rounded-md","k-button-rectangle",3,"click"],["type","button",1,"k-button","k-button-solid-primary","k-button-solid","k-button-md","k-rounded-md","k-button-rectangle",3,"click"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.DNE(1,em,4,6,"label",1),e.k0s(),e.DNE(2,tm,5,3,"div",2)),2&n&&(e.R7$(),e.Y8G("ngForOf",o.columns),e.R7$(),e.Y8G("ngIf",!o.autoSync))},dependencies:[M.pM,M.bT,M.YU,je.$W],encapsulation:2})}return i})(),yl=(()=>{class i extends ma{localization;columnInfoService;changeDetector;expand=new e.bkB;collapse=new e.bkB;expanded=!1;actionsClass="k-actions";get columns(){return this.columnInfoService.leafNamedColumns}columnsIcon=de.ZUr;constructor(t,n,o){super(),this.localization=t,this.columnInfoService=n,this.changeDetector=o}onApply(t){this.close(),t.length&&(this.changeDetector.markForCheck(),this.columnInfoService.changeVisibility(t))}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi),e.rXU(In),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-columnmenu-chooser"]],inputs:{expanded:"expanded"},outputs:{expand:"expand",collapse:"collapse"},standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:3,consts:[["icon","columns",3,"collapse","expand","text","svgIcon","expanded"],["kendoTreeListColumnMenuItemContentTemplate",""],[3,"apply","applyText","resetText","columns","autoSync","allowHideAll","actionsClass"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-columnmenu-item",0),e.bIt("collapse",function(){return o.collapse.emit()})("expand",function(){return o.expand.emit()}),e.DNE(1,nm,1,6,"ng-template",1),e.k0s()),2&n&&e.Y8G("text",o.localization.get("columns"))("svgIcon",o.columnsIcon)("expanded",o.expanded)},dependencies:[wi,fa,Jc],encapsulation:2})}return i})(),wl=(()=>{class i extends ma{localization;columnInfoService;changeDetector;unlockIcon=de.qqX;lockIcon=de.hzW;constructor(t,n,o){super(),this.localization=t,this.columnInfoService=n,this.changeDetector=o}get text(){return this.localization.get(this.locked?"unlock":"lock")}get icon(){return this.locked?"unlock":"lock"}get svgIcon(){return this.locked?this.unlockIcon:this.lockIcon}get disabled(){return!this.locked&&this.columnInfoService.unlockedRootCount<2}toggleColumn(){this.toggleHierarchy(!this.locked),this.close(),this.changeDetector.markForCheck()}toggleHierarchy(t){let n=this.service.column;for(;n.parent;)n=n.parent;const o=[n],r=[];for(;o.length;){const s=o.shift();s.locked=t,r.push(s),s.hasChildren&&o.push(...s.childrenArray)}this.columnInfoService.changeLocked(r)}get locked(){return this.service.column.locked}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi),e.rXU(In),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-columnmenu-lock"]],standalone:!0,features:[e.Vt3,e.aNF],decls:1,vars:4,consts:[[3,"itemClick","text","icon","svgIcon","disabled"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-columnmenu-item",0),e.bIt("itemClick",function(){return o.toggleColumn()}),e.k0s()),2&n&&e.Y8G("text",o.text)("icon",o.icon)("svgIcon",o.svgIcon)("disabled",o.disabled)},dependencies:[wi],encapsulation:2})}return i})(),Dl=(()=>{class i extends ma{localization;sortService;sortAscSmallIcon=de.uEm;
1sortDescSmallIcon=de.wan;constructor(t,n){super(),this.localization=t,this.sortService=n}get sortedAsc(){const t=this.descriptor;return t&&(!t.dir||"asc"===t.dir)}get sortedDesc(){const t=this.descriptor;return t&&"desc"===t.dir}toggleSort(t){const n=this.service.column.field,{mode:o,allowUnsort:r}=ml(this.service.sortable),s=this.descriptor,c="multiple"===o?this.service.sort.filter(u=>u.field!==n):[];if(s&&s.dir===t){if(!r)return}else c.push({field:n,dir:t});this.sortService.sort(c),this.close()}get descriptor(){return[].concat(this.service.sort||[]).find(t=>t.field===this.service.column.field)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi),e.rXU(aa))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-columnmenu-sort"]],standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:6,consts:[["icon","sort-asc-small",3,"itemClick","text","svgIcon","selected"],["icon","sort-desc-small",3,"itemClick","text","svgIcon","selected"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-columnmenu-item",0),e.bIt("itemClick",function(){return o.toggleSort("asc")}),e.k0s(),e.j41(1,"kendo-treelist-columnmenu-item",1),e.bIt("itemClick",function(){return o.toggleSort("desc")}),e.k0s()),2&n&&(e.Y8G("text",o.localization.get("sortAscending"))("svgIcon",o.sortAscSmallIcon)("selected",o.sortedAsc),e.R7$(),e.Y8G("text",o.localization.get("sortDescending"))("svgIcon",o.sortDescSmallIcon)("selected",o.sortedDesc))},dependencies:[wi],encapsulation:2})}return i})(),Ol=(()=>{class i{popupService;localization;service;cdr;standalone=!0;column;settings={};sort;filter;sortable=!0;columnMenuTemplate;expandedFilter=!1;expandedColumns=!1;moreVerticalIcon=de.DeK;popupRef;closeSubscription;constructor(t,n,o,r){this.popupService=t,this.localization=n,this.service=o,this.cdr=r,this.closeSubscription=o.closeMenu.subscribe(this.close.bind(this))}get isActive(){return this.hasFilter&&Co(this.filter,this.column.field).length>0||!this.sortable&&this.hasSort&&this.sort.find(t=>t.field===this.column.field)}get hasFilter(){return kc(this.settings,this.column)}get hasSort(){return Rc(this.settings,this.column)}get hasColumnChooser(){return yc(this.settings)}get hasLock(){return Ic(this.settings,this.column)}ngOnChanges(){this.service.column=this.column,this.service.sort=this.sort,this.service.filter=this.filter,this.service.sortable=this.sortable}ngOnDestroy(){this.close(),this.closeSubscription.unsubscribe()}toggle(t,n,o){t.preventDefault(),this.expandedFilter=!this.hasColumnChooser,this.expandedColumns=!this.hasFilter,this.popupRef=this.popupService.open(n,o,this.popupRef,"k-grid-columnmenu-popup k-column-menu")}close(){this.popupService.destroy(),this.popupRef=null,this.cdr.markForCheck()}onColumnsExpand(){this.expandedColumns=!0,this.expandedFilter=!1}onFilterExpand(){this.expandedFilter=!0,this.expandedColumns=!1}static \u0275fac=function(n){return new(n||i)(e.rXU(mo),e.rXU(H.Pi),e.rXU(Hc),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-column-menu"]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-grid-column-menu-standalone",o.standalone)},inputs:{standalone:"standalone",column:"column",settings:"settings",sort:"sort",filter:"filter",sortable:"sortable",columnMenuTemplate:"columnMenuTemplate"},standalone:!0,features:[e.Jv_([Hc]),e.OA$,e.aNF],decls:7,vars:5,consts:[["anchor",""],["template",""],["defaultTemplate",""],["href","#","tabindex","-1",1,"k-grid-column-menu","k-grid-header-menu",3,"click","ngClass"],["name","more-vertical",3,"svgIcon"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"service",4,"ngIf"],[3,"service","expanded","expand",4,"ngIf"],[3,"service"],[3,"expand","service","expanded"]],template:function(n,o){if(1&n){const r=e.RV6();e.j41(0,"a",3,0),e.bIt("click",function(c){e.eBV(r);const u=e.sdS(1),g=e.sdS(4);return e.Njj(o.toggle(c,u,g))}),e.nrm(2,"kendo-icon-wrapper",4),e.k0s(),e.DNE(3,rm,1,5,"ng-template",null,1,e.C5r)(5,cm,4,4,"ng-template",null,2,e.C5r)}2&n&&(e.Y8G("ngClass",e.eq3(3,im,o.isActive)),e.BMQ("title",o.localization.get("columnMenu")),e.R7$(2),e.Y8G("svgIcon",o.moreVerticalIcon))},dependencies:[M.YU,A.QK,M.T3,M.bT,Dl,wl,yl,Il],encapsulation:2})}return i})(),xl=(()=>{class i{filterService;popupService;localization;filterIcon=de.Sj_;column;filter;filterLabel;popupRef;constructor(t,n,o){this.filterService=t,this.popupService=n,this.localization=o,this.filterLabel=this.localization.get("filter")}get hasFilters(){return Co(this.filter,(this.column||{}).field).length>0}toggle(t,n){return this.popupRef=this.popupService.open(t,n,this.popupRef),!1}close(){this.popupService.destroy()}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(mo),e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-menu"]],inputs:{column:"column",filter:"filter"},standalone:!0,features:[e.aNF],decls:5,vars:4,consts:[["anchor",""],["template",""],["href","#",1,"k-grid-filter-menu","k-grid-header-menu",3,"click"],["name","filter",3,"svgIcon"],[3,"close","column","filter"]],template:function(n,o){if(1&n){const r=e.RV6();e.j41(0,"a",2,0),e.bIt("click",function(){e.eBV(r);const c=e.sdS(1),u=e.sdS(4);return e.Njj(o.toggle(c,u))}),e.nrm(2,"kendo-icon-wrapper",3),e.k0s(),e.DNE(3,pm,1,2,"ng-template",null,1,e.C5r)}2&n&&(e.AVh("k-active",o.hasFilters),e.BMQ("title",o.filterLabel),e.R7$(2),e.Y8G("svgIcon",o.filterIcon))},dependencies:[A.QK,ha],encapsulation:2})}return i})(),wC=(()=>
1{class i{sub=new K.y;setState=!0;constructor(t,n,o,r,s){this.sub=o.changes.subscribe(c=>{if(!this.setState)return void(this.setState=!0);const u=c.sender.view;let g;Vn.loadView({fields:Object.assign({},u.fieldAccessor(),{hasFooter:!1,pageable:!1,isVirtual:!1}),loaded:u.loaded,selectionState:u.selectionState}).subscribe(V=>{V&&(g=V.data.length)});const b=g===o.state.length,k=0===o.state.length,D=!k&&!b;b&&!0!==t.checkedState?t.checkedState=!0:D&&"indeterminate"!==t.checkedState?t.checkedState="indeterminate":k&&!1!==t.checkedState&&(t.checkedState=!1),r.detectChanges()}),["pointerdown","keydown"].forEach(c=>this.sub.add(s.listen(n.nativeElement,c,u=>{const g=u.key&&" "===u.key;(!(0,v.Wo)(u.key)||g)&&(this.setState=!1)})))}ngOnDestroy(){this.sub&&this.sub.unsubscribe()}static \u0275fac=function(n){return new(n||i)(e.rXU(je.$W),e.rXU(e.aKT),e.rXU(Rn),e.rXU(e.gRc),e.rXU(e.sFG))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListSelectAllCheckbox",""]],standalone:!0})}return i})();const Ca=(...i)=>Object.assign.apply(null,[{}].concat(i)),qc=(i,a)=>i.parent===a.parent||Dd(a)&&qc(i,a.parent),LC=Ed(({draggable:i})=>["column","columnGroup"].indexOf(i.context.type)>=0,({draggable:i})=>i.context.column.reorderable,({draggable:i})=>!Dd(i.context.column),({draggable:i,target:a})=>i.element.nativeElement!==a.element.nativeElement,({draggable:i,target:a})=>qc(i.context.column,a.context.column),so(({draggable:i})=>!Dt(i.context.column.locked)&&(({parent:i})=>!Dt(i))(i.context.column)&&i.context.lastColumn),({draggable:i,target:a})=>!1!==i.context.column.lockable||i.context.column.isLocked===a.context.column.isLocked);let Ml=(()=>{class i{popupService;hint;cue;reorderService;sortService;selectionService;localization;cd;totalColumnLevels;columns=[];scrollable;filterable;sort=new Array;filter;sortable=!1;lockedColumnsCount=0;resizable=!1;reorderable=!1;columnMenu=!1;columnMenuTemplate;totalColumnsCount=0;totalColumns;sortedFields={};get headerClass(){return!this.scrollable}hostClass=!0;get sortableLabel(){return this.localization.get("sortable")}get columnMenuSettings(){return this.columnMenu}dropTargets=new e.rOR;get unlockedColumnsCount(){return this.totalColumnsCount-this.lockedColumnsCount-this.columns.length}sortAscSmallIcon=de.uEm;sortDescSmallIcon=de.wan;subscription=new K.y;targetSubscription;_leafColumns;constructor(t,n,o,r,s,c,u,g){this.popupService=t,this.hint=n,this.cue=o,this.reorderService=r,this.sortService=s,this.selectionService=c,this.localization=u,this.cd=g}getColumnComponent(t){return t}sortColumn(t,n,o){const r=n?n.target:null;return t.headerTemplateRef&&r!==o&&Xs(r,$d,o)?"checkbox"===r.type:(this.sortService.sort(this.toggleSort(t)),!1)}onHeaderKeydown(t,n){!this.sortable||n.defaultPrevented||!1===t.sortable||n.keyCode===v.D$.Enter&&this.sortService.sort(this.toggleSort(t))}showSortNumbering(t){const{showIndexes:n}=ml(this.sortable);return n&&this.sort&&this.sort.filter(({dir:o})=>pe(o)).length>1&&this.sortOrder(t.field)>0}sortOrder(t){return this.sort.filter(({dir:n})=>pe(n)).findIndex(n=>n.field===t)+1}sortState(t){if(!this.isSortable(t))return;const n=this.sortDescriptor(t.field);return"asc"===n.dir?"ascending":"desc"===n.dir?"descending":void 0}toggleSort(t){const{allowUnsort:n,mode:o,initialDirection:r}=ml(this.sortable,t.sortable),s=this.toggleDirection(t.field,n,r);return"single"===o?[s]:[...this.sort.filter(c=>c.field!==t.field),s]}ngAfterViewInit(){this.subscription.add(Ms(this.dropTargets).subscribe(this.attachTargets.bind(this)))}ngDoCheck(){this._leafColumns=Bn(this.columns||[]).filter(t=>!po(t))}ngOnChanges(t){const n=t.sort;n&&!n.isFirstChange()&&n.currentValue.forEach(o=>{this.sortedFields[o.field]=!0})}ngOnInit(){this.subscription.add(this.localization.changes.subscribe(()=>this.cd.markForCheck()))}ngOnDestroy(){this.targetSubscription&&this.targetSubscription.unsubscribe(),this.popupService&&this.popupService.destroy(),this.subscription.unsubscribe()}isFirstOnRow(t,n){const o=r=>r&&(this.columnsForLevel(r.level).indexOf(r)>0||o(r.parent));return 0===n&&o(t.parent)}logicalColumnIndex(t){const n=t.leafIndex;return pe(n)?n:-1}get showFilterMenu(){return!this.columnMenu&&(i=>"string"==typeof i&&i.indexOf("menu")>-1)(this.filterable)}get showFilterRow(){return Ks(this.filterable)}showColumnMenu(t){return this.columnMenu&&t.columnMenu&&(this.columnMenuTemplate||t.columnMenuTemplates.length||((i,a)=>yc(i)||Ic(i,a)||Rc(i,a)||kc(i,a))(this.columnMenu,t))}isFilterable(t){return!Ve(t.field)&&!0===t.filterable}canDrop(t,n){return this.reorderable&&LC({draggable:t,target:n})}shouldActivate(t){return this.reorderable&&t.reorderable}isSortable(t){return!Ve(t.field)&&Dt(this.sortable)&&Dt(t.sortable)}trackByIndex(t,n){return t}
1toggleDirection(t,n,o){const r=this.sortDescriptor(t),[s,c]=(i=>"asc"===i?["asc","desc"]:["desc","asc"])(o);let u=s;return r.dir===s?u=c:r.dir===c&&n&&(u=void 0),{dir:u,field:t}}columnsForLevel(t){const n=this.columns?this.columns.filter(o=>o.level===t):[];return jn(Bn(n))}isColumnGroupComponent(t){return po(t)}get columnLevels(){return new Array((this.totalColumnLevels||0)+1)}renderSelectAll(t){return t.isCheckboxColumn&&t.showSelectAll&&!t.headerTemplateRef&&this.selectionService.enableMultiple}selectAllChange(t){this.selectionService.toggleAll(t)}sortDescriptor(t){return this.sort.find(n=>n.field===t)||{field:t}}get leafColumns(){return this._leafColumns}messageFor(t){return this.localization.get(t)}attachTargets(){this.targetSubscription&&this.targetSubscription.unsubscribe(),this.targetSubscription=new K.y;const t=(0,we.h)(...this.dropTargets.map(r=>r.enter)),n=(0,we.h)(...this.dropTargets.map(r=>r.leave)),o=(0,we.h)(...this.dropTargets.map(r=>r.drop));this.targetSubscription.add(t.pipe((0,Te.M)(({target:r,draggable:s})=>{const c=Dt(r.context.column.isLocked),u=Dt(s.context.column.isLocked);(this.lockedColumnsCount>0||c||u)&&this.hint.toggleLock(c)}),(0,ae.p)(({draggable:r,target:s})=>this.canDrop(r,s)),(0,Oe.n)(this.trackMove.bind(this,n,o)),(0,Me.T)(r=>Ca(r,{before:this.calculateBefore(r),changeContainer:r.changeContainer})),(0,Me.T)(this.normalizeTarget.bind(this)),(0,Te.M)(this.enter.bind(this)),(0,Oe.n)(r=>o.pipe((0,Me.T)(()=>r),(0,L.Q)(n.pipe((0,Te.M)(this.leave.bind(this))))))).subscribe(this.drop.bind(this)))}normalizeTarget(t){let n=t.target;const o=n.context.column.parent;if(o&&o.isSpanColumn){const r=this.dropTargets.toArray(),s=r.find(g=>g.context.column.parent===o),c=r.indexOf(s);n=r[c+(t.before?0:o.childColumns.length-1)]}return Ca(t,{target:n})}trackMove(t,n,o){const r=o.target.context.column,s=this.columnsForLevel(r.level),c=s.indexOf(r),g=o.draggable.context.column.isLocked!==r.isLocked;return g&&(r.locked?c===s.length-1:0===c)?o.draggable.drag.pipe((0,L.Q)(t),(0,L.Q)(n),(0,Me.T)(({mouseEvent:b})=>Ca({changeContainer:!0},o,{mouseEvent:b}))):(0,le.of)(Ca({changeContainer:g},o))}calculateBefore({draggable:t,target:n,mouseEvent:o,changeContainer:r=!1}){const s=n.element.nativeElement;let c=!1;if(r){const{left:u}=Hd(s);c=u+s.offsetWidth/2>o.pageX,this.localization.rtl&&(c=!c)}else c=((i,a)=>!!(4&a.compareDocumentPosition(i)))(t.element.nativeElement,s);return c}enter({target:t,before:n}){this.hint.enable(),this.localization.rtl&&(n=!n),this.cue.position(((i,a)=>{const t=Hd(i),{offsetWidth:n,offsetHeight:o}=i;return{left:t.left+(a?0:n),top:t.top,height:o}})(t.element.nativeElement,n))}leave(){this.hint.disable(),this.cue.hide()}drop({draggable:t,target:n,before:o,changeContainer:r}){this.reorderService.reorder({before:o,changeContainer:r,source:t.context.column,target:n.context.column})}static \u0275fac=function(n){return new(n||i)(e.rXU(mo),e.rXU(qs),e.rXU(Qs),e.rXU(Zs),e.rXU(aa),e.rXU(Rn),e.rXU(H.Pi),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListHeader",""]],viewQuery:function(n,o){if(1&n&&e.GBs(Ec,5),2&n){let r;e.mGM(r=e.lsd())&&(o.dropTargets=r)}},hostVars:4,hostBindings:function(n,o){2&n&&e.AVh("k-grid-header",o.headerClass)("k-table-thead",o.hostClass)},inputs:{totalColumnLevels:"totalColumnLevels",columns:"columns",scrollable:"scrollable",filterable:"filterable",sort:"sort",filter:"filter",sortable:"sortable",lockedColumnsCount:"lockedColumnsCount",resizable:"resizable",reorderable:"reorderable",columnMenu:"columnMenu",columnMenuTemplate:"columnMenuTemplate",totalColumnsCount:"totalColumnsCount",totalColumns:"totalColumns"},standalone:!0,features:[e.OA$,e.aNF],attrs:um,decls:2,vars:2,consts:[["link",""],["role","row","kendoTreeListLogicalRow","",3,"logicalRowIndex","logicalSlaveRow","logicalCellsCount","totalColumns","logicalSlaveCellsCount",4,"ngFor","ngForOf"],["kendoTreeListFilterRow","","kendoTreeListLogicalRow","",3,"columns","filter","lockedColumnsCount","totalColumns","logicalRowIndex","logicalSlaveRow","logicalCellsCount","logicalSlaveCellsCount",4,"ngIf"],["role","row","kendoTreeListLogicalRow","",3,"logicalRowIndex","logicalSlaveRow","logicalCellsCount","totalColumns","logicalSlaveCellsCount"],["ngFor","",3,"ngForOf","ngForTrackBy"],["kendoTreeListLogicalCell","","role","columnheader","aria-selected","false","kendoDropTarget","","kendoDraggable","","kendoDraggableColumn","","class","k-header k-table-th",3,"logicalRowIndex","logicalColIndex","colSpan","rowSpan","enableDrag","context","k-filterable","k-first","ngClass","ngStyle","keydown",4,"ngIf"],["kendoTreeListLogicalCell","","kendoDropTarget","","kendoDraggable","","kendoDraggableColumn","","class","k-header k-table-th",3,"logicalRowIndex","logicalColIndex","rowSpan","colSpan","enableDrag","context","k-first","k-filterable","ngClass","ngStyle",4,"ngIf"],["kendoTreeListLogicalCell","","role","columnheader","aria-selected","false","kendoDropTarget","","kendoDraggable","","kendoDraggableColumn","",1,"k-header","k-table-th",3,"keydown","logicalRowIndex","logicalColIndex","colSpan","rowSpan","enableDrag","context","ngClass","ngStyle"],[3,"ngIf"],["kendoTreeListColumnHandle","","kendoDraggable","","class","k-column-resizer",3,"column","columns",4,"ngIf"],[3,"column","filter",4,"ngIf"],[3,"standalone","settings","column","columnMenuTemplate","sort","filter","sortable",4,"ngIf"],[3,"templateContext"],[3,"column","filter"],[3,"standalone","settings","column","columnMenuTemplate","sort","filter","sortable"],[1,"k-cell-inner"],[1,"k-link",3,"click"],[4,"ngIf"],["role","note",3,"name","svgIcon",4,"ngIf"],["class","k-sort-order",4,"ngIf"],[1,"k-column-title"],["role","note",3,"name","svgIcon"],[1,"k-sort-order"],["kendoTreeListFocusable","","kendoTreeListSelectAllCheckbox","",3,"checkedStateChange","inputAttributes"],["kendoTreeListColumnHandle","","kendoDraggable","",1,"k-column-resizer",3,"column","columns"],["kendoTreeListLogicalCell","","kendoDropTarget","","kendoDraggable","","kendoDraggableColumn","",1,"k-header","k-table-th",3,"logicalRowIndex","logicalColIndex","rowSpan","colSpan","enableDrag","context","ngClass","ngStyle"],[3,"standalone","settings","column","columnMenuTemplate",4,"ngIf"],[3,"standalone","settings","column","columnMenuTemplate"],["kendoTreeListFilterRow","","kendoTreeListLogicalRow","",3,"columns","filter","lockedColumnsCount","totalColumns","logicalRowIndex","logicalSlaveRow","logicalCellsCount","logicalSlaveCellsCount"]],template:function(n,o){1&n&&e.DNE(0,Gm,2,7,"tr",1)(1,Am,1,8,"tr",2),2&n&&(e.Y8G("ngForOf",o.columnLevels),e.R7$(),e.Y8G("ngIf",o.showFilterRow))},dependencies:[M.pM,ll,M.bT,sa,Ec,v.T5,oC,M.YU,M.B3,xl,Ol,v.b2,A.QK,$n,Yc,jc,je.$W,wC],encapsulation:2})}return i})(),Qc=(()=>{class i{elem;renderer;ctx;hostRole="toolbar";context={};set position(t){this.context.position=t}navigable;get toolbarTemplateRef(){return this.ctx.treelist.toolbarTemplate?this.ctx.treelist.toolbarTemplate.templateRef:void 0}subs=new K.y;navigationService;constructor(t,n,o){this.elem=t,this.renderer=n,this.ctx=o,this.navigationService=this.ctx[`${this.elem.nativeElement.getAttribute("position")}ToolbarNavigation`]}ngAfterViewInit(){this.subs.add(this.renderer.listen(this.elem.nativeElement,"keydown",n=>
1this.onKeyDown(n)))}ngOnDestroy(){this.subs.unsubscribe()}onKeyDown(t){if(this.navigable&&(0,v.nm)()&&this.navigationService.navigableElements.length){const n=t.keyCode;n!==v.D$.ArrowLeft&&n!==v.D$.ArrowRight||(t.preventDefault(),this.changeFocusedItem(n===v.D$.ArrowLeft?-1:1))}}changeFocusedItem(t){this.navigationService.currentActiveIndex+=t;const n=this.navigationService.currentActiveIndex<0;(n||this.navigationService.currentActiveIndex>=this.navigationService.navigableElements.length)&&(this.navigationService.currentActiveIndex=n?this.navigationService.navigableElements.length-1:0),this.navigationService.updateFocus()}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(fo))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-toolbar"]],hostVars:1,hostBindings:function(n,o){2&n&&e.BMQ("role",o.hostRole)},inputs:{position:"position",navigable:"navigable"},standalone:!0,features:[e.aNF],decls:1,vars:1,consts:[[4,"ngIf"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,o){1&n&&e.DNE(0,Bm,1,2,null,0),2&n&&e.Y8G("ngIf",o.toolbarTemplateRef)},dependencies:[M.bT,M.T3],encapsulation:2})}return i})(),va=(()=>{class i extends H.EX{groupPanelEmpty;noRecords;pagerLabel;pagerInputLabel;pagerFirstPage;pagerLastPage;pagerPreviousPage;pagerNextPage;pagerPage;pagerPageNumberInputTitle;pagerItemsPerPage;pagerOf;pagerItemsTotal;pagerSelectPage;filter;filterInputLabel;filterCellOperatorLabel;booleanFilterCellLabel;filterEqOperator;filterNotEqOperator;filterIsNullOperator;filterIsNotNullOperator;filterIsEmptyOperator;filterIsNotEmptyOperator;filterStartsWithOperator;filterContainsOperator;filterNotContainsOperator;filterEndsWithOperator;filterGteOperator;filterGtOperator;filterLteOperator;filterLtOperator;filterIsTrue;filterIsFalse;filterBooleanAll;filterAfterOrEqualOperator;filterAfterOperator;filterBeforeOperator;filterBeforeOrEqualOperator;filterFilterButton;filterClearButton;filterAndLogic;filterOrLogic;loading;columnMenu;columns;lock;unlock;sortable;sortAscending;sortDescending;sortedAscending;sortedDescending;sortedDefault;columnsApply;columnsReset;topToolbarLabel;bottomToolbarLabel;dragRowHandleLabel;selectRowCheckboxLabel;selectAllRowsCheckboxLabel;static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(i)))(o||i)}})();static \u0275dir=e.FsC({type:i,inputs:{groupPanelEmpty:"groupPanelEmpty",noRecords:"noRecords",pagerLabel:"pagerLabel",pagerInputLabel:"pagerInputLabel",pagerFirstPage:"pagerFirstPage",pagerLastPage:"pagerLastPage",pagerPreviousPage:"pagerPreviousPage",pagerNextPage:"pagerNextPage",pagerPage:"pagerPage",pagerPageNumberInputTitle:"pagerPageNumberInputTitle",pagerItemsPerPage:"pagerItemsPerPage",pagerOf:"pagerOf",pagerItemsTotal:"pagerItemsTotal",pagerSelectPage:"pagerSelectPage",filter:"filter",filterInputLabel:"filterInputLabel",filterCellOperatorLabel:"filterCellOperatorLabel",booleanFilterCellLabel:"booleanFilterCellLabel",filterEqOperator:"filterEqOperator",filterNotEqOperator:"filterNotEqOperator",filterIsNullOperator:"filterIsNullOperator",filterIsNotNullOperator:"filterIsNotNullOperator",filterIsEmptyOperator:"filterIsEmptyOperator",filterIsNotEmptyOperator:"filterIsNotEmptyOperator",filterStartsWithOperator:"filterStartsWithOperator",filterContainsOperator:"filterContainsOperator",filterNotContainsOperator:"filterNotContainsOperator",filterEndsWithOperator:"filterEndsWithOperator",filterGteOperator:"filterGteOperator",filterGtOperator:"filterGtOperator",filterLteOperator:"filterLteOperator",filterLtOperator:"filterLtOperator",filterIsTrue:"filterIsTrue",filterIsFalse:"filterIsFalse",filterBooleanAll:"filterBooleanAll",filterAfterOrEqualOperator:"filterAfterOrEqualOperator",filterAfterOperator:"filterAfterOperator",filterBeforeOperator:"filterBeforeOperator",filterBeforeOrEqualOperator:"filterBeforeOrEqualOperator",filterFilterButton:"filterFilterButton",filterClearButton:"filterClearButton",filterAndLogic:"filterAndLogic",filterOrLogic:"filterOrLogic",loading:"loading",columnMenu:"columnMenu",columns:"columns",lock:"lock",unlock:"unlock",sortable:"sortable",sortAscending:"sortAscending",sortDescending:"sortDe
1scending",sortedAscending:"sortedAscending",sortedDescending:"sortedDescending",sortedDefault:"sortedDefault",columnsApply:"columnsApply",columnsReset:"columnsReset",topToolbarLabel:"topToolbarLabel",bottomToolbarLabel:"bottomToolbarLabel",dragRowHandleLabel:"dragRowHandleLabel",selectRowCheckboxLabel:"selectRowCheckboxLabel",selectAllRowsCheckboxLabel:"selectAllRowsCheckboxLabel"},features:[e.Vt3]})}return i})(),BC=(()=>{class i extends va{service;constructor(t){super(),this.service=t}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListLocalizedMessages",""]],standalone:!0,features:[e.Jv_([{provide:va,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3]})}return i})();const Zc=(i,a)=>pt(i,Kt("k-grid-edit-cell"))&&pt(i,qe("kendo-treelist"))===a;let an=(()=>{class i{supportService;wrapper;changeNotification;editService;filterService;pdfService;responsiveService;renderer;excelService;ngZone;scrollSyncService;domEvents;columnResizingService;changeDetectorRef;columnReorderService;columnInfoService;navigationService;sortService;scrollRequestService;expandStateService;optionChanges;selectionService;localization;ctx;rowReorderService;ariaLabel;set data(t){this.view.reset(),this._data=t,this.loadedData=null,this.unsubscribeDataLoaded(),(0,rt.A)(t)?this.dataLoadedSubscription=t.subscribe(this.dataLoaded):this.dataLoaded(t)}get data(){return this.loadedData}pageSize=10;height;rowHeight;get skip(){return this._skip}set skip(t){"number"==typeof t&&t>=0&&(this._skip=t,this.view.clear())}scrollable="scrollable";set sort(t){(i=>Array.isArray(i))(t)&&(this._sort=t)}get sort(){return this._sort}trackBy=nl;filter;virtualColumns=!1;get showTopToolbar(){return this.toolbarTemplate&&["top","both"].indexOf(this.toolbarTemplate.position)>-1}get showBottomToolbar(){return this.toolbarTemplate&&["bottom","both"].indexOf(this.toolbarTemplate.position)>-1}get isLocked(){return this.lockedLeafColumns.length>0}get showPager(){return!this.isVirtual&&!1!==this.pageable}get marqueeSelection(){return this.selectionService.enableMarquee}filterable=!1;sortable=!1;pageable=!1;get normalizedPageableSettings(){return(i=>(({buttonCount:i=10,info:a=!0,type:t="numeric",pageSizes:n=!1,previousNext:o=!0,responsive:r=!0})=>({buttonCount:i,info:a,pageSizes:!0===n?[5,10,20]:n,previousNext:o,type:t,responsive:r}))(!0===i?{}:i))(this.pageable)}navigable=!1;set navigatable(t){this.navigable=t}get navigatable(){return this.navigable}autoSize=!1;set rowClass(t){if("function"!=typeof t)throw new Error(`rowClass must be a function, but received ${JSON.stringify(t)}.`);this._rowClass=t}get rowClass(){return this._rowClass}get activeCell(){return this.navigationService.activeCell}get activeRow(){return this.navigationService.activeRow}resizable=!1;reorderable=!1;loading=!1;columnMenu=!1;hideHeader=!1;set idField(t){this.idGetter="function"==typeof t?t:(0,Pe.oK)(t),this.editService.idGetter=this.idGetter}set selectable(t){this.selectionService.settings=t}set isSelected(t){if("function"!=typeof t&&(0,e.naY)())throw new Error(`isSelected must be a function, but received "${JSON.stringify(t)}".`);this.selectionService.isSelected=t}set rowReorderable(t){this._rowReorderable=t,t?this.rowReorderSubscription=this.rowReorderService.rowReorder.subscribe(n=>{(0,v.SF)(this.rowReorder)&&this.ngZone.run(()=>{this.rowReorder.emit(n)})}):this.rowReorderSubscription?.unsubscribe()}get rowReorderable(){return this._rowReorderable}selectionChange=new e.bkB;filterChange=new e.bkB;pageChange=new e.bkB;sortChange=new e.bkB;dataStateChange=new e.bkB;edit=new e.bkB;
1cancel=new e.bkB;save=new e.bkB;remove=new e.bkB;add=new e.bkB;cellClose=new e.bkB;cellClick=new e.bkB;pdfExport=new e.bkB;excelExport=new e.bkB;columnResize=new e.bkB;columnReorder=new e.bkB;columnVisibilityChange=new e.bkB;columnLockedChange=new e.bkB;scrollBottom=new e.bkB;contentScroll=new e.bkB;expandEvent=new e.bkB;collapseEvent=new e.bkB;expandStateChange=new e.bkB;rowReorder=new e.bkB;columnOrderChange=new e.bkB;set columnsRef(t){this._columnsRef=t,pe(t)&&this.loadColumns(t)}get columnsRef(){return this._columnsRef}columns=new e.rOR;get dir(){return this.direction}hostClasses=!0;get lockedClasses(){return this.lockedLeafColumns.length>0}get virtualClasses(){return this.isVirtual}get noScrollbarClass(){return 0===this.scrollbarWidth}noRecordsTemplateChildren;get noRecordsTemplate(){return this._customNoRecordsTemplate?this._customNoRecordsTemplate:this.noRecordsTemplateChildren?this.noRecordsTemplateChildren.first:void 0}set noRecordsTemplate(t){this._customNoRecordsTemplate=t}pagerTemplateChildren;get pagerTemplate(){return this._customPagerTemplate?this._customPagerTemplate:this.pagerTemplateChildren?this.pagerTemplateChildren.first:void 0}set pagerTemplate(t){this._customPagerTemplate=t}toolbarTemplateChildren;get toolbarTemplate(){return this._customToolbarTemplate?this._customToolbarTemplate:this.toolbarTemplateChildren?this.toolbarTemplateChildren.first:void 0}set toolbarTemplate(t){this._customToolbarTemplate=t}columnMenuTemplates;lockedHeader;header;footer=new e.rOR;ariaRoot;dragTargetContainer;dropTargetContainer;get scrollbarWidth(){return this.supportService.scrollbarWidth}get headerPadding(){if(fi())return"";const t=Math.max(0,this.scrollbarWidth)+"px";return`0 ${this.rtl?0:t} 0 ${this.rtl?t:0}`}columnMenuOptions;columnList;columnsContainer=new Vs(()=>this.columnList.filterHierarchy(t=>(fi()||(t.matchesMedia=this.matchesMedia(t)),t.isVisible)));get showLoading(){return this.loading||(0,rt.A)(this._data)&&!this.loadedData||this.excelService.loading}get showFooter(){return this.columnsContainer.hasFooter}get ariaRowCount(){return this.totalColumnLevels+1+this.totalCount}get ariaColCount(){return this.columnsContainer.leafColumnsToRender.length}get ariaMultiselectable(){if(this.selectionService.enabled)return this.selectionService.enableMultiple}get navigation(){return this.navigationService}get isVirtual(){return"virtual"===this.scrollable}get isScrollable(){return"none"!==this.scrollable}get visibleColumns(){return this.columnsContainer.allColumns}get lockedColumns(){return this.columnsContainer.lockedColumns}get nonLockedColumns(){return this.columnsContainer.nonLockedColumns}get lockedLeafColumns(){return this.columnsContainer.lockedLeafColumns}get nonLockedLeafColumns(){return this.columnsContainer.nonLockedLeafColumns}get leafColumns(){return this.columnsContainer.leafColumns}get totalColumnLevels(){return this.columnsContainer.totalLevels}get headerColumns(){return this.virtualColumns&&!this.pdfService.exporting?this.viewportColumns:this.nonLockedColumns}get headerLeafColumns(){return this.virtualColumns&&!this.pdfService.exporting?this.leafViewportColumns:this.nonLockedLeafColumns}get lockedWidth(){return Sn(this.lockedLeafColumns.toArray()).reduce((t,n)=>t+(n.width||0),0)}get nonLockedWidth(){if(!this.rtl&&this.lockedLeafColumns.length||this.virtualColumns)return this.virtualColumns?this.leafViewportColumns.reduce((t,n)=>t+(n.width||0),0):this.columnsContainer.unlockedWidth}get columnMenuTemplate(){const t=this.columnMenuTemplates.first;return t?t.templateRef:null}get totalCount(){return this.view.totalRows}set fetchChildren(t){this._fetchChildren=t}get fetchChildren(){return this._fetchChildren}set hasChildren(t){this._hasChildren=t}get hasChildren(){return this._hasChildren}set isExpanded(t){this.expandStateService.isExpanded=t||Kd,this.expandIcons=!!t}idGetter=(0,Pe.oK)(void 0);localEditService=new il;view;expandIcons;ariaRootId=`k-${(0,v.Os)()}`;dataChanged=!1;loadedData;_fetchChildren;_hasChildren=()=>!1;subscriptions=new K.y;dataLoadedSubscription;focusElementSubscription;rowReorderSubscription;detachElementEventHandlers;rtl=!1;shouldGenerateColumns=!0;direction;_data=[];_sort=new Array;_skip=0;_columnsRef;cachedWindowWidth=0;_customNoRecordsTemplate;_customPagerTemplate;_customToolbarTemplate;leafViewportColumns;viewportColumns;pageChangeTimeout;_rowReorderable=!1;constructor(t,n,o,r,s,c,u,g,b,k,D,V,U,B,De,et,Ht,Xt,Jn,qn,Qn,Zn,Dn,ei,ti){this.supportService=t,this.wrapper=n,this.changeNotification=o,this.editService=r,this.filterService=s,this.pdfService=c,this.responsiveService=u,this.renderer=g,this.excelService=b,this.ngZone=k,this.scrollSyncService=D,this.domEvents=V,this.columnResizingService=U,this.changeDetectorRef=B,this.columnReorderService=De,this.columnInfoService=et,this.navigationService=Ht,this.sortService=Xt,this.scrollRequestService=Jn,this.expandStateService=qn,this.optionChanges=Qn,this.selectionService=Zn,this.localization=Dn,this.ctx=ei,this.rowReorderService=ti,(0,Wr.$j)(Hg),this.subscriptions.add(Dn.changes.subscribe(({rtl:Ae})=>{this.rtl=Ae,this.direction=this.rtl?"rtl":"ltr"})),this.view=new Vn(this.viewFieldAccessor.bind(this),this.expandStateService,this.editService,this.selectionService),this.selectionService.init(this),this.ctx.treelist=this,this.subscriptions.add(this.selectionService.changes.subscribe(Ae=>{(0,v.SF)(this.selectionChange)&&this.ngZone.run(()=>{Ae.sender=this,this.selectionChange.emit(Ae),this.selectionService.updateSelectedState(),this.changeDetectorRef.markForCheck()})})),this.columnInfoService.init(this.columnsContainer,()=>this.columnList),this.subscriptions.add(this.columnInfoService.visibilityChange.subscribe(Ae=>{this.columnVisibilityChange.emit(new _f(Ae)),this.changeDetectorRef.markForCheck()}
1)),this.subscriptions.add(this.columnInfoService.lockedChange.subscribe(Ae=>{this.columnLockedChange.emit(new ec(Ae)),this.changeDetectorRef.markForCheck()})),this.subscriptions.add((0,we.h)(this.optionChanges.columns,this.optionChanges.options).subscribe(()=>{this.changeDetectorRef.markForCheck()})),this.subscriptions.add(this.filterService.changes.subscribe(Ae=>{this.filterChange.emit(Ae)})),this.subscriptions.add(this.sortService.changes.subscribe(Ae=>{this.sortChange.emit(Ae)})),this.attachStateChangesEmitter(),this.attachEditHandlers(),this.attachDomEventHandlers(),this.subscriptions.add(this.pdfService.exportClick.subscribe(this.emitPDFExportEvent.bind(this))),this.subscriptions.add(this.excelService.exportClick.subscribe(this.saveAsExcel.bind(this))),this.subscriptions.add(this.excelService.loadingChange.subscribe(()=>{this.changeDetectorRef.detectChanges()})),this.columnsContainerChange(),this.handleColumnResize(),this.columnList=new ea(this.columns),this.subscriptions.add(this.columnReorderService.changes.subscribe(this.reorder.bind(this))),this.subscriptions.add(this.columnInfoService.columnRangeChange.subscribe(this.onColumnRangeChange.bind(this))),this.subscriptions.add(this.expandStateService.changes.subscribe(Ae=>{Ae.expand?this.expandEvent.emit(Ae):this.collapseEvent.emit(Ae),Ae.isDefaultPrevented()||(this.changeDetectorRef.markForCheck(),this.view.clear(),this.expandStateChange.emit(Ae)),this.rowReorderable&&this.ngZone.onStable.pipe((0,O.s)(1)).subscribe(()=>{this.notifyReorderContainers()})})),this.subscriptions.add(this.view.childrenLoaded.subscribe(()=>{this.changeDetectorRef.detectChanges()})),this.subscriptions.add(this.view.resetPage.subscribe(()=>{this.skip>0&&(0,v.SF)(this.pageChange)&&(this.pageChangeTimeout=setTimeout(()=>{this.pageChange.emit({skip:0,take:this.pageSize})},0)),this.skip=0})),this.dataLoaded=this.dataLoaded.bind(this),this.editService.idGetter=this.idGetter}viewFieldAccessor(){return{fetchChildren:this.fetchChildren,hasChildren:this.hasChildren,idGetter:this.idGetter,skip:this.skip,pageSize:this.pageSize,pageable:this.pageable,isVirtual:this.isVirtual,data:this.loadedData,hasFooter:this.columnsContainer.hasFooter}}onDataChange(){this.autoGenerateColumns(),this.changeNotification.notify(),this.pdfService.dataChanged.emit(),this.updateNavigationMetadata()}ngOnChanges(t){this.lockedLeafColumns.length&&(0,v.TI)(["pageSize","skip","sort"],t)&&this.changeNotification.notify(),(0,v.TI)(["pageSize","scrollable","virtualColumns"],t)&&this.updateNavigationMetadata(),(0,v.Hq)("virtualColumns",t)&&(this.viewportColumns=this.leafViewportColumns=null),(0,v.Hq)("height",t,!1)&&this.renderer.setStyle(this.wrapper.nativeElement,"height",`${this.height}px`),(0,v.Hq)("filterable",t)&&this.lockedColumns.length&&this.syncHeaderHeight(this.ngZone.onStable.asObservable().pipe((0,O.s)(1))),(0,v.TI)(["columnMenu","sortable","filterable"],t,!1)&&(this.columnMenuOptions=this.columnMenu&&Object.assign({filter:!!this.filterable,sort:!!this.sortable},this.columnMenu)),(0,v.Hq)("scrollable",t)&&this.isScrollable&&this.ngZone.onStable.pipe((0,O.s)(1)).subscribe(()=>this.attachScrollSync())}ngAfterViewInit(){this.attachScrollSync(),this.attachElementEventHandlers(),this.updateNavigationMetadata(),this.applyAutoSize(),this.subscriptions.add(this.pagerTemplateChildren.changes.subscribe(()=>this.changeDetectorRef.markForCheck()));const t=this.wrapper?.nativeElement?.querySelector("kendo-toolbar");t&&this.renderer.addClass(t,"k-grid-toolbar")}ngAfterContentChecked(){this.dataChanged&&(this.dataChanged=!1,this.onDataChange()),this.columnsContainer.refresh(),this.verifySettings()}ngAfterContentInit(){pe(this.columnsRef)&&this.loadColumns(this.columnsRef),this.shouldGenerateColumns=!this.columns.length,this.autoGenerateColumns(),this.columnList=new ea(this.columns),this.subscriptions.add(this.columns.changes.subscribe(()=>{this.verifySettings(),this.optionChanges.columnChanged()}))}ngOnInit(){this.navigable&&this.navigationService.init(this.navigationMetadata())}ngOnDestroy(){this.subscriptions.unsubscribe(),this.detachElementEventHandlers&&this.detachElementEventHandlers(),this.focusElementSubscription&&this.focusElementSubscription.unsubscribe(),this.unsubscribeDataLoaded(),this.ngZone=null,clearTimeout(this.pageChangeTimeout)}handleReorderEvents(t,n){this.rowReorderService[n](t)}getDefaultSelectors(t){return this.rowReorderService.defaultSelectors[t]}treeListData=()=>this.view;getHintSettings(t){return this.rowReorderService[t]}get hintText(){return this.rowReorderService.getDefaultHintText(this.columnList,this.view)}attachScrollSync(){fi()||(this.header&&this.scrollSyncService.registerEmitter(this.header.n
1ativeElement,"header"),this.footer&&this.subscriptions.add(Ms(this.footer).subscribe(t=>t.map(n=>n.nativeElement).filter(pe).forEach(n=>this.scrollSyncService.registerEmitter(n,"footer")))))}editRow(t,n,o){this.editService.editRow(t,n),this.view.updateEditedState(),this.changeDetectorRef.markForCheck(),(!o||!o.skipFocus)&&this.focusEditElement(()=>`tr[data-treelist-view-index="${this.view.itemIndex(t)}"]`)}closeRow(t,n){this.editService.close(t,n),this.changeDetectorRef.markForCheck(),n?this.view.clear():this.view.updateEditedState()}addRow(t,n){if(!(t instanceof R.gE)){const r=Object.keys(t).reduce((i=>(a,t)=>(a[t]=new R.MJ(i[t]),a))(t),{});t=new R.gE(r)}if(this.isVirtual&&!n&&this.skip){const r=this.navigationService.viewport.firstItemIndex;r!==this.skip&&(this.skip=r,this.pageChange.emit({skip:this.skip,take:this.pageSize}))}this.editService.addRow(n,t),this.changeDetectorRef.markForCheck(),this.view.clear(),this.focusEditElement(()=>n?`tr[data-treelist-view-index="${this.view.itemIndex(n)+1}"]`:".k-grid-add-row")}editCell(t,n,o){const r=this.columnInstance(n);this.editService.editCell(t,r,o),this.changeDetectorRef.markForCheck(),this.view.updateEditedState(),this.focusEditElement(()=>".k-grid-edit-cell")}closeCell(){return!this.editService.closeCell()}cancelCell(){this.editService.cancelCell(),this.view.updateEditedState()}isEditing(){return this.editService.isEditing()}isEditingCell(){return this.editService.isEditing()&&this.editService.isEditingCell()}saveAsPDF(){this.pdfService.save(this)}drawPDF(){const t=(()=>{let i,a;const t=new Promise((n,o)=>{i=r=>(n(r),t),a=r=>(o(r),t)});return t.resolve=i,t.reject=a,t})();return this.pdfService.draw(this,t),t}saveAsExcel(){this.excelService.save(this)}autoFitColumn(t){this.columnResizingService.autoFit(t)}autoFitColumns(t=this.columns){let n;n=t instanceof e.rOR?t.toArray():t,this.columnResizingService.autoFit(...n)}notifyPageChange(t,n){"list"===t&&!this.isVirtual||(this.skip=n.skip,this.pageSize=n.take,this.closeCell(),this.cancelCell(),this.changeDetectorRef.markForCheck(),this.pageChange.emit(n))}messageFor(t){return this.localization.get(t)}notifyScrollBottom(){"none"!==this.scrollable&&(0,v.SF)(this.scrollBottom)&&this.ngZone.run(()=>this.scrollBottom.emit({sender:this}))}focusEditElement(t){this.focusElementSubscription&&this.focusElementSubscription.unsubscribe(),this.ngZone.runOutsideAngular(()=>{this.focusElementSubscription=this.ngZone.onStable.asObservable().pipe((0,O.s)(1)).subscribe(()=>{const n=this.wrapper.nativeElement,o=t();!this.setEditFocus(n.querySelector(o))&&this.isLocked&&this.setEditFocus(n.querySelector(`.k-grid-content ${o}`)),this.focusElementSubscription=null})})}focus(){return this.assertNavigable(),this.navigationService.focusCell()}focusCell(t,n){return this.assertNavigable(),this.navigationService.focusCell(t,n)}focusNextCell(t=!0){return this.assertNavigable(),this.navigationService.focusNextCell(t)}focusPrevCell(t=!0){return this.assertNavigable(),this.navigationService.focusPrevCell(t)}scrollTo(t){this.scrollRequestService.scrollTo(t)}reorderColumn(t,n,o={before:!1}){let s=jn(this.allColumnsForLevel(t.level))[n];!s||s.isLocked&&!t.isLocked&&1===this.columnsContainer.nonLockedColumns.length||(Jr(s)&&!o.before&&(s=s.childColumns.last),this.reorder({before:o.before,source:t,target:s}))}reload(t,n){t&&(this.view.resetItem(t,n),this.changeDetectorRef.markForCheck())}updateView(){this.rowReorderable&&this.ngZone.onStable.pipe((0,O.s)(1)).subscribe(()=>{this.notifyReorderContainers()}),this.view.clear(),this.changeDetectorRef.markForCheck()}expand(t){this.expandStateService.expand(t),this.changeDetectorRef.markForCheck()}collapse(t){this.expandStateService.collapse(t),this.changeDetectorRef.markForCheck()}reorder({target:t,source:n,before:o,changeContainer:r}){this.ngZone.run(()=>{const s=jn(this.allColumnsForLevel(n.level));let c=s.indexOf(t);t.parent&&t.parent.isSpanColumn&&(c=s.indexOf(t.parent),o&&(t=t.parent));const u=s.indexOf(n);r&&(o&&0<c&&u<c?c--:!o&&u>c&&c++);const g=new $h({column:n,oldIndex:u,newIndex:c});this.columnReorder.emit(g),!g.isDefaultPrevented()&&(r&&this.columnLockedChange.emit(new ec([n])),this.updateColumnIndices({columnsForLevel:s,source:n,target:t,before:o}),n.locked!==t.locked&&(n.locked=t.locked),this.columnOrderChange.emit(g),this.columnsContainer.refresh(),this.changeDetectorRef.markForCheck())})}updateColumnIndices({columnsForLevel:t,source:n,target:o,before:r}){const s=yd(t),c=s.indexOf(n);let u=0,g=0,b=1;n.isSpanColumn&&(b+=n.childColumns.length);let k=0;for(;k<s.length;){const D=s[k];if(D===o)u=r?g:g+1,g=r?g+b:g,D.orderIndex=g,u===g+1&&(g+=b);else{if(D===n){k+=b;continue}D.orderIndex=g}g++,k++}for(k=c;k<c+b;k++)s[k].orderIndex=u++;this.updateIndicesForLevel(n.level+1)}updateIndicesForLevel(t){const n=this.allColumnsForLevel(t-1),o=[];
1jn(n).forEach(r=>{r.isColumnGroup&&o.push(...r.childrenArray.sort((s,c)=>s.orderIndex-c.orderIndex))}),yd(o).map((r,s)=>r.orderIndex=s),t<this.columnList.totalColumnLevels()&&this.updateIndicesForLevel(t+1)}allColumnsForLevel(t){return this.columnList.toArray().filter(n=>n.level===t)}setEditFocus(t){if(t)return this.navigationService.tryFocus(t)}columnInstance(t){let n;if(n="number"==typeof t?this.columnsContainer.lockedLeafColumns.toArray().concat(this.columnsContainer.nonLockedLeafColumns.toArray())[t]:"string"==typeof t?this.columnList.filter(o=>o.field===t)[0]:t,!n&&(0,e.naY)())throw new Error(`Invalid column ${t}`);return n}verifySettings(){if((0,e.naY)()){const t=this.lockedLeafColumns.length||this.columnMenu&&this.columnMenu.lock;if(this.lockedLeafColumns.length&&!this.nonLockedLeafColumns.length)throw new Error("There should be at least one non-locked column");if((t||this.virtualColumns)&&Sn(this.columnList.toArray()).filter(n=>!n.width&&!po(n)).length)throw new Error((t?"Locked":"Virtual")+" columns feature requires all columns to have set width.");if(t&&!this.isScrollable)throw new Error("Locked columns are only supported when scrolling is enabled.");if(this.columnList.filter(po).filter(n=>!n.hasChildren).length)throw new Error("ColumnGroupComponent should contain ColumnComponent or CommandColumnComponent.");if(this.columnList.filter(n=>n.locked&&n.parent&&!n.parent.isLocked).length)throw new Error("Locked child columns require their parent columns to be locked.");if(this.rowHeight&&!this.isVirtual)throw new Error("Row height setting requires virtual scrolling mode to be enabled.");this.wrapper?.nativeElement?.querySelector("kendo-toolbar")&&this.toolbarTemplate&&console.warn("Defining both a toolbar template and a ToolBarComponent within the TreeList is not supported.\n                    Please use either the ToolBarComponent or a custom template."),(i=>{Sn(i.toArray()).filter(Rd).filter(({field:a})=>!(i=>!Ve(i)&&nh.test(i)&&"."!==i[0]&&"."!==i[i.length-1])(a)).forEach(({field:a})=>console.warn(`\n                TreeList column field name '${a}' does not look like a valid JavaScript identifier.\n                Identifiers can contain only alphanumeric characters (including "$" or "_"), and may not start with a digit.\n                Please use only valid identifier names to ensure error-free operation.\n            `))})(this.columnList)}}autoGenerateColumns(){if(this.shouldGenerateColumns&&!this.columns.length&&this.view.length){const t=Object.keys(this.view.at(0).data).map(n=>{const o=new lo;return o.field=n,o});t[0].expandable=!0,this.columns.reset(t)}}attachStateChangesEmitter(){this.subscriptions.add((0,we.h)(this.sortChange.pipe((0,Me.T)(t=>({filter:this.filter,skip:this.skip,sort:t,take:this.pageSize}))),this.filterChange.pipe((0,Me.T)(t=>({filter:t,skip:0,sort:this.sort,take:this.pageSize})))).subscribe(t=>{this.closeCell(),this.cancelCell(),this.dataStateChange.emit(t),this.rowReorderable&&this.notifyReorderContainers()}))}attachEditHandlers(){this.editService&&this.subscriptions.add(this.editService.changes.subscribe(this.emitCRUDEvent.bind(this)))}emitCRUDEvent(t){let{action:n,formGroup:o,dataItem:r}=t;switch("add"!==n&&!r&&(r=o.value),this.view.clear(),this.changeDetectorRef.markForCheck(),this.closeCell(),Object.assign(t,{dataItem:r,sender:this}),n){case"add":this.add.emit(t);break;case"cancel":this.cancel.emit(t);break;case"edit":this.edit.emit(t);break;case"remove":this.remove.emit(t);break;case"save":this.save.emit(t);break;case"cellClose":this.cellClose.emit(t)}}attachDomEventHandlers(){this.subscriptions.add(this.domEvents.cellClick.subscribe(t=>{((0,v.SF)(this.cellClick)||this.selectionService.enabled)&&this.ngZone.run(()=>{this.cellClick.emit(Object.assign({sender:this},t)),this.selectionService.click(t)})}))}attachElementEventHandlers(){if(fi())return;const t=this.wrapper.nativeElement,n=this.ariaRoot.nativeElement;this.ngZone.runOutsideAngular(()=>{const o=this.resizeCheck.bind(this),r=this.renderer.listen("window","resize",o),s=this.renderer.listen("window","orientationchange",o),c=this.renderer.listen("document","click",U=>{const B=document.activeElement;this.editService.shouldCloseCell()&&!pt(U.target,Kt("k-animation-container k-treelist-ignore-click"))&&(!B||!pt(B,Kt("k-animation-container"))&&!Zc(B,this.wrapper.nativeElement))&&this.editService.closeCell(U)}),u=this.renderer.listen("window","blur",U=>{const B=document.activeElement;B&&!(qe("input")(B)&&"file"===B.type&&Zc(B,this.wrapper.nativeElement))&&this.editService.closeCell(U),this.domEvents.windowBlur.emit(U)}),g=this.renderer.listen(t,"click",U=>{this.domEvents.click.emit(U)}),b=this.renderer.listen(t,"keydown",U=>{this.domEvents.keydown.emit(U)});let k=!1;const D=this.renderer.listen(n,"focusin",U=>{this.domEvents.focus.emit(U),k||(this.domEvents.focusIn.emit(U),k=!0)}),V=this.renderer.listen(n,"focusout",U=>{const B=U.relatedTarget||document.activeElement;!pt(B,et=>et===n)&&(this.domEvents.focusOut.emit(U),k=!1)});this.detachElementEventHandlers=()=>{r(),s(),c(),u(),g(),b(),D(),V()}})}matchesMedia(t){return this.responsiveService.matchesMedia(t.media)}resizeCheck(){if(window.innerWidth!==this.cachedWindowWidth){this.cachedWindowWidth=window.innerWidth;let t=!1;this.columnList.filterHierarchy(n=>{const o=this.matchesMedia(n);return n.matchesMedia!==o&&(t=!0,n.matchesMedia=o),n.isVisible}),t&&this.ngZone.run(()=>{this.changeDetectorRef.markForCheck()})}}emitPDFExportEvent(){const t=new Th;this.pdfExport.emit(t),t.isDefaultPrevented()||this.saveAsPDF()}syncHeaderHeight(t){return t.pipe((0,ae.p)(()=>pe(this.lockedHeader))).subscribe(()=>
1Ad(this.lockedHeader.nativeElement.children[0],this.header.nativeElement.children[0]))}columnsContainerChange(){this.subscriptions.add(this.syncHeaderHeight(this.columnsContainer.changes.pipe((0,ae.p)(()=>this.lockedColumns.length>0),(0,Oe.n)(()=>this.ngZone.onStable.asObservable().pipe((0,O.s)(1))))))}handleColumnResize(){const t=this.columnResizingService.changes;this.subscriptions.add(t.pipe((0,Te.M)(n=>{"start"===n.type?this.renderer.addClass(this.wrapper.nativeElement,"k-grid-column-resizing"):"end"===n.type&&this.renderer.removeClass(this.wrapper.nativeElement,"k-grid-column-resizing")}),(0,ae.p)(n=>"start"===n.type),(0,Oe.n)(()=>t.pipe((0,L.Q)(t.pipe((0,ae.p)(n=>"triggerAutoFit"===n.type))),(0,ae.p)(n=>"end"===n.type)))).subscribe(this.notifyResize.bind(this)))}notifyResize(t){const n=t.resizedColumns.filter(o=>Dt(o.column.resizable)&&!o.column.isColumnGroup).map(o=>({column:o.column,newWidth:o.column.width,oldWidth:o.oldWidth}));(0,v.SF)(this.columnResize)&&this.ngZone.run(()=>{this.columnResize.emit(n)})}assertNavigable(){if((0,e.naY)()&&!this.navigable)throw new Error('The TreeList should be configured as [navigable]="true" to control focus')}_rowClass=()=>null;navigationMetadata(){const t=this.isVirtual,n=Ks(this.filterable)?1:0;return new pf(this.view,this.totalColumnLevels+1+n,t,this.showPager,this.wrapper,this.virtualColumns,this.columnsContainer)}updateNavigationMetadata(){this.navigationService.metadata=this.navigationMetadata()}applyAutoSize(){const t=this.columns.filter(n=>this.autoSize?!1!==n.autoSize:n.autoSize);t.length>0&&this.ngZone.onStable.pipe((0,O.s)(1)).subscribe(n=>this.autoFitColumns(t))}onColumnRangeChange(t){const n=this.viewportColumns=[],o=this.columnsContainer.nonLockedLeafColumns.toArray().slice(t.start,t.end+1);for(let r=0;r<o.length;r++){let s=o[r];for(;s.parent;)s=s.parent;const c=[s];for(;c.length;)s=c.shift(),n.push(s),s.isColumnGroup&&c.unshift(...s.childrenArray);const u=n[n.length-1];for(s=o[r];s!==u&&r<o.length;)r++,s=o[r]}if(t.start>0){const r=o[0];let s=t.offset,c=n[0],u=0;for(;c!==r;)s-=c.isColumnGroup?0:c.width,u++,c=n[u];if(s>0){const g=this.columnsContainer.totalLevels;let b;for(let k=0;k<=g;k++){const D=k<g?new Gs(b):new Ge(b);b=D,D.title="\xa0",D.width=s,n.unshift(D)}}}this.leafViewportColumns=n.filter(r=>!r.isColumnGroup)}dataLoaded(t){this.loadedData=t||[],this.view.reset(),this.dataChanged=!0,this.changeDetectorRef.markForCheck()}unsubscribeDataLoaded(){this.dataLoadedSubscription&&(this.dataLoadedSubscription.unsubscribe(),this.dataLoadedSubscription=null)}loadColumns(t){this.columns.reset(t.toArray()),this.columns.notifyOnChanges()}notifyReorderContainers(){this.dragTargetContainer?.notify(),this.dropTargetContainer?.notify()}static \u0275fac=function(n){return new(n||i)(e.rXU(Ls),e.rXU(e.aKT),e.rXU(Qr),e.rXU(Ot),e.rXU(Je),e.rXU(vi),e.rXU(Ld),e.rXU(e.sFG),e.rXU(_o),e.rXU(e.SKi),e.rXU(ta),e.rXU(na),e.rXU(Ti),e.rXU(e.gRc),e.rXU(Zs),e.rXU(In),e.rXU(Un),e.rXU(aa),e.rXU(ra),e.rXU(oa),e.rXU(Tn),e.rXU(Rn),e.rXU(H.Pi),e.rXU(fo),e.rXU(rn))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist"]],contentQueries:function(n,o,r){if(1&n&&(e.wni(r,Ge,4),e.wni(r,Nd,4),e.wni(r,Ie.HG,4),e.wni(r,jd,4),e.wni(r,Ds,4)),2&n){let s;e.mGM(s=e.lsd())&&(o.columns=s),e.mGM(s=e.lsd())&&(o.noRecordsTemplateChildren=s),e.mGM(s=e.lsd())&&(o.pagerTemplateChildren=s),e.mGM(s=e.lsd())&&(o.toolbarTemplateChildren=s),e.mGM(s=e.lsd())&&(o.columnMenuTemplates=s)}},viewQuery:function(n,o){if(1&n&&(e.GBs(jm,5),e.GBs(Vm,5),e.GBs($m,7),e.GBs(Se.YY,5),e.GBs(Se.Bw,5),e.GBs(Um,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.lockedHeader=r.first),e.mGM(r=e.lsd())&&(o.header=r.first),e.mGM(r=e.lsd())&&(o.ariaRoot=r.first),e.mGM(r=e.lsd())&&(o.dragTargetContainer=r.first),e.mGM(r=e.lsd())&&(o.dropTargetContainer=r.first),e.mGM(r=e.lsd())&&(o.footer=r)}},hostVars:13,hostBindings:function(n,o){2&n&&(e.BMQ("dir",o.dir),e.AVh("k-grid",o.hostClasses)("k-grid-md",o.hostClasses)("k-treelist",o.hostClasses)("k-grid-lockedcolumns",o.lockedClasses)("k-grid-virtual",o.virtualClasses)("k-grid-no-scrollbar",o.noScrollbarClass))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],data:"data",pageSize:"pageSize",height:"height",rowHeight:"rowHeight",skip:"skip",scrollable:"scrollable",sort:"sort",trackBy:"trackBy",filter:"filter",virtualColumns:"virtualColumns",filterable:"filterable",sortable:"sortable",pageable:"pageable",navigable:"navigable",navigatable:"navigatable",autoSize:"autoSize",rowClass:"rowClass",resizable:"resizable",reorderable:"reorderable",loading:"loading",columnMenu:"columnMenu",hideHeader:"hideHeader",idField:"idField",selectable:"selectable",isSelected:"isSelected",rowReorderable:"rowReorderable",columnsRef:[0,"columns","columnsRef"],fetchChildren:"fetchChildren",hasChildren:"hasChildren",isExpanded:"isExpanded"},outputs:{selectionChange:"selectionChange",filterChange:"filterChange",pageChange:"pageChange",sortChange:"sortChange",dataStateChange:"dataStateChange",edit:"edit",cancel:"cancel",save:"save",remove:"remove",add:"add",cellClose:"cellClose",cellClick:"cellClick",pdfExport:"pdfExport",excelExport:"excelExport",columnResize:"columnResize",columnReorder:"columnReorder",columnVisibilityChange:"columnVisibilityChange",columnLockedChange:"columnLockedChange",scrollBottom:"scrollBottom",contentScroll:"contentScroll",expandEvent:"expand",collapseEvent:"collapse",expandStateChange:"expandStateChange",rowReorder:"rowReorder"},exportAs:["kendoTreeList"],standalone:!0,features:[e.Jv_([Ls,H.Pi,In,Qr,Ot,vi,$s,{provide:H.$R,useValue:"kendo.treelist"},Je,Ld,Ie.OT,Ie.X9,_o,ta,Ys,na,Ti,mo,Js,qs,Qs,Zs,Un,ia,tl,ra,aa,oa,Tn,Rn,{provide:ho,useExisting:(0,e.Rfq)(()=>i)},{provide:ol,useExisting:(0,e.Rfq)(()=>i)},fo,rn]),e.OA$,e.aNF],ngContentSelectors:Hm,decls:14,vars:23,consts:()=>{let t,n,o,r,s,c,u,g,b,k,D,V,U,B,De,et,Ht,Xt,Jn,qn,Qn,Zn,Dn,ei,ti,Ae,Oo,xo,Mo,Fo,Po,No,Go,Ao,Lo,Bo,jo,Vo,$o,Uo,Yo,Ho,Xo,Wo,zo,Ko,Jo,qo,Qo,Zo,er,tr,nr,ir,or,rr,ar,sr;return t=$localize`:kendo.treelist.noRecords|The label visible in the TreeList when there are no records:No records available.`,n=$localize`:kendo.treelist.pagerFirstPage|The label for the first page button in TreeList pager:Go to the first page`,o=$localize`:kendo.treelist.pagerPreviousPage|The label for the previous page button in TreeList pager:Go to the previous page`,r=$localize`:kendo.treelist.pagerNextPage|The label for the next page button in TreeList pager:Go to the next page`,s=$localize`:kendo.treelist.pagerLastPage|The label for the last page button in TreeList pager:Go to the last page`,c=$localize`:kendo.treelist.pagerPage|The label before the current page number in the TreeList pager:Page`,u=$localize`:kendo.treelist.pagerOf|The label before the total pages number in the TreeList pager:of`,g=$localize`:kendo.treelist.pagerPageNumberInputTitle|The label for the pager input in the Treelist pager:Page Number`,b=$localize`:kendo.treelist.pagerItemsPerPage|The label for the page size chooser in the TreeList pager:items per page`,k=$localize`:kendo.treelist.pagerItemsTotal|The label after the total items count in the TreeList pager:items total`,D=$localize`:kendo.treelist.pagerInputLabel|The text of the aria-label attribute applied to the input element for entering the page number:Type a page number`,V=$localize`:kendo.treelist.filter|The label of the filter cell or icon:Filter`,U=$localize`:kendo.treelist.filterEqOperator|The text of the equal filter operator:Is equal to`,B=$localize`:kendo.treelist.filterNotEqOperator|The text of the not equal filter operator:Is not equal to`,De=$localize`:kendo.treelist.filterIsNullOperator|The text of the is null filter operator:Is null`,et=$localize`:kendo.treelist.filterIsNotNullOperator|The text of the is not null filter operator:Is not null`,Ht=$localize`:kendo.treelist.filterIsEmptyOperator|The text of the is empty filter operator:Is empty`,Xt=$localize`:kendo.treelist.filterIsNotEmptyOperator|The text of the is not empty filter operator:Is not empty`,Jn=$localize`:kendo.treelist.filterStartsWithOperator|The text of the starts with filter operator:Starts with`,qn=$localize`:kendo.treelist.filterContainsOperator|The text of the contains filter operator:Contains`,Qn=$localize`:kendo.treelist.filterNotContainsOperator|The text of the does not contain filter operator:
1Does not contain`,Zn=$localize`:kendo.treelist.filterEndsWithOperator|The text of the ends with filter operator:Ends with`,Dn=$localize`:kendo.treelist.filterGteOperator|The text of the greater than or equal filter operator:Is greater than or equal to`,ei=$localize`:kendo.treelist.filterGtOperator|The text of the greater than filter operator:Is greater than`,ti=$localize`:kendo.treelist.filterLteOperator|The text of the less than or equal filter operator:Is less than or equal to`,Ae=$localize`:kendo.treelist.filterLtOperator|The text of the less than filter operator:Is less than`,Oo=$localize`:kendo.treelist.filterIsTrue|The text of the IsTrue boolean filter option:Is True`,xo=$localize`:kendo.treelist.filterIsFalse|The text of the IsFalse boolean filter option:Is False`,Mo=$localize`:kendo.treelist.filterBooleanAll|The text of the (All) boolean filter option:(All)`,Fo=$localize`:kendo.treelist.filterAfterOrEqualOperator|The text of the after or equal date filter operator:Is after or equal to`,Po=$localize`:kendo.treelist.filterAfterOperator|The text of the after date filter operator:Is after`,No=$localize`:kendo.treelist.filterBeforeOperator|The text of the before date filter operator:Is before`,Go=$localize`:kendo.treelist.filterBeforeOrEqualOperator|The text of the before or equal date filter operator:Is before or equal to`,Ao=$localize`:kendo.treelist.filterFilterButton|The text of the filter button:Filter`,Lo=$localize`:kendo.treelist.filterClearButton|The text of the clear filter button:Clear`,Bo=$localize`:kendo.treelist.filterAndLogic|The text of the And filter logic:And`,jo=$localize`:kendo.treelist.filterOrLogic|The text of the Or filter logic:Or`,Vo=$localize`:kendo.treelist.loading|The loading text:Loading`,$o=$localize`:kendo.treelist.columnMenu|The title of the column menu icon:Column Menu`,Uo=$localize`:kendo.treelist.columns|The text shown in the column menu for the columns item:Columns`,Yo=$localize`:kendo.treelist.lock|The text shown in the column menu for the lock item:Lock`,Ho=$localize`:kendo.treelist.unlock|The text shown in the column menu for the unlock item:Unlock`,Xo=$localize`:kendo.treelist.sortable|The label of the sort icon:Sortable`,Wo=$localize`:kendo.treelist.sortAscending|The text shown in the column menu for the sort ascending item:Sort Ascending`,zo=$localize`:kendo.treelist.sortDescending|The text shown in the column menu for the sort descending item:Sort Descending`,Ko=$localize`:kendo.treelist.sortedDefault|The status announcement when a column is no longer sorted:Not Sorted`,Jo=$localize`:kendo.treelist.columnsApply|The text shown in the column menu or column chooser for the columns apply button:Apply`,qo=$localize`:kendo.treelist.columnsReset|The text shown in the column menu or column chooser for the columns reset button:Reset`,Qo=$localize`:kendo.treelist.pagerSelectPage|The text of the title and aria-label attributes applied to the page chooser in the TreeList Pager:Select page`,Zo=$localize`:kendo.treelist.topToolbarLabel|The label of the TreeList top toolbar:Top toolbar`,er=$localize`:kendo.treelist.bottomToolbarLabel|The label of the TreeList bottom toolbar:Bottom toolbar`,tr=$localize`:kendo.treelist.dragRowHandleLabel|The label for the TreeList drag row handle:Drag row`,nr=$localize`:kendo.treelist.selectRowCheckboxLabel|The label for the select row checkbox:Select row`,ir=$localize`:kendo.treelist.selectAllRowsCheckboxLabel|The label for the select all rows checkbox:Select all rows`,or=$localize`:kendo.treelist.pagerLabel|The label for the TreeList pager:${"\ufffd0\ufffd"}:INTERPOLATION:`,rr=$localize`:kendo.treelist.filterCellOperatorLabel|The label of the filter cell operators dropdown:${"\ufffd0\ufffd"}:INTERPOLATION:`,ar=$localize`:kendo.treelist.booleanFilterCellLabel|The label of the boolean filter cell dropdown:${"\ufffd0\ufffd"}:INTERPOLATION:`,sr=$localize`:kendo.treelist.filterInputLabel|The label of the filter row and menu inputs:${"\ufffd0\ufffd"}:INTERPOLATION:`,[["ariaRoot",""],["defaultHint",""],["defaultPager",""],["header",""],["lockedHeader",""],["pager",""],["pagerLabel",or,"filterCellOperatorLabel",rr,"booleanFilterCellLabel",ar,"filterInputLabel",sr],["kendoTreeListLocalizedMessages","","noRecords",t,"pagerFirstPage",n,"pagerPreviousPage",o,"pagerNextPage",r,"pagerLastPage",s,"pagerPage",c,"pagerOf",u,"pagerPageNumberInputTitle",g,"pagerItemsPerPage",b,"pagerItemsTotal",k,"pagerInputLabel",D,"filter",V,"filterEqOperator",U,"filterNotEqOperator",B,"filterIsNullOperator",De,"filterIsNotNullOperator",et,"filterIsEmptyOperator",Ht,"filterIsNotEmptyOperator",Xt,"filterStartsWithOperator",Jn,"filterContainsOperator",qn,"filterNotContainsOperator",Qn,"filterEndsWithOperator",Zn,"filterGteOperator",Dn,"filterGtOperator",ei,"filterLteOperator",ti,"filterLtOperator",Ae,"filterIsTrue",Oo,"filterIsFalse",xo,"filterBooleanAll",Mo,"filterAfterOrEqualOperator",Fo,"filterAfterOperator",Po,"filterBeforeOperator",No,"filterBeforeOrEqualOperator",Go,"filterFilterButton",Ao,"filterClearButton",Lo,"filterAndLogic",Bo,"filterOrL
1ogic",jo,"loading",Vo,"columnMenu",$o,"columns",Uo,"lock",Yo,"unlock",Ho,"sortable",Xo,"sortAscending",Wo,"sortDescending",zo,"sortedDefault",Ko,"columnsApply",Jo,"columnsReset",qo,"pagerSelectPage",Qo,"topToolbarLabel",Zo,"bottomToolbarLabel",er,"dragRowHandleLabel",tr,"selectRowCheckboxLabel",nr,"selectAllRowsCheckboxLabel",ir,6,"pagerLabel","filterCellOperatorLabel","booleanFilterCellLabel","filterInputLabel"],["position","top","class","k-toolbar k-grid-toolbar k-toolbar-md",3,"navigable",4,"ngIf"],["role","treegrid","kendoDragTargetContainer","","kendoDropTargetContainer","","mode","manual",1,"k-grid-aria-root",3,"onPress","onDragStart","onDrag","onDragEnter","onDragLeave","onDragEnd","onDrop","id","dragDisabled","dropDisabled","dragTargetFilter","dropTargetFilter","dragHandle","hint","dragData"],[3,"ngIf"],["class","k-grid-pager",3,"navigable","pageSize","total","skip","responsive","buttonCount","info","pageSizeValues","previousNext","type","pageChange",4,"ngIf"],["class","k-toolbar k-grid-toolbar k-grid-toolbar-bottom k-toolbar-md","position","bottom",3,"navigable",4,"ngIf"],["position","top",1,"k-toolbar","k-grid-toolbar","k-toolbar-md",3,"navigable"],["class","k-grid-header","role","presentation",3,"padding",4,"ngIf"],["kendoDraggable","","kendoTreeListSelectionMarquee","",3,"pageChange","scrollBottom","contentScroll","view","loading","rowHeight","total","take","skip","trackBy","columns","filterable","noRecordsTemplate","rowClass","isVirtual","virtualColumns","expandIcons","enableDrag"],["role","presentation",1,"k-grid-header"],["role","presentation","class","k-grid-header-locked",3,"width",4,"ngIf"],["role","presentation","data-scrollable","",1,"k-grid-header-wrap",3,"kendoTreeListResizableContainer","lockedWidth"],["role","presentation","kendoTreeListResizableTable","",1,"k-grid-header-table","k-table","k-table-md",3,"virtualColumns"],["kendoTreeListColGroup","",3,"columns"],["kendoTreeListHeader","","role","rowgroup",3,"resizable","scrollable","columns","totalColumnLevels","sort","filter","filterable","reorderable","sortable","columnMenu","columnMenuTemplate","lockedColumnsCount","totalColumnsCount","totalColumns"],["class","k-width-container","role","presentation",4,"ngIf"],["role","presentation",1,"k-grid-header-locked"],["kendoTreeListResizableTable","","role","presentation",1,"k-grid-header-table","k-table","k-table-md",3,"locked"],["kendoTreeListHeader","",3,"resizable","scrollable","columns","totalColumnLevels","sort","filter","filterable","reorderable","sortable","columnMenu","columnMenuTemplate","totalColumnsCount","totalColumns"],["role","presentation",1,"k-width-container"],["role","presentation","kendoTreeListResizableTable","",1,"k-table","k-table-md","k-grid-header-table"],["kendoTreeListHeader","",3,"resizable","scrollable","columns","totalColumnLevels","reorderable","sort","sortable","filter","filterable","columnMenu","columnMenuTemplate","totalColumns",4,"ngIf"],["kendoTreeListTableBody","","kendoDraggable","","kendoTreeListSelectionMarquee","",3,"view","skip","columns","filterable","noRecordsTemplate","trackBy","rowClass","expandIcons","enableDrag"],["kendoTreeListLoading","",4,"ngIf"],["kendoTreeListHeader","",3,"resizable","scrollable","columns","totalColumnLevels","reorderable","sort","sortable","filter","filterable","columnMenu","columnMenuTemplate","totalColumns"],["kendoTreeListLoading",""],[1,"k-grid-pager",3,"pageChange","navigable","pageSize","total","skip","responsive","buttonCount","info","pageSizeValues","previousNext","type"],["kendoPagerTemplate",""],[3,"ariaLabel","firstPage","inputLabel","previousPage","nextPage","lastPage","selectPage","page","itemsPerPage","items","of","pageNumberInputTitle"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["position","bottom",1,"k-toolbar","k-grid-toolbar","k-grid-toolbar-bottom","k-toolbar-md",3,"navigable"],["innerCssClass","k-drag-status",3,"name","svgIcon"],[1,"k-pager-numbers-wrap"],[4,"ngIf"],[3,"buttonCount",4,"ngIf"],[3,"pageSizes",4,"ngIf"],[3,"buttonCount"],[3,"pageSizes"]]},template:function(n,o){if(1&n){const r=e.RV6();e.NAR(Ym),e.qex(0,7),e.ehv(1,6),e.bVm(),e.DNE(2,Wm,1,3,"kendo-treelist-toolbar",8),e.SdG(3),e.j41(4,"div",9,0),e.bIt("onPress",function(c){return e.eBV(r),e.Njj(o.handleReorderEvents(c,"press"))})("onDragStart",function(c){return e.eBV(r),e.Njj(o.handleReorderEvents(c,"dragStart"))})("onDrag",function(c){return e.eBV(r),e.Njj(o.handleReorderEvents(c,"drag"))})("onDragEnter",function(c){return e.eBV(r),e.Njj(o.handleReorderEvents(c,"dragEnter"))})("onDragLeave",function(c){return e.eBV(r),e.Njj(o.handleReorderEvents(c,"dragLeave"))})("onDragEnd",function(c){return e.eBV(r),e.Njj(o.handleReorderEvents(c,"dragEnd"))})("onDrop",function(c){return e.eBV(r),e.Njj(o.handleReorderEvents(c,"drop"))}),e.DNE(6,qm,2,16,"ng-template",10)(7,eg,5,14,"ng-template",10),e.k0s(),e.DNE(8,ng,4,22,"kendo-pager",11)(9,ig,1,3,"kendo-treelist-toolbar",12)(10,og,2,3,"ng-template",null,1,e.C5r)(12,pg,8,18,"ng-template",null,2,e.C5r)}if(2&n){const r=e.sdS(11);e.uP7("Page navigation, page {currentPage} of {totalPages}")("Filter cell operators for {columnName}")("Boolean filter cell for {columnName}
1")("{columnName} Filter"),e.nnv(1),e.R7$(2),e.Y8G("ngIf",o.showTopToolbar),e.R7$(2),e.Y8G("id",o.ariaRootId)("dragDisabled",!o.rowReorderable)("dropDisabled",!o.rowReorderable)("dragTargetFilter",o.getDefaultSelectors("dragTarget"))("dropTargetFilter",o.getDefaultSelectors("dropTarget"))("dragHandle",o.getDefaultSelectors("handle"))("hint",e.eq3(21,Xm,r))("dragData",o.treeListData),e.BMQ("aria-rowcount",o.ariaRowCount)("aria-colcount",o.ariaColCount)("aria-multiselectable",o.ariaMultiselectable)("aria-label",o.ariaLabel),e.R7$(2),e.Y8G("ngIf",o.isScrollable),e.R7$(),e.Y8G("ngIf",!o.isScrollable),e.R7$(),e.Y8G("ngIf",o.showPager),e.R7$(),e.Y8G("ngIf",o.showBottomToolbar)}},dependencies:[BC,M.bT,M.T3,Qc,Se.YY,Se.Bw,gc,pl,Ml,cl,qf,v.T5,Lf,dc,al,Ie.Xh,Ie.Ti,Ie.RJ,Ie.Zc,Ie.F$,Ie.Gj,Ie.hw,Ie.HG,Ie.Bz,A.QK],encapsulation:2,changeDetection:0})}return i})(),ep=(()=>{class i extends va{service;constructor(t){super(),this.service=t}get override(){return!0}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-messages"]],standalone:!0,features:[e.Jv_([{provide:va,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})();const ip=(i,a,t,n)=>{let o=0;if(!n&&t.skip){let r=t.view.find(g=>"data"===g.type&&!g.isNew),s=r,c=0;if(r.level>0){for(;r.level>0;)r=r.parent;s=r,c=1}const u=a.indexOf(s.data);u>0&&(o=u+c)}a.splice(o,0,i)};let op=(()=>{class i{component;rowReorderService;set sort(t){this.component.sort=this.state.sort=t}set filter(t){this.component.filter=this.state.filter=t}set aggregate(t){this._aggregate=t}state={};dataChanged;cache=new Map;originalData=[];_aggregate;subscriptions=new K.y;constructor(t,n){this.component=t,this.rowReorderService=n,this.component.fetchChildren=this.fetchChildren.bind(this),this.component.hasChildren=this.hasChildren.bind(this)}ngOnInit(){this.applyState(this.state),this.subscriptions.add(this.component.dataStateChange.subscribe(this.onStateChange.bind(this))),this.component.rowReorderable&&this.subscriptions.add(this.rowReorderService.rowReorder.subscribe(this.onRowReorder.bind(this)))}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe()}ngDoCheck(){this.dataChanged&&(this.dataChanged=!1,this.rebind())}ngOnChanges(t){(0,v.TI)(["sort","filter","aggregate"],t)&&this.rebind(),(0,v.Hq)("data",t,!1)&&this.updateData(t.data.currentValue)}onStateChange(t){this.applyState(t),this.rebind()}rebind(){this.cache.clear(),this.component.data=this.fetchChildren()}onRowReorder(t){}applyState({sort:t,filter:n}){this.sort=t,this.filter=n}fetchChildren(t){const n=this.itemKey(t);if(this.cache.has(n))return this.cache.get(n);const o=this.getChildren(t);let s,r=this.filterItems(o);r.length&&(this.state.sort&&(r=(0,He.eh)(r,{sort:this.state.sort}).data),this._aggregate&&(s=this.calculateAggregates(r)));const c={data:r,aggregates:s};return this.cache.set(n,c),c}hasChildren(t){const n=this.fetchChildren(t).data;return n&&n.length>0}filterItems(t){const n=this.state.filter;return n&&n.filters&&n.filters.length>0?(0,He.eh)(t,{filter:{logic:"or",filters:[this.state.filter,{operator:s=>{const c=this.fetchChildren(s);return!(!c.data||!c.data.length)}}]}}).data:t}calculateAggregates(t){const n=[],o=t.slice(0);for(;o.length;){const r=o.shift();n.push(r),this.hasChildren(r)&&o.push(...this.fetchChildren(r).data)}return(0,He.BU)(n,this._aggregate)}updateData(t){this.originalData=t||[],this.dataChanged=!0}static \u0275fac=function(n){return new(n||i)(e.rXU(ho),e.rXU(rn))};static \u0275dir=e.FsC({type:i,inputs:{sort:"sort",filter:"filter",aggregate:"aggregate"},features:[e.OA$]})}return i})();class JC extends il{bindingDirective;constructor(a){super(),this.bindingDirective=a}create(a,t,n){const{idGetter:o,idSetter:r,parentIdSetter:s,originalData:c,component:u}=this.bindingDirective;r(a,pe(n)?n:(0,v.Os)()),t&&s(a,o(t)),ip(a,c,u,t),this.bindingDirective.rebind()}update(a){this.bindingDirective.rebind()}remove(a,t){const{idGetter:n,parentIdGetter:o,originalData:r}=this.bindingDirective,s=[a];for(;s.length;){const u=n(s.shift());let g=-1;for(let b=0;b<r.length;b++){const k=r[b];-1===g&&n(k)===u&&(g=b),o(k)===u&&s.push(k)}g>=0&&r.splice(g,1)}this.bindingDirective.rebind()}}let qC=(()=>{class i extends rn{isOverChild(t){const{draggedRows:n}=this.rowReorderArgs(this.dragTarget,this.dropTarget,this.view),o=n[0].dataItem;if(!pe(t[this.parentIdField])||o[this.parentIdField]===t[this.parentIdField])return!1;
1if(t&&t.hasOwnProperty(this.parentIdField)){if(o[this.idField]===t[this.parentIdField])return!0;const c=this.data.find(u=>u[this.idField]===t[this.parentIdField]);if(c)return this.isOverChild(c)}}reorderRows(t,n){const{draggedRows:o,dropTargetRow:r}=t,s=o[0].dataItem;let u=n.indexOf(r.dataItem);const g=n.indexOf(s);n.splice(g,1),"after"===t.dropPosition&&u<g&&u++,n.splice(u,0,s)}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(i)))(o||i)}})();static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),sp=(()=>{class i extends op{component;rowReorderService;set parentIdField(t){this.parentIdGetter=(0,Pe.oK)(t),this.parentIdSetter=(0,Pe.qB)(t),this._parentIdField=t}get parentIdField(){return this._parentIdField}set idField(t){this.idGetter=(0,Pe.oK)(t),this.idSetter=(0,Pe.qB)(t),this._idField=t}get idField(){return this._idField}data;idGetter=(0,Pe.oK)("id");idSetter=(0,Pe.qB)("id");parentIdGetter=(0,Pe.oK)("parentId");parentIdSetter=(0,Pe.qB)("parentId");constructor(t,n){super(t),this.component=t,this.rowReorderService=n,t.localEditService=new JC(this),this.rowReorderService&&(this.rowReorderService.bindingDirective=this)}_parentIdField;_idField;getChildren(t){const n=this.itemKey(t);return this.originalData.filter(null===n?r=>!pe(this.parentIdGetter(r)):r=>this.parentIdGetter(r)===n)}itemKey(t){return t?this.idGetter(t):null}onRowReorder(t){if("forbidden"===t.dropPosition)return;const n=t.draggedRows[0].dataItem,o=t.dropTargetRow.dataItem;if("over"===t.dropPosition){const r=this.itemKey(o);n[this.parentIdField]!==r&&(n[this.parentIdField]=r)}else n[this.parentIdField]=o[this.parentIdField],this.rowReorderService.reorderRows(t,this.originalData);this.rebind()}static \u0275fac=function(n){return new(n||i)(e.rXU(ho),e.rXU(rn,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoTreeListFlatBinding",""]],inputs:{parentIdField:"parentIdField",idField:"idField",data:[0,"kendoTreeListFlatBinding","data"]},exportAs:["kendoTreeListFlatBinding"],standalone:!0,features:[e.Jv_([{provide:rn,useClass:qC}]),e.Vt3]})}return i})();let ba=(()=>{class i{hostClass=!0;get sizedClass(){return pe(this.width)}get flexBasisStyle(){return this.width}width;static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-spacer"]],hostVars:6,hostBindings:function(n,o){2&n&&(e.xc7("flex-basis",o.flexBasisStyle),e.AVh("k-spacer",o.hostClass)("k-spacer-sized",o.sizedClass))},inputs:{width:"width"},standalone:!0,features:[e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),e1=(()=>{class i extends Ge{parent;showSelectAll;checkChildren;expandable;isCheckboxColumn=!0;template;constructor(t){super(t),this.parent=t}get templateRef(){return this.template?this.template.templateRef:void 0}static \u0275fac=function(n){return new(n||i)(e.rXU(Ge,13))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-checkbox-column"]],contentQueries:function(n,o,r){if(1&n&&e.wni(r,ro,5),2&n){let s;e.mGM(s=e.lsd())&&(o.template=s.first)}},inputs:{showSelectAll:"showSelectAll",checkChildren:"checkChildren",expandable:"expandable"},standalone:!0,features:[e.Jv_([{provide:Ge,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),t1=(()=>{class i extends Ge{parent;isRowReorderColumn=!0;constructor(t){super(t),this.parent=t}static \u0275fac=function(n){return new(n||i)(e.rXU(Ge,13))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-rowreorder-column"]],standalone:!0,features:[e.Jv_([{provide:Ge,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),bo=(()=>{class i extends Be.$n{editService;get visible(){if(this.cellContext)return this.isEdited!==this.readVisible?"":"none"}get isEdited(){return!(!this.cellContext||!this.editService.isEdited(this.dataItem)||this.editService.isEditingCell())}get dataItem(){if(this.cellContext)return this.cellContext.viewItem.data}clickHandler(t){t.preventDefault(),this.onClick()}constructor(t,n,o,r,s){super(n,o,null,r,s),this.editService=t}static \u0275fac=function(n){return new(n||i)(e.rXU(Ot),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListBaseCommand",""]],hostVars:2,hostBindings:function(n,o){1&n&&e.bIt("click",function(s){return o.clickHandler(s)}),2&n&&e.xc7("display",o.visible)},standalone:!0,features:[e.Vt3,e.aNF],attrs:ug,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,_g,1,2,"kendo-icon-wrapper",0)(1,mg,2,1,"span",1)(2,gg,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})(),dp=(()=>
1{class i extends bo{cellContext;commandClass=!0;readVisible=!0;constructor(t,n,o,r,s){super(t,n,o,r,s)}onClick(){this.cellContext&&this.editService.beginEdit(this.dataItem)}static \u0275fac=function(n){return new(n||i)(e.rXU(Ot),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListEditCommand",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-grid-edit-command",o.commandClass)},inputs:{cellContext:[0,"kendoTreeListEditCommand","cellContext"]},standalone:!0,features:[e.Vt3,e.aNF],attrs:hg,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,fg,1,2,"kendo-icon-wrapper",0)(1,Cg,2,1,"span",1)(2,vg,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})(),cp=(()=>{class i extends bo{cellContext;commandClass=!0;readVisible=!1;constructor(t,n,o,r,s){super(t,n,o,r,s)}onClick(){if(this.cellContext){const t=this.cellContext.viewItem;this.editService.endEdit(t.data,t.isNew)}}static \u0275fac=function(n){return new(n||i)(e.rXU(Ot),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListCancelCommand",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-grid-cancel-command",o.commandClass)},inputs:{cellContext:[0,"kendoTreeListCancelCommand","cellContext"]},standalone:!0,features:[e.Vt3,e.aNF],attrs:bg,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,Tg,1,2,"kendo-icon-wrapper",0)(1,Eg,2,1,"span",1)(2,Sg,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})(),pp=(()=>{class i extends bo{cellContext;commandClass=!0;readVisible=!1;constructor(t,n,o,r,s){super(t,n,o,r,s)}onClick(){this.cellContext&&this.editService.save(this.dataItem,this.cellContext.viewItem.isNew)}static \u0275fac=function(n){return new(n||i)(e.rXU(Ot),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListSaveCommand",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-grid-save-command",o.commandClass)},inputs:{cellContext:[0,"kendoTreeListSaveCommand","cellContext"]},standalone:!0,features:[e.Vt3,e.aNF],attrs:kg,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,Rg,1,2,"kendo-icon-wrapper",0)(1,Ig,2,1,"span",1)(2,yg,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})(),up=(()=>{class i extends bo{cellContext;commandClass=!0;readVisible=!0;constructor(t,n,o,r,s){super(t,n,o,r,s)}onClick(){this.cellContext&&this.editService.remove(this.dataItem,(this.cellContext.viewItem.parent||{}).data)}static \u0275fac=function(n){return new(n||i)(e.rXU(Ot),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListRemoveCommand",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-grid-remove-command",o.commandClass)},inputs:{cellContext:[0,"kendoTreeListRemoveCommand","cellContext"]},standalone:!0,features:[e.Vt3,e.aNF],attrs:wg,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,Dg,1,2,"kendo-icon-wrapper",0)(1,Og,2,1,"span",1)(2,xg,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})(),_p=(()=>
1{class i extends bo{cellContext;commandClass=!0;readVisible=!0;constructor(t,n,o,r,s){super(t,n,o,r,s)}onClick(){this.editService.beginAdd(this.dataItem)}static \u0275fac=function(n){return new(n||i)(e.rXU(Ot),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListAddCommand",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-grid-add-command",o.commandClass)},inputs:{cellContext:[0,"kendoTreeListAddCommand","cellContext"]},standalone:!0,features:[e.Vt3,e.aNF],attrs:Mg,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,Fg,1,2,"kendo-icon-wrapper",0)(1,Pg,2,1,"span",1)(2,Ng,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})();const o1=pa({filterContainsOperator:"contains",filterNotContainsOperator:"doesnotcontain",filterEqOperator:"eq",filterNotEqOperator:"neq",filterStartsWithOperator:"startswith",filterEndsWithOperator:"endswith",filterIsNullOperator:"isnull",filterIsNotNullOperator:"isnotnull",filterIsEmptyOperator:"isempty",filterIsNotEmptyOperator:"isnotempty"});let mp=(()=>{class i extends Ii{localization;showOperators=!0;column;data;set valueField(t){this._valueField=t}get valueField(){return this._valueField?this._valueField:this.column.field}get currentFilter(){return this.filterByField(this.column.field)}get currentOperator(){return this.currentFilter?this.currentFilter.operator:"contains"}_valueField;constructor(t,n,o){super(t),this.localization=o,this.defaultOperators=o1(this.localization),this.column=n}get columnLabel(){const t=this.localization.get("filterInputLabel")||"";return En(t,"columnName",this.column.title||this.column.field)}static \u0275fac=function(n){return new(n||i)(e.rXU(Je),e.rXU(lo),e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-autocomplete-filter-cell"]],inputs:{showOperators:"showOperators",column:"column",data:"data",valueField:"valueField"},standalone:!0,features:[e.Vt3,e.aNF],decls:2,vars:8,consts:[[3,"column","filter","operators","showOperators"],["kendoFilterInput","",3,"data","columnLabel","valueField","value"]],template:function(n,o){1&n&&(e.j41(0,"kendo-treelist-filter-wrapper-cell",0),e.nrm(1,"kendo-autocomplete",1),e.k0s()),2&n&&(e.Y8G("column",o.column)("filter",o.filter)("operators",o.operators)("showOperators",o.showOperators),e.R7$(),e.Y8G("data",o.data)("columnLabel",o.columnLabel)("valueField",o.valueField)("value",null==o.currentFilter?null:o.currentFilter.value))},dependencies:[Hn,at.SA,Jt],encapsulation:2})}return i})(),r1=(()=>{class i extends be{constructor(t){super("contains",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-contains-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),a1=(()=>{class i extends be{constructor(t){super("doesnotcontain",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-not-contains-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),s1=(()=>{class i extends be{constructor(t){super("endswith",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-endswith-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),l1=(()=>{class i extends be{constructor(t){super("eq",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-eq-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),d1=(()=>{class i extends be{constructor(t){super("isempty",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-isempty-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),c1=(()=>{class i extends be{constructor(t){super("isnotempty",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-isnotempty-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),p1=(()=>{class i extends be{constructor(t){super("isnotnull",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-isnotnull-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),u1=(()=>{class i extends be{constructor(t){super("isnull",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-isnull-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),_1=(()=>{class i extends be{constructor(t){super("neq",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-neq-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),m1=(()=>{class i extends be{constructor(t){super("startswith",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-startswith-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),g1=(()=>{class i extends be{constructor(t){super("gt",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-gt-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),h1=(()=>{class i extends be{constructor(t){super("gte",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-gte-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),f1=(()=>{class i extends be{constructor(t){super("lt",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-lt-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),C1=(()=>{class i extends be{constructor(t){super("lte",t)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-lte-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),v1=(()=>{class i extends be{constructor(t){super("after",t)}toJSON(){return{text:this.text,value:"gt"}}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-after-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),b1=(()=>{class i extends be{constructor(t){super("after-eq",t)}toJSON(){return{text:this.text,value:"gte"}}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-after-eq-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),T1=(()=>{class i extends be{constructor(t){super("before-eq",t)}toJSON(){return{text:this.text,value:"lte"}}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-before-eq-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),E1=(()=>{class i extends be{constructor(t){super("before",t)}toJSON(){return{text:this.text,value:"lt"}}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-filter-before-operator"]],standalone:!0,features:[e.Jv_([{provide:be,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),gp=(()=>{class i{localization;columnInfoService;popupService;ngZone;renderer;changeDetector;autoSync=!1;allowHideAll=!0;get columns(){return this.columnInfoService.leafNamedColumns}columnsIcon=de.ZUr;popupRef;closeClick;constructor(t,n,o,r,s,c){this.localization=t,this.columnInfoService=n,this.popupService=o,this.ngZone=r,this.renderer=s,this.changeDetector=c}ngOnDestroy(){this.close()}toggle(t,n){if(this.popupRef)this.close();else{const o=this.localization.rtl?"right":"left";if(this.popupRef=this.popupService.open({anchor:t.element,content:n,positionMode:"absolute",anchorAlign:{vertical:"bottom",horizontal:o},popupAlign:{vertical:"top",horizontal:o}}),this.renderer.setAttribute(this.popupRef.popupElement,"dir",this.localization.rtl?"rtl":"ltr"),!(0,v.nm)())return;this.ngZone.runOutsideAngular(()=>this.closeClick=this.renderer.listen("document","click",({target:r})=>{pt(r,s=>s===this.popupRef.popupElement||s===t.element)||this.close()}))}}onApply(t){this.close(),t.length&&(this.changeDetector.markForCheck(),this.columnInfoService.changeVisibility(t))}onChange(t){this.changeDetector.markForCheck(),this.columnInfoService.changeVisibility(t)}close(){this.popupRef&&(this.popupRef.close(),this.popupRef=null,this.changeDetector.markForCheck()),this.detachClose()}detachClose(){this.closeClick&&(this.closeClick(),this.closeClick=null)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi),e.rXU(In),e.rXU(me.OQ),e.rXU(e.SKi),e.rXU(e.sFG),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-treelist-column-chooser"]],inputs:{autoSync:"autoSync",allowHideAll:"allowHideAll"},standalone:!0,features:[e.aNF],decls:4,vars:2,consts:[["anchor",""],["template",""],["kendoButton","","type","button","fillMode","flat","icon","columns",3,"click","
1svgIcon"],[1,"k-column-chooser-title"],[3,"apply","columnChange","columns","applyText","resetText","autoSync","allowHideAll"]],template:function(n,o){if(1&n){const r=e.RV6();e.j41(0,"button",2,0),e.bIt("click",function(){e.eBV(r);const c=e.sdS(1),u=e.sdS(3);return e.Njj(o.toggle(c,u))}),e.k0s(),e.DNE(2,Gg,3,6,"ng-template",null,1,e.C5r)}2&n&&(e.Y8G("svgIcon",o.columnsIcon),e.BMQ("title",o.localization.get("columns")))},dependencies:[Be.Qp,Jc],encapsulation:2})}return i})();let hp=(()=>{class i extends Be.$n{excelService;onClick(t){t.preventDefault(),this.excelService.exportClick.emit()}get excelClass(){return!0}constructor(t,n,o,r,s){super(n,o,null,r,s),this.excelService=t,this.ngZone=s}static \u0275fac=function(n){return new(n||i)(e.rXU(_o),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListExcelCommand",""]],hostVars:2,hostBindings:function(n,o){1&n&&e.bIt("click",function(s){return o.onClick(s)}),2&n&&e.AVh("k-grid-excel",o.excelClass)},standalone:!0,features:[e.Vt3,e.aNF],attrs:Ag,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,Lg,1,2,"kendo-icon-wrapper",0)(1,Bg,2,1,"span",1)(2,jg,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})();qe("KENDO-TREELIST-LIST"),qe("TABLE");let Ip=(()=>{class i extends Be.$n{pdfService;onClick(t){t.preventDefault(),this.pdfService.exportClick.emit()}get pdfClass(){return!0}constructor(t,n,o,r,s){super(n,o,null,r,s),this.pdfService=t,this.ngZone=s}static \u0275fac=function(n){return new(n||i)(e.rXU(vi),e.rXU(e.aKT),e.rXU(e.sFG),e.rXU(H.Pi),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoTreeListPDFCommand",""]],hostVars:2,hostBindings:function(n,o){1&n&&e.bIt("click",function(s){return o.onClick(s)}),2&n&&e.AVh("k-grid-pdf",o.pdfClass)},standalone:!0,features:[e.Vt3,e.aNF],attrs:Vg,ngContentSelectors:zt,decls:5,vars:3,consts:[["innerCssClass","k-button-icon",3,"name","svgIcon",4,"ngIf"],["class","k-button-icon k-icon",4,"ngIf"],["class","k-button-icon",3,"ngClass",4,"ngIf"],[1,"k-button-text"],["innerCssClass","k-button-icon",3,"name","svgIcon"],[1,"k-button-icon","k-icon"],["role","presentation",1,"k-image",3,"src"],[1,"k-button-icon",3,"ngClass"]],template:function(n,o){1&n&&(e.NAR(),e.DNE(0,$g,1,2,"kendo-icon-wrapper",0)(1,Ug,2,1,"span",1)(2,Yg,1,1,"span",2),e.j41(3,"span",3),e.SdG(4),e.k0s()),2&n&&(e.Y8G("ngIf",o.icon||o.svgIcon),e.R7$(),e.Y8G("ngIf",o.imageUrl),e.R7$(),e.Y8G("ngIf",o.iconClass))},dependencies:[M.bT,A.QK,M.YU],encapsulation:2})}return i})();const $1=[yi,r1,a1,s1,l1,d1,c1,p1,u1,_1,m1,g1,h1,f1,C1,v1,b1,T1,E1,Jt,...[lo,Gs,sa,ll,$n,pl,cl,v.b2,sc,Id,al,yi,e1,t1]];let z1=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({providers:[A.o3,v.yr,z.uC,z.Hp,z.d7,z.fQ,z.iU,me.OQ,z.o_,ie.Nb,ie.o3,ie.s7,ie.VV],imports:[an,yi,sl,dp,cp,pp,up,_p,Ml,_a,fl,mp,Cl,Hn,vl,yi,yi,xl,ha,vo,bl,ga,El,Tl,Sl,kl,Rl,gp,yl,Il,wi,Dl,Ol,wl,hp,lt.Io,lt.Hr,Ip,dt.T8,dt.AC,dt.Rr,dt.U4,dt.oj,dt.SB,dt.rK,dt.LY,Ie.Xh,Ie.Ti,Ie.RJ,Ie.Zc,Ie.F$,Ie.Gj,Ie.hw,Ie.Bz,Ie.Vn]})}return i})();var wp=F(429),Ea=F(77338),To=F(25131),Di=F(64188),Sa=F(97649),Vt=F(95022),ka=F(62579),Ll=F(71664),K1=F(56098),Bl=F(72296),J1=F(53808),q1=F(51235),jl=F(13004);class Z1{constructor(a,t,n){this.project=a,this.concurrent=t,this.scheduler=n}call(a,t){return t.subscribe(new Vl(a,this.project,this.concurrent,this.scheduler))}}class Vl extends jl.gn{constructor(a,t,n,o){super(a),this.project=t,this.concurrent=n,this.scheduler=o,this.index=0,this.active=0,this.hasCompleted=!1,n<Number.POSITIVE_INFINITY&&(this.buffer=[])}static dispatch(a){const{subscriber:t,result:n,value:o,index:r}=a;t.subscribeToProjection(n,o,r)}_next(a){const t=this.destination;if(t.closed)return void this._complete();const n=this.index++;if(this.active<this.concurrent){t.next(a);try{const{project:o}=this,r=o(a,n);this.scheduler?this.destination.add(this.scheduler.schedule(Vl.dispatch,0,{subscriber:this,result:r,value:a,index:n})):this.subscribeToProjection(r,a,n)}catch(o){t.error(o)}}else this.buffer.push(a)}subscribeToProjection(a,t,n){this.active++,this.destination.add((0,jl.tS)(a,new jl.zA(this)))}_complete(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()}notifyNext(a){this._next(a)}notifyComplete(){const a=this.buffer;this.active--,a&&a.length>0&&this._next(a.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()}}var Dp=F(85019),Op=F(78257),ev=F(97849),xp=F(78167),$l=F(31635),xt=F(60422),ht=F(92828);const nv=["task"],iv=i=>({$implicit:i}),Ul=i=>({click:i}),Mp=(i,a)=>({$implicit:i,elementWidth:a});function ov(i,a){if(1&i&&(e.qex(0),e.EFF(1),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.SpI(" ",t.mapper.extractFromTask(t.dataItem,"title")," ")}}function rv(i,a){}function av(i,a){if(1&i&&(e.qex(0),e.nrm(1,"div",4),e.j41(2,"div",5)(3,"div",6),e.DNE(4,ov,2,1,"ng-container",7)(5,rv,0,0,"ng-template",8,1,e.C5r),e.k0s(),e.j41(7,"span",9)(8,"span",10),e.nrm(9,"kendo-icon-wrapper",11),e.k0s()()(),e.bVm()),2&i){const t=e.sdS(6),n=e.XpG();e.R7$(),e.xc7("width",n.completionOverlayWidth,"px"),e.R7$(3),e.Y8G("ngIf",!n.taskContentTemplate)("ngIfElse",t),e.R7$(),e.Y8G("ngTemplateOutlet",n.taskContentTemplate)("ngTemplateOutletContext",e.eq3(9,iv,n.dataItem)),e.R7$(3),e.Y8G("kendoEventsOutsideAngular",e.eq3(11,Ul,n.onTaskDelete))("scope",n),e.R7$(),e.Y8G("svgIcon",n.xIcon)}}function sv(i,a){}function lv(i,a){if(1&i&&e.DNE(0,sv,0,0,"ng-template",8),2&i){const t=e.XpG();e.Y8G("ngTemplateOutlet",t.taskTemplate)("ngTemplateOutletContext",e.l_i(2,Mp,t.dataItem,t.taskWidth))}}function dv(i,a){if(1&i&&(e.qex(0),e.nrm(1,"div",12)(2,"div",13),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.AVh("k-display-block",t.touchEnabled),e.R7$(),e.AVh("k-display-block",t.touchEnabled)}}function cv(i,a){if(1&i&&(e.j41(0,"div",6),e.nrm(1,"div",7),e.k0s()),2&i){const t=e.XpG();e.xc7("width",t.taskWidth,"px"),e.R7$(),e.xc7("width",t.completionOverlayWidth,"px")}
1}function pv(i,a){}function uv(i,a){if(1&i&&(e.qex(0),e.nrm(1,"div",8)(2,"div",9),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.AVh("k-display-block",t.touchEnabled),e.R7$(),e.AVh("k-display-block",t.touchEnabled)}}function _v(i,a){if(1&i&&(e.qex(0),e.nrm(1,"div",3)(2,"div",4),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.AVh("k-display-block",t.touchEnabled),e.R7$(),e.AVh("k-display-block",t.touchEnabled)}}const mv=["timelineRow"],gv=["kendoGanttTasksTableBody",""];function hv(i,a){if(1&i&&e.nrm(0,"kendo-gantt-milestone-task",6),2&i){const t=e.XpG(),n=t.$implicit,o=t.index,r=e.XpG();e.Y8G("dataItem",n.data)("level",n.level)("activeView",r.activeView)("taskClass",r.taskClass)("selectable",r.selectable)("isSelected",r.isTaskSelected)("index",o)("renderDependencyDragClues",r.renderDependencyDragClues)}}function fv(i,a){if(1&i&&e.nrm(0,"kendo-gantt-summary-task",9),2&i){const t=e.XpG(2),n=t.$implicit,o=t.index,r=e.XpG();e.Y8G("dataItem",n.data)("level",n.level)("template",r.summaryTaskTemplate)("activeView",r.activeView)("taskClass",r.taskClass)("selectable",r.selectable)("isSelected",r.isTaskSelected)("isExpanded",r.isExpanded)("index",o)("renderDependencyDragClues",r.renderDependencyDragClues)}}function Cv(i,a){if(1&i&&e.nrm(0,"kendo-gantt-task",10),2&i){const t=e.XpG(2),n=t.$implicit,o=t.index,r=e.XpG();e.Y8G("dataItem",n.data)("level",n.level)("taskContentTemplate",r.taskContentTemplate)("taskTemplate",r.taskTemplate)("activeView",r.activeView)("taskClass",r.taskClass)("selectable",r.selectable)("isSelected",r.isTaskSelected)("index",o)("renderDependencyDragClues",r.renderDependencyDragClues)}}function vv(i,a){if(1&i&&e.DNE(0,fv,1,10,"kendo-gantt-summary-task",7)(1,Cv,1,10,"kendo-gantt-task",8),2&i){const t=e.XpG().$implicit;e.Y8G("ngIf",t.hasChildren),e.R7$(),e.Y8G("ngIf",!t.hasChildren)}}function bv(i,a){if(1&i&&(e.j41(0,"tr",3,0)(2,"td",4),e.DNE(3,hv,1,8,"kendo-gantt-milestone-task",5)(4,vv,2,2,"ng-template",null,1,e.C5r),e.k0s()()),2&i){const t=a.$implicit,n=e.sdS(5),o=e.XpG();e.R7$(3),e.Y8G("ngIf",o.isMileStone(t))("ngIfElse",n)}}const Tv=["kendoGanttHeaderTableBody",""];function Ev(i,a){if(1&i&&(e.j41(0,"td",2),e.EFF(1),e.k0s()),2&i){const t=a.$implicit;e.BMQ("colspan",t.span),e.R7$(),e.JRh(t.text)}}function Sv(i,a){if(1&i&&(e.j41(0,"td",2),e.EFF(1),e.k0s()),2&i){const t=a.$implicit;e.BMQ("colspan",7===t.span?t.span:1)("title",t.text),e.R7$(),e.JRh(t.text)}}const kv=["timelineContent"],Rv=["timelineColumns"],Iv=["timelineHeaderWrap"],yv=["tasksContainer"],wv=["dragPopupContainer"],Dv=["dependencyDragCreatePolyline"];function Ov(i,a){1&i&&(e.j41(0,"tr"),e.nrm(1,"td",24),e.k0s()),2&i&&e.ZvI("k-table-row",a.index%2?" k-alt k-table-alt-row":"","")}function xv(i,a){1&i&&e.nrm(0,"col")}function Mv(i,a){if(1&i&&e.nrm(0,"td",24),2&i){const t=a.$implicit,n=e.XpG();e.AVh("k-nonwork-hour",n.isNonWorking(t))}}function Fv(i,a){1&i&&(e.qSk(),e.nrm(0,"polyline",25)),2&i&&e.Y8G("dependency",a.$implicit)}const Pv=()=>({mode:"single"});function Nv(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",5),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.addHandler())}),e.EFF(1),e.k0s(),e.j41(2,"button",6),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.removeHandler())}),e.EFF(3),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("svgIcon",t.plusIcon),e.R7$(),e.SpI(" ",t.getText("taskEditingDependenciesAddButtonText")," "),e.R7$(),e.Y8G("svgIcon",t.minusIcon)("disabled",0===t.selectedKeys.length),e.R7$(),e.SpI(" ",t.getText("taskEditingDependenciesRemoveButtonText")," ")}}function Gv(i,a){if(1&i&&e.nrm(0,"kendo-dropdownlist",7),2&i){const t=a.column,n=a.rowIndex,o=e.XpG();e.Y8G("data",o.tasks)("valuePrimitive",!0)("formControl",o.getFormControl(n,t.field))}}function Av(i,a){if(1&i&&e.nrm(0,"kendo-dropdownlist",8),2&i){const t=a.column,n=a.rowIndex,o=e.XpG();e.Y8G("data",o.dependencyTypes)("valuePrimitive",!0)("formControl",o.getFormControl(n,t.field))}}function Lv(i,a){if(1&i&&(e.j41(0,"kendo-formfield"),e.nrm(1,"kendo-label",8)(2,"input",9,0),e.k0s()),2&i){const t=e.sdS(3),n=e.XpG();e.R7$(),e.Y8G("for",t)("text",n.getText("titleFieldInputLabel")),e.R7$(),e.Y8G("formControlName",n.mapper.taskFields.title)}}function Bv(i,a){if(1&i&&(e.j41(0,"kendo-formfield"),e.nrm(1,"kendo-label",8)(2,"kendo-datetimepicker",10,1),e.k0s()),2&i){const t=e.sdS(3),n=e.XpG();e.xc7("width",49,"%"),e.R7$(),e.Y8G("for",t)("text",n.getText("startFieldInputLabel")),e.R7$(),e.Y8G("formControlName",n.mapper.taskFields.start)}}function jv(i,a){if(1&i&&(e.j41(0,"kendo-formfield"),e.nrm(1,"kendo-label",8)(2,"kendo-datetimepicker",10,2),e.k0s()),2&i){const t=e.sdS(3),n=e.XpG();e.xc7("width",49,"%"),e.R7$(),e.Y8G("for",t)("text",n.getText("endFieldInputLabel")),e.R7$(),e.Y8G("formControlName",n.mapper.taskFields.end)}}function Vv(i,a){if(1&i&&(e.j41(0,"kendo-formfield"),e.nrm(1,"kendo-label",8)(2,"kendo-numerictextbox",11,3),e.k0s()),2&i){const t=e.sdS(3),n=e.XpG();e.xc7("width",49,"%"),e.R7$(),e.Y8G("for",t)("text",n.getText("completionRatioFieldInputLabel")),e.R7$(),e.Y8G("formControlName",n.mapper.taskFields.completionRatio)("min",0)("max",1)("decimals",2)("step",.01)}}function $v(i,a){1&i&&e.nrm(0,"kendo-gantt-task-fields")}function Uv(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-gantt-dependencies-table",10),e.mxI("dependenciesChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.predecessors,o)||(r.predecessors=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("tasks",t.loadedTasks),e.R50("dependencies",t.predecessors)}}function Yv(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-gantt-dependencies-table",11),e.mxI("dependenciesChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.successors,o)||(r.successors=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("tasks",t.loadedTasks),e.R50("dependencies",t.successors)}}function Hv(i,a){if(1&i&&(e.j41(0,"option",4),e.EFF(1),e.k0s()),2&i){const t=a.$implicit,n=e.XpG();e.Y8G("value",t),e.R7$(),e.JRh(n.getViewTypeText(t))}}function Xv(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",5),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG();return e.Njj(r.onClick(o))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG();e.Y8G("selected",t===n.activeView),e.R7$(),e.JRh(n.getViewTypeText(t))}}function Wv(i,a){1&i&&e.nrm(0,"kendo-gantt-add-task")}function zv(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-gantt-view-selector",3),e.bIt("activeViewChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.handleViewChange(o))}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("views",t.views)("activeView",t.activeView)}}function Kv(i,a){if(1&i&&(e.qex(0),e.DNE(1,Wv,1,0,"kendo-gantt-add-task",0),e.nrm(2,"span",1),e.DNE(3,zv,1,2,"kendo-gantt-view-selector",2),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.showAddTask),e.R7$(2),e.Y8G("ngIf",t.showViewSelector)}}function Jv(i,a){}function qv(i,a){if(1&i&&e.DNE(0,Jv,0,0,"ng-template",4),2&i){const t=e.XpG();e.Y8G("ngTemplateOutlet",t.toolbarTemplateRef)("ngTemplateOutletContext",t.context)}}const Qv=i=>({dblclick:i}),Zv=(i,a,t,n)=>({click:i,contextmenu:a,dblclick:t,mousedown:n});function eb(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-gantt-toolbar",12),e.bIt("activeViewChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.changeActiveView(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("showAddTask","top"===t.toolbarSettings.addTaskTool||"both"===t.toolbarSettings.addTaskTool)("showViewSelector","top"===t.toolbarSettings.viewSelectorTool||"both"===t.toolbarSettings.viewSelectorTool)("toolbarTemplate",t.toolbarTemplate)("views",t.viewTypes)("activeView",t.activeView)("navigable",t.navigable),e.BMQ("aria-label",t.toolbarAriaLabel)}}function tb(i,a){if(1&i&&e.nrm(0,"kendo-gantt-timeline",13),2&i){const t=e.XpG();e.Y8G("renderDependencyDragClues",t.renderDependencyDragClues)("dragScrollSettings",t.dragScrollSettings)("rows",t.viewItems)("slots",t.timelineSlots)("currentTimeMarker",t.activeViewCurrentTimeMarker)("groupSlots",t.timelineGroupSlots)("tableWidth",t.tableWidth)("activeView",t.activeView)("taskContentTemplate",null==t.taskContentTemplate?null:t.taskContentTemplate.templateRef)("taskTemplate",null==t.taskTemplate?null:t.taskTemplate.templateRef)("summaryTaskTemplate",null==t.summaryTaskTemplate?null:t.summaryTaskTemplate.templateRef)("taskClass",t.taskClass)("dependencies",t.dependencies)("isExpanded",t.isExpanded)("selectable",t.selectable)("isTaskSelected",t.isTaskSelected)("kendoEventsOutsideAngular",e.ziG(18,Zv,t.handleTimelineClick,t.handleTimelineRightClick,t.handleTimelineDblClick,t.handleTimelineMouseDown))("scope",t)}}function nb(i,a){if(1&i&&e.nrm(0,"kendo-gantt-toolbar",14),2&i){const t=e.XpG();e.Y8G("showAddTask","bottom"===t.toolbarSettings.addTaskTool||"both"===t.toolbarSettings.addTaskTool)("showViewSelector","bottom"===t.toolbarSettings.viewSelectorTool||"both"===t.toolbarSettings.viewSelectorTool)("toolbarTemplate",t.toolbarTemplate)("views",t.viewTypes)("activeView",t.activeView)("navigable",t.navigable),e.BMQ("aria-label",t.toolbarAriaLabel)}}function ib(i,a){if(1&i&&e.nrm(0,"kendo-gantt-edit-dialog",15),2&i){const t=e.XpG();e.Y8G("data",t.data)}}function ob(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-dialog",16),e.bIt("close",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.handleConfirmationDialogClose())}),e.j41(1,"span"),e.EFF(2),e.k0s(),e.j41(3,"kendo-dialog-actions",17),e.nrm(4,"kendo-treelist-spacer"),e.j41(5,"button",18),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.handleDeleteConfirmation())}),e.EFF(6),e.k0s(),e.j41(7,"button",19),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.handleConfirmationDialogClose())}),e.EFF(8),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("width",575)("height",170)("title",t.getText("confirmationDialogTitle")),e.R7$(2),e.JRh(t.getText("confirmationDialogContent")),e.R7$(3),e.Y8G("primary",!0),e.R7$(),e.JRh(t.getText("deleteButtonText")),e.R7$(2),e.JRh(t.getText("cancelButtonText"))}}function rb(i,a){1&i&&e.nrm(0,"div",20)}const ab={name:"@progress/kendo-angular-gantt",productName:"Kendo UI for Angular",productC
1odes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1734682106,version:"17.2.0",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"};var sn=function(i){return i[i.Digit1=97]="Digit1",i[i.Digit2=98]="Digit2",i[i.Digit3=99]="Digit3",i[i.Digit4=100]="Digit4",i}(sn||{});let Ra=(()=>{class i{ngZone;changes=new ue.B7;elements=[];subscriptions=new K.y;syncingTimeline;syncingTreeList;constructor(t){this.ngZone=t,this.subscriptions.add(this.changes.subscribe(n=>{this.scroll(n)}))}registerElement(t,n){this.elements.push({element:t,sourceType:n}),("timeline"===n||"treelist"===n)&&this.ngZone.runOutsideAngular(()=>{const o=(0,Ne.R)(t,"scroll").pipe((0,Me.T)(({target:{scrollTop:s,scrollLeft:c}})=>({scrollTop:s,scrollLeft:c,sourceType:n})));this.subscriptions.add(o.pipe((0,yt.F)("timeline"===n?(s,c)=>s.scrollTop===c.scrollTop&&s.scrollLeft===c.scrollLeft:(s,c)=>s.scrollTop===c.scrollTop)).subscribe(s=>this.changes.next(s)))})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.elements=null}syncScrollTop(t,n){const o=this.elements.find(s=>s.sourceType===t),r=this.elements.find(s=>s.sourceType===n);this.ngZone.onStable.pipe((0,O.s)(1)).subscribe(()=>r.element.scrollTop=o.element.scrollTop)}resetTimelineScrollLeft(){this.elements.find(n=>"timeline"===n.sourceType).element.scrollLeft=0}scroll({scrollTop:t,scrollLeft:n,sourceType:o}){this.ngZone.runOutsideAngular(()=>{"timeline"===o&&(this.elements.find(s=>"header"===s.sourceType).element.scrollLeft=n,this.syncingTimeline||(this.syncingTreeList=!0,this.elements.find(c=>"treelist"===c.sourceType).element.scrollTop=t),this.syncingTimeline=!1),"treelist"===o&&(this.syncingTreeList||(this.syncingTimeline=!0,this.elements.find(s=>"timeline"===s.sourceType).element.scrollTop=t),this.syncingTreeList=!1)})}static \u0275fac=function(n){return new(n||i)(e.KVO(e.SKi))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Fp=Object.freeze({toId:"toId",fromId:"fromId",id:"id",type:"type"}),Pp=Object.freeze({id:"id",start:"start",end:"end",title:"title",completionRatio:"completionRatio",children:"children"});var Xe=function(i){return i[i.FF=0]="FF",i[i.FS=1]="FS",i[i.SF=2]="SF",i[i.SS=3]="SS",i}(Xe||{});const ub=(i,a,t)=>i.getDay()>=a&&i.getDay()<=t,_b=(i,a,t)=>i.getHours()>=a&&i.getHours()<=t,Y=i=>null!=i,Np=i=>Y(i)?Array.isArray(i.data)?i.data:i:[],Gp=(i,a,t=0,n=0,o=0)=>{if(!Y(i))return null;const r=(0,wp.a)(i);return r.setHours(a),r.setMinutes(t),r.setSeconds(n),r.setMilliseconds(o),r},mb=(i,a)=>{const t=(0,Ea.J)(i,1),n=(0,To.u)(t,a);return(0,Di.f)(n,-1)},Yl=i=>(0,Sa.W)(i).getDate(),Ap=(i,a)=>{const t=a.getMonth()-i.getMonth()+12*(a.getFullYear()-i.getFullYear());return t<=1?0:t-1};let Hl;const ln=(i,a)=>{const t=(0,v.lG)(i,(0,v.sO)("k-task-wrap"),a);return Y(t)?Number(t.getAttribute("data-task-index")):null},Xn=(i,a)=>{const t=(0,v.lG)(i,(0,v.sO)("k-task"),a);return Y(t)},Eo=(i,a)=>{const t=(0,v.lG)(i,(0,v.sO)("k-task-actions"),a);return Y(t)},ko=(i,a,t)=>!Y(i)||i<a?a:i>t?t:i;let We=(()=>{class i{set taskFields(t){this._taskFields={...Pp,...t}}get taskFields(){return this._taskFields}set dependencyFields(t){this._dependencyFields={...Fp,...t}}get dependencyFields(){return this._dependencyFields}_taskFields={...Pp};_dependencyFields={...Fp};extractFromTask(t,n){return Y(this.taskFields)?(0,Pe.oK)(this.taskFields[n])(t):null}extractFromDependency(t,n){return Y(this.dependencyFields)?(0,Pe.oK)(this.dependencyFields[n])(t):null}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),kt=(()=>{class i{mapper;get taskChanges(){return this.notifier.asObservable()}get dependencyDomArgs(){return{tasks:this.tasks,contentContainer:this.contentContainer,timelineRow:this.timelineRow}}notifier=new ue.B7;timelineRow;contentContainer;tasks=new Map;constructor(t){this.mapper=t}ngOnDestroy(){this.tasks.clear(),this.tasks=null,this.contentContainer=null}registerTimelineRow(t){this.timelineRow=t,this.notifyChanges()}registerContentContainer(t){this.contentContainer=t,this.notifyChanges()}
1registerTask(t,n){const o=this.mapper.extractFromTask(t,"id");this.tasks.set(o,n),this.notifyChanges()}unregisterTask(t){const n=this.mapper.extractFromTask(t,"id");this.tasks.delete(n),this.notifyChanges()}notifyChanges(){this.notifier.next(this.dependencyDomArgs)}static \u0275fac=function(n){return new(n||i)(e.KVO(We))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Kl=(()=>{class i{renderer;cdr;container;slots=[];rows=[];currentTimeMarker;rowHeight;rtl;activeView;get deltaOffset(){if(this.slotIndex>=0){const t=this.slots[this.slotIndex].end.getTime()-this.slots[this.slotIndex].start.getTime();if(t>0){const o=(this.now.getTime()-this.slots[this.slotIndex].start.getTime())/t;return this.slotIndex*this.slotWidth+o*this.slotWidth}return 0}}get slotWidth(){return this.slots[0]?.slotWidth}get slotIndex(){return this.slots.indexOf(this.slots.find(t=>t.start<=this.now&&t.end>this.now))}get height(){return this.rows.length*this.rowHeight}get interval(){return"boolean"==typeof this.currentTimeMarker?6e4:this.currentTimeMarker?.updateInterval||6e4}now=new Date(Date.now());currentTimeTimeout;timeMarkerDiv;constructor(t,n){this.renderer=t,this.cdr=n}ngOnDestroy(){clearTimeout(this.currentTimeTimeout)}removeTimeMarker(){this.timeMarkerDiv&&(this.renderer.removeChild(this.container.nativeElement,this.timeMarkerDiv),clearTimeout(this.currentTimeTimeout),this.cdr.detectChanges())}createTimeMarker=()=>{(0,v.nm)()&&(this.removeTimeMarker(),this.slotIndex>=0&&(this.now=new Date(Date.now()),this.timeMarkerDiv=this.renderer.createElement("div"),this.renderer.addClass(this.timeMarkerDiv,"k-current-time"),this.renderer.setStyle(this.timeMarkerDiv,"width","1px"),this.renderer.setStyle(this.timeMarkerDiv,"top","0px"),this.renderer.setStyle(this.timeMarkerDiv,this.rtl?"right":"left",this.deltaOffset+"px"),this.renderer.appendChild(this.container.nativeElement,this.timeMarkerDiv),this.renderer.setStyle(this.timeMarkerDiv,"height",this.height+"px"),this.currentTimeTimeout=setTimeout(this.createTimeMarker,this.interval||6e4)))};static \u0275fac=function(n){return new(n||i)(e.KVO(e.sFG),e.KVO(e.gRc))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Vp=(i,a)=>{const{top:t,left:n}=((i,a)=>{const t={top:0,left:0};if(!a.contains(i))return t;let n=i;for(;n&&n!==a;)t.top+=n.offsetTop,t.left+=n.offsetLeft,n=n.offsetParent;return t})(i,a);return{top:t+i.offsetHeight/2,left:n,right:n+i.offsetWidth}},$p=(i,a,t,n)=>t?Sb(i,a,n):kb(i,a,n),Sb=(i,a,t)=>{const n=[];return n.push({top:i-t/2,left:a}),n.push({top:i,left:a-t+1}),n.push({top:i+t/2,left:a}),n.push({top:i,left:a}),n},kb=(i,a,t)=>{const n=[];return n.push({top:i+t/2,left:a}),n.push({top:i,left:a+t-1}),n.push({top:i-t/2,left:a}),n.push({top:i,left:a}),n};let wb=(()=>{class i{polyline;zone;renderer;mapper;dependencyDomService;dependency;subscriptions=new K.y;constructor(t,n,o,r,s){this.polyline=t,this.zone=n,this.renderer=o,this.mapper=r,this.dependencyDomService=s,this.subscriptions.add(s.taskChanges.pipe((0,Oe.n)(c=>this.zone.onStable.pipe((0,O.s)(1),(0,Me.T)(()=>c)))).subscribe(c=>this.updatePoints(c)))}ngOnDestroy(){this.subscriptions.unsubscribe()}ngOnChanges(t){Y(t.dependency)&&this.updatePoints(this.dependencyDomService.dependencyDomArgs)}updatePoints({timelineRow:t,contentContainer:n,tasks:o}){if(!(Y(t)&&Y(n)&&Y(o)&&0!==o.size&&o.has(this.mapper.extractFromDependency(this.dependency,"fromId"))&&o.has(this.mapper.extractFromDependency(this.dependency,"toId"))))return void this.clearPoints();const u=((i,a,t,n,o)=>{const s=[],c=Math.floor(t/2),u=i.top<a.top;let g,b;if(n===Xe.FF||n===Xe.SS){const k=n===Xe.SS?"left":"right";g=i.top,b=i[k],s.push({top:g,left:b}),b=Math["left"===k?"min":"max"](i[k],a[k]),b="left"===k?b-o:b+o,s.push({top:g,left:b}),g=a.top,s.push({top:g,left:b}),b="left"===k?a[k]-4:a[k]+4,s.push({top:g,left:b}),s.push(...$p(g,b,"left"!==k,4))}else{const k=n===Xe.SF?"left":"right",D=n===Xe.SF?"right":"left",V=n===Xe.SF?i[k]-20<a[D]:i[k]+20>a[D];g=i.top,b=i[k],s.push({top:g,left:b}),b="left"===k?b-o:b+o,s.push({top:g,left:b}),V&&(g=u?g+c:g-c,s.push({top:g,left:b}),b="left"===k?a[D]+o:a[D]-o,s.push({top:g,left:b})),g=a.top,s.push({top:g,left:b}),b="left"===D?a[D]-4:a[D]+4,s.push({top:g,left:b}),s.push(...$p(g,b,"left"!==D,4))}return s})(Vp(o.get(this.mapper.extractFromDependency(this.dependency,"fromId")),n),Vp(o.get(this.mapper.extractFromDependency(this.dependency,"toId")),n),(0,v.nm)()?t.getBoundingClientRect().height:0,this.dependency.type,10);this.drawPoints(u)}clearPoints(){this.renderer.setAttribute(this.polyline.nativeElement,"points","")}drawPoints(t){if(!Y(t)||0===t.length)return void this.clearPoints();const n=t.map(({left:o,top:r})=>`${o},${r}`).join(" ");this.renderer.setAttribute(this.polyline.nativeElement,"points",n)}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(e.SKi),e.rXU(e.sFG),e.rXU(We),e.rXU(kt))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttDependency",""]],inputs:{depen
1dency:"dependency"},standalone:!0,features:[e.OA$]})}return i})(),Oi=(()=>{class i{zone;renderer;scrollSyncService;taskStatusChanges=new ue.B7;get enabled(){return this._enabled}get activeTask(){return{activeIndex:this.activeTimelineIndex,isFocused:this.isTimelineFocused}}set activeTimelineIndex(t){this._activeTimelineIndex=t}get activeTimelineIndex(){return ko(this._activeTimelineIndex,0,this.metadata.treeList.view.data.length-1)}set activeTreeListCell(t){this._activeTreeListCell=t}get activeTreeListCell(){return{rowIndex:ko(this._activeTreeListCell.rowIndex,0,this.treeListHeaderRowsCount+this.metadata.treeList.view.data.length-1),colIndex:ko(this._activeTreeListCell.colIndex,0,this.metadata.columns.length)}}isTimelineFocused=!1;get treeListHeaderRowsCount(){return this.metadata.treeListElement.querySelectorAll(".k-grid-header tr").length}treeListLastActive=!1;timelineLastActive=!1;metadata;_enabled=!1;_activeTimelineIndex=0;_activeTreeListCell={rowIndex:0,colIndex:0};eventListenerDisposers;constructor(t,n,o){this.zone=t,this.renderer=n,this.scrollSyncService=o}initialize(t){this._enabled=!0,this.metadata=t;const n=this.metadata.host.querySelector(".k-splitbar");Y(n)&&Y(n.previousElementSibling)&&Y(n.after)&&n.after(n.previousElementSibling),this.zone.runOutsideAngular(()=>{this.eventListenerDisposers=[this.renderer.listen(this.metadata.treeListElement,"mousedown",this.focusTreeList.bind(this)),this.renderer.listen(this.metadata.treeListElement,"focusin",this.handleTreeListFocusIn.bind(this)),this.renderer.listen(this.metadata.timelineElement,"mousedown",this.handleTimelineMousedown.bind(this)),this.renderer.listen(this.metadata.timelineElement,"focusin",this.handleTimelineFocusIn.bind(this)),this.renderer.listen(this.metadata.timelineElement,"focusout",this.handleTimelineFocusOut.bind(this))]})}ngOnDestroy(){Y(this.eventListenerDisposers)&&(this.eventListenerDisposers.forEach(t=>t()),this.eventListenerDisposers=null),this.metadata=null}focusLastActiveItem(){if(0===this.metadata.data.length||!this.treeListLastActive&&!this.timelineLastActive)this.focusCell(0,0);else if(this.treeListLastActive){const{rowIndex:t,colIndex:n}=this.activeTreeListCell;this.metadata.treeList.focusCell(t,n)}else this.timelineLastActive&&this.focusTask(this.activeTimelineIndex)}focusCell(t,n){this.activeTreeListCell={rowIndex:t,colIndex:n},this.activeTimelineIndex=t-this.treeListHeaderRowsCount,this.metadata.treeList.focusCell(this.activeTreeListCell.rowIndex,this.activeTreeListCell.colIndex)}focusTask(t){this.activeTimelineIndex=t,this.isTimelineFocused=!0,this.activeTreeListCell={rowIndex:t+this.treeListHeaderRowsCount,colIndex:this.activeTreeListCell.colIndex},this.notifyTaskStatusChange()}handleTimelineFocusIn({target:t}){this.treeListLastActive=!1,this.timelineLastActive=!0,this.isTimelineFocused=!0,Xn(t,this.metadata.timelineElement)&&this.notifyTaskStatusChange()}handleTimelineFocusOut({relatedTarget:t}){this.isTimelineFocused=this.metadata.timelineElement.contains(t),Xn(t,this.metadata.timelineElement)||this.notifyTaskStatusChange()}handleTreeListFocusIn(t){if(this.treeListLastActive=!0,this.timelineLastActive=!1,this.metadata.treeListElement.contains(t.relatedTarget)){const{colIndex:n,rowIndex:o}=this.metadata.treeList.activeCell;this.activeTreeListCell={colIndex:n,rowIndex:o}}else{const{rowIndex:n,colIndex:o}=this.activeTreeListCell;this.metadata.treeList.focusCell(n,o)}this.activeTimelineIndex=this.metadata.treeList.activeCell.dataRowIndex,this.notifyTaskStatusChange(),this.metadata.treeList.activeCell.dataRowIndex>=0&&(this.scrollHorizontallyToTask(),this.scrollSyncService.syncScrollTop("treelist","timeline"))}updateActiveTimeLineIndex(t){this.activeTimelineIndex=t}updateActiveTreeListCell(){this.activeTreeListCell={rowIndex:this.activeTimelineIndex+this.treeListHeaderRowsCount,colIndex:this.activeTreeListCell.colIndex}}notifyTaskStatusChange(){this.taskStatusChanges.next(this.activeTask)}scrollHorizontallyToTask(){const t=this.activeTimelineIndex,n=this.metadata.timelineElement.querySelectorAll(".k-task-wrap").item(t);Y(n)&&(this.metadata.timelineElement.clientWidth+this.metadata.timelineElement.scrollLeft<n.offsetLeft+200||this.metadata.timelineElement.scrollLeft>n.offsetLeft)&&(this.metadata.timelineElement.scrollLeft=n.offsetLeft)}handleTimelineMousedown({target:t}){if(Xn(t,this.metadata.host)&&!Eo(t,this.metadata.host)){const n=ln(t,this.metadata.host);this.focusTask(n)}}focusTreeList(){this.metadata.treeList.focus()}static \u0275fac=function(n){return new(n||i)(e.KVO(e.SKi),e.KVO(e.sFG),e.KVO(Ra))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Wn=(()=>{class i{mapper;showEditingDialog=new ue.B7;taskDelete=new ue.B7;
1editEvent=new ue.B7;addEvent=new ue.B7;taskFormGroup;dataItem;getSelectedItem;hasChildren;fetchChildren;set dependencies(t){const n=this.mapper.extractFromTask(this.dataItem,"id");this.predecessors=t.filter(o=>this.mapper.extractFromDependency(o,"toId")===n),this.successors=t.filter(o=>this.mapper.extractFromDependency(o,"fromId")===n)}get dependencies(){return[...this.predecessors,...this.successors]}predecessors=[];successors=[];updatedItems=[];deletedItems=[];constructor(t){this.mapper=t}createEditDialog(t,n,o){this.dataItem=t,this.taskFormGroup=n,this.dependencies=o,this.showEditingDialog.next(!0)}closeEditDialog(){this.showEditingDialog.next(!1),this.dataItem=void 0,this.taskFormGroup=void 0,this.dependencies=[],this.updatedItems=[],this.deletedItems=[]}triggerEditEvent(t){this.editEvent.next({taskFormGroup:this.taskFormGroup,dataItem:this.dataItem,dependencies:{createdItems:this.getCreatedDependencies(),updatedItems:this.updatedItems,deletedItems:this.deletedItems},editResultType:t})}updateDependencies(t){if(!this.isNew(t)){const n=this.itemIndex(t,this.updatedItems);-1!==n?this.updatedItems.splice(n,1,t):this.updatedItems.push(t)}}getCreatedDependencies(){return this.dependencies.filter(t=>null===this.mapper.extractFromDependency(t,"id"))}deleteDependency(t){const n=this.itemIndex(t,this.updatedItems);-1!==n&&this.updatedItems.splice(n,1),this.isNew(t)||this.deletedItems.push(t)}loadTasks(t,n=!0){return(0,vt.p)(t.map(o=>this.getElementById(o))).pipe((0,Me.T)(o=>o.reduce((r,s)=>r.concat(Np(s)),[])),function Q1(i,a=Number.POSITIVE_INFINITY,t){return a=(a||0)<1?Number.POSITIVE_INFINITY:a,n=>n.lift(new Z1(i,a,t))}(o=>o.some(r=>this.hasChildren(r))?this.loadTasks(o,!1):q1.w),function tv(i,a){return arguments.length>=2?function(n){return(0,xp.F)((0,Dp.S)(i,a),(0,Op.o)(1),(0,ev.U)(a))(n)}:function(n){return(0,xp.F)((0,Dp.S)((o,r,s)=>i(o,r,s+1)),(0,Op.o)(1))(n)}}((o,r)=>o.concat(r),n?[...t]:[]))}getElementById(t){const n=this.fetchChildren(t);return(0,rt.A)(n)?n:(0,le.of)(n)}itemIndex=(t,n)=>n.findIndex(o=>this.mapper.extractFromTask(o,"id")===this.mapper.extractFromTask(t,"id"));isNew(t){return!Y(this.mapper.extractFromDependency(t,"id"))}static \u0275fac=function(n){return new(n||i)(e.KVO(We))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Rt=(()=>{class i{viewChanges=new e.bkB;columnChanges=new e.bkB;dateFormatChanges=new e.bkB;notifyColumnChanges(){this.columnChanges.emit()}notifyViewChanges(){this.viewChanges.emit()}notifyDateFormatChanges(){this.dateFormatChanges.emit()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const ql=(i,a)=>{const t=(0,wp.a)(i);return t.setHours(a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()),t},Ql=new Date(1980,0,1,23,59,59,999);let ya=(()=>{let i=class{intlService;mapper;localeId;options;_viewStart=0;constructor(t,n,o){this.intlService=t,this.mapper=n,this.localeId=o}get viewStart(){return this._viewStart}getRange(t){if(!t||!t.length)return{start:new Date,end:new Date};const n=(0,He.My)(t,[{field:this.mapper.taskFields.start,dir:"asc"}]),o=(0,He.My)(t,[{field:this.mapper.taskFields.end,dir:"desc"}]),r=new Date(this.mapper.extractFromTask(n[0],"start"))||new Date,s=new Date(this.mapper.extractFromTask(o[0],"end"))||new Date,c=this.getStartOffset(r),u=this.getEndOffset(s);return this._viewStart=Number(c),{start:new Date(c),end:new Date(u)}}getHours(t,n,o){const r=[],s=this.intlService.parseDate(this.options.workDayStart).getHours(),c=this.intlService.parseDate(this.options.workDayEnd).getHours();let g=new Date(t);const b=o||"HH:mm aa",k=new Date(n);for(;g<k;){const D=new Date(g),V=_b(D,s,c);D.setHours(D.getHours()+1),r.push({start:g,end:D,isWorking:V,text:this.intlService.formatDate(g,b,this.localeId),span:1,slotWidth:this.options.slotWidth}),g=D}return r}getDays(t,n,o){const r=[];let s=new Date(t);const c=o||"E d/MM",u=new Date(n);for(;s<=u;){const g=(0,Vt.p)((0,Di.f)(s,1)),b=ub(s,this.options.workWeekStart,this.options.workWeekEnd);r.push({start:s,end:u<g?u:g,isWorking:b,text:this.intlService.formatDate(s,c,this.localeId),span:1,slotWidth:this.options.slotWidth}),s=g}return r}getWeeks(t,n,o){const r=this.intlService.firstDay(),s=[];let c=new Date(t);const u=o||"E d/MM",g=new Date(n);for(;c<=g;){const b=mb(c,r),k=b>g?g:b,D=this.getDays(c,k),V=D.length,U=this.intlService.formatDate((0,To.u)((0,Vt.p)(c),r),u,this.localeId),B=this.intlService.formatDate(k,u,this.localeId);V>0&&s.push({start:D[0].start,end:ql(D[V-1].end,Ql),text:`${U} - ${B}`,span:V,slotWidth:this.options.slotWidth}),c=(0,To.u)((0,Ea.J)(k,1),r)}return s}getMonths(t,n,o,r){const s=[];let c=new Date(t);const u=r||"MMM",g=new Date(n);for(;c<g;){const b=(0,Sa.W)(c),k=g<b?g:b,D=this.getDays(c,k),V=this.getWeeks(c,k),U=o?D.length:V.length,B=(0,ka.G)((0,Vt.p)(c)),De=this.intlService.formatDate(B,u,this.localeId);U>0&&s.push({start:o?D[0].start:V[0].start,end:o?D[U-1]:ql(V[U-1].end,Ql),span:U,text:De,slotWidth:this.options.slotWidth}),c=(0,ka.G)((0,Ll.P)(k,1))}return s}getYears(t,n,o){const r=[];let s=new Date(t);const c=new Date(n),u=o||"yyyy";
1for(;s<c;){const g=(0,Sa.W)((0,K1.b)(s)),b=c<g?c:g,k=this.getMonths(s,b),D=k.length;D>0&&r.push({start:k[0].start,end:ql(k[D-1].end,Ql),span:D,text:this.intlService.formatDate(b,u),slotWidth:this.options.slotWidth}),s=(0,Di.f)(b,1)}return r}};return i=(0,$l.Cg)([(0,$l.Qj)(2,(0,e.y_5)(e.xe9)),(0,$l.Sn)("design:paramtypes",[Et.Bs,We,String])],i),i})(),Yp=(()=>{class i extends ya{localeId;constructor(t,n,o){super(t,n,o),this.localeId=o}getStartOffset(t){return Gp(t,t.getHours()-1)}getEndOffset(t){return Gp(t,t.getHours()+1)}getTableWidth(t){const n=this.getSlots(t)[1];return Math.round(n.length*this.options.slotWidth)}getSlots(t){const n=[],{start:o,end:r}=this.getRange(t),s=this.getDays(o,r,this.options.timelineHeadersDateFormat?.groupHeaderDateFormat),c=[];for(let u=0;u<s.length;u++){const g=s[u],b=this.getHours(g.start,g.end,this.options.timelineHeadersDateFormat?.columnHeaderDateFormat);g.span=b.length,c.push(...b)}return n.push(s,c),n}static \u0275fac=function(n){return new(n||i)(e.KVO(Et.Bs),e.KVO(We),e.KVO(e.xe9))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Hp=(()=>{class i extends ya{localeId;constructor(t,n,o){super(t,n,o),this.localeId=o}getStartOffset(t){const n=this.intlService.firstDay(),o=(0,To.u)((0,Vt.p)(t),n);return(0,Ea.J)((0,Vt.p)(o),-1)}getEndOffset(t){const n=this.intlService.firstDay(),o=(0,Di.f)((0,To.u)((0,Vt.p)(t),n),6);return(0,Ea.J)((0,Vt.p)(o),1)}getTableWidth(t){const n=this.getSlots(t)[1];return Math.round(n.length*this.options.slotWidth)}getSlots(t){const n=[],{start:o,end:r}=this.getRange(t),s=this.getMonths(o,r,!0,this.options.timelineHeadersDateFormat?.groupHeaderDateFormat),c=this.getWeeks(o,r,this.options.timelineHeadersDateFormat?.columnHeaderDateFormat);return n.push(s,c),n}static \u0275fac=function(n){return new(n||i)(e.KVO(Et.Bs),e.KVO(We),e.KVO(e.xe9))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Xp=(()=>{class i extends ya{localeId;constructor(t,n,o){super(t,n,o),this.localeId=o}getStartOffset(t){return(0,Di.f)((0,Vt.p)(t),-1)}getEndOffset(t){return(0,Di.f)((0,Vt.p)(t),1)}getTableWidth(t){const n=this.getSlots(t)[1];return Math.round(n.length*this.options.slotWidth)}getSlots(t){const n=[],{start:o,end:r}=this.getRange(t),s=this.getWeeks(o,r,this.options.timelineHeadersDateFormat?.groupHeaderDateFormat),c=this.getDays(o,r,this.options.timelineHeadersDateFormat?.columnHeaderDateFormat);return n.push(s,c),n}static \u0275fac=function(n){return new(n||i)(e.KVO(Et.Bs),e.KVO(We),e.KVO(e.xe9))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),Wp=(()=>{class i extends ya{localeId;constructor(t,n,o){super(t,n,o),this.localeId=o}getTableWidth(t){const n=this.getSlots(t)[1];return Math.round(n.length*this.options.slotWidth)}getStartOffset(t){const n=(0,ka.G)(t);return(0,Ll.P)((0,Vt.p)(n),-1)}getEndOffset(t){const n=(0,Sa.W)(t);return(0,Ll.P)((0,Vt.p)(n),1)}getSlots(t){const n=[],{start:o,end:r}=this.getRange(t),s=this.getYears(o,r,this.options.timelineHeadersDateFormat?.groupHeaderDateFormat),c=this.getMonths(o,r,!1,this.options.timelineHeadersDateFormat?.columnHeaderDateFormat);return n.push(s,c),n}static \u0275fac=function(n){return new(n||i)(e.KVO(Et.Bs),e.KVO(We),e.KVO(e.xe9))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Mb={day:Yp,week:Xp,month:Hp,year:Wp};let xi=(()=>{class i{injector;viewChange=new e.bkB;constructor(t){this.injector=t}service(t){const n=Mb[t];return n?this.injector.get(n):null}static \u0275fac=function(n){return new(n||i)(e.KVO(e.zZn))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Fb={day:Bl.C_,week:Bl.ec,month:7*Bl.ec},zp="k-focus";let Mi=(()=>{class i{mapper;timelineViewService;dependencyDomService;optionChangesService;cdr;navigationService;wrapperClass=!0;get taskIndexAttribute(){return this.index}taskElement;dataItem;index;level;renderDependencyDragClues;selectable;isSelected;activeView;taskClass;get ariaSelected(){return this.selectable?String(this.isSelected(this.dataItem)):null}get slotUnitDuration(){return Fb[this.activeView]}get viewService(){return this.timelineViewService.service(this.activeView)}get slotWidth(){return this.viewService.options.slotWidth}get taskWidth(){const t=this.mapper.extractFromTask(this.dataItem,"start"),n=this.mapper.extractFromTask(this.dataItem,"end");if("year"===this.activeView){if(!t||!n)return;const c=Math.max(Ap(t,n),0),u=Yl(t);return c>0||0===c&&t.getMonth()!==n.getMonth()?((u-t.getDate())/u+c+n.getDate()/Yl(n))*this.slotWidth:(n.getDate()-t.getDate())/u*this.slotWidth}return(n-t)/this.slotUnitDuration*this.slotWidth}get taskOffset(){const t=this.mapper.extractFromTask(this.dataItem,"start"),n=this.mapper.extractFromTask(this.dataItem,"end"),o=this.viewService.viewStart;if("year"===this.activeView){if(!t||!n)return;const u=new Date(o);return(Ap(u,new Date((0,ka.G)(t)))+1+t.getDate()/Yl(t))*this.slotWidth}return(t-o)/this.slotUnitDuration*this.slotWidth}get completionOverlayWidth(){const t=this.taskWidth*this.mapper.extractFromTask(this.dataItem,"completionRatio");return(i=>"number"==typeof i&&!isNaN(i))(t)?t:0}subscriptions=new K.y;constructor(t,n,o,r,s,c){this.mapper=t,this.timelineViewService=n,this.dependencyDomService=o,this.optionChangesService=r,this.cdr=s,this.navigationService=c,this.subscriptions.add(this.optionChangesService.viewChanges.subscribe(()=>this.cdr.markForCheck())),this.subscriptions.add(this.navigationService.taskStatusChanges.subscribe(this.updateActiveState.bind(this)))}ngOnInit(){const t=this.mapper.extractFromTask(this.dataItem,"start"),n=this.mapper.extractFromTask(this.dataItem,"end");if((0,e.naY)()){const o=this.mapper.extractFromTask(this.dataItem,"title");(!t||!n)&&console.warn(`Task ${o} is missing a start or end date.`),t&&n&&t>n&&console.warn(`Task ${o} has a start date that is after the end date.`)}}ngOnChanges(t){Y(t.dataItem)?(Y(t.dataItem.previousValue)&&this.dependencyDomService.unregisterTask(t.dataItem.previousValue),this.dependencyDomService.registerTask(this.dataItem,this.taskElement.nativeElement)):Y(t.activeView)&&this.dependencyDomService.n
1otifyChanges(),this.navigationService.enabled&&Y(t.index)&&this.updateActiveState(this.navigationService.activeTask)}ngOnDestroy(){Y(this.dataItem)&&this.dependencyDomService.unregisterTask(this.dataItem),this.subscriptions.unsubscribe()}updateActiveState({activeIndex:t,isFocused:n}){const o=t===this.index;this.taskElement.nativeElement.setAttribute("tabindex",o?"0":"-1"),o&&n?(this.taskElement.nativeElement.focus(),this.taskElement.nativeElement.classList.add(zp)):this.taskElement.nativeElement.classList.remove(zp)}static \u0275fac=function(n){return new(n||i)(e.rXU(We),e.rXU(xi),e.rXU(kt),e.rXU(Rt),e.rXU(e.gRc),e.rXU(Oi))};static \u0275dir=e.FsC({type:i,selectors:[["kendo-gantt-task-base"]],viewQuery:function(n,o){if(1&n&&e.GBs(nv,7),2&n){let r;e.mGM(r=e.lsd())&&(o.taskElement=r.first)}},hostVars:5,hostBindings:function(n,o){2&n&&(e.BMQ("data-task-index",o.taskIndexAttribute),e.xc7("left",o.taskOffset,"px"),e.AVh("k-task-wrap",o.wrapperClass))},inputs:{dataItem:"dataItem",index:"index",level:"level",renderDependencyDragClues:"renderDependencyDragClues",selectable:"selectable",isSelected:"isSelected",activeView:"activeView",taskClass:"taskClass"},features:[e.OA$]})}return i})(),Pb=(()=>{class i extends Mi{editService;taskContentTemplate;taskTemplate;xIcon=de.i3N;touchEnabled=Pe.jl;constructor(t,n,o,r,s,c,u){super(n,o,r,s,c,u),this.editService=t}onTaskDelete(){this.editService.dataItem=this.dataItem,this.editService.taskDelete.next(this.dataItem)}static \u0275fac=function(n){return new(n||i)(e.rXU(Wn),e.rXU(We),e.rXU(xi),e.rXU(kt),e.rXU(Rt),e.rXU(e.gRc),e.rXU(Oi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-task"]],inputs:{taskContentTemplate:"taskContentTemplate",taskTemplate:"taskTemplate"},standalone:!0,features:[e.Jv_([{provide:Mi,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:5,vars:11,consts:[["task",""],["taskContent",""],["role","treeitem",1,"k-task","k-task-single",3,"ngClass"],[4,"ngIf"],["aria-hidden","true",1,"k-task-complete"],[1,"k-task-content"],[1,"k-task-template"],[4,"ngIf","ngIfElse"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],["aria-hidden","true",1,"k-task-actions"],[1,"k-link","k-task-delete",3,"kendoEventsOutsideAngular","scope"],["icon","x",3,"svgIcon"],[1,"k-task-dot","k-task-start","k-touch-action-none"],[1,"k-task-dot","k-task-end","k-touch-action-none"]],template:function(n,o){1&n&&(e.j41(0,"div",2,0),e.DNE(2,av,10,13,"ng-container",3)(3,lv,1,5,null,3),e.k0s(),e.DNE(4,dv,3,4,"ng-container",3)),2&n&&(e.xc7("width",o.taskWidth,"px"),e.AVh("k-selected",o.isSelected(o.dataItem)),e.Y8G("ngClass",o.taskClass(o.dataItem)),e.BMQ("title",o.mapper.extractFromTask(o.dataItem,"title"))("aria-selected",o.ariaSelected)("aria-level",o.level+1),e.R7$(2),e.Y8G("ngIf",!o.taskTemplate),e.R7$(),e.Y8G("ngIf",o.taskTemplate),e.R7$(),e.Y8G("ngIf",o.renderDependencyDragClues))},dependencies:[M.YU,M.bT,M.T3,v.Uj,A.QK],encapsulation:2})}return i})(),Nb=(()=>{class i extends Mi{summaryWrapperClass=!0;template;isExpanded;touchEnabled=Pe.jl;get ariaExpanded(){const t=!Y(this.isExpanded)||this.isExpanded(this.dataItem);return String(t)}constructor(t,n,o,r,s,c){super(t,n,o,r,s,c)}static \u0275fac=function(n){return new(n||i)(e.rXU(We),e.rXU(xi),e.rXU(kt),e.rXU(Rt),e.rXU(e.gRc),e.rXU(Oi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-summary-task"]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-summary-wrap",o.summaryWrapperClass)},inputs:{template:"template",isExpanded:"isExpanded"},standalone:!0,features:[e.Jv_([{provide:Mi,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:6,vars:17,consts:[["task",""],["summaryTemplate",""],["role","treeitem",1,"k-task","k-task-summary",3,"ngClass"],["class","k-task-summary-progress",3,"width",4,"ngIf","ngIfElse"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngIf"],[1,"k-task-summary-progress"],[1,"k-task-summary-complete"],[1,"k-task-dot","k-task-start","k-touch-action-none"],[1,"k-task-dot","k-task-end","k-touch-action-none"]],template:function(n,o){if(1&n&&(e.j41(0,"div",2,0),e.DNE(2,cv,2,4,"div",3)(3,pv,0,0,"ng-template",4,1,e.C5r),e.k0s(),e.DNE(5,uv,3,4,"ng-container",5)),2&n){const r=e.sdS(4);e.xc7("width",o.taskWidth,"px"),e.AVh("k-selected",o.isSelected(o.dataItem)),e.Y8G("ngClass",o.taskClass(o.dataItem)),e.BMQ("title",o.mapper.extractFromTask(o.dataItem,"title"))("aria-selected",o.ariaSelected)("aria-expanded",o.ariaExpanded)("aria-level",o.level+1),e.R7$(2),e.Y8G("ngIf",!o.template)("ngIfElse",r),e.R7$(),e.Y8G("ngTemplateOutlet",o.template)("ngTemplateOutletContext",e.l_i(14,Mp,o.dataItem,o.taskWidth)),e.R7$(2),e.Y8G("ngIf",o.renderDependencyDragClues)}},dependencies:[M.YU,M.bT,M.T3],encapsulation:2})}return i})(),Gb=(()=>{class i extends Mi{milestoneWrapperClass=!0;touchEnabled=Pe.jl;constructor(t,n,o,r,s,c){super(t,n,o,r,s,c)}static \u0275fac=function(n){return new(n||i)(e.rXU(We),e.rXU(xi),e.rXU(kt),e.rXU(Rt),e.rXU(e.gRc),e.rXU(Oi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-milestone-task"]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-milestone-wrap",o.milestoneWrapperClass)},standalone:!0,features:[e.Jv_([{provide:Mi,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:3,vars:7,consts:[["task",""],["role","treeitem",1,"k-task","k-task-milestone",3,"ngClass"],[4,"ngIf"],[1,"k-task-dot","k-task-start","k-touch-action-none"],[1,"k-task-dot","k-task-end","k-touch-action-none"]],template:function(n,o){1&n&&(e.nrm(0,"div",1,0),e.DNE(2,_v,3,4,"ng-container",2)),2&n&&(e.AVh("k-selected",o.isSelected(o.dataItem)),e.Y8G("ngClass",o.taskClass(o.dataItem)),e.BMQ("title",o.mapper.extractFromTask(o.dataItem,"title"))("aria-selected",o.ariaSelected)("aria-level",o.level+1),e.R7$(2),e.Y8G("ngIf",o.renderDependencyDragClues))},dependencies:[M.YU,M.bT],encapsulation:2})}return i})(),Ab=(()=>{class i{dependencyDomService;mapper;set timelineRow(t){Y(t)&&this.dependencyDomService.registerTimelineRow(t.nativeElement)}selectable;rows;activeView;taskContentTemplate;taskTemplate;summaryTaskTemplate;taskClass;isExpanded;isTaskSelected;renderDependencyDragClues;constructor(t,n){this.dependencyDomService=t,this.mapper=n}isMileStone(t){return!t.hasChildren&&(0,J1.n)(this.mapper.extractFromTask(t.data,"start"),this.mapper.extractFromTask(t.data,"end"))}static \u0275fac=function(n){return new(n||i)(e.rXU(kt),e.rXU(We))};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoGanttTasksTableBody",""]],viewQuery:function(n,o){if(1&n&&e.GBs(mv,5),2&n){let r;e.mGM(r=e.lsd())&&(o.timelineRow=r.first)}},inputs:{selectable:"selectable",rows:"rows",activeView:"activeView",taskContentTemplate:"taskContentTemplate",taskTemplate:"taskTemplate",summaryTaskTemplate:"summaryTaskTemplate",taskClass:"taskClass",isExpanded:"isExpanded",isTaskSelected:"isTaskSelected",renderDependencyDragClues:"renderDependencyDragClues"},standalone:!0,features:[e.aNF],attrs:gv,decls:1,vars:1,consts:[["timelineRow",""],["task",""],["class","k-table-row",4,"ngFor","ngForOf"],[1,"k-table-row"],[1,"k-table-td"],[3,"dataItem","level","activeView","taskClass","selectable","isSelected","index","renderDependencyDragClues",4,"ngIf","ngIfElse"],[3,"dataItem","level","activeView","taskClass","selectable","isSelected","index","renderDependencyDragClues"],[3,"dataItem","level","template","activeView","taskClass","selectable","isSelected","isExpanded","index","renderDependencyDragClues",4,"ngIf"],[3,"dataItem","level","taskContentTemplate","taskTemplate","activeView","taskClass","selectable","isSelected","index","renderDependencyDragClues",4,"ngIf"],[3,"dataItem","level","template","activeView","taskClass","selectable","isSelected","isExpanded","index","renderDependencyDragClues"],[3,"dataItem","level","taskContentTemplate","taskTemplate","activeView","taskClass","selectable","isSelected","index","renderDependencyDragClues"]],template:function(n,o){1&n&&e.DNE(0,bv,6,2,"tr",2),2&n&&e.Y8G("ngForOf",o.rows)},dependencies:[M.pM,M.bT,Gb,Nb,Pb],encapsulation:2})}return i})();var zn=function(i){return i[i.Backwards=-1]="Backwards",i[i.Forward=1]="Forward",i}(zn||{}),Fi=function(i){return i.Vertical="scrollTop",i.Horizontal="scrollLeft",i}(Fi||{});let Zl=(()=>
1{class i{horizontalScroll=new ue.B7;verticalScroll=new ue.B7;scrollCancel=new ue.B7;ngOnDestroy(){this.horizontalScroll.complete(),this.verticalScroll.complete(),this.scrollCancel.complete()}requestHorizontalScroll(t){this.horizontalScroll.next(t)}requestVerticalScroll(t){this.verticalScroll.next(t)}requestScrollCancel(){this.scrollCancel.next()}static \u0275fac=function(n){return new(n||i)};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const Lb=(i,a)=>Math.floor(i[a])<=0,Bb=(i,a)=>{const t=a===Fi.Horizontal?i.scrollWidth-i.clientWidth:i.scrollHeight-i.clientHeight;return Math.ceil(i[a])>=t},wa=(i,a,t,n)=>{if(!Y(i)||!(0,v.nm)())return;const o=i[n];let r=a,s=0;for(;o===i[n]&&(t!==zn.Backwards||!Lb(i,n))&&(t!==zn.Forward||!Bb(i,n))&&s<20;)i[n]+=r*t,r+=1,s+=1},Kp=i=>{const a=i.getBoundingClientRect(),t=Math.max(a.top,0),n=Math.max(a.left,0);return{top:t,bottom:t+Math.min(a.bottom,i.clientHeight),left:n,right:n+Math.min(a.right,i.clientWidth)}};let jb=(()=>{class i{timelineScrollableContainer;scrollService;zone;scrollSettings;subscriptions=new K.y;verticalScrollInterval;horizontalScrollInterval;constructor(t,n,o){this.timelineScrollableContainer=t,this.scrollService=n,this.zone=o,this.subscriptions.add(this.scrollService.horizontalScroll.subscribe(this.scrollHorizontallyTo.bind(this))),this.subscriptions.add(this.scrollService.verticalScroll.subscribe(this.scrollVerticallyTo.bind(this))),this.subscriptions.add(this.scrollService.scrollCancel.subscribe(this.cancelScroll.bind(this)))}ngOnDestroy(){this.subscriptions.unsubscribe()}scrollHorizontallyTo(t){this.zone.runOutsideAngular(()=>{const n=this.timelineScrollableContainer.nativeElement,o=Kp(n);t<o.left+this.scrollSettings.threshold?this.horizontalScrollInterval=setInterval(()=>wa(n,this.scrollSettings.step,zn.Backwards,Fi.Horizontal),this.scrollSettings.interval):t>o.right-this.scrollSettings.threshold&&(this.horizontalScrollInterval=setInterval(()=>wa(n,this.scrollSettings.step,zn.Forward,Fi.Horizontal),this.scrollSettings.interval))})}scrollVerticallyTo(t){this.zone.runOutsideAngular(()=>{const n=this.timelineScrollableContainer.nativeElement,o=Kp(n);t<o.top+this.scrollSettings.threshold?this.verticalScrollInterval=setInterval(()=>wa(n,this.scrollSettings.step,zn.Backwards,Fi.Vertical),this.scrollSettings.interval):t>o.bottom-this.scrollSettings.threshold&&(this.verticalScrollInterval=setInterval(()=>wa(n,this.scrollSettings.step,zn.Forward,Fi.Vertical),this.scrollSettings.interval))})}cancelScroll(){Y(this.verticalScrollInterval)&&(clearInterval(this.verticalScrollInterval),this.verticalScrollInterval=null),Y(this.horizontalScrollInterval)&&(clearInterval(this.horizontalScrollInterval),this.horizontalScrollInterval=null)}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(Zl),e.rXU(e.SKi))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttTimelineScrollable",""]],inputs:{scrollSettings:"scrollSettings"},standalone:!0})}return i})(),Vb=(()=>{class i{tbodyClass=!0;groupSlots;slots;static \u0275fac=function(n){return new(n||i)};static \u0275cmp=e.VBU({type:i,selectors:[["","kendoGanttHeaderTableBody",""]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-table-tbody",o.tbodyClass)},inputs:{groupSlots:"groupSlots",slots:"slots"},standalone:!0,features:[e.aNF],attrs:Tv,decls:4,vars:2,consts:[[1,"k-table-row"],["class","k-header k-table-td",4,"ngFor","ngForOf"],[1,"k-header","k-table-td"]],template:function(n,o){1&n&&(e.j41(0,"tr",0),e.DNE(1,Ev,2,2,"td",1),e.k0s(),e.j41(2,"tr",0),e.DNE(3,Sv,2,3,"td",1),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngForOf",o.groupSlots),e.R7$(2),e.Y8G("ngForOf",o.slots))},dependencies:[M.pM],encapsulation:2})}return i})(),Jp=(()=>{class i{scrollSyncService;dependencyDomService;renderer;zone;currentTimeMarkerService;timelineContent;timelineColumns;timelineHeaderWrap;tasksContainer;dragPopupContainer;dependencyDragCreatePolyline;rows;slots;groupSlots;tableWidth;activeView;taskContentTemplate;taskTemplate;summaryTaskTemplate;taskClass;renderDependencyDragClues;dragScrollSettings;currentTimeMarker;selectable;isTaskSelected;isExpanded;dependencies=[];timelineContainerPress=new e.bkB;timelineContainerDrag=new e.bkB;timelineContainerRelease=new e.bkB;get draggableEnabled(){return this.renderDependencyDragClues}subscriptions=new K.y;constructor(t,n,o,r,s){this.scrollSyncService=t,this.dependencyDomService=n,this.renderer=o,this.zone=r,this.currentTimeMarkerService=s,this.subscriptions.add(this.dependencyDomService.taskChanges.pipe((0,ae.p)(c=>Y(c.timelineRow)),(0,Oe.n)(c=>this.zone.onStable.pipe((0,O.s)(1),(0,Me.T)(()=>c)))).subscribe(({timelineRow:c})=>{const u=(0,v.nm)()?c.getBoundingClientRect().height:0;this.currentTimeMarkerService.rowHeight=u,this.currentTimeMarkerService.currentTimeMarker=this.currentTimeMarker,this.currentTimeMarkerService.slots=this.slots,this.currentTimeMarkerService.rows=this.rows,this.currentTimeMarkerService.activeView=this.activeView,this.createTimeMarker(),this.renderer.setStyle(this.timelineColumns.nativeElement,"height",(this.rows||[]).length*u+"px")}))}ngOnChanges(t){t.currentTimeMarker&&this.createTimeMarker()}ngAfterViewInit(){this.currentTimeMarkerService.slots=this.slots,this.currentTimeMarkerService.rows=this.rows,this.currentTimeMarkerService.container=this.timelineContent;const t=this.timelineHeaderWrap.nativeElement;this.scrollSyncService.registerElement(this.timelineContent.nativeElement,"timeline"),this.scrollSyncService.registerElement(t,"header"),this.dependencyDomService.registerContentContainer(this.tasksContainer.nativeElement)}ngOnDestroy(){this.subscriptions.unsubscribe()}isNonWorking(t){return t.hasOwnProperty("isWorking")&&!t.isWorking}createTimeMarker(){this.zone.runOutsideAngular(()=>{this.currentTimeMarkerService.removeTimeMarker(),("boolean"==typeof this.currentTimeMarker&&this.currentTimeMarker||this.currentTimeMarker?.enabled)&&this.currentTimeMarkerService.createTimeMarker()})}static \u0275fac=function(n){return new(n||i)(e.rXU(Ra),e.rXU(kt),e.rXU(e.sFG),e.rXU(e.SKi),e.rXU(Kl))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-timeline"]],viewQuery:function(n,o){if(1&n&&(e.GBs(kv,7),e.GBs(Rv,7),e.GBs(Iv,7),e.GBs(yv,7),e.GBs(wv,5,e.c1b),e.GBs(Dv,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.timelineContent=r.first),e.mGM(r=e.lsd())&&(o.timelineColumns=r.first),e.mGM(r=e.lsd())&&(o.timelineHeaderWrap=r.first),e.mGM(r=e.lsd())&&(o.tasksContainer=r.first),e.mGM(r=e.lsd())&&(o.dragPopupContainer=r.first),e.mGM(r=e.lsd())&&(o.dependencyDragCreatePolyline=r.first)}},inputs:{rows:"rows",slots:"slots",groupSlots:"groupSlots",tableWidth:"tableWidth",activeView:"activeView",taskContentTemplate:"taskContentTemplate",taskTemplate:"taskTemplate",summaryTaskTemplate:"summaryTaskTemplate",taskClass:"taskClass",renderDependencyDragClues:"renderDependencyDragClues",dragScrollSettings:"dragScrollSettings",currentTimeMarker:"currentTimeMarker",selectable:"selectable",isTaskSelected:"isTaskSelected",isExpanded:"isExpanded",dependencies:"dependencies"},outputs:{timelineContainerPress:"timelineContainerPress",timelineContainerDrag:"timelineContainerDrag",timelineContainerRelease:"timelineContainerRelease"},standalone:!0,features:[e.OA$,e.aNF],decls:28,vars:28,consts:[["timelineHeaderWrap",""],["t
1imelineContent",""],["timelineColumns",""],["tasksContainer",""],["dependencyDragCreatePolyline",""],["dragPopupContainer",""],[1,"k-gantt-timeline","k-grid","k-grid-md"],[1,"k-grid-header"],[1,"k-grid-header-wrap"],["role","presentation",1,"k-table","k-table-md","k-grid-header-table"],["kendoGanttHeaderTableBody","",3,"groupSlots","slots"],["tabindex","-1","role","tree","aria-roledescription","Timeline","kendoGanttTimelineScrollable","","kendoDraggable","",1,"k-grid-content",3,"kendoPress","kendoDrag","kendoRelease","scrollSettings","enableDrag"],[1,"k-gantt-tables"],["role","presentation",1,"k-table","k-table-md","k-grid-table","k-gantt-rows"],[1,"k-table-tbody"],[3,"class",4,"ngFor","ngForOf"],["role","presentation",1,"k-table","k-table-md","k-gantt-columns"],[4,"ngFor","ngForOf"],[1,"k-table-row"],["class","k-table-td",3,"k-nonwork-hour",4,"ngFor","ngForOf"],["role","presentation",1,"k-table","k-table-md","k-gantt-tasks"],["kendoGanttTasksTableBody","",1,"k-table-tbody",3,"rows","activeView","taskContentTemplate","taskTemplate","summaryTaskTemplate","taskClass","isExpanded","selectable","isTaskSelected","renderDependencyDragClues"],[1,"k-gantt-dependencies-svg"],["kendoGanttDependency","",3,"dependency",4,"ngFor","ngForOf"],[1,"k-table-td"],["kendoGanttDependency","",3,"dependency"]],template:function(n,o){if(1&n){const r=e.RV6();e.j41(0,"div",6)(1,"div",7)(2,"div",8,0)(4,"table",9),e.nrm(5,"tbody",10),e.k0s()()(),e.j41(6,"div",11,1),e.bIt("kendoPress",function(c){return e.eBV(r),e.Njj(o.timelineContainerPress.emit(c))})("kendoDrag",function(c){return e.eBV(r),e.Njj(o.timelineContainerDrag.emit(c))})("kendoRelease",function(c){return e.eBV(r),e.Njj(o.timelineContainerRelease.emit(c))}),e.j41(8,"div",12)(9,"table",13)(10,"tbody",14),e.DNE(11,Ov,2,3,"tr",15),e.k0s()(),e.j41(12,"table",16,2)(14,"colgroup"),e.DNE(15,xv,1,0,"col",17),e.k0s(),e.j41(16,"tbody",14)(17,"tr",18),e.DNE(18,Mv,1,2,"td",19),e.k0s()()(),e.j41(19,"table",20,3),e.nrm(21,"tbody",21),e.k0s()(),e.qSk(),e.j41(22,"svg",22),e.DNE(23,Fv,1,1,"polyline",23),e.nrm(24,"polyline",null,4),e.k0s(),e.joV(),e.eu8(26,null,5),e.k0s()()}2&n&&(e.R7$(4),e.xc7("width",o.tableWidth,"px"),e.R7$(),e.Y8G("groupSlots",o.groupSlots)("slots",o.slots),e.R7$(),e.Y8G("scrollSettings",o.dragScrollSettings)("enableDrag",o.draggableEnabled),e.R7$(3),e.xc7("width",o.tableWidth,"px"),e.R7$(2),e.Y8G("ngForOf",o.rows),e.R7$(),e.xc7("width",o.tableWidth,"px"),e.R7$(3),e.Y8G("ngForOf",o.slots),e.R7$(3),e.Y8G("ngForOf",o.slots),e.R7$(),e.xc7("border-collapse","collapse")("width",o.tableWidth,"px"),e.R7$(2),e.Y8G("rows",o.rows)("activeView",o.activeView)("taskContentTemplate",o.taskContentTemplate)("taskTemplate",o.taskTemplate)("summaryTaskTemplate",o.summaryTaskTemplate)("taskClass",o.taskClass)("isExpanded",o.isExpanded)("selectable",o.selectable)("isTaskSelected",o.isTaskSelected)("renderDependencyDragClues",o.renderDependencyDragClues),e.R7$(2),e.Y8G("ngForOf",o.dependencies))},dependencies:[Vb,jb,v.T5,M.pM,Ab,wb],encapsulation:2})}return i})(),yn=(()=>{class i extends Ge{static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(i)))(o||i)}})();static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-column-base"]],features:[e.Vt3],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),ed=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttCellTemplate",""]],standalone:!0})}return i})(),qp=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttColumnMenuTemplate",""]],standalone:!0})}return i})(),Qp=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttFilterCellTemplate",""]],standalone:!0})}return i})(),Zp=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttFilterMenuTemplate",""]],standalone:!0})}return i})(),eu=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttFooterTemplate",""]],standalone:!0})}return i})(),td=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttHeaderTemplate",""]],standalone:!0})}return i})(),nd=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttEditTemplate",""]],standalone:!0})}return i})(),id=(()=>{class i extends lo{options;headerTemplates=new e.rOR;footerTemplate;columnMenuTemplates=new e.rOR;template;editTemplate;filterCellTemplate;filterMenuTemplate;filter="text";filterable=!0;editor="text";editable=!0;constructor(t,n){super(n),this.options=t}ngOnChanges(){this.options.notifyColumnChanges()}static \u0275fac=function(n){return new(n||i)(e.rXU(Rt),e.rXU(yn,13))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-column"]],contentQueries:function(n,o,r){if(1&n&&(e.wni(r,eu,5),e.wni(r,ed,5),e.wni(r,nd,5),e.wni(r,Qp,5),e.wni(r,Zp,5),e.wni(r,td,4),e.wni(r,qp,4)),2&n){let s;e.mGM(s=e.lsd())&&(o.footerTemplate=s.first),e.mGM(s=e.lsd())&&(o.template=s.first),e.mGM(s=e.lsd())&&(o.editTemplate=s.first),e.mGM(s=e.lsd())&&(o.filterCellTemplate=s.first),e.mGM(s=e.lsd())&&(o.filterMenuTemplate=s.first),e.mGM(s=e.lsd())&&(o.headerTemplates=s),e.mGM(s=e.lsd())&&(o.columnMenuTemplates=s)}},inputs:{filter:"filter",filterable:"filterable",editor:"editor",editable:"editable"},standalone:!0,features:[e.Jv_([{provide:yn,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.OA$,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})();const Yb=()=>!1,Hb=()=>(0,le.of)([]),Xb=()=>null,Wb=()=>null,od=()=>!1;class zb extends v.PM{dataItem;isNew;column;formGroup;originalEvent;sender;item;
1constructor(a){super(),Object.assign(this,a)}}let rd=(()=>{class i{localizationService;constructor(t){this.localizationService=t}get(t){return this.localizationService.get(t)}static \u0275fac=function(n){return new(n||i)(e.KVO(H.Pi))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})();const tu=Object.freeze({collapsible:!0,collapsed:!1}),nu=Object.freeze({collapsible:!0,collapsed:!1,size:"50%",resizable:!0});let iu=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttTaskTemplate",""]],standalone:!0})}return i})(),ou=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttSummaryTaskTemplate",""]],standalone:!0})}return i})(),ru=(()=>{class i{templateRef;constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttTaskContentTemplate",""]],standalone:!0})}return i})(),au=(()=>{class i{templateRef;_position="top";set position(t){this._position=t}get position(){return this._position}constructor(t){this.templateRef=t}static \u0275fac=function(n){return new(n||i)(e.rXU(e.C4Q,8))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttToolbarTemplate",""]],inputs:{position:"position"},standalone:!0})}return i})(),dn=(()=>{class i{optionChangesService;dependencyDomService;slotWidth=100;timelineHeadersDateFormat;currentTimeMarker;constructor(t,n){this.optionChangesService=t,this.dependencyDomService=n}ngOnChanges(t){(0,v.TI)(["slotWidth"],t)&&(this.optionChangesService.notifyColumnChanges(),this.dependencyDomService.notifyChanges()),(0,v.TI)(["timelineHeadersDateFormat"],t)&&this.optionChangesService.notifyDateFormatChanges()}static \u0275fac=function(n){return new(n||i)(e.rXU(Rt),e.rXU(kt))};static \u0275dir=e.FsC({type:i,selectors:[["kendo-gantt-view-base"]],inputs:{slotWidth:"slotWidth",timelineHeadersDateFormat:"timelineHeadersDateFormat",currentTimeMarker:"currentTimeMarker"},features:[e.OA$]})}return i})();const Da=(i,a,t)=>{const n=a.find(o=>t.extractFromTask(o.data,"id")===t.extractFromTask(i,"id"));return su(n)},su=i=>({dataItem:i.data,parent:i.parent.data?su(i.parent):null});let Kb=(()=>{class i{mapper;editService;localizationService;tasks;dependencies;dependencyType;dependenciesChange=new e.bkB;selectedKeys=[];formGroups=new R.Yp([]);dependencyTypes=this.getDependencyTypes();plusIcon=de.WWM;minusIcon=de.cmS;get taskId(){return this.editService.dataItem.id}get dependencyIdField(){return"predecessor"===this.dependencyType?"fromId":"toId"}constructor(t,n,o){this.mapper=t,this.editService=n,this.localizationService=o}ngOnInit(){if(0===this.formGroups.controls.length){const t=this.mapper.dependencyFields;this.dependencies.forEach(n=>{const o=new R.gE({[t.id]:new R.MJ(this.mapper.extractFromDependency(n,"id")),[t.fromId]:new R.MJ(this.mapper.extractFromDependency(n,"fromId"),R.k0.required),[t.toId]:new R.MJ(this.mapper.extractFromDependency(n,"toId"),R.k0.required),[t.type]:new R.MJ(this.mapper.extractFromDependency(n,"type"),R.k0.required)});this.formGroups.push(o)})}this.formGroups.valueChanges.subscribe(t=>{this.formGroups.controls.forEach(n=>{n.dirty&&this.editService.updateDependencies(n.value)}),this.dependenciesChange.emit(t)})}getFormControl(t,n){return this.formGroups.controls.find((o,r)=>r===t).get(this.mapper.dependencyFields[n])}getText(t){return this.localizationService.get(t)}getDependencyTypes(){return Object.keys(Xe).filter(n=>"number"==typeof Xe[n]).map(n=>({type:n,id:Xe[n]}))}addHandler(){const t=this.mapper.dependencyFields,n=new R.gE({[t.id]:new R.MJ,[t.fromId]:new R.MJ("toId"===this.dependencyIdField?this.taskId:null,R.k0.required),[t.toId]:new R.MJ("fromId"===this.dependencyIdField?this.taskId:null,R.k0.required),[t.type]:new R.MJ(null,R.k0.required)});this.formGroups.push(n)}removeHandler(){const[t]=this.selectedKeys,n=this.formGroups.at(t).value;this.editService.deleteDependency(n),this.formGroups.removeAt(t)}static \u0275fac=function(n){return new(n||i)(e.rXU(We),e.rXU(Wn),e.rXU(rd))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-dependencies-table"]],inputs:{tasks:"tasks",dependencies:"dependencies",dependencyType:"dependencyType"}
1,outputs:{dependenciesChange:"dependenciesChange"},standalone:!0,features:[e.aNF],decls:6,vars:8,consts:[["kendoGridSelectBy","",3,"selectedKeysChange","data","selectable","selectedKeys","height"],["kendoGridToolbarTemplate",""],[3,"title","field"],["kendoGridCellTemplate",""],["field","type",3,"title"],["kendoButton","","icon","plus",3,"click","svgIcon"],["kendoButton","","icon","minus",3,"click","svgIcon","disabled"],["textField","title","valueField","id",3,"data","valuePrimitive","formControl"],["textField","type","valueField","id",3,"data","valuePrimitive","formControl"]],template:function(n,o){1&n&&(e.j41(0,"kendo-grid",0),e.mxI("selectedKeysChange",function(s){return e.DH7(o.selectedKeys,s)||(o.selectedKeys=s),s}),e.DNE(1,Nv,4,5,"ng-template",1),e.j41(2,"kendo-grid-column",2),e.DNE(3,Gv,1,3,"ng-template",3),e.k0s(),e.j41(4,"kendo-grid-column",4),e.DNE(5,Av,1,3,"ng-template",3),e.k0s()()),2&n&&(e.Y8G("data",o.dependencies)("selectable",e.lJ4(7,Pv)),e.R50("selectedKeys",o.selectedKeys),e.Y8G("height",275),e.R7$(2),e.Y8G("title",o.getText("taskEditingDependenciesGridNameColumnTitle"))("field",o.dependencyIdField),e.R7$(2),e.Y8G("title",o.getText("taskEditingDependenciesGridTypeColumnTitle")))},dependencies:[xt._ab,xt.sQF,xt.vGN,Be.Qp,xt.Ioe,xt.i4w,at.V9,R.X1,R.BC,R.l_],encapsulation:2})}return i})(),Jb=(()=>{class i{mapper;editService;localizationService;constructor(t,n,o){this.mapper=t,this.editService=n,this.localizationService=o}get formGroup(){return this.editService.taskFormGroup}getText(t){return this.localizationService.get(t)}static \u0275fac=function(n){return new(n||i)(e.rXU(We),e.rXU(Wn),e.rXU(rd))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-task-fields"]],standalone:!0,features:[e.aNF],decls:7,vars:5,consts:[["title",""],["start",""],["end",""],["completionRatio",""],[1,"k-form","k-form-md",3,"formGroup"],[4,"ngIf"],[1,"k-hstack"],[3,"width",4,"ngIf"],[3,"for","text"],["kendoTextBox","",3,"formControlName"],[3,"formControlName"],["format","p2",3,"formControlName","min","max","decimals","step"]],template:function(n,o){1&n&&(e.j41(0,"form",4),e.DNE(1,Lv,4,3,"kendo-formfield",5),e.j41(2,"div",6),e.DNE(3,Bv,4,5,"kendo-formfield",7),e.nrm(4,"kendo-treelist-spacer"),e.DNE(5,jv,4,5,"kendo-formfield",7),e.k0s(),e.DNE(6,Vv,4,9,"kendo-formfield",7),e.k0s()),2&n&&(e.Y8G("formGroup",o.formGroup),e.R7$(),e.Y8G("ngIf",o.formGroup.get(o.mapper.taskFields.title)),e.R7$(2),e.Y8G("ngIf",o.formGroup.get(o.mapper.taskFields.start)),e.R7$(2),e.Y8G("ngIf",o.formGroup.get(o.mapper.taskFields.end)),e.R7$(),e.Y8G("ngIf",o.formGroup.get(o.mapper.taskFields.completionRatio)))},dependencies:[R.X1,R.qT,R.me,R.BC,R.cb,R.j4,R.JD,M.bT,je.KS,ee.UF,je.gl,z.P3,ba,je.Jh],encapsulation:2})}return i})(),qb=(()=>{class i{mapper;editService;cdr;localizationService;data;loadedTasks;saveIcon=de.DLl;cancelIcon=de.q$H;deleteIcon=de.ITL;constructor(t,n,o,r){this.mapper=t,this.editService=n,this.cdr=o,this.localizationService=r}ngOnInit(){this.editService.loadTasks(this.data).subscribe(t=>{this.loadedTasks=t})}get predecessors(){return this.editService.predecessors}set predecessors(t){this.editService.predecessors=t}get successors(){return this.editService.successors}set successors(t){this.editService.successors=t}getText(t){return this.localizationService.get(t)}getDependencyType(t){return Xe[t]}handleEditingResult(t){this.editService.triggerEditEvent(t)}handleTaskDelete(){this.editService.taskDelete.next(this.editService.dataItem)}static \u0275fac=function(n){return new(n||i)(e.rXU(We),e.rXU(Wn),e.rXU(e.gRc),e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-edit-dialog"]],inputs:{data:"data"},standalone:!0,features:[e.aNF],decls:17,vars:22,consts:[[3,"close","title","width","height","autoFocusedElement"],[3,"closeTitle"],[3,"keepTabContent"],[3,"title","selected"],["kendoTabContent",""],[3,"title"],["layout","start"],["kendoButton","","themeColor","primary","icon","save",3,"click","svgIcon"],["kendoButton","","icon","cancel-outline",3,"click","svgIcon"],["kendoButton","","themeColor","primary","fillMode","flat","icon","delete",3,"svgIcon","kendoEventsOutsideAngular","scope"],["dependencyType","predecessor",3,"dependenciesChange","tasks","dependencies"],["dependencyType","successor",3,"dependenciesChange","tasks","dependencies"]],template:function(n,o){1&n&&(e.j41(0,"kendo-dialog",0),e.bIt("close",function(){return o.handleEditingResult("cancel")}),e.nrm(1,"kendo-dialog-messages",1),e.j41(2,"kendo-tabstrip",2)(3,"kendo-tabstrip-tab",3),e.DNE(4,$v,1,0,"ng-template",4),e.k0s(),e.j41(5,"kendo-tabstrip-tab",5),e.DNE(6,Uv,1,2,"ng-template",4),e.k0s(),e.j41(7,"kendo-tabstrip-tab",5),e.DNE(8,Yv,1,2,"ng-template",4),e.k0s()(),e.j41(9,"kendo-dialog-actions",6)(10,"button",7),e.bIt("click",function(){return o.handleEditingResult("save")}),e.EFF(11),e.k0s(),e.j41(12,"button",8),e.bIt("click",function(){return o.handleEditingResult("cancel")}),e.EFF(13),e.k0s(),e.nrm(14,"kendo-treelist-spacer"),e.j41(15,"button",9),e.EFF(16),e.k0s()()()),2&n&&(e.Y8G("title",o.getText("taskEditingDialogTitle"))("width",575)("height",470)("autoFocusedElement",".k-actions .k-button-solid-primary"),e.R7$(),e.Y8G("closeTitle",o.getText("taskEditingDialogCloseTitle")),e.R7$(),e.xc7("height",345,"px"),e.Y8G("keepTabContent",!0),e.R7$(),e.Y8G("title",o.getText("taskEditingGeneralTabTitle"))("selected",!0),e.R7$(2),e.Y8G("title",o.getText("taskEditingPredecessorsTabTitle")),e.R7$(2),e.Y8G("title",o.getText("taskEditingSuccessorsTabTitle")),e.R7$(3),e.Y8G("svgIcon",o.saveIcon),e.R7$(),e.SpI(" ",o.getText("saveButtonText")," "),e.R7$(),e.Y8G("svgIcon",o.cancelIcon),e.R7$(),e.SpI(" ",o.getText("cancelButtonText")," "),e.R7$(2),e.Y8G("svgIcon",o.deleteIcon)("kendoEventsOutsideAngular",e.eq3(20,Ul,o.handleTaskDelete))("scope",o),e.R7$(),e.SpI(" ",o.getText("deleteButtonText")," "))},dependencies:[ie.mq,ie.Xh,ht.z$,ht.sl,ht.Ai,Jb,Kb,ie.hf,Be.Qp,ba,v.Uj],encapsulation:2})}return i})(),lu=(()=>{class i{renderer;focusableContent;focusIndex=0;constructor(t){this.renderer=t}updateFocus(){this.focusableContent.forEach(t=>{this.renderer.setAttribute(t,"tabindex","-1")}),this.renderer.setAttribute(this.focusableContent[this.focusIndex],"tabindex","0"),this.focusableContent[this.focusIndex].focus()}static \u0275fac=function(n){return new(n||i)(e.KVO(e.sFG))};static \u0275prov=e.jDH({token:i,factory:i.\u0275fac})}return i})(),ad=(()=>{class i{localizationService;hostClass=!0;views;activeView="week";activeViewChange=new e.bkB;constructor(t){this.localizationService=t}onClick(t){t!==this.activeView&&this.activeViewChange.emit(t)}getViewTypeText(t){return this.localizationService.get(`${t}ViewText`)}onActiveViewChange(t){this.activeViewChange.emit(t.target.value)}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-view-selector"]],hostVars:2,hostBindings:function(n,o){2&n&&e.AVh("k-gantt-views-wrapper",o.hostClass)},inputs:{views:"views",activeView:"activeView"},outputs:{activeViewChange:"activeViewChange"},standalone:!0,features:[e.aNF],decls:4,vars:4,consts:[["aria-label","View Selector",1,"k-dropdownlist","k-picker","k-rounded-md","k-views-dropdown",3,"change","value"],[3,"value",4,"ngFor","ngForOf"],["selection","single",1,"k-gantt-views",3,"navigable"],["kendoButton","","type","button",3,"selected","click",4,"ngFor","ngForOf"],[3,"value"],["kendoButton","","type","button",3,"click","
1selected"]],template:function(n,o){1&n&&(e.j41(0,"select",0),e.bIt("change",function(s){return o.onActiveViewChange(s)}),e.DNE(1,Hv,2,2,"option",1),e.k0s(),e.j41(2,"kendo-buttongroup",2),e.DNE(3,Xv,2,2,"button",3),e.k0s()),2&n&&(e.Y8G("value",o.activeView),e.R7$(),e.Y8G("ngForOf",o.views),e.R7$(),e.Y8G("navigable",!1),e.R7$(),e.Y8G("ngForOf",o.views))},dependencies:[M.pM,R.X1,R.xH,R.y7,Be.Z7,Be.Qp],encapsulation:2})}return i})(),sd=(()=>{class i{localizationService;editService;ngZone;data=[{text:this.getText("addChildText"),type:"addChild"},{text:this.getText("addAboveText"),type:"addAbove"},{text:this.getText("addBelowText"),type:"addBelow"}];icon="plus";svgIcon=de.WWM;constructor(t,n,o){this.localizationService=t,this.editService=n,this.ngZone=o}getText(t){return this.localizationService.get(t)}handleOpen(t){this.editService.getSelectedItem()||t.preventDefault()}handleMouseClick(){this.editService.getSelectedItem()||this.ngZone.run(()=>{this.editService.addEvent.next({selectedItem:null,actionType:"addTask"})})}handleItemClick(t){this.editService.addEvent.next({actionType:t.type,selectedItem:null})}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi),e.rXU(Wn),e.rXU(e.SKi))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-add-task"]],inputs:{data:"data",icon:"icon",svgIcon:"svgIcon"},standalone:!0,features:[e.aNF],decls:2,vars:8,consts:[[3,"itemClick","open","data","icon","svgIcon","kendoEventsOutsideAngular","scope"]],template:function(n,o){1&n&&(e.j41(0,"kendo-dropdownbutton",0),e.bIt("itemClick",function(s){return o.handleItemClick(s)})("open",function(s){return o.handleOpen(s)}),e.EFF(1),e.k0s()),2&n&&(e.Y8G("data",o.data)("icon",o.icon)("svgIcon",o.svgIcon)("kendoEventsOutsideAngular",e.eq3(6,Ul,o.handleMouseClick))("scope",o),e.R7$(),e.SpI(" ",o.getText("addTaskText")," "))},dependencies:[Be.dT,v.Uj],encapsulation:2})}return i})(),Qb=(()=>{class i{hostEl;navigationService;context={};role="toolbar";toolbarSizingClass=!0;clickHandler(t){if(this.navigable){const n=(0,v.kp)(t.target,v.tp),o=this.navigationService.focusableContent.indexOf(n);o>-1&&(this.navigationService.focusIndex=o),this.navigationService.updateFocus()}}arrowLeftListener(){this.navigable&&(0,v.nm)()&&(this.navigationService.focusIndex--,this.navigationService.focusIndex<0&&(this.navigationService.focusIndex=this.navigationService.focusableContent.length-1),this.navigationService.updateFocus())}arrowRightListener(){this.navigable&&(0,v.nm)()&&(this.navigationService.focusIndex++,this.navigationService.focusIndex>=this.navigationService.focusableContent.length&&(this.navigationService.focusIndex=0),this.navigationService.updateFocus())}activeViewChange=new e.bkB;showAddTask;showViewSelector;views;activeView;toolbarTemplate;navigable;set position(t){this.context.position=this._position=t}get position(){return this._position}get toolbarTemplateRef(){return this.toolbarTemplate?this.toolbarTemplate.templateRef:void 0}get renderTemplate(){const t=this.toolbarTemplate,n=t?t.position:null;return t&&("both"===n||n===this.position)}_position;constructor(t,n){this.hostEl=t,this.navigationService=n}handleViewChange(t){this.activeViewChange.emit(t)}ngAfterViewInit(){if((0,v.nm)()){const t=Array.from(this.hostEl.nativeElement.querySelectorAll(v.Uo)||[]).filter(n=>(0,v.zN)(n));t.length&&(this.navigationService.focusableContent=t)}}static \u0275fac=function(n){return new(n||i)(e.rXU(e.aKT),e.rXU(lu))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-toolbar"]],hostVars:3,hostBindings:function(n,o){1&n&&e.bIt("click",function(s){return o.clickHandler(s)})("keydown.arrowleft",function(s){return o.arrowLeftListener(s)})("keydown.arrowright",function(s){return o.arrowRightListener(s)}),2&n&&(e.BMQ("role",o.role),e.AVh("k-toolbar-md",o.toolbarSizingClass))},inputs:{showAddTask:"showAddTask",showViewSelector:"showViewSelector",views:"views",activeView:"activeView",toolbarTemplate:"toolbarTemplate",navigable:"navigable",position:"position"},outputs:{activeViewChange:"activeViewChange"},standalone:!0,features:[e.Jv_([lu]),e.aNF],decls:2,vars:2,consts:[[4,"ngIf"],[1,"k-spacer","k-toolbar-spacer"],[3,"views","activeView","activeViewChange",4,"ngIf"],[3,"activeViewChange","views","activeView"],[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(n,o){1&n&&e.DNE(0,Kv,4,2,"ng-container",0)(1,qv,1,2,null,0),2&n&&(e.Y8G("ngIf",!o.renderTemplate),e.R7$(),e.Y8G("ngIf",o.renderTemplate))},dependencies:[M.bT,sd,ad,M.T3],encapsulation:2})}return i})(),Oa=(()=>{class i extends H.EX{taskEditingGeneralTabTitle;taskEditingPredecessorsTabTitle;taskEditingSuccessorsTabTitle;taskEditingDependenciesAddButtonText;taskEditingDependenciesRemoveButtonText;taskEditingDependenciesGridNameColumnTitle;taskEditingDependenciesGridTypeColumnTitle;deleteButtonText;taskDeleteLabel;taskEditingDialogTitle;taskEditingDialogCloseTitle;confirmationDialogCloseTitle;confirmationDialogTitle;addTaskText;addChildText;addAboveText;addBelowText;cancelButtonText;saveButtonText;titleFieldInputLabel;startFieldInputLabel;endFieldInputLabel;completionRatioFieldInputLabel;confirmationDialogContent;dayViewText;weekViewText;monthViewText;yearViewText;noRecords;filter;filterEqOperator;filterNotEqOperator;filterIsNullOperator;filterIsNotNullOperator;filterIsEmptyOperator;filterIsNotEmptyOperator;filterStartsWithOperator;filterContainsOperator;filterNotContainsOperator;filterEndsWithOperator;filterGteOperator;filterGtOperator;filterLteOperator;filterLtOperator;filterIsTrue;filterIsFalse;filterBooleanAll;filterAfterOrEqualOperator;filterAfterOperator;filterBeforeOperator;filterBeforeOrEqualOperator;filterFilterButton;filterClearButton;filterAndLogic;
1filterOrLogic;loading;columnMenu;columns;lock;unlock;sortable;sortAscending;sortDescending;sortedAscending;sortedDescending;sortedDefault;columnsApply;columnsReset;static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(i)))(o||i)}})();static \u0275dir=e.FsC({type:i,selectors:[["kendo-gantt-messages-base"]],inputs:{taskEditingGeneralTabTitle:"taskEditingGeneralTabTitle",taskEditingPredecessorsTabTitle:"taskEditingPredecessorsTabTitle",taskEditingSuccessorsTabTitle:"taskEditingSuccessorsTabTitle",taskEditingDependenciesAddButtonText:"taskEditingDependenciesAddButtonText",taskEditingDependenciesRemoveButtonText:"taskEditingDependenciesRemoveButtonText",taskEditingDependenciesGridNameColumnTitle:"taskEditingDependenciesGridNameColumnTitle",taskEditingDependenciesGridTypeColumnTitle:"taskEditingDependenciesGridTypeColumnTitle",deleteButtonText:"deleteButtonText",taskDeleteLabel:"taskDeleteLabel",taskEditingDialogTitle:"taskEditingDialogTitle",taskEditingDialogCloseTitle:"taskEditingDialogCloseTitle",confirmationDialogCloseTitle:"confirmationDialogCloseTitle",confirmationDialogTitle:"confirmationDialogTitle",addTaskText:"addTaskText",addChildText:"addChildText",addAboveText:"addAboveText",addBelowText:"addBelowText",cancelButtonText:"cancelButtonText",saveButtonText:"saveButtonText",titleFieldInputLabel:"titleFieldInputLabel",startFieldInputLabel:"startFieldInputLabel",endFieldInputLabel:"endFieldInputLabel",completionRatioFieldInputLabel:"completionRatioFieldInputLabel",confirmationDialogContent:"confirmationDialogContent",dayViewText:"dayViewText",weekViewText:"weekViewText",monthViewText:"monthViewText",yearViewText:"yearViewText",noRecords:"noRecords",filter:"filter",filterEqOperator:"filterEqOperator",filterNotEqOperator:"filterNotEqOperator",filterIsNullOperator:"filterIsNullOperator",filterIsNotNullOperator:"filterIsNotNullOperator",filterIsEmptyOperator:"filterIsEmptyOperator",filterIsNotEmptyOperator:"filterIsNotEmptyOperator",filterStartsWithOperator:"filterStartsWithOperator",filterContainsOperator:"filterContainsOperator",filterNotContainsOperator:"filterNotContainsOperator",filterEndsWithOperator:"filterEndsWithOperator",filterGteOperator:"filterGteOperator",filterGtOperator:"filterGtOperator",filterLteOperator:"filterLteOperator",filterLtOperator:"filterLtOperator",filterIsTrue:"filterIsTrue",filterIsFalse:"filterIsFalse",filterBooleanAll:"filterBooleanAll",filterAfterOrEqualOperator:"filterAfterOrEqualOperator",filterAfterOperator:"filterAfterOperator",filterBeforeOperator:"filterBeforeOperator",filterBeforeOrEqualOperator:"filterBeforeOrEqualOperator",filterFilterButton:"filterFilterButton",filterClearButton:"filterClearButton",filterAndLogic:"filterAndLogic",filterOrLogic:"filterOrLogic",loading:"loading",columnMenu:"columnMenu",columns:"columns",lock:"lock",unlock:"unlock",sortable:"sortable",sortAscending:"sortAscending",sortDescending:"sortDescending",sortedAscending:"sortedAscending",sortedDescending:"sortedDescending",sortedDefault:"sortedDefault",columnsApply:"columnsApply",columnsReset:"columnsReset"},features:[e.Vt3]})}return i})(),Zb=(()=>{class i extends Oa{service;constructor(t){super(),this.service=t}static \u0275fac=function(n){return new(n||i)(e.rXU(H.Pi))};static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttLocalizedMessages",""]],standalone:!0,features:[e.Jv_([{provide:Oa,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3]})}return i})();const du="k-gantt-treelist-nested-columns",cu={enabled:!0,step:3,interval:1,threshold:10};let Ro=(()=>{class i{timelineViewService;scrollSyncService;renderer;mapper;optionChangesService;dependencyDomService;editService;localizationService;hostElement;zone;navigation;currentTimeMarkerService;treeList;timeline;taskContentTemplate;taskTemplate;summaryTaskTemplate;toolbarTemplateChildren;get toolbarTemplate(){return this._customToolbarTemplate?this._customToolbarTemplate:this.toolbarTemplateChildren?this.toolbarTemplateChildren.first:void 0}set toolbarTemplate(t){this._customToolbarTemplate=t}roleDescription="Gantt Chart";get hostRoleDescriptionAttr(){return this.roleDescription}role="application";get hostRoleAttr(){return this.role}hostClasses=!0;get dir(){return this.direction}set columns(t){this._columns=t,this.updateTreeListGroupClass(t)}get columns(){return this._columns}set taskModelFields(t){this.mapper.taskFields=t}
1set dependencyModelFields(t){this.mapper.dependencyFields=t}views;set activeView(t){this._activeView=t}get activeView(){const t=this.views.find(n=>n.type===this._activeView)?this._activeView:this.views.first.type;return this.currentTimeMarkerService.activeView=t,t}get activeViewCurrentTimeMarker(){const t=this.views.find(n=>n.type===this._activeView)?.currentTimeMarker;return!1!==t&&(t||this.currentTimeMarker)}set data(t){this._data=Np(t),this.loadTimelineData()}get data(){return this._data}isSelected=od;validateNewDependency=this.defaultValidateNewDependencyCallback.bind(this);selectionChange=new e.bkB;selectable=!1;set toolbarSettings(t){this._toolbarSettings={position:t.position||"top",addTaskTool:t.addTaskTool||"none",viewSelectorTool:t.viewSelectorTool||"top"}}get toolbarSettings(){return this._toolbarSettings}toolbarAriaLabel="Toolbar";set fetchChildren(t){this._fetchChildren=t,this.editService.fetchChildren=t}get fetchChildren(){return this._fetchChildren}set hasChildren(t){this._hasChildren=t,this.editService.hasChildren=t}get hasChildren(){return this._hasChildren}dependencies=[];sortable=!1;sort=[];filterable=!1;filter;workDayStart="08:00";workDayEnd="17:00";workWeekStart=1;workWeekEnd=5;navigable=!1;set timelinePaneOptions(t){this._timelinePaneOptions.collapsed&&!t.collapsed&&this.dependencyDomService.notifyChanges(),this._timelinePaneOptions={...nu,...t}}get timelinePaneOptions(){return{...this._timelinePaneOptions,size:this.treeListPaneOptions.collapsed?"100%":this._timelinePaneOptions.size}}set treeListPaneOptions(t){this._treeListPaneOptions={...tu,...t}}get treeListPaneOptions(){return this._treeListPaneOptions}set taskClass(t){if((0,e.naY)()&&"function"!=typeof t)throw new Error(`taskClass must be a function, but received ${JSON.stringify(t)}.`);this._taskClass=t}get taskClass(){return this._taskClass}set rowClass(t){if((0,e.naY)()&&"function"!=typeof t)throw new Error(`rowClass must be a function, but received ${JSON.stringify(t)}.`);this._rowClass=t}get rowClass(){return this._rowClass}get taskIdField(){return this.mapper.taskFields.id}isExpanded;columnsAutoSize=!1;currentTimeMarker=!0;columnMenu=!1;columnsReorderable=!1;columnsResizable=!1;set dragScrollSettings(t){this._dragScrollSettings={...cu,...t}}get dragScrollSettings(){return this._dragScrollSettings}rowExpand=new e.bkB;taskDblClick=new e.bkB;cellDblClick=new e.bkB;cellClose=new e.bkB;taskDelete=new e.bkB;rowCollapse=new e.bkB;remove=new e.bkB;
1cancel=new e.bkB;save=new e.bkB;taskAdd=new e.bkB;dependencyAdd=new e.bkB;sortChange=new e.bkB;filterChange=new e.bkB;dataStateChange=new e.bkB;treeListPaneCollapsedChange=new e.bkB;timelinePaneCollapsedChange=new e.bkB;timelinePaneSizeChange=new e.bkB;activeViewChange=new e.bkB;columnResize=new e.bkB;columnReorder=new e.bkB;columnVisibilityChange=new e.bkB;columnLockedChange=new e.bkB;cellClick=new e.bkB;taskClick=new e.bkB;get renderedTreeListItems(){return Y(this.treeList)?this.treeList.view.data.map(t=>t.data):[]}get viewItems(){return Y(this.treeList)?this.treeList.view.data:[]}get filterMenu(){return!!this.filterable&&"menu"}renderDependencyDragClues=!1;timelineSlots;timelineGroupSlots;tableWidth;get viewService(){return this.views&&this.views.length?this.timelineViewService.service(this.activeView):null}get isTaskSelected(){return this.selectable?this.isSelected:od}get idGetter(){if(Y(this.treeList))return this.treeList.idGetter}get viewTypes(){return this.views.map(t=>t.type)}expandStateChange=new e.bkB;showEditingDialog=!1;showConfirmationDialog=!1;get isInEditMode(){return this.showEditingDialog||this.showConfirmationDialog||this.treeList.isEditing()}showLicenseWatermark=!1;_columns=new e.rOR;_data=[];_dragScrollSettings={...cu};_timelinePaneOptions={...nu};_treeListPaneOptions={...tu};_customToolbarTemplate;_rowClass=Xb;_taskClass=Wb;_activeView="week";_toolbarSettings={position:"top",addTaskTool:"none",viewSelectorTool:"top"};_fetchChildren=Hb;_hasChildren=Yb;lastTreeListCellClick;direction;rtl=!1;editItem;optionChangesSubscriptions=new K.y;editServiceSubscription=new K.y;localizationSubscription;keydownListenerDisposers;constructor(t,n,o,r,s,c,u,g,b,k,D,V){this.timelineViewService=t,this.scrollSyncService=n,this.renderer=o,this.mapper=r,this.optionChangesService=s,this.dependencyDomService=c,this.editService=u,this.localizationService=g,this.hostElement=b,this.zone=k,this.navigation=D,this.currentTimeMarkerService=V;const U=(0,Wr.$j)(ab);this.showLicenseWatermark=(0,v.Em)(U),this.optionChangesSubscriptions.add(this.optionChangesService.viewChanges.subscribe(()=>{this.loadTimelineData()})),this.optionChangesSubscriptions.add(this.optionChangesService.dateFormatChanges.subscribe(()=>{this.loadTimelineData()})),this.optionChangesSubscriptions.add(this.optionChangesService.columnChanges.subscribe(()=>{this.treeList.columns.notifyOnChanges()})),this.editService.getSelectedItem=this.getFirstSelectedItem.bind(this),this.editServiceSubscription.add(this.editService.showEditingDialog.subscribe(B=>this.showEditingDialog=B)),this.editServiceSubscription.add(this.editService.taskDelete.subscribe(B=>{(0,v.SF)(this.taskDelete)&&this.zone.run(()=>this.notifyTaskDelete(B))})),this.editServiceSubscription.add(this.editService.editEvent.subscribe(B=>{this[B.editResultType].emit({taskFormGroup:B.taskFormGroup,item:Da(B.dataItem,this.treeList.view.data,this.mapper),dependencies:B.dependencies,sender:this}),this.showConfirmationDialog=this.showEditingDialog=!1,this.editService.dataItem=this.editService.taskFormGroup=null,this.updateView(),this.navigable&&this.focus()})),this.editServiceSubscription.add(this.editService.addEvent.subscribe(B=>{const De=this.getFirstSelectedItem();this.taskAdd.emit({actionType:B.actionType,selectedItem:De?Da(De,this.treeList.view.data,this.mapper):null}),this.updateView()})),this.localizationSubscription=this.localizationService.changes.subscribe(({rtl:B})=>{this.rtl=B,this.direction=this.rtl?"rtl":"ltr",this.currentTimeMarkerService.rtl=B})}ngOnChanges(t){(0,v.TI)(["data","activeView","workWeekStart","workWeekEnd","workDayStart","workDayEnd"],t)&&this.loadTimelineData()}ngAfterViewInit(){this.updateTreeListMargin(),this.zone.runOutsideAngular(()=>{this.keydownListenerDisposers=this.renderer.listen(this.hostElement.nativeElement,"keydown",this.handleKeydown.bind(this))}),this.navigable&&this.navigation.initialize({treeList:this.treeList,host:this.hostElement.nativeElement,treeListElement:this.treeList.wrapper.nativeElement,timelineElement:this.timeline.timelineContent.nativeElement,columns:this.columns,data:this.data});const t=this.treeList.wrapper.nativeElement.querySelector("kendo-treelist-list > div");this.scrollSyncService.registerElement(t,"treelist")}ngAfterContentInit(){if((0,e.naY)()&&0===this.views.length)throw new Error("No views declared for <kendo-gantt>. Please, declare at least one view.");this.loadTimelineData(),this.updateTreeListGroupClass()}ngOnDestroy(){this.optionChangesSubscriptions.unsubscribe(),this.editServiceSubscription.unsubscribe(),this.localizationSubscription&&this.localizationSubscription.unsubscribe(),Y(this.keydownListenerDisposers)&&(this.keydownListenerDisposers(),this.keydownListenerDisposers=null)}focus(){this.navigable&&this.navigation.focusLastActiveItem()}focusCell(t,n){this.navigable&&this.navigation.focusCell(t,n)}focusTask(t){this.navigable&&this.navigation.focusTask(t)}autoFitColumn(t){Y(this.treeList)&&this.treeList.autoFitColumn(t)}autoFitColumns(t=this.columns){Y(this.treeList)&&this.treeList.autoFitColumns(t)}reload(t,n){Y(this.treeList)&&this.treeList.reload(t,n)}reorderColumn(t,n,o={before:!1}){Y(this.treeList)&&this.treeList.reorderColumn(t,n,o)}updateView(){Y(this.treeList)&&this.treeList.updateView(),this.loadTimelineData(),this.dependencyDomService.n
1otifyChanges()}editTask(t,n){if(!this.showEditingDialog){const o=this.mapper.extractFromTask(t,"id"),r=this.dependencies.filter(s=>this.mapper.extractFromDependency(s,"toId")===o||this.mapper.extractFromDependency(s,"fromId")===o);this.editService.createEditDialog(t,n,r)}}closeTaskDialog(){this.showEditingDialog&&this.editService.closeEditDialog()}openConfirmationDialog(){this.showConfirmationDialog=!0}handleConfirmationDialogClose(){this.showConfirmationDialog=!1,this.navigable&&this.focus()}editCell(t,n,o){this.treeList.editCell(t,n,o)}closeCell(){this.treeList.closeCell()}handleCellClose(t){this.cellClose.emit(new zb({...t,item:this.editItem,sender:this})),this.dependencyDomService.notifyChanges()}onTreeListCollapsedChange(t){this.treeListPaneCollapsedChange.emit(t),t||this.scrollSyncService.syncScrollTop("timeline","treelist")}onTimelineCollapsedChange(t){this.timelinePaneCollapsedChange.emit(t),t||(this.scrollSyncService.syncScrollTop("treelist","timeline"),this.dependencyDomService.notifyChanges())}loadTimelineData(){if(!Y(this.viewService))return;const t=this.getActiveViewOptions();this.viewService.options={workWeekStart:this.workWeekStart,workWeekEnd:this.workWeekEnd,workDayStart:this.workDayStart,workDayEnd:this.workDayEnd,...t},this.tableWidth=this.viewService.getTableWidth(this.data);const[n,o]=this.viewService.getSlots(this.data);this.timelineSlots=o,this.timelineGroupSlots=n}showToolbar(t){return"none"!==this.toolbarSettings.position&&[t,"both"].indexOf(this.toolbarSettings.position)>-1}handleColumnVisibilityChange(t){this.columnVisibilityChange.emit(t),this.updateTreeListGroupClass()}onTimelinePaneSizeChange(t){this._timelinePaneOptions.size=t,this.timelinePaneSizeChange.emit(t)}handleTimelineRightClick(t){const n=t.target,o=this.hostElement.nativeElement;if(Xn(n,o)&&!Eo(n,o)&&(0,v.SF)(this.taskClick)){const r=ln(n,o),s=this.renderedTreeListItems[r];this.zone.run(()=>this.notifyTaskClick(t,s,r))}}handleTimelineClick(t){const n=t.target,o=this.hostElement.nativeElement;if(!Xn(n,o)||Eo(n,o))return;const r=ln(n,o),s=this.renderedTreeListItems[r],c=this.getSelectionAction(t,s);((0,v.SF)(this.selectionChange)&&!this.isSameSelection(c,s)||(0,v.SF)(this.taskClick))&&this.zone.run(()=>{this.notifySelectionChange(s,c),this.notifyTaskClick(t,s,r)})}handleTreeListDoubleClick(t){!Y(this.lastTreeListCellClick)||t.target!==this.lastTreeListCellClick.originalEvent.target||(this.editItem=Da(this.lastTreeListCellClick.dataItem,this.treeList.view.data,this.mapper),(0,v.SF)(this.cellDblClick)&&this.zone.run(()=>{this.cellDblClick.emit({column:this.lastTreeListCellClick.column,columnIndex:this.lastTreeListCellClick.columnIndex,dataItem:this.lastTreeListCellClick.dataItem,isEdited:this.lastTreeListCellClick.isEdited,originalEvent:this.lastTreeListCellClick.originalEvent,rowIndex:this.lastTreeListCellClick.rowIndex,type:"dblclick",sender:this})}))}handleTreeListSelectionChange(t){if(Y(this.lastTreeListCellClick)&&"contextmenu"===this.lastTreeListCellClick.type)return;const n=t.items.map(r=>r.dataItem)[0];this.notifySelectionChange(n,t.action)}handleTreeListCellClick(t){this.lastTreeListCellClick=t,this.cellClick.emit({column:t.column,columnIndex:t.columnIndex,dataItem:t.dataItem,isEdited:t.isEdited,originalEvent:t.originalEvent,rowIndex:t.rowIndex,type:t.type,sender:this})}handleDeleteConfirmation(){this.editService.triggerEditEvent("remove")}handleTimelineMouseDown(t){const n=t.target,o=this.hostElement.nativeElement;!Xn(n,o)||Eo(n,o)||t.preventDefault()}handleTimelineDblClick(t){const n=t.target,o=this.hostElement.nativeElement;if(Xn(n,o)&&!Eo(n,o)&&(0,v.SF)(this.taskDblClick)){const r=ln(n,o),s=this.renderedTreeListItems[r];this.zone.run(()=>this.taskDblClick.emit({dataItem:s,originalEvent:t,sender:this,index:r,type:"dblclick"}))}}getText(t){return this.localizationService.get(t)}changeActiveView(t){t!==this.activeView&&(this.activeView=t,this.loadTimelineData(),this.scrollSyncService.resetTimelineScrollLeft(),this.activeViewChange.emit(t),this.currentTimeMarkerService.slots=this.timelineSlots,this.currentTimeMarkerService.rows=this.viewItems,this.currentTimeMarkerService.activeView=t)}notifyTaskClick(t,n,o){const r=t instanceof KeyboardEvent?"click":t.type;this.taskClick.emit({originalEvent:t,dataItem:n,index:o,type:r,sender:this})}notifySelectionChange(t,n){this.isSameSelection(n,t)||(this.selectionChange.emit({action:n,items:[t],sender:this}),this.treeList.updateView())}notifyTaskDelete(t){this.editService.dataItem=t,this.taskDelete.emit({item:Da(t,this.treeList.view.data,this.mapper),sender:this})}isSameSelection(t,n){return"select"===t&&this.isSelected(n)}getSelectionAction({ctrlKey:t,metaKey:n},o){return(t||n)&&this.isSelected(o)?"remove":"select"}updateTreeListGroupClass(t=this.columns){Y(this.treeList)&&(Y(t)&&t.length>0&&t.some(r=>(i=>i.isColumnGroup)(r)&&r.childrenArray.some(s=>s.isVisible))?this.renderer.addClass(this.treeList.wrapper.nativeElement,du):this.renderer.removeClass(this.treeList.wrapper.nativeElement,du))}updateTreeListMargin(){const t=this.treeList.wrapper.nativeElement.querySelector(".k-treelist .k-grid-content");this.renderer.setStyle(t,"margin-right",-Math.abs((()=>
1{if((0,v.nm)()){if(isNaN(Hl)){const i=document.createElement("div");i.style.cssText="overflow: scroll; overflow-x: hidden; zoom: 1; clear: both; display: block;",i.innerHTML="&nbsp;",document.body.appendChild(i),Hl=i.offsetWidth-i.scrollWidth,document.body.removeChild(i)}return Hl}})()-1)+"px")}get activeTimelineIndex(){return this.navigation.activeTimelineIndex}getActiveViewOptions(){if(this.views)return this.views.find(t=>t.type===this.activeView)}getFirstSelectedItem(){return(this.renderedTreeListItems||[]).find(this.isSelected||od)}defaultValidateNewDependencyCallback(t){const n=this.mapper.extractFromDependency(t,"fromId"),o=this.mapper.extractFromDependency(t,"toId"),r=this.treeList.view.data.find(D=>this.mapper.extractFromTask(D.data,"id")===n),s=this.treeList.view.data.find(D=>this.mapper.extractFromTask(D.data,"id")===o);if(!Y(r)||!Y(r.data)||!Y(s)||!Y(s.data)||r.data===s.data||this.dependencies.some(D=>{const V=this.mapper.extractFromDependency(D,"fromId"),U=this.mapper.extractFromDependency(D,"toId");return n===V&&o===U||o===V&&n===U})||((i,a)=>{let t=!1,n=i;for(;Y(n)&&Y(n.data);){if(n.data===a.data){t=!0;break}n=n.parent}let o=a;for(;!t&&Y(o)&&Y(o.data);){if(o.data===i.data){t=!0;break}o=o.parent}return t})(r,s))return!1;const u=this.mapper.extractFromTask(r.data,"start"),g=this.mapper.extractFromTask(r.data,"end"),b=this.mapper.extractFromTask(s.data,"start"),k=this.mapper.extractFromTask(s.data,"end");switch(this.mapper.extractFromDependency(t,"type")){case Xe.FF:return g<=k;case Xe.FS:return g<=b;case Xe.SF:return u<=k;case Xe.SS:return u<=b;default:return!1}}handleKeydown(t){const{keyCode:n,target:o,altKey:r}=t,s=this.timeline.timelineContent.nativeElement.contains(o);if(s){if((i=>[v.D$.ArrowUp,v.D$.ArrowDown].some(a=>i===a))(n)?(this.navigation.activeTimelineIndex=this.activeTimelineIndex+(n===v.D$.ArrowUp?-1:1),this.navigation.updateActiveTreeListCell()):n===v.D$.Home?(this.navigation.activeTimelineIndex=0,this.navigation.updateActiveTreeListCell()):n===v.D$.End&&(this.navigation.activeTimelineIndex=this.treeList.view.data.length-1,this.navigation.updateActiveTreeListCell()),(i=>[v.D$.ArrowUp,v.D$.ArrowDown,v.D$.Home,v.D$.End].some(a=>i===a))(n)&&(this.navigation.scrollHorizontallyToTask(),this.scrollSyncService.syncScrollTop("timeline","treelist"),this.navigation.notifyTaskStatusChange(),t.preventDefault()),n===v.D$.Space&&(0,v.SF)(this.selectionChange)){const u=this.renderedTreeListItems[this.activeTimelineIndex],g=this.getSelectionAction(t,u);Y(u)&&!this.isSameSelection(g,u)&&this.zone.run(()=>this.notifySelectionChange(u,g)),t.preventDefault()}if(n===v.D$.Enter&&(0,v.SF)(this.taskClick)){const u=this.renderedTreeListItems[this.activeTimelineIndex];Y(u)&&this.zone.run(()=>this.notifyTaskClick(t,u,this.activeTimelineIndex)),t.preventDefault()}if(((i,a)=>a&&[v.D$.ArrowLeft,v.D$.ArrowRight].some(t=>i===t))(n,r)){const u=this.renderedTreeListItems[this.activeTimelineIndex];if(Y(u)&&this.hasChildren(u)){const g=n===v.D$.ArrowRight,b=this.isExpanded(u);g===b||this.zone.run(()=>{const D={dataItem:u};(g?this.rowExpand:this.rowCollapse).emit(D),this.expandStateChange.emit({...D,expand:g}),this.updateView(),this.navigation.scrollHorizontallyToTask()})}t.preventDefault()}}const c=this.treeList.wrapper.nativeElement.contains(o);if(n===v.D$.Delete&&(s||c)&&(0,v.SF)(this.taskDelete)){const g=this.renderedTreeListItems[c?this.treeList.activeCell.dataRowIndex:this.activeTimelineIndex];Y(g)&&this.zone.run(()=>this.notifyTaskDelete(g))}if((i=>[v.D$.Digit1,sn.Digit1,v.D$.Digit2,sn.Digit2,v.D$.Digit3,sn.Digit3,v.D$.Digit4,sn.Digit4].some(a=>i===a))(n)&&!((i,a)=>{const t=(0,v.lG)(i,(0,v.sO)("k-gantt-toolbar"),a);return Y(t)})(o,this.hostElement.nativeElement)&&!this.isInEditMode){const u=(i=>{switch(i){case sn.Digit1:case v.D$.Digit1:return 0;case sn.Digit2:case v.D$.Digit2:return 1;case sn.Digit3:case v.D$.Digit3:return 2;case sn.Digit4:case v.D$.Digit4:return 3;default:return null}})(n),b=this.views.toArray()[u];Y(b)&&b.type!==this.activeView&&this.zone.run(()=>this.changeActiveView(b.type))}}static \u0275fac=function(n){return new(n||i)(e.rXU(xi),e.rXU(Ra),e.rXU(e.sFG),e.rXU(We),e.rXU(Rt),e.rXU(kt),e.rXU(Wn),e.rXU(H.Pi),e.rXU(e.aKT),e.rXU(e.SKi),e.rXU(Oi),e.rXU(Kl))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt"]],contentQueries:function(n,o,r){if(1&n&&(e.wni(r,ru,5),e.wni(r,iu,5),e.
1wni(r,ou,5),e.wni(r,au,4),e.wni(r,yn,4),e.wni(r,dn,4)),2&n){let s;e.mGM(s=e.lsd())&&(o.taskContentTemplate=s.first),e.mGM(s=e.lsd())&&(o.taskTemplate=s.first),e.mGM(s=e.lsd())&&(o.summaryTaskTemplate=s.first),e.mGM(s=e.lsd())&&(o.toolbarTemplateChildren=s),e.mGM(s=e.lsd())&&(o.columns=s),e.mGM(s=e.lsd())&&(o.views=s)}},viewQuery:function(n,o){if(1&n&&(e.GBs(an,7),e.GBs(Jp,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.treeList=r.first),e.mGM(r=e.lsd())&&(o.timeline=r.first)}},hostVars:5,hostBindings:function(n,o){2&n&&(e.BMQ("aria-roledescription",o.hostRoleDescriptionAttr)("role",o.hostRoleAttr)("dir",o.dir),e.AVh("k-gantt",o.hostClasses))},inputs:{roleDescription:[0,"aria-roledescription","roleDescription"],role:"role",taskModelFields:"taskModelFields",dependencyModelFields:"dependencyModelFields",activeView:"activeView",data:"data",isSelected:"isSelected",validateNewDependency:"validateNewDependency",selectable:"selectable",toolbarSettings:"toolbarSettings",toolbarAriaLabel:"toolbarAriaLabel",fetchChildren:"fetchChildren",hasChildren:"hasChildren",dependencies:"dependencies",sortable:"sortable",sort:"sort",filterable:"filterable",filter:"filter",workDayStart:"workDayStart",workDayEnd:"workDayEnd",workWeekStart:"workWeekStart",workWeekEnd:"workWeekEnd",navigable:"navigable",timelinePaneOptions:"timelinePaneOptions",treeListPaneOptions:"treeListPaneOptions",taskClass:"taskClass",rowClass:"rowClass",isExpanded:"isExpanded",columnsAutoSize:"columnsAutoSize",currentTimeMarker:"currentTimeMarker",columnMenu:"columnMenu",columnsReorderable:"columnsReorderable",columnsResizable:"columnsResizable",dragScrollSettings:"dragScrollSettings"},outputs:{selectionChange:"selectionChange",rowExpand:"rowExpand",taskDblClick:"taskDblClick",cellDblClick:"cellDblClick",cellClose:"cellClose",taskDelete:"taskDelete",rowCollapse:"rowCollapse",remove:"remove",cancel:"cancel",save:"save",taskAdd:"taskAdd",dependencyAdd:"dependencyAdd",sortChange:"sortChange",filterChange:"filterChange",dataStateChange:"dataStateChange",treeListPaneCollapsedChange:"treeListPaneCollapsedChange",timelinePaneCollapsedChange:"timelinePaneCollapsedChange",timelinePaneSizeChange:"timelinePaneSizeChange",activeViewChange:"activeViewChange",columnResize:"columnResize",columnReorder:"columnReorder",columnVisibilityChange:"columnVisibilityChange",columnLockedChange:"columnLockedChange",cellClick:"cellClick",taskClick:"taskClick"},exportAs:["kendoGantt"],standalone:!0,features:[e.Jv_([rd,H.Pi,{provide:H.$R,useValue:"kendo.gantt"},{provide:ho,useExisting:(0,e.Rfq)(()=>i)},{provide:ol,useExisting:(0,e.Rfq)(()=>i)},xi,Yp,Xp,Hp,Wp,Ra,kt,We,Rt,Wn,Zl,Oi,Kl]),e.OA$,e.aNF],decls:13,vars:78,consts:()=>{let t,n,o,r,s,c,u,g,b,k,D,V,U,B,De,et,Ht,Xt,Jn,qn,Qn,Zn,Dn,ei,ti,Ae,Oo,xo,Mo,Fo,Po,No,Go,Ao,Lo,Bo,jo,Vo,$o,Uo,Yo,Ho,Xo,Wo,zo,Ko,Jo,qo,Qo,Zo,er,tr,nr,ir,or,rr,ar,sr,Z,e_,t_,n_,i_,o_,r_;return t=$localize`:kendo.gantt.taskEditingGeneralTabTitle|The title of the 'General' tab of the editing dialog TabStrip:General`,n=$localize`:kendo.gantt.taskEditingPredecessorsTabTitle|The title of the 'Predecessors' dependencies tab of the editing dialog TabStrip:Predecessors`,o=$localize`:kendo.gantt.taskEditingSuccessorsTabTitle|The title of the 'Successors' dependencies tab of the editing dialog TabStrip:Successors`,r=$localize`:kendo.gantt.taskEditingDependenciesAddButtonText|The text of the 'Add' button in the dependencies tabs of the editing dialog TabStrip:Add`,s=$localize`:kendo.gantt.taskEditingDependenciesRemoveButtonText|The text of the 'Remove' button in the dependencies tabs of the editing dialog TabStrip:Remove`,c=$localize`:kendo.gantt.taskEditingDependenciesGridNameColumnTitle|The title of the 'Task Title' Grid column in the dependencies tabs of the editing dialog TabStrip:Task Title`,u=$localize`:kendo.gantt.taskEditingDependenciesGridTypeColumnTitle|The title of the 'Type' Grid column in the dependencies tabs of the editing dialog TabStrip:Type`,g=$localize`:kendo.gantt.taskDeleteLabel|The label of the task delete icon:Delete`,b=$localize`:kendo.gantt.taskEditingDialogTitle|The title of the task editing dialog:Editing Task`,k=$localize`:kendo.gantt.taskEditingDialogCloseTitle|The title of the task editing dialog close button:Close`,D=$localize`:kendo.gantt.confirmationDialogCloseTitle|The title of the confirmation dialog close button:Close`,V=$localize`:kendo.gantt.confirmationDialogTitle|The title of the delete task confirmation dialog:Delete Task`,U=$localize`:kendo.gantt.confirmationDialogContent|The content of the delete task confirmation dialog:Are you sure you want to delete this task?`,B=$localize`:kendo.gantt.deleteButtonText|The text of the task editing dialog 'Delete' button:Delete`,De=$localize`:kendo.gantt.cancelButtonText|The text of the task editing dialog 'Cancel' button:Cancel`,et=$localize`:kendo.gantt.saveButtonText|The text of the task editing dialog 'Save' button:Save`,Ht=$localize`:kendo.gantt.titleFieldInputLabel|The label of the 'title' field input in editing mode:Title`,Xt=$localize`:kendo.gantt.startFieldInputLabel|The label of the 'start' field input in editing mode:Start`,Jn=$localize`:kendo.gantt.endFieldInputLabel|The label of the 'end' field input in editing mode:End`,qn=$localize`:kendo.gantt.completionRatioFieldInputLabel|The label of the 'completionRatio' field input in editing mode:Progress`,Qn=$localize`:kendo.gantt.dayViewText|The text of the day view in the ViewSelector component:Day`,Zn=$localize`:kendo.gantt.weekViewText|The text of the week view in the ViewSelector component:Week`,Dn=$localize`:kendo.gantt.monthViewText|The text of the month view in the ViewSelector component:Month`,ei=$localize`:kendo.gantt.addTaskText|The text of the DropDownButton in the AddTask component:Add Task`,ti=$localize`:kendo.gantt.addChildText|The text of the 'Add Child' option in the AddTask component:Add Child`,Ae=$localize`:kendo.gantt.addAboveText|The text of the 'Add Above' option in the AddTask component:Add Above`,Oo=$localize`:kendo.gantt.addBelowText|The text of the 'Add Below' option in the AddTask component:Add Below`,xo=$localize`:kendo.gantt.noRecords|The label visible in the TreeList when there are no records:No records available.`,Mo=$localize`:kendo.gantt.filter|The label of the filter cell or icon:Filter`,Fo=$localize`:kendo.gantt.filterEqOperator|The text of the equal filter operator:Is equal to`,Po=$localize`:kendo.gantt.filterNotEqOperator|The text of the not equal filter operator:Is not equal to`,No=$localize`:kendo.gantt.filterIsNullOperator|The text of the is null filter operator:Is null`,Go=$localize`:kendo.gantt.filterIsNotNullOperator|The text of the is not null filter operator:Is not null`,Ao=$localize`:kendo.gantt.filterIsEmptyOperator|The text of the is empty filter operator:Is empty`,Lo=$localize`:kendo.gantt.filterIsNotEmptyOperator|The text of the is not empty filter operator:Is not empty`,Bo=$localize`:kendo.gantt.filterStartsWithOperator|The text of the starts with filter operator:Starts with`,jo=$localize`:kendo.gantt.filterContainsOperator|The text of the contains filter operator:Contains`,Vo=$localize`:kendo.gantt.filterNotContainsOperator|The text of the does not contain filter operator:
1Does not contain`,$o=$localize`:kendo.gantt.filterEndsWithOperator|The text of the ends with filter operator:Ends with`,Uo=$localize`:kendo.gantt.filterGteOperator|The text of the greater than or equal filter operator:Is greater than or equal to`,Yo=$localize`:kendo.gantt.filterGtOperator|The text of the greater than filter operator:Is greater than`,Ho=$localize`:kendo.gantt.filterLteOperator|The text of the less than or equal filter operator:Is less than or equal to`,Xo=$localize`:kendo.gantt.filterLtOperator|The text of the less than filter operator:Is less than`,Wo=$localize`:kendo.gantt.filterIsTrue|The text of the IsTrue boolean filter option:Is True`,zo=$localize`:kendo.gantt.filterIsFalse|The text of the IsFalse boolean filter option:Is False`,Ko=$localize`:kendo.gantt.filterBooleanAll|The text of the (All) boolean filter option:(All)`,Jo=$localize`:kendo.gantt.filterAfterOrEqualOperator|The text of the after or equal date filter operator:Is after or equal to`,qo=$localize`:kendo.gantt.filterAfterOperator|The text of the after date filter operator:Is after`,Qo=$localize`:kendo.gantt.filterBeforeOperator|The text of the before date filter operator:Is before`,Zo=$localize`:kendo.gantt.filterBeforeOrEqualOperator|The text of the before or equal date filter operator:Is before or equal to`,er=$localize`:kendo.gantt.filterFilterButton|The text of the filter button:Filter`,tr=$localize`:kendo.gantt.filterClearButton|The text of the clear filter button:Clear`,nr=$localize`:kendo.gantt.filterAndLogic|The text of the And filter logic:And`,ir=$localize`:kendo.gantt.filterOrLogic|The text of the Or filter logic:Or`,or=$localize`:kendo.gantt.loading|The loading text:Loading`,rr=$localize`:kendo.gantt.columnMenu|The title of the column menu icon:Column Menu`,ar=$localize`:kendo.gantt.columns|The text shown in the column menu for the columns item:Columns`,sr=$localize`:kendo.gantt.lock|The text shown in the column menu for the lock item:Lock`,Z=$localize`:kendo.gantt.unlock|The text shown in the column menu for the unlock item:Unlock`,e_=$localize`:kendo.gantt.sortable|The label of the sort icon:Sortable`,t_=$localize`:kendo.gantt.sortAscending|The text shown in the column menu for the sort ascending item:Sort Ascending`,n_=$localize`:kendo.gantt.sortDescending|The text shown in the column menu for the sort descending item:Sort Descending`,i_=$localize`:kendo.gantt.sortedDefault|The status announcement when a column is no longer sorted:Not Sorted`,o_=$localize`:kendo.gantt.columnsApply|The text shown in the column menu or column chooser for the columns apply button:Apply`,r_=$localize`:kendo.gantt.columnsReset|The text shown in the column menu or column chooser for the columns reset button:Reset`,[["kendoGanttLocalizedMessages","","taskEditingGeneralTabTitle",t,"taskEditingPredecessorsTabTitle",n,"taskEditingSuccessorsTabTitle",o,"taskEditingDependenciesAddButtonText",r,"taskEditingDependenciesRemoveButtonText",s,"taskEditingDependenciesGridNameColumnTitle",c,"taskEditingDependenciesGridTypeColumnTitle",u,"taskDeleteLabel",g,"taskEditingDialogTitle",b,"taskEditingDialogCloseTitle",k,"confirmationDialogCloseTitle",D,"confirmationDialogTitle",V,"confirmationDialogContent",U,"deleteButtonText",B,"cancelButtonText",De,"saveButtonText",et,"titleFieldInputLabel",Ht,"startFieldInputLabel",Xt,"endFieldInputLabel",Jn,"completionRatioFieldInputLabel",qn,"dayViewText",Qn,"weekViewText",Zn,"monthViewText",Dn,"yearViewText","Year","addTaskText",ei,"addChildText",ti,"addAboveText",Ae,"addBelowText",Oo,"noRecords",xo,"filter",Mo,"filterEqOperator",Fo,"filterNotEqOperator",Po,"filterIsNullOperator",No,"filterIsNotNullOperator",Go,"filterIsEmptyOperator",Ao,"filterIsNotEmptyOperator",Lo,"filterStartsWithOperator",Bo,"filterContainsOperator",jo,"filterNotContainsOperator",Vo,"filterEndsWithOperator",$o,"filterGteOperator",Uo,"filterGtOperator",Yo,"filterLteOperator",Ho,"filterLtOperator",Xo,"filterIsTrue",Wo,"filterIsFalse",zo,"filterBooleanAll",Ko,"filterAfterOrEqualOperator",Jo,"filterAfterOperator",qo,"filterBeforeOperator",Qo,"filterBeforeOrEqualOperator",Zo,"filterFilterButton",er,"filterClearButton",tr,"filterAndLogic",nr,"filterOrL
1ogic",ir,"loading",or,"columnMenu",rr,"columns",ar,"lock-disabled",sr,"unlock-disabled",Z,"sortable",e_,"sortAscending",t_,"sortDescending",n_,"sortedDefault",i_,"columnsApply",o_,"columnsReset",r_],["class","k-gantt-header k-toolbar k-gantt-toolbar","position","top",3,"showAddTask","showViewSelector","toolbarTemplate","views","activeView","navigable","activeViewChange",4,"ngIf"],[1,"k-gantt-content"],[1,"k-gantt-treelist","k-gantt-treelist-scrollable",3,"collapsedChange","collapsible","collapsed","scrollable"],[3,"filterChange","sortChange","dataStateChange","expandStateChange","expand","collapse","columnReorder","columnResize","columnVisibilityChange","columnLockedChange","selectionChange","cellClick","cellClose","idField","columns","data","hasChildren","fetchChildren","navigable","isExpanded","autoSize","columnMenu","reorderable","resizable","rowClass","isSelected","selectable","sortable","sort","filterable","filter","kendoEventsOutsideAngular","scope"],[3,"noRecords","filter","filterEqOperator","filterNotEqOperator","filterIsNullOperator","filterIsNotNullOperator","filterIsEmptyOperator","filterIsNotEmptyOperator","filterStartsWithOperator","filterContainsOperator","filterNotContainsOperator","filterEndsWithOperator","filterGteOperator","filterGtOperator","filterLteOperator","filterLtOperator","filterIsTrue","filterIsFalse","filterBooleanAll","filterAfterOrEqualOperator","filterAfterOperator","filterBeforeOperator","filterBeforeOrEqualOperator","filterFilterButton","filterClearButton","filterAndLogic","filterOrLogic","loading","columnMenu","columns","sortable","sortAscending","sortDescending","sortedAscending","sortedDescending","sortedDefault","columnsApply","columnsReset"],[1,"k-gantt-timeline-pane",3,"collapsedChange","sizeChange","collapsible","resizable","collapsed","min","max","size","scrollable"],[3,"renderDependencyDragClues","dragScrollSettings","rows","slots","currentTimeMarker","groupSlots","tableWidth","activeView","taskContentTemplate","taskTemplate","summaryTaskTemplate","taskClass","dependencies","isExpanded","selectable","isTaskSelected","kendoEventsOutsideAngular","scope",4,"ngIf"],["class","k-gantt-footer k-toolbar k-gantt-toolbar","position","bottom",3,"showAddTask","showViewSelector","toolbarTemplate","views","activeView","navigable",4,"ngIf"],[3,"data",4,"ngIf"],[3,"width","height","title","close",4,"ngIf"],["kendoWatermarkOverlay","",4,"ngIf"],["position","top",1,"k-gantt-header","k-toolbar","k-gantt-toolbar",3,"activeViewChange","showAddTask","showViewSelector","toolbarTemplate","views","activeView","navigable"],[3,"renderDependencyDragClues","dragScrollSettings","rows","slots","currentTimeMarker","groupSlots","tableWidth","activeView","taskContentTemplate","taskTemplate","summaryTaskTemplate","taskClass","dependencies","isExpanded","selectable","isTaskSelected","kendoEventsOutsideAngular","scope"],["position","bottom",1,"k-gantt-footer","k-toolbar","k-gantt-toolbar",3,"showAddTask","showViewSelector","toolbarTemplate","views","activeView","navigable"],[3,"data"],[3,"close","width","height","title"],["layout","start"],["kendoButton","",3,"click","primary"],["kendoButton","",3,"click"],["kendoWatermarkOverlay",""]]},template:function(n,o){1&n&&(e.eu8(0,0),e.DNE(1,eb,1,7,"kendo-gantt-toolbar",1),e.j41(2,"div",2)(3,"kendo-splitter")(4,"kendo-splitter-pane",3),e.bIt("collapsedChange",function(s){return o.onTreeListCollapsedChange(s)}),e.j41(5,"kendo-treelist",4),e.bIt("filterChange",function(s){return o.filterChange.emit(s)})("sortChange",function(s){return o.sortChange.emit(s)})("dataStateChange",function(s){return o.dataStateChange.emit({filter:s.filter,sort:s.sort})})("expandStateChange",function(s){return o.expandStateChange.emit(s)})("expand",function(s){return o.rowExpand.emit({dataItem:s.dataItem})})("collapse",function(s){return o.rowCollapse.emit({dataItem:s.dataItem})})("columnReorder",function(s){return o.columnReorder.emit(s)})("columnResize",function(s){return o.columnResize.emit(s)})("columnVisibilityChange",function(s){return o.handleColumnVisibilityChange(s)})("columnLockedChange",function(s){return o.columnLockedChange.emit(s)})("selectionChange",function(s){return o.handleTreeListSelectionChange(s)})("cellClick",function(s){return o.handleTreeListCellClick(s)})("cellClose",function(s){return o.handleCellClose(s)}),e.nrm(6,"kendo-treelist-messages",5),e.k0s()(),e.j41(7,"kendo-splitter-pane",6),e.bIt("collapsedChange",function(s){return o.onTimelineCollapsedChange(s)})("sizeChange",function(s){return o.onTimelinePaneSizeChange(s)}),e.DNE(8,tb,1,23,"kendo-gantt-timeline",7),e.k0s()()(),e.DNE(9,nb,1,7,"kendo-gantt-toolbar",8)(10,ib,1,1,"kendo-gantt-edit-dialog",9)(11,ob,9,7,"kendo-dialog",10)(12,rb,1,0,"div",11)),2&n&&(e.R7$(),e.Y8G("ngIf",o.showToolbar("top")),e.R7$(2),e.xc7("border",0),e.R7$(),e.Y8G("collapsible",null==o.treeListPaneOptions?null:o.treeListPaneOptions.collapsible)("collapsed",null==o.treeListPaneOptions?null:o.treeListPaneOptions.collapsed)("scrollable",!1),e.R7$(),e.Y8G("idField",o.taskIdField)("columns",o.columns)("data",o.data)("hasChildren",o.hasChildren)("fetchChildren",o.fetchChildren)("navigable",o.navigable)("isExpanded",o.isExpanded)("autoSize",o.columnsAutoSize)("columnMenu",o.columnMenu)("reorderable",o.columnsReorderable)("resizable",o.columnsResizable)("rowClass",o.rowClass)("isSelected",o.isSelected)("selectable",o.selectable)("sortable",o.sortable)("sort",o.sort)("filterable",o.filterMenu)("filter",o.filter)("kendoEventsOutsideAngular",e.eq3(76,Qv,o.handleTreeListDoubleClick))("scope",o),e.R7$(),e.Y8G("noRecords",o.getText("noRecords"))("filter",o.getText("filter"))("filterEqOperator",o.getText("filterEqOperator"))("filterNotEqOperator",o.getText("filterNotEqOperator"))("filterIsNullOperator",o.getText("filterIsNullOperator"))("filterIsNotNullOperator",o.getText("filterIsNotNullOperator"))("filterIsEmptyOperator",o.getText("filterIsEmptyOperator"))("filterIsNotEmptyOperator",o.getText("filterIsNotEmptyOperator"))("filterStartsWithOperator",o.getText("filterStartsWithOperator"))("filterContainsOperator",o.getText("filterContainsOperator"))("filterNotContainsOperator",o.getText("filterNotContainsOperator"))("filterEndsWithOperator",o.getText("filterEndsWithOperator"))("filterGteOperator",o.getText("filterGteOperator"))("filterGtOperator",o.getText("filterGtOperator"))("filterLteOperator",o.getText("filterLteOperator"))("filterLtOperator",o.getText("filterLtOperator"))("filterIsTrue",o.getText("filterIsTrue"))("filterIsFalse",o.getText("filterIsFalse"))("filterBooleanAll",o.getText("filterBooleanAll"))("filterAfterOrEqualOperator",o.getText("filterAfterOrEqualOperator"))("filterAfterOperator",o.getText("filterAfterOperator"))("filterBeforeOperator",o.getText("filterBeforeOperator"))("filterBeforeOrEqualOperator",o.getText("filterBeforeOrEqualOperator"))("filterFilterButton",o.getText("filterFilterButton"))("filterClearButton",o.getText("filterClearButton"))("filterAndLogic",o.getText("filterAndLogic"))("filterOrL
1ogic",o.getText("filterOrLogic"))("loading",o.getText("loading"))("columnMenu",o.getText("columnMenu"))("columns",o.getText("columns"))("sortable",o.getText("sortable"))("sortAscending",o.getText("sortAscending"))("sortDescending",o.getText("sortDescending"))("sortedAscending",o.getText("sortedAscending"))("sortedDescending",o.getText("sortedDescending"))("sortedDefault",o.getText("sortedDefault"))("columnsApply",o.getText("columnsApply"))("columnsReset",o.getText("columnsReset")),e.R7$(),e.Y8G("collapsible",null==o.timelinePaneOptions?null:o.timelinePaneOptions.collapsible)("resizable",null==o.timelinePaneOptions?null:o.timelinePaneOptions.resizable)("collapsed",null==o.timelinePaneOptions?null:o.timelinePaneOptions.collapsed)("min",null==o.timelinePaneOptions?null:o.timelinePaneOptions.min)("max",null==o.timelinePaneOptions?null:o.timelinePaneOptions.max)("size",null==o.timelinePaneOptions?null:o.timelinePaneOptions.size)("scrollable",!1),e.R7$(),e.Y8G("ngIf",o.views&&o.views.length),e.R7$(),e.Y8G("ngIf",o.showToolbar("bottom")),e.R7$(),e.Y8G("ngIf",o.showEditingDialog),e.R7$(),e.Y8G("ngIf",o.showConfirmationDialog),e.R7$(),e.Y8G("ngIf",o.showLicenseWatermark))},dependencies:[Zb,M.bT,Qb,ht.Hn,ht.R7,an,v.Uj,ep,Jp,qb,ie.mq,ie.hf,ba,Be.Qp,v.S$],encapsulation:2})}return i})(),pu=(()=>{class i extends sp{data;set aggregate(t){super.aggregate=t}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(i)))(o||i)}})();static \u0275dir=e.FsC({type:i,selectors:[["","kendoGanttFlatBinding",""]],inputs:{data:[0,"kendoGanttFlatBinding","data"]},exportAs:["kendoGanttFlatBinding"],standalone:!0,features:[e.Vt3]})}return i})(),hu=(()=>{class i extends dn{type="week";constructor(t,n){super(t,n)}static \u0275fac=function(n){return new(n||i)(e.rXU(Rt),e.rXU(kt))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-timeline-week-view"]],standalone:!0,features:[e.Jv_([{provide:dn,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),fu=(()=>{class i extends dn{type="month";constructor(t,n){super(t,n)}static \u0275fac=function(n){return new(n||i)(e.rXU(Rt),e.rXU(kt))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-timeline-month-view"]],standalone:!0,features:[e.Jv_([{provide:dn,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),Cu=(()=>{class i extends dn{type="year";constructor(t,n){super(t,n)}static \u0275fac=function(n){return new(n||i)(e.rXU(Rt),e.rXU(kt))};static \u0275cmp=e.VBU({type:i,selectors:[["kendo-gantt-timeline-year-view"]],standalone:!0,features:[e.Jv_([{provide:dn,useExisting:(0,e.Rfq)(()=>i)}]),e.Vt3,e.aNF],decls:0,vars:0,template:function(n,o){},encapsulation:2})}return i})(),s0=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({providers:[{provide:H.$R,useValue:"kendo.gantt"},A.o3,me.OQ,v.yr,ie.Nb,ie.o3,ie.s7,ie.VV,z.uC,z.Hp,z.d7,z.fQ,z.iU,z.o_,z.T5,z.HU,z.l2,z.lm,z.Uk,z.z_,Ti],imports:[Ro,ad,sd]})}return i})();function l0(i,a){1&i&&(e.j41(0,"div",4),e.nrm(1,"kendo-loader",5),e.j41(2,"span"),e.EFF(3,"Loading Gantt data..."),e.k0s()())}function d0(i,a){1&i&&(e.j41(0,"div",6),e.nrm(1,"i",7),e.j41(2,"p"),e.EFF(3,"Failed to load Gantt data. Please try again."),e.k0s()())}function c0(i,a){1&i&&(e.j41(0,"div",6),e.nrm(1,"i",8),e.j41(2,"p"),e.EFF(3,"Gantt configuration is missing. Please edit the report."),e.k0s()())}function p0(i,a){1&i&&(e.j41(0,"div",6),e.nrm(1,"i",8),e.j41(2,"p"),e.EFF(3,"No tasks found for the selected data source and date range."),e.k0s()())}function u0(i,a){if(1&i&&e.nrm(0,"kendo-gantt-column",14),2&i){const t=e.XpG(2);e.Y8G("width",t.colWidths.percentComplete)}}function _0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-gantt",9),e.bIt("columnResize",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onColumnResize(o))}),e.nrm(1,"kendo-gantt-column",10)(2,"kendo-gantt-column",11)(3,"kendo-gantt-column",12),e.DNE(4,u0,1,1,"kendo-gantt-column",13),e.nrm(5,"kendo-gantt-timeline-week-view")(6,"kendo-gantt-timeline-month-view")(7,"kendo-gantt-timeline-year-view"),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("kendoGanttFlatBinding",t.tasks)("columnsResizable",!0),e.R7$(),e.Y8G("width",t.colWidths.title)("expandable",!0),e.R7$(),e.Y8G("width",t.colWidths.start),e.R7$(),e.Y8G("width",t.colWidths.end),e.R7$(),e.Y8G("ngIf",null==t.ganttConfig?null:t.ganttConfig.percentCompleteField)}}const ld={title:250,start:110,end:110,percentComplete:90},vu="gantt_col_widths_";let dd=(()=>{class i{constructor(t){this._apiService=t,this.report=null,this.parameterValues=[],this._destroyed$=new ue.B7,this._prevReportId="",this._rawFlatItems=[],this._rawLevel2Items=[],this._rawLevel3Items=[],this.ganttConfig=null,this.tasks=[],this.loading=!1,this.error=!1,this.colWidths={...ld}}ngOnInit(){this.report&&this._init(this.report)}ngOnChanges(t){t.report&&this.report&&this.report.adHocReportId!==this._prevReportId?this._init(this.report):t.parameterValues&&!t.report&&(this.tasks=this._mapMultiLevelTasks(this._filterItems(this._rawFlatItems),this._rawLevel2Items,this._rawLevel3Items))}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}getTasksForExport(){const t=new Map;for(const n of this.tasks){const o=null!==n.parentId?t.get(n.parentId)??1:0;t.set(n.id,o+1)}return this.tasks.map(n=>({...n,level:t.get(n.id)??1}))}onColumnResize(t){for(const n of t){const o=n.column?.field;o&&o in this.colWidths&&(this.colWidths={...this.colWidths,[o]:n.newWidth})}this._saveColWidths()}_init(t){this._prevReportId=t.adHocReportId,this.colWidths=this._loadColWidths(t.adHocReportId),this.ganttConfig=this._parseConfig(t.dashboardConfiguration),this.ganttConfig&&this._loadData(t.adHocReportId)}_loadColWidths(t){try{const n=localStorage.getItem(vu+t);if(n)return{...ld,...JSON.parse(n)}}catch{}return{...ld}}_saveColWidths(){if(this.report?.adHocReportId)try{localStorage.setItem(vu+this.report.adHocReportId,JSON.stringify(this.colWidths))}catch{}}_parseConfig(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}_flattenItems(t){return t.map(n=>({...n,...n.elementData}))}_level2Source(t){return t.workflowTypeId?this._apiService.getWorkflowData(t.workflowTypeId,void 0,void 0,1,5e3).pipe((0,ye.W)(()=>(0,le.of)({data:[],total:0}))):t.dataSetId?this._apiService.queryDataSet(t.dataSetId,{page:1,pageSize:5e3}).pipe((0,ye.W)(()=>(0,le.of)({data:[],total:0}))):(0,le.of)({data:[],total:0})}_loadData(t){this.loading=!0,this.error=!1;const n=this._apiService.executeReport(t,{page:1,pageSize:5e3}).pipe((0,ye.W)(()=>(0,le.of)(null))),o=this.ganttConfig?.level2,r=this.ganttConfig?.level3,s=o?this._level2Source(o):(0,le.of)({data:[],total:0}),c=r?this._level2Source(r):(0,le.of)({data:[],total:0});(0,vt.p)([n,s,c]).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:([u,g,b])=>{u?(this._rawFlatItems=this._flattenItems(u.data||[]),this._rawLevel2Items=this._flattenItems(g?.data||[]),this._rawLevel3Items=this._flattenItems(b?.data||[]),this.tasks=this._mapMultiLevelTasks(this._filterItems(this._rawFlatItems),this._rawLevel2Items,this._rawLevel3Items)):this.error=!0},error:()=>{this.error=!0}})}_filterItems(t){const n=this.ganttConfig?.parameters;return n?.length&&this.parameterValues?.length?t.filter(o=>n.every(r=>{const s=this.parameterValues.find(u=>u.parameterId===r.id);if(!s?.value)return!0;
1const c=String(o[r.fieldName]??"");return"dropdown"===r.parameterType?c.toLowerCase()===s.value.toLowerCase():"multi-select"===r.parameterType?s.value.split(",").map(g=>g.trim().toLowerCase()).includes(c.toLowerCase()):"text"!==r.parameterType||c.toLowerCase().includes(s.value.toLowerCase())})):t}_itemToTask(t,n,o,r){const s=t[n.startDateField],c=t[n.endDateField];if(!s||!c)return null;const u=new Date(s),g=new Date(c);if(isNaN(u.getTime())||isNaN(g.getTime()))return null;const b=String(t[n.taskTitleField]??t.relativeId??"");let k=0;if(n.percentCompleteField){const D=parseFloat(t[n.percentCompleteField]);isNaN(D)||(k=Math.min(1,Math.max(0,D/100)))}return{id:o,parentId:r,title:b,start:u,end:g,percentComplete:k}}_pruneOrphanedChildren(t,n,o){const r=new Set(n.map(s=>s.relativeId));return t.filter(s=>{const c=s[o+"_Id"],b=parseInt(void 0!==c?c:s[o],10);return!isNaN(b)&&b>0&&r.has(b)})}_resolveParentId(t,n,o){const r=t[n+"_Id"],u=parseInt(void 0!==r?r:t[n],10);return isNaN(u)||u<=0?null:o.get(u)??null}_mapMultiLevelTasks(t,n,o){if(!this.ganttConfig)return[];const r=[];let s=1;const c=new Map,u=new Map;for(const V of t){const U=this._itemToTask(V,this.ganttConfig,s,null);U&&(c.set(V.relativeId,s),r.push(U),s++)}const g=this.ganttConfig.level2,b=g?this._pruneOrphanedChildren(n,t,g.parentRelationField):n;if(g&&b.length)for(const V of b){const U=this._resolveParentId(V,g.parentRelationField,c),B=this._itemToTask(V,g,s,U);B&&(u.set(V.relativeId,s),r.push(B),s++)}const k=this.ganttConfig.level3,D=k?this._pruneOrphanedChildren(o,b,k.parentRelationField):o;if(k&&D.length)for(const V of D){const U=this._resolveParentId(V,k.parentRelationField,u),B=this._itemToTask(V,k,s,U);B&&(r.push(B),s++)}return r.sort((V,U)=>V.id-U.id)}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ye.F))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-gantt-viewer"]],inputs:{report:"report",parameterValues:"parameterValues"},features:[e.OA$],decls:6,vars:5,consts:[[1,"gantt-viewer-container"],["class","gantt-loading",4,"ngIf"],["class","gantt-empty",4,"ngIf"],["idField","id","parentIdField","parentId","class","gantt-chart",3,"kendoGanttFlatBinding","columnsResizable","columnResize",4,"ngIf"],[1,"gantt-loading"],["type","pulsing","size","large"],[1,"gantt-empty"],[1,"mdi","mdi-alert-circle-outline","gantt-empty-icon","error-icon"],[1,"mdi","mdi-chart-gantt","gantt-empty-icon"],["idField","id","parentIdField","parentId",1,"gantt-chart",3,"columnResize","kendoGanttFlatBinding","columnsResizable"],["field","title","title","Task",3,"width","expandable"],["field","start","title","Start","format","{0:d}",3,"width"],["field","end","title","End","format","{0:d}",3,"width"],["field","percentComplete","title","Complete","format","{0:p0}",3,"width",4,"ngIf"],["field","percentComplete","title","Complete","format","{0:p0}",3,"width"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.DNE(1,l0,4,0,"div",1)(2,d0,4,0,"div",2)(3,c0,4,0,"div",2)(4,p0,4,0,"div",2)(5,_0,8,7,"kendo-gantt",3),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading&&o.error),e.R7$(),e.Y8G("ngIf",!o.loading&&!o.error&&!o.ganttConfig),e.R7$(),e.Y8G("ngIf",!o.loading&&!o.error&&o.ganttConfig&&0===o.tasks.length),e.R7$(),e.Y8G("ngIf",!o.loading&&!o.error&&o.ganttConfig&&o.tasks.length>0))},dependencies:[M.bT,ze.VU,Ro,pu,id,hu,fu,Cu],styles:[".gantt-viewer-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%}.gantt-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:100%;color:var(--text-color-secondary, #64748b)}.gantt-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:100%;color:var(--text-color-secondary, #64748b);font-size:.9rem}.gantt-empty[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0}.gantt-empty-icon[_ngcontent-%COMP%]{font-size:2.5rem;color:var(--text-color-secondary, #94a3b8)}.gantt-empty-icon.error-icon[_ngcontent-%COMP%]{color:var(--danger-color, #ef4444)}.gantt-chart[_ngcontent-%COMP%]{flex:1;width:100%;height:100%}  .gantt-chart .k-gantt-timeline .k-gantt-rows,   .gantt-chart .k-gantt-timeline .k-gantt-tasks{height:auto!important}  .gantt-chart .k-gantt-treelist .k-grid-content td,   .gantt-chart .k-gantt-timeline .k-grid-content td{height:50px!important;box-sizing:border-box!important}  .gantt-chart .k-gantt-treelist .k-grid-content tr,   .gantt-chart .k-gantt-timeline .k-grid-content tr{height:50px!important}"]})}}return i})();var m0=F(62078),g0=F(54089),cd=F(15370),Kn=F(66132),bu=F(71136),xa=F(55152);function h0(i,a){1&i&&(e.j41(0,"div",3),e.nrm(1,"kendo-loader",4),e.k0s())}function f0(i,a){if(1&i&&(e.j41(0,"div",8)(1,"div",9),e.nrm(2,"i"),e.j41(3,"span",10),e.EFF(4),e.k0s()(),e.j41(5,"span",11),e.EFF(6),e.k0s()()),2&i){const t=e.XpG(2);e.Y8G("ngClass",t.getComparisonClass()),e.R7$(2),e.HbH(t.getComparisonIcon()),e.R7$(2),e.JRh(t.getFormattedPercent()),e.R7$(2),e.JRh(t.comparisonLabel)}}function C0(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",5),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCounterClick())}),e.j41(1,"div",6),e.EFF(2),e.k0s(),e.DNE(3,f0,7,5,"div",7),e.k0s()}if(2&i){const t=e.XpG();e.AVh("clickable",t.hasData),e.R7$(2),e.JRh(t.displayValue),e.R7$(),e.Y8G("ngIf","none"!==t.widget.comparison&&null!==t.comparisonPercent)}}let v0=(()=>{class i{constructor(){this.data=null,this.loading=!1,this.drillThrough=new e.bkB,this.displayValue="--",this.comparisonValue=null,this.comparisonPercent=null,this.comparisonDirection="neutral",this.comparisonLabel=""}ngOnChanges(t){(t.data||t.widget)&&this.computeValues()}computeValues(){if(!this.data||!this.data.value)return this.displayValue="--",this.comparisonValue=null,void(this.comparisonPercent=null);const t=this.data.value;this.displayValue=this.formatValue(t),this.widget.comparison!==w.JU.None&&void 0!==this.data.comparisonValue&&(this.comparisonValue=this.data.comparisonValue,0!==this.comparisonValue?(this.comparisonPercent=(t-this.comparisonValue)/Math.abs(this.comparisonValue)*100,this.comparisonDirection=this.comparisonPercent>0?"up":this.comparisonPercent<0?"down":"neutral"):(this.comparisonPercent=t>0?100:0,this.comparisonDirection=t>0?"up":"neutral"),this.comparisonLabel=this.getComparisonLabel())}formatValue(t){const n=this.widget.prefix||"",o=this.widget.suffix||"";let r;return r=this.widget.format?this.applyFormat(t,this.widget.format):t>=1e6?(t/1e6).toFixed(1)+"M":t>
1=1e3?(t/1e3).toFixed(1)+"K":Number.isInteger(t)?t.toLocaleString():t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}),n+r+o}applyFormat(t,n){switch(n.toLowerCase()){case"currency":return t.toLocaleString(void 0,{style:"currency",currency:"USD"});case"percent":return t.toLocaleString(void 0,{style:"percent",minimumFractionDigits:1});case"decimal":return t.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2});case"integer":return Math.round(t).toLocaleString();default:return t.toLocaleString()}}getComparisonLabel(){switch(this.widget.comparison){case w.JU.PreviousPeriod:return"vs previous period";case w.JU.PreviousMonth:return"vs previous month";case w.JU.PreviousYear:return"vs previous year";default:return""}}getComparisonIcon(){switch(this.comparisonDirection){case"up":return"mdi mdi-arrow-up";case"down":return"mdi mdi-arrow-down";default:return"mdi mdi-minus"}}getComparisonClass(){switch(this.comparisonDirection){case"up":return"comparison-up";case"down":return"comparison-down";default:return"comparison-neutral"}}getFormattedPercent(){return null===this.comparisonPercent?"":(this.comparisonPercent>=0?"+":"")+this.comparisonPercent.toFixed(1)+"%"}get hasData(){return!!this.data?.value&&this.data.value>=1}onCounterClick(){this.hasData&&this.drillThrough.emit(this.widget)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-counter-widget"]],inputs:{widget:"widget",data:"data",loading:"loading"},outputs:{drillThrough:"drillThrough"},features:[e.OA$],decls:3,vars:2,consts:[[1,"counter-widget"],["class","loading-state",4,"ngIf"],["class","counter-content",3,"clickable","click",4,"ngIf"],[1,"loading-state"],["type","pulsing","size","medium"],[1,"counter-content",3,"click"],[1,"counter-value"],["class","counter-comparison",3,"ngClass",4,"ngIf"],[1,"counter-comparison",3,"ngClass"],[1,"comparison-badge"],[1,"comparison-percent"],[1,"comparison-label"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.DNE(1,h0,2,0,"div",1)(2,C0,4,4,"div",2),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading))},dependencies:[M.YU,M.bT,ze.VU],styles:[".counter-widget[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:1rem}.loading-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}.counter-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center}.counter-content.clickable[_ngcontent-%COMP%]{cursor:pointer;border-radius:8px;padding:.5rem;transition:background-color .2s ease}.counter-content.clickable[_ngcontent-%COMP%]:hover{background-color:#0000000a}.counter-value[_ngcontent-%COMP%]{font-size:2.5rem;font-weight:700;color:#000;line-height:1.2}.counter-comparison[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:.25rem;margin-top:.75rem}.counter-comparison[_ngcontent-%COMP%]   .comparison-badge[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;padding:.25rem .5rem;border-radius:12px;font-size:.875rem;font-weight:600}.counter-comparison[_ngcontent-%COMP%]   .comparison-badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:.75rem}.counter-comparison[_ngcontent-%COMP%]   .comparison-label[_ngcontent-%COMP%]{font-size:.75rem;color:#7b7b7b}.counter-comparison.comparison-up[_ngcontent-%COMP%]   .comparison-badge[_ngcontent-%COMP%]{background:#fafafa;color:#09a564}.counter-comparison.comparison-down[_ngcontent-%COMP%]   .comparison-badge[_ngcontent-%COMP%]{background:#fafafa;color:#e60400}.counter-comparison.comparison-neutral[_ngcontent-%COMP%]   .comparison-badge[_ngcontent-%COMP%]{background:#fafafa;color:#7b7b7b}"]})}}return i})();const Pi="custom",pd=[{id:"cadynce-blue",label:"Cadynce Blue",colors:["#1976d2","#42a5f5","#0d47a1","#64b5f6","#1565c0","#90caf9","#0277bd","#b3e5fc"]},{id:"warm",label:"Warm",colors:["#e53935","#fb8c00","#fdd835","#d81b60","#f4511e","#ffb300","#c62828","#ef6c00"]},{id:"cool",label:"Cool",colors:["#1976d2","#00897b","#5e35b1","#039be5","#43a047","#3949ab","#00acc1","#7cb342"]},{id:"vibrant",label:"Vibrant",colors:["#e91e63","#9c27b0","#3f51b5","#03a9f4","#009688","#8bc34a","#ff9800","#f44336"]},{id:"pastel",label:"Pastel",colors:["#a8d8ea","#aa96da","#fcbad3","#ffffd2","#c5e1a5","#ffe0b2","#f8bbd0","#b2dfdb"]},{id:"monochrome",label:"Monochrome",colors:["#212121","#424242","#616161","#757575","#9e9e9e","#bdbdbd","#e0e0e0","#f5f5f5"]}];var qt=F(75419);const T0=()=>({visible:!0}),E0=()=>({width:0});function S0(i,a){1&i&&(e.j41(0,"div",6),e.nrm(1,"kendo-loader",7),e.k0s())}function k0(i,a){1&i&&(e.j41(0,"div",8),e.nrm(1,"i",9),e.j41(2,"span"),e.EFF(3,"No data available"),e.k0s()())}function R0(i,a){1&i&&e.nrm(0,"kendo-chart-legend",16)}function I0(i,a){1&i&&e.nrm(0,"kendo-chart-series-item-labels",17),2&i&&e.Y8G("visible",!0)}function y0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-chart",10),e.bIt("seriesClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSeriesClick(o))}),e.DNE(1,R0,1,0,"kendo-chart-legend",11),e.j41(2,"kendo-chart-category-axis")(3,"kendo-chart-category-axis-item",12),e.nrm(4,"kendo-chart-category-axis-item-labels",13),e.k0s()(),e.j41(5,"kendo-chart-series")(6,"kendo-chart-series-item",14),e.DNE(7,I0,1,1,"kendo-chart-series-item-labels",15),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("transitions",!1)("seriesColors",t.seriesColors),e.R7$(),e.Y8G("ngIf",t.widget.showLegend
1),e.R7$(2),e.Y8G("categories",t.getCategories()),e.R7$(),e.Y8G("rotation",-45),e.R7$(2),e.Y8G("data",t.chartData),e.R7$(),e.Y8G("ngIf",t.widget.showLabels)}}function w0(i,a){1&i&&e.nrm(0,"kendo-chart-legend",16)}function D0(i,a){1&i&&e.nrm(0,"kendo-chart-series-item-labels",17),2&i&&e.Y8G("visible",!0)}function O0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-chart",18),e.bIt("seriesClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSeriesClick(o))}),e.DNE(1,w0,1,0,"kendo-chart-legend",11),e.j41(2,"kendo-chart-category-axis")(3,"kendo-chart-category-axis-item",12),e.nrm(4,"kendo-chart-category-axis-item-labels",13),e.k0s()(),e.j41(5,"kendo-chart-series")(6,"kendo-chart-series-item",19),e.DNE(7,D0,1,1,"kendo-chart-series-item-labels",15),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("transitions",!1),e.R7$(),e.Y8G("ngIf",t.widget.showLegend),e.R7$(2),e.Y8G("categories",t.getCategories()),e.R7$(),e.Y8G("rotation",-45),e.R7$(2),e.Y8G("data",t.chartData)("markers",e.lJ4(7,T0)),e.R7$(),e.Y8G("ngIf",t.widget.showLabels)}}function x0(i,a){1&i&&e.nrm(0,"kendo-chart-legend",16)}function M0(i,a){if(1&i&&e.nrm(0,"kendo-chart-series-item-labels",22),2&i){const t=e.XpG(2);e.Y8G("visible",!0)("content",t.labelContent)}}function F0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-chart",10),e.bIt("seriesClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSeriesClick(o))}),e.DNE(1,x0,1,0,"kendo-chart-legend",11),e.j41(2,"kendo-chart-series")(3,"kendo-chart-series-item",20),e.DNE(4,M0,1,2,"kendo-chart-series-item-labels",21),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("transitions",!1)("seriesColors",t.seriesColors),e.R7$(),e.Y8G("ngIf",t.widget.showLegend),e.R7$(2),e.Y8G("data",t.chartData),e.R7$(),e.Y8G("ngIf",t.widget.showLabels)}}function P0(i,a){1&i&&e.nrm(0,"kendo-chart-legend",16)}function N0(i,a){if(1&i&&e.nrm(0,"kendo-chart-series-item-labels",22),2&i){const t=e.XpG(2);e.Y8G("visible",!0)("content",t.labelContent)}}function G0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-chart",10),e.bIt("seriesClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSeriesClick(o))}),e.DNE(1,P0,1,0,"kendo-chart-legend",11),e.j41(2,"kendo-chart-series")(3,"kendo-chart-series-item",23),e.DNE(4,N0,1,2,"kendo-chart-series-item-labels",21),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("transitions",!1)("seriesColors",t.seriesColors),e.R7$(),e.Y8G("ngIf",t.widget.showLegend),e.R7$(2),e.Y8G("data",t.chartData)("holeSize",60),e.R7$(),e.Y8G("ngIf",t.widget.showLabels)}}function A0(i,a){1&i&&e.nrm(0,"kendo-chart-legend",16)}function L0(i,a){1&i&&e.nrm(0,"kendo-chart-series-item-labels",17),2&i&&e.Y8G("visible",!0)}function B0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-chart",18),e.bIt("seriesClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSeriesClick(o))}),e.DNE(1,A0,1,0,"kendo-chart-legend",11),e.j41(2,"kendo-chart-category-axis")(3,"kendo-chart-category-axis-item",12),e.nrm(4,"kendo-chart-category-axis-item-labels",13),e.k0s()(),e.j41(5,"kendo-chart-series")(6,"kendo-chart-series-item",24),e.DNE(7,L0,1,1,"kendo-chart-series-item-labels",15),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("transitions",!1),e.R7$(),e.Y8G("ngIf",t.widget.showLegend),e.R7$(2),e.Y8G("categories",t.getCategories()),e.R7$(),e.Y8G("rotation",-45),e.R7$(2),e.Y8G("data",t.chartData),e.R7$(),e.Y8G("ngIf",t.widget.showLabels)}}function j0(i,a){1&i&&e.nrm(0,"kendo-chart-series-item-labels",28),2&i&&e.Y8G("visible",!0)("border",e.lJ4(2,E0))}function V0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-chart",18),e.bIt("seriesClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSeriesClick(o))}),e.nrm(1,"kendo-chart-legend",25),e.j41(2,"kendo-chart-series")(3,"kendo-chart-series-item",26),e.DNE(4,j0,1,3,"kendo-chart-series-item-labels",27),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("transitions",!1),e.R7$(),e.Y8G("visible",!0),e.R7$(2),e.Y8G("data",t.chartData)("dynamicHeight",!1)("segmentSpacing",2),e.R7$(),e.Y8G("ngIf",t.widget.showLabels)}}function $0(i,a){1&i&&e.nrm(0,"kendo-chart-legend",16)}function U0(i,a){1&i&&e.nrm(0,"kendo-chart-series-item-labels",17),2&i&&e.Y8G("visible",!0)}function Y0(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-chart",18),e.bIt("seriesClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSeriesClick(o))}),e.DNE(1,$0,1,0,"kendo-chart-legend",11),e.j41(2,"kendo-chart-category-axis")(3,"kendo-chart-category-axis-item",12),e.nrm(4,"kendo-chart-category-axis-item-labels",13),e.k0s()(),e.j41(5,"kendo-chart-series")(6,"kendo-chart-series-item",29),e.DNE(7,U0,1,1,"kendo-chart-series-item-labels",15),e.k0s()()()}if(2&i){const t=e.XpG();e.Y8G("transitions",!1),e.R7$(),e.Y8G("ngIf",t.widget.showLegend
1),e.R7$(2),e.Y8G("categories",t.getCategories()),e.R7$(),e.Y8G("rotation",-45),e.R7$(2),e.Y8G("data",t.chartData),e.R7$(),e.Y8G("ngIf",t.widget.showLabels)}}function H0(i,a){if(1&i&&e.nrm(0,"kendo-sparkline",30),2&i){const t=e.XpG();e.Y8G("data",t.getSparklineValues())}}let X0=(()=>{class i{constructor(){this.data=null,this.loading=!1,this.drillThrough=new e.bkB,this.chartData=[],this.DashboardWidgetType=w.v2,this.labelContent=t=>`${t.category}: ${t.value}`}ngOnChanges(t){(t.data||t.widget)&&this.processChartData(),t.widget&&(this.seriesColors=function b0(i){if(!i||!i.colorPaletteId)return;if(i.colorPaletteId===Pi){const t=i.colorScheme;return t&&t.length>0?t:void 0}const a=pd.find(t=>t.id===i.colorPaletteId);return a?a.colors:void 0}(this.widget))}processChartData(){this.chartData=this.data&&this.data.chartData?this.data.chartData.map(t=>{const n={category:String(t[this.widget.categoryField]||"Unknown"),value:Number(t[this.widget.valueField]||0)};return t.color&&(n.color=String(t.color)),n}):[]}isBarChart(){return this.widget.type===w.v2.BarChart}isLineChart(){return this.widget.type===w.v2.LineChart}isPieChart(){return this.widget.type===w.v2.PieChart}isDonutChart(){return this.widget.type===w.v2.DonutChart}isAreaChart(){return this.widget.type===w.v2.AreaChart}isFunnelChart(){return this.widget.type===w.v2.FunnelChart}isHeatMapChart(){return this.widget.type===w.v2.HeatMap}isSparkline(){return this.widget.type===w.v2.Sparkline}isPieOrDonut(){return this.isPieChart()||this.isDonutChart()}getCategories(){return this.chartData.map(t=>t.category)}getSparklineValues(){return this.chartData.map(t=>t.value)}onSeriesClick(t){const n=String(t.category||"");n&&this.drillThrough.emit({category:n,widget:this.widget})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-chart-widget"]],inputs:{widget:"widget",data:"data",loading:"loading"},outputs:{drillThrough:"drillThrough"},features:[e.OA$],decls:11,vars:10,consts:[[1,"chart-widget"],["class","loading-state",4,"ngIf"],["class","empty-state",4,"ngIf"],["class","chart-container",3,"transitions","seriesColors","seriesClick",4,"ngIf"],["class","chart-container",3,"transitions","seriesClick",4,"ngIf"],["class","sparkline-container","type","line",3,"data",4,"ngIf"],[1,"loading-state"],["type","pulsing","size","medium"],[1,"empty-state"],[1,"mdi","mdi-chart-bar"],[1,"chart-container",3,"seriesClick","transitions","seriesColors"],["position","bottom",4,"ngIf"],[3,"categories"],[3,"rotation"],["type","column","field","value","categoryField","category",3,"data"],["format","{0:N0}",3,"visible",4,"ngIf"],["position","bottom"],["format","{0:N0}",3,"visible"],[1,"chart-container",3,"seriesClick","transitions"],["type","line","field","value","categoryField","category",3,"data","markers"],["type","pie","field","value","categoryField","category",3,"data"],["position","outsideEnd",3,"visible","content",4,"ngIf"],["position","outsideEnd",3,"visible","content"],["type","donut","field","value","categoryField","category",3,"data","holeSize"],["type","area","field","value","categoryField","category",3,"data"],["position","right",3,"visible"],["type","funnel","field","value","categoryField","category","colorField","color",3,"data","dynamicHeight","segmentSpacing"],["format","N0","align","center","background","none",3,"visible","border",4,"ngIf"],["format","N0","align","center","background","none",3,"visible","border"],["type","heatmap","xField","category","yField","category","field","value",3,"data"],["type","line",1,"sparkline-container",3,"data"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.DNE(1,S0,2,0,"div",1)(2,k0,4,0,"div",2)(3,y0,8,7,"kendo-chart",3)(4,O0,8,8,"kendo-chart",4)(5,F0,5,5,"kendo-chart",3)(6,G0,5,6,"kendo-chart",3)(7,B0,8,6,"kendo-chart",4)(8,V0,5,6,"kendo-chart",4)(9,Y0,8,6,"kendo-chart",4)(10,H0,1,1,"kendo-sparkline",5),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading&&0===o.chartData.length),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isBarChart()),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isLineChart()),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isPieChart()),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isDonutChart()),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isAreaChart()),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isFunnelChart()),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isHeatMapChart()),e.R7$(),e.Y8G("ngIf",!o.loading&&o.chartData.length>0&&o.isSparkline()))},dependencies:[M.bT,ze.VU,qt.Qeh,qt.PUb,qt.u$2,qt.y98,qt.fMr,qt.Vfc,qt.EqR,qt.c_i,qt.Bp],styles:[".chart-widget[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;color:#7b7b7b}.empty-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:2rem}.empty-state[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.875rem}.chart-container[_ngcontent-%COMP%]{width:100%;height:100%;cursor:pointer}.sparkline-container[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;align-items:center;justify-content:center}"]})}}return i})();var W0=F(58143),z0=F(84161);const K0=()=>({mode:"multiple"}),J0=()=>[10,25,50,100],q0=i=>({"background-color":i});function Q0(i,a){1&i&&(e.j41(0,"div",4),e.nrm(1,"kendo-loader",5),e.k0s())}function Z0(i,a){1&i&&(e.j41(0,"div",6),e.nrm(1,"i",7),e.j41(2,"span"),e.EFF(3,"No data available"),e.k0s()())}function eT(i,a){if(1&i&&(e.nrm(0,"kendo-pager-prev-buttons")(1,"kendo-pager-numeric-buttons",11)(2,"kendo-pager-next-buttons")(3,"kendo-pager-page-sizes",12),e.j41(4,"span",13),e.EFF(5),e.nI1(6,"number"),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("buttonCount",5),e.R7$(2),e.Y8G("pageSizes",e.lJ4(5,J0)),e.R7$(2),e.SpI("",e.bMT(6,3,t.totalRecordCount)," total records")}}function tT(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",21),e.nI1(1,"translate"),e.nI1(2,"translate"),e.bIt("click",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(4);return e.Njj(s.onAdvanceStageClick(o,r))}),e.nrm(3,"i"),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(4);
1e.FS9("title",e.bMT(1,6,"WORKFLOW.MOVE_TO_STAGE.TITLE")),e.Y8G("disabled",n.stageChangingItemId===t.itemGuid),e.BMQ("aria-label",e.bMT(2,8,"WORKFLOW.MOVE_TO_STAGE.TITLE")),e.R7$(3),e.ZvI("mdi ",n.stageChangingItemId===t.itemGuid?"mdi-loading mdi-spin":"mdi-chevron-right","")}}function nT(i,a){if(1&i&&(e.qex(0),e.j41(1,"span",17),e.nrm(2,"span",18),e.j41(3,"span",19),e.EFF(4),e.k0s(),e.DNE(5,tT,4,10,"button",20),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit,n=e.XpG(2).$implicit,o=e.XpG(2);e.R7$(2),e.Y8G("ngStyle",e.eq3(3,q0,null==t.currentStageObject?null:t.currentStageObject.color)),e.R7$(2),e.SpI(" ",(null==t.currentStageObject?null:t.currentStageObject.name)||t[n.field]," "),e.R7$(),e.Y8G("ngIf",o.canAdvanceStage)}}function iT(i,a){if(1&i&&(e.qex(0),e.nrm(1,"span",22),e.bVm()),2&i){const t=e.XpG().$implicit,n=e.XpG(2).$implicit;e.R7$(),e.Y8G("innerHTML",t[n.field],e.npT)}}function oT(i,a){if(1&i&&(e.qex(0),e.j41(1,"span"),e.EFF(2),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit,n=e.XpG(2).$implicit,o=e.XpG(2);e.R7$(2),e.JRh(o.formatCellValue(t[n.field]))}}function rT(i,a){if(1&i&&e.DNE(0,nT,6,5,"ng-container",15)(1,iT,2,1,"ng-container",15)(2,oT,3,1,"ng-container",15),2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.Y8G("ngIf",n.isStageColumn(t)),e.R7$(),e.Y8G("ngIf",!n.isStageColumn(t)&&n.isHtmlColumn(t.field)),e.R7$(),e.Y8G("ngIf",!n.isStageColumn(t)&&!n.isHtmlColumn(t.field)&&t.wrapText)}}function aT(i,a){1&i&&e.DNE(0,rT,3,3,"ng-template",16)}function sT(i,a){if(1&i&&(e.j41(0,"span",24)(1,"span",25),e.EFF(2),e.k0s(),e.j41(3,"span",26),e.EFF(4),e.k0s()()),2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.R7$(2),e.SpI("",n.getAggregateLabel(t.aggregate),":"),e.R7$(2),e.JRh(n.getAggregateValue(t.field,t.aggregate))}}function lT(i,a){1&i&&e.DNE(0,sT,5,2,"ng-template",23)}function dT(i,a){if(1&i&&(e.j41(0,"span",26),e.EFF(1),e.nI1(2,"number"),e.k0s()),2&i){const t=a.$implicit,n=e.XpG(2).$implicit;e.R7$(),e.JRh(e.i5U(2,1,null==t[n.field]?null:t[n.field][n.aggregate],"1.2-2"))}}function cT(i,a){1&i&&e.DNE(0,dT,3,4,"ng-template",27)}function pT(i,a){if(1&i&&(e.j41(0,"kendo-grid-column",14),e.DNE(1,aT,1,0,null,15)(2,lT,1,0,null,15)(3,cT,1,0,null,15),e.k0s()),2&i){const t=a.$implicit,n=e.XpG(2);e.HbH(t.wrapText?"wrap-text-cell":""),e.Y8G("field",t.field)("title",t.title)("width",t.width)("format",n.isHtmlColumn(t.field)||n.isStageColumn(t)?void 0:n.getColumnFormat(t.field)),e.R7$(),e.Y8G("ngIf",n.isStageColumn(t)||n.isHtmlColumn(t.field)||t.wrapText),e.R7$(),e.Y8G("ngIf",t.aggregate),e.R7$(),e.Y8G("ngIf",t.aggregate)}}function uT(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-grid",8),e.bIt("dataStateChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onDataStateChange(o))})("cellClick",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onCellClick(o))}),e.DNE(1,eT,7,6,"ng-template",9)(2,pT,4,9,"kendo-grid-column",10),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("data",t.gridDataResult)("pageSize",t.gridState.take)("skip",t.gridState.skip)("pageable",t.pageableSettings)("filterable",t.widget.showFilters)("sortable",e.lJ4(12,K0))("resizable",!0)("groupable",!0)("sort",t.gridState.sort)("filter",t.gridState.filter)("group",t.gridState.group),e.R7$(2),e.Y8G("ngForOf",t.sanitizedColumns)}}class wn{constructor(a,t,n){this._reportingApi=a,this._dialogService=t,this._msgService=n,this.data=null,this.loading=!1,this.rowClick=new e.bkB,this.stateChange=new e.bkB,this._element=null,this._destroyed$=new ue.B7,this.stageChangingItemId=null,this.rawData=[],this._fieldMap=new Map,this._reverseFieldMap=new Map,this.sanitizedColumns=[],this.gridDataResult={data:[],total:0},this.gridState={skip:0,take:25,sort:[],filter:null,group:[]},this.pageableSettings={pageSizes:[10,25,50,100],info:!0,buttonCount:5},this.htmlColumns=new Set}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}ngOnChanges(a){if(a.widget&&this.widget){const t=Number(this.widget.pageSize)||25;this.gridState={...this.gridState,skip:0,take:t},this.buildFieldMaps(),this._loadElement()}a.data&&this.loadRawData()}loadRawData(){this.rawData=this.data&&this.data.gridData?this.data.gridData:[],this.remapDataKeys(),this.parseDateValues(),this.detectHtmlColumns(),this._enrichWithStageObjects(),this.processGridData()}get isServerSidePaging(){return null!=this.data?.totalRecords&&this.data.totalRecords>=0}get totalRecordCount(){return this.isServerSidePaging?this.data.totalRecords:this.rawData.length}processGridData(){if(this.isServerSidePaging)if(this.gridState.group?.length){const a={group:this.gridState.group.map(n=>({...n,aggregates:this.getColumnAggregateDescriptors()}))},t=(0,He.eh)(this.rawData,a);this.gridDataResult={data:t.data,total:this.data.totalRecords}}else this.gridDataResult={data:this.rawData,total:this.data.totalRecords};else{if(this.gridState.group?.length){const a=this.getColumnAggregateDescriptors();a.length>0&&(this.gridState.group=this.gridState.group.map(t=>({...t,aggregates:a})))}this.gridDataResult=(0,He.eh)(this.rawData,this.gridState)}}onDataStateChange(a){if(a.group?.length){const t=this.getColumnAggregateDescriptors();t.length>0&&(a.group=a.group.map(n=>({...n,aggregates:t})))}if(this.isServerSidePaging){const t=this.gridState.skip,n=this.gridState.take,o=this.gridState.sort,r=this.gridState.filter;this.gridState=a;const s=JSON.stringify(o)!==JSON.stringify(a.sort),c=t!==a.skip||n!==a.take,u=JSON.stringify(r)!==JSON.stringify(a.filter);if(s||c||u){const g=u?0:a.skip||0;u&&(this.gridState={...this.gridState,skip:0});const b=(a.sort||[]).filter(k=>k.field&&k.dir).slice(0,3).map(k=>({field:this.toOriginalFieldName(k.field),direction:k.dir}));return void this.stateChange.emit({widgetId:this.widget.id,page:Math.floor(g/(a.take||25))+1,pageSize:a.take||25,sortDe
1scriptors:b,columnFilters:this.flattenFilters(a.filter)})}this.processGridData()}else this.gridState=a,this.processGridData()}flattenFilters(a){if(!a||!a.filters)return[];const t=[];for(const n of a.filters)if("filters"in n)t.push(...this.flattenFilters(n));else{const o=n;o.field&&null!=o.operator&&t.push({field:this.toOriginalFieldName(o.field),operator:o.operator,value:null!=o.value?String(o.value):""})}return t}get hasAggregates(){return this.sanitizedColumns.some(a=>!!a.aggregate)}getColumnAggregateDescriptors(){return this.sanitizedColumns.filter(a=>a.aggregate).map(a=>({field:a.field,aggregate:a.aggregate}))}getAggregateValue(a,t){const n=this.data?.columnAggregates;if(!n)return"";const r=n[this.toOriginalFieldName(a)];if(!r)return"";const s=r[t];if(null==s)return"";if("number"==typeof s){const u=this.sanitizedColumns.find(g=>g.field===a)?.decimalPlaces??2;return s.toLocaleString(void 0,{minimumFractionDigits:u,maximumFractionDigits:u})}return String(s)}getAggregateLabel(a){switch(a){case"sum":return"Sum";case"average":return"Avg";case"count":return"Count";case"min":return"Min";case"max":return"Max";default:return""}}getColumnTitle(a){return this.sanitizedColumns.find(n=>n.field===a)?.title||this.toTitleCase(a)}getColumnWidth(a){return this.sanitizedColumns.find(n=>n.field===a)?.width}static{this.ID_FIELDS=new Set(["relativeid","elementid","currentstage","currentStageid","statusid","assigneduserid"])}getColumnFormat(a){const t=this.sanitizedColumns.find(n=>n.field===a);if(t){if(t.format)return t.format;if(this.isDateColumn(a))return"{0:MM/dd/yyyy}";if("currency"===t.numberFormat)return`{0:c${t.decimalPlaces??2}}`;if("comma"===t.numberFormat)return`{0:n${t.decimalPlaces??2}}`;if("none"!==t.numberFormat&&!wn.ID_FIELDS.has(a.toLowerCase())&&this.isNumericColumn(a))return"{0:n2}"}}isNumericColumn(a){for(const t of this.rawData){const n=t[a];if(null!=n)return"number"==typeof n}return!1}isDateColumn(a){for(const t of this.rawData){const n=t[a];if(null!=n)return n instanceof Date}return!1}static{this.ISO_DATE_REGEX=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/}parseDateValues(){if(!this.rawData.length||!this.sanitizedColumns.length)return;const a=new Set,t=new Set;for(const n of this.rawData){for(const o of this.sanitizedColumns){if(t.has(o.field))continue;const r=n[o.field];null!=r&&(t.add(o.field),"string"==typeof r&&wn.ISO_DATE_REGEX.test(r)&&a.add(o.field))}if(t.size===this.sanitizedColumns.length)break}if(0!==a.size)for(const n of this.rawData)for(const o of a){const r=n[o];"string"==typeof r&&r&&(n[o]=new Date(r))}}getColumnFields(){return this.sanitizedColumns.map(a=>a.field)}get canAdvanceStage(){return!(!this._element?.userCanMoveToStage||!this.widget?.workflowTypeId)}isStageColumn(a){return"currentStage"===a.originalField}_loadElement(){this.widget?.workflowTypeId?this._reportingApi.getElementDetail(this.widget.workflowTypeId).pipe((0,O.s)(1),(0,L.Q)(this._destroyed$)).subscribe({next:a=>{this._element=a,this._enrichWithStageObjects(),this.processGridData()},error:()=>{this._element=null}}):this._element=null}_enrichWithStageObjects(){this._element?.stages?.length&&(this.rawData=this.rawData.map(a=>({...a,currentStageObject:this._element.stages.find(t=>t.id===a.currentStageId)??this._element.stages.find(t=>t.name===a.currentStage)??null})))}onAdvanceStageClick(a,t){if(a.stopPropagation(),!this._element)return;const n=t.currentStageObject,o=(this._element.stages||[]).map(s=>(null!=t.currentStageId?s.id===t.currentStageId:s.name===n?.name)?{...s,disabled:!0}:s);this._dialogService.open(W0.y,{header:this._msgService.getTranslation("WORKFLOW.MOVE_TO_STAGE.TITLE"),width:"500px",data:{itemTitle:t.title,elementIcon:this._element.iconId,stageColor:n?.color,stageName:n?.name,stages:o}}).onClose.pipe((0,O.s)(1)).subscribe(s=>{s&&this._changeStage(t,s)})}_changeStage(a,t){this.stageChangingItemId=a.itemGuid,this._reportingApi.getElementInstance(a.itemGuid).pipe((0,O.s)(1),(0,Oe.n)(n=>this._reportingApi.updateElementInstance({...n,currentStageId:t.id})),(0,ne.j)(()=>this.stageChangingItemId=null)).subscribe({next:()=>{this._updateStageLocally(a.itemGuid,t),this._msgService.success("WORKFLOW.TOAST.STAGE_CHANGE_SUCCESS.MESSAGE","WORKFLOW.TOAST.STAGE_CHANGE_SUCCESS.TITLE")},error:n=>{this._msgService.error(1891===n?.error?.error?.code?"ELEMENTS.ITEMS.TOAST.
1UPDATE_ERROR.MISSING_MANDATORY_FIELDS_MESSAGE":"ELEMENTS.ITEMS.TOAST.UPDATE_ERROR.MESSAGE","ELEMENTS.ITEMS.TOAST.UPDATE_ERROR.TITLE")}})}_updateStageLocally(a,t){const n=this._element?.stages?.find(r=>r.id===t.id)??null,o=this.rawData.findIndex(r=>r.itemGuid===a);-1!==o&&(this.rawData=[...this.rawData.slice(0,o),{...this.rawData[o],currentStageId:t.id,currentStage:n?.name??this.rawData[o].currentStage,currentStageObject:n},...this.rawData.slice(o+1)],this.processGridData())}onCellClick(a){const t=a?.dataItem;t?.itemGuid&&this.rowClick.emit({elementId:this.widget.workflowTypeId,instanceId:t.itemGuid,dataSetId:this.widget.dataSetId})}stripHtml(a){if(null==a)return"";const t=String(a);if(!/<[^>]+>/.test(t))return t;const n=document.createElement("div");return n.innerHTML=t,n.textContent||n.innerText||""}containsHtml(a){return null!=a&&"string"==typeof a&&/<[^>]+>/.test(a)}isHtmlColumn(a){return this.htmlColumns.has(a)}detectHtmlColumns(){this.htmlColumns.clear();for(const a of this.sanitizedColumns)for(const t of this.rawData)if(this.containsHtml(t[a.field])){this.htmlColumns.add(a.field);break}}formatCellValue(a){return null==a?"":a instanceof Date?`${String(a.getMonth()+1).padStart(2,"0")}/${String(a.getDate()).padStart(2,"0")}/${a.getFullYear()}`:String(a)}toTitleCase(a){return a.replace(/([A-Z])/g," $1").replace(/_/g," ").replace(/^./,t=>t.toUpperCase()).trim()}static{this.INVALID_IDENT_CHARS=/[^a-zA-Z0-9_$]/g}static sanitizeFieldName(a){let t=a.replace(wn.INVALID_IDENT_CHARS,"_");return/^\d/.test(t)&&(t="_"+t),t}buildFieldMaps(){if(this._fieldMap.clear(),this._reverseFieldMap.clear(),!this.widget?.columns)return void(this.sanitizedColumns=[]);const a=new Set;this.sanitizedColumns=this.widget.columns.map(t=>{let n=wn.sanitizeFieldName(t.field);if(a.has(n)&&!this._fieldMap.has(t.field)){let o=2;for(;a.has(`${n}_${o}`);)o++;n=`${n}_${o}`}return a.add(n),this._fieldMap.set(t.field,n),this._reverseFieldMap.set(n,t.field),{...t,field:n,title:t.title||this.toTitleCase(t.field),originalField:t.field}})}remapDataKeys(){!this._fieldMap.size||!this.rawData.length||!this.widget?.columns?.some(t=>t.field!==this._fieldMap.get(t.field))||(this.rawData=this.rawData.map(t=>{const n={};for(const[o,r]of Object.entries(t))n[this._fieldMap.get(o)||o]=r;return n}))}toOriginalFieldName(a){return this._reverseFieldMap.get(a)||a}static{this.\u0275fac=function(t){return new(t||wn)(e.rXU(Ye.F),e.rXU(It.o3),e.rXU(q.Ui))}}static{this.\u0275cmp=e.VBU({type:wn,selectors:[["cad-grid-widget"]],inputs:{widget:"widget",data:"data",loading:"loading"},outputs:{rowClick:"rowClick",stateChange:"stateChange"},features:[e.OA$],decls:4,vars:3,consts:[[1,"grid-widget"],["class","loading-state",4,"ngIf"],["class","empty-state",4,"ngIf"],["class","grid-container",3,"data","pageSize","skip","pageable","filterable","sortable","resizable","groupable","sort","filter","group","dataStateChange","cellClick",4,"ngIf"],[1,"loading-state"],["type","pulsing","size","medium"],[1,"empty-state"],[1,"mdi","mdi-table"],[1,"grid-container",3,"dataStateChange","cellClick","data","pageSize","skip","pageable","filterable","sortable","resizable","groupable","sort","filter","group"],["kendoPagerTemplate",""],[3,"field","title","width","format","class",4,"ngFor","ngForOf"],[3,"buttonCount"],["localizedPagerPageSizes","",3,"pageSizes"],[1,"total-records"],[3,"field","title","width","format"],[4,"ngIf"],["kendoGridCellTemplate",""],[1,"stageInfo"],[1,"stageInfo__colorIndicator",3,"ngStyle"],[1,"stageInfo__text"],["class","button button_round stageInfo__advanceBtn",3,"disabled","title","click",4,"ngIf"],[1,"button","button_round","stageInfo__advanceBtn",3,"click","disabled","title"],[1,"html-cell",3,"innerHTML"],["kendoGridFooterTemplate",""],[1,"aggregate-footer"],[1,"aggregate-label"],[1,"aggregate-value"],["kendoGridGroupFooterTemplate",""]],template:function(t,n){1&t&&(e.j41(0,"div",0),e.DNE(1,Q0,2,0,"div",1)(2,Z0,4,0,"div",2)(3,uT,3,13,"kendo-grid",3),e.k0s()),2&t&&(e.R7$(),e.Y8G("ngIf",n.loading),e.R7$(),e.Y8G("ngIf",!n.loading&&0===n.gridDataResult.total),e.R7$(),e.Y8G("ngIf",!n.loading&&n.gridDataResult.total>0))},dependencies:[M.Sq,M.bT,M.B3,z0.F,xt._ab,xt.geU,xt.Ioe,xt.TPV,xt.
1i4w,Ie.Zc,Ie.F$,Ie.Gj,Ie.hw,Ie.HG,ze.VU,M.QX,nt.D9],styles:[".grid-widget[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%}.loading-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:100%}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;height:100%;color:#7b7b7b}.empty-state[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:2rem}.empty-state[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.875rem}.grid-container[_ngcontent-%COMP%]{height:100%;width:100%}.grid-container[_ngcontent-%COMP%]     .k-grid{border:none}.grid-container[_ngcontent-%COMP%]     .k-grid-header{font-weight:600}.grid-container[_ngcontent-%COMP%]     .k-grid-content tr{cursor:pointer}.grid-container[_ngcontent-%COMP%]     .k-pager-wrap, .grid-container[_ngcontent-%COMP%]     .k-pager{border-top:1px solid #dedede}.grid-container[_ngcontent-%COMP%]     .total-records{margin-left:auto;font-size:.8125rem;font-weight:500;color:#7b7b7b;white-space:nowrap;padding-right:8px}.grid-container[_ngcontent-%COMP%]     .k-grid-footer{background:#fafafa;border-top:2px solid #dedede;font-weight:600}.grid-container[_ngcontent-%COMP%]     .k-grid-footer td{padding:6px 12px}.grid-container[_ngcontent-%COMP%]     .k-group-footer td{background:#5f84fc0a;border-top:1px solid #dedede;font-weight:600}.grid-container[_ngcontent-%COMP%]     .k-grouping-row td{font-weight:600;background:#fafafa}.grid-container[_ngcontent-%COMP%]     .k-grouping-header{padding:8px 12px;background:#fafafa;border-bottom:1px solid #dedede;font-size:.8125rem;color:#7b7b7b}.grid-container[_ngcontent-%COMP%]     td.wrap-text-cell{white-space:normal;word-break:break-word;line-height:1.4}.grid-container[_ngcontent-%COMP%]     .html-cell{display:block;white-space:normal;word-break:break-word;line-height:1.4;font-size:.8125rem}.grid-container[_ngcontent-%COMP%]     .html-cell p{margin:0 0 .25em}.grid-container[_ngcontent-%COMP%]     .html-cell p:last-child{margin-bottom:0}.grid-container[_ngcontent-%COMP%]     .html-cell ul, .grid-container[_ngcontent-%COMP%]     .html-cell ol{margin:.25em 0;padding-left:1.25em}.stageInfo[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.stageInfo__colorIndicator[_ngcontent-%COMP%]{flex-shrink:0;display:block;width:8px;height:8px;margin:0 .5rem 0 0;border-radius:1000px}.stageInfo__text[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stageInfo__advanceBtn[_ngcontent-%COMP%]{margin-left:4px;width:20px;height:20px;min-width:unset;padding:0;opacity:0;pointer-events:none;transition:opacity .15s;flex-shrink:0}.stageInfo__advanceBtn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:14px}.stageInfo[_ngcontent-%COMP%]:hover   .stageInfo__advanceBtn[_ngcontent-%COMP%], .stageInfo[_ngcontent-%COMP%]:focus-within   .stageInfo__advanceBtn[_ngcontent-%COMP%]{opacity:1;pointer-events:auto}.aggregate-footer[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.aggregate-label[_ngcontent-%COMP%]{font-size:.75rem;color:#7b7b7b;font-weight:500}.aggregate-value[_ngcontent-%COMP%]{font-weight:600;color:#000}"]})}}var _T=F(16119),Qt=F(22908);function mT(i,a){if(1&i&&(e.j41(0,"span",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG().date,n=e.XpG(2);e.R7$(),e.SpI(" ",n.formatSummary(n.getDailySummary(t))," ")}}function gT(i,a){if(1&i&&(e.j41(0,"div",3)(1,"span",4),e.EFF(2),e.k0s(),e.DNE(3,mT,2,1,"span",5),e.k0s()),2&i){const t=a.date,n=e.XpG(2);e.R7$(2),e.JRh(t.getDate()),e.R7$(),e.Y8G("ngIf",null!==n.getDailySummary(t))}}function hT(i,a){1&i&&e.DNE(0,gT,4,2,"ng-template",2)}function fT(i,a){if(1&i&&(e.j41(0,"span",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG().date,n=e.XpG(2);e.R7$(),e.SpI(" ",n.formatSummary(n.getDailySummary(t))," ")}}function CT(i,a){if(1&i&&(e.j41(0,"div",8)(1,"span",9),e.EFF(2),e.nI1(3,"date"),e.k0s(),e.DNE(4,fT,2,1,"span",5),e.k0s()),2&i){const t=a.date,n=e.XpG(2);e.R7$(2),e.JRh(e.i5U(3,2,t,"EEE d")),e.R7$(2),e.Y8G("ngIf",null!==n.getDailySummary(t))}}function vT(i,a){1&i&&e.DNE(0,CT,5,5,"ng-template",7)}function bT(i,a){if(1&i&&(e.j41(0,"span",6),e.EFF(1),e.k0s()),2&i){const t=e.XpG().date,n=e.XpG(2);e.R7$(),e.SpI(" ",n.formatSummary(n.getDailySummary(t))," ")}}function TT(i,a){if(1&i&&(e.j41(0,"div",8)(1,"span",9),e.EFF(2),e.nI1(3,"date"),e.k0s(),e.DNE(4,bT,2,1,"span",5),e.k0s()),2&i){const t=a.date,n=e.XpG(2);e.R7$(2),e.JRh(e.i5U(3,2,t,"EEEE, MMM d")),e.R7$(2),e.Y8G("ngIf",null!==n.getDailySummary(t))}}function ET(i,a){1&i&&e.DNE(0,TT,5,5,"ng-template",7)}function ST(i,a){if(1&i&&(e.j41(0,"span",14),e.EFF(1),e.k0s()),2&i){const t=e.XpG().date,n=e.XpG(2);e.R7$(),e.SpI(" ",n.formatSummary(n.getDailySummary(t))," ")}}function kT(i,a){if(1&i&&(e.j41(0,"div",11)(1,"span",12),e.EFF(2),e.nI1(3,"date"),e.k0s(),e.DNE(4,ST,2,1,"span",13),e.k0s()),2&i){const t=a.date,n=e.XpG(2);e.R7$(2),e.JRh(e.i5U(3,2,t,"EEE, MMM d, y")),e.R7$(2),e.Y8G("ngIf",null!==n.getDailySummary(t))}}function RT(i,a){1&i&&e.DNE(0,kT,5,5,"ng-template",10)}let Tu=(()=>{class i{constructor(){this.events=[],this.loading=!1,this.defaultView="month",this.eventColor="#09a564",this.eventClick=new e.bkB,this.dateChange=new e.bkB,this.selectedDate=new Date,this.selectedViewIndex=0,this.dailySummaries=new Map,this.viewIndexMap={month:0,week:1,day:2,agenda:3},this.getEventStyles=t=>{const n=t.event?.dataItem?.dataItem?._color||t.event?.dataItem?._color||"#09a564";return{backgroundColor:n,color:(0,_T.B)(n),cursor:"pointer"}}}ngOnInit(){this.selectedViewIndex=this.viewIndexMap[this.defaultView]??0}ngOnChanges(t){(t.events||t.summaryField||t.summaryType)&&this.computeDailySummaries()}computeDailySummaries(){if(this.dailySummaries.clear(),this.summaryType&&this.events?.length)for(const t of this.events){const n=this.toDateKey(t.start);if("count"===this.summaryType)this.dailySummaries.set(n,(this.dailySummaries.get(n)||0)+1);else if("sum"===this.summaryType&&this.summaryField){const o=Number(t.dataItem?.[this.summaryField])||0;this.dailySummaries.set(n,(this.dailySummaries.get(n)||0)+o)}}}toDateKey(t){return`${t.getFullYear()}
1-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}getDailySummary(t){const n=this.toDateKey(t);return this.dailySummaries.has(n)?this.dailySummaries.get(n):null}formatSummary(t){const n=this.summaryLabel||"";return"count"===this.summaryType?`${n}${t} item${1!==t?"s":""}`:`${n}${t.toLocaleString(void 0,{maximumFractionDigits:2})}`}get isMonthView(){return 0===this.selectedViewIndex}onViewIndexChange(t){this.selectedViewIndex=t}onEventClick(t){const n=t.event;n?.id&&this.eventClick.emit(this.isMonthView?{elementId:0,instanceId:n.id,isMonthView:!0,date:n.start}:{elementId:0,instanceId:n.id})}onSlotClick(t){this.isMonthView&&this.eventClick.emit({elementId:0,instanceId:null,isMonthView:!0,date:t.start})}onDateChange(t){this.selectedDate=t.selectedDate,this.dateChange.emit({start:t.dateRange.start,end:t.dateRange.end})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-calendar-report-widget"]],inputs:{events:"events",loading:"loading",defaultView:"defaultView",eventColor:"eventColor",summaryField:"summaryField",summaryType:"summaryType",summaryLabel:"summaryLabel"},outputs:{eventClick:"eventClick",dateChange:"dateChange"},features:[e.OA$],decls:9,vars:10,consts:[[2,"height","100%",3,"eventClick","slotClick","dateChange","selectedViewIndexChange","events","selectedDate","showWorkHours","selectedViewIndex","eventStyles","loading"],[4,"ngIf"],["kendoSchedulerMonthDaySlotTemplate",""],[1,"day-slot-custom"],[1,"day-number"],["class","day-summary-badge",4,"ngIf"],[1,"day-summary-badge"],["kendoSchedulerDateHeaderTemplate",""],[1,"date-header-custom"],[1,"date-header-label"],["kendoSchedulerAgendaDateTemplate",""],[1,"agenda-date-custom"],[1,"agenda-date-label"],["class","day-summary-badge agenda-badge",4,"ngIf"],[1,"day-summary-badge","agenda-badge"]],template:function(n,o){1&n&&(e.j41(0,"kendo-scheduler",0),e.bIt("eventClick",function(s){return o.onEventClick(s)})("slotClick",function(s){return o.onSlotClick(s)})("dateChange",function(s){return o.onDateChange(s)})("selectedViewIndexChange",function(s){return o.onViewIndexChange(s)}),e.j41(1,"kendo-scheduler-month-view"),e.DNE(2,hT,1,0,null,1),e.k0s(),e.j41(3,"kendo-scheduler-week-view"),e.DNE(4,vT,1,0,null,1),e.k0s(),e.j41(5,"kendo-scheduler-day-view"),e.DNE(6,ET,1,0,null,1),e.k0s(),e.j41(7,"kendo-scheduler-agenda-view"),e.DNE(8,RT,1,0,null,1),e.k0s()()),2&n&&(e.Y8G("events",o.events)("selectedDate",o.selectedDate)("showWorkHours",!0)("selectedViewIndex",o.selectedViewIndex)("eventStyles",o.getEventStyles)("loading",o.loading),e.R7$(2),e.Y8G("ngIf",o.summaryType),e.R7$(2),e.Y8G("ngIf",o.summaryType),e.R7$(2),e.Y8G("ngIf",o.summaryType),e.R7$(2),e.Y8G("ngIf",o.summaryType))},dependencies:[M.bT,Qt.JC,Qt.pm,Qt.pX,Qt.NP,Qt.Tm,Qt.dp,Qt._y,Qt.x$,Qt.ik,M.vh],styles:["[_nghost-%COMP%]{display:block;height:100%;min-height:500px}  .k-button-solid-base.k-selected{background-color:#0d2c54;border-color:#0d2c54}  .day-summary-badge{display:inline-block;padding:1px 6px;border-radius:10px;font-size:.6875rem;font-weight:600;background-color:#5f84fc1f;color:#5f84fc;white-space:nowrap;cursor:pointer;transition:background-color .15s ease}  .day-summary-badge:hover{background-color:#5f84fc38}  .k-scheduler-monthview .day-slot-custom{display:flex;justify-content:space-between;align-items:center;width:100%;padding:2px 4px}  .date-header-custom{display:flex;align-items:center;gap:6px}  .date-header-custom .date-header-label{font-weight:500}  .agenda-date-custom{display:flex;flex-direction:column;align-items:flex-start;gap:2px}  .agenda-date-custom .agenda-date-label{font-weight:500}"]})}}return i})();var ud=F(26937),Eu=F(51304),IT=F(51263),yT=F(16939),wT=F(39294),DT=F(21943),OT=F(52944),Io=F(67480);const xT=()=>[];function MT(i,a){1&i&&(e.j41(0,"div",3),e.nrm(1,"i",4),e.j41(2,"p"),e.EFF(3,"Widget not configured \u2014 click the settings icon to set up."),e.k0s()())}function FT(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",3),e.nrm(1,"i",5),e.j41(2,"p"),e.EFF(3,"Failed to load element data."),e.k0s(),e.j41(4,"button",6),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onRetryLoad())}),e.EFF(5,"Retry"),e.k0s()()}}function PT(i,a){1&i&&e.nrm(0,"i",24)}function NT(i,a){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.JRh(t.getUserDisplayName(t.selectedUser))}}function GT(i,a){if(1&i&&e.DNE(0,NT,2,1,"span",2),2&i){const t=e.XpG(2);e.Y8G("ngIf",t.selectedUser)}}function AT(i,a){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=a.$implicit,n=e.XpG(2);e.R7$(),e.JRh(n.getUserDisplayName(t))}}function LT(i,a){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=a.$implicit;e.R7$(),e.Lme("",t.name," (",(null==t.users?null:t.users.length)||0,")")}}function BT(i,a){if(1&i&&(e.j41(0,"span",30),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.xc7("background",t.stageColor),e.R7$(),e.SpI(" ",t.stageName," ")}}function jT(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",27),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return e.Njj(r.onItemSelected(o))}),e.j41(1,"span",28),e.EFF(2),e.k0s(),e.DNE(3,BT,2,3,"span",29),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.title),e.R7$(),e.Y8G("ngIf",t.stageName)}}function VT(i,a){if(1&i&&(e.j41(0,"div",25),e.DNE(1,jT,4,2,"div",26),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.searchResults)}}function $T(i,a){1&i&&(e.j41(0,"div",31),e.nrm(1,"i",32),e.EFF(2," No active timers \u2014 search above to start tracking. "),e.k0s())}function UT(i,a){if(1&i&&(e.j41(0,"span",43),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.xc7("background",t.stage.color),e.R7$(),e.SpI(" ",t.stage.name," ")}}function YT(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",44),e.bIt("click",function(o){e.eBV(t);const r=e.XpG().$implicit;return e.XpG(2).onStopTimer(r),e.Njj(o.stopPropagation())}),e.nrm(1,"i",45),e.k0s()}}function HT(i,a){1&i&&e.nrm(0,"i",53)}function XT(i,a){1&i&&e.nrm(0,"i",54)}function WT(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",46)(1,"textarea",47),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG().$implicit;return e.DH7(r.pendingNote,o)||(r.pendingNote=o),e.Njj(o)}),e.k0s(),e.j41(2,"div",48)(3,"button",49),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(2);return e.Njj(r.onCancelStop(o))}),e.EFF(4," Cancel "),e.k0s(),e.j41(5,"button",50),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(2);return e.Njj(r.onConfirmStop(o))}),e.DNE(6,HT,1,0,"i",51)(7,XT,1,0,"i",52),e.EFF(8," Confirm Stop "),e.k0s()()()}if(2&i){const t=e.XpG().$implicit;e.R7$(),e.R50("ngModel",t.pendingNote),e.Y8G("autoResize",!0),e.R7$(2),e.Y8G("disabled",t.confirmingStop),e.R7$(2),e.Y8G("disabled",t.confirmingStop),e.R7$(),e.Y8G("ngIf",!t.confirmingStop),e.R7$(),e.Y8G("ngIf",t.confirmingStop)}}function zT(i,a){1&i&&(e.j41(0,"span",73),e.EFF(1,"*"),e.k0s())}function KT(i,a){if(1&i){const t=e.RV6();e.j41(0,"input",74),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3).$implicit;return e.DH7(s.fieldValues[r.dataFieldId],o)||(s.fieldValues[r.dataFieldId]=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(3).$implicit;e.R50("ngModel",n.fieldValues[t.dataFieldId])}}function JT(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-inputNumber",75),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3).$implicit;return e.DH7(s.fieldValues[r.dataFieldId],o)||(s.fieldValues[r.dataFieldId]=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(3).$implicit;e.R50("ngModel",n.fieldValues[t.dataFieldId]),e.Y8G("useGrouping",!1)}}function qT(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-inputNumber",76),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3).$implicit;return e.DH7(s.fieldValues[r.dataFieldId],o)||(s.fieldValues[r.dataFieldId]=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(3).$implicit;e.R50("ngModel",n.fieldValues[t.dataFieldId]),e.Y8G("minFractionDigits",2)}}function QT(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-checkbox",77),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3).$implicit;return e.DH7(s.fieldValues[r.dataFieldId],o)||(s.fieldValues[r.dataFieldId]=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(3).$implicit;e.R50("ngModel",n.fieldValues[t.dataFieldId]),e.Y8G("binary",!0)}}function ZT(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-calendar",78),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3).$implicit;return e.DH7(s.fieldValues[r.dataFieldId],o)||(s.fieldValues[r.dataFieldId]=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(3).$implicit;e.R50("ngModel",n.fieldValues[t.dataFieldId])}}function eE(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",79),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3).$implicit;return e.DH7(s.fieldValues[r.dataFieldId],o)||(s.fieldValues[r.dataFieldId]=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(3).$implicit;e.R50("ngModel",n.fieldValues[t.dataFieldId]),e.Y8G("options",n.selectorOptionsMap[t.dataFieldId]||e.lJ4(2,xT))}}function tE(i,a){if(1&i&&(e.qex(0),e.j41(1,"div",64)(2,"label",65),e.EFF(3),e.DNE(4,zT,2,0,"span",66),e.k0s(),e.DNE(5,KT,1,1,"input",67)(6,JT,1,2,"p-inputNumber",68)(7,qT,1,2,"p-inputNumber",69)(8,QT,1,2,"p-checkbox",70)(9,ZT,1,1,"p-calendar",71)(10,eE,1,3,"p-dropdown",72),e.k0s(),e.bVm()),2&i){const t=a.ngIf,n=e.XpG().$implicit,o=e.XpG(5);e.R7$(3),e.SpI(" ",n.label||t.name,""),e.R7$(),e.Y8G("ngIf",n.required),e.R7$(),e.Y8G("ngIf",t.typeName===o.DataFieldTypeEnum.TEXT||t.typeName===o.DataFieldTypeEnum.NOTE),e.R7$(),e.Y8G("ngIf",t.typeName===o.DataFieldTypeEnum.INTEGER),e.R7$(),e.Y8G("ngIf",t.typeName===o.DataFieldTypeEnum.DECI
1MAL),e.R7$(),e.Y8G("ngIf",t.typeName===o.DataFieldTypeEnum.BOOLEAN),e.R7$(),e.Y8G("ngIf",t.typeName===o.DataFieldTypeEnum.DATE),e.R7$(),e.Y8G("ngIf",t.typeName===o.DataFieldTypeEnum.SELECTOR)}}function nE(i,a){if(1&i&&(e.qex(0),e.DNE(1,tE,11,8,"ng-container",2),e.bVm()),2&i){const t=a.$implicit,n=e.XpG(5);e.R7$(),e.Y8G("ngIf",n.getSurfacedDataField(t))}}function iE(i,a){if(1&i&&(e.j41(0,"div",62),e.DNE(1,nE,2,1,"ng-container",63),e.k0s()),2&i){const t=e.XpG(4);e.R7$(),e.Y8G("ngForOf",t.widget.surfacedFields)}}function oE(i,a){1&i&&e.nrm(0,"i",82)}function rE(i,a){1&i&&e.nrm(0,"i",54)}function aE(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",80),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(2);return e.Njj(r.onSaveFields(o))}),e.DNE(1,oE,1,0,"i",81)(2,rE,1,0,"i",52),e.EFF(3," Save Fields "),e.k0s()}if(2&i){const t=e.XpG(2).$implicit;e.Y8G("disabled",t.savingFields),e.R7$(),e.Y8G("ngIf",!t.savingFields),e.R7$(),e.Y8G("ngIf",t.savingFields)}}function sE(i,a){1&i&&e.nrm(0,"i",84)}function lE(i,a){1&i&&e.nrm(0,"i",54)}function dE(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",49),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(2);return e.Njj(r.onMoveToNextStage(o))}),e.DNE(1,sE,1,0,"i",83)(2,lE,1,0,"i",52),e.EFF(3," Next Stage "),e.k0s()}if(2&i){const t=e.XpG(2).$implicit;e.Y8G("disabled",t.movingStage),e.R7$(),e.Y8G("ngIf",!t.movingStage),e.R7$(),e.Y8G("ngIf",t.movingStage)}}function cE(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",55),e.DNE(1,iE,2,1,"div",56),e.j41(2,"div",57),e.DNE(3,aE,4,3,"button",58)(4,dE,4,3,"button",59),e.j41(5,"button",60),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(2);return e.Njj(r.onRemoveTimer(o))}),e.nrm(6,"i",61),e.k0s()()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(),e.Y8G("ngIf",n.widget.surfacedFields.length>0),e.R7$(2),e.Y8G("ngIf",n.widget.surfacedFields.length>0),e.R7$(),e.Y8G("ngIf",t.nextStageAvailable)}}function pE(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",33)(1,"div",34),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2);return e.Njj(!o.stopping&&r.onToggleExpand(o))}),e.nrm(2,"i",35),e.j41(3,"span",36),e.EFF(4),e.k0s(),e.DNE(5,UT,2,3,"span",37),e.j41(6,"span",38),e.EFF(7),e.k0s(),e.j41(8,"span",39),e.EFF(9),e.k0s(),e.DNE(10,YT,2,0,"button",40),e.k0s(),e.DNE(11,WT,9,6,"div",41)(12,cE,7,3,"div",42),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(2);e.AVh("ttw-timer-expanded",t.expanded)("ttw-timer-stopping",t.stopping),e.R7$(2),e.AVh("mdi-chevron-right",!t.expanded)("mdi-chevron-down",t.expanded),e.R7$(),e.Y8G("title",t.item.title),e.R7$(),e.JRh(t.item.title),e.R7$(),e.Y8G("ngIf",t.stage),e.R7$(),e.AVh("ttw-elapsed-active",!t.stopping),e.R7$(),e.SpI(" ",t.elapsedDisplay," "),e.R7$(),e.Y8G("title",t.targetUser.email),e.R7$(),e.SpI(" ",n.getUserDisplayName(t.targetUser)," "),e.R7$(),e.Y8G("ngIf",!t.stopping),e.R7$(),e.Y8G("ngIf",t.stopping),e.R7$(),e.Y8G("ngIf",t.expanded&&!t.stopping)}}function uE(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",7)(2,"span",8),e.nrm(3,"i",9),e.j41(4,"input",10),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.searchQuery,o)||(r.searchQuery=o),e.Njj(o)}),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onSearch(o))}),e.k0s(),e.DNE(5,PT,1,0,"i",11),e.k0s(),e.j41(6,"p-dropdown",12),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedUser,o)||(r.selectedUser=o),e.Njj(o)}),e.DNE(7,GT,1,1,"ng-template",13)(8,AT,2,1,"ng-template",14),e.k0s(),e.j41(9,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onAddTimer())}),e.nrm(10,"i",16),e.k0s(),e.j41(11,"p-dropdown",17),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedRole,o)||(r.selectedRole=o),e.Njj(o)}),e.DNE(12,LT,2,2,"ng-template",14),e.k0s(),e.j41(13,"button",18),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onAddTimersByRole())}),e.nrm(14,"i",19),e.k0s(),e.DNE(15,VT,2,1,"div",20),e.k0s(),e.j41(16,"div",21),e.DNE(17,$T,3,0,"div",22)(18,pE,13,19,"div",23),e.k0s(),e.bVm()}if(2&i){const t=e.XpG();e.R7$(4),e.R50("ngModel",t.searchQuery),e.R7$(),e.Y8G("ngIf",t.searchLoading),e.R7$(),e.Y8G("options",t.users),e.R50("ngModel",t.selectedUser),e.Y8G("filter",!0),e.R7$(3),e.Y8G("disabled",!t.selectedItem||!t.selectedUser),e.R7$(2),e.Y8G("options",t.roles),e.R50("ngModel",t.selectedRole),e.Y8G("filter",!0),e.R7$(2),e.Y8G("disabled",!t.selectedItem||!t.selectedRole),e.R7$(2),e.Y8G("ngIf",t.searchResults.length>0),e.R7$(2),e.Y8G("ngIf",0===t.activeTimers.length),e.R7$(),e.Y8G("ngForOf",t.activeTimers)}}let _E=(()=>{class i{constructor(t,n,o,r,s,c,u){this._authService=t,this._elementsService=n,this._instanceDataService=o,this._itemsService=r,this._timeTrackingService=s,this._usersService=c,this._roleService=u,this.element=null,this.loadError=!1,this.searchQuery="",this.searchResults=[],this.searchLoading=!1,this.selectedItem=null,this.roles=[],this.selectedRole=null,this.activeTimers=[],this.users=[],this.usersLoading=!1,this.selectedUser=null,this.DataFieldTypeEnum=ve.en,this._destroyed$=new ue.B7,this._searchSubject=ne
1w ue.B7}ngOnInit(){this.widget?.elementId&&(this._elementsService.getById(this.widget.elementId).pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.element=t},error:()=>{this.loadError=!0}}),this.usersLoading=!0,this._usersService.getAll().pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>{this.usersLoading=!1})).subscribe({next:t=>{this.users=t;const n=this._authService.getCurrentUser()?.email;this.selectedUser=t.find(o=>o.email===n)??t[0]??null}}),this._roleService.getAll(),this._roleService.entities$.pipe((0,L.Q)(this._destroyed$)).subscribe(t=>{this.roles=t??[]}),this._searchSubject.pipe((0,no.B)(300),(0,L.Q)(this._destroyed$)).subscribe(t=>this._doSearch(t)))}ngOnDestroy(){this.activeTimers.forEach(t=>t.timerSub?.unsubscribe()),this._destroyed$.next(),this._destroyed$.complete()}get isUnconfigured(){return!this.widget?.elementId}onSearch(t){this.selectedItem=null,this.searchLoading=!0,this._searchSubject.next(t)}onItemSelected(t){this.selectedItem=t,this.searchQuery=t.title,this.searchResults=[]}onAddTimer(){if
1(!this.selectedItem||!this.selectedUser)return;if(this.activeTimers.some(r=>r.item.itemGuid===this.selectedItem.itemGuid&&r.targetUser.email===this.selectedUser.email))return this.selectedItem=null,void(this.searchQuery="");const n=this.selectedItem.itemGuid,o=this.selectedUser;this.selectedItem=null,this.searchQuery="",this._instanceDataService.getById(n).pipe((0,L.Q)(this._destroyed$)).subscribe({next:r=>{r.itemGuid=n,this._startTimerForUser(r,o)},error:()=>{this.loadError=!0}})}onAddTimersByRole(){if(!this.selectedItem||!this.selectedRole)return;const t=this.selectedItem.itemGuid,n=(this.selectedRole.users??[]).filter(o=>!!o.email).map(o=>this.users.find(r=>r.email===o.email)??o);this.selectedItem=null,this.searchQuery="",this.selectedRole=null,n.length&&this._instanceDataService.getById(t).pipe((0,L.Q)(this._destroyed$)).subscribe({next:o=>{o.itemGuid=t;for(const r of n)this.activeTimers.some(c=>c.item.itemGuid===t&&c.targetUser.email===r.email)||this._startTimerForUser(o,r)},error:()=>{this.loadError=!0}})}_startTimerForUser(t,n){const o=this.element?.stages?.find(g=>g.id===t.currentStageId)??null,r=o?(0,ud.c9)(t.currentStageId,this.element):null,s={},c={};for(const g of this.widget.surfacedFields){const b=t.fields?.find(D=>D.dataFieldId===g.dataFieldId);s[g.dataFieldId]=b?.value??null;const k=this.element?.dataFields?.find(D=>D.id===g.dataFieldId);k?.typeName===ve.en.SELECTOR&&k.selectorOptions?.length&&(c[g.dataFieldId]=k.selectorOptions.map(D=>({label:D.description,value:D.description})))}const u={item:t,stage:o,targetUser:n,startTime:new Date,elapsedSeconds:0,elapsedDisplay:"00:00:00",nextStageAvailable:null!==r,expanded:!1,stopping:!1,pendingNote:"",confirmingStop:!1,fieldValues:s,selectorOptionsMap:c,savingFields:!1,movingStage:!1,timerSub:null};this._startTimerInterval(u),this.activeTimers.push(u)}onToggleExpand(t){const n=!t.expanded;this.activeTimers.forEach(o=>{o.expanded=!1}),t.expanded=n}onStopTimer(t){t.stopping=!0}onCancelStop(t){t.stopping=!1,t.pendingNote=""}onConfirmStop(t){if(t.confirmingStop)return;t.confirmingStop=!0,t.timerSub?.unsubscribe();const n=new Date,o={itemId:t.item.itemGuid,stageId:t.stage?.id??0,email:t.targetUser.email,startTime:t.startTime.toISOString(),endTime:n.toISOString(),notes:t.pendingNote||void 0};this._timeTrackingService.manualTimeLogCreation(o).pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>{this.activeTimers=this.activeTimers.filter(r=>r!==t)},error:()=>{t.confirmingStop=!1,t.stopping=!1,this._startTimerInterval(t)}})}onRemoveTimer(t){t.timerSub?.unsubscribe(),this.activeTimers=this.activeTimers.filter(n=>n!==t)}onSaveFields(t){if(!t.item.itemGuid||t.savingFields)return;t.savingFields=!0;const n=this.widget.surfacedFields.map(r=>this._elementsService.updateInstanceField(this.widget.elementId,t.item.itemGuid,r.dataFieldId,t.fieldValues[r.dataFieldId]));if(0===n.length)return void(t.savingFields=!1);let o=0;n.forEach(r=>{r.pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>{o++,o===n.length&&(t.savingFields=!1)},error:()=>{t.savingFields=!1}})})}onMoveToNextStage(t){if(!t.item.itemGuid||!this.element||t.movingStage)return;const n=(0,ud.c9)(t.item.currentStageId,this.element);n&&(t.movingStage=!0,this._instanceDataService.update({id:t.item.itemGuid,changes:{elementId:this.widget.elementId,currentStageId:n.id}}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>{t.movingStage=!1})).subscribe({next:o=>{t.item={...t.item,currentStageId:o.currentStageId},t.stage=this.element.stages?.find(s=>s.id===o.currentStageId)??null;const r=(0,ud.c9)(o.currentStageId,this.element);t.nextStageAvailable=null!==r}}))}onRetryLoad(){this.loadError=!1,this.ngOnInit()}getSurfacedDataField(t){return this.element?.dataFields?.find(n=>n.id===t.dataFieldId)??null}getUserDisplayName(t){return`${t.firstName} ${t.lastName}`.trim()||t.email||""}_doSearch(t){if(!t?.trim())return this.searchResults=[],void(this.searchLoading=!1);this._itemsService.ftsSearch(t,1,50).pipe((0,L.Q)(this._destroyed$)).subscribe({next:n=>{this.searchResults=n.items.filter(o=>o.elementId===this.widget.elementId),this.searchLoading=!1},error:()=>{this.searchLoading=!1}})}_startTimerInterval(t){t.timerSub=(0,Fe.Y)(1e3).pipe((0,L.Q)(this._destroyed$)).subscribe(()=>{t.elapsedSeconds++,t.elapsedDisplay=this._formatElapsed(t.elapsedSeconds)})}_formatElapsed(t){const n=Math.floor(t/3600),o=Math.floor(t%3600/60),r=t%60;return`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(q.uR),e.rXU(Eu.L),e.rXU(IT.d),e.rXU(yT._),e.rXU(wT.W),e.rXU(DT.g),e.rXU(OT.H))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-time-tracker-widget"]],inputs:{widget:"widget"},decls:4,vars:3,consts:[[1,"ttw-container"],["class","ttw-empty-state",4,"ngIf"],[4,"ngIf"],[1,"ttw-empty-state"],[1,"mdi","mdi-timer-off","ttw-empty-icon"],[1,"mdi","mdi-alert-circle-outline","ttw-empty-icon","ttw-icon-error"],["type","button",1,"button","button_outline",3,"click"],[1,"ttw-search-row"],[1,"p-input-icon-left","ttw-search-wrap"],[1,"pi","pi-search"],["type","text","pInputText","","placeholder","Search for an item...",1,"ttw-search-input",3,"ngModelChange","ngModel"],["class","pi pi-spinner pi-spin ttw-search-spinner",4,"ngIf"],["o
1ptionLabel","fullName","placeholder","For...","filterBy","firstName,lastName,email","styleClass","ttw-user-dropdown","appendTo","body",3,"ngModelChange","options","ngModel","filter"],["pTemplate","selectedItem"],["pTemplate","item"],["type","button","title","Start timer for the selected item",1,"button","button_icon","ttw-add-btn",3,"click","disabled"],[1,"mdi","mdi-plus"],["optionLabel","name","placeholder","Role...","filterBy","name","styleClass","ttw-role-dropdown","appendTo","body",3,"ngModelChange","options","ngModel","filter"],["type","button","title","Start timers for everyone in this role",1,"button","button_icon","ttw-add-role-btn",3,"click","disabled"],[1,"mdi","mdi-account-multiple-plus"],["class","ttw-search-results",4,"ngIf"],[1,"ttw-board"],["class","ttw-board-empty",4,"ngIf"],["class","ttw-timer-row",3,"ttw-timer-expanded","ttw-timer-stopping",4,"ngFor","ngForOf"],[1,"pi","pi-spinner","pi-spin","ttw-search-spinner"],[1,"ttw-search-results"],["class","ttw-search-result-item",3,"click",4,"ngFor","ngForOf"],[1,"ttw-search-result-item",3,"click"],[1,"ttw-result-title"],["class","ttw-result-stage",3,"background",4,"ngIf"],[1,"ttw-result-stage"],[1,"ttw-board-empty"],[1,"mdi","mdi-timer-outline"],[1,"ttw-timer-row"],[1,"ttw-timer-header",3,"click"],[1,"mdi","ttw-chevron"],[1,"ttw-item-name",3,"title"],["class","ttw-stage-badge",3,"background",4,"ngIf"],[1,"ttw-elapsed"],[1,"ttw-user-chip",3,"title"],["type","button","class","button button_icon ttw-stop-btn","title","Stop timer",3,"click",4,"ngIf"],["class","ttw-stop-panel",4,"ngIf"],["class","ttw-timer-body",4,"ngIf"],[1,"ttw-stage-badge"],["type","button","title","Stop timer",1,"button","button_icon","ttw-stop-btn",3,"click"],[1,"mdi","mdi-stop-circle-outline"],[1,"ttw-stop-panel"],["pInputTextarea","","placeholder","What did you work on? (optional)","rows","2",1,"ttw-note-input",3,"ngModelChange","ngModel","autoResize"],[1,"ttw-stop-actions"],["type","button",1,"button","button_outline",3,"click","disabled"],["type","button",1,"button","button_colorDanger",3,"click","disabled"],["class","mdi mdi-stop-circle",4,"ngIf"],["class","pi pi-spinner pi-spin",4,"ngIf"],[1,"mdi","mdi-stop-circle"],[1,"pi","pi-spinner","pi-spin"],[1,"ttw-timer-body"],["class","ttw-fields",4,"ngIf"],[1,"ttw-timer-actions"],["type","button","class","button button_colorPrimary",3,"disabled","click",4,"ngIf"],["type","button","class","button button_outline",3,"disabled","click",4,"ngIf"],["type","button","title","Remove timer without logging",1,"button","button_icon","ttw-remove-btn",3,"click"],[1,"mdi","mdi-close"],[1,"ttw-fields"],[4,"ngFor","ngForOf"],[1,"ttw-field-row"],[1,"ttw-field-label"],["class","ttw-required",4,"ngIf"],["type","text","pInputText","","class","ttw-field-input",3,"ngModel","ngModelChange",4,"ngIf"],["styleClass","ttw-field-input",3,"ngModel","useGrouping","ngModelChange",4,"ngIf"],["styleClass","ttw-field-input",3,"ngModel","minFractionDigits","ngModelChange",4,"ngIf"],[3,"ngModel","binary","ngModelChange",4,"ngIf"],["styleClass","ttw-field-input","appendTo","body",3,"ngModel","ngModelChange",4,"ngIf"],["optionLabel","label","optionValue","value","styleClass","ttw-field-input","appendTo","body",3,"ngModel","options","ngModelChange",4,"ngIf"],[1,"ttw-required"],["type","text","pInputText","",1,"ttw-field-input",3,"ngModelChange","ngModel"],["styleClass","ttw-field-input",3,"ngModelChange","ngModel","useGrouping"],["styleClass","ttw-field-input",3,"ngModelChange","ngModel","minFractionDigits"],[3,"ngModelChange","ngModel","binary"],["styleClass","ttw-field-input","appendTo","body",3,"ngModelChange","ngModel"],["optionLabel","label","optionValue","value","styleClass","ttw-field-input","appendTo","body",3,"ngModelChange","ngModel","options"],["type","button",1,"button","button_colorPrimary",3,"click","disabled"],["class","mdi mdi-content-save",4,"ngIf"],[1,"mdi","mdi-content-save"],["class","mdi mdi-arrow-right",4,"ngIf"],[1,"mdi","mdi-arrow-right"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.DNE(1,MT,4,0,"div",1)(2,FT,6,0,"div",1)(3,uE,19,13,"ng-container",2),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngIf",o.isUnconfigured),e.R7$(),e.Y8G("ngIf",!o.isUnconfigured&&o.loadError),e.R7$(),e.Y8G("ngIf",!o.isUnconfigured&&!o.loadError))},dependencies:[M.Sq,M.bT,R.me,R.BC,R.vS,ke.Ei,ui.Vv,ut.Sc,Le.ms,Io.YI,_e.S,mt.Z],styles:[".ttw-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;height:100%;padding:8px;overflow-y:auto}.ttw-empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;height:100%;color:var(--text-color-secondary, #6c757d);text-align:center;padding:16px}.ttw-empty-icon[_ngcontent-%COMP%]{font-size:2rem}.ttw-empty-icon.ttw-icon-error[_ngcontent-%COMP%]{color:var(--red-500, #ef4444)}.ttw-search-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;position:relative}.ttw-search-wrap[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center}.ttw-search-wrap[_ngcontent-%COMP%]   .ttw-search-input[_ngcontent-%COMP%]{width:100%}.ttw-search-wrap[_ngcontent-%COMP%]   .ttw-search-spinner[_ngcontent-%COMP%]{position:absolute;right:8px}.ttw-user-dropdown[_ngcontent-%COMP%], .ttw-role-dropdown[_ngcontent-%COMP%]{min-width:160px;
1max-width:200px}.ttw-add-btn[_ngcontent-%COMP%], .ttw-add-role-btn[_ngcontent-%COMP%]{flex-shrink:0}.ttw-add-btn[_ngcontent-%COMP%]:disabled, .ttw-add-role-btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ttw-search-results[_ngcontent-%COMP%]{position:absolute;z-index:100;left:0;right:0;top:calc(100% + 4px);background:var(--surface-overlay, #fff);border:1px solid var(--surface-border, #dee2e6);border-radius:4px;box-shadow:0 4px 12px #0000001f;max-height:200px;overflow-y:auto}.ttw-search-result-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;cursor:pointer;gap:8px}.ttw-search-result-item[_ngcontent-%COMP%]:hover{background:var(--surface-hover, #f8f9fa)}.ttw-result-title[_ngcontent-%COMP%]{font-size:.875rem;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ttw-result-stage[_ngcontent-%COMP%]{font-size:.75rem;padding:2px 6px;border-radius:10px;color:#fff;white-space:nowrap}.ttw-board[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px;flex:1;overflow-y:auto}.ttw-board-empty[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--text-color-secondary, #6c757d);font-size:.875rem;padding:16px;justify-content:center}.ttw-board-empty[_ngcontent-%COMP%]   .mdi[_ngcontent-%COMP%]{font-size:1.25rem}.ttw-timer-row[_ngcontent-%COMP%]{border:1px solid var(--surface-border, #dee2e6);border-radius:6px;overflow:hidden;background:var(--surface-card, #fff);transition:border-color .15s}.ttw-timer-row.ttw-timer-expanded[_ngcontent-%COMP%]{border-color:var(--primary-color, #3b82f6)}.ttw-timer-row.ttw-timer-stopping[_ngcontent-%COMP%]{border-color:var(--red-400, #f87171);background:var(--red-50, #fef2f2)}.ttw-timer-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px 10px;cursor:pointer;-webkit-user-select:none;user-select:none}.ttw-timer-header[_ngcontent-%COMP%]:hover{background:var(--surface-hover, #f8f9fa)}.ttw-chevron[_ngcontent-%COMP%]{font-size:1rem;color:var(--text-color-secondary, #6c757d);flex-shrink:0}.ttw-item-name[_ngcontent-%COMP%]{flex:1;font-size:.875rem;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ttw-stage-badge[_ngcontent-%COMP%]{font-size:.7rem;padding:2px 7px;border-radius:10px;color:#fff;white-space:nowrap;flex-shrink:0}.ttw-elapsed[_ngcontent-%COMP%]{font-family:monospace;font-size:.9rem;font-weight:600;color:var(--text-color-secondary, #6c757d);letter-spacing:.5px;flex-shrink:0}.ttw-elapsed.ttw-elapsed-active[_ngcontent-%COMP%]{color:var(--green-600, #16a34a)}.ttw-user-chip[_ngcontent-%COMP%]{font-size:.75rem;padding:2px 8px;border-radius:12px;background:var(--surface-200, #e9ecef);color:var(--text-color-secondary, #6c757d);white-space:nowrap;max-width:120px;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}.ttw-stop-btn[_ngcontent-%COMP%]{flex-shrink:0;color:var(--red-500, #ef4444)}.ttw-stop-btn[_ngcontent-%COMP%]:hover{background:var(--red-50, #fef2f2)}.ttw-stop-panel[_ngcontent-%COMP%]{padding:8px 12px 10px;display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--red-200, #fecaca)}.ttw-note-input[_ngcontent-%COMP%]{width:100%;resize:vertical;font-size:.875rem}.ttw-stop-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;justify-content:flex-end}.ttw-timer-body[_ngcontent-%COMP%]{padding:8px 12px 10px;border-top:1px solid var(--surface-border, #dee2e6);display:flex;flex-direction:column;gap:8px}.ttw-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px}.ttw-field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.ttw-field-label[_ngcontent-%COMP%]{min-width:100px;font-size:.8rem;color:var(--text-color-secondary, #6c757d);text-align:right;flex-shrink:0}.ttw-required[_ngcontent-%COMP%]{color:var(--red-500, #ef4444);margin-left:2px}.ttw-field-input[_ngcontent-%COMP%]{flex:1}.ttw-timer-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding-top:4px;border-top:1px solid var(--surface-border, #dee2e6);flex-wrap:wrap}.ttw-remove-btn[_ngcontent-%COMP%]{margin-left:auto;color:var(--text-color-secondary, #6c757d)}"]})}}return i})();const mE=["pdfContent"],Su=()=>[];function gE(i,a){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.JRh(t.report.workflowTypeName)}}function hE(i,a){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.SpI("By ",t.report.ownerName,"")}}function fE(i,a){if(1&i&&(e.j41(0,"div",24)(1,"h2"),e.EFF(2),e.k0s(),e.j41(3,"span",25),e.DNE(4,gE,2,1,"span",26)(5,hE,2,1,"span",26),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.JRh(t.report.name),e.R7$(2),e.Y8G("ngIf",t.report.workflowTypeName),e.R7$(),e.Y8G("ngIf",t.report.ownerName)}}function CE(i,a){if(1&i&&(e.j41(0,"span",27)(1,"strong"),e.EFF(2),e.k0s(),e.EFF(3," widget(s) "),e.k0s()),2&i){const t=e.XpG();e.R7$(2),e.JRh(t.dashboardConfig.widgets.length)}}function vE(i,a){1&i&&e.nrm(0,"i",28)}function bE(i,a){1&i&&e.nrm(0,"i",29)}function TE(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",30),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onEdit())}),e.nrm(1,"i",31),e.k0s()}}function EE(i,a){1&i&&e.nrm(0,"i",28)}function SE(i,a){1&i&&e.nrm(0,"i",34)}function kE(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",32),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onExportAllExcel())}),e.DNE(1,EE,1,0,"i",10)(2,SE,1,0,"i",33),e.k0s()}if(2&i){const t=e.XpG();
1e.Y8G("disabled",!t.hasExportableData||t.exportAllLoading),e.R7$(),e.Y8G("ngIf",t.exportAllLoading),e.R7$(),e.Y8G("ngIf",!t.exportAllLoading)}}function RE(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",32),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onExportAllExcel())}),e.nrm(1,"i",34),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("disabled",!t.hasExportableData||t.exportAllLoading)}}function IE(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",35),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onExportGanttExcel())}),e.nrm(1,"i",34),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("disabled",t.exporting)}}function yE(i,a){1&i&&e.nrm(0,"i",28)}function wE(i,a){1&i&&e.nrm(0,"i",38)}function DE(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",36),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onExportPdf())}),e.DNE(1,yE,1,0,"i",10)(2,wE,1,0,"i",37),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("disabled",t.exporting),e.R7$(),e.Y8G("ngIf",t.exporting),e.R7$(),e.Y8G("ngIf",!t.exporting)}}function OE(i,a){1&i&&(e.j41(0,"div",39),e.nrm(1,"kendo-loader",40),e.j41(2,"span"),e.EFF(3,"Loading report..."),e.k0s()())}function xE(i,a){if(1&i&&(e.j41(0,"span",55),e.nrm(1,"i",56),e.EFF(2),e.k0s()),2&i){const t=e.XpG(4);e.R7$(2),e.SpI(" ",t.getStandardDateLabel()," ")}}function ME(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",49)(2,"label"),e.EFF(3,"Date From"),e.k0s(),e.j41(4,"kendo-datepicker",50),e.mxI("valueChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.dateFrom,o)||(r.dateFrom=o),e.Njj(o)}),e.bIt("valueChange",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onDateRangeChange())}),e.k0s()(),e.j41(5,"div",49)(6,"label"),e.EFF(7,"Date To"),e.k0s(),e.j41(8,"kendo-datepicker",50),e.mxI("valueChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.dateTo,o)||(r.dateTo=o),e.Njj(o)}),e.bIt("valueChange",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onDateRangeChange())}),e.k0s()(),e.j41(9,"div",51),e.DNE(10,xE,3,1,"span",52),e.j41(11,"span",53),e.nrm(12,"i",54),e.EFF(13),e.k0s()(),e.bVm()}if(2&i){const t=e.XpG(3);e.R7$(),e.AVh("disabled-field",t.useStandardDateRange),e.R7$(3),e.R50("value",t.dateFrom),e.Y8G("format","MM/dd/yyyy")("disabled",t.useStandardDateRange),e.R7$(),e.AVh("disabled-field",t.useStandardDateRange),e.R7$(3),e.R50("value",t.dateTo),e.Y8G("format","MM/dd/yyyy")("disabled",t.useStandardDateRange),e.R7$(2),e.Y8G("ngIf",t.useStandardDateRange),e.R7$(3),e.SpI(" ",t.dateFieldName," ")}}function FE(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-dropdownlist",62),e.bIt("valueChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterChange(r.id,o))})("filterChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterFilterChange(r.id,o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(4);e.Y8G("data",n.parameterDisplayData[t.id]||e.lJ4(4,Su))("value",n.parameterValues.get(t.id))("defaultItem","All")("filterable",!0)}}function PE(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-multiselect",63),e.bIt("valueChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterMultiChange(r.id,o))})("filterChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterFilterChange(r.id,o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(4);e.Y8G("data",n.parameterDisplayData[t.id]||e.lJ4(5,Su))("value",n.getParameterMultiValues(t.id))("filterable",!0)("tagMapper",n.summaryTagMapper)("placeholder","All")}}function NE(i,a){if(1&i){const t=e.RV6();e.j41(0,"input",64),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterChange(r.id,o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(4);e.Y8G("ngModel",n.parameterValues.get(t.id))}}function GE(i,a){if(1&i&&(e.j41(0,"div",49)(1,"label"),e.EFF(2),e.k0s(),e.DNE(3,FE,1,5,"kendo-dropdownlist",59)(4,PE,1,6,"kendo-multiselect",60)(5,NE,1,1,"input",61),e.k0s()),2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.name),e.R7$(),e.Y8G("ngIf","dropdown"===t.parameterType),e.R7$(),e.Y8G("ngIf","multi-select"===t.parameterType),e.R7$(),e.Y8G("ngIf","text"===t.parameterType)}}function AE(i,a){if(1&i&&(e.qex(0),e.nrm(1,"span",57),e.DNE(2,GE,6,4,"div",58),e.bVm()),2&i){const t=e.XpG(3);e.R7$(2),e.Y8G("ngForOf",t.activeParameters)}}function LE(i,a){if(1&i&&(e.j41(0,"span",68),e.EFF(1),e.k0s()),2&i){const t=e.XpG(4);e.R7$(),e.Lme(" Page ",t.currentPage," of ",t.totalPages," ")}}
1function BE(i,a){if(1&i&&(e.j41(0,"div",65)(1,"span",66)(2,"strong"),e.EFF(3),e.nI1(4,"number"),e.k0s(),e.EFF(5," records "),e.k0s(),e.DNE(6,LE,2,2,"span",67),e.k0s()),2&i){const t=e.XpG(3);e.R7$(3),e.JRh(e.bMT(4,2,t.totalRecords)),e.R7$(3),e.Y8G("ngIf",t.totalPages>1)}}function jE(i,a){1&i&&e.nrm(0,"i",72)}function VE(i,a){1&i&&e.nrm(0,"i",73)}function $E(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",69),e.bIt("click",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onSaveFilters())}),e.DNE(1,jE,1,0,"i",70)(2,VE,1,0,"i",71),e.EFF(3," Save "),e.k0s()}if(2&i){const t=e.XpG(3);e.Y8G("disabled",t.savingFilters),e.R7$(),e.Y8G("ngIf",t.savingFilters),e.R7$(),e.Y8G("ngIf",!t.savingFilters)}}function UE(i,a){if(1&i&&(e.j41(0,"div",45)(1,"div",46),e.DNE(2,ME,14,12,"ng-container",26)(3,AE,3,1,"ng-container",26),e.k0s(),e.DNE(4,BE,7,4,"div",47)(5,$E,4,3,"button",48),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("ngIf",t.visualizationType!==t.VisualizationType.Gantt),e.R7$(),e.Y8G("ngIf",t.activeParameters.length),e.R7$(),e.Y8G("ngIf",t.visualizationType!==t.VisualizationType.Dashboard&&t.visualizationType!==t.VisualizationType.DataGrid&&t.visualizationType!==t.VisualizationType.Calendar),e.R7$(),e.Y8G("ngIf",!(null!=t.report&&t.report.isReadOnly))}}function YE(i,a){if(1&i){const t=e.RV6();e.j41(0,"span",80),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(4);return e.Njj(r.onPivotCellClick(o))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit,n=a.value,o=e.XpG(4);e.R7$(),e.SpI(" ",o.pivotValueFormats.size>0?o.formatPivotValue(n,t):n," ")}}function HE(i,a){if(1&i&&(e.j41(0,"kendo-pivotgrid",78),e.DNE(1,YE,2,1,"ng-template",79),e.k0s()),2&i){const t=e.XpG(3);e.Y8G("kendoPivotLocalBinding",t.pivotData)("dimensions",t.pivotDimensions)("measures",t.pivotMeasures)("rowAxes",t.pivotRowAxes)("columnAxes",t.pivotColumnAxes)("measureAxes",t.pivotMeasureAxes)("columnHeadersWidth",t.columnHeadersWidth)("configurator",!0)}}function XE(i,a){1&i&&(e.j41(0,"div",81),e.nrm(1,"kendo-loader",82),e.k0s())}function WE(i,a){1&i&&(e.j41(0,"div",83),e.nrm(1,"i",84),e.j41(2,"p"),e.EFF(3,"No data found for the selected criteria"),e.k0s()())}function zE(i,a){if(1&i&&(e.qex(0),e.j41(1,"div",74),e.DNE(2,HE,2,8,"kendo-pivotgrid",75)(3,XE,2,0,"div",76)(4,WE,4,0,"div",77),e.k0s(),e.bVm()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("ngIf",t.pivotData.length>0),e.R7$(),e.Y8G("ngIf",t.executing),e.R7$(),e.Y8G("ngIf",0===t.pivotData.length&&!t.executing)}}function KE(i,a){1&i&&(e.j41(0,"div",88),e.nrm(1,"kendo-loader",82),e.j41(2,"span"),e.EFF(3,"Loading calendar..."),e.k0s()())}function JE(i,a){1&i&&(e.j41(0,"div",83),e.nrm(1,"i",89),e.j41(2,"p"),e.EFF(3,"No events found for the selected criteria"),e.k0s()())}function qE(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-calendar-report-widget",90),e.bIt("eventClick",function(o){e.eBV(t);const r=e.XpG(3);return e.Njj(r.onCalendarEventClick(o))})("dateChange",function(o){e.eBV(t);const r=e.XpG(3);return e.Njj(r.onCalendarDateChange(o))}),e.k0s()}if(2&i){const t=e.XpG(3);e.Y8G("events",t.calendarEvents)("loading",t.executing)("defaultView",(null==t.calendarConfig?null:t.calendarConfig.defaultView)||"month")("summaryField",null==t.calendarConfig?null:t.calendarConfig.summaryField)("summaryType",null==t.calendarConfig?null:t.calendarConfig.summaryType)("summaryLabel",null==t.calendarConfig?null:t.calendarConfig.summaryLabel)}}function QE(i,a){if(1&i&&(e.qex(0),e.j41(1,"div",85),e.DNE(2,KE,4,0,"div",86)(3,JE,4,0,"div",77)(4,qE,1,6,"cad-calendar-report-widget",87),e.k0s(),e.bVm()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("ngIf",t.executing),e.R7$(),e.Y8G("ngIf",!t.executing&&0===t.calendarEvents.length),e.R7$(),e.Y8G("ngIf",!t.executing&&t.calendarEvents.length>0)}}function ZE(i,a){if(1&i&&(e.qex(0),e.j41(1,"div",91),e.nrm(2,"cad-gantt-viewer",92),e.k0s(),e.bVm()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("report",t.report)("parameterValues",t.ganttParamValues)}}function eS(i,a){1&i&&(e.j41(0,"div",88),e.nrm(1,"kendo-loader",82),e.j41(2,"span"),e.EFF(3,"Loading widgets..."),e.k0s()())}function tS(i,a){1&i&&(e.j41(0,"div",83),e.nrm(1,"i",96),e.j41(2,"p"),e.EFF(3,"This dashboard has no widgets configured"),e.k0s()())}function nS(i,a){if(1&i&&e.nrm(0,"i",105),2&i){const t=e.XpG().$implicit,n=e.XpG(5);e.Y8G("pTooltip",n.getFilterTooltip(t))}}function iS(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-counter-widget",106),e.bIt("drillThrough",function(o){e.eBV(t);const r=e.XpG(6);return e.Njj(r.onCounterDrillThrough(o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(5);e.Y8G("widget",n.asCounterWidget(t))("data",n.getWidgetData(t.id))("loading",n.executing)}}function oS(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-chart-widget",106),e.bIt("drillThrough",function(o){e.eBV(t);const r=e.XpG(6);return e.Njj(r.onChartDrillThrough(o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(5);e.Y8G("widget",n.asChartWidget(t))("data",n.getWidgetData(t.id))("loading",n.executing)}}function rS(i,a){if(1&i){const t=e.RV6();
1e.j41(0,"cad-grid-widget",107),e.bIt("stateChange",function(o){e.eBV(t);const r=e.XpG(6);return e.Njj(r.onGridStateChange(o))})("rowClick",function(o){e.eBV(t);const r=e.XpG(6);return e.Njj(r.onGridRowClick(o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(5);e.Y8G("widget",n.asGridWidget(t))("data",n.getWidgetData(t.id))("loading",n.widgetLoading[t.id]||n.executing)}}function aS(i,a){if(1&i&&e.nrm(0,"cad-time-tracker-widget",108),2&i){const t=e.XpG().$implicit,n=e.XpG(5);e.Y8G("widget",n.asTimeTrackerWidget(t))}}function sS(i,a){if(1&i&&(e.j41(0,"kendo-tilelayout-item",99)(1,"kendo-tilelayout-item-header")(2,"span",100),e.EFF(3),e.DNE(4,nS,1,1,"i",101),e.k0s()(),e.j41(5,"kendo-tilelayout-item-body"),e.DNE(6,iS,1,3,"cad-counter-widget",102)(7,oS,1,3,"cad-chart-widget",102)(8,rS,1,3,"cad-grid-widget",103)(9,aS,1,1,"cad-time-tracker-widget",104),e.k0s()()),2&i){const t=a.$implicit,n=e.XpG(5);e.Y8G("col",t.col+1)("row",t.row+1)("colSpan",t.colSpan)("rowSpan",t.rowSpan),e.R7$(3),e.SpI(" ",t.title," "),e.R7$(),e.Y8G("ngIf",n.hasFilter(t)),e.R7$(2),e.Y8G("ngIf",t.type===n.DashboardWidgetType.Counter),e.R7$(),e.Y8G("ngIf",t.type===n.DashboardWidgetType.BarChart||t.type===n.DashboardWidgetType.LineChart||t.type===n.DashboardWidgetType.PieChart||t.type===n.DashboardWidgetType.DonutChart||t.type===n.DashboardWidgetType.AreaChart||t.type===n.DashboardWidgetType.FunnelChart||t.type===n.DashboardWidgetType.HeatMap||t.type===n.DashboardWidgetType.Sparkline),e.R7$(),e.Y8G("ngIf",t.type===n.DashboardWidgetType.Grid),e.R7$(),e.Y8G("ngIf",t.type===n.DashboardWidgetType.TimeTracker)}}function lS(i,a){if(1&i&&(e.j41(0,"kendo-tilelayout",97),e.DNE(1,sS,10,10,"kendo-tilelayout-item",98),e.k0s()),2&i){const t=e.XpG(4);e.Y8G("columns",t.dashboardConfig.columns||12)("rowHeight",t.dashboardConfig.rowHeight||120)("gap",t.dashboardConfig.gap||16)("resizable",!1)("reorderable",!1),e.R7$(),e.Y8G("ngForOf",t.dashboardConfig.widgets)}}function dS(i,a){if(1&i&&(e.j41(0,"div",94),e.DNE(1,eS,4,0,"div",86)(2,tS,4,0,"div",77)(3,lS,2,6,"kendo-tilelayout",95),e.k0s()),2&i){const t=e.XpG(3);e.R7$(),e.Y8G("ngIf",t.executing),e.R7$(),e.Y8G("ngIf",!t.executing&&0===t.dashboardConfig.widgets.length),e.R7$(),e.Y8G("ngIf",!t.executing&&t.dashboardConfig.widgets.length>0)}}function cS(i,a){if(1&i&&(e.qex(0),e.DNE(1,dS,4,3,"div",93),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.dashboardConfig)}}function pS(i,a){1&i&&(e.j41(0,"div",88),e.nrm(1,"kendo-loader",82),e.j41(2,"span"),e.EFF(3,"Loading data..."),e.k0s()())}function uS(i,a){1&i&&(e.j41(0,"div",83),e.nrm(1,"i",112),e.j41(2,"p"),e.EFF(3,"No data found for the selected criteria"),e.k0s()())}function _S(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-grid-widget",113),e.bIt("stateChange",function(o){e.eBV(t);const r=e.XpG(4);return e.Njj(r.onGridStateChange(o))})("rowClick",function(o){e.eBV(t);const r=e.XpG(4);return e.Njj(r.onGridRowClick(o))}),e.k0s()}if(2&i){const t=e.XpG(4);e.Y8G("hidden",t.executing)("widget",t.asGridWidget(t.dashboardConfig.widgets[0]))("data",t.getWidgetData(t.dashboardConfig.widgets[0].id))("loading",t.widgetLoading[null==t.dashboardConfig.widgets[0]?null:t.dashboardConfig.widgets[0].id]||t.executing)}}function mS(i,a){if(1&i&&(e.j41(0,"div",110),e.DNE(1,pS,4,0,"div",86)(2,uS,4,0,"div",77)(3,_S,1,4,"cad-grid-widget",111),e.k0s()),2&i){let t,n;const o=e.XpG(3);e.R7$(),e.Y8G("ngIf",o.executing),e.R7$(),e.Y8G("ngIf",!(o.executing||o.dashboardConfig.widgets.length&&null!=(t=o.getWidgetData(null==o.dashboardConfig.widgets[0]?null:o.dashboardConfig.widgets[0].id))&&null!=t.gridData&&t.gridData.length)),e.R7$(),e.Y8G("ngIf",o.dashboardConfig.widgets.length>0&&(null==(n=o.getWidgetData(null==o.dashboardConfig.widgets[0]?null:o.dashboardConfig.widgets[0].id))||null==n.gridData?null:n.gridData.length))}}function gS(i,a){if(1&i&&(e.qex(0),e.DNE(1,mS,4,3,"div",109),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.dashboardConfig)}}function hS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",114)(1,"button",115),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onPageChange(o.currentPage-1))}),e.nrm(2,"i",116),e.k0s(),e.j41(3,"span",117),e.EFF(4),e.k0s(),e.j41(5,"button",118),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onPageChange(o.currentPage+1))}),e.nrm(6,"i",119),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("disabled",1===t.currentPage),e.R7$(3),e.Lme(" Page ",t.currentPage," of ",t.totalPages," "),e.R7$(),e.Y8G("disabled",t.currentPage===t.totalPages)}}function fS(i,a){if(1&i&&(e.j41(0,"div",41,0),e.DNE(2,UE,6,4,"div",42),e.j41(3,"div",43),e.DNE(4,zE,5,3,"ng-container",26)(5,QE,5,3,"ng-container",26)(6,ZE,3,2,"ng-container",26)(7,cS,2,1,"ng-container",26)(8,gS,2,1,"ng-container",26),e.k0s(),e.DNE(9,hS,7,4,"div",44),e.k0s()),2&i){const t=e.XpG();e.BMQ("data-report-name",null==t.report?null:t.report.name),e.R7$(2),e.Y8G("ngIf",t.visualizationType!==t.VisualizationType.Gantt||t.activeParameters.length>0),e.R7$(2),e.Y8G("ngIf",t.visualizationType===t.VisualizationType.Pivot),e.R7$(),e.Y8G("ngIf",t.visualizationType===t.VisualizationType.Calendar),e.R7$(),e.Y8G("ngIf",t.visualizationType===t.VisualizationType.Gantt),e.R7$(),e.Y8G("ngIf",t.visualizationType===t.VisualizationType.Dashboard),e.R7$(),e.Y8G("ngIf",t.visualizationType===t.VisualizationType.DataGrid),e.R7$(),e.Y8G("ngIf",t.totalPages>1&&t.visualizationType!==t.VisualizationType.Dashboard&&t.visualizationType!==t.VisualizationType.DataGrid&&t.visualizationType!==t.VisualizationType.Calendar&&t.visualizationType!==t.VisualizationType.Gantt)}}function CS(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-share-report-dialog",120),e.bIt("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onShareDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("report",t.report)("visible",t.showShareDialog)}}let vS=(()=>{class i{constructor(t,n,o,r,s,c,u){this._router=t,this._route=n,this._apiService=o,this._messagingService=r,this._drillThroughService=s,this._dialogService=c,this._cdr=u,this._destroyed$=new ue.B7,this.VisualizationType=w.vi,this.reportId=null,this.report=null,this.fieldMetadata=null,this.pivotConfig=null,this.visualizationType=w.vi.Pivot,this.pivotData=[],this.pivotDimensions={},this.pivotMeasures=[],this.pivotRowAxes=[],this.pivotColumnAxes=[],this.pivotMeasureAxes=[],this.pivotValueFormats=new Map,this.columnHeadersWidth=100,this.rowHeadersWidth=null,this.gridData={data:[],total:0},this.gridState={skip:0,take:100,sort:[],filter:null,group:[]},this.dashboardConfig=null,this.widgetDataMap=new Map,this.widgetLoading={},this.DashboardWidgetType=w.v2,this.calendarConfig=null,this.calendarSources=[],this.calendarEvents=[],this._calendarStagesCache=new Map,this._currentSortDescriptors=[],this._currentColumnFilters=[],this._dataSetElementIdCache=new Map,this.parameterValues=new Map,this.parameterOptions=new Map,this.parameterOptionsLoading=new Map,this.parameterDisplayData={},this.currentPage=1,this.pageSize=1e3,this.totalRecords=0,this.totalPages=0,this.loading=!1,this.executing=!1,this.savingFilters=!1,this.showShareDialog=!1,this.exporting=!1,this.exportAllLoading=!1,this.ganttParamValues=[],this.dateFrom=null,this.dateTo=null,this.dateFieldName="Created Date",this._endpointType=null,this.useStandardDateRange=!1,this.standardDateRange=null,this.standardDateOptions=[{label:"Current Week",value:"currentWeek"},{label:"Current Month",value:"currentMonth"},{label:"Current Quarter",value:"currentQuarter"},{label:"Current Year",value:"currentYear"}]}ngOnInit(){this.reportId=this._route.snapshot.params.reportId,this.reportId?this.loadReport():(this._messagingService.error("Report ID is required","Error"),this._router.navigate(["/private/ad-hoc-reports"]))}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}loadReport(){this.reportId&&(this.loading=!0,this._apiService.getReportById(this.reportId).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:t=>{this.report=t,this.visualizationType=t.visualizationType||w.vi.Pivot,this.visualizationType===w.vi.Gantt?(this.report.ganttConfig=this._parseGanttConfig(this.report.dashboardConfiguration),this.report.ganttConfig?.parameters?.length&&this.report.ganttConfig.parameters.forEac
1h(n=>{n.defaultValue&&this.parameterValues.set(n.id,n.defaultValue),("dropdown"===n.parameterType||"multi-select"===n.parameterType)&&this.loadParameterOptions(n)}),this.parseExecutionParams(),this.ganttParamValues=this.getParameterValuesPayload()):this.visualizationType===w.vi.Calendar?(this.parseCalendarConfig(),this.parseExecutionParams(),this.executeCalendarReport()):this.visualizationType===w.vi.Dashboard||this.visualizationType===w.vi.DataGrid?(this.parseDashboardConfig(),this.parseExecutionParams(),this.executeDashboard()):(this.parsePivotConfig(),this.parseExecutionParams(),this.executeReport())},error:t=>{this._messagingService.error("Failed to load report","Error"),console.error("Error loading report:",t)}}))}parsePivotConfig(){this.report?.pivotConfiguration&&(this.pivotConfig=this._apiService.parsePivotConfig(this.report.pivotConfiguration),this.pivotConfig?.columnHeadersWidth&&(this.columnHeadersWidth=this.pivotConfig.columnHeadersWidth),this.pivotConfig?.rowHeadersWidth&&(this.rowHeadersWidth=this.pivotConfig.rowHeadersWidth),this.pivotConfig?.parameters?.length&&this.pivotConfig.parameters.forEach(t=>{t.defaultValue&&this.parameterValues.set(t.id,t.defaultValue),("dropdown"===t.parameterType||"multi-select"===t.parameterType)&&this.loadParameterOptions(t)}))}parseDashboardConfig(){if(this.report?.dashboardConfiguration)try{this.dashboardConfig=JSON.parse(this.report.dashboardConfiguration),this.dashboardConfig?.widgets?.length>0&&this.hasOverlappingWidgets()&&(console.warn("Detected overlapping widgets in saved configuration, recalculating positions"),this.recalculateWidgetPositions()),this.dashboardConfig?.dateFrom&&!this.dateFrom&&(this.dateFrom=new Date(this.dashboardConfig.dateFrom)),this.dashboardConfig?.dateTo&&!this.dateTo&&(this.dateTo=new Date(this.dashboardConfig.dateTo)),this.dashboardConfig?.parameters?.length&&this.dashboardConfig.parameters.forEach(t=>{t.defaultValue&&this.parameterValues.set(t.id,t.defaultValue),("dropdown"===t.parameterType||"multi-select"===t.parameterType)&&this.loadParameterOptions(t)})}catch(t){console.error("Error parsing dashboard configuration:",t)}}_parseGanttConfig(t){if(t)try{return JSON.parse(t)}catch{return}}parseCalendarConfig(){if(this.report?.dashboardConfiguration)try{if(this.calendarConfig=JSON.parse(this.report.dashboardConfiguration),this.calendarConfig?.sources?.length?this.calendarSources=this.calendarConfig.sources:this.calendarConfig?.titleField&&this.report?.workflowTypeId&&(this.calendarSources=[{id:"legacy",workflowTypeId:this.report.workflowTypeId,titleField:this.calendarConfig.titleField,startDateField:this.calendarConfig.startDateField,endDateField:this.calendarConfig.endDateField,dateField:"createdDate"}]),this.calendarSources.length){const t=[...new Set(this.calendarSources.map(n=>n.dateField).filter(Boolean))].map(n=>this.formatFieldLabel(n));t.length&&(this.dateFieldName=t.join(" / "))}this.calendarConfig?.parameters?.length&&this.calendarConfig.parameters.forEach(t=>{t.defaultValue&&this.parameterValues.set(t.id,t.defaultValue),("dropdown"===t.parameterType||"multi-select"===t.parameterType)&&this.loadParameterOptions(t)})}catch(t){console.error("Error parsing calendar configuration:",t)}}executeCalendarReport(){if(!this.reportId||!this.calendarConfig||!this.calendarSources.length)return;this.executing=!0;const t=[...new Set(this.calendarSources.map(s=>s.workflowTypeId))],n={};for(const s of t)this._calendarStagesCache.has(s)||(n[`el_${s}`]=this._apiService.getElementDetail(s).pipe((0,ye.W)(()=>(0,le.of)(null))));const o={};for(const s of this.calendarSources)o[`data_${s.id}`]=this._apiService.getWorkflowData(s.workflowTypeId,this.dateFrom||void 0,this.dateTo||void 0,1,5e3,s.dateField).pipe((0,ye.W)(()=>(0,le.of)(null)));(Object.keys(n).length>0?(0,vt.p)(n):(0,le.of)({})).pipe((0,L.Q)(this._destroyed$)).subscribe({next:s=>{for(const c of t){const u=`el_${c}`;s[u]&&this._calendarStagesCache.set(c,s[u].stages||[])}(0,vt.p)(o).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.executing=!1)).subscribe({next:c=>{const u=[];let g=0;for(const b of this.calendarSources){const k=c[`data_${b.id}`];if(!k?.data)continue;g+=k.pagination?.totalRecords||0;const D=this._calendarStagesCache.get(b.workflowTypeId)||[];let V=(k.data||[]).map(B=>({relativeId:B.relativeId,elementId:B.elementId,createdDate:B.createdDate,modifiedDate:B.modifiedDate,createdBy:B.createdBy,modifiedBy:B.modifiedBy,workflowTypeId:b.workflowTypeId,...B.elementData}));
1b.stageId&&(V=V.filter(B=>Number(B.currentStageId)===Number(b.stageId))),b.parameterMappings?.length&&(V=this.applySourceParameterFilters(V,b));const U=this.transformSourceToCalendarEvents(V,b,D);u.push(...U)}this.totalRecords=g,this.calendarEvents=u},error:c=>{this._messagingService.error("Failed to load calendar data","Error"),console.error("Error executing calendar report:",c)}})},error:()=>{this.executing=!1,this._messagingService.error("Failed to load calendar data","Error")}})}transformSourceToCalendarEvents(t,n,o){const r=n.stageId?o.find(s=>Number(s.id)===Number(n.stageId))?.color||"#09a564":null;return t.filter(s=>s[n.startDateField]).map(s=>{const c=s.currentStageId,u=r||(null!=c?o.find(g=>Number(g.id)===Number(c))?.color:null)||"#09a564";return{id:s.elementId||s.relativeId,title:s[n.titleField]||"Untitled",start:new Date(s[n.startDateField]),end:n.endDateField&&s[n.endDateField]?new Date(s[n.endDateField]):new Date(s[n.startDateField]),isAllDay:!n.endDateField,dataItem:{...s,_color:u,_workflowTypeId:n.workflowTypeId}}})}applySourceParameterFilters(t,n){return n.parameterMappings?.length?t.filter(o=>{for(const r of n.parameterMappings){const s=this.parameterValues.get(r.parameterId);if(!s)continue;const c=o[r.widgetFieldName];if(null==c)return!1;const u=String(c).toLowerCase(),g=s.toLowerCase();if(g.includes(",")){if(!g.split(",").map(k=>k.trim()).includes(u))return!1}else if(u!==g)return!1}return!0}):t}onCalendarEventClick(t){if(t.isMonthView&&t.date)return void this.openCalendarDayDrillThrough(t.date,t.instanceId);const n=this.calendarEvents.find(r=>r.id===t.instanceId),o=n?.dataItem?._workflowTypeId||this.report?.workflowTypeId;!o||!t.instanceId||this._drillThroughService.loadElement(o).subscribe(r=>{this._drillThroughService.openDrillThrough(r,{logic:"and",filters:[{field:"itemGuid",operator:"eq",value:t.instanceId}]},n?.title||"Calendar Event")})}openCalendarDayDrillThrough(t,n){let o;if(n&&(o=this.calendarEvents.find(g=>g.id===n)?.dataItem?._workflowTypeId),o||(o=this.calendarConfig?.sources?.[0]?.workflowTypeId||this.report?.workflowTypeId),!o)return;const r=new Date(t.getFullYear(),t.getMonth(),t.getDate()),s=new Date(r.getFullYear(),r.getMonth(),r.getDate()+1),c=this.calendarEvents.filter(u=>u.start>=r&&u.start<s&&u.dataItem?._workflowTypeId===o).map(u=>u.id).filter(u=>u>0);0!==c.length&&this._drillThroughService.loadElement(o).subscribe(u=>{const g={logic:"or",filters:c.map(k=>({field:"id",operator:"eq",value:k}))},b=r.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"});this._drillThroughService.openDrillThrough(u,g,`${u.name} \u2014 ${b}`)})}onCalendarDateChange(t){this.useStandardDateRange||(this.dateFrom=t.start,this.dateTo=t.end)}hasOverlappingWidgets(){if(!this.dashboardConfig?.widgets)return!1;const t=this.dashboardConfig.widgets;for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++)if(this.widgetsOverlap(t[n],t[o]))return!0;return!1}widgetsOverlap(t,n){return!(t.col+t.colSpan<=n.col||n.col+n.colSpan<=t.col||t.row+t.rowSpan<=n.row||n.row+n.rowSpan<=t.row)}recalculateWidgetPositions(){if(!this.dashboardConfig?.widgets)return;const t=this.dashboardConfig.columns||12,n=[],o=r=>{for(;n.length<=r;)n.push(new Array(t).fill(!1))};o(20),this.dashboardConfig.widgets.forEach(r=>{const s=this.findAvailablePosition(n,r.colSpan,r.rowSpan,t);r.col=s.col,r.row=s.row,o(s.row+r.rowSpan);for(let c=s.row;c<s.row+r.rowSpan;c++)for(let u=s.col;u<s.col+r.colSpan;u++)n[c][u]=!0})}findAvailablePosition(t,n,o,r){const s=c=>{for(;t.length<=c;)t.push(new Array(r).fill(!1))};for(let c=0;c<100;c++){s(c+o);for(let u=0;u<=r-n;u++){let g=!0;for(let b=c;b<c+o&&g;b++)for(let k=u;k<u+n&&g;k++)(b>=t.length||t[b][k])&&(g=!1);if(g)return{col:u,row:c}}}return{col:0,row:t.length}}parseExecutionParams(){if(this.report?.endpointParameters)try{const t=JSON.parse(this.report.endpointParameters);t.standardDateRange?(this.useStandardDateRange=!0,this.standardDateRange=t.standardDateRange,this.applyStandardDateRange()):(t.dateFrom&&(this.dateFrom=new Date(t.dateFrom)),t.dateTo&&(this.dateTo=new Date(t.dateTo))),t.dateField&&(this.dateFieldName=this.formatFieldLabel(t.dateField)),t.endpointType&&(this._endpointType=t.endpointType),t.parameterValues&&Array.isArray(t.parameterValues)&&t.parameterValues.forEac
1h(n=>{n.parameterId&&n.value&&this.parameterValues.set(n.parameterId,n.value)})}catch(t){console.error("Error parsing endpoint parameters:",t)}}buildPivotBindingConfig(){!this.pivotConfig||0===this.pivotData.length||(this.pivotDimensions={},this.pivotConfig.rows.forEach(t=>{this.pivotDimensions[t]={caption:this.getFieldDisplayName(t),displayValue:n=>n[t]?.toString()||"(blank)",sortValue:n=>n}}),this.pivotConfig.columns.forEach(t=>{this.pivotDimensions[t]={caption:this.getFieldDisplayName(t),displayValue:n=>n[t]?.toString()||"(blank)",sortValue:n=>n}}),this.pivotMeasures=this.pivotConfig.values.map(t=>{const n=this.isNumericField(t.field),o="count"===t.aggregate,r=!n&&!o;return{name:t.caption||this.getFieldDisplayName(t.field),value:s=>{const c=s[t.field];if(o||r)return 1;if(null==c||""===c)return 0;const u=Number(c);return isNaN(u)?0:u},aggregate:r?Kn.jg:this.getAggregate(t.aggregate)}}),this.pivotValueFormats.clear(),this.pivotConfig.values.forEach(t=>{const n=t.caption||this.getFieldDisplayName(t.field);(t.formatCurrency||t.formatCommas)&&this.pivotValueFormats.set(n,{formatCurrency:t.formatCurrency,formatCommas:t.formatCommas})}),this.pivotRowAxes=this.pivotConfig.rows.map(t=>({name:[t]})),this.pivotColumnAxes=this.pivotConfig.columns.map(t=>({name:[t]})),this.pivotMeasureAxes=this.pivotMeasures.map(t=>({name:Array.isArray(t.name)?t.name:[t.name]})))}getAggregate(t){switch(t){case"sum":return Kn.bi;case"count":default:return Kn.jg;case"min":return Kn.Ae;case"max":return Kn.A7;case"average":return Kn.Br}}formatPivotValue(t,n){if(null==t||""===t)return"";let o;const r=n?.columnTuple?.members;if(r?.length){const u=r.find(g=>"[Measures].[MeasuresLevel]"===g.levelName)?.caption||r[r.length-1]?.caption;u&&(o=this.pivotValueFormats.get(u))}if(!o&&1===this.pivotValueFormats.size&&(o=this.pivotValueFormats.values().next().value),!o)return t?.toString()??"";const s=parseFloat(t);return isNaN(s)?t?.toString()??"":o.formatCurrency?s.toLocaleString("en-US",{style:"currency",currency:"USD"}):o.formatCommas?s.toLocaleString("en-US"):t?.toString()??""}formatFieldLabel(t){return t.replace(/([A-Z])/g," $1").replace(/^./,n=>n.toUpperCase()).trim()}getFieldDisplayName(t){if(!this.fieldMetadata)return t;const n=this.fieldMetadata.commonFields?.find(r=>r.name===t);if(n)return n.displayName;const o=this.fieldMetadata.elementFields?.find(r=>r.name===t);return o?o.displayName:t}getFieldType(t){if(!this.fieldMetadata)return"string";const n=this.fieldMetadata.commonFields?.find(r=>r.name===t);if(n)return n.type;const o=this.fieldMetadata.elementFields?.find(r=>r.name===t);return o?o.type:"string"}isNumericField(t){return"number"===this.getFieldType(t)}buildGridConfig(){if(!this.pivotConfig)return;const t=this.pivotConfig.rows.map(n=>({field:n,aggregates:this.pivotConfig.values.map(o=>({field:o.field,aggregate:o.aggregate}))}));this.gridState.group=t}applyPivotParameterFilters(t){if(!this.pivotConfig?.parameters?.length)return t;let n=t;return this.pivotConfig.parameters.forEach(o=>{const r=this.parameterValues.get(o.id);if(r&&o.fieldName)if("multi-select"===o.parameterType){const s=r.split(",").map(c=>c.trim().toLowerCase()).filter(c=>c);s.length>0&&(n=n.filter(c=>{const u=String(c[o.fieldName]||"").toLowerCase();return s.includes(u)}))}else{const s=r.toLowerCase();n=n.filter(c=>{const u=String(c[o.fieldName]||"").toLowerCase();return"text"===o.parameterType?u.includes(s):u===s})}}),n}get activeParameters(){return this.calendarConfig?.parameters||this.dashboardConfig?.parameters||this.pivotConfig?.parameters||this.report?.ganttConfig?.parameters||[]}loadParameterOptions(t){this.parameterOptionsLoading.set(t.id,!0),(t.workflowTypeId===w.dg?this._apiService.getTenantUserNames():this._apiService.getDistinctFieldValues(t.workflowTypeId,t.fieldName)).pipe((0,L.Q)(this._destroyed$)).subscribe({next:o=>{this.parameterOptions.set(t.id,o),this.parameterDisplayData[t.id]=o.slice(),this.parameterOptionsLoading.set(t.id,!1)},error:()=>{this.parameterOptionsLoading.set(t.id,!1)}})}onParameterChange(t,n){n&&"All"!==n?this.parameterValues.set(t,n):this.parameterValues.delete(t)}onParameterFilterChange(t,n){const o=this.parameterOptions.get(t)||[];if(n){const r=n.toLowerCase();this.parameterDisplayData[t]=o.filter(s=>s.toLowerCase().includes(r))}else this.parameterDisplayData[t]=o.slice();this._cdr.detectChanges()}getParameterMultiValues(t){const n=this.parameterValues.get(t);return n?n.split(",").map(o=>o.trim()).filter(o=>o):[]}onParameterMultiChange(t,n){n?this.parameterValues.set(t,n.join(",")):this.parameterValues.delete(t)}summaryTagMapper(t){return t.length>1?[t]:t}getParameterValuesPayload(){return Array.from(this.parameterValues.entries()).filter(([t,n])=>n).map(([t,n])=>({parameterId:t,value:n}))}get hasDates(){return!!this.dateFrom&&!!this.dateTo}executeDashboard(){if(!this.reportId||!this.dashboardConfig||!this.hasDates)return;this.executing=!0;const t=this.getParameterValuesPayload();this._apiService.executeDashboard(this.reportId,this.dateFrom||void 0,this.dateTo||void 0,t.length>0?t:void 0).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.executing=!1)).subscribe({next:n=>{const o=new Map;
1n.forEach(r=>{o.set(r.widgetId,r)}),this.widgetDataMap=o},error:n=>{this._messagingService.error("Failed to load dashboard data","Error"),console.error("Error executing dashboard:",n)}})}getWidgetData(t){return this.widgetDataMap.get(t)||null}onGridStateChange(t){if(!this.reportId)return;this._currentSortDescriptors=t.sortDescriptors||[],this._currentColumnFilters=t.columnFilters||[],this.persistWidgetPageSize(t.widgetId,t.pageSize),this.widgetLoading[t.widgetId]=!0;const n=this.getParameterValuesPayload();this._apiService.executeWidget(this.reportId,{widgetId:t.widgetId,dateFrom:this.dateFrom?.toISOString(),dateTo:this.dateTo?.toISOString(),page:t.page,pageSize:t.pageSize,sortDescriptors:t.sortDescriptors?.length?t.sortDescriptors:void 0,parameterValues:n.length>0?n:void 0,columnFilters:t.columnFilters?.length?t.columnFilters:void 0}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.widgetLoading[t.widgetId]=!1)).subscribe({next:o=>{this.widgetDataMap.set(t.widgetId,o),this.widgetDataMap=new Map(this.widgetDataMap)},error:o=>{console.error("Error re-executing widget:",o)}})}persistWidgetPageSize(t,n){if(!this.dashboardConfig?.widgets?.length||!this.reportId||this.report?.isReadOnly)return;const o=this.dashboardConfig.widgets.find(c=>c.id===t);if(!o||o.pageSize===n)return;o.pageSize=n;const s={dashboardConfiguration:JSON.stringify(this.dashboardConfig)};this._apiService.updateReport(this.reportId,s).pipe((0,L.Q)(this._destroyed$)).subscribe({error:c=>console.error("Failed to persist page size:",c)})}asCounterWidget(t){return t}asChartWidget(t){return t}asGridWidget(t){return t}asTimeTrackerWidget(t){return t}hasFilter(t){return t.type===w.v2.Counter&&!(!t.filterField||!t.filterValue)}getFilterTooltip(t){if(t.type===w.v2.Counter){const n=t;if(n.filterField&&n.filterValue)return`Filtered by ${n.filterField.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase()).trim()}: ${n.filterValue}`}return""}executeReport(){if(!this.reportId)return;this.executing=!0;const t={page:this.currentPage,pageSize:this.pageSize};this.dateFrom&&(t.dateFrom=this.dateFrom.toISOString()),this.dateTo&&(t.dateTo=this.dateTo.toISOString()),this._apiService.executeReport(this.reportId,t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.executing=!1)).subscribe({next:n=>{this.fieldMetadata=n.metadata,this.totalRecords=n.pagination.totalRecords,this.totalPages=n.pagination.totalPages;let o=n.data.map(r=>({itemGuid:r.itemGuid,relativeId:r.relativeId,elementId:r.elementId,createdDate:r.createdDate,modifiedDate:r.modifiedDate,createdBy:r.createdBy,modifiedBy:r.modifiedBy,...r.elementData}));this.visualizationType===w.vi.Pivot&&this.pivotConfig?.parameters?.length&&(o=this.applyPivotParameterFilters(o)),this.pivotData=o,this.totalRecords=o.length,this.visualizationType===w.vi.Pivot&&this.buildPivotBindingConfig()},error:n=>{this._messagingService.error("Failed to execute report","Error"),console.error("Error executing report:",n)}})}processGridData(){const t=(0,He.eh)(this.pivotData,this.gridState);this.gridData=t}onDataStateChange(t){this.gridState=t,this.processGridData()}onRefresh(){this.visualizationType===w.vi.Calendar?this.executeCalendarReport():this.visualizationType===w.vi.Dashboard||this.visualizationType===w.vi.DataGrid?this.executeDashboard():this.executeReport()}getStandardDateLabel(){return this.standardDateOptions.find(n=>n.value===this.standardDateRange)?.label||"Predefined"}applyStandardDateRange(){if(!this.standardDateRange)return;const t=new Date;switch(this.standardDateRange){case"currentWeek":{const n=t.getDay(),o=0===n?6:n-1,r=new Date(t.getFullYear(),t.getMonth(),t.getDate()-o),s=new Date(r.getFullYear(),r.getMonth(),r.getDate()+6,23,59,59);this.dateFrom=r,this.dateTo=s;break}case"currentMonth":this.dateFrom=new Date(t.getFullYear(),t.getMonth(),1),this.dateTo=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59);break;case"currentQuarter":{const n=Math.floor(t.getMonth()/3);this.dateFrom=new Date(t.getFullYear(),3*n,1),this.dateTo=new Date(t.getFullYear(),3*n+3,0,23,59,59);break}case"currentYear":this.dateFrom=new Date(t.getFullYear(),0,1),this.dateTo=new Date(t.getFullYear(),11,31,23,59,59)}}onDateRangeChange(){}onSaveFilters(){if(!this.reportId||!this.report||this.report.isReadOnly)return;this.savingFilters=!0,this.useStandardDateRange&&this.standardDateRange&&this.applyStandardDateRange();const t=this.getParameterValuesPayload(),o={endpointParameters:JSON.stringify({dateFrom:this.useStandardDateRange?void 0:this.dateFrom?.toISOString(),dateTo:this.useStandardDateRange?void 0:this.dateTo?.toISOString(),standardDateRange:this.useStandardDateRange?this.standardDateRange:void 0,parameterValues:t.length>0?t:void 0})};this._apiService.updateReport(this.reportId,o).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.savingFilters=!1)).subscribe({next:()=>{this._messagingService.success("Filters saved","Success"),this.visualizationType===w.vi.Gantt?this.ganttParamValues=this.getParameterValuesPayload():this.visualizationType===w.vi.Calendar?this.executeCalendarReport():this.visualizationType===w.vi.Dashboard||this.visualizationType===w.vi.DataGrid?this.executeDashboard():this.executeReport()},error:r=>{this._messagingService.error("Failed to save filters","Error"),console.error("Error saving filters:",r)}})}onPageChange(t){this.currentPage=t,this.executeReport()}onEdit(){this.report?.isReadOnly?this._messagingService.warning("This report is read-only. Create a copy to modify it.","Read Only"):this._router.navigate(this.visualizationType===w.vi.Calendar?["/private/ad-hoc-reports/calendar/edit",this.reportId]:this.visualizationType===w.vi.Dashboard?["/private/ad-hoc-reports/dashboard/edit",this.reportId]:this.visualizationType===w.vi.DataGrid?["/private/ad-hoc-reports/datagrid/edit",this.reportId]:this.visualizationType===w.vi.Gantt?["/private/ad-hoc-reports/gantt/edit",this.reportId]:["/private/ad-hoc-reports/edit",this.reportId])}onCopy(){this.report&&this._apiService.copyReport(this.report.adHocReportId,`${this.report.name} (Copy)`).pipe((0,L.Q)(this._destroyed$)).subscribe({next:n=>{this._messagingService.success("Report copied successfully","Success"),this._router.navigate(n.visualizationType===w.vi.Dashboard?["/private/ad-hoc-reports/dashboard/edit",n.adHocReportId]:n.visualizationType===w.vi.DataGrid?["/private/ad-hoc-reports/datagrid/edit",n.adHocReportId]:["/private/ad-hoc-reports/edit",n.adHocReportId])},error:n=>
1{this._messagingService.error("Failed to copy report","Error"),console.error("Error copying report:",n)}})}onShare(){this.showShareDialog=!0}onShareDialogClosed(){this.showShareDialog=!1}onBack(){this._router.navigate(["/private/ad-hoc-reports"])}formatDate(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):""}get hasExportableData(){return this.pivotData.length>0||!(this.visualizationType!==w.vi.DataGrid||!this.dashboardConfig?.widgets?.length)&&(this.getWidgetData(this.dashboardConfig.widgets[0].id)?.gridData?.length||0)>0}onExportExcel(){if(!this.hasExportableData)return;if(this.visualizationType===w.vi.DataGrid&&this.dashboardConfig?.widgets?.length){const c=this.asGridWidget(this.dashboardConfig.widgets[0]),g=this.getWidgetData(c.id)?.gridData;if(!g?.length)return;const b=c.columns.filter(U=>"elementId"!==U.field),k=b.map(U=>({value:U.title||this.formatFieldLabel(U.field),bold:!0,background:"#E8E8E8"})),D=g.map(U=>b.map(B=>{const De=U[B.field];if(De instanceof Date)return{value:De};if("number"==typeof De)return{value:De};if("string"==typeof De&&/<[^>]+>/.test(De)){const et=document.createElement("div");return et.innerHTML=De,{value:et.textContent||et.innerText||""}}return{value:null!=De?String(De):""}}));return void new cd.v({sheets:[{name:(this.report?.name||"Report").substring(0,31),columns:b.map(()=>({autoWidth:!0})),rows:[{cells:k},...D.map(U=>({cells:U}))]}]}).toDataURL().then(U=>{(0,Bt.U)(U,`${this.report?.name||"report"}.xlsx`)})}const t=this.pivotData,n=Object.keys(t[0]||{}).filter(c=>"elementId"!==c),o=n.map(c=>({value:this.formatFieldLabel(c),bold:!0,background:"#E8E8E8"})),r=t.map(c=>n.map(u=>{const g=c[u];if(g instanceof Date)return{value:g};if("number"==typeof g)return{value:g};if("string"==typeof g&&/<[^>]+>/.test(g)){const b=document.createElement("div");return b.innerHTML=g,{value:b.textContent||b.innerText||""}}return{value:null!=g?String(g):""}}));new cd.v({sheets:[{name:(this.report?.name||"Report").substring(0,31),columns:n.map(()=>({autoWidth:!0})),rows:[{cells:o},...r.map(c=>({cells:c}))]}]}).toDataURL().then(c=>{(0,Bt.U)(c,`${this.report?.name||"report"}.xlsx`)})}onExportAllExcel(){if(!this.reportId)return;const t=this.visualizationType===w.vi.Pivot,n=this.visualizationType===w.vi.DataGrid;n&&!this.dashboardConfig?.widgets?.length||t&&!this.hasExportableData||this._dialogService.open(N.DY,{header:"Export All Records",data:new N.q$("Cancel","Export",t?"Your export will include all records and a configured Excel Pivot Table. You will receive a notification when the file is ready to download. The file will be available for 48 hours.":"Your export will be prepared in the background. You will receive a notification when the file is ready to download. The file will be available for 48 hours.","mdi-microsoft-excel")}).onClose.pipe((0,O.s)(1)).subscribe(r=>{if(!r)return;this.exportAllLoading=!0;const s=this.getParameterValuesPayload();this._apiService.requestExportAll(this.reportId,{widgetId:n?this.dashboardConfig.widgets[0].id:void 0,exportType:t?"Pivot":"DataGrid",dateFrom:this.dateFrom?.toISOString(),dateTo:this.dateTo?.toISOString(),sortDescriptors:n&&this._currentSortDescriptors.length>0?this._currentSortDescriptors:void 0,columnFilters:n&&this._currentColumnFilters.length>0?this._currentColumnFilters:void 0,parameterValues:s.length>0?s.map(c=>({parameterId:c.parameterId,value:c.value})):void 0}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.exportAllLoading=!1)).subscribe({next:()=>{this._messagingService.success("Export queued successfully. You will be notified when the file is ready.","Export Queued")},error:c=>{console.error("Failed to queue export:",c),this._messagingService.error("Failed to queue export. Please try again.","Export Error")}})})}onChartDrillThrough(t){this._drillThroughService.handleChartDrillThrough(t,this.dateFrom,this.dateTo,this.getParameterValuesPayload(),this.dashboardConfig?.parameters)}onCounterDrillThrough(t){this._drillThroughService.handleCounterDrillThrough(t,this.dateFrom,this.dateTo,this.getParameterValuesPayload(),this.dashboardConfig?.parameters)}onGridRowClick(t){if(t.instanceId){if(t.elementId)return void this._openInstanceDialog(t.elementId,t.instanceId);if(t.dataSetId){const n=this._dataSetElementIdCache.get(t.dataSetId);if(n)return void this._openInstanceDialog(n,t.instanceId);this._apiService.getDataSet(t.dataSetId).pipe((0,L.Q)(this._destroyed$)).subscribe(o=>{o?.primaryElementId&&(this._dataSetElementIdCache.set(t.dataSetId,o.primaryElementId),this._openInstanceDialog(o.primaryElementId,t.instanceId))})}}}_openInstanceDialog(t,n){window.open(`/private/i/${n}`,"_blank")}onPivotCellClick(t){if(!this.report?.workflowTypeId)return;const n=[],o=c=>{const u=c.name,g=u&&u.includes("&")?u.substring(u.indexOf("&")+1):u;return g&&"(blank)"!==g?g:null};t.rowTuple?.members?.forEach((c,u)=>{u<this.pivotRowAxes.length&&c.levelNum>
10&&n.push({field:this.pivotRowAxes[u].name[0],value:o(c)})}),t.columnTuple?.members?.forEach((c,u)=>{u<this.pivotColumnAxes.length&&c.levelNum>0&&n.push({field:this.pivotColumnAxes[u].name[0],value:o(c)})}),console.log("[Pivot DrillThrough] dimensionFilters:",n);const r=n.map(c=>c.value??"(blank)"),s=n.length>0?r.join(" / "):"All Records";"HISTORY_WORKFLOW"!==this._endpointType&&"TIME_TRACKING_HISTORY"!==this._endpointType?this._drillThroughService.loadElement(this.report.workflowTypeId).subscribe(c=>{const g={logic:"and",filters:n.map(b=>{if(null===b.value){const D=this._drillThroughService.mapFieldForGridApi(c,b.field,"");return D?{field:D.field,operator:"isnull",value:null}:null}const k=this._drillThroughService.mapFieldForGridApi(c,b.field,b.value);return k?{field:k.field,operator:"eq",value:k.value}:null}).filter(b=>null!==b)};console.log("[Pivot DrillThrough] Final filter:",JSON.stringify(g)),this._drillThroughService.openDrillThrough(c,g,s)}):this._drillThroughService.openLocalDrillThrough(this.pivotData,this.fieldMetadata,n,s)}onExportGanttExcel(){const t=this._ganttViewer?.getTasksForExport();if(!t?.length)return void this._messagingService.warning("No tasks to export","Export");const n=["Task","Start Date","End Date","% Complete"].map(s=>({value:s,bold:!0,background:"#eeeeee"})),o=t.map(s=>({cells:[{value:s.title,indent:s.level-1},{value:s.start,format:"mm/dd/yyyy"},{value:s.end,format:"mm/dd/yyyy"},{value:s.percentComplete,format:"0%"}]}));new cd.v({sheets:[{name:(this.report?.name||"Gantt").substring(0,31),columns:[{autoWidth:!0},{autoWidth:!0},{autoWidth:!0},{autoWidth:!0}],rows:[{cells:n},...o]}]}).toDataURL().then(s=>{(0,Bt.U)(s,`${this.report?.name||"gantt"}.xlsx`),this._messagingService.success("Gantt chart exported to Excel","Success")}).catch(()=>this._messagingService.error("Failed to export Gantt chart","Error"))}onExportPdf(){const t=this.pdfContent?.nativeElement||document.querySelector(".viewer-content");t?(this.exporting=!0,(0,m0.vr)(t,{paperSize:"A4",landscape:!0,margin:{top:"1cm",bottom:"1cm",left:"1cm",right:"1cm"},scale:.6}).then(n=>(0,g0.F3)(n)).then(n=>{(0,Bt.U)(n,`${this.report?.name||"report"}.pdf`),this._messagingService.success("Report exported to PDF","Success"),this.exporting=!1}
1).catch(n=>{console.error("Error generating PDF:",n),this._messagingService.error("Failed to export PDF","Error"),this.exporting=!1})):this._messagingService.error("Could not find report content to export","Error")}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(Ye.F),e.rXU(q.Ui),e.rXU(bu.I),e.rXU(It.o3),e.rXU(e.gRc))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-report-viewer"]],viewQuery:function(n,o){if(1&n&&(e.GBs(mE,5),e.GBs(dd,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.pdfContent=r.first),e.mGM(r=e.lsd())&&(o._ganttViewer=r.first)}},decls:24,vars:13,consts:[["pdfContent",""],[1,"report-viewer-container"],[1,"viewer-header"],[1,"header-left"],["type","button","title","Go back",1,"button","button_clear","button_colorAlt",3,"click"],[1,"mdi","mdi-arrow-left"],["class","report-info",4,"ngIf"],[1,"header-actions"],["class","widget-count",4,"ngIf"],["type","button","title","Refresh Data","pTooltip","Refresh Data","tooltipStyleClass","small-tooltip",1,"button","button_round",3,"click","disabled"],["class","mdi mdi-loading mdi-spin",4,"ngIf"],["class","mdi mdi-refresh",4,"ngIf"],["type","button","title","Edit Report","class","button button_round","pTooltip","Edit Report","tooltipStyleClass","small-tooltip",3,"click",4,"ngIf"],["type","button","title","Copy Report","pTooltip","Copy Report","tooltipStyleClass","small-tooltip",1,"button","button_round",3,"click"],[1,"mdi","mdi-content-copy"],["type","button","title","Share Report","pTooltip","Share Report","tooltipStyleClass","small-tooltip",1,"button","button_round",3,"click"],[1,"mdi","mdi-share-variant"],[1,"action-divider"],["type","button","title","Export All to Excel","class","button button_round","pTooltip","Export All to Excel","tooltipStyleClass","small-tooltip","tooltipPosition","left",3,"disabled","click",4,"ngIf"],["type","button","title","Export to Excel","class","button button_round","pTooltip","Export to Excel","tooltipStyleClass","small-tooltip","tooltipPosition","left",3,"disabled","click",4,"ngIf"],["type","button","title","Export to PDF","class","button button_round","pTooltip","Export to PDF","tooltipStyleClass","small-tooltip","tooltipPosition","left",3,"disabled","click",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","viewer-content",4,"ngIf"],[3,"report","visible","closed",4,"ngIf"],[1,"report-info"],[1,"report-meta"],[4,"ngIf"],[1,"widget-count"],[1,"mdi","mdi-loading","mdi-spin"],[1,"mdi","mdi-refresh"],["type","button","title","Edit Report","pTooltip","Edit Report","tooltipStyleClass","small-tooltip",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil"],["type","button","title","Export All to Excel","pTooltip","Export All to Excel","tooltipStyleClass","small-tooltip","tooltipPosition","left",1,"button","button_round",3,"click","disabled"],["class","mdi mdi-microsoft-excel",4,"ngIf"],[1,"mdi","mdi-microsoft-excel"],["type","button","title","Export to Excel","pTooltip","Export to Excel","tooltipStyleClass","small-tooltip","tooltipPosition","left",1,"button","button_round",3,"click","disabled"],["type","button","title","Export to PDF","pTooltip","Export to PDF","tooltipStyleClass","small-tooltip","tooltipPosition","left",1,"button","button_round",3,"click","disabled"],["class","mdi mdi-file-pdf",4,"ngIf"],[1,"mdi","mdi-file-pdf"],[1,"loading-container"],["type","pulsing","size","large"],[1,"viewer-content"],["class","filters-bar",4,"ngIf"],[1,"visualization-container"],["class","pagination-bar",4,"ngIf"],[1,"filters-bar"],[1,"filters-controls"],["class","data-info",4,"ngIf"],["type","button","class","button button_colorSuccess save-filters-btn","pTooltip","Save dates and parameter selections","tooltipStyleClass","small-tooltip","tooltipPosition","left",3,"disabled","click",4,"ngIf"],[1,"filter-field"],[3,"valueChange","value","format","disabled"],[1,"date-info-column"],["class","predefined-date-label",4,"ngIf"],[1,"date-field-label"],[1,"mdi","mdi-calendar-clock"],[1,"predefined-date-label"],[1,"mdi","mdi-calendar-check"],[1,"filter-divider"],["class","filter-field",4,"ngFor","ngForOf"],[3,"data","value","defaultItem","filterable","valueChange","filterChange",4,"ngIf"],["class","no-wrap-select",3,"data","value","filterable","tagMapper","placeholder","valueChange","filterChange",4,"ngIf"],["pInputText","","placeholder","Type to filter...","class","parameter-text-input",3,"ngModel","ngModelChange",4,"ngIf"],[3,"valueChange","filterChange","data","value","defaultItem","filterable"],[1,"no-wrap-select",3,"valueChange","filterChange","data","value","filterable","tagMapper","placeholder"],["pInputText","","placeholder","Type to filter...",1,"parameter-text-input",3,"ngModelChange","ngModel"],[1,"data-info"],[1,"record-count"],["class","page-info",4,"ngIf"],[1,"page-info"],["type","button","pTooltip","Save dates and parameter selections","tooltipStyleClass","small-tooltip","tooltipPosition","left",1,"button","button_colorSuccess","save-filters-btn",3,"click","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-content-save buttonIcon_right",4,"ngIf"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-content-save","buttonIcon_right"],[1,"pivot-container"],[3,"kendoPivotLocalBinding","dimensions","measures","rowAxes","columnAxes","measureAxes","columnHeadersWidth","configurator",4,"ngIf"],["class","pivot-loading",4,"ngIf"],["class","no-data",4,"ngIf"],[3,"kendoPivotLocalBinding","dimensions","measures","rowAxes","columnAxes","measureAxes","columnHeadersWidth","configurator"],["kendoPivotGridValueCellTemplate",""],[1,"pivot-cell-clickable",3,"click"],[1,"pivot-loading"],["type","pulsing","size","medium"],[1,"no-data"],[1,"mdi","mdi-inbox"],[1,"calendar-container"],["class","dashboard-loading",4,"ngIf"],[3,"events","loading","defaultView","summaryField","summaryType","summaryLabel","eventClick","dateChange",4,"ngIf"],[1,"dashboard-loading"],[1,"mdi","mdi-calendar-blank"],[3,"eventClick","dateChange","events","loading","defaultView","summaryField","summaryType","summaryLabel"],[1,"gantt
1-container"],[3,"report","parameterValues"],["class","dashboard-container",4,"ngIf"],[1,"dashboard-container"],["class","dashboard-grid",3,"columns","rowHeight","gap","resizable","reorderable",4,"ngIf"],[1,"mdi","mdi-view-dashboard"],[1,"dashboard-grid",3,"columns","rowHeight","gap","resizable","reorderable"],[3,"col","row","colSpan","rowSpan",4,"ngFor","ngForOf"],[3,"col","row","colSpan","rowSpan"],[1,"widget-title"],["class","mdi mdi-filter filter-icon","tooltipPosition","top",3,"pTooltip",4,"ngIf"],[3,"widget","data","loading","drillThrough",4,"ngIf"],[3,"widget","data","loading","stateChange","rowClick",4,"ngIf"],[3,"widget",4,"ngIf"],["tooltipPosition","top",1,"mdi","mdi-filter","filter-icon",3,"pTooltip"],[3,"drillThrough","widget","data","loading"],[3,"stateChange","rowClick","widget","data","loading"],[3,"widget"],["class","datagrid-container",4,"ngIf"],[1,"datagrid-container"],["class","datagrid-full-width",3,"hidden","widget","data","loading","stateChange","rowClick",4,"ngIf"],[1,"mdi","mdi-table-large"],[1,"datagrid-full-width",3,"stateChange","rowClick","hidden","widget","data","loading"],[1,"pagination-bar"],["type","button","title","Previous page","aria-label","Previous page",1,"button","button_round",3,"click","disabled"],[1,"mdi","mdi-chevron-left"],[1,"page-indicator"],["type","button","title","Next page","aria-label","Next page",1,"button","button_round",3,"click","disabled"],[1,"mdi","mdi-chevron-right"],[3,"closed","report","visible"]],template:function(n,o){1&n&&(e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"button",4),e.bIt("click",function(){return o.onBack()}),e.nrm(4,"i",5),e.k0s(),e.DNE(5,fE,6,3,"div",6),e.k0s(),e.j41(6,"div",7),e.DNE(7,CE,4,1,"span",8),e.j41(8,"button",9),e.bIt("click",function(){return o.onRefresh()}),e.DNE(9,vE,1,0,"i",10)(10,bE,1,0,"i",11),e.k0s(),e.DNE(11,TE,2,0,"button",12),e.j41(12,"button",13),e.bIt("click",function(){return o.onCopy()}),e.nrm(13,"i",14),e.k0s(),e.j41(14,"button",15),e.bIt("click",function(){return o.onShare()}),e.nrm(15,"i",16),e.k0s(),e.nrm(16,"span",17),e.DNE(17,kE,3,3,"button",18)(18,RE,2,1,"button",18)(19,IE,2,1,"button",19)(20,DE,3,3,"button",20),e.k0s()(),e.DNE(21,OE,4,0,"div",21)(22,fS,10,8,"div",22),e.k0s(),e.DNE(23,CS,1,2,"cad-share-report-dialog",23)),2&n&&(e.R7$(5),e.Y8G("ngIf",o.report),e.R7$(2),e.Y8G("ngIf",o.visualizationType===o.VisualizationType.Dashboard&&o.dashboardConfig),e.R7$(),e.Y8G("disabled",o.executing),e.R7$(),e.Y8G("ngIf",o.executing),e.R7$(),e.Y8G("ngIf",!o.executing),e.R7$(),e.Y8G("ngIf",!(null!=o.report&&o.report.isReadOnly)),e.R7$(6),e.Y8G("ngIf",o.visualizationType===o.VisualizationType.Pivot),e.R7$(),e.Y8G("ngIf",o.visualizationType===o.VisualizationType.DataGrid),e.R7$(),e.Y8G("ngIf",o.visualizationType===o.VisualizationType.Gantt),e.R7$(),e.Y8G("ngIf",o.visualizationType!==o.VisualizationType.DataGrid),e.R7$(),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading&&o.report),e.R7$(),e.Y8G("ngIf",o.showShareDialog&&o.report))},dependencies:[M.Sq,M.bT,R.me,R.BC,R.vS,_e.S,Mt.m,xa.km,xa.S6,xa.Lr,z.I,at.V9,at.b3,ht.iB,ht.fu,ht.ZP,ht.ML,ze.VU,Bi,v0,X0,wn,Tu,dd,_E,M.QX],styles:['@charset "UTF-8";  .p-tooltip.small-tooltip .p-tooltip-text{font-size:12px;padding:4px 8px}  .k-list-filter .k-searchbar:before,   .k-list-filter .k-i-search,   .k-list-filter .k-svg-i-search{display:none}.report-viewer-container[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;overflow:hidden}.viewer-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:12px 24px;background:#fff;border-bottom:1px solid #dedede;flex-shrink:0}.viewer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.viewer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .report-info[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:600;color:#000}.viewer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .report-info[_ngcontent-%COMP%]   .report-meta[_ngcontent-%COMP%]{display:flex;gap:12px;font-size:12px;color:#7b7b7b}.viewer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .report-info[_ngcontent-%COMP%]   .report-meta[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:after{content:"\\2022";margin-left:12px}.viewer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .report-info[_ngcontent-%COMP%]   .report-meta[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]:last-child:after{content:""}.viewer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.viewer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .widget-count[_ngcontent-%COMP%]{font-size:13px;color:#7b7b7b;margin-right:8px}.viewer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .button[_ngcontent-%COMP%]{color:#0009}.viewer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .action-divider[_ngcontent-%COMP%]{width:1px;height:24px;background:#dedede;margin:0 8px}.loading-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;color:#7b7b7b}.viewer-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;background:#fafafa}
1.filters-bar[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;padding:12px 24px;background:#fff;border-bottom:1px solid #dedede;flex-shrink:0;gap:16px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;flex:1}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:#7b7b7b}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]     kendo-datepicker{width:160px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]     kendo-dropdownlist{min-width:200px;font-size:13px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]     kendo-multiselect{width:400px;font-size:13px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-field[_ngcontent-%COMP%]   .parameter-text-input[_ngcontent-%COMP%]{width:150px;padding:6px 10px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .date-info-column[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-self:flex-end;padding-bottom:6px;gap:2px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .date-info-column[_ngcontent-%COMP%]   .predefined-date-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:500;color:#5f84fc;white-space:nowrap}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .date-info-column[_ngcontent-%COMP%]   .predefined-date-label[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:12px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .date-info-column[_ngcontent-%COMP%]   .date-field-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-size:12px;color:#7b7b7b;white-space:nowrap}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .date-info-column[_ngcontent-%COMP%]   .date-field-label[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:14px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-divider[_ngcontent-%COMP%]{width:1px;height:32px;background:#dedede;align-self:flex-end;margin-bottom:2px}.filters-bar[_ngcontent-%COMP%]   .filters-controls[_ngcontent-%COMP%]   .filter-field.disabled-field[_ngcontent-%COMP%]{opacity:.4;pointer-events:none}.filters-bar[_ngcontent-%COMP%]   .data-info[_ngcontent-%COMP%]{display:flex;gap:16px;font-size:13px;color:#0009;white-space:nowrap;align-self:center}.filters-bar[_ngcontent-%COMP%]   .data-info[_ngcontent-%COMP%]   .record-count[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#0009}.filters-bar[_ngcontent-%COMP%]   .data-info[_ngcontent-%COMP%]   .page-info[_ngcontent-%COMP%]{padding-left:16px;border-left:1px solid #dedede}.grid-container[_ngcontent-%COMP%]{flex:1;padding:16px 24px;overflow:auto}.grid-container[_ngcontent-%COMP%]     .k-grid{height:100%;border-radius:4px;overflow:hidden}.grid-container[_ngcontent-%COMP%]     .k-grid .k-grid-header{background:#fafafa}.grid-container[_ngcontent-%COMP%]     .k-grid .k-grid-header th{font-weight:600;font-size:13px}.grid-container[_ngcontent-%COMP%]     .k-grid .k-grid-content td{font-size:13px;padding:8px 12px}.grid-container[_ngcontent-%COMP%]     .k-grid .k-grouping-row{background:#fafafa;font-weight:600}.grid-container[_ngcontent-%COMP%]     .k-grid .k-grouping-row td{padding:8px 12px}.grid-container[_ngcontent-%COMP%]     .k-grid .k-group-footer{background:#f2f2f2;font-weight:500}.grid-container[_ngcontent-%COMP%]   .no-data[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:40px;color:#7b7b7b}.grid-container[_ngcontent-%COMP%]   .no-data[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:32px;margin-bottom:12px}.grid-container[_ngcontent-%COMP%]   .no-data[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0}.grid-footer-aggregates[_ngcontent-%COMP%]{display:flex;gap:24px;padding:8px 0}.grid-footer-aggregates[_ngcontent-%COMP%]   .aggregate-item[_ngcontent-%COMP%]{font-size:13px}.grid-footer-aggregates[_ngcontent-%COMP%]   .aggregate-item[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{margin-right:4px}
1.pagination-bar[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;gap:16px;padding:12px 24px;background:#fff;border-top:1px solid #dedede;flex-shrink:0}.pagination-bar[_ngcontent-%COMP%]   .page-indicator[_ngcontent-%COMP%]{font-size:13px;color:#7b7b7b}.pivot-container[_ngcontent-%COMP%]{flex:1;padding:16px 24px;overflow:auto;position:relative}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid{height:100%;border-radius:4px;background:#fff}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-row-headers table.k-pivotgrid-table{table-layout:auto}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-row-headers .k-pivotgrid-cell{min-width:120px;white-space:nowrap;background:#fafafa;color:#000;font-weight:500;border-color:#dedede}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-column-headers .k-pivotgrid-cell{font-weight:600;background:#fafafa;color:#000;border-color:#dedede}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-values .k-pivotgrid-cell{text-align:right;font-size:13px}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-values .k-pivotgrid-cell .pivot-cell-clickable{cursor:pointer;display:block;width:100%;padding:2px 4px;border-radius:2px}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-values .k-pivotgrid-cell .pivot-cell-clickable:hover{background-color:#0000000f;text-decoration:underline}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-total{font-weight:600;background:#fafafa;color:#000}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-empty{background:#fafafa}.pivot-container[_ngcontent-%COMP%]     .k-pivotgrid .k-pivotgrid-cell{border-color:#dedede}.pivot-container[_ngcontent-%COMP%]   .pivot-loading[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:#fffc;padding:24px;border-radius:8px}.pivot-container[_ngcontent-%COMP%]   .no-data[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 40px;color:#7b7b7b;background:#fff;border-radius:4px}.pivot-container[_ngcontent-%COMP%]   .no-data[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:48px;margin-bottom:16px;color:#dedede}.pivot-container[_ngcontent-%COMP%]   .no-data[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;font-size:14px}.dashboard-container[_ngcontent-%COMP%]{flex:1;padding:16px 24px}.dashboard-container[_ngcontent-%COMP%]   .dashboard-placeholder[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 40px;background:#fff;border-radius:4px;color:#7b7b7b}.dashboard-container[_ngcontent-%COMP%]   .dashboard-placeholder[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:48px;margin-bottom:16px;color:#5f84fc}.dashboard-container[_ngcontent-%COMP%]   .dashboard-placeholder[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0 0 8px;color:#000}.dashboard-container[_ngcontent-%COMP%]   .dashboard-placeholder[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 4px}.dashboard-container[_ngcontent-%COMP%]   .dashboard-placeholder[_ngcontent-%COMP%]   .hint[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b}.calendar-container[_ngcontent-%COMP%]{flex:1;padding:16px 24px;display:flex;flex-direction:column;min-height:500px}.gantt-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:500px;overflow:hidden}.datagrid-container[_ngcontent-%COMP%]{flex:1;padding:16px 24px;display:flex;flex-direction:column}.datagrid-container[_ngcontent-%COMP%]   .datagrid-full-width[_ngcontent-%COMP%]{flex:1;width:100%}.datagrid-container[_ngcontent-%COMP%]   .datagrid-full-width[_ngcontent-%COMP%]     .grid-widget{height:100%}.datagrid-container[_ngcontent-%COMP%]   .datagrid-full-width[_ngcontent-%COMP%]     .grid-container{height:100%}.save-filters-btn[_ngcontent-%COMP%]{margin-left:auto;flex-shrink:0;align-self:flex-start}.widget-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px}.widget-title[_ngcontent-%COMP%]   .filter-icon[_ngcontent-%COMP%]{font-size:.75rem;color:#5f84fc;
1cursor:help}@media print{.viewer-header[_ngcontent-%COMP%], .filters-bar[_ngcontent-%COMP%], .pagination-bar[_ngcontent-%COMP%]{display:none!important}.report-viewer-container[_ngcontent-%COMP%]{height:auto;overflow:visible}.viewer-content[_ngcontent-%COMP%]{overflow:visible;background:#fff}.pivot-container[_ngcontent-%COMP%], .grid-container[_ngcontent-%COMP%], .dashboard-container[_ngcontent-%COMP%]{padding:0;overflow:visible;height:auto}  .k-grid,   .k-pivotgrid{height:auto!important;overflow:visible!important}.viewer-content[_ngcontent-%COMP%]:before{content:attr(data-report-name);display:block;font-size:18px;font-weight:700;margin-bottom:16px;padding-bottom:8px;border-bottom:2px solid #000000}}']})}}return i})();const bS=()=>({width:"400px"}),_d=()=>({width:"100%"});function TS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",2)(1,"label",11),e.EFF(2,"Decimal Places"),e.k0s(),e.j41(3,"p-inputNumber",12),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.decimalPlaces,o)||(r.decimalPlaces=o),e.Njj(o)}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(3),e.Aen(e.lJ4(6,_d)),e.R50("ngModel",t.decimalPlaces),e.Y8G("min",0)("max",6)("showButtons",!0)}}function ES(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",7)(1,"h6"),e.EFF(2,"Number Format"),e.k0s(),e.j41(3,"div",2)(4,"label",8),e.EFF(5,"Format"),e.k0s(),e.j41(6,"p-dropdown",9),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.numberFormat,o)||(r.numberFormat=o),e.Njj(o)}),e.k0s()(),e.DNE(7,TS,4,7,"div",10),e.k0s()}if(2&i){const t=e.XpG();e.R7$(6),e.Aen(e.lJ4(5,_d)),e.Y8G("options",t.numberFormatOptions),e.R50("ngModel",t.numberFormat),e.R7$(),e.Y8G("ngIf","none"!==t.numberFormat)}}function SS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",7)(1,"h6"),e.EFF(2,"Aggregation"),e.k0s(),e.j41(3,"div",2)(4,"label",13),e.EFF(5,"Aggregate"),e.k0s(),e.j41(6,"p-dropdown",14),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.aggregate,o)||(r.aggregate=o),e.Njj(o)}),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(6),e.Aen(e.lJ4(4,_d)),e.Y8G("options",t.aggregateOptions),e.R50("ngModel",t.aggregate)}}function kS(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCancel())}),e.EFF(1," Cancel "),e.k0s(),e.j41(2,"button",16),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onSave())}),e.EFF(3," Save "),e.k0s()}}let ku=(()=>{class i{constructor(){this.visible=!1,this.column=null,this.isNumeric=!1,this.saved=new e.bkB,this.closed=new e.bkB,this.wrapText=!1,this.numberFormat="comma",this.decimalPlaces=2,this.aggregate="",this.numberFormatOptions=[{label:"Comma (1,234.56)",value:"comma"},{label:"Currency ($1,234.56)",value:"currency"},{label:"None",value:"none"}],this.aggregateOptions=[{label:"None",value:""},{label:"Sum",value:"sum"},{label:"Average",value:"average"},{label:"Count",value:"count"},{label:"Min",value:"min"},{label:"Max",value:"max"}]}ngOnChanges(t){t.column&&this.column&&(this.wrapText=this.column.wrapText||!1,this.numberFormat=this.column.numberFormat||"comma",this.decimalPlaces=this.column.decimalPlaces??2,this.aggregate=this.column.aggregate||"")}onSave(){if(!this.column)return;const t={...this.column,wrapText:this.wrapText||void 0,aggregate:this.aggregate||void 0,numberFormat:this.isNumeric?this.numberFormat:void 0,decimalPlaces:this.isNumeric?this.decimalPlaces:void 0};this.saved.emit(t)}onCancel(){this.closed.emit()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-column-format-dialog"]],inputs:{visible:"visible",column:"column",isNumeric:"isNumeric"},outputs:{saved:"saved",closed:"closed"},features:[e.OA$],decls:9,vars:11,consts:[[3,"visibleChange","onHide","header","visible","modal","closable"],[1,"format-dialog-content"],[1,"format-field"],["inputId","wrapText",3,"ngModelChange","ngModel","binary"],["for","wrapText"],["class","format-section",4,"ngIf"],["pTemplate","footer"],[1,"format-section"],["for","numberFormat"],["optionLabel","label","optionValue","value","inputId","numberFormat",3,"ngModelChange","options","ngModel"],["class","format-field",4,"ngIf"],["for","decimalPlaces"],["inputId","decimalPlaces",3,"ngModelChange","ngModel","min","max","showButtons"],["for","aggregate"],["o
1ptionLabel","label","optionValue","value","inputId","aggregate",3,"ngModelChange","options","ngModel"],["type","button","title","Cancel",1,"button","button_outline",3,"click"],["type","button","title","Save",1,"button",3,"click"]],template:function(n,o){1&n&&(e.j41(0,"p-dialog",0),e.mxI("visibleChange",function(s){return e.DH7(o.visible,s)||(o.visible=s),s}),e.bIt("onHide",function(){return o.onCancel()}),e.j41(1,"div",1)(2,"div",2)(3,"p-checkbox",3),e.mxI("ngModelChange",function(s){return e.DH7(o.wrapText,s)||(o.wrapText=s),s}),e.k0s(),e.j41(4,"label",4),e.EFF(5,"Wrap Text"),e.k0s()(),e.DNE(6,ES,8,6,"div",5)(7,SS,7,5,"div",5),e.k0s(),e.DNE(8,kS,4,0,"ng-template",6),e.k0s()),2&n&&(e.Aen(e.lJ4(10,bS)),e.Y8G("header","Format: "+((null==o.column?null:o.column.title)||(null==o.column?null:o.column.field)||"")),e.R50("visible",o.visible),e.Y8G("modal",!0)("closable",!0),e.R7$(3),e.R50("ngModel",o.wrapText),e.Y8G("binary",!0),e.R7$(3),e.Y8G("ngIf",o.isNumeric),e.R7$(),e.Y8G("ngIf",o.isNumeric))},dependencies:[M.bT,R.BC,R.vS,ke.Ei,ut.Sc,_t.l,Le.ms,Io.YI,ee.C3],styles:[".format-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.format-field[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.format-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{min-width:100px;font-weight:500}.format-field[_ngcontent-%COMP%]   p-dropdown[_ngcontent-%COMP%], .format-field[_ngcontent-%COMP%]   p-inputNumber[_ngcontent-%COMP%]{flex:1}.format-section[_ngcontent-%COMP%]{border-top:1px solid #e0e0e0;padding-top:.75rem}.format-section[_ngcontent-%COMP%]   h6[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:.85rem;color:#666;text-transform:uppercase;letter-spacing:.5px}.format-section[_ngcontent-%COMP%]   .format-field[_ngcontent-%COMP%] + .format-field[_ngcontent-%COMP%]{margin-top:.5rem}"]})}}return i})();function RS(i,a){1&i&&(e.j41(0,"small",17),e.nrm(1,"i",18),e.EFF(2," Loading element... "),e.k0s())}function IS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",7)(1,"h5",8),e.EFF(2,"Select Workflow Element"),e.k0s(),e.j41(3,"p",9),e.EFF(4,"Choose the workflow whose items users will track time against."),e.k0s(),e.j41(5,"div",10)(6,"label"),e.EFF(7,"Workflow Element *"),e.k0s(),e.j41(8,"p-dropdown",11),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedWorkflowTypeId,o)||(r.selectedWorkflowTypeId=o),e.Njj(o)}),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onElementChange(o))}),e.k0s(),e.DNE(9,RS,3,0,"small",12),e.k0s(),e.j41(10,"div",13)(11,"button",14),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCancel())}),e.EFF(12,"Cancel"),e.k0s(),e.j41(13,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onNext())}),e.EFF(14," Next "),e.nrm(15,"i",16),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(8),e.Y8G("options",t.workflowTypes),e.R50("ngModel",t.selectedWorkflowTypeId),e.Y8G("filter",!0),e.R7$(),e.Y8G("ngIf",t.elementLoading),e.R7$(4),e.Y8G("disabled",!t.canProceedStep1())}}function yS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",7)(1,"h5",8),e.EFF(2,"Select Search Field"),e.k0s(),e.j41(3,"p",9),e.EFF(4,"Choose the field used to search for items (text or selector type)."),e.k0s(),e.j41(5,"div",10)(6,"label"),e.EFF(7,"Search Field *"),e.k0s(),e.j41(8,"p-dropdown",19),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.selectedSearchFieldName,o)||(r.selectedSearchFieldName=o),e.Njj(o)}),e.k0s()(),e.j41(9,"div",13)(10,"button",14),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onBack())}),e.nrm(11,"i",20),e.EFF(12," Back "),e.k0s(),e.j41(13,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onNext())}),e.EFF(14," Next "),e.nrm(15,"i",16),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(8),e.Y8G("options",t.searchableFields),e.R50("ngModel",t.selectedSearchFieldName),e.Y8G("filter",!0),e.R7$(5),e.Y8G("disabled",!t.canProceedStep2())}}function wS(i,a){1&i&&(e.j41(0,"div",26),e.EFF(1," No surfaceable fields on this element. "),e.k0s())}function DS(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"p-checkbox",31),e.mxI("ngModelChange",function(o){const r=e.eBV(t).ngIf;return e.DH7(r.required,o)||(r.required=o),e.Njj(o)}),e.k0s(),e.j41(2,"label",32),e.EFF(3,"Req"),e.k0s(),e.bVm()}if(2&i){const t=a.ngIf,n=e.XpG().$implicit;e.R7$(),e.Y8G("binary",!0),e.R50("ngModel",t.required),e.Y8G("inputId","ttc-req-"+n.id),e.R7$(),e.Y8G("for","ttc-req-"+n.id)}}function OS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",27)(1,"p-checkbox",28),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(2);return e.Njj(s.onFieldToggle(r,o.checked))}),e.k0s(),e.j41(2,"label",29),e.EFF(3),e.k0s(),e.DNE(4,DS,4,4,"ng-container",30),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(2);e.R7$(),e.Y8G("binary",!0)("ngModel",n.isFieldSelected(t))("inputId","ttc-field-"+t.id),e.R7$(),e.Y8G("for","ttc-field-"+t.id),e.R7$(),e.JRh(t.name),e.R7$(),e.Y8G("ngIf",n.getDraftField(t))}}function xS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",7)(1,"h5",8),e.EFF(2,"Surface Fields (optional)"),e.k0s(),e.j41(3,"p",9),e.EFF(4,"Choose fields to display and edit inline in the widget."),e.k0s(),e.DNE(5,wS,2,0,"div",21),e.j41(6,"div",22),e.DNE(7,OS,5,6,"div",23),e.k0s(),e.j41(8,"div",13)(9,"button",14),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onBack())}),e.nrm(10,"i",20),e.EFF(11," Back "),e.k0s(),e.j41(12,"button",14),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCancel())}),e.EFF(13,"Cancel"),e.k0s(),e.j41(14,"button",24),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onSave())}),e.nrm(15,"i",25),e.EFF(16," Save Widget "),e.k0s()()()}if(2&i){const t=e.XpG();e.R7$(5),e.Y8G("ngIf",0===t.availableFields.length),e.R7$(2),e.Y8G("ngForOf",t.availableFields)}}const MS=[ve.en.TEXT,ve.en.SELECTOR],FS=[ve.en.TEXT,ve.en.INTEGER,ve.en.DECIMAL,ve.en.BOOLEAN,ve.en.DATE,ve.en.NOTE,ve.en.SELECTOR];let PS=(()=>{class i{constructor(t,n){this._reportingApiService=t,this._elementsService=n,this.saved=new e.bkB,this.closed=new e.bkB,this.step=1,this.workflowTypes=[],this.workflowTypesLoading=!1,this.selectedWorkflowTypeId=null,this.selectedElement=null,this.elementLoading=!1,this.searchableFields=[],this.selectedSearchFieldName=null,this.availableFields=[],this.surfacedFieldDraft=[],this.saving=!1,this._destroyed$=new ue.B7}ngOnInit(){this.workflowTypesLoading=!0,this._reportingApiService.getWorkflowTypes("WORKFLOW").pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>{this.workflowTypesLoading=!1})).subscribe({next:t=>{this.workflowTypes=t}}
1),this.widget?.elementId&&(this.selectedWorkflowTypeId=this.widget.elementId,this.selectedSearchFieldName=this.widget.searchFieldName||null,this.surfacedFieldDraft=this.widget.surfacedFields.map(t=>({...t})),this._loadElement(this.widget.elementId))}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}onElementChange(t){this.selectedWorkflowTypeId=t,this.selectedElement=null,this.searchableFields=[],this.availableFields=[],this.selectedSearchFieldName=null,this.surfacedFieldDraft=[],t&&this._loadElement(t)}onFieldToggle(t,n){const o=this.surfacedFieldDraft.findIndex(r=>r.dataFieldId===t.id);n&&-1===o?this.surfacedFieldDraft.push({dataFieldId:t.id,label:t.name,required:!1}):!n&&-1!==o&&this.surfacedFieldDraft.splice(o,1)}isFieldSelected(t){return this.surfacedFieldDraft.some(n=>n.dataFieldId===t.id)}getDraftField(t){return this.surfacedFieldDraft.find(n=>n.dataFieldId===t.id)??null}onNext(){this.step<3&&(this.step=this.step+1)}onBack(){this.step>1&&(this.step=this.step-1)}canProceedStep1(){return!!this.selectedWorkflowTypeId&&!!this.selectedElement}canProceedStep2(){return!!this.selectedSearchFieldName}onSave(){if(!this.selectedWorkflowTypeId||!this.selectedSearchFieldName)return;const t={...this.widget,elementId:this.selectedWorkflowTypeId,searchFieldName:this.selectedSearchFieldName,surfacedFields:[...this.surfacedFieldDraft]};this.saved.emit(t)}onCancel(){this.closed.emit()}_loadElement(t){this.elementLoading=!0,this._elementsService.getById(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>{this.elementLoading=!1})).subscribe({next:n=>{this.selectedElement=n;const o=n.dataFields??[];this.searchableFields=o.filter(r=>MS.includes(r.typeName)),this.availableFields=o.filter(r=>FS.includes(r.typeName))}})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(Ye.F),e.rXU(Eu.L))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-time-tracker-configurator"]],inputs:{widget:"widget"},outputs:{saved:"saved",closed:"closed"},decls:22,vars:13,consts:[[1,"ttc-container"],[1,"ttc-steps"],[1,"ttc-step"],[1,"ttc-step-num"],[1,"ttc-step-label"],[1,"ttc-step-line"],["class","ttc-step-content",4,"ngIf"],[1,"ttc-step-content"],[1,"ttc-step-title"],[1,"ttc-step-desc"],[1,"form-field"],["optionLabel","name","optionValue","workflowTypeId","placeholder","Select a workflow...","filterBy","name","styleClass","ttc-dropdown","appendTo","body",3,"ngModelChange","options","ngModel","filter"],["class","ttc-hint",4,"ngIf"],[1,"ttc-step-actions"],["type","button",1,"button","button_outline",3,"click"],["type","button",1,"button","button_colorPrimary",3,"click","disabled"],[1,"mdi","mdi-arrow-right"],[1,"ttc-hint"],[1,"pi","pi-spinner","pi-spin"],["optionLabel","name","optionValue","name","placeholder","Select a field...","filterBy","name","styleClass","ttc-dropdown","appendTo","body",3,"ngModelChange","options","ngModel","filter"],[1,"mdi","mdi-arrow-left"],["class","ttc-empty",4,"ngIf"],[1,"ttc-field-list"],["class","ttc-field-row",4,"ngFor","ngForOf"],["type","button",1,"button","button_colorSuccess",3,"click"],[1,"mdi","mdi-check"],[1,"ttc-empty"],[1,"ttc-field-row"],[3,"onChange","binary","ngModel","inputId"],[1,"ttc-field-name",3,"for"],[4,"ngIf"],["title","Required",3,"ngModelChange","binary","ngModel","inputId"],[1,"ttc-req-label",3,"for"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),e.
1EFF(4,"1"),e.k0s(),e.j41(5,"span",4),e.EFF(6,"Element"),e.k0s()(),e.nrm(7,"div",5),e.j41(8,"div",2)(9,"span",3),e.EFF(10,"2"),e.k0s(),e.j41(11,"span",4),e.EFF(12,"Search Field"),e.k0s()(),e.nrm(13,"div",5),e.j41(14,"div",2)(15,"span",3),e.EFF(16,"3"),e.k0s(),e.j41(17,"span",4),e.EFF(18,"Fields"),e.k0s()()(),e.DNE(19,IS,16,5,"div",6)(20,yS,16,4,"div",6)(21,xS,17,2,"div",6),e.k0s()),2&n&&(e.R7$(2),e.AVh("ttc-step-active",1===o.step)("ttc-step-done",o.step>1),e.R7$(6),e.AVh("ttc-step-active",2===o.step)("ttc-step-done",o.step>2),e.R7$(6),e.AVh("ttc-step-active",3===o.step),e.R7$(5),e.Y8G("ngIf",1===o.step),e.R7$(),e.Y8G("ngIf",2===o.step),e.R7$(),e.Y8G("ngIf",3===o.step))},dependencies:[M.Sq,M.bT,R.BC,R.vS,ut.Sc,Le.ms,ee.C3],styles:[".ttc-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;padding:4px 0}.ttc-steps[_ngcontent-%COMP%]{display:flex;align-items:center;gap:0;margin-bottom:8px}.ttc-step[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:4px;flex:0 0 auto}.ttc-step.ttc-step-active[_ngcontent-%COMP%]   .ttc-step-num[_ngcontent-%COMP%]{background:var(--primary-color, #3b82f6);color:#fff}.ttc-step.ttc-step-done[_ngcontent-%COMP%]   .ttc-step-num[_ngcontent-%COMP%]{background:var(--green-500, #22c55e);color:#fff}.ttc-step-num[_ngcontent-%COMP%]{width:28px;height:28px;border-radius:50%;background:var(--surface-200, #e5e7eb);color:var(--text-color-secondary, #6c757d);display:flex;align-items:center;justify-content:center;font-size:.8rem;font-weight:600}.ttc-step-label[_ngcontent-%COMP%]{font-size:.7rem;color:var(--text-color-secondary, #6c757d);white-space:nowrap}.ttc-step-line[_ngcontent-%COMP%]{flex:1;height:2px;background:var(--surface-200, #e5e7eb);margin:0 4px 16px}.ttc-step-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.ttc-step-title[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.ttc-step-desc[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--text-color-secondary, #6c757d)}.ttc-dropdown[_ngcontent-%COMP%]{width:100%}.ttc-hint[_ngcontent-%COMP%]{color:var(--text-color-secondary, #6c757d);font-size:.8rem;display:flex;align-items:center;gap:4px}.ttc-empty[_ngcontent-%COMP%]{color:var(--text-color-secondary, #6c757d);font-size:.875rem;font-style:italic}.ttc-field-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;max-height:220px;overflow-y:auto}.ttc-field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.ttc-field-name[_ngcontent-%COMP%]{flex:1;min-width:100px;font-size:.875rem;cursor:pointer}.ttc-req-label[_ngcontent-%COMP%]{font-size:.75rem;color:var(--text-color-secondary, #6c757d);cursor:pointer}.ttc-step-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding-top:8px;border-top:1px solid var(--surface-border, #dee2e6)}"]})}}return i})();const NS=()=>({width:"550px"}),$t=()=>({standalone:!0});function GS(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-time-tracker-configurator",5),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.saved.emit(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.closed.emit())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("widget",t.asTimeTrackerWidget(t.widget))}}function AS(i,a){1&i&&(e.j41(0,"small",15),e.EFF(1," Title is required "),e.k0s())}function LS(i,a){if(1&i){const t=e.RV6();e.j41(0,"label",18)(1,"input",19),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.dataSourceType,o)||(r.dataSourceType=o),e.Njj(o)}),e.bIt("change",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onDataSourceTypeChange())}),e.k0s(),e.EFF(2),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.AVh("active",n.dataSourceType===t.value),e.R7$(),e.Y8G("value",t.value),e.R50("ngModel",n.dataSourceType),e.Y8G("ngModelOptions",e.lJ4(6,$t)),e.R7$(),e.SpI(" ",t.label," ")}}function BS(i,a){if(1&i&&(e.j41(0,"div",8)(1,"label"),e.EFF(2,"Data Source Type"),e.k0s(),e.j41(3,"div",16),e.DNE(4,LS,3,7,"label",17),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(4),e.Y8G("ngForOf",t.dataSourceOptions)}}function jS(i,a){1&i&&(e.j41(0,"small",15),e.EFF(1," Endpoint is required "),e.k0s())}function VS(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",8)(2,"label",20),e.EFF(3,"Endpoint Type"),e.k0s(),e.j41(4,"p-dropdown",21),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);
1return e.DH7(r.selectedElementType,o)||(r.selectedElementType=o),e.Njj(o)}),e.bIt("onChange",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onElementTypeChange())}),e.k0s(),e.j41(5,"small",22),e.EFF(6,"Select the type of endpoint"),e.k0s()(),e.j41(7,"div",8)(8,"label",23),e.EFF(9,"Endpoint *"),e.k0s(),e.j41(10,"p-dropdown",24),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onWorkflowChange(o))}),e.k0s(),e.DNE(11,jS,2,0,"small",11),e.k0s(),e.bVm()}if(2&i){let t;const n=e.XpG(2);e.R7$(4),e.Y8G("options",n.elementTypeOptions),e.R50("ngModel",n.selectedElementType),e.Y8G("ngModelOptions",e.lJ4(6,$t)),e.R7$(6),e.Y8G("options",n.filteredWorkflowTypes)("filter",!0),e.R7$(),e.Y8G("ngIf",(null==(t=n.widgetForm.get("workflowTypeId"))?null:t.touched)&&!(null!=(t=n.widgetForm.get("workflowTypeId"))&&t.value)&&"workflow"===n.dataSourceType)}}function $S(i,a){if(1&i&&(e.j41(0,"div",28)(1,"span",29),e.EFF(2),e.k0s(),e.j41(3,"span",30),e.EFF(4),e.k0s()()),2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.name),e.R7$(2),e.Lme("",t.primaryElementName," + ",t.joinedElementName,"")}}function US(i,a){1&i&&(e.j41(0,"small",15),e.EFF(1," Data set is required "),e.k0s())}function YS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",8)(1,"label",25),e.EFF(2,"Data Set *"),e.k0s(),e.j41(3,"p-dropdown",26),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onDataSetChange(o))}),e.DNE(4,$S,5,3,"ng-template",27),e.k0s(),e.DNE(5,US,2,0,"small",11),e.k0s()}if(2&i){let t;const n=e.XpG(2);e.R7$(3),e.Y8G("options",n.dataSets)("filter",!0)("showClear",!0),e.R7$(2),e.Y8G("ngIf",(null==(t=n.widgetForm.get("dataSetId"))?null:t.touched)&&!(null!=(t=n.widgetForm.get("dataSetId"))&&t.value)&&"dataset"===n.dataSourceType)}}function HS(i,a){if(1&i&&(e.j41(0,"div",8)(1,"label",31),e.EFF(2,"Date Range Field"),e.k0s(),e.nrm(3,"p-dropdown",32),e.j41(4,"small",22),e.EFF(5,"Which date field the dashboard date range applies to"),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(3),e.Y8G("options",t.dateFieldOptions)}}function XS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",8)(1,"label",50),e.EFF(2,"Filter Values"),e.k0s(),e.j41(3,"kendo-multiselect",51),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.selectedFilterValues,o)||(r.selectedFilterValues=o),e.Njj(o)}),e.k0s()()}if(2&i){const t=e.XpG(3);e.R7$(3),e.Y8G("data",t.filterValueOptions),e.R50("ngModel",t.selectedFilterValues),e.Y8G("ngModelOptions",e.lJ4(7,$t))("filterable",!0)("autoClose",!1)("loading",t.filterValuesLoading)("placeholder","Select filter values...")}}function WS(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",59),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterFieldChange(r.id,o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(4);e.Y8G("options",n.filterFieldOptions)("ngModel",n.getParameterMappedField(t.id))("ngModelOptions",e.lJ4(4,$t))("filter",!0)}}function zS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"p-checkbox",55),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.onParameterToggle(r,o.checked))}),e.k0s(),e.j41(2,"label",56)(3,"span",57),e.EFF(4),e.k0s()(),e.DNE(5,WS,1,5,"p-dropdown",58),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(4);e.R7$(),e.Y8G("binary",!0)("ngModel",n.isParameterMapped(t.id))("ngModelOptions",e.lJ4(7,$t))("inputId","param-"+t.id),e.R7$(),e.Y8G("for","param-"+t.id),e.R7$(2),e.JRh(t.name),e.R7$(),e.Y8G("ngIf",n.isParameterMapped(t.id))}}function KS(i,a){if(1&i&&(e.j41(0,"div",37)(1,"div",38),e.EFF(2,"Global Parameter Mappings"),e.k0s(),e.j41(3,"small",39),e.EFF(4,"Map dashboard-level parameters to fields on this widget"),e.k0s(),e.j41(5,"div",52),e.DNE(6,zS,6,8,"div",53),e.k0s()()),2&i){const t=e.XpG(3);e.R7$(6),e.Y8G("ngForOf",t.parameters)}}function JS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",7)(1,"h5"),e.EFF(2,"Counter Settings"),e.k0s(),e.j41(3,"div",8)(4,"label",33),e.EFF(5,"Aggregation *"),e.k0s(),e.nrm(6,"p-dropdown",34),e.j41(7,"small",22),e.EFF(8,"Count: counts all records. Sum/Avg/Min/Max: requires numeric field."),e.k0s()(),e.j41(9,"div",8)(10,"label",35),e.EFF(11,"Value Field *"),e.k0s(),e.nrm(12,"p-dropdown",36),e.k0s(),e.j41(13,"div",37)(14,"div",38),e.EFF(15,"Widget Parameter Mapping"),e.k0s(),e.j41(16,"small",39),e.EFF(17,"Filter this widget's data by a specific field value"),e.k0s(),e.j41(18,"div",8)(19,"label",40),e.EFF(20,"Filter By"),e.k0s(),e.j41(21,"p-dropdown",41),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onFilterFieldChange(o))}),e.k0s()(),e.DNE(22,XS,4,8,"div",12),e.k0s(),e.DNE(23,KS,7,1,"div",42),e.j41(24,"div",8)(25,"label",43),e.EFF(26,"Comparison Period"),e.k0s(),e.nrm(27,"p-dropdown",44),e.j41(28,"small",22),e.EFF(29,"Show indicator comparing to previous period"),e.k0s()(),e.j41(30,"div",45)(31,"div",8)(32,"label",46),e.EFF(33,"Prefix"),e.k0s(),e.nrm(34,"input",47),e.k0s(),e.j41(35,"div",8)(36,"label",48),e.
1EFF(37,"Suffix"),e.k0s(),e.nrm(38,"input",49),e.k0s()()()}if(2&i){let t;const n=e.XpG(2);e.R7$(6),e.Y8G("options",n.aggregateOptions),e.R7$(6),e.Y8G("options",n.counterValueFieldOptions)("filter",!0),e.R7$(9),e.Y8G("options",n.groupedFilterFieldOptions)("group",!0)("showClear",!0)("filter",!0),e.R7$(),e.Y8G("ngIf",null==(t=n.widgetForm.get("filterField"))?null:t.value),e.R7$(),e.Y8G("ngIf",(null==n.parameters?null:n.parameters.length)>0),e.R7$(4),e.Y8G("options",n.comparisonOptions)}}function qS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",8)(1,"label",72),e.EFF(2,"Filter Values"),e.k0s(),e.j41(3,"kendo-multiselect",51),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.selectedFilterValues,o)||(r.selectedFilterValues=o),e.Njj(o)}),e.k0s()()}if(2&i){const t=e.XpG(3);e.R7$(3),e.Y8G("data",t.filterValueOptions),e.R50("ngModel",t.selectedFilterValues),e.Y8G("ngModelOptions",e.lJ4(7,$t))("filterable",!0)("autoClose",!1)("loading",t.filterValuesLoading)("placeholder","Select filter values...")}}function QS(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",59),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterFieldChange(r.id,o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(4);e.Y8G("options",n.filterFieldOptions)("ngModel",n.getParameterMappedField(t.id))("ngModelOptions",e.lJ4(4,$t))("filter",!0)}}function ZS(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"p-checkbox",55),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.onParameterToggle(r,o.checked))}),e.k0s(),e.j41(2,"label",56)(3,"span",57),e.EFF(4),e.k0s()(),e.DNE(5,QS,1,5,"p-dropdown",58),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(4);e.R7$(),e.Y8G("binary",!0)("ngModel",n.isParameterMapped(t.id))("ngModelOptions",e.lJ4(7,$t))("inputId","chart-param-"+t.id),e.R7$(),e.Y8G("for","chart-param-"+t.id),e.R7$(2),e.JRh(t.name),e.R7$(),e.Y8G("ngIf",n.isParameterMapped(t.id))}}function ek(i,a){if(1&i&&(e.j41(0,"div",37)(1,"div",38),e.EFF(2,"Global Parameter Mappings"),e.k0s(),e.j41(3,"small",39),e.EFF(4,"Map dashboard-level parameters to fields on this widget"),e.k0s(),e.j41(5,"div",52),e.DNE(6,ZS,6,8,"div",53),e.k0s()()),2&i){const t=e.XpG(3);e.R7$(6),e.Y8G("ngForOf",t.parameters)}}function tk(i,a){if(1&i&&e.nrm(0,"span",80),2&i){const t=a.$implicit;e.xc7("background-color",t),e.BMQ("title",t)}}function nk(i,a){if(1&i&&(e.j41(0,"div",78),e.DNE(1,tk,1,3,"span",79),e.k0s()),2&i){let t;const n=e.XpG(4);e.R7$(),e.Y8G("ngForOf",n.getPaletteColors(null==(t=n.widgetForm.get("colorPaletteId"))?null:t.value))("ngForTrackBy",n.trackByIndex)}}function ik(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",85)(1,"kendo-colorpicker",86),e.bIt("valueChange",function(o){const r=e.eBV(t).index,s=e.XpG(5);return e.Njj(s.onCustomColorChange(r,o))}),e.k0s(),e.j41(2,"button",87),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(5);return e.Njj(r.removeCustomColor(o))}),e.nrm(3,"i",88),e.k0s()()}if(2&i){const t=a.$implicit,n=a.index;e.R7$(),e.Y8G("value",t),e.R7$(),e.BMQ("aria-label","Remove color "+(n+1))}}function ok(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",81),e.DNE(1,ik,4,2,"div",82),e.j41(2,"button",83),e.bIt("click",function(){e.eBV(t);const o=e.XpG(4);return e.Njj(o.addCustomColor())}),e.nrm(3,"i",84),e.EFF(4," Add color "),e.k0s(),e.j41(5,"small",22),e.EFF(6,"Colors cycle through additional categories."),e.k0s()()}if(2&i){const t=e.XpG(4);e.R7$(),e.Y8G("ngForOf",t.customColors)("ngForTrackBy",t.trackByIndex)}}function rk(i,a){if(1&i&&(e.j41(0,"div",73)(1,"label",74),e.EFF(2,"Color Palette"),e.k0s(),e.nrm(3,"p-dropdown",75),e.j41(4,"small",22),e.EFF(5,"Leave empty to use default chart colors"),e.k0s(),e.DNE(6,nk,2,2,"div",76)(7,ok,7,2,"div",77),e.k0s()),2&i){let t,n;const o=e.XpG(3);e.R7$(3),e.Y8G("options",o.paletteOptions)("showClear",!0),e.R7$(3),e.Y8G("ngIf",(null==(t=o.widgetForm.get("colorPaletteId"))?null:t.value)&&(null==(t=o.widgetForm.get("colorPaletteId"))?null:t.value)!==o.CUSTOM_PALETTE_ID),e.R7$(),e.Y8G("ngIf",(null==(n=o.widgetForm.get("colorPaletteId"))?null:n.value)===o.CUSTOM_PALETTE_ID)}}function ak(i,a){if(1&i){const t=e.RV6();
1e.j41(0,"div",7)(1,"h5"),e.EFF(2,"Chart Settings"),e.k0s(),e.j41(3,"div",8)(4,"label",60),e.EFF(5,"Category Field (X-Axis) *"),e.k0s(),e.nrm(6,"p-dropdown",61),e.j41(7,"small",22),e.EFF(8,"Field used for grouping data"),e.k0s()(),e.j41(9,"div",8)(10,"label",35),e.EFF(11,"Value Field (Y-Axis) *"),e.k0s(),e.nrm(12,"p-dropdown",62),e.k0s(),e.j41(13,"div",8)(14,"label",33),e.EFF(15,"Aggregation *"),e.k0s(),e.nrm(16,"p-dropdown",34),e.k0s(),e.j41(17,"div",37)(18,"div",38),e.EFF(19,"Widget Parameter Mapping"),e.k0s(),e.j41(20,"small",39),e.EFF(21,"Filter this widget's data by a specific field value"),e.k0s(),e.j41(22,"div",8)(23,"label",63),e.EFF(24,"Filter By"),e.k0s(),e.j41(25,"p-dropdown",64),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onFilterFieldChange(o))}),e.k0s()(),e.DNE(26,qS,4,8,"div",12),e.k0s(),e.DNE(27,ek,7,1,"div",42),e.j41(28,"div",65)(29,"div",66),e.nrm(30,"p-checkbox",67),e.j41(31,"label",68),e.EFF(32,"Show Legend"),e.k0s()(),e.j41(33,"div",66),e.nrm(34,"p-checkbox",69),e.j41(35,"label",70),e.EFF(36,"Show Labels"),e.k0s()()(),e.DNE(37,rk,8,4,"div",71),e.k0s()}if(2&i){let t;const n=e.XpG(2);e.R7$(6),e.Y8G("options",n.categoryFieldOptions)("filter",!0),e.R7$(6),e.Y8G("options",n.numericFieldOptions)("filter",!0),e.R7$(4),e.Y8G("options",n.aggregateOptions),e.R7$(9),e.Y8G("options",n.groupedFilterFieldOptions)("group",!0)("showClear",!0)("filter",!0),e.R7$(),e.Y8G("ngIf",null==(t=n.widgetForm.get("filterField"))?null:t.value),e.R7$(),e.Y8G("ngIf",(null==n.parameters?null:n.parameters.length)>0),e.R7$(3),e.Y8G("binary",!0),e.R7$(4),e.Y8G("binary",!0),e.R7$(3),e.Y8G("ngIf",n.isPaletteCapableChart())}}function sk(i,a){1&i&&(e.j41(0,"div",97),e.EFF(1," Select an endpoint to see available columns "),e.k0s())}function lk(i,a){if(1&i){const t=e.RV6();e.j41(0,"a",102),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.openColumnFormatDialog(o))}),e.nrm(1,"i",103),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.AVh("has-settings",n.hasColumnFormatSettings(t.value))}}function dk(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",98)(1,"div",99)(2,"p-checkbox",55),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onGridColumnToggle(r.value,o.checked))}),e.k0s(),e.j41(3,"label",100),e.EFF(4),e.k0s(),e.DNE(5,lk,2,2,"a",101),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(2),e.Y8G("binary",!0)("ngModel",n.isGridColumnSelected(t.value))("ngModelOptions",e.lJ4(7,$t))("inputId","col-"+t.value),e.R7$(),e.Y8G("for","col-"+t.value),e.R7$(),e.JRh(t.label),e.R7$(),e.Y8G("ngIf",n.isGridColumnSelected(t.value))}}function ck(i,a){1&i&&(e.j41(0,"small",15),e.EFF(1," Select at least one column "),e.k0s())}function pk(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",59),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(4);return e.Njj(s.onParameterFieldChange(r.id,o))}),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(4);e.Y8G("options",n.filterFieldOptions)("ngModel",n.getParameterMappedField(t.id))("ngModelOptions",e.lJ4(4,$t))("filter",!0)}}function uk(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"p-checkbox",55),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(4);return e.Njj(s.onParameterToggle(r,o.checked))}),e.k0s(),e.j41(2,"label",56)(3,"span",57),e.EFF(4),e.k0s()(),e.DNE(5,pk,1,5,"p-dropdown",58),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(4);e.R7$(),e.Y8G("binary",!0)("ngModel",n.isParameterMapped(t.id))("ngModelOptions",e.lJ4(7,$t))("inputId","grid-param-"+t.id),e.R7$(),e.Y8G("for","grid-param-"+t.id),e.R7$(2),e.JRh(t.name),e.R7$(),e.Y8G("ngIf",n.isParameterMapped(t.id))}}function _k(i,a){if(1&i&&(e.j41(0,"div",37)(1,"div",38),e.EFF(2,"Global Parameter Mappings"),e.k0s(),e.j41(3,"small",39),e.EFF(4,"Map dashboard-level parameters to fields on this widget"),e.k0s(),e.j41(5,"div",52),e.DNE(6,uk,6,8,"div",53),e.k0s()()),2&i){const t=e.XpG(3);e.R7$(6),e.Y8G("ngForOf",t.parameters)}}function mk(i,a){if(1&i&&(e.j41(0,"div",7)(1,"h5"),e.EFF(2,"Grid Settings"),e.k0s(),e.j41(3,"div",8)(4,"label"),e.EFF(5,"Columns to Display *"),e.k0s(),e.j41(6,"div",89),e.DNE(7,sk,2,0,"div",90)(8,dk,6,8,"div",91),e.k0s(),e.DNE(9,ck,2,0,"small",11),e.k0s(),e.j41(10,"div",45)(11,"div",8)(12,"label",92),e.EFF(13,"Page Size"),e.k0s(),e.nrm(14,"p-inputNumber",93),e.k0s(),e.j41(15,"div",94),e.nrm(16,"p-checkbox",95),e.j41(17,"label",96),e.EFF(18,"Show Column Filters"),e.k0s()()(),e.DNE(19,_k,7,1,"div",42),e.k0s()),2&i){const t=e.XpG(2);e.R7$(7),e.Y8G("ngIf",0===t.fieldOptions.length),e.R7$(),e.Y8G("ngForOf",t.fieldOptions),e.R7$(),e.Y8G("ngIf",0===t.selectedGridColumns.length),e.R7$(5),e.Y8G("min",5)("max",100)("showButtons",!0),e.R7$(2),e.Y8G("binary",!0),e.R7$(3),e.Y8G("ngIf",(null==t.parameters?null:t.parameters.length)>0)}}function gk(i,a){if(1&i&&(e.j41(0,"form",6)(1,"div",7)(2,"h5"),e.
1EFF(3,"General Settings"),e.k0s(),e.j41(4,"div",8)(5,"label",9),e.EFF(6,"Widget Title *"),e.k0s(),e.nrm(7,"input",10),e.DNE(8,AS,2,0,"small",11),e.k0s(),e.DNE(9,BS,5,1,"div",12)(10,VS,12,7,"ng-container",13)(11,YS,6,4,"div",12)(12,HS,6,1,"div",12),e.k0s(),e.DNE(13,JS,39,10,"div",14)(14,ak,38,14,"div",14)(15,mk,20,8,"div",14),e.k0s()),2&i){let t;const n=e.XpG();e.Y8G("formGroup",n.widgetForm),e.R7$(8),e.Y8G("ngIf",(null==(t=n.widgetForm.get("title"))||null==t.errors?null:t.errors.required)&&(null==(t=n.widgetForm.get("title"))?null:t.touched)),e.R7$(),e.Y8G("ngIf",n.dataSets.length>0),e.R7$(),e.Y8G("ngIf","workflow"===n.dataSourceType),e.R7$(),e.Y8G("ngIf","dataset"===n.dataSourceType),e.R7$(),e.Y8G("ngIf",n.dateFieldOptions.length>0),e.R7$(),e.Y8G("ngIf",(null==n.widget?null:n.widget.type)===n.DashboardWidgetType.Counter),e.R7$(),e.Y8G("ngIf",n.isChartWidget()),e.R7$(),e.Y8G("ngIf",(null==n.widget?null:n.widget.type)===n.DashboardWidgetType.Grid)}}function hk(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"button",104),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onCancel())}),e.EFF(2," Cancel "),e.k0s(),e.j41(3,"button",105),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onSave())}),e.nrm(4,"i",106),e.EFF(5," Save Widget "),e.k0s(),e.bVm()}}function fk(i,a){if(1&i&&e.DNE(0,hk,6,0,"ng-container",13),2&i){const t=e.XpG();e.Y8G("ngIf",(null==t.widget?null:t.widget.type)!==t.DashboardWidgetType.TimeTracker)}}function Ck(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-column-format-dialog",107),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onFormatSaved(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onFormatDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("visible",t.showFormatDialog)("column",t.editingFormatColumn)("isNumeric",t.editingFormatIsNumeric)}}let vk=(()=>{class i{get groupedFilterFieldOptions(){const t=[{label:"System Data",items:[{label:"Users",value:w.we,fieldType:""}]}];return this.filterFieldOptions.length>0&&t.push({label:"Fields",items:this.filterFieldOptions}),t}get filteredWorkflowTypes(){return this.selectedElementType?this.workflowTypes.filter("HISTORY_WORKFLOW"===this.selectedElementType||"TIME_TRACKING_HISTORY"===this.selectedElementType?t=>t.elementType===ve.Q8.WORKFLOW:t=>t.elementType===this.selectedElementType):this.workflowTypes}onElementTypeChange(){this.widgetForm&&(this.widgetForm.patchValue({workflowTypeId:null}),this.fieldOptions=[],this.numericFieldOptions=[],this.categoryFieldOptions=[],this.counterValueFieldOptions=[],this.filterFieldOptions=[],this.dateFieldOptions=[],this.filterValueOptions=[],this.selectedFilterValues=[]),this.elementTypeChanged.emit(this.selectedElementType)}constructor(t){this._fb=t,this.workflowTypes=[],this.dataSets=[],this.fieldMetadataCache=new Map,this.dataSetFieldMetadataCache=new Map,this.visible=!1,this.loadTenantUsersFn=null,this.parameters=[],this.saved=new e.bkB,this.closed=new e.bkB,this.loadFieldMetadata=new e.bkB,this.elementTypeChanged=new e.bkB,this._destroyed$=new ue.B7,this.fieldOptions=[],this.numericFieldOptions=[],this.categoryFieldOptions=[],this.counterValueFieldOptions=[],this.filterFieldOptions=[],this.dateFieldOptions=[],this.filterValueOptions=[],this.selectedFilterValues=[],this.filterValuesLoading=!1,this.paletteOptions=[],this.customColors=[],this.CUSTOM_PALETTE_ID=Pi,this.editingMappings=[],this.dataSourceType="workflow",this.dataSourceOptions=[{label:"Endpoint",value:"workflow"},{label:"Data Set",value:"dataset"}],this.DashboardWidgetType=w.v2,this.elementTypeOptions=[{label:"Element: Workflow",value:ve.Q8.WORKFLOW},{label:"Element: Master Data",value:ve.Q8.MASTERDATA},{label:"Element: Documents",value:ve.Q8.DOCUMENT},{label:"Element: System Data",value:ve.Q8.SYSTEMDATA},{label:"History: Workflow",value:"HISTORY_WORKFLOW"},{label:"Time Tracking: History",value:"TIME_TRACKING_HISTORY"}],this.selectedElementType=ve.Q8.WORKFLOW,this.aggregateOptions=[{label:"Count",value:"count"},{label:"Sum",value:"sum"},{label:"Average",value:"avg"},{label:"Min",value:"min"},{label:"Max",value:"max"}],this.comparisonOptions=[{label:"None",value:w.JU.None}
1,{label:"Previous Period",value:w.JU.PreviousPeriod},{label:"Previous Month",value:w.JU.PreviousMonth},{label:"Previous Year",value:w.JU.PreviousYear}],this.selectedGridColumns=[],this.columnFormats=new Map,this.showFormatDialog=!1,this.editingFormatColumn=null,this.editingFormatIsNumeric=!1}ngOnInit(){this.paletteOptions=[...pd.map(t=>({label:t.label,value:t.id})),{label:"Custom\u2026",value:Pi}],this.initForm()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}ngOnChanges(t){t.widget&&this.widget&&(this.dataSourceType=this.widget.dataSetId?"dataset":"workflow",this.restoreElementType(),this.editingMappings=this.widget.parameterMappings?[...this.widget.parameterMappings]:[],this.initForm(),"dataset"===this.dataSourceType?this.loadFieldsForDataSet(this.widget.dataSetId):this.loadFieldsForWorkflow(this.widget.workflowTypeId)),t.workflowTypes&&this.widget?.workflowTypeId&&this.restoreElementType()}restoreElementType(){if(this.widget?.endpointType)this.selectedElementType=this.widget.endpointType;else if(this.widget?.workflowTypeId&&this.workflowTypes.length>0){const t=this.workflowTypes.find(n=>n.workflowTypeId===this.widget.workflowTypeId);t?.elementType&&(this.selectedElementType=t.elementType)}}initForm(){if(!this.widget)return;const t={title:[this.widget.title,[R.k0.required,R.k0.maxLength(100)]],workflowTypeId:[this.widget.workflowTypeId],dataSetId:[this.widget.dataSetId||null],dateField:[this.widget.dateField||"createdDate"]};let n={};switch(this.widget.type){case w.v2.Counter:const o=this.widget;this.selectedFilterValues=o.filterValue?o.filterValue.split(",").map(c=>c.trim()).filter(c=>c):[],n={valueField:[o.valueField||"",R.k0.required],aggregate:[o.aggregate||"count",R.k0.required],filterField:[o.filterField||""],comparison:[o.comparison||w.JU.None],prefix:[o.prefix||""],suffix:[o.suffix||""],format:[o.format||""]},o.filterField&&(o.filterField===w.we&&this.loadTenantUsersFn?(this.filterValuesLoading=!0,this.loadTenantUsersFn().pipe((0,L.Q)(this._destroyed$)).subscribe({next:c=>{this.filterValueOptions=c||[],this.filterValuesLoading=!1},error:()=>{this.filterValuesLoading=!1}})):o.workflowTypeId&&this.loadDistinctValuesFn&&(this.filterValuesLoading=!0,this.loadDistinctValuesFn(o.workflowTypeId,o.filterField).pipe((0,L.Q)(this._destroyed$)).subscribe({next:c=>{this.filterValueOptions=c||[],this.filterValuesLoading=!1},error:()=>{this.filterValuesLoading=!1}})));break;case w.v2.BarChart:case w.v2.LineChart:case w.v2.PieChart:case w.v2.DonutChart:case w.v2.AreaChart:case w.v2.FunnelChart:case w.v2.HeatMap:case w.v2.Sparkline:const r=this.widget;this.selectedFilterValues=r.filterValue?r.filterValue.split(",").map(c=>c.trim()).filter(c=>c):[],n={categoryField:[r.categoryField||"",R.k0.required],valueField:[r.valueField||"",R.k0.required],aggregate:[r.aggregate||"count",R.k0.required],filterField:[r.filterField||""],showLegend:[!1!==r.showLegend],showLabels:[!1!==r.showLabels],showTooltip:[!1!==r.showTooltip],colorPaletteId:[r.colorPaletteId||""]},this.customColors=r.colorPaletteId===Pi&&r.colorScheme?[...r.colorScheme]:[],r.filterField&&(r.filterField===w.we&&this.loadTenantUsersFn?(this.filterValuesLoading=!0,this.loadTenantUsersFn().pipe((0,L.Q)(this._destroyed$)).subscribe({next:c=>{this.filterValueOptions=c||[],this.filterValuesLoading=!1},error:()=>{this.filterValuesLoading=!1}})):r.workflowTypeId&&this.loadDistinctValuesFn&&(this.filterValuesLoading=!0,this.loadDistinctValuesFn(r.workflowTypeId,r.filterField).pipe((0,L.Q)(this._destroyed$)).subscribe({next:c=>{this.filterValueOptions=c||[],this.filterValuesLoading=!1},error:()=>{this.filterValuesLoading=!1}})));break;case w.v2.Grid:const s=this.widget;this.selectedGridColumns=(s.columns||[]).map(c=>c.field),this.columnFormats.clear();for(const c of s.columns||[])(c.aggregate||c.wrapText||c.numberFormat||null!=c.decimalPlaces)&&this.columnFormats.set(c.field,{aggregate:c.aggregate,wrapText:c.wrapText,numberFormat:c.numberFormat,decimalPlaces:c.decimalPlaces});n={pageSize:[s.pageSize||10,[R.k0.required,R.k0.min(5),R.k0.max(100)]],showFilters:[s.showFilters||!1]}}this.widgetForm=this._fb.group({...t,...n})}onDataSourceTypeChange(){if(this.fieldOptions=[],this.numericFieldOptions=[],this.categoryFieldOptions=[],this.counterValueFieldOptions=[],this.filterFieldOptions=[],this.dateFieldOptions=[],this.filterValueOptions=[],this.selectedFilterValues=[],"workflow"===this.dataSourceType){this.widgetForm?.patchValue({dataSetId:null});const t=this.widgetForm?.get("workflowTypeId")?.value;t&&this.loadFieldsForWorkflow(t)}else{this.widgetForm?.patchValue({workflowTypeId:null});const t=this.widgetForm?.get("dataSetId")?.value;t&&this.loadFieldsForDataSet(t)}}onWorkflowChange(t){this.loadFieldsForWorkflow(t.value),this.filterValueOptions=[],this.selectedFilterValues=[],this.dateFieldOptions=[]}
1onDataSetChange(t){this.loadFieldsForDataSet(t.value),this.filterValueOptions=[],this.selectedFilterValues=[],this.dateFieldOptions=[]}onFilterFieldChange(t){const n=t.value;if(this.filterValueOptions=[],this.selectedFilterValues=[],!n)return;if(n===w.we){if(!this.loadTenantUsersFn)return;return this.filterValuesLoading=!0,void this.loadTenantUsersFn().pipe((0,L.Q)(this._destroyed$)).subscribe({next:r=>{this.filterValueOptions=r||[],this.filterValuesLoading=!1},error:r=>{console.error("Error loading tenant users:",r),this.filterValuesLoading=!1}})}const o=this.widgetForm?.get("workflowTypeId")?.value;!o||!this.loadDistinctValuesFn||(this.filterValuesLoading=!0,this.loadDistinctValuesFn(o,n).pipe((0,L.Q)(this._destroyed$)).subscribe({next:r=>{this.filterValueOptions=r||[],this.filterValuesLoading=!1},error:r=>{console.error("Error loading filter values:",r),this.filterValuesLoading=!1}}))}loadFieldsForWorkflow(t){if(!t)return this.fieldOptions=[],this.numericFieldOptions=[],this.categoryFieldOptions=[],this.counterValueFieldOptions=[],this.filterFieldOptions=[],void(this.dateFieldOptions=[]);if("HISTORY_WORKFLOW"===this.selectedElementType)return void this.populateFieldOptions(this.getStagePresenceFieldMetadata());if("TIME_TRACKING_HISTORY"===this.selectedElementType)return void this.populateFieldOptions(this.getTimeTrackingFieldMetadata());const n=this.fieldMetadataCache.get(t);n?this.populateFieldOptions(n):(this.fieldOptions=[],this.numericFieldOptions=[],this.categoryFieldOptions=[],this.counterValueFieldOptions=[],this.filterFieldOptions=[],this.dateFieldOptions=[],this.loadFieldMetadataFn?this.loadFieldMetadataFn(t).pipe((0,L.Q)(this._destroyed$)).subscribe({next:o=>{this.populateFieldOptions(o)},error:o=>{console.error("Error loading field metadata:",o)}}):this.loadFieldMetadata.emit(t))}getStagePresenceFieldMetadata(){return{commonFields:[],elementFields:[{name:"instanceId",displayName:"Instance ID",type:"string"},{name:"relativeId",displayName:"Relative ID",type:"number"},{name:"stageId",displayName:"Stage ID",type:"number"},{name:"title",displayName:"Title",type:"string"},{name:"stageName",displayName:"Stage Name",type:"string"},{name:"startDate",displayName:"Start Date",type:"datetime"},{name:"endDate",displayName:"End Date",type:"datetime"},{name:"durationHours",displayName:"Duration (Hours)",type:"number"},{name:"currentStageId",displayName:"Current Stage ID",type:"number"},{name:"currentStageName",displayName:"Current Stage Name",type:"string"},{name:"isNewInStageDuringPeriod",displayName:"New In Stage During Perio
1d",type:"boolean"},{name:"url",displayName:"URL",type:"string"}]}}getTimeTrackingFieldMetadata(){return{commonFields:[],elementFields:[{name:"workflowId",displayName:"Workflow ID",type:"number"},{name:"workflowName",displayName:"Workflow Name",type:"string"},{name:"stageId",displayName:"Stage ID",type:"number"},{name:"stageName",displayName:"Stage Name",type:"string"},{name:"userId",displayName:"User ID",type:"number"},{name:"userName",displayName:"User Name",type:"string"},{name:"entries",displayName:"Entries",type:"number"},{name:"totalMinutes",displayName:"Total Minutes",type:"number"}]}}loadFieldsForDataSet(t){if(!t)return this.fieldOptions=[],this.numericFieldOptions=[],this.categoryFieldOptions=[],this.counterValueFieldOptions=[],this.filterFieldOptions=[],void(this.dateFieldOptions=[]);const n=this.dataSetFieldMetadataCache.get(t);n?this.populateFieldOptions(n):(this.fieldOptions=[],this.numericFieldOptions=[],this.categoryFieldOptions=[],this.counterValueFieldOptions=[],this.filterFieldOptions=[],this.dateFieldOptions=[],this.loadDataSetFieldMetadataFn&&this.loadDataSetFieldMetadataFn(t).pipe((0,L.Q)(this._destroyed$)).subscribe({next:o=>{this.populateFieldOptions(o)},error:o=>{console.error("Error loading data set field metadata:",o)}}))}populateFieldOptions(t){const n=[...t.commonFields||[],...t.elementFields||[]];this.fieldOptions=n.map(o=>({label:o.displayName,value:o.name,fieldType:o.type})),this.numericFieldOptions=n.filter(o=>this.isNumericField(o)).map(o=>({label:o.displayName,value:o.name,fieldType:o.type})),this.numericFieldOptions.unshift({label:"Record Count",value:"*",fieldType:"count"}),this.counterValueFieldOptions=[{label:"Record Count",value:"*",fieldType:"count"},...n.map(o=>({label:o.displayName,value:o.name,fieldType:o.type}))],this.categoryFieldOptions=n.filter(o=>this.isCategoryField(o)).map(o=>({label:o.displayName,value:o.name,fieldType:o.type})),this.dateFieldOptions=[{label:"Created Date (default)",value:"createdDate",fieldType:"datetime"},{label:"Modified Date",value:"modifiedDate",fieldType:"datetime"},...n.filter(o=>"datetime"===o.type&&"createdDate"!==o.name&&"modifiedDate"!==o.name).map(o=>({label:o.displayName,value:o.name,fieldType:o.type}))],this.filterFieldOptions=n.filter(o=>this.isFilterableField(o)).map(o=>({label:o.displayName,value:o.name,fieldType:o.type}))}isFilterableField(t){return["string","text","lookup","dropdown","status"].includes(t.type?.toLowerCase()||"")}isNumericField(t){return["number","decimal","currency","integer","double","float"].includes(t.type?.toLowerCase()||"")}isCategoryField(t){return["string","text","lookup","dropdown","status","boolean","date"].includes(t.type?.toLowerCase()||"")}onGridColumnToggle(t,n){n?this.selectedGridColumns.includes(t)||this.selectedGridColumns.push(t):(this.selectedGridColumns=this.selectedGridColumns.filter(o=>o!==t),this.columnFormats.delete(t))}isGridColumnSelected(t){return this.selectedGridColumns.includes(t)}isNumericFieldOption(t){const n=this.fieldOptions.find(r=>r.value===t);return!!n&&["number","decimal","currency","integer","double","float"].includes(n.fieldType?.toLowerCase()||"")}openColumnFormatDialog(t){const n=this.columnFormats.get(t.value)||{};this.editingFormatColumn={field:t.value,title:t.label,aggregate:n.aggregate,wrapText:n.wrapText,numberFormat:n.numberFormat,decimalPlaces:n.decimalPlaces},this.editingFormatIsNumeric=this.isNumericFieldOption(t.value),this.showFormatDialog=!0}onFormatSaved(t){this.columnFormats.set(t.field,{aggregate:t.aggregate,wrapText:t.wrapText,numberFormat:t.numberFormat,decimalPlaces:t.decimalPlaces}),this.showFormatDialog=!1,this.editingFormatColumn=null}onFormatDialogClosed(){this.showFormatDialog=!1,this.editingFormatColumn=null}hasColumnFormatSettings(t){const n=this.columnFormats.get(t);return!!n&&!!(n.aggregate||n.wrapText||n.numberFormat||null!=n.decimalPlaces)}getDialogHeader(){switch(this.widget?.type){case w.v2.Counter:return"Configure Counter Widget";case w.v2.BarChart:return"Configure Bar Chart";case w.v2.LineChart:return"Configure Line Chart";case w.v2.PieChart:return"Configure Pie Chart";case w.v2.DonutChart:return"Configure Donut Chart";case w.v2.AreaChart:return"Configure Area Chart";case w.v2.HeatMap:return"Configure Heat Map";case w.v2.FunnelChart:return"Configure Funnel Chart";case w.v2.Sparkline:return"Configure Sparkline";case w.v2.Grid:return"Configure Data Grid";case w.v2.TimeTracker:return"Configure Time Tracker";default:return"Configure Widget"}}asTimeTrackerWidget(t){return t}
1isChartWidget(){return[w.v2.BarChart,w.v2.LineChart,w.v2.PieChart,w.v2.DonutChart,w.v2.AreaChart,w.v2.FunnelChart,w.v2.HeatMap,w.v2.Sparkline].includes(this.widget?.type)}isPaletteCapableChart(){return[w.v2.BarChart,w.v2.PieChart,w.v2.DonutChart].includes(this.widget?.type)}getPaletteColors(t){if(!t||t===Pi)return[];const n=pd.find(o=>o.id===t);return n?n.colors:[]}addCustomColor(){this.customColors=[...this.customColors,"#1976d2"]}removeCustomColor(t){this.customColors=this.customColors.filter((n,o)=>o!==t)}onCustomColorChange(t,n){this.customColors=this.customColors.map((o,r)=>r===t?n:o)}trackByIndex(t){return t}onSave(){if(this.widgetForm.invalid)return void this.widgetForm.markAllAsTouched();if("workflow"===this.dataSourceType&&!this.widgetForm.get("workflowTypeId")?.value)return void this.widgetForm.get("workflowTypeId")?.markAsTouched();if("dataset"===this.dataSourceType&&!this.widgetForm.get("dataSetId")?.value)return void this.widgetForm.get("dataSetId")?.markAsTouched();const t=this.widgetForm.value;let n;const o=this.editingMappings.filter(c=>c.widgetFieldName),s={id:this.widget.id,type:this.widget.type,title:t.title,workflowTypeId:"workflow"===this.dataSourceType?t.workflowTypeId:0,dataSetId:"dataset"===this.dataSourceType?t.dataSetId:void 0,endpointType:"HISTORY_WORKFLOW"===this.selectedElementType||"TIME_TRACKING_HISTORY"===this.selectedElementType?this.selectedElementType:void 0,dateField:t.dateField||"createdDate",col:this.widget.col,row:this.widget.row,colSpan:this.widget.colSpan,rowSpan:this.widget.rowSpan,parameterMappings:o.length>0?o:void 0};switch(this.widget.type){case w.v2.Counter:const c=this.selectedFilterValues.length>0?this.selectedFilterValues.join(","):void 0;n={...s,valueField:t.valueField,aggregate:t.aggregate,filterField:t.filterField||void 0,filterValue:c,comparison:t.comparison,prefix:t.prefix,suffix:t.suffix,format:t.format};break;case w.v2.BarChart:case w.v2.LineChart:case w.v2.PieChart:case w.v2.DonutChart:case w.v2.AreaChart:case w.v2.FunnelChart:case w.v2.HeatMap:case w.v2.Sparkline:const u=this.selectedFilterValues.length>0?this.selectedFilterValues.join(","):void 0,g=t.colorPaletteId||void 0,b=g===Pi?this.customColors.map(D=>(D||"").trim()).filter(D=>/^#[0-9a-fA-F]{6}$/.test(D)):[];n={...s,categoryField:t.categoryField,valueField:t.valueField,aggregate:t.aggregate,filterField:t.filterField||void 0,filterValue:u,showLegend:t.showLegend,showLabels:t.showLabels,showTooltip:t.showTooltip,colorPaletteId:g,colorScheme:b.length>0?b:void 0};break;case w.v2.Grid:const k=this.selectedGridColumns.map(D=>{const V=this.fieldOptions.find(B=>B.value===D),U=this.columnFormats.get(D)||{};return{field:D,title:V?.label||this.toTitleCase(D),aggregate:U.aggregate,wrapText:U.wrapText,numberFormat:U.numberFormat,decimalPlaces:U.decimalPlaces}});n={...s,columns:k,pageSize:Number(t.pageSize)||25,showFilters:t.showFilters};break;default:n=s}this.saved.emit(n)}isParameterMapped(t){return this.editingMappings.some(n=>n.parameterId===t)}onParameterToggle(t,n){n?this.editingMappings.push({parameterId:t.id,widgetFieldName:""}):this.editingMappings=this.editingMappings.filter(o=>o.parameterId!==t.id)}onParameterFieldChange(t,n){const o=this.editingMappings.find(r=>r.parameterId===t);o&&(o.widgetFieldName=n)}getParameterMappedField(t){return this.editingMappings.find(n=>n.parameterId===t)?.widgetFieldName||""}onCancel(){this.closed.emit()}toTitleCase(t){return t.replace(/([A-Z])/g," $1").replace(/_/g," ").replace(/^./,n=>n.toUpperCase()).trim()}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(R.ok))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-widget-configurator"]],inputs:{widget:"widget",workflowTypes:"workflowTypes",dataSets:"dataSets",fieldMetadataCache:"fieldMetadataCache",dataSetFieldMetadataCache:"dataSetFieldMetadataCache",visible:"visible",loadFieldMetadataFn:"loadFieldMetadataFn",loadDataSetFieldMetadataFn:"loadD
1ataSetFieldMetadataFn",loadDistinctValuesFn:"loadDistinctValuesFn",loadTenantUsersFn:"loadTenantUsersFn",parameters:"parameters"},outputs:{saved:"saved",closed:"closed",loadFieldMetadata:"loadFieldMetadata",elementTypeChanged:"elementTypeChanged"},features:[e.OA$],decls:5,vars:10,consts:[[3,"visibleChange","onHide","header","visible","modal","closable"],[3,"widget","saved","closed",4,"ngIf"],["class","widget-config-form",3,"formGroup",4,"ngIf"],["pTemplate","footer"],[3,"visible","column","isNumeric","saved","closed",4,"ngIf"],[3,"saved","closed","widget"],[1,"widget-config-form",3,"formGroup"],[1,"form-section"],[1,"form-field"],["for","title"],["id","title","type","text","pInputText","","formControlName","title","placeholder","Enter widget title"],["class","p-error",4,"ngIf"],["class","form-field",4,"ngIf"],[4,"ngIf"],["class","form-section",4,"ngIf"],[1,"p-error"],[1,"data-source-toggle"],["class","toggle-option",3,"active",4,"ngFor","ngForOf"],[1,"toggle-option"],["type","radio",3,"ngModelChange","change","value","ngModel","ngModelOptions"],["for","elementType"],["id","elementType","optionLabel","label","optionValue","value","placeholder","Select endpoint type",3,"ngModelChange","onChange","options","ngModel","ngModelOptions"],[1,"help-text"],["for","workflow"],["id","workflow","formControlName","workflowTypeId","optionLabel","name","optionValue","workflowTypeId","placeholder","Select an endpoint","filterBy","name",3,"onChange","options","filter"],["for","dataSet"],["id","dataSet","formControlName","dataSetId","optionLabel","name","optionValue","dataSetId","placeholder","Select a data set","filterBy","name",3,"onChange","options","filter","showClear"],["pTemplate","item"],[1,"dataset-option"],[1,"name"],[1,"detail"],["for","dateField"],["id","dateField","formControlName","dateField","optionLabel","label","optionValue","value","placeholder","Select date field for filtering",3,"options"],["for","aggregate"],["id","aggregate","formControlName","aggregate","optionLabel","label","optionValue","value",3,"options"],["for","valueField"],["id","valueField","formControlName","valueField","optionLabel","label","optionValue","value","placeholder","Select field to aggregate",3,"options","filter"],[1,"filter-section"],[1,"filter-section-header"],[1,"filter-section-desc"],["for","filterField"],["id","filterField","formControlName","filterField","optionGroupLabel","label","optionGroupChildren","items","optionLabel","label","optionValue","value","placeholder","Select field to filter",3,"onChange","options","group","showClear","filter"],["class","filter-section",4,"ngIf"],["for","comparison"],["id","comparison","formControlName","comparison","optionLabel","label","optionValue","value",3,"options"],[1,"form-row"],["for","prefix"],["id","prefix","type","text","pInputText","","formControlName","prefix","placeholder","e.g., $"],["for","suffix"],["id","suffix","type","text","pInputText","","formControlName","suffix","placeholder","e.g., %"],["for","filterValue"],[3,"ngModelChange","data","ngModel","ngModelOptions","filterable","autoClose","loading","placeholder"],[1,"parameter-toggle-list"],["class","parameter-toggle-row",4,"ngFor","ngForOf"],[1,"parameter-toggle-row"],[3,"onChange","binary","ngModel","ngModelOptions","inputId"],[1,"param-toggle-label",3,"for"],[1,"param-toggle-name"],["optionLabel","label","optionValue","value","placeholder","Map to field...","class","param-field-dropdown",3,"options","ngModel","ngModelOptions","filter","ngModelChange",4,"ngIf"],["optionLabel","label","optionValue","value","placeholder","Map to field...",1,"param-field-dropdown",3,"ngModelChange","options","ngModel","ngModelOptions","filter"],["for","categoryField"],["id","categoryField","formControlName","categoryField","optionLabel","label","optionValue","value","placeholder","Select category field",3,"options","filter"],["id","valueField","formControlName","valueField","optionLabel","label","optionValue","value","placeholder","Select value field",3,"options","filter"],["for","chartFilterField"],["id","chartFilterField","formControlName","filterField","optionGroupLabel","label","optionGroupChildren","items","optionLabel","label","optionValue","value","placeholder","Select field to filter",3,"onChange","options","group","showClear","filter"],[1,"form-section-inline"],[1,"checkbox-field"],["formControlName","showLegend","inputId","showLegend",3,"binary"],["for","showLegend"],["formControlName","showLabels","inputId","showLabels",3,"binary"],["for","showLabels"],["class","form-field color-palette-field",4,"ngIf"],["for","chartFilterValue"],[1,"form-field","color-palette-field"],["for","colorPaletteId"],["id","colorPaletteId","formControlName","colorPaletteId","optionLabel","label","optionValue","value","placeholder","Default colors",3,"options","showClear"],["class","palette-preview",4,"ngIf"],["class","custom-color-list",4,"ngIf"],[1,"palette-preview"],["class","palette-swatch",3,"background-color",4,"ngFor","ngForOf","ngForTrackBy"],[1,"palette-swatch"],[1,"custom-color-list"],["class","custom-color-row",4,"ngFor","ngForOf","ngForTrackBy"],["type","button",1,"custom-color-add",3,"click"],[1,"mdi","mdi-plus"],[1,"custom-color-row"],["format","hex",3,"valueChange","value"],["type","button",1,"custom-color-remove",3,"click"],[1,"mdi","mdi-close"],[1,"column-list"],["class","no-fields",4,"ngIf"],["class","column-option",4,"ngFor","ngForOf"],["for","pageSize"],["id","pageSize","formControlName","pageSize",3,"min","max","showButtons"],[1,"form-field","checkbox-inline"],["formControlName","showFilters","inputId","showFilters",3,"binary"],["for","showFilters"],[1,"n
1o-fields"],[1,"column-option"],[1,"column-option-header"],[3,"for"],["class","format-icon","title","Column format settings",3,"has-settings","click",4,"ngIf"],["title","Column format settings",1,"format-icon",3,"click"],[1,"mdi","mdi-cog"],["type","button","title","Cancel",1,"button","button_outline",3,"click"],["type","button","title","Save Widget",1,"button","button_colorSuccess",3,"click"],[1,"mdi","mdi-check","buttonIcon_right"],[3,"saved","closed","visible","column","isNumeric"]],template:function(n,o){1&n&&(e.j41(0,"p-dialog",0),e.mxI("visibleChange",function(s){return e.DH7(o.visible,s)||(o.visible=s),s}),e.bIt("onHide",function(){return o.onCancel()}),e.DNE(1,GS,1,1,"cad-time-tracker-configurator",1)(2,gk,16,9,"form",2)(3,fk,1,1,"ng-template",3),e.k0s(),e.DNE(4,Ck,1,3,"cad-column-format-dialog",4)),2&n&&(e.Aen(e.lJ4(9,NS)),e.Y8G("header",o.getDialogHeader()),e.R50("visible",o.visible),e.Y8G("modal",!0)("closable",!0),e.R7$(),e.Y8G("ngIf",(null==o.widget?null:o.widget.type)===o.DashboardWidgetType.TimeTracker),e.R7$(),e.Y8G("ngIf",o.widgetForm&&(null==o.widget?null:o.widget.type)!==o.DashboardWidgetType.TimeTracker),e.R7$(2),e.Y8G("ngIf",o.showFormatDialog&&o.editingFormatColumn))},dependencies:[M.Sq,M.bT,R.qT,R.me,R.Fm,R.BC,R.cb,R.vS,R.j4,R.JD,ke.Ei,ut.Sc,_t.l,Le.ms,Io.YI,_e.S,je.h_,ee.C3,at.b3,ku,PS],styles:[".widget-config-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.form-section[_ngcontent-%COMP%]{padding-bottom:1rem;border-bottom:1px solid var(--surface-border)}.form-section[_ngcontent-%COMP%]:last-child{border-bottom:none;padding-bottom:0}.form-section[_ngcontent-%COMP%]   h5[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:.875rem;font-weight:600;color:var(--text-color);text-transform:uppercase;letter-spacing:.5px}.form-field[_ngcontent-%COMP%]{margin-bottom:1rem}.form-field[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:var(--text-color)}.form-field[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]{width:100%}.form-field[_ngcontent-%COMP%]     .p-dropdown, .form-field[_ngcontent-%COMP%]     .p-inputnumber{width:100%}.form-field[_ngcontent-%COMP%]   .p-error[_ngcontent-%COMP%]{display:block;margin-top:.25rem}.form-field[_ngcontent-%COMP%]   .help-text[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.75rem;color:var(--text-color-secondary)}.form-row[_ngcontent-%COMP%]{display:flex;gap:1rem}.form-row[_ngcontent-%COMP%]   .form-field[_ngcontent-%COMP%]{flex:1}.form-section-inline[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1.5rem;margin-top:.5rem}.checkbox-field[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.checkbox-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0;font-weight:400;cursor:pointer}.checkbox-inline[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding-top:1.75rem}.checkbox-inline[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0;font-weight:400}.data-source-toggle[_ngcontent-%COMP%]{display:flex;gap:0;border:1px solid var(--surface-border);border-radius:6px;overflow:hidden}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;justify-content:center;padding:8px 12px;cursor:pointer;font-size:13px;font-weight:500;color:var(--text-color-secondary);background:var(--surface-card);transition:all .2s;border-right:1px solid var(--surface-border)}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option[_ngcontent-%COMP%]:last-child{border-right:none}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option.active[_ngcontent-%COMP%]{background:var(--primary-color);color:#fff}.data-source-toggle[_ngcontent-%COMP%]   .toggle-option[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]{display:none}.dataset-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.dataset-option[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{font-weight:500}.dataset-option[_ngcontent-%COMP%]   .detail[_ngcontent-%COMP%]{font-size:.75rem;color:var(--text-color-secondary)}.column-list[_ngcontent-%COMP%]{max-height:350px;overflow-y:auto;border:1px solid var(--surface-border);border-radius:6px;padding:.5rem;background:var(--surface-ground)}.column-list[_ngcontent-%COMP%]   .no-fields[_ngcontent-%COMP%]{padding:1rem;text-align:center;color:var(--text-color-secondary);font-size:.875rem}.filter-section[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;border:1px solid var(--surface-border);border-radius:6px;background:var(--surface-ground)}.filter-section[_ngcontent-%COMP%]   .filter-section-header[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:700;color:var(--text-color);margin-bottom:.25rem}.filter-section[_ngcontent-%COMP%]   .filter-section-desc[_ngcontent-%COMP%]{display:block;font-size:.75rem;color:var(--text-color-secondary);margin-bottom:.75rem}.filter-section[_ngcontent-%COMP%]   .form-field[_ngcontent-%COMP%]:last-child{margin-bottom:0}.parameter-toggle-list[_ngcontent-%COMP%]{padding:0}.parameter-toggle-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem;border-radius:4px;flex-wrap:wrap}.parameter-toggle-row[_ngcontent-%COMP%]:hover{background:var(--surface-hover)}.parameter-toggle-row[_ngcontent-%COMP%]     .param-field-dropdown{flex:1;min-width:150px}.parameter-toggle-row[_ngcontent-%COMP%]     .param-field-dropdown .p-dropdown{width:100%}.param-toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;margin:0!important;font-weight:400!important;white-space:nowrap}
1.param-toggle-label[_ngcontent-%COMP%]   .param-toggle-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--text-color)}.color-palette-field[_ngcontent-%COMP%]   .palette-preview[_ngcontent-%COMP%]{display:flex;gap:.25rem;margin-top:.5rem}.color-palette-field[_ngcontent-%COMP%]   .palette-swatch[_ngcontent-%COMP%]{display:inline-block;width:1.25rem;height:1.25rem;border-radius:3px;border:1px solid var(--surface-border, #d1d5db)}.color-palette-field[_ngcontent-%COMP%]   .custom-color-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;margin-top:.5rem}.color-palette-field[_ngcontent-%COMP%]   .custom-color-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.color-palette-field[_ngcontent-%COMP%]   .custom-color-remove[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:1px solid var(--surface-border, #d1d5db);border-radius:3px;background:var(--surface-0, #ffffff);color:var(--text-color-secondary);cursor:pointer}.color-palette-field[_ngcontent-%COMP%]   .custom-color-remove[_ngcontent-%COMP%]:hover{background:var(--surface-100, #f3f4f6);color:var(--text-color)}.color-palette-field[_ngcontent-%COMP%]   .custom-color-add[_ngcontent-%COMP%]{align-self:flex-start;display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .75rem;border:1px dashed var(--surface-border, #d1d5db);border-radius:3px;background:transparent;color:var(--text-color);cursor:pointer;font-size:.875rem}.color-palette-field[_ngcontent-%COMP%]   .custom-color-add[_ngcontent-%COMP%]:hover{background:var(--surface-100, #f3f4f6)}.column-option[_ngcontent-%COMP%]{padding:.5rem;border-radius:4px}.column-option[_ngcontent-%COMP%]:hover{background:var(--surface-hover)}.column-option[_ngcontent-%COMP%]   .column-option-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.column-option[_ngcontent-%COMP%]   .column-option-header[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{margin:0;font-weight:400;cursor:pointer;font-size:.875rem}.column-option[_ngcontent-%COMP%]   .column-option-header[_ngcontent-%COMP%]   .format-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;margin-left:auto;color:var(--text-color-secondary);cursor:pointer;font-size:1rem;transition:color .2s}.column-option[_ngcontent-%COMP%]   .column-option-header[_ngcontent-%COMP%]   .format-icon[_ngcontent-%COMP%]:hover, .column-option[_ngcontent-%COMP%]   .column-option-header[_ngcontent-%COMP%]   .format-icon.has-settings[_ngcontent-%COMP%]{color:#2196f3}"]})}}return i})();const bk=["tileLayout"],Ru=()=>({standalone:!0}),Tk=i=>({count:i}),Ek=()=>[];function Sk(i,a){1&i&&e.nrm(0,"i",15)}function kk(i,a){1&i&&e.nrm(0,"i",16)}function Rk(i,a){1&i&&(e.j41(0,"div",17),e.nrm(1,"kendo-loader",18),e.j41(2,"span"),e.EFF(3,"Loading..."),e.k0s()())}function Ik(i,a){1&i&&(e.j41(0,"small",46),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"AD_HOC_REPORTS.DASHBOARD_BUILDER.NAME_REQUIRED")," "))}function yk(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",47),e.nI1(1,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.predefinedDateRange,o)||(r.predefinedDateRange=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("options",t.predefinedDateOptions),e.R50("ngModel",t.predefinedDateRange),e.Y8G("ngModelOptions",e.lJ4(6,Ru))("placeholder",e.bMT(1,4,"AD_HOC_REPORTS.DASHBOARD_BUILDER.SELECT_DATE_RANGE"))}}function wk(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",23)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div",48)(5,"p-calendar",49),e.nI1(6,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.dashboardConfig.dateFrom,o)||(r.dashboardConfig.dateFrom=o),e.Njj(o)}),e.k0s(),e.j41(7,"span",50),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.j41(10,"p-calendar",49),e.nI1(11,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.dashboardConfig.dateTo,o)||(r.dashboardConfig.dateTo=o),e.Njj(o)}),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,8,"AD_HOC_REPORTS.DASHBOARD_BUILDER.DATE_RANGE")),e.R7$(3),e.R50("ngModel",t.dashboardConfig.dateFrom),e.Y8G("showIcon",!0)("placeholder",e.bMT(6,10,"AD_HOC_REPORTS.DASHBOARD_BUILDER.FROM")),e.R7$(3),e.JRh(e.bMT(9,12,"AD_HOC_REPORTS.DASHBOARD_BUILDER.TO")),e.R7$(2),e.R50("ngModel",t.dashboardConfig.dateTo),e.Y8G("showIcon",!0)("placeholder",e.bMT(11,14,"AD_HOC_REPORTS.DASHBOARD_BUILDER.TO"))}}function Dk(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",53)(1,"div",54)(2,"span",55),e.EFF(3),e.k0s(),e.j41(4,"span",56),e.EFF(5),e.k0s()(),e.j41(6,"div",57)(7,"button",58),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onEditParameter(o))}),e.nrm(8,"i",59),e.k0s(),e.j41(9,"button",60),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onDeleteParameter(o))}),e.nrm(10,"i",61),e.k0s()()()}if(2&i){const t=a.$implicit;e.R7$(3),e.JRh(t.name),e.R7$(2),e.JRh(t.parameterType)}}function Ok(i,a){if(1&i&&(e.j41(0,"div",51),e.DNE(1,Dk,11,2,"div",52),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.dashboardConfig.parameters)}}function xk(i,a){1&i&&(e.j41(0,"div",62)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.JRh(e.bMT(3,1,"AD_HOC_REPORTS.DASHBOARD_BUILDER.NO_PARAMETERS")))}function Mk(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",63),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2);return e.Njj(r.onAddWidget(o.value))}),e.j41(1,"div",64),e.nrm(2,"i"),e.k0s(),e.j41(3,"div",65)(4,"span",66),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"span",67),e.EFF(8),e.nI1(9,"translate"),e.k0s()(),e.nrm(10,"i",68),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(2),e.HbH(t.icon),e.R7$(3),e.JRh(e.bMT(6,4,t.label)),e.R7$(3),e.JRh(e.bMT(9,6,t.description))}}function Fk(i,a){1&i&&(e.j41(0,"div",69),e.nrm(1,"i",70),e.j41(2,"h4"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"AD_HOC_REPORTS.DASHBOARD_BUILDER.NO_WIDGETS")),e.R7$(3),e.JRh(e.bMT(7,4,"AD_HOC_REPORTS.DASHBOARD_BUILDER.NO_WIDGETS_HINT")))}function Pk(i,a){if(1&i&&e.nrm(0,"i",84),2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.Y8G("pTooltip",n.getFilterTooltip(t))}}function Nk(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-tilelayout-item",73)(1,"kendo-tilelayout-item-header")(2,"div",74)(3,"div",75),e.nrm(4,"i"),e.j41(5,"span",76),e.EFF(6),e.k0s(),e.DNE(7,Pk,1,1,"i",77
1),e.k0s(),e.j41(8,"div",78)(9,"button",79),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onEditWidget(o))}),e.nrm(10,"i",59),e.k0s(),e.j41(11,"button",80),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onDeleteWidget(o))}),e.nrm(12,"i",61),e.k0s()()()(),e.j41(13,"kendo-tilelayout-item-body")(14,"div",81)(15,"div",82),e.nrm(16,"i"),e.j41(17,"span"),e.EFF(18),e.nI1(19,"translate"),e.k0s()(),e.j41(20,"div",83),e.nrm(21,"i"),e.j41(22,"span"),e.EFF(23),e.k0s()()()()()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.Y8G("id",t.id)("col",t.col+1)("row",t.row+1)("colSpan",t.colSpan)("rowSpan",t.rowSpan),e.R7$(4),e.HbH(n.getWidgetTypeIcon(t.type)),e.R7$(2),e.JRh(t.title),e.R7$(),e.Y8G("ngIf",n.hasFilter(t)),e.R7$(9),e.HbH(n.getWidgetTypeIcon(t.type)),e.R7$(2),e.JRh(e.bMT(19,15,n.getWidgetTypeLabel(t.type))),e.R7$(3),e.HbH(t.dataSetId?"mdi mdi-database":"mdi mdi-sitemap"),e.R7$(2),e.JRh(n.getDataSourceName(t))}}function Gk(i,a){if(1&i){const t=e.RV6();e.j41(0,"kendo-tilelayout",71,0),e.bIt("reorder",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onTileReorder(o))})("resize",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onTileResize(o))}),e.DNE(2,Nk,24,17,"kendo-tilelayout-item",72),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("columns",t.dashboardConfig.columns)("rowHeight",t.dashboardConfig.rowHeight)("gap",t.dashboardConfig.gap)("resizable",!0)("reorderable",!0),e.R7$(2),e.Y8G("ngForOf",t.dashboardConfig.widgets)}}function Ak(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",19)(1,"div",20)(2,"p-card",21),e.nI1(3,"translate"),e.j41(4,"form",22)(5,"div",23)(6,"label",24),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.nrm(9,"input",25),e.nI1(10,"translate"),e.DNE(11,Ik,3,3,"small",26),e.k0s(),e.j41(12,"div",23)(13,"label",27),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.nrm(16,"textarea",28),e.nI1(17,"translate"),e.k0s()(),e.j41(18,"div",23)(19,"div",29)(20,"p-checkbox",30),e.nI1(21,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.usePredefinedDate,o)||(r.usePredefinedDate=o),e.Njj(o)}),e.k0s()(),e.DNE(22,yk,2,7,"p-dropdown",31),e.k0s(),e.DNE(23,wk,12,16,"div",32),e.k0s(),e.j41(24,"p-card",33),e.nI1(25,"translate"),e.DNE(26,Ok,2,1,"div",34)(27,xk,4,3,"div",35),e.j41(28,"button",36),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onAddParameter())}),e.nrm(29,"i",37),e.EFF(30),e.nI1(31,"translate"),e.k0s()(),e.j41(32,"p-card",38),e.nI1(33,"translate"),e.j41(34,"div",39),e.DNE(35,Mk,11,8,"div",40),e.k0s()()(),e.j41(36,"div",41)(37,"div",42)(38,"h3"),e.EFF(39),e.nI1(40,"translate"),e.k0s(),e.j41(41,"span",43),e.EFF(42),e.nI1(43,"translate"),e.k0s()(),e.DNE(44,Fk,8,6,"div",44)(45,Gk,3,6,"kendo-tilelayout",45),e.k0s()()}if(2&i){let t,n;const o=e.XpG();e.R7$(2),e.Y8G("header",e.bMT(3,25,"AD_HOC_REPORTS.DASHBOARD_BUILDER.SETTINGS_TITLE")),e.R7$(2),e.Y8G("formGroup",o.reportForm),e.R7$(3),e.SpI("",e.bMT(8,27,"AD_HOC_REPORTS.DASHBOARD_BUILDER.NAME_LABEL")," *"),e.R7$(2),e.AVh("ng-invalid",(null==(t=o.reportForm.get("name"))?null:t.invalid)&&(null==(t=o.reportForm.get("name"))?null:t.touched)),e.FS9("placeholder",e.bMT(10,29,"AD_HOC_REPORTS.DASHBOARD_BUILDER.NAME_PLACEHOLDER")),e.R7$(2),e.Y8G("ngIf",(null==(n=o.reportForm.get("name"))||null==n.errors?null:n.errors.required)&&(null==(n=o.reportForm.get("name"))?null:n.touched)),e.R7$(3),e.JRh(e.bMT(15,31,"AD_HOC_REPORTS.DASHBOARD_BUILDER.DESCRIPTION_LABEL")),e.R7$(2),e.FS9("placeholder",e.bMT(17,33,"AD_HOC_REPORTS.DASHBOARD_BUILDER.DESCRIPTION_PLACEHOLDER")),e.R7$(4),e.R50("ngModel",o.usePredefinedDate),e.Y8G("ngModelOptions",e.lJ4(48,Ru))("binary",!0)("label",e.bMT(21,35,"AD_HOC_REPORTS.DASHBOARD_BUILDER.PREDEFINED_DATE")),e.R7$(2),e.Y8G("ngIf",o.usePredefinedDate),e.R7$(),e.Y8G("ngIf",!o.usePredefinedDate),e.R7$(),e.Y8G("header",e.bMT(25,37,"AD_HOC_REPORTS.DASHBOARD_BUILDER.PARAMETERS")),e.R7$(2),e.Y8G("ngIf",null==o.dashboardConfig.parameters?null:o.dashboardConfig.parameters.length),e.R7$(),e.Y8G("ngIf",!(null!=o.dashboardConfig.parameters&&o.dashboardConfig.parameters.length)),e.R7$(3),e.SpI(" ",e.bMT(31,39,"AD_HOC_REPORTS.DASHBOARD_BUILDER.ADD_PARAMETER")," "),e.R7$(2),e.Y8G("header",e.bMT(33,41,"AD_HOC_REPORTS.DASHBOARD_BUILDER.ADD_WIDGET")),e.R7$(3),e.Y8G("ngForOf",o.widgetTypeOptions),e.R7$(4),e.JRh(e.bMT(40,43,"AD_HOC_REPORTS.DASHBOARD_BUILDER.PREVIEW_TITLE")),e.R7$(3),e.JRh(e.i5U(43,45,"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_COUNT",e.eq3(49,Tk,o.dashboardConfig.widgets.length))),e.R7$(2),e.Y8G("ngIf",0===o.dashboardConfig.widgets.length),e.R7$(),e.Y8G("ngIf",o.dashboardConfig.widgets.length>0)}}function Lk(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-widget-configurator",85),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onWidgetConfigured(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onWidgetDialogClosed())})("loadFieldMetadata",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.loadFieldMetadata(o))})("elementTypeChanged",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.loadWorkflowTypesByElementType(o))}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("widget",t.selectedWidget)("workflowTypes",t.workflowTypes)("dataSets",t.dataSets)("parameters",t.dashboardConfig.parameters||e.lJ4(11,Ek))("fieldMetadataCache",t.fieldMetadataCache)("dataSetFieldMetadataCache",t.dataSetFieldMetadataCache)("loadFieldMetadataFn",t.loadFieldMetadataCallback)("loadD
1ataSetFieldMetadataFn",t.loadDataSetFieldMetadataCallback)("loadDistinctValuesFn",t.loadDistinctValuesCallback)("loadTenantUsersFn",t.loadTenantUsersCallback)("visible",t.showWidgetDialog)}}function Bk(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-parameter-configurator",86),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onParameterSaved(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onParameterDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("parameter",t.editingParameter)("visible",t.showParameterDialog)("workflowTypes",t.workflowTypes)("loadFieldMetadataFn",t.loadFieldMetadataCallback)}}let Iu=(()=>{class i{constructor(t,n,o,r,s,c){this._router=t,this._route=n,this._fb=o,this._apiService=r,this._messagingService=s,this._translate=c,this._destroyed$=new ue.B7,this.workflowTypes=[],this.dataSets=[],this.fieldMetadataCache=new Map,this.dataSetFieldMetadataCache=new Map,this.dashboardConfig={columns:12,rowHeight:120,gap:16,widgets:[]},this.loading=!1,this.saving=!1,this.isEditMode=!1,this.reportId=null,this.report=null,this.selectedWidget=null,this.showWidgetDialog=!1,this.editingWidgetIndex=-1,this.showParameterDialog=!1,this.editingParameterIndex=-1,this.editingParameter=null,this.usePredefinedDate=!1,this.predefinedDateRange=null,this._savedEndpointParams={},this.predefinedDateOptions=[{label:"Current Week",value:"currentWeek"},{label:"Current Month",value:"currentMonth"},{label:"Current Quarter",value:"currentQuarter"},{label:"Current Year",value:"currentYear"}],this.widgetTypeOptions=[{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.COUNTER",value:w.v2.Counter,icon:"mdi mdi-pound",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.COUNTER"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.BAR_CHART",value:w.v2.BarChart,icon:"mdi mdi-chart-bar",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.BAR_CHART"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.LINE_CHART",value:w.v2.LineChart,icon:"mdi mdi-chart-line",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.LINE_CHART"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.AREA_CHART",value:w.v2.AreaChart,icon:"mdi mdi-chart-areaspline",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.AREA_CHART"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.PIE_CHART",value:w.v2.PieChart,icon:"mdi mdi-chart-pie",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.PIE_CHART"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.FUNNEL_CHART",value:w.v2.FunnelChart,icon:"mdi mdi-filter-variant",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.FUNNEL_CHART"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.HEAT_MAP",value:w.v2.HeatMap,icon:"mdi mdi-view-dashboard",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.HEAT_MAP"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.SPARKLINE",value:w.v2.Sparkline,icon:"mdi mdi-chart-timeline-variant",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.SPARKLINE"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.DATA_GRID",value:w.v2.Grid,icon:"mdi mdi-table",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.DATA_GRID"},{label:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.TIME_TRACKER",value:w.v2.TimeTracker,icon:"mdi mdi-timer",description:"AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_DESCRIPTIONS.TIME_TRACKER"}],this.loadDistinctValuesCallback=(u,g)=>this._apiService.getDistinctFieldValues(u,g),this.loadTenantUsersCallback=()=>this._apiService.getTenantUserNames(),this.loadDataSetFieldMetadataCallback=u=>{const g=this.dataSetFieldMetadataCache.get(u);return g?(0,le.of)(g):this._apiService.getDataSetFields(u).pipe((0,Te.M)(b=>{const k=new Map(this.dataSetFieldMetadataCache);k.set(u,b),this.dataSetFieldMetadataCache=k}))},this.loadFieldMetadataCallback=u=>{const g=this.fieldMetadataCache.get(u);return g?(0,le.of)(g):this._apiService.getFieldMetadata(u).pipe((0,Te.M)(b=>{const k=new Map(this.fieldMetadataCache);k.set(u,b),this.fieldMetadataCache=k}))},this.initForm()}ngOnInit(){this.reportId=this._route.snapshot.params.reportId,this.isEditMode=!!this.reportId,this.loadInitialData()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}initForm(){this.reportForm=this._fb.group({name:["",[R.k0.required,R.k0.maxLength(200)]],description:["",[R.k0.maxLength(1e3)]]})}loadInitialData(){this.loading=!0;const t={workflowTypes:this._apiService.getWorkflowTypes().pipe((0,ye.W)(n=>(console.error("Error loading workflow types:",n),(0,le.of)([])))),dataSets:this._apiService.getDataSets().pipe((0,ye.W)(()=>(0,le.of)([])))};this.isEditMode&&this.reportId&&(t.report=this._apiService.getReportById(this.reportId).pipe((0,ye.W)(n=>(console.error("Error loading report:",n),(0,le.of)(null))))),(0,vt.p)(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:n=>{this.workflowTypes=n.workflowTypes||[],this.dataSets=n.dataSets||[],this.isEditMode&&n.report&&(this.report=n.report,this.populateFormFromReport(n.report))},error:n=>{this._messagingService.error("Failed to load data","Error"),console.error("Error loading initial data:",n)}})}populateFormFromReport(t){if(this.reportForm.patchValue({name:t.name,description:t.description}),t.dashboardConfiguration)try{this.dashboardConfig=JSON.parse(t.dashboardConfiguration),this.dashboardConfig.parameters||(this.dashboardConfig.parameters=[]),this.dashboardConfig.widgets?.length>0&&this.hasOverlappingWidgets()&&(console.warn("Detected overlapping widgets in saved configuration, recalculating positions"),this.recalculateAllPositions())}catch(r){console.error("Error parsing dashboard configuration:",r)}if(t.endpointParameters)try{const r="string"==typeof t.endpointParameters?JSON.parse(t.endpointParameters):t.endpointParameters;this._savedEndpointParams=r,r.standardDateRange&&(this.usePredefinedDate=!0,this.predefinedDateRange=r.standardDateRange)}catch{}[...new Set(this.dashboardConfig.widgets.filter(r=>!r.dataSetId&&r.workflowTypeId).map(r=>
1r.workflowTypeId))].forEach(r=>this.loadFieldMetadata(r)),[...new Set(this.dashboardConfig.widgets.filter(r=>r.dataSetId).map(r=>r.dataSetId))].forEach(r=>this.loadDataSetFieldMetadataCallback(r).subscribe())}loadWorkflowTypesByElementType(t){this._apiService.getWorkflowTypes("HISTORY_WORKFLOW"===t||"TIME_TRACKING_HISTORY"===t?"WORKFLOW":t).pipe((0,L.Q)(this._destroyed$)).subscribe({next:o=>{this.workflowTypes=o},error:o=>{console.error("Error loading workflow types:",o)}})}loadFieldMetadata(t){this.fieldMetadataCache.has(t)||this._apiService.getFieldMetadata(t).pipe((0,L.Q)(this._destroyed$)).subscribe({next:n=>{const o=new Map(this.fieldMetadataCache);o.set(t,n),this.fieldMetadataCache=o},error:n=>{console.error("Error loading field metadata:",n)}})}getFieldMetadata(t){return this.fieldMetadataCache.get(t)}onAddWidget(t){const n=this.createDefaultWidget(t);this.selectedWidget=n,this.editingWidgetIndex=-1,this.showWidgetDialog=!0}onEditWidget(t){this.selectedWidget={...this.dashboardConfig.widgets[t]},this.editingWidgetIndex=t,this.showWidgetDialog=!0}onDeleteWidget(t){this.dashboardConfig.widgets.splice(t,1),this.recalculateAllPositions()}onWidgetConfigured(t){-1===this.editingWidgetIndex?(this.positionNewWidget(t),this.dashboardConfig.widgets.push(t)):(this.dashboardConfig.widgets[this.editingWidgetIndex]=t,this.recalculateAllPositions()),t.dataSetId?this.loadDataSetFieldMetadataCallback(t.dataSetId).subscribe():t.workflowTypeId&&this.loadFieldMetadata(t.workflowTypeId),this.showWidgetDialog=!1,this.selectedWidget=null,this.editingWidgetIndex=-1}onWidgetDialogClosed(){this.showWidgetDialog=!1,this.selectedWidget=null,this.editingWidgetIndex=-1}onTileReorder(t){setTimeout(()=>{this.syncWidgetPositionsFromEvent(t.items)})}onTileResize(t){setTimeout(()=>{this.syncWidgetPositionsFromEvent(t.items)})}syncWidgetPositionsFromEvent(t){!t||0===t.length||(t.forEach(n=>{const o=n.elem?.nativeElement?.id;if(!o)return;const r=this.dashboardConfig.widgets.find(s=>s.id===o);r&&(r.col=(n.col||1)-1,r.row=(n.row||1)-1,r.colSpan=n.colSpan||r.colSpan,r.rowSpan=n.rowSpan||r.rowSpan)}),this.hasOverlappingWidgets()&&this.recalculateAllPositions())}syncPositionsBeforeSave(){this.tileLayout?.items&&(this.tileLayout.items.toArray().forEach(n=>{const o=n.elem?.nativeElement?.id;if(!o)return;const r=this.dashboardConfig.widgets.find(s=>s.id===o);r&&(r.col=(n.col||1)-1,r.row=(n.row||1)-1,r.colSpan=n.colSpan||r.colSpan,r.rowSpan=n.rowSpan||r.rowSpan)}),this.hasOverlappingWidgets()&&this.recalculateAllPositions())}hasOverlappingWidgets(){const t=this.dashboardConfig.widgets;for(let n=0;n<t.length;n++)for(let o=n+1;o<t.length;o++)if(this.widgetsOverlap(t[n],t[o]))return!0;return!1}widgetsOverlap(t,n){return!(t.col+t.colSpan<=n.col||n.col+n.colSpan<=t.col||t.row+t.rowSpan<=n.row||n.row+n.rowSpan<=t.row)}recalculateAllPositions(){const t=this.dashboardConfig.columns,n=[],o=r=>{for(;n.length<=r;)n.push(new Array(t).fill(!1))};o(20),this.dashboardConfig.widgets.forEach(r=>{const s=this.findAvailablePosition(n,r.colSpan,r.rowSpan,t);r.col=s.col,r.row=s.row,o(s.row+r.rowSpan);for(let c=s.row;c<s.row+r.rowSpan;c++)for(let u=s.col;u<s.col+r.colSpan;u++)n[c][u]=!0})}positionNewWidget(t){const n=this.dashboardConfig.columns,o=[],r=c=>{for(;o.length<=c;)o.push(new Array(n).fill(!1))};r(20),this.dashboardConfig.widgets.forEach(c=>{r(c.row+c.rowSpan);for(let u=c.row;u<c.row+c.rowSpan;u++)for(let g=c.col;g<c.col+c.colSpan;g++)u<o.length&&g<n&&(o[u][g]=!0)});const s=this.findAvailablePosition(o,t.colSpan,t.rowSpan,n);t.col=s.col,t.row=s.row}findAvailablePosition(t,n,o,r){const s=c=>{for(;t.length<=c;)t.push(new Array(r).fill(!1))};for(let c=0;c<100;c++){s(c+o);for(let u=0;u<=r-n;u++)if(this.canPlaceWidget(t,u,c,n,o,r))return{col:u,row:c}}return{col:0,row:t.length}}canPlaceWidget(t,n,o,r,s,c){if(n+r>c)return!1;for(let u=o;u<o+s;u++)for(let g=n;g<n+r;g++)if(u>=t.length||t[u][g])return!1;return!0}createDefaultWidget(t){const n={id:this.generateWidgetId(),title:"New Widget",workflowTypeId:this.workflowTypes[0]?.workflowTypeId||0,dateField:"createdDate",col:0,row:0,colSpan:4,rowSpan:2};switch(t){case w.v2.Counter:return{...n,type:w.v2.Counter,title:"Counter",colSpan:3,rowSpan:1,valueField:"",aggregate:"count",comparison:w.JU.None};case w.v2.BarChart:case w.v2.LineChart:case w.v2.PieChart:case w.v2.DonutChart:case w.v2.AreaChart:case w.v2.FunnelChart:case w.v2.HeatMap:return{...n,type:t,title:this.getChartTitle(t),colSpan:6,rowSpan:3,categoryField:"",valueField:"",aggregate:"count",showLegend:!0,showLabels:!0,showTooltip:!0};case w.v2.Sparkline:return{...n,type:t,title:this.getChartTitle(t),colSpan:3,rowSpan:1,categoryField:"",valueField:"",aggregate:"count",showLegend:!1,showLabels:!1,showTooltip:!0};case w.v2.Grid:return{...n,type:w.v2.Grid,title:this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.DATA_GRID"),colSpan:6,rowSpan:3,columns:[],pageSize:10,showFilters:!1};case w.v2.TimeTracker:return{...n,type:w.v2.TimeTracker,title:this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.TIME_TRACKER"),colSpan:4,rowSpan:4,workflowTypeId:0,elementId:0,searchFieldName:"",surfacedFields:[]};default:throw new Error(`Unknown widget type: ${t}`)}}getChartTitle(t){switch(t){case w.v2.BarChart:return this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.BAR_CHART");case w.v2.LineChart:return this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.LINE_CHART");case w.v2.PieChart:case w.v2.DonutChart:return this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.PIE_CHART");case w.v2.AreaChart:return this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.AREA_CHART");case w.v2.HeatMap:return this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.HEAT_MAP");case w.v2.FunnelChart:return this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.FUNNEL_CHART");case w.v2.Sparkline:return this._translate.instant("AD_HOC_REPORTS.DASHBOARD_BUILDER.WIDGET_TYPES.SPARKLINE");default:return this._translate.instant("AD_HOC_REPORTS.CREATE_MODAL.TYPES.DASHBOARD")}}generateWidgetId(){return"widget-"+Date.now()+"-"+Math.random().toString(36).substr(2,9)}onAddParameter(){this.editingParameter={id:"param-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),name:"",workflowTypeId:0,fieldName:"",parameterType:"dropdown",required:!1},this.editingParameterIndex=-1,this.showParameterDialog=!0}onEditParameter(t){this.editingParameter={...this.dashboardConfig.parameters[t]},this.editingParameterIndex=t,this.showParameterDialog=!0}onDeleteParameter(t){const n=this.dashboardConfig.parameters[t].id;this.dashboardConfig.parameters.splice(t,1),this.dashboardConfig.widgets.forEac
1h(o=>{o.parameterMappings&&(o.parameterMappings=o.parameterMappings.filter(r=>r.parameterId!==n))})}onParameterSaved(t){this.dashboardConfig.parameters||(this.dashboardConfig.parameters=[]),this.editingParameterIndex>=0?this.dashboardConfig.parameters[this.editingParameterIndex]=t:this.dashboardConfig.parameters.push(t),this.showParameterDialog=!1,this.editingParameter=null}onParameterDialogClosed(){this.showParameterDialog=!1,this.editingParameter=null,this.editingParameterIndex=-1}onSave(){if(this.reportForm.invalid)return this.reportForm.markAllAsTouched(),void this._messagingService.warning("Please fill in all required fields","Validation");0!==this.dashboardConfig.widgets.length?this.doSave():this._messagingService.warning("Please add at least one widget to the dashboard","Validation")}doSave(){this.syncPositionsBeforeSave(),this.saving=!0;const t=this.reportForm.value,n=JSON.stringify(this.dashboardConfig),o={};this.usePredefinedDate&&this.predefinedDateRange?o.standardDateRange=this.predefinedDateRange:(this._savedEndpointParams.dateFrom&&(o.dateFrom=this._savedEndpointParams.dateFrom),this._savedEndpointParams.dateTo&&(o.dateTo=this._savedEndpointParams.dateTo)),this._savedEndpointParams.parameterValues&&(o.parameterValues=this._savedEndpointParams.parameterValues);const s=Object.keys(o).length>0?JSON.stringify(o):void 0;if(this.isEditMode&&this.reportId){const c={name:t.name,description:t.description,dashboardConfiguration:n};s&&(c.endpointParameters=s),this._apiService.updateReport(this.reportId,c).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:u=>{this._messagingService.success("Dashboard updated successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",u.adHocReportId])},error:u=>{this._messagingService.error("Failed to update dashboard","Error"),console.error("Error updating dashboard:",u)}})}else this._apiService.createReport({name:t.name,description:t.description,entityType:w.dX.Workflow,visualizationType:w.vi.Dashboard,dashboardConfiguration:n,endpointParameters:s}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:u=>{this._messagingService.success("Dashboard created successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",u.adHocReportId])},error:u=>{this._messagingService.error("Failed to create dashboard","Error"),console.error("Error creating dashboard:",u)}})}onCancel(){this._router.navigate(["/private/ad-hoc-reports"])}getWidgetTypeLabel(t){return this.widgetTypeOptions.find(o=>o.value===t)?.label||t}getWidgetTypeIcon(t){return this.widgetTypeOptions.find(o=>o.value===t)?.icon||"mdi mdi-view-dashboard-outline"}getWorkflowName(t){return this.workflowTypes.find(o=>o.workflowTypeId===t)?.name||this._translate.instant("GENERAL.UNKNOWN")}getDataSourceName(t){const n=t.dataSetId;return n?this.dataSets.find(r=>r.dataSetId===n)?.name||this._translate.instant("AD_HOC_REPORTS.DATA_GRID_BUILDER.DATA_SET"):this.getWorkflowName(t.workflowTypeId)}hasFilter(t){return t.type===w.v2.Counter&&!(!t.filterField||!t.filterValue)}getFilterTooltip(t){if(t.type===w.v2.Counter){const n=t;if(n.filterField&&n.filterValue)return`Filtered by ${n.filterField.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase()).trim()}: ${n.filterValue}`}return""}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(R.ok),e.rXU(Ye.F),e.rXU(q.Ui),e.rXU(nt.c$))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-dashboard-builder"]],viewQuery:function(n,o){if(1&n&&e.GBs(bk,5),2&n){let r;e.mGM(r=e.lsd())&&(o.tileLayout=r.first)}},decls:25,vars:27,consts:[["tileLayout",""],[1,"dashboard-builder-container"],[1,"builder-header"],[1,"header-title"],["type","button",1,"button","button_clear","button_colorAlt",3,"click","title"],[1,"mdi","mdi-arrow-left"],[1,"header-actions"],["type","button",1,"button","button_outline",3,"click","title"],["type","button",1,"button","button_colorSuccess",3,"click","title","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-content-save buttonIcon_right",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","builder-content",4,"ngIf"],[3,"widget","workflowTypes","dataSets","parameters","fieldMetadataCache","dataSetFieldMetadataCache","loadFieldMetadataFn","loadDataSetFieldMetadataFn","loadDistinctValuesFn","loadTenantUsersFn","visible","saved","closed","loadFieldMetadata","elementTypeChanged",4,"ngIf"],[3,"parameter","visible","workflowTypes","loadFieldMetadataFn","saved","closed",4,"ngIf"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-content-save","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[1,"builder-content"],[1,"settings-sidebar"],[3,"header"],[3,"formGroup"],[1,"form-field"],["for","name"],["id","name","type","text","pInputText","","formControlName","name",3,"placeholder"],["class","p-error",4,"ngIf"],["for","description"],["id","description","pInputTextarea","","formControlName","description","rows","2",3,"placeholder"],[1,"predefined-toggle"],[3,"ngModelChange","ngModel","ngModelOptions","binary","label"],["o
1ptionLabel","label","optionValue","value",3,"options","ngModel","ngModelOptions","placeholder","ngModelChange",4,"ngIf"],["class","form-field",4,"ngIf"],[1,"parameters-card",3,"header"],["class","parameter-list",4,"ngIf"],["class","no-parameters",4,"ngIf"],["type","button",1,"button","button_outline","button_sm","add-parameter-btn",3,"click"],[1,"mdi","mdi-plus"],[1,"add-widget-card",3,"header"],[1,"widget-type-list"],["class","widget-type-option",3,"click",4,"ngFor","ngForOf"],[1,"dashboard-canvas"],[1,"canvas-header"],[1,"widget-count"],["class","empty-canvas",4,"ngIf"],["class","widget-grid",3,"columns","rowHeight","gap","resizable","reorderable","reorder","resize",4,"ngIf"],[1,"p-error"],["optionLabel","label","optionValue","value",3,"ngModelChange","options","ngModel","ngModelOptions","placeholder"],[1,"date-range"],["dateFormat","mm/dd/yy","appendTo","body",3,"ngModelChange","ngModel","showIcon","placeholder"],[1,"date-separator"],[1,"parameter-list"],["class","parameter-item",4,"ngFor","ngForOf"],[1,"parameter-item"],[1,"parameter-info"],[1,"parameter-name"],[1,"parameter-type-badge"],[1,"parameter-actions"],["type","button","title","Edit Parameter",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil"],["type","button","title","Delete Parameter",1,"button","button_round","delete-btn",3,"click"],[1,"mdi","mdi-trash-can"],[1,"no-parameters"],[1,"widget-type-option",3,"click"],[1,"widget-icon"],[1,"widget-info"],[1,"widget-label"],[1,"widget-desc"],[1,"mdi","mdi-plus","add-icon"],[1,"empty-canvas"],[1,"mdi","mdi-view-dashboard"],[1,"widget-grid",3,"reorder","resize","columns","rowHeight","gap","resizable","reorderable"],[3,"id","col","row","colSpan","rowSpan",4,"ngFor","ngForOf"],[3,"id","col","row","colSpan","rowSpan"],[1,"widget-header"],[1,"widget-title-area"],[1,"widget-title"],["class","mdi mdi-filter filter-icon","tooltipPosition","top",3,"pTooltip",4,"ngIf"],[1,"widget-actions"],["type","button","title","Edit Widget","pTooltip","Edit Widget",1,"button","button_round",3,"click"],["type","button","title","Delete Widget","pTooltip","Delete Widget",1,"button","button_round","delete-btn",3,"click"],[1,"widget-preview"],[1,"widget-type-badge"],[1,"widget-workflow"],["tooltipPosition","top",1,"mdi","mdi-filter","filter-icon",3,"pTooltip"],[3,"saved","closed","loadFieldMetadata","elementTypeChanged","widget","workflowTypes","dataSets","parameters","fieldMetadataCache","dataSetFieldMetadataCache","loadFieldMetadataFn","loadDataSetFieldMetadataFn","loadDistinctValuesFn","loadTenantUsersFn","visible"],[3,"saved","closed","parameter","visible","workflowTypes","loadFieldMetadataFn"]],template:function(n,o){1&n&&(e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"button",4),e.nI1(4,"translate"),e.bIt("click",function(){return o.onCancel()}),e.nrm(5,"i",5),e.k0s(),e.j41(6,"h2"),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"div",6)(11,"button",7),e.nI1(12,"translate"),e.bIt("click",function(){return o.onCancel()}),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"button",8),e.nI1(16,"translate"),e.bIt("click",function(){return o.onSave()}),e.DNE(17,Sk,1,0,"i",9)(18,kk,1,0,"i",10),e.EFF(19),e.nI1(20,"translate"),e.k0s()()(),e.DNE(21,Rk,4,0,"div",11)(22,Ak,46,51,"div",12),e.k0s(),e.DNE(23,Lk,1,12,"cad-widget-configurator",13)(24,Bk,1,4,"cad-parameter-configurator",14)),2&n&&(e.R7$(3),e.Y8G("title",e.bMT(4,13,"GENERAL.GO_BACK")),e.R7$(4),e.SpI(" ",o.isEditMode?e.bMT(8,15,"AD_HOC_REPORTS.DASHBOARD_BUILDER.EDIT_TITLE"):e.bMT(9,17,"AD_HOC_REPORTS.DASHBOARD_BUILDER.NEW_TITLE")," "),e.R7$(4),e.Y8G("title",e.bMT(12,19,"GENERAL.CANCEL")),e.R7$(2),e.SpI(" ",e.bMT(14,21,"GENERAL.CANCEL")," "),e.R7$(2),e.Y8G("title",e.bMT(16,23,"AD_HOC_REPORTS.DASHBOARD_BUILDER.SAVE"))("disabled",o.saving),e.R7$(2),e.Y8G("ngIf",o.saving),e.R7$(),e.Y8G("ngIf",!o.saving),e.R7$(),e.SpI(" ",e.bMT(20,25,"AD_HOC_REPORTS.DASHBOARD_BUILDER.SAVE")," "),e.R7$(2),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading),e.R7$(),e.Y8G("ngIf",o.showWidgetDialog&&o.selectedWidget),e.R7$(),e.Y8G("ngIf",o.showParameterDialog&&o.editingParameter))},dependencies:[M.Sq,M.bT,R.qT,R.me,R.BC,R.cb,R.vS,R.j4,R.JD,ui.Vv,ut.Sc,Le.ms,_e.S,mt.Z,Mt.m,ee.C3,ht.iB,ht.fu,ht.ZP,ht.ML,ze.VU,_n,vk,Gn,nt.D9],styles:[".dashboard-builder-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:#fafafa}.builder-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.5rem;background:#fff;border-bottom:1px solid #dedede}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:#000}.builder-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px;gap:1rem;color:#7b7b7b}.builder-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.settings-sidebar[_ngcontent-%COMP%]{width:320px;min-width:320px;padding:1rem;background:#fff;border-right:1px solid #dedede;overflow-y:auto;display:flex;flex-direction:column;gap:1rem}.settings-sidebar[_ngcontent-%COMP%]     .p-card .p-card-header{padding:.75rem 1rem;background:#fafafa;font-weight:600;font-size:.875rem;border-bottom:1px solid #dedede}.settings-sidebar[_ngcontent-%COMP%]     .p-card .p-card-body{padding:1rem}.form-field[_ngcontent-%COMP%]{margin-bottom:1rem}.form-field[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:#000}.form-field[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]{width:100%}.form-field[_ngcontent-%COMP%]   .p-error[_ngcontent-%COMP%]{display:block;margin-top:.25rem}.date-range[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}
1.date-range[_ngcontent-%COMP%]   .date-separator[_ngcontent-%COMP%]{color:#7b7b7b;font-size:.875rem}.date-range[_ngcontent-%COMP%]     .p-calendar{flex:1}.date-range[_ngcontent-%COMP%]     .p-calendar input{width:100%}.parameters-card[_ngcontent-%COMP%]     .p-card-body{padding:.75rem!important}.parameter-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.75rem}.parameter-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.5rem .75rem;border-radius:6px;background:#fafafa}.parameter-item[_ngcontent-%COMP%]:hover{background:#f2f2f2}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-name[_ngcontent-%COMP%]{font-weight:500;font-size:.875rem;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-type-badge[_ngcontent-%COMP%]{font-size:.625rem;padding:.125rem .375rem;border-radius:10px;background:#5f84fc;color:#fff;text-transform:uppercase;font-weight:600;white-space:nowrap}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .button[_ngcontent-%COMP%]{color:#0009}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{background-color:transparent;border:none;color:#0009}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]:hover{background-color:#0000000a}.no-parameters[_ngcontent-%COMP%]{padding:.75rem;text-align:center;font-size:.8125rem;color:#7b7b7b;margin-bottom:.75rem}.add-parameter-btn[_ngcontent-%COMP%]{width:100%;justify-content:center;gap:.25rem}.add-widget-card[_ngcontent-%COMP%]     .p-card-body{padding:.5rem!important}.widget-type-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.widget-type-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.75rem;border-radius:6px;cursor:pointer;transition:background-color .2s}.widget-type-option[_ngcontent-%COMP%]:hover{background:#f2f2f2}.widget-type-option[_ngcontent-%COMP%]:hover   .add-icon[_ngcontent-%COMP%]{opacity:1}.widget-type-option[_ngcontent-%COMP%]   .widget-icon[_ngcontent-%COMP%]{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:#fafafa;border-radius:8px}.widget-type-option[_ngcontent-%COMP%]   .widget-icon[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1rem;color:#5f84fc}.widget-type-option[_ngcontent-%COMP%]   .widget-info[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.125rem}.widget-type-option[_ngcontent-%COMP%]   .widget-info[_ngcontent-%COMP%]   .widget-label[_ngcontent-%COMP%]{font-weight:500;font-size:.875rem;color:#000}.widget-type-option[_ngcontent-%COMP%]   .widget-info[_ngcontent-%COMP%]   .widget-desc[_ngcontent-%COMP%]{font-size:.75rem;color:#7b7b7b}.widget-type-option[_ngcontent-%COMP%]   .add-icon[_ngcontent-%COMP%]{opacity:0;color:#5f84fc;transition:opacity .2s}.dashboard-canvas[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:1rem;overflow:auto;background:#fafafa}.canvas-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.canvas-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:#000}.canvas-header[_ngcontent-%COMP%]   .widget-count[_ngcontent-%COMP%]{font-size:.875rem;color:#7b7b7b}.empty-canvas[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#fff;border:2px dashed #dedede;border-radius:8px;padding:3rem}.empty-canvas[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:3rem;color:#7b7b7b;margin-bottom:1rem}.empty-canvas[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1.125rem;font-weight:600;color:#000}.empty-canvas[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;color:#7b7b7b}.widget-grid[_ngcontent-%COMP%]{flex:1;min-height:400px}.widget-grid[_ngcontent-%COMP%]     .k-tilelayout{background:transparent}.widget-grid[_ngcontent-%COMP%]     .k-tilelayout-item{background:#fff;border:1px solid #dedede;border-radius:8px;box-shadow:0 1px 3px #0000001a}.widget-grid[_ngcontent-%COMP%]     .k-tilelayout-item:hover{box-shadow:0 4px 12px #00000026}.widget-grid[_ngcontent-%COMP%]     .k-tilelayout-item-header{padding:0;background:transparent;border-bottom:1px solid #dedede}.widget-grid[_ngcontent-%COMP%]     .k-tilelayout-item-body{padding:1rem;display:flex;align-items:center;justify-content:center}.widget-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.5rem .75rem}.widget-header[_ngcontent-%COMP%]   .widget-title-area[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.widget-header[_ngcontent-%COMP%]   .widget-title-area[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{color:#5f84fc}.widget-header[_ngcontent-%COMP%]   .widget-title-area[_ngcontent-%COMP%]   .widget-title[_ngcontent-%COMP%]{font-weight:600;font-size:.875rem;color:#000}.widget-header[_ngcontent-%COMP%]   .widget-title-area[_ngcontent-%COMP%]   .filter-icon[_ngcontent-%COMP%]{font-size:.75rem;color:#5f84fc;
1cursor:help}.widget-header[_ngcontent-%COMP%]   .widget-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem}.widget-header[_ngcontent-%COMP%]   .widget-actions[_ngcontent-%COMP%]   .button[_ngcontent-%COMP%]{color:#0009}.widget-header[_ngcontent-%COMP%]   .widget-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{background-color:transparent;border:none;color:#0009}.widget-header[_ngcontent-%COMP%]   .widget-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]:hover{background-color:#0000000a}.widget-header[_ngcontent-%COMP%]   .widget-actions[_ngcontent-%COMP%]     .p-button{width:28px;height:28px}.widget-preview[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;text-align:center;color:#7b7b7b}.widget-preview[_ngcontent-%COMP%]   .widget-type-badge[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem;background:#fafafa;border-radius:20px;font-size:.875rem}.widget-preview[_ngcontent-%COMP%]   .widget-type-badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#5f84fc}.widget-preview[_ngcontent-%COMP%]   .widget-workflow[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:.75rem}.widget-preview[_ngcontent-%COMP%]   .widget-workflow[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{color:#7b7b7b}"]})}}return i})();var Ut=F(78677),Ma=F(81141),Yt=F(81455),yu=F(47824),wu=F(40931),Du=F(57734),Ou=F(87939),xu=F(38439),Mu=F(98196),md=F(58263),Fu=F(52080),jk=F(461);let Vk=(()=>{class i extends jk.h{pathId;ngOnInit(){this.pathId="url(#"+(0,he._Y)()+")"}static \u0275fac=(()=>{let t;return function(o){return(t||(t=e.xGo(i)))(o||i)}})();static \u0275cmp=e.VBU({type:i,selectors:[["HomeIcon"]],standalone:!0,features:[e.Vt3,e.aNF],decls:6,vars:7,consts:[["width","14","height","14","viewBox","0 0 14 14","fill","none","xmlns","http://www.w3.org/2000/svg"],["fill-rule","evenodd","clip-rule","evenodd","d","M13.4175 6.79971C13.2874 6.80029 13.1608 6.75807 13.057 6.67955L12.4162 6.19913V12.6073C12.4141 12.7659 12.3502 12.9176 12.2379 13.0298C12.1257 13.142 11.9741 13.206 11.8154 13.208H8.61206C8.61179 13.208 8.61151 13.208 8.61123 13.2081C8.61095 13.208 8.61068 13.208 8.6104 13.208H5.41076C5.40952 13.208 5.40829 13.2081 5.40705 13.2081C5.40581 13.2081 5.40458 13.208 5.40334 13.208H2.20287C2.04418 13.206 1.89257 13.142 1.78035 13.0298C1.66813 12.9176 1.60416 12.7659 1.60209 12.6073V6.19914L0.961256 6.67955C0.833786 6.77515 0.673559 6.8162 0.515823 6.79367C0.358086 6.77114 0.215762 6.68686 0.120159 6.55939C0.0245566 6.43192 -0.0164931 6.2717 0.00604063 6.11396C0.0285744 5.95622 0.112846 5.8139 0.240316 5.7183L1.83796 4.52007L1.84689 4.51337L6.64868 0.912027C6.75267 0.834032 6.87915 0.79187 7.00915 0.79187C7.13914 0.79187 7.26562 0.834032 7.36962 0.912027L12.1719 4.51372L12.1799 4.51971L13.778 5.7183C13.8943 5.81278 13.9711 5.94732 13.9934 6.09553C14.0156 6.24373 13.9816 6.39489 13.8981 6.51934C13.8471 6.60184 13.7766 6.67054 13.6928 6.71942C13.609 6.76831 13.5144 6.79587 13.4175 6.79971ZM6.00783 12.0065H8.01045V7.60074H6.00783V12.0065ZM9.21201 12.0065V6.99995C9.20994 6.84126 9.14598 6.68965 9.03375 6.57743C8.92153 6.46521 8.76992 6.40124 8.61123 6.39917H5.40705C5.24836 6.40124 5.09675 6.46521 4.98453 6.57743C4.8723 6.68965 4.80834 6.84126 4.80627 6.99995V12.0065H2.80366V5.29836L7.00915 2.14564L11.2146 5.29836V12.0065H9.21201Z","fill","currentColor"],[3,"id"],["width","14","height","14","fill","white"]],template:function(n,o){1&n&&(e.qSk(),e.j41(0,"svg",0)(1,"g"),e.nrm(2,"path",1),e.k0s(),e.j41(3,"defs")(4,"clipPath",2),e.nrm(5,"rect",3),e.k0s()()()),2&n&&(e.HbH(o.getClassNames()),e.BMQ("aria-label",o.ariaLabel)("aria-hidden",o.ariaHidden)("role",o.role),e.R7$(),e.BMQ("clip-path",o.pathId),e.R7$(3),e.Y8G("id",o.pathId))},encapsulation:2})}return i})();var Pu=F(75998),Fa=F(10563);const $k=["sourcelist"],Uk=["targetlist"],Yk=["sourceFilter"],Hk=["targetFilter"],Xk=i=>({"p-picklist p-component":!0,"p-picklist-striped":i}),Pa=i=>({$implicit:i}),Nu=i=>({options:i}),Gu=(i,a)=>({$implicit:i,index:a});function Wk(i,a){1&i&&e.nrm(0,"AngleUpIcon"),2&i&&e.BMQ("data-pc-section","moveupicon")}function zk(i,a){}function Kk(i,a){1&i&&e.DNE(0,zk,0,0,"ng-template")}function Jk(i,a){1&i&&e.nrm(0,"AngleDoubleUpIcon"),2&i&&e.BMQ("data-pc-section","movetopicon")}function qk(i,a){}function Qk(i,a){1&i&&e.DNE(0,qk,0,0,"ng-template")}function Zk(i,a){1&i&&e.nrm(0,"AngleDownIcon"),2&i&&e.BMQ("data-pc-section","movedownicon")}function eR(i,a){}function tR(i,a){1&i&&e.DNE(0,eR,0,0,"ng-template")}function nR(i,a){1&i&&e.nrm(0,"AngleDoubleDownIcon"),2&i&&e.BMQ("data-pc-section","movebottomicon")}function iR(i,a){}function oR(i,a){1&i&&e.DNE(0,iR,0,0,"ng-template")}function rR(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",20)(1,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(6);return e.Njj(o.moveUp(r,o.source,o.selectedItemsSource,o.onSourceReorder,o.SOURCE_LIST))}),e.DNE(2,Wk,1,1,"AngleUpIcon",13)(3,Kk,1,0,null,21),e.k0s(),e.j41(4,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(6);return e.Njj(o.moveTop(r,o.source,o.selectedItemsSource,o.onSourceReorder,o.SOURCE_LIST))}),e.DNE(5,Jk,1,1,"AngleDoubleUpIcon",13)(6,Qk,1,0,null,21),e.k0s(),e.j41(7,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(6);return e.Njj(o.moveDown(r,o.source,o.selectedItemsSource,o.onSourceReorder,o.SOURCE_LIST))}),e.DNE(8,Zk,1,1,"AngleDownIcon",13)(9,tR,1,0,null,21),e.k0s(),e.j41(10,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(6);return e.Njj(o.moveBottom(r,o.source,o.selectedItemsSource,o.onSourceReorder,o.SOURCE_LIST))}),e.DNE(11,nR,1,1,"AngleDoubleDownIcon",13)(12,oR,1,0,null,21),e.k0s()()}if(2&i){const t=e.XpG();e.BMQ("data-pc-section","sourceControls")("data-pc-group-section","controls"),e.R7$(),e.Y8G("disabled",t.sourceMoveDisabled()),e.BMQ("aria-label",t.moveUpAriaLabel)("data-pc-section","sourceMoveUpButton"),e.R7$(),e.Y8G("ngIf",!t.moveUpIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveUpIconTemplate),e.R7$(),e.Y8G("disabled",t.sourceMoveDisabled()),e.BMQ("aria-label",t.moveTopAriaLabel)("data-pc-section","sourceMoveTopButton"),e.R7$(),e.Y8G("ngIf",!t.moveTopIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveTopIconTemplate),e.R7$(),e.Y8G("disabled",t.sourceMoveDisabled()),e.BMQ("aria-label",t.moveDownAriaLabel)("data-pc-section","sourceMoveDownButton"),e.R7$(),e.Y8G("ngIf",!t.moveDownIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveDownIconTemplate),e.R7$(),e.Y8G("disabled",t.sourceMoveDisabled()),e.BMQ("aria-label",t.moveBottomAriaLabel)("data-pc-section","sourceMoveBottomButton"),e.R7$(),e.Y8G("ngIf",!t.moveBottomIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveBottomIconTemplate)}}function aR(i,a){if(1&i&&(e.j41(0,"div",24),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.JRh(t.sourceHeader)}}function sR(i,a){1&i&&e.eu8(0)}function lR(i,a){if(1&i&&(e.j41(0,"div",22),e.DNE(1,aR,2,1,"div",23)(2,sR,1,0,"ng-container",21),e.k0s()),2&i){const t=e.XpG();e.Y8G("id",t.idSource+"_header"),e.BMQ("data-pc-section","sourceHeader")("data-pc-group-section","header"),e.R7$(),e.Y8G("ngIf",!t.sourceHeaderTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.sourceHeaderTemplate)}}function dR(i,a){1&i&&e.eu8(0)}function cR(i,a){if(1&i&&(e.qex(0),e.DNE(1,dR,1,0,"ng-container",16),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngTemplateOutlet",t.sourceFilterTemplate)("ngTemplateOutletContext",e.eq3(2,Nu,t.sourceFilterOptions))}}function pR(i,a){1&i&&e.nrm(0,"SearchIcon",31),2&i&&(e.Y8G("styleClass","p-picklist-filter-icon"),e.BMQ("data-pc-section","sourcefilterIcon"))}function uR(i,a){}function _R(i,a){1&i&&e.DNE(0,uR,0,0,"ng-template")}function mR(i,a){if(1&i&&(e.j41(0,"span",32),e.DNE(1,_R,1,0,null,21),e.k0s()),2&i){const t=e.XpG(3);e.BMQ("data-pc-section","sourcefilterIcon"),e.R7$(),e.Y8G("ngTemplateOutlet",t.sourceFilterIconTemplate)}}function gR(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",27)(1,"input",28,3),e.bIt("keyup",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onFilter(o,r.SOURCE_LIST))}),e.k0s(),e.DNE(3,pR,1,2,"SearchIcon",29)(4,mR,2,2,"span",30),e.k0s()}if(2&i){const t=e.XpG(2);e.BMQ("data-pc-section","sourceFilter"),e.R7$(),e.Y8G("disabled",t.disabled),e.BMQ("placeholder",t.sourceFilterPlaceholder)("aria-label",t.ariaSourceFilterLabel)("data-pc-section","sourceFilterInput"),e.R7$(2),e.Y8G("ngIf",!t.sourceFilterIconTemplate),e.R7$(),e.Y8G("ngIf",t.sourceFilterIconTemplate)}}function hR(i,a){if(1&i&&(e.j41(0,"div",25),e.DNE(1,cR,2,4,"ng-container",26)(2,gR,5,7,"ng-template",null,2,e.C5r),e.k0s()),2&i){const t=e.sdS(3),n=e.XpG();e.BMQ("data-pc-section","sourceFilterContainer"),e.R7$(),e.Y8G("ngIf",n.sourceFilterTemplate)("ngIfElse",t)}}function fR(i,a){1&i&&e.eu8(0)}function CR(i,a){if(1&i){const t=e.RV6();e.j41(0,"li",34),e.bIt("click",function(o){e.eBV(t);const r=e.XpG(),s=r.$implicit,c=r.index,u=e.XpG();return e.Njj(u.onItemClick(o,s,u.selectedItemsSource,u.SOURCE_LIST,u.onSourceSelect,u.idSource+"_"+c))})("mousedown",function(){e.eBV(t);const o=e.XpG().index,r=e.XpG();return e.Njj(r.onOptionMouseDown(o,r.SOURCE_LIST))})("dblclick",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onSourceItemDblClick())})("touchend",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onItemTouchEnd())}),e.DNE(1,fR,1,0,"ng-container",16),e.k0s()}if(2&i){const t=e.XpG(),n=t.$implicit,o=t.index,r=e.XpG();e.Y8G("id",r.idSource+"_"+o)("ngClass",r.itemClass(n,r.idSource+"_"+o,r.selectedItemsSource))("cdkDragData",n)("cdkDragDisabled",!r.dragdrop),e.BMQ("data-pc-section","item")("aria-selected",r.isSelected(n,r.selectedItemsSource)),e.R7$(),e.Y8G("ngTemplateOutlet",r.itemTemplate)("ngTemplateOutletContext",e.l_i(8,Gu,n,o))}}function vR(i,a){if(1&i&&e.DNE(0,CR,2,11,"li",33),2&i){const t=a.$implicit,n=e.XpG();e.Y8G("ngIf",n.isItemVisible(t,n.SOURCE_LIST))}}function bR(i,a){1&i&&e.eu8(0)}function TR(i,a){if(1&i&&(e.j41(0,"li",36),e.DNE(1,bR,1,0,"ng-container",21),e.k0s()),2&i){const t=e.XpG(2);e.BMQ("data-pc-section","sourceEmptyMessage"),e.R7$(),e.Y8G("ngTemplateOutlet",t.emptyMessageSourceTemplate)}}function ER(i,a){1&i&&e.eu8(0)}function SR(i,a){if(1&i&&(e.j41(0,"li",36),e.DNE(1,ER,1,0,"ng-container",21),e.k0s()),2&i){const t=e.XpG(2);e.BMQ("data-pc-section","sourceEmptyMessage"),e.R7$(),e.Y8G("ngTemplateOutlet",t.emptyFilterMessageSourceTemplate)}}function kR(i,a){if(1&i&&(e.qex(0),e.DNE(1,TR,2,2,"li",35)(2,SR,2,2,"li",35),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.filterValueSource||!t.emptyFilterMessageSourceTemplate),e.R7$(),e.Y8G("ngIf",t.filterValueSource)}}function RR(i,a){1&i&&e.nrm(0,"AngleRightIcon"),2&i&&e.BMQ("data-pc-section","movetotargeticon")}function IR(i,a){1&i&&e.nrm(0,"AngleDownIcon"),2&i&&e.BMQ("data-pc-section","movetotargeticon")}function yR(i,a){if(1&i&&(e.qex(0),e.DNE(1,RR,1,1,"AngleRightIcon",13)(2,IR,1,1,"AngleDownIcon",13),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.viewChanged),e.R7$(),e.Y8G("ngIf",t.viewChanged)}}function wR(i,a){}function DR(i,a){1&i&&e.DNE(0,wR,0,0,"ng-template")}function OR(i,a){1&i&&e.nrm(0,"AngleDoubleRightIcon"),2&i&&e.BMQ("data-pc-section","movealltotargeticon")}function xR(i,a){1&i&&e.nrm(0,"AngleDoubleDownIcon"),2&i&&e.BMQ("data-pc-section","movealltotargeticon")}function MR(i,a){if(1&i&&(e.qex(0),e.DNE(1,OR,1,1,"AngleDoubleRightIcon",13)(2,xR,1,1,"AngleDoubleDownIcon",13),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.viewChanged),e.R7$(),e.Y8G("ngIf",t.viewChanged)}}function FR(i,a){}function PR(i,a){1&i&&e.DNE(0,FR,0,0,"ng-template")}function NR(i,a){1&i&&e.nrm(0,"AngleLeftIcon"),2&i&&e.BMQ("data-pc-section","movedownsourceticon")}function GR(i,a){1&i&&e.nrm(0,"AngleUpIcon"),2&i&&e.BMQ("data-pc-section","movedownsourceticon")}function AR(i,a){if(1&i&&(e.qex(0),e.DNE(1,NR,1,1,"AngleLeftIcon",13)(2,GR,1,1,"AngleUpIcon",13),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.viewChanged),e.R7$(),e.Y8G("ngIf",t.viewChanged)}}function LR(i,a){}function BR(i,a){1&i&&e.DNE(0,LR,0,0,"ng-template")}function jR(i,a){1&i&&e.nrm(0,"AngleDoubleLeftIcon"),2&i&&e.BMQ("data-pc-section","movealltosourceticon")}function VR(i,a){1&i&&e.nrm(0,"AngleDoubleUpIcon"),2&i&&e.BMQ("data-pc-section","movealltosourceticon")}function $R(i,a){if(1&i&&(e.qex(0),e.DNE(1,jR,1,1,"AngleDoubleLeftIcon",13)(2,VR,1,1,"AngleDoubleUpIcon",13),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.viewChanged),e.R7$(),e.Y8G("ngIf",t.viewChanged)}}function UR(i,a){}function YR(i,a){1&i&&e.DNE(0,UR,0,0,"ng-template")}function HR(i,a){if(1&i&&(e.j41(0,"div",24),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.JRh(t.targetHeader)}}function XR(i,a){1&i&&e.eu8(0)}function WR(i,a){if(1&i&&(e.j41(0,"div",22),e.DNE(1,HR,2,1,"div",23)(2,XR,1,0,"ng-container",21),e.k0s()),2&i){const t=e.XpG();e.Y8G("id",t.idTarget+"_header"),e.BMQ("data-pc-section","targetHead")("data-pc-group-section","header"),e.R7$(),e.Y8G("ngIf",!t.targetHeaderTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.targetHeaderTemplate)}}function zR(i,a){1&i&&e.eu8(0)}function KR(i,a){if(1&i&&(e.qex(0),e.DNE(1,zR,1,0,"ng-container",16),e.bVm()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngTemplateOutlet",t.targetFilterTemplate)("ngTemplateOutletContext",e.eq3(2,Nu,t.targetFilterOptions))}}function JR(i,a){1&i&&e.nrm(0,"SearchIcon",31),2&i&&(e.Y8G("styleClass","p-picklist-filter-icon"),e.BMQ("data-pc-section","targetfiltericon"))}function qR(i,a){}function QR(i,a){1&i&&e.DNE(0,qR,0,0,"ng-template")}function ZR(i,a){if(1&i&&(e.j41(0,"span",32),e.DNE(1,QR,1,0,null,21),e.k0s()),2&i){const t=e.XpG(3);e.BMQ("data-pc-section","targetfiltericon"),e.R7$(),e.Y8G("ngTemplateOutlet",t.targetFilterIconTemplate)}}function eI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",27)(1,"input",28,5),e.bIt("keyup",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onFilter(o,r.TARGET_LIST))}),e.k0s(),e.DNE(3,JR,1,2,"SearchIcon",29)(4,ZR,2,2,"span",30),e.k0s()}if(2&i){const t=e.XpG(2);e.BMQ("data-pc-section","targetFilter"),e.R7$(),e.Y8G("disabled",t.disabled),e.BMQ("placeholder",t.targetFilterPlaceholder)("aria-label",t.ariaTargetFilterLabel)("data-pc-section","targetFilterInput"),e.R7$(2),e.Y8G("ngIf",!t.targetFilterIconTemplate),e.R7$(),e.Y8G("ngIf",t.targetFilterIconTemplate)}}function tI(i,a){if(1&i&&(e.j41(0,"div",25),e.DNE(1,KR,2,4,"ng-container",26)(2,eI,5,7,"ng-template",null,4,e.C5r),e.k0s()),2&i){const t=e.sdS(3),n=e.XpG();e.BMQ("data-pc-section","targetFilterContainer"),e.R7$(),e.Y8G("ngIf",n.targetFilterTemplate)("ngIfElse",t)}}function nI(i,a){1&i&&e.eu8(0)}function iI(i,a){if(1&i){const t=e.RV6();e.j41(0,"li",34),e.bIt("click",function(o){e.eBV(t);const r=e.XpG(),s=r.$implicit,c=r.index,u=e.XpG();return e.Njj(u.onItemClick(o,s,u.selectedItemsTarget,u.TARGET_LIST,u.onTargetSelect,u.idTarget+"_"+c))})("mousedown",function(){e.eBV(t);const o=e.XpG().index,r=e.XpG();return e.Njj(r.onOptionMouseDown(o,r.TARGET_LIST))})("dblclick",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onTargetItemDblClick())})("touchend",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onItemTouchEnd())}),e.DNE(1,nI,1,0,"ng-container",16),e.k0s()}if(2&i){const t=e.XpG(),n=t.$implicit,o=t.index,r=e.XpG();e.Y8G("id",r.idTarget+"_"+o)("ngClass",r.itemClass(n,r.idTarget+"_"+o,r.selectedItemsTarget))("cdkDragData",n)("cdkDragDisabled",!r.dragdrop),e.BMQ("data-pc-section","item")("aria-selected",r.isSelected(n,r.selectedItemsTarget)),e.R7$(),e.Y8G("ngTemplateOutlet",r.itemTemplate)("ngTemplateOutletContext",e.l_i(8,Gu,n,o))}}function oI(i,a){if(1&i&&e.DNE(0,iI,2,11,"li",33),2&i){const t=a.$implicit,n=e.XpG();e.Y8G("ngIf",n.isItemVisible(t,n.TARGET_LIST))}}function rI(i,a){1&i&&e.eu8(0)}function aI(i,a){if(1&i&&(e.j41(0,"li",36),e.DNE(1,rI,1,0,"ng-container",21),e.k0s()),2&i){const t=e.XpG(2);e.BMQ("data-pc-section","targetEmptyMessage"),e.R7$(),e.Y8G("ngTemplateOutlet",t.emptyMessageTargetTemplate)}}function sI(i,a){1&i&&e.eu8(0)}function lI(i,a){if(1&i&&(e.j41(0,"li",36),e.DNE(1,sI,1,0,"ng-container",21),e.k0s()),2&i){const t=e.XpG(2);e.BMQ("data-pc-section","targetEmptyMessage"),e.R7$(),e.Y8G("ngTemplateOutlet",t.emptyFilterMessageTargetTemplate)}}function dI(i,a){if(1&i&&(e.qex(0),e.DNE(1,aI,2,2,"li",35)(2,lI,2,2,"li",35),e.bVm()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",!t.filterValueTarget||!t.emptyFilterMessageTargetTemplate),e.R7$(),e.Y8G("ngIf",t.filterValueTarget)}}function cI(i,a){1&i&&e.nrm(0,"
1AngleUpIcon"),2&i&&e.BMQ("data-pc-section","moveupicon")}function pI(i,a){}function uI(i,a){1&i&&e.DNE(0,pI,0,0,"ng-template")}function _I(i,a){1&i&&e.nrm(0,"AngleDoubleUpIcon"),2&i&&e.BMQ("data-pc-section","movetopicon")}function mI(i,a){}function gI(i,a){1&i&&e.DNE(0,mI,0,0,"ng-template")}function hI(i,a){1&i&&e.nrm(0,"AngleDownIcon"),2&i&&e.BMQ("data-pc-section","movedownicon")}function fI(i,a){}function CI(i,a){1&i&&e.DNE(0,fI,0,0,"ng-template")}function vI(i,a){1&i&&e.nrm(0,"AngleDoubleDownIcon"),2&i&&e.BMQ("data-pc-section","movebottomicon")}function bI(i,a){}function TI(i,a){1&i&&e.DNE(0,bI,0,0,"ng-template")}function EI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",37)(1,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(26);return e.Njj(o.moveUp(r,o.target,o.selectedItemsTarget,o.onTargetReorder,o.TARGET_LIST))}),e.DNE(2,cI,1,1,"AngleUpIcon",13)(3,uI,1,0,null,21),e.k0s(),e.j41(4,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(26);return e.Njj(o.moveTop(r,o.target,o.selectedItemsTarget,o.onTargetReorder,o.TARGET_LIST))}),e.DNE(5,_I,1,1,"AngleDoubleUpIcon",13)(6,gI,1,0,null,21),e.k0s(),e.j41(7,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(26);return e.Njj(o.moveDown(r,o.target,o.selectedItemsTarget,o.onTargetReorder,o.TARGET_LIST))}),e.DNE(8,hI,1,1,"AngleDownIcon",13)(9,CI,1,0,null,21),e.k0s(),e.j41(10,"button",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG(),r=e.sdS(26);return e.Njj(o.moveBottom(r,o.target,o.selectedItemsTarget,o.onTargetReorder,o.TARGET_LIST))}),e.DNE(11,vI,1,1,"AngleDoubleDownIcon",13)(12,TI,1,0,null,21),e.k0s()()}if(2&i){const t=e.XpG();e.BMQ("data-pc-section","targetControls")("data-pc-group-section","controls"),e.R7$(),e.Y8G("disabled",t.targetMoveDisabled()),e.BMQ("aria-label",t.moveUpAriaLabel)("data-pc-section","targetMoveUpButton"),e.R7$(),e.Y8G("ngIf",!t.moveUpIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveUpIconTemplate),e.R7$(),e.Y8G("disabled",t.targetMoveDisabled()),e.BMQ("aria-label",t.moveTopAriaLabel)("data-pc-section","targetMoveTopButton"),e.R7$(),e.Y8G("ngIf",!t.moveTopIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveTopIconTemplate),e.R7$(),e.Y8G("disabled",t.targetMoveDisabled()),e.BMQ("aria-label",t.moveDownAriaLabel)("data-pc-section","targetMoveDownButton"),e.R7$(),e.Y8G("ngIf",!t.moveDownIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveDownIconTemplate),e.R7$(),e.Y8G("disabled",t.targetMoveDisabled()),e.BMQ("aria-label",t.moveBottomAriaLabel)("data-pc-section","targetMoveBottomButton"),e.R7$(),e.Y8G("ngIf",!t.moveBottomIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",t.moveBottomIconTemplate)}}let SI=(()=>{class i{document;platformId;renderer;el;cd;filterService;config;source;target;sourceHeader;tabindex=0;rightButtonAriaLabel;leftButtonAriaLabel;allRightButtonAriaLabel;allLeftButtonAriaLabel;upButtonAriaLabel;downButtonAriaLabel;topButtonAriaLabel;bottomButtonAriaLabel;targetHeader;responsive;filterBy;filterLocale;trackBy=(t,n)=>n;sourceTrackBy;targetTrackBy;showSourceFilter=!0;showTargetFilter=!0;metaKeySelection=!1;dragdrop=!1;style;styleClass;sourceStyle;targetStyle;showSourceControls=!0;showTargetControls=!0;sourceFilterPlaceholder;targetFilterPlaceholder;disabled=!1;ariaSourceFilterLabel;ariaTargetFilterLabel;filterMatchMode="contains";
1stripedRows;keepSelection=!1;get breakpoint(){return this._breakpoint}set breakpoint(t){t!==this._breakpoint&&(this._breakpoint=t,(0,M.UE)(this.platformId)&&(this.destroyMedia(),this.initMedia()))}onMoveToSource=new e.bkB;onMoveAllToSource=new e.bkB;onMoveAllToTarget=new e.bkB;onMoveToTarget=new e.bkB;onSourceReorder=new e.bkB;onTargetReorder=new e.bkB;onSourceSelect=new e.bkB;onTargetSelect=new e.bkB;onSourceFilter=new e.bkB;onTargetFilter=new e.bkB;onFocus=new e.bkB;onBlur=new e.bkB;listViewSourceChild;listViewTargetChild;sourceFilterViewChild;targetFilterViewChild;templates;get moveUpAriaLabel(){return this.upButtonAriaLabel?this.upButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveUp:void 0}get moveTopAriaLabel(){return this.topButtonAriaLabel?this.topButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveTop:void 0}get moveDownAriaLabel(){return this.downButtonAriaLabel?this.downButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveDown:void 0}get moveBottomAriaLabel(){return this.bottomButtonAriaLabel?this.bottomButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveBottom:void 0}get moveToTargetAriaLabel(){return this.rightButtonAriaLabel?this.rightButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveToTarget:void 0}get moveAllToTargetAriaLabel(){return this.allRightButtonAriaLabel?this.allRightButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveAllToTarget:void 0}get moveToSourceAriaLabel(){return this.leftButtonAriaLabel?this.leftButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveToSource:void 0}get moveAllToSourceAriaLabel(){return this.allLeftButtonAriaLabel?this.allLeftButtonAriaLabel:this.config.translation.aria?this.config.translation.aria.moveAllToSource:void 0}get idSource(){return this.id+"_source"}get idTarget(){return this.id+"_target"}get focusedOptionId(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}_breakpoint="960px";itemTemplate;moveTopIconTemplate;moveUpIconTemplate;moveDownIconTemplate;moveBottomIconTemplate;moveToTargetIconTemplate;moveAllToTargetIconTemplate;moveToSourceIconTemplate;moveAllToSourceIconTemplate;targetFilterIconTemplate;sourceFilterIconTemplate;visibleOptionsSource;visibleOptionsTarget;selectedItemsSource=[];selectedItemsTarget=[];reorderedListElement;
1movedUp;movedDown;itemTouched;styleElement;id=(0,he._Y)();filterValueSource;filterValueTarget;fromListType;emptyMessageSourceTemplate;emptyFilterMessageSourceTemplate;emptyMessageTargetTemplate;emptyFilterMessageTargetTemplate;sourceHeaderTemplate;targetHeaderTemplate;sourceFilterTemplate;targetFilterTemplate;sourceFilterOptions;targetFilterOptions;SOURCE_LIST=-1;TARGET_LIST=1;window;media;viewChanged;focusedOptionIndex=-1;focusedOption;focused={sourceList:!1,targetList:!1};mediaChangeListener;constructor(t,n,o,r,s,c,u){this.document=t,this.platformId=n,this.renderer=o,this.el=r,this.cd=s,this.filterService=c,this.config=u,this.window=this.document.defaultView}ngOnInit(){this.responsive&&(this.createStyle(),this.initMedia()),this.filterBy&&(this.sourceFilterOptions={filter:t=>this.filterSource(t),reset:()=>this.resetSourceFilter()},this.targetFilterOptions={filter:t=>this.filterTarget(t),reset:()=>this.resetTargetFilter()})}ngAfterContentInit(){this.templates.forEach(t=>{switch(t.getType()){case"item":default:this.itemTemplate=t.template;break;case"sourceHeader":this.sourceHeaderTemplate=t.template;break;case"targetHeader":this.targetHeaderTemplate=t.template;break;case"sourceFilter":this.sourceFilterTemplate=t.template;break;case"targetFilter":this.targetFilterTemplate=t.template;break;case"emptymessagesource":this.emptyMessageSourceTemplate=t.template;break;case"emptyfiltermessagesource":this.emptyFilterMessageSourceTemplate=t.template;break;case"emptymessagetarget":this.emptyMessageTargetTemplate=t.template;break;case"emptyfiltermessagetarget":this.emptyFilterMessageTargetTemplate=t.template;break;case"moveupicon":this.moveUpIconTemplate=t.template;break;case"movetopicon":this.moveTopIconTemplate=t.template;break;case"movedownicon":this.moveDownIconTemplate=t.template;break;case"movebottomicon":this.moveBottomIconTemplate=t.template;break;case"movetotargeticon":this.moveToTargetIconTemplate=t.template;break;case"movealltotargeticon":this.moveAllToTargetIconTemplate=t.template;break;case"movetosourceicon":this.moveToSourceIconTemplate=t.template;break;case"movealltosourceicon":this.moveAllToSourceIconTemplate=t.template;break;case"targetfiltericon":this.targetFilterIconTemplate=t.template;break;case"sourcefiltericon":this.sourceFilterIconTemplate=t.template}})}ngAfterViewChecked(){if(this.movedUp||this.movedDown){let n,t=Yt.D.find(this.reorderedListElement,"li.p-highlight");n=this.movedUp?t[0]:t[t.length-1],Yt.D.scrollInView(this.reorderedListElement,n),this.movedUp=!1,this.movedDown=!1,this.reorderedListElement=null}}onItemClick(t,n,o,r,s,c){if(this.disabled)return;let u=this.findIndexInList(n,o);c&&(this.focusedOptionIndex=c);let g=-1!=u;if(!this.itemTouched&&this.metaKeySelection){let k=t.metaKey||t.ctrlKey||t.shiftKey;g&&k?o=o.filter((D,V)=>V!==u):(k||(o=[]),o.push(n))}else g?o=o.filter((k,D)=>D!==u):o.push(n);this.setSelectionList(r,o),s.emit({originalEvent:t,items:o}),this.itemTouched=!1}onOptionMouseDown(t,n){this.focused[n===this.SOURCE_LIST?"sourceList":"targetList"]=!0,this.focusedOptionIndex=t}onSourceItemDblClick(){this.disabled||this.moveRight()}onTargetItemDblClick(){this.disabled||this.moveLeft()}onFilter(t,n){let o=t.target.value;n===this.SOURCE_LIST?this.filterSource(o):n===this.TARGET_LIST&&this.filterTarget(o)}filterSource(t=""){this.filterValueSource=t.trim().toLocaleLowerCase(this.filterLocale),this.filter(this.source,this.SOURCE_LIST)}filterTarget(t=""){this.filterValueTarget=t.trim().toLocaleLowerCase(this.filterLocale),this.filter(this.target,this.TARGET_LIST)}filter(t,n){let o=this.filterBy.split(",");n===this.SOURCE_LIST?(this.visibleOptionsSource=this.filterService.filter(t,o,this.filterValueSource,this.filterMatchMode,this.filterLocale),this.onSourceFilter.emit({query:this.filterValueSource,value:this.visibleOptionsSource})):n===this.TARGET_LIST&&(this.visibleOptionsTarget=this.filterService.filter(t,o,this.filterValueTarget,this.filterMatchMode,this.filterLocale),this.onTargetFilter.emit({query:this.filterValueTarget,value:this.visibleOptionsTarget}))}isItemVisible(t,n){return n==this.SOURCE_LIST?this.isVisibleInList(this.visibleOptionsSource,t,this.filterValueSource):this.isVisibleInList(this.visibleOptionsTarget,t,this.filterValueTarget)}isEmpty(t){return t==this.SOURCE_LIST?this.filterValueSource?!this.visibleOptionsSource||0===this.visibleOptionsSource.length:!this.source||0===this.source.length:this.filterValueTarget?!this.visibleOptionsTarget||0===this.visibleOptionsTarget.length:!this.target||0===this.target.length}isVisibleInList(t,n,o){if(!o||!o.trim().length)return!0;for(let r=0;r<t.length;r++)if(n==t[r])return!0}onItemTouchEnd(){this.disabled||(this.itemTouched=!0)}sortByIndexInList(t,n){return t.sort((o,r)=>he.BF.findIndexInList(o,n)-he.BF.findIndexInList(r,n))}moveUp(t,n,o,r,s){if(o&&o.length){o=this.sortByIndexInList(o,n);for(let c=0;c<o.length;c++){let g=he.BF.findIndexInList(o[c],n);if(0==g)break;{let k=n[g-1];n[g-1]=n[g],n[g]=k}}this.dragdrop&&(this.filterValueSource&&s===this.SOURCE_LIST||this.filterValueTarget&&s===this.TARGET_LIST)&&this.filter(n,s),this.movedUp=!0,this.reorderedListElement=t,r.emit({items:o})}}moveTop(t,n,o,r,s){if(o&&o.length){o=this.sortByIndexInList(o,n);for(let c=0;c<o.length;c++){let g=he.BF.findIndexInList(o[c],n);if(0==g)break;{let b=n.splice(g,1)[0];n.unshift(b)}}this.dragdrop&&(this.filterValueSource&&s===this.SOURCE_LIST||this.filterValueTarget&&s===this.TARGET_LIST)&&this.filter(n,s),t.scrollTop=0,r.emit({items:o})}}moveDown(t,n,o,r,s){if(o&&o.length){for(let c=(o=this.sortByIndexInList(o,n)).length-1;c>=0;c--){let g=he.BF.findIndexInList(o[c],n);if(g==n.length-1)break;{let k=n[g+1];n[g+1]=n[g],n[g]=k}}this.dragdrop&&(this.filterValueSource&&s===this.SOURCE_LIST||this.filterValueTarget&&s===this.TARGET_LIST)&&this.filter(n,s),this.movedDown=!0,this.reorderedListElement=t,r.emit({items:o})}}moveBottom(t,n,o,r,s){if(o&&o.length){for(let c=(o=this.sortByIndexInList(o,n)).length-1;c>=0;c--){let g=he.BF.findIndexInList(o[c],n);if(g==n.length-1)break;{let b=n.splice(g,1)[0];n.push(b)}}this.dragdrop&&(this.filterValueSource&&s===this.SOURCE_LIST||this.filterValueTarget&&s===this.TARGET_LIST)&&this.filter(n,s),t.scrollTop=t.scrollHeight,r.emit({items:o})}}moveRight(){if(this.selectedItemsSource&&this.selectedItemsSource.length){const t=[...this.selectedItemsSource];for(let n=0;n<t.length;n++){let o=t[n];if(-1==he.BF.findIndexInList(o,this.target)){let r=he.BF.findIndexInList(o,this.source);-1!==r&&this.target?.push(this.source?.splice(r,1)[0]),this.visibleOptionsSource?.includes(o)&&this.visibleOptionsSource.splice(he.BF.findIndexInList(o,this.visibleOptionsSource),1)}}this.onMoveToTarget.emit({items:this.selectedItemsSource}),this.keepSelection&&(this.selectedItemsTarget=[...this.selectedItemsTarget,...this.selectedItemsSource]),this.selectedItemsSource=[],this.filterValueTarget&&this.filter(this.target,this.TARGET_LIST)}}moveAllRight(){if(this.source){let t=[];for(let n=0;n<this.source.length;n++)if(this.isItemVisible(this.source[n],this.SOURCE_LIST)){let o=this.source.splice(n,1)[0];this.target?.push(o),t.push(o),n--}this.onMoveAllToTarget.emit({items:t}),this.keepSelection&&(this.selectedItemsTarget=[...this.selectedItemsTarget,...this.selectedItemsSource]),this.selectedItemsSource=[],this.filterValueTarget&&this.filter(this.target,this.TARGET_LIST),this.visibleOptionsSource=[]}}moveLeft(){if(this.selectedItemsTarget&&this.selectedItemsTarget.length){const t=[...this.selectedItemsTarget];for(let n=0;n<t.length;n++){let o=t[n];if(-1==he.BF.findIndexInList(o,this.source)){let r=he.BF.findIndexInList(o,this.target);-1!==r&&this.source?.push(this.target?.splice(r,1)[0]),this.visibleOptionsTarget?.includes(o)&&this.visibleOptionsTarget.splice(he.BF.findIndexInList(o,this.visibleOptionsTarget),1)}}this.onMoveToSource.emit({items:this.selectedItemsTarget}),this.keepSelection&&(this.selectedItemsSource=[...this.selectedItemsSource,...this.selectedItemsTarget]),this.selectedItemsTarget=[],this.filterValueSource&&this.filter(this.source,this.SOURCE_LIST)}}moveAllLeft(){if(this.target){let t=[];for(let n=0;n<this.target.length;n++)if(this.isItemVisible(this.target[n],this.TARGET_LIST)){let o=this.target.splice(n,1)[0];this.source?.push(o),t.push(o),n--}this.onMoveAllToSource.emit({items:t}),this.keepSelection&&(this.selectedItemsSource=[...this.selectedItemsSource,...this.selectedItemsTarget]),this.selectedItemsTarget=[],this.filterValueSource&&this.filter(this.source,this.SOURCE_LIST),this.visibleOptionsTarget=[]}}isSelected(t,n){return-1!=this.findIndexInList(t,n)}itemClass(t,n,o){return{"p-picklist-item":!0,"p-highlight":this.isSelected(t,o),"p-focus":n===this.focusedOptionId,"p-disabled":this.disabled}}findIndexInList(t,n){return he.BF.findIndexInList(t,n)}onDrop(t,n){let o=t.previousContainer!==t.container,r=this.getDropIndexes(t.previousIndex,t.currentIndex,n,o,t.item.data);if(n===this.SOURCE_LIST){if(o){(0,Ut.eg)(t.previousContainer.data,t.container.data,r.previousIndex,r.currentIndex);let s=he.BF.findIndexInList(t.item.data,this.selectedItemsTarget);-1!=s&&(this.selectedItemsTarget.splice(s,1),this.keepSelection&&this.selectedItemsTarget.push(t.item.data)),this.visibleOptionsTarget&&this.visibleOptionsTarget.splice(t.previousIndex,1),this.onMoveToSource.emit({items:[t.item.data]})}else(0,Ut.HD)(t.container.data,r.previousIndex,r.currentIndex),this.onSourceReorder.emit({items:[t.item.data]});this.filterValueSource&&this.filter(this.source,this.SOURCE_LIST)}else{if(o){(0,Ut.eg)(t.previousContainer.data,t.container.data,r.previousIndex,r.currentIndex);let s=he.BF.findIndexInList(t.item.data,this.selectedItemsSource);-1!=s&&(this.selectedItemsSource.splice(s,1),this.keepSelection&&this.selectedItemsTarget.push(t.item.data)),this.visibleOptionsSource&&this.visibleOptionsSource.splice(t.previousIndex,1),this.onMoveToTarget.emit({items:[t.item.data]})}else(0,Ut.HD)(t.container.data,r.previousIndex,r.currentIndex),this.onTargetReorder.emit({items:[t.item.data]});this.filterValueTarget&&this.filter(this.target,this.TARGET_LIST)}}onListFocus(t,n){let o=this.getListElement(n);const r=Yt.D.findSingle(o,"li.p-picklist-item.p-highlight")||Yt.D.findSingle(o,"li.p-picklist-item"),s=he.BF.findIndexInList(r,o.children);this.focused[n===this.SOURCE_LIST?"sourceList":"targetList"]=!0;const c=-1!==this.focusedOptionIndex?this.focusedOptionIndex:r?s:-1,u=he.BF.isNotEmpty(this.visibleOptionsSource)?this.findIndexInList(this.source[c],this.visibleOptionsSource):c;this.changeFocusedOptionIndex(u,n),this.onFocus.emit(t)}onListBlur(t,n){this.focused[n===this.SOURCE_LIST?"sourceList":"targetList"]=!1,this.focusedOptionIndex=-1,this.focusedOption=null,this.onBlur.emit(t)}getListElement(t){return t===this.SOURCE_LIST?this.listViewSourceChild?.nativeElement:this.listViewTargetChild?.nativeElement}getListItems(t){let n=this.getListElement(t);return Yt.D.find(n,"li.p-picklist-item")}getLatestSelectedVisibleOptionIndex(t,n){const o=[...n].reverse().find(r=>t.includes(r));return void 0!==o?t.indexOf(o):-1}getVisibleList(t){return t===this.SOURCE_LIST?this.visibleOptionsSource&&this.visibleOptionsSource.length>0?this.visibleOptionsSource:this.source&&this.source.length>0?this.source:null:this.visibleOptionsTarget&&this.visibleOptionsTarget.length>0?this.visibleOptionsTarget:this.target&&this.target.length>0?this.target:null}setSelectionList(t,n){t===this.SOURCE_LIST?this.selectedItemsSource=n:this.selectedItemsTarget=n}findNextOptionIndex(t,n){const r=[...this.getListItems(n)].findIndex(s=>s.id===t);return r>-1?r+1:0}findPrevOptionIndex(t,n){const r=[...this.getListItems(n)].findIndex(s=>s.id===t);return r>-1?r-1:0}onItemKeyDown(t,n,o,r){switch(t.code){case"ArrowDown":this.onArrowDownKey(t,n,o,r);break;case"ArrowUp":this.onArrowUpKey(t,n,o,r);break;case"Home":this.onHomeKey(t,n,o,r);break;case"End":this.onEndKey(t,n,o,r);break;case"Enter":this.onEnterKey(t,n,o,r);break;case"Space":this.onSpaceKey(t,n,o,r);break;case"KeyA":t.ctrlKey&&(this.setSelectionList(r,this.getVisibleList(r)),o.emit({items:n}),t.preventDefault())}}getFocusedOption(t,n){return-1===t?null:n===this.SOURCE_LIST?this.visibleOptionsSource&&this.visibleOptionsSource.length?this.visibleOptionsSource[t]:this.source&&this.source.length?this.source[t]:null:this.visibleOptionsTarget&&this.visibleOptionsTarget.length?this.visibleOptionsTarget[t]:this.target&&this.target.length?this.target[t]:null}changeFocusedOptionIndex(t,n){const o=this.getListItems(n);if(o?.length>0){let r=t>=o.length?o.length-1:t<0?0:t;this.focusedOptionIndex=o[r].getAttribute("id"),this.focusedOption=this.getFocusedOption(r,n),this.scrollInView(o[r].getAttribute("id"),n)}}scrollInView(t,n){const o=Yt.D.findSingle(this.getListElement(n),`li[id="${t}"]`);o&&o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"start"})}onArrowDownKey(t,n,o,r){const s=this.findNextOptionIndex(this.focusedOptionIndex,r);this.changeFocusedOptionIndex(s,r),t.shiftKey&&this.onEnterKey(t,n,o,r),t.preventDefault()}onArrowUpKey(t,n,o,r){const s=this.findPrevOptionIndex(this.focusedOptionIndex,r);this.changeFocusedOptionIndex(s,r),t.shiftKey&&this.onEnterKey(t,n,o,r),t.preventDefault()}onEnterKey(t,n,o,r){this.onItemClick(t,this.focusedOption,n,r,o),t.preventDefault()}onSpaceKey(t,n,o,r){if(t.preventDefault(),t.shiftKey&&n&&n.length>0){let s=this.getVisibleList(r),c=this.getLatestSelectedVisibleOptionIndex(s,n);if(-1!==c){let u=he.BF.findIndexInList(this.focusedOption,s);return n=[...s.slice(Math.min(c,u),Math.max(c,u)+1)],this.setSelectionList(r,n),void o.emit({items:n})}}this.onEnterKey(t,n,o,r)}
1onHomeKey(t,n,o,r){if(t.ctrlKey&&t.shiftKey){let s=this.getVisibleList(r),c=he.BF.findIndexInList(this.focusedOption,s);n=[...s.slice(0,c+1)],this.setSelectionList(r,n),o.emit({items:n})}else this.changeFocusedOptionIndex(0,r);t.preventDefault()}onEndKey(t,n,o,r){let s=this.getVisibleList(r),c=s&&s.length>0?s.length-1:null;if(null!==c){if(t.ctrlKey&&t.shiftKey){let u=he.BF.findIndexInList(this.focusedOption,s);n=[...s.slice(u,c)],this.setSelectionList(r,n),o.emit({items:n})}else this.changeFocusedOptionIndex(c,r);t.preventDefault()}}getDropIndexes(t,n,o,r,s){let c,u;return o===this.SOURCE_LIST?(c=r?this.filterValueTarget?he.BF.findIndexInList(s,this.target):t:this.filterValueSource?he.BF.findIndexInList(s,this.source):t,u=this.filterValueSource?this.findFilteredCurrentIndex(this.visibleOptionsSource,n,this.source):n):(c=r?this.filterValueSource?he.BF.findIndexInList(s,this.source):t:this.filterValueTarget?he.BF.findIndexInList(s,this.target):t,u=this.filterValueTarget?this.findFilteredCurrentIndex(this.visibleOptionsTarget,n,this.target):n),{previousIndex:c,currentIndex:u}}findFilteredCurrentIndex(t,n,o){return t.length===n?he.BF.findIndexInList(t[n-1],o)+1:he.BF.findIndexInList(t[n],o)}resetSourceFilter(){this.visibleOptionsSource=null,this.filterValueSource=null,this.sourceFilterViewChild&&(this.sourceFilterViewChild.nativeElement.value="")}resetTargetFilter(){this.visibleOptionsTarget=null,this.filterValueTarget=null,this.targetFilterViewChild&&(this.targetFilterViewChild.nativeElement.value="")}resetFilter(){this.resetSourceFilter(),this.resetTargetFilter()}findNextItem(t){let n=t.nextElementSibling;return n?!Yt.D.hasClass(n,"p-picklist-item")||Yt.D.isHidden(n)?this.findNextItem(n):n:null}findPrevItem(t){let n=t.previousElementSibling;return n?!Yt.D.hasClass(n,"p-picklist-item")||Yt.D.isHidden(n)?this.findPrevItem(n):n:null}initMedia(){(0,M.UE)(this.platformId)&&(this.media=this.window.matchMedia(`(max-width: ${this.breakpoint})`),this.viewChanged=this.media.matches,this.bindMediaChangeListener())}destroyMedia(){this.unbindMediaChangeListener()}bindMediaChangeListener(){this.media&&!this.mediaChangeListener&&(this.mediaChangeListener=this.renderer.listen(this.media,"change",t=>{this.viewChanged=t.matches,this.cd.markForCheck()}))}unbindMediaChangeListener(){this.mediaChangeListener&&(this.mediaChangeListener(),this.mediaChangeListener=null)}createStyle(){(0,M.UE)(this.platformId)&&!this.styleElement&&(this.renderer.setAttribute(this.el.nativeElement.children[0],this.id,""),this.styleElement=this.renderer.createElement("style"),this.renderer.setAttribute(this.styleElement,"type","text/css"),Yt.D.setAttribute(this.styleElement,"nonce",this.config?.csp()?.nonce),this.renderer.appendChild(this.document.head,this.styleElement),this.renderer.setProperty(this.styleElement,"innerHTML",`\n                @media screen and (max-width: ${this.breakpoint}) {\n                    .p-picklist[${this.id}] {\n                        flex-direction: column;\n                    }\n\n                    .p-picklist[${this.id}] .p-picklist-buttons {\n                        padding: var(--content-padding);\n                        flex-direction: row;\n                    }\n\n                    .p-picklist[${this.id}] .p-picklist-buttons .p-button {\n                        margin-right: var(--inline-spacing);\n                        margin-bottom: 0;\n                    }\n\n                    .p-picklist[${this.id}] .p-picklist-buttons .p-button:last-child {\n                        margin-right: 0;\n                    }\n                }`))}sourceMoveDisabled(){if(this.disabled||!this.selectedItemsSource.length)return!0}targetMoveDisabled(){if(this.disabled||!this.selectedItemsTarget.length)return!0}moveRightDisabled(){return this.disabled||he.BF.isEmpty(this.selectedItemsSource)}moveLeftDisabled(){return this.disabled||he.BF.isEmpty(this.selectedItemsTarget)}moveAllRightDisabled(){return this.disabled||he.BF.isEmpty(this.source)}moveAllLeftDisabled(){return this.disabled||he.BF.isEmpty(this.target)}destroyStyle(){this.styleElement&&(this.renderer.removeChild(this.document.head,this.styleElement),this.styleElement=null)}ngOnDestroy(){this.destroyStyle(),this.destroyMedia()}static \u0275fac=function(n){return new(n||i)(e.rXU(M.qQ),e.rXU(e.Agw),e.rXU(e.sFG),e.rXU(e.aKT),e.rXU(e.gRc),e.rXU(ke.E),e.rXU(ke.r1))};
1static \u0275cmp=e.VBU({type:i,selectors:[["p-pickList"]],contentQueries:function(n,o,r){if(1&n&&e.wni(r,ke.Ei,4),2&n){let s;e.mGM(s=e.lsd())&&(o.templates=s)}},viewQuery:function(n,o){if(1&n&&(e.GBs($k,5),e.GBs(Uk,5),e.GBs(Yk,5),e.GBs(Hk,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.listViewSourceChild=r.first),e.mGM(r=e.lsd())&&(o.listViewTargetChild=r.first),e.mGM(r=e.lsd())&&(o.sourceFilterViewChild=r.first),e.mGM(r=e.lsd())&&(o.targetFilterViewChild=r.first)}},hostAttrs:[1,"p-element"],inputs:{source:"source",target:"target",sourceHeader:"sourceHeader",tabindex:[2,"tabindex","tabindex",e.Udg],rightButtonAriaLabel:"rightButtonAriaLabel",leftButtonAriaLabel:"leftButtonAriaLabel",allRightButtonAriaLabel:"allRightButtonAriaLabel",allLeftButtonAriaLabel:"allLeftButtonAriaLabel",upButtonAriaLabel:"upButtonAriaLabel",downButtonAriaLabel:"downButtonAriaLabel",topButtonAriaLabel:"topButtonAriaLabel",bottomButtonAriaLabel:"bottomButtonAriaLabel",targetHeader:"targetHeader",responsive:[2,"responsive","responsive",e.L39],filterBy:"filterBy",filterLocale:"filterLocale",trackBy:"trackBy",sourceTrackBy:"sourceTrackBy",targetTrackBy:"targetTrackBy",showSourceFilter:[2,"showSourceFilter","showSourceFilter",e.L39],showTargetFilter:[2,"showTargetFilter","showTargetFilter",e.L39],metaKeySelection:[2,"metaKeySelection","metaKeySelection",e.L39],dragdrop:[2,"dragdrop","dragdrop",e.L39],style:"style",styleClass:"styleClass",sourceStyle:"sourceStyle",targetStyle:"targetStyle",showSourceControls:[2,"showSourceControls","showSourceControls",e.L39],showTargetControls:[2,"showTargetControls","showTargetControls",e.L39],sourceFilterPlaceholder:"sourceFilterPlaceholder",targetFilterPlaceholder:"targetFilterPlaceholder",disabled:[2,"disabled","disabled",e.L39],ariaSourceFilterLabel:"ariaSourceFilterLabel",ariaTargetFilterLabel:"ariaTargetFilterLabel",filterMatchMode:"filterMatchMode",stripedRows:[2,"stripedRows","stripedRows",e.L39],keepSelection:[2,"keepSelection","keepSelection",e.L39],breakpoint:"breakpoint"},outputs:{onMoveToSource:"onMoveToSource",onMoveAllToSource:"onMoveAllToSource",onMoveAllToTarget:"onMoveAllToTarget",onMoveToTarget:"onMoveToTarget",onSourceReorder:"onSourceReorder",onTargetReorder:"onTargetReorder",onSourceSelect:"onSourceSelect",onTargetSelect:"onTargetSelect",onSourceFilter:"onSourceFilter",onTargetFilter:"onTargetFilter",onFocus:"onFocus",onBlur:"onBlur"},features:[e.GFd],decls:30,vars:74,consts:[["sourcelist",""],["targetlist",""],["builtInSourceElement",""],["sourceFilter",""],["builtInTargetElement",""],["targetFilter",""],["cdkDropListGroup","",3,"ngStyle","ngClass"],["class","p-picklist-buttons p-picklist-source-controls",4,"ngIf"],[1,"p-picklist-list-wrapper","p-picklist-source-wrapper"],["class","p-picklist-header",3,"id",4,"ngIf"],["class","p-picklist-filter-container",4,"ngIf"],["cdkDropList","","role","listbox","aria-multiselectable","true",1,"p-picklist-list","p-picklist-source",3,"keydown","focus","blur","cdkDropListDropped","id","cdkDropListData","ngStyle"],["ngFor","",3,"ngForOf","ngForTrackBy"],[4,"ngIf"],[1,"p-picklist-buttons","p-picklist-transfer-buttons"],["type","button","pButton","","pRipple","",1,"p-button-icon-only",3,"click","disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"p-picklist-list-wrapper","p-picklist-target-wrapper"],["cdkDropList","","role","listbox","aria-multiselectable","true",1,"p-picklist-list","p-picklist-target",3,"keydown","focus","blur","cdkDropListDropped","id","cdkDropListData","ngStyle"],["class","p-picklist-buttons p-picklist-target-controls",4,"ngIf"],[1,"p-picklist-buttons","p-picklist-source-controls"],[4,"ngTemplateOutlet"],[1,"p-picklist-header",3,"id"],["class","p-picklist-title",4,"ngIf"],[1,"p-picklist-title"],[1,"p-picklist-filter-container"],[4,"ngIf","ngIfElse"],[1,"p-picklist-filter"],["type","text","role","textbox",1,"p-picklist-filter-input","p-inputtext","p-component",3,"keyup","disabled"],[3,"styleClass",4,"ngIf"],["class","p-picklist-filter-icon",4,"ngIf"],[3,"styleClass"],[1,"p-picklist-filter-icon"],["pRipple","","cdkDrag","","role","option",3,"id","ngClass","cdkDragData","cdkDragDisabled","click","mousedown","dblclick","touchend",4,"ngIf"],["pRipple","","cdkDrag","","role","option",3,"click","mousedown","dblclick","touchend","id","ngClass","cdkDragData","cdkDragDisabled"],["class","p-picklist-empty-message",4,"ngIf"],[1,"p-picklist-empty-message"],[1,"p-picklist-buttons","p-picklist-target-control
1s"]],template:function(n,o){if(1&n){const r=e.RV6();e.j41(0,"div",6),e.DNE(1,rR,13,22,"div",7),e.j41(2,"div",8),e.DNE(3,lR,3,5,"div",9)(4,hR,4,3,"div",10),e.j41(5,"ul",11,0),e.bIt("keydown",function(c){return e.eBV(r),e.Njj(o.onItemKeyDown(c,o.selectedItemsSource,o.onSourceSelect,o.SOURCE_LIST))})("focus",function(c){return e.eBV(r),e.Njj(o.onListFocus(c,o.SOURCE_LIST))})("blur",function(c){return e.eBV(r),e.Njj(o.onListBlur(c,o.SOURCE_LIST))})("cdkDropListDropped",function(c){return e.eBV(r),e.Njj(o.onDrop(c,o.SOURCE_LIST))}),e.DNE(7,vR,1,1,"ng-template",12)(8,kR,3,2,"ng-container",13),e.k0s()(),e.j41(9,"div",14)(10,"button",15),e.bIt("click",function(){return e.eBV(r),e.Njj(o.moveRight())}),e.DNE(11,yR,3,2,"ng-container",13)(12,DR,1,0,null,16),e.k0s(),e.j41(13,"button",15),e.bIt("click",function(){return e.eBV(r),e.Njj(o.moveAllRight())}),e.DNE(14,MR,3,2,"ng-container",13)(15,PR,1,0,null,16),e.k0s(),e.j41(16,"button",15),e.bIt("click",function(){return e.eBV(r),e.Njj(o.moveLeft())}),e.DNE(17,AR,3,2,"ng-container",13)(18,BR,1,0,null,16),e.k0s(),e.j41(19,"button",15),e.bIt("click",function(){return e.eBV(r),e.Njj(o.moveAllLeft())}),e.DNE(20,$R,3,2,"ng-container",13)(21,YR,1,0,null,16),e.k0s()(),e.j41(22,"div",17),e.DNE(23,WR,3,5,"div",9)(24,tI,4,3,"div",10),e.j41(25,"ul",18,1),e.bIt("keydown",function(c){return e.eBV(r),e.Njj(o.onItemKeyDown(c,o.selectedItemsTarget,o.onTargetSelect,o.TARGET_LIST))})("focus",function(c){return e.eBV(r),e.Njj(o.onListFocus(c,o.TARGET_LIST))})("blur",function(c){return e.eBV(r),e.Njj(o.onListBlur(c,o.TARGET_LIST))})("cdkDropListDropped",function(c){return e.eBV(r),e.Njj(o.onDrop(c,o.TARGET_LIST))}),e.DNE(27,oI,1,1,"ng-template",12)(28,dI,3,2,"ng-container",13),e.k0s()(),e.DNE(29,EI,13,22,"div",19),e.k0s()}2&n&&(e.HbH(o.styleClass),e.Y8G("ngStyle",o.style)("ngClass",e.eq3(64,Xk,o.stripedRows)),e.BMQ("data-pc-name","picklist")("data-pc-section","root"),e.R7$(),e.Y8G("ngIf",o.showSourceControls),e.R7$(),e.BMQ("data-pc-section","sourceWrapper")("data-pc-group-section","listWrapper"),e.R7$(),e.Y8G("ngIf",o.sourceHeader||o.sourceHeaderTemplate),e.R7$(),e.Y8G("ngIf",o.filterBy&&!1!==o.showSourceFilter),e.R7$(),e.Y8G("id",o.idSource+"_list")("cdkDropListData",o.source)("ngStyle",o.sourceStyle),e.BMQ("aria-labelledby",o.idSource+"_header")("aria-activedescendant",o.focused.sourceList?o.focusedOptionId:void 0)("tabindex",o.source&&o.source.length>0?o.tabindex:-1)("data-pc-section","sourceList")("data-pc-group-section","list"),e.R7$(2),e.Y8G("ngForOf",o.source)("ngForTrackBy",o.sourceTrackBy||o.trackBy),e.R7$(),e.Y8G("ngIf",o.isEmpty(o.SOURCE_LIST)&&(o.emptyMessageSourceTemplate||o.emptyFilterMessageSourceTemplate)),e.R7$(),e.BMQ("data-pc-section","buttons")("data-pc-group-section","controls"),e.R7$(),e.Y8G("disabled",o.moveRightDisabled()),e.BMQ("aria-label",o.moveToTargetAriaLabel)("data-pc-section","moveToTargetButton"),e.R7$(),e.Y8G("ngIf",!o.moveToTargetIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",o.moveToTargetIconTemplate)("ngTemplateOutletContext",e.eq3(66,Pa,o.viewChanged)),e.R7$(),e.Y8G("disabled",o.moveAllRightDisabled()),e.BMQ("aria-label",o.moveAllToTargetAriaLabel)("data-pc-section","moveAllToTargetButton"),e.R7$(),e.Y8G("ngIf",!o.moveAllToTargetIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",o.moveAllToTargetIconTemplate)("ngTemplateOutletContext",e.eq3(68,Pa,o.viewChanged)),e.R7$(),e.Y8G("disabled",o.moveLeftDisabled()),e.BMQ("aria-label",o.moveToSourceAriaLabel)("data-pc-section","moveToSourceButton"),e.R7$(),e.Y8G("ngIf",!o.moveToSourceIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",o.moveToSourceIconTemplate)("ngTemplateOutletContext",e.eq3(70,Pa,o.viewChanged)),e.R7$(),e.Y8G("disabled",o.moveAllLeftDisabled()),e.BMQ("aria-label",o.moveAllToSourceAriaLabel)("data-pc-section","moveAllToSourceButton"),e.R7$(),e.Y8G("ngIf",!o.moveAllToSourceIconTemplate),e.R7$(),e.Y8G("ngTemplateOutlet",o.moveAllToSourceIconTemplate)("ngTemplateOutletContext",e.eq3(72,Pa,o.viewChanged)),e.R7$(),e.BMQ("data-pc-section","targetWrapper")("data-pc-group-section","listwrapper"),e.R7$(),e.Y8G("ngIf",o.targetHeader||o.targetHeaderTemplate),e.R7$(),e.Y8G("ngIf",o.filterBy&&!1!==o.showTargetFilter),e.R7$(),e.Y8G("id",o.idTarget+"_list")("cdkDropListData",o.target)("ngStyle",o.targetStyle),e.BMQ("aria-labelledby",o.idTarget+"_header")("aria-activedescendant",o.focused.targetList?o.focusedOptionId:void 0)("tabindex",o.target&&o.target.length>0?o.tabindex:-1)("data-pc-section","targetList")("data-pc-group-section","list"),e.R7$(2),e.Y8G("ngForOf",o.target)("ngForTrackBy",o.targetTrackBy||o.trackBy),e.R7$(),e.Y8G("ngIf",o.isEmpty(o.TARGET_LIST)&&(o.emptyMessageTargetTemplate||o.emptyFilterMessageTargetTemplate)),e.R7$(),e.Y8G("ngIf",o.showTargetControls))},dependencies:()=>[M.YU,M.Sq,M.bT,M.T3,M.B3,Ma._f,Fa.n,Ut.O7,Ut.RK,Ut.T1,yu.c,wu.J,Du.W,Ou.X,xu.R,Mu.u,md.D,Fu.Q,Pu.W],styles:["@layer primeng{.p-picklist{display:flex}.p-picklist-buttons{display:flex;flex-direction:column;justify-content:center}.p-picklist-list-wrapper{flex:1 1 50%}.p-picklist-list{list-style-type:none;margin:0;padding:0;overflow:auto;min-height:12rem}.p-picklist-item{display:block;cursor:pointer;overflow:hidden;position:relative}.p-picklist-item:not(.cdk-drag-disabled){cursor:move}.p-picklist-item.cdk-drag-placeholder{opacity:0}
1.p-picklist-item.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.p-picklist-filter{position:relative}.p-picklist-filter-icon{position:absolute;top:50%;margin-top:-.5rem}.p-picklist-filter-input{width:100%}.p-picklist-list.cdk-drop-list-dragging .p-picklist-item:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}}\n"],encapsulation:2,changeDetection:0})}return i})();const kI={zIndex:1200};let RI=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({providers:[{provide:Ut.j3,useValue:kI}],imports:[M.MD,Ma.tm,ke.Gg,Fa.Z,Ut.ad,yu.c,wu.J,Du.W,Ou.X,xu.R,Mu.u,md.D,Fu.Q,Pu.W,Vk,ke.Gg,Ut.ad]})}return i})();const Au=()=>({standalone:!0}),yo=()=>({width:"100%"}),Lu=()=>({height:"100%"});function II(i,a){1&i&&e.nrm(0,"i",14)}function yI(i,a){1&i&&e.nrm(0,"i",15)}function wI(i,a){1&i&&(e.j41(0,"div",16),e.nrm(1,"kendo-loader",17),e.j41(2,"span"),e.EFF(3,"Loading..."),e.k0s()())}function DI(i,a){1&i&&(e.j41(0,"small",47),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"AD_HOC_REPORTS.DATA_GRID_BUILDER.NAME_REQUIRED")," "))}function OI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",22)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",48),e.nI1(5,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.selectedWorkflowTypeId,o)||(r.selectedWorkflowTypeId=o),e.Njj(o)}),e.bIt("onChange",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onWorkflowChange())}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.SpI("",e.bMT(3,7,"AD_HOC_REPORTS.DATA_GRID_BUILDER.ELEMENT")," *"),e.R7$(2),e.Aen(e.lJ4(11,yo)),e.FS9("placeholder",e.bMT(5,9,"AD_HOC_REPORTS.DATA_GRID_BUILDER.ELEMENT_PLACEHOLDER")),e.Y8G("options",t.workflowTypes),e.R50("ngModel",t.selectedWorkflowTypeId),e.Y8G("filter",!0)}}function xI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",22)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",49),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.selectedDataSetId,o)||(r.selectedDataSetId=o),e.Njj(o)}),e.bIt("onChange",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onDataSetChange())}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.SpI("",e.bMT(3,6,"AD_HOC_REPORTS.DATA_GRID_BUILDER.DATA_SET")," *"),e.R7$(2),e.Aen(e.lJ4(8,yo)),e.Y8G("options",t.dataSets),e.R50("ngModel",t.selectedDataSetId),e.Y8G("filter",!0)}}function MI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",22)(1,"label"),e.EFF(2,"Date Field"),e.k0s(),e.j41(3,"p-dropdown",50),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.selectedDateField,o)||(r.selectedDateField=o),e.Njj(o)}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(3),e.Aen(e.lJ4(4,yo)),e.Y8G("options",t.dateFieldDropdownOptions),e.R50("ngModel",t.selectedDateField)}}function FI(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",51),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.predefinedDateRange,o)||(r.predefinedDateRange=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(2);e.Y8G("options",t.predefinedDateOptions),e.R50("ngModel",t.predefinedDateRange),e.Y8G("ngModelOptions",e.lJ4(3,Au))}}function PI(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",52)(1,"div",22)(2,"label"),e.EFF(3,"Page Size"),e.k0s(),e.j41(4,"p-dropdown",50),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.pageSize,o)||(r.pageSize=o),e.Njj(o)}),e.k0s()(),e.j41(5,"div",22)(6,"p-checkbox",53),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.showFilters,o)||(r.showFilters=o),e.Njj(o)}),e.k0s()()()}if(2&i){const t=e.XpG(2);e.R7$(4),e.Aen(e.lJ4(6,yo)),e.Y8G("options",t.pageSizeOptions),e.R50("ngModel",t.pageSize),e.R7$(2),e.R50("ngModel",t.showFilters),e.Y8G("binary",!0)}}function NI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",67)(1,"label"),e.EFF(2,"Maps to field:"),e.k0s(),e.j41(3,"p-dropdown",68),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.onParameterMappingChange(r.id,o))}),e.k0s()()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(3),e.Aen(e.lJ4(5,yo)),e.Y8G("options",n.filterFieldOptions)("ngModel",n.getParameterMappedField(t.id))("filter",!0)}}function GI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",56)(1,"div",57)(2,"div",58)(3,"span",59),e.EFF(4),e.k0s(),e.j41(5,"span",60),e.EFF(6),e.k0s()(),e.j41(7,"div",61)(8,"button",62),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onEditParameter(o))}),e.nrm(9,"i",63),e.k0s(),e.j41(10,"button",64),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onDeleteParameter(o))}),e.nrm(11,"i",65),e.k0s()()(),e.DNE(12,NI,4,6,"div",66),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(4),e.JRh(t.name),e.R7$(2),e.JRh(t.parameterType),e.R7$(6),e.Y8G("ngIf",n.filterFieldOptions.length>0)}}function AI(i,a){if(1&i&&(e.j41(0,"div",54),e.DNE(1,GI,13,3,"div",55),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.parameters)}}function LI(i,a){1&i&&(e.j41(0,"div",69)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.JRh(e.bMT(3,1,"AD_HOC_REPORTS.DATA_GRID_BUILDER.NO_PARAMETERS")))}function BI(i,a){if(1&i&&(e.j41(0,"span",70),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.SpI("",t.targetColumns.length," column(s) selected")}}function jI(i,a){1&i&&(e.j41(0,"div",16),e.nrm(1,"kendo-loader",71),e.j41(2,"span"),e.EFF(3,"Loading fields..."),e.k0s()())}function VI(i,a){1&i&&(e.j41(0,"div",72),e.nrm(1,"i",73),e.j41(2,"h4"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"AD_HOC_REPORTS.DATA_GRID_BUILDER.SELECT_SOURCE")),e.R7$(3),e.JRh(e.bMT(7,4,"AD_HOC_REPORTS.DATA_GRID_BUILDER.SELECT_SOURCE_HINT")))}function $I(i,a){if(1&i){const t=e.RV6();e.j41(0,"a",82),e.bIt("click",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.openFormatDialog(r,o))}),e.nrm(1,"i",83),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.AVh("has-settings",n.hasFormatSettings(t.name))}}function UI(i,a){if(1&i&&(e.j41(0,"div",77)(1,"span",78),e.EFF(2),e.k0s(),e.j41(3,"div",79)(4,"span",80),e.EFF(5),e.k0s(),e.DNE(6,$I,2,2,"a",81),e.k0s()()),2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(2),e.JRh(t.displayName),e.R7$(3),e.JRh(t.type),e.R7$(),e.Y8G("ngIf",n.isInTargetList(t))}}function YI(i,a){if(1&i&&(e.j41(0,"div",74)(1,"p-pickList",75),e.DNE(2,UI,7,3,"ng-template",76),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("source",t.sourceColumns)("target",t.targetColumns)("dragdrop",!0)("responsive",!0)("sourceStyle",e.lJ4(6,Lu))("targetStyle",e.lJ4(7,Lu))}}function HI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",18)(1,"div",19)(2,"p-card",20),e.nI1(3,"translate"),e.j41(4,"form",21)(5,"div",22)(6,"label",23),e.
1EFF(7),e.nI1(8,"translate"),e.k0s(),e.nrm(9,"input",24),e.nI1(10,"translate"),e.DNE(11,DI,3,3,"small",25),e.k0s(),e.j41(12,"div",22)(13,"label",26),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.nrm(16,"textarea",27),e.nI1(17,"translate"),e.k0s()()(),e.j41(18,"p-card",20),e.nI1(19,"translate"),e.j41(20,"div",22)(21,"label"),e.EFF(22),e.nI1(23,"translate"),e.k0s(),e.j41(24,"div",28)(25,"button",29),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return o.dataSourceType="element",e.Njj(o.onDataSourceTypeChange())}),e.nrm(26,"i",30),e.EFF(27),e.nI1(28,"translate"),e.k0s(),e.j41(29,"button",29),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return o.dataSourceType="dataset",e.Njj(o.onDataSourceTypeChange())}),e.nrm(30,"i",31),e.EFF(31),e.nI1(32,"translate"),e.k0s()()(),e.DNE(33,OI,6,12,"div",32)(34,xI,5,9,"div",32)(35,MI,4,5,"div",32),e.j41(36,"div",22)(37,"div",33)(38,"p-checkbox",34),e.nI1(39,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.usePredefinedDate,o)||(r.usePredefinedDate=o),e.Njj(o)}),e.k0s()(),e.DNE(40,FI,1,4,"p-dropdown",35),e.k0s()(),e.DNE(41,PI,7,7,"p-card",36),e.j41(42,"p-card",37),e.nI1(43,"translate"),e.DNE(44,AI,2,1,"div",38)(45,LI,4,3,"div",39),e.j41(46,"button",40),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onAddParameter())}),e.nrm(47,"i",41),e.EFF(48),e.nI1(49,"translate"),e.k0s()()(),e.j41(50,"div",42)(51,"div",43)(52,"h3"),e.EFF(53),e.nI1(54,"translate"),e.k0s(),e.DNE(55,BI,2,1,"span",44),e.k0s(),e.DNE(56,jI,4,0,"div",10)(57,VI,8,6,"div",45)(58,YI,3,8,"div",46),e.k0s()()}if(2&i){let t,n;const o=e.XpG();e.R7$(2),e.Y8G("header",e.bMT(3,35,"AD_HOC_REPORTS.DATA_GRID_BUILDER.SETTINGS_TITLE")),e.R7$(2),e.Y8G("formGroup",o.reportForm),e.R7$(3),e.SpI("",e.bMT(8,37,"AD_HOC_REPORTS.DATA_GRID_BUILDER.NAME_LABEL")," *"),e.R7$(2),e.AVh("ng-invalid",(null==(t=o.reportForm.get("name"))?null:t.invalid)&&(null==(t=o.reportForm.get("name"))?null:t.touched)),e.FS9("placeholder",e.bMT(10,39,"AD_HOC_REPORTS.DATA_GRID_BUILDER.NAME_PLACEHOLDER")),e.R7$(2),e.Y8G("ngIf",(null==(n=o.reportForm.get("name"))||null==n.errors?null:n.errors.required)&&(null==(n=o.reportForm.get("name"))?null:n.touched)),e.R7$(3),e.JRh(e.bMT(15,41,"AD_HOC_REPORTS.DATA_GRID_BUILDER.DESCRIPTION_LABEL")),e.R7$(2),e.FS9("placeholder",e.bMT(17,43,"AD_HOC_REPORTS.DATA_GRID_BUILDER.DESCRIPTION_PLACEHOLDER")),e.R7$(2),e.Y8G("header",e.bMT(19,45,"AD_HOC_REPORTS.DATA_GRID_BUILDER.DATA_SOURCE")),e.R7$(4),e.JRh(e.bMT(23,47,"AD_HOC_REPORTS.DATA_GRID_BUILDER.SOURCE_TYPE")),e.R7$(3),e.AVh("active","element"===o.dataSourceType),e.R7$(2),e.SpI(" ",e.bMT(28,49,"AD_HOC_REPORTS.DATA_GRID_BUILDER.ELEMENT")," "),e.R7$(2),e.AVh("active","dataset"===o.dataSourceType),e.R7$(2),e.SpI(" ",e.bMT(32,51,"AD_HOC_REPORTS.DATA_GRID_BUILDER.DATA_SET")," "),e.R7$(2),e.Y8G("ngIf","element"===o.dataSourceType),e.R7$(),e.Y8G("ngIf","dataset"===o.dataSourceType),e.R7$(),e.Y8G("ngIf",o.selectedWorkflowTypeId||o.selectedDataSetId),e.R7$(3),e.R50("ngModel",o.usePredefinedDate),e.Y8G("ngModelOptions",e.lJ4(61,Au))("binary",!0)("label",e.bMT(39,53,"AD_HOC_REPORTS.DATA_GRID_BUILDER.PREDEFINED_DATE")),e.R7$(2),e.Y8G("ngIf",o.usePredefinedDate),e.R7$(),e.Y8G("ngIf",o.selectedWorkflowTypeId||o.selectedDataSetId),e.R7$(),e.Y8G("header",e.bMT(43,55,"AD_HOC_REPORTS.DATA_GRID_BUILDER.PARAMETERS")),e.R7$(2),e.Y8G("ngIf",o.parameters.length),e.R7$(),e.Y8G("ngIf",!o.parameters.length),e.R7$(3),e.SpI(" ",e.bMT(49,57,"AD_HOC_REPORTS.DATA_GRID_BUILDER.ADD_PARAMETER")," "),e.R7$(5),e.JRh(e.bMT(54,59,"AD_HOC_REPORTS.DATA_GRID_BUILDER.SELECT_COLUMNS")),e.R7$(2),e.Y8G("ngIf",o.targetColumns.length),e.R7$(),e.Y8G("ngIf",o.fieldsLoading),e.R7$(),e.Y8G("ngIf",!o.fieldsLoading&&!o.selectedWorkflowTypeId&&!o.selectedDataSetId),e.R7$(),e.Y8G("ngIf",!o.fieldsLoading&&(o.selectedWorkflowTypeId||o.selectedDataSetId)&&o.availableFields.length>0)}}function XI(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-parameter-configurator",84),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onParameterSaved(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onParameterDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("parameter",t.editingParameter)("visible",t.showParameterDialog)("workflowTypes",t.workflowTypes)("loadFieldMetadataFn",t.loadFieldMetadataCallback)}}function WI(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-column-format-dialog",85),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onFormatSaved(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onFormatDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("visible",t.showFormatDialog)("column",t.editingFormatColumn)("isNumeric",t.editingFormatIsNumeric)}}let Bu=(()=>{class i{constructor(t,n,o,r,s){this._router=t,this._route=n,this._fb=o,this._apiService=r,this._messagingService=s,this._destroyed$=new ue.B7,this.workflowTypes=[],this.dataSets=[],this.fieldMetadataCache=new Map,this.dataSetFieldMetadataCache=new Map,this.loading=!1,this.saving=!1,this.isEditMode=!1,this.reportId=null,this.report=null,this.dataSourceType="element",this.selectedWorkflowTypeId=null,this.selectedDataSetId=null,this.selectedDateField="createdDate",this.pageSize=25,this.show
1Filters=!0,this.availableFields=[],this.dateFieldOptions=[],this.fieldsLoading=!1,this.sourceColumns=[],this.targetColumns=[],this.parameters=[],this.parameterMappings=[],this.showParameterDialog=!1,this.editingParameterIndex=-1,this.editingParameter=null,this.filterFieldOptions=[],this.columnFormats=new Map,this.showFormatDialog=!1,this.editingFormatColumn=null,this.editingFormatIsNumeric=!1,this.pageSizeOptions=[{label:"10",value:10},{label:"25",value:25},{label:"50",value:50},{label:"100",value:100}],this.usePredefinedDate=!1,this.predefinedDateRange=null,this._savedEndpointParams={},this.predefinedDateOptions=[{label:"Current Week",value:"currentWeek"},{label:"Current Month",value:"currentMonth"},{label:"Current Quarter",value:"currentQuarter"},{label:"Current Year",value:"currentYear"}],this.dateFieldDropdownOptions=[{label:"Created Date",value:"createdDate"},{label:"Modified Date",value:"modifiedDate"}],this.loadFieldMetadataCallback=c=>{const u=this.fieldMetadataCache.get(c);return u?(0,le.of)(u):this._apiService.getFieldMetadata(c).pipe((0,Te.M)(g=>{const b=new Map(this.fieldMetadataCache);b.set(c,g),this.fieldMetadataCache=b}))},this.initForm()}ngOnInit(){this.reportId=this._route.snapshot.params.reportId,this.isEditMode=!!this.reportId,this.loadInitialData()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}initForm(){this.reportForm=this._fb.group({name:["",[R.k0.required,R.k0.maxLength(200)]],description:["",[R.k0.maxLength(1e3)]]})}loadInitialData(){this.loading=!0;const t={workflowTypes:this._apiService.getWorkflowTypes().pipe((0,ye.W)(()=>(0,le.of)([]))),dataSets:this._apiService.getDataSets().pipe((0,ye.W)(()=>(0,le.of)([])))};this.isEditMode&&this.reportId&&(t.report=this._apiService.getReportById(this.reportId).pipe((0,ye.W)(()=>(0,le.of)(null)))),(0,vt.p)(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:n=>{this.workflowTypes=n.workflowTypes||[],this.dataSets=n.dataSets||[],this.isEditMode&&n.report&&(this.report=n.report,this.populateFromReport(n.report))},error:()=>{this._messagingService.error("Failed to load data","Error")}})}populateFromReport(t){if(this.reportForm.patchValue({name:t.name,description:t.description}),t.dashboardConfiguration)try{const n=JSON.parse(t.dashboardConfiguration);if(this.parameters=n.parameters||[],n.widgets?.length>0){const o=n.widgets[0];o.dataSetId?(this.dataSourceType="dataset",this.selectedDataSetId=o.dataSetId,this.loadDataSetFields(o.dataSetId,o)):o.workflowTypeId&&(this.dataSourceType="element",this.selectedWorkflowTypeId=o.workflowTypeId,this.loadElementFields(o.workflowTypeId,o)),this.selectedDateField=o.dateField||"createdDate",this.pageSize=o.pageSize||25,this.showFilters=!1!==o.showFilters,this.columnFormats.clear();for(const r of o.columns||[])(r.aggregate||r.wrapText||r.numberFormat||null!=r.decimalPlaces)&&this.columnFormats.set(r.field,{aggregate:r.aggregate,wrapText:r.wrapText,numberFormat:r.numberFormat,decimalPlaces:r.decimalPlaces})}}catch(n){console.error("Error parsing configuration:",n)}if(t.endpointParameters)try{const n="string"==typeof t.endpointParameters?JSON.parse(t.endpointParameters):t.endpointParameters;this._savedEndpointParams=n,n.standardDateRange&&(this.usePredefinedDate=!0,this.predefinedDateRange=n.standardDateRange)}catch{}}onDataSourceTypeChange(){this.selectedWorkflowTypeId=null,this.selectedDataSetId=null,this.availableFields=[],this.dateFieldOptions=[],this.sourceColumns=[],this.targetColumns=[]}onWorkflowChange(){this.selectedWorkflowTypeId&&this.loadElementFields(this.selectedWorkflowTypeId)}onDataSetChange(){this.selectedDataSetId&&this.loadDataSetFields(this.selectedDataSetId)}loadElementFields(t,n){this.fieldsLoading=!0,this._apiService.getFieldMetadata(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.fieldsLoading=!1)).subscribe({next:o=>{const r=new Map(this.fieldMetadataCache);r.set(t,o),this.fieldMetadataCache=r,this.populateFieldOptions(o,n)},error:()=>{this._messagingService.error("Failed to load fields","Error")}})}loadDataSetFields(t,n){this.fieldsLoading=!0,this._apiService.getDataSetFields(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.fieldsLoading=!1)).subscribe({next:o=>{const r=new Map(this.dataSetFieldMetadataCache);r.set(t,o),this.dataSetFieldMetadataCache=r,this.populateFieldOptions(o,n)},error:()=>{this._messagingService.error("Failed to load fields","Error")}})}populateFieldOptions(t,n){const o=[...t.commonFields||[],...t.elementFields||[]];this.availableFields=o,this.dateFieldOptions=o.filter(s=>"datetime"===s.type),this.dateFieldDropdownOptions=[{label:"Created Date",value:"createdDate"},{label:"Modified Date",value:"modifiedDate"},...this.dateFieldOptions.filter(s=>"createdDate"!==s.name&&"modifiedDate"!==s.name).map(s=>({label:s.displayName,value:s.name}))];const r=["string","text","lookup","dropdown","status"];if(this.filterFieldOptions=o.filter(s=>r.includes(s.type?.toLowerCase()||"")).map(s=>({label:s.displayName,value:s.name})),n?.columns?.length){const s=n.columns.map(c=>c.field);this.targetColumns=n.columns.map(c=>o.find(g=>g.name===c.field)||{name:c.field,displayName:c.title||c.field,type:"string"}),this.sourceColumns=o.filter(c=>!s.includes(c.name)),n.parameterMappings?.length&&(this.parameterMappings=[...n.parameterMappings])}else this.sourceColumns=[...o],this.targetColumns=[]}onAddParameter(){this.editingParameter={id:"param-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),name:"",workflowTypeId:0,fieldName:"",parameterType:"dropdown",required:!1},this.editingParameterIndex=-1,this.showParameterDialog=!0}onEditParameter(t){this.editingParameter={...this.parameters[t]},this.editingParameterIndex=t,this.showParameterDialog=!0}onDeleteParameter(t){const n=this.parameters[t].id;this.parameters.splice(t,1),this.parameterMappings=this.parameterMappings.filter(o=>o.parameterId!==n)}onParameterSaved(t){this.editingParameterIndex>=0?this.parameters[this.editingParameterIndex]=t:this.parameters.push(t),this.showParameterDialog=!1,this.editingParameter=null}onParameterDialogClosed(){this.showParameterDialog=!1,this.editingParameter=null,this.editingParameterIndex=-1}getParameterMappedField(t){return this.parameterMappings.find(o=>o.parameterId===t)?.widgetFieldName||""}onParameterMappingChange(t,n){const o=this.parameterMappings.find(r=>r.parameterId===t);o?o.widgetFieldName=n:this.parameterMappings.push({parameterId:t,widgetFieldName:n})}isNumericField(t){return"number"===t.type}isInTargetList(t){return this.targetColumns.some(n=>n.name===t.name)}openFormatDialog(t,n){n.stopPropagation();const o=this.columnFormats.get(t.name)||{};this.editingFormatColumn={field:t.name,title:t.displayName,aggregate:o.aggregate,wrapText:o.wrapText,numberFormat:o.numberFormat,decimalPlaces:o.decimalPlaces}
1,this.editingFormatIsNumeric=this.isNumericField(t),this.showFormatDialog=!0}onFormatSaved(t){this.columnFormats.set(t.field,{aggregate:t.aggregate,wrapText:t.wrapText,numberFormat:t.numberFormat,decimalPlaces:t.decimalPlaces}),this.showFormatDialog=!1,this.editingFormatColumn=null}onFormatDialogClosed(){this.showFormatDialog=!1,this.editingFormatColumn=null}hasFormatSettings(t){const n=this.columnFormats.get(t);return!!n&&!!(n.aggregate||n.wrapText||n.numberFormat||null!=n.decimalPlaces)}onSave(){if(this.reportForm.invalid)return this.reportForm.markAllAsTouched(),void this._messagingService.warning("Please fill in all required fields","Validation");if(!this.selectedWorkflowTypeId&&!this.selectedDataSetId)return void this._messagingService.warning("Please select a data source","Validation");if(0===this.targetColumns.length)return void this._messagingService.warning("Please select at least one column","Validation");this.saving=!0;const t=this.reportForm.value,n={id:"datagrid-widget",type:w.v2.Grid,title:t.name,workflowTypeId:this.selectedWorkflowTypeId||0,dataSetId:this.selectedDataSetId||void 0,dateField:this.selectedDateField,col:0,row:0,colSpan:12,rowSpan:4,columns:this.targetColumns.map(g=>{const b=this.columnFormats.get(g.name)||{};return{field:g.name,title:g.displayName,aggregate:b.aggregate,wrapText:b.wrapText,numberFormat:b.numberFormat,decimalPlaces:b.decimalPlaces}}),pageSize:Number(this.pageSize)||25,showFilters:this.showFilters,parameterMappings:[]},o=this.parameterMappings.filter(g=>g.widgetFieldName);o.length>0&&(n.parameterMappings=o);const s=JSON.stringify({columns:12,rowHeight:120,gap:16,widgets:[n],parameters:this.parameters.length>0?this.parameters:void 0}),c={dateField:this.selectedDateField};this.usePredefinedDate&&this.predefinedDateRange?c.standardDateRange=this.predefinedDateRange:(this._savedEndpointParams.dateFrom&&(c.dateFrom=this._savedEndpointParams.dateFrom),this._savedEndpointParams.dateTo&&(c.dateTo=this._savedEndpointParams.dateTo)),this._savedEndpointParams.parameterValues&&(c.parameterValues=this._savedEndpointParams.parameterValues);const u=JSON.stringify(c);this.isEditMode&&this.reportId?this._apiService.updateReport(this.reportId,{name:t.name,description:t.description,dashboardConfiguration:s,endpointParameters:u}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:b=>{this._messagingService.success("Data Grid updated successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",b.adHocReportId])},error:()=>{this._messagingService.error("Failed to update Data Grid","Error")}}):this._apiService.createReport({name:t.name,description:t.description,entityType:w.dX.Workflow,visualizationType:w.vi.DataGrid,dashboardConfiguration:s,endpointParameters:u}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:b=>{this._messagingService.success("Data Grid created successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",b.adHocReportId])},error:()=>{this._messagingService.error("Failed to create Data Grid","Error")}})}onCancel(){this._router.navigate(["/private/ad-hoc-reports"])}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(R.ok),e.rXU(Ye.F),e.rXU(q.Ui))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-datagrid-builder"]],decls:25,vars:27,consts:[[1,"datagrid-builder-container"],[1,"builder-header"],[1,"header-title"],["type","button",1,"button","button_clear","button_colorAlt",3,"click","title"],[1,"mdi","mdi-arrow-left"],[1,"header-actions"],["type","button",1,"button","button_outline",3,"click","title"],["type","button",1,"button","button_colorSuccess",3,"click","title","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-content-save buttonIcon_right",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","builder-content",4,"ngIf"],[3,"parameter","visible","workflowTypes","loadFieldMetadataFn","saved","closed",4,"ngIf"],[3,"visible","column","isNumeric","saved","closed",4,"ngIf"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-content-save","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[1,"builder-content"],[1,"settings-sidebar"],[3,"header"],[3,"formGroup"],[1,"form-field"],["for","name"],["id","name","type","text","pInputText","","formControlName","name",3,"placeholder"],["class","p-error",4,"ngIf"],["for","description"],["id","description","pInputTextarea","","formControlName","description","rows","2",3,"placeholder"],[1,"source-type-toggle"],["type","button",1,"toggle-btn",3,"click"],[1,"mdi","mdi-sitemap"],[1,"mdi","mdi-database"],["class","form-field",4,"ngIf"],[1,"predefined-toggle"],[3,"ngModelChange","ngModel","ngModelOptions","binary","label"],["o
1ptionLabel","label","optionValue","value","placeholder","Select date range...",3,"options","ngModel","ngModelOptions","ngModelChange",4,"ngIf"],["header","Grid Options",4,"ngIf"],[1,"parameters-card",3,"header"],["class","parameter-list",4,"ngIf"],["class","no-parameters",4,"ngIf"],["type","button",1,"button","button_outline","button_sm","add-parameter-btn",3,"click"],[1,"mdi","mdi-plus"],[1,"main-content"],[1,"content-header"],["class","column-count",4,"ngIf"],["class","empty-canvas",4,"ngIf"],["class","column-picklist",4,"ngIf"],[1,"p-error"],["optionLabel","name","optionValue","workflowTypeId","filterBy","name",3,"ngModelChange","onChange","options","ngModel","filter","placeholder"],["optionLabel","name","optionValue","dataSetId","filterBy","name","placeholder","Select data set...",3,"ngModelChange","onChange","options","ngModel","filter"],["optionLabel","label","optionValue","value",3,"ngModelChange","options","ngModel"],["optionLabel","label","optionValue","value","placeholder","Select date range...",3,"ngModelChange","options","ngModel","ngModelOptions"],["header","Grid Options"],["label","Show column filters",3,"ngModelChange","ngModel","binary"],[1,"parameter-list"],["class","parameter-item-wrapper",4,"ngFor","ngForOf"],[1,"parameter-item-wrapper"],[1,"parameter-item"],[1,"parameter-info"],[1,"parameter-name"],[1,"parameter-type-badge"],[1,"parameter-actions"],["type","button","title","Edit Parameter",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil"],["type","button","title","Delete Parameter",1,"button","button_round","delete-btn",3,"click"],[1,"mdi","mdi-trash-can"],["class","parameter-mapping",4,"ngIf"],[1,"parameter-mapping"],["optionLabel","label","optionValue","value","placeholder","Select field...",3,"ngModelChange","options","ngModel","filter"],[1,"no-parameters"],[1,"column-count"],["type","pulsing","size","medium"],[1,"empty-canvas"],[1,"mdi","mdi-table-large"],[1,"column-picklist"],["sourceHeader","Available Fields","targetHeader","Selected Columns (drag to reorder)","filterBy","displayName","sourceFilterPlaceholder","Search fields...","targetFilterPlaceholder","Search columns...",3,"source","target","dragdrop","responsive","sourceStyle","targetStyle"],["pTemplate","item"],[1,"picklist-item"],[1,"field-name"],[1,"field-options"],[1,"field-type"],["class","format-icon","title","Column format settings",3,"has-settings","click",4,"ngIf"],["title","Column format settings",1,"format-icon",3,"click"],[1,"mdi","mdi-cog"],[3,"saved","closed","parameter","visible","workflowTypes","loadFieldMetadataFn"],[3,"saved","closed","visible","column","isNumeric"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),e.nI1(4,"translate"),e.bIt("click",function(){return o.onCancel()}),e.nrm(5,"i",4),e.k0s(),e.j41(6,"h2"),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"div",5)(11,"button",6),e.nI1(12,"translate"),e.bIt("click",function(){return o.onCancel()}),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"button",7),e.nI1(16,"translate"),e.bIt("click",function(){return o.onSave()}),e.DNE(17,II,1,0,"i",8)(18,yI,1,0,"i",9),e.EFF(19),e.nI1(20,"translate"),e.k0s()()(),e.DNE(21,wI,4,0,"div",10)(22,HI,59,62,"div",11),e.k0s(),e.DNE(23,XI,1,4,"cad-parameter-configurator",12)(24,WI,1,3,"cad-column-format-dialog",13)),2&n&&(e.R7$(3),e.Y8G("title",e.bMT(4,13,"GENERAL.GO_BACK")),e.R7$(4),e.SpI(" ",o.isEditMode?e.bMT(8,15,"AD_HOC_REPORTS.DATA_GRID_BUILDER.EDIT_TITLE"):e.bMT(9,17,"AD_HOC_REPORTS.DATA_GRID_BUILDER.NEW_TITLE")," "),e.R7$(4),e.Y8G("title",e.bMT(12,19,"GENERAL.CANCEL")),e.R7$(2),e.SpI(" ",e.bMT(14,21,"GENERAL.CANCEL")," "),e.R7$(2),e.Y8G("title",e.bMT(16,23,"AD_HOC_REPORTS.DATA_GRID_BUILDER.SETTINGS_TITLE"))("disabled",o.saving),e.R7$(2),e.Y8G("ngIf",o.saving),e.R7$(),e.Y8G("ngIf",!o.saving),e.R7$(),e.SpI(" ",e.bMT(20,25,"AD_HOC_REPORTS.DATA_GRID_BUILDER.SAVE")," "),e.R7$(2),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading),e.R7$(),e.Y8G("ngIf",o.showParameterDialog&&o.editingParameter),e.R7$(),e.Y8G("ngIf",o.showFormatDialog&&o.editingFormatColumn))},dependencies:[M.Sq,M.bT,R.qT,R.me,R.BC,R.cb,R.vS,R.j4,R.JD,ke.Ei,ut.Sc,Le.ms,_e.S,mt.Z,ee.C3,ze.VU,_n,SI,Gn,ku,nt.D9],styles:[".datagrid-builder-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:#fafafa}.builder-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.5rem;background:#fff;border-bottom:1px solid #dedede}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:#000}.builder-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px;gap:1rem;color:#7b7b7b}.builder-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.settings-sidebar[_ngcontent-%COMP%]{width:320px;min-width:320px;padding:1rem;background:#fff;border-right:1px solid #dedede;overflow-y:auto;display:flex;flex-direction:column;gap:1rem}.settings-sidebar[_ngcontent-%COMP%]     .p-card .p-card-header{padding:.75rem 1rem;background:#fafafa;font-weight:600;font-size:.875rem;border-bottom:1px solid #dedede}.settings-sidebar[_ngcontent-%COMP%]     .p-card .p-card-body{padding:1rem}.form-field[_ngcontent-%COMP%]{margin-bottom:1rem}.form-field[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:#000}.form-field[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]{width:100%}.form-field[_ngcontent-%COMP%]   .p-error[_ngcontent-%COMP%]{display:block;margin-top:.25rem}.source-type-toggle[_ngcontent-%COMP%]{display:flex;gap:.5rem}.source-type-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]{flex:1;display:flex;align-items:center;justify-content:center;gap:.375rem;padding:.5rem;border:1px solid #dedede;border-radius:6px;background:#fff;color:#7b7b7b;font-size:.8125rem;cursor:pointer;transition:all .2s}.source-type-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]:hover{border-color:#5f84fc;color:#5f84fc}.source-type-toggle[_ngcontent-%COMP%]   .toggle-btn.active[_ngcontent-%COMP%]{background:#5f84fc;border-color:#5f84fc;color:#fff}.source-type-toggle[_ngcontent-%COMP%]   .toggle-btn[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1rem}.parameters-card[_ngcontent-%COMP%]     .p-card-body{padding:.75rem!important}.parameter-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.75rem}.parameter-item-wrapper[_ngcontent-%COMP%]{padding:.5rem .75rem;border-radius:6px;background:#fafafa}.parameter-item-wrapper[_ngcontent-%COMP%]:hover{background:#f2f2f2}.parameter-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-name[_ng
1content-%COMP%]{font-weight:500;font-size:.875rem;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-type-badge[_ngcontent-%COMP%]{font-size:.625rem;padding:.125rem .375rem;border-radius:10px;background:#5f84fc;color:#fff;text-transform:uppercase;font-weight:600;white-space:nowrap}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .button[_ngcontent-%COMP%]{color:#0009}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{background-color:transparent;border:none;color:#0009}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]:hover{background-color:#0000000a}.parameter-mapping[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.375rem;padding-top:.375rem;border-top:1px solid #dedede}.parameter-mapping[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-size:.75rem;color:#7b7b7b;white-space:nowrap}.parameter-mapping[_ngcontent-%COMP%]     .p-dropdown{flex:1}.no-parameters[_ngcontent-%COMP%]{padding:.75rem;text-align:center;font-size:.8125rem;color:#7b7b7b;margin-bottom:.75rem}.add-parameter-btn[_ngcontent-%COMP%]{width:100%;justify-content:center;gap:.25rem}.main-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:1rem;overflow:auto;background:#fafafa}.content-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.content-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:#000}.content-header[_ngcontent-%COMP%]   .column-count[_ngcontent-%COMP%]{font-size:.875rem;color:#7b7b7b}.empty-canvas[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#fff;border:2px dashed #dedede;border-radius:8px;padding:3rem}.empty-canvas[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:3rem;color:#7b7b7b;margin-bottom:1rem}.empty-canvas[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1.125rem;font-weight:600;color:#000}.empty-canvas[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;color:#7b7b7b}.column-picklist[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column}.column-picklist[_ngcontent-%COMP%]     .p-picklist{flex:1;height:100%}.column-picklist[_ngcontent-%COMP%]     .p-picklist .p-picklist-list-wrapper{flex:1}.column-picklist[_ngcontent-%COMP%]     .p-picklist .p-picklist-list{min-height:300px}.column-picklist[_ngcontent-%COMP%]     .p-picklist .p-picklist-header{font-weight:600;font-size:.875rem;padding:.75rem 1rem;background:#fafafa;border-bottom:1px solid #dedede}.column-picklist[_ngcontent-%COMP%]     .p-picklist .p-picklist-filter-container{padding:.5rem}.picklist-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;padding:.25rem 0}.picklist-item[_ngcontent-%COMP%]   .field-name[_ngcontent-%COMP%]{font-weight:500;font-size:.875rem;color:#000;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.picklist-item[_ngcontent-%COMP%]   .field-options[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.picklist-item[_ngcontent-%COMP%]   .field-type[_ngcontent-%COMP%]{font-size:.75rem;color:#7b7b7b;text-transform:lowercase}.picklist-item[_ngcontent-%COMP%]   .format-icon[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;color:#7b7b7b;cursor:pointer;font-size:1rem;transition:color .2s}.picklist-item[_ngcontent-%COMP%]   .format-icon[_ngcontent-%COMP%]:hover, .picklist-item[_ngcontent-%COMP%]   .format-icon.has-settings[_ngcontent-%COMP%]{color:#2196f3}"]})}}return i})();var Na=F(36613);function zI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",20),e.bIt("dragstart",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldDragStart(r,o))})("dragover",function(o){e.eBV(t);const r=e.XpG(3);return e.Njj(r.onFieldDragOver(o))})("drop",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldDrop(r,o))}),e.j41(1,"p-checkbox",21),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldToggle(r,o.checked))}),e.k0s(),e.j41(2,"span",22),e.EFF(3),e.k0s(),e.j41(4,"span",23),e.EFF(5),e.k0s(),e.nrm(6,"i",24),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.AVh("drop-target-highlight",n.isFieldDropTarget(t)),e.R7$(),e.Y8G("ngModel",t.checked)("binary",!0),e.R7$(2),e.JRh(t.displayName),e.R7$(2),e.JRh(t.fieldType)}}function KI(i,a){if(1&i&&(e.j41(0,"div",18),e.DNE(1,zI,7,6,"div",19),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.commonFields)}}function JI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",10)(1,"div",11),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.commonCollapsed=!o.commonCollapsed)}),e.nrm(2,"i",12),e.j41(3,"span",13),e.EFF(4,"Common Fields"),e.k0s(),e.j41(5,"span",14),e.bIt("click",function(o){return e.eBV(t),e.Njj(o.stopPropagation())}),e.j41(6,"a",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.selectAllCommon())}),e.EFF(7,"All"),e.k0s(),e.j41(8,"span",16),e.EFF(9,"|"),e.k0s(),e.j41(10,"a",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.deselectAllCommon())}),e.EFF(11,"None"),e.k0s()()(),e.DNE(12,KI,2,1,"div",17),e.k0s()}if(2&i){const t=e.XpG();e.R7$(2),e.AVh("mdi-chevron-down",!t.commonCollapsed)("mdi-chevron-right",t.commonCollapsed),e.R7$(10),e.Y8G("ngIf",!t.commonCollapsed)}}function qI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",20),e.bIt("dragstart",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldDragStart(r,o))})("dragover",function(o){e.eBV(t);const r=e.XpG(3);return e.Njj(r.onFieldDragOver(o))})("drop",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldDrop(r,o))}),e.j41(1,"p-checkbox",21),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldToggle(r,o.checked))}),e.k0s(),e.j41(2,"span",22),e.EFF(3),e.k0s(),e.j41(4,"span",23),e.EFF(5),e.k0s(),e.nrm(6,"i",24),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.AVh("drop-target-highlight",n.isFieldDropTarget(t)),e.R7$(),e.Y8G("ngModel",t.checked)("binary",!0),e.R7$(2),e.JRh(t.displayName),e.R7$(2),e.JRh(t.fieldType)}}function QI(i,a){if(1&i&&(e.j41(0,"div",18),e.DNE(1,qI,7,6,"div",19),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.customFields)}}function ZI(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",10)(1,"div",11),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.customCollapsed=!o.customCollapsed)}),e.nrm(2,"i",12),e.j41(3,"span",13),e.EFF(4,"Custom Fields"),e.k0s(),e.j41(5,"span",14),e.bIt("click",function(o){return e.eBV(t),e.Njj(o.stopPropagation())}),e.j41(6,"a",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.selectAllCustom())}),e.EFF(7,"All"),e.k0s(),e.j41(8,"span",16),e.EFF(9,"|"),e.k0s(),e.j41(10,"a",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.deselectAllCustom())}),e.EFF(11,"None"),e.k0s()()(),e.DNE(12,QI,2,1,"div",17),e.k0s()}if(2&i){const t=e.XpG();e.R7$(2),e.AVh("mdi-chevron-down",!t.customCollapsed)("mdi-chevron-right",t.customCollapsed),e.R7$(10),e.Y8G("ngIf",!t.customCollapsed)}}function e2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",26),e.bIt("dragstart",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldDragStart(r,o))})("dragover",function(o){e.eBV(t);const r=e.XpG(3);return e.Njj(r.onFieldDragOver(o))})("drop",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldDrop(r,o))}),e.j41(1,"p-checkbox",27),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldToggle(r,o.checked))})("click",function(o){return e.eBV(t),e.Njj(o.stopPropagation())}),e.k0s(),e.j41(2,"span",28),e.nrm(3,"i",12),e.k0s(),e.j41(4,"span",22),e.EFF(5),e.k0s(),e.j41(6,"span",23),e.EFF(7,"relation"),e.k0s(),e.nrm(8,"i",24),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.AVh("linked",t.dataFieldId===n.linkedRelationFieldId)("drop-target-highlight",n.isFieldDropTarget(t)),e.R7$(),e.Y8G("ngModel",t.checked)("binary",!0),e.R7$(),e.AVh("linked",t.dataFieldId===n.linkedRelationFieldId),e.R7$(),e.AVh("mdi-circle",t.dataFieldId!==n.linkedRelationFieldId)("mdi-check-circle",t.dataFieldId===n.linkedRelationFieldId),e.R7$(2),e.JRh(t.displayName)}}function t2(i,a){if(1&i&&(e.j41(0,"div",18),e.DNE(1,e2,9,13,"div",25),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.relationFields)}}function n2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",10)(1,"div",11),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.relationCollapsed=!o.relationCollapsed)}),e.nrm(2,"i",12),e.j41(3,"span",13),e.EFF(4,"Relations"),e.k0s(),e.j41(5,"span",14),e.bIt("click",function(o){return e.eBV(t),e.Njj(o.stopPropagation())}),e.j41(6,"a",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.selectAllRelation())}),e.EFF(7,"All"),e.k0s(),e.j41(8,"span",16),e.EFF(9,"|"),e.k0s(),e.j41(10,"a",15),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.deselectAllRelation())}),e.EFF(11,"None"),e.k0s()()(),e.DNE(12,t2,2,1,"div",17),e.k0s()}if(2&i){const t=e.XpG();e.R7$(2),e.AVh("mdi-chevron-down",!t.relationCollapsed)("mdi-chevron-right",t.relationCollapsed),e.R7$(10),e.Y8G("ngIf",!t.relationCollapsed)}}let o2=(()=>{class i{constructor(t){this.elementRef=t,this.isDragTarget=!1,this.linkedRelationFieldId=null,this.dropTargetFieldKey=null,this.fieldCheckedChange=new e.bkB,this.cardRemoved=new e.bkB,this.relationDragStart=new e.bkB,this.fieldDragStart=new e.bkB,this.fieldDropped=new e.bkB,this.cardDragOver=new e.bkB,this.cardDrop=new e.bkB,this.commonCollapsed=!1,this.customCollapsed=!1,this.relationCollapsed=!1}get commonFields(){return this.card.fields.filter(t=>t.isCommon&&!t.isRelation)}get customFields(){return this.card.fields.filter(t=>!t.isCommon&&!t.isRelation)}get relationFields(){return this.card.fields.filter(t=>t.isRelation)}get selectedCount(){return this.card.fields.filter(t=>t.checked).length}get totalCheckableCount(){return this.card.fields.length}onFieldToggle(t,n){this.fieldCheckedChange.emit({field:t,checked:n})}selectAllCommon(){for(const t of this.commonFields)t.checked||this.fieldCheckedChange.emit({field:t,checked:!0})}deselectAllCommon(){for(const t of this.commonFields)t.checked&&this.fieldCheckedChange.emit({field:t,checked:!1}
1)}selectAllCustom(){for(const t of this.customFields)t.checked||this.fieldCheckedChange.emit({field:t,checked:!0})}deselectAllCustom(){for(const t of this.customFields)t.checked&&this.fieldCheckedChange.emit({field:t,checked:!1})}selectAllRelation(){for(const t of this.relationFields)t.checked||this.fieldCheckedChange.emit({field:t,checked:!0})}deselectAllRelation(){for(const t of this.relationFields)t.checked&&this.fieldCheckedChange.emit({field:t,checked:!1})}onFieldDragStart(t,n){const o=this.getFieldKey(t);n.dataTransfer?.setData("text/plain",o),this.fieldDragStart.emit({field:t,cardElementId:this.card.elementId}),t.isRelation&&t.relatedElementId&&this.relationDragStart.emit({fieldId:t.dataFieldId,relatedElementId:t.relatedElementId,event:n})}onFieldDragOver(t){t.preventDefault(),t.stopPropagation()}onFieldDrop(t,n){n.preventDefault(),n.stopPropagation(),this.fieldDropped.emit({targetField:t,event:n})}onCardDragOver(t){t.preventDefault(),this.cardDragOver.emit(t)}onCardDrop(t){t.preventDefault(),this.cardDrop.emit(t)}onRemove(){this.cardRemoved.emit()}getFieldKey(t){return t.isCommon?`common:${t.commonFieldName}`:`data:${t.dataFieldId}`}isFieldDropTarget(t){return!!this.dropTargetFieldKey&&this.getFieldKey(t)===this.dropTargetFieldKey}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(e.aKT))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-element-field-card"]],inputs:{card:"card",isDragTarget:"isDragTarget",linkedRelationFieldId:"linkedRelationFieldId",dropTargetFieldKey:"dropTargetFieldKey"},outputs:{fieldCheckedChange:"fieldCheckedChange",cardRemoved:"cardRemoved",relationDragStart:"relationDragStart",fieldDragStart:"fieldDragStart",fieldDropped:"fieldDropped",cardDragOver:"cardDragOver",cardDrop:"cardDrop"},decls:16,vars:13,consts:[[1,"element-card",3,"dragover","drop"],[1,"card-header"],[1,"header-info"],[1,"element-name"],[1,"role-badge"],["type","button","title","Remove element",1,"remove-btn",3,"click"],[1,"mdi","mdi-close"],[1,"card-body"],["class","field-section",4,"ngIf"],[1,"card-footer"],[1,"field-section"],[1,"section-header",3,"click"],[1,"mdi"],[1,"section-title"],[1,"section-actions",3,"click"],[1,"select-link",3,"click"],[1,"divider"],["class","section-fields",4,"ngIf"],[1,"section-fields"],["class","field-row draggable-field","draggable","true",3,"drop-target-highlight","dragstart","dragover","drop",4,"ngFor","ngForOf"],["draggable","true",1,"field-row","draggable-field",3,"dragstart","dragover","drop"],[3,"onChange","ngModel","binary"],[1,"field-name"],[1,"field-type-badge"],[1,"mdi","mdi-drag-vertical","drag-grip"],["class","field-row relation-row draggable-field","draggable","true","title","Drag to connect or check to include in grid",3,"linked","drop-target-highlight","dragstart","dragover","drop",4,"ngFor","ngForOf"],["draggable","true","title","Drag to connect or check to include in grid",1,"field-row","relation-row","draggable-field",3,"dragstart","dragover","drop"],[3,"onChange","click","ngModel","binary"],[1,"drag-handle"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.bIt("dragover",function(s){return o.onCardDragOver(s)})("drop",function(s){return o.onCardDrop(s)}
1),e.j41(1,"div",1)(2,"div",2)(3,"span",3),e.EFF(4),e.k0s(),e.j41(5,"span",4),e.EFF(6),e.k0s()(),e.j41(7,"button",5),e.bIt("click",function(){return o.onRemove()}),e.nrm(8,"i",6),e.k0s()(),e.j41(9,"div",7),e.DNE(10,JI,13,5,"div",8)(11,ZI,13,5,"div",8)(12,n2,13,5,"div",8),e.k0s(),e.j41(13,"div",9)(14,"span"),e.EFF(15),e.k0s()()()),2&n&&(e.AVh("drag-target",o.isDragTarget),e.R7$(4),e.JRh(o.card.element.name),e.R7$(),e.AVh("primary","primary"===o.card.role)("joined","joined"===o.card.role),e.R7$(),e.SpI(" ","primary"===o.card.role?"Primary":"Joined"," "),e.R7$(4),e.Y8G("ngIf",o.commonFields.length>0),e.R7$(),e.Y8G("ngIf",o.customFields.length>0),e.R7$(),e.Y8G("ngIf",o.relationFields.length>0),e.R7$(3),e.Lme("",o.selectedCount," of ",o.totalCheckableCount," fields selected"))},dependencies:[M.Sq,M.bT,R.BC,R.vS,ut.Sc],styles:[".element-card[_ngcontent-%COMP%]{width:320px;background:#fff;border:2px solid #dedede;border-radius:10px;box-shadow:0 2px 8px #0000000f;transition:border-color .2s,box-shadow .2s;display:flex;flex-direction:column}.element-card.drag-target[_ngcontent-%COMP%]{border-color:#5f84fc;box-shadow:0 0 0 3px #5f84fc26}.card-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid #dedede;background:#5f84fc08;border-radius:8px 8px 0 0}.card-header[_ngcontent-%COMP%]   .header-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;min-width:0}.card-header[_ngcontent-%COMP%]   .element-name[_ngcontent-%COMP%]{font-weight:600;font-size:15px;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-header[_ngcontent-%COMP%]   .role-badge[_ngcontent-%COMP%]{font-size:10px;font-weight:600;text-transform:uppercase;padding:2px 6px;border-radius:4px;white-space:nowrap}.card-header[_ngcontent-%COMP%]   .role-badge.primary[_ngcontent-%COMP%]{background:#5f84fc1f;color:#5f84fc}.card-header[_ngcontent-%COMP%]   .role-badge.joined[_ngcontent-%COMP%]{background:#ff98001f;color:#e65100}.card-header[_ngcontent-%COMP%]   .remove-btn[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;color:#7b7b7b;font-size:18px;padding:2px;border-radius:4px;line-height:1;transition:color .2s,background .2s}.card-header[_ngcontent-%COMP%]   .remove-btn[_ngcontent-%COMP%]:hover{color:#d32f2f;background:#d32f2f14}.card-body[_ngcontent-%COMP%]{flex:1;overflow-y:auto;max-height:400px;padding:4px 0}.field-section[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid rgba(222,222,222,.5)}.section-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:8px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.section-header[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:16px;color:#7b7b7b}.section-header[_ngcontent-%COMP%]   .section-title[_ngcontent-%COMP%]{font-size:12px;font-weight:600;text-transform:uppercase;color:#7b7b7b;letter-spacing:.5px}.section-header[_ngcontent-%COMP%]   .section-actions[_ngcontent-%COMP%]{margin-left:auto;display:flex;align-items:center;gap:4px}.section-header[_ngcontent-%COMP%]   .section-actions[_ngcontent-%COMP%]   .select-link[_ngcontent-%COMP%]{font-size:11px;color:#5f84fc;cursor:pointer;text-decoration:none}.section-header[_ngcontent-%COMP%]   .section-actions[_ngcontent-%COMP%]   .select-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.section-header[_ngcontent-%COMP%]   .section-actions[_ngcontent-%COMP%]   .divider[_ngcontent-%COMP%]{font-size:11px;color:#dedede}.section-fields[_ngcontent-%COMP%]{padding:0 8px 6px}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:4px 6px;border-radius:4px;cursor:pointer;transition:background .15s,border-color .15s,box-shadow .15s}.field-row[_ngcontent-%COMP%]:hover{background:#5f84fc0a}.field-row[_ngcontent-%COMP%]   .field-name[_ngcontent-%COMP%]{flex:1;font-size:13px;color:#000;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.field-row[_ngcontent-%COMP%]   .field-type-badge[_ngcontent-%COMP%]{font-size:10px;color:#7b7b7b;background:#fafafa;padding:1px 5px;border-radius:3px;white-space:nowrap}.draggable-field[_ngcontent-%COMP%]{cursor:grab;border:1px solid transparent}.draggable-field[_ngcontent-%COMP%]:active{cursor:grabbing}.draggable-field[_ngcontent-%COMP%]   .drag-grip[_ngcontent-%COMP%]{font-size:14px;color:#7b7b7b66;flex-shrink:0;transition:color .15s}.draggable-field[_ngcontent-%COMP%]:hover   .drag-grip[_ngcontent-%COMP%]{color:#7b7b7b}.drop-target-highlight[_ngcontent-%COMP%]{background:#5f84fc1a!important;border-color:#5f84fc!important;border-style:dashed;box-shadow:0 0 0 1px #5f84fc33}.relation-row[_ngcontent-%COMP%]{cursor:grab}.relation-row[_ngcontent-%COMP%]:active{cursor:grabbing}.relation-row.linked[_ngcontent-%COMP%]{background:#5f84fc0f}.relation-row[_ngcontent-%COMP%]   .drag-handle[_ngcontent-%COMP%]{font-size:16px;color:#7b7b7b;flex-shrink:0}.relation-row[_ngcontent-%COMP%]   .drag-handle.linked[_ngcontent-%COMP%]{color:#5f84fc}.relation-row[_ngcontent-%COMP%]   .relation-arrow[_ngcontent-%COMP%]{font-size:14px;color:#7b7b7b}.card-footer[_ngcontent-%COMP%]{padding:8px 14px;border-top:1px solid #dedede;font-size:12px;color:#7b7b7b;text-align:center}  .element-card .p-checkbox{width:18px;height:18px}  .element-card .p-checkbox .p-checkbox-box{width:18px;height:18px}"]})}}return i})();const r2=["canvasContainer"],a2=["cardRef"],s2=()=>({width:"90vw",maxWidth:"1200px"}),l2=()=>({maxHeight:"70vh",overflow:"auto"}),ju=()=>["+","-","*","/","%","^"],Vu=()=>["=","<>","<",">","<=",">="],$u=()=>["AND","OR","NOT"],Uu=()=>["(",")"],Yu=()=>({width:"80px"}),d2=()=>({minWidth:"180px"}),c2=()=>({width:"100px"});function p2(i,a){1&i&&e.nrm(0,"i",21)}function u2(i,a){1&i&&e.nrm(0,"i",22)}function _2(i,a){1&i&&(e.j41(0,"div",23),e.nrm(1,"kendo-loader",24),e.j41(2,"span"),e.EFF(3,"Loading..."),e.k0s()())}function m2(i,a){if(1&i){const t=e.RV6();e.j41(0,"span",53),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG().index,s=e.XpG(3);return e.Njj(s.setLinkJoinType(r,o.value))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG().$implicit;e.AVh("selected",n.joinType===t.value),e.Y8G("title",t.description),e.R7$(),e.SpI(" ",t.label," ")}}function g2(i,a){1&i&&e.nrm(0,"i",65)}function h2(i,a){if(1&i&&(e.qex(0),e.DNE(1,g2,1,0,"i",61),e.j41(2,"span",62),e.EFF(3),e.k0s(),e.j41(4,"span",63),e.EFF(5),e.k0s(),e.nrm(6,"i",48),e.j41(7,"span",64),e.EFF(8),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit,n=e.XpG(2).$implicit;e.R7$(),e.Y8G("ngIf",n.selectedRelation!==t),e.R7$(2),e.JRh(t.ownerElementName),e.R7$(2),e.SpI(".",t.fieldName,""),e.R7$(3),e.JRh(t.relatedElementName)}}function f2(i,a){if(1&i&&(e.qex(0),e.nrm(1,"i",66),e.j41(2,"span",62),e.EFF(3),e.k0s(),e.nrm(4,"i",67),e.j41(5,"span",64),e.EFF(6),e.k0s(),e.bVm()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.JRh(null==t.leftField?null:t.leftField.displayName),e.R7$(3),e.JRh(null==t.rightField?null:t.rightField.displayName)}}function C2(i,a){1&i&&e.nrm(0,"i",68)}function v2(i,a){if(1&i){const t=e.RV6();e.j41(0,"i",69),e.bIt("click",function(o){e.eBV(t);const r=e.XpG().$implicit,s=e.XpG(2).index,c=e.XpG(3);return e.Njj(c.removeCustomRelation(s,r,o))}),e.k0s()}}function b2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",57),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2).index,s=e.XpG(3);return e.Njj(s.onRelationSelected(r,o))}),e.DNE(1,h2,9,4,"ng-container",58)(2,f2,7,2,"ng-container",58)(3,C2,1,0,"i",59)(4,v2,1,0,"i",60),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(2).$implicit;e.AVh("selected",n.selectedRelation===t)("custom-chip",t.isCustom),e.R7$(),e.Y8G("ngIf",!t.isCustom),e.R7$(),e.Y8G("ngIf",t.isCustom),e.R7$(),e.Y8G("ngIf",n.selectedRelation===t),e.R7$(),e.Y8G("ngIf",t.isCustom)}}function T2(i,a){if(1&i&&(e.j41(0,"div",54)(1,"span",55),e.EFF(2,"Join On:"),e.k0s(),e.DNE(3,b2,5,8,"div",56),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(3),e.Y8G("ngForOf",t.detectedRelations)}}function E2(i,a){1&i&&(e.j41(0,"div",70),e.nrm(1,"i",71),e.j41(2,"span"),e.EFF(3,"Drag a field from one card to the other to create a join"),e.k0s()())}function S2(i,a){if(1&i&&(e.j41(0,"div",45)(1,"span",46),e.nrm(2,"i",47),e.EFF(3),e.nrm(4,"i",48),e.EFF(5),e.k0s(),e.j41(6,"div",49),e.DNE(7,m2,2,4,"span",50),e.k0s(),e.DNE(8,T2,4,1,"div",51)(9,E2,4,0,"div",52),e.k0s()),2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(3),e.SpI(" ",null==n.cards[t.leftIndex]||null==n.cards[t.leftIndex].element?null:n.cards[t.leftIndex].element.name," "),e.R7$(2),e.SpI(" ",null==n.cards[t.rightIndex]||null==n.cards[t.rightIndex].element?null:n.cards[t.rightIndex].element.name," "),e.R7$(2),e.Y8G("ngForOf",n.joinTypeOptions),e.R7$(),e.Y8G("ngIf",t.detectedRelations.length>0),e.R7$(),e.Y8G("ngIf",0===t.detectedRelations.length)}}function k2(i,a){if(1&i&&(e.j41(0,"div",43),e.DNE(1,S2,10,5,"div",44),e.k0s()),2&i){const t=e.XpG(2);
1e.R7$(),e.Y8G("ngForOf",t.joinLinks)}}function R2(i,a){if(1&i&&(e.j41(0,"div",75)(1,"span",76),e.EFF(2),e.k0s(),e.j41(3,"span",77),e.EFF(4),e.k0s()()),2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(2),e.Lme("",n.getEndpointTypeLabel(t.elementType),": ",t.name,""),e.R7$(2),e.SpI("",t.instanceCount," instances")}}function I2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",72)(1,"p-dropdown",73),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.addElementSelected,o)||(r.addElementSelected=o),e.Njj(o)}),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onAddElement(o.value))}),e.DNE(2,R2,5,3,"ng-template",74),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("options",t.availableElements),e.R50("ngModel",t.addElementSelected),e.Y8G("showClear",!1)("filter",!0)}}function y2(i,a){1&i&&(e.j41(0,"div",78),e.nrm(1,"kendo-loader",79),e.j41(2,"span"),e.EFF(3,"Loading endpoint details..."),e.k0s()())}function w2(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",82,1)(3,"cad-element-field-card",83),e.bIt("fieldCheckedChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.Njj(s.onFieldCheckedChange(r,o))})("cardRemoved",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onRemoveCard(o))})("relationDragStart",function(o){const r=e.eBV(t).index,s=e.XpG(3);return e.Njj(s.onRelationDragStartFromCard(o,r))})("fieldDragStart",function(o){const r=e.eBV(t).index,s=e.XpG(3);return e.Njj(s.onFieldDragStartFromCard(o,r))})("fieldDropped",function(o){const r=e.eBV(t).index,s=e.XpG(3);return e.Njj(s.onFieldDroppedOnCard(o,r))})("cardDragOver",function(o){const r=e.eBV(t).index,s=e.XpG(3);return e.Njj(s.onCardDragOver(o,r))})("cardDrop",function(o){const r=e.eBV(t).index,s=e.XpG(3);return e.Njj(s.onCardDrop(o,r))}),e.k0s()(),e.bVm()}if(2&i){const t=a.$implicit,n=a.index,o=e.XpG(3);e.R7$(3),e.Y8G("card",t)("isDragTarget",o.dragTargetCardIndex===n)("linkedRelationFieldId",o.getLinkedRelationFieldId(n))("dropTargetFieldKey",o.getDropTargetFieldKey(n))}}function D2(i,a){if(1&i&&(e.j41(0,"div",80)(1,"div",81),e.DNE(2,w2,4,4,"ng-container",39),e.k0s()()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("ngForOf",t.cards)}}function O2(i,a){if(1&i&&(e.qSk(),e.nrm(0,"path",88)),2&i){const t=e.XpG().$implicit;e.BMQ("d",t.connectorPath)}}function x2(i,a){if(1&i&&(e.qSk(),e.qex(0),e.DNE(1,O2,1,1,"path",87),e.bVm()),2&i){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t.selectedRelation&&t.connectorPath)}}function M2(i,a){if(1&i&&(e.qSk(),e.j41(0,"svg",84)(1,"defs")(2,"marker",85),e.nrm(3,"polygon",86),e.k0s()(),e.DNE(4,x2,2,1,"ng-container",39),e.k0s()),2&i){const t=e.XpG(2);e.R7$(4),e.Y8G("ngForOf",t.joinLinks)}}function F2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",90),e.bIt("click",function(){e.eBV(t);const o=e.XpG().index,r=e.XpG(2);return e.Njj(r.cycleJoinType(o))}),e.nrm(1,"i",47),e.EFF(2),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.xc7("left",t.connectorMidpoint.x-32,"px")("top",t.connectorMidpoint.y-14,"px"),e.R7$(2),e.SpI(" ",n.getJoinTypeLabel(t.joinType)," ")}}function P2(i,a){if(1&i&&(e.qex(0),e.DNE(1,F2,3,5,"div",89),e.bVm()),2&i){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t.selectedRelation&&t.connectorPath)}}function N2(i,a){1&i&&(e.j41(0,"div",91),e.nrm(1,"i",92),e.j41(2,"p"),e.EFF(3,"Select elements to build your data set"),e.k0s(),e.j41(4,"small"),e.EFF(5,'Use the "Add Element" dropdown above to add elements'),e.k0s()())}function G2(i,a){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG(4);e.R7$(),e.Lme(" (",t.joinLinks.length," join",t.joinLinks.length>1?"s":"",") ")}}function A2(i,a){if(1&i&&(e.j41(0,"span")(1,"strong"),e.EFF(2),e.k0s(),e.EFF(3," fields selected from "),e.j41(4,"strong"),e.EFF(5),e.k0s(),e.EFF(6),e.DNE(7,G2,2,2,"span",58),e.k0s()),2&i){const t=e.XpG(3);e.R7$(2),e.JRh(t.selectedFieldCount),e.R7$(3),e.JRh(t.cards.length),e.R7$(),e.SpI(" element",t.cards.length>1?"s":""," "),e.R7$(),e.Y8G("ngIf",t.joinLinks.length>0)}}function L2(i,a){1&i&&(e.j41(0,"span",95),e.EFF(1," Check fields on the element cards to include them in the data set "),e.k0s())}function B2(i,a){if(1&i&&(e.j41(0,"div",93),e.DNE(1,A2,8,4,"span",58)(2,L2,2,0,"span",94),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngIf",t.selectedFieldCount>0),e.R7$(),e.Y8G("ngIf",0===t.selectedFieldCount)}}function j2(i,a){1&i&&(e.j41(0,"div",103)(1,"small"),e.EFF(2,"Add calculated fields to create computed columns (e.g., Revenue * Probability)"),e.k0s()())}function V2(i,a){1&i&&(e.j41(0,"div",103)(1,"small"),e.EFF(2,"Select at least 1 field to enable c
1alculated fields"),e.k0s()())}function $2(i,a){1&i&&(e.j41(0,"span",137),e.EFF(1,"(click to add optional condition)"),e.k0s())}function U2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",141)(1,"span",142),e.EFF(2),e.k0s(),e.j41(3,"p-dropdown",143),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.fieldKey,o)||(r.fieldKey=o),e.Njj(o)}),e.bIt("onChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(5);return e.Njj(s.onConditionFieldChange(r,o.value))}),e.k0s(),e.j41(4,"p-dropdown",144),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.comparison,o)||(r.comparison=o),e.Njj(o)}),e.k0s(),e.j41(5,"input",145),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.value,o)||(r.value=o),e.Njj(o)}),e.k0s(),e.j41(6,"button",146),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(2).$implicit,s=e.XpG(3);return e.Njj(s.removeCondition(r,o))}),e.nrm(7,"i",108),e.k0s()()}if(2&i){const t=a.$implicit,n=a.index,o=e.XpG(5);e.R7$(2),e.JRh(0===n?"IF":"AND"),e.R7$(),e.Aen(e.lJ4(11,d2)),e.Y8G("options",o.allFieldOptions),e.R50("ngModel",t.fieldKey),e.Y8G("filter",!0),e.R7$(),e.Aen(e.lJ4(12,c2)),e.Y8G("options",o.comparisonOptions),e.R50("ngModel",t.comparison),e.R7$(),e.R50("ngModel",t.value)}}function Y2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",138),e.DNE(1,U2,8,13,"div",139),e.j41(2,"button",140),e.bIt("click",function(){e.eBV(t);const o=e.XpG().$implicit,r=e.XpG(3);return e.Njj(r.addCondition(o))}),e.nrm(3,"i",100),e.EFF(4," Add condition "),e.k0s()()}if(2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngForOf",t.conditions)}}function H2(i,a){if(1&i&&(e.j41(0,"div",152),e.nrm(1,"i",153),e.EFF(2),e.k0s()),2&i){const t=a.$implicit;e.R7$(2),e.SpI(" ",t," ")}}function X2(i,a){if(1&i&&(e.j41(0,"div",150),e.DNE(1,H2,3,1,"div",151),e.k0s()),2&i){const t=e.XpG(2).$implicit,n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.validateExpression(n.expressionTexts[t.id]))}}function W2(i,a){if(1&i&&(e.j41(0,"div",154),e.nrm(1,"i",155),e.j41(2,"span",156),e.EFF(3),e.k0s()()),2&i){const t=e.XpG(2).$implicit,n=e.XpG(3);e.R7$(3),e.JRh(n.getExpressionPreview(n.expressionTexts[t.id]))}}function z2(i,a){if(1&i&&(e.j41(0,"div",147),e.DNE(1,X2,2,1,"div",148)(2,W2,4,1,"div",149),e.k0s()),2&i){const t=e.XpG().$implicit,n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.validateExpression(n.expressionTexts[t.id]).length>0),e.R7$(),e.Y8G("ngIf",0===n.validateExpression(n.expressionTexts[t.id]).length)}}function K2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",157),e.bIt("dblclick",function(){const o=e.eBV(t).$implicit,r=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id,"{"+o.label+"}","main"))}),e.j41(1,"span",158),e.EFF(2),e.k0s(),e.j41(3,"span",159),e.EFF(4),e.k0s()()}if(2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.label),e.R7$(),e.BMQ("data-type",t.fieldType),e.R7$(),e.JRh(t.fieldType)}}function J2(i,a){1&i&&(e.j41(0,"div",160)(1,"small"),e.EFF(2,"No fields selected"),e.k0s()())}function q2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",167),e.bIt("dblclick",function(){const o=e.eBV(t).$implicit,r=e.XpG(3).$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o.syntax+" ","main"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.Y8G("title",t.description),e.R7$(),e.SpI(" ",t.name," ")}}function Q2(i,a){if(1&i&&(e.j41(0,"div",165),e.DNE(1,q2,2,2,"div",166),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngForOf",t.items)}}function Z2(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",161)(1,"div",162),e.bIt("click",function(){const o=e.eBV(t).$implicit;return e.Njj(o.expanded=!o.expanded)}),e.nrm(2,"i",163),e.EFF(3),e.k0s(),e.DNE(4,Q2,2,1,"div",164),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(2),e.AVh("mdi-chevron-right",!t.expanded)("mdi-chevron-down",t.expanded),e.R7$(),e.SpI(" ",t.category," "),e.R7$(),e.Y8G("ngIf",t.expanded)}}function ey(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",168),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","main"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function ty(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",131),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","main"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function ny(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",131),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","main"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function iy(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",168),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG().$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","main"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function oy(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",140),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(3);return e.Njj(r.toggleElse(o))}),e.nrm(1,"i",100),e.EFF(2," Add Else "),e.k0s()}}function ry(i,a){if(1&i&&(e.j41(0,"div",152),e.nrm(1,"i",153),e.EFF(2),e.k0s()),2&i){const t=a.$implicit;e.R7$(2),e.SpI(" ",t," ")}}function ay(i,a){if(1&i&&(e.j41(0,"div",150),e.DNE(1,ry,3,1,"div",151),e.k0s()),2&i){const t=e.XpG(4).$implicit,n=e.XpG(3);e.R7$(),e.Y8G("ngForOf",n.validateExpression(n.elseExpressionTexts[t.id]))}}function sy(i,a){if(1&i&&(e.j41(0,"div",154),e.nrm(1,"i",155),e.j41(2,"span",156),e.EFF(3),e.k0s()()),2&i){const t=e.XpG(4).$implicit,n=e.XpG(3);e.R7$(3),e.JRh(n.getExpressionPreview(n.elseExpressionTexts[t.id]))}}function ly(i,a){if(1&i&&(e.j41(0,"div",147),e.DNE(1,ay,2,1,"div",148)(2,sy,4,1,"div",149),e.k0s()),2&i){const t=e.XpG(3).$implicit,n=e.XpG(3);e.R7$(),e.Y8G("ngIf",n.validateExpression(n.elseExpressionTexts[t.id]).length>0),e.R7$(),e.Y8G("ngIf",0===n.validateExpression(n.elseExpressionTexts[t.id]).length)}}function dy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",157),e.bIt("dblclick",function(){const o=e.eBV(t).$implicit,r=e.XpG(3).$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id,"{"+o.label+"}","else"))}),e.j41(1,"span",158),e.EFF(2),e.k0s(),e.j41(3,"span",159),e.EFF(4),e.k0s()()}if(2&i){const t=a.$implicit;e.R7$(2),e.JRh(t.label),e.R7$(),e.BMQ("data-type",t.fieldType),e.R7$(),e.JRh(t.fieldType)}}function cy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",167),e.bIt("dblclick",function(){const o=e.eBV(t).$implicit,r=e.XpG(5).$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o.syntax+" ","else"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.Y8G("title",t.description),e.R7$(),e.SpI(" ",t.name," ")}}function py(i,a){if(1&i&&(e.j41(0,"div",165),e.DNE(1,cy,2,2,"div",166),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngForOf",t.items)}}function uy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",161)(1,"div",162),e.bIt("click",function(){const o=e.eBV(t).$implicit;return e.Njj(o.expanded=!o.expanded)}),e.nrm(2,"i",163),e.EFF(3),e.k0s(),e.DNE(4,py,2,1,"div",164),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(2),e.AVh("mdi-chevron-right",!t.expanded)("mdi-chevron-down",t.expanded),e.R7$(),e.SpI(" ",t.category," "),e.R7$(),e.Y8G("ngIf",t.expanded)}}function _y(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",168),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3).$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","else"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function my(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",131),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3).$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","else"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function gy(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",131),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3).$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","else"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function hy(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",168),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3).$implicit,s=e.XpG(3);return e.Njj(s.insertIntoExpression(r.id," "+o+" ","else"))}),e.EFF(1),e.k0s()}if(2&i){const t=a.$implicit;e.R7$(),e.JRh(t)}}function fy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",172)(1,"div",173)(2,"label",118),e.EFF(3,"ELSE FORMULA"),e.k0s(),e.j41(4,"button",174),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(3);return e.Njj(r.toggleElse(o))}),e.nrm(5,"i",108),e.EFF(6," Remove Else "),e.k0s()(),e.j41(7,"div",117)(8,"textarea",175),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3);return e.DH7(s.elseExpressionTexts[r.id],o)||(s.elseExpressionTexts[r.id]=o),e.Njj(o)}),e.k0s(),e.DNE(9,ly,3,2,"div",120),e.k0s(),e.j41(10,"div",121)(11,"div",122)(12,"div",123),e.EFF(13,"Fields"),e.k0s(),e.j41(14,"div",124),e.DNE(15,dy,5,3,"div",125),e.k0s()(),e.j41(16,"div",122)(17,"div",123),e.EFF(18,"Functions"),e.k0s(),e.j41(19,"div",124),e.DNE(20,uy,5,6,"div",127),e.k0s()(),e.j41(21,"div",122)(22,"div",123),e.EFF(23,"Operators"),e.k0s(),e.j41(24,"div",124)(25,"div",128),e.EFF(26,"Math"),e.k0s(),e.j41(27,"div",129),e.DNE(28,_y,2,1,"button",130),e.k0s(),e.j41(29,"div",128),e.EFF(30,"String"),e.k0s(),e.j41(31,"div",129)(32,"button",131),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(3);return e.Njj(r.insertIntoExpression(o.id," & ","else"))}),e.EFF(33,"&"),e.k0s()(),e.j41(34,"div",128),e.EFF(35,"Comparison"),e.k0s(),e.j41(36,"div",129),e.DNE(37,my,2,1,"button",132),e.k0s(),e.j41(38,"div",128),e.EFF(39,"
1Logical"),e.k0s(),e.j41(40,"div",129),e.DNE(41,gy,2,1,"button",132),e.k0s(),e.j41(42,"div",128),e.EFF(43,"Grouping"),e.k0s(),e.j41(44,"div",129),e.DNE(45,hy,2,1,"button",130),e.k0s(),e.j41(46,"div",133)(47,"p-inputNumber",134),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit,s=e.XpG(3);return e.DH7(s.calcConstantInputs[r.id+"_else"],o)||(s.calcConstantInputs[r.id+"_else"]=o),e.Njj(o)}),e.k0s(),e.j41(48,"button",135),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2).$implicit,r=e.XpG(3);return r.insertIntoExpression(o.id," "+r.calcConstantInputs[o.id+"_else"]+" ","else"),e.Njj(r.calcConstantInputs[o.id+"_else"]=null)}),e.EFF(49,"Add #"),e.k0s()()()()()()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(3);e.R7$(8),e.AVh("expression-error",n.validateExpression(n.elseExpressionTexts[t.id]).length>0),e.R50("ngModel",n.elseExpressionTexts[t.id]),e.R7$(),e.Y8G("ngIf",null==n.elseExpressionTexts[t.id]?null:n.elseExpressionTexts[t.id].trim()),e.R7$(6),e.Y8G("ngForOf",n.allFieldOptions),e.R7$(5),e.Y8G("ngForOf",n.formulaFunctions),e.R7$(8),e.Y8G("ngForOf",e.lJ4(15,ju)),e.R7$(9),e.Y8G("ngForOf",e.lJ4(16,Vu)),e.R7$(4),e.Y8G("ngForOf",e.lJ4(17,$u)),e.R7$(4),e.Y8G("ngForOf",e.lJ4(18,Uu)),e.R7$(2),e.Aen(e.lJ4(19,Yu)),e.R50("ngModel",n.calcConstantInputs[t.id+"_else"]),e.Y8G("minFractionDigits",0)("maxFractionDigits",4)}}function Cy(i,a){if(1&i&&(e.j41(0,"div",169),e.DNE(1,oy,3,0,"button",170)(2,fy,50,20,"div",171),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.Y8G("ngIf",!t.showElse),e.R7$(),e.Y8G("ngIf",t.showElse)}}function vy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",104)(1,"div",105)(2,"span",106),e.EFF(3,"CALCULATED FIELD"),e.k0s(),e.j41(4,"button",107),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.removeCalculatedField(o))}),e.nrm(5,"i",108),e.k0s()(),e.j41(6,"div",109)(7,"label"),e.EFF(8,"Name"),e.k0s(),e.j41(9,"input",110),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit;return e.DH7(r.name,o)||(r.name=o),e.Njj(o)}),e.k0s()(),e.j41(10,"div",111)(11,"div",112),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return e.Njj(0===o.conditions.length?r.addCondition(o):null)}),e.nrm(12,"i",113),e.j41(13,"span",114),e.EFF(14,"IF...THEN"),e.k0s(),e.DNE(15,$2,2,0,"span",115),e.k0s(),e.DNE(16,Y2,5,1,"div",116),e.k0s(),e.j41(17,"div",117)(18,"label",118),e.EFF(19,"FORMULA"),e.k0s(),e.j41(20,"textarea",119),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.DH7(s.expressionTexts[r.id],o)||(s.expressionTexts[r.id]=o),e.Njj(o)}),e.k0s(),e.DNE(21,z2,3,2,"div",120),e.k0s(),e.j41(22,"div",121)(23,"div",122)(24,"div",123),e.EFF(25,"Fields"),e.k0s(),e.j41(26,"div",124),e.DNE(27,K2,5,3,"div",125)(28,J2,3,0,"div",126),e.k0s()(),e.j41(29,"div",122)(30,"div",123),e.EFF(31,"Functions"),e.k0s(),e.j41(32,"div",124),e.DNE(33,Z2,5,6,"div",127),e.k0s()(),e.j41(34,"div",122)(35,"div",123),e.EFF(36,"Operators"),e.k0s(),e.j41(37,"div",124)(38,"div",128),e.EFF(39,"Math"),e.k0s(),e.j41(40,"div",129),e.DNE(41,ey,2,1,"button",130),e.k0s(),e.j41(42,"div",128),e.EFF(43,"String"),e.k0s(),e.j41(44,"div",129)(45,"button",131),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return e.Njj(r.insertIntoExpression(o.id," & ","main"))}),e.EFF(46,"&"),e.k0s()(),e.j41(47,"div",128),e.EFF(48,"Comparison"),e.k0s(),e.j41(49,"div",129),e.DNE(50,ty,2,1,"button",132),e.k0s(),e.j41(51,"div",128),e.EFF(52,"Logical"),e.k0s(),e.j41(53,"div",129),e.DNE(54,ny,2,1,"button",132),e.k0s(),e.j41(55,"div",128),e.EFF(56,"Grouping"),e.k0s(),e.j41(57,"div",129),e.DNE(58,iy,2,1,"button",130),e.k0s(),e.j41(59,"div",133)(60,"p-inputNumber",134),e.mxI("ngModelChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(3);return e.DH7(s.calcConstantInputs[r.id],o)||(s.calcConstantInputs[r.id]=o),e.Njj(o)}),e.k0s(),e.j41(61,"button",135),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(3);return r.insertIntoExpression(o.id," "+r.calcConstantInputs[o.id]+" ","main"),e.Njj(r.calcConstantInputs[o.id]=null)}),e.EFF(62,"Add #"),e.k0s()()()()(),e.DNE(63,Cy,3,2,"div",136),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(3);e.R7$(9),e.R50("ngModel",t.name),e.R7$(3),e.AVh("rotated",t.conditions.length>0),e.R7$(3),e.Y8G("ngIf",0===t.conditions.length),e.R7$(),e.Y8G("ngIf",t.conditions.length>0),e.R7$(4),e.AVh("expression-error",n.validateExpression(n.expressionTexts[t.id]).length>0),e.R50("ngModel",n.expressionTexts[t.id]),e.R7$(),e.Y8G("ngIf",null==n.expressionTexts[t.id]?null:n.expressionTexts[t.id].trim()),e.R7$(6),e.Y8G("ngForOf",n.allFieldOptions),e.R7$(),e.Y8G("ngIf",0===n.allFieldOptions.length),e.R7$(5),e.Y8G("ngForOf",n.formulaFunctions),e.R7$(8),e.Y8G("ngForOf",e.lJ4(22,ju)),e.R7$(9),e.Y8G("ngForOf",e.lJ4(23,Vu)),e.R7$(4),e.Y8G("ngForOf",e.lJ4(24,$u)),e.R7$(4),e.Y8G("ngForOf",e.lJ4(25,Uu)),e.R7$(2),e.Aen(e.lJ4(26,Yu)),e.R50("ngModel",n.calcConstantInputs[t.id]),e.Y8G("minFractionDigits",0)("maxFractionDigits",4),e.R7$(3),e.Y8G("ngIf",t.conditions.length>0)}}function by(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",96)(1,"div",97)(2,"span"),e.nrm(3,"i",98),e.EFF(4," Calculated Fields"),e.k0s(),e.j41(5,"button",99),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.addCalculatedField())}),e.nrm(6,"i",100),e.EFF(7," Add Calculated Field "),e.k0s()(),e.DNE(8,j2,3,0,"div",101)(9,V2,3,0,"div",101)(10,vy,64,27,"div",102),e.k0s()}if(2&i){const t=e.XpG(2);e.R7$(5),e.Y8G("disabled",t.allFieldOptions.length<1),e.R7$(3),e.Y8G("ngIf",0===t.calculatedFields.length&&t.allFieldOptions.length>=1),e.R7$(),e.Y8G("ngIf",t.allFieldOptions.length<1&&0===t.calculatedFields.length),e.R7$(),e.Y8G("ngForOf",t.calculatedFields)}}function Ty(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",25)(1,"div",26)(2,"div",27)(3,"label",28),e.EFF(4,"Name *"),e.k0s(),e.j41(5,"input",29),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.name,o)||(r.name=o),e.Njj(o)}),e.k0s()(),e.j41(6,"div",30)(7,"label",31),e.EFF(8,"Description"),e.k0s(),e.j41(9,"input",32),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.description,o)||(r.description=o),e.Njj(o)}),e.k0s()()(),e.DNE(10,k2,2,1,"div",33),e.j41(11,"div",34,0),e.bIt("dragend",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCanvasDragEnd())}),e.DNE(13,I2,3,4,"div",35)(14,y2,4,0,"div",36)(15,D2,3,1,"div",37)(16,M2,5,1,"svg",38)(17,P2,2,1,"ng-container",39)(18,N2,6,0,"div",40),e.k0s(),e.DNE(19,B2,3,2,"div",41)(20,by,11,4,"div",42),e.k0s()}if(2&i){const t=e.XpG();e.R7$(5),e.R50("ngModel",t.name),e.R7$(4),e.R50("ngModel",t.description),e.R7$(),e.Y8G("ngIf",t.joinLinks.length>0),e.R7$(3),e.Y8G("ngIf",t.canAddElement),e.R7$(),e.Y8G("ngIf",t.loadingElements),e.R7$(),e.Y8G("ngIf",!t.loadingElements&&t.cards.length>0),e.R7$(),e.Y8G("ngIf",t.joinLinks.length>
10),e.R7$(),e.Y8G("ngForOf",t.joinLinks),e.R7$(),e.Y8G("ngIf",0===t.cards.length&&!t.loadingElements),e.R7$(),e.Y8G("ngIf",t.cards.length>0),e.R7$(),e.Y8G("ngIf",t.cards.length>0)}}function Ey(i,a){1&i&&(e.j41(0,"div",176),e.nrm(1,"kendo-loader",24),e.j41(2,"span"),e.EFF(3,"Loading preview data..."),e.k0s()())}function Sy(i,a){if(1&i&&(e.j41(0,"small",180),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.JRh(t.previewDebugInfo)}}function ky(i,a){if(1&i&&(e.j41(0,"div",177),e.nrm(1,"i",178),e.j41(2,"span"),e.EFF(3,"No data returned. Verify the join configuration and try again."),e.k0s(),e.DNE(4,Sy,2,1,"small",179),e.k0s()),2&i){const t=e.XpG();e.R7$(4),e.Y8G("ngIf",t.previewDebugInfo)}}function Ry(i,a){if(1&i&&(e.j41(0,"th",185),e.EFF(1),e.nrm(2,"p-sortIcon",186),e.k0s()),2&i){const t=a.$implicit;e.Y8G("pSortableColumn",t.field),e.R7$(),e.SpI(" ",t.header," "),e.R7$(),e.Y8G("field",t.field)}}function Iy(i,a){if(1&i&&(e.j41(0,"tr"),e.DNE(1,Ry,3,3,"th",184),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.previewColumns)}}function yy(i,a){if(1&i&&(e.j41(0,"td"),e.EFF(1),e.k0s()),2&i){const t=a.$implicit,n=e.XpG().$implicit,o=e.XpG(2);e.R7$(),e.JRh(o.formatCellValue(n[t.field]))}}function wy(i,a){if(1&i&&(e.j41(0,"tr"),e.DNE(1,yy,2,1,"td",39),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.previewColumns)}}function Dy(i,a){if(1&i&&(e.j41(0,"p-table",181),e.DNE(1,Iy,2,1,"ng-template",182)(2,wy,2,1,"ng-template",183),e.k0s()),2&i){const t=e.XpG();e.Y8G("value",t.previewData)("scrollable",!0)("rows",50)}}function Oy(i,a){if(1&i&&(e.j41(0,"span",190),e.EFF(1),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.SpI(" Showing ",t.previewData.length," rows (preview limited to 10) ")}}function xy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",187),e.DNE(1,Oy,2,1,"span",188),e.j41(2,"button",189),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.showPreview=!1)}),e.EFF(3," Close "),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(),e.Y8G("ngIf",t.previewData.length>0)}}let Hu=(()=>{class i{constructor(t,n,o,r,s){this._router=t,this._route=n,this._apiService=o,this._messagingService=r,this._ngZone=s,this._destroyed$=new ue.B7,this._needsConnectorUpdate=!1,this.loading=!1,this.saving=!1,this.isEditMode=!1,this.dataSetId=null,this.name="",this.description="",this.workflowTypes=[],this.loadingElements=!1,this.cards=[],this.joinLinks=[],this.joinTypeOptions=[{label:"Inner",value:"inner",description:"Only matching records from both elements"},{label:"Left",value:"left",description:"All left records + matching right records"},{label:"Right",value:"right",description:"All right records + matching left records"}],this.dragSourceFieldId=null,this.dragSourceCardIndex=null,this.dragTargetCardIndex=null,this.dragFieldInfo=null,this.dragFieldSourceCardIndex=null,this.dropTargetFieldKeys=new Map,this.addElementSelected=null,this.calculatedFields=[],this.calcConstantInputs={},this.expressionTexts={},this.elseExpressionTexts={},this.formulaFunctions=[{category:"String",expanded:!1,items:[{name:"Left",syntax:"Left({field}, n)",description:"Extract n characters from the left"},{name:"Right",syntax:"Right({field}, n)",description:"Extract n characters from the right"},{name:"Mid",syntax:"Mid({field}, start, len)",description:"Extract characters from the middle"},{name:"Length",syntax:"Length({field})",description:"Count characters in a string"},{name:"UpperCase",syntax:"UpperCase({field})",description:"Convert to uppercase"},{name:"LowerCase",syntax:"LowerCase({field})",description:"Convert to lowercase"},{name:"TrimLeft",syntax:"TrimLeft({field})",description:"Remove leading spaces"},{name:"TrimRight",syntax:"TrimRight({field})",description:"Remove trailing spaces"}]},{category:"Date/Time",expanded:!1,items:[{name:"Date",syntax:"Date({field})",description:"Extract date from DateTime"},{name:"Month",syntax:"Month({field})",description:"Extract month number"},{name:"Year",syntax:"Year({field})",description:"Extract year"},{name:"WeekdayName",syntax:"WeekdayName({field})",description:"Return name of the day"}]},{category:"Math/Summary",expanded:!1,items:[{name:"Sum",syntax:"Sum({field})",description:"Calculate total"},{name:"Average",syntax:"Average({field})",description:"Calculate average"},{name:"Count",syntax:"Count({field})",description:"Count records"},{name:"Maximum",syntax:"Maximum({field})",description:"Find highest value"},{name:"Minimum",syntax:"Minimum({field})",description:"Find lowest value"},{name:"Round",syntax:"Round({field}, n)",description:"Round to n decimal places"},{name:"Truncate",syntax:"Truncate({field})",description:"Cut off decimal places"}]},{category:"Conversion",expanded:!1,items:[{name:"ToText",syntax:"ToText({field})",description:"Convert number to string"},{name:"CDate",syntax:"CDate({field})",description:"Convert to date"},{name:"CStr",syntax:"CStr({field})",description:"Convert to string"}]},{category:"Logical",expanded:!1,items:[{name:"If-Then-Else",syntax:"If {field} > 0 Then {field} Else 0",description:"Conditional logic"},{name:"IsNull",syntax:"IsNull({field})",description:"Check for null values"},{name:"IsBlank",syntax:"IsBlank({field})",description:"Check for null or empty values"}]}],this.comparisonOptions=[{label:"=",value:"equals"},{label:"!=",value:"notEquals"},{label:">",value:"greaterThan"},{label:"<",value:"lessThan"},{label:">=",value:"greaterThanOrEquals"},{label:"<=",value:"lessThanOrEquals"},{label:"contains",value:"contains"}],this.showPreview=!1,this.previewLoading=!1,this.previewData=[],this.previewColumns=[],this.previewDebugInfo=""}ngOnInit(){this.dataSetId=this._route.snapshot.params.dataSetId,this.isEditMode=!!this.dataSetId,this.loadInitialData()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}ngAfterViewChecked(){this._needsConnectorUpdate&&(this._needsConnectorUpdate=!1,requestAnimationFrame(()=>this.updateAllConnectors()))}onWindowResize(){this.joinLinks.some(t=>t.selectedRelation)&&this.updateAllConnectors()}get availableElements(){const t=this.cards.map(n=>n.elementId);return this.workflowTypes.filter(n=>!t.includes(n.workflowTypeId))}get canAddElement(){return this.availableElements.length>0&&!this.loadingElements}getEndpointTypeLabel(t){switch(t){case"WORKFLOW":return"Element: Workflow";case"MASTERDATA":return"Element: Master Data";case"DOCUMENT":return"Element: Documents";case"SYSTEMDATA":return"Element: System Data";case"HISTORY_WORKFLOW":return"History: Workflow";case"TIME_TRACKING_HISTORY":return"Time Tracking: History";default:return t||""}}onAddElement(t){t&&(this.addElementSelected=null,this.loadAndAddElement(t))}loadAndAddElement(t){this.loadingElements=!0,this._apiService.getElementDetail(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loadingElements=!1)).subscribe({next:n=>{if(!n)return;const r=this.buildSingleCard(n,0===this.cards.length?"primary":"joined");if(this.cards.push(r),this.cards.length>=2){const u=this.createJoinLink(this.cards.length-2,this.cards.length-1);this.joinLinks.push(u),this._needsConnectorUpdate=!0}},error:()=>{this._messagingService.error("Failed to load element details","Error")}})}onRemoveCard(t){this.cards.splice(t,1),this.rebuildJoinLinks();for(let n=0;n<this.cards.length;n++)this.cards[n].role=0===n?"primary":"joined";this._needsConnectorUpdate=!0}rebuildJoinLinks(){const t=this.joinLinks;this.joinLinks=[];for(let n=0;n<this.cards.length-1;n++){const o=this.cards[n],r=this.cards[n+1],s=t.find(c=>c.detectedRelations.length>0&&c.detectedRelations[0]&&(c.detectedRelations[0].ownerElementId===o.elementId&&c.detectedRelations[0].relatedElementId===r.elementId||c.detectedRelations[0].ownerElementId===r.elementId&&c.detectedRelations[0].relatedElementId===o.elementId));s?(s.leftIndex=n,s.rightIndex=n+1,this.joinLinks.push(s)):this.joinLinks.push(this.createJoinLink(n,n+1))}}onFieldCheckedChange(t,n){const o=t.fields.find(r=>r===n.field);o&&(o.checked=n.checked)}get selectedFieldCount(){return this.cards.reduce((t,n)=>t+n.fields.filter(o=>o.checked).length,0)}onRelationDragStartFromCard(t,n){this.dragSourceFieldId=t.fieldId,this.dragSourceCardIndex=n}onCardDragOver(t,n){null==this.dragSourceFieldId||this.dragSourceCardIndex===n||(this.dragTargetCardIndex=n)}onCardDrop(t,n){if(null==this.dragSourceFieldId||null==this.dragSourceCardIndex)return;const o=Math.min(this.dragSourceCardIndex,n),r=Math.max(this.dragSourceCardIndex,n);if(r-o==1){const s=this.joinLinks.find(c=>c.leftIndex===o&&c.rightIndex===r);if(s){const c=s.detectedRelations.find(u=>u.fieldId===this.dragSourceFieldId);c&&(s.selectedRelation=c,this._needsConnectorUpdate=!0)}}this.clearDragState()}onCanvasDragEnd(){this.clearDragState()}onFieldDragStartFromCard(t,n){this.dragFieldInfo=t,this.dragFieldSourceCardIndex=n}onFieldDroppedOnCard(t,n){if(!this.dragFieldInfo||null==this.dragFieldSourceCardIndex||this.dragFieldSourceCardIndex===n)return void this.clearDragState();const o=this.dragFieldInfo.field,r=t.targetField,s=this.dragFieldSourceCardIndex,c=Math.min(s,n),u=Math.max(s,n);let g=this.joinLinks.find(b=>b.leftIndex===c&&b.rightIndex===u);if(!g&&u-c==1&&(g=this.createJoinLink(c,u),this.joinLinks.push(g)),g){const b=s===c?o:r,k=s===c?r:o,D={fieldId:0,fieldName:`${b.displayName} = ${k.displayName}`,ownerElementId:this.cards[c].elementId,ownerElementName:this.cards[c].element.name,relatedElementId:this.cards[u].elementId,relatedElementName:this.cards[u].element.name,direction:"primaryToJoined",isCustom:!0,leftField:b,rightField:k};g.detectedRelations.find(U=>U.isCustom&&U.leftField===b&&U.rightField===k)||g.detectedRelations.push(D),g.selectedRelation=D,this._needsConnectorUpdate=!0}this.clearDragState()}getDropTargetFieldKey(t){return this.dropTargetFieldKeys.get(t)||null}clearDragState(){this.dragSourceFieldId=null,this.dragSourceCardIndex=null,this.dragTargetCardIndex=null,this.dragFieldInfo=null,this.dragFieldSourceCardIndex=null,this.dropTargetFieldKeys.clear()}getLinkedRelationFieldId(t){for(const n of this.joinLinks)if((n.leftIndex===t||n.rightIndex===t)&&n.selectedRelation)return n.selectedRelation.fieldId;return null}onRelationSelected(t,n){this.joinLinks[t].selectedRelation=n,this._needsConnectorUpdate=!0}removeCustomRelation(t,n,o){o.stopPropagation();const r=this.joinLinks[t],s=r.detectedRelations.indexOf(n);s>=0&&r.detectedRelations.splice(s,1),r.selectedRelation===n&&(r.selectedRelation=r.detectedRelations.length>0?r.detectedRelations[0]:null),this._needsConnectorUpdate=!0}cycleJoinType(t){const n=["inner","left","right"],o=this.joinLinks[t],r=n.indexOf(o.joinType);o.joinType=n[(r+1)%n.length]}setLinkJoinType(t,n){this.joinLinks[t].joinType=n}getJoinTypeLabel(t){switch(t){case"inner":return"INNER";case"left":return"LEFT";case"right":return"RIGHT"}}updateAllConnectors(){if(!this.canvasContainer||!this.cardRefs)return;const t=this.canvasContainer.nativeElement.getBoundingClientRect(),n=this.cardRefs.toArray();for(const o of this.joinLinks){if(!o.selectedRelation){o.connectorPath="";continue}const r=n[o.leftIndex],s=n[o.rightIndex];if(!r||!s){o.connectorPath="";continue}const c=r.nativeElement.getBoundingClientRect(),u=s.nativeElement.getBoundingClientRect(),g=c.right-t.left,b=c.top+c.height/2-t.top,k=u.left-t.left,D=u.top+u.height/2-t.top,V=.4*Math.abs(k-g);o.connectorPath=`M ${g} ${b} C ${g+V} ${b}, ${k-V} ${D}, ${k} ${D}`,o.connectorMidpoint={x:(g+k)/2,y:(b+D)/2}}}createJoinLink(t,n){return{leftIndex:t,rightIndex:n,detectedRelations:this.detectRelationsBetween(this.cards[t].element,this.cards[n].element),selectedRelation:null,joinType:"inner",connectorPath:"",connectorMidpoint:{x:0,y:0}}}detectRelationsBetween(t,n){const o=[],r=t.dataFields||[],s=n.dataFields||[];for(const c of r)c.typeName===ve.en.RELATION&&c.relatedElementId===n.id&&o.push({f
1ieldId:c.id,fieldName:c.name,ownerElementId:t.id,ownerElementName:t.name,relatedElementId:n.id,relatedElementName:n.name,direction:"primaryToJoined"});for(const c of s)c.typeName===ve.en.RELATION&&c.relatedElementId===t.id&&o.push({fieldId:c.id,fieldName:c.name,ownerElementId:n.id,ownerElementName:n.name,relatedElementId:t.id,relatedElementName:t.name,direction:"joinedToPrimary"});return o}buildSingleCard(t,n){const o=[{name:"createdDate",displayName:"Created Date",type:"datetime"},{name:"modifiedDate",displayName:"Modified Date",type:"datetime"},{name:"createdBy",displayName:"Created By",type:"string"},{name:"createdByName",displayName:"Created By_name",type:"string"},{name:"modifiedBy",displayName:"Modified By",type:"string"},{name:"modifiedByName",displayName:"Modified By_name",type:"string"},{name:"currentStage",displayName:"Current Stage",type:"string"},{name:"assignedUser",displayName:"Assigned User",type:"string"},{name:"assignedUserName",displayName:"Assigned User_name",type:"string"},{name:"status",displayName:"Status",type:"string"}],r=[];for(const s of o)r.push({elementId:t.id,elementName:t.name,isCommon:!0,commonFieldName:s.name,displayName:s.displayName,fieldType:s.type,checked:!1,isRelation:!1});for(const s of t.dataFields||[]){const c=s.typeName===ve.en.RELATION,u=s.typeName===ve.en.USER_RELATION;r.push({elementId:t.id,elementName:t.name,isCommon:!1,dataFieldId:s.id,displayName:s.name,fieldType:c?"relation":this.mapFieldType(s.typeName),checked:!1,isRelation:c,relatedElementId:s.relatedElementId}),u&&r.push({elementId:t.id,elementName:t.name,isCommon:!1,commonFieldName:this.sanitizeFieldName(s.name)+"Name",displayName:s.name+"_name",fieldType:"string",checked:!1,isRelation:!1})}return{elementId:t.id,element:t,role:n,fields:r}}mapFieldType(t){switch(t){case ve.en.INTEGER:case ve.en.DECIMAL:return"number";case ve.en.BOOLEAN:return"boolean";case ve.en.DATE:return"datetime";default:return"string"}}loadInitialData(){this.loading=!0;const t={workflowTypes:this._apiService.getWorkflowTypes().pipe((0,ye.W)(()=>(0,le.of)([])))};this.isEditMode&&this.dataSetId&&(t.dataSet=this._apiService.getDataSet(this.dataSetId).pipe((0,ye.W)(()=>(0,le.of)(null)))),(0,vt.p)(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:n=>{this.workflowTypes=n.workflowTypes||[],this.isEditMode&&n.dataSet&&this.populateFromDataSet(n.dataSet)},error:()=>{this._messagingService.error("Failed to load data","Error")}})}populateFromDataSet(t){this.name=t.name,this.description=t.description||"";let n=[];if(t.elementIds)if(Array.isArray(t.elementIds))n=t.elementIds;else if("string"==typeof t.elementIds)try{const r=JSON.parse(t.elementIds);n=Array.isArray(r)?r:[]}catch{}if(0===n.length&&(n=[t.primaryElementId,t.joinedElementId].filter(r=>!!r)),0===n.length)return;this.loadingElements=!0;const o=n.map(r=>this._apiService.getElementDetail(r).pipe((0,ye.W)(()=>(0,le.of)(null))));(0,vt.p)(o).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loadingElements=!1)).subscribe({next:r=>{for(let u=0;u<r.length;u++){const g=r[u];g&&this.cards.push(this.buildSingleCard(g,0===u?"primary":"joined"))}for(let u=0;u<this.cards.length-1;u++)this.joinLinks.push(this.createJoinLink(u,u+1));let s=[];if(t.joins)if(Array.isArray(t.joins))s=t.joins;else if("string"==typeof t.joins)try{const u=JSON.parse(t.joins);s=Array.isArray(u)?u:[]}catch{}if(s.length>0)for(let u=0;u<s.length&&u<this.joinLinks.length;u++){const g=s[u],b=this.joinLinks[u];if(b.joinType=g.joinType||"inner",g.isCustom){const k=this.cards[b.leftIndex],D=this.cards[b.rightIndex],V=k?.fields.find(B=>g.leftCommonFieldName?B.isCommon&&B.commonFieldName===g.leftCommonFieldName:B.dataFieldId===g.leftFieldId),U=D?.fields.find(B=>g.rightCommonFieldName?B.isCommon&&B.commonFieldName===g.rightCommonFieldName:B.dataFieldId===g.rightFieldId);if(V&&U){const B={fieldId:0,fieldName:`${V.displayName} = ${U.displayName}`,ownerElementId:k.elementId,ownerElementName:k.element.name,relatedElementId:D.elementId,relatedElementName:D.element.name,direction:"primaryToJoined",isCustom:!0,leftField:V,rightField:U};b.detectedRelations.push(B),b.selectedRelation=B}}
1else{const k=b.detectedRelations.find(D=>D.fieldId===g.relationFieldId);k&&(b.selectedRelation=k)}}else if(this.joinLinks.length>0){const u=this.joinLinks[0];u.joinType=t.joinType||"inner";const g=u.detectedRelations.find(b=>b.fieldId===t.relationFieldId);g&&(u.selectedRelation=g)}let c=t.selectedFields;if("string"==typeof c)try{c=JSON.parse(c)}catch{c=[]}if(this.restoreCheckedFields(c||[]),t.calculatedFields){let u=[];if(Array.isArray(t.calculatedFields))u=t.calculatedFields;else if("string"==typeof t.calculatedFields)try{const g=JSON.parse(t.calculatedFields);u=Array.isArray(g)?g:[]}catch{u=[]}this.calculatedFields=u.map(g=>{if(g.formula&&Array.isArray(g.formula))return{...g,conditions:g.conditions||[],elseFormula:g.elseFormula||[],showElse:!!(g.elseFormula&&g.elseFormula.length>0)};const b=[];if("constant"===g.leftType&&null!=g.leftConstant)b.push({type:"constant",value:g.leftConstant});else if(g.leftFieldKey){const D=this.numericFieldOptions.find(V=>V.value===g.leftFieldKey);b.push({type:"field",fieldKey:g.leftFieldKey,displayName:D?.label||g.leftFieldKey})}const k={add:"+",subtract:"-",multiply:"*",divide:"/"};if(g.operator&&k[g.operator]&&b.push({type:"operator",operator:k[g.operator]}),"constant"===g.rightType&&null!=g.rightConstant)b.push({type:"constant",value:g.rightConstant});else if(g.rightFieldKey){const D=this.numericFieldOptions.find(V=>V.value===g.rightFieldKey);b.push({type:"field",fieldKey:g.rightFieldKey,displayName:D?.label||g.rightFieldKey})}return{id:g.id,name:g.name,conditions:[],formula:b,elseFormula:[],showElse:!1,resultType:g.resultType||"number"}});for(const g of this.calculatedFields)this.expressionTexts[g.id]=this.tokensToExpression(g.formula),this.elseExpressionTexts[g.id]=this.tokensToExpression(g.elseFormula||[])}this._needsConnectorUpdate=!0},error:()=>{this._messagingService.error("Failed to load element details","Error")}})}restoreCheckedFields(t){if(t&&0!==t.length)for(const n of this.cards)for(const o of n.fields)t.find(s=>s.isCommon&&o.isCommon?s.commonFieldName===o.commonFieldName&&s.elementId===o.elementId:!s.isCommon&&!o.isCommon&&s.dataFieldId===o.dataFieldId)&&(o.checked=!0)}sanitizeFieldName(t){if(!t)return"field";const n=t.replace(/[\s\-_]/g,"");return n.length>0?n[0].toLowerCase()+n.substring(1):n}get numericFieldOptions(){const t=[];for(const n of this.cards){const o=this.sanitizeFieldName(n.element?.name||"element");for(const r of n.fields)if(r.checked&&("number"===r.fieldType||"decimal"===r.fieldType||"currency"===r.fieldType||"int"===r.fieldType)){const s=r.isCommon?`${o}_${r.commonFieldName}`:`${o}_${this.sanitizeFieldName(r.displayName||"")}`;t.push({label:`${n.element?.name} - ${r.displayName}`,value:s})}}return t}get allFieldOptions(){const t=[];for(const n of this.cards){const o=this.sanitizeFieldName(n.element?.name||"element");for(const r of n.fields){if(!r.checked)continue;const s=r.isCommon?`${o}_${r.commonFieldName}`:`${o}_${this.sanitizeFieldName(r.displayName||"")}`;t.push({label:`${n.element?.name} - ${r.displayName}`,value:s,fieldType:r.fieldType})}}return t}addCalculatedField(){const t={id:"calc-"+Date.now()+"-"+Math.random().toString(36).substr(2,6),name:"",conditions:[],formula:[],elseFormula:[],showElse:!1,resultType:"number"};this.calculatedFields.push(t),this.calcConstantInputs[t.id]=null,this.expressionTexts[t.id]="",this.elseExpressionTexts[t.id]=""}removeCalculatedField(t){const n=this.calculatedFields[t];delete this.calcConstantInputs[n.id],delete this.calcConstantInputs[n.id+"_else"],delete this.expressionTexts[n.id],delete this.elseExpressionTexts[n.id],this.calculatedFields.splice(t,1)}tokensToExpression(t){return t&&0!==t.length?t.map(n=>{switch(n.type){case"field":return`{${n.displayName}}`;case"operator":return n.operator;case"constant":return String(n.value);default:return""}}).join(" "):""}expressionToTokens(t){if(!t||!t.trim())return[];const n=[],o=/\{([^}]+)\}|\b(AND|OR|NOT)\b|(<>|<=|>=|[+\-*\/%^&()=<>])|(\d+\.?\d*)/g;let r;for(;null!==(r=o.exec(t));)if(void 0!==r[1]){const s=r[1],c=this.allFieldOptions.find(u=>u.label===s);n.push({type:"field",fieldKey:c?.value||this.sanitizeFieldName(s),displayName:s})}else void 0!==r[2]?n.push({type:"operator",operator:r[2]}):void 0!==r[3]?n.push({type:"operator",operator:r[3]}):void 0!==r[4]&&n.push({type:"constant",value:parseFloat(r[4])});return n}insertIntoExpression(t,n,o){const r="else"===o?this.elseExpressionTexts:this.expressionTexts,s=r[t]||"";r[t]=s?s+" "+n:n}validateExpression(t){if(!t||!t.trim())return[];const n=[];let o=0;for(const c of t)if("("===c&&o++,")"===c&&o--,o<0){n.push("Unexpected closing parenthesis");break}o>0&&n.push(`${o} unclosed parenthesis${o>1?"es":""}`);let r=0;for(const c of t)if("{"===c&&r++,"}"===c&&r--,r<0){n.push("Unexpected closing brace }");break}r>0&&n.push("Unclosed field reference \u2014 missing }");const s=t.match(/\{([^}]+)\}/g);if(s)for(const c of s){const u=c.slice(1,-1);this.allFieldOptions.find(b=>b.label===u)||n.push(`Unknown field: ${u}`)}return n}getExpressionPreview(t){if(!t||!t.trim())return"";const n=this.expressionToTokens(t);return 0===n.length?"No valid tokens parsed":n.map(o=>{switch(o.type){case"field":return`[Field: ${o.displayName}]`;case"operator":return o.operator;case"constant":return String(o.value);default:return"?"}}).join(" ")}
1addCondition(t){t.conditions.push({fieldKey:"",fieldDisplayName:"",comparison:"equals",value:""})}removeCondition(t,n){t.conditions.splice(n,1),0===t.conditions.length&&(t.showElse=!1,t.elseFormula=[])}onConditionFieldChange(t,n){const o=this.allFieldOptions.find(r=>r.value===n);o&&(t.fieldKey=o.value,t.fieldDisplayName=o.label)}toggleElse(t){t.showElse=!t.showElse,t.showElse?t.elseFormula||(t.elseFormula=[],this.elseExpressionTexts[t.id]="",this.calcConstantInputs[t.id+"_else"]=null):(t.elseFormula=[],this.elseExpressionTexts[t.id]="")}get canSave(){return!(!this.name.trim()||0===this.cards.length||0===this.selectedFieldCount)&&this.joinLinks.every(t=>null!==t.selectedRelation)}onSave(){if(!this.canSave)return void this._messagingService.warning("Please complete all required fields, select join relations, and select at least one field.","Validation");this.saving=!0;const t=this.getCheckedFields().map(u=>({elementId:u.elementId,dataFieldId:u.dataFieldId,commonFieldName:u.commonFieldName,isCommon:u.isCommon,alias:`${u.elementName} - ${u.displayName}`})),n=this.joinLinks.map(u=>{const g=u.selectedRelation,b={leftElementId:this.cards[u.leftIndex].elementId,rightElementId:this.cards[u.rightIndex].elementId,relationFieldId:g.fieldId,joinDirection:g.direction,joinType:u.joinType};return g.isCustom&&g.leftField&&g.rightField&&(b.isCustom=!0,b.leftFieldId=g.leftField.dataFieldId,b.leftCommonFieldName=g.leftField.isCommon?g.leftField.commonFieldName:void 0,b.rightFieldId=g.rightField.dataFieldId,b.rightCommonFieldName=g.rightField.isCommon?g.rightField.commonFieldName:void 0),b}),o=this.cards.map(u=>u.elementId),r=0===this.joinLinks.length,s=r?null:this.joinLinks[0],c={name:this.name.trim(),description:this.description.trim()||void 0,primaryElementId:this.cards[0].elementId,joinedElementId:r?0:this.cards.length>1?this.cards[1].elementId:this.cards[0].elementId,relationFieldId:r?0:s.selectedRelation.fieldId,joinDirection:r?"primaryToJoined":s.selectedRelation.direction,joinType:r?"inner":s.joinType,selectedFields:t,joins:n,elementIds:o,calculatedFields:this.calculatedFields.filter(u=>u.name&&(this.expressionTexts[u.id]||"").trim()).map(u=>{const g=this.expressionToTokens(this.expressionTexts[u.id]||""),b=u.showElse?this.expressionToTokens(this.elseExpressionTexts[u.id]||""):[],k=(this.expressionTexts[u.id]||"").trim(),D=u.showElse?(this.elseExpressionTexts[u.id]||"").trim():"",{showElse:V,...U}=u;return{...U,formula:g,elseFormula:b,expressionText:k,elseExpressionText:D}})};this.isEditMode&&this.dataSetId?this._apiService.updateDataSet(this.dataSetId,c).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:()=>{this._messagingService.success("Data set updated successfully","Success"),this._router.navigate(["/private/ad-hoc-reports"],{queryParams:{tab:2}})},error:g=>{this._messagingService.error(g?.error?.message||"Failed to update data set","Error")}}):this._apiService.createDataSet(c).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:()=>{this._messagingService.success("Data set created successfully","Success"),this._router.navigate(["/private/ad-hoc-reports"],{queryParams:{tab:2}})},error:g=>{this._messagingService.error(g?.error?.message||"Failed to create data set","Error")}})}getCheckedFields(){const t=[];for(const n of this.cards)t.push(...n.fields.filter(o=>o.checked));return t}get canPreview(){return this.canSave&&!this.previewLoading&&!this.saving}onViewData(){this.canSave&&(this.showPreview=!0,this.previewLoading=!0,this.previewData=[],this.previewColumns=[],this.saveForPreview().then(t=>{t?this.loadPreviewData(t):this.previewLoading=!1},()=>{this.previewLoading=!1,this._messagingService.error("Failed to save data set for preview","Error")}))}saveForPreview(){return new Promise((t,n)=>{const o=this.getCheckedFields().map(b=>({elementId:b.elementId,dataFieldId:b.dataFieldId,commonFieldName:b.commonFieldName,isCommon:b.isCommon,alias:`${b.elementName} - ${b.displayName}`})),r=this.joinLinks.map(b=>{const k=b.selectedRelation,D={leftElementId:this.cards[b.leftIndex].elementId,rightElementId:this.cards[b.rightIndex].elementId,relationFieldId:k.fieldId,joinDirection:k.direction,joinType:b.joinType};return k.isCustom&&k.leftField&&k.rightField&&(D.isCustom=!0,D.leftFieldId=k.leftField.dataFieldId,D.leftCommonFieldName=k.leftField.isCommon?k.leftField.commonFieldName:void 0,D.rightFieldId=k.rightField.dataFieldId,D.right
1CommonFieldName=k.rightField.isCommon?k.rightField.commonFieldName:void 0),D}),s=this.cards.map(b=>b.elementId),c=0===this.joinLinks.length,u=c?null:this.joinLinks[0];console.log("[DataSet Save] isSingleElement:",c,"relationFieldId:",c?0:u.selectedRelation.fieldId,"joins:",JSON.stringify(r),"elementIds:",s);const g={name:this.name.trim(),description:this.description.trim()||void 0,primaryElementId:this.cards[0].elementId,joinedElementId:c?0:this.cards.length>1?this.cards[1].elementId:this.cards[0].elementId,relationFieldId:c?0:u.selectedRelation.fieldId,joinDirection:c?"primaryToJoined":u.selectedRelation.direction,joinType:c?"inner":u.joinType,selectedFields:o,joins:r,elementIds:s,calculatedFields:this.calculatedFields.filter(b=>b.name&&(this.expressionTexts[b.id]||"").trim()).map(b=>{const k=this.expressionToTokens(this.expressionTexts[b.id]||""),D=b.showElse?this.expressionToTokens(this.elseExpressionTexts[b.id]||""):[],V=(this.expressionTexts[b.id]||"").trim(),U=b.showElse?(this.elseExpressionTexts[b.id]||"").trim():"",{showElse:B,...De}=b;return{...De,formula:k,elseFormula:D,expressionText:V,elseExpressionText:U}})};this.isEditMode&&this.dataSetId?this._apiService.updateDataSet(this.dataSetId,g).pipe((0,L.Q)(this._destroyed$)).subscribe({next:()=>t(this.dataSetId),error:b=>n(b)}):this._apiService.createDataSet(g).pipe((0,L.Q)(this._destroyed$)).subscribe({next:b=>{this.dataSetId=b.dataSetId||b.DataSetId,this.isEditMode=!0,t(this.dataSetId)},error:b=>n(b)})})}loadPreviewData(t){const n=new Date(2e3,0,1).toISOString(),o=new Date(2099,11,31).toISOString();this._apiService.queryDataSet(t,{page:1,pageSize:10,dateFrom:n,dateTo:o}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.previewLoading=!1)).subscribe({next:r=>{if(console.log("[DataSet Preview] Raw API result:",JSON.stringify(r,null,2)),!r)return this.previewDebugInfo="API returned null/undefined result",void console.warn("[DataSet Preview] result is null/undefined");const s=r.data||r.Data||[],c=r.metadata||r.Metadata;console.log("[DataSet Preview] Data rows:",s.length,"First row:",s[0]),console.log("[DataSet Preview] Metadata:",c),this.previewData=s.map(k=>{const D={...k};return k.elementData?Object.assign(D,k.elementData):k.ElementData&&Object.assign(D,k.ElementData),D});const u=[],g=c?.commonFields||c?.CommonFields||[],b=c?.elementFields||c?.ElementFields||[];for(const k of g){const D=k.name||k.Name;D&&u.push({field:D,header:k.displayName||k.DisplayName||D})}for(const k of b){const D=k.name||k.Name;D&&u.push({field:D,header:k.displayName||k.DisplayName||D})}if(0===u.length&&this.previewData.length>0){const k=this.previewData[0];for(const D of Object.keys(k))"relativeId"!==D&&"elementId"!==D&&"elementData"!==D&&"ElementData"!==D&&u.push({field:D,header:D})}this.previewColumns=u,this.previewDebugInfo=`Rows: ${this.previewData.length}, Columns: ${u.length}, Pagination: ${JSON.stringify(r.pagination||r.Pagination||{})}`,console.log("[DataSet Preview] Final columns:",u),console.log("[DataSet Preview] Final rows (first):",this.previewData[0])},error:r=>{console.error("[DataSet Preview] Query error:",r),this.previewDebugInfo=`Error: ${r?.status} ${r?.message||r?.error?.message||"Unknown"}`,this._messagingService.error("Failed to load preview data","Error")}})}static{this.ISO_DATE_REGEX=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/}formatCellValue(t){if(null==t)return"";if("string"==typeof t&&i.ISO_DATE_REGEX.test(t)){const n=new Date(t);if(!isNaN(n.getTime()))return`${String(n.getMonth()+1).padStart(2,"0")}/${String(n.getDate()).padStart(2,"0")}/${n.getFullYear()}`}return String(t)}onCancel(){this._router.navigate(["/private/ad-hoc-reports"],{queryParams:{tab:2}})}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(Ye.F),e.rXU(q.Ui),e.rXU(e.SKi))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-dataset-builder"]],viewQuery:function(n,o){if(1&n&&(e.GBs(r2,5),e.GBs(a2,5)),2&n){let r;e.mGM(r=e.lsd())&&(o.canvasContainer=r.first),e.mGM(r=e.lsd())&&(o.cardRefs=r)}},hostBindings:function(n,o){1&n&&e.bIt("resize",function(){return o.onWindowResize()},!1,e.tSv)},decls:24,vars:19,consts:[["canvasContainer",""],["cardRef",""],[1,"dataset-builder
1-container"],[1,"builder-header"],[1,"header-title"],["type","button","title","Go back",1,"button","button_clear","button_colorAlt",3,"click"],[1,"mdi","mdi-arrow-left"],[1,"header-actions"],["type","button","title","Cancel",1,"button","button_outline",3,"click"],["type","button","title","Preview data set results",1,"button","button_outline","button_colorMain",3,"click","disabled"],[1,"mdi","mdi-table-eye","buttonIcon_right"],["type","button","title","Save Data Set",1,"button","button_colorSuccess",3,"click","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-content-save buttonIcon_right",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","builder-content",4,"ngIf"],["header","Data Set Preview","styleClass","preview-dialog",3,"visibleChange","visible","modal","draggable","resizable","contentStyle"],["class","preview-loading",4,"ngIf"],["class","preview-empty",4,"ngIf"],["scrollHeight","60vh","styleClass","p-datatable-sm p-datatable-gridlines p-datatable-striped",3,"value","scrollable","rows",4,"ngIf"],["pTemplate","footer"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-content-save","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[1,"builder-content"],[1,"settings-bar"],[1,"settings-field","name-field"],["for","dsName"],["id","dsName","type","text","pInputText","","placeholder","Enter data set name","maxlength","200",3,"ngModelChange","ngModel"],[1,"settings-field","desc-field"],["for","dsDesc"],["id","dsDesc","type","text","pInputText","","placeholder","Optional description","maxlength","1000",3,"ngModelChange","ngModel"],["class","join-links-bar",4,"ngIf"],[1,"canvas-area",3,"dragend"],["class","add-element-toolbar",4,"ngIf"],["class","canvas-loading",4,"ngIf"],["class","cards-scroll-wrapper",4,"ngIf"],["class","connector-overlay",4,"ngIf"],[4,"ngFor","ngForOf"],["class","empty-canvas",4,"ngIf"],["class","summary-bar",4,"ngIf"],["class","calculated-fields-section",4,"ngIf"],[1,"join-links-bar"],["class","join-link-row",4,"ngFor","ngForOf"],[1,"join-link-row"],[1,"link-label"],[1,"mdi","mdi-link-variant"],[1,"mdi","mdi-arrow-right"],[1,"link-join-type"],["class","join-chip",3,"selected","title","click",4,"ngFor","ngForOf"],["class","link-relations",4,"ngIf"],["class","link-no-relations",4,"ngIf"],[1,"join-chip",3,"click","title"],[1,"link-relations"],[1,"relations-label"],["class","relation-chip",3,"selected","custom-chip","click",4,"ngFor","ngForOf"],[1,"relation-chip",3,"click"],[4,"ngIf"],["class","mdi mdi-check-circle selected-check",4,"ngIf"],["class","mdi mdi-close remove-custom-join","title","Remove custom join",3,"click",4,"ngIf"],["class","mdi mdi-radiobox-blank confirm-indicator",4,"ngIf"],[1,"relation-owner"],[1,"relation-field-name"],[1,"relation-target"],[1,"mdi","mdi-radiobox-blank","confirm-indicator"],[1,"mdi","mdi-drag-variant","custom-icon"],[1,"mdi","mdi-equal"],[1,"mdi","mdi-check-circle","selected-check"],["title","Remove custom join",1,"mdi","mdi-close","remove-custom-join",3,"click"],[1,"link-no-relations"],[1,"mdi","mdi-gesture-swipe-horizontal"],[1,"add-element-toolbar"],["optionLabel","name","optionValue","workflowTypeId","placeholder","+ Add Endpoint","filterBy","name","styleClass","add-element-dropdown",3,"ngModelChange","onChange","options","ngModel","showClear","filter"],["pTemplate","item"],[1,"element-option"],[1,"name"],[1,"count"],[1,"canvas-loading"],["type","pulsing","size","small"],[1,"cards-scroll-wrapper"],[1,"cards-container"],[1,"card-wrapper"],[3,"fieldCheckedChange","cardRemoved","relationDragStart","fieldDragStart","fieldDropped","cardDragOver","cardDrop","card","isDragTarget","linkedRelationFieldId","dropTargetFieldKey"],[1,"connector-overlay"],["id","arrowhead","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto"],["points","0 0, 8 3, 0 6","fill","#6366f1"],["fill","none","stroke","#6366f1","stroke-width","2","stroke-dasharray","6 3","marker-end","url(#arrowhead)",4,"ngIf"],["fill","none","stroke","#6366f1","stroke-width","2","stroke-dasharray","6 3","marker-end","url(#arrowhead)"],["class","join-badge","title","Click to change join type",3,"left","top","click",4,"ngIf"],["title","Click to change join type",1,"join-badge",3,"click"],[1,"empty-canvas"],[1,"mdi","mdi-database-plus-outline"],[1,"summary-bar"],["class","no-fields-hint",4,"ngIf"],[1,"no-fields-hint"],[1,"calculated-fields-section"],[1,"calc-header"],[1,"mdi","mdi-calculator-variant"],["type","button",1,"button","button_sm",3,"click","disabled"],[1,"mdi","mdi-plus"],["class","calc-empty",4,"ngIf"],["class","calc-field-card",4,"ngFor","ngForOf"],[1,"calc-empty"],[1,"calc-field-card"],[1,"calc-card-header"],[1,"calc-card-title"],["type","button","title","Remove calculated field",1,"button","button_round","button_sm","calc-remove",3,"click"],[1,"mdi","mdi-close"],[1,"calc-name-row"],["type","text","pInputText","","placeholder","e.g., Weighted Revenue","maxlength","100",3,"ngModelChange","ngModel"],[1,"calc-conditions-section"],[1,"conditions-toggle",3,"click"],[1,"mdi","mdi-chevron-right"],[1,"conditions-label"],["class","conditions-hint",4,"ngIf"],["class","conditions-list",4,"ngIf"],[1,"expression-editor"],[1,"formula-label"],["placeholder","e.g., ( {Revenue} * {Probability}
1 ) + 100","spellcheck","false","rows","3",1,"expression-textarea",3,"ngModelChange","ngModel"],["class","expression-feedback",4,"ngIf"],[1,"formula-editor-columns"],[1,"editor-column"],[1,"editor-column-header"],[1,"editor-column-list"],["class","editor-column-item",3,"dblclick",4,"ngFor","ngForOf"],["class","editor-column-empty",4,"ngIf"],["class","fn-category",4,"ngFor","ngForOf"],[1,"op-group-label"],[1,"editor-operator-grid"],["type","button","class","op-btn",3,"click",4,"ngFor","ngForOf"],["type","button",1,"op-btn","op-btn-wide",3,"click"],["type","button","class","op-btn op-btn-wide",3,"click",4,"ngFor","ngForOf"],[1,"constant-input-group"],["placeholder","#","mode","decimal",3,"ngModelChange","ngModel","minFractionDigits","maxFractionDigits"],["type","button",1,"button","button_sm",3,"click"],["class","calc-else-section",4,"ngIf"],[1,"conditions-hint"],[1,"conditions-list"],["class","condition-row",4,"ngFor","ngForOf"],["type","button",1,"button","button_text","button_sm",3,"click"],[1,"condition-row"],[1,"condition-prefix"],["optionLabel","label","optionValue","value","placeholder","Select field","filterBy","label","appendTo","body",3,"ngModelChange","onChange","options","ngModel","filter"],["optionLabel","label","optionValue","value","appendTo","body",3,"ngModelChange","options","ngModel"],["type","text","pInputText","","placeholder","Value",1,"condition-value-input",3,"ngModelChange","ngModel"],["type","button","title","Remove condition",1,"button","button_round","button_sm","condition-remove",3,"click"],[1,"expression-feedback"],["class","expression-errors",4,"ngIf"],["class","expression-valid",4,"ngIf"],[1,"expression-errors"],["class","expression-error-msg",4,"ngFor","ngForOf"],[1,"expression-error-msg"],[1,"mdi","mdi-alert-circle"],[1,"expression-valid"],[1,"mdi","mdi-check-circle"],[1,"expression-preview"],[1,"editor-column-item",3,"dblclick"],[1,"field-name"],[1,"field-type-badge"],[1,"editor-column-empty"],[1,"fn-category"],[1,"fn-category-header",3,"click"],[1,"mdi"],["class","fn-category-items",4,"ngIf"],[1,"fn-category-items"],["class","editor-column-item fn-item",3,"title","dblclick",4,"ngFor","ngForOf"],[1,"editor-column-item","fn-item",3,"dblclick","title"],["type","button",1,"op-btn",3,"click"],[1,"calc-else-section"],["type","button","class","button button_text button_sm",3,"click",4,"ngIf"],["class","else-block",4,"ngIf"],[1,"else-block"],[1,"else-header"],["type","button",1,"button","button_text","button_sm","else-remove",3,"click"],["placeholder","e.g., {Revenue} * 0.5","spellcheck","false","rows","3",1,"expression-textarea",3,"ngModelChange","ngModel"],[1,"preview-loading"],[1,"preview-empty"],[1,"mdi","mdi-table-off"],["class","preview-debug-info",4,"ngIf"],[1,"preview-debug-info"],["scrollHeight","60vh","styleClass","p-datatable-sm p-datatable-gridlines p-datatable-striped",3,"value","scrollable","rows"],["pTemplate","header"],["pTemplate","body"],[3,"pSortableColumn",4,"ngFor","ngForOf"],[3,"pSortableColumn"],[3,"field"],[1,"preview-footer"],["class","preview-row-count",4,"ngIf"],["type","button",1,"button","button_outline",3,"click"],[1,"preview-row-count"]],template:function(n,o){1&n&&(e.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"button",5),e.bIt("click",function(){return o.onCancel()}),e.nrm(4,"i",6),e.k0s(),e.j41(5,"h2"),e.EFF(6),e.k0s()(),e.j41(7,"div",7)(8,"button",8),e.bIt("click",function(){return o.onCancel()}),e.EFF(9," Cancel "),e.k0s(),e.j41(10,"button",9),e.bIt("click",function(){return o.onViewData()}),e.nrm(11,"i",10),e.EFF(12," View Data "),e.k0s(),e.j41(13,"button",11),e.bIt("click",function(){return o.onSave()}),e.DNE(14,p2,1,0,"i",12)(15,u2,1,0,"i",13),e.EFF(16," Save Data Set "),e.k0s()()(),e.DNE(17,_2,4,0,"div",14)(18,Ty,21,11,"div",15),e.k0s(),e.j41(19,"p-dialog",16),e.mxI("visibleChange",function(s){return e.DH7(o.showPreview,s)||(o.showPreview=s),s}),e.DNE(20,Ey,4,0,"div",17)(21,ky,5,1,"div",18)(22,Dy,3,3,"p-table",19)(23,xy,4,1,"ng-template",20),e.k0s()),2&n&&(e.R7$(6),e.JRh(o.isEditMode?"Edit Data Set":"New Data Set"),e.R7$(4),e.Y8G("disabled",!o.canPreview),e.R7$(3),e.Y8G("disabled",o.saving||!o.canSave),e.R7$(),e.Y8G("ngIf",o.saving),e.R7$(),e.Y8G("ngIf",!o.saving),e.R7$(2),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading),e.R7$(),e.Aen(e.lJ4(17,s2)),e.R50("visible",o.showPreview),e.Y8G("modal",!0)("draggable",!1)("resizable",!1)("contentStyle",e.lJ4(18,l2)),e.R7$(),e.Y8G("ngIf",o.previewLoading),e.R7$(),e.Y8G("ngIf",!o.previewLoading&&0===o.previewData.length),e.R7$(),e.Y8G("ngIf",!o.previewLoading&&o.previewData.length>0))},dependencies:[M.Sq,M.bT,R.me,R.BC,R.tU,R.vS,ke.Ei,_t.l,Le.ms,Io.YI,_e.S,Na.XI,Na.Tg,Na.yc,ee.C3,ze.VU,o2],styles:[".dataset-builder
1-container[_ngcontent-%COMP%]{padding:24px;height:100%;overflow:auto}.builder-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-size:24px;font-weight:600;color:#000}.builder-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:12px;align-items:center}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px;gap:16px;color:#7b7b7b}.builder-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:0}.settings-bar[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:16px;padding:16px 20px;background:#fff;border:1px solid #dedede;border-radius:10px 10px 0 0;border-bottom:2px solid #dedede}.settings-bar[_ngcontent-%COMP%]   .settings-field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.settings-bar[_ngcontent-%COMP%]   .settings-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:#7b7b7b}.settings-bar[_ngcontent-%COMP%]   .settings-field[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%]{width:100%}.settings-bar[_ngcontent-%COMP%]   .name-field[_ngcontent-%COMP%]{flex:1;max-width:280px}.settings-bar[_ngcontent-%COMP%]   .desc-field[_ngcontent-%COMP%]{flex:2;max-width:400px}.join-links-bar[_ngcontent-%COMP%]{background:#fff;border:1px solid #dedede;border-top:none;padding:0}.join-link-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;padding:10px 20px;flex-wrap:wrap}.join-link-row[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid rgba(222,222,222,.5)}.join-link-row[_ngcontent-%COMP%]   .link-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:#000;white-space:nowrap}.join-link-row[_ngcontent-%COMP%]   .link-label[_ngcontent-%COMP%]   .mdi-link-variant[_ngcontent-%COMP%]{color:#5f84fc;font-size:16px}.join-link-row[_ngcontent-%COMP%]   .link-label[_ngcontent-%COMP%]   .mdi-arrow-right[_ngcontent-%COMP%]{color:#7b7b7b;font-size:14px}.join-link-row[_ngcontent-%COMP%]   .link-join-type[_ngcontent-%COMP%]{display:flex;gap:4px}.join-link-row[_ngcontent-%COMP%]   .link-relations[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap}.join-link-row[_ngcontent-%COMP%]   .link-relations[_ngcontent-%COMP%]   .relations-label[_ngcontent-%COMP%]{font-size:12px;font-weight:600;color:#7b7b7b;white-space:nowrap}.join-link-row[_ngcontent-%COMP%]   .link-no-relations[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-left:auto;font-size:13px;color:#ff9800}.join-link-row[_ngcontent-%COMP%]   .link-no-relations[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:16px}.join-chip[_ngcontent-%COMP%]{padding:4px 8px;font-size:11px;font-weight:600;border:2px solid #dedede;border-radius:5px;cursor:pointer;transition:all .2s;color:#7b7b7b;white-space:nowrap}.join-chip[_ngcontent-%COMP%]:hover{border-color:#5f84fc;color:#5f84fc}.join-chip.selected[_ngcontent-%COMP%]{border-color:#5f84fc;background:#5f84fc14;color:#5f84fc}.relation-chip[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;padding:4px 10px;border:2px solid #dedede;border-radius:5px;cursor:pointer;font-size:12px;transition:all .2s}.relation-chip[_ngcontent-%COMP%]:hover{border-color:#5f84fc;background:#5f84fc0a}.relation-chip.selected[_ngcontent-%COMP%]{border-color:#5f84fc;background:#5f84fc14}.relation-chip[_ngcontent-%COMP%]   .confirm-indicator[_ngcontent-%COMP%]{font-size:14px;color:#dedede;transition:color .15s}.relation-chip[_ngcontent-%COMP%]:hover   .confirm-indicator[_ngcontent-%COMP%]{color:#5f84fc}.relation-chip[_ngcontent-%COMP%]   .relation-owner[_ngcontent-%COMP%]{font-weight:600;color:#000}.relation-chip[_ngcontent-%COMP%]   .relation-field-name[_ngcontent-%COMP%]{color:#5f84fc;font-weight:500}.relation-chip[_ngcontent-%COMP%]   .mdi-arrow-right[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b}.relation-chip[_ngcontent-%COMP%]   .relation-target[_ngcontent-%COMP%]{font-weight:600;color:#000}.relation-chip[_ngcontent-%COMP%]   .selected-check[_ngcontent-%COMP%]{color:#5f84fc;font-size:14px;margin-left:2px}.relation-chip[_ngcontent-%COMP%]   .custom-icon[_ngcontent-%COMP%]{color:#ff9800;font-size:14px}.relation-chip[_ngcontent-%COMP%]   .mdi-equal[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b}.relation-chip[_ngcontent-%COMP%]   .remove-custom-join[_ngcontent-%COMP%]{font-size:14px;color:#7b7b7b;margin-left:4px;cursor:pointer;transition:color .15s}.relation-chip[_ngcontent-%COMP%]   .remove-custom-join[_ngcontent-%COMP%]:hover{color:#d32f2f}.relation-chip.custom-chip[_ngcontent-%COMP%]{border-style:dashed;border-color:#ff9800}.relation-chip.custom-chip.selected[_ngcontent-%COMP%]{border-color:#ff9800;background:#ff980014}.canvas-area[_ngcontent-%COMP%]{position:relative;min-height:480px;background:#fafbfd;background-image:radial-gradient(circle,rgba(222,222,222,.4) 1px,transparent 1px);background-size:20px 20px;border:1px solid #dedede;border-top:none;border-radius:0 0 10px 10px;padding:24px}.add-element-toolbar[_ngcontent-%COMP%]{margin-bottom:20px}.add-element-toolbar[_ngcontent-%COMP%]     .add-element-dropdown{min-width:240px}.element-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%}.element-option[_ngcontent-%COMP%]   .name[_ngcontent-%COMP%]{font-weight:500}.element-option[_ngcontent-%COMP%]   .count[_ngcontent-%COMP%]{font-size:12px;color:#7b7b7b}.canvas-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:20px;color:#7b7b7b;font-size:14px}.cards-scroll-wrapper[_ngcontent-%COMP%]{overflow-x:auto;overflow-y:visible;padding-bottom:8px}.cards-scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar{height:6px}.cards-scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.cards-scroll-wrapper[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#dedede99;border-radius:3px}.cards-container[_ngcontent-%COMP%]{display:inline-flex;align-items:flex-start;gap:80px;padding:16px 24px;min-width:100%}
1.card-wrapper[_ngcontent-%COMP%]{flex-shrink:0}.connector-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;overflow:visible}.join-badge[_ngcontent-%COMP%]{position:absolute;pointer-events:all;cursor:pointer;display:flex;align-items:center;gap:4px;padding:4px 10px;background:#fff;border:2px solid #6366f1;border-radius:6px;font-size:11px;font-weight:700;color:#6366f1;box-shadow:0 2px 6px #0000001a;transition:background .2s;z-index:10}.join-badge[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:14px}.join-badge[_ngcontent-%COMP%]:hover{background:#6366f10f}.empty-canvas[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 24px;text-align:center;color:#7b7b7b}.empty-canvas[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:56px;color:#dedede;margin-bottom:16px}.empty-canvas[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 4px;font-size:16px;font-weight:500}.empty-canvas[_ngcontent-%COMP%]   small[_ngcontent-%COMP%]{font-size:13px}.summary-bar[_ngcontent-%COMP%]{padding:12px 20px;background:#fff;border:1px solid #dedede;border-top:none;border-radius:0 0 10px 10px;font-size:14px;color:#000;margin-top:-1px}.summary-bar[_ngcontent-%COMP%]   strong[_ngcontent-%COMP%]{color:#5f84fc}.summary-bar[_ngcontent-%COMP%]   .no-fields-hint[_ngcontent-%COMP%]{color:#7b7b7b;font-style:italic}.preview-loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px;gap:16px;color:#7b7b7b}.preview-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px;gap:12px;color:#7b7b7b}.preview-empty[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:48px;color:#dedede}.preview-empty[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:14px}.preview-empty[_ngcontent-%COMP%]   .preview-debug-info[_ngcontent-%COMP%]{display:block;margin-top:8px;color:#888;font-size:11px}.preview-footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.preview-footer[_ngcontent-%COMP%]   .preview-row-count[_ngcontent-%COMP%]{font-size:13px;color:#7b7b7b}  .preview-dialog .p-datatable{font-size:13px}  .preview-dialog .p-datatable th{white-space:nowrap}  .preview-dialog .p-datatable td{max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (max-width: 768px){.settings-bar[_ngcontent-%COMP%]{flex-direction:column;align-items:stretch}.settings-bar[_ngcontent-%COMP%]   .name-field[_ngcontent-%COMP%], .settings-bar[_ngcontent-%COMP%]   .desc-field[_ngcontent-%COMP%]{max-width:none}.join-link-row[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.join-link-row[_ngcontent-%COMP%]   .link-relations[_ngcontent-%COMP%]{margin-left:0}}.calculated-fields-section[_ngcontent-%COMP%]{margin-top:16px;padding:16px 24px;border:1px solid #dedede;border-radius:8px;background:#fafbfc}.calculated-fields-section[_ngcontent-%COMP%]   .calc-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;font-weight:600;font-size:.875rem}.calculated-fields-section[_ngcontent-%COMP%]   .calc-header[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{margin-right:6px;color:#5f84fc}.calculated-fields-section[_ngcontent-%COMP%]   .calc-empty[_ngcontent-%COMP%]{color:#9ca3af;font-size:.8125rem;padding:4px 0}.calc-field-card[_ngcontent-%COMP%]{background:#fff;border:1px solid #dedede;border-radius:8px;padding:16px;margin-bottom:12px}.calc-field-card[_ngcontent-%COMP%]   .calc-card-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.calc-field-card[_ngcontent-%COMP%]   .calc-card-header[_ngcontent-%COMP%]   .calc-card-title[_ngcontent-%COMP%]{font-size:11px;font-weight:700;letter-spacing:.5px;color:#7b7b7b;text-transform:uppercase}.calc-field-card[_ngcontent-%COMP%]   .calc-name-row[_ngcontent-%COMP%]{margin-bottom:16px}.calc-field-card[_ngcontent-%COMP%]   .calc-name-row[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;font-size:12px;font-weight:500;color:#7b7b7b;margin-bottom:4px}.calc-field-card[_ngcontent-%COMP%]   .calc-name-row[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%;max-width:320px}.calc-remove[_ngcontent-%COMP%]{color:#ef4444;border-color:#fecaca}.calc-remove[_ngcontent-%COMP%]:hover{background:#fef2f2}.calc-conditions-section[_ngcontent-%COMP%]{margin-bottom:16px}.calc-conditions-section[_ngcontent-%COMP%]   .conditions-toggle[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;cursor:pointer;padding:6px 0;font-size:13px;color:#5f84fc;font-weight:600}.calc-conditions-section[_ngcontent-%COMP%]   .conditions-toggle[_ngcontent-%COMP%]   .mdi-chevron-right[_ngcontent-%COMP%]{transition:transform .2s;font-size:18px}.calc-conditions-section[_ngcontent-%COMP%]   .conditions-toggle[_ngcontent-%COMP%]   .mdi-chevron-right.rotated[_ngcontent-%COMP%]{transform:rotate(90deg)}.calc-conditions-section[_ngcontent-%COMP%]   .conditions-toggle[_ngcontent-%COMP%]   .conditions-hint[_ngcontent-%COMP%]{font-weight:400;font-size:12px;color:#7b7b7b}.calc-conditions-section[_ngcontent-%COMP%]   .conditions-list[_ngcontent-%COMP%]{padding:8px 0 0 24px}.calc-conditions-section[_ngcontent-%COMP%]   .condition-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}.calc-conditions-section[_ngcontent-%COMP%]   .condition-row[_ngcontent-%COMP%]   .condition-prefix[_ngcontent-%COMP%]{font-size:12px;font-weight:700;color:#5f84fc;min-width:30px;text-align:right}.calc-conditions-section[_ngcontent-%COMP%]   .condition-row[_ngcontent-%COMP%]   .condition-value-input[_ngcontent-%COMP%]{width:150px}.calc-conditions-section[_ngcontent-%COMP%]   .condition-row[_ngcontent-%COMP%]   .condition-remove[_ngcontent-%COMP%]{color:#7b7b7b;border:none}.calc-conditions-section[_ngcontent-%COMP%]   .condition-row[_ngcontent-%COMP%]   .condition-remove[_ngcontent-%COMP%]:hover{color:#ef4444}
1.expression-editor[_ngcontent-%COMP%]{margin-bottom:12px}.expression-editor[_ngcontent-%COMP%]   .formula-label[_ngcontent-%COMP%]{display:block;font-size:11px;font-weight:700;letter-spacing:.5px;color:#7b7b7b;text-transform:uppercase;margin-bottom:6px}.expression-editor[_ngcontent-%COMP%]   .expression-textarea[_ngcontent-%COMP%]{width:100%;min-height:60px;padding:10px 12px;border:1px solid #dedede;border-radius:6px;background:#fafbfc;font-family:Courier New,Consolas,monospace;font-size:13px;line-height:1.5;color:#000;resize:vertical}.expression-editor[_ngcontent-%COMP%]   .expression-textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:#5f84fc;box-shadow:0 0 0 2px #5f84fc1a}.expression-editor[_ngcontent-%COMP%]   .expression-textarea[_ngcontent-%COMP%]::placeholder{color:#9ca3af;font-style:italic}.expression-editor[_ngcontent-%COMP%]   .expression-textarea.expression-error[_ngcontent-%COMP%]{border-color:#ef4444}.expression-editor[_ngcontent-%COMP%]   .expression-textarea.expression-error[_ngcontent-%COMP%]:focus{border-color:#ef4444;box-shadow:0 0 0 2px #ef44441a}.expression-editor[_ngcontent-%COMP%]   .expression-feedback[_ngcontent-%COMP%]{margin-top:4px;font-size:12px}.expression-editor[_ngcontent-%COMP%]   .expression-errors[_ngcontent-%COMP%]   .expression-error-msg[_ngcontent-%COMP%]{color:#ef4444;display:flex;align-items:center;gap:4px;padding:2px 0}.expression-editor[_ngcontent-%COMP%]   .expression-errors[_ngcontent-%COMP%]   .expression-error-msg[_ngcontent-%COMP%]   .mdi[_ngcontent-%COMP%]{font-size:14px}.expression-editor[_ngcontent-%COMP%]   .expression-valid[_ngcontent-%COMP%]{color:#16a34a;display:flex;align-items:flex-start;gap:4px}.expression-editor[_ngcontent-%COMP%]   .expression-valid[_ngcontent-%COMP%]   .mdi[_ngcontent-%COMP%]{font-size:14px;margin-top:1px}.expression-editor[_ngcontent-%COMP%]   .expression-valid[_ngcontent-%COMP%]   .expression-preview[_ngcontent-%COMP%]{font-family:Courier New,Consolas,monospace;font-size:11px;color:#7b7b7b;word-break:break-word}.formula-editor-columns[_ngcontent-%COMP%]{display:flex;gap:1px;border:1px solid #dedede;border-radius:6px;overflow:hidden;margin-bottom:12px;min-height:140px;resize:vertical}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;background:#fff}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column[_ngcontent-%COMP%]:not(:last-child){border-right:1px solid #dedede}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-header[_ngcontent-%COMP%]{padding:6px 10px;font-size:11px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:#7b7b7b;background:#f3f4f6;border-bottom:1px solid #dedede}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-list[_ngcontent-%COMP%]{flex:1;overflow-y:auto;max-height:280px;padding:4px 0}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]{padding:5px 10px;font-size:12px;cursor:pointer;-webkit-user-select:none;user-select:none;display:flex;align-items:center;justify-content:space-between;gap:6px}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-name[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[_ngcontent-%COMP%]{font-size:9px;font-weight:600;text-transform:uppercase;letter-spacing:.3px;padding:1px 5px;border-radius:3px;white-space:nowrap;background:#e5e7eb;color:#6b7280}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=number][_ngcontent-%COMP%], .formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=decimal][_ngcontent-%COMP%], .formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=currency][_ngcontent-%COMP%], .formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=int][_ngcontent-%COMP%]{background:#3b82f61f;color:#2563eb}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=text][_ngcontent-%COMP%], .formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=string][_ngcontent-%COMP%], .formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=textarea][_ngcontent-%COMP%]{background:#8b5cf61f;color:#7c3aed}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=date][_ngcontent-%COMP%], .formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=datetime][_ngcontent-%COMP%]{background:#f59e0b1f;color:#d97706}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=boolean][_ngcontent-%COMP%], .formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]   .field-type-badge[data-type=checkbox][_ngcontent-%COMP%]{background:#10b9811f;color:#059669}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]:hover{background:#5f84fc14;color:#5f84fc}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-item[_ngcontent-%COMP%]:hover   .field-type-badge[_ngcontent-%COMP%]{opacity:.8}.formula-editor-columns[_ngcontent-%COMP%]   .editor-column-empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;color:#9ca3af;padding:12px}.formula-editor-columns[_ngcontent-%COMP%]   .editor-operator-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:4px;padding:6px 10px}.formula-editor-columns[_ngcontent-%COMP%]   .op-btn[_ngcontent-%COMP%]{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:2px solid #dedede;border-radius:6px;background:#fff;font-size:16px;font-weight:700;color:#000;cursor:pointer;transition:all .15s}.formula-editor-columns[_ngcontent-%COMP%]   .op-btn[_ngcontent-%COMP%]:hover{border-color:#5f84fc;color:#5f84fc;background:#5f84fc0a}.formula-editor-columns[_ngcontent-%COMP%]   .op-btn-wide[_ngcontent-%COMP%]{width:auto;min-width:32px;padding:0 8px;font-size:13px}.formula-editor-columns[_ngcontent-%COMP%]   .op-group-label[_ngcontent-%COMP%]{font-size:10px;font-weight:600;text-transform:uppercase;color:#999;padding:6px 10px 2px;letter-spacing:.5px}.formula-editor-columns[_ngcontent-%COMP%]   .constant-input-group[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:6px 10px;border-top:1px solid #dedede}.fn-category[_ngcontent-%COMP%]   .fn-category-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;padding:5px 10px;font-size:12px;font-weight:600;cursor:pointer;color:#000}.fn-category[_ngcontent-%COMP%]   .fn-category-header[_ngcontent-%COMP%]:hover{background:#f3f4f6}.fn-category[_ngcontent-%COMP%]   .fn-category-header[_ngcontent-%COMP%]   .mdi[_ngcontent-%COMP%]{font-size:14px;color:#7b7b7b}.fn-category[_ngcontent-%COMP%]   .fn-category-items[_ngcontent-%COMP%]{padding-left:12px}.fn-category[_ngcontent-%COMP%]   .fn-item[_ngcontent-%COMP%]{font-size:11.5px;padding:3px 10px}.calc-else-section[_ngcontent-%COMP%]{margin-top:8px}.calc-else-section[_ngcontent-%COMP%]   .else-block[_ngcontent-%COMP%]{margin-top:8px;padding-top:12px;border-top:1px dashed #dedede}.calc-else-section[_ngcontent-%COMP%]   .else-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}.calc-else-section[_ngcontent-%COMP%]   .else-header[_ngcontent-%COMP%]   .else-remove[_ngcontent-%COMP%]{color:#7b7b7b;font-size:12px}.calc-else-section[_ngcontent-%COMP%]   .else-header[_ngcontent-%COMP%]   .else-remove[_ngcontent-%COMP%]:hover{color:#ef4444}"]})}}return i})();const Zt=()=>({width:"100%"}),Ni=()=>({standalone:!0}),My=()=>({label:"Count",value:"count"}),Fy=()=>({label:"Sum",value:"sum"}),Py=(i,a)=>[i,a],Ny=()=>[];function Gy(i,a){1&i&&e.nrm(0,"i",13)}function Ay(i,a){1&i&&e.nrm(0,"i",14)}function Ly(i,a){1&i&&(e.j41(0,"div",15),e.nrm(1,"kendo-loader",16),e.j41(2,"span"),e.EFF(3,"Loading..."),e.k0s()())}function By(i,a){1&i&&(e.j41(0,"small",43),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"AD_HOC_REPORTS.CALENDAR_BUILDER.NAME_REQUIRED")," "))}function jy(i,a){1&i&&(e.j41(0,"div",44),e.nrm(1,"i",45),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"AD_HOC_REPORTS.CALENDAR_BUILDER.NO_SOURCE")))}function Vy(i,a){if(1&i&&e.nrm(0,"span",55),2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.xc7("background-color",n.getStageColor(t.workflowTypeId,t.stageId))}}function $y(i,a){1&i&&(e.j41(0,"div",61),e.nrm(1,"kendo-loader",62),e.k0s())}function Uy(i,a){if(1&i&&(e.j41(0,"div",67),e.nrm(1,"span",55),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&i){const t=a.$implicit;e.R7$(),e.xc7("background-color",t.color),e.R7$(2),e.JRh(t.label)}}function Yy(i,a){if(1&i&&(e.j41(0,"div",67),e.nrm(1,"span",55),e.j41(2,"span"),e.EFF(3),e.k0s()()),2&i){const t=e.XpG().$implicit;e.R7$(),e.xc7("background-color",t.color),e.R7$(2),e.JRh(t.label)}}function Hy(i,a){1&i&&e.DNE(0,Yy,4,3,"div",68),2&i&&e.Y8G("ngIf",a.$implicit)}function Xy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",21)(1,"label"),e.EFF(2,"Stage Filter"),e.k0s(),e.j41(3,"p-dropdown",63),e.bIt("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).index,s=e.XpG(2);return e.Njj(s.onSourceStageChange(r,o))}),e.DNE(4,Uy,4,3,"ng-template",64)(5,Hy,1,1,"ng-template",65),e.k0s(),e.j41(6,"small",66),e.EFF(7,"Only show events in this stage. Color is derived from stage."),e.k0s()()}if(2&i){const t=e.XpG(2).$implicit,n=e.XpG(2);e.R7$(3),e.Aen(e.lJ4(6,Zt)),e.Y8G("options",n.getSourceStageOptions(t.workflowTypeId))("ngModel",t.stageId)("showClear",!0)("appendTo","body")}}function Wy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",77)(1,"span",78),e.EFF(2),e.k0s(),e.j41(3,"p-dropdown",79),e.bIt("ngModelChange",function(o){const r=e.eBV(t).$implicit,s=e.XpG(4).$implicit,c=e.XpG(2);return e.Njj(c.onSourceParameterMappingChange(s,r.id,o))}),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG(2).ngIf,o=e.XpG(2).$implicit,r=e.XpG(2);e.R7$(2),e.JRh(t.name),e.R7$(),e.Aen(e.lJ4(8,Zt)),e.Y8G("options",n.filterFieldOptions)("ngModel",r.getSourceParameterMappedField(o,t.id))("filter",!0)("showClear",!0)("appendTo","body")}}function zy(i,a){if(1&i&&(e.j41(0,"div",74)(1,"div",75),e.EFF(2,"Parameter Mappings"),e.k0s(),e.DNE(3,Wy,4,9,"div",76),e.k0s()),2&i){const t=e.XpG(5);e.R7$(3),e.Y8G("ngForOf",t.parameters)}}function Ky(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",21)(2,"label"),e.EFF(3,"Title Field *"),e.k0s(),e.j41(4,"p-dropdown",69),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit;return e.DH7(r.titleField,o)||(r.titleField=o),e.Njj(o)}),e.k0s()(),e.j41(5,"div",21)(6,"label"),e.EFF(7,"Start Date Field *"),e.k0s(),e.j41(8,"p-dropdown",70),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit;return e.DH7(r.startDateField,o)||(r.startDateField=o),e.Njj(o)}),e.k0s()(),e.j41(9,"div",21)(10,"label"),e.EFF(11,"End Date Field"),e.k0s(),e.j41(12,"p-dropdown",71),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit;
1return e.DH7(r.endDateField,o)||(r.endDateField=o),e.Njj(o)}),e.k0s()(),e.j41(13,"div",21)(14,"label"),e.EFF(15,"Date Range Field"),e.k0s(),e.j41(16,"p-dropdown",72),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2).$implicit;return e.DH7(r.dateField,o)||(r.dateField=o),e.Njj(o)}),e.k0s(),e.j41(17,"small",66),e.EFF(18,"Which date field the date range filter applies to"),e.k0s()(),e.DNE(19,zy,4,1,"div",73),e.bVm()}if(2&i){const t=a.ngIf,n=e.XpG(2).$implicit,o=e.XpG(2);e.R7$(4),e.Aen(e.lJ4(23,Zt)),e.Y8G("options",t.allFields),e.R50("ngModel",n.titleField),e.Y8G("filter",!0)("appendTo","body"),e.R7$(4),e.Aen(e.lJ4(24,Zt)),e.Y8G("options",t.dateFields),e.R50("ngModel",n.startDateField),e.Y8G("appendTo","body"),e.R7$(4),e.Aen(e.lJ4(25,Zt)),e.Y8G("options",t.dateFields),e.R50("ngModel",n.endDateField),e.Y8G("showClear",!0)("appendTo","body"),e.R7$(4),e.Aen(e.lJ4(26,Zt)),e.Y8G("options",t.dateFields),e.R50("ngModel",n.dateField),e.Y8G("appendTo","body"),e.R7$(3),e.Y8G("ngIf",o.parameters.length>0)}}function Jy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",56)(1,"div",21)(2,"label"),e.EFF(3,"Element *"),e.k0s(),e.j41(4,"p-dropdown",57),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG().$implicit;return e.DH7(r.workflowTypeId,o)||(r.workflowTypeId=o),e.Njj(o)}),e.bIt("onChange",function(){e.eBV(t);const o=e.XpG().index,r=e.XpG(2);return e.Njj(r.onSourceWorkflowChange(o))}),e.k0s()(),e.DNE(5,$y,2,0,"div",58)(6,Xy,8,7,"div",59)(7,Ky,20,27,"ng-container",60),e.k0s()}if(2&i){const t=e.XpG().$implicit,n=e.XpG(2);e.R7$(4),e.Aen(e.lJ4(9,Zt)),e.Y8G("options",n.workflowTypes),e.R50("ngModel",t.workflowTypeId),e.Y8G("filter",!0)("appendTo","body"),e.R7$(),e.Y8G("ngIf",n.sourceFieldsLoading.get(t.id)),e.R7$(),e.Y8G("ngIf",n.getSourceStages(t.workflowTypeId).length>0),e.R7$(),e.Y8G("ngIf",n.getSourceFieldOptions(t.workflowTypeId))}}function qy(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",46)(1,"div",47),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2);return e.Njj(r.toggleSourceExpanded(o.id))}),e.j41(2,"div",48),e.nrm(3,"i",49),e.DNE(4,Vy,1,2,"span",50),e.j41(5,"span",51),e.EFF(6),e.k0s()(),e.j41(7,"button",52),e.bIt("click",function(o){const r=e.eBV(t).index;return e.XpG(2).onRemoveSource(r),e.Njj(o.stopPropagation())}),e.nrm(8,"i",53),e.k0s()(),e.DNE(9,Jy,8,10,"div",54),e.k0s()}if(2&i){const t=a.$implicit,n=a.index,o=e.XpG(2);e.AVh("expanded",o.isSourceExpanded(t.id)),e.R7$(3),e.AVh("mdi-chevron-right",!o.isSourceExpanded(t.id))("mdi-chevron-down",o.isSourceExpanded(t.id)),e.R7$(),e.Y8G("ngIf",t.stageId&&o.getSourceStages(t.workflowTypeId).length),e.R7$(2),e.JRh(o.getSourceLabel(t,n)),e.R7$(3),e.Y8G("ngIf",o.isSourceExpanded(t.id))}}function Qy(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-dropdown",84),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.predefinedDateRange,o)||(r.predefinedDateRange=o),e.Njj(o)}),e.k0s()}if(2&i){const t=e.XpG(3);e.Y8G("options",t.predefinedDateOptions),e.R50("ngModel",t.predefinedDateRange),e.Y8G("ngModelOptions",e.lJ4(3,Ni))}}function Zy(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",80)(1,"div",21)(2,"div",81)(3,"p-checkbox",82),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.usePredefinedDate,o)||(r.usePredefinedDate=o),e.Njj(o)}),e.k0s()(),e.DNE(4,Qy,1,4,"p-dropdown",83),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(3),e.R50("ngModel",t.usePredefinedDate),e.Y8G("ngModelOptions",e.lJ4(4,Ni))("binary",!0),e.R7$(),e.Y8G("ngIf",t.usePredefinedDate)}}function ew(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",85)(1,"div",21)(2,"label"),e.EFF(3,"Default View"),e.k0s(),e.j41(4,"p-dropdown",86),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.defaultView,o)||(r.defaultView=o),e.Njj(o)}),e.k0s()(),e.j41(5,"small",66),e.EFF(6,"Event colors are determined by workflow stage colors."),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(4),e.Aen(e.lJ4(4,Zt)),e.Y8G("options",t.viewOptions),e.R50("ngModel",t.defaultView)}}function tw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",21)(1,"label"),e.EFF(2,"Numeric Field"),e.k0s(),e.j41(3,"p-dropdown",91),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.summaryField,o)||(r.summaryField=o),e.Njj(o)}),e.k0s()()}if(2&i){const t=e.XpG(4);e.R7$(3),e.Aen(e.lJ4(6,Zt)),e.Y8G("options",t.getAllNumericFields()),e.R50("ngModel",t.summaryField),e.Y8G("ngModelOptions",e.lJ4(7,Ni))("filter",!0)}}function nw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"div",21)(2,"label"),e.EFF(3,"Summary Type"),e.k0s(),e.j41(4,"p-dropdown",89),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.summaryType,o)||(r.summaryType=o),e.Njj(o)}),e.k0s()(),e.DNE(5,tw,4,8,"div",59),e.j41(6,"div",21)(7,"label"),e.EFF(8,"Label Prefix"),e.k0s(),e.j41(9,"input",90),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(3);return e.DH7(r.summaryLabel,o)||(r.summaryLabel=o),e.Njj(o)}),e.k0s(),e.j41(10,"small",66),e.EFF(11,"Optional prefix shown before the value"),e.k0s()()()}if(2&i){const t=e.XpG(3);e.R7$(4),e.Aen(e.lJ4(8,Zt)),e.Y8G("options",e.l_i(11,Py,e.lJ4(9,My),e.lJ4(10,Fy))),e.R50("ngModel",t.summaryType),e.Y8G("ngModelOptions",e.lJ4(14,Ni)),e.R7$(),e.Y8G("ngIf","sum"===t.summaryType),e.R7$(4),e.R50("ngModel",t.summaryLabel),e.Y8G("ngModelOptions",e.lJ4(15,Ni))}}function iw(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",87)(1,"div",21)(2,"p-checkbox",88),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.showDailySummary,o)||(r.showDailySummary=o),e.Njj(o)}),e.k0s()(),e.DNE(3,nw,12,16,"div",60),e.k0s()}if(2&i){const t=e.XpG(2);e.R7$(2),e.R50("ngModel",t.showDailySummary),e.Y8G("ngModelOptions",e.lJ4(4,Ni))("binary",!0),e.R7$(),e.Y8G("ngIf",t.showDailySummary)}}function ow(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",94)(1,"div",95)(2,"div",96)(3,"span",97),e.EFF(4),e.k0s(),e.j41(5,"span",98),e.EFF(6),e.k0s()(),e.j41(7,"div",99)(8,"button",100),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onEditParameter(o))}),e.nrm(9,"i",101),e.k0s(),e.j41(10,"button",102),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onDeleteParameter(o))}),e.nrm(11,"i",103),e.k0s()()()()}if(2&i){const t=a.$implicit;e.R7$(4),e.JRh(t.name),e.R7$(2),e.JRh(t.parameterType)}}function rw(i,a){if(1&i&&(e.j41(0,"div",92),e.DNE(1,ow,12,2,"div",93),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.parameters)}}function aw(i,a){1&i&&(e.j41(0,"div",104)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.JRh(e.bMT(3,1,"AD_HOC_REPORTS.CALENDAR_BUILDER.NO_PARAMETERS")))}function sw(i,a){1&i&&(e.j41(0,"div",105),e.nrm(1,"i",106),e.j41(2,"h4"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"AD_HOC_REPORTS.CALENDAR_BUILDER.EMPTY_MAIN")),e.R7$(3),e.JRh(e.bMT(7,4,"AD_HOC_REPORTS.CALENDAR_BUILDER.EMPTY_MAIN_HINT")))}function lw(i,a){1&i&&(e.j41(0,"div",105),e.nrm(1,"i",107),e.j41(2,"h4"),e.EFF(3,"Configure field mapping"),e.k0s(),e.j41(4,"p"),e.EFF(5,"Select elements, title fields, and start date fields for each source"),e.k0s()())}function dw(i,a){if(1&i&&(e.j41(0,"div",108),e.nrm(1,"cad-calendar-report-widget",109),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("events",e.lJ4(3,Ny))("loading",!1)("defaultView",t.defaultView)}}function cw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",17)(1,"div",18)(2,"p-card",19),e.nI1(3,"translate"),e.j41(4,"form",20)(5,"div",21)(6,"label",22),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.nrm(9,"input",23),e.nI1(10,"translate"),e.DNE(11,By,3,3,"small",24),e.k0s(),e.j41(12,"div",21)(13,"label",25),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.nrm(16,"textarea",26),e.nI1(17,"translate"),e.k0s()()(),e.j41(18,"p-card",19),e.nI1(19,"translate"),e.DNE(20,jy,5,3,"div",27),e.j41(21,"div",28),e.DNE(22,qy,10,9,"div",29),e.k0s(),e.j41(23,"button",30),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onAddSource())}),e.nrm(24,"i",31),e.EFF(25),e.nI1(26,"translate"),e.k0s()(),e.DNE(27,Zy,5,5,"p-card",32)(28,ew,7,5,"p-card",33)(29,iw,4,5,"p-card",34),e.j41(30,"p-card",35),e.nI1(31,"translate"),e.DNE(32,rw,2,1,"div",36)(33,aw,4,3,"div",37),e.j41(34,"button",38),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onAddParameter())}),e.nrm(35,"i",31),e.EFF(36),e.nI1(37,"translate"),e.k0s()()(),e.j41(38,"div",39)(39,"div",40)(40,"h3"),e.EFF(41,"Calendar Preview"),e.k0s()(),e.DNE(42,sw,8,6,"div",41)(43,lw,6,0,"div",41)(44,dw,2,4,"div",42),e.k0s()()}if(2&i){let t,n;const o=e.XpG();e.R7$(2),e.Y8G("header",e.bMT(3,23,"AD_HOC_REPORTS.CALENDAR_BUILDER.SETTINGS_TITLE")),e.R7$(2),e.Y8G("formGroup",o.reportForm),e.R7$(3),e.SpI("",e.bMT(8,25,"AD_HOC_REPORTS.CALENDAR_BUILDER.NAME_LABEL")," *"),e.R7$(2),e.AVh("ng-invalid",(null==(t=o.reportForm.get("name"))?null:t.invali
1d)&&(null==(t=o.reportForm.get("name"))?null:t.touched)),e.FS9("placeholder",e.bMT(10,27,"AD_HOC_REPORTS.CALENDAR_BUILDER.NAME_PLACEHOLDER")),e.R7$(2),e.Y8G("ngIf",(null==(n=o.reportForm.get("name"))||null==n.errors?null:n.errors.required)&&(null==(n=o.reportForm.get("name"))?null:n.touched)),e.R7$(3),e.JRh(e.bMT(15,29,"AD_HOC_REPORTS.CALENDAR_BUILDER.DESCRIPTION_LABEL")),e.R7$(2),e.FS9("placeholder",e.bMT(17,31,"AD_HOC_REPORTS.CALENDAR_BUILDER.DESCRIPTION_PLACEHOLDER")),e.R7$(2),e.Y8G("header",e.bMT(19,33,"AD_HOC_REPORTS.CALENDAR_BUILDER.SOURCES")),e.R7$(2),e.Y8G("ngIf",0===o.sources.length),e.R7$(2),e.Y8G("ngForOf",o.sources),e.R7$(3),e.SpI(" ",e.bMT(26,35,"AD_HOC_REPORTS.CALENDAR_BUILDER.ADD_SOURCE")," "),e.R7$(2),e.Y8G("ngIf",o.sources.length>0),e.R7$(),e.Y8G("ngIf",o.sources.length>0),e.R7$(),e.Y8G("ngIf",o.sources.length>0),e.R7$(),e.Y8G("header",e.bMT(31,37,"AD_HOC_REPORTS.CALENDAR_BUILDER.PARAMETERS")),e.R7$(2),e.Y8G("ngIf",o.parameters.length),e.R7$(),e.Y8G("ngIf",!o.parameters.length),e.R7$(3),e.SpI(" ",e.bMT(37,39,"AD_HOC_REPORTS.CALENDAR_BUILDER.ADD_PARAMETER")," "),e.R7$(6),e.Y8G("ngIf",0===o.sources.length),e.R7$(),e.Y8G("ngIf",o.sources.length>0&&!o.hasConfiguredSources),e.R7$(),e.Y8G("ngIf",o.hasConfiguredSources)}}function pw(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-parameter-configurator",110),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onParameterSaved(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onParameterDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("parameter",t.editingParameter)("visible",t.showParameterDialog)("workflowTypes",t.workflowTypes)("loadFieldMetadataFn",t.loadFieldMetadataCallback)}}let Xu=(()=>{class i{constructor(t,n,o,r,s){this._router=t,this._route=n,this._fb=o,this._apiService=r,this._messagingService=s,this._destroyed$=new ue.B7,this.workflowTypes=[],this.fieldMetadataCache=new Map,this.stagesCache=new Map,this.fieldOptionsCache=new Map,this.loading=!1,this.saving=!1,this.isEditMode=!1,this.reportId=null,this.report=null,this.sources=[],this.sourceExpanded=new Map,this.sourceFieldsLoading=new Map,this.defaultView="month",this.showDailySummary=!1,this.summaryType="count",this.summaryField="",this.summaryLabel="",this.usePredefinedDate=!1,this.predefinedDateRange=null,this._savedEndpointParams={},this.predefinedDateOptions=[{label:"Current Week",value:"currentWeek"},{label:"Current Month",value:"currentMonth"},{label:"Current Quarter",value:"currentQuarter"},{label:"Current Year",value:"currentYear"}],this.viewOptions=[{label:"Month",value:"month"},{label:"Week",value:"week"},{label:"Day",value:"day"},{label:"Agenda",value:"agenda"}],this.parameters=[],this.showParameterDialog=!1,this.editingParameterIndex=-1,this.editingParameter=null,this.loadFieldMetadataCallback=c=>{const u=this.fieldMetadataCache.get(c);return u?(0,le.of)(u):this._apiService.getFieldMetadata(c).pipe((0,Te.M)(g=>{this.fieldMetadataCache.set(c,g)}))},this.initForm()}ngOnInit(){this.reportId=this._route.snapshot.params.reportId,this.isEditMode=!!this.reportId,this.loadInitialData()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}initForm(){this.reportForm=this._fb.group({name:["",[R.k0.required,R.k0.maxLength(200)]],description:["",[R.k0.maxLength(1e3)]]})}loadInitialData(){this.loading=!0;const t={workflowTypes:this._apiService.getWorkflowTypes().pipe((0,ye.W)(()=>(0,le.of)([])))};this.isEditMode&&this.reportId&&(t.report=this._apiService.getReportById(this.reportId).pipe((0,ye.W)(()=>(0,le.of)(null)))),(0,vt.p)(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:n=>{this.workflowTypes=n.workflowTypes||[],this.isEditMode&&n.report&&(this.report=n.report,this.populateFromReport(n.report))},error:()=>{this._messagingService.error("Failed to load data","Error")}})}populateFromReport(t){if(this.reportForm.patchValue({name:t.name,description:t.description}),t.dashboardConfiguration)try{const n=JSON.parse(t.dashboardConfiguration);if(this.defaultView=n.defaultView||"month",this.parameters=n.parameters||[],n.summaryType&&(this.showDailySummary=!0,this.summaryType=n.summaryType,this.summaryField=n.summaryField||"",this.summaryLabel=n.summaryLabel||""),n.sources?.length){this.sources=n.sources.map(o=>({...o}));for(const o of this.sources)this.sourceExpanded.set(o.id,!0),this.loadSourceData(o)}else if(n.titleField&&t.workflowTypeId){const o={id:this.generateId(),workflowTypeId:t.workflowTypeId,workflowName:this.workflowTypes.find(r=>r.workflowTypeId===t.workflowTypeId)?.name,titleField:n.titleField,startDateField:n.startDateField,endDateField:n.endDateField,dateField:"createdDate",parameterMappings:[]};this.sources=[o],this.sourceExpanded.set(o.id,!0),this.loadSourceData(o)}}catch(n){console.error("Error parsing calendar configuration:",n)}if(t.endpointParameters)try{const n="string"==typeof t.endpointParameters?JSON.parse(t.endpointParameters):t.endpointParameters;this._savedEndpointParams=n,n.standardDateRange&&(this.usePredefinedDate=!0,this.predefinedDateRange=n.standardDateRange),n.dateField&&1===this.sources.length&&(this.sources[0].dateField=n.dateField)}catch{}}onAddSource(){const t={id:this.generateId(),workflowTypeId:0,titleField:"",startDateField:"",dateField:"createdDate",parameterMappings:[]};this.sources=[...this.sources,t],this.sourceExpanded.set(t.id,!0)}onRemoveSource(t){const n=this.sources[t];this.sourceExpanded.delete(n.id),this.sourceFieldsLoading.delete(n.id),this.sources=this.sources.filter((o,r)=>r!==t)}toggleSourceExpanded(t){this.sourceExpanded.set(t,!this.sourceExpanded.get(t))}isSourceExpanded(t){return this.sourceExpanded.get(t)??!1}onSourceWorkflowChange(t){const n=this.sources[t];if(!n.workflowTypeId)return;const o=this.workflowTypes.find(r=>r.workflowTypeId===n.workflowTypeId);n.workflowName=o?.name,n.titleField="",n.startDateField="",n.endDateField=void 0,n.stageId=void 0,n.stageName=void 0,this.loadSourceData(n)}onSourceStageChange(t,n){const o=this.sources[t];if(n){const s=(this.stagesCache.get(o.workflowTypeId)||[]).find(c=>c.id===n);o.stageId=n,o.stageName=s?.name}else o.stageId=void 0,o.stageName=void 0}loadSourceData(t){if(!t.workflowTypeId)return;
1this.sourceFieldsLoading.set(t.id,!0);const n={};this.stagesCache.has(t.workflowTypeId)||(n.element=this._apiService.getElementDetail(t.workflowTypeId).pipe((0,ye.W)(()=>(0,le.of)(null)))),this.fieldMetadataCache.has(t.workflowTypeId)||(n.metadata=this._apiService.getFieldMetadata(t.workflowTypeId).pipe((0,ye.W)(()=>(0,le.of)(null)))),0!==Object.keys(n).length?(0,vt.p)(n).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.sourceFieldsLoading.set(t.id,!1))).subscribe({next:o=>{o.element&&this.stagesCache.set(t.workflowTypeId,o.element.stages||[]),o.metadata&&(this.fieldMetadataCache.set(t.workflowTypeId,o.metadata),this.buildFieldOptionsForWorkflow(t.workflowTypeId,o.metadata))},error:()=>{this._messagingService.error("Failed to load source data","Error")}}):this.sourceFieldsLoading.set(t.id,!1)}buildFieldOptionsForWorkflow(t,n){const o=[...n.commonFields||[],...n.elementFields||[]],r=[{label:"Created Date",value:"createdDate"},{label:"Modified Date",value:"modifiedDate"},...o.filter(g=>"datetime"===g.type&&"createdDate"!==g.name&&"modifiedDate"!==g.name).map(g=>({label:g.displayName,value:g.name}))],s=["string","text","lookup","dropdown","status"],c=o.filter(g=>s.includes(g.type?.toLowerCase()||"")).map(g=>({label:g.displayName,value:g.name})),u=o.filter(g=>"number"===g.type);this.fieldOptionsCache.set(t,{allFields:o,dateFields:r,filterFieldOptions:c,numericFields:u})}getSourceFieldOptions(t){return this.fieldOptionsCache.get(t)}getSourceStages(t){return this.stagesCache.get(t)||[]}getSourceStageOptions(t){return this.getSourceStages(t).map(o=>({label:o.name||"Unnamed",value:o.id,color:o.color||"#999"}))}getStageColor(t,n){return(this.stagesCache.get(t)||[]).find(r=>r.id===n)?.color||"#999"}getAllNumericFields(){const t=new Set,n=[];for(const o of this.sources){const r=this.fieldOptionsCache.get(o.workflowTypeId);if(r)for(const s of r.numericFields)t.has(s.name)||(t.add(s.name),n.push(s))}return n}getSourceParameterMappedField(t,n){return(t.parameterMappings||[]).find(r=>r.parameterId===n)?.widgetFieldName||""}onSourceParameterMappingChange(t,n,o){t.parameterMappings||(t.parameterMappings=[]);const r=t.parameterMappings.find(s=>s.parameterId===n);r?r.widgetFieldName=o:t.parameterMappings.push({parameterId:n,widgetFieldName:o})}onAddParameter(){this.editingParameter={id:"param-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),name:"",workflowTypeId:0,fieldName:"",parameterType:"dropdown",required:!1},this.editingParameterIndex=-1,this.showParameterDialog=!0}onEditParameter(t){this.editingParameter={...this.parameters[t]},this.editingParameterIndex=t,this.showParameterDialog=!0}onDeleteParameter(t){const n=this.parameters[t].id;this.parameters.splice(t,1);for(const o of this.sources)o.parameterMappings&&(o.parameterMappings=o.parameterMappings.filter(r=>r.parameterId!==n))}onParameterSaved(t){this.editingParameterIndex>=0?this.parameters[this.editingParameterIndex]=t:this.parameters.push(t),this.showParameterDialog=!1,this.editingParameter=null}onParameterDialogClosed(){this.showParameterDialog=!1,this.editingParameter=null,this.editingParameterIndex=-1}get hasConfiguredSources(){return this.sources.some(t=>t.workflowTypeId&&t.titleField&&t.startDateField)}getSourceLabel(t,n){return t.workflowName?`${t.workflowName}${t.stageName?` \u2014 ${t.stageName}`:""}`:`Source ${n+1}`}generateId(){return"src-"+Date.now()+"-"+Math.random().toString(36).substr(2,9)}
1onSave(){if(this.reportForm.invalid)return this.reportForm.markAllAsTouched(),void this._messagingService.warning("Please fill in all required fields","Validation");if(0===this.sources.length)return void this._messagingService.warning("Please add at least one calendar source","Validation");for(let u=0;u<this.sources.length;u++){const g=this.sources[u];if(!g.workflowTypeId)return void this._messagingService.warning(`Source ${u+1}: Please select an element`,"Validation");if(!g.titleField)return void this._messagingService.warning(`Source ${u+1}: Please select a title field`,"Validation");if(!g.startDateField)return void this._messagingService.warning(`Source ${u+1}: Please select a start date field`,"Validation")}this.saving=!0;const t=this.reportForm.value,n={sources:this.sources.map(u=>({id:u.id,workflowTypeId:u.workflowTypeId,workflowName:u.workflowName,titleField:u.titleField,startDateField:u.startDateField,endDateField:u.endDateField||void 0,stageId:u.stageId||void 0,stageName:u.stageName||void 0,dateField:u.dateField||"createdDate",parameterMappings:u.parameterMappings?.length?u.parameterMappings:void 0})),defaultView:this.defaultView,parameters:this.parameters.length>0?this.parameters:void 0,summaryType:this.showDailySummary?this.summaryType:void 0,summaryField:this.showDailySummary&&"sum"===this.summaryType?this.summaryField:void 0,summaryLabel:this.showDailySummary&&this.summaryLabel?this.summaryLabel:void 0},o=JSON.stringify(n),r={};this.usePredefinedDate&&this.predefinedDateRange?r.standardDateRange=this.predefinedDateRange:(this._savedEndpointParams.dateFrom&&(r.dateFrom=this._savedEndpointParams.dateFrom),this._savedEndpointParams.dateTo&&(r.dateTo=this._savedEndpointParams.dateTo)),this._savedEndpointParams.parameterValues&&(r.parameterValues=this._savedEndpointParams.parameterValues);const s=JSON.stringify(r),c=this.sources[0]?.workflowTypeId||void 0;this.isEditMode&&this.reportId?this._apiService.updateReport(this.reportId,{name:t.name,description:t.description,workflowTypeId:c,endpointParameters:s,dashboardConfiguration:o}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:g=>{this._messagingService.success("Calendar updated successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",g.adHocReportId])},error:()=>{this._messagingService.error("Failed to update Calendar","Error")}}):this._apiService.createReport({name:t.name,description:t.description,entityType:w.dX.Workflow,visualizationType:w.vi.Calendar,workflowTypeId:c,endpointParameters:s,dashboardConfiguration:o}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:g=>{this._messagingService.success("Calendar created successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",g.adHocReportId])},error:()=>{this._messagingService.error("Failed to create Calendar","Error")}})}onCancel(){this._router.navigate(["/private/ad-hoc-reports"])}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(R.ok),e.rXU(Ye.F),e.rXU(q.Ui))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-calendar-builder"]],decls:24,vars:26,consts:[[1,"calendar-builder-container"],[1,"builder-header"],[1,"header-title"],["type","button",1,"button","button_clear","button_colorAlt",3,"click","title"],[1,"mdi","mdi-arrow-left"],[1,"header-actions"],["type","button",1,"button","button_outline",3,"click","title"],["type","button",1,"button","button_colorSuccess",3,"click","title","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-content-save buttonIcon_right",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","builder-content",4,"ngIf"],[3,"parameter","visible","workflowTypes","loadFieldMetadataFn","saved","closed",4,"ngIf"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-content-save","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[1,"builder-content"],[1,"settings-sidebar"],[3,"header"],[3,"formGroup"],[1,"form-field"],["for","name"],["id","name","type","text","pInputText","","formControlName","name",3,"placeholder"],["class","p-error",4,"ngIf"],["for","description"],["id","description","pInputTextarea","","formControlName","description","rows","2",3,"placeholder"],["class","no-sources",4,"ngIf"],[1,"source-list"],["class","source-card",3,"expanded",4,"ngFor","ngForOf"],["type","button",1,"button","button_outline","button_sm","add-source-btn",3,"click"],[1,"mdi","mdi-plus"],["header","Date Range",4,"ngIf"],["header","Dis
1play Options",4,"ngIf"],["header","Daily Summary",4,"ngIf"],[1,"parameters-card",3,"header"],["class","parameter-list",4,"ngIf"],["class","no-parameters",4,"ngIf"],["type","button",1,"button","button_outline","button_sm","add-parameter-btn",3,"click"],[1,"main-content"],[1,"content-header"],["class","empty-canvas",4,"ngIf"],["class","calendar-preview",4,"ngIf"],[1,"p-error"],[1,"no-sources"],[1,"mdi","mdi-calendar-plus"],[1,"source-card"],[1,"source-header",3,"click"],[1,"source-header-left"],[1,"mdi"],["class","stage-color-dot",3,"background-color",4,"ngIf"],[1,"source-title"],["type","button","title","Remove Source",1,"button","button_round","button_sm","remove-source-btn",3,"click"],[1,"mdi","mdi-close"],["class","source-body",4,"ngIf"],[1,"stage-color-dot"],[1,"source-body"],["optionLabel","name","optionValue","workflowTypeId","filterBy","name","placeholder","Select element...",3,"ngModelChange","onChange","options","ngModel","filter","appendTo"],["class","source-loading",4,"ngIf"],["class","form-field",4,"ngIf"],[4,"ngIf"],[1,"source-loading"],["type","pulsing","size","small"],["optionLabel","label","optionValue","value","placeholder","All stages (use current stage color)",3,"ngModelChange","options","ngModel","showClear","appendTo"],["pTemplate","item"],["pTemplate","selectedItem"],[1,"field-hint"],[1,"stage-option"],["class","stage-option",4,"ngIf"],["optionLabel","displayName","optionValue","name","filterBy","displayName","placeholder","Select title field...",3,"ngModelChange","options","ngModel","filter","appendTo"],["optionLabel","label","optionValue","value","placeholder","Select start date...",3,"ngModelChange","options","ngModel","appendTo"],["optionLabel","label","optionValue","value","placeholder","None (all-day events)",3,"ngModelChange","options","ngModel","showClear","appendTo"],["optionLabel","label","optionValue","value",3,"ngModelChange","options","ngModel","appendTo"],["class","source-param-section",4,"ngIf"],[1,"source-param-section"],[1,"source-param-header"],["class","source-param-row",4,"ngFor","ngForOf"],[1,"source-param-row"],[1,"source-param-name"],["optionLabel","label","optionValue","value","placeholder","Map to field...",3,"ngModelChange","options","ngModel","filter","showClear","appendTo"],["header","Date Range"],[1,"predefined-toggle"],["label","Set Predefined Date",3,"ngModelChange","ngModel","ngModelOptions","binary"],["optionLabel","label","optionValue","value","placeholder","Select date range...",3,"options","ngModel","ngModelOptions","ngModelChange",4,"ngIf"],["optionLabel","label","optionValue","value","placeholder","Select date range...",3,"ngModelChange","options","ngModel","ngModelOptions"],["header","Display Options"],["optionLabel","label","optionValue","value",3,"ngModelChange","options","ngModel"],["header","Daily Summary"],["label","Show daily summary",3,"ngModelChange","ngModel","ngModelOptions","binary"],["optionLabel","label","optionValue","value",3,"ngModelChange","options","ngModel","ngModelOptions"],["type","text","pInputText","","placeholder",'e.g. "$" or "Total: "',3,"ngModelChange","ngModel","ngModelOptions"],["optionLabel","displayName","optionValue","name","filterBy","displayName","placeholder","Select numeric field...",3,"ngModelChange","options","ngModel","ngModelOptions","filter"],[1,"parameter-list"],["class","parameter-item-wrapper",4,"ngFor","ngForOf"],[1,"parameter-item-wrapper"],[1,"parameter-item"],[1,"parameter-info"],[1,"parameter-name"],[1,"parameter-type-badge"],[1,"parameter-actions"],["type","button","title","Edit Parameter",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil"],["type","button","title","Delete Parameter",1,"button","button_round","delete-btn",3,"click"],[1,"mdi","mdi-trash-can"],[1,"no-parameters"],[1,"empty-canvas"],[1,"mdi","mdi-calendar-blank"],[1,"mdi","mdi-calendar-edit"],[1,"calendar-preview"],[3,"events","loading","defaultView"],[3,"saved","closed","parameter","visible","workflowTypes","loadFieldMetadataFn"]],template:function(n,o){1&n&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),e.nI1(4,"translate"),e.bIt("click",function(){return o.onCancel()}),e.nrm(5,"i",4),e.k0s(),e.j41(6,"h2"),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"div",5)(11,"button",6),e.nI1(12,"translate"),e.bIt("click",function(){return o.onCancel()}),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"button",7),e.nI1(16,"translate"),e.bIt("click",function(){return o.onSave()}),e.DNE(17,Gy,1,0,"i",8)(18,Ay,1,0,"i",9),e.EFF(19),e.nI1(20,"translate"),e.k0s()()(),e.DNE(21,Ly,4,0,"div",10)(22,cw,45,41,"div",11),e.k0s(),e.DNE(23,pw,1,4,"cad-parameter-configurator",12)),2&n&&(e.R7$(3),e.Y8G("title",e.bMT(4,12,"GENERAL.GO_BACK")),e.R7$(4),e.SpI(" ",o.isEditMode?e.bMT(8,14,"AD_HOC_REPORTS.CALENDAR_BUILDER.EDIT_TITLE"):e.bMT(9,16,"AD_HOC_REPORTS.CALENDAR_BUILDER.NEW_TITLE")," "),e.R7$(4),e.Y8G("title",e.bMT(12,18,"GENERAL.CANCEL")),e.R7$(2),e.SpI(" ",e.bMT(14,20,"GENERAL.CANCEL")," "),e.R7$(2),e.Y8G("title",e.bMT(16,22,"AD_HOC_REPORTS.CALENDAR_BUILDER.SAVE"))("disabled",o.saving),e.R7$(2),e.Y8G("ngIf",o.saving),e.R7$(),e.Y8G("ngIf",!o.saving),e.R7$(),e.SpI(" ",e.bMT(20,24,"AD_HOC_REPORTS.CALENDAR_BUILDER.SAVE")," "),e.R7$(2),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading),e.R7$(),e.Y8G("ngIf",o.showParameterDialog&&o.editingParameter))},dependencies:[M.Sq,M.bT,R.qT,R.me,R.BC,R.cb,R.vS,R.j4,R.JD,ke.Ei,ut.Sc,Le.ms,_e.S,mt.Z,ee.C3,ze.VU,_n,Gn,Tu,nt.D9],styles:[".calendar-builder
1-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:#fafafa}.builder-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.5rem;background:#fff;border-bottom:1px solid #dedede}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:#000}.builder-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:300px;gap:1rem;color:#7b7b7b}.builder-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.settings-sidebar[_ngcontent-%COMP%]{width:360px;min-width:360px;padding:1rem;background:#fff;border-right:1px solid #dedede;overflow-y:auto;display:flex;flex-direction:column;gap:1rem}.settings-sidebar[_ngcontent-%COMP%]     .p-card .p-card-header{padding:.75rem 1rem;background:#fafafa;font-weight:600;font-size:.875rem;border-bottom:1px solid #dedede}.settings-sidebar[_ngcontent-%COMP%]     .p-card .p-card-body{padding:1rem}.form-field[_ngcontent-%COMP%]{margin-bottom:1rem}.form-field[_ngcontent-%COMP%]:last-child{margin-bottom:0}.form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;font-size:.875rem;color:#000}.form-field[_ngcontent-%COMP%]   input[type=text][_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]{width:100%}.form-field[_ngcontent-%COMP%]   .p-error[_ngcontent-%COMP%]{display:block;margin-top:.25rem}.field-hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.75rem;color:#7b7b7b}.no-sources[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:.5rem;padding:1.5rem 1rem;color:#7b7b7b;text-align:center}.no-sources[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1.5rem}.no-sources[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{font-size:.8125rem}.source-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.75rem}.source-card[_ngcontent-%COMP%]{border:1px solid #dedede;border-radius:6px;background:#fafafa}.source-card.expanded[_ngcontent-%COMP%]{border-color:#5f84fc}.source-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.5rem .75rem;cursor:pointer;-webkit-user-select:none;user-select:none}.source-header[_ngcontent-%COMP%]:hover{background:#f2f2f2}.source-header[_ngcontent-%COMP%]   .source-header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;flex:1;min-width:0}.source-header[_ngcontent-%COMP%]   .source-header-left[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:1rem;color:#7b7b7b}.source-header[_ngcontent-%COMP%]   .source-title[_ngcontent-%COMP%]{font-weight:500;font-size:.8125rem;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.source-header[_ngcontent-%COMP%]   .remove-source-btn[_ngcontent-%COMP%]{color:#0006;background:transparent;border:none;padding:2px 4px}.source-header[_ngcontent-%COMP%]   .remove-source-btn[_ngcontent-%COMP%]:hover{color:#e60400}.source-body[_ngcontent-%COMP%]{padding:.75rem;border-top:1px solid #dedede;background:#fff}.source-loading[_ngcontent-%COMP%]{display:flex;justify-content:center;padding:.75rem}.stage-color-dot[_ngcontent-%COMP%]{display:inline-block;width:10px;height:10px;border-radius:50%;flex-shrink:0}.stage-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.source-param-section[_ngcontent-%COMP%]{margin-top:.75rem;padding-top:.75rem;border-top:1px solid #dedede}.source-param-section[_ngcontent-%COMP%]   .source-param-header[_ngcontent-%COMP%]{font-size:.75rem;font-weight:700;color:#000;margin-bottom:.5rem;text-transform:uppercase;letter-spacing:.5px}.source-param-row[_ngcontent-%COMP%]{margin-bottom:.5rem}.source-param-row[_ngcontent-%COMP%]:last-child{margin-bottom:0}
1.source-param-row[_ngcontent-%COMP%]   .source-param-name[_ngcontent-%COMP%]{display:block;font-size:.75rem;font-weight:500;color:#7b7b7b;margin-bottom:.25rem}.add-source-btn[_ngcontent-%COMP%]{width:100%;justify-content:center;gap:.25rem}.predefined-toggle[_ngcontent-%COMP%]{margin-bottom:.5rem}.parameters-card[_ngcontent-%COMP%]     .p-card-body{padding:.75rem!important}.parameter-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.75rem}.parameter-item-wrapper[_ngcontent-%COMP%]{padding:.5rem .75rem;border-radius:6px;background:#fafafa}.parameter-item-wrapper[_ngcontent-%COMP%]:hover{background:#f2f2f2}.parameter-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-name[_ngcontent-%COMP%]{font-weight:500;font-size:.875rem;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-type-badge[_ngcontent-%COMP%]{font-size:.625rem;padding:.125rem .375rem;border-radius:10px;background:#5f84fc;color:#fff;text-transform:uppercase;font-weight:600;white-space:nowrap}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .button[_ngcontent-%COMP%]{color:#0009}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{background-color:transparent;border:none;color:#0009}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]:hover{background-color:#0000000a}.no-parameters[_ngcontent-%COMP%]{padding:.75rem;text-align:center;font-size:.8125rem;color:#7b7b7b;margin-bottom:.75rem}.add-parameter-btn[_ngcontent-%COMP%]{width:100%;justify-content:center;gap:.25rem}.main-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;padding:1rem;overflow:auto;background:#fafafa}.content-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.content-header[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600;color:#000}.empty-canvas[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#fff;border:2px dashed #dedede;border-radius:8px;padding:3rem}.empty-canvas[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:3rem;color:#7b7b7b;margin-bottom:1rem}.empty-canvas[_ngcontent-%COMP%]   h4[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1.125rem;font-weight:600;color:#000}.empty-canvas[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0;color:#7b7b7b}.calendar-preview[_ngcontent-%COMP%]{flex:1;background:#fff;border-radius:8px;overflow:hidden;min-height:500px}"]})}}return i})();function uw(i,a){1&i&&e.nrm(0,"i",14)}function _w(i,a){1&i&&e.nrm(0,"i",15)}function mw(i,a){1&i&&(e.j41(0,"div",16),e.nrm(1,"kendo-loader",17),e.j41(2,"span"),e.EFF(3,"Loading..."),e.k0s()())}function gw(i,a){1&i&&(e.j41(0,"small",41),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&i&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"AD_HOC_REPORTS.GANTT_BUILDER.NAME_REQUIRED")," "))}function hw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",44)(1,"div",45)(2,"span",46),e.EFF(3),e.k0s(),e.j41(4,"span",47),e.EFF(5),e.k0s()(),e.j41(6,"div",48)(7,"button",49),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onEditParameter(o))}),e.nrm(8,"i",50),e.k0s(),e.j41(9,"button",51),e.bIt("click",function(){const o=e.eBV(t).index,r=e.XpG(3);return e.Njj(r.onDeleteParameter(o))}),e.nrm(10,"i",52),e.k0s()()()}if(2&i){const t=a.$implicit;e.R7$(3),e.JRh(t.name),e.R7$(2),e.JRh(t.parameterType)}}function fw(i,a){if(1&i&&(e.j41(0,"div",42),e.DNE(1,hw,11,2,"div",43),e.k0s()),2&i){const t=e.XpG(2);e.R7$(),e.Y8G("ngForOf",t.parameters)}}function Cw(i,a){1&i&&(e.j41(0,"div",53)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&i&&(e.R7$(2),e.JRh(e.bMT(3,1,"AD_HOC_REPORTS.GANTT_BUILDER.NO_PARAMETERS")))}function vw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",55),e.nI1(5,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.selectedWorkflowTypeId,o)||(r.selectedWorkflowTypeId=o),e.Njj(o)}),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onElementChange(o.value))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,6,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_ELEMENT")),e.R7$(2),e.Y8G("options",t.workflowTypes),e.R50("ngModel",t.selectedWorkflowTypeId),e.Y8G("filter",!0)("placeholder",e.bMT(5,8,"AD_HOC_REPORTS.GANTT_BUILDER.ELEMENT_PLACEHOLDER"))("showClear",!0)}}function bw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",56),e.nI1(5,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.selectedDataSetId,o)||(r.selectedDataSetId=o),e.Njj(o)}),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(2);return e.Njj(r.onDataSetChange(o.value))}),e.k0s()()}if(2&i){const t=e.XpG(2);e.R7$(2),e.JRh(e.bMT(3,6,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATASET")),e.R7$(2),e.Y8G("options",t.dataSets),e.R50("ngModel",t.selectedDataSetId),e.Y8G("filter",!0)("placeholder",e.bMT(5,8,"AD_HOC_REPORTS.GANTT_BUILDER.DATASET_PLACEHOLDER"))("showClear",!0)}}function Tw(i,a){if(1&i){const t=e.RV6();e.j41(0,"p-card",28),e.nI1(1,"translate"),e.j41(2,"div",22)(3,"label"),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"p-dropdown",57),e.nI1(7,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.taskTitleField,o)||(r.taskTitleField=o),e.Njj(o)}),e.k0s(),e.j41(8,"small",58),e.EFF(9),e.nI1(10,"translate"),e.k0s()(),e.j41(11,"div",22)(12,"label"),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"p-dropdown",57),e.nI1(16,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.startDateField,o)||(r.startDateField=o),e.Njj(o)}),e.k0s()(),e.j41(17,"div",22)(18,"label"),e.EFF(19),e.nI1(20,"translate"),e.k0s(),e.j41(21,"p-dropdown",57),e.nI1(22,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);
1return e.DH7(r.endDateField,o)||(r.endDateField=o),e.Njj(o)}),e.k0s()(),e.j41(23,"div",22)(24,"label"),e.EFF(25),e.nI1(26,"translate"),e.j41(27,"span",59),e.EFF(28),e.nI1(29,"translate"),e.k0s()(),e.j41(30,"p-dropdown",57),e.nI1(31,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.percentCompleteField,o)||(r.percentCompleteField=o),e.Njj(o)}),e.k0s(),e.j41(32,"small",58),e.EFF(33),e.nI1(34,"translate"),e.k0s()()()}if(2&i){const t=e.XpG(2);e.Y8G("header",e.bMT(1,28,"AD_HOC_REPORTS.GANTT_BUILDER.FIELD_MAPPINGS")),e.R7$(4),e.SpI("",e.bMT(5,30,"AD_HOC_REPORTS.GANTT_BUILDER.TASK_TITLE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.allFieldOptions),e.R50("ngModel",t.taskTitleField),e.Y8G("filter",!0)("placeholder",e.bMT(7,32,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(3),e.JRh(e.bMT(10,34,"AD_HOC_REPORTS.GANTT_BUILDER.TASK_TITLE_HINT")),e.R7$(4),e.SpI("",e.bMT(14,36,"AD_HOC_REPORTS.GANTT_BUILDER.START_DATE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.dateFieldOptions),e.R50("ngModel",t.startDateField),e.Y8G("filter",!0)("placeholder",e.bMT(16,38,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATE_FIELD"))("showClear",!0),e.R7$(4),e.SpI("",e.bMT(20,40,"AD_HOC_REPORTS.GANTT_BUILDER.END_DATE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.dateFieldOptions),e.R50("ngModel",t.endDateField),e.Y8G("filter",!0)("placeholder",e.bMT(22,42,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATE_FIELD"))("showClear",!0),e.R7$(4),e.SpI(" ",e.bMT(26,44,"AD_HOC_REPORTS.GANTT_BUILDER.PERCENT_COMPLETE_FIELD")," "),e.R7$(3),e.JRh(e.bMT(29,46,"GENERAL.OPTIONAL")),e.R7$(2),e.Y8G("options",t.numberFieldOptions),e.R50("ngModel",t.percentCompleteField),e.Y8G("filter",!0)("placeholder",e.bMT(31,48,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(3),e.JRh(e.bMT(34,50,"AD_HOC_REPORTS.GANTT_BUILDER.PERCENT_COMPLETE_HINT"))}}function Ew(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",65),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(4);return e.Njj(o.onRemoveLevel2())}),e.nrm(2,"i",66),e.k0s()}2&i&&e.Y8G("title",e.bMT(1,1,"AD_HOC_REPORTS.GANTT_BUILDER.REMOVE_LEVEL"))}function Sw(i,a){if(1&i&&(e.j41(0,"div",63)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,Ew,3,3,"button",64),e.k0s()),2&i){const t=e.XpG(3);e.R7$(2),e.JRh(e.bMT(3,2,"AD_HOC_REPORTS.GANTT_BUILDER.LEVEL2_TITLE")),e.R7$(2),e.Y8G("ngIf",t.level2.enabled)}}function kw(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"button",67),e.bIt("click",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onAddLevel2())}),e.nrm(2,"i",32),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.bVm()}2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"AD_HOC_REPORTS.GANTT_BUILDER.ADD_CHILD_LEVEL")," "))}function Rw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",55),e.nI1(5,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level2.workflowTypeId,o)||(r.level2.workflowTypeId=o),e.Njj(o)}),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(4);return e.Njj(r.onLevel2ElementChange(o.value))}),e.k0s()()}if(2&i){const t=e.XpG(4);e.R7$(2),e.JRh(e.bMT(3,6,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_ELEMENT")),e.R7$(2),e.Y8G("options",t.workflowTypes),e.R50("ngModel",t.level2.workflowTypeId),e.Y8G("filter",!0)("placeholder",e.bMT(5,8,"AD_HOC_REPORTS.GANTT_BUILDER.ELEMENT_PLACEHOLDER"))("showClear",!0)}}function Iw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",56),e.nI1(5,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level2.dataSetId,o)||(r.level2.dataSetId=o),e.Njj(o)}),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(4);return e.Njj(r.onLevel2DataSetChange(o.value))}),e.k0s()()}if(2&i){const t=e.XpG(4);e.R7$(2),e.JRh(e.bMT(3,6,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATASET")),e.R7$(2),e.Y8G("options",t.dataSets),e.R50("ngModel",t.level2.dataSetId),e.Y8G("filter",!0)("placeholder",e.bMT(5,8,"AD_HOC_REPORTS.GANTT_BUILDER.DATASET_PLACEHOLDER"))("showClear",!0)}}function yw(i,a){1&i&&(e.j41(0,"div",68),e.nrm(1,"kendo-loader",69),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"AD_HOC_REPORTS.GANTT_BUILDER.LOADING_FIELDS")))}function ww(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",22)(2,"label"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p-dropdown",57),e.nI1(6,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level2.taskTitleField,o)||(r.level2.taskTitleField=o),e.Njj(o)}),e.k0s()(),e.j41(7,"div",22)(8,"label"),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.j41(11,"p-dropdown",57),e.nI1(12,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level2.startDateField,o)||(r.level2.startDateField=o),e.Njj(o)}),e.k0s()(),e.j41(13,"div",22)(14,"label"),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"p-dropdown",57),e.nI1(18,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level2.endDateField,o)||(r.level2.endDateField=o),e.Njj(o)}),e.k0s()(),e.j41(19,"div",22)(20,"label"),e.EFF(21),e.nI1(22,"translate"),e.j41(23,"span",59),e.EFF(24),e.nI1(25,"translate"),e.k0s()(),e.j41(26,"p-dropdown",57),e.nI1(27,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level2.percentCompleteField,o)||(r.level2.percentCompleteField=o),e.Njj(o)}),e.k0s()(),e.j41(28,"div",22)(29,"label"),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"p-dropdown",57),e.nI1(33,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level2.parentRelationField,o)||(r.level2.parentRelationField=o),e.Njj(o)}),e.k0s(),e.j41(34,"small",58),e.EFF(35),e.nI1(36,"translate"),e.k0s()(),e.bVm()}if(2&i){const t=e.XpG(4);e.R7$(3),e.SpI("",e.bMT(4,32,"AD_HOC_REPORTS.GANTT_BUILDER.TASK_TITLE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level2.allFieldOptions),e.R50("ngModel",t.level2.taskTitleField),e.Y8G("filter",!0)("placeholder",e.bMT(6,34,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(4),e.SpI("",e.bMT(10,36,"AD_HOC_REPORTS.GANTT_BUILDER.START_DATE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level2.dateFieldOptions),e.R50("ngModel",t.level2.startDateField),e.Y8G("filter",!0)("placeholder",e.bMT(12,38,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATE_FIELD"))("showClear",!0),e.R7$(4),e.SpI("",e.bMT(16,40,"AD_HOC_REPORTS.GANTT_BUILDER.END_DATE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level2.dateFieldOptions),e.R50("ngModel",t.level2.endDateField),e.Y8G("filter",!0)("placeholder",e.bMT(18,42,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATE_FIELD"))("showClear",!0),e.R7$(4),e.SpI(" ",e.bMT(22,44,"AD_HOC_REPORTS.GANTT_BUILDER.PERCENT_COMPLETE_FIELD")," "),e.R7$(3),e.JRh(e.bMT(25,46,"GENERAL.OPTIONAL")),e.R7$(2),e.Y8G("options",t.level2.numberFieldOptions),e.R50("ngModel",t.level2.percentCompleteField),e.Y8G("filter",!0)("placeholder",e.bMT(27,48,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(4),e.SpI("",e.bMT(31,50,"AD_HOC_REPORTS.GANTT_BUILDER.PARENT_RELATION_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level2.allFieldOptions),e.R50("ngModel",t.level2.parentRelationField),e.Y8G("filter",!0)("placeholder",e.bMT(33,52,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(3),e.JRh(e.bMT(36,54,"AD_HOC_REPORTS.GANTT_BUILDER.PARENT_RELATION_HINT"))}}function Dw(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",33)(2,"button",34),e.bIt("click",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onLevel2SourceTypeChange("element"))}),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"button",34),e.bIt("click",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onLevel2SourceTypeChange("dataset"))}),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.DNE(8,Rw,6,10,"div",35)(9,Iw,6,10,"div",35)(10,yw,5,3,"div",38)(11,ww,37,56,"ng-container",62),e.bVm()}if(2&i){const t=e.XpG(3);e.R7$(2),e.AVh("button_colorPrimary","element"===t.level2.sourceType)("button_outline","element"!==t.level2.sourceType),e.R7$(),e.SpI(" ",e.bMT(4,14,"AD_HOC_REPORTS.GANTT_BUILDER.ELEMENT")," "),e.R7$(2),e.AVh("button_colorPrimary","dataset"===t.level2.sourceType)("button_outline","dataset"!==t.level2.sourceType),e.R7$(),e.SpI(" ",e.bMT(7,16,"AD_HOC_REPORTS.GANTT_BUILDER.DATASET")," "),e.R7$(2),e.Y8G("ngIf","element"===t.level2.sourceType),e.R7$(),e.Y8G("ngIf","dataset"===t.level2.sourceType),e.R7$(),e.Y8G("ngIf",t.level2.fieldsLoading),e.R7$(),e.Y8G("ngIf",t.level2.fieldMetadata&&!t.level2.fieldsLoading)}}function Ow(i,a){if(1&i&&(e.j41(0,"p-card",60),e.DNE(1,Sw,5,4,"ng-template",61)(2,kw,5,3,"ng-container",62)(3,Dw,12,18,"ng-container",62),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("ngIf",!t.level2.enabled),e.R7$(),e.Y8G("ngIf",t.level2.enabled)}}function xw(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",65),e.nI1(1,"translate"),e.bIt("click",function(){e.eBV(t);const o=e.XpG(4);return e.Njj(o.onRemoveLevel3())}),e.nrm(2,"i",66),e.k0s()}2&i&&e.Y8G("title",e.bMT(1,1,"AD_HOC_REPORTS.GANTT_BUILDER.REMOVE_LEVEL"))}function Mw(i,a){if(1&i&&(e.j41(0,"div",63)(1,"span"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,xw,3,3,"button",64),e.k0s()),2&i){const t=e.XpG(3);e.R7$(2),e.JRh(e.bMT(3,2,"AD_HOC_REPORTS.GANTT_BUILDER.LEVEL3_TITLE")),e.R7$(2),e.Y8G("ngIf",t.level3.enabled)}}function Fw(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"button",67),e.bIt("click",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onAddLevel3())}),e.nrm(2,"i",32),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.bVm()}2&i&&(e.R7$(3),e.SpI(" ",e.bMT(4,1,"AD_HOC_REPORTS.GANTT_BUILDER.ADD_SUBTASK_LEVEL")," "))}function Pw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",55),e.nI1(5,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level3.workflowTypeId,o)||(r.level3.workflowTypeId=o),e.Njj(o)}),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(4);return e.Njj(r.onLevel3ElementChange(o.value))}),e.k0s()()}if(2&i){const t=e.XpG(4);e.R7$(2),e.JRh(e.bMT(3,6,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_ELEMENT")),e.R7$(2),e.Y8G("options",t.workflowTypes),e.R50("ngModel",t.level3.workflowTypeId),e.Y8G("filter",!0)("placeholder",e.bMT(5,8,"AD_HOC_REPORTS.GANTT_BUILDER.ELEMENT_PLACEHOLDER"))("showClear",!0)}}function Nw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",54)(1,"label"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p-dropdown",56),e.nI1(5,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level3.dataSetId,o)||(r.level3.dataSetId=o),e.Njj(o)}),e.bIt("onChange",function(o){e.eBV(t);const r=e.XpG(4);return e.Njj(r.onLevel3DataSetChange(o.value))}),e.k0s()()}if(2&i){const t=e.XpG(4);e.R7$(2),e.JRh(e.bMT(3,6,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATASET")),e.R7$(2),e.Y8G("options",t.dataSets),e.R50("ngModel",t.level3.dataSetId),e.Y8G("filter",!0)("placeholder",e.bMT(5,8,"AD_HOC_REPORTS.GANTT_BUILDER.DATASET_PLACEHOLDER"))("showClear",!0)}}function Gw(i,a){1&i&&(e.j41(0,"div",68),e.nrm(1,"kendo-loader",69),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"AD_HOC_REPORTS.GANTT_BUILDER.LOADING_FIELDS")))}function Aw(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",22)(2,"label"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p-dropdown",57),e.nI1(6,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level3.taskTitleField,o)||(r.level3.taskTitleField=o),e.Njj(o)}),e.k0s()(),e.j41(7,"div",22)(8,"label"),e.EFF(9),e.nI1(10,"translate"),e.k0s(),e.j41(11,"p-dropdown",57),e.nI1(12,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level3.startDateField,o)||(r.level3.startDateField=o),e.Njj(o)}),e.k0s()(),e.j41(13,"div",22)(14,"label"),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.j41(17,"p-dropdown",57),e.nI1(18,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level3.endDateField,o)||(r.level3.endDateField=o),e.Njj(o)}),e.k0s()(),e.j41(19,"div",22)(20,"label"),e.EFF(21),e.nI1(22,"translate"),e.j41(23,"span",59),e.EFF(24),e.nI1(25,"translate"),e.k0s()(),e.j41(26,"p-dropdown",57),e.nI1(27,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level3.percentCompleteField,o)||(r.level3.percentCompleteField=o),e.Njj(o)}),e.k0s()(),e.j41(28,"div",22)(29,"label"),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"p-dropdown",57),e.nI1(33,"translate"),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(4);return e.DH7(r.level3.parentRelationField,o)||(r.level3.parentRelationField=o),e.Njj(o)}),e.k0s(),e.j41(34,"small",58),e.EFF(35),e.nI1(36,"translate"),e.k0s()(),e.bVm()}if(2&i){const t=e.XpG(4);e.R7$(3),e.SpI("",e.bMT(4,32,"AD_HOC_REPORTS.GANTT_BUILDER.TASK_TITLE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level3.allFieldOptions),e.R50("ngModel",t.level3.taskTitleField),e.Y8G("filter",!0)("placeholder",e.bMT(6,34,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(4),e.SpI("",e.bMT(10,36,"AD_HOC_REPORTS.GANTT_BUILDER.START_DATE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level3.dateFieldOptions),e.R50("ngModel",t.level3.startDateField),e.Y8G("filter",!0)("placeholder",e.bMT(12,38,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATE_FIELD"))("showClear",!0),e.R7$(4),e.SpI("",e.bMT(16,40,"AD_HOC_REPORTS.GANTT_BUILDER.END_DATE_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level3.dateFieldOptions),e.R50("ngModel",t.level3.endDateField),e.Y8G("filter",!0)("placeholder",e.bMT(18,42,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_DATE_FIELD"))("showClear",!0),e.R7$(4),e.SpI(" ",e.bMT(22,44,"AD_HOC_REPORTS.GANTT_BUILDER.PERCENT_COMPLETE_FIELD")," "),e.R7$(3),e.JRh(e.bMT(25,46,"GENERAL.OPTIONAL")),e.R7$(2),e.Y8G("options",t.level3.numberFieldOptions),e.R50("ngModel",t.level3.percentCompleteField),e.Y8G("filter",!0)("placeholder",e.bMT(27,48,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(4),e.SpI("",e.bMT(31,50,"AD_HOC_REPORTS.GANTT_BUILDER.CHILD_RELATION_FIELD")," *"),e.R7$(2),e.Y8G("options",t.level3.allFieldOptions),e.R50("ngModel",t.level3.parentRelationField),e.Y8G("filter",!0)("placeholder",e.bMT(33,52,"AD_HOC_REPORTS.GANTT_BUILDER.SELECT_FIELD"))("showClear",!0),e.R7$(3),e.JRh(e.bMT(36,54,"AD_HOC_REPORTS.GANTT_BUILDER.CHILD_RELATION_HINT"))}}function Lw(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"div",33)(2,"button",34),e.bIt("click",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onLevel3SourceTypeChange("element"))}),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"button",34),e.bIt("click",function(){e.eBV(t);const o=e.XpG(3);return e.Njj(o.onLevel3SourceTypeChange("dataset"))}),e.EFF(6),e.nI1(7,"translate"),e.k0s()(),e.DNE(8,Pw,6,10,"div",35)(9,Nw,6,10,"div",35)(10,Gw,5,3,"div",38)(11,Aw,37,56,"ng-container",62),e.bVm()}if(2&i){const t=e.XpG(3);e.R7$(2),e.AVh("button_colorPrimary","element"===t.level3.sourceType)("button_outline","element"!==t.level3.sourceType),e.R7$(),e.SpI(" ",e.bMT(4,14,"AD_HOC_REPORTS.GANTT_BUILDER.ELEMENT")," "),e.R7$(2),e.AVh("button_colorPrimary","dataset"===t.level3.sourceType)("button_outline","dataset"!==t.level3.sourceType),e.R7$(),e.SpI(" ",e.bMT(7,16,"AD_HOC_REPORTS.GANTT_BUILDER.DATASET")," "),e.R7$(2),e.Y8G("ngIf","element"===t.level3.sourceType),e.R7$(),e.Y8G("ngIf","dataset"===t.level3.sourceType),e.R7$(),e.Y8G("ngIf",t.level3.fieldsLoading),e.R7$(),e.Y8G("ngIf",t.level3.fieldMetadata&&!t.level3.fieldsLoading)}}function Bw(i,a){if(1&i&&(e.j41(0,"p-card",60),e.DNE(1,Mw,5,4,"ng-template",61)(2,Fw,5,3,"ng-container",62)(3,Lw,12,18,"ng-container",62),e.k0s()),2&i){const t=e.XpG(2);e.R7$(2),e.Y8G("ngIf",!t.level3.enabled),e.R7$(),e.Y8G("ngIf",t.level3.enabled)}}function jw(i,a){1&i&&(e.j41(0,"div",68),e.nrm(1,"kendo-loader",69),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,1,"AD_HOC_REPORTS.GANTT_BUILDER.LOADING_FIELDS")))}function Vw(i,a){if(1&i&&(e.qex(0),e.j41(1,"div",70)(2,"div",71)(3,"span",72),e.EFF(4),e.nI1(5,"translate"),e.k0s(),e.j41(6,"span",73),e.EFF(7),e.nI1(8,"translate"),e.k0s()(),e.nrm(9,"cad-gantt-viewer",74),e.k0s(),e.bVm()),2&i){const t=e.XpG(2);e.R7$(4),e.JRh(e.bMT(5,3,"AD_HOC_REPORTS.GANTT_BUILDER.PREVIEW_LABEL")),e.R7$(3),e.JRh(e.bMT(8,5,"AD_HOC_REPORTS.GANTT_BUILDER.PREVIEW_HINT")),e.R7$(2),e.Y8G("report",t.previewReport)}}
1function $w(i,a){1&i&&(e.j41(0,"div",75),e.nrm(1,"i",76),e.j41(2,"h3"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"AD_HOC_REPORTS.GANTT_BUILDER.EMPTY_MAIN")),e.R7$(3),e.JRh(e.bMT(7,4,"AD_HOC_REPORTS.GANTT_BUILDER.EMPTY_MAIN_HINT")))}function Uw(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",18)(1,"div",19)(2,"p-card",20),e.nI1(3,"translate"),e.j41(4,"form",21)(5,"div",22)(6,"label",23),e.EFF(7),e.nI1(8,"translate"),e.k0s(),e.nrm(9,"input",24),e.nI1(10,"translate"),e.DNE(11,gw,3,3,"small",25),e.k0s(),e.j41(12,"div",22)(13,"label",26),e.EFF(14),e.nI1(15,"translate"),e.k0s(),e.nrm(16,"textarea",27),e.nI1(17,"translate"),e.k0s()()(),e.j41(18,"p-card",28),e.nI1(19,"translate"),e.DNE(20,fw,2,1,"div",29)(21,Cw,4,3,"div",30),e.j41(22,"button",31),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onAddParameter())}),e.nrm(23,"i",32),e.EFF(24),e.nI1(25,"translate"),e.k0s()(),e.j41(26,"p-card",28),e.nI1(27,"translate"),e.j41(28,"div",33)(29,"button",34),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onSourceTypeChange("element"))}),e.EFF(30),e.nI1(31,"translate"),e.k0s(),e.j41(32,"button",34),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onSourceTypeChange("dataset"))}),e.EFF(33),e.nI1(34,"translate"),e.k0s()(),e.DNE(35,vw,6,10,"div",35)(36,bw,6,10,"div",35),e.k0s(),e.DNE(37,Tw,35,52,"p-card",36)(38,Ow,4,2,"p-card",37)(39,Bw,4,2,"p-card",37)(40,jw,5,3,"div",38),e.k0s(),e.j41(41,"div",39),e.DNE(42,Vw,10,7,"ng-container",40)(43,$w,8,6,"ng-template",null,0,e.C5r),e.k0s()()}if(2&i){let t,n;const o=e.sdS(44),r=e.XpG();e.R7$(2),e.Y8G("header",e.bMT(3,34,"AD_HOC_REPORTS.GANTT_BUILDER.SETTINGS_TITLE")),e.R7$(2),e.Y8G("formGroup",r.reportForm),e.R7$(3),e.SpI("",e.bMT(8,36,"AD_HOC_REPORTS.GANTT_BUILDER.NAME_LABEL")," *"),e.R7$(2),e.AVh("ng-invalid",(null==(t=r.reportForm.get("name"))?null:t.invalid)&&(null==(t=r.reportForm.get("name"))?null:t.touched)),e.Y8G("placeholder",e.bMT(10,38,"AD_HOC_REPORTS.GANTT_BUILDER.NAME_PLACEHOLDER")),e.R7$(2),e.Y8G("ngIf",(null==(n=r.reportForm.get("name"))?null:n.invalid)&&(null==(n=r.reportForm.get("name"))?null:n.touched)),e.R7$(3),e.JRh(e.bMT(15,40,"AD_HOC_REPORTS.GANTT_BUILDER.DESCRIPTION_LABEL")),e.R7$(2),e.Y8G("placeholder",e.bMT(17,42,"AD_HOC_REPORTS.GANTT_BUILDER.DESCRIPTION_PLACEHOLDER")),e.R7$(2),e.Y8G("header",e.bMT(19,44,"AD_HOC_REPORTS.GANTT_BUILDER.PARAMETERS")),e.R7$(2),e.Y8G("ngIf",r.parameters.length),e.R7$(),e.Y8G("ngIf",!r.parameters.length),e.R7$(3),e.SpI(" ",e.bMT(25,46,"AD_HOC_REPORTS.GANTT_BUILDER.ADD_PARAMETER")," "),e.R7$(2),e.Y8G("header",e.bMT(27,48,"AD_HOC_REPORTS.GANTT_BUILDER.DATA_SOURCE")),e.R7$(3),e.AVh("button_colorPrimary","element"===r.sourceType)("button_outline","element"!==r.sourceType),e.R7$(),e.SpI(" ",e.bMT(31,50,"AD_HOC_REPORTS.GANTT_BUILDER.ELEMENT")," "),e.R7$(2),e.AVh("button_colorPrimary","dataset"===r.sourceType)("button_outline","dataset"!==r.sourceType),e.R7$(),e.SpI(" ",e.bMT(34,52,"AD_HOC_REPORTS.GANTT_BUILDER.DATASET")," "),e.R7$(2),e.Y8G("ngIf","element"===r.sourceType),e.R7$(),e.Y8G("ngIf","dataset"===r.sourceType),e.R7$(),e.Y8G("ngIf",r.fieldMetadata&&!r.fieldsLoading),e.R7$(),e.Y8G("ngIf",r.fieldMetadata&&!r.fieldsLoading),e.R7$(),e.Y8G("ngIf",r.level2.enabled&&r.level2.fieldMetadata&&!r.level2.fieldsLoading),e.R7$(),e.Y8G("ngIf",r.fieldsLoading),e.R7$(),e.AVh("main-content--preview",r.isEditMode&&r.previewReport),e.R7$(),e.Y8G("ngIf",r.isEditMode&&r.previewReport)("ngIfElse",o)}}function Yw(i,a){if(1&i){const t=e.RV6();e.j41(0,"cad-parameter-configurator",77),e.bIt("saved",function(o){e.eBV(t);const r=e.XpG();return e.Njj(r.onParameterSaved(o))})("closed",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onParameterDialogClosed())}),e.k0s()}if(2&i){const t=e.XpG();e.Y8G("parameter",t.editingParameter)("visible",t.showParameterDialog)("workflowTypes",t.workflowTypes)("loadFieldMetadataFn",t.loadFieldMetadataCallback)}}let Wu=(()=>{class i{constructor(t,n,o,r,s){this._router=t,this._route=n,this._fb=o,this._apiService=r,this._messagingService=s,this._destroyed$=new ue.B7,this.workflowTypes=[],this.dataSets=[],this.sourceType="element",this.selectedWorkflowTypeId=null,this.selectedDataSetId=null,this.fieldMetadata=null,this.allFieldOptions=[],this.dateFieldOptions=[],this.numberFieldOptions=[],this.taskTitleField="",this.startDateField="",this.endDateField="",this.percentCompleteField="",this.level2=this._emptyLevelState(),this.level3=this._emptyLevelState(),this.previewReport=null,this.parameters=[],this.showParameterDialog=!1,this.editingParameter=null,this.editingParameterIndex=-1,this.loadFieldMetadataCallback=c=>this._apiService.getFieldMetadata(c),this.loading=!1,this.saving=!1,this.fieldsLoading=!1,this.isEditMode=!1,this.reportId=null,this._initForm()}ngOnInit(){this.reportId=this._route.snapshot.params.reportId,this.isEditMode=!!this.reportId,this._loadInitialData()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}_initForm(){this.reportForm=this._fb.group({name:["",[R.k0.required,R.k0.maxLength(200)]],description:["",[R.k0.maxLength(1e3)]]})}_emptyLevelState(){return{enabled:!1,sourceType:"element",workflowTypeId:null,dataSetId:null,fieldMetadata:null,allFieldOptions:[],dateFieldOptions:[],numberFieldOptions:[],taskTitleField:"",startDateField:"",endDateField:"",percentCompleteField:"",parentRelationField:"",fieldsLoading:!1}}_loadInitialData(){this.loading=!0;const t={workflowTypes:this._apiService.getWorkflowTypes().pipe((0,ye.W)(()=>(0,le.of)([]))),dataSets:this._apiService.getDataSets().pipe((0,ye.W)(()=>(0,le.of)([])))};this.isEditMode&&this.reportId&&(t.report=this._apiService.getReportById(this.reportId).pipe((0,ye.W)(()=>(0,le.of)(null)))),(0,vt.p)(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.loading=!1)).subscribe({next:n=>{this.workflowTypes=n.workflowTypes||[],this.dataSets=n.dataSets||[],this.isEditMode&&n.report&&this._populateFromReport(n.report)},error:()=>{this._messagingService.error("Failed to load data","Error")}})}_populateFromReport(t){this.previewReport=t,this.reportForm.patchValue({name:t.name,description:t.description}),t.dataSetId?(this.sourceType="dataset",this.selectedDataSetId=t.dataSetId,this._loadDataSetFields(t.dataSetId,t.dashboardConfiguration)):t.workflowTypeId&&(this.sourceType="element",this.selectedWorkflowTypeId=t.workflowTypeId,this._loadElementFields(t.workflowTypeId,t.dashboardConfiguration))}_applyGanttConfig(t){if(t)try{const n=JSON.parse(t);this.taskTitleField=n.taskTitleField||"",this.startDateField=n.startDateField||"",this.endDateField=n.endDateField||"",this.percentCompleteField=n.percentCompleteField||"",this.parameters=n.parameters||[],n.level2&&(this.level2.enabled=!0,this.level2.taskTitleField=n.level2.taskTitleField||"",this.level2.startDateField=n.level2.startDateField||"",this.level2.endDateField=n.level2.endDateField||"",this.level2.percentCompleteField=n.level2.percentCompleteField||"",this.level2.parentRelationField=n.level2.parentRelationField||"",n.level2.workflowTypeId?(this.level2.sourceType="element",this.level2.workflowTypeId=n.level2.workflowTypeId,this._loadLevelFields(this.level2,this._apiService.getFieldMetadata(n.level2.workflowTypeId))):n.level2.dataSetId&&(this.level2.sourceType="dataset",this.level2.dataSetId=n.level2.dataSetId,this._loadLevelFields(this.level2,this._apiService.getDataSetFields(n.level2.dataSetId)))),n.level3&&(this.level3.enabled=!0,this.level3.taskTitleField=n.level3.taskTitleField||"",this.level3.startDateField=n.level3.startDateField||"",this.level3.endDateField=n.level3.endDateField||"",this.level3.percentCompleteField=n.level3.percentCompleteField||"",this.level3.parentRelationField=n.level3.parentRelationField||"",n.level3.
1workflowTypeId?(this.level3.sourceType="element",this.level3.workflowTypeId=n.level3.workflowTypeId,this._loadLevelFields(this.level3,this._apiService.getFieldMetadata(n.level3.workflowTypeId))):n.level3.dataSetId&&(this.level3.sourceType="dataset",this.level3.dataSetId=n.level3.dataSetId,this._loadLevelFields(this.level3,this._apiService.getDataSetFields(n.level3.dataSetId))))}catch{}}onSourceTypeChange(t){this.sourceType=t,this.selectedWorkflowTypeId=null,this.selectedDataSetId=null,this.fieldMetadata=null,this._clearFieldOptions(),this._clearFieldMappings()}onElementChange(t){this.selectedWorkflowTypeId=t,this._clearFieldMappings(),t?this._loadElementFields(t):(this.fieldMetadata=null,this._clearFieldOptions())}onDataSetChange(t){this.selectedDataSetId=t,this._clearFieldMappings(),t?this._loadDataSetFields(t):(this.fieldMetadata=null,this._clearFieldOptions())}onAddLevel2(){this.level2.enabled=!0}onRemoveLevel2(){this.level2=this._emptyLevelState(),this.level3=this._emptyLevelState()}onLevel2SourceTypeChange(t){this.level2.sourceType=t,this.level2.workflowTypeId=null,this.level2.dataSetId=null,this.level2.fieldMetadata=null,this.level2.allFieldOptions=[],this.level2.dateFieldOptions=[],this.level2.numberFieldOptions=[],this.level2.taskTitleField="",this.level2.startDateField="",this.level2.endDateField="",this.level2.percentCompleteField="",this.level2.parentRelationField=""}onLevel2ElementChange(t){this.level2.workflowTypeId=t,this.level2.taskTitleField="",this.level2.startDateField="",this.level2.endDateField="",this.level2.percentCompleteField="",this.level2.parentRelationField="",t?this._loadLevelFields(this.level2,this._apiService.getFieldMetadata(t)):(this.level2.fieldMetadata=null,this.level2.allFieldOptions=[],this.level2.dateFieldOptions=[],this.level2.numberFieldOptions=[])}onLevel2DataSetChange(t){this.level2.dataSetId=t,this.level2.taskTitleField="",this.level2.startDateField="",this.level2.endDateField="",this.level2.percentCompleteField="",this.level2.parentRelationField="",t?this._loadLevelFields(this.level2,this._apiService.getDataSetFields(t)):(this.level2.fieldMetadata=null,this.level2.allFieldOptions=[],this.level2.dateFieldOptions=[],this.level2.numberFieldOptions=[])}onAddLevel3(){this.level2.enabled&&(this.level3.enabled=!0)}onRemoveLevel3(){this.level3=this._emptyLevelState()}onLevel3SourceTypeChange(t){this.level3.sourceType=t,this.level3.workflowTypeId=null,this.level3.dataSetId=null,this.level3.fieldMetadata=null,this.level3.allFieldOptions=[],this.level3.dateFieldOptions=[],this.level3.numberFieldOptions=[],this.level3.taskTitleField="",this.level3.startDateField="",this.level3.endDateField="",this.level3.percentCompleteField="",this.level3.parentRelationField=""}onLevel3ElementChange(t){this.level3.workflowTypeId=t,this.level3.taskTitleField="",this.level3.startDateField="",this.level3.endDateField="",this.level3.percentCompleteField="",this.level3.parentRelationField="",t?this._loadLevelFields(this.level3,this._apiService.getFieldMetadata(t)):(this.level3.fieldMetadata=null,this.level3.allFieldOptions=[],this.level3.dateFieldOptions=[],this.level3.numberFieldOptions=[])}onLevel3DataSetChange(t){this.level3.dataSetId=t,this.level3.taskTitleField="",this.level3.startDateField="",this.level3.endDateField="",this.level3.percentCompleteField="",this.level3.parentRelationField="",t?this._loadLevelFields(this.level3,this._apiService.getDataSetFields(t)):(this.level3.fieldMetadata=null,this.level3.allFieldOptions=[],this.level3.dateFieldOptions=[],this.level3.numberFieldOptions=[])}_loadElementFields(t,n){this.fieldsLoading=!0,this._apiService.getFieldMetadata(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.fieldsLoading=!1)).subscribe({next:o=>{this.fieldMetadata=o,this._buildFieldOptions(o),n&&this._applyGanttConfig(n)},error:()=>{this._messagingService.error("Failed to load field metadata","Error")}})}_loadDataSetFields(t,n){this.fieldsLoading=!0,this._apiService.getDataSetFields(t).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.fieldsLoading=!1)).subscribe({next:o=>{this.fieldMetadata=o,this._buildFieldOptions(o),n&&this._applyGanttConfig(n)},error:()=>{this._messagingService.error("Failed to load dataset fields","Error")}})}_loadLevelFields(t,n){t.fieldsLoading=!0,n.pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>t.fieldsLoading=!1)).subscribe({next:o=>{t.fieldMetadata=o;const r=[...o.commonFields||[],...o.elementFields||[]];t.allFieldOptions=r.map(s=>({label:s.displayName,value:s.name})),t.dateFieldOptions=r.filter(s=>"datetime"===s.type).map(s=>({label:s.displayName,value:s.name})),t.numberFieldOptions=r.filter(s=>"number"===s.type).map(s=>({label:s.displayName,value:s.name}))},error:()=>this._messagingService.error("Failed to load field metadata","Error")})}_buildFieldOptions(t){const n=[...t.commonFields||[],...t.elementFields||[]];this.allFieldOptions=n.map(o=>({label:o.displayName,value:o.name})),this.dateFieldOptions=n.filter(o=>"datetime"===o.type).map(o=>({label:o.displayName,value:o.name})),this.numberFieldOptions=n.filter(o=>"number"===o.type).map(o=>({label:o.displayName,value:o.name}))}_clearFieldOptions(){this.allFieldOptions=[],this.dateFieldOptions=[],this.numberFieldOptions=[]}_clearFieldMappings(){this.taskTitleField="",this.startDateField="",this.endDateField="",this.percentCompleteField=""}
1onSave(){if(this.reportForm.invalid)return this.reportForm.markAllAsTouched(),void this._messagingService.warning("Please fill in all required fields","Validation");if(!this.selectedWorkflowTypeId&&!this.selectedDataSetId)return void this._messagingService.warning("Please select a data source","Validation");if(!this.taskTitleField)return void this._messagingService.warning("Please select a Task Title field","Validation");if(!this.startDateField)return void this._messagingService.warning("Please select a Start Date field","Validation");if(!this.endDateField)return void this._messagingService.warning("Please select an End Date field","Validation");if(this.level2.enabled){if(!this.level2.workflowTypeId&&!this.level2.dataSetId)return void this._messagingService.warning("Please select a data source for the Child Task level","Validation");if(!this.level2.taskTitleField||!this.level2.startDateField||!this.level2.endDateField)return void this._messagingService.warning("Please complete all required field mappings for the Child Task level","Validation");if(!this.level2.parentRelationField)return void this._messagingService.warning("Please select the relation field linking Child Tasks to Parent Tasks","Validation")}if(this.level3.enabled){if(!this.level3.workflowTypeId&&!this.level3.dataSetId)return void this._messagingService.warning("Please select a data source for the Sub-Task level","Validation");if(!this.level3.taskTitleField||!this.level3.startDateField||!this.level3.endDateField)return void this._messagingService.warning("Please complete all required field mappings for the Sub-Task level","Validation");if(!this.level3.parentRelationField)return void this._messagingService.warning("Please select the relation field linking Sub-Tasks to Child Tasks","Validation")}this.saving=!0;const t=this.reportForm.value,n={taskTitleField:this.taskTitleField,startDateField:this.startDateField,endDateField:this.endDateField,percentCompleteField:this.percentCompleteField||void 0,parameters:this.parameters.length?this.parameters:void 0};if(this.level2.enabled){const r={taskTitleField:this.level2.taskTitleField,startDateField:this.level2.startDateField,endDateField:this.level2.endDateField,percentCompleteField:this.level2.percentCompleteField||void 0,parentRelationField:this.level2.parentRelationField};this.level2.workflowTypeId&&(r.workflowTypeId=this.level2.workflowTypeId),this.level2.dataSetId&&(r.dataSetId=this.level2.dataSetId),n.level2=r}if(this.level3.enabled&&n.level2){const r={taskTitleField:this.level3.taskTitleField,startDateField:this.level3.startDateField,endDateField:this.level3.endDateField,percentCompleteField:this.level3.percentCompleteField||void 0,parentRelationField:this.level3.parentRelationField};this.level3.workflowTypeId&&(r.workflowTypeId=this.level3.workflowTypeId),this.level3.dataSetId&&(r.dataSetId=this.level3.dataSetId),n.level3=r}const o=JSON.stringify(n);this.isEditMode&&this.reportId?this._apiService.updateReport(this.reportId,{name:t.name,description:t.description,workflowTypeId:this.selectedWorkflowTypeId||void 0,dataSetId:this.selectedDataSetId||void 0,dashboardConfiguration:o}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:s=>{this._messagingService.success("Gantt chart updated successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",s.adHocReportId])},error:()=>{this._messagingService.error("Failed to update Gantt chart","Error")}}):this._apiService.createReport({name:t.name,description:t.description,entityType:w.dX.Workflow,visualizationType:w.vi.Gantt,workflowTypeId:this.selectedWorkflowTypeId||void 0,dataSetId:this.selectedDataSetId||void 0,dashboardConfiguration:o}).pipe((0,L.Q)(this._destroyed$),(0,ne.j)(()=>this.saving=!1)).subscribe({next:s=>{this._messagingService.success("Gantt chart created successfully","Success"),this._router.navigate(["/private/ad-hoc-reports/view",s.adHocReportId])},error:()=>{this._messagingService.error("Failed to create Gantt chart","Error")}})}onAddParameter(){this.editingParameter={id:"param-"+Date.now()+"-"+Math.random().toString(36).substr(2,9),name:"",workflowTypeId:0,fieldName:"",parameterType:"dropdown",required:!1},this.editingParameterIndex=-1,this.showParameterDialog=!0}onEditParameter(t){this.editingParameter={...this.parameters[t]},this.editingParameterIndex=t,this.showParameterDialog=!0}onDeleteParameter(t){this.parameters.splice(t,1)}onParameterSaved(t){this.editingParameterIndex>=0?this.parameters[this.editingParameterIndex]=t:this.parameters.push(t),this.showParameterDialog=!1,this.editingParameter=null}onParameterDialogClosed(){this.showParameterDialog=!1,this.editingParameter=null,this.editingParameterIndex=-1}onCancel(){this._router.navigate(["/private/ad-hoc-reports"])}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.Ix),e.rXU(ge.nX),e.rXU(R.ok),e.rXU(Ye.F),e.rXU(q.Ui))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-gantt-builder"]],decls:24,vars:26,consts:[["emptyState",""],[1,"gantt
1-builder-container"],[1,"builder-header"],[1,"header-title"],["type","button",1,"button","button_clear","button_colorAlt",3,"click","title"],[1,"mdi","mdi-arrow-left"],[1,"header-actions"],["type","button",1,"button","button_outline",3,"click","title"],["type","button",1,"button","button_colorSuccess",3,"click","title","disabled"],["class","mdi mdi-loading mdi-spin buttonIcon_right",4,"ngIf"],["class","mdi mdi-content-save buttonIcon_right",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","builder-content",4,"ngIf"],[3,"parameter","visible","workflowTypes","loadFieldMetadataFn","saved","closed",4,"ngIf"],[1,"mdi","mdi-loading","mdi-spin","buttonIcon_right"],[1,"mdi","mdi-content-save","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[1,"builder-content"],[1,"settings-sidebar"],[3,"header"],[3,"formGroup"],[1,"form-field"],["for","name"],["id","name","type","text","pInputText","","formControlName","name",3,"placeholder"],["class","p-error",4,"ngIf"],["for","description"],["id","description","pInputTextarea","","formControlName","description","rows","2",3,"placeholder"],["styleClass","mt-3",3,"header"],["class","parameter-list",4,"ngIf"],["class","no-parameters",4,"ngIf"],["type","button",1,"button","button_outline","button_sm","add-parameter-btn",3,"click"],[1,"mdi","mdi-plus"],[1,"source-type-toggle"],["type","button",1,"button","button_sm",3,"click"],["class","form-field mt-2",4,"ngIf"],["styleClass","mt-3",3,"header",4,"ngIf"],["styleClass","mt-3",4,"ngIf"],["class","fields-loading",4,"ngIf"],[1,"main-content"],[4,"ngIf","ngIfElse"],[1,"p-error"],[1,"parameter-list"],["class","parameter-item",4,"ngFor","ngForOf"],[1,"parameter-item"],[1,"parameter-info"],[1,"parameter-name"],[1,"parameter-type-badge"],[1,"parameter-actions"],["type","button",1,"button","button_round",3,"click"],[1,"mdi","mdi-pencil"],["type","button",1,"button","button_round","delete-btn",3,"click"],[1,"mdi","mdi-trash-can"],[1,"no-parameters"],[1,"form-field","mt-2"],["optionLabel","name","optionValue","workflowTypeId","filterBy","name","styleClass","w-full",3,"ngModelChange","onChange","options","ngModel","filter","placeholder","showClear"],["optionLabel","name","optionValue","dataSetId","filterBy","name","styleClass","w-full",3,"ngModelChange","onChange","options","ngModel","filter","placeholder","showClear"],["optionLabel","label","optionValue","value","styleClass","w-full",3,"ngModelChange","options","ngModel","filter","placeholder","showClear"],[1,"field-hint"],[1,"optional-label"],["styleClass","mt-3"],["pTemplate","header"],[4,"ngIf"],[1,"level-card-header"],["type","button","class","button button_round delete-btn",3,"title","click",4,"ngIf"],["type","button",1,"button","button_round","delete-btn",3,"click","title"],[1,"mdi","mdi-close"],["type","button",1,"button","button_outline","button_sm","add-level-btn",3,"click"],[1,"fields-loading"],["type","pulsing","size","medium"],[1,"preview-container"],[1,"preview-header"],[1,"preview-label"],[1,"preview-hint"],[1,"preview-viewer",3,"report"],[1,"empty-state"],[1,"mdi","mdi-chart-gantt","empty-icon"],[3,"saved","closed","parameter","visible","workflowTypes","loadFieldMetadataFn"]],template:function(n,o){1&n&&(e.j41(0,"div",1)(1,"div",2)(2,"div",3)(3,"button",4),e.nI1(4,"translate"),e.bIt("click",function(){return o.onCancel()}),e.nrm(5,"i",5),e.k0s(),e.j41(6,"h2"),e.EFF(7),e.nI1(8,"translate"),e.nI1(9,"translate"),e.k0s()(),e.j41(10,"div",6)(11,"button",7),e.nI1(12,"translate"),e.bIt("click",function(){return o.onCancel()}),e.EFF(13),e.nI1(14,"translate"),e.k0s(),e.j41(15,"button",8),e.nI1(16,"translate"),e.bIt("click",function(){return o.onSave()}),e.DNE(17,uw,1,0,"i",9)(18,_w,1,0,"i",10),e.EFF(19),e.nI1(20,"translate"),e.k0s()()(),e.DNE(21,mw,4,0,"div",11)(22,Uw,45,54,"div",12)(23,Yw,1,4,"cad-parameter-configurator",13),e.k0s()),2&n&&(e.R7$(3),e.Y8G("title",e.bMT(4,12,"GENERAL.GO_BACK")),e.R7$(4),e.SpI(" ",o.isEditMode?e.bMT(8,14,"AD_HOC_REPORTS.GANTT_BUILDER.EDIT_TITLE"):e.bMT(9,16,"AD_HOC_REPORTS.GANTT_BUILDER.NEW_TITLE")," "),e.R7$(4),e.Y8G("title",e.bMT(12,18,"GENERAL.CANCEL")),e.R7$(2),e.SpI(" ",e.bMT(14,20,"GENERAL.CANCEL")," "),e.R7$(2),e.Y8G("title",e.bMT(16,22,"AD_HOC_REPORTS.GANTT_BUILDER.SAVE"))("disabled",o.saving),e.R7$(2),e.Y8G("ngIf",o.saving),e.R7$(),e.Y8G("ngIf",!o.saving),e.R7$(),e.SpI(" ",e.bMT(20,24,"AD_HOC_REPORTS.GANTT_BUILDER.SAVE")," "),e.R7$(2),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading),e.R7$(),e.Y8G("ngIf",o.showParameterDialog&&o.editingParameter))},dependencies:[M.Sq,M.bT,R.qT,R.me,R.BC,R.cb,R.vS,R.j4,R.JD,ke.Ei,Le.ms,_e.S,mt.Z,ee.C3,ze.VU,_n,Gn,dd,nt.D9],styles:[".gantt-builder
1-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden}.builder-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:12px 20px;border-bottom:1px solid var(--border-color, #e2e8f0);background:var(--surface-card, #fff);flex-shrink:0}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.builder-header[_ngcontent-%COMP%]   .header-title[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;font-weight:600}.builder-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:8px}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;flex:1;color:var(--text-color-secondary, #64748b)}.builder-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.settings-sidebar[_ngcontent-%COMP%]{width:340px;flex-shrink:0;overflow-y:auto;padding:16px;border-right:1px solid var(--border-color, #e2e8f0);background:var(--surface-ground, #f8fafc)}.main-content[_ngcontent-%COMP%]{flex:1;overflow:auto;display:flex;align-items:center;justify-content:center;background:var(--surface-ground, #f8fafc)}.main-content--preview[_ngcontent-%COMP%]{align-items:stretch;justify-content:stretch;overflow:hidden}.preview-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;overflow:hidden;padding:16px}.preview-container[_ngcontent-%COMP%]   .preview-header[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:12px;margin-bottom:12px;flex-shrink:0}.preview-container[_ngcontent-%COMP%]   .preview-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--text-color-secondary, #64748b)}.preview-container[_ngcontent-%COMP%]   .preview-hint[_ngcontent-%COMP%]{font-size:.75rem;color:var(--text-color-secondary, #94a3b8)}.preview-viewer[_ngcontent-%COMP%]{flex:1;overflow:hidden;display:flex;flex-direction:column;min-height:0}.form-field[_ngcontent-%COMP%]{margin-bottom:16px}.form-field[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:block;margin-bottom:6px;font-size:.85rem;font-weight:500;color:var(--text-color, #1e293b)}.form-field[_ngcontent-%COMP%]   input[_ngcontent-%COMP%], .form-field[_ngcontent-%COMP%]   textarea[_ngcontent-%COMP%]{width:100%}.source-type-toggle[_ngcontent-%COMP%]{display:flex;gap:8px;margin-bottom:4px}.mt-2[_ngcontent-%COMP%]{margin-top:8px}.mt-3[_ngcontent-%COMP%]{margin-top:12px}.w-full[_ngcontent-%COMP%]{width:100%}.optional-label[_ngcontent-%COMP%]{font-size:.75rem;font-weight:400;color:var(--text-color-secondary, #64748b);margin-left:4px}.field-hint[_ngcontent-%COMP%]{display:block;margin-top:4px;font-size:.75rem;color:var(--text-color-secondary, #64748b)}.fields-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:16px;color:var(--text-color-secondary, #64748b);font-size:.85rem}.empty-state[_ngcontent-%COMP%]{text-align:center;padding:40px 24px;max-width:480px}.empty-state[_ngcontent-%COMP%]   .empty-icon[_ngcontent-%COMP%]{font-size:3rem;color:var(--text-color-secondary, #94a3b8);display:block;margin-bottom:16px}.empty-state[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%]{margin:0 0 8px;font-size:1rem;font-weight:600;color:var(--text-color, #1e293b)}.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 20px;font-size:.875rem;color:var(--text-color-secondary, #64748b)}.parameter-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;margin-bottom:.75rem}.parameter-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:.5rem .75rem;border-radius:6px;background:var(--surface-ground, #f8fafc)}.parameter-item[_ngcontent-%COMP%]:hover{background:var(--surface-hover, #f1f5f9)}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-name[_ngcontent-%COMP%]{font-weight:500;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.parameter-item[_ngcontent-%COMP%]   .parameter-info[_ngcontent-%COMP%]   .parameter-type-badge[_ngcontent-%COMP%]{font-size:.625rem;padding:.125rem .375rem;border-radius:10px;background:var(--primary-color, #3b82f6);color:#fff;text-transform:uppercase;font-weight:600;white-space:nowrap}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]{display:flex;gap:.25rem}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{background-color:transparent;border:none;color:#0009}.parameter-item[_ngcontent-%COMP%]   .parameter-actions[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]:hover{background-color:#0000000a}.no-parameters[_ngcontent-%COMP%]{padding:.75rem;text-align:center;font-size:.8125rem;color:var(--text-color-secondary, #64748b);margin-bottom:.75rem}.add-parameter-btn[_ngcontent-%COMP%]{width:100%;justify-content:center;gap:.25rem}.level-card-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;width:100%;padding:0 1rem;font-size:.9rem;font-weight:600}.level-card-header[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]{background-color:transparent;border:none;color:#00000080;flex-shrink:0}.level-card-header[_ngcontent-%COMP%]   .delete-btn[_ngcontent-%COMP%]:hover{background-color:#0000000a;color:var(--danger-color, #ef4444)}.add-level-btn[_ngcontent-%COMP%]{width:100%;justify-content:center;gap:.25rem}.mapping-summary[_ngcontent-%COMP%]{background:var(--surface-card, #fff);border:1px solid var(--border-color, #e2e8f0);border-radius:8px;padding:16px;text-align:left}.mapping-summary[_ngcontent-%COMP%]   .mapping-row[_ngcontent-%COMP%]{display:flex;gap:8px;padding:4px 0;font-size:.85rem}.mapping-summary[_ngcontent-%COMP%]   .mapping-row[_ngcontent-%COMP%]:not(:last-child){border-bottom:1px solid var(--border-color, #f1f5f9)}.mapping-summary[_ngcontent-%COMP%]   .mapping-label[_ngcontent-%COMP%]{font-weight:500;color:var(--text-color-secondary, #64748b);min-width:120px}.mapping-summary[_ngcontent-%COMP%]   .mapping-value[_ngcontent-%COMP%]{color:var(--text-color, #1e293b);font-family:monospace;font-size:.8rem}"]})}}return i})();var zu=F(10467);const wo=new Map;function Do(i,a){if(a?.())return Promise.resolve();const t=wo.get(i);if(t)return t;const n=new Promise((o,r)=>{const s=document.createElement("script");s.src=i,s.onload=()=>o(),s.onerror=()=>{wo.delete(i),r(new Error(`Failed to load script: ${i}`))},document.head.appendChild(s)});return wo.set(i,n),n}var Hw=F(52170);function Xw(i,a){if(1&i&&(e.j41(0,"p",21),e.nrm(1,"i",22),e.EFF(2," Selected: "),e.j41(3,"strong"),e.EFF(4),e.k0s()()),2&i){const t=e.XpG();e.R7$(4),e.JRh(t.selectedElement.name)}}function Ww(i,a){1&i&&(e.j41(0,"div",23),e.nrm(1,"kendo-loader",24),e.j41(2,"span"),e.EFF(3,"Loading datasets\u2026"),e.k0s()())}function zw(i,a){if(1&i&&(e.j41(0,"div",25),e.nrm(1,"i",26),e.EFF(2),e.k0s()),2&i){const t=e.XpG();e.R7$(2),e.SpI(" ",t.datasetsError," ")}}
1function Kw(i,a){1&i&&(e.j41(0,"div",23),e.EFF(1," No datasets available. "),e.k0s())}function Jw(i,a){if(1&i&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.description)}}function qw(i,a){if(1&i&&(e.j41(0,"span",34),e.EFF(1),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.ownerName)}}function Qw(i,a){if(1&i){const t=e.RV6();e.j41(0,"li",29),e.bIt("click",function(){const o=e.eBV(t).$implicit,r=e.XpG(2);return e.Njj(r.selectDataset(o))}),e.j41(1,"div",30),e.EFF(2),e.k0s(),e.j41(3,"div",31),e.DNE(4,Jw,2,1,"span",32)(5,qw,2,1,"span",33),e.k0s()()}if(2&i){const t=a.$implicit,n=e.XpG(2);e.AVh("picker-list__item_selected",(null==n.selectedDataset?null:n.selectedDataset.dataSetId)===t.dataSetId),e.R7$(2),e.JRh(t.name),e.R7$(2),e.Y8G("ngIf",t.description),e.R7$(),e.Y8G("ngIf",t.ownerName)}}function Zw(i,a){if(1&i&&(e.j41(0,"ul",27),e.DNE(1,Qw,6,5,"li",28),e.k0s()),2&i){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",t.filteredDatasets)}}function eD(i,a){if(1&i){const t=e.RV6();e.j41(0,"label",39)(1,"input",40),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG(2);return e.DH7(r.renderMode,o)||(r.renderMode=o),e.Njj(o)}),e.k0s(),e.EFF(2),e.k0s()}if(2&i){const t=a.$implicit,n=e.XpG(2);e.R7$(),e.Y8G("value",t.value),e.R50("ngModel",n.renderMode),e.R7$(),e.SpI(" ",t.label," ")}}function tD(i,a){if(1&i&&(e.j41(0,"div",35)(1,"label",36),e.EFF(2,"Render mode"),e.k0s(),e.j41(3,"div",37),e.DNE(4,eD,3,3,"label",38),e.k0s()()),2&i){const t=e.XpG();e.R7$(4),e.Y8G("ngForOf",t.renderModes)}}let nD=(()=>{class i{constructor(t,n,o,r){this._ref=t,this._config=n,this._apiService=o,this._reportingApi=r,this._destroyed$=new ue.B7,this._initial=null,this.activeTab=0,this.elementFilter$=new gt.t(""),this.selectedElement=null,this.datasets=[],this.filteredDatasets=[],this.datasetFilter="",this.datasetsLoading=!1,this.datasetsError="",this.selectedDataset=null,this.renderMode=Ue.D7.SingleRow,this.renderModes=[{label:"Single row (one item)",value:Ue.D7.SingleRow},{label:"Related rows (filtered to current item)",value:Ue.D7.FilteredTabular},{label:"Tabular (up to 50,000 rows)",value:Ue.D7.Tabular}]}ngOnInit(){this._initial=this._config.data?.initial??null,"dataset"===this._initial?.type?(this.activeTab=1,this.renderMode=this._initial.renderMode??Ue.D7.SingleRow):"element"===this._initial?.type&&this._initial.elementId&&(this.selectedElement={id:this._initial.elementId,name:this._initial.displayName},this.elementSearchCtrl=new R.MJ(this._initial.displayName)),this.elementSearchCtrl||(this.elementSearchCtrl=new R.MJ("")),this.elementSuggestions$=this.elementFilter$.pipe((0,no.B)(250),(0,Oe.n)(t=>this._apiService.get("elements",Hw.n6.Elements,{name:t})),(0,Me.T)(t=>t.value.items)),this.loadDatasets()}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete()}onTabChange(t){this.activeTab=t}searchElements(t){this.elementFilter$.next(t.query)}selectElement(t){this.selectedElement=t.value}loadDatasets(){this.datasetsLoading=!0,this.datasetsError="",this._reportingApi.getFormDataSetOptions().pipe((0,L.Q)(this._destroyed$),(0,ye.W)(()=>(this.datasetsError="Failed to load datasets.",(0,le.of)([])))).subscribe(t=>{if(this.datasets=t??[],this.applyDatasetFilter(),this.datasetsLoading=!1,"dataset"===this._initial?.type&&this._initial.dataSetId){const n=this.datasets.find(o=>o.dataSetId===this._initial.dataSetId);n&&(this.selectedDataset=n)}})}onDatasetFilterChange(){this.applyDatasetFilter()}applyDatasetFilter(){const t=this.datasetFilter?.trim().toLowerCase();this.filteredDatasets=t?this.datasets.filter(n=>(n.name||"").toLowerCase().includes(t)||(n.description||"").toLowerCase().includes(t)||(n.ownerName||"").toLowerCase().includes(t)):this.datasets.slice()}selectDataset(t){this.selectedDataset=t}confirm(){const t=this.buildResult();t&&this._ref.close(t)}cancel(){this._ref.close(null)}canConfirm(){return 0===this.activeTab?!!this.selectedElement?.id:!!this.selectedDataset?.dataSetId}buildResult(){return 0===this.activeTab?this.selectedElement?.id?{type:"element",elementId:this.selectedElement.id,displayName:this.selectedElement.name}:null:this.selectedDataset?.dataSetId?{type:"dataset",dataSetId:this.selectedDataset.dataSetId,renderMode:this.renderMode,displayName:this.selectedDataset.name}:null}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(It.Pw),e.rXU(It.sb),e.rXU(q.Gf),e.rXU(Ye.F))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-select-form-data-source-dialog"]],decls:30,vars:16,consts:[["elementAutocomplete",""],[1,"picker-dialog"],[3,"activeIndexChange","activeIndex"],["header","Element"],[1,"picker-tab"],["for","elementSearch",1,"label","label_bold"],[1,"inputCont","inputCont_iconLeft"],["field","name","inputId","elementSearch","styleClass","searchAdd
1Input searchAddInput_full","placeholder","Search elements","emptyMessage","No elements found",3,"completeMethod","onSelect","suggestions","minLength","completeOnFocus","formControl","delay"],[1,"iconLeft","mdi","mdi-magnify"],["class","picker-selection",4,"ngIf"],["header","Dataset"],["for","datasetSearch",1,"label","label_bold"],["id","datasetSearch","type","text","pInputText","","placeholder","Search datasets",1,"searchAddInput","searchAddInput_full",3,"ngModelChange","ngModel"],["class","picker-status",4,"ngIf"],["class","picker-status picker-status_error",4,"ngIf"],["class","picker-list",4,"ngIf"],["class","picker-render-mode",4,"ngIf"],[1,"modalFoot","marginTop_1"],["type","button",1,"button","button_outline",3,"click"],["type","button",1,"button","button_colorSuccess",3,"click","disabled"],[1,"mdi","mdi-check"],[1,"picker-selection"],[1,"mdi","mdi-check-circle"],[1,"picker-status"],["type","pulsing","size","small"],[1,"picker-status","picker-status_error"],[1,"mdi","mdi-alert-circle-outline"],[1,"picker-list"],["class","picker-list__item",3,"picker-list__item_selected","click",4,"ngFor","ngForOf"],[1,"picker-list__item",3,"click"],[1,"picker-list__title"],[1,"picker-list__meta"],[4,"ngIf"],["class","picker-list__owner",4,"ngIf"],[1,"picker-list__owner"],[1,"picker-render-mode"],[1,"label","label_bold"],[1,"picker-render-mode__options"],["class","picker-render-mode__option",4,"ngFor","ngForOf"],[1,"picker-render-mode__option"],["type","radio","name","renderMode",3,"ngModelChange","value","ngModel"]],template:function(n,o){if(1&n){const r=e.RV6();e.j41(0,"div",1)(1,"p-tabView",2),e.bIt("activeIndexChange",function(c){return e.eBV(r),e.Njj(o.onTabChange(c))}),e.j41(2,"p-tabPanel",3)(3,"div",4)(4,"label",5),e.EFF(5,"Element"),e.k0s(),e.j41(6,"div",6)(7,"p-autoComplete",7,0),e.nI1(9,"async"),e.bIt("completeMethod",function(c){return e.eBV(r),e.Njj(o.searchElements(c))})("onSelect",function(c){return e.eBV(r),e.Njj(o.selectElement(c))}),e.k0s(),e.nrm(10,"i",8),e.k0s(),e.DNE(11,Xw,5,1,"p",9),e.k0s()(),e.j41(12,"p-tabPanel",10)(13,"div",4)(14,"label",11),e.EFF(15,"Dataset"),e.k0s(),e.j41(16,"div",6)(17,"input",12),e.mxI("ngModelChange",function(c){return e.eBV(r),e.DH7(o.datasetFilter,c)||(o.datasetFilter=c),e.Njj(c)}),e.bIt("ngModelChange",function(){return e.eBV(r),e.Njj(o.onDatasetFilterChange())}),e.k0s(),e.nrm(18,"i",8),e.k0s(),e.DNE(19,Ww,4,0,"div",13)(20,zw,3,1,"div",14)(21,Kw,2,0,"div",13)(22,Zw,2,1,"ul",15)(23,tD,5,1,"div",16),e.k0s()()(),e.j41(24,"div",17)(25,"button",18),e.bIt("click",function(){return e.eBV(r),e.Njj(o.cancel())}),e.EFF(26," Cancel "),e.k0s(),e.j41(27,"button",19),e.bIt("click",function(){return e.eBV(r),e.Njj(o.confirm())}),e.nrm(28,"i",20),e.EFF(29," Use data source "),e.k0s()()()}2&n&&(e.R7$(),e.Y8G("activeIndex",o.activeTab),e.R7$(6),e.Y8G("suggestions",e.bMT(9,14,o.elementSuggestions$))("minLength",0)("completeOnFocus",!0)("formControl",o.elementSearchCtrl)("delay",250),e.R7$(4),e.Y8G("ngIf",o.selectedElement),e.R7$(6),e.R50("ngModel",o.datasetFilter),e.R7$(2),e.Y8G("ngIf",o.datasetsLoading),e.R7$(),e.Y8G("ngIf",!o.datasetsLoading&&o.datasetsError),e.R7$(),e.Y8G("ngIf",!o.datasetsLoading&&!o.datasetsError&&0===o.filteredDatasets.length),e.R7$(),e.Y8G("ngIf",!o.datasetsLoading&&o.filteredDatasets.length>0),e.R7$(),e.Y8G("ngIf",o.selectedDataset),e.R7$(4),e.Y8G("disabled",!o.canConfirm()))},dependencies:[M.Sq,M.bT,R.me,R.Fm,R.BC,R.vS,R.l_,ft.j9,_e.S,On.JQ,On.Kp,ee.C3,ze.VU,M.Jj],styles:[".picker-dialog[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.picker-tab[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding-top:.5rem}.picker-selection[_ngcontent-%COMP%]{margin:0;color:var(--color-success, #2e7d32);display:flex;align-items:center;gap:.35rem}.picker-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;color:var(--color-muted, #6b7280);padding:.5rem 0}.picker-status_error[_ngcontent-%COMP%]{color:var(--color-danger, #c62828)}.picker-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;max-height:240px;overflow-y:auto;border:1px solid var(--color-border, #e5e7eb);border-radius:4px}.picker-list__item[_ngcontent-%COMP%]{padding:.6rem .75rem;border-bottom:1px solid var(--color-border, #e5e7eb);cursor:pointer;transition:background .12s ease}.picker-list__item[_ngcontent-%COMP%]:last-child{border-bottom:none}.picker-list__item[_ngcontent-%COMP%]:hover{background:var(--color-hover, #f3f4f6)}.picker-list__item_selected[_ngcontent-%COMP%], .picker-list__item_selected[_ngcontent-%COMP%]:hover{background:var(--color-primary-soft, #e3f2fd)}.picker-list__title[_ngcontent-%COMP%]{font-weight:600;margin-bottom:.15rem}.picker-list__meta[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-muted, #6b7280);display:flex;gap:.75rem}.picker-list__owner[_ngcontent-%COMP%]{color:var(--color-muted, #6b7280);font-style:italic}.picker-render-mode[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.35rem}.picker-render-mode__options[_ngcontent-%COMP%]{display:flex;gap:1rem;flex-wrap:wrap}.picker-render-mode__option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.35rem;cursor:pointer}"]})}}return i})();const iD=["viewerHost"],oD=()=>({width:"80vw",height:"85vh"});function rD(i,a){if(1&i&&(e.j41(0,"div",6)(1,"span",7),e.EFF(2),e.k0s()()),2&i){const t=e.XpG();e.R7$(2),e.JRh(null==t.form?null:t.form.name)}}function aD(i,a){1&i&&e.nrm(0,"div",8,0)}function sD(i,a){if(1&i&&(e.j41(0,"div",9),e.nrm(1,"i",10),e.j41(2,"p"),e.EFF(3),e.k0s()()),2&i){const t=e.XpG();e.R7$(3),e.JRh(t.viewerError)}}function lD(i,a){1&i&&(e.j41(0,"div",9),e.nrm(1,"i",11),e.j41(2,"p"),e.EFF(3,"No preview available. The form may not have a design definition yet."),e.k0s()())}let dD=(()=>{class i{constructor(t,n,o,r){this._messagingService=t,this._configService=n,this._jwtService=o,this._ngZone=r,this.form=null,this.visible=!1,this.closed=new e.bkB,this.viewerServiceUrl="",this.viewerMounted=!1,this.viewerError="",this._viewer
1ServiceBase="",this._viewerInstance=null,this._initTimeoutId=null,this._viewerServiceBase=`${this._configService.appConfig.apiElement}api/form-builder/viewer`,this.viewerServiceUrl=`${this._viewerServiceBase}/`}ngOnChanges(t){t.visible&&(this.visible&&this.form?(this.viewerError="",this.viewerMounted=!0,this._initTimeoutId=window.setTimeout(()=>{this._initTimeoutId=null,this.initViewer()},0)):this.visible||this.destroyViewer())}ngOnDestroy(){this.destroyViewer()}onClose(){this.destroyViewer(),this.closed.emit()}initViewer(){var t=this;return(0,zu.A)(function*(){if(!t.visible||!t.viewerMounted||!t.form)return;const n=`${t._viewerServiceBase}/resources/js/telerikReportViewer`;try{yield Do(n,()=>!!($&&$.fn&&$.fn.telerik_ReportViewer))}catch(s){return t.viewerError="Failed to load the Telerik Report Viewer scripts.",void console.error("Failed to load viewer script:",s)}if(!t.visible||!t.viewerMounted)return;const o=t.viewerHostRef?.nativeElement;if(o)if($&&$.fn.telerik_ReportViewer)try{t._viewerInstance=$(o).telerik_ReportViewer({serviceUrl:t.viewerServiceUrl,reportSource:{report:`${t.form.id}.trdp`,parameters:{}},authenticationToken:t._jwtService.getToken()||"",viewMode:"INTERACTIVE",scaleMode:"SPECIFIC",scale:1,pageMode:"CONTINUOUS_SCROLL",persistSession:!1,error:(s,c)=>{t._ngZone.run(()=>{console.error("Report Viewer error:",c),t._messagingService.error("string"==typeof c?c:"Failed to render form preview","Error")})}}).data("telerik_ReportViewer")}catch(s){t.viewerError="Failed to initialize the Telerik Report Viewer widget.",console.error("Viewer init error:",s)}else t.viewerError="The Telerik Report Viewer widget failed to initialize."})()}destroyViewer(){null!==this._initTimeoutId&&(clearTimeout(this._initTimeoutId),this._initTimeoutId=null);const t=this._viewerInstance;if(t?.dispose)try{t.dispose()}catch{}this.viewerHostRef?.nativeElement&&$(this.viewerHostRef.nativeElement).empty(),this._viewerInstance=null,this.viewerMounted=!1}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(q.Ui),e.rXU(q.we),e.rXU(q.bT),e.rXU(e.SKi))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-form-preview-dialog"]],viewQuery:function(n,o){if(1&n&&e.GBs(iD,5),2&n){let r;e.mGM(r=e.lsd())&&(o.viewerHostRef=r.first)}},inputs:{form:"form",visible:"visible"},outputs:{closed:"closed"},features:[e.OA$],decls:6,vars:9,consts:[["viewerHost",""],["header","Form Preview",3,"visibleChange","onHide","visible","modal","maximizable"],["pTemplate","header"],[1,"preview-body"],["class","viewer-host",4,"ngIf"],["class","empty-state",4,"ngIf"],[1,"preview-header"],[1,"title"],[1,"viewer-host"],[1,"empty-state"],[1,"mdi","mdi-alert-circle-outline"],[1,"mdi","mdi-file-document-outline"]],template:function(n,o){1&n&&(e.j41(0,"p-dialog",1),e.mxI("visibleChange",function(s){return e.DH7(o.visible,s)||(o.visible=s),s}),e.bIt("onHide",function(){return o.onClose()}),e.DNE(1,rD,3,1,"ng-template",2),e.j41(2,"div",3),e.DNE(3,aD,2,0,"div",4)(4,sD,4,1,"div",5)(5,lD,4,0,"div",5),e.k0s()()),2&n&&(e.Aen(e.lJ4(8,oD)),e.R50("visible",o.visible),e.Y8G("modal",!0)("maximizable",!0),e.R7$(3),e.Y8G("ngIf",o.viewerMounted&&!o.viewerError),e.R7$(),e.Y8G("ngIf",o.viewerError),e.R7$(),e.Y8G("ngIf",!o.viewerMounted&&!o.viewerError))},dependencies:[M.bT,ke.Ei,_t.l],styles:[".preview-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;width:100%}.preview-header[_ngcontent-%COMP%]   .title[_ngcontent-%COMP%]{font-size:16px;font-weight:600;color:#000}.preview-header[_ngcontent-%COMP%]   .preview-actions[_ngcontent-%COMP%]{display:flex;gap:4px;margin-left:auto}.preview-body[_ngcontent-%COMP%]{height:calc(85vh - 120px);display:flex;flex-direction:column}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:16px;color:#7b7b7b}.pdf-viewer[_ngcontent-%COMP%]{width:100%;flex:1;border:none}.viewer-host[_ngcontent-%COMP%]{flex:1;min-height:0;position:relative}.empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;color:#7b7b7b}.empty-state[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:48px;color:#dedede;margin-bottom:16px}.empty-state[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{max-width:400px;text-align:center;line-height:1.5}"]})}}return i})();const cD=["designerHost"];function pD(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"h2",19),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.editingName=!0)}),e.EFF(2),e.k0s(),e.nrm(3,"p-tag",20),e.bVm()}if(2&i){const t=e.XpG();e.R7$(2),e.JRh(t.form.name),e.R7$(),e.Y8G("value",t.isPublished?"Published":"Draft")("severity",t.isPublished?"success":"warning")}}function uD(i,a){if(1&i){const t=e.RV6();e.qex(0),e.j41(1,"input",21),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.editName,o)||(r.editName=o),e.Njj(o)}),e.k0s(),e.j41(2,"input",22),e.mxI("ngModelChange",function(o){e.eBV(t);const r=e.XpG();return e.DH7(r.editDescription,o)||(r.editDescription=o),e.Njj(o)}),e.k0s(),e.j41(3,"button",23),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onSaveName())}),e.nrm(4,"i",24),e.k0s(),e.j41(5,"button",25),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onCancelEditName())}),e.nrm(6,"i",26),e.k0s(),e.bVm()}if(2&i){const t=e.XpG();e.R7$(),e.R50("ngModel",t.editName),e.R7$(),e.R50("ngModel",t.editDescription)}}function _D(i,a){1&i&&(e.qex(0),e.nrm(1,"i",29),e.EFF(2," Saving\u2026 "),e.bVm())}function mD(i,a){if(1&i&&(e.qex(0),e.nrm(1,"i",30),e.EFF(2),e.nI1(3,"date"),e.bVm()),2&i){const t=e.XpG(2);e.R7$(2),e.SpI(" Saved ",e.i5U(3,1,t.lastSavedAt,"HH:mm")," ")}}function gD(i,a){1&i&&(e.qex(0),e.nrm(1,"i",31),e.EFF(2," Save failed "),e.bVm())}function hD(i,a){if(1&i&&(e.j41(0,"span",27),e.DNE(1,_D,3,0,"ng-container",28)(2,mD,4,4,"ng-container",28)(3,gD,3,0,"ng-container",28),e.k0s()),2&i){const t=e.XpG();e.AVh("autosave-chip_error","error"===t.autosaveStatus),e.Y8G("ngSwitch",t.autosaveStatus),e.R7$(),e.Y8G("ngSwitchCase","saving"),e.R7$(),e.Y8G("ngSwitchCase","saved"),e.R7$(),e.Y8G("ngSwitchCase","error")}}function fD(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",32),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onPublish())}),e.nrm(1,"i",33),e.EFF(2," Publish "),e.k0s()}}function CD(i,a){if(1&i){const t=e.RV6();e.j41(0,"button",34),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.onUnpublish())}),e.nrm(1,"i",35),e.EFF(2," Unpublish "),e.k0s()}}function vD(i,a){if(1&i){const t=e.RV6();e.qex(0),e.nrm(1,"p-tag",40),e.j41(2,"button",41),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onPickDataSource())}),e.nrm(3,"i",42),e.EFF(4," Change "),e.k0s(),e.j41(5,"button",43),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onClearDataSource())}),e.nrm(6,"i",44),e.EFF(7," Clear "),e.k0s(),e.bVm()}if(2&i){const t=e.XpG(2);e.R7$(),e.Y8G("value",t.dataSourceBadge)}}function bD(i,a){if(1&i){const t=e.RV6();e.j41(0,"span",45),e.EFF(1,"No data source bound"),e.k0s(),e.j41(2,"button",46),e.bIt("click",function(){e.eBV(t);const o=e.XpG(2);return e.Njj(o.onPickDataSource())}),e.nrm(3,"i",47),e.EFF(4," Pick Data Source "),e.k0s()}}
1function TD(i,a){if(1&i&&(e.j41(0,"div",36)(1,"div",37)(2,"span",38),e.EFF(3,"Data Source:"),e.k0s(),e.DNE(4,vD,8,1,"ng-container",39)(5,bD,5,0,"ng-template",null,0,e.C5r),e.k0s()()),2&i){const t=e.sdS(6),n=e.XpG();e.R7$(4),e.Y8G("ngIf",n.hasDataSource)("ngIfElse",t)}}function ED(i,a){1&i&&(e.j41(0,"div",48),e.nrm(1,"kendo-loader",49),e.j41(2,"span"),e.EFF(3,"Loading form designer..."),e.k0s()())}function SD(i,a){if(1&i&&(e.j41(0,"div",50),e.nrm(1,"i",31),e.j41(2,"p"),e.EFF(3),e.k0s(),e.j41(4,"div",51),e.nrm(5,"p-tag",52),e.j41(6,"code"),e.EFF(7),e.k0s()()()),2&i){const t=e.XpG();e.R7$(3),e.JRh(t.designerError),e.R7$(4),e.JRh(t.designerServiceUrl)}}function kD(i,a){1&i&&e.nrm(0,"div",53,1)}let RD=(()=>{class i{static{this._authHeadersInstalled=!1}static{this.AUTOSAVE_POLL_MS=2e3}static{this.AUTOSAVE_INFLIGHT_TIMEOUT_MS=6e3}constructor(t,n,o,r,s,c,u,g){this._route=t,this._router=n,this._apiService=o,this._messagingService=r,this._configService=s,this._jwtService=c,this._dialogService=u,this._ngZone=g,this._destroyed$=new ue.B7,this._designerInstance=null,this._toolboxObserver=null,this._uiRestrictionStyle=null,this.form=null,this.loading=!0,this.designerReady=!1,this.designerError="",this.designerMounted=!0,this.designerServiceUrl="",this.viewerServiceUrl="",this.editingName=!1,this.editName="",this.editDescription="",this.showPreview=!1,this._autosavePollSub=null,this._autosaveSaveInFlight=!1,this._autosaveSaveStartedAt=null,this._autosaveSaveCmd=null,this._autosaveMissingWarned=!1,this.autosaveStatus="idle",this.lastSavedAt=null;const b=this._configService.appConfig.apiElement;this.designerServiceUrl=`${b}api/form-builder/designer`,this.viewerServiceUrl=`${b}api/form-builder/viewer`}ngOnInit(){this._route.params.pipe((0,L.Q)(this._destroyed$)).subscribe(t=>{const n=+t.id;if(!n||n===this.formId)return;const o=!this.formId;this.formId=n,this.loadForm(o)})}ngOnDestroy(){this._destroyed$.next(),this._destroyed$.complete(),this.destroyDesigner()}loadForm(t=!0){this.loading=!0,this._apiService.getFormById(this.formId).pipe((0,L.Q)(this._destroyed$)).subscribe({next:n=>{this.form=n,this.editName=n.name,this.editDescription=n.description,this.loading=!1,t?this.initDesigner():this.reinitializeDesigner()},error:n=>{this._messagingService.error("Failed to load form","Error"),console.error("Error loading form:",n),this.loading=!1}})}get hasDataSource(){return!(!this.form?.dataSourceElementId&&!this.form?.dataSourceDataSetId)}renderModeLabel(t){switch(t){case Ue.D7.Tabular:return"Tabular";case Ue.D7.FilteredTabular:return"Related rows";default:return"Single-row"}}get dataSourceBadge(){return this.form?this.form.dataSourceElementId?this.form.dataSourceElementName||`Element #${this.form.dataSourceElementId}`:this.form.dataSourceDataSetId?`${this.form.dataSourceDataSetName||"Dataset"} \xb7 ${this.renderModeLabel(this.form.renderMode)}`:"":""}onPickDataSource(){this._dialogService.open(nD,{header:"Select data source",width:"640px",data:{initial:this.form?.dataSourceDataSetId?{type:"dataset",dataSetId:this.form.dataSourceDataSetId,renderMode:this.form.renderMode,displayName:this.form.dataSourceDataSetName||""}:this.form?.dataSourceElementId?{type:"element",elementId:this.form.dataSourceElementId,displayName:this.form.dataSourceElementName||""}:null}}).onClose.pipe((0,O.s)(1),(0,L.Q)(this._destroyed$)).subscribe(o=>{o&&this.persistDataSource(o)})}onClearDataSource(){this.hasDataSource&&this.persistDataSource(null)}persistDataSource(t){const n=this.toSetRequest(t);this._apiService.setFormDataSource(this.formId,n).pipe((0,L.Q)(this._destroyed$)).subscribe({next:o=>{this.form=o,this.reinitializeDesigner(),this._messagingService.success(t?"Data source updated":"Data source cleared","Success")},error:o=>{this._messagingService.error("Failed to update data source","Error"),console.error("Error updating data source:",o)}})}
1toSetRequest(t){return t?"element"===t.type?{type:Ue.KV.Element,elementId:t.elementId??null}:{type:Ue.KV.DataSet,dataSetId:t.dataSetId??null,renderMode:t.renderMode??Ue.D7.SingleRow}:{type:Ue.KV.None}}reinitializeDesigner(){this.form&&(this.destroyDesigner(),this.designerReady=!1,this.designerMounted=!1,setTimeout(()=>{this.designerMounted=!0,setTimeout(()=>this.createDesignerWidget(),50)},0))}initDesigner(){var t=this;return(0,zu.A)(function*(){try{yield t.loadDesignerScripts(),t.setupAuthHeaders(),setTimeout(()=>t.createDesignerWidget(),100)}catch(n){t.designerError="Failed to load the Telerik Report Designer scripts. Ensure the backend designer service is running.",console.error("Failed to load designer scripts:",n)}})()}setupAuthHeaders(){if(i._authHeadersInstalled)return;i._authHeadersInstalled=!0;const t=()=>this._jwtService.getToken();$&&$.ajaxPrefilter&&$.ajaxPrefilter((o,r,s)=>{if(o.url&&(o.url.includes("form-builder/designer")||o.url.includes("form-builder/viewer"))){const c=t();c&&s.setRequestHeader("Authorization",`Bearer ${c}`)}});const n=window.fetch.bind(window);window.fetch=(o,r)=>{const s="string"==typeof o?o:o instanceof Request?o.url:o.toString();if(s.includes("form-builder/designer")||s.includes("form-builder/viewer")){const c=t();c&&((r=r||{}).headers=new Headers(r.headers||{}),r.headers.set("Authorization",`Bearer ${c}`))}return n(o,r)}}loadDesignerScripts(){const r=`${this.designerServiceUrl}/designerresources/js/webReportDesigner`;return Do(`${this.viewerServiceUrl}/resources/js/telerikReportViewer`,()=>!!($&&$.fn&&$.fn.telerik_ReportViewer)).then(()=>Do("assets/kendo/kendo.all.min.js",()=>!!window.kendo)).then(()=>Do("assets/kendo/telerik-license.js")).then(()=>Do(r,()=>!!($&&$.fn&&$.fn.telerik_WebReportDesigner)))}createDesignerWidget(){if(!this.designerHostRef||!this.form)return;const t=this.designerHostRef.nativeElement;if(!$||!$.fn.telerik_WebReportDesigner)return void(this.designerError="The Telerik Report Designer widget failed to load. Check that the backend designer service is running.");const n=`${this.formId}.trdp`;try{localStorage.setItem("LastOpenedReport",n),localStorage.setItem("RecentReports",JSON.stringify([n])),localStorage.setItem("PreviouslyOpenedReports",JSON.stringify([n]))}catch{}try{this._designerInstance=$(t).telerik_WebReportDesigner({serviceUrl:this.designerServiceUrl,report:n,persistSession:!1,startMode:"design",toolboxArea:{layout:"list"},skipOnboarding:!0,skipCollectingUsageDataPrompt:!0,promptOnDiscardingModifiedReport:!0,reportViewerOptions:{serviceUrl:this.viewerServiceUrl,scaleMode:"SPECIFIC",scale:1,viewMode:"INTERACTIVE",pageMode:"CONTINUOUS_SCROLL"},notificationShowing:(o,r)=>{"success"===r?.type&&(r.cancel=!0)},error:(o,r)=>{this._ngZone.run(()=>{this._autosaveSaveInFlight&&(this._autosaveSaveInFlight=!1,this.autosaveStatus="error"),console.error("Report Designer error:",r.message,r.error),this._messagingService.error(r.message||"Designer error","Error")})}}).data("telerik_WebReportDesigner"),this.designerReady=!0,this.applyDesignerUiRestrictions(t),this.startAutosave()}catch(o){this.designerError="Failed to initialize the Telerik Report Designer widget.",console.error("Designer init error:",o)}}applyDesignerUiRestrictions(t){this.installUiRestrictionStyles();const n=()=>this.hideDataSourcesToolboxGroup(t);n(),this._toolboxObserver?.disconnect(),this._toolboxObserver=new MutationObserver(()=>n()),this._toolboxObserver.observe(t,{childList:!0,subtree:!0})}hideDataSourcesToolboxGroup(t){$(t).find(".k-panelbar .k-link, .k-panelbar .k-header").each(function(){"Data Sources"===$(this).text().trim()&&$(this).closest(".k-panelbar-item, .k-item").hide()})}installUiRestrictionStyles(){if(this._uiRestrictionStyle)return;const t=document.createElement("style");t.setAttribute("data-cad-form-designer-restrictions",""),t.textContent='\n      .k-menu-popup [data-action="documentSaveAs"] { display: none !important; }\n      .twd-top-menu-area { display: none !important; }\n      .k-treeview-item:has(> div > .k-treeview-leaf > [data-text="[Shared Data Sources]"]) { display: none !important; }\n    ',document.head.appendChild(t),this._uiRestrictionStyle=t}removeUiRestrictionStyles(){this._uiRestrictionStyle?.remove(),this._uiRestrictionStyle=null}destroyDesigner(){this.stopAutosave(),this.autosaveStatus="idle",this._autosaveSaveInFlight=!1,this._autosaveSaveStartedAt=null,this._toolboxObserver?.disconnect(),this._toolboxObserver=null,this.removeUiRestrictionStyles();const t=this._designerInstance;
1if(t?.Dispose)try{t.Dispose()}catch{}else if(t?.dispose)try{t.dispose()}catch{}this.designerHostRef&&$(this.designerHostRef.nativeElement).empty(),this._designerInstance=null}startAutosave(){this.stopAutosave(),this._autosaveSaveCmd=null,this._autosaveMissingWarned=!1,this._autosavePollSub=(0,Fe.Y)(i.AUTOSAVE_POLL_MS).pipe((0,L.Q)(this._destroyed$)).subscribe(()=>this.autosaveTick())}stopAutosave(){this._autosavePollSub?.unsubscribe(),this._autosavePollSub=null,this._autosaveSaveCmd=null}resolveSaveCommand(){const t=this._designerInstance;if(!t)return null;const n=s=>!!s&&"function"==typeof s.enabled&&"function"==typeof s.exec,o=s=>{if(!s)return null;const c=["save","documentSave","saveReport"];for(const u of c)if(n(s[u]))return s[u];for(const u of Object.keys(s))if(/save/i.test(u)&&!/saveas/i.test(u)&&n(s[u]))return s[u];return null},r=[t,t.controller,t.api,t.model,t.reportViewer];for(const s of r){const c=o(s?.commands);if(c)return c}return"function"==typeof t.save?{enabled:"function"==typeof t.isDirty?()=>!!t.isDirty():"function"==typeof t.isModified?()=>!!t.isModified():()=>!0,exec:()=>t.save()}:null}resolveSaveButtonFallback(){const t=this.designerHostRef?.nativeElement;if(!t)return null;const n=()=>t.querySelector('[data-action="documentSave"]');return n()?{enabled:()=>{const o=n();return!!o&&!(o.classList.contains("k-state-disabled")||o.classList.contains("k-disabled")||"true"===o.getAttribute("aria-disabled"))},exec:()=>n()?.click()}:null}autosaveTick(){if(!this._designerInstance)return;this._autosaveSaveCmd||(this._autosaveSaveCmd=this.resolveSaveCommand()||this.resolveSaveButtonFallback());const t=this._autosaveSaveCmd;if(!t){if(!this._autosaveMissingWarned){this._autosaveMissingWarned=!0;const o=this._designerInstance,r=this.designerHostRef?.nativeElement;console.warn("[autosave] could not resolve a save command on the Telerik widget.","instance keys:",Object.keys(o),"| commands:",o.commands?Object.keys(o.commands):[],"| save button in host:",!!r?.querySelector('[data-action="documentSave"]'))}return}const n=!!t.enabled();if(this._autosaveSaveInFlight)return n?void(Date.now()-(this._autosaveSaveStartedAt??Date.now())>=i.AUTOSAVE_INFLIGHT_TIMEOUT_MS&&(this._autosaveSaveInFlight=!1,this._autosaveSaveStartedAt=null,this._ngZone.run(()=>{this.autosaveStatus="saved",this.lastSavedAt=new Date}))):(this._autosaveSaveInFlight=!1,this._autosaveSaveStartedAt=null,void this._ngZone.run(()=>{this.autosaveStatus="saved",this.lastSavedAt=new Date}));if(n){this._autosaveSaveInFlight=!0,this._autosaveSaveStartedAt=Date.now(),this._ngZone.run(()=>{this.autosaveStatus="saving"});try{t.exec()}catch(o){this._autosaveSaveInFlight=!1,this._autosaveSaveStartedAt=null,this._ngZone.run(()=>{this.autosaveStatus="error"}),console.error("Autosave exec failed:",o)}}}onBack(){this._router.navigate(["/private/ad-hoc-reports"],{queryParams:{tab:3}})}onSaveName(){this.form&&this._apiService.updateForm(this.formId,{name:this.editName,description:this.editDescription}).pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.form=t,this.editingName=!1,this._messagingService.success("Form updated","Success")},error:t=>{this._messagingService.error("Failed to update form","Error"),console.error("Error updating form:",t)}})}onCancelEditName(){this.form&&(this.editName=this.form.name,this.editDescription=this.form.description),this.editingName=!1}onPublish(){this.form&&this._apiService.updateForm(this.formId,{status:Ue.HB.Published}).pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.form=t,this._messagingService.success("Form published","Success")},error:t=>{this._messagingService.error("Failed to publish form","Error"),console.error("Error publishing form:",t)}})}onUnpublish(){this.form&&this._apiService.updateForm(this.formId,{status:Ue.HB.Draft}).pipe((0,L.Q)(this._destroyed$)).subscribe({next:t=>{this.form=t,this._messagingService.success("Form reverted to draft","Success")},error:t=>{this._messagingService.error("Failed to update form status","Error"),console.error("Error updating form status:",t)}})}onPreview(){this.showPreview=!0}onPreviewClosed(){this.showPreview=!1}get isPublished(){return this.form?.status===Ue.HB.Published}static{this.\u0275fac=function(n){return new(n||i)(e.rXU(ge.nX),e.rXU(ge.Ix),e.rXU(Ye.F),e.rXU(q.Ui),e.rXU(q.we),e.rXU(q.bT),e.rXU(It.o3),e.rXU(e.SKi))}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["cad-form-designer"]],viewQuery:function(n,o){if(1&n&&e.GBs(cD,5),2&n){let r;e.mGM(r=e.lsd())&&(o.designerHostRef=r.first)}},decls:19,vars:11,consts:[["noDataSource",""],["designerHost",""],[1,"form-designer-container"],[1,"designer-header"],[1,"header-left"],["type","button","title","Back to Forms","pTooltip","Back to Forms",1,"button","button_round",3,"click"],[1,"mdi","mdi-arrow-left"],[4,"ngIf"],[1,"header-actions"],["class","autosave-chip",3,"autosave-chip_error","ngSwitch",4,"ngIf"],["type","button","title","Preview","pTooltip","Preview PDF",1,"button",3,"click"],[1,"mdi","mdi-eye","buttonIcon_right"],["type","button","title","Publish","class","button button_colorSuccess",3,"click",4,"ngIf"],["type","button","title","Unpublish","class","button button_colorWarning",3,"click",4,"ngIf"],["class","datasource-panel",4,"ngIf"],["class","loading-container",4,"ngIf"],["class","error-container",4,"ngIf"],["class","designer-body",4,"ngIf"],[3,"closed","form","visible"],[1,"form-title",3,"click"],[3,"value","severity"],["type","text","pInputText","","placeholder","Form name",1,"name-input",3,"ngModelChange","ngModel"],["type","text","pInputText","","placeholder","Description (optional)",1,"description-input",3,"ngModelChange","ngModel"],["type","button","title","Save",1,"button","button_colorSuccess","button_round",3,"click"],[1,"mdi","mdi-check"],["type","button","title","Cancel",1,"button","button_round",3,"click"],[1,"mdi","mdi-close"],[1,"autosave-chip",3,"ngSwitch"],[4,"ngSwitchCase"],[1,"mdi","mdi-cloud-upload-outline"],[1,"mdi","mdi-cloud-check-outline"],[1,"mdi","mdi-alert-circle-outline"],["type","button","title","Publish",1,"button","button_colorSuccess",3,"click"],[1,"mdi","mdi-publish","buttonIcon_right"],["type","button","title","Unpublish",1,"button","button_colorWarning",3,"click"],[1,"mdi","mdi-undo","buttonIcon_right"],[1,"datasource-panel"],[1,"datasource-panel__main"],[1,"datasource-panel__label"],[4,"ngIf","ngIfElse"],["severity","info",3,"value"],["type","button","pTooltip","Change data source",1,"button","button_sm",3,"click"],[1,"mdi","mdi-swap-horizontal","buttonIcon_right"],["type","button","pTooltip","Clear data source",1,"button","button_sm","button_colorWarning",3,"click"],[1,"mdi","mdi-close","buttonIcon_right"],[1,"datasource-panel__empty"],["type","button","pTooltip","Pick an element or dataset as the data source",1,"button","button_sm","button_colorPrimary",3,"click"],[1,"mdi","mdi-link-variant","buttonIcon_right"],[1,"loading-container"],["type","pulsing","size","large"],[1,"error-container"],[1,"service-info"],["value","Designer Service","severity","info"],[1,"designer-body"]],template:function(n,o){1&n&&(e.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"button",5),e.bIt("click",function(){return o.onBack()}),e.nrm(4,"i",6),e.k0s(),e.DNE(5,pD,4,3,"ng-container",7)(6,uD,7,2,"ng-container",7),e.k0s(),e.j41(7,"div",8),e.DNE(8,hD,4,6,"span",9),e.j41(9,"button",10),e.bIt("click",function(){return o.onPreview()}),e.nrm(10,"i",11),e.EFF(11," Preview "),e.k0s(),e.DNE(12,fD,3,0,"button",12)(13,CD,3,0,"button",13),e.k0s()(),e.DNE(14,TD,7,2,"div",14)(15,ED,4,0,"div",15)(16,SD,8,2,"div",16)(17,kD,2,0,"div",17),e.k0s(),e.j41(18,"cad-form-preview-dialog",18),e.bIt("closed",function(){return o.onPreviewClosed()}),e.k0s()),2&n&&(e.R7$(5),e.Y8G("ngIf",!o.editingName&&o.form),e.R7$(),e.Y8G("ngIf",o.editingName),e.R7$(2),e.Y8G("ngIf",o.designerReady&&"idle"!==o.autosaveStatus),e.R7$(4),e.Y8G("ngIf",!o.isPublished),e.R7$(),e.Y8G("ngIf",o.isPublished),e.R7$(),e.Y8G("ngIf",!o.loading&&o.form&&!o.designerError),e.R7$(),e.Y8G("ngIf",o.loading),e.R7$(),e.Y8G("ngIf",!o.loading&&o.designerError),e.R7$(),e.Y8G("ngIf",!o.loading&&o.form&&!o.designerError&&o.designerMounted),e.R7$(),e.Y8G("form",o.form)("visible",o.showPreview))},dependencies:[M.bT,M.ux,M.e1,R.me,R.BC,R.vS,_e.S,Mt.m,ze.VU,ni.v,dD,M.vh],styles:["[_nghost-%COMP%]{display:block;height:100%}.form-designer-container[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column}.designer-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:12px 24px;border-bottom:1px solid #dedede;background:#fff;flex-shrink:0;position:relative;z-index:100}.designer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.designer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .form-title[_ngcontent-%COMP%]{margin:0;font-size:18px;font-weight:600;color:#000;cursor:pointer}.designer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .form-title[_ngcontent-%COMP%]:hover{color:#5f84fc}.designer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .name-input[_ngcontent-%COMP%]{width:250px}.designer-header[_ngcontent-%COMP%]   .header-left[_ngcontent-%COMP%]   .description-input[_ngcontent-%COMP%]{width:300px}.designer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.designer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .autosave-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;font-size:12px;color:#7b7b7b;padding:2px 8px;border-radius:10px;background:#fafafa}.designer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .autosave-chip[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{font-size:14px}.designer-header[_ngcontent-%COMP%]   .header-actions[_ngcontent-%COMP%]   .autosave-chip_error[_ngcontent-%COMP%]{color:#e74
1c3c}.loading-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;gap:16px;color:#7b7b7b}.error-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;text-align:center;padding:40px;color:#7b7b7b}.error-container[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:64px;color:#e74c3c;margin-bottom:16px}.error-container[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 16px;max-width:500px;line-height:1.5}.error-container[_ngcontent-%COMP%]   .service-info[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.error-container[_ngcontent-%COMP%]   .service-info[_ngcontent-%COMP%]   code[_ngcontent-%COMP%]{font-size:13px;background:#fafafa;padding:4px 8px;border-radius:4px;color:#000}.designer-body[_ngcontent-%COMP%]{flex:1;overflow:hidden;position:relative;min-height:0}.datasource-panel[_ngcontent-%COMP%]{padding:10px 24px;border-bottom:1px solid #dedede;background:#fafafa;display:flex;flex-wrap:wrap;align-items:center;gap:16px;flex-shrink:0}.datasource-panel__main[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px}.datasource-panel__label[_ngcontent-%COMP%]{font-weight:600;color:#000}.datasource-panel__empty[_ngcontent-%COMP%]{color:#7b7b7b;font-style:italic}@media (max-width: 768px){.datasource-panel[_ngcontent-%COMP%]{padding:10px 16px;flex-direction:column;align-items:flex-start}}"]})}}return i})();var ID=F(89079),yD=F(2578);function wD(i,a){1&i&&(e.j41(0,"div",3),e.nrm(1,"span",4),e.j41(2,"h2"),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"p"),e.EFF(6),e.nI1(7,"translate"),e.k0s()()),2&i&&(e.R7$(3),e.JRh(e.bMT(4,2,"EXPORT_DOWNLOAD.PREPARING_TITLE")),e.R7$(3),e.JRh(e.bMT(7,4,"EXPORT_DOWNLOAD.PREPARING_MESSAGE")))}function DD(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",3)(1,"h2"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"button",5),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.download())}),e.EFF(8),e.nI1(9,"translate"),e.k0s()()}2&i&&(e.R7$(2),e.JRh(e.bMT(3,3,"EXPORT_DOWNLOAD.DONE_TITLE")),e.R7$(3),e.JRh(e.bMT(6,5,"EXPORT_DOWNLOAD.DONE_MESSAGE")),e.R7$(3),e.SpI(" ",e.bMT(9,7,"EXPORT_DOWNLOAD.DOWNLOAD_AGAIN")," "))}function OD(i,a){if(1&i){const t=e.RV6();e.j41(0,"div",3)(1,"h2"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"p"),e.EFF(5),e.nI1(6,"translate"),e.k0s(),e.j41(7,"button",5),e.bIt("click",function(){e.eBV(t);const o=e.XpG();return e.Njj(o.download())}),e.EFF(8),e.nI1(9,"translate"),e.k0s()()}if(2&i){const t=e.XpG();e.R7$(2),e.JRh(e.bMT(3,3,"EXPORT_DOWNLOAD.FAILED_TITLE")),e.R7$(3),e.JRh(e.bMT(6,5,t.errorKey)),e.R7$(3),e.SpI(" ",e.bMT(9,7,"EXPORT_DOWNLOAD.TRY_AGAIN")," ")}}const xD=[{path:"",component:Gr},{path:"new",component:y},{path:"new/:templateId",component:y},{path:"edit/:reportId",component:y},{path:"view/:reportId",component:vS},{path:"dashboard/new",component:Iu},{path:"dashboard/edit/:reportId",component:Iu},{path:"datagrid/new",component:Bu},{path:"datagrid/edit/:reportId",component:Bu},{path:"calendar/new",component:Xu},{path:"calendar/edit/:reportId",component:Xu},{path:"gantt/new",component:Wu},{path:"gantt/edit/:reportId",component:Wu},{path:"datasets/new",component:Hu},{path:"datasets/edit/:dataSetId",component:Hu},{path:"forms/:id/design",component:RD},{path:"exports/:jobId/download",component:(()=>{class i{constructor(){this.state="downloading",this.errorKey="",this._route=(0,e.WQX)(ge.nX),this._api=(0,e.WQX)(Ye.F),this._messaging=(0,e.WQX)(q.Ui),this._destroyRef=(0,e.WQX)(e.abz)}ngOnInit(){const t=Number(this._route.snapshot.paramMap.get("jobId"));!Number.isInteger(t)||t<=0?this._fail("EXPORT_DOWNLOAD.ERROR_INVALID_LINK"):(this._jobId=t,this.download())}download(){this.state="downloading",this._api.downloadExport(this._jobId).pipe((0,ID.pQ)(this._destroyRef)).subscribe({next:t=>{(0,yD.saveAs)(t,`export-${this._jobId}.xlsx`),this.state="done"},error:t=>this._fail(this._resolveError(t))})}_resolveError(t){const n=t?.status;return 403===n?"EXPORT_DOWNLOAD.ERROR_FORBIDDEN":404===n?"EXPORT_DOW
1NLOAD.ERROR_NOT_FOUND":"EXPORT_DOWNLOAD.ERROR_GENERIC"}_fail(t){this.state="error",this.errorKey=t,this._messaging.error(t,"EXPORT_DOWNLOAD.FAILED_TITLE")}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=e.VBU({type:i,selectors:[["app-export-download"]],decls:5,vars:4,consts:[[1,"export-download"],[3,"ngSwitch"],["class","export-download__status",4,"ngSwitchCase"],[1,"export-download__status"],[1,"k-icon","k-i-loading","export-download__spinner"],["type","button",1,"export-download__btn",3,"click"]],template:function(n,o){1&n&&(e.j41(0,"div",0),e.qex(1,1),e.DNE(2,wD,8,6,"div",2)(3,DD,10,9,"div",2)(4,OD,10,9,"div",2),e.bVm(),e.k0s()),2&n&&(e.R7$(),e.Y8G("ngSwitch",o.state),e.R7$(),e.Y8G("ngSwitchCase","downloading"),e.R7$(),e.Y8G("ngSwitchCase","done"),e.R7$(),e.Y8G("ngSwitchCase","error"))},dependencies:[M.ux,M.e1,nt.D9],styles:[".export-download[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-top:96px;padding:24px}.export-download__status[_ngcontent-%COMP%]{text-align:center;max-width:420px}.export-download__status[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%]{margin:0 0 8px}.export-download__status[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0 0 24px;color:#7b7b7b}.export-download__spinner[_ngcontent-%COMP%]{font-size:40px;margin-bottom:16px}.export-download__btn[_ngcontent-%COMP%]{background-color:#09a564;color:#fff;border:none;border-radius:6px;padding:12px 24px;font-weight:700;cursor:pointer}.export-download__btn[_ngcontent-%COMP%]:hover{background-color:#078a53}"]})}}return i})()}];let MD=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=e.$C({type:i})}static{this.\u0275inj=e.G2t({imports:[ge.iI.forChild(xD),ge.iI]})}}return i})();var FD=F(24486),PD=F(97722);let gO=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[M.MD,ge.iI,Fa.Z,Mt.S,ke.Gg,ge.iI,Mt.S,ke.Gg]})}return i})();var hO=F(52423);let Qu=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[M.MD,ge.iI,Fa.Z,Mt.S,md.D,ke.Gg,ge.iI,Mt.S,ke.Gg]})}return i})();var WO=F(41880);let JO=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[M.MD,Ma.tm,Qu,WO.u,hO.D,Ma.tm,Qu]})}return i})();var qO=F(56296);const Zu={report:null,data:[],metadata:null,pivotConfig:null,loading:!1,executing:!1,error:null};let QO=(()=>{class i{constructor(){this._state$=new gt.t(Zu),this.state$=this._state$.asObservable(),this.STORAGE_KEY="adhoc-report-grid-settings"}get state(){return this._state$.getValue()}get report(){return this.state.report}get data(){return this.state.data}get metadata(){return this.state.metadata}get pivotConfig(){return this.state.pivotConfig}get isLoading(){return this.state.loading}get isExecuting(){return this.state.executing}get error(){return this.state.error}setReport(t){this._state$.next({...this.state,report:t})}setData(t){this._state$.next({...this.state,data:t})}setMetadata(t){this._state$.next({...this.state,metadata:t})}setPivotConfig(t){this._state$.next({...this.state,pivotConfig:t})}setLoading(t){this._state$.next({...this.state,loading:t})}setExecuting(t){this._state$.next({...this.state,executing:t})}setError(t){this._state$.next({...this.state,error:t})}reset(){this._state$.next(Zu)}saveGridSettings(t,n){try{const o=this.getAllGridSettings();o[t]=n,sessionStorage.setItem(this.STORAGE_KEY,JSON.stringify(o))}catch(o){console.error("Error saving grid settings:",o)}}loadGridSettings(t){try{return this.getAllGridSettings()[t]||null}catch(n){return console.error("Error loading grid settings:",n),null}}clearGridSettings(t){try{const n=this.getAllGridSettings();delete n[t],sessionStorage.setItem(this.STORAGE_KEY,JSON.stringify(n))}catch(n){console.error("Error clearing grid settings:",n)}}getAllGridSettings(){try{const t=sessionStorage.getItem(this.STORAGE_KEY);return t?JSON.parse(t):{}}catch{return{}}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=e.jDH({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();const ZO=$e()||cn;window.$=window.jQuery=ZO;let ex=(()=>
vendor: 5,956 bytes, line 1
1{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=e.$C({type:i})}static{this.\u0275inj=e.G2t({providers:[Ye.F,Ar,QO,ke.td,It.o3,bu.I],imports:[M.MD,R.YN,R.X1,cr.G,MD,xt.pc9,xt.GKD,xt.Nq2,xa.Vr,Be.Cp,je.ol,ee.Bo,z.SC,at.ZS,ht.RH,ie.ss,FD.Ss,ze.JX,ht.Jx,qt.mM2,Qt._1,Ie.io,s0,z1,On.fd,Na.bG,_t.P,Re.F,PD.MB,Le.kr,_e.u,mt.f,ui.rO,$a,ni.$,gO,JO,ft.$$,ut.q4,Io.O3,Mt.S,qO.iV,It.k_,RI,Ut.ad]})}}return i})()},51653:function(lr,dr){var M;!function(R,cn){"use strict";"object"==typeof lr.exports?lr.exports=R.document?cn(R,!0):function($e){if(!$e.document)throw new Error("jQuery requires a window with a document");return cn($e)}:cn(R)}(typeof window<"u"?window:this,function(R,cn){"use strict";var $e=[],cr=Object.getPrototypeOf,ge=$e.slice,ue=$e.flat?function(l){return $e.flat.call(l)}:function(l){return $e.concat.apply([],l)},L=$e.push,ne=$e.indexOf,w={},Ue=w.toString,e=w.hasOwnProperty,It=e.toString,Ye=It.call(Object),ce={},q=function(d){return"function"==typeof d&&"number"!=typeof d.nodeType&&"function"!=typeof d.item},Le=function(d){return null!=d&&d===d.window},ee=R.document,Aa={type:!0,src:!0,nonce:!0,noModule:!0};function pr(l,d,p){var _,h,f=(p=p||ee).createElement("script");if(f.text=l,d)for(_ in Aa)(h=d[_]||d.getAttribute&&d.getAttribute(_))&&f.setAttribute(_,h);p.head.appendChild(f).parentNode.removeChild(f)}function pn(l){return null==l?l+"":"object"==typeof l||"function"==typeof l?w[Ue.call(l)]||"object":typeof l}var La=/HTML$/i,m=function(l,d){return new m.fn.init(l,d)};function ke(l){var d=!!l&&"length"in l&&l.length,p=pn(l);return!q(l)&&!Le(l)&&("array"===p||0===d||"number"==typeof d&&d>0&&d-1 in l)}function _e(l,d){return l.nodeName&&l.nodeName.toLowerCase()===d.toLowerCase()}m.fn=m.prototype={jquery:"3.7.1",constructor:m,length:0,toArray:function(){return ge.call(this)},get:function(l){return null==l?ge.call(this):l<0?this[l+this.length]:this[l]},pushStack:function(l){var d=m.merge(this.constructor(),l);return d.prevObject=this,d},each:function(l){return m.each(this,l)},map:function(l){return this.pushStack(m.map(this,function(d,p){return l.call(d,p,d)}))},slice:function(){return this.pushStack(ge.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(m.grep(this,function(l,d){return(d+1)%2}))},odd:function(){return this.pushStack(m.grep(this,function(l,d){return d%2}))},eq:function(l){var d=this.length,p=+l+(l<0?d:0);return this.pushStack(p>=0&&p<d?[this[p]]:[])},end:function(){return this.prevObject||this.constructor()},push:L,sort:$e.sort,splice:$e.splice},m.extend=m.fn.extend=function(){var l,d,p,_,h,f,C=arguments[0]||{},S=1,E=arguments.length,y=!1;for("boolean"==typeof C&&(y=C,C=arguments[S]||{},S++),"object"!=typeof C&&!q(C)&&(C={}),S===E&&(C=this,S--);S<E;S++)if(null!=(l=arguments[S]))for(d in l)_=l[d],"__proto__"!==d&&C!==_&&(y&&_&&(m.isPlainObject(_)||(h=Array.isArray(_)))?(p=C[d],f=h&&!Array.isArray(p)?[]:h||m.isPlainObject(p)?p:{},h=!1,C[d]=m.extend(y,f,_)):void 0!==_&&(C[d]=_));return C},m.extend({expando:"jQuery"+("3.7.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(l){throw new Error(l)},noop:function(){},isPlainObject:function(l){var d,p;return!(!l||"[object Object]"!==Ue.call(l)||(d=cr(l))&&("function"!=typeof(p=e.call(d,"constructor")&&d.constructor)||It.call(p)!==Ye))},isEmptyObject:function(l){var d;for(d in l)return!1;return!0},globalEval:function(l,d,p){pr(l,{nonce:d&&d.nonce},p)},each:function(l,d){var p,_=0;if(ke(l))for(p=l.length;_<p&&!1!==d.call(l[_],_,l[_]);_++);else for(_ in l)if(!1===d.call(l[_],_,l[_]))break;return l},text:function(l){var d,p="",_=0,h=l.nodeType;if(!h)for(;d=l[_++];)p+=m.text(d);return 1===h||11===h?l.textContent:9===h?l.documentElement.textContent:3===h||4===h?l.nodeValue:p},makeArray:function(l,d){var p=d||[];return null!=l&&(ke(Object(l))?m.merge(p,"string"==typeof l?[l]:l):L.call(p,l)),p},inArray:function(l,d,p){return null==d?-1:ne.call(d,l,p)},isXMLDoc:function(l){var p=l&&(l.ownerDocument||l).documentElement;return!La.test(l&&l.namespaceURI||p&&p.nodeName||"HTML")},merge:function(l,d){for(var p=+d.length,_=0,h=l.length;_<p;_++)l[h++]=d[_];return l.length=h,l},grep:function(l,d,p){for(var h=[],f=0,C=l.length,S=!p;f<C;f++)!d(l[f],f)!==S&&h.push(l[f]);return h},map:function(l,d,p){var _,h,f=0,C=[];if(ke(l))for(_=l.length;f<_;f++)null!=(h=d(l[f],f,p))&&C.push(h);else for(f in l)null!=(h=d(l[f],f,p))&&C.push(h);return ue(C)},guid:1,support:ce}),"function"==typeof Symbol&&(m.fn[Symbol.iterator]=$e[Symbol.iterator]),m.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(l,d){w["[object "+d+"]"]=d.toLowerCase()});var On=$e.pop,Mt=$e.sort,ze=$e.splice,Re="[\\x20\\t\\r\\n\\f]",he=new RegExp("^"+Re+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Re+"+$","g");m.contains=function(l,d){var p=d&&d.parentNode;return l===p||!(!p||1!==p.nodeType||!(l.contains?l.contains(p):l.compareDocumentPosition&&16&l.compareDocumentPosition(p)))};var Ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function ja(l,d){return d?"\0"===l?"\ufffd":l.slice(0,-1)+"\\"+l.charCodeAt(l.length-1).toString(16)+" ":"\\"+l}m.escapeSelector=function(l){return(l+"").replace(Ba,ja)};var Nt=ee,Gi=L;!function(){var l,d,p,_,h,C,S,E,y,O,f=Gi,N=m.expando,v=0,A=0,z=He(),me=He(),ie=He(),we=He(),Ne=function(T,I){return T===I&&(h=!0),0},rt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",gt="(?:\\\\[\\da-fA-F]{1,6}"+Re+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",K="\\["+Re+"*("+gt+")(?:"+Re+"*([*^$|!~]?=)"+Re+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+gt+"))|)"+Re+"*\\]",nn=":("+gt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+K+")*)|.*)\\)|)",Ee=new RegExp(Re+"+","g"),Fe=new RegExp("^"+Re+"*,"+Re+"*"),on=new RegExp("^"+Re+"*([>+~]|"+Re+")"+Re+"*"),to=new RegExp(Re+"|>
1"),Oe=new RegExp(nn),Me=new RegExp("^"+gt+"$"),yt={ID:new RegExp("^#("+gt+")"),CLASS:new RegExp("^\\.("+gt+")"),TAG:new RegExp("^("+gt+"|[*])"),ATTR:new RegExp("^"+K),PSEUDO:new RegExp("^"+nn),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Re+"*(even|odd|(([+-]|)(\\d*)n|)"+Re+"*(?:([+-]|)"+Re+"*(\\d+)|))"+Re+"*\\)|)","i"),bool:new RegExp("^(?:"+rt+")$","i"),needsContext:new RegExp("^"+Re+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Re+"*((?:-\\d)?\\d*)"+Re+"*\\)|)(?=[^-]|$)","i")},ae=/^(?:input|select|textarea|button)$/i,Wt=/^h\d$/i,bt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mi=/[+~]/,Lt=new RegExp("\\\\[\\da-fA-F]{1,6}"+Re+"?|\\\\([^\\r\\n\\f])","g"),wt=function(T,I){var x="0x"+T.slice(1)-65536;return I||(x<0?String.fromCharCode(x+65536):String.fromCharCode(x>>10|55296,1023&x|56320))},no=function(){Be()},Wr=dt(function(T){return!0===T.disabled&&_e(T,"fieldset")},{dir:"parentNode",next:"legend"});try{f.apply($e=ge.call(Nt.childNodes),Nt.childNodes)}catch{f={apply:function(I,x){Gi.apply(I,ge.call(x))},call:function(I){Gi.apply(I,ge.call(arguments,1))}}}function Se(T,I,x,P){var G,j,X,Q,W,fe,re,se=I&&I.ownerDocument,Ce=I?I.nodeType:9;if(x=x||[],"string"!=typeof T||!T||1!==Ce&&9!==Ce&&11!==Ce)return x;if(!P&&(Be(I),I=I||C,E)){if(11!==Ce&&(W=bt.exec(T)))if(G=W[1]){if(9===Ce){if(!(X=I.getElementById(G)))return x;if(X.id===G)return f.call(x,X),x}else if(se&&(X=se.getElementById(G))&&Se.contains(I,X)&&X.id===G)return f.call(x,X),x}else{if(W[2])return f.apply(x,I.getElementsByTagName(T)),x;if((G=W[3])&&I.getElementsByClassName)return f.apply(x,I.getElementsByClassName(G)),x}if(!(we[T+" "]||y&&y.test(T))){if(re=T,se=I,1===Ce&&(to.test(T)||on.test(T))){for(((se=mi.test(T)&&at(I.parentNode)||I)!=I||!ce.scope)&&((Q=I.getAttribute("id"))?Q=m.escapeSelector(Q):I.setAttribute("id",Q=N)),j=(fe=Bt(T)).length;j--;)fe[j]=(Q?"#"+Q:":scope")+" "+lt(fe[j]);re=fe.join(",")}try{return f.apply(x,se.querySelectorAll(re)),x}catch{we(T,!0)}finally{Q===N&&I.removeAttribute("id")}}}return zr(T.replace(he,"$1"),I,x,P)}function He(){var T=[];return function I(x,P){return T.push(x+" ")>d.cacheLength&&delete I[T.shift()],I[x+" "]=P}}function Tt(T){return T[N]=!0,T}function de(T){var I=C.createElement("fieldset");try{return!!T(I)}catch{return!1}finally{I.parentNode&&I.parentNode.removeChild(I),I=null}}function Ie(T){return function(I){return _e(I,"input")&&I.type===T}}function Pe(T){return function(I){return(_e(I,"input")||_e(I,"button"))&&I.type===T}}function je(T){return function(I){return"form"in I?I.parentNode&&!1===I.disabled?"label"in I?"label"in I.parentNode?I.parentNode.disabled===T:I.disabled===T:I.isDisabled===T||I.isDisabled!==!T&&Wr(I)===T:I.disabled===T:"label"in I&&I.disabled===T}}function Et(T){return Tt(function(I){return I=+I,Tt(function(x,P){for(var G,j=T([],x.length,I),X=j.length;X--;)x[G=j[X]]&&(x[G]=!(P[G]=x[G]))})})}function at(T){return T&&typeof T.getElementsByTagName<"u"&&T}function Be(T){var I,x=T?T.ownerDocument||T:Nt;return x==C||9!==x.nodeType||!x.documentElement||(S=(C=x).documentElement,E=!m.isXMLDoc(C),O=S.matches||S.webkitMatchesSelector||S.msMatchesSelector,S.msMatchesSelector&&Nt!=C&&(I=C.defaultView)&&I.top!==I&&I.addEventListener("unload",no),ce.getById=de(function(P){return S.appendChild(P).id=m.expando,!C.getElementsByName||!C.getElementsByName(m.expando).length}),ce.disconnectedMatch=de(function(P){return O.call(P,"*")}),ce.scope=de(function(){return C.querySelectorAll(":scope")}),ce.cssHas=de(function(){try{return C.querySelector(":has(*,:jqfake)"),!1}catch{return!0}}),ce.getById?(d.filter.ID=function(P){var G=P.replace(Lt,wt);return function(j){return j.getAttribute("id")===G}},d.find.ID=function(P,G){if(typeof G.getElementById<"u"&&E){var j=G.getElementById(P);return j?[j]:[]}}):(d.filter.ID=function(P){var G=P.replace(Lt,wt);return function(j){var X=typeof j.getAttributeNode<"u"&&j.getAttributeNode("id");return X&&X.value===G}},d.find.ID=function(P,G){if(typeof G.getElementById<"u"&&E){var j,X,Q,W=G.getElementById(P);if(W){if((j=W.getAttributeNode("id"))&&j.value===P)return[W];for(Q=G.getElementsByName(P),X=0;W=Q[X++];)if((j=W.getAttributeNode("id"))&&j.value===P)return[W]}return[]}}),d.find.TAG=function(P,G){return typeof G.getElementsByTagName<"u"?G.getElementsByTagName(P):G.querySelectorAll(P)},d.find.CLASS=function(P,G){if(typeof G.getElementsByClassName<"u"&&E)return G.getElementsByClassName(P)},y=[],de(function(P){var G;S.appendChild(P).innerHTML="<a id='"+N+"' href='' disabled='disabled'></a><select id='"+N+"-\r\\' disabled='disabled'><option selected=''></option></select>",P.querySelectorAll("[selected]").length||y.push("\\["+Re+"*(?:value|"+rt+")"),P.querySelectorAll("[id~="+N+"-]").length||y.push("~="),P.querySelectorAll("a#"+N+"+*").length||y.push(".#.+[+~]"),P.querySelectorAll(":checked").length||y.push(":checked"),(G=C.createElement("input")).setAttribute("type","hidden"),P.appendChild(G).setAttribute("name","D"),S.appendChild(P).disabled=!0,2!==P.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),(G=C.createElement("input")).setAttribute("name",""),P.appendChild(G),P.querySelectorAll("[name='']").length||y.push("\\["+Re+"*name"+Re+"*="+Re+"*(?:''|\"\")")}),ce.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),Ne=function(P,G){if(P===G)return h=!0,0;var j=!P.compareDocumentPosition-!G.compareDocumentPosition;return j||(1&(j=(P.ownerDocument||P)==(G.ownerDocument||G)?P.compareDocumentPosition(G):1)||!ce.sortDetached&&G.compareDocumentPosition(P)===j?P===C||P.ownerDocument==Nt&&Se.contains(Nt,P)?-1:G===C||G.ownerDocument==Nt&&Se.contains(Nt,G)?1:_?ne.call(_,P)-ne.call(_,G):0:4&j?-1:1)}),C}for(l in Se.matches=function(T,I){return Se(T,null,null,I)},Se.matchesSelector=function(T,I){if(Be(T),E&&!we[I+" "]&&(!y||!y.test(I)))try{var x=O.call(T,I);if(x||ce.disconnectedMatch||T.document&&11!==T.document.nodeType)return x}catch{we(I,!0)}return Se(I,C,null,[T]).length>0},Se.contains=function(T,I){return(T.ownerDocument||T)!=C&&Be(T),m.contains(T,I)},Se.attr=function(T,I){(T.ownerDocument||T)!=C&&Be(T);var x=d.attrHandle[I.toLowerCase()],P=x&&e.call(d.attrHandle,I.toLowerCase())?x(T,I,!E):void 0;return void 0!==P?P:T.getAttribute(I)},Se.error=function(T){throw new Error("Syntax error, unrecognized expression: "+T)},m.uniqueSort=function(T){var I,x=[],P=0,G=0;if(h=!ce.sortStable,_=!ce.sortStable&&ge.call(T,0),Mt.call(T,Ne),h){for(;I=T[G++];)I===T[G]&&(P=x.push(G));for(;P--;)ze.call(T,x[P],1)}return _=null,T},m.fn.uniqueSort=function(){return this.pushStack(m.uniqueSort(ge.apply(this)))},(d=m.expr={cacheLength:50,createPseudo:Tt,match:yt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(T){return T[1]=T[1].replace(Lt,wt),T[3]=(T[3]||T[4]||T[5]||"").replace(Lt,wt),"~="===T[2]&&(T[3]=" "+T[3]+" "),T.slice(0,4)},CHILD:function(T){return T[1]=T[1].toLowerCase(),"nth"===T[1].slice(0,3)?(T[3]||Se.error(T[0]),T[4]=+(T[4]?T[5]+(T[6]||1):2*("even"===T[3]||"odd"===T[3])),T[5]=+(T[7]+T[8]||"odd"===T[3])):T[3]&&Se.error(T[0]),T},PSEUDO:function(T){var I,x=!T[6]&&T[2];return yt.CHILD.test(T[0])?null:(T[3]?T[2]=T[4]||T[5]||"":x&&Oe.test(x)&&(I=Bt(x,!0))&&(I=x.indexOf(")",x.length-I)-x.length)&&(T[0]=T[0].slice(0,I),T[2]=x.slice(0,I)),T.slice(0,3))}},filter:{TAG:function(T){var I=T.replace(Lt,wt).toLowerCase();return"*"===T?function(){return!0}:function(x){return _e(x,I)}},CLASS:function(T){var I=z[T+" "];return I||(I=new RegExp("(^|"+Re+")"+T+"("+Re+"|$)"))&&z(T,function(x){return I.test("string"==typeof x.className&&x.className||typeof x.getAttribute<"u"&&x.getAttribute("class")||"")})},ATTR:function(T,I,x){return function(P){var G=Se.attr(P,T);return null==G?"!="===I:!I||(G+="","="===I?G===x:"!="===I?G!==x:"^="===I?x&&0===G.indexOf(x):"*="===I?x&&G.indexOf(x)>-1:"$="===I?x&&G.slice(-x.length)===x:"~="===I?(" "+G.replace(Ee," ")+" ").indexOf(x)>-1:"|="===I&&(G===x||G.slice(0,x.length+1)===x+"-"))}},CHILD:function(T,I,x,P,G){var j="nth"!==T.slice(0,3),X="last"!==T.slice(-4),Q="of-type"===I;return 1===P&&0===G?function(W){return!!W.parentNode}:function(W,fe,re){var se,Ce,oe,xe,ct,Ke=j!==X?"nextSibling":"previousSibling",St=W.parentNode,Pt=Q&&W.nodeName.toLowerCase(),bn=!re&&!Q,Qe=!1;if(St){if(j){for(;Ke;){for(oe=W;oe=oe[Ke];)if(Q?_e(oe,Pt):1===oe.nodeType)return!1;ct=Ke="only"===T&&!ct&&"nextSibling"}return!0}if(ct=[X?St.firstChild:St.lastChild],X&&bn){for(Qe=(xe=(se=(Ce=St[N]||(St[N]={}))[T]||[])[0]===v&&se[1])&&se[2],oe=xe&&St.childNodes[xe];oe=++xe&&oe&&oe[Ke]||(Qe=xe=0)||ct.pop();)if(1===oe.nodeType&&++Qe&&oe===W){Ce[T]=[v,xe,Qe];break}}else if(bn&&(Qe=xe=(se=(Ce=W[N]||(W[N]={}))[T]||[])[0]===v&&se[1]),!1===Qe)for(;(oe=++xe&&oe&&oe[Ke]||(Qe=xe=0)||ct.pop())&&(!(Q?_e(oe,Pt):1===oe.nodeType)||!++Qe||(bn&&((Ce=oe[N]||(oe[N]={}))[T]=[v,Qe]),oe!==W)););return(Qe-=G)===P||Qe%P==0&&Qe/P>=0}}},PSEUDO:function(T,I){var x,P=d.pseudos[T]||d.setFilters[T.toLowerCase()]||Se.error("unsupported pseudo: "+T);return P[N]?P(I):P.length>1?(x=[T,T,"",I],d.setFilters.hasOwnProperty(T.toLowerCase())?Tt(function(G,j){for(var X,Q=P(G,I),W=Q.length;W--;)G[X=ne.call(G,Q[W])]=!(j[X]=Q[W])}):function(G){return P(G,0,x)}):P}},pseudos:{not:Tt(function(T){var I=[],x=[],P=oo(T.replace(he,"$1"));return P[N]?Tt(function(G,j,X,Q){for(var W,fe=P(G,null,Q,[]),re=G.length;re--;)(W=fe[re])&&(G[re]=!(j[re]=W))}):function(G,j,X){return I[0]=G,P(I,null,X,x),I[0]=null,!x.pop()}}),has:Tt(function(T){return function(I){return Se(T,I).length>0}}),contains:Tt(function(T){return T=T.replace(Lt,wt),function(I){return(I.textContent||m.text(I)).indexOf(T)>-1}}),lang:Tt(function(T){return Me.test(T||"")||Se.error("unsupported lang: "+T),T=T.replace(Lt,wt).toLowerCase(),function(I){var x;do{if(x=E?I.lang:I.getAttribute("xml:lang")||I.getAttribute("lang"))return(x=x.toLowerCase())===T||0===x.indexOf(T+"-")}while((I=I.parentNode)&&1===I.nodeType);return!1}}),target:function(T){var I=R.location&&R.location.hash;return I&&I.slice(1)===T.id},root:function(T){return T===S},focus:function(T){return T===function H(){try{return C.activeElement}catch{}}()&&C.hasFocus()&&!!(T.type||T.href||~T.tabIndex)},enabled:je(!1),disabled:je(!0),checked:function(T){return _e(T,"input")&&!!T.checked||_e(T,"option")&&!!T.selected},selected:function(T){return!0===T.selected},empty:function(T){for(T=T.firstChild;T;T=T.nextSibling)if(T.nodeType<6)return!1;return!0},parent:function(T){return!d.pseudos.empty(T)},header:function(T){return Wt.test(T.nodeName)}
vendor: 9,544 bytes, line 1
1,input:function(T){return ae.test(T.nodeName)},button:function(T){return _e(T,"input")&&"button"===T.type||_e(T,"button")},text:function(T){var I;return _e(T,"input")&&"text"===T.type&&(null==(I=T.getAttribute("type"))||"text"===I.toLowerCase())},first:Et(function(){return[0]}),last:Et(function(T,I){return[I-1]}),eq:Et(function(T,I,x){return[x<0?x+I:x]}),even:Et(function(T,I){for(var x=0;x<I;x+=2)T.push(x);return T}),odd:Et(function(T,I){for(var x=1;x<I;x+=2)T.push(x);return T}),lt:Et(function(T,I,x){var P;for(P=x<0?x+I:x>I?I:x;--P>=0;)T.push(P);return T}),gt:Et(function(T,I,x){for(var P=x<0?x+I:x;++P<I;)T.push(P);return T})}}).pseudos.nth=d.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[l]=Ie(l);for(l in{submit:!0,reset:!0})d.pseudos[l]=Pe(l);function st(){}function Bt(T,I){var x,P,G,j,X,Q,W,fe=me[T+" "];if(fe)return I?0:fe.slice(0);for(X=T,Q=[],W=d.preFilter;X;){for(j in(!x||(P=Fe.exec(X)))&&(P&&(X=X.slice(P[0].length)||X),Q.push(G=[])),x=!1,(P=on.exec(X))&&(x=P.shift(),G.push({value:x,type:P[0].replace(he," ")}),X=X.slice(x.length)),d.filter)(P=yt[j].exec(X))&&(!W[j]||(P=W[j](P)))&&(x=P.shift(),G.push({value:x,type:j,matches:P}),X=X.slice(x.length));if(!x)break}return I?X.length:X?Se.error(T):me(T,Q).slice(0)}function lt(T){for(var I=0,x=T.length,P="";I<x;I++)P+=T[I].value;return P}function dt(T,I,x){var P=I.dir,G=I.next,j=G||P,X=x&&"parentNode"===j,Q=A++;return I.first?function(W,fe,re){for(;W=W[P];)if(1===W.nodeType||X)return T(W,fe,re);return!1}:function(W,fe,re){var se,Ce,oe=[v,Q];if(re){for(;W=W[P];)if((1===W.nodeType||X)&&T(W,fe,re))return!0}else for(;W=W[P];)if(1===W.nodeType||X)if(Ce=W[N]||(W[N]={}),G&&_e(W,G))W=W[P]||W;else{if((se=Ce[j])&&se[0]===v&&se[1]===Q)return oe[2]=se[2];if(Ce[j]=oe,oe[2]=T(W,fe,re))return!0}return!1}}function Ln(T){return T.length>1?function(I,x,P){for(var G=T.length;G--;)if(!T[G](I,x,P))return!1;return!0}:T[0]}function gi(T,I,x,P,G){for(var j,X=[],Q=0,W=T.length,fe=null!=I;Q<W;Q++)(j=T[Q])&&(!x||x(j,P,G))&&(X.push(j),fe&&I.push(Q));return X}function hi(T,I,x,P,G,j){return P&&!P[N]&&(P=hi(P)),G&&!G[N]&&(G=hi(G,j)),Tt(function(X,Q,W,fe){var re,se,Ce,oe,xe=[],ct=[],Ke=Q.length,St=X||function Rs(T,I,x){for(var P=0,G=I.length;P<G;P++)Se(T,I[P],x);return x}(I||"*",W.nodeType?[W]:W,[]),Pt=!T||!X&&I?St:gi(St,xe,T,W,fe);if(x?x(Pt,oe=G||(X?T:Ke||P)?[]:Q,W,fe):oe=Pt,P)for(re=gi(oe,ct),P(re,[],W,fe),se=re.length;se--;)(Ce=re[se])&&(oe[ct[se]]=!(Pt[ct[se]]=Ce));if(X){if(G||T){if(G){for(re=[],se=oe.length;se--;)(Ce=oe[se])&&re.push(Pt[se]=Ce);G(null,oe=[],re,fe)}for(se=oe.length;se--;)(Ce=oe[se])&&(re=G?ne.call(X,Ce):xe[se])>-1&&(X[re]=!(Q[re]=Ce))}}else oe=gi(oe===Q?oe.splice(Ke,oe.length):oe),G?G(null,Q,oe,fe):f.apply(Q,oe)})}function io(T){for(var I,x,P,G=T.length,j=d.relative[T[0].type],X=j||d.relative[" "],Q=j?1:0,W=dt(function(se){return se===I},X,!0),fe=dt(function(se){return ne.call(I,se)>-1},X,!0),re=[function(se,Ce,oe){var xe=!j&&(oe||Ce!=p)||((I=Ce).nodeType?W(se,Ce,oe):fe(se,Ce,oe));return I=null,xe}];Q<G;Q++)if(x=d.relative[T[Q].type])re=[dt(Ln(re),x)];else{if((x=d.filter[T[Q].type].apply(null,T[Q].matches))[N]){for(P=++Q;P<G&&!d.relative[T[P].type];P++);return hi(Q>1&&Ln(re),Q>1&&lt(T.slice(0,Q-1).concat({value:" "===T[Q-2].type?"*":""})).replace(he,"$1"),x,Q<P&&io(T.slice(Q,P)),P<G&&io(T=T.slice(P)),P<G&&lt(T))}re.push(x)}return Ln(re)}function oo(T,I){var x,P=[],G=[],j=ie[T+" "];if(!j){for(I||(I=Bt(T)),x=I.length;x--;)(j=io(I[x]))[N]?P.push(j):G.push(j);j=ie(T,function Is(T,I){var x=I.length>0,P=T.length>0,G=function(j,X,Q,W,fe){var re,se,Ce,oe=0,xe="0",ct=j&&[],Ke=[],St=p,Pt=j||P&&d.find.TAG("*",fe),bn=v+=null==St?1:Math.random()||.1,Qe=Pt.length;for(fe&&(p=X==C||X||fe);xe!==Qe&&null!=(re=Pt[xe]);xe++){if(P&&re){for(se=0,!X&&re.ownerDocument!=C&&(Be(re),Q=!E);Ce=T[se++];)if(Ce(re,X||C,Q)){f.call(W,re);break}fe&&(v=bn)}x&&((re=!Ce&&re)&&oe--,j&&ct.push(re))}if(oe+=xe,x&&xe!==oe){for(se=0;Ce=I[se++];)Ce(ct,Ke,X,Q);if(j){if(oe>0)for(;xe--;)ct[xe]||Ke[xe]||(Ke[xe]=On.call(W));Ke=gi(Ke)}f.apply(W,Ke),fe&&!j&&Ke.length>0&&oe+I.length>1&&m.uniqueSort(W)}return fe&&(v=bn,p=St),ct};return x?Tt(G):G}(G,P)),j.selector=T}return j}function zr(T,I,x,P){var G,j,X,Q,W,fe="function"==typeof T&&T,re=!P&&Bt(T=fe.selector||T);if(x=x||[],1===re.length){if((j=re[0]=re[0].slice(0)).length>2&&"ID"===(X=j[0]).type&&9===I.nodeType&&E&&d.relative[j[1].type]){if(!(I=(d.find.ID(X.matches[0].replace(Lt,wt),I)||[])[0]))return x;fe&&(I=I.parentNode),T=T.slice(j.shift().value.length)}for(G=yt.needsContext.test(T)?0:j.length;G--&&!d.relative[Q=(X=j[G]).type];)if((W=d.find[Q])&&(P=W(X.matches[0].replace(Lt,wt),mi.test(j[0].type)&&at(I.parentNode)||I))){if(j.splice(G,1),!(T=P.length&&lt(j)))return f.apply(x,P),x;break}}return(fe||oo(T,re))(P,I,!E,x,!I||mi.test(T)&&at(I.parentNode)||I),x}st.prototype=d.filters=d.pseudos,d.setFilters=new st,ce.sortStable=N.split("").sort(Ne).join("")===N,Be(),ce.sortDetached=de(function(T){return 1&T.compareDocumentPosition(C.createElement("fieldset"))}),m.find=Se,m.expr[":"]=m.expr.pseudos,m.unique=m.uniqueSort,Se.compile=oo,Se.select=zr,Se.setDocument=Be,Se.tokenize=Bt,Se.escape=m.escapeSelector,Se.getText=m.text,Se.isXML=m.isXMLDoc,Se.selectors=m.expr,Se.support=m.support,Se.uniqueSort=m.uniqueSort}();var un=function(l,d,p){for(var _=[],h=void 0!==p;(l=l[d])&&9!==l.nodeType;)if(1===l.nodeType){if(h&&m(l).is(p))break;_.push(l)}return _},_r=function(l,d){for(var p=[];l;l=l.nextSibling)1===l.nodeType&&l!==d&&p.push(l);return p},mr=m.expr.match.needsContext,gr=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function Ai(l,d,p){return q(d)?m.grep(l,function(_,h){return!!d.call(_,h,_)!==p}):d.nodeType?m.grep(l,function(_){return _===d!==p}):"string"!=typeof d?m.grep(l,function(_){return ne.call(d,_)>-1!==p}):m.filter(d,l,p)}m.filter=function(l,d,p){var _=d[0];return p&&(l=":not("+l+")"),1===d.length&&1===_.nodeType?m.find.matchesSelector(_,l)?[_]:[]:m.find.matches(l,m.grep(d,function(h){return 1===h.nodeType}))},m.fn.extend({find:function(l){var d,p,_=this.length,h=this;if("string"!=typeof l)return this.pushStack(m(l).filter(function(){for(d=0;d<_;d++)if(m.contains(h[d],this))return!0}));for(p=this.pushStack([]),d=0;d<_;d++)m.find(l,h[d],p);return _>1?m.uniqueSort(p):p},filter:function(l){return this.pushStack(Ai(this,l||[],!1))},not:function(l){return this.pushStack(Ai(this,l||[],!0))},is:function(l){return!!Ai(this,"string"==typeof l&&mr.test(l)?m(l):l||[],!1).length}});var hr,Va=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,_n=m.fn.init=function(l,d,p){var _,h;if(!l)return this;if(p=p||hr,"string"==typeof l){if(!(_="<"===l[0]&&">"===l[l.length-1]&&l.length>=3?[null,l,null]:Va.exec(l))||!_[1]&&d)return!d||d.jquery?(d||p).find(l):this.constructor(d).find(l);if(_[1]){if(m.merge(this,m.parseHTML(_[1],(d=d instanceof m?d[0]:d)&&d.nodeType?d.ownerDocument||d:ee,!0)),gr.test(_[1])&&m.isPlainObject(d))for(_ in d)q(this[_])?this[_](d[_]):this.attr(_,d[_]);return this}return(h=ee.getElementById(_[2]))&&(this[0]=h,this.length=1),this}return l.nodeType?(this[0]=l,this.length=1,this):q(l)?void 0!==p.ready?p.ready(l):l(m):m.makeArray(l,this)};_n.prototype=m.fn,hr=m(ee);var $a=/^(?:parents|prev(?:Until|All))/,ni={children:!0,contents:!0,next:!0,prev:!0};function fr(l,d){for(;(l=l[d])&&1!==l.nodeType;);return l}m.fn.extend({has:function(l){var d=m(l,this),p=d.length;return this.filter(function(){for(var _=0;_<p;_++)if(m.contains(this,d[_]))return!0})},closest:function(l,d){var p,_=0,h=this.length,f=[],C="string"!=typeof l&&m(l);if(!mr.test(l))for(;_<h;_++)for(p=this[_];p&&p!==d;p=p.parentNode)if(p.nodeType<11&&(C?C.index(p)>-1:1===p.nodeType&&m.find.matchesSelector(p,l))){f.push(p);break}return this.pushStack(f.length>1?m.uniqueSort(f):f)},index:function(l){return l?"string"==typeof l?ne.call(m(l),this[0]):ne.call(this,l.jquery?l[0]:l):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(l,d){return this.pushStack(m.uniqueSort(m.merge(this.get(),m(l,d))))},addBack:function(l){return this.add(null==l?this.prevObject:this.prevObject.filter(l))}}),m.each({parent:function(l){var d=l.parentNode;return d&&11!==d.nodeType?d:null},parents:function(l){return un(l,"parentNode")},parentsUntil:function(l,d,p){return un(l,"parentNode",p)},next:function(l){return fr(l,"nextSibling")},prev:function(l){return fr(l,"previousSibling")},nextAll:function(l){return un(l,"nextSibling")},prevAll:function(l){return un(l,"previousSibling")},nextUntil:function(l,d,p){return un(l,"nextSibling",p)},prevUntil:function(l,d,p){return un(l,"previousSibling",p)},siblings:function(l){return _r((l.parentNode||{}).firstChild,l)},children:function(l){return _r(l.firstChild)},contents:function(l){return null!=l.contentDocument&&cr(l.contentDocument)?l.contentDocument:(_e(l,"template")&&(l=l.content||l),m.merge([],l.childNodes))}},function(l,d){m.fn[l]=function(p,_){var h=m.map(this,d,p);return"Until"!==l.slice(-5)&&(_=p),_&&"string"==typeof _&&(h=m.filter(_,h)),this.length>1&&(ni[l]||m.uniqueSort(h),$a.test(l)&&h.reverse()),this.pushStack(h)}});var ft=/[^\x20\t\r\n\f]+/g;function _t(l){return l}function ii(l){throw l}function oi(l,d,p,_){var h;try{l&&q(h=l.promise)?h.call(l).done(d).fail(p):l&&q(h=l.then)?h.call(l,d,p):d.apply(void 0,[l].slice(_))}catch(f){p.apply(void 0,[f])}}m.Callbacks=function(l){l="string"==typeof l?function ut(l){var d={};return m.each(l.match(ft)||[],function(p,_){d[_]=!0}),d}(l):m.extend({},l);var d,p,_,h,f=[],C=[],S=-1,E=function(){for(h=h||l.once,_=d=!0;C.length;S=-1)for(p=C.shift();++S<f.length;
vendor: 17,855 bytes, line 1
1)!1===f[S].apply(p[0],p[1])&&l.stopOnFalse&&(S=f.length,p=!1);l.memory||(p=!1),d=!1,h&&(f=p?[]:"")},y={add:function(){return f&&(p&&!d&&(S=f.length-1,C.push(p)),function O(N){m.each(N,function(v,A){q(A)?(!l.unique||!y.has(A))&&f.push(A):A&&A.length&&"string"!==pn(A)&&O(A)})}(arguments),p&&!d&&E()),this},remove:function(){return m.each(arguments,function(O,N){for(var v;(v=m.inArray(N,f,v))>-1;)f.splice(v,1),v<=S&&S--}),this},has:function(O){return O?m.inArray(O,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return h=C=[],f=p="",this},disabled:function(){return!f},lock:function(){return h=C=[],!p&&!d&&(f=p=""),this},locked:function(){return!!h},fireWith:function(O,N){return h||(N=[O,(N=N||[]).slice?N.slice():N],C.push(N),d||E()),this},fire:function(){return y.fireWith(this,arguments),this},fired:function(){return!!_}};return y},m.extend({Deferred:function(l){var d=[["notify","progress",m.Callbacks("memory"),m.Callbacks("memory"),2],["resolve","done",m.Callbacks("once memory"),m.Callbacks("once memory"),0,"resolved"],["reject","fail",m.Callbacks("once memory"),m.Callbacks("once memory"),1,"rejected"]],p="pending",_={state:function(){return p},always:function(){return h.done(arguments).fail(arguments),this},catch:function(f){return _.then(null,f)},pipe:function(){var f=arguments;return m.Deferred(function(C){m.each(d,function(S,E){var y=q(f[E[4]])&&f[E[4]];h[E[1]](function(){var O=y&&y.apply(this,arguments);O&&q(O.promise)?O.promise().progress(C.notify).done(C.resolve).fail(C.reject):C[E[0]+"With"](this,y?[O]:arguments)})}),f=null}).promise()},then:function(f,C,S){var E=0;function y(O,N,v,A){return function(){var z=this,me=arguments,ie=function(){var Ne,rt;if(!(O<E)){if((Ne=v.apply(z,me))===N.promise())throw new TypeError("Thenable self-resolution");q(rt=Ne&&("object"==typeof Ne||"function"==typeof Ne)&&Ne.then)?A?rt.call(Ne,y(E,N,_t,A),y(E,N,ii,A)):(E++,rt.call(Ne,y(E,N,_t,A),y(E,N,ii,A),y(E,N,_t,N.notifyWith))):(v!==_t&&(z=void 0,me=[Ne]),(A||N.resolveWith)(z,me))}},we=A?ie:function(){try{ie()}catch(Ne){m.Deferred.exceptionHook&&m.Deferred.exceptionHook(Ne,we.error),O+1>=E&&(v!==ii&&(z=void 0,me=[Ne]),N.rejectWith(z,me))}};O?we():(m.Deferred.getErrorHook?we.error=m.Deferred.getErrorHook():m.Deferred.getStackHook&&(we.error=m.Deferred.getStackHook()),R.setTimeout(we))}}return m.Deferred(function(O){d[0][3].add(y(0,O,q(S)?S:_t,O.notifyWith)),d[1][3].add(y(0,O,q(f)?f:_t)),d[2][3].add(y(0,O,q(C)?C:ii))}).promise()},promise:function(f){return null!=f?m.extend(f,_):_}},h={};return m.each(d,function(f,C){var S=C[2],E=C[5];_[C[1]]=S.add,E&&S.add(function(){p=E},d[3-f][2].disable,d[3-f][3].disable,d[0][2].lock,d[0][3].lock),S.add(C[3].fire),h[C[0]]=function(){return h[C[0]+"With"](this===h?void 0:this,arguments),this},h[C[0]+"With"]=S.fireWith}),_.promise(h),l&&l.call(h,h),h},when:function(l){var d=arguments.length,p=d,_=Array(p),h=ge.call(arguments),f=m.Deferred(),C=function(S){return function(E){_[S]=this,h[S]=arguments.length>1?ge.call(arguments):E,--d||f.resolveWith(_,h)}};if(d<=1&&(oi(l,f.done(C(p)).resolve,f.reject,!d),"pending"===f.state()||q(h[p]&&h[p].then)))return f.then();for(;p--;)oi(h[p],C(p),f.reject);return f.promise()}});var Ua=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;m.Deferred.exceptionHook=function(l,d){R.console&&R.console.warn&&l&&Ua.test(l.name)&&R.console.warn("jQuery.Deferred exception: "+l.message,l.stack,d)},m.readyException=function(l){R.setTimeout(function(){throw l})};var Li=m.Deferred();function ri(){ee.removeEventListener("DOMContentLoaded",ri),R.removeEventListener("load",ri),m.ready()}m.fn.ready=function(l){return Li.then(l).catch(function(d){m.readyException(d)}),this},m.extend({isReady:!1,readyWait:1,ready:function(l){(!0===l?--m.readyWait:m.isReady)||(m.isReady=!0,!(!0!==l&&--m.readyWait>0)&&Li.resolveWith(ee,[m]))}}),m.ready.then=Li.then,"complete"===ee.readyState||"loading"!==ee.readyState&&!ee.documentElement.doScroll?R.setTimeout(m.ready):(ee.addEventListener("DOMContentLoaded",ri),R.addEventListener("load",ri));var Gt=function(l,d,p,_,h,f,C){var S=0,E=l.length,y=null==p;if("object"===pn(p))for(S in h=!0,p)Gt(l,d,S,p[S],!0,f,C);else if(void 0!==_&&(h=!0,q(_)||(C=!0),y&&(C?(d.call(l,_),d=null):(y=d,d=function(O,N,v){return y.call(m(O),v)})),d))for(;S<E;S++)d(l[S],p,C?_:_.call(l[S],S,d(l[S],p)));return h?l:y?d.call(l):E?d(l[0],p):f},Ya=/^-ms-/,Ha=/-([a-z])/g;function Xa(l,d){return d.toUpperCase()}function Ft(l){return l.replace(Ya,"ms-").replace(Ha,Xa)}var xn=function(l){return 1===l.nodeType||9===l.nodeType||!+l.nodeType};function Mn(){this.expando=m.expando+Mn.uid++}Mn.uid=1,Mn.prototype={cache:function(l){var d=l[this.expando];return d||(d={},xn(l)&&(l.nodeType?l[this.expando]=d:Object.defineProperty(l,this.expando,{value:d,configurable:!0}))),d},set:function(l,d,p){var _,h=this.cache(l);if("string"==typeof d)h[Ft(d)]=p;else for(_ in d)h[Ft(_)]=d[_];return h},get:function(l,d){return void 0===d?this.cache(l):l[this.expando]&&l[this.expando][Ft(d)]},access:function(l,d,p){return void 0===d||d&&"string"==typeof d&&void 0===p?this.get(l,d):(this.set(l,d,p),void 0!==p?p:d)},remove:function(l,d){var p,_=l[this.expando];if(void 0!==_){if(void 0!==d)for((p=(d=Array.isArray(d)?d.map(Ft):(d=Ft(d))in _?[d]:d.match(ft)||[]).length);p--;)delete _[d[p]];(void 0===d||m.isEmptyObject(_))&&(l.nodeType?l[this.expando]=void 0:delete l[this.expando])}},hasData:function(l){var d=l[this.expando];return void 0!==d&&!m.isEmptyObject(d)}};var te=new Mn,tt=new Mn,Wa=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,za=/[A-Z]/g;function Cr(l,d,p){var _;if(void 0===p&&1===l.nodeType)if(_="data-"+d.replace(za,"-$&").toLowerCase(),"string"==typeof(p=l.getAttribute(_))){try{p=function Ka(l){return"true"===l||"false"!==l&&("null"===l?null:l===+l+""?+l:Wa.test(l)?JSON.parse(l):l)}(p)}catch{}tt.set(l,d,p)}else p=void 0;return p}m.extend({hasData:function(l){return tt.hasData(l)||te.hasData(l)},data:function(l,d,p){return tt.access(l,d,p)},removeData:function(l,d){tt.remove(l,d)},_data:function(l,d,p){return te.access(l,d,p)},_removeData:function(l,d){te.remove(l,d)}}),m.fn.extend({data:function(l,d){var p,_,h,f=this[0],C=f&&f.attributes;if(void 0===l){if(this.length&&(h=tt.get(f),1===f.nodeType&&!te.get(f,"hasDataAttrs"))){for(p=C.length;p--;)C[p]&&0===(_=C[p].name).indexOf("data-")&&(_=Ft(_.slice(5)),Cr(f,_,h[_]));te.set(f,"hasDataAttrs",!0)}return h}return"object"==typeof l?this.each(function(){tt.set(this,l)}):Gt(this,function(S){var E;if(f&&void 0===S)return void 0!==(E=tt.get(f,l))||void 0!==(E=Cr(f,l))?E:void 0;this.each(function(){tt.set(this,l,S)})},null,d,arguments.length>1,null,!0)},removeData:function(l){return this.each(function(){tt.remove(this,l)})}}),m.extend({queue:function(l,d,p){var _;if(l)return _=te.get(l,d=(d||"fx")+"queue"),p&&(!_||Array.isArray(p)?_=te.access(l,d,m.makeArray(p)):_.push(p)),_||[]},dequeue:function(l,d){var p=m.queue(l,d=d||"fx"),_=p.length,h=p.shift(),f=m._queueHooks(l,d);"inprogress"===h&&(h=p.shift(),_--),h&&("fx"===d&&p.unshift("inprogress"),delete f.stop,h.call(l,function(){m.dequeue(l,d)},f)),!_&&f&&f.empty.fire()},_queueHooks:function(l,d){var p=d+"queueHooks";return te.get(l,p)||te.access(l,p,{empty:m.Callbacks("once memory").add(function(){te.remove(l,[d+"queue",p])})})}}),m.fn.extend({queue:function(l,d){var p=2;return"string"!=typeof l&&(d=l,l="fx",p--),arguments.length<p?m.queue(this[0],l):void 0===d?this:this.each(function(){var _=m.queue(this,l,d);m._queueHooks(this,l),"fx"===l&&"inprogress"!==_[0]&&m.dequeue(this,l)})},dequeue:function(l){return this.each(function(){m.dequeue(this,l)})},clearQueue:function(l){return this.queue(l||"fx",[])},promise:function(l,d){var p,_=1,h=m.Deferred(),f=this,C=this.length,S=function(){--_||h.resolveWith(f,[f])};for("string"!=typeof l&&(d=l,l=void 0),l=l||"fx";C--;)(p=te.get(f[C],l+"queueHooks"))&&p.empty&&(_++,p.empty.add(S));return S(),h.promise(d)}});var Bi=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,nt=new RegExp("^(?:([+-])=|)("+Bi+")([a-z%]*)$","i"),At=["Top","Right","Bottom","Left"],en=ee.documentElement,mn=function(l){return m.contains(l.ownerDocument,l)},Ja={composed:!0};en.getRootNode&&(mn=function(l){return m.contains(l.ownerDocument,l)||l.getRootNode(Ja)===l.ownerDocument});var ai=function(l,d){return"none"===(l=d||l).style.display||""===l.style.display&&mn(l)&&"none"===m.css(l,"display")};function vr(l,d,p,_){var h,f,C=20,S=_?function(){return _.cur()}:function(){return m.css(l,d,"")},E=S(),y=p&&p[3]||(m.cssNumber[d]?"":"px"),O=l.nodeType&&(m.cssNumber[d]||"px"!==y&&+E)&&nt.exec(m.css(l,d));if(O&&O[3]!==y){for(y=y||O[3],O=+(E/=2)||1;C--;)m.style(l,d,O+y),(1-f)*(1-(f=S()/E||.5))<=0&&(C=0),O/=f;m.style(l,d,(O*=2)+y),p=p||[]}return p&&(O=+O||+E||0,h=p[1]?O+(p[1]+1)*p[2]:+p[2],_&&(_.unit=y,_.start=O,_.end=h)),h}var br={};function qa(l){var d,p=l.ownerDocument,_=l.nodeName,h=br[_];return h||(d=p.body.appendChild(p.createElement(_)),h=m.css(d,"display"),d.parentNode.removeChild(d),"none"===h&&(h="block"),br[_]=h,h)}function gn(l,d){for(var p,_,h=[],f=0,C=l.length;f<C;f++)(_=l[f]).style&&(p=_.style.display,d?("none"===p&&(h[f]=te.get(_,"display")||null,h[f]||(_.style.display="")),""===_.style.display&&ai(_)&&(h[f]=qa(_))):"none"!==p&&(h[f]="none",te.set(_,"display",p)));for(f=0;f<C;f++)null!=h[f]&&(l[f].style.display=h[f]);return l}m.fn.extend({show:function(){return gn(this,!0)},hide:function(){return gn(this)},toggle:function(l){return"boolean"==typeof l?l?this.show():this.hide():this.each(function(){ai(this)?m(this).show():m(this).hide()})}});var d,p,Fn=/^(?:checkbox|radio)$/i,Tr=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Er=/^$|^module$|\/(?:java|ecma)script/i;d=ee.createDocumentFragment().appendChild(ee.createElement("div")),(p=ee.createElement("input")).setAttribute("type","radio"),p.setAttribute("checked","checked"),p.setAttribute("name","t"),d.appendChild(p),ce.checkClone=d.cloneNode(!0).cloneNode(!0).lastChild.checked,d.innerHTML="<textarea>x</textarea>",ce.noCloneChecked=!!d.cloneNode(!0).lastChild.defaultValue,d.innerHTML="<option></option>",ce.option=!!d.lastChild;var Ct={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function it(l,d){var p;return p=typeof l.getElementsByTagName<"u"?l.getElementsByTagName(d||"*"):typeof l.querySelectorAll<"u"?l.querySelectorAll(d||"*"):[],void 0===d||d&&_e(l,d)?m.merge([l],p):p}function ji(l,d){for(var p=0,_=l.length;p<_;p++)te.set(l[p],"globalEval",!d||te.get(d[p],"globalEval"))}Ct.tbody=Ct.tfoot=Ct.colgroup=Ct.caption=Ct.thead,Ct.th=Ct.td,ce.option||(Ct.optgroup=Ct.option=[1,"<select multiple='multiple'>","</select>"]);var si=/<|&#?\w+;/;function Vi(l,d,p,_,h){for(var f,C,S,E,y,O,N=d.createDocumentFragment(),v=[],A=0,z=l.length;A<z;A++)if((f=l[A])||0===f)if("object"===pn(f))m.merge(v,f.nodeType?[f]:f);else if(si.test(f)){for(C=C||N.appendChild(d.createElement("div")),S=(Tr.exec(f)||["",""])[1].toLowerCase(),C.innerHTML=(E=Ct[S]||Ct._default)[1]+m.htmlPrefilter(f)+E[2],O=E[0];O--;)C=C.lastChild;m.merge(v,C.childNodes),(C=N.firstChild).textContent=""}else v.push(d.createTextNode(f));for(N.textContent="",A=0;f=v[A++];)if(_&&m.inArray(f,_)>-1)h&&h.push(f);else if(y=mn(f),C=it(N.appendChild(f),"script"),y&&ji(C),p)for(O=0;f=C[O++];)Er.test(f.type||"")&&p.push(f);return N}var Sr=/^([^.]*)(?:\.(.+)|)/;function hn(){return!0}function fn(){return!1}function $i(l,d,p,_,h,f){var C,S;if("object"==typeof d){for(S in"string"!=typeof p&&(_=_||p,p=void 0),d)$i(l,S,p,_,d[S],f);return l}if(null==_&&null==h?(h=p,_=p=void 0):null==h&&("string"==typeof p?(h=_,_=void 0):(h=_,_=p,p=void 0)),!1===h)h=fn;else if(!h)return l;return 1===f&&(C=h,h=function(E){return m().off(E),C.apply(this,arguments)},h.guid=C.guid||(C.guid=m.guid++)),l.each(function(){m.event.add(this,d,h,_,p)})}function li(l,d,p){p?(te.set(l,d,!1),m.event.add(l,d,{namespace:!1,handler:function(_){var h,f=te.get(this,d);if(1&_.isTrigger&&this[d]){if(f)(m.event.special[d]||{}).delegateType&&_.stopPropagation();else if(f=ge.call(arguments),te.set(this,d,f),this[d](),h=te.get(this,d),te.set(this,d,!1),f!==h)return _.stopImmediatePropagation(),_.preventDefault(),h}else f&&(te.set(this,d,m.event.trigger(f[0],f.slice(1),this)),_.stopPropagation(),_.isImmediatePropagationStopped=hn)}})):void 0===te.get(l,d)&&m.event.add(l,d,hn)}m.event={global:{},add:function(l,d,p,_,h){var f,C,S,E,y,O,N,v,A,z,me,ie=te.get(l);if(xn(l))for(p.handler&&(p=(f=p).handler,h=f.selector),h&&m.find.matchesSelector(en,h),p.guid||(p.guid=m.guid++),(E=ie.events)||(E=ie.events=Object.create(null)),(C=ie.handle)||(C=ie.handle=function(we){return typeof m<"u"&&m.event.triggered!==we.type?m.event.dispatch.apply(l,arguments):void 0}),y=(d=(d||"").match(ft)||[""]).length;y--;)A=me=(S=Sr.exec(d[y])||[])[1],z=(S[2]||"").split(".").sort(),A&&(N=m.event.special[A]||{},N=m.event.special[A=(h?N.delegateType:N.bindType)||A]||{},O=m.extend({type:A,origType:me,data:_,handler:p,guid:p.guid,selector:h,needsContext:h&&m.expr.match.needsContext.test(h),namespace:z.join(".")},f),(v=E[A])||((v=E[A]=[]).delegateCount=0,(!N.setup||!1===N.setup.call(l,_,z,C))&&l.addEventListener&&l.addEventListener(A,C)),N.add&&(N.add.call(l,O),O.handler.guid||(O.handler.guid=p.guid)),h?v.splice(v.delegateCount++,0,O):v.push(O),m.event.global[A]=!0)},remove:function(l,d,p,_,h){var f,C,S,E,y,O,N,v,A,z,me,ie=te.hasData(l)&&te.get(l);if(ie&&(E=ie.events)){for(y=(d=(d||"").match(ft)||[""]).length;y--;)if(A=me=(S=Sr.exec(d[y])||[])[1],z=(S[2]||"").split(".").sort(),A){for(N=m.event.special[A]||{},v=E[A=(_?N.delegateType:N.bindType)||A]||[],S=S[2]&&new RegExp("(^|\\.)"+z.join("\\.(?:.*\\.|)")+"(\\.|$)"),C=f=v.length;f--;)O=v[f],(h||me===O.origType)&&(!p||p.guid===O.guid)&&(!S||S.test(O.namespace))&&(!_||_===O.selector||"**"===_&&O.selector)&&(v.splice(f,1),O.selector&&v.delegateCount--,N.remove&&N.remove.call(l,O));C&&!v.length&&((!N.teardown||!1===N.teardown.call(l,z,ie.handle))&&m.removeEvent(l,A,ie.handle),delete E[A])}else for(A in E)m.event.remove(l,A+d[y],p,_,!0);m.isEmptyObject(E)&&te.remove(l,"handle events")}},dispatch:function(l){var d,p,_,h,f,C,S=new Array(arguments.length),E=m.event.fix(l),y=(te.get(this,"events")||Object.create(null))[E.type]||[],O=m.event.special[E.type]||{};for(S[0]=E,d=1;d<arguments.length;d++)S[d]=arguments[d];if(E.delegateTarget=this,!O.preDispatch||!1!==O.preDispatch.call(this,E)){for(C=m.event.handlers.call(this,E,y),d=0;(h=C[d++])&&!E.isPropagationStopped();)for(E.currentTarget=h.elem,p=0;(f=h.handlers[p++])&&!E.isImmediatePropagationStopped();)(!E.rnamespace||!1===f.namespace||E.rnamespace.test(f.namespace))&&(E.handleObj=f,E.data=f.data,void 0!==(_=((m.event.special[f.origType]||{}).handle||f.handler).apply(h.elem,S))&&!1===(E.result=_)&&(E.preventDefault(),E.stopPropagation()));return O.postDispatch&&O.postDispatch.call(this,E),E.result}},handlers:function(l,d){var p,_,h,f,C,S=[],E=d.delegateCount,y=l.target;if(E&&y.nodeType&&!("click"===l.type&&l.button>=1))for(;y!==this;y=y.parentNode||this)if(1===y.nodeType&&("click"!==l.type||!0!==y.disabled)){for(f=[],C={},p=0;p<E;p++)void 0===C[h=(_=d[p]).selector+" "]&&(C[h]=_.needsContext?m(h,this).index(y)>-1:m.find(h,this,null,[y]).length),C[h]&&f.push(_);f.length&&S.push({elem:y,handlers:f})}return y=this,E<d.length&&S.push({elem:y,handlers:d.slice(E)}),S},addProp:function(l,d){Object.defineProperty(m.Event.prototype,l,{enumerable:!0,configurable:!0,get:q(d)?function(){if(this.originalEvent)return d(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[l]},set:function(p){Object.defineProperty(this,l,{enumerable:!0,configurable:!0,writable:!0,value:p})}})},fix:function(l){return l[m.expando]?l:new m.Event(l)},special:{load:{noBubble:!0},click:{setup:function(l){var d=this||l;return Fn.test(d.type)&&d.click&&_e(d,"input")&&li(d,"click",!0),!1},trigger:function(l){var d=this||l;return Fn.test(d.type)&&d.click&&_e(d,"input")&&li(d,"click"),!0},_default:function(l){var d=l.target;return Fn.test(d.type)&&d.click&&_e(d,"input")&&te.get(d,"click")||_e(d,"a")}},beforeunload:{postDispatch:function(l){void 0!==l.result&&l.originalEvent&&(l.originalEvent.returnValue=l.result)}}}},m.removeEvent=function(l,d,p){l.removeEventListener&&l.removeEventListener(d,p)},m.Event=function(l,d){if(!(this instanceof m.Event))return new m.Event(l,d);l&&l.type?(this.originalEvent=l,this.type=l.type,this.isDefaultPrevented=l.defaultPrevented||void 0===l.defaultPrevented&&!1===l.returnValue?hn:fn,this.target=l.target&&3===l.target.nodeType?l.target.parentNode:l.target,this.currentTarget=l.currentTarget,this.relatedTarget=l.relatedTarget):this.type=l,d&&m.extend(this,d),this.timeStamp=l&&l.timeStamp||Date.now(),this[m.expando]=!0},m.Event.prototype={constructor:m.Event,isDefaultPrevented:fn,isPropagationStopped:fn,isImmediatePropagationStopped:fn,isSimulated:!1,preventDefault:function(){var l=this.originalEvent;this.isDefaultPrevented=hn,l&&!this.isSimulated&&l.preventDefault()},stopPropagation:function(){var l=this.originalEvent;this.isPropagationStopped=hn,l&&!this.isSimulated&&l.stopPropagation()},stopImmediatePropagation:function(){var l=this.originalEvent;this.isImmediatePropagationStopped=hn,l&&!this.isSimulated&&l.stopImmediatePropagation(),this.stopPropagation()}},m.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},m.event.addProp),m.each({focus:"focusin",blur:"focusout"},function(l,d){function p(_){if(ee.documentMode){var h=te.get(this,"handle"),f=m.event.fix(_);
vendor: 1,037 bytes, line 1
1f.type="focusin"===_.type?"focus":"blur",f.isSimulated=!0,h(_),f.target===f.currentTarget&&h(f)}else m.event.simulate(d,_.target,m.event.fix(_))}m.event.special[l]={setup:function(){var _;if(li(this,l,!0),!ee.documentMode)return!1;(_=te.get(this,d))||this.addEventListener(d,p),te.set(this,d,(_||0)+1)},trigger:function(){return li(this,l),!0},teardown:function(){var _;if(!ee.documentMode)return!1;(_=te.get(this,d)-1)?te.set(this,d,_):(this.removeEventListener(d,p),te.remove(this,d))},_default:function(_){return te.get(_.target,l)},delegateType:d},m.event.special[d]={setup:function(){var _=this.ownerDocument||this.document||this,h=ee.documentMode?this:_,f=te.get(h,d);f||(ee.documentMode?this.addEventListener(d,p):_.addEventListener(l,p,!0)),te.set(h,d,(f||0)+1)},teardown:function(){var _=this.ownerDocument||this.document||this,h=ee.documentMode?this:_,f=te.get(h,d)-1;f?te.set(h,d,f):(ee.documentMode?this.removeEventListener(d,p):_.removeEventListener(l,p,!0),te.remove(h,d))}}}),m.each({mouseenter:"mouseover",mouseleave:"mou
1seout",pointerenter:"pointerover",pointerleave:"pointerout"},function(l,d){m.event.special[l]={delegateType:d,bindType:d,handle:function(p){var _,f=p.relatedTarget,C=p.handleObj;return(!f||f!==this&&!m.contains(this,f))&&(p.type=C.origType,_=C.handler.apply(this,arguments),p.type=d),_}}}),m.fn.extend({on:function(l,d,p,_){return $i(this,l,d,p,_)},one:function(l,d,p,_){return $i(this,l,d,p,_,1)},off:function(l,d,p){var _,h;if(l&&l.preventDefault&&l.handleObj)return _=l.handleObj,m(l.delegateTarget).off(_.namespace?_.origType+"."+_.namespace:_.origType,_.selector,_.handler),this;if("object"==typeof l){for(h in l)this.off(h,d,l[h]);return this}return(!1===d||"function"==typeof d)&&(p=d,d=void 0),!1===p&&(p=fn),this.each(function(){m.event.remove(this,l,p,d)})}});var Qa=/<script|<style|<link/i,Za=/checked\s*(?:[^=]|=\s*.checked.)/i,es=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function kr(l,d){return _e(l,"table")&&_e(11!==d.nodeType?d:d.firstChild,"tr")&&m(l).children("tbody")[0]||l}function ts(l){return l.type=(null!==l.getAttribute("type"))+"/"+l.type,l}function ns(l){return"true/"===(l.type||"").slice(0,5)?l.type=l.type.slice(5):l.removeAttribute("type"),l}function Rr(l,d){var p,_,h,C,S,E;if(1===d.nodeType){if(te.hasData(l)&&(E=te.get(l).events))for(h in te.remove(d,"handle events"),E)for(p=0,_=E[h].length;p<_;p++)m.event.add(d,h,E[h][p]);tt.hasData(l)&&(C=tt.access(l),S=m.extend({},C),tt.set(d,S))}}function is(l,d){var p=d.nodeName.toLowerCase();"input"===p&&Fn.test(l.type)?d.checked=l.checked:("input"===p||"textarea"===p)&&(d.defaultValue=l.defaultValue)}function Cn(l,d,p,_){d=ue(d);var h,f,C,S,E,y,O=0,N=l.length,v=N-1,A=d[0],z=q(A);if(z||N>1&&"string"==typeof A&&!ce.checkClone&&Za.test(A))return l.each(function(me){var ie=l.eq(me);
vendor: 4,164 bytes, line 1
1z&&(d[0]=A.call(this,me,ie.html())),Cn(ie,d,p,_)});if(N&&(f=(h=Vi(d,l[0].ownerDocument,!1,l,_)).firstChild,1===h.childNodes.length&&(h=f),f||_)){for(S=(C=m.map(it(h,"script"),ts)).length;O<N;O++)E=h,O!==v&&(E=m.clone(E,!0,!0),S&&m.merge(C,it(E,"script"))),p.call(l[O],E,O);if(S)for(y=C[C.length-1].ownerDocument,m.map(C,ns),O=0;O<S;O++)Er.test((E=C[O]).type||"")&&!te.access(E,"globalEval")&&m.contains(y,E)&&(E.src&&"module"!==(E.type||"").toLowerCase()?m._evalUrl&&!E.noModule&&m._evalUrl(E.src,{nonce:E.nonce||E.getAttribute("nonce")},y):pr(E.textContent.replace(es,""),E,y))}return l}function Ir(l,d,p){for(var _,h=d?m.filter(d,l):l,f=0;null!=(_=h[f]);f++)!p&&1===_.nodeType&&m.cleanData(it(_)),_.parentNode&&(p&&mn(_)&&ji(it(_,"script")),_.parentNode.removeChild(_));return l}m.extend({htmlPrefilter:function(l){return l},clone:function(l,d,p){var _,h,f,C,S=l.cloneNode(!0),E=mn(l);if(!(ce.noCloneChecked||1!==l.nodeType&&11!==l.nodeType||m.isXMLDoc(l)))for(C=it(S),_=0,h=(f=it(l)).length;_<h;_++)is(f[_],C[_]);if(d)if(p)for(f=f||it(l),C=C||it(S),_=0,h=f.length;_<h;_++)Rr(f[_],C[_]);else Rr(l,S);return(C=it(S,"script")).length>0&&ji(C,!E&&it(l,"script")),S},cleanData:function(l){for(var d,p,_,h=m.event.special,f=0;void 0!==(p=l[f]);f++)if(xn(p)){if(d=p[te.expando]){if(d.events)for(_ in d.events)h[_]?m.event.remove(p,_):m.removeEvent(p,_,d.handle);p[te.expando]=void 0}p[tt.expando]&&(p[tt.expando]=void 0)}}}),m.fn.extend({detach:function(l){return Ir(this,l,!0)},remove:function(l){return Ir(this,l)},text:function(l){return Gt(this,function(d){return void 0===d?m.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=d)})},null,l,arguments.length)},append:function(){return Cn(this,arguments,function(l){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||kr(this,l).appendChild(l)})},prepend:function(){return Cn(this,arguments,function(l){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var d=kr(this,l);d.insertBefore(l,d.firstChild)}})},before:function(){return Cn(this,arguments,function(l){this.parentNode&&this.parentNode.insertBefore(l,this)})},after:function(){return Cn(this,arguments,function(l){this.parentNode&&this.parentNode.insertBefore(l,this.nextSibling)})},empty:function(){for(var l,d=0;null!=(l=this[d]);d++)1===l.nodeType&&(m.cleanData(it(l,!1)),l.textContent="");return this},clone:function(l,d){return l=l??!1,d=d??l,this.map(function(){return m.clone(this,l,d)})},html:function(l){return Gt(this,function(d){var p=this[0]||{},_=0,h=this.length;if(void 0===d&&1===p.nodeType)return p.innerHTML;if("string"==typeof d&&!Qa.test(d)&&!Ct[(Tr.exec(d)||["",""])[1].toLowerCase()]){d=m.htmlPrefilter(d);try{for(;_<h;_++)1===(p=this[_]||{}).nodeType&&(m.cleanData(it(p,!1)),p.innerHTML=d);p=0}catch{}}p&&this.empty().append(d)},null,l,arguments.length)},replaceWith:function(){var l=[];return Cn(this,arguments,function(d){var p=this.parentNode;m.inArray(this,l)<0&&(m.cleanData(it(this)),p&&p.replaceChild(d,this))},l)}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(l,d){m.fn[l]=function(p){for(var _,h=[],f=m(p),C=f.length-1,S=0;S<=C;S++)_=S===C?this:this.clone(!0),m(f[S])[d](_),L.apply(h,_.get());return this.pushStack(h)}});var Ui=new RegExp("^("+Bi+")(?!px)[a-z%]+$","i"),Yi=/^--/,di=function(l){var d=l.ownerDocument.defaultView;return(!d||!d.opener)&&(d=R),d.getComputedStyle(l)},yr=function(l,d,p){var _,h,f={};for(h in d)f[h]=l.style[h],l.style[h]=d[h];for(h in _=p.call(l),d)l.style[h]=f[h];return _},os=new RegExp(At.join("|"),"i");function Pn(l,d,p){var _,h,f,C,S=Yi.test(d),E=l.style;return(p=p||di(l))&&(C=p.getPropertyValue(d)||p[d],S&&C&&(C=C.replace(he,"$1")||void 0),""===C&&!mn(l)&&(C=m.style(l,d)),!ce.pixelBoxStyles()&&Ui.test(C)&&os.test(d)&&(_=E.width,h=E.minWidth,f=E.maxWidth,E.minWidth=E.maxWidth=E.width=C,C=p.width,E.width=_,E.minWidth=h,E.maxWidth=f)),void 0!==C?C+"":C}function wr(l,d){return{get:function(){if(!l())return(this.get=d).apply(this,arguments);delete this.get}}}!function(){function l(){if(y){E.style.cssText="position:absolute;
1left:-11111px;width:60px;margin-top:1px;padding:0;border:0",y.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",en.appendChild(E).appendChild(y);var O=R.getComputedStyle(y);p="1%"!==O.top,S=12===d(O.marginLeft),y.style.right="60%",f=36===d(O.right),_=36===d(O.width),y.style.position="absolute",h=12===d(y.offsetWidth/3),en.removeChild(E),y=null}}function d(O){return Math.round(parseFloat(O))}var p,_,h,f,C,S,E=ee.createElement("div"),y=ee.createElement("div");y.style&&(y.style.backgroundClip="content-box",y.cloneNode(!0).style.backgroundClip="",ce.clearCloneStyle="content-box"===y.style.backgroundClip,m.extend(ce,{boxSizingReliable:function(){return l(),_},pixelBoxStyles:function(){return l(),f},pixelPosition:function(){return l(),p},reliableMarginLeft:function(){return l(),S},scrollboxSize:function(){return l(),h},reliableTrDimensions:function(){var O,N,v,A;return null==C&&(O=ee.createElement("table"),N=ee.createElement("tr"),v=ee.createElement("div"),O.style.cssText="position:absolute;left:-11111px;border-collapse:separate",N.style.cssText="box-sizing:content-box;border:1px solid",N.style.height="1px",v.style.height="9px",v.style.display="block",en.appendChild(O).appendChild(N).appendChild(v),A=R.getComputedStyle(N),C=parseInt(A.height,10)+parseInt(A.borderTopWidth,10)+parseInt(A.borderBottomWidth,10)===N.offsetHeight,en.removeChild(O)),C}}))}();var Dr=["Webkit","Moz","ms"],Or=ee.createElement("div").style,xr={};function Hi(l){return m.cssProps[l]||xr[l]||(l in Or?l:xr[l]=function rs(l){for(var d=l[0].toUpperCase()+l.slice(1),p=Dr.length;p--;)if((l=Dr[p]+d)in Or)return l}(l)||l)}var as=/^(none|table(?!-c[ea]).+)/,ss={position:"absolute",visibility:"hidden",display:"block"},Mr={letterSpacing:"0",fontWeight:"400"};function Fr(l,d,p){var _=nt.exec(d);return _?Math.max(0,_[2]-(p||0))+(_[3]||"px"):d}function Xi(l,d,p,_,h,f){var C="width"===d?1:0,S=0,E=0,y=0;if(p===(_?"border":"content"))return 0;for(;C<4;C+=2)"margin"===p&&(y+=m.css(l,p+At[C],!0,h)),_?("content"===p&&(E-=m.css(l,"padding"+At[C],!0,h)),"margin"!==p&&(E-=m.css(l,"border"+At[C]+"Width",!0,h))):(E+=m.css(l,"padding"+At[C],!0,h),"padding"!==p?E+=m.css(l,"border"+At[C]+"Width",!0,h):S+=m.css(l,"border"+At[C]+"Width",!0,h));return!_&&f>=0&&(E+=Math.max(0,Math.ceil(l["offset"+d[0].toUpperCase()+d.slice(1)]-f-E-S-.5))||0),E+y}function Pr(l,d,p){var _=di(l),f=(!ce.boxSizingReliable()||p)&&"border-box"===m.css(l,"boxSizing",!1,_),C=f,S=Pn(l,d,_),E="offset"+d[0].toUpperCase()+d.slice(1);if(Ui.test(S)){if(!p)return S;S="auto"}return(!ce.boxSizingReliable()&&f||!ce.reliableTrDimensions()&&_e(l,"tr")||"auto"===S||!parseFloat(S)&&"inline"===m.css(l,"display",!1,_))&&l.getClientRects().length&&(f="border-box"===m.css(l,"boxSizing",!1,_),(C=E in l)&&(S=l[E])),(S=parseFloat(S)||0)+Xi(l,d,p||(f?"border":"content"),C,_,S)+"px"}function ot(l,d,p,_,h){return new ot.prototype.init(l,d,p,_,h)}m.extend({cssHooks:{opacity:{get:function(l,d){if(d){var p=Pn(l,"opacity");return""===p?"1":p}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(l,d,p,_){if(l&&3!==l.nodeType&&8!==l.nodeType&&l.style){var h,f,C,S=Ft(d),E=Yi.test(d),y=l.style;if(E||(d=Hi(S)),C=m.cssHooks[d]||m.cssHooks[S],void 0===p)return C&&"get"in C&&void 0!==(h=C.get(l,!1,_))?h:y[d];if("string"==(f=typeof p)&&(h=nt.exec(p))&&h[1]&&(p=vr(l,d,h),f="number"),null==p||p!=p)return;"number"===f&&!E&&(p+=h&&h[3]||(m.cssNumber[S]?"":"px")),!ce.clearCloneStyle&&""===p&&0===d.indexOf("background")&&(y[d]="inherit"),(!C||!("set"in C)||void 0!==(p=C.set(l,p,_)))&&(E?y.setProperty(d,p):y[d]=p)}},css:function(l,d,p,_){var h,f,C,S=Ft(d);return Yi.test(d)||(d=Hi(S)),(C=m.cssHooks[d]||m.cssHooks[S])&&"get"in C&&(h=C.get(l,!0,p)),void 0===h&&(h=Pn(l,d,_)),"n
1ormal"===h&&d in Mr&&(h=Mr[d]),""===p||p?(f=parseFloat(h),!0===p||isFinite(f)?f||0:h):h}}),m.each(["height","width"],function(l,d){m.cssHooks[d]={get:function(p,_,h){if(_)return!as.test(m.css(p,"display"))||p.getClientRects().length&&p.getBoundingClientRect().width?Pr(p,d,h):yr(p,ss,function(){return Pr(p,d,h)})},set:function(p,_,h){var f,C=di(p),S=!ce.scrollboxSize()&&"absolute"===C.position,y=(S||h)&&"border-box"===m.css(p,"boxSizing",!1,C),O=h?Xi(p,d,h,y,C):0;return y&&S&&(O-=Math.ceil(p["offset"+d[0].toUpperCase()+d.slice(1)]-parseFloat(C[d])-Xi(p,d,"border",!1,C)-.5)),O&&(f=nt.exec(_))&&"px"!==(f[3]||"px")&&(p.style[d]=_,_=m.css(p,d)),Fr(0,_,O)}}}),m.cssHooks.marginLeft=wr(ce.reliableMarginLeft,function(l,d){if(d)return(parseFloat(Pn(l,"marginLeft"))||l.getBoundingClientRect().left-yr(l,{marginLeft:0},function(){return l.getBoundingClientRect().left}))+"px"}),m.each({margin:"",padding:"",border:"Width"},function(l,d){m.cssHooks[l+d]={expand:function(p){for(var _=0,h={},f="string"==typeof p?p.split(" "):[p];_<4;_++)h[l+At[_]+d]=f[_]||f[_-2]||f[0];return h}},"margin"!==l&&(m.cssHooks[l+d].set=Fr)}),m.fn.extend({css:function(l,d){return Gt(this,function(p,_,h){var f,C,S={},E=0;if(Array.isArray(_)){for(f=di(p),C=_.length;E<C;E++)S[_[E]]=m.css(p,_[E],!1,f);return S}return void 0!==h?m.style(p,_,h):m.css(p,_)},l,d,arguments.length>1)}}),m.Tween=ot,ot.prototype={constructor:ot,init:function(l,d,p,_,h,f){this.elem=l,this.prop=p,this.easing=h||m.easing._default,this.options=d,this.start=this.now=this.cur(),this.end=_,this.unit=f||(m.cssNumber[p]?"":"px")},cur:function(){var l=ot.propHooks[this.prop];return l&&l.get?l.get(this):ot.propHooks._default.get(this)},run:function(l){var d,p=ot.propHooks[this.prop];return this.pos=d=this.options.duration?m.easing[this.easing](l,this.options.duration*l,0,1,this.options.duration):l,this.now=(this.end-this.start)*d+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),p&&p.set?p.set(this):ot.propHooks._default.set(this),this}},ot.prototype.init.prototype=ot.prototype,ot.propHooks={_default:{get:function(l){var d;return 1!==l.elem.nodeType||null!=l.elem[l.prop]&&null==l.elem.style[l.prop]?l.elem[l.prop]:(d=m.css(l.elem,l.prop,""))&&"auto"!==d?d:0},set:function(l){m.fx.step[l.prop]?m.fx.step[l.prop](l):1!==l.elem.nodeType||!m.cssHooks[l.prop]&&null==l.elem.style[Hi(l.prop)]?l.elem[l.prop]=l.now:m.style(l.elem,l.prop,l.now+l.unit)}}},ot.propHooks.scrollTop=ot.propHooks.scrollLeft={set:function(l){l.elem.nodeType&&l.elem.parentNode&&(l.elem[l.prop]=l.now)}},m.easing={linear:function(l){return l},swing:function(l){return.5-Math.cos(l*Math.PI)/2},_default:"swing"},m.fx=ot.prototype.init,m.fx.step={};var vn,ci,ls=/^(?:toggle|show|hide)$/,ds=/queueHooks$/;function Wi(){ci&&(!1===ee.hidden&&R.requestAnimationFrame?R.requestAnimationFrame(Wi):R.setTimeout(Wi,m.fx.interval),m.fx.tick())}function Nr(){return R.setTimeout(function(){vn=void 0}),vn=Date.now()}function pi(l,d){var p,_=0,h={height:l};for(d=d?1:0;_<4;_+=2-d)h["margin"+(p=At[_])]=h["padding"+p]=l;return d&&(h.opacity=h.width=l),h}function Gr(l,d,p){for(var _,h=(Te.tweeners[d]||[]).concat(Te.tweeners["*"]),f=0,C=h.length;f<C;f++)if(_=h[f].call(p,d,l))return _}function Te(l,d,p){var _,h,f=0,C=Te.prefilters.length,S=m.Deferred().always(function(){delete E.elem}),E=function(){if(h)return!1;for(var N=vn||Nr(),v=Math.max(0,y.startTime+y.duration-N),z=1-(v/y.duration||0),me=0,ie=y.tweens.length;me<ie;me++)y.tweens[me].run(z);return S.notifyWith(l,[y,z,v]),z<1&&ie?v:(ie||S.notifyWith(l,[y,1,0]),S.resolveWith(l,[y]),!1)},y=S.promise({elem:l,props:m.extend({},d),opts:m.extend(!0,{specialEasing:{},easing:m.easing._default},p),originalProperties:d,originalOptions:p,startTime:vn||Nr(),duration:p.duration,tweens:[],createTween:function(N,v){var A=m.Tween(l,y.opts,N,v,y.opts.specialEasing[N]||y.opts.easing);return y.tweens.push(A),A},stop:function(N){var v=0,A=N?y.tweens.length:0;if(h)return this;for(h=!0;v<A;v++)y.tweens[v].run(1);return N?(S.notifyWith(l,[y,1,0]),S.resolveWith(l,[y,N])):S.rejectWith(l,[y,N]),this}}),O=y.props;for(function vt(l,d){var p,_,h,f,C;for(p in l)if(h=d[_=Ft(p)],f=l[p],Array.isArray(f)&&(h=f[1],f=l[p]=f[0]),p!==_&&(l[_]=f,delete l[p]),(C=m.cssHooks[_])&&"expand"in C)for(p in f=C.expand(f),delete l[_],f)p in l||(l[p]=f[p],d[p]=h);else d[_]=h}(O,y.opts.specialEasing);f<C;f++)if(_=Te.prefilters[f].call(y,l,O,y.opts))return q(_.stop)&&(m._queueHooks(y.elem,y.opts.queue).stop=_.stop.bind(_)),_;return m.map(O,Gr,y),q(y.opts.start)&&y.opts.start.call(l,y),y.progress(y.opts.progress).done(y.opts.done,y.opts.complete).fail(y.opts.fail).always(y.opts.always),m.fx.timer(m.extend(E,{elem:l,anim:y,queue:y.opts.queue})),y}m.Animation=m.extend(Te,{tweeners:{"*":[function(l,d){var p=this.createTween(l,d);return vr(p.elem,l,nt.exec(d),p),p}]},tweener:function(l,d){q(l)?(d=l,l=["*"]):l=l.match(ft);for(var p,_=0,h=l.length;_<h;_++)(Te.tweeners[p=l[_]]=Te.tweeners[p]||[]).unshift(d)},prefilters:[function le(l,d,p){var _,h,f,C,S,E,y,O,N="width"in d||"height"in d,v=this,A={},z=l.style,me=l.nodeType&&ai(l),ie=te.get(l,"fxshow");for(_ in p.queue||(null==(C=m._queueHooks(l,"fx")).unqueued&&(C.unqueued=0,S=C.empty.fire,C.empty.fire=function(){C.unqueued||S()}),C.unqueued++,v.always(function(){v.always(function(){C.unqueued--,m.queue(l,"fx").length||C.empty.fire()})})),d)if(ls.test(h=d[_])){if(delete d[_],f=f||"toggle"===h,h===(me?"hide":"show")){if("show"!==h||!ie||void 0===ie[_])continue;me=!0}A[_]=ie&&ie[_]||m.style(l,_)}if((E=!m.isEmptyObject(d))||!m.isEmptyObject(A))for(_ in N&&1===l.nodeType&&(p.overflow=[z.overflow,z.overflowX,z.overflowY],null==(y=ie&&ie.display)&&(y=te.get(l,"display")),"none"===(O=m.css(l,"display"))&&(y?O=y:(gn([l],
vendor: 4,259 bytes, line 1
1!0),y=l.style.display||y,O=m.css(l,"display"),gn([l]))),("inline"===O||"inline-block"===O&&null!=y)&&"none"===m.css(l,"float")&&(E||(v.done(function(){z.display=y}),null==y&&(y="none"===(O=z.display)?"":O)),z.display="inline-block")),p.overflow&&(z.overflow="hidden",v.always(function(){z.overflow=p.overflow[0],z.overflowX=p.overflow[1],z.overflowY=p.overflow[2]})),E=!1,A)E||(ie?"hidden"in ie&&(me=ie.hidden):ie=te.access(l,"fxshow",{display:y}),f&&(ie.hidden=!me),me&&gn([l],!0),v.done(function(){for(_ in me||gn([l]),te.remove(l,"fxshow"),A)m.style(l,_,A[_])})),E=Gr(me?ie[_]:0,_,v),_ in ie||(ie[_]=E.start,me&&(E.end=E.start,E.start=0))}],prefilter:function(l,d){d?Te.prefilters.unshift(l):Te.prefilters.push(l)}}),m.speed=function(l,d,p){var _=l&&"object"==typeof l?m.extend({},l):{complete:p||!p&&d||q(l)&&l,duration:l,easing:p&&d||d&&!q(d)&&d};return m.fx.off?_.duration=0:"number"!=typeof _.duration&&(_.duration=_.duration in m.fx.speeds?m.fx.speeds[_.duration]:m.fx.speeds._default),(null==_.queue||!0===_.queue)&&(_.queue="fx"),_.old=_.complete,_.complete=function(){q(_.old)&&_.old.call(this),_.queue&&m.dequeue(this,_.queue)},_},m.fn.extend({fadeTo:function(l,d,p,_){return this.filter(ai).css("opacity",0).show().end().animate({opacity:d},l,p,_)},animate:function(l,d,p,_){var h=m.isEmptyObject(l),f=m.speed(d,p,_),C=function(){var S=Te(this,m.extend({},l),f);(h||te.get(this,"finish"))&&S.stop(!0)};return C.finish=C,h||!1===f.queue?this.each(C):this.queue(f.queue,C)},stop:function(l,d,p){var _=function(h){var f=h.stop;delete h.stop,f(p)};return"string"!=typeof l&&(p=d,d=l,l=void 0),d&&this.queue(l||"fx",[]),this.each(function(){var h=!0,f=null!=l&&l+"queueHooks",C=m.timers,S=te.get(this);if(f)S[f]&&S[f].stop&&_(S[f]);else for(f in S)S[f]&&S[f].stop&&ds.test(f)&&_(S[f]);for(f=C.length;f--;)C[f].elem===this&&(null==l||C[f].queue===l)&&(C[f].anim.stop(p),h=!1,C.splice(f,1));(h||!p)&&m.dequeue(this,l)})},finish:function(l){return!1!==l&&(l=l||"fx"),this.each(function(){var d,p=te.get(this),_=p[l+"queue"],h=p[l+"queueHooks"],f=m.timers,C=_?_.length:0;for(p.finish=!0,m.queue(this,l,[]),h&&h.stop&&h.stop.call(this,!0),d=f.length;d--;)f[d].elem===this&&f[d].queue===l&&(f[d].anim.stop(!0),f.splice(d,1));for(d=0;d<C;d++)_[d]&&_[d].finish&&_[d].finish.call(this);delete p.finish})}}),m.each(["toggle","show","hide"],function(l,d){var p=m.fn[d];m.fn[d]=function(_,h,f){return null==_||"boolean"==typeof _?p.apply(this,arguments):this.animate(pi(d,!0),_,h,f)}}),m.each({slideDown:pi("show"),slideUp:pi("hide"),slideToggle:pi("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(l,d){m.fn[l]=function(p,_,h){return this.animate(d,p,_,h)}}),m.timers=[],m.fx.tick=function(){var l,d=0,p=m.timers;for(vn=Date.now();d<p.length;d++)!(l=p[d])()&&p[d]===l&&p.splice(d--,1);p.length||m.fx.stop(),vn=void 0},m.fx.timer=function(l){m.timers.push(l),m.fx.start()},m.fx.interval=13,m.fx.start=function(){ci||(ci=!0,Wi())},m.fx.stop=function(){ci=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(l,d){return l=m.fx&&m.fx.speeds[l]||l,this.queue(d=d||"fx",function(p,_){var h=R.setTimeout(p,l);_.stop=function(){R.clearTimeout(h)}})},function(){var l=ee.createElement("input"),p=ee.createElement("select").appendChild(ee.createElement("option"));l.type="checkbox",ce.checkOn=""!==l.value,ce.optSelected=p.selected,(l=ee.createElement("input")).value="t",l.type="radio",ce.radioValue="t"===l.value}();var ye,ve=m.expr.attrHandle;m.fn.extend({attr:function(l,d){return Gt(this,m.attr,l,d,arguments.length>1)},removeAttr:function(l){return this.each(function(){m.removeAttr(this,l)})}}),m.extend({attr:function(l,d,p){var _,h,f=l.nodeType;if(3!==f&&8!==f&&2!==f)return typeof l.getAttribute>"u"?m.prop(l,d,p):((1!==f||!m.isXMLDoc(l))&&(h=m.attrHooks[d.toLowerCase()]||(m.expr.match.bool.test(d)?ye:void 0)),void 0!==p?null===p?void m.removeAttr(l,d):h&&"set"in h&&void 0!==(_=h.set(l,p,d))?_:(l.setAttribute(d,p+""),p):h&&"get"in h&&null!==(_=h.get(l,d))?_:(_=m.find.attr(l,d))??void 0)},attrHooks:{type:{set:function(l,d){if(!ce.radioValue&&"radio"===d&&_e(l,"input")){var p=l.value;return l.setAttribute("type",d),p&&(l.value=p),d}}}},removeAttr:function(l,d){var p,_=0,h=d&&d.match(ft);
vendor: 5,111 bytes, line 1
1if(h&&1===l.nodeType)for(;p=h[_++];)l.removeAttribute(p)}}),ye={set:function(l,d,p){return!1===d?m.removeAttr(l,p):l.setAttribute(p,p),p}},m.each(m.expr.match.bool.source.match(/\w+/g),function(l,d){var p=ve[d]||m.find.attr;ve[d]=function(_,h,f){var C,S,E=h.toLowerCase();return f||(S=ve[E],ve[E]=C,C=null!=p(_,h,f)?E:null,ve[E]=S),C}});var Ar=/^(?:input|select|textarea|button)$/i,ui=/^(?:a|area)$/i;function mt(l){return(l.match(ft)||[]).join(" ")}function tn(l){return l.getAttribute&&l.getAttribute("class")||""}function zi(l){return Array.isArray(l)?l:"string"==typeof l&&l.match(ft)||[]}m.fn.extend({prop:function(l,d){return Gt(this,m.prop,l,d,arguments.length>1)},removeProp:function(l){return this.each(function(){delete this[m.propFix[l]||l]})}}),m.extend({prop:function(l,d,p){var _,h,f=l.nodeType;if(3!==f&&8!==f&&2!==f)return(1!==f||!m.isXMLDoc(l))&&(h=m.propHooks[d=m.propFix[d]||d]),void 0!==p?h&&"set"in h&&void 0!==(_=h.set(l,p,d))?_:l[d]=p:h&&"get"in h&&null!==(_=h.get(l,d))?_:l[d]},propHooks:{tabIndex:{get:function(l){var d=m.find.attr(l,"tabindex");return d?parseInt(d,10):Ar.test(l.nodeName)||ui.test(l.nodeName)&&l.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ce.optSelected||(m.propHooks.selected={get:function(l){return null},set:function(l){}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),m.fn.extend({addClass:function(l){var d,p,_,h,f,C;return q(l)?this.each(function(S){m(this).addClass(l.call(this,S,tn(this)))}):(d=zi(l)).length?this.each(function(){if(_=tn(this),p=1===this.nodeType&&" "+mt(_)+" "){for(f=0;f<d.length;f++)p.indexOf(" "+(h=d[f])+" ")<0&&(p+=h+" ");C=mt(p),_!==C&&this.setAttribute("class",C)}}):this},removeClass:function(l){var d,p,_,h,f,C;return q(l)?this.each(function(S){m(this).removeClass(l.call(this,S,tn(this)))}):arguments.length?(d=zi(l)).length?this.each(function(){if(_=tn(this),p=1===this.nodeType&&" "+mt(_)+" "){for(f=0;f<d.length;f++)for(h=d[f];p.indexOf(" "+h+" ")>-1;)p=p.replace(" "+h+" "," ");C=mt(p),_!==C&&this.setAttribute("class",C)}}):this:this.attr("class","")},toggleClass:function(l,d){var p,_,h,f,C=typeof l,S="string"===C||Array.isArray(l);return q(l)?this.each(function(E){m(this).toggleClass(l.call(this,E,tn(this),d),d)}):"boolean"==typeof d&&S?d?this.addClass(l):this.removeClass(l):(p=zi(l),this.each(function(){if(S)for(f=m(this),h=0;h<p.length;h++)f.hasClass(_=p[h])?f.removeClass(_):f.addClass(_);else(void 0===l||"boolean"===C)&&((_=tn(this))&&te.set(this,"__className__",_),this.setAttribute&&this.setAttribute("class",_||!1===l?"":te.get(this,"__className__")||""))}))},hasClass:function(l){var d,p,_=0;for(d=" "+l+" ";p=this[_++];)if(1===p.nodeType&&(" "+mt(tn(p))+" ").indexOf(d)>-1)return!0;return!1}});var cs=/\r/g;m.fn.extend({val:function(l){var d,p,_,h=this[0];return arguments.length?(_=q(l),this.each(function(f){var C;1===this.nodeType&&(null==(C=_?l.call(this,f,m(this).val()):l)?C="":"number"==typeof C?C+="":Array.isArray(C)&&(C=m.map(C,function(S){return null==S?"":S+""})),(!(d=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()])||!("set"in d)||void 0===d.set(this,C,"value"))&&(this.value=C))})):h?(d=m.valHooks[h.type]||m.valHooks[h.nodeName.toLowerCase()])&&"get"in d&&void 0!==(p=d.get(h,"value"))?p:"string"==typeof(p=h.value)?p.replace(cs,""):p??"":void 0}}),m.extend({valHooks:{option:{get:function(l){return m.find.attr(l,"value")??mt(m.text(l))}},select:{get:function(l){var d,p,_,h=l.options,f=l.selectedIndex,C="select-one"===l.type,S=C?null:[],E=C?f+1:h.length;for(_=f<0?E:C?f:0;_<E;_++)if(((p=h[_]).selected||_===f)&&!p.disabled&&(!p.parentNode.disabled||!_e(p.parentNode,"optgroup"))){if(d=m(p).val(),C)return d;S.push(d)}return S},set:function(l,d){for(var p,_,h=l.options,f=m.makeArray(d),C=h.length;C--;)((_=h[C]).selected=m.inArray(m.valHooks.option.get(_),f)>-1)&&(p=!0);return p||(l.selectedIndex=-1),f}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(l,d){if(Array.isArray(d))return l.checked=m.inArray(m(l).val(),d)>-1}},ce.checkOn||(m.valHooks[this].get=function(l){return null===l.getAttribute("value")?"on":l.value})});var Nn=R.location,Lr={guid:Date.now()},Ki=/\?/;m.parseXML=function(l){var d,p;if(!l||"string"!=typeof l)return null;try{d=(new R.DOMParser).parseFromString(l,"text/xml")}catch{}return p=d&&d.getElementsByTagName("parsererror")[0],(!d||p)&&m.error("Invalid XML: "+(p?m.map(p.childNodes,function(_){return _.textContent}).join("\n"):l)),d};var Br=/^(?:focusinfocus|focusoutblur)$/,jr=function(l){l.stopPropagation()};m.extend(m.event,{trigger:function(l,d,p,_){var h,f,C,S,E,y,O,N,v=[p||ee],A=e.call(l,"type")?l.type:l,z=e.call(l,"namespace")?l.namespace.split("."):[];if(f=N=C=p=p||ee,3!==p.nodeType&&8!==p.nodeType&&!Br.test(A+m.event.triggered)&&(A.indexOf(".")>-1&&(z=A.split("."),A=z.shift(),z.sort()),E=A.indexOf(":")<0&&"on"+A,(l=l[m.expando]?l:new m.Event(A,"object"==typeof l&&l)).isTrigger=_?2:3,l.namespace=z.join("."),l.rnamespace=l.namespace?new RegExp("(^|\\.)"+z.
vendor: 10,645 bytes, line 1
1join("\\.(?:.*\\.|)")+"(\\.|$)"):null,l.result=void 0,l.target||(l.target=p),d=null==d?[l]:m.makeArray(d,[l]),O=m.event.special[A]||{},_||!O.trigger||!1!==O.trigger.apply(p,d))){if(!_&&!O.noBubble&&!Le(p)){for(Br.test((S=O.delegateType||A)+A)||(f=f.parentNode);f;f=f.parentNode)v.push(f),C=f;C===(p.ownerDocument||ee)&&v.push(C.defaultView||C.parentWindow||R)}for(h=0;(f=v[h++])&&!l.isPropagationStopped();)N=f,l.type=h>1?S:O.bindType||A,(y=(te.get(f,"events")||Object.create(null))[l.type]&&te.get(f,"handle"))&&y.apply(f,d),(y=E&&f[E])&&y.apply&&xn(f)&&(l.result=y.apply(f,d),!1===l.result&&l.preventDefault());return l.type=A,!_&&!l.isDefaultPrevented()&&(!O._default||!1===O._default.apply(v.pop(),d))&&xn(p)&&E&&q(p[A])&&!Le(p)&&((C=p[E])&&(p[E]=null),m.event.triggered=A,l.isPropagationStopped()&&N.addEventListener(A,jr),p[A](),l.isPropagationStopped()&&N.removeEventListener(A,jr),m.event.triggered=void 0,C&&(p[E]=C)),l.result}},simulate:function(l,d,p){var _=m.extend(new m.Event,p,{type:l,isSimulated:!0});m.event.trigger(_,null,d)}}),m.fn.extend({trigger:function(l,d){return this.each(function(){m.event.trigger(l,d,this)})},triggerHandler:function(l,d){var p=this[0];if(p)return m.event.trigger(l,d,p,!0)}});var ps=/\[\]$/,Vr=/\r?\n/g,us=/^(?:submit|button|image|reset|file)$/i,_s=/^(?:input|select|textarea|keygen)/i;function Ji(l,d,p,_){var h;if(Array.isArray(d))m.each(d,function(f,C){p||ps.test(l)?_(l,C):Ji(l+"["+("object"==typeof C&&null!=C?f:"")+"]",C,p,_)});else if(p||"object"!==pn(d))_(l,d);else for(h in d)Ji(l+"["+h+"]",d[h],p,_)}m.param=function(l,d){var p,_=[],h=function(f,C){var S=q(C)?C():C;_[_.length]=encodeURIComponent(f)+"="+encodeURIComponent(S??"")};if(null==l)return"";if(Array.isArray(l)||l.jquery&&!m.isPlainObject(l))m.each(l,function(){h(this.name,this.value)});else for(p in l)Ji(p,l[p],d,h);return _.join("&")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var l=m.prop(this,"elements");return l?m.makeArray(l):this}).filter(function(){var l=this.type;return this.name&&!m(this).is(":disabled")&&_s.test(this.nodeName)&&!us.test(l)&&(this.checked||!Fn.test(l))}).map(function(l,d){var p=m(this).val();return null==p?null:Array.isArray(p)?m.map(p,function(_){return{name:d.name,value:_.replace(Vr,"\r\n")}}):{name:d.name,value:p.replace(Vr,"\r\n")}}).get()}});var ms=/%20/g,gs=/#.*$/,hs=/([?&])_=[^&]*/,fs=/^(.*?):[ \t]*([^\r\n]*)$/gm,Gn=/^(?:GET|HEAD)$/,_i=/^\/\//,$r={},qi={},Ur="*/".concat("*"),Qi=ee.createElement("a");function Yr(l){return function(d,p){"string"!=typeof d&&(p=d,d="*");var _,h=0,f=d.toLowerCase().match(ft)||[];if(q(p))for(;_=f[h++];)"+"===_[0]?(_=_.slice(1)||"*",(l[_]=l[_]||[]).unshift(p)):(l[_]=l[_]||[]).push(p)}}function Hr(l,d,p,_){var h={},f=l===qi;function C(S){var E;return h[S]=!0,m.each(l[S]||[],function(y,O){var N=O(d,p,_);return"string"!=typeof N||f||h[N]?f?!(E=N):void 0:(d.dataTypes.unshift(N),C(N),!1)}),E}return C(d.dataTypes[0])||!h["*"]&&C("*")}function Zi(l,d){var p,_,h=m.ajaxSettings.flatOptions||{};for(p in d)void 0!==d[p]&&((h[p]?l:_||(_={}))[p]=d[p]);return _&&m.extend(!0,l,_),l}Qi.href=Nn.href,m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Nn.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Nn.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ur,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(l,d){return d?Zi(Zi(l,m.ajaxSettings),d):Zi(m.ajaxSettings,l)},ajaxPrefilter:Yr($r),ajaxTransport:Yr(qi),ajax:function(l,d){"object"==typeof l&&(d=l,l=void 0);var p,_,h,f,C,S,E,y,O,N,v=m.ajaxSetup({},d=d||{}),A=v.context||v,z=v.context&&(A.nodeType||A.jquery)?m(A):m.event,me=m.Deferred(),ie=m.Callbacks("once memory"),we=v.statusCode||{},Ne={},rt={},gt="canceled",K={readyState:0,getResponseHeader:function(Ee){var Fe;if(E){if(!f)for(f={};Fe=fs.exec(h);)f[Fe[1].toLowerCase()+" "]=(f[Fe[1].toLowerCase()+" "]||[]).concat(Fe[2]);Fe=f[Ee.toLowerCase()+" "]}return null==Fe?null:Fe.join(", ")},getAllResponseHeaders:function(){return E?h:null},setRequestHeader:function(Ee,Fe){return null==E&&(Ee=rt[Ee.toLowerCase()]=rt[Ee.toLowerCase()]||Ee,Ne[Ee]=Fe),this},overrideMimeType:function(Ee){return null==E&&(v.mimeType=Ee),this},statusCode:function(Ee){var Fe;if(Ee)if(E)K.always(Ee[K.status]);else for(Fe in Ee)we[Fe]=[we[Fe],Ee[Fe]];return this},abort:function(Ee){var Fe=Ee||gt;return p&&p.abort(Fe),nn(0,Fe),this}};if(me.promise(K),v.url=((l||v.url||Nn.href)+"").replace(_i,Nn.protocol+"//"),v.type=d.method||d.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(ft)||[""],null==v.crossDomain){S=ee.createElement("a");try{S.href=v.url,S.href=S.href,v.crossDomain=Qi.protocol+"//"+Qi.host!=S.protocol+"//"+S.host}catch{v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=m.param(v.data,v.traditional)),Hr($r,v,d,K),E)return K;for(O in(y=m.event&&v.global)&&0==m.active++&&m.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Gn.test(v.type),_=v.url.replace(gs,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(ms,"+")):(N=v.url.slice(_.length),v.data&&(v.processData||"string"==typeof v.data)&&(_+=(Ki.test(_)?"&":"?")+v.data,delete v.data),!1===v.cache&&(_=_.replace(hs,"$1"),N=(Ki.test(_)?"&":"?")+"_="+Lr.guid+++N),v.url=_+N),v.ifModified&&(m.lastModified[_]&&K.setRequestHeader("If-Modified-Since",m.lastModified[_]),m.etag[_]&&K.setRequestHeader("If-None-Match",m.etag[_])),(v.data&&v.hasContent&&!1!==v.contentType||d.contentType)&&K.setRequestHeader("Content-Type",v.contentType),K.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Ur+"; q=0.01":""):v.accepts["*"]),v.headers)K.setRequestHeader(O,v.headers[O]);if(v.beforeSend&&(!1===v.beforeSend.call(A,K,v)||E))return K.abort();if(gt="abort",ie.add(v.complete),K.done(v.success),K.fail(v.error),p=Hr(qi,v,d,K)){if(K.readyState=1,y&&z.trigger("ajaxSend",[K,v]),E)return K;v.async&&v.timeout>0&&(C=R.setTimeout(function(){K.abort("timeout")},v.timeout));try{E=!1,p.send(Ne,nn)}catch(Ee){if(E)throw Ee;nn(-1,Ee)}}else nn(-1,"No Transport");function nn(Ee,Fe,on,to){var Oe,Me,yt,ae,Wt,bt=Fe;E||(E=!0,C&&R.clearTimeout(C),p=void 0,h=to||"",K.readyState=Ee>0?4:0,Oe=Ee>=200&&Ee<300||304===Ee,on&&(ae=function vs(l,d,p){for(var _,h,f,C,S=l.contents,E=l.dataTypes;"*"===E[0];)E.shift(),void 0===_&&(_=l.mimeType||d.getResponseHeader("Content-Type"));if(_)for(h in S)if(S[h]&&S[h].test(_)){E.unshift(h);break}if(E[0]in p)f=E[0];else{for(h in p){if(!E[0]||l.converters[h+" "+E[0]]){f=h;break}C||(C=h)}f=f||C}if(f)return f!==E[0]&&E.unshift(f),p[f]}(v,K,on)),!Oe&&m.inArray("script",v.dataTypes)>-1&&m.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),ae=function bs(l,d,p,_){var h,f,C,S,E,y={},O=l.dataTypes.slice();if(O[1])for(C in l.converters)y[C.toLowerCase()]=l.converters[C];for(f=O.shift();f;)if(l.responseFields[f]&&(p[l.responseFields[f]]=d),!E&&_&&l.dataFilter&&(d=l.dataFilter(d,l.dataType)),E=f,f=O.shift())if("*"===f)f=E;else if("*"!==E&&E!==f){if(!(C=y[E+" "+f]||y["* "+f]))for(h in y)if((S=h.split(" "))[1]===f&&(C=y[E+" "+S[0]]||y["* "+S[0]])){!0===C?C=y[h]:!0!==y[h]&&(f=S[0],O.unshift(S[1]));break}if(!0!==C)if(C&&l.throws)d=C(d);else try{d=C(d)}catch(N){return{state:"parsererror",error:C?N:"No conversion from "+E+" to "+f}}}return{state:"success",data:d}}(v,ae,K,Oe),Oe?(v.ifModified&&((Wt=K.getResponseHeader("Last-Modified"))&&(m.lastModified[_]=Wt),(Wt=K.getResponseHeader("etag"))&&(m.etag[_]=Wt)),204===Ee||"HEAD"===v.type?bt="nocontent":304===Ee?bt="notmodified":(bt=ae.state,Me=ae.data,Oe=!(yt=ae.error))):(yt=bt,(Ee||!bt)&&(bt="error",Ee<0&&(Ee=0))),K.status=Ee,K.statusText=(Fe||bt)+"",Oe?me.resolveWith(A,[Me,bt,K]):me.rejectWith(A,[K,bt,yt]),K.statusCode(we),we=void 0,y&&z.trigger(Oe?"ajaxSuccess":"ajaxError",[K,v,Oe?Me:yt]),ie.fireWith(A,[K,bt]),y&&(z.trigger("ajaxComplete",[K,v]),--m.active||m.event.trigger("ajaxStop")))}return K},getJSON:function(l,d,p){return m.get(l,d,p,"json")},getScript:function(l,d){return m.get(l,void 0,d,"script")}}),m.each(["get","post"],function(l,d){m[d]=function(p,_,h,f){return q(_)&&(f=f||h,h=_,_=void 0),m.ajax(m.extend({url:p,type:d,dataType:f,data:_,success:h},m.isPlainObject(p)&&p))}}),m.ajaxPrefilter(function(l){var d;for(d in l.headers)"content-type"===d.toLowerCase()&&(l.contentType=l.headers[d]||"")}),m._evalUrl=function(l,d,p){return m.ajax({url:l,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(_){m.globalEval(_,d,p)}})},m.fn.extend({wrapAll:function(l){var d;return this[0]&&(q(l)&&(l=l.call(this[0])),d=m(l,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&d.insertBefore(this[0]),d.map(function(){for(var p=this;p.firstElementChild;)p=p.firstElementChild;return p}).append(this)),this},wrapInner:function(l){return q(l)?this.each(function(d){m(this).wrapInner(l.call(this,d))}):this.each(function(){var d=m(this),p=d.contents();p.length?p.wrapAll(l):d.append(l)})},wrap:function(l){var d=q(l);return this.each(function(p){m(this).wrapAll(d?l.call(this,p):l)})},unwrap:function(l){return this.parent(l).not("body").each(function(){m(this).replaceWith(this.childNodes)}),this}}),m.expr.pseudos.hidden=function(l){return!m.expr.pseudos.visible(l)},m.expr.pseudos.visible=function(l){return!!(l.offsetWidth||l.offsetHeight||l.getClientRects().length)},m.ajaxSettings.xhr=function(){try{return new R.XMLHttpRequest}catch{}};var Ts={0:200,1223:204},An=m.ajaxSettings.xhr();ce.cors=!!An&&"withCredentials"in An,ce.ajax=An=!!An,m.ajaxTransport(function(l){var d,p;if(ce.cors||An&&!l.crossDomain)return{send:function(_,h){var f,C=l.xhr();if(C.open(l.type,l.url,l.async,l.username,l.password),l.xhrFields)for(f in l.xhrFields)C[f]=l.xhrFields[f];for(f in l.mimeType&&C.overrideMimeType&&C.overrideMimeType(l.mimeType),!l.crossDomain&&!_["X-Requested-With"]&&(_["X-Requested-With"]="XMLHttpRequest"),_)C.setRequestHeader(f,_[f]);d=function(S){return function(){d&&(d=p=C.onload=C.onerror=C.onabort=C.ontimeout=C.onreadystatechange=null,"abort"===S?C.abort():"error"===S?"
1number"!=typeof C.status?h(0,"error"):h(C.status,C.statusText):h(Ts[C.status]||C.status,C.statusText,"text"!==(C.responseType||"text")||"string"!=typeof C.responseText?{binary:C.response}:{text:C.responseText},C.getAllResponseHeaders()))}},C.onload=d(),p=C.onerror=C.ontimeout=d("error"),void 0!==C.onabort?C.onabort=p:C.onreadystatechange=function(){4===C.readyState&&R.setTimeout(function(){d&&p()})},d=d("abort");try{C.send(l.hasContent&&l.data||null)}catch(S){if(d)throw S}},abort:function(){d&&d()}}}),m.ajaxPrefilter(function(l){l.crossDomain&&(l.contents.script=!1)}),m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(l){return m.globalEval(l),l}}}),m.ajaxPrefilter("script",function(l){void 0===l.cache&&(l.cache=!1),l.crossDomain&&(l.type="GET")}),m.ajaxTransport("script",function(l){var d,p;if(l.crossDomain||l.scriptAttrs)return{send:function(_,h){d=m("<script>").attr(l.scriptAttrs||{}).prop({charset:l.scriptCharset,src:l.url}).on("load error",p=function(f){d.remove(),p=null,f&&h("error"===f.type?404:200,f.type)}),ee.head.appendChild(d[0])},abort:function(){p&&p()}}});var l,Xr=[],eo=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var l=Xr.pop()||m.expando+"_"+Lr.guid++;return this[l]=!0,l}}),m.ajaxPrefilter("json jsonp",function(l,d,p){var _,h,f,C=!1!==l.jsonp&&(eo.test(l.url)?"url":"string"==typeof l.data&&0===(l.contentType||"").indexOf("application/x-www-form-urlencoded")&&eo.test(l.data)&&"data");if(C||"jsonp"===l.dataTypes[0])return _=l.jsonpCallback=q(l.jsonpCallback)?l.jsonpCallback():l.jsonpCallback,C?l[C]=l[C].replace(eo,"$1"+_):!1!==l.jsonp&&(l.url+=(Ki.test(l.url)?"&":"?")+l.jsonp+"="+_),l.converters["script json"]=function(){return f||m.error(_+" was not called"),f[0]},l.dataTypes[0]="json",h=R[_],R[_]=function(){f=arguments},p.always(function(){void 0===h?m(R).removeProp(_):R[_]=h,l[_]&&(l.jsonpCallback=d.jsonpCallback,Xr.push(_)),f&&q(h)&&h(f[0]),f=h=void 0}),"script"}),ce.createHTMLDocument=((l=ee.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===l.childNodes.length),m.parseHTML=function(l,d,p){return"string"!=typeof l?[]:("boolean"==typeof d&&(p=d,d=!1),d||(ce.createHTMLDocument?((_=(d=ee.implementation.createHTMLDocument("")).createElement("base")).href=ee.location.href,d.head.appendChild(_)):d=ee),f=!p&&[],(h=gr.exec(l))?[d.createElement(h[1])]:(h=Vi([l],d,f),f&&f.length&&m(f).remove(),m.merge([],h.childNodes)));var _,h,f},m.fn.load=function(l,d,p){var _,h,f,C=this,S=l.indexOf(" ");return S>-1&&(_=mt(l.slice(S)),l=l.slice(0,S)),q(d)?(p=d,d=void 0):d&&"object"==typeof d&&(h="POST"),C.length>0&&m.ajax({url:l,type:h||"GET",dataType:"html",data:d}).done(function(E){f=arguments,C.html(_?m("<div>").append(m.parseHTML(E)).find(_):E)}).always(p&&function(E,y){C.each(function(){p.apply(this,f||[E.responseText,y,E])})}),this},m.expr.pseudos.animated=function(l){return m.grep(m.timers,function(d){return l===d.elem}).length},m.offset={setOffset:function(l,d,p){var _,h,f,C,S,E,O=m.css(l,"position"),N=m(l),v={};"static"===O&&(l.style.position="relative"),S=N.offset(),f=m.css(l,"top"),E=m.css(l,"left"),("absolute"===O||"fixed"===O)&&(f+E).indexOf("auto")>-1?(C=(_=N.position()).top,h=_.left):(C=parseFloat(f)||0,h=parseFloat(E)||0),q(d)&&(d=d.call(l,p,m.extend({},S))),null!=d.top&&(v.top=d.top-S.top+C),null!=d.left&&(v.left=d.left-S.left+h),"using"in d?d.using.call(l,v):N.css(v)}},m.fn.extend({offset:function(l){if(arguments.length)return void 0===l?this:this.each(function(h){m.offset.setOffset(this,l,h)});var d,p,_=this[0];return _?_.getClientRects().length?{top:(d=_.getBoundingClientRect()).top+(p=_.ownerDocument.defaultView).pageYOffset,left:d.left+p.pageXOffset}:{top:0,left:0}:void 0},position:function(){if(this[0]){var l,d,p,_=this[0],h={top:0,left:0};if("fixed"===m.css(_,"position"))d=_.getBoundingClientRect();else{for(d=this.offset(),p=_.ownerDocument,l=_.offsetParent||p.documentElement;l&&(l===p.body||l===p.documentElement)&&"static"===m.css(l,"position");)l=l.parentNode;l&&l!==_&&1===l.nodeType&&((h=m(l).offset()).top+=m.css(l,"borderTopWidth",!0),h.left+=m.css(l,"borderLeftWidth",!0))}return{top:d.top-h.top-m.css(_,"marginTop",!0),left:d.left-h.left-m.css(_,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var l=this.offsetParent;l&&"static"===m.css(l,"position");)l=l.offsetParent;return l||en})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(l,d){var p="pageYOffset"===d;m.fn[l]=function(_){return Gt(this,function(h,f,C){var S;if(Le(h)?S=h:9===h.nodeType&&(S=h.defaultView),void 0===C)return S?S[d]:h[f];S?S.scrollTo(p?S.pageXOffset:C,p?C:S.pageYOffset):h[f]=C},l,_,arguments.length)}}),m.each(["top","left"],function(l,d){m.cssHooks[d]=wr(ce.pixelPosition,function(p,_){if(_)return _=Pn(p,d),Ui.test(_)?m(p).position()[d]+"px":_})}),m.each({Height:"height",Width:"width"},function(l,d){m.each({padding:"inner"+l,content:d,"":"outer"+l},function(p,_){m.fn[_]=function(h,f){var C=arguments.length&&(p||"boolean"!=typeof h),S=p||
vendor: 1,959 bytes, line 1
1(!0===h||!0===f?"margin":"border");return Gt(this,function(E,y,O){var N;return Le(E)?0===_.indexOf("outer")?E["inner"+l]:E.document.documentElement["client"+l]:9===E.nodeType?(N=E.documentElement,Math.max(E.body["scroll"+l],N["scroll"+l],E.body["offset"+l],N["offset"+l],N["client"+l])):void 0===O?m.css(E,y,S):m.style(E,y,O,S)},d,C?h:void 0,C)}})}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(l,d){m.fn[d]=function(p){return this.on(d,p)}}),m.fn.extend({bind:function(l,d,p){return this.on(l,null,d,p)},unbind:function(l,d){return this.off(l,null,d)},delegate:function(l,d,p,_){return this.on(d,l,p,_)},undelegate:function(l,d,p){return 1===arguments.length?this.off(l,"**"):this.off(d,l||"**",p)},hover:function(l,d){return this.on("mouseenter",l).on("mouseleave",d||l)}}),m.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(l,d){m.fn[d]=function(p,_){return arguments.length>0?this.on(d,null,p,_):this.trigger(d)}});var Es=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;m.proxy=function(l,d){var p,_,h;if("string"==typeof d&&(p=l[d],d=l,l=p),q(l))return _=ge.call(arguments,2),h=function(){return l.apply(d||this,_.concat(ge.call(arguments)))},h.guid=l.guid=l.guid||m.guid++,h},m.holdReady=function(l){l?m.readyWait++:m.ready(!0)},m.isArray=Array.isArray,m.parseJSON=JSON.parse,m.nodeName=_e,m.isFunction=q,m.isWindow=Le,m.camelCase=Ft,m.type=pn,m.now=Date.now,m.isNumeric=function(l){var d=m.type(l);return("number"===d||"string"===d)&&!isNaN(l-parseFloat(l))},m.trim=function(l){return null==l?"":(l+"").replace(Es,"$1")},void 0!==(M=function(){return m}.apply(dr,[]))&&(lr.exports=M);var Ss=R.jQuery,ks=R.$;return m.noConflict=function(l){return R.$===m&&(R.$=ks),l&&R.jQuery===m&&(R.jQuery=Ss),m},typeof cn>"u"&&(R.jQuery=R.$=m),m})}}]);

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.