PageSourceSearch

https://www.hungryhorse.co.uk/dist/gk-jss-app/js/BackToTop.410dcd93.js

js hungryhorse.co.uk collected 2026-09-25 23:56:02 UTC 2,538 bytes, 2 lines download raw bytes

1"use strict";(globalThis["webpackChunkgk_jss_app"]=globalThis["webpackChunkgk_jss_app"]||[]).push([[7570],{7623:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});var o=n(20641),l=n(90033),i=n(53751),s=n(50953),r=n(20002);const u=["aria-label"],a=32,c=16,d=8,v=3,p=(0,o.pM)({__name:"BackToTop",setup(e){const{isMedia:t}=(0,r.A)("(min-width: 768px)"),{isMedia:n}=(0,r.A)("(min-width: 1024px)");let p=0,b=!0;const m=(0,s.KR)(!1),w=(0,s.KR)(!1),g=(0,s.KR)(!1),h=(0,o.EW)((()=>m.value&&(w.value||g.value))),k=(0,s.KR)(null),f=(0,s.KR)(null);let y=null,C=null,E=null,R=!1,_=null,x=!1;const K=()=>{k.value?.focus()},L=()=>{const e=getComputedStyle(document.documentElement),n=Number.parseFloat(e.getPropertyValue("--sticky-booking-block-height"))||0;return(t.value?0:n)+c},M=()=>{b=window.scrollY>p,!b&&window.scrollY>2*screen.height&&(w.value=!0),(b||window.scrollY<2*screen.height)&&(w.value=!1),p=window.scrollY},Y=()=>{m.value=document.documentElement.scrollHeight-window.innerHeight>2*screen.height},A=()=>{if(!R||!y||!f.value||!m.value)return g.value=!1,void f.value?.style.removeProperty("--back-button-sticky-offset");const e=L(),t=y.getBoundingClientRect(),o=window.innerHeight-e-a/2;if(g.value=t.top<=o,C){const t=C.getBoundingClientRect().top,o=window.innerHeight-e-a,l=o-t-d;if(l>0){const e=n.value?Math.min(l,v):l;f.value.style.setProperty("--back-button-sticky-offset",`${e}px`)}else f.value.style.removeProperty("--back-button-sticky-offset")}},B=()=>{y?.isConnected||(E?.disconnect(),R=!1,y=document.querySelector(".main-footer"),C=y?.querySelector(".main-footer-bottom")??null,y&&(E=new IntersectionObserver((e=>{R=e[0]?.isIntersecting??!1,H(!1)}),{rootMargin:"200px"}),E.observe(y)))},H=e=>{x||=e,null===_&&(_=requestAnimationFrame((()=>{_=null,B(),x&&M(),x=!1,Y(),A()})))},P=()=>H(!0),T=()=>H(!1);return(0,o.sV)((()=>{document.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",T,{passive:!0}),p=window.scrollY,k.value=document.getElementById("top"),B()})),(0,o.xo)((()=>{document.removeEventListener("scroll",P),window.removeEventListener("resize",T),null!==_&&cancelAnimationFrame(_),E?.disconnect()})),(e,t)=>(0,o.bo)(((0,o.uX)(),(0,o.CE)("button",{ref_key:"buttonRef",ref:f,type:"button",class:(0,l.C4)(["back-to-top-button show-on-load",{"back-to-top-button--over-footer":g.value}]),"aria-label":e.$t("back-to-top-button"),onClick:K},[...t[0]||(t[0]=[(0,o.Lk)("i",{class:"icon icon-Up","aria-hidden":"true"},null,-1)])],10,u)),[[i.aG,h.value]])}}),b=p,m=b}}]);
2//# sourceMappingURL=BackToTop.410dcd93.js.map

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.