1/*! 2 Copyright (c) 2017 Jed Watson. 3 Licensed under the MIT License (MIT), see 4 http://jedwatson.github.io/classnames 5*/ 6(function(){var hasOwn={}.hasOwnProperty;function classNames(){var classes=[];for(var i=0;i<arguments.length;i++){var arg=arguments[i];if(!arg){continue;}var argType=typeof arg;if(argType==="string"||argType==="number"){classes.push(arg);}else{if(Array.isArray(arg)&&arg.length){var inner=classNames.apply(null,arg);if(inner){classes.push(inner);}}else{if(argType==="object"){for(var key in arg){if(hasOwn.call(arg,key)&&arg[key]){classes.push(key);}}}}}}return classes.join(" ");}if(typeof module!=="undefined"&&module.exports){module.exports=classNames;}else{if(typeof define==="function"&&typeof define.amd==="object"&&define.amd){define("classnames",[],function(){return classNames;});}else{window.classNames=classNames;}}}());var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var __assign=(this&&this.__assign)||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)){t[p]=s[p];}}}return t;};var __rest=(this&&this.__rest)||function(s,e){var t={};for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0){t[p]=s[p];}}if(s!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0){t[p[i]]=s[p[i]];}}}return t;};function withImpressionTrack(WrappedComponent,enterOffset,exitOffset,trackInterval){if(enterOffset===void 0){enterOffset=0;}if(exitOffset===void 0){exitOffset=0;}if(trackInterval===void 0){trackInterval=100;}return _a=(function(_super){__extends(WithImpressionTrack,_super);function WithImpressionTrack(props){var _this=_super.call(this,props)||this;_this.impressionWrapper=null;_this.scrollEventIdentifier="scroll."+_.now().toString();_this.attachListeners=_this.attachListeners.bind(_this);_this.detachListeners=_this.detachListeners.bind(_this);_this.track=_this.track.bind(_this);_this.impress=_this.impress.bind(_this);return _this;}WithImpressionTrack.prototype.componentDidMount=function(){this.attachListeners();this.track();};WithImpressionTrack.prototype.componentWillUnmount=function(){this.detachListeners();};WithImpressionTrack.prototype.attachListeners=function(){$(window).on(this.scrollEventIdentifier,_.throttle(this.track,trackInterval));};WithImpressionTrack.prototype.detachListeners=function(){$(window).off(this.scrollEventIdentifier);};WithImpressionTrack.prototype.track=function(){if($(this.impressionWrapper).componentInScreen(enterOffset,exitOffset)){this.impress();}};WithImpressionTrack.prototype.impress=function(){var onImpress=this.props.onImpress;onImpress&&onImpress();this.detachListeners();};WithImpressionTrack.prototype.render=function(){var _this=this;var _a=this.props,onImpress=_a.onImpress,detachFunction=_a.detachFunction,passThroughProps=__rest(_a,["onImpress","detachFunction"]);return(React.createElement("div",{className:"with-impression-track",ref:function(impressionWrapper){return _this.impressionWrapper=impressionWrapper;}},React.createElement(WrappedComponent,__assign({},passThroughProps))));};return WithImpressionTrack;}(React.Component)),_a.displayName="WithImpressionTrack("+(WrappedComponent.displayName||"Component")+")",_a;var _a;}var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var __assign=(this&&this.__assign)||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)){t[p]=s[p];}}}return t;};var __rest=(this&&this.__rest)||function(s,e){var t={};for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0){t[p]=s[p];}}if(s!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0){t[p[i]]=s[p[i]];}}}return t;};function withIntersectionImpression(WrappedComponent,threshold){if(threshold===void 0){threshold=0.01;}return _a=(function(_super){__extends(WithIntersectionTrack,_super);
6function WithIntersectionTrack(props){var _this=_super.call(this,props)||this;_this.observerOption={rootMargin:"0px",threshold:threshold};_this.impressionWrapper=null;_this.impress=_this.impress.bind(_this);if(IntersectionObserver){_this.intersectionObserver=new IntersectionObserver(_this.impress,_this.observerOption);}return _this;}WithIntersectionTrack.prototype.componentDidMount=function(){if(this.intersectionObserver){this.intersectionObserver.observe(this.impressionWrapper);}};WithIntersectionTrack.prototype.impress=function(entries,observer){var _a=this.props,onImpress=_a.onImpress,outIntersection=_a.outIntersection;entries.forEach(function(entry){entry.isIntersecting&&onImpress&&onImpress();!entry.isIntersecting&&outIntersection&&outIntersection();});};WithIntersectionTrack.prototype.render=function(){var _this=this;var _a=this.props,onImpress=_a.onImpress,detachFunction=_a.detachFunction,passThroughProps=__rest(_a,["onImpress","detachFunction"]);return(React.createElement("div",{className:"with-impression-intersect",ref:function(impressionWrapper){return _this.impressionWrapper=impressionWrapper;}},React.createElement(WrappedComponent,__assign({},passThroughProps))));};return WithIntersectionTrack;}(React.Component)),_a.displayName="WithIntersectionTrack("+(WrappedComponent.displayName||"Component")+")",_a;var _a;}var isString=_.isString,isNumber=_.isNumber,isArray=_.isArray,isObject=_.isObject;var parseString=ValueUtils.parseString,parseNumber=ValueUtils.parseNumber,parseInteger=ValueUtils.parseInteger,parseArray=ValueUtils.parseArray,parseObject=ValueUtils.parseObject;var FormattedValuePair=(function(){function FormattedValuePair(value,formattedValue){if(value===void 0){value=null;}if(formattedValue===void 0){formattedValue="";}this.value=null;this.formattedValue="";this.value=value;this.formattedValue=formattedValue;}return FormattedValuePair;}());var ProductDataImage=(function(){function ProductDataImage(url,alt,imageType,format){if(url===void 0){url="";}if(alt===void 0){alt="";}if(imageType===void 0){imageType="";}if(format===void 0){format="";}this.url=url;this.alt=alt;this.imageType=imageType;this.format=format;}return ProductDataImage;}());var ProductData=(function(){function ProductData(){this.id="";this.baseProductId="";this.objectID="";this.queryID="";this.url="";this.images=[];this.videoThumbnailUrl="";this.name="";this.brandName="";this.packingSpec="";this.primaryCatCode="";this.numberOfReviews=0;this.averageRating=0;this.buyPrice=new FormattedValuePair();this.discountPrice=new FormattedValuePair();this.freqDiscountPrice=new FormattedValuePair();this.vipPrice=new FormattedValuePair();this.goldVipPrice=new FormattedValuePair();this.diamondVipPrice=new FormattedValuePair();this.plusMemberPrice=new FormattedValuePair();this.discountSavedPriceFormatted="";this.freqDiscountSavedPriceFormatted="";this.vipSavedPriceFormatted="";this.goldVipSavedPriceFormatted="";this.diamondVipSavedPriceFormatted="";this.plusMemberSavedPriceFormatted="";this.mainlandBuyPrice=new FormattedValuePair();this.mainlandDiscountPrice=new FormattedValuePair();this.mainlandFreqDiscountPrice=new FormattedValuePair();this.mainlandVipPrice=new FormattedValuePair();this.mainlandGoldVipPrice=new FormattedValuePair();this.mainlandDiamondVipPrice=new FormattedValuePair();this.mainlandPlusMemberPrice=new FormattedValuePair();this.promotionText="";this.promotionStyle="";this.storeName="";this.storeType="";this.storeTypeDisplay="";this.storeRating=0;this.storeId="";this.storeIdOrig="";this.malldollarPercent=null;this.malldollarAmountFormatted=null;this.malldollarPercentFreq=null;this.malldollarAmountFormattedFreq=null;this.malldollarPercentVipFreq=null;this.malldollarAmountFormattedVipFreq=null;this.malldollarPercentGoldVipFreq=null;this.malldollarAmountFormattedGoldVipFreq=null;this.malldollarPercentDiamondVip=null;this.malldollarAmountFormattedDiamondVip=null;this.malldollarPercentDiamondVipFreq=null;this.malldollarAmountFormattedDiamondVipFreq=null;this.malldollarPercentVip=null;this.malldollarAmountFormattedVip=null;this.malldollarPercentGoldVip=null;this.malldollarAmountFormattedGoldVip=null;this.thresholdPromotion={};this.multiCategoryPromotion={};this.perfectPartnerPromotion={};this.bundlePromotion={};this.buyMoreSaveMore={};this.numberOfVariants=1;this.purchaseOption=0;this.stockLevelStatusCode="";this.priceUpdatedDate="";this.deliveryLabelCode="";this.deliveryLabelScheduleCode=null;this.deliverableRegions=[];this.deliveryModeCode="";this.salesNumberString=null;this.specialAddCartFlowLink="";this.mabsRefId="";this.mabsAdPosition="";this.marketingLabelUids=[];this.additionalLabel="";this.additionalLabelForPurchasedList="";this.sourceId="";this.inStorePickUpCheckoutLink="";this.externalAffiliateRedirectLink="";this.displayStoreSquareLogoUrl="";this.officialWebsiteAffiliateUrl="";
6this.overseasRegionCodes=[];this.isThirdPartyLogisticsWarehouse="";this.isPriorSKU="";this.pickLabelUids=[];this.eCoinsRebateSchedule=[];this.isMainlandSamePrice=false;this.warehouseState="";this.warehouseCity="";this.isGreenLab=false;this.expiryDate="";this.expiryDateTs=null;this.kaPriceList=[];this.serviceDealOption={};this.isExpressDeliverableSku=false;this.isMerchantWetmarketWarehouse=false;this.wetmarketCodeList=[];}ProductData.parseHybrisProductData=function(productData){var product=new ProductData();if(_.isObject(productData)){var code=productData.code;product.id=ValueUtils.parseString(code);var baseProduct=productData.baseProduct;product.baseProductId=ValueUtils.parseString(baseProduct);var url=productData.url;product.url=ValueUtils.parseString(url);var name_1=productData.name;product.name=ValueUtils.parseString(name_1);var brandName=productData.brandName;product.brandName=ValueUtils.parseString(brandName);var images=productData.images;product.images=ValueUtils.parseArray(images).map(function(image){var url=image.url;return new ProductDataImage(ValueUtils.parseString(url),product.name,image.imageType,image.format);});var videos=productData.videos;product.videoThumbnailUrl=ValueUtils.parseString(videos&&videos.thumbnailUrl?videos.thumbnailUrl:"");var packingSpec=productData.packingSpec;product.packingSpec=ValueUtils.parseString(packingSpec);var primaryCatCode=productData.primaryCatCode;product.primaryCatCode=ValueUtils.parseString(primaryCatCode);var numberOfReviews=productData.numberOfReviews;product.numberOfReviews=ValueUtils.parseInteger(numberOfReviews);var averageRating=productData.averageRating;product.averageRating=ValueUtils.parseNumber(averageRating);var priceList=productData.priceList;product.buyPrice=new FormattedValuePair();product.discountPrice=new FormattedValuePair();product.freqDiscountPrice=new FormattedValuePair();product.vipPrice=new FormattedValuePair();product.goldVipPrice=new FormattedValuePair();product.diamondVipPrice=new FormattedValuePair();if(_.isArray(priceList)){priceList.map(function(priceItem){var _a=ValueUtils.parseObject(priceItem),priceType=_a.priceType,value=_a.value,formattedValue=_a.formattedValue;var formattedValuePair=new FormattedValuePair(ValueUtils.parseNumber(value),ValueUtils.parseString(formattedValue));switch(priceType){case"BUY":product.buyPrice=formattedValuePair;break;case"DISCOUNT":product.discountPrice=formattedValuePair;break;case"DISCOUNT_FREQ":product.freqDiscountPrice=formattedValuePair;break;case"VIP":product.vipPrice=formattedValuePair;break;case"GOLDVIP":product.goldVipPrice=formattedValuePair;break;case"DIAMONDVIP":product.diamondVipPrice=formattedValuePair;break;case"PLUS":product.plusMemberPrice=formattedValuePair;default:}});}var mainlandPriceList=productData.mainlandPriceList;product.mainlandBuyPrice=new FormattedValuePair();product.mainlandDiscountPrice=new FormattedValuePair();product.mainlandFreqDiscountPrice=new FormattedValuePair();product.mainlandVipPrice=new FormattedValuePair();product.mainlandGoldVipPrice=new FormattedValuePair();product.mainlandDiamondVipPrice=new FormattedValuePair();if(_.isArray(mainlandPriceList)){mainlandPriceList.map(function(priceItem){var _a=ValueUtils.parseObject(priceItem),priceType=_a.priceType,value=_a.value,formattedValue=_a.formattedValue;var formattedValuePair=new FormattedValuePair(ValueUtils.parseNumber(value),ValueUtils.parseString(formattedValue));switch(priceType){case"BUY":product.mainlandBuyPrice=formattedValuePair;break;case"DISCOUNT":product.mainlandDiscountPrice=formattedValuePair;break;case"DISCOUNT_FREQ":product.mainlandFreqDiscountPrice=formattedValuePair;break;case"VIP":product.mainlandVipPrice=formattedValuePair;break;case"GOLDVIP":product.mainlandGoldVipPrice=formattedValuePair;break;case"DIAMONDVIP":product.mainlandDiamondVipPrice=formattedValuePair;break;case"PLUS":product.mainlandPlusMemberPrice=formattedValuePair;default:}});}var savedPriceList=productData.savedPrice;product.discountSavedPriceFormatted="";product.freqDiscountSavedPriceFormatted="";product.vipSavedPriceFormatted="";product.goldVipSavedPriceFormatted="";product.diamondVipSavedPriceFormatted="";product.plusMemberSavedPriceFormatted="";if(_.isArray(savedPriceList)){savedPriceList.map(function(savedPriceItem){var _a=ValueUtils.parseObject(savedPriceItem),priceType=_a.priceType,formattedValue=_a.formattedValue,value=_a.value;if(ValueUtils.parseNumber(value)<0.001){return;}switch(priceType){case"DISCOUNT":product.discountSavedPriceFormatted=ValueUtils.parseString(formattedValue);break;case"DISCOUNT_FREQ":product.freqDiscountSavedPriceFormatted=ValueUtils.parseString(formattedValue);break;case"VIP":product.vipSavedPriceFormatted=ValueUtils.parseString(formattedValue);break;case"GOLDVIP":product.goldVipSavedPriceFormatted=ValueUtils.parseString(formattedValue);break;case"DIAMONDVIP":product.diamondVipSavedPriceFormatted=ValueUtils.parseString(formattedValue);break;default:}});}var promotionText=productData.promotionText;product.promotionText=ValueUtils.parseString(promotionText);var promotionStyle=productData.promotionStyle;product.promotionStyle=ValueUtils.parseString(promotionStyle);var storeName=productData.storeName;product.storeName=ValueUtils.parseString(storeName);var storeType=productData.storeType;product.storeType=ValueUtils.parseString(storeType);var storeTypeDisplay=productData.storeTypeDisplay;product.storeTypeDisplay=ValueUtils.parseString(storeTypeDisplay);var storeRating=productData.storeRating;product.storeRating=ValueUtils.parseNumber(storeRating);var storeId=productData.storeCode;product.storeId=ValueUtils.parseString(storeId);var storeIdOrig=productData.storeCodeOriginal;product.storeIdOrig=ValueUtils.parseString(storeIdOrig);var mallDollarLabels=productData.labels;product.malldollarPercent=null;product.malldollarAmountFormatted=null;product.malldollarPercentFreq=null;product.malldollarAmountFormattedFreq=null;product.malldollarPercentVipFreq=null;product.malldollarAmountFormattedVipFreq=null;product.malldollarPercentGoldVipFreq=null;product.malldollarAmountFormattedGoldVipFreq=null;product.malldollarPercentDiamondVip=null;product.malldollarAmountFormattedDiamondVip=null;product.malldollarPercentDiamondVipFreq=null;product.malldollarAmountFormattedDiamondVipFreq=null;product.malldollarPercentVip=null;product.malldollarAmountFormattedVip=null;product.malldollarPercentGoldVip=null;product.malldollarAmountFormattedGoldVip=null;
6if(_.isArray(mallDollarLabels)){mallDollarLabels.map(function(mallDollarLabel){var _a=ValueUtils.parseObject(mallDollarLabel),rebateType=_a.type,malldollarAmount=_a.amount,malldollarPercent=_a.loyaltyPoint;var malldollarAmountValue=ValueUtils.parseNumber(malldollarAmount);if(malldollarAmountValue<0.001){return;}var formattedMalldollarPercent="$ "+malldollarAmountValue.toFixed(2);switch(rebateType){case"REBATE":product.malldollarPercent=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormatted=formattedMalldollarPercent;break;case"FREQREBATE":product.malldollarPercentFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedFreq=formattedMalldollarPercent;break;case"VIPFREQREBATE":product.malldollarPercentVipFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedVipFreq=formattedMalldollarPercent;break;case"GOLDVIPFREQREBATE":product.malldollarPercentGoldVipFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedGoldVipFreq=formattedMalldollarPercent;break;case"DIAMONDVIPREBATE":product.malldollarPercentDiamondVip=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedDiamondVip=formattedMalldollarPercent;break;case"DIAMONDVIPFREQREBATE":product.malldollarPercentDiamondVipFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedDiamondVipFreq=formattedMalldollarPercent;break;case"VIPREBATE":product.malldollarPercentVip=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedVip=formattedMalldollarPercent;break;case"GOLDVIPREBATE":product.malldollarPercentGoldVip=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedGoldVip=formattedMalldollarPercent;break;default:}});}var thresholdPromotion=productData.thresholdPromotion,multiCategoryPromotion=productData.multiCategoryPromotion,perfectPartnerPromotion=productData.perfectPartnerPromotion,bundlePromotion=productData.bundlePromotion,buyMoreSaveMore=productData.buyMoreSaveMore;product.thresholdPromotion=ValueUtils.parseObject(thresholdPromotion);product.multiCategoryPromotion=ValueUtils.parseObject(multiCategoryPromotion);product.perfectPartnerPromotion=ValueUtils.parseObject(perfectPartnerPromotion);product.bundlePromotion=ValueUtils.parseObject(bundlePromotion);product.buyMoreSaveMore=ValueUtils.parseObject(buyMoreSaveMore);var numberOfVariants=productData.numberOfVariants;product.numberOfVariants=ValueUtils.parseInteger(numberOfVariants,1);var purchaseOption=productData.purchaseOption;product.purchaseOption=ValueUtils.parseInteger(purchaseOption,0);var stockLevelStatusCode=productData.stock&&productData.stock.stockLevelStatus&&productData.stock.stockLevelStatus.code||"";product.stockLevelStatusCode=ValueUtils.parseString(stockLevelStatusCode);var deliveryLabelCode=productData.deliveryLabelCode;var deliveryLabelCodeS=ProductBriefData.getScheduledDeliveryLabelCode(productData);if(typeof deliveryLabelCodeS==="undefined"||deliveryLabelCodeS==null){product.deliveryLabelCode=ValueUtils.parseString(deliveryLabelCode);}else{product.deliveryLabelCode=ValueUtils.parseString(deliveryLabelCodeS);}var deliveryLabelScheduleCode=productData.deliveryLabelScheduleCode;product.deliveryLabelScheduleCode=ValueUtils.parseArray(deliveryLabelScheduleCode);var salesNumberString=productData.salesNumberString;product.salesNumberString=ValueUtils.parseString(salesNumberString);var specialAddCartFlowLink=productData.specialAddCartFlowLink;product.specialAddCartFlowLink=ValueUtils.parseString(specialAddCartFlowLink);var inStorePickUpCheckoutLink=productData.inStorePickUpCheckoutLink;product.inStorePickUpCheckoutLink=ValueUtils.parseString(inStorePickUpCheckoutLink);var externalAffiliateRedirectLink=productData.externalAffiliateRedirectLink;product.externalAffiliateRedirectLink=ValueUtils.parseString(externalAffiliateRedirectLink);var displayStoreSquareLogoUrl=productData.displayStoreSquareLogoUrl;product.displayStoreSquareLogoUrl=ValueUtils.parseString(displayStoreSquareLogoUrl);var officialWebsiteAffiliateUrl=productData.officialWebsiteAffiliateUrl;product.officialWebsiteAffiliateUrl=ValueUtils.parseString(officialWebsiteAffiliateUrl);var isThirdPartyLogisticsWarehouse=productData.isThirdPartyLogisticsWarehouse;product.isThirdPartyLogisticsWarehouse=ValueUtils.parseString(isThirdPartyLogisticsWarehouse);var isPriorSKU=productData.isPriorSKU;product.isPriorSKU=ValueUtils.parseString(isPriorSKU);var marketingLabelUids=productData.marketingLabelUids;product.marketingLabelUids=ValueUtils.parseArray(marketingLabelUids);product.priceUpdatedDate="";
6var overseasRegionCodes=productData.overseasRegionCodes;product.overseasRegionCodes=ValueUtils.parseArray(overseasRegionCodes);var pickLabelUids=productData.pickLabelUids;product.pickLabelUids=ValueUtils.parseArray((pickLabelUids));var eCoinsRebateSchedule=productData.eCoinsRebateSchedule;product.eCoinsRebateSchedule=ValueUtils.parseArray((eCoinsRebateSchedule));var isMainlandSamePrice=productData.isMainlandSamePrice;product.isMainlandSamePrice=ValueUtils.parseBoolean(isMainlandSamePrice);var warehouseState=productData.warehouseState;product.warehouseState=ValueUtils.parseString(warehouseState);var warehouseCity=productData.warehouseCity;product.warehouseCity=ValueUtils.parseString(warehouseCity);var deliveryModeCode=productData.deliveryModeCode;product.deliveryModeCode=ValueUtils.parseString(deliveryModeCode);var isGreenLab=productData.isGreenLab;product.isGreenLab=ValueUtils.parseBoolean(isGreenLab);var expiryDate=productData.expiryDate;product.expiryDate=ValueUtils.parseString(expiryDate);var expiryDateTs=productData.expiryDateTs;product.expiryDateTs=ValueUtils.parseInteger(expiryDateTs);var kaPriceList_1=productData.kaPriceList;product.kaPriceList=ValueUtils.parseArray(kaPriceList_1);var serviceDealOption=productData.serviceDealOption;product.serviceDealOption=ValueUtils.parseObject(serviceDealOption);if(_.isBoolean(productData.isExpressDeliverableSku)){product.isExpressDeliverableSku=productData.isExpressDeliverableSku;}if(_.isBoolean(productData.isMerchantWetmarketWarehouse)){product.isMerchantWetmarketWarehouse=productData.isMerchantWetmarketWarehouse;}if(_.isArray(productData.wetmarketCodeList)){product.wetmarketCodeList=productData.wetmarketCodeList;}}return product;};ProductData.parseSfpiProductData=function(sfpiProductData){var productData=new ProductData();if(isObject(sfpiProductData)){var product_code=sfpiProductData.product_code;if(isString(product_code)){productData.baseProductId=product_code;}var primary_cat_code=sfpiProductData.primary_cat_code;if(isString(primary_cat_code)){productData.primaryCatCode=primary_cat_code;}var sku_id=sfpiProductData.sku_id;if(isString(sku_id)){productData.id=sku_id;}var link=sfpiProductData.link;if(isString(link)){productData.url=link;}var brand_name=sfpiProductData.brand_name;if(isString(brand_name)){productData.brandName=brand_name;}var name_2=sfpiProductData.name;if(isString(name_2)){productData.name=name_2;}var packing_spec=sfpiProductData.packing_spec;if(isString(packing_spec)){productData.packingSpec=packing_spec;}var rating=sfpiProductData.rating;if(isNumber(rating)){productData.averageRating=rating;}var num_reviews=sfpiProductData.num_reviews;if(isNumber(num_reviews)){productData.numberOfReviews=num_reviews;}var image_link=sfpiProductData.image_link;if(isString(image_link)){productData.images[0]=new ProductDataImage(image_link,parseString(name_2));}var regular_price=sfpiProductData.regular_price,regular_price_formatted=sfpiProductData.regular_price_formatted;if(isNumber(regular_price)&&isString(regular_price_formatted)){productData.buyPrice=new FormattedValuePair(regular_price,regular_price_formatted);}var sale_price_string=sfpiProductData.sale_price_string,sale_price_formatted=sfpiProductData.sale_price_formatted;if(isNumber(sale_price_string)&&isString(sale_price_formatted)){productData.discountPrice=new FormattedValuePair(sale_price_string,sale_price_formatted);}var vip_members_price=sfpiProductData.vip_members_price,vip_members_price_formatted=sfpiProductData.vip_members_price_formatted;if(isNumber(vip_members_price)&&isString(vip_members_price_formatted)){productData.vipPrice=new FormattedValuePair(vip_members_price,vip_members_price_formatted);}var gold_vip_members_price=sfpiProductData.gold_vip_members_price,gold_vip_members_price_formatted=sfpiProductData.gold_vip_members_price_formatted;if(isNumber(gold_vip_members_price)&&isString(gold_vip_members_price_formatted)){productData.goldVipPrice=new FormattedValuePair(gold_vip_members_price,gold_vip_members_price_formatted);}var diamond_vip_members_price=sfpiProductData.diamond_vip_members_price,diamond_vip_members_price_formatted=sfpiProductData.diamond_vip_members_price_formatted;if(isNumber(diamond_vip_members_price)&&isString(diamond_vip_members_price_formatted)){productData.diamondVipPrice=new FormattedValuePair(diamond_vip_members_price,diamond_vip_members_price_formatted);}var discount_text_ch=sfpiProductData.discount_text_ch,discount_text=sfpiProductData.discount_text;if(isString(discount_text_ch)||isString(discount_text)){productData.promotionText=ProductData.localizationFallback(discount_text_ch,discount_text);}var discount_style=sfpiProductData.discount_style;if(isString(discount_style)){productData.promotionStyle=discount_style;}var store_id=sfpiProductData.store_id;if(isString(store_id)){productData.storeId=store_id;}productData.storeIdOrig=store_id;var merchant_name=sfpiProductData.merchant_name;if(isString(merchant_name)){productData.storeName=merchant_name;}var store_type=sfpiProductData.store_type;if(isString(store_type)){productData.storeType=store_type;}var mall_dollar_perc=sfpiProductData.mall_dollar_perc;if((isString(mall_dollar_perc)&&/^[0-9]+$/.test(mall_dollar_perc))||isNumber(mall_dollar_perc)){productData.malldollarPercent=mall_dollar_perc.toString();}var mall_dollar_amt_formatted=sfpiProductData.mall_dollar_amt_formatted;if(isString(mall_dollar_amt_formatted)){productData.malldollarAmountFormatted=mall_dollar_amt_formatted;}var mall_dollar_perc_vip=sfpiProductData.mall_dollar_perc_vip;if((isString(mall_dollar_perc_vip)&&/^[0-9]+$/.test(mall_dollar_perc_vip))||isNumber(mall_dollar_perc_vip)){productData.malldollarPercentVip=mall_dollar_perc_vip.toString();}var mall_dollar_amt_vip_formatted=sfpiProductData.mall_dollar_amt_vip_formatted;if(isString(mall_dollar_amt_vip_formatted)){productData.malldollarAmountFormattedVip=mall_dollar_amt_vip_formatted;}var mall_dollar_perc_gold_vip=sfpiProductData.mall_dollar_perc_gold_vip;if((isString(mall_dollar_perc_gold_vip)&&/^[0-9]+$/.test(mall_dollar_perc_gold_vip))||isNumber(mall_dollar_perc_gold_vip)){productData.malldollarPercentGoldVip=mall_dollar_perc_gold_vip.toString();}var mall_dollar_amt_gold_vip_formatted=sfpiProductData.mall_dollar_amt_gold_vip_formatted;if(isString(mall_dollar_amt_gold_vip_formatted)){productData.malldollarAmountFormattedGoldVip=mall_dollar_amt_gold_vip_formatted;}var promotion_levels_zh=sfpiProductData.promotion_levels_zh,promotion_levels_en=sfpiProductData.promotion_levels_en;if(isString(promotion_levels_zh)||isString(promotion_levels_en)){try{productData.buyMoreSaveMore.promotionLevels=JSON.parse(this.localizationFallback(promotion_levels_zh,promotion_levels_en));}catch(err){Logger.error(err);}}var promo_tag_color=sfpiProductData.promo_tag_color,promo_tag_link=sfpiProductData.promo_tag_link,promo_tag_text=sfpiProductData.promo_tag_text,promo_tag_start_time=sfpiProductData.promo_tag_start_time,promo_tag_end_time=sfpiProductData.promo_tag_end_time;if(isString(promo_tag_link)&&isString(promo_tag_text)){var promoData={code:promo_tag_link.substring(promo_tag_link.lastIndexOf("/")+1,promo_tag_link.length),colorCode:parseString(promo_tag_color,""),label:promo_tag_text,startTime:isString(promo_tag_start_time)&&isNumber(Number(promo_tag_start_time))&&Number(promo_tag_start_time),endTime:isString(promo_tag_end_time)&&isNumber(Number(promo_tag_end_time))&&Number(promo_tag_end_time)};if(/\/promo\/.+$/.test(promo_tag_link)){productData.thresholdPromotion=promoData;}else{if(/\/abpromo\/.+$/.test(promo_tag_link)){productData.multiCategoryPromotion=promoData;}else{if(/\/exp\/.+$/.test(promo_tag_link)){productData.perfectPartnerPromotion=promoData;}else{if(/\/abcbundle\/.+$/.test(promo_tag_link)){productData.bundlePromotion=promoData;}else{if(/\/p\/.+$/.test(promo_tag_link)){productData.buyMoreSaveMore.promotionMessage=promo_tag_text;productData.buyMoreSaveMore.promotionTagColor=promo_tag_color;productData.buyMoreSaveMore.startTime=isString(promo_tag_start_time)&&isNumber(Number(promo_tag_start_time))&&Number(promo_tag_start_time);productData.buyMoreSaveMore.endTime=isString(promo_tag_end_time)&&isNumber(Number(promo_tag_end_time))&&Number(promo_tag_end_time);}}}}}}}return productData;};ProductData.parseAlgoliaProductData=function(AlgoliaProductData){var product=ne
6w ProductData();if(_.isObject(AlgoliaProductData)){if(_.isString(AlgoliaProductData.baseProduct)){product.baseProductId=AlgoliaProductData.baseProduct;}if(_.isString(AlgoliaProductData.code)){product.id=AlgoliaProductData.code;}if(_.isString(AlgoliaProductData.objectID)){product.objectID=AlgoliaProductData.objectID;}if(_.isString(AlgoliaProductData.queryID)){product.queryID=AlgoliaProductData.queryID;}if(_.isString(AlgoliaProductData.urlZh)||_.isString(AlgoliaProductData.urlEn)){product.url=hktvCommon.addPrefixToHktvUrl(this.localizationFallback(AlgoliaProductData.urlZh,AlgoliaProductData.urlEn));}if(_.isString(AlgoliaProductData.brandZh)||_.isString(AlgoliaProductData.brandEn)){product.brandName=this.localizationFallback(AlgoliaProductData.brandZh,AlgoliaProductData.brandEn);}if(_.isString(AlgoliaProductData.nameZh)||_.isString(AlgoliaProductData.nameEn)){product.name=this.localizationFallback(AlgoliaProductData.nameZh,AlgoliaProductData.nameEn);}if(_.isString(AlgoliaProductData.storeNameZh)||_.isString(AlgoliaProductData.storeNameEn)){product.storeName=this.localizationFallback(AlgoliaProductData.storeNameZh,AlgoliaProductData.storeNameEn);}if(_.isString(AlgoliaProductData.storeType)){product.storeType=AlgoliaProductData.storeType;}if(_.isString(AlgoliaProductData.storeTypeDisplayZh)||_.isString(AlgoliaProductData.storeTypeDisplayEn)){product.storeTypeDisplay=this.localizationFallback(AlgoliaProductData.storeTypeDisplayZh,AlgoliaProductData.storeTypeDisplayEn);}if(_.isString(AlgoliaProductData.storeCode)){product.storeId=AlgoliaProductData.storeCode;}if(_.isString(AlgoliaProductData.storeCodeOrig)){product.storeIdOrig=AlgoliaProductData.storeCodeOrig;}if(_.isString(AlgoliaProductData.packingSpecZh)||_.isString(AlgoliaProductData.packingSpecEn)){product.packingSpec=this.localizationFallback(AlgoliaProductData.packingSpecZh,AlgoliaProductData.packingSpecEn);}if(_.isString(AlgoliaProductData.primaryCatCode)){product.primaryCatCode=AlgoliaProductData.primaryCatCode;}if(_.isNumber(AlgoliaProductData.storeRating)){product.storeRating=AlgoliaProductData.storeRating;}if(_.isNumber(AlgoliaProductData.averageRating)){product.averageRating=AlgoliaProductData.averageRating;}if(_.isNumber(AlgoliaProductData.numberOfReviews)){product.numberOfReviews=AlgoliaProductData.numberOfReviews;}if(_.isNumber(AlgoliaProductData.numberOfVariants)){product.numberOfVariants=AlgoliaProductData.numberOfVariants;}if(_.isNumber(AlgoliaProductData.purchaseOption)){product.purchaseOption=AlgoliaProductData.purchaseOption;}if(_.isArray(AlgoliaProductData.images)&&_.isObject(AlgoliaProductData.images[0])){var image=new ProductDataImage(AlgoliaProductData.images[0].url,product.name);product.images[0]=image;}if(_.isObject(AlgoliaProductData.videos)){var _a=AlgoliaProductData.videos,videos=_a===void 0?{}:_a;if(_.isString(videos.thumbnailUrl)){product.videoThumbnailUrl=videos.thumbnailUrl;}}if(_.isObject(AlgoliaProductData.thresholdPromotionZh)||_.isObject(AlgoliaProductData.thresholdPromotionEn)){product.thresholdPromotion=this.localizationFallback(AlgoliaProductData.thresholdPromotionZh,AlgoliaProductData.thresholdPromotionEn);}if(_.isObject(AlgoliaProductData.multiCategoryPromotionZh)||_.isObject(AlgoliaProductData.multiCategoryPromotionEn)){product.multiCategoryPromotion=this.localizationFallback(AlgoliaProductData.multiCategoryPromotionZh,AlgoliaProductData.multiCategoryPromotionEn);}if(_.isObject(AlgoliaProductData.buyMoreSaveMoreZh)||_.isObject(AlgoliaProductData.buyMoreSaveMoreEn)){product.buyMoreSaveMore=this.localizationFallback(AlgoliaProductData.buyMoreSaveMoreZh,AlgoliaProductData.buyMoreSaveMoreEn);}if(_.isObject(AlgoliaProductData.perfectPartnerPromotionZh)||_.isObject(AlgoliaProductData.perfectPartnerPromotionEn)){product.perfectPartnerPromotion=this.localizationFallback(AlgoliaProductData.perfectPartnerPromotionZh,AlgoliaProductData.perfectPartnerPromotionEn);}if(_.isObject(AlgoliaProductData.bundlePromotionZh)||_.isObject(AlgoliaProductData.bundlePromotionEn)){product.bundlePromotion=this.localizationFallback(AlgoliaProductData.bundlePromotionZh,AlgoliaProductData.bundlePromotionEn);}if(_.isArray(AlgoliaProductData.priceList)){AlgoliaProductData.priceList.forEach(function(priceListItem){if(priceListItem.priceType=="BUY"){product.buyPrice={"formattedValue":priceListItem.formattedValue,"value":priceListItem.value};}if(priceListItem.priceType=="DISCOUNT"){product.discountPrice={"formattedValue":priceListItem.formattedValue,"value":priceListItem.value};}if(priceListItem.priceType=="DISCOUNT_FREQ"){product.freqDiscountPrice={"formattedValue":priceListItem.formattedValue,"value":priceListItem.value};}if(priceListItem.priceType=="VIP"){product.vipPrice={"formattedValue":priceListItem.formattedValue,"value":priceListItem.value};}if(priceListItem.priceType=="GOLDVIP"){product.goldVipPrice={"formattedValue":priceListItem.formattedValue,"value":priceListItem.value};}if(priceListItem.priceType=="DIAMONDVIP"){product.diamondVipPrice={"formattedValue":priceListItem.formattedValue,"value":priceListItem.value};}if(priceListItem.priceType=="PLUS"){product.plusMemberPrice={"formattedValue":priceListItem.formattedValue,"value":priceListItem.value};}});}if(_.isArray(AlgoliaProductData.mainlandPriceList)){AlgoliaProductData.mainlandPriceList.forEach(function(mainlandPriceListItem){if(mainlandPriceListItem.priceType=="BUY"){product.mainlandBuyPrice={"formattedValue":mainlandPriceListItem.formattedValue,"value":mainlandPriceListItem.value};}if(mainlandPriceListItem.priceType=="DISCOUNT"){product.mainlandDiscountPrice={"formattedValue":mainlandPriceListItem.formattedValue,"value":mainlandPriceListItem.value};}if(mainlandPriceListItem.priceType=="DISCOUNT_FREQ"){product.mainlandFreqDiscountPrice={"formattedValue":mainlandPriceListItem.formattedValue,"value":mainlandPriceListItem.value};}if(mainlandPriceListItem.priceType=="VIP"){product.mainlandVipPrice={"formattedValue":mainlandPriceListItem.formattedValue,"value":mainlandPriceListItem.value};}if(mainlandPriceListItem.priceType=="GOLDVIP"){product.mainlandGoldVipPrice={"formattedValue":mainlandPriceListItem.formattedValue,"value":mainlandPriceListItem.value};}if(mainlandPriceListItem.priceType=="DIAMONDVIP"){product.mainlandDiamondVipPrice={"formattedValue":mainlandPriceListItem.formattedValue,"value":mainlandPriceListItem.value};}if(mainlandPriceListItem.priceType=="PLUS"){product.mainlandPlusMemberPrice={"formattedValue":mainlandPriceListItem.formattedValue,"value":mainlandPriceListItem.value};}});}if(_.isString(AlgoliaProductData.promotionTextZh)||_.isString(AlgoliaProductData.promotionTextEn)){product.promotionText=this.localizationFallback(AlgoliaProductData.promotionTextZh,AlgoliaProductData.promotionTextEn);}if(_.isString(AlgoliaProductData.promotionStyle)){product.promotionStyle=AlgoliaProductData.promotionStyle;}if(_.isArray(AlgoliaProductData.labels)){AlgoliaProductData.labels.forEac
6h(function(label){var malldollarAmountValue=ValueUtils.parseNumber(label.amount);if(malldollarAmountValue<0.001){return;}if(label.type=="REBATE"){product.malldollarPercent=label.loyaltyPoint;product.malldollarAmountFormatted="$ "+malldollarAmountValue.toFixed(2);}if(label.type=="FREQREBATE"){product.malldollarPercentFreq=label.loyaltyPoint;product.malldollarAmountFormattedFreq="$ "+malldollarAmountValue.toFixed(2);}if(label.type=="VIPFREQREBATE"){product.malldollarPercentVipFreq=label.loyaltyPoint;product.malldollarAmountFormattedVipFreq="$ "+malldollarAmountValue.toFixed(2);}if(label.type=="GOLDVIPFREQREBATE"){product.malldollarPercentGoldVipFreq=label.loyaltyPoint;product.malldollarAmountFormattedGoldVipFreq="$ "+malldollarAmountValue.toFixed(2);}if(label.type=="DIAMONDVIPREBATE"){product.malldollarPercentDiamondVip=label.loyaltyPoint;product.malldollarAmountFormattedDiamondVip="$ "+malldollarAmountValue.toFixed(2);}if(label.type=="DIAMONDVIPFREQREBATE"){product.malldollarPercentDiamondVipFreq=label.loyaltyPoint;product.malldollarAmountFormattedDiamondVipFreq="$ "+malldollarAmountValue.toFixed(2);}if(label.type=="VIPREBATE"){product.malldollarPercentVip=label.loyaltyPoint;product.malldollarAmountFormattedVip="$ "+malldollarAmountValue.toFixed(2);}if(label.type=="GOLDVIPREBATE"){product.malldollarPercentGoldVip=label.loyaltyPoint;product.malldollarAmountFormattedGoldVip="$ "+malldollarAmountValue.toFixed(2);}});}if(_.isArray(AlgoliaProductData.savedPrice)){AlgoliaProductData.savedPrice.forEach(function(savedPriceObj){if(savedPriceObj.priceType=="DISCOUNT"&&savedPriceObj.value>=0.001){product.discountSavedPriceFormatted=savedPriceObj.formattedValue;}if(savedPriceObj.priceType=="DISCOUNT_FREQ"&&savedPriceObj.value>=0.001){product.freqDiscountSavedPriceFormatted=savedPriceObj.formattedValue;}if(savedPriceObj.membershipLevel=="VIP"&&savedPriceObj.value>=0.001){product.vipSavedPriceFormatted=savedPriceObj.formattedValue;}if(savedPriceObj.membershipLevel=="GOLDVIP"&&savedPriceObj.value>=0.001){product.goldVipSavedPriceFormatted=savedPriceObj.formattedValue;}if(savedPriceObj.membershipLevel=="DIAMONDVIP"&&savedPriceObj.value>=0.001){product.diamondVipSavedPriceFormatted=savedPriceObj.formattedValue;}});}if(_.isObject(AlgoliaProductData.stock)){var _b=AlgoliaProductData.stock,stock=_b===void 0?{}:_b;if(_.isObject(stock.stockLevelStatus)&&_.isString(stock.stockLevelStatus.code)){product.stockLevelStatusCode=stock.stockLevelStatus.code;}}if(_.isObject(AlgoliaProductData.deliveryLabelScheduleCode)||_.isString(AlgoliaProductData.deliveryLabelCode)){product.deliveryLabelCode=this.getScheduledDeliveryLabelCode(AlgoliaProductData);}if(_.isArray(AlgoliaProductData.deliveryLabelScheduleCode)){product.deliveryLabelScheduleCode=AlgoliaProductData.deliveryLabelScheduleCode;}if(_.isString(AlgoliaProductData.salesNumberStringZh)&&hktvCommon.env.currentLanguage!=="en"){product.salesNumberString=AlgoliaProductData.salesNumberStringZh;}else{if(_.isString(AlgoliaProductData.salesNumberStringEn)){product.salesNumberString=AlgoliaProductData.salesNumberStringEn;}}if(_.isString(AlgoliaProductData.mabsRefId)){product.mabsRefId=AlgoliaProductData.mabsRefId;if(_.isString(AlgoliaProductData.mabsAdPosition)){product.mabsAdPosition=AlgoliaProductData.mabsAdPosition;}}if(_.isArray(AlgoliaProductData.marketingLabelUids)){product.marketingLabelUids=AlgoliaProductData.marketingLabelUids;}if(_.isString(AlgoliaProductData.additionalLabel)){product.additionalLabel=AlgoliaProductData.additionalLabel;}if(_.isString(AlgoliaProductData.additionalLabelForPurchasedList)){product.additionalLabelForPurchasedList=AlgoliaProductData.additionalLabelForPurchasedList;}if(_.isString(AlgoliaProductData.sourceId)){product.sourceId=AlgoliaProductData.sourceId;}if(_.isString(AlgoliaProductData.inStorePickUpCheckoutLink)){product.inStorePickUpCheckoutLink=AlgoliaProductData.inStorePickUpCheckoutLink;}if(_.isString(AlgoliaProductData.externalAffiliateRedirectLink)){product.externalAffiliateRedirectLink=AlgoliaProductData.externalAffiliateRedirectLink;}if(_.isString(AlgoliaProductData.displayStoreSquareLogoUrl)){product.displayStoreSquareLogoUrl=AlgoliaProductData.displayStoreSquareLogoUrl;}if(_.isString(AlgoliaProductData.officialWebsiteAffiliateUrl)){product.officialWebsiteAffiliateUrl=AlgoliaProductData.officialWebsiteAffiliateUrl;}if(_.isArray(AlgoliaProductData.deliverableRegions)){product.deliverableRegions=AlgoliaProductData.deliverableRegions;}
6if(_.isArray(AlgoliaProductData.overseasRegionCodes)){product.overseasRegionCodes=AlgoliaProductData.overseasRegionCodes;}if(_.isString(AlgoliaProductData.isThirdPartyLogisticsWarehouse)){product.isThirdPartyLogisticsWarehouse=AlgoliaProductData.isThirdPartyLogisticsWarehouse;}if(_.isString(AlgoliaProductData.isPriorSKU)){product.isPriorSKU=AlgoliaProductData.isPriorSKU;}if(_.isArray(AlgoliaProductData.pickLabelUids)){product.pickLabelUids=AlgoliaProductData.pickLabelUids;}if(_.isArray(AlgoliaProductData.eCoinsRebateSchedule)){product.eCoinsRebateSchedule=AlgoliaProductData.eCoinsRebateSchedule;}if(_.isString(AlgoliaProductData.warehouseStateZh)||_.isString(AlgoliaProductData.warehouseStateEn)){product.warehouseState=this.localizationFallback(AlgoliaProductData.warehouseStateZh,AlgoliaProductData.warehouseStateEn);}if(_.isString(AlgoliaProductData.warehouseCityZh)||_.isString(AlgoliaProductData.warehouseCityEn)){product.warehouseCity=this.localizationFallback(AlgoliaProductData.warehouseCityZh,AlgoliaProductData.warehouseCityEn);}if(_.isString(AlgoliaProductData.deliveryModeCode)){product.deliveryModeCode=AlgoliaProductData.deliveryModeCode;}if(_.isBoolean(AlgoliaProductData.isMainlandSamePrice)){product.isMainlandSamePrice=AlgoliaProductData.isMainlandSamePrice;}if(_.isBoolean(AlgoliaProductData.isGreenLab)){product.isGreenLab=AlgoliaProductData.isGreenLab;}if(_.isString(AlgoliaProductData.expiryDate)){product.expiryDate=AlgoliaProductData.expiryDate;}if(_.isNumber(AlgoliaProductData.expiryDateTs)){product.expiryDateTs=AlgoliaProductData.expiryDateTs;}if(_.isArray(AlgoliaProductData.kaPriceList)){product.kaPriceList=AlgoliaProductData.kaPriceList;}if(_.isObject(AlgoliaProductData.serviceDealOption)){product.serviceDealOption=AlgoliaProductData.serviceDealOption;}if(_.isBoolean(AlgoliaProductData.isExpressDeliverableSku)){product.isExpressDeliverableSku=AlgoliaProductData.isExpressDeliverableSku;}if(_.isBoolean(AlgoliaProductData.isMerchantWetmarketWarehouse)){product.isMerchantWetmarketWarehouse=AlgoliaProductData.isMerchantWetmarketWarehouse;}if(_.isArray(AlgoliaProductData.wetmarketCodeList)){product.wetmarketCodeList=AlgoliaProductData.wetmarketCodeList;}}return product;};ProductData.getScheduledDeliveryLabelCode=function(algoliaProductData){var schedule=algoliaProductData.deliveryLabelScheduleCode==null?[]:algoliaProductData.deliveryLabelScheduleCode;for(var i=0;i<schedule.length;++i){var now=Date.now();var label=schedule[i];if(label.startTime<=now&&now<label.endTime){return label.deliveryMode;}}return algoliaProductData.deliveryLabelCode;};ProductData.parseCommunityProductData=function(referenceData){var product=new ProductData();if(_.isObject(referenceData)){var productData_1=referenceData.product;if(_.isObject(productData_1)){var productName=productData_1.productName;if(typeof productData_1.productName==="undefined"){productName=this.localizationFallback(productData_1.productNameZh,productData_1.productNameEn);}product.name=ValueUtils.parseString(productName);var brandName=productData_1.brandName;if(typeof productData_1.brandName==="undefined"){brandName=this.localizationFallback(productData_1.brandNameZh,productData_1.brandNameEn);}product.brandName=ValueUtils.parseString(brandName);var images=productData_1.images;product.images=ValueUtils.parseArray(images).map(function(image){var url=image.url;return new ProductDataImage(ValueUtils.parseString(url),product.name,image.imageType,image.format);});var mallDollarLabels=productData_1.labels;product.malldollarPercent=null;product.malldollarAmountFormatted=null;product.malldollarPercentFreq=null;product.malldollarAmountFormattedFreq=null;product.malldollarPercentVipFreq=null;product.malldollarAmountFormattedVipFreq=null;product.malldollarPercentGoldVipFreq=null;product.malldollarAmountFormattedGoldVipFreq=null;product.malldollarPercentDiamondVip=null;product.malldollarAmountFormattedDiamondVip=null;product.malldollarPercentDiamondVipFreq=null;product.malldollarAmountFormattedDiamondVipFreq=null;product.malldollarPercentVip=null;product.malldollarAmountFormattedVip=null;product.malldollarPercentGoldVip=null;product.malldollarAmountFormattedGoldVip=null;
6if(_.isArray(mallDollarLabels)){mallDollarLabels.map(function(mallDollarLabel){var _a=ValueUtils.parseObject(mallDollarLabel),rebateType=_a.type,malldollarAmount=_a.amount,malldollarPercent=_a.loyaltyPoint;var malldollarAmountValue=ValueUtils.parseNumber(malldollarAmount);if(malldollarAmountValue<0.001){return;}var formattedMalldollarPercent="$ "+malldollarAmountValue.toFixed(2);switch(rebateType){case"REBATE":product.malldollarPercent=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormatted=formattedMalldollarPercent;break;case"FREQREBATE":product.malldollarPercentFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedFreq=formattedMalldollarPercent;break;case"VIPFREQREBATE":product.malldollarPercentVipFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedVipFreq=formattedMalldollarPercent;break;case"GOLDVIPFREQREBATE":product.malldollarPercentGoldVipFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedGoldVipFreq=formattedMalldollarPercent;break;case"DIAMONDVIPREBATE":product.malldollarPercentDiamondVip=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedDiamondVip=formattedMalldollarPercent;break;case"DIAMONDVIPFREQREBATE":product.malldollarPercentDiamondVipFreq=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedDiamondVipFreq=formattedMalldollarPercent;break;case"VIPREBATE":product.malldollarPercentVip=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedVip=formattedMalldollarPercent;break;case"GOLDVIPREBATE":product.malldollarPercentGoldVip=ValueUtils.parseString(malldollarPercent);product.malldollarAmountFormattedGoldVip=formattedMalldollarPercent;break;default:}});}var priceList=productData_1.priceList;product.buyPrice=new FormattedValuePair();product.discountPrice=new FormattedValuePair();product.freqDiscountPrice=new FormattedValuePair();product.vipPrice=new FormattedValuePair();product.goldVipPrice=new FormattedValuePair();if(_.isArray(priceList)){priceList.map(function(priceItem){var _a=ValueUtils.parseObject(priceItem),priceType=_a.priceType,value=_a.value,formattedValue=_a.formattedValue;var formattedValuePair=new FormattedValuePair(ValueUtils.parseNumber(value),ValueUtils.parseString(formattedValue));switch(priceType){case"BUY":product.buyPrice=formattedValuePair;break;case"DISCOUNT":product.discountPrice=formattedValuePair;break;case"DISCOUNT_FREQ":product.freqDiscountPrice=formattedValuePair;break;case"VIP":product.vipPrice=formattedValuePair;break;case"GOLDVIP":product.goldVipPrice=formattedValuePair;break;default:}});}var storeName=productData_1.storeName;if(typeof productData_1.storeName==="undefined"){storeName=this.localizationFallback(productData_1.storeNameZh,productData_1.storeNameEn);}product.storeName=ValueUtils.parseString(storeName);var url=productData_1.url;product.url=ValueUtils.parseString(url);var promotionText=productData_1.promotionText;if(typeof productData_1.promotionText==="undefined"){promotionText=this.localizationFallback(productData_1.promotionTextZh,productData_1.promotionTextEn);}product.promotionText=ValueUtils.parseString(promotionText);var promotionStyle=productData_1.promotionStyle;product.promotionStyle=ValueUtils.parseString(promotionStyle);var storeType=productData_1.storeType;product.storeType=ValueUtils.parseString(storeType);}var baseProductCode=referenceData.baseProductCode;product.baseProductId=ValueUtils.parseString(baseProductCode);var primaryCategoryCode=referenceData.primaryCategoryCode;product.primaryCatCode=ValueUtils.parseString(primaryCategoryCode);var productRatingMean=referenceData.productRatingMean;product.averageRating=ValueUtils.parseNumber(productRatingMean);var productReviewCount=referenceData.productReviewCount;product.numberOfReviews=ValueUtils.parseInteger(productReviewCount);var storeCode=referenceData.storeCode;product.storeId=ValueUtils.parseString(storeCode);var variantProductCode=referenceData.variantProductCode;product.id=ValueUtils.parseString(variantProductCode);}return product;};ProductData.localizationFallback=function(zh,en){if(hktvCommon.env.currentLanguage!="en"){return zh||en;}return en||zh;};return ProductData;}());var __assign=(this&&this.__assign)||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)){t[p]=s[p];}}}return t;};var ProductBriefDataImage=(function(){function ProductBriefDataImage(){this.alt="";this.url="";}return ProductBriefDataImage;}());var ProductBriefDataPromotionLabel=(function(){function ProductBriefDataPromotionLabel(isPromotionLabelNotClickable){if(isPromotionLabelNotClickable===void 0){isPromotionLabelNotClickable=false;}this.promotionType="";this.promotionCode="";this.promotionShortName="";this.promotionUrl="";this.promotionLabelColor="";this.startTime=null;this.endTime=null;this.isPromotionLabelNotClickable=isPromotionLabelNotClickable;}ProductBriefDataPromotionLabel.parseProductBriefDataPromotionLabel=function(productData,options){if(options===void 0){options={};}var _a=options.isPromotionLabelNotClickable,isPromotionLabelNotClickable=_a===void 0?false:_a,_b=options.hideBMSM,hideBMSM=_b===void 0?false:_b;var promotionLabel=new ProductBriefDataPromotionLabel(isPromotionLabelNotClickable);var promotionType="";var promotionData={};var promotionUrlPrefix;var isBeforeEndTime=true;var isAfterStartTime=true;function getEstimatedServerTimestamp(){var estimatedServerTimestamp=null;var timeDiff;timeDiff=Date.now()-clientInitTime;estimatedServerTimestamp=parseInt(serverTimestamp)+timeDiff;return estimatedServerTimestamp;}if(_.isObject(productData.thresholdPromotion)&&!_.isEmpty(productData.thresholdPromotion)){promotionData=productData.thresholdPromotion;promotionLabel.promotionType="thresholdPromotion";promotionUrlPrefix="promo";promotionLabel.startTime=productData.thresholdPromotion.startTime&&productData.thresholdPromotion.startTime;promotionLabel.endTime=productData.thresholdPromotion.endTime&&productData.thresholdPromotion.endTime;}else{if(_.isObject(productData.multiCategoryPromotion)&&!_.isEmpty(productData.multiCategoryPromotion)){promotionData=productData.multiCategoryPromotion;promotionLabel.promotionType="multiCategoryPromotion";promotionUrlPrefix="promo";promotionLabel.startTime=productData.multiCategoryPromotion.startTime&&productData.multiCategoryPromotion.startTime;promotionLabel.endTime=productData.multiCategoryPromotion.endTime&&productData.multiCategoryPromotion.endTime;}else{if(_.isObject(productData.perfectPartnerPromotion)&&!_.isEmpty(productData.perfectPartnerPromotion)){promotionData=productData.perfectPartnerPromotion;promotionLabel.promotionType="perfectPartnerPromotion";promotionUrlPrefix="exp";promotionLabel.startTime=productData.perfectPartnerPromotion.startTime&&productData.perfectPartnerPromotion.startTime;promotionLabel.endTime=productData.perfectPartnerPromotion.endTime&&productData.perfectPartnerPromotion.endTime;}else{if(_.isObject(productData.bundlePromotion)&&!_.isEmpty(productData.bundlePromotion)){promotionData=productData.bundlePromotion;promotionLabel.promotionType="bundlePromotion";promotionUrlPrefix="abcbundle";promotionLabel.startTime=productData.bundlePromotion.startTime&&productData.bundlePromotion.startTime;promotionLabel.endTime=productData.bundlePromotion.endTime&&productData.bundlePromotion.endTime;}else{if(_.isObject(productData.buyMoreSaveMore)&&!_.isEmpty(productData.buyMoreSaveMore)){promotionLabel.promotionType="buyMoreSaveMore";promotionLabel.startTime=productData.buyMoreSaveMore.startTime&&productData.buyMoreSaveMore.startTime;promotionLabel.endTime=productData.buyMoreSaveMore.endTime&&productData.buyMoreSaveMore.endTime;}}}}}if(typeof serverTimestamp!=="undefined"&&serverTimestamp!=""&&typeof clientInitTime!=="undefined"&&clientInitTime!=""){if(promotionLabel.endTime!=null&&promotionLabel.endTime!=""){isBeforeEndTime=getEstimatedServerTimestamp()<promotionLabel.endTime;}if(promotionLabel.startTime!=null&&promotionLabel.startTime!=""){isAfterStartTime=getEstimatedServerTimestamp()>promotionLabel.startTime;}}if(!hideBMSM&&_.isObject(productData.buyMoreSaveMore)&&!_.isEmpty(productData.buyMoreSaveMore)&&isBeforeEndTime&&isAfterStartTime){promotionLabel.promotionUrl=productData.url;promotionLabel.promotionLabelColor=productData.buyMoreSaveMore.promotionTagColor;promotionLabel.promotionShortName=productData.buyMoreSaveMore.promotionMessage;}if(!hideBMSM&&!_.isEmpty(promotionData)&&isBeforeEndTime&&isAfterStartTime){promotionLabel.promotionCode=promotionData.code;promotionLabel.promotionLabelColor=promotionData.colorCode;promotionLabel.promotionShortName=promotionData.label;promotionLabel.promotionUrl=hktvCommon.addPrefixToHktvUrl("/"+promotionUrlPrefix+"/"+promotionData.code);}return promotionLabel;};return ProductBriefDataPromotionLabel;}());var ProductBriefMalldollarLabel=(function(){function ProductBriefMalldollarLabel(){this.malldollarLabelPercent=null;this.malldollarLabelAmountFormatted=null;this.isVipMalldollar=false;this.isGoldVipMalldollar=false;this.isDiamondVipMalldollar=false;this.rebateDisplayThreshold=null;}ProductBriefMalldollarLabel.parseProductBriefMalldollarLabel=function(productData,options){if(options===void 0){options={};}var malldollarLabel=new ProductBriefMalldollarLabel();var malldollarPercent=productData.malldollarPercent,malldollarAmountFormatted=productData.malldollarAmountFormatted,malldollarPercentFreq=productData.malldollarPercentFreq,malldollarAmountFormattedFreq=productData.malldollarAmountFormattedFreq,malldollarPercentVipFreq=productData.malldollarPercentVipFreq,malldollarAmountFormattedVipFreq=productData.malldollarAmountFormattedVipFreq,malldollarPercentGoldVipFreq=productData.malldollarPercentGoldVipFreq,malldollarAmountFormattedGoldVipFreq=productData.malldollarAmountFormattedGoldVipFreq,malldollarPercentDiamondVip=productData.malldollarPercentDiamondVip,malldollarAmountFormattedDiamondVip=productData.malldollarAmountFormattedDiamondVip,malldollarPercentDiamondVipFreq=productData.malldollarPercentDiamondVipFreq,malldollarAmountFormattedDiamondVipFreq=productData.malldollarAmountFormattedDiamondVipFreq,malldollarPercentVip=productData.malldollarPercentVip,malldollarAmountFormattedVip=productData.malldollarAmountFormattedVip,malldollarPercentGoldVip=productData.malldollarPercentGoldVip,malldollarAmountFormattedGoldVip=productData.malldollarAmountFormattedGoldVip;var userMembershipLevel=hktvCommon.env.userMembershipLevel||"";var dynamicPersonalPriceSkuListData=typeof dynamicPersonalPriceSkuList!=="undefined"?dynamicPersonalPriceSkuList:[];var shouldShowDynamicPersonalPrice=_.isArray(dynamicPersonalPriceSkuListData)&&dynamicPersonalPriceSkuListData.indexOf(productData.id)!==-1;malldollarLabel.rebateDisplayThreshold=typeof rebateDisplayThreshold==="number"?rebateDisplayThreshold:null;if(_.isString(malldollarPercent)&&_.isString(malldollarAmountFormatted)){if
6(userMembershipLevel=="VIP"){if(_.isString(malldollarPercentVip)&&_.isString(malldollarAmountFormattedVip)){if(malldollarPercentVip!=malldollarPercent){malldollarLabel.isVipMalldollar=true;}malldollarLabel.malldollarLabelPercent=malldollarPercentVip;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormattedVip;}else{malldollarLabel.malldollarLabelPercent=malldollarPercent;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormatted;}}else{if(userMembershipLevel=="GOLDVIP"){if(_.isString(malldollarPercentGoldVip)&&_.isString(malldollarAmountFormattedGoldVip)){if(malldollarPercentGoldVip!=malldollarPercent){malldollarLabel.isGoldVipMalldollar=true;}malldollarLabel.malldollarLabelPercent=malldollarPercentGoldVip;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormattedGoldVip;}else{malldollarLabel.malldollarLabelPercent=malldollarPercent;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormatted;}}else{if(userMembershipLevel=="DIAMONDVIP"){if(_.isString(malldollarPercentDiamondVip)&&_.isString(malldollarAmountFormattedDiamondVip)){if(malldollarPercentDiamondVip!=malldollarPercent){malldollarLabel.isDiamondVipMalldollar=true;}malldollarLabel.malldollarLabelPercent=malldollarPercentDiamondVip;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormattedDiamondVip;}else{malldollarLabel.malldollarLabelPercent=malldollarPercent;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormatted;}}else{malldollarLabel.malldollarLabelPercent=malldollarPercent;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormatted;}}}}if(shouldShowDynamicPersonalPrice){if(userMembershipLevel=="DIAMONDVIP"&&_.isString(malldollarPercentDiamondVipFreq)&&_.isString(malldollarAmountFormattedDiamondVipFreq)){malldollarLabel.isVipMalldollar=false;malldollarLabel.isGoldVipMalldollar=false;malldollarLabel.isDiamondVipMalldollar=true;malldollarLabel.malldollarLabelPercent=malldollarPercentDiamondVipFreq;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormattedDiamondVipFreq;}else{if(userMembershipLevel=="GOLDVIP"&&_.isString(malldollarPercentGoldVipFreq)&&_.isString(malldollarAmountFormattedGoldVipFreq)){malldollarLabel.isVipMalldollar=false;malldollarLabel.isGoldVipMalldollar=true;malldollarLabel.isDiamondVipMalldollar=false;malldollarLabel.malldollarLabelPercent=malldollarPercentGoldVipFreq;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormattedGoldVipFreq;}else{if(userMembershipLevel=="VIP"&&_.isString(malldollarPercentVipFreq)&&_.isString(malldollarAmountFormattedVipFreq)){malldollarLabel.isVipMalldollar=true;malldollarLabel.isGoldVipMalldollar=false;malldollarLabel.isDiamondVipMalldollar=false;malldollarLabel.malldollarLabelPercent=malldollarPercentVipFreq;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormattedVipFreq;}else{if(_.isString(malldollarPercentFreq)&&_.isString(malldollarAmountFormattedFreq)){malldollarLabel.isVipMalldollar=false;malldollarLabel.isGoldVipMalldollar=false;malldollarLabel.isDiamondVipMalldollar=false;malldollarLabel.malldollarLabelPercent=malldollarPercentFreq;malldollarLabel.malldollarLabelAmountFormatted=malldollarAmountFormattedFreq;}}}}}return malldollarLabel;};return ProductBriefMalldollarLabel;}());var ProductBriefDataPriceLabel=(function(){function ProductBriefDataPriceLabel(priceRows,showUpLabel,showVipLabel,showGoldVipLabel,showDiamondVipLabel,hidePromotionText){if(priceRows===void 0){priceRows=2;}if(showUpLabel===void 0){showUpLabel=false;}if(showVipLabel===void 0){showVipLabel=false;}if(showGoldVipLabel===void 0){showGoldVipLabel=false;}if(showDiamondVipLabel===void 0){showDiamondVipLabel=false;}if(hidePromotionText===void 0){hidePromotionText=false;}this.promotionalClass={};this.promotionalRow="";this.hidePromotionText=false;this.priceClass={};this.priceRow="";this.upLabel="";this.isVipPrice=false;this.isGoldVipPrice=false;this.isDiamondVipPrice=false;this.showPlusPriceSaved=false;this.hasPlusPrice=false;this.hasMainlandPlusPrice=false;this.isZeroPrice=false;this.plusPrice="";this.showPlusPrice=false;this.plusSavedPrice="";this.hasMainlandPrice=false;this.isExternalProduct=false;this.showPersonalPrice=false;this.hasPersonalPrice=false;this.priceRows=priceRows;this.showUpLabel=showUpLabel;this.showVipLabel=showVipLabel;this.showGoldVipLabel=showGoldVipLabel;this.showDiamondVipLabel=showDiamondVipLabel;this.hidePromotionText=hidePromotionText;}ProductBriefDataPriceLabel.parseProductBriefDataPriceLabel=function(productData,options){if(options===void 0){options={};}var _a=options.priceRows,priceRows=_a===void 0?2:_a,_b=options.showUpLabel,showUpLabel=_b===void 0?false:_b,_c=options.showVipLabel,showVipLabel=_c===void 0?false:_c,_d=options.showGoldVipLabel,showGoldVipLabel=_d===void 0?false:_d,_e=options.showDiamondVipLabel,showDiamondVipLabel=_e===void 0?false:_e,_f=options.hidePromotionText,hidePromotionText=_f===void 0?false:_f,_g=options.personalPrice,personalPrice=_g===void 0?[]:_g;var priceLabel=new ProductBriefDataPriceLabel(priceRows,showUpLabel,showVipLabel,showGoldVipLabel,showDiamondVipLabel,hidePromotionText);var promotionText="";var promotionStyle="";var isExternalProduct=(productData.externalAffiliateRedirectLink||productData.officialWebsiteAffiliateUrl).length>0;if(_.isString(productData.promotionText)){promotionText=productData.promotionText;}if(_.isString(productData.promotionStyle)){promotionStyle=productData.promotionStyle.toLowerCase();}var buyPrice="";var discountPrice="";var mainlandBuyPrice="";var mainlandDiscountPrice="";var isZeroPrice=false;var userMembershipLevel=hktvCommon.env.userMembershipLevel||"";var plusSavedPrice;buyPrice=productData.buyPrice.formattedValue;if(!_.isNull(productData.buyPrice.value)&&productData.buyPrice.value<0.001){isZeroPrice=true;}discountPrice=productData.discountPrice.formattedValue;if(!_.isNull(productData.discountPrice.value)&&productData.discountPrice.value<0.001){isZeroPrice=true;}var discountPriceValue=productData.discountPrice.value;mainlandBuyPrice=productData.mainlandBuyPrice.formattedValue;if(!_.isNull(productData.mainlandBuyPrice.value)&&productData.mainlandBuyPrice.value<0.001){isZeroPrice=true;}mainlandDiscountPrice=productData.mainlandDiscountPrice.formattedValue;if(!_.isNull(productData.mainlandDiscountPrice.value)&&productData.mainlandDiscountPrice.value<0.001){isZeroPrice=true;}var mainlandDiscountPriceValue=productData.mainlandDiscountPrice.value;var dynamicPersonalPriceSkuListData=typeof dynamicPersonalPriceSkuList!=="undefined"?dynamicPersonalPriceSkuList:[];var shouldShowDynamicPersonalPrice=_.isArray(dynamicPersonalPriceSkuListData)&&dynamicPersonalPriceSkuListData.indexOf(productData.id)!==-1;if(shouldShowDynamicPersonalPrice){if(!_.isNull(productData.freqDiscountPrice.value)){discountPrice=productData.freqDiscountPrice.formattedValue;discountPriceValue=productData.freqDiscountPrice.value;if(productData.freqDiscountPrice.value<0.001){isZeroPrice=true;}}if(!_.isNull(productData.mainlandFreqDiscountPrice.value)){mainlandDiscountPrice=productData.mainlandFreqDiscountPrice.formattedValue;mainlandDiscountPriceValue=productData.mainlandFreqDiscountPrice.value;if(productData.mainlandFreqDiscountPrice.value<0.001){isZeroPrice=true;}}}var isVipPrice=false;var isMainlandVipPrice=false;if(userMembershipLevel=="VIP"){if(!_.isNull(productData.vipPrice.value)){isVipPrice=true;discountPrice=productData.vipPrice.formattedValue;if(!_.isNull(productData.vipPrice.value)&&productData.vipPrice.value<0.001){isZeroPrice=true;}}if(!_.isNull(productData.mainlandVipPrice.value)){isMainlandVipPrice=true;mainlandDiscountPrice=productData.mainlandVipPrice.formattedValue;if(!_.isNull(productData.mainlandVipPrice.value)&&productData.mainlandVipPrice.value<0.001){isZeroPrice=true;}}}var isGoldVipPrice=false;var isMainlandGoldVipPrice=false;if(userMembershipLevel=="GOLDVIP"){if(!_.isNull(productData.goldVipPrice.value)){isGoldVipPrice=true;discountPrice=productData.goldVipPrice.formattedValue;if(!_.isNull(productData.goldVipPrice.value)&&productData.goldVipPrice.value<0.001){isZeroPrice=true;}}if(!_.isNull(productData.mainlandGoldVipPrice.value)){isMainlandGoldVipPrice=true;mainlandDiscountPrice=productData.mainlandGoldVipPrice.formattedValue;if(!_.isNull(productData.mainlandGoldVipPrice.value)&&productData.mainlandGoldVipPrice.value<0.001){isZeroPrice=true;}}}var isDiamondVipPrice=false;var isMainlandDiamondVipPrice=false;if(userMembershipLevel=="DIAMONDVIP"){if(!_.isNull(productData.diamondVipPrice.value)){isDiamondVipPrice=true;discountPrice=productData.diamondVipPrice.formattedValue;if(!_.isNull(productData.diamondVipPrice.value)&&productData.diamondVipPrice.value<0.001){isZeroPrice=true;}}if(!_.isNull(productData.mainlandDiamondVipPrice.value)){isMainlandDiamondVipPrice=true;mainlandDiscountPrice=productData.mainlandDiamondVipPrice.formattedValue;if(!_.isNull(productData.mainlandDiamondVipPrice.value)&&productData.mainlandDiamondVipPrice.value<0.001){isZeroPrice=true;}}}var hasPlusPrice=false;var plusPrice;if(!_.isNull(productData.plusMemberPrice.value)){hasPlusPrice=true;plusPrice=productData.plusMemberPrice.formattedValue;if(!_.isNull(productData.plusMemberPrice.value)&&productData.plusMemberPrice.value<0.001){isZeroPrice=true;}}var hasPersonalPrice=false;var personalPriceDisplay;var personalPriceValue;var personalPriceType;var personalPricePercentage=null;if(_.isArray(personalPrice)){var filteredPersonalPrice=personalPrice.filter(function(ele){return ele.skuCode===productData.id;});if(!_.isEmpty(filteredPersonalPrice)){hasPersonalPrice=true;personalPriceDisplay=filteredPersonalPrice[0].price.formattedValue;personalPriceValue=filteredPersonalPrice[0].price.value;personalPriceType=filteredPersonalPrice[0].price.priceType;personalPricePercentage=filteredPersonalPrice[0].percentage;if(!_.isNull(personalPriceValue)&&personalPriceValue<0.001){isZeroPrice=true;}}}var hasMainlandPlusPrice=false;var mainlandPlusPrice;if(!_.isNull(productData.mainlandPlusMemberPrice.value)){hasMainlandPlusPrice=true;mainlandPlusPrice=productData.mainlandPlusMemberPrice.formattedValue;if(!_.isNull(productData.mainlandPlusMemberPrice.value)&&productData.mainlandPlusMemberPrice.value<0.001){isZeroPrice=true;}}var priceRow="";var priceValue="";var priceClass={"discount":false,"vip":false,"goldvip":false,"diamondvip":false,"plusmember":false,"mainlandPrice":false,"personal":false};var promotionalRow="";var promotionalClass={};var vipPrice=productData.vipPrice,goldVipPrice=productData.goldVipPrice,diamondVipPrice=productData.diamondVipPrice,plusMemberPrice=productData.plusMemberPrice;
6function isNotVipPrice(){return !isVipPrice&&!isGoldVipPrice&&!isDiamondVipPrice;}function isOnlyDiamondVipPrice(){return !isVipPrice&&!isGoldVipPrice&&isDiamondVipPrice;}function isOnlyGoldVipPrice(){return !isVipPrice&&isGoldVipPrice&&!isDiamondVipPrice;}if(!buyPrice){}else{if(isZeroPrice){priceRow=isExternalProduct?"":hktvCommon.stringResources.general.productDetailNotForSale;}else{if(priceRows==1){if(!discountPrice||discountPrice==buyPrice){priceRow=buyPrice;priceValue=productData.buyPrice.value;plusSavedPrice=productData.buyPrice.value-plusMemberPrice.value;}else{if(isNotVipPrice()){priceRow=discountPrice;priceClass.discount=true;priceValue=discountPriceValue;plusSavedPrice=discountPriceValue-plusMemberPrice.value;}else{if(isOnlyDiamondVipPrice()){priceRow=discountPrice;priceClass.discount=true;priceClass.diamondvip=true;priceValue=diamondVipPrice.value;plusSavedPrice=diamondVipPrice.value-plusMemberPrice.value;}else{if(isOnlyGoldVipPrice()){priceRow=discountPrice;priceClass.discount=true;priceClass.goldvip=true;priceValue=goldVipPrice.value;plusSavedPrice=goldVipPrice.value-plusMemberPrice.value;}else{priceRow=discountPrice;priceClass.discount=true;priceClass.vip=true;priceValue=vipPrice.value;plusSavedPrice=vipPrice.value-plusMemberPrice.value;}}}}}else{if(hidePromotionText||!promotionText){if(!discountPrice||discountPrice==buyPrice){priceRow=buyPrice;priceValue=productData.buyPrice.value;plusSavedPrice=productData.buyPrice.value-plusMemberPrice.value;}else{if(isNotVipPrice()){promotionalRow=buyPrice;priceRow=discountPrice;priceClass.discount=true;priceValue=discountPriceValue;plusSavedPrice=discountPriceValue-plusMemberPrice.value;}else{if(isOnlyDiamondVipPrice()){promotionalRow=buyPrice;priceRow=discountPrice;priceClass.discount=true;priceClass.diamondvip=true;priceValue=diamondVipPrice.value;plusSavedPrice=diamondVipPrice.value-plusMemberPrice.value;}else{if(isOnlyGoldVipPrice()){promotionalRow=buyPrice;priceRow=discountPrice;priceClass.discount=true;priceClass.goldvip=true;priceValue=goldVipPrice.value;plusSavedPrice=goldVipPrice.value-plusMemberPrice.value;}else{promotionalRow=buyPrice;priceRow=discountPrice;priceClass.discount=true;priceClass.vip=true;priceValue=vipPrice.value;plusSavedPrice=vipPrice.value-plusMemberPrice.value;}}}}}else{promotionalRow=promotionText;promotionalClass[promotionStyle]=true;priceClass.discount=true;if(!discountPrice){priceRow=buyPrice;priceValue=productData.buyPrice.value;plusSavedPrice=productData.buyPrice.value-plusMemberPrice.value;}else{if(isNotVipPrice()){priceRow=discountPrice;priceValue=discountPriceValue;plusSavedPrice=discountPriceValue-plusMemberPrice.value;}else{if(isOnlyDiamondVipPrice()){priceRow=discountPrice;priceClass.diamondvip=true;priceValue=diamondVipPrice.value;plusSavedPrice=diamondVipPrice.value-plusMemberPrice.value;}else{if(isOnlyGoldVipPrice()){priceRow=discountPrice;priceClass.goldvip=true;priceValue=goldVipPrice.value;plusSavedPrice=goldVipPrice.value-plusMemberPrice.value;}else{priceRow=discountPrice;priceClass.vip=true;priceValue=vipPrice.value;plusSavedPrice=vipPrice.value-plusMemberPrice.value;}}}}}}}}var priceClassAfterNewPromotion=null;var isPlusMember=hktvCommon.env.plusMembershipLevel=="PLUS";var isMfood=hktvCommon.env.zone=="mfood";var isCTM=hktvCommon.env.zone=="ctm";var showPlusPriceSaved=isPlusMember&&hasPlusPrice&&plusSavedPrice>0;var showPlusPrice=false;if(isPlusMember&&hasPlusPrice&&!isMfood&&!isCTM){promotionalRow=priceRow;promotionalClass=priceClass;priceRow=plusMemberPrice.formattedValue;priceClassAfterNewPromotion="discount plusmember";priceValue=plusMemberPrice.value;showPlusPrice=true;priceLabel.plusSavedPrice="$ "+plusSavedPrice.toFixed(2);}var hasMainlandPrice=false;if(hasMainlandPrice){priceClass.mainlandPrice=true;priceClass.discount=false;priceClass.vip=false;priceClass.goldvip=false;priceClass.diamondvip=false;isVipPrice=false;isGoldVipPrice=false;isDiamondVipPrice=false;if(mainlandDiscountPrice==""||mainlandDiscountPrice==mainlandBuyPrice){priceClass.discount=false;plusSavedPrice=productData.mainlandBuyPrice.value-productData.mainlandPlusMemberPrice.value;}else{if(!isMainlandVipPrice&&!isMainlandGoldVipPrice&&!isMainlandDiamondVipPrice){priceClass.discount=true;plusSavedPrice=mainlandDiscountPriceValue-productData.mainlandPlusMemberPrice.value;}else{if(!isMainlandVipPrice&&!isMainlandGoldVipPrice&&isMainlandDiamondVipPrice){priceClass.discount=true;priceClass.diamondvip=true;isDiamondVipPrice=isMainlandDiamondVipPrice;plusSavedPrice=productData.mainlandDiamondVipPrice.value-productData.mainlandPlusMemberPrice.value;}else{if(!isMainlandVipPrice&&isMainlandGoldVipPrice&&!isMainlandDiamondVipPrice){priceClass.discount=true;priceClass.goldvip=true;isGoldVipPrice=isMainlandGoldVipPrice;plusSavedPrice=productData.mainlandGoldVipPrice.value-productData.mainlandPlusMemberPrice.value;}else{priceClass.discount=true;priceClass.vip=true;isVipPrice=isMainlandVipPrice;plusSavedPrice=productData.mainlandVipPrice.value-productData.mainlandPlusMemberPrice.value;}}}}promotionalRow=priceRow;promotionalClass=priceClass;priceRow=mainlandDiscountPrice;if(mainlandDiscountPrice==""||mainlandDiscountPrice==mainlandBuyPrice){priceRow=mainlandBuyPrice;}if(isPlusMember&&hasPlusPrice&&!_.isNull(plusPrice)){if(!_.isNull(priceClassAfterNewPromotion)){priceClassAfterNewPromotion=priceClass;}promotionalRow=plusPrice;}if(isPlusMember&&hasMainlandPlusPrice&&!_.isNull(mainlandPlusPrice)){promotionalClass="discount mainlandPrice";priceClass.plusmember=true;showPlusPrice=true;priceRow=mainlandPlusPrice;priceLabel.plusSavedPrice="\u00A5 "+plusSavedPrice.toFixed(2);}}var showPersonalPrice=false;if(hasPersonalPrice&&!hasMainlandPrice&&priceValue!==""&&!_.isNull(personalPriceValue)){var originalUnitPrice=Number(priceValue);var effectivePersonalPriceValue=Math.min(originalUnitPrice,Number(personalPriceValue));if(!_.isNull(personalPricePercentage)&&personalPricePercentage!==undefined){var percentageBaseUnitPrice=showPlusPrice?(Number(discountPriceValue)>0?Number(discountPriceValue):Number(productData.buyPrice.value)):originalUnitPrice;effectivePersonalPriceValue=Math.min(effectivePersonalPriceValue,percentageBaseUnitPrice*personalPricePercentage);}if(effectivePersonalPriceValue<=originalUnitPrice){promotionalRow=priceRow;promotionalClass=priceClassAfterNewPromotion?priceClassAfterNewPromotion:priceClass;priceClassAfterNewPromotion="discount personal";personalPriceValue=effectivePersonalPriceValue;personalPriceDisplay="$ "+effectivePersonalPriceValue.toFixed(2);priceRow=personalPriceDisplay;showPersonalPrice=true;if(showPlusPrice){showPlusPrice=false;}}}if(showPersonalPrice||showPlusPrice||(isPlusMember&&hasMainlandPlusPrice)){isVipPrice=false;isGoldVipPrice=false;isDiamondVipPrice=false;if(hasMainlandPrice){showPersonalPrice=false;}}priceLabel.isZeroPrice=isZeroPrice;priceLabel.promotionalClass=promotionalClass;priceLabel.promotionalRow=promotionalRow;priceLabel.priceClass=priceClassAfterNewPromotion?priceClassAfterNewPromotion:priceClass;priceLabel.priceRow=priceRow;priceLabel.upLabel=hktvCommon.stringResources.general.upLabel;priceLabel.isVipPrice=isVipPrice;priceLabel.isGoldVipPrice=isGoldVipPrice;priceLabel.isDiamondVipPrice=isDiamondVipPrice;priceLabel.showPlusPriceSaved=showPlusPriceSaved;priceLabel.showPlusPrice=isPlusMember&&showPlusPrice;priceLabel.hasPlusPrice=hasPlusPrice;priceLabel.hasMainlandPlusPrice=hasMainlandPlusPrice;priceLabel.plusPrice=isPlusMember?(hasMainlandPlusPrice&&hasMainlandPrice?mainlandPlusPrice:plusPrice):undefined;priceLabel.hasMainlandPrice=hasMainlandPrice;priceLabel.isExternalProduct=isExternalProduct;priceLabel.showPersonalPrice=showPersonalPrice;priceLabel.hasPersonalPrice=hasPersonalPrice;return priceLabel;};return ProductBriefDataPriceLabel;}());var ProductBriefListOption=(function(){function ProductBriefListOption(_a){var _b=_a.template,template=_b===void 0?"":_b,_c=_a.zone,zone
6=_c===void 0?"":_c,_d=_a.colorTheme,colorTheme=_d===void 0?"":_d,_e=_a.hideMalldollarPrecent,hideMalldollarPrecent=_e===void 0?false:_e,_f=_a.hidePromotionLabel,hidePromotionLabel=_f===void 0?false:_f,_g=_a.hideProductSurface,hideProductSurface=_g===void 0?false:_g,_h=_a.hidePriceLabel,hidePriceLabel=_h===void 0?false:_h,_j=_a.hideBriefButton,hideBriefButton=_j===void 0?false:_j,_k=_a.isStaySamePage,isStaySamePage=_k===void 0?false:_k,_l=_a.showStoreName,showStoreName=_l===void 0?false:_l,_m=_a.showMalldollarPrecentCaption,showMalldollarPrecentCaption=_m===void 0?false:_m,_o=_a.hidePriceDropdown,hidePriceDropdown=_o===void 0?false:_o,_p=_a.showDeliveryLabel,showDeliveryLabel=_p===void 0?false:_p,_q=_a.showDeliveryRegionLabel,showDeliveryRegionLabel=_q===void 0?false:_q,_r=_a.showSalesNumber,showSalesNumber=_r===void 0?false:_r,_s=_a.isShopinshopHotpicksForApps,isShopinshopHotpicksForApps=_s===void 0?false:_s,_t=_a.isShopinshopStorePickListsForApps,isShopinshopStorePickListsForApps=_t===void 0?false:_t,_u=_a.hidePlusPriceSection,hidePlusPriceSection=_u===void 0?false:_u,_v=_a.hidePlusPriceUnlockBtn,hidePlusPriceUnlockBtn=_v===void 0?false:_v,_w=_a.personalPrice,personalPrice=_w===void 0?{}:_w,_x=_a.hideMainlandShippingTag,hideMainlandShippingTag=_x===void 0?false:_x,_y=_a.hideMainlandSamePriceTag,hideMainlandSamePriceTag=_y===void 0?false:_y,_z=_a.hideMainlandStoreName,hideMainlandStoreName=_z===void 0?false:_z,_0=_a.showGreenLab,showGreenLab=_0===void 0?false:_0;this.template=template;this.zone=zone;this.colorTheme=colorTheme;this.hideMalldollarPrecent=hideMalldollarPrecent;this.hidePromotionLabel=hidePromotionLabel;this.hideProductSurface=hideProductSurface;this.hidePriceLabel=hidePriceLabel;this.hideBriefButton=hideBriefButton;this.isStaySamePage=isStaySamePage;this.showStoreName=showStoreName;this.showMalldollarPrecentCaption=showMalldollarPrecentCaption;this.hidePriceDropdown=hidePriceDropdown;this.showDeliveryLabel=showDeliveryLabel;this.showDeliveryRegionLabel=showDeliveryRegionLabel;this.showSalesNumber=showSalesNumber;this.isShopinshopHotpicksForApps=isShopinshopHotpicksForApps;this.isShopinshopStorePickListsForApps=isShopinshopStorePickListsForApps;this.hidePlusPriceSection=hidePlusPriceSection;this.hidePlusPriceUnlockBtn=hidePlusPriceUnlockBtn;this.personalPrice=personalPrice;this.hideMainlandShippingTag=hideMainlandShippingTag;this.hideMainlandSamePriceTag=hideMainlandSamePriceTag;this.hideMainlandStoreName=hideMainlandStoreName;this.showGreenLab=showGreenLab;if(this.template=="mobile"){this.isStaySamePage=true;this.showMalldollarPrecentCaption=true;this.hidePriceDropdown=true;}}return ProductBriefListOption;}());var ProductBriefListData=(function(){function ProductBriefListData(options,productBriefList,trackingListName,moduleName){if(options===void 0){options={};}if(productBriefList===void 0){productBriefList=[];}this.options=new ProductBriefListOption(options);this.productBriefList=productBriefList;this.trackingListName=trackingListName;this.moduleName=moduleName;}ProductBriefListData.parseSfpiProductListData=function(sfpiProductListData,options){if(sfpiProductListData===void 0){sfpiProductListData=[];}if(options===void 0){options={};}var productBriefListData=new ProductBriefListData(options);if(_.isArray(sfpiProductListData)){sfpiProductListData.forEach(function(sfpiProductData){var productData=ProductData.parseSfpiProductData(sfpiProductData);var productBriefData=ProductBriefData.parseProductBriefData(productData,options);productBriefListData.productBriefList.push(productBriefData);});}return productBriefListData;};ProductBriefListData.parseSolrProductListData=function(productDataList,options,advertisingProducts,pagination,trackListName,moduleName){if(options===void 0){options={};}var productBriefListData=new ProductBriefListData(options);var filteredList=productDataList;var isMnMPromotion=productDataList.every(function(ele){return ele.thresholdPromotion&&(ele.thresholdPromotion.thresholdType=="AMOUNT"||ele.thresholdPromotion.thresholdType=="QUANTITY");});var isMultiCatPromotion=productDataList.every(function(ele){return ele.multiCategoryPromotion&&(ele.multiCategoryPromotion.thresholdType=="AMOUNT"||ele.multiCategoryPromotion.thresholdType=="QUANTITY");});if((isMultiCatPromotion||isMnMPromotion)&&productBriefListData.options.personalPrice.length>0){var personalPriceSkuCodeList_1=productBriefListData.options.personalPrice.map(function(ele){return ele.skuCode;});filteredList=filteredList.filter(function(ele){return !personalPriceSkuCodeList_1.includes(ele.code);});}if(_.isArray(filteredList)){filteredList.forEach(function(productDataElement){var productData=ProductData.parseHybrisProductData(productDataElement);var productBriefData=ProductBriefData.parseProductBriefData(productData,options);productBriefListData.productBriefList.push(productBriefData);});}if(_.isArray(advertisingProducts)&&advertisingProducts.length&&_.isArray(filteredList)&&filteredList.length&&typeof thisJSP!="undefined"&&thisJSP=="searchResult"){var pageSize_1=pagination.pageSize||99999;var currentPage=pagination.currentPage||0;var startingIndex_1=currentPage*pageSize_1;var isLastPage_1=currentPage+1===pagination.numberOfPages;var adsCountAddedThisPage_1=0;var compareObj_1={};var advertisingProductsFilterd=advertisingProducts.reverse().filter(function(e,i){if(compareObj_1[e.position]){return false;}else{compareObj_1[e.position]=true;return true;}}
6).sort(function(a,b){return a.position-b.position;});advertisingProductsFilterd.forEach(function(e,i){var numberOfAdsBeforeCurrent=i;var pos=e.position;if(pos>=startingIndex_1+numberOfAdsBeforeCurrent-adsCountAddedThisPage_1&&(pos<startingIndex_1+pageSize_1+numberOfAdsBeforeCurrent||isLastPage_1)){var productData_1=ProductData.parseHybrisProductData(e.product);var productBriefData=ProductBriefData.parseProductBriefData(productData_1,__assign({},options,{imageType:"PRIMARY",format:"product"}));productBriefData.mabsRefId=e.mabsRefId;productBriefData.mabsAdPosition=pos;productBriefListData.productBriefList.splice(pos-(startingIndex_1+numberOfAdsBeforeCurrent-adsCountAddedThisPage_1),0,productBriefData);adsCountAddedThisPage_1++;}});}productBriefListData.trackingListName=trackListName||"";productBriefListData.moduleName=moduleName||"";return productBriefListData;};ProductBriefListData.parseOpenSearchProductListData=function(productDataList,options,advertisingProducts,pagination){if(options===void 0){options={};}var productBriefListData=new ProductBriefListData(options);if(_.isArray(productDataList)){productDataList.forEach(function(productDataElement){var productData=ProductData.parseHybrisProductData(productDataElement);var productBriefData=ProductBriefData.parseProductBriefData(productData,options);productBriefListData.productBriefList.push(productBriefData);});}if(_.isArray(advertisingProducts)&&advertisingProducts.length&&_.isArray(productDataList)&&productDataList.length&&typeof thisJSP!="undefined"&&thisJSP=="searchResult"){var pageSize_2=pagination.pageSize||99999;var currentPage=pagination.currentPage||0;var startingIndex_2=currentPage*pageSize_2;var isLastPage_2=currentPage+1===pagination.numberOfPages;var adsCountAddedThisPage_2=0;var compareObj_2={};var advertisingProductsFilterd=advertisingProducts.reverse().filter(function(e,i){if(compareObj_2[e.position]){return false;}else{compareObj_2[e.position]=true;return true;}}).sort(function(a,b){return a.position-b.position;});advertisingProductsFilterd.forEach(function(e,i){var numberOfAdsBeforeCurrent=i;var pos=e.position;if(pos>=startingIndex_2+numberOfAdsBeforeCurrent-adsCountAddedThisPage_2&&(pos<startingIndex_2+pageSize_2+numberOfAdsBeforeCurrent||isLastPage_2)){var productData_2=ProductData.parseHybrisProductData(e.product);var productBriefData=ProductBriefData.parseProductBriefData(productData_2,__assign({},options,{imageType:"PRIMARY",format:"product"}));productBriefData.mabsRefId=e.mabsRefId;productBriefData.mabsAdPosition=pos;productBriefListData.productBriefList.splice(pos-(startingIndex_2+numberOfAdsBeforeCurrent-adsCountAddedThisPage_2),0,productBriefData);adsCountAddedThisPage_2++;}});}return productBriefListData;};ProductBriefListData.parseAlgoliaProductListData=function(algoliaProductListData,options,trackingListName,moduleName){if(algoliaProductListData===void 0){algoliaProductListData=[];}if(options===void 0){options={};}var productBriefListData=new ProductBriefListData(options);if(_.isArray(algoliaProductListData)){algoliaProductListData.forEach(function(algoliaProductData){var productData=ProductData.parseAlgoliaProductData(algoliaProductData);var productBriefData=ProductBriefData.parseProductBriefData(productData,options);productBriefListData.productBriefList.push(productBriefData);});}productBriefListData.trackingListName=trackingListName||"";productBriefListData.moduleName=moduleName||"";return productBriefListData;};return ProductBriefListData;}());var ProductBriefData=(function(){function ProductBriefData(_a){var _b=_a.isCheckVariant,isCheckVariant=_b===void 0?true:_b;this.id="";this.baseProductId="";this.objectID="";this.queryID="";this.url="";this.image=new ProductBriefDataImage();this.videoThumbnailUrl="";this.name="";this.brandName="";this.buyMoreSaveMore={};this.brandProductName="";this.packingSpec="";this.primaryCatCode="";this.averageRating=0;this.numberOfVariants=1;this.numberOfReviews=0;this.priceLabel={};this.isVipSavedPrice=false;this.isGoldVipSavedPrice=false;this.isDiamondVipSavedPrice=false;this.promotionLabel={};this.malldollarLabel={};this.storeName="";this.storeType="";this.storeId="";this.storeIdOrig="";this.stockStatus="";this.priceUpdatedDate="";this.deliveryLabelCode="";this.deliveryLabelScheduleCode=null;this.salesNumberString="";this.mabsRefId="";this.mabsAdPosition=null;this.specialAddCartFlowLink="";this.advMabsRefId="";this.advmabsAdPosition=null;this.additionalLabel="";this.additionalLabelForPurchasedList="";this.sourceId="";this.inStorePickUpCheckoutLink="";this.externalAffiliateRedirectLink="";this.displayStoreSquareLogoUrl="";this.officialWebsiteAffiliateUrl="";
6this.overseasRegionCodes=[];this.isThirdPartyLogisticsWarehouse="";this.isPriorSKU="";this.pickLabelUids=[];this.eCoinsRebateSchedule=[];this.showEcoins=false;this.isMainlandSamePrice=false;this.warehouseState="";this.warehouseCity="";this.deliveryModeCode="";this.isGreenLab=false;this.expiryDate="";this.expiryDateTs=null;this.greenLabData=null;this.kaPriceList=[];this.mappedKaPrice={};this.showKaPrice=false;this.serviceDealOption={};this.isExpressDeliverableSku=false;this.isMerchantWetmarketWarehouse=false;this.wetmarketCodeList=[];this.marketingLabelUids=[];this.isCheckVariant=isCheckVariant;}ProductBriefData.parseProductBriefData=function(productData,options){if(options===void 0){options={};}var productBriefData=new ProductBriefData(options);if(_.isObject(productData)){if(_.isString(productData.id)){productBriefData.id=productData.id;}if(_.isString(productData.baseProductId)){productBriefData.baseProductId=productData.baseProductId;}if(_.isString(productData.objectID)){productBriefData.objectID=productData.objectID;}if(_.isString(productData.queryID)){productBriefData.queryID=productData.queryID;}if(_.isString(productData.url)){productBriefData.url=productData.url;}if(_.isString(productData.brandName)){productBriefData.brandName=productData.brandName;}if(_.isString(productData.name)){productBriefData.name=productData.name;productBriefData.brandProductName=(productBriefData.brandName?productBriefData.brandName+" - ":"")+productBriefData.name;}if(_.isObject(productData.buyMoreSaveMore)){productBriefData.buyMoreSaveMore=productData.buyMoreSaveMore;}if(_.isString(productData.packingSpec)){productBriefData.packingSpec=productData.packingSpec;}if(_.isString(productData.specialAddCartFlowLink)){productBriefData.specialAddCartFlowLink=productData.specialAddCartFlowLink;}if(_.isString(productData.inStorePickUpCheckoutLink)){productBriefData.inStorePickUpCheckoutLink=productData.inStorePickUpCheckoutLink;}if(_.isString(productData.externalAffiliateRedirectLink)){productBriefData.externalAffiliateRedirectLink=productData.externalAffiliateRedirectLink;}if(_.isString(productData.displayStoreSquareLogoUrl)){productBriefData.displayStoreSquareLogoUrl=productData.displayStoreSquareLogoUrl;}if(_.isString(productData.officialWebsiteAffiliateUrl)){productBriefData.officialWebsiteAffiliateUrl=productData.officialWebsiteAffiliateUrl;}if(_.isString(productData.salesNumberString)){productBriefData.salesNumberString=productData.salesNumberString;}if(_.isString(productData.primaryCatCode)){productBriefData.primaryCatCode=productData.primaryCatCode;}if(_.isNumber(productData.averageRating)){productBriefData.averageRating=productData.averageRating;}if(_.isNumber(productData.numberOfReviews)){productBriefData.numberOfReviews=productData.numberOfReviews;}if(_.isObject(productData.buyPrice)){productBriefData.priceLabel=ProductBriefDataPriceLabel.parseProductBriefDataPriceLabel(productData,options);}if(_.isString(productData.discountSavedPriceFormatted)){productBriefData.savedPriceFormatted=productData.discountSavedPriceFormatted;var userMembershipLevel=hktvCommon.env.userMembershipLevel||"";if(userMembershipLevel=="VIP"&&_.isString(productData.vipSavedPriceFormatted)&&!_.isEmpty(productData.vipSavedPriceFormatted)){productBriefData.savedPriceFormatted=productData.vipSavedPriceFormatted;productBriefData.isVipSavedPrice=true;}if(userMembershipLevel=="GOLDVIP"&&_.isString(productData.goldVipSavedPriceFormatted)&&!_.isEmpty(productData.goldVipSavedPriceFormatted)){productBriefData.savedPriceFormatted=productData.goldVipSavedPriceFormatted;productBriefData.isGoldVipSavedPrice=true;}if(userMembershipLevel=="DIAMONDVIP"&&_.isString(productData.diamondVipSavedPriceFormatted)&&!_.isEmpty(productData.diamondVipSavedPriceFormatted)){productBriefData.savedPriceFormatted=productData.diamondVipSavedPriceFormatted;productBriefData.isDiamondVipSavedPrice=true;}var dynamicPersonalPriceSkuListData=typeof dynamicPersonalPriceSkuList!=="undefined"?dynamicPersonalPriceSkuList:[];var shouldShowDynamicPersonalPrice=_.isArray(dynamicPersonalPriceSkuListData)&&dynamicPersonalPriceSkuListData.indexOf(productData.id)!==-1;if(shouldShowDynamicPersonalPrice&&_.isObject(productData.freqDiscountPrice)&&!_.isNull(productData.freqDiscountPrice.value)&&_.isString(productData.freqDiscountSavedPriceFormatted)&&!_.isEmpty(productData.freqDiscountSavedPriceFormatted)){productBriefData.savedPriceFormatted=productData.freqDiscountSavedPriceFormatted;}if(productBriefData.priceLabel.hasMainlandPrice===true){productBriefData.savedPriceFormatted=null;productBriefData.isVipSavedPrice=false;productBriefData.isGoldVipSavedPrice=false;productBriefData.isDiamondVipSavedPrice=false;}}if(_.isString(productData.storeName)){productBriefData.storeName=productData.storeName;}if(_.isString(productData.storeType)){productBriefData.storeType=productData.storeType;}if(_.isString(productData.storeId)){productBriefData.storeId=productData.storeId;}if(_.isString(productData.storeIdOrig)){productBriefData.storeIdOrig=productData.storeIdOrig;}if(_.isString(productData.malldollarPercent)||_.isString(productData.malldollarPercentFreq)){productBriefData.malldollarLabel=ProductBriefMalldollarLabel.parseProductBriefMalldollarLabel(productData,options);}if(_.isArray(productData.images)){if(_.isObject(productData.images[0])&&_.isString(productData.images[0].url)){productBriefData.image={"alt":_.isString(productData.images[0].alt)?productData.images[0].alt:"","url":productData.images[0].url};}if(options.imageType&&options.format){for(var i=0;i<productData.images.length;i++){if(productData.images[i].imageType===options.imageType&&productData.images[i].format===options.format){productBriefData.image={"alt":_.isString(productData.images[i].alt)?productData.images[i].alt:"","url":productData.images[i].url};break;}}}}if(_.isString(productData.videoThumbnailUrl)){productBriefData.videoThumbnailUrl=productData.videoThumbnailUrl;}productBriefData.promotionLabel=ProductBriefDataPromotionLabel.parseProductBriefDataPromotionLabel(productData,options);var numberOfVariants=1,purchaseOption=0,stockLevelStatusCode="";if(_.isNumber(productData.numberOfVariants)){numberOfVariants=productData.numberOfVariants;}if(_.isNumber(productData.numberOfVariants)){productBriefData.numberOfVariants=productData.numberOfVariants;}if(_.isNumber(productData.purchaseOption)){purchaseOption=productData.purchaseOption;}if(_.isString(productData.stockLevelStatusCode)){stockLevelStatusCode=productData.stockLevelStatusCode;}var isZeroPrice=productBriefData.priceLabel.isZeroPrice,isCheckVariant=productBriefData.isCheckVariant;var stockStatus="inStock";if(!isZeroPrice){if(isCheckVariant&&numberOfVariants>1){switch(purchaseOption){case 2:stockStatus="soldOut";break;case 1:stockStatus="outOfStock";break;default:stockStatus="inStock";}}else{switch(stockLevelStatusCode){case"outOfStock":stockStatus="soldOut";break;case"stockNotifiable":stockStatus="outOfStock";break;default:stockStatus="inStock";}}}productBriefData.stockStatus=stockStatus;if(_.isString(productData.priceUpdatedDate)){productBriefData.priceUpdatedDate=productData.priceUpdatedDate;}var scheduledLabelCode=this.getScheduledDeliveryLabelCode(productData);if(scheduledLabelCode){if(_.isString(scheduledLabelCode)){productBriefData.deliveryLabelCode=scheduledLabelCode;}}else{if(productData.deliveryLabelCode){productBriefData.deliveryLabelCode=productData.deliveryLabelCode;}}if(_.isArray(productData.deliveryLabelScheduleCode)){productBriefData.deliveryLabelScheduleCode=productData.deliveryLabelScheduleCode;}if(options.showDeliveryRegionLabel){if(_.isArray(productData.overseasReg
6ionCodes)){productBriefData.overseasRegionCodes=productData.overseasRegionCodes;}}if(_.isString(productData.mabsRefId)){productBriefData.mabsRefId=productData.mabsRefId;if(_.isString(productData.mabsAdPosition)){productBriefData.mabsAdPosition=productData.mabsAdPosition;}}if(_.isArray(productData.marketingLabelUids)){productBriefData.marketingLabelUids=productData.marketingLabelUids;}if(_.isString(productData.additionalLabel)){productBriefData.additionalLabel=productData.additionalLabel;}if(_.isString(productData.additionalLabelForPurchasedList)){productBriefData.additionalLabelForPurchasedList=productData.additionalLabelForPurchasedList;}if(_.isString(productData.sourceId)){productBriefData.sourceId=productData.sourceId;}if(_.isString(productData.isThirdPartyLogisticsWarehouse)){productBriefData.isThirdPartyLogisticsWarehouse=productData.isThirdPartyLogisticsWarehouse;}if(_.isString(productData.isPriorSKU)){productBriefData.isPriorSKU=productData.isPriorSKU;}if(_.isArray(productData.pickLabelUids)){productBriefData.pickLabelUids=productData.pickLabelUids;}if(_.isArray(productData.eCoinsRebateSchedule)){productBriefData.eCoinsRebateSchedule=productData.eCoinsRebateSchedule;productBriefData.eCoinsRebateSchedule.forEach(function(ele){return ele.ecoinsDisplayThreshold=typeof ecoinsDisplayThreshold==="number"?ecoinsDisplayThreshold:null;});}var hasEcoins=productBriefData.eCoinsRebateSchedule.length>0;var hasMallDollar=Number(productBriefData.malldollarLabel.malldollarLabelPercent)>0;productBriefData.showEcoins=hasEcoins&&!hasMallDollar;productBriefData.isMainlandSamePrice=productData.isMainlandSamePrice;if(_.isString(productData.warehouseState)){productBriefData.warehouseState=productData.warehouseState;}if(_.isString(productData.warehouseCity)){productBriefData.warehouseCity=productData.warehouseCity;}if(_.isString(productData.deliveryModeCode)){productBriefData.deliveryModeCode=productData.deliveryModeCode;}var hasPersonalPrice=productBriefData.priceLabel.hasPersonalPrice;if(hasPersonalPrice){productBriefData.buyMoreSaveMore={};var hideBMSM=true;productBriefData.promotionLabel=ProductBriefDataPromotionLabel.parseProductBriefDataPromotionLabel(productData,__assign({},options,{hideBMSM:hideBMSM}));}productBriefData.isGreenLab=productData.isGreenLab;productBriefData.expiryDate=productData.expiryDate;productBriefData.expiryDateTs=productData.expiryDateTs;productBriefData.greenLabData=options.showGreenLab?generateGreenLabData(productBriefData,productData.buyPrice.formattedValue):null;if(_.isArray(productData.kaPriceList)){productBriefData.kaPriceList=productData.kaPriceList;productBriefData.mappedKaPrice=generateMappedKaPrice(productBriefData);}productBriefData.showKaPrice=hasKaData();if(_.isObject(productData.serviceDealOption)){productBriefData.serviceDealOption=productData.serviceDealOption;}if(_.isBoolean(productData.isExpressDeliverableSku)){productBriefData.isExpressDeliverableSku=productData.isExpressDeliverableSku;}if(_.isBoolean(productData.isMerchantWetmarketWarehouse)){productBriefData.isMerchantWetmarketWarehouse=productData.isMerchantWetmarketWarehouse;}if(_.isArray(productData.wetmarketCodeList)){productBriefData.wetmarketCodeList=productData.wetmarketCodeList;}}return productBriefData;};ProductBriefData.getScheduledDeliveryLabelCode=function(productData){var schedule=productData.deliveryLabelScheduleCode==null?[]:productData.deliveryLabelScheduleCode;for(var i=0;i<schedule.length;++i){var now=Date.now();var label=schedule[i];if(label.startTime<=now&&now<label.endTime){return label.deliveryMode;}}return productData.deliveryLabelCode;};return ProductBriefData;}());function generateGreenLabData(productBriefData,buyPrice){var isGreenLab=productBriefData.isGreenLab,expiryDate=productBriefData.expiryDate,expiryDateTs=productBriefData.expiryDateTs,priceLabel=productBriefData.priceLabel,isMainlandSamePrice=productBriefData.isMainlandSamePrice;var now=getEstimatedServerTimestamp();var isZeroPrice=priceLabel.isZeroPrice,hasMainlandPlusPrice=priceLabel.hasMainlandPlusPrice,hasMainlandPrice=priceLabel.hasMainlandPrice,showPersonalPrice=priceLabel.showPersonalPrice,priceRow=priceLabel.priceRow;if(!isGreenLab||isMainlandSamePrice||hasMainlandPlusPrice||hasMainlandPrice||showPersonalPrice||!now){return null;}var expiryType="bestDeal";if(expiryDateTs&&now<=expiryDateTs){expiryType="expiringSoon";}else{if(expiryDateTs&&now>expiryDateTs){expiryType="expired";}}var discountPercentage=0;if(!isZeroPrice&&priceRow&&buyPrice){var discountPrice=Number(priceRow.replace(/\$|,|\s/g,""));var buyPriceValue=Number(buyPrice.replace(/\$|,|\s/g,""));discountPercentage=100-Math.round(discountPrice/buyPriceValue*100)||0;if(discountPrice<buyPriceValue){return{expiryType:expiryType,expiryDate:expiryDate,discountPercentage:discountPercentage,formattedMarketPrice:buyPrice.replace(/\s/g,"")};}}return{expiryType:expiryType,expiryDate:expiryDate,discountPercentage:discountPercentage};}function getEstimatedServerTimestamp(){if(clientInitTime&&serverTimestamp){return parseInt(serverTimestamp)+(Date.now()-clientInitTime);}return null;}function generateMappedKaPrice(productBriefData){var kaPriceList=productBriefData.kaPriceList,priceLabel=productBriefData.priceLabel,officialWebsiteAffiliateUrl=productBriefData.officialWebsiteAffiliateUrl,externalAffiliateRedirectLink=productBriefData.externalAffiliateRedirectLink;var kaPriceOnOff=hktvCommon.env.showKaPrice==="true";var isExternalProduct=officialWebsiteAffiliateUrl||externalAffiliateRedirectLink;if(kaPriceOnOff&&kaPriceList&&kaPriceList.length>0&&hasKaData()&&!isExternalProduct){var kaDisplayPrice_1=formatKaDisplayPrice(!priceLabel.hasMainlandPrice?priceLabel.priceRow:priceLabel.promotionalRow);var kaList=kaData.kaList;var _loop_1=function(kaPrice){var foundKa=kaList.find(function(ka){return ka.code&&kaPrice.code&&ka.code===kaPrice.code&&kaDisplayPrice_1<kaPr
6ice.priceValue;});if(foundKa&&foundKa.shortName&&foundKa.longName){return{value:$.extend({},kaPrice,foundKa)};}};for(var _i=0,kaPriceList_1=kaPriceList;_i<kaPriceList_1.length;_i++){var kaPrice=kaPriceList_1[_i];var state_1=_loop_1(kaPrice);if(typeof state_1==="object"){return state_1.value;}}}return null;}function hasKaData(){return typeof kaData!=="undefined"&&kaData!==null&&typeof kaData.kaList!=="undefined"&&kaData.kaList!==null;}function formatKaDisplayPrice(formattedValue){var formattedValue=formattedValue||"";var trimmedValue=Number.MAX_VALUE.toString();if(formattedValue.match(/\d|\./g)){trimmedValue=formattedValue.replace(/[^\d\.]*/g,"");}return parseFloat(Number(trimmedValue).toFixed(2));}var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var RatingStar=(function(_super){__extends(RatingStar,_super);function RatingStar(props){var _this=_super.call(this,props)||this;_this.rating=0;_this.reactPropsArray=[];_this.starPath="M395.112552,317.720681 C394.310754,315.665806 393.137371,315.714159 392.491788,317.828477 L388.303844,331.544234 L373.994238,331.544234 C371.788281,331.544234 371.439585,332.599256 373.221904,333.905457 L384.198698,341.949969 L380.196974,355.17364 C379.557469,357.28688 380.507981,357.977907 382.320448,356.716781 L393.660769,348.826113 L406.285205,356.854812 C408.14813,358.039567 409.020375,357.334127 408.225426,355.258298 L403.12894,341.949969 L415.484648,333.751023 C417.321327,332.532247 417.021874,331.544234 414.816012,331.544234 L400.506406,331.544234 L395.112552,317.720681 Z";_this.RatingStarInlineStyle={};_this.rating=_this.props.rating||0;_this.calcRatingStar(_this.rating);_this.state={starMaskOffset:_this.reactPropsArray,inputValue:0};_this.onClickCheckSubmitButton=_this.onClickCheckSubmitButton.bind(_this);if(_this.props.clickable){_this.RatingStarInlineStyle={cursor:"pointer"};}else{_this.RatingStarInlineStyle={cursor:"default"};}return _this;}RatingStar.prototype.onClickCheckSubmitButton=function(inputValue){this.props.onClickCheckSubmitButton(inputValue);};RatingStar.prototype.calcRatingStar=function(rating){var numOfFullStar=Math.floor(rating);var remainder=rating%1;this.reactPropsArray=[];for(var i=0;i<numOfFullStar;i++){this.reactPropsArray.push(1);}this.reactPropsArray.push(remainder);};RatingStar.prototype.updateRating=function(rating){if(!this.props.formSubmitting){this.rating=rating||0;this.calcRatingStar(this.rating);this.setState({starMaskOffset:this.reactPropsArray});}};RatingStar.prototype.updateClickStarRating=function(eCurrentTarget,index){if(this.props.clickable){var $e=$(eCurrentTarget);$("svg path").removeClass("active");$e.addClass("active");this.setState({inputValue:index});this.updateRating(index);this.onClickCheckSubmitButton(index);}};RatingStar.prototype.updateMouseOverStarRating=function(index){if(this.props.clickable){this.updateRating(index);}};RatingStar.prototype.updateMouseLeaveStarRating=function(){if(this.props.clickable){var active_index=$("#star_container svg path.active").data("index");this.updateRating(active_index);}};RatingStar.prototype.renderHiddenInput=function(){if(this.props.clickable){return(React.createElement("input",{type:"hidden",value:this.state.inputValue,name:"rating"}));}else{return null;}};RatingStar.prototype.render=function(){var _this=this;var starmaskID=this.props.starmaskID.replace(/[ ())]/g,"_")||_.now().toString();var strokeColor=this.props.colorTheme=="white"?"#FFF":this.props.colorTheme=="black"?"#000":"#ff9A01";var frontColor=this.props.colorTheme=="white"?"#FFF":this.props.colorTheme=="black"?"#000":"#FFCA28";var backColor=this.props.colorTheme=="white"?"#999":this.props.colorTheme=="black"?"#FFF":"#EBEBEB";return(React.createElement("div",{className:"star_container"},React.createElement("svg",{width:this.props.width,height:this.props.width/(265/42),viewBox:"0 0 265 42",xmlns:"http://www.w3.org/2000/svg",style:this.RatingStarInlineStyle,onMouseLeave:function(){_this.updateMouseLeaveStarRating();},stroke:strokeColor,strokeWidth:"3"},React.createElement("defs",null,[0,1,2,3,4].map(function(i){return React.createElement("linearGradient",{id:starmaskID+"_"+(i+1),key:i},React.createElement("stop",{offset:"0",stopColor:frontColor}),React.createElement("stop",{stopColor:frontColor,offset:_this.state.starMaskOffset[i]}),React.createElement("stop",{stopColor:backColor,offset:_this.state.starMaskOffset[i]}),React.createElement("stop",{offset:"1",stopColor:backColor}));})),React.createElement("g",{transform:"translate(-372.000000, -316.000000)"},[0,1,2,3,4].map(function(i){return React.createElement("path",{key:i,d:_this.starPath,fill:"url(#"+starmaskID+"_"+(i+1)+")",transform:"translate("+i*55+" 0)","data-index":i+1,onClick:function(e){_this.updateClickStarRating(e.currentTarget,i+1);},onMouseOver:function(){_this.updateMouseOverStarRating(i+1);}});}))),this.renderHiddenInput()));};return RatingStar;}(React.Component));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.
6setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var __assign=(this&&this.__assign)||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)){t[p]=s[p];}}}return t;};var __rest=(this&&this.__rest)||function(s,e){var t={};for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0){t[p]=s[p];}}if(s!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++){if(e.indexOf(p[i])<0){t[p[i]]=s[p[i]];}}}return t;};var BuyMoreButton=(function(_super){__extends(BuyMoreButton,_super);function BuyMoreButton(props){return _super.call(this,props)||this;}BuyMoreButton.prototype.render=function(){return(React.createElement("button",{className:"saveMore",id:"",style:{"border":"1px solid "+this.props.colorCode,"color":this.props.colorCode},onMouseEnter:this.props.onMouseEnter},hktvCommon.stringResources.saveMore));};return BuyMoreButton;}(React.Component));var ProductBriefBuyMoreSaveMore=(function(_super){__extends(ProductBriefBuyMoreSaveMore,_super);function ProductBriefBuyMoreSaveMore(props){var _this=_super.call(this,props)||this;_this.setStockStatusState=_this.setStockStatusState.bind(_this);return _this;}ProductBriefBuyMoreSaveMore.prototype.setStockStatusState=function(status){this.props.setProductBriefListStockStatus(this.props.index,status);};ProductBriefBuyMoreSaveMore.prototype.render=function(){var props=this.props;var template=props.template,stockStatus=props.stockStatus,isZeroPrice=props.priceLabel.isZeroPrice,hidePriceDropdown=props.hidePriceDropdown,malldollarLabelPercent=props.malldollarLabel.malldollarLabelPercent,savedPriceFormatted=props.savedPriceFormatted,priceUpdatedDate=props.priceUpdatedDate;var malldollarLabelPercentNumber=Number(malldollarLabelPercent);if(!(_.isNumber(malldollarLabelPercentNumber)&&malldollarLabelPercentNumber>0)&&_.isEmpty(savedPriceFormatted)&&_.isEmpty(priceUpdatedDate)){hidePriceDropdown=true;}var classes={"product-brief":true,"fashion":props.zone=="fashion","white":props.colorTheme=="white","BMSM":true,"displayStore":Boolean(props.officialWebsiteAffiliateUrl||props.externalAffiliateRedirectLink),"officialWebsiteAffiliateUrl":props.officialWebsiteAffiliateUrl,"externalAffiliateRedirectLink":props.externalAffiliateRedirectLink};var vipBMSM=false;if(hktvCommon.env.userMembershipLevel=="VIP"){vipBMSM=true;}var height=24;switch(props.buyMoreSaveMore.promotionLevels.length){case 3:break;case 2:height+=36;break;case 1:height+=72;break;default:break;}return(React.createElement(ProductBriefContainerBuyMoreSaveMore,{classes:classes,id:props.id,url:props.url,isStaySamePage:props.isStaySamePage},React.createElement("div",{className:"square-wrapper"},React.createElement(UIImageContainer,{src:props.image.url,alt:props.image.alt,width:"100%",height:"100%"}),stockStatus!=="soldOut"&&stockStatus!=="outOfStock"&&typeof marketingLabels!=="undefined"&&marketingLabels&&marketingLabels.length>0&&typeof props.marketingLabelUids!=="undefined"&&props.marketingLabelUids&&props.marketingLabelUids.length>0&&React.createElement(MarketingLabel,__assign({},props,{onClickHandler:_.isFunction(this.props.onMarketingLabelClickHandler)&&this.props.onMarketingLabelClickHandler(props.primaryCatCode,props.id,props.mabsRefId,props.storeId,props.additionalLabel,props.additionalLabelForPurchasedList,props.sourceId),style:{bottom:bottomLabelHeight.toString()}})),typeof pickLabels!=="undefined"&&pickLabels&&pickLabels.length>0&&typeof props.pickLabelUids!=="undefined"&&props.pickLabelUids&&props.pickLabelUids.length>0&&React.createElement(PickLabel,__assign({},props)),stockStatus=="soldOut"&&React.createElement(SoldOutLabel,null)||stockStatus=="outOfStock"&&React.createElement(OutOfStockLabel,null)||props.promotionLabel.promotionShortName&&React.createElement(PromotionLabel,__assign({},props,{onClickHandler:function(){return _.isFunction(props.onPromotionTagClickHandler)&&props.onPromotionTagClickHandler();}})),!props.hideProductSurface&&React.createElement(ProductSurface,__assign({},props)),!props.hideMalldollarPrecent&&React.createElement(MalldollarPercentSection,__assign({},props)),props.showEcoins&&React.createElement(ECoinsPercentSection,__assign({},props))),React.createElement("div",{className:"info-wrapper"},React.createElement("div",{className:"upper-wrapper",style:{height:height}},React.createElement("div",{className:"brand-product-name"},React.createElement("h4",null,props.brandProductName)),props.packingSpec!=""&&React.createElement("div",{className:"packing-spec"},React.createElement("span",null,props.packingSpec)),props.averageRating!=0&&React.createElement("div",{className:"review-info"},React.createElement(RatingStar,{width:91,rating:props.averageRating,starmaskID:props.id,clickable:false,onClickCheckSubmitButton:false,formSubmitting:false,colorTheme:!_.isEmpty(props.colorTheme)?props.colorTheme:(props.zone=="fashion"?"black":"")}
6),props.numberOfReviews>0&&React.createElement("span",{className:"review-number"},"(",props.numberOfReviews>9999?"9999+":props.numberOfReviews,")")),props.priceRows!=0&&React.createElement(PriceLabelSection,__assign({},props,{hidePriceDropdown:true})))),React.createElement(BuyMoreSaveMoreBrief,__assign({},props,{vipBMSM:vipBMSM,stockStatus:stockStatus,setStockStatusState:this.setStockStatusState,promotionLevels:props.buyMoreSaveMore.promotionLevels,productCode:props.id})),React.createElement(BriefButton,__assign({},props,{stockStatus:stockStatus,setStockStatusState:this.setStockStatusState,onClickHandler:props.AddToCartHandler})),React.createElement(BuyMoreButton,{colorCode:props.isGreenLab&&props.greenLabData?"#0D8063":(vipBMSM&&props.buyMoreSaveMore.promotionLevels[0].vipmessage?"#7e3ac7":"#ee740e")})));};return ProductBriefBuyMoreSaveMore;}(React.Component));var ProductBriefBuyMoreSaveMoreHorizontal=(function(_super){__extends(ProductBriefBuyMoreSaveMoreHorizontal,_super);function ProductBriefBuyMoreSaveMoreHorizontal(props){var _this=_super.call(this,props)||this;_this.setStockStatusState=_this.setStockStatusState.bind(_this);return _this;}ProductBriefBuyMoreSaveMoreHorizontal.prototype.setStockStatusState=function(status){this.props.setProductBriefListStockStatus(this.props.index,status);};ProductBriefBuyMoreSaveMoreHorizontal.prototype.render=function(){var _this=this;var props=this.props;var template=props.template,stockStatus=props.stockStatus,isZeroPrice=props.priceLabel.isZeroPrice,hidePriceDropdown=props.hidePriceDropdown,malldollarLabelPercent=props.malldollarLabel.malldollarLabelPercent,savedPriceFormatted=props.savedPriceFormatted,priceUpdatedDate=props.priceUpdatedDate;var malldollarLabelPercentNumber=Number(malldollarLabelPercent);if(!(_.isNumber(malldollarLabelPercentNumber)&&malldollarLabelPercentNumber>0)&&_.isEmpty(savedPriceFormatted)&&_.isEmpty(priceUpdatedDate)){hidePriceDropdown=true;}var classes={"product-brief":true,"fashion":props.zone=="fashion","white":props.colorTheme=="white","horizontals":true,"BMSM":true};var vipBMSM=false;if(hktvCommon.env.userMembershipLevel=="VIP"){vipBMSM=true;}var height=18;switch(props.buyMoreSaveMore.promotionLevels.length){case 3:break;case 2:height+=36;break;case 1:height+=72;break;default:break;}return(React.createElement(ProductBriefContainer,{classes:classes,id:props.id,url:props.url,isStaySamePage:props.isStaySamePage},React.createElement("div",{className:"left-wrapper"},React.createElement("div",{className:"square-wrapper"},React.createElement(UIImageContainer,{src:props.image.url,alt:props.image.alt,width:"100%",height:"100%"}),stockStatus!=="soldOut"&&stockStatus!=="outOfStock"&&typeof marketingLabels!=="undefined"&&marketingLabels&&marketingLabels.length>0&&typeof props.marketingLabelUids!=="undefined"&&props.marketingLabelUids&&props.marketingLabelUids.length>0&&React.createElement(MarketingLabel,__assign({},props,{onClickHandler:_.isFunction(this.props.onMarketingLabelClickHandler)&&this.props.onMarketingLabelClickHandler(props.primaryCatCode,props.id),style:{bottom:bottomLabelHeight.toString()}})),typeof pickLabels!=="undefined"&&pickLabels&&pickLabels.length>0&&typeof props.pickLabelUids!=="undefined"&&props.pickLabelUids&&props.pickLabelUids.length>0&&React.createElement(PickLabel,__assign({},props)),stockStatus=="soldOut"&&React.createElement(SoldOutLabel,null)||stockStatus=="outOfStock"&&React.createElement(OutOfStockLabel,null)||props.promotionLabel.promotionShortName&&React.createElement(PromotionLabel,__assign({},props)),!props.hideProductSurface&&React.createElement(ProductSurface,__assign({},props)),!props.hideMalldollarPrecent&&React.createElement(MalldollarPercentSection,__assign({},props)),props.showEcoins&&React.createElement(ECoinsPercentSection,__assign({},props)))),React.createElement("div",{className:"right-wrapper"},React.createElement("div",{className:"info-wrapper"},React.createElement("div",{className:"upper-wrapper",style:{height:height}},React.createElement("div",{className:"brand-product-name"},React.createElement("h4",null,props.brandProductName)),props.packingSpec!=""&&React.createElement("div",{className:"packing-spec"},React.createElement("span",null,props.packingSpec)),props.averageRating!=0&&React.createElement("div",{className:"review-info"},React.createElement(RatingStar,{width:91,rating:props.averageRating,starmaskID:props.id,clickable:false,onClickCheckSubmitButton:false,formSubmitting:false,colorTheme:!_.isEmpty(props.colorTheme)?props.colorTheme:(props.zone=="fashion"?"black":"")}
6),props.numberOfReviews>0&&React.createElement("span",{className:"review-number"},"(",props.numberOfReviews>9999?"9999+":props.numberOfReviews,")")),props.priceRows!=0&&React.createElement(PriceLabelSection,__assign({},props,{hidePriceDropdown:true}))),React.createElement(BuyMoreSaveMoreBrief,__assign({},props,{vipBMSM:vipBMSM,stockStatus:stockStatus,setStockStatusState:this.setStockStatusState,promotionLevels:props.buyMoreSaveMore.promotionLevels,productCode:props.id})),React.createElement(BriefButton,__assign({},props,{stockStatus:stockStatus,setStockStatusState:this.setStockStatusState,onClickHandler:props.AddToCartHandler})),React.createElement(BuyMoreButton,{colorCode:vipBMSM&&props.buyMoreSaveMore.promotionLevels[0].vipmessage?"#7e3ac7":"#ee740e"}))),!hidePriceDropdown&&React.createElement(PriceDropDownSection,__assign({},props,{priceDropdownSectionRef:function(el){return _this.priceDropdownSectionElement=el;}}))));};return ProductBriefBuyMoreSaveMoreHorizontal;}(React.Component));var GreenLabAddToCartButton=function(){return(React.createElement("div",{className:"greenLabAddToCartButton"},React.createElement("img",{className:"greenLabAddToCartButton__icon",src:"/_ui/common/images/green_lab/greenlab_cart.svg",alt:"add-to-cart"})));};var BuyMoreSaveMoreBrief=function(props){var colorCode=props.isGreenLab&&props.greenLabData?"#0D8063":(props.vipBMSM&&props.promotionLevels[0].vipmessage?"#7e3ac7":"#ee740e");return(React.createElement("div",{className:"buyMoreSaveMoreBrief_container"},React.createElement("p",{style:{"background":colorCode},dangerouslySetInnerHTML:{__html:hktvCommon.stringResources.saveMore}})," ",props.promotionLevels.slice(0,3).map(function(promotion,index){return(React.createElement(BuyMoreSaveMoreBriefBtn,__assign({onClickHandler:function(){typeof props.onClickGA==="function"&&props.onClickGA(index+1,props.primaryCatCode,props.productCode,promotion.quantity,props.mabsRefId);_.isFunction(props.onBMSMLevelClickHandler)&&props.onBMSMLevelClickHandler(promotion.quantity,index+1);},vipBMSM:props.vipBMSM,color:colorCode,key:index,promotionLevel:promotion,productCode:props.productCode},props,{stockStatus:props.stockStatus,setStockStatusState:props.setStockStatusState,mylistProductGAFlag:props.mylistProductGAFlag,listType:props.listType})));})));};var BuyMoreSaveMoreBriefBtn=(function(_super){__extends(BuyMoreSaveMoreBriefBtn,_super);function BuyMoreSaveMoreBriefBtn(props){return _super.call(this,props)||this;}BuyMoreSaveMoreBriefBtn.prototype.componentDidMount=function(){this.$element=$(this.element);};BuyMoreSaveMoreBriefBtn.prototype.addtoCartEvent=function(){var _a=this.props,name=_a.name,id=_a.id,brandName=_a.brandName,baseProductId=_a.baseProductId,primaryCatCode=_a.primaryCatCode,setStockStatusState=_a.setStockStatusState,storeId=_a.storeId,storeIdOrig=_a.storeIdOrig,priceLabel=_a.priceLabel,specialAddCartFlowLink=_a.specialAddCartFlowLink,inStorePickUpCheckoutLink=_a.inStorePickUpCheckoutLink,externalAffiliateRedirectLink=_a.externalAffiliateRedirectLink,mylistProductGAFlag=_a.mylistProductGAFlag,listType=_a.listType,deliveryLabelCode=_a.deliveryLabelCode;var $element=this.$element;var qty=this.props.promotionLevel.quantity,pageType="productBrief";var self=this;var productCode=$element.data("productcode")||"";var category=$element.data("category")||"";var pageName=hktvCommon.env.pageName||"";var type;if(listType=="userCreate"){type="custom_list_";}else{if(listType=="wishList"){type="wishlist_";}else{if(listType=="recentlyPurchased"){type="recently_purchased_";}else{if(listType=="recentlyViewed"){type="recently_viewed_";}}}}if($element.hasClass("hasVariant")){hktvCommon.showProductQuickView(productCode,$element,category,{"pageName":pageName,"userAction":"addToCart"});}else{if(specialAddCartFlowLink!=""){window.open(specialAddCartFlowLink,"_blank");}else{if(inStorePickUpCheckoutLink){window.location.href=inStorePickUpCheckoutLink;}else{if(externalAffiliateRedirectLink!=""){ExternalAffliateTncPage(externalAffiliateRedirectLink);}else{$.ajax({type:"post",url:hktvCommon.addPrefixToHktvUrl("/cart/add"),data:{productC
6odePost:id,qty:qty,pageType:pageType},cache:false,success:function(responseData){var callback="";if(pageType=="quickview"){callback=function(){setTimeout(function(){ColorboxDesktop.close();},5000);};}var addtocartStrings=hktvCommon.stringResources.addtocart;var notifyMeStrings=hktvCommon.stringResources.notifyMe;if(typeof responseData.statusCode!="undefined"&&responseData.statusCode=="locallyNoStock"){var html_1=hktvCommon.templateForMessage(addtocartStrings.failNoStock,"negative");$element.children("p").showHktvTooltips(html_1,"bottom",callback);}else{if(typeof responseData.statusCode!="undefined"&&(responseData.statusCode=="stockNotifiable"||responseData.statusCode=="stockNotified")){var reloadCallback;if(pageType=="productDetailPage"){reloadCallback=function(){setTimeout(function(){window.location.reload();},800);};var html_2=hktvCommon.templateForMessage(notifyMeStrings.stockNotifiable,"negative");$element.children("p").showHktvTooltips(html_2,"bottom",reloadCallback);return;}var html_3=hktvCommon.templateForMessage(notifyMeStrings.stockNotifiable,"negative");$element.children("p").showHktvTooltips(html_3,"bottom",reloadCallback);setStockStatusState("outOfStock");}else{var addedQty=Number(responseData.quantityAdded);if(hktvCommon.env.webType=="mobile"){var proceedToPaymentHtml='<a href="'+hktvCommon.addPrefixToHktvUrl("/cart")+'">'+hktvCommon.stringResources.general.proceedToPaymentMobile+'<i class="icArrowrightBlack"></i></a>';}else{var proceedToPaymentHtml=mylistProductGAFlag?'<a href="'+hktvCommon.addPrefixToHktvUrl("/cart/checkout/select-flow?flow=express&pci=")+("'\" onclick=\"analytics.trackEventV2('mylist', '"+type+"checkout', '"+(primaryCatCode?primaryCatCode:"undefined_AA")+" | "+(id?id:"undefined_S_")+"')\"")+'">'+hktvCommon.stringResources.general.proceedToPayment+'<i class="icArrowrightBlack"></i></a>':'<a href="'+hktvCommon.addPrefixToHktvUrl("/cart/checkout/select-flow?flow=express&pci=")+'">'+hktvCommon.stringResources.general.proceedToPayment+'<i class="icArrowrightBlack"></i></a>';}if(addedQty>0){var exactTimeLabel=hktvCommon.resolveExactTimeDeliveryLabel(self.props);var addToCartAnimationURL=hktvCommon.getAddToCartAnimationURL(deliveryLabelCode,exactTimeLabel&&exactTimeLabel.addToCartImageURL,!!exactTimeLabel);if(addToCartAnimationURL){hktvCommon.showEightHourSuccessOverlay(addToCartAnimationURL);}else{if(addedQty==qty){var html=hktvCommon.templateForMessage(addtocartStrings.succeed+"<br/>"+proceedToPaymentHtml,"positive");$element.children("p").showHktvTooltips(html,"bottom",callback);}else{var html=hktvCommon.templateForMessage(hktvCommon.springThemeReplace(addtocartStrings.succeedLowStock,addedQty)+"<br/>"+proceedToPaymentHtml,"neutral");$element.children("p").showHktvTooltips(html,"bottom",callback);}}}else{var $parentButtonWrapper=$element.parent();var reloadCallback;if($element.data("page")=="productDetailPage"){reloadCallback=function(){setTimeout(function(){window.location.reload();},800);};var html=hktvCommon.templateForMessage(notifyMeStrings.soldOut,"negative");$element.children("p").showHktvTooltips(html,"bottom",reloadCallback);return;}else{setStockStatusState("soldOut");}}}}hktvCommon.updateMiniCartCount();$($element).on("click",".tooltips",function(e){e.stopPropagation();});if($(".page-promotion").length>0){$("#product-search-container").data("promotionInfo").updatePromotionInfo();}},error:function(error){var addtocartStrings=hktvCommon.stringResources.addtocart;var html=hktvCommon.templateForMessage(addtocartStrings.error,"negative");$element.children("p").showHktvTooltips(html,"bottom");console.log(error);$($element).on("click",".tooltips",function(e){e.stopPropagation();});},complete:function(){}});if(typeof window.google_trackConversion=="function"){window.google_trackConversion({google_conversion_id:google_conversion_id,google_remarketing_only:google_remarketing_only,google_custom_params:{ecomm_prodid:id,ecomm_pagetype:"other",ecomm_category:primaryCatCode||"",addToCart:true}});}if(typeof analytics!="undefined"&&analytics!=null){analytics.trackPage("/_ga/click/add_to_cart");analytics.trackAddToCart(id,baseProductId,storeId,primaryCatCode,qty);analytics.trackEcommerceAddToCart(hktvCommon.escapeHtml(name,true),id,priceLabel.priceRow,hktvCommon.escapeHtml(brandName,true),primaryCatCode,qty,storeId,storeIdOrig);}}}}}};BuyMoreSaveMoreBriefBtn.prototype.render=function(){var _this=this;
6var _a=this.props,promotionLevel=_a.promotionLevel,productCode=_a.productCode,vipBMSM=_a.vipBMSM;var message=promotionLevel.message,vipmessage=promotionLevel.vipmessage,quantity=promotionLevel.quantity;var _b=this.props,id=_b.id,baseProductId=_b.baseProductId,primaryCatCode=_b.primaryCatCode,name=_b.name,brandName=_b.brandName,storeId=_b.storeId,_c=_b.priceLabel,priceLabel=_c===void 0?{}:_c,numberOfVariants=_b.numberOfVariants,purchaseOption=_b.purchaseOption,stockStatus=_b.stockStatus,greenLabData=_b.greenLabData,serviceDealOption=_b.serviceDealOption;var priceRow=priceLabel.priceRow;var qty=quantity,pageType="productBrief";var hasVariant=false;if(numberOfVariants&&numberOfVariants>1){hasVariant=true;}if(Object.keys(serviceDealOption).length>0){hasVariant=true;}var buttonAttributes={};buttonAttributes={spriteName:"icAddtocart",classes:{sepaButton:true,"add-to-cart-button":true},title:hktvCommon.stringResources.general.addToCart,onClickEvent:this.addtoCartEvent};if(hasVariant){buttonAttributes.classes=_.assign({"hasVariant":true},buttonAttributes.classes);}var spriteName=buttonAttributes.spriteName,title=buttonAttributes.title,classes=buttonAttributes.classes,onClickEvent=buttonAttributes.onClickEvent;onClickEvent=onClickEvent.bind(this);var borderBottomStyle={"borderBottom":"0.5px "+this.props.color+" solid","borderLeft":"0.5px "+this.props.color+" solid","borderRight":"0.5px "+this.props.color+" solid"};return(React.createElement("button",{ref:function(element){return _this.element=element;},style:borderBottomStyle,onClick:function(){_this.addtoCartEvent();typeof _this.props.onClickHandler==="function"&&_this.props.onClickHandler();},className:"BMSM_btn "+(greenLabData?"isGreenLab":""),id:"","data-productcode":id,"data-analytics-baseproduct":baseProductId,"data-qty":qty,"data-category":primaryCatCode,"data-pagetype":pageType,"data-productname":name,"data-productbrand":brandName,"data-storecode":storeId,"data-price":priceRow,title:title},greenLabData?React.createElement(GreenLabAddToCartButton,null):vipBMSM&&vipmessage?React.createElement(UIIconPurpleAddToCart,null):React.createElement(UIIconOrangeAddToCart,null),React.createElement("p",{dangerouslySetInnerHTML:{__html:vipBMSM&&vipmessage?vipmessage:message}})));};return BuyMoreSaveMoreBriefBtn;}(React.Component));var UIIconOrangeAddToCart=function(){return(React.createElement("svg",{width:"31px",height:"36px",viewBox:"0 0 34 40",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{id:"search-result",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React.createElement("g",{id:"pc",transform:"translate(-21.000000, -103.000000)"},React.createElement("g",{id:"img_productBrief_orange",transform:"translate(21.000000, 103.000000)"},React.createElement("g",{id:"Group-7"},React.createElement("rect",{id:"Rectangle",x:"0",y:"0",width:"33.825641",height:"40"}),React.createElement("g",{id:"icon_shopp-cart",transform:"translate(6.964103, 10.000000)"},React.createElement("path",{d:"M3.60178868,13.6308566 C3.61338352,13.6314237 3.62441276,13.6342593 3.6362904,13.6342593 C3.64562283,13.6342593 3.65495526,13.6339757 3.66457049,13.6336922 L17.3804171,13.0665875 C17.6222119,13.0546783 17.8297879,12.8893673 17.8965289,12.6557202 L19.87557,3.44991029 C19.9244946,3.27892823 19.8902757,3.09461922 19.7833769,2.95255951 C19.6764781,2.81049979 19.5093428,2.72685185 19.3317438,2.72685185 L2.65299145,2.72685185",id:"Fill-1",fill:"#EE740E"}),React.createElement("path",{d:"M3.60178868,13.6308566 C3.64562283,13.6342593 3.65495526,13.6339757 3.66457049,13.6336922 L17.3804171,13.0665875 C17.6222119,13.0546783 17.8297879,12.8893673 17.8965289,12.6557202 L19.87557,3.44991029 C19.9244946,3.27892823 19.8902757,3.09461922 19.7833769,2.95255951 C19.6764781,2.81049979 19.5093428,2.72685185 19.3317438,2.72685185 L2.65299145,2.72685185",id:"Stroke-3",stroke:"#EE740E",strokeWidth:"1.2541806"}),React.createElement("polyline",{id:"Stroke-5",stroke:"#EE740E",strokeWidth:"1.45574534",strokeLinecap:"round",strokeLinejoin:"round",points:"0 0 2.4546925 0 3.97948718 16.3611111"}),React.createElement("path",{d:"M8.16842105,17.150463 C8.16842105,18.3395139 7.23079802,19.3032407 6.07395412,19.3032407 C4.91711021,19.3032407 3.97948718,18.3395139 3.97948718,17.150463 C3.97948718,15.961412 4.91711021,14.9976852 6.07395412,14.9976852 C7.23079802,14.9976852 8.16842105,15.9614
612 8.16842105,17.150463 L8.16842105,17.150463 Z",id:"Stroke-9",stroke:"#EE740E",strokeWidth:"1.2541806"}),React.createElement("path",{d:"M16.1273954,17.150463 C16.1273954,18.3395139 15.1897724,19.3032407 14.0329285,19.3032407 C12.8760846,19.3032407 11.9384615,18.3395139 11.9384615,17.150463 C11.9384615,15.961412 12.8760846,14.9976852 14.0329285,14.9976852 C15.1897724,14.9976852 16.1273954,15.961412 16.1273954,17.150463 L16.1273954,17.150463 Z",id:"Stroke-13",stroke:"#EE740E",strokeWidth:"1.2541806"}),React.createElement("path",{d:"M7.95897436,14.9976852 L11.9384615,14.9976852",id:"Fill-15",fill:"#EE740E"}),React.createElement("path",{d:"M7.95897436,17.724537 L11.9384615,17.724537",id:"Stroke-17",stroke:"#EE740E",strokeWidth:"1.45574534",strokeLinecap:"round",strokeLinejoin:"round"}))))))));};var UIIconPurpleAddToCart=function(){return(React.createElement("svg",{width:"31px",height:"36px",viewBox:"0 0 34 40",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{id:"search-result",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},React.createElement("g",{id:"pc",transform:"translate(-21.000000, -47.000000)"},React.createElement("g",{id:"img_productBrief_purple",transform:"translate(21.000000, 47.000000)"},React.createElement("g",{id:"Group-7"},React.createElement("rect",{id:"Rectangle",x:"0",y:"0",width:"33.825641",height:"40"}),React.createElement("g",{id:"icon_shopp-cart",transform:"translate(6.964103, 10.000000)"},React.createElement("path",{d:"M3.60178868,13.6308566 C3.61338352,13.6314237 3.62441276,13.6342593 3.6362904,13.6342593 C3.64562283,13.6342593 3.65495526,13.6339757 3.66457049,13.6336922 L17.3804171,13.0665875 C17.6222119,13.0546783 17.8297879,12.8893673 17.8965289,12.6557202 L19.87557,3.44991029 C19.9244946,3.27892823 19.8902757,3.09461922 19.7833769,2.95255951 C19.6764781,2.81049979 19.5093428,2.72685185 19.3317438,2.72685185 L2.65299145,2.72685185",id:"Fill-1",fill:"#7E3AC7"}),React.createElement("path",{d:"M3.60178868,13.6308566 C3.64562283,13.6342593 3.65495526,13.6339757 3.66457049,13.6336922 L17.3804171,13.0665875 C17.6222119,13.0546783 17.8297879,12.8893673 17.8965289,12.6557202 L19.87557,3.44991029 C19.9244946,3.27892823 19.8902757,3.09461922 19.7833769,2.95255951 C19.6764781,2.81049979 19.5093428,2.72685185 19.3317438,2.72685185 L2.65299145,2.72685185",id:"Stroke-3",stroke:"#7E3AC7",strokeWidth:"1.2541806"}),React.createElement("polyline",{id:"Stroke-5",stroke:"#7E3AC7",strokeWidth:"1.45574534",strokeLinecap:"round",strokeLinejoin:"round",points:"0 0 2.4546925 0 3.97948718 16.3611111"}),React.createElement("path",{d:"M8.16842105,17.150463 C8.16842105,18.3395139 7.23079802,19.3032407 6.07395412,19.3032407 C4.91711021,19.3032407 3.97948718,18.3395139 3.97948718,17.150463 C3.97948718,15.961412 4.91711021,14.9976852 6.07395412,14.9976852 C7.23079802,14.9976852 8.16842105,15.961412 8.16842105,17.150463 L8.16842105,17.150463 Z",id:"Stroke-9",stroke:"#7E3AC7",strokeWidth:"1.2541806"}),React.createElement("path",{d:"M16.1273954,17.150463 C16.1273954,18.3395139 15.1897724,19.3032407 14.0329285,19.3032407 C12.8760846,19.3032407 11.9384615,18.3395139 11.9384615,17.150463 C11.9384615,15.961412 12.8760846,14.9976852 14.0329285,14.9976852 C15.1897724,14.9976852 16.1273954,15.961412 16.1273954,17.150463 L16.1273954,17.150463 Z",id:"Stroke-13",stroke:"#7E3AC7",strokeWidth:"1.2541806"}),React.createElement("path",{d:"M7.95897436,14.9976852 L11.9384615,14.9976852",id:"Fill-15",fill:"#7E3AC7"}),React.createElement("path",{d:"M7.95897436,17.724537 L11.9384615,17.724537",id:"Stroke-1
67",stroke:"#7E3AC7",strokeWidth:"1.45574534",strokeLinecap:"round",strokeLinejoin:"round"}))))))));};var Popup=function(props){return(React.createElement("div",{className:"popUpMenuContainer"},props.shape=="horizontal"?React.createElement(ProductBriefBuyMoreSaveMoreHorizontal,__assign({},props)):React.createElement(ProductBriefBuyMoreSaveMore,__assign({},props))));};Popup.defaultProps={shape:"vertical"};var OutOfStockLabel=function(){return React.createElement("div",{className:"out-of-stock-label"},React.createElement("span",null,hktvCommon.stringResources.general.outOfStock));};var SoldOutLabel=function(){return React.createElement("div",{className:"sold-out-label"},React.createElement("span",null,hktvCommon.stringResources.general.soldOut));};var MalldollarPercentSection=function(props){var _a=props.malldollarLabel,malldollarLabel=_a===void 0?{}:_a;var _b=malldollarLabel.malldollarLabelPercent,malldollarLabelPercent=_b===void 0?"":_b,_c=malldollarLabel.isVipMalldollar,isVipMalldollar=_c===void 0?false:_c,_d=malldollarLabel.isGoldVipMalldollar,isGoldVipMalldollar=_d===void 0?false:_d,_e=malldollarLabel.isDiamondVipMalldollar,isDiamondVipMalldollar=_e===void 0?false:_e,_f=malldollarLabel.rebateDisplayThreshold,rebateDisplayThreshold=_f===void 0?null:_f;var percent=Number(malldollarLabelPercent);var threshold=typeof rebateDisplayThreshold==="number"?rebateDisplayThreshold:2;return(_.isNumber(percent)&&percent>=threshold)?React.createElement("div",{className:"mall-dollar-percent"},React.createElement("i",{className:"icMalldollarpercent"+(percent>10?"_high":"")+(isVipMalldollar?"VIP":isGoldVipMalldollar?"GOLDVIP":isDiamondVipMalldollar?"DIAMONDVIP":"")}),React.createElement("span",null,percent+(percent<=9?"\u00A0":""))):null;};var ECoinsPercentSection=function(props){var _a=props.eCoinsRebateSchedule,eCoinsRebateSchedule=_a===void 0?{}:_a,name=props.name;var ecoinElement=null;var isMfood=hktvCommon.env.zone=="mfood"?true:false;var isCTM=hktvCommon.env.zone=="ctm"?true:false;if(!isMfood&&!isCTM){eCoinsRebateSchedule.forEach(function(ele){var startTime=ele.startTime,endTime=ele.endTime,rebatePercentage=ele.rebatePercentage,ecoinsDisplayThreshold=ele.ecoinsDisplayThreshold;var currentTime=Date.now();var threshold=ecoinsDisplayThreshold?ecoinsDisplayThreshold:2;if(currentTime>=startTime&¤tTime<=endTime){var percent=Number(rebatePercentage);if(_.isNumber(percent)&&percent>0&&percent>=threshold){ecoinElement=(React.createElement("div",{className:"e-coins-percent"},React.createElement("i",{className:"icECoinspercent"}),React.createElement("span",null,percent+(percent<=9?"\u00A0":""))));}}});}return ecoinElement;};var MalldollarCaptionSection=function(props){var _a=props.malldollarLabel,malldollarLabel=_a===void 0?{}:_a;var _b=malldollarLabel.malldollarLabelPercent,malldollarLabelPercent=_b===void 0?"":_b,_c=malldollarLabel.malldollarLabelAmountFormatted,malldollarLabelAmountFormatted=_c===void 0?"":_c,_d=malldollarLabel.isVipMalldollar,isVipMalldollar=_d===void 0?false:_d,_e=malldollarLabel.isGoldVipMalldollar,isGoldVipMalldollar=_e===void 0?false:_e,_f=malldollarLabel.isDiamondVipMalldollar,isDiamondVipMalldollar=_f===void 0?false:_f;var mallDollarStringResources=hktvCommon.stringResources.mallDollar;var classes={mallDollarCaption:true,vip:isVipMalldollar,goldvip:isGoldVipMalldollar,diamondvip:isDiamondVipMalldollar},percent=Number(malldollarLabelPercent);return(_.isNumber(percent)&&percent>0&&malldollarLabelAmountFormatted)?React.createElement("div",{className:classNames(classes)},React.createElement("span",null,mallDollarStringResources.mobileCaption),React.createElement("span",null,malldollarLabelAmountFormatted),React.createElement("span",null,mallDollarStringResources.mobileCaptionMallDollar)):null;};var PromotionLabel=function(props){var _a=props.promotionLabel,promotionLabel=_a===void 0?{}:_a;var promotionType=promotionLabel.promotionType,promotionCode=promotionLabel.promotionCode,promotionShortName=promotionLabel.promotionShortName,promotionUrl=promotionLabel.promotionUrl,isPromotionLabelNotClickable=promotionLabel.
6isPromotionLabelNotClickable;var isBmsm=promotionType==="buyMoreSaveMore";var inlineStyle=isBmsm?{background:"#E40032",border:"solid 1px #FFFFFF",color:"#FFFFFF",transform:"none",borderLeft:"none",borderRight:"none"}:{background:"#E40032",border:"solid 1px #FFFFFF",color:"#FFFFFF"};var spanStyle=isBmsm?{transform:"none"}:undefined;return React.createElement("div",{className:"promotion-label-wrapper"},React.createElement("div",{className:"promotion-label "+promotionType,"data-promocode":promotionCode,style:inlineStyle},React.createElement("a",{href:isPromotionLabelNotClickable?"javascript:void(0)":promotionUrl,onClick:function(ev){return _.isFunction(props.onClickHandler)&&props.onClickHandler();},target:"_blank",rel:"noopener",className:"linkText"},React.createElement("span",{style:spanStyle},promotionShortName))));};var MarketingLabel=(function(_super){__extends(MarketingLabel,_super);function MarketingLabel(){return _super!==null&&_super.apply(this,arguments)||this;}MarketingLabel.prototype.getEstimatedServerTimestamp=function(){var estimatedServerTimestamp=null;var timeDiff;timeDiff=Date.now()-clientInitTime;estimatedServerTimestamp=parseInt(serverTimestamp)+timeDiff;return estimatedServerTimestamp;};MarketingLabel.prototype.isWithInPeriod=function(startTime,endTime){var isBeforeEndTime=true;var isAfterStartTime=true;if(typeof serverTimestamp!=="undefined"&&serverTimestamp!==""&&typeof clientInitTime!=="undefined"&&clientInitTime!==""){if(endTime!==null&&endTime!==""){isBeforeEndTime=this.getEstimatedServerTimestamp()<endTime;}if(startTime!==null&&startTime!==""){isAfterStartTime=this.getEstimatedServerTimestamp()>startTime;}}return isBeforeEndTime&&isAfterStartTime;};MarketingLabel.prototype.render=function(){var _this=this;if(typeof this.props.marketingLabelUids==="undefined"||typeof marketingLabels==="undefined"){return null;}var marketingLabel=marketingLabels.find(function(label){return this.props.marketingLabelUids.indexOf(label.code)>=0&&this.isWithInPeriod(label.startTime,label.endTime);}.bind(this));if(typeof marketingLabel!=="undefined"&&marketingLabel){typeof bottomLabelHeight!=="undefined"?bottomLabelHeight+=25:bottomLabelHeight=0;return(React.createElement("div",{className:"marketing-label-wrapper",style:this.props.style},React.createElement("div",{className:"marketing-label",style:{border:"solid 1px #FFFFFF",background:"#E40032"}},React.createElement("a",{className:"linkText",onClick:function(){return _.isFunction(_this.props.onClickHandler)&&_this.props.onClickHandler(marketingLabel.code);},href:marketingLabel.clickThroughUrl,target:"_blank",rel:"noopener"},React.createElement("span",{style:{color:"#FFFFFF"}},marketingLabel.name)))));}else{return null;}};return MarketingLabel;}(React.Component));var PickLabel=(function(_super){__extends(PickLabel,_super);function PickLabel(){return _super!==null&&_super.apply(this,arguments)||this;}PickLabel.prototype.render=function(){if(typeof this.props.pickLabelUids==="undefined"||typeof pickLabels==="undefined"){return null;}var pickLabel=pickLabels.find(function(label){return this.props.pickLabelUids.indexOf(label.uid)>=0;}.bind(this));if(typeof pickLabels!=="undefined"&&pickLabels&&pickLabels.length>0&&typeof pickLabel!=="undefined"){return(React.createElement("div",{className:"pick-label-wrapper"},React.createElement("div",{className:"pick-label"},React.createElement("a",{className:"linkText",href:pickLabel.clickThroughUrl,target:"_blank",rel:"noopener"},React.createElement("img",{src:pickLabel.iconUrl})))));}else{return null;}};return PickLabel;}(React.Component));var AddToWishlistButton=(function(_super){__extends(AddToWishlistButton,_super);function AddToWishlistButton(props){var _this=_super.call(this,props)||this;_this.onClickHandler=_this.onClickHandler.bind(_this);return _this;}AddToWishlistButton.prototype.componentDidMount=function(){this.$element=$(this.element);};AddToWishlistButton.prototype.onClickHandler=function(event){this.addToWishlistEvent(this.props);_.isFunction(this.props.onWishlistClickHandler)&&this.props.onWishlistClickHandler();};AddToWishlistButton.prototype.addToWishlistEvent=function(props){if(hktvCommon.env.webType=="mobile"){var id=this.props.id;var url=hktvCommon.addPrefixToHktvUrl("/wishlist/add/"+id);if(!hktvCommon.env.loggedin){window.location.href=url;return;}var $element_1=this.$element;var addtowishlistStringResources_1=hktvCommon.stringResources.addtowishlist;$.ajax({type:"post",url:url,cache:false,timeout:10000,success:function(responseData){if(responseData.indexOf("successfully")>=0||responseData.indexOf("already")>
6=0){var html=hktvCommon.templateForMessage(addtowishlistStringResources_1.added,"positive");$element_1.showHktvTooltips(html,"bottom");}else{var html=hktvCommon.templateForMessage(addtowishlistStringResources_1.full,"negative");$element_1.showHktvTooltips(html,"bottom");}},error:function(error){var html=hktvCommon.templateForMessage(addtowishlistStringResources_1.error,"negative");$element_1.showHktvTooltips(html,"bottom");console.log(error);}});hktvCommon.updateLastSeenCategory(props.primaryCatCode);}else{if(hktvCommon.env.loggedin){hktvCommon.showMyListQuickView(props.id,$(this),props.primaryCatCode);}else{var dialogHTML='<div class="spare-write-review-text"><span>'+hktvCommon.stringResources.general.pleaseLogin+'</span></div><button class="spare-write-review-ok squareButton green" onclick="javascript:$.colorbox.close()">'+hktvCommon.stringResources.general.ok+"</button>";ColorboxDesktop.show(dialogHTML,{width:700,closeButton:true});}}};AddToWishlistButton.prototype.render=function(){var _this=this;var _a=this.props,id=_a.id,baseProductId=_a.baseProductId,primaryCatCode=_a.primaryCatCode,name=_a.name,brandName=_a.brandName,storeId=_a.storeId,_b=_a.priceLabel,priceLabel=_b===void 0?{}:_b,numberOfVariants=_a.numberOfVariants,purchaseOption=_a.purchaseOption,stockStatus=_a.stockStatus;var priceRow=priceLabel.priceRow;var qty=1,pageType="productBrief";var classes={labelButton:true,"add-to-wishlist-button":true};return(React.createElement("button",{ref:function(element){return _this.element=element;},onClick:this.onClickHandler,className:classNames(classes),id:"","data-productcode":id,"data-category":primaryCatCode},React.createElement("div",{className:"spriteWrapper"},React.createElement("i",{className:"icAddtowishlist"})),React.createElement("span",null,hktvCommon.stringResources.general.addToWishlist)));};return AddToWishlistButton;}(React.Component));var ProductSurface=function(props){var showProductQuickViewEvent=function(){hktvCommon.showProductQuickView(props.id,$(""),props.primaryCatCode);_.isFunction(props.onQuickViewClickHandler)&&props.onQuickViewClickHandler();};var id=props.id,primaryCatCode=props.primaryCatCode,isZeroPrice=props.priceLabel.isZeroPrice;var title=hktvCommon.stringResources.general.quickView;return(React.createElement("div",{className:"product-surface"},React.createElement("div",{className:"product-surface-button-wrapper"},React.createElement("button",{onClick:showProductQuickViewEvent,className:"labelButton surface",title:title},React.createElement("div",{className:"spriteWrapper"},React.createElement("i",{className:"icQuickview"})),React.createElement("span",null,title))),React.createElement("div",{className:"product-surface-button-wrapper"},!isZeroPrice&&React.createElement(AddToWishlistButton,__assign({},props)))));};var PriceLabelSection=function(props){var _a=props.priceLabel,priceLabel=_a===void 0?{}:_a,hidePriceDropdown=props.hidePriceDropdown,priceDropdownButtonRef=props.priceDropdownButtonRef,isMainlandSamePrice=props.isMainlandSamePrice,hideMainlandSamePriceTag=props.hideMainlandSamePriceTag,greenLabData=props.greenLabData,_b=props.showKaPrice,showKaPrice=_b===void 0?false:_b;var promotionalClass=priceLabel.promotionalClass,promotionalRow=priceLabel.promotionalRow,priceClass=priceLabel.priceClass,priceRow=priceLabel.priceRow,showUpLabel=priceLabel.showUpLabel,upLabel=priceLabel.upLabel,showVipLabel=priceLabel.showVipLabel,isVipPrice=priceLabel.isVipPrice,showGoldVipLabel=priceLabel.showGoldVipLabel,isGoldVipPrice=priceLabel.isGoldVipPrice,showDiamondVipLabel=priceLabel.showDiamondVipLabel,isDiamondVipPrice=priceLabel.isDiamondVipPrice,showPlusPrice=priceLabel.showPlusPrice,hasMainlandPrice=priceLabel.hasMainlandPrice,hasMainlandPlusPrice=priceLabel.hasMainlandPlusPrice,isExternalProduct=priceLabel.isExternalProduct,showPersonalPrice=priceLabel.showPersonalPrice;var isMfood=hktvCommon.env.zone=="mfood";var isCTM=hktvCommon.env.zone=="ctm";var isPlusMember=hktvCommon.env.plusMembershipLevel=="PLUS";var shouldShowPlusPrice=isPlusMember&&showPlusPrice&&!showPersonalPrice;var renderPromotionalRow=function(){if(greenLabData&&greenLabData.formattedMarketPrice){return(React.createElement("div",{className:"promotional"},React.createElement("span",{className:"red"},hktvCommon.stringResources.greenLab.market,React.createElement("span",{className:"greenLab-formatted-market-price"},greenLabData.formattedMarketPrice))));}return(React.createElement("div",{className:"promotional"},React.createElement("span",{className:classNames(promotionalClass)},isMfood||isCTM||hasMainlandPrice?promotionalRow.replace("$","HKD"):promotionalRow)));};return React.createElement("div",{className:"price-label"},showKaPrice&&React.createElement(KaPriceSection,__assign({},props)),renderPromotionalRow(),priceRow&&React.createElement("div",{className:"price"},React.createElement("span",{className:classNames(priceClass)},isMfood||isCTM?priceRow.replace("$","HKD"):priceRow),showUpLabel&&!hasMainlandPrice&&React.createElement("span",{className:"upLabel"},upLabel),isVipPrice&&showVipLabel&&React.createElement("span",{className:"vip-highlight"}),isGoldVipPrice&&showGoldVipLabel&&React.createElement("span",{className:"goldvip-highlight"}),isDiamondVipPrice&&showDiamondVipLabel&&React.createElement("span",{className:"diamondvip-highlight"}),shouldShowPlusPrice&&React.createElement("span",{className:"plusmember-highlight"}),showPersonalPrice&&!shouldShowPlusPrice&&!hasMainlandPrice&&React.createElement("span",{className:"personal-highlight "+hktvCommon.env.currentLanguage}),!hidePriceDropdown&&!shouldShowPlusPrice&&!isExternalProduct&&!greenLabData&&React.createElement(PriceDropDownButton,{priceDropdownButtonRef:priceDropdownButtonRef})));};var PriceDropDownButton=function(props){return React.createElement("button",{className:"price-dropdown-button",ref:props.priceDropdownButtonRef});};var PriceDropDownSection=function(props){var SavedPriceLabel=function(props){var classes={savedPrice:true,vip:props.isVipSavedPrice,goldvip:props.isGoldVipSavedPrice,diamondvip:props.isDiamondVipSavedPrice};return React.createElement("div",{className:classNames(classes)},React.createElement("span",null,hktvCommon.stringResources.general.savedPrice),React.createElement("span",null,savedPriceFormatted));};var PriceDropDownMalldollarLabel=function(props){var _a=props.malldollarLabel,malldollarLabel=_a===void 0?{}:_a;var _b=malldollarLabel.malldollarLabelPercent,malldollarLabelPercent=_b===void 0?"":_b,_c=malldollarLabel.malldollarLabelAmountFormatted,malldollarLabelAmountFormatted=_c===void 0?"":_c,_d=malldollarLabel.isVipMalldollar,isVipMalldollar=_d===void 0?false:_d,_e=malldollarLabel.isGoldVipMalldollar,isGoldVipMalldollar=_e===void 0?false:_e,_f=malldollarLabel.isDiamondVipMalldollar,isDiamondVipMalldollar=_f===void 0?false:_f;
6var mallDollarStringResources=hktvCommon.stringResources.mallDollar;var classes={"price-dropdown-mallDollar-label":true,vip:isVipMalldollar,goldvip:isGoldVipMalldollar,diamondvip:isDiamondVipMalldollar},percent=Number(malldollarLabelPercent);return(_.isNumber(percent)&&percent>0&&malldollarLabelAmountFormatted)?React.createElement("div",{className:classNames(classes)},React.createElement("span",null,mallDollarStringResources.caption),React.createElement("span",null,malldollarLabelAmountFormatted)):null;};var PriceUpdatedDateLabel=function(_a){var priceUpdatedDate=_a.priceUpdatedDate;return React.createElement("div",{className:"priceLastUpdate"},React.createElement("span",null,priceUpdatedDate));};var savedPriceFormatted=props.savedPriceFormatted,isVipSavedPrice=props.isVipSavedPrice,isGoldVipSavedPrice=props.isGoldVipSavedPrice,isDiamondVipSavedPrice=props.isDiamondVipSavedPrice,priceDropdownSectionRef=props.priceDropdownSectionRef,priceUpdatedDate=props.priceUpdatedDate;return React.createElement("div",{className:"price-dropdown-wrapper",ref:priceDropdownSectionRef},savedPriceFormatted&&React.createElement(SavedPriceLabel,{savedPriceFormatted:savedPriceFormatted,isVipSavedPrice:isVipSavedPrice,isGoldVipSavedPrice:isGoldVipSavedPrice,isDiamondVipSavedPrice:isDiamondVipSavedPrice}),React.createElement(PriceDropDownMalldollarLabel,__assign({},props)),priceUpdatedDate&&React.createElement(PriceUpdatedDateLabel,{priceUpdatedDate:priceUpdatedDate}));};var storeTypeIconClass=function(storeType){if(storeType=="hktv_own_store"||storeType=="flagship_store"){return"store-name-label crown";}else{if(storeType=="plastic_reduction_store"){return"store-name-label plastic-reduction-icon";}else{return"store-name-label";}}};var ExternalAffliateTncPage=function(url){var isAffiliateUrl=url.includes("/external_affiliate");if(!isAffiliateUrl){window.open(url.replace(/&storeCode=[^&]*/g,""));}else{$.ajax({type:"get",url:url,cache:false}).then(function(html){$.colorbox({html:$(html),width:1100,height:700,fixed:true,overlayClose:true,close:'<i class="btnQuickViewClose"></i>',onOpen:function(){$("body").css("overflow","hidden");},onComplete:function(){},onClosed:function(){stoptimer=true;$("body").css("overflow","");}});});}};var AnimatedStoreLabel=function(props){var deliveryLabelCode=props.deliveryLabelCode;var isMainlandConsolidatedDelivery=deliveryLabelCode==="mainland-consolidated-delivery";var showDeliveryDays=isMainlandConsolidatedDelivery;var deliveryStatement=isMainlandConsolidatedDelivery?hktvCommon.stringResources.mainlandConsolidatedDelivery.deliveryStatement:"";return(React.createElement("div",{className:"displayStoreSection"},React.createElement("div",{className:"storeName "+(showDeliveryDays?"slide":"")},React.createElement("i",{className:"icStore"}),React.createElement("span",null,props.storeName)),showDeliveryDays&&React.createElement("div",{className:"deliveryDays slide"},deliveryStatement)));};var StoreNameSection=function(props){var storeName=props.storeName,officialWebsiteAffiliateUrl=props.officialWebsiteAffiliateUrl,displayStoreSquareLogoUrl=props.displayStoreSquareLogoUrl,externalAffiliateRedirectLink=props.externalAffiliateRedirectLink,id=props.id,storeId=props.storeId,source=props.source,_a=props.showAnimatedStoreLabel,showAnimatedStoreLabel=_a===void 0?true:_a;if(storeName){var isExternalProduct_1=officialWebsiteAffiliateUrl||externalAffiliateRedirectLink;var storeUrl=props.storeId?hktvCommon.addPrefixToHktvUrl("/s/"+props.storeId):"javascript:void(0);";var storeContent=function(){return isExternalProduct_1&&source!=="supermarket-promo-cat"?(React.createElement("div",{className:"displayStore-label-container",onClick:function(){return analytics.trackEventV2("display_store","officialWebsiteAffiliate",id+" | "+storeId,null);}},React.createElement("div",{className:"displayStore-square-logo-outer"},React.createElement("div",{className:"displayStore-square-logo-container"},React.createElement("div",{className:"displayStore-square-logo-inner"},displayStoreSquareLogoUrl?(React.createElement("img",{className:"displayStore-square-logo",src:displayStoreSquareLogoUrl}
6)):(React.createElement("svg",{width:"38",height:"38",viewBox:"0 0 38 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("rect",{width:"38",height:"38",rx:"4",fill:"#F0F0F0"}),React.createElement("path",{d:"M29.002 18.9984C29.0051 24.5126 24.5201 28.9984 19.002 29C13.4862 29.0023 8.99961 24.5181 8.99805 19.0016C8.99648 13.4858 13.4792 9.00235 18.9988 9C24.5154 8.99765 28.9988 13.4795 29.002 18.9984ZM16.1896 16.908C16.0517 18.322 16.047 19.7023 16.192 21.0834H21.8112C21.9499 19.6796 21.9531 18.2985 21.808 16.908H16.1896ZM16.4012 15.3278H21.5972C21.529 15.0096 21.4749 14.7133 21.4012 14.4225C21.1183 13.3008 20.7734 12.2027 20.0601 11.266C19.3398 10.3207 18.6547 10.3145 17.943 11.2621C17.0455 12.4574 16.7007 13.8675 16.4005 15.3278H16.4012ZM16.4381 22.6675C16.4318 22.7106 16.4193 22.7404 16.4248 22.767C16.6536 23.9498 16.9578 25.1115 17.5676 26.1618C17.7753 26.52 18.0418 26.8594 18.3396 27.1463C18.777 27.5672 19.2308 27.568 19.6635 27.1431C19.9723 26.8398 20.242 26.48 20.463 26.1069C20.9278 25.32 21.192 24.4491 21.4052 23.5642C21.4749 23.2734 21.5321 22.9795 21.5988 22.6683H16.4381V22.6675ZM14.5718 16.9142C14.5459 16.9095 14.5083 16.897 14.4715 16.897C13.3185 16.8954 12.1663 16.8978 11.0133 16.8923C10.8526 16.8915 10.8008 16.9511 10.7663 17.1024C10.4803 18.351 10.4818 19.5965 10.7522 20.8475C10.7954 21.0473 10.869 21.1132 11.0783 21.1108C12.1427 21.0991 13.208 21.1053 14.2724 21.1053H14.5718V16.9142ZM23.4282 16.8954V21.1053C24.6314 21.1053 25.8314 21.1085 27.0307 21.0967C27.0965 21.0967 27.2007 20.9854 27.2196 20.9094C27.5268 19.6451 27.5213 18.3792 27.236 17.1102C27.1976 16.9409 27.1325 16.89 26.9648 16.8923C26.3495 16.9009 25.7342 16.8954 25.1189 16.8954C24.5546 16.8954 23.9902 16.8954 23.4282 16.8954ZM23.1805 15.3294H26.6121C25.5586 13.2546 23.9785 11.8468 21.7649 11.0097C22.5339 12.4073 22.9125 13.8511 23.1805 15.3294ZM23.179 22.6644C22.9117 24.1646 22.5284 25.5974 21.7932 26.9393C23.5121 26.5662 26.453 23.9028 26.54 22.6644H23.179ZM16.1661 11.0709C14.0137 11.8531 12.4343 13.2609 11.3926 15.3254H14.8226C15.0891 13.8401 15.4685 12.4104 16.1669 11.0709H16.1661ZM14.8203 22.6722H11.4397C11.8371 24.1873 14.6745 26.7206 16.1967 26.919C15.4646 25.5857 15.0876 24.1466 14.8203 22.6722Z",fill:"black",fillOpacity:"0.38"})))))),React.createElement("div",{className:"displayStore-right"},React.createElement("div",{className:"displayStore-name"},props.storeName),React.createElement("div",{className:"displayStore-shopNow"},hktvCommon.stringResources.general.shopNow)))):(showAnimatedStoreLabel?React.createElement(AnimatedStoreLabel,__assign({},props)):React.createElement("div",null,React.createElement("i",{className:"icStore"}),React.createElement("span",null,props.storeName)));};return(React.createElement("a",{onClick:function(){if(isExternalProduct_1){ExternalAffliateTncPage(isExternalProduct_1);}else{_.isFunction(props.onClickHandler)&&props.onClickHandler();_.isFunction(props.onStoreNameClickHandler)&&props.onStoreNameClickHandler(props.primaryCatCode,props.storeId,props.id,props.mabsRefId);}},className:storeTypeIconClass(props.storeType),target:isExternalProduct_1?"":"_blank",href:isExternalProduct_1?"javascript:void(0);":storeUrl},storeContent()));}return null;};var DeliveryLabel=function(props){var deliveryMode=props.deliveryMode,deliveryLabelColorHex=props.deliveryLabelColorHex,deliveryLabelText=props.deliveryLabelText,deliveryLabelIconUrl=props.deliveryLabelIconUrl,_a=props.hoverEffect,hoverEffect=_a===void 0?false:_a;return(deliveryLabelColorHex&&deliveryLabelIconUrl&&deliveryLabelText&&deliveryLabelIconUrl?(React.createElement("div",{className:"deliveryLabel","data-delivery-mode":deliveryMode,"data-hover-effect":hoverEffect?"true":"false"},React.createElement("div",{className:"deliveryLabelBackdrop",style:{backgroundColor:deliveryLabelColorHex}},React.createElement("img",{className:"deliveryLabelIcon",src:deliveryLabelIconUrl}),React.createElement("div",{className:"deliveryLabelText"},deliveryLabelText)))):(React.createElement("div",null)));};var ImageDeliveryLabel=function(props){var deliveryMode=props.deliveryMode,labelURL=props.labelURL,deliveryLabelText=props.deliveryLabelText,_a=props.hoverEffect,hoverEffect=_a===void 0?false:_a;return(labelURL?(React.createElement("div",{className:"deliveryLabel imageDeliveryLabel","data-delivery-mode":deliveryMode,"data-hover-effect":hoverEffect?"true":"false"},React.createElement("img",{className:"deliveryLabelImage",src:labelURL,alt:deliveryLabelText||""}))):(React.createElement("div",null)));};var DeliveryOverseaLabel=function(props){var deliveryMode=props.deliveryMode,deliveryLabelColorHex=props.deliveryLabelColorHex,deliveryLabelText=props.deliveryLabelText,_a=props.hoverEffect,hoverEffect=_a===void 0?false:_a;return(deliveryLabelColorHex&&deliveryLabelText?(React.createElement("div",{className:"deliveryOverSeaLabel","data-delivery-mode":deliveryMode,"data-hover-effect":hoverEffect?"true":"false"},React.createElement("div",{className:"deliveryOverSeaLabelBackdrop",style:{backgroundColor:"white",border:"2px",borderStyle:"solid",borderColor:deliveryLabelColorHex}},React.createElement("div",{className:"deliveryLabelText"},deliveryLabelText)))):(React.createElement("div",null)));};var UpperWrapper=function(props){var _a=props.showSalesNumber,showSalesNumber=_a===void 0?false:_a,salesNumberString=props.salesNumberString,hideMainlandShippingTag=props.hideMainlandShippingTag,isMainlandSamePrice=props.isMainlandSamePrice,deliveryModeCode=props.deliveryModeCode,greenLabData=props.greenLabData;var height=38;height+=17;height+=19;showSalesNumber?height+=20:null;return React.createElement("div",{className:"upper-wrapper",style:{height:height},"data-id":props.isThirdPartyLogisticsWarehouse?props.isThirdPartyLogisticsWarehouse:"","data-info":props.isPriorSKU?props.isPriorSKU:""},React.createElement("div",{className:"brand-product-name"},greenLabData&&React.createElement(GreenLabTag,{expiryType:greenLabData.expiryType}),React.createElement("h4",null,props.brandProductName)),props.packingSpec!=""&&React.createElement("div",{className:"packing-spec"},React.createElement("span",null,props.packingSpec)),showSalesNumber&&React.createElement("div",{className:"salesNumber-container"},React.createElement("span",null,salesNumberString)),props.averageRating!=0&&!props.greenLabData&&React.createElement("div",{className:"review-info"},React.createElement(RatingStar,{width:91,rating:props.averageRating,starmaskID:props.id,clickable:false,onClickCheckSubmitButton:false,formSubmitting:false,colorTheme:!_.isEmpty(props.colorTheme)?props.colorTheme:(props.zone=="fashion"?"black":"")}
6),props.numberOfReviews>0&&React.createElement("span",{className:"review-number"},"(",props.numberOfReviews>9999?"9999+":props.numberOfReviews,")")));};var LowerWrapper=function(props){var height=0;var _a=props.priceLabel,priceRows=_a.priceRows,hasPlusPrice=_a.hasPlusPrice,showPlusPriceSaved=_a.showPlusPriceSaved,showPersonalPrice=_a.showPersonalPrice,_b=props.showStoreName,showStoreName=_b===void 0?false:_b,_c=props.hidePriceLabel,hidePriceLabel=_c===void 0?false:_c,_d=props.showMalldollarPrecentCaption,showMalldollarPrecentCaption=_d===void 0?false:_d,_e=props.showDeliveryLabel,showDeliveryLabel=_e===void 0?false:_e,deliveryLabelCode=props.deliveryLabelCode,_f=props.showDeliveryRegionLabel,showDeliveryRegionLabel=_f===void 0?false:_f,overseasRegionCodes=props.overseasRegionCodes,hidePlusPriceSection=props.hidePlusPriceSection,_g=props.isMainlandSamePrice,isMainlandSamePrice=_g===void 0?false:_g,_h=props.hideMainlandSamePriceTag,hideMainlandSamePriceTag=_h===void 0?false:_h,_j=props.hideMainlandStoreName,hideMainlandStoreName=_j===void 0?false:_j,_k=props.showAnimatedStoreLabel,showAnimatedStoreLabel=_k===void 0?true:_k,greenLabData=props.greenLabData,_l=props.showKaPrice,showKaPrice=_l===void 0?false:_l;var isMfood=hktvCommon.env.zone=="mfood";var isCTM=hktvCommon.env.zone=="ctm";var labelData=deliveryLabelExplanations?deliveryLabelExplanations.find(function(data){return data.deliveryMode===deliveryLabelCode;}):null;var exactTimeLabel=typeof hktvCommon.resolveExactTimeDeliveryLabel==="function"?hktvCommon.resolveExactTimeDeliveryLabel({deliveryLabelCode:deliveryLabelCode,deliveryLabelScheduleCode:props.deliveryLabelScheduleCode,isExpressDeliverableSku:props.isExpressDeliverableSku,isMerchantWetmarketWarehouse:props.isMerchantWetmarketWarehouse,wetmarketCodeList:props.wetmarketCodeList}):null;var overseaLabelList=overseasRegionCodes.map(function(label){return deliveryRegionLabelExplanations?deliveryRegionLabelExplanations.find(function(data){return data.regionCode===label;}):null;}).filter(function(result){return result;});var isPlusMember=hktvCommon.env.plusMembershipLevel=="PLUS";var showPlusPriceSection=isPlusMember&&showPlusPriceSaved&&!hidePlusPriceSection&&!isMfood&&!isCTM;if(showPlusPriceSection&&!showPersonalPrice){height+=140;}else{if(!hidePriceLabel&&priceRows!=0){height+=42;}if(showDeliveryLabel){height+=29;}if(showDeliveryRegionLabel){height+=29;}if(showStoreName){height+=21;}if(showMalldollarPrecentCaption){height+=17;}if(showKaPrice){height+=15;}}var renderStoreNameSection=function(){var isMainlandConsolidatedDelivery=deliveryLabelCode==="mainland-consolidated-delivery";if(isMainlandSamePrice&&isMainlandConsolidatedDelivery&&!hideMainlandStoreName){return React.createElement(MainlandStoreNameSection,__assign({},props));}if(!isMainlandSamePrice&&greenLabData){return React.createElement(GreenLabStoreNameSection,__assign({},props));}if(showStoreName){return React.createElement(StoreNameSection,__assign({},props));}return null;};var renderDeliveryLabelData=function(data){if(!data||!data.labelURL){return null;}return React.createElement(ImageDeliveryLabel,{deliveryMode:data.deliveryMode,labelURL:data.labelURL,deliveryLabelText:data.name,hoverEffect:false});};var deliveryLabelToRender=exactTimeLabel||labelData;var renderDeliveryLabelSection=function(){return renderDeliveryLabelData(deliveryLabelToRender);};var renderPriceLabelSection=function(){if(!priceRows){return null;}if(greenLabData&&greenLabData.discountPercentage>=10){return React.createElement("div",{className:"greenLabPriceLabelSection"},React.createElement(PriceLabelSection,__assign({},props)),React.createElement(GreenLabDiscountLabel,__assign({},props)));}return React.createElement(PriceLabelSection,__assign({},props));};return height!=0?(React.createElement("div",{className:"lower-wrapper",style:{height:height,display:isMfood||isCTM?"flex":"block",alignItems:isMfood||isCTM?"flex-end":"stretch",position:"relative"}},renderPriceLabelSection(),showDeliveryLabel&&deliveryLabelToRender&&deliveryLabelToRender.labelURL&&!isMfood&&!isCTM&&(React.createElement("div",{className:"delivery-label-container"},renderDeliveryLabelSection())),showPlusPriceSection&&!showPersonalPrice?(React.createElement(PlusPriceSection,__assign({},props))):(React.createElement("div",null,showDeliveryRegionLabel&&overseaLabelList.length>0&&!isMfood&&!isCTM&&(React.createElement("div",{className:"overseas-delivery-label-container"},React.createElement("span",{className:"deliveryRegionTitle"},hktvCommon.stringResources.deliveryLabel.overSeaDeliveryLabel),React.createElement("div",{className:"deliveryRegionList"},overseaLabelList.map(function(label){return(React.createElement(DeliveryOverseaLabel,{key:label.regi
6onCode,deliveryMode:label.regionCode,deliveryLabelColorHex:label.bgColor,deliveryLabelText:label.shortName,hoverEffect:false}));})))),renderStoreNameSection())))):null;};var addNoStockRedirectToPdpUrl=function(url){if(!url||url.indexOf("/p/")<0||/[?&]noStockRedirect=/.test(url)){return url;}var hashIndex=url.indexOf("#");var hash=hashIndex>=0?url.substring(hashIndex):"";var baseUrl=hashIndex>=0?url.substring(0,hashIndex):url;var separator=baseUrl.indexOf("?")>=0?"&":"?";return""+baseUrl+separator+"noStockRedirect=true"+hash;};var ProductBriefContainer=function(props){var _a=props.classes,classes=_a===void 0?{}:_a,product=props.product,id=props.id,url=props.url,onMouseLeave=props.onMouseLeave,children=props.children,isStaySamePage=props.isStaySamePage,onClickHandler=props.onClickHandler;var externalAffiliateRedirectLink=product?product.externalAffiliateRedirectLink:"";var officialWebsiteAffiliateUrl=product?product.officialWebsiteAffiliateUrl:"";var cashbackUrl=externalAffiliateRedirectLink||officialWebsiteAffiliateUrl;var isPriceEmpty=product?product.priceLabel.priceRow==="":false;var href=cashbackUrl&&isPriceEmpty?"javascript:void(0);":url;return(React.createElement("div",{className:classNames(classes),key:id,"data-id":id,onMouseLeave:onMouseLeave},children,React.createElement("a",{href:href,target:isStaySamePage||cashbackUrl?"":"_blank",onClick:function(){return cashbackUrl&&isPriceEmpty?ExternalAffliateTncPage(cashbackUrl):onClickHandler();}})));};var ProductBriefContainerBuyMoreSaveMore=function(props){var _a=props.classes,classes=_a===void 0?{}:_a;return React.createElement("div",{className:classNames(classes),key:props.id,"data-id":props.id,onMouseLeave:props.onMouseLeave},props.children,React.createElement("a",{href:props.url,target:props.isStaySamePage?"":"_blank",rel:props.isStaySamePage?"":"noopener"}));};var AdditionalLabel=function(props){switch(props.type){case"mabs":return(React.createElement("p",{className:"square-wrapper__advertisingIcon",style:{bottom:bottomLabelHeight.toString(),left:"5px",top:"initial",right:"initial",backgroundColor:"rgba(255, 255, 255, 0.50)",color:"#000000"}},(hktvCommon.stringResources.mabsAd||"Ad")));case"purchased":return(React.createElement("p",{className:"square-wrapper__advertisingIcon",style:{backgroundColor:"#36b449",color:"#fff"}},props.product.additionalLabelForPurchasedList));default:return(typeof props.product.additionalLabel!=="undefined"&&React.createElement("p",{className:"square-wrapper__advertisingIcon",style:{backgroundColor:"#36b449",color:"#fff"}},props.product.additionalLabel));}};var PlusPriceSection=function(props){var _a=props.priceLabel,priceLabel=_a===void 0?{}:_a;var plusSavedPrice=priceLabel.plusSavedPrice,showPlusPriceSaved=priceLabel.showPlusPriceSaved;var plusString=hktvCommon.stringResources.plusMember;var isPlusMember=hktvCommon.env.plusMembershipLevel=="PLUS";var savedText=priceLabel.hasMainlandPlusPrice&&priceLabel.hasMainlandPrice&&hktvCommon.env.currentLanguage==="zh"?plusString.savedCN:plusString.saved;if(!isPlusMember||!showPlusPriceSaved){return null;}return(React.createElement("div",{className:"plusPriceSection"},React.createElement("div",{className:"plusPriceSection--top"},React.createElement("img",{src:"/_ui/common/images/plus_membership/plusLogo.svg"})),React.createElement("div",{className:"plusPriceSection--bottom"},React.createElement("span",null,savedText," ",plusSavedPrice))));};var MainlandSamePriceTag=function(props){var id=props.id;var hasMainlandSamePriceRedirectUrl=typeof mainlandSamePriceRedirectUrl!=="undefined"&&mainlandSamePriceRedirectUrl!==null&&mainlandSamePriceRedirectUrl!=="";var handleClick=function(event){analytics.trackEventV2("mainlandprice","ismainlandsameprice_tag",id);if(!hasMainlandSamePriceRedirectUrl){event.preventDefault();}else{window.location.href=mainlandSamePriceRedirectUrl;}};var imageSrc=hktvCommon.env.currentLanguage==="en"?"/_ui/common/images/mainland_consolidated_delivery/mainland_same_price_tag_en.svg":"/_ui/common/images/mainland_consolidated_delivery/mainland_same_price_tag_zh_CN.svg";return(React.createElement("span",{className:"mainlandSamePrice-tag",onClick:handleClick},React.createElement("img",{className:"mainlandSamePrice-tag-img",src:imageSrc})));};var FreeShippingMainlandTag=function(props){var deliveryModeCode=props.deliveryModeCode,isMainlandSamePrice=props.isMainlandSamePrice,hideMainlandShippingTag=props.hideMainlandShippingTag;var checkDeliveryMode=deliveryModeCode=="hktv-standard-delivery"||deliveryModeCode=="hktv-non-standard-delivery";var checkPickupThreshold=typeof pickupThreshold!=="undefined"&&pickupThreshold!==null&&(pickupThreshold<=1);var showMainlandShippingTag=!hideMainlandShippingTag&&(isMainlandSamePrice&&checkDeliveryMode&&checkPickupThreshold);var imageSrc=hktvCommon.env.currentLanguage==="en"?"/_ui/common/images/mainland_consolidated_delivery/free_mainland_shipping_tag_en.svg":"/_ui/common/images/mainland_consolidated_delivery/free_mainland_shipping_tag_zh_CN.svg";if(showMainlandShippingTag){return(React.createElement("span",{className:"free-mainland-shipping-tag"},React.createElement("img",{className:"free-mainland-shipping-tag-img",src:imageSrc})));}return null;};var MainlandStoreNameSection=function(props){var id=props.id,storeName=props.storeName,storeId=props.storeId,warehouseState=props.warehouseState,warehouseCity=props.warehouseCity,deliveryLabelCode=props.deliveryLabelCode;var isMainlandConsolidatedDelivery=deliveryLabelCode==="mainland-consolidated-delivery";var showDeliveryDays=isMainlandConsolidatedDelivery;var deliveryStatement=isMainlandConsolidatedDelivery?hktvCommon.stringResources.mainlandConsolidatedDelivery.deliveryStatement:"";if(storeName){var storeUrl=props.storeId?hktvCommon.addPrefixToHktvUrl("/s/"+props.storeId):"javascript:void(0);";var mainlandStoreNameSectionText=storeName;if(!(warehouseState===""||warehouseCity==="")){mainlandStoreNameSectionText=warehouseState+" "+warehouseCity+hktvCommon.stringResources.mainlandSamePrice.deliver+mainlandStoreNameSectionText;}return(React.createElement("a",{className:"mainlandStoreNameSection",onClick:function(){_.isFunction(props.onClickHandler)&&props.onClickHandler();_.isFunction(props.onStoreNameClickHandler)&&props.onStoreNameClickHandler(props.primaryCatCode,props.storeId,props.id,props.mabsRefId);
6analytics.trackEventV2("mainlandprice","mainland_store_label",id+" "+storeId);},target:"_blank",href:storeUrl},React.createElement("div",{className:"mainlandStoreNameSection__text"},React.createElement("div",{className:"mainlandStoreNameSection__text__storeName "+(showDeliveryDays?"slide":"")},React.createElement("div",{className:"mainlandStoreNameSection__text__storeName__text"},mainlandStoreNameSectionText)),showDeliveryDays&&React.createElement("div",{className:"mainlandStoreNameSection__text__deliveryDays slide"},React.createElement("div",{className:"mainlandStoreNameSection__text__deliveryDays__text"},deliveryStatement))),React.createElement("div",{className:"mainlandStoreNameSection__btn"},React.createElement("img",{className:"mainlandStoreNameSection__btn__icon",src:"/_ui/common/images/mainland_consolidated_delivery/chevron_right.svg"}))));}return null;};var GreenLabImageOverlay=function(_a){var _b=_a.size,size=_b===void 0?"default":_b,props=__rest(_a,["size"]);var greenLabData=props.greenLabData;if(!greenLabData){return null;}var sizeClass=size==="default"?"":"greenLabImageOverlay__"+size;if(greenLabData.expiryType==="bestDeal"){return(React.createElement("div",{className:"greenLabImageOverlay "+sizeClass},React.createElement("div",{className:"greenLabImageOverlay__expiryDate"},React.createElement("span",null,hktvCommon.stringResources.greenLab.clearance))));}var expiryDate=size==="small"?greenLabData.expiryDate.split("/").slice(0,2).join("/"):greenLabData.expiryDate;return(React.createElement("div",{className:"greenLabImageOverlay "+sizeClass},greenLabData.expiryType!=="bestDeal"&&greenLabData.expiryDate&&(React.createElement("div",{className:"greenLabImageOverlay__expiryDate"},hktvCommon.env.currentLanguage==="en"?React.createElement("span",null,expiryDate," ",hktvCommon.stringResources.greenLab.exp):React.createElement("span",null,hktvCommon.stringResources.greenLab.exp," ",expiryDate)))));};var GreenLabTag=function(_a){var expiryType=_a.expiryType;if(expiryType!=="expired"){return null;}return(React.createElement("div",{className:"greenLab-tag"},hktvCommon.stringResources.greenLab.expired));};var GreenLabDiscountLabel=function(props){var greenLabData=props.greenLabData,showMainlandPrice=props.showMainlandPrice,showKaPrice=props.showKaPrice;if(!greenLabData||showMainlandPrice||showKaPrice){return null;}return(React.createElement("div",{className:"greenLabDiscountLabel"},React.createElement("img",{className:"greenLabDiscountLabel__icon",src:"/_ui/common/images/green_lab/discount_label.svg",alt:"green_lab_discount_label"}),React.createElement("div",{className:"greenLabDiscountLabel__discountPercentage"},React.createElement("span",null,greenLabData.discountPercentage),React.createElement("span",{className:"greenLabDiscountLabel__percentage"},"%"))));};var GreenLabStoreNameSection=function(props){var id=props.id,storeName=props.storeName,storeId=props.storeId,showDeliveryRegionLabel=props.showDeliveryRegionLabel,overseasRegionCodes=props.overseasRegionCodes,_a=props.isFashionProductBrief,isFashionProductBrief=_a===void 0?false:_a;if(!storeName){return null;}var storeUrl=props.storeId?hktvCommon.addPrefixToHktvUrl("/s/"+props.storeId):"javascript:void(0);";var marginTop=0;var overseaLabelList=overseasRegionCodes.map(function(label){return deliveryRegionLabelExplanations?deliveryRegionLabelExplanations.find(function(data){return data.regionCode===label;}):null;}).filter(function(result){return result;});if(!isFashionProductBrief&&showDeliveryRegionLabel&&overseaLabelList.length===0){marginTop+=26;}return(React.createElement("a",{className:"greenLabStoreNameSection",style:{marginTop:marginTop},onClick:function(){_.isFunction(props.onClickHandler)&&props.onClickHandler();_.isFunction(props.onStoreNameClickHandler)&&props.onStoreNameClickHandler(props.primaryCatCode,props.storeId,props.id,props.mabsRefId);analytics.trackEventV2("greenlab","green_lab_store_label",id+" "+storeId);},target:"_blank",href:storeUrl},React.createElement("span",{className:"greenLabStoreNameSection__text"},storeName),React.createElement("img",{src:"/_ui/common/images/green_lab/chevron_right.svg"})));};var KaPriceSection=function(props){var mappedKaPrice=props.mappedKaPrice,showKaPrice=props.showKaPrice,priceLabel=props.priceLabel,_a=props.isFashionBrief,isFashionBrief=_a===void 0?false:_a,greenLabData=props.greenLabData,showMainlandPrice=props.showMainlandPrice;var promotionalRow=priceLabel.promotionalRow;var paddingTop=(showKaPrice&&!(promotionalRow)&&!isFashionBrief)?15:0;var zIndex=(greenLabData&&!showMainlandPrice)?0:-1;if(mappedKaPrice){var stampUrl=mappedKaPrice.stampUrl;return(React.createElement("div",{className:"kaPrice",style:{paddingTop:paddingTop}},React.createElement("div",{className:"tag",style:{zIndex:zIndex+1}},React.createElement("div",{className:"name"},mappedKaPrice.shortName),React.createElement("div",{className:"price"},mappedKaPrice.formattedValue)),stampUrl&&(React.createElement("img",{className:"kaPriceStamp",src:stampUrl,style:{zIndex:zIndex}}))));}return(React.createElement("div",{className:"kaPrice",style:{paddingTop:paddingTop}}));};var ProductBriefDefault=(function(_super){__extends(ProductBriefDefault,_super);
6function ProductBriefDefault(props){var _this=_super.call(this,props)||this;_this.state={show:false};_this.setStockStatusState=_this.setStockStatusState.bind(_this);_this.mouseOut=_this.mouseOut.bind(_this);_this.mouseIn=_this.mouseIn.bind(_this);return _this;}ProductBriefDefault.prototype.setStockStatusState=function(status){this.props.setProductBriefListStockStatus(this.props.index,status);};ProductBriefDefault.prototype.bindPriceDropdown=function(){var $priceDropdownButton=$(this.priceDropdownButtonElement);if($priceDropdownButton.length>0&&!_.isEmpty(this.priceDropdownSectionElement)&&!_.isEmpty(this.priceDropdownSectionElement.innerHTML)){var $priceDropdownSection=$(this.priceDropdownSectionElement);hktvCommon.bindTooltipster($priceDropdownButton,{position:"bottom",theme:"tooltipster-default tooltipsterForPriceDropdown ",content:$priceDropdownSection,hideOnClick:false});}};ProductBriefDefault.prototype.mouseOut=function(evt){this.setState({show:false});};ProductBriefDefault.prototype.mouseIn=function(evt){this.setState({show:true});};ProductBriefDefault.prototype.componentDidMount=function(){this.bindPriceDropdown();};ProductBriefDefault.prototype.componentDidUpdate=function(nextProps,nextState,nextContext){this.bindPriceDropdown();};ProductBriefDefault.prototype.render=function(){var _this=this;var props=this.props;var stockStatus=props.stockStatus,isZeroPrice=props.priceLabel.isZeroPrice,hidePriceDropdown=props.hidePriceDropdown,malldollarLabelPercent=props.malldollarLabel.malldollarLabelPercent,savedPriceFormatted=props.savedPriceFormatted,priceUpdatedDate=props.priceUpdatedDate,deliveryLabelCode=props.deliveryLabelCode,officialWebsiteAffiliateUrl=props.officialWebsiteAffiliateUrl,externalAffiliateRedirectLink=props.externalAffiliateRedirectLink;var vipBMSM=false;if(hktvCommon.env.userMembershipLevel=="VIP"){vipBMSM=true;}var malldollarLabelPercentNumber=Number(malldollarLabelPercent);if(!(_.isNumber(malldollarLabelPercentNumber)&&malldollarLabelPercentNumber>0)&&_.isEmpty(savedPriceFormatted)&&_.isEmpty(priceUpdatedDate)){hidePriceDropdown=true;}bottomLabelHeight=0;if(props.promotionLabel.promotionShortName){bottomLabelHeight+=25;}var classes={"product-brief":true,"fashion":props.zone=="fashion","white":props.colorTheme=="white","BMSM-brief-btn":(!props.hideBriefButton&&stockStatus!="soldOut"&&stockStatus!="outOfStock"&&!isZeroPrice&&props.buyMoreSaveMore&&props.buyMoreSaveMore.promotionLevels&&props.buyMoreSaveMore.promotionLevels.length>0),"displayStore":Boolean(officialWebsiteAffiliateUrl||externalAffiliateRedirectLink),"isGreenLab":!!props.greenLabData,"officialWebsiteAffiliateUrl":officialWebsiteAffiliateUrl,"externalAffiliateRedirectLink":externalAffiliateRedirectLink};return(React.createElement(ProductBriefContainer,{product:props,classes:classes,id:props.id,url:props.url,isStaySamePage:props.isStaySamePage,onMouseLeave:this.mouseOut,onClickHandler:function(){if(props.mabsRefId){}typeof props.onProductClickHandler==="function"&&props.onProductClickHandler();}},React.createElement("div",{className:"square-wrapper"},React.createElement(UIImageContainer,{src:props.image.url,alt:props.image.alt,width:"100%",height:"100%",videoThumbnailUrl:props.videoThumbnailUrl}),props.greenLabData&&React.createElement(GreenLabImageOverlay,__assign({},props)),stockStatus!=="soldOut"&&stockStatus!=="outOfStock"&&typeof marketingLabels!=="undefined"&&marketingLabels&&marketingLabels.length>0&&typeof props.marketingLabelUids!=="undefined"&&props.marketingLabelUids&&props.marketingLabelUids.length>0&&!props.greenLabData&&React.createElement(MarketingLabel,__assign({},props,{onClickHandler:_.isFunction(this.props.onMarketingLabelClickHandler)&&this.props.onMarketingLabelClickHandler(props.primaryCatCode,props.id,props.mabsRefId,props.storeId,props.additionalLabel,props.additionalLabelForPurchasedList,props.sourceId),style:{bottom:bottomLabelHeight.toString()}})),(typeof pickLabels!=="undefined"&&pickLabels&&pickLabels.length>0&&typeof props.pickLabelUids!=="undefined"&&props.pickLabelUids&&props.pickLabelUids.length>0&&React.createElement(PickLabel,__assign({},props)))||(props.additionalLabel&&props.additionalLabel.length>0&&React.createElement(AdditionalLabel,{type:"",product:props}))||(props.additionalLabelForPurchasedList&&props.additionalLabelForPurchasedList.length>0&&React.createElement(AdditionalLabel,{type:"purchased",product:props})),stockStatus=="soldOut"&&React.createElement(SoldOutLabel,null)||stockStatus=="outOfStock"&&React.createElement(OutOfStockLabel,null)||props.promotionLabel.promotionShortName&&!props.greenLabData&&React.createElement(PromotionLabel,__assign({},props,{onClickHandler:function(){return _.isFunction(props.onPromotionTagClickHandler)&&props.onPromotionTagClickHandler();}})),!props.hideProductSurface&&React.createElement(ProductSurface,__assign({},props)),!props.hideMalldollarPrecent&&React.createElement(MalldollarPercentSection,__assign({},props)),props.showEcoins&&React.createElement(ECoinsPercentSection,__assign({},props)),props.mabsRefId&&React.createElement(AdditionalLabel,{type:"mabs",product:props})),React.createElement("div",{className:"info-wrapper"},React.createElement(UpperWrapper,__assign({},props)),React.createElement(LowerWrapper,__assign({},props,{hidePriceDropdown:hidePriceDropdown,priceDropdownButtonRef:function(el){return _this.priceDropdownButtonElement=el;}})),!props.hideBriefButton&&!isZeroPrice&&!(props.isMerchantWetmarketWarehouse&&(!props.wetmarketCodeList||props.wetmarketCodeList.length===0))&&React.createElement(BriefButton,__assign({},props,{stockStatus:stockStatus,setStockStatusState:this.setStockStatusState,onClickHandler:props.AddToCartHandler})),!props.hideBriefButton&&stockStatus!="soldOut"&&stockStatus!="outOfStock"&&deliveryLabelCode!="closed-store"&&!isZeroPrice&&props.buyMoreSaveMore&&props.buyMoreSaveMore.promotionLevels&&props.buyMoreSaveMore.promotionLevels.length>0&&React.createElement("div",null,this.state.show&&React.createElement(Popup,__assign({},props)),React.createElement(BuyMoreButton,{colorCode:props.greenLabData?"#0D8063":vipBMSM&&props.buyMoreSaveMore.promotionLevels[0].vipmessage?"#7e3ac7":"#ee740e",onMouseEnter:this.mouseIn}))),!hidePriceDropdown&&React.createElement(PriceDropDownSection,__assign({},props,{priceDropdownSectionRef:function(el){return _this.priceDropdownSectionElement=el;}}))));};return ProductBriefDefault;}(React.Component));var ProductBrief=(function(_super){__extends(ProductBrief,_super);
6function ProductBrief(props){var _this=_super.call(this,props)||this;_this.state={show:false};_this.setStockStatusState=_this.setStockStatusState.bind(_this);_this.mouseOut=_this.mouseOut.bind(_this);_this.mouseIn=_this.mouseIn.bind(_this);if(typeof(withImpressionTrack)!=="undefined"&&props.mabsRefId!=undefined&&props.mabsRefId!==""){_this.productBriefDefaultWithImpression=withImpressionTrack(ProductBriefDefault);}return _this;}ProductBrief.prototype.setStockStatusState=function(status){this.props.setProductBriefListStockStatus(this.props.index,status);};ProductBrief.prototype.bindPriceDropdown=function(){var $priceDropdownButton=$(this.priceDropdownButtonElement);if($priceDropdownButton.length>0&&!_.isEmpty(this.priceDropdownSectionElement)&&!_.isEmpty(this.priceDropdownSectionElement.innerHTML)){var $priceDropdownSection=$(this.priceDropdownSectionElement);hktvCommon.bindTooltipster($priceDropdownButton,{position:"bottom",theme:"tooltipster-default tooltipsterForPriceDropdown ",content:$priceDropdownSection,hideOnClick:false});}};ProductBrief.prototype.mouseOut=function(evt){this.setState({show:false});};ProductBrief.prototype.mouseIn=function(evt){this.setState({show:true});};ProductBrief.prototype.componentDidMount=function(){this.bindPriceDropdown();};ProductBrief.prototype.componentDidUpdate=function(nextProps,nextState,nextContext){this.bindPriceDropdown();};ProductBrief.prototype.render=function(){var _this=this;var props=this.props;var template=props.template,stockStatus=props.stockStatus,isZeroPrice=props.priceLabel.isZeroPrice,hidePriceDropdown=props.hidePriceDropdown,malldollarLabelPercent=props.malldollarLabel.malldollarLabelPercent,savedPriceFormatted=props.savedPriceFormatted,priceUpdatedDate=props.priceUpdatedDate,deliveryLabelCode=props.deliveryLabelCode,officialWebsiteAffiliateUrl=props.officialWebsiteAffiliateUrl,externalAffiliateRedirectLink=props.externalAffiliateRedirectLink,source=props.source;var vipBMSM=false;if(hktvCommon.env.userMembershipLevel=="VIP"){vipBMSM=true;}var malldollarLabelPercentNumber=Number(malldollarLabelPercent);if(!(_.isNumber(malldollarLabelPercentNumber)&&malldollarLabelPercentNumber>0)&&_.isEmpty(savedPriceFormatted)&&_.isEmpty(priceUpdatedDate)){hidePriceDropdown=true;}bottomLabelHeight=0;if(props.promotionLabel.promotionShortName){bottomLabelHeight+=25;}switch(template){case"box":var classes={"product-brief":true};return(React.createElement(ProductBriefContainer,{product:props,classes:classes,id:props.id,url:props.url,isStaySamePage:props.isStaySamePage},React.createElement("div",{className:"square-wrapper"},React.createElement(UIImageContainer,{src:props.image.url,alt:props.image.alt,width:"100%",height:"100%",videoThumbnailUrl:props.videoThumbnailUrl}))));case"horizontal":var classes={"product-brief":true,"horizontal":true};return(React.createElement(ProductBriefContainer,{product:props,classes:classes,id:props.id,url:props.url,isStaySamePage:props.isStaySamePage},React.createElement("div",{className:"left-wrapper"},React.createElement("div",{className:"square-wrapper"},React.createElement(UIImageContainer,{src:props.image.url,alt:props.image.alt,width:"100%",height:"100%",videoThumbnailUrl:props.videoThumbnailUrl}),stockStatus!=="soldOut"&&stockStatus!=="outOfStock"&&typeof marketingLabels!=="undefined"&&marketingLabels&&marketingLabels.length>0&&typeof props.marketingLabelUids!=="undefined"&&props.marketingLabelUids&&props.marketingLabelUids.length>0&&React.createElement(MarketingLabel,__assign({},props,{onClickHandler:_.isFunction(this.props.onMarketingLabelClickHandler)&&this.props.onMarketingLabelClickHandler(props.primaryCatCode,props.id,props.mabsRefId,props.storeId),style:{bottom:bottomLabelHeight.toString()}})),typeof pickLabels!=="undefined"&&pickLabels&&pickLabels.length>0&&typeof props.pickLabelUids!=="undefined"&&props.pickLabelUids&&props.pickLabelUids.length>0&&React.createElement(PickLabel,__assign({},props)),stockStatus=="soldOut"&&React.createElement(SoldOutLabel,null)||stockStatus=="outOfStock"&&React.createElement(OutOfStockLabel,null)||props.promotionLabel.promotionShortName&&React.createElement(PromotionLabel,__assign({},props)),!props.hideProductSurface&&React.createElement(ProductSurface,__assign({},props)),!props.hideMalldollarPrecent&&React.createElement(MalldollarPercentSection,__assign({},props)),props.showEcoins&&React.createElement(ECoinsPercentSection,__assign({},props)))),React.createElement("div",{className:"right-wrapper"},React.createElement("div",{className:"info-wrapper"},React.createElement(UpperWrapper,__assign({},props)),React.createElement(LowerWrapper,__assign({},props,{hidePriceDropdown:hidePriceDropdown,priceDropdownButtonRefpriceDropdownButtonRef:function(el){return _this.priceDropdownButtonElement=el;}})),!props.hideBriefButton&&!isZeroPrice&&!(props.isMerchantWetmarketWarehouse&&(!props.wetmarketCodeList||props.wetmarketCodeList.length===0))&&React.createElement(BriefButton,__assign({},props)))),!hidePriceDropdown&&React.createElement(PriceDropDownSection,__assign({},props,{priceDropdownSectionRef:function(el){return _this.priceDropdownSectionElement=el;}}))));case"mobile":var classes={"product-brief":true,"mobile":true};return(React.createElement(ProductBriefContainer,{product:props,classes:classe
6s,id:props.id,url:props.url,isStaySamePage:props.isStaySamePage,onClickHandler:function(){props.isShopinshopHotpicksForApps==true?InAppAnalytics.trackProductBrief_EventClick("hot_picks_pdp",typeof props.storeId!=="undefined"?props.storeId:"",typeof props.primaryCatCode!=="undefined"?props.primaryCatCode:"",typeof props.id!=="undefined"?props.id:"",typeof props.mabsRefId!=="undefined"?props.mabsRefId:""):props.isShopinshopStorePickListsForApps==true?InAppAnalytics.trackProductBrief_EventClick("store_pick_list_pdp",typeof props.storeId!=="undefined"?props.storeId:"",typeof props.primaryCatCode!=="undefined"?props.primaryCatCode:"",typeof props.id!=="undefined"?props.id:"",typeof props.mabsRefId!=="undefined"?props.mabsRefId:""):props.mabsRefId?function(){}:null;props.isShopinshopHotpicksForApps==true&&props.onEEHotPicksProductClickHandler();props.isShopinshopStorePickListsForApps==true&&props.onEEStorePicksListProductClickHandler();}},React.createElement("div",{className:"square-wrapper"},React.createElement(UIImageContainer,{src:props.image.url,alt:props.image.alt,width:"100%",height:"100%",onImgLoad:props.onImgLoad,videoThumbnailUrl:props.videoThumbnailUrl}),stockStatus!=="soldOut"&&stockStatus!=="outOfStock"&&typeof marketingLabels!=="undefined"&&marketingLabels&&marketingLabels.length>0&&typeof props.marketingLabelUids!=="undefined"&&props.marketingLabelUids&&props.marketingLabelUids.length>0&&React.createElement(MarketingLabel,__assign({},props,{onClickHandler:_.isFunction(this.props.onMarketingLabelClickHandler)&&this.props.onMarketingLabelClickHandler(typeof props.primaryCatCode!=="undefined"?props.primaryCatCode:"",typeof props.storeId!=="undefined"?props.storeId:"",typeof props.id!=="undefined"?props.id:"",typeof props.mabsRefId!=="undefined"?props.mabsRefId:"",typeof props.additionalLabel!=="undefined"?props.additionalLabel:"",typeof props.additionalLabelForPurchasedList!=="undefined"?props.additionalLabelForPurchasedList:"",typeof props.sourceId!=="undefined"?props.sourceId:""),style:{bottom:bottomLabelHeight.toString()}})),(typeof pickLabels!=="undefined"&&pickLabels&&pickLabels.length>0&&typeof props.pickLabelUids!=="undefined"&&props.pickLabelUids&&props.pickLabelUids.length>0&&React.createElement(PickLabel,__assign({},props)))||(props.additionalLabel&&props.additionalLabel.length>0&&React.createElement(AdditionalLabel,{type:"",product:props}))||(props.additionalLabelForPurchasedList&&props.additionalLabelForPurchasedList.length>0&&React.createElement(AdditionalLabel,{type:"purchased",product:props})),stockStatus=="soldOut"&&React.createElement(SoldOutLabel,null)||stockStatus=="outOfStock"&&React.createElement(OutOfStockLabel,null)||props.promotionLabel.promotionShortName&&React.createElement(PromotionLabel,__assign({},props)),!props.hideMalldollarPrecent&&React.createElement(MalldollarPercentSection,__assign({},props)),props.showEcoins&&React.createElement(ECoinsPercentSection,__assign({},props)),props.mabsRefId&&(hktvCommon.stringResources.mabsAd||"Ad")&&React.createElement(AdditionalLabel,{type:"mabs",product:props})),React.createElement("div",{className:"info-wrapper"},React.createElement(UpperWrapper,__assign({},props)),React.createElement(LowerWrapper,__assign({},props,{priceDropdownButtonRef:function(el){return _this.priceDropdownButtonElement=el;}})))));default:if(typeof(withImpressionTrack)!=="undefined"&&props.mabsRefId!=undefined&&props.mabsRefId!==""){return(React.createElement(this.productBriefDefaultWithImpression,__assign({onImpress:function(){analytics.trackEcommerceProductImpression({"id":props.id,"name":props.name,"brand":props.brandName,"category":props.primaryCatCode,"position":props.mabsAdPosition,"list":props.mabsRefId});}},props)));}else{return React.createElement(ProductBriefDefault,__assign({},props));}}};return ProductBrief;}(React.Component));var BriefButton=(function(_super){__extends(BriefButton,_super);function BriefButton(props){return _super.call(this,props)||this;}BriefButton.prototype.componentDidMount=function(){this.$element=$(this.element);};BriefButton.prototype.soldOutEvent=function(){};BriefButton.prototype.outOfStockEvent=function(){var _a=this.props,id=_a.id,baseProductId=_a.baseProductId,setStockStatusState=_a.setStockStatusState;var $element=this.$element;if(!hktvCommon.env.loggedin){window.location.href=hktvCommon.addPrefixToHktvUrl("/notifyMe/add_to_notify_me?sku="+id);return;}
6var productCode=$element.data("productcode")||"";var category=$element.data("category")||"";var pageName=hktvCommon.env.pageName||"";_.isFunction(this.props.onNotifyMeClickHandler)&&this.props.onNotifyMeClickHandler();if($element.hasClass("hasVariant")){hktvCommon.showProductQuickView(productCode,$element,category,{"pageName":pageName,"userAction":"notifyMe"});}else{$.ajax({type:"post",url:hktvCommon.addPrefixToHktvUrl("/notifyMe/add_to_notify_me"),data:{sku:id},cache:false,success:function(responseString){var notifyMeStrings=hktvCommon.stringResources.notifyMe;var viewListHtml='<a href="'+hktvCommon.addPrefixToHktvUrl("/wishlist/getWishlistPage/1/default")+'">'+notifyMeStrings.viewList+'<i class="icArrowrightBlack"></i></a>';if(responseString){var splitResponseString=responseString.split("-");var statusCode=splitResponseString[0];var reason=splitResponseString[1];if(statusCode=="success"){hktvCommon.addToWishlistAfterNotified(id,$element);if($element.data("page")=="quickview"){setTimeout(function(){if(hktvCommon.env.quickViewShowingProductCode==id){hktvCommon.showProductQuickView(id);}},3500);}}if(statusCode=="requestedBefore"){if(hktvCommon.env.pageName=="wishlistPage"){var html=hktvCommon.templateForMessage(notifyMeStrings.requestBefore,"neutral");}else{var html=hktvCommon.templateForMessage(notifyMeStrings.requestBefore+"<br/>"+viewListHtml,"neutral");}$element.showHktvTooltips(html,"bottom");}if(statusCode=="fail"){if(reason=="skuInStock"){var $parentButtonWrapper=$element.parent();var reloadCallback;if($element.data("page")=="productDetailPage"){reloadCallback=function(){setTimeout(function(){window.location.reload();},800);};var html=hktvCommon.templateForMessage(notifyMeStrings.skuInStock,"neutral");$element.showHktvTooltips(html,"bottom",reloadCallback);return;}setStockStatusState("inStock");var html=hktvCommon.templateForMessage(notifyMeStrings.skuInStock,"neutral");$element.showHktvTooltips(html,"bottom",reloadCallback);}else{if(reason=="skuSoldOut"){var html=hktvCommon.templateForMessage(notifyMeStrings.skuSoldOut,"neutral");$element.showHktvTooltips(html,"bottom");}else{if(reason=="reachedMaxLimit"){var html=hktvCommon.templateForMessage(notifyMeStrings.reachedMaxLimit,"neutral");$element.showHktvTooltips(html,"bottom");}else{var html=hktvCommon.templateForMessage(notifyMeStrings.error,"negative");$element.showHktvTooltips(html,"bottom");}}}}}},error:function(error){var notifyMeStrings=hktvCommon.stringResources.notifyMe;var html=hktvCommon.templateForMessage(notifyMeStrings.error,"negative");$element.showHktvTooltips(html,"bottom");console.log(error);},complete:function(){}});}};BriefButton.prototype.addtoCartEvent=function(){var _a=this.props,name=_a.name,id=_a.id,brandName=_a.brandName,baseProductId=_a.baseProductId,primaryCatCode=_a.primaryCatCode,setStockStatusState=_a.setStockStatusState,storeId=_a.storeId,storeIdOrig=_a.storeIdOrig,priceLabel=_a.priceLabel,specialAddCartFlowLink=_a.specialAddCartFlowLink,inStorePickUpCheckoutLink=_a.inStorePickUpCheckoutLink,externalAffiliateRedirectLink=_a.externalAffiliateRedirectLink,mabsRefId=_a.mabsRefId,additionalLabel=_a.additionalLabel,additionalLabelForPurchasedList=_a.additionalLabelForPurchasedList,sourceId=_a.sourceId,displayStoreSquareLogoUrl=_a.displayStoreSquareLogoUrl,officialWebsiteAffiliateUrl=_a.officialWebsiteAffiliateUrl,deliveryLabelCode=_a.deliveryLabelCode,trackingListName=_a.trackingListName,index=_a.index,moduleName=_a.moduleName,isMerchantWetmarketWarehouse=_a.isMerchantWetmarketWarehouse,wetmarketCodeList=_a.wetmarketCodeList;var $element=this.$element;var qty=1,pageType="productBrief";var self=this;_.isFunction(this.props.onAddToCartClickHandler)&&this.props.onAddToCartClickHandler();hktvCommon.addToCartWithWetmarketCheck({deliveryLabelProduct:this.props,product:{code:id,isMerchantWetmarketWarehouse:isMerchantWetmarketWarehouse,wetmarketCodeList:wetmarketCodeList||[]},qty:qty,pageType:pageType,$element:$element,doNormalAdd:function(){self.addtoCartEventOriginal();},onSuccess:function(responseData,context){if(context&&context.isReplacePath){hktvCommon.updateMiniCartCount();}},onError:function(responseData,errElement){hktvCommon.handleAddToCartError(errElement,responseData);}});};BriefButton.prototype.addtoCartEventOriginal=function(){var _a=this.props,name=_a.name,id=_a.id,brandName=_a.brandName,baseProductId=_a.baseProductId,primaryCatCode=_a.primaryCatCode,setStockStatusState=_a.setStockStatusState,storeId=_a.storeId,storeIdOrig=_a.storeIdOrig,priceLabel=_a.priceLabel,specialAddCartFlowLink=_a.specialAddCartFlowLink,inStorePickUpCheckoutLink=_a.inStorePickUpCheckoutLink,externalAffiliateRedirectLink=_a.externalAffiliateRedirectLink,mabsRefId=_a.mabsRefId,additionalLabel=_a.additionalLabel,additionalLabelForPurchasedList=_a.additionalLabelForPurchasedList,
6sourceId=_a.sourceId,displayStoreSquareLogoUrl=_a.displayStoreSquareLogoUrl,officialWebsiteAffiliateUrl=_a.officialWebsiteAffiliateUrl,deliveryLabelCode=_a.deliveryLabelCode,trackingListName=_a.trackingListName,index=_a.index,moduleName=_a.moduleName;var $element=this.$element;var qty=1,pageType="productBrief";var self=this;var productCode=$element.data("productcode")||"";var category=$element.data("category")||"";var pageName=hktvCommon.env.pageName||"";if($element.hasClass("hasVariant")){hktvCommon.recentSkuSource="recently_viewed_local";hktvCommon.purchasedSkuSource=sourceId;hktvCommon.showProductQuickView(productCode,$element,category,{"pageName":pageName,"userAction":"addToCart"});}else{if(specialAddCartFlowLink!=""){window.open(specialAddCartFlowLink,"_blank");}else{if(inStorePickUpCheckoutLink){window.location.href=inStorePickUpCheckoutLink;}else{if(externalAffiliateRedirectLink!=""){ExternalAffliateTncPage(externalAffiliateRedirectLink);}else{var doAddToCart=function(){$.ajax({type:"post",url:hktvCommon.addPrefixToHktvUrl("/cart/add"),data:{productCodePost:id,qty:qty,pageType:pageType},cache:false,success:function(responseData){var callback="";if(pageType=="quickview"){callback=function(){setTimeout(function(){ColorboxDesktop.close();},5000);};}var addtocartStrings=hktvCommon.stringResources.addtocart;var notifyMeStrings=hktvCommon.stringResources.notifyMe;if(typeof responseData.statusCode!="undefined"&&responseData.statusCode=="locallyNoStock"){var html_4=hktvCommon.templateForMessage(addtocartStrings.failNoStock,"negative");$element.showHktvTooltips(html_4,"bottom",callback);}else{if(typeof responseData.statusCode!="undefined"&&(responseData.statusCode=="stockNotifiable"||responseData.statusCode=="stockNotified")){var reloadCallback;if(pageType=="productDetailPage"){reloadCallback=function(){setTimeout(function(){window.location.reload();},800);};var html_5=hktvCommon.templateForMessage(notifyMeStrings.stockNotifiable,"negative");$element.showHktvTooltips(html_5,"bottom",reloadCallback);return;}var html_6=hktvCommon.templateForMessage(notifyMeStrings.stockNotifiable,"negative");$element.showHktvTooltips(html_6,"bottom",reloadCallback);setStockStatusState("outOfStock");}else{var addedQty=Number(responseData.quantityAdded);if(hktvCommon.env.webType=="mobile"){var proceedToPaymentHtml='<a href="'+hktvCommon.addPrefixToHktvUrl("/cart")+'">'+hktvCommon.stringResources.general.proceedToPaymentMobile+'<i class="icArrowrightBlack"></i></a>';}else{var proceedToPaymentHtml='<a href="'+hktvCommon.addPrefixToHktvUrl("/cart/checkout/select-flow?flow=express&pci=")+'">'+hktvCommon.stringResources.general.proceedToPayment+'<i class="icArrowrightBlack"></i></a>';}if(addedQty>0){var exactTimeLabel=hktvCommon.resolveExactTimeDeliveryLabel(self.props);var addToCartAnimationURL=hktvCommon.getAddToCartAnimationURL(deliveryLabelCode,exactTimeLabel&&exactTimeLabel.addToCartImageURL,!!exactTimeLabel);if(addToCartAnimationURL){hktvCommon.showEightHourSuccessOverlay(addToCartAnimationURL);}else{if(addedQty==qty){var html=hktvCommon.templateForMessage(addtocartStrings.succeed+"<br/>"+proceedToPaymentHtml,"positive");$element.showHktvTooltips(html,"bottom",callback);}else{var html=hktvCommon.templateForMessage(hktvCommon.springThemeReplace(addtocartStrings.succeedLowStock,addedQty)+"<br/>"+proceedToPaymentHtml,"neutral");$element.showHktvTooltips(html,"bottom",callback);}}}else{var $parentButtonWrapper=$element.parent();var reloadCallback;if($element.data("page")=="productDetailPage"){reloadCallback=function(){setTimeout(function(){window.location.reload();},800);};var html=hktvCommon.templateForMessage(notifyMeStrings.soldOut,"negative");$element.showHktvTooltips(html,"bottom",reloadCallback);return;}else{setStockStatusState("soldOut");}}}}hktvCommon.updateMiniCartCount();if($(".page-promotion").length>0){$("#product-search-container").data("promotionInfo").updatePromotionInfo();}},error:function(error){var addtocartStrings=hktvCommon.stringResources.addtocart;var html=hktvCommon.templateForMessage(addtocartStrings.error,"negative");$element.showHktvTooltips(html,"bottom");console.log(error);},complete:function(){}});if(typeof window.google_trackConversion=="function"){window.google_trackConversion({google_conversion_id:google_conversion_id,google_remarketing_only:google_remarketing_only,google_custom_params:{ecomm_prodid:id,ecomm_pagetype:"other",ecomm_category:primaryCatCode||"",addToCart:true}});}
6if(typeof analytics!="undefined"&&analytics!=null){analytics.trackPage("/_ga/click/add_to_cart");analytics.trackAddToCart(id,baseProductId,storeId,primaryCatCode,qty);var recentViewSource="";if(additionalLabelForPurchasedList){recentViewSource=sourceId;}else{if(additionalLabel){recentViewSource="recently_viewed_local";}}analytics.trackEcommerceAddToCart(hktvCommon.escapeHtml(name,true),id,priceLabel.priceRow,hktvCommon.escapeHtml(brandName,true),primaryCatCode,qty,storeId,storeIdOrig,recentViewSource,trackingListName,index+1,mabsRefId,moduleName);}};doAddToCart();}}}}};BriefButton.prototype.render=function(){var _this=this;var _a=this.props,id=_a.id,baseProductId=_a.baseProductId,primaryCatCode=_a.primaryCatCode,name=_a.name,brandName=_a.brandName,storeId=_a.storeId,_b=_a.priceLabel,priceLabel=_b===void 0?{}:_b,numberOfVariants=_a.numberOfVariants,purchaseOption=_a.purchaseOption,stockStatus=_a.stockStatus,deliveryLabelCode=_a.deliveryLabelCode,officialWebsiteAffiliateUrl=_a.officialWebsiteAffiliateUrl,externalAffiliateRedirectLink=_a.externalAffiliateRedirectLink,isMainlandSamePrice=_a.isMainlandSamePrice,hideMainlandSamePriceTag=_a.hideMainlandSamePriceTag,serviceDealOption=_a.serviceDealOption;var priceRow=priceLabel.priceRow;var qty=1,pageType="productBrief";var hasVariant=false;if(numberOfVariants&&numberOfVariants>1){hasVariant=true;}if(Object.keys(serviceDealOption).length>0){hasVariant=true;}var buttonAttributes={};switch(stockStatus){case"soldOut":buttonAttributes={spriteName:"",classes:{squareButton:true,disabled:true},title:hktvCommon.stringResources.general.soldOut,onClickEvent:this.soldOutEvent};break;case"outOfStock":buttonAttributes={spriteName:"icWhiteBell",classes:{sepaButton:true,"notify-me-button":true},title:hktvCommon.stringResources.general.notifyMe,onClickEvent:this.outOfStockEvent};break;default:var buttonText=hktvCommon.stringResources.general.addToCart;var spriteName_1="icAddtocart";if(officialWebsiteAffiliateUrl||externalAffiliateRedirectLink){buttonText=hktvCommon.stringResources.general.buyNow;spriteName_1="icExternalWeb";}buttonAttributes={spriteName:spriteName_1,classes:{sepaButton:true,"add-to-cart-button":true,"displayStore":Boolean(officialWebsiteAffiliateUrl||externalAffiliateRedirectLink),"officialWebsiteAffiliateUrl":officialWebsiteAffiliateUrl,"externalAffiliateRedirectLink":externalAffiliateRedirectLink},title:buttonText,onClickEvent:this.addtoCartEvent};}if(hasVariant){buttonAttributes.classes=_.assign({"hasVariant":true},buttonAttributes.classes);}var spriteName=buttonAttributes.spriteName,title=buttonAttributes.title,classes=buttonAttributes.classes,onClickEvent=buttonAttributes.onClickEvent;onClickEvent=onClickEvent.bind(this);var height=33.33;if(!(deliveryLabelCode!=null&&typeof deliveryLabelCode!="undefined"&&deliveryLabelCode=="closed-store"&&spriteName=="icAddtocart")){return(React.createElement("div",{className:"bottom-button-wrapper"},React.createElement("button",{ref:function(element){return _this.element=element;},onClick:function(){onClickEvent();typeof _this.props.onClickHandler==="function"&&_this.props.onClickHandler();},className:classNames(classes),id:"","data-productcode":id,"data-analytics-baseproduct":baseProductId,"data-qty":qty,"data-category":primaryCatCode,"data-pagetype":pageType,"data-productname":name,"data-productbrand":brandName,"data-storecode":storeId,"data-price":priceRow,title:title},React.createElement("div",{className:"spriteWrapper"},React.createElement("i",{className:spriteName})),React.createElement("span",null,title))));}else{return(React.createElement("div",{className:"bottom-button-wrapper",style:{height:height}}));}};return BriefButton;}(React.Component));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var __assign=(this&&this.__assign)||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)){t[p]=s[p];}}}return t;};var ProductBriefList=(function(_super){__extends(ProductBriefList,_super);
6function ProductBriefList(props){var _this=_super.call(this,props)||this;_this.setProductBriefListStockStatus=_this.setProductBriefListStockStatus.bind(_this);_this.state={productBriefList:_this.props.productBriefListData.productBriefList};return _this;}ProductBriefList.prototype.componentWillReceiveProps=function(nextProps){this.setState({productBriefList:nextProps.productBriefListData.productBriefList});};ProductBriefList.prototype.setProductBriefListStockStatus=function(index,status){this.setState(function(prevState){var productBriefList=prevState.productBriefList;productBriefList[index].stockStatus=status;return productBriefList;});};ProductBriefList.prototype.render=function(){var _this=this;var _a=this.props,_b=_a.productBriefListData.options,options=_b===void 0?{}:_b,_c=_a.classes,classes=_c===void 0?{}:_c;var template=options.template;var productBriefList=this.state.productBriefList;if(this.state.productBriefList.length==0){return null;}classes["product-brief-list"]=true;var AllProductBrief=function(){return(React.createElement("div",{className:classNames(classes)},_this.state.productBriefList.map(function(productBrief,index){return React.createElement("span",{className:"product-brief-wrapper",key:index}," ",React.createElement(ProductBrief,__assign({onClickGA:_this.props.onClickGA,AddToCartHandler:function(){return _.isFunction(_this.props.AddToCartHandler)&&_this.props.AddToCartHandler(productBrief.primaryCatCode,productBrief.id,productBrief.mabsRefId,productBrief.storeId);},onProductClickHandler:function(){return _.isFunction(_this.props.onProductClickHandler)&&_this.props.onProductClickHandler(productBrief.primaryCatCode,productBrief.id,productBrief.mabsRefId,productBrief.storeId,productBrief.name,productBrief.brandName,productBrief.priceLabel&&productBrief.priceLabel.priceRow,index+1,productBrief.objectID,productBrief.queryID,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId);},onNotifyMeClickHandler:function(){return _.isFunction(_this.props.onNotifyMeClickHandler)&&_this.props.onNotifyMeClickHandler(productBrief.primaryCatCode,productBrief.id,productBrief.mabsRefId,productBrief.storeId,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId);},onBMSMLevelClickHandler:function(qty,lv){return _.isFunction(_this.props.onBMSMLevelClickHandler)&&_this.props.onBMSMLevelClickHandler(productBrief.primaryCatCode,productBrief.id,qty,lv,productBrief.mabsRefId,productBrief.storeId,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId);},onAddToCartClickHandler:function(){return _.isFunction(_this.props.onAddToCartClickHandler)&&_this.props.onAddToCartClickHandler(productBrief.primaryCatCode,productBrief.id,productBrief.mabsRefId,productBrief.storeId,productBrief.objectID,productBrief.queryID,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId,productBrief.name,productBrief.brandName,productBrief.priceLabel&&productBrief.priceLabel.priceRow,index+1);},onPromotionTagClickHandler:function(){return _.isFunction(_this.props.onPromotionTagClickHandler)&&_this.props.onPromotionTagClickHandler(productBrief.primaryCatCode,productBrief.id,productBrief.mabsRefId,productBrief.promotionLabel&&productBrief.promotionLabel.promotionCode,productBrief.storeId,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId);},onQuickViewClickHandler:function(){return _.isFunction(_this.props.onQuickViewClickHandler)&&_this.props.onQuickViewClickHandler(productBrief.primaryCatCode,productBrief.id,productBrief.mabsRefId,productBrief.storeId,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId);},onStoreNameClickHandler:function(){return _.isFunction(_this.props.onStoreNameClickHandler)&&_this.props.onStoreNameClickHandler(productBrief.primaryCatCode,productBrief.storeId,productBrief.id,productBrief.mabsRefId,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId);},onMarketingLabelClickHandler:_.isFunction(_this.props.onMarketingLabelClickHandler)&&_this.props.onMarketingLabelClickHandler,onWishlistClickHandler:_this.props.onMylistClickHandler&&_this.props.onMylistClickHandler(productBrief.primaryCatCode,productBrief.id,productBrief.mabsRefId,productBrief.additionalLabel,productBrief.additionalLabelForPurchasedList,productBrief.sourceId)},productBrief,options,{trackingListName:_this.props.productBriefListData.trackingListName,index:index,setProductBriefListStockStatus:_this.setProductBriefListStockStatus,moduleName:_this.props.productBriefListData.moduleName})));})));};
6if(_.isFunction(this.props.onImpressionHandler)){var AllProductBriefWithImpression=withImpressionTrack(AllProductBrief);return React.createElement(AllProductBriefWithImpression,{onImpress:function(){return _this.props.onImpressionHandler(_this.state.productBriefList);}});}else{return React.createElement(AllProductBrief,null);}};return ProductBriefList;}(React.Component));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var __assign=(this&&this.__assign)||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)){t[p]=s[p];}}}return t;};var St12ProductBriefList=(function(_super){__extends(St12ProductBriefList,_super);function St12ProductBriefList(props){var _this=_super.call(this,props)||this;_this.setProductBriefListStockStatus=_this.setProductBriefListStockStatus.bind(_this);_this.state={productBriefList:_this.props.productBriefListData.productBriefList};return _this;}St12ProductBriefList.prototype.componentWillReceiveProps=function(nextProps){this.setState({productBriefList:nextProps.productBriefListData.productBriefList});};St12ProductBriefList.prototype.setProductBriefListStockStatus=function(index,status){this.setState(function(prevState){var productBriefList=prevState.productBriefList;productBriefList[index].stockStatus=status;return productBriefList;});};St12ProductBriefList.prototype.render=function(){var _this=this;var _a=this.props,_b=_a.productBriefListData.options,options=_b===void 0?{}:_b,_c=_a.classes,classes=_c===void 0?{}:_c;var template=options.template;var productBriefList=this.state.productBriefList;if(this.state.productBriefList.length==0){return null;}classes["product-brief-list"]=true;return(React.createElement("div",{className:classNames(classes)},this.state.productBriefList.slice(0,St12YouMayAlsoLike.ST12_YMAL_MAX_RENDER_COUNT).map(function(productBrief,index){return React.createElement("span",{className:"product-brief-wrapper",key:index}," ",React.createElement(ProductBrief,__assign({},productBrief,options,{index:index,setProductBriefListStockStatus:_this.setProductBriefListStockStatus})));})));};return St12ProductBriefList;}(React.Component));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var AllPromotionBox=(function(_super){__extends(AllPromotionBox,_super);function AllPromotionBox(props){var _this=_super.call(this,props)||this;_this.componentRoot=$("#otherPromo");_this.maximumPromotion=60;_this.isSearchResultPage=typeof CategorySearchPageAnalytics!=="undefined"?true:false;_this.isImpressed=false;_this.isExtraImpressed=false;_this.btnExpandOnClick=function(){var toggleList=_this.componentRoot.find(".toggleList");var extraList=_this.componentRoot.find(".extraList");var isSearchResultPage=typeof CategorySearchPageAnalytics!=="undefined"?true:false;extraList.slideToggle(500,"easeInOutCubic",function(){if(extraList.hasClass("expanded")){if(isSearchResultPage){analytics.trackEvent("search_result","category_search_all_promotion_box_expand",""+(CategorySearchPageAnalytics.getQuery()||"NA"));}toggleList.find(".showtext").fadeTo(130,0);}else{if(isSearchResultPage){analytics.trackEvent("search_result","category_search_all_promotion_box_collapse",""+(CategorySearchPageAnalytics.getQuery()||"NA"));}toggleList.find(".showtext").fadeTo(130,1);}});hktvCommon.scrollToElement($(".promoCatWrapper"));_this.setState({btnExpand:!_this.state.btnExpand});var eAction=_this.state.btnExpand?"all_promotion_box_collapse":"all_promotion_box_expand";analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),eAction,"NA");};_this.state={btnExpand:false};return _this;}AllPromotionBox.prototype.componentDidMount=function(){var _this=this;document.getElementById("otherPromo").classList.add("active");if(typeof CategorySearchPageAnalytics!=="undefined"){var allPromos_1=this.props.allPromotions;$.fn.allPromotionBox_isInImpression=function(){if($(this).length){var elementTop=$(this).first().offset().top;
6var outerHeight=$(this).first().outerHeight()===undefined?0:$(this).first().outerHeight();var elementBottom=elementTop+outerHeight;var windowTop=$(window).scrollTop();var innerHeight=$(window).innerHeight()===undefined?0:$(window).innerHeight();var windowBottom=windowTop+innerHeight;return(elementBottom>windowTop)&&(elementTop<windowBottom);}else{return false;}};var allPromoBoxTrackImpression_1=function(){if($(".promoCatWrapper.otherPromo").allPromotionBox_isInImpression()){if(!_this.isImpressed){analytics.trackEcommercePromoImpressionMulti(allPromos_1.slice(0,6).map(function(data,index){return({"id":""+(data.clickThroughUrl||"NA"),"name":""+(data.mabsRefId||data.name),"creative":"category_search_result_all_promotion_box_"+(data.clickThroughUrl||"NA"),"position":index+1});}));_this.isImpressed=true;}var extraList=$("#otherPromo").find(".extraList");if(!_this.isExtraImpressed&&extraList.hasClass("expanded")){analytics.trackEcommercePromoImpressionMulti(allPromos_1.slice(6,60).map(function(data,index){return({"id":""+(data.clickThroughUrl||"NA"),"name":""+(data.mabsRefId||data.name),"creative":"category_search_result_all_promotion_box_"+(data.clickThroughUrl||"NA"),"position":index+1});}));_this.isExtraImpressed=true;}}};$(window).scroll(function(){allPromoBoxTrackImpression_1();});}};AllPromotionBox.prototype.render=function(){return(React.createElement("div",{className:"showcaseWrapper"},this.props.allPromotions.length>0&&React.createElement("div",{className:"promoCatWrapper otherPromo"},React.createElement("div",{className:"promoCatList"},this.props.allPromotions.slice(0,6).map(function(details,index){return React.createElement(AllPromotionBoxListItems,{details:details,key:index,index:index});})),this.props.allPromotions.length>6&&React.createElement("div",{className:"extraListWrapper"},React.createElement("div",{className:"extraList"+(this.state.btnExpand?" expanded":"")},React.createElement("div",{className:"promoCatList"},this.props.allPromotions.slice(6,this.maximumPromotion).map(function(details,index){return React.createElement(AllPromotionBoxListItems,{details:details,key:index,index:index});}))),React.createElement("div",{className:"toggleList"},React.createElement("i",{className:"btnExpand",onClick:this.btnExpandOnClick}),React.createElement("div",{className:"divider"}),React.createElement("div",{className:"showtext"},hktvCommon.stringResources.allPromotionBox.buttonText))))));};return AllPromotionBox;}(React.Component));var onCLickGaForAllPromotionBox=function(clickThroughUrl,mabsRefId,altText,position){var isSearchResultPage=typeof CategorySearchPageAnalytics!=="undefined"?true:false;try{if(isSearchResultPage){analytics.trackEvent("search_result","category_search_all_promotion_box",(CategorySearchPageAnalytics.getQuery()||"NA")+" | \n "+(clickThroughUrl||"NA"));analytics.trackEcommercePromoClick(""+(clickThroughUrl||"NA"),""+(mabsRefId||altText),"category_search_result_all_promotion_box_"+(clickThroughUrl||"NA"),"");}else{var zone=analytics.getGaRevamp2020AnalyticsZone();analytics.trackEventV2(zone,"all_promotion_box",(clickThroughUrl||"NA")+" | mabs_"+(mabsRefId?mabsRefId:"false"));analytics.trackEcommercePromoClick(clickThroughUrl||"NA",mabsRefId||altText,zone+"_all_promotion_box",position+1);}}catch(error){}};var AllPromotionBoxListItems=function(props){var clickThroughUrl=props.details.clickThroughUrl;var mabsRefId=props.details.mabsRefId;var altText=props.details.name;var primaryCatCode=props.details.salesCode||"";var position=props.index;var content=function(){return(React.createElement("div",null,React.createElement("div",{className:"imageWrapper"+(mabsRefId?" adLabel":"")},React.createElement("div",{className:"imgContainer"},React.createElement("img",{src:props.details.image.url,alt:props.details.name}))),React.createElement("div",{className:"textWrapper"},React.createElement("span",null,props.details.name))));};var ContentWithImpression_ForAllPromotionBox=withImpressionTrack(content);return(React.createElement("a",{className:"imageLinkText imageTop-textBottom",href:clickThroughUrl,target:props.details.external?"_blank":"_self",onClick:function(){return onCLickGaForAllPromotionBox(clickThroughUrl,mabsRefId,altText,position);}},React.createElement(ContentWithImpression_ForAllPromotionBox,{onImpress:typeof CategorySearchPageAnalytics!=="undefined"?function(){}:function(){analytics.trackEcommercePromoImpression(clickThroughUrl||"NA",mabsRefId?mabsRefId:altText,analytics.getGaRevamp2020AnalyticsZone()+"_all_promotion_box",position+1);}})));};$.fn.renderAutoRotateTitle=function(productList,clockText){return this.each(function(){var util={init:function(element,productList){var self=this;self.$element=$(element||{});var productList=productList||{};self.status=productList.status||"";
6self.displayDate=productList.displayDate||"";if((self.status=="active")&&self.displayDate!=""){self.render(clockText);}},render:function(clockText){var self=this;var $autoRotateTitleWrapper=$('<div class="autoRotateTitleWrapper '+self.status+'">').appendTo(self.$element);var $innerWrapper=$('<div class="innerWrapper">').appendTo($autoRotateTitleWrapper);var str=self.displayDate;if(str.match(/([^\s]+)\s(12:00)(\s-\s)([^\s]+)\s(11:59)/)){if(hktvCommon.env.currentLanguage=="zh"){str=str.replace(/([^\s]+)\s(12:00)(\s-\s)([^\s]+)\s(11:59)/,"$1 "+hktvCommon.stringResources.autorotateproductlist.noon+"$2$3$4 "+hktvCommon.stringResources.autorotateproductlist.am+"$5");}else{str=str.replace(/([^\s]+)\s(12:00)(\s-\s)([^\s]+)\s(11:59)/,"$1 $2"+hktvCommon.stringResources.autorotateproductlist.noon+"$3$4 $5"+hktvCommon.stringResources.autorotateproductlist.am);}}$innerWrapper.append('<div class="dateDisplay"><span>'+hktvCommon.stringResources.autorotateproductlist.newArrival+" </span><span>"+str+"</span></div>");if(self.status=="active"&&clockText){$innerWrapper.append('<div class="count-down-clock"><span>'+hktvCommon.stringResources.autorotateproductlist.countDownClockTitle+"</span><span>"+clockText+"</span></div>");}self.$element.append($autoRotateTitleWrapper);return;}};util.init(this,productList,clockText);});};$.fn.renderAutoRotateProductListContainer=function(productList,productBriefOption){return this.each(function(){var util={init:function(element,productList,productBriefOption){var self=this;self.$element=$(element||{});self.productList=productList||{};self.productBriefOption=productBriefOption||{};self.status=productList.status||"";self.displayDate=productList.displayDate||"";self.render();},render:function(){var self=this;var zones=productList.zones||[];zones.forEach(function(zone,index){var selectedZone=hktvCommon.env.urlParams.selectedzone||"";if(selectedZone!=""&&zone.zone==selectedZone){zones.splice(0,0,zones.splice(index,1)[0]);}});zones.forEach(function(zone){var $zoneWrapper=$('<div class="zoneWrapper">').appendTo(self.$element);$zoneWrapper.append('<div class="zoneTitle '+(zone.zone||"")+'"><div class="sprite"></div></div>');var $listContainer=$('<div class="autoRotateProductListContainer">').appendTo($zoneWrapper);var products=zone.products||[];var maxProducts=120;products.forEach(function(product,index){if(index<maxProducts){var $productBriefWrapper=$('<div class="productBriefWrapper">').appendTo($listContainer);$productBriefWrapper.renderProductBrief(product,self.productBriefOption);}});if(self.status!="expired"){$listContainer.append('<div class="tnc">'+hktvCommon.stringResources.autorotateproductlist.tncClickThrough+"</div>");if(hktvCommon.env.webType!="mobile"){$listContainer.find(".tnc button").off("click").on("click",function(){var html='<div class="autoRotateProductListTncWrapper">';html+='<div class="tncTitle">'+hktvCommon.stringResources.autorotateproductlist.tncTitle+"</div>";html+='<div class="tncBody">'+hktvCommon.stringResources.autorotateproductlist.tncBody+"</div>";html+='</div">';$.colorbox({iframe:false,width:920,height:500,fixed:true,scrolling:false,overlayClose:true,html:html,close:'<i class="btnClosePopup"></i>',onComplete:function(){}});});}else{$listContainer.find(".tnc button").on("click",function(){var str="";str+='<div class="messageOverlay ">';str+='<div class="message">';str+='<div class="tncTitle">'+hktvCommon.stringResources.autorotateproductlist.tncTitle+"</div>";str+='<div class="tncBody">'+hktvCommon.stringResources.autorotateproductlist.tncBody+"</div>";str+="</div>";str+='<button class="messageButton">'+hktvCommon.stringResources.general.ok+"</button>";str+="</div>";$.colorbox({iframe:false,fixed:true,maxWidth:"100%",maxHeight:"70%",html:str,closeButton:false,onComplete:function(){$(".messageButton").off("click").on("click",function(){$.colorbox.close();});}});});}}});}};util.init(this,productList,productBriefOption);});};(function($,window,document){var productListView={init:function(options,element){var self=this;self.element=element;self.$element=$(element);self.options=$.extend({},$.fn.productListView.options,options);self.callAjax();},callAjax:function(){var self=this;self.ajaxUrl=self.options.apiEndPoint;$.ajax({url:self.ajaxUrl,cache:false,dataType:"json",data:self.options.para,success:function(data){hktvCommon.updateWishlist(data.wishlist);self.ajaxSuccess(data);},error:function(e,errorStatus){}});},ajaxSuccess:function(data){var self=this;self.data=data;self.render();},domTemplate:function(){return'<div class="productListViewItem"><div class="productBrief productBriefClickable supermarketTemplate target-blank clearfix"><div class="rank"></div><div class="imageWrapper"></div><div class="buttons"><div class="addtocartWrapper"></div><div class="addtowishlistWrapper"></div></div><div class="labelWrapper"></div><div class="infoWrapper"></div><div style="clear:both;"></div></div></div>';},render:function(){var self=this;self.gaInitPending=true;var products=self.data.products;self.$element.empty();$.each(products,function(index,product){var $container=$('<div class="productListViewItem">').appendTo(self.$element);$container.attr("data-product",product.code);$container.attr("data-category",product.primaryCatCode);$container.attr("data-name",product.name);$container.attr("data-position",index);$container.attr("data-brandname",product.brandName);$container.attr("data-mabsRefId",product.mabsRefId);$container.attr("data-price",hktvCommon.getPriceLabelFromProduct(product,{priceValueOnly:true}));$container.attr("data-storeCode",product.storeCode);var $brief=$container.renderProductBrief(product,{template:"supermarket",briefType:"horizontal",page:"top100",hideHoverOverlay:true,showMallDollarLabel:false,showProductSurface:false,priceDropdown:false});$container.find(".productBrief").attr("data-url",hktvCommon.addPrefixToHktvUrl(product.url));
6$('<div class="rank">'+(index+1)+"</div>").prependTo($brief);});var boxFix=(window.innerHeight>800?true:false);ColorboxDesktop.show($("#Top100PopupWrapper").clone().html(),{width:942,maxWidth:false,height:642,onComplete:function(){if(self.gaInitPending===true){self.gaInitPending=false;self.setupGA();if(hktvCommon.env.zone=="supermarket"){self.setUpTop100GA();}}},onClosed:function(){GA_trackEvent("supermarket","top100_all_close","NA");}});},setupGA:function(){var self=this;var products=self.data.products;$(".Top100PopupProductList").on("click",".productListViewItem .productBrief.productBriefClickable",function(event){var $productItem=$(this).parents(".productListViewItem");var clickData={id:$productItem.data("product"),name:$productItem.data("name"),brand:$productItem.data("brandname"),category:$productItem.data("category"),price:analytics.trimDisplayPrice($productItem.data("price")),position:$productItem.data("position"),list:$productItem.data("mabsRefId")?$productItem.data("mabsRefId"):"supermarket_top100_all",dimension2:$productItem.data("storecode")};SupermarketAnalytics.Top100All.trackProductClick(clickData);analytics.trackEventV2("supermarket","top100_all",$productItem.data("category")+" | "+$productItem.data("product")+" | mabs_false");});for(var i=0;i<products.length;i+=20){var impressionData=products.slice(i,(i+20)).map(function(el,index){return{name:el.name,id:el.code,mabsRefId:el.mabsRefId||"",brand:el.brandName,category:el.primaryCatCode,list:"supermarket_top100_all",position:i+index+1,price:analytics.trimDisplayPrice(hktvCommon.getPriceLabelFromProduct(el,{priceValueOnly:true})),dimension2:el.storeCode||"",dimension14:el.storeIdOrig||"",dimension57:el.sourceId||""};});SupermarketAnalytics.Top100All.trackProductImpressionMulti(impressionData);}},setUpTop100GA:function(){if(analytics){analytics.trackPageV2("/_ga/web/pageview/supermarket/top100");}$(".Top100PopupProductList").on("click",".addToCartButton",function(event){analytics.trackEventV2("supermarket","top100_all_add_to_cart",$(this).data("category")+" | "+$(this).data("productcode")+" | mabs_false");});$(".Top100PopupProductList").on("click",".tooltipsContainer a",function(event){analytics.trackEventV2("supermarket","top100_all_checkout",$(this).parents(".productListViewItem").data("category")+" | "+$(this).parents(".productListViewItem").data("product")+" | mabs_false");});$(".Top100PopupProductList").on("click",".addToWishlistButton",function(event){analytics.trackEventV2("supermarket","top100_all_add_to_mylist",$(this).data("category")+" | "+$(this).data("productcode")+" | mabs_false");});$(".Top100PopupProductList").on("click",".promotionLabel",function(event){var $Brief=$(this).parents(".productBrief");var promoCode=$(this).data("promocode");analytics.trackEventV2("supermarket","top100_all_promotion",$Brief.data("category")+" | "+$Brief.data("productcode")+" | mabs_false | "+promoCode);});$(".Top100PopupProductList").on("click",".notifyMeButton",function(event){analytics.trackEventV2("supermarket","top100_all_oos",$(this).parents(".productBrief").data("category")+" | "+$(this).data("productcode")+" | mabs_false");});}};$.fn.productListView=function(options){return this.each(function(){var $element=$(this),elementListView=Object.create(productListView);elementListView.init(options,this);$element.data("listView",elementListView);});};$.fn.productListView.options={"apiEndPoint":""};}(jQuery,window,document));/*! Gray v1.4.5 https://github.com/karlhorky/gray) | MIT */ 7; 8/*! Modernizr 2.8.3 (Custom Build) | MIT & BSD */ 9;window.Modernizr=window.Modernizr||function(a,b,c){function d(a){n.cssText=a;}function f(a,b){return typeof a===b;}var o,x,z,i="2.8.3",j={},k=b.documentElement,l="modernizr",m=b.createElement(l),n=m.style,q=({}.toString," -webkit- -moz- -o- -ms- ".split(" ")),r={svg:"http://www.w3.org/2000/svg"},s={},v=[],w=v.slice,y={}.hasOwnProperty;z=f(y,"undefined")||f(y.call,"undefined")?function(a,b){return b in a&&f(a.constructor.prototype[b],"undefined");}:function(a,b){return y.call(a,b);},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b){throw new TypeError;}
9var c=w.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(w.call(arguments)));return Object(g)===g?g:f;}return b.apply(a,c.concat(w.call(arguments)));};return d;}),s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg;};for(var A in s){z(s,A)&&(x=A.toLowerCase(),j[x]=s[A](),v.push((j[x]?"":"no-")+x));}return j.addTest=function(a,b){if("object"==typeof a){for(var d in a){z(a,d)&&j.addTest(d,a[d]);}}else{if(a=a.toLowerCase(),j[a]!==c){return j;}b="function"==typeof b?b():b,"undefined"!=typeof enableClasses&&enableClasses&&(k.className+=" "+(b?"":"no-")+a),j[a]=b;}return j;},d(""),m=o=null,j._version=i,j._prefixes=q,j;}(this,this.document),Modernizr.addTest("cssfilters",function(){var a=document.createElement("div");return a.style.cssText=Modernizr._prefixes.join("filter:blur(2px); "),!!a.style.length&&(void 0===document.documentMode||document.documentMode>9);}),Modernizr.addTest("svgfilters",function(){var a=!1;try{a=void 0!==typeof SVGFEColorMatrixElement&&2==SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE;}catch(b){}return a;}),function(a,b,c,d){function g(b,c){var d,g;c=c||{},d=c.classes||{},g=d.fade||f.classes.fade,c.fade=c.fade||b.className.indexOf(g)>-1,this.element=b,this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init();}var e="gray",f={fade:!1,classes:{fade:"grayscale-fade"}};a.extend(g.prototype,{init:function(){var b;!Modernizr.cssfilters&&Modernizr.inlinesvg&&Modernizr.svgfilters&&(b=a(this.element),(this.cssFilterDeprecated(b)||this.settings.fade)&&this.switchImage(b));},cssFilterDeprecated:function(a){return"none"===a.css("filter");},elementType:function(a){return"IMG"===a.prop("tagName")?"Img":"Bg";},pxToNumber:function(a){return parseInt(a.replace("px",""));},getComputedStyle:function(a){var c={},d={};c=b.getComputedStyle(a,null);for(var e=0,f=c.length;f>e;e++){var g=c[e],h=c.getPropertyValue(g);d[g]=h;}return d;},extractUrl:function(a){var b;return startRegex=/^url\(["']?/,endRegex=/["']?\)$/,b=a.replace(startRegex,"").replace(endRegex,"");},positionToNegativeMargin:function(a){var b,c,d;return b=a.match(/^(-?\d+\S+)/)[0],c=a.match(/\s(-?\d+\S+)$/)[0],d="margin:"+c+" 0 0 "+b;},getBgSize:function(b,c){var d,e,f,g,h,i,j;if(d=new Image,d.src=b,"auto"!==c&&"cover"!==c&&"contain"!==c&&"inherit"!==c){var k=a(this.element);e=d.width/d.height,g=parseInt((c.match(/^(\d+)px/)||[0,0])[1]),i=parseInt((c.match(/\s(\d+)px$/)||[0,0])[1]),f=k.height()*e,h=k.width()/e,g=g||f,i=i||h;}return j=g||i?{width:g,height:i}:{width:d.width,height:d.height};},getImgParams:function(a){var b={};b.styles=this.getComputedStyle(a[0]);var c={top:this.pxToNumber(b.styles["padding-top"]),right:this.pxToNumber(b.styles["padding-right"]),bottom:this.pxToNumber(b.styles["padding-bottom"]),left:this.pxToNumber(b.styles["padding-left"])},d={top:this.pxToNumber(b.styles["border-top-width"]),right:this.pxToNumber(b.styles["border-right-width"]),bottom:this.pxToNumber(b.styles["border-bottom-width"]),left:this.pxToNumber(b.styles["border-left-width"])};return b.image={width:this.pxToNumber(b.styles.width),height:this.pxToNumber(b.styles.height)},b.svg={url:a[0].src,padding:c,borderWidth:d,width:b.image.width+c.left+c.right+d.left+d.right,height:b.image.height+c.top+c.bottom+d.top+d.bottom,offset:""},b;},getBgParams:function(b){var d,c={};return d=this.extractUrl(b.css("background-image")),bgSize=this.getBgSize(d,b.css("background-size")),offset=this.positionToNegativeMargin(b.css("background-position")),c.styles=this.getComputedStyle(b[0]),c.svg=a.extend({url:d},bgSize,{offset:offset}),c.image={width:c.svg.width,height:c.svg.height},c;},setStyles:function(a,b,c,d){return b.display="inline-block",b.overflow=b["overflow-x"]=b["overflow-y"]="hidden",b["background-image"]='url("'+c.url+'")',b["background-size"]=d.width+"px "+d.height+"px","Img"===a&&(b["background-repeat"]="no-repeat",b["background-position"]=c.padding.left+"px "+c.padding.top+"px",b.width=c.width,b.height=c.height),delete b.filter,b;},addSVGFilterOnce:function(){$body=a("body"),$body.data("plugin_"+e+"_has_filter")||$body.data("plugin_"+e+"_has_filter","true").append('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="0" height="0" style="position:absolute"><defs><filter id="gray"><feColorMatrix type="saturate" values="0"/></filter></defs></svg>');},switchImage:function(b){var c,d,e,f;c=this.elementType(b),d=this["get"+c+"Params"](b),e=this.settings.fade?this.settings.classes.fade:"",f=a('<div class="grayscale grayscale-replaced '+e+'"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+d.svg.width+" "+d.svg.height+'" width="'+d.svg.width+'" height="'+d.svg.height+'" style="'+d.svg.offset+'">
9<image filter="url("#gray")" x="0" y="0" width="'+d.image.width+'" height="'+d.image.height+'" preserveAspectRatio="none" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="'+d.svg.url+'" /></svg></div>'),d.styles=this.setStyles(c,d.styles,d.svg,d.image),f.css(d.styles),this.addSVGFilterOnce(),b.replaceWith(f);}}),a.fn[e]=function(b){return this.each(function(){a.data(this,"plugin_"+e)||a.data(this,"plugin_"+e,new g(this,b));}),this;},a(b).on("load",function(){a(".grayscale:not(.grayscale-replaced)")[e]();});}(jQuery,window,document);(function($,window,document,undefined){if(!window.console){window.console={};}if(!window.console.log){window.console.log=function(){};}var bannerTop={init:function(options,elem){var self=this;self.elem=elem;self.$elem=$(elem);self.queue=[];self.cycle();},cycle:function(){var self=this;this.setupListener();},setupListener:function(){var self=this;self.options.scrollBarWidth=self.getScrollBarWidth()||0;self.initBannerTop();self.initBannerTopOverlay();},initBannerTop:function(){var self=this;self.$bannerTop=self.$elem.find(".banner-1188:first-child");self.$bannerTop.find(".width-1188 a").on("click",function(){self.openBannerTopOverlay(true);});},initBannerTopOverlay:function(){var self=this;self.$overlayBanner=self.$elem.find(".banner-1188:nth-child(2)");if(self.$overlayBanner.length>0){self.$bannerTop.find(".width-1188 a").css("cursor","pointer");self.options.videoId=self.$overlayBanner.data("videoid")||"";self.options.reloadInterval=((Number(self.$overlayBanner.data("reloadinterval"))||0)==0?self.options.reloadInterval:Number(self.$overlayBanner.data("reloadinterval")));if(self.options.reloadInterval<0){self.options.autoShowBannerTopOverlay=false;}if(self.options.videoId){(function loop100(){if(window.youTubeIframeAPIReady){window.bannerTopVideoPlayer=new YT.Player("bannerTopVideoPlayer",{height:"298",width:"530",videoId:self.$overlayBanner.data("videoid"),playerVars:{rel:0},events:{}});return;}else{setTimeout(loop100,100);}})();}if(hktvCommon.storageAvailable("localStorage")){if(!Date.now){Date.now=function(){return new Date().getTime();};}var currentTimestamp=Math.floor(Date.now()/1000);var intervalSec=self.options.reloadInterval*60;if(!(localStorage.bannerTopOverlayExpiry)||currentTimestamp>=parseInt(localStorage.bannerTopOverlayExpiry)+intervalSec){localStorage.bannerTopOverlayExpiry=currentTimestamp;}else{self.options.autoShowBannerTopOverlay=false;}}else{self.options.autoShowBannerTopOverlay=false;}self.$overlayBanner.find(".width-1188").append('<div class="bannerTopCloseButton"></div>').append('<div class="bannerTopVideoPlayerWrapper"><div id="bannerTopVideoPlayer"></div></div>');self.$overlayBanner.find(".bannerTopCloseButton").off("click").on("click",function(){self.closeBannerTopOverlay(true);});self.openBannerTopOverlay();}},openBannerTopOverlay:function(isUserClick){var self=this;var isUserClick=isUserClick||false;if(isUserClick){self.options.autoShowBannerTopOverlay=true;}if(self.$overlayBanner.length>0&&self.options.autoShowBannerTopOverlay){if(self.options.videoId){(function loop100(){var bannerTopVideoPlayer=window.bannerTopVideoPlayer;if(typeof bannerTopVideoPlayer!="undefined"&&typeof bannerTopVideoPlayer.mute=="function"&&typeof bannerTopVideoPlayer.playVideo=="function"){bannerTopVideoPlayer.mute();bannerTopVideoPlayer.playVideo();return;}else{setTimeout(loop100,100);}})();}self.$overlayBanner.slideDown(200,"easeOutQuart");}},closeBannerTopOverlay:function(isUserClick){var self=this;var isUserClick=isUserClick||false;if(isUserClick){self.options.autoShowBannerTopOverlay=false;}if(self.$overlayBanner.length>0){if(self.options.videoId){(function loop100(){var bannerTopVideoPlayer=window.bannerTopVideoPlayer;if(typeof bannerTopVideoPlayer!="undefined"&&typeof bannerTopVideoPlayer.playVideo=="function"){bannerTopVideoPlayer.pauseVideo();return;}else{setTimeout(loop100,100);}})();}self.$overlayBanner.slideUp(170,"easeInQuad");}},getScrollBarWidth:function(){if($("body").css("overflow-y")=="hidden"||$(document).height()<=$(window).height()){return 0;}var inner=document.createElement("p");inner.style.width="100%";inner.style.height="200px";var outer=document.createElement("div");outer.style.position="absolute";outer.style.top="0px";outer.style.left="0px";outer.style.visibility="hidden";outer.style.width="200px";outer.style.height="150px";outer.style.overflow="hidden";outer.appendChild(inner);document.body.appendChild(outer);var w1=inner.offsetWidth;outer.style.overflow="scroll";var w2=inner.offsetWidth;if(w1==w2){w2=outer.clientWidth;}document.body.removeChild(outer);return(w1-w2);}};$.fn.bannerTop=function(options){return this.each(function(){var element=$(this);var defaultOptions={videoId:"",reloadInterval:15,autoShowBannerTopOverlay:true};
9if(!element.data("bannerTop")){a=Object.create(bannerTop);a.options=$.extend({},defaultOptions,options);a.init(options,this);element.data("bannerTop",a);}else{element.data("bannerTop").options=$.extend({},element.data("bannerTop").options,options);element.data("bannerTop").cycle();}});};}(jQuery,window,document));var UIHwShowMoreAnchor=function(props){var displayText=props.displayText,arrowHeading=props.arrowHeading,href=props.href,target=props.target,style=props.style,onMouseEnterHandler=props.onMouseEnterHandler,onMouseLeaveHandler=props.onMouseLeaveHandler,onClickHandler=props.onClickHandler;var displayContentStyle={"lineHeight":style.height};return(React.createElement("a",{className:"ui-hw-show-more-anchor",href:href,target:target,rel:"noopener",onMouseEnter:onMouseEnterHandler,onMouseLeave:onMouseLeaveHandler,onClick:onClickHandler,style:style},React.createElement("span",{className:"display-content",style:displayContentStyle},React.createElement("span",{className:"display-text"},displayText),React.createElement("div",{className:"expand-arrow",style:{"transform":"rotate("+arrowHeading+"deg)"}}))));};UIHwShowMoreAnchor.displayName="UIHwShowMoreAnchor";var St12ShowMoreButton=function(props){var displayText=props.displayText,arrowHeading=props.arrowHeading,style=props.style,onClickHandler=props.onClickHandler,onMouseEnterHandler=props.onMouseEnterHandler,onMouseLeaveHandler=props.onMouseLeaveHandler;return(React.createElement("button",{className:"st12-show-more-button",onClick:onClickHandler,onMouseEnter:onMouseEnterHandler,onMouseLeave:onMouseLeaveHandler,style:style},React.createElement("span",{className:"display-text"},displayText),React.createElement("div",{className:"expand-arrow",style:{"transform":"rotate("+arrowHeading+"deg)"}})));};St12ShowMoreButton.displayName="St12ShowMoreButton";var Street12Analytics;(function(Street12Analytics){var promotedTop10;(function(promotedTop10){function trackAllLink(href){if(href===void 0){href="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_see_all",href);}promotedTop10.trackAllLink=trackAllLink;function trackQuickViewClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_quickview",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));};}promotedTop10.trackQuickViewClick=trackQuickViewClick;function trackAddToWishlistClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_add_to_mylist",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));hktvCommon.addStringResources({"eventCategories":analytics.getGaRevamp2020AnalyticsZone(),"eventActionPrefix":"Top100_Product_"});};}promotedTop10.trackAddToWishlistClick=trackAddToWishlistClick;function trackPromotionTagClick(productCatCode,productId,mabsRefId,promoCode){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}if(promoCode===void 0){promoCode="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_promotion",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false")+" | "+promoCode);};}promotedTop10.trackPromotionTagClick=trackPromotionTagClick;function trackMarketingLabelClick(primaryCatCode,productId,mabsRefId,promoCode){if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}if(promoCode===void 0){promoCode="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_marketing_label",primaryCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false")+" | "+promoCode);};}promotedTop10.trackMarketingLabelClick=trackMarketingLabelClick;})(promotedTop10=Street12Analytics.promotedTop10||(Street12Analytics.promotedTop10={}));var Top10;(function(Top10){function trackAllLink(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_see_all","NA");}Top10.trackAllLink=trackAllLink;function trackProductClick(productId,productCatCode,name,brandName,position,price,mabsRefId,customDimension2){if(productId===void 0){productId="";}if(productCatCode===void 0){productCatCode="";}if(name===void 0){name="";}if(brandName===void 0){brandName="";}if(position===void 0){position=0;}if(price===void 0){price="";}if(mabsRefId===void 0){mabsRefId="";}if(customDimension2===void 0){customDimension2="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));analytics.trackEcommerceProductClick({"id":productId,"name":name,"brand":brandName,"category":productCatCode,"position":position,"price":price,"list":analytics.getGaRevamp2020AnalyticsZone()+"_top100","dimension2":customDimension2,"mabsRefId":mabsRefId!=""?mabsRefId:""},"top100");};}Top10.trackProductClick=trackProductClick;function trackQuickViewClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_quickview",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));};}Top10.trackQuickViewClick=trackQuickViewClick;function trackAddToWishlistClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_add_to_mylist",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));hktvCommon.addStringResources({"eventCategories":UIAnalytics.getAnalyticsZone(),"eventActionPrefix":"Top100_Product_"});};}Top10.trackAddToWishlistClick=trackAddToWishlistClick;function trackPromotionTagClick(promotionCode,productCatCode,productId,mabsRefId){if(promotionCode===void 0){promotionCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_promotion",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false")+" | "+promotionCode);};}Top10.trackPromotionTagClick=trackPromotionTagClick;
9function trackMarketingLabelClick(primaryCatCode,productId){if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}return function(marketingCode){if(marketingCode===void 0){marketingCode="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_marketing_label",primaryCatCode+" | "+productId+" | "+marketingCode);};}Top10.trackMarketingLabelClick=trackMarketingLabelClick;function trackStoreNameClick(productCatCode,productId,storeId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(storeId===void 0){storeId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_store_name",productCatCode+" | "+storeId+" | "+productId+" | "+("mabs_"+(mabsRefId?mabsRefId:"false")));};}Top10.trackStoreNameClick=trackStoreNameClick;function trackProductImpressionMulti(productImpressionParametersList,moduleName){if(moduleName===void 0){moduleName="promoted_top_10";}analytics.trackEcommerceProductImpressionMulti(productImpressionParametersList,moduleName);}Top10.trackProductImpressionMulti=trackProductImpressionMulti;})(Top10=Street12Analytics.Top10||(Street12Analytics.Top10={}));var PromoCatSku;(function(PromoCatSku){function trackAllLink(bbCode,mabsRefId,anchorUrl){if(bbCode===void 0){bbCode="";}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_see_all",(bbCode||anchorUrl||"undefined_BB")+" | mabs_"+(mabsRefId?mabsRefId:"false"));}PromoCatSku.trackAllLink=trackAllLink;function trackPromoTab(bbCode,mabsRefId,anchorUrl){if(bbCode===void 0){bbCode="";}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box",(bbCode||anchorUrl||"undefined_BB")+" | mabs_"+(mabsRefId?mabsRefId:"false"));}PromoCatSku.trackPromoTab=trackPromoTab;function trackNextBtn(bbCode){if(bbCode===void 0){bbCode="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_next_page","NA");}PromoCatSku.trackNextBtn=trackNextBtn;function trackPrevBtn(bbCode){if(bbCode===void 0){bbCode="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_previous_page","NA");}PromoCatSku.trackPrevBtn=trackPrevBtn;function trackProductClick(productId,productCatCode,name,brandName,storeCode,price,position,bbCode,mabsRefId){if(productId===void 0){productId="";}if(productCatCode===void 0){productCatCode="";}if(name===void 0){name="";}if(brandName===void 0){brandName="";}if(storeCode===void 0){storeCode="";}if(position===void 0){position=0;}if(bbCode===void 0){bbCode="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_pdp",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));analytics.trackEcommerceProductClick({"id":productId,"name":name,"brand":brandName,"category":productCatCode||"undefined_AA","price":price,"position":position,"list":analytics.getGaRevamp2020AnalyticsZone()+"_sku_promotion_box_"+(bbCode||storeCode||"undefined_BB"),"dimension2":storeCode,"mabsRefId":mabsRefId!=""?mabsRefId:""});};}PromoCatSku.trackProductClick=trackProductClick;function trackStoreClick(bbCode,productCatCode,productId,mabsRefId,storeCode){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}if(storeCode===void 0){storeCode="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_store",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+storeCode+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));};}PromoCatSku.trackStoreClick=trackStoreClick;function trackQuickViewClick(bbCode,storeCode,productCatCode,productId,mabsRefId){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_quickview",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));};}PromoCatSku.trackQuickViewClick=trackQuickViewClick;function trackAddToWishlistClick(bbCode,storeCode,productCatCode,productId,mabsRefId){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_add_to_mylist",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));hktvCommon.addStringResources({"eventCategories":analytics.getGaRevamp2020AnalyticsZone(),"eventActionPrefix":"sku_promotion_box_","eventLabel":(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false")});};}PromoCatSku.trackAddToWishlistClick=trackAddToWishlistClick;function trackPromotionTagClick(bbCode,storeCode,productCatCode,productId,promotionCode){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(promotionCode===void 0){promotionCode="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_promotion",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | "+promotionCode);};}PromoCatSku.trackPromotionTagClick=trackPromotionTagClick;function trackMarketingLabelClick(bbCode,primaryCatCode,productId){if
9(bbCode===void 0){bbCode="";}if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}return function(marketingCode){if(marketingCode===void 0){marketingCode="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_marketing_label",bbCode+" | "+primaryCatCode+" | "+productId+" | "+marketingCode);};}PromoCatSku.trackMarketingLabelClick=trackMarketingLabelClick;function trackProductImpressionMulti(productImpressionParametersList){analytics.trackEcommerceProductImpressionMulti(productImpressionParametersList,"sku_promotion_box");}PromoCatSku.trackProductImpressionMulti=trackProductImpressionMulti;})(PromoCatSku=Street12Analytics.PromoCatSku||(Street12Analytics.PromoCatSku={}));var PromoCatMnm;(function(PromoCatMnm){function trackAllLink(tabname){if(tabname===void 0){tabname="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"mixnmatch_box_see_all",tabname||"undefined_tab_name");}PromoCatMnm.trackAllLink=trackAllLink;function trackPromoTab(tabname,salesCode){if(tabname===void 0){tabname="";}if(salesCode===void 0){salesCode="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"mixnmatch_box",(tabname||"undefined_tab_name")+" | "+(salesCode||"NA"));}PromoCatMnm.trackPromoTab=trackPromoTab;function trackNextBtn(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"mixnmatch_box_next_page","NA");}PromoCatMnm.trackNextBtn=trackNextBtn;function trackPrevBtn(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"mixnmatch_box_previous_page","NA");}PromoCatMnm.trackPrevBtn=trackPrevBtn;function trackPromoClick(clickThroughUrl,bbCode,salesCode,tabname,position,altText,mabsRefId){if(clickThroughUrl===void 0){clickThroughUrl="";}if(bbCode===void 0){bbCode="";}if(salesCode===void 0){salesCode="";}if(tabname===void 0){tabname="";}if(position===void 0){position=0;}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"mixnmatch_box_rule",(tabname||"undefined_tab_name")+" | "+(bbCode||"NA"));analytics.trackEcommercePromoClick(bbCode||"NA",mabsRefId?mabsRefId:(altText||"NA"),analytics.getGaRevamp2020AnalyticsZone()+"_mixnmatch_box_"+(tabname||"undefined_tab_name"),(position+1).toString());}PromoCatMnm.trackPromoClick=trackPromoClick;function trackPromoImpressionMulti(promoImpressionParametersList){analytics.trackEcommercePromoImpressionMulti(promoImpressionParametersList);}PromoCatMnm.trackPromoImpressionMulti=trackPromoImpressionMulti;})(PromoCatMnm=Street12Analytics.PromoCatMnm||(Street12Analytics.PromoCatMnm={}));var SelectedReview;(function(SelectedReview){function trackAllReviewClick(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"comment_see_all","NA");}SelectedReview.trackAllReviewClick=trackAllReviewClick;function trackReviewClick(catCode,productId,mabsRefId){if(catCode===void 0){catCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"comment_text",catCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));}SelectedReview.trackReviewClick=trackReviewClick;function trackProductClick(productId,productCatCode,name,brandName,position,price,mabsRefId,customDimension2){if(productId===void 0){productId="";}if(productCatCode===void 0){productCatCode="";}if(name===void 0){name="";}if(brandName===void 0){brandName="";}if(position===void 0){position=0;}if(price===void 0){price="";}if(mabsRefId===void 0){mabsRefId="";}if(customDimension2===void 0){customDimension2="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"comment_pdp",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));analytics.trackEcommerceProductClick({"id":productId,"name":name,"brand":brandName,"category":productCatCode,"position":position,"price":analytics.trimDisplayPrice(price),"list":analytics.getGaRevamp2020AnalyticsZone()+"_comment","dimension2":customDimension2,"mabsRefId":mabsRefId!=""?mabsRefId:""});};}SelectedReview.trackProductClick=trackProductClick;
9function trackSlideChange(currentSlide,nextSlide){var action=(nextSlide>currentSlide?"comment_next_page":"comment_previous_page");analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),action,"NA");}SelectedReview.trackSlideChange=trackSlideChange;function trackProductImpressionMulti(productImpressionParametersList){analytics.trackEcommerceProductImpressionMulti(productImpressionParametersList);}SelectedReview.trackProductImpressionMulti=trackProductImpressionMulti;})(SelectedReview=Street12Analytics.SelectedReview||(Street12Analytics.SelectedReview={}));var AdvancedPromotionBox;(function(AdvancedPromotionBox){function trackMarketingLabelClick(primaryCatCode,productId){if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}return function(marketingCode){if(marketingCode===void 0){marketingCode="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"advanced_promotion_box_marketing_label",primaryCatCode+" | "+productId+" | "+marketingCode);};}AdvancedPromotionBox.trackMarketingLabelClick=trackMarketingLabelClick;})(AdvancedPromotionBox=Street12Analytics.AdvancedPromotionBox||(Street12Analytics.AdvancedPromotionBox={}));})(Street12Analytics||(Street12Analytics={}));var UIAnalytics;(function(UIAnalytics){UIAnalytics.obj=getInstance();function getInstance(){switch(""+hktvCommon.env.zone){case"supermarket":return typeof SupermarketAnalytics=="undefined"?null:SupermarketAnalytics;case"housewares":return typeof HousewaresAnalytics=="undefined"?null:HousewaresAnalytics;case"gadgetsandelectronics":return typeof GadgetsAnalytics=="undefined"?null:GadgetsAnalytics;case"homenfamily":case"beautynhealth":case"personalcarenhealth":case"macau":case"mothernbaby":case"pets":case"deals":case"sportsntravel":case"toysnbooks":case"finance":case"disney":case"thirteenlandmarks":case"fashion":default:return typeof Street12Analytics=="undefined"?null:Street12Analytics;}}function getAnalyticsZone(){switch(""+hktvCommon.env.zone){case"housewares":return"Housewares";case"homenfamily":return"HomeAndFamily";case"beautynhealth":return"BeautyAndHealth";case"personalcarenhealth":return"PersonalCareAndHealth";case"macau":return"Macau";case"mothernbaby":return"MotherAndBaby";case"pets":return"Pets";case"deals":return"Deals";case"sportsntravel":return"SportsAndTravel";case"toysnbooks":return"ToysAndBooks";case"finance":return"InsuranceAndFinance";case"disney":return"Disney";case"supermarket":return"Supermarket";case"fashion":return"Fashion";case"thirteenlandmarks":return"thirteenlandmarks";default:return"";}}UIAnalytics.getAnalyticsZone=getAnalyticsZone;})(UIAnalytics||(UIAnalytics={}));var HousewaresAnalytics;(function(HousewaresAnalytics){var promotedTop10;(function(promotedTop10){function trackAllLink(href){if(href===void 0){href="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_see_all",href);}promotedTop10.trackAllLink=trackAllLink;function trackQuickViewClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_quickview",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));};}promotedTop10.trackQuickViewClick=trackQuickViewClick;function trackAddToWishlistClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_add_to_mylist",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));hktvCommon.addStringResources({"eventCategories":analytics.getGaRevamp2020AnalyticsZone(),"eventActionPrefix":"Top100_Product_"});};}promotedTop10.trackAddToWishlistClick=trackAddToWishlistClick;function trackPromotionTagClick(productCatCode,productId,mabsRefId,promoCode){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}if(promoCode===void 0){promoCode="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_promotion",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false")+" | "+promoCode);};}promotedTop10.trackPromotionTagClick=trackPromotionTagClick;function trackMarketingLabelClick(primaryCatCode,productId,mabsRefId,promoCode){if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}if(promoCode===void 0){promoCode="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"promoted_top_10_marketing_label",primaryCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false")+" | "+promoCode);};}promotedTop10.trackMarketingLabelClick=trackMarketingLabelClick;})(promotedTop10=HousewaresAnalytics.promotedTop10||(HousewaresAnalytics.promotedTop10={}));var Top10;(function(Top10){function trackAllLink(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_see_all","NA");}Top10.trackAllLink=trackAllLink;function trackProductClick(productId,productCatCode,name,brandName,position,price,mabsRefId,customDimension2){if(productId===void 0){productId="";}if(productCatCode===void 0){productCatCode="";}if(name===void 0){name="";}if(brandName===void 0){brandName="";}if(position===void 0){position=0;}if(price===void 0){price="";}if(mabsRefId===void 0){mabsRefId="";}if(customDimension2===void 0){customDimension2="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100",productCatCode+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));analytics.trackEcommerceProductClick({"id":productId,"name":name,"brand":brandName,"category":productCatCode,"position":position,"price":price,"list":analytics.getGaRevamp2020AnalyticsZone()+"_top100","dimension2":customDimension2,"mabsRefId":mabsRefId!=""?mabsRefId:""},"top100");};}Top10.trackProductClick=trackProductClick;function trackQuickViewClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_quickview",productCatCode+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));};}Top10.trackQuickViewClick=trackQuickViewClick;function trackAddToWishlistClick(productCatCode,productId,mabsRefId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_add_to_mylist",productCatCode+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));hktvCommon.addStringResources({"eventCategories":UIAnalytics.getAnalyticsZone(),"eventActionPrefix":"Top100_Product_"});};}Top10.trackAddToWishlistClick=trackAddToWishlistClick;function trackPromotionTagClick(promotionCode,productCatCode,productId,mabsRefId){if(promotionCode===void 0){promotionCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_promotion",productCatCode+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false")+" | "+promotionCode);};}Top10.trackPromotionTagClick=trackPromotionTagClick;
9function trackMarketingLabelClick(primaryCatCode,productId){if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}return function(marketingCode){if(marketingCode===void 0){marketingCode="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_marketing_label",primaryCatCode+" | "+productId+" | "+marketingCode);};}Top10.trackMarketingLabelClick=trackMarketingLabelClick;function trackStoreNameClick(productCatCode,productId,storeId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(storeId===void 0){storeId="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"top100_store_name",productCatCode+" | "+storeId+" | "+productId);};}Top10.trackStoreNameClick=trackStoreNameClick;function trackProductImpressionMulti(productImpressionParametersList,moduleName){analytics.trackEcommerceProductImpressionMulti(productImpressionParametersList,moduleName);}Top10.trackProductImpressionMulti=trackProductImpressionMulti;})(Top10=HousewaresAnalytics.Top10||(HousewaresAnalytics.Top10={}));var PromoCatSku;(function(PromoCatSku){function trackAllLink(bbCode,mabsRefId,anchorUrl){if(bbCode===void 0){bbCode="";}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_see_all",(bbCode||anchorUrl||"undefined_BB")+" | mabs_"+(mabsRefId?mabsRefId:"false"));}PromoCatSku.trackAllLink=trackAllLink;function trackPromoTab(bbCode,mabsRefId,anchorUrl){if(bbCode===void 0){bbCode="";}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box",(bbCode||anchorUrl||"undefined_BB")+" | mabs_"+(mabsRefId?mabsRefId:"false"));}PromoCatSku.trackPromoTab=trackPromoTab;function trackNextBtn(bbCode){if(bbCode===void 0){bbCode="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_next_page","NA");}PromoCatSku.trackNextBtn=trackNextBtn;function trackPrevBtn(bbCode){if(bbCode===void 0){bbCode="";}analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_previous_page","NA");}PromoCatSku.trackPrevBtn=trackPrevBtn;function trackProductClick(productId,productCatCode,name,brandName,storeCode,price,position,bbCode,mabsRefId){if(productId===void 0){productId="";}if(productCatCode===void 0){productCatCode="";}if(name===void 0){name="";}if(brandName===void 0){brandName="";}if(storeCode===void 0){storeCode="";}if(position===void 0){position=0;}if(bbCode===void 0){bbCode="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_pdp",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));analytics.trackEcommerceProductClick({"id":productId,"name":name,"brand":brandName,"category":productCatCode||"undefined_AA","price":price,"position":position,"list":analytics.getGaRevamp2020AnalyticsZone()+"_sku_promotion_box_"+(bbCode||storeCode||"undefined_BB"),"dimension2":storeCode,"mabsRefId":mabsRefId?mabsRefId:""});};}PromoCatSku.trackProductClick=trackProductClick;function trackStoreClick(bbCode,productCatCode,productId,mabsRefId,storeCode){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}if(storeCode===void 0){storeCode="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_store",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));};}PromoCatSku.trackStoreClick=trackStoreClick;function trackQuickViewClick(bbCode,storeCode,productCatCode,productId,mabsRefId){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_quickview",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));};}PromoCatSku.trackQuickViewClick=trackQuickViewClick;function trackAddToWishlistClick(bbCode,storeCode,productCatCode,productId,mabsRefId){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_add_to_mylist",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false"));hktvCommon.addStringResources({"eventCategories":analytics.getGaRevamp2020AnalyticsZone(),"eventActionPrefix":"sku_promotion_box_","eventLabel":(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | mabs_"+(mabsRefId?mabsRefId:"false")});};}PromoCatSku.trackAddToWishlistClick=trackAddToWishlistClick;function trackPromotionTagClick(bbCode,storeCode,productCatCode,productId,promotionCode){if(bbCode===void 0){bbCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}if(promotionCode===void 0){promotionCode="";}return function(){analytics.trackEventV2(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_promotion",(bbCode||storeCode||"undefined_BB")+" | "+(productCatCode||"undefined_AA")+" | "+productId+" | "+promotionCode);};}PromoCatSku.trackPromotionTagClick=trackPromotionTagClick;function trackMarketingLabelClick(bbCode,primaryCatCode,productId){if
9(bbCode===void 0){bbCode="";}if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}return function(marketingCode){if(marketingCode===void 0){marketingCode="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"sku_promotion_box_marketing_label",bbCode+" | "+primaryCatCode+" | "+productId+" | "+marketingCode);};}PromoCatSku.trackMarketingLabelClick=trackMarketingLabelClick;function trackProductImpressionMulti(productImpressionParametersList){analytics.trackEcommerceProductImpressionMulti(productImpressionParametersList,"sku_promotion_box");}PromoCatSku.trackProductImpressionMulti=trackProductImpressionMulti;})(PromoCatSku=HousewaresAnalytics.PromoCatSku||(HousewaresAnalytics.PromoCatSku={}));var PromoCatMnm;(function(PromoCatMnm){function trackAllLink(tabname){if(tabname===void 0){tabname="";}analytics.trackEventV2("housewares","mixnmatch_box_see_all",tabname||"undefined_tab_name");}PromoCatMnm.trackAllLink=trackAllLink;function trackPromoTab(tabname,salesCode){if(tabname===void 0){tabname="";}if(salesCode===void 0){salesCode="";}analytics.trackEventV2("housewares","mixnmatch_box",(tabname||"undefined_tab_name")+" | "+(salesCode||"NA"));}PromoCatMnm.trackPromoTab=trackPromoTab;function trackNextBtn(){analytics.trackEventV2("housewares","mixnmatch_box_next_page","NA");}PromoCatMnm.trackNextBtn=trackNextBtn;function trackPrevBtn(){analytics.trackEventV2("housewares","mixnmatch_box_previous_page","NA");}PromoCatMnm.trackPrevBtn=trackPrevBtn;function trackPromoClick(clickThroughUrl,bbCode,salesCode,tabname,position,altText,mabsRefId){if(clickThroughUrl===void 0){clickThroughUrl="";}if(bbCode===void 0){bbCode="";}if(salesCode===void 0){salesCode="";}if(tabname===void 0){tabname="";}if(position===void 0){position=0;}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEventV2("housewares","mixnmatch_box_rule",(tabname||"undefined_tab_name")+" | "+(bbCode||"NA"));analytics.trackEcommercePromoClick(bbCode||"NA",mabsRefId?mabsRefId:(altText||"NA"),"housewares_mixnmatch_box_"+(tabname||"undefined_tab_name"),(position+1).toString());}PromoCatMnm.trackPromoClick=trackPromoClick;function trackPromoImpressionMulti(promoImpressionParametersList){analytics.trackEcommercePromoImpressionMulti(promoImpressionParametersList);}PromoCatMnm.trackPromoImpressionMulti=trackPromoImpressionMulti;})(PromoCatMnm=HousewaresAnalytics.PromoCatMnm||(HousewaresAnalytics.PromoCatMnm={}));var SelectedReview;(function(SelectedReview){function trackAllReviewClick(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"comment_see_all","NA");}SelectedReview.trackAllReviewClick=trackAllReviewClick;function trackReviewClick(catCode,productId,mabsRefId){if(catCode===void 0){catCode="";}if(productId===void 0){productId="";}if(mabsRefId===void 0){mabsRefId="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"comment_text",catCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));}SelectedReview.trackReviewClick=trackReviewClick;function trackProductClick(productId,productCatCode,name,brandName,position,price,mabsRefId,customDimension2){if(productId===void 0){productId="";}if(productCatCode===void 0){productCatCode="";}if(name===void 0){name="";}if(brandName===void 0){brandName="";}if(position===void 0){position=0;}if(price===void 0){price="";}if(mabsRefId===void 0){mabsRefId="";}if(customDimension2===void 0){customDimension2="";}return function(){analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"comment_pdp",productCatCode+" | "+productId+" | mabs_"+(mabsRefId!=""?mabsRefId:"false"));analytics.trackEcommerceProductClick({"id":productId,"name":name,"brand":brandName,"category":productCatCode,"position":position,"price":analytics.trimDisplayPrice(price),"list":analytics.getGaRevamp2020AnalyticsZone()+"_comment","dimension2":customDimension2,"mabsRefId":mabsRefId!=""?mabsRefId:""});};}SelectedReview.trackProductClick=trackProductClick;function trackSlideChange(currentSlide,nextSlide){var action=(nextSlide>currentSlide?"comment_next_page":"comment_previous_page");analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),action,"NA");}
9SelectedReview.trackSlideChange=trackSlideChange;function trackProductImpressionMulti(productImpressionParametersList){analytics.trackEcommerceProductImpressionMulti(productImpressionParametersList);}SelectedReview.trackProductImpressionMulti=trackProductImpressionMulti;})(SelectedReview=HousewaresAnalytics.SelectedReview||(HousewaresAnalytics.SelectedReview={}));var CatBread;(function(CatBread){function trackAllProduct(catCode){if(catCode===void 0){catCode="";}analytics.trackEvent("Housewares","Bread_Product_All",catCode);}CatBread.trackAllProduct=trackAllProduct;function trackProductClick(productId,productCatCode,name,brandName,position,catCode){if(productId===void 0){productId="";}if(productCatCode===void 0){productCatCode="";}if(name===void 0){name="";}if(brandName===void 0){brandName="";}if(position===void 0){position=0;}if(catCode===void 0){catCode="";}return function(){analytics.trackEvent("Housewares","Bread_PDP_"+catCode,productCatCode+"_"+productId);analytics.trackEcommerceProductClick({"id":productId,"name":name,"brand":brandName,"category":productCatCode,"position":position,"list":"Housewares_Bread_"+catCode});};}CatBread.trackProductClick=trackProductClick;function trackQuickViewClick(productCatCode,productId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}return function(){analytics.trackEvent("Housewares","Bread_Product_Quickview",productCatCode+"_"+productId);};}CatBread.trackQuickViewClick=trackQuickViewClick;function trackAddToWishlistClick(productCatCode,productId){if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}return function(){analytics.trackEvent("Housewares","Bread_Product_Wishlist",productCatCode+"_"+productId);};}CatBread.trackAddToWishlistClick=trackAddToWishlistClick;function trackPromotionTagClick(promotionCode,productCatCode,productId){if(promotionCode===void 0){promotionCode="";}if(productCatCode===void 0){productCatCode="";}if(productId===void 0){productId="";}return function(){analytics.trackEvent("Housewares","Bread_Product_"+promotionCode,productCatCode+"_"+productId);};}CatBread.trackPromotionTagClick=trackPromotionTagClick;function trackProductImpressionMulti(productImpressionParametersList){analytics.trackEcommerceProductImpressionMulti(productImpressionParametersList);}CatBread.trackProductImpressionMulti=trackProductImpressionMulti;})(CatBread=HousewaresAnalytics.CatBread||(HousewaresAnalytics.CatBread={}));var AdvancedPromotionBox;(function(AdvancedPromotionBox){function trackMarketingLabelClick(primaryCatCode,productId){if(primaryCatCode===void 0){primaryCatCode="";}if(productId===void 0){productId="";}return function(marketingCode){if(marketingCode===void 0){marketingCode="";}analytics.trackEvent(analytics.getGaRevamp2020AnalyticsZone(),"advanced_promotion_box_marketing_label",primaryCatCode+" | "+productId+" | "+marketingCode);};}AdvancedPromotionBox.trackMarketingLabelClick=trackMarketingLabelClick;})(AdvancedPromotionBox=HousewaresAnalytics.AdvancedPromotionBox||(HousewaresAnalytics.AdvancedPromotionBox={}));})(HousewaresAnalytics||(HousewaresAnalytics={}));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var CountDownTimer=(function(_super){__extends(CountDownTimer,_super);function CountDownTimer(props){var _this=_super.call(this,props)||this;_this.timer=_this.timer.bind(_this);var timeLeft=props.timeRemain;timeLeft<0&&(timeLeft=0);_this.localCurrent=Date.now();_this.state={timeLeft:timeLeft};return _this;}CountDownTimer.prototype.componentDidMount=function(){var _this=this;if(this.state.timeLeft>0){this.timerRef=setInterval(function(){_this.timer();},1000);}};CountDownTimer.prototype.timer=function(){var newTime=Date.now();var diff=newTime-this.localCurrent;
9this.localCurrent=newTime;var timeLeft;if(diff>this.state.timeLeft){clearInterval(this.timerRef);this.props.timeUpHandler&&this.props.timeUpHandler();timeLeft=0;}else{timeLeft=this.state.timeLeft-diff;}this.setState({timeLeft:timeLeft});};CountDownTimer.prototype.timeStampToDay=function(timeStamp){return Math.floor(timeStamp/86400000);};CountDownTimer.prototype.timeStampToHour=function(timeStamp){return Math.floor(timeStamp%86400000/3600000);};CountDownTimer.prototype.timeStampToMin=function(timeStamp){return Math.floor(timeStamp%3600000/60000);};CountDownTimer.prototype.timeStampToSec=function(timeStamp){return Math.floor(timeStamp%60000/1000);};CountDownTimer.prototype.timeCountTo2DigitStr=function(num){return""+(num<10?"0":"")+num;};CountDownTimer.prototype.timeCountSplitTo2Integer=function(num){return[""+Math.floor((num%100)/10),""+num%10];};CountDownTimer.prototype.render=function(){var countDownDay=this.timeStampToDay(this.state.timeLeft);var countDownHour=this.timeStampToHour(this.state.timeLeft);var countDownMin=this.timeStampToMin(this.state.timeLeft);var countDownSec=this.timeStampToSec(this.state.timeLeft);var dateArr=this.timeCountSplitTo2Integer((countDownDay));var hrArr=this.timeCountSplitTo2Integer((countDownHour));var minArr=this.timeCountSplitTo2Integer((countDownMin));var secArr=this.timeCountSplitTo2Integer((countDownSec));return(React.createElement("div",{className:"countDownTimer"},React.createElement("div",{className:"counter"},React.createElement("div",{className:"count tenDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),dateArr[0]),React.createElement("div",{className:"count unitDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),dateArr[1]),React.createElement("div",{className:"units"},this.props.timerUnits.day),React.createElement("div",{className:"count tenDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),hrArr[0]),React.createElement("div",{className:"count unitDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),hrArr[1]),React.createElement("div",{className:"units"},this.props.timerUnits.hour),React.createElement("div",{className:"count tenDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),minArr[0]),React.createElement("div",{className:"count unitDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),minArr[1]),React.createElement("div",{className:"units"},this.props.timerUnits.min),React.createElement("div",{className:"count tenDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),secArr[0]),React.createElement("div",{className:"count unitDigit"},React.createElement("div",{className:"counterDecorator",style:{backgroundColor:this.props.decoratorColor}}),React.createElement("div",{className:"counterHorizontalLine"}),secArr[1]),React.createElement("div",{className:"units"},this.props.timerUnits.sec))));};return CountDownTimer;}(React.Component));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();
9var CountdownTimerWithImpressive=withImpressionTrack(CountDownTimer);var CountDownTimerContainer=(function(_super){__extends(CountDownTimerContainer,_super);function CountDownTimerContainer(props){var _this=_super.call(this,props)||this;_this.maxTimeRemain=8640000;_this.updateImageOnTimeup=_this.updateImageOnTimeup.bind(_this);_this.state={showImg:_this.props.image,impressed:false};_this.timerContainerOnClickHandle=_this.timerContainerOnClickHandle.bind(_this);_this.onImpressHandler=_this.onImpressHandler.bind(_this);return _this;}CountDownTimerContainer.prototype.updateImageOnTimeup=function(){this.setState({showImg:this.props.timeoutImage});};CountDownTimerContainer.prototype.timerContainerOnClickHandle=function(){var analyticsZoneName=UIAnalytics.getAnalyticsZone();analytics.trackEcommercePromoClick(this.props.clickThroughUrl,this.props.name,analyticsZoneName+"_Countdown_Timer","");};CountDownTimerContainer.prototype.onImpressHandler=function(){if(!this.state.impressed){var analyticsZoneName=UIAnalytics.getAnalyticsZone();analytics.trackEcommercePromoImpression(this.props.clickThroughUrl,this.props.name,analyticsZoneName+"_Countdown_Timer","");this.setState({impressed:true});}};CountDownTimerContainer.prototype.render=function(){return(React.createElement("div",{style:{backgroundColor:this.props.bgColor,display:this.props.timeRemain<this.maxTimeRemain?"block":"none"}},React.createElement("a",{href:this.props.clickThroughUrl,target:this.props.external?"_blank":"_self",onClick:this.timerContainerOnClickHandle},React.createElement("div",{className:"timerContainer"},React.createElement("div",{id:"countdownArea"},React.createElement("div",{className:"titleImg"},React.createElement("img",{src:this.state.showImg.url,alt:this.state.showImg.altText})),React.createElement(CountdownTimerWithImpressive,{timeRemain:this.props.timeRemain*1000,timeUpHandler:this.updateImageOnTimeup,timerUnits:this.props.unitString,decoratorColor:this.props.bgColor,onImpress:this.onImpressHandler}))))));};return CountDownTimerContainer;}(React.Component));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var __assign=(this&&this.__assign)||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s){if(Object.prototype.hasOwnProperty.call(s,p)){t[p]=s[p];}}}return t;};var MechanicsBanner1188=function(props){function onPromoClickHandler(){var analyticsZoneName=analytics.getGaRevamp2020AnalyticsZone();analytics.trackEventV2(analyticsZoneName,"mechanics_banner",props.headline+" | "+props.anchorUrl+" | mabs_false");analytics.trackEcommercePromoClick(props.anchorUrl,props.headline,analyticsZoneName+"_mechanics_banner","");analytics.trackKafkaPromoClick("mechanics_banner",[{clickthrough_link:props.anchorUrl||"",mabs_ref_id:"",promotion_name:props.headline||"",creative_slot:1}]);}var imageDOM=(React.createElement("img",{src:props.imageUrl,alt:props.headline,title:props.headline}));var bannerDOM;if(props.anchorUrl!=""){bannerDOM=(React.createElement("a",{tabIndex:-1,href:props.anchorUrl,target:props.anchorTarget},imageDOM));}else{bannerDOM=imageDOM;}return(React.createElement("div",{className:"mechanics-banner-1188",style:{backgroundColor:props.backgroundColor},"data-videoid":props.upperButton,"data-reloadinterval":props.lowerButton,onClick:onPromoClickHandler},React.createElement("div",{className:"width-1188"},bannerDOM)));};var MechanicsBannerWithImpressive=withImpressionTrack(MechanicsBanner1188);var MechanicsBannerContainer=(function(_super){__extends(MechanicsBannerContainer,_super);function MechanicsBannerContainer(props){var _this=_super.call(this,props)||this;_this.onImpressHandler=_this.onImpressHandler.bind(_this);_this.state={impressed:false};return _this;}MechanicsBannerContainer.prototype.onImpressHandler=function(){if(!this.state.impressed){var analyticsZoneName=analytics.getGaRevamp2020AnalyticsZone();
9analytics.trackEcommercePromoImpression(this.props.anchorUrl,this.props.headline,analyticsZoneName+"_mechanics_banner","");analytics.trackKafkaPromoImpressionMulti("mechanics_banner",[{clickthrough_link:this.props.anchorUrl||"",mabs_ref_id:"",promotion_name:this.props.headline||"",creative_slot:0}]);this.setState({impressed:true});}};MechanicsBannerContainer.prototype.render=function(){return(React.createElement(MechanicsBannerWithImpressive,__assign({},this.props,{onImpress:this.onImpressHandler})));};return MechanicsBannerContainer;}(React.Component));var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var CurrentVisitorContainer=function(props){var onCloseClick=props.onCloseClick,currentVisitor=props.currentVisitor;var parser=function(price){if(price==null){return null;}if(price>99999){return"99,999+";}var priceStr;priceStr=price.toString();return priceStr.replace(/\B(?=(\d{3})+(?!\d))/g,",");};var digitStyle=function(cv){switch(cv.toString().length){case (1):return{marginRight:"80px"};case (2):return{marginRight:"70px"};case (3):return{marginRight:"60px"};case (4):return{marginRight:"55px"};case (5):return{marginRight:"47px"};case (6):return{marginRight:"33px"};default:return{};}};return(React.createElement("div",{id:"currentVisitor"},React.createElement("div",{className:"currentVisitorContainer"},React.createElement("div",{className:"currentVistorContentAbs",style:{width:148,height:70}},React.createElement("div",{style:digitStyle(currentVisitor),className:"currentVisitorContent"},parser(currentVisitor)),React.createElement("div",{className:"closeBtnContainer",onClick:onCloseClick},React.createElement("i",{className:"closeBtn"}," ",React.createElement("svg",{height:16,viewBox:"0 0 16 16",width:16},React.createElement("g",{fill:"none"},React.createElement("circle",{cx:8,cy:8,fill:"#ddd",r:8}),React.createElement("path",{d:"M11.825 3.429l.746.746-3.828 3.827 3.828 3.827-.742.742-3.827-3.828-3.827 3.828-.746-.745 3.826-3.828L3.43 4.17l.742-.742 3.827 3.826z",fill:"#222"})))))))));};var ScrollingTextBarContainer=(function(_super){__extends(ScrollingTextBarContainer,_super);function ScrollingTextBarContainer(props){var _this=_super.call(this,props)||this;_this.telexOptions={"speed":35,"pauseOnHover":true};_this.updateCount=1;_this.isScrollingTextBarRender=_this.props.dataString.length+_this.props.gaDataString.length>4;_this.isCurrentVisitorRender=_this.props.currentVisitor&&_this.props.currentVisitor>0;_this.maxMessages=40;_this.toggleCurrentVisitor=function(){_this.setState({isCurrentVisitorShow:false});};_this.getLastMessageIndex=_this.getLastMessageIndex.bind(_this);_this.shuffleMessageSequence=_this.shuffleMessageSequence.bind(_this);_this.handleUpdateMessage=_this.handleUpdateMessage.bind(_this);_this.parseUpdateData=_this.parseUpdateData.bind(_this);_this.formatRenderData=_this.formatRenderData.bind(_this);_this.updateDataInState=_this.updateDataInState.bind(_this);_this.state={isCurrentVisitorShow:true,currentVisitor:_this.props.currentVisitor?_this.props.currentVisitor:null,tempDataString:_this.props.dataString,tempGaDataString:_this.props.gaDataString,tempRenderData:_this.props.gaDataString.concat(_this.shuffleMessageSequence(_this.getLastMessageIndex(),_this.props.dataString))};return _this;}ScrollingTextBarContainer.prototype.shuffleMessageSequence=function(lastIndex,preShuffleData){var shuffled=[];var temp=preShuffleData.slice(0,lastIndex);preShuffleData.slice(lastIndex).map(function(data,index){shuffled.push(data);});temp.map(function(data,index){shuffled.push(data);});return shuffled;};ScrollingTextBarContainer.prototype.getLastMessageIndex=function(){if(hktvCommon.storageAvailable("localStorage")&&localStorage.getItem("scrollingTextLastIndex")){var lastIndex=localStorage.getItem("scrollingTextLastIndex").split("-")[1];return lastIndex;}else{return"0";}};
9ScrollingTextBarContainer.prototype.parseUpdateData=function(scrollingTextData){scrollingTextData=parseObject(scrollingTextData);return{"currentVisitor":((scrollingTextData.currentVisitor!=""&&scrollingTextData.currentVisitor!=undefined)?ValueUtils.parseNumber(scrollingTextData.currentVisitor):null),"bgColor":(scrollingTextData.bgColor!=""?ValueUtils.parseString("#"+scrollingTextData.bgColor):"transparent"),"dataBgColor":(scrollingTextData.dataBgColor!=""?ValueUtils.parseString("#"+scrollingTextData.dataBgColor):"transparent"),"dataFontColor":(scrollingTextData.dataFontColor!=""?ValueUtils.parseString("#"+scrollingTextData.dataFontColor):"#000000"),"gaDataString":scrollingTextData.gaDataString.map(function(el,index){return{"text":ValueUtils.parseString(el.text),"clickThroughUrl":ValueUtils.parseString(el.clickThroughUrl),"dataIndex":0};}),"dataString":scrollingTextData.dataString.map(function(el,index){return{"text":ValueUtils.parseString(el.text),"clickThroughUrl":ValueUtils.parseString(el.clickThroughUrl),"dataIndex":index+1};})};};ScrollingTextBarContainer.prototype.parseUpdateGAData=function(scrollingTextGAData){scrollingTextGAData=parseObject(scrollingTextGAData);return{"currentVisitor":((scrollingTextGAData.currentVisitor!=""&&scrollingTextGAData.currentVisitor!=undefined)?ValueUtils.parseNumber(scrollingTextGAData.currentVisitor):null),"gaUpdateDataString":scrollingTextGAData.gaDataString.map(function(el,index){return{"text":ValueUtils.parseString(el.text),"clickThroughUrl":ValueUtils.parseString(el.clickThroughUrl)};})};};ScrollingTextBarContainer.prototype.handleUpdateMessage=function(){var _this=this;if(this.updateCount>1){this.updateCount=0;Promise.resolve($.getJSON(hktvCommon.addPrefixToHktvUrl("ajax/getLiveData"))).then(function(data){var scrollingTextBarContainerProps=_this.parseUpdateData(data);if((scrollingTextBarContainerProps.dataString.length+scrollingTextBarContainerProps.gaDataString.length)>4){try{_this.setState({tempDataString:scrollingTextBarContainerProps.dataString,tempGaDataString:scrollingTextBarContainerProps.gaDataString});}catch(err){Logger.warn("Failed to render scrolling text bar on update");}}else{Logger.warn("No scrolling text bar found, skipping rendering on update");}if(scrollingTextBarContainerProps.currentVisitor!=null){try{_this.setState({currentVisitor:scrollingTextBarContainerProps.currentVisitor});}catch(err){Logger.warn("Failed to render scrolling text bar on update ga data");}}else{Logger.warn("No current visitor is found, skipping rendering on update ga data");}}).then(function(){_this.updateDataInState();}).caught(function(err){Logger.warn("Failed to get scrolling text bar data on update");});}else{Promise.resolve($.getJSON(hktvCommon.addPrefixToHktvUrl("ajax/getGALiveData"))).then(function(data){var scrollingTextBarGADataProps=_this.parseUpdateGAData(data);if(scrollingTextBarGADataProps.gaUpdateDataString.length>0){try{_this.setState({tempGaDataString:scrollingTextBarGADataProps.gaUpdateDataString});}catch(err){Logger.warn("Failed to render scrolling text bar on update ga data");}}else{Logger.warn("No scrolling text bar found, skipping rendering on update ga data");}if(scrollingTextBarGADataProps.currentVisitor!=null){try{_this.setState({currentVisitor:scrollingTextBarGADataProps.currentVisitor});}catch(err){Logger.warn("Failed to render scrolling text bar on update ga data");}}else{Logger.warn("No current visitor is found, skipping rendering on update ga data");}}).then(function(){_this.updateDataInState();}).caught(function(err){Logger.warn("Failed to get scrolling text bar data on update ga data");});}};ScrollingTextBarContainer.prototype.updateDataInState=function(){this.updateCount++;this.setState({tempRenderData:this.state.tempGaDataString.concat(this.shuffleMessageSequence(this.getLastMessageIndex(),this.state.tempDataString))});if(this.isScrollingTextBarRender){this.telexObj.messages=this.formatRenderData();}};ScrollingTextBarContainer.prototype.formatRenderData=function(min,max){var _this=this;if(min===void 0){min=0;}if(max===void 0){max=this.maxMessages;}return this.state.tempRenderData.slice(min,max).map(function(data,index){return{"content":data.clickThroughUrl?'<div style="background-color:'+_this.props.dataBgColor+";
9color:"+_this.props.dataFontColor+'" '+'class="scrollingText '+"index-"+data.dataIndex+'">'+'<a target="_blank" style="color:'+_this.props.dataFontColor+';" href="'+data.clickThroughUrl+'">'+data.text+"</a>"+"</div>":'<div style="background-color:'+_this.props.dataBgColor+";color:"+_this.props.dataFontColor+'" '+'class="scrollingText '+"index-"+data.dataIndex+'">'+data.text+"</div>"};});};ScrollingTextBarContainer.prototype.componentDidUpdate=function(){};ScrollingTextBarContainer.prototype.componentDidMount=function(){if(this.isScrollingTextBarRender){this.telexObj=Telex.widget("scrollingArea",this.telexOptions,this.formatRenderData());}var updateMessage=setInterval(this.handleUpdateMessage,180000);};ScrollingTextBarContainer.prototype.render=function(){var _this=this;return(React.createElement("div",null,this.isScrollingTextBarRender?React.createElement("div",{style:{backgroundColor:this.props.bgColor}},React.createElement("div",{className:"scrollingContainer"},React.createElement("div",{id:"scrollingArea"}))):null,this.isCurrentVisitorRender&&this.state.isCurrentVisitorShow?React.createElement(CurrentVisitorContainer,{currentVisitor:this.state.currentVisitor,onCloseClick:function(){return _this.toggleCurrentVisitor();}}):null));};return ScrollingTextBarContainer;}(React.Component));var St12HotcatCard=function(props){var imageUrl=props.imageUrl,clickThroughUrl=props.clickThroughUrl,displayText=props.displayText,onClick=props.onClick;return(React.createElement("a",{className:"st12-hotcat-card",href:clickThroughUrl,target:"_blank",onClick:onClick},React.createElement("span",{className:"display-text"},displayText),React.createElement(UIImageContainer,{className:"thumbnail",src:imageUrl,alt:displayText,width:"140px",height:"170px"})));};St12HotcatCard.displayName="St12HotcatCard";var __extends=(this&&this.__extends)||(function(){var extendStatics=Object.setPrototypeOf||({__proto__:[]} instanceof Array&&function(d,b){d.__proto__=b;})||function(d,b){for(var p in b){if(b.hasOwnProperty(p)){d[p]=b[p];}}};return function(d,b){extendStatics(d,b);function __(){this.constructor=d;}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __());};})();var St12HotcatShowMoreButton=(function(_super){__extends(St12HotcatShowMoreButton,_super);function St12HotcatShowMoreButton(props){var _this=_super.call(this,props)||this;_this.state={"hovering":false};_this.handleMouseEnter=_this.handleMouseEnter.bind(_this);_this.handleMouseLeave=_this.handleMouseLeave.bind(_this);return _this;}St12HotcatShowMoreButton.prototype.handleMouseEnter=function(evt){this.setState({"hovering":true});};St12HotcatShowMoreButton.prototype.handleMouseLeave=function(evt){this.setState({"hovering":false});};St12HotcatShowMoreButton.prototype.render=function(){var _a=this.props,displayText=_a.displayText,arrowHeading=_a.arrowHeading,onClickHandler=_a.onClickHandler;var style={"minWidth":"306px","height":"48px"};return(React.createElement(St12ShowMoreButton,{displayText:displayText,arrowHeading:arrowHeading,style:style,onClickHandler:onClickHandler,onMouseEnterHandler:this.handleMouseEnter,onMouseLeaveHandler:this.handleMouseLeave}));};return St12HotcatShowMoreButton;}(React.Component));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.