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,GAGE,GAF2BnE,SAASC,cAAc,wBAE1B,CACtB,MAAMmE,EAAmBpE,SAASI,iBAAiB,qBAE/CgE,GAAoBA,EAAiB/D,OAAS,GAChD+D,EAAiB9D,SAASC,IACxBA,EAAO0C,UAAUC,IAAI,SAAS,GAGpC,CACF,EACA,IAAAmB,GACE,IAAIvE,EAAqB,EAEzBoC,KAAKE,kBACLF,KAAKiC,2BAEL,MAAMG,EAA+B,KACnCxE,EAAqBD,IAErBqC,KAAKC,aAAarC,GAElBE,SAASC,cAAc,QAAQ8B,MAAME,WACnCnC,EAAqB,KAEhBoC,KAAKU,MAAM9C,IAGpB,IAAIyE,EAAoBD,IAExBhD,OAAOK,iBAAiB,UAAU,KACP,MAArB4C,GACFA,EAAkBC,aAEpBD,EAAoBD,GAA8B,GAEtD,EACA,IAAAG,GACkBzE,SAAS2C,eAAe,oBAGtCT,KAAKR,4BACLQ,KAAKmC,OACLnC,KAAK1B,sBAET,IAGMiE,M","sources":["webpack://configuracao/./js/utilidades/calcularTamanhoHeader.js","webpack://configuracao/./js/hotsite.js"],"sourcesContent":["export function calcularTamanhoHeader() {\r\n  let tamanhoHeaderAtual = 0;\r\n\r\n  const headerQuestionario = document.querySelector('.header-questionario');\r\n  \r\n  if(headerQuestionario){\r\n    tamanhoHeaderAtual =\r\n    headerQuestionario.offsetHeight < 40 ? 40 : headerQuestionario.offsetHeight;\r\n\r\n    return tamanhoHeaderAtual;\r\n  }\r\n\r\n  const headers = document.querySelectorAll(\".header-empregare\");\r\n  if (headers && headers.length > 0) {\r\n    headers.forEach((header) => {\r\n      if (header.offsetHeight > 0) {\r\n        tamanhoHeaderAtual =\r\n          header.offsetHeight < 40 ? 40 : header.offsetHeight;\r\n      }\r\n    });\r\n  }\r\n\r\n  return tamanhoHeaderAtual;\r\n}\r\n","import { calcularTamanhoHeader } from \"./utilidades/calcularTamanhoHeader\";\r\n\r\nconst hotsite = {\r\n  Internacionalizacao() {\r\n    const selectCultures = document.querySelectorAll(\".cultura\");\r\n    const culturaSelecionada = document.getElementsByClassName(\r\n      \"cultura-selecionada\"\r\n    );\r\n\r\n    for (const botaoCultura of culturaSelecionada) {\r\n      botaoCultura.innerHTML = document.querySelector(\r\n        `a.cultura[data-culture=\"${CULTURE_EMPREGARE}\"]`\r\n      ).innerHTML;\r\n    }\r\n\r\n    selectCultures.forEach(\r\n      (selectCulture) =>\r\n        (selectCulture.onclick = (e) =>\r\n          document\r\n            .querySelectorAll(\".cultura-selecionada\")\r\n            .forEach((dropdown) => {\r\n              const culture = e.target.getAttribute(\"data-culture\");\r\n              window.location.href = window.location.href.replace(\r\n                \"/\" + CULTURE_EMPREGARE,\r\n                \"/\" + culture\r\n              );\r\n            }))\r\n    );\r\n  },\r\n  AjustarPaginasQuandoLogar() {\r\n    // Observar EventListener que e enviado do global ao logar\r\n\r\n    window.addEventListener(\"LoginHotsite\", (e) => {\r\n      const navBarFiltros = document.querySelector(\".navbar-filtros\");\r\n      const tamanhoHeaderAtual = calcularTamanhoHeader();\r\n\r\n      if (!navBarFiltros) {\r\n        document.querySelector(\"body\").style.paddingTop =\r\n          tamanhoHeaderAtual + \"px\";\r\n\r\n        this.DetalhesVaga(tamanhoHeaderAtual);\r\n      } else {\r\n        const filtrosVagas =\r\n          document.getElementsByClassName(\"navbar-filtros\")[0];\r\n        const headerPesquisa = document.querySelector(\r\n          \"#pesquisa-cargo-hotsite\"\r\n        );\r\n\r\n        filtrosVagas.style.top =\r\n          tamanhoHeaderAtual + headerPesquisa.offsetHeight + \"px\";\r\n        headerPesquisa.style.top = tamanhoHeaderAtual + \"px\";\r\n      }\r\n    });\r\n  },\r\n  PainelCandidato() {\r\n    const barraPainelMobile = document.querySelector(\"#tab-botoes\");\r\n\r\n    if (barraPainelMobile) {\r\n      const styleElement = document.createElement(\"style\");\r\n\r\n      styleElement.textContent = `\r\n      @media (max-width: 768px) {\r\n          .tabs-botoes .link-menu-ativo {\r\n              color: var(--bs-secondary) !important;\r\n              border-bottom: 2px solid var(--bs-primary) !important;\r\n          }\r\n          .link-menu-ativo {\r\n              background-color: white !important;\r\n          }\r\n      }`;\r\n\r\n      barraPainelMobile.appendChild(styleElement);\r\n    }\r\n  },\r\n  DetalhesVaga(tamanhoHeaderAtual) {\r\n    const barraDetalheVaga = document.getElementById(\"navbarFixadaDetalheVaga\");\r\n    if (barraDetalheVaga) {\r\n      barraDetalheVaga.style.top = tamanhoHeaderAtual + \"px\";\r\n    }\r\n  },\r\n  Vagas(tamanhoHeaderAtual) {\r\n    const filtrosVagas = document.getElementsByClassName(\"navbar-filtros\")[0];\r\n    const headerPesquisa = document.getElementById(\"pesquisa-cargo-hotsite\");\r\n\r\n    if (filtrosVagas && headerPesquisa) {\r\n      if (window.innerWidth > 1000) {\r\n        document.body.style.paddingTop =\r\n          tamanhoHeaderAtual + headerPesquisa.clientHeight + 70 + `px`;\r\n\r\n        filtrosVagas.style.zIndex = \"985\";\r\n\r\n        filtrosVagas.classList.add(\"transicao-colapso-cabecalho\");\r\n        headerPesquisa.classList.add(\"transicao-colapso-cabecalho\");\r\n\r\n        const controladorHeaderColapsavel = document.getElementById(\r\n          \"TermoBuscaVagaTexto\"\r\n        );\r\n\r\n        const callbackHeaderColpsavel = (chave) => {\r\n          let tamanhoHeaderNovo = calcularTamanhoHeader();\r\n\r\n          if (chave && window.innerWidth > 1000) {\r\n            filtrosVagas.style.top =\r\n              tamanhoHeaderNovo + headerPesquisa.offsetHeight + \"px\";\r\n            headerPesquisa.style.top = tamanhoHeaderNovo + \"px\";\r\n            return;\r\n          }\r\n\r\n          filtrosVagas.style.zIndex = 985;\r\n\r\n          headerPesquisa.style.top =\r\n            tamanhoHeaderNovo - headerPesquisa.offsetHeight + \"px\";\r\n\r\n          filtrosVagas.style.top = tamanhoHeaderNovo + \"px\";\r\n        };\r\n\r\n        const observer = new IntersectionObserver(\r\n          (entries) => {\r\n            entries.forEach((entry) => {\r\n              if (entry.isIntersecting) {\r\n                if (entry.boundingClientRect.y < entry.rootBounds.y) {\r\n                  //Elemento está acima do observador\r\n                  callbackHeaderColpsavel(false);\r\n                } else {\r\n                  //Elemento está abaixo do observador\r\n                  callbackHeaderColpsavel(true);\r\n                }\r\n              } else {\r\n                // Elemento de destino não está visível\r\n                callbackHeaderColpsavel(false);\r\n              }\r\n            });\r\n          },\r\n          { root: null, threshold: 1, rootMargin: `10px` }\r\n        );\r\n\r\n        observer.observe(controladorHeaderColapsavel);\r\n\r\n        return observer;\r\n      } else {\r\n        document.body.style.paddingTop =\r\n          tamanhoHeaderAtual + headerPesquisa.clientHeight + 70 + `px`;\r\n        filtrosVagas.style.top = tamanhoHeaderAtual + \"px\";\r\n      }\r\n    }\r\n    return null;\r\n  },\r\n  AjustarHeadeQuestionario() {\r\n    const headerQuestionario = document.querySelector(\".header-questionario\");\r\n\r\n    if (headerQuestionario) {\r\n      const headersEmpregare = document.querySelectorAll(\".header-empregare\");\r\n\r\n      if (headersEmpregare && headersEmpregare.length > 0) {\r\n        headersEmpregare.forEach((header) => {\r\n          header.classList.add(\"d-none\");\r\n        });\r\n      }\r\n    }\r\n  },\r\n  Main() {\r\n    let tamanhoHeaderAtual = 0;\r\n\r\n    this.PainelCandidato();\r\n    this.AjustarHeadeQuestionario();\r\n\r\n    const CustomizarLayoutVagasHotsite = () => {\r\n      tamanhoHeaderAtual = calcularTamanhoHeader();\r\n\r\n      this.DetalhesVaga(tamanhoHeaderAtual);\r\n\r\n      document.querySelector(\"body\").style.paddingTop =\r\n        tamanhoHeaderAtual + \"px\";\r\n\r\n      return this.Vagas(tamanhoHeaderAtual);\r\n    };\r\n\r\n    let observerInstancia = CustomizarLayoutVagasHotsite();\r\n\r\n    window.addEventListener(\"resize\", () => {\r\n      if (observerInstancia != null) {\r\n        observerInstancia.disconnect();\r\n      }\r\n      observerInstancia = CustomizarLayoutVagasHotsite();\r\n    });\r\n  },\r\n  Init() {\r\n    const hotsite = document.getElementById(\"layout-hotsite\");\r\n\r\n    if (hotsite) {\r\n      this.AjustarPaginasQuandoLogar();\r\n      this.Main();\r\n      this.Internacionalizacao();\r\n    }\r\n  },\r\n};\r\n\r\nhotsite.Init();\r\n"],"names":["calcularTamanhoHeader","tamanhoHeaderAtual","headerQuestionario","document","querySelector","offsetHeight","headers","querySelectorAll","length","forEach","header","Internacionalizacao","selectCultures","culturaSelecionada","getElementsByClassName","botaoCultura","innerHTML","CULTURE_EMPREGARE","selectCulture","onclick","e","dropdown","culture","target","getAttribute","window","location","href","replace","AjustarPaginasQuandoLogar","addEventListener","navBarFiltros","filtrosVagas","headerPesquisa","style","top","paddingTop","this","DetalhesVaga","PainelCandidato","barraPainelMobile","styleElement","createElement","textContent","appendChild","barraDetalheVaga","getElementById","Vagas","innerWidth","body","clientHeight","zIndex","classList","add","controladorHeaderColapsavel","callbackHeaderColpsavel","chave","tamanhoHeaderNovo","observer","IntersectionObserver","entries","entry","isIntersecting","boundingClientRect","y","rootBounds","root","threshold","rootMargin","observe","AjustarHeadeQuestionario","headersEmpregare","Main","CustomizarLayoutVagasHotsite","observerInstancia","disconnect","Init"],"sourceRoot":""}