Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/applicationinsights-analytics-js

Package Overview
Dependencies
Maintainers
5
Versions
590
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-analytics-js - npm Package Compare versions

Comparing version 1.0.0-beta.4 to 1.0.0-beta.5

4

browser/applicationinsights-analytics-js.min.js
/*!
* Application Insights JavaScript SDK - Web Analytics, 1.0.0-beta.4
* Application Insights JavaScript SDK - Web Analytics, 1.0.0-beta.5
* 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.aianalytics={})}(this,function(e){"use strict";var i,t,h,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var m,r,l=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.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)})},e}(),o=/[xy]/g;(r=m||(m={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var a=1,c=2,u=3,f=4,g=5,p=6,v=8,y=10,s=11,d=25,w=31,S=32,I=35,_=36,N=37,T=38,E=39,D=45,x=52,b=56,k=57,A=61,P=62,C=63,M=64,R=66,U=68,L=69,z=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=z}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var o=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);o.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<i.length;t++){var a=i[t];a.priority>z&&e.push(a)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),O=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var o=0,a=i;void 0!==n[a];)o++,a=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(o);i=a}return i},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(m.WARNING,k,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(m.WARNING,A,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,R)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(m.WARNING,b,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(m.WARNING,x,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var i=s.sanitizeString(e,t[r],s.MAX_PROPERTY_LENGTH);n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,L).toString():t},s.sanitizeInput=function(e,t,n,r){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),G=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,g,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(m.WARNING,U,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",o="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(o=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+o)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),o=0;o<i.length;o++){var a=i[o];if((a=s.trim(a))&&0===a.indexOf(r)){n=a.substring(r.length,i[o].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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"}},s.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},s.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,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,r=r.length<2?"0"+r:r,(0<o?o+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),V=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),q=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,o;if(t&&0<t.length){var a=V.parseUrl(t);if(i=a.host,null!=a.pathname)"/"!==(r=0===a.pathname.length?"/":a.pathname).charAt(0)&&(r="/"+r),o=O.sanitizeString(e,n?n+" "+r:r);else o=O.sanitizeString(e,t)}else o=i=r;return{target:i,name:o}},e}(),B=(function(){function e(){}e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||(n=t-e),n}}(),function(e,t){return(B=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 j(e,t){function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X,H,W=function(e){function t(){return e.call(this)||this}return j(t,e),t}(function(){}),K=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=O.sanitizeString(e,n)||G.NotSpecified,r.data=t,r.time=G.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}j(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),F=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(K),Q=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=O.sanitizeString(e,t)||G.NotSpecified,i.properties=O.sanitizeProperties(e,n),i.measurements=O.sanitizeMeasurements(e,r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(F),Y=function(){},J=function(){this.hasFullStack=!0,this.parsedStack=[]},$=function(a){function e(e,t,n,r,i){var o=a.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},o.properties=O.sanitizeProperties(e,n),o.measurements=O.sanitizeMeasurements(e,r),o.exceptions=[new Z(e,t)],i&&(o.severityLevel=i),o}return j(e,a),e.CreateSimpleException=function(e,t,n,r,i,o){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return j(e,t),e}(K)),Z=function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},n.typeName=O.sanitizeString(e,t.name)||G.NotSpecified,n.message=O.sanitizeMessage(e,t.message)||G.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=O.sanitizeException(e,r),n.hasFullStack=G.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return j(e,i),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,o=0;o<=n.length;o++){var a=n[o];if(ee.regex.test(a)){var s=new ee(n[o],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,f=c,g=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=g-f+1;t.splice(f,p);break}f=c,g=u,c++,u--}}return t},e}(J),ee=function(i){function o(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},n.level=t,n.method="<no_method>",n.assembly=G.trim(e);var r=e.match(o.regex);return r&&5<=r.length&&(n.method=G.trim(r[2])||n.method,n.fileName=G.trim(r[4]),n.line=parseInt(r[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return j(o,i),o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(Y),te=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return j(e,t),e}(K);(H=X||(X={}))[H.Measurement=0]="Measurement",H[H.Aggregation=1]="Aggregation";var ne,re,ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return j(e,t),e}(function(){this.kind=X.Measurement}),oe=function(u){function e(e,t,n,r,i,o,a){var s=u.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new ie;return c.count=0<r?r:void 0,c.max=isNaN(o)||null===o?void 0:o,c.min=isNaN(i)||null===i?void 0:i,c.name=O.sanitizeString(e,t)||G.NotSpecified,c.value=n,s.metrics=[c],s.properties=O.sanitizeProperties(e,a),s}return j(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(te),ae=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(F),se=function(c){function e(e,t,n,r,i,o,a){var s=c.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=O.sanitizeId(e,a),s.url=O.sanitizeUrl(e,n),s.name=O.sanitizeString(e,t)||G.NotSpecified,isNaN(r)||(s.duration=G.msToTimeSpan(r)),s.properties=O.sanitizeProperties(e,i),s.measurements=O.sanitizeMeasurements(e,o),s}return j(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ae),ce=function(g){function e(e,t,n,r,i,o,a,s,c,u){var l=g.call(this)||this;l.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},l.id=t,l.duration=G.msToTimeSpan(i),l.success=o,l.resultCode=a+"",l.type="Ajax",l.data=O.sanitizeUrl(e,r);var f=q.ParseDependencyPath(e,n,s,r);return l.target=f.target,l.name=f.name,l.properties=O.sanitizeProperties(e,c),l.measurements=O.sanitizeMeasurements(e,u),l}return j(e,g),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return j(e,t),e}(K)),ue=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||G.NotSpecified,i.message=O.sanitizeMessage(e,t),i.properties=O.sanitizeProperties(e,n),r&&(i.severityLevel=r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return j(e,t),e}(K)),le=function(p){function d(e,t,n,r,i,o){var a=p.call(this)||this;a.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},a.isValid=!1;var s=d.getPerformanceTiming();if(s){var c=d.getDuration(s.navigationStart,s.loadEventEnd),u=d.getDuration(s.navigationStart,s.connectEnd),l=d.getDuration(s.requestStart,s.responseStart),f=d.getDuration(s.responseStart,s.responseEnd),g=d.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(m.WARNING,y,"error calculating page view performance.",{total:c,network:u,request:l,response:f,dom:g}):d.shouldCollectDuration(c,u,l,f,g)?c<Math.floor(u)+Math.floor(l)+Math.floor(f)+Math.floor(g)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:f,dom:g}):(a.durationMs=c,a.perfTotal=a.duration=G.msToTimeSpan(c),a.networkConnect=G.msToTimeSpan(u),a.sentRequest=G.msToTimeSpan(l),a.receivedResponse=G.msToTimeSpan(f),a.domProcessing=G.msToTimeSpan(g),a.isValid=!0):e.throwInternal(m.WARNING,D,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:f,dom:g})}return a.url=O.sanitizeUrl(e,n),a.name=O.sanitizeString(e,t)||G.NotSpecified,a.properties=O.sanitizeProperties(e,i),a.measurements=O.sanitizeMeasurements(e,o),a}return j(d,p),d.prototype.getIsValid=function(){return this.isValid},d.prototype.getDurationMs=function(){return this.durationMs},d.getPerformanceTiming=function(){return d.isPerformanceTimingSupported()?window.performance.timing:null},d.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},d.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},d.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},d.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=navigator.userAgent,i=!1;if(r)for(var o=0;o<n.length;o++)i=i||-1!==r.toLowerCase().indexOf(n[o]);if(i)return!1;for(var a=0;a<e.length;a++)if(e[a]>=d.MAX_DURATION_ALLOWED)return!1;return!0},d.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",d.dataType="PageviewPerformanceData",d.MAX_DURATION_ALLOWED=36e5,d}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(ae));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}j(e,r)}(W);(re=ne||(ne={}))[re.Verbose=0]="Verbose",re[re.Information=1]="Information",re[re.Warning=2]="Warning",re[re.Error=3]="Error",re[re.Critical=4]="Critical";var fe=function(){function e(){}return e.create=function(e,t,n,r,i,o){if(n=O.sanitizeString(r,n)||G.NotSpecified,l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||l.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var a={name:n,timestamp:new Date,instrumentationKey:"",ctx:o||{},tags:[],data:{},baseType:t,baseData:e};if(!l.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(a.data[s]=i[s]);return a},e}(),ge=function(){function e(e,t,n){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}return e.prototype.trackPageView=function(t,n){var r=this,i=t.name;(l.isNullOrUndefined(i)||"string"!=typeof i)&&(t.name=window.document&&window.document.title||"");var o=t.uri;if((l.isNullOrUndefined(o)||"string"!=typeof o)&&(t.uri=window.location&&window.location.href||""),!le.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(m.WARNING,d,"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 a=!1,s=void 0,c=le.getPerformanceTiming().navigationStart;s=le.getDuration(c,+new Date),le.shouldCollectDuration(s)||(s=void 0);var e=void 0;l.isNullOrUndefined(n)||l.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&(n||(n={}),n.duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),a=!0);n||(n={});var u=setInterval(function(){try{if(le.isPerformanceTimingDataReady()){clearInterval(u);var e=new le(r._logger,i,o,null);e.getIsValid()||a?(a||(n.duration=e.getDurationMs(),r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<le.getDuration(c,+new Date)&&(clearInterval(u),a||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(m.CRITICAL,T,"trackPageView failed on page load calculation: "+G.getExceptionName(e),{exception:G.dump(e)})}},100)},e}(),pe=function(){function u(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return u.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=G.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=G.stringToBoolOrDefault(e.autoTrackPageVisitTime),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=G.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=G.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=G.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e},u.prototype.processTelemetry=function(e){var t=!1;try{for(var n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i&&!1===i.apply(null,[e])){t=!0;break}}}catch(e){t=!0,this._logger.throwInternal(m.CRITICAL,M,"One of telemetry initializers failed, telemetry item will not be sent: "+G.getExceptionName(e),{exception:G.dump(e)},!0)}t||l.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype.trackEvent=function(e,t){try{var n=fe.create(e,Q.dataType,Q.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackTrace=function(e,t){try{var n=fe.create(e,ue.dataType,ue.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackMetric=function(e,t){try{var n=fe.create(e,oe.dataType,oe.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,_,"trackMetric failed, metric will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackPageView=function(e,t){try{this._pageViewManager.trackPageView(e,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e.name,e.uri)}catch(e){this._logger.throwInternal(m.CRITICAL,N,"trackPageView failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.sendPageViewInternal=function(e,t,n){var r=fe.create(e,se.dataType,se.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},u.prototype.sendPageViewPerformanceInternal=function(e,t){var n=fe.create(e,le.dataType,le.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)},u.prototype.trackPageViewPerformance=function(e,t){var n=new le(this.core.logger,e.name,e.url,void 0,t);this.sendPageViewPerformanceInternal(n,t)},u.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(m.CRITICAL,w,"startTrackPage failed, page view may not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.stopTrackPage=function(e,t,n){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(m.CRITICAL,S,"stopTrackPage failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackException=function(e,t){try{var n=fe.create(e,$.dataType,$.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,I,"trackException failed, exception will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(G.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!G.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({error:t.error,severityLevel:ne.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(m.CRITICAL,s,"_onError threw exception while logging error, error will not be collected: "+G.getExceptionName(e),{exception:G.dump(e),errorString:r})}},u.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(l.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 r=u.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=this.config[i]||e[i]||r[i];if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&G.disableCookies(),this.config.isStorageUseDisabled&&G.disableStorage();var a={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}};if(this._pageViewManager=new ge(this,this.config.overridePageViewDuration,this.core),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._pageTracking=new de(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r){var i={name:e,uri:t};l.isNullOrUndefined(r)&&(r={}),r.duration=n,o.sendPageViewInternal(i,r)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var o=s&&s(e,t,n,r,i);return!0!==o&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),o},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},u.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===ce.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.absoluteUrl&&0<=t.absoluteUrl.indexOf(r[n]))return!1}return!0})}},u.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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:void 0},n=fe.create(t,$.dataType,$.envelopeType,this._logger,{url:e});this.core.track(n)},u.prototype._setTelemetryNameAndIKey=function(e){e.instrumentationKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},u.Version="2.0.1-beta",u}(),de=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(m.WARNING,P,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n){var r=this._events[e];if(isNaN(r))this._logger.throwInternal(m.WARNING,C,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var i=+new Date,o=le.getDuration(r,i);this.action(e,t,o,n)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=pe,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.aianalytics={})}(this,function(e){"use strict";var i,t,h,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var m,r,l=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.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)})},e}(),o=/[xy]/g;(r=m||(m={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var a=1,c=2,u=3,f=4,g=5,p=6,v=8,y=10,s=11,d=25,w=31,S=32,I=35,_=36,N=37,T=38,E=39,D=45,x=52,b=56,k=57,A=61,C=62,P=63,M=64,R=66,U=68,L=69,z=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=z}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var o=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);o.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<i.length;t++){var a=i[t];a.priority>z&&e.push(a)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),O=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var o=0,a=i;void 0!==n[a];)o++,a=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(o);i=a}return i},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(m.WARNING,k,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(m.WARNING,A,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,R)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(m.WARNING,b,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(m.WARNING,x,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var i=s.sanitizeString(e,t[r],s.MAX_PROPERTY_LENGTH);n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,L).toString():t},s.sanitizeInput=function(e,t,n,r){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),G=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,g,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(m.WARNING,U,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",o="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(o=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+o)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),o=0;o<i.length;o++){var a=i[o];if((a=s.trim(a))&&0===a.indexOf(r)){n=a.substring(r.length,i[o].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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"}},s.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},s.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,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,r=r.length<2?"0"+r:r,(0<o?o+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),V=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),q=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,o;if(t&&0<t.length){var a=V.parseUrl(t);if(i=a.host,null!=a.pathname)"/"!==(r=0===a.pathname.length?"/":a.pathname).charAt(0)&&(r="/"+r),o=O.sanitizeString(e,n?n+" "+r:r);else o=O.sanitizeString(e,t)}else o=i=r;return{target:i,name:o}},e}(),B=(function(){function e(){}e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||(n=t-e),n}}(),function(e,t){return(B=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 j(e,t){function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X,H,W=function(e){function t(){return e.call(this)||this}return j(t,e),t}(function(){}),K=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=O.sanitizeString(e,n)||G.NotSpecified,r.data=t,r.time=G.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}j(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),F=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(K),Q=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=O.sanitizeString(e,t)||G.NotSpecified,i.properties=O.sanitizeProperties(e,n),i.measurements=O.sanitizeMeasurements(e,r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(F),Y=function(){},J=function(){this.hasFullStack=!0,this.parsedStack=[]},$=function(a){function e(e,t,n,r,i){var o=a.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},o.properties=O.sanitizeProperties(e,n),o.measurements=O.sanitizeMeasurements(e,r),o.exceptions=[new Z(e,t)],i&&(o.severityLevel=i),o}return j(e,a),e.CreateSimpleException=function(e,t,n,r,i,o){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return j(e,t),e}(K)),Z=function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},n.typeName=O.sanitizeString(e,t.name)||G.NotSpecified,n.message=O.sanitizeMessage(e,t.message)||G.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=O.sanitizeException(e,r),n.hasFullStack=G.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return j(e,i),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,o=0;o<=n.length;o++){var a=n[o];if(ee.regex.test(a)){var s=new ee(n[o],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,f=c,g=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=g-f+1;t.splice(f,p);break}f=c,g=u,c++,u--}}return t},e}(J),ee=function(i){function o(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},n.level=t,n.method="<no_method>",n.assembly=G.trim(e);var r=e.match(o.regex);return r&&5<=r.length&&(n.method=G.trim(r[2])||n.method,n.fileName=G.trim(r[4]),n.line=parseInt(r[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return j(o,i),o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(Y),te=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return j(e,t),e}(K);(H=X||(X={}))[H.Measurement=0]="Measurement",H[H.Aggregation=1]="Aggregation";var ne,re,ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return j(e,t),e}(function(){this.kind=X.Measurement}),oe=function(u){function e(e,t,n,r,i,o,a){var s=u.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new ie;return c.count=0<r?r:void 0,c.max=isNaN(o)||null===o?void 0:o,c.min=isNaN(i)||null===i?void 0:i,c.name=O.sanitizeString(e,t)||G.NotSpecified,c.value=n,s.metrics=[c],s.properties=O.sanitizeProperties(e,a),s}return j(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(te),ae=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(F),se=function(c){function e(e,t,n,r,i,o,a){var s=c.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=O.sanitizeId(e,a),s.url=O.sanitizeUrl(e,n),s.name=O.sanitizeString(e,t)||G.NotSpecified,isNaN(r)||(s.duration=G.msToTimeSpan(r)),s.properties=O.sanitizeProperties(e,i),s.measurements=O.sanitizeMeasurements(e,o),s}return j(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ae),ce=function(g){function e(e,t,n,r,i,o,a,s,c,u){var l=g.call(this)||this;l.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},l.id=t,l.duration=G.msToTimeSpan(i),l.success=o,l.resultCode=a+"",l.type="Ajax",l.data=O.sanitizeUrl(e,r);var f=q.ParseDependencyPath(e,n,s,r);return l.target=f.target,l.name=f.name,l.properties=O.sanitizeProperties(e,c),l.measurements=O.sanitizeMeasurements(e,u),l}return j(e,g),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return j(e,t),e}(K)),ue=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||G.NotSpecified,i.message=O.sanitizeMessage(e,t),i.properties=O.sanitizeProperties(e,n),r&&(i.severityLevel=r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return j(e,t),e}(K)),le=function(p){function d(e,t,n,r,i,o){var a=p.call(this)||this;a.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},a.isValid=!1;var s=d.getPerformanceTiming();if(s){var c=d.getDuration(s.navigationStart,s.loadEventEnd),u=d.getDuration(s.navigationStart,s.connectEnd),l=d.getDuration(s.requestStart,s.responseStart),f=d.getDuration(s.responseStart,s.responseEnd),g=d.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(m.WARNING,y,"error calculating page view performance.",{total:c,network:u,request:l,response:f,dom:g}):d.shouldCollectDuration(c,u,l,f,g)?c<Math.floor(u)+Math.floor(l)+Math.floor(f)+Math.floor(g)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:f,dom:g}):(a.durationMs=c,a.perfTotal=a.duration=G.msToTimeSpan(c),a.networkConnect=G.msToTimeSpan(u),a.sentRequest=G.msToTimeSpan(l),a.receivedResponse=G.msToTimeSpan(f),a.domProcessing=G.msToTimeSpan(g),a.isValid=!0):e.throwInternal(m.WARNING,D,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:f,dom:g})}return a.url=O.sanitizeUrl(e,n),a.name=O.sanitizeString(e,t)||G.NotSpecified,a.properties=O.sanitizeProperties(e,i),a.measurements=O.sanitizeMeasurements(e,o),a}return j(d,p),d.prototype.getIsValid=function(){return this.isValid},d.prototype.getDurationMs=function(){return this.durationMs},d.getPerformanceTiming=function(){return d.isPerformanceTimingSupported()?window.performance.timing:null},d.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},d.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},d.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},d.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=navigator.userAgent,i=!1;if(r)for(var o=0;o<n.length;o++)i=i||-1!==r.toLowerCase().indexOf(n[o]);if(i)return!1;for(var a=0;a<e.length;a++)if(e[a]>=d.MAX_DURATION_ALLOWED)return!1;return!0},d.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",d.dataType="PageviewPerformanceData",d.MAX_DURATION_ALLOWED=36e5,d}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(ae));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}j(e,r)}(W);(re=ne||(ne={}))[re.Verbose=0]="Verbose",re[re.Information=1]="Information",re[re.Warning=2]="Warning",re[re.Error=3]="Error",re[re.Critical=4]="Critical";var fe=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),void 0!==(i=n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t])?i:r},e}(),ge=function(){function e(){}return e.create=function(e,t,n,r,i,o){if(n=O.sanitizeString(r,n)||G.NotSpecified,l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||l.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var a={name:n,timestamp:new Date,instrumentationKey:"",ctx:o||{},tags:[],data:{},baseType:t,baseData:e};if(!l.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(a.data[s]=i[s]);return a},e}(),pe=function(){function e(e,t,n){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}return e.prototype.trackPageView=function(t,n){var r=this,i=t.name;(l.isNullOrUndefined(i)||"string"!=typeof i)&&(t.name=window.document&&window.document.title||"");var o=t.uri;if((l.isNullOrUndefined(o)||"string"!=typeof o)&&(t.uri=window.location&&window.location.href||""),!le.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(m.WARNING,d,"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 a=!1,s=void 0,c=le.getPerformanceTiming().navigationStart;s=le.getDuration(c,+new Date),le.shouldCollectDuration(s)||(s=void 0);var e=void 0;l.isNullOrUndefined(n)||l.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&(n||(n={}),n.duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),a=!0);n||(n={});var u=setInterval(function(){try{if(le.isPerformanceTimingDataReady()){clearInterval(u);var e=new le(r._logger,i,o,null);e.getIsValid()||a?(a||(n.duration=e.getDurationMs(),r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<le.getDuration(c,+new Date)&&(clearInterval(u),a||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(m.CRITICAL,T,"trackPageView failed on page load calculation: "+G.getExceptionName(e),{exception:G.dump(e)})}},100)},e}(),de=function(){function u(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return u.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=G.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=G.stringToBoolOrDefault(e.autoTrackPageVisitTime),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=G.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=G.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=G.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e},u.prototype.processTelemetry=function(e){var t=!1;try{for(var n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i&&!1===i.apply(null,[e])){t=!0;break}}}catch(e){t=!0,this._logger.throwInternal(m.CRITICAL,M,"One of telemetry initializers failed, telemetry item will not be sent: "+G.getExceptionName(e),{exception:G.dump(e)},!0)}t||l.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype.trackEvent=function(e,t){try{var n=ge.create(e,Q.dataType,Q.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackTrace=function(e,t){try{var n=ge.create(e,ue.dataType,ue.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackMetric=function(e,t){try{var n=ge.create(e,oe.dataType,oe.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,_,"trackMetric failed, metric will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackPageView=function(e,t){try{this._pageViewManager.trackPageView(e,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e.name,e.uri)}catch(e){this._logger.throwInternal(m.CRITICAL,N,"trackPageView failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.sendPageViewInternal=function(e,t,n){var r=ge.create(e,se.dataType,se.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},u.prototype.sendPageViewPerformanceInternal=function(e,t){var n=ge.create(e,le.dataType,le.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)},u.prototype.trackPageViewPerformance=function(e,t){var n=new le(this.core.logger,e.name,e.url,void 0,t);this.sendPageViewPerformanceInternal(n,t)},u.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(m.CRITICAL,w,"startTrackPage failed, page view may not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.stopTrackPage=function(e,t,n){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(m.CRITICAL,S,"stopTrackPage failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackException=function(e,t){try{var n=ge.create(e,$.dataType,$.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,I,"trackException failed, exception will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(G.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!G.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({error:t.error,severityLevel:ne.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(m.CRITICAL,s,"_onError threw exception while logging error, error will not be collected: "+G.getExceptionName(e),{exception:G.dump(e),errorString:r})}},u.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(l.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 r=u.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=fe.getConfig(e,i,this.identifier,r[i]);if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&G.disableCookies(),this.config.isStorageUseDisabled&&G.disableStorage();var a={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}};if(this._pageViewManager=new pe(this,this.config.overridePageViewDuration,this.core),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._pageTracking=new he(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r){var i={name:e,uri:t};l.isNullOrUndefined(r)&&(r={}),r.duration=n,o.sendPageViewInternal(i,r)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var o=s&&s(e,t,n,r,i);return!0!==o&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),o},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},u.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===ce.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.absoluteUrl&&0<=t.absoluteUrl.indexOf(r[n]))return!1}return!0})}},u.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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:void 0},n=ge.create(t,$.dataType,$.envelopeType,this._logger,{url:e});this.core.track(n)},u.prototype._setTelemetryNameAndIKey=function(e){e.instrumentationKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},u.Version="2.0.1-beta",u}(),he=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(m.WARNING,C,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n){var r=this._events[e];if(isNaN(r))this._logger.throwInternal(m.WARNING,P,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var i=+new Date,o=le.getDuration(r,i);this.action(e,t,o,n)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=de,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map

@@ -5,3 +5,3 @@ /**

*/
import { Util, PageViewPerformance, PageView, RemoteDependencyData, Event, TelemetryItemCreator, Metric, Exception, SeverityLevel, Trace } from "@microsoft/applicationinsights-common";
import { Util, PageViewPerformance, PageView, RemoteDependencyData, Event, TelemetryItemCreator, Metric, Exception, SeverityLevel, Trace, ConfigurationManager } from "@microsoft/applicationinsights-common";
import { CoreUtils, LoggingSeverity, _InternalMessageId } from "@microsoft/applicationinsights-core-js";

