Socket
Socket
Sign inDemoInstall

@microsoft/applicationinsights-core-js

Package Overview
Dependencies
Maintainers
4
Versions
561
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 2.5.4 to 2.5.5

dist-esm/JavaScriptSDK.Enums/SendRequestReason.js

4

browser/applicationinsights-core-js.min.js
/*!
* Application Insights JavaScript SDK - Core, 2.5.4
* Application Insights JavaScript SDK - Core, 2.5.5
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(c){"use strict";var n={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},i=function(e,n){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])})(e,n)};function e(e,n){function t(){this.constructor=e}i(e,n),e.prototype=null===n?function(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if("object"!=t&&"function"!=t)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i.prototype=e,new i}(n):(t.prototype=n.prototype,new t)}var t="undefined",r="object",f="prototype",g="function",o="window",a="JSON";function s(){return typeof globalThis!==t&&globalThis?globalThis:typeof self!==t&&self?self:typeof window!==t&&window?window:typeof global!==t&&global?global:null}function l(e){var n=s();return n&&n[e]?n[e]:e===o&&u()?window:null}function u(){return!(typeof window!==r||!window)}function d(){return u()?window:l(o)}function p(){return!(typeof document!==r||!document)}function h(){return p()?document:l("document")}function v(){return!(typeof navigator!==r||!navigator)}function y(){return!(typeof history!==r||!history)}function m(){return!!(typeof JSON===r&&JSON||null!==l(a))}function x(){return m()?JSON||l(a):null}var C=t,T="attachEvent",I="addEventListener",w="detachEvent",N="removeEventListener";function S(e,n){return typeof e===n}function b(e){return S(e,t)||e===undefined}function _(e){return b(e)||null===e}function L(e,n){return e&&Object[f].hasOwnProperty.call(e,n)}function E(e){return S(e,r)}function F(e){return S(e,g)}function M(e,n,t,i){void 0===i&&(i=!1);var r=!1;if(!_(e))try{_(e[I])?_(e[T])||(e[T]("on"+n,t),r=!0):(e[I](n,t,i),r=!0)}catch(o){}return r}function P(e,n,t,i){if(void 0===i&&(i=!1),!_(e))try{_(e[N])?_(e[w])||e[w]("on"+n,t):e[N](n,t,i)}catch(r){}}var O=(A.isDate=function(e){return"[object Date]"===Object[f].toString.call(e)},A.isString=function(e){return S(e,"string")},A.isNumber=function(e){return S(e,"number")},A.isBoolean=function(e){return S(e,"boolean")},A.disableCookies=function(){A._canUseCookies=!1},A.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(j,function(e){var n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})},A.toISOString=function(e){if(A.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},A.arrForEach=function(e,n,t){for(var i=e.length,r=0;r<i;++r)r in e&&n.call(t||e,e[r],r,e)},A.arrIndexOf=function(e,n,t){for(var i=e.length,r=t||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===n)return o;return-1},A.arrMap=function(e,n,t){for(var i=e.length,r=t||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=n.call(r,e[a],e));return o},A.arrReduce=function(e,n,t){var i,r=e.length,o=0;if(3<=arguments.length)i=t;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=n(i,e[o],o,e)),o++;return i},A.objCreate=function(e){if(null==e)return{};if(!E(e)&&!F(e))throw new TypeError("Object prototype may only be an Object: "+e);function n(){}return n[f]=e,new n},A.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(F(e)||E(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var i in e)L(e,i)&&t.push(i);if(n)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)L(e,r[a])&&t.push(r[a]);return t},A.objDefineAccessors=function(e,n,t,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),i&&(o.set=i),r(e,n,o),!0}catch(a){}return!1},A.addEventHandler=function(e,n){var t=!1,i=d();i&&(t=M(i,e,n),t=M(i.body,e,n)||t);var r=h();return r&&(t=U.Attach(r,e,n)||t),t},A.isTypeof=S,A.isUndefined=b,A.isNullOrUndefined=_,A.hasOwnProperty=L,A.isFunction=F,A.isObject=E,A);function A(){}var D,j=/[xy]/g,U=(R.Attach=M,R.AttachEvent=M,R.Detach=P,R.DetachEvent=P,R);function R(){}(D=c.LoggingSeverity||(c.LoggingSeverity={}))[D.CRITICAL=1]="CRITICAL",D[D.WARNING=2]="WARNING";var k={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73},z=(B.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},B.dataType="MessageData",B.AiNonUserActionablePrefix="AI (Internal): ",B.AiUserActionablePrefix="AI: ",B);function B(e,n,t,i){void 0===t&&(t=!1),this.messageId=e,this.message=(t?B.AiUserActionablePrefix:B.AiNonUserActionablePrefix)+e;var r="";m()&&(r=x().stringify(i));var o=(n?" message:"+B.sanitizeDiagnosticText(n):"")+(i?" props:"+B.sanitizeDiagnosticText(r):"");this.message+=o}var Q=(V.prototype.throwInternal=function(e,n,t,i,r){void 0===r&&(r=!1);var o=new z(n,t,r,i),a=this;if(a.enableDebugExceptions())throw o;if(!O.isUndefined(o)&&o&&!O.isUndefined(o.message)){if(r){var s=+o.messageId;!a._messageLogged[s]&&a.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(a.warnToConsole(o.message),a._messageLogged[s]=!0)}else a.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&a.warnToConsole(o.message);a.logInternalMessage(e,o)}},V.prototype.warnToConsole=function(e){!O.isUndefined(console)&&console&&(O.isFunction(console.warn)?console.warn(e):O.isFunction(console.log)&&console.log(e))},V.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},V.prototype.logInternalMessage=function(e,n){var t=this;if(!t._areInternalMessagesThrottled()){var i=!0,r=t.AIInternalMessagePrefix+n.messageId;if(t._messageLogged[r]?i=!1:t._messageLogged[r]=!0,i&&(e<=t.telemetryLoggingLevel()&&(t.queue.push(n),t._messageCount++),t._messageCount===t.maxInternalMessageLimit())){var o="Internal events throttle limit per PageView reached for this app.",a=new z(k.MessageLimitPerPVExceeded,o,!1);t.queue.push(a),t.warnToConsole(o)}}},V.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},V);function V(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},O.isNullOrUndefined(e)||(O.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),O.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),O.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),O.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var W=O.isFunction,H=function(r,o){var a=this,s=null,l=W(r.processTelemetry),u=W(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,n){if(n=n||o,r&&l){a._hasRun=!0;try{n.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,n)}catch(i){var t=s&&s._hasRun;s&&t||n.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,k.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!t&&s.processTelemetry(e,n)}}else s&&(a._hasRun=!0,s.processTelemetry(e,n))}},K=O.isNullOrUndefined;function q(e,n){var t=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o=e[r];if(o&&O.isFunction(o.processTelemetry)){var a=new H(o,n);t.push(a),i&&i.setNext(a),i=a}}return 0<t.length?t[0]:null}var G=function _e(e,o,t,n){var i,r,a,s,l=this,u=null;null!==n&&(e&&O.isFunction(e.getPlugin)?u=function(e,n,t){var i=[],r=!t;if(e)for(;e;){var o=e.getPlugin();!r&&o!==t||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(t),q(i,n)}(e,l,n||e.getPlugin()):n?(i=l,a=e,s=!1,(r=n)&&e&&(a=[],O.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=q(a,i)):O.isUndefined(n)&&(u=q(e,l))),l.core=function(){return t},l.diagLog=function(){return(t||{}).logger||new Q(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,n){var t;if(void 0===n&&(n={}),o){var i=o.extensionConfig;i&&e&&(t=i[e])}return t||n},l.getConfig=function(e,n,t){var i;void 0===t&&(t=!1);var r=l.getExtCfg(e,null);return r&&!K(r[n])?i=r[n]:o&&!K(o[n])&&(i=o[n]),K(i)?t:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,l))},l.createNew=function(e,n){return void 0===e&&(e=null),new _e(e||u,o,t,n)}},J=O.isFunction,Z="getPlugin",Y=($.prototype.initialize=function(e,n,t,i){this._baseTelInit(e,n,t,i)},$);function $(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,n){n?n.processNext(e):l&&J(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;if(!n){var t=s||new G(null,{},o.core);n=l&&l[Z]?t.createNew(null,l[Z]):t.createNew(null,l)}return n},o._baseTelInit=function(e,n,t,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&n&&(i=n.getProcessTelContext().getNext());var r=l;l&&l[Z]&&(r=l[Z]()),o.core=n,s=new G(i,e,n,r),a=!0}}var X=O.isFunction,ee="processTelemetry",ne="priority",te="setNextPlugin",ie="isInitialized";function re(n,t){for(var e=[],i=null,r=n.getNext();r;){var o=r.getPlugin();o&&(i&&X(i[te])&&X(o[ee])&&i[te](o),X(o[ie])&&o[ie]()||e.push(o),i=o,r=r.getNext())}O.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function oe(e){return e.sort(function(e,n){var t=0,i=X(n[ee]);return X(e[ee])?t=i?e[ne]-n[ne]:1:i&&(t=-1),t})}var ae=O.arrForEach,se=O.objDefineAccessors;function le(e,n){var t;n&&0<n.length&&(t=n=n.sort(function(e,n){return e.priority-n.priority}),ae(t,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(n))}var ue,ce=(e(fe,ue=Y),fe.prototype.processTelemetry=function(n,t){var i=this;this._channelQueue&&ae(this._channelQueue,function(e){0<e.length&&i._getTelCtx(t).createNew(e).processNext(n)})},fe.prototype.getChannelControls=function(){return this._channelQueue},fe.prototype.initialize=function(n,t,i){if(!this.isInitialized()){ue.prototype.initialize.call(this,n,t,i),n.isCookieUseDisabled&&O.disableCookies();var e=this._channelQueue=function(e,n){var t=[];if(e&&ae(e,function(e){return le(t,e)}),n){var i=[];ae(n,function(e){500<e.priority&&i.push(e)}),le(t,i)}return t}((n||{}).channels,i);ae(e,function(e){return re(new G(e,n,t),i)})}},fe._staticInit=(se(fe.prototype,"ChannelControls",fe.prototype.getChannelControls),void se(fe.prototype,"channelQueue",fe.prototype.getChannelControls)),fe);function fe(){var e=null!==ue&&ue.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var ge=O.arrForEach,de=O.isNullOrUndefined,pe=(he.prototype.initialize=function(e,n,i,t){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||de(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;t=t||O.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){}}),r._notificationManager=t,e.extensions=de(e.extensions)?[]:e.extensions,(e.extensionConfig=de(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,i=i||O.objCreate({throwInternal:function(e,n,t,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,n.concat(e.extensions)),a=oe(a);var s=[],l={};if(ge(a,function(e){if(de(e)||de(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(de(l[n])?l[n]=t:i.warnToConsole("Two extensions have same priority #"+n+" - "+l[n]+", "+t)),(!n||n<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=oe(a),r._extensions=a,re(new G([o],e,r),a),re(new G(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0)},he.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},he.prototype.track=function(e){var n=this;e.iKey||(e.iKey=n.config.instrumentationKey),e.time||(e.time=O.toISOString(new Date)),de(e.ver)&&(e.ver="4.0"),n.isInitialized()?(0<n._eventQueue.length&&(ge(n._eventQueue,function(e){n.getProcessTelContext().processNext(e)}),n._eventQueue=[]),n.getProcessTelContext().processNext(e)):n._eventQueue.push(e)},he.prototype.getProcessTelContext=function(){var e=this._extensions,n=e;return e&&0!==e.length||(n=[this._channelController]),new G(n,this.config,this)},he);function he(){var n=!1,e=this;e._extensions=[],e._channelController=new ce,e.isInitialized=function(){return n},e._setInit=function(e){n=e},e._eventQueue=[]}var ve=(ye.prototype.addNotificationListener=function(e){this.listeners.push(e)},ye.prototype.removeNotificationListener=function(e){for(var n=O.arrIndexOf(this.listeners,e);-1<n;)this.listeners.splice(n,1),n=O.arrIndexOf(this.listeners,e)},ye.prototype.eventsSent=function(n){for(var t=this,e=function(e){i.listeners[e].eventsSent&&setTimeout(function(){return t.listeners[e].eventsSent(n)},0)},i=this,r=0;r<this.listeners.length;++r)e(r)},ye.prototype.eventsDiscarded=function(n,t){for(var i=this,e=function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(n,t)},0)},r=this,o=0;o<this.listeners.length;++o)e(o)},ye);function ye(){this.listeners=[]}var me,xe=(e(Ce,me=pe),Ce.prototype.initialize=function(e,n){var t=this;t._notificationManager=new ve,t.logger=new Q(e),t.config=e,me.prototype.initialize.call(this,e,n,t.logger,t._notificationManager)},Ce.prototype.getTransmissionControls=function(){return me.prototype.getTransmissionControls.call(this)},Ce.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),me.prototype.track.call(this,e)},Ce.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},Ce.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},Ce.prototype.pollInternalLogs=function(i){var n=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var t=n,e=t.logger?t.logger.queue:[];O.arrForEach(e,function(e){var n={name:i||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:O.toISOString(new Date),baseType:z.dataType,baseData:{message:e.message}};t.track(n)}),e.length=0},e)},Ce.prototype._validateTelemetryItem=function(e){if(O.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},Ce.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],n.InvalidEvent)},Ce);function Ce(){return me.call(this)||this}var Te="_aiHooks",Ie=["req","rsp","hkErr","fnErr"];function we(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Ne(e,l,u,c,f){0<=f&&f<=2&&we(e,function(e,n){var t=e.cbks,i=t[Ie[f]];if(i){l.ctx=function(){return c[n]=c[n]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=t[Ie[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Se(e,n,t,i){if(void 0===i&&(i=!0),e&&n&&t){var r=function c(e,n,t){var i=null;return e&&(O.hasOwnProperty(e,n)?i=e:t&&(i=c(e[f],n,!1))),i}(e,n,i),o=r[n];if(typeof o===g){var a=o[Te];if(!a){var s=(u=a={i:0,n:n,f:o,h:[]},function(){var t=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,r=o([i],t)}},n=[],r=o([i],t);function o(n,e){return we(e,function(e){n.push(e)}),n}Ne(e,i,r,n,0);var a=u.f;try{i.rslt=a.apply(this,t)}catch(s){throw i.err=s,Ne(e,i,r,n,3),s}return Ne(e,i,r,n,1),i.rslt});s[Te]=a,r[n]=s}var l={id:a.i,cbks:t,rm:function(){var t=this.id;we(a.h,function(e,n){return e.id===t&&(a.h.splice(n,1),1)})}};return a.i++,a.h.push(l),l}}var u;return null}function be(t,e,i,r){void 0===r&&(r=!0);var o=null;return we(e,function(e){var n=Se(t,e,i,r);n&&(o=o||[]).push(n)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=n,c.AppInsightsCore=xe,c.BaseCore=pe,c.BaseTelemetryPlugin=Y,c.CoreUtils=O,c.EventHelper=U,c.Undefined=C,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=s,c.getGlobalInst=l,c.hasWindow=u,c.getWindow=d,c.hasDocument=p,c.getDocument=h,c.hasNavigator=v,c.getNavigator=function(){return v()?navigator:l("navigator")},c.hasHistory=y,c.getHistory=function(){return y()?history:l("history")},c.getLocation=function(){return typeof location===r&&location?location:l("location")},c.getPerformance=function(){return l("performance")},c.hasJSON=m,c.getJSON=x,c.strUndefined=t,c.strObject=r,c.strPrototype=f,c.strFunction=g,c.NotificationManager=ve,c.DiagnosticLogger=Q,c._InternalLogMessage=z,c.ProcessTelemetryContext=G,c.initializePlugins=re,c.sortPlugins=oe,c._InternalMessageId=k,c.InstrumentProto=function(e,n,t){return e?Se(e[f],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?be(e[f],n,t,!1):null},c.InstrumentFunc=Se,c.InstrumentFuncs=be,function(e,n,t){var i=Object.defineProperty;if(i)try{return i(e,n,t)}catch(r){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(c){"use strict";var r="function",o="object",n="undefined",a="prototype",s="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function i(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if(t!=o&&t!=r)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i[a]=e,new i}var l=function(e,n){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[s](t)&&(e[t]=n[t])})(e,n)},t=e()||{};__assign=t.__assign=t.__assign||Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object[a][s].call(n,r)&&(e[r]=n[r]);return e},__extends=t.__extends=t.__extends||function(e,n){function t(){this.constructor=e}l(e,n),e[a]=null===n?i(n):(t[a]=n[a],new t)};var u={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=o,d=a,h=r,p="window",v="JSON",y=e;function m(e){var n=y();return n&&n[e]?n[e]:e===p&&x()?window:null}function x(){return!(typeof window!==g||!window)}function C(){return x()?window:m(p)}function T(){return!(typeof document!==g||!document)}function I(){return T()?document:m("document")}function _(){return!(typeof navigator!==g||!navigator)}function w(){return!(typeof history!==g||!history)}function S(){return!!(typeof JSON===g&&JSON||null!==m(v))}function N(){return S()?JSON||m(v):null}var b=n,L="attachEvent",E="addEventListener",F="detachEvent",M="removeEventListener";function P(e,n){return typeof e===n}function A(e){return P(e,n)||e===undefined}function O(e){return A(e)||null===e}function D(e,n){return e&&Object[a].hasOwnProperty.call(e,n)}function R(e){return P(e,o)}function U(e){return P(e,r)}function j(e,n,t,i){void 0===i&&(i=!1);var r=!1;if(!O(e))try{O(e[E])?O(e[L])||(e[L]("on"+n,t),r=!0):(e[E](n,t,i),r=!0)}catch(o){}return r}function k(e,n,t,i){if(void 0===i&&(i=!1),!O(e))try{O(e[M])?O(e[F])||e[F]("on"+n,t):e[M](n,t,i)}catch(r){}}var z=(B.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},B.isString=function(e){return P(e,"string")},B.isNumber=function(e){return P(e,"number")},B.isBoolean=function(e){return P(e,"boolean")},B.disableCookies=function(){B._canUseCookies=!1},B.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Q,function(e){var n,t=0|((n=m("crypto"))?n.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?t:3&t|8).toString(16)})},B.toISOString=function(e){if(B.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},B.arrForEach=function(e,n,t){for(var i=e.length,r=0;r<i;++r)r in e&&n.call(t||e,e[r],r,e)},B.arrIndexOf=function(e,n,t){for(var i=e.length,r=t||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===n)return o;return-1},B.arrMap=function(e,n,t){for(var i=e.length,r=t||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=n.call(r,e[a],e));return o},B.arrReduce=function(e,n,t){var i,r=e.length,o=0;if(3<=arguments.length)i=t;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=n(i,e[o],o,e)),o++;return i},B.strTrim=function(e){return B.isString(e)?e.replace(/^\s+|\s+$/g,""):e},B.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(U(e)||R(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var i in e)D(e,i)&&t.push(i);if(n)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)D(e,r[a])&&t.push(r[a]);return t},B.objDefineAccessors=function(e,n,t,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),i&&(o.set=i),r(e,n,o),!0}catch(a){}return!1},B.addEventHandler=function(e,n){var t=!1,i=C();i&&(t=j(i,e,n),t=j(i.body,e,n)||t);var r=I();return r&&(t=V.Attach(r,e,n)||t),t},B.isTypeof=P,B.isUndefined=A,B.isNullOrUndefined=O,B.hasOwnProperty=D,B.isFunction=U,B.isObject=R,B.objCreate=i,B);function B(){}var q,Q=/[xy]/g,V=(W.Attach=j,W.AttachEvent=j,W.Detach=k,W.DetachEvent=k,W);function W(){}(q=c.LoggingSeverity||(c.LoggingSeverity={}))[q.CRITICAL=1]="CRITICAL",q[q.WARNING=2]="WARNING";var H={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99},K=(G.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},G.dataType="MessageData",G.AiNonUserActionablePrefix="AI (Internal): ",G.AiUserActionablePrefix="AI: ",G);function G(e,n,t,i){void 0===t&&(t=!1),this.messageId=e,this.message=(t?G.AiUserActionablePrefix:G.AiNonUserActionablePrefix)+e;var r="";S()&&(r=N().stringify(i));var o=(n?" message:"+G.sanitizeDiagnosticText(n):"")+(i?" props:"+G.sanitizeDiagnosticText(r):"");this.message+=o}var J=(Z.prototype.throwInternal=function(e,n,t,i,r){void 0===r&&(r=!1);var o,a=new K(n,t,r,i),s=this;if(s.enableDebugExceptions())throw a;!z.isUndefined(a)&&a&&(z.isUndefined(a.message)||(r?(o=+a.messageId,!s._messageLogged[o]&&s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(s.warnToConsole(a.message),s._messageLogged[o]=!0)):s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&s.warnToConsole(a.message),s.logInternalMessage(e,a)))},Z.prototype.warnToConsole=function(e){!z.isUndefined(console)&&console&&(z.isFunction(console.warn)?console.warn(e):z.isFunction(console.log)&&console.log(e))},Z.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},Z.prototype.logInternalMessage=function(e,n){var t,i,r,o=this;o._areInternalMessagesThrottled()||(t=!0,i=o.AIInternalMessagePrefix+n.messageId,o._messageLogged[i]?t=!1:o._messageLogged[i]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),o._messageCount++),o._messageCount===o.maxInternalMessageLimit()&&(r=new K(H.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),o.warnToConsole("Internal events throttle limit per PageView reached for this app."))))},Z.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},Z);function Z(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},z.isNullOrUndefined(e)||(z.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),z.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),z.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),z.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var $=z.isFunction,Y=function(r,o){var a=this,s=null,l=$(r.processTelemetry),u=$(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,n){if(n=n||o,r&&l){a._hasRun=!0;try{n.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,n)}catch(i){var t=s&&s._hasRun;s&&t||n.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,H.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!t&&s.processTelemetry(e,n)}}else s&&(a._hasRun=!0,s.processTelemetry(e,n))}},X=z.isNullOrUndefined;function ee(e,n){var t=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o,a=e[r];a&&z.isFunction(a.processTelemetry)&&(o=new Y(a,n),t.push(o),i&&i.setNext(o),i=o)}return 0<t.length?t[0]:null}var ne=function Oe(e,o,t,n){var i,r,a,s,l=this,u=null;null!==n&&(e&&z.isFunction(e.getPlugin)?u=function(e,n,t){var i=[],r=!t;if(e)for(;e;){var o=e.getPlugin();!r&&o!==t||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(t),ee(i,n)}(e,l,n||e.getPlugin()):n?(i=l,a=e,s=!1,(r=n)&&e&&(a=[],z.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=ee(a,i)):z.isUndefined(n)&&(u=ee(e,l))),l.core=function(){return t},l.diagLog=function(){return(t||{}).logger||new J(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,n){var t,i;return void 0===n&&(n={}),!o||(i=o.extensionConfig)&&e&&(t=i[e]),t||n},l.getConfig=function(e,n,t){var i;void 0===t&&(t=!1);var r=l.getExtCfg(e,null);return r&&!X(r[n])?i=r[n]:o&&!X(o[n])&&(i=o[n]),X(i)?t:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,l))},l.createNew=function(e,n){return void 0===e&&(e=null),new Oe(e||u,o,t,n)}},te=z.isFunction,ie="getPlugin",re=(oe.prototype.initialize=function(e,n,t,i){this._baseTelInit(e,n,t,i)},oe);function oe(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,n){n?n.processNext(e):l&&te(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n,t=e;return t||(n=s||new ne(null,{},o.core),t=l&&l[ie]?n.createNew(null,l[ie]):n.createNew(null,l)),t},o._baseTelInit=function(e,n,t,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&n&&(i=n.getProcessTelContext().getNext());var r=l;l&&l[ie]&&(r=l[ie]()),o.core=n,s=new ne(i,e,n,r),a=!0}}var ae=z.isFunction,se="processTelemetry",le="priority",ue="setNextPlugin",ce="isInitialized";function fe(n,t){for(var e=[],i=null,r=n.getNext();r;){var o=r.getPlugin();o&&(i&&ae(i[ue])&&ae(o[se])&&i[ue](o),ae(o[ce])&&o[ce]()||e.push(o),i=o,r=r.getNext())}z.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function ge(e){return e.sort(function(e,n){var t=0,i=ae(n[se]);return ae(e[se])?t=i?e[le]-n[le]:1:i&&(t=-1),t})}var de=z.arrForEach,he=z.objDefineAccessors;function pe(e,n){n&&0<n.length&&(n=n.sort(function(e,n){return e.priority-n.priority}),de(n,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(n))}var ve,ye=(ve=re,__extends(me,ve),me.prototype.processTelemetry=function(n,t){var i=this;this._channelQueue&&de(this._channelQueue,function(e){0<e.length&&i._getTelCtx(t).createNew(e).processNext(n)})},me.prototype.getChannelControls=function(){return this._channelQueue},me.prototype.initialize=function(n,t,i){var e,r,o,a,s;this.isInitialized()||(ve.prototype.initialize.call(this,n,t,i),n.isCookieUseDisabled&&z.disableCookies(),e=this._channelQueue=(o=i,s=[],(r=(n||{}).channels)&&de(r,function(e){return pe(s,e)}),o&&(a=[],de(o,function(e){500<e.priority&&a.push(e)}),pe(s,a)),s),de(e,function(e){return fe(new ne(e,n,t),i)}))},me._staticInit=(he(me.prototype,"ChannelControls",me.prototype.getChannelControls),void he(me.prototype,"channelQueue",me.prototype.getChannelControls)),me);function me(){var e=null!==ve&&ve.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var xe=z.arrForEach,Ce=z.isNullOrUndefined,Te=(Ie.prototype.initialize=function(e,n,i,t){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Ce(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;t=t||z.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),r._notificationManager=t,e.extensions=Ce(e.extensions)?[]:e.extensions,(e.extensionConfig=Ce(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,i=i||z.objCreate({throwInternal:function(e,n,t,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,n.concat(e.extensions)),a=ge(a);var s=[],l={};if(xe(a,function(e){if(Ce(e)||Ce(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(Ce(l[n])?l[n]=t:i.warnToConsole("Two extensions have same priority #"+n+" - "+l[n]+", "+t)),(!n||n<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=ge(a),r._extensions=a,fe(new ne([o],e,r),a),fe(new ne(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0)},Ie.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ie.prototype.track=function(e){var n=this;e.iKey||(e.iKey=n.config.instrumentationKey),e.time||(e.time=z.toISOString(new Date)),Ce(e.ver)&&(e.ver="4.0"),n.isInitialized()?(0<n._eventQueue.length&&(xe(n._eventQueue,function(e){n.getProcessTelContext().processNext(e)}),n._eventQueue=[]),n.getProcessTelContext().processNext(e)):n._eventQueue.push(e)},Ie.prototype.getProcessTelContext=function(){var e=this._extensions,n=e;return e&&0!==e.length||(n=[this._channelController]),new ne(n,this.config,this)},Ie);function Ie(){var n=!1,e=this;e._extensions=[],e._channelController=new ye,e.isInitialized=function(){return n},e._setInit=function(e){n=e},e._eventQueue=[]}var _e=(we.prototype.addNotificationListener=function(e){this.listeners.push(e)},we.prototype.removeNotificationListener=function(e){for(var n=z.arrIndexOf(this.listeners,e);-1<n;)this.listeners.splice(n,1),n=z.arrIndexOf(this.listeners,e)},we.prototype.eventsSent=function(n){for(var t=this,i=this,e=0;e<this.listeners.length;++e)!function(e){i.listeners[e].eventsSent&&setTimeout(function(){return t.listeners[e].eventsSent(n)},0)}(e)},we.prototype.eventsDiscarded=function(n,t){for(var i=this,r=this,e=0;e<this.listeners.length;++e)!function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(n,t)},0)}(e)},we.prototype.eventsSendRequest=function(t,i){for(var r=this,o=this,e=0;e<this.listeners.length;++e)!function(e){if(o.listeners[e].eventsSendRequest)if(i)setTimeout(function(){return r.listeners[e].eventsSendRequest(t,i)},0);else try{o.listeners[e].eventsSendRequest(t,i)}catch(n){}}(e)},we);function we(){this.listeners=[]}var Se,Ne=(Se=Te,__extends(be,Se),be.prototype.initialize=function(e,n){var t=this;t._notificationManager=new _e,t.logger=new J(e),t.config=e,Se.prototype.initialize.call(this,e,n,t.logger,t._notificationManager)},be.prototype.getTransmissionControls=function(){return Se.prototype.getTransmissionControls.call(this)},be.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Se.prototype.track.call(this,e)},be.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},be.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},be.prototype.pollInternalLogs=function(i){var n=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var t=n,e=t.logger?t.logger.queue:[];z.arrForEach(e,function(e){var n={name:i||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:z.toISOString(new Date),baseType:K.dataType,baseData:{message:e.message}};t.track(n)}),e.length=0},e)},be.prototype._validateTelemetryItem=function(e){if(z.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},be.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u.InvalidEvent)},be);function be(){return Se.call(this)||this}var Le="_aiHooks",Ee=["req","rsp","hkErr","fnErr"];function Fe(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Me(e,l,u,c,f){0<=f&&f<=2&&Fe(e,function(e,n){var t=e.cbks,i=t[Ee[f]];if(i){l.ctx=function(){return c[n]=c[n]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=t[Ee[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Pe(e,n,t,i){if(void 0===i&&(i=!0),e&&n&&t){var r=function c(e,n,t){var i=null;return e&&(z.hasOwnProperty(e,n)?i=e:t&&(i=c(e[d],n,!1))),i}(e,n,i),o=r[n];if(typeof o===h){var a,s=o[Le];s||(u=s={i:0,n:n,f:o,h:[]},(a=function(){var t=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,r=o([i],t)}},n=[],r=o([i],t);function o(n,e){return Fe(e,function(e){n.push(e)}),n}Me(e,i,r,n,0);var a=u.f;try{i.rslt=a.apply(this,t)}catch(s){throw i.err=s,Me(e,i,r,n,3),s}return Me(e,i,r,n,1),i.rslt})[Le]=s,r[n]=a);var l={id:s.i,cbks:t,rm:function(){var t=this.id;Fe(s.h,function(e,n){return e.id===t&&(s.h.splice(n,1),1)})}};return s.i++,s.h.push(l),l}}var u;return null}function Ae(t,e,i,r){void 0===r&&(r=!0);var o=null;return Fe(e,function(e){var n=Pe(t,e,i,r);n&&(o=o||[]).push(n)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=u,c.AppInsightsCore=Ne,c.BaseCore=Te,c.BaseTelemetryPlugin=re,c.CoreUtils=z,c.EventHelper=V,c.Undefined=b,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=y,c.getGlobalInst=m,c.hasWindow=x,c.getWindow=C,c.hasDocument=T,c.getDocument=I,c.hasNavigator=_,c.getNavigator=function(){return _()?navigator:m("navigator")},c.hasHistory=w,c.getHistory=function(){return w()?history:m("history")},c.getLocation=function(){return typeof location===g&&location?location:m("location")},c.getPerformance=function(){return m("performance")},c.hasJSON=S,c.getJSON=N,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=h,c.NotificationManager=_e,c.DiagnosticLogger=J,c._InternalLogMessage=K,c.ProcessTelemetryContext=ne,c.initializePlugins=fe,c.sortPlugins=ge,c._InternalMessageId=H,c.InstrumentProto=function(e,n,t){return e?Pe(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?Ae(e[d],n,t,!1):null},c.InstrumentFunc=Pe,c.InstrumentFuncs=Ae,function(e,n,t){var i=Object.defineProperty;if(i)try{return i(e,n,t)}catch(r){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-core-js.min.js.map

@@ -0,1 +1,4 @@

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import '@microsoft/applicationinsights-shims';
export { MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";

@@ -2,0 +5,0 @@ export { EventsDiscardedReason } from "./JavaScriptSDK.Enums/EventsDiscardedReason";

@@ -93,4 +93,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

SendBrowserInfoOnUserInit: 72,
PluginException: 73
PluginException: 73,
NotificationException: 74,
SnippetScriptLoadFailure: 99
};
//# sourceMappingURL=LoggingEnums.js.map

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

import * as tslib_1 from "tslib";
import { BaseCore } from './BaseCore';

@@ -9,3 +8,3 @@ import { EventsDiscardedReason } from "../JavaScriptSDK.Enums/EventsDiscardedReason";

var AppInsightsCore = /** @class */ (function (_super) {
tslib_1.__extends(AppInsightsCore, _super);
__extends(AppInsightsCore, _super);
function AppInsightsCore() {

@@ -12,0 +11,0 @@ return _super.call(this) || this;

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

eventsSent: function (events) { },
eventsDiscarded: function (events, reason) { }
eventsDiscarded: function (events, reason) { },
eventsSendRequest: function (sendReason, isAsync) { }
});

@@ -41,0 +42,0 @@ }

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
import * as tslib_1 from "tslib";
import { CoreUtils } from "./CoreUtils";

