{
  "version": 3,
  "sources": ["/cdn/shop/t/39/compiled_assets/scripts.js?5=654075930126380652119186707395"],
  "sourcesContent": ["(function() {\n  var __sections__ = {};\n  (function() {\n    for(var i = 0, s = document.getElementById('sections-script').getAttribute('data-sections').split(','); i < s.length; i++)\n      __sections__[s[i]] = true;\n    })();\n    (function() {\n  if (!__sections__[\"featured-collections-custom\"] && !Shopify.designMode) return;\n  try {\n    \n(() => {\n  // Dots y flecha anterior: maja-carousel-dots / maja-carousel-area (maja-product-carousel.js).\n  // Aqu\u00ED solo queda la anal\u00EDtica de la secci\u00F3n.\n\n  // Shopify sustituye el HTML al editar la secci\u00F3n. El ciclo de conexi\u00F3n\n  // reinicializa los observadores y desconecta los anteriores.\n  class MajaFeaturedCollections extends HTMLElement {\n    #abortController;\n    #intersectionObserver;\n    #mutationObserver;\n    #safetyTimeout;\n\n    async connectedCallback() {\n      this.#abortController = new AbortController();\n      const { signal } = this.#abortController;\n      await Promise.resolve();\n      if (signal.aborted || !this.isConnected) return;\n\n      this.#intersectionObserver = new IntersectionObserver(entries => {\n        if (!entries.some(entry => entry.isIntersecting)) return;\n        this.#intersectionObserver.disconnect();\n        const activeItem = this.querySelector('.featured-collections-carousel__item.is-selected');\n        if (!activeItem) return;\n        const cards = activeItem.querySelectorAll('product-card[data-gtag-item-data]');\n        if (cards.length) {\n          this.fireViewItemList(cards);\n          return;\n        }\n        this.#mutationObserver = new MutationObserver(() => {\n          const loadedCards = activeItem.querySelectorAll('product-card[data-gtag-item-data]');\n          if (!loadedCards.length) return;\n          this.#mutationObserver.disconnect();\n          clearTimeout(this.#safetyTimeout);\n          this.fireViewItemList(loadedCards);\n        });\n        this.#mutationObserver.observe(activeItem, { childList: true, subtree: true });\n        this.#safetyTimeout = setTimeout(() => this.#mutationObserver?.disconnect(), 5000);\n      }, { threshold: 0.1 });\n      this.#intersectionObserver.observe(this);\n    }\n\n    disconnectedCallback() {\n      this.#abortController?.abort();\n      this.#intersectionObserver?.disconnect();\n      this.#mutationObserver?.disconnect();\n      clearTimeout(this.#safetyTimeout);\n    }\n\n    fireViewItemList(cards) {\n      if (typeof gtag !== 'function') return;\n      const items = Array.from(cards).map(card => {\n        try {\n          return JSON.parse(card.dataset.gtagItemData);\n        } catch (error) {\n          console.error('[featured-collections] Error parsing gtag-item-data', error, card);\n          return null;\n        }\n      }).filter(Boolean);\n      if (!items.length) return;\n      const listName = this.dataset.analyticsListName\n        || this.querySelector('.featured-collections-navigation button[aria-current=\"true\"]')?.textContent.trim()\n        || 'Featured Collection';\n      gtag('event', 'view_item_list', { ecommerce: null });\n      gtag('event', 'view_item_list', {\n        item_list_id: 'featured-collection-' + this.dataset.sectionId,\n        item_list_name: listName,\n        items\n      });\n    }\n  }\n\n  if (!customElements.get('maja-featured-collections')) {\n    customElements.define('maja-featured-collections', MajaFeaturedCollections);\n  }\n})();\n\n  } catch(e) { console.error(e); }\n})();\n})();\n"],
  "mappings": "CAAC,UAAW,CACV,IAAI,aAAe,CAAC,GACnB,UAAW,CACV,QAAQ,EAAI,EAAG,EAAI,SAAS,eAAe,iBAAiB,EAAE,aAAa,eAAe,EAAE,MAAM,GAAG,EAAG,EAAI,EAAE,OAAQ,IACpH,aAAa,EAAE,CAAC,CAAC,EAAI,EACvB,GAAG,GACF,UAAW,CACd,GAAI,GAAC,aAAa,6BAA6B,GAAK,CAAC,QAAQ,YAC7D,GAAI,EAEL,IAAM,CAML,MAAM,gCAAgC,WAAY,CAChD,iBACA,sBACA,kBACA,eAEA,MAAM,mBAAoB,CACxB,KAAK,iBAAmB,IAAI,gBAC5B,KAAM,CAAE,MAAO,EAAI,KAAK,iBACxB,MAAM,QAAQ,QAAQ,EAClB,SAAO,SAAW,CAAC,KAAK,eAE5B,KAAK,sBAAwB,IAAI,qBAAqB,SAAW,CAC/D,GAAI,CAAC,QAAQ,KAAK,OAAS,MAAM,cAAc,EAAG,OAClD,KAAK,sBAAsB,WAAW,EACtC,MAAM,WAAa,KAAK,cAAc,kDAAkD,EACxF,GA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