var NineYi;(function(n){var t;(function(t){var i;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d){var g,nt,it,tt;v===void 0&&(v=[]);g=this;this.$scope=t;this.$element=i;this.$log=r;this.$window=u;this.$location=f;this.$cookies=e;this.OfficialShopProfile=o;this.FreezeBodyUtility=s;this.MainMenuUtility=h;this.UrlUtility=c;this.GoogleAnalyticsUtility=l;this.CurrentLocale=a;this.AvailableLanguages=v;this.EnableLanguageSwitcher=y;this.CurrencyCode=p;this.AvailableCurrencies=w;this.EnableCurrencySwitcher=b;this.market=k;this.shopId=d;this.isUseAccurateComparison=null;this.checkIsDefaultUseAccurateComparison=function(){var t=window.nineyi&&window.nineyi.env||undefined,n=t==="Dev"||t==="QA";return n&&g.market==="TW"&&g.shopId===225||!n&&g.market==="TW"&&g.shopId===2131||!n&&g.market==="TW"&&g.shopId===40259};nt=this.$element[0];typeof this.OfficialShopProfile!="undefined"&&typeof nt!="undefined"?this.OfficialShopProfile.BrowserMode===n.WebStore.Frontend.BE.Device.DeviceModeEnum.Mobile&&(it=nt.querySelector("#layout-header"),tt=it.getAttribute("data-effect-css-class"),this.$scope.$watch(function(){return g.FreezeBodyUtility.IsFreeze},function(n){n&&nt.classList.contains(tt)&&nt.classList.remove(tt)})):this.$log.error("OfficialShopProfile is undefined");this.SelectedLanguage=v.filter(function(n){return n.Lang===a})[0];this.SelectedCurrency=w.filter(function(n){return n.code===p})[0];this.isDefaultUseAccurateComparison=this.checkIsDefaultUseAccurateComparison()}return t.prototype.OpenMenu=function(n){this.MainMenuUtility.Open(n)},t.prototype.ChangeLanguage=function(n){n.Lang!==this.CurrentLocale&&(this.GoogleAnalyticsUtility.TrackEvent("Language","select_content","("+n.Lang+")"+n.Display),this.SelectedLanguage=n,window.location.href=this.UrlUtility.AppendParameter(window.location.href,"lang",n.Lang))},t.prototype.ChangeCurrency=function(n){n.code!==this.CurrencyCode&&(this.GoogleAnalyticsUtility.TrackEvent("Currency","select_content","("+n.code+")"+n.display),this.SelectedCurrency=n,this.$cookies.put("currency",n.code,{path:"/"}),this.$window.location.reload())},t.prototype.TrackLanguageCurrencyView=function(n,t,i){var r=i;this.GoogleAnalyticsUtility.TrackEvent(n,t,i)},t.$inject=["$scope","$element","$log","$window","$location","$cookies","OfficialShopProfile","FreezeBodyUtility","MainMenuUtility","UrlUtility","GoogleAnalyticsUtility","CurrentLocale","AvailableLanguages","EnableLanguageSwitcher","CurrencyCode","AvailableCurrencies","EnableCurrencySwitcher","Market","ShopId"],t}();t.HeaderController=i;angular.module("NineYi.Mall.Controllers").controller("HeaderController",i)})(i=t.Controllers||(t.Controllers={}))})(t=n.Mall||(n.Mall={}))})(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y){this.shopId=n;this.$scope=t;this.$log=i;this.DeviceValue=r;this.$window=u;this.$timeout=f;this.$translate=e;this.activityService=o;this.OfficialOriginDomain=s;this.CmsShopInfo=h;this.CmsServiceImmediate=c;this.CmsService=l;this.CmsThemeUtility=a;this.OfficialShopProfile=v;this.ActivityServiceImmediate=y;e.onReady(this.Init.bind(this))}return t.prototype.Init=function(){var t=this;this.CmsShopInfo&&this.CmsShopInfo.EnableCms&&this.OfficialShopProfile.BrowserMode===n.WebStore.Frontend.BE.Device.DeviceModeEnum.Desktop?this.CmsServiceImmediate.GetCmsThemePromise.then(function(n){n&&(t.ActivityMenuSwitch=!!t.CmsThemeUtility.GetActivityMenuSwitch(n),t.ActivityMenuSwitch&&t.GetActivityList(),t.ActivityMenuTitle=t.CmsThemeUtility.GetActivityMenu(n).title||t.$translate.instant("frontend.typescripts.shared.latest_events"))}):(this.GetActivityList(),this.ActivityMenuTitle=this.$translate.instant("frontend.typescripts.shared.latest_events"))},t.prototype.GetActivityList=function(){var n=this;this.$log.info("Get ActivityList - start");this.ActivityServiceImmediate.GetActivityList(this.shopId).then(function(t){(n.ActivityMenuSwitch=n.CmsShopInfo&&n.CmsShopInfo.EnableCms?n.ActivityMenuSwitch&&t.length>0:t.length>0,t.length!==0)&&(n.ActivityList=t.map(function(t){return t.Activity_Url=n.OfficialOriginDomain+"/v2/activity/"+t.Activity_Id+"?layout=official",t}),n.$log.info("Get ActivityList - Finish"))})},t.$inject=["ShopId","$scope","$log","DeviceValue","$window","$timeout","$translate","ActivityService","OfficialOriginDomain","CmsShopInfo","CmsServiceImmediate","CmsService","CmsThemeUtility","OfficialShopProfile","ActivityServiceImmediate"],t}();t.HeaderActivityController=i;angular.module("NineYi.Theme.Components").controller("HeaderActivityController",i)})(i=t.Controllers||(t.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(t,i,r,u,f,e,o,s,h,c){var l=this;this.$scope=t;this.$log=i;this.$window=r;this.shopId=u;this.shopService=f;this.OfficialServiceImmediate=e;this.OfficialShopProfile=o;this.CmsShopInfo=s;this.CmsServiceImmediate=h;this.CmsThemeUtility=c;this.ShowBars=!1;this.FreeGiftList=[];this.IsOpendMenu=!1;this.CmsShopInfo&&this.CmsShopInfo.EnableCms&&this.OfficialShopProfile.BrowserMode===n.WebStore.Frontend.BE.Device.DeviceModeEnum.Desktop?this.CmsServiceImmediate.GetCmsThemePromise.then(function(n){l.$log.debug("取得CMS Theme Config",n);n&&(l.CategoryMenuSwitch=l.CmsThemeUtility.GetCategoryMenuSwitch(n),l.CategoryMenuSwitch&&(l.InitialProductCategoryList(),l.InitialPromotionList()))}):(this.CategoryMenuSwitch=!0,this.InitialProductCategoryList(),this.InitialPromotionList())}return t.prototype.InitialPromotionList=function(){var n=this;this.IsLoadedPromotionList=!1;this.OfficialServiceImmediate.GetOfficialPromotionTargetListPromise.then(function(t){for(var u,r,i=0;i<=t.length-1;i++)if(u=t[i].ConditionDiscountTypeDef,t[i].Targets.length>0&&u==="FreeGift")for(r=0;r<=t[i].Targets.length-1;r++)n.FreeGiftList.push(t[i].Targets[r]);n.IsLoadedPromotionList=!0})},t.prototype.InitialProductCategoryList=function(){var n=this;this.shopService.GetProductCategoryList(this.shopId).then(function(t){typeof t!="undefined"&&(n.ShopCategoryListInfo=t)})},t.$inject=["$scope","$log","$window","ShopId","ShopService","OfficialServiceImmediate","OfficialShopProfile","CmsShopInfo","CmsServiceImmediate","CmsThemeUtility"],t}();t.HeaderCategoryMenuController=i;angular.module("NineYi.Mall.Controllers").controller("HeaderCategoryMenuController",i)})(i=t.Controllers||(t.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n,t,i,r,u,f,e,o,s,h,c){var l=this;this.value=n;this.$scope=t;this.$log=i;this.$window=r;this.$translate=u;this.shopId=f;this.officialService=e;this.appDownloadUtility=o;this.DialogUtility=s;this.LocalizationConfig=h;this.DefaultCountry=c;this.ShowTouchDownloadApp=!1;this.IsFocusInput=!1;this.IsTouchDevice=n.isTouchDevice;this.$translate.onReady(function(){switch(l.DefaultCountry){case"TW":l.CellPhonePlaceholder=l.$translate.instant("frontend.typescripts.shared.mobile_number_TW");break;default:l.CellPhonePlaceholder=l.$translate.instant("frontend.typescripts.shared.mobile_number")}})}return t.prototype.SendDownloadMessage=function(t){t.stopPropagation();var i=this.LocalizationConfig.Common.validateCellPhoneNumber?n.Mall.Configs.RegexPattern.Phone:n.Mall.Configs.RegexPattern.NumberOnly;i.test(this.CellPhone)?this.GetAppDownLoadLink():this.DialogUtility.Notice(this.$translate.instant("frontend.typescripts.components.invalid_mobile_number"));this.ShowTouchDownloadApp=!1;this.IsFocusInput=!1},t.prototype.GetAppDownLoadLink=function(){var n=this;this.$log.info("Get AppDownLoadLink - Start");this.officialService.GetAppDownLoadLink(this.shopId,this.CellPhone).then(function(t){n.$log.info("Get AppDownLoadLink - End");n.appDownloadUtility.ShowDownloadLinkResult(n.CellPhone,t.ReturnCode);n.CellPhone=""})},t.$inject=["Mall.Value","$scope","$log","$window","$translate","ShopId","OfficialService","AppDownloadUtility","DialogUtility","LocalizationConfig","DefaultCountry"],t}();t.HeaderDownloadAppController=i;angular.module("NineYi.Theme.Components").controller("HeaderDownloadAppController",i)})(i=t.Controllers||(t.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v){var y=this;this.shopId=n;this.$rootScope=t;this.value=i;this.$scope=r;this.$log=u;this.$window=f;this.$translate=e;this.authService=o;this.AuthServiceImmediate=s;this.VipMemberService=h;this.googleAnalyticsUtility=c;this.dialogUtility=l;this.favoriteUtility=a;this.officialOriginDomain=v;this.IsLogin=!1;this.IsTouchDevice=i.isTouchDevice;this.$log.info("Get Auth IsLogin - Start");this.AuthServiceImmediate.IsLoginPromise.then(function(n){y.IsLogin=n;y.$log.info("Get Auth IsLogin - Finish",n)})}return n.prototype.ToggleMyAccountMenu=function(n){n.preventDefault();n.stopPropagation();this.IsShowMyAccountMenu=!this.IsShowMyAccountMenu},n.prototype.TrackEvent=function(n,t,i,r){this.googleAnalyticsUtility.TrackEvent(n,t,i,r)},n.prototype.Login=function(n){n.preventDefault();n.stopPropagation();var t=encodeURIComponent(this.$window.location.href.replace(this.$window.location.hash,""));this.$window.location.href="/Login/HttpLoginRelayToHttps/?rt="+t+"&reason=notlogin"},n.prototype.Logout=function(n){var t=this;n.preventDefault();n.stopPropagation();this.authService.Logout().then(function(){t.dialogUtility.AutoCloseNotice(t.$translate.instant("frontend.typescripts.shared.logout_success")).then(function(){t.$window.location.href=t.officialOriginDomain?t.officialOriginDomain:"/"})})},n.$inject=["ShopId","$rootScope","Mall.Value","$scope","$log","$window","$translate","AuthService","AuthServiceImmediate","VipMemberService","GoogleAnalyticsUtility","DialogUtility","FavoriteUtility","OfficialOriginDomain"],n}();n.HeaderMyAccountController=t;angular.module("NineYi.Mall.Controllers").controller("HeaderMyAccountController",t)})(t=n.Controllers||(n.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u,f,e,o,s,h,c){var l=this;this.$scope=n;this.$rootScope=t;this.$log=i;this.$window=r;this.$timeout=u;this.$translate=f;this.ShopId=e;this.ShoppingCartService=o;this.googleAnalyticsEcommerceUtility=s;this.AdobeAnalyticsUtility=h;this.dialogUtility=c;this.ShoppingCartCount=0;this.RefreshShoppingCartCount();t.$on("RefreshShoppingCartCount",function(){l.$log.info("Event - RefreshShoppingCartCount");l.RefreshShoppingCartCount()})}return n.prototype.RefreshShoppingCartCount=function(){var n=this;this.ShoppingCartService.GetCount(this.ShopId).then(function(t){n.ShoppingCartCount=t;n.ShoppingCartPreviewData=null})},n.prototype.LoadShoppingCartPreview=function(){var n=this;this.ShoppingCartPreviewData||(this.$log.info("Get ShoppingCart Preview - Start",this.ShopId),this.ShoppingCartService.GetPreview(this.ShopId).then(function(t){n.$log.info("Get ShoppingCart Preview - Finish",t);n.ShoppingCartPreviewData=t}))},n.prototype.RemoveFromShoppingCart=function(n,t){var i=this,r=t.PointsPayPair?"PointsPay":"",u=t.PointsPayPair?t.PointsPayPair.PointsPayId:0;this.ShoppingCartService.RemoveItem(this.ShopId,t.SalePageId,t.SaleProductSKUId,t.SalePageGroupSeq,r,u).then(function(){i.ShoppingCartPreviewData.ShopList[0].SalePageList.splice(n,1);i.dialogUtility.AutoCloseNotice(i.$translate.instant("frontend.typescripts.shared.removal_success"));var r={id:t.SalePageId.toString(),name:t.Title,price:t.Price};i.googleAnalyticsEcommerceUtility.RemoveFromCart(r);i.AdobeAnalyticsUtility.RemoveFromCart({id:""+t.SalePageId,name:t.Title,price:t.Price,quantity:t.Qty,sku:""+t.SaleProductSKUId});i.ShoppingCartCount=i.ShoppingCartPreviewData.ShopList[0].SalePageList.length;i.ShoppingCartPreviewData=null;i.LoadShoppingCartPreview()})},n.prototype.CheckOut=function(){this.$window.location.href="/V2/ShoppingCart/Index?shopId="+this.ShopId},n.$inject=["$scope","$rootScope","$log","$window","$timeout","$translate","ShopId","ShoppingCartService","GoogleAnalyticsEcommerceUtility","AdobeAnalyticsUtility","DialogUtility"],n}();n.HeaderShoppingCartController=t;angular.module("NineYi.Theme.Components").controller("HeaderShoppingCartController",t)})(t=n.Controllers||(n.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u,f,e){var o=this;this.$log=n;this.$translate=t;this.LayoutTemplateDataServiceImmediate=i;this.OfficialShopProfile=r;this.CmsShopInfo=u;this.CmsServiceImmediate=f;this.CmsThemeUtility=e;t.onReady(function(){o.CmsShopInfo&&o.CmsShopInfo.EnableCms?o.CmsServiceImmediate.GetCmsThemePromise.then(function(n){if(n)try{var r=o.CmsThemeUtility.GetCustomLinkListMenuSwitch(n),i=o.CmsThemeUtility.GetCustomLinkListMenu(n);r&&i&&i.length>0&&(i.map(function(n){n.text=n.text||t.instant("frontend.typescripts.shared.text_link");n.childList&&n.childList.length>0&&n.childList.map(function(n){n.text=n.text||t.instant("frontend.typescripts.shared.text_link")})}),o.CmsCustomLinks=i)}catch(u){o.GetCustomLinkFromLayoutTemplateData()}}):o.GetCustomLinkFromLayoutTemplateData()})}return n.prototype.GetCustomLinkFromLayoutTemplateData=function(){var n=this;this.LayoutTemplateDataServiceImmediate.GetCustomLinkPromise.then(function(t){n.CustomLinks=t.Data.filter(function(n){return n.Data.length>0});n.$log.debug("取得自訂連結資料CustomLinks"+n.CustomLinks)})},n.$inject=["$log","$translate","LayoutTemplateDataServiceImmediate","OfficialShopProfile","CmsShopInfo","CmsServiceImmediate","CmsThemeUtility"],n}();n.HeaderCustomLinksController=t;angular.module("NineYi.Mall.Controllers").controller("HeaderCustomLinksController",t)})(t=n.Controllers||(n.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n,t,i,r,u,f,e,o,s,h,c){var l=this;this.config=n;this.$rootScope=t;this.$scope=i;this.$log=r;this.$translate=u;this.ShopId=f;this.OfficialService=e;this.appDownloadUtility=o;this.DialogUtility=s;this.LocalizationConfig=h;this.DefaultCountry=c;this.$translate.onReady(function(){switch(l.DefaultCountry){case"TW":l.CellPhonePlaceholder=l.$translate.instant("frontend.typescripts.shared.mobile_number_TW");break;default:l.CellPhonePlaceholder=l.$translate.instant("frontend.typescripts.shared.mobile_number")}})}return t.prototype.sendDownloadMessage=function(t){t.stopPropagation();var i=this.LocalizationConfig.Common.validateCellPhoneNumber?n.Mall.Configs.RegexPattern.Phone:n.Mall.Configs.RegexPattern.NumberOnly;i.test(this.cellphone)?this.GetAppDownLoadLink():this.DialogUtility.Notice(this.$translate.instant("frontend.typescripts.components.invalid_mobile_number"))},t.prototype.GetAppDownLoadLink=function(){var n=this;this.$log.info("Get AppDownLoadLink - Start");this.OfficialService.GetAppDownLoadLink(this.ShopId,this.cellphone).then(function(t){n.$log.info("Get AppDownLoadLink - End");n.appDownloadUtility.ShowDownloadLinkResult(n.cellphone,t.ReturnCode);n.cellphone=""})},t.$inject=["Mall.Config","$rootScope","$scope","$log","$translate","ShopId","OfficialService","AppDownloadUtility","DialogUtility","LocalizationConfig","DefaultCountry"],t}();t.SharedFooterController=i;angular.module("NineYi.Mall.Controllers").controller("SharedFooterController",i)})(i=t.Controllers||(t.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st,ht,ct,lt,at){ut===void 0&&(ut=[]);this.shopId=n;this.$scope=t;this.$log=i;this.$q=r;this.config=u;this.$window=f;this.$translate=e;this.googleAnalyticsUtility=o;this.OfficialServiceImmediate=s;this.shopServiceImmediate=h;this.salePageCategoryId=c;this.UrlUtility=l;this.activityService=a;this.promotionV2ServiceImmediate=v;this.couponServiceImmediate=y;this.eCouponServiceImmediate=p;this.MainMenuUtility=w;this.RefUtility=b;this.PageValue=k;this.OfficialShopProfile=d;this.OfficialOriginDomain=g;this.CmsShopInfo=nt;this.CmsServiceImmediate=tt;this.CmsThemeUtility=it;this.DialogUtility=rt;this.AvailableLanguages=ut;this.CurrentLocale=ft;this.CurrencyCode=et;this.EnableLanguageSwitcher=ot;this.VipMemberService=st;this.AvailableCurrencies=ht;this.EnableCurrencySwitcher=ct;this.DeepLinkService=lt;this.ActivityServiceImmediate=at;this.FreeGiftList=[];e.onReady(this.Init.bind(this))}return t.prototype.Init=function(){var t=this;this.CmsShopInfo&&this.CmsShopInfo.EnableCms&&this.OfficialShopProfile.BrowserMode===n.WebStore.Frontend.BE.Device.DeviceModeEnum.Mobile?this.InitilaCmsCustomListMenu():(this.ActivityMenuCaption=this.$translate.instant("frontend.typescripts.shared.events_and_discounts"),this.ActivityMenuTitle=this.$translate.instant("frontend.typescripts.shared.latest_events"));this.InitialCategoryMenu();this.CurrentLanguage=this.AvailableLanguages.filter(function(n){return n.Lang===t.CurrentLocale})[0];this.HasStoreInfo=this.OfficialShopProfile.StoreTotalCount>0;this.couponServiceImmediate.GetCouponListPromise.then(function(n){t.HasCoupon=n&&n.length>0});this.$scope.$watch(function(){return t.MainMenuUtility.HasOpenmenu},function(n){n&&(t.HasStoreInfo||t.HasCoupon)&&t.GetVipMemberCustomLinkSettings()})},t.prototype.SetActiveLink=function(n,t){this.SimpleMode=!1;var i=this;if(t===this.config.allSalePageCategoryId){n[0].active=!0;return}[].slice.call(n).forEach(function(n){if(+n.ShopCategory_Id==+t){n.active=!0;n.ChildList&&n.ChildList.length>0&&(i.SimpleMode=!0,n.selected=!0);return}n.ChildList&&[].slice.call(n.ChildList).forEach(function(r){if(+r.ShopCategory_Id==+t){r.active=!0;n.selected=!0;i.SimpleMode=!0;return}})})},t.prototype.ToggleCategoryLevel1=function(n){n.selected=!n.selected},t.prototype.ClickCategoryLevel1=function(n){n.ChildList&&n.ChildList.length>0?this.ToggleCategoryLevel1(n):(n.active=!0,this.$window.location.href=this.OfficialOriginDomain+"/v2/official/SalePageCategory/"+n.ShopCategory_Id,this.TrackEvent("全站_Header","Menu","商品分類"))},t.prototype.HasFreeGift=function(n){return this.FreeGiftList.indexOf(n.ShopCategory_Id)>=0},t.prototype.OpenMenu=function(n){this.MainMenuUtility.Open(n)},t.prototype.TrackEvent=function(n,t,i,r){this.googleAnalyticsUtility.TrackEvent(n,t,i,r)},t.prototype.GoToDownloadApp=function(){var n=this,t=this.RefUtility.GetUtmDeeplinkTarget();this.DeepLinkService.GetDeepLink(t).then(function(t){n.$window.location.href=t.Data}).catch(function(){n.$window.location.href=n.RefUtility.ReplaceRefUrl(n.PageValue.CurrentPage)})},t.prototype.CloseMenu=function(){this.MainMenuUtility.Close()},t.prototype.ShowSwitchLanguageModal=function(n){var t=n;this.googleAnalyticsUtility.TrackEvent("Language","click",n);this.DialogUtility.Custom({title:null,model:null,backdrop:!0,templateUrl:"/V2/TypeScripts/Modules/Shared/switchLocaleModal.html",windowClass:"switch-locale__modal",controller:"SwitchLanguageModalController as SwitchLocaleModalCtrl"})},t.prototype.ShowSwitchCurrencyModal=function(n){var t=n;this.googleAnalyticsUtility.TrackEvent("Currency","click",n);this.DialogUtility.Custom({title:null,model:null,backdrop:!0,templateUrl:"/V2/TypeScripts/Modules/Shared/switchLocaleModal.html",windowClass:"switch-locale__modal",controller:"SwitchCurrencyModalController as SwitchLocaleModalCtrl"})},t.prototype.CheckHasDiscountPromotion=function(){var t=this,n=this.$q.defer();return this.HasDiscountPromotion=!1,this.promotionV2ServiceImmediate.GetPromotionListPromise.then(function(i){t.HasDiscountPromotion=i.ReturnCode==="API0001"&&i.Data.PromotionCount>0;n.resolve()}).catch(function(){n.reject()}),n.promise},t.prototype.CheckHasECoupon=function(){var t=this,n=this.$q.defer();return this.eCouponServiceImmediate.GetOfficialECouponListPromise.then(function(i){i&&i[0]&&(t.HasECoupon=i[0].ECouponList.length>0);n.resolve()}).catch(function(){n.reject()}),n.promise},t.prototype.InitialActivityList=function(){var n=this,t=this.$q.defer();return this.$log.info("Get ActivityList - start"),this.ActivityServiceImmediate.GetActivityList(this.shopId).then(function(i){i&&(n.ActivityMenuSwitch=n.CmsShopInfo&&n.CmsShopInfo.EnableCms?n.ActivityMenuSwitch&&i.length>0:i.length>0,n.ActivityList=i.map(function(t){return t.Activity_Url=n.OfficialOriginDomain+"/v2/activity/"+t.Activity_Id+"?layout=official",t}));n.$log.info("Get ActivityList - Finish");t.resolve()}).catch(function(){t.reject()}),t.promise},t.prototype.InitialCategoryMenu=function(){var n=this,t;this.shopServiceImmediate.GetShopCategoryListPromise.then(function(t){if(n.ShopCategoryData=t,n.CategoryMenuSwitch=n.CmsShopInfo&&n.CmsShopInfo.EnableCms?n.CategoryMenuSwitch:!0,n.ShopCategoryData&&n.ShopCategoryData.List.length>0)if(typeof n.salePageCategoryId!="undefined")n.SetActiveLink(n.ShopCategoryData.List,n.salePageCategoryId);else{var i=parseInt(n.UrlUtility.GetQuerystring("cid"));i&&(n.salePageCategoryId=i,n.SetActiveLink(n.ShopCategoryData.List,n.salePageCategoryId))}});this.OfficialServiceImmediate.GetOfficialPromotionTargetListPromise.then(function(t){for(var u,r,i=0;i<=t.length-1;i++)if(u=t[i].ConditionDiscountTypeDef,t[i].Targets.length>0&&u==="FreeGift")for(r=0;r<=t[i].Targets.length-1;r++)n.FreeGiftList.push(t[i].Targets[r]);n.IsLoadedPromotionList=!0});t=[this.InitialActivityList(),this.CheckHasDiscountPromotion(),this.CheckHasECoupon()];this.$q.all(t).then(function(){n.IsShowActivityAndOffers=n.HasECoupon||n.ActivityList&&n.ActivityList.length>0||n.HasDiscountPromotion})},t.prototype.InitilaCmsCustomListMenu=function(){var n=this;this.CmsServiceImmediate.GetCmsThemePromise.then(function(t){var r;if(t){var u=n.CmsThemeUtility.GetCustomLinkListMenuSwitch(t),i=n.CmsThemeUtility.GetCustomLinkListMenu(t),f=n.CmsThemeUtility.GetCustomLinkListMenuTitle(t);u&&i&&i.length>0&&(i.map(function(t){return t.text=t.text||n.$translate.instant("frontend.typescripts.shared.text_link")}),n.CmsCustomLinks=i,n.CmsCustomLinkTitle=f,n.IsShowCmsCustomLinks=!0);n.ActivityMenuSwitch=n.CmsThemeUtility.GetActivityMenuSwitch(t);n.CategoryMenuSwitch=n.CmsThemeUtility.GetCategoryMenuSwitch(t);r=n.CmsThemeUtility.GetActivityMenu(t);n.ActivityMenuCaption=n.ActivityMenuSwitch?r.caption:null;n.ActivityMenuTitle=r.title||n.$translate.instant("frontend.typescripts.shared.latest_events")}})},t.prototype.GetVipMemberCustomLinkSettings=function(){var n=this;this.VipMemberService.VipMemberCustomLinkData?this.SetCustomLinkConfigurationList(this.VipMemberService.VipMemberCustomLinkData):this.VipMemberService.GetVipMemberCustomLinkSettings().then(function(t){t.ReturnCode==="API0001"&&n.SetCustomLinkConfigurationList(t.Data)})},t.prototype.SetCustomLinkConfigurationList=function(t){var i=this,r=n.WebStore.Frontend.BE.Shop.CustomLinkShowPositionEnum[n.WebStore.Frontend.BE.Shop.CustomLinkShowPositionEnum.MobileWebSideBar];this.customLinkConfigurationList=[];t.forEach(function(n){n.IsEnable&&n.ShowPositions.indexOf(r)>-1&&i.customLinkConfigurationList.push(n)})},t.$inject=["ShopId","$scope","$log","$q","Mall.Config","$window","$translate","GoogleAnalyticsUtility","OfficialServiceImmediate","ShopServiceImmediate","SalePageCategoryId","UrlUtility","ActivityService","PromotionV2ServiceImmediate","CouponServiceImmediate","ECouponServiceImmediate","MainMenuUtility","RefUtility","PageValue","OfficialShopProfile","OfficialOriginDomain","CmsShopInfo","CmsServiceImmediate","CmsThemeUtility","DialogUtility","AvailableLanguages","CurrentLocale","CurrencyCode","EnableLanguageSwitcher","VipMemberService","AvailableCurrencies","EnableCurrencySwitcher","DeepLinkService","ActivityServiceImmediate"],t}();t.AsideCategoryMenuController=i;angular.module("NineYi.Mall.Controllers").controller("AsideCategoryMenuController",i)})(i=t.Controllers||(t.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){this.$log=n;this.ComponentControlFactory=t;this.IsEnable=!1;this.IsEnable=this.ComponentControlFactory.IsEnableToolbox}return n.$inject=["$log","ComponentControlFactory"],n}();n.CommonToolboxController=t;angular.module("NineYi.Mall.Controllers").controller("CommonToolboxController",t)})(t=n.Controllers||(n.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}))