(window.webpackJsonp=window.webpackJsonp||[]).push([[106],{472:function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var o=n(15),i=n.n(o),t=n(16),s=n.n(t),o=n(346),r=n.n(o),t=n(347),a=n.n(t),o=n(348),c=n.n(o),t=n(349),h=n(350),l=n(1),y=n(357),o=n(54),u=n.n(o);function d(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=c()(n);return t=o?(e=c()(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments),a()(this,t)}}var m=function(e){r()(n,e);var t=d(n);function n(){return i()(this,n),t.apply(this,arguments)}return s()(n,[{key:"onCreate",value:function(){this.startVideo(),this.banner(),this.toggleForm(),this.clickLogger(),this.submenuShowHide(),this.scrollMetrics(),this.removeAssingButton(),this.fixedHeader()}},{key:"removeAssingButton",value:function(){setTimeout(function(){document.querySelector(".header-services").style.opacity=1},600);var t=this.dom.querySelector(".signin"),n=t.querySelector("a"),o="true"==t.dataset.subscriberPage;document.cookie.includes("SESS")&&Object(l.a)().then(function(e){"success"==e.status&&e.data&&-1!=e.data.indexOf("7-32")&&(o?t.style.display="none":n.innerHTML='<svg class="crown-icon crown-signin"><use xlink:href="#svg-crown"></svg><span class="hidden-xs"> Só para assinantes</span>',n.href="https://www.uol.com.br/assinante-uol/")}).catch(function(){console.log("Erro na autenticação:",err)})}},{key:"startVideo",value:function(){var e,t,n=this,o=this.dom.querySelector(".bg-video-container");o&&(e=o.querySelector(".bg-video-container video"),t=JSON.parse(e.getAttribute("data-items")),e.setAttribute("src",(t[h.a.breakpoint.name]||t.lg).url),(t=o.getAttribute("data-include"))&&t.split(",").forEach(function(e){e=n.dom.querySelector("."+e);e&&(e.innerHTML+=o.outerHTML)}))}},{key:"hasScroll",value:function(e){return e.classList.contains("hasScrollMobile")}},{key:"fixedHeader",value:function(){var o,i,s,r,n,a,e,c,l,u,d=this;this.dom.classList.contains("fixed")&&(o=null,i=document.querySelector(".hideTitle"),s=document.querySelector(".bannersticky-wrapper"),r=this.dom.querySelector(".header-logo"),s?(this.hasBanner=!0,s.style.position="fixed",this.bannerOriginalHeight=document.querySelector(".model-base-bnr").offsetHeight+2,s.classList.add("fixed"),h.a.checkin("xs")||h.a.checkin("sm")?document.querySelector("body").style.paddingTop="88px":document.querySelector("body").style.paddingTop="138px",o="".concat(this.bannerOriginalHeight,"px")):(o=0,h.a.checkin("xs")||h.a.checkin("sm")?document.querySelector("body").style.paddingTop="88px":document.querySelector("body").style.paddingTop="136px"),this.dom.style.position="fixed",this.dom.style.top=o,y.a.onscroll(function(e){var t=h.a.checkin("xs")?150:400,n=h.a.checkin("xs")?t:500+t;e.top>=t?(d.dom.style.transition="all .4s ease-in",d.hasBanner&&(s.style.top="-".concat(d.bannerOriginalHeight,"px")),i&&i.classList.remove("hideTitle"),d.dom.style.top=0,e.top>=n&&(d.dom.classList.add("scrolling"),h.a.checkin("xs")||h.a.checkin("sm")||(r.style.position="absolute",d.dom.querySelector(".header-menu-lateral").style.opacity=0,r.querySelector(".station").style.display="block",d.dom.querySelector(".header-menu-lateral").style.display="none",d.dom.querySelector(".under").style.display="none",r.style.opacity=1,r.querySelector(".station").style.opacity=1),e=d.dom.clientHeight,(n=document.querySelector(".title-sponsor"))&&(n.style.top="".concat(e,"px")))):(d.hasBanner&&(s.style.top=0),i&&i.classList.add("hideTitle"),d.dom.classList.remove("scrolling"),d.dom.style.top=o,h.a.checkin("xs")||h.a.checkin("sm")||(r.style.position="unset",r.querySelector(".station").style.opacity=0,setTimeout(function(){r.querySelector(".station").style.display="none",d.dom.querySelector(".header-menu-lateral").style.display="block",d.dom.querySelector(".header-menu-lateral").style.opacity=1,d.dom.querySelector(".under").style.display="block"},300)))})),this.dom.classList.contains("vertical-fixed")&&(n=document.querySelector(".header-fixed-vertical header"),e=document.querySelector(".header-fixed-vertical"),n&&(n.style.transform="translateY(-100%)",e.style.display="flex",e=document.querySelector(".bannersticky-wrapper"),a=0,a=e?this.hasScroll(this.dom)?200:386:this.hasScroll(this.dom)?250:450,(e=document.querySelector(".title-home.hideTitle"))&&e.classList.remove("hideTitle"),c=document.querySelector("#profile-avatar"),l=n.querySelector(".widget"),u=document.querySelector("header .services .widget"),y.a.onscroll(function(e){var t;e.top>=a?(l&&l.appendChild(c),n.style.transition="all 567ms ease-in-out",n.style.top="0",n.style.transform="translateY(0)",t=n.clientHeight,(e=document.querySelector(".title-sponsor"))&&(e.style.top="".concat(t,"px"))):(u&&u.appendChild(c),n.style.top="-56px",n.style.transition="all 567ms ease-in-out, visibility 0s linear 0s",n.style.transform="translateY(-100%)")})))}},{key:"scrollMetrics",value:function(){var t,i,s,r,n,o,e=this.dom.getAttribute("data-has-scroll-metrics");this.scrollMetric=this.dom.getAttribute("data-scroll-metrics"),"true"==e&&(t=document.body.clientHeight,i=[25,50,75,95],e=(Audience||{}).ga||{},s="uolestacoes"==e.filename?"uolestacoes.event":"event",n=this.scrollMetric,o=e,r=i.map(function(e){return{hasDone:!1,height:t*(e/100),category:"vertical-scroll-depth",action:"scroll",label:"".concat(e,"%"),nonInteraction:!0,ga:o,central:Audience.central,channel:Audience.channel,mediaName:Audience.mediaName,abTest14:n}}),window.addEventListener("scroll",function(e){var t,n,o=(window.scrollY||window.pageYOffset)+window.innerHeight;for(t in i)r[t].height<=o&&0==r[t].hasDone&&(n=r[t],window.uolAnalytics(s,n),r[t].hasDone=!0)}))}},{key:"toggleClass",value:function(e,t){var n=-1!=e.indexOf(t);return e.replace(new RegExp(n?" ".concat(t):"$"),n?"":" ".concat(t))}},{key:"toggleForm",value:function(){if(!this.dom.classList.contains("withShare")){var e=this.dom.querySelector(".services"),t=e.querySelector(".search");if(!t)return null;var n=t.querySelector("input"),o=e.getAttribute("data-active-form");t.addEventListener("click",function(){e.classList.add(o),n.focus()},!1),n.addEventListener("blur",function(){e.classList.remove(o)},!1)}}},{key:"clickLogger",value:function(){for(var e=this.dom.getAttribute("data-chn-id"),t=/chn:\d+;creative:(linkfixo_menu|barrauol)(_mobile)?;/,n=this.dom.querySelectorAll("a"),o=n.length;o--;){var i=n[o],s=i.href;!0===t.test(s)&&(i.href=s.replace(t,"chn:"+e+";creative:$1$2;"))}}},{key:"banner",value:function(){var e=document.querySelector(".title-container");document.querySelector(".bannersticky-wrapper")&&(!e||(e=(e=null==e.offsetParent?this.dom:e).getBoundingClientRect()).height&&(e=e.height+e.top+window.pageYOffset,!this.dom.classList.contains("fixed")&&0<e&&e<={web:1e3,mobile:500}[this.hasScroll(this.dom)?"mobile":"web"]&&(document.querySelector(".bannersticky-wrapper").style.height="".concat(e,"px"))))}},{key:"submenuShowHide",value:function(){var e=this.dom.querySelectorAll(".menu-wrapper");u()(e).find(".active").addClass("main"),u()(e).find(".menu-item").click(function(e){h.a.checkin(["sm"])&&(u()(this).hasClass("has-submenu")&&(e.preventDefault(),u()(this).find(".submenu-item a").click(function(e){e.stopPropagation()})),u()(this).siblings().removeClass("show-menu"),u()(this).toggleClass("show-menu"))}),u()(e).scroll(function(){u()(this).find(".menu-item").removeClass("show-menu")})}}]),n}(t.a)}}]);