import{a as me}from"./chunk-RRVEX3AP.js";import{a as ot,b as rt,c as ct,f as pe,g as dt}from"./chunk-4ENQACUL.js";import{a as at,b as pt,c as st}from"./chunk-GSLPDASC.js";import{a as mt}from"./chunk-AFYHCFWY.js";import{b as lt}from"./chunk-PSWVHTEU.js";import{a as nt}from"./chunk-FKH74CIW.js";import{a as ze}from"./chunk-ISCIGLF2.js";import{J as le}from"./chunk-CWWVHRJU.js";import{b as We,c as $e,d as je,j as Ge,l as Qe}from"./chunk-7JA7UHZ2.js";import{b as Ye,c as Xe}from"./chunk-QMZQK3O6.js";import{a as oe}from"./chunk-RU43IR5J.js";import{a as G}from"./chunk-Y7IP5WLG.js";import{b as qe}from"./chunk-ISDPQX42.js";import{a as ae}from"./chunk-SLGBXDUF.js";import{a as He}from"./chunk-LY6HB4BL.js";import{a as Ue}from"./chunk-Q2GL4HAH.js";import{g as X,n as Ke,o as Je,p as Ze,q as et,r as tt,s as it}from"./chunk-L7CU4UNF.js";import{a as ce}from"./chunk-NFSBDFF3.js";import{a as re}from"./chunk-VQWPF2OP.js";import{da as Ne,m as Y}from"./chunk-FBI7JGZC.js";import{U as j,V as De,qa as Oe,r as $,s as Be}from"./chunk-MXUIPT66.js";import{I as ne,b as Re,f as q,l as W}from"./chunk-DX7LHTFF.js";import{Aa as f,Ab as l,Ba as h,Bb as g,Cb as y,Da as be,Db as I,Dc as Se,Fb as v,Ha as ye,Ka as _e,Kb as x,Kd as te,Lb as c,Na as Z,Nd as we,Ob as Ie,Og as Ae,Pb as K,Ua as n,Va as T,Vc as U,Wc as Fe,Wg as ie,Xb as Me,Xc as H,Xg as ke,Yb as u,_b as C,a as ge,bd as ee,cc as L,dc as R,dd as Pe,ec as B,fh as Ve,gb as A,gc as Te,ib as _,ic as ue,jc as M,kc as N,ob as a,pa as ve,qb as E,rc as s,sc as d,t as xe,ta as w,tc as F,ub as S,wc as Ee,yh as k,zb as m,zh as Le}from"./chunk-N6B2OJOY.js";var Pt=t=>({items:t});function wt(t,r){if(t&1&&(m(0,"div",21),u(1),l()),t&2){let e=c(2);n(),C(" ",e.item.product.code," ")}}function At(t,r){if(t&1){let e=v();m(0,"div",22)(1,"foerch-input",23),s(2,"cxTranslate"),s(3,"cxTranslate"),x("valueChanged",function(o){f(e);let p=c(2);return h(p.updateEntryComment(o))}),l()()}if(t&2){let e=c(2);n(),K("inputId","comment_",e.item.pk,""),Ie("value",e.item.comment),a("label",d(2,5,"cartItems.commentLabel"))("placeholder",d(3,7,"cartItems.commentPlaceholder"))}}function kt(t,r){t&1&&(m(0,"div",30),u(1),s(2,"cxTranslate"),l()),t&2&&(n(),C(" ",d(2,1,"cartItems.mandatoryCostCentersHint")," "))}function Vt(t,r){if(t&1){let e=v();m(0,"div",31)(1,"ng-select",32),s(2,"cxTranslate"),B("ngModelChange",function(o){f(e);let p=c(5);return R(p.selectedOrderReason,o)||(p.selectedOrderReason=o),h(o)}),l()()}if(t&2){let e=r.ngIf,i=c(5);n(),a("clearable",!1)("disabled",i.selectedCostCenter===null||(e.items==null?null:e.items.length)===0)("items",e.items)("placeholder",d(2,5,"cartItems.purchaseReasonEntryLabel")),L("ngModel",i.selectedOrderReason)}}function Lt(t,r){if(t&1){let e=v();y(0),m(1,"div",25),u(2),s(3,"cxTranslate"),m(4,"div",26)(5,"ng-select",27),s(6,"async"),s(7,"cxTranslate"),B("ngModelChange",function(o){f(e);let p=c(4);return R(p.selectedCostCenter,o)||(p.selectedCostCenter=o),h(o)}),x("change",function(o){f(e);let p=c(4);return h(p.onChangeCostCenter(o))}),l()(),_(8,kt,3,3,"div",28)(9,Vt,3,7,"div",29),s(10,"async"),l(),I()}if(t&2){let e=c(4);n(2),C(" ",d(3,7,"cartItems.costCenterLabel")," "),n(3),a("clearable",!0)("items",d(6,9,e.costCenters$))("placeholder",d(7,11,"cartItems.costCenterEntryLabel")),L("ngModel",e.selectedCostCenter),n(3),a("ngIf",e.shouldHighlightMissingCostCenter&&!e.selectedCostCenter),n(),a("ngIf",M(15,Pt,d(10,13,e.purchaseReasonList$)))}}function Rt(t,r){if(t&1&&(y(0),_(1,Lt,11,17,"ng-container",16),s(2,"async"),I()),t&2){let e=c(3);n(),a("ngIf",d(2,1,e.hasCcmPermission$))}}function Bt(t,r){if(t&1){let e=v();m(0,"div",33),u(1),s(2,"cxTranslate"),m(3,"div",34)(4,"foerch-cart-item-mobile-vpe",35),s(5,"foerchOrderEntryToVPE"),x("anyChange",function(o){f(e);let p=c(3);return h(p.vpeValueChange(o))}),l()()()}if(t&2){let e=c(3);n(),C(" ",d(2,2,"common.vpeFormula")," "),n(3),a("item",d(5,4,e.item))}}function Dt(t,r){if(t&1&&(y(0),_(1,Rt,3,3,"ng-container",16)(2,Bt,6,6,"div",24),I()),t&2){let e=c(2);n(),a("ngIf",e.cartConfig.isAnonymousUser!==!0),n(),a("ngIf",e.displayMode===e.displayModes.FULL)}}function Ot(t,r){if(t&1){let e=v();m(0,"div",6)(1,"div",7)(2,"div",8),g(3,"cx-media",9),l()(),m(4,"div",10)(5,"div",11)(6,"div",12),u(7),l(),_(8,wt,2,1,"div",13),m(9,"div",14),u(10),l(),_(11,At,4,9,"div",15)(12,Dt,3,2,"ng-container",16),m(13,"div",17)(14,"div",18)(15,"button",19),x("click",function(){f(e);let o=c();return h(o.close())}),g(16,"cx-icon",2),l()(),m(17,"div",10)(18,"button",20),x("click",function(){f(e);let o=c();return h(o.applyAndClose())}),u(19),s(20,"cxTranslate"),l()()()()()()}if(t&2){let e=c();n(3),a("container",e.item.product.images==null?null:e.item.product.images.PRIMARY),n(4),C(" ",e.item.product.baseProductName," "),n(),a("ngIf",e.item.product.code),n(2),C(" ",e.item.product.name," "),n(),a("ngIf",e.displayMode===e.displayModes.FULL&&e.cartConfig.isAnonymousUser!==!0),n(),a("ngIf",e.cartConfig.cartMode!==e.cartModes.WATCHLIST),n(4),a("type",e.iconTypes.CLOSE_BIG),n(2),a("disabled",e.shouldHighlightMissingCostCenter&&!e.selectedCostCenter),n(),C(" ",d(20,9,"common.save")," ")}}var Q=function(t){return t[t.FULL=0]="FULL",t[t.CCM_ONLY=1]="CCM_ONLY",t}(Q||{}),se=(()=>{let r=class r extends at{set item(i){this._item=i,this._initialCostCenterCode=i.costCenter?i.costCenter.code:null,this._initialOrderReasonCode=i.orderReason?i.orderReason.code:null,this._initialComment=i.comment,this._initialVPEArticle=this.orderEntryToVPEPipe.transform(i)}constructor(i,o,p,b){super(i,o,b),this.activeCartService=i,this.modalService=o,this.orderEntryToVPEPipe=p,this.permissionsService=b,this.updateComment=new _e,this.vpeChanged=new _e,this.cartModes=Y,this.shouldHighlightMissingCostCenter=!1,this.displayMode=Q.FULL,this.displayModes=Q,this._initialCostCenterCode=null,this._initialOrderReasonCode=null,this._initialComment="",this._initialVPEArticle=null}get item(){return this._item}applyAndClose(){let i=this.displayMode===Q.FULL;this.cartConfig.isAnonymousUser!==!0&&((this.selectedCostCenter!==this._initialCostCenterCode||this.selectedOrderReason!==this._initialOrderReasonCode)&&this.apply.emit({costCenter:this.selectedCostCenter,orderReason:this.selectedOrderReason}),i&&this.comment&&this.comment!==this._initialComment&&this.updateComment.emit(this.comment)),i&&this.vpeArticle&&(this.vpeArticle.quantity!==this._initialVPEArticle.quantity||this.vpeArticle.selectedVPE!==this._initialVPEArticle.selectedVPE)&&this.vpeChanged.emit(this.vpeArticle),this.close()}updateEntryComment(i){this.comment=i}vpeValueChange(i){this.vpeArticle=i}};r.\u0275fac=function(o){return new(o||r)(T(le),T(G),T(X),T(oe))},r.\u0275cmp=w({type:r,selectors:[["foerch-cart-mobile-dialog"]],inputs:{item:"item"},outputs:{updateComment:"updateComment",vpeChanged:"vpeChanged"},features:[A],decls:6,vars:2,consts:[[1,"modal-header"],["type","button",1,"close","pt-1",3,"click"],[3,"type"],[1,"modal-body","pb-2"],[1,"cartEntry-modal"],["class","row g-0 flex-nowrap",4,"ngIf"],[1,"row","g-0","flex-nowrap"],[1,"col-auto"],[1,"cartEntry-img"],["format","thumbnail",3,"container"],[1,"col"],[1,"cartEntry-body"],[1,"cartEntry-name"],["class","cartEntry-code",4,"ngIf"],[1,"cartEntry-desc"],["class","cartEntry-comment mt-3",4,"ngIf"],[4,"ngIf"],[1,"row","mt-2","g-0"],[1,"col-auto","me-1"],["type","button",1,"btn","btn-secondary",3,"click"],["type","button",1,"btn","btn-primary","btn-block",3,"click","disabled"],[1,"cartEntry-code"],[1,"cartEntry-comment","mt-3"],[3,"valueChanged","inputId","value","label","placeholder"],["class","cartEntry-ccm mt-3",4,"ngIf"],["data-testid","cart-mobile-dialog-ccm-container",1,"cartEntry-ccm","mt-3"],[1,"form-group","mt-1","mb-1"],["bindLabel","name","bindValue","code",3,"ngModelChange","change","clearable","items","placeholder","ngModel"],["class","form-helptext form-helptext_danger mt-2 mb-1",4,"ngIf"],["class","form-group pt-1",4,"ngIf"],[1,"form-helptext","form-helptext_danger","mt-2","mb-1"],[1,"form-group","pt-1"],["bindLabel","name","bindValue","code",3,"ngModelChange","clearable","disabled","items","placeholder","ngModel"],[1,"cartEntry-ccm","mt-3"],[1,"mt-1"],[3,"anyChange","item"]],template:function(o,p){o&1&&(m(0,"div",0)(1,"button",1),x("click",function(){return p.close()}),g(2,"cx-icon",2),l()(),m(3,"div",3)(4,"div",4),_(5,Ot,21,11,"div",5),l()()),o&2&&(n(2),a("type",p.iconTypes.CLOSE),n(3),a("ngIf",!!(p.item!=null&&p.item.product)))},dependencies:[H,q,W,j,$,qe,ne,me,ee,k,X],encapsulation:2});let t=r;return t})();var Ht=function(t,r,e,i){var o=arguments.length,p=o<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,r,e,i);else for(var D=t.length-1;D>=0;D--)(b=t[D])&&(p=(o<3?b(p):o>3?b(r,e,p):b(r,e))||p);return o>3&&p&&Object.defineProperty(r,e,p),p},qt=function(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)},Ct=(t,r)=>({code:t,name:r}),ft=t=>({cxRoute:"product",params:t}),Wt=()=>({state:"HelpText"}),$t=()=>({state:"PopUpText"}),jt=t=>({articleCode:t}),Yt=t=>({active:t});function Gt(t,r){if(t&1){let e=v();m(0,"div",24)(1,"input",25),B("ngModelChange",function(o){f(e);let p=c();return R(p.markItem,o)||(p.markItem=o),h(o)}),x("change",function(){f(e);let o=c();return h(o.toggleCheckbox())}),l(),g(2,"label",26),l()}if(t&2){let e=c();n(),K("id","markMeArticle_",e.item.pk,""),L("ngModel",e.markItem),n(),K("for","markMeArticle_",e.item.pk,"")}}function Xt(t,r){if(t&1&&(m(0,"a",27),s(1,"foerchStrip"),s(2,"cxUrl"),g(3,"cx-media",28),l()),t&2){let e=c();a("queryParams",e.presetQueryParams)("routerLink",d(2,5,M(10,ft,N(7,Ct,e.item.product.baseProduct,d(1,3,e.item.product.baseProductName))))),n(3),a("container",e.item.product.images&&e.item.product.images.PRIMARY)}}function Qt(t,r){if(t&1&&(m(0,"div",29),u(1),l()),t&2){let e=c();n(),C(" ",e.foerchArticleCode," ")}}function zt(t,r){if(t&1&&(m(0,"div",29),u(1),l()),t&2){let e=c();n(),C(" ",e.item.product.customArticleCode," ")}}function Kt(t,r){if(t&1&&g(0,"foerch-availability",30),t&2){let e=c();a("stock",e.item.product.stock)}}function Jt(t,r){if(t&1&&(m(0,"div",38)(1,"span",39),u(2),s(3,"cxTranslate"),l(),u(4),l()),t&2){let e=c(2);n(2),C("",d(3,2,"cartItems.commentLabel"),":"),n(2),C(" ",e.item.comment," ")}}function Zt(t,r){t&1&&(m(0,"div"),u(1),s(2,"cxTranslate"),l()),t&2&&(n(),C(" ",d(2,1,"cartDetails.proceedToCheckoutCcHint")," "))}function ei(t,r){if(t&1&&(y(0),u(1),s(2,"cxTranslate"),m(3,"div",41),u(4),l(),m(5,"div",41),u(6),l(),I()),t&2){let e=c(3);n(),C(" ",d(2,3,"cartItems.costCenterLabel")," "),n(3),C(" ",e.item.costCenter==null?null:e.item.costCenter.name," "),n(2),C(" ",e.item.orderReason==null?null:e.item.orderReason.name," ")}}function ti(t,r){if(t&1&&(m(0,"div",40),_(1,Zt,3,3,"div",11)(2,ei,7,5,"ng-container",11),l()),t&2){let e=c(2);E("costCenterMissing",e.isCostCenterMissing),n(),a("ngIf",e.isCostCenterMissing),n(),a("ngIf",e.item.costCenter)}}function ii(t,r){if(t&1){let e=v();m(0,"div",41)(1,"foerch-cart-item-mobile-vpe",43),s(2,"foerchOrderEntryToVPE"),x("valueChange",function(o){f(e);let p=c(3);return h(p.vpeValueChange(o))}),l()()}if(t&2){let e=c(3);n(),a("isReadOnly",!0)("item",d(2,2,e.item))}}function ni(t,r){if(t&1){let e=v();m(0,"div",44)(1,"foerch-volume-prices",45),s(2,"foerchOrderEntryToVPE"),x("titleClicked",function(){f(e);let o=c(3);return h(!o.isExpanded&&o.toggle())})("volumePriceSelected",function(o){f(e);let p=c(3);return h(p.anyChange(o))}),l()()}if(t&2){let e=c(3);n(),a("article",d(2,7,e.item))("hasBoldTitle",!0)("isDisabled",e.isLoading)("isSmall",!0)("showOnlyTitle",!e.isExpanded)("tilesPerRow",2)("volumePrices",e.item.product==null?null:e.item.product.volumePrices)}}function oi(t,r){if(t&1&&(m(0,"div",40),u(1),s(2,"cxTranslate"),_(3,ii,3,4,"div",42)(4,ni,3,9,"div",17),l()),t&2){let e=c(2);n(),C(" ",d(2,3,"common.vpeFormula")," "),n(2),a("ngIf",e.item.quantity),n(),a("ngIf",e.hasVolumePrices)}}function ri(t,r){t&1&&(m(0,"div"),u(1),s(2,"cxTranslate"),l()),t&2&&(n(),C(" ",d(2,1,"cartItems.amountUnit")," "))}function ai(t,r){if(t&1&&(m(0,"div"),u(1),l()),t&2){let e=c(2);n(),C(" ",e.item.product.quantityUnit.singular," ")}}function ci(t,r){t&1&&(m(0,"div"),u(1),s(2,"cxTranslate"),l()),t&2&&(n(),C(" ",d(2,1,"cartItems.priceUnit")," "))}function li(t,r){if(t&1&&(m(0,"div"),u(1),l()),t&2){let e=c(2);n(),C(" ",e.item.priceUnit," ")}}function pi(t,r){if(t&1&&(m(0,"div")(1,"foerch-price-info",49),s(2,"cxTranslate"),u(3),l()()),t&2){let e=c(3);n(),a("additionalDiscountWording",d(2,6,"cartItems.itemPrice"))("discount",e.item.product==null?null:e.item.product.discount)("originalPrice",e.item.product==null?null:e.item.product.originalPrice)("price",e.item.basePrice.value||0)("shouldShowDiscountArrangement",!0),n(2),C(" ",e.item.basePrice.formattedValue," ")}}function mi(t,r){if(t&1&&(y(0),m(1,"div",35)(2,"div",46),_(3,pi,4,8,"div",11),l()(),m(4,"div",47)(5,"div",36)(6,"div"),u(7),s(8,"cxTranslate"),l()(),m(9,"div",37)(10,"div")(11,"foerch-price-info",48),u(12),l()()()(),I()),t&2){let e=c(2);n(3),a("ngIf",e.item.basePrice),n(4),C("",d(8,4,"cartItems.total"),":"),n(4),a("price",(e.item.totalPrice==null?null:e.item.totalPrice.value)||0),n(),C(" ",e.item.totalPrice==null?null:e.item.totalPrice.formattedValue," ")}}function si(t,r){if(t&1&&(y(0),m(1,"div",31),_(2,Jt,5,4,"div",32)(3,ti,3,4,"div",33),l(),_(4,oi,5,5,"div",34),m(5,"div",31)(6,"div",35)(7,"div",36),_(8,ri,3,3,"div",11),l(),m(9,"div",37),_(10,ai,2,1,"div",11),l()(),m(11,"div",35)(12,"div",36),_(13,ci,3,3,"div",11),l(),m(14,"div",37),_(15,li,2,1,"div",11),l()(),_(16,mi,13,6,"ng-container",11),l(),I()),t&2){let e=c();n(),a("ngbCollapse",!e.isExpanded),n(),a("ngIf",e.cartConfig.isAnonymousUser!==!0&&e.item.comment),n(),a("ngIf",e.cartConfig.showCCM),n(),a("ngIf",e.cartConfig.showVPE),n(),a("ngbCollapse",!e.isExpanded),n(3),a("ngIf",e.cartConfig.showVPE&&(e.item.product==null?null:e.item.product.quantityUnit)),n(2),a("ngIf",e.cartConfig.showVPE&&(e.item.product==null?null:e.item.product.quantityUnit)),n(3),a("ngIf",e.cartConfig.showVPE&&e.cartConfig.isAnonymousUser!==!0),n(2),a("ngIf",e.cartConfig.showVPE&&e.cartConfig.isAnonymousUser!==!0),n(),a("ngIf",e.cartConfig.showPrice&&(e.item.product==null||e.item.product.saleability==null?null:e.item.product.saleability.purchasable))}}function di(t,r){if(t&1&&(m(0,"div",38)(1,"span",39),u(2),s(3,"cxTranslate"),l(),u(4),l()),t&2){let e=c(2);n(2),C("",d(3,2,"cartItems.commentLabel"),":"),n(2),C(" ",e.item.comment," ")}}function _i(t,r){if(t&1&&(m(0,"div"),_(1,di,5,4,"div",32),m(2,"div",50)(3,"span"),u(4),s(5,"cxTranslate"),l(),u(6),s(7,"cxDate"),l()()),t&2){let e=c();n(),a("ngIf",e.item.comment),n(3),C("",d(5,3,"cartItems.rememberedAt"),":"),n(2),C(" ",d(7,5,e.item.savedTime)," ")}}function ui(t,r){if(t&1&&(m(0,"foerch-price-info",48)(1,"span",53),u(2),l()()),t&2){let e=c(2);a("price",(e.item.totalPrice==null?null:e.item.totalPrice.value)||0),n(2),C(" ",e.item.totalPrice==null?null:e.item.totalPrice.formattedValue," ")}}function Ci(t,r){if(t&1&&(m(0,"div",51)(1,"div"),u(2),s(3,"cxTranslate"),_(4,ui,3,2,"foerch-price-info",52),l()()),t&2){let e=c();a("ngbCollapse",e.isExpanded),n(2),C(" ",d(3,3,"cartItems.total"),": "),n(2),a("ngIf",e.item.totalPrice)}}function fi(t,r){if(t&1&&(g(0,"foerch-help-text-popup",55),s(1,"foerchSaleabilitySpecificText"),s(2,"foerchSaleabilitySpecificText")),t&2){let e=c(2);a("helpText",F(1,2,e.item.product,ue(8,Wt)))("popupText",F(2,5,e.item.product,ue(9,$t)))}}function hi(t,r){if(t&1&&g(0,"foerch-follow-up-article-link",56),t&2){let e=c(2);a("sequelProduct",e.item.product.saleability==null?null:e.item.product.saleability.followUpProduct)}}function gi(t,r){if(t&1&&(y(0),_(1,fi,3,10,"foerch-help-text-popup",54),s(2,"foerchSaleabilityIsSpecific"),_(3,hi,1,1,"foerch-follow-up-article-link",16),s(4,"foerchSaleabilityHasFollowUp"),I()),t&2){let e=c();n(),a("ngIf",d(2,2,e.item.product)),n(2),a("ngIf",d(4,4,e.item.product))}}function xi(t,r){if(t&1){let e=v();m(0,"foerch-sequel-product-replacement-link",57),s(1,"cxTranslate"),s(2,"cxTranslate"),x("approveReplacement",function(o){f(e);let p=c();return h(p.replacementApproved(o,p.item.product.saleability==null?null:p.item.product.saleability.followUpProduct))}),l()}if(t&2){let e=c();a("buttonText",e.cartConfig.cartMode===e.cartModes.CART?"sequelProductReplacementModal.replaceInCart":"sequelProductReplacementModal.replaceArticle")("modalTitle",d(1,6,e.cartConfig.cartMode===e.cartModes.CART?"common.articleNonPurchasable":"common.articleNoLongerAvailable"))("description",d(2,8,"sequelProductReplacementModal.description"))("product",e.item.product)("replacement",e.item.product.saleability==null?null:e.item.product.saleability.followUpProduct)("replacementType",e.replacementTypes.FOLLOW_UP)}}function vi(t,r){if(t&1){let e=v();m(0,"foerch-sequel-product-replacement-link",58),s(1,"cxTranslate"),s(2,"cxTranslate"),x("approveReplacement",function(o){f(e);let p=c();return h(p.replacementApproved(o,p.item.product.saleability.substituteProduct))}),l()}if(t&2){let e=c();a("buttonText",e.cartConfig.cartMode===e.cartModes.CART?"sequelProductReplacementModal.replaceInCart":"sequelProductReplacementModal.replaceArticle")("modalTitle",F(1,6,"common.possibleSubstitutionArticle",M(11,jt,e.foerchArticleCode)))("description",d(2,9,"sequelProductReplacementModal.descriptionForSubstitute"))("product",e.item.product)("replacement",e.item.product.saleability.substituteProduct)("replacementType",e.replacementTypes.SUBSTITUTE)}}function bi(t,r){t&1&&g(0,"foerch-helpt-text-icon",59)}function yi(t,r){if(t&1&&g(0,"foerch-substitute-product-link",56),t&2){let e=c();a("sequelProduct",e.item==null||e.item.product==null||e.item.product.saleability==null?null:e.item.product.saleability.substituteProduct)}}function Ii(t,r){if(t&1){let e=v();m(0,"button",64),s(1,"foerchSaleabilityAddableToCart"),s(2,"foerchSaleabilityAddableToCart"),x("click",function(){f(e);let o=c(2);return h(o.addEntryToCart())}),g(3,"cx-icon",65),l()}if(t&2){let e=c(2);E("disabled",e.isLoading||!d(1,4,e.item.product==null?null:e.item.product.saleability)),a("disabled",e.isLoading||!d(2,6,e.item.product==null?null:e.item.product.saleability)),n(3),a("type",e.icons.CART)}}function Mi(t,r){if(t&1&&g(0,"foerch-add-to-watchlist",66),t&2){let e=c(2);a("isDisabled",e.isLoading===!0||(e.item.product==null||e.item.product.saleability==null?null:e.item.product.saleability.purchasable)===!1)("itemOrCode",e.item)}}function Ti(t,r){if(t&1){let e=v();m(0,"button",67),x("click",function(){f(e);let o=c(2);return h(o.removeItem())}),g(1,"cx-icon",65),l()}if(t&2){let e=c(2);E("disabled",e.isLoading),a("disabled",e.isLoading),n(),a("type",e.icons.DELETE)}}function Ei(t,r){if(t&1&&(y(0),m(1,"div",60),g(2,"pre"),_(3,Ii,4,8,"button",61)(4,Mi,1,2,"foerch-add-to-watchlist",62)(5,Ti,2,4,"button",63),l(),I()),t&2){let e=c();n(3),a("ngIf",e.cartConfig.showAddToCart),n(),a("ngIf",e.cartConfig.cartMode!==e.cartModes.WATCHLIST&&e.item.freightToll===!1),n(),a("ngIf",e.cartConfig.isEditable&&!e.item.freightToll)}}function Si(t,r){if(t&1&&(m(0,"div",44),g(1,"foerch-add-to-watchlist",66),l()),t&2){let e=c();n(),a("isDisabled",e.isLoading===!0||(e.item.product==null||e.item.product.saleability==null?null:e.item.product.saleability.purchasable)===!1)("itemOrCode",e.item)}}function Fi(t,r){if(t&1){let e=v();m(0,"div",68)(1,"button",69),x("click",function(){f(e);let o=c();return h(o.toggle())}),g(2,"cx-icon",65),l()()}if(t&2){let e=c();n(),a("ngClass",M(2,Yt,e.isExpanded)),n(),a("type",e.icons.ARROW_DOWN)}}function Pi(t,r){if(t&1){let e=v();m(0,"button",70),x("click",function(){f(e);let o=c();return h(o.openCartMobileDialog())}),g(1,"cx-icon",65),l()}if(t&2){let e=c();E("costCenterMissing",e.isCostCenterMissing),a("disabled",e.isLoading),n(),a("type",e.icons.EDIT)}}function wi(t,r){if(t&1){let e=v();m(0,"div",71)(1,"button",70),x("click",function(){f(e);let o=c();return h(o.removeItem())}),g(2,"cx-icon",65),l()()}if(t&2){let e=c();n(),E("disabled",e.isLoading),a("disabled",e.isLoading),n(),a("type",e.icons.DELETE)}}var V,de=(V=class extends st{set expandAll(r){this.isCostCenterMissing===!0?this.isExpanded=!0:this.isExpanded=r}get expandAll(){return this.isExpanded}constructor(r){super(r),this.modalService=r,this.cartModes=Y,this.isExpanded=!1,this.subs$=new ge,this.replacementTypes=Ne}ngOnInit(){this.isCostCenterMissing===!0&&(this.isExpanded=!0)}ngOnDestroy(){}openCartMobileDialog(){this.modalRef=this.modalService.open(se);let r=this.modalRef.componentInstance;r&&(r.cartConfig=this.cartConfig,r.item=this.item,r.selectedCostCenter=this.item.costCenter?this.item.costCenter.code:null,r.selectedOrderReason=this.item.orderReason?this.item.orderReason.code:null,r.shouldHighlightMissingCostCenter=this.shouldHighlightMissingCc,this.subs$.add(r.apply.subscribe(e=>{this.applyCCM.emit(e)})),this.subs$.add(r.updateComment.subscribe(e=>{this.updateComment.emit(e)})),this.subs$.add(r.vpeChanged.subscribe(e=>{this.anyChange(e)})))}toggle(){this.isExpanded=!this.isExpanded}},V.\u0275fac=function(e){return new(e||V)(T(G))},V.\u0275cmp=w({type:V,selectors:[["foerch-cart-item-mobile"]],inputs:{expandAll:"expandAll"},features:[A],decls:34,vars:43,consts:[[1,"row","flex-nowrap"],[1,"col-auto","pe-0"],["class","form-check form-checkbox me-0 mb-2",4,"ngIf"],[1,"cartEntry-img"],["class","d-block",3,"queryParams","routerLink",4,"ngIf"],[1,"col","px-0"],[1,"cartEntry-body"],[1,"cartEntry-name",3,"queryParams","routerLink"],["class","cartEntry-code",4,"ngIf"],[1,"cartEntry-desc",3,"innerHTML"],[3,"stock",4,"ngIf"],[4,"ngIf"],["class","cartEntry-price",3,"ngbCollapse",4,"ngIf"],[3,"buttonText","modalTitle","description","product","replacement","replacementType","approveReplacement",4,"ngIf"],["class","mt-1",3,"buttonText","modalTitle","description","product","replacement","replacementType","approveReplacement",4,"ngIf"],["class","mt-1 d-block",4,"ngIf"],[3,"sequelProduct",4,"ngIf"],["class","mt-1",4,"ngIf"],[1,"col-auto"],[1,"cartEntry-action-wrapper"],["class","cartEntry-action",4,"ngIf"],[1,"cartEntry-action",3,"ngbCollapse"],["class","btn-icon",3,"costCenterMissing","disabled","click",4,"ngIf"],["class","cartEntry-action mt-auto",4,"ngIf"],[1,"form-check","form-checkbox","me-0","mb-2"],["name","article","type","checkbox","role","checkbox",1,"form-check-input",3,"ngModelChange","change","id","ngModel"],[1,"form-check-label",3,"for"],[1,"d-block",3,"queryParams","routerLink"],["format","thumbnail",3,"container"],[1,"cartEntry-code"],[3,"stock"],[3,"ngbCollapse"],["class","cartEntry-comment",4,"ngIf"],["class","cartEntry-ccm",3,"costCenterMissing",4,"ngIf"],["class","cartEntry-ccm",4,"ngIf"],[1,"row","mw-sm-md-400"],[1,"col-6","cartEntry-details"],[1,"col-6","text-end"],[1,"cartEntry-comment"],[1,"text-body-secondary"],[1,"cartEntry-ccm"],[1,"cartEntry-ccm-line"],["class","cartEntry-ccm-line",4,"ngIf"],[3,"valueChange","isReadOnly","item"],[1,"mt-1"],[3,"titleClicked","volumePriceSelected","article","hasBoldTitle","isDisabled","isSmall","showOnlyTitle","tilesPerRow","volumePrices"],[1,"col"],[1,"row","mw-sm-md-400","mt-1","cartEntry-total"],[3,"price"],[3,"additionalDiscountWording","discount","originalPrice","price","shouldShowDiscountArrangement"],[1,"cartEntry-rememberedAt","mb-2"],[1,"cartEntry-price",3,"ngbCollapse"],[3,"price",4,"ngIf"],[1,"cartTable-total"],["class","mt-1 d-block",3,"helpText","popupText",4,"ngIf"],[1,"mt-1","d-block",3,"helpText","popupText"],[3,"sequelProduct"],[3,"approveReplacement","buttonText","modalTitle","description","product","replacement","replacementType"],[1,"mt-1",3,"approveReplacement","buttonText","modalTitle","description","product","replacement","replacementType"],[1,"mt-1","d-block"],[1,"mt-2"],["class","btn btn-commerce me-2",3,"disabled","click",4,"ngIf"],[3,"isDisabled","itemOrCode",4,"ngIf"],["class","btn-icon order-template-delete",3,"disabled","click",4,"ngIf"],[1,"btn","btn-commerce","me-2",3,"click","disabled"],[3,"type"],[3,"isDisabled","itemOrCode"],[1,"btn-icon","order-template-delete",3,"click","disabled"],[1,"cartEntry-action"],[1,"btn-icon","cartEntry-action-arrow",3,"click","ngClass"],[1,"btn-icon",3,"click","disabled"],[1,"cartEntry-action","mt-auto"]],template:function(e,i){e&1&&(m(0,"div",0)(1,"div",1),_(2,Gt,3,5,"div",2),m(3,"div",3),_(4,Xt,4,12,"a",4),l()(),m(5,"div",5)(6,"div",6)(7,"a",7),s(8,"foerchStrip"),s(9,"cxUrl"),u(10),l(),_(11,Qt,2,1,"div",8)(12,zt,2,1,"div",8),g(13,"div",9),s(14,"safe"),_(15,Kt,1,1,"foerch-availability",10)(16,si,17,10,"ng-container",11)(17,_i,8,7,"div",11)(18,Ci,5,5,"div",12)(19,gi,5,6,"ng-container",11)(20,xi,3,10,"foerch-sequel-product-replacement-link",13),s(21,"foerchSaleabilityHasFollowUp"),_(22,vi,3,13,"foerch-sequel-product-replacement-link",14)(23,bi,1,0,"foerch-helpt-text-icon",15),s(24,"foerchSaleabilityIsGeneral"),_(25,yi,1,1,"foerch-substitute-product-link",16)(26,Ei,6,3,"ng-container",11)(27,Si,2,2,"div",17),l()(),m(28,"div",18)(29,"div",19),_(30,Fi,3,4,"div",20),m(31,"div",21),_(32,Pi,2,4,"button",22),l(),_(33,wi,3,4,"div",23),l()()()),e&2&&(E("deletionArticle",i.cartConfig.highlightDeletedArticles&&i.isDeleted)("replaceableArticle",i.cartConfig.highlightReplaceableArticles&&!i.isDeleted&&i.hasSubstituteProduct),n(2),a("ngIf",i.item.freightToll===!1&&(i.cartConfig.isEditable||i.cartConfig.isSelectable)),n(2),a("ngIf",i.item.product),n(3),a("queryParams",i.presetQueryParams)("routerLink",d(9,29,M(41,ft,N(38,Ct,i.item.product.baseProduct,d(8,27,i.item.product.baseProductName))))),n(3),C(" ",i.item.product.baseProductName," "),n(),a("ngIf",i.foerchArticleCode&&(i.articleNumberMode!==i.articleNumberModes.CUSTOMER||!i.item.product.customArticleCode)),n(),a("ngIf",i.articleNumberMode!==i.articleNumberModes.FOERCH&&i.item.product.customArticleCode),n(),a("innerHTML",F(14,31,i.item.product.nameHtml||i.item.product.name,"html"),Z),n(2),a("ngIf",i.item.product.stock),n(),a("ngIf",i.cartConfig.cartMode!==i.cartModes.WATCHLIST),n(),a("ngIf",i.cartConfig.cartMode===i.cartModes.WATCHLIST),n(),a("ngIf",i.cartConfig.showPrice&&(i.item.product==null||i.item.product.saleability==null?null:i.item.product.saleability.purchasable)),n(),a("ngIf",i.cartConfig.highlightDeletedArticles!==!0),n(),a("ngIf",d(21,34,i.cartConfig.highlightDeletedArticles&&i.item.product)),n(2),a("ngIf",i.cartConfig.highlightReplaceableArticles&&i.hasSubstituteProduct),n(),a("ngIf",d(24,36,i.item.product)),n(2),a("ngIf",i.cartConfig.highlightReplaceableArticles!==!0&&i.hasSubstituteProduct),n(),a("ngIf",i.cartConfig.cartMode===i.cartModes.WATCHLIST||i.cartConfig.cartMode===i.cartModes.ORDER_TEMPLATE_DETAILS&&i.isExpanded),n(),a("ngIf",(i.item.product==null||i.item.product.saleability==null?null:i.item.product.saleability.purchasable)===!0&&i.cartConfig.cartMode!==i.cartModes.WATCHLIST&&i.cartConfig.cartMode!==i.cartModes.ORDER_TEMPLATE_DETAILS&&i.item.freightToll===!1),n(3),a("ngIf",i.cartConfig.cartMode!==i.cartModes.WATCHLIST),n(),a("ngbCollapse",(i.cartConfig.cartMode===i.cartModes.CART||i.cartConfig.cartMode===i.cartModes.ORDER_TEMPLATE_DETAILS)&&!i.isExpanded),n(),a("ngIf",i.cartConfig.isEditable&&!i.item.freightToll&&i.isPurchasable),n(),a("ngIf",i.cartConfig.cartMode===i.cartModes.CART&&i.cartConfig.isEditable&&!i.item.freightToll))},dependencies:[U,H,Re,q,W,j,te,$,Ye,Ue,$e,je,Ge,We,ae,mt,lt,pt,me,k,Ve,ie,X,re,ce,Ke,Je,Ze,et,ze],encapsulation:2,changeDetection:0}),V);de=Ht([He(),qt("design:paramtypes",[G])],de);var ht=(t,r)=>({code:t,name:r}),gt=t=>({cxRoute:"product",params:t}),ki=t=>({active:t});function Vi(t,r){if(t&1&&(m(0,"a",5),s(1,"foerchStrip"),s(2,"cxUrl"),g(3,"cx-media",19),l()),t&2){let e=c(2);a("routerLink",d(2,4,M(9,gt,N(6,ht,e.item.product.baseProduct,d(1,2,e.item.product.baseProductName))))),n(3),a("container",e.item.product==null||e.item.product.images==null?null:e.item.product.images.PRIMARY)}}function Li(t,r){if(t&1&&(m(0,"div",9),u(1),l()),t&2){let e=c(2);n(),C(" ",e.foerchArticleCode," ")}}function Ri(t,r){if(t&1&&(m(0,"div",9),u(1),l()),t&2){let e=c(2);n(),C(" ",e.item.product.customArticleCode," ")}}function Bi(t,r){t&1&&(m(0,"div"),u(1),s(2,"cxTranslate"),l()),t&2&&(n(),C(" ",d(2,1,"cartDetails.proceedToCheckoutCcHint")," "))}function Di(t,r){if(t&1&&(u(0),s(1,"cxTranslate"),m(2,"div",20),u(3),l(),m(4,"div",20),u(5),l()),t&2){let e=c(3);C(" ",d(1,3,"cartItems.costCenterLabel")," "),n(3),C(" ",e.item.costCenter==null?null:e.item.costCenter.name," "),n(2),C(" ",e.item.orderReason==null?null:e.item.orderReason.name," ")}}function Oi(t,r){if(t&1&&(m(0,"div",14),_(1,Bi,3,3,"div")(2,Di,6,5),l()),t&2){let e=c(2);E("costCenterMissing",e.isCostCenterMissing),n(),S(1,e.isCostCenterMissing?1:-1),n(),S(2,e.item.costCenter?2:-1)}}function Ni(t,r){if(t&1&&(m(0,"div",14)(1,"div",20),u(2),l()()),t&2){let e=c(2);n(2),C(" ",e.amountAndUnit," ")}}function Ui(t,r){if(t&1){let e=v();m(0,"div",18)(1,"button",21),x("click",function(){f(e);let o=c(2);return h(o.toggle())}),g(2,"cx-icon",3),l()()}if(t&2){let e=c(2);n(),a("ngClass",M(2,ki,e.isExpanded)),n(),a("type",e.icons.ARROW_DOWN)}}function Hi(t,r){if(t&1){let e=v();m(0,"div",22)(1,"button",23),x("click",function(){f(e);let o=c(2);return h(o.openCartMobileDialog())}),g(2,"cx-icon",3),l()(),m(3,"div",24)(4,"button",23),x("click",function(){f(e);let o=c(2);return h(o.removeItem())}),g(5,"cx-icon",3),l()()}if(t&2){let e=c(2);a("ngbCollapse",!e.isExpanded),n(),E("costCenterMissing",e.isCostCenterMissing),a("disabled",e.isLoading),n(),a("type",e.icons.EDIT),n(2),E("disabled",e.isLoading),a("disabled",e.isLoading),n(),a("type",e.icons.DELETE)}}function qi(t,r){if(t&1&&(m(0,"div",0)(1,"div",1)(2,"div",2),g(3,"cx-icon",3),l(),m(4,"div",4),_(5,Vi,4,11,"a",5),l()(),m(6,"div",6)(7,"div",7)(8,"a",8),s(9,"foerchStrip"),s(10,"cxUrl"),u(11),l(),_(12,Li,2,1,"div",9)(13,Ri,2,1,"div",9),g(14,"div",10),s(15,"safe"),m(16,"div",11),u(17),s(18,"cxTranslate"),l(),m(19,"div",12),_(20,Oi,3,4,"div",13),l(),_(21,Ni,3,1,"div",14),m(22,"div",15),u(23),s(24,"cxTranslate"),m(25,"span")(26,"strong"),u(27),s(28,"cxTranslate"),s(29,"uppercase"),l()()()()(),m(30,"div",16)(31,"div",17),_(32,Ui,3,4,"div",18)(33,Hi,6,9),l()()()),t&2){let e=c();n(3),a("type",e.icons.MARKER),n(2),S(5,e.item.product?5:-1),n(3),a("routerLink",d(10,17,M(33,gt,N(30,ht,e.item.product.baseProduct,d(9,15,e.item.product.baseProductName))))),n(3),C(" ",e.item.product.baseProductName," "),n(),S(12,e.foerchArticleCode&&(e.articleNumberMode!==e.articleNumberModes.CUSTOMER||!e.item.product.customArticleCode)?12:-1),n(),S(13,e.articleNumberMode!==e.articleNumberModes.FOERCH&&e.item.product.customArticleCode?13:-1),n(),a("innerHTML",F(15,19,e.item.product.nameHtml||e.item.product.name,"html"),Z),n(3),C(" ",d(18,22,"promotionItem.promotionArticle")," "),n(2),a("ngbCollapse",!e.isExpanded),n(),S(20,e.cartConfig.showCCM?20:-1),n(),S(21,e.item.quantity?21:-1),n(2),C(" ",d(24,24,"cartItems.total"),":"),n(4),C(" ",d(29,28,d(28,26,"promotionItem.freeOfCharge")),""),n(5),S(32,e.cartConfig.isAnonymousUser?-1:32),n(),S(33,e.cartConfig.isEditable?33:-1)}}var xt=(()=>{let r=class r extends ct{constructor(){super(...arguments),this._destroyRef=ve(ye),this.isExpanded=!1,this.CartMode=Y}set expandAll(i){this.isCostCenterMissing===!0?this.isExpanded=!0:this.isExpanded=i}openCartMobileDialog(){this.modalRef=this.modalService.open(se);let i=this.modalRef.componentInstance;i&&(i.cartConfig=this.cartConfig,i.item=this.item,i.displayMode=Q.CCM_ONLY,i.selectedCostCenter=this.item.costCenter?this.item.costCenter.code:null,i.selectedOrderReason=this.item.orderReason?this.item.orderReason.code:null,i.shouldHighlightMissingCostCenter=this.shouldHighlightMissingCc,i.apply.pipe(we(this._destroyRef)).subscribe(o=>{this.applyCCM.emit(o)}))}toggle(){this.isExpanded=!this.isExpanded}};r.\u0275fac=(()=>{let i;return function(p){return(i||(i=be(r)))(p||r)}})(),r.\u0275cmp=w({type:r,selectors:[["foerch-promotion-cart-item-mobile"]],inputs:{expandAll:"expandAll"},standalone:!0,features:[A,Te],decls:1,vars:1,consts:[[1,"row","flex-nowrap"],[1,"col-auto","pe-0"],[1,"cartEntry-action","cartEntry-promotionMarker","me-0","mb-2"],[3,"type"],[1,"cartEntry-img"],[1,"d-block",3,"routerLink"],[1,"col","px-0"],[1,"cartEntry-body"],[1,"cartEntry-name",3,"routerLink"],[1,"cartEntry-code"],[1,"cartEntry-desc",3,"innerHTML"],[1,"cartEntry-promotionArticle"],[3,"ngbCollapse"],[1,"cartEntry-ccm",3,"costCenterMissing"],[1,"cartEntry-ccm"],[1,"cartEntry-price"],[1,"col-auto"],[1,"cartEntry-action-wrapper"],[1,"cartEntry-action"],["format","thumbnail",3,"container"],[1,"cartEntry-ccm-line"],[1,"btn-icon","cartEntry-action-arrow",3,"click","ngClass"],[1,"cartEntry-action",3,"ngbCollapse"],[1,"btn-icon",3,"click","disabled"],[1,"cartEntry-action","mt-auto"]],template:function(o,p){o&1&&_(0,qi,34,35,"div",0),o&2&&S(0,p.item&&p.item.product?0:-1)},dependencies:[nt,re,ce,Le,k,Be,$,De,j,ae,U,te,Pe,ke,ie],encapsulation:2,changeDetection:0});let t=r;return t})();var $i=t=>({isLoading:t}),ji=t=>({"is-unqualified-for-promotion-threshold":t});function Yi(t,r){if(t&1&&g(0,"foerch-checkout-info",10),t&2){let e=c();a("checkoutInfo",e.checkoutInfo)}}function Gi(t,r){if(t&1){let e=v();m(0,"div",11)(1,"ng-select",12),B("ngModelChange",function(o){f(e);let p=c();return R(p.selectedSort,o)||(p.selectedSort=o),h(o)}),x("change",function(o){f(e);let p=c();return h(p.onMobileSortingChange(o))}),l(),m(2,"foerch-table-reset-mobile",13),x("resetSorting",function(){f(e);let o=c();return h(o.onMobileSortingReset())}),l()()}if(t&2){let e=c();n(),a("clearable",!1)("items",e.sortItems)("searchable",!1),L("ngModel",e.selectedSort),n(),a("enabled",e.hasActiveSorting)}}function Xi(t,r){if(t&1){let e=v();m(0,"div",14)(1,"button",15),x("click",function(){f(e);let o=c();return h(o.toggleAll())}),u(2),s(3,"cxTranslate"),l()()}if(t&2){let e=c();n(2),C(" ",d(3,1,e.getToggleAllLabel())," ")}}function Qi(t,r){if(t&1){let e=v();m(0,"foerch-promotion-cart-item-mobile",20),s(1,"foerchCheckoutDisallowedCostCenter"),x("applyCCM",function(o){f(e);let p=c().$implicit,b=c(3);return h(b.applyCostCenterReason(o,p))})("remove",function(){f(e);let o=c().$implicit,p=c(3);return h(p.removeItem(o))}),l()}if(t&2){let e=c().$implicit,i=c(2).ngIf,o=c();a("articleNumberMode",o.articleNumberMode)("cartConfig",o.cartConfig)("expandAll",o.expandAll)("isLoading",i.isLoading)("item",e)("shouldHighlightMissingCc",d(1,6,o.checkoutInfo))}}function zi(t,r){if(t&1&&(y(0),_(1,Qi,2,8,"foerch-promotion-cart-item-mobile",19),I()),t&2){let e=r.$implicit;n(),a("ngIf",!e.entryDeleted)}}function Ki(t,r){if(t&1){let e=v();m(0,"foerch-cart-item-mobile",22),s(1,"foerchUnqualifiedForThreshold"),s(2,"foerchCheckoutDisallowedCostCenter"),x("addToCart",function(){f(e);let o=c().$implicit,p=c(3);return h(p.onAddToCart(o))})("applyCCM",function(o){f(e);let p=c().$implicit,b=c(3);return h(b.applyCostCenterReason(o,p))})("articleReplaced",function(o){f(e);let p=c().$implicit,b=c(3);return h(b.onArticleReplaced(o,p))})("itemToggled",function(){f(e);let o=c().$implicit,p=c(3);return h(p.cartEntryToggled(o))})("remove",function(){f(e);let o=c().$implicit,p=c(3);return h(p.removeItem(o))})("updateComment",function(o){f(e);let p=c().$implicit,b=c(3);return h(b.updateItemComment(o,p))})("vpeAnyChanged",function(o){f(e);let p=c(4);return h(p.onVpeChange(o))}),l()}if(t&2){let e=c().$implicit,i=c(2).ngIf,o=c();a("articleNumberMode",o.articleNumberMode)("cartConfig",o.cartConfig)("expandAll",o.expandAll)("isLoading",i.isLoading)("item",e)("markItem",o.selectionHelper.getItemStatus(e.pk))("ngClass",M(13,ji,F(1,8,e,o.unqualifiedEntriesForPromotion)))("shouldHighlightMissingCc",d(2,11,o.checkoutInfo))}}function Ji(t,r){if(t&1&&(y(0),_(1,Ki,3,15,"foerch-cart-item-mobile",21),I()),t&2){let e=r.$implicit;n(),a("ngIf",!e.entryDeleted)}}function Zi(t,r){if(t&1&&(y(0),_(1,zi,2,1,"ng-container",18),s(2,"foerchGiveaway"),_(3,Ji,2,1,"ng-container",18),s(4,"foerchGiveaway"),I()),t&2){let e=c(2);n(),a("ngForOf",F(2,4,e.items,!0))("ngForTrackBy",e.trackByIndex),n(2),a("ngForOf",F(4,7,e.items,!1))("ngForTrackBy",e.trackByIndex)}}function en(t,r){if(t&1&&u(0),t&2){let e=c(2);C(" ",e.cartConfig.emptyMessage," ")}}function tn(t,r){if(t&1&&(m(0,"div",16),_(1,Zi,5,10,"ng-container",17)(2,en,1,1,"ng-template",null,0,Ee),l()),t&2){let e=Me(3),i=c();n(),a("ngIf",i.items&&i.items.length>0)("ngIfElse",e)}}var Co=(()=>{let r=class r extends dt{get isSortingActive(){return this.sortModel&&Object.keys(this.sortModel).length!==0}constructor(i,o,p,b){super(i,o,b,p),this.activeCartService=i,this.permissionsService=o,this.cd=p,this.translationService=b,this.expandAll=null,this.sortItems=[],this.hasActiveSorting=!1,this.CLOSE_ALL_TEXT="common.closeAll",this.OPEN_ALL_TEXT="common.openAll"}ngOnInit(){super.ngOnInit(),this.sortModel&&this.sortableColumns&&this.prepareSortItems()}trackByIndex(i){return i}toggleAll(){this.expandAll===null?this.expandAll=!0:this.expandAll=!this.expandAll}getToggleAllLabel(){return this.expandAll?this.CLOSE_ALL_TEXT:this.OPEN_ALL_TEXT}onMobileSortingChange(i){this.hasActiveSorting=!0;let o=i.value.split("_"),p={sortBy:o[0],sortDirection:o[1]};this.sortingChange.emit(p)}onMobileSortingReset(){this.hasActiveSorting=!1,this.setSelectedSort(),this.sortingReset.emit()}prepareSortItems(){let i=[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")];this.sortableColumns.forEach(o=>{i.push(this.translationService.translate(o))}),this._subs$.add(xe(i).subscribe(o=>{let p=o[0],b=o[1],D=o[2],vt=o[3],bt=o[4],P=5,J=[],O=(z,yt)=>`${p}: ${o[z]} ${yt}`;for(let z=0;z<this.sortableColumns.length;z++)switch(this.sortableColumns[z]){case pe.ARTICLE_NUMBER:{J.push({name:O(P,b),value:"code_ASC"},{name:O(P,D),value:"code_DESC"}),P++;break}case pe.ARTICLE_NAME:{J.push({name:O(P,b),value:"title_ASC"},{name:O(P,D),value:"title_DESC"}),P++;break}case pe.TOTAL:{J.push({name:O(P,vt),value:"total_ASC"},{name:O(P,bt),value:"total_DESC"}),P++;break}}this.sortItems=[...J],this.setSelectedSort()}))}setSelectedSort(){this.selectedSort=this.sortItems.length>0?this.sortItems[0].value:null}};r.\u0275fac=function(o){return new(o||r)(T(le),T(oe),T(Se),T(Ae))},r.\u0275cmp=w({type:r,selectors:[["foerch-cart-mobile-body"]],features:[A],decls:11,vars:11,consts:[["emptyCart",""],["class","mb-2 mt-2",3,"checkoutInfo",4,"ngIf"],[1,"orderTemplate-sortRow"],[1,"container"],[1,"row","align-items-basement"],["class","col-auto d-flex align-items-baseline",4,"ngIf"],[1,"col"],["class","orderTemplate-toggleAll",4,"ngIf"],[3,"promotions"],["class","cart-details-wrapper",4,"ngIf"],[1,"mb-2","mt-2",3,"checkoutInfo"],[1,"col-auto","d-flex","align-items-baseline"],["bindLabel","name","bindValue","value","labelForId","orderTemplateSortingDropDown",1,"ng-select_alt",3,"ngModelChange","change","clearable","items","searchable","ngModel"],[3,"resetSorting","enabled"],[1,"orderTemplate-toggleAll"],["type","button",1,"btn","btn-link_secondary",3,"click"],[1,"cart-details-wrapper"],[4,"ngIf","ngIfElse"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"articleNumberMode","cartConfig","expandAll","isLoading","item","shouldHighlightMissingCc","applyCCM","remove",4,"ngIf"],[3,"applyCCM","remove","articleNumberMode","cartConfig","expandAll","isLoading","item","shouldHighlightMissingCc"],[3,"articleNumberMode","cartConfig","expandAll","isLoading","item","markItem","ngClass","shouldHighlightMissingCc","addToCart","applyCCM","articleReplaced","itemToggled","remove","updateComment","vpeAnyChanged",4,"ngIf"],[3,"addToCart","applyCCM","articleReplaced","itemToggled","remove","updateComment","vpeAnyChanged","articleNumberMode","cartConfig","expandAll","isLoading","item","markItem","ngClass","shouldHighlightMissingCc"]],template:function(o,p){o&1&&(_(0,Yi,1,1,"foerch-checkout-info",1),s(1,"foerchCheckoutDisplayHint"),m(2,"div",2)(3,"div",3)(4,"div",4),_(5,Gi,3,5,"div",5),m(6,"div",6),_(7,Xi,4,3,"div",7),l()()()(),g(8,"cx-promotions",8),_(9,tn,4,2,"div",9),s(10,"async")),o&2&&(a("ngIf",(p.cartConfig.cartMode===p.cartModes.CART||p.cartConfig.cartMode===p.cartModes.ORDER_TEMPLATE_DETAILS)&&d(1,5,p.checkoutInfo)),n(5),a("ngIf",p.isSortingActive),n(2),a("ngIf",p.cartConfig.cartMode!==p.cartModes.WATCHLIST&&(p.cartConfig.isEditable||p.cartConfig.isSelectable||p.cartConfig.isToggleable)),n(),a("promotions",p.promotions),n(),a("ngIf",M(9,$i,d(10,7,p.isLoading$))))},dependencies:[Oe,de,U,Fe,H,Qe,Xe,ne,q,W,xt,k,ee,it,tt,ot,rt],encapsulation:2,changeDetection:0});let t=r;return t})();export{xt as a,Co as b};