@@ -268,3 +268,3 @@ import { PageViewManager } from "./Telemetry/PageViewManager";

// for each unspecified field, set the default value
this.config[field] = this.config[field] || config[field] || defaults[field];
this.config[field] = ConfigurationManager.getConfig(config, field, this.identifier, defaults[field]);
}

@@ -271,0 +271,0 @@ if (this._globalconfig) {

/*!
* Application Insights JavaScript SDK - Web Analytics, 1.0.0-beta.4
* Application Insights JavaScript SDK - Web Analytics, 1.0.0-beta.5
* 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.aianalytics={})}(this,function(e){"use strict";var i,t,h,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var m,r,l=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.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)})},e}(),o=/[xy]/g;(r=m||(m={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var a=1,c=2,u=3,f=4,g=5,p=6,v=8,y=10,s=11,d=25,w=31,S=32,I=35,_=36,N=37,T=38,E=39,D=45,x=52,b=56,k=57,A=61,P=62,C=63,M=64,R=66,U=68,L=69,z=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=z}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var o=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);o.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<i.length;t++){var a=i[t];a.priority>z&&e.push(a)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),O=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var o=0,a=i;void 0!==n[a];)o++,a=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(o);i=a}return i},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(m.WARNING,k,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(m.WARNING,A,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,R)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(m.WARNING,b,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(m.WARNING,x,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var i=s.sanitizeString(e,t[r],s.MAX_PROPERTY_LENGTH);n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,L).toString():t},s.sanitizeInput=function(e,t,n,r){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),G=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,g,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(m.WARNING,U,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",o="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(o=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+o)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),o=0;o<i.length;o++){var a=i[o];if((a=s.trim(a))&&0===a.indexOf(r)){n=a.substring(r.length,i[o].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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"}},s.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},s.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,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,r=r.length<2?"0"+r:r,(0<o?o+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),V=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),q=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,o;if(t&&0<t.length){var a=V.parseUrl(t);if(i=a.host,null!=a.pathname)"/"!==(r=0===a.pathname.length?"/":a.pathname).charAt(0)&&(r="/"+r),o=O.sanitizeString(e,n?n+" "+r:r);else o=O.sanitizeString(e,t)}else o=i=r;return{target:i,name:o}},e}(),B=(function(){function e(){}e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||(n=t-e),n}}(),function(e,t){return(B=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 j(e,t){function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X,H,W=function(e){function t(){return e.call(this)||this}return j(t,e),t}(function(){}),K=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=O.sanitizeString(e,n)||G.NotSpecified,r.data=t,r.time=G.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}j(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),F=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(K),Q=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=O.sanitizeString(e,t)||G.NotSpecified,i.properties=O.sanitizeProperties(e,n),i.measurements=O.sanitizeMeasurements(e,r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(F),Y=function(){},J=function(){this.hasFullStack=!0,this.parsedStack=[]},$=function(a){function e(e,t,n,r,i){var o=a.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},o.properties=O.sanitizeProperties(e,n),o.measurements=O.sanitizeMeasurements(e,r),o.exceptions=[new Z(e,t)],i&&(o.severityLevel=i),o}return j(e,a),e.CreateSimpleException=function(e,t,n,r,i,o){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return j(e,t),e}(K)),Z=function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},n.typeName=O.sanitizeString(e,t.name)||G.NotSpecified,n.message=O.sanitizeMessage(e,t.message)||G.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=O.sanitizeException(e,r),n.hasFullStack=G.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return j(e,i),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,o=0;o<=n.length;o++){var a=n[o];if(ee.regex.test(a)){var s=new ee(n[o],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,f=c,g=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=g-f+1;t.splice(f,p);break}f=c,g=u,c++,u--}}return t},e}(J),ee=function(i){function o(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},n.level=t,n.method="<no_method>",n.assembly=G.trim(e);var r=e.match(o.regex);return r&&5<=r.length&&(n.method=G.trim(r[2])||n.method,n.fileName=G.trim(r[4]),n.line=parseInt(r[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return j(o,i),o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(Y),te=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return j(e,t),e}(K);(H=X||(X={}))[H.Measurement=0]="Measurement",H[H.Aggregation=1]="Aggregation";var ne,re,ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return j(e,t),e}(function(){this.kind=X.Measurement}),oe=function(u){function e(e,t,n,r,i,o,a){var s=u.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new ie;return c.count=0<r?r:void 0,c.max=isNaN(o)||null===o?void 0:o,c.min=isNaN(i)||null===i?void 0:i,c.name=O.sanitizeString(e,t)||G.NotSpecified,c.value=n,s.metrics=[c],s.properties=O.sanitizeProperties(e,a),s}return j(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(te),ae=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(F),se=function(c){function e(e,t,n,r,i,o,a){var s=c.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=O.sanitizeId(e,a),s.url=O.sanitizeUrl(e,n),s.name=O.sanitizeString(e,t)||G.NotSpecified,isNaN(r)||(s.duration=G.msToTimeSpan(r)),s.properties=O.sanitizeProperties(e,i),s.measurements=O.sanitizeMeasurements(e,o),s}return j(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ae),ce=function(g){function e(e,t,n,r,i,o,a,s,c,u){var l=g.call(this)||this;l.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},l.id=t,l.duration=G.msToTimeSpan(i),l.success=o,l.resultCode=a+"",l.type="Ajax",l.data=O.sanitizeUrl(e,r);var f=q.ParseDependencyPath(e,n,s,r);return l.target=f.target,l.name=f.name,l.properties=O.sanitizeProperties(e,c),l.measurements=O.sanitizeMeasurements(e,u),l}return j(e,g),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return j(e,t),e}(K)),ue=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||G.NotSpecified,i.message=O.sanitizeMessage(e,t),i.properties=O.sanitizeProperties(e,n),r&&(i.severityLevel=r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return j(e,t),e}(K)),le=function(p){function d(e,t,n,r,i,o){var a=p.call(this)||this;a.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},a.isValid=!1;var s=d.getPerformanceTiming();if(s){var c=d.getDuration(s.navigationStart,s.loadEventEnd),u=d.getDuration(s.navigationStart,s.connectEnd),l=d.getDuration(s.requestStart,s.responseStart),f=d.getDuration(s.responseStart,s.responseEnd),g=d.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(m.WARNING,y,"error calculating page view performance.",{total:c,network:u,request:l,response:f,dom:g}):d.shouldCollectDuration(c,u,l,f,g)?c<Math.floor(u)+Math.floor(l)+Math.floor(f)+Math.floor(g)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:f,dom:g}):(a.durationMs=c,a.perfTotal=a.duration=G.msToTimeSpan(c),a.networkConnect=G.msToTimeSpan(u),a.sentRequest=G.msToTimeSpan(l),a.receivedResponse=G.msToTimeSpan(f),a.domProcessing=G.msToTimeSpan(g),a.isValid=!0):e.throwInternal(m.WARNING,D,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:f,dom:g})}return a.url=O.sanitizeUrl(e,n),a.name=O.sanitizeString(e,t)||G.NotSpecified,a.properties=O.sanitizeProperties(e,i),a.measurements=O.sanitizeMeasurements(e,o),a}return j(d,p),d.prototype.getIsValid=function(){return this.isValid},d.prototype.getDurationMs=function(){return this.durationMs},d.getPerformanceTiming=function(){return d.isPerformanceTimingSupported()?window.performance.timing:null},d.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},d.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},d.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},d.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=navigator.userAgent,i=!1;if(r)for(var o=0;o<n.length;o++)i=i||-1!==r.toLowerCase().indexOf(n[o]);if(i)return!1;for(var a=0;a<e.length;a++)if(e[a]>=d.MAX_DURATION_ALLOWED)return!1;return!0},d.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",d.dataType="PageviewPerformanceData",d.MAX_DURATION_ALLOWED=36e5,d}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(ae));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}j(e,r)}(W);(re=ne||(ne={}))[re.Verbose=0]="Verbose",re[re.Information=1]="Information",re[re.Warning=2]="Warning",re[re.Error=3]="Error",re[re.Critical=4]="Critical";var fe=function(){function e(){}return e.create=function(e,t,n,r,i,o){if(n=O.sanitizeString(r,n)||G.NotSpecified,l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||l.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var a={name:n,timestamp:new Date,instrumentationKey:"",ctx:o||{},tags:[],data:{},baseType:t,baseData:e};if(!l.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(a.data[s]=i[s]);return a},e}(),ge=function(){function e(e,t,n){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}return e.prototype.trackPageView=function(t,n){var r=this,i=t.name;(l.isNullOrUndefined(i)||"string"!=typeof i)&&(t.name=window.document&&window.document.title||"");var o=t.uri;if((l.isNullOrUndefined(o)||"string"!=typeof o)&&(t.uri=window.location&&window.location.href||""),!le.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(m.WARNING,d,"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 a=!1,s=void 0,c=le.getPerformanceTiming().navigationStart;s=le.getDuration(c,+new Date),le.shouldCollectDuration(s)||(s=void 0);var e=void 0;l.isNullOrUndefined(n)||l.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&(n||(n={}),n.duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),a=!0);n||(n={});var u=setInterval(function(){try{if(le.isPerformanceTimingDataReady()){clearInterval(u);var e=new le(r._logger,i,o,null);e.getIsValid()||a?(a||(n.duration=e.getDurationMs(),r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<le.getDuration(c,+new Date)&&(clearInterval(u),a||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(m.CRITICAL,T,"trackPageView failed on page load calculation: "+G.getExceptionName(e),{exception:G.dump(e)})}},100)},e}(),pe=function(){function u(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return u.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=G.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=G.stringToBoolOrDefault(e.autoTrackPageVisitTime),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=G.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=G.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=G.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e},u.prototype.processTelemetry=function(e){var t=!1;try{for(var n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i&&!1===i.apply(null,[e])){t=!0;break}}}catch(e){t=!0,this._logger.throwInternal(m.CRITICAL,M,"One of telemetry initializers failed, telemetry item will not be sent: "+G.getExceptionName(e),{exception:G.dump(e)},!0)}t||l.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype.trackEvent=function(e,t){try{var n=fe.create(e,Q.dataType,Q.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackTrace=function(e,t){try{var n=fe.create(e,ue.dataType,ue.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackMetric=function(e,t){try{var n=fe.create(e,oe.dataType,oe.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,_,"trackMetric failed, metric will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackPageView=function(e,t){try{this._pageViewManager.trackPageView(e,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e.name,e.uri)}catch(e){this._logger.throwInternal(m.CRITICAL,N,"trackPageView failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.sendPageViewInternal=function(e,t,n){var r=fe.create(e,se.dataType,se.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},u.prototype.sendPageViewPerformanceInternal=function(e,t){var n=fe.create(e,le.dataType,le.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)},u.prototype.trackPageViewPerformance=function(e,t){var n=new le(this.core.logger,e.name,e.url,void 0,t);this.sendPageViewPerformanceInternal(n,t)},u.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(m.CRITICAL,w,"startTrackPage failed, page view may not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.stopTrackPage=function(e,t,n){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(m.CRITICAL,S,"stopTrackPage failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackException=function(e,t){try{var n=fe.create(e,$.dataType,$.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,I,"trackException failed, exception will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(G.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!G.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({error:t.error,severityLevel:ne.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(m.CRITICAL,s,"_onError threw exception while logging error, error will not be collected: "+G.getExceptionName(e),{exception:G.dump(e),errorString:r})}},u.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(l.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 r=u.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=this.config[i]||e[i]||r[i];if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&G.disableCookies(),this.config.isStorageUseDisabled&&G.disableStorage();var a={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}};if(this._pageViewManager=new ge(this,this.config.overridePageViewDuration,this.core),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._pageTracking=new de(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r){var i={name:e,uri:t};l.isNullOrUndefined(r)&&(r={}),r.duration=n,o.sendPageViewInternal(i,r)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var o=s&&s(e,t,n,r,i);return!0!==o&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),o},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},u.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===ce.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.absoluteUrl&&0<=t.absoluteUrl.indexOf(r[n]))return!1}return!0})}},u.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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:void 0},n=fe.create(t,$.dataType,$.envelopeType,this._logger,{url:e});this.core.track(n)},u.prototype._setTelemetryNameAndIKey=function(e){e.instrumentationKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},u.Version="2.0.1-beta",u}(),de=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(m.WARNING,P,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n){var r=this._events[e];if(isNaN(r))this._logger.throwInternal(m.WARNING,C,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var i=+new Date,o=le.getDuration(r,i);this.action(e,t,o,n)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=pe,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.aianalytics={})}(this,function(e){"use strict";var i,t,h,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var m,r,l=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.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)})},e}(),o=/[xy]/g;(r=m||(m={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var a=1,c=2,u=3,f=4,g=5,p=6,v=8,y=10,s=11,d=25,w=31,S=32,I=35,_=36,N=37,T=38,E=39,D=45,x=52,b=56,k=57,A=61,C=62,P=63,M=64,R=66,U=68,L=69,z=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=z}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var o=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);o.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<i.length;t++){var a=i[t];a.priority>z&&e.push(a)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),O=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var o=0,a=i;void 0!==n[a];)o++,a=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(o);i=a}return i},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(m.WARNING,k,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(m.WARNING,A,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,R)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(m.WARNING,b,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(m.WARNING,x,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var i=s.sanitizeString(e,t[r],s.MAX_PROPERTY_LENGTH);n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,L).toString():t},s.sanitizeInput=function(e,t,n,r){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),G=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(m.WARNING,g,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(m.WARNING,U,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",o="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(o=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+o)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),o=0;o<i.length;o++){var a=i[o];if((a=s.trim(a))&&0===a.indexOf(r)){n=a.substring(r.length,i[o].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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"}},s.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},s.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,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,r=r.length<2?"0"+r:r,(0<o?o+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),V=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),q=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,o;if(t&&0<t.length){var a=V.parseUrl(t);if(i=a.host,null!=a.pathname)"/"!==(r=0===a.pathname.length?"/":a.pathname).charAt(0)&&(r="/"+r),o=O.sanitizeString(e,n?n+" "+r:r);else o=O.sanitizeString(e,t)}else o=i=r;return{target:i,name:o}},e}(),B=(function(){function e(){}e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||(n=t-e),n}}(),function(e,t){return(B=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 j(e,t){function n(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X,H,W=function(e){function t(){return e.call(this)||this}return j(t,e),t}(function(){}),K=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=O.sanitizeString(e,n)||G.NotSpecified,r.data=t,r.time=G.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}j(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),F=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(K),Q=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=O.sanitizeString(e,t)||G.NotSpecified,i.properties=O.sanitizeProperties(e,n),i.measurements=O.sanitizeMeasurements(e,r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(F),Y=function(){},J=function(){this.hasFullStack=!0,this.parsedStack=[]},$=function(a){function e(e,t,n,r,i){var o=a.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},o.properties=O.sanitizeProperties(e,n),o.measurements=O.sanitizeMeasurements(e,r),o.exceptions=[new Z(e,t)],i&&(o.severityLevel=i),o}return j(e,a),e.CreateSimpleException=function(e,t,n,r,i,o){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return j(e,t),e}(K)),Z=function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},n.typeName=O.sanitizeString(e,t.name)||G.NotSpecified,n.message=O.sanitizeMessage(e,t.message)||G.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=O.sanitizeException(e,r),n.hasFullStack=G.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return j(e,i),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,o=0;o<=n.length;o++){var a=n[o];if(ee.regex.test(a)){var s=new ee(n[o],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,f=c,g=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=g-f+1;t.splice(f,p);break}f=c,g=u,c++,u--}}return t},e}(J),ee=function(i){function o(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},n.level=t,n.method="<no_method>",n.assembly=G.trim(e);var r=e.match(o.regex);return r&&5<=r.length&&(n.method=G.trim(r[2])||n.method,n.fileName=G.trim(r[4]),n.line=parseInt(r[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return j(o,i),o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(Y),te=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return j(e,t),e}(K);(H=X||(X={}))[H.Measurement=0]="Measurement",H[H.Aggregation=1]="Aggregation";var ne,re,ie=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return j(e,t),e}(function(){this.kind=X.Measurement}),oe=function(u){function e(e,t,n,r,i,o,a){var s=u.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new ie;return c.count=0<r?r:void 0,c.max=isNaN(o)||null===o?void 0:o,c.min=isNaN(i)||null===i?void 0:i,c.name=O.sanitizeString(e,t)||G.NotSpecified,c.value=n,s.metrics=[c],s.properties=O.sanitizeProperties(e,a),s}return j(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(te),ae=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(F),se=function(c){function e(e,t,n,r,i,o,a){var s=c.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=O.sanitizeId(e,a),s.url=O.sanitizeUrl(e,n),s.name=O.sanitizeString(e,t)||G.NotSpecified,isNaN(r)||(s.duration=G.msToTimeSpan(r)),s.properties=O.sanitizeProperties(e,i),s.measurements=O.sanitizeMeasurements(e,o),s}return j(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ae),ce=function(g){function e(e,t,n,r,i,o,a,s,c,u){var l=g.call(this)||this;l.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},l.id=t,l.duration=G.msToTimeSpan(i),l.success=o,l.resultCode=a+"",l.type="Ajax",l.data=O.sanitizeUrl(e,r);var f=q.ParseDependencyPath(e,n,s,r);return l.target=f.target,l.name=f.name,l.properties=O.sanitizeProperties(e,c),l.measurements=O.sanitizeMeasurements(e,u),l}return j(e,g),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return j(e,t),e}(K)),ue=function(o){function e(e,t,n,r){var i=o.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||G.NotSpecified,i.message=O.sanitizeMessage(e,t),i.properties=O.sanitizeProperties(e,n),r&&(i.severityLevel=r),i}return j(e,o),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return j(e,t),e}(K)),le=function(p){function d(e,t,n,r,i,o){var a=p.call(this)||this;a.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},a.isValid=!1;var s=d.getPerformanceTiming();if(s){var c=d.getDuration(s.navigationStart,s.loadEventEnd),u=d.getDuration(s.navigationStart,s.connectEnd),l=d.getDuration(s.requestStart,s.responseStart),f=d.getDuration(s.responseStart,s.responseEnd),g=d.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(m.WARNING,y,"error calculating page view performance.",{total:c,network:u,request:l,response:f,dom:g}):d.shouldCollectDuration(c,u,l,f,g)?c<Math.floor(u)+Math.floor(l)+Math.floor(f)+Math.floor(g)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:f,dom:g}):(a.durationMs=c,a.perfTotal=a.duration=G.msToTimeSpan(c),a.networkConnect=G.msToTimeSpan(u),a.sentRequest=G.msToTimeSpan(l),a.receivedResponse=G.msToTimeSpan(f),a.domProcessing=G.msToTimeSpan(g),a.isValid=!0):e.throwInternal(m.WARNING,D,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:f,dom:g})}return a.url=O.sanitizeUrl(e,n),a.name=O.sanitizeString(e,t)||G.NotSpecified,a.properties=O.sanitizeProperties(e,i),a.measurements=O.sanitizeMeasurements(e,o),a}return j(d,p),d.prototype.getIsValid=function(){return this.isValid},d.prototype.getDurationMs=function(){return this.durationMs},d.getPerformanceTiming=function(){return d.isPerformanceTimingSupported()?window.performance.timing:null},d.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},d.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},d.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},d.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=navigator.userAgent,i=!1;if(r)for(var o=0;o<n.length;o++)i=i||-1!==r.toLowerCase().indexOf(n[o]);if(i)return!1;for(var a=0;a<e.length;a++)if(e[a]>=d.MAX_DURATION_ALLOWED)return!1;return!0},d.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",d.dataType="PageviewPerformanceData",d.MAX_DURATION_ALLOWED=36e5,d}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return j(e,t),e}(ae));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}j(e,r)}(W);(re=ne||(ne={}))[re.Verbose=0]="Verbose",re[re.Information=1]="Information",re[re.Warning=2]="Warning",re[re.Error=3]="Error",re[re.Critical=4]="Critical";var fe=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),void 0!==(i=n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t])?i:r},e}(),ge=function(){function e(){}return e.create=function(e,t,n,r,i,o){if(n=O.sanitizeString(r,n)||G.NotSpecified,l.isNullOrUndefined(e)||l.isNullOrUndefined(t)||l.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var a={name:n,timestamp:new Date,instrumentationKey:"",ctx:o||{},tags:[],data:{},baseType:t,baseData:e};if(!l.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(a.data[s]=i[s]);return a},e}(),pe=function(){function e(e,t,n){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}return e.prototype.trackPageView=function(t,n){var r=this,i=t.name;(l.isNullOrUndefined(i)||"string"!=typeof i)&&(t.name=window.document&&window.document.title||"");var o=t.uri;if((l.isNullOrUndefined(o)||"string"!=typeof o)&&(t.uri=window.location&&window.location.href||""),!le.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(m.WARNING,d,"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 a=!1,s=void 0,c=le.getPerformanceTiming().navigationStart;s=le.getDuration(c,+new Date),le.shouldCollectDuration(s)||(s=void 0);var e=void 0;l.isNullOrUndefined(n)||l.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&(n||(n={}),n.duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),a=!0);n||(n={});var u=setInterval(function(){try{if(le.isPerformanceTimingDataReady()){clearInterval(u);var e=new le(r._logger,i,o,null);e.getIsValid()||a?(a||(n.duration=e.getDurationMs(),r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<le.getDuration(c,+new Date)&&(clearInterval(u),a||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(m.CRITICAL,T,"trackPageView failed on page load calculation: "+G.getExceptionName(e),{exception:G.dump(e)})}},100)},e}(),de=function(){function u(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return u.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=G.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=G.stringToBoolOrDefault(e.autoTrackPageVisitTime),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=G.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=G.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=G.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e},u.prototype.processTelemetry=function(e){var t=!1;try{for(var n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i&&!1===i.apply(null,[e])){t=!0;break}}}catch(e){t=!0,this._logger.throwInternal(m.CRITICAL,M,"One of telemetry initializers failed, telemetry item will not be sent: "+G.getExceptionName(e),{exception:G.dump(e)},!0)}t||l.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype.trackEvent=function(e,t){try{var n=ge.create(e,Q.dataType,Q.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackTrace=function(e,t){try{var n=ge.create(e,ue.dataType,ue.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.WARNING,E,"trackTrace failed, trace will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackMetric=function(e,t){try{var n=ge.create(e,oe.dataType,oe.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,_,"trackMetric failed, metric will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackPageView=function(e,t){try{this._pageViewManager.trackPageView(e,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e.name,e.uri)}catch(e){this._logger.throwInternal(m.CRITICAL,N,"trackPageView failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.sendPageViewInternal=function(e,t,n){var r=ge.create(e,se.dataType,se.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},u.prototype.sendPageViewPerformanceInternal=function(e,t){var n=ge.create(e,le.dataType,le.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)},u.prototype.trackPageViewPerformance=function(e,t){var n=new le(this.core.logger,e.name,e.url,void 0,t);this.sendPageViewPerformanceInternal(n,t)},u.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(m.CRITICAL,w,"startTrackPage failed, page view may not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.stopTrackPage=function(e,t,n){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(m.CRITICAL,S,"stopTrackPage failed, page view will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype.trackException=function(e,t){try{var n=ge.create(e,$.dataType,$.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(m.CRITICAL,I,"trackException failed, exception will not be collected: "+G.getExceptionName(e),{exception:G.dump(e)})}},u.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(G.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!G.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({error:t.error,severityLevel:ne.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(m.CRITICAL,s,"_onError threw exception while logging error, error will not be collected: "+G.getExceptionName(e),{exception:G.dump(e),errorString:r})}},u.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(l.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 r=u.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=fe.getConfig(e,i,this.identifier,r[i]);if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&G.disableCookies(),this.config.isStorageUseDisabled&&G.disableStorage();var a={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}};if(this._pageViewManager=new pe(this,this.config.overridePageViewDuration,this.core),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._pageTracking=new he(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r){var i={name:e,uri:t};l.isNullOrUndefined(r)&&(r={}),r.duration=n,o.sendPageViewInternal(i,r)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var o=s&&s(e,t,n,r,i);return!0!==o&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),o},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},u.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===ce.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.absoluteUrl&&0<=t.absoluteUrl.indexOf(r[n]))return!1}return!0})}},u.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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:void 0},n=ge.create(t,$.dataType,$.envelopeType,this._logger,{url:e});this.core.track(n)},u.prototype._setTelemetryNameAndIKey=function(e){e.instrumentationKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},u.Version="2.0.1-beta",u}(),he=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(m.WARNING,C,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n){var r=this._events[e];if(isNaN(r))this._logger.throwInternal(m.WARNING,P,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var i=+new Date,o=le.getDuration(r,i);this.action(e,t,o,n)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=de,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map
{
"name": "@microsoft/applicationinsights-analytics-js",
"version": "1.0.0-beta.4",
"version": "1.0.0-beta.5",
"description": "Microsoft Application Insights Javascript SDK apis",

@@ -28,5 +28,5 @@ "main": "dist/applicationinsights-analytics-js.min.js",

"@microsoft/applicationinsights-core-js": "^1.0.0-beta.2",
"@microsoft/applicationinsights-common": "^1.0.0-beta.6"
"@microsoft/applicationinsights-common": "^1.0.0-beta.7"
},
"license": "MIT"
}

@@ -13,3 +13,4 @@ /**

IExceptionTelemetry, ITraceTelemetry, IMetricTelemetry, IAutoExceptionTelemetry,
IPageViewTelemetryInternal, IPageViewTelemetry, IPageViewPerformanceTelemetry
IPageViewTelemetryInternal, IPageViewTelemetry, IPageViewPerformanceTelemetry,
ConfigurationManager
} from "@microsoft/applicationinsights-common";

@@ -402,3 +403,3 @@ import {

// for each unspecified field, set the default value
this.config[field] = this.config[field] || config[field] || defaults[field];
this.config[field] = ConfigurationManager.getConfig(config, field, this.identifier, defaults[field]);
}

@@ -405,0 +406,0 @@

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 too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc