(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{mh2t:function(t,e,i){"use strict";i.r(e),i.d(e,"ShopLandingPageModule",function(){return Se});var o=i("sYmb"),a=i("AcyG"),s=i("PCNd"),n=i("2qik"),c=i("0zz2"),l=i("r6SO"),r=i("4mdi"),d=i("ZD0A"),b=i("A7ro"),p=i("gSya"),h=i("KrAf"),u=i("tyNb"),m=i("9NBX"),f=i("mrSG"),g=i("quSY"),v=i("HDdC"),S=i("gg4E"),k=i("DQpe"),T=i("2Njn"),L=i("k6lK"),A=i("St1E"),E=i("rhm1"),I=i("xIUe"),w=i("fXoL"),O=i("3Yxx"),y=i("SJeB"),M=i("2hg7"),C=i("+hSf"),P=i("/z64"),N=i("yydN"),_=i("O0k0"),D=i("pCJ9"),F=i("668k"),U=i("ofXK");const x=function(t){return{selected:t}};function B(t,e){if(1&t){const t=w.Ub();w.Tb(0,"div",15),w.Tb(1,"div",16),w.ac("click",function(){return w.tc(t),w.cc().toggleEditLinks()}),w.Sb(),w.Ob(2,"div",17),w.Tb(3,"div",18),w.Tb(4,"div",13),w.ac("click",function(){return w.tc(t),w.cc().openShopProfileModal()}),w.Bc(5),w.dc(6,"translate"),w.Sb(),w.Tb(7,"div",14),w.ac("click",function(){return w.tc(t),w.cc().openEditShopModal()}),w.Bc(8),w.dc(9,"translate"),w.Sb(),w.Sb(),w.Sb()}if(2&t){const t=w.cc();w.gc("ngClass",w.lc(7,x,t.openEditLinks)),w.Ab(5),w.Dc("",w.ec(6,3,"LANDING_PAGE.profile_picture")," "),w.Ab(3),w.Dc("",w.ec(9,5,"LANDING_PAGE.edit_profile")," ")}}function H(t,e){if(1&t){const t=w.Ub();w.Tb(0,"div",19),w.Tb(1,"div",20),w.ac("click",function(){return w.tc(t),w.cc().openShareShopModal()}),w.Bc(2),w.dc(3,"translate"),w.Sb(),w.Sb()}2&t&&(w.Ab(2),w.Cc(w.ec(3,1,"LANDING_PAGE.share")))}const $=function(t){return{active:t}};let j=(()=>{class t{constructor(t,e,i){this.route=t,this.sessionStorage=e,this.metadataService=i,this.editShopEvent=new w.n,this.editProfileImageEvent=new w.n,this.openShareShopModalEvent=new w.n,this.subscriptions=new g.a,this.openEditLinks=!1}ngOnInit(){this.route.queryParamMap.subscribe(t=>{const e=t.get("sbc");e&&this.sessionStorage.setItem(P.o,e)}),this.setMetaData()}openEditShopModal(){this.openEditLinks=!1,this.editShopEvent.emit(!0)}openShopProfileModal(){this.openEditLinks=!1,this.editProfileImageEvent.emit(!0)}toggleEditLinks(){this.openEditLinks=!this.openEditLinks}setMetaData(){this.subscriptions.add(this.shopInfo$.subscribe(t=>{t&&t.shopName&&this.metadataService.updateMetadata({title:t.shopName,description:t.description.trim(),image:t.profilePicture&&t.profilePicture.downloadUrl?t.profilePicture.downloadUrl:""})}))}openShareShopModal(){this.openShareShopModalEvent.emit(!0)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(u.a),w.Nb(N.a),w.Nb(y.a))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-shop-banner"]],outputs:{editShopEvent:"editShopEvent",editProfileImageEvent:"editProfileImageEvent",openShareShopModalEvent:"openShareShopModalEvent"},decls:25,vars:26,consts:[[1,"shop-mylist-banner","customer"],[1,"amway-container"],[1,"shop-mylist-banner-profile-box"],[1,"shop-mylist-banner-profile"],[3,"src"],["class","shop-mylist-banner-mod-bci-edit",3,"ngClass",4,"appRole"],[1,"shop-mylist-banner-name"],[1,"shop-mylist-banner-detail"],["class","shop-mylist-banner-share-box",4,"appRole"],[3,"visible","cover"],["id","editPop",1,"amway-modal","editPop",3,"ngClass"],[1,"bg-modal",3,"click"],[1,"shop-mylist-banner-mod-edit-menu-content"],[1,"shop-mylist-banner-mod-edit-menu-list","cam",3,"click"],[1,"shop-mylist-banner-mod-edit-menu-list","edit",3,"click"],[1,"shop-mylist-banner-mod-bci-edit",3,"ngClass"],[1,"shop-mylist-banner-mod-bci-edit-btn",3,"click"],[1,"shop-mylist-banner-mod-edit-backdrop"],[1,"shop-mylist-banner-mod-edit-menu"],[1,"shop-mylist-banner-share-box"],[1,"shop-mylist-banner-share",3,"click"]],template:function(t,e){if(1&t&&(w.Tb(0,"div",0),w.Tb(1,"div",1),w.Tb(2,"div",2),w.Tb(3,"div",3),w.Ob(4,"app-image-loader",4),w.dc(5,"async"),w.zc(6,B,10,9,"div",5),w.Sb(),w.Sb(),w.Tb(7,"div",6),w.Bc(8),w.dc(9,"async"),w.Sb(),w.Tb(10,"div",7),w.Bc(11),w.dc(12,"async"),w.Sb(),w.zc(13,H,4,3,"div",8),w.Ob(14,"app-loader",9),w.dc(15,"async"),w.Sb(),w.Sb(),w.Tb(16,"div",10),w.Tb(17,"div",11),w.ac("click",function(){return e.toggleEditLinks()}),w.Sb(),w.Tb(18,"div",12),w.Tb(19,"div",13),w.ac("click",function(){return e.openShopProfileModal()}),w.Bc(20),w.dc(21,"translate"),w.Sb(),w.Tb(22,"div",14),w.ac("click",function(){return e.openEditShopModal()}),w.Bc(23),w.dc(24,"translate"),w.Sb(),w.Sb(),w.Sb()),2&t){let t=null,i=null,o=null;w.Ab(4),w.Db("shop-mylist-banner-profile-img"),w.gc("src",null==(t=w.ec(5,12,e.shopInfo$))||null==t.profilePicture?null:t.profilePicture.downloadUrl),w.Ab(2),w.gc("appRole","shopOwner"),w.Ab(2),w.Dc(" ",null==(i=w.ec(9,14,e.shopInfo$))?null:i.shopName," "),w.Ab(3),w.Cc(null==(o=w.ec(12,16,e.shopInfo$))?null:o.aboutOwner),w.Ab(2),w.gc("appRole","shopOwner"),w.Ab(1),w.gc("visible",w.ec(15,18,e.loading$))("cover",!0),w.Ab(2),w.gc("ngClass",w.lc(24,$,e.openEditLinks)),w.Ab(4),w.Cc(w.ec(21,20,"LANDING_PAGE.profile_picture")),w.Ab(3),w.Dc("",w.ec(24,22,"LANDING_PAGE.edit_profile")," ")}},directives:[_.a,D.a,F.a,U.j],pipes:[U.b,o.c],styles:[""],changeDetection:0}),Object(f.a)([Object(a.c)(r.a.getShopInfo)],t.prototype,"shopInfo$",void 0),Object(f.a)([Object(a.c)(r.a.getLoader)],t.prototype,"loading$",void 0),t})();var R=i("+nbM"),z=i("VOyT"),G=i("Ba6S"),V=i("1ylV"),Q=i("8slg"),K=i("/rjk"),q=i("3jvs"),J=i("bhfF"),X=i("K8J1"),Y=i("Sx+G");function Z(t,e){1&t&&w.Ob(0,"div",14)}function W(t,e){if(1&t){const t=w.Ub();w.Tb(0,"div",15),w.Tb(1,"button",16),w.ac("click",function(){return w.tc(t),w.cc().addProductToCart()}),w.Sb(),w.Sb()}if(2&t){const t=w.cc();w.Ab(1),w.gc("disabled",!(null!=t.item&&t.item.isEligibleForMyList))}}function tt(t,e){if(1&t){const t=w.Ub();w.Tb(0,"div",17),w.Tb(1,"button",18),w.ac("click",function(){return w.tc(t),w.cc().openAddToListModal()}),w.Sb(),w.Tb(2,"button",19),w.ac("click",function(){return w.tc(t),w.cc().openShareInfoModal()}),w.Ob(3,"div",20),w.Tb(4,"div",21),w.Tb(5,"div",22),w.Bc(6),w.dc(7,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Sb()}if(2&t){const t=w.cc();w.Ab(1),w.gc("disabled",!(null!=t.item&&t.item.isEligibleForMyList)),w.Ab(1),w.gc("disabled",!(null!=t.item&&t.item.isEligibleForMyList)),w.Ab(4),w.Dc(" ",w.ec(7,3,"SHOP_FOA_ITEM.easy_to_share")," ")}}let et=(()=>{class t{constructor(t){this.shopInfoService=t,this.item=null,this.openShareInfoModalEvent=new w.n,this.openAddToListModalEvent=new w.n,this.addProductToCartEvent=new w.n,this.shopUid=""}ngOnInit(){this.shopUid=this.shopInfoService.getShopInfoFromSession().shopUid}openShareInfoModal(){this.openShareInfoModalEvent.emit(this.item)}openAddToListModal(){this.openAddToListModalEvent.emit(this.item)}addProductToCart(){this.addProductToCartEvent.emit(this.item)}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(X.a))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-shop-foa-item"]],inputs:{item:"item"},outputs:{openShareInfoModalEvent:"openShareInfoModalEvent",openAddToListModalEvent:"openAddToListModalEvent",addProductToCartEvent:"addProductToCartEvent"},decls:25,vars:25,consts:[[1,"item"],[1,"foa-recommand-card"],["class","foa-card-tag",4,"appRole"],[3,"routerLink"],[3,"src"],[1,"foa-recommand-card-name",3,"routerLink"],[1,"foa-recommand-card-description","mb-2"],[1,"foa-recommand-card-description-price-box"],[1,"foa-recommand-card-description-price","member"],[1,"foa-recommand-card-description-price-title"],[1,"foa-recommand-card-description-price-price"],[1,"foa-recommand-card-description-price","custumer"],["class","foa-recommand-card-description-btn-box",4,"appRole"],["class","foa-recommand-card-tool",4,"appRole"],[1,"foa-card-tag"],[1,"foa-recommand-card-description-btn-box"],["aria-label","add product to cart",1,"btn-black","foa-recommand-card-description-btn",3,"disabled","click"],[1,"foa-recommand-card-tool"],["aria-label","open add to list modal",1,"btn-tomylist",3,"disabled","click"],["aria-label","open share info modal",1,"btn-share2earn","btn-black",3,"disabled","click"],[1,"btn-share2earn-icon"],[1,"btn-share2earn-content"],[1,"btn-share2earn-title"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"div",1),w.zc(2,Z,1,0,"div",2),w.Tb(3,"a",3),w.Ob(4,"app-image-loader",4),w.Sb(),w.Tb(5,"a",5),w.Bc(6),w.Sb(),w.Tb(7,"div",6),w.Tb(8,"div",7),w.Tb(9,"div",8),w.Tb(10,"div",9),w.Bc(11),w.dc(12,"translate"),w.Sb(),w.Tb(13,"div",10),w.Bc(14),w.dc(15,"priceFormatter"),w.Sb(),w.Sb(),w.Tb(16,"div",11),w.Tb(17,"div",9),w.Bc(18),w.dc(19,"translate"),w.Sb(),w.Tb(20,"div",10),w.Bc(21),w.dc(22,"priceFormatter"),w.Sb(),w.Sb(),w.Sb(),w.zc(23,W,2,1,"div",12),w.Sb(),w.zc(24,tt,8,5,"div",13),w.Sb(),w.Sb()),2&t&&(w.Ab(2),w.gc("appRole","shopOwner"),w.Ab(1),w.jc("routerLink","/",e.shopUid,"/products/",null==e.item?null:e.item.pdpAliasCode,""),w.Bb("aria-label","navigate to product"+(null==e.item?null:e.item.pdpAliasCode)),w.Ab(1),w.Db("foa-recommand-card-img-box"),w.gc("src",null==e.item?null:e.item.imageUrl),w.Ab(1),w.jc("routerLink","/",e.shopUid,"/products/",null==e.item?null:e.item.pdpAliasCode,""),w.Bb("aria-label","navigate to product"+(null==e.item?null:e.item.pdpAliasCode)),w.Ab(1),w.Dc(" ",null==e.item?null:e.item.description," "),w.Ab(5),w.Dc(" ",w.ec(12,17,"SHOP_FOA_ITEM.member")," "),w.Ab(3),w.Dc(" ",w.ec(15,19,null==e.item?null:e.item.priceValue)," "),w.Ab(4),w.Dc(" ",w.ec(19,21,"SHOP_FOA_ITEM.retail")," "),w.Ab(3),w.Dc(" ",w.ec(22,23,null==e.item?null:e.item.retailPriceValue)," "),w.Ab(2),w.gc("appRole","customer"),w.Ab(1),w.gc("appRole","shopOwner"))},directives:[D.a,u.h,_.a],pipes:[o.c,Y.a],styles:[""],changeDetection:0}),t})();var it=i("MYMn"),ot=i("iJbF");let at=(()=>{class t{constructor(){this.item=null,this.listSelectionChageEvent=new w.n}ngOnInit(){}onListSelectionChange(t){this.listSelectionChageEvent.emit(t)}ngOnDestroy(){}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=w.Hb({type:t,selectors:[["app-foa-list-item"]],inputs:{item:"item"},outputs:{listSelectionChageEvent:"listSelectionChageEvent"},decls:5,vars:5,consts:[[1,"add-to-share-list"],["type","checkbox",1,"add-to-share-input",3,"id","name","value","change"],[1,"add-to-share-label",3,"for"],[1,"add-to-share-label-text"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"input",1),w.ac("change",function(t){return e.onListSelectionChange(t)}),w.Sb(),w.Tb(2,"label",2),w.Tb(3,"div",3),w.Bc(4),w.Sb(),w.Sb(),w.Sb()),2&t&&(w.Ab(1),w.hc("id",e.item.uid),w.hc("name",e.item.uid),w.hc("value",e.item.uid),w.Ab(1),w.hc("for",e.item.uid),w.Ab(2),w.Cc(null==e.item?null:e.item.name))},styles:[""],changeDetection:0}),t})();function st(t,e){if(1&t){const t=w.Ub();w.Rb(0),w.Tb(1,"app-foa-list-item",15),w.ac("listSelectionChageEvent",function(e){return w.tc(t),w.cc(2).onListSelectionChange(e)}),w.Sb(),w.Qb()}if(2&t){const t=e.$implicit;w.Ab(1),w.gc("item",t)}}function nt(t,e){if(1&t&&(w.Rb(0),w.zc(1,st,2,1,"ng-container",14),w.dc(2,"async"),w.Qb()),2&t){const t=w.cc();w.Ab(1),w.gc("ngForOf",w.ec(2,1,t.shopList$))}}const ct=function(t){return{"has-morethan-four":t}};let lt=(()=>{class t{constructor(t){this.uiHelperService=t,this.closeAddToListModalEvent=new w.n,this.openCreateNewListModalEvent=new w.n,this.addProductToListsEvent=new w.n,this.isModalClassAlreadyApplied=!1,this.selectedShopListUids=[],this.isModalClassAlreadyApplied=this.uiHelperService.isModalClassApplied(),this.isModalClassAlreadyApplied||this.uiHelperService.onInitPopup()}ngOnInit(){}closeAddToListModal(){this.closeAddToListModalEvent.emit(!0)}openCreateNewListModal(){this.openCreateNewListModalEvent.emit(!0)}onListSelectionChange(t){const e=t.srcElement.value;t.srcElement.checked?this.isItemAlreadyPresent(e)||this.selectedShopListUids.push(e):this.isItemAlreadyPresent(e)&&(this.selectedShopListUids=this.selectedShopListUids.filter(t=>t!==e))}isItemAlreadyPresent(t){return-1!==this.selectedShopListUids.findIndex(e=>e===t)}addProductToLists(){this.addProductToListsEvent.emit(this.selectedShopListUids)}ngOnDestroy(){this.isModalClassAlreadyApplied||this.uiHelperService.onClosePopup()}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(O.a))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-add-foa-list"]],outputs:{closeAddToListModalEvent:"closeAddToListModalEvent",openCreateNewListModalEvent:"openCreateNewListModalEvent",addProductToListsEvent:"addProductToListsEvent"},decls:23,vars:22,consts:[["id","Thelist",1,"amway-modal","active"],[1,"bg-modal",3,"click"],[1,"amway-modal-content","ListShop"],[1,"title-bar-with-close","mb-3"],[1,"amway-modal-content-title","my-list"],[1,"btn-close-modal","visible-desktop",3,"click"],["data-typeList","shop",1,"content-list","--selected"],[1,"add-to-share",3,"ngClass"],[4,"ngIf"],[1,"footer-ListShop","padding-for-mobile"],[1,"two-btn"],["aria-label","create list",1,"btn-outline-black","btn-modal","btn-mod-double",3,"click"],["aria-label","add product to list",1,"btn-black","btn-modal","btn-mod-double",3,"disabled","click"],[3,"visible","cover"],[4,"ngFor","ngForOf"],[3,"item","listSelectionChageEvent"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"div",1),w.ac("click",function(){return e.closeAddToListModal()}),w.Sb(),w.Tb(2,"div",2),w.Tb(3,"div",3),w.Tb(4,"div",4),w.Bc(5),w.dc(6,"translate"),w.Sb(),w.Tb(7,"div",5),w.ac("click",function(){return e.closeAddToListModal()}),w.Sb(),w.Sb(),w.Tb(8,"div",6),w.Tb(9,"div",7),w.dc(10,"async"),w.zc(11,nt,3,3,"ng-container",8),w.dc(12,"async"),w.Sb(),w.Tb(13,"div",9),w.Tb(14,"div",10),w.Tb(15,"button",11),w.ac("click",function(){return e.openCreateNewListModal()}),w.Bc(16),w.dc(17,"translate"),w.Sb(),w.Tb(18,"button",12),w.ac("click",function(){return e.addProductToLists()}),w.Bc(19),w.dc(20,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Ob(21,"app-loader",13),w.dc(22,"async"),w.Sb(),w.Sb()),2&t&&(w.Ab(5),w.Cc(w.ec(6,8,"ADD_FOA_LIST.my_list")),w.Ab(4),w.gc("ngClass",w.lc(20,ct,w.ec(10,10,e.shopList$).length>4)),w.Ab(2),w.gc("ngIf",w.ec(12,12,e.shopList$).length),w.Ab(5),w.Dc("+ ",w.ec(17,14,"ADD_FOA_LIST.create_list"),""),w.Ab(2),w.gc("disabled",!(null!=e.selectedShopListUids&&e.selectedShopListUids.length)),w.Ab(1),w.Cc(w.ec(20,16,"COMMON.save")),w.Ab(2),w.gc("visible",w.ec(22,18,e.loading$))("cover",!0))},directives:[U.j,U.l,F.a,U.k,at],pipes:[o.c,U.b],styles:[""],changeDetection:0}),Object(f.a)([Object(a.c)(d.a.getShopList)],t.prototype,"shopList$",void 0),Object(f.a)([Object(a.c)(d.a.getLoader)],t.prototype,"loading$",void 0),t})();function rt(t,e){1&t&&(w.Tb(0,"div",9),w.Tb(1,"div",10),w.Tb(2,"div",11),w.Bc(3),w.dc(4,"translate"),w.Sb(),w.Tb(5,"div",12),w.Bc(6),w.dc(7,"translate"),w.Sb(),w.Sb(),w.Sb()),2&t&&(w.Ab(3),w.Dc(" ",w.ec(4,2,"SHOP_FOA.recommended_products")," "),w.Ab(3),w.Dc(" ",w.ec(7,4,"SHOP_FOA.recommended_products_tag")," "))}function dt(t,e){1&t&&(w.Tb(0,"div",11),w.Bc(1),w.dc(2,"translate"),w.Sb()),2&t&&(w.Ab(1),w.Dc(" ",w.ec(2,1,"SHOP_FOA.recommended_for_you")," "))}function bt(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-shop-foa-item",15),w.ac("openShareInfoModalEvent",function(e){return w.tc(t),w.cc(4).openShareInfoModal(e)})("openAddToListModalEvent",function(e){return w.tc(t),w.cc(4).openAddToListModal(e)})("addProductToCartEvent",function(e){return w.tc(t),w.cc(4).addProductToCart(e)}),w.Sb()}if(2&t){const t=w.cc(2).$implicit;w.gc("item",t)}}function pt(t,e){1&t&&w.zc(0,bt,1,1,"ng-template",14)}function ht(t,e){if(1&t&&(w.Rb(0),w.zc(1,pt,1,0,void 0,13),w.Qb()),2&t){const t=e.$implicit;w.Ab(1),w.gc("ngIf",null==t?null:t.isShopVisible)}}function ut(t,e){if(1&t&&(w.Tb(0,"div",3),w.zc(1,rt,8,6,"div",4),w.zc(2,dt,3,3,"div",5),w.Tb(3,"div",6),w.Tb(4,"owl-carousel-o",7),w.zc(5,ht,2,1,"ng-container",8),w.dc(6,"async"),w.Sb(),w.Sb(),w.Sb()),2&t){const t=w.cc();w.Ab(1),w.gc("appRole","shopOwner"),w.Ab(1),w.gc("appRole","customer"),w.Ab(2),w.gc("options",t.favouriteItemsCarousel),w.Ab(1),w.gc("ngForOf",w.ec(6,4,t.shopFoaProductList$))}}function mt(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-email",19),w.ac("closeModalEvent",function(e){return w.tc(t),w.cc(2).toggleEmailModal(e)}),w.Sb()}if(2&t){const t=w.cc(2);w.gc("product",t.itemToShare)}}function ft(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-add-foa-list",20),w.ac("closeAddToListModalEvent",function(){return w.tc(t),w.cc(2).closeAddToListModal()})("openCreateNewListModalEvent",function(){return w.tc(t),w.cc(2).openCreateNewListModal()})("addProductToListsEvent",function(e){return w.tc(t),w.cc(2).addProductToLists(e)}),w.Sb()}}function gt(t,e){if(1&t){const t=w.Ub();w.Rb(0),w.Tb(1,"app-sharebar",16),w.ac("sendEmailEvent",function(e){return w.tc(t),w.cc().toggleEmailModal(e)})("closeModalEvent",function(){return w.tc(t),w.cc().closeShareInfoModal()}),w.Sb(),w.zc(2,mt,1,1,"app-email",17),w.zc(3,ft,1,0,"app-add-foa-list",18),w.Qb()}if(2&t){const t=w.cc();w.Ab(1),w.gc("open",t.isShareItemInfoModalOpen)("product",t.itemToShare)("showProductInfo",t.showProductInfo),w.Ab(1),w.gc("ngIf",t.openEmailModal),w.Ab(1),w.gc("ngIf",t.isAddToListModalOpen)}}let vt=(()=>{class t{constructor(t,e,i,o,a,s){this.store=t,this.router=e,this.route=i,this.cartDetailService=o,this.messageService=a,this.uiHelper=s,this.openCreateNewListModalEvent=new w.n,this.shopUid="",this.listId="",this.subscriptions=new g.a,this.itemToShare=new V.a,this.favouriteItemsCarousel=R.v,this.isShareItemInfoModalOpen=!1,this.isAddToListModalOpen=!1,this.showProductInfo=!1,this.openEmailModal=!1,this.addedCartProducts=[],this.codeToCustom3EProduct=new Map}ngOnInit(){this.getRouteParams(),this.subscribeForCurrentAction(),this.subscribeForShopListCurrentAction()}getRouteParams(){this.subscriptions.add(this.route.params.subscribe(t=>{this.shopUid=t&&t.shopUid?t.shopUid:this.shopUid}))}subscribeForCurrentAction(){this.subscriptions.add(this.currentAction$.subscribe(t=>{"productAddedToCart"===t&&this.messageService.showSuccess({routeTo:"/"+this.shopUid+this.uiHelper.getRoutePathForCartPage(),linkMessage:"SHOP_FOA.goto_basket",message:"SHOP_FOA.product_added_notification"})}))}subscribeForShopListCurrentAction(){this.subscriptions.add(this.shopListCurrentAction$.subscribe(t=>{switch(t){case"productAddedToLists":this.messageService.showSuccess({routeTo:"/"+this.shopUid+"/"+this.listId,linkMessage:"COMMON.view_list",message:"COMMON.added_to_my_list",viewCloseIcon:!0});break;case"newListCreated":this.messageService.showSuccess({message:"COMMON.successfully_added_list",viewCloseIcon:!0})}}))}openShareInfoModal(t){this.itemToShare=t,this.showProductInfo=!0,this.isShareItemInfoModalOpen=!0}closeShareInfoModal(){this.openEmailModal||(this.itemToShare=new V.a),this.showProductInfo=!1,this.isShareItemInfoModalOpen=!1}openAddToListModal(t){this.itemToShare=t,this.itemToShare&&this.itemToShare.code&&(this.itemToShare.multidimensional||this.itemToShare.isKitProduct?this.router.navigateByUrl(`${this.shopUid}/products/${this.itemToShare.pdpAliasCode}`):this.isAddToListModalOpen=!0)}closeAddToListModal(){this.itemToShare=new V.a,this.isAddToListModalOpen=!1}openCreateNewListModal(){this.openCreateNewListModalEvent.emit(this.itemToShare),this.closeAddToListModal()}toggleEmailModal(t){this.openEmailModal=t,t||(this.itemToShare=new V.a)}addProductToLists(t){t&&t.length>0&&(this.store.dispatch(new E.c(t,[this.itemToShare])),this.listId=1===t.length?t[0]:"",this.closeAddToListModal())}addProductToCart(t){if(t&&t.code)if(t.multidimensional||t.isKitProduct)this.router.navigateByUrl(`${this.shopUid}/products/${t.pdpAliasCode}`);else{const e=this.cartDetailService.getCartInfoFromSession();e&&e.cartId?this.addProductToExistingCart(t):this.addProductToNewCart(t)}}addProductToExistingCart(t){this.store.dispatch(new Q.e({nonBundledEntries:[this.createCustomNonBundledProduct(t)]}))}addProductToNewCart(t){this.store.dispatch(new Q.j({bundledEntries:[],nonBundledEntries:[this.createCustomNonBundledProduct(t)]}))}createCustomNonBundledProduct(t){const e=new G.a;e.quantity=1;const i=new z.a;return i.code=t.code,i.alias=t.aliasCode,e.product=i,e}getUpdatedCustom3EProduct(t){const e=this.codeToCustom3EProduct.get(t);return e.quantity+=1,e}ngOnDestroy(){this.subscriptions.unsubscribe(),this.store.dispatch(new Q.n),this.store.dispatch(new E.j)}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(a.f),w.Nb(u.g),w.Nb(u.a),w.Nb(K.a),w.Nb(q.a),w.Nb(O.a))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-shop-foa"]],outputs:{openCreateNewListModalEvent:"openCreateNewListModalEvent"},decls:8,vars:14,consts:[["class","foa-recommand-main",4,"ngIf"],[3,"visible","cover"],[4,"appRole"],[1,"foa-recommand-main"],["class","foa-recommand-main-box mb-3",4,"appRole"],["class","foa-recommand-main-title",4,"appRole"],[1,"foa-recommand-main-list"],[3,"options"],[4,"ngFor","ngForOf"],[1,"foa-recommand-main-box","mb-3"],[1,"foa-recommand-main-title-area"],[1,"foa-recommand-main-title"],[1,"foa-recommand-main-text"],[4,"ngIf"],["carouselSlide",""],[3,"item","openShareInfoModalEvent","openAddToListModalEvent","addProductToCartEvent"],[3,"open","product","showProductInfo","sendEmailEvent","closeModalEvent"],[3,"product","closeModalEvent",4,"ngIf"],[3,"closeAddToListModalEvent","openCreateNewListModalEvent","addProductToListsEvent",4,"ngIf"],[3,"product","closeModalEvent"],[3,"closeAddToListModalEvent","openCreateNewListModalEvent","addProductToListsEvent"]],template:function(t,e){if(1&t&&(w.zc(0,ut,7,6,"div",0),w.dc(1,"async"),w.Ob(2,"app-loader",1),w.dc(3,"async"),w.dc(4,"async"),w.dc(5,"async"),w.dc(6,"async"),w.zc(7,gt,4,5,"ng-container",2)),2&t){let t=null;w.gc("ngIf",null==(t=w.ec(1,4,e.shopFoaProductList$))?null:t.length),w.Ab(2),w.gc("visible",w.ec(3,6,e.loading$)||w.ec(4,8,e.isLoading$))("cover",!w.ec(5,10,e.loading$)&&!!w.ec(6,12,e.isLoading$)),w.Ab(5),w.gc("appRole","shopOwner")}},directives:[U.l,F.a,D.a,J.a,U.k,J.c,et,it.a,ot.a,lt],pipes:[U.b,o.c],styles:[""],changeDetection:0}),Object(f.a)([Object(a.c)(l.a.getShopFoaProductList)],t.prototype,"shopFoaProductList$",void 0),Object(f.a)([Object(a.c)(l.a.getLoader)],t.prototype,"loading$",void 0),Object(f.a)([Object(a.c)(b.a.getCurrentAction)],t.prototype,"currentAction$",void 0),Object(f.a)([Object(a.c)(b.a.getLoader)],t.prototype,"isLoading$",void 0),Object(f.a)([Object(a.c)(d.a.getShopListCurrentAction)],t.prototype,"shopListCurrentAction$",void 0),t})();var St=i("LyJQ"),kt=i("X36C"),Tt=i("Vurf"),Lt=i("EP1h"),At=i("Qosb"),Et=i("QOZS");function It(t,e){if(1&t){const t=w.Ub();w.Tb(0,"div",13),w.ac("click",function(e){return w.tc(t),w.cc(2).openSocialShare(!0),e.stopPropagation()}),w.Bc(1),w.dc(2,"translate"),w.Sb()}2&t&&(w.Ab(1),w.Dc(" ",w.ec(2,1,"LANDING_PAGE.share_list")," "))}function wt(t,e){if(1&t&&(w.Tb(0,"div",19),w.Bc(1),w.Sb()),2&t){const t=w.cc(4);w.Ab(1),w.Dc(" +",t.list.entries.length-4," ")}}const Ot=function(t){return{"more-all":t}},yt=function(t){return{background:t}};function Mt(t,e){if(1&t&&(w.Tb(0,"div",15),w.Tb(1,"div",16),w.zc(2,wt,2,1,"div",17),w.Ob(3,"div",18),w.Sb(),w.Sb()),2&t){const t=w.cc(),e=t.index,i=t.$implicit,o=w.cc(2);w.gc("ngClass",w.lc(3,Ot,3===e&&o.list.entries.length>4)),w.Ab(2),w.gc("ngIf",3===e&&o.list.entries.length>4),w.Ab(1),w.gc("ngStyle",w.lc(5,yt,"url("+(i.imageUrl?i.imageUrl:"assets/image/action/no-img.svg")+")"))}}function Ct(t,e){if(1&t&&(w.Rb(0),w.zc(1,Mt,4,7,"div",14),w.Qb()),2&t){const t=e.index;w.Ab(1),w.gc("ngIf",t<4)}}function Pt(t,e){if(1&t){const t=w.Ub();w.Rb(0),w.Tb(1,"div",2),w.ac("click",function(){w.tc(t);const e=w.cc();return e.navigateToList(null==e.list?null:e.list.uid)}),w.Tb(2,"div",3),w.Tb(3,"div",4),w.Tb(4,"a",5),w.ac("click",function(t){return t.stopPropagation()}),w.Bc(5),w.Sb(),w.Sb(),w.Tb(6,"div",6),w.Bc(7),w.Sb(),w.Tb(8,"div",7),w.zc(9,It,3,3,"div",8),w.Tb(10,"a",9),w.ac("click",function(t){return t.stopPropagation()}),w.Bc(11),w.dc(12,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(13,"div",10),w.Tb(14,"div",11),w.zc(15,Ct,2,1,"ng-container",12),w.Sb(),w.Sb(),w.Sb(),w.Qb()}if(2&t){const t=w.cc();w.Ab(1),w.gc("ngClass",t.list.theme),w.Ab(3),w.jc("routerLink","/",t.shopUid,"/",t.list.uid,""),w.Bb("aria-label","navigate to list"+(null==t.list?null:t.list.uid)),w.Ab(1),w.Dc(" ",t.list.name," "),w.Ab(2),w.Dc(" ",t.list.description," "),w.Ab(2),w.gc("appRole","shopOwner"),w.Ab(1),w.jc("routerLink","/",t.shopUid,"/",t.list.uid,""),w.Bb("aria-label","navigate to list"+(null==t.list?null:t.list.uid)),w.Ab(1),w.Dc(" ",w.ec(12,12,"LANDING_PAGE.view_all")," "),w.Ab(4),w.gc("ngForOf",t.list.entries)}}function Nt(t,e){if(1&t){const t=w.Ub();w.Tb(0,"div",21),w.ac("click",function(){w.tc(t);const e=w.cc(2);return e.navigateToList(null==e.list?null:e.list.uid)}),w.Tb(1,"div",3),w.Tb(2,"div",4),w.Tb(3,"a",5),w.ac("click",function(t){return t.stopPropagation()}),w.Bc(4),w.Sb(),w.Sb(),w.Tb(5,"div",6),w.Bc(6),w.Sb(),w.Tb(7,"div",7),w.Tb(8,"a",9),w.ac("click",function(t){return t.stopPropagation()}),w.Bc(9),w.dc(10,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(11,"div",10),w.Tb(12,"div",22),w.Tb(13,"div",23),w.Bc(14),w.dc(15,"translate"),w.Sb(),w.Tb(16,"div",24),w.Tb(17,"button",25),w.ac("click",function(e){return w.tc(t),w.cc(2).viewAddShopProductDialog(),e.stopPropagation()}),w.Bc(18),w.dc(19,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb()}if(2&t){const t=w.cc(2);w.gc("ngClass",t.list.theme),w.Ab(3),w.jc("routerLink","/",t.shopUid,"/",t.list.uid,""),w.Bb("aria-label","navigate to list"+(null==t.list?null:t.list.uid)),w.Ab(1),w.Dc(" ",t.list.name," "),w.Ab(2),w.Dc(" ",t.list.description,""),w.Ab(2),w.jc("routerLink","/",t.shopUid,"/",t.list.uid,""),w.Bb("aria-label","navigate to list"+(null==t.list?null:t.list.uid)),w.Ab(1),w.Dc(" ",w.ec(10,12,"LANDING_PAGE.view_all")," "),w.Ab(5),w.Dc(" ",w.ec(15,14,"LANDING_PAGE.noitem_title")," "),w.Ab(4),w.Cc(w.ec(19,16,"LANDING_PAGE.add_product"))}}function _t(t,e){1&t&&w.zc(0,Nt,20,18,"div",20),2&t&&w.gc("appRole","shopOwner")}let Dt=(()=>{class t{constructor(t,e,i){this.router=i,this.openShareModalEvent=new w.n,this.openShopProductListModalEvent=new w.n,this.shopUid="",this.shopUid=t.getShopInfoFromSession().shopUid,this.favouriteItemsCarousel=e.shoplistCardCarousel}ngOnInit(){}openSocialShare(t){this.openShareModalEvent.emit(t)}viewAddShopProductDialog(){this.openShopProductListModalEvent.emit(!0)}navigateToList(t){t&&this.router.navigateByUrl(this.shopUid+"/"+t)}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(X.a),w.Nb(Et.a),w.Nb(u.g))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-shop-list"]],inputs:{list:"list"},outputs:{openShareModalEvent:"openShareModalEvent",openShopProductListModalEvent:"openShopProductListModalEvent"},decls:3,vars:2,consts:[[4,"ngIf","ngIfElse"],["noItemTemplate",""],[1,"favorite-list-card","pointer",3,"ngClass","click"],[1,"fl-card-content"],[1,"fl-card-name-area"],[1,"fl-card-name",3,"routerLink","click"],[1,"fl-card-detail"],[1,"fl-card-tool"],["class","fl-card-share",3,"click",4,"appRole"],[1,"fl-card-viewall",3,"routerLink","click"],[1,"fl-card-pd"],[1,"fl-card-pd-list"],[4,"ngFor","ngForOf"],[1,"fl-card-share",3,"click"],["class","item",3,"ngClass",4,"ngIf"],[1,"item",3,"ngClass"],[1,"fl-card"],["class","text-more-all",4,"ngIf"],[1,"fl-card-img",3,"ngStyle"],[1,"text-more-all"],["class","favorite-list-card noItem pointer",3,"ngClass","click",4,"appRole"],[1,"favorite-list-card","noItem","pointer",3,"ngClass","click"],[1,"fl-card-pd-noitem"],[1,"fl-card-pd-noitem-title"],[1,"middle-with-flex","mt-2"],["aria-label","open add product dialog",1,"btn-black","btn-h48",3,"click"]],template:function(t,e){if(1&t&&(w.zc(0,Pt,16,14,"ng-container",0),w.zc(1,_t,1,1,"ng-template",null,1,w.Ac)),2&t){const t=w.rc(2);w.gc("ngIf",e.list.entries&&e.list.entries.length>0)("ngIfElse",t)}},directives:[U.l,U.j,u.h,D.a,U.k,U.m],pipes:[o.c],styles:[""],changeDetection:0}),t})();var Ft=i("l5QL");function Ut(t,e){if(1&t){const t=w.Ub();w.Rb(0),w.Tb(1,"app-shop-list",22),w.ac("openShareModalEvent",function(){w.tc(t);const i=e.$implicit;return w.cc(2).viewShareModal(i)})("openShopProductListModalEvent",function(){w.tc(t);const i=e.$implicit;return w.cc(2).viewAddShopProductModal(i)}),w.Sb(),w.Qb()}if(2&t){const t=e.$implicit;w.Ab(1),w.gc("list",t)}}function xt(t,e){if(1&t&&(w.Tb(0,"div",20),w.zc(1,Ut,2,1,"ng-container",21),w.dc(2,"async"),w.Sb()),2&t){const t=w.cc();w.Ab(1),w.gc("ngForOf",w.ec(2,1,t.shopList$))}}function Bt(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-email",26),w.ac("closeModalEvent",function(e){return w.tc(t),w.cc(2).toggleEmailModal(e)}),w.Sb()}if(2&t){const t=w.cc(2);w.gc("shoplist",t.selectedList)}}function Ht(t,e){if(1&t){const t=w.Ub();w.Rb(0),w.Tb(1,"app-sharebar",23),w.ac("sendEmailEvent",function(e){return w.tc(t),w.cc().toggleEmailModal(e)})("closeModalEvent",function(e){return w.tc(t),w.cc().toggleSocialShare(e)}),w.Sb(),w.zc(2,Bt,1,1,"app-email",24),w.Tb(3,"app-add-shoplist-product",25),w.ac("closeDialogEvent",function(e){return w.tc(t),w.cc().hideAddShoplistProductDialog(e)}),w.Sb(),w.Qb()}if(2&t){const t=w.cc();w.Ab(1),w.gc("open",t.openShareModal)("shoplist",t.selectedList),w.Ab(1),w.gc("ngIf",t.openEmailModal),w.Ab(1),w.gc("open",t.openShopProductListModal)}}let $t=(()=>{class t{constructor(t,e,i,o,a){this.authService=t,this.store=e,this.shopInfoService=i,this.localStorage=o,this.shoplistDetailService=a,this.doEntriesExist=new w.n,this.isOwnerLoggedIn=!1,this.isEntriesExist=!1,this.openShareModal=!1,this.openEmailModal=!1,this.openShopProductListModal=!1,this.subscriptions=new g.a}ngOnInit(){this.isOwnerLoggedIn=this.authService.isRoleAvailable(St.a.SHOP_OWNER),this.shopList$.subscribe(t=>{this.isEntriesExist=t.some(t=>t.entries.length>0),this.doEntriesExist.emit(this.isEntriesExist)}),this.subscribeForFetchShopListDetail()}subscribeForFetchShopListDetail(){this.subscriptions.add(this.shoplistDetailService.fetchShoplistDetail$.subscribe(t=>{t&&this.store.dispatch(new E.i(t))}))}viewShareModal(t){this.selectedList=t,this.toggleSocialShare(!0)}toggleSocialShare(t){this.openShareModal=t}toggleEmailModal(t){this.openEmailModal=t}viewAddShopProductModal(t){this.selectedList=t,this.openShopProductListModal=!0}hideAddShoplistProductDialog(t){if(this.openShopProductListModal=!1,t&&t.length){const e=t.filter(t=>t.isKitProduct),i=t.filter(t=>!t.isKitProduct);if(i&&i.length&&this.store.dispatch(new E.d(this.selectedList.uid,t)),e&&e.length){const t=this.shopInfoService.getShopInfoFromSession(),i=this.localStorage.getItem(P.k);this.store.dispatch(new E.a({accountId:null==i?void 0:i.aboid,shopId:t.shopUid,shoplistUid:this.selectedList.uid},e))}}this.store.dispatch(new kt.a)}ngOnDestroy(){this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(Tt.a),w.Nb(a.f),w.Nb(X.a),w.Nb(Lt.a),w.Nb(At.a))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-shop-list-shell"]],outputs:{doEntriesExist:"doEntriesExist"},decls:31,vars:20,consts:[[1,"favorite-content"],["data-type","list",1,"mylist-section","selected"],[1,"favorite-list"],["class","favorite-list-area",4,"ngIf"],[3,"visible","cover"],["data-type","\n    grid",1,"mylist-section","d-none"],[1,"favorite-grid"],[1,"favorite-grid-box"],[1,"favorite-grid-card","purple","no-pd-item"],[1,"favorite-grid-card-box"],[1,"favorite-grid-pd-area"],[1,"favorite-grid-pd-box"],[1,"no-pd-item-text"],["type","button","onclick","openModal('SearchPd')",1,"btn-black","no-pd-item-btn"],[1,"favorite-grid-detail-box"],["href","ABO_mylist_detail_no_product.html",1,"favorite-grid-name"],[1,"favorite-grid-tool"],["type","button","onclick","openModal('shareSocial')",1,"favorite-grid-share"],["type","button","onclick"," window.location = 'ABO_mylist_detail_no_product.html';",1,"favorite-grid-seemore","visible-desktop"],[4,"appRole"],[1,"favorite-list-area"],[4,"ngFor","ngForOf"],[3,"list","openShareModalEvent","openShopProductListModalEvent"],[3,"open","shoplist","sendEmailEvent","closeModalEvent"],[3,"shoplist","closeModalEvent",4,"ngIf"],[3,"open","closeDialogEvent"],[3,"shoplist","closeModalEvent"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"section",1),w.Tb(2,"div",2),w.zc(3,xt,3,3,"div",3),w.dc(4,"async"),w.Ob(5,"app-loader",4),w.dc(6,"async"),w.Sb(),w.Sb(),w.Tb(7,"section",5),w.Tb(8,"div",6),w.Tb(9,"div",7),w.Tb(10,"div",8),w.Tb(11,"div",9),w.Tb(12,"div",10),w.Tb(13,"div",11),w.Tb(14,"div",12),w.Bc(15),w.dc(16,"translate"),w.Sb(),w.Tb(17,"button",13),w.Bc(18),w.dc(19,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(20,"div",14),w.Tb(21,"a",15),w.Bc(22," My first list grid "),w.Sb(),w.Tb(23,"div",16),w.Tb(24,"button",17),w.Bc(25),w.dc(26,"translate"),w.Sb(),w.Tb(27,"button",18),w.Bc(28),w.dc(29,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.zc(30,Ht,4,4,"ng-container",19)),2&t&&(w.Ab(3),w.gc("ngIf",w.ec(4,8,e.shopList$).length&&(e.isOwnerLoggedIn||e.isEntriesExist)),w.Ab(2),w.gc("visible",w.ec(6,10,e.loading$))("cover",!1),w.Ab(10),w.Dc(" ",w.ec(16,12,"LANDING_PAGE.noitem_title")," List "),w.Ab(3),w.Dc("+ ",w.ec(19,14,"LANDING_PAGE.add_product")," "),w.Ab(7),w.Cc(w.ec(26,16,"LANDING_PAGE.share_list")),w.Ab(3),w.Cc(w.ec(29,18,"LANDING_PAGE.view_all")),w.Ab(2),w.gc("appRole","shopOwner"))},directives:[U.l,F.a,D.a,U.k,Dt,it.a,Ft.a,ot.a],pipes:[U.b,o.c],styles:[".favorite-content[_ngcontent-%COMP%]{position:relative}"],changeDetection:0}),Object(f.a)([Object(a.c)(d.a.getShopList)],t.prototype,"shopList$",void 0),Object(f.a)([Object(a.c)(d.a.getLoader)],t.prototype,"loading$",void 0),t})();var jt=i("vzU1"),Rt=i("QxsG"),zt=i("XkHM");let Gt=(()=>{class t{constructor(t){this.store=t,this.product=null,this.closeModalEvent=new w.n,this.shopList=new Rt.a}ngOnChanges(t){t&&t.open&&this.open&&(this.shopList=new Rt.a)}addShopListHandler(t){t&&this.store.dispatch(new E.e({shopList:t,productList:this.product?[this.product]:[]}))}closeModalEventHandler(t){this.closeModalEvent.emit(t)}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(a.f))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-add-shop-list"]],inputs:{product:"product",open:"open"},outputs:{closeModalEvent:"closeModalEvent"},features:[w.yb],decls:1,vars:2,consts:[[3,"open","shopList","updatedShopListDetails","closeModalEvent"]],template:function(t,e){1&t&&(w.Tb(0,"app-shop-list-form",0),w.ac("updatedShopListDetails",function(t){return e.addShopListHandler(t)})("closeModalEvent",function(t){return e.closeModalEventHandler(t)}),w.Sb()),2&t&&w.gc("open",e.open)("shopList",e.shopList)},directives:[zt.a],styles:[""],changeDetection:0}),t})();function Vt(t,e){1&t&&(w.Rb(0),w.Ob(1,"div",10),w.Tb(2,"div",11),w.Bc(3),w.dc(4,"translate"),w.Sb(),w.Qb()),2&t&&(w.Ab(3),w.Cc(w.ec(4,1,"LANDING_PAGE.my_list")))}function Qt(t,e){1&t&&(w.Tb(0,"div",11),w.Bc(1),w.dc(2,"translate"),w.Sb()),2&t&&(w.Ab(1),w.Cc(w.ec(2,1,"SHOP_FOA.good_product")))}function Kt(t,e){if(1&t&&(w.Rb(0),w.zc(1,Qt,3,3,"div",12),w.Qb()),2&t){const t=w.cc();w.Ab(1),w.gc("ngIf",t.doEntriesExist)}}function qt(t,e){if(1&t){const t=w.Ub();w.Tb(0,"button",13),w.ac("click",function(){return w.tc(t),w.cc().toggleAddShopList(!0)}),w.Bc(1),w.dc(2,"translate"),w.Sb()}2&t&&(w.Ab(1),w.Dc(" ",w.ec(2,1,"LANDING_PAGE.add_shop_list")," "))}function Jt(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-add-shop-list",14),w.ac("closeModalEvent",function(e){return w.tc(t),w.cc().toggleAddShopList(e)}),w.Sb()}if(2&t){const t=w.cc();w.gc("open",t.openAddShopListModal)("product",t.product)}}let Xt=(()=>{class t{constructor(){this.openAddShopListModal=!1,this.product=null,this.doEntriesExist=!1}toggleAddShopList(t){t||(this.product=null),this.openAddShopListModal=t}openCreateNewListModal(t){this.product=t,this.toggleAddShopList(!0)}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=w.Hb({type:t,selectors:[["app-shop-content"]],decls:12,vars:4,consts:[[1,"amway-shop-content-area"],[1,"amway-container"],[3,"openCreateNewListModalEvent"],[1,"favorite-item"],[1,"favorite-item-area"],[4,"appRole"],[1,"mylist-tool"],["aria-label","add product to list","class","btn-outlin-black btn-h40 min-w-auto",3,"click",4,"appRole"],[3,"doEntriesExist"],[3,"open","product","closeModalEvent",4,"appRole"],[1,"favorite-item-icon"],[1,"favorite-item-text"],["class","favorite-item-text",4,"ngIf"],["aria-label","add product to list",1,"btn-outlin-black","btn-h40","min-w-auto",3,"click"],[3,"open","product","closeModalEvent"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"div",1),w.Tb(2,"app-shop-foa",2),w.ac("openCreateNewListModalEvent",function(t){return e.openCreateNewListModal(t)}),w.Sb(),w.Tb(3,"div",3),w.Tb(4,"div",4),w.zc(5,Vt,5,3,"ng-container",5),w.zc(6,Kt,2,1,"ng-container",5),w.Sb(),w.Tb(7,"div",6),w.zc(8,qt,3,3,"button",7),w.Sb(),w.Sb(),w.Tb(9,"app-shop-list-shell",8),w.ac("doEntriesExist",function(t){return e.doEntriesExist=t}),w.Sb(),w.Sb(),w.Sb(),w.Ob(10,"app-contact-footer"),w.zc(11,Jt,1,2,"app-add-shop-list",9)),2&t&&(w.Ab(5),w.gc("appRole","shopOwner"),w.Ab(1),w.gc("appRole","customer"),w.Ab(2),w.gc("appRole","shopOwner"),w.Ab(3),w.gc("appRole","shopOwner"))},directives:[vt,D.a,$t,jt.a,U.l,Gt],pipes:[o.c],styles:[""],changeDetection:0}),t})();var Yt=i("Kjkz"),Zt=i("3Pt+"),Wt=i("LAwb"),te=i("1tC4");class ee{constructor(t=null){this.shopName="",this.shopUID="",this.shopDescription="",this.aboutAbo="",this.facebookLink="",this.instagramLink="",this.lineLink="",this.phone="",this.tiktokLink="",this.twitterLink="",this.youtubeLink="",this.email="",t&&(this.shopName=t.shopName||this.shopName,this.shopUID=t.shopUid||this.shopUID,this.shopDescription=t.description||this.shopDescription,this.aboutAbo=t.aboutOwner||this.aboutAbo,this.facebookLink=t.facebookLink||this.facebookLink,this.instagramLink=t.instagramLink||this.instagramLink,this.lineLink=t.lineLink||this.lineLink,this.tiktokLink=t.tiktokLink||this.tiktokLink,this.twitterLink=t.twitterLink||this.twitterLink,this.youtubeLink=t.youtubeLink||this.youtubeLink,this.email=t.email||this.email,this.phone=t.phoneNumber||this.phone)}}const ie=function(t){return{active:t}};function oe(t,e){if(1&t&&(w.Tb(0,"div",62),w.Tb(1,"div",63),w.Ob(2,"div",64),w.Tb(3,"div",65),w.Bc(4),w.dc(5,"translate"),w.Sb(),w.Sb(),w.Tb(6,"div",66),w.Ob(7,"div",64),w.Tb(8,"div",65),w.Bc(9),w.dc(10,"translate"),w.Sb(),w.Sb(),w.Sb()),2&t){const t=w.cc();w.Ab(1),w.gc("ngClass",w.lc(8,ie,t.isLinkAvailable)),w.Ab(3),w.Dc(" ",w.ec(5,4,"EDIT_SHOP_INFO.shop_name_available")," "),w.Ab(2),w.gc("ngClass",w.lc(10,ie,!t.isLinkAvailable)),w.Ab(3),w.Dc(" ",w.ec(10,6,"EDIT_SHOP_INFO.shop_name_unavailable")," ")}}function ae(t,e){1&t&&(w.Tb(0,"div",67),w.Bc(1),w.dc(2,"translate"),w.Sb()),2&t&&(w.Ab(1),w.Dc(" ",w.ec(2,1,"EDIT_SHOP_INFO.duplicate_link_name_err"),""))}const se=function(t){return{"input-errorMessage":t}};function ne(t,e){if(1&t&&(w.Rb(0),w.Tb(1,"div",9),w.Bc(2),w.dc(3,"translate"),w.Sb(),w.Tb(4,"div",68),w.Ob(5,"div",69),w.Tb(6,"div",70),w.Tb(7,"div",71),w.Ob(8,"input",72),w.dc(9,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(10,"div",68),w.Ob(11,"div",73),w.Tb(12,"div",70),w.Tb(13,"div",71),w.Ob(14,"input",74),w.dc(15,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(16,"div",75),w.Ob(17,"div",76),w.Tb(18,"div",70),w.Tb(19,"div",71),w.Ob(20,"input",77),w.dc(21,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Qb()),2&t){const t=w.cc();w.Ab(2),w.Cc(w.ec(3,7,"EDIT_SHOP_INFO.social_media")),w.Ab(5),w.gc("ngClass",w.lc(15,se,t.shopForm.get("lineLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(9,9,"EDIT_SHOP_INFO.line_id_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(17,se,t.shopForm.get("facebookLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(15,11,"EDIT_SHOP_INFO.facebook_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(19,se,t.shopForm.get("instagramLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(21,13,"EDIT_SHOP_INFO.instagram_placeholder"))}}const ce=function(t){return{active:t}},le=function(t,e){return{"input-errorMessage":t,disabled:e}},re=function(t){return{selected:t}};let de=(()=>{class t{constructor(t,e,i){this.store=t,this.fb=e,this.uihelper=i,this.closeModalEvent=new w.n,this.subscriptions=new g.a,this.isDuplicateShopLinkName=!1,this.isModalClass=!1,this.initialLinkNameValue="",this.isLinkEditable=!1,this.showLinkAvailabilityMsg=!1,this.isLinkAvailable=!0,this.shopUidToAvailability=new Map,this.isUpdateClicked=!1}ngOnInit(){this.subscribeForShopInfo(),this.subscribeForIsShopUidAvailableFlag()}subscribeForShopInfo(){this.subscriptions.add(this.shopInfo$.subscribe(t=>{t?(this.existingShopDetails=t,this.initShopForm(t),this.initialLinkNameValue=this.shopForm.get("shopUid").value):this.initialLinkNameValue=""}))}subscribeForIsShopUidAvailableFlag(){this.subscriptions.add(this.isShopUidAvailable$.subscribe(t=>{null!=t&&(this.isLinkAvailable=t,this.showLinkAvailabilityMsg=!0,this.shopUidToAvailability.set(this.shopForm.get("shopUid").value,t),this.onUpdateClick())}))}ngOnChanges(t){t&&t.open&&(this.applyModalClass(),this.open&&this.initShopForm(this.existingShopDetails))}applyModalClass(){this.open?(this.isModalClass=this.uihelper.isModalClassApplied(),this.isModalClass||this.uihelper.onInitPopup()):this.isModalClass||this.uihelper.onClosePopup()}initShopForm(t){this.shopForm=this.fb.group({shopName:[t.shopName,[Zt.p.required]],shopUid:[t.shopUid,[Zt.p.required]],aboutOwner:[t.aboutOwner],description:[t.description],lineLink:[t.lineLink],facebookLink:[this.parseLink(t.facebookLink,R.u)],instagramLink:[this.parseLink(t.instagramLink,R.D)],twitterLink:[this.parseLink(t.twitterLink,R.X)],youtubeLink:[this.parseLink(t.youtubeLink,R.Y)],tiktokLink:[this.parseLink(t.tiktokLink,R.W)],phoneNumber:[this.getFormattedMobileNumber(t.phone),[Zt.p.pattern(te.b)]],email:[t.email,[Zt.p.email]]})}getFormattedMobileNumber(t){return Wt.a.formatStringWithHyphen(t,[3,7])}parseLink(t,e){if(t&&e){const i=t.indexOf(e);if(-1!==i)return t.slice(i+e.length,t.length)}return t}formatPhoneNumber(t){if(t.target.value){const e=t.target.value.replace(/-/g,"");this.shopForm.patchValue({phoneNumber:this.getFormattedMobileNumber(e)})}}resetShopForm(){this.shopForm&&this.shopForm.reset(this.existingShopDetails)}saveChanges(){if(this.shopForm.valid){const t=this.updateFormValuesBeforeSave();this.store.dispatch(new A.e(new ee(t))),this.closeModal()}}updateFormValuesBeforeSave(){const t=this.shopForm.getRawValue();return t&&(t.facebookLink=t.facebookLink.trim(),t.instagramLink=t.instagramLink.trim(),t.tiktokLink=t.tiktokLink.trim(),t.twitterLink=t.twitterLink.trim(),t.youtubeLink=t.youtubeLink.trim(),t.lineLink=t.lineLink.trim(),t.facebookLink&&(t.facebookLink=R.u+t.facebookLink),t.instagramLink&&(t.instagramLink=R.D+t.instagramLink),t.tiktokLink&&(t.tiktokLink=R.W+t.tiktokLink),t.twitterLink&&(t.twitterLink=R.X+t.twitterLink),t.youtubeLink&&(t.youtubeLink=R.Y+t.youtubeLink),t.phoneNumber&&(t.phoneNumber=t.phoneNumber.replaceAll("-",""))),t}closeModal(){this.resetShopForm(),this.initialLinkNameValue=this.shopForm.get("shopUid").value,this.showLinkAvailabilityMsg=!1,this.isLinkEditable=!1,this.isLinkAvailable=!0,this.isUpdateClicked=!1,this.shopUidToAvailability=new Map,this.closeModalEvent.emit(!1)}showEditLinkName(){this.isLinkEditable=!0}closeEditLinkName(){this.isLinkEditable=!1,this.showLinkAvailabilityMsg=!1,this.shopForm.patchValue({shopUid:this.initialLinkNameValue}),this.isLinkAvailable=!0,this.isUpdateClicked=!1}updateLinkName(){this.isUpdateClicked=!0,this.isLinkNameAvailable()}onUpdateClick(){this.isUpdateClicked&&(this.isUpdateClicked=!1,this.isLinkAvailable&&(this.showLinkAvailabilityMsg=!1,this.isLinkEditable=!1))}isLinkNameAvailable(){if(this.shopForm&&this.shopForm.get("shopUid")){this.updateLinkNameText();const t=this.shopForm.get("shopUid").value;t?t===this.initialLinkNameValue?(this.isLinkAvailable=!0,this.showLinkAvailabilityMsg=!1,this.onUpdateClick()):this.shopUidToAvailability&&this.shopUidToAvailability.has(t)?(this.isLinkAvailable=this.shopUidToAvailability.get(t),this.showLinkAvailabilityMsg=!0,this.onUpdateClick()):this.store.dispatch(new A.a({shopUid:t})):(this.isLinkAvailable=!1,this.onUpdateClick())}}updateLinkNameText(){let t=this.shopForm.get("shopUid").value;t=t.replace(/\s/g,"-"),t=t.replace(/[^a-zA-Z0-9-_.\u0E00-\u0E7F]/g,""),t=t.replace(/\.+$/,""),this.shopForm.patchValue({shopUid:t})}ngOnDestroy(){this.subscriptions.unsubscribe()}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(a.f),w.Nb(Zt.c),w.Nb(O.a))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-edit-shop-info"]],inputs:{open:"open"},outputs:{closeModalEvent:"closeModalEvent"},features:[w.yb],decls:140,vars:138,consts:[["id","editProfile",1,"amway-modal-fullPageOnMb",3,"ngClass"],[1,"bg-modal",3,"click"],[3,"formGroup","ngSubmit"],[1,"amway-modal-content-fullpage-onMb","choose-theme-profile","shop"],[1,"aw-header-bar"],[1,"aw-header-bar-btn-back",3,"click"],[1,"aw-header-bar-title"],[1,"aw-for-scroll"],[1,"content-create-wl"],[1,"aw-md-full-sub-title"],[1,"red-text-for-input"],[1,"sub-text-for-label"],[1,"amway-input-area","mb-3","mt-1",3,"ngClass"],["type","text","name","nameProfile","id","nameProfile","formControlName","shopName","autocomplete","off","maxlength","60",1,"amway-input",3,"placeholder"],[1,"link-add-area","mt-1"],[1,"link-add-area-box"],[1,"box-link-edit",3,"ngClass"],[1,"box-link-edit-main-link"],[1,"box-link-edit-text"],["type","text","name","link","id","link","formControlName","shopUid","autocomplete","off",1,"amway-input","box-link-edit-input",3,"placeholder","readonly","disabled","maxlength","blur"],["aria-label","enable shop link name","type","button","data-name","AmwayShop",1,"box-link-edit-btn",3,"click","mousedown"],[1,"box-link-edit-content",3,"ngClass"],["class","amway-info-url-status","id","url-status",4,"ngIf"],[1,"box-link-edit-content-warning"],[1,"box-link-edit-content-warning-icon"],[1,"box-link-edit-content-warning-text"],[1,"box-link-edit-content-tool"],["type","button","aria-label","disable shop link name",1,"btn-outline-black","mr-2",3,"click","mousedown"],["type","button","aria-label","update shop link name",1,"btn-black","box-link-edit-confirm-btn",3,"disabled","click","mousedown"],["class","amway-input-error alert_error",4,"ngIf"],[1,"aw-md-full-sub-title","mt-3"],[1,"amway-textarea-area","my-3",3,"ngClass"],["row","6","autocomplete","off","formControlName","aboutOwner",1,"amway-textarea",3,"placeholder"],[4,"ngIf"],[1,"aw-info-content"],[1,"amway-info-label"],[1,"amway-info-label-title"],[1,"text-optional"],[1,"social-info-content-box"],[1,"social-info-box"],[1,"social-info-box-icon","line"],[1,"social-info-box-input"],[1,"amway-info-input-area",3,"ngClass"],["type","text","formControlName","lineLink","autocomplete","off","maxlength","25",1,"amway-info-input",3,"placeholder"],[1,"social-info-box-icon","facebook"],["type","text","formControlName","facebookLink","autocomplete","off","maxlength","25",1,"amway-info-input",3,"placeholder"],[1,"social-info-box-icon","ig"],["type","text","formControlName","instagramLink","autocomplete","off","maxlength","25",1,"amway-info-input",3,"placeholder"],[1,"social-info-box-icon","twitter"],["type","text","formControlName","twitterLink","autocomplete","off","maxlength","25",1,"amway-info-input",3,"placeholder"],[1,"social-info-box-icon","youtube"],["type","text","formControlName","youtubeLink","autocomplete","off","maxlength","25",1,"amway-info-input",3,"placeholder"],[1,"social-info-box-icon","tiktok"],["type","text","formControlName","tiktokLink","autocomplete","off","maxlength","25",1,"amway-info-input",3,"placeholder"],[1,"social-info-box-icon","phone"],["type","text","formControlName","phoneNumber","autocomplete","off",1,"amway-info-input",3,"placeholder","keyup"],[1,"social-info-box-icon","email"],["type","text","formControlName","email","autocomplete","off",1,"amway-info-input",3,"placeholder"],[1,"aw-footer-bar","padding-space-on-mb","editinfoprofile-footer"],["type","button",1,"btn-outlin-black","btn-h48","box-link-edit-btn-main-submit",3,"click"],["type","submit","aria-label","save shop info",1,"btn-black","btn-h48","confirm","box-link-edit-btn-main-submit",3,"disabled"],[3,"visible","cover"],["id","url-status",1,"amway-info-url-status"],[1,"amway-info-url-status-state","available",3,"ngClass"],[1,"amway-info-url-status-state-icon"],[1,"amway-info-url-status-state-text"],[1,"amway-info-url-status-state","unavailable",3,"ngClass"],[1,"amway-input-error","alert_error"],[1,"social-list"],[1,"social-list-img",2,"background","url('./assets/image/icon/icon_social/line-min.svg')"],[1,"social-list-input"],[1,"amway-input-area",3,"ngClass"],["type","text","name","line","id","line","formControlName","lineLink","autocomplete","off",1,"amway-input",3,"placeholder"],[1,"social-list-img",2,"background","url('./assets/image/icon/icon_social/facebook.svg')"],["type","text","name","facebook","id","facebook","formControlName","facebookLink","autocomplete","off",1,"amway-input",3,"placeholder"],[1,"social-list","mb-3"],[1,"social-list-img",2,"background","url('./assets/image/icon/icon_social/instagram.svg')"],["type","text","name","Instagram","id","Instagram","formControlName","instagramLink","autocomplete","off",1,"amway-input",3,"placeholder"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"div",1),w.ac("click",function(){return e.closeModal()}),w.Sb(),w.Tb(2,"form",2),w.ac("ngSubmit",function(){return e.saveChanges()}),w.Tb(3,"div",3),w.Tb(4,"div",4),w.Tb(5,"div",5),w.ac("click",function(){return e.closeModal()}),w.Sb(),w.Tb(6,"div",6),w.Bc(7),w.dc(8,"translate"),w.Sb(),w.Sb(),w.Tb(9,"div",7),w.Tb(10,"div",8),w.Tb(11,"div",9),w.Bc(12),w.dc(13,"translate"),w.Tb(14,"span",10),w.Bc(15),w.dc(16,"translate"),w.Sb(),w.Sb(),w.Tb(17,"div",11),w.Bc(18),w.dc(19,"translate"),w.Sb(),w.Tb(20,"div",12),w.Ob(21,"input",13),w.dc(22,"translate"),w.Sb(),w.Tb(23,"div",9),w.Bc(24),w.dc(25,"translate"),w.Tb(26,"span",10),w.Bc(27),w.dc(28,"translate"),w.Sb(),w.Sb(),w.Tb(29,"div",11),w.Bc(30),w.dc(31,"translate"),w.Sb(),w.Tb(32,"div",14),w.Tb(33,"div",15),w.Tb(34,"div",16),w.Tb(35,"div",17),w.Bc(36,"amway.co.th/MyList/"),w.Sb(),w.Tb(37,"div",18),w.Tb(38,"p"),w.Bc(39),w.Sb(),w.Sb(),w.Tb(40,"input",19),w.ac("blur",function(){return e.isLinkNameAvailable()}),w.dc(41,"translate"),w.Sb(),w.Tb(42,"button",20),w.ac("click",function(){return e.showEditLinkName()})("mousedown",function(t){return t.preventDefault()}),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Tb(43,"div",21),w.zc(44,oe,11,12,"div",22),w.Tb(45,"div",23),w.Ob(46,"div",24),w.Tb(47,"div",25),w.Bc(48),w.dc(49,"translate"),w.Sb(),w.Sb(),w.Tb(50,"div",26),w.Tb(51,"button",27),w.ac("click",function(){return e.closeEditLinkName()})("mousedown",function(t){return t.preventDefault()}),w.Bc(52),w.dc(53,"translate"),w.Sb(),w.Tb(54,"button",28),w.ac("click",function(){return e.updateLinkName()})("mousedown",function(t){return t.preventDefault()}),w.Bc(55),w.dc(56,"translate"),w.Sb(),w.Sb(),w.Sb(),w.zc(57,ae,3,3,"div",29),w.Tb(58,"div",30),w.Bc(59),w.dc(60,"translate"),w.Sb(),w.Tb(61,"div",31),w.Ob(62,"textarea",32),w.dc(63,"translate"),w.Sb(),w.zc(64,ne,22,21,"ng-container",33),w.Tb(65,"div",34),w.Tb(66,"div",35),w.Tb(67,"div",36),w.Bc(68),w.dc(69,"translate"),w.Tb(70,"span",37),w.Bc(71),w.dc(72,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(73,"div",38),w.Tb(74,"div",39),w.Ob(75,"div",40),w.Tb(76,"div",41),w.Tb(77,"div",42),w.Ob(78,"input",43),w.dc(79,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(80,"div",39),w.Ob(81,"div",44),w.Tb(82,"div",41),w.Tb(83,"div",42),w.Ob(84,"input",45),w.dc(85,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(86,"div",39),w.Ob(87,"div",46),w.Tb(88,"div",41),w.Tb(89,"div",42),w.Ob(90,"input",47),w.dc(91,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(92,"div",39),w.Ob(93,"div",48),w.Tb(94,"div",41),w.Tb(95,"div",42),w.Ob(96,"input",49),w.dc(97,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(98,"div",39),w.Ob(99,"div",50),w.Tb(100,"div",41),w.Tb(101,"div",42),w.Ob(102,"input",51),w.dc(103,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(104,"div",39),w.Ob(105,"div",52),w.Tb(106,"div",41),w.Tb(107,"div",42),w.Ob(108,"input",53),w.dc(109,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Tb(110,"div",34),w.Tb(111,"div",35),w.Tb(112,"div",36),w.Bc(113),w.dc(114,"translate"),w.Tb(115,"span",37),w.Bc(116),w.dc(117,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Tb(118,"div",38),w.Tb(119,"div",39),w.Ob(120,"div",54),w.Tb(121,"div",41),w.Tb(122,"div",42),w.Tb(123,"input",55),w.ac("keyup",function(t){return e.formatPhoneNumber(t)}),w.dc(124,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Tb(125,"div",39),w.Ob(126,"div",56),w.Tb(127,"div",41),w.Tb(128,"div",42),w.Ob(129,"input",57),w.dc(130,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Sb(),w.Tb(131,"div",58),w.Tb(132,"button",59),w.ac("click",function(){return e.closeModal(),e.closeEditLinkName()}),w.Bc(133),w.dc(134,"translate"),w.Sb(),w.Tb(135,"button",60),w.Bc(136),w.dc(137,"translate"),w.Sb(),w.Sb(),w.Sb(),w.Ob(138,"app-loader",61),w.dc(139,"async"),w.Sb(),w.Sb()),2&t&&(w.gc("ngClass",w.lc(111,ce,e.open)),w.Ab(2),w.gc("formGroup",e.shopForm),w.Ab(5),w.Cc(w.ec(8,53,"EDIT_SHOP_INFO.edit_information")),w.Ab(5),w.Dc("",w.ec(13,55,"EDIT_SHOP_INFO.shop_name")," "),w.Ab(3),w.Cc(w.ec(16,57,"EDIT_SHOP_INFO.required")),w.Ab(3),w.Cc(w.ec(19,59,"EDIT_SHOP_INFO.shop_name_sub_text")),w.Ab(2),w.gc("ngClass",w.lc(113,se,e.shopForm.get("shopName").invalid)),w.Ab(1),w.hc("placeholder",w.ec(22,61,"EDIT_SHOP_INFO.shop_name_placeholder")),w.Ab(3),w.Dc("",w.ec(25,63,"EDIT_SHOP_INFO.link_name")," "),w.Ab(3),w.Cc(w.ec(28,65,"EDIT_SHOP_INFO.required")),w.Ab(3),w.Cc(w.ec(31,67,"EDIT_SHOP_INFO.link_name_sub_text")),w.Ab(4),w.gc("ngClass",w.mc(115,le,e.isLinkEditable&&e.shopForm.get("shopUid").invalid||e.isDuplicateShopLinkName,!e.isLinkEditable)),w.Ab(5),w.Cc(e.shopForm.get("shopUid").value),w.Ab(1),w.hc("placeholder",w.ec(41,69,"EDIT_SHOP_INFO.link_name_placeholder")),w.gc("readonly",!e.isLinkEditable)("disabled",!e.isLinkEditable)("maxlength",e.isLinkEditable?20:null),w.Ab(3),w.gc("ngClass",w.lc(118,re,e.isLinkEditable)),w.Ab(1),w.gc("ngIf",e.showLinkAvailabilityMsg),w.Ab(4),w.Dc(" ",w.ec(49,71,"EDIT_SHOP_INFO.shop_name_edit_msg")," "),w.Ab(4),w.Cc(w.ec(53,73,"COMMON.cancel")),w.Ab(2),w.gc("disabled",!e.isLinkAvailable),w.Ab(1),w.Cc(w.ec(56,75,"COMMON.save")),w.Ab(2),w.gc("ngIf",e.isDuplicateShopLinkName),w.Ab(2),w.Cc(w.ec(60,77,"EDIT_SHOP_INFO.about_you")),w.Ab(2),w.gc("ngClass",w.lc(120,se,e.shopForm.get("aboutOwner").invalid)),w.Ab(1),w.hc("placeholder",w.ec(63,79,"EDIT_SHOP_INFO.about_you_placeholder")),w.Ab(2),w.gc("ngIf",!1),w.Ab(4),w.Dc(" ",w.ec(69,81,"EDIT_SHOP_INFO.follow_at")," "),w.Ab(3),w.Dc("(",w.ec(72,83,"EDIT_SHOP_INFO.optional"),")"),w.Ab(6),w.gc("ngClass",w.lc(122,se,e.shopForm.get("lineLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(79,85,"EDIT_SHOP_INFO.line_id_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(124,se,e.shopForm.get("facebookLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(85,87,"EDIT_SHOP_INFO.facebook_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(126,se,e.shopForm.get("instagramLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(91,89,"EDIT_SHOP_INFO.instagram_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(128,se,e.shopForm.get("twitterLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(97,91,"EDIT_SHOP_INFO.twitter_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(130,se,e.shopForm.get("youtubeLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(103,93,"EDIT_SHOP_INFO.youtube_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(132,se,e.shopForm.get("tiktokLink").invalid)),w.Ab(1),w.hc("placeholder",w.ec(109,95,"EDIT_SHOP_INFO.tiktok_placeholder")),w.Ab(5),w.Dc(" ",w.ec(114,97,"EDIT_SHOP_INFO.contact_info")," "),w.Ab(3),w.Dc("(",w.ec(117,99,"EDIT_SHOP_INFO.optional"),")"),w.Ab(6),w.gc("ngClass",w.lc(134,se,e.shopForm.get("phoneNumber").invalid)),w.Ab(1),w.hc("placeholder",w.ec(124,101,"EDIT_SHOP_INFO.phone_number_placeholder")),w.Ab(5),w.gc("ngClass",w.lc(136,se,e.shopForm.get("email").invalid)),w.Ab(1),w.hc("placeholder",w.ec(130,103,"EDIT_SHOP_INFO.email_placeholder")),w.Ab(4),w.Cc(w.ec(134,105,"EDIT_SHOP_INFO.cancel")),w.Ab(2),w.gc("disabled",!e.isLinkAvailable),w.Ab(1),w.Cc(w.ec(137,107,"EDIT_SHOP_INFO.save")),w.Ab(2),w.gc("visible",w.ec(139,109,e.loading$))("cover",!0))},directives:[U.j,Zt.q,Zt.j,Zt.e,Zt.b,Zt.i,Zt.d,Zt.g,U.l,F.a],pipes:[o.c,U.b],styles:[""],changeDetection:0}),Object(f.a)([Object(a.c)(r.a.getShopInfo)],t.prototype,"shopInfo$",void 0),Object(f.a)([Object(a.c)(r.a.getLoader)],t.prototype,"loading$",void 0),Object(f.a)([Object(a.c)(r.a.isShopUidAvailable)],t.prototype,"isShopUidAvailable$",void 0),t})();const be=["croppie"],pe=function(t){return{active:t}};let he=(()=>{class t{constructor(t,e,i){this.uihelper=t,this.message=e,this.store=i,this.closeModalEvent=new w.n,this.isModalClass=!1}ngOnInit(){this.addCroppieScript()}ngOnChanges(t){t&&t.open&&(this.applyModalClass(),this.open&&this.setInitialProfileImage())}applyModalClass(){this.open?(this.isModalClass=this.uihelper.isModalClassApplied(),this.isModalClass||this.uihelper.onInitPopup()):this.isModalClass||this.uihelper.onClosePopup()}addCroppieScript(){if(document.getElementById("croppie-jssdk"))this.initCropImage();else{const t=document.createElement("script");t.id="croppie-jssdk",t.src="https://cdnjs.cloudflare.com/ajax/libs/croppie/2.6.5/croppie.min.js",t.async=!0,t.defer=!0,document.body.appendChild(t),t.onload=()=>{this.initCropImage()}}}initCropImage(){const t=document.getElementById("profile-cropper");this.vanilla=new window.Croppie(t,{viewport:{width:250,height:250,type:"circle"},showZoomer:!0,enableOrientation:!0,setZoom:()=>{this.zoomIt()}});const e=document.getElementsByClassName("cr-slider")[0];e.className="cr-slider-mod",e.id="cr-slider-mod",e.addEventListener("change",t=>{this.zoomIt()}),e.addEventListener("mousemove",t=>{this.zoomIt()}),e.addEventListener("touchmove",t=>{this.zoomIt()}),this.setInitialProfileImage()}setInitialProfileImage(){this.shopProfileUrl&&(this.vanilla.bind({url:this.shopProfileUrl}),this.zoomIt())}readFile(t){if(t.files&&t.files[0])if(["image/png","image/jpeg","image/jpg"].indexOf(t.files[0].type)>-1){const e=new FileReader;e.onload=t=>{this.vanilla.bind({url:t.target.result})},e.readAsDataURL(t.files[0])}else this.message.showError({message:"only PNG, JPG or JPEG file accepted, please upload valid image file!"})}zoomIt(){const t=document.getElementById("cr-slider-mod"),e=parseFloat(t.getAttribute("aria-valuenow")),i=parseFloat(t.getAttribute("min")),o=(e-i)/(parseFloat(t.getAttribute("max"))-i),a=isNaN(100*o)?0:100*o;t.style.backgroundImage="-webkit-gradient(linear, left top, right top, color-stop("+a+"%, #2C2C2C), color-stop("+a+"%, #9EA0A3))"}rotateImage(t){const e=t.target.getAttribute("data-deg");this.vanilla.rotate(parseInt(e,10))}saveImage(){this.vanilla.result("blob").then(t=>{this.store.dispatch(new A.f({shopId:this.shopUid,file:t})),this.closeModal()})}closeModal(){this.closeModalEvent.emit(!1)}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(O.a),w.Nb(q.a),w.Nb(a.f))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-edit-profile-image"]],viewQuery:function(t,e){if(1&t&&w.Hc(be,!0),2&t){let t;w.qc(t=w.bc())&&(e.croppie=t.first)}},inputs:{open:"open",shopUid:"shopUid",shopProfileUrl:"shopProfileUrl"},outputs:{closeModalEvent:"closeModalEvent"},features:[w.yb],decls:21,vars:12,consts:[["id","editProfileImg",1,"amway-modal-fullPageOnMb",3,"ngClass"],[1,"bg-modal",3,"click"],[1,"amway-modal-content-fullpage-onMb","choose-image-profile"],[1,"aw-header-bar"],[1,"aw-header-bar-btn-back",3,"click"],[1,"aw-header-bar-title"],[1,"aw-for-scroll"],[1,"content-create-wl"],["id","profile-cropper",1,"profile-cropper"],["data-deg","-90",1,"btn-rotate",3,"click"],[1,"aw-footer-bar","min-btn-onMb","editprofile-footer"],[1,"btn-outlin-black","btn-h40","mr-3","actionUpload"],["type","file","id","upload","value","Choose Image","accept","image/png,image/jpg,image/jpeg",3,"change"],[1,"btn-black","btn-h40",3,"click"],["id","displayImgPrev"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"div",1),w.ac("click",function(){return e.closeModal()}),w.Sb(),w.Tb(2,"div",2),w.Tb(3,"div",3),w.Tb(4,"div",4),w.ac("click",function(){return e.closeModal()}),w.Sb(),w.Tb(5,"div",5),w.Bc(6),w.dc(7,"translate"),w.Sb(),w.Sb(),w.Tb(8,"div",6),w.Tb(9,"div",7),w.Ob(10,"div",8),w.Tb(11,"button",9),w.ac("click",function(t){return e.rotateImage(t)}),w.Sb(),w.Sb(),w.Sb(),w.Tb(12,"div",10),w.Tb(13,"a",11),w.Tb(14,"input",12),w.ac("change",function(t){return e.readFile(t.target)}),w.Sb(),w.Bc(15),w.dc(16,"translate"),w.Sb(),w.Tb(17,"button",13),w.ac("click",function(){return e.saveImage()}),w.Bc(18),w.dc(19,"translate"),w.Sb(),w.Sb(),w.Ob(20,"div",14),w.Sb(),w.Sb()),2&t&&(w.gc("ngClass",w.lc(10,pe,e.open)),w.Ab(6),w.Cc(w.ec(7,4,"EDIT_PROFILE_IMAGE.profile_picture")),w.Ab(9),w.Dc(" ",w.ec(16,6,"EDIT_PROFILE_IMAGE.upload_pictures"),""),w.Ab(3),w.Dc(" ",w.ec(19,8,"EDIT_PROFILE_IMAGE.record"),""))},directives:[U.j],pipes:[o.c],styles:[""]}),t})();function ue(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-edit-shop-info",11),w.ac("closeModalEvent",function(e){return w.tc(t),w.cc().toggleEditShopInfo(e)}),w.Sb()}if(2&t){const t=w.cc();w.gc("open",t.openEditShopInfoModal)}}function me(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-edit-profile-image",12),w.ac("closeModalEvent",function(e){return w.tc(t),w.cc().toggleShopProfileImage(e)}),w.dc(1,"async"),w.Sb()}if(2&t){const t=w.cc();let e=null;w.gc("open",t.openShopProfileImageModal)("shopProfileUrl",null==(e=w.ec(1,3,t.shop$))||null==e.profilePicture?null:e.profilePicture.downloadUrl)("shopUid",t.shopUid)}}function fe(t,e){if(1&t){const t=w.Ub();w.Tb(0,"app-email",13),w.ac("closeModalEvent",function(e){return w.tc(t),w.cc().toggleEmailModal(e)}),w.dc(1,"async"),w.Sb()}if(2&t){const t=w.cc();w.gc("shopInfo",w.ec(1,1,t.shop$))}}const ge=[{path:"",resolve:{shopInfo:m.a},component:(()=>{class t{constructor(t,e,i,o,a,s,n,c){this.router=t,this.route=e,this.store=i,this.uiHelper=o,this.metadataService=a,this.headerService=s,this.config=c,this.subscriptions=new g.a,this.openEditShopInfoModal=!1,this.openShopProfileImageModal=!1,this.currentPage=0,this.numberOfPages=0,this.shopUid="",this.isShareShopModalOpen=!1,this.openEmailModal=!1,n.removePreviousStyles(),this.shoplistScrollCallback=this.handleScrollEvent.bind(this)}ngOnInit(){this.metadataService.removeMetadata(),this.subscribeForRouteParams(),this.subscribeForUpdatedShopUid(),this.getRouteData(),this.subscribeForNumberOfPages()}subscribeForRouteParams(){this.subscriptions.add(this.route.params.subscribe(t=>{this.shopUid=t.shopUid?t.shopUid:this.shopUid,this.loadShopData(t.shopUid)}))}subscribeForUpdatedShopUid(){this.subscriptions.add(this.updatedShopUid$.subscribe(t=>{t&&this.uiHelper.refreshPage(t)}))}subscribeForNumberOfPages(){this.subscriptions.add(this.numbeOfPages$.subscribe(t=>{this.numberOfPages=t}))}handleScrollEvent(){return this.currentPage+1<this.numberOfPages?(this.currentPage++,this.scrollObservable=this.store.dispatch(new E.h(this.shopUid,this.currentPage))):this.scrollObservable=new v.a(t=>{t.next(""),t.complete()}),this.scrollObservable}loadShopData(t){t&&(this.store.dispatch(new A.b(t)),this.store.dispatch(new E.h(t,this.currentPage)),this.store.dispatch(new I.a),this.store.dispatch(new L.a),this.subscriptions.add(this.detectError$.subscribe(t=>{t&&400===t.status&&(this.uiHelper.setAppTitle(),this.router.navigateByUrl(k.a.NO_CONTENT))})),this.subscriptions.add(this.shop$.subscribe(()=>this.uiHelper.setShopnameAppTitle())),this.uiHelper.roleUpdate(!0))}getRouteData(){this.subscriptions.add(this.route.data.subscribe(t=>{t&&(null!=t.showCartIcon&&(t.showCartIcon&&this.uiHelper.doesCartExist()&&this.store.dispatch(new T.e),this.headerService.showCartIcon$.next(t.showCartIcon)),null!=t.applyVDClass&&this.headerService.applyVDClass$.next(t.applyVDClass),null!=t.showHomeIcon&&this.headerService.showHomeIcon$.next(t.showHomeIcon))}))}toggleEditShopInfo(t){this.openEditShopInfoModal=t}toggleShopProfileImage(t){this.openShopProfileImageModal=t}openShareShopModal(){this.isShareShopModalOpen=!0}closeShareShopModal(){this.isShareShopModalOpen=!1}toggleEmailModal(t){this.openEmailModal=t}ngOnDestroy(){this.store.dispatch(new E.g),this.scrollObservable=null,this.subscriptions.unsubscribe(),this.headerService.showCartIcon$.next(!1),this.headerService.applyVDClass$.next(!0),this.headerService.showHomeIcon$.next(!1)}}return t.\u0275fac=function(e){return new(e||t)(w.Nb(u.g),w.Nb(u.a),w.Nb(a.f),w.Nb(O.a),w.Nb(y.a),w.Nb(M.a),w.Nb(C.a),w.Nb(S.a))},t.\u0275cmp=w.Hb({type:t,selectors:[["app-shop-landing-page"]],decls:14,vars:11,consts:[[1,"amway-main-layout","step-creator"],[1,"amway-main-layout__content"],[1,"amway-header-creator","d-none"],["aria-label","back icon",1,"ah-back","active"],[1,"ah-creator"],[3,"editShopEvent","editProfileImageEvent","openShareShopModalEvent"],["appInfiniteScroller","","scrollPerecnt","70",3,"scrollCallback"],[3,"open","closeModalEvent",4,"appRole"],[3,"open","shopProfileUrl","shopUid","closeModalEvent",4,"appRole"],[3,"open","shopInfo","sendEmailEvent","closeModalEvent"],[3,"shopInfo","closeModalEvent",4,"ngIf"],[3,"open","closeModalEvent"],[3,"open","shopProfileUrl","shopUid","closeModalEvent"],[3,"shopInfo","closeModalEvent"]],template:function(t,e){1&t&&(w.Tb(0,"div",0),w.Tb(1,"div",1),w.Tb(2,"div",2),w.Ob(3,"a",3),w.Tb(4,"div",4),w.Bc(5),w.dc(6,"translate"),w.Sb(),w.Sb(),w.Tb(7,"app-shop-banner",5),w.ac("editShopEvent",function(t){return e.toggleEditShopInfo(t)})("editProfileImageEvent",function(t){return e.toggleShopProfileImage(t)})("openShareShopModalEvent",function(){return e.openShareShopModal()}),w.Sb(),w.Ob(8,"app-shop-content",6),w.Sb(),w.Sb(),w.zc(9,ue,1,1,"app-edit-shop-info",7),w.zc(10,me,2,5,"app-edit-profile-image",8),w.Tb(11,"app-sharebar",9),w.ac("sendEmailEvent",function(t){return e.toggleEmailModal(t)})("closeModalEvent",function(){return e.closeShareShopModal()}),w.dc(12,"async"),w.Sb(),w.zc(13,fe,2,3,"app-email",10)),2&t&&(w.Ab(5),w.Cc(w.ec(6,7,"CHECKOUT_JOURNEY.create_my_shop")),w.Ab(3),w.gc("scrollCallback",e.shoplistScrollCallback),w.Ab(1),w.gc("appRole","shopOwner"),w.Ab(1),w.gc("appRole","shopOwner"),w.Ab(1),w.gc("open",e.isShareShopModalOpen)("shopInfo",w.ec(12,9,e.shop$)),w.Ab(2),w.gc("ngIf",e.openEmailModal))},directives:[j,Xt,Yt.a,D.a,it.a,U.l,de,he,ot.a],pipes:[o.c,U.b],styles:[""],changeDetection:0}),Object(f.a)([Object(a.c)(r.a.getShopInfo)],t.prototype,"shop$",void 0),Object(f.a)([Object(a.c)(d.a.getNumberOfPages)],t.prototype,"numbeOfPages$",void 0),Object(f.a)([Object(a.c)(r.a.detectError)],t.prototype,"detectError$",void 0),Object(f.a)([Object(a.c)(r.a.getUpdatedShopUid)],t.prototype,"updatedShopUid$",void 0),t})(),data:{showCartIcon:!0,applyVDClass:!1,showHomeIcon:!0}}];let ve=(()=>{class t{}return t.\u0275mod=w.Lb({type:t}),t.\u0275inj=w.Kb({factory:function(e){return new(e||t)},imports:[[u.i.forChild(ge)],u.i]}),t})(),Se=(()=>{class t{}return t.\u0275mod=w.Lb({type:t}),t.\u0275inj=w.Kb({factory:function(e){return new(e||t)},providers:[],imports:[[ve,s.a,o.b.forChild(),a.b.forFeature([r.a,d.a,p.a,n.a,h.a,l.a,c.a,b.a])]]}),t})()}}]);