@microsoft/applicationinsights-dependencies-js
Advanced tools
Comparing version 1.0.0-beta.10 to 1.0.0-beta.11
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.10 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.11 | ||
* 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 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(){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"},re=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}(),oe=(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 ae),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*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}(),ce=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}(),ue=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 se(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=ce.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=re.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 se(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]=le.getConfig(e,a,r.identifier,i[a]);!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch()}},r.identifier="AjaxDependencyPlugin",r}(),le=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]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?i:a},e}();e.AjaxPlugin=ue,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=e||self).aidependencies={})}(this,function(e){"use strict";var a,t,f,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=f||(f={}))[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,p=5,h=6,v=8,x=10,s=13,g=14,I=15,y=16,S=17,D=18,N=45,w=52,A=55,C=56,T=57,M=61,b=66,R=68,_=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,b)},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,_).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,p,"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,h,"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,R,"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}(),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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),H="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 V,G,X=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:f.Required,iKey:f.Required,name:f.Required,sampleRate:function(){return 100==i.sampleRate?f.Hidden:f.Required},tags:f.Required,data:f.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:f.Required,name:f.Required,properties:f.Default,measurements:f.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:f.Required,exceptions:f.Required,severityLevel:f.Default,properties:f.Default,measurements:f.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:f.Default,outerId:f.Default,typeName:f.Required,message:f.Required,hasFullStack:f.Default,stack:f.Default,parsedStack:f.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,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=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:f.Required,method:f.Required,assembly:f.Default,fileName:f.Default,line:f.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);(G=V||(V={}))[G.Measurement=0]="Measurement",G[G.Aggregation=1]="Aggregation";var Z,ee,te=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:f.Required,kind:f.Default,value:f.Required,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default},e}return P(e,t),e}(function(){this.kind=V.Measurement}),ne=(function(u){function e(e,t,n,i,a,r,o){var s=u.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.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:f.Required,name:f.Default,url:f.Default,duration:f.Default,properties:f.Default,measurements:f.Default,id:f.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(p){function e(e,t,n,i,a,r,o,s,c,u){var l=p.call(this)||this;l.aiDataContract={id:f.Required,ver:f.Required,name:f.Default,resultCode:f.Default,duration:f.Default,success:f.Default,data:f.Default,target:f.Default,type:f.Default,properties:f.Default,measurements:f.Default,kind:f.Default,value:f.Default,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default,dependencyKind:f.Default,dependencySource:f.Default,commandName:f.Default,dependencyTypeName:f.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,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return P(e,t),e}(W)));(function(r){function e(e,t,n,i){var a=r.call(this)||this;return a.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||q.NotSpecified,a.message=j.sanitizeMessage(e,t),a.properties=j.sanitizeProperties(e,i),n&&(a.severityLevel=n),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(h){function g(e,t,n,i,a,r){var o=h.call(this)||this;o.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,perfTotal:f.Default,networkConnect:f.Default,sentRequest:f.Default,receivedResponse:f.Default,domProcessing:f.Default,properties:f.Default,measurements:f.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var c=g.getDuration(s.navigationStart,s.loadEventEnd),u=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.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:p}):g.shouldCollectDuration(c,u,l,d,p)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:p}):(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(p),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:p})}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(g,h),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.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},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.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]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.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:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}P(e,i)}(X);(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]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?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.domain="domain",e.browser="web.browser",e.browserVer="web.browserVer",e.browserLang="web.browserLang",e.userConsent="web.userConsent",e.isManual="web.isManual",e.screenRes="web.screenRes",e}(),se=function(){function e(){}return e.localId="device.localId",e.model="device.model",e.deviceType="device.class",e}(),ce=function(){function e(){}return e.sessionId="app.sesId",e}(),ue=function(){function e(){}return e.clientIp="ingest.clientIp",e}(),le=function(){function e(){}return e.deviceOS="os.name",e}(),de=function(){function e(){}return e.sessionIsFirst="ai.session.isFirst",e.sessionIsNew="ai.session.isNew",e.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",e.userStoreRegion="ai.user.storeRegion",e.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",e.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",e.cloudName="ai.cloud.name",e.cloudRole="ai.cloud.role",e.cloudRoleVer="ai.cloud.roleVer",e.cloudRoleInstance="ai.cloud.roleInstance",e.cloudEnvironment="ai.cloud.environment",e.cloudLocation="ai.cloud.location",e.cloudDeploymentUnit="ai.cloud.deploymentUnit",e.internalNodeName="ai.internal.nodeName",e.internalSdkVersion="ai.internal.sdkVersion",e.internalAgentVersion="ai.internal.agentVersion",e.deviceOEMName="ai.device.oemName",e.deviceNetwork="ai.device.network",e.applicationVersion="ai.application.ver",e.applicationBuild="ai.application.build",e.deviceLocale="ai.device.locale",e.deviceOSVersion="ai.device.osVersion",e.locationIp="ai.location.ip",e.operationId="ai.operation.id",e.operationParentId="ai.operation.parentId",e.operationRootId="ai.operation.rootId",e.operationSyntheticSource="ai.operation.syntheticSource",e}(),pe=new re,he=function(){function o(){}return o.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},o.convertoFrom=function(e,t){var n,i={};for(var a in e.data)"baseData"!==a&&"baseType"!==a&&(i[a]=e.data[a]);switch(e.data.baseType){case ie.dataType:var r=e.data.baseType;n=o.create(r,ie.dataType,ie.envelopeType,t,i)}return o._extractPartA(e,n),n},o._extractPartA=function(t,n){var i=[];n&&t.tags&&(n.tags||(n.tags=[]),n.ctx||(n.ctx={}),t.tags[pe.applicationVersion]&&(n.tags[de.applicationVersion]=t.tags[pe.applicationVersion],i.push(pe.applicationVersion)),t.tags[pe.applicationBuild]&&(n.tags[de.applicationBuild]=t.tags[pe.applicationBuild],i.push(pe.applicationBuild)),t.tags[pe.sessionId]&&(n.ctx[ce.sessionId]=t.tags[pe.sessionId],i.push(pe.sessionId)),t.tags[pe.sessionIsFirst]&&(n.tags[pe.sessionIsFirst]=t.tags[pe.sessionIsFirst],i.push(pe.sessionIsFirst)),t.tags[pe.deviceId]&&(n.ctx[se.localId]=t.tags[pe.deviceId],i.push(pe.deviceId)),t.tags[pe.deviceIp]&&(n.ctx[ue.clientIp]=t.tags[pe.deviceIp],i.push(pe.deviceIp)),t.tags[pe.deviceLanguage]&&(n.ctx[oe.browserLang]=t.tags[pe.deviceLanguage],i.push(pe.deviceLanguage)),t.tags[pe.deviceLocale]&&(n.tags[de.deviceLocale]=t.tags[pe.deviceLocale],i.push(pe.deviceLocale)),t.tags[pe.deviceModel]&&(n.ctx[se.model]=t.tags[pe.deviceModel],i.push(pe.deviceModel)),t.tags[pe.deviceNetwork]&&(n.ctx[de.deviceNetwork]=t.tags[pe.deviceNetwork],i.push(pe.deviceNetwork)),t.tags[pe.deviceOEMName]&&(n.ctx[de.deviceOEMName]=t.tags[pe.deviceOEMName],i.push(pe.deviceOEMName)),t.tags[pe.deviceOSVersion]&&(n.tags[de.deviceOSVersion]=t.tags[pe.deviceOSVersion],i.push(pe.deviceOSVersion)),t.tags[pe.deviceOS]&&(n.ctx[le.deviceOS]=t.tags[pe.deviceOS],i.push(pe.deviceModel)),t.tags[pe.deviceNetwork]&&(n.ctx[de.deviceNetwork]=t.tags[pe.deviceNetwork],i.push(pe.deviceNetwork)),t.tags[pe.deviceType]&&(n.ctx[se.deviceType]=t.tags[pe.deviceType],i.push(pe.deviceType)),t.tags[pe.deviceOSVersion]&&(n.tags[de.deviceOSVersion]=t.tags[pe.deviceOSVersion],i.push(pe.deviceOSVersion)),t.tags[pe.deviceScreenResolution]&&(n.tags[oe.screenRes]=t.tags[pe.deviceScreenResolution],i.push(pe.deviceScreenResolution)),t.tags.sampleRate&&(n.tags.sampleRate=t.tags.sampleRate,i.push(pe.deviceScreenResolution)),t.tags[pe.locationIp]&&(n.tags[pe.locationIp]=t.tags[pe.locationIp],i.push(pe.locationIp)),t.tags[pe.internalSdkVersion]&&(n.tags[pe.internalSdkVersion]=t.tags[pe.internalSdkVersion],i.push(pe.internalSdkVersion)),t.tags[pe.internalAgentVersion]&&(n.tags[pe.internalAgentVersion]=t.tags[pe.internalAgentVersion],i.push(pe.internalAgentVersion)),t.tags[pe.operationRootId]&&(n.tags[pe.operationRootId]=t.tags[pe.operationRootId],i.push(pe.operationRootId)),t.tags[pe.operationSyntheticSource]&&(n.tags[pe.operationSyntheticSource]=t.tags[pe.operationSyntheticSource],i.push(pe.operationSyntheticSource)),t.tags[pe.operationParentId]&&(n.tags[pe.operationParentId]=t.tags[pe.operationParentId],i.push(pe.operationParentId)),t.tags[pe.operationName]&&(n.tags[pe.operationName]=t.tags[pe.operationName],i.push(pe.operationName)),t.tags[pe.operationId]&&(n.tags[pe.operationId]=t.tags[pe.operationId],i.push(pe.operationId)),Object.keys(t.tags).forEach(function(e){i.indexOf(e)<0&&(n.tags[e]=t.tags[e])}))},o}(),ge=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},fe=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 ge,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?j.sanitizeUrl(this._logger,L.getCompleteUrl(this.method,this.requestUrl)):null},e}(),me=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}(),ve=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,n,i){var a=!1,r=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[H]||!!i&&!0===i[H]):void 0!==e&&(o=this.initialized,a=!0===e[H],r=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&r&&!a},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,I,"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 fe(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,S,"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=F.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=me.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,y,"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=F.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,g,"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,responseCode:+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,D,"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=he.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)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(m.CRITICAL,I,"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[H]},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 fe(n,this._core.logger);return i.requestSentTime=F.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)return O.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)&&(n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(U.requestIdHeader,e.id)),n;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,I,"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=F.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,g,"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(),type:e.getPathName(),duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},i=this.getFetchCorrelationContext(t);i&&(n.correlationContext=i),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,D,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.dump(e)})}},r.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,g,"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(),type:e.getPathName(),duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(i,{error:n.message})}}catch(e){this._core.logger.throwInternal(m.WARNING,D,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception: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,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception: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=ve,e.ajaxRecord=fe,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { RequestHeaders, Util, CorrelationIdHelper, TelemetryItemCreator, RemoteDependencyData, DateTimeUtils, DisabledPropertyName } from '@microsoft/applicationinsights-common'; | ||
import { RequestHeaders, Util, CorrelationIdHelper, TelemetryItemCreator, RemoteDependencyData, DateTimeUtils, DisabledPropertyName, ConfigurationManager } from '@microsoft/applicationinsights-common'; | ||
import { CoreUtils, LoggingSeverity, _InternalMessageId } from '@microsoft/applicationinsights-core-js'; | ||
@@ -19,9 +19,23 @@ import { ajaxRecord } from './ajaxRecord'; | ||
///<returns type="bool">True if instance needs to be monitored, otherwise false</returns> | ||
AjaxMonitor.prototype.isMonitoredInstance = function (xhr, excludeAjaxDataValidation) { | ||
AjaxMonitor.prototype.isMonitoredInstance = function (xhr, excludeAjaxDataValidation, request, init) { | ||
var disabledProperty = false; | ||
var ajaxValidation = true; | ||
var initialized = false; | ||
if (typeof request !== 'undefined') { | ||
initialized = this._fetchInitialized; | ||
// Look for DisabledPropertyName in either Request or RequestInit | ||
disabledProperty = (typeof request === 'object' ? request[DisabledPropertyName] === true : false) || | ||
(init ? init[DisabledPropertyName] === true : false); | ||
} | ||
else if (typeof xhr !== 'undefined') { | ||
initialized = this.initialized; | ||
disabledProperty = xhr[DisabledPropertyName] === true; | ||
ajaxValidation = excludeAjaxDataValidation === true || !CoreUtils.isNullOrUndefined(xhr.ajaxData); | ||
} | ||
// checking to see that all interested functions on xhr were instrumented | ||
return this.initialized | ||
return initialized | ||
// checking on ajaxData to see that it was not removed in user code | ||
&& (excludeAjaxDataValidation === true || !CoreUtils.isNullOrUndefined(xhr.ajaxData)) | ||
&& ajaxValidation | ||
// check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector | ||
&& xhr[DisabledPropertyName] !== true; | ||
&& !disabledProperty; | ||
}; | ||
@@ -177,3 +191,3 @@ ///<summary>Determines whether ajax monitoring can be enabled on this document</summary> | ||
success: (+(xhr.ajaxData.status)) >= 200 && (+(xhr.ajaxData.status)) < 400, | ||
resultCode: +xhr.ajaxData.status, | ||
responseCode: +xhr.ajaxData.status, | ||
method: xhr.ajaxData.method | ||
@@ -244,3 +258,3 @@ }; | ||
var fetchData; | ||
if (fetchMonitorInstance.isFetchInstrumented(input)) { | ||
if (fetchMonitorInstance.isFetchInstrumented(input) && fetchMonitorInstance.isMonitoredInstance(undefined, undefined, input, init)) { | ||
try { | ||
@@ -324,2 +338,3 @@ fetchData = fetchMonitorInstance.createFetchRecord(input, init); | ||
} | ||
return init; | ||
} | ||
@@ -373,7 +388,7 @@ else if (xhr) { | ||
absoluteUrl: ajaxData.getAbsoluteUrl(), | ||
commandName: ajaxData.getPathName(), | ||
type: ajaxData.getPathName(), | ||
duration: ajaxData.ajaxTotalDuration, | ||
success: response.status >= 200 && response.status < 400, | ||
resultCode: response.status, | ||
method: ajaxData.method | ||
responseCode: response.status, | ||
properties: { HttpMethod: ajaxData.method } | ||
}; | ||
@@ -413,7 +428,7 @@ // enrich dependency target with correlation context from the server | ||
absoluteUrl: ajaxData.getAbsoluteUrl(), | ||
commandName: ajaxData.getPathName(), | ||
type: ajaxData.getPathName(), | ||
duration: ajaxData.ajaxTotalDuration, | ||
success: false, | ||
resultCode: 0, | ||
method: ajaxData.method | ||
responseCode: 0, | ||
properties: { HttpMethod: ajaxData.method } | ||
}; | ||
@@ -498,18 +513,2 @@ this.trackDependencyDataInternal(dependency, { error: reason.message }); | ||
export { AjaxMonitor }; | ||
var ConfigurationManager = /** @class */ (function () { | ||
function ConfigurationManager() { | ||
} | ||
ConfigurationManager.getConfig = function (config, field, identifier, defaultValue) { | ||
if (defaultValue === void 0) { defaultValue = false; } | ||
var configValue; | ||
if (identifier && config.extensionConfig && config.extensionConfig[identifier] && !CoreUtils.isNullOrUndefined(config.extensionConfig[identifier][field])) { | ||
configValue = config.extensionConfig[identifier][field]; | ||
} | ||
else { | ||
configValue = config[field]; | ||
} | ||
return !CoreUtils.isNullOrUndefined(configValue) ? configValue : defaultValue; | ||
}; | ||
return ConfigurationManager; | ||
}()); | ||
//# sourceMappingURL=ajax.js.map |
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.10 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 1.0.0-beta.11 | ||
* 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 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(){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"},re=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}(),oe=(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 ae),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*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}(),ce=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}(),ue=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 se(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=ce.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=re.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 se(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]=le.getConfig(e,a,r.identifier,i[a]);!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch()}},r.identifier="AjaxDependencyPlugin",r}(),le=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]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?i:a},e}();e.AjaxPlugin=ue,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=e||self).aidependencies={})}(this,function(e){"use strict";var a,t,f,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=f||(f={}))[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,p=5,h=6,v=8,x=10,s=13,g=14,I=15,y=16,S=17,D=18,N=45,w=52,A=55,C=56,T=57,M=61,b=66,R=68,_=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,b)},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,_).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,p,"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,h,"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,R,"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}(),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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),H="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 V,G,X=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:f.Required,iKey:f.Required,name:f.Required,sampleRate:function(){return 100==i.sampleRate?f.Hidden:f.Required},tags:f.Required,data:f.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:f.Required,name:f.Required,properties:f.Default,measurements:f.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:f.Required,exceptions:f.Required,severityLevel:f.Default,properties:f.Default,measurements:f.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:f.Default,outerId:f.Default,typeName:f.Required,message:f.Required,hasFullStack:f.Default,stack:f.Default,parsedStack:f.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,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=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:f.Required,method:f.Required,assembly:f.Default,fileName:f.Default,line:f.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);(G=V||(V={}))[G.Measurement=0]="Measurement",G[G.Aggregation=1]="Aggregation";var Z,ee,te=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:f.Required,kind:f.Default,value:f.Required,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default},e}return P(e,t),e}(function(){this.kind=V.Measurement}),ne=(function(u){function e(e,t,n,i,a,r,o){var s=u.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.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:f.Required,name:f.Default,url:f.Default,duration:f.Default,properties:f.Default,measurements:f.Default,id:f.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(p){function e(e,t,n,i,a,r,o,s,c,u){var l=p.call(this)||this;l.aiDataContract={id:f.Required,ver:f.Required,name:f.Default,resultCode:f.Default,duration:f.Default,success:f.Default,data:f.Default,target:f.Default,type:f.Default,properties:f.Default,measurements:f.Default,kind:f.Default,value:f.Default,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default,dependencyKind:f.Default,dependencySource:f.Default,commandName:f.Default,dependencyTypeName:f.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,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return P(e,t),e}(W)));(function(r){function e(e,t,n,i){var a=r.call(this)||this;return a.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||q.NotSpecified,a.message=j.sanitizeMessage(e,t),a.properties=j.sanitizeProperties(e,i),n&&(a.severityLevel=n),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(h){function g(e,t,n,i,a,r){var o=h.call(this)||this;o.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,perfTotal:f.Default,networkConnect:f.Default,sentRequest:f.Default,receivedResponse:f.Default,domProcessing:f.Default,properties:f.Default,measurements:f.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var c=g.getDuration(s.navigationStart,s.loadEventEnd),u=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.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:p}):g.shouldCollectDuration(c,u,l,d,p)?c<Math.floor(u)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(m.WARNING,v,"client performance math error.",{total:c,network:u,request:l,response:d,dom:p}):(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(p),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:p})}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(g,h),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.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},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.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]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.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:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}P(e,i)}(X);(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]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?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.domain="domain",e.browser="web.browser",e.browserVer="web.browserVer",e.browserLang="web.browserLang",e.userConsent="web.userConsent",e.isManual="web.isManual",e.screenRes="web.screenRes",e}(),se=function(){function e(){}return e.localId="device.localId",e.model="device.model",e.deviceType="device.class",e}(),ce=function(){function e(){}return e.sessionId="app.sesId",e}(),ue=function(){function e(){}return e.clientIp="ingest.clientIp",e}(),le=function(){function e(){}return e.deviceOS="os.name",e}(),de=function(){function e(){}return e.sessionIsFirst="ai.session.isFirst",e.sessionIsNew="ai.session.isNew",e.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",e.userStoreRegion="ai.user.storeRegion",e.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",e.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",e.cloudName="ai.cloud.name",e.cloudRole="ai.cloud.role",e.cloudRoleVer="ai.cloud.roleVer",e.cloudRoleInstance="ai.cloud.roleInstance",e.cloudEnvironment="ai.cloud.environment",e.cloudLocation="ai.cloud.location",e.cloudDeploymentUnit="ai.cloud.deploymentUnit",e.internalNodeName="ai.internal.nodeName",e.internalSdkVersion="ai.internal.sdkVersion",e.internalAgentVersion="ai.internal.agentVersion",e.deviceOEMName="ai.device.oemName",e.deviceNetwork="ai.device.network",e.applicationVersion="ai.application.ver",e.applicationBuild="ai.application.build",e.deviceLocale="ai.device.locale",e.deviceOSVersion="ai.device.osVersion",e.locationIp="ai.location.ip",e.operationId="ai.operation.id",e.operationParentId="ai.operation.parentId",e.operationRootId="ai.operation.rootId",e.operationSyntheticSource="ai.operation.syntheticSource",e}(),pe=new re,he=function(){function o(){}return o.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},o.convertoFrom=function(e,t){var n,i={};for(var a in e.data)"baseData"!==a&&"baseType"!==a&&(i[a]=e.data[a]);switch(e.data.baseType){case ie.dataType:var r=e.data.baseType;n=o.create(r,ie.dataType,ie.envelopeType,t,i)}return o._extractPartA(e,n),n},o._extractPartA=function(t,n){var i=[];n&&t.tags&&(n.tags||(n.tags=[]),n.ctx||(n.ctx={}),t.tags[pe.applicationVersion]&&(n.tags[de.applicationVersion]=t.tags[pe.applicationVersion],i.push(pe.applicationVersion)),t.tags[pe.applicationBuild]&&(n.tags[de.applicationBuild]=t.tags[pe.applicationBuild],i.push(pe.applicationBuild)),t.tags[pe.sessionId]&&(n.ctx[ce.sessionId]=t.tags[pe.sessionId],i.push(pe.sessionId)),t.tags[pe.sessionIsFirst]&&(n.tags[pe.sessionIsFirst]=t.tags[pe.sessionIsFirst],i.push(pe.sessionIsFirst)),t.tags[pe.deviceId]&&(n.ctx[se.localId]=t.tags[pe.deviceId],i.push(pe.deviceId)),t.tags[pe.deviceIp]&&(n.ctx[ue.clientIp]=t.tags[pe.deviceIp],i.push(pe.deviceIp)),t.tags[pe.deviceLanguage]&&(n.ctx[oe.browserLang]=t.tags[pe.deviceLanguage],i.push(pe.deviceLanguage)),t.tags[pe.deviceLocale]&&(n.tags[de.deviceLocale]=t.tags[pe.deviceLocale],i.push(pe.deviceLocale)),t.tags[pe.deviceModel]&&(n.ctx[se.model]=t.tags[pe.deviceModel],i.push(pe.deviceModel)),t.tags[pe.deviceNetwork]&&(n.ctx[de.deviceNetwork]=t.tags[pe.deviceNetwork],i.push(pe.deviceNetwork)),t.tags[pe.deviceOEMName]&&(n.ctx[de.deviceOEMName]=t.tags[pe.deviceOEMName],i.push(pe.deviceOEMName)),t.tags[pe.deviceOSVersion]&&(n.tags[de.deviceOSVersion]=t.tags[pe.deviceOSVersion],i.push(pe.deviceOSVersion)),t.tags[pe.deviceOS]&&(n.ctx[le.deviceOS]=t.tags[pe.deviceOS],i.push(pe.deviceModel)),t.tags[pe.deviceNetwork]&&(n.ctx[de.deviceNetwork]=t.tags[pe.deviceNetwork],i.push(pe.deviceNetwork)),t.tags[pe.deviceType]&&(n.ctx[se.deviceType]=t.tags[pe.deviceType],i.push(pe.deviceType)),t.tags[pe.deviceOSVersion]&&(n.tags[de.deviceOSVersion]=t.tags[pe.deviceOSVersion],i.push(pe.deviceOSVersion)),t.tags[pe.deviceScreenResolution]&&(n.tags[oe.screenRes]=t.tags[pe.deviceScreenResolution],i.push(pe.deviceScreenResolution)),t.tags.sampleRate&&(n.tags.sampleRate=t.tags.sampleRate,i.push(pe.deviceScreenResolution)),t.tags[pe.locationIp]&&(n.tags[pe.locationIp]=t.tags[pe.locationIp],i.push(pe.locationIp)),t.tags[pe.internalSdkVersion]&&(n.tags[pe.internalSdkVersion]=t.tags[pe.internalSdkVersion],i.push(pe.internalSdkVersion)),t.tags[pe.internalAgentVersion]&&(n.tags[pe.internalAgentVersion]=t.tags[pe.internalAgentVersion],i.push(pe.internalAgentVersion)),t.tags[pe.operationRootId]&&(n.tags[pe.operationRootId]=t.tags[pe.operationRootId],i.push(pe.operationRootId)),t.tags[pe.operationSyntheticSource]&&(n.tags[pe.operationSyntheticSource]=t.tags[pe.operationSyntheticSource],i.push(pe.operationSyntheticSource)),t.tags[pe.operationParentId]&&(n.tags[pe.operationParentId]=t.tags[pe.operationParentId],i.push(pe.operationParentId)),t.tags[pe.operationName]&&(n.tags[pe.operationName]=t.tags[pe.operationName],i.push(pe.operationName)),t.tags[pe.operationId]&&(n.tags[pe.operationId]=t.tags[pe.operationId],i.push(pe.operationId)),Object.keys(t.tags).forEach(function(e){i.indexOf(e)<0&&(n.tags[e]=t.tags[e])}))},o}(),ge=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},fe=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 ge,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?j.sanitizeUrl(this._logger,L.getCompleteUrl(this.method,this.requestUrl)):null},e}(),me=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}(),ve=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,n,i){var a=!1,r=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[H]||!!i&&!0===i[H]):void 0!==e&&(o=this.initialized,a=!0===e[H],r=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&r&&!a},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,I,"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 fe(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,S,"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=F.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=me.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,y,"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=F.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,g,"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,responseCode:+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,D,"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=he.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)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(m.CRITICAL,I,"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[H]},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 fe(n,this._core.logger);return i.requestSentTime=F.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)return O.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)&&(n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(U.requestIdHeader,e.id)),n;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,I,"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=F.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(m.WARNING,g,"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(),type:e.getPathName(),duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},i=this.getFetchCorrelationContext(t);i&&(n.correlationContext=i),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(m.WARNING,D,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:q.dump(e)})}},r.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,g,"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(),type:e.getPathName(),duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(i,{error:n.message})}}catch(e){this._core.logger.throwInternal(m.WARNING,D,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception: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,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception: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=ve,e.ajaxRecord=fe,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
{ | ||
"name": "@microsoft/applicationinsights-dependencies-js", | ||
"version": "1.0.0-beta.10", | ||
"version": "1.0.0-beta.11", | ||
"description": "Microsoft Application Insights XHR dependencies plugin", | ||
@@ -31,5 +31,5 @@ "main": "dist/applicationinsights-dependencies-js.js", | ||
"@microsoft/applicationinsights-core-js": "^1.0.0-beta.3", | ||
"@microsoft/applicationinsights-common": "^1.0.0-beta.12" | ||
"@microsoft/applicationinsights-common": "^1.0.0-beta.13" | ||
}, | ||
"license": "MIT" | ||
} |
@@ -7,3 +7,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
RemoteDependencyData, DateTimeUtils, DisabledPropertyName, Data, IDependencyTelemetry, | ||
IConfig | ||
IConfig, ConfigurationManager, HttpMethod | ||
} from '@microsoft/applicationinsights-common'; | ||
@@ -47,12 +47,26 @@ import { | ||
///<returns type="bool">True if instance needs to be monitored, otherwise false</returns> | ||
private isMonitoredInstance(xhr: XMLHttpRequestInstrumented, excludeAjaxDataValidation?: boolean): boolean { | ||
private isMonitoredInstance(xhr?: XMLHttpRequestInstrumented, excludeAjaxDataValidation?: boolean, request?: Request | string, init?: RequestInit): boolean { | ||
let disabledProperty = false; | ||
let ajaxValidation = true; | ||
let initialized = false; | ||
if (typeof request !== 'undefined') { // fetch | ||
initialized = this._fetchInitialized; | ||
// Look for DisabledPropertyName in either Request or RequestInit | ||
disabledProperty = (typeof request === 'object' ? request[DisabledPropertyName] === true : false) || | ||
(init ? init[DisabledPropertyName] === true : false); | ||
} else if (typeof xhr !== 'undefined') { | ||
initialized = this.initialized; | ||
disabledProperty = xhr[DisabledPropertyName] === true; | ||
ajaxValidation = excludeAjaxDataValidation === true || !CoreUtils.isNullOrUndefined(xhr.ajaxData); | ||
} | ||
// checking to see that all interested functions on xhr were instrumented | ||
return this.initialized | ||
return initialized | ||
// checking on ajaxData to see that it was not removed in user code | ||
&& (excludeAjaxDataValidation === true || !CoreUtils.isNullOrUndefined(xhr.ajaxData)) | ||
&& ajaxValidation | ||
// check that this instance is not not used by ajax call performed inside client side monitoring to send data to collector | ||
&& xhr[DisabledPropertyName] !== true; | ||
&& !disabledProperty; | ||
@@ -112,3 +126,3 @@ } | ||
/* todo: | ||
Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. | ||
Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
@@ -244,3 +258,3 @@ var id = "|" + this.appInsights.context.operation.id + "." + Util.newId(); | ||
success:(+(xhr.ajaxData.status)) >= 200 && (+(xhr.ajaxData.status)) < 400, | ||
resultCode: +xhr.ajaxData.status, | ||
responseCode: +xhr.ajaxData.status, | ||
method: xhr.ajaxData.method | ||
@@ -320,3 +334,3 @@ }; | ||
public identifier: string = AjaxMonitor.identifier; | ||
setNextPlugin(next: ITelemetryPlugin) { | ||
@@ -339,3 +353,3 @@ if (next) { | ||
let fetchData: ajaxRecord; | ||
if (fetchMonitorInstance.isFetchInstrumented(input)) { | ||
if (fetchMonitorInstance.isFetchInstrumented(input) && fetchMonitorInstance.isMonitoredInstance(undefined, undefined, input, init)) { | ||
try { | ||
@@ -384,3 +398,3 @@ fetchData = fetchMonitorInstance.createFetchRecord(input, init); | ||
/* todo: | ||
Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. | ||
Disabling the following block of code as CV is not yet supported in 1DS for 3rd Part. | ||
// this format corresponds with activity logic on server-side and is required for the correct correlation | ||
@@ -398,3 +412,3 @@ var id = "|" + this.appInsights.context.operation.id + "." + Util.newId(); | ||
} | ||
if (init && init.method) { | ||
@@ -428,2 +442,3 @@ ajaxData.method = init.method; | ||
} | ||
return init; | ||
} else if (xhr) { // XHR | ||
@@ -487,7 +502,7 @@ if (this.currentWindowHost && CorrelationIdHelper.canIncludeCorrelationHeader(this._config, xhr.ajaxData.getAbsoluteUrl(), | ||
absoluteUrl: ajaxData.getAbsoluteUrl(), | ||
commandName: ajaxData.getPathName(), | ||
type: ajaxData.getPathName(), | ||
duration: ajaxData.ajaxTotalDuration, | ||
success: response.status >= 200 && response.status < 400, | ||
resultCode: response.status, | ||
method: ajaxData.method | ||
responseCode: response.status, | ||
properties: { HttpMethod: ajaxData.method } | ||
}; | ||
@@ -538,9 +553,9 @@ | ||
absoluteUrl: ajaxData.getAbsoluteUrl(), | ||
commandName: ajaxData.getPathName(), | ||
type: ajaxData.getPathName(), | ||
duration: ajaxData.ajaxTotalDuration, | ||
success: false, | ||
resultCode: 0, | ||
method: ajaxData.method | ||
responseCode: 0, | ||
properties: { HttpMethod: ajaxData.method } | ||
}; | ||
this.trackDependencyDataInternal(dependency, { error: reason.message }); | ||
@@ -613,3 +628,3 @@ } | ||
} | ||
public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[]) { | ||
@@ -634,15 +649,1 @@ if (!this.initialized && !this._fetchInitialized) { | ||
} | ||
class ConfigurationManager { | ||
public static getConfig(config: IConfiguration & IConfig, field: string, identifier?: string, defaultValue: number | string | boolean = false): number | string | boolean { | ||
let configValue; | ||
if (identifier && config.extensionConfig && config.extensionConfig[identifier] && !CoreUtils.isNullOrUndefined(config.extensionConfig[identifier][field])) { | ||
configValue = config.extensionConfig[identifier][field]; | ||
} else { | ||
configValue = config[field]; | ||
} | ||
return !CoreUtils.isNullOrUndefined(configValue) ? configValue : defaultValue; | ||
} | ||
} | ||
@@ -24,3 +24,3 @@ import { ICorrelationConfig, IDependencyTelemetry, IConfig } from '@microsoft/applicationinsights-common'; | ||
constructor(); | ||
private isMonitoredInstance(xhr, excludeAjaxDataValidation?); | ||
private isMonitoredInstance(xhr?, excludeAjaxDataValidation?, request?, init?); | ||
private supportsAjaxMonitoring(); | ||
@@ -27,0 +27,0 @@ private instrumentOpen(); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1387589
7103