https://www.bareminerals.com/cdn/shop/t/1716/assets/component-prod…?v=147785917504666092551790177301
1class ProductWearItWithNosto extends HHBaseElement{constructor(){super(),this.version=parseInt(this.dataset.version)||1,this.resultId=this.dataset.resultId,this.$products=[],this.$placementID=this.dataset.id,this.sectionHeadline=this.dataset.sectionHeadline,this.titleRecommended="",this.$container=this.querySelector(".product-wear-it-with__container"),this.$titleContainer=this.querySelector(".product-wear-it-with__title"),this.runNosto=this.runNosto.bind(this),this._generateList=this._generateList.bind(this),this._generateProductCard=this._generateProductCard.bind(this),this.isExpanded=!1,this.handleShowMore=this.handleShowMore.bind(this),this.showMoreButton=this.querySelector(".show-more-button"),this.showMoreButton&&this.showMoreButton.addEventListener("click",this.handleShowMore)}runNosto(){window.__NOSTO_RECOMMENDER__?.getRecommendation().then(response=>{typeof response.recommendations[this.$placementID]<"u"?(this.$products=response.recommendations[this.$placementID].products.filter(product=>!product.tags1.includes("free")),this.titleRecommended=response.recommendations[this.$placementID].title,this.resultId=response.recommendations[this.$placementID].result_id,this.sectionHeadline&&this.$titleContainer?this.$titleContainer.innerHTML=this.sectionHeadline:this.titleRecommended&&this.$titleContainer&&(this.$titleContainer.innerHTML=this.titleRecommended),this.$products.length>0?this.buildBlock():this.remove()):this.remove()})}buildBlock(){const productContainer=this.$container.querySelector(".product-items");if(productContainer.innerHTML=this._generateList(),window.innerWidth<768){const observer=new ResizeObserver(()=>{productContainer.scrollHeight>200&&(this.showMoreButton?.classList.remove("tw-hidden"),observer.disconnect())});observer.observe(productContainer)}}handleShowMore(){const productContainer=this.$container.querySelector(".product-items"),showMoreBackground=this.$container.querySelector(".show-more-background");productContainer.style.setProperty("--product-list-max-height","none"),showMoreBackground.classList.add("tw-hidden"),this.showMoreButton.classList.add("tw-hidden"),this.isExpanded=!0}_generateList(){return`${this.$products.map(this._generateProductCard).join("")}`}_generateProductCard(item,key){const variantId=item?.recommended_sku?.id||item.product_id;let classList;return this.version==2?classList="tw-relative":classList="product-card-small product-card-medium background-color-light-tan relative",` 2 <product-card 3 class="${classList}" 4 hydrate 5 wear-it-with-nosto 6 data-id="${variantId}" 7 product-handle="${item.url.split("/").slice(-1)}" 8 card-size='medium' 9 url-postfix='nosto=${this.resultId}' 10 ></product-card> 11 `}connectedCallback(){this.runNosto(),this.addEventListener("click::add-to-cart",event=>{window.__NOSTO_RECOMMENDER__?.trackAddToCart(event.detail.product_id,this.resultId)}),this.addEventListener("click::quick-shop-toggle",event=>{window.__NOSTO_RECOMMENDER__?.trackProductView(event.detail.product_id,this.resultId)})}}window.customElements.define("product-wear-it-with-nosto",ProductWearItWithNosto); 12//# sourceMappingURL=/cdn/shop/t/1716/assets/component-product-wear-it-with-nosto.js.map?v=147785917504666092551790177301
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.