{
  "version": 3,
  "sources": ["/cdn/shop/t/2/assets/zonvo-pdp.js?cb=4"],
  "sourcesContent": ["/* cache-bust: force fresh CDN fingerprint (rev 3 - debug trace) */\nclass ZonvoSpinViewer extends HTMLElement {\n  connectedCallback() {\n    this.frames = Array.from(this.querySelectorAll('.zv-spin__frame'));\n    this.stage = this.querySelector('.zv-spin__stage');\n    this.slider = this.querySelector('.zv-spin__slider');\n    this.degreeLabel = this.querySelector('.zv-spin__degree');\n    this.replayBtn = this.querySelector('.zv-spin__replay');\n    this.frameCount = this.frames.length;\n    this.current = 0;\n    this.dragging = false;\n    this.startX = 0;\n    this.startFrame = 0;\n\n    if (!this.frameCount) return;\n\n    this.showFrame(0);\n\n    this.stage.addEventListener('pointerdown', (e) => this.onPointerDown(e));\n    window.addEventListener('pointermove', (e) => this.onPointerMove(e));\n    window.addEventListener('pointerup', () => this.onPointerUp());\n\n    this.slider.addEventListener('input', () => {\n      this.showFrame(parseInt(this.slider.value, 10));\n    });\n\n    this.replayBtn.addEventListener('click', () => this.autoSpin());\n\n    this.autoSpin();\n  }\n\n  showFrame(index) {\n    const normalized = ((index % this.frameCount) + this.frameCount) % this.frameCount;\n    this.frames[this.current] && this.frames[this.current].classList.remove('is-active');\n    this.current = normalized;\n    this.frames[this.current].classList.add('is-active');\n    this.slider.value = normalized;\n    const degrees = Math.round((normalized / this.frameCount) * 360);\n    this.degreeLabel.textContent = degrees + '\u00B0';\n  }\n\n  onPointerDown(e) {\n    this.dragging = true;\n    this.startX = e.clientX;\n    this.startFrame = this.current;\n    this.stage.setPointerCapture && this.stage.setPointerCapture(e.pointerId);\n  }\n\n  onPointerMove(e) {\n    if (!this.dragging) return;\n    const deltaX = e.clientX - this.startX;\n    const framesPerPixel = this.frameCount / 360;\n    const frameDelta = Math.round(deltaX * framesPerPixel * 0.6);\n    this.showFrame(this.startFrame - frameDelta);\n  }\n\n  onPointerUp() {\n    this.dragging = false;\n  }\n\n  autoSpin() {\n    let step = 0;\n    clearInterval(this.autoSpinTimer);\n    this.autoSpinTimer = setInterval(() => {\n      step += 1;\n      this.showFrame(step);\n      if (step >= this.frameCount) clearInterval(this.autoSpinTimer);\n    }, 60);\n  }\n}\n\ncustomElements.define('zonvo-spin-viewer', ZonvoSpinViewer);\n\n// Gallery thumbnail swapping. Delegated on document (not bound per-thumb at\n// load) because variant switches can rebuild the whole thumbs list with new\n// nodes that wouldn't otherwise have a listener attached.\ndocument.addEventListener('click', (event) => {\n  const thumb = event.target.closest('.zv-gallery__thumb');\n  if (!thumb) return;\n  const thumbsWrap = thumb.closest('.zv-gallery__thumbs');\n  if (!thumbsWrap) return;\n  const mainImage = thumbsWrap.closest('.zv-gallery').querySelector('#zv-gallery-main-image');\n  if (!mainImage) return;\n  mainImage.removeAttribute('srcset');\n  mainImage.removeAttribute('sizes');\n  mainImage.src = thumb.dataset.fullSrc;\n  thumbsWrap.querySelectorAll('.zv-gallery__thumb').forEach((t) => t.classList.remove('is-active'));\n  thumb.classList.add('is-active');\n});\n\ndocument.querySelectorAll('.zv-pdp__thumb').forEach((thumb) => {\n  thumb.addEventListener('click', () => {\n    document.querySelectorAll('.zv-spin__frame').forEach((f) => f.classList.remove('is-active'));\n    const img = thumb.closest('.zv-pdp__gallery').querySelector('.zv-spin__frame');\n    if (img) {\n      img.src = thumb.dataset.fullSrc;\n      img.classList.add('is-active');\n    }\n  });\n});\n\n// Simple quantity stepper\ndocument.querySelectorAll('.zv-qty').forEach((qty) => {\n  const input = qty.querySelector('.zv-qty__input');\n  const decrement = qty.querySelector('[data-qty-decrement]');\n  const increment = qty.querySelector('[data-qty-increment]');\n  if (!input) return;\n\n  decrement &&\n    decrement.addEventListener('click', () => {\n      const min = parseInt(input.min, 10) || 1;\n      input.value = Math.max(min, (parseInt(input.value, 10) || 1) - 1);\n    });\n\n  increment &&\n    increment.addEventListener('click', () => {\n      input.value = (parseInt(input.value, 10) || 1) + 1;\n    });\n});\n\n// Wishlist toggle (UI only \u2014 no backend wishlist configured)\ndocument.querySelectorAll('[data-wishlist-toggle]').forEach((btn) => {\n  btn.addEventListener('click', () => {\n    const active = btn.getAttribute('data-active') === 'true';\n    btn.setAttribute('data-active', active ? 'false' : 'true');\n    const icon = btn.querySelector('span[aria-hidden]');\n    if (icon) icon.textContent = active ? '\u2661' : '\u2665';\n  });\n});\n\n// Variant swatch reactivity: update price, stock badge, add-to-cart state.\n// Delegated on document (not bound to a specific <variant-selects> node)\n// because Dawn's product-info.js replaces that element with a freshly\n// fetched copy after every change (to sync price/URL/etc via its own async\n// render) \u2014 a direct listener bound at page load would end up attached to a\n// detached node after the first swap and silently stop firing.\ndocument.addEventListener('change', (event) => {\n  const variantSelects = event.target.closest('variant-selects');\n  if (!variantSelects) return;\n\n  const variantScript = variantSelects.querySelector('[data-all-variants]');\n  if (!variantScript) return;\n\n  let variants;\n  try {\n    variants = JSON.parse(variantScript.textContent);\n  } catch (e) {\n    return;\n  }\n\n  const productInfo = variantSelects.closest('product-info');\n  if (!productInfo) return;\n\n  const priceEl = productInfo.parentElement.querySelector('[data-pdp-price]');\n  const stockEl = productInfo.parentElement.querySelector('[data-pdp-stock]');\n  const variantIdInput = productInfo.querySelector('[data-pdp-variant-id]');\n  const addBtn = productInfo.querySelector('[data-pdp-add-btn]');\n  const addLabel = productInfo.querySelector('[data-pdp-add-label]');\n  const pdpRoot = variantSelects.closest('.zv-pdp');\n  const gallery = pdpRoot && pdpRoot.querySelector('.zv-pdp__gallery');\n\n  const selectedValues = Array.from(variantSelects.querySelectorAll('input:checked')).map(\n    (input) => input.value\n  );\n\n  const matched = variants.find((variant) =>\n    selectedValues.every((value) => variant.options.includes(value))\n  );\n\n  if (!matched) return;\n\n  if (matched.gallery && matched.gallery.length > 0 && gallery) {\n    // This variant has its own multi-photo set (custom.gallery_images\n    // metafield) \u2014 rebuild the whole thumbnail rail rather than just\n    // swapping one image, since the previous variant's photos don't apply.\n    const mainImage = gallery.querySelector('#zv-gallery-main-image');\n    let thumbsWrap = gallery.querySelector('.zv-gallery__thumbs');\n\n    if (mainImage) {\n      // The server-rendered tag may carry a srcset from whichever variant\n      // loaded first \u2014 srcset wins over src when both are present, so a\n      // stale one silently keeps the old photo on screen no matter what\n      // src is set to.\n      mainImage.removeAttribute('srcset');\n      mainImage.removeAttribute('sizes');\n      mainImage.src = matched.gallery[0].full;\n    }\n\n    if (!thumbsWrap && matched.gallery.length > 1) {\n      thumbsWrap = document.createElement('div');\n      thumbsWrap.className = 'zv-gallery__thumbs';\n      gallery.querySelector('.zv-gallery').appendChild(thumbsWrap);\n    }\n\n    if (thumbsWrap) {\n      if (matched.gallery.length > 1) {\n        thumbsWrap.innerHTML = matched.gallery\n          .map(\n            (img, i) => `\n              <button type=\"button\" class=\"zv-gallery__thumb${i === 0 ? ' is-active' : ''}\" data-full-src=\"${img.full}\">\n                <img src=\"${img.thumb}\" loading=\"lazy\" alt=\"\">\n              </button>\n            `\n          )\n          .join('');\n      } else {\n        thumbsWrap.remove();\n      }\n    }\n  } else if (matched.featured_image && gallery) {\n    const mainImage = gallery.querySelector('#zv-gallery-main-image');\n    const thumbs = gallery.querySelectorAll('.zv-gallery__thumb');\n    const newBase = matched.featured_image.src.split('?')[0];\n    let matchedThumb = null;\n    thumbs.forEach((thumb) => {\n      if ((thumb.dataset.fullSrc || '').split('?')[0] === newBase) {\n        matchedThumb = thumb;\n      }\n    });\n\n    if (mainImage) {\n      mainImage.removeAttribute('srcset');\n      mainImage.removeAttribute('sizes');\n      mainImage.src = matchedThumb ? matchedThumb.dataset.fullSrc : newBase + '?width=1000';\n    }\n    if (matchedThumb) {\n      thumbs.forEach((thumb) => thumb.classList.remove('is-active'));\n      matchedThumb.classList.add('is-active');\n    }\n  }\n\n  if (priceEl) {\n    priceEl.textContent = formatMoney(matched.price);\n  }\n  if (stockEl) {\n    stockEl.classList.toggle('zv-pill--in-stock', matched.available);\n    stockEl.classList.toggle('zv-pill--out-stock', !matched.available);\n    stockEl.textContent = matched.available\n      ? 'In Stock \u00B7 Ready to Ship'\n      : 'Sold Out';\n  }\n  if (variantIdInput) {\n    variantIdInput.value = matched.id;\n    variantIdInput.disabled = !matched.available;\n  }\n  if (addBtn) {\n    addBtn.disabled = !matched.available;\n  }\n  if (addLabel) {\n    addLabel.textContent = matched.available ? `Add to Cart \u2014 ${formatMoney(matched.price)}` : 'Sold Out';\n  }\n});\n\nfunction formatMoney(cents) {\n  return '\u00A3' + (cents / 100).toFixed(2);\n}\n"],
  "mappings": "AACA,MAAM,wBAAwB,WAAY,CACxC,mBAAoB,CAClB,KAAK,OAAS,MAAM,KAAK,KAAK,iBAAiB,iBAAiB,CAAC,EACjE,KAAK,MAAQ,KAAK,cAAc,iBAAiB,EACjD,KAAK,OAAS,KAAK,cAAc,kBAAkB,EACnD,KAAK,YAAc,KAAK,cAAc,kBAAkB,EACxD,KAAK,UAAY,KAAK,cAAc,kBAAkB,EACtD,KAAK,WAAa,KAAK,OAAO,OAC9B,KAAK,QAAU,EACf,KAAK,SAAW,GAChB,KAAK,OAAS,EACd,KAAK,WAAa,EAEb,KAAK,aAEV,KAAK,UAAU,CAAC,EAEhB,KAAK,MAAM,iBAAiB,cAAgB,GAAM,KAAK,cAAc,CAAC,CAAC,EACvE,OAAO,iBAAiB,cAAgB,GAAM,KAAK,cAAc,CAAC,CAAC,EACnE,OAAO,iBAAiB,YAAa,IAAM,KAAK,YAAY,CAAC,EAE7D,KAAK,OAAO,iBAAiB,QAAS,IAAM,CAC1C,KAAK,UAAU,SAAS,KAAK,OAAO,MAAO,EAAE,CAAC,CAChD,CAAC,EAED,KAAK,UAAU,iBAAiB,QAAS,IAAM,KAAK,SAAS,CAAC,EAE9D,KAAK,SAAS,EAChB,CAEA,UAAU,MAAO,CACf,MAAM,YAAe,MAAQ,KAAK,WAAc,KAAK,YAAc,KAAK,WACxE,KAAK,OAAO,KAAK,OAAO,GAAK,KAAK,OAAO,KAAK,OAAO,EAAE,UAAU,OAAO,WAAW,EACnF,KAAK,QAAU,WACf,KAAK,OAAO,KAAK,OAAO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