@microsoft/applicationinsights-dependencies-js
Advanced tools
Comparing version 1.0.0-beta.3 to 1.0.0-beta.4
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.3 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.4 | ||
* 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.aidependencies={})}(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,u=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,c=2,l=3,d=4,f=5,p=6,v=8,x=10,s=13,h=14,D=15,y=16,S=17,I=18,w=45,N=52,C=55,A=56,T=57,_=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)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<i.length;t++){var o=i[t];o.priority>R&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),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}(),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,T,"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,_,"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,N,"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}(),q=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,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,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}(),L=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}(),H=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=L.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,j.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}(),O=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a;if(t&&0<t.length){var o=L.parseUrl(t);if(i=o.host,null!=o.pathname)"/"!==(r=0===o.pathname.length?"/":o.pathname).charAt(0)&&(r="/"+r),a=U.sanitizeString(e,n?n+" "+r:r);else a=U.sanitizeString(e,t)}else a=i=r;return{target:i,name:a}},e}(),F=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||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),k="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",z=function(e,t){return(z=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 P(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var G,X,W=function(e){function t(){return e.call(this)||this}return P(t,e),t}(function(){}),B=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=U.sanitizeString(e,n)||q.NotSpecified,r.data=t,r.time=q.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}P(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),V=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(B),K=(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)||q.NotSpecified,i.properties=U.sanitizeProperties(e,n),i.measurements=U.sanitizeMeasurements(e,r),i}P(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(V),function(){}),Q=function(){this.hasFullStack=!0,this.parsedStack=[]},Y=(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 Y(e,t)],i&&(a.severityLevel=i),a}P(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 P(e,t),e}(B)),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)||q.NotSpecified,n.message=U.sanitizeMessage(e,t.message)||q.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=U.sanitizeException(e,r),n.hasFullStack=q.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return P(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(J.regex.test(o)){var s=new J(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var u=0,c=t.length-1,l=0,d=u,f=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=u,f=c,u++,c--}}return t},e}(Q)),J=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=q.trim(e);var r=e.match(a.regex);return r&&5<=r.length&&(n.method=q.trim(r[2])||n.method,n.fileName=q.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 P(a,i),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(K),$=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return P(e,t),e}(B);(X=G||(G={}))[X.Measurement=0]="Measurement",X[X.Aggregation=1]="Aggregation";var Z,ee,te=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 P(e,t),e}(function(){this.kind=G.Measurement}),ne=(function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;s.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var u=new te;return u.count=0<r?r:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(i)||null===i?void 0:i,u.name=U.sanitizeString(e,t)||q.NotSpecified,u.value=n,s.metrics=[u],s.properties=U.sanitizeProperties(e,o),s}P(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}($),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(V)),re=(function(u){function e(e,t,n,r,i,a,o){var s=u.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)||q.NotSpecified,isNaN(r)||(s.duration=q.msToTimeSpan(r)),s.properties=U.sanitizeProperties(e,i),s.measurements=U.sanitizeMeasurements(e,a),s}P(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ne),function(f){function e(e,t,n,r,i,a,o,s,u,c){var l=f.call(this)||this;l.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},l.id=t,l.duration=q.msToTimeSpan(i),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=U.sanitizeUrl(e,r);var d=O.ParseDependencyPath(e,n,s,r);return l.target=d.target,l.name=d.name,l.properties=U.sanitizeProperties(e,u),l.measurements=U.sanitizeMeasurements(e,c),l}return P(e,f),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 P(e,t),e}(B)));(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||q.NotSpecified,i.message=U.sanitizeMessage(e,t),i.properties=U.sanitizeProperties(e,n),r&&(i.severityLevel=r),i}P(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 P(e,t),e}(B)),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 u=h.getDuration(s.navigationStart,s.loadEventEnd),c=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==u?e.throwInternal(m.WARNING,x,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:f}):h.shouldCollectDuration(u,c,l,d,f)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(f)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:f}):(o.durationMs=u,o.perfTotal=o.duration=q.msToTimeSpan(u),o.networkConnect=q.msToTimeSpan(c),o.sentRequest=q.msToTimeSpan(l),o.receivedResponse=q.msToTimeSpan(d),o.domProcessing=q.msToTimeSpan(f),o.isValid=!0):e.throwInternal(m.WARNING,w,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:f})}return o.url=U.sanitizeUrl(e,n),o.name=U.sanitizeString(e,t)||q.NotSpecified,o.properties=U.sanitizeProperties(e,i),o.measurements=U.sanitizeMeasurements(e,a),o}P(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 P(e,t),e}(ne)),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}P(e,r)}(W);(ee=Z||(Z={}))[ee.Verbose=0]="Verbose",ee[ee.Information=1]="Information",ee[ee.Warning=2]="Warning",ee[ee.Error=3]="Error",ee[ee.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),void 0!==(i=n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t])?i:r},e}(),ae=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=U.sanitizeString(r,n)||q.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},e}(),oe=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},se=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 oe,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*F.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?L.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?U.sanitizeUrl(this._logger,L.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ue=function(){function e(){}return e.AttachEvent=function(e,t,n){var r=!1;return u.isNullOrUndefined(e)||(u.isNullOrUndefined(e.attachEvent)?u.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},e.DetachEvent=function(e,t,n){u.isNullOrUndefined(e)||(u.isNullOrUndefined(e.detachEvent)?u.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),ce=function(){function a(){this._trackAjaxAttempts=0,this.identifier=a.identifier,this.priority=161,this.currentWindowHost=window&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return a.prototype.isMonitoredInstance=function(e,t){return this.initialized&&(!0===t||!u.isNullOrUndefined(e.ajaxData))&&!0!==e[k]},a.prototype.supportsAjaxMonitoring=function(){var e=!0;return(u.isNullOrUndefined(XMLHttpRequest)||u.isNullOrUndefined(XMLHttpRequest.prototype)||u.isNullOrUndefined(XMLHttpRequest.prototype.open)||u.isNullOrUndefined(XMLHttpRequest.prototype.send)||u.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},a.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,D,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return r.apply(this,arguments)}},a.prototype.openHandler=function(e,t,n,r){var i=q.newId(),a=new se(i,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},a.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{u.isNullOrUndefined(e)||u.isNullOrUndefined(e.ajaxData)||u.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},a.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:a.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return t.apply(this,arguments)}},a.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=F.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},a.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:a.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return e.apply(this,arguments)}},a.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=q.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(m.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedAjaxDiagnosticsMessage(n),exception:q.dump(e)})}})},a.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=F.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:a.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,absoluteUrl:e.ajaxData.getAbsoluteUrl(),commandName:e.ajaxData.getPathName(),duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,resultCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},a.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 H.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:a.getFailedAjaxDiagnosticsMessage(t),exception:q.dump(e)})}},a.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ae.create(e,re.dataType,re.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(m.CRITICAL,C,"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},a.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},a.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},a.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},a.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))try{n=i.createFetchRecord(t,e),e=i.includeCorrelationHeaders(n,t,e)}catch(e){i._core.logger.throwInternal(m.CRITICAL,D,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.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}},a.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[k]},a.prototype.supportsFetch=function(){var e=!0;return(!window||u.isNullOrUndefined(window.Request)||u.isNullOrUndefined(window.Request.prototype)||u.isNullOrUndefined(window.fetch))&&(e=!1),e},a.prototype.createFetchRecord=function(e,t){var n=q.newId(),r=new se(n,this._core.logger);return r.requestSentTime=F.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},a.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(H.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost))return n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(j.requestIdHeader,e.id),n}else if(r){if(this.currentWindowHost&&H.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(j.requestIdHeader,r.ajaxData.id);var i=this._config.appId;i&&r.setRequestHeader(j.requestContextHeader,j.requestContextAppIdFormat+i)}return r}},a.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{u.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(m.CRITICAL,D,"Failed to grab failed fetch diagnostics message",{exception:q.dump(e)})}return t},a.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=F.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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,resultCode:t.status,method: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:q.dump(e)})}},a.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=F.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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:!1,resultCode:0,method: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:q.dump(e)})}},a.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(j.requestContextHeader);return H.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:q.dump(e)})}},a.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},a.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}},a.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},a.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=a.getDefaultConfig();for(var i in this._config=a.getEmptyConfig(),r)this._config[i]=ie.getConfig(e,i,a.identifier,r[i]);!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch()}},a.identifier="AjaxDependencyPlugin",a}();e.AjaxPlugin=ce,e.ajaxRecord=se,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.aidependencies={})}(this,function(e){"use strict";var a,t,g,n;(t=a||(a={}))[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,i,c=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(r,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),r=/[xy]/g;(i=m||(m={}))[i.CRITICAL=1]="CRITICAL",i[i.WARNING=2]="WARNING";var o=1,u=2,l=3,d=4,h=5,p=6,v=8,x=10,s=13,f=14,y=15,D=16,I=17,S=18,N=45,w=52,A=55,C=56,T=57,M=61,_=66,b=68,R=69,E=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=E}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,a){var r=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,a)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);r.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<a.length;t++){var o=a[t];o.priority>E&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,a)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),U=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}(),j=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,a=s.sanitizeKey(e,t);if(a.length!==i){for(var r=0,o=a;void 0!==n[o];)r++,o=a.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(r);a=o}return a},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,T,"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,M,"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,_)},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,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(m.WARNING,w,"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 a=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=a}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var a=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=a}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,R).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.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}(),q=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(a.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===a.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(a.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 i=s._getLocalStorageObject();if(null!==i)try{return i.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,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(a.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(a.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 i=s._getSessionStorageObject();if(null!==i)try{return i.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,i){var a="",r="";i&&(a=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(r=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+a+";path=/"+r)},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+"=",a=s.document.cookie.split(";"),r=0;r<a.length;r++){var o=a[r];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,a[r].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,a=""+Math.floor(e/36e5)%24,r=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<r?r+".":"")+(a=a.length<2?"0"+a:a)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,a){return("Script error."===e||"Script error"===e)&&!a},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}(),L=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}(),O=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=L.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var r=0;r<a.length;r++){if(new RegExp(a[r].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,U.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 a=n[i].split("=");if(2==a.length&&a[0]==t)return a[1]}},n.correlationIdPrefix="cid-v1:",n}(),k=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var a,r;if(t&&0<t.length){var o=L.parseUrl(t);if(a=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),r=j.sanitizeString(e,n?n+" "+i:i);else r=j.sanitizeString(e,t)}else r=a=i;return{target:a,name:r}},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",z=function(e,t){return(z=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 P(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var G,X,V=function(e){function t(){return e.call(this)||this}return P(t,e),t}(function(){}),W=(function(a){function e(e,t,n){var i=a.call(this)||this;return i.name=j.sanitizeString(e,n)||q.NotSpecified,i.data=t,i.time=q.toISOStringForIE8(new Date),i.aiDataContract={time:g.Required,iKey:g.Required,name:g.Required,sampleRate:function(){return 100==i.sampleRate?g.Hidden:g.Required},tags:g.Required,data:g.Required},i}P(e,a)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),B=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(W),K=(function(r){function e(e,t,n,i){var a=r.call(this)||this;return a.aiDataContract={ver:g.Required,name:g.Required,properties:g.Default,measurements:g.Default},a.name=j.sanitizeString(e,t)||q.NotSpecified,a.properties=j.sanitizeProperties(e,n),a.measurements=j.sanitizeMeasurements(e,i),a}P(e,r),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(B),function(){}),Q=function(){this.hasFullStack=!0,this.parsedStack=[]},Y=(function(o){function e(e,t,n,i,a){var r=o.call(this)||this;return r.aiDataContract={ver:g.Required,exceptions:g.Required,severityLevel:g.Default,properties:g.Default,measurements:g.Default},r.properties=j.sanitizeProperties(e,n),r.measurements=j.sanitizeMeasurements(e,i),r.exceptions=[new Y(e,t)],a&&(r.severityLevel=a),r}P(e,o),e.CreateSimpleException=function(e,t,n,i,a,r){return{exceptions:[{hasFullStack:!0,message:e,stack:a,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 P(e,t),e}(W)),function(a){function e(e,t){var n=a.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=j.sanitizeString(e,t.name)||q.NotSpecified,n.message=j.sanitizeMessage(e,t.message)||q.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=j.sanitizeException(e,i),n.hasFullStack=q.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return P(e,a),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,a=0,r=0;r<=n.length;r++){var o=n[r];if(J.regex.test(o)){var s=new J(n[r],i++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,h=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=h-d+1;t.splice(d,p);break}d=c,h=u,c++,u--}}return t},e}(Q)),J=function(a){function r(e,t){var n=a.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=q.trim(e);var i=e.match(r.regex);return i&&5<=i.length&&(n.method=q.trim(i[2])||n.method,n.fileName=q.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+=r.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return P(r,a),r.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,r.baseSize=58,r}(K),$=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return P(e,t),e}(W);(X=G||(G={}))[X.Measurement=0]="Measurement",X[X.Aggregation=1]="Aggregation";var Z,ee,te=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 P(e,t),e}(function(){this.kind=G.Measurement}),ne=(function(u){function e(e,t,n,i,a,r,o){var s=u.call(this)||this;s.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var c=new te;return c.count=0<i?i:void 0,c.max=isNaN(r)||null===r?void 0:r,c.min=isNaN(a)||null===a?void 0:a,c.name=j.sanitizeString(e,t)||q.NotSpecified,c.value=n,s.metrics=[c],s.properties=j.sanitizeProperties(e,o),s}P(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}($),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(B)),ie=(function(c){function e(e,t,n,i,a,r,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=j.sanitizeId(e,o),s.url=j.sanitizeUrl(e,n),s.name=j.sanitizeString(e,t)||q.NotSpecified,isNaN(i)||(s.duration=q.msToTimeSpan(i)),s.properties=j.sanitizeProperties(e,a),s.measurements=j.sanitizeMeasurements(e,r),s}P(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ne),function(h){function e(e,t,n,i,a,r,o,s,c,u){var l=h.call(this)||this;l.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},l.id=t,l.duration=q.msToTimeSpan(a),l.success=r,l.resultCode=o+"",l.type="Ajax",l.data=j.sanitizeUrl(e,i);var d=k.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=j.sanitizeProperties(e,c),l.measurements=j.sanitizeMeasurements(e,u),l}return P(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 P(e,t),e}(W)));(function(r){function e(e,t,n,i){var a=r.call(this)||this;return a.aiDataContract={ver:g.Required,message:g.Required,severityLevel:g.Default,properties:g.Default},t=t||q.NotSpecified,a.message=j.sanitizeMessage(e,t),a.properties=j.sanitizeProperties(e,n),i&&(a.severityLevel=i),a}P(e,r),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 P(e,t),e}(W)),function(p){function f(e,t,n,i,a,r){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=f.getPerformanceTiming();if(s){var c=f.getDuration(s.navigationStart,s.loadEventEnd),u=f.getDuration(s.navigationStart,s.connectEnd),l=f.getDuration(s.requestStart,s.responseStart),d=f.getDuration(s.responseStart,s.responseEnd),h=f.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:h}):f.shouldCollectDuration(c,u,l,d,h)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(h)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:h}):(o.durationMs=c,o.perfTotal=o.duration=q.msToTimeSpan(c),o.networkConnect=q.msToTimeSpan(u),o.sentRequest=q.msToTimeSpan(l),o.receivedResponse=q.msToTimeSpan(d),o.domProcessing=q.msToTimeSpan(h),o.isValid=!0):e.throwInternal(m.WARNING,N,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:d,dom:h})}return o.url=j.sanitizeUrl(e,n),o.name=j.sanitizeString(e,t)||q.NotSpecified,o.properties=j.sanitizeProperties(e,a),o.measurements=j.sanitizeMeasurements(e,r),o}P(f,p),f.prototype.getIsValid=function(){return this.isValid},f.prototype.getDurationMs=function(){return this.durationMs},f.getPerformanceTiming=function(){return f.isPerformanceTimingSupported()?window.performance.timing:null},f.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},f.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},f.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},f.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,a=!1;if(i)for(var r=0;r<n.length;r++)a=a||-1!==i.toLowerCase().indexOf(n[r]);if(a)return!1;for(var o=0;o<e.length;o++)if(e[o]>=f.MAX_DURATION_ALLOWED)return!1;return!0},f.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",f.dataType="PageviewPerformanceData",f.MAX_DURATION_ALLOWED=36e5}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(ne)),function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:g.Required,baseData:g.Required},n.baseType=e,n.baseData=t,n}P(e,i)}(V);(ee=Z||(Z={}))[ee.Verbose=0]="Verbose",ee[ee.Information=1]="Information",ee[ee.Warning=2]="Warning",ee[ee.Error=3]="Error",ee[ee.Critical=4]="Critical";var ae=function(){function e(){}return e.getConfig=function(e,t,n,i){var a;return void 0===i&&(i=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t],c.isNullOrUndefined(a)?i:a},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},oe=function(){function e(){}return e.create=function(e,t,n,i,a,r){if(n=j.sanitizeString(i,n)||q.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:r||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},e}(),se=(new function(e){this.UserExtensionName="User",this.WebExtensionName="Web",this.AppExtensionName="App",this.accountIdTag="User.AccountId",this.userTagsKeysMap={},this.userTagsKeysMap[this.accountIdTag]=e.userAccountId,this.ctxKeys={id:"id",authId:"authId",localId:"localId"},this.userExtKeysMap={},this.userExtKeysMap[this.ctxKeys.localId]=e.userId,this.userExtKeysMap[this.ctxKeys.authId]=e.userAuthUserId}(new re),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*H.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?L.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?j.sanitizeUrl(this._logger,L.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ue=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}(),le=function(){function r(){this._trackAjaxAttempts=0,this.identifier=r.identifier,this.priority=161,this.currentWindowHost=window&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return r.prototype.isMonitoredInstance=function(e,t){return this.initialized&&(!0===t||!c.isNullOrUndefined(e.ajaxData))&&!0!==e[F]},r.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},r.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.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:r.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return i.apply(this,arguments)}},r.prototype.openHandler=function(e,t,n,i){var a=q.newId(),r=new ce(a,this._core.logger);r.method=t,r.requestUrl=n,r.xhrMonitoringState.openDone=!0,e.ajaxData=r,this.attachToOnReadyStateChange(e)},r.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},r.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,I,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return t.apply(this,arguments)}},r.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=H.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},r.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:r.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return e.apply(this,arguments)}},r.prototype.attachToOnReadyStateChange=function(n){var i=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=q.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||i._core.logger.throwInternal(m.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(n),exception:q.dump(e)})}})},r.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(m.WARNING,f,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,absoluteUrl:e.ajaxData.getAbsoluteUrl(),commandName:e.ajaxData.getPathName(),duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,resultCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},r.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return O.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(t),exception:q.dump(e)})}},r.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var i=oe.create(e,ie.dataType,ie.envelopeType,this._core.logger,t,n);this._core.track(i)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(m.CRITICAL,A,"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},r.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},r.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},r.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},r.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var i=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._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:q.dump(e)})}return i(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},r.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[F]},r.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},r.prototype.createFetchRecord=function(e,t){var n=q.newId(),i=new ce(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},r.prototype.includeCorrelationHeaders=function(e,t,n,i){if(t){if(O.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost))return n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(U.requestIdHeader,e.id),n}else if(i){if(this.currentWindowHost&&O.canIncludeCorrelationHeader(this._config,i.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){i.setRequestHeader(U.requestIdHeader,i.ajaxData.id);var a=this._config.appId;a&&i.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+a)}return i}},r.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:q.dump(e)})}return t},r.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,f,"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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,resultCode:t.status,method:e.method},i=this.getFetchCorrelationContext(t);i&&(n.correlationContext=i),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,S,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.dump(e)})}},r.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,f,"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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:!1,resultCode:0,method:e.method};this.trackDependencyDataInternal(i,{error:n.message})}}catch(e){this._core.logger.throwInternal(m.WARNING,S,"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:q.dump(e)})}},r.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return O.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(m.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.dump(e)})}},r.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},r.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}},r.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},r.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var i=r.getDefaultConfig();for(var a in this._config=r.getEmptyConfig(),i)this._config[a]=ae.getConfig(e,a,r.identifier,i[a]);!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch()}},r.identifier="AjaxDependencyPlugin",r}();e.AjaxPlugin=le,e.ajaxRecord=ce,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.3 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.4 | ||
* 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.aidependencies={})}(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,u=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,c=2,l=3,d=4,f=5,p=6,v=8,x=10,s=13,h=14,D=15,y=16,S=17,I=18,w=45,N=52,C=55,A=56,T=57,_=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)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<i.length;t++){var o=i[t];o.priority>R&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),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}(),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,T,"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,_,"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,N,"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}(),q=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,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(m.WARNING,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}(),L=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}(),H=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=L.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,j.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}(),O=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a;if(t&&0<t.length){var o=L.parseUrl(t);if(i=o.host,null!=o.pathname)"/"!==(r=0===o.pathname.length?"/":o.pathname).charAt(0)&&(r="/"+r),a=U.sanitizeString(e,n?n+" "+r:r);else a=U.sanitizeString(e,t)}else a=i=r;return{target:i,name:a}},e}(),F=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||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),k="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",z=function(e,t){return(z=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 P(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var G,X,W=function(e){function t(){return e.call(this)||this}return P(t,e),t}(function(){}),B=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=U.sanitizeString(e,n)||q.NotSpecified,r.data=t,r.time=q.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}P(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),V=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(B),K=(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)||q.NotSpecified,i.properties=U.sanitizeProperties(e,n),i.measurements=U.sanitizeMeasurements(e,r),i}P(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(V),function(){}),Q=function(){this.hasFullStack=!0,this.parsedStack=[]},Y=(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 Y(e,t)],i&&(a.severityLevel=i),a}P(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 P(e,t),e}(B)),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)||q.NotSpecified,n.message=U.sanitizeMessage(e,t.message)||q.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=U.sanitizeException(e,r),n.hasFullStack=q.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return P(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(J.regex.test(o)){var s=new J(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var u=0,c=t.length-1,l=0,d=u,f=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=u,f=c,u++,c--}}return t},e}(Q)),J=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=q.trim(e);var r=e.match(a.regex);return r&&5<=r.length&&(n.method=q.trim(r[2])||n.method,n.fileName=q.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 P(a,i),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(K),$=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return P(e,t),e}(B);(X=G||(G={}))[X.Measurement=0]="Measurement",X[X.Aggregation=1]="Aggregation";var Z,ee,te=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 P(e,t),e}(function(){this.kind=G.Measurement}),ne=(function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;s.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var u=new te;return u.count=0<r?r:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(i)||null===i?void 0:i,u.name=U.sanitizeString(e,t)||q.NotSpecified,u.value=n,s.metrics=[u],s.properties=U.sanitizeProperties(e,o),s}P(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}($),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(V)),re=(function(u){function e(e,t,n,r,i,a,o){var s=u.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)||q.NotSpecified,isNaN(r)||(s.duration=q.msToTimeSpan(r)),s.properties=U.sanitizeProperties(e,i),s.measurements=U.sanitizeMeasurements(e,a),s}P(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ne),function(f){function e(e,t,n,r,i,a,o,s,u,c){var l=f.call(this)||this;l.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},l.id=t,l.duration=q.msToTimeSpan(i),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=U.sanitizeUrl(e,r);var d=O.ParseDependencyPath(e,n,s,r);return l.target=d.target,l.name=d.name,l.properties=U.sanitizeProperties(e,u),l.measurements=U.sanitizeMeasurements(e,c),l}return P(e,f),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 P(e,t),e}(B)));(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||q.NotSpecified,i.message=U.sanitizeMessage(e,t),i.properties=U.sanitizeProperties(e,n),r&&(i.severityLevel=r),i}P(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 P(e,t),e}(B)),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 u=h.getDuration(s.navigationStart,s.loadEventEnd),c=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==u?e.throwInternal(m.WARNING,x,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:f}):h.shouldCollectDuration(u,c,l,d,f)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(f)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:f}):(o.durationMs=u,o.perfTotal=o.duration=q.msToTimeSpan(u),o.networkConnect=q.msToTimeSpan(c),o.sentRequest=q.msToTimeSpan(l),o.receivedResponse=q.msToTimeSpan(d),o.domProcessing=q.msToTimeSpan(f),o.isValid=!0):e.throwInternal(m.WARNING,w,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:f})}return o.url=U.sanitizeUrl(e,n),o.name=U.sanitizeString(e,t)||q.NotSpecified,o.properties=U.sanitizeProperties(e,i),o.measurements=U.sanitizeMeasurements(e,a),o}P(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 P(e,t),e}(ne)),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}P(e,r)}(W);(ee=Z||(Z={}))[ee.Verbose=0]="Verbose",ee[ee.Information=1]="Information",ee[ee.Warning=2]="Warning",ee[ee.Error=3]="Error",ee[ee.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),void 0!==(i=n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t])?i:r},e}(),ae=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=U.sanitizeString(r,n)||q.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},e}(),oe=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},se=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 oe,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*F.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?L.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?U.sanitizeUrl(this._logger,L.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ue=function(){function e(){}return e.AttachEvent=function(e,t,n){var r=!1;return u.isNullOrUndefined(e)||(u.isNullOrUndefined(e.attachEvent)?u.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},e.DetachEvent=function(e,t,n){u.isNullOrUndefined(e)||(u.isNullOrUndefined(e.detachEvent)?u.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),ce=function(){function a(){this._trackAjaxAttempts=0,this.identifier=a.identifier,this.priority=161,this.currentWindowHost=window&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return a.prototype.isMonitoredInstance=function(e,t){return this.initialized&&(!0===t||!u.isNullOrUndefined(e.ajaxData))&&!0!==e[k]},a.prototype.supportsAjaxMonitoring=function(){var e=!0;return(u.isNullOrUndefined(XMLHttpRequest)||u.isNullOrUndefined(XMLHttpRequest.prototype)||u.isNullOrUndefined(XMLHttpRequest.prototype.open)||u.isNullOrUndefined(XMLHttpRequest.prototype.send)||u.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},a.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,D,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return r.apply(this,arguments)}},a.prototype.openHandler=function(e,t,n,r){var i=q.newId(),a=new se(i,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},a.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{u.isNullOrUndefined(e)||u.isNullOrUndefined(e.ajaxData)||u.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},a.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:a.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return t.apply(this,arguments)}},a.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=F.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},a.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:a.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return e.apply(this,arguments)}},a.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=q.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(m.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedAjaxDiagnosticsMessage(n),exception:q.dump(e)})}})},a.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=F.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:a.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,absoluteUrl:e.ajaxData.getAbsoluteUrl(),commandName:e.ajaxData.getPathName(),duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,resultCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},a.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 H.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:a.getFailedAjaxDiagnosticsMessage(t),exception:q.dump(e)})}},a.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ae.create(e,re.dataType,re.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(m.CRITICAL,C,"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},a.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},a.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},a.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},a.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))try{n=i.createFetchRecord(t,e),e=i.includeCorrelationHeaders(n,t,e)}catch(e){i._core.logger.throwInternal(m.CRITICAL,D,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.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}},a.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[k]},a.prototype.supportsFetch=function(){var e=!0;return(!window||u.isNullOrUndefined(window.Request)||u.isNullOrUndefined(window.Request.prototype)||u.isNullOrUndefined(window.fetch))&&(e=!1),e},a.prototype.createFetchRecord=function(e,t){var n=q.newId(),r=new se(n,this._core.logger);return r.requestSentTime=F.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},a.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(H.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost))return n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(j.requestIdHeader,e.id),n}else if(r){if(this.currentWindowHost&&H.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(j.requestIdHeader,r.ajaxData.id);var i=this._config.appId;i&&r.setRequestHeader(j.requestContextHeader,j.requestContextAppIdFormat+i)}return r}},a.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{u.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(m.CRITICAL,D,"Failed to grab failed fetch diagnostics message",{exception:q.dump(e)})}return t},a.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=F.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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,resultCode:t.status,method: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:q.dump(e)})}},a.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=F.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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:!1,resultCode:0,method: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:q.dump(e)})}},a.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(j.requestContextHeader);return H.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:q.dump(e)})}},a.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},a.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}},a.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},a.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=a.getDefaultConfig();for(var i in this._config=a.getEmptyConfig(),r)this._config[i]=ie.getConfig(e,i,a.identifier,r[i]);!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch()}},a.identifier="AjaxDependencyPlugin",a}();e.AjaxPlugin=ce,e.ajaxRecord=se,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.aidependencies={})}(this,function(e){"use strict";var a,t,g,n;(t=a||(a={}))[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,i,c=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(r,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),r=/[xy]/g;(i=m||(m={}))[i.CRITICAL=1]="CRITICAL",i[i.WARNING=2]="WARNING";var o=1,u=2,l=3,d=4,h=5,p=6,v=8,x=10,s=13,f=14,y=15,D=16,I=17,S=18,N=45,w=52,A=55,C=56,T=57,M=61,_=66,b=68,R=69,E=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=E}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,a){var r=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,a)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);r.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<a.length;t++){var o=a[t];o.priority>E&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,a)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),U=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}(),j=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,a=s.sanitizeKey(e,t);if(a.length!==i){for(var r=0,o=a;void 0!==n[o];)r++,o=a.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(r);a=o}return a},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,T,"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,M,"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,_)},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,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(m.WARNING,w,"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 a=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=a}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var a=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=a}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,R).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(m.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}(),q=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(a.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===a.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(a.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 i=s._getLocalStorageObject();if(null!==i)try{return i.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,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(a.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(a.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 i=s._getSessionStorageObject();if(null!==i)try{return i.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,i){var a="",r="";i&&(a=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(r=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+a+";path=/"+r)},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+"=",a=s.document.cookie.split(";"),r=0;r<a.length;r++){var o=a[r];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,a[r].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,a=""+Math.floor(e/36e5)%24,r=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<r?r+".":"")+(a=a.length<2?"0"+a:a)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,a){return("Script error."===e||"Script error"===e)&&!a},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}(),L=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}(),O=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=L.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var r=0;r<a.length;r++){if(new RegExp(a[r].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,U.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 a=n[i].split("=");if(2==a.length&&a[0]==t)return a[1]}},n.correlationIdPrefix="cid-v1:",n}(),k=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var a,r;if(t&&0<t.length){var o=L.parseUrl(t);if(a=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),r=j.sanitizeString(e,n?n+" "+i:i);else r=j.sanitizeString(e,t)}else r=a=i;return{target:a,name:r}},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",z=function(e,t){return(z=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 P(e,t){function n(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var G,X,V=function(e){function t(){return e.call(this)||this}return P(t,e),t}(function(){}),W=(function(a){function e(e,t,n){var i=a.call(this)||this;return i.name=j.sanitizeString(e,n)||q.NotSpecified,i.data=t,i.time=q.toISOStringForIE8(new Date),i.aiDataContract={time:g.Required,iKey:g.Required,name:g.Required,sampleRate:function(){return 100==i.sampleRate?g.Hidden:g.Required},tags:g.Required,data:g.Required},i}P(e,a)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),B=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(W),K=(function(r){function e(e,t,n,i){var a=r.call(this)||this;return a.aiDataContract={ver:g.Required,name:g.Required,properties:g.Default,measurements:g.Default},a.name=j.sanitizeString(e,t)||q.NotSpecified,a.properties=j.sanitizeProperties(e,n),a.measurements=j.sanitizeMeasurements(e,i),a}P(e,r),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(B),function(){}),Q=function(){this.hasFullStack=!0,this.parsedStack=[]},Y=(function(o){function e(e,t,n,i,a){var r=o.call(this)||this;return r.aiDataContract={ver:g.Required,exceptions:g.Required,severityLevel:g.Default,properties:g.Default,measurements:g.Default},r.properties=j.sanitizeProperties(e,n),r.measurements=j.sanitizeMeasurements(e,i),r.exceptions=[new Y(e,t)],a&&(r.severityLevel=a),r}P(e,o),e.CreateSimpleException=function(e,t,n,i,a,r){return{exceptions:[{hasFullStack:!0,message:e,stack:a,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 P(e,t),e}(W)),function(a){function e(e,t){var n=a.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=j.sanitizeString(e,t.name)||q.NotSpecified,n.message=j.sanitizeMessage(e,t.message)||q.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=j.sanitizeException(e,i),n.hasFullStack=q.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return P(e,a),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,a=0,r=0;r<=n.length;r++){var o=n[r];if(J.regex.test(o)){var s=new J(n[r],i++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,h=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=h-d+1;t.splice(d,p);break}d=c,h=u,c++,u--}}return t},e}(Q)),J=function(a){function r(e,t){var n=a.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=q.trim(e);var i=e.match(r.regex);return i&&5<=i.length&&(n.method=q.trim(i[2])||n.method,n.fileName=q.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+=r.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return P(r,a),r.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,r.baseSize=58,r}(K),$=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return P(e,t),e}(W);(X=G||(G={}))[X.Measurement=0]="Measurement",X[X.Aggregation=1]="Aggregation";var Z,ee,te=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 P(e,t),e}(function(){this.kind=G.Measurement}),ne=(function(u){function e(e,t,n,i,a,r,o){var s=u.call(this)||this;s.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var c=new te;return c.count=0<i?i:void 0,c.max=isNaN(r)||null===r?void 0:r,c.min=isNaN(a)||null===a?void 0:a,c.name=j.sanitizeString(e,t)||q.NotSpecified,c.value=n,s.metrics=[c],s.properties=j.sanitizeProperties(e,o),s}P(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}($),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(B)),ie=(function(c){function e(e,t,n,i,a,r,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=j.sanitizeId(e,o),s.url=j.sanitizeUrl(e,n),s.name=j.sanitizeString(e,t)||q.NotSpecified,isNaN(i)||(s.duration=q.msToTimeSpan(i)),s.properties=j.sanitizeProperties(e,a),s.measurements=j.sanitizeMeasurements(e,r),s}P(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ne),function(h){function e(e,t,n,i,a,r,o,s,c,u){var l=h.call(this)||this;l.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},l.id=t,l.duration=q.msToTimeSpan(a),l.success=r,l.resultCode=o+"",l.type="Ajax",l.data=j.sanitizeUrl(e,i);var d=k.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=j.sanitizeProperties(e,c),l.measurements=j.sanitizeMeasurements(e,u),l}return P(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 P(e,t),e}(W)));(function(r){function e(e,t,n,i){var a=r.call(this)||this;return a.aiDataContract={ver:g.Required,message:g.Required,severityLevel:g.Default,properties:g.Default},t=t||q.NotSpecified,a.message=j.sanitizeMessage(e,t),a.properties=j.sanitizeProperties(e,n),i&&(a.severityLevel=i),a}P(e,r),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 P(e,t),e}(W)),function(p){function f(e,t,n,i,a,r){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=f.getPerformanceTiming();if(s){var c=f.getDuration(s.navigationStart,s.loadEventEnd),u=f.getDuration(s.navigationStart,s.connectEnd),l=f.getDuration(s.requestStart,s.responseStart),d=f.getDuration(s.responseStart,s.responseEnd),h=f.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:h}):f.shouldCollectDuration(c,u,l,d,h)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(h)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:h}):(o.durationMs=c,o.perfTotal=o.duration=q.msToTimeSpan(c),o.networkConnect=q.msToTimeSpan(u),o.sentRequest=q.msToTimeSpan(l),o.receivedResponse=q.msToTimeSpan(d),o.domProcessing=q.msToTimeSpan(h),o.isValid=!0):e.throwInternal(m.WARNING,N,"Invalid page load duration value. Browser perf data won't be sent.",{total:c,network:u,request:l,response:d,dom:h})}return o.url=j.sanitizeUrl(e,n),o.name=j.sanitizeString(e,t)||q.NotSpecified,o.properties=j.sanitizeProperties(e,a),o.measurements=j.sanitizeMeasurements(e,r),o}P(f,p),f.prototype.getIsValid=function(){return this.isValid},f.prototype.getDurationMs=function(){return this.durationMs},f.getPerformanceTiming=function(){return f.isPerformanceTimingSupported()?window.performance.timing:null},f.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},f.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},f.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},f.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,a=!1;if(i)for(var r=0;r<n.length;r++)a=a||-1!==i.toLowerCase().indexOf(n[r]);if(a)return!1;for(var o=0;o<e.length;o++)if(e[o]>=f.MAX_DURATION_ALLOWED)return!1;return!0},f.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",f.dataType="PageviewPerformanceData",f.MAX_DURATION_ALLOWED=36e5}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return P(e,t),e}(ne)),function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:g.Required,baseData:g.Required},n.baseType=e,n.baseData=t,n}P(e,i)}(V);(ee=Z||(Z={}))[ee.Verbose=0]="Verbose",ee[ee.Information=1]="Information",ee[ee.Warning=2]="Warning",ee[ee.Error=3]="Error",ee[ee.Critical=4]="Critical";var ae=function(){function e(){}return e.getConfig=function(e,t,n,i){var a;return void 0===i&&(i=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t],c.isNullOrUndefined(a)?i:a},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},oe=function(){function e(){}return e.create=function(e,t,n,i,a,r){if(n=j.sanitizeString(i,n)||q.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:r||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},e}(),se=(new function(e){this.UserExtensionName="User",this.WebExtensionName="Web",this.AppExtensionName="App",this.accountIdTag="User.AccountId",this.userTagsKeysMap={},this.userTagsKeysMap[this.accountIdTag]=e.userAccountId,this.ctxKeys={id:"id",authId:"authId",localId:"localId"},this.userExtKeysMap={},this.userExtKeysMap[this.ctxKeys.localId]=e.userId,this.userExtKeysMap[this.ctxKeys.authId]=e.userAuthUserId}(new re),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*H.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?L.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?j.sanitizeUrl(this._logger,L.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ue=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}(),le=function(){function r(){this._trackAjaxAttempts=0,this.identifier=r.identifier,this.priority=161,this.currentWindowHost=window&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return r.prototype.isMonitoredInstance=function(e,t){return this.initialized&&(!0===t||!c.isNullOrUndefined(e.ajaxData))&&!0!==e[F]},r.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},r.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.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:r.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return i.apply(this,arguments)}},r.prototype.openHandler=function(e,t,n,i){var a=q.newId(),r=new ce(a,this._core.logger);r.method=t,r.requestUrl=n,r.xhrMonitoringState.openDone=!0,e.ajaxData=r,this.attachToOnReadyStateChange(e)},r.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},r.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,I,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return t.apply(this,arguments)}},r.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=H.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},r.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:r.getFailedAjaxDiagnosticsMessage(this),exception:q.dump(e)})}return e.apply(this,arguments)}},r.prototype.attachToOnReadyStateChange=function(n){var i=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=q.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||i._core.logger.throwInternal(m.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(n),exception:q.dump(e)})}})},r.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(m.WARNING,f,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,absoluteUrl:e.ajaxData.getAbsoluteUrl(),commandName:e.ajaxData.getPathName(),duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,resultCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},r.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return O.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:r.getFailedAjaxDiagnosticsMessage(t),exception:q.dump(e)})}},r.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var i=oe.create(e,ie.dataType,ie.envelopeType,this._core.logger,t,n);this._core.track(i)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(m.CRITICAL,A,"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},r.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},r.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},r.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},r.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var i=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._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:q.dump(e)})}return i(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},r.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[F]},r.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},r.prototype.createFetchRecord=function(e,t){var n=q.newId(),i=new ce(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},r.prototype.includeCorrelationHeaders=function(e,t,n,i){if(t){if(O.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost))return n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(U.requestIdHeader,e.id),n}else if(i){if(this.currentWindowHost&&O.canIncludeCorrelationHeader(this._config,i.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){i.setRequestHeader(U.requestIdHeader,i.ajaxData.id);var a=this._config.appId;a&&i.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+a)}return i}},r.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:q.dump(e)})}return t},r.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,f,"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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,resultCode:t.status,method:e.method},i=this.getFetchCorrelationContext(t);i&&(n.correlationContext=i),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,S,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.dump(e)})}},r.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=H.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,f,"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,absoluteUrl:e.getAbsoluteUrl(),commandName:e.getPathName(),duration:e.ajaxTotalDuration,success:!1,resultCode:0,method:e.method};this.trackDependencyDataInternal(i,{error:n.message})}}catch(e){this._core.logger.throwInternal(m.WARNING,S,"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:q.dump(e)})}},r.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return O.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(m.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.dump(e)})}},r.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},r.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}},r.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},r.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var i=r.getDefaultConfig();for(var a in this._config=r.getEmptyConfig(),i)this._config[a]=ae.getConfig(e,a,r.identifier,i[a]);!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch()}},r.identifier="AjaxDependencyPlugin",r}();e.AjaxPlugin=le,e.ajaxRecord=ce,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
{ | ||
"name": "@microsoft/applicationinsights-dependencies-js", | ||
"version": "1.0.0-beta.3", | ||
"version": "1.0.0-beta.4", | ||
"description": "Microsoft Application Insights XHR dependencies plugin", | ||
@@ -32,5 +32,5 @@ "main": "dist/applicationinsights-dependencies-js.min.js", | ||
"@microsoft/applicationinsights-core-js": "^1.0.0-beta.2", | ||
"@microsoft/applicationinsights-common": "^1.0.0-beta.7" | ||
"@microsoft/applicationinsights-common": "^1.0.0-beta.8" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -12,3 +12,3 @@ # Microsoft Application Insights JavaScript SDK - Dependencies Plugin | ||
npm install | ||
npm run build | ||
npm run build --silent | ||
``` | ||
@@ -15,0 +15,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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1277631
6620