Socket
Socket
Sign inDemoInstall

@microsoft/applicationinsights-common

Package Overview
Dependencies
Maintainers
5
Versions
563
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-common - npm Package Compare versions

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

4

browser/applicationinsights-common.min.js
/*!
* Application Insights JavaScript SDK - Common, 1.0.0-beta.5
* Application Insights JavaScript SDK - Common, 1.0.0-beta.6
* 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.aicommon={})}(this,function(m){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=m.FieldType||(m.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var h,n,u=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=h||(h={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,c=3,l=4,d=5,p=6,v=8,y=10,S=45,f=52,g=56,T=57,N=61,I=66,D=68,w=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(h.WARNING,T,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(h.WARNING,N,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,I)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(h.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(h.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,w).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(h.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),x=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,c,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(h.WARNING,D,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),_=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),F=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=_.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),C=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=_.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=E.sanitizeString(e,n?n+" "+i:i);else a=E.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),R=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),M=function(e,t){return(M=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 U(e,t){function n(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var b,L,z=function(){},k=function(e){function t(){return e.call(this)||this}return U(t,e),t}(z),q=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=E.sanitizeString(e,n)||x.NotSpecified,i.data=t,i.time=x.toISOStringForIE8(new Date),i.aiDataContract={time:m.FieldType.Required,iKey:m.FieldType.Required,name:m.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?m.FieldType.Hidden:m.FieldType.Required},tags:m.FieldType.Required,data:m.FieldType.Required},i}return U(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),O=function(){},P=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(O),G=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Required,properties:m.FieldType.Default,measurements:m.FieldType.Default},r.name=E.sanitizeString(e,t)||x.NotSpecified,r.properties=E.sanitizeProperties(e,n),r.measurements=E.sanitizeMeasurements(e,i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(P),H=function(){},V=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:m.FieldType.Required,exceptions:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},a.properties=E.sanitizeProperties(e,n),a.measurements=E.sanitizeMeasurements(e,i),a.exceptions=[new X(e,t)],r&&(a.severityLevel=r),a}return U(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return U(e,t),e}(O)),X=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:m.FieldType.Default,outerId:m.FieldType.Default,typeName:m.FieldType.Required,message:m.FieldType.Required,hasFullStack:m.FieldType.Default,stack:m.FieldType.Default,parsedStack:m.FieldType.Array},n.typeName=E.sanitizeString(e,t.name)||x.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||x.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=E.sanitizeException(e,i),n.hasFullStack=x.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return U(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(B.regex.test(o)){var s=new B(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var u=0,c=t.length-1,l=0,d=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=u,p=c,u++,c--}}return t},e}(V),B=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:m.FieldType.Required,method:m.FieldType.Required,assembly:m.FieldType.Default,fileName:m.FieldType.Default,line:m.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=x.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=x.trim(i[2])||n.method,n.fileName=x.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return U(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(H),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return U(e,t),e}(O);(L=b||(b={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:m.FieldType.Required,kind:m.FieldType.Default,value:m.FieldType.Required,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default},e}return U(e,t),e}(function(){this.kind=b.Measurement}),Y=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;s.aiDataContract={ver:m.FieldType.Required,metrics:m.FieldType.Required,properties:m.FieldType.Default};var u=new Q;return u.count=0<i?i:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(r)||null===r?void 0:r,u.name=E.sanitizeString(e,t)||x.NotSpecified,u.value=n,s.metrics=[u],s.properties=E.sanitizeProperties(e,o),s}return U(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(P),$=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,id:m.FieldType.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||x.NotSpecified,isNaN(i)||(s.duration=x.msToTimeSpan(i)),s.properties=E.sanitizeProperties(e,r),s.measurements=E.sanitizeMeasurements(e,a),s}return U(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,u,c){var l=p.call(this)||this;l.aiDataContract={id:m.FieldType.Required,ver:m.FieldType.Required,name:m.FieldType.Default,resultCode:m.FieldType.Default,duration:m.FieldType.Default,success:m.FieldType.Default,data:m.FieldType.Default,target:m.FieldType.Default,type:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,kind:m.FieldType.Default,value:m.FieldType.Default,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default,dependencyKind:m.FieldType.Default,dependencySource:m.FieldType.Default,commandName:m.FieldType.Default,dependencyTypeName:m.FieldType.Default},l.id=t,l.duration=x.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=E.sanitizeUrl(e,i);var d=C.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=E.sanitizeProperties(e,u),l.measurements=E.sanitizeMeasurements(e,c),l}return U(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return U(e,t),e}(O)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,message:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default},t=t||x.NotSpecified,r.message=E.sanitizeMessage(e,t),r.properties=E.sanitizeProperties(e,n),i&&(r.severityLevel=i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return U(e,t),e}(O)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,perfTotal:m.FieldType.Default,networkConnect:m.FieldType.Default,sentRequest:m.FieldType.Default,receivedResponse:m.FieldType.Default,domProcessing:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var u=g.getDuration(s.navigationStart,s.loadEventEnd),c=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==u?e.throwInternal(h.WARNING,y,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:p}):g.shouldCollectDuration(u,c,l,d,p)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(h.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:p}):(o.durationMs=u,o.perfTotal=o.duration=x.msToTimeSpan(u),o.networkConnect=x.msToTimeSpan(c),o.sentRequest=x.msToTimeSpan(l),o.receivedResponse=x.msToTimeSpan(d),o.domProcessing=x.msToTimeSpan(p),o.isValid=!0):e.throwInternal(h.WARNING,S,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:p})}return o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||x.NotSpecified,o.properties=E.sanitizeProperties(e,r),o.measurements=E.sanitizeMeasurements(e,a),o}return U(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:m.FieldType.Required,baseData:m.FieldType.Required},n.baseType=e,n.baseData=t,n}return U(e,i),e}(k);(K=m.SeverityLevel||(m.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"},re=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=E.sanitizeString(i,n)||x.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}();m.Util=x,m.CorrelationIdHelper=F,m.UrlHelper=_,m.DateTimeUtils=R,m.RequestHeaders=A,m.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",m.AIData=k,m.AIBase=z,m.Envelope=q,m.Event=G,m.Exception=j,m.Metric=Y,m.PageView=$,m.PageViewData=J,m.RemoteDependencyData=Z,m.Trace=ee,m.PageViewPerformance=te,m.Data=ne,m.ContextTagKeys=ie,m.DataSanitizer=E,m.TelemetryItemCreator=re,Object.defineProperty(m,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.aicommon={})}(this,function(m){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=m.FieldType||(m.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var h,n,u=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=h||(h={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,c=3,l=4,d=5,p=6,v=8,y=10,S=45,f=52,g=56,T=57,N=61,I=66,D=68,w=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(h.WARNING,T,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(h.WARNING,N,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,I)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(h.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(h.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,w).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(h.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),x=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,c,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(h.WARNING,D,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),_=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),F=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=_.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),C=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=_.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=E.sanitizeString(e,n?n+" "+i:i);else a=E.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),M=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),R=function(e,t){return(R=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 U(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var b,L,z=function(){},k=function(e){function t(){return e.call(this)||this}return U(t,e),t}(z),q=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=E.sanitizeString(e,n)||x.NotSpecified,i.data=t,i.time=x.toISOStringForIE8(new Date),i.aiDataContract={time:m.FieldType.Required,iKey:m.FieldType.Required,name:m.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?m.FieldType.Hidden:m.FieldType.Required},tags:m.FieldType.Required,data:m.FieldType.Required},i}return U(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),O=function(){},P=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(O),G=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Required,properties:m.FieldType.Default,measurements:m.FieldType.Default},r.name=E.sanitizeString(e,t)||x.NotSpecified,r.properties=E.sanitizeProperties(e,n),r.measurements=E.sanitizeMeasurements(e,i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(P),H=function(){},V=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:m.FieldType.Required,exceptions:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},a.properties=E.sanitizeProperties(e,n),a.measurements=E.sanitizeMeasurements(e,i),a.exceptions=[new X(e,t)],r&&(a.severityLevel=r),a}return U(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return U(e,t),e}(O)),X=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:m.FieldType.Default,outerId:m.FieldType.Default,typeName:m.FieldType.Required,message:m.FieldType.Required,hasFullStack:m.FieldType.Default,stack:m.FieldType.Default,parsedStack:m.FieldType.Array},n.typeName=E.sanitizeString(e,t.name)||x.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||x.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=E.sanitizeException(e,i),n.hasFullStack=x.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return U(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(B.regex.test(o)){var s=new B(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var u=0,c=t.length-1,l=0,d=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=u,p=c,u++,c--}}return t},e}(V),B=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:m.FieldType.Required,method:m.FieldType.Required,assembly:m.FieldType.Default,fileName:m.FieldType.Default,line:m.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=x.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=x.trim(i[2])||n.method,n.fileName=x.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return U(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(H),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return U(e,t),e}(O);(L=b||(b={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:m.FieldType.Required,kind:m.FieldType.Default,value:m.FieldType.Required,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default},e}return U(e,t),e}(function(){this.kind=b.Measurement}),Y=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;s.aiDataContract={ver:m.FieldType.Required,metrics:m.FieldType.Required,properties:m.FieldType.Default};var u=new Q;return u.count=0<i?i:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(r)||null===r?void 0:r,u.name=E.sanitizeString(e,t)||x.NotSpecified,u.value=n,s.metrics=[u],s.properties=E.sanitizeProperties(e,o),s}return U(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(P),$=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,id:m.FieldType.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||x.NotSpecified,isNaN(i)||(s.duration=x.msToTimeSpan(i)),s.properties=E.sanitizeProperties(e,r),s.measurements=E.sanitizeMeasurements(e,a),s}return U(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,u,c){var l=p.call(this)||this;l.aiDataContract={id:m.FieldType.Required,ver:m.FieldType.Required,name:m.FieldType.Default,resultCode:m.FieldType.Default,duration:m.FieldType.Default,success:m.FieldType.Default,data:m.FieldType.Default,target:m.FieldType.Default,type:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,kind:m.FieldType.Default,value:m.FieldType.Default,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default,dependencyKind:m.FieldType.Default,dependencySource:m.FieldType.Default,commandName:m.FieldType.Default,dependencyTypeName:m.FieldType.Default},l.id=t,l.duration=x.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=E.sanitizeUrl(e,i);var d=C.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=E.sanitizeProperties(e,u),l.measurements=E.sanitizeMeasurements(e,c),l}return U(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return U(e,t),e}(O)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,message:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default},t=t||x.NotSpecified,r.message=E.sanitizeMessage(e,t),r.properties=E.sanitizeProperties(e,n),i&&(r.severityLevel=i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return U(e,t),e}(O)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,perfTotal:m.FieldType.Default,networkConnect:m.FieldType.Default,sentRequest:m.FieldType.Default,receivedResponse:m.FieldType.Default,domProcessing:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var u=g.getDuration(s.navigationStart,s.loadEventEnd),c=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==u?e.throwInternal(h.WARNING,y,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:p}):g.shouldCollectDuration(u,c,l,d,p)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(h.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:p}):(o.durationMs=u,o.perfTotal=o.duration=x.msToTimeSpan(u),o.networkConnect=x.msToTimeSpan(c),o.sentRequest=x.msToTimeSpan(l),o.receivedResponse=x.msToTimeSpan(d),o.domProcessing=x.msToTimeSpan(p),o.isValid=!0):e.throwInternal(h.WARNING,S,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:p})}return o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||x.NotSpecified,o.properties=E.sanitizeProperties(e,r),o.measurements=E.sanitizeMeasurements(e,a),o}return U(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:m.FieldType.Required,baseData:m.FieldType.Required},n.baseType=e,n.baseData=t,n}return U(e,i),e}(k);(K=m.SeverityLevel||(m.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n){return n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t]},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"},ae=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=E.sanitizeString(i,n)||x.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}();m.Util=x,m.CorrelationIdHelper=F,m.UrlHelper=_,m.DateTimeUtils=M,m.RequestHeaders=A,m.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",m.AIData=k,m.AIBase=z,m.Envelope=q,m.Event=G,m.Exception=j,m.Metric=Y,m.PageView=$,m.PageViewData=J,m.RemoteDependencyData=Z,m.Trace=ee,m.PageViewPerformance=te,m.Data=ne,m.ConfigurationManager=ie,m.ContextTagKeys=re,m.DataSanitizer=E,m.TelemetryItemCreator=ae,Object.defineProperty(m,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-common.min.js.map

@@ -20,2 +20,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

export { SeverityLevel } from './Interfaces/Contracts/Generated/SeverityLevel';
export { ConfigurationManager } from './Interfaces/IConfig';
export { ContextTagKeys } from './Interfaces/Contracts/Generated/ContextTagKeys';

@@ -22,0 +23,0 @@ export { DataSanitizer } from './Telemetry/Common/DataSanitizer';

@@ -1,3 +0,13 @@

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
var ConfigurationManager = /** @class */ (function () {
function ConfigurationManager() {
}
ConfigurationManager.getConfig = function (config, field, identifier) {
if (!identifier || !config.extensionConfig || !config.extensionConfig[identifier]) {
return config[field];
}
return config.extensionConfig[identifier][field] || config[field];
};
return ConfigurationManager;
}());
export { ConfigurationManager };
//# sourceMappingURL=IConfig.js.map
/*!
* Application Insights JavaScript SDK - Common, 1.0.0-beta.5
* Application Insights JavaScript SDK - Common, 1.0.0-beta.6
* 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.aicommon={})}(this,function(m){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=m.FieldType||(m.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var h,n,u=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=h||(h={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,c=3,l=4,d=5,p=6,v=8,y=10,S=45,f=52,g=56,T=57,N=61,I=66,D=68,w=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(h.WARNING,T,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(h.WARNING,N,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,I)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(h.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(h.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,w).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(h.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),x=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,c,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(h.WARNING,D,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),_=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),F=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=_.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),C=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=_.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=E.sanitizeString(e,n?n+" "+i:i);else a=E.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),R=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),M=function(e,t){return(M=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 U(e,t){function n(){this.constructor=e}M(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var b,L,z=function(){},k=function(e){function t(){return e.call(this)||this}return U(t,e),t}(z),q=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=E.sanitizeString(e,n)||x.NotSpecified,i.data=t,i.time=x.toISOStringForIE8(new Date),i.aiDataContract={time:m.FieldType.Required,iKey:m.FieldType.Required,name:m.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?m.FieldType.Hidden:m.FieldType.Required},tags:m.FieldType.Required,data:m.FieldType.Required},i}return U(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),O=function(){},P=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(O),G=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Required,properties:m.FieldType.Default,measurements:m.FieldType.Default},r.name=E.sanitizeString(e,t)||x.NotSpecified,r.properties=E.sanitizeProperties(e,n),r.measurements=E.sanitizeMeasurements(e,i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(P),H=function(){},V=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:m.FieldType.Required,exceptions:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},a.properties=E.sanitizeProperties(e,n),a.measurements=E.sanitizeMeasurements(e,i),a.exceptions=[new X(e,t)],r&&(a.severityLevel=r),a}return U(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return U(e,t),e}(O)),X=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:m.FieldType.Default,outerId:m.FieldType.Default,typeName:m.FieldType.Required,message:m.FieldType.Required,hasFullStack:m.FieldType.Default,stack:m.FieldType.Default,parsedStack:m.FieldType.Array},n.typeName=E.sanitizeString(e,t.name)||x.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||x.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=E.sanitizeException(e,i),n.hasFullStack=x.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return U(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(B.regex.test(o)){var s=new B(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var u=0,c=t.length-1,l=0,d=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=u,p=c,u++,c--}}return t},e}(V),B=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:m.FieldType.Required,method:m.FieldType.Required,assembly:m.FieldType.Default,fileName:m.FieldType.Default,line:m.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=x.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=x.trim(i[2])||n.method,n.fileName=x.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return U(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(H),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return U(e,t),e}(O);(L=b||(b={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:m.FieldType.Required,kind:m.FieldType.Default,value:m.FieldType.Required,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default},e}return U(e,t),e}(function(){this.kind=b.Measurement}),Y=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;s.aiDataContract={ver:m.FieldType.Required,metrics:m.FieldType.Required,properties:m.FieldType.Default};var u=new Q;return u.count=0<i?i:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(r)||null===r?void 0:r,u.name=E.sanitizeString(e,t)||x.NotSpecified,u.value=n,s.metrics=[u],s.properties=E.sanitizeProperties(e,o),s}return U(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(P),$=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,id:m.FieldType.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||x.NotSpecified,isNaN(i)||(s.duration=x.msToTimeSpan(i)),s.properties=E.sanitizeProperties(e,r),s.measurements=E.sanitizeMeasurements(e,a),s}return U(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,u,c){var l=p.call(this)||this;l.aiDataContract={id:m.FieldType.Required,ver:m.FieldType.Required,name:m.FieldType.Default,resultCode:m.FieldType.Default,duration:m.FieldType.Default,success:m.FieldType.Default,data:m.FieldType.Default,target:m.FieldType.Default,type:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,kind:m.FieldType.Default,value:m.FieldType.Default,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default,dependencyKind:m.FieldType.Default,dependencySource:m.FieldType.Default,commandName:m.FieldType.Default,dependencyTypeName:m.FieldType.Default},l.id=t,l.duration=x.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=E.sanitizeUrl(e,i);var d=C.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=E.sanitizeProperties(e,u),l.measurements=E.sanitizeMeasurements(e,c),l}return U(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return U(e,t),e}(O)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,message:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default},t=t||x.NotSpecified,r.message=E.sanitizeMessage(e,t),r.properties=E.sanitizeProperties(e,n),i&&(r.severityLevel=i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return U(e,t),e}(O)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,perfTotal:m.FieldType.Default,networkConnect:m.FieldType.Default,sentRequest:m.FieldType.Default,receivedResponse:m.FieldType.Default,domProcessing:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var u=g.getDuration(s.navigationStart,s.loadEventEnd),c=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==u?e.throwInternal(h.WARNING,y,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:p}):g.shouldCollectDuration(u,c,l,d,p)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(h.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:p}):(o.durationMs=u,o.perfTotal=o.duration=x.msToTimeSpan(u),o.networkConnect=x.msToTimeSpan(c),o.sentRequest=x.msToTimeSpan(l),o.receivedResponse=x.msToTimeSpan(d),o.domProcessing=x.msToTimeSpan(p),o.isValid=!0):e.throwInternal(h.WARNING,S,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:p})}return o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||x.NotSpecified,o.properties=E.sanitizeProperties(e,r),o.measurements=E.sanitizeMeasurements(e,a),o}return U(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:m.FieldType.Required,baseData:m.FieldType.Required},n.baseType=e,n.baseData=t,n}return U(e,i),e}(k);(K=m.SeverityLevel||(m.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"},re=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=E.sanitizeString(i,n)||x.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}();m.Util=x,m.CorrelationIdHelper=F,m.UrlHelper=_,m.DateTimeUtils=R,m.RequestHeaders=A,m.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",m.AIData=k,m.AIBase=z,m.Envelope=q,m.Event=G,m.Exception=j,m.Metric=Y,m.PageView=$,m.PageViewData=J,m.RemoteDependencyData=Z,m.Trace=ee,m.PageViewPerformance=te,m.Data=ne,m.ContextTagKeys=ie,m.DataSanitizer=E,m.TelemetryItemCreator=re,Object.defineProperty(m,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.aicommon={})}(this,function(m){"use strict";var r,e,t;(e=r||(r={}))[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage",(t=m.FieldType||(m.FieldType={}))[t.Default=0]="Default",t[t.Required=1]="Required",t[t.Array=2]="Array",t[t.Hidden=4]="Hidden";var h,n,u=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(i,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),i=/[xy]/g;(n=h||(h={}))[n.CRITICAL=1]="CRITICAL",n[n.WARNING=2]="WARNING";var a=1,o=2,c=3,l=4,d=5,p=6,v=8,y=10,S=45,f=52,g=56,T=57,N=61,I=66,D=68,w=69,s=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=s}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,i,r){var a=this;if(this.channelQueue=new Array,n.channels)n.channels.forEach(function(e){if(e&&0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}});else{for(var e=new Array,t=0;t<r.length;t++){var o=r[t];o.priority>s&&e.push(o)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,i,r)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}}(),200),A=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var i=t.length,r=s.sanitizeKey(e,t);if(r.length!==i){for(var a=0,o=r;void 0!==n[o];)a++,o=r.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);r=o}return r},s.sanitizeKey=function(e,t){return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(t=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(h.WARNING,T,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),t},s.sanitizeString=function(e,t,n){return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(t=t.toString().substring(0,n),e.throwInternal(h.WARNING,N,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,I)},s.sanitizeMessage=function(e,t){return t&&t.length>s.MAX_MESSAGE_LENGTH&&(t=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(h.WARNING,g,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),t},s.sanitizeException=function(e,t){return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(t=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(h.WARNING,f,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),t},s.sanitizeProperties=function(e,t){if(t){var n={};for(var i in t){var r=s.sanitizeString(e,t[i],s.MAX_PROPERTY_LENGTH);n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var i in t){var r=t[i];n[i=s.sanitizeKeyAndAddUniqueness(e,i,n)]=r}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,w).toString():t},s.sanitizeInput=function(e,t,n,i){return t&&(t=s.trim(t)).length>n&&(t=t.substring(0,n),e.throwInternal(h.WARNING,i,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),x=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(r.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,i=null;try{if("undefined"==typeof window)return null;n=new Date,(i=e===r.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=i.getItem(n)!=n,i.removeItem(n),t&&(i=null)}catch(e){i=null}return i},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(r.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,a,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var i=s._getLocalStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,c,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(h.WARNING,d,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(r.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(r.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,o,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var i=s._getSessionStorageObject();if(null!==i)try{return i.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,l,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(h.WARNING,p,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(h.WARNING,D,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,i){var r="",a="";i&&(r=";domain="+i),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+r+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var i=t+"=",r=s.document.cookie.split(";"),a=0;a<r.length;a++){var o=r[a];if((o=s.trim(o))&&0===o.indexOf(i)){n=o.substring(i.length,r[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,i=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,i=i.length<2?"0"+i:i,(0<a?a+".":"")+(r=r.length<2?"0"+r:r)+":"+i+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,i,r){return("Script error."===e||"Script error"===e)&&!r},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),_=function(){function i(){}return i.parseUrl=function(e){return i.htmlAnchorElement||(i.htmlAnchorElement=i.document.createElement?i.document.createElement("a"):{}),i.htmlAnchorElement.href=e,i.htmlAnchorElement},i.getAbsoluteUrl=function(e){var t,n=i.parseUrl(e);return n&&(t=n.href),t},i.getPathName=function(e){var t,n=i.parseUrl(e);return n&&(t=n.pathname),t},i.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},i.document="undefined"!=typeof document?document:{},i}(),F=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var i=_.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||i===n))return!1;var r=e&&e.correlationHeaderExcludedDomains;if(!r||0==r.length)return!0;for(var a=0;a<r.length;a++){if(new RegExp(r[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(i))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,A.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),i=0;i<n.length;++i){var r=n[i].split("=");if(2==r.length&&r[0]==t)return r[1]}},n.correlationIdPrefix="cid-v1:",n}(),C=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,i){var r,a;if(t&&0<t.length){var o=_.parseUrl(t);if(r=o.host,null!=o.pathname)"/"!==(i=0===o.pathname.length?"/":o.pathname).charAt(0)&&(i="/"+i),a=E.sanitizeString(e,n?n+" "+i:i);else a=E.sanitizeString(e,t)}else a=r=i;return{target:r,name:a}},e}(),M=function(){function e(){}return e.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||(n=t-e),n},e}(),R=function(e,t){return(R=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 U(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var b,L,z=function(){},k=function(e){function t(){return e.call(this)||this}return U(t,e),t}(z),q=function(r){function e(e,t,n){var i=r.call(this)||this;return i.name=E.sanitizeString(e,n)||x.NotSpecified,i.data=t,i.time=x.toISOStringForIE8(new Date),i.aiDataContract={time:m.FieldType.Required,iKey:m.FieldType.Required,name:m.FieldType.Required,sampleRate:function(){return 100==i.sampleRate?m.FieldType.Hidden:m.FieldType.Required},tags:m.FieldType.Required,data:m.FieldType.Required},i}return U(e,r),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),O=function(){},P=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(O),G=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Required,properties:m.FieldType.Default,measurements:m.FieldType.Default},r.name=E.sanitizeString(e,t)||x.NotSpecified,r.properties=E.sanitizeProperties(e,n),r.measurements=E.sanitizeMeasurements(e,i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(P),H=function(){},V=function(){this.hasFullStack=!0,this.parsedStack=[]},j=function(o){function e(e,t,n,i,r){var a=o.call(this)||this;return a.aiDataContract={ver:m.FieldType.Required,exceptions:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},a.properties=E.sanitizeProperties(e,n),a.measurements=E.sanitizeMeasurements(e,i),a.exceptions=[new X(e,t)],r&&(a.severityLevel=r),a}return U(e,o),e.CreateSimpleException=function(e,t,n,i,r,a){return{exceptions:[{hasFullStack:!0,message:e,stack:r,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return U(e,t),e}(O)),X=function(r){function e(e,t){var n=r.call(this)||this;n.aiDataContract={id:m.FieldType.Default,outerId:m.FieldType.Default,typeName:m.FieldType.Required,message:m.FieldType.Required,hasFullStack:m.FieldType.Default,stack:m.FieldType.Default,parsedStack:m.FieldType.Array},n.typeName=E.sanitizeString(e,t.name)||x.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||x.NotSpecified;var i=t.stack;return n.parsedStack=n.parseStack(i),n.stack=E.sanitizeException(e,i),n.hasFullStack=x.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return U(e,r),e.prototype.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var i=0,r=0,a=0;a<=n.length;a++){var o=n[a];if(B.regex.test(o)){var s=new B(n[a],i++);r+=s.sizeInBytes,t.push(s)}}if(32768<r)for(var u=0,c=t.length-1,l=0,d=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var f=p-d+1;t.splice(d,f);break}d=u,p=c,u++,c--}}return t},e}(V),B=function(r){function a(e,t){var n=r.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:m.FieldType.Required,method:m.FieldType.Required,assembly:m.FieldType.Default,fileName:m.FieldType.Default,line:m.FieldType.Default},n.level=t,n.method="<no_method>",n.assembly=x.trim(e);var i=e.match(a.regex);return i&&5<=i.length&&(n.method=x.trim(i[2])||n.method,n.fileName=x.trim(i[4]),n.line=parseInt(i[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return U(a,r),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(H),W=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return U(e,t),e}(O);(L=b||(b={}))[L.Measurement=0]="Measurement",L[L.Aggregation=1]="Aggregation";var K,Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:m.FieldType.Required,kind:m.FieldType.Default,value:m.FieldType.Required,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default},e}return U(e,t),e}(function(){this.kind=b.Measurement}),Y=function(c){function e(e,t,n,i,r,a,o){var s=c.call(this)||this;s.aiDataContract={ver:m.FieldType.Required,metrics:m.FieldType.Required,properties:m.FieldType.Default};var u=new Q;return u.count=0<i?i:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(r)||null===r?void 0:r,u.name=E.sanitizeString(e,t)||x.NotSpecified,u.value=n,s.metrics=[u],s.properties=E.sanitizeProperties(e,o),s}return U(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(W),J=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(P),$=function(u){function e(e,t,n,i,r,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,id:m.FieldType.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||x.NotSpecified,isNaN(i)||(s.duration=x.msToTimeSpan(i)),s.properties=E.sanitizeProperties(e,r),s.measurements=E.sanitizeMeasurements(e,a),s}return U(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(J),Z=function(p){function e(e,t,n,i,r,a,o,s,u,c){var l=p.call(this)||this;l.aiDataContract={id:m.FieldType.Required,ver:m.FieldType.Required,name:m.FieldType.Default,resultCode:m.FieldType.Default,duration:m.FieldType.Default,success:m.FieldType.Default,data:m.FieldType.Default,target:m.FieldType.Default,type:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default,kind:m.FieldType.Default,value:m.FieldType.Default,count:m.FieldType.Default,min:m.FieldType.Default,max:m.FieldType.Default,stdDev:m.FieldType.Default,dependencyKind:m.FieldType.Default,dependencySource:m.FieldType.Default,commandName:m.FieldType.Default,dependencyTypeName:m.FieldType.Default},l.id=t,l.duration=x.msToTimeSpan(r),l.success=a,l.resultCode=o+"",l.type="Ajax",l.data=E.sanitizeUrl(e,i);var d=C.ParseDependencyPath(e,n,s,i);return l.target=d.target,l.name=d.name,l.properties=E.sanitizeProperties(e,u),l.measurements=E.sanitizeMeasurements(e,c),l}return U(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return U(e,t),e}(O)),ee=function(a){function e(e,t,n,i){var r=a.call(this)||this;return r.aiDataContract={ver:m.FieldType.Required,message:m.FieldType.Required,severityLevel:m.FieldType.Default,properties:m.FieldType.Default},t=t||x.NotSpecified,r.message=E.sanitizeMessage(e,t),r.properties=E.sanitizeProperties(e,n),i&&(r.severityLevel=i),r}return U(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return U(e,t),e}(O)),te=function(f){function g(e,t,n,i,r,a){var o=f.call(this)||this;o.aiDataContract={ver:m.FieldType.Required,name:m.FieldType.Default,url:m.FieldType.Default,duration:m.FieldType.Default,perfTotal:m.FieldType.Default,networkConnect:m.FieldType.Default,sentRequest:m.FieldType.Default,receivedResponse:m.FieldType.Default,domProcessing:m.FieldType.Default,properties:m.FieldType.Default,measurements:m.FieldType.Default},o.isValid=!1;var s=g.getPerformanceTiming();if(s){var u=g.getDuration(s.navigationStart,s.loadEventEnd),c=g.getDuration(s.navigationStart,s.connectEnd),l=g.getDuration(s.requestStart,s.responseStart),d=g.getDuration(s.responseStart,s.responseEnd),p=g.getDuration(s.responseEnd,s.loadEventEnd);0==u?e.throwInternal(h.WARNING,y,"error calculating page view performance.",{total:u,network:c,request:l,response:d,dom:p}):g.shouldCollectDuration(u,c,l,d,p)?u<Math.floor(c)+Math.floor(l)+Math.floor(d)+Math.floor(p)?e.throwInternal(h.WARNING,v,"client performance math error.",{total:u,network:c,request:l,response:d,dom:p}):(o.durationMs=u,o.perfTotal=o.duration=x.msToTimeSpan(u),o.networkConnect=x.msToTimeSpan(c),o.sentRequest=x.msToTimeSpan(l),o.receivedResponse=x.msToTimeSpan(d),o.domProcessing=x.msToTimeSpan(p),o.isValid=!0):e.throwInternal(h.WARNING,S,"Invalid page load duration value. Browser perf data won't be sent.",{total:u,network:c,request:l,response:d,dom:p})}return o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||x.NotSpecified,o.properties=E.sanitizeProperties(e,r),o.measurements=E.sanitizeMeasurements(e,a),o}return U(g,f),g.prototype.getIsValid=function(){return this.isValid},g.prototype.getDurationMs=function(){return this.durationMs},g.getPerformanceTiming=function(){return g.isPerformanceTimingSupported()?window.performance.timing:null},g.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},g.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},g.getDuration=function(e,t){var n=void 0;return isNaN(e)||isNaN(t)||(n=Math.max(t-e,0)),n},g.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],i=navigator.userAgent,r=!1;if(i)for(var a=0;a<n.length;a++)r=r||-1!==i.toLowerCase().indexOf(n[a]);if(r)return!1;for(var o=0;o<e.length;o++)if(e[o]>=g.MAX_DURATION_ALLOWED)return!1;return!0},g.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",g.dataType="PageviewPerformanceData",g.MAX_DURATION_ALLOWED=36e5,g}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return U(e,t),e}(J)),ne=function(i){function e(e,t){var n=i.call(this)||this;return n.aiDataContract={baseType:m.FieldType.Required,baseData:m.FieldType.Required},n.baseType=e,n.baseData=t,n}return U(e,i),e}(k);(K=m.SeverityLevel||(m.SeverityLevel={}))[K.Verbose=0]="Verbose",K[K.Information=1]="Information",K[K.Warning=2]="Warning",K[K.Error=3]="Error",K[K.Critical=4]="Critical";var ie=function(){function e(){}return e.getConfig=function(e,t,n){return n&&e.extensionConfig&&e.extensionConfig[n]&&e.extensionConfig[n][t]||e[t]},e}(),re=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"},ae=function(){function e(){}return e.create=function(e,t,n,i,r,a){if(n=E.sanitizeString(i,n)||x.NotSpecified,u.isNullOrUndefined(e)||u.isNullOrUndefined(t)||u.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,timestamp:new Date,instrumentationKey:"",ctx:a||{},tags:[],data:{},baseType:t,baseData:e};if(!u.isNullOrUndefined(r))for(var s in r)r.hasOwnProperty(s)&&(o.data[s]=r[s]);return o},e}();m.Util=x,m.CorrelationIdHelper=F,m.UrlHelper=_,m.DateTimeUtils=M,m.RequestHeaders=A,m.DisabledPropertyName="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",m.AIData=k,m.AIBase=z,m.Envelope=q,m.Event=G,m.Exception=j,m.Metric=Y,m.PageView=$,m.PageViewData=J,m.RemoteDependencyData=Z,m.Trace=ee,m.PageViewPerformance=te,m.Data=ne,m.ConfigurationManager=ie,m.ContextTagKeys=re,m.DataSanitizer=E,m.TelemetryItemCreator=ae,Object.defineProperty(m,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-common.min.js.map
{
"name": "@microsoft/applicationinsights-common",
"version": "1.0.0-beta.5",
"version": "1.0.0-beta.6",
"description": "Microsoft Application Insights Common JavaScript Library",

@@ -5,0 +5,0 @@ "main": "./dist/applicationinsights-common.js",

@@ -30,3 +30,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

export { SeverityLevel } from './Interfaces/Contracts/Generated/SeverityLevel';
export { IConfig } from './Interfaces/IConfig';
export { IConfig, ConfigurationManager } from './Interfaces/IConfig';
export { IChannelControlsAI } from './Interfaces/IChannelControlsAI';

@@ -33,0 +33,0 @@ export { ContextTagKeys } from './Interfaces/Contracts/Generated/ContextTagKeys';

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { IConfiguration } from '@microsoft/applicationinsights-core-js';

@@ -41,2 +42,11 @@ export interface IConfig {

autoExceptionInstrumented?: boolean;
}
}
export class ConfigurationManager {
public static getConfig(config: IConfiguration & IConfig, field: string, identifier?: string): number | string | boolean {
if (!identifier || !config.extensionConfig || !config.extensionConfig[identifier]) {
return config[field];
}
return config.extensionConfig[identifier][field] || config[field];
}
}

@@ -27,3 +27,3 @@ export { Util, CorrelationIdHelper, UrlHelper, DateTimeUtils } from './Util';

export { SeverityLevel } from './Interfaces/Contracts/Generated/SeverityLevel';
export { IConfig } from './Interfaces/IConfig';
export { IConfig, ConfigurationManager } from './Interfaces/IConfig';
export { IChannelControlsAI } from './Interfaces/IChannelControlsAI';

@@ -30,0 +30,0 @@ export { ContextTagKeys } from './Interfaces/Contracts/Generated/ContextTagKeys';

@@ -0,1 +1,2 @@

import { IConfiguration } from '@microsoft/applicationinsights-core-js';
export interface IConfig {

@@ -37,1 +38,4 @@ emitLineDelimitedJson?: boolean;

}
export declare class ConfigurationManager {
static getConfig(config: IConfiguration & IConfig, field: string, identifier?: string): number | string | boolean;
}

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 not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc