PageSourceSearch

https://www.devolo.co.uk/theme/f12d75d211689d64fc3f9a3f7741cd81/js/swag-analytics/swag-analytics.js

js devolo.co.uk collected 2026-10-02 03:17:41 UTC 26,999 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e={857:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function n(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function i(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||n,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=s;var l,u,d=Array.isArray(r);return d!==Array.isArray(e)?s(r,c):d?c.arrayMerge(e,r,c):(u={},(l=c).isMergeableObject(e)&&i(e).forEach(function(t){u[t]=s(e[t],l)}),i(r).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&l.isMergeableObject(r[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a})(t,l)(e[t],r[t],l):u[t]=s(r[t],l))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})},e.exports=a}},t={};function r(s){var n=t[s];if(void 0!==n)return n.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.m=e,(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}})(),(()=>{r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,s)=>(r.f[s](e,t),t),[]))})(),(()=>{r.u=e=>"./js/swag-analytics/"+e+".js"})(),(()=>{r.miniCssF=e=>{}})(),(()=>{r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}()})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={};r.l=(t,s,n,i)=>{if(e[t]){e[t].push(s);return}if(void 0!==n)for(var o,a,c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var u=c[l];if(u.getAttribute("src")==t){o=u;break}}o||(a=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,r.nc&&o.setAttribute("nonce",r.nc),o.src=t),e[t]=[s];var d=(r,s)=>{o.onerror=o.onload=null,clearTimeout(h);var n=e[t];if(delete e[t],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(e=>e(s)),r)return r(s)},h=setTimeout(d.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=d.bind(null,o.onerror),o.onload=d.bind(null,o.onload),a&&document.head.appendChild(o)}})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{r.g.importScripts&&(e=r.g.location+"");var e,t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&!e;)e=s[n--].src}if(!e)throw Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e+"../../"})(),(()=>{var e={"swag-analytics":0};r.f.j=(t,s)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n){if(n)s.push(n[2]);else{var i=new Promise((r,s)=>n=e[t]=[r,s]);s.push(n[2]=i);var o=r.p+r.u(t),a=Error();r.l(o,s=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=s&&("load"===s.type?"missing":s.type),o=s&&s.target&&s.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}},"chunk-"+t,t)}}};var t=(t,s)=>{var n,i,[o,a,c]=s,l=0;if(o.some(t=>0!==e[t])){for(n in a)r.o(a,n)&&(r.m[n]=a[n]);c&&c(r)}for(t&&t(s);l<o.length;l++)i=o[l],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0},s=self.webpackChunk=self.webpackChunk||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})(),(()=>{class e{static isSupported(){return"undefined"!==document.cookie}static setItem(e,t,r){if(null==e)throw Error("You must specify a key to set a cookie");let s=new Date;s.setTime(s.getTime()+864e5*r);let n="";"https:"===location.protocol&&(n="secure"),document.cookie="".concat(e,"=").concat(t,";expires=").concat(s.toUTCString(),";path=/;sameSite=lax;").concat(n)}static getItem(e){if(!e)return!1;let t=e+"=",r=document.cookie.split(";");for(let e=0;e<r.length;e++){let s=r[e];for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(t))return s.substring(t.length,s.length)}return!1}static removeItem(e){document.cookie="".concat(e,"= ; expires = Thu, 01 Jan 1970 00:00:00 GMT;path=/")}
1static key(){return""}static clear(){}}var t,s,n=r(857);class i{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let r=i.toUpperCamelCase(e,t);return i.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class o{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!o.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===o.hasAttribute(e,t))throw Error('The required property "'.concat(t,'" does not exist!'));if("function"!=typeof e.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),n=i.toLowerCamelCase(s,"-");if(!o.isNode(e)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let a=e.dataset[n];if(void 0===a){if(r)throw Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return a}return i.parsePrimitive(a)}static querySelector(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!o.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelector(t)||!1;if(r&&!1===s)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return s}static querySelectorAll(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!o.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelectorAll(t);if(0===s.length&&(s=!1),r&&!1===s)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return s}}class a{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(s),s}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=e.split("."),i=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=i;i=function(r){s.unsubscribe(e),t(r)}}return this.el.addEventListener(n[0],i),this.listeners.push({splitEventName:n,opts:r,cb:i}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,r)=>([...r.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):e.push(r),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}}class c{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return c.isIPhoneDevice()||c.isIPadDevice()}static isNativeWindowsBrowser(){return c.isIEBrowser()||c.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":c.isTouchDevice(),"is-ios":c.isIOSDevice(),"is-native-windows":c.isNativeWindowsBrowser(),"is-iphone":c.isIPhoneDevice(),"is-ipad":c.isIPadDevice(),"is-ie"
1:c.isIEBrowser(),"is-edge":c.isEdgeBrowser()}}}class l{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var r of e.entries())t(r[1],r[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(r=>{t(e[r],r)});throw Error("The element type ".concat(typeof e," is not iterable!"))}}let u="offcanvas";class d{open(e,t,r,s,n,i,o){this._removeExistingOffCanvas();let a=this._createOffCanvas(r,i,o,s);this.setContent(e,s,n),this._openOffcanvas(a,t)}setContent(e,t){let r=this.getOffCanvas();r[0]&&(r[0].innerHTML=e,this._registerEvents(t))}setAdditionalClassName(e){this.getOffCanvas()[0].classList.add(e)}getOffCanvas(){return document.querySelectorAll(".".concat(u))}close(e){let t=this.getOffCanvas();l.iterate(t,e=>{bootstrap.Offcanvas.getInstance(e).hide()}),setTimeout(()=>{this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e)}goBackInHistory(){window.history.back()}exists(){return this.getOffCanvas().length>0}_openOffcanvas(e,t){d.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof t&&t()}_registerEvents(e){let t=c.isTouchDevice()?"touchend":"click",r=this.getOffCanvas();l.iterate(r,t=>{let s=()=>{setTimeout(()=>{t.remove(),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:r})},e),t.removeEventListener("hide.bs.offcanvas",s)};t.addEventListener("hide.bs.offcanvas",s)}),window.addEventListener("popstate",this.close.bind(this,e),{once:!0});let s=document.querySelectorAll(".".concat("js-offcanvas-close"));l.iterate(s,r=>r.addEventListener(t,this.close.bind(this,e)))}_removeExistingOffCanvas(){d.bsOffcanvas=null;let e=this.getOffCanvas();return l.iterate(e,e=>e.remove())}_getPositionClass(e){return"left"===e?"offcanvas-start":"right"===e?"offcanvas-end":"offcanvas-".concat(e)}_createOffCanvas(e,t,r,s){let n=document.createElement("div");if(n.classList.add(u),n.classList.add(this._getPositionClass(e)),!0===t&&n.classList.add("is-fullwidth"),r){let e=typeof r;if("string"===e)n.classList.add(r);else if(Array.isArray(r))r.forEach(e=>{n.classList.add(e)});else throw Error('The type "'.concat(e,'" is not supported. Please pass an array or a string.'))}return document.body.appendChild(n),d.bsOffcanvas=new bootstrap.Offcanvas(n,{backdrop:!1!==s||"static"}),n}constructor(){this.$emitter=new a}}let h=Object.freeze(new d);class p{static open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";h.open(e,t,r,s,n,i,o)}static setContent(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;h.setContent(e,t,r)}static setAdditionalClassName(e){h.setAdditionalClassName(e)}static close(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;h.close(e)}static exists(){return h.exists()}static getOffCanvas(){return h.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}class g{get(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,r);return this._sendRequest(s,null,t)}post(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("POST",e,s);return this._sendRequest(n,t,r)}delete(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(n,t,r)}patch(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(n,t,r)}
1abort(){if(this._request)return this._request.abort()}_registerOnLoaded(e,t){t&&e.addEventListener("loadend",()=>{t(e.responseText,e)})}_sendRequest(e,t,r){return this._registerOnLoaded(e,r),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,r){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null}}let f="loader",v={BEFORE:"before",INNER:"inner"};class m{create(){if(!this.exists()){if(this.position===v.INNER){this.parent.innerHTML=m.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),m.getTemplate())}}remove(){let e=this.parent.querySelectorAll(".".concat(f));l.iterate(e,e=>e.remove())}exists(){return this.parent.querySelectorAll(".".concat(f)).length>0}_getPosition(){return this.position===v.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(f,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return f}constructor(e,t=v.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}}let y=null;class b extends p{static open(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",n=!(arguments.length>4)||void 0===arguments[4]||arguments[4],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:p.REMOVE_OFF_CANVAS_DELAY(),o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";if(!e)throw Error("A url must be given!");h._removeExistingOffCanvas();let c=h._createOffCanvas(s,o,a,n);this.setContent(e,t,r,n,i),h._openOffcanvas(c)}static setContent(e,t,r,s,n){let i=new g;super.setContent('<div class="offcanvas-body">'.concat(m.getTemplate(),"</div>"),s,n),y&&y.abort();let o=e=>{super.setContent(e,s,n),"function"==typeof r&&r(e)};y=t?i.post(e,t,b.executeCallback.bind(this,o)):i.get(e,b.executeCallback.bind(this,o))}static executeCallback(e,t){"function"==typeof e&&e(t),window.PluginManager.initializePlugins()}}let w="element-loader-backdrop";class _ extends m{static create(e){e.classList.add("has-element-loader"),_.exists(e)||(_.appendLoader(e),setTimeout(()=>{let t=e.querySelector(".".concat(w));t&&t.classList.add("element-loader-backdrop-open")},1))}static remove(e){e.classList.remove("has-element-loader");let t=e.querySelector(".".concat(w));t&&t.remove()}static exists(e){return e.querySelectorAll(".".concat(w)).length>0}static getTemplate(){return'\n        <div class="'.concat(w,'">\n            <div class="loader" role="status">\n                <span class="').concat("visually-hidden",'">Loading...</span>\n            </div>\n        </div>\n        ')}static appendLoader(e){e.insertAdjacentHTML("beforeend",_.getTemplate())}}window.router["frontend.cookie.offcanvas"];let C={accountOrder:"Account",accountPayment:"Account",accountProfile:"Account",address:"Account",auth:"Account",checkout:"Checkout",error:"Error",landingPage:"Landing page",maintenance:"Maintenance",navigation:"Navigation",newsletter:"Newsletter",product:"Product",register:"Account",search:"Search",wishlist:"Wish list"},A={accountOrder:{orderOverview:"Order overview",orderSingleOverview:"Order details",editOrder:"Order edit"},accountPayment:{paymentOverview:"Payment overview"},accountProfile:{index:"Account overview",profileOverview:"Profile overview"},address:{accountAddressOverview:"Address overview",accountCreateAddress:"Address create"},auth:{loginPage:"Sign in",guestLoginPage:"Guest sign in",logout:"Sign out",recoverAccountForm:"Account recovery"},checkout:{cartPage:"Cart",finishPage:"Checkout finish",confirmPage:"Checkout confirm"},error:{error:"Error page"},landingPage:{index:"Landing page"},maintenance:{renderMaintenancePage:"Maintenance"},navigation:{home:"Home",index:"Product listing"},newsletter:{subscribeMail:"Newsletter subscription"},product:{index:"Product detail"},register:{accountRegisterPage:"Sign up",customerGroupRegistration:"Business sign up",checkoutRegisterPage:"Checkout sign up",confirmRegistration:"Sign up confirmation"},search:{search:"Search"},wishlist:{index:"Wish list"}};function E(e){return e.charAt(0).toLowerCase()+e.slice(1)}let O={"Checkout finish":["order-created"]};async function S(e,t){let s=O[e]||[],{load:n}=await r.e("extension340563725_SwagAnalytics_Resources_app_storefront_src_event_track_event-module-loader_js").then(r.bind(r,732));
1s.forEach(e=>n(e).then(e=>{var r;return(r=e.pageLoaded)===null||void 0===r?void 0:r.call(e,t)}))}async function T(e){var t,r;let s=await L();if(null!==s&&s.id!==e.user.id&&e.identify(s.id,{firstName:s.firstName,lastName:s.lastName,email:s.email,customerGroupId:s.customerGroupId,customerGroupName:s.customerGroupName,guest:s.guest}),null===s&&null!==e.user.id){e.reset();return}let{category:n,name:i}=function(e,t,r){var s,n,i;let o=E(String(e)),a=E(String(t));return"string"==typeof r?function(e){let t=null;switch(e){case"page":t="Shop page";break;case"landingpage":t="Landing page";break;case"product_list":t="Product listing";break;case"product_detail":t="Product detail"}return{category:"CMS",name:t}}(r):{category:(s=C[E(o)])!==null&&void 0!==s?s:null,name:(i=(n=A[E(o)])===null||void 0===n?void 0:n[E(a)])!==null&&void 0!==i?i:null}}(window.shopwareAnalytics.storefrontController,window.shopwareAnalytics.storefrontAction,window.shopwareAnalytics.storefrontCmsPageType);e.page(n,i,{storefrontController:(r=window.shopwareAnalytics.storefrontController).charAt(0).toLowerCase()+r.slice(1),storefrontAction:window.shopwareAnalytics.storefrontAction,storefrontRoute:window.shopwareAnalytics.storefrontRoute,storefrontCmsPageType:(t=window.shopwareAnalytics.storefrontCmsPageType)!==null&&void 0!==t?t:null}),S(i,{})}async function L(){var e;let t=await fetch(window.router["frontend.shopware_analytics.customer.data"]),r=await t.json();return(e=null==r?void 0:r.customer)!==null&&void 0!==e?e:null}let k="_swa_consent_enabled";function I(t){let r=t.detail;"object"==typeof r&&Object.prototype.hasOwnProperty.call(r,k)&&(r[k]?(this.plugin.setConsentActive(!0),T(this.instance)):(this.plugin.setConsentActive(!1),this.instance.clearStorage(),function(){let t=document.cookie.split(";"),r=/^_swa_.*$/;t.forEach(t=>{let s=t.split("=")[0].trim();s.match(r)&&e.removeItem(s)})}()))}let P="_swa_anonymousId",x="_swa_userId",j="_swa_userTraits";class N extends Event{constructor(e,t,r,s,n){super(e),this.payload={context:r.context,screen:r.screen,user:r.user,anonymousId:r.anonymousId,...t},this.instance=r,this.config=s,this.context=n}}let q="identify";class R extends N{constructor(e,t,r){super(q,{id:e,traits:t},r,r.config,r.context)}}let D="page";class M extends N{constructor(e,t,r,s){super(D,{category:e,name:t,properties:r},s,s.config,s.context)}}let F="reset";class H extends N{constructor(e){super(F,{},e,e.config,e.context)}}let B="track";class U extends N{constructor(e,t,r){super(B,{name:e,properties:t},r,r.config,r.context)}}let $={identify:q,page:D,reset:F,track:B};class G extends EventTarget{addEventListener(e,t){let r=this._subscriber[e]||[];r.push(t),this._subscriber[e]=r}removeEventListener(e,t){var r;this._subscriber[e]=(r=this._subscriber[e])===null||void 0===r?void 0:r.filter(e=>e!==t)}dispatchEvent(e){var t;(t=this._subscriber[e.type])===null||void 0===t||t.forEach(t=>setTimeout(()=>t(e),0))}constructor(...e){super(...e),this._subscriber=[]}}let J=window._shopwareAnalytics=new class{async identify(e,t){this._updateUser(e,t),this._emitter.dispatchEvent(new R(e,t,this))}async page(e,t,r){this._emitter.dispatchEvent(new M(e,t,r,this))}async track(e,t){this._emitter.dispatchEvent(new U(e,t,this))}async reset(){let e=()=>{this.clearStorage(),this._emitter.removeEventListener($.reset,e)};this._emitter.addEventListener($.reset,e),this._emitter.dispatchEvent(new H(this))}clearStorage(){this._storage.removeItem(x),this._storage.removeItem(j),this._storage.removeItem(P)}use(e){e.install(this)}subscribe(e,t){this._emitter.addEventListener(e,t)}get config(){return{...this._config}}get anonymousId(){return this._storage.getItem(P)||this._storage.setItem(P,JSON.stringify(globalThis.crypto.randomUUID())),JSON.parse(this._storage.getItem(P))}get user(){return{id:JSON.parse(this._storage.getItem(x)),traits:JSON.parse(this._storage.getItem(j))}}get screen(){return globalThis.screen?{width:globalThis.screen.width,height:globalThis.screen.height,density:globalThis.devicePixelRatio}:{}}get context(){var e;return{app:this._config.app,library:{name:"shopware-analytics",version:"0.3.0"},locale:globalThis.navigator.language,page:this.getPage(),screen:this.screen,timestamp:Date.now(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userAgent:globalThis.navigator.userAgent,userAgentData:(e=globalThis.navigator.userAgentData)!==null&&void 0!==e?e:null}}getPage(){return{path:globalThis.location.pathname,referrer:document.referrer,search:globalThis.location.search,title:document.title,url:globalThis.location.href}}_updateUser(e,t){this._storage.setItem(x,JSON.stringify(e)),this._storage.setItem(j,JSON.stringify(t))}constructor(e={debug:!1,app:"storefront"}){this._storage=null,this._config=e,this._emitter=new G,this._storage=globalThis.localStorage}}({debug:(s=(t=window.shopwareAnalytics)===null||void 0===t?void 0:t.debug)!==null&&void 0!==s&&s,app:"storefront"});if(window.shopwareAnalytics&&""!==window.shopwareAnalytics.trackingId){let t=new class{setConsentActive(e){this._consentActive=e}get isConsentActive(){return this._consentActive}async page(e){let{payload:t,config:r,context:s,instance:n}=e;r.debug&&this._trace($.page,t,r),this._send({type:$.page,timestamp:new Date(s.timestamp).toISOString(),anonymousId:t.anonymousId,properties:this._removeEmptyValuesFromObjectRecursively({...t.properties,category:t.category,name:t.name,title:s.page.title,path:s.page.path,url:s.page.url,referrer:s.page.referrer,search:s.page.search}),context:s,customer:await this._getIdentifiedCustomer(n)})}async track(e){let{payload:t,config:r,context:s,instance:n}=e;r.debug&&this._trace($.track,t,r),this._send({type:$.track,timestamp:new Date(s.timestamp).toISOString(),anonymousId:t.anonymousId,name:t.name,properties:t.properties,context:s,customer:await this._getIdentifiedCustomer(n)})}async identify(e){let{payload:t,config:r,context:s,instance:n}=e;r.debug&&this._trace($.identify,t,r),this._send({type:$.identify,timestamp:new Date(s.timestamp).toISOString(),anonymousId:t.anonymousId,context:s,customer:await this._getIdentifiedCustomer(n)})}reset(e){let{payload:t,config:r,instance:s}=e;r.debug&&this._trace($.reset,t,r),this.track(new U("user:logout",{},s))}loaded(){return!0}install(e){globalThis.crypto&&globalThis.crypto.randomUUID&&(e.subscribe($.identify,this.identify.bind(this)),e.subscribe($.page,this.page.bind(this)),e.subscribe($.reset,this.reset.bind(this)),e.subscribe($.track,this.track.bind(this)))}async _getIdentifiedCustomer(e){let{user:t}=e;return null===t.id?null:{customerGroupId:e.user.traits.customerGroupId,customerGroupName:e.user.traits.customerGroupName,guest:e.user.traits.guest}}_removeEmptyValuesFromObjectRecursively(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,r]=e;return null!=r}).map(e=>{let[t,r]=e;return[t,r===Object(r)?this._removeEmptyValuesFromObjectRecursively(r):r]}
1))}_send(e){this._consentActive&&fetch("".concat(this._trackingURL,"/").concat(e.type),{method:"POST",headers:{"Content-Type":"application/json","Shopware-Tracking-Id":this._trackingId},body:JSON.stringify(e)})}_trace(e,t,r){console.dir({trackingId:this._trackingId,event:e,payload:t,config:r})}constructor(e){this.name="shopware-analytics",this._trackingId=e,this._trackingURL="https://analytics.shopware.io/v1",this._consentActive=!1;try{this._trackingURL="https://analytics.shopware.io/v1"}catch(e){}}}(window.shopwareAnalytics.trackingId);J.use(t),!0===window.shopwareAnalytics.merchantConsent&&(function(e){let t=t=>r=>{e.track(t,r.detail)};document.addEventListener("product:search-performed",t("product:search-performed")),document.addEventListener("product:search-suggestion-product-viewed",t("product:search-suggestion-product-viewed"))}(J),function(t,r,s){window.useDefaultCookieConsent&&(e.getItem(k)?(s.setConsentActive(!0),T(r)):(s.setConsentActive(!1),r.clearStorage()),t.subscribe("CookieConfiguration_Update",I.bind({instance:r,plugin:s})))}(document.$emitter,J,t),function(e,t,r){!0!==window.useDefaultCookieConsent&&e.addEventListener("Shopware Analytics",e=>{e.detail&&"consent_status"===e.detail.event&&(!0===e.detail["Shopware Analytics"]?(r.setConsentActive(!0),T(t)):(r.setConsentActive(!1),t.clearStorage()))})}(window,J,t),function(e,t,r){!0!==window.useDefaultCookieConsent&&(e.addEventListener("CookiebotOnAccept",()=>{Cookiebot.consent.statistics?(r.setConsentActive(!0),T(t)):(r.setConsentActive(!1),t.clearStorage())}),e.addEventListener("CookiebotOnDecline",()=>{r.setConsentActive(!1),t.clearStorage()}))}(window,J,t),function(e,t,r){!0!==e.useDefaultCookieConsent&&"function"==typeof e.__cmp&&e.__cmp("addEventListener",["consent",()=>{var s,n,i,o;let a=e.__cmp("getCMPData"),c=(i=(n=a.vendorsList)===null||void 0===n?void 0:(s=n.find(e=>"Shopware Analytics"===e.name))===null||void 0===s?void 0:s.id)!==null&&void 0!==i?i:null;if(!c){r.setConsentActive(!1),t.clearStorage();return}(o=a.vendorConsents[c])!==null&&void 0!==o&&o?(r.setConsentActive(!0),T(t)):(r.setConsentActive(!1),t.clearStorage())},!1])}(window,J,t),function(e,t,r){window.useDefaultCookieConsent||e.subscribe("sw-analytics-consent",e=>{var s;((s=e.detail)===null||void 0===s?void 0:s.consent)===!0?(r.setConsentActive(!0),T(t)):(r.setConsentActive(!1),t.clearStorage())})}(document.$emitter,J,t))}else J.clearStorage()})()})();

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.