1import a from"./dist.BZsIy03G.js";import{p as n}from"./dist.D9CZYm7J.js";import{s}from"./dist.CROVOw_2.js";import{n as d}from"./dist.BComLLcB.js";import{L as c}from"./dist.DjwzPvBF.js";import l from"./dist.b3KUJMnc.js";import"./dist.DZcWhOA9.js";import"./dist.VGkhar1Y.js";import"./dist.X1KX6xSZ.js";import"./dist.C_ZQv_f3.js";import"./dist.CRdf-gho.js";import"./dist.B8_nURbH.js";import"./dist.CT3aCfjm.js";import"./dist.Cpj98o6Y.js";import"./dist.BKBaG9rG.js";import"./dist.CG2sRT4b.js";import"./dist.cXLMeLn5.js";const m="recentlyViewedProducts",u=()=>{try{return typeof window<"u"&&window.localStorage}catch{return!1}},p=()=>{if(!u())return[];try{const i=window.localStorage.getItem(m),e=JSON.parse(i);return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{return[]}},f={components:{ProductTile:a},props:{heading:{type:String,required:!1,default:"Recently Viewed"},limit:{type:Number,required:!1,default:12},excludeHandle:{type:String,required:!1,default:""}},data(){return{loaded:!1,recentlyViewedProducts:[]}},created(){this.loadRecentlyViewed()},methods:{async loadRecentlyViewed(){const i=Number.isFinite(this.limit)?this.limit:12,e=p().filter(o=>o&&o!==this.excludeHandle).slice(0,Math.max(i,0));if(!e.length){this.loaded=!0;return}const r=(await Promise.all(e.map(async o=>{try{return await n.load({},{handle:o})}catch{return null}}))).filter(Boolean);this.recentlyViewedProducts=await s(r),this.loaded=!0}}};var _=function(){var e=this,t=e._self._c;return e.loaded&&e.recentlyViewedProducts.length>0?t("div",{staticClass:"recommendations__wrapper"},[e.heading?t("h2",{staticClass:"recommendations__heading heading-lg"},[e._v(" "+e._s(e.heading)+" ")]):e._e(),t("div",{staticClass:"recommendations__product-grid"},e._l(e.recentlyViewedProducts,function(r){return t("product-tile",{key:r.title,attrs:{product:r}})}),1)]):e.loaded?e._e():t("div",[t("div",{staticClass:"placeholder-grid"},e._l(4,function(r){return t("div",{key:r,staticClass:"product-tile product-tile--loading"})}),0)])},y=[],h=d(f,_,y,!1,null,null);const w=h.exports,{template:{name:g}}=window.theme,v=window.theme[g]||{},k={name:"RecommendationsSection",components:{LayersRecommendationsSlider:l,LayersRecommendationsGrid:c,LayersRecentlyViewedGrid:w},data:{context:v}};export{k as default};
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.