@microsoft/applicationinsights-dependencies-js
Advanced tools
Comparing version 2.0.0-rc5 to 2.0.0-rc6
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc5 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc6 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var a,t,h,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var c=(r.isNullOrUndefined=function(e){return null==e},r.disableCookies=function(){r._canUseCookies=!1},r.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},r);function r(){}var i,o,s=/[xy]/g;(o=i||(i={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var l=1,u=2,d=3,p=4,f=5,g=6,m=13,v=14,x=15,y=16,D=17,S=18,I=49,C=52,N=55,w=56,A=57,_=61,M=66,b=68,T=69;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error(E+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];s.priority>R&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=R}var R=500,E="Channel has invalid priority",U=(q.requestContextHeader="Request-Context",q.requestContextTargetKey="appId",q.requestContextAppIdFormat="appId=cid-v1:",q.requestIdHeader="Request-Id",q.sdkContextHeader="Sdk-Context",q.sdkContextHeaderAppIdRequest="appId",q.requestContextHeaderLowerCase="request-context",q);function q(){}var L=(k.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=k.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,k.MAX_NAME_LENGTH-3)+k.padNumber(i);a=o}return a},k.sanitizeKey=function(e,t){var n;return t&&(t=k.trim(t.toString())).length>k.MAX_NAME_LENGTH&&(n=t.substring(0,k.MAX_NAME_LENGTH),e.throwInternal(i.WARNING,A,"name is too long. It has been truncated to "+k.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},k.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=k.MAX_STRING_LENGTH),t&&(n=n||k.MAX_STRING_LENGTH,(t=k.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(i.WARNING,_,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},k.sanitizeUrl=function(e,t){return k.sanitizeInput(e,t,k.MAX_URL_LENGTH,M)},k.sanitizeMessage=function(e,t){var n;return t&&t.length>k.MAX_MESSAGE_LENGTH&&(n=t.substring(0,k.MAX_MESSAGE_LENGTH),e.throwInternal(i.WARNING,w,"message is too long, it has been truncated to "+k.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},k.sanitizeException=function(e,t){var n;return t&&t.length>k.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,k.MAX_EXCEPTION_LENGTH),e.throwInternal(i.WARNING,C,"exception is too long, it has been truncated to "+k.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},k.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(i.WARNING,I,"custom property is not valid",{exception:e},!0)}a=k.sanitizeString(t,a,k.MAX_PROPERTY_LENGTH),n[r=k.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},k.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=k.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},k.sanitizeId=function(e,t){return t?k.sanitizeInput(e,t,k.MAX_ID_LENGTH,T).toString():t},k.sanitizeInput=function(e,t,n,r){var a;return t&&(t=k.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(i.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},k.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},k.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},k.MAX_NAME_LENGTH=150,k.MAX_ID_LENGTH=128,k.MAX_PROPERTY_LENGTH=8192,k.MAX_STRING_LENGTH=1024,k.MAX_URL_LENGTH=2048,k.MAX_MESSAGE_LENGTH=32768,k.MAX_EXCEPTION_LENGTH=32768,k);function k(){}var F=(H.disableStorage=function(){H._canUseLocalStorage=!1,H._canUseSessionStorage=!1},H._getLocalStorageObject=function(){return H.canUseLocalStorage()?H._getVerifiedStorageObject(a.LocalStorage):null},H._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},H.isInternalApplicationInsightsEndpoint=function(e){return-1!==H._internalEndpoints.indexOf(e.toLowerCase())},H.canUseLocalStorage=function(){return void 0===H._canUseLocalStorage&&(H._canUseLocalStorage=!!H._getVerifiedStorageObject(a.LocalStorage)),H._canUseLocalStorage},H.getStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,l,"Browser failed read of local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setStorage=function(t,e,n){var r=H._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,d,"Browser failed write to local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,f,"Browser failed removal of local storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H._getSessionStorageObject=function(){return H.canUseSessionStorage()?H._getVerifiedStorageObject(a.SessionStorage):null},H.canUseSessionStorage=function(){return void 0===H._canUseSessionStorage&&(H._canUseSessionStorage=!!H._getVerifiedStorageObject(a.SessionStorage)),H._canUseSessionStorage},H.getSessionStorageKeys=function(){var e=[];if(H.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},H.getSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,u,"Browser failed read of session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setSessionStorage=function(t,e,n){var r=H._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,p,"Browser failed write to session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,g,"Browser failed removal of session storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.disableCookies=function(){c.disableCookies()},H.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==H.document.cookie}catch(e){t.throwInternal(i.WARNING,b,"Cannot access document.cookie - "+H.getExceptionName(e),{exception:H.dump(e)})}}return c._canUseCookies},H.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),H.document.location&&"https:"===H.document.location.protocol&&(i=";secure"),H.canUseCookies(e)&&(H.document.cookie=t+"="+n+a+";path=/"+i)},H.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},H.getCookie=function(e,t){if(H.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=H.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=H.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},H.deleteCookie=function(e,t){H.canUseCookies(e)&&(H.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},H.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},H.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},H.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},H.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},H.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},H.toISOStringForIE8=function(e){if(H.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"}},H.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},H.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},H.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},H.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},H.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},H.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},H.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},H.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},H.document="undefined"!=typeof document?document:{},H._canUseLocalStorage=void 0,H._canUseSessionStorage=void 0,H._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],H.NotSpecified="not_specified",H);function H(){}var O=(z.parseUrl=function(e){return z.htmlAnchorElement||(z.htmlAnchorElement=z.document.createElement?z.document.createElement("a"):{host:z.parseHost(e)}),z.htmlAnchorElement.href=e,z.htmlAnchorElement},z.getAbsoluteUrl=function(e){var t,n=z.parseUrl(e);return n&&(t=n.href),t},z.getPathName=function(e){var t,n=z.parseUrl(e);return n&&(t=n.pathname),t},z.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},z.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},z.document="undefined"!=typeof document?document:{},z);function z(){}var P=(G.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=O.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var i=0;i<a.length;i++)if(new RegExp(a[i].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},G.getCorrelationContext=function(e){if(e){var t=G.getCorrelationContextValue(e,U.requestContextTargetKey);if(t&&t!==G.correlationIdPrefix)return t}},G.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2==a.length&&a[0]==t)return a[1]}},G.correlationIdPrefix="cid-v1:",G);function G(){}var X=(W.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=O.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=L.sanitizeString(e,n?n+" "+c:c)}else i=L.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},W);function W(){}var B=(V.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()},V.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},V);function V(){}var K="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Q=function(e,t){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function J(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,$=function(){return($=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Z=(J(ee,Y=function(){}),ee);function ee(){return Y.call(this)||this}var te;J(ne,te=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ne(e,t,n){var r=te.call(this)||this;return r.name=L.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function re(){}var ae,ie=(J(oe,ae=re),oe);function oe(){var e=ae.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var se;J(ce,se=ie),ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ce.dataType="EventData";function ce(e,t,n,r){var a=se.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=L.sanitizeString(e,t)||F.NotSpecified,a.properties=L.sanitizeProperties(e,n),a.measurements=L.sanitizeMeasurements(e,r),a}function le(){}var ue,de=(J(pe,ue=re),pe);function pe(){var e=ue.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function he(){this.hasFullStack=!0,this.parsedStack=[]}var fe;J(ge,fe=de),ge.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ve.CreateFromInterface(t,e)});return new ge(t,$({},e,{exceptions:n}))},ge.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},ge.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},ge.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",ge.dataType="ExceptionData";function ge(e,t,n,r,a){var i=fe.call(this)||this;return i.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(i.exceptions=[new ve(e,t)],i.properties=L.sanitizeProperties(e,n),i.measurements=L.sanitizeMeasurements(e,r),a&&(i.severityLevel=a)):(i.exceptions=t.exceptions,i.properties=t.properties,i.measurements=t.measurements,t.severityLevel&&(i.severityLevel=t.severityLevel)),i}var me,ve=(J(xe,me=he),xe.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},xe.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new xe(e,$({},t,{parsedStack:n}))},xe.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,l=t.length-1,u=0,d=c,p=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=l,c++,l--}}return t},xe);function xe(e,t){var n=me.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=L.sanitizeString(e,t.name)||F.NotSpecified,n.message=L.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=xe.parseStack(r),n.stack=L.sanitizeException(e,r),n.hasFullStack=F.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var ye,De=(J(Se,ye=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=ye.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ie,Ce,Ne,we=(J(Ae,Ie=re),Ae);function Ae(){var e=Ie.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ne=Ce||(Ce={}))[Ne.Measurement=0]="Measurement",Ne[Ne.Aggregation=1]="Aggregation";var _e,Me=(J(be,_e=function(){this.kind=Ce.Measurement}),be);function be(){var e=null!==_e&&_e.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var Te;J(je,Te=we),je.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",je.dataType="MetricData";function je(e,t,n,r,a,i,o){var s=Te.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=L.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=L.sanitizeProperties(e,o),s}var Re,Ee=(J(Ue,Re=ie),Ue);function Ue(){var e=Re.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe;J(Le,qe=Ee),Le.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Le.dataType="PageviewData";function Le(e,t,n,r,a,i,o){var s=qe.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=L.sanitizeId(e,o),s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),s}var ke,Fe=(J(He,ke=re),He);function He(){var e=ke.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Oe,ze=(J(Pe,Oe=Fe),Pe.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Pe.dataType="RemoteDependencyData",Pe);function Pe(e,t,n,r,a,i,o,s,c,l,u){void 0===c&&(c="Ajax");var d=Oe.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=L.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=L.sanitizeUrl(e,r)||p.data,d.target=p.target,d.name=p.name,d.properties=L.sanitizeProperties(e,l),d.measurements=L.sanitizeMeasurements(e,u),d}var Ge,Xe=(J(We,Ge=re),We);function We(){var e=Ge.call(this)||this;return e.ver=2,e.properties={},e}var Be;J(Ve,Be=Xe),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ve.dataType="MessageData";function Ve(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=L.sanitizeMessage(e,t),a.properties=L.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Ke,Qe=(J(Je,Ke=Ee),Je);function Je(){var e=Ke.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;J($e,Ye=Qe),$e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",$e.dataType="PageviewPerformanceData";function $e(e,t,n,r,a,i){var o=Ye.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=L.sanitizeUrl(e,n),o.name=L.sanitizeString(e,t)||F.NotSpecified,o.properties=L.sanitizeProperties(e,a),o.measurements=L.sanitizeMeasurements(e,i),o}var Ze,et,tt;J(nt,Ze=Z);function nt(e,t){var n=Ze.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(tt=et||(et={}))[tt.Verbose=0]="Verbose",tt[tt.Information=1]="Information",tt[tt.Warning=2]="Warning",tt[tt.Error=3]="Error",tt[tt.Critical=4]="Critical";var rt=(at.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},at);function at(){}var it=(ot.create=function(e,t,n,r,a,i){if(n=L.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},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},ot);function ot(){}var st=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ct=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?O.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?L.sanitizeUrl(this._logger,O.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 st,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}var ut=(dt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},dt.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))},dt);function dt(){}var pt=(ht.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[K]||!!r&&!0===r[K]):void 0!==e&&(o=this.initialized,a=!0===e[K],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},ht.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},ht.prototype.instrumentOpen=function(){var r=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){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},ht.prototype.openHandler=function(e,t,n,r){var a;a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var i=new ct(a,this._core.logger);i.method=t,i.requestUrl=n,i.xhrMonitoringState.openDone=!0,e.ajaxData=i,this.attachToOnReadyStateChange(e)},ht.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},ht.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){n._core.logger.throwInternal(i.CRITICAL,D,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},ht.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},ht.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){t._core.logger.throwInternal(i.CRITICAL,m,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},ht.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ut.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(i.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},ht.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},ht.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return P.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=it.create(e,ze.dataType,ze.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(i.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},ht.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},ht.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},ht.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},ht.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=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(i.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},ht.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[K]},ht.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},ht.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var r=new ct(n,this._core.logger);return r.requestSentTime=B.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},ht.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(P.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);var a=this._config.appId||this._context.appId();return a&&n.headers.set(U.requestContextHeader,U.requestContextAppIdFormat+a),n}return n}if(r){if(this.currentWindowHost&&P.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(U.requestIdHeader,r.ajaxData.id);var i=this._config.appId||this._context.appId();i&&r.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+i)}return r}},ht.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(i.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},ht.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return P.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},ht.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}},ht.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},ht.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=ht.getDefaultConfig();for(var a in this._config=ht.getEmptyConfig(),r)this._config[a]=rt.getConfig(e,a,ht.identifier,r[a]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},ht.identifier="AjaxDependencyPlugin",ht);function ht(){this._trackAjaxAttempts=0,this.identifier=ht.identifier,this.priority=171,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=pt,e.ajaxRecord=ct,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var a,t,h,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var c=(r.isNullOrUndefined=function(e){return null==e},r.disableCookies=function(){r._canUseCookies=!1},r.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},r);function r(){}var i,o,s=/[xy]/g;(o=i||(i={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var l=1,u=2,d=3,p=4,f=5,g=6,m=13,v=14,x=15,y=16,D=17,S=18,I=49,C=52,N=55,w=56,A=57,_=61,M=66,b=68,T=69;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error(E+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];s.priority>R&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=R}var R=500,E="Channel has invalid priority",U=(q.requestContextHeader="Request-Context",q.requestContextTargetKey="appId",q.requestContextAppIdFormat="appId=cid-v1:",q.requestIdHeader="Request-Id",q.sdkContextHeader="Sdk-Context",q.sdkContextHeaderAppIdRequest="appId",q.requestContextHeaderLowerCase="request-context",q);function q(){}var L=(k.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=k.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,k.MAX_NAME_LENGTH-3)+k.padNumber(i);a=o}return a},k.sanitizeKey=function(e,t){var n;return t&&(t=k.trim(t.toString())).length>k.MAX_NAME_LENGTH&&(n=t.substring(0,k.MAX_NAME_LENGTH),e.throwInternal(i.WARNING,A,"name is too long. It has been truncated to "+k.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},k.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=k.MAX_STRING_LENGTH),t&&(n=n||k.MAX_STRING_LENGTH,(t=k.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(i.WARNING,_,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},k.sanitizeUrl=function(e,t){return k.sanitizeInput(e,t,k.MAX_URL_LENGTH,M)},k.sanitizeMessage=function(e,t){var n;return t&&t.length>k.MAX_MESSAGE_LENGTH&&(n=t.substring(0,k.MAX_MESSAGE_LENGTH),e.throwInternal(i.WARNING,w,"message is too long, it has been truncated to "+k.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},k.sanitizeException=function(e,t){var n;return t&&t.length>k.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,k.MAX_EXCEPTION_LENGTH),e.throwInternal(i.WARNING,C,"exception is too long, it has been truncated to "+k.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},k.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(i.WARNING,I,"custom property is not valid",{exception:e},!0)}a=k.sanitizeString(t,a,k.MAX_PROPERTY_LENGTH),n[r=k.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},k.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=k.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},k.sanitizeId=function(e,t){return t?k.sanitizeInput(e,t,k.MAX_ID_LENGTH,T).toString():t},k.sanitizeInput=function(e,t,n,r){var a;return t&&(t=k.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(i.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},k.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},k.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},k.MAX_NAME_LENGTH=150,k.MAX_ID_LENGTH=128,k.MAX_PROPERTY_LENGTH=8192,k.MAX_STRING_LENGTH=1024,k.MAX_URL_LENGTH=2048,k.MAX_MESSAGE_LENGTH=32768,k.MAX_EXCEPTION_LENGTH=32768,k);function k(){}var F=(H.disableStorage=function(){H._canUseLocalStorage=!1,H._canUseSessionStorage=!1},H._getLocalStorageObject=function(){return H.canUseLocalStorage()?H._getVerifiedStorageObject(a.LocalStorage):null},H._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},H.isInternalApplicationInsightsEndpoint=function(e){return-1!==H._internalEndpoints.indexOf(e.toLowerCase())},H.canUseLocalStorage=function(){return void 0===H._canUseLocalStorage&&(H._canUseLocalStorage=!!H._getVerifiedStorageObject(a.LocalStorage)),H._canUseLocalStorage},H.getStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,l,"Browser failed read of local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setStorage=function(t,e,n){var r=H._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,d,"Browser failed write to local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,f,"Browser failed removal of local storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H._getSessionStorageObject=function(){return H.canUseSessionStorage()?H._getVerifiedStorageObject(a.SessionStorage):null},H.canUseSessionStorage=function(){return void 0===H._canUseSessionStorage&&(H._canUseSessionStorage=!!H._getVerifiedStorageObject(a.SessionStorage)),H._canUseSessionStorage},H.getSessionStorageKeys=function(){var e=[];if(H.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},H.getSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,u,"Browser failed read of session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setSessionStorage=function(t,e,n){var r=H._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,p,"Browser failed write to session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,g,"Browser failed removal of session storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.disableCookies=function(){c.disableCookies()},H.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==H.document.cookie}catch(e){t.throwInternal(i.WARNING,b,"Cannot access document.cookie - "+H.getExceptionName(e),{exception:H.dump(e)})}}return c._canUseCookies},H.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),H.document.location&&"https:"===H.document.location.protocol&&(i=";secure"),H.canUseCookies(e)&&(H.document.cookie=t+"="+n+a+";path=/"+i)},H.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},H.getCookie=function(e,t){if(H.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=H.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=H.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},H.deleteCookie=function(e,t){H.canUseCookies(e)&&(H.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},H.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},H.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},H.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},H.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},H.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},H.toISOStringForIE8=function(e){if(H.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"}},H.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},H.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},H.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},H.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},H.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},H.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},H.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},H.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},H.document="undefined"!=typeof document?document:{},H._canUseLocalStorage=void 0,H._canUseSessionStorage=void 0,H._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],H.NotSpecified="not_specified",H);function H(){}var O=(z.parseUrl=function(e){return z.htmlAnchorElement||(z.htmlAnchorElement=z.document.createElement?z.document.createElement("a"):{host:z.parseHost(e)}),z.htmlAnchorElement.href=e,z.htmlAnchorElement},z.getAbsoluteUrl=function(e){var t,n=z.parseUrl(e);return n&&(t=n.href),t},z.getPathName=function(e){var t,n=z.parseUrl(e);return n&&(t=n.pathname),t},z.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},z.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},z.document="undefined"!=typeof document?document:{},z);function z(){}var G=(P.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=O.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var i=0;i<a.length;i++)if(new RegExp(a[i].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},P.getCorrelationContext=function(e){if(e){var t=P.getCorrelationContextValue(e,U.requestContextTargetKey);if(t&&t!==P.correlationIdPrefix)return t}},P.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2==a.length&&a[0]==t)return a[1]}},P.correlationIdPrefix="cid-v1:",P);function P(){}var X=(W.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=O.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=L.sanitizeString(e,n?n+" "+c:c)}else i=L.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},W);function W(){}var B=(V.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()},V.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},V);function V(){}var K="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Q=function(e,t){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function J(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,$=function(){return($=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Z=(J(ee,Y=function(){}),ee);function ee(){return Y.call(this)||this}var te;J(ne,te=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ne(e,t,n){var r=te.call(this)||this;return r.name=L.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function re(){}var ae,ie=(J(oe,ae=re),oe);function oe(){var e=ae.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var se;J(ce,se=ie),ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ce.dataType="EventData";function ce(e,t,n,r){var a=se.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=L.sanitizeString(e,t)||F.NotSpecified,a.properties=L.sanitizeProperties(e,n),a.measurements=L.sanitizeMeasurements(e,r),a}function le(){}var ue,de=(J(pe,ue=re),pe);function pe(){var e=ue.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function he(){this.hasFullStack=!0,this.parsedStack=[]}var fe;J(ge,fe=de),ge.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ve.CreateFromInterface(t,e)});return new ge(t,$({},e,{exceptions:n}))},ge.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:i,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},ge.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},ge.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",ge.dataType="ExceptionData";function ge(e,t,n,r,a){var i=fe.call(this)||this;return i.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(i.exceptions=[new ve(e,t)],i.properties=L.sanitizeProperties(e,n),i.measurements=L.sanitizeMeasurements(e,r),a&&(i.severityLevel=a)):(i.exceptions=t.exceptions,i.properties=t.properties,i.measurements=t.measurements,t.severityLevel&&(i.severityLevel=t.severityLevel),t.id&&(i.id=t.id),t.problemGroup&&(i.problemGroup=t.problemGroup),c.isNullOrUndefined(t.ver)||(i.ver=t.ver),c.isNullOrUndefined(t.isManual)||(i.isManual=t.isManual)),i}var me,ve=(J(xe,me=he),xe.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},xe.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new xe(e,$({},t,{parsedStack:n}))},xe.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,l=t.length-1,u=0,d=c,p=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=l,c++,l--}}return t},xe);function xe(e,t){var n=me.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=L.sanitizeString(e,t.name)||F.NotSpecified,n.message=L.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=xe.parseStack(r),n.stack=L.sanitizeException(e,r),n.hasFullStack=F.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var ye,De=(J(Se,ye=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=ye.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ie,Ce,Ne,we=(J(Ae,Ie=re),Ae);function Ae(){var e=Ie.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ne=Ce||(Ce={}))[Ne.Measurement=0]="Measurement",Ne[Ne.Aggregation=1]="Aggregation";var _e,Me=(J(be,_e=function(){this.kind=Ce.Measurement}),be);function be(){var e=null!==_e&&_e.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var Te;J(je,Te=we),je.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",je.dataType="MetricData";function je(e,t,n,r,a,i,o){var s=Te.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=L.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=L.sanitizeProperties(e,o),s}var Re,Ee=(J(Ue,Re=ie),Ue);function Ue(){var e=Re.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe;J(Le,qe=Ee),Le.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Le.dataType="PageviewData";function Le(e,t,n,r,a,i,o){var s=qe.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=L.sanitizeId(e,o),s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),s}var ke,Fe=(J(He,ke=re),He);function He(){var e=ke.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Oe,ze=(J(Ge,Oe=Fe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ge.dataType="RemoteDependencyData",Ge);function Ge(e,t,n,r,a,i,o,s,c,l,u){void 0===c&&(c="Ajax");var d=Oe.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=L.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=L.sanitizeUrl(e,r)||p.data,d.target=p.target,d.name=p.name,d.properties=L.sanitizeProperties(e,l),d.measurements=L.sanitizeMeasurements(e,u),d}var Pe,Xe=(J(We,Pe=re),We);function We(){var e=Pe.call(this)||this;return e.ver=2,e.properties={},e}var Be;J(Ve,Be=Xe),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ve.dataType="MessageData";function Ve(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=L.sanitizeMessage(e,t),a.properties=L.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Ke,Qe=(J(Je,Ke=Ee),Je);function Je(){var e=Ke.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;J($e,Ye=Qe),$e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",$e.dataType="PageviewPerformanceData";function $e(e,t,n,r,a,i,o){var s=Ye.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var Ze,et,tt;J(nt,Ze=Z);function nt(e,t){var n=Ze.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(tt=et||(et={}))[tt.Verbose=0]="Verbose",tt[tt.Information=1]="Information",tt[tt.Warning=2]="Warning",tt[tt.Error=3]="Error",tt[tt.Critical=4]="Critical";var rt=(at.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},at);function at(){}var it=(ot.create=function(e,t,n,r,a,i){if(n=L.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},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},ot);function ot(){}var st=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ct=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?O.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?L.sanitizeUrl(this._logger,O.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 st,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}var ut=(dt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},dt.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))},dt);function dt(){}var pt=(ht.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[K]||!!r&&!0===r[K]):void 0!==e&&(o=this.initialized,a=!0===e[K],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},ht.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},ht.prototype.instrumentOpen=function(){var r=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){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},ht.prototype.openHandler=function(e,t,n,r){var a;a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var i=new ct(a,this._core.logger);i.method=t,i.requestUrl=n,i.xhrMonitoringState.openDone=!0,e.ajaxData=i,this.attachToOnReadyStateChange(e)},ht.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},ht.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){n._core.logger.throwInternal(i.CRITICAL,D,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},ht.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},ht.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){t._core.logger.throwInternal(i.CRITICAL,m,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},ht.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ut.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(i.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},ht.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},ht.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return G.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=it.create(e,ze.dataType,ze.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(i.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},ht.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},ht.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},ht.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},ht.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=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(i.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},ht.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[K]},ht.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},ht.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var r=new ct(n,this._core.logger);return r.requestSentTime=B.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},ht.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(G.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);var a=this._config.appId||this._context.appId();return a&&n.headers.set(U.requestContextHeader,U.requestContextAppIdFormat+a),n}return n}if(r){if(this.currentWindowHost&&G.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(U.requestIdHeader,r.ajaxData.id);var i=this._config.appId||this._context.appId();i&&r.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+i)}return r}},ht.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(i.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},ht.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return G.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},ht.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}},ht.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},ht.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=ht.getDefaultConfig();for(var a in this._config=ht.getEmptyConfig(),r)this._config[a]=rt.getConfig(e,a,ht.identifier,r[a]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},ht.identifier="AjaxDependencyPlugin",ht);function ht(){this._trackAjaxAttempts=0,this.identifier=ht.identifier,this.priority=171,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=pt,e.ajaxRecord=ct,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc5 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc6 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var a,t,h,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var c=(r.isNullOrUndefined=function(e){return null==e},r.disableCookies=function(){r._canUseCookies=!1},r.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},r);function r(){}var i,o,s=/[xy]/g;(o=i||(i={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var l=1,u=2,d=3,p=4,f=5,g=6,m=13,v=14,x=15,y=16,D=17,S=18,I=49,C=52,N=55,w=56,A=57,_=61,M=66,b=68,T=69;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error(E+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];s.priority>R&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=R}var R=500,E="Channel has invalid priority",U=(q.requestContextHeader="Request-Context",q.requestContextTargetKey="appId",q.requestContextAppIdFormat="appId=cid-v1:",q.requestIdHeader="Request-Id",q.sdkContextHeader="Sdk-Context",q.sdkContextHeaderAppIdRequest="appId",q.requestContextHeaderLowerCase="request-context",q);function q(){}var L=(k.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=k.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,k.MAX_NAME_LENGTH-3)+k.padNumber(i);a=o}return a},k.sanitizeKey=function(e,t){var n;return t&&(t=k.trim(t.toString())).length>k.MAX_NAME_LENGTH&&(n=t.substring(0,k.MAX_NAME_LENGTH),e.throwInternal(i.WARNING,A,"name is too long. It has been truncated to "+k.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},k.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=k.MAX_STRING_LENGTH),t&&(n=n||k.MAX_STRING_LENGTH,(t=k.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(i.WARNING,_,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},k.sanitizeUrl=function(e,t){return k.sanitizeInput(e,t,k.MAX_URL_LENGTH,M)},k.sanitizeMessage=function(e,t){var n;return t&&t.length>k.MAX_MESSAGE_LENGTH&&(n=t.substring(0,k.MAX_MESSAGE_LENGTH),e.throwInternal(i.WARNING,w,"message is too long, it has been truncated to "+k.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},k.sanitizeException=function(e,t){var n;return t&&t.length>k.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,k.MAX_EXCEPTION_LENGTH),e.throwInternal(i.WARNING,C,"exception is too long, it has been truncated to "+k.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},k.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(i.WARNING,I,"custom property is not valid",{exception:e},!0)}a=k.sanitizeString(t,a,k.MAX_PROPERTY_LENGTH),n[r=k.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},k.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=k.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},k.sanitizeId=function(e,t){return t?k.sanitizeInput(e,t,k.MAX_ID_LENGTH,T).toString():t},k.sanitizeInput=function(e,t,n,r){var a;return t&&(t=k.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(i.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},k.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},k.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},k.MAX_NAME_LENGTH=150,k.MAX_ID_LENGTH=128,k.MAX_PROPERTY_LENGTH=8192,k.MAX_STRING_LENGTH=1024,k.MAX_URL_LENGTH=2048,k.MAX_MESSAGE_LENGTH=32768,k.MAX_EXCEPTION_LENGTH=32768,k);function k(){}var F=(H.disableStorage=function(){H._canUseLocalStorage=!1,H._canUseSessionStorage=!1},H._getLocalStorageObject=function(){return H.canUseLocalStorage()?H._getVerifiedStorageObject(a.LocalStorage):null},H._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},H.isInternalApplicationInsightsEndpoint=function(e){return-1!==H._internalEndpoints.indexOf(e.toLowerCase())},H.canUseLocalStorage=function(){return void 0===H._canUseLocalStorage&&(H._canUseLocalStorage=!!H._getVerifiedStorageObject(a.LocalStorage)),H._canUseLocalStorage},H.getStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,l,"Browser failed read of local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setStorage=function(t,e,n){var r=H._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,d,"Browser failed write to local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,f,"Browser failed removal of local storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H._getSessionStorageObject=function(){return H.canUseSessionStorage()?H._getVerifiedStorageObject(a.SessionStorage):null},H.canUseSessionStorage=function(){return void 0===H._canUseSessionStorage&&(H._canUseSessionStorage=!!H._getVerifiedStorageObject(a.SessionStorage)),H._canUseSessionStorage},H.getSessionStorageKeys=function(){var e=[];if(H.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},H.getSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,u,"Browser failed read of session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setSessionStorage=function(t,e,n){var r=H._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,p,"Browser failed write to session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,g,"Browser failed removal of session storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.disableCookies=function(){c.disableCookies()},H.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==H.document.cookie}catch(e){t.throwInternal(i.WARNING,b,"Cannot access document.cookie - "+H.getExceptionName(e),{exception:H.dump(e)})}}return c._canUseCookies},H.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),H.document.location&&"https:"===H.document.location.protocol&&(i=";secure"),H.canUseCookies(e)&&(H.document.cookie=t+"="+n+a+";path=/"+i)},H.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},H.getCookie=function(e,t){if(H.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=H.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=H.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},H.deleteCookie=function(e,t){H.canUseCookies(e)&&(H.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},H.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},H.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},H.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},H.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},H.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},H.toISOStringForIE8=function(e){if(H.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"}},H.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},H.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},H.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},H.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},H.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},H.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},H.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},H.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},H.document="undefined"!=typeof document?document:{},H._canUseLocalStorage=void 0,H._canUseSessionStorage=void 0,H._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],H.NotSpecified="not_specified",H);function H(){}var O=(z.parseUrl=function(e){return z.htmlAnchorElement||(z.htmlAnchorElement=z.document.createElement?z.document.createElement("a"):{host:z.parseHost(e)}),z.htmlAnchorElement.href=e,z.htmlAnchorElement},z.getAbsoluteUrl=function(e){var t,n=z.parseUrl(e);return n&&(t=n.href),t},z.getPathName=function(e){var t,n=z.parseUrl(e);return n&&(t=n.pathname),t},z.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},z.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},z.document="undefined"!=typeof document?document:{},z);function z(){}var P=(G.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=O.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var i=0;i<a.length;i++)if(new RegExp(a[i].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},G.getCorrelationContext=function(e){if(e){var t=G.getCorrelationContextValue(e,U.requestContextTargetKey);if(t&&t!==G.correlationIdPrefix)return t}},G.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2==a.length&&a[0]==t)return a[1]}},G.correlationIdPrefix="cid-v1:",G);function G(){}var X=(W.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=O.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=L.sanitizeString(e,n?n+" "+c:c)}else i=L.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},W);function W(){}var B=(V.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()},V.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},V);function V(){}var K="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Q=function(e,t){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function J(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,$=function(){return($=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Z=(J(ee,Y=function(){}),ee);function ee(){return Y.call(this)||this}var te;J(ne,te=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ne(e,t,n){var r=te.call(this)||this;return r.name=L.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function re(){}var ae,ie=(J(oe,ae=re),oe);function oe(){var e=ae.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var se;J(ce,se=ie),ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ce.dataType="EventData";function ce(e,t,n,r){var a=se.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=L.sanitizeString(e,t)||F.NotSpecified,a.properties=L.sanitizeProperties(e,n),a.measurements=L.sanitizeMeasurements(e,r),a}function le(){}var ue,de=(J(pe,ue=re),pe);function pe(){var e=ue.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function he(){this.hasFullStack=!0,this.parsedStack=[]}var fe;J(ge,fe=de),ge.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ve.CreateFromInterface(t,e)});return new ge(t,$({},e,{exceptions:n}))},ge.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},ge.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},ge.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",ge.dataType="ExceptionData";function ge(e,t,n,r,a){var i=fe.call(this)||this;return i.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(i.exceptions=[new ve(e,t)],i.properties=L.sanitizeProperties(e,n),i.measurements=L.sanitizeMeasurements(e,r),a&&(i.severityLevel=a)):(i.exceptions=t.exceptions,i.properties=t.properties,i.measurements=t.measurements,t.severityLevel&&(i.severityLevel=t.severityLevel)),i}var me,ve=(J(xe,me=he),xe.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},xe.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new xe(e,$({},t,{parsedStack:n}))},xe.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,l=t.length-1,u=0,d=c,p=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=l,c++,l--}}return t},xe);function xe(e,t){var n=me.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=L.sanitizeString(e,t.name)||F.NotSpecified,n.message=L.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=xe.parseStack(r),n.stack=L.sanitizeException(e,r),n.hasFullStack=F.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var ye,De=(J(Se,ye=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=ye.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ie,Ce,Ne,we=(J(Ae,Ie=re),Ae);function Ae(){var e=Ie.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ne=Ce||(Ce={}))[Ne.Measurement=0]="Measurement",Ne[Ne.Aggregation=1]="Aggregation";var _e,Me=(J(be,_e=function(){this.kind=Ce.Measurement}),be);function be(){var e=null!==_e&&_e.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var Te;J(je,Te=we),je.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",je.dataType="MetricData";function je(e,t,n,r,a,i,o){var s=Te.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=L.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=L.sanitizeProperties(e,o),s}var Re,Ee=(J(Ue,Re=ie),Ue);function Ue(){var e=Re.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe;J(Le,qe=Ee),Le.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Le.dataType="PageviewData";function Le(e,t,n,r,a,i,o){var s=qe.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=L.sanitizeId(e,o),s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),s}var ke,Fe=(J(He,ke=re),He);function He(){var e=ke.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Oe,ze=(J(Pe,Oe=Fe),Pe.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Pe.dataType="RemoteDependencyData",Pe);function Pe(e,t,n,r,a,i,o,s,c,l,u){void 0===c&&(c="Ajax");var d=Oe.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=L.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=L.sanitizeUrl(e,r)||p.data,d.target=p.target,d.name=p.name,d.properties=L.sanitizeProperties(e,l),d.measurements=L.sanitizeMeasurements(e,u),d}var Ge,Xe=(J(We,Ge=re),We);function We(){var e=Ge.call(this)||this;return e.ver=2,e.properties={},e}var Be;J(Ve,Be=Xe),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ve.dataType="MessageData";function Ve(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=L.sanitizeMessage(e,t),a.properties=L.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Ke,Qe=(J(Je,Ke=Ee),Je);function Je(){var e=Ke.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;J($e,Ye=Qe),$e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",$e.dataType="PageviewPerformanceData";function $e(e,t,n,r,a,i){var o=Ye.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=L.sanitizeUrl(e,n),o.name=L.sanitizeString(e,t)||F.NotSpecified,o.properties=L.sanitizeProperties(e,a),o.measurements=L.sanitizeMeasurements(e,i),o}var Ze,et,tt;J(nt,Ze=Z);function nt(e,t){var n=Ze.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(tt=et||(et={}))[tt.Verbose=0]="Verbose",tt[tt.Information=1]="Information",tt[tt.Warning=2]="Warning",tt[tt.Error=3]="Error",tt[tt.Critical=4]="Critical";var rt=(at.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},at);function at(){}var it=(ot.create=function(e,t,n,r,a,i){if(n=L.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},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},ot);function ot(){}var st=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ct=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?O.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?L.sanitizeUrl(this._logger,O.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 st,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}var ut=(dt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},dt.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))},dt);function dt(){}var pt=(ht.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[K]||!!r&&!0===r[K]):void 0!==e&&(o=this.initialized,a=!0===e[K],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},ht.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},ht.prototype.instrumentOpen=function(){var r=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){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},ht.prototype.openHandler=function(e,t,n,r){var a;a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var i=new ct(a,this._core.logger);i.method=t,i.requestUrl=n,i.xhrMonitoringState.openDone=!0,e.ajaxData=i,this.attachToOnReadyStateChange(e)},ht.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},ht.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){n._core.logger.throwInternal(i.CRITICAL,D,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},ht.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},ht.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){t._core.logger.throwInternal(i.CRITICAL,m,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},ht.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ut.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(i.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},ht.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},ht.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return P.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=it.create(e,ze.dataType,ze.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(i.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},ht.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},ht.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},ht.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},ht.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=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(i.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},ht.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[K]},ht.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},ht.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var r=new ct(n,this._core.logger);return r.requestSentTime=B.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},ht.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(P.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);var a=this._config.appId||this._context.appId();return a&&n.headers.set(U.requestContextHeader,U.requestContextAppIdFormat+a),n}return n}if(r){if(this.currentWindowHost&&P.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(U.requestIdHeader,r.ajaxData.id);var i=this._config.appId||this._context.appId();i&&r.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+i)}return r}},ht.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(i.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},ht.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return P.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},ht.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}},ht.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},ht.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=ht.getDefaultConfig();for(var a in this._config=ht.getEmptyConfig(),r)this._config[a]=rt.getConfig(e,a,ht.identifier,r[a]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},ht.identifier="AjaxDependencyPlugin",ht);function ht(){this._trackAjaxAttempts=0,this.identifier=ht.identifier,this.priority=171,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=pt,e.ajaxRecord=ct,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var a,t,h,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var c=(r.isNullOrUndefined=function(e){return null==e},r.disableCookies=function(){r._canUseCookies=!1},r.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},r);function r(){}var i,o,s=/[xy]/g;(o=i||(i={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var l=1,u=2,d=3,p=4,f=5,g=6,m=13,v=14,x=15,y=16,D=17,S=18,I=49,C=52,N=55,w=56,A=57,_=61,M=66,b=68,T=69;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error(E+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];s.priority>R&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=R}var R=500,E="Channel has invalid priority",U=(q.requestContextHeader="Request-Context",q.requestContextTargetKey="appId",q.requestContextAppIdFormat="appId=cid-v1:",q.requestIdHeader="Request-Id",q.sdkContextHeader="Sdk-Context",q.sdkContextHeaderAppIdRequest="appId",q.requestContextHeaderLowerCase="request-context",q);function q(){}var L=(k.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=k.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,k.MAX_NAME_LENGTH-3)+k.padNumber(i);a=o}return a},k.sanitizeKey=function(e,t){var n;return t&&(t=k.trim(t.toString())).length>k.MAX_NAME_LENGTH&&(n=t.substring(0,k.MAX_NAME_LENGTH),e.throwInternal(i.WARNING,A,"name is too long. It has been truncated to "+k.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},k.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=k.MAX_STRING_LENGTH),t&&(n=n||k.MAX_STRING_LENGTH,(t=k.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(i.WARNING,_,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},k.sanitizeUrl=function(e,t){return k.sanitizeInput(e,t,k.MAX_URL_LENGTH,M)},k.sanitizeMessage=function(e,t){var n;return t&&t.length>k.MAX_MESSAGE_LENGTH&&(n=t.substring(0,k.MAX_MESSAGE_LENGTH),e.throwInternal(i.WARNING,w,"message is too long, it has been truncated to "+k.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},k.sanitizeException=function(e,t){var n;return t&&t.length>k.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,k.MAX_EXCEPTION_LENGTH),e.throwInternal(i.WARNING,C,"exception is too long, it has been truncated to "+k.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},k.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(i.WARNING,I,"custom property is not valid",{exception:e},!0)}a=k.sanitizeString(t,a,k.MAX_PROPERTY_LENGTH),n[r=k.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},k.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=k.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},k.sanitizeId=function(e,t){return t?k.sanitizeInput(e,t,k.MAX_ID_LENGTH,T).toString():t},k.sanitizeInput=function(e,t,n,r){var a;return t&&(t=k.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(i.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},k.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},k.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},k.MAX_NAME_LENGTH=150,k.MAX_ID_LENGTH=128,k.MAX_PROPERTY_LENGTH=8192,k.MAX_STRING_LENGTH=1024,k.MAX_URL_LENGTH=2048,k.MAX_MESSAGE_LENGTH=32768,k.MAX_EXCEPTION_LENGTH=32768,k);function k(){}var F=(H.disableStorage=function(){H._canUseLocalStorage=!1,H._canUseSessionStorage=!1},H._getLocalStorageObject=function(){return H.canUseLocalStorage()?H._getVerifiedStorageObject(a.LocalStorage):null},H._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},H.isInternalApplicationInsightsEndpoint=function(e){return-1!==H._internalEndpoints.indexOf(e.toLowerCase())},H.canUseLocalStorage=function(){return void 0===H._canUseLocalStorage&&(H._canUseLocalStorage=!!H._getVerifiedStorageObject(a.LocalStorage)),H._canUseLocalStorage},H.getStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,l,"Browser failed read of local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setStorage=function(t,e,n){var r=H._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,d,"Browser failed write to local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,f,"Browser failed removal of local storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H._getSessionStorageObject=function(){return H.canUseSessionStorage()?H._getVerifiedStorageObject(a.SessionStorage):null},H.canUseSessionStorage=function(){return void 0===H._canUseSessionStorage&&(H._canUseSessionStorage=!!H._getVerifiedStorageObject(a.SessionStorage)),H._canUseSessionStorage},H.getSessionStorageKeys=function(){var e=[];if(H.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},H.getSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,u,"Browser failed read of session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setSessionStorage=function(t,e,n){var r=H._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,p,"Browser failed write to session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,g,"Browser failed removal of session storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.disableCookies=function(){c.disableCookies()},H.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==H.document.cookie}catch(e){t.throwInternal(i.WARNING,b,"Cannot access document.cookie - "+H.getExceptionName(e),{exception:H.dump(e)})}}return c._canUseCookies},H.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),H.document.location&&"https:"===H.document.location.protocol&&(i=";secure"),H.canUseCookies(e)&&(H.document.cookie=t+"="+n+a+";path=/"+i)},H.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},H.getCookie=function(e,t){if(H.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=H.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=H.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},H.deleteCookie=function(e,t){H.canUseCookies(e)&&(H.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},H.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},H.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},H.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},H.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},H.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},H.toISOStringForIE8=function(e){if(H.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"}},H.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},H.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},H.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},H.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},H.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},H.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},H.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},H.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},H.document="undefined"!=typeof document?document:{},H._canUseLocalStorage=void 0,H._canUseSessionStorage=void 0,H._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],H.NotSpecified="not_specified",H);function H(){}var O=(z.parseUrl=function(e){return z.htmlAnchorElement||(z.htmlAnchorElement=z.document.createElement?z.document.createElement("a"):{host:z.parseHost(e)}),z.htmlAnchorElement.href=e,z.htmlAnchorElement},z.getAbsoluteUrl=function(e){var t,n=z.parseUrl(e);return n&&(t=n.href),t},z.getPathName=function(e){var t,n=z.parseUrl(e);return n&&(t=n.pathname),t},z.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},z.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},z.document="undefined"!=typeof document?document:{},z);function z(){}var G=(P.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=O.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var i=0;i<a.length;i++)if(new RegExp(a[i].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},P.getCorrelationContext=function(e){if(e){var t=P.getCorrelationContextValue(e,U.requestContextTargetKey);if(t&&t!==P.correlationIdPrefix)return t}},P.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2==a.length&&a[0]==t)return a[1]}},P.correlationIdPrefix="cid-v1:",P);function P(){}var X=(W.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=O.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=L.sanitizeString(e,n?n+" "+c:c)}else i=L.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},W);function W(){}var B=(V.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()},V.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},V);function V(){}var K="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Q=function(e,t){return(Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function J(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,$=function(){return($=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Z=(J(ee,Y=function(){}),ee);function ee(){return Y.call(this)||this}var te;J(ne,te=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ne(e,t,n){var r=te.call(this)||this;return r.name=L.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function re(){}var ae,ie=(J(oe,ae=re),oe);function oe(){var e=ae.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var se;J(ce,se=ie),ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ce.dataType="EventData";function ce(e,t,n,r){var a=se.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=L.sanitizeString(e,t)||F.NotSpecified,a.properties=L.sanitizeProperties(e,n),a.measurements=L.sanitizeMeasurements(e,r),a}function le(){}var ue,de=(J(pe,ue=re),pe);function pe(){var e=ue.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function he(){this.hasFullStack=!0,this.parsedStack=[]}var fe;J(ge,fe=de),ge.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ve.CreateFromInterface(t,e)});return new ge(t,$({},e,{exceptions:n}))},ge.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:i,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},ge.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},ge.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",ge.dataType="ExceptionData";function ge(e,t,n,r,a){var i=fe.call(this)||this;return i.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(i.exceptions=[new ve(e,t)],i.properties=L.sanitizeProperties(e,n),i.measurements=L.sanitizeMeasurements(e,r),a&&(i.severityLevel=a)):(i.exceptions=t.exceptions,i.properties=t.properties,i.measurements=t.measurements,t.severityLevel&&(i.severityLevel=t.severityLevel),t.id&&(i.id=t.id),t.problemGroup&&(i.problemGroup=t.problemGroup),c.isNullOrUndefined(t.ver)||(i.ver=t.ver),c.isNullOrUndefined(t.isManual)||(i.isManual=t.isManual)),i}var me,ve=(J(xe,me=he),xe.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},xe.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new xe(e,$({},t,{parsedStack:n}))},xe.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,l=t.length-1,u=0,d=c,p=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=l,c++,l--}}return t},xe);function xe(e,t){var n=me.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=L.sanitizeString(e,t.name)||F.NotSpecified,n.message=L.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=xe.parseStack(r),n.stack=L.sanitizeException(e,r),n.hasFullStack=F.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var ye,De=(J(Se,ye=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=ye.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ie,Ce,Ne,we=(J(Ae,Ie=re),Ae);function Ae(){var e=Ie.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ne=Ce||(Ce={}))[Ne.Measurement=0]="Measurement",Ne[Ne.Aggregation=1]="Aggregation";var _e,Me=(J(be,_e=function(){this.kind=Ce.Measurement}),be);function be(){var e=null!==_e&&_e.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var Te;J(je,Te=we),je.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",je.dataType="MetricData";function je(e,t,n,r,a,i,o){var s=Te.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=L.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=L.sanitizeProperties(e,o),s}var Re,Ee=(J(Ue,Re=ie),Ue);function Ue(){var e=Re.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe;J(Le,qe=Ee),Le.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Le.dataType="PageviewData";function Le(e,t,n,r,a,i,o){var s=qe.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=L.sanitizeId(e,o),s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),s}var ke,Fe=(J(He,ke=re),He);function He(){var e=ke.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Oe,ze=(J(Ge,Oe=Fe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ge.dataType="RemoteDependencyData",Ge);function Ge(e,t,n,r,a,i,o,s,c,l,u){void 0===c&&(c="Ajax");var d=Oe.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=L.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=L.sanitizeUrl(e,r)||p.data,d.target=p.target,d.name=p.name,d.properties=L.sanitizeProperties(e,l),d.measurements=L.sanitizeMeasurements(e,u),d}var Pe,Xe=(J(We,Pe=re),We);function We(){var e=Pe.call(this)||this;return e.ver=2,e.properties={},e}var Be;J(Ve,Be=Xe),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ve.dataType="MessageData";function Ve(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=L.sanitizeMessage(e,t),a.properties=L.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Ke,Qe=(J(Je,Ke=Ee),Je);function Je(){var e=Ke.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;J($e,Ye=Qe),$e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",$e.dataType="PageviewPerformanceData";function $e(e,t,n,r,a,i,o){var s=Ye.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var Ze,et,tt;J(nt,Ze=Z);function nt(e,t){var n=Ze.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(tt=et||(et={}))[tt.Verbose=0]="Verbose",tt[tt.Information=1]="Information",tt[tt.Warning=2]="Warning",tt[tt.Error=3]="Error",tt[tt.Critical=4]="Critical";var rt=(at.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},at);function at(){}var it=(ot.create=function(e,t,n,r,a,i){if(n=L.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},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},ot);function ot(){}var st=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ct=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?O.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?L.sanitizeUrl(this._logger,O.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 st,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}var ut=(dt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},dt.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))},dt);function dt(){}var pt=(ht.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[K]||!!r&&!0===r[K]):void 0!==e&&(o=this.initialized,a=!0===e[K],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},ht.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},ht.prototype.instrumentOpen=function(){var r=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){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},ht.prototype.openHandler=function(e,t,n,r){var a;a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var i=new ct(a,this._core.logger);i.method=t,i.requestUrl=n,i.xhrMonitoringState.openDone=!0,e.ajaxData=i,this.attachToOnReadyStateChange(e)},ht.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},ht.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){n._core.logger.throwInternal(i.CRITICAL,D,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},ht.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},ht.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){t._core.logger.throwInternal(i.CRITICAL,m,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},ht.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ut.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(i.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},ht.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},ht.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return G.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=it.create(e,ze.dataType,ze.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(i.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},ht.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},ht.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},ht.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},ht.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=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(i.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},ht.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[K]},ht.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},ht.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var r=new ct(n,this._core.logger);return r.requestSentTime=B.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},ht.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(G.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);var a=this._config.appId||this._context.appId();return a&&n.headers.set(U.requestContextHeader,U.requestContextAppIdFormat+a),n}return n}if(r){if(this.currentWindowHost&&G.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(U.requestIdHeader,r.ajaxData.id);var i=this._config.appId||this._context.appId();i&&r.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+i)}return r}},ht.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(i.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},ht.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return G.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(i.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:F.dump(e)})}},ht.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},ht.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}},ht.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},ht.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=ht.getDefaultConfig();for(var a in this._config=ht.getEmptyConfig(),r)this._config[a]=rt.getConfig(e,a,ht.identifier,r[a]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},ht.identifier="AjaxDependencyPlugin",ht);function ht(){this._trackAjaxAttempts=0,this.identifier=ht.identifier,this.priority=171,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=pt,e.ajaxRecord=ct,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
{ | ||
"name": "@microsoft/applicationinsights-dependencies-js", | ||
"version": "2.0.0-rc5", | ||
"version": "2.0.0-rc6", | ||
"description": "Microsoft Application Insights XHR dependencies plugin", | ||
@@ -31,4 +31,4 @@ "main": "dist/applicationinsights-dependencies-js.js", | ||
"dependencies": { | ||
"@microsoft/applicationinsights-core-js": "2.0.0-rc5", | ||
"@microsoft/applicationinsights-common": "2.0.0-rc5", | ||
"@microsoft/applicationinsights-core-js": "2.0.0-rc6", | ||
"@microsoft/applicationinsights-common": "2.0.0-rc6", | ||
"tslib": "^1.9.3" | ||
@@ -35,0 +35,0 @@ }, |
@@ -301,3 +301,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
*/ | ||
public trackDependencyDataInternal(dependency: IDependencyTelemetry, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) { | ||
protected trackDependencyDataInternal(dependency: IDependencyTelemetry, properties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) { | ||
if (this._config.maxAjaxCallsPerView === -1 || this._trackAjaxAttempts < this._config.maxAjaxCallsPerView) { | ||
@@ -304,0 +304,0 @@ let item = TelemetryItemCreator.create<IDependencyTelemetry>( |
@@ -38,3 +38,3 @@ import { ICorrelationConfig, IDependencyTelemetry, IConfig } from '@microsoft/applicationinsights-common'; | ||
*/ | ||
trackDependencyDataInternal(dependency: IDependencyTelemetry, properties?: { | ||
protected trackDependencyDataInternal(dependency: IDependencyTelemetry, properties?: { | ||
[key: string]: any; | ||
@@ -41,0 +41,0 @@ }, systemProperties?: { |
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
1283584
6675
+ Added@microsoft/applicationinsights-common@2.0.0-rc6(transitive)
+ Added@microsoft/applicationinsights-core-js@2.0.0-rc6(transitive)
- Removed@microsoft/applicationinsights-common@2.0.0-rc5(transitive)
- Removed@microsoft/applicationinsights-core-js@2.0.0-rc5(transitive)