import{d as Ee,u as Be,a as Re,b as Se,c as qe,r as i,o as Me,e as Oe,w as Ue,f as Ve,g as ze,h as d,i as a,j as I,k as y,l as k,m as Fe,F as Ge,n as We,p as je,q as He,s as Ke,_ as Ze,t as Je,v as Qe,x as r,y as Xe,z as Ye,A as et}from"./CLkPlaab.js";import{_ as tt}from"./C33aoMQH.js";import{_ as st}from"./Ch5YvZfo.js";import{u as nt}from"./CNkMGhz2.js";import"./DDp4Oosk.js";import"./suR1rAvS.js";import"./DslTMqll.js";const at=je(tt),lt={key:1,class:"text-center m-20"},ot={key:2},ct={key:0},ut={key:1,class:"mx-auto max-w-screen-lg text-center px-5 mb-20"},it={key:2},ht=Ee({__name:"[slug]",async setup(rt){var M,O,U,V,z,F,G,W,j,H,K,Z,J,Q,X,Y,ee,te,se,ne,ae,le;let h,P;const D=Be(),g=Re(),Ie=Se(),{locale:o,t:Pe}=qe(),$=He(),w=$.public.DOMAIN,L=i([]),N=i([]);Me(async()=>{if(g.query.step==="completed"){const m=D.cart,c=(n,u)=>Ke(n,u),p=n=>{const u=Math.pow(10,n.value.fractionDigits);return n.value.centAmount/u},v=n=>{const u=Math.pow(10,n.fractionDigits);return n.centAmount/u},t=Oe(()=>o.value==="sv-SE"?"SEK":"EUR");m.lineItems.forEach((n,u)=>{N.value.push({item_id:n.productKey,item_name:c(n.name,o.value),affiliation:`Lappset.com/${o.value}`,index:u,price:p(n.price)*n.quantity,currency:t.value,quantity:n.quantity})}),L.value={event:"purchase",ecommerce:{transaction_id:m.id,value:v(m.totalPrice),currency:t.value,affiliation:`Lappset.com/${o.value}`,items:N.value}},D.reset({awsApi:$fetch,locale:o.value})}});let A="";$.public.PREVIEW=="true"&&(A="&preview=true");const{data:e}=([h,P]=Ue(()=>Qe(()=>$fetch(`content-type/${decodeURI(g.params.slug)}?locale=${o.value}&contentType=pageContentPage${A}`,{method:"GET",baseURL:`${$.public.AWS_API_ENDPOINT}/${$.public.AWS_API_ENV}/`}),{watch:[o]},"$Tp5y69NxkZ")),h=await h,P(),h);e.value;const{fields:_}=e.value||{};_!=null&&_.slug&&g.path!==`/${o.value}/${_==null?void 0:_.slug}`&&Ie.push(`${_.locales[o.value]}`);const C=i([]),E=i((O=(M=e==null?void 0:e.value)==null?void 0:M.fields)==null?void 0:O.title),De=i((V=(U=e==null?void 0:e.value)==null?void 0:U.fields)==null?void 0:V.locales),s=i((z=e==null?void 0:e.value)==null?void 0:z.fields);if((G=(F=e==null?void 0:e.value)==null?void 0:F.sys)!=null&&G.id){const m={slug:(W=s.value)!=null&&W.isNotLandable?"":(j=s==null?void 0:s.value)==null?void 0:j.slug,name:E},c=[];let p={},v={};if((K=(H=s==null?void 0:s.value)==null?void 0:H.parentPage)!=null&&K.fields){const t=(J=(Z=s==null?void 0:s.value)==null?void 0:Z.parentPage)==null?void 0:J.fields;if((Q=t==null?void 0:t.parentPage)!=null&&Q.fields){const l=(X=t==null?void 0:t.parentPage)==null?void 0:X.fields;p={slug:l!=null&&l.isNotLandable?"":l==null?void 0:l.slug,name:l==null?void 0:l.title},c.push(p)}v={slug:t!=null&&t.isNotLandable?"":t==null?void 0:t.slug,name:t==null?void 0:t.title},c.push(v)}c.push(m),C.value=c}else C.value=[];const B=Ve((Y=e==null?void 0:e.value)==null?void 0:Y.fields),R=i(B?`https:${B}`:""),S=i((te=(ee=e==null?void 0:e.value)==null?void 0:ee.fields)==null?void 0:te.metaTitle),b=i((ne=(se=e==null?void 0:e.value)==null?void 0:se.fields)==null?void 0:ne.metaDescription),q=i(De),Ne=()=>{const m=[];for(const c in q.value){const p=q.value[c];p!=null&&m.push({rel:"alternate",hreflang:c,href:`${w}/${c}/${p}`})}return m},x=`${S.value?S.value:E.value} ${Pe("| Lappset Group | The world of playgrounds and sports")}`;return nt({title:x,ogTitle:x,twitterTitle:x,ogImage:R.value,twitterImage:R.value,description:b.value,ogDescription:b.value,twitterDescription:b.value,ogUrl:`${w}/${o.value}/${(ae=s==null?void 0:s.value)==null?void 0:ae.slug}`,ogType:"website"}),ze({title:x,meta:[{name:"description",content:b.value}],link:[{rel:"canonical",hid:"canonical",href:`${w}/${o.value}/${(le=s==null?void 0:s.value)==null?void 0:le.slug}`},...Ne()]}),(m,c)=>{var u,T,oe,ce,ue,ie,re,me,pe,_e,de,ve,fe,ye,he,ge,$e,be;const p=at,v=et,t=Ze,l=st,n=Je;return r(),d("div",null,[a(L)&&a(g).query.step=="completed"?(r(),I(p,{key:0,data:a(L)},null,8,["data"])):y("",!0),k(t,null,{default:Fe(()=>[k(v,{"breadcrumbs-list":a(C)},null,8,["breadcrumbs-list"])]),_:1}),(u=a(e))!=null&&u.fields?(r(),d("div",ot,[(T=a(e))!=null&&T.fields&&Object.keys((oe=a(e))==null?void 0:oe.fields).length>0?(r(),d("div",ct,[(ue=(ce=a(e))==null?void 0:ce.fields)!=null&&ue.heroBanner?(r(),I(l,{key:0,type:"layoutHero",data:(re=(ie=a(e))==null?void 0:ie.fields)==null?void 0:re.heroBanner},null,8,["data"])):y("",!0),(pe=(me=a(e))==null?void 0:me.fields)!=null&&pe.content?(r(),d("div",ut,[k(n,{content:(de=(_e=a(e))==null?void 0:_e.fields)==null?void 0:de.content},null,8,["content"])])):y("",!0),(fe=(ve=a(e))==null?void 0:ve.fields)!=null&&fe.sections&&((ge=(he=(ye=a(e))==null?void 0:ye.fields)==null?void 0:he.sections)==null?void 0:ge.length)>0?(r(),d("div",it,[(r(!0),d(Ge,null,We((be=($e=a(e))==null?void 0:$e.fields)==null?void 0:be.sections,(f,Ae)=>{var xe,Te,ke,we,Le,Ce;return r(),I(l,{key:Ae,type:(ke=(Te=(xe=f.sys)==null?void 0:xe.contentType)==null?void 0:Te.sys)!=null&&ke.id?(Ce=(Le=(we=f==null?void 0:f.sys)==null?void 0:we.contentType)==null?void 0:Le.sys)==null?void 0:Ce.id:"",data:f,class:Ye(f.classes)},null,8,["type","data","class"])}),128))])):y("",!0)])):y("",!0)])):(r(),d("div",lt,[k(Xe)]))])}}});export{ht as default};