PageSourceSearch

https://www.grasswarehouse.co.uk/cdn/shopifycloud/checkout-web/assets/c1/ImpressionEventCapture.DHoHQcSz.js

js grasswarehouse.co.uk collected 2026-09-29 12:34:33 UTC 1,683 bytes, 1 lines download raw bytes

1import{A as v,h as l,u as b}from"./esnext-vendor.7EcvH7tF.js";import{bW as g}from"./hydrate.CvWSYK3c.js";function h(t){return t?.assets?.main?.url!=null}function m(t,a){const s=new WebSocket(t),n=({data:r})=>{try{const{event:e,data:o}=JSON.parse(r);if(e!=="update")return;a(o)}catch(e){console.log(`error parsing update message from ${t} : ${e}`)}};return s.addEventListener("message",n),()=>{s.removeEventListener("message",n),s.close()}}function w(t,a){const s=new Map,n=new Map;return t.extensions.forEach(({uuid:r,assets:{main:{lastUpdated:e}},localization:o})=>{s.set(r,e),o&&n.set(r,o.lastUpdated)}),m(t.socket.url,({extensions:r})=>{r.forEach(({uuid:e,assets:{main:{lastUpdated:o}},localization:c})=>{const i=s.get(e),p=n.get(e),d=o&&i!==o,f=c?.lastUpdated&&p!==c.lastUpdated;let u;d&&(s.set(e,o),u=()=>a(e)),f&&(n.set(e,c.lastUpdated),u=()=>a(e,c)),u&&u()})})}function x(t,a){const{uuid:s,socketUrl:n}=t,r=m(n,({extensions:e})=>{e.find(({uuid:c})=>c===s)&&(r(),a())})}function E({impressionType:t,impressionFeatures:a,enabled:s=!0}){const n=g(),r=v(null),e=v(!1),o=v({impressionType:t,impressionFeatures:a});return o.current={impressionType:t,impressionFeatures:a},l(()=>{if(!s||e.current||!window.IntersectionObserver)return;const c=new IntersectionObserver(p=>{const d=p.some(({isIntersecting:f})=>f);i&&d&&(c.unobserve(i),e.current=!0,n("impression",{...o.current,timestamp:new Date}))},{threshold:1}),i=r.current;return i&&c.observe(i),()=>{i&&c.unobserve(i)}},[n,s]),r}function I({impressionType:t,impressionFeatures:a,enabled:s,children:n}){const r=E({impressionType:t,impressionFeatures:a,enabled:s});return b("div",{ref:r,children:n})}export{I,x as a,h as i,w as s};

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.