"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[13],{37:(e,t,o)=>{o.d(t,{a:()=>r});var i=o(96),n=o.n(i),c=o(20),a=function(e,t,o,i){return new(o||(o=Promise))((function(n,c){function a(e){try{l(i.next(e))}catch(e){c(e)}}function r(e){try{l(i.throw(e))}catch(e){c(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,r)}l((i=i.apply(e,t||[])).next())}))};const r=(e,t)=>{const o=n()("1XJQADMP2C","f9c73f3989befa962bc850274febefae"),i=null!=e?e:"shopify_products";let r=o.initIndex(i);return{analyticsFilterClick:function({filters:e,fromSearch:t,fromPopularSearches:o,fromRecentSearches:n}){let c="Filter Clicked From PLP";if(o&&(c="Filter Clicked From Popular Searches"),n&&(c="Filter Clicked From Recent Searches"),t&&(c="Filter Clicked From Search"),"undefined"!=typeof window){const t=localStorage.getItem("algoliaQueryID");try{window.aa("clickedFilters",{eventName:c,filters:null==e?void 0:e.filter((e=>""!==e&&!e.includes("compare_at_price"))),index:i,queryID:null!=t?t:""})}catch(e){console.log("Failed to send event to Algolia")}}},askAlgoliaForSearch:function({value:e,filters:t,facetsSearchList:i,filtersListWithOpenForStackGroup:n,isAlgoliaDev:l,device:s}){var d,u;return a(this,void 0,void 0,(function*(){const n=l?"shopify_products_dev":"shopify_products_search";r=o.initIndex(n);const a={facets:i,typoTolerance:!1,distinct:!0,attributesToRetrieve:["id","objectID"],filters:t.join(" AND "),ruleContexts:[l?"search_dev":"search",s]},D=yield Promise.all([r.search(e,Object.assign(Object.assign({},a),{facetingAfterDistinct:!0,typoTolerance:!0,clickAnalytics:!0,analytics:!0}))]),[f]=D,{hits:h,queryID:I="",facets:y,nbHits:b,userData:v}=f,g=h.slice(0,6).map((e=>{const t=r.getObjectPosition(f,e.objectID);return{id:e.id,algoliaObjectID:e.objectID,algoliaQueryID:I,algoliaPosition:t,algoliaIndexName:r.indexName}})),w=null==v?void 0:v.filter((e=>"src"in e&&e.src&&""!==e.src))[0],m=w&&w.src&&""!==w.src?{alt:null!==(d=w.alt)&&void 0!==d?d:"",url:null!==(u=w.url)&&void 0!==u?u:"",src:w.src?(0,c.b)(w.src,600):""}:null,p=h.map((e=>e.objectID)).slice(0,20);return window.aa("convertedObjectIDsAfterSearch",{eventName:"Searched Products By Phrase",index:n,objectIDs:p,queryID:I}),{firstSixResults:g,updatedFacets:y,nbHits:b,banner:m}}))},analyticsAddToCart:function(e,o,n){return a(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const c=localStorage.getItem("algoliaQueryID");try{const{hits:a}=yield r.search(`${e}`,{attributesToRetrieve:["objectID"]});a[0].objectID&&(o?window.aa("convertedObjectIDsAfterSearch",{eventName:"Added to Cart After Search From PDP "+(n?"and Checkout":""),index:i,queryID:null!=c?c:a[0].queryID,objectIDs:[a[0].objectID],currency:null!=t?t:"USD"}):window.aa("convertedObjectIDs",{eventName:"Added to Cart From PDP "+(n?"and Checkout":""),index:i,objectIDs:[a[0].objectID],currency:null!=t?t:"USD",queryID:null!=c?c:a[0].queryID}))}catch(e){console.log("Failed to send event to Algolia")}}}))},analyticsBuyNow:function(e,o){return a(this,void 0,void 0,(function*(){if("undefined"!=typeof window)try{const n=localStorage.getItem("algoliaQueryID"),{hits:c}=yield r.search(`${e}`,{attributesToRetrieve:["objectID"],typoTolerance:!1});o&&c[0].objectID?window.aa("purchasedObjectIDsAfterSearch",{eventName:"Buy Now After Search From PDP",index:i,queryID:null!=n?n:"",objectIDs:[c[0].objectID],currency:null!=t?t:"USD"}):window.aa("purchasedObjectIDs",{eventName:"Buy Now From PDP",index:i,objectIDs:[c[0].objectID],currency:null!=t?t:"USD",queryID:null!=n?n:""})}catch(e){console.log("Failed to send event to Algolia")}}))},analyticsViewProduct:function(e,t,o){return a(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const n=localStorage.getItem("algoliaQueryID");try{const{hits:c}=yield r.search(`${e}`,{attributesToRetrieve:["objectID"]});c[0].objectID&&window.aa("viewedObjectIDs",{eventName:"Viewed Product From "+(t?"Search "+(o?"and Swatch Change":""):o?"Swatch Change":"Other"),index:i,objectIDs:[c[0].objectID],queryID:null!=n?n:""})}catch(e){console.log("Failed to send event to Algolia")}}}))},analyticsCheckout:function(e,o){return a(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const n=e.map((e=>{var t;return`handle:${null===(t=e.url.split("/").pop())||void 0===t?void 0:t.split("?")[0]}`})),c=localStorage.getItem("algoliaQueryID");try{const l=(yield Promise.all(n.map((e=>a(this,void 0,void 0,(function*(){return(yield r.search(`${e}`,{attributesToRetrieve:["objectID"],typoTolerance:!1})).hits[0].objectID})))))).slice(0,e.length);window.aa("purchasedObjectIDs",{eventName:"Checkout "+(o?"From PDP":"From Cart"),index:i,objectIDs:l,currency:null!=t?t:"USD",queryID:null!=c?c:""})}catch(e){console.log("Failed to send event to Algolia")}}}))},analyticsProductClick:function({algoliaObjectID:e,algoliaPosition:t,algoliaIndexName:o,algoliaQueryID:i}){"undefined"!=typeof window&&e&&t&&o&&i&&(window.aa("clickedObjectIDsAfterSearch",{eventName:"Product Clicked",objectIDs:[e],positions:[t],index:o,queryID:i}),localStorage.setItem("algoliaQueryID",i))}}}}}]);