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J,EAAcxC,QAAQyC,KAAO,OAE7B,MAAMC,EAAeF,EAActJ,cAAc,mBACjDwJ,EAAa1C,QAAQyB,UAAY1C,KAAKiB,QAAQyB,UAC9CiB,EAAa1C,QAAQuB,UAAYxC,KAAKiB,QAAQuB,UAC9CmB,EAAa1C,QAAQ2C,OAASC,KAAKC,MAAMhB,UAC3C,EASGhO,eAAeC,IAAI,qBACtBD,eAAeE,OAAO,mBAAoBsO,gB","sources":["webpack://lange/./scripts/sections/add-to-cart-elements/add-to-cart-product/index.ts","webpack://lange/./scripts/sections/add-to-cart-elements/add-to-cart-set/index.ts","webpack://lange/webpack/bootstrap","webpack://lange/./scripts/lib/call-utils.ts","webpack://lange/./scripts/common/liquid-global.ts","webpack://lange/./scripts/sections/modal-cart/modal-cart.ts","webpack://lange/./scripts/sections/modal-cart/cart-service/get-cart.ts","webpack://lange/./scripts/sections/modal-cart/toggle-sub-line-items.ts","webpack://lange/./scripts/sections/modal-cart/cart-service/add-to-cart.ts","webpack://lange/./scripts/lib/update-cart-html.ts","webpack://lange/./scripts/sections/add-to-cart-elements/add-to-cart/index.ts","webpack://lange/./scripts/sections/add-to-cart-elements/add-to-cart/index.scss","webpack://lange/./scripts/sections/add-to-cart-elements/add-to-cart/index.html","webpack://lange/./scripts/sections/add-to-cart-elements/notify-me-button/index.ts","webpack://lange/./scripts/sections/add-to-cart-elements/notify-me-button/index.scss","webpack://lange/./scripts/sections/add-to-cart-elements/notify-me-button/index.html"],"sourcesContent":["/**\n * This is a placeholder element that carries data properties, needed for add to cart functionality\n * It has no functionality.\n */\nclass AddToCartProduct extends HTMLElement {\n  readonly dataset!: {\n    /**\n     * Boolean represented as string representing product availability\n     */\n    available: 'false' | 'true';\n\n    /**\n     * Product ID, a stringified integer\n     */\n    id: string;\n\n    /**\n     * Selected variant ID, a stringified integer\n     */\n    selectedVariantId: string;\n\n    /**\n     * Set subproduct index, a stringified integer started from 0\n     */\n    setIndex: string;\n  };\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'add-to-cart-product': AddToCartProduct;\n  }\n}\n\nif (!customElements.get('add-to-cart-product')) {\n  customElements.define('add-to-cart-product', AddToCartProduct);\n}\n","/**\n * This is a placeholder element that carries data properties, needed for add to cart functionality\n * It has no functionality.\n */\nclass AddToCartSet extends HTMLElement {\n  readonly dataset!: {\n    /**\n     * Set compare at price as cents, a stringified integer number\n     */\n    compareAtPrice: string;\n\n    /**\n     * Set product ID, a stringified integer number\n     */\n    id: string;\n\n    /**\n     * Set image url\n     */\n    imageUrl: string;\n\n    /**\n     * Set name\n     */\n    name: string;\n\n    /**\n     * Set price as cents, a stringified integer number\n     */\n    price: string;\n  };\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'add-to-cart-set': AddToCartSet;\n  }\n}\n\nif (!customElements.get('add-to-cart-set')) {\n  customElements.define('add-to-cart-set', AddToCartSet);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// Keeps track of the timeout timer between the start and end of all calls\nlet timerId: ReturnType<typeof setTimeout>;\n\n/**\n * Called at the beginning of most service operations. This signals to the view that an operation\n * has started.\n *\n * @see http://jdebp.info/FGA/function-perilogues.html\n */\nexport function startCall(...args: any[]) {\n  // This should never happen because we always clear the timeout and set the variable value back\n  // to undefined in the epilogue. This might help debug some screwy things.\n\n  if (typeof timerId !== 'undefined') {\n    window.console.error('concurrent call detected!');\n    window.console.error('[call-utils.ts] args: ', args);\n\n    window.Sentry?.captureException(new Error('Concurrent checkout service call detected'), {\n      extra: {\n        args\n      },\n      level: 'warning'\n    });\n  }\n\n  // Guarantee that the end event will fire by starting a timer.\n  timerId = setTimeout(() => {\n    endCall(false, true);\n  }, 30 * 1000, true);\n\n  const event = new CustomEvent('ofir-cart-call-started', { cancelable: false });\n  dispatchEvent(event);\n}\n\n/**\n * Called at the end of most service operations. This signals to the view that an operation has\n * completed (successfully or not).\n *\n * This is called either manually whenever the operation completed, or automatically, if the\n * operation errored or has not completed after a certain amount of time. We do this to prevent\n * the situation of never firing an end event in case of extremely messed up code. Sometimes that\n * kind of thing happens and we never want to fully lock someone out of cart interactions.\n *\n * @see http://jdebp.info/FGA/function-perilogues.html\n */\nexport function endCall(notifyView = true, didTimeOut = false) {\n  // Unconditionally clear the timeout timer, regardless of whether the timer id is set.\n  clearTimeout(timerId);\n\n  // Reset the timer id. Not really needed but it makes it crystal clear that there is no timer id\n  // active.\n  timerId = undefined;\n\n  // If we got here from a timeout, just make sure something is logged. In theory, nothing ever\n  // times out.\n  if (didTimeOut) {\n    console.warn('epilogue timed out');\n  }\n\n  const event = new CustomEvent('ofir-cart-call-ended', {\n    cancelable: false,\n    detail: {\n      is_timeout: didTimeOut,\n      notify_view: notifyView\n    }\n  });\n\n  dispatchEvent(event);\n}\n","/* eslint-disable @typescript-eslint/naming-convention */\n/**\n * Do not use this export. This is a hacky fix to a strange inlining optimization performed by\n * webpack where it removes this module and points identifiers directly to the global values.\n * Without this export, webpack fails to understand that `window.__ofir` must also be inlined.\n *\n * @type {unknown}\n */\nexport const __ofir: unknown = window.__ofir;\n\n/**\n * Cart should never be undefined\n */\nexport const Cart: OfirLiquidGlobals.Cart = window.__ofir?.Cart;\n\n/**\n * Checkout is undefined if user is not loading a checkout page.\n *\n * @type {OfirLiquidGlobals.Checkout}\n */\nexport const Checkout: OfirLiquidGlobals.Checkout = window.__ofir?.Checkout;\n\n/**\n * Collection is undefined if user is not loading a product or collection page.\n *\n * @type {OfirLiquidGlobals.Collection}\n */\nexport const Collection: OfirLiquidGlobals.Collection = window.__ofir?.Collection;\n\n/**\n * Customer is undefined if user is not logged in.\n *\n * @type {OfirLiquidGlobals.Customer}\n */\nexport const Customer: OfirLiquidGlobals.Customer = window.__ofir?.Customer;\n\n/**\n * GiftCard is undefined if user is not on gift card page.\n *\n * @type {OfirLiquidGlobals.GiftCard}\n */\nexport const GiftCard: OfirLiquidGlobals.GiftCard = window.__ofir?.GiftCard;\n\n/**\n * Order is undefined unless user is on thank_you page, order status page or account/order detail\n * page.\n *\n * @type {OfirLiquidGlobals.Order}\n */\nexport const Order: OfirLiquidGlobals.Order = window.__ofir?.Order;\n\n/** @type {OfirLiquidGlobals.Page} */\nexport const Page: OfirLiquidGlobals.Page = window.__ofir?.Page;\n\n/** @type {OfirLiquidGlobals.Pagination} */\nexport const Pagination: OfirLiquidGlobals.Pagination = window.__ofir?.Pagination;\n\n/**\n * Product is undefined if not accessing a product page template.\n *\n * @type {OfirLiquidGlobals.Product}\n */\nexport const Product: OfirLiquidGlobals.Product = window.__ofir?.Product;\n\n/** @type {OfirLiquidGlobals.Request} */\nexport const Request: OfirLiquidGlobals.Request = window.__ofir?.Request;\n\n/** @type {OfirLiquidGlobals.Scripts} */\nexport const Scripts: OfirLiquidGlobals.Scripts = window.__ofir?.Scripts;\n\n/** @type {OfirLiquidGlobals.Search} */\nexport const Search: OfirLiquidGlobals.Search = window.__ofir?.Search;\n\n/** @type {OfirLiquidGlobals.SearchEngineListing} */\nexport const SearchEngineListing: OfirLiquidGlobals.SearchEngineListing =\n  window.__ofir?.SearchEngineListing;\n\n/** @type {OfirLiquidGlobals.SectionSettings} */\nexport const SectionSettings: OfirLiquidGlobals.SectionSettings = window.__ofir?.SectionSettings;\n\n/** @type {OfirLiquidGlobals.Shop} */\nexport const Shop: OfirLiquidGlobals.Shop = window.__ofir?.Shop;\n\n/** @type {OfirLiquidGlobals.Template} */\nexport const Template: OfirLiquidGlobals.Template = window.__ofir?.Template;\n\n/** @type {OfirLiquidGlobals.Theme} */\nexport const Theme: OfirLiquidGlobals.Theme = window.__ofir?.Theme;\n\n/** @type {OfirLiquidGlobals.ThemeSettings} */\nexport const ThemeSettings: OfirLiquidGlobals.ThemeSettings = window.__ofir?.ThemeSettings;\n","import type * as ajax from '@integrabeauty/shopify-ajax-api';\nimport * as LiquidGlobal from '../../common/liquid-global';\nimport * as CartService from './cart-service';\n\nexport function loadCartModal() {\n  const cartLinkElement = document.getElementById('cart-link');\n  if (!cartLinkElement) {\n    return;\n  }\n\n  const cartModalElement = document.getElementById('cart-modal');\n  if (!cartModalElement) {\n    return;\n  }\n\n  const modalContentElement = cartModalElement.querySelector('.modal-content');\n  if (!modalContentElement) {\n    return;\n  }\n\n  const closeModalElement = cartModalElement.querySelector('.cart__close');\n  if (!closeModalElement) {\n    return;\n  }\n\n  cartLinkElement.addEventListener('click', function (event: Event) {\n    openModal(event);\n    CartService.getCart(false).then((cart: ajax.Cart) => {\n      const detail = <OfirCustomEvents.ViewCartEventDetails>{\n        items: cart.items,\n        source: 'cart-header-icon'\n      };\n      const viewCartEvent = new CustomEvent('ofir-view-cart', {\n        cancelable: false,\n        detail\n      });\n\n      dispatchEvent(viewCartEvent);\n    }).catch(console.error);\n  });\n\n  closeModalElement.addEventListener('click', function onCloseIconClicked(event: Event) {\n    event.preventDefault();\n    toggleSlideAnimation(event);\n  });\n\n  modalContentElement.addEventListener('click', function (event: Event) {\n    if (!closeModalElement.contains(<HTMLElement>event.target)) {\n      event.stopPropagation();\n    }\n  });\n\n  cartModalElement.addEventListener('click', toggleSlideAnimation);\n}\n\nfunction toggleSlideAnimation(event: Event) {\n  event.preventDefault();\n  const cartModalElement = document.getElementById('cart-modal');\n  const modalContentElement = cartModalElement?.querySelector('.modal-content');\n  modalContentElement?.classList.toggle('animate-slide-in-right');\n  modalContentElement?.classList.toggle('animate-slide-out-right');\n  if (modalContentElement?.classList.contains('animate-slide-out-right')) {\n    closeModal(event);\n  }\n}\n\nfunction closeModal(event: Event) {\n  event.preventDefault();\n  const cartModalElement = document.getElementById('cart-modal');\n  cartModalElement?.classList.add('hidden');\n  document.documentElement.setAttribute('style', '');\n  toggleSlideAnimation(event);\n}\n\nexport function openModal(event?: Event) {\n  event?.preventDefault();\n  const cartModalElement = document.getElementById('cart-modal');\n  if (!cartModalElement?.classList.contains('hidden')) {\n    return;\n  }\n\n  cartModalElement.classList.remove('hidden');\n  document.documentElement.setAttribute('style', 'overflow: hidden;');\n\n  const cartModalOpenedEvent = new CustomEvent('cart-modal-opened');\n  dispatchEvent(cartModalOpenedEvent);\n}\n\nfunction updateListeners(event: OfirCustomEvents.CartCallEndedEvent) {\n  if (event.detail.notify_view) {\n    loadCartModal();\n    openModal();\n  }\n}\n\nif (LiquidGlobal.Template.name !== 'cart') {\n  addEventListener('ofir-cart-call-ended', <EventListener>updateListeners);\n  addEventListener('DOMContentLoaded', loadCartModal);\n}\n\ndeclare global {\n  interface WindowEventMap {\n    'cart-modal-opened': CustomEvent;\n  }\n}\n","import type * as ajax from '@integrabeauty/shopify-ajax-api';\nimport * as CallUtils from '../../../lib/call-utils';\n\n/**\n * Utility method to retrieve a users current cart using the provided Shopify Ajax API endpoint.\n *\n * The imported CallUtils methods emit events to notify any view layer logic listening so it can\n * implement any required changes to update the user of the application state. You only need to use\n * these methods if you want the UX/UI to represent and/or provide messaging for the asynchronous\n * request.\n *\n * Since all Shopify cart interaction are done client side asynchronously, there are numorous use\n * cases involving the need for the most up-to-date shopping cart. Examples being after a user adds\n * an item to their cart or changes a quantity. The LiquiGlobal.Cart values would not be accurate,\n * and if required; users should utilize this method with emitStartStop value of false to not\n * interfere with UX/UI operations.\n *\n * @param notifyView passed on to ofir-cart-call-ended event to for view layer listeners (false)\n * @param emitStartStop passed as control to emit start and stop call events (false)\n *\n * @returns cart data\n *\n * @see https://shopify.dev/api/ajax/reference/cart#get-locale-cart-js\n */\nexport async function getCart(notifyView = true, emitStartStop = false) {\n  if (emitStartStop) {\n    CallUtils.startCall('getCart');\n  }\n\n  let response;\n  let cart;\n\n  try {\n    response = await fetch('/cart.js', {\n      method: 'GET',\n      headers: {\n        'Content-Type': 'application/json'\n      }\n    });\n\n    if (!response.ok) {\n      throw new Error(`CartService.getCart Error: ${response.status} ${response.statusText} ` +\n        response.url);\n    }\n\n    cart = <ajax.Cart> await response.json();\n  } catch (error) {\n    window.Sentry?.captureException(error, {\n      extra: {\n        source: 'cart-service-get-cart'\n      }\n    });\n  } finally {\n    if (emitStartStop) {\n      CallUtils.endCall(notifyView);\n    }\n  }\n\n  return cart;\n}\n","export function attachToggleHandlers() {\n  const variantToggles = document.querySelectorAll('.cart-line-item__show-details');\n\n  for (const toggle of variantToggles) {\n    toggle.addEventListener('click', onToggleClicked);\n  }\n}\n\nfunction onToggleClicked(event: Event) {\n  event.preventDefault();\n\n  const element = <HTMLElement>event.currentTarget;\n  const targetId = element.getAttribute('aria-controls');\n  const toggleTarget = document.getElementById(targetId);\n  if (!toggleTarget) {\n    return;\n  }\n\n  toggleTarget.classList.toggle('hidden');\n\n  if (toggleTarget.classList.contains('hidden')) {\n    element.textContent = 'Show Details';\n    element.setAttribute('aria-expanded', 'false');\n  } else {\n    element.textContent = 'Hide Details';\n    element.setAttribute('aria-expanded', 'true');\n  }\n}\n\naddEventListener('DOMContentLoaded', attachToggleHandlers);\n","import * as CallUtils from '../../../lib/call-utils';\nimport updateCartHtml from '../../../lib/update-cart-html';\n\n/**\n * Utilizes the Shopify Ajax API endpoint to add an array of products to a users shopping cart.\n *\n * The imported CallUtils methods emit events to notify any view layer logic listening so it can\n * implement any required changes to update the user of the application state. You only need to use\n * these methods if you want the UX/UI to represent and/or provide messaging for the asynchronous\n * request.\n *\n * @param payload form data to be submitted\n * @param notifyView passed on to ofir-cart-call-ended event to for view layer listeners\n *\n * @returns lineItems cart data\n *\n * @see https://shopify.dev/api/ajax/reference/cart#post-locale-cart-add-js\n */\nexport async function addToCart(payload: ShopifyAjaxApi.AddToCartPayload, notifyView = true) {\n  CallUtils.startCall('addToCart', payload);\n\n  let response;\n  let lineItems;\n  const addedItems = <ShopifyAjaxApi.LineItem[]>[];\n\n  try {\n    const body = JSON.stringify({ ...payload, sections: 'modal-cart' });\n    response = await fetch('/cart/add.js', {\n      method: 'POST',\n      body,\n      headers: {\n        'Content-Type': 'application/json'\n      }\n    });\n\n    if (!response.ok) {\n      throw new Error(`CartService.addToCart Error: ${response.status} ${response.statusText} ` +\n        response.url);\n    }\n\n    lineItems = <ShopifyAjaxApi.AddToCartResponse> await response.json();\n\n    const addedVariantIds = payload.items.map((i: ShopifyAjaxApi.AddToCartItem) => i.id);\n    for (const item of lineItems.items) {\n      if (addedVariantIds.indexOf(item.variant_id) > -1) {\n        const addedItem = payload.items.find(\n          (i: ShopifyAjaxApi.AddToCartItem) => i.id === item.variant_id);\n        addedItems.push({ ...item, quantity: addedItem.quantity });\n        break;\n      }\n    }\n\n    const customEvent = new CustomEvent('ofir-add-to-cart', {\n      cancelable: false,\n      detail: {\n        items: addedItems,\n        modal_cart: lineItems.sections['modal-cart'],\n        success: true\n      }\n    });\n    dispatchEvent(customEvent);\n\n    if (lineItems.sections?.['modal-cart']) {\n      updateCartHtml(lineItems.sections['modal-cart']);\n    }\n\n    if (notifyView) {\n      const detail = <OfirCustomEvents.ViewCartEventDetails>{\n        items: lineItems.items,\n        source: 'add-to-cart-cta'\n      };\n      const viewCartEvent = new CustomEvent('ofir-view-cart', {\n        cancelable: false,\n        detail\n      });\n\n      dispatchEvent(viewCartEvent);\n    }\n  } catch (error) {\n    const detail = <OfirCustomEvents.AddToCartEvent['detail']>{\n      error_code: response.status,\n      error_message: response.statusText,\n      items: addedItems,\n      payload,\n      success: false\n    };\n\n    window.Sentry?.captureException(error, {\n      extra: {\n        ...detail,\n        source: 'cart-service-add-to-cart'\n      }\n    });\n\n    const customEvent = new CustomEvent('ofir-add-to-cart', {\n      cancelable: false,\n      detail\n    });\n\n    dispatchEvent(customEvent);\n  } finally {\n    CallUtils.endCall(notifyView, false);\n  }\n\n  return lineItems;\n}\n\ndeclare global {\n  interface WindowEventMap {\n    'ofir-add-to-cart': OfirCustomEvents.AddToCartEvent;\n  }\n}\n","import * as LiquidGlobals from '../common/liquid-global';\nimport * as ModalCart from '../sections/modal-cart/modal-cart';\nimport * as ToggleSubLineItems from '../sections/modal-cart/toggle-sub-line-items';\n\nexport default function updateCartHtml(html: string) {\n  const element = document.createElement('div');\n  element.innerHTML = html;\n\n  const cartContentElement = element.querySelector('.modal-content');\n  if (!cartContentElement) {\n    return;\n  }\n\n  if (LiquidGlobals.Template.name !== 'cart') {\n    const cartModalElement = document.getElementById('cart-modal');\n    const modalContentElement = cartModalElement?.querySelector('.modal-content');\n    if (!modalContentElement) {\n      return;\n    }\n\n    const modalContentCartHeaderElement = modalContentElement.querySelector('.cart__header');\n    modalContentCartHeaderElement.innerHTML =\n      cartContentElement.querySelector('.cart__header').innerHTML;\n\n    const modalContentCartContentElement = modalContentElement.querySelector('.cart__main');\n    modalContentCartContentElement.innerHTML =\n      cartContentElement.querySelector('.cart__main').innerHTML;\n\n    const cartCount =\n      cartContentElement.querySelector('.cart__header > span').textContent.replace(/\\D+/, '');\n    const cartCounterElement = document.querySelector('#cart-counter');\n    cartCounterElement.textContent = cartCount;\n\n    if (parseInt(cartCount, 10) === 0) {\n      cartCounterElement.classList.add('hidden');\n    } else {\n      cartCounterElement.classList.remove('hidden');\n    }\n  } else {\n    // Update cart content if user landed on cart page\n    const cartPageElement = document.getElementById('cart-page');\n    if (cartPageElement.classList.contains('cart--empty')) {\n      return;\n    }\n\n    const cartPageCartHeaderElement = cartPageElement.querySelector('.cart__header');\n    cartPageCartHeaderElement.innerHTML =\n      cartContentElement.querySelector('.cart__header').innerHTML;\n\n    const cartPageCartContentElement = cartPageElement.querySelector('.cart__main');\n    cartPageCartContentElement.innerHTML =\n      cartContentElement.querySelector('.cart__main').innerHTML;\n  }\n\n  ToggleSubLineItems.attachToggleHandlers();\n  ModalCart.loadCartModal();\n}\n","import type { CustomElement } from '@integrabeauty/custom-elements';\n// TODO this web component shouldn't import anything from another section\nimport * as CartService from '../../modal-cart/cart-service';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * The custom element that handles \"Add to Cart\" functionality.\n *\n * This component relies on <add-to-cart-product> and <add-to-cart-set> placeholder elements passed\n * to the default slot. The <add-to-cart-product> element holds the data of the product that should\n * be added to the cart. The <add-to-cart-set> holds data set's properties.\n *\n * *Regular product:*\n * The product data is held by <add-to-cart-product>. On the \"variant-changed\" event the\n * selected variant ID and availability of the product are updated. When the button clicked the\n * payload object of type ShopifyAjaxApi.AddToCartPayload composed and sent via the CartService.\n * In case the selected variant is unavailable the notify me button should be shown instead of add\n * to cart button.\n *\n * *Set product:*\n * The products data is help by several <add-to-cart-product> elements that should\n * be passed to the default slot. Each represents the product in the bundle. Since the set can\n * consist from similar products the \"data-set-index\" attribute should be set for each\n * <add-to-cart-product> to distinguish products. On the \"variant-changed\" event the selected\n * variant ID and availability of the related product are updated. Also, <add-to-cart-set> should\n * be passed to the default slot. This element holds set properties. When the button clicked the\n * payload object of type ShopifyAjaxApi.AddToCartPayload composed and sent via the CartService. In\n * case any of selected product variant is unavailable the notify me button should be shown instead\n * of add to cart button.\n */\nclass AddToCart extends HTMLElement implements CustomElement {\n  readonly dataset!: {\n    /**\n     * Defines the button variant. Currently, only 'secondary' is supported. Default styles applied\n     * if no value is set.\n     */\n    buttonVariant: 'secondary';\n\n    /**\n     * Represents whether the component for a Sets product.\n     */\n    isSet: 'false' | 'true';\n\n    /**\n     * Represents whether the component for an upsell product.\n     */\n    isUpsell: 'false' | 'true';\n  };\n\n  public shadowRoot!: ShadowRoot;\n  private listenersInitialized = false;\n\n  /**\n   * Indicates the quantity of products to be added to the cart.\n   */\n  private quantity = 1;\n\n  private onAddToCartClickedBound = this.onAddToCartClicked.bind(this);\n  private onVariantChangedBound = this.onVariantChanged.bind(this);\n  private onQuantityChangedBound = this.onQuantityChanged.bind(this);\n\n  public constructor() {\n    super();\n    this.attachShadow({ mode: 'open' });\n    this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n  }\n\n  public connectedCallback() {\n    // call it to set initial component state\n    this.render();\n  }\n\n  public disconnectedCallback() {\n    const addToCart = this.shadowRoot.querySelector('button');\n    addToCart.removeEventListener('click', this.onAddToCartClickedBound);\n\n    removeEventListener('variant-changed', this.onVariantChangedBound);\n    removeEventListener('quantity-input-changed', this.onQuantityChangedBound);\n  }\n\n  private onAddToCartClicked(_event: Event) {\n    const button = this.shadowRoot.querySelector('button');\n    button.disabled = true;\n\n    let payload;\n    if (this.dataset.isSet === 'true') {\n      payload = this.composeSetProductPayload();\n    } else if (this.dataset.isUpsell === 'true') {\n      payload = this.composeUpsellProductPayload();\n    } else {\n      payload = this.composeRegularProductPayload();\n    }\n\n    CartService.addToCart(payload)\n      .catch(error => {\n        throw new Error(<string>error);\n      })\n      .finally(() => {\n        button.disabled = false;\n      });\n  }\n\n  /**\n   * Handle the change in product quantity input.\n   *\n   * At present, this is only relevant for PDP.\n   */\n  private onQuantityChanged(event: WindowEventMap['quantity-input-changed']) {\n    if (event.detail.source === 'pdp') {\n      // We need to update quantity only if the \"quantity-input-changed\" event is fired from a PDP\n      // product details section. This event is also fired from the quantity input in the mini cart.\n      // In this case, we don't need to update the quantity of any <add-to-cart> button, even if the\n      // product ID is the same.\n      const product = this.querySelector(`[data-id=\"${ event.detail.product_id }\"]`);\n      if (product) {\n        this.quantity = event.detail.quantity;\n      }\n    }\n  }\n\n  private composeRegularProductPayload() {\n    const product = this.querySelector('add-to-cart-product');\n    const payload: ShopifyAjaxApi.AddToCartPayload = {\n      items: [\n        {\n          id: parseInt(product.dataset.selectedVariantId, 10),\n\n          // At the moment, there's a quantity selector only on the set PDP. So in this case always\n          // the default value \"1\" will be used.\n          quantity: this.quantity\n        }\n      ]\n    };\n\n    const sellingPlan = getSellingPlan();\n    if (sellingPlan) {\n      payload.items[0].selling_plan = sellingPlan;\n    }\n\n    return payload;\n  }\n\n  private composeUpsellProductPayload() {\n    const product = this.querySelector('add-to-cart-product');\n    const payload: ShopifyAjaxApi.AddToCartPayload = {\n      items: [\n        {\n          id: parseInt(product.dataset.selectedVariantId, 10),\n\n          // At the moment, there's a quantity selector only on the set PDP. So in this case always\n          // the default value \"1\" will be used.\n          quantity: this.quantity,\n          properties: {\n            '_is_upsell': 'true'\n          }\n        }\n      ]\n    };\n\n    const sellingPlan = getSellingPlan();\n    if (sellingPlan) {\n      payload.items[0].selling_plan = sellingPlan;\n    }\n\n    return payload;\n  }\n\n  private composeSetProductPayload() {\n    const products = this.querySelectorAll('add-to-cart-product');\n    const variantIds = [];\n    for (const product of products) {\n      variantIds.push(product.dataset.selectedVariantId);\n    }\n\n    // Compose set properties. This object should be added to each product item in the add to cart\n    // request payload.\n    const setPropertiesElement = this.querySelector('add-to-cart-set');\n    const properties = {\n      'Set': setPropertiesElement.dataset.name,\n      '_is_set': 'true',\n      '_set_product_id': setPropertiesElement.dataset.id,\n      '_set_name': setPropertiesElement.dataset.name,\n      '_set_image_url': setPropertiesElement.dataset.imageUrl,\n      '_set_compare_at_price': setPropertiesElement.dataset.compareAtPrice,\n      '_set_price': setPropertiesElement.dataset.price,\n      _set_variant_ids: variantIds.join(',')\n    };\n\n    // A set can consist of similar products. If the same variants are selected for similar\n    // products, we shouldn't send them as different items but set the appropriate quantity.\n    const variantQuantities: Record<string, number> = {};\n    for (const variantId of variantIds) {\n      if (variantQuantities[variantId]) {\n        variantQuantities[variantId] = variantQuantities[variantId] + 1;\n      } else {\n        variantQuantities[variantId] = 1;\n      }\n    }\n\n    const payload: ShopifyAjaxApi.AddToCartPayload = { items: [] };\n    for (const id in variantQuantities) {\n      payload.items.push({\n        id: parseInt(id, 10),\n        properties,\n        quantity: variantQuantities[id] * this.quantity\n      });\n    }\n\n    return payload;\n  }\n\n  private onVariantChanged(event: WindowEventMap['variant-changed']) {\n    const {\n      id,\n      available,\n      product_id: productId,\n      setIndex\n    } = event.detail.variant;\n\n    let product: HTMLElementTagNameMap['add-to-cart-product'];\n    if (this.dataset.isSet === 'true') {\n      // A set can consist of similar products. We need \"setIndex\" to distinguish them.\n      const selector = `add-to-cart-product[data-id=\"${productId}\"][data-set-index=\"${setIndex}\"]`;\n      product = this.querySelector(selector);\n    } else {\n      product = this.querySelector(`add-to-cart-product[data-id=\"${productId}\"]`);\n    }\n\n    if (!product) {\n      // The \"variant-changed\" event can be dispatched by any variant selector on the page. If the\n      // product element is not found, it means that the variant that had been changed is not\n      // related to this add to cart button.\n      return;\n    }\n\n    product.dataset.selectedVariantId = id.toString();\n    product.dataset.available = available ? 'true' : 'false';\n\n    this.render();\n  }\n\n  /**\n   * Update the availability of the product for displaying either the add to cart button\n   * or the notify me button based on product availability.\n   */\n  private render() {\n    if (!this.listenersInitialized) {\n      this.listenersInitialized = true;\n\n      const addToCart = this.shadowRoot.querySelector('button');\n      addToCart.addEventListener('click', this.onAddToCartClickedBound);\n\n      addEventListener('variant-changed', this.onVariantChangedBound);\n      addEventListener('quantity-input-changed', this.onQuantityChangedBound);\n    }\n\n    const addToCart = this.shadowRoot.querySelector('button');\n    const notifyMe = this.shadowRoot.querySelector('notify-me-button');\n\n    type AddToCartProduct = HTMLElementTagNameMap['add-to-cart-product'];\n\n    // Selecting the first unavailable product. This will be effective with a regular product\n    // containing only one <add-to-cart-product> element and a set with multiple\n    // <add-to-cart-product> elements. If no element is found, it means that the product or set\n    // can be added to the cart.\n    const unavailableProduct =\n      this.querySelector<AddToCartProduct>('add-to-cart-product[data-available=\"false\"]');\n    if (unavailableProduct) {\n      addToCart.hidden = true;\n      notifyMe.hidden = false;\n\n      // Set product ID and variant ID of the unavailable item.\n\n      // TODO: How to handle cases when two or more items of the set are unavailable? Currently,\n      // the data from the first unavailable item is used.\n      notifyMe.dataset.productId = unavailableProduct.dataset.id;\n      notifyMe.dataset.variantId = unavailableProduct.dataset.selectedVariantId;\n    } else {\n      addToCart.hidden = false;\n      notifyMe.hidden = true;\n    }\n  }\n}\n\n/**\n * Retrieves the selected selling plan based on the subscription checkbox and radio button selection\n *\n * TODO Move it out of this custom element. I don't think it should be here, but for now it's more\n * or less a copy-paste of the existing functionality encapsulated in the custom element. We can\n * create a custom element to handle the subscription selector which will dispatch some event that\n * we can handle in this component then.\n */\nfunction getSellingPlan() {\n  const subscribeCheckbox =\n    document.querySelector<HTMLInputElement>('.subscribe-and-save__checkbox');\n  if (!subscribeCheckbox?.checked) {\n    return null;\n  }\n\n  const selectedRadioElement =\n    document.querySelector<HTMLInputElement>('.subscribe-and-save__radio:checked');\n  if (selectedRadioElement) {\n    return parseInt(selectedRadioElement.value, 10);\n  } else {\n    return null;\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'add-to-cart': AddToCart;\n  }\n}\n\nif (!customElements.get('add-to-cart')) {\n  customElements.define('add-to-cart', AddToCart);\n}\n","export default \":host{display:inline-flex;flex-direction:column;font-size:1rem;justify-content:flex-end;min-height:48px;width:100%}:host([data-button-variant=secondary]) button{background-color:#fff;border-color:#000;color:#000}:host([data-button-variant=secondary]) button:active,:host([data-button-variant=secondary]) button:hover{background-color:#f5f5f5;border-color:#1e1e1e}button{align-items:center;background-color:#000;border:1px solid #000;border-radius:0;color:#fff;cursor:pointer;flex-shrink:0;font-family:Poppins,sans-serif;font-size:inherit;font-weight:600;justify-content:center;letter-spacing:.16em;line-height:1;min-height:inherit;padding:10px 16px;text-align:center;text-transform:uppercase;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);white-space:nowrap;width:100%}button:active,button:hover{background-color:#333;border-color:#333}button:focus{outline:2px solid #000;outline-offset:1px}notify-me-button{min-height:inherit}button:disabled{opacity:.6}slot:not([name]){display:none}\";","// Module\nvar code = \"<button>Add to Bag</button><notify-me-button></notify-me-button><slot></slot>\";\n// Exports\nexport default code;","import html from './index.html';\nimport styles from './index.scss';\n\n/**\n * The custom element that is used to show a notify me button that opens a modal when clicked.\n */\nclass NotifyMeButton extends HTMLElement {\n  readonly dataset!: {\n    /**\n     * Product ID, a stringified integer number\n     */\n    productId: string;\n\n    /**\n     * Product variant ID, a stringified integer number\n     */\n    variantId: string;\n  };\n\n  public shadowRoot!: ShadowRoot;\n\n  private onButtonClickedBound = this.onButtonClicked.bind(this);\n\n  public constructor() {\n    super();\n    this.attachShadow({ mode: 'open' });\n    this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n  }\n\n  public connectedCallback() {\n    this.render();\n  }\n\n  public disconnectedCallback() {\n    const button = this.shadowRoot.querySelector('button');\n    button.removeEventListener('click', this.onButtonClickedBound);\n  }\n\n  private render() {\n    const button = this.shadowRoot.querySelector('button');\n    button.addEventListener('click', this.onButtonClickedBound);\n  }\n\n  private onButtonClicked(_event: Event) {\n    type OfirModal = HTMLElementTagNameMap['ofir-modal'];\n    const notifyMeModal = document.querySelector<OfirModal>('.notify-me-modal');\n    notifyMeModal.dataset.open = 'true';\n\n    const modalContent = notifyMeModal.querySelector('notify-me-modal');\n    modalContent.dataset.productId = this.dataset.productId;\n    modalContent.dataset.variantId = this.dataset.variantId;\n    modalContent.dataset.update = Date.now().toString();\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'notify-me-button': NotifyMeButton;\n  }\n}\n\nif (!customElements.get('notify-me-button')) {\n  customElements.define('notify-me-button', NotifyMeButton);\n}\n","export default \":host{display:inline-block;font-size:1rem;min-height:48px;width:100%}button{align-items:center;background-color:#d6d6d6;border:1px solid #d6d6d6;border-radius:0;color:#545454;cursor:pointer;display:inline-flex;font-family:Poppins,sans-serif;font-size:inherit;font-weight:600;justify-content:center;letter-spacing:.16em;line-height:1;min-height:inherit;padding:10px 16px;text-align:center;text-transform:uppercase;transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);white-space:nowrap;width:100%}button:active,button:hover{background-color:#d1d1d1;border-color:#d1d1d1}button:focus{outline:2px solid #000;outline-offset:1px}:host([hidden]){display:none}\";","// Module\nvar code = \"<button>Notify Me</button>\";\n// Exports\nexport default code;"],"names":["AddToCartProduct","HTMLElement","customElements","get","define","AddToCartSet","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","timerId","startCall","_window$Sentry","window","console","error","_len","arguments","length","args","Array","_key","Sentry","captureException","Error","extra","level","setTimeout","endCall","event","CustomEvent","cancelable","dispatchEvent","notifyView","didTimeOut","clearTimeout","warn","detail","is_timeout","notify_view","__ofir","_window$__ofir","Cart","_window$__ofir2","Checkout","_window$__ofir3","Collection","_window$__ofir4","Customer","_window$__ofir5","GiftCard","_window$__ofir6","Order","_window$__ofir7","Page","_window$__ofir8","Pagination","_window$__ofir9","Product","_window$__ofir0","Request","_window$__ofir1","Scripts","_window$__ofir10","Search","_window$__ofir11","SearchEngineListing","_window$__ofir12","SectionSettings","_window$__ofir13","Shop","Template","_window$__ofir14","_window$__ofir15","Theme","_window$__ofir16","ThemeSettings","loadCartModal","cartLinkElement","document","getElementById","cartModalElement","modalContentElement","querySelector","closeModalElement","addEventListener","openModal","async","emitStartStop","CallUtils","response","cart","fetch","method","headers","ok","concat","status","statusText","url","json","source","CartService","then","items","viewCartEvent","catch","preventDefault","toggleSlideAnimation","contains","target","stopPropagation","classList","toggle","add","documentElement","setAttribute","closeModal","remove","cartModalOpenedEvent","attachToggleHandlers","variantToggles","querySelectorAll","onToggleClicked","element","currentTarget","targetId","getAttribute","toggleTarget","textContent","addToCart","payload","lineItems","addedItems","_lineItems$sections","body","JSON","stringify","_extends","sections","addedVariantIds","map","i","id","item","indexOf","variant_id","addedItem","find","push","quantity","customEvent","modal_cart","success","html","createElement","innerHTML","cartContentElement","LiquidGlobals","name","cartCount","replace","cartCounterElement","parseInt","cartPageElement","ToggleSubLineItems","ModalCart","updateCartHtml","error_code","error_message","LiquidGlobal","AddToCart","constructor","super","listenersInitialized","onAddToCartClickedBound","this","onAddToCartClicked","bind","onVariantChangedBound","onVariantChanged","onQuantityChangedBound","onQuantityChanged","attachShadow","mode","shadowRoot","connectedCallback","render","disconnectedCallback","removeEventListener","_event","button","disabled","dataset","isSet","composeSetProductPayload","isUpsell","composeUpsellProductPayload","composeRegularProductPayload","finally","product_id","product","selectedVariantId","sellingPlan","getSellingPlan","selling_plan","properties","products","variantIds","setPropertiesElement","imageUrl","compareAtPrice","price","_set_variant_ids","join","variantQuantities","variantId","available","productId","setIndex","variant","selector","toString","notifyMe","unavailableProduct","hidden","subscribeCheckbox","checked","selectedRadioElement","value","NotifyMeButton","onButtonClickedBound","onButtonClicked","notifyMeModal","open","modalContent","update","Date","now"],"sourceRoot":""}