{
  "version": 3,
  "sources": ["/cdn/shop/t/2/assets/cart-drawer.js"],
  "sourcesContent": ["class MiniCart extends HTMLElement {\n  constructor() {\n    super();\n  }\n\n  connectedCallback() {\n    this.header = document.querySelector('sticky-header');\n    this.drawer = document.querySelector('cart-drawer');\n    new IntersectionObserver(this.handleIntersection.bind(this)).observe(this);\n  }\n\n  handleIntersection(entries, observer) {\n    if (!entries[0].isIntersecting) return;\n    observer.unobserve(this);\n\n    fetch(this.dataset.url)\n      .then(response => response.text())\n      .then(html => {\n        document.getElementById('mini-cart').innerHTML =\n          this.getSectionInnerHTML(html, '.shopify-section');\n          \n          document.dispatchEvent(new CustomEvent('cartdrawer:opened'));\n      })\n      .catch(e => {\n        console.error(e);\n      });\n  }\n\n  open() {\n    const detailsElement = this.drawer.querySelector('details');\n    if (detailsElement.hasAttribute('open')) {\n      return;\n    }\n    \n    this.drawer.openMenuDrawer();\n  }\n\n  renderContents(parsedState) {\n    this.productId = parsedState.id;\n    this.getSectionsToRender().forEach((section => {\n      if (document.getElementById(section.id)) {\n        document.getElementById(section.id).innerHTML =\n          this.getSectionInnerHTML(parsedState.sections[section.id], section.selector);\n      }\n    }));\n\n    this.open();\n  }\n\n  getSectionsToRender() {\n    return [\n      {\n        id: 'mini-cart',\n        section: 'mini-cart',\n        selector: '.shopify-section'\n      },\n      {\n        id: 'cart-icon-bubble',\n        section: 'cart-icon-bubble',\n        selector: '.shopify-section'\n      },\n      {\n        id: 'mobile-cart-icon-bubble',\n        section: 'mobile-cart-icon-bubble',\n        selector: '.shopify-section'\n      }\n    ];\n  }\n\n  getSectionInnerHTML(html, selector = '.shopify-section') {\n    return new DOMParser()\n      .parseFromString(html, 'text/html')\n      .querySelector(selector).innerHTML;\n  }\n\n  setActiveElement(element) {\n    this.activeElement = element;\n  }\n}\n\ncustomElements.define('mini-cart', MiniCart);\n"],
  "mappings": "AAAA,MAAM,iBAAiB,WAAY,CACjC,aAAc,CACZ,MAAM,CACR,CAEA,mBAAoB,CACl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