{
  "version": 3,
  "sources": ["/cdn/shop/t/206/assets/custom.js?enable_js_minification=1"],
  "sourcesContent": ["/*\n* Pipeline Theme\n*\n* Use this file to add custom Javascript to Pipeline.  Keeping your custom\n* Javascript in this fill will make it easier to update Pipeline. In order\n* to use this file you will need to open layout/theme.liquid and uncomment\n* the custom.js script import line near the bottom of the file.\n*\n*/\n\n\n(function() {\n  window.Alpine = Alpine\n\n  const helpers = {\n    updateDOMContent: (selector, responseHTML) => {\n      const parser = new DOMParser()\n      const doc = parser.parseFromString(responseHTML, \"text/html\")\n    \n      const newContentElement = doc.querySelector(selector)\n      const newContent = newContentElement ? newContentElement.innerHTML : null\n    \n      const currentElement = document.querySelector(selector)\n      if (currentElement) {\n        if (newContent) {\n          currentElement.innerHTML = newContent\n          currentElement.style.display = \"\"\n        } else {\n          currentElement.innerHTML = \"\"\n          currentElement.style.display = \"none\"\n        }\n      }\n    }\n  }\n\n  document.addEventListener(\"alpine:init\", function () {\n    Alpine.data(\"productRecommendations\", function(param) {\n      return {\n        recommendationsSlider: null,\n\n        init: function () {\n          this.fetchRecommendations()\n        },\n\n        fetchRecommendations: function () {\n          themeVendor.axios.get(param.url)\n            .then(response => {\n              if (response.data) {\n                helpers.updateDOMContent(\"[data-cart-recommendations]\", response.data)\n\n                this.initSlider()\n              }\n            }).catch(error => {\n              console.log(error, 'Error')\n            })\n        },\n\n        initSlider () {\n          const recommendationsSliderElement = document.querySelector('[data-cart-recommendations-slider]')\n\n          if (recommendationsSliderElement) {\n            const sliderOptions = {\n              accessibility: true,\n              autoPlay: false,\n              contain: false,\n              pageDots: true,\n              adaptiveHeight: false,\n              wrapAround: true,\n              groupCells: true,\n              cellAlign: 'left',\n              freeScroll: true,\n              prevNextButtons: false,\n              draggable: true\n            };\n    \n            this.recommendationsSlider = new Flickity(recommendationsSliderElement, sliderOptions);\n          }\n        },\n\n        handleRecommendedProductAdd(variantId) {\n          console.log(variantId, 'variantId');\n          const url = `${window.theme.routes.cart}/add.js`;\n\n          const data = {\n            id: variantId,\n            quantity: 1\n          }\n\n          const headers = {\n            'X-Requested-With': 'XMLHttpRequest',\n            'Content-Type': 'application/x-www-form-urlencoded'\n          }\n\n          themeVendor.axios.post(url, data, headers).then(function (response) {\n\n            themeVendor.axios.get(`${window.theme.routes.cart}.js`)\n              .then((response) => {\n                console.log('teeest')\n\n                document.dispatchEvent(\n                  new CustomEvent('theme:cart:change', {\n                    detail: {\n                      cart: response.data,\n                    },\n                    bubbles: true,\n                  })\n                );\n              })\n              .catch((e) => {\n                console.error(e);\n              });\n\n            document.dispatchEvent(new CustomEvent('theme:cart:init', {bubbles: true}));\n            document.dispatchEvent(new CustomEvent('theme:cart:reload', {bubbles: true}));\n\n            setTimeout(() => {\n              document.dispatchEvent(new CustomEvent('theme:cart:init', {bubbles: true}));\n              document.dispatchEvent(new CustomEvent('theme:cart:reload', {bubbles: true}));\n            }, 2000);\n\n            console.log('reload');\n          })\n          .catch(function (error) {\n            console.warn(error);\n          });         \n        }\n      }\n    })\n  })\n\n  Alpine.start()\n\n  // Below are example event listeners.  They listen for theme events that Pipeline\n  // fires in order to make it easier for you to add customizations.\n\n  // Keep your scripts inside this IIFE function call to avoid leaking your\n  // variables into the global scope.\n\n\n  // document.addEventListener('theme:variant:change', function(event) {\n  //   // You might use something like this to write a pre-order feature or a\n  //   // custom swatch feature.\n  //   var variant = event.detail.variant;\n  //   var container = event.target;\n  //   if (variant) {\n  //     console.log('Container \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n  //     console.log(container);\n  //     console.log('Variant \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n  //     console.log(variant);\n  //     // ... update some element on the page\n  //   }\n  // });\n\n  // document.addEventListener('theme:cart:change', function(event) {\n  //   var cart = event.detail.cart;\n  //   if (cart) {\n  //     console.log('Cart \u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014 \u2193');\n  //     console.log(cart);\n  //     // ... update an app or a custom shipping caluclator\n  //   }\n  // });\n  // Fired when page loads to update header values\n  // document.addEventListener('theme:cart:init', (e) => {\n  //   console.log('theme:cart:init');\n  //   console.log(e);\n  // });\n\n  // Debounced scroll listeners.  Up and down only fire on direction changes\n  // These events are useful for creating sticky elements and popups.\n  // document.addEventListener('theme:scroll', e => { console.log(e); });\n  // document.addEventListener('theme:scroll:up', e => { console.log(e); });\n  // document.addEventListener('theme:scroll:down', e => { console.log(e); });\n\n  // Debounced resize listener to bundle changes that trigger document reflow\n  // document.addEventListener('theme:resize', e => { console.log(e); });\n\n  // Locks and unlocks page scroll for modals and drawers\n  // These are commented out because firing them will lock the page scroll\n  // the lock event must set `detail` to the modal or drawer body so the \n  // scroll locking code knows what element should maintain scoll. \n  // document.dispatchEvent(new CustomEvent('theme:scroll:lock', {bubbles: true, detail: scrollableInnerElement}));\n  // document.dispatchEvent(new CustomEvent('theme:scroll:unlock', {bubbles: true}));\n\n\n  // ^^ Keep your scripts inside this IIFE function call to avoid leaking your\n  // variables into the global scope.\n})();\n"],
  "mappings": "CAWC,UAAW,CACV,OAAO,OAAS,OAEhB,MAAM,QAAU,CACd,iBAAkB,CAAC,SAAU,eAAiB,CAI5C,MAAM,kBAHS,IAAI,UAAU,EACV,gBAAgB,aAAc,WAAW,EAE9B,cAAc,QAAQ,EAC9C,WAAa,kBAAoB,kBAAkB,UAAY,KAE/D,eAAiB,SAAS,cAAc,QAAQ,EAClD,iBACE,YACF,eAAe,UAAY,WAC3B,eAAe,MAAM,QAAU,KAE/B,eAAe,UAAY,GAC3B,eAAe,MAAM,QAAU,QAGrC,CACF,EAEA,SAAS,iBAAiB,cAAe,UAAY,CACnD,OAAO,KAAK,yBAA0B,SAAS,MAAO,CACpD,MAAO,CACL,sBAAuB,KAEvB,KAAM,UAAY,CAChB,KAAK,qBAAqB,CAC5B,EAEA,qBAAsB,UAAY,CAChC,YAAY,MAAM,IAAI,MAAM,GAAG,EAC5B,KAAK,UAAY,CACZ,SA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