const updatepageContent = function () { if (window.location.pathname.includes("/partners/walmart")) { const garfieldModule = document.getElementById("garfieldModule"); garfieldModule.style.display = "flex"; } else if (window.location.pathname.includes("/partners/provident")) { const e = document.getElementById("providentImage"); e && (e.style.display = "inline-block"); document.querySelectorAll("[data-hiddenFooterText]").forEach((e) => { e && (e.style.display = "none"); }); } }; const setPartnerImage = function () { if (!window.location.search) return; const e = document.getElementById("dynamicPartnerImage"); if (!e) return; const t = [ { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=Venbrook", "utm_campaign=Venbrook_portal", "c=VenbrookCA1", ], src: "https://uploads-ssl.webflow.com/6011ced336f3c77caf0e1dad/6553a75e51e023e299098479_venbrook%201%20(2).svg", }, { hrefIncludes: "/partners/member-benefits", searchIncludes: [ "utm_source=AAPP", "utm_campaign=AAPP_web", "c=AAPP10", ], src: "https://uploads-ssl.webflow.com/6011ced336f3c77caf0e1dad/656e30ffa35d0a697905ce18_Frame%2011.png", }, { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=Berkeley", "utm_campaign=Berkeley_portal", "c=BerkeleyCNJ10", ], src: "https://uploads-ssl.webflow.com/6011ced336f3c77caf0e1dad/65c245479dd46c5bf3bd7cf6_YourPotential_172e81RGB.png", }, { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=Fringe", "utm_campaign=Fringe_portal", "c=FringePP10", ], src: "https://uploads-ssl.webflow.com/6011ced336f3c77caf0e1dad/664270c79f2caf6d79744940_fringe-new-logo_r81rpa.png", }, { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=BFASemployees", "utm_campaign=BFASemployees_portal", "c=BFASemployees10", ], src: "https://uploads-ssl.webflow.com/6011ced336f3c77caf0e1dad/664b920fb6c09665c3489acc_BF_Primary_Logo_Orange_2021.png", }, { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=Brokerlinkemployees", "utm_campaign=Brokerlinkemployees_portal", "c=Brokerlinkemployees10", ], src: "https://cdn.prod.website-files.com/6011ced336f3c77caf0e1dad/66e8674b124ca28608164e11_66c38d1fe30a4aab3c0244fd_62d597fcdf43a758152c13e4_brokerlink-logo.png", }, { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=Enverus", "utm_campaign=Enverus_portal", "c=Enverus10", ], src: "https://cdn.prod.website-files.com/6011ced336f3c77caf0e1dad/6716bd51847d362d43b42065_EnverusLogo%20(2)%201%20(1).png", }, { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=BPHC", "utm_campaign=BPHC_portal", "c=BPHC10", ], src: "https://cdn.prod.website-files.com/6011ced336f3c77caf0e1dad/67224e03e537cc06b0da075c_Frame%2023%20(3).png", }, { hrefIncludes: "/partners/employee-benefits", searchIncludes: [ "utm_source=ASAhq", "utm_campaign=ASAhq_portal", "c=USIAffinity", ], src: "https://cdn.prod.website-files.com/6011ced336f3c77caf0e1dad/68dfe469d61b1419f58e1073_ASA%20Insurance_USI_Logo%20Horizontal_RGB%20(1).png", }, ], { href: n, search: c } = window.location; for (let a of t) if ( n.includes(a.hrefIncludes) && a.searchIncludes.every((e) => c.includes(e)) ) { (e.src = a.src), e.classList.remove("w-dyn-bind-empty", "w-dyn-hide", "w-condition-invisible"), e.style.setProperty("display", "inline-block", "important"); break; } }; const setButton = (link) => { document.querySelectorAll("[data-partners]").forEach(function (e) { if (!e) return; e.href = link; }); }; const checkPartnersSession = function () { const partnerAttribute = document.getElementById("partner-append").dataset.append; if (partnerAttribute != "full" && partnerAttribute != "partial") return; const pathAttribute = document.getElementById("partner-append").dataset.path; const cCodeAttribute = document.getElementById("partner-append").dataset.ccode; const pCodeAttribute = document.getElementById("partner-append").dataset.pcode; const activeCCode = cCodeAttribute.length != 0; const activePCode = pCodeAttribute.length != 0; const domain = window.location.hostname; const storedParams = sessionStorage.getItem("searchData"); let appendParams; if (activeCCode && activePCode) { appendParams = `c=${cCodeAttribute}&p=${pCodeAttribute}`; } else { appendParams = activeCCode ? `c=${cCodeAttribute}` : `p=${pCodeAttribute}`; } if (!storedParams) { return setButton(`https://${domain}/${pathAttribute}?${appendParams}`); } const searchParams = new URLSearchParams(storedParams); if (partnerAttribute === "full") { if (activeCCode) { searchParams.set("c", cCodeAttribute); } if (activePCode) { searchParams.set("p", pCodeAttribute); } return setButton(`https://${domain}/${pathAttribute}?${searchParams}`); } else { const cCode = searchParams.get("c"); const pCode = searchParams.get("p"); if (cCode && pCode) { return setButton(`https://${domain}/${pathAttribute}?${searchParams}`); } else if (cCode && !pCode) { if (activePCode) { searchParams.set("p", pCodeAttribute); } return setButton(`https://${domain}/${pathAttribute}?${searchParams}`); } else if (pCode) { if (activeCCode) { searchParams.set("c", cCodeAttribute); } return setButton(`https://${domain}/${pathAttribute}?${searchParams}`); } else { if (activeCCode) { searchParams.set("c", cCodeAttribute); } if (activePCode) { searchParams.set("p", pCodeAttribute); } return setButton(`https://${domain}/${pathAttribute}?${searchParams}`); } } }; const checkPartnersNumber = function () { const empCookie = getCookie("emp-benefit-visitor"); if ( document .getElementById("partner-append") .getAttribute("employee-benefit") == "yes" && empCookie ) return; else { let footerPhone = document.getElementById("partner-append").dataset.footerphone; let navPhone = document.getElementById("partner-append").dataset.navphone; let linkPhone = document.getElementById("partner-append").dataset.linkphone; let phoneNumberElementsNavLinks = document.querySelectorAll( "[data-number-nav-link]" ); let phoneNumberElementsNavText = document.querySelectorAll( "[data-number-nav-text]" ); let phoneNumberElementsFooter = document.querySelectorAll( "[data-number-footer]" ); phoneNumberElementsNavLinks.forEach((element) => { element.setAttribute("href", linkPhone); console.log(`nav link: ${linkPhone}`); }); phoneNumberElementsNavText.forEach((element) => { element.textContent = navPhone; console.log(`nav text: ${navPhone}`); }); phoneNumberElementsFooter.forEach((element) => { element.textContent = footerPhone; element.setAttribute("href", linkPhone); console.log(`footer text ${footerPhone} and link: ${linkPhone}`); }); } }; const setBannerText = () => { if ( window.location.pathname === "/partners/aarp" && window.location.search === "?utm_source=aarp&utm_medium=partnership&utm_campaign=AARP_JAN_LTO&c=AARPbulletin&p=AARP" ) { const bannerText = document.getElementById("bannerText"); bannerText.textContent = "Limited-time offer: Get a quote and Fetch will donate $10 to a life-saving shelter on your behalf"; } }; updatepageContent(); setPartnerImage(); checkPartnersSession(); checkPartnersNumber(); setBannerText();