PageSourceSearch

https://c-audiohellman-production.web.app/_nuxt/B4X2ojue.js

js c-audiohellman-production.web.app collected 2026-10-03 12:19:46 UTC 15,021 bytes, 1 lines download raw bytes

1import{a7 as q,u as L,z as A,a as H,k as l,m as d,j as r,n as F,aN as j,y as a,A as K,B as M,F as O,q as lt,x as G,l as _,t as v,v as C,e as Q,O as E,bX as dt,ai as ft,N as tt,f as pt,R as et,r as W,a3 as mt,aI as gt,L as ot,J as nt,K as yt,a6 as ht,aH as vt,T as bt,V as kt}from"./DXADahwW.js";import{u as st}from"./ChREVvNC.js";import{a as _t}from"./CPpUH-jE.js";function Yt(t,o){const{$i18n:c}=L(),s=c?.locale?.value??"fi",f={};return f["Accept-language"]=s,$fetch("/api/products/search",{method:"GET",credentials:"include",query:{customProducts:t,limit:o,locale:s},headers:f})}function te(t){const{$i18n:o}=L(),c=o?.locale?.value??"fi",s={locale:c};t.customProducts&&(s.customProducts=t.customProducts),t.search&&(s.search=t.search),t.limit!==void 0&&(s.limit=t.limit),t.position!==void 0&&(s.position=t.position),t.explodeVariations!==void 0&&(s.explodeVariations=t.explodeVariations),t.categoryId?.length&&(s.categoryId=t.categoryId),t.producer?.length&&(s.producer=t.producer),t.productType?.length&&(s.productType=t.productType),t.stockCodes?.length&&(s.stockCodes=t.stockCodes),t.filters?.length&&(s.filters=JSON.stringify(t.filters)),t.order?.length&&(s.order=JSON.stringify(t.order));const f=new URLSearchParams;for(const[e,p]of Object.entries(s))Array.isArray(p)?p.forEach(w=>f.append(e,String(w))):f.append(e,String(p));if(f.toString().length>1800)return q("/products/search/",{method:"POST",body:JSON.stringify(t)});const n={};return n["Accept-language"]=c,$fetch("/api/products/search",{method:"GET",credentials:"include",query:s,headers:n})}function ee(t){return q(`/products/ratings?code=${encodeURIComponent(t)}`,{method:"GET"})}function oe(t){return q("/products/collection/",{method:"POST",body:JSON.stringify({products:t})})}function ne(){const{$i18n:t}=L(),o=t?.locale?.value??"fi";return $fetch("/api/products/brands",{method:"GET",query:{locale:o}
1,headers:{"Accept-language":o}})}function se(t){return q(`/products/questions?code=${encodeURIComponent(t)}`,{method:"GET"})}function ae(t){return q("/products/alsoproducts/",{method:"POST",body:JSON.stringify({sku:t})})}function re(t){return q("/products/relatedproducts/",{method:"POST",body:JSON.stringify({sku:t})})}function ce(t,o,c,s,f){return q("/products/ratings",{method:"POST",body:JSON.stringify({sku:t,rating:o,title:c,comment:s,nickname:f})})}function ue(t,o,c){return q("/products/questions",{method:"POST",body:JSON.stringify({sku:t,comment:o,email:c})})}function ie(t,o){return q("/stock/notification",{method:"POST",body:JSON.stringify({sku:t,email:o})})}function le(t,o){return q("/stock/contact",{method:"POST",body:JSON.stringify({sku:t,email:o})})}const St=["title"],at=A({__name:"badge",props:{type:{type:String,required:!0}},setup(t){const{t:o}=H(),c=t,s=a(()=>({"os-stock-badge":!0,badge:!0,"badge-success":c.type==="in-stock","badge-danger":c.type==="out-of-stock","badge-warning":c.type==="few-in-stock","badge-info":c.type==="coming"})),f=a(()=>{switch(c.type){case"in-stock":case"few-in-stock":return o("product_in_store");case"out-of-stock":return o("product_not_in_store");case"coming":return o("product_is_coming");default:return""}});return(n,e)=>(l(),d("span",{class:F(r(s)),title:r(f)},[j(n.$slots,"default")],10,St))}}),Tt={class:"list-group"},Ct={class:"store-title flex-grow-1 px-2"},wt={key:0,class:"badge badge-info"},$t={key:1,class:"store-amount"},xt={key:0,class:"list-group-item d-flex align-items-center"},Dt={class:"ml-2"},Ot=A({__name:"complex",props:{stocks:{type:Object,required:!0},unit:{type:Object,required:!0},compact:{type:Boolean,default:!1,required:!1}},setup(t){const{locale:o}=H(),{formatDate:c}=st(),s=K(M,null),f=a(()=>parseInt(String(s?.value?.saldo_coming_date_limit??0))),n=a(()=>{const u=new Date;return u.setDate(u.getDate()+f.value),u});function e(u){const y=new Date(u[0]?.date).setHours(0,0,0,0),h=n.value.setHours(0,0,0,0);return!!(u[0]?.amount>0&&(Number.isNaN(y)||y>=h)||y>=h)}function p(u){const y=u?.[0]?.date??"";return y===""||new Date(y)<new Date?"":c(y)}function w(u){return u.amount>0?u.stockType==="badge:yellow"?"few-in-stock":"in-stock":u.coming.length>0&&e(u.coming)?"coming":"out-of-stock"}return(u,y)=>{const h=at;return l(),d("ul",Tt,[(l(!0),d(O,null,lt(t.stocks.stores,g=>(l(),d("li",{key:g.id,class:F(["list-group-item d-flex align-items-center",{"p-1":t.compact}])},[G(h,{type:w(g)},null,8,["type"]),_("span",Ct,v(g.title[r(o)]),1),g.amount<=0&&e(g.coming)?(l(),d("span",wt,v(u.$t("v1.views.product.comingToStock",{comingDate:p(g.coming)})),1)):g.stockType==="exact"?(l(),d("span",$t,v(g.amount)+" "+v(t.unit.title[r(o)]),1)):C("",!0)],2))),128)),t.stocks.stores.length===0?(l(),d("li",xt,[G(h,{type:"out-of-stock"}),_("span",Dt,v(u.$t("not_in_stock")),1)])):C("",!0)])}}}),qt=["data-saldo-type"],Nt={key:1,class:"badge-content"},It={key:0},Vt={key:0,class:"amount"},Pt={key:0},At={class:"label"},Bt={key:0,class:"amount"},de=A({__name:"stock",props:{product:{type:Object,required:!0},presentation:{type:String,required:!0},showComingDate:{type:Boolean,default:!1},badgeTextInStore:{type:String,default:"in_store"},badgeTextNotInStore:{type:String,default:"not_in_store"},badgeTextComing:{type:String,default:"coming"}},setup(t){const{t:o,te:c}=H(),{formatDate:s}=st(),f=K(M,null),n=t,e=a(()=>n.presentation==="complex"||n.presentation==="complex_compact"),p=a(()=>n.product.stocks.total),w=a(()=>n.product.stocks.stores.some(i=>i?.amount>0)),u=a(()=>parseInt(String(f?.value?.saldo_coming_date_limit??0))),y=a(()=>{const i=new Date;return i.setDate(i.getDate()+u.value),i}),h=i=>{for(const b of i){const S=new Date(b?.coming[0]?.date).setHours(0,0,0,0),$=y.value.setHours(0,0,0,0);if(b?.coming[0]?.amount>0&&(Number.isNaN(S)||S>=$)||S>=$)return!0}return!1},g=i=>i.length>0&&i.every(b=>b.stockType==="exact"),m=i=>i.stores.reduce((b,S)=>{const $=S.coming.find(X=>new Date(X.date).setHours(0,0,0,0)>=y.value.setHours(0,0,0,0));return $&&new Date($.date).setHours(0,0,0,0)<new Date(b.date).setHours(0,0,0,0)?$:b},{date:"9999-12-31"}),D=a(()=>{let i=!1;return n.product.stocks.total<=0&&(i=h(n.product.stocks.stores),!i&&n.product.variations&&n.product.variations.products.length>
10&&n.product.variations.products.forEach(b=>{if(i=h(b.product.stocks.stores),i)return!1})),i}),I=a(()=>{let i=m(n.product.stocks);return n.product.variations&&n.product.variations.products.length>0&&n.product.variations.products.forEach(b=>{const S=m(b.product.stocks);i.date>S.date&&(i=S)}),i}),V=a(()=>I.value&&I.value.date!=="9999-12-31"?s(I.value.date):""),J=a(()=>p.value>0||w.value?n.product.stocks.stockType==="badge:yellow"?"few-in-stock":"in-stock":D.value?"coming":"out-of-stock"),P=a(()=>p.value>0?c(n.badgeTextInStore)?o(n.badgeTextInStore):o("in_store"):D.value?c(n.badgeTextComing)?o(n.badgeTextComing):o("coming"):c(n.badgeTextNotInStore)?o(n.badgeTextNotInStore):o("not_in_store")),U=a(()=>p.value>0?p:D.value?"":p);return(i,b)=>{const S=Ot,$=at;return t.product.stocks.stockType!=="none"&&!t.product.hideStock?(l(),d("div",{key:0,class:"product-saldo d-inline-block","data-saldo-type":t.presentation},[r(e)?(l(),Q(S,{key:0,stocks:t.product.stocks,unit:t.product.unit,compact:t.presentation==="complex_compact"},null,8,["stocks","unit","compact"])):(l(),d("div",Nt,[G($,{type:r(J)},null,8,["type"]),t.presentation==="simple"?(l(),d(O,{key:0},[r(D)&&t.showComingDate?(l(),d("span",It,[r(V)?(l(),d(O,{key:0},[E(v(i.$t("v1.views.product.comingToStock",{comingDate:r(V)})),1)],64)):(l(),d(O,{key:1},[E(v(i.$t("coming")),1)],64))])):(l(),d(O,{key:1},[_("span",{class:F(["label",{"sr-only":t.product.stocks.stockType==="exact"&&r(p)>0}])},v(r(P)),3),g(n.product.stocks.stores)&&r(p)>0?(l(),d("span",Vt,v(r(U)),1)):C("",!0)],64))],64)):t.presentation==="simple_text"?(l(),d(O,{key:1},[r(D)&&t.showComingDate?(l(),d("span",Pt,[r(V)?(l(),d(O,{key:0},[E(v(i.$t("v1.views.product.comingToStock",{comingDate:r(V)})),1)],64)):(l(),d(O,{key:1},[E(v(i.$t("coming")),1)],64))])):(l(),d(O,{key:1},[_("span",At,v(r(P)),1),g(n.product.stocks.stores)&&r(p)>0?(l(),d("span",Bt,"("+v(r(U))+")",1)):C("",!0)],64))],64)):C("",!0)]))],8,qt)):C("",!0)}}}),Rt=["data-animation","data-presentation","aria-labelledby"],Et={class:"modal-content"},jt={key:0,class:"modal-header"},Ht=["id"],Ft=["aria-label"],Jt={class:"modal-body"},Ut={key:1,class:"modal-footer"},fe=A({__name:"dialog",props:{modelValue:{type:Boolean,required:!0},static:{type:Boolean,required:!1,default:!1},animation:{type:String,required:!1,default:"none"},label:{type:String,required:!1,default:""},presentation:{type:String,required:!1,default:"dialog"},scrollable:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(t,{emit:o}){const c=t,s=dt(),f=W(null),n=ft(),e=o,p=a(()=>c.label!==""||!!s.header);function w(){c.modelValue&&e("update:modelValue",!1)}function u(){f.value?.showModal(),e("update:modelValue",!0),y()}function y(){gt(()=>{const m=f.value?.querySelector(`[id="${n}"]`);m&&(m.hasAttribute("tabindex")||m.setAttribute("tabindex","-1"),m.focus())})}function h(){f.value?.close(),e("update:modelValue",!1)}function g(m){!c.static&&m.target===f.value&&h()}return tt(()=>c.modelValue,m=>{m?u():h()}),(m,D)=>{const I=mt;return l(),Q(I,null,{default:pt(()=>[_("dialog",{ref_key:"dialog",ref:f,class:"ui-dialog","data-animation":t.animation,"data-presentation":t.presentation,"aria-labelledby":r(p)?r(n):void 0,onClick:g,onClose:w},[_("div",{class:F(["modal-dialog m-0",{"modal-dialog-scrollable":t.scrollable}])},[_("div",Et,[r(p)?(l(),d("div",jt,[j(m.$slots,"header",{titleId:r(n),close:h},()=>[_("h5",{id:r(n),class:"modal-title"},v(t.label),9,Ht),_("button",{type:"button",class:"close","data-dismiss":"modal","aria-label":m.$t("close"),onClick:et(h,["prevent"])},[...D[0]||(D[0]=[_("span",{"aria-hidden":"true"},"×",-1)])],8,Ft)])])):C("",!0),_("div",Jt,[j(m.$slots,"default")]),r(s).footer?(l(),d("div",Ut,[j(m.$slots,"footer")])):C("",!0)])],2)],40,Rt)]),_:3})}}}),Wt={key:0},pe=A({__name:"price",props:{price:{type:Object,default:null},perX:{type:Object,default:null},unit:{type:Object,default:null},showUnit:{type:Boolean,default:!0},showDefaultUnit:{type:Boolean,default:!1}},setup(t){const o=t,{locale:c,n:s}=H(),{user:f}=ot(nt()),{userVatOn:n}=yt(),e=a(()=>o.perX&&o.perX.amount>1?o.perX:null),p=a(()=>e.value??o.price),w=a(()=>n.value?p.value.valueWithVat:p.value.value),u=a(()=>o?.unit?.title[c.value]??""),y=a(()=>e.value?`${s(e.value.amount)} ${u.value}
1`:u.value),h=a(()=>o.showUnit&&u.value.length>0&&(e.value!==null||o.showDefaultUnit||u.value!=="kpl"&&u.value!=="pcs"));return(g,m)=>r(f)?.rights?.showPrices?(l(),d(O,{key:0},[E(v(g.$n(r(w),"currency"))+" ",1),r(h)?(l(),d("span",Wt,"/ "+v(r(y)),1)):C("",!0)],64)):C("",!0)}}),me=(t,o)=>{const c={value:t.value*o,valueWithVat:parseFloat((t.valueWithVat*o).toFixed(2)),vat:[]};return t.vat.forEach(s=>{c.vat.push({percent:s.percent,amount:parseFloat((s.amount*o).toFixed(2))})}),c},Gt=t=>!t.hidePrice&&(t.priceVisible??!1),Xt=["data-add-target"],zt={class:"d-flex flex-nowrap"},Lt=["disabled","aria-label"],Kt={class:"cart-add-text"},ge=A({__name:"purchaseForm",props:{product:{type:Object,required:!0},addTarget:{type:String,default:"cart",required:!1},context:{type:String,default:"page",required:!1},options:{type:Object,required:!1,default:null},showAmountInput:{type:Boolean,default:!0,required:!1},buttonPhrase:{type:String,default:"buy",required:!1},buttonDisabledPhrase:{type:String,default:"buy",required:!1},buttonIcon:{type:String,default:"fa fa-shopping-cart",required:!1},buttonClasses:{type:String,default:"btn btn-primary btn-block d-flex align-items-center",required:!1}},emits:["formSubmitted","formCompleted"],setup(t,{emit:o}){const{locale:c,t:s,te:f}=H(),n=K(M),e=t,{addToCart:p}=ht(),{addToCart:w}=vt(),{user:u}=ot(nt()),y=o,h=a(()=>!!e.product.showOfferRequest),g=W(e.product.unit.packingSize),m=W(!1),D=a(()=>e.product.price.discounted.value===0),I=a(()=>D.value&&Gt(e.product)),V=a(()=>n?.value?.gift_token_enable??!1),J=a(()=>n?.value?.gift_token_ptype??""),P=a(()=>V.value&&J.value.length>0&&e.product?.type===J.value),U=W(!1),i=a(()=>{const T=e.context==="list"?"productlist_product_addtocart_visible":"productcard_addtocart_visible";return n?.value?.[T]!==!1}),b=a(()=>!h.value&&!P.value&&u.value?.rights?.addToOffer),S=a(()=>!e.product.orderable&&e.product.offerable&&b.value),$=a(()=>(!I.value&&!h.value||P.value)&&!S.value&&u.value?.rights?.addToCart),X=a(()=>e.addTarget==="offer"?b.value&&(U.value||!$.value):$.value&&i.value),Z=a(()=>{if(e.addTarget==="offer"){if(B.value&&e.buttonPhrase==="buy")return s("v1.views.offer.addToOffer");if(!B.value&&e.buttonDisabledPhrase==="buy")return s("v1.views.offer.addToOffer")}return B.value?f(e.buttonPhrase)?s(e.buttonPhrase):s("buy"):f(e.buttonDisabledPhrase)?s(e.buttonDisabledPhrase):s("buy")}),rt=a(()=>e.addTarget==="offer"&&e.buttonIcon==="fa fa-shopping-cart"?"fa fa-sticky-note":e.buttonIcon??"fa fa-shopping-cart"),ct=a(()=>n?.value?.product_options_show_amount??!1),Y=a(()=>{const T=[];return e.options?.optionGroups.forEach(x=>{x.products.forEach(k=>{if(k.selected){const N=!ct.value&&k.amount<=0?1:k.amount??1;T.push({sku:k.activeChoice&&k.activeChoice?.length>0?k.activeChoice:k.sku,amount:N})}})}),T}),ut=a(()=>{const T=e.options?.optionGroups?.every(x=>x.products.filter(N=>N.selected).length>=x.minChoices);return!e.options||(e.options?.optionGroups?.length??0)===0||T}),B=a(()=>{const T=e.product.orderable,x=e.product.offerable,k=ut.value,N=e.addTarget==="offer";return(T||N&&x)&&k});async function it(){if(B.value&&!m.value){y("formSubmitted",e.product);const T=e.product.title[c.value]??"",x=e.product.category?.title?.[c.value]??"",k=e.product.manufacturer.title[c.value]??"",N=n?.value?.vat_on_default_cash??!0?e.product.price.discounted.valueWithVat:e.product.price.discounted.value,R={id:e.product.sku,title:T,categoryTitle:x,brandName:k,amount:g.value,price:N,
1currency:e.product.price.currency,type:"product"};Y.value.length>0&&(R.options=Y.value),m.value=!0;let z=!1;try{e.addTarget==="offer"?z=await w([R]):z=await p([R])}finally{m.value=!1}y("formCompleted",e.product,z,e.addTarget)}}return tt(()=>e.product.sku,()=>{g.value=e.product.unit.packingSize??1}),(T,x)=>{const k=_t,N=kt;return r(X)?(l(),d("form",{key:0,role:"form",itemprop:"offers",itemtype:"http://schema.org/Offer",class:"product-purchase-form","data-add-target":t.addTarget,onSubmit:et(it,["prevent"])},[_("div",zt,[t.showAmountInput&&!r(P)?(l(),Q(k,{key:0,modelValue:r(g),"onUpdate:modelValue":x[0]||(x[0]=R=>bt(g)?g.value=R:null),step:e.product.unit.amountIncrement,min:e.product.unit.amountIncrement,max:e.product.unit.maxAmount},null,8,["modelValue","step","min","max"])):C("",!0),_("button",{type:"submit",class:F(t.buttonClasses),disabled:!r(B)||r(m),"aria-label":r(Z)},[j(T.$slots,"cart-icon",{},()=>[G(N,{icon:r(rt),class:"mr-1"},null,8,["icon"])]),_("span",Kt,v(r(Z)),1)],10,Lt)])],40,Xt)):C("",!0)}}});export{fe as _,de as a,pe as b,ge as c,oe as d,ie as e,ne as f,le as g,Gt as h,ue as i,se as j,ce as k,ee as l,me as m,ae as n,re as o,Yt as p,te as s};

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.