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

@microsoft/applicationinsights-channel-js

Package Overview
Dependencies
Maintainers
5
Versions
577
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 2.0.0-rc4 to 2.0.0-rc5

4

browser/applicationinsights-channel-js.min.js
/*!
* Application Insights JavaScript SDK - Channel, 2.0.0-rc4
* Application Insights JavaScript SDK - Channel, 2.0.0-rc5
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var 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 n(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,t,h,a,f=function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(a=h||(h={}))[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden";var g,o,m=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.disableCookies=function(){e._canUseCookies=!1},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),s=/[xy]/g;(o=g||(g={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var u,c,l=1,p=2,d=3,v=4,y=5,_=6,I=7,S=12,b=22,w=24,E=26,N=28,x=40,C=41,A=42,D=43,T=46,R=47,M=48,U=49,L=50,O=52,P=54,k=56,z=57,B=61,F=64,V=66,q=67,G=68,X=69,j=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=j}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&m.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<j&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(H+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];s.priority>j&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),H="Channel has invalid priority",K=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}(),W=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}return i},s.sanitizeKey=function(e,t){var n;return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(n=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(g.WARNING,z,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},s.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(g.WARNING,B,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,V)},s.sanitizeMessage=function(e,t){var n;return t&&t.length>s.MAX_MESSAGE_LENGTH&&(n=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(g.WARNING,k,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},s.sanitizeException=function(e,t){var n;return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(g.WARNING,O,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},s.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(g.WARNING,U,"custom property is not valid",{exception:e},!0)}i=s.sanitizeString(t,i,s.MAX_PROPERTY_LENGTH),n[r=s.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,X).toString():t},s.sanitizeInput=function(e,t,n,r){var i;return t&&(t=s.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(g.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||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}(),Y=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(g.WARNING,l,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(g.WARNING,d,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(g.WARNING,y,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(g.WARNING,p,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(g.WARNING,v,"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(g.WARNING,_,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){m.disableCookies()},s.canUseCookies=function(t){if(void 0===m._canUseCookies){m._canUseCookies=!1;try{m._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(g.WARNING,G,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,i=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),J=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),Z=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=J.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var u=0===s.pathname.length?"/":s.pathname;"/"!==u.charAt(0)&&(u="/"+u),o=s.pathname,a=W.sanitizeString(e,n?n+" "+u:u)}else a=W.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),Q=(function(){function e(){}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||m.isNullOrUndefined(e)||m.isNullOrUndefined(t)||(n=t-e),n}}(),"ProcessLegacy"),$="http.method",ee=function(e){function t(){return e.call(this)||this}return n(t,e),t}(function(){}),te=function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=W.sanitizeString(e,n)||Y.NotSpecified,r.data=t,r.time=Y.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}return n(e,i),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),ne=function(){},re=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return n(e,t),e}(ne),ie=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=W.sanitizeString(e,t)||Y.NotSpecified,i.properties=W.sanitizeProperties(e,n),i.measurements=W.sanitizeMeasurements(e,r),i}return n(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(re),ae=function(){},oe=function(){this.hasFullStack=!0,this.parsedStack=[]},se=function(o){function r(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(a.exceptions=[new ue(e,t)],a.properties=W.sanitizeProperties(e,n),a.measurements=W.sanitizeMeasurements(e,r),i&&(a.severityLevel=i)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel)),a}return n(r,o),r.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ue.CreateFromInterface(t,e)});return new r(t,f({},e,{exceptions:n}))},r.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},r.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},r.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",r.dataType="ExceptionData",r}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return n(e,t),e}(ne)),ue=function(i){function a(e,t){var n=i.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=W.sanitizeString(e,t.name)||Y.NotSpecified,n.message=W.sanitizeMessage(e,t.message)||Y.NotSpecified;var r=t.stack;n.parsedStack=a.parseStack(r),n.stack=W.sanitizeException(e,r),n.hasFullStack=Y.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}return n(a,i),a.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},a.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return ce.CreateFromInterface(e)})||t.parsedStack;return new a(e,f({},t,{parsedStack:n}))},a.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(ce.regex.test(o)){var s=new ce(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var u=0,c=t.length-1,l=0,f=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var d=p-f+1;t.splice(f,d);break}f=u,p=c,u++,c--}}return t},a}(oe),ce=function(a){function o(e,t){var n=a.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=Y.trim(r),n.fileName="",n.line=0;var i=r.match(o.regex);i&&5<=i.length&&(n.method=Y.trim(i[2])||n.method,n.fileName=Y.trim(i[4]),n.line=parseInt(i[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return n(o,a),o.CreateFromInterface=function(e){return new o(e,null)},o.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(ae),le=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return n(e,t),e}(ne);(c=u||(u={}))[c.Measurement=0]="Measurement",c[c.Aggregation=1]="Aggregation";var fe,pe,de=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return n(e,t),e}(function(){this.kind=u.Measurement}),he=function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var u=new de;return u.count=0<r?r:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(i)||null===i?void 0:i,u.name=W.sanitizeString(e,t)||Y.NotSpecified,u.value=n,s.metrics=[u],s.properties=W.sanitizeProperties(e,o),s}return n(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(le),ge=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return n(e,t),e}(re),me=function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=W.sanitizeId(e,o),s.url=W.sanitizeUrl(e,n),s.name=W.sanitizeString(e,t)||Y.NotSpecified,isNaN(r)||(s.duration=Y.msToTimeSpan(r)),s.properties=W.sanitizeProperties(e,i),s.measurements=W.sanitizeMeasurements(e,a),s}return n(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ge),ve=function(d){function e(e,t,n,r,i,a,o,s,u,c,l){void 0===u&&(u="Ajax");var f=d.call(this)||this;f.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},f.id=t,f.duration=Y.msToTimeSpan(i),f.success=a,f.resultCode=o+"",f.type=W.sanitizeString(e,u);var p=Z.ParseDependencyPath(e,n,s,r);return f.data=W.sanitizeUrl(e,r)||p.data,f.target=p.target,f.name=p.name,f.properties=W.sanitizeProperties(e,c),f.measurements=W.sanitizeMeasurements(e,l),f}return n(e,d),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 n(e,t),e}(ne)),ye=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||Y.NotSpecified,i.message=W.sanitizeMessage(e,t),i.properties=W.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}return n(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 n(e,t),e}(ne)),_e=function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=W.sanitizeUrl(e,n),o.name=W.sanitizeString(e,t)||Y.NotSpecified,o.properties=W.sanitizeProperties(e,i),o.measurements=W.sanitizeMeasurements(e,a),o}return n(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return n(e,t),e}(ge)),Ie=function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}return n(e,r),e}(ee);(pe=fe||(fe={}))[pe.Verbose=0]="Verbose",pe[pe.Information=1]="Information",pe[pe.Warning=2]="Warning",pe[pe.Error=3]="Error",pe[pe.Critical=4]="Critical";var Se=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!m.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],m.isNullOrUndefined(i)?r:i},e}(),be=new function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},we=function(){function e(e){this._config=e,this._buffer=[]}return e.prototype.enqueue=function(e){this._buffer.push(e)},e.prototype.count=function(){return this._buffer.length},e.prototype.clear=function(){this._buffer.length=0},e.prototype.getItems=function(){return this._buffer.slice(0)},e.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(e){this.clear()},e.prototype.clearSent=function(e){},e}(),Ee=function(){function i(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(i.BUFFER_KEY),r=this.getBuffer(i.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>i.MAX_BUFFER_SIZE&&(this._buffer.length=i.MAX_BUFFER_SIZE),this.setBuffer(i.SENT_BUFFER_KEY,[]),this.setBuffer(i.BUFFER_KEY,this._buffer)}return i.prototype.enqueue=function(e){this._buffer.length>=i.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(g.WARNING,q,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(i.BUFFER_KEY,this._buffer))},i.prototype.count=function(){return this._buffer.length},i.prototype.clear=function(){this._buffer.length=0,this.setBuffer(i.BUFFER_KEY,[]),this.setBuffer(i.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},i.prototype.getItems=function(){return this._buffer.slice(0)},i.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},i.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(i.BUFFER_KEY,this._buffer);var t=this.getBuffer(i.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>i.MAX_BUFFER_SIZE&&(this._logger.throwInternal(g.CRITICAL,q,"Sent buffer reached its maximum size: "+t.length,!0),t.length=i.MAX_BUFFER_SIZE),this.setBuffer(i.SENT_BUFFER_KEY,t))},i.prototype.clearSent=function(e){var t=this.getBuffer(i.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(i.SENT_BUFFER_KEY,t)},i.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},i.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=Y.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(g.CRITICAL,A," storage key: "+t+", "+Y.getExceptionName(e),{exception:Y.dump(e)})}return[]},i.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);Y.setSessionStorage(this._logger,n,r)}catch(e){Y.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(g.WARNING,C," storage key: "+n+", "+Y.getExceptionName(e)+". Buffer cleared",{exception:Y.dump(e)})}},i.BUFFER_KEY="AI_buffer",i.SENT_BUFFER_KEY="AI_sentBuffer",i.MAX_BUFFER_SIZE=2e3,i}(),Ne=function(){function o(){}return o.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&(t||(t={}),t[n]=r)}return t},o.extractPropsAndMeasurements=function(e,t,n){if(!m.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},o.createEnvelope=function(e,t,n,r){var i=new te(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),o.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},o.extractPartAExtensions=function(e,t){if(t.tags||(t.tags={}),e.ext||(e.ext={}),e.tags||(e.tags=[]),e.ext.user){e.ext.user.authId&&(t.tags[be.userAuthUserId]=e.ext.user.authId);var n=e.ext.user.id||e.ext.user.localId;n&&(t.tags[be.userId]=n)}if(e.ext.app&&e.ext.app.sesId&&(t.tags[be.sessionId]=e.ext.app.sesId),e.ext.device&&((e.ext.device.id||e.ext.device.localId)&&(t.tags[be.deviceId]=e.ext.device.id||e.ext.device.localId),e.ext.device.deviceClass&&(t.tags[be.deviceType]=e.ext.device.deviceClass),e.ext.device.ip&&(t.tags[be.deviceIp]=e.ext.device.ip)),e.ext.web){var r=e.ext.web;r.browserLang&&(t.tags[be.deviceLanguage]=r.browserLang),r.browserVer&&(t.tags[be.deviceBrowserVersion]=r.browserVer),r.browser&&(t.tags[be.deviceBrowser]=r.browser),t.data=t.data||{},t.data.baseData=t.data.baseData||{},t.data.baseData.properties=t.data.baseData.properties||{},r.domain&&(t.data.baseData.properties.domain=r.domain),r.isManual&&(t.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(t.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(t.data.baseData.properties.userConsent=r.userConsent.toString())}e.ext.device&&e.ext.device.model&&(t.tags[be.deviceModel]=e.ext.device.model),e.ext.os&&e.ext.os.name&&(t.tags[be.deviceOS]=e.ext.os.name),e.ext.device&&e.ext.device.deviceType&&(t.tags[be.deviceType]=e.ext.device.deviceType),e.ext.trace&&(e.ext.trace.parentID&&(t.tags[be.operationParentId]=e.ext.trace.parentID),e.ext.trace.name&&(t.tags[be.operationName]=e.ext.trace.name),e.ext.trace.traceID&&(t.tags[be.operationId]=e.ext.trace.traceID));var i={};e.tags.forEach(function(e){i=f({},i,e)}),t.tags=f({},t.tags,i),t.tags[be.internalSdkVersion]||(t.tags[be.internalSdkVersion]="javascript:"+o.Version)},o.Version="2.0.0-rc4",o}(),xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};Ne.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(m.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,u=i.duration,c=i.success,l=i.responseCode,f=i.type,p=i.properties&&i.properties[$]?i.properties[$]:"GET",d=new ve(e,a,o,s,u,c,l,p,f,r,n),h=new Ie(ve.dataType,d);return Ne.createEnvelope(e,ve.envelopeType,t,h)},t.DependencyEnvelopeCreator=new t,t}(Ne),Ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==ie.dataType&&(n.baseTypeSource=t.baseType),t.baseType===ie.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&Ne.extractPropsAndMeasurements(t.baseData,n,r),Ne.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new ie(e,i,n,r),o=new Ie(ie.dataType,a);return Ne.createEnvelope(e,ie.envelopeType,t,o)},t.EventEnvelopeCreator=new t,t}(Ne),Ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=se.CreateFromInterface(e,n),i=new Ie(se.dataType,r);return Ne.createEnvelope(e,se.envelopeType,t,i)},t.ExceptionEnvelopeCreator=new t,t}(Ne),De=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=Ne.extractProperties(t.data);r=f({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,u=t.baseData.max,c=new he(e,i,a,o,s,u,r),l=new Ie(he.dataType,c);return Ne.createEnvelope(e,he.envelopeType,t,l)},t.MetricEnvelopeCreator=new t,t}(Ne),Te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=void 0;m.isNullOrUndefined(t.baseData)||m.isNullOrUndefined(t.baseData.properties)||m.isNullOrUndefined(t.baseData.properties.duration)?m.isNullOrUndefined(t.data)||m.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r=t.baseData,i=r.name,a=r.uri,o=r.id,s=r.properties||{},u=r.measurements||{};if(m.isNullOrUndefined(r.refUri)||(s.refUri=r.refUri),m.isNullOrUndefined(r.pageType)||(s.pageType=r.pageType),m.isNullOrUndefined(r.isLoggedIn)||(s.isLoggedIn=r.isLoggedIn.toString()),!m.isNullOrUndefined(r.properties)){var c=r.properties;for(var l in c)c.hasOwnProperty(l)&&(s[l]=c[l])}var f=new me(e,i,a,n,s,u,o),p=new Ie(me.dataType,f);return Ne.createEnvelope(e,me.envelopeType,t,p)},t.PageViewEnvelopeCreator=new t,t}(Ne),Re=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri,a=n.properties,o=n.measurements,s=new _e(e,r,i,void 0,a,o),u=new Ie(_e.dataType,s);return Ne.createEnvelope(e,_e.envelopeType,t,u)},t.PageViewPerformanceEnvelopeCreator=new t,t}(Ne),Me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=Ne.extractProperties(t.data),a=f({},i,t.baseData.properties),o=new ye(e,n,r,a),s=new Ie(ye.dataType,o);return Ne.createEnvelope(e,ye.envelopeType,t,s)},t.TraceEnvelopeCreator=new t,t}(Ne),Ue=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.EventValidator=new e,e}(),Le=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.TraceValidator=new e,e}(),Oe=function(){function e(){}return e.prototype.Validate=function(e){return!0},e._validateExceptions=function(e){return!0},e.ExceptionValidator=new e,e}(),Pe=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.MetricValidator=new e,e}(),ke=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewPerformanceValidator=new e,e}(),ze=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewValidator=new e,e}(),Be=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.RemoteDepdencyValidator=new e,e}(),Fe=function(){function e(e){this._logger=e}return e.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},e.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(g.CRITICAL,M,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(g.WARNING,L,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(Y.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(g.WARNING,U,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(g.CRITICAL,M,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&h.Required:o&h.Required,u="function"==typeof o?o()&h.Hidden:o&h.Hidden,c=o&h.Array,l=void 0!==e[i],f="object"==typeof e[i]&&null!==e[i];if(!s||l||c){if(!u)void 0!==(a=f?c?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a)}else this._logger.throwInternal(g.CRITICAL,w,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},e.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(Y.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(g.CRITICAL,P,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},e.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(g.CRITICAL,r[i],null,!0)}return r},e}(),Ve=function(){function e(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}return e.prototype._setOnline=function(){this._onlineStatus=!0},e.prototype._setOffline=function(){this._onlineStatus=!1},e.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!m.isNullOrUndefined(navigator.onLine))||navigator.onLine},e.prototype.isOffline=function(){return!this.isOnline()},e.Offline=new e,e}().Offline,qe=function(){function u(){this.priority=1001,this._XMLHttpRequestSupported=!1,this.identifier="AppInsightsChannelPlugin"}return u.prototype.pause=function(){throw new Error("Method not implemented.")},u.prototype.resume=function(){throw new Error("Method not implemented.")},u.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(g.CRITICAL,b,"flush failed, telemetry will not be collected: "+Y.getExceptionName(e),{exception:Y.dump(e)})}},u.prototype.teardown=function(){throw new Error("Method not implemented.")},u.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new Fe(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=u._getDefaultAppInsightsChannelConfig();this._config=u._getEmptyAppInsightsChannelConfig();var a=function(e){o._config[e]=function(){return Se.getConfig(t,e,r.identifier,i[e]())}},o=this;for(var s in i)a(s);(this._buffer=this._config.enableSessionStorageBuffer&&Y.canUseSessionStorage()?new Ee(this._logger,this._config):new we(this._config),!this._config.isBeaconApiDisabled()&&Y.IsBeaconApiSupported())?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},u.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(g.CRITICAL,I,"Cannot send empty telemetry");if(!this._sender)return void this._logger.throwInternal(g.CRITICAL,N,"Sender was not initialized");if(!u._validate(e))return void this._logger.throwInternal(g.CRITICAL,T,"Invalid telemetry envelope");var n=u.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(g.CRITICAL,R,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[Q]&&(e.tags[Q].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(g.CRITICAL,F,"One of telemetry initializers failed, telemetry item will not be sent: "+Y.getExceptionName(e),{exception:Y.dump(e)},!0)}}),delete e.tags[Q]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(g.WARNING,S,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Y.getExceptionName(e),{exception:Y.dump(e)})}m.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;if(this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status)!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(g.WARNING,x,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e));else if(Ve.isOffline()){if(!this._config.isRetryDisabled()){this._resendPayload(t,10),this._logger.throwInternal(g.WARNING,x,". Offline - Response Code: "+e.status+". Offline status: "+Ve.isOffline()+". Will retry to send "+t.length+" items.")}}else 206===e.status?(r||(r=this._parseResponse(e.responseText||e.response)),r&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e))):(this._consecutiveErrors=0,this._onSuccess(t,n))}},u.prototype.triggerSend=function(e){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var t=this._buffer.getItems();this._sender(t,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!Y.getIEVersion()||9<Y.getIEVersion())&&this._logger.throwInternal(g.CRITICAL,x,"Telemetry transmission failed, some telemetry will be lost: "+Y.getExceptionName(e),{exception:Y.dump(e)})}},u.prototype._onError=function(e,t,n){this._logger.throwInternal(g.WARNING,E,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},u.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(g.WARNING,x,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},u.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},u.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},u.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||m.isNullOrUndefined(t)?e:f({},e,{iKey:t})).baseType){case ie.dataType:return Ce.EventEnvelopeCreator.Create(n,r);case ye.dataType:return Me.TraceEnvelopeCreator.Create(n,r);case me.dataType:return Te.PageViewEnvelopeCreator.Create(n,r);case _e.dataType:return Re.PageViewPerformanceEnvelopeCreator.Create(n,r);case se.dataType:return Ae.ExceptionEnvelopeCreator.Create(n,r);case he.dataType:return De.MetricEnvelopeCreator.Create(n,r);case ve.dataType:return xe.DependencyEnvelopeCreator.Create(n,r);default:return Ce.EventEnvelopeCreator.Create(n,r)}},u._getDefaultAppInsightsChannelConfig=function(){var e={endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},instrumentationKey:function(){}};return e},u._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,instrumentationKey:void 0,namePrefix:void 0}},u._validate=function(e){switch(e.baseType){case ie.dataType:return Ue.EventValidator.Validate(e);case ye.dataType:return Le.TraceValidator.Validate(e);case se.dataType:return Oe.ExceptionValidator.Validate(e);case he.dataType:return Pe.MetricValidator.Validate(e);case me.dataType:return ze.PageViewValidator.Validate(e);case _e.dataType:return ke.PageViewPerformanceValidator.Validate(e);case ve.dataType:return Be.RemoteDepdencyValidator.Validate(e);default:return Ue.EventValidator.Validate(e)}},u.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?this._buffer.markAsSent(e):this._logger.throwInternal(g.CRITICAL,x,". Failed to send telemetry with Beacon API.")},u.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),Y.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(K.sdkContextHeader,K.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},u.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(g.CRITICAL,D,"Cannot parse the response. "+Y.getExceptionName(e),{response:t})}return null},u.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},u.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},u.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},u.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},u.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},u.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(g.WARNING,x,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},u.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},u}();e.Sender=qe,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=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 t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,f,a,p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i||(i={}))[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=f||(f={}))[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden";var g=(o.isNullOrUndefined=function(e){return null==e},o.disableCookies=function(){o._canUseCookies=!1},o.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},o);function o(){}var v,s,l=/[xy]/g;(s=v||(v={}))[s.CRITICAL=1]="CRITICAL",s[s.WARNING=2]="WARNING";var u=1,c=2,d=3,h=4,m=5,y=6,_=7,I=12,S=22,b=24,w=26,E=28,N=40,x=41,C=42,A=43,D=46,T=47,R=48,M=49,U=50,L=52,O=54,P=56,k=57,z=61,B=64,F=66,V=67,q=68,G=69;H.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(H.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),H.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&g.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<X&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(j+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];s.priority>X&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function H(){this.identifier="ChannelControllerPlugin",this.priority=X}var X=500,j="Channel has invalid priority",K=(W.requestContextHeader="Request-Context",W.requestContextTargetKey="appId",W.requestContextAppIdFormat="appId=cid-v1:",W.requestIdHeader="Request-Id",W.sdkContextHeader="Sdk-Context",W.sdkContextHeaderAppIdRequest="appId",W.requestContextHeaderLowerCase="request-context",W);function W(){}var Y=(J.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=J.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,J.MAX_NAME_LENGTH-3)+J.padNumber(a);i=o}return i},J.sanitizeKey=function(e,t){var n;return t&&(t=J.trim(t.toString())).length>J.MAX_NAME_LENGTH&&(n=t.substring(0,J.MAX_NAME_LENGTH),e.throwInternal(v.WARNING,k,"name is too long. It has been truncated to "+J.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},J.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=J.MAX_STRING_LENGTH),t&&(n=n||J.MAX_STRING_LENGTH,(t=J.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(v.WARNING,z,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},J.sanitizeUrl=function(e,t){return J.sanitizeInput(e,t,J.MAX_URL_LENGTH,F)},J.sanitizeMessage=function(e,t){var n;return t&&t.length>J.MAX_MESSAGE_LENGTH&&(n=t.substring(0,J.MAX_MESSAGE_LENGTH),e.throwInternal(v.WARNING,P,"message is too long, it has been truncated to "+J.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},J.sanitizeException=function(e,t){var n;return t&&t.length>J.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,J.MAX_EXCEPTION_LENGTH),e.throwInternal(v.WARNING,L,"exception is too long, it has been truncated to "+J.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},J.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(v.WARNING,M,"custom property is not valid",{exception:e},!0)}i=J.sanitizeString(t,i,J.MAX_PROPERTY_LENGTH),n[r=J.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},J.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=J.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},J.sanitizeId=function(e,t){return t?J.sanitizeInput(e,t,J.MAX_ID_LENGTH,G).toString():t},J.sanitizeInput=function(e,t,n,r){var i;return t&&(t=J.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(v.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},J.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},J.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},J.MAX_NAME_LENGTH=150,J.MAX_ID_LENGTH=128,J.MAX_PROPERTY_LENGTH=8192,J.MAX_STRING_LENGTH=1024,J.MAX_URL_LENGTH=2048,J.MAX_MESSAGE_LENGTH=32768,J.MAX_EXCEPTION_LENGTH=32768,J);function J(){}var Z=(Q.disableStorage=function(){Q._canUseLocalStorage=!1,Q._canUseSessionStorage=!1},Q._getLocalStorageObject=function(){return Q.canUseLocalStorage()?Q._getVerifiedStorageObject(i.LocalStorage):null},Q._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},Q.isInternalApplicationInsightsEndpoint=function(e){return-1!==Q._internalEndpoints.indexOf(e.toLowerCase())},Q.canUseLocalStorage=function(){return void 0===Q._canUseLocalStorage&&(Q._canUseLocalStorage=!!Q._getVerifiedStorageObject(i.LocalStorage)),Q._canUseLocalStorage},Q.getStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(v.WARNING,u,"Browser failed read of local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setStorage=function(t,e,n){var r=Q._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(v.WARNING,d,"Browser failed write to local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(v.WARNING,m,"Browser failed removal of local storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q._getSessionStorageObject=function(){return Q.canUseSessionStorage()?Q._getVerifiedStorageObject(i.SessionStorage):null},Q.canUseSessionStorage=function(){return void 0===Q._canUseSessionStorage&&(Q._canUseSessionStorage=!!Q._getVerifiedStorageObject(i.SessionStorage)),Q._canUseSessionStorage},Q.getSessionStorageKeys=function(){var e=[];if(Q.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},Q.getSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(v.WARNING,c,"Browser failed read of session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setSessionStorage=function(t,e,n){var r=Q._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(v.WARNING,h,"Browser failed write to session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(v.WARNING,y,"Browser failed removal of session storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.disableCookies=function(){g.disableCookies()},Q.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==Q.document.cookie}catch(e){t.throwInternal(v.WARNING,q,"Cannot access document.cookie - "+Q.getExceptionName(e),{exception:Q.dump(e)})}}return g._canUseCookies},Q.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),Q.document.location&&"https:"===Q.document.location.protocol&&(a=";secure"),Q.canUseCookies(e)&&(Q.document.cookie=t+"="+n+i+";path=/"+a)},Q.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},Q.getCookie=function(e,t){if(Q.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=Q.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=Q.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},Q.deleteCookie=function(e,t){Q.canUseCookies(e)&&(Q.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},Q.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},Q.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},Q.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Q.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},Q.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},Q.toISOStringForIE8=function(e){if(Q.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"}},Q.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},Q.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,i=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},Q.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},Q.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},Q.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},Q.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},Q.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},Q.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},Q.document="undefined"!=typeof document?document:{},Q._canUseLocalStorage=void 0,Q._canUseSessionStorage=void 0,Q._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],Q.NotSpecified="not_specified",Q);function Q(){}var $=(ee.parseUrl=function(e){return ee.htmlAnchorElement||(ee.htmlAnchorElement=ee.document.createElement?ee.document.createElement("a"):{host:ee.parseHost(e)}),ee.htmlAnchorElement.href=e,ee.htmlAnchorElement},ee.getAbsoluteUrl=function(e){var t,n=ee.parseUrl(e);return n&&(t=n.href),t},ee.getPathName=function(e){var t,n=ee.parseUrl(e);return n&&(t=n.pathname),t},ee.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ee.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},ee.document="undefined"!=typeof document?document:{},ee);function ee(){}var te=(ne.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=$.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var l=0===s.pathname.length?"/":s.pathname;"/"!==l.charAt(0)&&(l="/"+l),o=s.pathname,a=Y.sanitizeString(e,n?n+" "+l:l)}else a=Y.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},ne);function ne(){}re.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()},re.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n};function re(){}var ie,ae="ProcessLegacy",oe="http.method",se=(t(le,ie=function(){}),le);function le(){return ie.call(this)||this}var ue,ce=(t(pe,ue=function(){this.ver=1,this.sampleRate=100,this.tags={}}),pe);function pe(e,t,n){var r=ue.call(this)||this;return r.name=Y.sanitizeString(e,n)||Z.NotSpecified,r.data=t,r.time=Z.toISOStringForIE8(new Date),r.aiDataContract={time:f.Required,iKey:f.Required,name:f.Required,sampleRate:function(){return 100==r.sampleRate?f.Hidden:f.Required},tags:f.Required,data:f.Required},r}function de(){}var fe,he=(t(ge,fe=de),ge);function ge(){var e=fe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ve,me=(t(ye,ve=he),ye.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ye.dataType="EventData",ye);function ye(e,t,n,r){var i=ve.call(this)||this;return i.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},i.name=Y.sanitizeString(e,t)||Z.NotSpecified,i.properties=Y.sanitizeProperties(e,n),i.measurements=Y.sanitizeMeasurements(e,r),i}function _e(){}var Ie,Se=(t(be,Ie=de),be);function be(){var e=Ie.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function we(){this.hasFullStack=!0,this.parsedStack=[]}var Ee,Ne=(t(xe,Ee=Se),xe.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return Ae.CreateFromInterface(t,e)});return new xe(t,p({},e,{exceptions:n}))},xe.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},xe.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},xe.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",xe.dataType="ExceptionData",xe);function xe(e,t,n,r,i){var a=Ee.call(this)||this;return a.aiDataContract={ver:f.Required,exceptions:f.Required,severityLevel:f.Default,properties:f.Default,measurements:f.Default},t instanceof Error?(a.exceptions=[new Ae(e,t)],a.properties=Y.sanitizeProperties(e,n),a.measurements=Y.sanitizeMeasurements(e,r),i&&(a.severityLevel=i)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel)),a}var Ce,Ae=(t(De,Ce=we),De.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},De.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Re.CreateFromInterface(e)})||t.parsedStack;return new De(e,p({},t,{parsedStack:n}))},De.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(Re.regex.test(o)){var s=new Re(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var l=0,u=t.length-1,c=0,p=l,d=u;l<u;){if(32768<(c+=t[l].sizeInBytes+t[u].sizeInBytes)){var f=d-p+1;t.splice(p,f);break}p=l,d=u,l++,u--}}return t},De);function De(e,t){var n=Ce.call(this)||this;if(n.aiDataContract={id:f.Default,outerId:f.Default,typeName:f.Required,message:f.Required,hasFullStack:f.Default,stack:f.Default,parsedStack:f.Array},t instanceof Error){n.typeName=Y.sanitizeString(e,t.name)||Z.NotSpecified,n.message=Y.sanitizeMessage(e,t.message)||Z.NotSpecified;var r=t.stack;n.parsedStack=De.parseStack(r),n.stack=Y.sanitizeException(e,r),n.hasFullStack=Z.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var Te,Re=(t(Me,Te=_e),Me.CreateFromInterface=function(e){return new Me(e,null)},Me.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Me.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Me.baseSize=58,Me);function Me(e,t){var n=Te.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:f.Required,method:f.Required,assembly:f.Default,fileName:f.Default,line:f.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=Z.trim(r),n.fileName="",n.line=0;var i=r.match(Me.regex);i&&5<=i.length&&(n.method=Z.trim(i[2])||n.method,n.fileName=Z.trim(i[4]),n.line=parseInt(i[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Me.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ue,Le,Oe,Pe=(t(ke,Ue=de),ke);function ke(){var e=Ue.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Oe=Le||(Le={}))[Oe.Measurement=0]="Measurement",Oe[Oe.Aggregation=1]="Aggregation";var ze,Be=(t(Fe,ze=function(){this.kind=Le.Measurement}),Fe);function Fe(){var e=null!==ze&&ze.apply(this,arguments)||this;return e.aiDataContract={name:f.Required,kind:f.Default,value:f.Required,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default},e}var Ve,qe=(t(Ge,Ve=Pe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Ge.dataType="MetricData",Ge);function Ge(e,t,n,r,i,a,o){var s=Ve.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var l=new Be;return l.count=0<r?r:void 0,l.max=isNaN(a)||null===a?void 0:a,l.min=isNaN(i)||null===i?void 0:i,l.name=Y.sanitizeString(e,t)||Z.NotSpecified,l.value=n,s.metrics=[l],s.properties=Y.sanitizeProperties(e,o),s}var He,Xe=(t(je,He=he),je);function je(){var e=He.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ke,We=(t(Ye,Ke=Xe),Ye.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Ye.dataType="PageviewData",Ye);function Ye(e,t,n,r,i,a,o){var s=Ke.call(this)||this;return s.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,properties:f.Default,measurements:f.Default,id:f.Default},s.id=Y.sanitizeId(e,o),s.url=Y.sanitizeUrl(e,n),s.name=Y.sanitizeString(e,t)||Z.NotSpecified,isNaN(r)||(s.duration=Z.msToTimeSpan(r)),s.properties=Y.sanitizeProperties(e,i),s.measurements=Y.sanitizeMeasurements(e,a),s}var Je,Ze=(t(Qe,Je=de),Qe);function Qe(){var e=Je.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var $e,et=(t(tt,$e=Ze),tt.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",tt.dataType="RemoteDependencyData",tt);function tt(e,t,n,r,i,a,o,s,l,u,c){void 0===l&&(l="Ajax");var p=$e.call(this)||this;p.aiDataContract={id:f.Required,ver:f.Required,name:f.Default,resultCode:f.Default,duration:f.Default,success:f.Default,data:f.Default,target:f.Default,type:f.Default,properties:f.Default,measurements:f.Default,kind:f.Default,value:f.Default,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default,dependencyKind:f.Default,dependencySource:f.Default,commandName:f.Default,dependencyTypeName:f.Default},p.id=t,p.duration=Z.msToTimeSpan(i),p.success=a,p.resultCode=o+"",p.type=Y.sanitizeString(e,l);var d=te.ParseDependencyPath(e,n,s,r);return p.data=Y.sanitizeUrl(e,r)||d.data,p.target=d.target,p.name=d.name,p.properties=Y.sanitizeProperties(e,u),p.measurements=Y.sanitizeMeasurements(e,c),p}var nt,rt=(t(it,nt=de),it);function it(){var e=nt.call(this)||this;return e.ver=2,e.properties={},e}var at,ot=(t(st,at=rt),st.envelopeType="Microsoft.ApplicationInsights.{0}.Message",st.dataType="MessageData",st);function st(e,t,n,r){var i=at.call(this)||this;return i.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||Z.NotSpecified,i.message=Y.sanitizeMessage(e,t),i.properties=Y.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var lt,ut=(t(ct,lt=Xe),ct);function ct(){var e=lt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var pt,dt=(t(ft,pt=ut),ft.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",ft.dataType="PageviewPerformanceData",ft);function ft(e,t,n,r,i,a){var o=pt.call(this)||this;return o.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,perfTotal:f.Default,networkConnect:f.Default,sentRequest:f.Default,receivedResponse:f.Default,domProcessing:f.Default,properties:f.Default,measurements:f.Default},o.url=Y.sanitizeUrl(e,n),o.name=Y.sanitizeString(e,t)||Z.NotSpecified,o.properties=Y.sanitizeProperties(e,i),o.measurements=Y.sanitizeMeasurements(e,a),o}var ht,gt,vt,mt=(t(yt,ht=se),yt);function yt(e,t){var n=ht.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(vt=gt||(gt={}))[vt.Verbose=0]="Verbose",vt[vt.Information=1]="Information",vt[vt.Warning=2]="Warning",vt[vt.Error=3]="Error",vt[vt.Critical=4]="Critical";var _t=(It.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!g.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],g.isNullOrUndefined(i)?r:i},It);function It(){}var St=new function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},bt=(wt.prototype.enqueue=function(e){this._buffer.push(e)},wt.prototype.count=function(){return this._buffer.length},wt.prototype.clear=function(){this._buffer.length=0},wt.prototype.getItems=function(){return this._buffer.slice(0)},wt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},wt.prototype.markAsSent=function(e){this.clear()},wt.prototype.clearSent=function(e){},wt);function wt(e){this._config=e,this._buffer=[]}var Et=(Nt.prototype.enqueue=function(e){this._buffer.length>=Nt.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(v.WARNING,V,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(Nt.BUFFER_KEY,this._buffer))},Nt.prototype.count=function(){return this._buffer.length},Nt.prototype.clear=function(){this._buffer.length=0,this.setBuffer(Nt.BUFFER_KEY,[]),this.setBuffer(Nt.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},Nt.prototype.getItems=function(){return this._buffer.slice(0)},Nt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Nt.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(Nt.BUFFER_KEY,this._buffer);var t=this.getBuffer(Nt.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>Nt.MAX_BUFFER_SIZE&&(this._logger.throwInternal(v.CRITICAL,V,"Sent buffer reached its maximum size: "+t.length,!0),t.length=Nt.MAX_BUFFER_SIZE),this.setBuffer(Nt.SENT_BUFFER_KEY,t))},Nt.prototype.clearSent=function(e){var t=this.getBuffer(Nt.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(Nt.SENT_BUFFER_KEY,t)},Nt.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},Nt.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=Z.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(v.CRITICAL,C," storage key: "+t+", "+Z.getExceptionName(e),{exception:Z.dump(e)})}return[]},Nt.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);Z.setSessionStorage(this._logger,n,r)}catch(e){Z.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(v.WARNING,x," storage key: "+n+", "+Z.getExceptionName(e)+". Buffer cleared",{exception:Z.dump(e)})}},Nt.BUFFER_KEY="AI_buffer",Nt.SENT_BUFFER_KEY="AI_sentBuffer",Nt.MAX_BUFFER_SIZE=2e3,Nt);function Nt(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(Nt.BUFFER_KEY),r=this.getBuffer(Nt.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>Nt.MAX_BUFFER_SIZE&&(this._buffer.length=Nt.MAX_BUFFER_SIZE),this.setBuffer(Nt.SENT_BUFFER_KEY,[]),this.setBuffer(Nt.BUFFER_KEY,this._buffer)}var xt=(Ct.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&(t||(t={}),t[n]=r)}return t},Ct.extractPropsAndMeasurements=function(e,t,n){if(!g.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},Ct.createEnvelope=function(e,t,n,r){var i=new ce(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),Ct.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},Ct.extractPartAExtensions=function(e,t){if(t.tags||(t.tags={}),e.ext||(e.ext={}),e.tags||(e.tags=[]),e.ext.user){e.ext.user.authId&&(t.tags[St.userAuthUserId]=e.ext.user.authId);var n=e.ext.user.id||e.ext.user.localId;n&&(t.tags[St.userId]=n)}if(e.ext.app&&e.ext.app.sesId&&(t.tags[St.sessionId]=e.ext.app.sesId),e.ext.device&&((e.ext.device.id||e.ext.device.localId)&&(t.tags[St.deviceId]=e.ext.device.id||e.ext.device.localId),e.ext.device.deviceClass&&(t.tags[St.deviceType]=e.ext.device.deviceClass),e.ext.device.ip&&(t.tags[St.deviceIp]=e.ext.device.ip)),e.ext.web){var r=e.ext.web;r.browserLang&&(t.tags[St.deviceLanguage]=r.browserLang),r.browserVer&&(t.tags[St.deviceBrowserVersion]=r.browserVer),r.browser&&(t.tags[St.deviceBrowser]=r.browser),t.data=t.data||{},t.data.baseData=t.data.baseData||{},t.data.baseData.properties=t.data.baseData.properties||{},r.domain&&(t.data.baseData.properties.domain=r.domain),r.isManual&&(t.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(t.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(t.data.baseData.properties.userConsent=r.userConsent.toString())}e.ext.device&&e.ext.device.model&&(t.tags[St.deviceModel]=e.ext.device.model),e.ext.os&&e.ext.os.name&&(t.tags[St.deviceOS]=e.ext.os.name),e.ext.device&&e.ext.device.deviceType&&(t.tags[St.deviceType]=e.ext.device.deviceType),e.ext.trace&&(e.ext.trace.parentID&&(t.tags[St.operationParentId]=e.ext.trace.parentID),e.ext.trace.name&&(t.tags[St.operationName]=e.ext.trace.name),e.ext.trace.traceID&&(t.tags[St.operationId]=e.ext.trace.traceID));var i={};e.tags.forEach(function(e){i=p({},i,e)}),t.tags=p({},t.tags,i),t.tags[St.internalSdkVersion]||(t.tags[St.internalSdkVersion]="javascript:"+Ct.Version)},Ct.Version="2.0.0-rc5",Ct);function Ct(){}var At,Dt=(t(Tt,At=xt),Tt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};xt.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(g.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,l=i.duration,u=i.success,c=i.responseCode,p=i.type,d=i.properties&&i.properties[oe]?i.properties[oe]:"GET",f=new et(e,a,o,s,l,u,c,d,p,r,n),h=new mt(et.dataType,f);return xt.createEnvelope(e,et.envelopeType,t,h)},Tt.DependencyEnvelopeCreator=new Tt,Tt);function Tt(){return null!==At&&At.apply(this,arguments)||this}var Rt,Mt=(t(Ut,Rt=xt),Ut.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==me.dataType&&(n.baseTypeSource=t.baseType),t.baseType===me.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&xt.extractPropsAndMeasurements(t.baseData,n,r),xt.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new me(e,i,n,r),o=new mt(me.dataType,a);return xt.createEnvelope(e,me.envelopeType,t,o)},Ut.EventEnvelopeCreator=new Ut,Ut);function Ut(){return null!==Rt&&Rt.apply(this,arguments)||this}var Lt,Ot=(t(Pt,Lt=xt),Pt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=Ne.CreateFromInterface(e,n),i=new mt(Ne.dataType,r);return xt.createEnvelope(e,Ne.envelopeType,t,i)},Pt.ExceptionEnvelopeCreator=new Pt,Pt);function Pt(){return null!==Lt&&Lt.apply(this,arguments)||this}var kt,zt=(t(Bt,kt=xt),Bt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=xt.extractProperties(t.data);r=p({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,l=t.baseData.max,u=new qe(e,i,a,o,s,l,r),c=new mt(qe.dataType,u);return xt.createEnvelope(e,qe.envelopeType,t,c)},Bt.MetricEnvelopeCreator=new Bt,Bt);function Bt(){return null!==kt&&kt.apply(this,arguments)||this}var Ft,Vt=(t(qt,Ft=xt),qt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=void 0;g.isNullOrUndefined(t.baseData)||g.isNullOrUndefined(t.baseData.properties)||g.isNullOrUndefined(t.baseData.properties.duration)?g.isNullOrUndefined(t.data)||g.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r=t.baseData,i=r.name,a=r.uri,o=r.id,s=r.properties||{},l=r.measurements||{};if(g.isNullOrUndefined(r.refUri)||(s.refUri=r.refUri),g.isNullOrUndefined(r.pageType)||(s.pageType=r.pageType),g.isNullOrUndefined(r.isLoggedIn)||(s.isLoggedIn=r.isLoggedIn.toString()),!g.isNullOrUndefined(r.properties)){var u=r.properties;for(var c in u)u.hasOwnProperty(c)&&(s[c]=u[c])}var p=new We(e,i,a,n,s,l,o),d=new mt(We.dataType,p);return xt.createEnvelope(e,We.envelopeType,t,d)},qt.PageViewEnvelopeCreator=new qt,qt);function qt(){return null!==Ft&&Ft.apply(this,arguments)||this}var Gt,Ht=(t(Xt,Gt=xt),Xt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri,a=n.properties,o=n.measurements,s=new dt(e,r,i,void 0,a,o),l=new mt(dt.dataType,s);return xt.createEnvelope(e,dt.envelopeType,t,l)},Xt.PageViewPerformanceEnvelopeCreator=new Xt,Xt);function Xt(){return null!==Gt&&Gt.apply(this,arguments)||this}var jt,Kt=(t(Wt,jt=xt),Wt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=xt.extractProperties(t.data),a=p({},i,t.baseData.properties),o=new ot(e,n,r,a),s=new mt(ot.dataType,o);return xt.createEnvelope(e,ot.envelopeType,t,s)},Wt.TraceEnvelopeCreator=new Wt,Wt);function Wt(){return null!==jt&&jt.apply(this,arguments)||this}var Yt=(Jt.prototype.Validate=function(e){return!0},Jt.EventValidator=new Jt,Jt);function Jt(){}var Zt=(Qt.prototype.Validate=function(e){return!0},Qt.TraceValidator=new Qt,Qt);function Qt(){}var $t=(en.prototype.Validate=function(e){return!0},en._validateExceptions=function(e){return!0},en.ExceptionValidator=new en,en);function en(){}var tn=(nn.prototype.Validate=function(e){return!0},nn.MetricValidator=new nn,nn);function nn(){}var rn=(an.prototype.Validate=function(e){return!0},an.PageViewPerformanceValidator=new an,an);function an(){}var on=(sn.prototype.Validate=function(e){return!0},sn.PageViewValidator=new sn,sn);function sn(){}var ln=(un.prototype.Validate=function(e){return!0},un.RemoteDepdencyValidator=new un,un);function un(){}var cn=(pn.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},pn.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(v.CRITICAL,R,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(v.WARNING,U,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(Z.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(v.WARNING,M,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(v.CRITICAL,R,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&f.Required:o&f.Required,l="function"==typeof o?o()&f.Hidden:o&f.Hidden,u=o&f.Array,c=void 0!==e[i],p="object"==typeof e[i]&&null!==e[i];!s||c||u?l||void 0!==(a=p?u?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a):this._logger.throwInternal(v.CRITICAL,b,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},pn.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(Z.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(v.CRITICAL,O,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},pn.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(v.CRITICAL,r[i],null,!0)}return r},pn);function pn(e){this._logger=e}function dn(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}var fn=(dn.prototype._setOnline=function(){this._onlineStatus=!0},dn.prototype._setOffline=function(){this._onlineStatus=!1},dn.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!g.isNullOrUndefined(navigator.onLine))||navigator.onLine},dn.prototype.isOffline=function(){return!this.isOnline()},dn.Offline=new dn,dn).Offline,hn=(gn.prototype.pause=function(){throw new Error("Method not implemented.")},gn.prototype.resume=function(){throw new Error("Method not implemented.")},gn.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(v.CRITICAL,S,"flush failed, telemetry will not be collected: "+Z.getExceptionName(e),{exception:Z.dump(e)})}},gn.prototype.teardown=function(){throw new Error("Method not implemented.")},gn.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new cn(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=gn._getDefaultAppInsightsChannelConfig();function a(e){o._config[e]=function(){return _t.getConfig(t,e,r.identifier,i[e]())}}this._config=gn._getEmptyAppInsightsChannelConfig();var o=this;for(var s in i)a(s);this._buffer=this._config.enableSessionStorageBuffer&&Z.canUseSessionStorage()?new Et(this._logger,this._config):new bt(this._config),!this._config.isBeaconApiDisabled()&&Z.IsBeaconApiSupported()?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},gn.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(v.CRITICAL,_,"Cannot send empty telemetry");if(!this._sender)return void this._logger.throwInternal(v.CRITICAL,E,"Sender was not initialized");if(!gn._validate(e))return void this._logger.throwInternal(v.CRITICAL,D,"Invalid telemetry envelope");var n=gn.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(v.CRITICAL,T,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[ae]&&(e.tags[ae].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(v.CRITICAL,B,"One of telemetry initializers failed, telemetry item will not be sent: "+Z.getExceptionName(e),{exception:Z.dump(e)},!0)}}),delete e.tags[ae]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(v.WARNING,I,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Z.getExceptionName(e),{exception:Z.dump(e)})}g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},gn.prototype.setNextPlugin=function(e){this._nextPlugin=e},gn.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(v.WARNING,N,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):fn.isOffline()?this._config.isRetryDisabled()||(this._resendPayload(t,10),this._logger.throwInternal(v.WARNING,N,". Offline - Response Code: "+e.status+". Offline status: "+fn.isOffline()+". Will retry to send "+t.length+" items.")):206===e.status?(r||(r=this._parseResponse(e.responseText||e.response)),r&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e))):(this._consecutiveErrors=0,this._onSuccess(t,n))}},gn.prototype.triggerSend=function(e){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var t=this._buffer.getItems();this._sender(t,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!Z.getIEVersion()||9<Z.getIEVersion())&&this._logger.throwInternal(v.CRITICAL,N,"Telemetry transmission failed, some telemetry will be lost: "+Z.getExceptionName(e),{exception:Z.dump(e)})}},gn.prototype._onError=function(e,t,n){this._logger.throwInternal(v.WARNING,w,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},gn.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(v.WARNING,N,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},gn.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},gn.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},gn.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||g.isNullOrUndefined(t)?e:p({},e,{iKey:t})).baseType){case me.dataType:return Mt.EventEnvelopeCreator.Create(n,r);case ot.dataType:return Kt.TraceEnvelopeCreator.Create(n,r);case We.dataType:return Vt.PageViewEnvelopeCreator.Create(n,r);case dt.dataType:return Ht.PageViewPerformanceEnvelopeCreator.Create(n,r);case Ne.dataType:return Ot.ExceptionEnvelopeCreator.Create(n,r);case qe.dataType:return zt.MetricEnvelopeCreator.Create(n,r);case et.dataType:return Dt.DependencyEnvelopeCreator.Create(n,r);default:return Mt.EventEnvelopeCreator.Create(n,r)}},gn._getDefaultAppInsightsChannelConfig=function(){var e={endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},instrumentationKey:function(){}};return e},gn._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,instrumentationKey:void 0,namePrefix:void 0}},gn._validate=function(e){switch(e.baseType){case me.dataType:return Yt.EventValidator.Validate(e);case ot.dataType:return Zt.TraceValidator.Validate(e);case Ne.dataType:return $t.ExceptionValidator.Validate(e);case qe.dataType:return tn.MetricValidator.Validate(e);case We.dataType:return on.PageViewValidator.Validate(e);case dt.dataType:return rn.PageViewPerformanceValidator.Validate(e);case et.dataType:return ln.RemoteDepdencyValidator.Validate(e);default:return Yt.EventValidator.Validate(e)}},gn.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?this._buffer.markAsSent(e):this._logger.throwInternal(v.CRITICAL,N,". Failed to send telemetry with Beacon API.")},gn.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),Z.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(K.sdkContextHeader,K.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},gn.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(v.CRITICAL,A,"Cannot parse the response. "+Z.getExceptionName(e),{response:t})}return null},gn.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},gn.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},gn.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},gn.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},gn.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},gn.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(v.WARNING,N,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},gn.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},gn);function gn(){this.priority=1001,this.identifier="AppInsightsChannelPlugin",this._XMLHttpRequestSupported=!1}e.Sender=hn,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-channel-js.min.js.map

@@ -173,3 +173,3 @@ import * as tslib_1 from "tslib";

};
EnvelopeCreator.Version = "2.0.0-rc4";
EnvelopeCreator.Version = "2.0.0-rc5";
return EnvelopeCreator;

@@ -176,0 +176,0 @@ }());

@@ -12,3 +12,3 @@ import * as tslib_1 from "tslib";

import { Serializer } from './Serializer'; // todo move to channel
import { DisabledPropertyName, RequestHeaders, Util, PageView, Event, Trace, Exception, Metric, PageViewPerformance, RemoteDependencyData, ConfigurationManager, ProcessLegacy } from '@microsoft/applicationinsights-common';
import { DisabledPropertyName, RequestHeaders, Util, PageView, Event, Trace, Exception, Metric, PageViewPerformance, RemoteDependencyData, ConfigurationManager, ProcessLegacy, BreezeChannelIdentifier } from '@microsoft/applicationinsights-common';
import { _InternalMessageId, LoggingSeverity, } from '@microsoft/applicationinsights-core-js';

@@ -20,2 +20,3 @@ import { CoreUtils } from '@microsoft/applicationinsights-core-js';

this.priority = 1001;
this.identifier = BreezeChannelIdentifier;
/**

@@ -25,3 +26,2 @@ * Whether XMLHttpRequest object is supported. Older version of IE (8,9) do not support it.

this._XMLHttpRequestSupported = false;
this.identifier = "AppInsightsChannelPlugin";
}

@@ -28,0 +28,0 @@ Sender.prototype.pause = function () {

/*!
* Application Insights JavaScript SDK - Channel, 2.0.0-rc4
* Application Insights JavaScript SDK - Channel, 2.0.0-rc5
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var 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 n(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,t,h,a,f=function(){return(f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(a=h||(h={}))[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden";var g,o,m=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.disableCookies=function(){e._canUseCookies=!1},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),s=/[xy]/g;(o=g||(g={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var u,c,l=1,p=2,d=3,v=4,y=5,_=6,I=7,S=12,b=22,w=24,E=26,N=28,x=40,C=41,A=42,D=43,T=46,R=47,M=48,U=49,L=50,O=52,P=54,k=56,z=57,B=61,F=64,V=66,q=67,G=68,X=69,j=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=j}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&m.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<j&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(H+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];s.priority>j&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),H="Channel has invalid priority",K=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}(),W=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}return i},s.sanitizeKey=function(e,t){var n;return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(n=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(g.WARNING,z,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},s.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(g.WARNING,B,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,V)},s.sanitizeMessage=function(e,t){var n;return t&&t.length>s.MAX_MESSAGE_LENGTH&&(n=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(g.WARNING,k,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},s.sanitizeException=function(e,t){var n;return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(g.WARNING,O,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},s.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(g.WARNING,U,"custom property is not valid",{exception:e},!0)}i=s.sanitizeString(t,i,s.MAX_PROPERTY_LENGTH),n[r=s.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,X).toString():t},s.sanitizeInput=function(e,t,n,r){var i;return t&&(t=s.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(g.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||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}(),Y=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(g.WARNING,l,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(g.WARNING,d,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(g.WARNING,y,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(g.WARNING,p,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(g.WARNING,v,"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(g.WARNING,_,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){m.disableCookies()},s.canUseCookies=function(t){if(void 0===m._canUseCookies){m._canUseCookies=!1;try{m._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(g.WARNING,G,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},s.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},s.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,i=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),J=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),Z=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=J.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var u=0===s.pathname.length?"/":s.pathname;"/"!==u.charAt(0)&&(u="/"+u),o=s.pathname,a=W.sanitizeString(e,n?n+" "+u:u)}else a=W.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),Q=(function(){function e(){}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||m.isNullOrUndefined(e)||m.isNullOrUndefined(t)||(n=t-e),n}}(),"ProcessLegacy"),$="http.method",ee=function(e){function t(){return e.call(this)||this}return n(t,e),t}(function(){}),te=function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=W.sanitizeString(e,n)||Y.NotSpecified,r.data=t,r.time=Y.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}return n(e,i),e}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),ne=function(){},re=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return n(e,t),e}(ne),ie=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=W.sanitizeString(e,t)||Y.NotSpecified,i.properties=W.sanitizeProperties(e,n),i.measurements=W.sanitizeMeasurements(e,r),i}return n(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(re),ae=function(){},oe=function(){this.hasFullStack=!0,this.parsedStack=[]},se=function(o){function r(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(a.exceptions=[new ue(e,t)],a.properties=W.sanitizeProperties(e,n),a.measurements=W.sanitizeMeasurements(e,r),i&&(a.severityLevel=i)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel)),a}return n(r,o),r.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ue.CreateFromInterface(t,e)});return new r(t,f({},e,{exceptions:n}))},r.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},r.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},r.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",r.dataType="ExceptionData",r}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return n(e,t),e}(ne)),ue=function(i){function a(e,t){var n=i.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=W.sanitizeString(e,t.name)||Y.NotSpecified,n.message=W.sanitizeMessage(e,t.message)||Y.NotSpecified;var r=t.stack;n.parsedStack=a.parseStack(r),n.stack=W.sanitizeException(e,r),n.hasFullStack=Y.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}return n(a,i),a.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},a.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return ce.CreateFromInterface(e)})||t.parsedStack;return new a(e,f({},t,{parsedStack:n}))},a.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(ce.regex.test(o)){var s=new ce(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var u=0,c=t.length-1,l=0,f=u,p=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var d=p-f+1;t.splice(f,d);break}f=u,p=c,u++,c--}}return t},a}(oe),ce=function(a){function o(e,t){var n=a.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=Y.trim(r),n.fileName="",n.line=0;var i=r.match(o.regex);i&&5<=i.length&&(n.method=Y.trim(i[2])||n.method,n.fileName=Y.trim(i[4]),n.line=parseInt(i[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return n(o,a),o.CreateFromInterface=function(e){return new o(e,null)},o.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(ae),le=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return n(e,t),e}(ne);(c=u||(u={}))[c.Measurement=0]="Measurement",c[c.Aggregation=1]="Aggregation";var fe,pe,de=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return n(e,t),e}(function(){this.kind=u.Measurement}),he=function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var u=new de;return u.count=0<r?r:void 0,u.max=isNaN(a)||null===a?void 0:a,u.min=isNaN(i)||null===i?void 0:i,u.name=W.sanitizeString(e,t)||Y.NotSpecified,u.value=n,s.metrics=[u],s.properties=W.sanitizeProperties(e,o),s}return n(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(le),ge=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return n(e,t),e}(re),me=function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=W.sanitizeId(e,o),s.url=W.sanitizeUrl(e,n),s.name=W.sanitizeString(e,t)||Y.NotSpecified,isNaN(r)||(s.duration=Y.msToTimeSpan(r)),s.properties=W.sanitizeProperties(e,i),s.measurements=W.sanitizeMeasurements(e,a),s}return n(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ge),ve=function(d){function e(e,t,n,r,i,a,o,s,u,c,l){void 0===u&&(u="Ajax");var f=d.call(this)||this;f.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},f.id=t,f.duration=Y.msToTimeSpan(i),f.success=a,f.resultCode=o+"",f.type=W.sanitizeString(e,u);var p=Z.ParseDependencyPath(e,n,s,r);return f.data=W.sanitizeUrl(e,r)||p.data,f.target=p.target,f.name=p.name,f.properties=W.sanitizeProperties(e,c),f.measurements=W.sanitizeMeasurements(e,l),f}return n(e,d),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 n(e,t),e}(ne)),ye=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||Y.NotSpecified,i.message=W.sanitizeMessage(e,t),i.properties=W.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}return n(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 n(e,t),e}(ne)),_e=function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=W.sanitizeUrl(e,n),o.name=W.sanitizeString(e,t)||Y.NotSpecified,o.properties=W.sanitizeProperties(e,i),o.measurements=W.sanitizeMeasurements(e,a),o}return n(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return n(e,t),e}(ge)),Ie=function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}return n(e,r),e}(ee);(pe=fe||(fe={}))[pe.Verbose=0]="Verbose",pe[pe.Information=1]="Information",pe[pe.Warning=2]="Warning",pe[pe.Error=3]="Error",pe[pe.Critical=4]="Critical";var Se=function(){function e(){}return e.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!m.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],m.isNullOrUndefined(i)?r:i},e}(),be=new function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},we=function(){function e(e){this._config=e,this._buffer=[]}return e.prototype.enqueue=function(e){this._buffer.push(e)},e.prototype.count=function(){return this._buffer.length},e.prototype.clear=function(){this._buffer.length=0},e.prototype.getItems=function(){return this._buffer.slice(0)},e.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},e.prototype.markAsSent=function(e){this.clear()},e.prototype.clearSent=function(e){},e}(),Ee=function(){function i(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(i.BUFFER_KEY),r=this.getBuffer(i.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>i.MAX_BUFFER_SIZE&&(this._buffer.length=i.MAX_BUFFER_SIZE),this.setBuffer(i.SENT_BUFFER_KEY,[]),this.setBuffer(i.BUFFER_KEY,this._buffer)}return i.prototype.enqueue=function(e){this._buffer.length>=i.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(g.WARNING,q,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(i.BUFFER_KEY,this._buffer))},i.prototype.count=function(){return this._buffer.length},i.prototype.clear=function(){this._buffer.length=0,this.setBuffer(i.BUFFER_KEY,[]),this.setBuffer(i.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},i.prototype.getItems=function(){return this._buffer.slice(0)},i.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},i.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(i.BUFFER_KEY,this._buffer);var t=this.getBuffer(i.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>i.MAX_BUFFER_SIZE&&(this._logger.throwInternal(g.CRITICAL,q,"Sent buffer reached its maximum size: "+t.length,!0),t.length=i.MAX_BUFFER_SIZE),this.setBuffer(i.SENT_BUFFER_KEY,t))},i.prototype.clearSent=function(e){var t=this.getBuffer(i.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(i.SENT_BUFFER_KEY,t)},i.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},i.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=Y.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(g.CRITICAL,A," storage key: "+t+", "+Y.getExceptionName(e),{exception:Y.dump(e)})}return[]},i.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);Y.setSessionStorage(this._logger,n,r)}catch(e){Y.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(g.WARNING,C," storage key: "+n+", "+Y.getExceptionName(e)+". Buffer cleared",{exception:Y.dump(e)})}},i.BUFFER_KEY="AI_buffer",i.SENT_BUFFER_KEY="AI_sentBuffer",i.MAX_BUFFER_SIZE=2e3,i}(),Ne=function(){function o(){}return o.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&(t||(t={}),t[n]=r)}return t},o.extractPropsAndMeasurements=function(e,t,n){if(!m.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},o.createEnvelope=function(e,t,n,r){var i=new te(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),o.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},o.extractPartAExtensions=function(e,t){if(t.tags||(t.tags={}),e.ext||(e.ext={}),e.tags||(e.tags=[]),e.ext.user){e.ext.user.authId&&(t.tags[be.userAuthUserId]=e.ext.user.authId);var n=e.ext.user.id||e.ext.user.localId;n&&(t.tags[be.userId]=n)}if(e.ext.app&&e.ext.app.sesId&&(t.tags[be.sessionId]=e.ext.app.sesId),e.ext.device&&((e.ext.device.id||e.ext.device.localId)&&(t.tags[be.deviceId]=e.ext.device.id||e.ext.device.localId),e.ext.device.deviceClass&&(t.tags[be.deviceType]=e.ext.device.deviceClass),e.ext.device.ip&&(t.tags[be.deviceIp]=e.ext.device.ip)),e.ext.web){var r=e.ext.web;r.browserLang&&(t.tags[be.deviceLanguage]=r.browserLang),r.browserVer&&(t.tags[be.deviceBrowserVersion]=r.browserVer),r.browser&&(t.tags[be.deviceBrowser]=r.browser),t.data=t.data||{},t.data.baseData=t.data.baseData||{},t.data.baseData.properties=t.data.baseData.properties||{},r.domain&&(t.data.baseData.properties.domain=r.domain),r.isManual&&(t.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(t.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(t.data.baseData.properties.userConsent=r.userConsent.toString())}e.ext.device&&e.ext.device.model&&(t.tags[be.deviceModel]=e.ext.device.model),e.ext.os&&e.ext.os.name&&(t.tags[be.deviceOS]=e.ext.os.name),e.ext.device&&e.ext.device.deviceType&&(t.tags[be.deviceType]=e.ext.device.deviceType),e.ext.trace&&(e.ext.trace.parentID&&(t.tags[be.operationParentId]=e.ext.trace.parentID),e.ext.trace.name&&(t.tags[be.operationName]=e.ext.trace.name),e.ext.trace.traceID&&(t.tags[be.operationId]=e.ext.trace.traceID));var i={};e.tags.forEach(function(e){i=f({},i,e)}),t.tags=f({},t.tags,i),t.tags[be.internalSdkVersion]||(t.tags[be.internalSdkVersion]="javascript:"+o.Version)},o.Version="2.0.0-rc4",o}(),xe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};Ne.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(m.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,u=i.duration,c=i.success,l=i.responseCode,f=i.type,p=i.properties&&i.properties[$]?i.properties[$]:"GET",d=new ve(e,a,o,s,u,c,l,p,f,r,n),h=new Ie(ve.dataType,d);return Ne.createEnvelope(e,ve.envelopeType,t,h)},t.DependencyEnvelopeCreator=new t,t}(Ne),Ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==ie.dataType&&(n.baseTypeSource=t.baseType),t.baseType===ie.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&Ne.extractPropsAndMeasurements(t.baseData,n,r),Ne.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new ie(e,i,n,r),o=new Ie(ie.dataType,a);return Ne.createEnvelope(e,ie.envelopeType,t,o)},t.EventEnvelopeCreator=new t,t}(Ne),Ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=se.CreateFromInterface(e,n),i=new Ie(se.dataType,r);return Ne.createEnvelope(e,se.envelopeType,t,i)},t.ExceptionEnvelopeCreator=new t,t}(Ne),De=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=Ne.extractProperties(t.data);r=f({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,u=t.baseData.max,c=new he(e,i,a,o,s,u,r),l=new Ie(he.dataType,c);return Ne.createEnvelope(e,he.envelopeType,t,l)},t.MetricEnvelopeCreator=new t,t}(Ne),Te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=void 0;m.isNullOrUndefined(t.baseData)||m.isNullOrUndefined(t.baseData.properties)||m.isNullOrUndefined(t.baseData.properties.duration)?m.isNullOrUndefined(t.data)||m.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r=t.baseData,i=r.name,a=r.uri,o=r.id,s=r.properties||{},u=r.measurements||{};if(m.isNullOrUndefined(r.refUri)||(s.refUri=r.refUri),m.isNullOrUndefined(r.pageType)||(s.pageType=r.pageType),m.isNullOrUndefined(r.isLoggedIn)||(s.isLoggedIn=r.isLoggedIn.toString()),!m.isNullOrUndefined(r.properties)){var c=r.properties;for(var l in c)c.hasOwnProperty(l)&&(s[l]=c[l])}var f=new me(e,i,a,n,s,u,o),p=new Ie(me.dataType,f);return Ne.createEnvelope(e,me.envelopeType,t,p)},t.PageViewEnvelopeCreator=new t,t}(Ne),Re=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri,a=n.properties,o=n.measurements,s=new _e(e,r,i,void 0,a,o),u=new Ie(_e.dataType,s);return Ne.createEnvelope(e,_e.envelopeType,t,u)},t.PageViewPerformanceEnvelopeCreator=new t,t}(Ne),Me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(g.CRITICAL,T,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=Ne.extractProperties(t.data),a=f({},i,t.baseData.properties),o=new ye(e,n,r,a),s=new Ie(ye.dataType,o);return Ne.createEnvelope(e,ye.envelopeType,t,s)},t.TraceEnvelopeCreator=new t,t}(Ne),Ue=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.EventValidator=new e,e}(),Le=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.TraceValidator=new e,e}(),Oe=function(){function e(){}return e.prototype.Validate=function(e){return!0},e._validateExceptions=function(e){return!0},e.ExceptionValidator=new e,e}(),Pe=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.MetricValidator=new e,e}(),ke=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewPerformanceValidator=new e,e}(),ze=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.PageViewValidator=new e,e}(),Be=function(){function e(){}return e.prototype.Validate=function(e){return!0},e.RemoteDepdencyValidator=new e,e}(),Fe=function(){function e(e){this._logger=e}return e.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},e.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(g.CRITICAL,M,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(g.WARNING,L,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(Y.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(g.WARNING,U,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(g.CRITICAL,M,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&h.Required:o&h.Required,u="function"==typeof o?o()&h.Hidden:o&h.Hidden,c=o&h.Array,l=void 0!==e[i],f="object"==typeof e[i]&&null!==e[i];if(!s||l||c){if(!u)void 0!==(a=f?c?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a)}else this._logger.throwInternal(g.CRITICAL,w,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},e.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(Y.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(g.CRITICAL,P,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},e.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(g.CRITICAL,r[i],null,!0)}return r},e}(),Ve=function(){function e(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}return e.prototype._setOnline=function(){this._onlineStatus=!0},e.prototype._setOffline=function(){this._onlineStatus=!1},e.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!m.isNullOrUndefined(navigator.onLine))||navigator.onLine},e.prototype.isOffline=function(){return!this.isOnline()},e.Offline=new e,e}().Offline,qe=function(){function u(){this.priority=1001,this._XMLHttpRequestSupported=!1,this.identifier="AppInsightsChannelPlugin"}return u.prototype.pause=function(){throw new Error("Method not implemented.")},u.prototype.resume=function(){throw new Error("Method not implemented.")},u.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(g.CRITICAL,b,"flush failed, telemetry will not be collected: "+Y.getExceptionName(e),{exception:Y.dump(e)})}},u.prototype.teardown=function(){throw new Error("Method not implemented.")},u.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new Fe(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=u._getDefaultAppInsightsChannelConfig();this._config=u._getEmptyAppInsightsChannelConfig();var a=function(e){o._config[e]=function(){return Se.getConfig(t,e,r.identifier,i[e]())}},o=this;for(var s in i)a(s);(this._buffer=this._config.enableSessionStorageBuffer&&Y.canUseSessionStorage()?new Ee(this._logger,this._config):new we(this._config),!this._config.isBeaconApiDisabled()&&Y.IsBeaconApiSupported())?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},u.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(g.CRITICAL,I,"Cannot send empty telemetry");if(!this._sender)return void this._logger.throwInternal(g.CRITICAL,N,"Sender was not initialized");if(!u._validate(e))return void this._logger.throwInternal(g.CRITICAL,T,"Invalid telemetry envelope");var n=u.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(g.CRITICAL,R,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[Q]&&(e.tags[Q].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(g.CRITICAL,F,"One of telemetry initializers failed, telemetry item will not be sent: "+Y.getExceptionName(e),{exception:Y.dump(e)},!0)}}),delete e.tags[Q]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(g.WARNING,S,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Y.getExceptionName(e),{exception:Y.dump(e)})}m.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;if(this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status)!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(g.WARNING,x,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e));else if(Ve.isOffline()){if(!this._config.isRetryDisabled()){this._resendPayload(t,10),this._logger.throwInternal(g.WARNING,x,". Offline - Response Code: "+e.status+". Offline status: "+Ve.isOffline()+". Will retry to send "+t.length+" items.")}}else 206===e.status?(r||(r=this._parseResponse(e.responseText||e.response)),r&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e))):(this._consecutiveErrors=0,this._onSuccess(t,n))}},u.prototype.triggerSend=function(e){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var t=this._buffer.getItems();this._sender(t,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!Y.getIEVersion()||9<Y.getIEVersion())&&this._logger.throwInternal(g.CRITICAL,x,"Telemetry transmission failed, some telemetry will be lost: "+Y.getExceptionName(e),{exception:Y.dump(e)})}},u.prototype._onError=function(e,t,n){this._logger.throwInternal(g.WARNING,E,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},u.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(g.WARNING,x,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},u.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},u.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},u.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||m.isNullOrUndefined(t)?e:f({},e,{iKey:t})).baseType){case ie.dataType:return Ce.EventEnvelopeCreator.Create(n,r);case ye.dataType:return Me.TraceEnvelopeCreator.Create(n,r);case me.dataType:return Te.PageViewEnvelopeCreator.Create(n,r);case _e.dataType:return Re.PageViewPerformanceEnvelopeCreator.Create(n,r);case se.dataType:return Ae.ExceptionEnvelopeCreator.Create(n,r);case he.dataType:return De.MetricEnvelopeCreator.Create(n,r);case ve.dataType:return xe.DependencyEnvelopeCreator.Create(n,r);default:return Ce.EventEnvelopeCreator.Create(n,r)}},u._getDefaultAppInsightsChannelConfig=function(){var e={endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},instrumentationKey:function(){}};return e},u._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,instrumentationKey:void 0,namePrefix:void 0}},u._validate=function(e){switch(e.baseType){case ie.dataType:return Ue.EventValidator.Validate(e);case ye.dataType:return Le.TraceValidator.Validate(e);case se.dataType:return Oe.ExceptionValidator.Validate(e);case he.dataType:return Pe.MetricValidator.Validate(e);case me.dataType:return ze.PageViewValidator.Validate(e);case _e.dataType:return ke.PageViewPerformanceValidator.Validate(e);case ve.dataType:return Be.RemoteDepdencyValidator.Validate(e);default:return Ue.EventValidator.Validate(e)}},u.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?this._buffer.markAsSent(e):this._logger.throwInternal(g.CRITICAL,x,". Failed to send telemetry with Beacon API.")},u.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),Y.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(K.sdkContextHeader,K.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},u.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(g.CRITICAL,D,"Cannot parse the response. "+Y.getExceptionName(e),{response:t})}return null},u.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},u.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},u.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},u.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},u.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},u.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(g.WARNING,x,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},u.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},u}();e.Sender=qe,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=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 t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,f,a,p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i||(i={}))[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=f||(f={}))[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden";var g=(o.isNullOrUndefined=function(e){return null==e},o.disableCookies=function(){o._canUseCookies=!1},o.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},o);function o(){}var v,s,l=/[xy]/g;(s=v||(v={}))[s.CRITICAL=1]="CRITICAL",s[s.WARNING=2]="WARNING";var u=1,c=2,d=3,h=4,m=5,y=6,_=7,I=12,S=22,b=24,w=26,E=28,N=40,x=41,C=42,A=43,D=46,T=47,R=48,M=49,U=50,L=52,O=54,P=56,k=57,z=61,B=64,F=66,V=67,q=68,G=69;H.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(H.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),H.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&g.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<X&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(j+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];s.priority>X&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function H(){this.identifier="ChannelControllerPlugin",this.priority=X}var X=500,j="Channel has invalid priority",K=(W.requestContextHeader="Request-Context",W.requestContextTargetKey="appId",W.requestContextAppIdFormat="appId=cid-v1:",W.requestIdHeader="Request-Id",W.sdkContextHeader="Sdk-Context",W.sdkContextHeaderAppIdRequest="appId",W.requestContextHeaderLowerCase="request-context",W);function W(){}var Y=(J.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=J.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,J.MAX_NAME_LENGTH-3)+J.padNumber(a);i=o}return i},J.sanitizeKey=function(e,t){var n;return t&&(t=J.trim(t.toString())).length>J.MAX_NAME_LENGTH&&(n=t.substring(0,J.MAX_NAME_LENGTH),e.throwInternal(v.WARNING,k,"name is too long. It has been truncated to "+J.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},J.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=J.MAX_STRING_LENGTH),t&&(n=n||J.MAX_STRING_LENGTH,(t=J.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(v.WARNING,z,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},J.sanitizeUrl=function(e,t){return J.sanitizeInput(e,t,J.MAX_URL_LENGTH,F)},J.sanitizeMessage=function(e,t){var n;return t&&t.length>J.MAX_MESSAGE_LENGTH&&(n=t.substring(0,J.MAX_MESSAGE_LENGTH),e.throwInternal(v.WARNING,P,"message is too long, it has been truncated to "+J.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},J.sanitizeException=function(e,t){var n;return t&&t.length>J.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,J.MAX_EXCEPTION_LENGTH),e.throwInternal(v.WARNING,L,"exception is too long, it has been truncated to "+J.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},J.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(v.WARNING,M,"custom property is not valid",{exception:e},!0)}i=J.sanitizeString(t,i,J.MAX_PROPERTY_LENGTH),n[r=J.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},J.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=J.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},J.sanitizeId=function(e,t){return t?J.sanitizeInput(e,t,J.MAX_ID_LENGTH,G).toString():t},J.sanitizeInput=function(e,t,n,r){var i;return t&&(t=J.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(v.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},J.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},J.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},J.MAX_NAME_LENGTH=150,J.MAX_ID_LENGTH=128,J.MAX_PROPERTY_LENGTH=8192,J.MAX_STRING_LENGTH=1024,J.MAX_URL_LENGTH=2048,J.MAX_MESSAGE_LENGTH=32768,J.MAX_EXCEPTION_LENGTH=32768,J);function J(){}var Z=(Q.disableStorage=function(){Q._canUseLocalStorage=!1,Q._canUseSessionStorage=!1},Q._getLocalStorageObject=function(){return Q.canUseLocalStorage()?Q._getVerifiedStorageObject(i.LocalStorage):null},Q._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},Q.isInternalApplicationInsightsEndpoint=function(e){return-1!==Q._internalEndpoints.indexOf(e.toLowerCase())},Q.canUseLocalStorage=function(){return void 0===Q._canUseLocalStorage&&(Q._canUseLocalStorage=!!Q._getVerifiedStorageObject(i.LocalStorage)),Q._canUseLocalStorage},Q.getStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(v.WARNING,u,"Browser failed read of local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setStorage=function(t,e,n){var r=Q._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(v.WARNING,d,"Browser failed write to local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(v.WARNING,m,"Browser failed removal of local storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q._getSessionStorageObject=function(){return Q.canUseSessionStorage()?Q._getVerifiedStorageObject(i.SessionStorage):null},Q.canUseSessionStorage=function(){return void 0===Q._canUseSessionStorage&&(Q._canUseSessionStorage=!!Q._getVerifiedStorageObject(i.SessionStorage)),Q._canUseSessionStorage},Q.getSessionStorageKeys=function(){var e=[];if(Q.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},Q.getSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(v.WARNING,c,"Browser failed read of session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setSessionStorage=function(t,e,n){var r=Q._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(v.WARNING,h,"Browser failed write to session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(v.WARNING,y,"Browser failed removal of session storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.disableCookies=function(){g.disableCookies()},Q.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==Q.document.cookie}catch(e){t.throwInternal(v.WARNING,q,"Cannot access document.cookie - "+Q.getExceptionName(e),{exception:Q.dump(e)})}}return g._canUseCookies},Q.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),Q.document.location&&"https:"===Q.document.location.protocol&&(a=";secure"),Q.canUseCookies(e)&&(Q.document.cookie=t+"="+n+i+";path=/"+a)},Q.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},Q.getCookie=function(e,t){if(Q.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=Q.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=Q.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},Q.deleteCookie=function(e,t){Q.canUseCookies(e)&&(Q.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},Q.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},Q.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},Q.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Q.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},Q.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},Q.toISOStringForIE8=function(e){if(Q.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"}},Q.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},Q.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,i=""+Math.floor(e/36e5)%24,a=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},Q.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},Q.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},Q.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},Q.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},Q.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},Q.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},Q.document="undefined"!=typeof document?document:{},Q._canUseLocalStorage=void 0,Q._canUseSessionStorage=void 0,Q._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],Q.NotSpecified="not_specified",Q);function Q(){}var $=(ee.parseUrl=function(e){return ee.htmlAnchorElement||(ee.htmlAnchorElement=ee.document.createElement?ee.document.createElement("a"):{host:ee.parseHost(e)}),ee.htmlAnchorElement.href=e,ee.htmlAnchorElement},ee.getAbsoluteUrl=function(e){var t,n=ee.parseUrl(e);return n&&(t=n.href),t},ee.getPathName=function(e){var t,n=ee.parseUrl(e);return n&&(t=n.pathname),t},ee.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ee.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},ee.document="undefined"!=typeof document?document:{},ee);function ee(){}var te=(ne.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=$.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var l=0===s.pathname.length?"/":s.pathname;"/"!==l.charAt(0)&&(l="/"+l),o=s.pathname,a=Y.sanitizeString(e,n?n+" "+l:l)}else a=Y.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},ne);function ne(){}re.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()},re.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n};function re(){}var ie,ae="ProcessLegacy",oe="http.method",se=(t(le,ie=function(){}),le);function le(){return ie.call(this)||this}var ue,ce=(t(pe,ue=function(){this.ver=1,this.sampleRate=100,this.tags={}}),pe);function pe(e,t,n){var r=ue.call(this)||this;return r.name=Y.sanitizeString(e,n)||Z.NotSpecified,r.data=t,r.time=Z.toISOStringForIE8(new Date),r.aiDataContract={time:f.Required,iKey:f.Required,name:f.Required,sampleRate:function(){return 100==r.sampleRate?f.Hidden:f.Required},tags:f.Required,data:f.Required},r}function de(){}var fe,he=(t(ge,fe=de),ge);function ge(){var e=fe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ve,me=(t(ye,ve=he),ye.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ye.dataType="EventData",ye);function ye(e,t,n,r){var i=ve.call(this)||this;return i.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},i.name=Y.sanitizeString(e,t)||Z.NotSpecified,i.properties=Y.sanitizeProperties(e,n),i.measurements=Y.sanitizeMeasurements(e,r),i}function _e(){}var Ie,Se=(t(be,Ie=de),be);function be(){var e=Ie.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function we(){this.hasFullStack=!0,this.parsedStack=[]}var Ee,Ne=(t(xe,Ee=Se),xe.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return Ae.CreateFromInterface(t,e)});return new xe(t,p({},e,{exceptions:n}))},xe.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},xe.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},xe.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",xe.dataType="ExceptionData",xe);function xe(e,t,n,r,i){var a=Ee.call(this)||this;return a.aiDataContract={ver:f.Required,exceptions:f.Required,severityLevel:f.Default,properties:f.Default,measurements:f.Default},t instanceof Error?(a.exceptions=[new Ae(e,t)],a.properties=Y.sanitizeProperties(e,n),a.measurements=Y.sanitizeMeasurements(e,r),i&&(a.severityLevel=i)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel)),a}var Ce,Ae=(t(De,Ce=we),De.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||void 0}},De.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Re.CreateFromInterface(e)})||t.parsedStack;return new De(e,p({},t,{parsedStack:n}))},De.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(Re.regex.test(o)){var s=new Re(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var l=0,u=t.length-1,c=0,p=l,d=u;l<u;){if(32768<(c+=t[l].sizeInBytes+t[u].sizeInBytes)){var f=d-p+1;t.splice(p,f);break}p=l,d=u,l++,u--}}return t},De);function De(e,t){var n=Ce.call(this)||this;if(n.aiDataContract={id:f.Default,outerId:f.Default,typeName:f.Required,message:f.Required,hasFullStack:f.Default,stack:f.Default,parsedStack:f.Array},t instanceof Error){n.typeName=Y.sanitizeString(e,t.name)||Z.NotSpecified,n.message=Y.sanitizeMessage(e,t.message)||Z.NotSpecified;var r=t.stack;n.parsedStack=De.parseStack(r),n.stack=Y.sanitizeException(e,r),n.hasFullStack=Z.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var Te,Re=(t(Me,Te=_e),Me.CreateFromInterface=function(e){return new Me(e,null)},Me.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Me.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Me.baseSize=58,Me);function Me(e,t){var n=Te.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:f.Required,method:f.Required,assembly:f.Default,fileName:f.Default,line:f.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=Z.trim(r),n.fileName="",n.line=0;var i=r.match(Me.regex);i&&5<=i.length&&(n.method=Z.trim(i[2])||n.method,n.fileName=Z.trim(i[4]),n.line=parseInt(i[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Me.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ue,Le,Oe,Pe=(t(ke,Ue=de),ke);function ke(){var e=Ue.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Oe=Le||(Le={}))[Oe.Measurement=0]="Measurement",Oe[Oe.Aggregation=1]="Aggregation";var ze,Be=(t(Fe,ze=function(){this.kind=Le.Measurement}),Fe);function Fe(){var e=null!==ze&&ze.apply(this,arguments)||this;return e.aiDataContract={name:f.Required,kind:f.Default,value:f.Required,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default},e}var Ve,qe=(t(Ge,Ve=Pe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Ge.dataType="MetricData",Ge);function Ge(e,t,n,r,i,a,o){var s=Ve.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var l=new Be;return l.count=0<r?r:void 0,l.max=isNaN(a)||null===a?void 0:a,l.min=isNaN(i)||null===i?void 0:i,l.name=Y.sanitizeString(e,t)||Z.NotSpecified,l.value=n,s.metrics=[l],s.properties=Y.sanitizeProperties(e,o),s}var He,Xe=(t(je,He=he),je);function je(){var e=He.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ke,We=(t(Ye,Ke=Xe),Ye.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Ye.dataType="PageviewData",Ye);function Ye(e,t,n,r,i,a,o){var s=Ke.call(this)||this;return s.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,properties:f.Default,measurements:f.Default,id:f.Default},s.id=Y.sanitizeId(e,o),s.url=Y.sanitizeUrl(e,n),s.name=Y.sanitizeString(e,t)||Z.NotSpecified,isNaN(r)||(s.duration=Z.msToTimeSpan(r)),s.properties=Y.sanitizeProperties(e,i),s.measurements=Y.sanitizeMeasurements(e,a),s}var Je,Ze=(t(Qe,Je=de),Qe);function Qe(){var e=Je.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var $e,et=(t(tt,$e=Ze),tt.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",tt.dataType="RemoteDependencyData",tt);function tt(e,t,n,r,i,a,o,s,l,u,c){void 0===l&&(l="Ajax");var p=$e.call(this)||this;p.aiDataContract={id:f.Required,ver:f.Required,name:f.Default,resultCode:f.Default,duration:f.Default,success:f.Default,data:f.Default,target:f.Default,type:f.Default,properties:f.Default,measurements:f.Default,kind:f.Default,value:f.Default,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default,dependencyKind:f.Default,dependencySource:f.Default,commandName:f.Default,dependencyTypeName:f.Default},p.id=t,p.duration=Z.msToTimeSpan(i),p.success=a,p.resultCode=o+"",p.type=Y.sanitizeString(e,l);var d=te.ParseDependencyPath(e,n,s,r);return p.data=Y.sanitizeUrl(e,r)||d.data,p.target=d.target,p.name=d.name,p.properties=Y.sanitizeProperties(e,u),p.measurements=Y.sanitizeMeasurements(e,c),p}var nt,rt=(t(it,nt=de),it);function it(){var e=nt.call(this)||this;return e.ver=2,e.properties={},e}var at,ot=(t(st,at=rt),st.envelopeType="Microsoft.ApplicationInsights.{0}.Message",st.dataType="MessageData",st);function st(e,t,n,r){var i=at.call(this)||this;return i.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||Z.NotSpecified,i.message=Y.sanitizeMessage(e,t),i.properties=Y.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var lt,ut=(t(ct,lt=Xe),ct);function ct(){var e=lt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var pt,dt=(t(ft,pt=ut),ft.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",ft.dataType="PageviewPerformanceData",ft);function ft(e,t,n,r,i,a){var o=pt.call(this)||this;return o.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,perfTotal:f.Default,networkConnect:f.Default,sentRequest:f.Default,receivedResponse:f.Default,domProcessing:f.Default,properties:f.Default,measurements:f.Default},o.url=Y.sanitizeUrl(e,n),o.name=Y.sanitizeString(e,t)||Z.NotSpecified,o.properties=Y.sanitizeProperties(e,i),o.measurements=Y.sanitizeMeasurements(e,a),o}var ht,gt,vt,mt=(t(yt,ht=se),yt);function yt(e,t){var n=ht.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(vt=gt||(gt={}))[vt.Verbose=0]="Verbose",vt[vt.Information=1]="Information",vt[vt.Warning=2]="Warning",vt[vt.Error=3]="Error",vt[vt.Critical=4]="Critical";var _t=(It.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!g.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],g.isNullOrUndefined(i)?r:i},It);function It(){}var St=new function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},bt=(wt.prototype.enqueue=function(e){this._buffer.push(e)},wt.prototype.count=function(){return this._buffer.length},wt.prototype.clear=function(){this._buffer.length=0},wt.prototype.getItems=function(){return this._buffer.slice(0)},wt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},wt.prototype.markAsSent=function(e){this.clear()},wt.prototype.clearSent=function(e){},wt);function wt(e){this._config=e,this._buffer=[]}var Et=(Nt.prototype.enqueue=function(e){this._buffer.length>=Nt.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(v.WARNING,V,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(Nt.BUFFER_KEY,this._buffer))},Nt.prototype.count=function(){return this._buffer.length},Nt.prototype.clear=function(){this._buffer.length=0,this.setBuffer(Nt.BUFFER_KEY,[]),this.setBuffer(Nt.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},Nt.prototype.getItems=function(){return this._buffer.slice(0)},Nt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Nt.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(Nt.BUFFER_KEY,this._buffer);var t=this.getBuffer(Nt.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>Nt.MAX_BUFFER_SIZE&&(this._logger.throwInternal(v.CRITICAL,V,"Sent buffer reached its maximum size: "+t.length,!0),t.length=Nt.MAX_BUFFER_SIZE),this.setBuffer(Nt.SENT_BUFFER_KEY,t))},Nt.prototype.clearSent=function(e){var t=this.getBuffer(Nt.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(Nt.SENT_BUFFER_KEY,t)},Nt.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},Nt.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=Z.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(v.CRITICAL,C," storage key: "+t+", "+Z.getExceptionName(e),{exception:Z.dump(e)})}return[]},Nt.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);Z.setSessionStorage(this._logger,n,r)}catch(e){Z.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(v.WARNING,x," storage key: "+n+", "+Z.getExceptionName(e)+". Buffer cleared",{exception:Z.dump(e)})}},Nt.BUFFER_KEY="AI_buffer",Nt.SENT_BUFFER_KEY="AI_sentBuffer",Nt.MAX_BUFFER_SIZE=2e3,Nt);function Nt(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(Nt.BUFFER_KEY),r=this.getBuffer(Nt.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>Nt.MAX_BUFFER_SIZE&&(this._buffer.length=Nt.MAX_BUFFER_SIZE),this.setBuffer(Nt.SENT_BUFFER_KEY,[]),this.setBuffer(Nt.BUFFER_KEY,this._buffer)}var xt=(Ct.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&(t||(t={}),t[n]=r)}return t},Ct.extractPropsAndMeasurements=function(e,t,n){if(!g.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},Ct.createEnvelope=function(e,t,n,r){var i=new ce(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),Ct.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},Ct.extractPartAExtensions=function(e,t){if(t.tags||(t.tags={}),e.ext||(e.ext={}),e.tags||(e.tags=[]),e.ext.user){e.ext.user.authId&&(t.tags[St.userAuthUserId]=e.ext.user.authId);var n=e.ext.user.id||e.ext.user.localId;n&&(t.tags[St.userId]=n)}if(e.ext.app&&e.ext.app.sesId&&(t.tags[St.sessionId]=e.ext.app.sesId),e.ext.device&&((e.ext.device.id||e.ext.device.localId)&&(t.tags[St.deviceId]=e.ext.device.id||e.ext.device.localId),e.ext.device.deviceClass&&(t.tags[St.deviceType]=e.ext.device.deviceClass),e.ext.device.ip&&(t.tags[St.deviceIp]=e.ext.device.ip)),e.ext.web){var r=e.ext.web;r.browserLang&&(t.tags[St.deviceLanguage]=r.browserLang),r.browserVer&&(t.tags[St.deviceBrowserVersion]=r.browserVer),r.browser&&(t.tags[St.deviceBrowser]=r.browser),t.data=t.data||{},t.data.baseData=t.data.baseData||{},t.data.baseData.properties=t.data.baseData.properties||{},r.domain&&(t.data.baseData.properties.domain=r.domain),r.isManual&&(t.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(t.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(t.data.baseData.properties.userConsent=r.userConsent.toString())}e.ext.device&&e.ext.device.model&&(t.tags[St.deviceModel]=e.ext.device.model),e.ext.os&&e.ext.os.name&&(t.tags[St.deviceOS]=e.ext.os.name),e.ext.device&&e.ext.device.deviceType&&(t.tags[St.deviceType]=e.ext.device.deviceType),e.ext.trace&&(e.ext.trace.parentID&&(t.tags[St.operationParentId]=e.ext.trace.parentID),e.ext.trace.name&&(t.tags[St.operationName]=e.ext.trace.name),e.ext.trace.traceID&&(t.tags[St.operationId]=e.ext.trace.traceID));var i={};e.tags.forEach(function(e){i=p({},i,e)}),t.tags=p({},t.tags,i),t.tags[St.internalSdkVersion]||(t.tags[St.internalSdkVersion]="javascript:"+Ct.Version)},Ct.Version="2.0.0-rc5",Ct);function Ct(){}var At,Dt=(t(Tt,At=xt),Tt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};xt.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(g.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,l=i.duration,u=i.success,c=i.responseCode,p=i.type,d=i.properties&&i.properties[oe]?i.properties[oe]:"GET",f=new et(e,a,o,s,l,u,c,d,p,r,n),h=new mt(et.dataType,f);return xt.createEnvelope(e,et.envelopeType,t,h)},Tt.DependencyEnvelopeCreator=new Tt,Tt);function Tt(){return null!==At&&At.apply(this,arguments)||this}var Rt,Mt=(t(Ut,Rt=xt),Ut.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==me.dataType&&(n.baseTypeSource=t.baseType),t.baseType===me.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&xt.extractPropsAndMeasurements(t.baseData,n,r),xt.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new me(e,i,n,r),o=new mt(me.dataType,a);return xt.createEnvelope(e,me.envelopeType,t,o)},Ut.EventEnvelopeCreator=new Ut,Ut);function Ut(){return null!==Rt&&Rt.apply(this,arguments)||this}var Lt,Ot=(t(Pt,Lt=xt),Pt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=Ne.CreateFromInterface(e,n),i=new mt(Ne.dataType,r);return xt.createEnvelope(e,Ne.envelopeType,t,i)},Pt.ExceptionEnvelopeCreator=new Pt,Pt);function Pt(){return null!==Lt&&Lt.apply(this,arguments)||this}var kt,zt=(t(Bt,kt=xt),Bt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=xt.extractProperties(t.data);r=p({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,l=t.baseData.max,u=new qe(e,i,a,o,s,l,r),c=new mt(qe.dataType,u);return xt.createEnvelope(e,qe.envelopeType,t,c)},Bt.MetricEnvelopeCreator=new Bt,Bt);function Bt(){return null!==kt&&kt.apply(this,arguments)||this}var Ft,Vt=(t(qt,Ft=xt),qt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=void 0;g.isNullOrUndefined(t.baseData)||g.isNullOrUndefined(t.baseData.properties)||g.isNullOrUndefined(t.baseData.properties.duration)?g.isNullOrUndefined(t.data)||g.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r=t.baseData,i=r.name,a=r.uri,o=r.id,s=r.properties||{},l=r.measurements||{};if(g.isNullOrUndefined(r.refUri)||(s.refUri=r.refUri),g.isNullOrUndefined(r.pageType)||(s.pageType=r.pageType),g.isNullOrUndefined(r.isLoggedIn)||(s.isLoggedIn=r.isLoggedIn.toString()),!g.isNullOrUndefined(r.properties)){var u=r.properties;for(var c in u)u.hasOwnProperty(c)&&(s[c]=u[c])}var p=new We(e,i,a,n,s,l,o),d=new mt(We.dataType,p);return xt.createEnvelope(e,We.envelopeType,t,d)},qt.PageViewEnvelopeCreator=new qt,qt);function qt(){return null!==Ft&&Ft.apply(this,arguments)||this}var Gt,Ht=(t(Xt,Gt=xt),Xt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri,a=n.properties,o=n.measurements,s=new dt(e,r,i,void 0,a,o),l=new mt(dt.dataType,s);return xt.createEnvelope(e,dt.envelopeType,t,l)},Xt.PageViewPerformanceEnvelopeCreator=new Xt,Xt);function Xt(){return null!==Gt&&Gt.apply(this,arguments)||this}var jt,Kt=(t(Wt,jt=xt),Wt.prototype.Create=function(e,t){this._logger=e,g.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,D,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=xt.extractProperties(t.data),a=p({},i,t.baseData.properties),o=new ot(e,n,r,a),s=new mt(ot.dataType,o);return xt.createEnvelope(e,ot.envelopeType,t,s)},Wt.TraceEnvelopeCreator=new Wt,Wt);function Wt(){return null!==jt&&jt.apply(this,arguments)||this}var Yt=(Jt.prototype.Validate=function(e){return!0},Jt.EventValidator=new Jt,Jt);function Jt(){}var Zt=(Qt.prototype.Validate=function(e){return!0},Qt.TraceValidator=new Qt,Qt);function Qt(){}var $t=(en.prototype.Validate=function(e){return!0},en._validateExceptions=function(e){return!0},en.ExceptionValidator=new en,en);function en(){}var tn=(nn.prototype.Validate=function(e){return!0},nn.MetricValidator=new nn,nn);function nn(){}var rn=(an.prototype.Validate=function(e){return!0},an.PageViewPerformanceValidator=new an,an);function an(){}var on=(sn.prototype.Validate=function(e){return!0},sn.PageViewValidator=new sn,sn);function sn(){}var ln=(un.prototype.Validate=function(e){return!0},un.RemoteDepdencyValidator=new un,un);function un(){}var cn=(pn.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},pn.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(v.CRITICAL,R,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(v.WARNING,U,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(Z.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(v.WARNING,M,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(v.CRITICAL,R,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&f.Required:o&f.Required,l="function"==typeof o?o()&f.Hidden:o&f.Hidden,u=o&f.Array,c=void 0!==e[i],p="object"==typeof e[i]&&null!==e[i];!s||c||u?l||void 0!==(a=p?u?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a):this._logger.throwInternal(v.CRITICAL,b,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},pn.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(Z.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(v.CRITICAL,O,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},pn.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(v.CRITICAL,r[i],null,!0)}return r},pn);function pn(e){this._logger=e}function dn(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}var fn=(dn.prototype._setOnline=function(){this._onlineStatus=!0},dn.prototype._setOffline=function(){this._onlineStatus=!1},dn.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!g.isNullOrUndefined(navigator.onLine))||navigator.onLine},dn.prototype.isOffline=function(){return!this.isOnline()},dn.Offline=new dn,dn).Offline,hn=(gn.prototype.pause=function(){throw new Error("Method not implemented.")},gn.prototype.resume=function(){throw new Error("Method not implemented.")},gn.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(v.CRITICAL,S,"flush failed, telemetry will not be collected: "+Z.getExceptionName(e),{exception:Z.dump(e)})}},gn.prototype.teardown=function(){throw new Error("Method not implemented.")},gn.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new cn(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=gn._getDefaultAppInsightsChannelConfig();function a(e){o._config[e]=function(){return _t.getConfig(t,e,r.identifier,i[e]())}}this._config=gn._getEmptyAppInsightsChannelConfig();var o=this;for(var s in i)a(s);this._buffer=this._config.enableSessionStorageBuffer&&Z.canUseSessionStorage()?new Et(this._logger,this._config):new bt(this._config),!this._config.isBeaconApiDisabled()&&Z.IsBeaconApiSupported()?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},gn.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(v.CRITICAL,_,"Cannot send empty telemetry");if(!this._sender)return void this._logger.throwInternal(v.CRITICAL,E,"Sender was not initialized");if(!gn._validate(e))return void this._logger.throwInternal(v.CRITICAL,D,"Invalid telemetry envelope");var n=gn.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(v.CRITICAL,T,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[ae]&&(e.tags[ae].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(v.CRITICAL,B,"One of telemetry initializers failed, telemetry item will not be sent: "+Z.getExceptionName(e),{exception:Z.dump(e)},!0)}}),delete e.tags[ae]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(v.WARNING,I,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+Z.getExceptionName(e),{exception:Z.dump(e)})}g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},gn.prototype.setNextPlugin=function(e){this._nextPlugin=e},gn.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(v.WARNING,N,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):fn.isOffline()?this._config.isRetryDisabled()||(this._resendPayload(t,10),this._logger.throwInternal(v.WARNING,N,". Offline - Response Code: "+e.status+". Offline status: "+fn.isOffline()+". Will retry to send "+t.length+" items.")):206===e.status?(r||(r=this._parseResponse(e.responseText||e.response)),r&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e))):(this._consecutiveErrors=0,this._onSuccess(t,n))}},gn.prototype.triggerSend=function(e){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var t=this._buffer.getItems();this._sender(t,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!Z.getIEVersion()||9<Z.getIEVersion())&&this._logger.throwInternal(v.CRITICAL,N,"Telemetry transmission failed, some telemetry will be lost: "+Z.getExceptionName(e),{exception:Z.dump(e)})}},gn.prototype._onError=function(e,t,n){this._logger.throwInternal(v.WARNING,w,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},gn.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(v.WARNING,N,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},gn.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},gn.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},gn.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||g.isNullOrUndefined(t)?e:p({},e,{iKey:t})).baseType){case me.dataType:return Mt.EventEnvelopeCreator.Create(n,r);case ot.dataType:return Kt.TraceEnvelopeCreator.Create(n,r);case We.dataType:return Vt.PageViewEnvelopeCreator.Create(n,r);case dt.dataType:return Ht.PageViewPerformanceEnvelopeCreator.Create(n,r);case Ne.dataType:return Ot.ExceptionEnvelopeCreator.Create(n,r);case qe.dataType:return zt.MetricEnvelopeCreator.Create(n,r);case et.dataType:return Dt.DependencyEnvelopeCreator.Create(n,r);default:return Mt.EventEnvelopeCreator.Create(n,r)}},gn._getDefaultAppInsightsChannelConfig=function(){var e={endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},instrumentationKey:function(){}};return e},gn._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,instrumentationKey:void 0,namePrefix:void 0}},gn._validate=function(e){switch(e.baseType){case me.dataType:return Yt.EventValidator.Validate(e);case ot.dataType:return Zt.TraceValidator.Validate(e);case Ne.dataType:return $t.ExceptionValidator.Validate(e);case qe.dataType:return tn.MetricValidator.Validate(e);case We.dataType:return on.PageViewValidator.Validate(e);case dt.dataType:return rn.PageViewPerformanceValidator.Validate(e);case et.dataType:return ln.RemoteDepdencyValidator.Validate(e);default:return Yt.EventValidator.Validate(e)}},gn.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?this._buffer.markAsSent(e):this._logger.throwInternal(v.CRITICAL,N,". Failed to send telemetry with Beacon API.")},gn.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),Z.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(K.sdkContextHeader,K.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},gn.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(v.CRITICAL,A,"Cannot parse the response. "+Z.getExceptionName(e),{response:t})}return null},gn.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},gn.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},gn.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},gn.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},gn.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},gn.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(v.WARNING,N,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},gn.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},gn);function gn(){this.priority=1001,this.identifier="AppInsightsChannelPlugin",this._XMLHttpRequestSupported=!1}e.Sender=hn,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-channel-js.min.js.map
{
"name": "@microsoft/applicationinsights-channel-js",
"version": "2.0.0-rc4",
"version": "2.0.0-rc5",
"description": "Microsoft Application Insights JavaScript SDK Channel",

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

"dependencies": {
"@microsoft/applicationinsights-core-js": "2.0.0-rc4",
"@microsoft/applicationinsights-common": "2.0.0-rc4",
"@microsoft/applicationinsights-core-js": "2.0.0-rc5",
"@microsoft/applicationinsights-common": "2.0.0-rc5",
"tslib": "^1.9.3"

@@ -35,0 +35,0 @@ },

@@ -5,3 +5,3 @@ # Microsoft Application Insights JavaScript SDK - Channel

[![Build Status](https://travis-ci.org/Microsoft/applicationinsights-js.svg?branch=master)](https://travis-ci.org/Microsoft/applicationinsights-js)
[![Build Status](https://travis-ci.org/microsoft/applicationinsights-js.svg?branch=master)](https://travis-ci.org/microsoft/applicationinsights-js)
[![Build status](https://dev.azure.com/mseng/AppInsights/_apis/build/status/1DS%20JavaScript%20SDK%20-%20Channel)](https://dev.azure.com/mseng/AppInsights/_build/latest?definitionId=7614)

@@ -8,0 +8,0 @@ [![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-channel-js.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-channel-js)

@@ -21,3 +21,3 @@ import {

export abstract class EnvelopeCreator {
public static Version = "2.0.0-rc4";
public static Version = "2.0.0-rc5";
protected _logger: IDiagnosticLogger;

@@ -24,0 +24,0 @@

@@ -23,3 +23,4 @@ import { ISenderConfig, XDomainRequest as IXDomainRequest, IBackendResponse } from './Interfaces';

ConfigurationManager, IConfig,
ProcessLegacy
ProcessLegacy,
BreezeChannelIdentifier
} from '@microsoft/applicationinsights-common';

@@ -41,3 +42,3 @@ import {

public identifier: string;
public identifier: string = BreezeChannelIdentifier;

@@ -117,6 +118,2 @@ public pause(): void {

constructor() {
this.identifier = "AppInsightsChannelPlugin"
}
public initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[]) :void {

@@ -123,0 +120,0 @@ this._logger = core.logger;

@@ -51,3 +51,2 @@ import { ISenderConfig, XDomainRequest as IXDomainRequest, IBackendResponse } from './Interfaces';

private _serializer;
constructor();
initialize(config: IConfiguration & IConfig, core: IAppInsightsCore, extensions: IPlugin[]): void;

@@ -54,0 +53,0 @@ processTelemetry(telemetryItem: ITelemetryItem): void;

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