1"use strict";(self.webpackChunkgcom_rhythm=self.webpackChunkgcom_rhythm||[]).push([[2388,7546],{9883(t,e,n){n.r(e),n.d(e,{attachProductCardSelectedListeners:()=>l,initCarouselProductCardImpressions:()=>m,publishProductCardView:()=>d,publishProductCardViews:()=>_});const r=Object.freeze({carouselParent:'[data-carousel-type="grid-carousel"]',viewport:'[data-items-element="swiper__viewport"]',productGrid:".grid--product",productCard:".product_card"}),i=new WeakSet,o=new WeakSet,c=new Set,a=new WeakSet,s=new WeakMap,u=.5;function m(t=document){"IntersectionObserver"in window&&f()&&function(t){const e=new Set;if(t instanceof HTMLElement){t.matches(r.carouselParent)&&e.add(t);const n=t.closest(r.carouselParent);n instanceof HTMLElement&&e.add(n)}"querySelectorAll"in t&&t.querySelectorAll(r.carouselParent).forEach(t=>{t instanceof HTMLElement&&e.add(t)});return Array.from(e)}(t).forEach(t=>{if(!(t instanceof HTMLElement))return;const e=t.querySelector(r.viewport),n=t.querySelector(r.productGrid);if(!(e instanceof HTMLElement&&n instanceof HTMLElement))return;const a=function(t){const e=s.get(t);if(e)return e;const n=new IntersectionObserver((t,e)=>{const n=[];t.forEach(t=>{if(!(t.target instanceof HTMLElement))return;if(!t.isIntersecting||t.intersectionRatio<u)return;const r=y(t.target);o.has(t.target)||r&&c.has(r)?e.unobserve(t.target):n.push(t.target)}),_(n).forEach(t=>{e.unobserve(t)})},{root:t,threshold:u});return s.set(t,n),n}(e);n.querySelectorAll(r.productCard).forEach(t=>{if(!(t instanceof HTMLElement))return;if(i.has(t)||o.has(t))return;const e=y(t);e&&c.has(e)||function(t){const e=g(t);return e?{currency:window.currentCurrency,items:[e]}:null}(t)&&(i.add(t),a.observe(t))})})}function d(t){return _([t]).length>0}function _(t){if(!f())return[];const e=[],n=[];return t.forEach(t=>{if(o.has(t))return;const r=y(t);if(r&&c.has(r))return;const i=g(t);i&&(e.push(t),n.push(i))}),n.length<1?[]:(window.Shopify.analytics.publish("product_card_viewed",{currency:window.currentCurrency,items:n}),e.forEach(t=>{o.add(t);const e=y(t);e&&c.add(e)}),e)}function l(t=document){p()||function(t){const e=new Set;t instanceof HTMLElement&&t.matches(r.productCard)&&e.add(t);"querySelectorAll"in t&&t.querySelectorAll(r.productCard).forEach(t=>{t instanceof HTMLElement&&e.add(t)});return Array.from(e)}(t).forEach(t=>{const e=t.querySelector("a");e instanceof HTMLAnchorElement&&(a.has(e)||(e.addEventListener("click",()=>{const e=function(t){const e=h(t,"gtm_item_name"),n=h(t,"gtm_item_id"),r=h(t,"gtm_item_variant"),i=h(t,"gtm_item_price");if(!(e&&n&&r&&i))return null;const o=h(t,"gtm_item_sku"),c={item_name:e,item_id:n,item_category:h(t,"gtm_item_collection")||"",item_variant:r,upc:h(t,"gtm_item_upc"),price:parseFloat(i)},a={currency:window.currentCurrency,items:[c]};"DE"===window.shop_iso_code&&Object.assign(a,{value:i,items:[{...c,category:h(t,"gtm_item_category")||"",item_brand:h(t,"gtm_item_brand")||"",item_sku:o,item_group_id:o.slice(0,6),item_list_name:h(t,"gtm_item_list_name")||"",item_list_id:h(t,"gtm_item_list_id")||""}]});return a}(t);e&&window.Shopify?.analytics?.publish&&window.Shopify.analytics.publish("product_card_selected",e)}),a.add(e)))})}function f(){return!p()&&Boolean(window.Shopify?.analytics?.publish)}function p(){return Boolean("undefined"!=typeof Shopify&&Shopify.designMode)}function g(t){const e=h(t,"gtm_item_name"),n=h(t,"gtm_item_id"),r=h(t,"gtm_item_variant"),i=parseFloat(h(t,"gtm_item_price")||"");if(!e||!n||!r||Number.isNaN(i))return null;const o=h(t,"gtm_item_sku")||"",c=h(t,"gtm_item_upc")||"",a={item_name:e,item_id:n,item_category:h(t,"gtm_item_collection")||"",item_variant:r,upc:o||c,price:i};return"DE"===window.shop_iso_code&&Object.assign(a,{barcode:c,category:h(t,"gtm_item_category")||"",item_brand:h(t,"gtm_item_brand")||"",item_sku:o,item_group_id:h(t,"gtm_item_group_id")||o.slice(0,6),item_list_name:h(t,"gtm_item_list_name")||"",item_list_id:h(t,"gtm_item_list_id")||""}),a}function h(t,e){return t.querySelector(`[name="${e}"]`)?.getAttribute("value")||""}function y(t){const e=h(t,"gtm_item_id")||t.dataset.product||"",n=h(t,"gtm_item_variant");if(!e||!n)return"";const r=h(t,"gtm_item_list_id"),i=h(t,"gtm_item_list_name"),o=t.closest('[id^="shopify-section-"], [data-section-id], .shopify-section')?.id||"";return[r||i||o||"page",e,n].join(":")}}}]);
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.