(function ($) { Drupal.behaviors.elc_common = { attach: function (context, settings) { $('.ajax-popover', context).colorbox({ maxWidth: '100%', maxHeight: '100%', href: function() { return this.href + ' #main'; } }); } }; })(jQuery); ; !function(a){Drupal.behaviors.gnavPromoBannerV1={attached:!1,attach:function(n){if(!this.attached){this.attached=!0;var e=a(".js-gnav-promo-banner-v1",n);e.each((function(){var n=a(".js-gnav-promo-banner-carousel",e),t=n.find(".gnav-promo-banner__carousel-item"),o=a(".js-gnav-promo-banner-carousel-arrow",n),i=1,r=null,s=n.data("slides-autoplay"),c=parseInt(n.data("speed"));function l(a,n,e){return n&&a===e?1:!n&&1===a?e:n?a+1:a-1}function u(a){const n=a-1;if(t.removeClass("item-active"),t.eq(n).addClass("item-active"),i=a,s){const a=l(i,!0,t.length);r=setTimeout((()=>u(a)),c)}}o.once().on("click",(function(){const n=parseInt(a(this).data("index")||"1",10)>0,e=l(i,n,t.length);clearTimeout(r),u(e)})),n.removeClass("not-initialized"),u(i)}))}}}}(jQuery); ; !function(a){Drupal.behaviors.headerGnavcartV1={attach:function(e){var r=a("body"),n=a(".js-header-gnav-cart-v1",e),v=a(".js-header-gnav-cart__overlay",n),c=r.find(".js-gnav-header-formatter__bg-full-width"),o=a(".js-gnav-block-dark-overlay",e);a(".js-header-gnav-cart__close",n).add(c).add(o).once().on("click",(function(){v.removeClass("visible"),r.removeClass("active-gnav")}))}}}(jQuery); ; Drupal.behaviors.SDSearchGnavFormatterV1=function(t){var a,e=t(),c=t();return{attached:!1,attach:function(r){this.attached||(this.attached=!0,e=t(".js-sd-search-gnav-input-field",r),c=t(r),a=c[0].documentElement,new MutationObserver((function(t){for(var a=t.length,e=0;ee.handleGnavOnScroll(a)),300))})))},closeAccordions:function(a){n(".js-gnav-submenu-link__input-label",a).prop("checked",!1)},handleGnavOnScroll:function(a){const e=this,o=n(window).scrollTop(),i=o>e.position;a.nodes.$gnavMobileHamburgerTrigger.is(":checked")||e.isGnavHovered||a.nodes.$body.hasClass("active-gnav")||a.nodes.$body.hasClass("search-overlay-displayed")||(e.handleGnavBlockTransitions({currentScrollPosition:o,isScrollingDown:i,$module:a}),e.position=o)},handleGnavBlockTransitions:function({currentScrollPosition:n,isScrollingDown:a,$module:e}){const o=n>e.nodes.gnavTemplateHeight,i=a&&o;e.nodes.$html.toggleClass("gnav-block-hidden",i),e.nodes.$html.toggleClass("gnav-block-sticky-enabled",o)},getDom:function(a){a.nodes={},a.nodes.$html=n("html"),a.nodes.$body=n("body"),a.nodes.$gnavHamburger=n(".js-gnav-block-courtesy-hamburger-link",a),a.nodes.$gnavMainNavigationContainer=n(".js-gnav-block-main-navigation",a),a.nodes.$gnavInputMainLinks=a.nodes.$gnavMainNavigationContainer.find(".js-gnav-block-input-navigation"),a.nodes.$gnavLinkBackMainNavMobile=n(".js-gnav-block-main-navigation-link-back",a),a.nodes.$gnavLinkMainNavTrigger=n(".js-gnav-block-main-navigation-link",a),a.nodes.$gnavLinkMainNavTriggerPc=n('.js-gnav-block-navigation-item[aria-haspopup="true"]',a),a.nodes.$gnavCloseNavMobile=n(".js-gnav-block-courtesy-close-link",a),a.nodes.$gnavMobileHamburgerTrigger=n("#gnav_mobile_input_hamburger_trigger",a),a.nodes.gnavTemplateHeight=a.outerHeight(!0)},setEvents:function(a,e){Unison.on("change",(function(n){var o;e.isMobile=parseInt(n.width,10)0&&(t=i.is(":checked"),a.nodes.$gnavInputMainLinks.removeAttr("checked"),t||i.attr("checked","checked"))})),a.nodes.$gnavLinkBackMainNavMobile.once().on("click touchstart",(function(){var a=n();e.isMobile&&(a=n(this).closest(".js-gnav-block-navigation-item"),e.collapseGnavContent(a),e.closeAccordions(a))})),a.nodes.$gnavLinkMainNavTriggerPc.hover((function(){a.nodes.$gnavLinkMainNavTriggerPc.removeClass("hover"),e.expandGnavContent(n(this)),e.isGnavHovered=!0}),(function(a){n(a.relatedTarget).hasClass("js-safe-triangle")||(e.collapseGnavContent(n(this)),e.isGnavHovered=!1)}))},expandGnavContent:function(a){var e=n(".js-gnav-block-main-navigation-layout",a);e.length>0&&(e.attr("aria-expanded","true"),a.addClass("hover"))},collapseGnavContent:function(a){var e=n(".js-gnav-block-main-navigation-layout",a);e.length>0&&(e.attr("aria-expanded","false"),a.removeClass("hover"))}}}(jQuery); ; !function(n){Drupal.behaviors.gnavSubmenuLinkV1={attached:!1,attach:function(t){var i=n(".js-gnav-submenu-link-v1",t),a=n(".js-gnav-submenu-link__title-accordion",i),e=Unison.fetch.all(),u=Unison.fetch.now(),c=parseInt(u.width,10)0&&(t=i.collateMessages(r,m)),t.length>0?(r.nodes.$emailError.empty(),r.nodes.$emailForm.addClass("error"),r.nodes.$emailError.html(t).removeClass("hidden")):(c=["PC_EMAIL_ADDRESS","PC_EMAIL_PROMOTIONS","PC_EMAIL_PROMOTIONS_PRESENT","ACTION","LAST_SOURCE","ORIGINAL_SOURCE","LANGUAGE_ID","COUNTRY_ID","redirect_or_text","redirect"],r.nodes.$emailAcceptedCommercial.length>0&&c.push("ACCEPTED_COMMERCIAL"),r.nodes.$emailPrivacy.length>0&&c.push("ACCEPTED_PRIVACY_POLICY"),c.forEach((function(i){(l=e(`input[name=${i}]`,r)).is(":checkbox")&&!l.prop("checked")?d[i]="":l.is(":radio")?d[i]=e(`input[name=${i}]:checked`).val():d[i]=l.val()})),d._SUBMIT="email_signup",generic.jsonrpc.fetch({method:"rpc.form",params:[d],onSuccess:function(){r.nodes.$emailContent.addClass("hidden"),r.nodes.$emailSuccess.removeClass("hidden")},onFailure:function(e){t=i.collateMessages(r,e.getMessages()),r.nodes.$emailError.empty(),r.nodes.$emailForm.addClass("error"),r.nodes.$emailError.html(t).removeClass("hidden")}}))}))},collateMessages:function(e,r){var i=[];if(Array.isArray(r))return r.forEach((function(r){"required.pc_email_promotions.email_signup"===r.key&&e.nodes.$emailPromotionError.val()?i.push(e.nodes.$emailPromotionError.val()):"required.pc_email_address.email_signup"===r.key&&e.nodes.$emailAddressError.val()?i.push(e.nodes.$emailAddressError.val()):"required.privacy.email_signup"===r.key&&e.nodes.$emailPrivacyError.val()?i.push(e.nodes.$emailPrivacyError.val()):i.push(r.text)})),i.join("
")}}}(jQuery); ; !function(e){Drupal.behaviors.ie11UpgradeV1={attach:function(i){var a=e(".js-ie-upgrade-v1",i),n=e(".js-ie-upgrade-close",a);e.cookie("CLINIQUE_IE_UPGRADE_POPUP")||(navigator.userAgent.indexOf("MSIE")>=0||navigator.appVersion.indexOf("Trident/")>-1?(a.removeClass("hidden"),n.on("click",(function(){e.cookie("CLINIQUE_IE_UPGRADE_POPUP","1",{path:"/"}),a.addClass("hidden")}))):a.remove())}}}(jQuery); ; !function(e,t){Drupal.behaviors.footerCountryChooserV1={attach:function(o){if(!this.attached){this.attached=!0,t.util=t.util||{},t.util.refreshSelectBoxes=t.util.refreshSelectBoxes||function(){};var a=e("body",o),n=a.attr("data-locale"),r=e(".js-footer-country-chooser-v1",o),s=e(".js-footer-country-chooser__menu",r),c=e(".field-menu, .field-mobile-menu",s),i=e("a",c),l=e(".js-footer-country-chooser__selectbox",r),u=[],f="locale_en_us"===n?c.find(".first"):c.find(".last");f.addClass("selected"),c.prepend('");var d=l.attr("default-country");d&&(d=d.toLowerCase()),i.each((function(){var t=e(this),o=t.attr("href"),a=t.text(),n="";a.toLowerCase()===d&&(n+=' selected="selected"'),u.push('")})),l.append(u),l.next().attr({role:"combobox","aria-haspopup":"true","aria-expanded":"false"}),t.util.refreshSelectBoxes(l),l.on("change",(function(){var t=e(this).val();if(t)return window.location=t,!0})),e(".menu-active-value",c).on("click",(function(e){e.stopPropagation(),s.toggleClass("country-en")})),a.on("click",(function(t){e(this).closest(c).length||s.removeClass("country-en")}))}},attached:!1}}(jQuery,window.site||{}); ; var openSalesforceChat=openSalesforceChat||function(){};!function(e,t){t.behaviors.liveChatServiceDrawer={attach:function(t){var n=e(".js-lc-service-drawer-v2",t),i=e(".js-lc-service-drawer-overlay-v2",t),c=e(".js-live-chat",t),a=e(".js-lc-beauty-advisor-btn",n),o=e(".js-lc-order-status-btn",t);function r(){n.slideUp(),i.slideUp()}c.once().on("click",(function(e){e.stopPropagation(),e.preventDefault(),n.is(":visible")?r():(n.slideDown(),i.slideDown(),void 0!==site.track&&"function"==typeof site.track.evtLink&&site.track.evtLink({event_name:"live chat interaction",event_category:"live chat interaction",event_action:"chat offered",event_label:"click"}))})),i.once().on("click",(function(e){e.stopPropagation(),r()})),e("html").once().on("click",(function(t){e(t.target).hasClass("js-lc-service-drawer")||e(t.target).hasClass("js-live-chat")||r()})),a.once().on("click",(function(t){var n=e(".LPMcontainer img.LPMimage");t.preventDefault(),r(),n.length>0&&(n.trigger("click"),void 0!==site.track&&"function"==typeof site.track.evtLink&&site.track.evtLink({event_name:"live chat interaction",event_category:"live chat interaction",event_action:"chat type selection",event_label:"Beauty Advisor"}))})),o.once().on("click",(function(e){e.preventDefault(),r(),openSalesforceChat(),void 0!==site.track&&"function"==typeof site.track.evtLink&&site.track.evtLink({event_name:"live chat interaction",event_category:"live chat interaction",event_action:"chat type selection",event_label:"Customer Service"})}))}}}(jQuery,Drupal); ; !function(o){customerService3ColRowV1={formatter:o(".cs-3-col-row-v1")},Drupal.behaviors.customerService3ColRowV1={get:function(o){return customerService3ColRowV1[o]},set:function(o,e){customerService3ColRowV1[o]=e},attach:function(e,t){this.get("formatter").each((function(e){o(this)}))}}}(jQuery); ; !function(t){Drupal.behaviors.toutImageV1={attach:function(i,c){t(".tout-image-v1").each((function(){var i=t(this),c=i.find("a");void 0!==c.attr("href")&&i.css("cursor","pointer").on("click",(function(){c.trigger("click")}))}))}}}(jQuery); ; !function(t){customerServiceV1={formatter:t(".cs-formatter-v1")},Drupal.behaviors.customerServiceV1={get:function(t){return customerServiceV1[t]},set:function(t,e){customerServiceV1[t]=e},attach:function(e,r){this.get("formatter").each((function(e){t(this)}))}}}(jQuery); ; !function(o){Drupal.behaviors.offerPromoV1={attach:function(n,r){o(document).ready((function(){o("#header").on(".offer-promo-row","click",(function(n){n.preventDefault();var r=o(this).find(".cta a");window.location.href=r[0].href}))}))}}}(jQuery); ; !function(e){Drupal.behaviors.offerPromoCarouselV1={attach:function(r){e(".offer-promo-carousel-v1").each((function(){var r=e(this).children("ul"),o=r.children("li").length,a=parseInt(r.attr("data-cycle-loop")),c=parseInt(r.attr("stop-on"));if(0==r.hasClass("cycle-slideshow"))return r.children("li").hide(),void r.children("li").eq(0).show();if(c>o&&(c=o),a>0){var l=1,i=1;r.on("cycle-after",(function(e,a,n,t,s){++l>o&&(l=1,i++),2==i&&l==c&&r.cycle("pause")}))}}))}}}(jQuery); ; !function(n){gnavOfferV1={formatter:n(".gnav-offer-v1")},Drupal.behaviors.gnavOfferV1={get:function(n){return gnavOfferV1[n]},set:function(n,e){gnavOfferV1[n]=e},attach:function(e,t){var o=this.get("formatter"),a=location.pathname;o.each((function(){var e=n(this),t=e.attr("data-image-link");null!==t&&0!==t.length&&e.wrapInner('');var o,i=e.attr("data-offer-status"),f=e.attr("data-close-label");if(null!=n.cookie("offer_info")&&n.cookie("offer_info").length>0?(n(".hidegnavoffer").show(),o=n.cookie("offer_info").split(":")[1],generic.jsonrpc.fetch({method:"offer.linkedOfferState",params:[o],onSuccess:function(t){e.replaceWith(t.getValue().linked_offer.cms_content);var o=(e=n(".link-based-offer-v1")).find(".subheading");o.html(t.getValue().linked_offer.offer_message);var a=e.find("h2 span");if(a.is(":empty")){var i=o.find("h2");i.is(":empty")||null==i||a.text(i.text())}e.find(".outer-wrap").once().prepend('