(function(){function t(){e(h.section).target.forEach(function(b){d.instances.has(b)||new d(b)})}function g(){q.setLazyLoad();e(h.section).target.forEach(function(b){d.instances.has(b)?d.instances.get(b).reInit():new d(b)})}var e=window.sg.common.$q,u=window.sg.common.constants.BREAKPOINTS,k=window.sg.common.utils,q=window.sg.common.lazyLoad,h={section:".st-two-column",figure:".st-two-column__figure",title:".st-two-column__title",subTitle:".st-two-column__sub-title",rating:".st-two-column__rating",
text:".st-two-column__text",cta:".st-two-column__cta",ctaWrap:".st-two-column__cta-wrap",disclaimer:".st-two-column__disclaimer",subHeadline:".st-two-column__headline, .st-two-column__sub-headline"},d=function(b){this.el={window:e(window),section:e(b)};this.setProperty();this.eventResize=this.resize.bind(this);d.instances.set(b,this);this.init()};d.prototype.setProperty=function(){this.matchEl=[];this.matchEl[0]=this.el.section.find(h.figure);this.matchEl[1]=this.el.section.find(h.title);this.matchEl[2]=
this.el.section.find(h.subTitle);this.matchEl[3]=this.el.section.find(h.rating);this.matchEl[4]=this.el.section.find(h.text);this.matchEl[5]=this.el.section.find(h.cta);this.matchEl[6]=this.el.section.find(h.ctaWrap);this.matchEl[7]=this.el.section.find(h.disclaimer);this.mobileFlag=this.desktopFlag=!1};d.prototype.init=function(){this.bindEvents();this.resize()};d.prototype.reInit=function(){this.setProperty();this.bindEvents();this.resize()};d.prototype.resize=function(){this.removeHeight();u.MOBILE<
k.getViewPort().width?(!1===this.desktopFlag&&(this.desktopFlag=!0,this.mobileFlag=!1,this.setDesktopClass()),this.setHeight()):!1===this.mobileFlag&&(this.mobileFlag=!0,this.desktopFlag=!1,this.setMobileClass())};d.prototype.bindEvents=function(){var b=this;this.el.window.off("resize",this.eventResize).on("resize",this.eventResize);this.matchEl[0].find("img").target.forEach(function(a){a.addEventListener("load",b.resize.bind(b))})};d.prototype.removeHeight=function(){this.matchEl.forEach(function(b){b.css({height:""})})};
d.prototype.setMobileClass=function(){var b=this;this.matchEl.forEach(function(a,d){a.target.forEach(function(c){c=e(c);b.removeNoData(c)});1===d||2===d?a.target.forEach(function(c){c=e(c);0===c.find(h.subHeadline).target.length?b.setNoData(c):b.removeNoData(c)}):5===d?a.target.forEach(function(c){c=e(c);0===c.find(h.cta).eq(0).height()&&0===c.find(h.cta).eq(1).height()?b.setNoData(c):b.removeNoData(c)}):a.target.forEach(function(c){c=e(c);0===c.height()?b.setNoData(c):b.removeNoData(c)})})};d.prototype.setDesktopClass=
function(){var b=this;this.matchEl.forEach(function(a,d){var c=[],g=0===a.eq(0).find(h.subHeadline).target.length&&0===a.eq(1).find(h.subHeadline).target.length;a.target.forEach(function(a){a=e(a);b.removeNoData(a);c.push(a.height())});var k=Math.max.apply(null,c);1===d||2===d?g?b.setNoData(a):b.removeNoData(a):0===k?b.setNoData(a):b.removeNoData(a)})};d.prototype.setHeight=function(){var b=this;this.matchEl.forEach(function(a,d){var c=[],g=0===a.eq(0).find(h.subHeadline).target.length&&0===a.eq(1).find(h.subHeadline).target.length;
a.target.forEach(function(b){c.push(e(b).height())});var k=Math.max.apply(null,c);1===d||2===d?g?a.css({height:""}):b.setMaxHeight(a,k):0!==k?b.setMaxHeight(a,k):a.css({height:""})})};d.prototype.setMaxHeight=function(b,a){b.css({height:a+"px"})};d.prototype.setNoData=function(b){b.addClass("no-data")};d.prototype.removeNoData=function(b){b.hasClass("no-data")&&b.removeClass("no-data")};d.instances=new WeakMap;e.ready(function(){t();window.sg.components.featureBenefitTwoColumn={reInit:g}})})();
(function(t,g){function e(c){var e=c.val();e={siteCode:k,modelList:e,saleSkuYN:"N",onlyRequestSkuYN:"N"};a&&(e.shopSiteCode=a);r&&(e.commonCodeYN=r);g.ajax({url:p,type:"GET",data:e,dataType:"json",cache:!0,timeout:2E4,success:function(a){if(a.response&&200===a.response.statusCode&&a.response.resultData&&a.response.resultData.productList){a=a.response.resultData.productList;for(var e=0;e<a.length;e++){var l=a[e],g=c,p="",n="",f=l.modelList[0].ratings;fnIsNull(f)&&(f=0,l.modelList[0].ratings=0);var m=
Math.pow(10,1);f=Math.round(f*m)/m;m=parseFloat(f).toFixed(1);f=parseInt(f);var x=parseInt(100*(m-f));"0.0"!==m&&(l.modelList[0].ratings=m);for(m=0;m<f;m++)n+='\x3cspan class\x3d"rating__star-item"\x3e\x3cspan class\x3d"rating__star-empty"\x3e\x3c/span\x3e\x3cspan class\x3d"rating__star-filled" style\x3d"width: 100%;"\x3e\x3c/span\x3e\x3c/span\x3e';if(5>f&&0<f)for(n+='\x3cspan class\x3d"rating__star-item"\x3e\x3cspan class\x3d"rating__star-empty"\x3e\x3c/span\x3e\x3cspan class\x3d"rating__star-filled" style\x3d"width: '+
x+'%;"\x3e\x3c/span\x3e\x3c/span\x3e',m=4;m>f;m--)n+='\x3cspan class\x3d"rating__star-item"\x3e\x3cspan class\x3d"rating__star-empty"\x3e\x3c/span\x3e\x3cspan class\x3d"rating__star-filled" style\x3d"width: 0%;"\x3e\x3c/span\x3e\x3c/span\x3e';else if(0===f)for(f=0;5>f;f++)n+='\x3cspan class\x3d"rating__star-item"\x3e\x3cspan class\x3d"rating__star-empty"\x3e\x3c/span\x3e\x3cspan class\x3d"rating__star-filled" style\x3d"width: 0%;"\x3e\x3c/span\x3e\x3c/span\x3e';l.ratingHtml=n;l.ratingsText=Granite.I18n.get("{0} out of {1} Stars",
["\x3cspan\x3e"+l.modelList[0].ratings+"\x3c/span\x3e","5"],k);null!=l.modelList[0].ratings&&""!=l.modelList[0].ratings&&(n="","0"==l.modelList[0].ratings&&(n=" rating--empty"),p+='\x3cspan class\x3d"rating'+n+'"\x3e\n                 \t\x3cspan class\x3d"hidden"\x3e'+h+'\x3c/span\x3e\n                 \t\x3cspan class\x3d"rating__inner"\x3e\n                 \t\t\x3cspan class\x3d"rating__star-list"\x3e\n                 \t\t\t'+l.ratingHtml+'\n                 \t\t\x3c/span\x3e\n\t                 \t\x3cstrong class\x3d"rating__point"\x3e\x3cspan class\x3d"hidden"\x3e'+
d+" : \x3c/span\x3e\x3cspan\x3e"+l.modelList[0].ratings+'\x3c/span\x3e\x3c/strong\x3e\n\t                 \t\x3cem class\x3d"rating__review-count"\x3e(\x3cspan class\x3d"hidden"\x3e'+b+" :\x3c/span\x3e\x3cspan\x3e"+l.modelList[0].reviewCount+"\x3c/span\x3e)\x3c/em\x3e\n\t                 \x3c/span\x3e\n                 \x3c/span\x3e");g=g.parent().find(".ft09-skuList");for(n=0;n<g.length;n++)for(f=0;f<l.modelList.length;f++)if(m={"data-modelcode":l.modelList[f].modelCode,"data-modelname":l.modelList[f].modelName},
l.modelList[f].modelCode===g.eq(n).attr("data-userRatingSku")){g.eq(n).html(p).attr(m);break}}a=c.parent().find(".ft09-skuList");for(e=0;e<a.length;e++)1>a.eq(e).find("span").length&&a.eq(e).remove()}},error:function(a){a=c.parent().find(".ft09-skuList");for(var b=0;b<a.length;b++)1>a.eq(b).find("span").length&&a.eq(b).remove()}})}var u=g("#searchDomain").val(),k=g("#siteCode").val(),q=g(".ft09-productSku"),h=Granite.I18n.get("Rating"),d=Granite.I18n.get("Product Ratings"),b=Granite.I18n.get("Number Of Ratings"),
a="",r="",c=g("#shopIntegrationFlag").val(),v="Hybris-new"===c,w="Hybris-intg"===c,p=u+"/front/b2c/product/card/detail/";"GPv2"===c?(p+="gpv2",r="N"):w?p+="hybris":v?(r="N",p+="newhybris"):(p+="global","ae"===k||"ae_ar"===k?a=t.cookies.getCookie("dotcom_multistore")||k:"levant"===k?a="jo":"levant_ar"===k?a="jo_ar":"n_africa"===k&&(a="ma"));g(document).on("click",".ft09-skuList.anchor",function(){var a=g(this).attr("href").split("'")[1];g(a).trigger("click")});g(function(){for(var a=0;a<q.length;a++)e(q.eq(a))})})(window,
window.jQuery);