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

@microsoft/applicationinsights-dependencies-js

Package Overview
Dependencies
Maintainers
5
Versions
595
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 2.0.0-beta.2 to 2.0.0-beta.3

4

browser/applicationinsights-dependencies-js.min.js
/*!
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-beta.2
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-beta.3
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var i,t,g,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=g||(g={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var m,r,c=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),a=/[xy]/g;(r=m||(m={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var o=1,u=2,l=3,d=4,f=5,p=6,v=8,x=10,s=13,h=14,y=15,D=16,S=17,I=18,w=45,C=52,N=55,A=56,_=57,T=61,M=66,b=68,E=69,R=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=R}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 a=this;if(this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(j+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];s.priority>R&&e.push(s)}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)}}}(),500),j="Channel has invalid priority",q=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),U=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 a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}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,_,"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,T,"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,M)},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,A,"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,C,"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,E).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}(),L=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,o,"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,l,"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,f,"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,u,"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,d,"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,b,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},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(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].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,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},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}(),H=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}(),O=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=H.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var i=e&&e.correlationHeaderExcludedDomains;if(!i||0==i.length)return!0;for(var a=0;a<i.length;a++){if(new RegExp(i[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,q.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var i=n[r].split("=");if(2==i.length&&i[0]==t)return i[1]}},n.correlationIdPrefix="cid-v1:",n}(),F=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=H.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=U.sanitizeString(e,n?n+" "+c:c)}else a=U.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),z=function(){function e(){}return 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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),k="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",P=function(e,t){return(P=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 G(e,t){function n(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X,W,B=function(e){function t(){return e.call(this)||this}return G(t,e),t}(function(){}),V=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=U.sanitizeString(e,n)||L.NotSpecified,r.data=t,r.time=L.toISOStringForIE8(new Date),r.aiDataContract={time:g.Required,iKey:g.Required,name:g.Required,sampleRate:function(){return 100==r.sampleRate?g.Hidden:g.Required},tags:g.Required,data:g.Required},r}G(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),K=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return G(e,t),e}(V),Q=(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:g.Required,name:g.Required,properties:g.Default,measurements:g.Default},i.name=U.sanitizeString(e,t)||L.NotSpecified,i.properties=U.sanitizeProperties(e,n),i.measurements=U.sanitizeMeasurements(e,r),i}G(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(K),function(){}),Y=function(){this.hasFullStack=!0,this.parsedStack=[]},J=(function(o){function e(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:g.Required,exceptions:g.Required,severityLevel:g.Default,properties:g.Default,measurements:g.Default},a.properties=U.sanitizeProperties(e,n),a.measurements=U.sanitizeMeasurements(e,r),a.exceptions=[new J(e,t)],i&&(a.severityLevel=i),a}G(e,o),e.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return G(e,t),e}(V)),function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:g.Default,outerId:g.Default,typeName:g.Required,message:g.Required,hasFullStack:g.Default,stack:g.Default,parsedStack:g.Array},n.typeName=U.sanitizeString(e,t.name)||L.NotSpecified,n.message=U.sanitizeMessage(e,t.message)||L.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=U.sanitizeException(e,r),n.hasFullStack=L.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return G(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,a=0;a<=n.length;a++){var o=n[a];if($.regex.test(o)){var s=new $(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=c,f=u,c++,u--}}return t},e}(Y)),$=function(i){function a(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:g.Required,method:g.Required,assembly:g.Default,fileName:g.Default,line:g.Default},n.level=t,n.method="<no_method>",n.assembly=L.trim(e);var r=e.match(a.regex);return r&&5<=r.length&&(n.method=L.trim(r[2])||n.method,n.fileName=L.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+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return G(a,i),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(Q),Z=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return G(e,t),e}(V);(W=X||(X={}))[W.Measurement=0]="Measurement",W[W.Aggregation=1]="Aggregation";var ee,te,ne=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:g.Required,kind:g.Default,value:g.Required,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default},e}return G(e,t),e}(function(){this.kind=X.Measurement}),re=(function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;s.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var c=new ne;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=U.sanitizeString(e,t)||L.NotSpecified,c.value=n,s.metrics=[c],s.properties=U.sanitizeProperties(e,o),s}G(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}(Z),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return G(e,t),e}(K)),ie=(function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,properties:g.Default,measurements:g.Default,id:g.Default},s.id=U.sanitizeId(e,o),s.url=U.sanitizeUrl(e,n),s.name=U.sanitizeString(e,t)||L.NotSpecified,isNaN(r)||(s.duration=L.msToTimeSpan(r)),s.properties=U.sanitizeProperties(e,i),s.measurements=U.sanitizeMeasurements(e,a),s}G(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(re),function(p){function e(e,t,n,r,i,a,o,s,c,u,l){void 0===c&&(c="Ajax");var d=p.call(this)||this;d.aiDataContract={id:g.Required,ver:g.Required,name:g.Default,resultCode:g.Default,duration:g.Default,success:g.Default,data:g.Default,target:g.Default,type:g.Default,properties:g.Default,measurements:g.Default,kind:g.Default,value:g.Default,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default,dependencyKind:g.Default,dependencySource:g.Default,commandName:g.Default,dependencyTypeName:g.Default},d.id=t,d.duration=L.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=U.sanitizeString(e,c);var f=F.ParseDependencyPath(e,n,s,r);return d.data=U.sanitizeUrl(e,r)||f.data,d.target=f.target,d.name=f.name,d.properties=U.sanitizeProperties(e,u),d.measurements=U.sanitizeMeasurements(e,l),d}return G(e,p),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 G(e,t),e}(V)));(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:g.Required,message:g.Required,severityLevel:g.Default,properties:g.Default},t=t||L.NotSpecified,i.message=U.sanitizeMessage(e,t),i.properties=U.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}G(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData"})(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return G(e,t),e}(V)),function(p){function h(e,t,n,r,i,a){var o=p.call(this)||this;o.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,perfTotal:g.Default,networkConnect:g.Default,sentRequest:g.Default,receivedResponse:g.Default,domProcessing:g.Default,properties:g.Default,measurements:g.Default},o.isValid=!1;var s=h.getPerformanceTiming();if(s){var c=h.getDuration(s.navigationStart,s.loadEventEnd),u=h.getDuration(s.navigationStart,s.connectEnd),l=h.getDuration(s.requestStart,s.responseStart),d=h.getDuration(s.responseStart,s.responseEnd),f=h.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(m.WARNING,x,"error calculating page view performance.",{total:c,network:u,request:l,response:d,dom:f}):h.shouldCollectDuration(c,u,l,d,f)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(f)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:f}):(o.durationMs=c,o.perfTotal=o.duration=L.msToTimeSpan(c),o.networkConnect=L.msToTimeSpan(u),o.sentRequest=L.msToTimeSpan(l),o.receivedResponse=L.msToTimeSpan(d),o.domProcessing=L.msToTimeSpan(f),o.isValid=!0):e.throwInternal(m.WARNING,w,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:d,dom:f})}return o.url=U.sanitizeUrl(e,n),o.name=U.sanitizeString(e,t)||L.NotSpecified,o.properties=U.sanitizeProperties(e,i),o.measurements=U.sanitizeMeasurements(e,a),o}G(h,p),h.prototype.getIsValid=function(){return this.isValid},h.prototype.getDurationMs=function(){return this.durationMs},h.getPerformanceTiming=function(){return h.isPerformanceTimingSupported()?window.performance.timing:null},h.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},h.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},h.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},h.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 a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(var o=0;o<e.length;o++)if(e[o]>=h.MAX_DURATION_ALLOWED)return!1;return!0},h.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",h.dataType="PageviewPerformanceData",h.MAX_DURATION_ALLOWED=36e5}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return G(e,t),e}(re)),function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:g.Required,baseData:g.Required},n.baseType=e,n.baseData=t,n}G(e,r)}(B);(te=ee||(ee={}))[te.Verbose=0]="Verbose",te[te.Information=1]="Information",te[te.Warning=2]="Warning",te[te.Error=3]="Error",te[te.Critical=4]="Critical";var ae=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(i)?r:i},e}(),oe=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=U.sanitizeString(r,n)||L.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},e}(),se=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ce=function(){function e(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new se,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*z.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?H.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?U.sanitizeUrl(this._logger,H.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ue=function(){function e(){}return e.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},e.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),le=function(){function o(){this._trackAjaxAttempts=0,this.identifier=o.identifier,this.priority=161,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return o.prototype.isMonitoredInstance=function(e,t,n,r){var i=!1,a=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,i="object"==typeof n&&!0===n[k]||!!r&&!0===r[k]):void 0!==e&&(o=this.initialized,i=!0===e[k],a=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&a&&!i},o.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},o.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,i=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!i.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||i.openHandler(this,e,t,n)}catch(e){this._core.logger.throwInternal(m.CRITICAL,y,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:L.dump(e)})}return r.apply(this,arguments)}},o.prototype.openHandler=function(e,t,n,r){var i;i=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+L.newId():L.newId();var a=new ce(i,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},o.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},o.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){this._core.logger.throwInternal(m.CRITICAL,S,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:L.dump(e)})}return t.apply(this,arguments)}},o.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=z.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},o.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){this._core.logger.throwInternal(m.CRITICAL,s,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:L.dump(e)})}return e.apply(this,arguments)}},o.prototype.attachToOnReadyStateChange=function(n){var r=this,e=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ue.AttachEvent(n,"readystatechange",function(){try{e.isMonitoredInstance(n)&&4===n.readyState&&e.onAjaxComplete(n)}catch(e){var t=L.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(m.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(n),exception:L.dump(e)})}})},o.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=z.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,h,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},o.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(q.requestContextHeaderLowerCase)){var n=t.getResponseHeader(q.requestContextHeader);return O.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=oe.create(e,ie.dataType,ie.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(m.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},o.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},o.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},o.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},o.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,i=this;window.fetch=function(t,e){var n;if(i.isFetchInstrumented(t)&&i.isMonitoredInstance(void 0,void 0,t,e))try{n=i.createFetchRecord(t,e),e=i.includeCorrelationHeaders(n,t,e)}catch(e){i._core.logger.throwInternal(m.CRITICAL,y,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}return r(t,e).then(function(e){return i.onFetchComplete(e,n),e}).catch(function(e){throw i.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},o.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[k]},o.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},o.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+L.newId():L.newId();var r=new ce(n,this._core.logger);return r.requestSentTime=z.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},o.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(O.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(q.requestIdHeader,e.id);var i=this._config.appId;return i&&n.headers.set(q.requestContextHeader,q.requestContextAppIdFormat+i),n}return n}if(r){if(this.currentWindowHost&&O.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(q.requestIdHeader,r.ajaxData.id);var a=this._config.appId;a&&r.setRequestHeader(q.requestContextHeader,q.requestContextAppIdFormat+a)}return r}},o.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(m.CRITICAL,y,"Failed to grab failed fetch diagnostics message",{exception:L.dump(e)})}return t},o.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=z.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,h,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=z.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,h,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(q.requestContextHeader);return O.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},o.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},o.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},o.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=o.getDefaultConfig();for(var i in this._config=o.getEmptyConfig(),r)this._config[i]=ae.getConfig(e,i,o.identifier,r[i]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){var a=n.AppInsightsPropertiesPlugin;a&&(this._context=a.context)}}},o.identifier="AjaxDependencyPlugin",o}();e.AjaxPlugin=le,e.ajaxRecord=ce,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r,t,p,n;(t=r||(r={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=p||(p={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var a,i,c=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;(i=a||(a={}))[i.CRITICAL=1]="CRITICAL",i[i.WARNING=2]="WARNING";var u=1,l=2,d=3,f=4,h=5,g=6,s=13,m=14,x=15,v=16,y=17,D=18,S=52,I=55,C=56,w=57,N=61,A=66,_=68,M=69,T=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=T}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,i,r){var a=this;if(this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<T&&(o=e.identifier),e.initialize(n,i,r)}),o)throw Error(b+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<r.length;t++){var s=r[t];s.priority>T&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),b="Channel has invalid priority",j=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),R=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},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(a.WARNING,w,"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(a.WARNING,N,"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,A)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(a.WARNING,C,"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(a.WARNING,S,"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 i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,M).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(a.WARNING,i,"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}(),E=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.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(a.WARNING,u,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(a.WARNING,d,"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(a.WARNING,h,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.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(a.WARNING,l,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(a.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(a.WARNING,g,"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(a.WARNING,_,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},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 i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].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,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},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}(),U=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),q=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=U.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,j.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),L=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a=i,o=i;if(t&&0<t.length){var s=U.parseUrl(t);if(r=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=R.sanitizeString(e,n?n+" "+c:c)}else a=R.sanitizeString(e,t)}else a=r=i;return{target:r,name:a,data:o}},e}(),H=function(){function e(){}return 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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),F="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",O=function(e,t){return(O=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 z(e,t){function n(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k,P,G=function(e){function t(){return e.call(this)||this}return z(t,e),t}(function(){}),X=(function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=R.sanitizeString(e,n)||E.NotSpecified,i.data=t,i.time=E.toISOStringForIE8(new Date),i.aiDataContract={time:p.Required,iKey:p.Required,name:p.Required,sampleRate:function(){return 100==i.sampleRate?p.Hidden:p.Required},tags:p.Required,data:p.Required},i}z(e,r)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(X),B=(function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:p.Required,name:p.Required,properties:p.Default,measurements:p.Default},r.name=R.sanitizeString(e,t)||E.NotSpecified,r.properties=R.sanitizeProperties(e,n),r.measurements=R.sanitizeMeasurements(e,i),r}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(W),function(){}),V=function(){this.hasFullStack=!0,this.parsedStack=[]},K=(function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:p.Required,exceptions:p.Required,severityLevel:p.Default,properties:p.Default,measurements:p.Default},a.properties=R.sanitizeProperties(e,n),a.measurements=R.sanitizeMeasurements(e,i),a.exceptions=[new K(e,t)],r&&(a.severityLevel=r),a}z(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return z(e,t),e}(X)),function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:p.Default,outerId:p.Default,typeName:p.Required,message:p.Required,hasFullStack:p.Default,stack:p.Default,parsedStack:p.Array},n.typeName=R.sanitizeString(e,t.name)||E.NotSpecified,n.message=R.sanitizeMessage(e,t.message)||E.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=R.sanitizeException(e,i),n.hasFullStack=E.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return z(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(Q.regex.test(o)){var s=new Q(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=f-d+1;t.splice(d,h);break}d=c,f=u,c++,u--}}return t},e}(V)),Q=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:p.Required,method:p.Required,assembly:p.Default,fileName:p.Default,line:p.Default},n.level=t,n.method="<no_method>",n.assembly=E.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=E.trim(i[2])||n.method,n.fileName=E.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return z(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(B),Y=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return z(e,t),e}(X);(P=k||(k={}))[P.Measurement=0]="Measurement",P[P.Aggregation=1]="Aggregation";var J,$,Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:p.Required,kind:p.Default,value:p.Required,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default},e}return z(e,t),e}(function(){this.kind=k.Measurement}),ee=(function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;s.aiDataContract={ver:p.Required,metrics:p.Required,properties:p.Default};var c=new Z;return c.count=0<i?i:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(r)||null===r?void 0:r,c.name=R.sanitizeString(e,t)||E.NotSpecified,c.value=n,s.metrics=[c],s.properties=R.sanitizeProperties(e,o),s}z(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}(Y),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(W)),te=(function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,properties:p.Default,measurements:p.Default,id:p.Default},s.id=R.sanitizeId(e,o),s.url=R.sanitizeUrl(e,n),s.name=R.sanitizeString(e,t)||E.NotSpecified,isNaN(i)||(s.duration=E.msToTimeSpan(i)),s.properties=R.sanitizeProperties(e,r),s.measurements=R.sanitizeMeasurements(e,a),s}z(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ee),function(h){function e(e,t,n,i,r,a,o,s,c,u,l){void 0===c&&(c="Ajax");var d=h.call(this)||this;d.aiDataContract={id:p.Required,ver:p.Required,name:p.Default,resultCode:p.Default,duration:p.Default,success:p.Default,data:p.Default,target:p.Default,type:p.Default,properties:p.Default,measurements:p.Default,kind:p.Default,value:p.Default,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default,dependencyKind:p.Default,dependencySource:p.Default,commandName:p.Default,dependencyTypeName:p.Default},d.id=t,d.duration=E.msToTimeSpan(r),d.success=a,d.resultCode=o+"",d.type=R.sanitizeString(e,c);var f=L.ParseDependencyPath(e,n,s,i);return d.data=R.sanitizeUrl(e,i)||f.data,d.target=f.target,d.name=f.name,d.properties=R.sanitizeProperties(e,u),d.measurements=R.sanitizeMeasurements(e,l),d}return z(e,h),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 z(e,t),e}(X)));(function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:p.Required,message:p.Required,severityLevel:p.Default,properties:p.Default},t=t||E.NotSpecified,r.message=R.sanitizeMessage(e,t),r.properties=R.sanitizeProperties(e,i),n&&(r.severityLevel=n),r}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData"})(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return z(e,t),e}(X)),function(s){function e(e,t,n,i,r,a){var o=s.call(this)||this;return o.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,perfTotal:p.Default,networkConnect:p.Default,sentRequest:p.Default,receivedResponse:p.Default,domProcessing:p.Default,properties:p.Default,measurements:p.Default},o.url=R.sanitizeUrl(e,n),o.name=R.sanitizeString(e,t)||E.NotSpecified,o.properties=R.sanitizeProperties(e,r),o.measurements=R.sanitizeMeasurements(e,a),o}z(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(ee)),function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:p.Required,baseData:p.Required},n.baseType=e,n.baseData=t,n}z(e,i)}(G);($=J||(J={}))[$.Verbose=0]="Verbose",$[$.Information=1]="Information",$[$.Warning=2]="Warning",$[$.Error=3]="Error",$[$.Critical=4]="Critical";var ne=function(){function e(){}return e.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(r)?i:r},e}(),ie=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=R.sanitizeString(i,n)||E.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}(),re=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ae=function(){function e(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new re,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*H.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?U.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?R.sanitizeUrl(this._logger,U.getCompleteUrl(this.method,this.requestUrl)):null},e}(),oe=function(){function e(){}return e.AttachEvent=function(e,t,n){var i=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),i=!0):(e.attachEvent("on"+t,n),i=!0)),i},e.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),se=function(){function o(){this._trackAjaxAttempts=0,this.identifier=o.identifier,this.priority=161,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return o.prototype.isMonitoredInstance=function(e,t,n,i){var r=!1,a=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,r="object"==typeof n&&!0===n[F]||!!i&&!0===i[F]):void 0!==e&&(o=this.initialized,r=!0===e[F],a=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&a&&!r},o.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},o.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,r=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!r.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||r.openHandler(this,e,t,n)}catch(e){this._core.logger.throwInternal(a.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:E.dump(e)})}return i.apply(this,arguments)}},o.prototype.openHandler=function(e,t,n,i){var r;r=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+E.newId():E.newId();var a=new ae(r,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},o.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},o.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){this._core.logger.throwInternal(a.CRITICAL,y,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:E.dump(e)})}return t.apply(this,arguments)}},o.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=H.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},o.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){this._core.logger.throwInternal(a.CRITICAL,s,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:E.dump(e)})}return e.apply(this,arguments)}},o.prototype.attachToOnReadyStateChange=function(n){var i=this,e=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=oe.AttachEvent(n,"readystatechange",function(){try{e.isMonitoredInstance(n)&&4===n.readyState&&e.onAjaxComplete(n)}catch(e){var t=E.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||i._core.logger.throwInternal(a.CRITICAL,v,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(n),exception:E.dump(e)})}})},o.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=H.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},o.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(j.requestContextHeaderLowerCase)){var n=t.getResponseHeader(j.requestContextHeader);return q.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var i=ie.create(e,te.dataType,te.envelopeType,this._core.logger,t,n);this._core.track(i)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(a.CRITICAL,I,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},o.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},o.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},o.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},o.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var i=window.fetch,r=this;window.fetch=function(t,e){var n;if(r.isFetchInstrumented(t)&&r.isMonitoredInstance(void 0,void 0,t,e))try{n=r.createFetchRecord(t,e),e=r.includeCorrelationHeaders(n,t,e)}catch(e){r._core.logger.throwInternal(a.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}return i(t,e).then(function(e){return r.onFetchComplete(e,n),e}).catch(function(e){throw r.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},o.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[F]},o.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},o.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+E.newId():E.newId();var i=new ae(n,this._core.logger);return i.requestSentTime=H.Now(),e instanceof Request?i.requestUrl=e?e.url:"":i.requestUrl=e,t&&t.method?i.method=t.method:e&&e instanceof Request?i.method=e.method:i.method="GET",i},o.prototype.includeCorrelationHeaders=function(e,t,n,i){if(t){if(q.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(j.requestIdHeader,e.id);var r=this._config.appId;return r&&n.headers.set(j.requestContextHeader,j.requestContextAppIdFormat+r),n}return n}if(i){if(this.currentWindowHost&&q.canIncludeCorrelationHeader(this._config,i.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){i.setRequestHeader(j.requestIdHeader,i.ajaxData.id);var a=this._config.appId;a&&i.setRequestHeader(j.requestContextHeader,j.requestContextAppIdFormat+a)}return i}},o.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(a.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:E.dump(e)})}return t},o.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},i=this.getFetchCorrelationContext(t);i&&(n.correlationContext=i),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var i={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(i,{error:n.message})}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(j.requestContextHeader);return q.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},o.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},o.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},o.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var i=o.getDefaultConfig();for(var r in this._config=o.getEmptyConfig(),i)this._config[r]=ne.getConfig(e,r,o.identifier,i[r]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){var a=n.AppInsightsPropertiesPlugin;a&&(this._context=a.context)}}},o.identifier="AjaxDependencyPlugin",o}();e.AjaxPlugin=se,e.ajaxRecord=ae,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map
/*!
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-beta.2
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-beta.3
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var i,t,g,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=g||(g={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var m,r,c=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),a=/[xy]/g;(r=m||(m={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var o=1,u=2,l=3,d=4,f=5,p=6,v=8,x=10,s=13,h=14,y=15,D=16,S=17,I=18,w=45,C=52,N=55,A=56,_=57,T=61,M=66,b=68,E=69,R=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=R}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 a=this;if(this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(j+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];s.priority>R&&e.push(s)}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)}}}(),500),j="Channel has invalid priority",q=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),U=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 a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}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,_,"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,T,"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,M)},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,A,"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,C,"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,E).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}(),L=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,o,"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,l,"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,f,"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,u,"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,d,"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,b,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},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(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].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,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},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}(),H=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}(),O=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=H.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var i=e&&e.correlationHeaderExcludedDomains;if(!i||0==i.length)return!0;for(var a=0;a<i.length;a++){if(new RegExp(i[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,q.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var i=n[r].split("=");if(2==i.length&&i[0]==t)return i[1]}},n.correlationIdPrefix="cid-v1:",n}(),F=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=H.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=U.sanitizeString(e,n?n+" "+c:c)}else a=U.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),z=function(){function e(){}return 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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),k="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",P=function(e,t){return(P=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 G(e,t){function n(){this.constructor=e}P(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X,W,B=function(e){function t(){return e.call(this)||this}return G(t,e),t}(function(){}),V=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=U.sanitizeString(e,n)||L.NotSpecified,r.data=t,r.time=L.toISOStringForIE8(new Date),r.aiDataContract={time:g.Required,iKey:g.Required,name:g.Required,sampleRate:function(){return 100==r.sampleRate?g.Hidden:g.Required},tags:g.Required,data:g.Required},r}G(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),K=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return G(e,t),e}(V),Q=(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:g.Required,name:g.Required,properties:g.Default,measurements:g.Default},i.name=U.sanitizeString(e,t)||L.NotSpecified,i.properties=U.sanitizeProperties(e,n),i.measurements=U.sanitizeMeasurements(e,r),i}G(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(K),function(){}),Y=function(){this.hasFullStack=!0,this.parsedStack=[]},J=(function(o){function e(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:g.Required,exceptions:g.Required,severityLevel:g.Default,properties:g.Default,measurements:g.Default},a.properties=U.sanitizeProperties(e,n),a.measurements=U.sanitizeMeasurements(e,r),a.exceptions=[new J(e,t)],i&&(a.severityLevel=i),a}G(e,o),e.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return G(e,t),e}(V)),function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:g.Default,outerId:g.Default,typeName:g.Required,message:g.Required,hasFullStack:g.Default,stack:g.Default,parsedStack:g.Array},n.typeName=U.sanitizeString(e,t.name)||L.NotSpecified,n.message=U.sanitizeMessage(e,t.message)||L.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=U.sanitizeException(e,r),n.hasFullStack=L.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return G(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,a=0;a<=n.length;a++){var o=n[a];if($.regex.test(o)){var s=new $(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=c,f=u,c++,u--}}return t},e}(Y)),$=function(i){function a(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:g.Required,method:g.Required,assembly:g.Default,fileName:g.Default,line:g.Default},n.level=t,n.method="<no_method>",n.assembly=L.trim(e);var r=e.match(a.regex);return r&&5<=r.length&&(n.method=L.trim(r[2])||n.method,n.fileName=L.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+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return G(a,i),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(Q),Z=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return G(e,t),e}(V);(W=X||(X={}))[W.Measurement=0]="Measurement",W[W.Aggregation=1]="Aggregation";var ee,te,ne=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:g.Required,kind:g.Default,value:g.Required,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default},e}return G(e,t),e}(function(){this.kind=X.Measurement}),re=(function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;s.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var c=new ne;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=U.sanitizeString(e,t)||L.NotSpecified,c.value=n,s.metrics=[c],s.properties=U.sanitizeProperties(e,o),s}G(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}(Z),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return G(e,t),e}(K)),ie=(function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,properties:g.Default,measurements:g.Default,id:g.Default},s.id=U.sanitizeId(e,o),s.url=U.sanitizeUrl(e,n),s.name=U.sanitizeString(e,t)||L.NotSpecified,isNaN(r)||(s.duration=L.msToTimeSpan(r)),s.properties=U.sanitizeProperties(e,i),s.measurements=U.sanitizeMeasurements(e,a),s}G(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(re),function(p){function e(e,t,n,r,i,a,o,s,c,u,l){void 0===c&&(c="Ajax");var d=p.call(this)||this;d.aiDataContract={id:g.Required,ver:g.Required,name:g.Default,resultCode:g.Default,duration:g.Default,success:g.Default,data:g.Default,target:g.Default,type:g.Default,properties:g.Default,measurements:g.Default,kind:g.Default,value:g.Default,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default,dependencyKind:g.Default,dependencySource:g.Default,commandName:g.Default,dependencyTypeName:g.Default},d.id=t,d.duration=L.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=U.sanitizeString(e,c);var f=F.ParseDependencyPath(e,n,s,r);return d.data=U.sanitizeUrl(e,r)||f.data,d.target=f.target,d.name=f.name,d.properties=U.sanitizeProperties(e,u),d.measurements=U.sanitizeMeasurements(e,l),d}return G(e,p),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 G(e,t),e}(V)));(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:g.Required,message:g.Required,severityLevel:g.Default,properties:g.Default},t=t||L.NotSpecified,i.message=U.sanitizeMessage(e,t),i.properties=U.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}G(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData"})(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return G(e,t),e}(V)),function(p){function h(e,t,n,r,i,a){var o=p.call(this)||this;o.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,perfTotal:g.Default,networkConnect:g.Default,sentRequest:g.Default,receivedResponse:g.Default,domProcessing:g.Default,properties:g.Default,measurements:g.Default},o.isValid=!1;var s=h.getPerformanceTiming();if(s){var c=h.getDuration(s.navigationStart,s.loadEventEnd),u=h.getDuration(s.navigationStart,s.connectEnd),l=h.getDuration(s.requestStart,s.responseStart),d=h.getDuration(s.responseStart,s.responseEnd),f=h.getDuration(s.responseEnd,s.loadEventEnd);0==c?e.throwInternal(m.WARNING,x,"error calculating page view performance.",{total:c,network:u,request:l,response:d,dom:f}):h.shouldCollectDuration(c,u,l,d,f)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(f)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:f}):(o.durationMs=c,o.perfTotal=o.duration=L.msToTimeSpan(c),o.networkConnect=L.msToTimeSpan(u),o.sentRequest=L.msToTimeSpan(l),o.receivedResponse=L.msToTimeSpan(d),o.domProcessing=L.msToTimeSpan(f),o.isValid=!0):e.throwInternal(m.WARNING,w,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:d,dom:f})}return o.url=U.sanitizeUrl(e,n),o.name=U.sanitizeString(e,t)||L.NotSpecified,o.properties=U.sanitizeProperties(e,i),o.measurements=U.sanitizeMeasurements(e,a),o}G(h,p),h.prototype.getIsValid=function(){return this.isValid},h.prototype.getDurationMs=function(){return this.durationMs},h.getPerformanceTiming=function(){return h.isPerformanceTimingSupported()?window.performance.timing:null},h.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},h.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},h.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},h.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 a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(var o=0;o<e.length;o++)if(e[o]>=h.MAX_DURATION_ALLOWED)return!1;return!0},h.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",h.dataType="PageviewPerformanceData",h.MAX_DURATION_ALLOWED=36e5}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return G(e,t),e}(re)),function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:g.Required,baseData:g.Required},n.baseType=e,n.baseData=t,n}G(e,r)}(B);(te=ee||(ee={}))[te.Verbose=0]="Verbose",te[te.Information=1]="Information",te[te.Warning=2]="Warning",te[te.Error=3]="Error",te[te.Critical=4]="Critical";var ae=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(i)?r:i},e}(),oe=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=U.sanitizeString(r,n)||L.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},e}(),se=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ce=function(){function e(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new se,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*z.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?H.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?U.sanitizeUrl(this._logger,H.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ue=function(){function e(){}return e.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},e.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),le=function(){function o(){this._trackAjaxAttempts=0,this.identifier=o.identifier,this.priority=161,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return o.prototype.isMonitoredInstance=function(e,t,n,r){var i=!1,a=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,i="object"==typeof n&&!0===n[k]||!!r&&!0===r[k]):void 0!==e&&(o=this.initialized,i=!0===e[k],a=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&a&&!i},o.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},o.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,i=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!i.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||i.openHandler(this,e,t,n)}catch(e){this._core.logger.throwInternal(m.CRITICAL,y,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:L.dump(e)})}return r.apply(this,arguments)}},o.prototype.openHandler=function(e,t,n,r){var i;i=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+L.newId():L.newId();var a=new ce(i,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},o.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},o.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){this._core.logger.throwInternal(m.CRITICAL,S,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:L.dump(e)})}return t.apply(this,arguments)}},o.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=z.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},o.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){this._core.logger.throwInternal(m.CRITICAL,s,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:L.dump(e)})}return e.apply(this,arguments)}},o.prototype.attachToOnReadyStateChange=function(n){var r=this,e=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ue.AttachEvent(n,"readystatechange",function(){try{e.isMonitoredInstance(n)&&4===n.readyState&&e.onAjaxComplete(n)}catch(e){var t=L.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(m.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(n),exception:L.dump(e)})}})},o.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=z.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,h,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},o.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(q.requestContextHeaderLowerCase)){var n=t.getResponseHeader(q.requestContextHeader);return O.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=oe.create(e,ie.dataType,ie.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(m.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},o.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},o.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},o.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},o.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,i=this;window.fetch=function(t,e){var n;if(i.isFetchInstrumented(t)&&i.isMonitoredInstance(void 0,void 0,t,e))try{n=i.createFetchRecord(t,e),e=i.includeCorrelationHeaders(n,t,e)}catch(e){i._core.logger.throwInternal(m.CRITICAL,y,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}return r(t,e).then(function(e){return i.onFetchComplete(e,n),e}).catch(function(e){throw i.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},o.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[k]},o.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},o.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+L.newId():L.newId();var r=new ce(n,this._core.logger);return r.requestSentTime=z.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},o.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(O.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(q.requestIdHeader,e.id);var i=this._config.appId;return i&&n.headers.set(q.requestContextHeader,q.requestContextAppIdFormat+i),n}return n}if(r){if(this.currentWindowHost&&O.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(q.requestIdHeader,r.ajaxData.id);var a=this._config.appId;a&&r.setRequestHeader(q.requestContextHeader,q.requestContextAppIdFormat+a)}return r}},o.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(m.CRITICAL,y,"Failed to grab failed fetch diagnostics message",{exception:L.dump(e)})}return t},o.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=z.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,h,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=z.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,h,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(q.requestContextHeader);return O.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(m.WARNING,I,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:L.dump(e)})}},o.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},o.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},o.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},o.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=o.getDefaultConfig();for(var i in this._config=o.getEmptyConfig(),r)this._config[i]=ae.getConfig(e,i,o.identifier,r[i]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){var a=n.AppInsightsPropertiesPlugin;a&&(this._context=a.context)}}},o.identifier="AjaxDependencyPlugin",o}();e.AjaxPlugin=le,e.ajaxRecord=ce,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r,t,p,n;(t=r||(r={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=p||(p={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var a,i,c=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;(i=a||(a={}))[i.CRITICAL=1]="CRITICAL",i[i.WARNING=2]="WARNING";var u=1,l=2,d=3,f=4,h=5,g=6,s=13,m=14,x=15,v=16,y=17,D=18,S=52,I=55,C=56,w=57,N=61,A=66,_=68,M=69,T=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=T}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,i,r){var a=this;if(this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<T&&(o=e.identifier),e.initialize(n,i,r)}),o)throw Error(b+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<r.length;t++){var s=r[t];s.priority>T&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),b="Channel has invalid priority",j=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),R=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},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(a.WARNING,w,"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(a.WARNING,N,"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,A)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(a.WARNING,C,"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(a.WARNING,S,"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 i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,M).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(a.WARNING,i,"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}(),E=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.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(a.WARNING,u,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(a.WARNING,d,"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(a.WARNING,h,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.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(a.WARNING,l,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(a.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(a.WARNING,g,"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(a.WARNING,_,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},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 i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].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,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},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}(),U=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),q=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=U.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,j.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),L=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a=i,o=i;if(t&&0<t.length){var s=U.parseUrl(t);if(r=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=R.sanitizeString(e,n?n+" "+c:c)}else a=R.sanitizeString(e,t)}else a=r=i;return{target:r,name:a,data:o}},e}(),H=function(){function e(){}return 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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),F="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",O=function(e,t){return(O=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 z(e,t){function n(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k,P,G=function(e){function t(){return e.call(this)||this}return z(t,e),t}(function(){}),X=(function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=R.sanitizeString(e,n)||E.NotSpecified,i.data=t,i.time=E.toISOStringForIE8(new Date),i.aiDataContract={time:p.Required,iKey:p.Required,name:p.Required,sampleRate:function(){return 100==i.sampleRate?p.Hidden:p.Required},tags:p.Required,data:p.Required},i}z(e,r)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(X),B=(function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:p.Required,name:p.Required,properties:p.Default,measurements:p.Default},r.name=R.sanitizeString(e,t)||E.NotSpecified,r.properties=R.sanitizeProperties(e,n),r.measurements=R.sanitizeMeasurements(e,i),r}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(W),function(){}),V=function(){this.hasFullStack=!0,this.parsedStack=[]},K=(function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:p.Required,exceptions:p.Required,severityLevel:p.Default,properties:p.Default,measurements:p.Default},a.properties=R.sanitizeProperties(e,n),a.measurements=R.sanitizeMeasurements(e,i),a.exceptions=[new K(e,t)],r&&(a.severityLevel=r),a}z(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return z(e,t),e}(X)),function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:p.Default,outerId:p.Default,typeName:p.Required,message:p.Required,hasFullStack:p.Default,stack:p.Default,parsedStack:p.Array},n.typeName=R.sanitizeString(e,t.name)||E.NotSpecified,n.message=R.sanitizeMessage(e,t.message)||E.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=R.sanitizeException(e,i),n.hasFullStack=E.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return z(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(Q.regex.test(o)){var s=new Q(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=f-d+1;t.splice(d,h);break}d=c,f=u,c++,u--}}return t},e}(V)),Q=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:p.Required,method:p.Required,assembly:p.Default,fileName:p.Default,line:p.Default},n.level=t,n.method="<no_method>",n.assembly=E.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=E.trim(i[2])||n.method,n.fileName=E.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return z(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(B),Y=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return z(e,t),e}(X);(P=k||(k={}))[P.Measurement=0]="Measurement",P[P.Aggregation=1]="Aggregation";var J,$,Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:p.Required,kind:p.Default,value:p.Required,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default},e}return z(e,t),e}(function(){this.kind=k.Measurement}),ee=(function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;s.aiDataContract={ver:p.Required,metrics:p.Required,properties:p.Default};var c=new Z;return c.count=0<i?i:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(r)||null===r?void 0:r,c.name=R.sanitizeString(e,t)||E.NotSpecified,c.value=n,s.metrics=[c],s.properties=R.sanitizeProperties(e,o),s}z(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}(Y),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(W)),te=(function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,properties:p.Default,measurements:p.Default,id:p.Default},s.id=R.sanitizeId(e,o),s.url=R.sanitizeUrl(e,n),s.name=R.sanitizeString(e,t)||E.NotSpecified,isNaN(i)||(s.duration=E.msToTimeSpan(i)),s.properties=R.sanitizeProperties(e,r),s.measurements=R.sanitizeMeasurements(e,a),s}z(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ee),function(h){function e(e,t,n,i,r,a,o,s,c,u,l){void 0===c&&(c="Ajax");var d=h.call(this)||this;d.aiDataContract={id:p.Required,ver:p.Required,name:p.Default,resultCode:p.Default,duration:p.Default,success:p.Default,data:p.Default,target:p.Default,type:p.Default,properties:p.Default,measurements:p.Default,kind:p.Default,value:p.Default,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default,dependencyKind:p.Default,dependencySource:p.Default,commandName:p.Default,dependencyTypeName:p.Default},d.id=t,d.duration=E.msToTimeSpan(r),d.success=a,d.resultCode=o+"",d.type=R.sanitizeString(e,c);var f=L.ParseDependencyPath(e,n,s,i);return d.data=R.sanitizeUrl(e,i)||f.data,d.target=f.target,d.name=f.name,d.properties=R.sanitizeProperties(e,u),d.measurements=R.sanitizeMeasurements(e,l),d}return z(e,h),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 z(e,t),e}(X)));(function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:p.Required,message:p.Required,severityLevel:p.Default,properties:p.Default},t=t||E.NotSpecified,r.message=R.sanitizeMessage(e,t),r.properties=R.sanitizeProperties(e,i),n&&(r.severityLevel=n),r}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData"})(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return z(e,t),e}(X)),function(s){function e(e,t,n,i,r,a){var o=s.call(this)||this;return o.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,perfTotal:p.Default,networkConnect:p.Default,sentRequest:p.Default,receivedResponse:p.Default,domProcessing:p.Default,properties:p.Default,measurements:p.Default},o.url=R.sanitizeUrl(e,n),o.name=R.sanitizeString(e,t)||E.NotSpecified,o.properties=R.sanitizeProperties(e,r),o.measurements=R.sanitizeMeasurements(e,a),o}z(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(ee)),function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:p.Required,baseData:p.Required},n.baseType=e,n.baseData=t,n}z(e,i)}(G);($=J||(J={}))[$.Verbose=0]="Verbose",$[$.Information=1]="Information",$[$.Warning=2]="Warning",$[$.Error=3]="Error",$[$.Critical=4]="Critical";var ne=function(){function e(){}return e.getConfig=function(e,t,n,i){var r;return void 0===i&&(i=!1),r=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(r)?i:r},e}(),ie=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=R.sanitizeString(i,n)||E.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}(),re=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ae=function(){function e(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new re,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*H.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?U.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?R.sanitizeUrl(this._logger,U.getCompleteUrl(this.method,this.requestUrl)):null},e}(),oe=function(){function e(){}return e.AttachEvent=function(e,t,n){var i=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),i=!0):(e.attachEvent("on"+t,n),i=!0)),i},e.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),se=function(){function o(){this._trackAjaxAttempts=0,this.identifier=o.identifier,this.priority=161,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return o.prototype.isMonitoredInstance=function(e,t,n,i){var r=!1,a=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,r="object"==typeof n&&!0===n[F]||!!i&&!0===i[F]):void 0!==e&&(o=this.initialized,r=!0===e[F],a=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&a&&!r},o.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},o.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,r=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!r.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||r.openHandler(this,e,t,n)}catch(e){this._core.logger.throwInternal(a.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:E.dump(e)})}return i.apply(this,arguments)}},o.prototype.openHandler=function(e,t,n,i){var r;r=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+E.newId():E.newId();var a=new ae(r,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},o.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},o.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){this._core.logger.throwInternal(a.CRITICAL,y,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:E.dump(e)})}return t.apply(this,arguments)}},o.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=H.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},o.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){this._core.logger.throwInternal(a.CRITICAL,s,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:E.dump(e)})}return e.apply(this,arguments)}},o.prototype.attachToOnReadyStateChange=function(n){var i=this,e=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=oe.AttachEvent(n,"readystatechange",function(){try{e.isMonitoredInstance(n)&&4===n.readyState&&e.onAjaxComplete(n)}catch(e){var t=E.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||i._core.logger.throwInternal(a.CRITICAL,v,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(n),exception:E.dump(e)})}})},o.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=H.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},o.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(j.requestContextHeaderLowerCase)){var n=t.getResponseHeader(j.requestContextHeader);return q.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var i=ie.create(e,te.dataType,te.envelopeType,this._core.logger,t,n);this._core.track(i)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(a.CRITICAL,I,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},o.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},o.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},o.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},o.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var i=window.fetch,r=this;window.fetch=function(t,e){var n;if(r.isFetchInstrumented(t)&&r.isMonitoredInstance(void 0,void 0,t,e))try{n=r.createFetchRecord(t,e),e=r.includeCorrelationHeaders(n,t,e)}catch(e){r._core.logger.throwInternal(a.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}return i(t,e).then(function(e){return r.onFetchComplete(e,n),e}).catch(function(e){throw r.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},o.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[F]},o.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},o.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+E.newId():E.newId();var i=new ae(n,this._core.logger);return i.requestSentTime=H.Now(),e instanceof Request?i.requestUrl=e?e.url:"":i.requestUrl=e,t&&t.method?i.method=t.method:e&&e instanceof Request?i.method=e.method:i.method="GET",i},o.prototype.includeCorrelationHeaders=function(e,t,n,i){if(t){if(q.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(j.requestIdHeader,e.id);var r=this._config.appId;return r&&n.headers.set(j.requestContextHeader,j.requestContextAppIdFormat+r),n}return n}if(i){if(this.currentWindowHost&&q.canIncludeCorrelationHeader(this._config,i.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){i.setRequestHeader(j.requestIdHeader,i.ajaxData.id);var a=this._config.appId;a&&i.setRequestHeader(j.requestContextHeader,j.requestContextAppIdFormat+a)}return i}},o.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(a.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:E.dump(e)})}return t},o.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},i=this.getFetchCorrelationContext(t);i&&(n.correlationContext=i),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var i={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(i,{error:n.message})}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(j.requestContextHeader);return q.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:E.dump(e)})}},o.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},o.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},o.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},o.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var i=o.getDefaultConfig();for(var r in this._config=o.getEmptyConfig(),i)this._config[r]=ne.getConfig(e,r,o.identifier,i[r]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){var a=n.AppInsightsPropertiesPlugin;a&&(this._context=a.context)}}},o.identifier="AjaxDependencyPlugin",o}();e.AjaxPlugin=se,e.ajaxRecord=ae,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map
{
"name": "@microsoft/applicationinsights-dependencies-js",
"version": "2.0.0-beta.2",
"version": "2.0.0-beta.3",
"description": "Microsoft Application Insights XHR dependencies plugin",

@@ -31,4 +31,4 @@ "main": "dist/applicationinsights-dependencies-js.js",

"dependencies": {
"@microsoft/applicationinsights-core-js": "^2.0.0-beta.2",
"@microsoft/applicationinsights-common": "^2.0.0-beta.2",
"@microsoft/applicationinsights-core-js": "^2.0.0-beta.3",
"@microsoft/applicationinsights-common": "^2.0.0-beta.3",
"tslib": "^1.9.3"

@@ -35,0 +35,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 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