import{_ as v,S as H,a as S,r as I,b as w,m as P,f as m,i as s,w as e,V as R,j as C,o,A as f,B as E,z as x,g as r,D as V,E as h,s as d,t as c,F as _,k,G as F,l as p,h as b,N as M,p as N,n as q}from"./index-Bmj_12NV.js";import{P as D}from"./ProductCard-B4PeaMUS.js";import{F as A}from"./Footer-HZwtkbtN.js";import{a as L}from"./alternate-hreflangs-xZGRuUDd.js";import{u as O}from"./index-Dz520mHp.js";import{u as U}from"./vue.f36acd1f-DOct_Vl-.js";const j={name:"Collection",props:["slug"],components:{ProductCard:D,Footer:A},beforeRouteEnter(t,a,i){i(u=>{const l=t.params.locale;H.includes(l)&&(u.$i18n.locale=l,S().$patch({locale:l})),u.$i18n.locale!==null&&t.path.startsWith("/"+u.$i18n.locale)===!1&&(u.$i18n.locale!=="en"||l)?I.push("/"+u.$i18n.locale+"/"+u.$t("routes.collections")+"/"+t.params.slug).catch(()=>{}):i()})},data(){return{show:!1,collection:null,products:[],collections:[],title:"",description:"",keywords:"",image:"",url:"",links:L(this.$router,this.$i18n)}},watch:{slug(t){this.show=!1;let a="https://images.helios.co.uk";w.get("https://api.helios.co.uk/api/collections/"+t).then(i=>{this.collection=i.data.data,this.title=i.data.data.name,this.description=i.data.data.description,this.image=i.data.data.path?"https://images.helios.co.uk/cdn-cgi/image/width=800,quality=85,fit=contain/"+i.data.data.path:"",this.imageSocial=i.data.data.path?a+"/assets/product-social/"+i.data.data.path:"",this.url="https://helios.co.uk"+this.$route.path,this.show=!0,this.$gtag.pageview({page_path:this.$route.path})}).catch(i=>{i.response&&i.response.status===404&&this.$router.push("/404/not-found").catch(()=>{})})}},mounted(){this.$gtag.pageview({page_path:this.$route.path}),document.getElementById("scrolling-content").scrollTop=0,this.url="https://helios.co.uk"+this.$route.path;let t="https://images.helios.co.uk";w.get("https://api.helios.co.uk/api/collections/"+this.slug).then(a=>{this.collection=a.data.data,this.title=a.data.data.name,this.description=a.data.data.description,this.image=a.data.data.path?"https://images.helios.co.uk/cdn-cgi/image/width=800,quality=85,fit=contain/"+a.data.data.path:"",this.imageSocial=a.data.data.path?t+"/assets/product-social/"+a.data.data.path:"",this.addMeta(),this.show=!0,setTimeout(function(){window.prerenderReady=!0},1e3)}).catch(a=>{a.response&&a.response.status===404&&this.$router.push("/404/not-found").catch(()=>{})}),w.get("https://api.helios.co.uk/api/collections").then(a=>{this.collections=a.data.data}).catch(a=>{console.log(a)})},methods:{addMeta(){U({htmlAttrs:{lang:this.locale},link:L(this.$router,this.$i18n)}),O({title:"Helios Homeopathy - "+this.$t("headings.Collections")+" - "+this.title,description:this.description,keywords:this.keywords,ogDescription:this.description,ogTitle:this.name,ogImage:this.imageSocial,ogUrl:this.url,twitterTitle:this.name,twitterDescription:this.description,twitterImage:this.imageSocial,twitterCard:"summary_large_image"})},navigate(t,a){this.$router.push({name:t,params:a})},collectionRoute(t){let a="/";return this.$i18n.locale!=="en"&&(a+=this.$i18n.locale+"/"),a+this.$t("routes.collections")+"/"+t}},computed:{...P(S,["locale"]),breadcrumbs(){let t=[];return t.push({title:this.$t("headings.Shop"),disabled:!1,exact:!0,to:{name:"shop"}}),t.push({title:this.$t("headings.Featured"),disabled:!0,exact:!0,to:{}}),this.collection&&this.collection.name&&t.push({title:this.collection.name,disabled:!0,exact:!0,to:{}}),t}}},z={id:"content"},G={class:"text-h4 mb-6"},W=["innerHTML"],J={class:"subheading-1"};function K(t,a,i,u,l,y){const g=C("router-link"),B=C("ProductCard"),T=C("Footer");return o(),m("div",z,[s(R,null,{default:e(()=>[f("div",null,[s(E,{class:"d-none d-md-block",large:"",items:y.breadcrumbs,divider:">"},null,8,["items"]),s(x,{class:"text-left"},{default:e(()=>[l.collections.length>0?(o(),r(p,{key:0,class:"d-none d-md-block",md:"4",lg:"2"},{default:e(()=>[s(V,{density:"compact",class:"text-left mt-4"},{default:e(()=>[s(h,{class:"text-uppercase text-subtitle-1"},{default:e(()=>[s(g,{class:"no-underline",hreflang:t.$i18n.locale,to:{name:"books"}},{default:e(()=>[d(c(t.$t("headings.Book finder")),1)]),_:1},8,["hreflang"])]),_:1}),s(h,{class:"text-uppercase text-subtitle-1"},{default:e(()=>[s(g,{class:"no-underline",hreflang:t.$i18n.locale,to:{name:"remedies"}},{default:e(()=>[d(c(t.$t("headings.Remedy finder")),1)]),_:1},8,["hreflang"])]),_:1}),s(h,{class:"text-uppercase text-subtitle-1"},{default:e(()=>[s(g,{class:"no-underline",hreflang:t.$i18n.locale,to:{name:"shop"}},{default:e(()=>[d(c(t.$t("headings.Find by category")),1)]),_:1},8,["hreflang"])]),_:1}),s(h,{class:"text-uppercase text-subtitle-1"},{default:e(()=>[s(g,{class:"no-underline",hreflang:t.$i18n.locale,to:{name:"shop"}},{default:e(()=>[d(c(t.$t("headings.Find by brand")),1)]),_:1},8,["hreflang"])]),_:1})]),_:1}),s(V,null,{default:e(()=>[s(h,{class:"text-uppercase"},{default:e(()=>[d(c(t.$t("headings.Featured")),1)]),_:1}),(o(!0),m(_,null,k(l.collections,n=>(o(),r(F,{class:"no-underline",key:n.id,hreflang:t.$i18n.locale,to:y.collectionRoute(n.slug)},{default:e(()=>[d(c(n.name),1)]),_:2},1032,["hreflang","to"]))),128))]),_:1})]),_:1})):b("",!0),s(p,{class:"v-col-xs-12 v-col-md-8"},{default:e(()=>[l.collection?(o(),r(q,{key:0,class:"text-left",flat:"",tile:""},{default:e(()=>[s(M,null,{default:e(()=>[s(x,null,{default:e(()=>[s(p,{cols:"12"},{default:e(()=>[f("h1",G,c(l.collection.name),1),l.collection.path?(o(),r(N,{key:0,contain:"",src:"https://images.helios.co.uk/cdn-cgi/image/width=600,quality=85,fit=contain/"+l.collection.path,srcset:"https://images.helios.co.uk/cdn-cgi/image/width=1200,quality=85,fit=contain/"+l.collection.path+" 2x",class:"mb-3"},null,8,["src","srcset"])):b("",!0),f("div",{class:"text-body-1",innerHTML:l.collection.description},null,8,W)]),_:1})]),_:1}),(o(!0),m(_,null,k(l.collection.products_by_category,n=>(o(),r(x,{key:n.sku},{default:e(()=>[s(p,{cols:"12"},{default:e(()=>[f("h2",J,c(n.name),1)]),_:2},1024),(o(!0),m(_,null,k(n.products,$=>(o(),r(p,{key:$.sku,cols:"12",sm:"6",md:"6"},{default:e(()=>[s(B,{product:$},null,8,["product"])]),_:2},1024))),128))]),_:2},1024))),128))]),_:1})]),_:1})):b("",!0)]),_:1}),l.collection&&l.collection.products_by_brand?(o(),r(p,{key:1,class:"d-xs-none d-sm-none d-lg-block",md:"2"},{default:e(()=>[s(V,null,{default:e(()=>[s(h,{class:"text-uppercase"},{default:e(()=>[d(c(t.$t("headings.Featured"))+" "+c(t.$t("headings.Brands")),1)]),_:1}),(o(!0),m(_,null,k(l.collection.products_by_brand,n=>(o(),r(F,{density:"compact",key:n.id,onClick:$=>y.navigate("brand",{slug:n.slug})},{default:e(()=>[d(c(n.name),1)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})):b("",!0)]),_:1})])]),_:1}),s(T)])}const at=v(j,[["render",K],["__scopeId","data-v-a8a01a62"]]);export{at as default}; //# sourceMappingURL=Collection-DPcuOv5U.js.map