import{a as le,b as _e,c as d,d as pe,e as me,g as ge}from"./chunk-6CY34PH5.js";import{b as de}from"./chunk-X6XKYEEJ.js";import{c as ce}from"./chunk-PY36RJBP.js";import{c as Ce}from"./chunk-7M3X7FU6.js";import{c as ne}from"./chunk-TFQ3RBKD.js";import{a as ae}from"./chunk-TRE4H2YK.js";import{a as se}from"./chunk-N2WXLUZD.js";import{a as re}from"./chunk-RU43IR5J.js";import{ba as oe}from"./chunk-FBI7JGZC.js";import{r as ie}from"./chunk-MXUIPT66.js";import{I as te,f as Z,l as ee}from"./chunk-DX7LHTFF.js";import{Aa as _,Ab as l,Ba as p,Bb as V,Cb as w,Db as k,Dc as K,Fb as b,Gd as G,Kb as g,Kd as J,Lb as s,Ob as W,Og as X,Ua as r,Va as C,Wc as q,Xb as j,Xc as z,Yb as f,_b as S,cc as R,dc as D,ec as A,gb as H,ib as M,ic as Q,ob as a,rc as x,sc as v,t as U,ta as B,wc as $,yh as Y,zb as m}from"./chunk-N6B2OJOY.js";var fe=()=>["/","my-account","cost-center-management"];function Se(o,c){if(o&1){let e=b();m(0,"div",17)(1,"div",18)(2,"button",19),g("click",function(){_(e);let t=s(2);return p(t.toggleAll())}),f(3),x(4,"cxTranslate"),l()()()}if(o&2){let e=s(2);r(3),S(" ",v(4,1,e.allExpanded?"common.closeAll":"common.openAll")," ")}}function xe(o,c){if(o&1){let e=b();w(0),m(1,"foerch-cost-center-mobile-position-list-table",20),g("selectionChanged",function(t){_(e);let i=s(2);return p(i.onSelectionChanged(t))}),l(),k()}if(o&2){let e=s(2);r(),a("articleNumberMode",e.articleNumberMode)("b2bUnit",e.user==null||e.user.unit==null?null:e.user.unit.uid)("costCenterPositionCode",e.costCenterPositions[0]==null?null:e.costCenterPositions[0].code)("isSelectionEnabled",e.selectedFilter===e.positionListFilters.TKM)("mapping",e.mapping)("positions",e.costCenterPositions[0]==null?null:e.costCenterPositions[0].positions)("searchQuery",e.searchQuery)("sortModel",e.sortModel)("totalPrice",e.costCenterPositions[0]==null?null:e.costCenterPositions[0].totalPricePositions)}}function ve(o,c){if(o&1){let e=b();m(0,"foerch-cost-center-position-list-header",22),g("expansionStateChanged",function(t){_(e);let i=s(3);return p(i.onExpansionStateChanged(t))})("selectionChanged",function(t){_(e);let i=s(3);return p(i.onSelectionChanged(t))}),l()}if(o&2){let e=c.$implicit,n=s(3);a("costCenterPosition",e)("isMobileView",!0)("isSelectionEnabled",n.selectedFilter===n.positionListFilters.TKM)("mapping",n.mapping)("searchQuery",n.searchQuery)("sortModel",n.sortModel)}}function Pe(o,c){if(o&1&&(w(0),M(1,ve,1,6,"foerch-cost-center-position-list-header",21),k()),o&2){let e=s(2);r(),a("ngForOf",e.costCenterPositions)("ngForTrackBy",e.trackByPosition)}}function Me(o,c){if(o&1){let e=b();m(0,"foerch-bulk-rebooking",23),g("bulkSelectionChanged",function(t){_(e);let i=s(2);return p(i.onBulkSelectionChanged(t))})("rebookSuccess",function(){_(e);let t=s(2);return p(t.onRebookSuccess())}),l()}if(o&2){let e=s(2);a("allSelected",e.allSelected)("costCenterCodes",e.costCenterCodes)("interval",e.interval)("isMobile",!0)("isSelectionPossible",e.hasSelectablePositions)("selectedPositions",e.selectedPositions)("topCostCenterCode",e.topCostCenterCode)}}function Fe(o,c){if(o&1){let e=b();w(0),m(1,"div",2)(2,"button",3),V(3,"cx-icon",4),f(4),x(5,"cxTranslate"),l(),m(6,"div",5),f(7),l()(),m(8,"div",6),V(9,"cx-icon",4),f(10),x(11,"cxTranslate"),l(),m(12,"div",7)(13,"foerch-search-input",8),g("searchString",function(t){_(e);let i=s();return p(i.onSearchQueryChanged(t))}),l()(),m(14,"div",7)(15,"ng-select",9),x(16,"cxTranslate"),A("ngModelChange",function(t){_(e);let i=s();return D(i.selectedFilter,t)||(i.selectedFilter=t),p(t)}),l()(),m(17,"foerch-date-range",10),g("dateRangeChanged",function(t){_(e);let i=s();return p(i.onDateRangeChanged(t))}),l(),m(18,"div",11)(19,"div",12)(20,"ng-select",13),A("ngModelChange",function(t){_(e);let i=s();return D(i.selectedSort,t)||(i.selectedSort=t),p(t)}),g("change",function(t){_(e);let i=s();return p(i.onMobileSortingChange(t))}),l()(),M(21,Se,5,3,"div",14),l(),M(22,xe,2,9,"ng-container",15)(23,Pe,2,2,"ng-container",15)(24,Me,1,7,"foerch-bulk-rebooking",16),k()}if(o&2){let e=s();r(2),a("routerLink",Q(27,fe)),r(),a("type",e.icons.ARROW_LEFT),r(),S("",v(5,21,"common.back")," "),r(3),S(" ",e.topCostCenter==null?null:e.topCostCenter.name," "),r(2),a("type",e.icons.INFO),r(),S(" ",v(11,23,"costCenterPositionList.rebookingNote")," "),r(3),a("placeholder","costCenterPositionList.searchArticlePlaceholder"),r(2),W("placeholder",v(16,25,"costCenterPositionList.filter.filter")),a("clearable",!1)("items",e.filterOptions),R("ngModel",e.selectedFilter),r(2),a("dateRange",e.interval)("maxDate",e.maxDate),r(3),a("clearable",!1)("items",e.sortItems)("searchable",!1),R("ngModel",e.selectedSort),r(),a("ngIf",!e.isCostCenterWithoutSubs),r(),a("ngIf",e.isCostCenterWithoutSubs),r(),a("ngIf",!e.isCostCenterWithoutSubs),r(),a("ngIf",e.selectedFilter===e.positionListFilters.TKM)}}function Le(o,c){o&1&&(f(0),x(1,"cxTranslate")),o&2&&S(" ",v(1,1,"costCenterPositionList.invalidURL"),` `)}var rt=(()=>{let c=class c extends ge{constructor(n,t,i,u,F,L,y,P,I){super(n,t,i,u,F,L,y,P,I),this.activatedRoute=n,this.userAccountService=t,this.costCenterService=i,this.costCentersManagementService=u,this.costCenterPositionsService=F,this.translationService=L,this.permissionsService=y,this.loggingService=P,this.cd=I,this.sortModel={sortBy:d.CODE,sortDirection:oe.ASC},this.sortItems=[]}ngOnInit(){super.ngOnInit(),this._subs$.add(U([this.translationService.translate("costCenterPositionList.table.articleNumberHeader"),this.translationService.translate("costCenterPositionList.table.articleHeader"),this.translationService.translate("costCenterPositionList.table.purchaseDateHeader"),this.translationService.translate("costCenterPositionList.table.orderReasonHeader"),this.translationService.translate("costCenterPositionList.table.customerHeader"),this.translationService.translate("costCenterPositionList.table.amountHeader"),this.translationService.translate("costCenterPositionList.table.sumHeader"),this.translationService.translate("common.sorting"),this.translationService.translate("common.asc"),this.translationService.translate("common.desc"),this.translationService.translate("common.dateAsc"),this.translationService.translate("common.dateDesc")]).subscribe(([n,t,i,u,F,L,y,P,I,he,T,E])=>{let h=(N,O,ue=I,be=he)=>[{name:`${P}: ${N} ${ue}`,value:`${O}_ASC`},{name:`${P}: ${N} ${be}`,value:`${O}_DESC`}];this.sortItems=[],this.sortItems.push(...h(n,d.CODE),...h(t,d.DESCRIPTION),...h(i,d.PURCHASE_DATE,T,E),...h(u,d.REASON),...h(F,d.CUSTOMER),...h(L,d.AMOUNT,T,E),...h(y,d.SUM,T,E)),this.selectedSort=this.sortItems[0].value}))}onMobileSortingChange(n){let t=n.value.split("_");this.sortModel={sortBy:t[0],sortDirection:t[1]}}};c.\u0275fac=function(t){return new(t||c)(C(G),C(ne),C(Ce),C(ce),C(le),C(X),C(re),C(de),C(K))},c.\u0275cmp=B({type:c,selectors:[["foerch-cost-center-mobile-position-list"]],features:[H],decls:3,vars:2,consts:[["invalidURL",""],[4,"ngIf","ngIfElse"],[1,"reminderDetailHead"],["type","button",1,"btn","btn-tertiary","btn-back",3,"routerLink"],[3,"type"],[1,"h3","mb-3"],[1,"costCenterMobilePositionList-info"],[1,"form-group"],[3,"searchString","placeholder"],["bindLabel","label","bindValue","value",3,"ngModelChange","placeholder","clearable","items","ngModel"],[3,"dateRangeChanged","dateRange","maxDate"],[1,"row","align-items-basement","pt-1"],[1,"col-auto"],["bindLabel","name","bindValue","value","labelForId","orderSortingDropDown",1,"ng-select_alt",3,"ngModelChange","change","clearable","items","searchable","ngModel"],["class","col",4,"ngIf"],[4,"ngIf"],[3,"allSelected","costCenterCodes","interval","isMobile","isSelectionPossible","selectedPositions","topCostCenterCode","bulkSelectionChanged","rebookSuccess",4,"ngIf"],[1,"col"],[1,"orderTemplate-toggleAll"],[1,"btn","btn-link_secondary","text-nowrap",3,"click"],[3,"selectionChanged","articleNumberMode","b2bUnit","costCenterPositionCode","isSelectionEnabled","mapping","positions","searchQuery","sortModel","totalPrice"],[3,"costCenterPosition","isMobileView","isSelectionEnabled","mapping","searchQuery","sortModel","expansionStateChanged","selectionChanged",4,"ngFor","ngForOf","ngForTrackBy"],[3,"expansionStateChanged","selectionChanged","costCenterPosition","isMobileView","isSelectionEnabled","mapping","searchQuery","sortModel"],[3,"bulkSelectionChanged","rebookSuccess","allSelected","costCenterCodes","interval","isMobile","isSelectionPossible","selectedPositions","topCostCenterCode"]],template:function(t,i){if(t&1&&M(0,Fe,25,28,"ng-container",1)(1,Le,2,3,"ng-template",null,0,$),t&2){let u=j(2);a("ngIf",!i.isInvalidUrl)("ngIfElse",u)}},dependencies:[q,z,ie,J,te,Z,ee,ae,se,me,pe,_e,Y],encapsulation:2});let o=c;return o})();export{rt as a};