PageSourceSearch

https://ooni.com/cdn/shop/t/621/assets/__vite-header.Cq3X3M0s.js

js ooni.com collected 2026-09-24 09:06:22 UTC 3,328 bytes, 1 lines download raw bytes

1import{c as l,d as a,u as i}from"./__vite-utils.bEHj0ca_.js";import"./__vite-currency.CSCTdhpv.js";class d{constructor(e,t,s){var r;this.hasTransparentHeader=t,this.lastScrollY=window.scrollY,this.element=document.querySelector(e),this.throttledCallback=l(this.onScroll.bind(this),s),this.headerElement=((r=this.element)==null?void 0:r.closest("header"))||null,this.scrollAmount=120,this.element&&(window.addEventListener("scroll",this.throttledCallback,{passive:!0}),window.addEventListener("scrollend",()=>{this.onScroll(!0)}),window.addEventListener("mobileMenuOpened",()=>{var n;window.scrollY>this.scrollAmount&&((n=this.headerElement)==null||n.classList.add("header__fixed"))},{passive:!0}),window.addEventListener("mobileMenuClosed",()=>{var n;(n=this.headerElement)==null||n.classList.remove("header__fixed")},{passive:!0}))}onScroll(e=!0){if(this.element&&this.hasTransparentHeader){const t=window.scrollY;t<=this.scrollAmount?this.element.classList.remove("scrolling-up","scrolling-down"):t>this.lastScrollY+(e?0:12)?(this.element.classList.remove("scrolling-up"),this.element.classList.add("scrolling-down")):this.lastScrollY>t+(e?0:12)&&(this.element.classList.remove("scrolling-down"),this.element.classList.add("scrolling-up")),this.lastScrollY=t}}}class c extends HTMLElement{constructor(){super(),this.transparentHeader=!1,this.debouncedUpdateHeaderHeight=a(()=>{i()},100),this.transparentHeader=this.getAttribute("setting-transparent-header")==="true"}connectedCallback(){this.cacheDomElements(),this.setupMobileMenu(),this.setupMobileSearch(),this.moveNonStickyQuickLinks(),new d(".header__wrapper",this.transparentHeader,25),window.addEventListener("scroll",this.debouncedUpdateHeaderHeight,{passive:!0})}disconnectedCallback(){window.removeEventListener("scroll",this.debouncedUpdateHeaderHeight)}cacheDomElements(){this.menuButton=this.querySelector('[js-header="hamburger"]'),this.headerInner=this.querySelector(".header__inner"),(!this.menuButton||!this.headerInner)&&console.error("One or more critical elements are missing in the header component")}setupMobileSearch(){const e=this.querySelector("uwp-drawer[modal-name='search-drawer']"),t=this.querySelectorAll('[js-header="mobile-search-toggle"]');!e||t.length===0||t.forEach(s=>{const r=s.getAttribute("js-search-input");s.addEventListener("click",()=>{r==="open"?(i(),e.showDrawer(),window.dispatchEvent(new CustomEvent("mobileSearchOpened"))):(e.hideDrawer(),window.dispatchEvent(new CustomEvent("mobileSearchClosed")))})})}setupMobileMenu(){const e=this.querySelector("uwp-drawer[modal-name='mobile-menu']");!e||!this.menuButton||(this.menuButton.addEventListener("click",()=>{if(!this.menuButton)return;if(this.menuButton.classList.contains("is-open")){this.menuButton.classList.remove("is-open"),e==null||e.hideDrawer();const s=new CustomEvent("mobileMenuClosed");window.dispatchEvent(s);return}i();const t=new CustomEvent("mobileMenuOpened");window.dispatchEvent(t),this.menuButton.classList.add("is-open"),e==null||e.showDrawer()}),document.addEventListener("modal:closed:mobile-menu",()=>{this.menuButton&&this.menuButton.classList.remove("is-open")}))}moveNonStickyQuickLinks(){const e=this.closest("header");if(!e)return;const t=e.querySelector(".quick-links-banner--non-sticky");t&&(e.after(t),i())}}customElements.define("uwp-header",c);

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.