PageSourceSearch

https://www.timeout.com/static/js/masthead-dde8b97dcd48f624c172.js

js timeout.com collected 2026-09-24 06:43:23 UTC 6,748 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_gp_web_frontend=self.webpackChunk_gp_web_frontend||[]).push([["masthead"],{
1"./src/ts/components/masthead/masthead.ts":(e,t,o)=>{o.r(t),o.d(t,{clearInput:()=>r,hideMasthead:()=>l,init:()=>h,mastheadComponent:()=>y,showMasthead:()=>d,updateHeaderLogo:()=>u});var a=o("../react-components/dist/components/global/header/header.css.json");const c=JSON.parse('{"IB":"_headerScrolled_15glu_148"}'),n=JSON.parse('{"IB":"_headerScrolled_1thw9_188"}');var s=o("../shared-types/frontend/core/store.ts");const i=()=>{const e=document.querySelector('[data-testid="city-selector-list_testID"]')||document.querySelector('[class*="listContainer"]'),t=document.querySelector(".masthead-header");if(e&&t){const o=t.getBoundingClientRect().bottom;e.style.top=o-43+"px"}},r=(e,t)=>t.id===e||(t.checked=!1,!1),l=(e,t)=>{const o=null==t?void 0:t.querySelector("input#checkbox-city-selector");o&&o.checked&&document.body.classList.remove("city-selector-open"),u(e,!0)},d=(e,t)=>{const o=null==t?void 0:t.querySelector("input#checkbox-city-selector");o&&o.checked&&document.body.classList.add("city-selector-open"),u(e,!1)},u=(e,t=!1)=>{e.classList.toggle(c.IB,t),e.classList.toggle(n.IB,t)},y=e=>{const t={manageMastheadScrollBehaviour:()=>{const t=e.querySelector(".js-header-navigation");let o=window.scrollY,a=!1;const c=[];let n=0;return()=>{const s=window.scrollY;c.push(s),c.length>5&&c.shift();let r=0;if(c.length>=3){const e=c.slice(-3),[t]=e;r=e[e.length-1]-t}Math.abs(r)>20&&(a=r<0),Math.abs(s-o)>=300&&(a?d(e,t):l(e,t),o=s);const u=0===s;e.classList.toggle("at-top",u),e.classList.toggle("not-at-top",!u);const y=document.querySelector("input#checkbox-city-selector");if(null==y?void 0:y.checked){const e=Date.now();e-n>50&&(i(),n=e)}}},initialize:()=>{const o=Array.from(document.querySelectorAll('input[name="masthead-dropdowns"]')),c=document.querySelector("input#checkbox-city-selector");c&&o.push(c);const n=Array.from(document.querySelectorAll('label[for="checkbox-city-selector"]')),r=null===document||void 0===document?void 0:document.querySelector(".js-open-navigation-toggle"),l={};for(const e of n){const t=e.getAttribute("for"),a=e=>{const a=o.find((e=>e.id===t));a&&((e.target.matches("label")?e.target:e.target.closest("label")).classList.toggle("chevron-selected",!a.checked),"checkbox-city-selector"===a.id?a.checked?(document.body.classList.add("city-selector-open"),setTimeout((()=>{i()}),0),setTimeout((()=>{a.checked=!1,document.body.classList.remove("city-selector-open")}))):document.body.classList.remove("city-selector-open"):a.checked&&setTimeout((()=>{a.checked=!1})))};l[t]=a,e.addEventListener("click",a)}const d=document.querySelector("input#checkbox-city-selector");if(d){const e=()=>{d.checked?(document.body.setAttribute("data-city-selector-open","true"),setTimeout((()=>{i()}),0)):document.body.removeAttribute("data-city-selector-open")};d.addEventListener("change",e),l["city-selector-direct"]=e}const u=t.manageMastheadScrollBehaviour();null==r||r.addEventListener("click",(()=>{var e;null===(e=document.querySelector(`.${a.sg}`))||void 0===e||e.classList.add(a.o9)}));try{if("undefined"!=typeof window&&"ResizeObserver"in window){const{ResizeObserver:e}=window,t=document.querySelector(`.${a.sg}`);if(t){const o=new e((()=>{const e=document.querySelector("input#checkbox-city-selector");(null==e?void 0:e.checked)&&i()}));o.observe(t)}const o=document.querySelector(".masthead-header");if(o){const t=new e((()=>{const e=document.querySelector("input#checkbox-city-selector");(null==e?void 0:e.checked)&&i()}));t.observe(o)}}}catch(e){}window.addEventListener("scroll",u),u();const y=document.querySelector("[data-navigation-toggle]");if(y){const t=()=>{y.checked?e.classList.add("nav-drawer-open"):e.classList.remove("nav-drawer-open")};y.addEventListener("change",t),l["navigation-toggle"]=t}const h=e=>{var t,o,a;const c=e.target,n=null==c?void 0:c.closest("a[data-data-layer]");if(!n)return;if(n.closest('[data-testid="city-selector-list_testID"]'))return;const i=n.getAttribute("data-data-layer");if(i)try{const e=JSON.parse(i),c=(null==e?void 0:e.payload)||{},r=null===(t=n.textContent)||void 0===t?void 0:t.trim(),l=n.closest('[data-testid="navigation-drawer_testID"]'),d=n.getAttribute("data-nav-origin")||(l?"drawer":"desktop"),u={...c,event:"drawer"===d?"navigation_drawer_click":"navigation_menu_click",nav_link:r,nav_origin:d};null===(a=null===(o=window.gpStore)||void 0===o?void 0:o.dispatch)||void 0===a||a.call(o,{type:s.Us.DataLayerPush,payload:u})}catch(e){console.warn("Failed to handle navigation click data-data-layer",e)}};e.addEventListener("click",h),l["header-navigation-click"]=h;const v=document.querySelector('[data-testid="city-selector-list_testID"]');if(v){const e=e=>{var t,o,a,c,n;const i=e.target,r=null==i?void 0:i.closest("a[data-data-layer]");if(!r)return;const l=r.getAttribute("data-data-layer");if(l)try{const e=JSON.parse(l),i=(null==e?void 0:e.payload)||{},d=null===(t=r.textContent)||void 0===t?void 0:t.trim(),u=r.getAttribute("href")||"",y=r.getAttribute("data-link-type"),h=u.includes("time-out-market");if("language"===y){const e={...i,event:"navigation_language_select",nav_language:d};return void(null===(a=null===(o=window.gpStore)||void 0===o?void 0:o.dispatch)||void 0===a||a.call(o,{type:s.Us.DataLayerPush,payload:e}))}const v={...i,event:h?"navigation_market_select":"navigation_city_select",city_type:h?"market":"city",...h?{market_link:d}:{city_link:d}};null===(n=null===(c=window.gpStore)||void 0===c?void 0:c.dispatch)||void 0===n||n.call(c,{type:s.Us.DataLayerPush,payload:v})}catch(e){console.warn("Failed to handle city/language selector data-data-layer",e)}};v.addEventListener("click",e),l["city-selector-click"]=e}const g=t=>{var o,a,c;const n=t.target;if((null===(o=null==n?void 0:n.matches)||void 0===o?void 0:o.call(n,'form[role="search"]'))&&e.contains(n))try{const e=new FormData(n).get("q"),t=n.closest('[data-testid="navigation-drawer_testID"]');null===(c=null===(a=window.gpStore)||void 0===a?void 0:a.dispatch)||void 0===c||c.call(a,{type:s.Us.DataLayerPush,payload:{event:"navigation_search_submit",nav_origin:t?"drawer":"desktop",search_term:(null==e?void 0:e.trim())||""}})}catch(e){console.warn("Failed to handle search submit GTM tracking",e)}};return e.addEventListener("submit",g),l["search-submit"]=g,l},bindEvents:()=>t.initialize()};return t},h=e=>{const t=Math.floor(1e4*Math.random());return{listeners:y(e).bindEvents(),componentId:`masthead-${t}`}}},
1"../react-components/dist/components/global/header/header.css.json":e=>{e.exports=JSON.parse('{"sg":"_adsContainer_ytkyz_18","CA":"_sticky_ytkyz_23","iM":"_slideUp_ytkyz_28","o9":"_adsContainerRelative_ytkyz_33","Jy":"_adsContainerLoading_ytkyz_51"}')}
1}]);

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.