PageSourceSearch

https://www.nivea.com.mx/dist/NiveaX/modules/DesktopNavigation.2b7f79eb.js

js nivea.com.mx collected 2026-09-26 09:59:59 UTC 11,537 bytes, 2 lines download raw bytes

1"use strict";(self.NiveaXwebpackJsonp=self.NiveaXwebpackJsonp||[]).push([[3695],{61269:(e,t,n)=>{n.d(t,{E:()=>l});var i=n(60778);function l(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(t){return(0,i.T)(function(e,t){var n=function(n){for(var i=n,l=0;l<t;l++){var s=i[e[l]];if(void 0===s)return;i=s}return i};return n}(e,n))(t)}}},66761:(e,t,n)=>{n.r(t),n.d(t,{default:()=>w});var i=n(84817),l=n(19446),s=n(42194),r=n(42028),o=n(71678),a=n(45204),u=n(41445),h=n(61269),v=n(60778),c=n(38373),d=n(24746),f=n(31772),p=n(70846),m=n(38406);function x(e){var t=arguments.length,n=f.b;(0,m.m)(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],t--);var i=null;t>=2&&(i=arguments[1]);var l=Number.POSITIVE_INFINITY;return t>=3&&(l=arguments[2]),function(t){return t.lift(new b(e,i,l,n))}}var b=function(){function e(e,t,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=n,this.scheduler=i}return e.prototype.call=function(e,t){return t.subscribe(new g(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),_=function(){return function(){this.buffer=[]}}(),g=function(e){function t(t,n,i,l,s){var r=e.call(this,t)||this;r.bufferTimeSpan=n,r.bufferCreationInterval=i,r.maxBufferSize=l,r.scheduler=s,r.contexts=[];var o=r.openContext();if(r.timespanOnly=null==i||i<0,r.timespanOnly){var a={subscriber:r,context:o,bufferTimeSpan:n};r.add(o.closeAction=s.schedule(y,n,a))}else{var u={subscriber:r,context:o},h={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:r,scheduler:s};r.add(o.closeAction=s.schedule(C,n,u)),r.add(s.schedule(L,i,h))}return r}return d.C6(t,e),t.prototype._next=function(e){for(var t,n=this.contexts,i=n.length,l=0;l<i;l++){var s=n[l],r=s.buffer;r.push(e),r.length==this.maxBufferSize&&(t=s)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,n=this.destination;t.length>0;){var i=t.shift();n.next(i.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var n=this.bufferTimeSpan,i={subscriber:this,context:e,bufferTimeSpan:n};this.add(e.closeAction=this.scheduler.schedule(y,n,i))}},t.prototype.openContext=function(){var e=new _;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(p.v);function y(e){var t=e.subscriber,n=e.context;n&&t.closeContext(n),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function L(e){var t=e.bufferCreationInterval,n=e.bufferTimeSpan,i=e.subscriber,l=e.scheduler,s=i.openContext();i.closed||(i.add(s.closeAction=l.schedule(C,n,{subscriber:i,context:s})),this.schedule(e,t))}function C(e){var t=e.subscriber,n=e.context;t.closeContext(n)}var k=n(98684);var S=n(21464);const T='[data-module="DesktopNavigation"]';class w{static setup(e=T){Array.from(document.querySelectorAll(e)).filter(e=>!e.dataset.moduleInitialized).forEach(e=>{new w(e),e.dataset.moduleInitialized="true"})}constructor(e,t){this.element=e,this.navStructure=t,this.navigation=this.element.querySelector(".nx-nav-desktop"),this.navigationWrapper=this.element.querySelector(".nx-nav-desktop__wrapper"),this.globalFlyout=this.navigation.querySelector(".nx-nav-desktop__global-flyout"),this.firstLevelList=this.navigation.querySelector(".nx-nav-first-level"),this.init()}init(){this.navStructure=this.navStructure||this.getNavStructure(),this.navStructure&&(this.overviewTitle=this.navStructure.OverviewTitle,this.buildNavigation(this.navStructure).setEventHandlers(),(0,S.aO)(this.element.querySelector(".nx-nav-first-level")),document.dispatchEvent(new CustomEvent("ScrollSlider:reset")),this.setCurrentNavigationHighlight())}setCurrentNavigationHighlight(){const e=window.location.pathname;this.firstLevelLinks.forEach(t=>{t.getAttribute("href")===e&&t.classList.add("nx-nav-first-level__link--highlighted")})}setEventHandlers(){this.firstLevelItems=Array.from(document.querySelectorAll(".nx-nav-first-level__item:not(.nx-nav-first-level__item--nochildred)")),this.firstLevelLinks=this.firstLevelItems.map(e=>e.querySelector(".nx-nav-first-level__link")),this.thirdLevelLinks=Array.from(document.querySelectorAll(".nx-nav-third-level__link--has-submenu"));const e=(0,i.H)(this.firstLevelItems),t=(0,i.H)(this.firstLevelLinks),n=(0,i.H)(this.thirdLevelLinks),c=t.pipe((0,r.ZZ)(e=>(0,l.R)(e,"mouseenter")),(0,o.n)(()=>this.didMouseStayInLevel())),d=t.pipe((0,r.ZZ)(e=>(0,l.R)(e,"touchstart",{passive:!0})),(0,a.p)(({currentTarget:e})=>!this.isLevelActive(e.parentElement)),(0,u.M)(({currentTarget:e})=>this.showLevel(e.parentElement)),(0,u.M)(()=>
1this.listenToTouchOnBody()),(0,u.M)(e=>e.preventDefault()),(0,h.E)("currentTarget","parentElement")),f=n.pipe((0,r.ZZ)(e=>(0,l.R)(e,"click")),(0,u.M)(e=>e.preventDefault())),p=(0,s.h)(c,d).pipe((0,v.T)(e=>[e,e.querySelector(".nx-nav-desktop__flyout")]),(0,v.T)(([e,t])=>[e,t?t.offsetHeight:0])),m=e.pipe((0,r.ZZ)(e=>(0,l.R)(e,"click")),(0,a.p)(({target:e})=>this.isCloseFlyoutBtn(e))),x=(0,l.R)(this.firstLevelItems,"mouseleave").pipe((0,o.n)(()=>this.didMouseLeaveNavigation())),b=(0,s.h)(x,m);return p.subscribe(([e,t])=>this.openNavigation(e,t)),b.subscribe(()=>this.closeNavigation()),f.subscribe(e=>{this.openClusterLevel(e.target)}),this}openNavigation(e,t){if(!this.hasNoChildren(e))return this.resetAllLevels().showLevel(e).adjustFlyout(t).fadeInBody().closeFourthLevel(),this}closeNavigation(){return this.resetAllLevels().adjustFlyout().fadeOutBody().closeFourthLevel(),this}openClusterLevel(e){const t=e.closest("li"),n=e.closest(".nx-nav-desktop__flyout");t.classList.contains("nx-nav-third-level__item--show-cluster")?t.classList.remove("nx-nav-third-level__item--show-cluster"):t.classList.add("nx-nav-third-level__item--show-cluster"),this.globalFlyout.classList.add("nx-nav-desktop__global-flyout--remove-animation");const i=setInterval(()=>{this.adjustFlyout(n.offsetHeight)},10);return setTimeout(()=>{clearInterval(i),this.globalFlyout.classList.remove("nx-nav-desktop__global-flyout--remove-animation")},600),this}closeFourthLevel(){return Array.from(document.querySelectorAll(".nx-nav-third-level__item--show-cluster")).forEach(e=>e.classList.remove("nx-nav-third-level__item--show-cluster")),this}isInNavigation(e){return null!==e.closest(".nx-nav-first-level")}
1hasNoChildren(e){return e.closest(".nx-nav-first-level__item").classList.contains("nx-nav-first-level__item--nochildred")}isLevelActive(e){return!0===(0,k.nB)(e,"nx-nav-first-level__item--active")}isCloseFlyoutBtn(e){return null!==e.closest(".nx-nav-desktop__flyout-close")}showLevel(e){return(0,k.iQ)(e,"nx-nav-first-level__item--active"),this}resetAllLevels(){return(0,k.vg)(this.firstLevelList.children,"nx-nav-first-level__item--active"),this}fadeInBody(){return(0,k.iQ)(document.body,"nx-nav-desktop--open"),this}fadeOutBody(){return(0,k.vy)(document.body,"nx-nav-desktop--open"),this}adjustFlyout(e=0){return this.globalFlyout.style.maxHeight=e+"px",this}listenToTouchOnBody(){return(0,l.R)(document.body,"touchstart",{passive:!0}).pipe((0,h.E)("target"),(0,a.p)(e=>!this.isInNavigation(e)),(0,c.$)()).subscribe(()=>this.closeNavigation()),this}didMouseLeaveNavigation(){return(0,l.R)(document.body,"mousemove").pipe(x(300),(0,c.$)(),(0,v.T)(e=>e[e.length-1]),(0,v.T)(e=>e?e.target:null),(0,a.p)(e=>!e||!this.isInNavigation(e)||this.hasNoChildren(e)))}didMouseStayInLevel(){return(0,l.R)(document.body,"mousemove").pipe(x(200),(0,c.$)(),(0,v.T)(e=>e[e.length-1].target),(0,a.p)(e=>this.isInNavigation(e)),(0,v.T)(e=>e.closest(".nx-nav-first-level__item")))}getNavStructure(){const e=document.querySelector("[data-navigation-structure]");return e&&JSON.parse(e.innerHTML)||{}}buildLinkElement(e,t,n,i="",l=!1,s=!1){let r=document.createElement("a"),o=document.createElement("li");if(o.className=i,r.className=n,r.innerHTML=l||e.Title,r.setAttribute("href",e.Url),r.setAttribute("title",l||e.Title),s){const e=(0,k.Uo)("ltr"==document.dir?' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M11.922,24.854a.8.8,0,0,1-.563-1.369L18.939,16l-7.58-7.485a.8.8,0,0,1,1.125-1.139l8.157,8.055a.8.8,0,0,1,0,1.139l-8.157,8.053A.793.793,0,0,1,11.922,24.854Z"/></svg>':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M20.078,24.854a.8.8,0,0,1-.563-.231L11.359,16.57a.8.8,0,0,1,0-1.139l8.156-8.055A.8.8,0,0,1,20.64,8.515L13.06,16l7.58,7.485a.8.8,0,0,1-.562,1.369Z"/></svg>');r.appendChild(e)}return o.appendChild(r),t.appendChild(o),o}buildNavigation(e){for(let t=0;t<e.NavigationItems.length;t++){let n=e.NavigationItems[t],i=this.navigation.children[0].children[t],l=n.MarketingTeaser,s=document.createElement("div");s.setAttribute("class","nx-nav-desktop__flyout");let r=document.createElement("div");if(r.setAttribute("class","nx-nav-desktop__flyout-inner"),s.appendChild(r),s.appendChild(this.getFlyoutCloseBtn()),i.appendChild(s),n.Children&&n.Children.length>0){let e=this.buildSubLevelMenu(n.Children,r,"nx-nav-second-level");l&&e.appendChild(this.createTeaserMarkup(l))}else n.Children&&0===n.Children.length&&i.classList.add("nx-nav-first-level__item--nochildred")}return this}buildSubLevelMenu(e,t,n){let i=document.createElement("ul");i.setAttribute("class",n);let l=t.appendChild(i);for(let t=0;t<e.length;t++){let n=this.buildLinkElement(e[t],l,"nx-nav-desktop__second-level-link nx-font--bold nx-font-text-link-large nx-txt-uppercase","nx-nav-second-level__item nx-nav-second-level__item--list");e[t].Children&&this.buildLinkList(e[t],n,"nx-nav-third-level")}return i}buildLinkList(e,t,n){var i,l,s;let r=document.createElement("ul");r.setAttribute("class",n);let o=t.appendChild(r);for(let t=0;t<e.Children.length;t++){let n=this.buildLinkElement(e.Children[t],o,"nx-nav-third-level__link "+((null===(i=e.Children[t].Children)||void 0===i?void 0:i.length)?"nx-nav-third-level__link--has-submenu":""),"nx-nav-third-level__item",!1,!!(null===(l=e.Children[t].Children)||void 0===l?void 0:l.length));(null===(s=e.Children[t].Children)||void 0===s?void 0:s.length)&&this.buildFourthLevel(e.Children[t],n,"nx-nav-fourth-level")}return this}buildFourthLevel(e,t,n){let i=document.createElement("ul");i.setAttribute("class",n);let l=t.appendChild(i);this.buildLinkElement(e,l,"nx-nav-fourth-level__link","nx-nav-fourth-level__item",this.overviewTitle);for(let t=0;t<e.Children.length;t++)this.buildLinkElement(e.Children[t],l,"nx-nav-fourth-level__link","nx-nav-fourth-level__item");return this}createTeaserMarkup(e){return(0,k.Uo)(`<li class="nx-nav-second-level__item nx-nav-teaser">\n                <a class="nx-nav-teaser__link" href="${e.Link}" title="${e.Title}">\n                    <div class="nx-nav-teaser__image-wrapper">\n                        ${e.ImageMarkup}\n                    </div>\n                    <h6 class="nx-nav-teaser__title nx-font-heading-6 nx-font--bold">${e.Title}</h6>\n                </a>\n            </li>`)}getFlyoutCloseBtn(){return(0,k.Uo)('<div class="nx-nav-desktop__flyout-close"><div class="nx-close-icon"></div></div>')}}w.setup(T)}}]);
2//# sourceMappingURL=/dist/NiveaX/./modules/DesktopNavigation.2b7f79eb.js.9e8e1d39.map

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.