PageSourceSearch

https://vierumaki.fi/_nuxt/M0-_d1-t2.js

js vierumaki.fi collected 2026-10-03 22:58:52 UTC 6,118 bytes, 1 lines download raw bytes

1import{n as e}from"./hePW80VL.js";import{a as t}from"./BXUjck09.js";import{D as n,On as r,Qn as i,_ as a,b as o,bt as ee,ct as s,er as c,g as l,it as te,mt as u,nr as d,o as ne,qt as f,v as p,vn as m,y as h,z as g}from"./Ib1jYPSS.js";import{C as _,n as v,w as y}from"./BUba7gzX.js";import{a as b,n as x}from"./DkJnlnrX.js";import{t as S}from"./CQytbKCk.js";import{y as C}from"./AjnSl8m1.js";import{t as w}from"./BJhCPh1k2.js";import{n as T}from"./CkMz2SGH2.js";import{t as E}from"./BC7daipr2.js";import{t as D}from"./DDtiNWCH2.js";import{i as O,n as k,t as re}from"./Do0y-QGb2.js";import{t as A}from"./BDNMzG2s.js";import{t as ie}from"./CzcslFRK.js";import{t as ae}from"./DC5UM4co.js";function j(e,t,n,r){return e==null?[]:(C(t)||(t=t==null?[]:[t]),n=r?void 0:n,C(n)||(n=n==null?[]:[n]),w(e,t,n))}var M=x(`productUpcoming`,{state:()=>({loading:!1,upcomingAvailability:[]}),actions:{async loadAvailability(){let e=k();this.setLoading(!0);let{code:t,classification:n,schema:r}=e.product;if(n!==`category`&&r!==`Active hours`)return!1;try{let e={categoryCode:t,availabilityFilter:{dates:[],numberOfAdults:1,numberOfChildrenOlder:0,numberOfChildrenYounger:0,amount:1}};for(let t=0;t<=6;t++){let n=S.now().plus({day:t}).set(t>0?{hour:0,minute:0,second:0}:{});e.availabilityFilter.dates.push(n.toUTC().toISO())}let n=await E(`vm-view/v1/product/search`,{method:`post`,body:e});this.setAvailability(n)}catch{}this.setLoading(!1)},setLoading(e){if(typeof e!=`boolean`)throw Error(`setLoading payload is not boolean`);this.loading=e},setAvailability(e){let t=j(e,[e=>{let t=new Date(e.product?.attributes?.active_hour_date),n=e.product?.attributes?.active_hour_start_time.split(`:`);return t.setHours(n[0]),t.setMinutes(n[1]),t.getTime()},`asc`]);t=t.splice(0,6),this.upcomingAvailability=t}}}),N=e({default:()=>J}),P={key:0,class:`product-data`},F={key:`content`,class:`page-grid without-gap`},I={class:`block h2 span12`},L={class:`glide__track`,"data-glide-el":`track`},R={class:`glide__slides`},z={class:`image`},B=[`src`],V={class:`date`},H={class:`location`},U={class:`row`},W={class:`price bold`},G={class:`available`},K=[`disabled`,`onClick`],q=[`name`,`aria-label`],oe=[`name`,`aria-label`],J=A({__name:`ProductData`,props:{contentType:{type:String,required:!1,default:`productData`},fields:{type:Object,required:!1,default:()=>({title:``,displayType:`Upcoming Sales`})}},setup(e){let{$bp:x}=t(),{gtm:C}=D(),w=re(),E=k(),A=M(),{product:j,availabilityLoading:N}=b(E),{totalsLoading:J}=b(w),{upcomingAvailability:se,loading:ce}=b(A),Y=m(0),X=m(null),Z,Q=l(()=>se.value.map(e=>{let t=new Date(e.product?.attributes?.active_hour_date),n=e.product?.attributes?.active_hour_start_time.split(`:`);return t.setHours(n[0]),t.setMinutes(n[1]),{type:e.itemType,code:e.product?.code,image:O.parseImage(e.product?.mainImage,2).url,name:e.product?.attributes?.marketing_name,location:e.product?.attributes?.active_hour_location,description:e.product?.attributes?.product_description_short,available:e.availableQuantity,from:t,duration:e.product?.attributes?.active_hour_duration,price:e.price,discountAmount:0}})),le=l(()=>j.value.type===`category`&&j.value.schema===`Active hours`),$=l(()=>({size:x.bps.isDesktop?`xxxl`:`xxl`,code:`slider-arrow`})),ue=l(()=>x.bps.atMostMobile?!(Y.value>=Q.value.length-1):x.bps.isSmallDesktop?!(Y.value>=Q.value.length-2):!(Y.value>=Q.value.length-3));s(()=>{if(A.loadAvailability(),!X.value)return;let e={};e[x.limits.desktop]={perView:2},e[x.limits.largeMobile]={perView:1},Z=new ae(X.value,{bound:!0,perView:3,gap:24,autoplay:!1,hoverpause:!1,keyboard:!1,swipeThreshold:20,breakpoints:e}).mount(),Z.on(`move`,e=>{Y.value=Z.index})}),te(()=>{A.setAvailability([]),X.value?.glide?.destroy()});async function de(e){let t={metadata:{comment:``,amount:e.amount},pagePath:j.value.product_pagePath??j.value.category_pagePath,classification:e?.product?.classification};w.addProduct({type:e.type,productCode:e.code,from:S.fromJSDate(new Date(e.from)),to:S.fromJSDate(new Date(new Date(e.from).getTime()+e.duration*60*1e3)),image:e.image,title:e.name,price:e.price,location:e.location,persons:{...E.persons},discountAmount:e.discountAmount,priceWithoutTax:0,...t}),await w.getTotals(),C().push({event:`add_to_cart`,ecommerce:{items:[O.generateGtmProduct(e,`addToCart`,t.pagePath)]}})}return(t,s)=>r(le)?(u(),o(`div`,P,[n(v,{name:`list`},{default:f(()=>[r(ce)?(u(),p(ie,{key:`loading`,center:!0})):r(Q).length?(u(),o(`div`,F,[a(`h2`,I,d(e.fields.title),1),a(`div`,{ref_key:`slider`,ref:X,class:`content-slider block span12 glide glide--ltr glide--slider glide--swipeable`},[a(`div`,L,[a(`ul`,R,[(u(!0),o(ne,null,ee(r(Q),(e,i)=>(u(),o(`li`,{key:`slide-${i}`,class:`product glide__slide`},[a(`div`,z,[a(`img`,{src:e.image},null,8,B)]),a(`div`,V,d(`${e.from.getDate()} ${t.$t(`month.${e.from.getMonth()}`)} | ${t.$t(`units.time`)} ${r(O).formatTime(e.from)} | ${r(O).duration(e.from,e.to)}`),1),a(`h3`,null,d(e.name),1),a(`div`,H,d(e.location),1),a(`div`,U,[a(`div`,W,d(r(O).formatPrice(e.price)),1),a(`div`,G,[n(T,{size:`l`,code:`checkmark-circle`,class:`green`}),a(`span`,null,d(t.$t(`product.text.available`))+`: `+d(e.available),1)])]),a(`button`,{class:`btn btn-primary`,disabled:r(J)||r(N),onClick:t=>de(e)},d(t.$t(`product.text.addToCart`)),9,K)]))),128))])]),r(Q).length>1?(u(),o(`div`,{key:0,"data-glide-el":`controls`,class:i([`slider-control
1s`,{large:r(x).bps.isDesktop}])},[r(Y)===0?h(``,!0):(u(),o(`button`,{key:0,class:`previous btn btn-plain btn-no-border`,name:t.$t(`cms.previous`),"aria-label":t.$t(`cms.previous`),tabindex:`0`,"data-glide-dir":`<`,onClick:s[0]||=y(e=>r(Z).go(`<`),[`prevent`,`stop`]),onKeydown:s[1]||=_(e=>r(Z).go(`<`),[`enter`])},[n(T,c(g(r($))),null,16)],40,q)),r(ue)?(u(),o(`button`,{key:1,class:`next btn btn-plain btn-no-border`,name:t.$t(`cms.next`),"aria-label":t.$t(`cms.next`),tabindex:`0`,"data-glide-dir":`>`,onClick:s[2]||=y(e=>r(Z).go(`>`),[`prevent`,`stop`]),onKeydown:s[3]||=_(e=>r(Z).go(`>`),[`enter`])},[n(T,c(g(r($))),null,16)],40,oe)):h(``,!0)],2)):h(``,!0)],512)])):h(``,!0)]),_:1})])):h(``,!0)}},[[`__scopeId`,`data-v-6de340e2`]]);export{N as n,J as t};

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.