var __rest=this&&this.__rest||function(n,t){var u={},r,i;for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&t.indexOf(i)<0&&(u[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)t.indexOf(i[r])<0&&(u[i[r]]=n[i[r]]);return u},__assign,__extends,NineYi;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.SalesMarketSettings=n;var t=this.SalesMarketSettings,i=t.SupplierId,r=t.SalesMarket,u=t.CountryCode,f=__rest(t,["SupplierId","SalesMarket","CountryCode"]);this.SupplierId=i;this.SalesMarket=r;this.CountryCode=u;this.SalesCurrencySettings=f}return n.prototype.GetSalesMarket=function(){return this.SalesMarket},n.prototype.GetSalesCurrency=function(){return this.SalesCurrencySettings.SalesCurrency},n.prototype.GetSalesCurrencySetting=function(){return this.SalesCurrencySettings},n.$inject=["SalesMarketSettings"],n}();n.SalesMarketUtility=t;angular.module("NineYi.Mall.Utilities").service("SalesMarketUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))})(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t;(function(n){n[n.None=0]="None";n[n.CardNo=1]="CardNo";n[n.CardMonth=2]="CardMonth";n[n.CardYear=3]="CardYear";n[n.CVV=4]="CVV"})(t=n.FocusInputTypeEnum||(n.FocusInputTypeEnum={}))})(t=n.Models||(n.Models={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(){}return n.Factory=function(){return function(n){return n?(n=parseFloat(n),n%1==0&&(n=n.toFixed(0)),"$"+n):"$0"}},n}(),t;n.PriceFilter=i;t=function(){function n(){}return n.Factory=function(){return function(n){return n===0?null:n}},n}();n.ZeroToNullFilter=t;angular.module("NineYi.Mall.Filters").filter("nsPrice",["$log",i.Factory]).filter("nsZeroToNull",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n,t,i){t=parseInt(t);i=parseInt(i);for(var r=t;r<=i;r++)n.push(r);return n}},n}();n.RangeFilter=t;angular.module("NineYi.Mall.Filters").filter("nsRange",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n){return n.slice(0).reverse()}},n}();n.ReverseFilter=t;angular.module("NineYi.Mall.Filters").filter("nsReverse",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n,t){var r=parseInt(n,10),i;if(t=parseInt(t,10),isNaN(r)||isNaN(t))return n;for(i=""+r;i.length<t;)i="0"+i;return i}},n}();n.NumberFitLengthFilter=t;angular.module("NineYi.Mall.Filters").filter("nsNumberFitLength",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n){var i="",t;return n!=null&&(t=n.split("v="),t.length<=1&&(t=n.split("youtu.be/")),t.length>1&&(i="https://img.youtube.com/vi/"+t[1]+"/0.jpg")),i}},n}();n.YoutubeImgParser=t;angular.module("NineYi.Mall.Filters").filter("nsYoutubeImgParser",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n){var t;if(n)return(t="/Date(-62135596800000)/",n===t)?null:new Date(parseInt(n.replace("/Date(","").replace(")/",""),10))}},n}();n.DotNetDateParser=t;angular.module("NineYi.Mall.Filters").filter("nsDotNetDateParser",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var r=function(){function n(){}return n.Factory=function(){return function(n){if(n){var t=n.getMonth()+1,i=n.getDate();return n.getFullYear()+"-"+(t>9?t:"0"+t)+"-"+(i>=10?i:"0"+i)}}},n}(),t,i;n.DateFormatParser=r;t=function(){function n(){}return n.Factory=function(){return function(n){if(n){var t=new Date(n);return t.toLocaleDateString()}}},n}();n.DateStringShortFormatParser=t;i=function(){function n(){}return n.Factory=function(){return function(n){if(n){var t=n.split("-");return new Date(t[0],t[1]-1,t[2])}}},n}();n.DateStringFormatParser=i;angular.module("NineYi.Mall.Filters").filter("nsDateFormatParser",["$log",r.Factory]).filter("nsDateStringFormatParser",["$log",i.Factory]).filter("nsDateStringShortFormatParser",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n){return n?n.replace("/t/","/o/"):n}},n}();n.InitImageSizeFilter=t;angular.module("NineYi.Mall.Filters").filter("nsInitImageSize",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(n,t){return function(n){if(n){var i=n.replace("/t/","/z/");return i+"?quality="+t.imageQuality}return n}},n}();n.OptimizeImageFilter=t;angular.module("NineYi.Mall.Filters").filter("nsOptimizeImage",["$log","Mall.Config",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n){return n?String(n).replace(/<[^>]+>/gm,""):""}},n}();n.HtmlToPlanText=t;angular.module("NineYi.Mall.Filters").filter("nsHtmlToPlanText",t.Factory)})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function t(){}return t.Factory=function(t,i){return function(t){var r=i.instant("frontend.typescripts.filters.ns_crm_tier_name_filter.default_crm_tier_name"),f=n.Configs.RegexPattern.Chinese,e=n.Configs.RegexPattern.NumberAndEnglish,u=t.substring(0,1);return f.test(u)?t.length<=4?r=t:"":e.test(u)&&(t.length<=6?r=t:""),r}},t}();t.CrmTierNameFilter=i;angular.module("NineYi.Mall.Filters").filter("nsCrmTierNameFilter",["$log","$translate",i.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n,t,i){if(n)return t=isNaN(t)?10:t,i=typeof i=="undefined"?"...":i,n.length<=t||n.length-i.length<=t?n:String(n).substring(0,t-i.length)+i}},n}();n.TruncateTextFilter=t;angular.module("NineYi.Mall.Filters").filter("nsTruncateText",["$log",t.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var u=function(){function n(){}return n.Factory=function(n,t,i,r){i===void 0&&(i=[]);r===void 0&&(r=[]);var f=n.GetSalesCurrencySetting(),e=f.SalesCurrency,s=f.CurrencySymbol,h=f.CurrencyDecimalDigits,u=i.filter(function(n){return n.code===t})[0],o=r.filter(function(n){return n.base===e})[0];return u&&o?{CurrencyCode:u.code,CurrencySymbol:u.symbol,FractionSize:u.decimalDigits,Rate:o.rates[u.code]||1}:{CurrencyCode:e,CurrencySymbol:s,FractionSize:h,Rate:1}},n}(),r=function(){function n(){}return n.Factory=function(n,t){return function(i,r){var u=t.Rate,f=t.CurrencySymbol,e=t.FractionSize;return n(i*(r||u),f,e)}},n}(),t,i;n.PreferredCurrencyFilter=r;t=function(){function n(){}return n.Factory=function(n,t){return function(i,r){if(i){var u=t.Rate,f=t.CurrencySymbol,e=t.FractionSize,o=new RegExp("(NT\\$|RM|HK\\$)([\\d,.]*[\\d])","g"),s=function(t,i,o){var s=o.replace(/,/g,"");return n(s*(r||u),f,e)};return i.replace(o,s)}}},n}();n.StringToPreferredCurrencyFilter=t;i=function(){function n(){}return n.Factory=function(n,t){return function(i,r){var u=t.Rate,f=t.FractionSize;return n(i*(r||u),f)}},n}();n.PreferredCurrencyWithoutSymbolFilter=i;angular.module("NineYi.Mall.Filters").factory("CurrencyFormat",["SalesMarketUtility","CurrencyCode","AvailableCurrencies","ExchangeRates",u.Factory]).filter("preferredCurrency",["currencyFilter","CurrencyFormat",r.Factory]).filter("stringToPreferredCurrency",["currencyFilter","CurrencyFormat",t.Factory]).filter("preferredCurrencyWithoutSymbol",["numberFilter","CurrencyFormat",i.Factory])})(t=n.Filters||(n.Filters={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.Factory=function(){return function(n){return Math.abs(n)}},n}();n.AbsFilter=t;angular.module("NineYi.Mall.Filters").filter("nsAbs",["$filter",t.Factory])})(t=n.Filters||(n.Filters={}))})(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.config=n;this.ApiCdnConfig=t}return n.prototype.getWebApiUrl=function(n){var t="",i,r;return this.ApiCdnConfig.IsEnable?(i=n.indexOf("?")===-1?"?":"&",r=i+"site="+window.location.hostname,t=this.ApiCdnConfig.Url+"/webapi"+n+r):t=this.config.webapiUrl+n,t},n.$inject=["Mall.Config","ApiCdnConfig"],n}();n.WebApiFactory=t;angular.module("NineYi.Mall.Factories").factory("WebApiFactory",["Mall.Config","ApiCdnConfig",function(n,i){return new t(n,i)}])})(t=n.Factories||(n.Factories={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Factories").factory("AndroidHelper",["Mall.Config",function(n){return typeof Android!="undefined"&&n.enableAndroidHelper?Android:null}])})(t=n.Factories||(n.Factories={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Factories").factory("stacktrace",function(){return{print:printStackTrace}})})(t=n.Factories||(n.Factories={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Factories").factory("underscore",function(){return _})})(t=n.Factories||(n.Factories={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(){angular.module("NineYi.Mall.Factories").factory("CartBaseClass",function(){return n.Mall.BL.CartBaseClass}).factory("CartClass",function(){return n.Mall.BL.CartClass}).factory("TemperatureClass",function(){return n.Mall.BL.TemperatureClass}).factory("MerchandiseClass",function(){return n.Mall.BL.MerchandiseClass}).factory("DeliveryClass",function(){return n.Mall.BL.DeliveryClass}).factory("PaymentClass",function(){return n.Mall.BL.PaymentClass}).factory("InstallmentClass",function(){return n.Mall.BL.InstallmentClass}).factory("DeliveryInfoClass",function(){return n.Mall.BL.DeliveryInfoClass}).factory("PromotionClass",function(){return n.Mall.BL.PromotionClass}).factory("ReachQtyClass",function(){return n.Mall.BL.ReachQtyClass}).factory("FreebieClass",function(){return n.Mall.BL.FreebieClass}).factory("ECouponClass",function(){return n.Mall.BL.ECouponClass}).factory("PromotionDetailClass",function(){return n.Mall.BL.PromotionDetailClass}).factory("PromotionListClass",function(){return n.Mall.BL.PromotionListClass}).factory("MemberCardClass",function(){return n.Mall.BL.MemberCardClass}).factory("CardListClass",function(){return n.Mall.BL.CardListClass}).factory("BankListClass",function(){return n.Mall.BL.BankListClass})})(i=t.Factories||(t.Factories={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=n.Mall.Models.PageNameEnum,r=function(){function n(n,t){this.deviceValue=n;this.pageValue=t;this.IsEnableSmartAppBanner=!1;this.IsEnableToolbox=!1;this.IsMobile=!1;var i=this.pageValue.CurrentPage,r=this.deviceValue.IsMobile();this.IsEnableToolbox=this.CheckIsEnableToolbox(i,r);r&&(this.IsEnableSmartAppBanner=this.CheckIsEnableSmartAppBanner(i))}return n.prototype.CheckIsEnableSmartAppBanner=function(n){var t=!1;return(n===i.OfficailIndex||n===i.CouponDetail||n===i.CouponList||n===i.ECouponDetail||n===i.ECouponHowToUse||n===i.ECouponList||n===i.HotSaleRanking||n===i.NewestSalePage||n===i.PromotionDetail||n===i.PromotionList||n===i.SalePageCategory||n===i.SalePageIndex||n===i.SearchIndex||n===i.FreeGiftPromotionDetail||n===i.ArticleDetail||n===i.VideoDetail||n===i.AlbumDetail||n===i.ActivityIndex||n===i.ShopStoreList||n===i.ShopStoreDetail||n===i.TraceSalePageList||n===i.BrandStory||n===i.ShopIntroduce||n===i.HelpServiceInfo||n===i.MyAccountPrivacy||n===i.VipMemberBenefits)&&(t=!0),t},n.prototype.CheckIsEnableToolbox=function(n){var t=!1;return(n===i.OfficailIndex||n===i.CouponDetail||n===i.CouponList||n===i.ECouponDetail||n===i.ECouponHowToUse||n===i.ECouponList||n===i.HotSaleRanking||n===i.NewestSalePage||n===i.PromotionDetail||n===i.PromotionList||n===i.SalePageCategory||n===i.SalePageIndex||n===i.SearchIndex||n===i.FreeGiftPromotionDetail)&&(t=!0),t},n.$inject=["DeviceValue","PageValue"],n}();t.ComponentControlFactory=r;angular.module("NineYi.Mall.Factories").factory("ComponentControlFactory",["DeviceValue","PageValue",function(n,t){return new r(n,t)}])})(i=t.Factories||(t.Factories={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$filter=r;this.WebApiFactory=u}return t.prototype.GetOfficialPreferenceCategoryList=function(n,t,i,r){for(var f=this.$q.defer(),e={orderby:"Curator",startIndex:i||0,maxCount:r||10,shopId:n||0,cidList:[]},o=this.config.webapiUrl+"/SalePage/GetOfficialPreferenceCategoryList?id="+n,u=0;u<t.length;u++)t[u].TargetInfo.TargetId&&t[u].TargetInfo.TargetId!==""&&e.cidList.push(+t[u].TargetInfo.TargetId);return this.$http.post(o,e).then(function(n){f.resolve(n.data.Data)}).catch(f.reject),f.promise},t.prototype.GetSalePage=function(n,t){var u=this,i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/SalePage/GetSalePage/"+n);return t&&(r+="?cid="+t),this.$http.get(r).then(function(n){var t=new Date;n.data.data.Promotions=n.data.data.Promotions.filter(function(n){return u.$filter("nsDotNetDateParser")(n.StartTime)<=t});i.resolve(n.data)}).catch(i.reject),i.promise},t.prototype.GetOfficialRecommendSalePageList=function(n,t,i,r,u){var s=this.$q.defer(),f={orderby:i||"Newest",startIndex:r||0,maxCount:u||50,shopId:n||0,cidList:[]},e=this.config.webapiUrl+"/SalePage/GetOfficialRecommendSalePageList",o;for(e+="?shopId="+f.shopId,e+="&orderby="+f.orderby,e+="&startIndex="+f.startIndex,e+="&maxCount="+f.maxCount,o=0;o<t.length;o++)f.cidList.push(t[o].TargetInfo.TargetId);return this.$http.post(e,f).then(function(n){s.resolve(n.data.Data)}).catch(s.reject),s.promise},t.prototype.GetSalePageStatus=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/SalePageStatus/GetSalePageStatus/"+n);return this.$http.get(i,null).then(function(n){t.resolve(n.data)}).catch(),t.promise},t.prototype.GetIsGiftSalePage=function(n){var t=this.$q.defer(),i={id:n},r=this.config.webapiUrl+"/SalePage/GetIsGiftSalePage";return this.$http.post(r,i).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},t.prototype.GetSalePageViewList=function(){var n=this.$q.defer(),t=this.config.webapiUrl+"/SalePage/GetSalePageViewList";return this.$http.post(t,null).then(function(t){n.resolve(t.data.Data.SalepageLit)}).catch(n.reject),n.promise},t.prototype.GetSalePageAdditionalInfo=function(t,i){var r=this.$q.defer(),u=this.WebApiFactory.getWebApiUrl("/SalePageV2/GetSalePageAdditionalInfo/"+t+"/"+i+"?source="+n.WebStore.Frontend.BE.UserClientTrack.UserClientTrackSourceTypeEnum.Web);return this.$http.get(u).then(function(n){r.resolve(n.data.Data)}).catch(r.reject),r.promise},t.prototype.GetSalePageDataByIds=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/salepage/GetSalepageDataByIds?ids="+n;return this.$http.get(i).then(function(n){t.resolve(n.data.SalepageList)}).catch(t.reject),t.promise},t.prototype.GetShopShippingDetailList=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/Shop/GetShopShippingDetailList/"+n;return this.$http.get(i).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data.Data):t.reject()}).catch(t.reject),t.promise},t.prototype.GetBuyExtraItemList=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/SalePageV2/GetBuyExtraItemList/"+n+"?locationId="+(t||0));return this.$http.get(r).then(function(n){n.data.ReturnCode==="API0001"?i.resolve(n.data.Data):i.reject()}).catch(function(n){i.reject(n.data)}),i.promise},t.prototype.GetThresholdBuyExtraItemList=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/SalePageV2/GetThresholdBuyExtraItemList/"+n+"?locationId="+(t||0));return this.$http.get(r).then(function(n){n.data.ReturnCode==="API0001"?i.resolve(n.data.Data):i.reject()}).catch(function(n){i.reject(n.data)}),i.promise},t.prototype.GetSalePageV2=function(n,t,i){var r=this.$q.defer(),u=this.WebApiFactory.getWebApiUrl("/SalePageV2/GetSalePageV2Info/"+n+"/"+(i||t)+"?source=Web");return this.$http.get(u).then(function(n){n.data.ReturnCode==="API0001"?r.resolve(n.data.Data):r.reject()}).catch(function(n){r.reject(n.data)}),r.promise},t.prototype.GetShopPayShippingTypeDisplaySettingList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetShopPayShippingTypeDisplaySettingList/"+n);return this.$http.get(i).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data.Data):t.reject()}).catch(t.reject),t.promise},t.prototype.GetStarRate=function(n,t,i){var r=this.$q.defer(),u=this.WebApiFactory.getWebApiUrl("/SalePageComment/GetList/"+n+"/"+t+"?ratingStarsCondition=4&StartIndex=0&maxCount="+i);return this.$http.get(u).then(function(n){n.data.ReturnCode==="API0001"?r.resolve(n.data.Data):r.reject()}).catch(r.reject),r.promise},t.$inject=["Mall.Config","$q","$http","$filter","WebApiFactory"],t}();t.SalePageService=i;angular.module("NineYi.Mall.Services").service("SalePageService",i)})(i=t.Services||(t.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return n.prototype.GetSellingQtyListNew=function(n){var i=window.nineyi&&window.nineyi.googleAnalyticsSettingData&&window.nineyi.googleAnalyticsSettingData.isShowSaleProductOuterId||!1,r=n.join(","),t=this.$q.defer(),u=this.config.webapiUrl+"/ProductStock/GetSellingQtyListNew",f={ids:r,isShowSaleProductOuterId:i};return this.$http.post(u,f).then(function(n){t.resolve(n)}).catch(t.reject),t.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory"],n}();n.ProductStockService=t;angular.module("NineYi.Mall.Services").service("ProductStockService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.TraceSalePageListCache=r}return n.prototype.InsertItem=function(n){var t=this,i=this.config.webapiUrl+"/TraceSalePageList/InsertItem/?salePageId="+n,r={salePageId:n};return this.$http.post(i,r,{withCredentials:!0}).then(function(){var n=t.TraceSalePageListCache.get("Count")?parseInt(t.TraceSalePageListCache.get("Count").toString()):null;n&&t.TraceSalePageListCache.put("Count",n+1)})},n.prototype.DeleteItem=function(n){var t=this,i=this.config.webapiUrl+"/TraceSalePageList/DeleteItem/?salePageId="+n,r={salePageId:n};return this.$http.post(i,r,{withCredentials:!0}).then(function(){var n=t.TraceSalePageListCache.get("Count")?parseInt(t.TraceSalePageListCache.get("Count").toString()):null;n&&t.TraceSalePageListCache.put("Count",n-1)})},n.prototype.GetCount=function(){var i=this,n=this.$q.defer(),r=this.config.webapiUrl+"/TraceSalePageList/GetCount",t=this.TraceSalePageListCache.get("Count")?parseInt(this.TraceSalePageListCache.get("Count").toString()):null;return t?n.resolve(t):this.$http.post(r,null,{withCredentials:!0}).then(function(t){i.TraceSalePageListCache.put("Count",t.data);n.resolve(t.data)}).catch(n.reject),n.promise},n.prototype.GetDataList=function(){var n=this.$q.defer(),t=this.config.webapiUrl+"/TraceSalePageList/GetDataList";return this.$http.post(t,null,{withCredentials:!0}).then(function(t){n.resolve(t.data.data)}).catch(n.reject),n.promise},n.$inject=["Mall.Config","$q","$http","TraceSalePageListCache"],n}();n.TraceSalePageService=t;angular.module("NineYi.Mall.Services").factory("TraceSalePageListCache",["$cacheFactory",function(n){return n("TraceSalePageList")}]);angular.module("NineYi.Mall.Services").service("TraceSalePageService",t)})(t=n.Services||(n.Services={}))})(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){this.$q=n;this.$http=t;this.WebApiFactory=i}return n.prototype.GetShopCategoryPromotionList=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/shopCategory/GetPromotionList/"+n+"/"+t);return this.$http.get(r).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},n.prototype.GetSearchShopCategorySalePageResult=function(n,t,i,r,u,f){var e=this.$q.defer(),o=this.WebApiFactory.getWebApiUrl("/shopCategory/GetSalePageList/"+n+"/"+t+"?order="+i+"&startIndex="+r+"&maxCount="+u+"&isCuratorable="+f);return this.$http.get(o).then(function(n){e.resolve(n.data)}).catch(e.reject),e.promise},n.prototype.GetShopCategoryTreeListByLevel=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/ShopCategory/GetShopCategoryTreeListByLevel/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetShopCategoryTreeByShopCategoryId=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/ShopCategory/GetShopCategoryTreeByShopCategoryId/"+n+"/"+t);return this.$http.get(r).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},n.prototype.GetShopCategoryListBySalePageId=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/ShopCategory/GetShopCategoryListBySalePageId/"+n+"/"+t);return this.$http.get(r).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},n.$inject=["$q","$http","WebApiFactory"],n}();n.ShopCategoryService=t;angular.module("NineYi.Mall.Services").service("ShopCategoryService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return n.prototype.GetActivityList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Activity/GetActivityList?shopId="+n+"&isFromApp=false");return this.$http.get(i).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data.Data):t.reject(n.data.Message)}).catch(t.reject),t.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory"],n}();n.ActivityService=t;angular.module("NineYi.Mall.Services").service("ActivityService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$log=r;this.shopId=u;this.$filter=f;this.WebApiFactory=e}return n.prototype.GetInfoModule=function(n,t){for(var u=this.$q.defer(),e=this.config.webapiUrl+"/Official/GetInfoModule?shopId="+n,f={infoModuleClients:[]},r,i=0;i<t.length;i++)r=t[i],f.infoModuleClients.push({InfoModuleId:r.TargetInfo.TargetId,InfoModuleType:r.TargetInfo.TargetType,Order:r.Order});return this.$http.post(e,f).then(function(n){u.resolve(n.data)}).catch(u.reject),u.promise},n.prototype.GetOfficialSalePageByCategory=function(n,t,i,r,u){var e=this,o=this.$q.defer(),f=this.config.webapiUrl+"/Official/GetOfficialSalePageByCategory";return f+="?orderby="+n,f+="&startIndex="+t,f+="&maxCount="+i,f+="&shopId="+r,f+="&cid="+u,this.$log.info("GetOfficialSalePageByCategory - start"),this.$http.get(f).then(function(n){if(n.data.Data&&n.data.Data.PromotionList){var t=new Date;n.data.Data.PromotionList=n.data.Data.PromotionList.filter(function(n){return e.$filter("nsDotNetDateParser")(n.StartTime)<=t});o.resolve(n.data);e.$log.info("GetOfficialSalePageByCategory - success and finish")}}).catch(function(){e.$log.info("GetOfficialSalePageByCategory - fail");o.reject()}),o.promise},n.prototype.GetOfficialBrandStoryPageHtml=function(){var n=this.$q.defer(),t=this.config.webapiUrl+"/Official/GetOfficialBrandStoryPageHtml";return this.$http.get(t,{}).then(function(t){n.resolve(t.data)}).catch(n.reject),n.promise},n.prototype.GetOfficialNewestSalePage=function(n,t,i,r){var u=this.$q.defer(),f=this.WebApiFactory.getWebApiUrl("/Official/GetOfficialNewestSalePage?orderby="+n+"&startIndex="+t+"&maxCount="+i+"&shopId="+r);return this.$http.get(f,{}).then(function(n){u.resolve(n.data.Data)}).catch(u.reject),u.promise},n.prototype.GetOfficialPromotionTargetList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Official/GetOfficialPromotionTargetList/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data.Data)}).catch(t.reject),t.promise},n.prototype.GetAppDownLoadLink=function(n,t,i){i===void 0&&(i="");var r=this.$q.defer(),u={shopId:n,cellPhone:t,pagefrom:i};return this.$http.post("/webapi/Official/SendAppDownLoadLink",u).then(function(n){r.resolve(n.data)}).catch(r.reject),r.promise},n.$inject=["Mall.Config","$q","$http","$log","ShopId","$filter","WebApiFactory"],n}();n.OfficialService=t;angular.module("NineYi.Mall.Services").service("OfficialService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.shopId=r}return n.prototype.GetTraceSalePageIds=function(n){var t=this.config.webapiUrl+"/TraceSalePageList/GetTraceSalePageIds?shopId="+n;return this.$http.get(t)},n.$inject=["Mall.Config","$q","$http","ShopId"],n}();n.TraceSalePageListService=t;angular.module("NineYi.Mall.Services").service("TraceSalePageListService",t)})(t=n.Services||(n.Services={}))})(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){this.WebApiFactory=r;this.config=n;this.$q=t;this.$http=i}return n.prototype.GetShopSalePageTermListByKeyword=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/Search/GetShopSalePageTermListByKeyword?keyword="+encodeURIComponent(n),r={keyword:encodeURIComponent(n)};return this.$http.get(i,r).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetShopHotKeywordList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/SearchV2/GetShopHotKeywordList?shopId="+n),r={shopId:n};return this.$http.get(i,r).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetShopPayTypeAndShippingTypeList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/SearchV2/GetShopPayTypeAndShippingTypeList?shopId="+n),r={shopId:n};return this.$http.get(i,r).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetShopCategoryListBySearch=function(n,t,i,r,u,f,e,o,s){var c=this.$q.defer(),h=this.WebApiFactory.getWebApiUrl("/SearchV2/GetShopCategoryListBySearch?shopId="+n+"&keyword="+encodeURIComponent(t)),l={shopId:n,keyword:encodeURIComponent(t),minPrice:i,maxPrice:r,shippingType:u,payType:f,scoreThreshold:e,tags:s};return h+="&minPrice="+(i?i:""),h+="&maxPrice="+(r?r:""),h+="&shippingType="+(u?u:""),h+="&payType="+(f?f:""),h+="&scoreThreshold="+(!isNaN(e)&&typeof e=="number"?e:this.config.scoreThreshold),h+="&isResearch="+!!o,h+="&tags="+(s||""),this.$http.get(h,l).then(function(n){c.resolve(n.data)}).catch(c.reject),c.promise},n.prototype.GetShopSalePageBySearch=function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){var b=this.$q.defer(),w=this.config.webapiUrl+"/SearchV2/GetShopSalePageBySearch?shopId="+n+"&keyword="+encodeURIComponent(t),k={shopId:n,keyword:encodeURIComponent(t),minPrice:i,maxPrice:r,shippingType:u,payType:f,order:e,startIndex:o,maxCount:s,displayScore:h,shopCategoryId:c,scoreThreshold:l,tags:y,showMoreTags:p};return w+="&minPrice="+(!isNaN(i)&&typeof i=="number"?i:""),w+="&maxPrice="+(!isNaN(r)&&typeof r=="number"?r:""),w+="&shippingType="+(u?u:""),w+="&payType="+(f?f:""),w+="&order="+(e?e:""),w+="&startIndex="+(o?o:0),w+="&maxCount="+(s?s:""),w+="&displayScore="+(h?h:""),w+="&shopCategoryId="+(c?c:""),w+="&scoreThreshold="+(!isNaN(l)&&typeof l=="number"?l:this.config.scoreThreshold),w+="&isResearch="+!!a,w+="&locationId="+(v||0),w+="&tags="+(y||""),w+="&showMoreTagKeys="+(p||!1),this.$http.get(w,k).then(function(n){b.resolve(n.data)}).catch(b.reject),b.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory"],n}();n.SearchService=t;angular.module("NineYi.Mall.Services").service("SearchService",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(t){var i;(function(t){var i=function(){function t(t,i,r,u){this.config=t;this.$q=i;this.$http=r;this.WebApiFactory=u;this.ECouponTypeEnum=n.WebStore.Frontend.BE.ECoupon.ECouponTypeEnum;this.UserClientTrackSourceTypeEnum=n.WebStore.Frontend.BE.UserClientTrack.UserClientTrackSourceTypeEnum}return t.prototype.GetECouponDetail=function(n,t){t===void 0&&(t=0);var i=this.$q.defer(),r=this.config.webapiUrl+"/ECoupon/GetECouponDetail?id="+n+"&eCouponSlaveId="+t;return this.$http.get(r).then(function(n){i.resolve(__assign({},n.data,{Data:n.data.ECouponDetail}))}).catch(i.reject),i.promise},t.prototype.SetMemberECouponByCode=function(n,t,i){var r=this.$q.defer(),u=this.config.webapiUrl+"/ECoupon/SetMemberECouponByCode",f={code:n,shopId:t,supportVersion:1,eCouponType:i,source:"Web"};return this.$http.post(u,f,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?r.resolve(n.data.Message):r.reject(n.data.Message)}).catch(function(){r.reject("目前網路不穩定,請再試一次 !")}),r.promise},t.prototype.GetMemberECouponList=function(n,t){t===void 0&&(t=this.ECouponTypeEnum[this.ECouponTypeEnum.ECoupon]);var i=this.$q.defer(),r=this.config.webapiUrl+"/ECoupon/GetMemberECouponList",u={shopId:n,eCouponType:t};return this.$http.post(r,u,{withCredentials:!0}).then(function(n){i.resolve(n.data.ECouponList)}).catch(i.reject),i.promise},t.prototype.GetOfficialECouponList=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/ECoupon/GetOfficialECouponList?shopId="+n+"&salePageId="+t);return this.$http.get(r).then(function(n){i.resolve(n.data.ShopECouponList)}).catch(i.reject),i.promise},t.prototype.GetList=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ECoupon/GetList";return this.$http.post(i,{shopId:n}).then(function(n){t.resolve(n.data.Data)}).catch(t.reject),t.promise},t.prototype.GetPointExchangeECouponList=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ECoupon/GetPointExchangeECouponList?shopId="+n;return this.$http.get(i).then(function(n){t.resolve(n.data.ShopECouponList)}).catch(t.reject),t.promise},t.prototype.Verify=function(n,t,i,r,u){u===void 0&&(u=0);var f=this.$q.defer(),e=this.config.webapiUrl+"/ECoupon/Verify",o={shopId:n,ECouponId:t,source:i,device:r,eCouponSlaveId:u};return this.$http.post(e,o,{withCredentials:!0}).then(function(n){f.resolve(n.data)}).catch(f.reject),f.promise},t.prototype.GetECouponMemberBarcode=function(n,t){var i=this.$q.defer(),r=this.config.webapiUrl+"/ECoupon/GetECouponMemberBarcode";return this.$http.post(r,{eCouponId:n,shopId:t},{withCredentials:!0}).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},t.prototype.RedeemPointExchangeECoupon=function(t,i,r,u,f,e,o,s,h){f===void 0&&(f=null);e===void 0&&(e=n.WebStore.Frontend.BE.ECoupon.ECouponSlaveExchangeChannelTypeEnum[n.WebStore.Frontend.BE.ECoupon.ECouponSlaveExchangeChannelTypeEnum.All]);o===void 0&&(o="");s===void 0&&(s=0);h===void 0&&(h="");var c=this.$q.defer(),l=this.config.webapiUrl+"/ECoupon/RedeemPointExchangeECoupon",a={shopId:t,eCouponId:i,source:r,device:u,appVer:f,exchangeChannel:e,outerLocationCode:o,exchangeLocationId:s,locationName:h};return this.$http.post(l,a,{withCredentials:!0}).then(function(n){c.resolve(n.data)}).catch(c.reject),c.promise},t.prototype.GetECouponBarCode=function(n,t,i,r,u){return this.WebApiFactory.getWebApiUrl("/BarCode/GenerateBarCodeImage?width="+n+"&height="+t+"&barcodeType="+i+"&barCodeValue="+r+"&ts="+u)},t.prototype.GetMemberECouponStatusList=function(n,t){t===void 0&&(t=0);var i=this.$q.defer(),r=this.config.webapiUrl+"/ECoupon/GetMemberECouponStatusList",u={eCouponIdListString:n,eCouponSlaveId:t};return this.$http.post(r,u,{withCredentials:!0}).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},t.prototype.SetMemberECouponByECouponId=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ECoupon/SetMemberECouponByECouponId",r={ecouponId:n};return this.$http.post(i,r,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},t.prototype.GetECouponMemberHistoryList=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ECoupon/GetECouponMemberHistoryList";return this.$http.post(i,n,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},t.prototype.GetSalePageList=function(n,t,i,r,u){var f=this.$q.defer(),e=this.config.webapiUrl+("/ECoupon/GetSalePageList/"+n+"/"+t+"?CategoryId="+i+"&StartIndex="+r+"&maxCount="+u);return this.$http.get(e,{withCredentials:!0}).then(function(n){f.resolve(n.data)}).catch(f.reject),f.promise},t.prototype.GetCategoryList=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/ECoupon/GetCategoryList/"+n+"/"+t);return this.$http.get(r,{withCredentials:!0}).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},t.prototype.RefundECouponExchangePoint=function(n,t,i,r){var u=this.$q.defer(),f=this.config.webapiUrl+"/ECoupon/RefundECouponExchangePoint",e={shopId:n,eCouponSlaveId:t,source:i,device:r};return this.$http.post(f,e,{withCredentials:!0}).then(function(n){u.resolve(n.data)}).catch(u.reject),u.promise},t.prototype.GetRefundECouponExchangePointEnabled=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ECoupon/GetRefundECouponExchangePointEnabled?shopId="+n;return this.$http.get(i,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},t.prototype.SetECouponClaimAll=function(n,t,i,r,u){t===void 0&&(t="");i===void 0&&(i=this.UserClientTrackSourceTypeEnum[this.UserClientTrackSourceTypeEnum.Web]);r===void 0&&(r=4);u===void 0&&(u=this.ECouponTypeEnum[this.ECouponTypeEnum.ECoupon]);var f=this.$q.defer(),e=this.config.webapiUrl+"/ECouponLite/SetECouponClaimAll",o={shopId:n,guid:t,source:i,supportVersion:r,eCouponType:u};return this.$http.post(e,o,{withCredentials:!0}).then(function(n){f.resolve(n.data)}).catch(f.reject),f.promise},t.$inject=["Mall.Config","$q","$http","WebApiFactory"],t}();t.ECouponService=i;angular.module("NineYi.Mall.Services").service("ECouponService",i)})(i=t.Services||(t.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return n.prototype.GetCouponList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Coupon/GetCouponList/"+n),r={id:n};if(!n){alert("請檢查您的網路狀態");return}return this.$http.get(i,r).then(function(n){t.resolve(n.data.data)}).catch(t.reject),t.promise},n.prototype.GetCouponListForECouponList=function(n){var t=this.$q.defer(),i="/o2o/api/coupon/list/"+n;return this.$http.get(i).then(function(n){t.resolve(n.data.feed)}).catch(t.reject),t.promise},n.prototype.GetCouponListForMyECoupon=function(n){var t=this.$q.defer(),i="/o2o/api/coupon/my/"+n;return this.$http.get(i).then(function(n){t.resolve(n.data.feed)}).catch(t.reject),t.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory"],n}();n.CouponService=t;angular.module("NineYi.Mall.Services").service("CouponService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return n.prototype.GetList=function(n,t,i,r,u,f){f===void 0&&(f=0);var e=this.$q.defer(),o=this.WebApiFactory.getWebApiUrl("/PromotionV2/GetList/"+n+"?orderBy="+t+"&startIndex="+i+"&maxCount="+r+"&typeDef="+u+"&source=Web&crmShopMemberCardId="+f);return this.$http.get(o,{withCredentials:!0}).then(function(n){e.resolve(n.data)}).catch(e.reject),e.promise},n.prototype.GetDetail=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/PromotionV2/GetDetail/"+n;return this.$http.get(i,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetSalePageList=function(n,t,i,r,u){var f=this.$q.defer(),e=this.config.webapiUrl+("/PromotionV2/GetSalePageList/"+n+"/"+t+"?CategoryId="+i+"&StartIndex="+r+"&maxCount="+u);return this.$http.get(e,{withCredentials:!0}).then(function(n){f.resolve(n.data)}).catch(f.reject),f.promise},n.prototype.Calculate=function(n,t,i){var r=this.$q.defer(),u=this.config.webapiUrl+"/PromotionV2/Calculate";return this.$http.post(u,{promotionDetailDiscount:JSON.stringify({ShopId:n,PromotionId:+t,SalePageList:i})},{withCredentials:!0}).then(function(n){r.resolve(n.data)}).catch(r.reject),r.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory"],n}();n.PromotionV2Service=t;angular.module("NineYi.Mall.Services").service("PromotionV2Service",t)})(t=n.Services||(n.Services={}))})(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){this.$q=n;this.$http=t;this.WebApiFactory=i}return n.prototype.GetHotSaleRankingList=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/HotSaleRanking/GetHotSaleRankingList/"+n+"?period=Weekly&maxCount="+t);return this.$http.get(r).then(function(n){i.resolve(n.data.data)}).catch(i.reject),i.promise},n.$inject=["$q","$http","WebApiFactory"],n}();n.HotSaleRankingService=t;angular.module("NineYi.Mall.Services").service("HotSaleRankingService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.ShopId=r;this.WebApiFactory=u}return n.prototype.GetLayoutTemplateData=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/LayoutTemplateData/GetLayoutTemplateData?adCode="+n);return this.$http.get(i,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetLayoutTemplateDataByShopId=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/LayoutTemplateData/GetLayoutTemplateData?adCode="+n+"&shopId="+t);return this.$http.get(r,{withCredentials:!0}).then(function(n){i.resolve(n)}).catch(i.reject),i.promise},n.prototype.GetOfficialAllLayoutTemplateData=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/LayoutTemplateData/GetOfficialAllLayoutTemplateData?shopId="+n,r={shopId:n};return this.$http.get(i,r).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetOfficialAllLayoutTemplateDataV2=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/LayoutTemplateDataV2/GetOfficialAllLayoutTemplateData/"+n);return this.$http.get(i,{withCredentials:!0}).then(function(n){if(n.data.ReturnCode==="API0001"){var i=_.object(_.map(n.data.Data,_.values));t.resolve(i)}else t.reject(n.data.Message)}).catch(t.reject),t.promise},n.prototype.GetOfficialCustomLinkV2=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/LayoutTemplateDataV2/GetOfficialCustomLink?shopId="+n),r={shopId:n};return this.$http.get(i,r).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.$inject=["Mall.Config","$q","$http","ShopId","WebApiFactory"],n}();n.LayoutTemplateDataService=t;angular.module("NineYi.Mall.Services").service("LayoutTemplateDataService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i}return n.prototype.IsLogin=function(){var n=this.$q.defer(),t=this.config.webapiUrl+"/Auth/IsLogin";return this.$http.post(t,{withCredentials:!0}).then(function(t){n.resolve(t.data)}).catch(n.reject),n.promise},n.prototype.Logout=function(){var n=new Date,t=this.config.webapiUrl+"/Auth/Logout?t="+n.getTime();return sessionStorage.removeItem("ph"),sessionStorage.removeItem("em"),localStorage.removeItem("PromoCode"),localStorage.removeItem("promoCodePoolGroupId"),localStorage.removeItem("retailStoreAddressHistory"),this.$http.get(t,{withCredentials:!0})},n.prototype.GetInfo=function(){var n=this.$q.defer(),t=this.config.webapiUrl+"/Auth/GetInfo";return this.$http.post(t,{withCredentials:!0}).then(function(t){n.resolve(t)}).catch(n.reject),n.promise},n.prototype.MergeMemberFavorites=function(){var n=this.config.webapiUrl+"/Auth/MergeMemberFavorites";return this.$http.post(n,{withCredentials:!0})},n.$inject=["Mall.Config","$q","$http"],n}();n.AuthService=t;angular.module("NineYi.Mall.Services").service("AuthService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.WebApiFactory=t;this.$q=i;this.$http=r}return n.prototype.GetShopPayShippingTypeDisplaySettingList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetShopPayShippingTypeDisplaySettingList/"+n);return this.$http.get(i).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data):t.reject()}).catch(t.reject),t.promise},n.prototype.GetShopContractSetting=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetShopContractSetting/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetShopCategoryList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetShopCategoryListV2/"+n),r={id:n};return this.$http.get(i,r).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetProductCategoryList=function(n,t,i){var r=this.$q.defer(),u=this.WebApiFactory.getWebApiUrl("/Shop/GetShopCategoryListV3/"+n+"?serviceType="+t+"&locationId="+i);return this.$http.get(u).then(function(n){r.resolve(n.data)}).catch(r.reject),r.promise},n.prototype.GetShopAppName=function(n,t){var r=this,i=this.$q.defer(),u=this.WebApiFactory.getWebApiUrl("/Shop/GetShopAppName/"+n+"?osType="+t),f={shopId:n,osType:t};return this.$http.get(u,f).then(function(n){i.resolve(n.data);r.AppName=n.data.Data.length>0&&n.data.Data[0].appName?n.data.Data[0].appName:""}).catch(i.reject),i.promise},n.prototype.GetVipMemberDisplaySettings=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetVipMemberDisplaySettings/"+n);return this.$http.get(i,{}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetOverseaShippingStatement=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetOverseaShippingStatement/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(function(n){t.reject(n.data)}),t.promise},n.prototype.GetGlobalPaymentDetailInfo=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/Shop/GetGlobalPaymentDetailInfo/"+n;return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(function(n){t.reject(n)}),t.promise},n.prototype.GetIsShowOfflineOrderDescription=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/IsShowOfflineOrderDescription/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetPurchaseNotesSetting=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetPurchaseNotesSetting/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(function(n){t.reject(n.data)}),t.promise},n.prototype.GetEnableDisplayStoreList=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Shop/GetEnableDisplayStoreList/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(function(n){t.reject(n.data)}),t.promise},n.$inject=["Mall.Config","WebApiFactory","$q","$http"],n}();n.ShopService=t;angular.module("NineYi.Mall.Services").service("ShopService",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n,t,i,r){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return t.prototype.GetAllCategory=function(){var t=this,n=this.$q.defer(),i=this.config.webapiUrl+"/Category/GetAll/";return this.$http.get(i,{withCredentials:!0}).then(function(i){var r=t.JsonToCategoryModel(i.data);n.resolve(r)}).catch(n.reject),n.promise},t.prototype.JsonToCategoryModel=function(t){for(var f=[],i,r,u=0;u<t.length;u++)i=t[u],r=new n.Models.CategoryModel,r.Id=i.Id,r.ParentId=i.ParentId,r.Name=i.Name,r.Sort=i.Sort,r.Level=i.Level,r.Note=i.Note,r.HighLight=i.HighLight,r.PUrl=i.PUrl,i.Data&&i.Data.length>0&&(r.Data=this.JsonToCategoryModel(i.Data)),f.push(r);return f},t.prototype.GetShopCategoryNavigation=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Category/GetShopCategoryNavigation?categoryId="+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},t.$inject=["Mall.Config","$q","$http","WebApiFactory"],t}();t.CategoryService=i;angular.module("NineYi.Mall.Services").service("CategoryService",i)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t,i;(function(n){n[n.Update=0]="Update";n[n.Insert=1]="Insert";n[n.Delete=2]="Delete"})(t||(t={}));i=function(){function n(n,t,i,r){this.config=n;this.$q=t;this.$http=i;this.ShoppingCartCache=r}return n.prototype.Calculate=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ShoppingCartV3/Calculate",r={shoppingCart:angular.toJson(n),isWeb:!0};return this.$http.post(i,r,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data.Data):t.reject(n.data.Message)}).catch(t.reject),t.promise},n.prototype.GetCount=function(n){var r=this,t=this.$q.defer(),u=this.config.webapiUrl+"/ShoppingCartV2/GetCount",f={shopId:n},i=this.ShoppingCartCache.get("Count")?parseInt(this.ShoppingCartCache.get("Count").toString()):null;return i?t.resolve(i):this.$http.post(u,f,{withCredentials:!0}).then(function(n){var i=n.data;r.ShoppingCartCache.put("Count",i);t.resolve(i)}).catch(t.reject),t.promise},n.prototype.GetPreview=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ShoppingCartV3/GetShoppingCartPreview",r={shopId:n};return this.$http.post(i,r,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data.Data):t.reject(n.data.Message)}).catch(t.reject),t.promise},n.prototype.GetShoppingCart=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ShoppingCartV3/GetShoppingCart",r={shopId:n,isWeb:!0};return this.$http.post(i,r,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data.Data):t.reject(n.data.Message)}).catch(t.reject),t.promise},n.prototype.UpdateShoppingCartQty=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ShoppingCartV3/UpdateShoppingCartQty",r={qty:angular.toJson(n)};return this.$http.post(i,r,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(!0):t.reject(n.data)}).catch(t.reject),t.promise},n.prototype.RemoveItem=function(n,t,i,r,u,f){var e=this;u===void 0&&(u="");f===void 0&&(f=0);var o=this.$q.defer(),s=this.config.webapiUrl+"/ShoppingCartV2/RemoveItem",h={shopId:n,salePageId:t,saleProductSKUId:i,salePageSeq:r,optionalTypeDef:u,optionalTypeId:f};return this.$http.post(s,h,{withCredentials:!0}).then(function(){var n=e.ShoppingCartCache.get("Count")?parseInt(e.ShoppingCartCache.get("Count").toString()):null;n&&e.ShoppingCartCache.put("Count",n-1);o.resolve()}),o.promise},n.prototype.InsertItem=function(n){var r=this,i=this.$q.defer(),u=this.config.webapiUrl+"/ShoppingCartV2/InsertItem";return this.$http.post(u,n,{withCredentials:!0}).then(function(n){if(n.data.ReturnCode==="API0002"){i.reject(n.data.Message);return}var u=r.ShoppingCartCache.get("Count")?parseInt(r.ShoppingCartCache.get("Count").toString()):null;u&&n.data.Data&&n.data.Data.Action===t.Insert&&r.ShoppingCartCache.put("Count",u+1);i.resolve()},i.reject),i.promise},n.$inject=["Mall.Config","$q","$http","ShoppingCartCache"],n}();n.ShoppingCartService=i;angular.module("NineYi.Mall.Services").factory("ShoppingCartCache",["$cacheFactory",function(n){return n("ShoppingCart")}]);angular.module("NineYi.Mall.Services").service("ShoppingCartService",i)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i}return n.prototype.GetShoppingCart=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ShoppingCartV4/GetShoppingCart";return this.$http.post(i,n,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.Calculate=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/ShoppingCartV4/Calculate";return this.$http.post(i,n,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.UpdateShoppingCartQty=function(n){var t=this.$q.defer();return this.$http.post("https://testapi.91app.biz/APITest/api/ShoppingCartV4/WebAPI/ShoppingCartV4/UpdateShoppingCartQty",n,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.InsertItem=function(n,t,i,r,u,f,e,o){u===void 0&&(u="");f===void 0&&(f=0);e===void 0&&(e=!1);var s=this.$q.defer(),h=this.config.webapiUrl+"/ShoppingCartV4/InsertItem",c={shopId:n,salePageId:t,saleProductSKUId:i,qty:r,optionalTypeDef:u,optionalTypeId:f,IsSkuQtyAccumulate:e,optionalInfo:o};return this.$http.post(h,c,{withCredentials:!0}).then(function(n){if(n){var t=n.data,i=t.ReturnCode,r=t.Data,u=t.Message;return i!=="API5101"?s.reject(u):s.resolve(r)}return s.reject()},s.reject),s.promise},n.prototype.GetShoppingCartAmountPreview=function(n,t){var i=this.$q.defer(),r=this.config.webapiUrl+"/ShoppingCartV4/GetShoppingCartAmountPreview",u={shopId:n,serviceType:t};return this.$http.post(r,u,{withCredentials:!0}).then(function(n){if(n){var t=n.data,r=t.ReturnCode,u=t.Data,f=t.Message;return r==="API5001"?i.resolve(u):i.reject(f)}return i.reject()}).catch(i.reject),i.promise},n.$inject=["Mall.Config","$q","$http"],n}();n.ShoppingCartV4Service=t;angular.module("NineYi.Mall.Services").service("ShoppingCartV4Service",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i}return n.prototype.GetList=function(){var n=this.$q.defer(),t=this.config.webapiUrl+"/TraceShopList/GetDataList";return this.$http.post(t,{withCredentials:!0}).then(function(t){n.resolve(t.data)}).catch(n.reject),n.promise},n.$inject=["Mall.Config","$q","$http"],n}();n.TraceShopService=t;angular.module("NineYi.Mall.Services").service("TraceShopService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return n.prototype.GetShopCategoryHotSaleRankingList=function(n,t){var i=this.$q.defer(),r=this.WebApiFactory.getWebApiUrl("/ShopCategoryHotSaleRanking/GetShopCategoryHotSaleRankingList?shopId="+n+"&shopCategoryId="+t);return this.$http.get(r).then(function(n){i.resolve(n.data.data)}).catch(function(){i.reject()}),i.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory"],n}();n.ShopCategoryHotSaleService=t;angular.module("NineYi.Mall.Services").service("ShopCategoryHotSaleService",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.$q=n}return n.prototype.CallPromiseAction=function(n){var t=this.$q.defer();return n.then(function(n){t.resolve(n)}),t.promise},n.prototype.CallHttpPromiseAction=function(n){var t=this.$q.defer();return n.then(function(n){t.resolve(n)}),t.promise},n.$inject=["$q"],n}();n.BaseServiceImmediate=t;angular.module("NineYi.Mall.Services").service("BaseServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i){var r=n.call(this,t)||this;return r.$q=t,r.AuthService=i,r.IsLogin(),r}return __extends(t,n),t.prototype.IsLogin=function(){var t=this;this.IsLoginPromise=n.prototype.CallHttpPromiseAction.call(this,this.AuthService.IsLogin());this.IsLoginPromise.then(function(n){t.AuthService.LoginStatus=n})},t.$inject=["$q","AuthService"],t}(n.BaseServiceImmediate);n.AuthServiceImmediate=t;angular.module("NineYi.Mall.Services").service("AuthServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r){var u=n.call(this,t)||this;return u.$q=t,u.OfficialService=i,u.ShopId=r,u.GetOfficialPromotionTargetList(),u}return __extends(t,n),t.prototype.GetOfficialPromotionTargetList=function(){this.GetOfficialPromotionTargetListPromise=n.prototype.CallPromiseAction.call(this,this.OfficialService.GetOfficialPromotionTargetList(this.ShopId))},t.$inject=["$q","OfficialService","ShopId"],t}(n.BaseServiceImmediate);n.OfficialServiceImmediate=t;angular.module("NineYi.Mall.Services").service("OfficialServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){var f=n.call(this,t)||this;return f.$q=t,f.$timeout=i,f.shopId=r,f.layoutTemplateDataService=u,f.shopId>0&&(f.GetAdList(),f.GetCustomLinks()),f}return __extends(t,n),t.prototype.GetAdList=function(){var t=this;this.GetAdListPromise=n.prototype.CallPromiseAction.call(this,this.layoutTemplateDataService.GetOfficialAllLayoutTemplateDataV2(this.shopId));this.GetAdListPromise.then(function(n){n&&(t.layoutTemplateDataService.AdList=n)})},t.prototype.GetCustomLinks=function(){var t=this;this.GetCustomLinkPromise=n.prototype.CallHttpPromiseAction.call(this,this.layoutTemplateDataService.GetOfficialCustomLinkV2(this.shopId));this.GetCustomLinkPromise.then(function(n){n&&(t.layoutTemplateDataService.OfficialCustomLink=n.Data)})},t.$inject=["$q","$timeout","ShopId","LayoutTemplateDataService"],t}(n.BaseServiceImmediate);n.LayoutTemplateDataServiceImmediate=t;angular.module("NineYi.Mall.Services").service("LayoutTemplateDataServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r){var u=n.call(this,t)||this;return u.$q=t,u.TraceSalePageListService=i,u.ShopId=r,u.GetTraceSalePageIds(),u}return __extends(t,n),t.prototype.GetTraceSalePageIds=function(){var i=this,t=this.$q.defer();n.prototype.CallHttpPromiseAction.call(this,this.TraceSalePageListService.GetTraceSalePageIds(this.ShopId)).then(function(n){t.resolve(n.data.data)});this.GetTraceSalePageIdsPromise=t.promise;this.GetTraceSalePageIdsPromise.then(function(n){i.TraceSalePageListService.TraceSalePageList=n})},t.$inject=["$q","TraceSalePageListService","ShopId"],t}(n.BaseServiceImmediate);n.TraceSalePageListServiceImmediate=t;angular.module("NineYi.Mall.Services").service("TraceSalePageListServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r){var u=n.call(this,t)||this;return u.$q=t,u.ShopService=i,u.ShopId=r,u.GetShopCategoryList(),u}return __extends(t,n),t.prototype.GetShopCategoryList=function(){var t=this;this.GetShopCategoryListPromise=n.prototype.CallPromiseAction.call(this,this.ShopService.GetProductCategoryList(this.ShopId));this.GetShopCategoryListPromise.then(function(n){t.ShopService.ShopCategoryData=n;t.ShopCategoryData=n})},t.$inject=["$q","ShopService","ShopId"],t}(n.BaseServiceImmediate);n.ShopServiceImmediate=t;angular.module("NineYi.Mall.Services").service("ShopServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){var f=n.call(this,t)||this,e;return f.$q=t,f.$timeout=i,f.shopId=r,f.eCouponService=u,f.SalePageId=0,e=window.ServerRenderData&&window.ServerRenderData.SalePageIndexViewModel?window.ServerRenderData.SalePageIndexViewModel:null,e&&(f.SalePageId=e.Id),f.GetOfficialECouponList(f.SalePageId),f}return __extends(t,n),t.prototype.GetOfficialECouponList=function(t){var i=this;return t===this.SalePageId?this.GetOfficialECouponListPromise||(this.GetOfficialECouponListPromise=n.prototype.CallPromiseAction.call(this,this.eCouponService.GetOfficialECouponList(this.shopId,this.SalePageId))):this.GetOfficialECouponListPromise=n.prototype.CallPromiseAction.call(this,this.eCouponService.GetOfficialECouponList(this.shopId,t)),this.GetOfficialECouponListPromise.then(function(n){n[0]&&n[0].ECouponList&&n[0].ECouponList.length>0&&(i.eCouponService.ECouponList=n)}),this.GetOfficialECouponListPromise},t.$inject=["$q","$timeout","ShopId","ECouponService"],t}(n.BaseServiceImmediate);n.ECouponServiceImmediate=t;angular.module("NineYi.Mall.Services").service("ECouponServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){var f=n.call(this,t)||this;return f.$q=t,f.$timeout=i,f.shopId=r,f.couponService=u,f.GetCouponList(),f}return __extends(t,n),t.prototype.GetCouponList=function(){var t=this;this.GetCouponListPromise=n.prototype.CallPromiseAction.call(this,this.couponService.GetCouponList(this.shopId));this.GetCouponListPromise.then(function(n){t.couponService.CouponList=n})},t.$inject=["$q","$timeout","ShopId","CouponService"],t}(n.BaseServiceImmediate);n.CouponServiceImmediate=t;angular.module("NineYi.Mall.Services").service("CouponServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r){var u=n.call(this,t)||this;return u.$q=t,u.shopId=i,u.promotionV2Service=r,u.GetPromotionList(),u}return __extends(t,n),t.prototype.GetPromotionList=function(){var t=this;this.GetPromotionListPromise=n.prototype.CallPromiseAction.call(this,this.promotionV2Service.GetList(this.shopId,"Newest",0,30,"All"));this.GetPromotionListPromise.then(function(n){t.promotionV2Service.PromotionList=n.Data})},t.$inject=["$q","ShopId","PromotionV2Service"],t}(n.BaseServiceImmediate);n.PromotionV2ServiceImmediate=t;angular.module("NineYi.Mall.Services").service("PromotionV2ServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r){var u=n.call(this,t)||this;return u.$q=t,u.shopId=i,u.hotSaleRankingService=r,u.GetHotSaleRankingList(),u}return __extends(t,n),t.prototype.GetHotSaleRankingList=function(){var t=this;this.GetHotSaleRankingListPromise=n.prototype.CallPromiseAction.call(this,this.hotSaleRankingService.GetHotSaleRankingList(this.shopId,8));this.GetHotSaleRankingListPromise.then(function(n){n&&(t.hotSaleRankingService.HotSaleRankingList=n)})},t.$inject=["$q","ShopId","HotSaleRankingService"],t}(n.BaseServiceImmediate);n.HotSaleRankingServiceImmediate=t;angular.module("NineYi.Mall.Services").service("HotSaleRankingServiceImmediate",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return n.prototype.GetPromoCodeMGOSetting=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/MemberInvite/PromoCodeMGOSetting?shopId="+n);return this.$http.get(i,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?t.resolve(n.data.Data):t.reject(n.data.Message)}).catch(t.reject),t.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory"],n}();n.memberInviteImmediate=t;angular.module("NineYi.Mall.Services").service("memberInviteImmediate",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$timeout=r;this.WebApiFactory=u;this.CmsApiDomain=f;this.CookieUtility=e}return n.prototype.SubscribeProductSku=function(n,t,i,r){var u=this.$q.defer(),f=this.CmsApiDomain+"/cms/v1/user/backInStock/subscribeProductSku/"+n,e={method:"POST",url:f,headers:{"NY-MID":this.CookieUtility.GetCookie("MID")},data:{shopId:n,salePageId:t,skuIdList:[i],lang:r}};return this.$http(e).then(function(n){u.resolve(n.data)}).catch(function(n){u.reject(n.data)}),u.promise},n.prototype.UnsubscribeProductSku=function(n,t,i,r){var u=this.$q.defer(),f=this.CmsApiDomain+"/cms/v1/user/backInStock/deleteSubscribedSku/"+n+"/"+t+"/"+i+"/"+r,e={headers:{"NY-MID":this.CookieUtility.GetCookie("MID")}};return this.$http.delete(f,e).then(function(n){u.resolve(n.data)}).catch(function(n){u.reject(n.data)}),u.promise},n.prototype.GetSubscribedSkuList=function(n,t){var i=this.$q.defer(),r=this.CmsApiDomain+"/cms/v1/user/backInStock/getSubscribedSkuList/"+n+"?salePageId="+t,u={headers:{"NY-MID":this.CookieUtility.GetCookie("MID")}};return this.$http.get(r,u).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n.data)}),i.promise},n.prototype.GetSubscribedSkuCount=function(n,t){var i=this.$q.defer(),r=this.CmsApiDomain+"/cms/v1/user/backInStock/getSubscribedSkuCount/"+n+"?salePageId="+t,u={headers:{"NY-MID":this.CookieUtility.GetCookie("MID")}};return this.$http.get(r,u).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n.data)}),i.promise},n.$inject=["Mall.Config","$q","$http","$timeout","WebApiFactory","CmsApiDomain","CookieUtility"],n}();n.BackInStockService=t;angular.module("NineYi.Mall.Services").service("BackInStockService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$log=r;this.WebApiFactory=u;this.cookieUtility=f}return n.prototype.GetVipMemberBarCode=function(n,t,i,r,u){return this.WebApiFactory.getWebApiUrl("/BarCode/GenerateBarCodeImage?width="+n+"&height="+t+"&barcodeType="+i+"&barCodeValue="+r+"&ts="+u)},n.prototype.GetVipMemberMajorInfo=function(n,t){var r=this,u=this.config.webapiUrl+"/VIPMember/GetVipInfo?shopId="+n+"&isBinding="+t,i=this.$q.defer();return this.$log.info("取得會員主要資料 - Start"),this.$http.get(u,{withCredentials:!0}).then(function(n){i.resolve(n.data);r.$log.info("取得會員主要資料 - finish")}).catch(i.reject),i.promise},n.prototype.GetVipMemberItem=function(n,t){var r=this,u=this.config.webapiUrl+"/VIPMember/GetVIPMemberItemV2?shopId="+n+"&memberCardId="+t,i=this.$q.defer();return this.$log.info("取得會員的詳細填寫資料 - Start"),this.$http.get(u,{withCredentials:!0}).then(function(n){i.resolve(n.data.Data.Member);r.$log.info("取得會員的詳細填寫資料 - finish")}).catch(i.reject),i.promise},n.prototype.GetShopContractType=function(n){var i=this,r=this.config.webapiUrl+"/VIPMember/GetShopContractType?shopId="+n,t=this.$q.defer();return this.$log.info("取得商店會員合約類型 - Start"),this.$http.get(r,{withCredentials:!0}).then(function(n){t.resolve(n.data.Data);i.$log.info("取得商店會員合約類型 - finish")}).catch(t.reject),t.promise},n.prototype.CheckIsAddedMemberInfo=function(n){var i=this,r=this.config.webapiUrl+"/VIPMember/IsWriteVipMember?shopId="+n,t=this.$q.defer();return this.$log.info("檢查是否已填寫過會員資料 - Start"),this.$http.get(r,{withCredentials:!0}).then(function(n){t.resolve(n.data.Data);i.$log.info("檢查是否已填寫過會員資料 - finish")}).catch(t.reject),t.promise},n.prototype.RegisterVipMember=function(n,t,i,r){var f=n?"/VIPMember/RegisterVIPMember":"/VIPMember/InsertOrUpdateVIPMember",e=this.config.webapiUrl+f,u=this.$q.defer(),o={vipMemberInfo:r,shopId:t,memberCardId:i};return this.$http.post(e,o,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?u.resolve(n.data.Data):u.reject(n.data)}).catch(u.reject),u.promise},n.prototype.BindingShopLocationVipMember=function(n,t,i){var u=this.config.webapiUrl+"/VIPMember/BindingShopLocationVIPMember",r=this.$q.defer(),f={vipMemberInfo:i,shopId:n,memberCardId:t};return this.$http.post(u,f,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?r.resolve(n.data.Data):r.reject(n.data)}).catch(r.reject),r.promise},n.prototype.InsertOrUpdateVIPMember=function(n,t,i){var u=this.config.webapiUrl+"/VIPMember/InsertOrUpdateVIPMember",r=this.$q.defer(),f={vipMemberInfo:i,shopId:n,memberCardId:t};return this.$http.post(u,f,{withCredentials:!0}).then(function(n){n.data.ReturnCode==="API0001"?r.resolve(n.data.Data):r.reject(n.data)}).catch(r.reject),r.promise},n.prototype.GetOpenCardPresentStatus=function(n,t){var u=this,r="",i;return t?(r=this.config.webapiUrl+"/VIPMember/GetOpenCardPresentStatus?shopId="+n,this.$log.info("已填寫會員資料")):(r=this.config.webapiUrl+"/VIPMember/GetNonVIPOpenCardPresentStatus?shopId=226?shopId="+n,this.$log.info("未填寫過會員資料")),i=this.$q.defer(),this.$log.info("查看有無開卡禮 - Start"),this.$http.get(r,{withCredentials:!0}).then(function(n){i.resolve(n.data.Data);u.$log.info("查看有無開卡禮 - finish")}).catch(i.reject),i.promise},n.prototype.GetBirthdayPresentStatus=function(n){var i=this,r=this.config.webapiUrl+"/VIPMember/GetBirthdayPresentStatus?shopId="+n,t=this.$q.defer();return this.$log.info("查看有無生日禮 - Start"),this.$http.get(r,{withCredentials:!0}).then(function(n){t.resolve(n.data.Data);i.$log.info("查看有無生日禮 - finish")}).catch(t.reject),t.promise},n.prototype.GetThirdPartyTradesOrderConfiguration=function(n){var i=this,r=this.WebApiFactory.getWebApiUrl("/VIPMember/GetThirdPartyTradesOrderConfiguration?shopId="+n),t=this.$q.defer();return this.$log.info("查看是否有第三方訂單 - Start"),this.$http.get(r,{withCredentials:!0}).then(function(n){t.resolve(n.data.Data);i.$log.info("查看是否有第三方訂單 - Start")}).catch(t.reject),t.promise},n.prototype.GetThirdPartyTradesOrderSearchIsEnable=function(){var t=this.config.webapiUrl+"/VIPMember/GetThirdPartyTradesOrderSearchIsEnable",n=this.$q.defer();return this.$http.get(t,{withCredentials:!0}).then(function(t){n.resolve(t.data)}).catch(n.reject),n.promise},n.prototype.GetVipMemberEmailNotification=function(n){var i=this.config.webapiUrl+"/VIPMember/GetVipMemberEmailNotification/"+n,t=this.$q.defer();return this.$http.get(i,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.UpdateVipMemberEmailNotification=function(n){var i=this.config.webapiUrl+"/VIPMember/UpdateVipMemberEmailNotification",t=this.$q.defer();return this.$http.post(i,n,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetVipMemberCustomLinkSettings=function(){var t=this,i=this.config.webapiUrl+"/VIPMember/GetVipMemberCustomLinkSettings",n=this.$q.defer();return this.$http.get(i,{withCredentials:!0}).then(function(i){i.data.ReturnCode==="API0001"&&(t.VipMemberCustomLinkData=i.data.Data);n.resolve(i.data)}).catch(n.reject),n.promise},n.prototype.GetMemberPresentWithPurchase=function(n){var r=this,u=this.config.webapiUrl+"/VIPMember/GetMemberPresentWithPurchase",t=this.$q.defer(),i;return this.$log.info("取得會員的滿額禮累積狀態 - Start"),i={shopId:n},this.$http.post(u,i,{withCredentials:!0}).then(function(n){t.resolve(n.data);r.$log.info("取得會員的滿額禮累積狀態 - End")}).catch(t.reject),t.promise},n.prototype.UpdateFavoriteLocation=function(n,t){var r=this.config.webapiUrl+"/VIPMember/UpdateFavoriteLocation",i=this.$q.defer();return this.$http.post(r,{shopId:n,locationId:t},{withCredentials:!0}).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},n.prototype.GetBenefitsDetails=function(n){var i=this,r=this.config.webapiUrl+"/VIPMember/GetBenefitsDetails?shopId="+n,t=this.$q.defer();return this.$log.info("取得會員權益聲明明細 - Start"),this.$http.get(r,{withCredentials:!0}).then(function(n){t.resolve(n.data);i.$log.info("取得會員權益聲明明細 - finish")}).catch(t.reject),t.promise},n.prototype.GetRegistrationSettingEnable=function(n){var i=this.WebApiFactory.getWebApiUrl("/VIPMemberLite/GetRegistrationSetting?shopId="+n),t=this.$q.defer();return this.$http.get(i,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.GetVIPMemberItemForRegistrationSetting=function(n){var i=this,r=this.config.webapiUrl+"/VIPMember/GetVIPMemberItemForRegistrationSetting?shopId="+n,t=this.$q.defer();return this.$http.get(r,{withCredentials:!0}).then(function(n){t.resolve(n.data);i.$log.info("取得VIP會員資料ForRegistrationSetting - finish")}).catch(t.reject),t.promise},n.prototype.UpdateVIPMemberForRegistrationSetting=function(n,t,i,r,u){var e=this.config.webapiUrl+"/VIPMember/UpdateVIPMemberForRegistrationSetting",f=this.$q.defer();return this.$http.post(e,{vipMemberInfo:n,shopId:t,memberCardId:i,guid:r,isOptIn:u},{withCredentials:!0}).then(function(n){f.resolve(n.data)}).catch(f.reject),f.promise},n.prototype.GetVipMemberOuterId=function(n){var u=this,t=this.$q.defer(),i=n+":vipMemberOuterId",r=this.cookieUtility.GetCookie(i);return r?t.resolve(r):this.GetVipMemberMajorInfo(n,!1).then(function(n){var r=n.Data,f=r&&r.VipMember&&r.VipMember.OuterId||null;f&&u.cookieUtility.AddCookie(i,f);t.resolve(f)}).catch(t.reject),t.promise},n.prototype.GetCarrierCode=function(n){var i=this.config.webapiUrl+"/VIPMember/GetCarrierCode?shopId="+n,t=this.$q.defer();return this.$http.get(i,{withCredentials:!0}).then(function(n){t.resolve(n.data)}).catch(t.reject),t.promise},n.prototype.InsertOrUpdateCarrierCode=function(n,t){var r=this.config.webapiUrl+"/VIPMember/InsertOrUpdateCarrierCode",i=this.$q.defer();return this.$http.post(r,{shopId:n,carrierCodeEntity:{carrierCode:t}},{withCredentials:!0}).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},n.$inject=["Mall.Config","$q","$http","$log","WebApiFactory","CookieUtility"],n}();n.VipMemberService=t;angular.module("NineYi.Mall.Services").service("VipMemberService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i}return n.prototype.IsPhantomMember=function(){var t=this.config.webapiUrl+"/MemberV2/IsPhantomMember",n=this.$q.defer();return this.$http.post(t,{},{withCredentials:!0}).then(function(t){n.resolve(t.data)}).catch(n.reject),n.promise},n.$inject=["Mall.Config","$q","$http"],n}();n.MemberService=t;angular.module("NineYi.Mall.Services").service("MemberService",t)})(t=n.Services||(n.Services={}))})(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){this.CmsApiDomain=n;this.$q=t;this.$http=i;this.DeviceValue=r}return t.prototype.GetCMSThemeConfig=function(t){var i=this.$q.defer(),r=this.DeviceValue.BrowsingMode===n.Mall.Models.BrowsingModeEnum.Mobile?"mobile":"desktop",u=this.CmsApiDomain+"/cms/v1/theme/"+t+"/index/"+r;return this.$http.get(u).then(function(n){i.resolve(n.data)}).catch(i.reject),i.promise},t.prototype.GetTagCategory=function(n,t){var i=this.$q.defer(),r="/cms/api/tagCategory/relatedProducts/"+n+"/"+t;return this.$http.get(r).then(function(n){var t=[];n.data.relatedProducts.map(function(n){var i={PicUrl:n.imageSrc,Price:n.price,SalePageId:n.id,SalePageTitle:n.title,SuggestPrice:n.suggestPrice,Rank:null,SalePageUpdatedDateTime:null,TotalSaleQty:null,SoldOutActionType:null};t.push(i)});i.resolve({tags:n.data&&n.data.tags||[],relatedProducts:t})}).catch(i.reject),i.promise},t.$inject=["CmsApiDomain","$q","$http","DeviceValue"],t}();t.CmsService=i;angular.module("NineYi.Mall.Services").service("CmsService",i)})(i=t.Services||(t.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$log=r}return n.prototype.Set=function(n,t,i){var u=this,r=this.$q.defer(),f=this.config.webapiUrl+"/Fr/Set",e={shopId:n,fr:t,fr2:i};return this.$http.post(f,e).then(function(n){r.resolve(n.data);u.$log.info("FrService Set - finish")}).catch(function(){return u.$log.error("FrService Set - failed"),r.reject()}),r.promise},n.$inject=["Mall.Config","$q","$http","$log"],n}();n.FrService=t;angular.module("NineYi.Mall.Services").service("FrService",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r,u,f){var e=n.call(this,t)||this;return e.$q=t,e.CmsShopInfo=i,e.shopId=r,e.CmsService=u,e.OfficialShopProfile=f,e.CmsShopInfo&&e.CmsShopInfo.EnableCms&&e.GetCMSThemeConfig(),e}return __extends(t,n),t.prototype.GetCMSThemeConfig=function(){var t=this;this.GetCmsThemePromise=n.prototype.CallHttpPromiseAction.call(this,this.CmsService.GetCMSThemeConfig(this.shopId));this.GetCmsThemePromise.then(function(n){n&&(t.CmsService.CMSThemeConfig=n)})},t.$inject=["$q","CmsShopInfo","ShopId","CmsService","OfficialShopProfile"],t}(n.BaseServiceImmediate);n.CmsServiceImmediate=t;angular.module("NineYi.Mall.Services").service("CmsServiceImmediate",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$timeout=r;this.WebApiFactory=u}return n.prototype.GetSetting=function(n){var t=this.$q.defer(),i=this.WebApiFactory.getWebApiUrl("/Sidebar/GetSettingList/"+n);return this.$http.get(i).then(function(n){t.resolve(n.data)}).catch(function(n){t.reject(n.data)}),t.promise},n.$inject=["Mall.Config","$q","$http","$timeout","WebApiFactory"],n}();n.SidebarService=t;angular.module("NineYi.Mall.Services").service("SidebarService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$log=r;this.shopId=u}return n.prototype.GetDeepLink=function(n){var i=this,t=this.$q.defer(),r=this.config.webapiUrl+"/DeepLink/GetDeepLink",u={ShopId:this.shopId,TargetUrl:n};return this.$http.post(r,u).then(function(n){return n.data&&n.data.ReturnCode!=="API0001"?(i.$log.error("[DeepLinkService/GetDeepLink] failed, data:"+JSON.stringify(n.data)),t.reject()):t.resolve(n.data)}).catch(t.reject),t.promise},n.$inject=["Mall.Config","$q","$http","$log","ShopId"],n}();n.DeepLinkService=t;angular.module("NineYi.Mall.Services").service("DeepLinkService",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r,u){var f=n.call(this,t)||this;return f.$q=t,f.SalePageService=i,f.ShopId=r,f.CookieUtility=u,f.SalePageIds=f.CookieUtility.GetCookie("salePageViewList"),f}return __extends(t,n),t.prototype.GetSalePageDataByIds=function(t){return t===this.SalePageIds?(this.GetSalePageDataByIdsPromise||(this.GetSalePageDataByIdsPromise=n.prototype.CallHttpPromiseAction.call(this,this.SalePageService.GetSalePageDataByIds(this.SalePageIds))),this.GetSalePageDataByIdsPromise):n.prototype.CallHttpPromiseAction.call(this,this.SalePageService.GetSalePageDataByIds(t))},t.$inject=["$q","SalePageService","ShopId","CookieUtility"],t}(n.BaseServiceImmediate);n.SalePageServiceImmediate=t;angular.module("NineYi.Mall.Services").service("SalePageServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r){var u=n.call(this,t)||this;return u.$q=t,u.ActivityService=i,u.ShopId=r,u}return __extends(t,n),t.prototype.GetActivityList=function(t){return t===this.ShopId?(this.GetActivityListPromise||(this.GetActivityListPromise=n.prototype.CallHttpPromiseAction.call(this,this.ActivityService.GetActivityList(this.ShopId))),this.GetActivityListPromise):n.prototype.CallHttpPromiseAction.call(this,this.ActivityService.GetActivityList(t))},t.$inject=["$q","ActivityService","ShopId"],t}(n.BaseServiceImmediate);n.ActivityServiceImmediate=t;angular.module("NineYi.Mall.Services").service("ActivityServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i){var r=n.call(this,t)||this;return r.$q=t,r.ProductStockService=i,r.IdList=[],r.IsIdListChanged=function(n){if(n.length===r.IdList.length){var t=n.sort(function(n,t){return n-t}),i=r.IdList.sort(function(n,t){return n-t});return t.some(function(n,t){return n!==i[t]})}return!0},r.defer=r.$q.defer(),r.GetSellingQtyListNewPromise=r.defer.promise,r}return __extends(t,n),t.prototype.GetSellingQtyListNew=function(t){var i=this;return this.IdList.length!==0&&this.IsIdListChanged(t)&&(this.defer=this.$q.defer(),this.IdList=t),n.prototype.CallHttpPromiseAction.call(this,this.ProductStockService.GetSellingQtyListNew(t)).then(function(n){i.defer.resolve(n.data);i.GetSellingQtyListNewPromise=i.defer.promise;i.IdList=t}),this.defer.promise},t.$inject=["$q","ProductStockService"],t}(n.BaseServiceImmediate);n.ProductStockServiceImmediate=t;angular.module("NineYi.Mall.Services").service("ProductStockServiceImmediate",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.$log=r;this.WebApiFactory=u}return n.prototype.GetVIPMemberHashInfoForFbPixel=function(n,t){var u=this,i=this.$q.defer(),r;return t?(r=this.config.webapiUrl+("/Advertise/GetVIPMemberHashInfoForAdvertise/"+n),this.$http.get(r,{withCredentials:!0}).then(function(n){var t=n.data&&n.data.Data&&n.data.Data.PhoneHashed,r=n.data&&n.data.Data&&n.data.Data.EmailHashed;t&&localStorage.setItem("ph",t);r&&localStorage.setItem("em",r);i.resolve();u.$log.info("GetVIPMemberHashInfoForFbPixel - finish")}).catch(i.reject)):i.resolve(),i.promise},n.$inject=["Mall.Config","$q","$http","$log","WebApiFactory"],n}();n.FacebookPixelService=t;angular.module("NineYi.Mall.Services").service("FacebookPixelService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i}return n.prototype.GetMobileAppSettings=function(n){var t=this.$q.defer(),i=this.config.webapiUrl+"/AppNotification/GetMobileAppSettings/"+n;return this.$http.get(i).then(function(n){if(n){var i=n.data,r=i.ReturnCode,u=i.Data,f=i.Message;r==="API0001"?t.resolve(u):t.reject(f)}}).catch(t.reject),t.promise},n.$inject=["Mall.Config","$q","$http"],n}();n.AppNotificationService=t;angular.module("NineYi.Mall.Services").service("AppNotificationService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i}return n.prototype.GetHadSelectedService=function(){var t=this.config.webapiUrl+"/Retailstore/HadSelectedService",n=this.$q.defer();return this.$http.get(t).then(function(t){n.resolve(t.data)}).catch(function(t){n.reject(t.data)}),n.promise},n.prototype.GetHasStockLocationInfo=function(n,t){var r=this.config.webapiUrl+"/RetailStore/GetHasStockLocationInfo?shopId="+n+"&salePageId="+t,i=this.$q.defer();return this.$http.get(r).then(function(n){n.data.ReturnCode==="API0001"?i.resolve(n.data.Data):i.reject(n.data.Message)}).catch(function(n){i.reject(n.data)}),i.promise},n.$inject=["Mall.Config","$q","$http"],n}();n.RetailStoreService=t;angular.module("NineYi.Mall.Services").service("RetailStoreService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i;this.WebApiFactory=r}return n.prototype.GetRegularOrderList=function(n,t,i){i===void 0&&(i=10);var u=this.config.webapiUrl+"/RegularOrder/GetList?shopId="+n+"&startIndex="+t+"&maxCount="+i,r=this.$q.defer();return this.$http.get(u).then(function(n){r.resolve(n.data)}).catch(function(n){r.reject(n.data)}),r.promise},n.prototype.CancelRegularOrder=function(n,t){var r=this.config.webapiUrl+"/RegularOrder/Cancel",u={regularOrderId:n,cancelCause:t},i=this.$q.defer();return this.$http.post(r,u).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n.data)}),i.promise},n.prototype.GetRegularSalePageSetting=function(n,t){var r=this.WebApiFactory.getWebApiUrl("/RegularOrder/GetRegularSalePageSetting?shopId="+n+"&salePageId="+t),i=this.$q.defer();return this.$http.get(r).then(function(n){i.resolve(n.data)}).catch(function(n){i.reject(n.data)}),i.promise},n.$inject=["Mall.Config","$q","$http","WebApiFactory",],n}();n.RegularOrderService=t;angular.module("NineYi.Mall.Services").service("RegularOrderService",t)})(t=n.Services||(n.Services={}))})(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){this.config=n;this.$q=t;this.$http=i}return n.prototype.Stash=function(n,t,i){var r=this.$q.defer(),u=this.config.webapiUrl+"/FrontEndInfo/Stash/Liff",f={shopId:n,frontEndType:t,liffSizeType:i};return this.$http.post(u,f).then(function(n){r.resolve(n.data)}).catch(function(){return r.reject()}),r.promise},n.$inject=["Mall.Config","$q","$http"],n}();n.FrontEndInfoService=t;angular.module("NineYi.Mall.Services").service("FrontEndInfoService",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i,r){var u=n.call(this,t)||this;return u.$q=t,u.ShopCategoryService=i,u.ShopId=r,u}return __extends(t,n),t.prototype.GetShopCategoryTreeListByLevel=function(t){return t===this.ShopId?(this.GetShopCategoryTreeListByLevelPromise||(this.GetShopCategoryTreeListByLevelPromise=n.prototype.CallHttpPromiseAction.call(this,this.ShopCategoryService.GetShopCategoryTreeListByLevel(t))),this.GetShopCategoryTreeListByLevelPromise):n.prototype.CallHttpPromiseAction.call(this,this.ShopCategoryService.GetShopCategoryTreeListByLevel(t))},t.$inject=["$q","ShopCategoryService","ShopId"],t}(n.BaseServiceImmediate);n.ShopCategoryServiceImmediate=t;angular.module("NineYi.Mall.Services").service("ShopCategoryServiceImmediate",t)})(t=n.Services||(n.Services={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var r,i;(function(n){n[n.initial=0]="initial";n[n.submit=1]="submit";n[n.apiCallback=2]="apiCallback"})(r||(r={}));i=function(){function t(n,t){this.$q=n;this.$uibModal=t}return t.prototype.AddToCart=function(n,t,i,r,u,f){var e=this.$q.defer(),o={templateUrl:"/V2/TypeScripts/Utilities/ShoppingCartUtility/addToCart.html",size:"lg",windowClass:"add-to-cart-modal",backdrop:!0,keyboard:!1,resolve:{addToCartConfig:function(){return{salePageId:n,shopId:t,chooseSkuItem:i,position:r,listName:u,isSkuQtyAccumulate:f}}},controller:"AddToShoppingCartController as AddToShoppingCartCtrl"},s=this.$uibModal.open(o);return s.result.then(e.resolve).catch(e.reject),e.promise},t.prototype.AddToBasket=function(n,t,i,r,u){var f=this.$q.defer(),e={templateUrl:"/V2/TypeScripts/Utilities/ShoppingCartUtility/addToBasket.html",size:"lg",windowClass:"add-to-cart-modal",backdrop:!0,keyboard:!1,resolve:{addToCartConfig:function(){return{salePageId:n,shopId:t,position:r,listName:u,selectedSalePageSkuQtyList:i}}},controller:"AddToBasketController as AddToBasketCtrl"},o=this.$uibModal.open(e);return o.result.then(f.resolve).catch(f.reject),f.promise},t.prototype.AddToCartResult=function(n,t,i){var r=this.$q.defer(),u={templateUrl:"/V2/TypeScripts/Utilities/ShoppingCartUtility/addToCartResult.html",size:"sm",windowClass:"result-modal",backdrop:"static",keyboard:!1,resolve:{addToCartConfig:function(){return{message:n,autoClose:t,isOK:i}}},controller:"AddToShoppingCartController as AddToShoppingCartCtrl"},f=this.$uibModal.open(u);return f.result.then(r.resolve).catch(r.reject),r.promise},t.prototype.IsDisabledSubmitBtn=function(n,t){if(n===void 0&&(n="initial"),n==="initial")return!1;if(n==="submit")return!0;if(n==="apiCallback")switch(t){case"API0002":case"API0004":case"API0005":case"API0007":case"API9001":return!1;default:return!0}},t.prototype.CheckHasRegularOrder=function(t){if(!t)return!1;var i=!1,r=n.WebStore.Frontend.BE.SalePage.SaleProductShippingTypeEnum;return t.forEach(function(n){if(i)return!1;i=n.SalePageList.some(function(n){return n.SaleProductShippingTypeDef===r[r.RegularOrder]})}),i},t.$inject=["$q","$uibModal"],t}();t.ShoppingCartUtility=i;angular.module("NineYi.Mall.Utilities").service("ShoppingCartUtility",i)})(i=t.Utilities||(t.Utilities={}))})(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){this.$filter=t;this.CurrentLocale=i;this.$translate=r;this.Locales=["zh-tw","zh-hk","zh-cn"];this.ECouponDiscountTypeEnum=n.WebStore.Frontend.BE.ECoupon.ECouponDiscountTypeDefEnum}return t.prototype.CheckIsTargetLocale=function(n,t){return t.includes(n)},t.prototype.ReturnDiscountRate=function(n){return this.CheckIsTargetLocale(this.CurrentLocale.toLowerCase(),this.Locales)?Math.round(n*100%10==0?n*10:n*100):Math.round((1-n)*100)},t.prototype.ReturnECouponDiscountWording=function(n,t,i){var r;switch(this.ECouponDiscountTypeEnum[n]){case this.ECouponDiscountTypeEnum.ByPrice:case this.ECouponDiscountTypeEnum.FreeShippingByPrice:r=this.$filter("preferredCurrency")(i||0);break;case this.ECouponDiscountTypeEnum.ByPercent:case this.ECouponDiscountTypeEnum.FreeShippingByPercent:r=this.$translate.instant("frontend.typescripts.common.discount_percent",{val0:this.ReturnDiscountRate(t).toString()});break;default:r=""}return r},t.prototype.ReturnMaxDiscountLimit=function(n,t){var i;switch(this.ECouponDiscountTypeEnum[n]){case this.ECouponDiscountTypeEnum.ByPrice:case this.ECouponDiscountTypeEnum.FreeShippingByPrice:i=(t*100).toFixed(0)+"%";break;case this.ECouponDiscountTypeEnum.ByPercent:case this.ECouponDiscountTypeEnum.FreeShippingByPercent:i=this.$filter("preferredCurrency")(t||0);break;default:i=""}return i},t.$inject=["$filter","CurrentLocale","$translate"],t}();t.DiscountRateUtility=i;angular.module("NineYi.Mall.Utilities").service("DiscountRateUtility",i)})(i=t.Utilities||(t.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.getElementOffset=function(n){var i=document.documentElement,t=n.getBoundingClientRect(),r=t.top+window.pageYOffset-i.clientTop,u=t.left+window.pageXOffset-i.clientLeft,f=t.height;return{top:r,left:u,height:f}},n.prototype.GetOuterWidthWithMargin=function(n){var i=n.offsetWidth,t=getComputedStyle(n);return i+(parseInt(t.marginLeft)+parseInt(t.marginRight))},n.prototype.IsVisable=function(n){var t=n.getBoundingClientRect();return t.bottom>0&&t.right>0&&t.left<(window.innerWidth||document.documentElement.clientWidth)&&t.top<(window.innerHeight||document.documentElement.clientHeight)},n.prototype.HasScrollBar=function(n){return n.scrollHeight>n.offsetHeight||n.scrollWidth>n.offsetWidth},n.$inject=[],n}();n.ElementUtility=t;angular.module("NineYi.Mall.Utilities").factory("ElementUtility",function(){return new t})})(t=n.Utilities||(n.Utilities={}))})(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){this.$uibModal=n;this.$uibModalStack=t;this.$log=i;this.$q=r;this.IsOpen=!1}return t.prototype.ShowDownloadLinkResult=function(t,i){if(this.IsOpen==!1){this.IsOpen=!0;var r=this.$q.defer(),u={templateUrl:"/V2/TypeScripts/Utilities/AppDownloadUtility/AppDownload.html",windowClass:"download-app-popup",backdrop:!0,size:"sm",keyboard:!1,controller:["$scope","QRCodeImageUrl","DownloadAppUrl","AppDownloadUtility",function(r,u,f,e){r.QRCodeImageUrl=u;r.DownloadAppUrl=f;r.PhoneNumber=n.Mall.Configs.RegexPattern.Phone.test(t)?t.replace(t.substr(4,4),"****"):t;r.ReturnCode=i;r.Cancel=function(){e.Cancel()}}]};return this.$modalInstance=this.$uibModal.open(u),this.$modalInstance.result.then(r.resolve).catch(r.reject),r.promise}},t.prototype.Cancel=function(){this.$uibModalStack.close(this.$modalInstance);this.IsOpen=!1},t.$inject=["$uibModal","$uibModalStack","$log","$q"],t}();t.AppDownloadUtility=i;angular.module("NineYi.Mall.Utilities").service("AppDownloadUtility",i)})(i=t.Utilities||(t.Utilities={}))})(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){this.$log=n;this.DeviceValue=t;this.PageValue=i;this.RefUtility=r}return n.prototype.GetAppDownloadUrl=function(n,t,i){var r;return i===void 0&&(i=!1),this.DeviceValue.IsMobile()?(r=this.RefUtility.ReplaceRefUrl(this.PageValue.CurrentPage),i&&(r=r.replace("ref","v2/Official/LoginRef")),r):(r="/v2/Official/ShowQRCode/"+n,t&&(r+="?salePageId="+t),i&&(r=r.replace("ShowQRCode","LoginShowQRCode")),r)},n.$inject=["$log","DeviceValue","PageValue","RefUtility"],n}();n.AppDownloadUrlUtility=t;angular.module("NineYi.Mall.Utilities").service("AppDownloadUrlUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.AddCookie=function(n,t,i){var u="",r;i&&(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toUTCString());document.cookie=n+"="+t+u+"; path=/"},n.prototype.DeleteCookie=function(n){this.AddCookie(n,"",-1)},n.prototype.GetCookie=function(n){return(document.cookie.match("(^|; )"+n+"=([^;]*)")||0)[2]},n.prototype.SetCookieExpireTime=function(n,t){var i=this.GetCookie(n),r=new Date(Date.now()+(t||0));return i&&(document.cookie=n+"="+i+";expires="+r.toUTCString()+";path=/;"),r.toUTCString()},n}();n.CookieUtility=t;angular.module("NineYi.Mall.Utilities").factory("CookieUtility",function(){return new t})})(t=n.Utilities||(n.Utilities={}))})(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){this.AppVersionUtility=t;this.DeviceValue=i;this.$window=r;this.GaSetting=this.$window.nineyi.googleAnalyticsSettingData;this.IsFromApp=this.AppVersionUtility.IsFromApp();var u=this.DeviceValue.GetDeviceOS()===n.Mall.Models.DeviceOsEnum.Bot;this.IsSetup=this.$window.ga&&this.GaSetting&&!this.IsFromApp&&!u}return t.$inject=["AppVersionUtility","DeviceValue","$window"],t}();t.GoogleAnalyticsConfig=i;angular.module("NineYi.Mall.Utilities").service("GoogleAnalyticsConfig",i)})(i=t.Utilities||(t.Utilities={}))})(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){this.PageValue=n;this.GoogleAnalyticsConfig=t;this.$q=i;this.$window=r;this.AuthService=u;this.AuthServiceImmediate=f;this.VipMemberService=e;this.UserInfo={}}return t.prototype.SetUserDimension=function(t,i){var r=this,u=this.$q.defer();return this.GoogleAnalyticsConfig.IsSetup&&this.GetUserInfo().then(function(){if(r.SetDimension("userId",r.UserInfo.UserId),r.SetDimension("dimension1",r.UserInfo.UserId||t),r.SetDimension("dimension2",r.UserInfo.IdentityType),i){var f=r.$window.ga.getAll(),e=f&&f[0].get("clientId");r.SetDimension("dimension41",""+e)}r.PageValue.CurrentPage===n.Mall.Models.PageNameEnum.SalePageIndex&&r.SetDimension("dimension5",r.GetSalePageId());u.resolve()}),u.promise},t.prototype.SetHitLevelDimension=function(){var n=this,t=this.$q.defer();return this.GoogleAnalyticsConfig.IsSetup&&this.GetUserInfo().then(function(){n.$window.ga("set","dimension3",n.UserInfo.LoginStatus.toString());var i=(n.UserInfo.UserId?n.UserInfo.UserId:"")+"//"+n.UserInfo.IdentityType+"//"+n.UserInfo.LoginStatus;n.$window.ga("set","dimension4",i);t.resolve()}),t.promise},t.prototype.GetUserInfo=function(){var n=this,t=this.$q.defer(),i=this.UserInfo.UserId?this.UserInfo.UserId:(document.cookie.match("(^|; )MID=([^;]*)")||0)[2];return i&&typeof this.AuthService.LoginStatus!="undefined"?(this.UserInfo.LoginStatus=+this.AuthService.LoginStatus,this.UserInfo.UserId=i,this.UserInfo.IdentityType=this.UserInfo.UserId?"MID":"gaClientId",t.resolve()):this.AuthServiceImmediate.IsLoginPromise.then(function(i){n.UserInfo.LoginStatus=+i;n.UserInfo.UserId=(document.cookie.match("(^|; )MID=([^;]*)")||0)[2];n.UserInfo.IdentityType=n.UserInfo.UserId?"MID":"gaClientId";t.resolve()}),t.promise},t.prototype.GetSalePageId=function(){var n=new RegExp("/salepage/index/","ig");return window.location.pathname.replace(n,"")},t.prototype.SetVipMemberOuterIdDimension=function(n){var t=this,i=this.$q.defer();return this.AuthServiceImmediate.IsLoginPromise.then(function(r){if(!t.GoogleAnalyticsConfig.IsSetup||!r)return i.resolve();t.VipMemberService.GetVipMemberOuterId(n,r).then(function(n){var r=t.GoogleAnalyticsConfig.GaSetting.customOuidDimensionName,u=r.length>0;return n&&t.SetDimension(u?r:"dimension10",n),i.resolve()})}),i.promise},t.prototype.SetSalePageItemDimension=function(n,t){var i=this,r=this.$q.defer();return this.GoogleAnalyticsConfig.IsSetup&&this.GetUserInfo().then(function(){typeof n!="undefined"&&i.SetDimension("dimension39",n.toString());t&&i.SetDimension("dimension48",t);r.resolve()}),r.promise},t.prototype.SetDimension=function(n,t){this.$window.ga("set",n,t)},t.$inject=["PageValue","GoogleAnalyticsConfig","$q","$window","AuthService","AuthServiceImmediate","VipMemberService"],t}();t.GoogleAnalyticsCustomDataUtility=i;angular.module("NineYi.Mall.Utilities").service("GoogleAnalyticsCustomDataUtility",i)})(i=t.Utilities||(t.Utilities={}))})(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.pageValue=n;this.urlUtility=t;this.GaRefererName="garefersrc"}return n.prototype.GetAppendReferUrl=function(n,t){var i=n.indexOf("?")===-1?"?":"&";return n+i+this.GaRefererName+"="+t},n.prototype.GetListName=function(){var n="",t=this.urlUtility.GetQuerystring(this.GaRefererName);switch(t){case"TopViewAlsoView":n="推薦商品-商品頁TOP-ViewAlsoView";break;case"DownViewAlsoView":n="推薦商品-商品頁DOWN-ViewAlsoView";break;case"HotsaleInCategory":n="分類熱賣-商品頁";break;case"HotsaleOverall":n="全站熱銷排行-商品頁";break;case"BrowseHistory":n="瀏覽紀錄商品";break;case"PurchaseExtra":n="購物車推薦商品區";break;case"ThresholdPurchaseExtra":n="購物車滿額加價購區";break;default:n=this.pageValue.PreviousPageName}return n},n.$inject=["PageValue","UrlUtility"],n}();n.GoogleAnalyticsRefererUtility=t;angular.module("NineYi.Mall.Utilities").service("GoogleAnalyticsRefererUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.GoogleAnalyticsConfig=n;this.GoogleAnalyticsCustomDataUtility=t;this.$q=i;this.$window=r;this.config=u;this.ShopId=f;this.DefaultCurrencyCode=e;this.DefaultCountry=o;this.CurrentLocale=s;this.CurrencyCode=h;this.$log=c;this.GuidUtility=l;this.SalesMarketUtility=a}return n.prototype.InitGoogleAnalytics=function(n){var t=this,i;this.GoogleAnalyticsConfig.IsSetup&&(i={cookieDomain:document.location.hostname,allowLinker:!0,alwaysSendReferrer:!0,storage:null},this.GoogleAnalyticsConfig.GaSetting.isUseOriginalClientId||(i.clientId=this.GetClientId(),i.storage="none"),this.$window.ga("create",n,i),this.$window.ga("require","ec"),this.$window.ga("require","linker"),this.$window.ga("linker:autoLink",[this.GoogleAnalyticsConfig.GaSetting.originDomain!==""?this.GoogleAnalyticsConfig.GaSetting.originDomain:this.GoogleAnalyticsConfig.GaSetting.officialSsoDomain,]),this.$window.ga("require","displayfeatures"),this.$window.ga("set","currencyCode",this.SalesMarketUtility.GetSalesCurrency()),this.GoogleAnalyticsCustomDataUtility.SetDimension("dimension6",this.DefaultCountry.toLowerCase()),this.GoogleAnalyticsCustomDataUtility.SetDimension("dimension7",this.ShopId.toString()),this.GoogleAnalyticsCustomDataUtility.SetDimension("dimension8",this.CurrentLocale),this.GoogleAnalyticsCustomDataUtility.SetDimension("dimension9",this.CurrencyCode),this.GoogleAnalyticsConfig.GaSetting.isPassOuterMemberCode&&this.GoogleAnalyticsCustomDataUtility.SetVipMemberOuterIdDimension(this.ShopId),this.GoogleAnalyticsCustomDataUtility.SetUserDimension(i.clientId,this.GoogleAnalyticsConfig.GaSetting.isUseOriginalClientId).then(function(){t.$window.ga("set","page",t.$window.location.pathname+t.$window.location.search+t.$window.location.hash);t.SendPageView()}))},n.prototype.TrackPageUseOptional=function(n,t){this.GoogleAnalyticsConfig.IsSetup&&(this.$window.ga("set",{page:n,title:t}),this.SendPageView())},n.prototype.TrackEvent=function(n,t,i,r){if(this.GoogleAnalyticsConfig.IsSetup){var u=[this.SendTrackEvent(n,t,i,r),];return this.$q.all(u)}},n.prototype.hitCallBack=function(n){n.resolve()},n.prototype.SendTrackEvent=function(n,t,i,r){var u=this.$q.defer(),f;return this.GoogleAnalyticsCustomDataUtility.SetHitLevelDimension(),f={hitType:"event",eventCategory:n,eventAction:t,eventLabel:i,eventValue:r,hitCallback:this.hitCallBack(u)},this.$window.ga("send",f),u.resolve(),u.promise},n.prototype.SendPageView=function(){var n=this;this.GoogleAnalyticsCustomDataUtility.SetHitLevelDimension().then(function(){n.$window.ga("send","pageview")})},n.prototype.GetClientId=function(){var n=(document.cookie.match("(^|; )gaClientId=([^;]*)")||0)[2],t,i,r;return n||(n=this.GuidUtility.GenerateGuid(),t=new Date,i=731,t.setTime(t.getTime()+i*864e5),r="; expires="+t.toUTCString(),document.cookie="gaClientId="+n+r+"; path=/"),n},n.$inject=["GoogleAnalyticsConfig","GoogleAnalyticsCustomDataUtility","$q","$window","Mall.Config","ShopId","DefaultCurrencyCode","DefaultCountry","CurrentLocale","CurrencyCode","$log","GuidUtility","SalesMarketUtility"],n}();n.GoogleAnalyticsUtility=t;angular.module("NineYi.Mall.Utilities").service("GoogleAnalyticsUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.GoogleAnalyticsUtility=n;this.GoogleAnalyticsConfig=t;this.$window=i;this.$q=r}return n.prototype.SendImpression=function(n){var u=this,i;if(this.GoogleAnalyticsConfig.IsSetup){var t=angular.copy(n),f=t.length>10?Math.ceil(t.length/10):1,r=[];for(i=0;i<=f-1;i++)r=t.splice(0,10),r.map(function(n){u.$window.ga("ec:addImpression",n)});this.GoogleAnalyticsUtility.SendTrackEvent("ECommerce","scroll","Product Impression")}},n.prototype.SendProductClicks=function(n,t){var i=this.$q.defer();return this.AddProduct(n),this.$window.ga("ec:setAction","click",{list:t}),this.GoogleAnalyticsUtility.SendTrackEvent("ECommerce","click","Product Clicks").then(function(){i.resolve()}),i.promise},n.prototype.SendProductDetails=function(n,t){var i=this.$q.defer();return this.AddProduct(n),this.$window.ga("ec:setAction","detail",{list:t}),this.GoogleAnalyticsUtility.SendTrackEvent("ECommerce","click","Product Details").then(function(){i.resolve()}),i.promise},n.prototype.SendAddToCart=function(n){var t=this.$q.defer();return this.AddProduct(n),this.$window.ga("ec:setAction","add"),this.GoogleAnalyticsUtility.SendTrackEvent("ECommerce","click","Add To Cart").then(function(){t.resolve()}),t.promise},n.prototype.SendRemoveFromCart=function(n){var t=this.$q.defer();return this.AddProduct(n),this.$window.ga("ec:setAction","remove"),this.GoogleAnalyticsUtility.SendTrackEvent("ECommerce","click","Remove From Cart").then(function(){t.resolve()}),t.promise},n.prototype.SendCheckout=function(n,t,i){var u=this,r=this.$q.defer();return n.map(function(n){u.AddProduct(n)}),this.$window.ga("ec:setAction","checkout",{step:t,option:i}),this.GoogleAnalyticsUtility.SendTrackEvent("ECommerce","click","Checkout - Step"+t).then(function(){r.resolve()}),r.promise},n.prototype.SendPurchase=function(n,t,i,r,u,f){var o=this,e=this.$q.defer();return u.map(function(n){o.AddProduct(n)}),this.$window.ga("ec:setAction","purchase",{id:n,affiliation:t,revenue:i,shipping:r,coupon:f}),this.GoogleAnalyticsUtility.SendTrackEvent("ECommerce","Purchase",n).then(function(){e.resolve()}),e.promise},n.prototype.AddProduct=function(n){this.GoogleAnalyticsConfig.IsSetup&&this.$window.ga("ec:addProduct",n)},n.$inject=["GoogleAnalyticsUtility","GoogleAnalyticsConfig","$window","$q"],n}();n.GoogleAnalyticsEcommerceCommand=t;angular.module("NineYi.Mall.Utilities").service("GoogleAnalyticsEcommerceCommand",t)})(t=n.Utilities||(n.Utilities={}))})(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.$window=n;this.SalesMarketUtility=t;this.DataLayer=this.$window.dataLayer||[]}return n.prototype.ProductImpression=function(n){var i,t,r;if(this.DataLayer)for(i=n.length>10?Math.ceil(n.length/10):1,t=0;t<=i-1;t++)r=n.splice(0,10),this.DataLayer.push({event:"gtm.gaEnhance.productImpression",ecommerce:{currencyCode:this.SalesMarketUtility.GetSalesCurrency(),impressions:r}})},n.prototype.Checkout=function(n,t,i){var r=this;setTimeout(function(){r.DataLayer&&r.DataLayer.push({event:"gtm.gaEnhance.checkout",ecommerce:{checkout:{actionField:{step:t,option:i},products:n}}})},0)},n.prototype.Purchase=function(n,t,i,r,u,f){var e=this;this.DataLayer&&setTimeout(function(){e.DataLayer.push({event:"gtm.gaEnhance.purchase",ecommerce:{purchase:{actionField:{id:n,affiliation:t,revenue:i,shipping:r,coupon:f},products:u}}})},0)},n.prototype.OrderDetail=function(n){this.DataLayer&&this.DataLayer.push({event:"gtm.orderCompleted",transactionTotal:n})},n.prototype.AddToCart=function(n,t,i){this.DataLayer&&this.DataLayer.push({event:"gtm.addToCart",google_tag_params_addtocart:{dynx_itemid:n,dynx_quantity:t,dynx_price:i}})},n.prototype.ProductDetail=function(n){this.DataLayer&&(this.DataLayer.push({event:"gtm.productDetail",google_tag_params:{dynx_itemid:n.Id,dynx_itemtitle:n.Title,dynx_finalurl:n.PageUrl,dynx_imageurl:n.MainImage,dynx_itemsubtitle:n.ShopName,dynx_itemdescription:n.Desc,dynx_itemcategory:n.Category,dynx_price:n.SuggestPrice+" "+n.Currency,dynx_saleprice:n.Price+" "+n.Currency,dynx_contextualkeyword:n.Keyword,dynx_pagetype:"offerdetail"}}),this.DataLayer.push({google_tag_params_product:this.GetGoogleTagParamsProduct(n)}))},n.prototype.Category=function(n,t){this.DataLayer&&this.DataLayer.push({fullcategory:n,shopname:t})},n.prototype.CategoryProduct=function(n){this.DataLayer&&this.DataLayer.push({dynx_productids:n})},n.prototype.ProductCheckOut=function(n){var i=this,t;this.DataLayer&&(t=[],n.map(function(n){t.push(i.GetGoogleTagParamsProduct(n))}),this.DataLayer.push({google_tag_params_products:t}))},n.prototype.SearchSubmit=function(n,t){this.DataLayer&&this.DataLayer.push({dynx_searchwords:n,dynx_searchproductids:t})},n.prototype.GetGoogleTagParamsProduct=function(n){return{dynx_itemid:n.Id,dynx_itemtitle:n.Title,dynx_finalurl:n.PageUrl,dynx_imageurl:n.MainImage,dynx_itemsubtitle:n.ShopName,dynx_itemdescription:n.Desc,dynx_itemcategory:n.Category,dynx_price:n.SuggestPrice,dynx_saleprice:n.Price,dynx_contextualkeyword:n.Keyword,dynx_pagetype:"offerdetail",dynx_quantity:n.Quantity,dynx_fullcategory:n.FullCategory,dynx_currency:n.Currency,dynx_valid:n.Valid}},n.$inject=["$window","SalesMarketUtility"],n}();n.GoogleTagManagerDataLayerUtility=t;angular.module("NineYi.Mall.Utilities").service("GoogleTagManagerDataLayerUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.GoogleAnalyticsEcommerceCommand=n;this.GoogleTagManagerDataLayerUtility=t;this.GoogleAnalyticsConfig=i;this.$window=r;this.$q=u}return n.prototype.ProductImpression=function(n){this.GoogleAnalyticsEcommerceCommand.SendImpression(n);this.GoogleTagManagerDataLayerUtility.ProductImpression(n)},n.prototype.ProductClicks=function(n,t){if(this.GoogleAnalyticsConfig.IsSetup){var i=[this.GoogleAnalyticsEcommerceCommand.SendProductClicks(n,t),];return this.$q.all(i)}},n.prototype.ProductDetails=function(n,t){if(this.GoogleAnalyticsConfig.IsSetup){var i=[this.GoogleAnalyticsEcommerceCommand.SendProductDetails(n,t),];return this.$q.all(i)}},n.prototype.AddToCart=function(n){if(this.GoogleAnalyticsConfig.IsSetup){var t=[this.GoogleAnalyticsEcommerceCommand.SendAddToCart(n),];return this.$q.all(t)}},n.prototype.RemoveFromCart=function(n){if(this.GoogleAnalyticsConfig.IsSetup){var t=[this.GoogleAnalyticsEcommerceCommand.SendRemoveFromCart(n),];return this.$q.all(t)}},n.prototype.Checkout=function(n,t,i){var r=this;setTimeout(function(){r.GoogleAnalyticsConfig.IsSetup&&r.GoogleAnalyticsEcommerceCommand.SendCheckout(n,t,i);r.GoogleTagManagerDataLayerUtility.Checkout(n,t,i)},0)},n.prototype.Purchase=function(n,t,i,r,u,f){var e=this;setTimeout(function(){e.GoogleAnalyticsConfig.IsSetup&&e.GoogleAnalyticsEcommerceCommand.SendPurchase(n,t,i,r,u,f);e.GoogleTagManagerDataLayerUtility.Purchase(n,t,i,r,u,f)},0)},n.$inject=["GoogleAnalyticsEcommerceCommand","GoogleTagManagerDataLayerUtility","GoogleAnalyticsConfig","$window","$q"],n}();n.GoogleAnalyticsEcommerceUtility=t;angular.module("NineYi.Mall.Utilities").service("GoogleAnalyticsEcommerceUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.$q=n;this.$window=t;this.$log=i}return n.prototype.GenerateGuid=function(){var n=Date.now();return typeof performance!="undefined"&&typeof performance.now=="function"&&(n+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(t==="x"?i:i&3|8).toString(16)})},n.$inject=["$q","$window","$log",],n}();n.GuidUtility=t;angular.module("NineYi.Mall.Utilities").service("GuidUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.$q=n;this.ShopId=t;this.FacebookPixelService=i;this.AuthServiceImmediate=r;this.Market=u;this.GuidUtility=f;this.TrackSessionStorageUtility=e;this.UrlUtility=o}return n.prototype.InitFacebook=function(){},n.prototype.TrackLeadEvent=function(){},n.prototype.TrackViewContentEvent=function(){},n.prototype.TrackAddToWishlistEvent=function(){},n.prototype.FacebookCompleteRegistrationEvent=function(){},n.prototype.FacebookInitiateCheckoutEvent=function(){},n.prototype.FacebookAddPaymentInfoEvent=function(){},n.prototype.FacebookPurchaseEvent=function(){},n.prototype.TrackSearchEvent=function(){},n.$inject=["$q","ShopId","FacebookPixelService","AuthServiceImmediate","Market","GuidUtility","TrackSessionStorageUtility","UrlUtility"],n}();n.FacebookUtility=t;angular.module("NineYi.Mall.Utilities").service("FacebookUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t,i;(function(n){n[n.SpecA=0]="SpecA";n[n.SpecB=1]="SpecB"})(t||(t={}));i=function(){function n(n,t,i,r,u,f,e,o,s,h){var c=this;this.$q=n;this.$log=t;this.$window=i;this.AuthService=r;this.PageValue=u;this.ShopId=f;this.ShoppingCartService=e;this.CategoryService=o;this.CookieUtility=s;this.SalePageService=h;this.Core={language:"zh",currencyCode:"twd"};this.TestingShops=[230,232,226,225,64,8,11203,11970];this.StoreTrackingConfig={SpecA:[1257,230,226,11203],SpecB:[232,8,64,4408,39255,11970,41311,41287]};this.trackSearchSuggestClick=function(n,t){(c.IsAdobeTrackerShop||c.IsTesting)&&(c.$window.digitalData.eventData={searchResults:{searchTerm:n,searchSuggestionName:t}},c.$window.digitalData.event="searchSuggestionClick")};this.trackQuickView=function(n){if((c.IsAdobeTrackerShop||c.IsTesting)&&n){var t=n.id,i=n.name,r=n.price;c.sendDigitalDataEvent("quickView",{product:[{id:t,name:i,badge:undefined,price:r,discountAmount:0},]})}};this.sendDigitalDataEvent=function(n,t){window.digitalData=window.digitalData||{};window.digitalData.eventData=t;window.digitalData.event=n};this.PageName=this.PageValue.CurrentPageNameEn;this.Breadcrumb=this.PageValue.CurrentPageNameEn}return n.prototype.InitAdobeAnalytics=function(n){var i=n.toLowerCase();this.IsAdobeTrackerShop=i==="true";this.TestingShops.indexOf(this.ShopId)>=0&&(this.IsTesting=!0,this.$log.info("IsTesting store: "+this.ShopId));(this.IsAdobeTrackerShop||this.IsTesting)&&(typeof this.$window.digitalData=="undefined"&&(this.$window.digitalData={}),this.StoreTrackingConfig.SpecA.indexOf(this.ShopId)>=0?this.ConfigSpec=t.SpecA:this.StoreTrackingConfig.SpecB.indexOf(this.ShopId)>=0&&(this.ConfigSpec=t.SpecB),this.TrackPageView(this.PageName))},n.prototype.TrackPageView=function(n){["Product Category","Product Page","Search","Shopping Cart","Order Confirmation",null].indexOf(n)<0&&this.CoreDataLayer()},n.prototype.CoreDataLayer=function(){var n=this;this.GetUserInfo().then(function(){if(n.$window.digitalData={core:n.Core,page:{pageName:n.PageName,pageType:n.PageName==="Home"?"Home":"content",breadcrumb:n.Breadcrumb},visitor:n.VisitorInfo},n.ConfigSpec===t.SpecA){n.$log.info("Timberland core data layer");switch(n.PageName){case"Home":n.$window._satellite.track("page ready - homepage");break;case"My Wishlist":n.$window._satellite.track("page ready - wish list");break;case"Vip Member":case"My Orders":case"My Coupons":case"FAQ":case"Addressee List":case"Invoice List":case"Change Password":case"Membership Terms":n.$window._satellite.track("page ready - my account");break;default:n.$window._satellite.track("page ready - content")}}n.ConfigSpec===t.SpecB&&(n.$log.info("Kipling core data layer"),n.$window._satellite.track("page ready"));n.IsTesting&&(n.$log.info("AdobeAnalytics CoreDataLayer"),n.$log.info(n.$window.digitalData))})},n.prototype.ErrorPage=function(n,i){var r=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.GetUserInfo().then(function(){r.$window.digitalData={core:r.Core,page:{pageType:n,errorCode:i},visitor:r.VisitorInfo};r.ConfigSpec===t.SpecA&&(r.$log.info("Timberland page ready - error"),r.$window._satellite.track("page ready - error"));r.ConfigSpec===t.SpecB&&(r.$log.info("Kipling page ready"),r.$window._satellite.track("page ready"));r.IsTesting&&(r.$log.info("AdobeAnalytics ErrorPage"),r.$log.info(r.$window.digitalData))})},n.prototype.ProductListingPage=function(n,i,r,u){var f=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.GetUserInfo().then(function(){f.CategoryService.GetShopCategoryNavigation(u).then(function(u){f.$window.digitalData={core:f.Core,page:{pageName:n,pageType:"plp",breadcrumb:i},ecommerce:{category:{primaryCategory:u.Data.Level1_ShopCategory_Name,subCategory1:u.Data.Level2_ShopCategory_Name?u.Data.Level2_ShopCategory_Name:"",subCategory2:u.Data.Level3_ShopCategory_Name?u.Data.Level3_ShopCategory_Name:"",totalResultCount:r.length},product:f.ProductsArray(r)},visitor:f.VisitorInfo};f.ConfigSpec===t.SpecA&&(f.$log.info("Timberland page ready"),f.$window._satellite.track("page ready - plp"));f.ConfigSpec===t.SpecB&&(f.$log.info("Kipling page ready"),f.$window._satellite.track("page ready"));f.IsTesting&&(f.$log.info("AdobeAnalytics ProductListingPage"),f.$log.info(f.$window.digitalData))})})},n.prototype.ProductDisplayPage=function(n,i,r){var u=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.GetUserInfo().then(function(){var i=r.CategoryLevelName.Level1_ShopCategory_Name,f=r.CategoryLevelName.Level2_ShopCategory_Name?r.CategoryLevelName.Level2_ShopCategory_Name:"",e=r.CategoryLevelName.Level3_ShopCategory_Name?r.CategoryLevelName.Level3_ShopCategory_Name:"";u.$window.digitalData={core:u.Core,page:{pageName:n,pageType:"pdp",breadcrumb:"首頁|"+(i?i+"|":"")+(""+(f?f+"|":""))+(""+(e?e:""))},ecommerce:{category:{primaryCategory:i,subCategory1:f,subCategory2:e},product:u.PDPProduct(r)},visitor:u.VisitorInfo};u.ConfigSpec===t.SpecA&&(u.$log.info("Timberland page ready"),u.$window._satellite.track("page ready - pdp"));u.ConfigSpec===t.SpecB&&(u.$log.info("Kipling page ready"),u.$window._satellite.track("page ready"));u.IsTesting&&(u.$log.info("AdobeAnalytics ProductDisplayPage"),u.$log.info(u.$window.digitalData))})},n.prototype.StoreSearchResult=function(n,i,r,u){var f=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.GetUserInfo().then(function(){f.$window.digitalData={core:f.Core,page:{pageName:n,pageType:"search result",breadcrumb:i},searchResults:r,ecommerce:{product:f.ProductsArray(u)},visitor:f.VisitorInfo};f.ConfigSpec===t.SpecA&&(f.$log.info("Timberland page ready"),f.$window._satellite.track("page ready - search result"));f.ConfigSpec===t.SpecB&&(f.$log.info("Kipling page ready"),f.$window._satellite.track("page ready"));f.IsTesting&&(f.$log.info("AdobeAnalytics StoreSearchResult"),f.$log.info(f.$window.digitalData))})},n.prototype.StoreCart=function(n,i,r){var u=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.GetUserInfo().then(function(){u.$window.digitalData={core:u.Core,page:{pageName:n,pageType:"cart",breadcrumb:i},ecommerce:{checkoutStepName:"Cart",product:u.CheckoutProductsArray(r)},visitor:u.VisitorInfo};u.ConfigSpec===t.SpecA&&(u.$log.info("Timberland page ready"),u.$window._satellite.track("page ready - cart"));u.ConfigSpec===t.SpecB&&(u.$log.info("Kipling page ready"),u.$window._satellite.track("page ready"));u.IsTesting&&(u.$log.info("AdobeAnalytics StoreCart"),u.$log.info(u.$window.digitalData))})},n.prototype.StoreCheckoutStep=function(n,i,r,u,f){var e=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.GetUserInfo().then(function(){e.$window.digitalData={core:e.Core,page:{pageName:n,pageType:i,breadcrumb:r},ecommerce:{checkoutStepName:u,product:e.CheckoutProductsArray(f)},visitor:e.VisitorInfo};e.ConfigSpec===t.SpecA&&(e.$log.info("Timberland page ready"),e.$window._satellite.track("page ready - checkout"));e.ConfigSpec===t.SpecB&&(e.$log.info("Kipling page ready"),e.$window._satellite.track("page ready"));e.IsTesting&&(e.$log.info("AdobeAnalytics StoreCheckoutStep"),e.$log.info(e.$window.digitalData))})},n.prototype.StoreOrderConfirmation=function(n,i,r,u){var f=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.GetUserInfo().then(function(){f.$window.digitalData={core:f.Core,page:{pageName:n,pageType:"order confirmation",breadcrumb:i},ecommerce:{checkoutStepName:"Order Confirmation",orderID:r.orderID,orderSubTotal:r.orderSubTotal,orderTotal:r.orderTotal,tax:r.tax,shipping:r.shipping,shippingMethod:r.shippingMethod,paymentMethod:r.paymentMethod,giftCardAmount:r.giftCardAmount,promoCode:r.promoCode,orderDiscount:r.orderDiscount,shippingDiscount:r.shippingDiscount,product:f.CheckoutProductsArray(r.product)},visitor:{visitor:f.VisitorInfo,actions:{newsLetterSubscribed:u,newAccountCreated:""}}};f.ConfigSpec===t.SpecA&&(f.$log.info("Timberlnad page ready"),f.$window._satellite.track("page ready - order confirmation"));f.ConfigSpec===t.SpecB&&(f.$log.info("Kipling page ready"),f.$window._satellite.track("page ready"));f.IsTesting&&(f.$log.info("AdobeAnalytics StoreOrderConfirmation"),f.$log.info(f.$window.digitalData))})},n.prototype.InitSimpleEvent=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.event=n,this.IsTesting&&(this.$log.info("AdobeAnalytics InitSimpleEvent"),this.$log.info(n)))},n.prototype.AddToCart=function(n){var t=this;(this.IsAdobeTrackerShop||this.IsTesting)&&this.ShoppingCartService.GetCount(this.ShopId).then(function(i){t.$window.digitalData.eventData={product:t.AddToCartProducts(n),addToCartType:"add to cart",totalCartCount:i};t.$window.digitalData.event="addToCart";t.IsTesting&&(t.$log.info("AdobeAnalytics AddToCart Event"),t.$log.info(n),t.$log.info(t.$window.digitalData))})},n.prototype.AddToWishlist=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData=this.AddToWishlistProduct(n),this.$window.digitalData.event="addToWishlist",this.IsTesting&&(this.$log.info("AdobeAnalytics AddToWhishlist Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.SearchSuggestionClick=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={searchResult:n},this.$window.digitalData.event="searchSuggestionClick",this.IsTesting&&(this.$log.info("AdobeAnalytics SearchSuggestionClick Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.RemoveFromCart=function(n){var i=this;(this.IsAdobeTrackerShop||this.IsTesting)&&(this.ConfigSpec===t.SpecA&&(this.$window.digitalData.eventData=this.CartAddRemoveProduct(n),this.$window.digitalData.event="removeFromCart",this.IsTesting&&(this.$log.info("AdobeAnalytics RemoveFromCart Event"),this.$log.info(n),this.$log.info(this.$window.digitalData))),this.ConfigSpec===t.SpecB&&this.SalePageService.GetSalePage(parseInt(n.id,10)).then(function(t){n.suggestPrice=t.data.SuggestPrice;i.$window.digitalData.eventData=i.CartAddRemoveProduct(n);i.$window.digitalData.event="removeFromCart";i.IsTesting&&(i.$log.info("AdobeAnalytics RemoveFromCart Event"),i.$log.info(n),i.$log.info(i.$window.digitalData))}).catch(function(){n.suggestPrice=n.price;i.$window.digitalData.eventData=i.CartAddRemoveProduct(n);i.$window.digitalData.event="removeFromCart";i.IsTesting&&(i.$log.info("AdobeAnalytics RemoveFromCart Event"),i.$log.info(n),i.$log.info(i.$window.digitalData))}))},n.prototype.CartAddQuantity=function(n){var i=this;(this.IsAdobeTrackerShop||this.IsTesting)&&(this.ConfigSpec===t.SpecA&&(this.$window.digitalData.eventData=this.CartAddRemoveProduct(n),this.$window.digitalData.event="cartAddQuantity"),this.ConfigSpec===t.SpecB&&this.SalePageService.GetSalePage(parseInt(n.id,10)).then(function(t){n.suggestPrice=t.data.SuggestPrice;i.$window.digitalData.eventData=i.CartAddRemoveProduct(n);i.$window.digitalData.event="cartAddQuantity"}).catch(function(){i.$window.digitalData.eventData=i.CartAddRemoveProduct(n);i.$window.digitalData.event="cartAddQuantity"}),this.IsTesting&&(this.$log.info("AdobeAnalytics CartAddQuantity Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.LoadMoreProducts=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={product:this.ProductsArray(n)},this.$window.digitalData.event="loadMoreProducts",this.IsTesting&&(this.$log.info("AdobeAnalytics LoadMoreProducts Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.CheckoutStepProgress=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={checkoutStepName:n},this.$window.digitalData.event="checkoutStepProgress",this.IsTesting&&(this.$log.info("AdobeAnalytics CheckoutStepProgress Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.ApplyPromoCode=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={promoCode:n},this.$window.digitalData.event="applyPromoCode",this.IsTesting&&(this.$log.info("AdobeAnalytics ApplyPromoCode Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.NewsletterSubscription=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={newsletterSubscriptionLocation:n},this.$window.digitalData.event="newsletterSubscribed",this.IsTesting&&(this.$log.info("AdobeAnalytics NewsletterSubscription Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.ProductRecommendationClick=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData=this.RecommendationClickProduct(n),this.$window.digitalData.event="productRecommendationClick",this.IsTesting&&(this.$log.info("AdobeAnalytics ProductRecommendationClick Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.SocialShare=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={socialShareService:n},this.$window.digitalData.event="socialShareClick",this.IsTesting&&(this.$log.info("AdobeAnalytics SocialShare Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.VideoTracking=function(n){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={video:n},this.$window.digitalData.event="videoEvent",this.IsTesting&&(this.$log.info("AdobeAnalytics VideoTracking Event"),this.$log.info(n),this.$log.info(this.$window.digitalData)))},n.prototype.ApplyFilter=function(n,t){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={filterCategory:n,filterOption:t},this.$window.digitalData.event="applyFilter",this.IsTesting&&(this.$log.info("AdobeAnalytics ApplyFilter Event"),this.$log.info(n+" - "+t),this.$log.info(this.$window.digitalData)))},n.prototype.SkuSelect=function(n,t,i){(this.IsAdobeTrackerShop||this.IsTesting)&&(this.$window.digitalData.eventData={skuTitle:n,skuValue:t,sku:i},this.$window.digitalData.event="selectCustomSkuProperty",this.IsTesting&&(this.$log.info("AdobeAnalytics selectCustomSku Event"),this.$log.info(this.$window.digitalData)))},n.prototype.GetUserInfo=function(){var n=this,t=this.$q.defer();return this.AuthService.IsLogin().then(function(i){n.VisitorInfo={customerID:!i?"":n.CookieUtility.GetCookie("MID"),isRewardsMember:"",isLoggedIn:!!i};t.resolve()}),t.promise},n.prototype.PDPProduct=function(n){return this.ConfigSpec===t.SpecA?[{id:""+n.Id,name:n.Title,badge:"",ratingAvg:"",ratingCount:"",price:n.Price}]:this.ConfigSpec===t.SpecB?[{id:""+n.Id,name:n.Title,badge:"",ratingAvg:"",ratingCount:"",price:n.Price,sku:"",discountAmount:n.SuggestPrice-n.Price>0?n.SuggestPrice-n.Price:"",discountCode:""}]:void 0},n.prototype.AddToCartProducts=function(n){var i=this;return n.map(function(n){return i.ConfigSpec===t.SpecA?{id:n.id,style:i.ItemStyleCode(n.name),name:n.name,price:n.price,quantity:n.quantity,sku:n.sku}:i.ConfigSpec===t.SpecB?{id:n.id,style:i.ItemStyleCode(n.name),name:n.name,price:n.price,quantity:n.quantity,sku:n.sku,discountAmount:n.suggestPrice-n.price>0?n.suggestPrice-n.price:"",discountCode:""}:void 0})},n.prototype.CartAddRemoveProduct=function(n){return this.ConfigSpec===t.SpecA?{product:[{id:n.id,style:this.ItemStyleCode(n.name),name:n.name,price:n.price,quantity:n.quantity,sku:n.sku}]}:this.ConfigSpec===t.SpecB?{product:[{id:n.id,style:this.ItemStyleCode(n.name),name:n.name,price:n.price,quantity:n.quantity,sku:n.sku,discountAmount:n.suggestPrice-n.price>0?n.suggestPrice-n.price:"",discountCode:""}]}:void 0},n.prototype.ProductsArray=function(n){var i=this;return n.map(function(n){return i.ConfigSpec===t.SpecA?{id:""+n.Id,name:n.Title,badge:"",ratingAvg:"",ratingCount:"",price:n.Price}:i.ConfigSpec===t.SpecB?{id:""+n.Id,name:n.Title,badge:"",ratingAvg:"",ratingCount:"",price:n.Price,sku:"",discountAmount:n.SuggestPrice-n.Price>0?n.SuggestPrice-n.Price:"",discountCode:""}:void 0})},n.prototype.CheckoutProductsArray=function(n){var i=this;return[].concat.apply([],n.map(function(n){return n.SalePageList.map(function(n){return i.ConfigSpec===t.SpecA?{id:""+n.SalePageId,style:i.ItemStyleCode(n.Title),name:n.Title,price:n.Price,quantity:n.Qty,sku:""+n.SaleProductSKUId}:i.ConfigSpec===t.SpecB?{id:""+n.SalePageId,style:i.ItemStyleCode(n.Title),name:n.Title,price:n.Price,quantity:n.Qty,sku:""+n.SaleProductSKUId,discountAmount:n.SuggestPrice-n.Price>0?n.SuggestPrice-n.Price:"",discountCode:""}:void 0})}))},n.prototype.AddToWishlistProduct=function(n){return this.ConfigSpec===t.SpecA?{product:[{id:n.id,style:this.ItemStyleCode(n.name),name:n.name,price:n.price}]}:this.ConfigSpec===t.SpecB?{product:[{id:n.id,style:this.ItemStyleCode(n.name),name:n.name,price:n.price,sku:"",discountAmount:n.suggestPrice-n.price>0?n.suggestPrice-n.price:"",discountCode:""}]}:void 0},n.prototype.RecommendationClickProduct=function(n){return this.ConfigSpec===t.SpecA?{product:[{id:n[0].id,name:n[0].name}]}:this.ConfigSpec===t.SpecB?{product:[{id:n[0].id,sku:"",name:n[0].name}]}:void 0},n.prototype.ItemStyleCode=function(n){return n.indexOf("|")>=0&&n.slice(n.lastIndexOf("|")+1,n.length).length>0?n.slice(n.lastIndexOf("|")+1,n.length):""},n.$inject=["$q","$log","$window","AuthService","PageValue","ShopId","ShoppingCartService","CategoryService","CookieUtility","SalePageService"],n}();n.AdobeAnalyticsUtility=i;angular.module("NineYi.Mall.Utilities").service("AdobeAnalyticsUtility",i)})(t=n.Utilities||(n.Utilities={}))})(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){var r=this;this.$window=n;this.$log=t;this._=i;this.lineAdTrackingConfigList=[];this.checkIsEnable=function(){return window._lt&&r.lineAdTrackingConfigList&&r.lineAdTrackingConfigList.length>0};this.lineAdTrackingConfigList=this.$window.nineyi&&this.$window.nineyi.lineAdTrackingConfigList;angular.element(document).ready(function(){r.$window.setTimeout(function(){r.init()})})}return n.prototype.init=function(){var t=this,n;if(this.$log.debug("[tracking/lineAd] init start"),!this.checkIsEnable()){this.$log.warn("[tracking/lineAd] init stop, line ad is not enable");return}return n=this._.pluck(this.lineAdTrackingConfigList,"LineTagIdCode"),this._.map(n,function(n){window._lt("init",{customerType:"lap",tagId:n});t.$log.debug("[tracking/lineAd] init by tag, tagId: "+n)}),window._lt("send","pv",n)},n.prototype.addToCart=function(){if(!this.checkIsEnable()){this.$log.warn("[tracking/lineAd] addToCart stop, line ad is not enable");return}var n="AddToCart";return this.addToCartTagIdList=this.addToCartTagIdList||this.filterTagIdListByEventCode(n),this.sendCustomEvent(n,this.addToCartTagIdList)},n.prototype.viewContent=function(){if(!this.checkIsEnable()){this.$log.warn("[tracking/lineAd] viewContent stop");return}var n="ViewContent";return this.viewContentTagIdList=this.viewContentTagIdList||this.filterTagIdListByEventCode(n),this.sendCustomEvent(n,this.viewContentTagIdList)},n.prototype.registration=function(){if(!this.checkIsEnable()){this.$log.warn("[tracking/lineAd] registration stop, line ad is not enable");return}var n="Registration";return this.registrationTagIdList=this.registrationTagIdList||this.filterTagIdListByEventCode(n),this.sendCustomEvent(n,this.registrationTagIdList)},n.prototype.conversion=function(){if(!this.checkIsEnable()){this.$log.warn("[tracking/lineAd] conversion stop, line ad is not enable");return}return this.conversionTagIdList=this.conversionTagIdList||this.filterTagIdListByEventCode("Finish"),this.sendCustomEvent("Conversion",this.conversionTagIdList)},n.prototype.sendCustomEvent=function(n,t){return this.$log.debug("[tracking/lineAd] sendCustomEvent, params: "+JSON.stringify({type:n,tagIdList:t})),window._lt("send","cv",{type:n},t)},n.prototype.filterTagIdListByEventCode=function(n){return _.pluck(_.filter(this.lineAdTrackingConfigList,function(t){return _.find(t.LineTrackingEvent,function(t){return t===n})!==undefined}),"LineTagIdCode")},n.$inject=["$window","$log","underscore"],n}();n.LineAdUtility=t;angular.module("NineYi.Mall.Utilities").service("LineAdUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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.$window=n;this.$log=t;this.isYahooDotTagEnabled=!1}return n.$inject=["$window","$log"],n}();n.YahooDotTagUtility=t;angular.module("NineYi.Mall.Utilities").service("YahooDotTagUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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.$q=n;this.$log=t;this.$window=i;this.shopId=r;this.authServiceImmediate=u;this.UrlUtility=f;this.FacebookPixelService=e;this.trackingSdk=this.$window.nineyi.trackingSdk;this.getVIPMemberHashInfoForAdvertise=function(){var n=o.$q.defer(),t=!!(o.trackingSdk.facebookPixel&&o.trackingSdk.facebookPixel.checkIsEnableAdvancedPixel());return o.FacebookPixelService.GetVIPMemberHashInfoForFbPixel(o.shopId,t).then(function(){n.resolve()}).catch(function(){o.$log.debug("[TrackingDataUtility] GetVIPMemberHashInfoForFbPixel failed");n.reject()}),n.promise};this.checkIsThirdPartyNewRegistered=function(){var n=o.UrlUtility.GetQuerystring("isThirdPartyNewRegistered");return n==="true"||n==="false"}}return n.$inject=["$q","$log","$window","ShopId","AuthServiceImmediate","UrlUtility","FacebookPixelService"],n}();n.TrackingDataUtility=t;angular.module("NineYi.Mall.Utilities").service("TrackingDataUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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,y,p,w,b,k,d){var g=this;this.$q=n;this.$log=t;this.$window=i;this.shopId=r;this.defaultCurrencyCode=u;this.DefaultCountry=f;this.CurrentLocale=e;this.CurrencyCode=o;this.authServiceImmediate=s;this.market=h;this.GuidUtility=c;this.CookieUtility=l;this.GoogleAnalyticsEcommerceUtility=a;this.AdobeAnalyticsUtility=v;this.FacebookPixelService=y;this.GoogleAnalyticsUtility=p;this.SalesMarketUtility=w;this.UrlUtility=b;this.TrackingDataUtility=k;this.ShoppingCartService=d;this.trackingSdk=this.$window.nineyi.trackingSdk;this.trackPageViewDefer=this.$q.defer();this.checkIsTrackingSdkReady=function(){var n=!!g.trackingSdk;return n||g.$log.error("[trackingUtility] trackingSdk is not Ready "),n};this.trackInitialize=function(){try{if(!g.checkIsTrackingSdkReady())return;g.$log.debug("[trackingUtility] trackInitialize start");var i=(g.$window.nineyi||{}).googleAnalyticsSettingData,n=i===void 0?{}:i,u=n.GoogleAnalyticsTrackingId,f=n.GoogleAnalytics4TrackingId,e=n.originDomain,o=n.officialSsoDomain,s=n.isEnableVipMemberOuterIdDimension,r=g.$window.nineyi&&g.$window.nineyi.env||undefined,h={shopId:g.shopId,gaConfig:{googleAnalyticsTrackingId:u,originDomain:e,officialSsoDomain:o,isEnableVipMemberOuterIdDimension:s,countryName:g.DefaultCountry.toLowerCase(),customOuidDimensionName:""},gaFourConfig:{googleAnalyticsFourGTagId:f},fbPixelConfig:{isEnableAdvancedFacebookPixel:g.$window.IsEnableAdvancedFacebookPixel,allSiteFbPixelId:g.$window.AllSiteFbCustomAudiencesPixelId,customAudiencesPixelIds:g.$window.FbCustomAudiencesPixelIds},googleAdwordsConfig:{GoogleAdwordsTrackingIdList:window.GoogleAdwordsTrackingIdList,GoogleConversionData:window.GoogleConversionData,GoogleRemarketingData:window.GoogleRemarketingData},lineAdConfig:{isEnableLineAd:!0,tagEventSet:window.nineyi&&window.nineyi.lineAdTrackingConfigList},currency:g.SalesMarketUtility.GetSalesCurrency(),shopExtensionSetting:{},yahooConfig:{yahooGeminiTrackingInfoList:window.nineyi.yahooGeminiTrackingInfoList||[]},adobeAAConfig:{isEnable:!0},env:r?r.toLocaleLowerCase():null,market:g.market.toLocaleLowerCase(),silo:g.market==="PX"?"px":"91app",pageType:undefined,viewId:undefined,locale:g.CurrentLocale};g.trackingSdk.initialize(h);g.$log.debug("[trackingUtility] trackingSdkInitialize success")}catch(t){g.$log.error("[trackingUtility] trackingSdkInitialize failed",t&&t.message?t.message:t)}};this.trackPageView=function(){try{if(g.$log.debug("[trackingUtility] trackPageView start"),!g.checkIsTrackingSdkReady())return;var t=g.TrackingDataUtility.checkIsThirdPartyNewRegistered(),i=t?g.TrackingDataUtility.getVIPMemberHashInfoForAdvertise:null;g.$q.resolve(i).then(function(){g.sendPageView().then(function(){t&&g.trackingSdk.thirdPartyRegisterOrLoginEvent();g.trackPageViewDefer.resolve();g.$log.debug("[trackingUtility] trackPageView success")}).catch(function(){g.trackPageViewDefer.reject()})})}catch(n){g.$log.error("[trackingUtility] trackPageView failed",n&&n.message?n.message:n)}};this.sendPageView=function(){var n=g.$q.defer(),i=g.$window.nineyi&&g.$window.nineyi.env||undefined,r=g.market.toLocaleLowerCase(),u=g.market==="PX"?"px":"91app",t=g.shopId,f=g.TrackingDataUtility.checkIsThirdPartyNewRegistered(),e=f?g.TrackingDataUtility.getVIPMemberHashInfoForAdvertise():null,o=!!(g.trackingSdk&&g.trackingSdk.checkIsEnableCartList&&g.trackingSdk.checkIsEnableCartList({env:i,market:r,shopId:t,silo:u})),s=o?g.ShoppingCartService.GetPreview(t):null;return g.$q.all([g.authServiceImmediate.IsLoginPromise,s,e,]).then(function(t){var e=t[0],i=t[1],r=(g.$window.nineyi||{}).googleAnalyticsSettingData,u=r===void 0?{}:r,o=u.GoogleAnalyticsTrackingId,s=u.isPassOuterMemberCode,f=!!(g.trackingSdk.facebookPixel&&g.trackingSdk.facebookPixel.checkIsEnableAdvancedPixel()),h=f?localStorage.getItem("em"):null,c=f?localStorage.getItem("ph"):null,l=localStorage.getItem("phForTealiumIQ")||null,a=i&&i.ShopList&&i.ShopList[0]&&i.ShopList[0].SalePageList||[],v={isLogin:e,memberHashed:{emailHashed:h,phoneHashed:c,phoneHashedForTealiumIQ:l},isPassOuterMemberCode:s,currentCartList:a.map(function(n){return{id:n.SalePageId,name:n.Title,price:n.Price,quantity:n.Qty,suggestPrice:null}})||[],isDisableThridPartyRegisterOrLoginEvent:!0},y=g.GuidUtility.GenerateGuid();g.trackingSdk.pageView(v,y,g.CurrencyCode);g.GoogleAnalyticsUtility.InitGoogleAnalytics(o);g.$log.debug("[trackingUtility] trackPageView success");n.resolve()}),n.promise};this.trackInitialize();this.trackPageView()}return n.prototype.trackProductDetails=function(n,t){var f=this;try{if(!this.checkIsTrackingSdkReady()||!n||!n.productInfo)return;var s=n.categoryInfo,h=n.pageTitle,e=n.productInfo,o=n.isHidden,c=o===void 0?!1:o,i=e||{id:null,name:"",price:null,productOuterId:""},u=i.id,l=i.name,a=i.price,v=i.productOuterId,y=this.GuidUtility.GenerateGuid();this.trackPageViewDefer.promise.then(function(){f.GoogleAnalyticsEcommerceUtility.ProductDetails({id:u&&u.toString(),name:"("+u+")"+l,price:a,quantity:1},t);var n={categoryInfo:s,pageTitle:h,productInfo:e,productDesc:"",productMainImage:"",productOuterId:v,viewItemType:c?"HiddenSalePage":"SalePage"};f.trackingSdk.productDetails(n,y)})}catch(r){this.$log.error("[trackingUtility] trackProductDetails failed",r&&r.message?r.message:r)}},n.prototype.trackProductClick=function(n,t){try{if(!this.checkIsTrackingSdkReady())return;var r=n||{id:null,name:"",price:null},u=r.id,f=r.name,e=r.price,o={id:n&&n.id?u.toString():"",name:"("+u+")"+f,price:e};this.GoogleAnalyticsEcommerceUtility.ProductClicks(o,t)}catch(i){this.$log.error("[trackingUtility] trackProductClick failed",i&&i.message?i.message:i)}},n.prototype.trackAddToCart=function(n,t,i){var e=this;try{if(!this.checkIsTrackingSdkReady())return;i&&this.trackProductClick(n,t);var u=n||{id:null,name:"",price:null},o=u.id,h=u.name,c=u.price,s={id:n&&n.id?o.toString():"",name:"("+o+")"+h,price:c},f=this.GuidUtility.GenerateGuid();if(!(this.trackingSdk.adobeAnalytics&&this.trackingSdk.adobeAnalytics.checkIsEnableAdobeTrack())){this.trackingSdk.addToCart(n,f);this.GoogleAnalyticsEcommerceUtility.AddToCart(s);return}this.ShoppingCartService.GetCount(this.shopId).then(function(t){e.trackingSdk.addToCart(n,f,t)}).catch(function(){e.trackingSdk.addToCart(n,f)});this.GoogleAnalyticsEcommerceUtility.AddToCart(s)}catch(r){this.$log.error("[trackingUtility] trackAddToCart failed",r&&r.message?r.message:r)}},n.prototype.trackingSdkRemoveFromCart=function(n){try{if(!this.checkIsTrackingSdkReady())return;var t=n||{id:null,name:"",price:null,quantity:1,skuId:null},r=t.id,u=t.name,f=t.price,e=t.quantity,o=t.skuId;this.GoogleAnalyticsEcommerceUtility.RemoveFromCart({id:r?r.toString():"",name:u,price:f,quantity:e});this.trackingSdk.removeFromCart(n)}catch(i){this.$log.error("[trackingUtility] trackRemoveFromCart failed",i&&i.message?i.message:i)}},n.prototype.trackingSdkAddToFavorite=function(n,t){try{if(!this.checkIsTrackingSdkReady())return;var r=this.GuidUtility.GenerateGuid();this.trackingSdk.addToFavorite(n,r);this.GoogleAnalyticsUtility.TrackEvent(t,"收藏商品",n&&n.id?n.id.toString():"")}catch(i){this.$log.error("[trackingUtility] trackAddToFavorite failed",i&&i.message?i.message:i)}},n.prototype.trackingSdkRemoveFromFavorite=function(n){try{if(!this.checkIsTrackingSdkReady())return;this.trackingSdk.removeFromFavorite(n)}catch(t){this.$log.error("[trackingUtility] trackRemoveFromFavorite failed",t&&t.message?t.message:t)}},n.prototype.trackCheckout=function(n,t){var i=this;try{if(!this.checkIsTrackingSdkReady())return;this.$log.debug("[trackingUtility] trackCheckout start",{checkoutInfo:n,productList:t});var f=this.GuidUtility.GenerateGuid(),e=t.map(function(n){return{id:n.id.toString(),name:"("+n.id+")"+n.name,price:n.price,quantity:n.quantity,position:n.position}}),o=n.option,u=n.step;this.trackPageViewDefer.promise.then(function(){i.trackingSdk.checkout(n,t,f);i.GoogleAnalyticsEcommerceUtility.Checkout(e,u,o);u===2&&i.GoogleAnalyticsUtility.TrackPageUseOptional(i.$window.location.pathname+"/flow","付款與運送方式");i.$log.debug("[trackingUtility] trackCheckout success")})}catch(r){this.$log.error("[trackingUtility] trackCheckout failed",r&&r.message?r.message:r)}},n.prototype.trackPurchase=function(n,t){var r=this;try{if(!this.checkIsTrackingSdkReady())return;this.$log.debug("[trackingUtility] trackPurchase start",{purchaseInfo:n,productList:t});var u=n.orderId,f=n.shopName,e=n.orderTotal,o=n.shipping,s=t.map(function(n){var t=n||{id:null,name:"",price:null,quantity:1,position:null,categoryId:null,variant:null},i=t.id,s=t.name,f=t.price,e=t.quantity,o=t.position,r=t.categoryId,u=t.variant;return{id:i.toString(),name:"("+i+")"+n.name,price:f,quantity:e,position:o,category:r?r.toString():null,variant:u?u.toString():null}}),h=this.GuidUtility.GenerateGuid();this.trackPageViewDefer.promise.then(function(){r.trackingSdk.purchase(n,t,h);r.GoogleAnalyticsEcommerceUtility.Purchase(u,f,e,o,s);r.$log.debug("[trackingUtility] trackPurchase success",{purchaseInfo:n,productList:t})})}catch(i){this.$log.error("[trackingUtility] trackPurchase failed",i&&i.message?i.message:i)}},n.prototype.trackSelectContent=function(n){try{if(!this.checkIsTrackingSdkReady())return;this.trackingSdk.selectContent(n)}catch(t){this.$log.error("[trackingUtility] trackSelectContent failed",t&&t.message?t.message:t)}},n.prototype.trackLead=function(n){var r=this,i;try{if(!this.checkIsTrackingSdkReady()||!n)return;this.$log.debug("[trackingUtility] trackLead start",{leadInfo:n});i=this.GuidUtility.GenerateGuid();this.trackPageViewDefer.promise.then(function(){r.trackingSdk.lead(n,i);r.$log.debug("[trackingUtility] trackLead success",{leadInfo:n,eventId:i})})}catch(t){this.$log.error("[trackingUtility] trackLead failed",t&&t.message?t.message:t)}},n.prototype.trackSearchKeyword=function(n){var i=this,r;try{if(!this.checkIsTrackingSdkReady()||!n||!n.searchTerm)return;this.$log.debug("[trackingUtility] trackSearchKeyword start",{searchKeywordInfo:n});r=this.GuidUtility.GenerateGuid();this.trackPageViewDefer.promise.then(function(){i.trackingSdk.searchKeyword(n,r);i.GoogleAnalyticsUtility.TrackEvent("Header_搜尋","搜尋-Search",n.searchTerm);i.$log.debug("[trackingUtility] trackSearchKeyword success",{searchKeywordInfo:n,eventId:r})})}catch(t){this.$log.error("[trackingUtility] trackSearchKeyword failed",t&&t.message?t.message:t)}},n.prototype.trackIncreaseQuantity=function(n){var i=this;try{if(!this.checkIsTrackingSdkReady()||!n)return;this.$log.debug("[trackingUtility] trackIncreaseQuantity start",{productInfo:n});this.trackPageViewDefer.promise.then(function(){i.trackingSdk.increaseQuantity(n);i.$log.debug("[trackingUtility] trackIncreaseQuantity success",{productInfo:n})})}catch(t){this.$log.error("[trackingUtility] trackIncreaseQuantity failed",t&&t.message?t.message:t)}},n.prototype.trackReduceQuantity=function(n){var i=this;try{if(!this.checkIsTrackingSdkReady()||!n)return;this.$log.debug("[trackingUtility] trackReduceQuantity start",{productInfo:n});this.trackPageViewDefer.promise.then(function(){i.trackingSdk.reduceQuantity(n);i.$log.debug("[trackingUtility] trackReduceQuantity success",{productInfo:n})})}catch(t){this.$log.error("[trackingUtility] trackReduceQuantity failed",t&&t.message?t.message:t)}},n.prototype.trackQuickView=function(n){var i=this;try{if(!this.checkIsTrackingSdkReady()||!n)return;this.$log.debug("[trackingUtility] trackQuickView start",{productInfo:n});this.trackPageViewDefer.promise.then(function(){i.trackingSdk.quickView(n);i.$log.debug("[trackingUtility] trackQuickView success",{productInfo:n})})}catch(t){this.$log.error("[trackingUtility] trackQuickView failed",t&&t.message?t.message:t)}},n.prototype.trackProductRecommendationClick=function(n){var i=this;try{if(!this.checkIsTrackingSdkReady()||!n)return;this.$log.debug("[trackingUtility] trackProductRecommendationClick start",{productInfo:n});this.trackPageViewDefer.promise.then(function(){i.trackingSdk.productRecommendationClick(n);i.$log.debug("[trackingUtility] trackProductRecommendationClick success",{productInfo:n})})}catch(t){this.$log.error("[trackingUtility] trackProductRecommendationClick failed",t&&t.message?t.message:t)}},n.$inject=["$q","$log","$window","ShopId","DefaultCurrencyCode","DefaultCountry","CurrentLocale","CurrencyCode","AuthServiceImmediate","Market","GuidUtility","CookieUtility","GoogleAnalyticsEcommerceUtility","AdobeAnalyticsUtility","FacebookPixelService","GoogleAnalyticsUtility","SalesMarketUtility","UrlUtility","TrackingDataUtility","ShoppingCartService",],n}();n.TrackingUtility=t;angular.module("NineYi.Mall.Utilities").service("TrackingUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.GuidUtility=n}return n.prototype.getNormalEventIdFromStorage=function(n){var t=null;return sessionStorage.getItem(n)===null?(t=this.GuidUtility.GenerateGuid(),sessionStorage.setItem(n,t)):t=sessionStorage.getItem(n),t},n.prototype.getPvEventIdFromStorage=function(){var n=null,t=window.location.href.toUpperCase(),i=t.indexOf("INFO/PAYADVANCED")!==-1,r=sessionStorage.getItem("lastPage")!==t;return sessionStorage.getItem("pvevtid")===null||r&&!i?(n=this.GuidUtility.GenerateGuid(),sessionStorage.setItem("pvevtid",n)):n=sessionStorage.getItem("pvevtid"),sessionStorage.setItem("lastPage",t),n},n.$inject=["GuidUtility"],n}();n.TrackSessionStorageUtility=t;angular.module("NineYi.Mall.Utilities").service("TrackSessionStorageUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.$rootScope=n;this.$log=t;this.cfpLoadingBar=i}return n.prototype.EnableLoadingBar=function(){var n=this;this.$log.info("Enable Loading Bar");this.$rootScope.IsStillLoading=!0;this.$rootScope.$on("loadingBar:start",function(){n.cfpLoadingBar.start()});this.$rootScope.$on("loadingBar:finish",function(){n.$rootScope.IsStillLoading=!1;n.cfpLoadingBar.complete()})},n.prototype.ShowLoadingBar=function(){this.$log.debug("Show loading bar - Start");this.$rootScope.$emit("loadingBar:start")},n.prototype.HideLoadingBar=function(){this.$log.debug("Show loading bar - Finish");this.$rootScope.$emit("loadingBar:finish")},n.$inject=["$rootScope","$log","cfpLoadingBar"],n}();n.LoadingBarUtility=t;angular.module("NineYi.Mall.Utilities").service("LoadingBarUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=n.Mall.Models.SocialMediaEnum,r=function(){function n(){var n=navigator.userAgent;this.IsFirefox=n.indexOf("Firefox")!==-1;this.IsOpera=n.indexOf("Opera")!==-1;this.IsChrome=n.indexOf("Chrome")!==-1;this.IsSafari=n.indexOf("Safari")!==-1&&!this.IsChrome;this.IsWebkit=n.indexOf("WebKit")!==-1;this.IsIE=n.indexOf("Trident")>0||n.indexOf("MSIE")>0;this.IsIE6=n.indexOf("MSIE 6")>0;this.IsIE7=n.indexOf("MSIE 7")>0;this.IsIE8=n.indexOf("MSIE 8")>0;this.IsIE9=n.indexOf("MSIE 9")>0;this.IsIE10=n.indexOf("MSIE 10")>0;this.IsIE9_lower=this.IsIE6||this.IsIE7||this.IsIE8;this.IsIE11_upper=n.indexOf("MSIE")===-1&&n.indexOf("Trident")>0;this.IsIE10_upper=this.IsIE10||this.IsIE11_upper;this.IsIE9_upper=this.IsIE9||this.IsIE10_upper}return n.prototype.GetIsMobileBrowser=function(){var n=!1;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(n=!0),n},n.prototype.GetPageOfSocialMedia=function(){var n=navigator.userAgent;return n.indexOf("FB")!==-1?i.Facebook:n.indexOf("Line")!==-1?i.Line:n.indexOf("Instagram")!==-1?i.Instagram:i.UnKnown},n}();t.UserAgentUtility=r;angular.module("NineYi.Mall.Utilities").factory("UserAgentUtility",function(){return new r})})(i=t.Utilities||(t.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.utmSource=this.GetQuerystring("utm_source");this.utmMedium=this.GetQuerystring("utm_medium");this.utmCampaign=this.GetQuerystring("utm_campaign");this.utmTerm=this.GetQuerystring("utm_term");this.utmContent=this.GetQuerystring("utm_content");sessionStorage&&(this.utmSource&&sessionStorage.setItem("utmSource",this.utmSource),this.utmMedium&&sessionStorage.setItem("utmMedium",this.utmMedium),this.utmCampaign&&sessionStorage.setItem("utmCampaign",this.utmCampaign),this.utmTerm&&sessionStorage.setItem("utmTerm",this.utmTerm),this.utmContent&&sessionStorage.setItem("utmContent",this.utmContent))}return n.prototype.GetQuerystring=function(n,t){try{var i=RegExp("[?&]"+n+"=([^&]*)").exec(t?t:document.location.search);return i&&decodeURIComponent(decodeURIComponent(i[1].replace(/\+/g," ")))}catch(r){return null}},n.prototype.GetEscapeQueryString=function(n,t){try{return decodeURI((RegExp(n+"=(.+?)(&|$)").exec(t?t:document.location.search)||[,null])[1])}catch(i){return null}},n.prototype.GetHashstring=function(n,t){try{var r=decodeURIComponent(document.location.hash),i=RegExp("[#/&]"+n+"=([^&]*)").exec(t?t:r);return i&&decodeURIComponent(i[1].replace(/\+/g," "))}catch(u){return null}},n.prototype.AppendParameter=function(n,t,i,r){var s,e,f;r===void 0&&(r=!1);var h="",c=n.length;n.indexOf("#")>0&&(c=n.indexOf("#"),h=n.substring(n.indexOf("#"),n.length));var l=n.substring(0,c),o=l.split("?"),u="";if(o.length>1)for(s=o[1].split("&"),e=0;e<s.length;e++)f=s[e].split("="),!0&&f[0]==t||(u==""?u="?":u+="&",u+=f[0]+"="+(f[1]?f[1]:""));return u==""&&(u="?"),r?u="?"+t+"="+i+(u.length>1?"&"+u.substring(1):""):(u!==""&&u!="?"&&(u+="&"),u+=t+"="+(i?i:"")),o[0]+u+h},n.prototype.JsonToQueryString=function(n){var i=[],t;for(t in n)n[t]&&n[t]!==""&&i.push(t+"="+n[t]);return"?"+i.join("&")},n.prototype.RemoveQueryStringParam=function(n,t){var u=t.split("?")[0],f,i=[],e=t.indexOf("?")!==-1?t.split("?")[1]:"",r;if(e!==""){for(i=e.split("&"),r=i.length-1;r>=0;r-=1)f=i[r].split("=")[0],f===n&&i.splice(r,1);u=u+"?"+i.join("&")}return u},n}();n.UrlUtility=t;angular.module("NineYi.Mall.Utilities").service("UrlUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.ShopId=n;this.UrlUtility=t;this.$window=i}return t.prototype.ReplaceRefUrl=function(t){var f=this.$window.location.origin+"/ref/"+this.ShopId+"/",r="",i="",u=!1;switch(t){case n.Mall.Models.PageNameEnum.OfficailIndex:i="ShopHome";r=i+"/"+this.ShopId;break;case n.Mall.Models.PageNameEnum.SalePageIndex:i="SalePage";r=this.GetPageIdentityPath(i,new RegExp("/salepage/index/","ig"));break;case n.Mall.Models.PageNameEnum.SalePageCategory:i="ShopSalePageCategory";r=this.GetPageIdentityPath(i,new RegExp("/v2/official/SalePageCategory/","ig"));break;case n.Mall.Models.PageNameEnum.CouponDetail:i="Coupon";r=this.GetPageIdentityPath(i,new RegExp("/Coupon/Detail/","ig"));break;case n.Mall.Models.PageNameEnum.CouponList:i="Couponlist";r=i;break;case n.Mall.Models.PageNameEnum.VideoDetail:i="Video";r=this.GetPageIdentityPath(i,new RegExp("/Video/Detail/","ig"));break;case n.Mall.Models.PageNameEnum.ArticleDetail:i="Article";r=this.GetPageIdentityPath(i,new RegExp("/Article/Detail/","ig"));break;case n.Mall.Models.PageNameEnum.AlbumDetail:i="Album";r=this.GetPageIdentityPath(i,new RegExp("/Album/Detail/","ig"));break;case n.Mall.Models.PageNameEnum.VideoList:i="VideoList";r=i;break;case n.Mall.Models.PageNameEnum.ArticleList:i="ArticleList";r=i;break;case n.Mall.Models.PageNameEnum.AlbumList:i="AlbumList";r=i;break;case n.Mall.Models.PageNameEnum.ECouponDetail:i="eCoupon";r=this.GetPageIdentityPath(i,new RegExp("/v2/ECoupon/Detail/","ig"));break;case n.Mall.Models.PageNameEnum.ECouponList:i="eCouponList";r=i;break;case n.Mall.Models.PageNameEnum.PromotionDetail:i="promotion";r=this.GetPageIdentityPath(i,new RegExp("/v2/Promotion/Detail/","ig"));break;case n.Mall.Models.PageNameEnum.PromotionEngineDetail:i="PromotionEngine";r=this.GetPageIdentityPath(i,new RegExp("/v2/PromotionEngine/Detail/","ig"));break;case n.Mall.Models.PageNameEnum.ActivityIndex:i="activity";r=this.GetPageIdentityPath(i,new RegExp("/v2/activity/","ig"));break;case n.Mall.Models.PageNameEnum.ShopStoreList:i="LocationList";r=i;break;default:i="ShopHome";r=i+"/"+this.ShopId;u=!0}return f+r+this.GetUtmQueryString(null,"mweb","download_banner",u?"others":i)},t.prototype.GetUtmQueryString=function(n,t,i,r,u,f){var o=t||this.UrlUtility.GetQuerystring("utm_source",n),s=i||this.UrlUtility.GetQuerystring("utm_medium",n),h=r||this.UrlUtility.GetQuerystring("utm_campaign",n),c=u||this.UrlUtility.GetQuerystring("utm_term",n),l=f||this.UrlUtility.GetQuerystring("utm_content",n),a=this.UrlUtility.GetQuerystring("gclid"),v=this.UrlUtility.GetQuerystring("fbclid"),e="";return o&&(e=this.UrlUtility.AppendParameter(e,"utm_source",encodeURI(o))),s&&(e=this.UrlUtility.AppendParameter(e,"utm_medium",encodeURI(s))),h&&(e=this.UrlUtility.AppendParameter(e,"utm_campaign",encodeURI(h))),c&&(e=this.UrlUtility.AppendParameter(e,"utm_term",encodeURI(c))),l&&(e=this.UrlUtility.AppendParameter(e,"utm_content",encodeURI(l))),a&&(e=this.UrlUtility.AppendParameter(e,"gclid",encodeURI(a))),v&&(e=this.UrlUtility.AppendParameter(e,"fbclid",encodeURI(v))),e},t.prototype.GetPageIdentityPath=function(n,t){return n+"/"+this.$window.location.pathname.replace(t,"")},t.prototype.GetUtmDeeplinkTarget=function(){var t,n,r=this.UrlUtility.GetQuerystring("utm_source"),u=this.UrlUtility.GetQuerystring("utm_medium"),f=this.UrlUtility.GetQuerystring("utm_campaign"),e=this.UrlUtility.GetQuerystring("utm_Term"),o=this.UrlUtility.GetQuerystring("utm_content"),i=this.UrlUtility.GetQuerystring("q");if(r||u||f||e||o||!window.sessionStorage)t=window.location.origin+window.location.pathname,n=this.GetUtmQueryString(),i&&(n=this.UrlUtility.AppendParameter(n,"q",encodeURI(i))),t=t+n.toString();else{var s=sessionStorage.getItem("utmSource"),h=sessionStorage.getItem("utmMedium"),c=sessionStorage.getItem("utmCampaign"),l=sessionStorage.getItem("utmTerm"),a=sessionStorage.getItem("utmContent");t=window.location.origin+window.location.pathname;n=this.GetUtmQueryString(null,s,h,c,l,a);i&&(n=this.UrlUtility.AppendParameter(n,"q",encodeURI(i)));t=t+n.toString()}return t},t.$inject=["ShopId","UrlUtility","$window"],t}();t.RefUtility=i;angular.module("NineYi.Mall.Utilities").service("RefUtility",i)})(i=t.Utilities||(t.Utilities={}))})(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){var u=this;this.$scope=n;this.$uibModalInstance=t;this.config=i;this.$timeout=r;this.$scope.Message=this.config.UseNewLine?this.config.Message.replace(/\\n/g,"\n"):this.config.Message;this.$scope.ConfirmTitle=this.config.ConfirmTitle;this.$scope.CancelTitle=this.config.CancelTitle;this.$scope.ShowTitle=_.isBoolean(this.config.ShowTitle)?this.config.ShowTitle:!1;this.$scope.ShowClose=_.isBoolean(this.config.ShowClose)?this.config.ShowClose:!1;this.$scope.ShowOk=_.isBoolean(this.config.ShowOk)?this.config.ShowOk:!0;this.$scope.ShowCancel=_.isBoolean(this.config.ShowCancel)?this.config.ShowCancel:!1;this.$scope.AutoClose=_.isBoolean(this.config.AutoClose)?this.config.AutoClose:!1;this.$scope.UseNewLine=_.isBoolean(this.config.UseNewLine)?this.config.UseNewLine:!1;this.$scope.IsLongMessage=_.isBoolean(this.config.IsLongMessage)?this.config.IsLongMessage:!1;this.$scope.CloseDuration=this.config.CloseDuration||750;this.$scope.Title=this.config.Title||"";this.$scope.ToastMode=this.config.ToastMode;this.$scope.AutoClose&&(this.$scope.ShowOk=!1,this.$timeout(function(){u.Ok()},this.$scope.CloseDuration))}return n.prototype.Ok=function(){this.$uibModalInstance.close("ok")},n.prototype.Cancel=function(){this.$uibModalInstance.dismiss("cancel")},n.prototype.Close=function(){this.$uibModalInstance.dismiss("close")},n.$inject=["$scope","$uibModalInstance","dialogConfig","$timeout"],n}();n.DialogController=t;angular.module("NineYi.Mall.Utilities").controller("DialogController",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.$scope=n;this.$uibModalInstance=t;this.$translate=i;this.dialogCustomizeConfig=r;this.$scope.Title=this.dialogCustomizeConfig.Title;this.$scope.Model=this.dialogCustomizeConfig.Model}return n.prototype.Ok=function(){this.$uibModalInstance.close("ok")},n.prototype.Cancel=function(){this.$uibModalInstance.dismiss("cancel")},n.prototype.Close=function(){this.$uibModalInstance.dismiss("close")},n.$inject=["$scope","$uibModalInstance","$translate","DialogCustomizeConfig"],n}();n.DialogCustomizeController=t;angular.module("NineYi.Mall.Utilities").controller("DialogCustomizeController",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var r,t,i;(function(n){n[n.Center=0]="Center";n[n.Left=1]="Left";n[n.Right=2]="Right"})(r||(r={})),function(n){n.Success="success";n.Warning="warning"}(t||(t={}));i=function(){function n(n,i,r){this.$q=n;this.$uibModal=i;this.$translate=r;this.ToastModeEnum=t}return n.prototype.Notice=function(n,t,i,r){r===void 0&&(r=!1);var u=this.$q.defer(),f=!_.isUndefined(t)&&!_.isNull(t)&&t.trim().length!==0?t:this.$translate.instant("frontend.typescripts.components.ok_btn"),e={templateUrl:"/V2/TypeScripts/Utilities/DialogUtility/dialog.html",size:"sm",windowClass:"dialog-modal",backdrop:"static",keyboard:!1,resolve:{dialogConfig:function(){return{Message:n,ShowTitle:!1,ShowOk:!0,ShowCancel:!1,ShowClose:!1,ConfirmTitle:f,UseNewLine:i,IsLongMessage:r}}},controller:"DialogController as DialogCtrl"},o=this.$uibModal.open(e);return o.result.then(u.resolve).catch(u.reject),u.promise},n.prototype.AutoCloseNotice=function(n,t,i){t===void 0&&(t=this.$translate.instant("frontend.typescripts.components.ok_btn"));var r=this.$q.defer(),u={templateUrl:"/V2/TypeScripts/Utilities/DialogUtility/dialog.html",size:"sm",windowClass:"dialog-modal",backdrop:"static",keyboard:!1,resolve:{dialogConfig:function(){return{Message:n,ShowTitle:!1,ShowOk:!1,ShowCancel:!1,ShowClose:!1,AutoClose:!0,ConfirmTitle:t,CloseDuration:i}}},controller:"DialogController as DialogCtrl"},f=this.$uibModal.open(u);return f.result.then(r.resolve).catch(r.reject),r.promise},n.prototype.Confirm=function(n,t,i,r,u){r===void 0&&(r=!0);u===void 0&&(u="");var f=this.$q.defer(),e=!_.isUndefined(t)&&!_.isNull(t)&&t.trim().length!==0?t:this.$translate.instant("frontend.typescripts.components.ok_btn"),o=!_.isUndefined(i)&&!_.isNull(i)&&i.trim().length!==0,s=!_.isUndefined(u)&&!_.isNull(u)&&u.trim().length!==0,h={templateUrl:"/V2/TypeScripts/Utilities/DialogUtility/dialog.html",size:"sm",windowClass:"dialog-modal",backdrop:"static",keyboard:!1,resolve:{dialogConfig:function(){return{Title:u,Message:n,ShowTitle:s,ShowOk:!0,ShowCancel:o,ShowClose:r,ConfirmTitle:e,CancelTitle:i}}},controller:"DialogController as DialogCtrl"},c=this.$uibModal.open(h);return c.result.then(f.resolve).catch(f.reject),f.promise},n.prototype.Custom=function(n){var t=this.$q.defer(),i={templateUrl:n.templateUrl,size:"lg",windowClass:n.windowClass,backdrop:typeof n.backdrop=="undefined"?"static":n.backdrop,keyboard:!1,resolve:{dialogConfig:function(){return{Title:n.title,Model:n.model}}},controller:n.controller},r=this.$uibModal.open(i);return r.result.then(t.resolve).catch(t.reject),t.promise},n.prototype.Customize=function(n,t){var i=this.$q.defer(),r={templateUrl:n.TemplateUrl,size:n.Size||"lg",windowClass:n.WindowClass,backdropClass:n.BackdropClass,backdrop:n.Backdrop||"static",keyboard:!1,resolve:{DialogCustomizeConfig:function(){return{Title:t.Title,Model:t.Model}}},controller:n.Controller},u=this.$uibModal.open(r);return u.result.then(i.resolve).catch(i.reject),i.promise},n.prototype.Toast=function(n,t,i,r){r===void 0&&(r="");var u=this.$q.defer(),f={templateUrl:"/V2/TypeScripts/Utilities/DialogUtility/toast.html",size:"sm",windowClass:"toast-modal "+r,backdrop:"static",keyboard:!1,resolve:{dialogConfig:function(){return{Message:n,AutoClose:!0,ToastMode:t,CloseDuration:i?i:2500,ShowCancel:!1}}},controller:"DialogController as DialogCtrl"},e=this.$uibModal.open(f);return e.result.then(u.resolve).catch(u.reject),u.promise},n.$inject=["$q","$uibModal","$translate"],n}();n.DialogUtility=i;angular.module("NineYi.Mall.Utilities").service("DialogUtility",i)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},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){this.$q=n;this.$translate=t;this.$window=i;this.CurrentLocale=r;this.ShopId=u;this.AuthServiceImmediate=f;this.BackInStockService=e;this.VipMemberService=o;this.CookieUtility=s;this.DialogUtility=h;this.GoogleAnalyticsUtility=c;this.trackingUtility=l;this.BACK_IN_STOCK_LIMIT=100}return n.prototype.SubscribeBackInStock=function(n,t,i){var r=this,u=this.$q.defer();return this.CheckLogin(n,t).then(function(){return r.CheckVipMemberEmail()}).then(function(){return r.CheckSubscribedLimit(n)}).then(function(){return r.SubscribeProductSku(n,t,i)}).then(function(){return u.resolve()}).catch(function(){return u.reject()}),u.promise},n.prototype.UnsubscribeBackInStock=function(n,t,i){var r=this.$q.defer();return this.UnsubscribeProductSku(n,t,i).then(function(){return r.resolve()}).catch(function(){return r.reject()}),r.promise},n.prototype.SubscribeAfterLoginRedirect=function(n,t,i){var u=this,r=this.$q.defer();return this.CheckVipMemberEmail().then(function(){return u.CheckSubscribedLimit(n)}).then(function(){return u.SubscribeProductSku(n,t,i)}).then(function(){return r.resolve()}).catch(function(){return r.reject()}),r.promise},n.prototype.CheckBackInStockStatus=function(n,t){this.getSalePageDataToSubscribe().then(function(i){var r=i.salePageId,u=i.saleProductSKUId;(!t||t({salePageId:r,saleProductSKUId:u}))&&n&&n({salePageId:r,saleProductSKUId:u})},function(){})},n.prototype.getSalePageDataToSubscribe=function(){var n=this.$q.defer(),i="BackInStockStatus",t,r,u;return Modernizr.sessionstorage&&sessionStorage.getItem(i)!==null||n.reject(),t=JSON.parse(sessionStorage.getItem(i)),t&&(t.redirectUrl!==encodeURIComponent(this.$window.location.href.replace(this.$window.location.hash,""))&&(sessionStorage.removeItem(i),n.reject()),r=t.salePageId,u=t.saleProductSKUId,this.AuthServiceImmediate.IsLoginPromise.then(function(t){sessionStorage.removeItem(i);t?n.resolve({salePageId:r,saleProductSKUId:u}):n.reject()},function(){return n.reject()})),n.promise},n.prototype.GetSubscribedSkuList=function(n){var i=this,t=this.$q.defer();return this.AuthServiceImmediate.IsLoginPromise.then(function(r){r&&i.IsMIDCookieExist()?i.BackInStockService.GetSubscribedSkuList(i.ShopId,n).then(function(i){if(i&&i.result){var r=(i.result.subscribeList||[]).find(function(t){return t.salePageId===n})||{};t.resolve(r.skuList||[])}else t.resolve([])},function(){t.resolve([])}):t.resolve([])}).catch(function(){t.resolve([])}),t.promise},n.prototype.CheckLogin=function(n,t){var i=this,r=this.$q.defer();return this.AuthServiceImmediate.IsLoginPromise.then(function(u){u?r.resolve():(i.DialogUtility.Confirm(i.$translate.instant("frontend.typescripts.components.login_before_turn_on_back_in_stock_alert"),i.$translate.instant("frontend.typescripts.common.confirm"),undefined,!0).then(function(){i.SaveSKUIdBeforeLogin(n,t);var r=encodeURIComponent(i.$window.location.href.replace(i.$window.location.hash,"")),u="/Login/HttpLoginRelayToHttps/?rt="+r+"&reason=notlogin";i.$window.location.href=u}),r.reject())}).catch(function(){i.ShowErrorToast();r.reject()}),r.promise},n.prototype.CheckVipMemberEmail=function(){var t=this,n=this.$q.defer();return this.VipMemberService.GetVipMemberEmailNotification(this.ShopId).then(function(i){var r=i.Data,e=t.$translate.instant("frontend.typescripts.vip_member.email_notification.unable_to_connect"),u,f;r.Email===""?(u={Backdrop:!0,BackdropClass:"",TemplateUrl:"/V2/TypeScripts/Utilities/BackInStockUtility/backInStockEmailDialog.template.html",WindowClass:"confirm-modal back-in-stock-email-modal",Controller:"BackInStockEmailDialogController as BackInStockEmailDialogCtrl"},f={Model:{updateEmailErrorMessage:e,memberNotificationData:r}},t.DialogUtility.Customize(u,f).then(function(){n.resolve()}).catch(function(){n.reject()})):r.IsEnablePriceReduction?n.resolve():t.VipMemberService.UpdateVipMemberEmailNotification(__assign({},r,{IsEnablePriceReduction:!0})).then(function(i){i.ReturnCode!=="API0001"?(t.ShowErrorToast(),n.reject()):n.resolve()},function(){t.ShowErrorToast();n.reject()})}).catch(function(){t.ShowErrorToast();n.reject()}),n.promise},n.prototype.CheckSubscribedLimit=function(n){var t=this,i=this.$q.defer();return this.BackInStockService.GetSubscribedSkuCount(this.ShopId,n).then(function(n){if(n&&n.result){var r=n.result.subscribedSkuTotal;r>=t.BACK_IN_STOCK_LIMIT?(t.DialogUtility.Confirm(t.$translate.instant("frontend.typescripts.components.back_in_stock_subscribed_over_limit_desc"),t.$translate.instant("frontend.typescripts.components.back_in_stock_subscribed_over_limit_confirm"),undefined,!0).then(function(){t.$window.location.href="/v2/BackInStockAlertList"}),i.reject()):i.resolve()}else t.ShowErrorToast(),i.reject()},function(){t.ShowErrorToast();i.reject()}),i.promise},n.prototype.SubscribeProductSku=function(n,t,i){var r=this,u=this.$q.defer();return this.BackInStockService.SubscribeProductSku(this.ShopId,n,t,this.CurrentLocale).then(function(){r.DialogUtility.Toast(r.$translate.instant("frontend.typescripts.components.back_in_stock_subscribe_success_toast"),r.DialogUtility.ToastModeEnum.Success,2e3);r.trackingUtility.trackSelectContent({contentType:"BackInStockAlert",id:String(t),name:"貨到通知我",linkUrl:""});r.GoogleAnalyticsUtility.TrackEvent(i,"click","BackInStockAlert");u.resolve()},function(){r.ShowErrorToast();u.reject()}),u.promise},n.prototype.UnsubscribeProductSku=function(n,t,i){var r=this,u=this.$q.defer();return this.BackInStockService.UnsubscribeProductSku(this.ShopId,n,t,this.CurrentLocale).then(function(){r.DialogUtility.Toast(r.$translate.instant("frontend.typescripts.components.back_in_stock_unsubscribe_success_toast"),r.DialogUtility.ToastModeEnum.Success,2e3);r.trackingUtility.trackSelectContent({contentType:"RemoveFromBackInStockAlert",id:String(t),name:"取消貨到通知",linkUrl:""});r.GoogleAnalyticsUtility.TrackEvent(i,"click","RemoveFromBackInStockAlert");u.resolve()},function(){r.ShowErrorToast();u.reject()}),u.promise},n.prototype.SaveSKUIdBeforeLogin=function(n,t){var i;Modernizr.sessionstorage&&(i={salePageId:n,saleProductSKUId:t,redirectUrl:encodeURIComponent(this.$window.location.href.replace(this.$window.location.hash,""))},sessionStorage.setItem("BackInStockStatus",JSON.stringify(i)))},n.prototype.IsMIDCookieExist=function(){var n=this.CookieUtility.GetCookie("MID");return!!n},n.prototype.ShowErrorToast=function(){this.DialogUtility.Toast(this.$translate.instant("frontend.typescripts.components.back_in_stock_subscribe_failed_toast"),this.DialogUtility.ToastModeEnum.Warning,2e3)},n.$inject=["$q","$translate","$window","CurrentLocale","ShopId","AuthServiceImmediate","BackInStockService","VipMemberService","CookieUtility","DialogUtility","GoogleAnalyticsUtility","TrackingUtility"],n}();n.BackInStockUtility=t;angular.module("NineYi.Mall.Utilities").service("BackInStockUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}();__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(t){var i;(function(t){var r=n.Mall.Utilities.DialogCustomizeController,i=function(n){function t(t,i,r,u,f,e,o){var s=n.call(this,t,i,r,u)||this;return s.$q=f,s.DialogUtility=e,s.VipMemberService=o,s.IsShowInputErrorMessage=!1,s.EmailInputValue="",s.UpdateEmailErrorMessage=t.Model.updateEmailErrorMessage,s.NotificationData=t.Model.memberNotificationData,s}return __extends(t,n),t.prototype.IsEmailEmpty=function(){return!this.EmailInputValue.length},t.prototype.IsEmailInvalid=function(){return!/(.+)@(.+)\.(.+)/ig.test(this.EmailInputValue)},t.prototype.Cancel=function(){this.$uibModalInstance.dismiss("cancel")},t.prototype.CheckEmailInputValid=function(){return this.IsEmailEmpty()||this.IsEmailInvalid()?!1:!0},t.prototype.UpdateVipMemberEmail=function(n){var t=this,i=this.$q.defer();return this.VipMemberService.UpdateVipMemberEmailNotification(n).then(function(n){n.ReturnCode!=="API0001"&&(t.DialogUtility.Notice(t.UpdateEmailErrorMessage),i.reject());i.resolve()},function(){t.DialogUtility.Notice(t.UpdateEmailErrorMessage);i.reject()}),i.promise},t.prototype.Ok=function(){var t=this,n;if(!this.CheckEmailInputValid()){this.IsShowInputErrorMessage=!0;return}n=__assign({},this.NotificationData,{IsEnablePriceReduction:!0,Email:this.EmailInputValue});this.UpdateVipMemberEmail(n).then(function(){t.$uibModalInstance.close("ok")})},t.$inject=["$scope","$uibModalInstance","$translate","DialogCustomizeConfig","$q","DialogUtility","VipMemberService"],t}(r);t.BackInStockEmailDialogController=i;angular.module("NineYi.Mall.Utilities").controller("BackInStockEmailDialogController",i)})(i=t.Utilities||(t.Utilities={}))})(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){this.$cookies=n;this.$log=t;this.DeviceValue=i}return t.prototype.GetOSandVersion=function(){var r=n.Mall.Models.DeviceOsEnum[this.DeviceValue.GetDeviceOS()],t=this.$cookies.get("appVer")||"",i=t.split("."),u=+i[0],f=+i[1],e=+i[2];return this.$log.debug("Get App OS and Version, OS: ",r,",Version: ",t),{Version:t,MajorNumber:u,MinorNumber:f,MaintenanceNumber:e,OS:r}},t.prototype.IsNewVersion=function(n){if(!n)return!1;var t=n.split(".");return t[0]==="1"&&parseInt(t[1])>=18?!0:t[0]==="2"&&parseInt(t[1])>=2?!0:!1},t.prototype.IsFromApp=function(){return this.$cookies.get("appVer")?!0:!1},t.prototype.IsFromWebView=function(){return/(Version|wv)/i.test(navigator.userAgent)},t.$inject=["$cookies","$log","DeviceValue"],t}();t.AppVersionUtility=i;angular.module("NineYi.Mall.Utilities").service("AppVersionUtility",i)})(i=t.Utilities||(t.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.BodyElement=document.getElementsByTagName("body")[0];this.HtmlElement=document.getElementsByTagName("html")[0]}return n.prototype.FreezeBody=function(){this.BodyElement&&!this.BodyElement.classList.contains("freeze")&&(this.BodyElement.classList.add("freeze"),this.HtmlElement.classList.add("freeze-html"),this.IsFreeze=!0)},n.prototype.UnFreezeBody=function(){this.BodyElement&&this.BodyElement.classList.contains("freeze")&&(this.BodyElement.classList.remove("freeze"),this.HtmlElement.classList.remove("freeze-html"),this.IsFreeze=!1)},n.prototype.ToogleFreezeBody=function(){this.BodyElement&&(this.BodyElement.classList.contains("freeze")?(this.BodyElement.classList.remove("freeze"),this.HtmlElement.classList.remove("freeze-html"),this.IsFreeze=!1):(this.BodyElement.classList.add("freeze"),this.HtmlElement.classList.add("freeze-html"),this.IsFreeze=!0))},n}();n.FreezeBodyUtility=t;angular.module("NineYi.Mall.Utilities").factory("FreezeBodyUtility",function(){return new t})})(t=n.Utilities||(n.Utilities={}))})(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.DeviceValue=n;this.$log=t;this.IsShowMenu=!1}return n.prototype.Open=function(n){n&&(this.MenuType=n);this.HasOpenmenu=!0;this.IsShowMenu=!0},n.prototype.Close=function(){this.IsShowMenu=!1},n.prototype.Toggle=function(n){n&&(this.MenuType=n);this.IsShowMenu=!this.IsShowMenu;this.IsShowMenu&&(this.HasOpenmenu=!0)},n.$inject=["DeviceValue","$log"],n}();n.MainMenuUtility=t;angular.module("NineYi.Mall.Utilities").service("MainMenuUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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.$window=n;this.DeviceValue=t}return n.prototype.Register=function(){var t=this,n,i;this.DeviceValue.IsMobile()===!1&&(n=document.body,this.$window.addEventListener("scroll",function(){t.$window.clearTimeout(i);n.classList.contains("disable-hover")||n.classList.add("disable-hover");i=t.$window.setTimeout(function(){n.classList.remove("disable-hover")},500)},!1))},n.$inject=["$window","DeviceValue"],n}();n.ScrollDisableHoverUtility=t;angular.module("NineYi.Mall.Utilities").service("ScrollDisableHoverUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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.$q=n;this.$uibModal=t}return n.prototype.AddRistrictionNote=function(n,t){var i=this.$q.defer(),r={templateUrl:"/V2/TypeScripts/Utilities/RistrictionUtility/ristrictionNote.html",size:"lg",windowClass:"ristriction-modal",backdrop:"static",keyboard:!1,resolve:{addRistrictionNote:function(){return{Title:n,Message:t}}},controller:"RistrictionNoteController as RistrictionNoteCtrl"},u=this.$uibModal.open(r);return u.result.then(i.resolve).catch(i.reject),i.promise},n.$inject=["$q","$uibModal"],n}();n.RistrictionUtility=t;angular.module("NineYi.Mall.Utilities").service("RistrictionUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){var u=this;this.$scope=n;this.$uibModalInstance=t;this.$window=i;this.CssCDNDomain=r;angular.element(document).ready(function(){u.SetModalOpacity(.98)})}return n.prototype.Enter=function(){Modernizr.sessionstorage&&sessionStorage.setItem("type","Ristriction");this.$uibModalInstance.close("enter");this.SetModalOpacity(.5)},n.prototype.Cancel=function(){Modernizr.sessionstorage&&sessionStorage.clear();this.$window.location.href="https://www.google.com.tw/"},n.prototype.SetModalOpacity=function(n){angular.element(document.getElementsByClassName("modal-backdrop")).css("opacity",n)},n.$inject=["$scope","$uibModalInstance","$window","CssCDNDomain",],n}();n.RistrictionNoteController=t;angular.module("NineYi.Mall.Utilities").controller("RistrictionNoteController",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.$log=t;this.$filter=i;this.$translate=r;this.InvoiceStatusEnum=n.ERP.BE.Invoice.InvoiceStatusEnum}return t.prototype.GetTypeDisplayName=function(t,i,r,u,f,e){var o="";return o=t===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Sent]&&u?n.Mall.Mixin.invoiceStatusDisplayName(this.InvoiceStatusEnum[this.InvoiceStatusEnum.Prized]):n.Mall.Mixin.invoiceStatusDisplayName(t),this.$translate.instant(o)+this.GetSendDateDisplayName(t,i,u,e)+this.GetSubMessage(t,i,r,f,e)},t.prototype.GetSendDateDisplayName=function(n,t,i,r){var e=Date.now(),u=t?this.$filter("nsDotNetDateParser")(t):null,f=t?this.$filter("date")(u,"yyyy/MM/dd"):"";if(u){if((r==="Mail"||r===null)&&(n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Issued]||n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Prized]||n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Sent]&&i))return u>=e?""+this.$translate.instant("frontend.typescripts.utilities.expected_sent",{val0:f}):"("+f+" "+this.$translate.instant("frontend.typescripts.utilities.has_been_sent")+")";if(r==="FamiPort"&&(n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Prized]||n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Sent]&&i))return"(FamiPort "+this.$translate.instant("frontend.typescripts.utilities.printed")+")";if(r==="Ibon"&&(n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Prized]||n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Sent]&&i))return"(ibon "+this.$translate.instant("frontend.typescripts.utilities.printed")+")";if(n===this.InvoiceStatusEnum[this.InvoiceStatusEnum.Sent]&&!i)return u>=e?"":"("+f+" "+this.$translate.instant("frontend.typescripts.utilities.has_been_sent")+")"}return""},t.prototype.GetSubMessage=function(n,t,i,r,u){if(r==="TwoCopies")switch(n){case this.InvoiceStatusEnum[this.InvoiceStatusEnum.Issued]:return i&&!t?"("+this.$translate.instant("frontend.typescripts.utilities.modify_shipping_information")+")":"";case this.InvoiceStatusEnum[this.InvoiceStatusEnum.Prized]:return t?"":u==="FamiPort"?"(FamiPort "+this.$translate.instant("frontend.typescripts.utilities.not_print")+")":u==="Ibon"?"(ibon "+this.$translate.instant("frontend.typescripts.utilities.not_print")+")":"("+this.$translate.instant("frontend.typescripts.utilities.fill_in_modify_shipping_information")+")";default:return""}return""},t.prototype.GetInvoicesDetailUrl=function(n,t,i,r,u,f,e){var o=e?"true":"false";return n&&t&&(i||r)&&u&&n!=="None"?"/V2/Invoice/InvoiceDetail/"+t+"?tsCode="+i+"&tmCode="+r+"&source="+u+"&shopId="+f+"&archive="+o:""},t.prototype.GetPrizedInvoicesDetailUrl=function(n,t,i,r,u,f){return n&&t&&(i||r)&&u&&n!=="None"?"/V2/Invoice/FamiPortIllustrate/"+t+"?tsCode="+i+"&tmCode="+r+"&source="+u+"&shopId="+f:""},t.$inject=["$log","$filter","$translate"],t}();t.InvoiceStatusUtility=i;angular.module("NineYi.Mall.Utilities").service("InvoiceStatusUtility",i)})(i=t.Utilities||(t.Utilities={}))})(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){this.$rootScope=n;this.$q=t;this.$log=i;this.traceSalePageService=r;this.FacebookUtility=u;this.SalePageService=f;this.AdobeAnalyticsUtility=e;this.DefaultCurrencyCode=o;this.TrackingUtility=s;this.ProductStockService=h}return n.prototype.Add=function(n,t){var i=this,r=this.$q.defer();return this.traceSalePageService.InsertItem(n).then(function(){i.SalePageService.GetSalePage(n).then(function(n){if(n&&n.data){var u=n.data,f=u.Id,e=u.Title,o=u.Price,s=u.SuggestPrice,h=u.CategoryText,c=u.ShopCategoryId;i.ProductStockService.GetSellingQtyListNew(n.data.SaleProductSKUIdList).then(function(n){i.TrackingUtility.trackingSdkAddToFavorite({id:f,name:e,price:o,suggestPrice:s,categoryId:c,categoryName:h,productOuterId:n.data.length>0?n.data[0].SaleProductOuterId:"",quantity:1},t)})}i.$log.info("Insert TraceSalePageList");i.FavCount+=1;i.RefreshFavCount();r.resolve(!0)})}).catch(function(){r.reject("remove failed")}),r.promise},n.prototype.Remove=function(n){var t=this,i=this.$q.defer();return this.traceSalePageService.DeleteItem(n).then(function(){t.$log.info("Delete TraceSalePageList");t.FavCount-=1;t.RefreshFavCount();i.resolve()}).catch(function(){i.reject("remove failed")}),i.promise},n.prototype.RefreshFavCount=function(){this.$rootScope.$emit("RefreshFavCount")},n.prototype.AfterRefresh=function(n){this.$rootScope.$on("RefreshFavCount",n)},n.prototype.GetFavCount=function(){var t=this,n=this.$q.defer();return this.$log.info("Get TraceSalePageList Count - Start"),this.traceSalePageService.GetCount().then(function(i){t.$log.info("Get TraceSalePageList Count - Finish",i);t.FavCount=i;n.resolve(i)}).catch(function(){n.reject()}),n.promise},n.$inject=["$rootScope","$q","$log","TraceSalePageService","FacebookUtility","SalePageService","AdobeAnalyticsUtility","DefaultCurrencyCode","TrackingUtility","ProductStockServiceImmediate"],n}();n.FavoriteUtility=t;angular.module("NineYi.Mall.Utilities").factory("FavoriteUtility",["$rootScope","$q","$log","TraceSalePageService","FacebookUtility","SalePageService","AdobeAnalyticsUtility","DefaultCurrencyCode","TrackingUtility","ProductStockService",function(n,i,r,u,f,e,o,s,h,c){return new t(n,i,r,u,f,e,o,s,h,c)}])})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.Translate3d=function(n,t){n&&(n.style.transform="translate3d(0, "+t+"px, 0)",n.style["-webkit-transform"]="translate3d(0, "+t+"px, 0)",n.style["-moz-transform"]="translate3d(0, "+t+"px, 0)",n.style["-ms-transform"]="translate3d(0, "+t+"px, 0)")},n}();n.AnimeUtility=t;angular.module("NineYi.Mall.Utilities").factory("AnimeUtility",function(){return new t})})(t=n.Utilities||(n.Utilities={}))})(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){this.ShopId=n;this.$window=t;this.$translate=i;this.FanGroupUrl=r;this.IsEnableFBMessenger=u;this.IsEnableFBMessengerNonWorkingTime=f;this.FBMessengerWorkingStartWeekDay=e;this.FBMessengerWorkingEndWeekDay=o;this.FBMessengerWorkingStartTime=s;this.FBMessengerWorkingEndTime=h;this.DialogUtility=c;this.FBAppId=l;this.FBFanName=this.FanGroupUrl?this.FanGroupUrl.replace("https://www.facebook.com/",""):"";this.FanGroupUrlString=this.FanGroupUrl;this.FBMessenger={serviceStartDay:null,serviceEndDay:null,serviceStartHour:null,serviceStartMinutes:null,serviceEndHour:null,serviceEndMinutes:null,hasService:this.IsEnableFBMessenger};this.FbAppId=this.FBAppId}return n.prototype.IsFBMessengerServiceTime=function(){if(this.FBMessenger.hasService){var n=!0,t=new Date,i=t.getDay()===0?7:t.getDay(),r=new Date,u=new Date;return this.FBMessenger.hasService=!0,this.FBMessenger.serviceStartDay=this.FBMessenger.serviceStartDay||+this.FBMessengerWorkingStartWeekDay,this.FBMessenger.serviceEndDay=this.FBMessenger.serviceEndDay||+this.FBMessengerWorkingEndWeekDay,this.FBMessenger.serviceStartHour=this.FBMessenger.serviceStartHour||+/([0-9]+):/i.exec(this.FBMessengerWorkingStartTime)[1],this.FBMessenger.serviceStartMinutes=this.FBMessenger.serviceStartMinutes||+/:([0-9]+)/i.exec(this.FBMessengerWorkingStartTime)[1],this.FBMessenger.serviceEndHour=this.FBMessenger.serviceEndHour||+/([0-9]+):/i.exec(this.FBMessengerWorkingEndTime)[1],this.FBMessenger.serviceEndMinutes=this.FBMessenger.serviceEndMinutes||+/:([0-9]+)/i.exec(this.FBMessengerWorkingEndTime)[1],n&&this.FBMessenger.serviceStartDay===this.FBMessenger.serviceEndDay&&i!==this.FBMessenger.serviceStartDay&&(n=!1),n&&this.FBMessenger.serviceStartDay!==this.FBMessenger.serviceEndDay&&(i<this.FBMessenger.serviceStartDay||i>this.FBMessenger.serviceEndDay)&&(n=!1),r.setHours(this.FBMessenger.serviceStartHour),r.setMinutes(this.FBMessenger.serviceStartMinutes),u.setHours(this.FBMessenger.serviceEndHour),u.setMinutes(this.FBMessenger.serviceEndMinutes),n&&(t.getTime()-r.getTime()<0||t.getTime()-u.getTime()>0)&&(n=!1),n||this.IsEnableFBMessengerNonWorkingTime||(this.FBMessenger.hasService=!1),this.$window.location.href.match(/\/v2\/ShoppingCart/i)&&(this.FBMessenger.hasService=!1),this.$window.location.href.match(/\/v2\/Pay/i)&&(this.FBMessenger.hasService=!1),this.$window.location.href.match(/\/Question\/QuestionInsert/i)&&(this.FBMessenger.hasService=!1),n}},n.prototype.ConfirmQuestionService=function(){var n=this;this.DialogUtility.Confirm(this.$translate.instant("frontend.typescripts.utilities.question_service_offline_msg"),this.$translate.instant("frontend.typescripts.utilities.leave_message"),this.$translate.instant("frontend.typescripts.components.cancel_btn")).then(function(){n.$window.location.replace("/Question/QuestionInsert/0?sId="+n.ShopId)})},n.prototype.GetFBMessengerSrc=function(){return"https://www.facebook.com/plugins/page.php?href="+this.FanGroupUrl+"&tabs=messages&width=340&height=500&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=true"+("&appId="+this.FbAppId)},n.$inject=["ShopId","$window","$translate","FanGroupUrl","IsEnableFBMessenger","IsEnableFBMessengerNonWorkingTime","FBMessengerWorkingStartWeekDay","FBMessengerWorkingEndWeekDay","FBMessengerWorkingStartTime","FBMessengerWorkingEndTime","DialogUtility","FBAppId"],n}();n.FBMessengerUtility=t;angular.module("NineYi.Mall.Utilities").service("FBMessengerUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.ShopId=n;this.OnlineCRM=t;this.OnlineCRMCode=i;this.OnlineCRM&&this.OnlineCRMCode&&(this.lineUrl="https://line.naver.jp/ti/p/"+this.OnlineCRMCode)}return n.$inject=["ShopId","OnlineCRM","OnlineCRMCode"],n}();n.LineUtility=t;angular.module("NineYi.Mall.Utilities").service("LineUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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.CookieUtility=n;this.UrlUtility=t}return n.prototype.SetCommonCookie=function(n,t){var i,r;document.location.hostname.match(/service.91app/)||(i=this.UrlUtility.GetQuerystring(n),i&&(this.CookieUtility.AddCookie("trace-"+n,i),r=this.CookieUtility.SetCookieExpireTime("trace-"+n,t),this.CookieUtility.AddCookie("trace-"+n+"-expires",r),this.CookieUtility.SetCookieExpireTime("trace-"+n+"-expires",t)))},n.$inject=["CookieUtility","UrlUtility"],n}();n.SetCommonCookieUtility=t;angular.module("NineYi.Mall.Utilities").service("SetCommonCookieUtility",t)})(t=n.Utilities||(n.Utilities={}))})(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){this.$q=n;this.$window=t;this.$http=i;this.$translate=r;this.config=u;this.AuthService=f;this.LocalStorageService=e;this.DialogUtility=o;this.PageValue=s;this.ShopId=h}return t.prototype.Initialize=function(){var t=this;(this.PageValue.CurrentPage===n.Mall.Models.PageNameEnum.OfficailIndex||this.PageValue.CurrentPage===n.Mall.Models.PageNameEnum.SalePageCategory)&&this.AuthService.IsLogin().then(function(n){n&&t.CheckIsAddedMemberInfo(t.ShopId).then(function(n){n||t.CheckMemberProfileNotification()})})},t.prototype.CheckMemberProfileNotification=function(){var i=this,n,t;if(this.LocalStorageService.isSupported&&(n=void 0,t=void 0,n=this.LocalStorageService.get("RemindFillMemberProfileNumber")?parseInt(this.LocalStorageService.get("RemindFillMemberProfileNumber").toString()):null,t=this.LocalStorageService.get("RemindFillMemberProfileCheckPoint")?parseInt(this.LocalStorageService.get("RemindFillMemberProfileCheckPoint").toString()):null,n||n===0||(this.LocalStorageService.set("RemindFillMemberProfileNumber",0),this.LocalStorageService.set("RemindFillMemberProfileCheckPoint",8)),n+=1,this.LocalStorageService.set("RemindFillMemberProfileNumber",n),n===t)){this.$translate.onReady(function(){var n={Title:i.$translate.instant("frontend.typescripts.utilities.write_member_profile"),Model:{content:i.$translate.instant("frontend.typescripts.utilities.write_member_profile_msg")}};i.DialogUtility.Customize({Size:"sm",Backdrop:!0,TemplateUrl:"/V2/TypeScripts/Utilities/MemberProfileNotificationUtility/memberProfileNotificationTemplate.html",WindowClass:"confirm-modal",Controller:"DialogCustomizeController as DialogCustomizeCtrl"},n).then(function(){i.$window.location.href="/V2/VipMember/Profile"})});t+=5;this.LocalStorageService.set("RemindFillMemberProfileCheckPoint",t);this.LocalStorageService.set("RemindFillMemberProfileNumber",0)}},t.prototype.CheckIsAddedMemberInfo=function(n){var i=this.config.webapiUrl+"/VIPMember/IsWriteVipMember?shopId="+n,t=this.$q.defer();return this.$http.get(i,{withCredentials:!0}).then(function(n){t.resolve(n.data.Data)}).catch(t.reject),t.promise},t.$inject=["$q","$window","$http","$translate","Mall.Config","AuthService","localStorageService","DialogUtility","PageValue","ShopId"],t}();t.MemberProfileNotificationUtility=i;angular.module("NineYi.Mall.Utilities").service("MemberProfileNotificationUtility",i)})(i=t.Utilities||(t.Utilities={}))})(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){this.$q=n;this.$uibModal=t;this.CookieUtility=i;this.LocalStorageService=r}return n.prototype.OpenLineshopNotification=function(){var t=this.$q.defer(),n,i,r,u;return this.LocalStorageService.isSupported&&(n=this.CookieUtility.GetCookie("trace-fr2"),i=this.LocalStorageService.get("LineshopRedirectNote"),n&&n!==i&&(this.LocalStorageService.set("LineshopRedirectNote",n),r={templateUrl:"/V2/TypeScripts/Utilities/NotificationUtility/LineshopNotification.html",size:"lg",windowClass:"lineshop-note-modal",backdrop:"static",keyboard:!1,controller:"LineshopNotificationController as LineshopNotificationCtrl"},u=this.$uibModal.open(r),u.result.then(t.resolve).catch(t.reject))),t.promise},n.$inject=["$q","$uibModal","CookieUtility","localStorageService"],n}();n.NotificationUtility=t;angular.module("NineYi.Mall.Utilities").service("NotificationUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.$uibModalInstance=n}return n.prototype.Close=function(){this.$uibModalInstance.close("enter")},n.$inject=["$uibModalInstance"],n}();n.LineshopNotificationController=t;angular.module("NineYi.Mall.Utilities").controller("LineshopNotificationController",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.GetHeaderAttribute=function(n,t){try{var i=n.construct.header[0];return i.attributes[t]}catch(r){return null}},n.prototype.GetCustomLinkListMenuSwitch=function(n){var t=this.GetHeaderAttribute(n,"customLinkListMenuSwitch");return t?t.isTurnOn:!1},n.prototype.GetCustomLinkListMenu=function(n){return this.GetHeaderAttribute(n,"customLinkListMenu")},n.prototype.GetCustomLinkListMenuTitle=function(n){var t=this.GetHeaderAttribute(n,"customLinkListMenuTitle");return t&&t.text||null},n.prototype.GetActivityMenuSwitch=function(n){var t=this.GetHeaderAttribute(n,"activityMenuSwitch");return t?t.isTurnOn:!1},n.prototype.GetActivityMenu=function(n){return this.GetHeaderAttribute(n,"activityMenu")||{}},n.prototype.GetCategoryMenuSwitch=function(n){var t=this.GetHeaderAttribute(n,"categoryMenuSwitch");return t?t.isTurnOn:!0},n}();n.CmsThemeUtility=t;angular.module("NineYi.Mall.Utilities").factory("CmsThemeUtility",function(){return new t})})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.ECouponService=n}return n.prototype.GetBarcodeObject=function(n){return{VipMemberBarCodeUrl:this.GetVipMemberBarcodeUrl(n),MultipleVerificationCodes:this.GetMultipleVerificationCodes(n),SingleECouponCodeUrl:this.GetSingleECouponCodeUrl(n),UsingStore:n.UsingStore,UsingDateTime:this.GetUsingDateTime(n),BarCodeTypeDef:n.BarCodeTypeDef}},n.prototype.GetVipMemberBarcodeUrl=function(n){if(n.VipMemberBarCode){var t=this.ReturnBarCodeItem(n.VipMemberBarCode.BarCode,n.VipMemberBarCode.BarCodeTypeDef,n.BarCodeTimeStamp);return this.ReturnBarCodeUrl(t)}return null},n.prototype.GetMultipleVerificationCodes=function(n){var i=this,t=[];return n.IsUsingCustomVerificationCode?(n.ECouponCustomVerificationCode1&&t.push(this.ReturnBarCodeItem(n.ECouponCustomVerificationCode1,n.BarCodeTypeDef,n.BarCodeTimeStamp)),n.ECouponCustomVerificationCode2&&t.push(this.ReturnBarCodeItem(n.ECouponCustomVerificationCode2,n.BarCodeTypeDef,n.BarCodeTimeStamp)),n.ECouponCustomVerificationCode3&&t.push(this.ReturnBarCodeItem(n.ECouponCustomVerificationCode3,n.BarCodeTypeDef,n.BarCodeTimeStamp)),t.map(function(n){return i.ReturnBarCodeUrl(n)})):null},n.prototype.GetSingleECouponCodeUrl=function(n){if(!n.IsUsingCustomVerificationCode){var t=this.ReturnBarCodeItem(n.ECouponCode,n.BarCodeTypeDef,n.BarCodeTimeStamp);return this.ReturnBarCodeUrl(t)}return null},n.prototype.ReturnBarCodeItem=function(n,t,i){return{BarCode:n,BarCodeTypeDef:t,BarCodeTimeStamp:i}},n.prototype.ReturnBarCodeUrl=function(n){var t={CODE_39:[240,55],CODE_128:[240,55],QR_CODE:[220,220]};return this.ECouponService.GetECouponBarCode(t[n.BarCodeTypeDef][0],t[n.BarCodeTypeDef][1],n.BarCodeTypeDef,encodeURIComponent(n.BarCode),n.BarCodeTimeStamp)},n.prototype.GetUsingDateTime=function(n){var o=n.UsingDateTime.toString(),t=new Date(parseInt(o.replace("/Date(","").replace(")/",""),10)),s=""+t.getFullYear(),i=""+(t.getMonth()+1),r=""+t.getDate(),u=""+t.getHours(),f=""+t.getMinutes(),e=""+t.getSeconds();return i.length<2&&(i="0"+i),r.length<2&&(r="0"+r),u.length<2&&(u="0"+u),f.length<2&&(f="0"+f),e.length<2&&(e="0"+e),s+"/"+i+"/"+r+" "+u+":"+f+":"+e},n.$inject=["ECouponService"],n}();n.BarcodeUtility=t;angular.module("NineYi.Mall.Utilities").service("BarcodeUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t,i;(function(n){n[n.JavaScript=0]="JavaScript";n[n.WebCrawler=1]="WebCrawler";n[n.Angular=2]="Angular"})(t||(t={}));i=function(){function n(n,t){this.config=n;this.$http=t}return n.prototype.Log=function(n){var r=this.config.webapiUrl+"/Common/JsLogger/LogJavaScriptErrorV2",i=t.JavaScript;(/facebookexternalhit|AdsBot|PetalBot|Googlebot/i.test(navigator.userAgent)?i=t.WebCrawler:/errors.angularjs.org/i.test(n)&&(i=t.Angular),n)&&this.$http.post(r,{message:encodeURIComponent(n),exception:i})},n.prototype.GetLogDetailForElmah=function(n){return{data:n.data,status:n.status,config:{method:n.config.method,url:n.config.url,headers:n.config.headers},statusText:n.statusText,xhrStatus:n.xhrStatus}},n.$inject=["Mall.Config","$http"],n}();n.JSLoggerUtility=i;angular.module("NineYi.Mall.Utilities").service("JSLoggerUtility",i)})(t=n.Utilities||(n.Utilities={}))})(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){this.$q=n;this.$translate=t;this.$window=i;this.DialogUtility=r;this.DeviceValue=u}return n.prototype.OpenRegularOrderDescDialog=function(){var n={Backdrop:!0,Size:this.DeviceValue.IsMobile()?"sm":"md",TemplateUrl:"/V2/TypeScripts/Utilities/RegularOrderUtility/regularOrderDescDialog.template.html",WindowClass:"regular-order-desc-modal",Controller:"DialogCustomizeController as DialogCustomizeCtrl"},t={Title:this.$translate.instant("frontend.typescripts.sale_page.regular_order_desc"),Model:null};this.DialogUtility.Customize(n,t)},n.prototype.OpenRegularOrderPrivacyDialog=function(){var n={Backdrop:!0,Size:this.DeviceValue.IsMobile()?"sm":"md",TemplateUrl:"/V2/TypeScripts/Utilities/RegularOrderUtility/regularOrderPrivacyDialog.template.html",WindowClass:"regular-order-desc-modal",Controller:"DialogCustomizeController as DialogCustomizeCtrl"},t={Title:this.$translate.instant("frontend.typescripts.pay_process.pay_advanced.regular_order_privacy_text"),Model:null};this.DialogUtility.Customize(n,t)},n.$inject=["$q","$translate","$window","DialogUtility","DeviceValue",],n}();n.RegularOrderUtility=t;angular.module("NineYi.Mall.Utilities").service("RegularOrderUtility",t)})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.GetHtmlFormatString=function(n){return n.replace(/\n/g,"<br/>")},n.prototype.GetUrl=function(n){for(var i=n.match(/[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/ig),t=0;t<i.length;t++)n=i[t].match(/[\w|\-_.]+@[\w|\-.]+/i)?n.replace(i[t],'<a href="mailto:'+i[t]+'" target="_blank" class="link revert-style">'+i[t]+"<\/a>"):n.replace(i[t],'<a href="'+i[t]+'" target="_blank" class="link revert-style">'+i[t]+"<\/a>");return n},n}();n.StringFormatUtility=t;angular.module("NineYi.Mall.Utilities").factory("StringFormatUtility",function(){return new t})})(t=n.Utilities||(n.Utilities={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsLazyLoad",["$log","$window","$timeout",function(n,t,i){return{restrict:"A",scope:!1,link:function(r,u,f){function c(){var t=f.nsLazyLoad,n=u[0].querySelectorAll("."+t)[0];n&&n.getBoundingClientRect().top-s<=h&&o()}function o(){var i=u[0].getBoundingClientRect().top;i-s<=h&&(l(f.nsLazyLoad),(!f.lazyLoadAlarmClock&&e===!0||+f.lazyLoadAlarmClock<0&&e===!0)&&(n.debug("remove listener"),t.removeEventListener("scroll",o,!1)))}function l(n){var t=u[0].querySelectorAll("."+n);[].slice.call(t).forEach(function(t){var r=t.dataset&&t.dataset.tempSrc||t.getAttribute("data-temp-src"),i;if(r){switch(n){case"sleeping-img":t.setAttribute("src",r);t.classList.remove("sleeping-img");break;case"sleeping-background":t.style.backgroundImage="url("+r+")";t.classList.remove("sleeping-background");break;case"sleeping-iframe":i=document.createElement("iframe");i.classList.add("h100p");i.setAttribute("src",r);i.setAttribute("frameborder","0");t.appendChild(i);t.classList.remove("sleeping-iframe")}e=!0}})}var s=f.offsetY||0,h=t.innerHeight,e=!1;i(function(){c();t.addEventListener("scroll",o,!1);typeof f.activeTrigger!="undefined"&&f.$observe("activeTrigger",function(n){n==="true"&&i(function(){c()},1e3)})},0)}}}])})(t=n.Directives||(n.Directives={}))})(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){this.$log=n;this.$window=t;this.ElementUtility=i;this.scope={onVisiable:"&"};this.restrict="AE";this.link=function(r,u){function e(){var c=u[0].style.display!=="none",o=t.pageYOffset,l=o+t.innerHeight,s=i.getElementOffset(u[0]),h=s.top,a=h+s.height,v=a<=l&&h>=o&&c;v&&r.$apply(function(){n.debug("onVisiable - run");r.onVisiable();f.off("scroll",e);n.debug("onVisiable - disable")})}var f=angular.element(t);f.on("scroll",e)}}return n.factory=function(){var t=function(t,i,r){return new n(t,i,r)};return t.$inject=["$log","$window","ElementUtility"],t},n}();n.WatchScrollVisiableDirective=t;angular.module("NineYi.Mall.Directives").directive("nsWatchScrollVisiable",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.restrict="EA";this.scope={onShow:"&?",showSpinner:"="};this.templateUrl="/V2/TypeScripts/Directives/ns-spinner/spinnerDirective.html";this.link=function(n){n.$watch("showSpinner",function(t,i){t&&t!==i&&(n.showSpinner=t)})}}return n.instance=function(){var t=function(){return new n};return t.$inject=[],t},n}();n.SpinnerDirective=t;angular.module("NineYi.Mall.Directives").directive("nsSpinner",t.instance())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){function i(t,i,r,u,f,e){return{restrict:"AE",templateUrl:function(n,t){return t.templateUrl?t.templateUrl:"/V2/TypeScripts/Directives/ns-carousel/carouselDirective.html"},scope:{carouselList:"=ngModel"},link:function(o,s){function it(){h=s[0].querySelector(".carousel-ul");ut(h);rt();y=o.carouselList.length;ft(h,c);h.addEventListener("touchstart",pt,!1);h.addEventListener("touchend",wt,!1);yt();w=nt()}function rt(){l=s[0].querySelector(".carousel-ul").getBoundingClientRect().width;c=-l;p=0;k=0;v=0;g=0}function yt(){b=!0;r.addEventListener("scroll",function(){var n=s[0].querySelector(".carousel").getBoundingClientRect().bottom;n<0&&n>-200&&b&&(t.debug("stop carousel"),u.cancel(w),b=!1);n>=0&&!b&&(t.debug("start carousel"),w=nt(),b=!0)})}function ut(n){t.debug(n.offsetWidth);n&&(n.style.width=n.offsetWidth+"px")}function ft(n,t){n&&i(function(){a(n,t)},0)}function nt(){return u(function(){o.goNext()},8e3)}function et(n){return n.target.parentElement.className==="video-mask"}function pt(n){var t=n.changedTouches[0];n.target.parentElement.style.pointerEvents="none";et(t)===!1&&(p=parseInt(t.clientX),k=parseInt(t.clientY),h.addEventListener("touchmove",ot,!1),ht(h),u.cancel(w))}function ot(n){var i=n.changedTouches[0];if(!p||!k){t.debug("no touch data");return}var r=i.clientX,u=i.clientY,f=p-r,e=k-u;Math.abs(f)>Math.abs(e)?(v=parseInt(i.clientX)-p+c,a(h,v)):t.debug("swipe to top or bottom")}function wt(n){var t=n.changedTouches[0];et(t)===!1&&(h.removeEventListener("touchmove",ot,!1),d(h,"0.3s"),bt(),w=nt(),n.target.parentElement.style.pointerEvents="",g=v)}function bt(){if(t.debug("dis = "+c+" ; tempDist = "+v),v===g){t.debug("same of tempDist");return}Math.abs(v-c)>l/6?v>-l?(t.debug("change slide - to last"),a(h,0),lt(300)):v<-l*y?(t.debug("change slide - to first"),a(h,-l*(y+1)),ct(300)):c>v?(t.debug("change slide - to next"),vt()):(t.debug("change slide - to prev"),at()):(t.debug("back slide"),a(h,c))}function a(n,t){n&&!o.ShowVideo&&i(function(){n.style.transform="translate3d("+t+"px, 0, 0)";n.style["-webkit-transform"]="translate3d("+t+"px, 0, 0)";n.style["-moz-transform"]="translate3d("+t+"px, 0, 0)";n.style["-ms-transform"]="translate3d("+t+"px, 0, 0)"},0)}function st(n,t,r){n&&i(function(){ht(n);a(n,t)},r)}function ht(n){n&&n.style.removeProperty("transition")}function d(n,t){n&&(n.style.transition="transform "+t)}function ct(n){o.currentIndex=0;c=-l;st(h,c,n)}function lt(n){o.currentIndex=y-1;c=-l*y;st(h,c,n)}function at(){o.currentIndex=o.currentIndex-1;c=c+l;a(h,c)}function vt(){o.currentIndex=o.currentIndex+1;c=c-l;a(h,c)}function kt(n){o.currentIndex=n;c=-l*(n+1);d(h,"0.8s");a(h,c)}var h,l,p,k,y,c,v,g,w,b,tt;o.CarouseMediaTypeEnum=n.Mall.Directives.CarouseMediaTypeEnum;o.carouselList&&o.carouselList.length>0?it():tt=o.$watch("carouselList",function(n,t){n&&n!==t&&(i(function(){it()},0),tt())});r.addEventListener("resize",function(){h=s[0].querySelector(".carousel-ul");h&&(h.removeAttribute("style"),ut(h),rt(),ft(h,c))});o.currentIndex=0;o.goPrev=function(){o.ShowVideo=!1;d(h,"0.8s");o.currentIndex===0?(a(h,0),lt(850)):at()};o.goNext=function(){o.ShowVideo=!1;d(h,"0.8s");o.currentIndex===y-1?(a(h,-l*(y+1)),ct(850)):vt()};o.doJump=function(n){kt(n)};o.playVideo=function(n){n.preventDefault();n.stopPropagation();o.ShowVideo=!0;o.InitVideo=!0;t.debug("play video")};o.TrackCarouselEvent=function(t){if(e&&e.HasNewVersionSwitch){var i=e.BrowserMode===n.WebStore.Frontend.BE.Device.DeviceModeEnum.Desktop?"首頁廣告":"首頁廣告_M";f.TrackEvent(i,"活動型V1","1_官網輪播看板")}else t&&f.TrackEvent("輪播看板","click","輪播看板"+(t+1))}}}}var r;(function(n){n[n.Image=0]="Image";n[n.Video=1]="Video"})(r=t.CarouseMediaTypeEnum||(t.CarouseMediaTypeEnum={}));i.$inject=["$log","$timeout","$window","$interval","GoogleAnalyticsUtility","OfficialShopProfile"];angular.module("NineYi.Mall.Directives").directive("nsCarousel",i)})(i=t.Directives||(t.Directives={}))})(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){var r=this;this.$log=n;this.$window=t;this.$parse=i;this.restrict="A";this.link=function(n,t,i){if(i.nsClickOutside){var u=t[0],e=r.$parse(i.nsClickOutside),f=function(t){u===t.target||u.contains(t.target)||n.$apply(e)};r.$window.addEventListener("click",f,!0);n.$on("$destroy",function(){r.$window.removeEventListener("click",f)})}}}return n.factory=function(){var t=function(t,i,r){return new n(t,i,r)};return t.$inject=["$log","$window","$parse"],t},n}();n.ClickOutsideDirective=t;angular.module("NineYi.Mall.Directives").directive("nsClickOutside",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){var i=this;this.$window=n;this.UserAgentUtility=t;this.restrict="A";this.link=function(n,t,r){var u=t[0],f=angular.element(i.$window);n.fixedClassName=r.fixedClassName?r.fixedClassName:"fixed-header";i.$window.setTimeout(function(){if(n.IsOnTop()===!1){n.$parentElm=u.parentElement;f.on("scroll",n.FixHeader);i.UserAgentUtility.IsSafari&&i.$window.pageYOffset>n.$parentElm.offsetTop&&n.FixHeader()}else u.classList.contains(n.fixedClassName)||u.classList.add(n.fixedClassName)},2e3);n.FixHeader=function(){n.fixedOffset=n.$parentElm.offsetTop;i.$window.pageYOffset>n.fixedOffset?u.classList.contains(n.fixedClassName)||u.classList.add(n.fixedClassName):u.classList.contains(n.fixedClassName)&&u.classList.remove(n.fixedClassName)};n.IsOnTop=function(){return u.parentElement.offsetTop===0}}}return n.factory=function(){var t=function(t,i){return new n(t,i)};return t.$inject=["$window","UserAgentUtility"],t},n}();n.StickyHeaderDirective=t;angular.module("NineYi.Mall.Directives").directive("nsStickyHeader",t.factory())})(t=n.Directives||(n.Directives={}))})(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){var r=this;this.$window=n;this.UserAgentUtility=t;this.DeviceValue=i;this.restrict="A";this.scope={fixedOffset:"=?nsFixedOffset"};this.link=function(n,t,i){var f=i.fullParentContainer,u=t[0];n.isSupportCssSticky=i.useSticky?Modernizr.csspositionsticky:!1;n.$windowElem=angular.element(r.$window);n.fixedTop=i.fixedTop?i.fixedTop:0;n.fixedClassName=i.fixedClassName?i.fixedClassName:"fixed-header";r.$window.setTimeout(function(){n.fixedOffset=n.fixedOffset?n.fixedOffset:u.offsetTop-n.fixedTop;n.$windowElem.on("scroll",n.AddFixClass)},3e3);n.AddFixClass=function(){if(r.$window.pageYOffset>=n.fixedOffset){if(n.isSupportCssSticky)u.parentElement.classList.contains("sticky")||u.parentElement.classList.add("sticky");else if(u.classList.contains(n.fixedClassName)||u.classList.add(n.fixedClassName),f==="true"){var i=t.parent()[0];u.style.width=i&&i.getBoundingClientRect().width+"px"}}else n.isSupportCssSticky?u.parentElement.classList.contains("sticky")&&u.parentElement.classList.remove("sticky"):(u.classList.contains(n.fixedClassName)&&u.classList.remove(n.fixedClassName),f==="true"&&(u.style.width="initial"))}}}return n.factory=function(){var t=function(t,i,r){return new n(t,i,r)};return t.$inject=["$window","UserAgentUtility","DeviceValue"],t},n}();n.StickyDirective=t;angular.module("NineYi.Mall.Directives").directive("nsSticky",t.factory())})(t=n.Directives||(n.Directives={}))})(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.$timeout=n;this.facebook=t;this.scope={page:"@",height:"@",faces:"@",posts:"@",hideCover:"@",width:"@"};this.template='<div ng-if="IsSdkInitialized" class="fb-page" data-href="{{page}}"data-hide-cover="{{hideCover}}" data-width="{{width}}" data-show-facepile="{{faces}}"data-height="{{height}}"data-show-posts="{{posts}}"><\/div>';this.restrict="EA";this.link=function(n){n.height=n.height|550;n.faces=n.faces||!1;n.posts=n.posts||!0;n.hide=n.hide||!1;n.width=n.width|300;n.$watch(function(){return t.isReady()},function(){n.IsSdkInitialized=!0})}}return n.factory=function(){var t=function(t,i){return new n(t,i)};return t.$inject=["$timeout","Facebook"],t},n}();n.FacebookPageDirective=t;angular.module("NineYi.Mall.Directives").directive("nsFacebookPage",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsRepeatEnd",[function(){return{restrict:"A",link:function(n){n.$last&&n.$emit("onRepeatEnd")}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsTouch",["$parse","$rootScope",function(n,t){return{restrict:"A",compile:function(i,r){var u=n(r.nsTouch,null,!0);return function(n,i){i.on("touchstart",function(i){var r=function(){u(n,{$event:i})};t.$$phase?n.$evalAsync(r):n.$apply(r)})}}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){var i=this;this.$log=n;this.$timeout=t;this.restrict="A";this.link=function(n,t,r){var u,f,e;if(n.$event={name:"",isSecure:!1,isRunning:!1,target:t[0],types:{start:"mousedown",move:"mousemove",end:"mouseup",cancel:""},time:{start:0,end:0,duration:0},coords:{start:{x:0,y:0},end:{x:0,y:0}},events:{start:null,move:null,end:null,cancel:null},directionX:0,directionY:0,offsetX:0,offsetY:0,holdfor:0,threshold:0},u=function(t){n.$event.name=t;!r[t]||(n.$eval(r[t]),n.$apply())},typeof window.ontouchstart!="undefined"&&typeof window.ontouchend!="undefined"&&typeof window.ontouchcancel!="undefined"?(n.$event.types.start="touchstart",n.$event.types.move="touchmove",n.$event.types.end="touchend",n.$event.types.cancel="touchcancel",f=function(n){var t=!!n&&!!n.changedTouches&&!!(n.changedTouches.length>0)?n.changedTouches[0]:{};return{x:t.pageX||n.pageX||0,y:t.pageY||n.pageY||0}}):window.navigator.pointerEnabled?(n.$event.types.start="pointerdown",n.$event.types.move="pointermove",n.$event.types.end="pointerup"):window.navigator.msPointerEnabled?(n.$event.types.start="MSPointerDown",n.$event.types.move="MSPointerMove",n.$event.types.end="MSPointerUp",n.$event.types.cancel="MSPointerOut"):f=function(n){return{x:n.pageX||0,y:n.pageY||0}},!r.tap){n.$event.isSecure=!0;var o=null,h=function(t){n.$event.isRunning&&(n.$event.events.move=t)},s=function(t){!o||i.$timeout.cancel(o);n.$event.isRunning&&(n.$event.isRunning=!1,n.$event.time.end=(new Date).getTime(),n.$event.time.duration=n.$event.time.end-n.$event.time.start,n.$event.events.end=t,n.$event.coords.end=f(t),n.$event.directionX=n.$event.coords.end.x-n.$event.coords.start.x,n.$event.directionY=n.$event.coords.end.y-n.$event.coords.start.y,n.$event.offsetX=Math.abs(n.$event.directionX),n.$event.offsetY=Math.abs(n.$event.directionY),n.$event.offsetX<=n.$event.threshold&&n.$event.offsetY<=n.$event.threshold?!!r.hold&&n.$event.time.duration>=n.$event.holdfor?u("hold"):u("secureTap"):n.$event.offsetX>=n.$event.offsetY?u(n.$event.directionX>0?"swipeRight":"swipeLeft"):u(n.$event.directionY>0?"swipeDown":"swipeUp"))},e=function(t){n.$event.isRunning=!0;n.$event.time.start=(new Date).getTime();n.$event.events.start=t;n.$event.coords.start=f(t);!r.hold||(o=i.$timeout(function(){s(n.$event.events.move||t)},n.$event.holdfor,!1))};n.$event.target.addEventListener(n.$event.types.start,e,!1);n.$event.target.addEventListener(n.$event.types.end,s,!1);!n.$event.types.cancel||n.$event.target.addEventListener(n.$event.types.cancel,s,!1);!r.hold||n.$event.target.addEventListener(n.$event.types.move,h,!1)}else n.$event.isSecure=!1,n.$event.isRunning=!1,e=function(t){n.$event.events.start=t;n.$event.coords.start=f(t);u("tap")},n.$event.target.addEventListener(n.$event.types.start,e,!1)}}return n.factory=function(){var t=function(t,i){return new n(t,i)};return t.$inject=["$log","$timeout"],t},n}();n.TouchSwipeDirective=t;angular.module("NineYi.Mall.Directives").directive("nsTouchSwipe",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){function n(n,t,i){return{restrict:"A",scope:{src:"="},link:function(r,u,f){u.on("load",function(){n.debug("Image Loaded: "+f.src);u.off("load");t(function(){u.attr("src",f.nsLazyImage)},i.lazyLoadDelay)})}}}n.$inject=["$log","$timeout","Mall.Config"];angular.module("NineYi.Mall.Directives").directive("nsLazyImage",n)})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsEndLessList",["$log","$window",function(n,t){return{restrict:"A",scope:{endLessModel:"=",startIndex:"=",isLock:"=",getModelMethod:"&",scrollElementId:"=?",scrollListener:"=?",isEnd:"=?"},link:function(i,r,u){function f(){var e="body",f=angular.element(t),o;i.scrollElementId&&(e=i.scrollElementId,f=angular.element(document.querySelector(e)));o=function(i,r){var u={fireY:document.querySelector("body").scrollHeight/2,scrollY:0};return{fire:function(){function e(){if(i.startIndex>=0&&!i.isLock&&i.isEnd!==!0){var o=r[0].getBoundingClientRect();u.scrollY=t.scrollY||t.pageYOffset;u.fireY=o.top+o.height/2;u.scrollY>=u.fireY&&(n.debug("endless list keep going"),i.$apply(i.getModelMethod))}else(i.startIndex<0||i.isEnd===!0)&&(n.debug("endless list finish"),f.off("scroll",e))}i.scrollListener={listener:f,event:e};f.on("scroll",e)}}}(i,r,u).fire()}if(i.endLessModel&&i.endLessModel.length>0)f();else var e=i.$watch("endLessModel",function(n,t){n!==t&&(f(),e())});i.$watch("isEnd",function(n,t){typeof n!="undefined"&&n!==t&&(i.isEnd=n)})}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsEndLessOrderList",["$log","$window",function(n,t){return{restrict:"A",scope:{endLessModel:"=",startIndex:"=",isLock:"=",getModelMethod:"&",scrollElementId:"=?",scrollListener:"=?",isEnd:"=?"},link:function(i,r,u){function f(){var e="body",f=angular.element(t),o;i.scrollElementId&&(e=i.scrollElementId,f=angular.element(document.querySelector(e)));o=function(i,r){var u={fireY:document.querySelector("body").scrollHeight/2,scrollY:0};return{fire:function(){function e(){var o,s,h;i.startIndex>=0&&!i.isLock&&i.isEnd!==!0?(o=r[0].getBoundingClientRect(),u.scrollY=t.scrollY||t.pageYOffset,s=document.querySelector("body").scrollHeight/2,h=o.top+o.height/2,u.fireY=h||s||u.fireY,u.scrollY>=u.fireY&&(n.debug("endless list keep going"),i.$apply(i.getModelMethod))):(i.startIndex<0||i.isEnd===!0)&&(n.debug("endless list finish"),f.off("scroll",e))}i.scrollListener={listener:f,event:e};f.on("scroll",e)}}}(i,r,u).fire()}if(i.endLessModel&&i.endLessModel.length>0)f();else var e=i.$watch("endLessModel",function(n,t){n!==t&&(f(),e())});i.$watch("isEnd",function(n,t){typeof n!="undefined"&&n!==t&&(i.isEnd=n)})}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){var t=this;this.$window=n;this.restrict="A";this.link=function(i,r,u){var f=0,e=function(){var t=n.scrollY,e=u.triggerOffsetY,i=u.effectCssClass;t<e&&t!==0||(t>f?r.addClass(i):r.removeClass(i),f=t)};r.ready(function(){t.$window.addEventListener("scroll",e)})}}return n.factory=function(){var t=function(t){return new n(t)};return t.$inject=["$window"],t},n}();n.ScrollToggleClassDirective=t;angular.module("NineYi.Mall.Directives").directive("nsScrollToggleClass",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){var i=this;this.$log=n;this.GoogleAnalyticsUtility=t;this.restrict="A";this.link=function(n,t,r){var u=!1;n.SendEventTrack=function(n){n.type==="click"&&(u=!0);u&&i.GoogleAnalyticsUtility.TrackEvent(r.trackCategory,r.trackAction,r.trackLabel,r.trackValue)};t.on("touchstart",function(){u=!0});t.on("touchmove",function(){u=!1});t.on("click touchend",n.SendEventTrack)}}return n.factory=function(){var t=function(t,i){return new n(t,i)};return t.$inject=["$log","GoogleAnalyticsUtility"],t},n}();n.GAEventTrackDirective=t;angular.module("NineYi.Mall.Directives").directive("nsGaEventTrack",t.factory())})(t=n.Directives||(n.Directives={}))})(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.GoogleAnalyticsEcommerceUtility=t;this.restrict="A";this.link=function(n,i,r){var u=!1;n.SendProductClick=function(n){if(n.type==="click"&&(u=!0),u){var i={id:r.productId,name:"("+r.productId+")"+r.productName,price:r.productPrice,position:r.productPosition},f=r.listName;t.ProductClicks(i,f)}};i.on("touchstart",function(){u=!0});i.on("touchmove",function(){u=!1});i.on("click touchend",n.SendProductClick)}}return n.factory=function(){var t=function(t,i){return new n(t,i)};return t.$inject=["$log","GoogleAnalyticsEcommerceUtility"],t},n}();n.GAECommerceProductClicksDirective=t;angular.module("NineYi.Mall.Directives").directive("nsGaEcProductClicks",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsScrollToTop",["$window",function(n){return{restrict:"A",link:function(t,i){function e(t){var i=n.scrollY||n.pageYOffset,r=-i/(t/15),u=setInterval(function(){i=n.scrollY||n.pageYOffset;i!=0?n.scrollBy(0,r):clearInterval(u)},15)}function r(){var t=n.scrollY||n.pageYOffset;t-=100;n.scrollTo(0,t);t>0&&requestAnimationFrame(r)}var u=n.innerHeight,f=angular.element(n);i.on("click",function(t){var i=n.scrollY||n.pageYOffset;t.preventDefault();t.stopPropagation();i>600&&n.scrollTo(0,600);window.requestAnimationFrame?requestAnimationFrame(r):e(300)});f.on("scroll",function(){var t=n.scrollY||n.pageYOffset;t>u?i.removeClass("hide-over-bottom"):i.addClass("hide-over-bottom")})}}}])})(t=n.Directives||(n.Directives={}))})(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){var r=this;this.$window=n;this.$timeout=t;this.animeUtility=i;this.restrict="AE";this.transclude=!0;this.templateUrl="/V2/TypeScripts/Directives/ns-slide-list/slideListDirective.html";this.link=function(n,t,i){var e=t[0],f=parseInt(i.itemWidth),u=parseInt(i.itemCount),o=i.adaptSliderModel||!1;n.currentSlide=0;n.changeSlide=function(){var e=-1*f*u*n.currentSlide,i,s,t;o&&(i=n.slidesNum-n.currentSlide*u,s=i<u?i+(u-1)*n.currentSlide:u*n.currentSlide,e=-1*f*s);t="translate3d("+e+"px, 0px, 0px)";r.slideContentElement.style.transform=t;r.slideContentElement.style["-webkit-transform"]=t;r.slideContentElement.style["-moz-transform"]=t;r.slideContentElement.style["-o-transform"]=t;r.slideContentElement.style["-ms-transform"]=t};n.goToNext=function(){r.slideContentElement&&n.currentSlide<n.pagerCount-1&&(n.currentSlide=n.currentSlide+1,n.changeSlide())};n.goToPrev=function(){r.slideContentElement&&n.currentSlide>0&&(n.currentSlide=n.currentSlide-1,n.changeSlide())};n.initSlide=function(){var t=e.querySelector(".ns-slide-list");t.style.width=f*u+"px";r.$timeout(function(){if(r.slideContentElement=e.querySelector(".slide-container"),r.slideContentElement){var t=r.slideContentElement.querySelectorAll(".slide-item");n.slidesNum=t.length;r.slideContentElement.style.width=f*u*n.slidesNum+"px";n.pagerCount=n.slidesNum%u==0?~~(n.slidesNum/u):~~(n.slidesNum/u)+1}})};n.initSlide();n.$watch(function(){return i.itemId},function(){n.initSlide()},!0)}}return n.factory=function(){var t=function(t,i,r){return new n(t,i,r)};return t.$inject=["$window","$timeout","AnimeUtility"],t},n}();n.SlideListDirective=t;angular.module("NineYi.Mall.Directives").directive("nsSlideList",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){var t=this;this.AdobeAnalyticsUtility=n;this.restrict="A";this.link=function(n,i,r){i.on("click",function(){r.productId||r.productName?t.AdobeAnalyticsUtility.ProductRecommendationClick([{id:r.productId,name:r.productName}]):t.AdobeAnalyticsUtility.ProductRecommendationClick([{id:i.children()[0].attributes["data-product-id"].value,name:i.children()[0].attributes["data-product-name"].value}])})}}return n.factory=function(){var t=function(t){return new n(t)};return t.$inject=["AdobeAnalyticsUtility"],t},n}();n.AdobeAnalyticsEventTrackDirective=t;angular.module("NineYi.Mall.Directives").directive("nsAdobeAnalyticsEventTrack",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){dayjs.extend(dayjs_plugin_customParseFormat);var n=function(n,t,i,r){for(var u=dayjs(n);u.isBefore(t,"day");){if(_.every(i,function(n){return n!==u.format("YYYY-MM-DD")})&&_.every(r,function(n){return n!==u.day()}))return u.toDate();u=u.add(1,"day")}};angular.module("NineYi.Mall.Directives").directive("nsValidateDateFormat",function(){return{require:"ngModel",link:function(n,t,i,r){r.$validators.nsValidateDateFormat=function(n){return r.$isEmpty(n)||dayjs(n).isValid()};r.$formatters.push(function(n){if(n)return dayjs(n).format("YYYY/MM/DD")});r.$parsers.push(function(n){if(n)return dayjs(n).format("YYYY-MM-DD")})}}});angular.module("NineYi.Mall.Directives").directive("nsValidateDateSelectable",function(){return{require:"ngModel",scope:{nsMinDate:"=nsMinDate",nsMaxDate:"=nsMaxDate",nsDisabledDates:"=nsDisabledDates",nsDisabledWeekdays:"=nsDisabledWeekdays"},link:function(n,t,i,r){var u=n.nsMinDate,s=u===void 0?"1900-01-01":u,f=n.nsMaxDate,h=f===void 0?"2100-12-31":f,e=n.nsDisabledDates,c=e===void 0?[]:e,o=n.nsDisabledWeekdays,l=o===void 0?[]:o;r.$validators.nsValidateDateSelectable=function(n){if(r.$isEmpty(n))return!0;if(c.indexOf(n)>=0)return!1;var t=dayjs(n);return t.isValid()?l.indexOf(t.get("day"))>=0?!1:t.isBefore(dayjs(s),"day")||t.isAfter(dayjs(h),"day")?!1:!0:!0}}}});angular.module("NineYi.Mall.Directives").directive("nsDatepicker",["$window","$translate","DeviceValue",function(t,i,r){return{restrict:"EA",templateUrl:"/V2/TypeScripts/Directives/ns-datepicker/datepicker.html",scope:{nsSelectedDate:"=?nsSelectedDate",nsMinDate:"=?nsMinDate",nsMaxDate:"=?nsMaxDate",nsDisabledDates:"=?nsDisabledDates",nsDisabledWeekdays:"=?nsDisabledWeekdays",nsPlaceholder:"@?nsPlaceholder",nsSubmitted:"=?nsSubmitted",nsRequired:"=?nsRequired",cssClassTitle:"@?cssClassTitle",cssClassInput:"@?cssClassInput",cssClassBtn:"@?cssClassBtn",cssClassValidation:"@?cssClassValidation"},replace:!0,link:function(u,f){var e=u.nsMinDate,o=u.nsMaxDate,s=u.nsDisabledDates,h=u.nsDisabledWeekdays,c=n(e,o,s,h);i.onReady(function(){var l=f[0].querySelector(".ns-datepicker__input"),n=datepicker(l,{onSelect:function(n,t){if(t===undefined){u.nsSelectedDate="";u.$apply();return}},onShow:function(n){var t=n.dateSelected||c;t&&(n.currentMonth=t.getMonth(),n.currentYear=t.getFullYear(),n.renderCalendar(n))},formatter:function(n,t){u.nsSelectedDate=dayjs(t).format("YYYY-MM-DD");u.$apply()},position:r.IsMobile()?"c":"bl",startDate:c,minDate:e?dayjs(e,"YYYY-MM-DD").toDate():null,maxDate:o?dayjs(o,"YYYY-MM-DD").toDate():null,disabledDates:s?s.map(function(n){return dayjs(n,"YYYY-MM-DD").toDate()}):null,disabler:function(n){return h?h.indexOf(n.getDay())>=0:!1},customDays:[i.instant("frontend.typescripts.directives.ns_date_picker.sunday"),i.instant("frontend.typescripts.directives.ns_date_picker.monday"),i.instant("frontend.typescripts.directives.ns_date_picker.tuesday"),i.instant("frontend.typescripts.directives.ns_date_picker.wednesday"),i.instant("frontend.typescripts.directives.ns_date_picker.thursday"),i.instant("frontend.typescripts.directives.ns_date_picker.friday"),i.instant("frontend.typescripts.directives.ns_date_picker.saturday"),],customMonths:[i.instant("frontend.typescripts.directives.ns_date_picker.january"),i.instant("frontend.typescripts.directives.ns_date_picker.february"),i.instant("frontend.typescripts.directives.ns_date_picker.march"),i.instant("frontend.typescripts.directives.ns_date_picker.april"),i.instant("frontend.typescripts.directives.ns_date_picker.may"),i.instant("frontend.typescripts.directives.ns_date_picker.june"),i.instant("frontend.typescripts.directives.ns_date_picker.july"),i.instant("frontend.typescripts.directives.ns_date_picker.august"),i.instant("frontend.typescripts.directives.ns_date_picker.september"),i.instant("frontend.typescripts.directives.ns_date_picker.october"),i.instant("frontend.typescripts.directives.ns_date_picker.november"),i.instant("frontend.typescripts.directives.ns_date_picker.december"),]});u.$watch("nsSelectedDate",function(i){if(!i){n.dateSelected=undefined;return}t.setTimeout(function(){var t=dayjs(i);n.setDate(t.isValid()?t.toDate():undefined)},0)});u.nsHandleToggle=function(t){t.stopPropagation();var i=n.calendarContainer.classList.contains("qs-hidden");n[i?"show":"hide"]()}})}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(){angular.module("NineYi.Mall.Directives").directive("nsCookiePrivacyTip",["OfficialOriginDomain","ShopId","CookieUtility","AppVersionUtility","PageValue","DeviceValue",function(t,i,r,u,f,e){return{restrict:"E",templateUrl:"/V2/TypeScripts/Directives/ns-cookie-privacy-tip/cookiePrivacyTipDirective.html",link:function(o){var s=e.IsMobile();o.bottomOffset=0;s&&f.CurrentPage===n.Mall.Models.PageNameEnum.SalePageIndex&&(o.bottomOffset=67);f.CurrentPage===n.Mall.Models.PageNameEnum.PromotionEngineDetail&&(o.bottomOffset=63);s&&f.CurrentPage===n.Mall.Models.PageNameEnum.PromotionEngineDetail&&(o.bottomOffset=110);o.isOpenPrivacyBlock=!1;o.isEnablePrivacyTip=!r.GetCookie("allowGetPrivacyInfo")&&!u.IsFromApp()&&f.CurrentPage!==n.Mall.Models.PageNameEnum.ShoppingCartIndex&&f.CurrentPage!==n.Mall.Models.PageNameEnum.PayIndex&&f.CurrentPage!==n.Mall.Models.PageNameEnum.PayLanding&&f.CurrentPage!==n.Mall.Models.PageNameEnum.PayFinish;o.privacyLinkUrl=t+"/MyAccount/Privacy?shopId="+i;o.openPrivacyBlock=function(){o.isOpenPrivacyBlock=!0};o.handleAgreeButtonClick=function(){r.AddCookie("allowGetPrivacyInfo",(!0).toString(),365);o.isEnablePrivacyTip=!1}}}}])})(i=t.Directives||(t.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsFavoriteHeart",function(){return{replace:!0,restrict:"E",templateUrl:"/V2/TypeScripts/Components/ns-favorite-heart/favoriteHeartDirective.html",scope:{isFav:"="}}})})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsSvgLoadMore",function(){return{replace:!0,restrict:"E",templateUrl:"/V2/TypeScripts/Components/ns-svg/svgLoadMoreDirective.html"}})})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t){var i=this;this.$log=n;this.$timeout=t;this.scope={onClick:"&",isLoading:"=",isEnded:"="};this.templateUrl="/V2/TypeScripts/Components/ns-load-more/loadMoreDirective.html";this.restrict="AE";this.link=function(n){n.isLoading=n.isLoading||!1;n.ClickLoadMore=function(){i.$log.debug("loadMore start");i.$timeout(function(){n.$apply(function(){n.onClick();i.$log.debug("loadMore end")})})}}}return n.factory=function(){var t=function(t,i){return new n(t,i)};return t.$inject=["$log","$timeout"],t},n}();n.LoadMoreDirective=t;angular.module("NineYi.Mall.Directives").directive("nsLoadMore",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsAd",["$log","$window","LayoutTemplateDataService",function(n,t,i){return{link:function(r,u,f){var e=f.code,o=f.adCode,s=f.hdAdCode;o&&s&&(e=t.innerWidth>=768?s:o);n.info("Get LayoutTemplate Data - Start",e);i.GetLayoutTemplateData(e).then(function(t){n.info("Get LayoutTemplate Data - Finish",e);angular.forEach(t,function(n){n.PicturePath&&n.PicturePath.FullUrl&&(n.PicturePath.FullUrl=n.PicturePath.FullUrl.replace(/\/t\//,"/s/"))});r.AdDataList=t;n.debug("LayoutTemplateData",e,r.AdDataList)})},restrict:"EA",replace:!0,template:"<div ng-transclude><\/div>",transclude:!0}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsAdBoard",["$log","$window",function(n,t){return{restrict:"EA",template:"<div ng-transclude><\/div>",transclude:!0,scope:{ngModel:"=",adCode:"@",hdAdCode:"@",useHd:"@",action:"@",useAllDevice:"@"},link:function(n,i,r,u,f){function e(){if(!n.useAllDevice&&i[0].ownerDocument.defaultView.getComputedStyle(i[0]).display==="none"){n.boardDataList=[];return}var r={ngModel:n.ngModel||[],adCode:n.adCode||"",hdAdCode:n.hdAdCode||"",useHD:n.useHd==="true"?!0:undefined,adCodeList:n.ngModel&&(n.ngModel[n.adCode]||[]),hdAdCodeList:n.ngModel&&(n.ngModel[n.hdAdCode]||[]),transclude:function(){f(n,function(n){i.empty();i.append(n)})}};typeof r.useHD=="undefined"&&t.innerWidth<768&&(r.useHD=!1);typeof r.useHD=="undefined"&&t.innerWidth>=768&&(r.useHD=!0);r.useHD===!1&&r.adCodeList.length>0?(n.boardDataList=r.adCodeList,r.transclude()):r.useHD===!0&&r.hdAdCodeList.length>0?(n.boardDataList=r.hdAdCodeList,r.transclude()):(n.boardDataList=[],i.remove(),r.useHD)}if(n.ngModel)e();else var o=n.$watch("ngModel",function(t,i){t!==i?(e(),o()):n.ngModel&&e()})}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsSearch",["$window","$sce","$translate","SearchService","ShopId","OfficialOriginDomain","$timeout","localStorageService","Mall.Value","GoogleAnalyticsUtility","TrackingUtility","GuidUtility","Market",function(n,t,i,r,u,f,e,o,s,h,c){return{restrict:"EA",templateUrl:"/V2/TypeScripts/Components/ns-search/search.html",scope:{ngModel:"=?",nsIsUseAccurateComparison:"=?",nsIsDefaultUseAccurateComparison:"=?",nsPosition:"@?"},link:function(i){var o=/^service./i;i.search={keyWord:"",keyWordList:[],historyKeyWordList:[],maxHistoryKeyWordLength:15,maxKeyWordLength:10,maxDisplayHistoryLength:3,keyCodeTransform:{38:"up",40:"down"},selectIndex:-2,keyTimes:0,timeDisposer:undefined,showListType:"",delayTime:800,clickItem:function(n){c.trackSelectContent({adobeContentInfo:{eventInfo:{searchTerm:n.text,searchSuggestionName:n.text},eventMessage:"searchSuggestionClick",exclude:"GA4"},contentType:"",id:"",linkUrl:"",name:""});this.keyWord=n.text;this.keyWordList=[];this.doSearch()},doSearch:function(){var e,r,t,s;if(i.TrackSearchEvent(),i.search.keyWord&&i.search.keyWord!==""){if(o.test(n.location.hostname)){n.location.href=f+"/v2/Search?q="+encodeURIComponent(i.search.keyWord)+"&shopId="+u;return}if(Modernizr.localstorage){if(i.search.historyKeyWordList=n.localStorage.SearchHistoryKeyWord?JSON.parse(n.localStorage.SearchHistoryKeyWord):[],i.search.historyKeyWordList.length!==0){for(e=-1,r=0;r<i.search.historyKeyWordList.length;r++)i.search.historyKeyWordList[r].text===i.search.keyWord&&(e=r);e!==-1&&i.search.historyKeyWordList.splice(e,1)}i.search.historyKeyWordList.unshift({type:"history",text:i.search.keyWord,selected:!1});i.search.historyKeyWordList.length>i.search.maxHistoryKeyWordLength&&i.search.historyKeyWordList.splice(i.search.maxHistoryKeyWordLength,1);n.localStorage.SearchHistoryKeyWord=JSON.stringify(i.search.historyKeyWordList)}t=i.search.keyWord;s=t.length>2&&t.charAt(0)==='"'&&t.charAt(t.length-1)==='"';t=t.replace(/['"]+/g,"");(i.nsIsDefaultUseAccurateComparison&&i.nsIsUseAccurateComparison===null||i.nsIsUseAccurateComparison||s)&&(t='"'+t+'"');n.location.href=f+"/v2/Search?q="+encodeURIComponent(t)+"&shopId="+u}},getKeyWords:function(){if(this.timeDisposer&&e.cancel(this.timeDisposer),this.selectIndex=-2,i.search.keyWord===""){i.search.keyWordList=[];i.search.getHistoryKeyWord();return}if(i.search.keyWord.length>100&&(i.search.keyWord=i.search.keyWord.substr(0,100)),i.search.showListType="both",i.search.keyWordList=[],_.each(i.search.historyKeyWordList,function(n){if(n.text&&n.text.indexOf(i.search.keyWord)!==-1){var t=i.MatchKeywordHTML(n.text);i.search.keyWordList.unshift({type:"history",text:n.text,selected:!1,displayText:t})}}),i.search.keyWordList.length>=10){i.search.keyWordList.slice(0,10);return}this.timeDisposer=e(function(){r.GetShopSalePageTermListByKeyword(i.search.keyWord).then(function(n){_.each(n,function(n){var t=!0,r;_.each(i.search.keyWordList,function(i){i.text==n.SalePageTermText&&(t=!1)});t&&(r=i.MatchKeywordHTML(n.SalePageTermText),i.search.keyWordList.push({type:"key",text:n.SalePageTermText,selected:!1,displayText:r}))})})},i.search.delayTime)},selectAutoCompleteItem:function(n){n.stopPropagation();n.bubbles=!1;n.keyCode===13&&(n.preventDefault(),this.keyTimes%2==0&&(i.search.selectIndex>=0?i.TrackEvent("Header_搜尋","搜尋-AutoComplete",i.search.keyWord):i.TrackSearchEvent(),this.doSearch()),this.keyTimes+=1);var t=this.keyCodeTransform[n.keyCode];t&&this.switchSelectedItem(t)},switchSelectedItem:function(n){this.doSwitchItem(n)},doSwitchItem:function(n){if(this.keyWordList.length!==0){if(n&&this.keyTimes%2==0){if(this.selectIndex<0){this.selectIndex+=1;this.selectIndex===0&&this.keyWordList.length>0&&(this.keyWordList[this.selectIndex].selected=!0,this.keyWord=this.keyWordList[this.selectIndex].text);return}this.keyWordList[this.selectIndex].selected=!1;n==="down"?this.selectIndex<this.keyWordList.length-1?this.selectIndex+=1:this.selectIndex=0:this.selectIndex>0?this.selectIndex-=1:this.selectIndex=this.keyWordList.length-1;this.keyTimes+=1;this.keyWordList[this.selectIndex].selected=!0;this.keyWord=this.keyWordList[this.selectIndex].text;return}this.keyTimes+=1}},focusSearchBar:function(n){n?(i.nsPosition==="header"&&i.TrackEvent("全站_Header","搜尋","Focus"),i.search.keyWord!==""?i.search.getKeyWords():i.search.getHistoryKeyWord()):i.isDesktop&&e(function(){i.search.showListType=""},200)},getHistoryKeyWord:function(){(i.search.historyKeyWordList=[],o.test(n.location.hostname))||(Modernizr.localstorage&&(i.search.historyKeyWordList=n.localStorage.SearchHistoryKeyWord?JSON.parse(n.localStorage.SearchHistoryKeyWord):[]),i.search.keyWordList=i.search.historyKeyWordList,i.search.showListType="history")}};i.isDesktop=s.deviceSize==="pc";i.$watch("ngModel",function(n,t){i.ngModel?i.search.keyWord=i.ngModel:n!==t&&(i.search.keyWord=i.ngModel)});i.$watch("search.keyWord",function(n,t){n!==t&&(i.ngModel=i.search.keyWord)});i.MatchKeywordHTML=function(n){var r=n.replace(i.search.keyWord,"<b>"+i.search.keyWord+"<\/b>");return t.trustAsHtml(r)};i.TrackEvent=function(n,t,i){h.TrackEvent(n,t,i)};i.TrackSearchEvent=function(){i.nsIsUseAccurateComparison&&i.TrackEvent("搜尋-進階篩選","進階篩選-搜尋方式","AccurateComparison")}}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(){var t=n.Mall.Models.PageNameEnum;angular.module("NineYi.Mall.Directives").directive("nsBrowsingHistory",["$log","Mall.Value","PageValue","$window","$timeout","$translate","ShoppingCartUtility","SalePageService","ShopId","GoogleAnalyticsEcommerceUtility","GoogleAnalyticsUtility","CookieUtility","DefaultCurrencyCode","DialogUtility",function(n,i,r,u,f,e,o,s,h,c,l,a,v,y){return{restrict:"EA",templateUrl:"/V2/TypeScripts/Components/ns-browsing-history/browsingHistory.html",scope:{},link:function(u,f){function b(){var n=a.GetCookie("salePageViewList");s.GetSalePageDataByIds(n).then(function(n){u.salePageViewList=[];n&&(u.salePageViewList=n.reverse())})}function k(n,t){n&&(n.style.transform="translate3d(0, "+t+"px, 0)",n.style["-webkit-transform"]="translate3d(0, "+t+"px, 0)",n.style["-moz-transform"]="translate3d(0, "+t+"px, 0)",n.style["-ms-transform"]="translate3d(0, "+t+"px, 0)")}function g(n,t){n&&(n.style.transition="transform "+t)}function d(n,t,i){var u=r.CurrentPageName;u!==""&&l.TrackEvent(n,t,u+"-"+i)}var e,v,c,p,w;u.gaReferSrc="garefersrc=BrowseHistory";u.showDetail=!1;u.isDesktop=i.deviceSize==="pc";u.showMenu=u.isDesktop;u.shopId=h;u.currentIndex=0;u.browsingMenuCount=3;p=93;u.isDesktop&&b();u.isDesktop||(w=r.CurrentPage,w==t.SalePageIndex&&f[0].querySelector(".browsing-header").setAttribute("style","bottom:130px"));u.$on("onRepeatEnd",function(){u.initSetting()});u.initSetting=function(){u.currentIndex=0;e=f[0].querySelector(".browsing-menu-ul");p=f[0].querySelector(".browsing-menu-li").getBoundingClientRect().height;n.debug("componentsHeight, "+p);v=p*u.browsingMenuCount;n.debug("containerHeight, "+v);f[0].querySelector(".menu-frame").setAttribute("style","max-height:"+v+"px");c=0;k(e,c)};u.switchMenu=function(){u.isDesktop?u.showMenu=!u.showMenu:(u.showMenu=!u.showMenu,u.showMenu&&(d("瀏覽紀錄","click","展開瀏覽紀錄"),u.salePageViewList||b()))};u.scrollDown=function(){u.scroll(!1)};u.scrollUp=function(){u.scroll(!0)};u.scroll=function(n){if(!(u.salePageViewList.length<=u.browsingMenuCount)){var i=!n,t=1;(i&&(t=-1),n&&u.currentIndex-u.browsingMenuCount<0)||i&&u.currentIndex+u.browsingMenuCount>=u.salePageViewList.length||(u.currentIndex=u.currentIndex-t*u.browsingMenuCount,g(e,"0.8s"),c=c+t*v,k(e,c))}};u.hoverDetailFunction=function(n){var t=f[0].querySelector(".browsing-body-desktop .menu-frame");return n?t.classList.add("extand-width"):t.classList.remove("extand-width"),n};u.addToCart=function(n){var t=this;d("瀏覽紀錄","click","加入購物車");o.AddToCart(n,this.shopId,null,null,"瀏覽紀錄").then(function(n){if(n){y.Toast(n,y.ToastModeEnum.Warning,750);return}y.Toast(t.$translate.insert("frontend.typescripts.components.success_add"),y.ToastModeEnum.Success,750)})};u.clearHistory=function(){e&&e.style.removeProperty("transition");var n=new Date;document.cookie="salePageViewList=;expires="+n.toUTCString()+";path=/";u.salePageViewList=[];u.currentIndex=0};u.TrackEvent=function(n,t,i){l.TrackEvent(n,t,i)}}}}])})(i=t.Directives||(t.Directives={}))})(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){var u=this;this.$log=n;this.$timeout=t;this.$translate=i;this.FreezeBodyUtility=r;this.restrict="EA";this.replace=!0;this.scope={IsOpen:"=nsIsOpen",OpenDirection:"=?nsOpenDirection",ShowClose:"=?nsShowClose",PageCaption:"=?nsPageCaption",CloseFunction:"&?nsCloseFunction",IsFullLayout:"=nsIsFullLayout"};this.transclude=!0;this.templateUrl="/V2/TypeScripts/Components/ns-push-half-page/pushHalfPage.html";this.link=function(n,t){var f=t[0],e=angular.element(f.querySelector(".half-page-background")),i,r;n.OpenDirection=n.OpenDirection||"left";i=angular.element(f.querySelector(".half-page-container"));n.OpenDirection==="right"||n.OpenDirection==="left"?n.IsFullLayout?i.addClass("horizontal-container horizontal-container--full"):i.addClass("horizontal-container"):n.OpenDirection==="bottom-no-fixed-height"?i.addClass("vertical-no-fixed-height-container"):i.addClass("vertical-container");r=f.querySelector(".half-page-container");n.DetectScrollTop=function(){var n=r.scrollTop,t=r.scrollHeight,i=n+r.offsetHeight;n===0?r.scrollTop=1:i===t&&(r.scrollTop=n-1)};n.$watch(function(){return n.IsOpen},function(t){t?(e.addClass("open-mask"),i.removeClass("close-"+n.OpenDirection),i.addClass("open-"+n.OpenDirection),u.FreezeBodyUtility.FreezeBody(),r.addEventListener("touchstart",n.DetectScrollTop)):(e.removeClass("open-mask"),i.removeClass("open-"+n.OpenDirection),i.addClass("close-"+n.OpenDirection),u.FreezeBodyUtility.UnFreezeBody(),r.removeEventListener("touchstart",n.DetectScrollTop))});u.$timeout(function(){n.IsLoad=!0});n.ClosePage=function(){n.IsOpen=!1;typeof n.CloseFunction=="function"&&n.CloseFunction()}}}return n.factory=function(){var t=function(t,i,r,u){return new n(t,i,r,u)};return t.$inject=["$log","$timeout","$translate","FreezeBodyUtility"],t},n}();n.PushHalfPageDirective=t;angular.module("NineYi.Mall.Directives").directive("nsPushHalfPage",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsFixedAside",["$window",function(n){return{restrict:"AC",link:function(t,i,r){var u=768,f=n.innerWidth,e=function(){function g(){if(n.innerWidth>=u){if(o=t.clientHeight,f=t.getBoundingClientRect(),s=document.querySelector(r.competitor),l=s&&s.clientHeight,e=n.innerHeight,h=n.scrollY||n.pageYOffset,w=s.parentElement.offsetTop,s&&o>=l)return y(),o-e+f.top<=0&&(t.style.marginBottom=a+"px"),!0;var i=!!document.querySelector(".is-loading");!v&&!i&&h>o-e?(f.height>=e&&f.bottom<=e||f.height<e&&+f.top<=0)&&(f.height<e&&(p=document.querySelector("#officialHeader").getBoundingClientRect().height),c||(c=f.height-f.bottom+w),v=!0,t.classList.add("fixed-aside"),t.removeAttribute("style"),t.style.width=f.width+"px",o<=e-a?t.style.top=p+"px":t.style.bottom=a+"px"):o>e?h<=o-e+w&&y():h<=c&&y()}n.scrollY==0&&y()}function k(){o=t.clientHeight;f=t.getBoundingClientRect();p=t.getBoundingClientRect().top;s=document.querySelector(r.competitor);l=s&&s.clientHeight;d=document.querySelector(".layout-header");b=document.querySelector(".layout-footer");a=b.clientHeight;h=0;v=!1;c=null;e=n.innerHeight}function y(){v=!1;c=null;t.classList.remove("fixed-aside");t.removeAttribute("style")}var t=i[0],o,f,p,s,l,w,d,b,a,h,v,c,e;return k(),{needFix:function(){if(o<l)return!0},init:function(){k()},bindAffix:function(){n.innerWidth>=u&&n.addEventListener("scroll",g)}}}().bindAffix();n.addEventListener("resize",function(){n.innerWidth!==f&&n.scrollTo(0,0)})}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsHotKeywordSearch",["$window","$translate","SearchService","ShopId","OfficialOriginDomain","$timeout","Mall.Value","GoogleAnalyticsUtility","TrackingUtility","UrlUtility",function(n,t,i,r,u,f,e,o,s,h){return{restrict:"E",templateUrl:"/V2/TypeScripts/Components/ns-hot-keyword-search/hotKeywordSearch.html",scope:{gaCategory:"@?nsGaCategory",gaLabel:"@?nsGaLabel",hasCallApi:"=?nsCallApi"},link:function(t){t.shopId=r;t.hotKeywordList=[];t.$watch("hasCallApi",function(n){n||t.hotKeywordList.length!==0||i.GetShopHotKeywordList(r).then(function(n){t.hotKeywordList=n.Data})});t.hrefTo=function(i){t.gaCategory&&t.gaCategory!==""&&t.gaLabel&&t.gaLabel!==""&&o.TrackEvent(t.gaCategory,"click",t.gaLabel);var f=h.GetQuerystring("q");s.trackSelectContent({contentType:"",name:"",linkUrl:"",id:"",adobeContentInfo:{eventInfo:{searchTerm:f,searchSuggestionName:i},eventMessage:"searchSuggestionClick",exclude:"GA4"}});n.location.href=u+"/v2/Search?q="+encodeURIComponent(i)+"&shopId="+r}}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsSetClassByLink",["$window",function(n){return{restrict:"A",link:function(t,i,r){var p=n.location.search.replace("?","").split("&"),h="",o,c,u,f,y;p.forEach(function(n){n.toString().match(/ga/g)||(h+=n)});h!==""&&(h="?"+h);var l=n.location.pathname+h,w=l.toUpperCase().indexOf("/V2/")>-1?l.split("/")[2]:l.split("/")[1],v=r.className,a=i.find("a");for(u=0;u<a.length;u++){var f=angular.element(a[u]),b=f.attr("href"),s=b.split("/"),e=s.pop();if(s[0]==="")for(o=0;o<s.length;o++)c=s.pop(),e=c+"/"+e;else for(o=2;o<s.length;o++)c=s.pop(),e=c+"/"+e;if(e="/"+e,e.toUpperCase()===l.toUpperCase()){f.addClass(v);return}}for(u=0;u<a.length;u++)if(f=angular.element(a[u]),y=f.attr("href").toUpperCase().indexOf("/V2/")>-1?f.attr("href").split("/")[2]:f.attr("href").split("/")[1],y.toUpperCase()===w.toUpperCase()){f.addClass(v);return}}}}])})(t=n.Directives||(n.Directives={}))})(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){this.$q=n;this.$translate=t;this.ShopId=i;this.PageValue=r;this.ShoppingCartUtility=u;this.SalePageService=f;this.CookieUtility=e;this.SalePageServiceImmediate=o;this.DialogUtility=s}return n.prototype.GetSalePageViewList=function(){var t=[],n=this.$q.defer(),i=this.CookieUtility.GetCookie("salePageViewList");return i?this.SalePageServiceImmediate.GetSalePageDataByIds(i).then(function(i){i&&(t=i.reverse());n.resolve(t)},function(){n.reject()}):n.resolve(t),n.promise},n.prototype.AddToCart=function(n){var t=this;this.ShoppingCartUtility.AddToCart(n,this.ShopId,null,null,"瀏覽紀錄").then(function(n){if(n){t.DialogUtility.Toast(n,t.DialogUtility.ToastModeEnum.Warning,750);return}t.DialogUtility.Toast(t.$translate.instant("frontend.typescripts.components.success_add"),t.DialogUtility.ToastModeEnum.Success,750)})},n.prototype.ClearBrowsingHistory=function(){var n=new Date;document.cookie="salePageViewList=;expires="+n.toUTCString()+";path=/"},n.$inject=["$q","$translate","ShopId","PageValue","ShoppingCartUtility","SalePageService","CookieUtility","SalePageServiceImmediate","DialogUtility"],n}();n.BrowsingHistoryUtility=t;angular.module("NineYi.Mall.Directives").service("BrowsingHistoryUtility",t)})(t=n.Directives||(n.Directives={}))})(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){this.$log=n;this.$window=t;this.$timeout=i;this.restrict="AE";this.templateUrl="/V2/TypeScripts/Components/ns-tool-box/toolBoxDirective.html";this.transclude=!0;this.controller="ToolBoxDirectiveController";this.controllerAs="ToolBoxDirectiveCtrl"}return n.factory=function(){var t=function(t,i,r){return new n(t,i,r)};return t.$inject=["$log","$window","$timeout"],t},n}();n.ToolBoxDirective=t;angular.module("NineYi.Mall.Directives").directive("nsToolBox",t.factory())})(t=n.Directives||(n.Directives={}))})(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,l,a,v,y,p,w,b){var k=this;this.$scope=t;this.$element=i;this.$log=r;this.$window=u;this.$timeout=f;this.$sce=e;this.shopId=o;this.officialShopProfile=s;this.couponServiceImmediate=h;this.BrowsingHistoryUtility=c;this.FBMessengerUtility=l;this.LineUtility=a;this.ElementUtility=v;this.AnimeUtility=y;this.ShopInstagramUrl=p;this.$q=w;this.TrackingUtility=b;this.currentPage=1;this.totalPage=0;this.HeaderHeight=0;this.MainVisionPicHeight=0;this.CarouselHeight=0;this.scrollDistance=0;this.singlePageHeight=0;this.ToolBoxMarginTop=50;this.ToolBoxOriginTop=0;this.ToolBoxFixedTop=0;this.ShopId=this.shopId;this.gaReferSrc="garefersrc=BrowseHistory";this.FBMessenger=this.FBMessengerUtility.FBMessenger;this.IsFBMessengerServiceTime=this.FBMessengerUtility.IsFBMessengerServiceTime();this.FanGroupUrl=this.FBMessengerUtility.FanGroupUrlString;this.LineUrl=this.LineUtility.lineUrl;this.officialShopProfile&&this.officialShopProfile.BrowserMode===n.WebStore.Frontend.BE.Device.DeviceModeEnum.Desktop&&this.$timeout(function(){k.DetectScrollHeight();k.InitBrowsingHistoryData()},0);this.checkHasCoupon();this.HasStoreInfo=this.officialShopProfile.StoreTotalCount>0}return t.prototype.checkHasCoupon=function(){var n=this;this.couponServiceImmediate.GetCouponListPromise.then(function(t){n.HasCoupon=t.length>0})},t.prototype.DetectScrollHeight=function(){var n=this;this.MainVisionPicElement=document.getElementById("mainVisionPic");this.CarouselElement=document.getElementsByClassName("indexCarousel")[0];this.CarouselPicElement=this.CarouselElement?this.CarouselElement.querySelector("img"):this.CarouselPicElement;this.ToolBoxElem=this.$element[0].querySelector("#ns-tool-box");this.ToolBoxElem&&(this.HeaderElement=document.getElementById("officialHeader"),this.HeaderHeight=this.HeaderElement?this.HeaderElement.clientHeight:0,this.$q.all([this.GetMainVisionImageHeight(),this.GetCarouselImageHeight()]).then(function(t){var i=0;t.forEach(function(n){i+=n});n.ToolBoxFixedTop=n.HeaderHeight+n.ToolBoxMarginTop;n.ToolBoxOriginTop=i+n.ToolBoxFixedTop;n.ToolBoxElem.style.top=n.ToolBoxOriginTop+"px";n.IsLoaded=!0;n.AdjustToolBoxPosition();n.AddScrollEvent()}))},t.prototype.GetMainVisionImageHeight=function(){var n=this,t=this.$q.defer();return this.MainVisionPicElement&&!this.MainVisionPicElement.complete?this.MainVisionPicElement.onload=function(){n.MainVisionPicHeight=n.MainVisionPicElement.height;t.resolve(n.MainVisionPicHeight)}:(this.MainVisionPicHeight=this.MainVisionPicElement?this.MainVisionPicElement.height:0,t.resolve(this.MainVisionPicHeight)),t.promise},t.prototype.GetCarouselImageHeight=function(){var n=this,t=this.$q.defer();return this.CarouselPicElement&&!this.CarouselPicElement.complete?this.CarouselPicElement.onload=function(){n.hasLoadCarouselPic||(n.CarouselHeight=n.CarouselElement.clientHeight,n.hasLoadCarouselPic=!0,t.resolve(n.CarouselHeight))}:(this.CarouselHeight=this.CarouselPicElement?this.CarouselElement.clientHeight:0,t.resolve(this.CarouselHeight)),t.promise},t.prototype.AddScrollEvent=function(){var n=_.throttle(this.AdjustToolBoxPosition.bind(this),50);window.addEventListener("scroll",n)},t.prototype.AdjustToolBoxPosition=function(){window.pageYOffset<=this.MainVisionPicHeight+this.CarouselHeight?(this.ToolBoxElem.style.top=this.ToolBoxOriginTop+"px",this.ToolBoxElem.style.position="absolute"):(this.ToolBoxElem.style.top=this.ToolBoxFixedTop+"px",this.ToolBoxElem.style.position="fixed")},t.prototype.SwitchFBMessenger=function(){this.showMessenger=!this.showMessenger;this.hasShowMessage||(this.FBMessengerIframeSrc=this.$sce.trustAsResourceUrl(this.FBMessengerUtility.GetFBMessengerSrc()));this.hasShowMessage=!0},t.prototype.ConfirmQuestionService=function(){this.FBMessengerUtility.ConfirmQuestionService()},t.prototype.clearHistory=function(){this.BrowsingHistoryUtility.ClearBrowsingHistory();this.salePageViewList=[]},t.prototype.InitBrowsingHistoryData=function(){var n=this;this.GetSalePageViewList();this.$scope.$on("onRepeatEnd",function(){n.InitBrowsingHistorySetting()})},t.prototype.GetSalePageViewList=function(){var n=this;this.$log.info("Get SalePageViewList - Start");this.BrowsingHistoryUtility.GetSalePageViewList().then(function(t){n.salePageViewList=t;n.$log.info("Get SalePageViewList - Finish")})},t.prototype.InitBrowsingHistorySetting=function(){if(this.browsingMenuFrame=this.$element[0].querySelector(".browsing-menu-frame"),this.browsingMenuUlElement=this.$element[0].querySelector(".browsing-menu-ul"),this.browsingMenuLiElement=this.$element[0].querySelector(".browsing-menu-li"),this.browsingMenuLiElement&&this.browsingMenuUlElement){this.browsingMenuLiHeight=this.ElementUtility.getElementOffset(this.browsingMenuLiElement).height;var n=this.ElementUtility.getElementOffset(this.browsingMenuUlElement).height;this.singlePageHeight=this.browsingMenuLiHeight*3;this.totalPage=Math.ceil(n/this.singlePageHeight);this.AnimeUtility.Translate3d(this.browsingMenuUlElement,this.scrollDistance)}},t.prototype.BrowsingHistoryScrollUp=function(){this.currentPage<=1||(this.scrollDistance=this.scrollDistance+this.singlePageHeight,this.AnimeUtility.Translate3d(this.browsingMenuUlElement,this.scrollDistance),this.currentPage-=1)},t.prototype.BrowsingHistoryScrollDown=function(){this.currentPage>=this.totalPage||(this.scrollDistance=this.scrollDistance-this.singlePageHeight,this.AnimeUtility.Translate3d(this.browsingMenuUlElement,this.scrollDistance),this.currentPage+=1)},t.prototype.SocialShareClick=function(n){this.TrackingUtility.trackSelectContent({contentType:"",name:"",linkUrl:"",id:"",adobeContentInfo:{eventInfo:{socialShareService:n},eventMessage:"socialShareClick",exclude:"GA4"}})},t.$inject=["$scope","$element","$log","$window","$timeout","$sce","ShopId","OfficialShopProfile","CouponServiceImmediate","BrowsingHistoryUtility","FBMessengerUtility","LineUtility","ElementUtility","AnimeUtility","ShopInstagramUrl","$q","TrackingUtility"],t}();t.ToolBoxDirectiveController=i;angular.module("NineYi.Mall.Directives").controller("ToolBoxDirectiveController",i)})(i=t.Directives||(t.Directives={}))})(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){var s=this;this.$log=n;this.$q=t;this.$window=i;this.$timeout=r;this.shopId=u;this.BrowsingHistoryUtility=f;this.FBMessengerUtility=e;this.DefaultCurrencyCode=o;this.restrict="AE";this.templateUrl="/V2/TypeScripts/Components/ns-tool-box/toolBoxFloatingIconDirective.html";this.transclude=!0;this.link=function(n){n.gaReferSrc="garefersrc=BrowseHistory";n.ShopId=s.shopId;n.FBName=s.FBMessengerUtility.FBFanName;n.FBMessenger=s.FBMessengerUtility.FBMessenger;n.IsFBMessengerServiceTime=s.FBMessengerUtility.IsFBMessengerServiceTime();n.SwitchBrowsingHistory=function(){n.IsOpenBrowsingHistory=!n.IsOpenBrowsingHistory;n.hasInitBrowsingHistory||n.GetSalePageViewList()};n.addToCart=function(n,t,i){f.AddToCart(n,t,i)};n.clearHistory=function(){f.ClearBrowsingHistory();n.salePageViewList=[]};n.ConfirmQuestionService=function(){s.FBMessengerUtility.ConfirmQuestionService()};n.GetSalePageViewList=function(){s.$log.info("Get SalePageViewList - Start");n.hasInitBrowsingHistory=!0;f.GetSalePageViewList().then(function(t){n.salePageViewList=t;s.$log.info("Get SalePageViewList - Finish")})}}}return n.factory=function(){var t=function(t,i,r,u,f,e,o,s){return new n(t,i,r,u,f,e,o,s)};return t.$inject=["$log","$q","$window","$timeout","ShopId","BrowsingHistoryUtility","FBMessengerUtility","DefaultCurrencyCode"],t},n}();n.ToolBoxFloatingIconDirective=t;angular.module("NineYi.Mall.Directives").directive("nsToolBoxFloatingIcon",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.scope={ShopCategoryListInfo:"=nsShopCategoryListInfo",FreeGiftList:"=nsFreeGiftList"};this.restrict="EA";this.templateUrl="/V2/TypeScripts/Components/ns-header-category-menu/headerCategoryMenuDirective.html";this.controller="HeaderCategoryMenuDirectiveController";this.controllerAs="HeaderCategoryMenuDirectiveCtrl"}return n.factory=function(){return function(){return new n}},n}();n.HeaderCategoryMenuDirective=t;angular.module("NineYi.Mall.Directives").directive("nsHeaderCategoryMenu",t.factory())})(t=n.Directives||(n.Directives={}))})(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){var o=this,e;this.$scope=n;this.$element=t;this.$log=i;this.officialOriginDomain=r;this.googleAnalyticsUtility=u;this.$timeout=f;this.IsOpenCategoryLevel2=!1;this.PerGroupLength=14;this.GroupCountLimit=4;this.$MenuElem=t[0];e=this.$scope.$watchGroup(["ShopCategoryListInfo","FreeGiftList"],function(n,t){typeof n!="undefined"&&n!==t&&(o.InitialCategoryMenuSetting(),e())})}return n.prototype.OpenLevel1Category=function(n,t,i){var u=n.ChildList,f,r;n.ChildListCount>0&&u.length>0?(this.IsOpenCategoryLevel2=!0,this.SelectedCategoryListLevel1=n,this.SelectedGroupNumber=i,this.SelectedGroupedCategoryListLevel1=t,f=this.PerGroupLength-1,this.GroupedCategoryListLevel2=this.GetSplitedCategoryGroup(f,u),r=this.GroupedCategoryListLevel2.length+1,this.SelectedGroupNumber<r&&(this.ListWidth=this.GetMenuWidth(r)),this.IsEnableLevel2Slide=r-1>this.GroupCountLimit-1):window.location.href=this.GetCategoryLink(n.Id);this.googleAnalyticsUtility.TrackEvent("全站_Header","商品分類","Menu_Click")},n.prototype.OnEnterMenu=function(){this.$timeout.cancel(this.DelayTimer);this.$MenuElem.classList.add("show-menu")},n.prototype.OnLeaveMenu=function(){var n=this;this.DelayTimer=this.$timeout(function(){n.$MenuElem.classList.remove("show-menu")},500)},n.prototype.OpenLevel2Category=function(n){window.location.href=this.GetCategoryLink(n.Id);this.googleAnalyticsUtility.TrackEvent("全站_Header","商品分類","Menu_Click")},n.prototype.CloseLevel2Category=function(){this.IsOpenCategoryLevel2=!1;this.SelectedGroupNumber=0;this.ListWidth=this.Level1ListWidth;this.googleAnalyticsUtility.TrackEvent("全站_Header","商品分類","Back")},n.prototype.HasFreeGift=function(n){return this.$scope.FreeGiftList.indexOf(n.Id)>=0},n.prototype.GetCategoryLink=function(n){return this.officialOriginDomain+"/v2/official/SalePageCategory/"+n},n.prototype.InitialCategoryMenuSetting=function(){var n=this.$scope.ShopCategoryListInfo,t=n.Count,u=n.MaxChildListCount,i=this.PerGroupLength,r=Math.ceil(t/i);this.Level1ListWidth=this.ListWidth=this.GetMenuWidth(r);this.ListHeight=this.GetMenuHeight(t,u);this.IsEnableLevel1Slide=r>this.GroupCountLimit;this.GroupedCategoryListLevel1=this.GetSplitedCategoryGroup(i,n.List)},n.prototype.GetMenuHeight=function(n,t){var i=n>t?n:t,r=i>this.PerGroupLength?this.PerGroupLength:i+1;return r*30+30+"px"},n.prototype.GetMenuWidth=function(n){var t=n>this.GroupCountLimit?this.GroupCountLimit:n;return t*300+"px"},n.prototype.GetSplitedCategoryGroup=function(n,t){var r=[],i;if(typeof t!="undefined")for(i=0;i<=t.length-1;i+=n)r.push(t.slice(i,i+n));return r},n.$inject=["$scope","$element","$log","OfficialOriginDomain","GoogleAnalyticsUtility","$timeout"],n}();n.HeaderCategoryMenuDirectiveController=t;angular.module("NineYi.Mall.Directives").controller("HeaderCategoryMenuDirectiveController",t)})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.scope={ShopCategoryListInfo:"=nsShopCategoryListInfo"};this.restrict="EA";this.templateUrl="/V2/TypeScripts/Components/ns-multi-shop-category/headerCategoryMenuDirective.html";this.controller="MultiShopCategoryDirectiveController";this.controllerAs="MultiShopCategoryDirectiveCtrl"}return n.factory=function(){return function(){return new n}},n}();n.nsMultiShopCategory=t;angular.module("NineYi.Mall.Directives").directive("nsMultiShopCategory",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},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,s;this.$scope=n;this.$element=t;this.$log=i;this.officialOriginDomain=r;this.googleAnalyticsUtility=u;this.$timeout=f;this.$translate=e;this.SelectedGroupNumber=[];this.level2Title="";this.level2SliderId="";this.sliderListShow=!1;this.eachLengthForLevel3=12;this.expandFirstShopCategoryList=function(n){var t=[];t=n[0].filter(function(n){return!n.IsSystemCategory});t&&t.length>0&&o.OpenNextCategory(t[0])};s=this.$scope.$watchGroup(["ShopCategoryListInfo"],function(n,t){typeof n!="undefined"&&n!==t&&(o.InitialCategoryMenuSetting(),s())})}return n.prototype.OpenNextCategory=function(n){var u=n.ChildList,i=n.Level,r=u,t=this.GroupedCategoryListData,f;i===1?(t=t.slice(0,i),t[i]=r.length>0?r:[__assign({},n,{Level:2,Name:""+this.$translate.instant("frontend.typescripts.components.go_to_target_text",{targetText:n.Name})})],this.SelectedGroupNumber=[],this.SelectedGroupNumber[0]=n.Id,this.level2Title="",this.level2SliderId="",this.sliderListShow=!1):i===2&&(t=t.slice(0,i),f=this.GetSplitCategoryGroup(this.eachLengthForLevel3,r),t.push.apply(t,f),this.SelectedGroupNumber[1]=n.Id,u.length>0?(this.level2Title=n.Name,this.level2SliderId=n.Name+"_"+n.Id,this.sliderListShow=!0):(this.level2Title="",this.level2SliderId="",this.sliderListShow=!1));this.GroupedCategoryListData=t;i===1&&r.length>0&&this.OpenNextCategory(r[0])},n.prototype.OpenCategoryLink=function(n){this.googleAnalyticsUtility.TrackEvent("全站_Header","商品分類","Menu_Click");window.location.href=this.GetCategoryLink(n.Id)},n.prototype.onLeaveMenu=function(){this.resetMenuToFirstData()},n.prototype.resetMenuToFirstData=function(){var n=this.GroupedCategoryListData||[[]];n=n.slice(0,1);this.expandFirstShopCategoryList(n)},n.prototype.GetCategoryLink=function(n){return this.officialOriginDomain+"/v2/official/SalePageCategory/"+n},n.prototype.InitialCategoryMenuSetting=function(){var t=this.$scope.ShopCategoryListInfo,n=[t.List||[]];this.GroupedCategoryListData=n;this.expandFirstShopCategoryList(n)},n.prototype.GetSplitCategoryGroup=function(n,t){var r=[],i;if(typeof t!="undefined")for(i=0;i<=t.length-1;i+=n)r.push(t.slice(i,i+n));return r},n.prototype.isItemActive=function(n,t){var i=this.SelectedGroupNumber.indexOf(n.Id);return i>-1&&i===t-1},n.$inject=["$scope","$element","$log","OfficialOriginDomain","GoogleAnalyticsUtility","$timeout","$translate"],n}();n.MultiShopCategoryDirectiveController=t;angular.module("NineYi.Mall.Directives").controller("MultiShopCategoryDirectiveController",t)})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.scope={CustomLinkInfo:"=nsCustomLinkInfo"};this.restrict="EA";this.templateUrl="/V2/TypeScripts/Components/ns-header-multi-level-menu/headerMultiLevelMenuDirective.html";this.controller="HeaderMultiLevelMenuDirectiveController";this.controllerAs="HeaderMultiLevelMenuDirectiveCtrl"}return n.factory=function(){return function(){return new n}},n}();n.HeaderMultiLevelMenuDirective=t;angular.module("NineYi.Mall.Directives").directive("nsHeaderMultiLevelMenu",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i,r,u){var e=this,f;this.$scope=n;this.$element=t;this.$log=i;this.$timeout=r;this.$window=u;this.WINDOW_MARGIN_WIDTH=16;this.LINK_ROW_LIMIT=15;this.LEVEL_ONE_COLUMN_NUMBER_LIMIT=3;this.LEVEL_TWO_COLUMN_NUMBER_LIMIT=2;this.MENU_COLUMN_WIDTH=340;this.level1ChunkLinkList=[];this.level2ChunkLinkList=[];this.isShowLevel1Slider=!1;this.isShowLevel2Slider=!1;this.isOpenLevel2Menu=!1;this.leftShiftString="0px";this.menuWidth=0;this.menuWidthString="0px";this.$MenuElem=t[0];f=this.$scope.$watch("CustomLinkInfo",function(n){typeof n!="undefined"&&(e.InitialMultiLevelMenuSetting(),f())})}return n.prototype.InitialMultiLevelMenuSetting=function(){this.customLinkInfo=this.$scope.CustomLinkInfo;this.InitLevel1LinkList()},n.prototype.InitLevel1LinkList=function(){this.level1ChunkLinkList=this.GetChunkLevel1LinkList(this.customLinkInfo.childList);this.level1ColumnNumber=this.level1ChunkLinkList.length;this.isShowLevel1Slider=this.level1ColumnNumber>this.LEVEL_ONE_COLUMN_NUMBER_LIMIT;this.UpdateMenuStyle()},n.prototype.OnClickLevel1Link=function(n,t){if(n.hasChild){this.isOpenLevel2Menu=!0;this.currentLevel1LinkItem=n;this.currentLevel1ItemKey=n.itemKey;this.currentLevel1LinkChunkIndex=t;this.currentLevel1LinkChunk=this.level1ChunkLinkList[t];var i=_.find(this.customLinkInfo.additionalChildList,function(t){return t.parentItemKey===n.itemKey});this.level2ChunkLinkList=this.GetChunkLevel2LinkList(i.itemList);this.level2ColumnNumber=this.level2ChunkLinkList.length;this.isShowLevel2Slider=this.level2ColumnNumber>this.LEVEL_TWO_COLUMN_NUMBER_LIMIT;this.UpdateMenuStyle(!0)}else!n.linkUrl||(window.location.href=n.linkUrl)},n.prototype.OnClickLevel2Link=function(n){!n.linkUrl||(window.location.href=n.linkUrl)},n.prototype.CloseLevel2Menu=function(){this.isOpenLevel2Menu=!1;this.UpdateMenuStyle()},n.prototype.GetChunk=function(n,t){return n.reduce(function(n,i,r){if(r%t!=0){var u=n.slice();return u[u.length-1].push(i),u}return n.concat([[i]])},[])},n.prototype.CheckHasChild=function(n){var t=this;return Array.isArray(n)&&!!n.length?n.map(function(n){return __assign({},n,{hasChild:!!_.find(t.customLinkInfo.additionalChildList,function(t){return t.parentItemKey===n.itemKey})})}):[]},n.prototype.GetChunkLevel1LinkList=function(n){return this.GetChunk(this.CheckHasChild(n),this.LINK_ROW_LIMIT)},n.prototype.GetChunkLevel2LinkList=function(n){return this.GetChunk(n,this.LINK_ROW_LIMIT)},n.prototype.UpdateMenuStyle=function(n){n===void 0&&(n=!1);this.SetMenuWidth(n);this.SetMenuPosition()},n.prototype.SetMenuWidth=function(n){var t;t=n?(this.isShowLevel2Slider?this.LEVEL_TWO_COLUMN_NUMBER_LIMIT:this.level2ColumnNumber)+1:this.isShowLevel1Slider?this.LEVEL_ONE_COLUMN_NUMBER_LIMIT:this.level1ColumnNumber;this.menuWidth=t*this.MENU_COLUMN_WIDTH;this.menuWidthString=this.menuWidth+"px"},n.prototype.SetMenuPosition=function(){var t=this.$MenuElem.parentElement.parentElement.getBoundingClientRect().left,i=t+this.menuWidth,n=i-(this.$window.innerWidth-this.WINDOW_MARGIN_WIDTH),r=n>0;this.leftShiftString=r?"-"+n+"px":"0px"},n.$inject=["$scope","$element","$log","$timeout","$window",],n}();n.HeaderMultiLevelMenuDirectiveController=t;angular.module("NineYi.Mall.Directives").controller("HeaderMultiLevelMenuDirectiveController",t)})(t=n.Directives||(n.Directives={}))})(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){var r=this;this.$log=n;this.$window=t;this.AppDownloadUrlUtility=i;this.scope={shopId:"@nsShopId",salePageId:"@?nsSalePageId",desc:"@nsDesc",downloadLinkHtml:"@nsDownloadLinkHtml"};this.restrict="EA";this.templateUrl="/V2/Typescripts/Components/ns-app-only/appOnlyPromotionDirective.html";this.link=function(n){n.clickDownloadApp=function(t,i,u){u.preventDefault();u.stopPropagation();r.$window.location.href=r.AppDownloadUrlUtility.GetAppDownloadUrl(+n.shopId,+n.salePageId)}}}return n.factory=function(){var t=function(t,i,r){return new n(t,i,r)};return t.$inject=["$log","$window","AppDownloadUrlUtility"],t},n}();n.AppOnlyPromotionDirective=t;angular.module("NineYi.Mall.Directives").directive("nsAppOnlyPromotion",t.factory())})(t=n.Directives||(n.Directives={}))})(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){var u=this;this.$log=n;this.$timeout=t;this.$sce=i;this.$filter=r;this.restrict="EA";this.replace=!0;this.scope={EndDate:"=nsClockTimeEndDate",ClockTimeClass:"=?nsClockTimeClass",ClockTimeIsClosed:"&nsClockTimeIsClosed"};this.template="<span>{{ShowTime}}<\/span>";this.link=function(n){var t,r;n.isFirstTime=!0;n.IsHide=!1;t=function(){requestAnimationFrame(function(){u.$timeout(function(){var r=u.DiffCount(n.EndDate);r>0?(n.ShowTime=i.trustAsHtml(u.timeToHHMMSS(r)),t()):angular.isFunction(n.ClockTimeIsClosed)&&n.ClockTimeIsClosed({EndDate:n.EndDate})},n.isFirstTime?0:1e3)})};n.EndDate&&n.EndDate!==""||(n.IsHide=!0);r=u.DiffCount(n.EndDate);r>0?(t(),n.IsHide=!1,n.isFirstTime=!1):(n.ShowTime=u.$filter("date")(n.EndDate),n.IsHide=!0)}}return n.factory=function(){var t=function(t,i,r,u){return new n(t,i,r,u)};return t.$inject=["$log","$timeout","$sce","$filter"],t},n.prototype.DiffCount=function(n){try{if(isNaN(new Date(n).getTime()))return-1;var t=new Date(n).getTime()-(new Date).getTime();return t<0?-1:t}catch(i){return this.$log.log("傳入參數EndDate無法轉為Date:"+n),-1}},n.prototype.timeToHHMMSS=function(n){var r=Math.floor(n/1e3),t=Math.floor(r/3600),i=Math.floor((r-t*3600)/60),u=r-t*3600-i*60;return(t>9?t:"0"+t)+":"+(i>9?i:"0"+i)+":"+(u>9?u:"0"+u)},n}();n.ClockTimeDirective=t;angular.module("NineYi.Mall.Directives").directive("nsClockTime",t.factory())})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(n){var t;(function(){angular.module("NineYi.Mall.Directives").directive("nsPreferredCurrencyReminder",["DefaultCurrencyCode","CurrencyCode",function(n,t){return{restrict:"E",templateUrl:"/V2/TypeScripts/Components/ns-preferred-currency-reminder/preferredCurrencyReminder.html",link:function(i){i.defaultCurrencyCode=n;i.currencyCode=t}}}])})(t=n.Directives||(n.Directives={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n){this.model=n;this.model.StartDateTime=this.model.StartDateTime?new Date(parseInt(this.model.StartDateTime.replace("/Date(","").replace(")/",""),10)):null;this.model.EndDateTime=this.model.EndDateTime?new Date(parseInt(this.model.EndDateTime.replace("/Date(","").replace(")/",""),10)):null}return t.prototype.getTypeDef=function(){return this.model.TypeDef?n.Mall.Mixin.PromotionConditionTypeDisplayEnum(this.model.TypeDef):null},t.prototype.getCRMMemberTierName=function(){var n="";return this.isCRMMemberTier()&&(n=this.model.PromotionTargetMemberTierList[0].CrmShopMemberCardName),n},t.prototype.isProcessing=function(){var n=new Date;return this.model.StartDateTime&&this.model.EndDateTime?this.model.StartDateTime<=n&&this.model.EndDateTime>=n:!1},t.prototype.isNewest=function(){var n=new Date;return this.model.StartDateTime&&this.model.StartDateTime<=n?Date.now()-this.model.StartDateTime.getTime()<=864e5:!1},t.prototype.isComingToEnd=function(){var n=new Date;return this.model.EndDateTime&&this.model.EndDateTime>=n?this.model.EndDateTime.getTime()-Date.now()<=864e5:!1},t.prototype.isCRMMemberTier=function(){var n=!1;return this.model.PromotionTargetMemberTierList.length>0&&(n=!0),n},t.prototype.getPromotionTopLabel=function(){return this.model.PromotionTopLabel},t.prototype.getPromotionLabelList=function(){return this.model.PromotionLabelList},t.prototype.isPromotionEngine=function(){return this.model.IsPromotionEngine},t.prototype.isAppOnlyPromotion=function(){return this.model.IsAPPOnlyPromotion},t}();t.PromotionListClass=i})(i=t.BL||(t.BL={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){function i(t){var i={TotalPrice:n.WebStore.Frontend.BE.Promotion.PromotionConditionTypeV2Enum.TotalPrice,TotalQty:n.WebStore.Frontend.BE.Promotion.PromotionConditionTypeV2Enum.TotalQty,ReachQty:n.WebStore.Frontend.BE.Promotion.PromotionConditionTypeV2Enum.ReachQty,TotalPriceV2:n.WebStore.Frontend.BE.Promotion.PromotionConditionTypeV2Enum.TotalPriceV2,TotalQtyV2:n.WebStore.Frontend.BE.Promotion.PromotionConditionTypeV2Enum.TotalQtyV2,CrmMemberTierTotalPrice:n.WebStore.Frontend.BE.Promotion.PromotionConditionTypeV2Enum.CrmMemberTierTotalPrice};return t?i[t]:t}t.PromotionConditionTypeDisplayEnum=i})(i=t.Mixin||(t.Mixin={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={})),function(n){var t;(function(t){var i;(function(t){var r,i;(function(n){n[n.Normal=0]="Normal";n[n.IsClosed=1]="IsClosed";n[n.UnListing=2]="UnListing";n[n.NoStart=3]="NoStart";n[n.SoldOut=4]="SoldOut";n[n.Locked=5]="Locked"})(r=t.SalePageStatusEnum||(t.SalePageStatusEnum={}));i=function(){function t(t,i,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){var st=this;this.$rootScope=t;this.$scope=i;this.$location=u;this.$window=f;this.$log=e;this.$q=o;this.$timeout=s;this.$uibModalInstance=h;this.$translate=c;this._=l;this.SalePageService=a;this.ShoppingCartV4Service=v;this.ProductStockService=y;this.addToCartConfig=p;this.Facebook=w;this.GoogleAnalyticsEcommerceUtility=b;this.GoogleTagManagerDataLayerUtility=k;this.FacebookUtility=d;this.AdobeAnalyticsUtility=g;this.GoogleAnalyticsUtility=nt;this.lineAdUtility=tt;this.PageValue=it;this.DeviceValue=rt;this.DefaultCurrencyCode=ut;this.DialogUtility=ft;this.backInStockUtility=et;this.trackingUtility=ot;this.IsWaiting=!1;this.SalePageStatusEnum=r;this.SoldOutTypeEnum=n.WebStore.Frontend.BE.ShopDefault.ShopDefaultSoldOutActionTypeEnum;this.SubscribedSkuIdList=[];this.SelectedSKUProperty=[];this.SKULevel=0;this.SKUTitle="";this.IsInitialed=!1;this.HideBuyButton=!1;this.addToCartResultMessage=this.addToCartConfig.message||"";this.addToCartResult=this.addToCartConfig.isOK;this.CurrentImgSrc="";this.IsMobile=this.DeviceValue.IsMobile();this.SelectedSalePageSkuQtyList=this.addToCartConfig.selectedSalePageSkuQtyList;this.Qty=1;var ht=this.addToCartConfig.salePageId||0,ct=this.addToCartConfig.shopId||0,lt=this.addToCartConfig.autoClose||0;this.chooseItemStageIndex=this.addToCartConfig.chooseSkuItem?this.addToCartConfig.chooseSkuItem.level:null;this.chooseItemProperty=this.addToCartConfig.chooseSkuItem?this.addToCartConfig.chooseSkuItem.itemProperty:null;this.soldOutProperty=this.addToCartConfig.chooseSkuItem?this.addToCartConfig.chooseSkuItem.soldOutProperty:null;this.$log.info("Show add to shoppingCart dialog for salePage ",ht);lt!==0&&this.$timeout(function(){st.$uibModalInstance.close("ok")},lt);this.EnablePurchaseMethod=Boolean(this.$window.location.pathname.match(/Promotion\/Detail|v2\/Search|V2\/Activity/gi));this.PointPayOptionList=[];this.IsPointPayOption=!1;this.SelectedPointPayOptionIndex=0;this.SelectedPointPayOptionItem={};ht!==0&&ct!==0&&(this.$log.info("Get SalePage",ht,"- Start"),o.all([this.SalePageService.GetSalePage(ht),this.SalePageService.GetSalePageStatus(ht)]).then(function(n){st.SalePage=n[0].data;st.SalePage.StatusDef=n[1];(st.SalePage.IsAPPOnly||st.SalePage.IsShareToBuy)&&(st.HideBuyButton=!0,st.SalePage.IsAPPOnly&&st.SalePage.IsShareToBuy&&(st.SalePage.IsShareToBuy=!1));st.IsEnableBackInStockAlert=st.SalePage.SoldOutActionType===st.SoldOutTypeEnum[st.SoldOutTypeEnum.BackInStockAlert];st.IsEnableBackInStockAlert&&st.GetBackInStockSubscribedSkuList(ht);st.Initialize()}).catch(function(){st.$log.info("GetSalePage Failure")}),this.EnablePurchaseMethod&&this.SalePageService.GetSalePageV2(ct,ht).then(function(n){st.PointPayOptionList=n&&n.PointsPayPairsList;st.IsPointPayOption=n&&n.PointsPayPairsList.length>0;st.SelectedPointPayOptionItem=n&&n.PointsPayPairsList[st.SelectedPointPayOptionIndex]}).catch(function(){st.$log.info("GetSalePageV2 Failure")}))}return t.prototype.Initialize=function(){var n=this;if(this.SalePageStatusIsSoldOut()&&!this.IsEnableBackInStockAlert&&this.SalePage.MajorList[0].SKUList[0].PropertyList.length===0){this.CurrentImgSrc=this.SalePage.ImageList[0].PicUrl;this.IsInitialed=!0;return}this.SKULevel=this.SalePage.MajorList[0].SKUList.length===1?this.SalePage.MajorList[0].SKUList[0].Title==="-1"?0:1:2;this.$log.debug("SKU Level",this.SKULevel);this.SelectedSKUProperty[0]=this.SalePage.MajorList[0].SKUList[0].PropertyList[0];this.SKULevel===2&&this.chooseItemStageIndex===0&&this.chooseItemProperty&&(this.SelectedSKUProperty[0]=this.chooseItemProperty);this.SKUDictionaryById=this._.indexBy(this.SalePage.SKUPropertySetList,"SaleProductSKUId");this.SKUDictionaryByPropertyName=this._.indexBy(this.SalePage.SKUPropertySetList,"PropertyNameSet");this.UpdateSKUQty().then(function(){n.IsInitialed=!0;n.SKULevel==1&&(n.chooseItemProperty?n.chooseSelectedItem(n.chooseItemStageIndex):n.PickupDefaultSkuForLevel1());n.SKULevel===2&&(n.chooseItemProperty?n.chooseSelectedItem(n.chooseItemStageIndex):n.PickupDefaultSkuForLevel2());n.CurrentImgSrc=n.GetCurrentImgSrc(n.SelectedSKUProperty);setTimeout(function(){n.scrollToItemPosition()},0)});this.SKULevel===0&&(this.SelectedSKUPropertySet=this.SalePage.SKUPropertySetList[0]);this.SKULevel===1&&this.$scope.$watch(function(){return n.SelectedSKUProperty[0]},function(t,i){if(t!==i){n.$log.debug("SKU Level 1",t);n.SKUTitle=t.Name;var r=t.PropertyNameSet;n.SelectedSKUPropertySet=n.SKUDictionaryByPropertyName[r]}});this.SKULevel===2&&(this.$scope.$watch(function(){return n.SelectedSKUProperty[0]},function(t,i){t!==i&&(n.$log.debug("SKU Level 1",t),n.UpdateSKUQty().then(function(){n.PickupDefaultSkuForLevel2()}))}),this.$scope.$watch(function(){return n.SelectedSKUProperty},function(t,i){if(t!==i&&t.length>1){n.$log.debug("SKU change",t);n.SKUTitle=t[0].Name+"/"+t[1].Name;var r=t[0].PropertyNameSet+";"+t[1].PropertyNameSet;n.SelectedSKUPropertySet=n.SKUDictionaryByPropertyName[r]}},!0))},t.prototype.SelectSKUProperty=function(n,t,i){var u,r;(!this.IsSKUSoldout(n,t)||this.IsEnableBackInStockAlert)&&(this.SelectedSKUProperty[n]=t,u=this.SelectedSKUProperty[0].PropertyNameSet,n===1&&(u+=";"+this.SelectedSKUProperty[n].PropertyNameSet),r=this.SKUDictionaryByPropertyName[u],this.Qty=r?this.GetQtyBySKU(this.addToCartConfig.salePageId,r.SaleProductSKUId):1,r&&this.trackingUtility.trackSelectContent({adobeContentInfo:{eventInfo:{skuTitle:i,skuValue:t.Name,sku:r.SaleProductSKUId.toString()},eventMessage:"selectCustomSkuProperty",exclude:"GA4"},contentType:"",id:"",linkUrl:"",name:""}));n===0&&(this.CurrentImgSrc=this.GetCurrentImgSrc(this.SelectedSKUProperty))},t.prototype.IsSelectedSKUSoldOut=function(){return this.SalePageStatusIsSoldOut()||this.SalePageStatusIsNormal()&&this.SelectedSKUPropertySet&&this.SelectedSKUPropertySet.SellingQty<=0},t.prototype.IsSkuSubscribedBackInStock=function(){if(!this.SelectedSKUPropertySet)return!1;var n=this.SelectedSKUPropertySet.SaleProductSKUId;return this.SubscribedSkuIdList.indexOf(n)>=0},t.prototype.IsSKUSelected=function(n,t){var i=this.SelectedSKUProperty[n];return i?this.SelectedSKUProperty[n].PropertyNameSet===t.PropertyNameSet:!1},t.prototype.IsSKUSoldout=function(n,t){var i,r;if(this.SKULevel===1&&(i=t.PropertyNameSet),this.SKULevel===2){if(n!==this.SKULevel-1)return r=!1,this.soldOutProperty&&angular.forEach(this.soldOutProperty,function(n){t.PropertyNameSet===n&&(r=!0)}),r;i=this.SelectedSKUProperty[0].PropertyNameSet+";"+t.PropertyNameSet}return!this.SKUDictionaryByPropertyName||!this.SKUDictionaryByPropertyName[i]||!this.SKUDictionaryByPropertyName[i].hasOwnProperty("SellingQty")?!0:this.SKUDictionaryByPropertyName[i].SellingQty<=0},t.prototype.IsSKUHidden=function(n,t){var i;if(this.SKULevel===1&&(i=t.PropertyNameSet),this.SKULevel===2){if(n!==this.SKULevel-1)return!1;i=this.SelectedSKUProperty[0].PropertyNameSet+";"+t.PropertyNameSet}return!this.SKUDictionaryByPropertyName||!this.SKUDictionaryByPropertyName[i]||!this.SKUDictionaryByPropertyName[i].hasOwnProperty("SellingQty")?!0:!this.SKUDictionaryByPropertyName[i].IsShow},t.prototype.UpdateSKUQty=function(){var n=this,i=this.$q.defer(),t=[];return t=this.SKULevel<2?this.SalePage.SaleProductSKUIdList:this._.pluck(this._.filter(this.SalePage.SKUPropertySetList,function(t){return t.PropertyNameSet.indexOf(n.SelectedSKUProperty[0].PropertyNameSet)===0}),"SaleProductSKUId"),this.$log.info("Get SellingQtyList - Start",t),this.ProductStockService.GetSellingQtyListNew(t).then(function(r){n._.each(r.data,function(t){n.SKUDictionaryById[t.SaleProductSKUId].SellingQty=t.SellingQty;i.resolve()});n.$log.info("Get SellingQtyList - End",t)},i.reject),i.promise},t.prototype.Confirm=function(t){var i=this,r=this.addToCartConfig.salePageId,u=this.addToCartConfig.shopId,e=this.addToCartConfig.isSkuQtyAccumulate,f;if(this.IsWaiting=!0,!this.SelectedSKUPropertySet)return this.$log.info("SKU not select!"),this.IsWaiting=!1,!1;if(f=this.SKUDictionaryById[this.SelectedSKUPropertySet.SaleProductSKUId].SellingQty,f<=0)return this.$log.info("SKU no selling qty!"),this.IsWaiting=!1,!1;if(this.Qty<1)return this.$log.info("SKU no qty!"),this.IsWaiting=!1,!1;this.$log.info("Add ShoppingCart Item - Start",u,r,this.SelectedSKUPropertySet.SaleProductSKUId,this.Qty);this.ShoppingCartV4Service.InsertItem(u,r,this.SelectedSKUPropertySet.SaleProductSKUId,this.Qty,this.IsPointPayOption&&this.SelectedPointPayOptionItem.PairsPoints>0?"PointsPay":"",this.IsPointPayOption&&this.SelectedPointPayOptionItem.PairsPoints>0?this.SelectedPointPayOptionItem.PointsPayId:0,e,null).then(function(f){i.IsWaiting=!1;i.$log.info("Add ShoppingCart Item - Finish",u,r,i.SelectedSKUPropertySet.SaleProductSKUId,i.Qty,f);i.$rootScope.$emit("RefreshShoppingCartCount");i.$uibModalInstance.close();var o={id:i.SalePage.Id.toString(),name:"("+i.SalePage.Id+")"+i.SalePage.Title,price:i.SalePage.Price,position:i.addToCartConfig.position},e=i.PageValue.CurrentPage!==n.Mall.Models.PageNameEnum.SalePageIndex;i.trackingUtility.trackAddToCart({id:r,name:i.SalePage.Title,skuId:i.SelectedSKUPropertySet.SaleProductSKUId,skuName:i.SelectedSKUPropertySet.PropertyNameSet,price:i.SalePage.Price,quantity:i.Qty,suggestPrice:i.SalePage.SuggestPrice,categoryId:i.SalePage.ShopCategoryId,categoryName:i.SalePage.CategoryText},i.addToCartConfig.listName,e);i.GoogleAnalyticsUtility.TrackEvent(i.PageValue.CurrentPageName,"加入購物車",r.toString());!t||i.$window.setTimeout(function(){if(i.$window.location.protocol==="http:"){var t=i.$window.location.origin+"/V2/ShoppingCart/Preview",n="/Login/HttpLoginRelayToHttps/?rt="+encodeURIComponent(t);n+="&reason=addToCart_success";i.$window.location.href=n}else i.$window.location.href="/V2/ShoppingCart"},1500)},function(n){if(i.IsWaiting=!1,i.$uibModalInstance.close(n),!!t)if(i.$window.location.protocol=="http:"){var u=i.$window.location.origin+"/V2/ShoppingCart/Preview",r="/Login/HttpLoginRelayToHttps/?rt="+encodeURIComponent(u);r+="&reason=addToCart_success";i.$window.location.href=r}else i.$window.location.href="/V2/ShoppingCart"})},t.prototype.Cancel=function(){this.$uibModalInstance.dismiss("Cancel")},t.prototype.FacebookShare=function(n){var t=this,i=this.$location.protocol()+"://"+this.$location.host()+"/SalePage/Index/"+n;this.$log.debug("Share url:",i);this.IsWaiting=!0;this.Facebook.ui({method:"feed",link:i,display:"popup"},function(n){t.IsWaiting=!1;n&&(t.SalePage.IsShareToBuy=!1,t.HideBuyButton=!1)})},t.prototype.AppOnly=function(n,t){window.location.href=this.DeviceValue.IsMobile()?"/ref/"+t+"/SalePage/"+n:"/SalePage/ShowQRCode/"+n},t.prototype.PickupDefaultSkuForLevel1=function(){var n=this,t;this.SelectedSKUPropertySet=null;t=!1;angular.forEach(this.SalePage.MajorList[0].SKUList[0].PropertyList,function(i,r){var u=i.PropertyNameSet,f=n.SKUDictionaryByPropertyName[u].SellingQty;r===0&&n.IsEnableBackInStockAlert&&(n.SelectedSKUProperty[0]=i,n.SelectedSKUPropertySet=n.SKUDictionaryByPropertyName[u]);f>0&&!t&&(n.SelectedSKUProperty[0]=i,n.SelectedSKUPropertySet=n.SKUDictionaryByPropertyName[u],t=!0)});this.Qty=t?this.GetQtyBySKU(this.addToCartConfig.salePageId,this.SelectedSKUPropertySet.SaleProductSKUId):0},t.prototype.PickupDefaultSkuForLevel2=function(){var n=this,t;this.SelectedSKUPropertySet=null;t=!1;angular.forEach(this.SalePage.MajorList[0].SKUList[1].PropertyList,function(i,r){var u=n.SelectedSKUProperty[0].PropertyNameSet+";"+i.PropertyNameSet,f=n.SKUDictionaryByPropertyName[u]?n.SKUDictionaryByPropertyName[u].SellingQty:0;r===0&&n.IsEnableBackInStockAlert&&(n.SelectedSKUProperty[1]=i,n.SelectedSKUPropertySet=n.SKUDictionaryByPropertyName[u]);f>0&&!t&&(n.SelectedSKUProperty[1]=i,n.SelectedSKUPropertySet=n.SKUDictionaryByPropertyName[u],t=!0)});this.Qty=t?this.GetQtyBySKU(this.addToCartConfig.salePageId,this.SelectedSKUPropertySet.SaleProductSKUId):0},t.prototype.chooseSelectedItem=function(n){var r=this,t=!1,f,i,e,o,s,u,h;n===0?(this.SKULevel===1?f=i=this.chooseItemProperty.PropertyNameSet:this.SKULevel===2&&(f=this.chooseItemProperty.PropertyNameSet,e=!1,angular.forEach(this.SalePage.SKUPropertySetList,function(n,t){!e&&n.IsShow&&(i=r.chooseItemProperty.PropertyNameSet+";"+r.SalePage.SKUPropertySetList[t].PropertyNameSet.split(";")[1],e=!0)})),o=this.SKUDictionaryByPropertyName[i].SellingQty,o>0&&!t&&(this.SelectedSKUProperty[0]=this.chooseItemProperty,this.SKULevel===1?this.SelectedSKUPropertySet=this.SKUDictionaryByPropertyName[f]:this.SKULevel===2&&(angular.forEach(this.SalePage.MajorList[0].SKUList[1].PropertyList,function(n,t){n.PropertyNameSet===i.split(";")[1]&&(s=r.SelectedSKUProperty[1]=r.SalePage.MajorList[0].SKUList[1].PropertyList[t])}),this.SelectedSKUProperty[1]=s,this.SelectedSKUPropertySet=this.SKUDictionaryByPropertyName[i]),t=!0)):(u=this.SelectedSKUProperty[0].PropertyNameSet+";"+this.chooseItemProperty.PropertyNameSet,h=this.SKUDictionaryByPropertyName[u]?this.SKUDictionaryByPropertyName[u].SellingQty:0,h>0&&!t&&(this.SelectedSKUProperty[1]=this.chooseItemProperty,this.SelectedSKUPropertySet=this.SKUDictionaryByPropertyName[u],t=!0));this.Qty=t?this.GetQtyBySKU(this.addToCartConfig.salePageId,this.SelectedSKUPropertySet.SaleProductSKUId):0},t.prototype.scrollToItemPosition=function(){var n=document.querySelector(".current"),t=document.querySelector(".scroll-area");n&&n.offsetTop+n.offsetHeight>=t.offsetHeight&&(t.scrollTop=n.offsetTop-n.offsetHeight)},t.prototype.AddQty=function(){(this.trackingUtility.trackIncreaseQuantity({id:""+this.SalePage.Id,name:this.SalePage.Title,price:this.SalePage.Price,quantity:this.Qty,suggestPrice:this.SalePage.SuggestPrice,skuId:""+(this.SelectedSKUPropertySet&&this.SelectedSKUPropertySet.SaleProductSKUId)||""}),this.SelectedSKUPropertySet)&&(this.Qty<this.SelectedSKUPropertySet.SellingQty?(this.Qty+=1,this.$rootScope.$emit("onSkuQtyChanged",{SellingQty:this.SelectedSKUPropertySet.SellingQty})):(this.$rootScope.$emit("onSkuQtyStockOver",{SellingQty:this.SelectedSKUPropertySet.SellingQty}),this.ShowQtyAlert(this.SelectedSKUPropertySet.SellingQty)))},t.prototype.MinusQty=function(){this.Qty>1&&(this.Qty-=1);this.trackingUtility.trackReduceQuantity({id:""+this.SalePage.Id,name:this.SalePage.Title,price:this.SalePage.Price,quantity:this.Qty,suggestPrice:this.SalePage.SuggestPrice,skuId:""+(this.SelectedSKUPropertySet&&this.SelectedSKUPropertySet.SaleProductSKUId)||""})},t.prototype.GetCurrentImgSrc=function(n){var t="";return this.SalePage.ImageList.map(function(i){i.SKUPropertyNameSet&&i.SKUPropertyNameSet.split("/")[0]===n[0].Name&&(t=i.PicUrl)}),t===""?this.SalePage.ImageList[0].PicUrl:t},t.prototype.GetQtyBySKU=function(n,t){var i;return this.SelectedSalePageSkuQtyList&&this.SelectedSalePageSkuQtyList.length>0&&(i=this.SelectedSalePageSkuQtyList.filter(function(i){return i.SalePageId===n&&i.SaleProductSKUId===t})),i&&i.length>0?i[0].Qty:1},t.prototype.ShowQtyAlert=function(n){this.DialogUtility.Toast(this.$translate.instant("frontend.typescripts.common.selling_qty_message",{val0:n}),this.DialogUtility.ToastModeEnum.Warning,3e3)},t.prototype.SelectPointPayOption=function(n){this.SelectedPointPayOptionIndex=n;this.SelectedPointPayOptionItem={PointsPayId:this.PointPayOptionList[n].PointsPayId,PairsPoints:this.PointPayOptionList[n].PairsPoints,PairsPrice:this.PointPayOptionList[n].PairsPrice}},t.prototype.SalePageStatusIsNormal=function(){return this.SalePage.StatusDef===this.SalePageStatusEnum[this.SalePageStatusEnum.Normal]},t.prototype.SalePageStatusIsSoldOut=function(){return this.SalePage.StatusDef===this.SalePageStatusEnum[this.SalePageStatusEnum.SoldOut]},t.prototype.SalePageStatusIsNoStart=function(){return this.SalePage.StatusDef===this.SalePageStatusEnum[this.SalePageStatusEnum.NoStart]},t.prototype.GetBackInStockSubscribedSkuList=function(n){var t=this;this.backInStockUtility.GetSubscribedSkuList(n).then(function(n){t.SubscribedSkuIdList=(n||[]).map(function(n){return n.skuId})}).catch(function(){t.$log.info("GetSubscribedSkuList Failure")})},t.prototype.SubscribeBackInStock=function(){var t=this,i,n;if(!this.SelectedSKUPropertySet){this.DialogUtility.Notice(this.$translate.instant("frontend.typescripts.components.select_item_tip"));return}i=this.addToCartConfig.salePageId;n=this.SelectedSKUPropertySet&&this.SelectedSKUPropertySet.SaleProductSKUId;this.backInStockUtility.SubscribeBackInStock(i,n,this.PageValue.CurrentPageName).then(function(){t.SubscribedSkuIdList=t.SubscribedSkuIdList.concat([n])})},t.prototype.UnsubscribeBackInStock=function(){var n=this;if(!this.SelectedSKUPropertySet){this.DialogUtility.Notice(this.$translate.instant("frontend.typescripts.components.select_item_tip"));return}var r=this.addToCartConfig.salePageId,t=this.SelectedSKUPropertySet&&this.SelectedSKUPropertySet.SaleProductSKUId,i=this.SubscribedSkuIdList.indexOf(t);i<0||this.backInStockUtility.UnsubscribeBackInStock(r,t,this.PageValue.CurrentPageName).then(function(){var t=n.SubscribedSkuIdList.concat();t.splice(i,1);n.SubscribedSkuIdList=t})},t.$inject=["$rootScope","$scope","$location","$window","$log","$q","$timeout","$uibModalInstance","$translate","underscore","SalePageService","ShoppingCartV4Service","ProductStockService","addToCartConfig","Facebook","GoogleAnalyticsEcommerceUtility","GoogleTagManagerDataLayerUtility","FacebookUtility","AdobeAnalyticsUtility","GoogleAnalyticsUtility","LineAdUtility","PageValue","DeviceValue","DefaultCurrencyCode","DialogUtility","BackInStockUtility","TrackingUtility",],t}();t.AddToShoppingCartController=i;angular.module("NineYi.Mall.Controllers").controller("AddToShoppingCartController",i)})(i=t.Controllers||(t.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}));__extends=this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.Confirm=function(){var t=this.addToCartConfig.salePageId,i=this.addToCartConfig.shopId,n;if(this.IsWaiting=!0,!this.SelectedSKUPropertySet)return this.$log.info("SKU not select!"),this.IsWaiting=!1,!1;if(n=this.SKUDictionaryById[this.SelectedSKUPropertySet.SaleProductSKUId].SellingQty,n<=0)return this.$log.info("SKU no selling qty!"),this.IsWaiting=!1,!1;if(this.Qty<1)return this.$log.info("SKU no qty!"),this.IsWaiting=!1,!1;this.$uibModalInstance.close({ShopId:i,SalePageId:t,SkuLevel1:this.SelectedSKUProperty[0].Name!=="-1"?this.SelectedSKUProperty[0].Name:"",SkuLevel2:this.SelectedSKUProperty.length===2?this.SelectedSKUProperty[1].Name:"",SaleProductSKUId:this.SelectedSKUPropertySet.SaleProductSKUId,SelectedSuggestPrice:this.SelectedSKUPropertySet.SuggestPrice,SelectedPrice:this.SelectedSKUPropertySet.Price,Qty:this.Qty,SellingQty:n})},t}(n.AddToShoppingCartController);n.AddToBasketController=t;angular.module("NineYi.Mall.Controllers").controller("AddToBasketController",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,l,a,v,y,p){var w=this,b;if(this.$rootScope=n,this.$scope=t,this.$log=i,this.value=r,this.$window=u,this.ShopId=f,this.ShopCategoryService=e,this.ActivityService=o,this.OfficialService=s,this.GoogleAnalyticsUtility=h,this.PromotionService=c,this.ECouponService=l,this.CouponService=a,this.LayoutTemplateDataService=v,this.LoadingBarUtility=y,this.CategoryId=p,this.FreeGiftList=[],this.DiscountPriceList=[],this.SalePageId=0,this.DeviceSize=this.value.deviceSize,b=_.last(u.location.pathname.split("/")).toString(),this.DeviceSize!=="mobile"||b.toLowerCase()==="official"){this.LoadingBarUtility.EnableLoadingBar();this.LoadingBarUtility.ShowLoadingBar();this.ActivityList=[];this.LayoutTemplateDataList={};u.nineYiOfficial&&(this.CategoryId=u.nineYiOfficial.shopCategoryId);var k=this.$scope.$on("onOfficialPromotionTargetList",function(n,t){var i,u,r;for(w.OfficialPromotionTargetList=t,i=0;i<=t.length-1;i++)if(u=t[i].ConditionDiscountTypeDef,t[i].Targets.length>0)if(u==="FreeGift")for(r=0;r<=t[i].Targets.length-1;r++)w.FreeGiftList.push(t[i].Targets[r]);else if(u==="DiscountPrice"||u==="DiscountRate")for(r=0;r<=t[i].Targets.length-1;r++)w.DiscountPriceList.push(t[i].Targets[r]);k()}),d=this.$scope.$on("onShopCategoryObj",function(n,t){w.ShopCategoryObj=t;w.SetActiveLink(w.ShopCategoryObj.List,w.CategoryId);d()}),g=this.$scope.$on("onLayoutTemplateDataList",function(n,t){w.LayoutTemplateDataList=t;g()});this.$log.info("Get PromotionList - start");this.PromotionService.GetOfficialPromotionHotSaleRankingList(this.ShopId).then(function(n){n.length!==0&&(w.OriginPromotionListLength=n.length,w.PromotionList=n.length<6?n:n.splice(0,5),w.$log.info("Get Promotion - Finish"))});this.$log.info("Get OfficialECouponList - start");this.ECouponService.GetOfficialECouponList(this.ShopId,this.SalePageId).then(function(n){n.length!==0&&(w.OriginECouponListLength=n[0].ECouponList.length,w.OfficialECouponList=n[0].ECouponList.length<6?n[0].ECouponList:n[0].ECouponList.splice(0,5),w.$log.info("Get OfficialECouponList - Finish"))});this.$log.info("Get CouponList - start");this.CouponService.GetCouponList(this.ShopId).then(function(n){n.length!==0&&(w.OriginCouponListLength=n.length,w.CouponList=n.length<6?n:n.splice(0,5),w.$log.info("Get CouponList - Finish"))});this.$log.info("Get ActivityList - start");this.ActivityService.GetActivityList(this.ShopId).then(function(n){n.length!==0&&(w.ActivityList=n,w.$log.info("Get ActivityList - Finish"))});this.$rootScope.$on("OfficialIndexCtrl.TrackEvent",function(n,t,i,r,u){w.TrackEvent(t,i,r,u)})}}return n.prototype.selectLevel1List=function(n,t){n.ChildList?n.selected=!n.selected:this.$window.location.href=t+"/v2/official/SalePageCategory/"+n.ShopCategory_Id},n.prototype.TrackEvent=function(n,t,i,r){this.GoogleAnalyticsUtility.TrackEvent(n,t,i,r)},n.prototype.SetActiveLink=function(n,t){t&&[].slice.call(n).forEach(function(n){if(+n.ShopCategory_Id==+t){n.active=!0;return}n.ChildList&&[].slice.call(n.ChildList).forEach(function(i){if(+i.ShopCategory_Id==+t){i.active=!0;n.selected=!0;return}})})},n.$inject=["$rootScope","$scope","$log","Mall.Value","$window","ShopId","ShopCategoryService","ActivityService","OfficialService","GoogleAnalyticsUtility","PromotionService","ECouponService","CouponService","LayoutTemplateDataService","LoadingBarUtility"],n}();n.ShopCategoryController=t;angular.module("NineYi.Mall.Controllers").controller("ShopCategoryController",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){this.$rootScope=n;this.$scope=t;this.$log=i;this.$window=r;this.GoogleAnalyticsUtility=u;this.AdobeAnalyticsUtility=f;this.AdobeAnalyticsUtility.ErrorPage("error","404")}return n.prototype.TrackEvent=function(n,t,i,r){this.GoogleAnalyticsUtility.TrackEvent(n,t,i,r)},n.$inject=["$rootScope","$scope","$log","$window","GoogleAnalyticsUtility","AdobeAnalyticsUtility",],n}();n.ErrorPageController=t;angular.module("NineYi.Mall.Controllers").controller("ErrorPageController",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){this.$scope=n;this.$log=t;this.$window=i;this.$translate=r;this.ShopId=u;this.GoogleAnalyticsEcommerceUtility=f;this.GoogleTagManagerDataLayerUtility=e;this.PageValue=o;this.ShoppingCartUtility=s;this.RefUtility=h;this.DialogUtility=c;this.$window.$translate=this.$translate}return n.prototype.AddToCart=function(n,t,i,r){var u=this;this.ShoppingCartUtility.AddToCart(n,this.ShopId,r,t,i).then(function(n){if(n){u.DialogUtility.Toast(n,u.DialogUtility.ToastModeEnum.Warning,750);return}u.DialogUtility.Toast(u.$translate.instant("frontend.typescripts.components.success_add"),u.DialogUtility.ToastModeEnum.Success,750)})},n.prototype.GetDownloadAppUrl=function(){return this.RefUtility.ReplaceRefUrl(this.PageValue.CurrentPage)},n.$inject=["$scope","$log","$window","$translate","ShopId","GoogleAnalyticsEcommerceUtility","GoogleTagManagerDataLayerUtility","PageValue","ShoppingCartUtility","RefUtility","DialogUtility"],n}();n.CompatibilityAdapterController=t;angular.module("NineYi.Mall.Controllers").controller("CompatibilityAdapterController",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){this.$scope=n;this.$log=t;this.MainMenuUtility=i;this.FreezeBodyUtility=r;this.DeviceValue=u;this.IsMobile=this.DeviceValue.IsMobile()}return n.prototype.ShowMenu=function(){this.IsMobile&&(this.MainMenuUtility.Toggle("category"),this.FreezeBodyUtility.ToogleFreezeBody())},n.$inject=["$scope","$log","MainMenuUtility","FreezeBodyUtility","DeviceValue"],n}();n.BreadcrumbController=t;angular.module("NineYi.Mall.Controllers").controller("BreadcrumbController",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){var c=this;this.$rootScope=n;this.$scope=t;this.$log=i;this.$window=r;this.AuthServiceImmediate=u;this.VipMemberService=f;this.SidebarService=e;this.ShopId=o;this.LocalizationConfig=s;this.ShopService=h;this.IsShowRegularOrderLink=!1;this.IsCRMEnabled=!1;this.AuthServiceImmediate.IsLoginPromise.then(function(n){c.IsLogin=n;c.GetSidebarSetting();c.SetCRMEnableStatus(c.ShopId)})}return n.prototype.GetSidebarSetting=function(){var n=this;this.SidebarService.GetSetting(this.ShopId).then(function(t){n.IsShowRegularOrderLink=t.Data.some(function(n){return n.Name==="RegularPurchase"&&n.IsEnable})}).catch(function(){n.$log.info("GetSetting failed")})},n.prototype.SetCRMEnableStatus=function(n){var t=this;this.ShopService.GetShopContractSetting(n).then(function(n){n.ReturnCode==="API0001"&&(t.IsCRMEnabled=n.Data.IsCRMEnabled)}).catch(function(){t.$log.info("GetShopContractSetting failed")})},n.$inject=["$rootScope","$scope","$log","$window","AuthServiceImmediate","VipMemberService","SidebarService","ShopId","LocalizationConfig","ShopService",],n}();n.OfficialAccountAsideBarController=t;angular.module("NineYi.Mall.Controllers").controller("OfficialAccountAsideBarController",t)})(t=n.Controllers||(n.Controllers={}))})(t=n.Mall||(n.Mall={}))}(NineYi||(NineYi={}))