PageSourceSearch

https://www.bangerhead.pl/_nuxt/Dxiy8Pdm.js

js bangerhead.pl collected 2026-09-27 06:47:06 UTC 33,921 bytes, 1 lines download raw bytes

1import{u as Dt,i as Mt,d as rr}from"./CljuiXqW.js";import{u as Vt}from"./DImwG1cz.js";import{u as Ut,_ as qt}from"./SxfA1mj8.js";import nr from"./DUW0m9J2.js";import Et from"./DQ6VWcer.js";import{a as st,v as Wt}from"./DzIAryYo.js";import Ot from"./YRuCUxvz.js";import zt from"./BwKxs6fj.js";import Ht from"./8xx75tJt.js";import{f as Qt,p as jt}from"./B4vkUEz8.js";import{u as Kt}from"./Dp6czNMG.js";import{u as Yt}from"./DOQdaM1e.js";import{u as Jt}from"./C0F6oAUf.js";import{u as xt}from"./Cj68UpZQ.js";import{d as Bt,w as ie,e as c,r as A,J as Xt,g as $t,K as Zt,u as a,o as p,c as O,v as $e,x as Xe,f as P,a as g,b as s,t as D,n as K,h as lt,F as dt,i as er,l as Ge,p as Re,D as ar}from"./7wLLGBw6.js";import{_ as Gt}from"./DlAUqK2U.js";import or from"./wIY2lE5o.js";import cr from"./kDTvxiTX.js";import ir from"./3KgW5xRM.js";import"./PPVm8Dsz.js";import"./CEMNN0-S.js";import"./Bxq-ZRzE.js";import"./DV1rWqPI.js";import"./CQKBV69e.js";import"./B-XSawTn.js";import"./Bye0tMBB.js";import"./DFi0_zIc.js";import"./7jy-ks6P.js";import"./2BqOZB2Z.js";import"./DjwRFtxh.js";import"./MYfK9Jbk.js";import"./C9rM7IoF.js";import"./opPOqDw0.js";import"./Gh-jFvkY.js";import"./CHx6LYcc.js";import"./BOPot54M.js";import"./B57xfjda.js";import"./CMVG5Lup.js";import"./D_KgNNOu.js";import"./CLk8choT.js";import"./BYHoC4vs.js";import"./DuAV58dt.js";import"./D6n7F_Nn.js";import"./C3wwnLB9.js";import"./B-OxpdkT.js";import"./BJ2ClxiI.js";import"./IqoUnNbk.js";import"./DWtR54Pl.js";import"./Bu8_HwYY.js";import"./C_PhgRTd.js";import"./BKqcM5C0.js";import"./-BJuJWiG.js";import"./DP6wig6b.js";import"./CsmGXt1m.js";import"./BC6dpry8.js";import"./DShtZKlw.js";import"./BNyVQ8nL.js";import"./BPT17-I9.js";import"./DRy4sJuF.js";import"./Bv2tPn35.js";import"./1x_kSl0R.js";import"./Fx7vxA9P.js";import"./oVinqaqj.js";import"./CCBgFTxl.js";import"./Ctpuai81.js";import"./EW_f8si9.js";function tr({activeCodes:$,merchandiseTotal:o,shippingTotal:C=0,paymentFee:Y=0,grandTotal:W}){if(!$.length||!Lt(o)||!Lt(W))return 0;const x=o+Rt(C)+Rt(Y);return ur(x-W)}function Rt($){return Lt($)?$:0}function Lt($){return typeof $=="number"&&Number.isFinite($)}function ur($){const o=Math.round(($+Number.EPSILON)*100)/100;return o>.01?o:0}const sr={key:0,class:"checkout-page__error"},lr={class:"checkout-page__container"},dr={key:0,class:"checkout-page__empty"},pr={key:1,class:"checkout-page__products"},fr={class:"checkout-page__product-qty"},mr={class:"checkout-page__product-price"},gr={key:2,class:"checkout-page__codes"},vr={class:"checkout-page__code-row"},hr={class:"checkout-page__code-row"},yr={key:3,class:"checkout-page__total-price"},kr={class:"checkout-page__row"},_r={class:"checkout-page__newsletter"},wr={id:"checkout-payment",class:"checkout-page__section checkout-page__section--divided"},br={key:0,class:"checkout-page__feedback checkout-page__feedback--err"},Cr={key:0},Pr={key:1,class:"checkout-page__loading"},Tr=!0,Ar=!0,Ir=Bt({__name:"qliro",setup($){const o=Dt(),C=Vt(),{walleyUpdate:Y}=Ut(),W=Kt(),x=Yt(),J=Jt(`checkout-brand:${W.path}`,()=>C.site==="bangerhead"?"bangerhead":"legacy"),X=c(()=>J.value==="bangerhead");ie(()=>C.site,t=>{t==="bangerhead"?J.value="bangerhead":t&&(J.value="legacy")},{immediate:!0}),xt({bodyAttrs:{class:c(()=>X.value?"bangerhead-checkout-page":"")}});const m=c(()=>o.checkout?.data),we=c(()=>W.meta.languagePrefix??C.locale??""),pt=c(()=>we.value?`/${we.value}`:"/"),z=c(()=>Mt(m.value)),N=c(()=>m.value?.preloadedCart??{}),be=c(()=>{const t=N.value?.orderRows;return Array.isArray(t)?t:[]}),ue=c(()=>!!m.value),F=c(()=>be.value.length>0),me=c(()=>be.value),S=A(!1),ge=c(()=>{const t=Number(N.value?.quantity);return Number.isFinite(t)&&t>0?t:be.value.reduce((r,u)=>r+(Number(u.quantity)||0),0)}),Me=c(()=>!o.error&&!F.value&&!S.value),Ze=c(()=>!o.error&&S.value&&ue.value&&!F.value),ft=c(()=>F.value||Ze.value?ge.value:null),H=A(""),Q=A(""),Z=A(!!m.value?.isNewsLetterCheckboxChecked),G=A(!1),I=A(!1),R=A(!1),M=A(!1),ve=A(0),V=c(()=>R.value||o.walleyValidationFailed);ie(m,t=>{Z.value=!!t?.isNewsLetterCheckboxChecked});async function se(){if(!m.value||!F.value||I.value)return;R.value=!1;const t=await o.setPayment(m.value);I.value=t,R.value=!t}async function le(){z.value&&I.value||(I.value=!1,await se())}async function Ue(){if(z.value&&I.value){await Y();return}I.value=!1,await se()}function qe(){o.paymentInProcess=!1,o.orderCompleted=!1,o.walleyDeliveryPreview=null,o.walleyValidationFailed=!1,M.value=!1}Xt(qe),$t(async()=>{window.addEventListener("pageshow",he);try{F.value||await o.fetchCheckoutData()}finally{S.value=!0}await se()}),Zt(()=>{window.removeEventListener("pageshow",he),qe()}),ie(Z,t=>o.setNewsletterSubscription(t)),ie(()=>be.value.length,async(t,r)=>{if(!(!z.value||!I.value||r!==0||t===0||!m.value)){M.value=!0;try{await o.reloadPaymentWidget(m.value),ve.value+=1}finally{M.value=!1}}});function he(t){t.persisted&&window.location.reload()}async function Ee(){const t=H.value.trim();!t||!await o.setVoucherCode(t)||(H.value="",G.value=!0,await Ue())}
1async function de(){Q.value.trim()&&(await o.setGiftCard(Q.value.trim()),Q.value="",z.value&&I.value&&await Y())}async function We(t){await o.deleteVoucherCode(t)&&(G.value=!0,await Ue())}async function ye(){o.walleyValidationFailed=!1,await o.fetchCheckoutData(),I.value=!1,await se()}function v(t,r){for(const u of r){const l=t?.[u];if(l!=null&&l!=="")return l}}function Oe(t,r){for(const u of r){const l=u.split(".").reduce((h,f)=>h?.[f],t);if(l!=null&&l!=="")return l}}function ee(t){return String(v(t,["articleNumber","articleId","id","productId"])??"")}function et(t){return String(v(t,["brand","brandName","brandTitle","manufacturer"])??"")}function ze(t){return String(v(t,["name","productName","title","articleName"])??ee(t))}function mt(t){const r=[v(t,["variantName","secondaryName","category","volume"]),v(t,["description","subTitle"])].filter(Boolean).map(u=>String(u).trim()).filter(u=>u&&u!==ze(t));return[...new Set(r)]}function Ce(t){const r=v(t,["image","imageUrl","productImage","thumbnail","imageSrc"]);if(typeof r=="string")return r;const u=Oe(t,["image.url","image.src","image.full","image.desktop","image.filename","productImage.url","productImage.src","productImage.full"]);return typeof u=="string"?u:""}function k(t){if(!t)return"";if(t.startsWith("//"))return`https:${t}`;const r=t.trim(),u=C.apiBaseUrl||"https://beta.nordicfeel.com";if(r.startsWith("/"))return`${u}${r}`;try{const l=new URL(r);if(["localhost","127.0.0.1","::1"].includes(l.hostname))return`${u}${l.pathname}${l.search}${l.hash}`}catch{return r}return r}function U(t){return Number(t.quantity)||0}function T(t,r={}){return t==null||t===""?"":Qt(t,{locale:C.channel?.localeCode??C.locale??C.market,currencyCode:C.channel?.currency?.code??"SEK",currencyDisplay:C.channel?.currency?.display,decimals:r.decimals})}function He(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}function Pe(t){return jt(t)}function te(t){if(t==null||t==="")return"";if(typeof t=="string"||typeof t=="number")return T(t);const r=He(t);if(!r)return"";const u=v(r,["priceString","formattedPrice","displayPriceString"]);return T(u||v(r,["price","amount","value","priceIncludingVat"]))}function w(t){if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string")return Pe(t);const r=He(t);if(!r)return;const u=Number(v(r,["price","amount","value","priceIncludingVat"]));return Number.isFinite(u)?u:void 0}function re(t){return He(t.expandedPriceModel)??{}}function q(t){return t===!0||t==="true"||t===1||t==="1"}function L(t){const r=re(t);return q(v(t,["isGadRow"]))||!!r.googlePriceDate}function ke(t){const r=re(t);return[v(t,["isFreeGift","freeGift"]),Oe(t,["productItemTags.freeGift","frontendInfo.isFreeGift","frontendInfo.freeGift","additionalInfo.isFreeGift","additionalInfo.freeGift"]),v(r,["isFreeGift","freeGift"])].some(q)}function j(t){const r=re(t);return L(t)&&r.price?r.price:v(t,["priceIncludingVat","price","ordinaryPrice","originalPrice","beforePrice","priceBeforeDiscount","regularPrice"])??r.price}function E(t){const r=re(t);return L(t)&&r.campaignPrice&&r.hasCampaignPrice!==!1?r.campaignPrice:v(t,["campaignPriceIncludingVat","campaignPrice"])??r.campaignPrice}function _(t){const r=re(t),u=w(E(t)),l=w(j(t));return typeof r.hasCampaignPrice=="boolean"?r.hasCampaignPrice?u&&l?u<l:!0:!1:!!(u&&(!l||u<l))}function ne(t,r){const u=w(t),l=w(r);if(u!==void 0&&l!==void 0)return Math.abs(u-l)<.01;const h=te(t),f=te(r);return!!(h&&f&&h===f)}function Te(t){return v(t,["totalPriceString","totalPrice","totalPriceIncludingVat","lineTotal","lineTotalIncludingVat","rowTotal","displayTotal","totalDisplayPrice"])}function pe(t){const r=j(t),u=E(t),l=w(r),h=w(u);return h!==void 0&&h>0&&(l===void 0||h<l)?u:r}function ae(t,r){const u=w(t);return u!==void 0?T(u*Math.max(r,1),{decimals:!0}):r<=1?te(t):""}function fe(t,r){const u=w(t);if(u!==void 0)return u<=.01?"":T(u*Math.max(r,1),{decimals:!0});const l=te(t),h=l?Pe(l):void 0;return h===void 0||h>.01?l:""}function tt(t){const r=w(t);if(r!==void 0)return r<=.01?"":T(r,{decimals:!0});const u=te(t),l=u?Pe(u):void 0;return l===void 0||l>.01?u:""}function Qe(t){return ke(t)}function Ae(t){const r=pe(t),u=ae(r,U(t));return u||te(Te(t))||T(v(t,["displayPrice"]))}function Ie(t){const r=j(t);if(Qe(t)){const f=U(t);return fe(r,f)||fe(pe(t),f)||tt(Te(t))||fe(v(t,["displayPrice"]),f)}const u=pe(t);if(ne(r,u))return"";const l=w(r),h=w(u);return l!==void 0&&h!==void 0&&l<=h+.01?"":ae(r,U(t))}function rt(t){if(ke(t)||!_(t))return"";const r=re(t),u=Number(v(r,["campaignPercentage","percentage","discountPercentage","discountPercent"])??v(t,["campaignPercentage","percentage","discountPercentage","discountPercent"])),l=Number.isFinite(u)?Math.abs(u)<=1?Math.abs(u)*100:Math.abs(u):0,h=w(j(t)),f=w(E(t)),Ye=h!==void 0&&f!==void 0&&h>f&&h>0?(h-f)/h*100:0,e=l>0?l:Ye;return Number.isFinite(e)&&e>0?`-${Math.round(e)}%`:""}function je(t){const r=re(t).recommendedPrice??v(t,["recommendedPrice","recommendedPriceString"]),u=_(t)?E(t):j(t);return ne(r,u)?"":te(r)}function Se(t){return Math.round((t+Number.EPSILON)*100)/100}function nt(t){if(t===void 0)return 0;const r=Se(t);return r>.01?r:0}function gt(t){const r=U(t);if(r<=0)return 0;const u=w(j(t));return u!==void 0?u*r:w(Te(t))??0}function vt(t){const r=U(t);if(r<=0)return 0;const u=w(pe(t));return u!==void 0?u*r:w(Te(t))??0}const ht=c(()=>v(N.value,["orderTotal","orderTotalDecimal","grandTotal","grandTotalDecimal"])),yt=c(()=>w(ht.value)),oe=c(()=>Se(me.value.reduce((t,r)=>t+gt(r),0))),Ne=c(()=>Se(me.value.reduce((t,r)=>t+vt(r),0))),kt=c(()=>v(m.value?.selectedDeliveryMethod,["priceString","price"])??v(N.value,["deliveryCost","shippingCost","freightCost"])),at=c(()=>w(kt.value)??0),Fe=c(()=>z.value?o.walleyDeliveryPreview?.fee??null:null),ot=c(()=>Fe.value??at.value),Ke=c(()=>T(ot.value,{decimals:!0})),ce=c(()=>w(v(N.value,["orderTotal","orderTotalDecimal","grandTotal","grandTotalDecimal"]))??0),_t=c(()=>({visible:X.value&&x.hasThreshold.value,message:x.message(ce.value),progress:x.progress(ce.value)})),Le=c(()=>v(N.value,["grandTotal","grandTotalDecimal","orderTotal","orderTotalDecimal"])),De=c(()=>
1{if(Fe.value===null)return Le.value;const t=w(Le.value)??Ne.value;return Se(t+Fe.value)}),Ve=c(()=>T(De.value,{decimals:!0})),wt=c(()=>T(v(N.value,["vat","vatTotal","vatTotalDecimal"]),{decimals:!0})),xe=c(()=>nt(oe.value-Ne.value)),bt=c(()=>xe.value>0?T(xe.value,{decimals:!0}):""),ct=c(()=>tr({activeCodes:o.discountCodes,merchandiseTotal:Ne.value,shippingTotal:at.value,paymentFee:w(m.value?.paymentProviderFee),grandTotal:w(Le.value)})),Be=c(()=>ct.value>0?T(-ct.value,{decimals:!0}):""),Ct=c(()=>{const r=xe.value>0&&oe.value>0?oe.value:yt.value??Ne.value;return T(r,{decimals:!0})}),it=c(()=>me.value.map((t,r)=>{const u=ee(t),l=U(t),h=ke(t);return{key:String(t.rowSystemId??u??r),articleNumber:u,brand:et(t),name:ze(t),variants:mt(t),image:k(Ce(t)),quantity:l,price:Ae(t),originalPrice:Ie(t),recommendedPrice:je(t),campaignBadgeLabel:rt(t),isFreeGift:h,isFreeGiftFree:h&&Qe(t),canDecrease:!h&&Tr&&l>1,canRemove:!h&&Ar,isMutating:o.cartMutatingArticleNumber===u}})),Pt=c(()=>({orderTotal:Ct.value,totalSavings:bt.value,codeDiscount:Be.value,shippingTotal:Ke.value,showShippingTotal:z.value&&Fe.value!==null,grandTotal:Ve.value,vatTotal:wt.value}));function _e(t){return me.value.find(r=>ee(r)===t)}async function Tt(t){const r=ee(t);if(!r)return;await o.increaseCartLine(r,U(t)+1)&&await le()}async function ut(t){const r=_e(t);r&&await Tt(r)}async function At(t){const r=ee(t);if(!r||U(t)<=1)return;await o.decreaseCartLine(r,U(t)-1)&&await le()}async function It(t){const r=_e(t);r&&await At(r)}async function St(t){const r=ee(t);if(!r)return;await o.removeCartLine(r)&&await le()}async function Nt(t){const r=_e(t);r&&await St(r)}return(t,r)=>{const u=qt,l=nr,h=Et;return a(X)?(p(),O(zt,{key:0,"return-href":a(pt)},{default:$e(()=>[Xe(Ht,{"visible-product-count":a(ft),error:a(o).error,"show-cart-loading":a(Me),"show-empty-cart":a(Ze),"has-cart":a(F),rows:a(it),"cart-mutation-error":a(o).cartMutationError,"codes-open":a(G),"voucher-input":a(H),"gift-card-input":a(Q),"voucher-codes":a(o).discountCodes,"voucher-message":a(o).voucherInfo,"gift-card-message":a(o).giftCardInfo,totals:a(Pt),"free-shipping":a(_t),locked:a(o).cartLockedForPayment,onRetry:ye,onIncrease:ut,onDecrease:It,onRemove:Nt,"onUpdate:codesOpen":r[0]||(r[0]=f=>G.value=f),"onUpdate:voucherInput":r[1]||(r[1]=f=>H.value=f),"onUpdate:giftCardInput":r[2]||(r[2]=f=>Q.value=f),onApplyVoucher:Ee,onApplyGiftCard:de,onRemoveVoucher:We},null,8,["visible-product-count","error","show-cart-loading","show-empty-cart","has-cart","rows","cart-mutation-error","codes-open","voucher-input","gift-card-input","voucher-codes","voucher-message","gift-card-message","totals","free-shipping","locked"]),a(F)?(p(),O(Ot,{key:0,"checkout-data":a(m),newsletter:a(Z),"payment-provider":a(z)?"walley":"qliro","payment-init-failed":a(V),"payment-initialized":a(I),error:a(o).error,locked:a(o).cartLockedForPayment,"payment-widget-refreshing":a(M),"walley-widget-key":a(ve),"onUpdate:newsletter":r[3]||(r[3]=f=>Z.value=f),onRetryPayment:ye},null,8,["checkout-data","newsletter","payment-provider","payment-init-failed","payment-initialized","error","locked","payment-widget-refreshing","walley-widget-key"])):P("",!0)]),_:1},8,["return-href"])):(p(),g("div",{key:1,class:K(["checkout-page__wrapper",{"checkout-page__wrapper--empty":!a(F)}])},[r[15]||(r[15]=s("h1",{class:"checkout-page__header"},"Checkout",-1)),a(o).error?(p(),g("p",sr,D(a(o).error),1)):P("",!0),s("div",lr,[s("section",{class:K(["checkout-page__section checkout-page__section--cart",{"checkout-page__section--payment-locked":a(o).cartLockedForPayment}])},[r[11]||(r[11]=s("h2",{class:"checkout-page__cart-heading"},"Cart",-1)),a(F)?(p(),g("ul",pr,[(p(!0),g(dt,null,er(a(me),(f,Ye)=>(p(),g("li",{key:f.rowSystemId??f.articleNumber??Ye,class:"checkout-page__product"},[s("span",null,D(f.name??f.articleNumber),1),s("span",fr,"x "+D(f.quantity),1),s("span",mr,D(f.totalPrice??f.price),1)]))),128))])):(p(),g("div",dr,[r[9]||(r[9]=s("p",{class:"checkout-page__empty-message"},"Your cart is empty.",-1)),s("p",{class:"checkout-page__empty-hint"},[r[7]||(r[7]=lt(" If you just added items, the server may not have synced yet - ",-1)),s("button",{type:"button",class:"checkout-page__link-btn",onClick:ye}," try again "),r[8]||(r[8]=lt(". ",-1))])])),a(F)?(p(),g("div",gr,[s("div",vr,[Ge(s("input",{"onUpdate:modelValue":r[4]||(r[4]=f=>Re(H)?H.value=f:null),placeholder:"Promo code",class:"checkout-page__input"},null,512),[[st,a(H)]]),s("button",{type:"button",class:"checkout-page__btn",onClick:Ee},"Apply")]),a(o).voucherInfo?(p(),g("p",{key:0,class:K(["checkout-page__feedback",{"checkout-page__feedback--err":!a(o).voucherInfo.success}])},D(a(o).voucherInfo.text),3)):P("",!0),s("div",hr,[Ge(s("input",{"onUpdate:modelValue":r[5]||(r[5]=f=>Re(Q)?Q.value=f:null),placeholder:"Gift card",class:"checkout-page__input"},null,512),[[st,a(Q)]]),s("button",{type:"button",class:"checkout-page__btn",onClick:de},"Apply")]),a(o).giftCardInfo?(p(),g("p",{key:1,class:K(["checkout-page__feedback",{"checkout-page__feedback--err":!a(o).giftCardInfo.success}])},D(a(o).giftCardInfo.text),3)):P("",!0)])):P("",!0),a(F)?(p(),g("div",yr,[s("div",kr,[r[10]||(r[10]=s("span",null,"Total",-1)),s("strong",null,D(a(Ve)),1)])])):P("",!0)],2),a(F)?(p(),g(dt,{key:0},[s("section",{class:K(["checkout-page__section checkout-page__section--divided",{"checkout-page__section--payment-locked":a(o).cartLockedForPayment}])},[s("label",_r,[Ge(s("input",{"onUpdate:modelValue":r[6]||(r[6]=f=>Re(Z)?Z.value=f:null),type:"checkbox"},null,512),[[Wt,a(Z)]]),r[12]||(r[12]=s("span",null,"Subscribe to newsletter",-1))])],2),s("section",wr,[Xe(h,null,{fallback:$e(()=>[...r[13]||(r[13]=[s("p",{class:"checkout-page__loading"},"Loading payment...",-1)])]),default:$e(()=>[a(V)?(p(),g("div",br,[r[14]||(r[14]=s("p",null,"Could not initialise payment.",-1)),a(o).error?(p(),g("p",Cr,D(a(o).error),1)):P("",!0),s("button",{type:"button",class:"checkout-page__btn",onClick:ye},"Try again")])):a(I)?a(z)&&a(m)?(p(),O(u,{key:2,"checkout-data":a(m),state:"checkout"},null,8,["checkout-data"])):a(m)?(p(),O(l,{key:3,"checkout-data":a(m),state:"checkout"},null,8,["checkout-data"])):P("",!0):(p(),g("p",Pr," Initialising payment... "))]),_:1})])],64)):P("",!0)])],2))}}}),Ft=Gt(Ir,[["__scopeId","data-v-0ea6972d"]]),Sr={key:0,class:"checkout-page__error"},Nr={class:"checkout-page__container"},Fr={key:0,class:"checkout-page__empty"},Lr={key:1,class:"checkout-page__products"},Dr={class:"checkout-page__product-qty"},Vr={class:"checkout-page__product-price"},xr={key:2,class:"checkout-page__codes"},Br={class:"checkout-page__code-row"},$r={class:"checkout-page__code-row"},Gr={key:3,class:"checkout-page__total-price"},Rr={class:"checkout-page__row"},Mr={class:"checkout-page__newsletter"},Ur={class:"checkout-page__section checkout-page__section--divided"},qr={key:0,id:"checkout-payment",class:"checkout-page__section checkout-page__section--divided"},Er={key:0,class:"checkout-page__feedback checkout-page__feedback--err"},Wr={key:0},Or={key:1,class:"checkout-page__loading"},zr=!0,Hr=!0,Qr=Bt({__name:"briqpay",setup($){const o=Dt(),C=Vt(),{walleyUpdate:Y}=Ut(),W=Kt(),x=Yt(),J=Jt(`checkout-brand:${W.path}`,()=>C.site==="bangerhead"?"bangerhead":"legacy"),X=c(()=>J.value==="bangerhead");ie(()=>C.site,e=>{e==="bangerhead"?J.value="bangerhead":e&&(J.value="legacy")},{immediate:!0}),xt({bodyAttrs:{class:c(()=>X.value?"bangerhead-checkout-page":"")}});const m=c(()=>o.checkout?.data),we=c(()=>W.meta.languagePrefix??C.locale??""),pt=c(()=>we.value?`/${we.value}
1`:"/"),z=c(()=>String(C.market||we.value||"").trim().toLowerCase().split("-")[0]||""),N=c(()=>Mt(m.value)),be=c(()=>!N.value&&["pl","nl","be"].includes(z.value)),ue=c(()=>m.value?.preloadedCart??{}),F=c(()=>{const e=ue.value?.orderRows;return Array.isArray(e)?e:[]}),me=c(()=>!!m.value),S=c(()=>F.value.length>0),ge=c(()=>F.value),Me=A(!1),Ze=c(()=>{const e=Number(ue.value?.quantity);return Number.isFinite(e)&&e>0?e:F.value.reduce((n,i)=>n+(Number(i.quantity)||0),0)}),ft=c(()=>!o.error&&!S.value&&!Me.value),H=c(()=>!o.error&&Me.value&&me.value&&!S.value),Q=c(()=>S.value||H.value?Ze.value:null),Z=["firstName","lastName","email","phoneNumber","address","zipCode","city"],G=c(()=>{const e=m.value?.customerDetails;return e?Z.every(n=>String(e[n]??"").trim().length>0):!1}),I=A(""),R=A(""),M=A(!!m.value?.isNewsLetterCheckboxChecked),ve=A(!1),V=A(!1),se=A(!1),le=A(!1),Ue=A(0),qe=c(()=>se.value||o.walleyValidationFailed),he=A(!1),Ee=c(()=>G.value&&!he.value);ie(m,e=>{M.value=!!e?.isNewsLetterCheckboxChecked});async function de(){if(!m.value||!S.value||!G.value||V.value)return;se.value=!1;const e=await o.setPayment(m.value);V.value=e,se.value=!e}async function We(){N.value&&V.value||(V.value=!1,await de())}async function ye(){if(N.value&&V.value){await Y();return}V.value=!1,await de()}async function v(){he.value=!1,V.value=!1,await de()}function Oe(){o.paymentInProcess=!1,o.orderCompleted=!1,o.walleyDeliveryPreview=null,o.walleyValidationFailed=!1,le.value=!1}Xt(Oe),$t(async()=>{window.addEventListener("pageshow",ee);try{S.value||await o.fetchCheckoutData()}finally{Me.value=!0}}),ie(G,e=>{e&&de()},{immediate:!0}),Zt(()=>{window.removeEventListener("pageshow",ee),Oe()}),ie(M,e=>o.setNewsletterSubscription(e)),ie(()=>F.value.length,async(e,n)=>{if(!(!N.value||!V.value||n!==0||e===0||!m.value)){le.value=!0;try{await o.reloadPaymentWidget(m.value),Ue.value+=1}finally{le.value=!1}}});function ee(e){e.persisted&&window.location.reload()}async function et(){const e=I.value.trim();!e||!await o.setVoucherCode(e)||(I.value="",ve.value=!0,await ye())}async function ze(){R.value.trim()&&(await o.setGiftCard(R.value.trim()),R.value="",N.value&&V.value&&await Y())}async function mt(e){await o.deleteVoucherCode(e)&&(ve.value=!0,await ye())}async function Ce(){o.walleyValidationFailed=!1,await o.fetchCheckoutData(),V.value=!1,await de()}function k(e,n){for(const i of n){const d=e?.[i];if(d!=null&&d!=="")return d}}function U(e,n){for(const i of n){const d=i.split(".").reduce((y,B)=>y?.[B],e);if(d!=null&&d!=="")return d}}function T(e){return String(k(e,["articleNumber","articleId","id","productId"])??"")}function He(e){return String(k(e,["brand","brandName","brandTitle","manufacturer"])??"")}function Pe(e){return String(k(e,["name","productName","title","articleName"])??T(e))}function te(e){const n=[k(e,["variantName","secondaryName","category","volume"]),k(e,["description","subTitle"])].filter(Boolean).map(i=>String(i).trim()).filter(i=>i&&i!==Pe(e));return[...new Set(n)]}function w(e){const n=k(e,["image","imageUrl","productImage","thumbnail","imageSrc"]);if(typeof n=="string")return n;const i=U(e,["image.url","image.src","image.full","image.desktop","image.filename","productImage.url","productImage.src","productImage.full"]);return typeof i=="string"?i:""}function re(e){if(!e)return"";if(e.startsWith("//"))return`https:${e}`;const n=e.trim(),i=C.apiBaseUrl||"https://beta.nordicfeel.com";if(n.startsWith("/"))return`${i}${n}`;try{const d=new URL(n);if(["localhost","127.0.0.1","::1"].includes(d.hostname))return`${i}${d.pathname}${d.search}${d.hash}`}catch{return n}return n}function q(e){return Number(e.quantity)||0}function L(e,n={}){return e==null||e===""?"":Qt(e,{locale:C.channel?.localeCode??C.locale??C.market,currencyCode:C.channel?.currency?.code??"SEK",currencyDisplay:C.channel?.currency?.display,decimals:n.decimals})}function ke(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function j(e){return jt(e)}function E(e){if(e==null||e==="")return"";if(typeof e=="string"||typeof e=="number")return L(e);const n=ke(e);if(!n)return"";const i=k(n,["priceString","formattedPrice","displayPriceString"]);return L(i||k(n,["price","amount","value","priceIncludingVat"]))}function _(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string")return j(e);const n=ke(e);if(!n)return;const i=Number(k(n,["price","amount","value","priceIncludingVat"]));return Number.isFinite(i)?i:void 0}function ne(e){return ke(e.expandedPriceModel)??{}}function Te(e){return e===!0||e==="true"||e===1||e==="1"}function pe(e){const n=ne(e);return[k(e,["isFreeGift","freeGift"]),U(e,["productItemTags.freeGift","frontendInfo.isFreeGift","frontendInfo.freeGift","additionalInfo.isFreeGift","additionalInfo.freeGift"]),k(n,["isFreeGift","freeGift"])].some(Te)}function ae(e){const n=ne(e);return k(e,["priceIncludingVat","price","ordinaryPrice","originalPrice","beforePrice","priceBeforeDiscount","regularPrice"])??n.price}function fe(e){const n=ne(e);return k(e,["campaignPriceIncludingVat","campaignPrice"])??n.campaignPrice}function tt(e){const n=ne(e),i=_(fe(e)),d=_(ae(e));return typeof n.hasCampaignPrice=="boolean"?n.hasCampaignPrice?i&&d?i<d:!0:!1:!!(i&&(!d||i<d))}function Qe(e,n){const i=_(e),d=_(n);if(i!==void 0&&d!==void 0)return Math.abs(i-d)<.01;const y=E(e),B=E(n);return!!(y&&B&&y===B)}function Ae(e){return k(e,["totalPriceString","totalPrice","totalPriceIncludingVat","lineTotal","lineTotalIncludingVat","rowTotal","displayTotal","totalDisplayPrice"])}function Ie(e){const n=ae(e),i=fe(e),d=_(n),y=_(i);return y!==void 0&&y>0&&(d===void 0||y<d)?i:n}function rt(e,n){const i=_(e);return i!==void 0?L(i*Math.max(n,1),{decimals:!0}):n<=1?E(e):""}function je(e,n){const i=_(e);if(i!==void 0)return i<=.01?"":L(i*Math.max(n,1),{decimals:!0});const d=E(e),y=d?j(d):void 0;return y===void 0||y>.01?d:""}function Se(e){const n=_(e);if(n!==void 0)return n<=.01?"":L(n,{decimals:!0});const i=E(e),d=i?j(i):void 0;return d===void 0||d>.01?i:""}function nt(e){return pe(e)}function gt(e){const n=Ie(e),i=rt(n,q(e));return i||E(Ae(e))||L(k(e,["displayPrice"]))}function vt(e){const n=ae(e);if(nt(e)){const B=q(e);return je(n,B)||je(Ie(e),B)||Se(Ae(e))||je(k(e,["displayPrice"]),B)}const i=Ie(e);if(Qe(n,i))return"";const d=_(n),y=_(i);return d!==void 0&&y!==void 0&&d<=y+.01?"":rt(n,q(e))}function ht(e){if(pe(e)||!tt(e))return"";const n=ne(e),i=Number(k(n,["campaignPercentage","percentage","discountPercentage","discountPercent"])??k(e,["campaignPercentage","percentage","discountPercentage","discountPercent"])),d=Number.isFinite(i)?Math.abs(i)<=1?Math.abs(i)*100:Math.abs(i):0,y=_(ae(e)),B=_(fe(e)),b=y!==void 0&&B!==void 0&&y>B&&y>0?(y-B)/y*100:0,Je=d>0?d:b;return Number.isFinite(Je)&&Je>0?`-${Math.round(Je)}%`:""}function yt(e){const n=ne(e).recommendedPrice??k(e,["recommendedPrice","recommendedPriceString"]),i=tt(e)?fe(e):ae(e);return Qe(n,i)?"":E(n)}function oe(e){return Math.round((e+Number.EPSILON)*100)/100}function Ne(e){if(e===void 0)return 0;const n=oe(e);return n>.01?n:0}function kt(e){const n=q(e);if(n<=0)return 0;const i=_(ae(e));return i!==void 0?i*n:_(Ae(e))??0}function at(e){const n=q(e);if(n<=0)return 0;const i=_(Ie(e));return i!==void 0?i*n:_(Ae(e))??0}const Fe=c(()=>k(ue.value,["orderTotal","orderTotalDecimal","grandTotal","grandTotalDecimal"])),ot=c(()=>_(Fe.value)),Ke=c(()=>oe(ge.value.reduce((e,n)=>e+kt(n),0))),ce=c(()=>oe(ge.value.reduce((e,n)=>e+at(n),0))),_t=c(()=>k(m.value?.selectedDeliveryMethod,["priceString","price"])??k(ue.value,["deliveryCost","shippingCost","freightCost"])),Le=c(()=>_(_t.value)??0),De=c(()=>N.value?o.walleyDeliveryPreview?.fee??null:null),Ve=c(()=>ce.value||ot.value||0),wt=c(()=>X.value&&x.hasReachedThreshold(Ve.value)),xe=c(()=>De.value??(wt.value?0:Le.value)),bt=c(()=>L(xe.value,{decimals:!0})),ct=c(()=>({visible:X.value&&x.hasThreshold.value,message:x.message(Ve.value),progress:x.progress(Ve.value)})),Be=c(()=>k(ue.value,["grandTotal","grandTotalDecimal","orderTotal","orderTotalDecimal"])),Ct=c(()=>
1{if(De.value!==null){const i=_(Be.value)??ce.value;return oe(i+De.value)}const e=xe.value;if(G.value||e<=0)return Be.value;const n=_(Be.value)??ce.value;return oe(n+e)}),it=c(()=>L(Ct.value,{decimals:!0})),Pt=c(()=>L(k(ue.value,["vat","vatTotal","vatTotalDecimal"]),{decimals:!0})),_e=c(()=>Ne(Ke.value-ce.value)),Tt=c(()=>_e.value>0?L(_e.value,{decimals:!0}):""),ut=c(()=>tr({activeCodes:o.discountCodes,merchandiseTotal:ce.value,shippingTotal:Le.value,paymentFee:_(m.value?.paymentProviderFee),grandTotal:_(Be.value)})),At=c(()=>ut.value>0?L(-ut.value,{decimals:!0}):""),It=c(()=>{const n=_e.value>0&&Ke.value>0?Ke.value:ot.value??ce.value;return L(n,{decimals:!0})}),St=c(()=>ge.value.map((e,n)=>{const i=T(e),d=q(e),y=pe(e);return{key:String(e.rowSystemId??i??n),articleNumber:i,brand:He(e),name:Pe(e),variants:te(e),image:re(w(e)),quantity:d,price:gt(e),originalPrice:vt(e),recommendedPrice:yt(e),campaignBadgeLabel:ht(e),isFreeGift:y,isFreeGiftFree:y&&nt(e),canDecrease:!y&&zr&&d>1,canRemove:!y&&Hr,isMutating:o.cartMutatingArticleNumber===i}})),Nt=c(()=>({orderTotal:It.value,totalSavings:Tt.value,codeDiscount:At.value,shippingTotal:bt.value,showShippingTotal:N.value?De.value!==null:!0,grandTotal:it.value,vatTotal:Pt.value}));function t(e){return ge.value.find(n=>T(n)===e)}async function r(e){const n=T(e);if(!n)return;await o.increaseCartLine(n,q(e)+1)&&await We()}async function u(e){const n=t(e);n&&await r(n)}async function l(e){const n=T(e);if(!n||q(e)<=1)return;await o.decreaseCartLine(n,q(e)-1)&&await We()}async function h(e){const n=t(e);n&&await l(n)}async function f(e){const n=T(e);if(!n)return;await o.removeCartLine(n)&&await We()}async function Ye(e){const n=t(e);n&&await f(n)}return(e,n)=>{const i=or,d=qt,y=cr,B=Et;return a(X)?(p(),O(zt,{key:0,"return-href":a(pt)},{default:$e(()=>[Xe(Ht,{"visible-product-count":a(Q),error:a(o).error,"show-cart-loading":a(ft),"show-empty-cart":a(H),"has-cart":a(S),rows:a(St),"cart-mutation-error":a(o).cartMutationError,"codes-open":a(ve),"voucher-input":a(I),"gift-card-input":a(R),"voucher-codes":a(o).discountCodes,"voucher-message":a(o).voucherInfo,"gift-card-message":a(o).giftCardInfo,totals:a(Nt),"free-shipping":a(ct),locked:a(o).cartLockedForPayment,onRetry:Ce,onIncrease:u,onDecrease:h,onRemove:Ye,"onUpdate:codesOpen":n[0]||(n[0]=b=>ve.value=b),"onUpdate:voucherInput":n[1]||(n[1]=b=>I.value=b),"onUpdate:giftCardInput":n[2]||(n[2]=b=>R.value=b),onApplyVoucher:et,onApplyGiftCard:ze,onRemoveVoucher:mt},null,8,["visible-product-count","error","show-cart-loading","show-empty-cart","has-cart","rows","cart-mutation-error","codes-open","voucher-input","gift-card-input","voucher-codes","voucher-message","gift-card-message","totals","free-shipping","locked"]),a(S)?(p(),O(i,{key:0,collapsed:a(Ee),onSaved:v,onEdit:n[3]||(n[3]=b=>he.value=!0)},null,8,["collapsed"])):P("",!0),a(S)&&a(G)&&a(be)?(p(),O(ir,{key:1})):P("",!0),a(S)&&a(G)?(p(),O(Ot,{key:2,"checkout-data":a(m),newsletter:a(M),"payment-provider":a(N)?"walley":"briqpay","payment-init-failed":a(qe),"payment-initialized":a(V),error:a(o).error,locked:a(o).cartLockedForPayment,"payment-widget-refreshing":a(le),"walley-widget-key":a(Ue),"onUpdate:newsletter":n[4]||(n[4]=b=>M.value=b),onRetryPayment:Ce},null,8,["checkout-data","newsletter","payment-provider","payment-init-failed","payment-initialized","error","locked","payment-widget-refreshing","walley-widget-key"])):P("",!0)]),_:1},8,["return-href"])):(p(),g("div",{key:1,class:K(["checkout-page__wrapper",{"checkout-page__wrapper--empty":!a(S)}])},[n[17]||(n[17]=s("h1",{class:"checkout-page__header"},"Checkout",-1)),a(o).error?(p(),g("p",Sr,D(a(o).error),1)):P("",!0),s("div",Nr,[s("section",{class:K(["checkout-page__section checkout-page__section--cart",{"checkout-page__section--payment-locked":a(o).cartLockedForPayment}])},[n[13]||(n[13]=s("h2",{class:"checkout-page__cart-heading"},"Cart",-1)),a(S)?(p(),g("ul",Lr,[(p(!0),g(dt,null,er(a(ge),(b,Je)=>(p(),g("li",{key:b.rowSystemId??b.articleNumber??Je,class:"checkout-page__product"},[s("span",null,D(b.name??b.articleNumber),1),s("span",Dr,"x "+D(b.quantity),1),s("span",Vr,D(b.totalPrice??b.price),1)]))),128))])):(p(),g("div",Fr,[n[11]||(n[11]=s("p",{class:"checkout-page__empty-message"},"Your cart is empty.",-1)),s("p",{class:"checkout-page__empty-hint"},[n[9]||(n[9]=lt(" If you just added items, the server may not have synced yet - ",-1)),s("button",{type:"button",class:"checkout-page__link-btn",onClick:Ce}," try again "),n[10]||(n[10]=lt(". ",-1))])])),a(S)?(p(),g("div",xr,[s("div",Br,[Ge(s("input",{"onUpdate:modelValue":n[5]||(n[5]=b=>Re(I)?I.value=b:null),placeholder:"Promo code",class:"checkout-page__input"},null,512),[[st,a(I)]]),s("button",{type:"button",class:"checkout-page__btn",onClick:et},"Apply")]),a(o).voucherInfo?(p(),g("p",{key:0,class:K(["checkout-page__feedback",{"checkout-page__feedback--err":!a(o).voucherInfo.success}])},D(a(o).voucherInfo.text),3)):P("",!0),s("div",$r,[Ge(s("input",{"onUpdate:modelValue":n[6]||(n[6]=b=>Re(R)?R.value=b:null),placeholder:"Gift card",class:"checkout-page__input"},null,512),[[st,a(R)]]),s("button",{type:"button",class:"checkout-page__btn",onClick:ze},"Apply")]),a(o).giftCardInfo?(p(),g("p",{key:1,class:K(["checkout-page__feedback",{"checkout-page__feedback--err":!a(o).giftCardInfo.success}])},D(a(o).giftCardInfo.text),3)):P("",!0)])):P("",!0),a(S)?(p(),g("div",Gr,[s("div",Rr,[n[12]||(n[12]=s("span",null,"Total",-1)),s("strong",null,D(a(it)),1)])])):P("",!0)],2),a(S)?(p(),g(dt,{key:0},[s("section",{class:K(["checkout-page__section checkout-page__section--divided",{"checkout-page__section--payment-locked":a(o).cartLockedForPayment}])},[s("label",Mr,[Ge(s("input",{"onUpdate:modelValue":n[7]||(n[7]=b=>Re(M)?M.value=b:null),type:"checkbox"},null,512),[[Wt,a(M)]]),n[14]||(n[14]=s("span",null,"Subscribe to newsletter",-1))])],2),s("section",Ur,[Xe(i,{collapsed:a(Ee),onSaved:v,onEdit:n[8]||(n[8]=b=>he.value=!0)},null,8,["collapsed"])]),a(G)?(p(),g("section",qr,[Xe(B,null,{fallback:$e(()=>[...n[15]||(n[15]=[s("p",{class:"checkout-page__loading"},"Loading payment...",-1)])]),default:$e(()=>[a(qe)?(p(),g("div",Er,[n[16]||(n[16]=s("p",null,"Could not initialise payment.",-1)),a(o).error?(p(),g("p",Wr,D(a(o).error),1)):P("",!0),s("button",{type:"button",class:"checkout-page__btn",onClick:Ce},"Try again")])):a(V)?a(N)&&a(m)?(p(),O(d,{key:2,"checkout-data":a(m),state:"checkout"},null,8,["checkout-data"])):a(m)?(p(),O(y,{key:3,"checkout-data":a(m),state:"checkout"},null,8,["checkout-data"])):P("",!0):(p(),g("p",Or," Initialising payment... "))]),_:1})])):P("",!0)],64)):P("",!0)])],2))}}}),jr=Gt(Qr,[["__scopeId","data-v-44b7e8a2"]]),Kr={key:1,class:"checkout-dispat
1ch__loading","aria-busy":"true"},Yr=Bt({__name:"index",setup($){const o=Dt(),C=Vt(),Y={qliro:Ft,briqpay:jr,walley:Ft},W=A(!1);$t(async()=>{try{o.checkout?.data||await o.fetchCheckoutData()}finally{W.value=!0}});const x=c(()=>W.value||o.checkout?.data?Y[rr(o.checkout?.data)]??Ft:null),J=c(()=>C.site==="bangerhead");return xt({bodyAttrs:{class:c(()=>!x.value&&J.value?"bangerhead-checkout-page":"")}}),(X,m)=>a(x)?(p(),O(ar(a(x)),{key:0})):(p(),g("div",Kr))}}),la=Gt(Yr,[["__scopeId","data-v-f5b33639"]]);export{la 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.