"use strict";(()=>{var vo=Object.create;var Bn=Object.defineProperty;var mo=Object.getOwnPropertyDescriptor;var po=Object.getOwnPropertyNames;var go=Object.getPrototypeOf,ho=Object.prototype.hasOwnProperty;var qt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var yo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of po(t))!ho.call(e,o)&&o!==n&&Bn(e,o,{get:()=>t[o],enumerable:!(r=mo(t,o))||r.enumerable});return e};var wo=(e,t,n)=>(n=e!=null?vo(go(e)):{},yo(t||!e||!e.__esModule?Bn(n,"default",{value:e,enumerable:!0}):n,e));var ir=qt((ca,or)=>{(function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(n,r){return n<>>32-r},rotr:function(n,r){return n<<32-r|n>>>r},endian:function(n){if(n.constructor==Number)return t.rotl(n,8)&16711935|t.rotl(n,24)&4278255360;for(var r=0;r0;n--)r.push(Math.floor(Math.random()*256));return r},bytesToWords:function(n){for(var r=[],o=0,i=0;o>>5]|=n[o]<<24-i%32;return r},wordsToBytes:function(n){for(var r=[],o=0;o>>5]>>>24-o%32&255);return r},bytesToHex:function(n){for(var r=[],o=0;o>>4).toString(16)),r.push((n[o]&15).toString(16));return r.join("")},hexToBytes:function(n){for(var r=[],o=0;o>>6*(3-u)&63)):r.push("=");return r.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var r=[],o=0,i=0;o>>6-i*2);return r}};or.exports=t})()});var Zt=qt((la,ar)=>{var $t={utf8:{stringToBytes:function(e){return $t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape($t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n{(function(){var e=ir(),t=Zt().utf8,n=Zt().bin,r=function(i){i.constructor==String?i=t.stringToBytes(i):typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(i)?i=Array.prototype.slice.call(i,0):Array.isArray(i)||(i=i.toString());var u=e.bytesToWords(i),s=i.length*8,l=[],c=1732584193,f=-271733879,m=-1732584194,p=271733878,w=-1009589776;u[s>>5]|=128<<24-s%32,u[(s+64>>>9<<4)+15]=s;for(var y=0;y>>31}var U=(c<<5|c>>>27)+w+(l[v]>>>0)+(v<20?(f&m|~f&p)+1518500249:v<40?(f^m^p)+1859775393:v<60?(f&m|f&p|m&p)-1894007588:(f^m^p)-899497514);w=p,p=m,m=f<<30|f>>>2,f=c,c=U}c+=g,f+=C,m+=M,p+=E,w+=A}return[c,f,m,p,w]},o=function(i,u){var s=e.wordsToBytes(r(i));return u&&u.asBytes?s:u&&u.asString?n.bytesToString(s):e.bytesToHex(s)};o._blocksize=16,o._digestsize=20,ur.exports=o})()});var F=function(){return F=Object.assign||function(t){for(var n,r=1,o=arguments.length;r0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]>18&63,i=l>>12&63,u=l>>6&63,s=l&63,m[f++]=Te.charAt(o)+Te.charAt(i)+Te.charAt(u)+Te.charAt(s);while(c>16&255,r=c>>8&255,o=c&255,s===64?w[m++]=String.fromCharCode(n):l===64?w[m++]=String.fromCharCode(n,r):w[m++]=String.fromCharCode(n,r,o);while(f=me.error&&typeof console<"u"){var f=St+u+` `;s?console.error.apply(console,J([f+` `,s],l,!1)):console.error.apply(console,J([f],l,!1))}}function r(u,s){for(var l=[],c=2;c=me.warn&&typeof console<"u"){var f=St+u;s?console.warn.apply(console,J([f+` `,s],l,!1)):console.warn.apply(console,J([f],l,!1))}}function o(u){for(var s=[],l=1;l=me.debug&&typeof console<"u"&&console.debug.apply(console,J([St+u],s,!1))}function i(u){for(var s=[],l=1;l=me.info&&typeof console<"u"&&console.info.apply(console,J([St+u],s,!1))}return{setLogLevel:t,warn:r,error:n,debug:o,info:i}}function Oo(){var e=[],t=[],n={},r={},o=function(i){var u=Bo(i),s=No(i),l=[],c=Wt(e.concat(Object.values(n)),i,s,u);l.push.apply(l,c);var f=qo(t.concat(Object.values(r)),i,s,u);return l.push.apply(l,f),l};return{getGlobalPrimitives:function(){return e.concat(Object.values(n))},getConditionalProviders:function(){return t.concat(Object.values(r))},addGlobalContexts:function(i){if(Array.isArray(i)){for(var u=[],s=[],l=0,c=i;l0){for(var t=!1,n=0,r=e.slice(2);n1?Do(t):!1}function Wn(e){var t=new RegExp("^iglu:((?:(?:[a-zA-Z0-9-_]+|\\*).)+(?:[a-zA-Z0-9-_]+|\\*))/([a-zA-Z0-9-_.]+|\\*)/jsonschema/([1-9][0-9]*|\\*)-(0|[1-9][0-9]*|\\*)-(0|[1-9][0-9]*|\\*)$"),n=t.exec(e);if(n!==null&&Jn(n[1]))return n.slice(1,6)}function Jt(e){var t=Wn(e);if(t){var n=t[0];return t.length===5&&Jn(n)}return!1}function Uo(e){return Array.isArray(e)&&e.every(function(t){return typeof t=="string"})}function Vn(e){return Uo(e)?e.every(function(t){return Jt(t)}):typeof e=="string"?Jt(e):!1}function Ze(e){var t=e;return Hn(t)&&"schema"in t&&"data"in t?typeof t.schema=="string"&&typeof t.data=="object":!1}function Lo(e){var t=e,n=0;if(e!=null&&typeof e=="object"&&!Array.isArray(e)){if(Object.prototype.hasOwnProperty.call(t,"accept"))if(Vn(t.accept))n+=1;else return!1;if(Object.prototype.hasOwnProperty.call(t,"reject"))if(Vn(t.reject))n+=1;else return!1;return n>0&&n<=2}return!1}function It(e){return typeof e=="function"&&e.length<=1}function pe(e){return It(e)||Ze(e)}function Xn(e){return Array.isArray(e)&&e.length===2?Array.isArray(e[1])?It(e[0])&&e[1].every(pe):It(e[0])&&pe(e[1]):!1}function Yn(e){return Array.isArray(e)&&e.length===2&&Lo(e[0])?Array.isArray(e[1])?e[1].every(pe):pe(e[1]):!1}function $e(e){return Xn(e)||Yn(e)}function jo(e,t){var n=0,r=0,o=e.accept;Array.isArray(o)?e.accept.some(function(u){return Tt(u,t)})&&r++:typeof o=="string"&&Tt(o,t)&&r++;var i=e.reject;return Array.isArray(i)?e.reject.some(function(u){return Tt(u,t)})&&n++:typeof i=="string"&&Tt(i,t)&&n++,r>0&&n===0?!0:(r===0&&n>0,!1)}function Tt(e,t){if(!Jt(e))return!1;var n=Wn(e),r=Ro(t);if(n&&r){if(!Fo(n[0],r[0]))return!1;for(var o=1;o<5;o++)if(!Qn(n[o],r[o]))return!1;return!0}return!1}function Fo(e,t){var n=t.split("."),r=e.split(".");if(n&&r){if(n.length!==r.length)return!1;for(var o=0;on;)i.shift();return u()},removeHead:function(s){for(var l=0;l0?A[0].getServerAnonymization():void 0}function ie(x){return A.length>0&&Q()!==x.getServerAnonymization()?!1:(A.push(x),!0)}function ae(){return A}function B(){return v?R()>=C:A.length>=1}function q(){var x=new Headers;return v&&x.append("Content-Type","application/json; charset=UTF-8"),s&&Object.keys(s).forEach(function(D){x.append(D,s[D])}),Q()&&x.append("SP-Anonymous","*"),x}function ye(){var x=t;t.includes("://")||(x="".concat(r,"://").concat(t)),o&&(x="".concat(x,":").concat(o));var D=v?p:"/i";return x+D}function ce(x,D){fe(!1),U=new AbortController,T=setTimeout(function(){var je="Request timed out";console.error(je),T=void 0,fe(!1,je)},l??5e3);var $=F({headers:q(),signal:U.signal,keepalive:f,credentials:E},D),Le=new Request(x,$);return Le}function le(){var x=Yo(A.map(function(D){return D.getPOSTRequestBody()}));return ce(ye(),{method:"POST",body:Xo(x)})}function ke(){if(A.length!==1)throw new Error("Only one event can be sent in a GET request");var x=A[0],D=x.getGETRequestURL(ye(),y);return ce(D,{method:"GET"})}function Ce(){if(A.length!==0)return v?le():ke()}function fe(x,D){if(T!==void 0&&(clearTimeout(T),T=void 0),U!==void 0){var $=U;U=void 0,x||$.abort(D)}}return{addEvent:ie,getEvents:ae,toRequest:Ce,countBytes:R,countEvents:Y,isFull:B,closeRequest:fe}}function Mn(e){for(var t=0,n=0;n=55296&&r<=57343?(t+=4,n++):r<65535?t+=3:t+=4}return t}function $o(e){var t={co:!0,cx:!0},n=[];for(var r in e)e.hasOwnProperty(r)&&!t[r]&&n.push(r+"="+encodeURIComponent(e[r]));for(var o in t)e.hasOwnProperty(o)&&t[o]&&n.push(o+"="+encodeURIComponent(e[o]));return"?"+n.join("&")}function Zo(e){var t=Object.keys(e).map(function(n){return[n,e[n]]}).reduce(function(n,r){var o=r[0],i=r[1];return n[o]=i.toString(),n},{});return t}function qn(e){var t=null,n=null,r=null,o=null;function i(){return e.payload}function u(){var p;return(p=e.svrAnon)!==null&&p!==void 0?p:!1}function s(p){return t===null&&(t=$o(p)),t}function l(p,w){var y=s(i());return w?p+y.replace("?","?stm="+new Date().getTime()+"&"):p+y}function c(){if(r===null){var p=s(i());r=Mn(p)}return r}function f(){return n===null&&(n=Zo(i())),n}function m(){return o===null&&(o=Mn(JSON.stringify(f()))),o}return{getPayload:i,getServerAnonymization:u,getGETRequestURL:l,getGETRequestBytesCount:c,getPOSTRequestBody:f,getPOSTRequestBytesCount:m}}function nr(e){var t=e.endpoint,n=e.eventMethod,r=n===void 0?"post":n,o=e.postPath,i=e.protocol,u=e.port,s=e.maxPostBytes,l=s===void 0?4e4:s,c=e.maxGetBytes,f=e.bufferSize,m=f===void 0?1:f,p=e.customHeaders,w=e.serverAnonymization,y=e.connectionTimeout,g=e.keepalive,C=e.idService,M=e.dontRetryStatusCodes,E=M===void 0?[]:M,A=e.retryStatusCodes,v=A===void 0?[]:A,T=e.retryFailedRequests,U=T===void 0?!0:T,R=e.onRequestFailure,Y=e.onRequestSuccess,Q=e.customFetch,ie=Q===void 0?fetch:Q,ae=e.useStm,B=e.eventStore,q=B===void 0?Pt({}):B,ye=e.credentials,ce=!1,le=!1,ke=r.toLowerCase()==="post";E=E.concat([400,401,403,410,422]);function Ce(b){return b>=200&&b<300||!U?!1:v.includes(b)?!0:!E.includes(b)}function fe(b,S){Y!==void 0&&setTimeout(function(){try{Y?.(b,S)}catch(P){z.error("Error in onRequestSuccess",P)}},0)}function x(b,S){R!==void 0&&setTimeout(function(){try{R?.(b,S)}catch(P){z.error("Error in onRequestFailure",P)}},0)}function D(b){return Me(this,void 0,void 0,function(){var S,P,I,H,L,ue;return qe(this,function(j){switch(j.label){case 0:if(S=b.toRequest(),S===void 0)throw new Error("Empty batch");P=b.getEvents().map(function(ne){return ne.getPayload()}),j.label=1;case 1:return j.trys.push([1,4,,5]),[4,ie(S)];case 2:return I=j.sent(),[4,I.text()];case 3:return j.sent(),b.closeRequest(!0),I.ok?(fe(P,I),[2,{success:!0,retry:!1,status:I.status}]):(H=Ce(I.status),x({events:P,status:I.status,message:I.statusText,willRetry:H},I),[2,{success:!1,retry:H,status:I.status}]);case 4:return L=j.sent(),b.closeRequest(!1),ue=typeof L=="string"?L:L?L.message:"Unknown error",x({events:P,message:ue,willRetry:!0}),[2,{success:!1,retry:!0}];case 5:return[2]}})})}function $(){return Qo({endpoint:t,protocol:i,port:u,eventMethod:r,customHeaders:p,connectionTimeout:y,keepalive:g,maxPostBytes:l,useStm:ae,credentials:ye,postPath:o})}function Le(b){var S=function(H,L){return z.warn("Event ("+H+"B) too big, max is "+L)};if(ke){var P=b.getPOSTRequestBytesCount()+88,I=P>l;return I&&S(P,l),I}else{if(c===void 0)return!1;var P=b.getGETRequestBytesCount(),I=P>c;return I&&S(P,c),I}}function je(){return Me(this,void 0,void 0,function(){var b;return qe(this,function(S){switch(S.label){case 0:return C&&!ce?(ce=!0,b=new Request(C,{method:"GET"}),[4,ie(b)]):[3,2];case 1:S.sent(),S.label=2;case 2:return[2]}})})}function He(){return Me(this,void 0,void 0,function(){var b;return qe(this,function(S){switch(S.label){case 0:if(le)return[3,5];le=!0,S.label=1;case 1:return S.trys.push([1,3,4,5]),[4,it()];case 2:return S.sent(),[3,5];case 3:return b=S.sent(),z.error("Error sending events",b),[3,5];case 4:return le=!1,[7];case 5:return[2]}})})}function it(){return Me(this,void 0,void 0,function(){var b,S,P,I,H,L,ue,j,ne,ve;return qe(this,function(W){switch(W.label){case 0:return[4,je()];case 1:W.sent(),b=$(),S=q.iterator(),W.label=2;case 2:return b.isFull()?[3,4]:[4,S.next()];case 3:return P=W.sent(),I=P.value,H=P.done,H||I===void 0?[3,4]:(L=qn(I),b.addEvent(L)?[3,2]:[3,4]);case 4:return b.countEvents()===0?[2]:[4,D(b)];case 5:return ue=W.sent(),j=ue.success,ne=ue.retry,ve=ue.status,j||!ne?(j||z.error("Status ".concat(ve,", will not retry.")),[4,q.removeHead(b.countEvents())]):[3,7];case 6:W.sent(),W.label=7;case 7:return j?[4,it()]:[3,9];case 8:W.sent(),W.label=9;case 9:return[2]}})})}function te(b){return Me(this,void 0,void 0,function(){var S,P,I,H;return qe(this,function(L){switch(L.label){case 0:return S=Ho({payload:b,svrAnon:w}),P=qn(S),Le(P)?(I=$(),I.addEvent(P),[4,D(I)]):[3,2];case 1:return L.sent(),[3,5];case 2:return[4,q.add(S)];case 3:return H=L.sent(),H>=m?[4,He()]:[3,5];case 4:L.sent(),L.label=5;case 5:return[2]}})})}function V(b){t=b}function At(b){w=b}function de(b){m=b}return{flush:He,input:te,setCollectorUrl:V,setAnonymousTracking:At,setBufferSize:de}}var rr=xo;var yr=wo(sr());function Ko(e){try{var t=window.localStorage,n=t.getItem(e+".expires");if(n===null||+n>Date.now())return t.getItem(e);t.removeItem(e),t.removeItem(e+".expires");return}catch{return}}function ei(e,t,n){n===void 0&&(n=63072e3);try{var r=window.localStorage,o=Date.now()+n*1e3;return r.setItem("".concat(e,".expires"),o.toString()),r.setItem(e,t),!0}catch{return!1}}function cr(e){try{var t=window.localStorage;return t.removeItem(e),t.removeItem(e+".expires"),!0}catch{return!1}}function lr(e){try{return window.sessionStorage.getItem(e)}catch{return}}function ti(e,t){try{return window.sessionStorage.setItem(e,t),!0}catch{return!1}}var ni={sessionId:!0,sourceId:!0,sourcePlatform:!1,userId:!1,reason:!1};function ri(e,t,n){var r,o,i=new Date().getTime(),u=F(F({},ni),t),s=n.domainUserId,l=n.userId,c=n.sessionId,f=n.sourceId,m=n.sourcePlatform,p=n.event,w=p.currentTarget,y=typeof u.reason=="function"?u.reason(p):(r=w?.textContent)===null||r===void 0?void 0:r.trim();return e?o=[s,i,u.sessionId&&c,u.userId&&Kt(l||""),u.sourceId&&Kt(f||""),u.sourcePlatform&&m,u.reason&&Kt(y||"")].map(function(g){return g||""}).join(".").replace(/([.]*$)/,""):o=n.domainUserId+"."+i,o}function Kt(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")}function oi(e){return!!(e&&typeof e.valueOf()=="string")}function fr(e){return Number.isInteger&&Number.isInteger(e)||typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function ii(){if(typeof Intl=="object"&&typeof Intl.DateTimeFormat=="function"){var e=new Intl.DateTimeFormat().resolvedOptions();return e.timeZone}}function dr(e){if(!oi(e)){e=e.text||"";var t=document.getElementsByTagName("title");t&&t[0]!=null&&(e=t[0].text)}return e}function tt(e){var t=new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)"),n=t.exec(e);return n?n[1]:e}function vr(e){var t=e.length;return e.charAt(--t)==="."&&(e=e.slice(0,t)),e.slice(0,2)==="*."&&(e=e.slice(1)),e}function en(e){var t=window,n=nt("referrer",t.location.href)||nt("referer",t.location.href);if(n)return n;if(e)return e;try{if(t.top)return t.top.document.referrer;if(t.parent)return t.parent.document.referrer}catch{}return document.referrer}function se(e,t,n,r){if(e.addEventListener)return e.addEventListener(t,n,r),!0;if(e.attachEvent)return e.attachEvent("on"+t,n);e["on"+t]=n}function nt(e,t){var n=new RegExp("^[^#]*[?&]"+e+"=([^&#]*)").exec(t);return n?decodeURIComponent(n[1].replace(/\+/g," ")):null}function ai(e,t,n){var r=t+"="+n,o=e.split("#"),i=o[0].split("?"),u=i.shift(),s=i.join("?");if(!s)s=r;else{for(var l=!0,c=s.split("&"),f=0;f=0;s--){var l=u.slice(s).join(".");if(Pe(o,i,0,"/",l,e,t),Pe(o)===i){Ct(o,"/",l,e,t);for(var c=si(r),f=0;f1?document.cookie=e+"="+encodeURIComponent(t??"")+(n?"; Expires="+new Date(+new Date+n*1e3).toUTCString():"")+(r?"; Path="+r:"")+(o?"; Domain="+o:"")+(i?"; SameSite="+i:"")+(u?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}function wr(e){if(e==null||typeof e!="object"||Array.isArray(e))return function(){return!0};var t=Object.prototype.hasOwnProperty.call(e,"allowlist"),n=fi(e);return li(e,function(r){return ci(r,n)===t})}function cn(e){return e.className.match(/\S+/g)||[]}function ci(e,t){for(var n=cn(e),r=0,o=n;r1?nt(t,r[1]):null}function mr(e,t,n){var r;return e==="translate.googleusercontent.com"?(n===""&&(n=t),t=(r=mi(t,"u"))!==null&&r!==void 0?r:"",e=tt(t)):(e==="cc.bingj.com"||e==="webcache.googleusercontent.com")&&(t=document.links[0].href,e=tt(t)),[e,t,n]}var br=0,xe=1,pi=2,rt=3,ln=4,Sr=5,Ie=6,_e=7,Re=8,De=9,ge=10;function gi(){var e=["1","",0,0,0,void 0,"","","",void 0,0];return e}function hi(e,t,n,r){var o=new Date,i=Math.round(o.getTime()/1e3),u;e?(u=e.split("."),u.unshift("0")):u=["1",t,i,r,i,"",n],(!u[Ie]||u[Ie]==="undefined")&&(u[Ie]=K()),(!u[_e]||u[_e]==="undefined")&&(u[_e]=""),(!u[Re]||u[Re]==="undefined")&&(u[Re]=""),(!u[De]||u[De]==="undefined")&&(u[De]=""),(!u[ge]||u[ge]==="undefined")&&(u[ge]=0);var s=function(f,m){var p=parseInt(f);return isNaN(p)?m:p},l=function(f){return f?s(f,void 0):void 0},c=[u[br],u[xe],s(u[pi],i),s(u[rt],r),s(u[ln],i),l(u[Sr]),u[Ie],u[_e],u[Re],l(u[De]),s(u[ge],0)];return c}function yi(e,t){var n;return e[xe]?n=e[xe]:t?(n="",e[xe]=n):(n=K(),e[xe]=n),n}function Ke(e,t){t===void 0&&(t={memorizedVisitCount:1});var n=t.memorizedVisitCount;un(e)?(e[_e]=e[Ie],e[Sr]=e[ln],e[rt]++):e[rt]=n;var r=K();return e[Ie]=r,e[ge]=0,e[Re]="",e[De]=void 0,r}function tn(e){e[ln]=Math.round(new Date().getTime()/1e3)}function wi(e,t){if(e[ge]===0){var n=t.build();e[Re]=n.eid;var r=n.dtm||n.ttm;e[De]=r?parseInt(r):void 0}}function bi(e){e[ge]+=1}function Si(e,t){var n=J([],e,!0);return t&&(n[xe]="",n[_e]=""),n.shift(),n.join(".")}function pr(e,t,n){var r=e[De],o={userId:n?"00000000-0000-0000-0000-000000000000":e[xe],sessionId:e[Ie],eventIndex:e[ge],sessionIndex:e[rt],previousSessionId:n?null:e[_e]||null,storageMechanism:t=="localStorage"?"LOCAL_STORAGE":"COOKIE_1",firstEventId:e[Re]||null,firstEventTimestamp:r?new Date(r).toISOString():null};return o}function nn(e){return e[Ie]}function Ti(e){return e[xe]}function rn(e){return e[rt]}function un(e){return e[br]==="0"}function gr(e){return e[ge]}var xi="iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",Ii="iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0",Pi="iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2",ki="iglu:com.snowplowanalytics.snowplow/application/jsonschema/1-0-0";function Ci(){return"ResizeObserver"in window}var hr=!1;function Ei(){if(!hr&&!(!document||!document.body||!document.documentElement)){hr=!0;var e=new ResizeObserver(function(t){for(var n=0,r=t;nnew Date)&&(m=n[0])!==null&&m!==void 0?m:Pe(e)}function l(m,p,w,y,g,C){return n=[m,p,w,y,g,C],o=!1,t===void 0&&(t=setTimeout(function(){t=void 0,f()},i)),r=new Date(Date.now()+Math.min(u,p??u)*1e3),!0}function c(m,p,w,y){n=void 0,o=!0,t!==void 0&&(clearTimeout(t),t=void 0),Ct(e,m,p,w,y)}function f(){if(t!==void 0&&(clearTimeout(t),t=void 0),!o&&(o=!0,n!==void 0)){var m=n[0],p=n[1],w=n[2],y=n[3],g=n[4],C=n[5];Pe(e,m,p,w,y,g,C)}}return{getValue:s,setValue:l,deleteValue:c,flush:f}}function Di(){var e={};function t(s){return e[s]||(e[s]=Ri(s)),e[s]}function n(s){return t(s).getValue()}function r(s,l,c,f,m,p,w){return t(s).setValue(l,c,f,m,p,w)}function o(s,l,c,f,m){t(s).deleteValue(l,c,f,m)}function i(){e={}}function u(){for(var s=0,l=Object.values(e);s=0&&(a=a.slice(0,k)),(k=a.lastIndexOf("/"))!==a.length-1&&(a=a.slice(0,k+1)),a+d)}function $r(a){pn||mt||be.enqueueRequest(a.build())}function Ne(a){return Vr+a+"."+yn}function jt(a){var d=Ne(a);if(O=="localStorage")return Ko(d);if(O=="cookie"||O=="cookieAndLocalStorage")return te.getCookie(d)}function xn(){Ae(),yn=(0,yr.default)((Ee||b)+(Ge||"/")).slice(0,4)}function Je(){var a=new Date;st=a.getTime()}function Zr(){Kr(),Je()}function In(){var a=document.documentElement;return a?[a.scrollLeft||window.pageXOffset,a.scrollTop||window.pageYOffset]:[0,0]}function Pn(){var a=In(),d=a[0];ct=d,lt=d;var h=a[1];ft=h,dt=h}function Kr(){var a=In(),d=a[0];dlt&&(lt=d);var h=a[1];hdt&&(dt=h)}function ht(a){return Math.round(a)}function Ft(){var a=Ne("ses"),d="*";return kn(a,d,hn)}function Bt(a){var d=Ne("id"),h=Si(a,re);return kn(d,h,gn)}function kn(a,d,h){return re&&!Fe?!1:O=="localStorage"?ei(a,d,h):O=="cookie"||O=="cookieAndLocalStorage"?te.setCookie(a,d,h,Ge,Ee,at,ut):!1}function Cn(a){var d=Ne("id"),h=Ne("ses");cr(d),cr(h),te.deleteCookie(d,Ge,Ee,at,ut),te.deleteCookie(h,Ge,Ee,at,ut),a?.preserveSession||(Z=K(),oe=1),a?.preserveUser||(vt=re?"":K(),we=null)}function En(a){a&&a.stateStorageStrategy&&(g.stateStorageStrategy=a.stateStorageStrategy,O=x(g)),re=Le(g),Fe=D(g),_t=$(g),be.setUseLocalStorage(O=="localStorage"||O=="cookieAndLocalStorage"),be.setAnonymousTracking(_t)}function An(){if(!(re&&!Fe)){var a=O!="none"&&!!jt("ses"),d=We();vt=yi(d,re),a?Z=nn(d):Z=Ke(d),oe=rn(d),O!="none"&&(Ft(),tn(d),Bt(d),gr(d)||te.flush())}}function We(){if(O=="none")return gi();var a=jt("id")||void 0;return hi(a,vt,Z,oe)}function On(a){return a.indexOf("http")===0?a:(document.location.protocol==="https:"?"https":"http")+"://"+a}function _n(){(!Dt||y.pageViewId==null)&&(y.pageViewId=K(),y.pageViewUrl=j||S)}function Xe(){return eo()&&(y.pageViewId=K(),y.pageViewUrl=j||S),y.pageViewId}function eo(){if(y.pageViewId==null)return!0;if(Dt||!Be)return!1;if(y.pageViewUrl===void 0)return!0;var a=j||S;if(Be===!0||Be=="full"||!("URL"in window))return y.pageViewUrl!=a;var d=new URL(a),h=new URL(y.pageViewUrl);return Be=="pathname"?d.pathname!=h.pathname:Be=="pathnameAndSearch"?d.pathname!=h.pathname||d.search!=h.search:!1}function Rn(){if(O==="none"||re||!He)return null;var a="_sp_tab_id",d=lr(a);return d||(ti(a,K()),d=lr(a)),d||null}function to(){return{contexts:function(){return[{schema:xi,data:{id:Xe()}}]}}}function no(){return{contexts:function(){return[{schema:Ii,data:F(F({},on()),{tabId:Rn()})}]}}}function ro(){var a=function(h){return re?null:h},d=function(h){return Fe?h:a(h)};return{beforeTrack:function(h){var k=jt("ses"),_=We(),Se=gr(_)===0;if(Ot?mt=!!te.getCookie(Ot):mt=!1,pn||mt){Cn();return}un(_)?(!k&&O!="none"?Z=Ke(_):Z=nn(_),oe=rn(_)):new Date().getTime()-Rt>hn*1e3&&(oe++,Z=Ke(_,{memorizedVisitCount:oe})),tn(_),wi(_,h),bi(_);var X=on(),Ve=X.viewport,Ye=X.documentSize;h.add("vp",Ve),h.add("ds",Ye),h.add("vid",d(oe)),h.add("sid",d(Z)),h.add("duid",a(Ti(_))),h.add("uid",a(we)),Ae(),h.add("refr",Oe(I||P)),h.add("url",Oe(j||S));var Qe=pr(_,O,re);if(Mr&&(!re||Fe)&&oo(h,Qe),O!="none"){Bt(_);var Vt=Ft();(!k||Se)&&Vt&&pt&&!Lt&&(te.flush(),pt(Qe),Lt=!1)}Rt=new Date().getTime()}}}function oo(a,d){var h={schema:Pi,data:d};a.addContextEntity(h)}function io(){var a=We();if(un(a)?(O!="none"?Z=Ke(a):Z=nn(a),oe=rn(a)):(oe++,Z=Ke(a,{memorizedVisitCount:oe})),tn(a),O!="none"){var d=pr(a,O,re);Bt(a);var h=Ft();te.flush(),h&&pt&&(Lt=!0,pt(d))}Rt=new Date().getTime()}function Nt(a,d){return(a||[]).concat(d?d():[])}function ao(a){var d=a.title,h=a.context,k=a.timestamp,_=a.contextCallback;Ae(),Ut&&Ut==Xe()&&_n(),Ut=Xe(),ne=document.title,d?(ve=d,W=!0):W&&(ve=null);var Se=dr(ve||ne);V.track(er({pageUrl:Oe(j||S),pageTitle:Se,referrer:Oe(I||P)}),Nt(h,_),k);var X=new Date,Ve=!1;if(G.enabled&&!G.installed){G.installed=!0,Ve=!0;var Ye={update:function(){if(typeof window<"u"&&typeof window.addEventListener=="function"){var ze=!1,yt=Object.defineProperty({},"passive",{get:function(){ze=!0},set:function(){}}),jn=function(){};window.addEventListener("testPassiveEventSupport",jn,yt),window.removeEventListener("testPassiveEventSupport",jn,yt),Ye.hasSupport=ze}}};Ye.update();var Qe="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(Ye,"hasSupport")?se(document,Qe,Je,{passive:!0}):se(document,Qe,Je),Pn();var Vt=["click","mouseup","mousedown","mousemove","keypress","keydown","keyup","touchend","touchstart"],lo=["resize","focus","blur"],zt=function(fo,ze){return ze===void 0&&(ze=Je),function(yt){return se(document,yt,ze)}};Vt.forEach(zt(document)),lo.forEach(zt(window)),zt(window,Zr)("scroll")}if(G.enabled&&(Nr||Ve)){st=X.getTime();var Ln=void 0;for(Ln in G.configurations){var Mt=G.configurations[Ln];Mt&&(window.clearInterval(Mt.activityInterval),uo(Mt,h,_))}}}function uo(a,d,h){var k=function(X,Ve){Ae(),X({context:Ve,pageViewId:Xe(),minXOffset:ct,minYOffset:ft,maxXOffset:lt,maxYOffset:dt}),Pn()},_=function(){var X=new Date;st+a.configMinimumVisitLength>X.getTime()&&k(a.callback,Nt(d,h)),a.activityInterval=window.setInterval(Se,a.configHeartBeatTimer)},Se=function(){var X=new Date;st+a.configHeartBeatTimer>X.getTime()&&k(a.callback,Nt(d,h))};a.configMinimumVisitLength===0?a.activityInterval=window.setInterval(Se,a.configHeartBeatTimer):a.activityInterval=window.setTimeout(_,a.configMinimumVisitLength)}function Dn(a){var d=a.minimumVisitLength,h=a.heartbeatDelay,k=a.callback;if(fr(d)&&fr(h))return{configMinimumVisitLength:d*1e3,configHeartBeatTimer:h*1e3,callback:k};z.error("Activity tracking minimumVisitLength & heartbeatDelay must be integers")}function so(a){var d=a.context,h=a.minXOffset,k=a.minYOffset,_=a.maxXOffset,Se=a.maxYOffset,X=document.title;X!==ne&&(ne=X,ve=void 0),V.track(tr({pageUrl:Oe(j||S),pageTitle:dr(ve||ne),referrer:Oe(I||P),minXOffset:ht(h),maxXOffset:ht(_),minYOffset:ht(k),maxYOffset:ht(Se)}),d)}function Un(a){var d=G.configurations[a];d?.configMinimumVisitLength===0?window.clearTimeout(d?.activityInterval):window.clearInterval(d?.activityInterval),G.configurations[a]=void 0}var co={getDomainSessionIndex:function(){return oe},getPageViewId:Xe,getTabId:Rn,newSession:io,getCookieName:function(a){return Ne(a)},getUserId:function(){return we},getDomainUserId:function(){return We()[1]},getDomainUserInfo:function(){return We()},setReferrerUrl:function(a){I=a},setCustomUrl:function(a){Ae(),j=Qr(S,a)},setDocumentTitle:function(a){ne=document.title,ve=a,W=!1},discardHashTag:function(a){dn=a},discardBrace:function(a){vn=a},setCookiePath:function(a){Ge=a,xn()},setVisitorCookieTimeout:function(a){gn=a},crossDomainLinker:function(a){Sn(a)},enableActivityTracking:function(a){G.configurations.pagePing||(G.enabled=!0,G.configurations.pagePing=Dn(F(F({},a),{callback:so})))},enableActivityTrackingCallback:function(a){G.configurations.callback||(G.enabled=!0,G.configurations.callback=Dn(a))},disableActivityTracking:function(){Un("pagePing")},disableActivityTrackingCallback:function(){Un("callback")},updatePageActivity:function(){Je()},setOptOutCookie:function(a){Ot=a},setUserId:function(a){we=a},setUserIdFromLocation:function(a){Ae(),we=nt(a,S)},setUserIdFromReferrer:function(a){Ae(),we=nt(a,P)},setUserIdFromCookie:function(a){we=te.getCookie(a)},setCollectorUrl:function(a){be.setCollectorUrl(On(a))},setBufferSize:function(a){be.setBufferSize(a)},flushBuffer:function(a){a===void 0&&(a={}),be.executeQueue(),a.newBufferSize&&be.setBufferSize(a.newBufferSize)},trackPageView:function(a){a===void 0&&(a={}),ao(a)},preservePageViewId:function(){Dt=!0},preservePageViewIdForUrl:function(a){Be=a},disableAnonymousTracking:function(a){g.anonymousTracking=!1,En(a),An(),be.executeQueue()},enableAnonymousTracking:function(a){var d;g.anonymousTracking=(d=a&&a?.options)!==null&&d!==void 0?d:!0,En(a),Fe||_n()},clearUserData:Cn};return F(F({},co),{id:f,namespace:m,core:V,sharedState:y})},l=s(e,t,n,r,o,i),c=F(F({},l),{addPlugin:function(f){var m,p;c.core.addPlugin(f),(p=(m=f.plugin).activateBrowserPlugin)===null||p===void 0||p.call(m,c)}});return u.forEach(function(f){var m;(m=f.activateBrowserPlugin)===null||m===void 0||m.call(f,c)}),c}var et={};function fn(e,t){try{ji(e??Fi()).forEach(t)}catch(n){z.error("Function failed",n)}}function xr(e,t,n){try{Pr(e??Object.keys(t),t).forEach(n)}catch(r){z.error("Function failed",r)}}function Ir(e,t,n,r,o,i){return et.hasOwnProperty(e)?null:(et[e]=Li(e,t,n,r,o,i),et[e])}function ji(e){return Pr(e,et)}function Fi(){return Object.keys(et)}function Pr(e,t){for(var n=[],r=0,o=e;r{let{tag:t="common"}=e,n=localStorage.getItem(Wi)==="true"||!1;return{log:(...r)=>{n&&console.log(`tagsjs(${t}):`,...r)},info:(...r)=>{n&&console.info(`tagsjs(${t}):`,...r)},warn:(...r)=>console.warn(`tagsjs(${t}):`,...r),error:(...r)=>console.error(`tagsjs(${t}):`,...r)}};var Fr=e=>{let{appId:t,collectorUrl:n,shouldTrackLinkClicks:r=!1}=e,o=jr({tag:"snowplow"});o.info("init");let i=[];r&&i.push(Or());let u=Lr("tagsjs.sp",n,{appId:t,discoverRootDomain:!0,cookieSameSite:"Lax",plugins:i});if(!u){o.error("failed to initialize tracker");return}Dr({minimumVisitLength:5,heartbeatDelay:5},[u.id]),r&&_r({trackContent:!0},[u.id]);let s=!1;(()=>{s||(Ur({},[u.id]),s=!0,o.info("tracked page view"))})()};var Xi=e=>{document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e()},Br=Xi;Br(()=>{Fr({appId:"story.ovb-mediasales.de",collectorUrl:"s.story.ovb-mediasales.de",shouldTrackLinkClicks:!0})});})();