PageSourceSearch

https://curry.moscow/4637.d70e9da4efb54802.js

js curry.moscow collected 2026-09-29 15:06:12 UTC 49,130 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkyumapos_web_client_mobile=self.webpackChunkyumapos_web_client_mobile||[]).push([[4637],{14637(fn,me,i){i.d(me,{TABLE_ROUTES:()=>bn});var U=i(47084),f=i(63792),pe=i(28673),E=i(49769),d=i(85802),h=i(37702),H=i(93049),z=i(46822),C=i(59640),g=i(68018),T=i(96354),S=i(15307),I=i(13810),b=i(64683),j=i(6716),P=i(30995),p=i(46259),w=i(10467),_=i(54843),Y=i(91214),ue=i(96574),Z=i(23569);let B=(()=>{class t{constructor(n,o){this.router=n,this.store=o}createNewOrderForCurrentTable(){var n=this;return(0,w.A)(function*(){const o=yield(0,_._)(n.store.select(p.Od)),r=yield(0,_._)(n.store.select(p.FK).pipe((0,b.eU)()));ue.n.setCurrentStoreId(r.storeId);const a=yield(0,_._)(n.store.select(p.Jn).pipe((0,b.eU)()));n.store.dispatch(Z.k.setTableIdFromQueryParams(a)),yield n.router.navigate(Y.k.getShopRootPath(o,r))})()}static{this.\u0275fac=function(o){return new(o||t)(d.KVO(h.Ix),d.KVO(C.il))}}static{this.\u0275prov=d.jDH({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var e=i(35547);const ye=()=>["../"];function Te(t,s){if(1&t){const n=e.RV6();e.j41(0,"button",4),e.bIt("click",function(){d.eBV(n);const r=e.XpG(3);return d.Njj(r.tableOrdersService.createNewOrderForCurrentTable())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"TABLE_ORDER.LIST.NEW_ORDER")," "))}function be(t,s){1&t&&(e.j41(0,"button",3),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.Y8G("routerLink",e.lJ4(4,ye)),e.R7$(),e.SpI(" ",e.bMT(2,2,"TABLE_ORDER.LIST.TITLE")," "))}function fe(t,s){if(1&t&&(e.j41(0,"div",1),e.nVh(1,Te,3,3,"button",2),e.nI1(2,"async"),e.vZN(3,be,3,5,"button",3),e.k0s()),2&t){const n=e.XpG(2);e.R7$(),e.vxM(0===e.bMT(2,1,n.tableOrdersCount$)?1:3)}}function he(t,s){if(1&t&&(e.j41(0,"yp-fixed-header-footer")(1,"yp-page-not-found"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.DNE(4,fe,4,3,"div",0),e.k0s()),2&t){const n=e.XpG();e.R7$(2),e.JRh(e.bMT(3,2,"TABLE_ORDER.NOT_FOUND.ORDER")),e.R7$(2),e.Y8G("ypProjectedFooter",n.AppLayoutFooterIndex.firstLevel)}}function Ie(t,s){1&t&&e.nrm(0,"router-outlet")}let Ce=(()=>{class t{constructor(){this.AppLayoutFooterIndex=j.J,this.tableOrdersService=(0,d.WQX)(B);const n=(0,d.WQX)(h.nX),o=(0,d.WQX)(C.il),r=(0,d.WQX)(S.$);this.currentTableCurrentOrder$=o.select(p.LT),this.show404$=n.paramMap.pipe((0,T.T)(a=>{let l;return l=r.bitSettingsDecoded.mainStoreMode?a.get(f.G.param.currentRegionId.children.store.param.storeId.children.table.children.param.tableId.children.order.children.param.orderId.name)??void 0:a.get(f.G.store.param.storeId.children.table.children.param.tableId.children.order.children.param.orderId.name)??void 0,l}),(0,b.eU)(),(0,z.YQ)(()=>this.currentTableCurrentOrder$),(0,T.T)(([a,l])=>l?.orderId!==a)),this.tableOrdersCount$=o.select(p.FL).pipe((0,b.eU)(),(0,T.T)(a=>((0,I.iY)(a.data),a.data.tableOrders.length)))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-current-table-current-order-wrapper"]],decls:4,vars:5,consts:[["class","yp-bottom-buttons-wrapper",4,"ypProjectedFooter"],[1,"yp-bottom-buttons-wrapper"],["type","button",1,"flex-grow-1","yp-btn","yp-btn-lg","yp-btn-primary"],["type","button",1,"yp-btn","yp-btn-lg","yp-btn-primary",3,"routerLink"],["type","button",1,"flex-grow-1","yp-btn","yp-btn-lg","yp-btn-primary",3,"click"]],template:function(o,r){1&o&&(e.nVh(0,he,5,4,"yp-fixed-header-footer"),e.nI1(1,"async"),e.nI1(2,"async"),e.vZN(3,Ie,1,0,"router-outlet")),2&o&&e.vxM(e.bMT(1,1,r.show404$)?0:e.bMT(2,3,r.currentTableCurrentOrder$)?3:-1)},dependencies:[H.Wk,h.n3,P.cU,U.PageNotFoundComponent,P.J0,E.Jj,g.D9],encapsulation:2,changeDetection:0})}}return t})();function ve(t,s){1&t&&(e.j41(0,"yp-page-not-found"),e.EFF(1,"Table Not Found"),e.k0s())}function _e(t,s){1&t&&e.nrm(0,"router-outlet")}let Oe=(()=>{class t{constructor(n,o,r){this.currentTableId$=o.select(p.Jn),this.show404$=n.paramMap.pipe((0,T.T)(a=>{let l;return l=r.bitSettingsDecoded.mainStoreMode?a.get(f.G.param.currentRegionId.children.store.param.storeId.children.table.children.param.tableId.name)??void 0:a.get(f.G.store.param.storeId.children.table.children.param.tableId.name)??void 0,l}),(0,b.eU)(),(0,z.YQ)(()=>this.currentTableId$),(0,T.T)(([a,l])=>
1l!==a))}static{this.\u0275fac=function(o){return new(o||t)(e.rXU(h.nX),e.rXU(C.il),e.rXU(S.$))}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-current-table-wrapper"]],decls:4,vars:5,template:function(o,r){1&o&&(e.nVh(0,ve,2,0,"yp-page-not-found"),e.nI1(1,"async"),e.nI1(2,"async"),e.vZN(3,_e,1,0,"router-outlet")),2&o&&e.vxM(e.bMT(1,1,r.show404$)?0:e.bMT(2,3,r.currentTableId$)?3:-1)},dependencies:[U.PageNotFoundComponent,h.n3,E.Jj],encapsulation:2,changeDetection:0})}}return t})();var N=i(17705),K=i(89079),m=i(89417),M=i(36665),W=i(34006),G=i(26920),q=i(39204),ee=i(84412),V=i(84572),Q=i(99172),A=i(52906),D=i(25558),te=i(30477),ne=i(60711),J=i(80607),ge=i(37626),Pe=i(23070),Re=i(63639),re=i(71259),O=i(49655),$=i(42707),Fe=i(90900),Ee=i(54653),Se=i(72627),oe=i(84989),Me=i(30987),Ae=i(66076),x=i(7843),ae=i(34721),De=i(66566),v=i(49668),$e=i(40100),xe=i(2552);const Le=t=>({leftToPayAmount:t});function ke(t,s){1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"TABLE_ORDER.DETAILS.SPLIT.CUSTOM.AMOUNT.ERROR.REQUIRED")))}function je(t,s){if(1&t&&(e.j41(0,"mat-error"),e.EFF(1),e.nI1(2,"ypCurrency"),e.nI1(3,"translate"),e.k0s()),2&t){const n=e.XpG();e.R7$(),e.JRh(e.i5U(3,3,"TABLE_ORDER.DETAILS.SPLIT.CUSTOM.AMOUNT.ERROR.MAX",e.eq3(6,Le,e.bMT(2,1,n.bottomSheetData.orderAmountInCents-n.bottomSheetData.orderPaidAmountInCents))))}}let Be=(()=>{class t{constructor(){this.bottomSheetData=(0,d.WQX)(M.yj),this.matBottomSheetRef=(0,d.WQX)(M.eN),this.customAmountFormGroup=new m.gE({customAmount:new m.MJ(null,{validators:[m.k0.required,m.k0.min(.01),m.k0.max((this.bottomSheetData.orderAmountInCents-this.bottomSheetData.orderPaidAmountInCents)/100)]})}),this.customAmountFormGroup.controls.customAmount.setValue(this.bottomSheetData.customAmountToPayInCents?this.bottomSheetData.customAmountToPayInCents/100:null)}continue(){this.customAmountFormGroup.valid?this.matBottomSheetRef.dismiss({customAmountToPayInCents:(0,O._P)(this.customAmountFormGroup.controls.customAmount.value)}):this.customAmountFormGroup.markAllAsTouched()}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-bottom-sheet-table-order-pay-custom-amount"]],decls:16,vars:14,consts:[[1,"d-flex","flex-column","align-items-stretch","gap-4"],[1,"m-0"],["novalidate","",1,"form-controls-wrapper",3,"submit","formGroup"],["type","submit",1,"d-none"],[3,"appearance","subscriptSizing"],["type","number","matInput","","cdkFocusInitial","",3,"ypPositiveNumberInput","formControl"],["type","button",1,"w-100","yp-btn","yp-btn-lg","yp-btn-primary","yp-btn-mw-lg",3,"click"]],template:function(o,r){1&o&&(e.j41(0,"div",0)(1,"h2",1),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"form",2),e.bIt("submit",function(){return r.continue()}),e.nrm(5,"input",3),e.j41(6,"mat-form-field",4)(7,"mat-label"),e.EFF(8),e.nI1(9,"translate"),e.k0s(),e.nrm(10,"input",5),e.nVh(11,ke,3,3,"mat-error")(12,je,4,8,"mat-error"),e.k0s()(),e.j41(13,"button",6),e.bIt("click",function(){return r.continue()}),e.EFF(14),e.nI1(15,"translate"),e.k0s()()),2&o&&(e.R7$(2),e.SpI(" ",e.bMT(3,8,"TABLE_ORDER.DETAILS.SPLIT.CUSTOM.TITLE")," "),e.R7$(2),e.Y8G("formGroup",r.customAmountFormGroup),e.R7$(2),e.Y8G("appearance","outline")("subscriptSizing","dynamic"),e.R7$(2),e.JRh(e.bMT(9,10,"TABLE_ORDER.DETAILS.SPLIT.CUSTOM.AMOUNT.LABEL")),e.R7$(2),e.Y8G("formControl",r.customAmountFormGroup.controls.customAmount),e.R7$(),e.vxM(r.customAmountFormGroup.controls.customAmount.hasError("required")||r.customAmountFormGroup.controls.customAmount.hasError("min")?11:r.customAmountFormGroup.controls.customAmount.hasError("max")?12:-1),e.R7$(3),e.SpI(" ",e.bMT(15,12,"COMMON.CONTINUE")," "))},dependencies:[m.YN,m.qT,m.me,m.Q0,m.BC,m.cb,m.X1,m.l_,m.j4,G.TL,G.rl,$e.fg,G.nJ,xe._,x.o,g.D9],encapsulation:2,changeDetection:0})}}return t})();function Ne(t,s){if(1&t){const n=e.RV6();e.Hgh(0,"hr",3),e.rj2(1,"div",1)(2,"div"),e.EFF(3),e.nI1(4,"translate"),e.eux(),e.rj2(5,"button",2),e.VwU("click",function(){d.eBV(n);const r=e.XpG();return d.Njj(r.matDialogRef.dismiss({selectedSplitPaymentOption:r.SplitPaymentOption.payTheRest}))}),e.EFF(6),e.nI1(7,"translate"),e.eux()()}2&t&&(e.R7$(3),e.SpI(" ",e.bMT(4,2,"TABLE_ORDER.DETAILS.PAY_REST")," "),e.R7$(3),e.SpI(" ",e.bMT(7,4,"COMMON.SELECT")," "))}var L=function(t){return t[t.payByItem=0]="payByItem",t[t.payCustomAmount=1]="payCustomAmount",t[t.payTheRest=2]="payTheRest",t}(L||{});let Ge=(()=>{class t{constructor(){this.SplitPaymentOption=L,this.bottomSheetData=(0,d.WQX)(M.yj),this.matDialogRef=(0,d.WQX)(M.eN)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-bottom-sheet-table-order-split-payment-options"]],decls:17,vars:13,consts:[[1,"d-flex","flex-column","gap-4"],[1,"d-flex","align-items-center","justify-content-between"],["type","button",1,"yp-btn","yp-btn-primary",3,"click"],[1,"m-0"]],template:function(o,r){1&o&&(e.rj2(0,"div",0)(1,"div",1)(2,"div"),e.EFF(3),e.nI1(4,"translate"),e.eux(),e.rj2(5,"button",2),e.VwU("click",function(){return r.matDialogRef.dismiss({selectedSplitPaymentOption:r.SplitPaymentOption.payByItem})}),e.EFF(6),e.nI1(7,"translate"),e.eux()(),e.Hgh(8,"hr",3),e.rj2(9,"div",1)(10,"div"),e.EFF(11),e.nI1(12,"translate"),e.eux(),e.rj2(13,"button",2),e.VwU("click",function(){return r.matDialogRef.dismiss({selectedSplitPaymentOption:r.SplitPaymentOption.payCustomAmount})}),e.EFF(14),e.nI1(15,"translate"),e.eux()(),e.nVh(16,Ne,8,6),e.eux()),2&o&&(e.R7$(3),e.SpI(" ",e.bMT(4,5,"TABLE_ORDER.DETAILS.PAY_BY_ITEM")," "),e.R7$(3),e.SpI(" ",e.bMT(7,7,"COMMON.SELECT")," "),e.R7$(5),e.SpI(" ",e.bMT(12,9,"TABLE_ORDER.DETAILS.PAY_CUSTOM_AMOUNT")," "),e.R7$(3),e.SpI(" ",e.bMT(15,11,"COMMON.SELECT")," "),e.R7$(2),e.vxM(r.bottomSheetData.showPayTheRestOption?16:-1))},dependencies:[g.D9],encapsulation:2,changeDetection:0})}}return t})();var ie=i(9183),Ve=i(65245),Xe=i(70152),X=i(7673),Ue=i(12498),we=i(1807),Ye=i(99437),We=i(89208),Qe=i(72684),Je=i(28934),He=i(68606),se=i(12560),ze=i(26844),Ze=i(74541),Ke=i(36530);function qe(t,s){if(1&t&&e.EFF(0),2&t){const n=e.XpG().$implicit;e.SpI(" ",n.orderItemName," ")}}function et(t,s){if(1&t&&(e.EFF(0),e.nI1(1,"ypMenuItemWeight"),e.nI1(2,"async")),2&t){const n=e.XpG().$implicit;e.Lme(" ",n.orderItemName," ",e.bMT(2,6,e.brH(1,2,n.orderItemWeight,
1n.orderItemUom,n.orderItemVolumeUom))," ")}}function tt(t,s){if(1&t&&(e.j41(0,"div",22),e.EFF(1),e.k0s()),2&t){const n=s.$implicit;e.R7$(),e.Lme(" ",n.name," x ",n.quantity," ")}}function nt(t,s){if(1&t&&(e.j41(0,"div",18),e.Z7z(1,tt,2,2,"div",22,e.fX1),e.k0s()),2&t){const n=e.XpG().$implicit;e.R7$(),e.Dyx(n.modifiersInfo)}}function rt(t,s){1&t&&(e.j41(0,"div",20),e.nrm(1,"i",23),e.k0s())}function ot(t,s){if(1&t){const n=e.RV6();e.j41(0,"yp-counter",24),e.bIt("ngModelChange",function(r){d.eBV(n);const a=e.XpG().$index,l=e.XpG();return d.Njj(l.quantityChanged(a,r))}),e.k0s()}if(2&t){const n=e.XpG().$implicit;e.Y8G("ngModel",n.selectedQuantity)("minQuantity",0)("maxQuantity",n.leftToPayQuantity)}}function at(t,s){1&t&&e.nrm(0,"hr")}function it(t,s){if(1&t&&(e.j41(0,"yp-selected-cart-item",15)(1,"div",16)(2,"div")(3,"div",17),e.nVh(4,qe,1,1)(5,et,3,8),e.EFF(6),e.nI1(7,"ypCurrency"),e.k0s(),e.nVh(8,nt,3,0,"div",18),e.k0s(),e.j41(9,"div",19),e.nVh(10,rt,2,0,"div",20)(11,ot,1,3,"yp-counter",21),e.k0s()()(),e.nVh(12,at,1,0,"hr")),2&t){const n=s.$implicit,o=s.$index,r=s.$count;e.Y8G("image",n.image)("title",n.orderItemName),e.R7$(4),e.vxM(void 0===n.orderItemWeight?4:5),e.R7$(2),e.SpI(" (",e.i5U(7,7,n.orderItemPriceInCents,!1),") "),e.R7$(2),e.vxM(n.modifiersInfo.length?8:-1),e.R7$(2),e.vxM(0===n.leftToPayQuantity?10:11),e.R7$(2),e.vxM(o!==r-1?12:-1)}}function st(t,s){if(1&t&&(e.j41(0,"div",25),e.nrm(1,"yp-error",26),e.k0s()),2&t){const n=s.$implicit;e.R7$(),e.Y8G("serverResponseError",n)}}function lt(t,s){if(1&t&&(e.j41(0,"div",7),e.Z7z(1,st,2,1,"div",25,e.fX1),e.k0s()),2&t){e.XpG
1();const n=e.r8f(0);e.R7$(),e.Dyx(n.errors)}}function dt(t,s){1&t&&e.nrm(0,"mat-spinner",13),2&t&&e.Y8G("diameter",16)}function ct(t,s){if(1&t&&(e.EFF(0),e.nI1(1,"ypCents"),e.nI1(2,"ypCurrency")),2&t){e.XpG();const n=e.r8f(0);e.SpI(" ",e.bMT(2,3,e.bMT(1,1,n.amountToPay))," ")}}var R=function(t){return t[t.loading=0]="loading",t[t.errors=1]="errors",t[t.success=2]="success",t}(R||{});let mt=(()=>{class t{constructor(){this.matDialogRef=(0,d.WQX)(W.CP),this.dialogData=(0,d.WQX)(W.Vh),this.SelectedItemsPriceInfoState=R,this.leftToPayInCents=(0,O._P)(this.dialogData.orderDetails.amount)-(0,O._P)(this.dialogData.orderDetails.orderPaidAmount);const n=(0,d.WQX)(Qe.f),o=this.dialogData.orderDetails.orderItems.filter(r=>0!==r.price).map(r=>({orderItemId:r.orderItemId,orderItemName:r.name,image:r.image,leftToPayQuantity:r.qty>r.paidQuantity?r.qty-r.paidQuantity:0,selectedQuantity:this.dialogData.selectedItemsToPay?.find(a=>a.orderItemId==r.orderItemId)?.quantity??0,orderItemPriceInCents:(0,O._P)(r.price),orderItemWeight:r.weight,orderItemUom:r.uom,orderItemVolumeUom:r.volumeUOM,modifiersInfo:[...r.commonModifiersInfo.map(a=>({name:a.name,quantity:a.qty,price:a.price})),...r.relatedModifiersInfo.map(a=>({name:a.name,quantity:a.qty,price:a.price}))]}));this.orderItems$=new ee.t(o),this.selectedItemsPriceInfo$=this.orderItems$.pipe((0,Ve.i)(1),(0,Xe.B)(500),(0,D.n)(r=>{const a=r.filter(l=>0!==l.selectedQuantity);return 0===a.length?(0,X.of)(this.calculateSelectedItemsPriceInfo([])):n.calculateItemsPrice({orderId:this.dialogData.orderDetails.orderId,storeId:this.dialogData.orderDetails.storeId,orderItems:a.map(l=>({orderItemId:l.orderItemId,quantity:l.selectedQuantity}))}).pipe((0,Ue.L)({count:3,delay:(l,c)=>{if(l[0].responseErrorCode!==We.D.errorGeneratedOnClient)throw l;return(0,we.O)(1e3*c)}}),(0,T.T)(l=>this.calculateSelectedItemsPriceInfo(l)),(0,Ye.W)(l=>(0,X.of)({state:R.errors,errors:(0,O.HH)(l)})),(0,Q.Z)({state:R.loading}))}),(0,Q.Z)(this.calculateSelectedItemsPriceInfo(this.dialogData.selectedItemsToPay??[])))}quantityChanged(n,o){const r=[...this.orderItems$.getValue()];r[n]={...r[n],selectedQuantity:o},this.orderItems$.next(r)}continue(n){(0,I.hN)(n.state,R.success),(0,I.De)(n.selectedItemsToPay.length>0),this.matDialogRef.close({selectedItemsToPay:n.selectedItemsToPay})}calculateSelectedItemsPriceInfo(n){let o=0,r=0;for(const a of n)o+=a.priceWithTax,r+=a.tax;return{state:R.success,amountToPay:o,tax:r,selectedItemsToPay:n}}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-dialog-table-order-pay-by-item"]],features:[e.Jv_([Je.z])],decls:32,vars:23,consts:[[1,"h-100","d-flex","flex-column"],[3,"backClick","title"],[1,"flex-grow-1","overflow-auto"],[1,"cards-container"],[1,"yp-card"],[1,"yp-card-content"],[1,"p-3","d-flex","flex-column","gap-4","text-start"],[1,"my-3"],[1,"mx-3","d-flex","flex-wrap","gap-2","justify-content-between"],[1,"d-flex","flex-column","yp-text-muted"],[1,"fs-4"],[1,"fw-bolder"],[1,"d-flex","flex-column"],[3,"diameter"],["type","button",1,"w-100","yp-btn","yp-btn-lg","yp-btn-primary",3,"click","disabled"],[3,"image","title"],[1,"h-100","d-flex","flex-column","justify-content-between"],[1,"fw-bolder",2,"word-break","break-word"],[1,"fs-3",2,"word-break","break-word"],[1,"align-self-end"],[1,"yp-btn","yp-btn-light","yp-btn-icon",2,"pointer-events","none"],[3,"ngModel","minQuantity","maxQuantity"],[1,"fs-3","yp-text-muted","modifier-item"],[1,"icomoon-icon","icon-checkmark"],[3,"ngModelChange","ngModel","minQuantity","maxQuantity"],[1,"my-2","mx-3"],[3,"serverResponseError"]],template:function(o,r){if(1&o){const a=e.RV6();e.SS7(0),e.nI1(1,"async"),e.j41(2,"div",0)(3,"yp-page-back-button-panel",1),e.nI1(4,"translate"),e.bIt("backClick",function(){return r.matDialogRef.close()}),e.k0s(),e.j41(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5),e.Z7z(9,it,13,10,null,null,e.fX1),e.nI1(11,"async"),e.k0s()()()(),e.j41(12,"div",6),e.nVh(13,lt,3,0,"div",7),e.j41(14,"div",8)(15,"div",9)(16,"div",10),e.EFF(17),e.nI1(18,"translate"),e.k0s(),e.j41(19,"div",11),e.EFF(20),e.nI1(21,"ypCurrency"),e.k0s()(),e.j41(22,"div",12)(23,"div",10),e.EFF(24),e.nI1(25,"translate"),e.k0s(),e.j41(26,"div",11),e.nVh(27,dt,1,1,"mat-spinner",13)(28,ct,3,5),e.k0s()()(),e.j41(29,"button",14),e.bIt("click",function(){d.eBV(a);const c=e.r8f(0);return d.Njj(r.continue(c))}),e.EFF(30),e.nI1(31,"translate"),e.k0s()()()}if(2&o){const a=e.bH3(e.bMT(1,8,r.selectedItemsPriceInfo$));e.R7$(3),e.Y8G("title",e.bMT(4,11,"TABLE_ORDER.DETAILS.SPLIT.BY_ITEM.TITLE")),e.R7$(6),e.Dyx(e.bMT(11,13,r.orderItems$)),e.R7$(4),e.vxM(a.state===r.SelectedItemsPriceInfoState.errors?13:-1),e.R7$(4),e.JRh(e.bMT(18,15,"TABLE_ORDER.AMOUNT_TO_PAY")),e.R7$(3),e.JRh(e.bMT(21,17,r.leftToPayInCents)),e.R7$(4),e.JRh(e.bMT(25,19,"TABLE_ORDER.DETAILS.SPLIT.YOUR_SHARE")),e.R7$(3),e.vxM(a.state===r.SelectedItemsPriceInfoState.loading?27:a.state!==r.SelectedItemsPriceInfoState.errors?28:-1),e.R7$(2),e.Y8G("disabled",a.state!==r.SelectedItemsPriceInfoState.success||0===a.selectedItemsToPay.length),e.R7$(),e.SpI(" ",e.bMT(31,21,"COMMON.CONTINUE")," ")}},dependencies:[m.YN,m.BC,m.vS,ie.LG,He.s,se.A,ze.q,oe._,x.o,Ze.E,E.Jj,g.D9,Ke.f],encapsulation:2,changeDetection:0})}}return t})();const pt=["paymentTypeLabel"],ut=t=>({value:t});function yt(t,s){1&t&&(e.j41(0,"div",2),e.nrm(1,"yp-page-back-button-panel",23),e.k0s()),2&t&&(e.R7$(),e.Y8G("backButtonRouterLink","../"))}function Tt(t,s){1&t&&e.nrm(0,"div",3)}function bt(t,s){1&t&&e.nrm(0,"hr")}function ft(t,s){if(1&t&&(e.nVh(0,bt,1,0,"hr"),e.nrm(1,"yp-selected-cart-item-details",24)),2&t){const n=s.$implicit;e.vxM(0!==s.$index?0:-1),e.R7$(),e.Y8G("orderItemViewInfo",n)}}function ht(t,s){if(1&t&&(e.j41(0,"mat-radio-button",28),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t){const n=s.$implicit;e.Y8G("value",n),e.R7$(),e.SpI(" ",e.bMT(2,2,"PAYMENT_OPTION."+n.paymentOptionType)," ")}}function It(t,s){1&t&&(e.j41(0,"mat-error",29),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.JRh(e.bMT(2,1,"CHECKOUT.PAYMENT_TYPE.REQUIRED")))}function Ct(t,s){if(1&t&&(e.j41(0,"div",2)(1,"label",26,1),e.EFF(3),e.nI1(4,"translate"),e.k0s(),e.j41(5,"mat-radio-group",27),e.Z7z(6,ht,3,4,"mat-radio-button",28,e.fX1),e.k0s(),e.nVh(8,It,3,3,"mat-error",29),e.k0s()),2&t){const n=e.XpG(2),o=e.r8f(6);e.R7$(3),e.SpI(" ",e.bMT(4,3,"CHECKOUT.PAYMENT_TYPE.LABEL")," "),e.R7$(2),e.Y8G("formControl",n.tableOrderToPayForm.controls.paymentInfo),e.R7$(),e.Dyx(o),e.R7$(2),e.vxM(n.tableOrderToPayForm.controls.paymentInfo.invalid&&(n.tableOrderToPayForm.controls.paymentInfo.touched||n.tableOrderToPayForm.controls.paymentInfo.dirty)?8:-1)}}function vt(t,s){if(1&t&&(e.j41(0,"div",2)(1,"label",2),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.nrm(4,"yp-tips",30),e.k0s()),2&t){const n=e.XpG(2),o=e.r8f(3),r=e.r8f(15);e.R7$(2),e.JRh(e.bMT(3,4,"CHECKOUT.TIPS.LABEL")),e.R7$(2),e.Y8G("baseAmountForTipsInCents",r)("tipPercentValues",o.storeTipSetting.tipPercentValues)("formControl",n.tableOrderToPayForm.controls.tipsInCents)}}function _t(t,s){if(1&t&&(e.j41(0,"div",9)(1,"div",14)(2,"form",25),e.nVh(3,Ct,9,5,"div",2),e.nVh(4,vt,5,6,"div",2),e.k0s()()()),2&t){const n=e.XpG(),o=e.r8f(3),r=e.r8f(6);e.R7$(2),e.Y8G("formGroup",n.tableOrderToPayForm),e.R7$(),e.vxM(r.length>1?3:-1),e.R7$(),e.vxM(o.storeTipSetting?4:-1)}}function Ot(t,s){if(1&t&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"ypCurrency"),e.k0s()),2&t){e.XpG
1();const n=e.r8f(12),o=e.r8f(21);e.AVh("fw-bolder",o.totalAmountToPayInCents===o.leftToPayAmountInCents),e.R7$(),e.Lme(" ",e.bMT(2,4,"SHOPPING_CART.TOTAL"),": ",e.bMT(3,6,n.amountInCents)," ")}}function gt(t,s){if(1&t&&(e.j41(0,"div"),e.EFF(1),e.nI1(2,"translate"),e.nI1(3,"ypCurrency"),e.k0s()),2&t){e.XpG();const n=e.r8f(12),o=e.r8f(21);e.AVh("fw-bolder",o.totalAmountToPayInCents===o.leftToPayAmountInCents),e.R7$(),e.Lme(" ",e.bMT(2,4,"TABLE_ORDER.AMOUNT_TO_PAY"),": ",e.bMT(3,6,n.amountInCents-n.orderPaidAmountInCents)," ")}}function Pt(t,s){if(1&t){const n=e.RV6();e.j41(0,"button",33),e.bIt("click",function(){d.eBV(n);const r=e.XpG(2),a=e.r8f(18);return d.Njj(r.splitTheBillClick(a,!0))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"COMMON.CHANGE")," "))}function Rt(t,s){if(1&t&&(e.j41(0,"div",19)(1,"div",31),e.EFF(2),e.nI1(3,"translate"),e.nI1(4,"ypCurrency"),e.k0s(),e.nVh(5,Pt,3,3,"button",32),e.k0s()),2&t){e.XpG();const n=e.r8f(21);e.R7$(2),e.Lme(" ",e.bMT(3,3,"TABLE_ORDER.DETAILS.YOU_PAY"),": ",e.bMT(4,5,n.totalAmountToPayInCents)," "),e.R7$(3),e.vxM(n.payTheRest?-1:5)}}function Ft(t,s){if(1&t){const n=e.RV6();e.j41(0,"button",35),e.bIt("click",function(){d.eBV(n);const r=e.XpG(2),a=e.r8f(18);return d.Njj(r.splitTheBillClick(a,!1))}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"TABLE_ORDER.DETAILS.SPLIT_BILL")," "))}function Et(t,s){if(1&t){const n=e.RV6();e.nVh(0,Ft,3,3,"button",34),e.j41(1,"button",35),e.bIt("click",function(){d.eBV(n);const r=e.XpG(),a=e.r8f(21);return d.Njj(r.payOrder(a))}),e.EFF(2),e.nI1(3,"translate"),e.k0s()}if(2&t){e.XpG();const n=e.r8f(21);e.vxM(n.payTheRest?0:-1),e.R7$(2),e.SpI(" ",e.bMT(3,2,"TABLE_ORDER.DETAILS.PAY")," ")}}function St(t,s){if(1&t){const n=e.RV6();e.j41(0,"button",36),e.bIt("click",function(){d.eBV(n);const r=e.XpG();return d.Njj(r.tableOrdersService.createNewOrderForCurrentTable())}),e.EFF(1),e.nI1(2,"translate"),e.k0s()}2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"TABLE_ORDER.LIST.NEW_ORDER")," "))}function Mt(t,s){if(1&t&&e.nrm(0,"yp-base-order-price-details",37),2&t){e.XpG
1();const n=e.r8f(3),o=e.r8f(12);e.Y8G("baseOrderDetails",o)("showTips",void 0!==n.storeTipSetting)}}var F=function(t){return t[t.splitTheBill=0]="splitTheBill",t[t.payByItem=1]="payByItem",t[t.payCustomAmount=2]="payCustomAmount",t}(F||{});let At=(()=>{class t{constructor(){this.PaymentOptionType=J.Y,this.AppLayoutFooterIndex=j.J,this.ImageSize=Re.h,this.ImageFileFormat=Pe.F,this.AspectRatio=ge.g,this.tableOrdersService=(0,d.WQX)(B),this.tenant=(0,d.WQX)(S.$),this.store=(0,d.WQX)(C.il),this.matDialog=(0,d.WQX)(W.bZ),this.matBottomSheet=(0,d.WQX)(M.VK),this.paymentTypeLabelElementRef=(0,N.ebz)("paymentTypeLabel",{read:e.aKT}),this.tableOrderToPayForm=new m.gE({paymentInfo:new m.MJ(null,m.k0.required),tipsInCents:new m.MJ({value:null,disabled:!1})}),this.selectedPaymentInfo$=new ee.t({payTheRest:!0});const n=(0,d.WQX)(te.t);this.orderTimeFormatter=new Intl.DateTimeFormat(n,{timeStyle:"short"}),this.customerWebSettings$=this.store.select(De.gd).pipe((0,b.eU)()),this.store$=this.store.select(p.FK).pipe((0,b.eU)()),this.currentTable$=(0,V.z)([this.store$,this.store.select(p.Jn).pipe((0,b.eU)())]).pipe((0,T.T)(([a,l])=>{const c=(0,$.BI)(l,a.storeFloorPlans);return(0,I.iY)(c),c})),this.tableOrdersCount$=this.store.select(p.FL).pipe((0,b.eU)(),(0,T.T)(a=>((0,I.iY)(a.data),a.data.tableOrders.length))),this.availablePaymentOptions$=this.store$.pipe((0,T.T)(a=>{const l=a.orderTypes.find(c=>c.orderType===ne.Z.dineIn);return(0,I.iY)(l),(0,$.HS)(l.paymentTypes)}));const o=this.store.select(p.LT).pipe((0,b.eU)());this.orderDetails$=o.pipe((0,T.T)(a=>(0,re.F)(a)));const r=this.orderDetails$.pipe((0,T.T)(a=>a.amountInCents-a.orderPaidAmountInCents));this.baseAmountForTipsInCents$=(0,V.z)([r,this.selectedPaymentInfo$]).pipe((0,T.T)(([a,l])=>{let c;return c=l.payTheRest?a:l.amountToPayInCents,c})),this.amountToPayInfo$=(0,V.z)([r,this.selectedPaymentInfo$,this.tableOrderToPayForm.controls.tipsInCents.valueChanges.pipe((0,Q.Z)(null))]).pipe((0,T.T)(([a,l,c])=>{let u,y=0;return a>0&&(l.payTheRest?y=a:(y=l.amountToPayInCents,u=l.itemsToPay)),{payTheRest:l.payTheRest,leftToPayAmountInCents:a,customOrderAmountToPayInCents:l.payTheRest?void 0:l.amountToPayInCents,tipsAmountInCents:c??void 0,totalAmountToPayInCents:y+(c??0),itemsToPay:u}})),this.splitBillButtonType$=o.pipe((0,T.T)(a=>{if(!a.serviceFee&&!a.surcharge){const l=a.orderItems.find(c=>c.paidQuantity>c.qty);if(l)console.log("[YP]",`${l.name} is overpaid, so only pay custom amount is available now`);else{if(0===a.orderPaidAmount)return F.splitTheBill;const c=a.orderItems.reduce((y,u)=>y+u.paidQuantity*u.price,0);if(a.orderPaidAmount===c)return F.payByItem}}return F.payCustomAmount})),this.availablePaymentOptions$.pipe((0,K.pQ)()).subscribe(a=>{if(this.tableOrderToPayForm.controls.paymentInfo.value){const l=this.tableOrderToPayForm.controls.paymentInfo.value,c=a.find(y=>(0,$.eG)(y,l));c?this.tableOrderToPayForm.controls.paymentInfo.setValue(c,{emitEvent:!1}):this.tableOrderToPayForm.controls.paymentInfo.setValue(null,{emitEvent:!0})}else 1===a.length&&this.tableOrderToPayForm.controls.paymentInfo.setValue(a[0],{emitEvent:!0})})}payOrder(n){if(this.tableOrderToPayForm.invalid)this.tableOrderToPayForm.markAllAsTouched(),this.tableOrderToPayForm.controls.paymentInfo.invalid&&this.paymentTypeLabelElementRef()?.nativeElement.scrollIntoView({block:"start",behavior:"smooth"});else{let o;switch((0,I.HO)(this.tableOrderToPayForm.controls.paymentInfo.value),this.tableOrderToPayForm.controls.paymentInfo.value.paymentOptionType){case J.Y.cardOnline:case J.Y.sbp:o={paymentOptionType:this.tableOrderToPayForm.controls.paymentInfo.value.paymentOptionType}}this.store.dispatch(v.b.payCurrentTableCurrentOrder(o,n.customOrderAmountToPayInCents,n.tipsAmountInCents,n.itemsToPay))}}splitTheBillClick(n,o){switch(n){case F.payByItem:this.showPayByItemSelectionDialog();break;case F.payCustomAmount:this.showPayCustomAmountDialog();break;default:this.matBottomSheet.open(Ge,{data:{showPayTheRestOption:o}}).afterDismissed().subscribe(r=>{if(r)switch(r.selectedSplitPaymentOption){case L.payByItem:this.showPayByItemSelectionDialog();break;case L.payCustomAmount:this.showPayCustomAmountDialog();break;case L.payTheRest:this.selectedPaymentInfo$.next({payTheRest:!0})}})}}showPayByItemSelectionDialog(){const n=this.selectedPaymentInfo$.getValue();this.store.select(p.LT).pipe((0,b.eU)(),(0,A.$)(),(0,D.n)(o=>this.matDialog.open(mt,{data:{orderDetails:o,selectedItemsToPay:n.payTheRest?void 0:n.itemsToPay},panelClass:"yp-mat-dialog-md"}).afterClosed())).subscribe(o=>{o&&this.selectedPaymentInfo$.next({payTheRest:!1,amountToPayInCents:(0,O._P)(o.selectedItemsToPay.reduce((r,a)=>r+a.priceWithTax,0)),itemsToPay:o.selectedItemsToPay})})}showPayCustomAmountDialog(){const n=this.selectedPaymentInfo$.getValue();this.store.select(p.LT).pipe((0,b.eU)(),(0,A.$)(),(0,D.n)(o=>this.matBottomSheet.open(Be,{data:{customAmountToPayInCents:n.payTheRest?void 0:n.amountToPayInCents,orderAmountInCents:(0,O._P)(o.amount),orderPaidAmountInCents:(0,O._P)(o.orderPaidAmount)},autoFocus:"first-tabbable"}).afterDismissed())).subscribe(o=>{o&&this.selectedPaymentInfo$.next({payTheRest:!1,amountToPayInCents:o.customAmountToPayInCents,itemsToPay:void 0})})}showOrderAmountDetails(n){this.matBottomSheet.open(n,{autoFocus:"first-tabbable"})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-table-order-details"]],viewQuery:function(o,r){1&o&&e.wEZ(r.paymentTypeLabelElementRef,pt,5,e.aKT),2&o&&e.NyB()},decls:62,vars:65,consts:[["templateOrderAmountDetails",""],["paymentTypeLabel",""],[1,"mb-2"],[1,"mt-5"],[1,"d-flex","justify-content-center"],[1,"half-crossed-logo-container"],[1,"half-crossed-logo-wrapper"],[3,"image","imageSize","imageAspectRatio","imageFileFormat"],[1,"cards-container"],[1,"yp-card"],[1,"half-crossed-logo-spacer"],[1,"yp-card-title"],[1,"d-flex","align-items-center","justify-content-between"],["type","button",1,"yp-btn","yp-btn-link","p-0",3,"click"],[1,"yp-card-content"],[3,"index"],[1,"p-3"],[1,"mb-4"],[3,"fw-bolder"],[1,"d-flex","align-items-center","gap-3"],["type","button",1,"yp-btn","yp-btn-sm","yp-btn-link","p-0",3,"click"],[1,"yp-bottom-buttons-wrapper"],["type","button",1,"flex-grow-1","yp-btn","yp-btn-lg","yp-btn-primary"],[3,"backButtonRouterLink"],[3,"orderItemViewInfo"],["novalidate","",3,"formGroup"],["id","table-order-details-payment-type-radio-group-label"],["aria-labelledby","table-order-details-payment-type-radio-group-label",1,"d-flex","flex-column",3,"formControl"],[3,"value"],[1,"ps-3","fs-3"],[3,"baseAmountForTipsInCents","tipPercentValues","formControl"],[1,"fw-bolder"],["type","button",1,"yp-btn","yp-btn-sm","yp-btn-link","yp-btn-link-alt","p-0"],["type","button",1,"yp-btn","yp-btn-sm","yp-btn-link","yp-btn-link-alt","p-0",3,"click"],["type","button",1,"yp-btn","yp-btn-lg","yp-btn-primary"],["type","button",1,"yp-btn","yp-btn-lg","yp-btn-primary",3,"click"],["type","button",1,"flex-grow-1","yp-btn","yp-btn-lg","yp-btn-primary",3,"click"],[3,"baseOrderDetails","showTips"]],template:function(o,r){if(1&o){const a=e.RV6();e.SS7(0),e.nI1(1,"async"),e.nI1(2,"ypNotNull"),e.SS7(3),e.nI1(4,"async"),e.nI1(5,"ypNotNull"),e.SS7(6),e.nI1(7,"async"),e.nI1(8,"ypNotNull"),e.SS7(9),e.nI1(10,"async"),e.nI1(11,"ypNotNull"),e.SS7(12),e.nI1(13,"async"),e.nI1(14,"ypNotNull"),e.SS7(15),e.nI1(16,"async"),e.nI1(17,"ypNotNull"),e.SS7(18),e.nI1(19,"async"),e.nI1(20,"ypNotNull"),e.SS7(21),e.nI1(22,"async"),e.nI1(23,"ypNotNull"),e.nV
1h(24,yt,2,1,"div",2)(25,Tt,1,0,"div",3),e.j41(26,"div",4)(27,"div",5)(28,"div",6),e.nrm(29,"yp-image",7),e.k0s()()(),e.j41(30,"div",8)(31,"div",9),e.nrm(32,"div",10),e.j41(33,"div",11)(34,"div",12)(35,"h2"),e.EFF(36),e.nI1(37,"translate"),e.nI1(38,"async"),e.nI1(39,"translate"),e.k0s(),e.j41(40,"button",13),e.bIt("click",function(){return r.tableOrdersService.createNewOrderForCurrentTable()}),e.EFF(41),e.nI1(42,"translate"),e.k0s()()(),e.j41(43,"div",14),e.Z7z(44,ft,2,2,null,null,e.fX1),e.k0s()(),e.nVh(46,_t,5,3,"div",9),e.k0s(),e.j41(47,"yp-fixed-footer",15)(48,"div",16)(49,"div",17),e.nVh(50,Ot,4,8,"div",18)(51,gt,4,8,"div",18),e.nVh(52,Rt,6,7,"div",19),e.j41(53,"div")(54,"button",20),e.bIt("click",function(){d.eBV(a);const c=e.sdS(61);return d.Njj(r.showOrderAmountDetails(c))}),e.EFF(55),e.nI1(56,"translate"),e.k0s()()(),e.j41(57,"div",21),e.nVh(58,Et,4,4)(59,St,3,3,"button",22),e.k0s()()(),e.DNE(60,Mt,1,2,"ng-template",null,0,e.C5r)}if(2&o){const a=e.bMT(2,16,e.bMT(1,14,r.customerWebSettings$));e.R7$(3);const l=e.bH3(e.bMT(5,20,e.bMT(4,18,r.store$)));e.R7$(3);const c=e.bH3(e.bMT(8,25,e.bMT(7,23,r.availablePaymentOptions$))),y=e.bMT(11,30,e.bMT(10,28,r.tableOrdersCount$));e.R7$(6);const u=e.bH3(e.bMT(14,34,e.bMT(13,32,r.orderDetails$)));e.R7$(3),e.bH3(e.bMT(17,39,e.bMT(16,37,r.baseAmountForTipsInCents$))),e.R7$(3),e.bH3(e.bMT(20,44,e.bMT(19,42,r.splitBillButtonType$))),e.R7$(3);const k=e.bH3(e.bMT(23,49,e.bMT(22,47,r.amountToPayInfo$)));e.R7$(3),e.vxM(y>1?24:25),e.R7$(5),e.Y8G("image",a.squareLogo)("imageSize",r.ImageSize.sm)("imageAspectRatio",r.AspectRatio.aspectRatio1x1)("imageFileFormat",r.ImageFileFormat.png),e.R7$(7),e.Lme(" ",e.bMT(37,52,"CHECKOUT.TABLE.LABEL")," ",e.i5U(39,56,"COMMON.NUMBER_SYMBOL_WITH_VALUE",e.eq3(63,ut,e.bMT(38,54,r.currentTable$).tableNumber))," "),e.R7$(5),e.SpI(" ",e.bMT(42,59,"TABLE_ORDER.DETAILS.OPEN_MENU")," "),e.R7$(3),e.Dyx(u.orderItemsInfo),e.R7$(2),e.vxM(u.amountInCents>u.orderPaidAmountInCents&&(l.storeTipSetting||c.length>1)?46:-1),e.R7$(),e.Y8G("index",r.AppLayoutFooterIndex.firstLevel),e.R7$(3),e.vxM(0===u.orderPaidAmountInCents?50:51),e.R7$(2),e.vxM(k.totalAmountToPayInCents!==k.leftToPayAmountInCents?52:-1),e.R7$(3),e.SpI(" ",e.bMT(56,61,"CHECKOUT.DETAILS.MORE_DETAILS.LABEL")," "),e.R7$(3),e.vxM(u.amountInCents>u.orderPaidAmountInCents?58:59)}},dependencies:[m.X1,m.qT,m.BC,m.cb,m.l_,m.j4,q.VT,q._g,G.TL,Ee.G,oe._,Se.h,Me.Y,Ae.G,Fe.d,E.Jj,x.o,g.D9,ae.T],styles:["[_nghost-%COMP%]{--bs-border-style: dotted}mat-error[_ngcontent-%COMP%]{color:var(--mat-form-field-error-text-color, var(--mat-app-error))}.btn-split-type[_ngcontent-%COMP%]{flex-basis:50%;flex-grow:1}"],changeDetection:0})}}return t})();var Dt=i(74474),$t=i(75330);function xt(t,s){if(1&t){const n=e.RV6();e.j41(0,"yp-redirect-to-payment-processor",1),e.bIt("cancelPayment",function(){d.eBV(n);const r=e.XpG();return d.Njj(r.goAwayFromPage())}),e.k0s()}if(2&t){const n=e.XpG();e.Y8G("processPaymentParams",n.processPaymentParams)}}let Lt=(()=>{class t extends Dt.A{constructor(){super(...arguments),this.activatedRoute=(0,d.WQX)(h.nX),this.router=(0,d.WQX)(h.Ix)}goAwayFromPage(){this.activatedRoute.queryParamMap.pipe((0,A.$)()).subscribe(n=>{const o=n.get("partialPaymentId")??void 0;this.router.navigate(["../"],{queryParams:{partialPaymentId:o},relativeTo:this.activatedRoute})})}static{this.\u0275fac=(()=>{let n;return function(r){return(n||(n=e.xGo(t)))(r||t)}})()}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-table-order-pay-redirect"]],features:[e.Vt3],decls:1,vars:1,consts:[[3,"processPaymentParams"],[3,"cancelPayment","processPaymentParams"]],template:function(o,r){1&o&&e.nVh(0,xt,1,1,"yp-redirect-to-payment-processor",0),2&o&&e.vxM(r.processPaymentParams?0:-1)},dependencies:[$t.j],encapsulation:2,changeDetection:0})}}return t})();var kt=i(60177),le=i(77339),de=i(86884),ce=i(65873),jt=i(99627);const Bt=t=>({paymentAmount:t});function Nt(t,s){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,"SHOPPING_CART.PAYMENT_IN_PROCESS")," ")}function Gt(t,s){if(1&t&&(e.EFF(0),e.nI1(1,"ypCurrency"),e.nI1(2,"translate")),2&t){const n=e.XpG();e.SpI(" ",e.i5U(2,3,"TABLE_ORDER.PAYMENT_RESULT.SUCCESS",e.eq3(6,Bt,e.bMT(1,1,n.paymentResult.paymentAmountInCents)))," ")}}function Vt(t,s){1&t&&(e.EFF(0),e.nI1(1,"translate")),2&t&&e.SpI(" ",e.bMT(1,1,"TABLE_ORDER.PAYMENT_RESULT.FAILURE")," ")}function Xt(t,s){1&t&&e.nrm(0,"mat-spinner",4)}function Ut(t,s){1&t&&e.nrm(0,"yp-checkmark-animation")}function wt(t,s){if(1&t){const n=e.RV6();e.j41(0,"div",6)(1,"button",7),e.bIt("click",function(){d.eBV(n);const r=e.XpG();return d.Njj(r.okClick())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"COMMON.OK")," "))}let Yt=(()=>{class t{constructor(){this.store=(0,d.WQX)(C.il),this.spinnerService=(0,d.WQX)(ce.D),this.router=(0,d.WQX)(h.Ix),this.activatedRoute=(0,d.WQX)(h.nX),this.Ap
1pLayoutFooterIndex=j.J;const n=(0,d.WQX)(e.Agw),o=(0,d.WQX)(le.En),r=(0,d.WQX)(N.gRc);if((0,kt.Vy)(n))throw new Error("TableOrderPayComponent should not be rendered on server side");this.activatedRoute.queryParamMap.pipe((0,A.$)()).subscribe(a=>{const l=a.get("partialPaymentId")??void 0;if(l){o.pipe((0,le.gp)(v.b.saveCurrentTableCurrentOrderPaymentSuccess,v.b.saveCurrentTableCurrentOrderPaymentFailure),(0,K.pQ)()).subscribe(y=>{this.spinnerService.decrementCustomSpinnersCount(),this.paymentResult=y.type===v.b.saveCurrentTableCurrentOrderPaymentSuccess.type?{isPaymentSuccess:!0,paymentAmountInCents:y.paymentAmountInCents}:{isPaymentSuccess:!1},r.markForCheck()});const c=a.get("yTransactionId")??void 0;this.store.dispatch(v.b.saveCurrentTableCurrentOrderPayment(c,l)),this.spinnerService.incrementCustomSpinnersCount()}else console.log("[YP]","partialPaymentId query parameter missing, redirecting to orders list"),this.router.navigate(["../../"],{relativeTo:this.activatedRoute})})}ngOnDestroy(){void 0===this.paymentResult&&this.spinnerService.decrementCustomSpinnersCount()}okClick(){this.store.dispatch(v.b.loadCurrentTableOrders(de.Q.mainScreenArea)),this.router.navigate(["../../"],{relativeTo:this.activatedRoute})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-table-order-pay"]],decls:10,vars:4,consts:[[3,"footerUnderflowEnabled"],[1,"m-4"],[1,"text-center","mb-5"],[1,"text-center","pt-5"],[1,"d-inline-block"],["class","yp-bottom-buttons-wrapper",4,"ypProjectedFooter"],[1,"yp-bottom-buttons-wrapper"],["type","button",1,"yp-btn","yp-btn-lg","yp-btn-primary",3,"click"]],template:function(o,r){1&o&&(e.j41(0,"yp-fixed-header-footer",0)(1,"div",1)(2,"h1",2),e.nVh(3,Nt,2,3)(4,Gt,3,8)(5,Vt,2,3),e.k0s(),e.j41(6,"div",3),e.nVh(7,Xt,1,0,"mat-spinner",4)(8,Ut,1,0,"yp-checkmark-animation"),e.k0s()(),e.DNE(9,wt,4,3,"div",5),e.k0s()),2&o&&(e.Y8G("footerUnderflowEnabled",!0),e.R7$(3),e.vxM(void 0===r.paymentResult?3:r.paymentResult.isPaymentSuccess&&void 0!==r.paymentResult.paymentAmountInCents?4:5),e.R7$(4),e.vxM(void 0===r.paymentResult?7:r.paymentResult.isPaymentSuccess?8:-1),e.R7$(2),e.Y8G("ypProjectedFooter",r.AppLayoutFooterIndex.firstLevel))},dependencies:[P.cU,jt.o,ie.LG,P.J0,x.o,g.D9],encapsulation:2,changeDetection:0})}}return t})();var Wt=i(68943),Qt=i(99213),Jt=i(64954),Ht=i(41566);let zt=(()=>{class t{constructor(){this.ypDataFromServerError=N.hFB.required();const n=(0,d.WQX)(e.c1b),o=(0,d.WQX)(e.C4Q);let r=!1;(0,N.uEv)({read:()=>{const a=this.ypDataFromServerError();r?(2!==a.status||a.data)&&(n.clear(),r=!1):2===a.status&&!a.data&&(n.createEmbeddedView(o),r=!0)}})}static ngTemplateGuard_ypDataFromServerError(n,o){return 2===o.status}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275dir=e.FsC({type:t,selectors:[["","ypDataFromServerError",""]],inputs:{ypDataFromServerError:[1,"ypDataFromServerError"]}})}}return t})();var Zt=i(9282);const Kt=t=>({value:t}),qt=t=>({orderTime:t});function en(t,s){if(1&t){const n=e.RV6();e.j41(0,"div",10)(1,"h4",11),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"button",12),e.bIt("click",function(){d.eBV(n);const r=e.XpG();return d.Njj(r.refresh())}),e.nrm(5,"mat-icon",13),e.k0s()()}if(2&t){const n=e.XpG();e.R7$(2),e.SpI(" ",e.bMT(3,2,"TABLE_ORDER.LIST.TITLE")," "),e.R7$(3),e.Y8G("svgIcon",n.SvgIcon.refreshCcw)}}function tn(t,s){if(1&t&&(e.j41(0,"div",15),e.nrm(1,"yp-error",16),e.k0s()),2&t){const n=s.$implicit;e.R7$(),e.Y8G("serverResponseError",n)}}function nn(t,s){if(1&t&&(e.j41(0,"div",14),e.Z7z(1,tn,2,1,"div",15,e.fX1),e.k0s()),2&t){e.XpG
1();const n=e.r8f(0);e.R7$(),e.Dyx(n.errors)}}function rn(t,s){if(1&t&&(e.j41(0,"div",23)(1,"div"),e.EFF(2),e.nI1(3,"translate"),e.k0s(),e.j41(4,"div"),e.EFF(5),e.nI1(6,"ypCurrency"),e.k0s()()),2&t){const n=e.XpG().$implicit;e.R7$(2),e.SpI(" ",e.bMT(3,2,"TABLE_ORDER.AMOUNT_PAID")," "),e.R7$(3),e.SpI(" ",e.bMT(6,4,n.orderPaidAmountInCents)," ")}}function on(t,s){if(1&t&&(e.j41(0,"div",28)(1,"div",29),e.EFF(2),e.k0s(),e.j41(3,"div",30),e.EFF(4),e.k0s(),e.j41(5,"div",31),e.EFF(6),e.nI1(7,"ypCurrency"),e.k0s()()),2&t){const n=e.XpG().$implicit;e.R7$(2),e.SpI(" ",n.orderItemName," "),e.R7$(2),e.SpI(" ",n.orderItemQuantity," "),e.R7$(2),e.SpI(" ",n.fromServer?e.bMT(7,3,n.fromServer.orderItemPriceInCents*n.orderItemQuantity):"?"," ")}}function an(t,s){1&t&&e.nVh(0,on,8,5,"div",28),2&t&&e.vxM(s.$index<3?0:-1)}function sn(t,s){if(1&t&&(e.j41(0,"li",7)(1,"a",17),e.nI1(2,"ypTableOrderDetailsLink"),e.j41(3,"div",18)(4,"div",19),e.EFF(5),e.nI1(6,"ypDateTime"),e.nI1(7,"translate"),e.k0s(),e.nrm(8,"i",20),e.k0s(),e.j41(9,"div",21)(10,"div",22)(11,"div"),e.EFF(12),e.nI1(13,"translate"),e.k0s(),e.j41(14,"div"),e.EFF(15),e.nI1(16,"ypCurrency"),e.k0s()(),e.nVh(17,rn,7,6,"div",23),e.k0s(),e.nrm(18,"hr"),e.j41(19,"div",24)(20,"div",25),e.Z7z(21,an,1,1,null,null,e.fX1),e.k0s(),e.j41(23,"div",26),e.nrm(24,"div",27),e.k0s()()()()),2&t){const n=s.$implicit,o=e.XpG();e.R7$(),e.Y8G("routerLink",e.bMT(2,5,n)),e.R7$(4),e.SpI(" ",e.i5U(7,10,"TABLE_ORDER.ORDER_AT",e.eq3(17,qt,e.i5U(6,7,n.created,o.orderTimeFormatter)))," "),e.R7$(7),e.SpI(" ",e.bMT(13,13,"TABLE_ORDER.AMOUNT_TOTAL")," "),e.R7$(3),e.SpI(" ",e.bMT(16,15,n.amountInCents)," "),e.R7$(2),e.vxM(n.orderPaidAmountInCents?17:-1),e.R7$(4),e.Dyx(n.orderItemsInfo)}}function ln(t,s){1&t&&(e.j41(0,"div",8),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&t&&(e.R7$(),e.SpI(" ",e.bMT(2,1,"TABLE_ORDER.LIST.NO_ORDERS")," "))}function dn(t,s){if(1&t){const n=e.RV6();e.j41(0,"div",32)(1,"button",33),e.bIt("click",function(){d.eBV(n);const r=e.XpG();return d.Njj(r.tableOrdersService.createNewOrderForCurrentTable())}),e.EFF(2),e.nI1(3,"translate"),e.k0s()()}2&t&&(e.R7$(2),e.SpI(" ",e.bMT(3,1,"TABLE_ORDER.LIST.NEW_ORDER")," "))}let cn=(()=>{class t{transform(n){return[n.orderId]}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=e.EJ8({name:"ypTableOrderDetailsLink",type:t,pure:!0})}}return t})(),mn=(()=>{class t{constructor(n,o,r,a){this.store=n,this.tableOrdersService=o,this.AppLayoutHeaderIndex=Ht.h,this.Ap
1pLayoutFooterIndex=j.J,this.SvgIcon=Jt.h,this.ordersData$=this.store.select(p.FL).pipe((0,b.eU)()),this.tableOrders$=this.ordersData$.pipe((0,T.T)(l=>l.data?.tableOrders.map(c=>(0,re.F)(c))??[])),this.tableViewInfo$=(0,V.z)([this.store.select(p.FK).pipe((0,b.eU)()),this.store.select(p.Jn).pipe((0,b.eU)())]).pipe((0,T.T)(([l,c])=>{let y;for(const u of l.storeFloorPlans){for(const k of u.floorTables)if(k.tableId===c){y={floorPlan:u,table:k};break}if(void 0!==y)break}return(0,I.iY)(y),y})),this.orderTimeFormatter=new Intl.DateTimeFormat(r,{timeStyle:"short"}),this.spinnerType=a.generateSpinnerType()}refresh(){this.store.dispatch(v.b.loadCurrentTableOrders(this.spinnerType))}static{this.\u0275fac=function(o){return new(o||t)(e.rXU(C.il),e.rXU(B),e.rXU(te.t),e.rXU(ce.D))}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["yp-table-orders"]],decls:25,vars:29,consts:[[3,"showSpinner","footerUnderflowEnabled"],["class","d-flex align-items-center px-3",4,"ypProjectedHeader"],[1,"px-3","mb-3"],[1,"mb-3"],[1,"text-lowercase"],["class","my-3 text-center yp-text-danger",4,"ypDataFromServerError"],[1,"cards-container","p-0"],[1,"yp-card"],[1,"yp-text-muted","empty-menu-or-cart-message"],["class","yp-bottom-buttons-wrapper",4,"ypProjectedFooter"],[1,"d-flex","align-items-center","px-3"],[1,"flex-grow-1","pt-3","mb-3"],[1,"p-0","yp-btn","yp-btn-no-bg","yp-btn-icon",3,"click"],[1,"icon-xs",3,"svgIcon"],[1,"my-3","text-center","yp-text-danger"],[1,"my-2","mx-3"],[3,"serverResponseError"],["matRipple","",1,"d-block","link-as-text",3,"routerLink"],[1,"d-flex","align-items-center","mb-3","yp-text-muted"],[1,"flex-grow-1","fs-3"],[1,"icomoon-icon","icon-chevron_right"],[1,"yp-card-content","fs-5"],[1,"d-flex","justify-content-between","mb-1","fw-bold"],[1,"d-flex","justify-content-between","yp-text-success"],[1,"yp-card-content","order-items-wrapper","fs-3"],[1,"order-items"],[1,"order-items-shadow-wrapper"],[1,"order-items-shadow"],[1,"order-item"],[1,"order-item-name","text-truncate"],[1,"order-item-qty"],[1,"order-item-price"],[1,"yp-bottom-buttons-wrapper"],["type","button",1,"yp-btn","yp-btn-lg","yp-btn-primary",3,"click"]],template:function(o,r){if(1&o&&(e.SS7(0),e.nI1(1,"async"),e.nI1(2,"ypNotNull"),e.SS7(3),e.nI1(4,"async"),e.nI1(5,"ypNotNull"),e.SS7(6),e.nI1(7,"async"),e.nI1(8,"ypNotNull"),e.j41(9,"yp-fixed-header-footer",0),e.DNE(10,en,6,4,"div",1),e.j41(11,"div",2)(12,"h6",3),e.EFF(13),e.j41(14,"span",4),e.EFF(15),e.nI1(16,"translate"),e.k0s(),e.EFF(17),e.nI1(18,"translate"),e.k0s(),e.DNE(19,nn,3,0,"div",5),e.k0s(),e.j41(20,"ul",6),e.Z7z(21,sn,25,19,"li",7,e.fX1),e.k0s(),e.nVh(23,ln,3,3,"div",8),e.DNE(24,dn,4,3,"div",9),e.k0s()),2&o){const a=e.bH3(e.bMT(2,11,e.bMT(1,9,r.ordersData$))),l=e.bMT(5,16,e.bMT(4,14,r.tableOrders$)),c=e.bMT(8,20,e.bMT(7,18,r.tableViewInfo$));e.R7$(9),e.Y8G("showSpinner",r.spinnerType)("footerUnderflowEnabled",!0),e.R7$(),e.Y8G("ypProjectedHeader",r.AppLayoutHeaderIndex.last),e.R7$(3),e.SpI(" ",c.floorPlan.planName,", "),e.R7$(2),e.SpI(" ",e.bMT(16,22,"CHECKOUT.TABLE.LABEL")," "),e.R7$(2),e.SpI(" ",e.i5U(18,24,"COMMON.NUMBER_SYMBOL_WITH_VALUE",e.eq3(27,Kt,c.table.tableNumber))," "),e.R7$(2),e.Y8G("ypDataFromServerError",a),e.R7$(2),e.Dyx(l),e.R7$(2),e.vxM(0===(null==a.data||null==a.data.tableOrders?null:a.data.tableOrders.length)?23:-1),e.R7$(),e.Y8G("ypProjectedFooter",r.AppLayoutFooterIndex.firstLevel)}},dependencies:[Wt.r6,H.Wk,P.cU,se.A,zt,P.xp,P.J0,Qt.An,E.Jj,g.D9,x.o,Zt.A,cn,ae.T],styles:["li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]{position:relative;overflow:hidden}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items[_ngcontent-%COMP%]{max-height:4.5rem}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items[_ngcontent-%COMP%]   .order-item[_ngcontent-%COMP%]{display:flex}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items[_ngcontent-%COMP%]   .order-item[_ngcontent-%COMP%] + .order-item[_ngcontent-%COMP%]{margin-top:.5rem}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items[_ngcontent-%COMP%]   .order-item[_ngcontent-%COMP%]   .order-item-name[_ng
1content-%COMP%]{flex-grow:1}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items[_ngcontent-%COMP%]   .order-item[_ngcontent-%COMP%]   .order-item-qty[_ngcontent-%COMP%]{min-width:2em;margin-inline:.5em;flex-shrink:0;white-space:nowrap}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items[_ngcontent-%COMP%]   .order-item[_ngcontent-%COMP%]   .order-item-price[_ngcontent-%COMP%]{min-width:5em;flex-shrink:0;text-align:end;white-space:nowrap}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items-shadow-wrapper[_ngcontent-%COMP%]{position:absolute;inset-block-start:0;inset-inline:0;min-height:4.5rem;pointer-events:none}li[_ngcontent-%COMP%]   .order-items-wrapper[_ngcontent-%COMP%]   .order-items-shadow-wrapper[_ngcontent-%COMP%]   .order-items-shadow[_ngcontent-%COMP%]{position:absolute;inset-block-end:0;inset-inline:0;height:2em;background:linear-gradient(rgba(var(--yp-body-bg-rgb),.4),rgba(var(--yp-body-bg-rgb),.9))}"],changeDetection:0})}}return t})();const pn=function(){var t=(0,w.A)(function*(s,n){const o=(0,d.WQX)(S.$),r=(0,d.WQX)(C.il);let a;a=o.bitSettingsDecoded.mainStoreMode?s.paramMap.get(f.G.param.currentRegionId.children.store.param.storeId.children.table.children.param.tableId.children.order.children.param.orderId.name)??void 0:s.paramMap.get(f.G.store.param.storeId.children.table.children.param.tableId.children.order.children.param.orderId.name)??void 0,(0,I.iY)(a);const l=yield(0,_._)(r.select(p.FL));l?.data&&l.data.tableOrders.some(c=>c.orderId===a)&&(r.dispatch(v.b.setCurrentTableCurrentOrder(a)),yield(0,_._)(r.select(p.LT).pipe((0,b.c4)())))});return function(n,o){return t.apply(this,arguments)}}(),Tn=function(){var t=(0,w.A)(function*(s,n){const o=(0,d.WQX)(S.$);let r;r=o.bitSettingsDecoded.mainStoreMode?s.paramMap.get(f.G.param.currentRegionId.children.store.param.storeId.children.table.children.param.tableId.name)??void 0:s.paramMap.get(f.G.store.param.storeId.children.table.children.param.tableId.name)??void 0,(0,I.iY)(r);const a=(0,d.WQX)(C.il),l=(0,d.WQX)(h.Ix),c=yield(0,_._)(a.select(p.FK));if(c){const y=c.orderTypes.find(u=>u.orderType===ne.Z.dineIn);if(y)if((0,$.HS)(y.paymentTypes).length&&(o.bitSettingsDecoded.allowCreateOrderForNotRegisteredWithoutAuthorization||o.bitSettingsDecoded.allowCreateOrderForRegisteredWithoutAuthorization)&&10!==c.paymentProcessorType&&17!==c.paymentProcessorType)void 0!==(0,$.BI)(r,c.storeFloorPlans)&&(a.dispatch(v.b.setCurrentTable(r)),yield(0,_._)(a.select(p.Jn).pipe((0,b.c4)())));else{o.bitSettingsDecoded.allowCreateOrderForNotRegisteredWithoutAuthorization||o.bitSettingsDecoded.allowCreateOrderForRegisteredWithoutAuthorization?console.warn("[YP]","Partial payments not available. Redirecting to shop root."):console.warn("[YP]","Partial payments require anonymous authorization. Redirecting to shop root.");const u=yield(0,_._)(a.select(p.Od));a.dispatch(Z.k.setTableIdFromQueryParams(r)),yield l.navigate(Y.k.getShopRootPath(u,c))}else{console.warn("[YP]","Dine In not available. Redirecting to shop root.");const u=yield(0,_._)(a.select(p.Od));yield l.navigate(Y.k.getShopRootPath(u,c))}}});return function(n,o){return t.apply(this,arguments)}}(),bn=[{path:":"+f.G.store.param.storeId.children.table.children.param.tableId.name,resolve:[Tn],component:Oe,children:[{path:f.G.store.param.storeId.children.table.children.param.tableId.children.order.path,resolve:[(t,s)=>{const n=(0,d.WQX)(C.il);return n.select(p.Jn).pipe((0,D.n)(o=>o?(n.dispatch(v.b.loadCurrentTableOrders(de.Q.mainScreenArea)),n.select(p.FL).pipe((0,A.$)(r=>0!==r?.status),(0,T.T)(()=>{}))):(0,X.of)(void 0)))}],children:[{path:"",component:mn,resolve:[(t,s)=>{const n=(0,d.WQX)(C.il),o=(0,d.WQX)(h.Ix),r=(0,d.WQX)(B);return n.select(p.Jn).pipe((0,D.n)(a=>a?n.select(p.FL).pipe((0,T.T)(l=>{switch((0,I.iY)(l?.data),l.data.tableOrders.length){case 0:console.log("[YP]","Table has no orders. Redirect to menu."),r.createNewOrderForCurrentTable();break;case 1:console.log("[YP]","Table has one order. Redirect to order details."),o.navigateByUrl((0,h.Wj)(t,[l.data.tableOrders[0].orderId]))}}
1)):(0,X.of)(void 0)))}]},{path:":"+f.G.store.param.storeId.children.table.children.param.tableId.children.order.children.param.orderId.name,children:[{path:"",component:Ce,resolve:[pn],children:[{path:"",component:At},{path:f.G.store.param.storeId.children.table.children.param.tableId.children.order.children.param.orderId.children.pay.path,children:[{path:"",component:Yt},{path:f.G.store.param.storeId.children.table.children.param.tableId.children.order.children.param.orderId.children.pay.children.redirect.path,component:Lt}]}]}]}]},{path:"**",component:U.PageNotFoundComponent,resolve:[pe.p],data:f.G.pageNotFound.metaData}]}]}}]);

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.