@microsoft/applicationinsights-analytics-js
Advanced tools
Comparing version 2.3.1 to 2.4.0-beta
/*! | ||
* Application Insights JavaScript SDK - Web Analytics, 2.3.1 | ||
* Application Insights JavaScript SDK - Web Analytics, 2.4.0-beta | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o,n,d,r,a,s,c=function(){return(c=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};(n=o=o||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(r=d=d||{})[r.Default=0]="Default",r[r.Required=1]="Required",r[r.Array=2]="Array",r[r.Hidden=4]="Hidden",(s=a=a||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var l=2,u="prototype",f=(g.isNullOrUndefined=function(e){return null===e||e===undefined},g.isDate=function(e){return"[object Date]"===Object[u].toString.call(e)},g.disableCookies=function(){g._canUseCookies=!1},g.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(p,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},g.toISOString=function(e){if(g.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},g.arrForEach=function(e,t,n){for(var i=e.length,r=0;r<i;++r)r in e&&t.call(n||e,e[r],r,e)},g.arrIndexOf=function(e,t,n){for(var i=e.length,r=n||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===t)return o;return-1},g.arrMap=function(e,t,n){for(var i=e.length,r=n||e,o=new Array(i),a=0;a<i;a++)a in e&&(o[a]=t.call(r,e[a],e));return o},g.arrReduce=function(e,t,n){var i,r=e.length,o=0;if(3<=arguments.length)i=n;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=t(i,e[o],o,e)),o++;return i},g.objCreate=function(e){if(null==e)return{};var t=typeof e;if("object"!=t&&"function"!=t)throw new TypeError("Object prototype may only be an Object: "+e);function n(){}return n[u]=e,new n},g.objKeys=function(e){var t=Object[u].hasOwnProperty,n=!{toString:null}.propertyIsEnumerable("toString"),i=typeof e;if("function"!=i&&("object"!=i||null===e))throw new TypeError("objKeys called on non-object");var r=[];for(var o in e)t.call(e,o)&&r.push(o);if(n)for(var a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=a.length,c=0;c<s;c++)t.call(e,a[c])&&r.push(a[c]);return r},g.objDefineAccessors=function(e,t,n,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return n&&(o.get=n),i&&(o.set=i),r(e,t,o),!0}catch(a){}return!1},g);function g(){}var p=/[xy]/g,h=(m.prototype.processTelemetry=function(t){f.arrForEach(this.channelQueue,function(e){0<e.length&&e[0].processTelemetry(t)})},m.prototype.getChannelControls=function(){return this.channelQueue},m.prototype.initialize=function(n,i,r){var o,a=this;n.isCookieUseDisabled&&f.disableCookies(),this.channelQueue=new Array,n.channels&&f.arrForEach(n.channels,function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(f.arrForEach(e,function(e){e.priority<500&&(o=e.identifier),e.initialize(n,i,r)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}});for(var e=new Array,t=0;t<r.length;t++){var s=r[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);f.arrForEach(e,function(e){return e.initialize(n,i,r)}),this.channelQueue.push(e)}},m._staticInit=void f.objDefineAccessors(m.prototype,"ChannelControls",m.prototype.getChannelControls),m);function m(){this.identifier="ChannelControllerPlugin",this.priority=500}var v=(y.prototype.initialize=function(e,t,n,i){var r=this;if(this._isInitialized)throw Error("Core should not be initialized more than once");if(!e||f.isNullOrUndefined(e.instrumentationKey))throw Error("Please provide instrumentation key");this.config=e,this._notificationManager=i,this._notificationManager||(this._notificationManager=f.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}})),this.config.extensions=f.isNullOrUndefined(this.config.extensions)?[]:this.config.extensions,this.config.extensionConfig=f.isNullOrUndefined(this.config.extensionConfig)?{}:this.config.extensionConfig,this._notificationManager&&(this.config.extensionConfig.NotificationManager=this._notificationManager),this.logger=n,this.logger||(this.logger=f.objCreate({throwInternal:function(e,t,n,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}})),(a=this._extensions).push.apply(a,t.concat(this.config.extensions)),f.arrForEach(this._extensions,function(e){var t=!0;if((f.isNullOrUndefined(e)||f.isNullOrUndefined(e.initialize))&&(t=!1),!t)throw Error("Extensions must provide callback to initialize")}),this._extensions.push(this._channelController),this._extensions=this._extensions.sort(function(e,t){var n=e,i=t,r=typeof n.processTelemetry,o=typeof i.processTelemetry;return"function"==r&&"function"==o?n.priority-i.priority:"function"==r&&"function"!=o?1:"function"!=r&&"function"==o?-1:void 0});var o={};f.arrForEach(this._extensions,function(e){var t=e;t&&t.priority&&(f.isNullOrUndefined(o[t.priority])?o[t.priority]=t.identifier:r.logger&&r.logger.warnToConsole("Two extensions have same priority"+o[t.priority]+", "+t.identifier))});for(var a,s=-1,c=0;c<this._extensions.length-1;c++){var l=this._extensions[c];if(!l||"function"==typeof l.processTelemetry){if(l.priority===this._channelController.priority){s=c+1;break}this._extensions[c].setNextPlugin(this._extensions[c+1])}}if(this._channelController.initialize(this.config,this,this._extensions),f.arrForEach(this._extensions,function(e){e&&e.priority<r._channelController.priority&&e.initialize(r.config,r,r._extensions)}),s<this._extensions.length&&this._extensions.splice(s),0===this.getTransmissionControls().length)throw new Error("No channels available");this._isInitialized=!0},y.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},y.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=f.toISOString(new Date)),f.isNullOrUndefined(e.ver)&&(e.ver="4.0"),0===this._extensions.length&&this._channelController.processTelemetry(e);for(var t=0;t<this._extensions.length;){if(this._extensions[t].processTelemetry){this._extensions[t].processTelemetry(e);break}t++}},y);function y(){this._isInitialized=!1,this._extensions=new Array,this._channelController=new h}var w,_,I=(S.prototype.addNotificationListener=function(e){this.listeners.push(e)},S.prototype.removeNotificationListener=function(e){for(var t=f.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=f.arrIndexOf(this.listeners,e)},S.prototype.eventsSent=function(t){for(var n=this,e=function(e){i.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},i=this,r=0;r<this.listeners.length;++r)e(r)},S.prototype.eventsDiscarded=function(t,n){for(var i=this,e=function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(t,n)},0)},r=this,o=0;o<this.listeners.length;++o)e(o)},S);function S(){this.listeners=[]}(_=w=w||{})[_.CRITICAL=1]="CRITICAL",_[_.WARNING=2]="WARNING";var T=1,N=2,E=3,x=4,b=5,D=6,k=8,C=10,P=11,A=23,M=25,L=29,U=30,O=31,R=32,z=35,V=36,G=37,j=38,q=39,B=45,F=49,W=52,H=56,X=57,K=61,J=62,Q=63,Y=64,$=66,Z=68,ee=69,te=(ne.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},ne.dataType="MessageData",ne.AiNonUserActionablePrefix="AI (Internal): ",ne.AiUserActionablePrefix="AI: ",ne);function ne(e,t,n,i){void 0===n&&(n=!1),this.messageId=e,this.message=(n?ne.AiUserActionablePrefix:ne.AiNonUserActionablePrefix)+e;var r=(t?" message:"+ne.sanitizeDiagnosticText(t):"")+(i?" props:"+ne.sanitizeDiagnosticText(JSON.stringify(i)):"");this.message+=r}var ie=(re.prototype.throwInternal=function(e,t,n,i,r){void 0===r&&(r=!1);var o=new te(t,n,r,i);if(this.enableDebugExceptions())throw o;if(void 0!==o&&o&&"undefined"!=typeof o.message){if(r){var a=+o.messageId;(!this._messageLogged[a]||this.consoleLoggingLevel()>=w.WARNING)&&(this.warnToConsole(o.message),this._messageLogged[a]=!0)}else this.consoleLoggingLevel()>=w.WARNING&&this.warnToConsole(o.message);this.logInternalMessage(e,o)}},re.prototype.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},re.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},re.prototype.logInternalMessage=function(e,t){if(!this._areInternalMessagesThrottled()){var n=!0,i=this.AIInternalMessagePrefix+t.messageId;if(this._messageLogged[i]?n=!1:this._messageLogged[i]=!0,n&&(e<=this.telemetryLoggingLevel()&&(this.queue.push(t),this._messageCount++),this._messageCount===this.maxInternalMessageLimit())){var r="Internal events throttle limit per PageView reached for this app.",o=new te(A,r,!1);this.queue.push(o),this.warnToConsole(r)}}},re.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},re);function re(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},f.isNullOrUndefined(e)||(f.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),f.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),f.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),f.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var oe;t(ae,oe=v),ae.prototype.initialize=function(e,t){this._notificationManager=new I,this.logger=new ie(e),this.config=e,oe.prototype.initialize.call(this,e,t,this.logger,this._notificationManager)},ae.prototype.getTransmissionControls=function(){return oe.prototype.getTransmissionControls.call(this)},ae.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),oe.prototype.track.call(this,e)},ae.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},ae.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},ae.prototype.pollInternalLogs=function(n){var i=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var e=i.logger?i.logger.queue:[];f.arrForEach(e,function(e){var t={name:n||"InternalMessageId: "+e.messageId,iKey:i.config.instrumentationKey,time:f.toISOString(new Date),baseType:te.dataType,baseData:{message:e.message}};i.track(t)}),e.length=0},e)},ae.prototype._validateTelemetryItem=function(e){if(f.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},ae.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],l)};function ae(){return oe.call(this)||this}var se=(ce.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=ce.sanitizeKey(e,t);if(r.length!==i){for(var o=0,a=r;n[a]!==undefined;)o++,a=r.substring(0,ce.MAX_NAME_LENGTH-3)+ce.padNumber(o);r=a}return r},ce.sanitizeKey=function(e,t){var n;return t&&(t=ce.trim(t.toString())).length>ce.MAX_NAME_LENGTH&&(n=t.substring(0,ce.MAX_NAME_LENGTH),e.throwInternal(w.WARNING,X,"name is too long. It has been truncated to "+ce.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},ce.sanitizeString=function(e,t,n){var i;return void 0===n&&(n=ce.MAX_STRING_LENGTH),t&&(n=n||ce.MAX_STRING_LENGTH,(t=ce.trim(t)).toString().length>n&&(i=t.toString().substring(0,n),e.throwInternal(w.WARNING,K,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),i||t},ce.sanitizeUrl=function(e,t){return ce.sanitizeInput(e,t,ce.MAX_URL_LENGTH,$)},ce.sanitizeMessage=function(e,t){var n;return t&&t.length>ce.MAX_MESSAGE_LENGTH&&(n=t.substring(0,ce.MAX_MESSAGE_LENGTH),e.throwInternal(w.WARNING,H,"message is too long, it has been truncated to "+ce.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},ce.sanitizeException=function(e,t){var n;return t&&t.length>ce.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,ce.MAX_EXCEPTION_LENGTH),e.throwInternal(w.WARNING,W,"exception is too long, it has been truncated to "+ce.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},ce.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=t[i];if("object"==typeof r&&"undefined"!=typeof JSON)try{r=JSON.stringify(r)}catch(o){e.throwInternal(w.WARNING,F,"custom property is not valid",{exception:o},!0)}r=ce.sanitizeString(e,r,ce.MAX_PROPERTY_LENGTH),n[i=ce.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},ce.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=ce.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},ce.sanitizeId=function(e,t){return t?ce.sanitizeInput(e,t,ce.MAX_ID_LENGTH,ee).toString():t},ce.sanitizeInput=function(e,t,n,i){var r;return t&&(t=ce.trim(t)).length>n&&(r=t.substring(0,n),e.throwInternal(w.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),r||t},ce.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},ce.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ce.MAX_NAME_LENGTH=150,ce.MAX_ID_LENGTH=128,ce.MAX_PROPERTY_LENGTH=8192,ce.MAX_STRING_LENGTH=1024,ce.MAX_URL_LENGTH=2048,ce.MAX_MESSAGE_LENGTH=32768,ce.MAX_EXCEPTION_LENGTH=32768,ce);function ce(){}var le="prototype",ue=(ge.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},ge.disableStorage=function(){ge._canUseLocalStorage=!1,ge._canUseSessionStorage=!1},ge._getLocalStorageObject=function(){return ge.canUseLocalStorage()?ge._getVerifiedStorageObject(o.LocalStorage):null},ge._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===o.LocalStorage?window.localStorage:window.sessionStorage).setItem(n.toString(),n.toString()),t=i.getItem(n.toString())!==n.toString(),i.removeItem(n.toString()),t&&(i=null)}catch(r){i=null}return i},ge.isInternalApplicationInsightsEndpoint=function(e){return-1!==ge._internalEndpoints.indexOf(e.toLowerCase())},ge.canUseLocalStorage=function(){return ge._canUseLocalStorage===undefined&&(ge._canUseLocalStorage=!!ge._getVerifiedStorageObject(o.LocalStorage)),ge._canUseLocalStorage},ge.getStorage=function(e,t){var n=ge._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(i){ge._canUseLocalStorage=!1,e.throwInternal(w.WARNING,T,"Browser failed read of local storage. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return null},ge.setStorage=function(e,t,n){var i=ge._getLocalStorageObject();if(null!==i)try{return i.setItem(t,n),!0}catch(r){ge._canUseLocalStorage=!1,e.throwInternal(w.WARNING,E,"Browser failed write to local storage. "+ge.getExceptionName(r),{exception:ge.dump(r)})}return!1},ge.removeStorage=function(e,t){var n=ge._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(i){ge._canUseLocalStorage=!1,e.throwInternal(w.WARNING,b,"Browser failed removal of local storage item. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return!1},ge._getSessionStorageObject=function(){return ge.canUseSessionStorage()?ge._getVerifiedStorageObject(o.SessionStorage):null},ge.canUseSessionStorage=function(){return ge._canUseSessionStorage===undefined&&(ge._canUseSessionStorage=!!ge._getVerifiedStorageObject(o.SessionStorage)),ge._canUseSessionStorage},ge.getSessionStorageKeys=function(){var e=[];if(ge.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},ge.getSessionStorage=function(e,t){var n=ge._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(i){ge._canUseSessionStorage=!1,e.throwInternal(w.WARNING,N,"Browser failed read of session storage. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return null},ge.setSessionStorage=function(e,t,n){var i=ge._getSessionStorageObject();if(null!==i)try{return i.setItem(t,n),!0}catch(r){ge._canUseSessionStorage=!1,e.throwInternal(w.WARNING,x,"Browser failed write to session storage. "+ge.getExceptionName(r),{exception:ge.dump(r)})}return!1},ge.removeSessionStorage=function(e,t){var n=ge._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(i){ge._canUseSessionStorage=!1,e.throwInternal(w.WARNING,D,"Browser failed removal of session storage item. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return!1},ge.disableCookies=function(){f.disableCookies()},ge.canUseCookies=function(e){if(f._canUseCookies===undefined){f._canUseCookies=!1;try{f._canUseCookies=ge.document.cookie!==undefined}catch(t){e.throwInternal(w.WARNING,Z,"Cannot access document.cookie - "+ge.getExceptionName(t),{exception:ge.dump(t)})}}return f._canUseCookies},ge.setCookie=function(e,t,n,i){n+=";SameSite=None";var r="",o="";i&&(r=";domain="+i),ge.document.location&&"https:"===ge.document.location.protocol&&(o=";secure"),ge.canUseCookies(e)&&(ge.document.cookie=t+"="+n+r+";path=/"+o)},ge.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},ge.getCookie=function(e,t){if(ge.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=ge.document.cookie.split(";"),o=0;o<r.length;o++){var a=r[o];if((a=ge.trim(a))&&0===a.indexOf(i)){n=a.substring(i.length,r[o].length);break}}return n}},ge.deleteCookie=function(e,t){ge.canUseCookies(e)&&(ge.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},ge.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ge.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},ge.random32=function(){return 4294967296*Math.random()|0},ge.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",i=0;i<4;i++)n+=t[15&(e=ge.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var r=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+r+n.substr(16,3)+n.substr(19,12)},ge.isArray=function(e){return"[object Array]"===Object[le].toString.call(e)},ge.isError=function(e){return"[object Error]"===Object[le].toString.call(e)},ge.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},ge.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,o=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<o?o+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},ge.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},ge.dump=function(e){var t=Object[le].toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},ge.getExceptionName=function(e){return"[object Error]"===Object[le].toString.call(e)?e.name:""},ge.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},ge.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},ge.getExtension=function(e,t){for(var n=null,i=0;!n&&i<e.length;)e[i]&&e[i].identifier===t&&(n=e[i]),i++;return n},ge.document="undefined"!=typeof document?document:{},ge._canUseLocalStorage=undefined,ge._canUseSessionStorage=undefined,ge._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],ge.NotSpecified="not_specified",ge.isDate=f.isDate,ge.toISOStringForIE8=f.toISOString,ge);function ge(){}var fe=(pe.parseUrl=function(e){return pe.htmlAnchorElement||(pe.htmlAnchorElement=pe.document.createElement?pe.document.createElement("a"):{host:pe.parseHost(e)}),pe.htmlAnchorElement.href=e,pe.htmlAnchorElement},pe.getAbsoluteUrl=function(e){var t,n=pe.parseUrl(e);return n&&(t=n.href),t},pe.getPathName=function(e){var t,n=pe.parseUrl(e);return n&&(t=n.pathname),t},pe.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},pe.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},pe.document="undefined"!=typeof document?document:{},pe);function pe(){}var de=(he.ParseDependencyPath=function(e,t,n,i){var r,o=i,a=i;if(t&&0<t.length){var s=fe.parseUrl(t);if(r=s.host,!o)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),a=s.pathname,o=se.sanitizeString(e,n?n+" "+c:c)}else o=se.sanitizeString(e,t)}else o=r=i;return{target:r,name:o,data:a}},he);function he(){}var me=(ve.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},ve.GetDuration=function(e,t){var n=null;return 0===e||0===t||f.isNullOrUndefined(e)||f.isNullOrUndefined(t)||(n=t-e),n},ve);function ve(){}var ye,we=(t(_e,ye=function Wt(){}),_e);function _e(){return ye.call(this)||this}var Ie;t(Se,Ie=function Ht(){this.ver=1,this.sampleRate=100,this.tags={}});function Se(e,t,n){var i=Ie.call(this)||this;return i.name=se.sanitizeString(e,n)||ue.NotSpecified,i.data=t,i.time=f.toISOString(new Date),i.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100===i.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},i}var Te,Ne=function Xt(){},Ee=(t(xe,Te=Ne),xe);function xe(){var e=Te.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var be,De=(t(ke,be=Ee),ke.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ke.dataType="EventData",ke);function ke(e,t,n,i){var r=be.call(this)||this;return r.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},r.name=se.sanitizeString(e,t)||ue.NotSpecified,r.properties=se.sanitizeProperties(e,n),r.measurements=se.sanitizeMeasurements(e,i),r}var Ce,Pe=function Kt(){},Ae=(t(Me,Ce=Ne),Me);function Me(){var e=Ce.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var Le,Ue=function Jt(){this.hasFullStack=!0,this.parsedStack=[]},Oe=(t(Re,Le=Ae),Re.CreateFromInterface=function(t,e){var n=e.exceptions&&f.arrMap(e.exceptions,function(e){return Ve.CreateFromInterface(t,e)});return new Re(t,c({},e,{exceptions:n}))},Re.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,i=e.measurements,r=e.severityLevel,o=(e.ver,e.problemGroup),a=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&f.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:r,properties:n,measurements:i,problemGroup:o,id:a,isManual:s}},Re.CreateSimpleException=function(e,t,n,i,r,o){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},Re.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Re.dataType="ExceptionData",Re);function Re(e,t,n,i,r,o){var a=Le.call(this)||this;return a.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},t instanceof Error?(a.exceptions=[new Ve(e,t)],a.properties=se.sanitizeProperties(e,n),a.measurements=se.sanitizeMeasurements(e,i),r&&(a.severityLevel=r),o&&(a.id=o)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel),t.id&&(a.id=t.id),t.problemGroup&&(a.problemGroup=t.problemGroup),a.ver=2,f.isNullOrUndefined(t.isManual)||(a.isManual=t.isManual)),a}var ze,Ve=(t(Ge,ze=Ue),Ge.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&f.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},Ge.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&f.arrMap(t.parsedStack,function(e){return qe.CreateFromInterface(e)})||t.parsedStack;return new Ge(e,c({},t,{parsedStack:n}))},Ge.parseStack=function(e){var t;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,o=0;o<=n.length;o++){var a=n[o];if(qe.regex.test(a)){var s=new qe(n[o],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var c=0,l=t.length-1,u=0,g=c,f=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=l,c++,l--}}return t},Ge);function Ge(e,t){var n=ze.call(this)||this;if(n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},t instanceof Error){n.typeName=se.sanitizeString(e,t.name)||ue.NotSpecified,n.message=se.sanitizeMessage(e,t.message)||ue.NotSpecified;var i=t.stack;n.parsedStack=Ge.parseStack(i),n.stack=se.sanitizeException(e,i),n.hasFullStack=ue.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var je,qe=(t(Be,je=Pe),Be.CreateFromInterface=function(e){return new Be(e,null)},Be.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Be.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Be.baseSize=58,Be);function Be(e,t){var n=je.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},"string"==typeof e){var i=e;n.level=t,n.method="<no_method>",n.assembly=ue.trim(i),n.fileName="",n.line=0;var r=i.match(Be.regex);r&&5<=r.length&&(n.method=ue.trim(r[2])||n.method,n.fileName=ue.trim(r[4]),n.line=parseInt(r[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Be.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Fe,We,He,Xe=(t(Ke,Fe=Ne),Ke);function Ke(){var e=Fe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(He=We=We||{})[He.Measurement=0]="Measurement",He[He.Aggregation=1]="Aggregation";var Je,Qe=(t(Ye,Je=function Qt(){this.kind=We.Measurement}),Ye);function Ye(){var e=null!==Je&&Je.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}var $e,Ze=(t(et,$e=Xe),et.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",et.dataType="MetricData",et);function et(e,t,n,i,r,o,a,s){var c=$e.call(this)||this;c.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.Default};var l=new Qe;return l.count=0<i?i:undefined,l.max=isNaN(o)||null===o?undefined:o,l.min=isNaN(r)||null===r?undefined:r,l.name=se.sanitizeString(e,t)||ue.NotSpecified,l.value=n,c.metrics=[l],c.properties=se.sanitizeProperties(e,a),c.measurements=se.sanitizeMeasurements(e,s),c}var tt,nt=(t(it,tt=Ee),it);function it(){var e=tt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var rt,ot=(t(at,rt=nt),at.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",at.dataType="PageviewData",at);function at(e,t,n,i,r,o,a){var s=rt.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=se.sanitizeId(e,a),s.url=se.sanitizeUrl(e,n),s.name=se.sanitizeString(e,t)||ue.NotSpecified,isNaN(i)||(s.duration=ue.msToTimeSpan(i)),s.properties=se.sanitizeProperties(e,r),s.measurements=se.sanitizeMeasurements(e,o),s}var st,ct=(t(lt,st=Ne),lt);function lt(){var e=st.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var ut,gt=(t(ft,ut=ct),ft.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",ft.dataType="RemoteDependencyData",ft);function ft(e,t,n,i,r,o,a,s,c,l,u,g){void 0===c&&(c="Ajax");var f=ut.call(this)||this;f.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},f.id=t,f.duration=ue.msToTimeSpan(r),f.success=o,f.resultCode=a+"",f.type=se.sanitizeString(e,c);var p=de.ParseDependencyPath(e,n,s,i);return f.data=se.sanitizeUrl(e,i)||p.data,f.target=se.sanitizeString(e,p.target),l&&(f.target=f.target+" | "+l),f.name=se.sanitizeString(e,p.name),f.properties=se.sanitizeProperties(e,u),f.measurements=se.sanitizeMeasurements(e,g),f}var pt,dt=(t(ht,pt=Ne),ht);function ht(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var mt,vt=(t(yt,mt=dt),yt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",yt.dataType="MessageData",yt);function yt(e,t,n,i,r){var o=mt.call(this)||this;return o.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||ue.NotSpecified,o.message=se.sanitizeMessage(e,t),o.properties=se.sanitizeProperties(e,i),o.measurements=se.sanitizeMeasurements(e,r),n&&(o.severityLevel=n),o}var wt,_t=(t(It,wt=nt),It);function It(){var e=wt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var St,Tt=(t(Nt,St=_t),Nt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",Nt.dataType="PageviewPerformanceData",Nt);function Nt(e,t,n,i,r,o,a){var s=St.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},s.url=se.sanitizeUrl(e,n),s.name=se.sanitizeString(e,t)||ue.NotSpecified,s.properties=se.sanitizeProperties(e,r),s.measurements=se.sanitizeMeasurements(e,o),a&&(s.domProcessing=a.domProcessing,s.duration=a.duration,s.networkConnect=a.networkConnect,s.perfTotal=a.perfTotal,s.receivedResponse=a.receivedResponse,s.sentRequest=a.sentRequest),s}var Et,xt,bt;t(Dt,Et=we);function Dt(e,t){var n=Et.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}(bt=xt=xt||{})[bt.Verbose=0]="Verbose",bt[bt.Information=1]="Information",bt[bt.Warning=2]="Warning",bt[bt.Error=3]="Error",bt[bt.Critical=4]="Critical";var kt=(Ct.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!f.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],f.isNullOrUndefined(r)?i:r},Ct);function Ct(){}var Pt=(At.create=function(e,t,n,i,r,o){if(n=se.sanitizeString(i,n)||ue.NotSpecified,f.isNullOrUndefined(e)||f.isNullOrUndefined(t)||f.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var a={name:n,time:f.toISOString(new Date),iKey:"",ext:o||{},tags:[],data:{},baseType:t,baseData:e};if(!f.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(a.data[s]=r[s]);return a},At);function At(){}var Mt=(Lt.prototype.trackPageView=function(n,i){var r=this,o=n.name;!f.isNullOrUndefined(o)&&"string"==typeof o||(o=n.name="object"==typeof window&&window.document&&window.document.title||"");var a=n.uri;if(!f.isNullOrUndefined(a)&&"string"==typeof a||(a=n.uri="object"==typeof window&&window.location&&window.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(n,i),f.arrForEach(this._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})}),void this._logger.throwInternal(w.WARNING,M,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var s,e,c=!1,l=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=me.GetDuration(l,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=undefined),f.isNullOrUndefined(i)||f.isNullOrUndefined(i.duration)||(e=i.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&((i=i||{}).duration=s),this.appInsights.sendPageViewInternal(n,i),f.arrForEach(this._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})}),c=!0),i=i||{};var u=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(u);var e={name:o,uri:a};r._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||c?(c||(i.duration=e.durationMs,r.appInsights.sendPageViewInternal(n,i)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,i),r.pageViewPerformanceSent=!0),f.arrForEach(r._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})})):(i.duration=s,r.appInsights.sendPageViewInternal(n,i),f.arrForEach(r._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})}))}else 6e4<me.GetDuration(l,+new Date)&&(clearInterval(u),c||(i.duration=6e4,r.appInsights.sendPageViewInternal(n,i),f.arrForEach(r._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})})))}catch(t){r._logger.throwInternal(w.CRITICAL,j,"trackPageView failed on page load calculation: "+ue.getExceptionName(t),{exception:ue.dump(t)})}},100)},Lt);function Lt(e,t,n,i){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=i,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var Ut=(Ot.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(i){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+ue.dump(i))}},Ot.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(i){return this._logger.warnToConsole("Call to restart failed: "+ue.dump(i)),null}},Ot.prototype.startPageVisitTimer=function(e,t){try{if(ue.canUseSessionStorage()){if(null!=ue.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new Rt(e,t),i=JSON.stringify(n);ue.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,i)}}catch(r){this._logger.warnToConsole("Call to start failed: "+ue.dump(r))}},Ot.prototype.stopPageVisitTimer=function(){try{if(ue.canUseSessionStorage()){var e=Date.now(),t=ue.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,ue.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(i){return this._logger.warnToConsole("Stop page visit timer failed: "+ue.dump(i)),null}},Ot);function Ot(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var Rt=function Yt(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},zt=(Vt.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming();if(t||n){if(t)var i=t.duration,r=me.GetDuration(t.startTime,t.connectEnd),o=me.GetDuration(t.requestStart,t.responseStart),a=me.GetDuration(t.responseStart,t.responseEnd),s=me.GetDuration(t.responseEnd,t.loadEventEnd);else i=me.GetDuration(n.navigationStart,n.loadEventEnd),r=me.GetDuration(n.navigationStart,n.connectEnd),o=me.GetDuration(n.requestStart,n.responseStart),a=me.GetDuration(n.responseStart,n.responseEnd),s=me.GetDuration(n.responseEnd,n.loadEventEnd);0===i?this._logger.throwInternal(w.WARNING,C,"error calculating page view performance.",{total:i,network:r,request:o,response:a,dom:s}):this.shouldCollectDuration(i,r,o,a,s)?i<Math.floor(r)+Math.floor(o)+Math.floor(a)+Math.floor(s)?this._logger.throwInternal(w.WARNING,k,"client performance math error.",{total:i,network:r,request:o,response:a,dom:s}):(e.durationMs=i,e.perfTotal=e.duration=ue.msToTimeSpan(i),e.networkConnect=ue.msToTimeSpan(r),e.sentRequest=ue.msToTimeSpan(o),e.receivedResponse=ue.msToTimeSpan(a),e.domProcessing=ue.msToTimeSpan(s),e.isValid=!0):this._logger.throwInternal(w.WARNING,B,"Invalid page load duration value. Browser perf data won't be sent.",{total:i,network:r,request:o,response:a,dom:s})}},Vt.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},Vt.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?window.performance.getEntriesByType("navigation")[0]:null},Vt.prototype.isPerformanceNavigationTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.getEntriesByType&&0<window.performance.getEntriesByType("navigation").length},Vt.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},Vt.prototype.isPerformanceTimingDataReady=function(){var e="object"==typeof window&&window.performance.timing;return"object"==typeof window&&0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},Vt.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var o=0;o<n.length;o++)r=r||-1!==i.toLowerCase().indexOf(n[o]);if(r)return!1;for(o=0;o<e.length;o++)if(e[o]>=this.MAX_DURATION_ALLOWED)return!1;return!0},Vt);function Vt(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Gt="duration",jt=(qt.getDefaultConfig=function(e){return(e=e||{}).sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=ue.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=ue.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=ue.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=ue.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=ue.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=ue.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=ue.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},qt.prototype.processTelemetry=function(e){for(var t=!1,n=this._telemetryInitializers.length,i=0;i<n;++i){var r=this._telemetryInitializers[i];if(r)try{if(!1===r.apply(null,[e])){t=!0;break}}catch(o){this._logger.throwInternal(w.CRITICAL,Y,"One of telemetry initializers failed, telemetry item will not be sent: "+ue.getExceptionName(o),{exception:ue.dump(o)},!0)}}t||f.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},qt.prototype.setNextPlugin=function(e){this._nextPlugin=e},qt.prototype.trackEvent=function(e,t){try{var n=Pt.create(e,De.dataType,De.envelopeType,this._logger,t);this.core.track(n)}catch(i){this._logger.throwInternal(w.WARNING,q,"trackTrace failed, trace will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(t){this._logger.throwInternal(w.CRITICAL,L,"startTrackEvent failed, event will not be collected: "+ue.getExceptionName(t),{exception:ue.dump(t)})}},qt.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,undefined,t)}catch(i){this._logger.throwInternal(w.CRITICAL,U,"stopTrackEvent failed, event will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.trackTrace=function(e,t){try{var n=Pt.create(e,vt.dataType,vt.envelopeType,this._logger,t);this.core.track(n)}catch(i){this._logger.throwInternal(w.WARNING,q,"trackTrace failed, trace will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.trackMetric=function(e,t){try{var n=Pt.create(e,Ze.dataType,Ze.envelopeType,this._logger,t);this.core.track(n)}catch(i){this._logger.throwInternal(w.CRITICAL,V,"trackMetric failed, metric will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,c({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(i){this._logger.throwInternal(w.CRITICAL,G,"trackPageView failed, page view will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=e.refUri===undefined?document.referrer:e.refUri);var i=Pt.create(e,ot.dataType,ot.envelopeType,this._logger,t,n);this.core.track(i),this._trackAjaxAttempts=0},qt.prototype.sendPageViewPerformanceInternal=function(e,t,n){var i=Pt.create(e,Tt.dataType,Tt.envelopeType,this._logger,t,n);this.core.track(i)},qt.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(n){this._logger.throwInternal(w.CRITICAL,G,"trackPageViewPerformance failed, page view will not be collected: "+ue.getExceptionName(n),{exception:ue.dump(n)})}},qt.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e="object"==typeof window&&window.document&&window.document.title||""),this._pageTracking.start(e)}catch(t){this._logger.throwInternal(w.CRITICAL,O,"startTrackPage failed, page view may not be collected: "+ue.getExceptionName(t),{exception:ue.dump(t)})}},qt.prototype.stopTrackPage=function(e,t,n,i){try{"string"!=typeof e&&(e="object"==typeof window&&window.document&&window.document.title||""),"string"!=typeof t&&(t="object"==typeof window&&window.location&&window.location.href||""),this._pageTracking.stop(e,t,n,i),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(r){this._logger.throwInternal(w.CRITICAL,R,"stopTrackPage failed, page view will not be collected: "+ue.getExceptionName(r),{exception:ue.dump(r)})}},qt.prototype.sendExceptionInternal=function(e,t,n){var i=new Oe(this._logger,e.exception||new Error(ue.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),r=Pt.create(i,Oe.dataType,Oe.envelopeType,this._logger,t,n);this.core.track(r)},qt.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(n){this._logger.throwInternal(w.CRITICAL,z,"trackException failed, exception will not be collected: "+ue.getExceptionName(n),{exception:ue.dump(n)})}},qt.prototype._onerror=function(e){try{var t={url:e&&e.url||document.URL,lineNumber:e.lineNumber,columnNumber:e.columnNumber,message:e.message};if(ue.isCrossOriginError(e.message,e.url,e.lineNumber,e.columnNumber,e.error))this._sendCORSException(t.url);else{if(!ue.isError(e.error)){var n="window.onerror@"+t.url+":"+e.lineNumber+":"+(e.columnNumber||0);e.error=new Error(e.message),e.error.stack=n}this.trackException({exception:e.error,severityLevel:xt.Error},t)}}catch(r){var i=e.error?e.error.name+", "+e.error.message:"null";this._logger.throwInternal(w.CRITICAL,P,"_onError threw exception while logging error, error will not be collected: "+ue.getExceptionName(r),{exception:ue.dump(r),errorString:i})}},qt.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},qt.prototype._initialize=function(e,t,n){var a=this;if(!this._isInitialized){if(f.isNullOrUndefined(t))throw Error("Error initializing");this.core=t,this._logger=t.logger,this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=e.extensionConfig&&e.extensionConfig[this.identifier]?e.extensionConfig[this.identifier]:{};var i=qt.getDefaultConfig();if(i!==undefined){for(var r in i)this.config[r]=kt.getConfig(e,r,this.identifier,i[r]);if(this._globalconfig)for(var r in i)this._globalconfig[r]===undefined&&(this._globalconfig[r]=i[r])}this.config.isCookieUseDisabled&&ue.disableCookies(),this.config.isStorageUseDisabled&&ue.disableStorage();var o={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return a.config.accountId||e.accountId},sessionRenewalMs:function(){return a.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return a.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return a.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return a.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return a.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return a.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return a.config.appId||e.appId}};this._pageViewPerformanceManager=new zt(this.core),this._pageViewManager=new Mt(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new Ut(this._logger,function(e,t,n){return a.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(o),this._eventTracking=new Bt(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,i){(i=i||{})[Gt]=n.toString(),a.trackEvent({name:e,properties:i})},this._pageTracking=new Bt(this._logger,"trackPageView"),this._pageTracking.action=function(e,t,n,i,r){f.isNullOrUndefined(i)&&(i={}),i[Gt]=n.toString();var o={name:e,uri:t,properties:i,measurements:r};a.sendPageViewInternal(o)};var s,c,l=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented&&"object"==typeof window){var u=window.onerror;window.onerror=function(e,t,n,i,r){var o=u&&u(e,t,n,i,r);return!0!==o&&l._onerror({message:e,url:t,lineNumber:n,columnNumber:i,error:r}),o},this.config.autoExceptionInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&"object"==typeof history&&"function"==typeof history.pushState&&"function"==typeof history.replaceState&&"object"==typeof window&&"undefined"!=typeof Event){var g=this;f.arrForEach(n,function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(a._properties=e)}),history.pushState=(c=history.pushState,function(){var e=c.apply(this,arguments);return window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"pushState")),window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"locationchange")),e}),history.replaceState=(s=history.replaceState,function(){var e=s.apply(this,arguments);return window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"replaceState")),window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"locationchange")),e}),window.addEventListener(g.config.namePrefix+"popstate",function(){window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"locationchange"))}),window.addEventListener(g.config.namePrefix+"locationchange",function(){g._properties&&g._properties.context&&g._properties.context.telemetryTrace&&(g._properties.context.telemetryTrace.traceID=ue.generateW3CId(),g._properties.context.telemetryTrace.name=window.location&&window.location.pathname||"_unknown_"),a._currUri&&(a._prevUri=a._currUri),a._currUri=window.location&&window.location.href||"",setTimeout(function(e){g.trackPageView({refUri:e,properties:{duration:0}})}.bind(a,a._prevUri),g.autoRoutePVDelay)})}this._isInitialized=!0}},qt.prototype.trackPageVisitTime=function(e,t,n){var i={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},i)},qt.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var i=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===gt.dataType){var t=e.baseData;if(t)for(var n=0;n<i.length;n++)if(t.target&&0<=t.target.indexOf(i[n]))return!1}return!0})}},qt.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},qt.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:undefined},n=Pt.create(t,Oe.dataType,Oe.envelopeType,this._logger,{url:e});this.core.track(n)},qt.Version="2.3.1",qt);function qt(){this.identifier="ApplicationInsightsAnalytics",this.priority=180,this.autoRoutePVDelay=500,this._isInitialized=!1,this._trackAjaxAttempts=0,this._prevUri="object"==typeof window&&window.location&&window.location.href||"",this.initialize=this._initialize.bind(this)}var Bt=(Ft.prototype.start=function(e){"undefined"!=typeof this._events[e]&&this._logger.throwInternal(w.WARNING,J,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},Ft.prototype.stop=function(e,t,n,i){var r=this._events[e];if(isNaN(r))this._logger.throwInternal(w.WARNING,Q,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var o=+new Date,a=me.GetDuration(r,o);this.action(e,t,a,n,i)}delete this._events[e],this._events[e]=undefined},Ft);function Ft(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=jt,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a,n,d,i,o,s,c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=a=a||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(i=d=d||{})[i.Default=0]="Default",i[i.Required=1]="Required",i[i.Array=2]="Array",i[i.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var l=2,u="object";function g(){return Boolean(typeof window===u&&window)}function y(){return g()?window:null}function f(){return function e(){return Boolean(typeof document===u&&document)}()?document:g()&&y().document||null}function p(){return function e(){return Boolean(typeof navigator===u&&navigator)}()?navigator:null}function I(){return function e(){return Boolean(typeof history===u&&history)}()?history:null}function h(){return Boolean(typeof JSON===u&&JSON)}function m(){return h()?JSON:null}var v="undefined",T="prototype",S="attachEvent",w="addEventListener",N="detachEvent",_="removeEventListener";function E(e,t){return typeof e===t}function x(e){return e===undefined||E(e,v)}function b(e){return x(e)||null===e}function D(e,t){return e&&Object[T].hasOwnProperty.call(e,t)}function P(e){return E(e,"object")}function C(e){return E(e,"function")}function k(e,t,n,r){void 0===r&&(r=!1);var i=!1;if(!b(e))try{b(e[w])?b(e[S])||(e[S]("on"+t,n),i=!0):(e[w](t,n,r),i=!0)}catch(a){}return i}function L(e,t,n,r){if(void 0===r&&(r=!1),!b(e))try{b(e[_])?b(e[N])||e[N]("on"+t,n):e[_](t,n,r)}catch(i){}}var A=(M.isDate=function(e){return"[object Date]"===Object[T].toString.call(e)},M.isString=function(e){return E(e,"string")},M.isNumber=function(e){return E(e,"number")},M.isBoolean=function(e){return E(e,"boolean")},M.disableCookies=function(){M._canUseCookies=!1},M.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(O,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},M.toISOString=function(e){if(M.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},M.arrForEach=function(e,t,n){for(var r=e.length,i=0;i<r;++i)i in e&&t.call(n||e,e[i],i,e)},M.arrIndexOf=function(e,t,n){for(var r=e.length,i=n||0,a=Math.max(0<=i?i:r-Math.abs(i),0);a<r;a++)if(a in e&&e[a]===t)return a;return-1},M.arrMap=function(e,t,n){for(var r=e.length,i=n||e,a=new Array(r),o=0;o<r;o++)o in e&&(a[o]=t.call(i,e[o],e));return a},M.arrReduce=function(e,t,n){var r,i=e.length,a=0;if(3<=arguments.length)r=n;else{for(;a<i&&!(a in e);)a++;r=e[a++]}for(;a<i;)a in e&&(r=t(r,e[a],a,e)),a++;return r},M.objCreate=function(e){if(null==e)return{};if(!P(e)&&!C(e))throw new TypeError("Object prototype may only be an Object: "+e);function t(){}return t[T]=e,new t},M.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(C(e)||P(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var r in e)D(e,r)&&n.push(r);if(t)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=i.length,o=0;o<a;o++)D(e,i[o])&&n.push(i[o]);return n},M.objDefineAccessors=function(e,t,n,r){var i=Object.defineProperty;if(i)try{var a={enumerable:!0,configurable:!0};return n&&(a.get=n),r&&(a.set=r),i(e,t,a),!0}catch(o){}return!1},M.addEventHandler=function(e,t){var n=!1,r=y();r&&(n=k(r,e,t),n=k(r.body,e,t)||n);var i=f();return i&&(n=z.Attach(i,e,t)||n),n},M.isTypeof=E,M.isUndefined=x,M.isNullOrUndefined=b,M.hasOwnProperty=D,M.isFunction=C,M.isObject=P,M);function M(){}var U,R,O=/[xy]/g,z=(V.Attach=k,V.AttachEvent=k,V.Detach=L,V.DetachEvent=L,V);function V(){}(R=U=U||{})[R.CRITICAL=1]="CRITICAL",R[R.WARNING=2]="WARNING";var G=1,j=2,q=3,B=4,F=5,W=6,H=8,X=10,K=11,Q=23,J=25,Y=29,$=30,Z=31,ee=32,te=35,ne=36,re=37,ie=38,ae=39,oe=45,se=49,ce=52,le=56,ue=57,ge=61,fe=62,pe=63,de=64,he=66,me=68,ve=69,ye=73,Ie=(Te.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},Te.dataType="MessageData",Te.AiNonUserActionablePrefix="AI (Internal): ",Te.AiUserActionablePrefix="AI: ",Te);function Te(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?Te.AiUserActionablePrefix:Te.AiNonUserActionablePrefix)+e;var i="";h()&&(i=m().stringify(r));var a=(t?" message:"+Te.sanitizeDiagnosticText(t):"")+(r?" props:"+Te.sanitizeDiagnosticText(i):"");this.message+=a}var Se=(we.prototype.throwInternal=function(e,t,n,r,i){void 0===i&&(i=!1);var a=new Ie(t,n,i,r),o=this;if(o.enableDebugExceptions())throw a;if(!A.isUndefined(a)&&a&&!A.isUndefined(a.message)){if(i){var s=+a.messageId;!o._messageLogged[s]&&o.consoleLoggingLevel()>=U.WARNING&&(o.warnToConsole(a.message),o._messageLogged[s]=!0)}else o.consoleLoggingLevel()>=U.WARNING&&o.warnToConsole(a.message);o.logInternalMessage(e,a)}},we.prototype.warnToConsole=function(e){!A.isUndefined(console)&&console&&(A.isFunction(console.warn)?console.warn(e):A.isFunction(console.log)&&console.log(e))},we.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},we.prototype.logInternalMessage=function(e,t){var n=this;if(!n._areInternalMessagesThrottled()){var r=!0,i=n.AIInternalMessagePrefix+t.messageId;if(n._messageLogged[i]?r=!1:n._messageLogged[i]=!0,r&&(e<=n.telemetryLoggingLevel()&&(n.queue.push(t),n._messageCount++),n._messageCount===n.maxInternalMessageLimit())){var a="Internal events throttle limit per PageView reached for this app.",o=new Ie(Q,a,!1);n.queue.push(o),n.warnToConsole(a)}}},we.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},we);function we(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},A.isNullOrUndefined(e)||(A.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),A.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),A.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),A.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var Ne=A.isFunction,_e=function qn(i,a){var o=this,s=null,c=Ne(i.processTelemetry),l=Ne(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return s},o.setNext=function(e){s=e},o.processTelemetry=function(e,t){if(t=t||a,i&&c){o._hasRun=!0;try{t.setNext(s),l&&i.setNextPlugin(s),s&&(s._hasRun=!1),i.processTelemetry(e,t)}catch(r){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(U.CRITICAL,ye,"Plugin ["+i.identifier+"] failed during processTelemetry - "+r),s&&!n&&s.processTelemetry(e,t)}}else s&&(o._hasRun=!0,s.processTelemetry(e,t))}},Ee=A.isNullOrUndefined;function xe(e,t){var n=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var a=e[i];if(a&&A.isFunction(a.processTelemetry)){var o=new _e(a,t);n.push(o),r&&r.setNext(o),r=o}}return 0<n.length?n[0]:null}var be=function Bn(e,a,n,t){var o=this,r=null;null!==t&&(e&&A.isFunction(e.getPlugin)?r=function s(e,t,n){var r=[],i=!n;if(e)for(;e;){var a=e.getPlugin();!i&&a!==n||(i=!0,r.push(a)),e=e.getNext()}return i||r.push(n),xe(r,t)}(e,o,t||e.getPlugin()):t?r=function c(e,t,n){var r=e,i=!1;return n&&e&&(r=[],A.arrForEach(e,function(e){!i&&e!==n||(i=!0,r.push(e))})),n&&!i&&(r=r||[]).push(n),xe(r,t)}(e,o,t):A.isUndefined(t)&&(r=xe(e,o))),o.core=function(){return n},o.diagLog=function(){var e=(n||{}).logger;return e=e||new Se(a||{})},o.getCfg=function(){return a},o.getExtCfg=function(e,t){var n;if(void 0===t&&(t={}),a){var r=a.extensionConfig;r&&e&&(n=r[e])}return n||t},o.getConfig=function(e,t,n){var r;void 0===n&&(n=!1);var i=o.getExtCfg(e,null);return i&&!Ee(i[t])?r=i[t]:a&&!Ee(a[t])&&(r=a[t]),Ee(r)?n:r},o.hasNext=function(){return null!=r},o.getNext=function(){return r},o.setNext=function(e){r=e},o.processNext=function(e){var t=r;t&&(r=t.getNext(),t.processTelemetry(e,o))},o.createNew=function(e,t){return void 0===e&&(e=null),new Bn(e||r,a,n,t)}},De=A.isFunction,Pe="getPlugin",Ce=(ke.prototype.initialize=function(e,t,n,r){this._baseTelInit(e,t,n,r)},ke);function ke(){var a=this,o=!1,s=null,c=null;a.core=null,a.diagLog=function(e){return a._getTelCtx(e).diagLog()},a.isInitialized=function(){return o},a.setInitialized=function(e){o=e},a.setNextPlugin=function(e){c=e},a.processNext=function(e,t){t?t.processNext(e):c&&De(c.processTelemetry)&&c.processTelemetry(e,null)},a._getTelCtx=function(e){void 0===e&&(e=null);var t=e;if(!t){var n=s||new be(null,{},a.core);t=c&&c[Pe]?n.createNew(null,c[Pe]):n.createNew(null,c)}return t},a._baseTelInit=function(e,t,n,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&t&&(r=t.getProcessTelContext().getNext());var i=c;c&&c[Pe]&&(i=c[Pe]()),a.core=t,s=new be(r,e,t,i),o=!0}}var Le=A.isFunction,Ae="processTelemetry",Me="priority",Ue="setNextPlugin",Re="isInitialized";function Oe(t,n){for(var e=[],r=null,i=t.getNext();i;){var a=i.getPlugin();a&&(r&&Le(r[Ue])&&Le(a[Ae])&&r[Ue](a),Le(a[Re])&&a[Re]()||e.push(a),r=a,i=i.getNext())}A.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function ze(e){return e.sort(function(e,t){var n=0,r=Le(t[Ae]);return Le(e[Ae])?n=r?e[Me]-t[Me]:1:r&&(n=-1),n})}var Ve=500,Ge="Channel has invalid priority",je=A.arrForEach,qe=A.objDefineAccessors;function Be(e,t){t&&0<t.length&&(function n(e){je(e,function(e){if(e.priority<Ve)throw Error(Ge+e.identifier)})}(t=t.sort(function(e,t){return e.priority-t.priority})),e.push(t))}var Fe,We=(t(He,Fe=Ce),He.prototype.processTelemetry=function(t,n){var r=this;this._channelQueue&&je(this._channelQueue,function(e){0<e.length&&r._getTelCtx(n).createNew(e).processNext(t)})},He.prototype.getChannelControls=function(){return this._channelQueue},He.prototype.initialize=function(t,n,r){if(!this.isInitialized()){Fe.prototype.initialize.call(this,t,n,r),t.isCookieUseDisabled&&A.disableCookies();var e=this._channelQueue=function i(e,t){var n=[];if(e&&je(e,function(e){return Be(n,e)}),t){var r=[];je(t,function(e){e.priority>Ve&&r.push(e)}),Be(n,r)}return n}((t||{}).channels,r);je(e,function(e){return Oe(new be(e,t,n),r)})}},He._staticInit=(qe(He.prototype,"ChannelControls",He.prototype.getChannelControls),void qe(He.prototype,"channelQueue",He.prototype.getChannelControls)),He);function He(){var e=null!==Fe&&Fe.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=Ve,e}var Xe=A.arrForEach,Ke=A.isNullOrUndefined,Qe=(Je.prototype.initialize=function(e,t,r,n){var i=this;if(i.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Ke(e.instrumentationKey))throw Error("Please provide instrumentation key");i.config=e;var a=i._channelController;n=n||A.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}}),i._notificationManager=n,e.extensions=Ke(e.extensions)?[]:e.extensions,(e.extensionConfig=Ke(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,r=r||A.objCreate({throwInternal:function(e,t,n,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),i.logger=r;var o=[];o.push.apply(o,t.concat(e.extensions)),o=ze(o);var s=[],c={};if(Xe(o,function(e){if(Ke(e)||Ke(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(Ke(c[t])?c[t]=n:r.warnToConsole("Two extensions have same priority #"+t+" - "+c[t]+", "+n)),(!t||t<a.priority)&&s.push(e)}),o.push(a),s.push(a),o=ze(o),i._extensions=o,Oe(new be([a],e,i),o),Oe(new be(s,e,i),o),i._extensions=s,0===i.getTransmissionControls().length)throw new Error("No channels available");i._setInit(!0)},Je.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Je.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=A.toISOString(new Date)),Ke(e.ver)&&(e.ver="4.0"),this.getProcessTelContext().processNext(e)},Je.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new be(t,this.config,this)},Je);function Je(){var t=!1;this._extensions=new Array,this._channelController=new We,this.isInitialized=function(){return t},this._setInit=function(e){t=e}}var Ye=($e.prototype.addNotificationListener=function(e){this.listeners.push(e)},$e.prototype.removeNotificationListener=function(e){for(var t=A.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=A.arrIndexOf(this.listeners,e)},$e.prototype.eventsSent=function(t){for(var n=this,e=function(e){r.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},r=this,i=0;i<this.listeners.length;++i)e(i)},$e.prototype.eventsDiscarded=function(t,n){for(var r=this,e=function(e){i.listeners[e].eventsDiscarded&&setTimeout(function(){return r.listeners[e].eventsDiscarded(t,n)},0)},i=this,a=0;a<this.listeners.length;++a)e(a)},$e);function $e(){this.listeners=[]}var Ze;t(et,Ze=Qe),et.prototype.initialize=function(e,t){var n=this;n._notificationManager=new Ye,n.logger=new Se(e),n.config=e,Ze.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},et.prototype.getTransmissionControls=function(){return Ze.prototype.getTransmissionControls.call(this)},et.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Ze.prototype.track.call(this,e)},et.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},et.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},et.prototype.pollInternalLogs=function(r){var t=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];A.arrForEach(e,function(e){var t={name:r||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:A.toISOString(new Date),baseType:Ie.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},et.prototype._validateTelemetryItem=function(e){if(A.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},et.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],l)};function et(){return Ze.call(this)||this}var tt=(nt.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=nt.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;n[o]!==undefined;)a++,o=i.substring(0,nt.MAX_NAME_LENGTH-3)+nt.padNumber(a);i=o}return i},nt.sanitizeKey=function(e,t){var n;return t&&(t=nt.trim(t.toString())).length>nt.MAX_NAME_LENGTH&&(n=t.substring(0,nt.MAX_NAME_LENGTH),e.throwInternal(U.WARNING,ue,"name is too long. It has been truncated to "+nt.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},nt.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=nt.MAX_STRING_LENGTH),t&&(n=n||nt.MAX_STRING_LENGTH,(t=nt.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(U.WARNING,ge,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},nt.sanitizeUrl=function(e,t){return nt.sanitizeInput(e,t,nt.MAX_URL_LENGTH,he)},nt.sanitizeMessage=function(e,t){var n;return t&&t.length>nt.MAX_MESSAGE_LENGTH&&(n=t.substring(0,nt.MAX_MESSAGE_LENGTH),e.throwInternal(U.WARNING,le,"message is too long, it has been truncated to "+nt.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},nt.sanitizeException=function(e,t){var n;return t&&t.length>nt.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,nt.MAX_EXCEPTION_LENGTH),e.throwInternal(U.WARNING,ce,"exception is too long, it has been truncated to "+nt.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},nt.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var i=t[r];if(A.isObject(i)&&h())try{i=m().stringify(i)}catch(a){e.throwInternal(U.WARNING,se,"custom property is not valid",{exception:a},!0)}i=nt.sanitizeString(e,i,nt.MAX_PROPERTY_LENGTH),n[r=nt.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},nt.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=nt.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},nt.sanitizeId=function(e,t){return t?nt.sanitizeInput(e,t,nt.MAX_ID_LENGTH,ve).toString():t},nt.sanitizeInput=function(e,t,n,r){var i;return t&&(t=nt.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(U.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},nt.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},nt.trim=function(e){return A.isString(e)?e.replace(/^\s+|\s+$/g,""):e},nt.MAX_NAME_LENGTH=150,nt.MAX_ID_LENGTH=128,nt.MAX_PROPERTY_LENGTH=8192,nt.MAX_STRING_LENGTH=1024,nt.MAX_URL_LENGTH=2048,nt.MAX_MESSAGE_LENGTH=32768,nt.MAX_EXCEPTION_LENGTH=32768,nt);function nt(){}var rt="prototype",it=y(),at=p(),ot=A.isString,st=(ct.createDomEvent=function(e){var t=null;return A.isFunction(Event)?t=new Event(e):(t=f().createEvent("Event")).initEvent(e,!0,!0),t},ct.disableStorage=function(){ct._canUseLocalStorage=!1,ct._canUseSessionStorage=!1},ct._getLocalStorageObject=function(){return ct.canUseLocalStorage()?ct._getVerifiedStorageObject(a.LocalStorage):null},ct._getVerifiedStorageObject=function(e){var t,n,r=null;try{if(A.isNullOrUndefined(it))return null;n=new Date,(r=e===a.LocalStorage?it.localStorage:it.sessionStorage).setItem(n.toString(),n.toString()),t=r.getItem(n.toString())!==n.toString(),r.removeItem(n.toString()),t&&(r=null)}catch(i){r=null}return r},ct.isInternalApplicationInsightsEndpoint=function(e){return-1!==ct._internalEndpoints.indexOf(e.toLowerCase())},ct.canUseLocalStorage=function(){return ct._canUseLocalStorage===undefined&&(ct._canUseLocalStorage=!!ct._getVerifiedStorageObject(a.LocalStorage)),ct._canUseLocalStorage},ct.getStorage=function(e,t){var n=ct._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){ct._canUseLocalStorage=!1,e.throwInternal(U.WARNING,G,"Browser failed read of local storage. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return null},ct.setStorage=function(e,t,n){var r=ct._getLocalStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(i){ct._canUseLocalStorage=!1,e.throwInternal(U.WARNING,q,"Browser failed write to local storage. "+ct.getExceptionName(i),{exception:ct.dump(i)})}return!1},ct.removeStorage=function(e,t){var n=ct._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){ct._canUseLocalStorage=!1,e.throwInternal(U.WARNING,F,"Browser failed removal of local storage item. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return!1},ct._getSessionStorageObject=function(){return ct.canUseSessionStorage()?ct._getVerifiedStorageObject(a.SessionStorage):null},ct.canUseSessionStorage=function(){return ct._canUseSessionStorage===undefined&&(ct._canUseSessionStorage=!!ct._getVerifiedStorageObject(a.SessionStorage)),ct._canUseSessionStorage},ct.getSessionStorageKeys=function(){var e=[];if(ct.canUseSessionStorage())for(var t in it.sessionStorage)e.push(t);return e},ct.getSessionStorage=function(e,t){var n=ct._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){ct._canUseSessionStorage=!1,e.throwInternal(U.WARNING,j,"Browser failed read of session storage. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return null},ct.setSessionStorage=function(e,t,n){var r=ct._getSessionStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(i){ct._canUseSessionStorage=!1,e.throwInternal(U.WARNING,B,"Browser failed write to session storage. "+ct.getExceptionName(i),{exception:ct.dump(i)})}return!1},ct.removeSessionStorage=function(e,t){var n=ct._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){ct._canUseSessionStorage=!1,e.throwInternal(U.WARNING,W,"Browser failed removal of session storage item. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return!1},ct.disableCookies=function(){A.disableCookies()},ct.canUseCookies=function(e){if(A._canUseCookies===undefined){A._canUseCookies=!1;try{A._canUseCookies=ct.document.cookie!==undefined}catch(t){e.throwInternal(U.WARNING,me,"Cannot access document.cookie - "+ct.getExceptionName(t),{exception:ct.dump(t)})}}return A._canUseCookies},ct.setCookie=function(e,t,n,r){n+=";SameSite=None";var i="",a="";r&&(i=";domain="+r),ct.document.location&&"https:"===ct.document.location.protocol&&(a=";secure"),ct.canUseCookies(e)&&(ct.document.cookie=t+"="+n+i+";path=/"+a)},ct.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},ct.getCookie=function(e,t){if(ct.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=ct.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=ct.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},ct.deleteCookie=function(e,t){ct.canUseCookies(e)&&(ct.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},ct.trim=function(e){return ot(e)?e.replace(/^\s+|\s+$/g,""):e},ct.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},ct.random32=function(){return 4294967296*Math.random()|0},ct.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=ct.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},ct.isArray=function(e){return"[object Array]"===Object[rt].toString.call(e)},ct.isError=function(e){return"[object Error]"===Object[rt].toString.call(e)},ct.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():at?at.userAgent.toLowerCase():"";return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},ct.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,i=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},ct.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},ct.dump=function(e){var t=Object[rt].toString.call(e),n="";return"[object Error]"===t?n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":h()&&(n=m().stringify(e)),t+n},ct.getExceptionName=function(e){return"[object Error]"===Object[rt].toString.call(e)?e.name:""},ct.addEventHandler=function(e,t){return z.Attach(it,e,t)},ct.IsBeaconApiSupported=function(){return"sendBeacon"in at&&at.sendBeacon},ct.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},ct.document=f()||{},ct._canUseLocalStorage=undefined,ct._canUseSessionStorage=undefined,ct._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],ct.NotSpecified="not_specified",ct.isDate=A.isDate,ct.toISOStringForIE8=A.toISOString,ct);function ct(){}var lt=(ut.parseUrl=function(e){return ut.htmlAnchorElement||(ut.htmlAnchorElement=ut.document.createElement?ut.document.createElement("a"):{host:ut.parseHost(e)}),ut.htmlAnchorElement.href=e,ut.htmlAnchorElement},ut.getAbsoluteUrl=function(e){var t,n=ut.parseUrl(e);return n&&(t=n.href),t},ut.getPathName=function(e){var t,n=ut.parseUrl(e);return n&&(t=n.pathname),t},ut.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ut.parseHost=function(e){if(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);if(null!=t&&2<t.length&&ot(t[2])&&0<t[2].length)return t[2]}return null},ut.document=f()||{},ut);function ut(){}var gt=(ft.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=lt.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=tt.sanitizeString(e,n?n+" "+c:c)}else a=tt.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},ft);function ft(){}var pt=(dt.Now=A.isUndefined(it)?function(){return(new Date).getTime()}:it.performance&&it.performance.now&&it.performance.timing?function(){return it.performance.now()+it.performance.timing.navigationStart}:function(){return(new Date).getTime()},dt.GetDuration=function(e,t){var n=null;return 0===e||0===t||A.isNullOrUndefined(e)||A.isNullOrUndefined(t)||(n=t-e),n},dt);function dt(){}var ht,mt=(t(vt,ht=function Fn(){}),vt);function vt(){return ht.call(this)||this}var yt;t(It,yt=function Wn(){this.ver=1,this.sampleRate=100,this.tags={}});function It(e,t,n){var r=yt.call(this)||this;return r.name=tt.sanitizeString(e,n)||st.NotSpecified,r.data=t,r.time=A.toISOString(new Date),r.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100===r.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},r}var Tt,St=function Hn(){},wt=(t(Nt,Tt=St),Nt);function Nt(){var e=Tt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var _t,Et=(t(xt,_t=wt),xt.envelopeType="Microsoft.ApplicationInsights.{0}.Event",xt.dataType="EventData",xt);function xt(e,t,n,r){var i=_t.call(this)||this;return i.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},i.name=tt.sanitizeString(e,t)||st.NotSpecified,i.properties=tt.sanitizeProperties(e,n),i.measurements=tt.sanitizeMeasurements(e,r),i}var bt,Dt=function Xn(){},Pt=(t(Ct,bt=St),Ct);function Ct(){var e=bt.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var kt,Lt=function Kn(){this.hasFullStack=!0,this.parsedStack=[]},At=(t(Mt,kt=Pt),Mt.CreateFromInterface=function(t,e){var n=e.exceptions&&A.arrMap(e.exceptions,function(e){return Rt.CreateFromInterface(t,e)});return new Mt(t,c({},e,{exceptions:n}))},Mt.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=(e.ver,e.problemGroup),o=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&A.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:i,properties:n,measurements:r,problemGroup:a,id:o,isManual:s}},Mt.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Mt.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Mt.dataType="ExceptionData",Mt);function Mt(e,t,n,r,i,a){var o=kt.call(this)||this;return o.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},t instanceof Error?(o.exceptions=[new Rt(e,t)],o.properties=tt.sanitizeProperties(e,n),o.measurements=tt.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),o.ver=2,A.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Ut,Rt=(t(Ot,Ut=Lt),Ot.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&A.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},Ot.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&A.arrMap(t.parsedStack,function(e){return Vt.CreateFromInterface(e)})||t.parsedStack;return new Ot(e,c({},t,{parsedStack:n}))},Ot.parseStack=function(e){var t;if(A.isString(e)){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(Vt.regex.test(o)){var s=new Vt(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,g=c,f=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=l,c++,l--}}return t},Ot);function Ot(e,t){var n=Ut.call(this)||this;if(n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},t instanceof Error){n.typeName=tt.sanitizeString(e,t.name)||st.NotSpecified,n.message=tt.sanitizeMessage(e,t.message)||st.NotSpecified;var r=t.stack;n.parsedStack=Ot.parseStack(r),n.stack=tt.sanitizeException(e,r),n.hasFullStack=st.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var zt,Vt=(t(Gt,zt=Dt),Gt.CreateFromInterface=function(e){return new Gt(e,null)},Gt.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Gt.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Gt.baseSize=58,Gt);function Gt(e,t){var n=zt.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=st.trim(r),n.fileName="",n.line=0;var i=r.match(Gt.regex);i&&5<=i.length&&(n.method=st.trim(i[2])||n.method,n.fileName=st.trim(i[4]),n.line=parseInt(i[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Gt.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var jt,qt,Bt,Ft=(t(Wt,jt=St),Wt);function Wt(){var e=jt.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(Bt=qt=qt||{})[Bt.Measurement=0]="Measurement",Bt[Bt.Aggregation=1]="Aggregation";var Ht,Xt=(t(Kt,Ht=function Qn(){this.kind=qt.Measurement}),Kt);function Kt(){var e=null!==Ht&&Ht.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}var Qt,Jt=(t(Yt,Qt=Ft),Yt.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Yt.dataType="MetricData",Yt);function Yt(e,t,n,r,i,a,o,s){var c=Qt.call(this)||this;c.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.Default};var l=new Xt;return l.count=0<r?r:undefined,l.max=isNaN(a)||null===a?undefined:a,l.min=isNaN(i)||null===i?undefined:i,l.name=tt.sanitizeString(e,t)||st.NotSpecified,l.value=n,c.metrics=[l],c.properties=tt.sanitizeProperties(e,o),c.measurements=tt.sanitizeMeasurements(e,s),c}var $t,Zt=(t(en,$t=wt),en);function en(){var e=$t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var tn,nn=(t(rn,tn=Zt),rn.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",rn.dataType="PageviewData",rn);function rn(e,t,n,r,i,a,o){var s=tn.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=tt.sanitizeId(e,o),s.url=tt.sanitizeUrl(e,n),s.name=tt.sanitizeString(e,t)||st.NotSpecified,isNaN(r)||(s.duration=st.msToTimeSpan(r)),s.properties=tt.sanitizeProperties(e,i),s.measurements=tt.sanitizeMeasurements(e,a),s}var an,on=(t(sn,an=St),sn);function sn(){var e=an.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var cn,ln=(t(un,cn=on),un.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",un.dataType="RemoteDependencyData",un);function un(e,t,n,r,i,a,o,s,c,l,u,g){void 0===c&&(c="Ajax");var f=cn.call(this)||this;f.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},f.id=t,f.duration=st.msToTimeSpan(i),f.success=a,f.resultCode=o+"",f.type=tt.sanitizeString(e,c);var p=gt.ParseDependencyPath(e,n,s,r);return f.data=tt.sanitizeUrl(e,r)||p.data,f.target=tt.sanitizeString(e,p.target),l&&(f.target=f.target+" | "+l),f.name=tt.sanitizeString(e,p.name),f.properties=tt.sanitizeProperties(e,u),f.measurements=tt.sanitizeMeasurements(e,g),f}var gn,fn=(t(pn,gn=St),pn);function pn(){var e=gn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var dn,hn=(t(mn,dn=fn),mn.envelopeType="Microsoft.ApplicationInsights.{0}.Message",mn.dataType="MessageData",mn);function mn(e,t,n,r,i){var a=dn.call(this)||this;return a.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||st.NotSpecified,a.message=tt.sanitizeMessage(e,t),a.properties=tt.sanitizeProperties(e,r),a.measurements=tt.sanitizeMeasurements(e,i),n&&(a.severityLevel=n),a}var vn,yn=(t(In,vn=Zt),In);function In(){var e=vn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Tn,Sn=(t(wn,Tn=yn),wn.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",wn.dataType="PageviewPerformanceData",wn);function wn(e,t,n,r,i,a,o){var s=Tn.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},s.url=tt.sanitizeUrl(e,n),s.name=tt.sanitizeString(e,t)||st.NotSpecified,s.properties=tt.sanitizeProperties(e,i),s.measurements=tt.sanitizeMeasurements(e,a),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var Nn,_n,En;t(xn,Nn=mt);function xn(e,t){var n=Nn.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}(En=_n=_n||{})[En.Verbose=0]="Verbose",En[En.Information=1]="Information",En[En.Warning=2]="Warning",En[En.Error=3]="Error",En[En.Critical=4]="Critical";var bn=(Dn.create=function(e,t,n,r,i,a){if(n=tt.sanitizeString(r,n)||st.NotSpecified,A.isNullOrUndefined(e)||A.isNullOrUndefined(t)||A.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:A.toISOString(new Date),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!A.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},Dn);function Dn(){}var Pn=(Cn.prototype.trackPageView=function(n,r){var i=this,e=y(),a=n.name;!A.isNullOrUndefined(a)&&"string"==typeof a||(a=n.name=e&&e.document&&e.document.title||"");var o=n.uri;if(!A.isNullOrUndefined(o)&&"string"==typeof o||(o=n.uri=e&&e.location&&e.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(n,r),A.arrForEach(this._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})}),void this._logger.throwInternal(U.WARNING,J,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var s,t,c=!1,l=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=pt.GetDuration(l,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=undefined),A.isNullOrUndefined(r)||A.isNullOrUndefined(r.duration)||(t=r.duration),!this.overridePageViewDuration&&isNaN(t)||(isNaN(t)&&((r=r||{}).duration=s),this.appInsights.sendPageViewInternal(n,r),A.arrForEach(this._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})}),c=!0),r=r||{};var u=setInterval(function(){try{if(i._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(u);var e={name:a,uri:o};i._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||c?(c||(r.duration=e.durationMs,i.appInsights.sendPageViewInternal(n,r)),i.pageViewPerformanceSent||(i.appInsights.sendPageViewPerformanceInternal(e,r),i.pageViewPerformanceSent=!0),A.arrForEach(i._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})})):(r.duration=s,i.appInsights.sendPageViewInternal(n,r),A.arrForEach(i._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})}))}else 6e4<pt.GetDuration(l,+new Date)&&(clearInterval(u),c||(r.duration=6e4,i.appInsights.sendPageViewInternal(n,r),A.arrForEach(i._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})})))}catch(t){i._logger.throwInternal(U.CRITICAL,ie,"trackPageView failed on page load calculation: "+st.getExceptionName(t),{exception:st.dump(t)})}},100)},Cn);function Cn(e,t,n,r){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=r,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var kn=(Ln.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(r){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+st.dump(r))}},Ln.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(r){return this._logger.warnToConsole("Call to restart failed: "+st.dump(r)),null}},Ln.prototype.startPageVisitTimer=function(e,t){try{if(st.canUseSessionStorage()){if(null!=st.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new An(e,t),r=m().stringify(n);st.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(i){this._logger.warnToConsole("Call to start failed: "+st.dump(i))}},Ln.prototype.stopPageVisitTimer=function(){try{if(st.canUseSessionStorage()){var e=Date.now(),t=st.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t&&h()){var n=m().parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,st.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(r){return this._logger.warnToConsole("Stop page visit timer failed: "+st.dump(r)),null}},Ln);function Ln(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var An=function Jn(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Mn=(Un.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming();if(t||n){if(t)var r=t.duration,i=pt.GetDuration(t.startTime,t.connectEnd),a=pt.GetDuration(t.requestStart,t.responseStart),o=pt.GetDuration(t.responseStart,t.responseEnd),s=pt.GetDuration(t.responseEnd,t.loadEventEnd);else r=pt.GetDuration(n.navigationStart,n.loadEventEnd),i=pt.GetDuration(n.navigationStart,n.connectEnd),a=pt.GetDuration(n.requestStart,n.responseStart),o=pt.GetDuration(n.responseStart,n.responseEnd),s=pt.GetDuration(n.responseEnd,n.loadEventEnd);0===r?this._logger.throwInternal(U.WARNING,X,"error calculating page view performance.",{total:r,network:i,request:a,response:o,dom:s}):this.shouldCollectDuration(r,i,a,o,s)?r<Math.floor(i)+Math.floor(a)+Math.floor(o)+Math.floor(s)?this._logger.throwInternal(U.WARNING,H,"client performance math error.",{total:r,network:i,request:a,response:o,dom:s}):(e.durationMs=r,e.perfTotal=e.duration=st.msToTimeSpan(r),e.networkConnect=st.msToTimeSpan(i),e.sentRequest=st.msToTimeSpan(a),e.receivedResponse=st.msToTimeSpan(o),e.domProcessing=st.msToTimeSpan(s),e.isValid=!0):this._logger.throwInternal(U.WARNING,oe,"Invalid page load duration value. Browser perf data won't be sent.",{total:r,network:i,request:a,response:o,dom:s})}},Un.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},Un.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?window.performance.getEntriesByType("navigation")[0]:null},Un.prototype.isPerformanceNavigationTimingSupported=function(){var e=y();return e&&e.performance&&e.performance.getEntriesByType&&0<e.performance.getEntriesByType("navigation").length},Un.prototype.isPerformanceTimingSupported=function(){var e=y();return void 0!==e&&e.performance&&e.performance.timing},Un.prototype.isPerformanceTimingDataReady=function(){var e=y(),t=e&&e.performance.timing;return e&&0<t.domainLookupStart&&0<t.navigationStart&&0<t.responseStart&&0<t.requestStart&&0<t.loadEventEnd&&0<t.responseEnd&&0<t.connectEnd&&0<t.domLoading},Un.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],r=(p()||{}).userAgent,i=!1;if(r)for(var a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(a=0;a<e.length;a++)if(e[a]>=this.MAX_DURATION_ALLOWED)return!1;return!0},Un);function Un(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Rn,On="duration",zn=(t(Vn,Rn=Ce),Vn.getDefaultConfig=function(e){return(e=e||{}).sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=st.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=st.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=st.stringToBoolOrDefault(e.overridePageViewDuration),e.enableUnhandledPromiseRejectionTracking=st.stringToBoolOrDefault(e.enableUnhandledPromiseRejectionTracking),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=st.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=st.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=st.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=st.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},Vn.prototype.processTelemetry=function(e,t){var n=!1,r=this._telemetryInitializers.length;t=this._getTelCtx(t);for(var i=0;i<r;++i){var a=this._telemetryInitializers[i];if(a)try{if(!1===a.apply(null,[e])){n=!0;break}}catch(o){t.diagLog().throwInternal(U.CRITICAL,de,"One of telemetry initializers failed, telemetry item will not be sent: "+st.getExceptionName(o),{exception:st.dump(o)},!0)}}n||this.processNext(e,t)},Vn.prototype.trackEvent=function(e,t){try{var n=bn.create(e,Et.dataType,Et.envelopeType,this.diagLog(),t);this.core.track(n)}catch(r){this.diagLog().throwInternal(U.WARNING,ae,"trackTrace failed, trace will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(t){this.diagLog().throwInternal(U.CRITICAL,Y,"startTrackEvent failed, event will not be collected: "+st.getExceptionName(t),{exception:st.dump(t)})}},Vn.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,undefined,t)}catch(r){this.diagLog().throwInternal(U.CRITICAL,$,"stopTrackEvent failed, event will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.trackTrace=function(e,t){try{var n=bn.create(e,hn.dataType,hn.envelopeType,this.diagLog(),t);this.core.track(n)}catch(r){this.diagLog().throwInternal(U.WARNING,ae,"trackTrace failed, trace will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.trackMetric=function(e,t){try{var n=bn.create(e,Jt.dataType,Jt.envelopeType,this.diagLog(),t);this.core.track(n)}catch(r){this.diagLog().throwInternal(U.CRITICAL,ne,"trackMetric failed, metric will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,c({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(r){this.diagLog().throwInternal(U.CRITICAL,re,"trackPageView failed, page view will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.sendPageViewInternal=function(e,t,n){var r=f();r&&(e.refUri=e.refUri===undefined?r.referrer:e.refUri);var i=bn.create(e,nn.dataType,nn.envelopeType,this.diagLog(),t,n);this.core.track(i),this._trackAjaxAttempts=0},Vn.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=bn.create(e,Sn.dataType,Sn.envelopeType,this.diagLog(),t,n);this.core.track(r)},Vn.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(n){this.diagLog().throwInternal(U.CRITICAL,re,"trackPageViewPerformance failed, page view will not be collected: "+st.getExceptionName(n),{exception:st.dump(n)})}},Vn.prototype.startTrackPage=function(e){try{var t=y();"string"!=typeof e&&(e=t&&t.document&&t.document.title||""),this._pageTracking.start(e)}catch(n){this.diagLog().throwInternal(U.CRITICAL,Z,"startTrackPage failed, page view may not be collected: "+st.getExceptionName(n),{exception:st.dump(n)})}},Vn.prototype.stopTrackPage=function(e,t,n,r){try{var i=y();"string"!=typeof e&&(e=i&&i.document&&i.document.title||""),"string"!=typeof t&&(t=i&&i.location&&i.location.href||""),this._pageTracking.stop(e,t,n,r),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(a){this.diagLog().throwInternal(U.CRITICAL,ee,"stopTrackPage failed, page view will not be collected: "+st.getExceptionName(a),{exception:st.dump(a)})}},Vn.prototype.sendExceptionInternal=function(e,t,n){var r=new At(this.diagLog(),e.exception||new Error(st.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),i=bn.create(r,At.dataType,At.envelopeType,this.diagLog(),t,n);this.core.track(i)},Vn.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(n){this.diagLog().throwInternal(U.CRITICAL,te,"trackException failed, exception will not be collected: "+st.getExceptionName(n),{exception:st.dump(n)})}},Vn.prototype._onerror=function(e){try{var t={url:e&&e.url||(f()||{}).URL,lineNumber:e.lineNumber,columnNumber:e.columnNumber,message:e.message};if(st.isCrossOriginError(e.message,e.url,e.lineNumber,e.columnNumber,e.error))this._sendCORSException(t.url);else{if(!st.isError(e.error)){var n="window.onerror@"+t.url+":"+e.lineNumber+":"+(e.columnNumber||0);e.error=new Error(e.message),e.error.stack=n}this.trackException({exception:e.error,severityLevel:_n.Error},t)}}catch(i){var r=e.error?e.error.name+", "+e.error.message:"null";this.diagLog().throwInternal(U.CRITICAL,K,"_onError threw exception while logging error, error will not be collected: "+st.getExceptionName(i),{exception:st.dump(i),errorString:r})}},Vn.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Vn.prototype.initialize=function(e,t,n,r){var o=this;if(!this.isInitialized()){if(A.isNullOrUndefined(t))throw Error("Error initializing");Rn.prototype.initialize.call(this,e,t,n,r),this.setInitialized(!1);var i=this._getTelCtx(),a=this.identifier;this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=i.getExtCfg(a);var s=Vn.getDefaultConfig();if(s!==undefined){for(var c in s)this.config[c]=i.getConfig(a,c,s[c]);if(this._globalconfig)for(var c in s)this._globalconfig[c]===undefined&&(this._globalconfig[c]=s[c])}this.config.isCookieUseDisabled&&st.disableCookies(),this.config.isStorageUseDisabled&&st.disableStorage();var l={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return o.config.accountId||e.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||e.appId}};this._pageViewPerformanceManager=new Mn(this.core),this._pageViewManager=new Pn(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new kn(this.diagLog(),function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(l),this._eventTracking=new Gn(this.diagLog(),"trackEvent"),this._eventTracking.action=function(e,t,n,r){(r=r||{})[On]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new Gn(this.diagLog(),"trackPageView"),this._pageTracking.action=function(e,t,n,r,i){A.isNullOrUndefined(r)&&(r={}),r[On]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)};var u,g,f=y(),p=I(),d=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented&&f){var h=f.onerror;f.onerror=function(e,t,n,r,i){var a=h&&h(e,t,n,r,i);return!0!==a&&d._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}if(!1===this.config.disableExceptionTracking&&!0===this.config.enableUnhandledPromiseRejectionTracking&&!this.config.autoUnhandledPromiseInstrumented&&f){var m=f.onunhandledrejection;f.onunhandledrejection=function(e){var t=m&&m.call(f,e);return!0!==t&&d._onerror({message:e.reason.toString(),error:e.reason instanceof Error?e.reason:new Error(e.reason.toString()),url:f.location.href,lineNumber:0,columnNumber:0}),t},this.config.autoUnhandledPromiseInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&p&&A.isFunction(p.pushState)&&A.isFunction(p.replaceState)&&f&&"undefined"!=typeof Event){var v=this;A.arrForEach(n,function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(o._properties=e)}),p.pushState=(g=p.pushState,function(){var e=g.apply(this,arguments);return f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"pushState")),f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"locationchange")),e}),p.replaceState=(u=p.replaceState,function(){var e=u.apply(this,arguments);return f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"replaceState")),f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"locationchange")),e}),f.addEventListener(v.config.namePrefix+"popstate",function(){f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"locationchange"))}),f.addEventListener(v.config.namePrefix+"locationchange",function(){v._properties&&v._properties.context&&v._properties.context.telemetryTrace&&(v._properties.context.telemetryTrace.traceID=st.generateW3CId(),v._properties.context.telemetryTrace.name=f.location&&f.location.pathname||"_unknown_"),o._currUri&&(o._prevUri=o._currUri),o._currUri=f.location&&f.location.href||"",setTimeout(function(e){v.trackPageView({refUri:e,properties:{duration:0}})}.bind(o,o._prevUri),v.autoRoutePVDelay)})}this.setInitialized(!0)}},Vn.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)},Vn.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===ln.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.target&&0<=t.target.indexOf(r[n]))return!1}return!0})}},Vn.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Vn.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:undefined},n=bn.create(t,At.dataType,At.envelopeType,this.diagLog(),{url:e});this.core.track(n)},Vn.Version="2.4.0-beta",Vn);function Vn(){var e=Rn.call(this)||this;e.identifier="ApplicationInsightsAnalytics",e.priority=180,e.autoRoutePVDelay=500,e._trackAjaxAttempts=0;var t=y();return e._prevUri=t&&t.location&&t.location.href||"",e}var Gn=(jn.prototype.start=function(e){"undefined"!=typeof this._events[e]&&this._logger.throwInternal(U.WARNING,fe,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},jn.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(U.WARNING,pe,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=pt.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=undefined},jn);function jn(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=zn,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map |
@@ -6,4 +6,4 @@ /** | ||
import * as tslib_1 from "tslib"; | ||
import { Util, PageViewPerformance, PageView, RemoteDependencyData, Event as EventTelemetry, TelemetryItemCreator, Metric, Exception, SeverityLevel, Trace, ConfigurationManager, DateTimeUtils, PropertiesPluginIdentifier } from "@microsoft/applicationinsights-common"; | ||
import { CoreUtils, LoggingSeverity, _InternalMessageId, } from "@microsoft/applicationinsights-core-js"; | ||
import { Util, PageViewPerformance, PageView, RemoteDependencyData, Event as EventTelemetry, TelemetryItemCreator, Metric, Exception, SeverityLevel, Trace, DateTimeUtils, PropertiesPluginIdentifier } from "@microsoft/applicationinsights-common"; | ||
import { BaseTelemetryPlugin, CoreUtils, LoggingSeverity, _InternalMessageId, getWindow, getDocument, getHistory } from "@microsoft/applicationinsights-core-js"; | ||
import { PageViewManager } from "./Telemetry/PageViewManager"; | ||
@@ -14,8 +14,9 @@ import { PageVisitTimeManager } from "./Telemetry/PageVisitTimeManager"; | ||
var durationProperty = "duration"; | ||
var ApplicationInsights = /** @class */ (function () { | ||
var ApplicationInsights = /** @class */ (function (_super) { | ||
tslib_1.__extends(ApplicationInsights, _super); | ||
function ApplicationInsights() { | ||
this.identifier = "ApplicationInsightsAnalytics"; // do not change name or priority | ||
this.priority = 180; // take from reserved priority range 100- 200 | ||
this.autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place | ||
this._isInitialized = false; | ||
var _this = _super.call(this) || this; | ||
_this.identifier = "ApplicationInsightsAnalytics"; // do not change name or priority | ||
_this.priority = 180; // take from reserved priority range 100- 200 | ||
_this.autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place | ||
// Counts number of trackAjax invokations. | ||
@@ -25,6 +26,6 @@ // By default we only monitor X ajax call per view to avoid too much load. | ||
// This counter keeps increasing even after the limit is reached. | ||
this._trackAjaxAttempts = 0; | ||
// array with max length of 2 that store current url and previous url for SPA page route change trackPageview use. | ||
this._prevUri = typeof window === "object" && window.location && window.location.href || ""; | ||
this.initialize = this._initialize.bind(this); | ||
_this._trackAjaxAttempts = 0; | ||
var _window = getWindow(); | ||
_this._prevUri = _window && _window.location && _window.location.href || ""; | ||
return _this; | ||
} | ||
@@ -41,2 +42,3 @@ ApplicationInsights.getDefaultConfig = function (config) { | ||
config.overridePageViewDuration = Util.stringToBoolOrDefault(config.overridePageViewDuration); | ||
config.enableUnhandledPromiseRejectionTracking = Util.stringToBoolOrDefault(config.enableUnhandledPromiseRejectionTracking); | ||
if (isNaN(config.samplingPercentage) || config.samplingPercentage <= 0 || config.samplingPercentage >= 100) { | ||
@@ -52,5 +54,6 @@ config.samplingPercentage = 100; | ||
}; | ||
ApplicationInsights.prototype.processTelemetry = function (env) { | ||
ApplicationInsights.prototype.processTelemetry = function (env, itemCtx) { | ||
var doNotSendItem = false; | ||
var telemetryInitializersCount = this._telemetryInitializers.length; | ||
itemCtx = this._getTelCtx(itemCtx); | ||
for (var i = 0; i < telemetryInitializersCount; ++i) { | ||
@@ -68,20 +71,17 @@ var telemetryInitializer = this._telemetryInitializers[i]; | ||
// doNotSendItem = true; | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + Util.getExceptionName(e), { exception: Util.dump(e) }, true); | ||
itemCtx.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + Util.getExceptionName(e), { exception: Util.dump(e) }, true); | ||
} | ||
} | ||
} | ||
if (!doNotSendItem && !CoreUtils.isNullOrUndefined(this._nextPlugin)) { | ||
this._nextPlugin.processTelemetry(env); | ||
if (!doNotSendItem) { | ||
this.processNext(env, itemCtx); | ||
} | ||
}; | ||
ApplicationInsights.prototype.setNextPlugin = function (next) { | ||
this._nextPlugin = next; | ||
}; | ||
ApplicationInsights.prototype.trackEvent = function (event, customProperties) { | ||
try { | ||
var telemetryItem = TelemetryItemCreator.create(event, EventTelemetry.dataType, EventTelemetry.envelopeType, this._logger, customProperties); | ||
var telemetryItem = TelemetryItemCreator.create(event, EventTelemetry.dataType, EventTelemetry.envelopeType, this.diagLog(), customProperties); | ||
this.core.track(telemetryItem); | ||
} | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -98,3 +98,3 @@ }; | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackEventFailed, "startTrackEvent failed, event will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackEventFailed, "startTrackEvent failed, event will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -113,3 +113,3 @@ }; | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackEventFailed, "stopTrackEvent failed, event will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackEventFailed, "stopTrackEvent failed, event will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -125,7 +125,7 @@ }; | ||
try { | ||
var telemetryItem = TelemetryItemCreator.create(trace, Trace.dataType, Trace.envelopeType, this._logger, customProperties); | ||
var telemetryItem = TelemetryItemCreator.create(trace, Trace.dataType, Trace.envelopeType, this.diagLog(), customProperties); | ||
this.core.track(telemetryItem); | ||
} | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.WARNING, _InternalMessageId.TrackTraceFailed, "trackTrace failed, trace will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -146,7 +146,7 @@ }; | ||
try { | ||
var telemetryItem = TelemetryItemCreator.create(metric, Metric.dataType, Metric.envelopeType, this._logger, customProperties); | ||
var telemetryItem = TelemetryItemCreator.create(metric, Metric.dataType, Metric.envelopeType, this.diagLog(), customProperties); | ||
this.core.track(telemetryItem); | ||
} | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackMetricFailed, "trackMetric failed, metric will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -169,3 +169,3 @@ }; | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, "trackPageView failed, page view will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -180,6 +180,7 @@ }; | ||
ApplicationInsights.prototype.sendPageViewInternal = function (pageView, properties, systemProperties) { | ||
if (typeof document !== "undefined") { | ||
pageView.refUri = pageView.refUri === undefined ? document.referrer : pageView.refUri; | ||
var _document = getDocument(); | ||
if (_document) { | ||
pageView.refUri = pageView.refUri === undefined ? _document.referrer : pageView.refUri; | ||
} | ||
var telemetryItem = TelemetryItemCreator.create(pageView, PageView.dataType, PageView.envelopeType, this._logger, properties, systemProperties); | ||
var telemetryItem = TelemetryItemCreator.create(pageView, PageView.dataType, PageView.envelopeType, this.diagLog(), properties, systemProperties); | ||
this.core.track(telemetryItem); | ||
@@ -195,3 +196,3 @@ // reset ajaxes counter | ||
ApplicationInsights.prototype.sendPageViewPerformanceInternal = function (pageViewPerformance, properties, systemProperties) { | ||
var telemetryItem = TelemetryItemCreator.create(pageViewPerformance, PageViewPerformance.dataType, PageViewPerformance.envelopeType, this._logger, properties, systemProperties); | ||
var telemetryItem = TelemetryItemCreator.create(pageViewPerformance, PageViewPerformance.dataType, PageViewPerformance.envelopeType, this.diagLog(), properties, systemProperties); | ||
this.core.track(telemetryItem); | ||
@@ -210,3 +211,3 @@ }; | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, "trackPageViewPerformance failed, page view will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackPVFailed, "trackPageViewPerformance failed, page view will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -222,4 +223,5 @@ }; | ||
try { | ||
var _window = getWindow(); | ||
if (typeof name !== "string") { | ||
name = typeof window === "object" && window.document && window.document.title || ""; | ||
name = _window && _window.document && _window.document.title || ""; | ||
} | ||
@@ -229,3 +231,3 @@ this._pageTracking.start(name); | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StartTrackFailed, "startTrackPage failed, page view may not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -243,7 +245,8 @@ }; | ||
try { | ||
var _window = getWindow(); | ||
if (typeof name !== "string") { | ||
name = typeof window === "object" && window.document && window.document.title || ""; | ||
name = _window && _window.document && _window.document.title || ""; | ||
} | ||
if (typeof url !== "string") { | ||
url = typeof window === "object" && window.location && window.location.href || ""; | ||
url = _window && _window.location && _window.location.href || ""; | ||
} | ||
@@ -256,3 +259,3 @@ this._pageTracking.stop(name, url, properties, measurement); | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.StopTrackFailed, "stopTrackPage failed, page view will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -267,4 +270,4 @@ }; | ||
ApplicationInsights.prototype.sendExceptionInternal = function (exception, customProperties, systemProperties) { | ||
var exceptionPartB = new Exception(this._logger, exception.exception || new Error(Util.NotSpecified), exception.properties, exception.measurements, exception.severityLevel, exception.id).toInterface(); | ||
var telemetryItem = TelemetryItemCreator.create(exceptionPartB, Exception.dataType, Exception.envelopeType, this._logger, customProperties, systemProperties); | ||
var exceptionPartB = new Exception(this.diagLog(), exception.exception || new Error(Util.NotSpecified), exception.properties, exception.measurements, exception.severityLevel, exception.id).toInterface(); | ||
var telemetryItem = TelemetryItemCreator.create(exceptionPartB, Exception.dataType, Exception.envelopeType, this.diagLog(), customProperties, systemProperties); | ||
this.core.track(telemetryItem); | ||
@@ -286,3 +289,3 @@ }; | ||
catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.TrackExceptionFailed, "trackException failed, exception will not be collected: " + Util.getExceptionName(e), { exception: Util.dump(e) }); | ||
} | ||
@@ -298,3 +301,3 @@ }; | ||
var properties_1 = { | ||
url: (exception && exception.url) || document.URL, | ||
url: (exception && exception.url) || (getDocument() || {}).URL, | ||
lineNumber: exception.lineNumber, | ||
@@ -320,3 +323,3 @@ columnNumber: exception.columnNumber, | ||
: "null"; | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.ExceptionWhileLoggingError, "_onError threw exception while logging error, error will not be collected: " | ||
+ Util.getExceptionName(e), { exception: Util.dump(e), errorString: errorString }); | ||
@@ -328,5 +331,5 @@ } | ||
}; | ||
ApplicationInsights.prototype._initialize = function (config, core, extensions) { | ||
ApplicationInsights.prototype.initialize = function (config, core, extensions, pluginChain) { | ||
var _this = this; | ||
if (this._isInitialized) { | ||
if (this.isInitialized()) { | ||
return; | ||
@@ -337,4 +340,6 @@ } | ||
} | ||
this.core = core; | ||
this._logger = core.logger; | ||
_super.prototype.initialize.call(this, config, core, extensions, pluginChain); | ||
this.setInitialized(false); // resetting the initialized state, just in case the following fails | ||
var ctx = this._getTelCtx(); | ||
var identifier = this.identifier; | ||
this._globalconfig = { | ||
@@ -344,3 +349,3 @@ instrumentationKey: config.instrumentationKey, | ||
}; | ||
this.config = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {}; | ||
this.config = ctx.getExtCfg(identifier); | ||
// load default values if specified | ||
@@ -351,3 +356,3 @@ var defaults = ApplicationInsights.getDefaultConfig(); | ||
// for each unspecified field, set the default value | ||
this.config[field] = ConfigurationManager.getConfig(config, field, this.identifier, defaults[field]); | ||
this.config[field] = ctx.getConfig(identifier, field, defaults[field]); | ||
} | ||
@@ -383,6 +388,6 @@ if (this._globalconfig) { | ||
this._pageViewManager = new PageViewManager(this, this.config.overridePageViewDuration, this.core, this._pageViewPerformanceManager); | ||
this._pageVisitTimeManager = new PageVisitTimeManager(this._logger, function (pageName, pageUrl, pageVisitTime) { return _this.trackPageVisitTime(pageName, pageUrl, pageVisitTime); }); | ||
this._pageVisitTimeManager = new PageVisitTimeManager(this.diagLog(), function (pageName, pageUrl, pageVisitTime) { return _this.trackPageVisitTime(pageName, pageUrl, pageVisitTime); }); | ||
this._telemetryInitializers = []; | ||
this._addDefaultTelemetryInitializers(configGetters); | ||
this._eventTracking = new Timing(this._logger, "trackEvent"); | ||
this._eventTracking = new Timing(this.diagLog(), "trackEvent"); | ||
this._eventTracking.action = | ||
@@ -397,3 +402,3 @@ function (name, url, duration, properties) { | ||
// initialize page view timing | ||
this._pageTracking = new Timing(this._logger, "trackPageView"); | ||
this._pageTracking = new Timing(this.diagLog(), "trackPageView"); | ||
this._pageTracking.action = function (name, url, duration, properties, measurements) { | ||
@@ -413,9 +418,11 @@ // duration must be a custom property in order for the collector to extract it | ||
}; | ||
var _window = getWindow(); | ||
var _history = getHistory(); | ||
var instance = this; | ||
if (this.config.disableExceptionTracking === false && | ||
!this.config.autoExceptionInstrumented && typeof window === "object") { | ||
!this.config.autoExceptionInstrumented && _window) { | ||
// We want to enable exception auto collection and it has not been done so yet | ||
var onerror_1 = "onerror"; | ||
var originalOnError_1 = window[onerror_1]; | ||
window.onerror = function (message, url, lineNumber, columnNumber, error) { | ||
var originalOnError_1 = _window[onerror_1]; | ||
_window.onerror = function (message, url, lineNumber, columnNumber, error) { | ||
var handled = originalOnError_1 && originalOnError_1(message, url, lineNumber, columnNumber, error); | ||
@@ -435,2 +442,23 @@ if (handled !== true) { | ||
} | ||
if (this.config.disableExceptionTracking === false && | ||
this.config.enableUnhandledPromiseRejectionTracking === true && | ||
!this.config.autoUnhandledPromiseInstrumented && _window) { | ||
// We want to enable exception auto collection and it has not been done so yet | ||
var onunhandledrejection = "onunhandledrejection"; | ||
var originalOnUnhandledRejection_1 = _window[onunhandledrejection]; | ||
_window.onunhandledrejection = function (error) { | ||
var handled = originalOnUnhandledRejection_1 && originalOnUnhandledRejection_1.call(_window, error); | ||
if (handled !== true) { | ||
instance._onerror({ | ||
message: error.reason.toString(), | ||
error: error.reason instanceof Error ? error.reason : new Error(error.reason.toString()), | ||
url: _window.location.href, | ||
lineNumber: 0, | ||
columnNumber: 0 | ||
}); | ||
} | ||
return handled; | ||
}; | ||
this.config.autoUnhandledPromiseInstrumented = true; | ||
} | ||
/** | ||
@@ -440,4 +468,4 @@ * Create a custom "locationchange" event which is triggered each time the history object is changed | ||
if (this.config.enableAutoRouteTracking === true | ||
&& typeof history === "object" && typeof history.pushState === "function" && typeof history.replaceState === "function" | ||
&& typeof window === "object" | ||
&& _history && CoreUtils.isFunction(_history.pushState) && CoreUtils.isFunction(_history.replaceState) | ||
&& _window | ||
&& typeof Event !== "undefined") { | ||
@@ -451,28 +479,28 @@ var _self_1 = this; | ||
}); | ||
history.pushState = (function (f) { return function pushState() { | ||
_history.pushState = (function (f) { return function pushState() { | ||
var ret = f.apply(this, arguments); | ||
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "pushState")); | ||
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange")); | ||
_window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "pushState")); | ||
_window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange")); | ||
return ret; | ||
}; })(history.pushState); | ||
history.replaceState = (function (f) { return function replaceState() { | ||
}; })(_history.pushState); | ||
_history.replaceState = (function (f) { return function replaceState() { | ||
var ret = f.apply(this, arguments); | ||
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "replaceState")); | ||
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange")); | ||
_window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "replaceState")); | ||
_window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange")); | ||
return ret; | ||
}; })(history.replaceState); | ||
window.addEventListener(_self_1.config.namePrefix + "popstate", function () { | ||
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange")); | ||
}; })(_history.replaceState); | ||
_window.addEventListener(_self_1.config.namePrefix + "popstate", function () { | ||
_window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange")); | ||
}); | ||
window.addEventListener(_self_1.config.namePrefix + "locationchange", function () { | ||
_window.addEventListener(_self_1.config.namePrefix + "locationchange", function () { | ||
if (_self_1._properties && _self_1._properties.context && _self_1._properties.context.telemetryTrace) { | ||
_self_1._properties.context.telemetryTrace.traceID = Util.generateW3CId(); | ||
_self_1._properties.context.telemetryTrace.name = window.location && window.location.pathname || "_unknown_"; | ||
_self_1._properties.context.telemetryTrace.name = _window.location && _window.location.pathname || "_unknown_"; | ||
} | ||
if (_this._currUri) { | ||
_this._prevUri = _this._currUri; | ||
_this._currUri = window.location && window.location.href || ""; | ||
_this._currUri = _window.location && _window.location.href || ""; | ||
} | ||
else { | ||
_this._currUri = window.location && window.location.href || ""; | ||
_this._currUri = _window.location && _window.location.href || ""; | ||
} | ||
@@ -485,3 +513,3 @@ setTimeout((function (uri) { | ||
} | ||
this._isInitialized = true; | ||
this.setInitialized(true); | ||
}; | ||
@@ -533,8 +561,8 @@ /** | ||
}; | ||
var telemetryItem = TelemetryItemCreator.create(exception, Exception.dataType, Exception.envelopeType, this._logger, { url: url }); | ||
var telemetryItem = TelemetryItemCreator.create(exception, Exception.dataType, Exception.envelopeType, this.diagLog(), { url: url }); | ||
this.core.track(telemetryItem); | ||
}; | ||
ApplicationInsights.Version = "2.3.1"; // Not currently used anywhere | ||
ApplicationInsights.Version = "2.4.0-beta"; // Not currently used anywhere | ||
return ApplicationInsights; | ||
}()); | ||
}(BaseTelemetryPlugin)); | ||
export { ApplicationInsights }; | ||
@@ -541,0 +569,0 @@ /** |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { DateTimeUtils, Util } from '@microsoft/applicationinsights-common'; | ||
import { CoreUtils, LoggingSeverity, _InternalMessageId } from '@microsoft/applicationinsights-core-js'; | ||
import { CoreUtils, LoggingSeverity, _InternalMessageId, getWindow } from '@microsoft/applicationinsights-core-js'; | ||
/** | ||
@@ -32,9 +32,10 @@ * Class encapsulates sending page views and page view performance telemetry. | ||
var _this = this; | ||
var _window = getWindow(); | ||
var name = pageView.name; | ||
if (CoreUtils.isNullOrUndefined(name) || typeof name !== "string") { | ||
name = pageView.name = typeof window === "object" && window.document && window.document.title || ""; | ||
name = pageView.name = _window && _window.document && _window.document.title || ""; | ||
} | ||
var uri = pageView.uri; | ||
if (CoreUtils.isNullOrUndefined(uri) || typeof uri !== "string") { | ||
uri = pageView.uri = typeof window === "object" && window.location && window.location.href || ""; | ||
uri = pageView.uri = _window && _window.location && _window.location.href || ""; | ||
} | ||
@@ -41,0 +42,0 @@ // case 1a. if performance timing is not supported by the browser, send the page view telemetry with the duration provided by the user. If the user |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { Util, DateTimeUtils } from '@microsoft/applicationinsights-common'; | ||
import { LoggingSeverity, _InternalMessageId } from '@microsoft/applicationinsights-core-js'; | ||
import { LoggingSeverity, _InternalMessageId, getNavigator, getWindow } from '@microsoft/applicationinsights-core-js'; | ||
/** | ||
@@ -85,3 +85,4 @@ * Class encapsulates sending page view performance telemetry. | ||
PageViewPerformanceManager.prototype.isPerformanceNavigationTimingSupported = function () { | ||
return typeof window !== "undefined" && window.performance && window.performance.getEntriesByType && window.performance.getEntriesByType("navigation").length > 0; | ||
var _window = getWindow(); | ||
return _window && _window.performance && _window.performance.getEntriesByType && _window.performance.getEntriesByType("navigation").length > 0; | ||
}; | ||
@@ -92,3 +93,4 @@ /** | ||
PageViewPerformanceManager.prototype.isPerformanceTimingSupported = function () { | ||
return typeof window !== "undefined" && window.performance && window.performance.timing; | ||
var _window = getWindow(); | ||
return typeof _window !== "undefined" && _window.performance && _window.performance.timing; | ||
}; | ||
@@ -100,4 +102,5 @@ /** | ||
PageViewPerformanceManager.prototype.isPerformanceTimingDataReady = function () { | ||
var timing = typeof window === "object" && window.performance.timing; | ||
return typeof window === "object" | ||
var _window = getWindow(); | ||
var timing = _window && _window.performance.timing; | ||
return _window | ||
&& timing.domainLookupStart > 0 | ||
@@ -120,5 +123,6 @@ && timing.navigationStart > 0 | ||
} | ||
var _navigator = getNavigator() || {}; | ||
// a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en | ||
var botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; | ||
var userAgent = navigator.userAgent; | ||
var userAgent = _navigator.userAgent; | ||
var isGoogleBot = false; | ||
@@ -125,0 +129,0 @@ if (userAgent) { |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { Util } from '@microsoft/applicationinsights-common'; | ||
import { hasJSON, getJSON } from '@microsoft/applicationinsights-core-js'; | ||
/** | ||
@@ -64,3 +65,3 @@ * Used to track page visit durations | ||
var currPageVisitData = new PageVisitData(pageName, pageUrl); | ||
var currPageVisitDataStr = JSON.stringify(currPageVisitData); | ||
var currPageVisitDataStr = getJSON().stringify(currPageVisitData); | ||
Util.setSessionStorage(this._logger, this.prevPageVisitDataKeyName, currPageVisitDataStr); | ||
@@ -85,5 +86,5 @@ } | ||
var pageVisitDataJsonStr = Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName); | ||
if (pageVisitDataJsonStr) { | ||
if (pageVisitDataJsonStr && hasJSON()) { | ||
// if previous page data exists, set end time of visit | ||
var prevPageVisitData = JSON.parse(pageVisitDataJsonStr); | ||
var prevPageVisitData = getJSON().parse(pageVisitDataJsonStr); | ||
prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime; | ||
@@ -90,0 +91,0 @@ // Remove data from storage since we already used it |
/*! | ||
* Application Insights JavaScript SDK - Web Analytics, 2.3.1 | ||
* Application Insights JavaScript SDK - Web Analytics, 2.4.0-beta | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o,n,d,r,a,s,c=function(){return(c=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};(n=o=o||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(r=d=d||{})[r.Default=0]="Default",r[r.Required=1]="Required",r[r.Array=2]="Array",r[r.Hidden=4]="Hidden",(s=a=a||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var l=2,u="prototype",f=(g.isNullOrUndefined=function(e){return null===e||e===undefined},g.isDate=function(e){return"[object Date]"===Object[u].toString.call(e)},g.disableCookies=function(){g._canUseCookies=!1},g.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(p,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},g.toISOString=function(e){if(g.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},g.arrForEach=function(e,t,n){for(var i=e.length,r=0;r<i;++r)r in e&&t.call(n||e,e[r],r,e)},g.arrIndexOf=function(e,t,n){for(var i=e.length,r=n||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===t)return o;return-1},g.arrMap=function(e,t,n){for(var i=e.length,r=n||e,o=new Array(i),a=0;a<i;a++)a in e&&(o[a]=t.call(r,e[a],e));return o},g.arrReduce=function(e,t,n){var i,r=e.length,o=0;if(3<=arguments.length)i=n;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=t(i,e[o],o,e)),o++;return i},g.objCreate=function(e){if(null==e)return{};var t=typeof e;if("object"!=t&&"function"!=t)throw new TypeError("Object prototype may only be an Object: "+e);function n(){}return n[u]=e,new n},g.objKeys=function(e){var t=Object[u].hasOwnProperty,n=!{toString:null}.propertyIsEnumerable("toString"),i=typeof e;if("function"!=i&&("object"!=i||null===e))throw new TypeError("objKeys called on non-object");var r=[];for(var o in e)t.call(e,o)&&r.push(o);if(n)for(var a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],s=a.length,c=0;c<s;c++)t.call(e,a[c])&&r.push(a[c]);return r},g.objDefineAccessors=function(e,t,n,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return n&&(o.get=n),i&&(o.set=i),r(e,t,o),!0}catch(a){}return!1},g);function g(){}var p=/[xy]/g,h=(m.prototype.processTelemetry=function(t){f.arrForEach(this.channelQueue,function(e){0<e.length&&e[0].processTelemetry(t)})},m.prototype.getChannelControls=function(){return this.channelQueue},m.prototype.initialize=function(n,i,r){var o,a=this;n.isCookieUseDisabled&&f.disableCookies(),this.channelQueue=new Array,n.channels&&f.arrForEach(n.channels,function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(f.arrForEach(e,function(e){e.priority<500&&(o=e.identifier),e.initialize(n,i,r)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}});for(var e=new Array,t=0;t<r.length;t++){var s=r[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);f.arrForEach(e,function(e){return e.initialize(n,i,r)}),this.channelQueue.push(e)}},m._staticInit=void f.objDefineAccessors(m.prototype,"ChannelControls",m.prototype.getChannelControls),m);function m(){this.identifier="ChannelControllerPlugin",this.priority=500}var v=(y.prototype.initialize=function(e,t,n,i){var r=this;if(this._isInitialized)throw Error("Core should not be initialized more than once");if(!e||f.isNullOrUndefined(e.instrumentationKey))throw Error("Please provide instrumentation key");this.config=e,this._notificationManager=i,this._notificationManager||(this._notificationManager=f.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}})),this.config.extensions=f.isNullOrUndefined(this.config.extensions)?[]:this.config.extensions,this.config.extensionConfig=f.isNullOrUndefined(this.config.extensionConfig)?{}:this.config.extensionConfig,this._notificationManager&&(this.config.extensionConfig.NotificationManager=this._notificationManager),this.logger=n,this.logger||(this.logger=f.objCreate({throwInternal:function(e,t,n,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}})),(a=this._extensions).push.apply(a,t.concat(this.config.extensions)),f.arrForEach(this._extensions,function(e){var t=!0;if((f.isNullOrUndefined(e)||f.isNullOrUndefined(e.initialize))&&(t=!1),!t)throw Error("Extensions must provide callback to initialize")}),this._extensions.push(this._channelController),this._extensions=this._extensions.sort(function(e,t){var n=e,i=t,r=typeof n.processTelemetry,o=typeof i.processTelemetry;return"function"==r&&"function"==o?n.priority-i.priority:"function"==r&&"function"!=o?1:"function"!=r&&"function"==o?-1:void 0});var o={};f.arrForEach(this._extensions,function(e){var t=e;t&&t.priority&&(f.isNullOrUndefined(o[t.priority])?o[t.priority]=t.identifier:r.logger&&r.logger.warnToConsole("Two extensions have same priority"+o[t.priority]+", "+t.identifier))});for(var a,s=-1,c=0;c<this._extensions.length-1;c++){var l=this._extensions[c];if(!l||"function"==typeof l.processTelemetry){if(l.priority===this._channelController.priority){s=c+1;break}this._extensions[c].setNextPlugin(this._extensions[c+1])}}if(this._channelController.initialize(this.config,this,this._extensions),f.arrForEach(this._extensions,function(e){e&&e.priority<r._channelController.priority&&e.initialize(r.config,r,r._extensions)}),s<this._extensions.length&&this._extensions.splice(s),0===this.getTransmissionControls().length)throw new Error("No channels available");this._isInitialized=!0},y.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},y.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=f.toISOString(new Date)),f.isNullOrUndefined(e.ver)&&(e.ver="4.0"),0===this._extensions.length&&this._channelController.processTelemetry(e);for(var t=0;t<this._extensions.length;){if(this._extensions[t].processTelemetry){this._extensions[t].processTelemetry(e);break}t++}},y);function y(){this._isInitialized=!1,this._extensions=new Array,this._channelController=new h}var w,_,I=(S.prototype.addNotificationListener=function(e){this.listeners.push(e)},S.prototype.removeNotificationListener=function(e){for(var t=f.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=f.arrIndexOf(this.listeners,e)},S.prototype.eventsSent=function(t){for(var n=this,e=function(e){i.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},i=this,r=0;r<this.listeners.length;++r)e(r)},S.prototype.eventsDiscarded=function(t,n){for(var i=this,e=function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(t,n)},0)},r=this,o=0;o<this.listeners.length;++o)e(o)},S);function S(){this.listeners=[]}(_=w=w||{})[_.CRITICAL=1]="CRITICAL",_[_.WARNING=2]="WARNING";var T=1,N=2,E=3,x=4,b=5,D=6,k=8,C=10,P=11,A=23,M=25,L=29,U=30,O=31,R=32,z=35,V=36,G=37,j=38,q=39,B=45,F=49,W=52,H=56,X=57,K=61,J=62,Q=63,Y=64,$=66,Z=68,ee=69,te=(ne.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},ne.dataType="MessageData",ne.AiNonUserActionablePrefix="AI (Internal): ",ne.AiUserActionablePrefix="AI: ",ne);function ne(e,t,n,i){void 0===n&&(n=!1),this.messageId=e,this.message=(n?ne.AiUserActionablePrefix:ne.AiNonUserActionablePrefix)+e;var r=(t?" message:"+ne.sanitizeDiagnosticText(t):"")+(i?" props:"+ne.sanitizeDiagnosticText(JSON.stringify(i)):"");this.message+=r}var ie=(re.prototype.throwInternal=function(e,t,n,i,r){void 0===r&&(r=!1);var o=new te(t,n,r,i);if(this.enableDebugExceptions())throw o;if(void 0!==o&&o&&"undefined"!=typeof o.message){if(r){var a=+o.messageId;(!this._messageLogged[a]||this.consoleLoggingLevel()>=w.WARNING)&&(this.warnToConsole(o.message),this._messageLogged[a]=!0)}else this.consoleLoggingLevel()>=w.WARNING&&this.warnToConsole(o.message);this.logInternalMessage(e,o)}},re.prototype.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},re.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},re.prototype.logInternalMessage=function(e,t){if(!this._areInternalMessagesThrottled()){var n=!0,i=this.AIInternalMessagePrefix+t.messageId;if(this._messageLogged[i]?n=!1:this._messageLogged[i]=!0,n&&(e<=this.telemetryLoggingLevel()&&(this.queue.push(t),this._messageCount++),this._messageCount===this.maxInternalMessageLimit())){var r="Internal events throttle limit per PageView reached for this app.",o=new te(A,r,!1);this.queue.push(o),this.warnToConsole(r)}}},re.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},re);function re(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},f.isNullOrUndefined(e)||(f.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),f.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),f.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),f.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var oe;t(ae,oe=v),ae.prototype.initialize=function(e,t){this._notificationManager=new I,this.logger=new ie(e),this.config=e,oe.prototype.initialize.call(this,e,t,this.logger,this._notificationManager)},ae.prototype.getTransmissionControls=function(){return oe.prototype.getTransmissionControls.call(this)},ae.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),oe.prototype.track.call(this,e)},ae.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},ae.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},ae.prototype.pollInternalLogs=function(n){var i=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var e=i.logger?i.logger.queue:[];f.arrForEach(e,function(e){var t={name:n||"InternalMessageId: "+e.messageId,iKey:i.config.instrumentationKey,time:f.toISOString(new Date),baseType:te.dataType,baseData:{message:e.message}};i.track(t)}),e.length=0},e)},ae.prototype._validateTelemetryItem=function(e){if(f.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},ae.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],l)};function ae(){return oe.call(this)||this}var se=(ce.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=ce.sanitizeKey(e,t);if(r.length!==i){for(var o=0,a=r;n[a]!==undefined;)o++,a=r.substring(0,ce.MAX_NAME_LENGTH-3)+ce.padNumber(o);r=a}return r},ce.sanitizeKey=function(e,t){var n;return t&&(t=ce.trim(t.toString())).length>ce.MAX_NAME_LENGTH&&(n=t.substring(0,ce.MAX_NAME_LENGTH),e.throwInternal(w.WARNING,X,"name is too long. It has been truncated to "+ce.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},ce.sanitizeString=function(e,t,n){var i;return void 0===n&&(n=ce.MAX_STRING_LENGTH),t&&(n=n||ce.MAX_STRING_LENGTH,(t=ce.trim(t)).toString().length>n&&(i=t.toString().substring(0,n),e.throwInternal(w.WARNING,K,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),i||t},ce.sanitizeUrl=function(e,t){return ce.sanitizeInput(e,t,ce.MAX_URL_LENGTH,$)},ce.sanitizeMessage=function(e,t){var n;return t&&t.length>ce.MAX_MESSAGE_LENGTH&&(n=t.substring(0,ce.MAX_MESSAGE_LENGTH),e.throwInternal(w.WARNING,H,"message is too long, it has been truncated to "+ce.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},ce.sanitizeException=function(e,t){var n;return t&&t.length>ce.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,ce.MAX_EXCEPTION_LENGTH),e.throwInternal(w.WARNING,W,"exception is too long, it has been truncated to "+ce.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},ce.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=t[i];if("object"==typeof r&&"undefined"!=typeof JSON)try{r=JSON.stringify(r)}catch(o){e.throwInternal(w.WARNING,F,"custom property is not valid",{exception:o},!0)}r=ce.sanitizeString(e,r,ce.MAX_PROPERTY_LENGTH),n[i=ce.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},ce.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=ce.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},ce.sanitizeId=function(e,t){return t?ce.sanitizeInput(e,t,ce.MAX_ID_LENGTH,ee).toString():t},ce.sanitizeInput=function(e,t,n,i){var r;return t&&(t=ce.trim(t)).length>n&&(r=t.substring(0,n),e.throwInternal(w.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),r||t},ce.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},ce.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ce.MAX_NAME_LENGTH=150,ce.MAX_ID_LENGTH=128,ce.MAX_PROPERTY_LENGTH=8192,ce.MAX_STRING_LENGTH=1024,ce.MAX_URL_LENGTH=2048,ce.MAX_MESSAGE_LENGTH=32768,ce.MAX_EXCEPTION_LENGTH=32768,ce);function ce(){}var le="prototype",ue=(ge.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},ge.disableStorage=function(){ge._canUseLocalStorage=!1,ge._canUseSessionStorage=!1},ge._getLocalStorageObject=function(){return ge.canUseLocalStorage()?ge._getVerifiedStorageObject(o.LocalStorage):null},ge._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===o.LocalStorage?window.localStorage:window.sessionStorage).setItem(n.toString(),n.toString()),t=i.getItem(n.toString())!==n.toString(),i.removeItem(n.toString()),t&&(i=null)}catch(r){i=null}return i},ge.isInternalApplicationInsightsEndpoint=function(e){return-1!==ge._internalEndpoints.indexOf(e.toLowerCase())},ge.canUseLocalStorage=function(){return ge._canUseLocalStorage===undefined&&(ge._canUseLocalStorage=!!ge._getVerifiedStorageObject(o.LocalStorage)),ge._canUseLocalStorage},ge.getStorage=function(e,t){var n=ge._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(i){ge._canUseLocalStorage=!1,e.throwInternal(w.WARNING,T,"Browser failed read of local storage. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return null},ge.setStorage=function(e,t,n){var i=ge._getLocalStorageObject();if(null!==i)try{return i.setItem(t,n),!0}catch(r){ge._canUseLocalStorage=!1,e.throwInternal(w.WARNING,E,"Browser failed write to local storage. "+ge.getExceptionName(r),{exception:ge.dump(r)})}return!1},ge.removeStorage=function(e,t){var n=ge._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(i){ge._canUseLocalStorage=!1,e.throwInternal(w.WARNING,b,"Browser failed removal of local storage item. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return!1},ge._getSessionStorageObject=function(){return ge.canUseSessionStorage()?ge._getVerifiedStorageObject(o.SessionStorage):null},ge.canUseSessionStorage=function(){return ge._canUseSessionStorage===undefined&&(ge._canUseSessionStorage=!!ge._getVerifiedStorageObject(o.SessionStorage)),ge._canUseSessionStorage},ge.getSessionStorageKeys=function(){var e=[];if(ge.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},ge.getSessionStorage=function(e,t){var n=ge._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(i){ge._canUseSessionStorage=!1,e.throwInternal(w.WARNING,N,"Browser failed read of session storage. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return null},ge.setSessionStorage=function(e,t,n){var i=ge._getSessionStorageObject();if(null!==i)try{return i.setItem(t,n),!0}catch(r){ge._canUseSessionStorage=!1,e.throwInternal(w.WARNING,x,"Browser failed write to session storage. "+ge.getExceptionName(r),{exception:ge.dump(r)})}return!1},ge.removeSessionStorage=function(e,t){var n=ge._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(i){ge._canUseSessionStorage=!1,e.throwInternal(w.WARNING,D,"Browser failed removal of session storage item. "+ge.getExceptionName(i),{exception:ge.dump(i)})}return!1},ge.disableCookies=function(){f.disableCookies()},ge.canUseCookies=function(e){if(f._canUseCookies===undefined){f._canUseCookies=!1;try{f._canUseCookies=ge.document.cookie!==undefined}catch(t){e.throwInternal(w.WARNING,Z,"Cannot access document.cookie - "+ge.getExceptionName(t),{exception:ge.dump(t)})}}return f._canUseCookies},ge.setCookie=function(e,t,n,i){n+=";SameSite=None";var r="",o="";i&&(r=";domain="+i),ge.document.location&&"https:"===ge.document.location.protocol&&(o=";secure"),ge.canUseCookies(e)&&(ge.document.cookie=t+"="+n+r+";path=/"+o)},ge.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},ge.getCookie=function(e,t){if(ge.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=ge.document.cookie.split(";"),o=0;o<r.length;o++){var a=r[o];if((a=ge.trim(a))&&0===a.indexOf(i)){n=a.substring(i.length,r[o].length);break}}return n}},ge.deleteCookie=function(e,t){ge.canUseCookies(e)&&(ge.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},ge.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ge.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},ge.random32=function(){return 4294967296*Math.random()|0},ge.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",i=0;i<4;i++)n+=t[15&(e=ge.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var r=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+r+n.substr(16,3)+n.substr(19,12)},ge.isArray=function(e){return"[object Array]"===Object[le].toString.call(e)},ge.isError=function(e){return"[object Error]"===Object[le].toString.call(e)},ge.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},ge.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,o=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<o?o+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},ge.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},ge.dump=function(e){var t=Object[le].toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},ge.getExceptionName=function(e){return"[object Error]"===Object[le].toString.call(e)?e.name:""},ge.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},ge.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},ge.getExtension=function(e,t){for(var n=null,i=0;!n&&i<e.length;)e[i]&&e[i].identifier===t&&(n=e[i]),i++;return n},ge.document="undefined"!=typeof document?document:{},ge._canUseLocalStorage=undefined,ge._canUseSessionStorage=undefined,ge._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],ge.NotSpecified="not_specified",ge.isDate=f.isDate,ge.toISOStringForIE8=f.toISOString,ge);function ge(){}var fe=(pe.parseUrl=function(e){return pe.htmlAnchorElement||(pe.htmlAnchorElement=pe.document.createElement?pe.document.createElement("a"):{host:pe.parseHost(e)}),pe.htmlAnchorElement.href=e,pe.htmlAnchorElement},pe.getAbsoluteUrl=function(e){var t,n=pe.parseUrl(e);return n&&(t=n.href),t},pe.getPathName=function(e){var t,n=pe.parseUrl(e);return n&&(t=n.pathname),t},pe.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},pe.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},pe.document="undefined"!=typeof document?document:{},pe);function pe(){}var de=(he.ParseDependencyPath=function(e,t,n,i){var r,o=i,a=i;if(t&&0<t.length){var s=fe.parseUrl(t);if(r=s.host,!o)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),a=s.pathname,o=se.sanitizeString(e,n?n+" "+c:c)}else o=se.sanitizeString(e,t)}else o=r=i;return{target:r,name:o,data:a}},he);function he(){}var me=(ve.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},ve.GetDuration=function(e,t){var n=null;return 0===e||0===t||f.isNullOrUndefined(e)||f.isNullOrUndefined(t)||(n=t-e),n},ve);function ve(){}var ye,we=(t(_e,ye=function Wt(){}),_e);function _e(){return ye.call(this)||this}var Ie;t(Se,Ie=function Ht(){this.ver=1,this.sampleRate=100,this.tags={}});function Se(e,t,n){var i=Ie.call(this)||this;return i.name=se.sanitizeString(e,n)||ue.NotSpecified,i.data=t,i.time=f.toISOString(new Date),i.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100===i.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},i}var Te,Ne=function Xt(){},Ee=(t(xe,Te=Ne),xe);function xe(){var e=Te.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var be,De=(t(ke,be=Ee),ke.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ke.dataType="EventData",ke);function ke(e,t,n,i){var r=be.call(this)||this;return r.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},r.name=se.sanitizeString(e,t)||ue.NotSpecified,r.properties=se.sanitizeProperties(e,n),r.measurements=se.sanitizeMeasurements(e,i),r}var Ce,Pe=function Kt(){},Ae=(t(Me,Ce=Ne),Me);function Me(){var e=Ce.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var Le,Ue=function Jt(){this.hasFullStack=!0,this.parsedStack=[]},Oe=(t(Re,Le=Ae),Re.CreateFromInterface=function(t,e){var n=e.exceptions&&f.arrMap(e.exceptions,function(e){return Ve.CreateFromInterface(t,e)});return new Re(t,c({},e,{exceptions:n}))},Re.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,i=e.measurements,r=e.severityLevel,o=(e.ver,e.problemGroup),a=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&f.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:r,properties:n,measurements:i,problemGroup:o,id:a,isManual:s}},Re.CreateSimpleException=function(e,t,n,i,r,o){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},Re.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Re.dataType="ExceptionData",Re);function Re(e,t,n,i,r,o){var a=Le.call(this)||this;return a.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},t instanceof Error?(a.exceptions=[new Ve(e,t)],a.properties=se.sanitizeProperties(e,n),a.measurements=se.sanitizeMeasurements(e,i),r&&(a.severityLevel=r),o&&(a.id=o)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel),t.id&&(a.id=t.id),t.problemGroup&&(a.problemGroup=t.problemGroup),a.ver=2,f.isNullOrUndefined(t.isManual)||(a.isManual=t.isManual)),a}var ze,Ve=(t(Ge,ze=Ue),Ge.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&f.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},Ge.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&f.arrMap(t.parsedStack,function(e){return qe.CreateFromInterface(e)})||t.parsedStack;return new Ge(e,c({},t,{parsedStack:n}))},Ge.parseStack=function(e){var t;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,o=0;o<=n.length;o++){var a=n[o];if(qe.regex.test(a)){var s=new qe(n[o],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var c=0,l=t.length-1,u=0,g=c,f=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=l,c++,l--}}return t},Ge);function Ge(e,t){var n=ze.call(this)||this;if(n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},t instanceof Error){n.typeName=se.sanitizeString(e,t.name)||ue.NotSpecified,n.message=se.sanitizeMessage(e,t.message)||ue.NotSpecified;var i=t.stack;n.parsedStack=Ge.parseStack(i),n.stack=se.sanitizeException(e,i),n.hasFullStack=ue.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var je,qe=(t(Be,je=Pe),Be.CreateFromInterface=function(e){return new Be(e,null)},Be.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Be.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Be.baseSize=58,Be);function Be(e,t){var n=je.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},"string"==typeof e){var i=e;n.level=t,n.method="<no_method>",n.assembly=ue.trim(i),n.fileName="",n.line=0;var r=i.match(Be.regex);r&&5<=r.length&&(n.method=ue.trim(r[2])||n.method,n.fileName=ue.trim(r[4]),n.line=parseInt(r[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Be.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Fe,We,He,Xe=(t(Ke,Fe=Ne),Ke);function Ke(){var e=Fe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(He=We=We||{})[He.Measurement=0]="Measurement",He[He.Aggregation=1]="Aggregation";var Je,Qe=(t(Ye,Je=function Qt(){this.kind=We.Measurement}),Ye);function Ye(){var e=null!==Je&&Je.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}var $e,Ze=(t(et,$e=Xe),et.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",et.dataType="MetricData",et);function et(e,t,n,i,r,o,a,s){var c=$e.call(this)||this;c.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.Default};var l=new Qe;return l.count=0<i?i:undefined,l.max=isNaN(o)||null===o?undefined:o,l.min=isNaN(r)||null===r?undefined:r,l.name=se.sanitizeString(e,t)||ue.NotSpecified,l.value=n,c.metrics=[l],c.properties=se.sanitizeProperties(e,a),c.measurements=se.sanitizeMeasurements(e,s),c}var tt,nt=(t(it,tt=Ee),it);function it(){var e=tt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var rt,ot=(t(at,rt=nt),at.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",at.dataType="PageviewData",at);function at(e,t,n,i,r,o,a){var s=rt.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=se.sanitizeId(e,a),s.url=se.sanitizeUrl(e,n),s.name=se.sanitizeString(e,t)||ue.NotSpecified,isNaN(i)||(s.duration=ue.msToTimeSpan(i)),s.properties=se.sanitizeProperties(e,r),s.measurements=se.sanitizeMeasurements(e,o),s}var st,ct=(t(lt,st=Ne),lt);function lt(){var e=st.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var ut,gt=(t(ft,ut=ct),ft.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",ft.dataType="RemoteDependencyData",ft);function ft(e,t,n,i,r,o,a,s,c,l,u,g){void 0===c&&(c="Ajax");var f=ut.call(this)||this;f.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},f.id=t,f.duration=ue.msToTimeSpan(r),f.success=o,f.resultCode=a+"",f.type=se.sanitizeString(e,c);var p=de.ParseDependencyPath(e,n,s,i);return f.data=se.sanitizeUrl(e,i)||p.data,f.target=se.sanitizeString(e,p.target),l&&(f.target=f.target+" | "+l),f.name=se.sanitizeString(e,p.name),f.properties=se.sanitizeProperties(e,u),f.measurements=se.sanitizeMeasurements(e,g),f}var pt,dt=(t(ht,pt=Ne),ht);function ht(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var mt,vt=(t(yt,mt=dt),yt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",yt.dataType="MessageData",yt);function yt(e,t,n,i,r){var o=mt.call(this)||this;return o.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||ue.NotSpecified,o.message=se.sanitizeMessage(e,t),o.properties=se.sanitizeProperties(e,i),o.measurements=se.sanitizeMeasurements(e,r),n&&(o.severityLevel=n),o}var wt,_t=(t(It,wt=nt),It);function It(){var e=wt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var St,Tt=(t(Nt,St=_t),Nt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",Nt.dataType="PageviewPerformanceData",Nt);function Nt(e,t,n,i,r,o,a){var s=St.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},s.url=se.sanitizeUrl(e,n),s.name=se.sanitizeString(e,t)||ue.NotSpecified,s.properties=se.sanitizeProperties(e,r),s.measurements=se.sanitizeMeasurements(e,o),a&&(s.domProcessing=a.domProcessing,s.duration=a.duration,s.networkConnect=a.networkConnect,s.perfTotal=a.perfTotal,s.receivedResponse=a.receivedResponse,s.sentRequest=a.sentRequest),s}var Et,xt,bt;t(Dt,Et=we);function Dt(e,t){var n=Et.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}(bt=xt=xt||{})[bt.Verbose=0]="Verbose",bt[bt.Information=1]="Information",bt[bt.Warning=2]="Warning",bt[bt.Error=3]="Error",bt[bt.Critical=4]="Critical";var kt=(Ct.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!f.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],f.isNullOrUndefined(r)?i:r},Ct);function Ct(){}var Pt=(At.create=function(e,t,n,i,r,o){if(n=se.sanitizeString(i,n)||ue.NotSpecified,f.isNullOrUndefined(e)||f.isNullOrUndefined(t)||f.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var a={name:n,time:f.toISOString(new Date),iKey:"",ext:o||{},tags:[],data:{},baseType:t,baseData:e};if(!f.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(a.data[s]=r[s]);return a},At);function At(){}var Mt=(Lt.prototype.trackPageView=function(n,i){var r=this,o=n.name;!f.isNullOrUndefined(o)&&"string"==typeof o||(o=n.name="object"==typeof window&&window.document&&window.document.title||"");var a=n.uri;if(!f.isNullOrUndefined(a)&&"string"==typeof a||(a=n.uri="object"==typeof window&&window.location&&window.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(n,i),f.arrForEach(this._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})}),void this._logger.throwInternal(w.WARNING,M,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var s,e,c=!1,l=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=me.GetDuration(l,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=undefined),f.isNullOrUndefined(i)||f.isNullOrUndefined(i.duration)||(e=i.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&((i=i||{}).duration=s),this.appInsights.sendPageViewInternal(n,i),f.arrForEach(this._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})}),c=!0),i=i||{};var u=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(u);var e={name:o,uri:a};r._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||c?(c||(i.duration=e.durationMs,r.appInsights.sendPageViewInternal(n,i)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,i),r.pageViewPerformanceSent=!0),f.arrForEach(r._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})})):(i.duration=s,r.appInsights.sendPageViewInternal(n,i),f.arrForEach(r._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})}))}else 6e4<me.GetDuration(l,+new Date)&&(clearInterval(u),c||(i.duration=6e4,r.appInsights.sendPageViewInternal(n,i),f.arrForEach(r._channel(),function(e){f.arrForEach(e,function(e){return e.flush(!0)})})))}catch(t){r._logger.throwInternal(w.CRITICAL,j,"trackPageView failed on page load calculation: "+ue.getExceptionName(t),{exception:ue.dump(t)})}},100)},Lt);function Lt(e,t,n,i){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=i,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var Ut=(Ot.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(i){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+ue.dump(i))}},Ot.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(i){return this._logger.warnToConsole("Call to restart failed: "+ue.dump(i)),null}},Ot.prototype.startPageVisitTimer=function(e,t){try{if(ue.canUseSessionStorage()){if(null!=ue.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new Rt(e,t),i=JSON.stringify(n);ue.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,i)}}catch(r){this._logger.warnToConsole("Call to start failed: "+ue.dump(r))}},Ot.prototype.stopPageVisitTimer=function(){try{if(ue.canUseSessionStorage()){var e=Date.now(),t=ue.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,ue.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(i){return this._logger.warnToConsole("Stop page visit timer failed: "+ue.dump(i)),null}},Ot);function Ot(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var Rt=function Yt(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},zt=(Vt.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming();if(t||n){if(t)var i=t.duration,r=me.GetDuration(t.startTime,t.connectEnd),o=me.GetDuration(t.requestStart,t.responseStart),a=me.GetDuration(t.responseStart,t.responseEnd),s=me.GetDuration(t.responseEnd,t.loadEventEnd);else i=me.GetDuration(n.navigationStart,n.loadEventEnd),r=me.GetDuration(n.navigationStart,n.connectEnd),o=me.GetDuration(n.requestStart,n.responseStart),a=me.GetDuration(n.responseStart,n.responseEnd),s=me.GetDuration(n.responseEnd,n.loadEventEnd);0===i?this._logger.throwInternal(w.WARNING,C,"error calculating page view performance.",{total:i,network:r,request:o,response:a,dom:s}):this.shouldCollectDuration(i,r,o,a,s)?i<Math.floor(r)+Math.floor(o)+Math.floor(a)+Math.floor(s)?this._logger.throwInternal(w.WARNING,k,"client performance math error.",{total:i,network:r,request:o,response:a,dom:s}):(e.durationMs=i,e.perfTotal=e.duration=ue.msToTimeSpan(i),e.networkConnect=ue.msToTimeSpan(r),e.sentRequest=ue.msToTimeSpan(o),e.receivedResponse=ue.msToTimeSpan(a),e.domProcessing=ue.msToTimeSpan(s),e.isValid=!0):this._logger.throwInternal(w.WARNING,B,"Invalid page load duration value. Browser perf data won't be sent.",{total:i,network:r,request:o,response:a,dom:s})}},Vt.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},Vt.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?window.performance.getEntriesByType("navigation")[0]:null},Vt.prototype.isPerformanceNavigationTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.getEntriesByType&&0<window.performance.getEntriesByType("navigation").length},Vt.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},Vt.prototype.isPerformanceTimingDataReady=function(){var e="object"==typeof window&&window.performance.timing;return"object"==typeof window&&0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},Vt.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var o=0;o<n.length;o++)r=r||-1!==i.toLowerCase().indexOf(n[o]);if(r)return!1;for(o=0;o<e.length;o++)if(e[o]>=this.MAX_DURATION_ALLOWED)return!1;return!0},Vt);function Vt(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Gt="duration",jt=(qt.getDefaultConfig=function(e){return(e=e||{}).sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=ue.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=ue.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=ue.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=ue.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=ue.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=ue.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=ue.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},qt.prototype.processTelemetry=function(e){for(var t=!1,n=this._telemetryInitializers.length,i=0;i<n;++i){var r=this._telemetryInitializers[i];if(r)try{if(!1===r.apply(null,[e])){t=!0;break}}catch(o){this._logger.throwInternal(w.CRITICAL,Y,"One of telemetry initializers failed, telemetry item will not be sent: "+ue.getExceptionName(o),{exception:ue.dump(o)},!0)}}t||f.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},qt.prototype.setNextPlugin=function(e){this._nextPlugin=e},qt.prototype.trackEvent=function(e,t){try{var n=Pt.create(e,De.dataType,De.envelopeType,this._logger,t);this.core.track(n)}catch(i){this._logger.throwInternal(w.WARNING,q,"trackTrace failed, trace will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(t){this._logger.throwInternal(w.CRITICAL,L,"startTrackEvent failed, event will not be collected: "+ue.getExceptionName(t),{exception:ue.dump(t)})}},qt.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,undefined,t)}catch(i){this._logger.throwInternal(w.CRITICAL,U,"stopTrackEvent failed, event will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.trackTrace=function(e,t){try{var n=Pt.create(e,vt.dataType,vt.envelopeType,this._logger,t);this.core.track(n)}catch(i){this._logger.throwInternal(w.WARNING,q,"trackTrace failed, trace will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.trackMetric=function(e,t){try{var n=Pt.create(e,Ze.dataType,Ze.envelopeType,this._logger,t);this.core.track(n)}catch(i){this._logger.throwInternal(w.CRITICAL,V,"trackMetric failed, metric will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,c({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(i){this._logger.throwInternal(w.CRITICAL,G,"trackPageView failed, page view will not be collected: "+ue.getExceptionName(i),{exception:ue.dump(i)})}},qt.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=e.refUri===undefined?document.referrer:e.refUri);var i=Pt.create(e,ot.dataType,ot.envelopeType,this._logger,t,n);this.core.track(i),this._trackAjaxAttempts=0},qt.prototype.sendPageViewPerformanceInternal=function(e,t,n){var i=Pt.create(e,Tt.dataType,Tt.envelopeType,this._logger,t,n);this.core.track(i)},qt.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(n){this._logger.throwInternal(w.CRITICAL,G,"trackPageViewPerformance failed, page view will not be collected: "+ue.getExceptionName(n),{exception:ue.dump(n)})}},qt.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e="object"==typeof window&&window.document&&window.document.title||""),this._pageTracking.start(e)}catch(t){this._logger.throwInternal(w.CRITICAL,O,"startTrackPage failed, page view may not be collected: "+ue.getExceptionName(t),{exception:ue.dump(t)})}},qt.prototype.stopTrackPage=function(e,t,n,i){try{"string"!=typeof e&&(e="object"==typeof window&&window.document&&window.document.title||""),"string"!=typeof t&&(t="object"==typeof window&&window.location&&window.location.href||""),this._pageTracking.stop(e,t,n,i),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(r){this._logger.throwInternal(w.CRITICAL,R,"stopTrackPage failed, page view will not be collected: "+ue.getExceptionName(r),{exception:ue.dump(r)})}},qt.prototype.sendExceptionInternal=function(e,t,n){var i=new Oe(this._logger,e.exception||new Error(ue.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),r=Pt.create(i,Oe.dataType,Oe.envelopeType,this._logger,t,n);this.core.track(r)},qt.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(n){this._logger.throwInternal(w.CRITICAL,z,"trackException failed, exception will not be collected: "+ue.getExceptionName(n),{exception:ue.dump(n)})}},qt.prototype._onerror=function(e){try{var t={url:e&&e.url||document.URL,lineNumber:e.lineNumber,columnNumber:e.columnNumber,message:e.message};if(ue.isCrossOriginError(e.message,e.url,e.lineNumber,e.columnNumber,e.error))this._sendCORSException(t.url);else{if(!ue.isError(e.error)){var n="window.onerror@"+t.url+":"+e.lineNumber+":"+(e.columnNumber||0);e.error=new Error(e.message),e.error.stack=n}this.trackException({exception:e.error,severityLevel:xt.Error},t)}}catch(r){var i=e.error?e.error.name+", "+e.error.message:"null";this._logger.throwInternal(w.CRITICAL,P,"_onError threw exception while logging error, error will not be collected: "+ue.getExceptionName(r),{exception:ue.dump(r),errorString:i})}},qt.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},qt.prototype._initialize=function(e,t,n){var a=this;if(!this._isInitialized){if(f.isNullOrUndefined(t))throw Error("Error initializing");this.core=t,this._logger=t.logger,this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=e.extensionConfig&&e.extensionConfig[this.identifier]?e.extensionConfig[this.identifier]:{};var i=qt.getDefaultConfig();if(i!==undefined){for(var r in i)this.config[r]=kt.getConfig(e,r,this.identifier,i[r]);if(this._globalconfig)for(var r in i)this._globalconfig[r]===undefined&&(this._globalconfig[r]=i[r])}this.config.isCookieUseDisabled&&ue.disableCookies(),this.config.isStorageUseDisabled&&ue.disableStorage();var o={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return a.config.accountId||e.accountId},sessionRenewalMs:function(){return a.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return a.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return a.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return a.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return a.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return a.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return a.config.appId||e.appId}};this._pageViewPerformanceManager=new zt(this.core),this._pageViewManager=new Mt(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new Ut(this._logger,function(e,t,n){return a.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(o),this._eventTracking=new Bt(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,i){(i=i||{})[Gt]=n.toString(),a.trackEvent({name:e,properties:i})},this._pageTracking=new Bt(this._logger,"trackPageView"),this._pageTracking.action=function(e,t,n,i,r){f.isNullOrUndefined(i)&&(i={}),i[Gt]=n.toString();var o={name:e,uri:t,properties:i,measurements:r};a.sendPageViewInternal(o)};var s,c,l=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented&&"object"==typeof window){var u=window.onerror;window.onerror=function(e,t,n,i,r){var o=u&&u(e,t,n,i,r);return!0!==o&&l._onerror({message:e,url:t,lineNumber:n,columnNumber:i,error:r}),o},this.config.autoExceptionInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&"object"==typeof history&&"function"==typeof history.pushState&&"function"==typeof history.replaceState&&"object"==typeof window&&"undefined"!=typeof Event){var g=this;f.arrForEach(n,function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(a._properties=e)}),history.pushState=(c=history.pushState,function(){var e=c.apply(this,arguments);return window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"pushState")),window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"locationchange")),e}),history.replaceState=(s=history.replaceState,function(){var e=s.apply(this,arguments);return window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"replaceState")),window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"locationchange")),e}),window.addEventListener(g.config.namePrefix+"popstate",function(){window.dispatchEvent(ue.createDomEvent(g.config.namePrefix+"locationchange"))}),window.addEventListener(g.config.namePrefix+"locationchange",function(){g._properties&&g._properties.context&&g._properties.context.telemetryTrace&&(g._properties.context.telemetryTrace.traceID=ue.generateW3CId(),g._properties.context.telemetryTrace.name=window.location&&window.location.pathname||"_unknown_"),a._currUri&&(a._prevUri=a._currUri),a._currUri=window.location&&window.location.href||"",setTimeout(function(e){g.trackPageView({refUri:e,properties:{duration:0}})}.bind(a,a._prevUri),g.autoRoutePVDelay)})}this._isInitialized=!0}},qt.prototype.trackPageVisitTime=function(e,t,n){var i={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},i)},qt.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var i=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===gt.dataType){var t=e.baseData;if(t)for(var n=0;n<i.length;n++)if(t.target&&0<=t.target.indexOf(i[n]))return!1}return!0})}},qt.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},qt.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:undefined},n=Pt.create(t,Oe.dataType,Oe.envelopeType,this._logger,{url:e});this.core.track(n)},qt.Version="2.3.1",qt);function qt(){this.identifier="ApplicationInsightsAnalytics",this.priority=180,this.autoRoutePVDelay=500,this._isInitialized=!1,this._trackAjaxAttempts=0,this._prevUri="object"==typeof window&&window.location&&window.location.href||"",this.initialize=this._initialize.bind(this)}var Bt=(Ft.prototype.start=function(e){"undefined"!=typeof this._events[e]&&this._logger.throwInternal(w.WARNING,J,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},Ft.prototype.stop=function(e,t,n,i){var r=this._events[e];if(isNaN(r))this._logger.throwInternal(w.WARNING,Q,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var o=+new Date,a=me.GetDuration(r,o);this.action(e,t,a,n,i)}delete this._events[e],this._events[e]=undefined},Ft);function Ft(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=jt,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a,n,d,i,o,s,c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=a=a||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(i=d=d||{})[i.Default=0]="Default",i[i.Required=1]="Required",i[i.Array=2]="Array",i[i.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var l=2,u="object";function g(){return Boolean(typeof window===u&&window)}function y(){return g()?window:null}function f(){return function e(){return Boolean(typeof document===u&&document)}()?document:g()&&y().document||null}function p(){return function e(){return Boolean(typeof navigator===u&&navigator)}()?navigator:null}function I(){return function e(){return Boolean(typeof history===u&&history)}()?history:null}function h(){return Boolean(typeof JSON===u&&JSON)}function m(){return h()?JSON:null}var v="undefined",T="prototype",S="attachEvent",w="addEventListener",N="detachEvent",_="removeEventListener";function E(e,t){return typeof e===t}function x(e){return e===undefined||E(e,v)}function b(e){return x(e)||null===e}function D(e,t){return e&&Object[T].hasOwnProperty.call(e,t)}function P(e){return E(e,"object")}function C(e){return E(e,"function")}function k(e,t,n,r){void 0===r&&(r=!1);var i=!1;if(!b(e))try{b(e[w])?b(e[S])||(e[S]("on"+t,n),i=!0):(e[w](t,n,r),i=!0)}catch(a){}return i}function L(e,t,n,r){if(void 0===r&&(r=!1),!b(e))try{b(e[_])?b(e[N])||e[N]("on"+t,n):e[_](t,n,r)}catch(i){}}var A=(M.isDate=function(e){return"[object Date]"===Object[T].toString.call(e)},M.isString=function(e){return E(e,"string")},M.isNumber=function(e){return E(e,"number")},M.isBoolean=function(e){return E(e,"boolean")},M.disableCookies=function(){M._canUseCookies=!1},M.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(O,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},M.toISOString=function(e){if(M.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},M.arrForEach=function(e,t,n){for(var r=e.length,i=0;i<r;++i)i in e&&t.call(n||e,e[i],i,e)},M.arrIndexOf=function(e,t,n){for(var r=e.length,i=n||0,a=Math.max(0<=i?i:r-Math.abs(i),0);a<r;a++)if(a in e&&e[a]===t)return a;return-1},M.arrMap=function(e,t,n){for(var r=e.length,i=n||e,a=new Array(r),o=0;o<r;o++)o in e&&(a[o]=t.call(i,e[o],e));return a},M.arrReduce=function(e,t,n){var r,i=e.length,a=0;if(3<=arguments.length)r=n;else{for(;a<i&&!(a in e);)a++;r=e[a++]}for(;a<i;)a in e&&(r=t(r,e[a],a,e)),a++;return r},M.objCreate=function(e){if(null==e)return{};if(!P(e)&&!C(e))throw new TypeError("Object prototype may only be an Object: "+e);function t(){}return t[T]=e,new t},M.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(C(e)||P(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var r in e)D(e,r)&&n.push(r);if(t)for(var i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=i.length,o=0;o<a;o++)D(e,i[o])&&n.push(i[o]);return n},M.objDefineAccessors=function(e,t,n,r){var i=Object.defineProperty;if(i)try{var a={enumerable:!0,configurable:!0};return n&&(a.get=n),r&&(a.set=r),i(e,t,a),!0}catch(o){}return!1},M.addEventHandler=function(e,t){var n=!1,r=y();r&&(n=k(r,e,t),n=k(r.body,e,t)||n);var i=f();return i&&(n=z.Attach(i,e,t)||n),n},M.isTypeof=E,M.isUndefined=x,M.isNullOrUndefined=b,M.hasOwnProperty=D,M.isFunction=C,M.isObject=P,M);function M(){}var U,R,O=/[xy]/g,z=(V.Attach=k,V.AttachEvent=k,V.Detach=L,V.DetachEvent=L,V);function V(){}(R=U=U||{})[R.CRITICAL=1]="CRITICAL",R[R.WARNING=2]="WARNING";var G=1,j=2,q=3,B=4,F=5,W=6,H=8,X=10,K=11,Q=23,J=25,Y=29,$=30,Z=31,ee=32,te=35,ne=36,re=37,ie=38,ae=39,oe=45,se=49,ce=52,le=56,ue=57,ge=61,fe=62,pe=63,de=64,he=66,me=68,ve=69,ye=73,Ie=(Te.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},Te.dataType="MessageData",Te.AiNonUserActionablePrefix="AI (Internal): ",Te.AiUserActionablePrefix="AI: ",Te);function Te(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?Te.AiUserActionablePrefix:Te.AiNonUserActionablePrefix)+e;var i="";h()&&(i=m().stringify(r));var a=(t?" message:"+Te.sanitizeDiagnosticText(t):"")+(r?" props:"+Te.sanitizeDiagnosticText(i):"");this.message+=a}var Se=(we.prototype.throwInternal=function(e,t,n,r,i){void 0===i&&(i=!1);var a=new Ie(t,n,i,r),o=this;if(o.enableDebugExceptions())throw a;if(!A.isUndefined(a)&&a&&!A.isUndefined(a.message)){if(i){var s=+a.messageId;!o._messageLogged[s]&&o.consoleLoggingLevel()>=U.WARNING&&(o.warnToConsole(a.message),o._messageLogged[s]=!0)}else o.consoleLoggingLevel()>=U.WARNING&&o.warnToConsole(a.message);o.logInternalMessage(e,a)}},we.prototype.warnToConsole=function(e){!A.isUndefined(console)&&console&&(A.isFunction(console.warn)?console.warn(e):A.isFunction(console.log)&&console.log(e))},we.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},we.prototype.logInternalMessage=function(e,t){var n=this;if(!n._areInternalMessagesThrottled()){var r=!0,i=n.AIInternalMessagePrefix+t.messageId;if(n._messageLogged[i]?r=!1:n._messageLogged[i]=!0,r&&(e<=n.telemetryLoggingLevel()&&(n.queue.push(t),n._messageCount++),n._messageCount===n.maxInternalMessageLimit())){var a="Internal events throttle limit per PageView reached for this app.",o=new Ie(Q,a,!1);n.queue.push(o),n.warnToConsole(a)}}},we.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},we);function we(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},A.isNullOrUndefined(e)||(A.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),A.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),A.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),A.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var Ne=A.isFunction,_e=function qn(i,a){var o=this,s=null,c=Ne(i.processTelemetry),l=Ne(i.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return i},o.getNext=function(){return s},o.setNext=function(e){s=e},o.processTelemetry=function(e,t){if(t=t||a,i&&c){o._hasRun=!0;try{t.setNext(s),l&&i.setNextPlugin(s),s&&(s._hasRun=!1),i.processTelemetry(e,t)}catch(r){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(U.CRITICAL,ye,"Plugin ["+i.identifier+"] failed during processTelemetry - "+r),s&&!n&&s.processTelemetry(e,t)}}else s&&(o._hasRun=!0,s.processTelemetry(e,t))}},Ee=A.isNullOrUndefined;function xe(e,t){var n=[];if(e&&0<e.length)for(var r=null,i=0;i<e.length;i++){var a=e[i];if(a&&A.isFunction(a.processTelemetry)){var o=new _e(a,t);n.push(o),r&&r.setNext(o),r=o}}return 0<n.length?n[0]:null}var be=function Bn(e,a,n,t){var o=this,r=null;null!==t&&(e&&A.isFunction(e.getPlugin)?r=function s(e,t,n){var r=[],i=!n;if(e)for(;e;){var a=e.getPlugin();!i&&a!==n||(i=!0,r.push(a)),e=e.getNext()}return i||r.push(n),xe(r,t)}(e,o,t||e.getPlugin()):t?r=function c(e,t,n){var r=e,i=!1;return n&&e&&(r=[],A.arrForEach(e,function(e){!i&&e!==n||(i=!0,r.push(e))})),n&&!i&&(r=r||[]).push(n),xe(r,t)}(e,o,t):A.isUndefined(t)&&(r=xe(e,o))),o.core=function(){return n},o.diagLog=function(){var e=(n||{}).logger;return e=e||new Se(a||{})},o.getCfg=function(){return a},o.getExtCfg=function(e,t){var n;if(void 0===t&&(t={}),a){var r=a.extensionConfig;r&&e&&(n=r[e])}return n||t},o.getConfig=function(e,t,n){var r;void 0===n&&(n=!1);var i=o.getExtCfg(e,null);return i&&!Ee(i[t])?r=i[t]:a&&!Ee(a[t])&&(r=a[t]),Ee(r)?n:r},o.hasNext=function(){return null!=r},o.getNext=function(){return r},o.setNext=function(e){r=e},o.processNext=function(e){var t=r;t&&(r=t.getNext(),t.processTelemetry(e,o))},o.createNew=function(e,t){return void 0===e&&(e=null),new Bn(e||r,a,n,t)}},De=A.isFunction,Pe="getPlugin",Ce=(ke.prototype.initialize=function(e,t,n,r){this._baseTelInit(e,t,n,r)},ke);function ke(){var a=this,o=!1,s=null,c=null;a.core=null,a.diagLog=function(e){return a._getTelCtx(e).diagLog()},a.isInitialized=function(){return o},a.setInitialized=function(e){o=e},a.setNextPlugin=function(e){c=e},a.processNext=function(e,t){t?t.processNext(e):c&&De(c.processTelemetry)&&c.processTelemetry(e,null)},a._getTelCtx=function(e){void 0===e&&(e=null);var t=e;if(!t){var n=s||new be(null,{},a.core);t=c&&c[Pe]?n.createNew(null,c[Pe]):n.createNew(null,c)}return t},a._baseTelInit=function(e,t,n,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&t&&(r=t.getProcessTelContext().getNext());var i=c;c&&c[Pe]&&(i=c[Pe]()),a.core=t,s=new be(r,e,t,i),o=!0}}var Le=A.isFunction,Ae="processTelemetry",Me="priority",Ue="setNextPlugin",Re="isInitialized";function Oe(t,n){for(var e=[],r=null,i=t.getNext();i;){var a=i.getPlugin();a&&(r&&Le(r[Ue])&&Le(a[Ae])&&r[Ue](a),Le(a[Re])&&a[Re]()||e.push(a),r=a,i=i.getNext())}A.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function ze(e){return e.sort(function(e,t){var n=0,r=Le(t[Ae]);return Le(e[Ae])?n=r?e[Me]-t[Me]:1:r&&(n=-1),n})}var Ve=500,Ge="Channel has invalid priority",je=A.arrForEach,qe=A.objDefineAccessors;function Be(e,t){t&&0<t.length&&(function n(e){je(e,function(e){if(e.priority<Ve)throw Error(Ge+e.identifier)})}(t=t.sort(function(e,t){return e.priority-t.priority})),e.push(t))}var Fe,We=(t(He,Fe=Ce),He.prototype.processTelemetry=function(t,n){var r=this;this._channelQueue&&je(this._channelQueue,function(e){0<e.length&&r._getTelCtx(n).createNew(e).processNext(t)})},He.prototype.getChannelControls=function(){return this._channelQueue},He.prototype.initialize=function(t,n,r){if(!this.isInitialized()){Fe.prototype.initialize.call(this,t,n,r),t.isCookieUseDisabled&&A.disableCookies();var e=this._channelQueue=function i(e,t){var n=[];if(e&&je(e,function(e){return Be(n,e)}),t){var r=[];je(t,function(e){e.priority>Ve&&r.push(e)}),Be(n,r)}return n}((t||{}).channels,r);je(e,function(e){return Oe(new be(e,t,n),r)})}},He._staticInit=(qe(He.prototype,"ChannelControls",He.prototype.getChannelControls),void qe(He.prototype,"channelQueue",He.prototype.getChannelControls)),He);function He(){var e=null!==Fe&&Fe.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=Ve,e}var Xe=A.arrForEach,Ke=A.isNullOrUndefined,Qe=(Je.prototype.initialize=function(e,t,r,n){var i=this;if(i.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Ke(e.instrumentationKey))throw Error("Please provide instrumentation key");i.config=e;var a=i._channelController;n=n||A.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}}),i._notificationManager=n,e.extensions=Ke(e.extensions)?[]:e.extensions,(e.extensionConfig=Ke(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,r=r||A.objCreate({throwInternal:function(e,t,n,r,i){void 0===i&&(i=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),i.logger=r;var o=[];o.push.apply(o,t.concat(e.extensions)),o=ze(o);var s=[],c={};if(Xe(o,function(e){if(Ke(e)||Ke(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(Ke(c[t])?c[t]=n:r.warnToConsole("Two extensions have same priority #"+t+" - "+c[t]+", "+n)),(!t||t<a.priority)&&s.push(e)}),o.push(a),s.push(a),o=ze(o),i._extensions=o,Oe(new be([a],e,i),o),Oe(new be(s,e,i),o),i._extensions=s,0===i.getTransmissionControls().length)throw new Error("No channels available");i._setInit(!0)},Je.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Je.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=A.toISOString(new Date)),Ke(e.ver)&&(e.ver="4.0"),this.getProcessTelContext().processNext(e)},Je.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new be(t,this.config,this)},Je);function Je(){var t=!1;this._extensions=new Array,this._channelController=new We,this.isInitialized=function(){return t},this._setInit=function(e){t=e}}var Ye=($e.prototype.addNotificationListener=function(e){this.listeners.push(e)},$e.prototype.removeNotificationListener=function(e){for(var t=A.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=A.arrIndexOf(this.listeners,e)},$e.prototype.eventsSent=function(t){for(var n=this,e=function(e){r.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},r=this,i=0;i<this.listeners.length;++i)e(i)},$e.prototype.eventsDiscarded=function(t,n){for(var r=this,e=function(e){i.listeners[e].eventsDiscarded&&setTimeout(function(){return r.listeners[e].eventsDiscarded(t,n)},0)},i=this,a=0;a<this.listeners.length;++a)e(a)},$e);function $e(){this.listeners=[]}var Ze;t(et,Ze=Qe),et.prototype.initialize=function(e,t){var n=this;n._notificationManager=new Ye,n.logger=new Se(e),n.config=e,Ze.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},et.prototype.getTransmissionControls=function(){return Ze.prototype.getTransmissionControls.call(this)},et.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Ze.prototype.track.call(this,e)},et.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},et.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},et.prototype.pollInternalLogs=function(r){var t=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];A.arrForEach(e,function(e){var t={name:r||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:A.toISOString(new Date),baseType:Ie.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},et.prototype._validateTelemetryItem=function(e){if(A.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},et.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],l)};function et(){return Ze.call(this)||this}var tt=(nt.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=nt.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;n[o]!==undefined;)a++,o=i.substring(0,nt.MAX_NAME_LENGTH-3)+nt.padNumber(a);i=o}return i},nt.sanitizeKey=function(e,t){var n;return t&&(t=nt.trim(t.toString())).length>nt.MAX_NAME_LENGTH&&(n=t.substring(0,nt.MAX_NAME_LENGTH),e.throwInternal(U.WARNING,ue,"name is too long. It has been truncated to "+nt.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},nt.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=nt.MAX_STRING_LENGTH),t&&(n=n||nt.MAX_STRING_LENGTH,(t=nt.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(U.WARNING,ge,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},nt.sanitizeUrl=function(e,t){return nt.sanitizeInput(e,t,nt.MAX_URL_LENGTH,he)},nt.sanitizeMessage=function(e,t){var n;return t&&t.length>nt.MAX_MESSAGE_LENGTH&&(n=t.substring(0,nt.MAX_MESSAGE_LENGTH),e.throwInternal(U.WARNING,le,"message is too long, it has been truncated to "+nt.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},nt.sanitizeException=function(e,t){var n;return t&&t.length>nt.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,nt.MAX_EXCEPTION_LENGTH),e.throwInternal(U.WARNING,ce,"exception is too long, it has been truncated to "+nt.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},nt.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var i=t[r];if(A.isObject(i)&&h())try{i=m().stringify(i)}catch(a){e.throwInternal(U.WARNING,se,"custom property is not valid",{exception:a},!0)}i=nt.sanitizeString(e,i,nt.MAX_PROPERTY_LENGTH),n[r=nt.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},nt.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=nt.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},nt.sanitizeId=function(e,t){return t?nt.sanitizeInput(e,t,nt.MAX_ID_LENGTH,ve).toString():t},nt.sanitizeInput=function(e,t,n,r){var i;return t&&(t=nt.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(U.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},nt.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},nt.trim=function(e){return A.isString(e)?e.replace(/^\s+|\s+$/g,""):e},nt.MAX_NAME_LENGTH=150,nt.MAX_ID_LENGTH=128,nt.MAX_PROPERTY_LENGTH=8192,nt.MAX_STRING_LENGTH=1024,nt.MAX_URL_LENGTH=2048,nt.MAX_MESSAGE_LENGTH=32768,nt.MAX_EXCEPTION_LENGTH=32768,nt);function nt(){}var rt="prototype",it=y(),at=p(),ot=A.isString,st=(ct.createDomEvent=function(e){var t=null;return A.isFunction(Event)?t=new Event(e):(t=f().createEvent("Event")).initEvent(e,!0,!0),t},ct.disableStorage=function(){ct._canUseLocalStorage=!1,ct._canUseSessionStorage=!1},ct._getLocalStorageObject=function(){return ct.canUseLocalStorage()?ct._getVerifiedStorageObject(a.LocalStorage):null},ct._getVerifiedStorageObject=function(e){var t,n,r=null;try{if(A.isNullOrUndefined(it))return null;n=new Date,(r=e===a.LocalStorage?it.localStorage:it.sessionStorage).setItem(n.toString(),n.toString()),t=r.getItem(n.toString())!==n.toString(),r.removeItem(n.toString()),t&&(r=null)}catch(i){r=null}return r},ct.isInternalApplicationInsightsEndpoint=function(e){return-1!==ct._internalEndpoints.indexOf(e.toLowerCase())},ct.canUseLocalStorage=function(){return ct._canUseLocalStorage===undefined&&(ct._canUseLocalStorage=!!ct._getVerifiedStorageObject(a.LocalStorage)),ct._canUseLocalStorage},ct.getStorage=function(e,t){var n=ct._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){ct._canUseLocalStorage=!1,e.throwInternal(U.WARNING,G,"Browser failed read of local storage. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return null},ct.setStorage=function(e,t,n){var r=ct._getLocalStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(i){ct._canUseLocalStorage=!1,e.throwInternal(U.WARNING,q,"Browser failed write to local storage. "+ct.getExceptionName(i),{exception:ct.dump(i)})}return!1},ct.removeStorage=function(e,t){var n=ct._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){ct._canUseLocalStorage=!1,e.throwInternal(U.WARNING,F,"Browser failed removal of local storage item. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return!1},ct._getSessionStorageObject=function(){return ct.canUseSessionStorage()?ct._getVerifiedStorageObject(a.SessionStorage):null},ct.canUseSessionStorage=function(){return ct._canUseSessionStorage===undefined&&(ct._canUseSessionStorage=!!ct._getVerifiedStorageObject(a.SessionStorage)),ct._canUseSessionStorage},ct.getSessionStorageKeys=function(){var e=[];if(ct.canUseSessionStorage())for(var t in it.sessionStorage)e.push(t);return e},ct.getSessionStorage=function(e,t){var n=ct._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){ct._canUseSessionStorage=!1,e.throwInternal(U.WARNING,j,"Browser failed read of session storage. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return null},ct.setSessionStorage=function(e,t,n){var r=ct._getSessionStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(i){ct._canUseSessionStorage=!1,e.throwInternal(U.WARNING,B,"Browser failed write to session storage. "+ct.getExceptionName(i),{exception:ct.dump(i)})}return!1},ct.removeSessionStorage=function(e,t){var n=ct._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){ct._canUseSessionStorage=!1,e.throwInternal(U.WARNING,W,"Browser failed removal of session storage item. "+ct.getExceptionName(r),{exception:ct.dump(r)})}return!1},ct.disableCookies=function(){A.disableCookies()},ct.canUseCookies=function(e){if(A._canUseCookies===undefined){A._canUseCookies=!1;try{A._canUseCookies=ct.document.cookie!==undefined}catch(t){e.throwInternal(U.WARNING,me,"Cannot access document.cookie - "+ct.getExceptionName(t),{exception:ct.dump(t)})}}return A._canUseCookies},ct.setCookie=function(e,t,n,r){n+=";SameSite=None";var i="",a="";r&&(i=";domain="+r),ct.document.location&&"https:"===ct.document.location.protocol&&(a=";secure"),ct.canUseCookies(e)&&(ct.document.cookie=t+"="+n+i+";path=/"+a)},ct.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},ct.getCookie=function(e,t){if(ct.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=ct.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=ct.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},ct.deleteCookie=function(e,t){ct.canUseCookies(e)&&(ct.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},ct.trim=function(e){return ot(e)?e.replace(/^\s+|\s+$/g,""):e},ct.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},ct.random32=function(){return 4294967296*Math.random()|0},ct.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=ct.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},ct.isArray=function(e){return"[object Array]"===Object[rt].toString.call(e)},ct.isError=function(e){return"[object Error]"===Object[rt].toString.call(e)},ct.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():at?at.userAgent.toLowerCase():"";return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},ct.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,i=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},ct.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},ct.dump=function(e){var t=Object[rt].toString.call(e),n="";return"[object Error]"===t?n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":h()&&(n=m().stringify(e)),t+n},ct.getExceptionName=function(e){return"[object Error]"===Object[rt].toString.call(e)?e.name:""},ct.addEventHandler=function(e,t){return z.Attach(it,e,t)},ct.IsBeaconApiSupported=function(){return"sendBeacon"in at&&at.sendBeacon},ct.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},ct.document=f()||{},ct._canUseLocalStorage=undefined,ct._canUseSessionStorage=undefined,ct._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],ct.NotSpecified="not_specified",ct.isDate=A.isDate,ct.toISOStringForIE8=A.toISOString,ct);function ct(){}var lt=(ut.parseUrl=function(e){return ut.htmlAnchorElement||(ut.htmlAnchorElement=ut.document.createElement?ut.document.createElement("a"):{host:ut.parseHost(e)}),ut.htmlAnchorElement.href=e,ut.htmlAnchorElement},ut.getAbsoluteUrl=function(e){var t,n=ut.parseUrl(e);return n&&(t=n.href),t},ut.getPathName=function(e){var t,n=ut.parseUrl(e);return n&&(t=n.pathname),t},ut.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ut.parseHost=function(e){if(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);if(null!=t&&2<t.length&&ot(t[2])&&0<t[2].length)return t[2]}return null},ut.document=f()||{},ut);function ut(){}var gt=(ft.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=lt.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=tt.sanitizeString(e,n?n+" "+c:c)}else a=tt.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},ft);function ft(){}var pt=(dt.Now=A.isUndefined(it)?function(){return(new Date).getTime()}:it.performance&&it.performance.now&&it.performance.timing?function(){return it.performance.now()+it.performance.timing.navigationStart}:function(){return(new Date).getTime()},dt.GetDuration=function(e,t){var n=null;return 0===e||0===t||A.isNullOrUndefined(e)||A.isNullOrUndefined(t)||(n=t-e),n},dt);function dt(){}var ht,mt=(t(vt,ht=function Fn(){}),vt);function vt(){return ht.call(this)||this}var yt;t(It,yt=function Wn(){this.ver=1,this.sampleRate=100,this.tags={}});function It(e,t,n){var r=yt.call(this)||this;return r.name=tt.sanitizeString(e,n)||st.NotSpecified,r.data=t,r.time=A.toISOString(new Date),r.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100===r.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},r}var Tt,St=function Hn(){},wt=(t(Nt,Tt=St),Nt);function Nt(){var e=Tt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var _t,Et=(t(xt,_t=wt),xt.envelopeType="Microsoft.ApplicationInsights.{0}.Event",xt.dataType="EventData",xt);function xt(e,t,n,r){var i=_t.call(this)||this;return i.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},i.name=tt.sanitizeString(e,t)||st.NotSpecified,i.properties=tt.sanitizeProperties(e,n),i.measurements=tt.sanitizeMeasurements(e,r),i}var bt,Dt=function Xn(){},Pt=(t(Ct,bt=St),Ct);function Ct(){var e=bt.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var kt,Lt=function Kn(){this.hasFullStack=!0,this.parsedStack=[]},At=(t(Mt,kt=Pt),Mt.CreateFromInterface=function(t,e){var n=e.exceptions&&A.arrMap(e.exceptions,function(e){return Rt.CreateFromInterface(t,e)});return new Mt(t,c({},e,{exceptions:n}))},Mt.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=(e.ver,e.problemGroup),o=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&A.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:i,properties:n,measurements:r,problemGroup:a,id:o,isManual:s}},Mt.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Mt.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Mt.dataType="ExceptionData",Mt);function Mt(e,t,n,r,i,a){var o=kt.call(this)||this;return o.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},t instanceof Error?(o.exceptions=[new Rt(e,t)],o.properties=tt.sanitizeProperties(e,n),o.measurements=tt.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),o.ver=2,A.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Ut,Rt=(t(Ot,Ut=Lt),Ot.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&A.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},Ot.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&A.arrMap(t.parsedStack,function(e){return Vt.CreateFromInterface(e)})||t.parsedStack;return new Ot(e,c({},t,{parsedStack:n}))},Ot.parseStack=function(e){var t;if(A.isString(e)){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(Vt.regex.test(o)){var s=new Vt(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,g=c,f=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=l,c++,l--}}return t},Ot);function Ot(e,t){var n=Ut.call(this)||this;if(n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},t instanceof Error){n.typeName=tt.sanitizeString(e,t.name)||st.NotSpecified,n.message=tt.sanitizeMessage(e,t.message)||st.NotSpecified;var r=t.stack;n.parsedStack=Ot.parseStack(r),n.stack=tt.sanitizeException(e,r),n.hasFullStack=st.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var zt,Vt=(t(Gt,zt=Dt),Gt.CreateFromInterface=function(e){return new Gt(e,null)},Gt.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Gt.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Gt.baseSize=58,Gt);function Gt(e,t){var n=zt.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=st.trim(r),n.fileName="",n.line=0;var i=r.match(Gt.regex);i&&5<=i.length&&(n.method=st.trim(i[2])||n.method,n.fileName=st.trim(i[4]),n.line=parseInt(i[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Gt.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var jt,qt,Bt,Ft=(t(Wt,jt=St),Wt);function Wt(){var e=jt.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(Bt=qt=qt||{})[Bt.Measurement=0]="Measurement",Bt[Bt.Aggregation=1]="Aggregation";var Ht,Xt=(t(Kt,Ht=function Qn(){this.kind=qt.Measurement}),Kt);function Kt(){var e=null!==Ht&&Ht.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}var Qt,Jt=(t(Yt,Qt=Ft),Yt.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Yt.dataType="MetricData",Yt);function Yt(e,t,n,r,i,a,o,s){var c=Qt.call(this)||this;c.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.Default};var l=new Xt;return l.count=0<r?r:undefined,l.max=isNaN(a)||null===a?undefined:a,l.min=isNaN(i)||null===i?undefined:i,l.name=tt.sanitizeString(e,t)||st.NotSpecified,l.value=n,c.metrics=[l],c.properties=tt.sanitizeProperties(e,o),c.measurements=tt.sanitizeMeasurements(e,s),c}var $t,Zt=(t(en,$t=wt),en);function en(){var e=$t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var tn,nn=(t(rn,tn=Zt),rn.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",rn.dataType="PageviewData",rn);function rn(e,t,n,r,i,a,o){var s=tn.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=tt.sanitizeId(e,o),s.url=tt.sanitizeUrl(e,n),s.name=tt.sanitizeString(e,t)||st.NotSpecified,isNaN(r)||(s.duration=st.msToTimeSpan(r)),s.properties=tt.sanitizeProperties(e,i),s.measurements=tt.sanitizeMeasurements(e,a),s}var an,on=(t(sn,an=St),sn);function sn(){var e=an.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var cn,ln=(t(un,cn=on),un.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",un.dataType="RemoteDependencyData",un);function un(e,t,n,r,i,a,o,s,c,l,u,g){void 0===c&&(c="Ajax");var f=cn.call(this)||this;f.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},f.id=t,f.duration=st.msToTimeSpan(i),f.success=a,f.resultCode=o+"",f.type=tt.sanitizeString(e,c);var p=gt.ParseDependencyPath(e,n,s,r);return f.data=tt.sanitizeUrl(e,r)||p.data,f.target=tt.sanitizeString(e,p.target),l&&(f.target=f.target+" | "+l),f.name=tt.sanitizeString(e,p.name),f.properties=tt.sanitizeProperties(e,u),f.measurements=tt.sanitizeMeasurements(e,g),f}var gn,fn=(t(pn,gn=St),pn);function pn(){var e=gn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var dn,hn=(t(mn,dn=fn),mn.envelopeType="Microsoft.ApplicationInsights.{0}.Message",mn.dataType="MessageData",mn);function mn(e,t,n,r,i){var a=dn.call(this)||this;return a.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||st.NotSpecified,a.message=tt.sanitizeMessage(e,t),a.properties=tt.sanitizeProperties(e,r),a.measurements=tt.sanitizeMeasurements(e,i),n&&(a.severityLevel=n),a}var vn,yn=(t(In,vn=Zt),In);function In(){var e=vn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Tn,Sn=(t(wn,Tn=yn),wn.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",wn.dataType="PageviewPerformanceData",wn);function wn(e,t,n,r,i,a,o){var s=Tn.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},s.url=tt.sanitizeUrl(e,n),s.name=tt.sanitizeString(e,t)||st.NotSpecified,s.properties=tt.sanitizeProperties(e,i),s.measurements=tt.sanitizeMeasurements(e,a),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var Nn,_n,En;t(xn,Nn=mt);function xn(e,t){var n=Nn.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}(En=_n=_n||{})[En.Verbose=0]="Verbose",En[En.Information=1]="Information",En[En.Warning=2]="Warning",En[En.Error=3]="Error",En[En.Critical=4]="Critical";var bn=(Dn.create=function(e,t,n,r,i,a){if(n=tt.sanitizeString(r,n)||st.NotSpecified,A.isNullOrUndefined(e)||A.isNullOrUndefined(t)||A.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:A.toISOString(new Date),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!A.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},Dn);function Dn(){}var Pn=(Cn.prototype.trackPageView=function(n,r){var i=this,e=y(),a=n.name;!A.isNullOrUndefined(a)&&"string"==typeof a||(a=n.name=e&&e.document&&e.document.title||"");var o=n.uri;if(!A.isNullOrUndefined(o)&&"string"==typeof o||(o=n.uri=e&&e.location&&e.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(n,r),A.arrForEach(this._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})}),void this._logger.throwInternal(U.WARNING,J,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var s,t,c=!1,l=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=pt.GetDuration(l,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=undefined),A.isNullOrUndefined(r)||A.isNullOrUndefined(r.duration)||(t=r.duration),!this.overridePageViewDuration&&isNaN(t)||(isNaN(t)&&((r=r||{}).duration=s),this.appInsights.sendPageViewInternal(n,r),A.arrForEach(this._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})}),c=!0),r=r||{};var u=setInterval(function(){try{if(i._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(u);var e={name:a,uri:o};i._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||c?(c||(r.duration=e.durationMs,i.appInsights.sendPageViewInternal(n,r)),i.pageViewPerformanceSent||(i.appInsights.sendPageViewPerformanceInternal(e,r),i.pageViewPerformanceSent=!0),A.arrForEach(i._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})})):(r.duration=s,i.appInsights.sendPageViewInternal(n,r),A.arrForEach(i._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})}))}else 6e4<pt.GetDuration(l,+new Date)&&(clearInterval(u),c||(r.duration=6e4,i.appInsights.sendPageViewInternal(n,r),A.arrForEach(i._channel(),function(e){A.arrForEach(e,function(e){return e.flush(!0)})})))}catch(t){i._logger.throwInternal(U.CRITICAL,ie,"trackPageView failed on page load calculation: "+st.getExceptionName(t),{exception:st.dump(t)})}},100)},Cn);function Cn(e,t,n,r){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=r,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var kn=(Ln.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(r){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+st.dump(r))}},Ln.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(r){return this._logger.warnToConsole("Call to restart failed: "+st.dump(r)),null}},Ln.prototype.startPageVisitTimer=function(e,t){try{if(st.canUseSessionStorage()){if(null!=st.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new An(e,t),r=m().stringify(n);st.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(i){this._logger.warnToConsole("Call to start failed: "+st.dump(i))}},Ln.prototype.stopPageVisitTimer=function(){try{if(st.canUseSessionStorage()){var e=Date.now(),t=st.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t&&h()){var n=m().parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,st.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(r){return this._logger.warnToConsole("Stop page visit timer failed: "+st.dump(r)),null}},Ln);function Ln(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var An=function Jn(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Mn=(Un.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceNavigationTiming(),n=this.getPerformanceTiming();if(t||n){if(t)var r=t.duration,i=pt.GetDuration(t.startTime,t.connectEnd),a=pt.GetDuration(t.requestStart,t.responseStart),o=pt.GetDuration(t.responseStart,t.responseEnd),s=pt.GetDuration(t.responseEnd,t.loadEventEnd);else r=pt.GetDuration(n.navigationStart,n.loadEventEnd),i=pt.GetDuration(n.navigationStart,n.connectEnd),a=pt.GetDuration(n.requestStart,n.responseStart),o=pt.GetDuration(n.responseStart,n.responseEnd),s=pt.GetDuration(n.responseEnd,n.loadEventEnd);0===r?this._logger.throwInternal(U.WARNING,X,"error calculating page view performance.",{total:r,network:i,request:a,response:o,dom:s}):this.shouldCollectDuration(r,i,a,o,s)?r<Math.floor(i)+Math.floor(a)+Math.floor(o)+Math.floor(s)?this._logger.throwInternal(U.WARNING,H,"client performance math error.",{total:r,network:i,request:a,response:o,dom:s}):(e.durationMs=r,e.perfTotal=e.duration=st.msToTimeSpan(r),e.networkConnect=st.msToTimeSpan(i),e.sentRequest=st.msToTimeSpan(a),e.receivedResponse=st.msToTimeSpan(o),e.domProcessing=st.msToTimeSpan(s),e.isValid=!0):this._logger.throwInternal(U.WARNING,oe,"Invalid page load duration value. Browser perf data won't be sent.",{total:r,network:i,request:a,response:o,dom:s})}},Un.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},Un.prototype.getPerformanceNavigationTiming=function(){return this.isPerformanceNavigationTimingSupported()?window.performance.getEntriesByType("navigation")[0]:null},Un.prototype.isPerformanceNavigationTimingSupported=function(){var e=y();return e&&e.performance&&e.performance.getEntriesByType&&0<e.performance.getEntriesByType("navigation").length},Un.prototype.isPerformanceTimingSupported=function(){var e=y();return void 0!==e&&e.performance&&e.performance.timing},Un.prototype.isPerformanceTimingDataReady=function(){var e=y(),t=e&&e.performance.timing;return e&&0<t.domainLookupStart&&0<t.navigationStart&&0<t.responseStart&&0<t.requestStart&&0<t.loadEventEnd&&0<t.responseEnd&&0<t.connectEnd&&0<t.domLoading},Un.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],r=(p()||{}).userAgent,i=!1;if(r)for(var a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(a=0;a<e.length;a++)if(e[a]>=this.MAX_DURATION_ALLOWED)return!1;return!0},Un);function Un(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Rn,On="duration",zn=(t(Vn,Rn=Ce),Vn.getDefaultConfig=function(e){return(e=e||{}).sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=st.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=st.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=st.stringToBoolOrDefault(e.overridePageViewDuration),e.enableUnhandledPromiseRejectionTracking=st.stringToBoolOrDefault(e.enableUnhandledPromiseRejectionTracking),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=st.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=st.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=st.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=st.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},Vn.prototype.processTelemetry=function(e,t){var n=!1,r=this._telemetryInitializers.length;t=this._getTelCtx(t);for(var i=0;i<r;++i){var a=this._telemetryInitializers[i];if(a)try{if(!1===a.apply(null,[e])){n=!0;break}}catch(o){t.diagLog().throwInternal(U.CRITICAL,de,"One of telemetry initializers failed, telemetry item will not be sent: "+st.getExceptionName(o),{exception:st.dump(o)},!0)}}n||this.processNext(e,t)},Vn.prototype.trackEvent=function(e,t){try{var n=bn.create(e,Et.dataType,Et.envelopeType,this.diagLog(),t);this.core.track(n)}catch(r){this.diagLog().throwInternal(U.WARNING,ae,"trackTrace failed, trace will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(t){this.diagLog().throwInternal(U.CRITICAL,Y,"startTrackEvent failed, event will not be collected: "+st.getExceptionName(t),{exception:st.dump(t)})}},Vn.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,undefined,t)}catch(r){this.diagLog().throwInternal(U.CRITICAL,$,"stopTrackEvent failed, event will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.trackTrace=function(e,t){try{var n=bn.create(e,hn.dataType,hn.envelopeType,this.diagLog(),t);this.core.track(n)}catch(r){this.diagLog().throwInternal(U.WARNING,ae,"trackTrace failed, trace will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.trackMetric=function(e,t){try{var n=bn.create(e,Jt.dataType,Jt.envelopeType,this.diagLog(),t);this.core.track(n)}catch(r){this.diagLog().throwInternal(U.CRITICAL,ne,"trackMetric failed, metric will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,c({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(r){this.diagLog().throwInternal(U.CRITICAL,re,"trackPageView failed, page view will not be collected: "+st.getExceptionName(r),{exception:st.dump(r)})}},Vn.prototype.sendPageViewInternal=function(e,t,n){var r=f();r&&(e.refUri=e.refUri===undefined?r.referrer:e.refUri);var i=bn.create(e,nn.dataType,nn.envelopeType,this.diagLog(),t,n);this.core.track(i),this._trackAjaxAttempts=0},Vn.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=bn.create(e,Sn.dataType,Sn.envelopeType,this.diagLog(),t,n);this.core.track(r)},Vn.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(n){this.diagLog().throwInternal(U.CRITICAL,re,"trackPageViewPerformance failed, page view will not be collected: "+st.getExceptionName(n),{exception:st.dump(n)})}},Vn.prototype.startTrackPage=function(e){try{var t=y();"string"!=typeof e&&(e=t&&t.document&&t.document.title||""),this._pageTracking.start(e)}catch(n){this.diagLog().throwInternal(U.CRITICAL,Z,"startTrackPage failed, page view may not be collected: "+st.getExceptionName(n),{exception:st.dump(n)})}},Vn.prototype.stopTrackPage=function(e,t,n,r){try{var i=y();"string"!=typeof e&&(e=i&&i.document&&i.document.title||""),"string"!=typeof t&&(t=i&&i.location&&i.location.href||""),this._pageTracking.stop(e,t,n,r),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(a){this.diagLog().throwInternal(U.CRITICAL,ee,"stopTrackPage failed, page view will not be collected: "+st.getExceptionName(a),{exception:st.dump(a)})}},Vn.prototype.sendExceptionInternal=function(e,t,n){var r=new At(this.diagLog(),e.exception||new Error(st.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),i=bn.create(r,At.dataType,At.envelopeType,this.diagLog(),t,n);this.core.track(i)},Vn.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(n){this.diagLog().throwInternal(U.CRITICAL,te,"trackException failed, exception will not be collected: "+st.getExceptionName(n),{exception:st.dump(n)})}},Vn.prototype._onerror=function(e){try{var t={url:e&&e.url||(f()||{}).URL,lineNumber:e.lineNumber,columnNumber:e.columnNumber,message:e.message};if(st.isCrossOriginError(e.message,e.url,e.lineNumber,e.columnNumber,e.error))this._sendCORSException(t.url);else{if(!st.isError(e.error)){var n="window.onerror@"+t.url+":"+e.lineNumber+":"+(e.columnNumber||0);e.error=new Error(e.message),e.error.stack=n}this.trackException({exception:e.error,severityLevel:_n.Error},t)}}catch(i){var r=e.error?e.error.name+", "+e.error.message:"null";this.diagLog().throwInternal(U.CRITICAL,K,"_onError threw exception while logging error, error will not be collected: "+st.getExceptionName(i),{exception:st.dump(i),errorString:r})}},Vn.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Vn.prototype.initialize=function(e,t,n,r){var o=this;if(!this.isInitialized()){if(A.isNullOrUndefined(t))throw Error("Error initializing");Rn.prototype.initialize.call(this,e,t,n,r),this.setInitialized(!1);var i=this._getTelCtx(),a=this.identifier;this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=i.getExtCfg(a);var s=Vn.getDefaultConfig();if(s!==undefined){for(var c in s)this.config[c]=i.getConfig(a,c,s[c]);if(this._globalconfig)for(var c in s)this._globalconfig[c]===undefined&&(this._globalconfig[c]=s[c])}this.config.isCookieUseDisabled&&st.disableCookies(),this.config.isStorageUseDisabled&&st.disableStorage();var l={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return o.config.accountId||e.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||e.appId}};this._pageViewPerformanceManager=new Mn(this.core),this._pageViewManager=new Pn(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new kn(this.diagLog(),function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(l),this._eventTracking=new Gn(this.diagLog(),"trackEvent"),this._eventTracking.action=function(e,t,n,r){(r=r||{})[On]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new Gn(this.diagLog(),"trackPageView"),this._pageTracking.action=function(e,t,n,r,i){A.isNullOrUndefined(r)&&(r={}),r[On]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)};var u,g,f=y(),p=I(),d=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented&&f){var h=f.onerror;f.onerror=function(e,t,n,r,i){var a=h&&h(e,t,n,r,i);return!0!==a&&d._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}if(!1===this.config.disableExceptionTracking&&!0===this.config.enableUnhandledPromiseRejectionTracking&&!this.config.autoUnhandledPromiseInstrumented&&f){var m=f.onunhandledrejection;f.onunhandledrejection=function(e){var t=m&&m.call(f,e);return!0!==t&&d._onerror({message:e.reason.toString(),error:e.reason instanceof Error?e.reason:new Error(e.reason.toString()),url:f.location.href,lineNumber:0,columnNumber:0}),t},this.config.autoUnhandledPromiseInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&p&&A.isFunction(p.pushState)&&A.isFunction(p.replaceState)&&f&&"undefined"!=typeof Event){var v=this;A.arrForEach(n,function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(o._properties=e)}),p.pushState=(g=p.pushState,function(){var e=g.apply(this,arguments);return f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"pushState")),f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"locationchange")),e}),p.replaceState=(u=p.replaceState,function(){var e=u.apply(this,arguments);return f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"replaceState")),f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"locationchange")),e}),f.addEventListener(v.config.namePrefix+"popstate",function(){f.dispatchEvent(st.createDomEvent(v.config.namePrefix+"locationchange"))}),f.addEventListener(v.config.namePrefix+"locationchange",function(){v._properties&&v._properties.context&&v._properties.context.telemetryTrace&&(v._properties.context.telemetryTrace.traceID=st.generateW3CId(),v._properties.context.telemetryTrace.name=f.location&&f.location.pathname||"_unknown_"),o._currUri&&(o._prevUri=o._currUri),o._currUri=f.location&&f.location.href||"",setTimeout(function(e){v.trackPageView({refUri:e,properties:{duration:0}})}.bind(o,o._prevUri),v.autoRoutePVDelay)})}this.setInitialized(!0)}},Vn.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)},Vn.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===ln.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.target&&0<=t.target.indexOf(r[n]))return!1}return!0})}},Vn.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Vn.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:undefined},n=bn.create(t,At.dataType,At.envelopeType,this.diagLog(),{url:e});this.core.track(n)},Vn.Version="2.4.0-beta",Vn);function Vn(){var e=Rn.call(this)||this;e.identifier="ApplicationInsightsAnalytics",e.priority=180,e.autoRoutePVDelay=500,e._trackAjaxAttempts=0;var t=y();return e._prevUri=t&&t.location&&t.location.href||"",e}var Gn=(jn.prototype.start=function(e){"undefined"!=typeof this._events[e]&&this._logger.throwInternal(U.WARNING,fe,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},jn.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(U.WARNING,pe,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=pt.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=undefined},jn);function jn(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=zn,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map |
{ | ||
"name": "@microsoft/applicationinsights-analytics-js", | ||
"version": "2.3.1", | ||
"version": "2.4.0-beta", | ||
"description": "Microsoft Application Insights Javascript SDK apis", | ||
@@ -21,3 +21,3 @@ "main": "dist/applicationinsights-analytics-js.js", | ||
"devDependencies": { | ||
"@microsoft/applicationinsights-properties-js": "2.3.1", | ||
"@microsoft/applicationinsights-properties-js": "2.4.0-beta", | ||
"typescript": "2.5.3", | ||
@@ -36,4 +36,4 @@ "rollup-plugin-node-resolve": "^3.4.0", | ||
"dependencies": { | ||
"@microsoft/applicationinsights-core-js": "2.3.1", | ||
"@microsoft/applicationinsights-common": "2.3.1", | ||
"@microsoft/applicationinsights-core-js": "2.4.0-beta", | ||
"@microsoft/applicationinsights-common": "2.4.0-beta", | ||
"tslib": "^1.9.3" | ||
@@ -40,0 +40,0 @@ }, |
@@ -11,5 +11,3 @@ /** | ||
IPageViewTelemetryInternal, IPageViewTelemetry, IPageViewPerformanceTelemetry, IPageViewPerformanceTelemetryInternal, | ||
ConfigurationManager, DateTimeUtils, | ||
IExceptionInternal, | ||
PropertiesPluginIdentifier | ||
DateTimeUtils, IExceptionInternal, PropertiesPluginIdentifier | ||
} from "@microsoft/applicationinsights-common"; | ||
@@ -19,4 +17,5 @@ | ||
IPlugin, IConfiguration, IAppInsightsCore, | ||
ITelemetryPlugin, CoreUtils, ITelemetryItem, | ||
BaseTelemetryPlugin, CoreUtils, ITelemetryItem, IProcessTelemetryContext, ITelemetryPluginChain, | ||
IDiagnosticLogger, LoggingSeverity, _InternalMessageId, ICustomProperties, | ||
getWindow, getDocument, getHistory | ||
} from "@microsoft/applicationinsights-core-js"; | ||
@@ -33,6 +32,10 @@ import { PageViewManager, IAppInsightsInternal } from "./Telemetry/PageViewManager"; | ||
declare global { | ||
interface Window { onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null; } | ||
} | ||
const durationProperty: string = "duration"; | ||
export class ApplicationInsights implements IAppInsights, ITelemetryPlugin, IAppInsightsInternal { | ||
public static Version = "2.3.1"; // Not currently used anywhere | ||
export class ApplicationInsights extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal { | ||
public static Version = "2.4.0-beta"; // Not currently used anywhere | ||
@@ -50,3 +53,4 @@ public static getDefaultConfig(config?: IConfig): IConfig { | ||
config.overridePageViewDuration = Util.stringToBoolOrDefault(config.overridePageViewDuration); | ||
config.enableUnhandledPromiseRejectionTracking = Util.stringToBoolOrDefault(config.enableUnhandledPromiseRejectionTracking); | ||
if (isNaN(config.samplingPercentage) || config.samplingPercentage <= 0 || config.samplingPercentage >= 100) { | ||
@@ -64,11 +68,9 @@ config.samplingPercentage = 100; | ||
} | ||
public initialize: (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) => void; | ||
public identifier: string = "ApplicationInsightsAnalytics"; // do not change name or priority | ||
public priority: number = 180; // take from reserved priority range 100- 200 | ||
public config: IConfig; | ||
public core: IAppInsightsCore; | ||
public queue: Array<() => void>; | ||
public autoRoutePVDelay = 500; // ms; Time to wait after a route change before triggering a pageview to allow DOM changes to take place | ||
protected _nextPlugin: ITelemetryPlugin; | ||
protected _logger: IDiagnosticLogger; // Initialized by Core | ||
protected _telemetryInitializers: Array<(envelope: ITelemetryItem) => boolean | void>; // Internal telemetry initializers. | ||
@@ -79,3 +81,2 @@ protected _pageViewManager: PageViewManager; | ||
private _isInitialized: boolean = false; | ||
private _globalconfig: IConfiguration; | ||
@@ -93,13 +94,15 @@ private _eventTracking: Timing; | ||
// array with max length of 2 that store current url and previous url for SPA page route change trackPageview use. | ||
private _prevUri: string = typeof window === "object" && window.location && window.location.href || ""; | ||
private _prevUri: string; // Assigned in the constructor | ||
private _currUri: string; | ||
constructor() { | ||
this.initialize = this._initialize.bind(this); | ||
super(); | ||
let _window = getWindow(); | ||
this._prevUri = _window && _window.location && _window.location.href || ""; | ||
} | ||
public processTelemetry(env: ITelemetryItem) { | ||
public processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext) { | ||
let doNotSendItem = false; | ||
const telemetryInitializersCount = this._telemetryInitializers.length; | ||
itemCtx = this._getTelCtx(itemCtx); | ||
for (let i = 0; i < telemetryInitializersCount; ++i) { | ||
@@ -116,3 +119,3 @@ const telemetryInitializer = this._telemetryInitializers[i]; | ||
// doNotSendItem = true; | ||
this._logger.throwInternal( | ||
itemCtx.diagLog().throwInternal( | ||
LoggingSeverity.CRITICAL, _InternalMessageId.TelemetryInitializerFailed, "One of telemetry initializers failed, telemetry item will not be sent: " + Util.getExceptionName(e), | ||
@@ -124,11 +127,7 @@ { exception: Util.dump(e) }, true); | ||
if (!doNotSendItem && !CoreUtils.isNullOrUndefined(this._nextPlugin)) { | ||
this._nextPlugin.processTelemetry(env); | ||
if (!doNotSendItem) { | ||
this.processNext(env, itemCtx); | ||
} | ||
} | ||
public setNextPlugin(next: ITelemetryPlugin) { | ||
this._nextPlugin = next; | ||
} | ||
public trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void { | ||
@@ -140,3 +139,3 @@ try { | ||
EventTelemetry.envelopeType, | ||
this._logger, | ||
this.diagLog(), | ||
customProperties | ||
@@ -147,3 +146,3 @@ ); | ||
} catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.WARNING, | ||
this.diagLog().throwInternal(LoggingSeverity.WARNING, | ||
_InternalMessageId.TrackTraceFailed, | ||
@@ -163,3 +162,3 @@ "trackTrace failed, trace will not be collected: " + Util.getExceptionName(e), | ||
} catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, | ||
_InternalMessageId.StartTrackEventFailed, | ||
@@ -181,3 +180,3 @@ "startTrackEvent failed, event will not be collected: " + Util.getExceptionName(e), | ||
} catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, | ||
_InternalMessageId.StopTrackEventFailed, | ||
@@ -201,3 +200,3 @@ "stopTrackEvent failed, event will not be collected: " + Util.getExceptionName(e), | ||
Trace.envelopeType, | ||
this._logger, | ||
this.diagLog(), | ||
customProperties); | ||
@@ -207,3 +206,3 @@ | ||
} catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.WARNING, | ||
this.diagLog().throwInternal(LoggingSeverity.WARNING, | ||
_InternalMessageId.TrackTraceFailed, | ||
@@ -232,3 +231,3 @@ "trackTrace failed, trace will not be collected: " + Util.getExceptionName(e), | ||
Metric.envelopeType, | ||
this._logger, | ||
this.diagLog(), | ||
customProperties | ||
@@ -239,3 +238,3 @@ ); | ||
} catch (e) { | ||
this._logger.throwInternal(LoggingSeverity.CRITICAL, | ||
this.diagLog().throwInternal(LoggingSeverity.CRITICAL, | ||
_InternalMessageId.TrackMetricFailed, | ||
@@ -262,3 +261,3 @@ "trackMetric failed, metric will not be collected: " + Util.getExceptionName(e), | ||
} catch (e) { | ||
this._logger.throwInternal( | ||
this.diagLog().throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -278,4 +277,5 @@ _InternalMessageId.TrackPVFailed, | ||
public sendPageViewInternal(pageView: IPageViewTelemetryInternal, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) { | ||
if (typeof document !== "undefined") { | ||
pageView.refUri = pageView.refUri === undefined ? document.referrer : pageView.refUri; | ||
let _document = getDocument(); | ||
if (_document) { | ||
pageView.refUri = pageView.refUri === undefined ? _document.referrer : pageView.refUri; | ||
} | ||
@@ -287,3 +287,3 @@ | ||
PageView.envelopeType, | ||
this._logger, | ||
this.diagLog(), | ||
properties, | ||
@@ -308,3 +308,3 @@ systemProperties); | ||
PageViewPerformance.envelopeType, | ||
this._logger, | ||
this.diagLog(), | ||
properties, | ||
@@ -326,3 +326,3 @@ systemProperties); | ||
} catch (e) { | ||
this._logger.throwInternal( | ||
this.diagLog().throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -343,4 +343,6 @@ _InternalMessageId.TrackPVFailed, | ||
try { | ||
let _window = getWindow(); | ||
if (typeof name !== "string") { | ||
name = typeof window === "object" && window.document && window.document.title || ""; | ||
name = _window && _window.document && _window.document.title || ""; | ||
} | ||
@@ -350,3 +352,3 @@ | ||
} catch (e) { | ||
this._logger.throwInternal( | ||
this.diagLog().throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -370,8 +372,10 @@ _InternalMessageId.StartTrackFailed, | ||
try { | ||
let _window = getWindow(); | ||
if (typeof name !== "string") { | ||
name = typeof window === "object" && window.document && window.document.title || ""; | ||
name = _window && _window.document && _window.document.title || ""; | ||
} | ||
if (typeof url !== "string") { | ||
url = typeof window === "object" && window.location && window.location.href || ""; | ||
url = _window && _window.location && _window.location.href || ""; | ||
} | ||
@@ -385,3 +389,3 @@ | ||
} catch (e) { | ||
this._logger.throwInternal( | ||
this.diagLog().throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -402,3 +406,3 @@ _InternalMessageId.StopTrackFailed, | ||
const exceptionPartB = new Exception( | ||
this._logger, | ||
this.diagLog(), | ||
exception.exception || new Error(Util.NotSpecified), | ||
@@ -415,3 +419,3 @@ exception.properties, | ||
Exception.envelopeType, | ||
this._logger, | ||
this.diagLog(), | ||
customProperties, | ||
@@ -436,3 +440,3 @@ systemProperties | ||
} catch (e) { | ||
this._logger.throwInternal( | ||
this.diagLog().throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -453,3 +457,3 @@ _InternalMessageId.TrackExceptionFailed, | ||
const properties = { | ||
url: (exception && exception.url) || document.URL, | ||
url: (exception && exception.url) || (getDocument()||{} as any).URL, | ||
lineNumber: exception.lineNumber, | ||
@@ -475,3 +479,3 @@ columnNumber: exception.columnNumber, | ||
this._logger.throwInternal( | ||
this.diagLog().throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -490,5 +494,4 @@ _InternalMessageId.ExceptionWhileLoggingError, | ||
private _initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[]) { | ||
if (this._isInitialized) { | ||
public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?:ITelemetryPluginChain) { | ||
if (this.isInitialized()) { | ||
return; | ||
@@ -501,4 +504,7 @@ } | ||
this.core = core; | ||
this._logger = core.logger; | ||
super.initialize(config, core, extensions, pluginChain); | ||
this.setInitialized(false); // resetting the initialized state, just in case the following fails | ||
let ctx = this._getTelCtx(); | ||
let identifier = this.identifier; | ||
this._globalconfig = { | ||
@@ -509,3 +515,3 @@ instrumentationKey: config.instrumentationKey, | ||
this.config = config.extensionConfig && config.extensionConfig[this.identifier] ? config.extensionConfig[this.identifier] : {} as IConfig; | ||
this.config = ctx.getExtCfg<IConfig>(identifier); | ||
@@ -517,3 +523,3 @@ // load default values if specified | ||
// for each unspecified field, set the default value | ||
this.config[field] = ConfigurationManager.getConfig(config, field, this.identifier, defaults[field]); | ||
this.config[field] = ctx.getConfig(identifier, field, defaults[field]); | ||
} | ||
@@ -554,3 +560,3 @@ | ||
this._pageViewManager = new PageViewManager(this, this.config.overridePageViewDuration, this.core, this._pageViewPerformanceManager); | ||
this._pageVisitTimeManager = new PageVisitTimeManager(this._logger, (pageName, pageUrl, pageVisitTime) => this.trackPageVisitTime(pageName, pageUrl, pageVisitTime)) | ||
this._pageVisitTimeManager = new PageVisitTimeManager(this.diagLog(), (pageName, pageUrl, pageVisitTime) => this.trackPageVisitTime(pageName, pageUrl, pageVisitTime)) | ||
@@ -561,3 +567,3 @@ this._telemetryInitializers = []; | ||
this._eventTracking = new Timing(this._logger, "trackEvent"); | ||
this._eventTracking = new Timing(this.diagLog(), "trackEvent"); | ||
this._eventTracking.action = | ||
@@ -574,3 +580,3 @@ (name?: string, url?: string, duration?: number, properties?: { [key: string]: string }) => { | ||
// initialize page view timing | ||
this._pageTracking = new Timing(this._logger, "trackPageView"); | ||
this._pageTracking = new Timing(this.diagLog(), "trackPageView"); | ||
this._pageTracking.action = (name, url, duration, properties, measurements) => { | ||
@@ -594,9 +600,12 @@ | ||
let _window = getWindow(); | ||
let _history = getHistory(); | ||
const instance: IAppInsights = this; | ||
if (this.config.disableExceptionTracking === false && | ||
!this.config.autoExceptionInstrumented && typeof window === "object") { | ||
!this.config.autoExceptionInstrumented && _window) { | ||
// We want to enable exception auto collection and it has not been done so yet | ||
const onerror = "onerror"; | ||
const originalOnError = window[onerror]; | ||
window.onerror = (message, url, lineNumber, columnNumber, error) => { | ||
const originalOnError = _window[onerror]; | ||
_window.onerror = (message, url, lineNumber, columnNumber, error) => { | ||
const handled = originalOnError && (originalOnError(message, url, lineNumber, columnNumber, error) as any); | ||
@@ -618,2 +627,25 @@ if (handled !== true) { // handled could be typeof function | ||
if (this.config.disableExceptionTracking === false && | ||
this.config.enableUnhandledPromiseRejectionTracking === true && | ||
!this.config.autoUnhandledPromiseInstrumented && _window) { | ||
// We want to enable exception auto collection and it has not been done so yet | ||
const onunhandledrejection = "onunhandledrejection"; | ||
const originalOnUnhandledRejection = _window[onunhandledrejection]; | ||
_window.onunhandledrejection = (error: PromiseRejectionEvent) => { | ||
const handled = originalOnUnhandledRejection && (originalOnUnhandledRejection.call(_window, error) as any); | ||
if (handled !== true) { // handled could be typeof function | ||
instance._onerror({ | ||
message: error.reason.toString(), | ||
error: error.reason instanceof Error ? error.reason : new Error(error.reason.toString()), | ||
url: _window.location.href, | ||
lineNumber: 0, | ||
columnNumber: 0 | ||
}); | ||
} | ||
return handled; | ||
} | ||
this.config.autoUnhandledPromiseInstrumented = true; | ||
} | ||
/** | ||
@@ -623,4 +655,4 @@ * Create a custom "locationchange" event which is triggered each time the history object is changed | ||
if (this.config.enableAutoRouteTracking === true | ||
&& typeof history === "object" && typeof history.pushState === "function" && typeof history.replaceState === "function" | ||
&& typeof window === "object" | ||
&& _history && CoreUtils.isFunction(_history.pushState) && CoreUtils.isFunction(_history.replaceState) | ||
&& _window | ||
&& typeof Event !== "undefined") { | ||
@@ -635,30 +667,30 @@ const _self = this; | ||
history.pushState = ( f => function pushState() { | ||
_history.pushState = ( f => function pushState() { | ||
const ret = f.apply(this, arguments); | ||
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "pushState")); | ||
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange")); | ||
_window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "pushState")); | ||
_window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange")); | ||
return ret; | ||
})(history.pushState); | ||
})(_history.pushState); | ||
history.replaceState = ( f => function replaceState(){ | ||
_history.replaceState = ( f => function replaceState(){ | ||
const ret = f.apply(this, arguments); | ||
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "replaceState")); | ||
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange")); | ||
_window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "replaceState")); | ||
_window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange")); | ||
return ret; | ||
})(history.replaceState); | ||
})(_history.replaceState); | ||
window.addEventListener(_self.config.namePrefix + "popstate",()=>{ | ||
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange")); | ||
_window.addEventListener(_self.config.namePrefix + "popstate",()=>{ | ||
_window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange")); | ||
}); | ||
window.addEventListener(_self.config.namePrefix + "locationchange", () => { | ||
_window.addEventListener(_self.config.namePrefix + "locationchange", () => { | ||
if (_self._properties && _self._properties.context && _self._properties.context.telemetryTrace) { | ||
_self._properties.context.telemetryTrace.traceID = Util.generateW3CId(); | ||
_self._properties.context.telemetryTrace.name = window.location && window.location.pathname || "_unknown_"; | ||
_self._properties.context.telemetryTrace.name = _window.location && _window.location.pathname || "_unknown_"; | ||
} | ||
if (this._currUri) { | ||
this._prevUri = this._currUri; | ||
this._currUri = window.location && window.location.href || ""; | ||
this._currUri = _window.location && _window.location.href || ""; | ||
} else { | ||
this._currUri = window.location && window.location.href || ""; | ||
this._currUri = _window.location && _window.location.href || ""; | ||
} | ||
@@ -672,3 +704,3 @@ setTimeout(((uri: string) => { | ||
this._isInitialized = true; | ||
this.setInitialized(true); | ||
} | ||
@@ -730,3 +762,3 @@ | ||
Exception.envelopeType, | ||
this._logger, | ||
this.diagLog(), | ||
{ url } | ||
@@ -733,0 +765,0 @@ ); |
@@ -9,3 +9,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
IAppInsightsCore, CoreUtils, IDiagnosticLogger, LoggingSeverity, | ||
_InternalMessageId, IChannelControls | ||
_InternalMessageId, IChannelControls, getWindow | ||
} from '@microsoft/applicationinsights-core-js'; | ||
@@ -59,5 +59,8 @@ import { PageViewPerformanceManager } from './PageViewPerformanceManager'; | ||
public trackPageView(pageView: IPageViewTelemetry, customProperties?: { [key: string]: any }) { | ||
let _window = getWindow(); | ||
let name = pageView.name; | ||
if (CoreUtils.isNullOrUndefined(name) || typeof name !== "string") { | ||
name = pageView.name = typeof window === "object" && window.document && window.document.title || ""; | ||
name = pageView.name = _window && _window.document && _window.document.title || ""; | ||
} | ||
@@ -67,3 +70,3 @@ | ||
if (CoreUtils.isNullOrUndefined(uri) || typeof uri !== "string") { | ||
uri = pageView.uri = typeof window === "object" && window.location && window.location.href || ""; | ||
uri = pageView.uri = _window && _window.location && _window.location.href || ""; | ||
} | ||
@@ -70,0 +73,0 @@ |
@@ -9,3 +9,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
IAppInsightsCore, IDiagnosticLogger, LoggingSeverity, | ||
_InternalMessageId | ||
_InternalMessageId, getNavigator, getWindow | ||
} from '@microsoft/applicationinsights-core-js'; | ||
@@ -114,3 +114,4 @@ | ||
public isPerformanceNavigationTimingSupported() { | ||
return typeof window !== "undefined" && window.performance && window.performance.getEntriesByType && window.performance.getEntriesByType("navigation").length > 0; | ||
let _window = getWindow(); | ||
return _window && _window.performance && _window.performance.getEntriesByType && _window.performance.getEntriesByType("navigation").length > 0; | ||
} | ||
@@ -122,3 +123,4 @@ | ||
public isPerformanceTimingSupported() { | ||
return typeof window !== "undefined" && window.performance && window.performance.timing; | ||
let _window = getWindow(); | ||
return typeof _window !== "undefined" && _window.performance && _window.performance.timing; | ||
} | ||
@@ -131,5 +133,6 @@ | ||
public isPerformanceTimingDataReady() { | ||
const timing = typeof window === "object" && window.performance.timing; | ||
let _window = getWindow(); | ||
const timing = _window && _window.performance.timing; | ||
return typeof window === "object" | ||
return _window | ||
&& timing.domainLookupStart > 0 | ||
@@ -149,5 +152,6 @@ && timing.navigationStart > 0 | ||
public shouldCollectDuration(...durations: number[]): boolean { | ||
var _navigator = getNavigator() || {} as any; | ||
// a full list of Google crawlers user agent strings - https://support.google.com/webmasters/answer/1061943?hl=en | ||
const botAgentNames = ['googlebot', 'adsbot-google', 'apis-google', 'mediapartners-google']; | ||
const userAgent = navigator.userAgent; | ||
const userAgent = _navigator.userAgent; | ||
let isGoogleBot = false; | ||
@@ -154,0 +158,0 @@ |
@@ -5,3 +5,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
import { Util } from '@microsoft/applicationinsights-common'; | ||
import { IDiagnosticLogger } from '@microsoft/applicationinsights-core-js'; | ||
import { IDiagnosticLogger, hasJSON, getJSON } from '@microsoft/applicationinsights-core-js'; | ||
@@ -77,3 +77,3 @@ /** | ||
const currPageVisitData = new PageVisitData(pageName, pageUrl); | ||
const currPageVisitDataStr = JSON.stringify(currPageVisitData); | ||
const currPageVisitDataStr = getJSON().stringify(currPageVisitData); | ||
Util.setSessionStorage(this._logger, this.prevPageVisitDataKeyName, currPageVisitDataStr); | ||
@@ -100,6 +100,6 @@ } | ||
const pageVisitDataJsonStr = Util.getSessionStorage(this._logger, this.prevPageVisitDataKeyName); | ||
if (pageVisitDataJsonStr) { | ||
if (pageVisitDataJsonStr && hasJSON()) { | ||
// if previous page data exists, set end time of visit | ||
const prevPageVisitData: PageVisitData = JSON.parse(pageVisitDataJsonStr); | ||
const prevPageVisitData: PageVisitData = getJSON().parse(pageVisitDataJsonStr); | ||
prevPageVisitData.pageVisitTime = pageVisitEndTime - prevPageVisitData.pageVisitStartTime; | ||
@@ -106,0 +106,0 @@ |
@@ -6,18 +6,19 @@ /** | ||
import { IConfig, IAppInsights, IEventTelemetry, IExceptionTelemetry, ITraceTelemetry, IMetricTelemetry, IAutoExceptionTelemetry, IPageViewTelemetryInternal, IPageViewTelemetry, IPageViewPerformanceTelemetry, IPageViewPerformanceTelemetryInternal } from "@microsoft/applicationinsights-common"; | ||
import { IPlugin, IConfiguration, IAppInsightsCore, ITelemetryPlugin, ITelemetryItem, IDiagnosticLogger, ICustomProperties } from "@microsoft/applicationinsights-core-js"; | ||
import { IPlugin, IConfiguration, IAppInsightsCore, BaseTelemetryPlugin, ITelemetryItem, IProcessTelemetryContext, ITelemetryPluginChain, ICustomProperties } from "@microsoft/applicationinsights-core-js"; | ||
import { PageViewManager, IAppInsightsInternal } from "./Telemetry/PageViewManager"; | ||
import { PageVisitTimeManager } from "./Telemetry/PageVisitTimeManager"; | ||
import { PageViewPerformanceManager } from './Telemetry/PageViewPerformanceManager'; | ||
export declare class ApplicationInsights implements IAppInsights, ITelemetryPlugin, IAppInsightsInternal { | ||
declare global { | ||
interface Window { | ||
onunhandledrejection: ((this: Window, ev: PromiseRejectionEvent) => any) | null; | ||
} | ||
} | ||
export declare class ApplicationInsights extends BaseTelemetryPlugin implements IAppInsights, IAppInsightsInternal { | ||
static Version: string; | ||
static getDefaultConfig(config?: IConfig): IConfig; | ||
initialize: (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) => void; | ||
identifier: string; | ||
priority: number; | ||
config: IConfig; | ||
core: IAppInsightsCore; | ||
queue: Array<() => void>; | ||
autoRoutePVDelay: number; | ||
protected _nextPlugin: ITelemetryPlugin; | ||
protected _logger: IDiagnosticLogger; | ||
protected _telemetryInitializers: Array<(envelope: ITelemetryItem) => boolean | void>; | ||
@@ -27,3 +28,2 @@ protected _pageViewManager: PageViewManager; | ||
protected _pageVisitTimeManager: PageVisitTimeManager; | ||
private _isInitialized; | ||
private _globalconfig; | ||
@@ -37,4 +37,3 @@ private _eventTracking; | ||
constructor(); | ||
processTelemetry(env: ITelemetryItem): void; | ||
setNextPlugin(next: ITelemetryPlugin): void; | ||
processTelemetry(env: ITelemetryItem, itemCtx?: IProcessTelemetryContext): void; | ||
trackEvent(event: IEventTelemetry, customProperties?: ICustomProperties): void; | ||
@@ -158,3 +157,3 @@ /** | ||
addTelemetryInitializer(telemetryInitializer: (item: ITelemetryItem) => boolean | void): void; | ||
private _initialize(config, core, extensions); | ||
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[], pluginChain?: ITelemetryPluginChain): void; | ||
/** | ||
@@ -161,0 +160,0 @@ * Log a page visit time |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2033185
10869
2
+ Added@microsoft/applicationinsights-common@2.4.0-beta(transitive)
+ Added@microsoft/applicationinsights-core-js@2.4.0-beta(transitive)
- Removed@microsoft/applicationinsights-common@2.3.1(transitive)
- Removed@microsoft/applicationinsights-core-js@2.3.1(transitive)