{
  "version": 3,
  "sources": ["/cdn/shop/t/394/assets/global.js?sections=token-section"],
  "sourcesContent": ["function getFocusableElements(container) {\n  return Array.from(\n    container.querySelectorAll(\n      \"summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe\"\n    )\n  );\n}\nconst trapFocusHandlers = {};\n\nfunction removeTrapFocus(elementToFocus = null) {\n  document.removeEventListener('focusin', trapFocusHandlers.focusin);\n  document.removeEventListener('focusout', trapFocusHandlers.focusout);\n  document.removeEventListener('keydown', trapFocusHandlers.keydown);\n\n  if (elementToFocus) elementToFocus.focus();\n}\n\nfunction trapFocus(container, elementToFocus = container) {\n  var elements = getFocusableElements(container);\n  var first = elements[0];\n  var last = elements[elements.length - 1];\n\n  removeTrapFocus();\n\n  trapFocusHandlers.focusin = (event) => {\n    if (\n      event.target !== container &&\n      event.target !== last &&\n      event.target !== first\n    )\n      return;\n\n    document.addEventListener('keydown', trapFocusHandlers.keydown);\n  };\n\n  trapFocusHandlers.focusout = function() {\n    document.removeEventListener('keydown', trapFocusHandlers.keydown);\n  };\n\n  trapFocusHandlers.keydown = function(event) {\n    if (event.code.toUpperCase() !== 'TAB') return; // If not TAB key\n    // On the last focusable element and tab forward, focus the first element.\n    if (event.target === last && !event.shiftKey) {\n      event.preventDefault();\n      first.focus();\n    }\n\n    //  On the first focusable element and tab backward, focus the last element.\n    if (\n      (event.target === container || event.target === first) &&\n      event.shiftKey\n    ) {\n      event.preventDefault();\n      last.focus();\n    }\n  };\n\n  document.addEventListener('focusout', trapFocusHandlers.focusout);\n  document.addEventListener('focusin', trapFocusHandlers.focusin);\n\n  elementToFocus.focus();\n}\n\n\ndocument.querySelectorAll('[id^=\"Details-\"] summary').forEach((summary) => {\n  summary.setAttribute('role', 'button');\n  summary.setAttribute('aria-expanded', summary.parentNode.hasAttribute('open'));\n\n    if(summary.nextElementSibling) {\n      if(summary.nextElementSibling.getAttribute('id')) {\n        summary.setAttribute('aria-controls', summary.nextElementSibling.id);          \n      }\n    }\n\n  \n      summary.addEventListener('click', (event) => {   \n        event.currentTarget.setAttribute('aria-expanded', !event.currentTarget.closest('details').hasAttribute('open'));\n        \n        let menubtns = document.querySelectorAll('[data-menubtn]');\n        \n          if (event.currentTarget.hasAttribute('data-menubtn')) {\n            menubtns.forEach(btn => {\n              btn.classList.remove('g-btn-fill-primary');\n              btn.classList.remove('g-btn-fill-primary1');                   \n            });\n          }\n        \n          if (event.currentTarget.hasAttribute('data-menubtn')) {          \n            if(event.classList.contains('g-btn-fill-primary1')) {\n              event.classList.remove('g-btn-fill-primary1');\n            }\n            event.currentTarget.classList.remove('g-btn-outline-secondary');\n            event.currentTarget.classList.add('g-btn-fill-primary');                              \n          }\n      });\n    \n\n  if (summary.closest('header-drawer')) return;\n  summary.parentElement.addEventListener('keyup', onKeyUpEscape);\n});\n\n\n// Here run the querySelector to figure out if the browser supports :focus-visible or not and run code based on it.\ntry {\n  document.querySelector(\":focus-visible\");\n} catch(e) {\n  focusVisiblePolyfill();\n}\n\nfunction focusVisiblePolyfill() {\n  const navKeys = ['ARROWUP', 'ARROWDOWN', 'ARROWLEFT', 'ARROWRIGHT', 'TAB', 'ENTER', 'SPACE', 'ESCAPE', 'HOME', 'END', 'PAGEUP', 'PAGEDOWN']\n  let currentFocusedElement = null;\n  let mouseClick = null;\n\n  window.addEventListener('keydown', (event) => {\n    if(navKeys.includes(event.code.toUpperCase())) {\n      mouseClick = false;\n    }\n  });\n\n  window.addEventListener('mousedown', (event) => {\n    mouseClick = true;\n  });\n\n  window.addEventListener('focus', () => {\n    if (currentFocusedElement) currentFocusedElement.classList.remove('focused');\n\n    if (mouseClick) return;\n\n    currentFocusedElement = document.activeElement;\n    currentFocusedElement.classList.add('focused');\n\n  }, true);\n}\n\nfunction pauseAllMedia() {\n  document.querySelectorAll('.js-youtube').forEach((video) => {\n    video.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"' + 'pauseVideo' + '\",\"args\":\"\"}', '*');\n  });\n  document.querySelectorAll('.js-vimeo').forEach((video) => {\n    video.contentWindow.postMessage('{\"method\":\"pause\"}', '*');\n  });\n  document.querySelectorAll('video').forEach((video) => video.pause());\n}\n\n\nfunction onKeyUpEscape(event) {\n  if (event.code.toUpperCase() !== 'ESCAPE') return;\n\n  const openDetailsElement = event.target.closest('details[open]');\n  if (!openDetailsElement) return;\n\n  const summaryElement = openDetailsElement.querySelector('summary');\n  openDetailsElement.removeAttribute('open');\n  summaryElement.setAttribute('aria-expanded', false);\n  summaryElement.focus();\n}\n\nclass QuantityInput extends HTMLElement {\n  constructor() {\n    super();\n    this.input = this.querySelector('input');\n    this.changeEvent = new Event('change', { bubbles: true })\n    this.querySelectorAll('button').forEach(\n      (button) => button.addEventListener('click', this.onButtonClick.bind(this))\n    );\n  }\n\n  onButtonClick(event) {\n    event.preventDefault();\n    if (this.input.disabled) return;\n    const previousValue = this.input.value;\n\n    event.target.name === 'plus' ? this.input.stepUp() : this.input.stepDown();\n    if (previousValue !== this.input.value) this.input.dispatchEvent(this.changeEvent);\n  }\n}\n\ncustomElements.define('quantity-input', QuantityInput);\n\nfunction debounce(fn, wait) {\n  let t;\n  return (...args) => {\n    clearTimeout(t);\n    t = setTimeout(() => fn.apply(this, args), wait);\n  };\n}\n\nfunction fetchConfig(type = 'json') {\n  return {\n    method: 'POST',\n    headers: { 'Content-Type': 'application/json', 'Accept': `application/${type}` }\n  };\n}\n\n/*\n * Shopify Common JS\n *\n */\nif ((typeof window.Shopify) == 'undefined') {\n  window.Shopify = {};\n}\n\nShopify.bind = function(fn, scope) {\n  return function() {\n    return fn.apply(scope, arguments);\n  }\n};\n\nShopify.setSelectorByValue = function(selector, value) {\n  for (var i = 0, count = selector.options.length; i < count; i++) {\n    var option = selector.options[i];\n    if (value == option.value || value == option.innerHTML) {\n      selector.selectedIndex = i;\n      return i;\n    }\n  }\n};\n\nShopify.addListener = function(target, eventName, callback) {\n  target.addEventListener ? target.addEventListener(eventName, callback, false) : target.attachEvent('on'+eventName, callback);\n};\n\nShopify.postLink = function(path, options) {\n  options = options || {};\n  var method = options['method'] || 'post';\n  var params = options['parameters'] || {};\n\n  var form = document.createElement(\"form\");\n  form.setAttribute(\"method\", method);\n  form.setAttribute(\"action\", path);\n\n  for(var key in params) {\n    var hiddenField = document.createElement(\"input\");\n    hiddenField.setAttribute(\"type\", \"hidden\");\n    hiddenField.setAttribute(\"name\", key);\n    hiddenField.setAttribute(\"value\", params[key]);\n    form.appendChild(hiddenField);\n  }\n  document.body.appendChild(form);\n  form.submit();\n  document.body.removeChild(form);\n};\n\nShopify.CountryProvinceSelector = function(country_domid, province_domid, options) {\n  this.countryEl         = document.getElementById(country_domid);\n  this.provinceEl        = document.getElementById(province_domid);\n  this.provinceContainer = document.getElementById(options['hideElement'] || province_domid);\n\n  Shopify.addListener(this.countryEl, 'change', Shopify.bind(this.countryHandler,this));\n\n  this.initCountry();\n  this.initProvince();\n};\n\nShopify.CountryProvinceSelector.prototype = {\n  initCountry: function() {\n    var value = this.countryEl.getAttribute('data-default');\n    Shopify.setSelectorByValue(this.countryEl, value);\n    this.countryHandler();\n  },\n\n  initProvince: function() {\n    var value = this.provinceEl.getAttribute('data-default');\n    if (value && this.provinceEl.options.length > 0) {\n      Shopify.setSelectorByValue(this.provinceEl, value);\n    }\n  },\n\n  countryHandler: function(e) {\n    var opt       = this.countryEl.options[this.countryEl.selectedIndex];\n    var raw       = opt.getAttribute('data-provinces');\n    var provinces = JSON.parse(raw);\n\n    this.clearOptions(this.provinceEl);\n    if (provinces && provinces.length == 0) {\n      this.provinceContainer.style.display = 'none';\n    } else {\n      for (var i = 0; i < provinces.length; i++) {\n        var opt = document.createElement('option');\n        opt.value = provinces[i][0];\n        opt.innerHTML = provinces[i][1];\n        this.provinceEl.appendChild(opt);\n      }\n\n      this.provinceContainer.style.display = \"\";\n    }\n  },\n\n  clearOptions: function(selector) {\n    while (selector.firstChild) {\n      selector.removeChild(selector.firstChild);\n    }\n  },\n\n  setOptions: function(selector, values) {\n    for (var i = 0, count = values.length; i < values.length; i++) {\n      var opt = document.createElement('option');\n      opt.value = values[i];\n      opt.innerHTML = values[i];\n      selector.appendChild(opt);\n    }\n  }\n};\n\nShopify.formatMoney = function(cents, format) {\n  if (typeof cents == 'string') { cents = cents.replace('.',''); }\n  var value = '';\n  var placeholderRegex = /\\{\\{\\s*(\\w+)\\s*\\}\\}/;\n  var formatString = (format || this.money_format);\n  function defaultOption(opt, def) {\n     return (typeof opt == 'undefined' ? def : opt);\n  }\n\n  function formatWithDelimiters(number, precision, thousands, decimal) {\n    precision = defaultOption(precision, 2);\n    thousands = defaultOption(thousands, ',');\n    decimal   = defaultOption(decimal, '.');\n\n    if (isNaN(number) || number == null) { return 0; }\n\n    number = ((number)/100.0).toFixed(precision);\n\n    var parts   = number.split('.'),\n        dollars = parts[0].replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '$1' + thousands),\n        cents   = parts[1] ? (decimal + parts[1]) : '';\n\n    return dollars + cents.replace('00', '-');\n  }\n  \n  // switch(formatString.match(placeholderRegex)[1]) {\n  //   case 'amount':\n  //     value = formatWithDelimiters(cents, 2);\n  //     break;\n  //   case 'amount_no_decimals':\n  //     value = formatWithDelimiters(cents, 0);\n  //     break;\n  //   case 'amount_with_comma_separator':\n  //     value = formatWithDelimiters(cents, 2, '.', ',');\n  //     break;\n  //   case 'amount_no_decimals_with_comma_separator':\n  //     value = formatWithDelimiters(cents, 0, '.', ',');\n  //     break;\n  // }\n  value = formatWithDelimiters(cents, 2, '.', ',');\n  return formatString.replace(placeholderRegex, value);\n};\n\n\n// const userId = localStorage.getItem(\"usersIds\");\n// if(!userId){\n//     localStorage.removeItem(\"authToken\");\n\n// function uuidv4() {\n//   return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n//     (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n//   );\n\n// }\n//     const uuid = uuidv4();\n// localStorage.setItem(\"usersIds\", uuid);\n// }\n\n\nclass AuthToken {\n  async getToken() {\n    const userId = localStorage.getItem(\"usersIds\");\n    if(!userId){\n        localStorage.removeItem(\"authToken\");\n    \n    function uuidv4() {\n      return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>\n        (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)\n      );\n    \n    }\n        const uuid = uuidv4();\n    localStorage.setItem(\"usersIds\", uuid);\n    }\n    const authToken = localStorage.getItem('authToken');\n    if (authToken && this.isTokenValid()) {\n      return authToken;\n    }\n\n    const {token, expiresAt} = await this.fetchToken() || {};\n    localStorage.setItem('authToken', token);\n    localStorage.setItem('authTokenExpiredAt', expiresAt);\n\n    return token;\n  }\n\n  isTokenValid() {\n    const FIVE_MINUTES = 300000;\n    return this.timeToExpired() > FIVE_MINUTES;\n  }\n\n  timeToExpired() {\n    const authTokenExpiredAt = localStorage.getItem('authTokenExpiredAt')\n    if (!authTokenExpiredAt) {\n      return 0;\n    }\n\n    const timeToExpired = new Date(authTokenExpiredAt).getTime() - new Date().getTime();\n    return Math.max(timeToExpired, 0);\n  }\n  \n  async fetchToken(retry = 0) {\n    try {\n      const headers = new Headers();\n      const users = localStorage.getItem(\"usersIds\")   \n      headers.append(\"Authorization\", `Bearer ${window.escJwt.token}`);\n     if (window.customerId == null) {\n       headers.append(\"x-customerId\", users);\n       headers.append(\"x-isLoggedIn\",window.Shopify.userIsLoggedIn);\n       headers.append(\"x-oldCustomerId\",users);\n      } \n    else {\n       headers.append(\"x-customerId\", window.customerId);\n       headers.append(\"x-isLoggedIn\",window.Shopify.userIsLoggedIn);\n       headers.append(\"x-oldCustomerId\",users);    \n       }\n        // if (window.customerId) {\n        //   headers.append(\"x-customerId\", window.customerId)\n        // }\n      const requestOptions = {\n        method: 'POST',\n        headers,\n        redirect: 'follow'\n      };\n      \n      var adapterFunctionTokenUrl = \"\";\n      switch(window.Shopify.shop){\n       case 'levi9testtheme.myshopify.com':\n         adapterFunctionTokenUrl = \"https://func-shopifyadapter-dev-northeu-001.azurewebsites.net/api/Token\";\n          break;\n       case 'shirtup-online.myshopify.com':\n         adapterFunctionTokenUrl = \"https://func-shopifyadapter-prd-northeu-001.azurewebsites.net/api/Token\";\n          break;\n       case 'shirtupstaging.myshopify.com':\n         adapterFunctionTokenUrl = \"https://func-shopifyadapter-uat-northeu-001.azurewebsites.net/api/Token\";\n          break;\n      }\n      const response = await fetch(adapterFunctionTokenUrl, requestOptions);\n            if (retry > 3) {\n              console.log(\"Failed to fetch token\")\n              return {}       \n      }\n\n      if (response.status === 401) {\n        await this.refreshToken();\n        return await this.fetchToken(retry + 1);     \n      }\n      return await response.json(); \n    } catch (error) {\n      console.log(error);\n    }\n  }\n\n  async refreshToken() {\n    return await fetch(window.Shopify.routes.root + \"?sections=token-section\")\n        .then(res => res.json())\n        .then(res => {\n          const tokenMatch = res['token-section'].match(/token:\\s*\"([^\"]+)/);\n          const expiredAtMatch = res['token-section'].match(/expiredAt:\\s*\"([^\"]+)/);\n          const token = tokenMatch && tokenMatch[1];\n          const expiredAt = expiredAtMatch && expiredAtMatch[1];\n          window.escJwt = { token, expiredAt }\n        });\n  }\n}\n\n(async function () {\n  try {\n    const authToken = new AuthToken();\n    await authToken.getToken();\n  } catch (error) {\n    console.log(error);\n  }\n})();\n\n\nclass RedirectToConfigurator {\n  constructor() {\n    if (Shopify.userIsLoggedIn && localStorage.getItem(\"redirect_product\") && localStorage.getItem(\"redirect_configurator_design_id\")) {\n      this.init();\n    }\n  }\n  async init() {\n    const langMarket = Shopify.routes.root;\n    const activeUrl = window.location.pathname + window.location.search;\n    const redirectProduct = localStorage.getItem(\"redirect_product\");\n    const redirectConfiguratorDesignId = localStorage.getItem(\"redirect_configurator_design_id\");\n    const redirectVariant = localStorage.getItem(\"redirect_variant\");\n    var url = `${langMarket}products/${redirectProduct}?_configurator_design_id=${redirectConfiguratorDesignId}`;\n    if (redirectVariant) {\n      url = `${langMarket}products/${redirectProduct}?variant=${redirectVariant}&_configurator_design_id=${redirectConfiguratorDesignId}`;\n      \n    }\n    if (activeUrl.includes(url)) {\n      localStorage.removeItem('redirect_product');\n      localStorage.removeItem('redirect_configurator_design_id');\n      localStorage.removeItem('redirect_variant');\n    } else {\n        try{\n          const authToken = new AuthToken();\n          let token = await authToken.getToken();\n          window.location.replace(url);\n        } catch (error) {\n          console.log(error)\n        }   \n    }\n  }\n};\nnew RedirectToConfigurator();\n\nclass ModalDialog extends HTMLElement {\n  constructor() {\n    super();\n    this.querySelector('[id^=\"ModalClose-\"]').addEventListener(\n      'click',\n      this.hide.bind(this, false)\n    );\n    this.addEventListener('keyup', (event) => {\n      if (event.code.toUpperCase() === 'ESCAPE') this.hide();\n    });\n    if (this.classList.contains('media-modal')) {\n      this.addEventListener('pointerup', (event) => {\n        if (event.pointerType === 'mouse' && !event.target.closest('deferred-media, product-model')) this.hide();\n      });\n    } else {\n      this.addEventListener('click', (event) => {\n        if (event.target === this) this.hide();\n      });\n    }\n  }\n\n  connectedCallback() {\n    if (this.moved) return;\n    this.moved = true;\n    document.body.appendChild(this);\n  }\n\n  show(opener) {\n    this.openedBy = opener;\n    const popup = this.querySelector('.template-popup');\n    // document.body.classList.add('overflow-hidden');\n    this.setAttribute('open', '');\n    if (popup) popup.loadContent();\n    trapFocus(this, this.querySelector('[role=\"dialog\"]'));\n    window.pauseAllMedia();\n  }\n\n  hide() {\n    // document.body.classList.remove('overflow-hidden');\n    document.body.dispatchEvent(new CustomEvent('modalClosed'));\n    this.removeAttribute('open');\n    removeTrapFocus(this.openedBy);\n    window.pauseAllMedia();\n  }\n}\ncustomElements.define('modal-dialog', ModalDialog);\n\nclass ModalOpener extends HTMLElement {\n  constructor() {\n    super();\n\n    const button = this.querySelector('button');\n\n    if (!button) return;\n    button.addEventListener('click', () => {\n      const modal = document.querySelector(this.getAttribute('data-modal'));\n      if (modal) modal.show(button);\n    });\n  }\n}\ncustomElements.define('modal-opener', ModalOpener);\n\nclass DeferredMedia extends HTMLElement {\n  constructor() {\n    super();\n    const poster = this.querySelector('[id^=\"Deferred-Poster-\"]');\n    if (!poster) return;\n    poster.addEventListener('click', this.loadContent.bind(this));\n  }\n\n  loadContent(focus = true) {\n    window.pauseAllMedia();\n    if (!this.getAttribute('loaded')) {\n      const content = document.createElement('div');\n      content.appendChild(this.querySelector('template').content.firstElementChild.cloneNode(true));\n\n      this.setAttribute('loaded', true);\n      const deferredElement = this.appendChild(content.querySelector('video, model-viewer, iframe'));\n      if (focus) deferredElement.focus();\n      if (deferredElement.tagName == 'VIDEO') {\n        deferredElement.addEventListener('canplay', ev => {\n          deferredElement.play();\n        }, false);\n      }\n    }\n  }\n}\n\ncustomElements.define('deferred-media', DeferredMedia);\n\nclass SliderComponent extends HTMLElement {\n  constructor() {\n    super();\n    this.slider = this.querySelector('[id^=\"Slider-\"]');\n    this.sliderItems = this.querySelectorAll('[id^=\"Slide-\"]');\n    this.enableSliderLooping = !!this.dataset.looping;\n    this.currentPageElement = this.querySelector('.slider-counter--current');\n    this.pageTotalElement = this.querySelector('.slider-counter--total');\n    this.prevButton = this.querySelector('button[name=\"previous\"]');\n    this.nextButton = this.querySelector('button[name=\"next\"]');\n\n    if (!this.slider || !this.nextButton) return;\n\n    this.initPages();\n    this.initLinks();\n    const resizeObserver = new ResizeObserver(entries => this.initPages());\n    resizeObserver.observe(this.slider);\n\n    this.slider.addEventListener('scroll', this.update.bind(this));\n    if (this.prevButton) this.prevButton.addEventListener('click', this.onButtonClick.bind(this));\n    if (this.nextButton) this.nextButton.addEventListener('click', this.onButtonClick.bind(this));\n\n    let options = {\n      root: this.slider,\n      rootMargin: '0px',\n      threshold: 1.0\n    }\n\n    this.autoplayIntervalMs = 3000; \n    this.autoplayTimer = null;\n\n    // Start autoplay based on the data attribute\n    //if (this.dataset.autoplay === \"true\") {\n    //  this.startAutoplay();\n    //}\n\n    // Visibility change handling to pause/resume autoplay\n    document.addEventListener('visibilitychange', () => {\n      if (document.hidden) {\n        this.stopAutoplay();\n      } else if (this.dataset.autoplay === \"true\") {\n        this.startAutoplay();\n      }\n    });\n    \n    this.observer = new IntersectionObserver(this.slideUpdate.bind(this), options);\n    this.initObserver();\n  }\n\n  initObserver() {\n    this.sliderItems.forEach(element => {\n      this.observer.observe(element);\n    });\n  }\n\n  initLinks() {\n    this.sliderItems.forEach(element => {\n      const itemLink = document.querySelectorAll(`a[href=\"#${element.id}\"`);\n      itemLink.forEach(link => {\n        link.addEventListener('click', this.onLinkClink.bind(this));\n      });\n    });\n  }\n\n  slideUpdate(entries, observer) {\n    entries.forEach((entry) => {\n      const links = document.querySelectorAll(`a[href=\"#${entry.target.id}\"`);\n      links.forEach(element => {\n        element.parentElement.classList.toggle('active', entry.isIntersecting);\n      });\n    });\n  }\n  \n  onLinkClink(event) {\n    event.preventDefault();\n    const slide = this.slider.querySelector(event.target.getAttribute('href'));\n    this.slider.scrollTo({\n      left: slide.offsetLeft\n    });\n    return false;\n  }\n\n  initPages() {\n    this.sliderItemsToShow = Array.from(this.sliderItems).filter(element => element.clientWidth > 0);\n    if (this.sliderItemsToShow.length < 2) return;\n    this.sliderItemOffset = this.sliderItemsToShow[1].offsetLeft - this.sliderItemsToShow[0].offsetLeft;\n    this.slidesPerPage = Math.max(1, Math.floor((this.slider.clientWidth - this.sliderItemsToShow[0].offsetLeft) / this.sliderItemOffset));\n    this.totalPages = this.sliderItemsToShow.length - this.slidesPerPage + 1;\n    this.update();\n  }\n\n  resetPages() {\n    this.sliderItems = this.querySelectorAll('[id^=\"Slide-\"]');\n    this.initPages();\n  }\n\n  update() {\n    const previousPage = this.currentPage;\n    this.currentPage = Math.round(this.slider.scrollLeft / this.sliderItemOffset) + 1;\n\n    if (this.currentPageElement && this.pageTotalElement) {\n      this.currentPageElement.textContent = this.currentPage;\n      this.pageTotalElement.textContent = this.totalPages;\n    }\n\n    if (this.currentPage != previousPage) {\n      this.dispatchEvent(new CustomEvent('slideChanged', { detail: {\n        currentPage: this.currentPage,\n        currentElement: this.sliderItemsToShow[this.currentPage - 1]\n      }}));\n    }\n\n    if (this.enableSliderLooping) return;\n\n    const mediaQuery = window.matchMedia('(min-width: 750px)');\n\n    if (this.isSlideVisible(this.sliderItemsToShow[0]) && this.slider.scrollLeft === 0) {\n      if (this.prevButton) this.prevButton.setAttribute('disabled', 'disabled');\n      if (mediaQuery.matches && this.querySelector('.slider__header .collection__view-all')) {\n        this.querySelector('.slider__header .collection__view-all').classList.add('transparent');\n      }\n    } else {\n      if (this.prevButton) this.prevButton.removeAttribute('disabled');\n      if (this.querySelector('.slider__header .collection__view-all')) {\n        this.querySelector('.slider__header .collection__view-all').classList.remove('transparent');\n      }\n    }\n    if (this.isSlideVisible(this.sliderItemsToShow[this.sliderItemsToShow.length - 1])) {\n      if (this.nextButton) this.nextButton.setAttribute('disabled', 'disabled');\n    } else {\n      if (this.nextButton) this.nextButton.removeAttribute('disabled');\n    }\n  }\n\n  isSlideVisible(element, offset = 0) {\n    const lastVisibleSlide = this.slider.clientWidth + this.slider.scrollLeft - offset;\n    return (element.offsetLeft + element.clientWidth) <= lastVisibleSlide && element.offsetLeft >= this.slider.scrollLeft;\n  }\n\n  onButtonClick(event) {\n    event.preventDefault();\n    const step = event.currentTarget.dataset.step || 1;\n    this.slideScrollPosition = event.currentTarget.name === 'next' ? this.slider.scrollLeft + (step * this.sliderItemOffset) : this.slider.scrollLeft - (step * this.sliderItemOffset);\n    if (this.enableSliderLooping && this.slideScrollPosition > (this.slider.scrollWidth - this.slider.clientWidth)) {\n      this.slideScrollPosition = 0;\n    }\n    this.slider.scrollTo({\n      left: this.slideScrollPosition\n    });\n  }\n\n  // Autoplay control methods...\n  startAutoplay() {\n    this.stopAutoplay(); // Clear existing interval\n    this.autoplayTimer = setInterval(() => {\n      this.moveToNextSlide();\n    }, this.autoplayIntervalMs);\n  }\n\n  moveToNextSlide() {\n    let nextSlideIndex = this.currentPage + 1; // Assuming 'currentPage' is 1-indexed\n\n        \n    if (nextSlideIndex > this.totalPages) {\n      if (this.enableSliderLooping) {\n        nextSlideIndex = 1; // Reset to the first slide\n        this.slider.scrollTo({ left: 0, behavior: 'smooth' }); // Ensure we're moving to the start\n        this.currentPage = 1; // Reset currentPage to the first slide\n      } else {\n        this.slider.scrollTo({ left: 0, behavior: 'smooth' }); // Stop autoplay if not looping\n        return;\n      }\n    } else {\n      // Proceed to the next slide\n      const nextSlideElement = this.sliderItemsToShow[nextSlideIndex - 1];\n      this.slider.scrollTo({\n        left: nextSlideElement.offsetLeft,\n        behavior: 'smooth'\n      });\n      this.currentPage = nextSlideIndex; // Update currentPage to the next slide\n    }\n  \n    this.update(); // Ensure UI is updated accordingly\n  }\n  \n  \n  stopAutoplay() {\n    clearInterval(this.autoplayTimer);\n    this.autoplayTimer = null;\n  }\n\n  // Property to dynamically control autoplay\n  //set autoplay(value) {\n  //  if (value) {\n  //    this.dataset.autoplay = \"true\";\n  //    this.startAutoplay();\n  //  } else {\n  //    this.dataset.autoplay = \"false\";\n  //    this.stopAutoplay();\n  //  }\n  //}\n\n  get autoplay() {\n    return this.autoplayTimer !== null;\n  }\n\n  // Handle dynamic changes to the autoplay attribute\n  static get observedAttributes() { return ['data-autoplay']; }\n\n  //attributeChangedCallback(name, oldValue, newValue) {\n  //  if (name === 'data-autoplay') {\n  //    this.autoplay = newValue === \"true\";\n  //  }\n  //}\n}\n\ncustomElements.define('slider-component', SliderComponent);\n\nclass VariantSelects extends HTMLElement {\n  constructor() {\n    super();\n    this.addEventListener('change', this.onVariantChange);\n  }\n\n  onVariantChange() {\n    this.updateOptions();\n    this.updateMasterId();\n    this.toggleAddButton(true, '', false);\n    this.removeErrorMessage();\n\n    if (!this.currentVariant) {\n      this.toggleAddButton(true, '', true);\n      this.setUnavailable();\n    } else {\n      this.updateMedia();\n      this.updateURL();\n      this.updateVariantInput();\n      this.renderProductInfo();\n      this.updateShareUrl();\n    }\n  }\n\n  updateOptions() {\n    this.options = Array.from(this.querySelectorAll('select'), (select) => select.value);\n  }\n\n  updateMasterId() {\n    this.currentVariant = this.getVariantData().find((variant) => {\n      return !variant.options.map((option, index) => {\n        return this.options[index] === option;\n      }).includes(false);\n    });\n  }\n\n  updateMedia() {\n    if (!this.currentVariant) return;\n    if (!this.currentVariant.featured_media) return;\n\n    const mediaGallery = document.getElementById(`MediaGallery-${this.dataset.section}`);\n    mediaGallery.setActiveMedia(`${this.dataset.section}-${this.currentVariant.featured_media.id}`, true);\n\n    const modalContent = document.querySelector(`#ProductModal-${this.dataset.section} .product-media-modal__content`);\n    if (!modalContent) return;\n    const newMediaModal = modalContent.querySelector( `[data-media-id=\"${this.currentVariant.featured_media.id}\"]`);\n    modalContent.prepend(newMediaModal);\n  }\n\n  updateURL() {\n    if (!this.currentVariant || this.dataset.updateUrl === 'false') return;\n    window.history.replaceState({ }, '', `${this.dataset.url}?variant=${this.currentVariant.id}`);\n  }\n\n  updateShareUrl() {\n    const shareButton = document.getElementById(`Share-${this.dataset.section}`);\n    if (!shareButton || !shareButton.updateUrl) return;\n    shareButton.updateUrl(`${window.shopUrl}${this.dataset.url}?variant=${this.currentVariant.id}`);\n  }\n\n  updateVariantInput() {\n    const productForms = document.querySelectorAll(`#product-form-${this.dataset.section}, #product-form-installment-${this.dataset.section}`);\n    productForms.forEach((productForm) => {\n      const input = productForm.querySelector('input[name=\"id\"]');\n      input.value = this.currentVariant.id;\n      input.dispatchEvent(new Event('change', { bubbles: true }));\n    });\n  }\n\n  removeErrorMessage() {\n    const section = this.closest('section');\n    if (!section) return;\n\n    const productForm = section.querySelector('product-form');\n    if (productForm) productForm.handleErrorMessage();\n  }\n\n  renderProductInfo() {\n    fetch(`${this.dataset.url}?variant=${this.currentVariant.id}&section_id=${this.dataset.originalSection ? this.dataset.originalSection : this.dataset.section}`)\n      .then((response) => response.text())\n      .then((responseText) => {\n        const html = new DOMParser().parseFromString(responseText, 'text/html')\n        const destination = document.getElementById(`price-${this.dataset.section}`);\n        const source = html.getElementById(`price-${this.dataset.originalSection ? this.dataset.originalSection : this.dataset.section}`);\n        if (source && destination) destination.innerHTML = source.innerHTML;\n\n        const price = document.getElementById(`price-${this.dataset.section}`);\n\n        if (price) price.classList.remove('visibility-hidden');\n        this.toggleAddButton(!this.currentVariant.available, window.variantStrings.soldOut);\n      });\n  }\n\n  toggleAddButton(disable = true, text, modifyClass = true) {\n    const productForm = document.getElementById(`product-form-${this.dataset.section}`);\n    if (!productForm) return;\n    const addButton = productForm.querySelector('[name=\"add\"]');\n    const addButtonText = productForm.querySelector('[name=\"add\"] > span');\n    if (!addButton) return;\n\n    if (disable) {\n      addButton.setAttribute('disabled', 'disabled');\n      if (text) addButtonText.textContent = text;\n    } else {\n      addButton.removeAttribute('disabled');\n      addButtonText.textContent = window.variantStrings.addToCart;\n    }\n\n    if (!modifyClass) return;\n  }\n\n  setUnavailable() {\n    const button = document.getElementById(`product-form-${this.dataset.section}`);\n    const addButton = button.querySelector('[name=\"add\"]');\n    const addButtonText = button.querySelector('[name=\"add\"] > span');\n    const price = document.getElementById(`price-${this.dataset.section}`);\n    if (!addButton) return;\n    addButtonText.textContent = window.variantStrings.unavailable;\n    if (price) price.classList.add('visibility-hidden');\n  }\n\n  getVariantData() {\n    this.variantData = this.variantData || JSON.parse(this.querySelector('[type=\"application/json\"]').textContent);\n    return this.variantData;\n  }\n}\n\ncustomElements.define('variant-selects', VariantSelects);\n\nclass VariantRadios extends VariantSelects {\n  constructor() {\n    super();\n  }\n\n  updateOptions() {\n    const fieldsets = Array.from(this.querySelectorAll('fieldset'));\n    this.options = fieldsets.map((fieldset) => {\n      return Array.from(fieldset.querySelectorAll('input')).find((radio) => radio.checked).value;\n    });\n  }\n}\n\ncustomElements.define('variant-radios', VariantRadios);\n\nclass CollapsableContent extends HTMLElement {\n  constructor() {\n    super();\n    if ( this.querySelector(':scope > h2, :scope > p.footer-block__heading') ) {\n      this.querySelector(':scope > h2, :scope > p.footer-block__heading').addEventListener('click', this.toggleCollapse.bind(this), false);\n    }\n  }\n  toggleCollapse() {\n    if (this.hasAttribute('open')) {\n      this.removeAttribute('open', true);\n      return;\n    }\n    this.setAttribute('open', true);\n  }\n}\n\ncustomElements.define('collapsable-content', CollapsableContent);\n\nclass PopupModal extends HTMLElement {\n  constructor() {\n    super();\n    this.dialog = this.querySelector('dialog');\n    this.triggerBtn = this.querySelector('button'); // Assumes first button opens it\n    this.closeBtn = this.dialog?.querySelector(\"button[value='cancel']\");\n\n    if (this.triggerBtn) {\n      this.triggerBtn.addEventListener('click', this.openModal.bind(this));\n    }\n\n    if (typeof this.dialog.showModal !== 'function') {\n      // Fallback: dialog unsupported\n      this.dialog.hidden = true;\n    }\n\n    // Close button inside modal\n    if (this.closeBtn) {\n      this.closeBtn.addEventListener('click', this.closeModal.bind(this));\n    }\n\n    // Close on clicking outside modal content\n    // Close on clicking outside modal content\n    this.dialog?.addEventListener('click', (event) => {\n        // Check if the clicked target is outside the <dialog>'s direct content\n        if (event.target === this.dialog) {\n          this.closeModal(event);\n        }\n});\n\n    // Optional: handle ESC key fallback\n    this.dialog?.addEventListener('cancel', this.closeModal.bind(this));\n  }\n\n  openModal(ev) {\n    ev?.preventDefault?.();\n    if (typeof this.dialog.showModal === 'function') {\n      this.dialog.showModal();\n    } else {\n      this.dialog.hidden = false;\n    }\n    return false;\n  }\n\n  closeModal(ev) {\n    ev?.preventDefault?.();\n    if (typeof this.dialog.showModal === 'function') {\n      this.dialog.close();\n    } else {\n      this.dialog.hidden = true;\n    }\n\n    // Optional: remove it from DOM or refresh, depending on your flow\n\n    return false;\n  }\n}\n\ncustomElements.define('popup-modal', PopupModal);\n\n\nclass LinkElement extends HTMLElement {\n  constructor() {\n    super();\n    this.addEventListener('click', this.goToLink.bind(this));\n  }\n  goToLink(ev) {\n    ev.preventDefault();\n    if (\"href\" in this.dataset) {\n      window.location.href = this.dataset.href;\n    }\n  }\n}\n\ncustomElements.define('link-element', LinkElement);\n\nclass AccordionGroup extends HTMLElement {\n  constructor() {\n    super();\n    this.querySelectorAll(':scope > details, :scope > .accordion > details').forEach(el => {\n        el.addEventListener('toggle', this.detailsToggle.bind(this), false);\n    });\n  }\n  detailsToggle(event) {\n      if (!event.target.hasAttribute('open')) return;\n      Array.from(this.querySelectorAll(':scope > details[open], :scope > .accordion > details[open]')).filter( el => {\n          if (el != event.target) {\n              el.removeAttribute('open');\n          }\n      });\n  }\n}\n\ncustomElements.define('accordion-group', AccordionGroup);\n\n// class LoadMore extends HTMLElement {\n//   constructor() {\n//     super();\n//     this.addEventListener('click', this.loadMore.bind(this), false);\n//     this.mql = window.matchMedia('(max-width: 749px)');\n//     this.collectionWrapper = this.closest('.collection').querySelector('.product-grid');\n//   }\n//   loadMore(event) {\n//     if (!this.collectionWrapper) return;\n\n//     this.setAttribute('disabled', true);\n//     let limit = this.dataset.desktop;\n//     let classes = ['large-up-hide'];\n//     if (this.mql.matches) {\n//       limit = this.dataset.mobile;\n//       classes = ['small-hide', 'medium-hide'];\n//     }\n//     const productElements = this.collectionWrapper.querySelectorAll(':scope > *');\n//     const visibleProductElements = Array.from(productElements).filter(el => !el.matches('.' + classes.join('.')));\n//     const nextLimit = parseInt(limit) + visibleProductElements.length;\n//     if (productElements.length >= nextLimit) {\n//       // If there are enough products visible, just show the next X\n//       const nextElements = Array.from(productElements).slice(visibleProductElements.length, nextLimit);\n//       nextElements.forEach(element => {\n//         element.classList.remove(...classes);\n//       });\n//     } else {\n//       let requestLimit = nextLimit - productElements.length;\n//       if (requestLimit < 0) {\n//         requestLimit = limit\n//       }\n//       fetch(`${this.dataset.url}/products.json?limit=${limit}&page=&section_id=${this.dataset.originalSection ? this.dataset.originalSection : this.dataset.section}`)\n//       .then((response) => response.text())\n//       .then((responseText) => {\n//         console.log(responseText);\n//         return;\n//         const html = new DOMParser().parseFromString(responseText, 'text/html')\n//         const destination = document.getElementById(`price-${this.dataset.section}`);\n//         const source = html.getElementById(`price-${this.dataset.originalSection ? this.dataset.originalSection : this.dataset.section}`);\n//         if (source && destination) destination.innerHTML = source.innerHTML;\n\n//         const price = document.getElementById(`price-${this.dataset.section}`);\n\n//         if (price) price.classList.remove('visibility-hidden');\n//         this.toggleAddButton(!this.currentVariant.available, window.variantStrings.soldOut);\n//       });\n//       fetch()\n//       .then(request.json())\n//     }\n//     // console.log(nextLimit, productElements.length, limit, this.mql.matches, visibleProductElements.length);\n//   }\n// }\n\n// customElements.define('load-more', LoadMore);\n\nclass ProductConfigurator extends HTMLElement {\n  constructor() {\n      super();\n      this.authToken = new AuthToken();\n      this.addEventListener('shirtup:configure', this.initialiseData.bind(this));\n      this.addEventListener('shirtup:render', this.renderConfigurator.bind(this));\n      this.addEventListener('shirtup:update', this.updateData.bind(this));\n      if (this.querySelector('[data-close]')) {\n          this.querySelector('[data-close]').addEventListener('click', this.closeConfigurator.bind(this));\n      }\n\n      this.configurator = this.querySelector('shirtup-configurator');\n      this.cartItemsToUpdate = [];\n      this.readyToRedirect = true;\n      this.printingPrice = 0;\n      this.premiumGraphics = 0;\n  }\n\n  initialiseData(ev) {\n      this.updateConfiguratorData(ev.detail);\n      this.renderConfigurator();\n  }\n\n  updateData(ev) {\n    let colorPickerElement = document.querySelector('.colorEN:checked');\n    let colorEN=colorPickerElement.dataset.configuratorcolor;\n    let colorTranslated=colorPickerElement.value;\n    this.configuratorData = (this.configuratorData) ? this.configuratorData : this.getConfiguratorData();\n    const variants = ev.detail.variants.map(v => {\n        const altVariant = this.configuratorData.product.variants.find(av => av.size == v.option2);\n        let isPreselected = ev.detail.preselectedVariants.includes(v.id);\n        let variantQuantity = isPreselected ? 1 : 0;\n        return {\n            id: v.id,\n            color: colorEN,\n            size: v.option2,\n            sku: v.sku,\n            price: v.price,\n            available: v.available,\n            selectedQuantity: variantQuantity\n        };\n    });\n    const updatedValues = {\n        variants: variants,\n        product: {\n            preselectedVariants: ev.detail.preselectedVariants,\n            color: colorEN,\n            productColorTranslation: colorTranslated,\n            variants: variants\n        }\n    };\n    this.updateConfiguratorData(updatedValues);\n  }\n    async fetchAllTranslatedProductTitles() {\n    const GRAPHQL_ENDPOINT = `https://${window.location.host}/api/2023-10/graphql.json`;\n    const STOREFRONT_ACCESS_TOKEN = \"8ed4adeb081cc2c1365d4ef15ebee2f2\"; \n  \n    const TAG_FILTER = 'tag:Designyourown';\n    const LANGUAGE = Shopify.locale.toUpperCase();\n    const COUNTRY = Shopify.country.toUpperCase();\n  \n    const query = `\n      query getTranslatedProducts($tag: String!, $country: CountryCode, $language: LanguageCode, $cursor: String)\n        @inContext(country: $country, language: $language) {\n        products(first: 250, query: $tag, after: $cursor) {\n          edges {\n            cursor\n            node {\n              title\n              globalid: metafield(namespace: \"custom\", key: \"globalid\") {\n                value\n              }\n            }\n          }\n          pageInfo {\n            hasNextPage\n          }\n        }\n      }\n    `;\n  \n    let hasNextPage = true;\n    let cursor = null;\n    const productTitleTranslations = {};\n  \n    while (hasNextPage) {\n      const response = await fetch(GRAPHQL_ENDPOINT, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json',\n          'X-Shopify-Storefront-Access-Token': STOREFRONT_ACCESS_TOKEN\n        },\n        body: JSON.stringify({\n          query,\n          variables: {\n            tag: TAG_FILTER,\n            country: COUNTRY,\n            language: LANGUAGE,\n            cursor\n          }\n        })\n      });\n  \n      const json = await response.json();\n  \n      if (json.errors) {\n        console.error('Errors:', json.errors);\n        break;\n      }\n  \n      const edges = json?.data?.products?.edges || [];\n  \n      for (const edge of edges) {\n        const globalid = edge.node.globalid?.value;\n        const title = edge.node.title;\n        if (globalid && title) {\n          productTitleTranslations[globalid] = title;\n        }\n      }\n  \n      hasNextPage = json?.data?.products?.pageInfo?.hasNextPage;\n      cursor = edges.length > 0 ? edges[edges.length - 1].cursor : null;\n    }\n  \n    this.configurator.productTitleTranslations = productTitleTranslations;\n    return productTitleTranslations;\n  }\n\n  closeConfigurator(e) {\n    if(this.readyToRedirect === true){\n      this.removeAttribute('open');\n      document.body.classList.remove('overflow-hidden');\n      document.body.classList.remove('overflow-two');\n    if(this.configuratorData.variants[0].color != this.configuratorData.product.variants[0].color){\n      let resultVariants = [];\n      let counter = this.configuratorData.product.variantsStock.length;\n         for(let k=0; k<counter; k++) {\n            if(this.configuratorData.product.variantsStock[k].color == this.configuratorData.variants[0].color) {\n              resultVariants.push(this.configuratorData.product.variantsStock[k]);\n          }\n         }\n        this.configuratorData.product.variants = resultVariants;\n        this.configuratorData.product.color = this.configuratorData.variants[0].color;\n      }\n      \n      if (typeof URLSearchParams !== 'undefined') {\n        const params = (new URL(document.location)).searchParams;\n        if (params.has('_configurator_design_id')) {\n          params.delete('_configurator_design_id');\n          params.set('variant',this.configuratorData.variants[0].id);\n          if (params.has('readOnly')) {\n            params.delete('readOnly');\n          }\n          window.history.replaceState( {} , document.title, '?' + params.toString() );\n        }\n      } else {\n        window.history.replaceState( {} , document.title, '?browser=unsupported' );\n      }\n      if (this.configurator) this.configurator.remove();\n      this.configurator = false;\n\n      if (this.checkTokenIntervalId) {\n        clearInterval(this.checkTokenIntervalId);\n      }\n\n      if(window.location.toString().includes(\"saved-designs\")){\n        const event = new CustomEvent(\"saved-design-refetch\",{\n          bubbles:true\n        });\n        window.dispatchEvent(event) \n      }\n      // Restore the original configurator data:\n      if (this.originalConfiguratorData) {\n        this.configuratorData = this.originalConfiguratorData;\n        delete this.originalConfiguratorData;\n      }\n      }\n     else{\n        setTimeout(() => {\n          this.closeConfigurator();\n      }, 500);\n  }\n}\n\n  async renderConfigurator(e) {\n      document.body.classList.add('overflow-hidden');\n      document.body.classList.add('overflow-two');\n      this.setAttribute('open', true);\n      if (!this.configurator) {\n          this.configurator = document.createElement('shirtup-configurator');\n          this.appendChild(this.configurator);\n          await this.init();\n          this.addEventListeners();\n      }\n\n    setTimeout(()=>{\n        const trustBadge = document.querySelector('._1y0juye');\n        \n        if (trustBadge) {\n          trustBadge.style.setProperty(\"display\", \"none\", \"important\");\n        }\n      }, 3000)\n  }\n/*\n  async checkCartContents() {\n    try {\n      const response = await fetch('/cart.js');\n      const cart = await response.json();\n\n      const designIdExists = cart.items.some(item => item.properties._configurator_design_id === this.configuratorData.configuratorDesignId);\n      this.configuratorData.fromCart = designIdExists;\n\n    } catch (error) {\n      console.error('Error fetching cart contents:', error);\n    }\n  }\n*/\n  addEventListeners() {\n      this.configurator.addEventListener('onpricingrequested', this.pricingRequested.bind(this));\n      this.configurator.addEventListener('onprinttechniquechange', this.reinitializeComponent.bind(this));\n      this.configurator.addEventListener('onaddtocart', this.generateCart.bind(this));\n      this.configurator.addEventListener('ondesigniscreated', this.designIdUpdate.bind(this));\n      this.configurator.addEventListener('onconfiguratorclose', this.closeConfigurator.bind(this));\n      this.configurator.addEventListener('onreplaceproduct', this.replaceProduct.bind(this));    \n      this.configurator.addEventListener('oncompleteddesign', this.sendAccountToCompletedDesignInKlaviyo.bind(this));\n      this.configurator.addEventListener('onsaveddesign', this.sendAccountToSavedDesignInKlaviyo.bind(this));\n      this.configurator.addEventListener('onauthconflict', this.authConflict.bind(this));\n      this.configurator.addEventListener('onredirect', this.redirect.bind(this));\n      this.configurator.addEventListener('onrefreshcart', this.refreshCart.bind(this));\n  }\n  sendAccountToCompletedDesignInKlaviyo(e){\n    let userEmail = localStorage.getItem('users_email');\n    _learnq.push(['identify', {\n       '$email' : userEmail\n       }]);\n      _learnq.push(['track', 'Completed Design']);\n  }   \n\n  partialUpdateConfiguratorData(changes) {\n    if (!this.configuratorData) {\n        this.configuratorData = this.getConfiguratorData();\n    }\n  \n      this.configuratorData = this.mergeDeep(this.configuratorData, changes);\n    }\n  \n  async reinitializeComponent(e) {    \n    if (this.configurator) {\n        this.configurator.remove();\n        this.configurator = null;\n    }\n  \n    const changes = {\n        configuratorDesignId: e.detail.configuratorDesignId,\n        product: {\n            printTechnique: e.detail.printTechnique\n        }\n    };\n  \n    await this.renderConfigurator();\n\n    setTimeout(() => {                \n        this.partialUpdateConfiguratorData(changes);        \n    }, 1000); \n  }\n\n  \n  async replaceProduct(e) {\n    try {\n      // Save the original configurator data, also check if it's already saved\n        if (!this.originalConfiguratorData) {\n          this.originalConfiguratorData = JSON.parse(JSON.stringify(this.configuratorData));\n        }\n      // replace product\n      var shopifyId = await this.getShopifyProductId(e.detail.product.id);\n      var variantsObject = await this.getVariants(shopifyId);\n      var variantsData = variantsObject.data.product;\n      var shopifyVariantIds = [];\n      const productType = variantsData.productType;\n  \n      const variantsArray = variantsData.variants.edges.map(edge => {\n      const shopifyId = edge.node.id.split('/').pop(); // Split by '/' and get the last part\n      const shopifyVariantGlobalId = edge.node.globalid?.value;\n      const configuratorColor = edge.node.colorEN?.value;\n      const variantSku = edge.node.sku;\n      // const variantPriceWithoutDot = edge.node.price.amount.replace('.', \"\");\n      // const variantPrice = Number(variantPriceWithoutDot);\n      const variantPrice = edge.node.price.amount * 100.00;\n    \n      shopifyVariantIds.push(shopifyId, shopifyVariantGlobalId, configuratorColor, variantSku, variantPrice);\n  \n        return { id: shopifyId, globalId: shopifyVariantGlobalId, color: configuratorColor, sku: variantSku, price: variantPrice };\n      });\n\n      \n      this.configuratorData = this.getConfiguratorData();\n\n      this.configuratorData.product = e.detail.product;\n      this.configuratorData.productHandler = e.detail.productHandler;\n      this.configuratorData.productTranslation = e.detail.productHandler;\n      //example for updates printing products on replaceProduct      \n      if (productType === \"Hoodie\") {\n        this.configuratorData.printing_variants = getHoodieProduct();\n      } else {\n        this.configuratorData.printing_variants = getBasePrint();\n      }\n      this.configuratorData.product.variantsStock = variantsArray.map(variant => ({\n        id: variant.id,\n        globalid: variant.globalId,\n        color: variant.color,\n        sku: variant.sku,\n        price: variant.price\n      }));\n      this.configuratorData.product.variants = variantsArray.map(variant => ({\n        id: variant.id,\n        globalid: variant.globalId,\n        color: variant.color,\n        sku: variant.sku,\n        price: variant.price\n      }));\n      this.configuratorData.variants = variantsArray.map(variant => ({\n        id: variant.id,\n        globalid: variant.globalId,\n        color: variant.color,\n        sku: variant.sku,\n        price: variant.price\n      }));\n\n    } catch (error) {\n      console.error(\"Error replacing product:\", error);\n    }\n  }\n\n  refreshCart() {\n    this.closeConfigurator();\n    window.location.reload();\n  }\n\n  async getShopifyProductId(productGlobalId) {\n    var adapterFunctionTokenUrl = \"\";\n    switch(window.Shopify.shop){\n     case 'levi9testtheme.myshopify.com':\n       adapterFunctionTokenUrl = `https://func-shopifyadapter-dev-northeu-001.azurewebsites.net/api/GetShopifyProductId?globalId=${productGlobalId}`;\n        break;\n     case 'shirtup-online.myshopify.com':\n       adapterFunctionTokenUrl = `https://func-shopifyadapter-prd-northeu-001.azurewebsites.net/api/GetShopifyProductId?globalId=${productGlobalId}`;\n        break;\n     case 'shirtupstaging.myshopify.com':\n       adapterFunctionTokenUrl = `https://func-shopifyadapter-uat-northeu-001.azurewebsites.net/api/GetShopifyProductId?globalId=${productGlobalId}`;\n        break;\n    }\n    try {\n      const response = await fetch(adapterFunctionTokenUrl);\n      if (!response.ok) {\n        throw new Error('Network response was not ok ' + response.statusText);\n      }\n      const data = await response.json();\n      return data; \n    } catch (error) {\n      console.error('There was a problem with the fetch operation:', error);\n    }\n  }\n  async getVariants(shopifyId) {\n    const language=Shopify.country.toUpperCase();\n    let graphQlToken = \"\";\n    switch (window.Shopify.shop) {\n      case 'levi9testtheme.myshopify.com':\n        graphQlToken = \"98fdd58a48bcdc250a2a279a08f800e2\";\n        break;\n      case 'shirtup-online.myshopify.com':\n        graphQlToken = \"8ed4adeb081cc2c1365d4ef15ebee2f2\";\n        break;\n      case 'shirtupstaging.myshopify.com':\n        graphQlToken = \"b5deea45294c65b32c165d63fa61179e\";\n        break;\n    }\n    try {\n      const response = await fetch(`https://${window.location.host}/api/2024-07/graphql.json`, {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json',\n          'X-Shopify-Storefront-Access-Token': graphQlToken\n        },\n        body: JSON.stringify({\n          query: `query @inContext(country: ${language}) {\n            product(id: \"gid://shopify/Product/${shopifyId}\") {\n              productType\n              variants(first: 250) {\n                edges {\n                  node {\n                    id\n                    globalid:metafield(namespace:\"shirtup\", key: \"globalid\"){\n                      value\n                    }\n                    colorEN:metafield(namespace:\"shirtup\", key: \"configurator_color\"){\n                      value\n                    }\n                    price{\n                      amount\n                    }\n                    sku\n                  }\n                }\n              }\n            }\n          }`\n        })\n      });\n  \n      const data = await response.json();\n      return data;\n    } catch (error) {\n      console.error(error);\n      return null;\n    }\n  }\n  authConflict(e) {\n    window.location.href = '/404';\n  }\n  sendAccountToSavedDesignInKlaviyo(e){\n    let userEmail = localStorage.getItem('users_email');\n    \n    _learnq.push(['identify', {\n       '$email' : userEmail\n       }]);\n      _learnq.push(['track', 'Saved Design']);\n  }\n\n  setApiToken() {\n    this.configurator.apiToken = localStorage.getItem('authToken');\n    this.configurator.apiTokenExpiredDate = localStorage.getItem('authTokenExpiredAt');\n  }\n\n  async init() {\n    this.configuratorData = this.getConfiguratorData();\n    \n    if(!localStorage.getItem('authToken')) {\n      await (async () => {\n       await this.authToken.getToken();\n       this.setApiToken();         \n            return this;\n      })();  \n    }\n    this.setApiToken();\n    const FOUR_HOUR = 14400000;\n    const expiredAtSecond = this.authToken.timeToExpired() || FOUR_HOUR ;\n\n    this.checkTokenIntervalId = setInterval(async () => {\n       if (!this.authToken.isTokenValid()) {\n         await this.authToken.getToken();\n         this.setApiToken();\n       }\n     }, expiredAtSecond);\n\n    var userId = this.configuratorData.userId;\n       if (userId === \"\") {\n       userId = localStorage.getItem(\"usersIds\");\n        // userId = userId.replace(/^\"|\"$/g, '');\n      } \n\n    // await this.checkCartContents()\n    var exchangeRate = Shopify.currency.rate;\n    this.configuratorData.pricing.exchangeRate = parseFloat(exchangeRate);\n    this.fetchAllTranslatedProductTitles();\n    this.configurator.productCustomTags = this.configuratorData.productCustomTags;\n    this.configurator.lang = this.configuratorData.lang;\n    this.configurator.langMarket = this.configuratorData.langMarket;\n    this.configurator.fromCart = this.configuratorData.fromCart;\n    this.configurator.productTranslation  = this.configuratorData.productTranslation;\n    this.configurator.productColorTranslation  = this.configuratorData.productColorTranslation;\n    this.configurator.userId = userId;\n    this.configurator.userIsLoggedIn = this.configuratorData.userIsLoggedIn;\n    this.configurator.fromSavedDesigns = this.configuratorData.fromSavedDesigns;\n    this.configurator.nextShipping = this.configuratorData.nextShipping;\n    this.configurator.baseShopUrl = this.configuratorData.baseShopUrl;\n    this.configurator.productHandler = this.configuratorData.productHandler;\n    this.configurator.webShopProduct = this.configuratorData.product;\n    this.configurator.pricing = this.configuratorData.pricing;\n    this.configurator.preselectedVariants  = this.configuratorData.preselectedVariants;\n    this.configurator.mobileUxV2 = this.configuratorData.mobileUxV2;\n    this.configurator.desktopUxV2 = this.configuratorData.desktopUxV2;\n    this.configurator.weAdviseText = this.configuratorData.weAdviseText;\n    this.configurator.exchangeRate = this.configuratorData.pricing.exchangeRate;\n    this.configurator.content = this.configuratorData.content;\n    this.configurator.discountRules = this.configuratorData.discountRules;\n    \n    let designMode = {\n      \"mode\": \"USER_DESIGN\",\n      \"readOnly\": false\n    };\n    if (this.configuratorData.route == 'Customisable design') {\n      designMode.mode = \"PREDEFINED_DESIGN\";\n    }\n\n    const params = (new URL(document.location)).searchParams;\n    if (this.configuratorData.configuratorDesignId) {\n        this.configurator.configuratorDesignId = this.configuratorData.configuratorDesignId;\n    } else if (params.has('_configurator_design_id')) {\n        this.configurator.configuratorDesignId = params.get('_configurator_design_id');\n        if (params.has('readOnly')) {\n          designMode = {\n            \"mode\": \"SHARED_DESIGN\",\n            \"readOnly\": true\n          };\n        }\n        if (this.configuratorData.cart) {\n            const cartVariants = this.configuratorData.cart.variants.filter(variant => variant._configurator_design_id === params['_configurator_design_id']);\n            this.configuratorData.product.variants.map(variant => {\n                const cartVariant = cartVariants.find( v => v.id == variant.id );\n                if (cartVariant) {\n                    variant.selectedQuantity = parseInt(cartVariant.selectedQuantity);\n                }\n                return variant;\n            });\n        }\n    }\n    this.configurator.designMode = designMode;\n\n    try {\n      const cart = await fetch('/cart.js');\n      const cartJson = await cart.json();\n      const url = window.location.href;\n      const urlObj = new URL(url);\n      const params = new URLSearchParams(urlObj.search);\n      const configuratorDesignId =  params.get('_configurator_design_id');\n      if (configuratorDesignId !== null) {\n        const isItemInCart = cartJson.items.some(item => item.properties._configurator_design_id === configuratorDesignId);\n        this.configurator.fromCart = isItemInCart;\n      }\n    } catch (error) {\n      console.error('Error fetching cart contents:', error);\n    }\n}\n\n\n  getConfiguratorData() {\n      this.configuratorData = this.configuratorData || JSON.parse(this.querySelector('[type=\"application/json\"]').textContent);\n      return this.configuratorData;\n  }\n  updateConfiguratorData(updatedValues) {    \n    this.configuratorData = this.getConfiguratorData();\n    this.configuratorData = this.mergeDeep(this.configuratorData, updatedValues);\n  }\n  designIdUpdate(ev) {\n    if ('product' == this.dataset.page) {\n      let path = window.location.href.split('?')[0]\n      let currentHash = window.location.hash;\n      let params = (new URL(document.location)).searchParams;\n      params.set('_configurator_design_id', ev.detail);\n      let newUrl = `${path}?${params.toString()}${currentHash}`;\n      window.history.replaceState({ }, '', newUrl);\n    }\n  }\n  \n  \nupdateVariantsAfterColorChange(ev){\n  const selectedVariantId = ev.detail.selectedVariants[0].variantId;\n  const colorVariant = this.configuratorData.product.variantsStock.find(variant => variant.globalid === selectedVariantId);\n\n  if (!colorVariant) {\n      console.error('Selected variant not found in variantsStock.');\n      return;\n  }\n\n  const color = colorVariant.color;\n  const translatedColor = colorVariant.translatedColor;\n\n  this.configuratorData.product.productColorTranslation = translatedColor;\n\n  const colorVariants = this.configuratorData.product.variantsStock.filter(variant => variant.color === color);\n  const resultVariants = colorVariants.map(variant => {\n      const variantBeforeColorChange = this.configurator.webShopProduct.variants.find(x => x.size === variant.size);\n      if (variantBeforeColorChange) {\n          variant.selectedQuantity = variantBeforeColorChange.selectedQuantity;\n      }\n      return variant;\n  });\n\n  // Update configurator data\n  this.configuratorData.product.variants = resultVariants;\n  this.configuratorData.product.color = color;\n  this.configurator.webShopProduct.variants = resultVariants;\n\n  // Update URL if not on cart page\n  if (window.location.pathname !== routes.cart_url) {\n      const url = new URL(window.location);\n      const params = new URLSearchParams(document.location.search);\n      url.searchParams.set('_configurator_design_id', params.get('_configurator_design_id'));\n      url.searchParams.set('variant', selectedVariantId);\n      window.history.pushState(null, '', url.toString());\n  }\n}\nformatPrice(price, country) {\n  return country === \"NL\" ? (Shopify.formatMoney(price)).split(' ').reverse().join(' ') : Shopify.formatMoney(price);\n}\ncalculateDiscountedPrice(basePrice, percentage) {\n  return basePrice - (basePrice * (percentage / 100));\n}\n// prepareDiscounts(discounts, productTags, percentage) {\n//   let copyDiscountGroup;\n//   let newBreaks;\n  \n//   discounts.forEach(discountGroup => {\n//       copyDiscountGroup = discountGroup;\n//       if (productTags.includes(discountGroup.tag)) {\n//         newBreaks = discountGroup.breaks.filter(breakItem => breakItem.percentage >= percentage);    \n//         if(percentage != 0) {\n//           newBreaks[0].quantity = 1;\n//         }\n//         copyDiscountGroup.breaks = newBreaks;\n//       }\n//   })\n\n//   return copyDiscountGroup;\n// }\nprepareDiscounts(discounts, productTags, percentage) {\n  let copyDiscountGroup;\n  let newBreaks;\n\n  discounts.forEach(discountGroup => {\n      copyDiscountGroup = { ...discountGroup };\n\n      if (productTags.includes(discountGroup.tag)) {\n          newBreaks = discountGroup.breaks.filter(breakItem => breakItem.percentage >= percentage);\n\n          if (percentage !== 0 && (!newBreaks.length || newBreaks[0].percentage !== percentage)) {\n              newBreaks.unshift({\n                  quantity: 1,\n                  percentage: percentage,\n                  message: `Quantity discount for ${percentage}% off`,\n              });\n          }\n\n          copyDiscountGroup.breaks = newBreaks;\n      }\n  });\n\n  return copyDiscountGroup;\n}\nsetPercentageAndQuantity(ev) {\n  let percentage = this.dataset.percentage ? parseFloat(this.dataset.percentage) : 0;\n  let totalSelectedQuantity = ev.detail.selectedVariants.reduce((sum, variant) => sum + variant.quantity, 0);\n\n  return { percentage, totalSelectedQuantity };\n}\ntoFixed2(num, fixed) {\nconst factor = Math.pow(10, fixed);\n\n// Multiply to shift the decimals, inspect the third and fourth decimals\nconst extended = num * factor * 100; // Extend to inspect the third and fourth decimals\nconst thirdDecimal = Math.floor(extended / 10) % 10; // Extract the third decimal\nconst fourthDecimal = Math.floor(extended) % 10; // Extract the fourth decimal\n\n// If the third decimal is 9 and there is a fourth decimal\nif (thirdDecimal === 9 && fourthDecimal !== 0) {\n  return (Math.ceil(num * factor) / factor).toFixed(fixed);\n}\n\n// Otherwise, truncate the number (round down)\nreturn (Math.floor(num * factor) / factor).toFixed(fixed);\n}\n\n pricingRequested(ev) {      \n  let subtotal= 0;  \n  \n  let oldSubtotal = 0;\n  let discountTotal = 0;\n  let quantityDiscountPerItem = '';\n  let quantityDiscountPerItemPrice = 0;\n  let total = 0;\n  let oldTotal = 0;  \n  let chargesTotalPrintingCharge = 0;\n  let chargesTotalPrintingChargeFunction = 0;  \n  let oldChargesPrintingCharge = 0;\n  let charges = [];  \n\n  let currentBreak = {};\n  let isDiscounted = false;  \n  \n  let { percentage, totalSelectedQuantity } = this.setPercentageAndQuantity(ev);\n  isDiscounted = percentage != 0;\n  \n  this.productTags = (this.dataset.tags) ? JSON.parse(this.dataset.tags) : this.configuratorData.tags;\n  this.configuratorData = this.configuratorData || JSON.parse(this.querySelector('[type=\"application/json\"]').textContent);\n  this.currencySign = this.dataset.currency;\n  \n  const printTechnique =  this.configuratorData.product.printTechnique;\n\n  //Prepare bulk discounts based on percentage from settings \n  let copyDiscountGroup = {};\n  if (this.dataset.discounts) {\n    this.discounts = JSON.parse(this.dataset.discounts);\n    if(this.discounts) {\n      copyDiscountGroup = this.prepareDiscounts(this.discounts, this.productTags, percentage);\n    }\n  }  \n\n  //Update color and variants after change color is triggered\n  this.updateVariantsAfterColorChange(ev)\n\n  this.configuratorData.pricing.discounts = [];\n    \n  if (this.discounts && this.productTags) {\n    var TotalDiscountAllVariants = [];        \n      \n    if (this.productTags.includes(copyDiscountGroup.tag)) {\n        const unreachedBreaks = copyDiscountGroup.breaks.filter(b => b.quantity > totalSelectedQuantity);\n                  \n        if (unreachedBreaks.length > 0) {\n         const nextBreak = unreachedBreaks.reduce((prev, current) => (+prev.quantity < +current.quantity) ? prev : current);                    \n          if (nextBreak) {\n              const nextDiscount =  nextBreak.percentage;\n              const nextDiscountPrice = parseInt(this.configuratorData.variants[0].price + chargesTotalPrintingCharge) * (nextBreak.percentage / 100);\n              const discountDifference = nextBreak.quantity - totalSelectedQuantity;                  \n              let discountMessage = window.discountStrings.messageOne.replace('1', discountDifference);\n              if (discountDifference > 1) {\n                discountMessage = window.discountStrings.messageOther.replace('2', discountDifference);\n              }                \n              this.configuratorData.pricing.discounts.push({\n              type: \"BULK\",                    \n              description: discountMessage.replace('[discount]', nextDiscount + '%'),\n              price: this.formatPrice(nextDiscountPrice, Shopify.country)                 \n            });                            \n          }\n        }\n        const reachedBreaks = copyDiscountGroup.breaks.filter(b => b.quantity <= totalSelectedQuantity);            \n        if (reachedBreaks.length > 0) {\n          currentBreak = reachedBreaks.reduce((prev, current) => (+prev.quantity > +current.quantity) ? prev : current);            \n          if (currentBreak) {\n              percentage = currentBreak.percentage;\n              quantityDiscountPerItem = currentBreak.percentage + '%';\n              isDiscounted = percentage != 0;\n          }\n        }\n      }        \n  }\n\n  if (printTechnique === 'DTF') {\n    this.configuratorData.printingTechnique = \"DTF\";\n      const thresholds = [\n        { max: 250, variant: 'dtf1' },\n        { max: 500, variant: 'dtf2' },\n        { max: 750, variant: 'dtf3' },\n        { max: Infinity, variant: 'dtf4' }\n      ];\n    \n      ev.detail.pricingCalculation.printPositions.forEach((printPosition) => {\n        printPosition.dtf.usedPrintAreasSurfaces.forEach((surface) => {\n          const area = surface.usedAreaSurfaceInMm2/100;\n    \n          const matched = thresholds.find(t => area <= t.max);\n          const variantTitle = matched.variant;\n          const printVariant = this.configuratorData.printing_variants.find(\n            v => v.title.toLowerCase() === variantTitle\n          );\n    \n          if (printVariant) {\n            let printPrice = printVariant.price;      \n            chargesTotalPrintingChargeFunction = chargesTotalPrintingChargeFunction + printPrice;\n            \n            this.printingPrice = chargesTotalPrintingChargeFunction / Shopify.currency.rate;\n            const printPriceCalculated = this.calculateDiscountedPrice(printPrice, percentage);\n            \n            chargesTotalPrintingCharge = chargesTotalPrintingCharge + (percentage != 0 ? printPriceCalculated : printPrice);\n            oldChargesPrintingCharge = oldChargesPrintingCharge + (percentage != 0 ? printVariant.price : 0);\n                      \n            charges.push({\n              type: \"PRINTING_COST\",\n              description: printPosition.name,\n              price: isDiscounted ? this.formatPrice(printPriceCalculated, Shopify.country) : this.formatPrice(printPrice, Shopify.country),\n              oldPrice: isDiscounted ? this.formatPrice(printPrice, Shopify.country) : null            \n            }); \n          }\n        });\n      });\n    } else {\n    this.configuratorData.printingTechnique = \"DTG\";\n      ev.detail.selectedPrintPositions.forEach((printPosition, index) => {\n        const printVariant = this.configuratorData.printing_variants.find(v => v.title.toLowerCase().includes(printPosition.name));\n        if (printVariant) {\n          let printPrice = printVariant.price;      \n          chargesTotalPrintingChargeFunction = chargesTotalPrintingChargeFunction + printPrice;\n          \n          this.printingPrice = chargesTotalPrintingChargeFunction / Shopify.currency.rate;\n          const printPriceCalculated = this.calculateDiscountedPrice(printPrice, percentage);\n          \n          chargesTotalPrintingCharge = chargesTotalPrintingCharge + (percentage != 0 ? printPriceCalculated : printPrice);\n          oldChargesPrintingCharge = oldChargesPrintingCharge + (percentage != 0 ? printVariant.price : 0);\n                    \n          charges.push({\n            type: \"PRINTING_COST\",\n            description: printPosition.name,\n            price: isDiscounted ? this.formatPrice(printPriceCalculated, Shopify.country) : this.formatPrice(printPrice, Shopify.country),\n            oldPrice: isDiscounted ? this.formatPrice(printPrice, Shopify.country) : null            \n          });          \n        }\n      });\n    }\n\n  if(percentage != 0) {\n      var currentDiscountPercentage = percentage  / 100;\n      quantityDiscountPerItemPrice = Number((this.configuratorData.variants[0].price + chargesTotalPrintingChargeFunction) * (currentDiscountPercentage));\n      ev.detail.selectedVariants.forEach(variant => {\n        TotalDiscountAllVariants.push(quantityDiscountPerItemPrice * variant.quantity)\n    });\n  }\n\n  this.configuratorData.pricing.charges = charges;\n\n\n  const calculatePriceIncludingCharges = (basePrice, charges) => basePrice + charges;\n  const totalCharges = chargesTotalPrintingCharge;   \n\n  isDiscounted = percentage != 0;\n  let discountNewTotal = 0;\n  \n  this.configuratorData.pricing.items = Array.from(ev.detail.selectedVariants, variant => {\n    const productVariant = this.configuratorData.product.variantsStock.find(v => v.globalid == variant.variantId);           \n    const variantPrice = productVariant.price;\n    const calculatedPrice = (((productVariant.price - this.toFixed2(((productVariant.price/100) * percentage),2))));\n    \n    variant.price = isDiscounted ? this.formatPrice(calculatedPrice, Shopify.country) : this.formatPrice(variantPrice, Shopify.country);\n    variant.oldPrice = isDiscounted ? this.formatPrice(productVariant.price, Shopify.country) : null;\n    // variant.priceIncludingCharges = this.formatPrice(calculatePriceIncludingCharges(isDiscounted ? calculatedPrice : productVariant.price, totalCharges), Shopify.country);            \n\n    let calculatedPriceIncludingCharges = parseFloat((calculatePriceIncludingCharges(productVariant.price, chargesTotalPrintingChargeFunction)/100)) -  (parseFloat((this.toFixed2(((((productVariant.price + chargesTotalPrintingChargeFunction)/100)/100) * percentage),2))))      \n    variant.priceIncludingCharges = this.formatPrice(calculatedPriceIncludingCharges * 100, Shopify.country);\n    \n    const oldCharges = (oldChargesPrintingCharge || chargesTotalPrintingCharge);    \n    const variantTotal = isDiscounted ? calculatedPrice + totalCharges : productVariant.price + totalCharges;                    \n    let oldVariantTotal = 0;\n    \n    if (variant.oldPrice || oldChargesPrintingCharge !== 0) {\n      oldVariantTotal = (variant.oldPrice ? productVariant.price : calculatedPrice) + (oldChargesPrintingCharge !== 0 ? oldChargesPrintingCharge : chargesTotalPrintingCharge);\n      variant.oldPriceIncludingCharges = this.formatPrice(oldVariantTotal,Shopify.country);\n    } else {\n      variant.oldPriceIncludingCharges = null;\n    }\n\n    let variantSubtotal = ((productVariant.price + chargesTotalPrintingChargeFunction) * variant.quantity) / 100;\n    \n    let discountPerVariant = (((variantSubtotal / variant.quantity)/100).toFixed(4)) * percentage;\n    \n    // if(discountPerVariant.toString().split('.')[1].length <= 3) {\n    //  discountPerVariant = Math.floor(discountPerVariant * 100) / 100;\n    // }\n    const decimalPart = discountPerVariant.toString().split('.')[1];\n    if (!decimalPart || decimalPart.length <= 3) {\n        discountPerVariant = Math.floor(discountPerVariant * 100) / 100;\n    }\n\n    \n    let variantSubtotalDiscounted = discountPerVariant * variant.quantity;  \n    \n    variantSubtotalDiscounted = Math.floor(variantSubtotalDiscounted * 100) / 100;\n    \n    discountNewTotal = discountNewTotal + variantSubtotalDiscounted;          \n    subtotal = subtotal + parseFloat((variantSubtotal-variantSubtotalDiscounted).toFixed(2))\n    oldSubtotal = oldSubtotal + (oldVariantTotal * variant.quantity);\n    \n    return variant;\n  });\n\n  if(TotalDiscountAllVariants) {\n    for (let i = 0; i < TotalDiscountAllVariants.length; i++) {\n      let truncated = TotalDiscountAllVariants[i];\n      discountTotal += (truncated);\n    }\n  }\n\n  discountTotal = discountNewTotal * 100;\n\n\n  total = isDiscounted ? (((oldSubtotal/100) - discountNewTotal)*100) : subtotal * 100;\n  oldTotal = oldSubtotal != 0 ? oldSubtotal : 0;\n  subtotal = subtotal * 100;  \n\n  let freeShippingMinimum = parseInt(this.dataset.freeShipping);\n  let cartTotal = (this.configuratorData.cartTotal !== undefined) ? this.configuratorData.cartTotal : parseInt(this.dataset.cartTotal);\n  const cartProductTotal = (cartTotal + total);\n\n  if (cartProductTotal < freeShippingMinimum) {\n    const shippingDifference = freeShippingMinimum - cartProductTotal;\n    let shippingMessage = window.discountStrings.shippingMessage;\n      this.configuratorData.pricing.discounts.push({\n      type: \"FREE_SHIPPING\",\n      description: shippingMessage.replace('[total]', this.formatPrice(shippingDifference, Shopify.country)),\n      price: this.formatPrice(shippingDifference, Shopify.country)\n    });          \n  }\n\n  this.configuratorData.pricing.subtotal = this.formatPrice(subtotal, Shopify.country);\n  this.configuratorData.pricing.oldSubtotal = oldSubtotal != 0 ? this.formatPrice(oldSubtotal, Shopify.country) : null;\n  this.configuratorData.pricing.total = this.formatPrice(total, Shopify.country);\n  this.configuratorData.pricing.oldTotal = oldTotal != 0 ? this.formatPrice(oldTotal, Shopify.country) : null;\n\n  this.configuratorData.pricing.discountTotal = false;\n  this.configuratorData.pricing.quantityDiscountPerItem = false;\n  if (discountTotal > 0) {                \n      this.configuratorData.pricing.discountTotal = this.formatPrice(discountTotal, Shopify.country);\n      this.configuratorData.pricing.quantityDiscountPerItem  = quantityDiscountPerItem;\n  }\n  this.configuratorData.pricing.priceValue = Math.round(total) / 100;\n  this.configurator.pricing = this.configuratorData.pricing;\n}\n\n  async generateCart(ev) {\n    this.readyToRedirect = false;\n    this.configurator.configuratorDesignId = ev.detail.configuratorDesignId;\n    let designid = ev.detail.configuratorDesignId;\n    await fetch(`${routes.cart_url}.js`)\n      .then((response) => response.json())\n      .then(async (cart) => {\n        this.selectedPrintPositions = ev.detail.selectedPrintPositions;\n        this.selectedVariants = ev.detail.selectedVariants;\n        if (!this.selectedVariants) {\n          this.selectedVariants = this.configuratorData.pricing.items;\n        }\n        const items = this.configuratorData.product.variants.map(item => {\n          const itemVariant = this.selectedVariants.find(selecteditem => selecteditem.variantId == item.globalid);\n          item.quantity = 0;\n          if (itemVariant) {\n            item.orderDesignId = ev.detail.orderDesignId;\n            item.designName = ev.detail.designName;\n            item.smakeVariantId = ev.detail.smakeVariantId;\n            item.quantity = itemVariant.quantity;\n          }\n          return item;\n        });\n        const positions = this.configuratorData.printing_variants.map(position => {\n          const printPosition = this.selectedPrintPositions.find(selectedPosition => position.title.toLowerCase().includes(selectedPosition.name));\n          position.selected = false;\n          if (printPosition) {\n            position.printPositionId = printPosition.id;\n            position.selected = true;\n          }\n          return position;\n        });\n\n        const designId = this.configurator.configuratorDesignId;\n        const cartItemsPositions = cart.items.filter(variant => variant.properties['_configurator_design_id'] === designId);\n\n        const newItems = items.filter(item => item.quantity > 0);\n        const newPositions = positions.filter(position => position.selected);\n\n        if (cartItemsPositions.length !== 0) {\n          let keys = []\n          for (let i = 0; i < cart.items.length; i++) {\n            if (cart.items[i] === cartItemsPositions[0]) {\n              for (let j = 0; j < cartItemsPositions.length; j++, i++) {\n                keys.push(cart.items[i].key)\n              }\n              break\n            }\n          }\n          let updates = {}\n          keys.forEach(key => {\n            updates[key] = 0;\n          });\n          const body = JSON.stringify({\n            updates: updates\n          });\n          await fetch(`${routes.cart_update_url}`, { ...fetchConfig(), ...{ body } })\n            .then((response) => {\n            })\n        }\n        this.readyToRedirect = false;\n\n        if(ev.detail.selectedElements.length > 0) {\n          const variants = this.createItems(newItems, newPositions, true)\n          if (variants.length) {\n            const body = {\n              'items': variants\n            };\n            const config = fetchConfig('json');\n            config.headers['credentials'] = 'same-origin';\n            config.headers['X-Requested-With'] = 'XMLHttpRequest';\n            config.body = JSON.stringify(body);\n            await fetch(`${routes.cart_add_url}.js`, config)\n              .then((response) => response.json())\n              .then((response) => {\n                this.configurator.dispatchEvent(new CustomEvent('cartModified'));\n                if (this.cartItemsToUpdate.length) {\n                  this.updateProperties();\n                }\n                this.readyToRedirect = true;\n              })\n              .catch((e) => {\n                console.error(e);\n              });\n          }\n        }\n        this.readyToRedirect = true;\n      })\n  }\n\n redirect(ev){\n  const redirect=ev.detail.redirect;\n  switch(redirect){\n    case 'HOME':\n    this.redirectHome();\n    break;\n    case 'CART':\n    this.redirectCart();\n    break;\n    case 'NON':\n    break;\n    default : \n    console.log('error in catching redirect field')\n   }\n }\n redirectHome(){\n   if(this.readyToRedirect === true){\n   window.location.href = window.Shopify.routes.root;\n   }\n   else{\n    setTimeout(() => {\n      this.redirectHome();\n    }, 500);\n   }\n  }\n  redirectCart(){\n    if(this.readyToRedirect === true){\n      window.location.href = routes.cart_url;\n      }\n      else{\n       setTimeout(() => {\n         this.redirectCart();\n       }, 500);\n      }\n  }\n  \n   createItems(items, positions, includeItems = false) {\n      const designId = this.configurator.configuratorDesignId;\n      let variants = [];\n      let variant;      \n      let printPrice = this.printingPrice;\n      \n      items.forEach((itemVariant,index) => {        \n          if (includeItems) {\n              const itemVariantId = itemVariant.id == '01387840-8E49-4F17-B3E5-EE4ED76A1C91' ? 7943041417446 : itemVariant.id;\n              variant = {\n                  quantity: itemVariant.quantity,                  \n                  id: itemVariantId,\n                  price: itemVariant.price,\n                  properties: {\n                      '_designName': itemVariant.designName,\n                      '_type': 'configurator_product',\n                      '_configurator_design_id': designId,\n                      '_smake_variant_id': itemVariant.smakeVariantId,\n                      '_order_design_id': itemVariant.orderDesignId,\n                      '_print_positions': this.selectedPrintPositions.map(p => p.id).join(','),\n                      '_print_price': printPrice,\n                    '_print_technique': this.configuratorData.printingTechnique\n                  }\n              };\n              variants.push(variant);\n          }\n      });\n      return variants;\n  }\n\n\n  addNew(newItems, positions, existingItems, newPositions) {\n      const variants = this.createItems(newItems, positions, true).concat(this.createItems(existingItems, newPositions));\n      if (variants.length) {\n          this.cartAdd(variants);\n          return true;\n      }\n      return false;\n  }\n\n  createUpdates(cartItems, cartPositions, existingItems, positions) {\n      const printPositionsIds = this.selectedPrintPositions.map(p => p.id).join(',');\n      let itemsToUpdate = {};\n      cartItems.forEach(cartItem => {\n          if (cartItem.properties._print_positions !== printPositionsIds) {\n              cartItem.properties._print_positions = printPositionsIds;\n              this.cartItemsToUpdate.push(cartItem);\n          }\n          const item = existingItems.find(item => item.id == cartItem.variant_id);\n          if (item) {\n              if (cartItem.quantity !== item.quantity) {\n                  itemsToUpdate[cartItem.key] = item.quantity;\n              }\n              // Find positions in the cart where property line id matches current line item variant id.\n              cartPositions.filter(cartPosition => cartPosition.properties._for_line_item_id == cartItem.variant_id).forEach(cartPosition => {\n                  // Find position variant \n                  const position = positions.find(position => position.id === cartPosition.variant_id);\n                  if (position && !position.selected) {\n                      itemsToUpdate[cartPosition.key] = 0\n                  } else if (cartPosition.quantity !== item.quantity) {\n                      itemsToUpdate[cartPosition.key] = item.quantity;\n                  }\n              });\n          }\n      });\n      return itemsToUpdate;\n  }\n  \n  updateExisting(cartItems, cartPositions, existingItems, positions) {\n      if (existingItems.length) {\n          const items = this.createUpdates(cartItems, cartPositions, existingItems, positions);\n          if (Object.keys(items).length) {\n              this.cartUpdate(items);\n          }\n      }\n  }\n\n  updateProperties() {\n      if (this.cartItemsToUpdate.length) {\n          const cartItem = this.cartItemsToUpdate.shift();\n          const item = {\n              'id': cartItem.key,\n              'properties': cartItem.properties\n          };\n          this.cartChange(item);\n      }\n  }\n\n  cartAdd(preparedItems) {\n      const body = {\n          'items': preparedItems\n      };\n      this.cartAction(routes.cart_add_url, body);\n  }\n\n  cartUpdate(preparedItems) {\n      const body = {\n          'updates': preparedItems\n      };\n      this.cartAction(routes.cart_update_url, body);\n  }\n\n  cartChange(body) {\n      this.cartAction(routes.cart_change_url, body);\n  }\n\n  cartAction(route, body) {\n      const config = fetchConfig('json');\n      config.headers['credentials'] = 'same-origin';\n      config.headers['X-Requested-With'] = 'XMLHttpRequest';\n\n      config.body = JSON.stringify(body);\n\n      fetch(`${route}.js`, config)\n      .then((response) => response.json())\n      .then((response) => {\n          this.configurator.dispatchEvent(new CustomEvent('cartModified'));\n          if (this.cartItemsToUpdate.length) {\n              this.updateProperties();\n          }\n\n      })\n      .catch((e) => {\n          console.error(e);\n      });\n  }\n\n  isObject(item) {\n      return (item && typeof item === 'object' && !Array.isArray(item));\n  }\n  mergeDeep(target, ...sources) {\n      if (!sources.length) return target;\n      const source = sources.shift();\n    \n      if (this.isObject(target) && this.isObject(source)) {\n        for (const key in source) {\n          if (this.isObject(source[key])) {\n            if (!target[key]) Object.assign(target, { [key]: {} });\n            this.mergeDeep(target[key], source[key]);\n          } else {\n            Object.assign(target, { [key]: source[key] });\n          }\n        }\n      }\n    return this.mergeDeep(target, ...sources);\n      \n  }\n}\ncustomElements.define('product-configurator', ProductConfigurator);\n\n\nclass ConfiguratorTrigger extends HTMLElement {\n  constructor() {\n    super();\n    this.addEventListener('click', function(event) {\n      if (this.hasAttribute('disabled')) {\n        event.preventDefault();\n        const tooltipSpan = document.getElementById('tooltip-text');\n        const tooltipText = tooltipSpan ? tooltipSpan.textContent : '';\n        let tooltip = this.querySelector('.tooltip');\n\n        if (!tooltip) {\n          tooltip = document.createElement('div');\n          tooltip.className = 'tooltip';\n          tooltip.textContent = tooltipText;\n          this.appendChild(tooltip);\n        }\n    \n        tooltip.style.display = 'block';\n\n        setTimeout(() => {\n          tooltip.style.display = 'none';\n        }, 3000); // Hide tooltip after 3 seconds\n      } else {\n        this.openConfigurator();\n      }\n    }.bind(this));\n    this.productConfigurator = (this.dataset.configurator) ? document.querySelector('product-configurator[data-section=\"' + this.dataset.configurator + '\"]') : document.querySelector('product-configurator');\n  }\n  async duplicateDesign(dataset) {     \n \n      const designId = dataset.configuratorDesignId;\n      const customerId = dataset.customer ? dataset.customer : localStorage.getItem('usersIds');\n      const baseUrl = window.levi9BaseUrl;\n      const authToken = new AuthToken();\n      let customerIds = window.customerId;\n      let isGuest = !customerIds;      \n      if (designId && customerId && baseUrl) {\n        const url = `${baseUrl}/ProductDesigns/${designId}/duplicate`;\n        // const url = `${baseUrl}/ProductDesigns/${designId}/user/${customerId}/duplicate`;\n  \n        try {\n            const accessToken = await authToken.getToken(); // Wait for the token to resolve\n            console.log('token', accessToken)\n            const response = await fetch(url, {\n                method: \"POST\",\n                headers: {\n                    \"Content-Type\": \"application/json\",\n                    \"x-token\": accessToken,\n                    \"x-customerId\": customerId,\n                },\n                body: JSON.stringify({\n                    id: designId,\n                    customerId: customerId,\n                    name: this.generateGUID(),\n                    anonymous: isGuest\n                }),\n              });\n  \n              if (response.status === 200) {\n                  const newId = await response.json(); // Wait for the response JSON\n                  return newId; // Return the result\n              } else {\n                  console.error(\"Error duplicating design:\", response);\n              }\n          } catch (error) {\n              console.error(\"Error duplicating design:\", error);\n          }\n      } else {\n          console.error(\"Missing required data for duplication.\");\n      }\n      return null; // Return null if something goes wrong\n  }\n   generateGUID() {\n    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n      const r = Math.random() * 16 | 0; // Generate a random number (0-15)\n      const v = c === 'x' ? r : (r & 0x3 | 0x8); // Use r for 'x' and modify for 'y'\n      return v.toString(16); // Convert to hexadecimal\n    });\n  }\n async openConfigurator() {    \n    \n    const dataset = this.dataset;\n    const isFromOrder = this.dataset.source === 'order' && window.location.pathname.includes('/account/orders');\n\n    let activeDesignId = dataset.configuratorDesignId;\n\n     if (isFromOrder && dataset.configuratorDesignId) {\n      let duplicateDesignId = await this.duplicateDesign(dataset);\n      console.log('duplicate design', duplicateDesignId)\n      if(duplicateDesignId) {\n        activeDesignId = duplicateDesignId;\n      }\n    }\n\n    this.productConfigurator = this.productConfigurator || document.querySelector('product-configurator');\n    let currentURL = new URL(window.location.href);\n\n    if (currentURL.pathname.includes(\"saved-designs\")) {\n      currentURL.searchParams.set('variant', dataset.configuratorVariantId);\n      currentURL.searchParams.set('_configurator_design_id', dataset.configuratorDesignId);\n\n      history.replaceState(null, '', currentURL.href);\n    } else if (currentURL.pathname.includes(\"orders\")) {\n      currentURL.searchParams.set('_configurator_design_id', dataset.configuratorDesignId);\n\n      history.replaceState(null, '', currentURL.href);\n    }\n    \n   var myEle = document.getElementById(\"dummy-chat-button-iframe\"); \n   if(myEle) {\n     myEle.style.display = \"none\"\n   } \n    if (dataset.variants) {\n      if (this.productConfigurator.dataset.tags) {\n        this.productConfigurator.dataset.tags = this.dataset.tags;\n      }\n\n      const productTags = dataset.tags;\n      let discountsPerTag = JSON.parse(this.productConfigurator.dataset.productDiscounts);\n      if(discountsPerTag) {\n        discountsPerTag = discountsPerTag.split(',');\n        }else {\n      discountsPerTag = [];\n      }\n      let highestDiscount = 0;\n      \n      discountsPerTag.forEach(discount => {\n        const [discountTag, discountValueStr] = discount.split(':');\n        const discountValue = parseFloat(discountValueStr);\n        \n        if (productTags.includes(discountTag) || discountTag === \"ALL\") {          \n          if (discountValue > highestDiscount) {            \n            highestDiscount = discountValue;\n          }\n        }\n      });      \n      this.productConfigurator.dataset.percentage = highestDiscount;\n\n      const variants = JSON.parse(dataset.variants);\n      const productType = JSON.parse(dataset.productType);\n      const product_variants = JSON.parse(dataset.productVariants);\n      const variantsOnStock = JSON.parse(dataset.productVariantsstock)\n      const premiumGraphicProduct = JSON.parse(dataset.productPremiumgraphic)\n      const sizesTableArray = JSON.parse(dataset.productProductimagesizes);\n      const eventData = {\n        bubbles: true,\n        detail: {\n          variants: variants,\n          productHandler: dataset.productHandler,\n          baseShopUrl: dataset.baseShopUrl,\n          configuratorDesignId: activeDesignId,\n          tags:JSON.parse(dataset.tags),\n          \n          printing_variants: productType === \"Hoodie\" ?  getHoodieProduct() : getBasePrint(),\n          product: {\n            productSizeImageLink: dataset.productProductsizeimagelink,\n            productImageSizes: sizesTableArray,\n            productTranslation: JSON.parse(dataset.productProducttranslation),\n            productColorTranslation: JSON.parse(dataset.productProductcolortranslation),\n            id: dataset.productId,\n            color:  dataset.color,\n            quality: dataset.quality,\n            variants: product_variants,\n            variantsStock: variantsOnStock,\n            premiumGraphic: premiumGraphicProduct\n          }\n        }\n      };\n      this.productConfigurator.dispatchEvent(new CustomEvent('shirtup:configure', eventData));\n    } else {\n      this.productConfigurator.dispatchEvent(new CustomEvent('shirtup:render', { bubbles: true }));\n    }\n  }\n}\ncustomElements.define('configurator-trigger', ConfiguratorTrigger);\n\nclass DiscountMessage extends HTMLElement {\n  constructor() {\n    super();\n    this.productTags = JSON.parse(this.dataset.tags);\n    this.quantity = parseInt(this.dataset.quantity);\n    this.percentage = parseInt(this.dataset.percentage);\n    this.variantPrice = parseInt(this.dataset.price);\n    if (this.dataset.discounts) {\n      this.discounts = JSON.parse(this.dataset.discounts);\n    }\n\n  let copyDiscountGroup;\n  let newBreaks;\n  \n  this.discounts.forEach(discountGroup => {\n    copyDiscountGroup = { ...discountGroup };\n\n    if (this.productTags.includes(discountGroup.tag)) {\n      newBreaks = discountGroup.breaks.filter(breakItem => breakItem.percentage > this.percentage);\n\n      if (this.percentage !== 0 && (!newBreaks.length || newBreaks[0].percentage !== this.percentage)) {\n          newBreaks.unshift({\n              quantity: 1,\n              percentage: this.percentage,\n              message: `Quantity discount for ${this.percentage}% off`,\n          });\n      }\n\n      copyDiscountGroup.breaks = newBreaks;\n    }\n  })\n\n  this.discounts = copyDiscountGroup;\n\n    this.discountCode = parseFloat(this.dataset.discountCode) || 0;\n    this.render();\n  }\n  render() {\n    // if (this.discounts && this.productTags && this.quantity) {\n      // this.discounts.forEach(discountGroup => {\n        \n        if (this.productTags.includes(this.discounts.tag)) {\n            const unreachedBreaks = this.discounts.breaks.filter(b => b.quantity > this.quantity);\n            const reachedBreaks = this.discounts.breaks.filter(b => b.quantity <= this.quantity);\n            \n            if (unreachedBreaks.length > 0) {\n                // const currentBreak = reachedBreaks.reduce((prev, current) => (+prev.quantity > +current.quantity) ? prev : current);\n                //const nextBreak = unreachedBreaks.reduce((prev, current) => (+prev.quantity < +current.quantity) ? prev : current);\n                  let nextBreak = unreachedBreaks.find(b => b.percentage > this.discountCode);\n      \n                  if (!nextBreak) {\n                    nextBreak = unreachedBreaks.reduce((prev, current) => (+prev.quantity < +current.quantity) ? prev : current);\n                  }\n                if (nextBreak) {\n                    const nextDiscount = nextBreak.percentage + '%' ;\n                    const discountDifference = nextBreak.quantity - this.quantity;\n                    \n                    // Discount upsell\n                    let discountMessage = window.discountStrings.messageCartOne.replace('1', discountDifference);\n                    if (discountDifference > 1) {\n                      discountMessage = window.discountStrings.messageCartOther.replace('2', discountDifference);\n                     }\n                    this.innerHTML = discountMessage.replace('[discount]', nextDiscount);\n                }\n            }\n        }\n      // });\n    // }\n  }\n}\ncustomElements.define('discount-message', DiscountMessage);\n\n\nfunction updateSizesArrayFinder(root = document) {\n  const sizes = root.querySelectorAll('.sizes-array-finder');\n  if (!sizes.length) return;\n\n  const order = {\n    XXS: -1, XS: 0, S: 1, M: 2, L: 3, XL: 4, XXL: 5, '3XL': 6, '4XL': 7, '5XL': 8,\n    '06M': 9, '12M': 10, '18M': 11, '23M': 12, '2Y': 13, '4Y': 14, '6Y': 15, '8Y': 16, '10Y': 17, '12Y': 18\n  };\n\n  sizes.forEach(size => {\n    const orderValues = size.getAttribute('data-order');\n    if (!orderValues) return;\n\n    const orders = orderValues.split(',');\n\n    orders.sort((a, b) => {\n      if (!(a in order) && !(b in order)) return 0;\n      if (!(a in order)) return 1;\n      if (!(b in order)) return -1;\n      return order[a] - order[b];\n    });\n\n    if (orders.length > 0) {\n      const firstSpan = size.querySelector('span');\n      if (firstSpan) {\n        firstSpan.textContent = orders[0];\n        if (orders.length > 1) {\n          firstSpan.textContent = `${firstSpan.textContent} - ${orders[orders.length - 2]}`;\n        }\n      }\n    }\n  });\n}\n\nwindow.updateSizesArrayFinder = updateSizesArrayFinder;\nupdateSizesArrayFinder();\n\nvar urlParams = new URLSearchParams(window.location.search);\nvar discountCode = window.discountCode;\nvar country = Shopify.country; \nvar locale = Shopify.locale; \nvar activeMarkets = ['es', 'de', 'fr', 'nl', 'sv', 'pl', 'it'];\nif (!activeMarkets.includes(locale)) {  \n  locale = ''; // Fallback to no locale\n}\n\nif (discountCode) {\n  document.cookie = `discount_code=${discountCode}; path=/`;\n  var discountUrl = locale ? `/${locale}-${country}/discount/${discountCode}` : `/discount/${discountCode}`;\n  var cartUpdateUrl = locale ? `/${locale}-${country}/cart/update.js` : `/cart/update.js`;\n\n  fetch(discountUrl)\n  .then(function(response) {\n    if (!response.ok) {\n      throw new Error('Network response was not ok ' + response.statusText);\n    }\n    return fetch(cartUpdateUrl, {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json'\n      },\n      body: JSON.stringify({\n        updates: {},\n      }),\n    });\n  })\n  .catch(function(error) {\n    console.error('Error:', error);\n  });\n}\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  const accordions = document.querySelectorAll('.accordion_headline');\n\n  accordions.forEach((headline) => {\n    headline.addEventListener('click', function () {\n      const content = this.nextElementSibling;\n\n      // Close all other accordions + reset their icons\n      accordions.forEach((other) => {\n        if (other === this) return;\n\n        const otherContent = other.nextElementSibling;\n        otherContent.style.maxHeight = '0px';\n        otherContent.style.overflow = 'hidden';\n\n        const otherPlus = other.querySelector('.icon--plus');\n        const otherMinus = other.querySelector('.icon--minus');\n        if (otherPlus) otherPlus.classList.remove('hidden');\n        if (otherMinus) otherMinus.classList.add('hidden');\n\n        const otherSingleSvg = other.querySelector('svg'); // if you have rotate icon variant\n        if (otherSingleSvg) otherSingleSvg.classList.remove('accordion_icon_rotate');\n      });\n\n      // Toggle clicked accordion\n      const isClosed = !content.style.maxHeight || content.style.maxHeight === '0px';\n\n      const plusIcon = this.querySelector('.icon--plus');\n      const minusIcon = this.querySelector('.icon--minus');\n\n      if (isClosed) {\n        content.style.maxHeight = content.scrollHeight + 'px';\n        if (plusIcon) plusIcon.classList.add('hidden');\n        if (minusIcon) minusIcon.classList.remove('hidden');\n\n        const singleSvg = this.querySelector('svg');\n        if (singleSvg) singleSvg.classList.add('accordion_icon_rotate');\n      } else {\n        content.style.maxHeight = '0px';\n        if (plusIcon) plusIcon.classList.remove('hidden');\n        if (minusIcon) minusIcon.classList.add('hidden');\n\n        const singleSvg = this.querySelector('svg');\n        if (singleSvg) singleSvg.classList.remove('accordion_icon_rotate');\n      }\n    });\n  });\n});\n\n\n// POPUP FETCHING PAGE WHEN PAGE CONTENT IS EMPTY\nlet items = document.querySelectorAll('.popup-page-fetcher');\nif(items) {\nitems.forEach(item => {\n  item.addEventListener(\"click\", function(event) {\n    try {\n      const opener = event.currentTarget;\n      if (!opener) {\n        throw new Error('Failed to find the modal opener element');\n      }\n\n      var country = Shopify.country;\n      var locale = Shopify.locale;\n      var activeMarkets = ['es', 'de', 'fr', 'nl', 'sv', 'pl', 'it'];\n\n      if (!activeMarkets.includes(locale)) {        \n        locale = ''; // Fallback to no locale\n      }\n\n      const handle = item.dataset.handle;\n\n      const url = locale ? `${window.location.origin}/${locale}-${country}/pages/${handle}` : `${window.location.origin}/pages/${handle}`;\n\n      fetch(url)\n        .then(response => response.text())\n        .then(data => {\n          const parser = new DOMParser();\n          const doc = parser.parseFromString(data, \"text/html\");\n          const hero = doc.getElementById('MainContent')?.innerHTML || '';\n\n          const modalId = opener.getAttribute('data-modal'); // \"#PopupModal-<block.id>\"\n          const modal = document.querySelector(modalId);\n          \n          if (!modal) {\n            throw new Error(`Modal with ID ${modalId} not found`);\n          }\n\n          const modalContent = modal.querySelector(\".product-popup-modal__content-info-content\");\n\n          if (modalContent) {\n            modalContent.innerHTML = hero;\n          } else {\n            throw new Error('Modal content element not found');\n          }\n        })\n        .catch(error => console.error('Error fetching content:', error));\n\n    } catch (error) {\n      console.error('An error occurred:', error);\n    }\n  });\n});\n}\n// class CartWatcher {\n\n//   init() {\n//     this.emitCartChanges().then(() => {\n//       this.observeCartChanges();\n//     });\n//   }\n\n//   async fetchCart() {\n//     const response = await fetch('/cart.js');\n//     return response.json();\n//   }\n\n//   storeCart(cart) {\n//     localStorage.setItem('cart', JSON.stringify(cart));\n//   }\n\n//   storedCart() {\n//     return JSON.parse(localStorage.getItem('cart')) || { items: [] };\n//   }\n\n//   findCartChanges(oldCart, newCart) {\n//     const onlyInLeft = (l, r) => l.filter(li => !r.some(ri => ri.key == li.key));\n//     let result = {\n//       added: onlyInLeft(newCart.items, oldCart.items),\n//       removed: onlyInLeft(oldCart.items, newCart.items),\n//     };\n\n//     oldCart.items.forEach(oi => {\n//       const ni = newCart.items.find(i => i.key == oi.key && i.quantity != oi.quantity);\n//       if (!ni) return;\n//       let quantity = ni.quantity - oi.quantity;\n//       let item = { ...ni };\n//       item.quantity = Math.abs(quantity);\n//       quantity > 0\n//         ? result.added.push(item)\n//         : result.removed.push(item)\n//     });\n\n//     return result;\n//   }\n\n//   removePrintingTypeProduct(cart) {\n//     return cart.items.length > 0 && cart.items.every(item => item.product_type === \"Printing Charge\");\n//   }\n\n//   async clearCart() {\n//     await fetch('/cart/clear.js', { method: 'POST' });\n//   }\n\n//   async emitCartChanges() {\n//     const newCart = await this.fetchCart();\n\n\n\n//     const oldCart = this.storedCart();\n//     const changes = this.findCartChanges(oldCart, newCart);\n\n//     const event = new CustomEvent(\"cart_changed\", { detail: changes });\n//     window.dispatchEvent(event);\n//     if (this.removePrintingTypeProduct(newCart)) {\n//       await this.clearCart(); \n//       location.reload();\n//     }\n//     this.storeCart(newCart);\n//   }\n\n//   observeCartChanges() {\n//     const cartObserver = new PerformanceObserver((list) => {\n//       list.getEntries().forEach((entry) => {\n//         const isValidRequestType = ['xmlhttprequest', 'fetch'].includes(entry.initiatorType);\n//         const isCartChangeRequest = /\\/cart\\//.test(entry.name);\n//         if (isValidRequestType && isCartChangeRequest) {\n//           this.emitCartChanges();\n          \n//         }\n//       });\n//     });\n//     cartObserver.observe({ entryTypes: [\"resource\"] });\n//   }\n// }\n\n// const myCartWatcher = new CartWatcher;\n// myCartWatcher.init();\n// window.addEventListener(\"cart_changed\", e => console.log(e.detail));\nwindow.onload = function() {\n  var nullHash = {\n    'VAT Registration Number': null,  \n  };\n\n  fetch('/cart.js')\n    .then(response => response.json())\n    .then(cart => {\n      var existingAttributes = cart.attributes;\n\n      Object.keys(nullHash).forEach(key => {\n        if (existingAttributes[key]) {\n          existingAttributes[key] = null; \n        }\n      });\n\n      fetch('/cart/update.js', {\n        method: 'POST',\n        headers: {\n          'Content-Type': 'application/json',\n        },\n        body: JSON.stringify({\n          attributes: existingAttributes, \n        }),\n      })\n      .then(response => response.json())\n      .then(updatedCart => {\n        \n        if (updatedCart.attributes['VAT Registration Number'] === null) {\n          console.log('VAT Registration Number has been successfully set to null.');\n        }\n      })\n      .catch(error => {\n        console.error('Error updating cart attributes:', error);\n      });\n    })\n    .catch(error => {\n      console.error('Error fetching cart data:', error);\n    });\n};\n"],
  "mappings": "AAAA,SAAS,qBAAqB,UAAW,CACvC,OAAO,MAAM,KACX,UAAU,iBACR,0KACF,CACF,CACF,CACA,MAAM,kBAAoB,CAAC,EAE3B,SAAS,gBAAgB,eAAiB,KAAM,CAC9C,SAAS,oBAAoB,UAAW,kBAAkB,OAAO,EACjE,SAAS,oBAAoB,WAAY,kBAAkB,QAAQ,EACnE,SAAS,oBAAoB,UAAW,kBAAkB,OAAO,EAE7D,gBAAgB,eAAe,MAAM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