1"use strict";(self.webpackChunkrestaurant_online_order=self.webpackChunkrestaurant_online_order||[]).push([[6861],{36861:(be,S,p)=>{p.r(S),p.d(S,{CustomizeMenuBookModule:()=>ve});var g=p(36895),d=p(90433),v=p(40866),k=p(61989),I=p(77604),w=p(21493),M=p(25047),D=p(51740),y=p(62726),C=p(59114),e=p(94650),_=p(62710),T=p(10805);function V(o,r){1&o&&(e.\u0275\u0275elementStart(0,"h3",4),e.\u0275\u0275text(1,"Choose Your Menu Book Style"),e.\u0275\u0275elementEnd())}function j(o,r){1&o&&e.\u0275\u0275element(0,"i",13)}function z(o,r){1&o&&e.\u0275\u0275element(0,"i",13)}const E=function(o){return{"surface-200":o}};function A(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",5)(1,"div",6)(2,"div",7),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.selectDesignType(i.EMenuBookDesign.DEFAULT))}),e.\u0275\u0275elementStart(3,"div")(4,"div",8),e.\u0275\u0275text(5,"Default Design"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",9),e.\u0275\u0275text(7,"Show default design"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(8,j,1,0,"i",10),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"div",6)(10,"div",7),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.selectDesignType(i.EMenuBookDesign.ONE))}),e.\u0275\u0275elementStart(11,"div")(12,"div",11),e.\u0275\u0275text(13,"Design One"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",9),e.\u0275\u0275text(15,"Show design one "),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(16,z,1,0,"i",12),e.\u0275\u0275elementEnd()()()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(4,E,t.designType===t.EMenuBookDesign.DEFAULT)),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",t.designType===t.EMenuBookDesign.DEFAULT),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(6,E,t.designType===t.EMenuBookDesign.ONE)),e.\u0275\u0275advance(6),e.\u0275\u0275property("ngIf",t.designType===t.EMenuBookDesign.ONE)}}function L(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",14)(1,"button",15),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.closeModal())}),e.\u0275\u0275text(2,"Apply Design"),e.\u0275\u0275elementEnd()()}}const R=function(){return{width:"40vw"}};let b=(()=>{class o{constructor(t){this._utilityService=t,this.EMenuBookDesign=C.x,this.visible=!1,this.dialogClose=new e.EventEmitter,this.designType=C.x.DEFAULT}ngOnInit(){}selectDesignType(t){this.designType=t}closeModal(){this.dialogClose.emit(this.designType)}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275directiveInject(_.tI))},o.\u0275cmp=e.\u0275\u0275defineComponent({type:o,selectors:[["app-custom-menu-book-design-config-dialog"]],inputs:{visible:"visible",designType:"designType"},outputs:{dialogClose:"dialogClose"},decls:4,vars:9,consts:[["appendTo","body",3,"visible","modal","closable","baseZIndex","styleClass","position","visibleChange"],["pTemplate","header"],["pTemplate","content"],["pTemplate","footer"],[1,"text-5xl","md:text-4xl"],[1,"grid"],[1,"col-6"],[1,"p-3","flex","align-items-center","justify-content-between","border-round","border-1","surface-border","cursor-pointer","hover:surface-hover",3,"ngClass","click"],[1,"font-semibold","text-900","mb-1","text-2xl"],[1,"text-xl","text-700"],["class","jp-check_circle text-5xl text-green-500 align-self-center",4,"ngIf"],[1,"font-semibold","text-900","text-2xl","mb-1"],["class","jp-check_circle text-5xl text-green-500 align-self-center",4,"ngIf"],[1,"jp-check_circle","text-5xl","text-green-500","align-self-center"],[1,"flex","justify-content-between","w-12"],[1,"btn-res-primary","w-12",3,"click"]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"p-dialog",0),e.\u0275\u0275listener("visibleChange",function(s){return n.visible=s}),e.\u0275\u0275template(1,V,2,0,"ng-template",1),e.\u0275\u0275template(2,A,17,8,"ng-template",2),e.\u0275\u0275template(3,L,3,0,"ng-template",3),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275styleMap(e.\u0275\u0275pureFunction0(8,R)),e.\u0275\u0275property("visible",n.visible)("modal",!0)("closable",!1)("baseZIndex",1e4)("styleClass",n._utilityService.isSmallScreen?"dialog-full-width":"")("position",n._utilityService.isSmallScreen?"bottom":"center"))},dependencies:[g.mk,g.O5,w.V,T.jx]}),o})();function W(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"app-custom-menu-book-design-config-dialog",2),e.\u0275\u0275listener("dialogClose",function(i){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(s.hideConfigOptionDialog(i))}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("visible",t.showConfigDialog)}}let N=(()=>{class o{constructor(t){this._router=t,this.showConfigDialog=!1}ngOnInit(){this.showConfigDialog=!0}hideConfigOptionDialog(t){this.showConfigDialog=!1,t&&(t===C.x.DEFAULT&&this._router.navigate(["/custom-menu-book/default"]),t===C.x.ONE&&this._router.navigate(["/custom-menu-book/one"]))}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275directiveInject(y.F0))},o.\u0275cmp=e.\u0275\u0275defineComponent({type:o,selectors:[["app-custom-menu-book-design-config"]],decls:2,vars:1,consts:[[1,"restaurant-menu-page","flex","flex-nowrap","md:flex-wrap","overflow-x-auto","md:overflow-x-hidden","m-auto"],[4,"ngIf"],[3,"visible","dialogClose"]],template:function(t,n){1&t&&(e.\u0275\u0275element(0,"div",0),e.\u0275\u0275template(1,W,2,1,"ng-container",1)),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.showConfigDialog))},dependencies:[g.O5,b],styles:["[_nghost-%COMP%]{--paperWidth: 216mm;--paperHeight: 279.4mm;--defaultPaperMargin: 6.35mm}.restaurant-menu-page[_ngcontent-%COMP%]{max-width:var(--paperWidth);width:var(--paperWidth)}"]}),o})();var h=p(15861),O=p(6302);function $(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",26)(1,"h3",27),e.\u0275\u0275text(2,"Menu Book Configuration"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"i",28),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.close(!1))}),e.\u0275\u0275elementEnd()()}}function G(o,r){1&o&&(e.\u0275\u0275elementStart(0,"p",30),e.\u0275\u0275text(1,"Title is required"),e.\u0275\u0275elementEnd())}function H(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275template(1,G,2,0,"p",29),e.\u0275\u0275elementEnd()),2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.menuConfigForm.controls.title||null==t.menuConfigForm.controls.title.errors?null:t.menuConfigForm.controls.title.errors.required)}}function U(o,r){1&o&&(e.\u0275\u0275elementStart(0,"p",30),e.\u0275\u0275text(1,"Width is required."),e.\u0275\u0275elementEnd())}function Z(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275template(1,U,2,0,"p",29),e.\u0275\u0275elementEnd()),2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.menuConfigForm.controls.width||null==t.menuConfigForm.controls.width.errors?null:t.menuConfigForm.controls.width.errors.required)}}function q(o,r){1&o&&(e.\u0275\u0275elementStart(0,"p",30),e.\u0275\u0275text(1,"Height is required. "),e.\u0275\u0275elementEnd())}function J(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275template(1,q,2,0,"p",29),e.\u0275\u0275elementEnd()),2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",null==t.menuConfigForm.controls.height||null==t.menuConfigForm.controls.height.errors?null:t.menuConfigForm.controls.height.errors.required)}}function K(o,r){1&o&&e.\u0275\u0275element(0,"i",39)}function X(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",31)(1,"div",32),e.\u0275\u0275listener("click",function(){const s=e.\u0275\u0275restoreView(t).$implicit;return e.\u0275\u0275resetView(s.selected=!s.selected)}),e.\u0275\u0275elementStart(2,"div",33)(3,"div",34),e.\u0275\u0275element(4,"img",35),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",36)(6,"h5",37),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275template(8,K,1,0,"i",38),e.\u0275\u0275elementEnd()()}if(2&o){const t=r.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngClass",t.selected?"border-green-500":"border-300"),e.\u0275\u0275advance(3),e.\u0275\u0275propertyInterpolate("alt",t.minorCategory),e.\u0275\u0275property("src",t.imageUrl,e.\u0275\u0275sanitizeUrl),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(t.minorCategory),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.selected)}}function Y(o,r){1&o&&e.\u0275\u0275element(0,"data-not-available",40),2&o&&e.\u0275\u0275property("title","No Results Found")}function Q(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",41)(1,"button",42),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(i.close(!1))}),e.\u0275\u0275text(2,"Cancel"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"button",43),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.configHandler())}),e.\u0275\u0275text(4,"Confirm"),e.\u0275\u0275elementEnd()()}}let B=(()=>{class o extends v.mlD{constructor(t,n,i){super(t),this._fb=n,this._alertService=i,this.submitted=!1,this.isAllCategoryChecked=!1,this.allCategories=[],this.selectedCategories=[]}ngOnInit(){this.data=this.config.data,this.allCategories=[...this.data.originalCategories],this.selectedCategories=[...this.data.selectedCategories],this.buildForm(),this.checkForCheckedCategories(),this.allCategories=this.allCategories.sort((t,n)=>t.displaySequence-n.displaySequence),this.allCategories.sort((t,n)=>t.selected&&!n.selected?-1:!t.selected&&n.selected?1:0)}checkForCheckedCategories(){let t=this.selectedCategories.map(n=>n.posminorCateogryID);this.allCategories.forEach(n=>{n.selected=t.includes(n.posminorCateogryID)}),this.allCategories.length===this.selectedCategories.length&&(this.isAllCategoryChecked=!0)}buildForm(){this.menuConfigForm=this._fb.group({title:["",d.kI.required],width:["",d.kI.required],height:["",d.kI.required]}),this.menuConfigForm.patchValue({title:this.data.title,width:this.data.width,height:this.data.height})}configHandler(){try{if(this.submitted=!0,this.menuConfigForm.markAllAsTouched(),this.menuConfigForm.invalid)return void this._alertService.showAlert("Please Fill in All Required Fields","Oops! It seems you missed a few required fields. Please complete all the necessary information and try again.",O.K.DANGER);let t=this.allCategories.filter(n=>n.selected);if(0===t.length)return void this._alertService.showAlert("Category Selection Required","Please choose at least one category to feature on the flyer before proceeding.",O.K.DANGER);this.selectedCategories=[...t],this.close(!0)}catch{}}onChangeCategoryCheck(t){this.isAllCategoryChecked=t,this.allCategories.forEach(n=>{n.selected=this.isAllCategoryChecked})}close(t){this.ref.close(t?{title:this.menuConfigForm.value.title,originalCategories:this.allCategories,selectedCategories:this.selectedCategories,width:this.menuConfigForm.value.width,height:this.menuConfigForm.value.height}:null)}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275directiveInject(e.Injector),e.\u0275\u0275directiveInject(d.qu),e.\u0275\u0275directiveInject(_.M_))},o.\u0275cmp=e.\u0275\u0275defineComponent({type:o,selectors:[["app-menu-book-config"]],features:[e.\u0275\u0275InheritDefinitionFeature],decls:39,vars:17,consts:[["header",""],[1,"p-3","scrollable"],[3,"formGroup"],[1,"field","mb-3"],["pInputText","","placeholder","Enter Menu Title","type","text","name","title","required","","formControlName","title"],[4,"ngIf"],[1,"flex","align-items-center","gap-3","mb-3"],[1,"field","mb-0","w-12"],["placeholder","Enter menu book width","formControlName","width","mode","decimal","suffix"," inch",1,"w-12",3,"minFractionDigits","maxFractionDigits"],["placeholder","Enter menu book height","suffix"," inch","formControlName","height","mode","decimal",1,"w-12",3,"minFractionDigits","maxFractionDigits"],[1,"surface-100","border-round-md","p-3"],[1,"text-2xl"],[1,"categories","mt-3"],[1,"grid","mb-4","justify-content-between","align-items-center"],[1,"col-12","md:col-6"],[1,"p-input-icon-left","w-12","surface-0"],["type","search","pInputText","","placeholder","Search category...",3,"input"],[1,"col-12","md:col-3"],[1,"field-checkbox","justify-content-end","mb-0"],[3,"binary","ngModel","ngModelChange","onChange"],[1,"ml-3","text-2xl"],["filterBy","minorCategory",3,"value"],["dv",""],["pTemplate","listItem"],["pTemplate","empty"],["footer",""],[1,"flex","align-items-center","justify-content-between","w-full","p-3"],[1,"text-900","text-5xl","md:text-4xl","font-semibold","flex-1","mb-1"],[1,"pi","pi-times","text-5xl","md:text-4xl","text-900","cursor-pointer",3,"click"],["class","error-msg",4,"ngIf"],[1,"error-msg"],[1,"col-12","md:col-6","p-2"],[1,"category","surface-0","cursor-pointer","border-1","border-round-xl","flex","align-items-center","justify-content-between","gap-2","overflow-hidden",3,"ngClass","click"],[1,"flex","align-items-center","gap-2"],[1,"image-wrapper"],[3,"src","alt"],[1,"detail","p-2"],[1,"text-2xl","font-semibold"],["class","jp-check_circle text-4xl text-green-500 p-2 align-self-center",4,"ngIf"],[1,"jp-check_circle","text-4xl","text-green-500","p-2","align-self-center"],["imageUrl","https://s3.us-east-2.amazonaws.com/cloudimagehost/data-not-available.png","description","We couldn't find any categories matching the given name. Please try searching using a different keyword or change your location to find what you're looking for.",1,"h-full","block",3,"title"],[1,"flex","justify-content-between","w-12","gap-3","p-3"],[1,"btn-res-grey","w-12",3,"click"],[1,"btn-res-primary","w-12",3,"click"]],template:function(t,n){if(1&t){const i=e.\u0275\u0275getCurrentView();e.\u0275\u0275template(0,$,4,0,"ng-template",null,0,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementStart(2,"div",1)(3,"form",2)(4,"div",3)(5,"label"),e.\u0275\u0275text(6,"Menu Title"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(7,"input",4),e.\u0275\u0275template(8,H,2,1,"span",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"div",6)(10,"div",7)(11,"label"),e.\u0275\u0275text(12,"Wi
1dth"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(13,"p-inputNumber",8),e.\u0275\u0275template(14,Z,2,1,"span",5),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(15,"div",7)(16,"label"),e.\u0275\u0275text(17,"Height"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(18,"p-inputNumber",9),e.\u0275\u0275template(19,J,2,1,"span",5),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(20,"div",10)(21,"label",11),e.\u0275\u0275text(22,"Choose Categories to Display Items"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"div",12)(24,"div",13)(25,"div",14)(26,"span",15)(27,"input",16),e.\u0275\u0275listener("input",function(l){e.\u0275\u0275restoreView(i);const a=e.\u0275\u0275reference(34);return e.\u0275\u0275resetView(a.filter(l.target.value))}),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(28,"div",17)(29,"div",18)(30,"p-checkbox",19),e.\u0275\u0275listener("ngModelChange",function(l){return n.isAllCategoryChecked=l})("onChange",function(l){return n.onChangeCategoryCheck(l.checked)}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(31,"label",20),e.\u0275\u0275text(32,"Select All"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(33,"p-dataView",21,22),e.\u0275\u0275template(35,X,9,5,"ng-template",23),e.\u0275\u0275template(36,Y,1,1,"ng-template",24),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275template(37,Q,5,0,"ng-template",null,25,e.\u0275\u0275templateRefExtractor)}2&t&&(e.\u0275\u0275advance(3),e.\u0275\u0275property("formGroup",n.menuConfigForm),e.\u0275\u0275advance(4),e.\u0275\u0275classProp("input-error",n.menuConfigForm.controls.title.invalid&&n.menuConfigForm.controls.title.touched||n.submitted&&n.menuConfigForm.controls.title.invalid),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.menuConfigForm.controls.title.invalid&&n.menuConfigForm.controls.title.touched||n.submitted&&n.menuConfigForm.controls.title.invalid),e.\u0275\u0275advance(5),e.\u0275\u0275classProp("input-error",n.menuConfigForm.controls.width.invalid&&n.menuConfigForm.controls.width.touched||n.submitted&&n.menuConfigForm.controls.width.invalid),e.\u0275\u0275property("minFractionDigits",2)("maxFractionDigits",2),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.menuConfigForm.controls.width.invalid&&n.menuConfigForm.controls.width.touched||n.submitted&&n.menuConfigForm.controls.width.invalid),e.\u0275\u0275advance(4),e.\u0275\u0275classProp("input-error",n.menuConfigForm.controls.height.invali
1d&&n.menuConfigForm.controls.height.touched||n.submitted&&n.menuConfigForm.controls.height.invalid),e.\u0275\u0275property("minFractionDigits",2)("maxFractionDigits",2),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.menuConfigForm.controls.height.invalid&&n.menuConfigForm.controls.height.touched||n.submitted&&n.menuConfigForm.controls.height.invalid),e.\u0275\u0275advance(11),e.\u0275\u0275property("binary",!0)("ngModel",n.isAllCategoryChecked),e.\u0275\u0275advance(3),e.\u0275\u0275property("value",n.allCategories))},dependencies:[g.mk,g.O5,d._Y,d.Fj,d.JJ,d.JL,d.Q7,d.sg,d.u,T.jx,D.o,M.Rn,k.XZ,d.On,I.VO],styles:[".image-wrapper[_ngcontent-%COMP%]{height:5rem;width:5rem;min-width:5rem}.image-wrapper[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:100%;object-fit:cover}.category[_ngcontent-%COMP%]:hover{background:var(--surface-100)}"]}),o})(),F=(()=>{class o{constructor(t,n,i,s){this._categoriesService=t,this._ordersService=n,this._commonService=i,this._localStorageService=s}getItemsWithCategory(t){var n=this;return(0,h.Z)(function*(){return new Promise(function(){var i=(0,h.Z)(function*(s,l){try{let a=yield n.getAllItems();a=a.sort(function(c,f){return c.posMinorCategoryID-f.posMinorCategoryID});const u=[];let m=0;a.forEach(c=>{const f=t.find(x=>x.posminorCateogryID===c.posMinorCategoryID);if(f){const x=c.price-c.discount>0?c.price-c.discount:0;u.push({...c,category:m===f.posminorCateogryID?"":f.minorCategory,oldPrice:c.discount>0?c.price:0,price:x,description:c.description,categoryOrder:f.displaySequence}),m=f.posminorCateogryID}}),s([...u])}catch{l()}});return function(s,l){return i.apply(this,arguments)}}())})()}getAllItems(){var t=this;return(0,h.Z)(function*(){try{const n={posGuid:t._commonService.posDetails.posGuid,sessionID:t._localStorageService.getLocalStorageItem("sessionId")},i=yield t._ordersService.getAllItems(n);if(202===i.status&&i.body&&i.body.length>0){let s=i.body;return s.forEach(l=>{l.qrCodeUrl=l.threeDImageUrl?l.threeDImageUrl:l.imageUrl}),s}throw new Error}catch{return[]}})()}getCategories(){var t=this;return(0,h.Z)(function*(){return new Promise(function(){var n=(0,h.Z)(function*(i,s){try{let l={posGuid:t._commonService.posDetails.posGuid,sessionID:t._localStorageService.getLocalStorageItem("sessionId")},a=yield t._ordersService.getMinorCategoryPromise(l);if(202===a.status&&a.body&&a.body.length>0){let u=a.body;return u.forEach(m=>{m.selected=!1}),i(u)}throw new Error}catch{return i([])}});return function(i,s){return n.apply(this,arguments)}}())})()}getItemsWithGroupCategory(t){var n=this;return(0,h.Z)(function*(){return new Promise(function(){var i=(0,h.Z)(function*(s,l){try{let a=yield n.getAllItems();a=a.sort((m,c)=>m.posMinorCategoryID-c.posMinorCategoryID);const u=new Map;for(const m of a){const c=t.find(we=>we.posminorCateogryID===m.posMinorCategoryID);if(!c)continue;const f=m.price-m.discount>0?m.price-m.discount:0,x={...m,oldPrice:m.discount>0?m.price:0,price:f,description:m.description,category:c.minorCategory,categoryOrder:c.displaySequence};u.has(c.posminorCateogryID)||u.set(c.posminorCateogryID,{category:c.minorCategory,categoryOrder:c.displaySequence,posMinorCategoryID:c.posminorCateogryID,items:[]}),u.get(c.posminorCateogryID).items.push(x)}s(Array.from(u.values()).sort((m,c)=>m.categoryOrder-c.categoryOrder))}catch{l()}});return function(s,l){return i.apply(this,arguments)}}())})()}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275inject(_.GD),e.\u0275\u0275inject(_.Nz),e.\u0275\u0275inject(_.v_),e.\u0275\u0275inject(_.n2))},o.\u0275prov=e.\u0275\u0275defineInjectable({token:o,factory:o.\u0275fac,providedIn:"root"}),o})();var P=p(33159);function ee(o,r){1&o&&(e.\u0275\u0275elementStart(0,"div",5)(1,"h3",6),e.\u0275\u0275text(2," Mobile Device Not Supported "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",7),e.\u0275\u0275element(4,"img",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"p",9),e.\u0275\u0275text(6," For a better viewing experience and hassle-free printing, we recommend opening the menu on a "),e.\u0275\u0275elementStart(7,"b",10),e.\u0275\u0275text(8," desktop or laptop "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(9," using "),e.\u0275\u0275elementStart(10,"b",10),e.\u0275\u0275text(11," Google Chrome "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(12,". "),e.\u0275\u0275elementEnd()())}function te(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"div",22)(1,"p",23),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd()()),2&o){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",t.category,"")}}function ne(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"div",35),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"currency"),e.\u0275\u0275elementEnd()),2&o){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind3(2,1,t.oldPrice,n._commonService.currency,n._commonService.currencySymbol)," ")}}function oe(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"div",24)(1,"div",25)(2,"div",26),e.\u0275\u0275element(3,"img",27),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",28)(5,"div",29)(6,"div",30),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",31),e.\u0275\u0275text(9),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"div",32),e.\u0275\u0275template(11,ne,3,5,"div",33),e.\u0275\u0275elementStart(12,"div",34),e.\u0275\u0275text(13),e.\u0275\u0275pipe(14,"currency"),e.\u0275\u0275elementEnd()()()()()()),2&o){const t=r.$implicit,n=e.\u0275\u0275nextContext(3);e.\u0275\u0275attribute("id","item-"+t.posMinorCategoryID+"-"+t.posItemID),e.\u0275\u0275advance(3),e.\u0275\u0275property("src",t.thumbnail?t.thumbnail:t.imageUrl,e.\u0275\u0275sanitizeUrl)("alt",t.item),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(t.item),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.description),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.oldPrice>0),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind3(14,7,t.price,n._commonService.currency,n._commonService.currencySymbol)," ")}}function ie(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"li",18),e.\u0275\u0275template(1,te,3,1,"div",19),e.\u0275\u0275elementStart(2,"div",20),e.\u0275\u0275template(3,oe,15,11,"div",21),e.\u0275\u0275elementEnd()()),2&o){const t=r.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.category),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t)}}const re=function(o,r){return{width:o,height:r}};function se(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"div",11)(1,"ul",12)(2,"li")(3,"div",13),e.\u0275\u0275element(4,"img",14),e.\u0275\u0275elementStart(5,"div",15)(6,"p",16),e.\u0275\u0275text(7),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275template(8,ie,4,2,"li",17),e.\u0275\u0275elementEnd()()),2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngStyle",t.pageStyle)("ngClass",t._commonService.showLoader?"opacity-0":"opacity-1"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction2(5,re,96*t.config.width/t.noOfColsInRow+"px",96*t.config.height+"px")),e.\u0275\u0275advance(6),e.\u0275\u0275textInterpolate1(" ",t.config.title,""),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.itemsWithCategoryGrouped)}}function le(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",36)(1,"button",37),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(i.showConfigDialog=!0)}),e.\u0275\u0275element(2,"i",38),e.\u0275\u0275text(3," Design Config "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",37),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.openConfigOptionDialog())}),e.\u0275\u0275element(5,"i",39),e.\u0275\u0275text(6," Edit Configuration "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"button",40),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.printFlyer())}),e.\u0275\u0275element(8,"i",41),e.\u0275\u0275text(9," Print Menu Book "),e.\u0275\u0275elementEnd()()}}function ae(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"open-in-chrome-alert",42),e.\u0275\u0275listener("dialogClose",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.openInChromeDialog=!1)}),e.\u0275\u0275elementEnd()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("feature","flyer")("visible",t.openInChromeDialog)}}function ce(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"app-custom-menu-book-design-config-dialog",43),e.\u0275\u0275listener("dialogClose",function(i){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(s.hideConfigOptionDialog(i))}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("visible",t.showConfigDialog)("designType",t.menuDesignType)}}let me=(()=>{class o{constructor(t,n,i,s,l,a){this._commonService=t,this._customizeMenuBookService=n,this._dialogService=i,this._renderer=s,this._router=l,this._utilityService=a,this.categories=[],this.showLoader=!1,this.showConfigDialog=!1,this.menuDesignType=C.x.ONE,this.openInChromeDialog=!1,this.configDialog=!1,this.config={title:"",originalCategories:[],selectedCategories:[],width:8.5,height:11},this.pageStyle={width:96*this.config.width+"px",height:96*this.config.height+"px","min-width":96*this.config.width+"px"},this.itemsWithCategory=[],this.itemsWithCategoryGrouped=[],this.noOfColsInRow=1,this._renderer.addClass(document.body,"view-mode")}ngOnInit(){this._utilityService.isSmallScreen||this.init()}init(){var t=this;return(0,h.Z)(function*(){try{t.showLoader=!0,setTimeout(()=>{t._commonService.showLoader=!0}),yield t._commonService.getRestaurantInformation(),t.categories=yield t._customizeMenuBookService.getCategories(),t.openConfigOptionDialog()}catch{}finally{setTimeout(()=>{t._commonService.showLoader=!1})}})()}openConfigOptionDialog(){this._dialogService.show(B,{position:"center",height:"auto",width:"40vw",maxHeight:"80vh",data:{title:this.config.title,originalCategories:this.categories,selectedCategories:this.config.selectedCategories,width:this.config.width,height:this.config.height},headerCenter:!1,dismissableMask:!1,closable:!0,swipe:!1,contentClass:"p-0",headerClass:"p-0",footerClass:"p-0",onClose:t=>{if(t){this.config=t;const n=96*+this.config.width,i=96*+this.config.height;this.pageStyle.width=`${n}px`,this.pageStyle.height=`${i}px`,this.pageStyle["min-width"]=`${n}px`,this.mapCategory()}}})}mapCategory(){var t=this;return(0,h.Z)(function*(){try{t.showLoader=!0,setTimeout(()=>{t._commonService.showLoader=!0}),t.itemsWithCategory=yield t._customizeMenuBookService.getItemsWithCategory(t.config.selectedCategories),t.itemsWithCategory=t.itemsWithCategory.sort((n,i)=>n.categoryOrder-i.categoryOrder),t.groupItems()}catch{}finally{t.showLoader=!1,t._commonService.showLoader=!1,setTimeout(()=>{t.initItems(),t._commonService.isOpenInChrome()||(t.openInChromeDialog=!0)})}})()}initItems(){const t=document.getElementById("restaurant-menu-page"),n=document.getElementById("dummy-items-container"),i=Array.from(n.children),s=this.createCol(t);this.placeItemsFromDummyColToRespectiveCols(i,s,t),n.remove(),this.addColsIfNeededToCompletePaperRow(t),this.removeEmptyCols(Array.from(t.children))}placeItemsFromDummyColToRespectiveCols(t,n,i){let s=n.offsetHeight-(parseInt(window.getComputedStyle(n).getPropertyValue("padding-top"))||0)-(parseInt(window.getComputedStyle(n).getPropertyValue("padding-bottom"))||0);if(!s)return;let l=0;for(const[a,u]of Array.from(t).entries()){const m=u;0===a&&m.setAttribute("style","margin-top:0px !important");let c=m.offsetHeight;if(c+=parseInt(window.getComputedStyle(m).getPropertyValue("margin-top")),!(c<s-l)){const f=this.createCol(i);this.placeItemsFromDummyColToRespectiveCols(t.slice(a),f,i);break}this._renderer.appendChild(n,m),l+=c}}addColsIfNeededToCompletePaperRow(t){const i=this.noOfColsInRow;let s=t.children.length%i;s>0&&(s=i-s);for(let l=0;l<s;l++)this.createCol(t)}removeEmptyCols(t){const n=this.noOfColsInRow;for(let i=0;i<t.length;i+=n){const s=t.slice(i,i+n);if(s.every(a=>!a.children.length))for(const a of s)a&&a.remove()}}createCol(t){const n=this._renderer.createElement("ul");n.classList.add("m-0","p-0","surface-0");const i=96*this.config.width/this.noOfColsInRow,s=96*this.config.height;return this._renderer.setStyle(n,"width",`${i}px`),this._renderer.setStyle(n,"min-width",`${i}px`),this._renderer.setStyle(n,"height",`${s}px`),this._renderer.appendChild(t,n),n}groupItems(){this.itemsWithCategoryGrouped=[];for(let t=0;t<this.itemsWithCategory.length;t+=2)this.itemsWithCategoryGrouped.push(this.itemsWithCategory.slice(t,t+2))}hideConfigOptionDialog(t){this.showConfigDialog=!1,t&&(this.menuDesignType=t,t===C.x.DEFAULT&&this._router.navigate(["/custom-menu-book/default"]),t===C.x.ONE&&this._router.navigate(["/custom-menu-book/one"]))}printFlyer(){window.print()}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275directiveInject(_.v_),e.\u0275\u0275directiveInject(F),e.\u0275\u0275directiveInject(v.W3v),e.\u0275\u0275directiveInject(e.Renderer2),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(_.tI))},o.\u0275cmp=e.\u0275\u0275defineComponent({type:o,selectors:[["app-custom-menu-book-one"]],decls:6,vars:5,consts:[["class","open-in-desktop p-6 viewport-height flex flex-column align-items-center justify-content-center",4,"ngIf"],["class","restaurant-menu-page surface-0 m-auto","id","restaurant-menu-page",3,"ngStyle","ngClass",4,"ngIf"],["class","float-button fixed flex align-items-center gap-3",4,"ngIf"],[3,"feature","visible","dialogClose",4,"ngIf"],[4,"ngIf"],[1,"open-in-desktop","p-6","viewport-height","flex","flex-column","align-items-center","justify-content-center"],[1,"text-5xl","font-bold","text-center","text-900","mb-6"],[1,"image-wrapper","text-center","w-20rem"],["src","assets/images/phone-not-supported.png","alt","Phone Not Supported",1,"h-100","w-12","object-fit-cover"],[1,"text-3xl","text-700","text-center","mb-0","mt-6"],[1,"font-semibold","text-900"],["id","restaurant-menu-page",1,"restaurant-menu-page","surface-0","m-auto",3,"ngStyle","ngClass"],["
1id","dummy-items-container",1,"p-0","m-0","page-col-dummy","fixed","opacity-0",3,"ngStyle"],[1,"category-wrap","relative","mb-3"],["src","https://s3.us-east-2.amazonaws.com/cloudimagehost/custom-menu-ribbon.png","alt","",1,""],[1,"absolute","cat","flex","align-items-center","gap-3"],[1,"text-white","text-5xl","text-center","font-bold","uppercase"],["class","mt-4",4,"ngFor","ngForOf"],[1,"mt-4"],["class","mini-category-wrap relative border-1 border-primary-500 border-round-md p-2 mb-3 w-max gap-3",4,"ngIf"],[1,"grid"],["class","col-6 p-3",4,"ngFor","ngForOf"],[1,"mini-category-wrap","relative","border-1","border-primary-500","border-round-md","p-2","mb-3","w-max","gap-3"],[1,"uppercase","text-4xl","text-left","font-semibold","flex-1"],[1,"col-6","p-3"],[1,"flex","align-items-start","flex-column","gap-3"],[1,"item-image","overflow-hidden","border-3","border-white"],[1,"w-full","h-full","object-fit-cover",3,"src","alt"],[1,"w-full"],[1,"flex","flex-column","align-items-start","gap-2"],[1,"text-3xl","font-bold","uppercase"],[1,"text-xl","ellipsis-1"],[1,"flex","align-items-center"],["class","text-3xl font-semibold mr-1 line-through text-red-600",4,"ngIf"],[1,"text-3xl","font-semibold"],[1,"text-3xl","font-semibold","mr-1","line-through","text-red-600"],[1,"float-button","fixed","flex","align-items-center","gap-3"],[1,"btn","btn-res-grey",3,"click"],[1,"pi","pi-cog","text-3xl","mr-2"],[1,"pi","pi-refresh","text-3xl","mr-2"],[1,"btn","btn-res-primary",3,"click"],[1,"pi","pi-print","text-3xl","mr-2"],[3,"feature","visible","dialogClose"],[3,"visible","designType","dialogClose"]],template:function(t,n){1&t&&(e.\u0275\u0275template(0,ee,13,0,"div",0),e.\u0275\u0275template(1,se,9,8,"div",1),e.\u0275\u0275template(2,le,10,0,"div",2),e.\u0275\u0275element(3,"p-dialog"),e.\u0275\u0275template(4,ae,1,2,"open-in-chrome-alert",3),e.\u0275\u0275template(5,ce,2,2,"ng-container",4)),2&t&&(e.\u0275\u0275property("ngIf",n._utilityService.isSmallScreen),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.showLoader&&!n._utilityService.isSmallScreen),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.showLoader&&!n._utilityService.isSmallScreen),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.openInChromeDialog),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.showConfigDialog))},dependencies:[g.mk,g.sg,g.O5,g.PC,w.V,P.F,b,g.H9],styles:['@import"https://fonts.googleapis.com/css2?family=Special+Gothic+Condensed+One&display=swap";[_nghost-%COMP%]{--defaultPaperMargin: 6.35mm;--paperHeight: 279.4mm}.float-button[_ngcontent-%COMP%]{z-index:99!important}.title[_ngcontent-%COMP%]{font-size:11rem;font-family:Special Gothic Condensed One,sans-serif;font-weight:400;font-style:normal}.item-image[_ngcontent-%COMP%]{width:100%;height:20rem;min-width:100%;background:white;border-radius:10px}.category-wrap[_ngcontent-%COMP%]{height:60px;display:flex;align-items:center;justify-content:center}.category-wrap[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:100%}ul[_ngcontent-%COMP%]{padding:var(--defaultPaperMargin)!important;background-image:url(https://s3.us-east-2.amazonaws.com/cloudimagehost/custom-menu-border-5.jpg);background-repeat:no-repeat;background-size:cover;background-position:bottom}li[_ngcontent-%COMP%]{display:block;list-style-type:none}.restaurant-menu-page[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;font-size:0;margin:auto}@media print{.restaurant-menu-page[_ngcontent-%COMP%]{flex-wrap:wrap!important}body[_ngcontent-%COMP%]{print-color-adjust:exact!important}@page{size:portrait;margin:var(--defaultPaperMargin)}}']}),o})();function pe(o,r){1&o&&(e.\u0275\u0275elementStart(0,"div",5)(1,"h3",6),e.\u0275\u0275text(2," Mobile Device Not Supported "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",7),e.\u0275\u0275element(4,"img",8),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"p",9),e.\u0275\u0275text(6," For a better viewing experience and hassle-free printing, we recommend opening the menu on a "),e.\u0275\u0275elementStart(7,"b",10),e.\u0275\u0275text(8," desktop or laptop "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(9," using "),e.\u0275\u0275elementStart(10,"b",10),e.\u0275\u0275text(11," Google Chrome "),e.\u0275\u0275elementEnd(),e.\u0275\u0275text(12,". "),e.\u0275\u0275elementEnd()())}function ge(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"div",22)(1,"div",23)(2,"div",24),e.\u0275\u0275element(3,"img",25),e.\u0275\u0275elementStart(4,"div",26),e.\u0275\u0275element(5,"img",27),e.\u0275\u0275elementStart(6,"div",28),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"currency"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(9,"div",29),e.\u0275\u0275text(10),e.\u0275\u0275elementEnd()()()),2&o){const t=r.$implicit,n=e.\u0275\u0275nextContext(3);e.\u0275\u0275attribute("id","item-"+t.posMinorCategoryID+"-"+t.posItemID),e.\u0275\u0275advance(3),e.\u0275\u0275property("src",t.thumbnail?t.thumbnail:t.imageUrl,e.\u0275\u0275sanitizeUrl)("alt",t.item),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind3(8,5,t.price,n._commonService.currency,n._commonService.currencySymbol)," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1("",t.item," ")}}function de(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"li",19)(1,"div",20),e.\u0275\u0275template(2,ge,11,9,"div",21),e.\u0275\u0275elementEnd()()),2&o){const t=r.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t)}}const ue=function(o,r){return{width:o,height:r}};function fe(o,r){if(1&o&&(e.\u0275\u0275elementStart(0,"div",11)(1,"ul",12),e.\u0275\u0275element(2,"div",13),e.\u0275\u0275elementStart(3,"li")(4,"div",14),e.\u0275\u0275element(5,"img",15),e.\u0275\u0275elementStart(6,"div",16)(7,"p",17),e.\u0275\u0275text(8),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275template(9,de,3,1,"li",18),e.\u0275\u0275elementEnd()()),2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("ngStyle",t.pageStyle)("ngClass",t._commonService.showLoader?"opacity-0":"opacity-1"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction2(5,ue,96*t.config.width/t.noOfColsInRow+"px",96*t.config.height+"px")),e.\u0275\u0275advance(7),e.\u0275\u0275textInterpolate1(" ",t.config.title,""),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.itemsWithCategoryGrouped)}}function he(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",30)(1,"button",31),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(i.showConfigDialog=!0)}),e.\u0275\u0275element(2,"i",32),e.\u0275\u0275text(3," Design Config "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"button",31),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.openConfigOptionDialog())}),e.\u0275\u0275element(5,"i",33),e.\u0275\u0275text(6," Edit Configuration "),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"button",34),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.printFlyer())}),e.\u0275\u0275element(8,"i",35),e.\u0275\u0275text(9," Print Menu Book "),e.\u0275\u0275elementEnd()()}}function Ce(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"open-in-chrome-alert",36),e.\u0275\u0275listener("dialogClose",function(){e.\u0275\u0275restoreView(t);const i=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(i.openInChromeDialog=!1)}),e.\u0275\u0275elementEnd()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("feature","flyer")("visible",t.openInChromeDialog)}}function _e(o,r){if(1&o){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"app-custom-menu-book-design-config-dialog",37),e.\u0275\u0275listener("dialogClose",function(i){e.\u0275\u0275restoreView(t);const s=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(s.hideConfigOptionDialog(i))}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()}if(2&o){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("visible",t.showConfigDialog)("designType",t.menuDesignType)}}const ye=[{path:"",component:N},{path:"default",component:(()=>{class o{constructor(t,n,i,s,l,a){this._commonService=t,this._customizeMenuBookService=n,this._dialogService=i,this._renderer=s,this._router=l,this._utilityService=a,this.categories=[],this.showLoader=!1,this.openInChromeDialog=!1,this.showConfigDialog=!1,this.menuDesignType=C.x.DEFAULT,this.configDialog=!1,this.config={title:"",originalCategories:[],selectedCategories:[],width:8.5,height:11},this.pageStyle={width:96*this.config.width+"px",height:96*this.config.height+"px","min-width":96*this.config.width+"px"},this.itemsWithCategory=[],this.itemsWithCategoryGrouped=[],this.noOfColsInRow=1,this._renderer.addClass(document.body,"view-mode")}ngOnInit(){this._utilityService.isSmallScreen||this.init()}init(){var t=this;return(0,h.Z)(function*(){try{t.showLoader=!0,setTimeout(()=>{t._commonService.showLoader=!0}),yield t._commonService.getRestaurantInformation(),t.categories=yield t._customizeMenuBookService.getCategories(),t.openConfigOptionDialog()}catch{}finally{setTimeout(()=>{t._commonService.showLoader=!1})}})()}openConfigOptionDialog(){this._dialogService.show(B,{position:"center",height:"auto",width:"40vw",maxHeight:"80vh",data:{title:this.config.title,originalCategories:this.categories,selectedCategories:this.config.selectedCategories,width:this.config.width,height:this.config.height},headerCenter:!1,dismissableMask:!1,closable:!0,swipe:!1,contentClass:"p-0",headerClass:"p-0",footerClass:"p-0",onClose:t=>{if(t){this.config=t;const n=96*+this.config.width,i=96*+this.config.height;this.pageStyle.width=`${n}px`,this.pageStyle.height=`${i}px`,this.pageStyle["min-width"]=`${n}px`,this.mapCategory()}}})}mapCategory(){var t=this;return(0,h.Z)(function*(){try{t.showLoader=!0,setTimeout(()=>{t._commonService.showLoader=!0}),t.itemsWithCategory=yield t._customizeMenuBookService.getItemsWithCategory(t.config.selectedCategories),t.itemsWithCategory=t.itemsWithCategory.sort((n,i)=>n.categoryOrder-i.categoryOrder),t.groupItems()}catch{}finally{t.showLoader=!1,t._commonService.showLoader=!1,setTimeout(()=>{t.initItems(),t._commonService.isOpenInChrome()||(t.openInChromeDialog=!0)})}})()}initItems(){const t=document.getElementById("restaurant-menu-page"),n=document.getElementById("dummy-items-container"),i=Array.from(n.children),s=this.createCol(t);this.placeItemsFromDummyColToRespectiveCols(i,s,t),n.remove(),this.addColsIfNeededToCompletePaperRow(t),this.removeEmptyCols(Array.from(t.children))}placeItemsFromDummyColToRespectiveCols(t,n,i){let s=n.offsetHeight-(parseInt(window.getComputedStyle(n).getPropertyValue("padding-top"))||0)-(parseInt(window.getComputedStyle(n).getPropertyValue("padding-bottom"))||0);if(!s)return;let l=0;for(const[a,u]of Array.from(t).entries()){const m=u;0===a&&m.setAttribute("style","margin-top:0px !important");let c=m.offsetHeight;if(c+=parseInt(window.getComputedStyle(m).getPropertyValue("margin-top")),!(c<s-l)){const f=this.createCol(i);this.placeItemsFromDummyColToRespectiveCols(t.slice(a),f,i);break}this._renderer.appendChild(n,m),l+=c}}addColsIfNeededToCompletePaperRow(t){const i=this.noOfColsInRow;let s=t.children.length%i;s>0&&(s=i-s);for(let l=0;l<s;l++)this.createCol(t)}removeEmptyCols(t){const n=this.noOfColsInRow;for(let i=0;i<t.length;i+=n){const s=t.slice(i,i+n);if(s.every(a=>!a.children.length))for(const a of s)a&&a.remove()}}createCol(t){const n=this._renderer.createElement("ul");n.classList.add("m-0","p-0","surface-0");const i=96*this.config.width/this.noOfColsInRow,s=96*this.config.height;return this._renderer.setStyle(n,"width",`${i}px`),this._renderer.setStyle(n,"min-width",`${i}px`),this._renderer.setStyle(n,"height",`${s}px`),this._renderer.appendChild(t,n),n}groupItems(){this.itemsWithCategoryGrouped=[];for(let t=0;t<this.itemsWithCategory.length;t+=3)this.itemsWithCategoryGrouped.push(this.itemsWithCategory.slice(t,t+3))}hideConfigOptionDialog(t){this.showConfigDialog=!1,t&&(this.menuDesignType=t,t===C.x.DEFAULT&&this._router.navigate(["/custom-menu-book/default"]),t===C.x.ONE&&this._router.navigate(["/custom-menu-book/one"]))}printFlyer(){window.print()}}return o.\u0275fac=function(t){return new(t||o)(e.\u0275\u0275directiveInject(_.v_),e.\u0275\u0275directiveInject(F),e.\u0275\u0275directiveInject(v.W3v),e.\u0275\u0275directiveInject(e.Renderer2),e.\u0275\u0275directiveInject(y.F0),e.\u0275\u0275directiveInject(_.tI))},o.\u0275cmp=e.\u0275\u0275defineComponent({type:o,selectors:[["app-custom-menu-book-two"]],decls:6,vars:5,consts:[["class","open-in-desktop p-6 viewport-height flex flex-column align-items-center justify-content-center",4,"ngIf"],["class","restaurant-menu-page surface-0 m-auto","id","restaurant-menu-page",3,"ngStyle","ngClass",4,"ngIf"],["class","float-button fixed flex align-items-center gap-3",4,"ngIf"],[3,"feature","visible","dialogClose",4,"ngIf"],[4,"ngIf"],[1,"open-in-desktop","p-6","viewport-height","flex","flex-column","align-items-center","justify-content-center"],[1,"text-5xl","font-bold","text-center","text-900","mb-6"],[1,"image-wrapper","text-center","w-20rem"],["src","assets/images/phone-not-supported.png","alt","Phone Not Supported",1,"h-100","w-12","object-fit-cover"],[1,"text-3xl","text-700","text-center","mb-0","mt-6"],[1,"font-semibold","text-900"],["id","restaurant-menu-page",1,"restaurant-menu-page","surface-0","m-auto",3,"ngStyle","ngClass"],["
1id","dummy-items-container",1,"p-0","m-0","page-col-dummy","fixed","opacity-0",3,"ngStyle"],[1,"overlay","absolute"],[1,"category-wrap","relative","mb-3"],["src","https://s3.us-east-2.amazonaws.com/cloudimagehost/custom-menu-ribbon.png","alt","",1,""],[1,"absolute","cat","flex","align-items-center","gap-3"],[1,"text-white","text-5xl","text-center","font-bold","uppercase"],["class","mt-4",4,"ngFor","ngForOf"],[1,"mt-4"],[1,"grid"],["class","col-4 p-4",4,"ngFor","ngForOf"],[1,"col-4","p-4"],[1,"flex","align-items-center","flex-column","gap-3"],[1,"item-image","relative","border-circle"],[1,"w-full","h-full","object-fit-cover","border-circle",3,"src","alt"],[1,"price","absolute"],["src","https://s3.us-east-2.amazonaws.com/cloudimagehost/price-tag-cus-1.png","alt","",1,"w-12","h-full","object-fit-cover"],[1,"text-xl","price-item","absolute","font-semibold","text-white"],[1,"text-2xl","font-bold","text-white","uppercase","text-center","w-full"],[1,"float-button","fixed","flex","align-items-center","gap-3"],[1,"btn","btn-res-grey",3,"click"],[1,"pi","pi-cog","text-3xl","mr-2"],[1,"pi","pi-refresh","text-3xl","mr-2"],[1,"btn","btn-res-primary",3,"click"],[1,"pi","pi-print","text-3xl","mr-2"],[3,"feature","visible","dialogClose"],[3,"visible","designType","dialogClose"]],template:function(t,n){1&t&&(e.\u0275\u0275template(0,pe,13,0,"div",0),e.\u0275\u0275template(1,fe,10,8,"div",1),e.\u0275\u0275template(2,he,10,0,"div",2),e.\u0275\u0275element(3,"p-dialog"),e.\u0275\u0275template(4,Ce,1,2,"open-in-chrome-alert",3),e.\u0275\u0275template(5,_e,2,2,"ng-container",4)),2&t&&(e.\u0275\u0275property("ngIf",n._utilityService.isSmallScreen),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.showLoader&&!n._utilityService.isSmallScreen),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.showLoader&&!n._utilityService.isSmallScreen),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.openInChromeDialog),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.showConfigDialog))},dependencies:[g.mk,g.sg,g.O5,g.PC,w.V,P.F,b,g.H9],styles:['@import"https://fonts.googleapis.com/css2?family=Special+Gothic+Condensed+One&display=swap";[_nghost-%COMP%]{--defaultPaperMargin: 6.35mm;--paperHeight: 279.4mm}.float-button[_ngcontent-%COMP%]{z-index:99!important}.title[_ngcontent-%COMP%]{font-size:11rem;font-family:Special Gothic Condensed One,sans-serif;font-weight:400;font-style:normal}.item-image[_ngcontent-%COMP%]{width:15rem;height:15rem;min-width:15rem}.category-wrap[_ngcontent-%COMP%]{height:60px;display:flex;align-items:center;justify-content:center}.category-wrap[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:100%}.min-category-wrap[_ngcontent-%COMP%]{height:50px;display:flex;align-items:center;justify-content:center;width:320px}.min-category-wrap[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:100%;width:100%}ul[_ngcontent-%COMP%]{padding:var(--defaultPaperMargin)!important;background-image:url(https://s3.us-east-2.amazonaws.com/cloudimagehost/custom-menu-border-12.jpg);background-repeat:no-repeat;background-size:cover;background-position:center}li[_ngcontent-%COMP%]{display:block;list-style-type:none}.restaurant-menu-page[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;font-size:0;margin:auto}.price[_ngcontent-%COMP%]{bottom:20px;right:-28px;width:65px}.price[_ngcontent-%COMP%] .price-item[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;top:50%;left:50%;transform:translate(-50%,-50%)}@media print{.restaurant-menu-page[_ngcontent-%COMP%]{flex-wrap:wrap!important}body[_ngcontent-%COMP%]{print-color-adjust:exact!important}@page{size:portrait;margin:var(--defaultPaperMargin)}}']}),o})()},{path:"one",component:me}];let xe=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)}
1,o.\u0275mod=e.\u0275\u0275defineNgModule({type:o}),o.\u0275inj=e.\u0275\u0275defineInjector({imports:[y.Bz.forChild(ye),y.Bz]}),o})(),ve=(()=>{class o{}return o.\u0275fac=function(t){return new(t||o)},o.\u0275mod=e.\u0275\u0275defineNgModule({type:o}),o.\u0275inj=e.\u0275\u0275defineInjector({imports:[g.ez,d.UX,xe,w.S,D.j,M.L$,k.nD,d.u5,I.FI,v.Z3E]}),o})()}}]);
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.