@convivainc/conviva-js-appanalytics
Version:
Conviva ECO Sensor library
104 lines (103 loc) • 163 kB
JavaScript
/*!
* Browser tracker for Conviva v1.1.9 (http://bit.ly/sp-js)
* Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang
* Licensed under BSD-3-Clause
*/
'use strict';!function(wa,la){"object"==typeof exports&&"undefined"!=typeof module?la(exports):"function"==typeof define&&define.amd?define(["exports"],la):la((wa="undefined"!=typeof globalThis?globalThis:wa||self).convivaBrowserTracking={})}(this,function(wa){function la(a){return la="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"==typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},la(a)}function Ca(a,
c,b){if(b||2===arguments.length)for(var d,e=0,g=c.length;e<g;e++)!d&&e in c||(d||(d=Array.prototype.slice.call(c,0,e)),d[e]=c[e]);return a.concat(d||Array.prototype.slice.call(c))}function Dg(a){if(!a)return a;switch(4-a.length%4){case 2:a+="==";break;case 3:a+="="}return function(c){var b,d,e,g=0,f=0,k="",n=[];if(!c)return c;c+="";do{var l=(b=$a.indexOf(c.charAt(g++))<<18|$a.indexOf(c.charAt(g++))<<12|(d=$a.indexOf(c.charAt(g++)))<<6|(e=$a.indexOf(c.charAt(g++))))>>16&255;var v=b>>8&255;b&=255;n[f++]=
64===d?String.fromCharCode(l):64===e?String.fromCharCode(l,v):String.fromCharCode(l,v,b)}while(g<c.length);return k=n.join(""),function(p){return decodeURIComponent(p.split("").map(function(m){return"%"+("00"+m.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(k.replace(/\0+$/,""))}(a.replace(/-/g,"+").replace(/_/g,"/"))}function Md(){var a,c={},b=[],d=[],e=[],g=function(f,k){null!=k&&""!==k&&(c[f]=k)};return{add:g,addDict:function(f){for(var k in f)Object.prototype.hasOwnProperty.call(f,k)&&g(k,
f[k])},addJson:function(f,k,n){n&&Le(n)&&(f={keyIfEncoded:f,keyIfNotEncoded:k,json:n},d.push(f),b.push(f))},addContextEntity:function(f){e.push(f)},getPayload:function(){return c},getJson:function(){return b},withJsonProcessor:function(f){a=f},build:function(){return null==a||a(this,d,e),c}}}function Eg(a){return function(c,b,d){for(var e=function(l,v,p){l=JSON.stringify(l);if(a){p=c.add;if(l){var m,z=0,D=0,x=[];if(l){l=unescape(encodeURIComponent(l));do{var A=(m=l.charCodeAt(z++)<<16|l.charCodeAt(z++)<<
8|l.charCodeAt(z++))>>18&63;var w=m>>12&63;var t=m>>6&63;m&=63;x[D++]=$a.charAt(A)+$a.charAt(w)+$a.charAt(t)+$a.charAt(m)}while(z<l.length);A=x.join("");l=l.length%3;l=(l?A.slice(0,l-3):A)+"===".slice(l||3)}l=l.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}p.call(c,v,l)}else c.add(p,l)},g=function(l,v){l||(l=c.getPayload(),l=(a?l.cx:l.co)?JSON.parse(a?Dg(l.cx):l.co):void 0);return l?l.dt=l.dt.concat(v.dt):l=v,l},f=void 0,k=0;k<b.length;k++){var n=b[k];"cx"===n.keyIfEncoded?f=g(f,n.json):
e(n.json,n.keyIfEncoded,n.keyIfNotEncoded)}(b.length=0,d.length)&&(f=g(f,{sc:"sp/ctx/1-0-0",dt:Ca([],d,!0)}),d.length=0);f&&e(f,"cx","co")}}function Le(a){if(!Me(a))return!1;for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c))return!0;return!1}function Me(a){return null!=a&&(a.constructor==={}.constructor||a.constructor===[].constructor)}function Fg(){var a=[],c=[],b=function(d){var e=function(n){var l=0;for(n=n.getJson();l<n.length;l++){var v=n[l];if("ue_px"===v.keyIfEncoded&&"object"===
la(v.json.data)&&(v=v.json.data.schema,"string"==typeof v))return v}return""}(d),g=function(n){n=n.getPayload().e;return"string"==typeof n?n:""}(d),f=[],k=Nd(a,d,g,e);f.push.apply(f,k);d=function(n,l,v,p){var m;n=Ne(n).map(function(z){if((z=function(D,x,A,w){if(Oe(D)){var t=D[0],q=!1;try{q=t({event:x.getPayload(),eventType:A,eventSchema:w})}catch(L){q=!1}if(!0===q)return Nd(D[1],x,A,w)}else if(Pe(D)&&function(L,J){var P=0,E=0,M=L.accept;Array.isArray(M)?L.accept.some(function(N){return ad(N,J)})&&
E++:"string"==typeof M&&ad(M,J)&&E++;M=L.reject;Array.isArray(M)?L.reject.some(function(N){return ad(N,J)})&&P++:"string"==typeof M&&ad(M,J)&&P++;return 0<E&&0===P?!0:!1}(D[0],w))return Nd(D[1],x,A,w);return[]}(z,l,v,p))&&0!==z.length)return z});return(m=[]).concat.apply(m,n.filter(function(z){return null!=z&&z.filter(Boolean)}))}(c,d,g,e);return f.push.apply(f,d),f};return{getGlobalPrimitives:function(){return a},getConditionalProviders:function(){return c},addGlobalContexts:function(d){for(var e=
[],g=[],f=0;f<d.length;f++){var k=d[f];Qe(k)?e.push(k):ic(k)&&g.push(k)}a=a.concat(g);c=c.concat(e)},clearGlobalContexts:function(){c=[];a=[]},removeGlobalContexts:function(d){for(var e=function(f){Qe(f)?c=c.filter(function(k){return JSON.stringify(k)!==JSON.stringify(f)}):ic(f)&&(a=a.filter(function(k){return JSON.stringify(k)!==JSON.stringify(f)}))},g=0;g<d.length;g++)e(d[g])},getApplicableContexts:function(d){return b(d)}}}function Re(a){for(var c,b=[],d=1;d<arguments.length;d++)b[d-1]=arguments[d];
return null!==(c=null==a?void 0:a.map(function(e){if("function"!=typeof e)return e;try{return e.apply(void 0,b)}catch(g){}}).filter(Boolean))&&void 0!==c?c:[]}function Se(a){a=a.split(".");return!!(a&&1<a.length)&&function(c){if("*"===c[0]||"*"===c[1])return!1;if(0<c.slice(2).length){var b=!1,d=0;for(c=c.slice(2);d<c.length;d++)if("*"===c[d])b=!0;else if(b)return!1;return!0}return 2==c.length}(a)}function Te(a){a=/^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]*|\*)$/.exec(a);
if(null!==a&&Se(a[1]))return a.slice(1,6)}function Od(a){if(a=Te(a)){var c=a[0];return 5===a.length&&Se(c)}return!1}function Ue(a){return function(c){return Array.isArray(c)&&c.every(function(b){return"string"==typeof b})}(a)?a.every(function(c){return Od(c)}):"string"==typeof a&&Od(a)}function Ac(a){return!!(Le(a)&&"sc"in a&&"dt"in a)&&"string"==typeof a.sc&&"object"===la(a.dt)}function bd(a){return"function"==typeof a&&1>=a.length}function ic(a){return bd(a)||Ac(a)}function Oe(a){return!(!Array.isArray(a)||
2!==a.length)&&(Array.isArray(a[1])?bd(a[0])&&a[1].every(ic):bd(a[0])&&ic(a[1]))}function Pe(a){return!(!Array.isArray(a)||2!==a.length)&&!!function(c){var b=0;if(null!=c&&"object"===la(c)&&!Array.isArray(c)){if(Object.prototype.hasOwnProperty.call(c,"accept")){if(!Ue(c.accept))return!1;b+=1}if(Object.prototype.hasOwnProperty.call(c,"reject")){if(!Ue(c.reject))return!1;b+=1}return 0<b&&2>=b}return!1}(a[0])&&(Array.isArray(a[1])?a[1].every(ic):ic(a[1]))}function Qe(a){return Oe(a)||Pe(a)}function ad(a,
c){if(!Od(a))return!1;a=Te(a);c=function(d){d=/^iglu:([a-zA-Z0-9-_.]+)\/([a-zA-Z0-9-_]+)\/jsonschema\/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$/.exec(d);if(null!==d)return d.slice(1,6)}(c);if(a&&c){if(!function(d,e){e=e.split(".");d=d.split(".");if(e&&d){if(e.length!==d.length)return!1;for(var g=0;g<d.length;g++)if(!Ve(e[g],d[g]))return!1;return!0}return!1}(a[0],c[0]))return!1;for(var b=1;5>b;b++)if(!Ve(a[b],c[b]))return!1;return!0}return!1}function Ve(a,c){return a&&c&&"*"===a||a===c}function Ne(a){return Array.isArray(a)?
a:[a]}function Nd(a,c,b,d){var e;a=Ne(a).map(function(g){a:if(Ac(g))g=[g];else{if(bd(g)){b:{var f=void 0;try{var k=(f=g({event:c.getPayload(),eventType:b,eventSchema:d}),Array.isArray(f)&&f.every(Ac)||Ac(f)?f:void 0);break b}catch(n){}k=void 0}if(Ac(k)){g=[k];break a}if(Array.isArray(k)){g=k;break a}}g=void 0}if(g&&0!==g.length)return g});return(e=[]).concat.apply(e,a.filter(function(g){return null!=g&&g.filter(Boolean)}))}function Gg(a){void 0===a&&(a={});var c=a.base64,b=a.corePlugins,d=null!=b?
b:[];c=function(g,f,k){var n=function(m){return{addPluginContexts:function(z){var D=z?Ca([],z,!0):[];return m.forEach(function(x){try{x.contexts&&D.push.apply(D,x.contexts())}catch(A){ca.error("Error adding plugin contexts",A)}}),D}}}(f),l=Fg(),v=g,p={};return{track:function(m,z,D){m.withJsonProcessor(Eg(v));m.add("eid",Fb.v4());m.addDict(p);D=function(A){return null==A?{type:"dtm",value:(new Date).getTime()}:"number"==typeof A?{type:"dtm",value:A}:"ttm"===A.type?{type:"ttm",value:A.value}:{type:"dtm",
value:A.value||(new Date).getTime()}}(D);m.add(D.type,D.value.toString());z=function(A,w){A=l.getApplicableContexts(A);var t=[];return w&&w.length&&t.push.apply(t,w),A&&A.length&&t.push.apply(t,A),t}(m,n.addPluginContexts(z));z=z&&z.length?{sc:"sp/ctx/1-0-0",dt:z}:void 0;void 0!==z&&m.addJson("cx","co",z);f.forEach(function(A){try{A.beforeTrack&&A.beforeTrack(m)}catch(w){ca.error("Plugin beforeTrack",w)}});"function"==typeof k&&k(m);var x=m.build();return f.forEach(function(A){try{A.afterTrack&&A.afterTrack(x)}catch(w){ca.error("Plugin afterTrack",
w)}}),x},addPayloadPair:function(m,z){p[m]=z},configuration:a,getConfig:function(){return a},setConfig:function(m){m&&(void 0!==m.base64&&(a.base64=m.base64,v=m.base64),void 0!==m.lifecycleAutotracking&&(a.lifecycleAutotracking=m.lifecycleAutotracking),void 0!==m.cacheRefreshInterval&&(a.cacheRefreshInterval=m.cacheRefreshInterval),void 0!==m.exceptionAutotracking&&(a.exceptionAutotracking=m.exceptionAutotracking),void 0!==m.enablePeriodicHeartbeat&&(a.enablePeriodicHeartbeat=m.enablePeriodicHeartbeat),
void 0!==m.periodicHeartbeatInterval&&(a.periodicHeartbeatInterval=m.periodicHeartbeatInterval),void 0!==m.enc&&(a.enc=m.enc),void 0!==m.mend&&(a.mend=m.mend),void 0!==m.maxLocalStorageQueueSize&&(a.maxLocalStorageQueueSize=m.maxLocalStorageQueueSize),void 0!==m.maxGetBytes&&(a.maxGetBytes=m.maxGetBytes),void 0!==m.bufferSize&&(a.bufferSize=m.bufferSize),void 0!==m.customEventTrackingConfiguration&&(a.customEventTrackingConfiguration=m.customEventTrackingConfiguration),void 0!==m.networkRequestTrackingConfiguration&&
(a.networkRequestTrackingConfiguration=m.networkRequestTrackingConfiguration),void 0!==m.traceparentconfig&&(a.traceparentconfig=m.traceparentconfig),void 0!==m.metaTagsTrackingConfiguration&&(a.metaTagsTrackingConfiguration=m.metaTagsTrackingConfiguration),void 0!==m.performanceContextConfig&&(a.performanceContextConfig=m.performanceContextConfig),void 0!==m.configurationVersion&&(a.configurationVersion=m.configurationVersion),void 0!==m.catRcLastUpdatedTs&&(a.catRcLastUpdatedTs=m.catRcLastUpdatedTs),
void 0!==m.endpoint&&(a.endpoint=m.endpoint),void 0!==m.controlIngestConfig&&(a.controlIngestConfig=m.controlIngestConfig),void 0!==m.applicationContext&&(a.applicationContext=m.applicationContext),void 0!==m.emitterConfiguration&&(a.emitterConfiguration=m.emitterConfiguration),void 0!==m.di&&(a.di=m.di),void 0!==m.clickcc&&(a.clickcc=m.clickcc),void 0!==m.collectionRateLimit&&(a.collectionRateLimit=m.collectionRateLimit))},getBase64Encoding:function(){return v},setBase64Encoding:function(m){v=m},
addPayloadDict:function(m){for(var z in m)Object.prototype.hasOwnProperty.call(m,z)&&(p[z]=m[z])},resetPayloadPairs:function(m){p=Me(m)?m:{}},setTrackerVersion:function(m){p.tv=m},setTrackerNamespace:function(m){p.tna=m},setAppId:function(m){p.aid=m},setPlatform:function(m){p.p=m},setUserId:function(m){p.uid=m},setScreenResolution:function(m,z){p.res=m+"x"+z},setViewport:function(m,z){p.vp=m+"x"+z},setColorDepth:function(m){p.cd=m},setTimezone:function(m){p.tz=m},setLang:function(m){p.lang=m},setIpAddress:function(m){p.ip=
m},setUseragent:function(m){p.ua=m},addGlobalContexts:function(m){l.addGlobalContexts(m)},clearGlobalContexts:function(){l.clearGlobalContexts()},removeGlobalContexts:function(m){l.removeGlobalContexts(m)}}}(null==c||c,d,a.callback);var e=aa(aa({},c),{addPlugin:function(g){var f,k;g=g.plugin;d.push(g);null===(f=g.logger)||void 0===f||f.call(g,ca);null===(k=g.activateCorePlugin)||void 0===k||k.call(g,e)}});return null==d||d.forEach(function(g){var f,k;null===(f=g.logger)||void 0===f||f.call(g,ca);
null===(k=g.activateCorePlugin)||void 0===k||k.call(g,e)}),e}function Sb(a){var c=a.event;a=c.sc;var b=c.dt;c=Md();a={sc:"sp/ue/1-0-0",dt:{sc:a,dt:b}};return c.add("e","ue"),c.addJson("ue_px","ue_pr",a),c}function cd(a){return Sb({event:{sc:"cv/re/1-0-1",dt:jc({name:a.name,data:a.data})}})}function jc(a,c){void 0===c&&(c={});var b={},d;for(d in a)(c[d]||null!==a[d]&&void 0!==a[d])&&(b[d]=a[d]);return b}function kc(a){for(var c=a.length;0<=--c;)a[c]=0}function Pd(a,c,b,d,e){this.static_tree=a;this.extra_bits=
c;this.extra_base=b;this.elems=d;this.max_length=e;this.has_stree=a&&a.length}function Qd(a,c){this.dyn_tree=a;this.max_code=0;this.stat_desc=c}function lb(a,c,b,d,e){this.good_length=a;this.max_lazy=c;this.nice_length=b;this.max_chain=d;this.func=e}function Hg(){this.strm=null;this.status=0;this.pending_buf=null;this.wrap=this.pending=this.pending_out=this.pending_buf_size=0;this.gzhead=null;this.gzindex=0;this.method=dd;this.last_flush=-1;this.w_mask=this.w_bits=this.w_size=0;this.window=null;this.window_size=
0;this.head=this.prev=null;this.nice_match=this.good_match=this.strategy=this.level=this.max_lazy_match=this.max_chain_length=this.prev_length=this.lookahead=this.match_start=this.strstart=this.match_available=this.prev_match=this.match_length=this.block_start=this.hash_shift=this.hash_mask=this.hash_bits=this.hash_size=this.ins_h=0;this.dyn_ltree=new Uint16Array(1146);this.dyn_dtree=new Uint16Array(122);this.bl_tree=new Uint16Array(78);Gb(this.dyn_ltree);Gb(this.dyn_dtree);Gb(this.bl_tree);this.bl_desc=
this.d_desc=this.l_desc=null;this.bl_count=new Uint16Array(16);this.heap=new Uint16Array(573);Gb(this.heap);this.heap_max=this.heap_len=0;this.depth=new Uint16Array(573);Gb(this.depth);this.bi_valid=this.bi_buf=this.insert=this.matches=this.static_len=this.opt_len=this.sym_end=this.sym_next=this.lit_bufsize=this.sym_buf=0}function Bc(a){a=this.options=We({level:Ig,method:Jg,chunkSize:16384,windowBits:15,memLevel:8,strategy:Kg},a||{});a.raw&&0<a.windowBits?a.windowBits=-a.windowBits:a.gzip&&0<a.windowBits&&
16>a.windowBits&&(a.windowBits+=16);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new Xe;this.strm.avail_out=0;var c=Cc.deflateInit2(this.strm,a.level,a.method,a.windowBits,a.memLevel,a.strategy);if(c!==ed)throw Error(Tb[c]);if(a.header&&Cc.deflateSetHeader(this.strm,a.header),a.dictionary){var b;if(b="string"==typeof a.dictionary?Rd(a.dictionary):"[object ArrayBuffer]"===Ye.call(a.dictionary)?new Uint8Array(a.dictionary):a.dictionary,(c=Cc.deflateSetDictionary(this.strm,b))!==ed)throw Error(Tb[c]);
this._dict_set=!0}}function Sd(a,c){c=new Bc(c);if(c.push(a,!0),c.err)throw c.msg||Tb[c.err];return c.result}function Lg(){this.strm=null;this.mode=0;this.last=!1;this.wrap=0;this.havedict=!1;this.total=this.check=this.dmax=this.flags=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.extra=this.offset=this.length=this.bits=this.hold=0;this.distcode=this.lencode=null;this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=0;this.next=null;this.lens=new Uint16Array(320);
this.work=new Uint16Array(288);this.distdyn=this.lendyn=null;this.was=this.back=this.sane=0}function Dc(a){var c=this.options=We({chunkSize:65536,windowBits:15,to:""},a||{});c.raw&&0<=c.windowBits&&16>c.windowBits&&(c.windowBits=-c.windowBits,0===c.windowBits&&(c.windowBits=-15));!(0<=c.windowBits&&16>c.windowBits)||a&&a.windowBits||(c.windowBits+=32);15<c.windowBits&&48>c.windowBits&&0==(15&c.windowBits)&&(c.windowBits|=15);this.err=0;this.msg="";this.ended=!1;this.chunks=[];this.strm=new Xe;this.strm.avail_out=
0;a=tb.inflateInit2(this.strm,c.windowBits);if(a!==Ec)throw Error(Tb[a]);if(this.header=new Mg,tb.inflateGetHeader(this.strm,this.header),c.dictionary&&("string"==typeof c.dictionary?c.dictionary=Rd(c.dictionary):"[object ArrayBuffer]"===Ze.call(c.dictionary)&&(c.dictionary=new Uint8Array(c.dictionary)),c.raw&&(a=tb.inflateSetDictionary(this.strm,c.dictionary))!==Ec))throw Error(Tb[a]);}function Td(a,c){c=new Dc(c);if(c.push(a),c.err)throw c.msg||Tb[c.err];return c.result}function Ud(a){return!(!a||
"string"!=typeof a.valueOf())}function Fc(a){return Number.isInteger&&Number.isInteger(a)||"number"==typeof a&&isFinite(a)&&Math.floor(a)===a}function Vd(a){if(!Ud(a)){a=a.text||"";var c=document.getElementsByTagName("title");c&&null!=c[0]&&(a=c[0].text)}return a}function fd(a){var c=/^(?:(?:https?|ftp):)\/*(?:[^@]+@)?([^:/#]+)/.exec(a);return c?c[1]:a}function $e(a){var c=a.length;return"."===a.charAt(--c)&&(a=a.slice(0,c)),"*."===a.slice(0,2)&&(a=a.slice(1)),a}function Wd(a){var c=window,b=Gc("referrer",
c.location.href)||Gc("referer",c.location.href);if(b)return b;if(a)return a;try{if(c.top)return c.top.document.referrer;if(c.parent)return c.parent.document.referrer}catch(d){}return document.referrer}function gb(a,c,b,d){return void 0!==a&&(a.addEventListener?(a.addEventListener(c,b,d),!0):a.attachEvent?a.attachEvent("on"+c,b):void(a["on"+c]=b))}function Gc(a,c){return(a=(new RegExp("^[^#]*[?&]"+a+"=([^&#]*)")).exec(c))?decodeURIComponent(a[1].replace(/\+/g," ")):null}function gd(a,c,b){void 0===
b&&(b=63072E3);try{var d=window.localStorage,e=Date.now()+1E3*b;return d.setItem("".concat(a,".expires"),e.toString()),d.setItem(a,c),!0}catch(g){return!1}}function af(a){try{var c=window.localStorage;return c.removeItem(a),c.removeItem(a+".expires"),!0}catch(b){return!1}}function mb(a,c,b,d,e,g,f){return 1<arguments.length?document.cookie=a+"="+encodeURIComponent(null!=c?c:"")+(b?"; Expires="+(new Date(+new Date+1E3*b)).toUTCString():"")+(d?"; Path="+d:"")+(e?"; Domain="+e:"")+(g?"; SameSite="+g:
"")+(f?"; Secure":""):decodeURIComponent((("; "+document.cookie).split("; "+a+"=")[1]||"").split(";")[0])}function bf(a){try{var c=null===window||void 0===window?void 0:window.localStorage;return!!c&&(c.removeItem(a),!0)}catch(b){return!1}}function hd(){"undefined"!=typeof window&&void 0!==window.localStorage&&localStorage.removeItem(F.SAMPLING_STORAGE_RANDOM_NUMBER_KEY)}function Xd(a,c){return void 0!==a.act&&void 0!==a.act[c]&&(a=a.act[c],void 0!==a)?a:F.DEFAULT_SAMPLING_ACTION[c]}function Ma(a,
c){return a.length<=c?a:a.slice(0,c-3)+"..."}function Ng(a,c,b){try{if("string"==typeof b&&"string"==typeof a&&"*"===b.trim())return!0;switch(c){case "==":case "equal":return a===b;case "!=":return a!==b;case ">":return a>b;case "<":return a<b;case ">=":return a>=b;case "<=":return a<=b;case "contains":return""!==b&&"string"==typeof a&&"string"==typeof b&&-1!==a.toLowerCase().indexOf(b.toLowerCase());default:return!1}}catch(d){return console.warn("Conviva App Tracker: Error in Compare values nwreq ".concat(d)),
!1}}function Og(a,c,b){var d={};try{for(var e=0;e<c.length;e++){var g=c[e],f=a,k=d;b&&(g=g.toLowerCase(),f=f&&Object.entries(f).reduce(function(p,m){var z=m[1];return p[m[0].toLowerCase()]=z,p},{}));for(var n=g.split("."),l=0;l<n.length;l++){var v=n[l];if(null==f||!f.hasOwnProperty(v))break;l===n.length-1?k[v]=f[v]:(k[v]=k[v]||{},f=f[v],k=k[v])}}}catch(p){console.warn("Conviva App Tracker: Error in filtering schema object nwreq ".concat(p))}return d}function cf(a,c,b){var d,e,g;return"translate.googleusercontent.com"===
a?(""===b&&(b=c),a=fd(c=null!==(e=c,d=(g=/^(?:https?|ftp)(?::\/*(?:[^?]+))([?][^#]+)/.exec(e))&&1<(null==g?void 0:g.length)?Gc("u",g[1]):null)&&void 0!==d?d:"")):"cc.bingj.com"!==a&&"webcache.googleusercontent.com"!==a||(a=fd(c=document.links[0].href)),[a,c,b]}function Hc(a,c){void 0===c&&(c=1);"0"===a[0]?(a[7]=a[6],a[5]=a[4],a[3]++):a[3]=c;c=Fb.v4();return a[6]=c,a[8]="",a[9]=void 0,c}function Yd(a){a[4]=Math.round((new Date).getTime()/1E3)}function id(a){return{activateLCPObserver:function(){try{PerformanceObserver&&
(new PerformanceObserver(function(c){try{c.getEntries().forEach(function(b){var d;if("largest-contentful-paint"===b.entryType){var e=null===performance||void 0===performance?void 0:performance.getEntriesByType("navigation"),g=void 0;e&&0<(null==e?void 0:e.length)&&(g=null===(d=e[0])||void 0===d?void 0:d.activationStart);sa=aa(aa({},b.toJSON()),{performanceNavigationActivationStart:null!=g?g:0})}})}catch(b){console.warn("convivaAppTracker error in conviva lcp observer "+b)}})).observe({type:"largest-contentful-paint",
buffered:!0})}catch(c){console.warn("convivaAppTracker conviva_lcp failed "+c)}},contexts:function(){try{switch(a){case F.PERFORMANCE_CONTEXT.DISABLED:return[];case F.PERFORMANCE_CONTEXT.PERFORMANCE_NAVIGATION_TIMING:return function(){var c,b,d;try{var e=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{};if(e.getEntriesByType){var g=e.getEntriesByType("navigation")[0],f=null!==(c=null==e?void 0:e.timeOrigin)&&void 0!==c?c:0;if(!g)return[];var k={st:Math.floor(f+
g.startTime),dls:Math.floor(f+g.domainLookupStart),dle:Math.floor(f+g.domainLookupEnd),rss:Math.floor(f+g.responseStart),rse:Math.floor(f+g.responseEnd),le:Math.floor(f+g.loadEventEnd),dur:Math.floor(f+g.duration),as:Math.floor(f+g.activationStart)};return(null==sa?void 0:sa.startTime)&&(k.lcp={rt:Math.floor(f+sa.startTime),url:128<(null===(b=null==sa?void 0:sa.url)||void 0===b?void 0:b.length)?null===(d=null==sa?void 0:sa.url)||void 0===d?void 0:d.substring(0,128):sa.url,sz:sa.size}),[{sc:"cv/pc/1-0-1",
dt:k}]}return[]}catch(n){return console.warn("ConvivaAppTracker: issue will getting performance Navigation timing context"),[]}}();default:return Ca(Ca([],function(){var c=window;c=c.performance||c.mozPerformance||c.msPerformance||c.webkitPerformance;var b=c.timing;return c?[{sc:"w3/pt/1-0-0",dt:{navigationStart:b.navigationStart,domainLookupStart:b.domainLookupStart,domainLookupEnd:b.domainLookupEnd,responseStart:b.responseStart,responseEnd:b.responseEnd,loadEventEnd:b.loadEventEnd}}]:[]}(),!0),
function(){var c,b,d;try{if(void 0!==(null==sa?void 0:sa.startTime)&&"number"==typeof(null==sa?void 0:sa.startTime))return[{sc:"cv/lcp/1-0-0",dt:{lcp:Math.round(sa.startTime)-(null!==(c=sa.performanceNavigationActivationStart)&&void 0!==c?c:0),url:128<(null===(b=null==sa?void 0:sa.url)||void 0===b?void 0:b.length)?null===(d=null==sa?void 0:sa.url)||void 0===d?void 0:d.substring(0,128):sa.url}}]}catch(e){}return[]}(),!0)}}catch(c){return console.warn("convivaAppTracker problem in perfromance context "+
c),[]}}}}function jd(a,c,b,d,e,g){var f;try{var k,n=null,l=null!==(f=g.url)&&void 0!==f?f:"";if(!l)return!0;if(Pg.some(function(z){return l.includes(z)}))return!1;var v=(k=new URL(l)).protocol.replace(":","");f=function(z,D){var x;a:{var A={scheme:v,host:k.hostname,path:decodeURIComponent(k.pathname)},w=Ub.NETWORK_REQUEST;try{for(var t=0;t<z.length;t++){var q=z[t],L=q.opt;if(lc(q.req,A,w)){var J=!0;var P=L||null;break a}}J=!1;P=null}catch(E){J=!1,P=null}}return J?P?lc(P,{responseStatusCode:null!==
(x=null==e?void 0:e.status)&&void 0!==x?x:0,duration:Date.now()-g.requestTimestamp},Ub.NETWORK_REQUEST)===D:D:null};if(a&&null===n&&(n=f(a,!0)),c&&null===n&&(n=f(c,!1)),null===n){var p=(null==b?void 0:b.includes("*"))||(null==b?void 0:b.some(function(z){return!(!z||""===z)&&l.includes(z)})),m=null==d?void 0:d.some(function(z){return!(!z||""===z)&&l.includes(z)});n=!p||m}return!0===n}catch(z){return!0}}function lc(a,c,b){try{if(!a)return!1;if("and"===a.type){for(var d=0,e=a.cond;d<e.length;d++)if(!lc(e[d],
c,b))return!1;return!0}if("or"===a.type){e=0;for(d=a.cond;e<d.length;e++)if(lc(d[e],c,b))return!0;return!1}return b===Ub.NETWORK_REQUEST?function(g,f){var k=g.key,n=g.op;g=g.val;if(!k||!n)return!1;switch(k){case "sch":return!!f.scheme&&kd(f.scheme,n,g);case "host":return!!f.host&&kd(f.host,n,g);case "path":return!!f.path&&kd(f.path,n,g);case "dur":return!!f.duration&&Zd(f.duration,n,g);case "rsc":return void 0!==f.responseStatusCode&&0<=f.responseStatusCode&&Zd(f.responseStatusCode,n,g);default:return!1}}(a,
c):b===Ub.CUSTOM_EVENT&&function(g,f){var k=g.key,n=g.op;g=g.val;if(!k||!n)return!1;if(void 0!==f[k]){if(Ud(f[k]))return kd(f[k],n,g);if("boolean"==typeof f[k])switch(f=f[k],n){case "!=":return f!==g;case "==":return f===g;default:return!1}if(Number.isInteger(f[k]))return Zd(f[k],n,g)}return!1}(a,c)}catch(g){return!1}}function kd(a,c,b){var d;return"=="===c&&Array.isArray(b)?!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a===e}):"contains"===c&&Array.isArray(b)?!!(d=b).includes("*")||
d.some(function(e){return!(!e||""===e)&&a.includes(e)}):"sw"===c&&Array.isArray(b)?!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a.startsWith(e)}):!("ew"!==c||!Array.isArray(b))&&(!!(d=b).includes("*")||d.some(function(e){return!(!e||""===e)&&a.endsWith(e)}))}function Zd(a,c,b){if("in"===c.toLowerCase()&&Array.isArray(b))return b.includes(a);if("range"===c.toLowerCase()&&"object"===la(b)){c=b.min;var d=b.max,e=b.minExclusive;b=b.maxExclusive;return void 0!==c&&void 0!==d?a>=c&&a<=
d:void 0!==e&&void 0!==b&&a>e&&a<b}if(Fc(b))switch(c){case "!=":return a!==b;case ">":return a>b;case ">=":return a>=b;case "<":return a<b;case "<=":return a<=b;case "==":return a===b}return!1}function df(a,c,b){var d=null;a:{for(var e=0;e<a.length;e++){var g=a[e];var f=g.opt;if(lc(g.req,c,b)){a=!0;f=f||null;break a}}a=!1;f=null}a&&(d=!f||!!lc(f,c,b));return d}function xa(a,c,b){var d,e;try{if(a&&c){var g=null==a?void 0:a.getConfig(),f=function(k,n,l){var v,p,m,z={message:""};try{var D=l.message,
x=l.error,A=l.className,w=l.extraData;if(D)z.message=D;else if("string"==typeof x){if(!(0<x.trim().length))return ca.warn("Conviva Eco Sensor:: Mandatory field message is missing"),null;z.message=x}else"object"===la(x)&&("string"==typeof x.message&&0<x.message.trim().length&&(z.message=Ma(x.message,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_MESSAGE_LENGTH)),"string"==typeof x.name&&0<x.name.trim().length&&(z.exceptionName=Ma(x.name,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_EXCEPTION_NAME_LENGTH)),"string"==typeof x.stack&&
0<x.stack.trim().length&&(z.stackTrace=Ma(x.stack,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_STACK_LENGTH)));if(0===z.message.trim().length)return ca.warn("Conviva Eco Sensor:: Mandatory field message is missing"),null;"string"==typeof A&&0<A.trim().length&&(z.className=Ma(A,F.DIAGNOSTIC_INFO_MAX_LENGTH.MAX_CLASSNAME_LENGTH));null!=w&&(z.extraData=w);var t=null==k?void 0:k.getConfig();if((null==t?void 0:t.configurationVersion)&&(z.remoteConfigVersion=t.configurationVersion),(null==l?void 0:l.configAppliedTime)&&
(z.configAppliedTime=null==l?void 0:l.configAppliedTime),(null==t?void 0:t.cacheRefreshInterval)&&(z.cacheRefreshInterval=t.cacheRefreshInterval),(null==l?void 0:l.configAppliedSrc)&&(z.configAppliedSrc=null==l?void 0:l.configAppliedSrc),localStorage){var q=localStorage.getItem(F.SAMPLING_STORAGE_RANDOM_NUMBER_KEY);null!=q&&(z.samplingRandomNumber=parseFloat(q))}"number"==typeof(null===(p=null===(v=null==t?void 0:t.controlIngestConfig)||void 0===v?void 0:v.sel)||void 0===p?void 0:p.pct)?(z.samplingPercentage=
t.controlIngestConfig.sel.pct,z.samplingDecision=F.SAMPLING_STATUS.DERIVED,null!=la(null===(m=null==t?void 0:t.controlIngestConfig)||void 0===m?void 0:m.act)&&(z.extraData=aa(aa({},z.extraData),{samplingActionConfig:t.controlIngestConfig.act}))):z.samplingDecision=F.SAMPLING_STATUS.DEFAULT;"function"==typeof n&&"string"==typeof n()&&(z.samplingStatus=n()==F.SAMPLING_MODES.RCFG)}catch(L){return ca.warn("Error occurred while generating diagnostic object",L),null}return z}(a,c,b);f&&function(k){var n;
try{var l=null==k?void 0:k.getConfig(),v=(null===(n=null==l?void 0:l.di)||void 0===n?void 0:n.lim)||10,p=Date.now();return 6E4<=p-ef&&(ff=0,ef=p),!(++ff>v)}catch(m){return ca.warn("Conviva Eco Sensor:: Error occured while checking diagnostic event is allowed",m),!1}}(a)&&("boolean"!=typeof(null===(d=null==g?void 0:g.di)||void 0===d?void 0:d.en)||!0!==(null===(e=null==g?void 0:g.di)||void 0===e?void 0:e.en)||null!=a&&a.track(Sb({event:{sc:"iglu:com.conviva/di/jsonschema/1-0-4",dt:jc({msg:f.message,
cn:f.className,st:f.stackTrace,en:f.exceptionName,ed:f.extraData,rcv:f.remoteConfigVersion,cat:f.configAppliedTime,cri:f.cacheRefreshInterval,csrc:f.configAppliedSrc,srn:f.samplingRandomNumber,spr:f.samplingPercentage,ss:f.samplingStatus,sd:f.samplingDecision})}})))}}catch(k){ca.warn("Conviva Eco Sensor:: Error occurred while sending reportDiagnosticError",k)}}function Qg(a){var c,b,d,e,g,f;try{var k=function(t){var q,L,J;try{if(!Ea||!Ea.core||!t)return null;var P=Ea.core.getConfig();if(!0!==(null===
(q=null==P?void 0:P.clickcc)||void 0===q?void 0:q.en))return null;var E=null===(L=null==P?void 0:P.clickcc)||void 0===L?void 0:L.uiMode,M=null===(J=null==P?void 0:P.clickcc)||void 0===J?void 0:J.cssSelectorList,N=(null==M?void 0:M.replace(/\s+/g,""))||"";return E===Ic.RAW?t:E===Ic.BOTH?t.closest(N)||t:t.closest(N)}catch(R){return ca.warn("Conviva App Tracker caused Exception in getTrackedElement method of user click tracking module",R),null}}(function(t){var q,L,J;(null===(q=t.target)||void 0===q?
0:q.shadowRoot)&&(J=null===(L=t.composedPath)||void 0===L?void 0:L.call(t));t=J&&J[0]||t.target;return t instanceof HTMLElement?t:null}(a));if(k){var n=null===(c=null==Ea?void 0:Ea.core)||void 0===c?void 0:c.getConfig();a={};var l=F.CLICK_KEY_MAX_LENGTH;(null==k?0:k.id)&&(a.id=Ma(k.id,l));(null==k?0:k.className)&&(a.class=Ma(k.className,l));(null==k?0:k.tagName)&&(a.elementName=Ma(k.tagName.toLowerCase(),l));(null===(b=null==k?void 0:k.innerText)||void 0===b?0:b.trim())&&(a.text=Ma(k.innerText.trim(),
l));(null==k?0:k.getAttribute("name"))&&(a.name=Ma(k.getAttribute("name")||"",l));(null==k?0:k.getAttribute("type"))&&(a.elementType=Ma((null===(d=k.getAttribute("type"))||void 0===d?void 0:d.toLowerCase())||"",l));(null==k?0:k.placeholder)&&(a.placeholder=Ma(k.placeholder,l));(null==k?0:k.getAttribute("type"))&&"password"!==(null==k?void 0:k.getAttribute("type"))&&k.value&&(a.value=Ma(k.value,l));var v=null===(e=null==n?void 0:n.clickcc)||void 0===e?void 0:e.collectattr;if(v)for(b=0;b<v.length;b++){var p=
v[b],m=null==k?void 0:k.getAttribute(p);m&&(a[p]=Ma(m,l))}try{if("A"===k.tagName.toUpperCase()||"AREA"===k.tagName.toUpperCase()){if(null!=k.href){var z=k.hostname||fd(k.href),D=z.toLowerCase(),x=k.href.replace(z,D);/^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):/i.test(x)||(a.targetUrl=Ma(decodeURIComponent(x),l))}k.target&&(a.target=Ma(k.target,l))}}catch(t){ca.warn("Conviva App Tracker caused Exception in handleClick href setting",t)}var A=null!==(g=null==n?void 0:n.clickcc)&&
void 0!==g?g:{},w=function(t,q,L){var J=t.collect,P=t.block;t=null;if(J&&(t=df(J,q,L)),P&&null===t)q=df(P,q,L),"boolean"==typeof q&&(t=!q);return null===t||t}({collect:A.collect,block:A.block},a,Ub.CUSTOM_EVENT);if("boolean"!=typeof w||!1!==w)null===(f=null==Ea?void 0:Ea.core)||void 0===f||f.track(cd({name:"conviva_click",data:JSON.stringify(a)}))}}catch(t){return void ca.warn("Conviva App Tracker caused Exception in handleClick method of user click tracking module",t)}}function gf(a){try{var c=Date.now(),
b=F.CLICK_DEBOUNCING_DELAY;null===$d||c-$d>=b?((Qg(a),0<ld)&&xa(Ea.core,Ea.getSamplingMode,{className:"clickTracking - droppedEvent",message:"total click events dropped to Avoid tracking spam from rapid clicks",extraData:{clickEventDropped:ld}}),ld=0):ld++;$d=c}catch(d){console.warn("Conviva App Tracker caused Exception in immediateClickHandler method of user click tracking module",d)}}function hf(){try{Jc&&"undefined"!=typeof document&&document.body&&(Vb&&(document.body.removeEventListener("click",
Vb),Vb=null),Jc=!1)}catch(a){ca.warn("Conviva App Tracker caused Exception in disableUserClickTracking method of user click tracking module",a)}}function Rg(){try{var a=!!window.localStorage}catch(b){a=!0}if(!a)return!1;try{var c=window.localStorage;return c.setItem("modernizr","modernizr"),c.removeItem("modernizr"),!0}catch(b){return!1}}function Sg(a,c,b,d,e,g,f,k,n,l,v,p,m,z,D,x,A,w,t){function q(K){var Q=Object.keys(K).map(function(U){return[U,K[U]]}).reduce(function(U,da){return U[da[0]]=da[1].toString(),
U},{});return{evt:Q,bytes:L(JSON.stringify(Q))}}function L(K){for(var Q=0,U=0;U<K.length;U++){var da=K.charCodeAt(U);127>=da?Q+=1:2047>=da?Q+=2:55296<=da&&57343>=da?(Q+=4,U++):Q+=65535>da?3:4}return Q}function J(K,Q){Q=M(Q,!0,!1);K=N(R([K.evt]));try{D().toLowerCase()!==ub.NONE&&(K=jf.gzip(K,{level:6}),Q.setRequestHeader("Content-Encoding",ub.GZIP))}catch(U){}t()!==F.SAMPLING_MODES.NONE&&Q.send(K)}function P(K){try{if("undefined"!=typeof window&&void 0!==window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__&&
"function"==typeof window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__.postMessage){var Q=N(R(K));window.__CONVIVA_VISUAL_ACTIVATION_EXTENSION__.postMessage(Q)}}catch(U){ca.warn("Error occured while sending message to Visual Labelling Extension",U)}}function E(K){for(void 0===K&&(K=!1);X.length&&"string"!=typeof X[0]&&"object"!==la(X[0]);)X.shift();if(1>X.length)na=!1;else{if(!Ud(ta))throw"No collector configured";if(na=!0,window.clearTimeout(Na),Na=-1,oa){var Q,U=void 0,da=void 0;"object"===la(X[0])?
(Q=M(U=ta,!0,K),da=function(pa){for(var ya=0,vb=0;ya<pa.length&&!((vb+=pa[ya].bytes)>=A());)ya+=1;return ya}(X)):(U=ba(X[0]),Q=M(U,!1,K),da=1);var Qa=setTimeout(function(){Q.abort();na=!1},l);if(Q.onreadystatechange=function(){4===Q.readyState&&(clearTimeout(Qa),200<=Q.status&&300>Q.status?E():(ca.error("Status ".concat(Q.status,", will not retry.")),na=!1))},"object"===la(X[0])){var ab=X.slice(0,da);if(0<ab.length){K=!1;ab=ab.map(function(pa){return pa.evt});if(Ra){var wb=new Blob([N(R(ab))],{type:"application/json"});
try{K=navigator.sendBeacon(U,wb)}catch(pa){K=!1}}if(!0===K)E();else{U=N(R(ab));try{D().toLowerCase()!==ub.NONE&&(U=jf.gzip(U,{level:6}),Q.setRequestHeader("Content-Encoding",ub.GZIP))}catch(pa){}try{t()!==F.SAMPLING_MODES.NONE&&Q.send(U)}catch(pa){}}}}else Q.send();!function(pa){for(var ya=0;ya<pa;ya++)X.shift();b&&gd(bb,JSON.stringify(X.slice(-1*n())))}(da)}else if(v||"object"===la(X[0]))na=!1;else{da=new Image(1,1);var Xa=!0;da.onload=function(){Xa&&(Xa=!1,X.shift(),b&&gd(bb,JSON.stringify(X.slice(-1*
n()))),E())};da.onerror=function(){Xa&&(Xa=!1,na=!1)};da.src=ba(X[0]);setTimeout(function(){Xa&&na&&(Xa=!1,E())},l)}}}function M(K,Q,U){var da=new XMLHttpRequest,Qa;for(Qa in Q?(da.open("POST",K,!U),da.setRequestHeader("Content-Type","application/json; charset=UTF-8")):da.open("GET",K,!U),da.withCredentials=m,v&&da.setRequestHeader("SP-Anonymous","*"),p)Object.prototype.hasOwnProperty.call(p,Qa)&&da.setRequestHeader(Qa,p[Qa]);return da}function N(K){return JSON.stringify({sc:"sp/pd/1-0-4",dt:K})}
function R(K){for(var Q=(new Date).getTime().toString(),U=0;U<K.length;U++)K[U].stm=Q;return K}function ba(K){return k?ta+K.replace("?","?stm="+(new Date).getTime()+"&"):ta+K}(null===window||void 0===window?0:window.addEventListener)&&window.addEventListener("RemoteConfigUpdateApplied",function(){E()},{signal:hb});var ta,V,na=!1,X=[],Na=-1,za=!0===(d="string"==typeof d?d.toLowerCase():d)||"beacon"===d||"true"===d,Ra=!(!(za&&window.navigator&&window.navigator.sendBeacon)||function(K,Q){Q=Q.match(/\(iP.+; CPU .*OS (\d+)[_\d]*.*\) AppleWebKit\//);
return!(!Q||!Q.length)&&parseInt(Q[0])<=K}(13,V=window.navigator.userAgent)||function(K,Q,U){U=U.match("(Macintosh;.*Mac OS X (\\d+)_(\\d+)[_\\d]*.*) AppleWebKit/");return!(!U||!U.length)&&(parseInt(U[2])<=K||parseInt(U[2])===K&&parseInt(U[3])<=Q)}(10,15,V)&&function(K){return/^(?!.*Chrome)(?!.*Chromium)(?!.*Edg)(?!.*OPR)(?=.*Safari)/.test(K)&&!/(Chrome|Chromium|Edg|OPR)/.test(K)}(V))&&za,oa=!!(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),Z="get"!==d&&oa&&("post"===d||za),ha=Z?e:
"/i";d="convivaOutQueue_".concat(a,"_").concat(Z?"post2":"get");var bb="convivaOutQueue_".concat(a,"_").concat(Z?"post2":"get");if(bf(d),bf("".concat(d,".expires")),za&&(p={}),g=b&&Rg()&&Z&&g||1,b)try{var md=window.localStorage.getItem(bb);X=md?JSON.parse(md):[]}catch(K){}Array.isArray(X)||(X=[]);c.outQueues.push(X);oa&&1<g&&c.bufferFlushers.push(function(K){na||E(K)});return{enqueueRequest:function(K,Q,U){if(t()!=F.SAMPLING_MODES.NONE){ta=Q+ha;if(Z){P([(K=q(K)).evt]);Q=A();if(K.bytes>=Q)return na||
E(),ca.warn("Event ("+K.bytes+"B) too big, max is "+Q),void J(K,ta);X.push(K)}else{var da=function(pa){var ya="?",vb={co:!0,cx:!0},mc=!0,xb;for(xb in pa)pa.hasOwnProperty(xb)&&!vb.hasOwnProperty(xb)&&(mc?mc=!1:ya+="&",ya+=encodeURIComponent(xb)+"="+encodeURIComponent(pa[xb]));for(var Hb in vb)pa.hasOwnProperty(Hb)&&vb.hasOwnProperty(Hb)&&(ya+="&"+Hb+"="+encodeURIComponent(pa[Hb]));return ya}(K),Qa=f();if(0<Qa){var ab=L(ba(da));if(ab>=Qa){if(ca.warn("Event ("+ab+"B) too big, max is "+Qa),oa)P([(K=
q(K)).evt]),J(K,Q+e);return}}X.push(da)}Q=!1;b&&(Q=gd(bb,JSON.stringify(X.slice(-1*n()))));!na&&-1===Na&&Q&&(Na=window.setTimeout(E,w()+(Xa=z,Math.floor(Math.random()*Xa))));na||!(!Q||!x()||Z&&(wb=0,wb=Z?X.reduce(function(pa,ya){return pa+ya.bytes},0):X.reduce(function(pa,ya){return pa+ya.length},0),wb>A())||X.length>g||U)||E()}var wb,Xa},executeQueue:function(){na||E()},setUseLocalStorage:function(K){b=K},setAnonymousTracking:function(K){v=K},setCollectorUrl:function(K){ta=K+ha},setBufferSize:function(K){g=
K},setCustomHeaders:function(K){p=K}}}function Tg(){(null===window||void 0===window?0:window.addEventListener)&&window.addEventListener("RemoteConfigUpdateApplied",function(){var a,c,b,d,e,g,f;var k=null===(a=null==Sa?void 0:Sa.core)||void 0===a?void 0:a.getConfig();a=null===(b=null===(c=null==k?void 0:k.collectionRateLimit)||void 0===c?void 0:c.exceptionAutotracking)||void 0===b?void 0:b.maxEvents;c=null===(e=null===(d=null==k?void 0:k.collectionRateLimit)||void 0===d?void 0:d.exceptionAutotracking)||
void 0===e?void 0:e.disconnectDuration;d=null===(f=null===(g=null==k?void 0:k.collectionRateLimit)||void 0===g?void 0:g.exceptionAutotracking)||void 0===f?void 0:f.timeWindow;null==Wb||Wb.updateErrortRateLimitConfig(a,c,d)},{signal:hb})}function Ug(a){try{Sa=a;var c,b,d,e,g,f,k;try{var n=null===(c=null==Sa?void 0:Sa.core)||void 0===c?void 0:c.getConfig(),l=null===(d=null===(b=null==n?void 0:n.collectionRateLimit)||void 0===b?void 0:b.exceptionAutotracking)||void 0===d?void 0:d.maxEvents,v=null===
(g=null===(e=null==n?void 0:n.collectionRateLimit)||void 0===e?void 0:e.exceptionAutotracking)||void 0===g?void 0:g.disconnectDuration,p=null===(k=null===(f=null==n?void 0:n.collectionRateLimit)||void 0===f?void 0:f.exceptionAutotracking)||void 0===k?void 0:k.timeWindow;Wb=new Vg(l,v,p,null==Sa?void 0:Sa.core,null==Sa?void 0:Sa.getSamplingMode)}catch(m){console.warn("Conviva App Tracker caused Exception in initialiseRateLimiter method of error tracking module",m)}Tg();gb(window,"error",kf,!0);gb(window,
"unhandledrejection",lf,!0)}catch(m){console.warn("Conviva App Tracker caused Exception in enableErrorTracking method of error tracking module",m)}}function kf(a){try{(null==Wb?0:Wb.isAllowedToSendEvent())&&ae({message:a.message,filename:a.filename,lineno:a.lineno,colno:a.colno,error:a.error})}catch(c){console.warn("Conviva App Tracker caused Exception in captureError method of error tracking module",c)}}function lf(a){try{(null==Wb?0:Wb.isAllowedToSendEvent())&&ae({message:a.reason})}catch(c){console.warn("Conviva App Tracker caused Exception in captureRejection method of error tracking module",
c)}}function ae(a){var c,b,d=a.message,e=a.filename,g=a.lineno,f=a.colno,k=a.error,n=a.context;a=a.timestamp;k=k&&k.stack?k.stack:void 0;if(!(void 0===d||null===d&&void 0===k||null===k&&void 0===g||null===g&&void 0===f||null===f&&void 0===e||null===e)){var l=null===(c=null==Sa?void 0:Sa.core)||void 0===c?void 0:c.getConfig();(null==l?0:l.exceptionAutotracking)&&(null===(b=null==Sa?void 0:Sa.core)||void 0===b||b.track(Sb({event:{sc:"sp/ae/1-0-1",dt:{programmingLanguage:"JAVASCRIPT",message:d?mf(d,
2048):"JS Exception.",stackTrace:k?mf(k,8192):"",lineNumber:g,lineColumn:f,fileName:e}}}),n,a))}}function Wg(a){var c;try{var b=0,d=0;if("complete"===document.readyState){var e=null===(c=null==a?void 0:a.core)||void 0===c?void 0:c.getConfig();null==a||a.trackCustomEvent({name:"conviva_window_loaded",data:"{}",context:id(null==e?void 0:e.performanceContextConfig).contexts()})}else null===window||void 0===window||window.addEventListener("load",function(){var g;try{var f=null===(g=null==a?void 0:a.core)||
void 0===g?void 0:g.getConfig();null==a||a.trackCustomEvent({name:"conviva_window_loaded",data:"{}",context:id(null==f?void 0:f.performanceContextConfig).contexts()})}catch(k){console.warn("ConvivaAppTracker : issue while registering window loaded event",k)}},{signal:hb});null===document||void 0===document||document.addEventListener("visibilitychange",function(){var g,f;try{if((null==a?void 0:a.getSamplingMode())!==F.SAMPLING_MODES.NONE)if("hidden"===document.visibilityState)setTimeout(function(){var n,
l;try{var v=null===(n=null==a?void 0:a.core)||void 0===n?void 0:n.getConfig();d++;(null==v?0:v.lifecycleAutotracking)&&(null===(l=null==a?void 0:a.core)||void 0===l||l.track(Sb({event:{sc:"sp/abg/1-0-0",dt:jc({backgroundIndex:d})}})));"hidden"!==document.visibilityState||(null==a?0:a.getPageViewSent())||null==a||a.trackCustomEvent({name:"conviva_app_backgrnd_before_page_view",data:"{}"})}catch(p){console.warn("ConvivaAppTracker : issue while tracking visibility change",p)}},0);else{var k=null===(g=
null==a?void 0:a.core)||void 0===g?void 0:g.getConfig();b++;(null==k?0:k.lifecycleAutotracking)&&(null===(f=null==a?void 0:a.core)||void 0===f||f.track(Sb({event:{sc:"sp/afg/1-0-0",dt:jc({foregroundIndex:b})}})))}}catch(n){console.warn("convivaAppTracker visibilitychange failed "+n)}},{signal:hb});"undefined"!=typeof document&&document&&document.addEventListener&&document.addEventListener("convivaVideoEvent",function(g){g&&a&&(null==a?void 0:a.getSamplingMode())!==F.SAMPLING_MODES.NONE&&(null==a||
a.trackVideoEvent(g))},{signal:hb})}catch(g){console.warn("convivaAppTracker error in page load metrics"+g)}}function Xg(a,c,b,d,e){void 0===e&&(e={});var g=[];a=function(k,n,l,v,p){function m(){(nc=cf(window.location.hostname,window.location.href,Wd()))[1]!==Ib&&(Kc=Wd(Ib));nf=$e(nc[0]);Ib=nc[1]}function z(h){try{var r=(new Date).getTime(),u=h.currentTarget;if(null==u?0:u.href){h="_cnv="+(nd+"."+r);var y=u.href.split("#"),C=y[0].split("?"),G=C.shift(),H=C.join("?");if(H){C=!0;var I=H.split("&");
for(r=0;r<I.length;r++)if("_cnv="===I[r].substr(0,5)){C=!1;I[r]=h;H=I.join("&");break}C&&(H=h+"&"+H)}else H=h;var B=(y[0]=G+"?"+H,y.join("#"));u.href=B}}catch(O){console.warn("Conviva App Tracker:: Error in linkDecorationHandler of decorateLinks ".concat(O))}}function D(h){if("undefined"!=typeof document&&document.links&&0<document.links.length)for(var r=0;r<document.links.length;r++){var u=document.links[r];!u.spDecorationEnabled&&h(u)&&(gb(u,"click",z,!0),gb(u,"mousedown",z,!0),u.spDecorationEnabled=
!0)}}function x(h){var r;return of&&(r=/#.*/,h=h.replace(r,"")),pf&&(r=/[{}]/g,h=h.replace(r,"")),h}function A(h){return(h=/^([a-z]+):/.exec(h))?h[1]:null}function w(h){h=oc+h+"."+Xb;if("localStorage"==Ha)try{var r=window.localStorage,u=r.getItem(h+".expires");var y=null===u||+u>Date.now()?r.getItem(h):(r.removeItem(h),void r.removeItem(h+".expires"))}catch(C){y=void 0}else y="cookie"==Ha||"cookieAndLocalStorage"==Ha?mb(h):void 0;return y}function t(){m();Xb=Yg((Lc||nf)+(be||"/")).slice(0,4)}function q(){ce=
(new Date).getTime()}function L(){var h=J(),r=h[0];r<od?od=r:r>pd&&(pd=r);h=h[1];h<qd?qd=h:h>rd&&(rd=h);!0;q()}function J(){var h="undefined"!=typeof document?null===document||void 0===document?void 0:document.documentElement:void 0;return h?[h.scrollLeft||window.pageXOffset,h.scrollTop||window.pageYOffset]:[0,0]}function P(){var h=J(),r=h[0];pd=od=r;rd=qd=h=h[1]}function E(){N(oc+"ses."+Xb,"*",qf)}function M(h){var r=oc+"id."+Xb;h=(h.shift(),h.join("."));N(r,h,rf)}function N(h,r,u){Mc&&!sd||("localStorage"==
Ha?gd(h,r,u):"cookie"!=Ha&&"cookieAndLocalStorage"!=Ha||mb(h,r,u,be,Lc,td,ud))}function R(h){var r=oc+"id."+Xb,u=oc+"ses."+Xb;af(r);af(u);mb(r,"",-1,"/",Lc,td,ud);mb(u,"",-1,"/",Lc,td,ud);(null==h?0:h.preserveSession)||(Yb=Fb.v4(),nb=1);(null==h?0:h.preserveUser)||(nd=Fb.v4(),Zb=null)}function ba(h){h&&h.stateStorageStrategy&&(p.stateStorageStrategy=h.stateStorageStrategy,Ha=sf(p));Mc=!!p.anonymousTracking;sd=tf(p);de=uf(p);yb.setUseLocalStorage("localStorage"==Ha||"cookieAndLocalStorage"==Ha);yb.setAnonymousTracking(de)}
function ta(){if(function(){try{var u=window.localStorage.getItem("Conviva.sdkConfig"),y=JSON.parse(u||"{}");"{}"===y||void 0===y?(Nc=za(),vd=Ra()):(Nc=y.clId||za(),2147483648<=wd?wd=-1:wd++,vd=Ra());a:{var C=aa(aa({},y),{clId:Nc,iid:vd});try{var G=window.localStorage;u=null;try{u=JSON.stringify(C)}catch(H){break a}G.setItem("Conviva.sdkConfig",u)}catch(H){}}}catch(H){return void ca.warn("getEventIndexByClid",H)}}(),!Mc||sd){var h="none"!=Ha&&!!w("ses"),r=V();nd=function(u,y){var C;return u[1]?C=
u[1]:y?(C="",u[1]=C):(C=Fb.v4(),u[1]=C),C}(r,Mc);Yb=h?r[6]:Hc(r);nb=r[3];"none"!=Ha&&(E(),Yd(r),M(r))}}function V(){return"none"==Ha?["1","",0,0,0,void 0,"","","",void 0]:function(h,r,u,y){var C,G=Math.round((new Date).getTime()/1E3);h?(C=h.split(".")).unshift("0"):C=["1",r,G,y,G,"",u];C[6]&&"undefined"!==C[6]||(C[6]=Fb.v4());C[7]&&"undefined"!==C[7]||(C[7]="");C[8]&&"undefined"!==C[8]||(C[8]="");C[9]&&"undefined"!==C[9]||(C[9]="");C[10]&&"undefined"!==C[10]||(C[10]=-1);var H=function(I,B){I=parseInt(I);
return isNaN(I)?B:I};h=function(I){return I?H(I,void 0):void 0};return[C[0],C[1],H(C[2],G),H(C[3],y),H(C[4],G),h(C[5]),C[6],C[7],C[8],h(C[9])]}(w("id")||void 0,nd,Yb,nb)}function na(h,r){var u,y,C,G,H=!0,I=Jb.getConfig();return void 0!==I.mend?H=I.mend:void 0!==(null===(y=null===(u=null==p?void 0:p.configs)||void 0===u?void 0:u.network)||void 0===y?void 0:y.mergeEndpoint)&&(H=null===(G=null===(C=null==p?void 0:p.configs)||void 0===C?void 0:C.network)||void 0===G?void 0:G.mergeEndpoint),0===h.indexOf("http")?
(r&&H&&(h=h.replace(/^(https?:\/\/)(.*)$/,"$1"+r+".$2")),h):r&&H?("https:"===document.location.protocol?"https":"http")+"://"+r+"."+h:("https:"===document.location.protocol?"https":"http")+"://"+h}function X(){vf&&null!=v.pageViewId||(v.pageViewId=Fb.v4())}function Na(){return null==v.pageViewId&&(v.pageViewId=Fb.v4()),v.pageViewId}function za(){try{return Z({"First Launch":"Yes"}),Math.floor(2147483647*Math.random()).toString()+"."+Math.floor(2147483647*Math.random()).toString()+"."+Math.floor(2147483647*
Math.random()).toString()+"."+Math.floor(2147483647*Math.random()).toString()}catch(h){return void console.warn(h)}}function Ra(){try{return Math.floor(2147483647*Math.random())}catch(h){return console.warn(h),-1}}function oa(h){try{return"object"===la(JSON.parse(h))}catch(r){return!1}}function Z(h){try{var r=Object.keys(h);oa(JSON.stringify(h))?r.forEach(function(u){if(""!==u.trim()){var y=h[u];y&&""!==y&&(y="object"===la(y)?JSON.stringify(y):""+y,Object.defineProperty(ee,u,{value:y,writable:!0,
enumerable:!0,configurable:!0}))}}):console.warn("Conviva AppTracker:: Invalid JSON Format")}catch(u){console.warn("Conviva AppTracker:: Invalid JSON Format: Error Message=",u)}}function ha(h){var r=h.title,u=h.context,y=h.timestamp;h=h.contextCallback;m();fe&&X();fe=!0;Kb=document.title;r=Vd((Oc=r)||Kb);pc()!==F.SAMPLING_MODES.NONE&&Jb.track(function(H){var I=H.pageUrl,B=H.pageTitle;H=H.referrer;var O=Md();return O.add("e","pv"),O.add("url",I),O.add("page",B),O.add("refr",H),O}({pageUrl:x(xd||Ib),
pageTitle:r,referrer:x(yd||Kc)}),(u||[]).concat(h?h():[]),y);y=new Date;r=!1;if(Oa.enabled&&!Oa.installed){r=Oa.installed=!0;var C={update:function(){if("undefined"!=typeof window&&"function"==typeof window.addEventListener){var H=!1,I=Object.defineProperty({},"passive",{get:function(){H=!0},set:function(){}}),B=function(){};window.addEventListener("testPassiveEventSupport",B,I);window.removeEventListener("testPassiveEventSupport",B,I);C.hasSupport=H}}};C.update();var G="onwheel"in document.createElement("div")?
"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";Object.prototype.hasOwnProperty.call(C,"hasSupport")?gb(document,G,q,{passive:!0}):gb(document,G,q);P();G=function(H,I){return void 0===I&&(I=q),function(B){return gb(document,B,I)}};"click mouseup mousedown mousemove keypress keydown keyup".split(" ").forEach(G(document));["resize","focus","blur"].forEach(G(window));G(window,L)("scroll")}if(Oa.enabled&&(Zg||r))for(y in ce=y.getTime(),y=void 0,Oa.configurations)(r=Oa.configurations[y])&&
(window.clearInterval(r.activityInterval),md(r,u,h))}function bb(){var h,r,u,y,C,G,H,I,B,O,ja,Ia,Da,Ta,W,ea,ka,La,Ua,zb,Ab,ib,$b,ac,bc,qc,cc,rc,ob,Bb,Cb,qa,Pc;try{var S=null===(h=null==f?void 0:f.core)||void 0===h?void 0:h.getConfig();h=void 0;ge={};var ua=sc.MERGE;switch(void 0!==(null===(u=null===(r=null==p?void 0:p.configs)||void 0===r?void 0:r.metaTagsTracking)||void 0===u?void 0:u.preference)?ua=null===(C=null===(y=null==p?void 0:p.configs)||void 0===y?void 0:y.metaTagsTracking)||void 0===C?
void 0:C.preference:!0===(null===(H=null===(G=null==p?void 0:p.configs)||void 0===G?void 0:G.metaTagsTracking)||void 0===H?void 0:H.force)?ua=sc.APP:void 0!==(null===(I=null==S?void 0:S.metaTagsTrackingConfiguration)||void 0===I?void 0:I.pref)&&(ua=null===(B=null==S?void 0:S.metaTagsTrackingConfiguration)||void 0===B?void 0:B.pref),ua){case sc.APP:if(!1===(null===(ja=null===(O=null==p?void 0:p.configs)||void 0===O?void 0:O.metaTagsTracking)||void 0===ja?void 0:ja.enabled))return;0<(null===(Ta=null===
(Da=null===(Ia=null==p?void 0:p.configs)||void 0===Ia?void 0:Ia.metaTagsTracking)||void 0===Da?void 0:Da.tags)||void 0===Ta?void 0:Ta.length)&&(h=Ca([],null===(ea=null===(W=null==p?void 0:p.configs)||void 0===W?void 0:W.metaTagsTracking)||void 0===ea?void 0:ea.tags,!0));break;case sc.REMOTE:if(!1===(null===(ka=null==S?void 0:S.metaTagsTrackingConfiguration)||void 0===ka?void 0:ka.enabled))return;void 0!==(null==S?void 0:S.metaTagsTrackingConfiguration)&&0<(null===(Ua=null===(La=null==S?void 0:S.metaTagsTrackingConfiguration)||
void 0===La?void 0:La.tags)||void 0===Ua?void 0:Ua.length)&&(h=Ca([],null===(zb=null==S?void 0:S.metaTagsTrackingConfiguration)||void 0===zb?void 0:zb.tags,!0));break;default:if(void 0===(null==S?void 0:S.metaTagsTrackingConfiguration)&&!1===(null===(ib=null===(Ab=null==p?void 0:p.configs)||void 0===Ab?void 0:Ab.metaTagsTracking)||void 0===ib?void 0:ib.enabled)||void 0===(null===($b=null==p?void 0:p.configs)||void 0===$b?void 0:$b.metaTagsTracking)&&!1===(null===(ac=null==S?void 0:S.metaTagsTrackingConfiguration)||
void 0===ac?void 0:ac.enabled))return;var Lb=null===(qc=null===(bc=null==p?void 0:p.configs)||void 0===bc?void 0:bc.metaTagsTracking)||void 0