{
  "version": 3,
  "sources": ["/cdn/shop/t/6/assets/events.js?cb=20260407-7"],
  "sourcesContent": ["/**\n * @namespace ThemeEvents\n * @description A collection of theme-specific events that can be used to trigger and listen for changes anywhere in the theme.\n * @example\n * document.dispatchEvent(new VariantUpdateEvent(variant, sectionId, { html }));\n * document.addEventListener(ThemeEvents.variantUpdate, (e) => { console.log(e.detail.variant) });\n */\nexport class ThemeEvents {\n  /** @static @constant {string} Event triggered when a variant is selected */\n  static variantSelected = 'variant:selected';\n  /** @static @constant {string} Event triggered when a variant is changed */\n  static variantUpdate = 'variant:update';\n  /** @static @constant {string} Event triggered when the cart items or quantities are updated */\n  static cartUpdate = 'cart:update';\n  /** @static @constant {string} Event triggered when a cart update fails */\n  static cartError = 'cart:error';\n  /** @static @constant {string} Event triggered when a media (video, 3d model) is loaded */\n  static mediaStartedPlaying = 'media:started-playing';\n  // Event triggered when quantity-selector value is changed\n  static quantitySelectorUpdate = 'quantity-selector:update';\n  /** @static @constant {string} Event triggered when a predictive search is expanded */\n  static megaMenuHover = 'megaMenu:hover';\n  /** @static @constant {string} Event triggered when a zoom dialog media is selected */\n  static zoomMediaSelected = 'zoom-media:selected';\n  /** @static @constant {string} Event triggered when a discount is applied */\n  static discountUpdate = 'discount:update';\n  /** @static @constant {string} Event triggered when changing collection filters */\n  static FilterUpdate = 'filter:update';\n}\n\n/**\n * Event fired when a variant is selected\n * @extends {Event}\n */\nexport class VariantSelectedEvent extends Event {\n  /**\n   * Creates a new VariantSelectedEvent\n   * @param {Object} resource - The new variant object\n   * @param {string} resource.id - The id of the variant\n   */\n  constructor(resource) {\n    super(ThemeEvents.variantSelected, { bubbles: true });\n    this.detail = {\n      resource,\n    };\n  }\n}\n\n/**\n * Event fired after a variant is updated\n * @extends {Event}\n */\nexport class VariantUpdateEvent extends Event {\n  /**\n   * Creates a new VariantUpdateEvent\n   * @param {Object} resource - The new variant object\n   * @param {string} resource.id - The id of the variant\n   * @param {boolean} resource.available - Whether the variant is available\n   * @param {boolean} resource.inventory_management - Whether the variant has inventory management\n   * @param {Object} [resource.featured_media] - The featured media of the variant\n   * @param {string} [resource.featured_media.id] - The id of the featured media\n   * @param {Object} [resource.featured_media.preview_image] - The preview image of the featured media\n   * @param {string} [resource.featured_media.preview_image.src] - The src URL of the preview image\n   * @param {string} sourceId - The id of the element the action was triggered from\n   * @param {Object} data - Additional event data\n   * @param {Document} data.html - The new document fragment for the variant\n   * @param {string} data.productId - The product ID of the updated variant, used to ensure the correct product form is updated\n   * @param {Object} [data.newProduct] - If a new product was loaded as part of the variant update (combined listing)\n   * @param {string} data.newProduct.id - The id of the new product\n   * @param {string} data.newProduct.url - The url of the new product\n   */\n  constructor(resource, sourceId, data) {\n    super(ThemeEvents.variantUpdate, { bubbles: true });\n    this.detail = {\n      resource: resource || null,\n      sourceId,\n      data: {\n        html: data.html,\n        productId: data.productId,\n        newProduct: data.newProduct,\n      },\n    };\n  }\n}\n\n/**\n * Event class for cart additions\n * @extends {Event}\n */\nexport class CartAddEvent extends Event {\n  /**\n   * Creates a new CartAddEvent\n   * @param {Object} [resource] - The new cart object\n   * @param {string} [sourceId] - The id of the element the action was triggered from\n   * @param {Object} [data] - Additional event data\n   * @param {boolean} [data.didError] - Whether the cart operation failed\n   * @param {string} [data.source] - The source of the cart update\n   * @param {string} [data.productId] - The id of the product card that was updated\n   * @param {number} [data.itemCount] - The number of items in the cart\n   * @param {string} [data.variantId] - The id of the product variant that was added\n   * @param {Record<string, string>} [data.sections] - The sections affected by the cart operation\n   */\n  constructor(resource, sourceId, data) {\n    super(CartAddEvent.eventName, { bubbles: true });\n    this.detail = {\n      resource,\n      sourceId,\n      data: {\n        ...data,\n      },\n    };\n  }\n\n  static eventName = ThemeEvents.cartUpdate;\n}\n\n/**\n * Event class for cart updates\n * @extends {Event}\n */\nexport class CartUpdateEvent extends Event {\n  /**\n   * Creates a new CartUpdateEvent\n   * @param {Object} resource - The new cart object\n   * @param {string} sourceId - The id of the element the action was triggered from\n   * @param {Object} [data] - Additional event data\n   * @param {boolean} [data.didError] - Whether the cart operation failed\n   * @param {string} [data.source] - The source of the cart update\n   * @param {string} [data.productId] - The id of the product card that was updated\n   * @param {number} [data.itemCount] - The number of items in the cart\n   * @param {string} [data.variantId] - The id of the product variant that was updated\n   * @param {Record<string, string>} [data.sections] - The sections affected by the cart operation\n   */\n  constructor(resource, sourceId, data) {\n    super(ThemeEvents.cartUpdate, { bubbles: true });\n    this.detail = {\n      resource,\n      sourceId,\n      data: {\n        ...data,\n      },\n    };\n  }\n}\n\n/**\n * Event class for cart errors\n * @extends {Event}\n */\nexport class CartErrorEvent extends Event {\n  /**\n   * Creates a new CartErrorEvent\n   * @param {string} sourceId - The id of the element the action was triggered from\n   * @param {string} message - A message from the server response\n   * @param {Object} description - Description from the server response\n   * @param {Object} errors - Errors from the server response\n   */\n  constructor(sourceId, message, description, errors) {\n    super(ThemeEvents.cartError, { bubbles: true });\n    this.detail = {\n      sourceId,\n      data: {\n        message,\n        errors,\n        description,\n      },\n    };\n  }\n}\n\n/**\n * Event class for quantity-selector updates\n * @extends {Event}\n */\nexport class QuantitySelectorUpdateEvent extends Event {\n  /**\n   * Creates a new QuantitySelectorUpdateEvent\n   * @param {number} quantity - Quantity value\n   * @param {number} [cartLine] - The id of the updated cart line\n   */\n  constructor(quantity, cartLine) {\n    super(ThemeEvents.quantitySelectorUpdate, { bubbles: true });\n    this.detail = {\n      quantity,\n      cartLine,\n    };\n  }\n}\n\n/**\n * Event class for quantity-selector updates\n * @extends {Event}\n */\nexport class DiscountUpdateEvent extends Event {\n  /**\n   * Creates a new DiscountUpdateEvent\n   * @param {Object} resource - The new cart object\n   * @param {string} sourceId - The id of the element the action was triggered from\n   */\n  constructor(resource, sourceId) {\n    super(ThemeEvents.discountUpdate, { bubbles: true });\n    this.detail = {\n      resource,\n      sourceId,\n    };\n  }\n}\n\n/**\n * Event class for media playback starts\n * @extends {Event}\n */\nexport class MediaStartedPlayingEvent extends Event {\n  /**\n   * Creates a new MediaStartedPlayingEvent\n   * @param {HTMLElement} resource - The element containing the video that emitted the event\n   */\n  constructor(resource) {\n    super(ThemeEvents.mediaStartedPlaying, { bubbles: true });\n    this.detail = {\n      resource,\n    };\n  }\n}\n\n/**\n * @typedef {Object} SlideshowSelectEventData\n * @property {number} index\n * @property {string | null} id\n * @property {Element} slide\n * @property {number} previousIndex\n * @property {boolean} userInitiated\n * @property {'select' | 'scroll' | 'drag'} trigger\n */\n\nexport class SlideshowSelectEvent extends Event {\n  /**  @param {SlideshowSelectEventData} data */\n  constructor(data) {\n    super(SlideshowSelectEvent.eventName, { bubbles: true });\n    this.detail = data;\n  }\n\n  /** @type {SlideshowSelectEventData} */\n  detail;\n\n  static eventName = 'slideshow:select';\n}\n\n/**\n * Event class for zoom dialog media selection\n * @extends {Event}\n */\nexport class ZoomMediaSelectedEvent extends Event {\n  /**\n   * Creates a new ZoomMediaSelectedEvent\n   * @param {number} index - The index of the selected media\n   */\n  constructor(index) {\n    super(ThemeEvents.zoomMediaSelected, { bubbles: true });\n    this.detail = {\n      index,\n    };\n  }\n}\n\n/**\n * Event class for mega menu hover being hovered over\n * @extends {Event}\n */\nexport class MegaMenuHoverEvent extends Event {\n  constructor() {\n    super(ThemeEvents.megaMenuHover, { bubbles: true });\n  }\n}\n\n/** Event class for facet filtering updates */\nexport class FilterUpdateEvent extends Event {\n  /** @param {URLSearchParams} queryParams */\n  constructor(queryParams) {\n    super(ThemeEvents.FilterUpdate, { bubbles: true });\n    this.detail = {\n      queryParams,\n    };\n  }\n\n  shouldShowClearAll() {\n    return [...this.detail.queryParams.entries()].filter(([key]) => key.startsWith('filter.')).length > 0;\n  }\n}\n"],
  "mappings": "AAOO,aAAM,WAAY,CAEvB,OAAO,gBAAkB,mBAEzB,OAAO,cAAgB,iBAEvB,OAAO,WAAa,cAEpB,OAAO,UAAY,aAEnB,OAAO,oBAAsB,wBAE7B,OAAO,uBAAyB,2BAEhC,OAAO,cAAgB,iBAEvB,OAAO,kBAAoB,sBAE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