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Ac,CACxBpC,KAAM,EACNqC,WAAY,EACZC,cAAe,EACfC,OAAQ,EACRC,cAAe,GAGNC,EAAS,CAClB,gBAAM1C,CAAW2C,EAAaC,EAAOC,GAAe,GAChD,MAAMC,EAAY5C,SAASQ,eAAeiC,GAE1C,GAAKG,EAKL,IACI,MAAMJ,QAAeK,KAAKC,cAAcJ,GACxCK,QAAQC,IAAI,SAAUR,GAClBA,EAAOS,SAAWT,GAClBK,KAAKK,gBAAgBN,EAAWJ,EAAQE,EAAOC,EAIvD,CAAE,MAAOQ,GACLJ,QAAQI,MAAM,2BAA4BA,EAE9C,MAfIJ,QAAQI,MAAM,2FAgBtB,EAEA,mBAAML,CAAcJ,GAChB,IACI,MAAMU,QAAiBC,MAAM,yBAAyBX,IAAS,CAC3DY,OAAQ,MACRC,QAAS,CACL,eAAgB,sBAIxB,aAAaH,EAASI,MAC1B,CAAE,MAAOL,GAEL,OADAJ,QAAQI,MAAM,yBAA0BA,GACjC,CAAEF,SAAS,EACtB,CACJ,EAEA,eAAAC,CAAgBN,EAAWJ,EAAQE,EAAOC,GACtC,MASMc,EAAO,wHATkCjB,EAAOkB,YAAYhB,sCAYHF,EAAOkB,+BACtDf,EAAe,SAAW,yOAG0BH,EAAOmB,mKAEbnB,EAAOoB,mDAC7CpB,EAAOqB,mJAM/BjB,EAAUkB,UAAYL,EAStB,MAAMM,EAAcnB,EAAUlC,cAAc,KACxCqD,IACAA,EAAYC,MAAMC,WAAa,2BAE/BF,EAAY3D,iBAAiB,aAAa,KACtC2D,EAAYC,MAAME,QAAU,KAAK,IAGrCH,EAAY3D,iBAAiB,YAAY,KACrC2D,EAAYC,MAAME,QAAU,GAAG,IAG3C,E","sources":["webpack://configuracao/./js/home.js","webpack://configuracao/./js/utilidades/banner.js"],"sourcesContent":["import Splide from '@splidejs/splide';\r\nimport { localBanner, banner } from './utilidades/banner'\r\n// import { elementoFlutuante } from './utilidades/elementoFlutuante';\r\n\r\n\r\nconst homeApp = function () {\r\n\r\n const _ativaInput = () => {\r\n const iconesInput = document.querySelectorAll('.icone-input-pesquisa').forEach(icone => {\r\n icone.addEventListener(\"click\", () => {\r\n icone.nextElementSibling.focus();\r\n })\r\n })\r\n }\r\n\r\n\r\n\r\n const _headerScroll = () => {\r\n const headerCandidato = document.getElementById('header-candidato');\r\n const sectionBannerHome = document.querySelector('.section-banner-home h1');\r\n\r\n // headerCandidato.classList.remove('sticky-top');\r\n headerCandidato.classList.remove('bg-white');\r\n\r\n function callback(entries) {\r\n entries.forEach((entry) => {\r\n if (entry.isIntersecting) {\r\n headerCandidato.classList.add('header-candidato-customizado');\r\n headerCandidato.classList.remove('bg-white');\r\n } else {\r\n headerCandidato.classList.add('bg-white');\r\n headerCandidato.classList.remove('header-candidato-customizado');\r\n }\r\n })\r\n }\r\n\r\n const observer = new IntersectionObserver(callback, { root: null, threshold: .9, rootMargin: '-70px' });\r\n observer.observe(sectionBannerHome);\r\n }\r\n\r\n\r\n\r\n const _init = function () {\r\n banner.renderizar('banner-home', localBanner.HOME, true);\r\n _ativaInput();\r\n _headerScroll();\r\n //elementoFlutuante('.elemento-parallax', 1);\r\n\r\n const splideOptionsVagas = {\r\n type: 'loop',\r\n pagination: false,\r\n gap: '2em',\r\n width: '100%',\r\n perPage: 4,\r\n lazyLoad: 'nearby',\r\n padding: '5em',\r\n breakpoints: {\r\n 1199: {\r\n perPage: 3,\r\n },\r\n 992: {\r\n perPage: 2,\r\n },\r\n 767: {\r\n arrows: false,\r\n perPage: 1,\r\n padding: '7em',\r\n },\r\n 425: {\r\n padding: '2em',\r\n }\r\n }\r\n }\r\n\r\n const splideVagas = new Splide('#splide-cards-oportunidades', splideOptionsVagas);\r\n splideVagas.mount();\r\n\r\n new Splide('.splide-parceiros', {\r\n type: 'loop',\r\n arrows: false,\r\n pagination: false,\r\n gap: '2em',\r\n width: '100%',\r\n autoWidth: true,\r\n breakpoints: {\r\n 2560: {\r\n destroy: true,\r\n },\r\n 992: {\r\n destroy: false,\r\n padding: '2em',\r\n perPage: 1,\r\n }\r\n }\r\n }).mount();\r\n\r\n new Splide('.splide-nectar', {\r\n type: 'loop',\r\n arrows: false,\r\n pagination: false,\r\n gap: '1em',\r\n width: '100%',\r\n breakpoints: {\r\n //2560: {\r\n // destroy: true,\r\n //},\r\n 1199: {\r\n perPage: 3,\r\n },\r\n 768: {\r\n destroy: false,\r\n padding: '2em',\r\n perPage: 2,\r\n },\r\n 576: {\r\n perPage: 1,\r\n }\r\n }\r\n }).mount();\r\n }\r\n\r\n return _init();\r\n\r\n}\r\nhomeApp();\r\n\r\n//new Splide('#splide-cards-oportunidades', {\r\n// type: 'loop',\r\n// pagination: false,\r\n// gap: '2em',\r\n// width: '100%',\r\n// perPage: 4,\r\n// padding: '5em',\r\n// breakpoints: {\r\n// 1024: {\r\n// perPage: 3,\r\n// },\r\n// 768: {\r\n// perPage: 2,\r\n// },\r\n// 425: {\r\n// arrows: false,\r\n// perPage: 1,\r\n// }\r\n// }\r\n\r\n//}).mount();\r\n\r\n//new Splide('.splide-parceiros', {\r\n// type: 'loop',\r\n// arrows: false,\r\n// pagination: false,\r\n// gap: '2em',\r\n// width: '100%',\r\n// autoWidth: true,\r\n// breakpoints: {\r\n// 2560: {\r\n// destroy: true,\r\n// },\r\n// 425: {\r\n// padding: '5em',\r\n// perPage: 1,\r\n// destroy: false,\r\n// }\r\n// }\r\n//}).mount();\r\n\r\n//new Splide('.splide-nectar', {\r\n// type: 'loop',\r\n// arrows: false,\r\n// pagination: false,\r\n// gap: '1em',\r\n// width: '100%',\r\n// breakpoints: {\r\n// 2560: {\r\n// destroy: true,\r\n// },\r\n// 768: {\r\n// destroy: false,\r\n// padding: '2em',\r\n// perPage: 2,\r\n// },\r\n// 576: {\r\n// perPage: 1,\r\n// }\r\n// }\r\n//}).mount();\r\n","export const localBanner = {\r\n HOME: 1,\r\n VAGA_BUSCA: 2,\r\n VAGA_DETALHES: 3,\r\n PAINEL: 4,\r\n EMPLOYER_PAGE: 5,\r\n};\r\n\r\nexport const banner = {\r\n async renderizar(containerId, local, exibirMobile = true) {\r\n const container = document.getElementById(containerId);\r\n\r\n if (!container) {\r\n console.error('[banner]: não foi encontrado nenhuma div com o id especificado para renderizar o banner!');\r\n return;\r\n }\r\n\r\n try {\r\n const banner = await this._buscarBanner(local);\r\n console.log('banner', banner)\r\n if (banner.sucesso && banner) {\r\n this._renderizarHTML(container, banner, local, exibirMobile);\r\n } else {\r\n // this._renderizarBannerPadrao(container);\r\n }\r\n } catch (error) {\r\n console.error('Erro ao carregar banner:', error);\r\n // this._renderizarBannerPadrao(container);\r\n }\r\n },\r\n\r\n async _buscarBanner(local) {\r\n try {\r\n const response = await fetch(`/Home/GetBanner?local=${local}`, {\r\n method: 'GET',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n });\r\n\r\n return await response.json();\r\n } catch (error) {\r\n console.error('Erro ao buscar banner:', error);\r\n return { sucesso: false };\r\n }\r\n },\r\n\r\n _renderizarHTML(container, banner, local, exibirMobile) {\r\n const redirectUrl = `/Home/RedirectBanner?id=${banner.ID}&local=${local}`;\r\n\r\n //const botaoFecharHTML = botaoFechar\r\n // ? `\r\n // <button class=\"btn-close position-absolute top-0 end-0 m-2\" aria-label=\"Fechar\" \r\n // style=\"background-color: rgba(0,0,0,0.5); color: white;\">\r\n // </button>`\r\n // : '';\r\n\r\n const html = `\r\n <div class=\"banner-wrapper position-relative\">\r\n \r\n <a href=\"${redirectUrl}\" target=\"_blank\" data-banner-id=\"${banner.ID}\" \r\n class=\"${exibirMobile ? `d-flex` : `d-none d-md-flex`} justify-content-center\">\r\n <picture class=\"col-12 text-center\">\r\n <source media=\"(max-width: 767px)\" \r\n srcset=\"https://storage.empregare.com/banners/${banner.ArquivoMobile}\" \r\n class=\"img-fluid style=\"border-radius: 3px;\">\r\n <img src=\"https://storage.empregare.com/banners/${banner.ArquivoDesktop}\" \r\n alt=\"${banner.Titulo}\" \r\n class=\"img-fluid\" style=\"border-radius: 3px;\"/>\r\n </picture>\r\n </a>\r\n </div>`;\r\n\r\n container.innerHTML = html;\r\n\r\n //const botaoFecharElemento = container.querySelector('.btn-close');\r\n //if (botaoFecharElemento) {\r\n // botaoFecharElemento.addEventListener('click', () => {\r\n // this.ocultarBanner(banner.ID);\r\n // });\r\n //}\r\n\r\n const linkElement = container.querySelector('a');\r\n if (linkElement) {\r\n linkElement.style.transition = 'opacity 0.3s ease-in-out';\r\n\r\n linkElement.addEventListener('mouseover', () => {\r\n linkElement.style.opacity = '0.8';\r\n });\r\n\r\n linkElement.addEventListener('mouseout', () => {\r\n linkElement.style.opacity = '1';\r\n });\r\n }\r\n },\r\n\r\n //async ocultarBanner(bannerID) {\r\n // try {\r\n // const response = await fetch('/Company/Banner/OcultarBanner', {\r\n // method: 'POST',\r\n // headers: {\r\n // 'Content-Type': 'application/json',\r\n // },\r\n // body: JSON.stringify({ bannerID: bannerID }),\r\n // });\r\n\r\n // const result = await response.json();\r\n\r\n // if (result.sucesso) {\r\n // const bannerElement = document.querySelector(`[data-banner-id=\"${bannerID}\"]`);\r\n // if (bannerElement) {\r\n // bannerElement.closest('.banner-wrapper').remove();\r\n // }\r\n // }\r\n // } catch (error) {\r\n // console.error('Erro ao ocultar banner:', error);\r\n // }\r\n //},\r\n\r\n //_renderizarBannerPadrao(container) {\r\n // const html = `\r\n // <div class=\"banner-container\">\r\n // <a href=\"#\" target=\"_blank\">\r\n // <img src=\"https://www.empregare.com/assetsV2/common/images/global/logo.png\" \r\n // alt=\"Banner Estático\" />\r\n // </a>\r\n // </div>\r\n // `;\r\n //\r\n // container.innerHTML = html;\r\n //}\r\n};\r\n\r\n"],"names":["renderizar","HOME","document","querySelectorAll","forEach","icone","addEventListener","nextElementSibling","focus","headerCandidato","getElementById","sectionBannerHome","querySelector","classList","remove","IntersectionObserver","entries","entry","isIntersecting","add","root","threshold","rootMargin","observe","_headerScroll","type","pagination","gap","width","perPage","lazyLoad","padding","breakpoints","arrows","mount","autoWidth","destroy","localBanner","VAGA_BUSCA","VAGA_DETALHES","PAINEL","EMPLOYER_PAGE","banner","containerId","local","exibirMobile","container","this","_buscarBanner","console","log","sucesso","_renderizarHTML","error","response","fetch","method","headers","json","html","ID","ArquivoMobile","ArquivoDesktop","Titulo","innerHTML","linkElement","style","transition","opacity"],"sourceRoot":""}