@@ -48,3 +47,3 @@ import { BaseTelemetryPlugin } from './BaseTelemetryPlugin';

var ChannelController = /** @class */ (function (_super) {
tslib_1.__extends(ChannelController, _super);
__extends(ChannelController, _super);
function ChannelController() {

@@ -51,0 +50,0 @@ var _this = _super !== null && _super.apply(this, arguments) || this;

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
import { getWindow, getDocument, strUndefined, strObject, strFunction, strPrototype } from './EnvUtils';
import { objCreateFn, strShimObject, strShimUndefined, strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims";
import { getWindow, getDocument, getCrypto } from './EnvUtils';
// Added to help with minfication
export var Undefined = strUndefined;
export var Undefined = strShimUndefined;
var strOnPrefix = "on";

@@ -17,3 +18,3 @@ var strAttachEvent = "attachEvent";

function _isUndefined(value) {
return _isTypeof(value, strUndefined) || value === undefined;
return _isTypeof(value, strShimUndefined) || value === undefined;
}

@@ -25,11 +26,11 @@ ;

function _hasOwnProperty(obj, prop) {
return obj && Object[strPrototype].hasOwnProperty.call(obj, prop);
return obj && Object[strShimPrototype].hasOwnProperty.call(obj, prop);
}
;
function _isObject(value) {
return _isTypeof(value, strObject);
return _isTypeof(value, strShimObject);
}
;
function _isFunction(value) {
return _isTypeof(value, strFunction);
return _isTypeof(value, strShimFunction);
}

@@ -112,3 +113,3 @@ ;

CoreUtils.isDate = function (obj) {
return Object[strPrototype].toString.call(obj) === "[object Date]";
return Object[strShimPrototype].toString.call(obj) === "[object Date]";
};

@@ -147,4 +148,11 @@ /**

CoreUtils.newGuid = function () {
function randomHexDigit() {
var c = getCrypto();
if (c) {
return (c.getRandomValues(new Uint8Array(1))[0] % 16);
}
return Math.random() * 16;
}
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, function (c) {
var r = (Math.random() * 16 | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);
var r = (randomHexDigit() | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);
return v.toString(16);

@@ -259,18 +267,9 @@ });

/**
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil
* for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.
* Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations
* @param obj Object to use as a prototype. May be null
* helper method to trim strings (IE8 does not implement String.prototype.trim)
*/
CoreUtils.objCreate = function (obj) {
if (obj == null) {
return {};
CoreUtils.strTrim = function (str) {
if (!CoreUtils.isString(str)) {
return str;
}
if (!_isObject(obj) && !_isFunction(obj)) {
throw new TypeError('Object prototype may only be an Object: ' + obj);
}
function tmpFunc() { }
;
tmpFunc[strPrototype] = obj;
return new tmpFunc();
return str.replace(/^\s+|\s+$/g, "");
};

@@ -382,2 +381,10 @@ /**

CoreUtils.isObject = _isObject;
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil
* for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.
* Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations
* @param obj Object to use as a prototype. May be null
*/
// tslint:disable-next-line: member-ordering
CoreUtils.objCreate = objCreateFn;
return CoreUtils;

@@ -384,0 +391,0 @@ }());

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
import { getGlobal as shimsGetGlobal, strShimUndefined, strShimObject, strShimPrototype, strShimFunction } from "@microsoft/applicationinsights-shims";
/**

@@ -10,6 +11,6 @@ * This file exists to hold environment utilities that are requied to check and

*/
export var strUndefined = "undefined";
export var strObject = "object";
export var strPrototype = "prototype";
export var strFunction = "function";
export var strUndefined = strShimUndefined;
export var strObject = strShimObject;
export var strPrototype = strShimPrototype;
export var strFunction = strShimFunction;
var strWindow = "window";

@@ -22,2 +23,3 @@ var strDocument = "document";

var strJSON = "JSON";
var strCrypto = "crypto";
/**

@@ -35,17 +37,3 @@ * Returns the current global scope object, for a normal web page this will be the current

*/
export function getGlobal() {
if (typeof globalThis !== strUndefined && globalThis) {
return globalThis;
}
if (typeof self !== strUndefined && self) {
return self;
}
if (typeof window !== strUndefined && window) {
return window;
}
if (typeof global !== strUndefined && global) {
return global;
}
return null;
}
export var getGlobal = shimsGetGlobal;
/**

@@ -192,2 +180,10 @@ * Return the named global object if available, will return null if the object is not available.

}
/**
* Returns the crypto object if it is present otherwise null.
* This helper is used to access the crypto object from the current
* global instance which could be window or globalThis for a web worker
*/
export function getCrypto() {
return getGlobalInst(strCrypto);
}
//# sourceMappingURL=EnvUtils.js.map

@@ -61,2 +61,29 @@ import { CoreUtils } from "./CoreUtils";

};
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
NotificationManager.prototype.eventsSendRequest = function (sendReason, isAsync) {
var _this = this;
var _loop_3 = function (i) {
if (this_3.listeners[i].eventsSendRequest) {
if (isAsync) {
setTimeout(function () { return _this.listeners[i].eventsSendRequest(sendReason, isAsync); }, 0);
}
else {
try {
this_3.listeners[i].eventsSendRequest(sendReason, isAsync);
}
catch (e) {
// Catch errors to ensure we don't block sending the requests
}
}
}
};
var this_3 = this;
for (var i = 0; i < this.listeners.length; ++i) {
_loop_3(i);
}
};
return NotificationManager;

@@ -63,0 +90,0 @@ }());

/*!
* Application Insights JavaScript SDK - Core, 2.5.4
* Application Insights JavaScript SDK - Core, 2.5.5
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(c){"use strict";var n={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},i=function(e,n){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n.hasOwnProperty(t)&&(e[t]=n[t])})(e,n)};function e(e,n){function t(){this.constructor=e}i(e,n),e.prototype=null===n?function(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if("object"!=t&&"function"!=t)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i.prototype=e,new i}(n):(t.prototype=n.prototype,new t)}var t="undefined",r="object",f="prototype",g="function",o="window",a="JSON";function s(){return typeof globalThis!==t&&globalThis?globalThis:typeof self!==t&&self?self:typeof window!==t&&window?window:typeof global!==t&&global?global:null}function l(e){var n=s();return n&&n[e]?n[e]:e===o&&u()?window:null}function u(){return!(typeof window!==r||!window)}function d(){return u()?window:l(o)}function p(){return!(typeof document!==r||!document)}function h(){return p()?document:l("document")}function v(){return!(typeof navigator!==r||!navigator)}function y(){return!(typeof history!==r||!history)}function m(){return!!(typeof JSON===r&&JSON||null!==l(a))}function x(){return m()?JSON||l(a):null}var C=t,T="attachEvent",I="addEventListener",w="detachEvent",N="removeEventListener";function S(e,n){return typeof e===n}function b(e){return S(e,t)||e===undefined}function _(e){return b(e)||null===e}function L(e,n){return e&&Object[f].hasOwnProperty.call(e,n)}function E(e){return S(e,r)}function F(e){return S(e,g)}function M(e,n,t,i){void 0===i&&(i=!1);var r=!1;if(!_(e))try{_(e[I])?_(e[T])||(e[T]("on"+n,t),r=!0):(e[I](n,t,i),r=!0)}catch(o){}return r}function P(e,n,t,i){if(void 0===i&&(i=!1),!_(e))try{_(e[N])?_(e[w])||e[w]("on"+n,t):e[N](n,t,i)}catch(r){}}var O=(A.isDate=function(e){return"[object Date]"===Object[f].toString.call(e)},A.isString=function(e){return S(e,"string")},A.isNumber=function(e){return S(e,"number")},A.isBoolean=function(e){return S(e,"boolean")},A.disableCookies=function(){A._canUseCookies=!1},A.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(j,function(e){var n=16*Math.random()|0;return("x"===e?n:3&n|8).toString(16)})},A.toISOString=function(e){if(A.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},A.arrForEach=function(e,n,t){for(var i=e.length,r=0;r<i;++r)r in e&&n.call(t||e,e[r],r,e)},A.arrIndexOf=function(e,n,t){for(var i=e.length,r=t||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===n)return o;return-1},A.arrMap=function(e,n,t){for(var i=e.length,r=t||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=n.call(r,e[a],e));return o},A.arrReduce=function(e,n,t){var i,r=e.length,o=0;if(3<=arguments.length)i=t;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=n(i,e[o],o,e)),o++;return i},A.objCreate=function(e){if(null==e)return{};if(!E(e)&&!F(e))throw new TypeError("Object prototype may only be an Object: "+e);function n(){}return n[f]=e,new n},A.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(F(e)||E(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var i in e)L(e,i)&&t.push(i);if(n)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)L(e,r[a])&&t.push(r[a]);return t},A.objDefineAccessors=function(e,n,t,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),i&&(o.set=i),r(e,n,o),!0}catch(a){}return!1},A.addEventHandler=function(e,n){var t=!1,i=d();i&&(t=M(i,e,n),t=M(i.body,e,n)||t);var r=h();return r&&(t=U.Attach(r,e,n)||t),t},A.isTypeof=S,A.isUndefined=b,A.isNullOrUndefined=_,A.hasOwnProperty=L,A.isFunction=F,A.isObject=E,A);function A(){}var D,j=/[xy]/g,U=(R.Attach=M,R.AttachEvent=M,R.Detach=P,R.DetachEvent=P,R);function R(){}(D=c.LoggingSeverity||(c.LoggingSeverity={}))[D.CRITICAL=1]="CRITICAL",D[D.WARNING=2]="WARNING";var k={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73},z=(B.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},B.dataType="MessageData",B.AiNonUserActionablePrefix="AI (Internal): ",B.AiUserActionablePrefix="AI: ",B);function B(e,n,t,i){void 0===t&&(t=!1),this.messageId=e,this.message=(t?B.AiUserActionablePrefix:B.AiNonUserActionablePrefix)+e;var r="";m()&&(r=x().stringify(i));var o=(n?" message:"+B.sanitizeDiagnosticText(n):"")+(i?" props:"+B.sanitizeDiagnosticText(r):"");this.message+=o}var Q=(V.prototype.throwInternal=function(e,n,t,i,r){void 0===r&&(r=!1);var o=new z(n,t,r,i),a=this;if(a.enableDebugExceptions())throw o;if(!O.isUndefined(o)&&o&&!O.isUndefined(o.message)){if(r){var s=+o.messageId;!a._messageLogged[s]&&a.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(a.warnToConsole(o.message),a._messageLogged[s]=!0)}else a.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&a.warnToConsole(o.message);a.logInternalMessage(e,o)}},V.prototype.warnToConsole=function(e){!O.isUndefined(console)&&console&&(O.isFunction(console.warn)?console.warn(e):O.isFunction(console.log)&&console.log(e))},V.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},V.prototype.logInternalMessage=function(e,n){var t=this;if(!t._areInternalMessagesThrottled()){var i=!0,r=t.AIInternalMessagePrefix+n.messageId;if(t._messageLogged[r]?i=!1:t._messageLogged[r]=!0,i&&(e<=t.telemetryLoggingLevel()&&(t.queue.push(n),t._messageCount++),t._messageCount===t.maxInternalMessageLimit())){var o="Internal events throttle limit per PageView reached for this app.",a=new z(k.MessageLimitPerPVExceeded,o,!1);t.queue.push(a),t.warnToConsole(o)}}},V.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},V);function V(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},O.isNullOrUndefined(e)||(O.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),O.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),O.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),O.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var W=O.isFunction,H=function(r,o){var a=this,s=null,l=W(r.processTelemetry),u=W(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,n){if(n=n||o,r&&l){a._hasRun=!0;try{n.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,n)}catch(i){var t=s&&s._hasRun;s&&t||n.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,k.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!t&&s.processTelemetry(e,n)}}else s&&(a._hasRun=!0,s.processTelemetry(e,n))}},K=O.isNullOrUndefined;function q(e,n){var t=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o=e[r];if(o&&O.isFunction(o.processTelemetry)){var a=new H(o,n);t.push(a),i&&i.setNext(a),i=a}}return 0<t.length?t[0]:null}var G=function _e(e,o,t,n){var i,r,a,s,l=this,u=null;null!==n&&(e&&O.isFunction(e.getPlugin)?u=function(e,n,t){var i=[],r=!t;if(e)for(;e;){var o=e.getPlugin();!r&&o!==t||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(t),q(i,n)}(e,l,n||e.getPlugin()):n?(i=l,a=e,s=!1,(r=n)&&e&&(a=[],O.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=q(a,i)):O.isUndefined(n)&&(u=q(e,l))),l.core=function(){return t},l.diagLog=function(){return(t||{}).logger||new Q(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,n){var t;if(void 0===n&&(n={}),o){var i=o.extensionConfig;i&&e&&(t=i[e])}return t||n},l.getConfig=function(e,n,t){var i;void 0===t&&(t=!1);var r=l.getExtCfg(e,null);return r&&!K(r[n])?i=r[n]:o&&!K(o[n])&&(i=o[n]),K(i)?t:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,l))},l.createNew=function(e,n){return void 0===e&&(e=null),new _e(e||u,o,t,n)}},J=O.isFunction,Z="getPlugin",Y=($.prototype.initialize=function(e,n,t,i){this._baseTelInit(e,n,t,i)},$);function $(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,n){n?n.processNext(e):l&&J(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n=e;if(!n){var t=s||new G(null,{},o.core);n=l&&l[Z]?t.createNew(null,l[Z]):t.createNew(null,l)}return n},o._baseTelInit=function(e,n,t,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&n&&(i=n.getProcessTelContext().getNext());var r=l;l&&l[Z]&&(r=l[Z]()),o.core=n,s=new G(i,e,n,r),a=!0}}var X=O.isFunction,ee="processTelemetry",ne="priority",te="setNextPlugin",ie="isInitialized";function re(n,t){for(var e=[],i=null,r=n.getNext();r;){var o=r.getPlugin();o&&(i&&X(i[te])&&X(o[ee])&&i[te](o),X(o[ie])&&o[ie]()||e.push(o),i=o,r=r.getNext())}O.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function oe(e){return e.sort(function(e,n){var t=0,i=X(n[ee]);return X(e[ee])?t=i?e[ne]-n[ne]:1:i&&(t=-1),t})}var ae=O.arrForEach,se=O.objDefineAccessors;function le(e,n){var t;n&&0<n.length&&(t=n=n.sort(function(e,n){return e.priority-n.priority}),ae(t,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(n))}var ue,ce=(e(fe,ue=Y),fe.prototype.processTelemetry=function(n,t){var i=this;this._channelQueue&&ae(this._channelQueue,function(e){0<e.length&&i._getTelCtx(t).createNew(e).processNext(n)})},fe.prototype.getChannelControls=function(){return this._channelQueue},fe.prototype.initialize=function(n,t,i){if(!this.isInitialized()){ue.prototype.initialize.call(this,n,t,i),n.isCookieUseDisabled&&O.disableCookies();var e=this._channelQueue=function(e,n){var t=[];if(e&&ae(e,function(e){return le(t,e)}),n){var i=[];ae(n,function(e){500<e.priority&&i.push(e)}),le(t,i)}return t}((n||{}).channels,i);ae(e,function(e){return re(new G(e,n,t),i)})}},fe._staticInit=(se(fe.prototype,"ChannelControls",fe.prototype.getChannelControls),void se(fe.prototype,"channelQueue",fe.prototype.getChannelControls)),fe);function fe(){var e=null!==ue&&ue.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var ge=O.arrForEach,de=O.isNullOrUndefined,pe=(he.prototype.initialize=function(e,n,i,t){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||de(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;t=t||O.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){}}),r._notificationManager=t,e.extensions=de(e.extensions)?[]:e.extensions,(e.extensionConfig=de(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,i=i||O.objCreate({throwInternal:function(e,n,t,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,n.concat(e.extensions)),a=oe(a);var s=[],l={};if(ge(a,function(e){if(de(e)||de(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(de(l[n])?l[n]=t:i.warnToConsole("Two extensions have same priority #"+n+" - "+l[n]+", "+t)),(!n||n<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=oe(a),r._extensions=a,re(new G([o],e,r),a),re(new G(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0)},he.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},he.prototype.track=function(e){var n=this;e.iKey||(e.iKey=n.config.instrumentationKey),e.time||(e.time=O.toISOString(new Date)),de(e.ver)&&(e.ver="4.0"),n.isInitialized()?(0<n._eventQueue.length&&(ge(n._eventQueue,function(e){n.getProcessTelContext().processNext(e)}),n._eventQueue=[]),n.getProcessTelContext().processNext(e)):n._eventQueue.push(e)},he.prototype.getProcessTelContext=function(){var e=this._extensions,n=e;return e&&0!==e.length||(n=[this._channelController]),new G(n,this.config,this)},he);function he(){var n=!1,e=this;e._extensions=[],e._channelController=new ce,e.isInitialized=function(){return n},e._setInit=function(e){n=e},e._eventQueue=[]}var ve=(ye.prototype.addNotificationListener=function(e){this.listeners.push(e)},ye.prototype.removeNotificationListener=function(e){for(var n=O.arrIndexOf(this.listeners,e);-1<n;)this.listeners.splice(n,1),n=O.arrIndexOf(this.listeners,e)},ye.prototype.eventsSent=function(n){for(var t=this,e=function(e){i.listeners[e].eventsSent&&setTimeout(function(){return t.listeners[e].eventsSent(n)},0)},i=this,r=0;r<this.listeners.length;++r)e(r)},ye.prototype.eventsDiscarded=function(n,t){for(var i=this,e=function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(n,t)},0)},r=this,o=0;o<this.listeners.length;++o)e(o)},ye);function ye(){this.listeners=[]}var me,xe=(e(Ce,me=pe),Ce.prototype.initialize=function(e,n){var t=this;t._notificationManager=new ve,t.logger=new Q(e),t.config=e,me.prototype.initialize.call(this,e,n,t.logger,t._notificationManager)},Ce.prototype.getTransmissionControls=function(){return me.prototype.getTransmissionControls.call(this)},Ce.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),me.prototype.track.call(this,e)},Ce.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},Ce.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},Ce.prototype.pollInternalLogs=function(i){var n=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var t=n,e=t.logger?t.logger.queue:[];O.arrForEach(e,function(e){var n={name:i||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:O.toISOString(new Date),baseType:z.dataType,baseData:{message:e.message}};t.track(n)}),e.length=0},e)},Ce.prototype._validateTelemetryItem=function(e){if(O.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},Ce.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],n.InvalidEvent)},Ce);function Ce(){return me.call(this)||this}var Te="_aiHooks",Ie=["req","rsp","hkErr","fnErr"];function we(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Ne(e,l,u,c,f){0<=f&&f<=2&&we(e,function(e,n){var t=e.cbks,i=t[Ie[f]];if(i){l.ctx=function(){return c[n]=c[n]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=t[Ie[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Se(e,n,t,i){if(void 0===i&&(i=!0),e&&n&&t){var r=function c(e,n,t){var i=null;return e&&(O.hasOwnProperty(e,n)?i=e:t&&(i=c(e[f],n,!1))),i}(e,n,i),o=r[n];if(typeof o===g){var a=o[Te];if(!a){var s=(u=a={i:0,n:n,f:o,h:[]},function(){var t=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,r=o([i],t)}},n=[],r=o([i],t);function o(n,e){return we(e,function(e){n.push(e)}),n}Ne(e,i,r,n,0);var a=u.f;try{i.rslt=a.apply(this,t)}catch(s){throw i.err=s,Ne(e,i,r,n,3),s}return Ne(e,i,r,n,1),i.rslt});s[Te]=a,r[n]=s}var l={id:a.i,cbks:t,rm:function(){var t=this.id;we(a.h,function(e,n){return e.id===t&&(a.h.splice(n,1),1)})}};return a.i++,a.h.push(l),l}}var u;return null}function be(t,e,i,r){void 0===r&&(r=!0);var o=null;return we(e,function(e){var n=Se(t,e,i,r);n&&(o=o||[]).push(n)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=n,c.AppInsightsCore=xe,c.BaseCore=pe,c.BaseTelemetryPlugin=Y,c.CoreUtils=O,c.EventHelper=U,c.Undefined=C,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=s,c.getGlobalInst=l,c.hasWindow=u,c.getWindow=d,c.hasDocument=p,c.getDocument=h,c.hasNavigator=v,c.getNavigator=function(){return v()?navigator:l("navigator")},c.hasHistory=y,c.getHistory=function(){return y()?history:l("history")},c.getLocation=function(){return typeof location===r&&location?location:l("location")},c.getPerformance=function(){return l("performance")},c.hasJSON=m,c.getJSON=x,c.strUndefined=t,c.strObject=r,c.strPrototype=f,c.strFunction=g,c.NotificationManager=ve,c.DiagnosticLogger=Q,c._InternalLogMessage=z,c.ProcessTelemetryContext=G,c.initializePlugins=re,c.sortPlugins=oe,c._InternalMessageId=k,c.InstrumentProto=function(e,n,t){return e?Se(e[f],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?be(e[f],n,t,!1):null},c.InstrumentFunc=Se,c.InstrumentFuncs=be,function(e,n,t){var i=Object.defineProperty;if(i)try{return i(e,n,t)}catch(r){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(c){"use strict";var r="function",o="object",n="undefined",a="prototype",s="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function i(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if(t!=o&&t!=r)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i[a]=e,new i}var l=function(e,n){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[s](t)&&(e[t]=n[t])})(e,n)},t=e()||{};__assign=t.__assign=t.__assign||Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object[a][s].call(n,r)&&(e[r]=n[r]);return e},__extends=t.__extends=t.__extends||function(e,n){function t(){this.constructor=e}l(e,n),e[a]=null===n?i(n):(t[a]=n[a],new t)};var u={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=o,d=a,h=r,p="window",v="JSON",y=e;function m(e){var n=y();return n&&n[e]?n[e]:e===p&&x()?window:null}function x(){return!(typeof window!==g||!window)}function C(){return x()?window:m(p)}function T(){return!(typeof document!==g||!document)}function I(){return T()?document:m("document")}function _(){return!(typeof navigator!==g||!navigator)}function w(){return!(typeof history!==g||!history)}function S(){return!!(typeof JSON===g&&JSON||null!==m(v))}function N(){return S()?JSON||m(v):null}var b=n,L="attachEvent",E="addEventListener",F="detachEvent",M="removeEventListener";function P(e,n){return typeof e===n}function A(e){return P(e,n)||e===undefined}function O(e){return A(e)||null===e}function D(e,n){return e&&Object[a].hasOwnProperty.call(e,n)}function R(e){return P(e,o)}function U(e){return P(e,r)}function j(e,n,t,i){void 0===i&&(i=!1);var r=!1;if(!O(e))try{O(e[E])?O(e[L])||(e[L]("on"+n,t),r=!0):(e[E](n,t,i),r=!0)}catch(o){}return r}function k(e,n,t,i){if(void 0===i&&(i=!1),!O(e))try{O(e[M])?O(e[F])||e[F]("on"+n,t):e[M](n,t,i)}catch(r){}}var z=(B.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},B.isString=function(e){return P(e,"string")},B.isNumber=function(e){return P(e,"number")},B.isBoolean=function(e){return P(e,"boolean")},B.disableCookies=function(){B._canUseCookies=!1},B.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Q,function(e){var n,t=0|((n=m("crypto"))?n.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?t:3&t|8).toString(16)})},B.toISOString=function(e){if(B.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},B.arrForEach=function(e,n,t){for(var i=e.length,r=0;r<i;++r)r in e&&n.call(t||e,e[r],r,e)},B.arrIndexOf=function(e,n,t){for(var i=e.length,r=t||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===n)return o;return-1},B.arrMap=function(e,n,t){for(var i=e.length,r=t||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=n.call(r,e[a],e));return o},B.arrReduce=function(e,n,t){var i,r=e.length,o=0;if(3<=arguments.length)i=t;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=n(i,e[o],o,e)),o++;return i},B.strTrim=function(e){return B.isString(e)?e.replace(/^\s+|\s+$/g,""):e},B.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(U(e)||R(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var i in e)D(e,i)&&t.push(i);if(n)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)D(e,r[a])&&t.push(r[a]);return t},B.objDefineAccessors=function(e,n,t,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),i&&(o.set=i),r(e,n,o),!0}catch(a){}return!1},B.addEventHandler=function(e,n){var t=!1,i=C();i&&(t=j(i,e,n),t=j(i.body,e,n)||t);var r=I();return r&&(t=V.Attach(r,e,n)||t),t},B.isTypeof=P,B.isUndefined=A,B.isNullOrUndefined=O,B.hasOwnProperty=D,B.isFunction=U,B.isObject=R,B.objCreate=i,B);function B(){}var q,Q=/[xy]/g,V=(W.Attach=j,W.AttachEvent=j,W.Detach=k,W.DetachEvent=k,W);function W(){}(q=c.LoggingSeverity||(c.LoggingSeverity={}))[q.CRITICAL=1]="CRITICAL",q[q.WARNING=2]="WARNING";var H={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99},K=(G.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},G.dataType="MessageData",G.AiNonUserActionablePrefix="AI (Internal): ",G.AiUserActionablePrefix="AI: ",G);function G(e,n,t,i){void 0===t&&(t=!1),this.messageId=e,this.message=(t?G.AiUserActionablePrefix:G.AiNonUserActionablePrefix)+e;var r="";S()&&(r=N().stringify(i));var o=(n?" message:"+G.sanitizeDiagnosticText(n):"")+(i?" props:"+G.sanitizeDiagnosticText(r):"");this.message+=o}var J=(Z.prototype.throwInternal=function(e,n,t,i,r){void 0===r&&(r=!1);var o,a=new K(n,t,r,i),s=this;if(s.enableDebugExceptions())throw a;!z.isUndefined(a)&&a&&(z.isUndefined(a.message)||(r?(o=+a.messageId,!s._messageLogged[o]&&s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(s.warnToConsole(a.message),s._messageLogged[o]=!0)):s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&s.warnToConsole(a.message),s.logInternalMessage(e,a)))},Z.prototype.warnToConsole=function(e){!z.isUndefined(console)&&console&&(z.isFunction(console.warn)?console.warn(e):z.isFunction(console.log)&&console.log(e))},Z.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},Z.prototype.logInternalMessage=function(e,n){var t,i,r,o=this;o._areInternalMessagesThrottled()||(t=!0,i=o.AIInternalMessagePrefix+n.messageId,o._messageLogged[i]?t=!1:o._messageLogged[i]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),o._messageCount++),o._messageCount===o.maxInternalMessageLimit()&&(r=new K(H.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),o.warnToConsole("Internal events throttle limit per PageView reached for this app."))))},Z.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},Z);function Z(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},z.isNullOrUndefined(e)||(z.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),z.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),z.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),z.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var $=z.isFunction,Y=function(r,o){var a=this,s=null,l=$(r.processTelemetry),u=$(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,n){if(n=n||o,r&&l){a._hasRun=!0;try{n.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,n)}catch(i){var t=s&&s._hasRun;s&&t||n.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,H.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!t&&s.processTelemetry(e,n)}}else s&&(a._hasRun=!0,s.processTelemetry(e,n))}},X=z.isNullOrUndefined;function ee(e,n){var t=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o,a=e[r];a&&z.isFunction(a.processTelemetry)&&(o=new Y(a,n),t.push(o),i&&i.setNext(o),i=o)}return 0<t.length?t[0]:null}var ne=function Oe(e,o,t,n){var i,r,a,s,l=this,u=null;null!==n&&(e&&z.isFunction(e.getPlugin)?u=function(e,n,t){var i=[],r=!t;if(e)for(;e;){var o=e.getPlugin();!r&&o!==t||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(t),ee(i,n)}(e,l,n||e.getPlugin()):n?(i=l,a=e,s=!1,(r=n)&&e&&(a=[],z.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=ee(a,i)):z.isUndefined(n)&&(u=ee(e,l))),l.core=function(){return t},l.diagLog=function(){return(t||{}).logger||new J(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,n){var t,i;return void 0===n&&(n={}),!o||(i=o.extensionConfig)&&e&&(t=i[e]),t||n},l.getConfig=function(e,n,t){var i;void 0===t&&(t=!1);var r=l.getExtCfg(e,null);return r&&!X(r[n])?i=r[n]:o&&!X(o[n])&&(i=o[n]),X(i)?t:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,l))},l.createNew=function(e,n){return void 0===e&&(e=null),new Oe(e||u,o,t,n)}},te=z.isFunction,ie="getPlugin",re=(oe.prototype.initialize=function(e,n,t,i){this._baseTelInit(e,n,t,i)},oe);function oe(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,n){n?n.processNext(e):l&&te(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n,t=e;return t||(n=s||new ne(null,{},o.core),t=l&&l[ie]?n.createNew(null,l[ie]):n.createNew(null,l)),t},o._baseTelInit=function(e,n,t,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&n&&(i=n.getProcessTelContext().getNext());var r=l;l&&l[ie]&&(r=l[ie]()),o.core=n,s=new ne(i,e,n,r),a=!0}}var ae=z.isFunction,se="processTelemetry",le="priority",ue="setNextPlugin",ce="isInitialized";function fe(n,t){for(var e=[],i=null,r=n.getNext();r;){var o=r.getPlugin();o&&(i&&ae(i[ue])&&ae(o[se])&&i[ue](o),ae(o[ce])&&o[ce]()||e.push(o),i=o,r=r.getNext())}z.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function ge(e){return e.sort(function(e,n){var t=0,i=ae(n[se]);return ae(e[se])?t=i?e[le]-n[le]:1:i&&(t=-1),t})}var de=z.arrForEach,he=z.objDefineAccessors;function pe(e,n){n&&0<n.length&&(n=n.sort(function(e,n){return e.priority-n.priority}),de(n,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(n))}var ve,ye=(ve=re,__extends(me,ve),me.prototype.processTelemetry=function(n,t){var i=this;this._channelQueue&&de(this._channelQueue,function(e){0<e.length&&i._getTelCtx(t).createNew(e).processNext(n)})},me.prototype.getChannelControls=function(){return this._channelQueue},me.prototype.initialize=function(n,t,i){var e,r,o,a,s;this.isInitialized()||(ve.prototype.initialize.call(this,n,t,i),n.isCookieUseDisabled&&z.disableCookies(),e=this._channelQueue=(o=i,s=[],(r=(n||{}).channels)&&de(r,function(e){return pe(s,e)}),o&&(a=[],de(o,function(e){500<e.priority&&a.push(e)}),pe(s,a)),s),de(e,function(e){return fe(new ne(e,n,t),i)}))},me._staticInit=(he(me.prototype,"ChannelControls",me.prototype.getChannelControls),void he(me.prototype,"channelQueue",me.prototype.getChannelControls)),me);function me(){var e=null!==ve&&ve.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var xe=z.arrForEach,Ce=z.isNullOrUndefined,Te=(Ie.prototype.initialize=function(e,n,i,t){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Ce(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;t=t||z.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),r._notificationManager=t,e.extensions=Ce(e.extensions)?[]:e.extensions,(e.extensionConfig=Ce(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,i=i||z.objCreate({throwInternal:function(e,n,t,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,n.concat(e.extensions)),a=ge(a);var s=[],l={};if(xe(a,function(e){if(Ce(e)||Ce(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(Ce(l[n])?l[n]=t:i.warnToConsole("Two extensions have same priority #"+n+" - "+l[n]+", "+t)),(!n||n<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=ge(a),r._extensions=a,fe(new ne([o],e,r),a),fe(new ne(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0)},Ie.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ie.prototype.track=function(e){var n=this;e.iKey||(e.iKey=n.config.instrumentationKey),e.time||(e.time=z.toISOString(new Date)),Ce(e.ver)&&(e.ver="4.0"),n.isInitialized()?(0<n._eventQueue.length&&(xe(n._eventQueue,function(e){n.getProcessTelContext().processNext(e)}),n._eventQueue=[]),n.getProcessTelContext().processNext(e)):n._eventQueue.push(e)},Ie.prototype.getProcessTelContext=function(){var e=this._extensions,n=e;return e&&0!==e.length||(n=[this._channelController]),new ne(n,this.config,this)},Ie);function Ie(){var n=!1,e=this;e._extensions=[],e._channelController=new ye,e.isInitialized=function(){return n},e._setInit=function(e){n=e},e._eventQueue=[]}var _e=(we.prototype.addNotificationListener=function(e){this.listeners.push(e)},we.prototype.removeNotificationListener=function(e){for(var n=z.arrIndexOf(this.listeners,e);-1<n;)this.listeners.splice(n,1),n=z.arrIndexOf(this.listeners,e)},we.prototype.eventsSent=function(n){for(var t=this,i=this,e=0;e<this.listeners.length;++e)!function(e){i.listeners[e].eventsSent&&setTimeout(function(){return t.listeners[e].eventsSent(n)},0)}(e)},we.prototype.eventsDiscarded=function(n,t){for(var i=this,r=this,e=0;e<this.listeners.length;++e)!function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(n,t)},0)}(e)},we.prototype.eventsSendRequest=function(t,i){for(var r=this,o=this,e=0;e<this.listeners.length;++e)!function(e){if(o.listeners[e].eventsSendRequest)if(i)setTimeout(function(){return r.listeners[e].eventsSendRequest(t,i)},0);else try{o.listeners[e].eventsSendRequest(t,i)}catch(n){}}(e)},we);function we(){this.listeners=[]}var Se,Ne=(Se=Te,__extends(be,Se),be.prototype.initialize=function(e,n){var t=this;t._notificationManager=new _e,t.logger=new J(e),t.config=e,Se.prototype.initialize.call(this,e,n,t.logger,t._notificationManager)},be.prototype.getTransmissionControls=function(){return Se.prototype.getTransmissionControls.call(this)},be.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Se.prototype.track.call(this,e)},be.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},be.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},be.prototype.pollInternalLogs=function(i){var n=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var t=n,e=t.logger?t.logger.queue:[];z.arrForEach(e,function(e){var n={name:i||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:z.toISOString(new Date),baseType:K.dataType,baseData:{message:e.message}};t.track(n)}),e.length=0},e)},be.prototype._validateTelemetryItem=function(e){if(z.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},be.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u.InvalidEvent)},be);function be(){return Se.call(this)||this}var Le="_aiHooks",Ee=["req","rsp","hkErr","fnErr"];function Fe(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Me(e,l,u,c,f){0<=f&&f<=2&&Fe(e,function(e,n){var t=e.cbks,i=t[Ee[f]];if(i){l.ctx=function(){return c[n]=c[n]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=t[Ee[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Pe(e,n,t,i){if(void 0===i&&(i=!0),e&&n&&t){var r=function c(e,n,t){var i=null;return e&&(z.hasOwnProperty(e,n)?i=e:t&&(i=c(e[d],n,!1))),i}(e,n,i),o=r[n];if(typeof o===h){var a,s=o[Le];s||(u=s={i:0,n:n,f:o,h:[]},(a=function(){var t=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,r=o([i],t)}},n=[],r=o([i],t);function o(n,e){return Fe(e,function(e){n.push(e)}),n}Me(e,i,r,n,0);var a=u.f;try{i.rslt=a.apply(this,t)}catch(s){throw i.err=s,Me(e,i,r,n,3),s}return Me(e,i,r,n,1),i.rslt})[Le]=s,r[n]=a);var l={id:s.i,cbks:t,rm:function(){var t=this.id;Fe(s.h,function(e,n){return e.id===t&&(s.h.splice(n,1),1)})}};return s.i++,s.h.push(l),l}}var u;return null}function Ae(t,e,i,r){void 0===r&&(r=!0);var o=null;return Fe(e,function(e){var n=Pe(t,e,i,r);n&&(o=o||[]).push(n)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=u,c.AppInsightsCore=Ne,c.BaseCore=Te,c.BaseTelemetryPlugin=re,c.CoreUtils=z,c.EventHelper=V,c.Undefined=b,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=y,c.getGlobalInst=m,c.hasWindow=x,c.getWindow=C,c.hasDocument=T,c.getDocument=I,c.hasNavigator=_,c.getNavigator=function(){return _()?navigator:m("navigator")},c.hasHistory=w,c.getHistory=function(){return w()?history:m("history")},c.getLocation=function(){return typeof location===g&&location?location:m("location")},c.getPerformance=function(){return m("performance")},c.hasJSON=S,c.getJSON=N,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=h,c.NotificationManager=_e,c.DiagnosticLogger=J,c._InternalLogMessage=K,c.ProcessTelemetryContext=ne,c.initializePlugins=fe,c.sortPlugins=ge,c._InternalMessageId=H,c.InstrumentProto=function(e,n,t){return e?Pe(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?Ae(e[d],n,t,!1):null},c.InstrumentFunc=Pe,c.InstrumentFuncs=Ae,function(e,n,t){var i=Object.defineProperty;if(i)try{return i(e,n,t)}catch(r){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-core-js.min.js.map
{
"name": "@microsoft/applicationinsights-core-js",
"author": "Microsoft Corporation",
"version": "2.5.4",
"version": "2.5.5",
"description": "Microsoft Application Insights Core Javascript SDK",

@@ -49,5 +49,5 @@ "keywords": [

"dependencies": {
"@microsoft/dynamicproto-js": "^0.5.2",
"tslib": "^1.11.1"
"@microsoft/applicationinsights-shims" : "1.0.0",
"@microsoft/dynamicproto-js": "^0.5.2"
}
}

@@ -95,4 +95,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

SendBrowserInfoOnUserInit: 72,
PluginException: 73
PluginException: 73,
NotificationException: 74,
SnippetScriptLoadFailure: 99
};
export type _InternalMessageId = number | typeof _InternalMessageId;

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

eventsDiscarded?: (events: ITelemetryItem[], reason: number) => void;
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
eventsSendRequest?: (sendReason: number, isAsync?: boolean) => void;
}

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

import { INotificationListener } from "../JavaScriptSDK.Interfaces/INotificationListener";
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";

@@ -38,2 +39,9 @@ /**

eventsDiscarded(events: ITelemetryItem[], reason: number): void;
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
eventsSendRequest?(sendReason: number, isAsync: boolean): void;
}

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

import { _InternalMessageId, LoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
import { SendRequestReason } from "../JavaScriptSDK.Enums/SendRequestReason";

@@ -69,4 +70,5 @@ const validationError = "Extensions must provide callback to initialize";

eventsSent: (events: ITelemetryItem[]) => { },
eventsDiscarded: (events: ITelemetryItem[], reason: number) => { }
})
eventsDiscarded: (events: ITelemetryItem[], reason: number) => { },
eventsSendRequest: (sendReason: number, isAsync: boolean) => { }
});
}

@@ -73,0 +75,0 @@

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
import { getWindow, getDocument, strUndefined, strObject, strFunction, strPrototype } from './EnvUtils';
import { objCreateFn, strShimObject, strShimUndefined, strShimFunction, strShimPrototype } from "@microsoft/applicationinsights-shims";
import { getWindow, getDocument, getGlobalInst, getCrypto } from './EnvUtils';
// Added to help with minfication
export const Undefined = strUndefined;
export const Undefined = strShimUndefined;
const strOnPrefix = "on";

@@ -19,3 +20,3 @@ const strAttachEvent = "attachEvent";

function _isUndefined(value: any): boolean {
return _isTypeof(value, strUndefined) || value === undefined;
return _isTypeof(value, strShimUndefined) || value === undefined;
};

@@ -27,12 +28,12 @@

function _hasOwnProperty(obj:any, prop:string): boolean {
return obj && Object[strPrototype].hasOwnProperty.call(obj, prop);
function _hasOwnProperty(obj: any, prop: string): boolean {
return obj && Object[strShimPrototype].hasOwnProperty.call(obj, prop);
};
function _isObject(value: any): boolean {
return _isTypeof(value, strObject);
return _isTypeof(value, strShimObject);
};
function _isFunction(value: any): boolean {
return _isTypeof(value, strFunction);
return _isTypeof(value, strShimFunction);
};

@@ -48,3 +49,3 @@

*/
function _attachEvent(obj:any, eventNameWithoutOn:string, handlerRef:any, useCapture:boolean = false) {
function _attachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture: boolean = false) {
let result = false;

@@ -77,3 +78,3 @@ if (!_isNullOrUndefined(obj)) {

*/
function _detachEvent(obj:any, eventNameWithoutOn:string, handlerRef:any, useCapture:boolean = false) {
function _detachEvent(obj: any, eventNameWithoutOn: string, handlerRef: any, useCapture: boolean = false) {
if (!_isNullOrUndefined(obj)) {

@@ -99,3 +100,3 @@ try {

*/
export function normalizeJsName(name:string):string {
export function normalizeJsName(name: string): string {
let value = name;

@@ -105,3 +106,3 @@ let match = /([^\w\d_$])/g;

value = name.replace(match, "_");
}
}

@@ -114,10 +115,10 @@ return value;

public static isTypeof:(value: any, theType: string) => boolean = _isTypeof;
public static isUndefined:(value: any) => boolean = _isUndefined;
public static isNullOrUndefined:(value: any) => boolean = _isNullOrUndefined;
public static hasOwnProperty:(obj:any, prop:string) => boolean = _hasOwnProperty;
public static isTypeof: (value: any, theType: string) => boolean = _isTypeof;
public static isUndefined: (value: any) => boolean = _isUndefined;
public static isNullOrUndefined: (value: any) => boolean = _isNullOrUndefined;
public static hasOwnProperty: (obj: any, prop: string) => boolean = _hasOwnProperty;
/**

@@ -128,3 +129,3 @@ * Checks if the passed of value is a function.

*/
public static isFunction:(value: any) => boolean = _isFunction;
public static isFunction: (value: any) => boolean = _isFunction;

@@ -136,3 +137,3 @@ /**

*/
public static isObject:(value: any) => boolean = _isObject;
public static isObject: (value: any) => boolean = _isObject;

@@ -143,3 +144,3 @@ /**

public static isDate(obj: any): boolean {
return Object[strPrototype].toString.call(obj) === "[object Date]";
return Object[strShimPrototype].toString.call(obj) === "[object Date]";
}

@@ -183,6 +184,14 @@

public static newGuid():  string  {
return  'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex,  (c) => {
const  r  =  (Math.random()  *  16  |  0),  v  =  (c  ===  'x'  ?  r  :  r  &  0x3  |  0x8);
return  v.toString(16);
public static newGuid(): string {
function randomHexDigit() {
let c = getCrypto();
if (c) {
return (c.getRandomValues(new Uint8Array(1))[0] % 16);
}
return Math.random() * 16;
}
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(GuidRegex, (c) => {
const r = (randomHexDigit() | 0), v = (c === 'x' ? r : r & 0x3 | 0x8);
return v.toString(16);
});

@@ -224,3 +233,3 @@ }

*/
public static arrForEach<T>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => void, thisArg?: any):void {
public static arrForEach<T>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => void, thisArg?: any): void {
let len = arr.length;

@@ -262,7 +271,7 @@ for (let idx = 0; idx < len; ++idx) {

*/
public static arrMap<T,R>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => R, thisArg?: any): R[] {
public static arrMap<T, R>(arr: T[], callbackfn: (value: T, index?: number, array?: T[]) => R, thisArg?: any): R[] {
let len = arr.length;
let _this = thisArg || arr;
let results = new Array(len);
for (let lp = 0; lp < len; lp++) {

@@ -285,3 +294,3 @@ if (lp in arr) {

*/
public static arrReduce<T,R>(arr: T[], callbackfn: (previousValue: T|R, currentValue?: T, currentIndex?: number, array?: T[]) => R, initialValue?: R): R {
public static arrReduce<T, R>(arr: T[], callbackfn: (previousValue: T | R, currentValue?: T, currentIndex?: number, array?: T[]) => R, initialValue?: R): R {
let len = arr.length;

@@ -313,2 +322,13 @@ let lp = 0;

/**
* helper method to trim strings (IE8 does not implement String.prototype.trim)
*/
public static strTrim(str: any): string {
if (!CoreUtils.isString(str)) {
return str;
}
return str.replace(/^\s+|\s+$/g, "");
}
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil

@@ -319,17 +339,5 @@ * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.

*/
public static objCreate(obj:object):any {
if (obj == null) {
return {};
}
// tslint:disable-next-line: member-ordering
public static objCreate:(obj: object) => any = objCreateFn;
if (!_isObject(obj) && !_isFunction(obj)) {
throw new TypeError('Object prototype may only be an Object: ' + obj)
}
function tmpFunc() {};
tmpFunc[strPrototype] = obj;
return new (tmpFunc as any)();
}
/**

@@ -341,3 +349,3 @@ * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers

*/
public static objKeys(obj: {}): string[] {
public static objKeys(obj: {}): string[] {
var hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString');

@@ -349,4 +357,4 @@

let result:string[] = [];
let result: string[] = [];
for (let prop in obj) {

@@ -369,3 +377,3 @@ if (_hasOwnProperty(obj, prop)) {

let dontEnumsLength = dontEnums.length;
for (let lp = 0; lp < dontEnumsLength; lp++) {

@@ -391,7 +399,7 @@ if (_hasOwnProperty(obj, dontEnums[lp])) {

*/
public static objDefineAccessors<T>(target:any, prop:string, getProp?:() => T, setProp?: (v:T) => void) : boolean {
public static objDefineAccessors<T>(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean {
let defineProp = Object["defineProperty"];
if (defineProp) {
try {
let descriptor:PropertyDescriptor = {
let descriptor: PropertyDescriptor = {
enumerable: true,

@@ -452,3 +460,3 @@ configurable: true

*/
public static Attach:(obj:any, eventNameWithoutOn:string, handlerRef:any) => boolean = _attachEvent;
public static Attach: (obj: any, eventNameWithoutOn: string, handlerRef: any) => boolean = _attachEvent;

@@ -463,3 +471,3 @@ /**

*/
public static AttachEvent:(obj:any, eventNameWithoutOn:string, handlerRef:any) => boolean = _attachEvent;
public static AttachEvent: (obj: any, eventNameWithoutOn: string, handlerRef: any) => boolean = _attachEvent;

@@ -472,3 +480,3 @@ /**

*/
public static Detach:(obj:any, eventNameWithoutOn:string, handlerRef:any) => void = _detachEvent;
public static Detach: (obj: any, eventNameWithoutOn: string, handlerRef: any) => void = _detachEvent;

@@ -482,3 +490,3 @@ /**

*/
public static DetachEvent:(obj:any, eventNameWithoutOn:string, handlerRef:any) => void = _detachEvent;
public static DetachEvent: (obj: any, eventNameWithoutOn: string, handlerRef: any) => void = _detachEvent;
}

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

import {
getGlobal as shimsGetGlobal, strShimUndefined, strShimObject, strShimPrototype, strShimFunction
} from "@microsoft/applicationinsights-shims";
/**

@@ -13,6 +17,6 @@ * This file exists to hold environment utilities that are requied to check and

export const strUndefined = "undefined";
export const strObject = "object";
export const strPrototype = "prototype";
export const strFunction = "function";
export const strUndefined = strShimUndefined;
export const strObject = strShimObject;
export const strPrototype = strShimPrototype;
export const strFunction = strShimFunction;

@@ -26,7 +30,4 @@ const strWindow = "window";

const strJSON = "JSON";
const strCrypto = "crypto";
// To address compile time errors declaring these here
declare var globalThis: Window;
declare var global: Window;
/**

@@ -44,22 +45,4 @@ * Returns the current global scope object, for a normal web page this will be the current

*/
export function getGlobal(): Window {
if (typeof globalThis !== strUndefined && globalThis) {
return globalThis;
}
export const getGlobal:() => Window = shimsGetGlobal;
if (typeof self !== strUndefined && self) {
return self;
}
if (typeof window !== strUndefined && window) {
return window;
}
if (typeof global !== strUndefined && global) {
return global;
}
return null;
}
/**

@@ -227,1 +210,10 @@ * Return the named global object if available, will return null if the object is not available.

}
/**
* Returns the crypto object if it is present otherwise null.
* This helper is used to access the crypto object from the current
* global instance which could be window or globalThis for a web worker
*/
export function getCrypto(): Crypto | null {
return getGlobalInst(strCrypto);
}

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

import { INotificationManager } from './../JavaScriptSDK.Interfaces/INotificationManager';
import { SendRequestReason } from '../JavaScriptSDK.Enums/SendRequestReason';
import { CoreUtils } from "./CoreUtils";

@@ -60,2 +61,23 @@

}
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
eventsSendRequest?(sendReason: number, isAsync: boolean): void {
for (let i: number = 0; i < this.listeners.length; ++i) {
if (this.listeners[i].eventsSendRequest) {
if (isAsync) {
setTimeout(() => this.listeners[i].eventsSendRequest(sendReason, isAsync), 0);
} else {
try {
this.listeners[i].eventsSendRequest(sendReason, isAsync);
} catch (e) {
// Catch errors to ensure we don't block sending the requests
}
}
}
}
}
}

@@ -10,3 +10,3 @@ {

"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"importHelpers": false,
"noEmitHelpers": true,

@@ -13,0 +13,0 @@ "alwaysStrict": true,

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

import '@microsoft/applicationinsights-shims';
export { IConfiguration } from "./JavaScriptSDK.Interfaces/IConfiguration";

@@ -12,2 +13,3 @@ export { IChannelControls, MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";

export { EventsDiscardedReason } from "./JavaScriptSDK.Enums/EventsDiscardedReason";
export { SendRequestReason } from "./JavaScriptSDK.Enums/SendRequestReason";
export { AppInsightsCore } from "./JavaScriptSDK/AppInsightsCore";

@@ -14,0 +16,0 @@ export { BaseCore } from './JavaScriptSDK/BaseCore';

@@ -89,3 +89,5 @@ export declare enum LoggingSeverity {

PluginException: number;
NotificationException: number;
SnippetScriptLoadFailure: number;
};
export declare type _InternalMessageId = number | typeof _InternalMessageId;

@@ -19,2 +19,8 @@ import { ITelemetryItem } from "./ITelemetryItem";

eventsDiscarded?: (events: ITelemetryItem[], reason: number) => void;
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
eventsSendRequest?: (sendReason: number, isAsync?: boolean) => void;
}

@@ -30,2 +30,8 @@ import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";

eventsDiscarded(events: ITelemetryItem[], reason: number): void;
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
eventsSendRequest?(sendReason: number, isAsync: boolean): void;
}

@@ -97,2 +97,6 @@ export declare const Undefined = "undefined";

/**
* helper method to trim strings (IE8 does not implement String.prototype.trim)
*/
static strTrim(str: any): string;
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil

@@ -103,3 +107,3 @@ * for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation.

*/
static objCreate(obj: object): any;
static objCreate: (obj: object) => any;
/**

@@ -106,0 +110,0 @@ * Returns the names of the enumerable string properties and methods of an object. This helper exists to avoid adding a polyfil for older browsers

@@ -23,3 +23,3 @@ /**

*/
export declare function getGlobal(): Window;
export declare const getGlobal: () => Window;
/**

@@ -112,1 +112,7 @@ * Return the named global object if available, will return null if the object is not available.

export declare function getJSON(): JSON | null;
/**
* Returns the crypto object if it is present otherwise null.
* This helper is used to access the crypto object from the current
* global instance which could be window or globalThis for a web worker
*/
export declare function getCrypto(): Crypto | null;

@@ -31,2 +31,8 @@ import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";

eventsDiscarded(events: ITelemetryItem[], reason: number): void;
/**
* [Optional] A function called when the events have been requested to be sent to the sever.
* @param {number} sendReason - The reason why the event batch is being sent.
* @param {boolean} isAsync - A flag which identifies whether the requests are being sent in an async or sync manner.
*/
eventsSendRequest?(sendReason: number, isAsync: boolean): 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 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 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