{
  "version": 3,
  "sources": ["/cdn/shop/t/1/assets/recently-viewed-products.js?v=94729125001750262651787334881"],
  "sourcesContent": ["/**\n * Updates the recently viewed products in localStorage.\n */\nexport class RecentlyViewed {\n  /** @static @constant {string} The key used to store the viewed products in session storage */\n  static #STORAGE_KEY = 'viewedProducts';\n  /** @static @constant {number} The maximum number of products to store */\n  static #MAX_PRODUCTS = 4;\n\n  /**\n   * Adds a product to the recently viewed products list.\n   * @param {string} productId - The ID of the product to add.\n   */\n  static addProduct(productId) {\n    let viewedProducts = this.getProducts();\n\n    viewedProducts = viewedProducts.filter((/** @type {string} */ id) => id !== productId);\n    viewedProducts.unshift(productId);\n    viewedProducts = viewedProducts.slice(0, this.#MAX_PRODUCTS);\n\n    localStorage.setItem(this.#STORAGE_KEY, JSON.stringify(viewedProducts));\n  }\n\n  static clearProducts() {\n    localStorage.removeItem(this.#STORAGE_KEY);\n  }\n\n  /**\n   * Retrieves the list of recently viewed products from session storage.\n   * @returns {string[]} The list of viewed products.\n   */\n  static getProducts() {\n    return JSON.parse(localStorage.getItem(this.#STORAGE_KEY) || '[]');\n  }\n}\n"],
  "mappings": "AAGO,aAAM,cAAe,CAE1B,MAAO,aAAe,iBAEtB,MAAO,cAAgB,EAMvB,OAAO,WAAW,UAAW,CAC3B,IAAI,eAAiB,KAAK,YAAY,EAEtC,eAAiB,eAAe,OAA8B,IAAO,KAAO,SAAS,EACrF,eAAe,QAAQ,SAAS,EAChC,eAAiB,eAAe,MAAM,EAAG,KAAK,aAAa,EAE3D,aAAa,QAAQ,KAAK,aAAc,KAAK,UAAU,cAAc,CAAC,CACxE,CAEA,OAAO,eAAgB,CACrB,aAAa,WAAW,KAAK,YAAY,CAC3C,CAMA,OAAO,aAAc,CACnB,OAAO,KAAK,MAAM,aAAa,QAAQ,KAAK,YAAY,GAAK,IAAI,CACnE,CACF",
  "names": []
}
