1import{a as e}from"./vNw5UIaS.js";import{h as t}from"./53DkpcJz.js";import{i as n,r,t as i}from"./B5zAQhyu.js";import{t as a}from"./Br1j0Gsz.js";var o=e({MATOMO_REPORTING_CURRENCY:()=>`USD`,buildMatomoItems:()=>p,buildMatomoItemsFromCartData:()=>f,pushMatomoEvent:()=>k,trackMatomoCartUpdate:()=>_,trackMatomoEcommerceOrder:()=>h,useMatomo:()=>A}),s={USD:1,EUR:1.1127},c=e=>Math.round(e*100)/100;function l(e,t){return c(e*(s[t]??1))}function u(){try{return i().preferredCurrency||`EUR`}catch{return`EUR`}}function d(e,t,n){let r=e?.[n]||t?.[n];return r?r/100:null}function f(e){let t=a(),i=u(),o=e?.products||[],s=0,c=o.map(e=>{let a=t.getProductByName(e.name),o=e.quantity||1,c=d(e.price_discount,e.price_regular,i)??t.getEffectivePriceMajorUnits(a,i);return s+=c*o,{sku:n(e.name),name:e.name,category:r(a?.type),price:l(c,i),quantity:o}}),f=d(e?.total_discount,e?.total_regular,i)??s,p=e?.total_regular?.[i],m=p?Math.max(0,p/100-f):0;return{items:c,total:l(f,i),discount:l(m,i)}}function p(e){let t=a(),i=u(),o=0,s=0;return{items:e.map(e=>{let a=t.getProductByName(e.name),c=e.quantity||1,u=t.getEffectivePriceMajorUnits(a,i),d=(a?.price?.[i]??0)/100||u;return o+=u*c,s+=d*c,{sku:n(e.name),name:e.name,category:r(a?.type),price:l(u,i),quantity:c}}),total:l(o,i),discount:l(Math.max(0,s-o),i)}}function m(e){for(let t of e)window._paq.push([`addEcommerceItem`,t.sku,t.name,t.category,t.price,t.quantity])}function h(e,t,n,r=0){n||console.warn(`Matomo: reporting order`,e,`with a zero total â verify the price source`,t),O(),m(t),window._paq.push([`trackEcommerceOrder`,e,n,!1,!1,0,r||!1])}var g=null;function _(e,t){if(e.length===0&&g===null)return;let n=JSON.stringify([e.map(e=>[e.sku,e.quantity]),t]);n!==g&&(g=n,O(),m(e),window._paq.push([`trackEcommerceCartUpdate`,t]))}var v=/^\/products\/(?:plugins|guitar-cabinet-impulse-responses)\/([^/]+)\/?$/;function y(e){let t=e.match(v);if(!t)return null;try{let e=a(),i=e.getProductBySlug(t[1]);if(!i)return null;let o=u();return[`setEcommerceView`,n(i.name),i.name,r(i.type),l(e.getEffectivePriceMajorUnits(i,o),o)]}catch(e){return console.warn(`Matomo: could not resolve product for ecommerce view:`,e),null}}var b=[`forward-audio.com`,`www.forward-audio.com`],x=[`id`,`key`],S=`redacted`;function C(e){try{let t=new URL(e,window.location.origin),n=!1;for(let e of x)t.searchParams.has(e)&&(t.searchParams.set(e,S),n=!0);return n?`${t.pathname}${t.search}${t.hash}`:e}catch{return e}}function w(){try{let e=document.referrer;if(!e)return null;let t=new URL(e);if(t.origin!==window.location.origin||!x.some(e=>t.searchParams.has(e)))return null;for(let e of x)t.searchParams.has(e)&&t.searchParams.set(e,S);return[`setReferrerUrl`,t.toString()]}catch{return null}}var T=1,E=2;function D(){try{let e=i(),t=[[`setCustomDimension`,T,e.userData?.is_logged_in?`logged-in`:`anonymous`]];return e.preferredCurrency&&t.push([`setCustomDimension`,E,e.preferredCurrency]),t}catch(e){return console.warn(`Matomo: could not resolve visit dimensions:`,e),[]}}function O(){window._paq=window._paq||[];for(let e of D())window._paq.push(e)}function k(e,t,n,r){O();let i=[`trackEvent`,e,t];n!==void 0&&i.push(n),r!==void 0&&i.push(r),window._paq.push(i)}function A(){let e=t(),n=()=>{if(!b.includes(window.location.hostname)){console.log(`Matomo: tracking disabled on "${window.location.hostname}" â not a production host.`),window._paqLoaded=!0;return}window._paq=window._paq||[];let e=y(window.location.pathname),t=w(),n=[[`disableCookies`],[`disableBrowserFeatureDetection`],[`setTrackerUrl`,`//matomo.forward-audio.com/matomo.php`],[`setSiteId`,`9`],[`alwaysUseSendBeacon`],...D(),...e?[e]:[],[`setCustomUrl`,C(`${window.location.pathname}${window.location.search}${window.location.hash}`)],...t?[t]:[],[`trackPageView`],[`enableLinkTracking`]];window._paq.unshift(...n);let r=document.createElement(`script`);r.type=`text/javascript`,r.async=!0,r.defer=!0,r.src=`//matomo.forward-audio.com/matomo.js`,r.onload=()=>console.log(`Matomo script loaded successfully.`),r.onerror=e=>console.error(`Matomo script failed to load:`,e),document.head.appendChild(r),window._paqLoaded=!0};return{initMatomo:async()=>{window._paqLoaded||(n(),e&&(await e.isReady(),e.afterEach(e=>{if(window._paq){window._paq.push([`setCustomUrl`,C(e.fullPath)]),O();let t=y(e.path);t&&window._paq.push(t),window._paq.push([`trackPageView`])}})))}}}export{h as a,_ as i,f as n,A as o,k as r,o as s,p 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.